diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml deleted file mode 100644 index 70239a094fd32..0000000000000 --- a/.c3i/authorized_users.yml +++ /dev/null @@ -1,1252 +0,0 @@ -authorized_users: -- github-actions[bot] -- conan-center-bot -- c3i-dev -- uilianries -- SSE4 -- Croydon -- Johnnyxy -- solvingj -- ericLemanissier -- tru -- sztomi -- theodelrieu -- grafikrobot -- piponazo -- minimonium -- lasote -- danimtb -- memsharded -- jgsogo -- czoido -- jcar87 -- theirix -- madebr -- sourcedelica -- obiltschnig -- martinmoene -- tonka3000 -- leonardoarcari -- bmanga -- flexferrum -- gocarlos -- flostellbrink -- rvarago -- cqjjjzr -- akemimadoka -- bverhagen -- IceflowRE -- mjvk -- Morwenn -- Talkless -- sgiessl -- KristianJerpetjon -- paulbendixen -- datalogics-robb -- PinkySan -- keysight-daryl -- rdeterre -- Hopobcn -- rikdev -- arcadien -- aostrowski -- reneme -- abbyssoul -- ledocc -- fpelliccioni -- PierreRamoin -- soporide -- detwiler -- hrantzsch -- figroc -- robert-shade -- KaoCC -- planetmarshall -- cirla -- vaerizk -- Dattax -- TimSimpson -- intelligide -- ericriff -- renatofilho -- puetzk -- calvingiles -- raffienficiaud -- chfanghr -- dvirtz -- greenjava -- apeterson-branch -- david-sinuela-pix4d -- BlueSolei -- AndWass -- SpaceIm -- yssource -- dheater -- GavinNL -- sourcedelica -- kf6kjg -- StefansM -- Psy-Kai -- LunarWatcher -- nicoguillier -- a4z -- p-podsiadly -- tarc -- n-bes -- Manu343726 -- greenrobot -- KingKili -- Adnn -- arnesor -- gummif -- btashton -- osfd -- maddanio -- likle -- mbodmer -- feragon -- claremacrae -- samuelpmish -- Garcia6l20 -- pleroux0 -- qchateau -- datalogics-kam -- tt4g -- akshit-sharma -- xqp -- alnkpa -- prince-chrismc -- igl42 -- casabre -- Nipheris -- faker00t -- vvilpas -- fredrikslattman -- worldemar -- rurabori -- chhitz -- zod -- Twon -- miketsukerman -- dab0bby -- atilag -- floriansimon1 -- jjkoshy -- kasunch -- mapau -- igor-sadchenko -- fulara -- pyrige -- ZaMaZaN4iK -- rudolfheszele -- philburr -- vishsangale -- Artalus -- vanwinkeljan -- renatoGarcia -- Nekto89 -- gonestco -- xyz1001 -- axalon900 -- jfalcou -- pss146 -- zhenlei -- datalogics-aarroyo -- serpent7776 -- AndrewMeadows -- neobrain -- oxycoder -- dvd0101 -- anagno -- odygrd -- datalogics-kam -- ChaosWars -- ash7777 -- csch0 -- daixian -- Murazaki -- garethsb-sony -- Austin299792 -- FranckRJ -- danielaparker -- 0x8000-0000 -- ah7675 -- jmarrec -- icraggs -- davidtazy -- kchmck -- PavelKisliak -- vvandrounik -- pavanbadugu -- isnullxbh -- Michanne -- syoliver -- daravi -- museghost -- pezcode -- hnOsmium0001 -- kaihowl -- deimi -- tomlankhorst -- frek818 -- ddalcino -- saukijan -- sandro97git -- hoxnox -- madduci -- goranbrkic -- mohamedghita -- rweickelt -- faithfracture -- wolfee001 -- empyrical -- birgerbr -- akosik-anyvision -- jeremy-coulon -- TheStormN -- gmgunter -- ibmibmibm -- daniellecandid -- AGreat1 -- ytimenkov -- memchk -- lederernc -- lkotsonis -- DrewImm -- martin-schulze-vireso -- wdobbe -- Flow-It -- burace17 -- sam-mosleh -- db4 -- jaspervandeven -- DavidZemon -- yelu -- bibermann -- baltendorf -- Eremiell -- d70-t -- ufkesba -- frtru -- Janos95 -- siebenschlaefer -- marzer -- timblechmann -- dBagrat -- lemire -- talyz -- rconde01 -- SemyonDuB -- reuk -- ppetraki -- ZachClayburn -- SergiusTheBest -- kirandivekar -- jaredkeithwhite -- DavidAce -- zhangyoufu -- nqle -- rushikesh90 -- marcvilletard -- klimkin -- jheaff1 -- Bigpet -- derived-coder -- thclark -- sielicki -- helmesjo -- dskachan -- johanneskares -- GirtsR -- greeng3 -- mattgodbolt -- mathbunnyru -- TheLavaBlock -- greeng3 -- ItsBasi -- yamadapc -- afedechko -- pmqtt -- uyha -- GIGte -- ctapmex -- ohanar -- bernedom -- ericniebler -- mmha -- mjvankampen -- ivan-kulikov-dev -- ntagliani -- Alberto-Izquierdo -- an-tao -- p-ranav -- omaralvarez -- djcsdy -- pepsiman -- Fefer-Ivan -- iblancasa -- dongskyler -- MartinDelille -- samr -- cen1 -- stefan-floeren -- oleurodecision -- tbeu -- joxoby -- halfelf -- matt-42 -- sunnycase -- ldobinson -- xiaotianrandom -- mpusz -- Erlkoenig90 -- mzdun -- annulen -- fmorgner -- gmikhaile -- wwhuie -- kyllingstad -- desertfury -- yarrr-ru -- fschoenm -- bel2125 -- melak47 -- b1ackviking -- remysalim -- hosseinmoein -- illume -- srnwk -- boussaffawalid -- atrelinski -- Arenoros -- narcdev -- steinerthomas -- w4bremer -- ddark008 -- andioz -- OleksiiKyslynskyi -- verybigbadboy -- bobrofon -- newlawrence -- ThomasHauth -- nicraMarcin -- dankamongmen -- davehadley -- G3nna -- dertuxmalwieder -- arlyon -- remiburtin -- mplemay -- mys007 -- jwellbelove -- gopaldappdev -- ngrodzitski -- spjuanjoc -- hongyx11 -- morth -- selaci -- hdhauk -- libbylg -- cacay -- fatliverfreddy -- dnck -- balintfodor -- blackliner -- HeinrichJanzing -- Nick-Deubert-Bose -- ruanformigoni -- CAMOBAP -- jwillikers -- bowb -- dsakurai -- dooho-h -- dmn-star -- avantgardnerio -- ShuangLiu1992 -- justinmcbride -- resttime -- ubnt-kannan -- taoyouh -- skannan89 -- AndreyMlashkin -- AndyMender -- Woazim -- shubhamck -- Lukas-Heiligenbrunner -- marius-meissner -- Mikayex -- n-stone -- IvanRibakov -- dfontenot -- JonasProgrammer -- plopp -- sebastian-bergt -- xguerin -- Dobiasd -- ChGen -- Jonathan-Eid -- ihsandemir -- Marks101 -- jiangdawhy -- MichelleHetzel -- Pro -- petiaccja -- Expander -- kdsx -- wolfram77 -- dsakilesh -- mdavezac -- Jihadist -- anton-danielsson -- rawbby -- wuzhiguocarter -- GaryN4 -- TheSalvator -- fcelda -- toge -- blackencino -- lukaszlaszko -- pichi-router -- dernasherbrezon -- bsergean -- krzysztof-jusiak -- riebl -- ruilvo -- jhurliman -- ralfholly -- MaxSac -- Linux13524 -- IanE9 -- upsj -- Hippskill -- ksamelyuk -- doshisahil -- FlayaN -- uglyog -- alex-87 -- mologie -- ChatPion -- heyzooi -- Firefly35 -- maxmouchet -- dvj -- bitwizeshift -- ondrej-outrata -- rileylev -- ltjax -- sloriot -- wbitesi -- canmor -- whyman -- garethsb -- sixten-hilborn -- qoelet -- lawrence-koh -- adrianjrg -- ayeganov -- tetsuo-cpp -- AlvaroFS -- ivabrajer -- kebadopp -- qoo2p5 -- aapocketz -- mbeutel -- redradist -- accwebs -- ZombieRaccoon -- hoyes -- rtosman -- ivalery111 -- krsch -- jothepro -- Jean1995 -- tomas-krupa -- ollien -- tupini07 -- yuanliuus -- luismartingil -- mydatamodels -- pixsperdavid -- rockdreamer -- jpilet -- voidbar -- jayaramganapathy -- AJIOB -- th-lp -- penfeizhou -- tapia -- igormironchik -- rkozakban -- avsej -- jakecobb -- johnmcfarlane -- FernandoVelcic -- LHLaurini -- dotChris90 -- mymichu -- i-vovk -- lakinwecker -- hpesoj -- shiena -- aurelienpre -- lieser -- zspasztori -- HRenata -- alejandro-colomar -- leha-bot -- werto87 -- cguentherTUChemnitz -- mmatrosov -- cesenaLA -- chgans -- sabelka -- stefled -- PengZheng -- mez -- beckerhe -- serszab -- mtrzas -- zuut -- JohanZackrisson -- VladimirVR -- franramirez688 -- nicholas-kelly -- yemreinci -- alvarogarcia7 -- daniele77 -- Renari -- AlexanderLanin -- Guyutongxue -- rockandsalt -- thmahe -- slietzau -- fennibay -- Konard -- uselessgoddess -- espositofulvio -- Elnee -- tisonkun -- AshleyRoll -- inparallel -- vcampmany -- thesummer -- NolanC33 -- Chnossos -- spaque-qustodio -- maxis11 -- cqc-alec -- Zugzwanger -- maspri -- ghorbanzade -- pchamuczynski -- Sahnvour -- torfinnberset -- davidsanfal -- COM8 -- seladb -- vvarma -- smsm2014 -- jngrb -- dilawar -- cbachhuber -- mmatisko -- sparik -- samuel-emrys -- lordafzal -- jayvdb -- wwizz -- sh0 -- jtorresfabra -- Snowapril -- ryanseipp -- exief -- Lemiort -- tcanabrava -- k0ekk0ek -- gerd2s -- Divix55 -- hannahwhy -- zodinyac -- claudius-kienle -- choll -- erikzenker -- Jairard -- Nicky-D -- pgeler -- gmeeker -- gokhanettin -- emwap -- vbieleny -- FusionBolt -- krotitom-embedded -- SamsonBox -- SkillerRaptor -- KerstinKeller -- hemantkashniyal -- ThePirate42 -- jhabermas -- TheClonerx -- FMeinicke -- isidore -- corporategoth -- nightlark -- jpauwels -- LighthouseJ -- vbeffara -- ChrisRuff -- eigenwhat -- samvik -- xissburg -- SuTanTank -- bemehiser -- szavadsky -- nfrechette -- patmantru -- kenfred -- coryan -- ciclark2 -- serge1 -- PatSche -- Mo-Tay -- kexianda -- dvetutnev -- mwcondino -- YaZasnyal -- walterbrebels -- tuxu -- dev-plvlml -- woidpointer -- dkruempe -- ehds -- idealvin -- seemk -- chausner -- loic-lopez -- PolyPik -- fdgStilla -- jputcu -- ivmai -- Speak2Erase -- miklelappo -- ivanvurbanov -- cc0der -- kubasz -- killzoner -- MathiasDanzeisen -- mosure -- avitevet -- AntonHorbach -- darcamo -- DonOregano -- sebastianbergt -- yuriy-mochurad -- jtcarnes -- ValentiWorkLearning -- eyalroz -- Zvicii -- SteelBlueVision -- Fettpet -- sobotklp -- andiwand -- pdavydov108 -- gjasny -- eirikb -- wpalfi -- wouterz -- szigetics -- kovdan01 -- willadsen -- michalwidera -- FlexW -- wizardsd -- eeyrw -- nioncode -- Kr4is -- tonyseek -- kevswims -- Tarek-Hasan -- SerkanTuerker -- Carsten87 -- aacebedo -- maximiliank -- drmacdon -- somedevfox -- Zeeno-atl -- hardsetting -- friendlyanon -- MrLIk -- OrianeGourdyStilla -- chusitoo -- csegarragonz -- dean0x7d -- MauriceS-WTI -- Lorac -- sonicxml -- elazarl -- synacker -- jtbandes -- gouriano -- hiemstar -- Enhex -- luk1337 -- ChristianPanov -- JurajX -- pedro-alves-ferreira -- BenjaminNavarro -- sophieeihpos -- jowr -- aruizs -- pbreaux -- fardragon -- njacquemin1993 -- earonesty -- capnkenny -- kring -- sanblch -- winternet -- jlouazel -- JonathanGirardeau -- BishopJohnson -- Tzoockee -- PeteAudinate -- Cyriuz -- ArashPartow -- dpronin -- The-EDev -- artem-ogre -- krzysztofskorupski -- jt416 -- Pollux42 -- gracicot -- ggulgulia -- ondrej-benus -- RubyNova -- HerrNamenlos123 -- naresh97 -- rnapier -- eerimoq -- bb010g -- paulocoutinhox -- greg7mdp -- ruurdadema -- steromano87 -- marsven -- DS-Serafin -- DS-Alex-AG -- cbeattie-tl -- '0x28' -- nmgwddj -- brandonmkunkel -- MykolaPu -- petamas -- icarusdes -- the-nic -- zjg -- rfn123 -- icedream2linxi -- MikeLankamp -- AnotherFoxGuy -- fdefelici -- basiliscos -- svenpilz -- sfackler -- AnticliMaxtic -- serghov -- erikogenvik -- dssimonspoerri -- bysnack -- hannesa2 -- Aypahyo -- chausner-audeering -- gleb-kov -- Yen5666 -- jkimblad -- impugachev -- sebhmg -- sujankota -- 5chmidti -- l2dy -- DamDsj -- Anokhi1994 -- mscofield0 -- alex-700 -- StellaSmith -- buresu -- yzsolt -- aborzunov -- jsantorek -- tmartiel -- rbrich -- HappySeaFox -- hlewin -- victor1234 -- nextsilicon-itay-bookstein -- ekondis -- luizgabriel -- kshehata -- dietssa -- staskau -- Iswenzz -- DAP-IT-Aachen -- VladyslavUsenko -- vdsbenoit -- Macfly -- mkviatkovskii -- sgoth -- hellozee -- Ryan-rsm-McKenzie -- bog-dan-ro -- dennisjosesilva -- bartop -- cameron-devine -- wadimklincov -- vectorsli -- paulharris -- pbailey-hf -- Cogitri -- Sil3ntStorm -- jstzwj -- eseiler -- npuichigo -- dfleury2 -- bigerl -- EKathe -- hmartinez82 -- sfc-gh-mpilman -- apogza -- ameysutavani -- sify21 -- eigenraven -- jay-tux -- baptisteesteban -- chenpengfei -- minlexx -- kou -- 0xbk -- dsche -- tk-tnz -- strangeQuark1041 -- tuduongquyet -- lbakman -- gogoprog -- mvhv -- FreePhoenix888 -- tuccio -- martinvl -- robomics -- EricDeng1001 -- agom -- tsondergaard -- xhuohai -- Mitron57 -- EstebanDugueperoux2 -- suhasHere -- Tradias -- jellespijker -- bshoshany -- Chrismarsh -- ice0 -- krjakbrjak -- romariorios -- Latios96 -- 0xFireWolf -- ashkulz -- kenneth-jia -- jnordin20 -- jubalh -- joaotavora -- VestniK -- sheepgrass -- allen-zhou-dev -- daemyung -- szmyd -- lo1ol -- victorpaleologue -- FaerHack -- netheril96 -- atimin -- ssophie01 -- mietzen -- mourogurt -- hoisunng -- abouvier -- jadamwilson2 -- nilsnolde -- olivia76 -- CD3 -- ovostrikov -- t-8ch -- ingydotnet -- SirCosty -- mvoelkle-cern -- markferry -- mttbernardini -- ofiriluz -- ksmets -- jonathan-conder-sm -- Bueddl -- dornbirndevelops -- boofhead -- marcusl -- Makamitsu -- ulrichji -- kammce -- tomconder -- horusxnetworks -- Nomalah -- kambala-decapitator -- rainman110 -- jiangshipengv8 -- BjoernAtBosch -- dubvulture -- ZbigniewRA -- JorgenPo -- AlexRamallo -- kissandras -- scandyna -- jave27 -- mark0n -- kayoub5 -- topheg -- curoky -- datalogics-saharay -- sproberts92 -- madhat1 -- vince-cheung -- mariopil -- PikachuHyA -- System-Arch -- sorny92 -- cubanpit -- winterz -- Kidsunbo -- antony-jr -- tankeco -- ElliotMugner -- jfaust -- morningstar1 -- lrineau -- jwidauer -- partiallyderived -- Ahajha -- mjimenofluendo -- jiaoew1991 -- ramin-raeisi -- schoetbi -- psyinf -- Novakov -- maksim-petukhov -- roedhaetten -- nassipkali -- petrovito -- razielxyz -- da1910 -- RazielXYZ -- EmilienBINET -- Doome161 -- Sneder89 -- connorsmacd -- jshanab -- ghost -- zamazan4ik -- elliotcmorris -- Ignition -- je894591 -- AlexandrePTJ -- peterSW -- shiyj -- KGrzeg -- goodtune -- theartful -- Yuhanun -- feltech -- geirhei -- Clueliss -- andrewwasielewski -- chatpion -- kletoz -- agilemapper -- ZXfkSIE -- RubenRBS -- Alex-PLACET -- antekone -- ambroff -- tiolan -- MateuszMiekicki -- EricAtORS -- calebkiage -- bennyhuo -- ashuels -- jjcasmar -- kaipenglu -- ashley-b -- psmitsu -- Viatorus -- shtanko-sv -- larshg -- Wuqiqi123 -- OzanCansel -- marlamb -- alexsmedin -- n-morales -- calebgray -- technic -- guillaume-michel -- okaerin -- marknefedov -- jmaillard01 -- hpe-ykoehler -- dbarkar -- weinhold -- activtrak-dsalemizadeh -- axxel -- nicosmd -- impegoraro -- lukaumi -- mkmkme -- hobbeshunter -- rturrado -- wadehunk -- yekmen -- rechbergera -- hedtke -- Loki-Astari -- robbeykaaso -- LevWi -- Tsche -- Seadex-GmbH -- art-ignatev -- MrSparc -- ahmed192a -- maxpagani -- tim-goto -- tannerbitz -- PodnimatelPingvinov -- tmilnthorp -- IronTony-Stark -- edisonhello -- billyzheli -- xuzhenbao -- SunYu2004 -- Thibb1 -- achim-k -- JoelLefkowitz -- schuetzle-vector -- thejohnfreeman -- dimi309 -- valgur -- jakobrieke -- witte -- liarokapisv -- kielby -- mayeut -- CedricSchmeits -- mwerminski -- Kasurus -- barynton -- Daparrag -- roalter -- jsallay -- lmife -- granger35 -- bjoernrennfanz -- tylerjw -- fong7x7 -- zillemarco -- vlebourl -- akeles85 -- joakimono -- hkk2023 -- agagniere -- DuncanChisholm -- dariusarnold -- robbert-ef -- tobiashienzsch -- maikelvdh -- cmannett85 -- edahlseng -- yatagarasu25 -- elejke -- spnda -- forthib -- cprieto -- zhuoqiang -- bigcat26 -- KozhinovAlexander -- sykhro -- kuroneko -- swebb2066 -- grabowski-d -- pezy -- holger-detering -- carterian8 -- jdoubleu -- poretga99 -- sebsnyk -- mercierd -- Tobulus -- fklassen -- Geertien -- weatherhead99 -- OleksandrKvl -- bariscelik -- mralexlupu -- danicriss -- voronaam -- MatusKysel -- Sfletche132 -- stefanpantic-pdftools -- silvergasp -- doocman -- gouarin -- gegles -- jusito -- pwqbot -- ilya-lavrenov -- aubreynicoll -- j-carl -- jeffgarrett -- Maaown -- Knapock -- kaveish -- kwach -- BrettDong -- mtudan -- kontrybutor -- ThomasKes -- wbehrens-on-gh -- raulcd -- bwhitchurch -- jhunold -- Corallo -- JGatley -- christapley -- mpimenov -- ashvardanian -- 7bitcoder -- samuaz -- zajo -- bruchar1 -- pskoko -- marcus-sonestedt -- amrox -- 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 diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml deleted file mode 100644 index 95743fcd62579..0000000000000 --- a/.c3i/conan_v2_ready_references.yml +++ /dev/null @@ -1,1466 +0,0 @@ -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 -- android-ndk -- angelscript -- antlr4-cppruntime -- any-lite -- anyrpc -- approvaltests.cpp -- apr -- apr-util -- apriltag -- aravis -- archicad-apidevkit -- arcus -- arduinojson -- arg_router -- argh -- argon2 -- argparse -- 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 -- bitflags -- bitmagic -- bitserializer -- bitsery -- blaze -- blend2d -- bliss -- boolean-lite -- boolinq -- 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 -- c-ares -- c-blosc -- c-blosc2 -- c-client -- c-dbg-macro -- c4core -- caf -- cairomm -- cajun-jsonapi -- calceph -- canary -- canvas_ity -- capnproto -- capstone -- cargs -- cassandra-cpp-driver -- catch2 -- ccache -- cccl -- ccfits -- cctz -- cd3-boost-unit-definitions -- celero -- cereal -- ceres-solver -- certify -- cfgfile -- cfitsio -- cgal -- cgif -- cglm -- cgltf -- cgns -- chaiscript -- charls -- chef-fun -- chipmunk2d -- choc -- cimg -- circularbuffer -- cista -- cityhash -- civetweb -- cjson -- 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 -- coin-osi -- coin-utils -- commata -- concurrencpp -- concurrentqueue -- console_bridge -- continuable -- coost -- corrade -- cose-c -- cotila -- cpp-httplib -- cpp-ipc -- cpp-jwt -- cpp-lazy -- cpp-optparse -- cpp-peglib -- cpp-sort -- cpp-validator -- cpp_project_framework -- cppbenchmark -- cppcheck -- cppcmd -- 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 -- daw_header_libraries -- 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 -- 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 -- gsl-lite -- gsoap -- 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 -- 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 -- 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 -- 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 -- 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 -- xorg-cf-files -- xorg-gccmakedep -- 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 deleted file mode 100644 index 6fd58a85275b0..0000000000000 --- a/.c3i/config_v1.yml +++ /dev/null @@ -1,169 +0,0 @@ ---- -# Configuration for `https://github.com/conan-io/conan-center-index` repository -id: 'conan-io/conan-center-index' - -conan: - version: 1.61.0 - -artifactory: - url: "https://c3i.jfrog.io/c3i" - main_repo: "conan-center" - pull-request_repo_prefix: "c3i_PR" - pull-request_permission: "c3i-pr" - logs_repo: "misc" - 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: - access_request: - request_issue_url: https://github.com/conan-io/conan-center-index/issues/4 - max_inactivity_days: 0 - automatic_merge: - reviews_required_total: 2 # Reviews that a PR needs so it can be merged - reviews_required_team: 1 # Reviews from the Conan team that a PR needs so it can be merged - branches: # PRs from automations that have these as base-branches will be merged automatically - - "conan-io:action-doc-toc" - # Requirements to merge a given pull-request: - # * check_runs refers to notifications from GH actions - # * status_checks refers to notifications coming from external tools (Jenkins, CLA,...) - check_runs: - - name: "Lint changed files (YAML files)" - - name: "Lint changed conanfile.py (v2 migration)" - status_checks: - - name: "license/cla" - - name: "continuous-integration/jenkins/pr-merge" - - name: "c3i/conan-v2/pr-merge" - 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 - detailed_status_checks: true - update_labels: true - wait_for_multibranch: # CCI jobs should wait for other multibranch job for that same PR - 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/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 - hrname: "Linux, GCC" - content: - - os: ["Linux"] - arch: ["x86_64"] - compiler: - - "gcc": - compiler.libcxx: [ "libstdc++11" ] - compiler.version: ["5", "7", "9", "10", "11"] - build_type: ["Release", "Debug"] - - id: linux-clang - hrname: "Linux, Clang" - content: - - os: ["Linux"] - arch: ["x86_64"] - compiler: - - "clang": - compiler.libcxx: ["libstdc++", "libc++"] - compiler.version: ["12", "13"] - build_type: ["Release", "Debug"] - - id: macos-clang - hrname: "macOS, Clang" - build_profile: - os: "Macos" - arch: "armv8" - content: - - os: [ "Macos" ] - arch: [ "x86_64" ] - compiler: - - "apple-clang": - compiler.version: [ "13.0" ] - compiler.libcxx: [ "libc++" ] - build_type: [ "Release", "Debug" ] - - id: macos-m1-clang - hrname: "macOS, Clang (M1/arm64)" - content: - - os: [ "Macos" ] - arch: [ "armv8" ] - compiler: - - "apple-clang": - compiler.version: [ "13.0" ] - compiler.libcxx: [ "libc++" ] - build_type: [ "Release", "Debug" ] - - id: windows-visual_studio - hrname: "Windows, Visual Studio" - content: - - os: [ "Windows" ] - arch: [ "x86_64" ] - compiler: - - "Visual Studio": - compiler.version: [ "16" ] - build_type: - - "Release": - compiler.runtime: [ "MD" ] - - "Debug": - compiler.runtime: [ "MDd" ] - -jenkins: - url: "http://mb-jenkins-my-bloody-jenkins:8080" - -node_labels: - Windows: - x86_64: - "Visual Studio": - default: "windows20230531" - Macos: - x86_64: - "apple-clang": - default: "mac_apple_clang_${compiler.version}" - armv8: - "apple-clang": - default: "mac_apple_clang_${compiler.version}" - 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}" - -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 - large: - - "duckdb" - - "ceres-solver" - xlarge: - - "llvm" - - "opengv" - - "pcl" diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml deleted file mode 100644 index 712dcc277de49..0000000000000 --- a/.c3i/config_v2.yml +++ /dev/null @@ -1,160 +0,0 @@ ---- -# Configuration for `https://github.com/conan-io/conan-center-index` repository (using Conan v2) -id: 'conan-io/conan-center-index' - -conan: - 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" - main_repo: "conan-center" - pull-request_repo_prefix: "c3i_PR-v2" - pull-request_permission: "c3i-pr" - logs_repo: "misc-v2" - -github: - reviewers: "reviewers.yml" - authorized_users: "authorized_users.yml" - -# Things related to Jenkins jobs: -tasks: - automatic_merge: - reviews_required_total: 1000 # AutomaticMerge shouldn't run with this file, but just in case - reviews_required_team: 1000 # AutomaticMerge shouldn't run with this file, but just in case - 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 - write_comments: false - update_labels: false - user_feedback: - title: "Conan v2 pipeline" - 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 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: - update_yaml_list_path: ".c3i/conan_v2_ready_references" - update_yaml_list_key: "required_for_references" - 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 - hrname: "Linux, GCC" - build_profile: - os: "Linux" - content: - - os: ["Linux"] - arch: ["x86_64"] - compiler: - - "gcc": - compiler.libcxx: ["libstdc++11"] - compiler.version: ["11"] - build_type: ["Release"] - - id: macos-clang - hrname: "macOS, Clang" - build_profile: - os: "Macos" - arch: "armv8" - content: - - os: [ "Macos" ] - arch: [ "x86_64" ] - compiler: - - "apple-clang": - compiler.version: [ "13" ] - compiler.libcxx: [ "libc++" ] - build_type: [ "Release"] - - id: macos-m1-clang - hrname: "macOS M1, Clang" - build_profile: - os: "Macos" - arch: "armv8" - content: - - os: [ "Macos" ] - arch: [ "armv8" ] - compiler: - - "apple-clang": - compiler.version: ["13" ] - compiler.libcxx: [ "libc++" ] - build_type: [ "Release"] - - id: windows-msvc - hrname: "Windows, MSVC" - build_profile: - os: "Windows" - content: - - os: [ "Windows" ] - arch: [ "x86_64" ] - compiler: - - "msvc": - compiler.version: [ "192", "193" ] - build_type: - - "Release": - compiler.runtime: ["dynamic"] - compiler.runtime_type: [ "Release" ] - -cppstd: - apple-clang: - "13": ["17", "gnu17", "20", "gnu20"] - gcc: - "11": ["17", "gnu17", "20", "gnu20"] - msvc: - "192": ["14", "17", "20"] - "193": ["14", "17", "20"] - -jenkins: - url: "http://mb-jenkins-my-bloody-jenkins:8080" - -node_labels: - Windows: - x86_64: - "msvc": - default: "windows20230531" - Macos: - x86_64: - "apple-clang": - default: "mac_apple_clang_${compiler.version}" - armv8: - "apple-clang": - default: "mac_apple_clang_${compiler.version}" - Linux: - x86_64: - "gcc": - 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 deleted file mode 100644 index 3578b7dccdc68..0000000000000 --- a/.c3i/reviewers.yml +++ /dev/null @@ -1,89 +0,0 @@ -reviewers: - # List with users whose review is taken into account so that a pull-request is merged. - # - : Name of the github user - # - : Either 'community' for community reviewers or 'team' for Conan reviewers. - # - : Make the bot proactively request the user's review of pull-requests ready for review. - - user: "danimtb" - type: "team" - request_reviews: true - - user: "lasote" - type: "team" - request_reviews: false - - user: "jgsogo" - type: "community" - request_reviews: false - - user: "czoido" - type: "team" - request_reviews: false - - user: "memsharded" - type: "team" - request_reviews: false - - user: "SSE4" - type: "community" - request_reviews: false - - user: "uilianries" - type: "team" - request_reviews: true - - user: "madebr" - type: "community" - request_reviews: false - - user: "SpaceIm" - type: "community" - request_reviews: false - - user: "theirix" - type: "community" - request_reviews: false - - user: "ericLemanissier" - type: "community" - request_reviews: false - - user: "prince-chrismc" - type: "community" - request_reviews: false - - user: "Croydon" - type: "community" - request_reviews: false - - user: "intelligide" - type: "community" - request_reviews: false - - user: "ericriff" - type: "community" - request_reviews: false - - user: "toge" - type: "community" - request_reviews: false - - user: "AndreyMlashkin" - type: "community" - request_reviews: false - - user: "MartinDelille" - type: "community" - request_reviews: false - - user: "jcar87" - type: "team" - request_reviews: true - - user: "franramirez688" - type: "team" - request_reviews: true - - user: "paulocoutinhox" - type: "community" - request_reviews: false - - user: "jwillikers" - type: "community" - request_reviews: false - - user: "RubenRBS" - type: "team" - request_reviews: true - - user: "System-Arch" - type: "community" - request_reviews: false - - user: "samuel-emrys" - type: "community" - request_reviews: false - - user: "StellaSmith" - type: "community" - request_reviews: false - - user: "davidsanfal" - type: "team" - request_reviews: false - - user: "juansblanco" - type: "team" - request_reviews: false diff --git a/.c3i/v1.jenkins b/.c3i/v1.jenkins deleted file mode 100644 index 68f3504079ef2..0000000000000 --- a/.c3i/v1.jenkins +++ /dev/null @@ -1,6 +0,0 @@ -#!groovy - -@Library('c3i') _ - -String configurationFile = '.c3i/config_v1.yml' -cci.runBuild(this, configurationFile) diff --git a/.c3i/v2.jenkins b/.c3i/v2.jenkins deleted file mode 100644 index 865f167f1dcf0..0000000000000 --- a/.c3i/v2.jenkins +++ /dev/null @@ -1,6 +0,0 @@ -#!groovy - -@Library('c3i') _ - -String configurationFile = '.c3i/config_v2.yml' -cci.runBuild(this, configurationFile) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3f6e08d2479e9..80d0ac7cd4153 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,15 @@ -Specify library name and version: **lib/1.0** - +### Summary +Changes to recipe: **lib/[version]** +#### Motivation + + +#### Details + ---- -- [ ] I've read the [contributing guidelines](https://github.com/conan-io/conan-center-index/blob/master/CONTRIBUTING.md). -- [ ] I've used a [recent](https://github.com/conan-io/conan/releases/latest) Conan client version close to the [currently deployed](https://github.com/conan-io/conan-center-index/blob/master/.c3i/config_v1.yml#L6). -- [ ] I've tried at least one configuration locally with the [conan-center hook](https://github.com/conan-io/hooks.git) activated. +--- +- [ ] Read the [contributing guidelines](https://github.com/conan-io/conan-center-index/blob/master/CONTRIBUTING.md) +- [ ] Checked that this PR is not a duplicate: [list of PRs by recipe](https://github.com/conan-io/conan-center-index/discussions/24240) +- [ ] Tested locally with at least one configuration using a recent version of Conan diff --git a/.github/actions/alert-community/action.yml b/.github/actions/alert-community/action.yml deleted file mode 100644 index ca390cd38b4e7..0000000000000 --- a/.github/actions/alert-community/action.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Alert Community" -description: "Comment on pull request if certain files changes" -author: "prince-chrismc" -inputs: - files: - description: "Check for changes using only this list of files (Defaults to the entire repo)" - required: true - default: "" - reviewers: - description: "List of users to mention (make sure to include the @)" - required: true - default: "" - -runs: - using: "composite" - steps: - # Assume the repo checked out the code since this is running - - uses: ./.github/actions/pr_changed_files - id: changed_files - with: - files: ${{ inputs.files }} - - if: always() && steps.changed_files.outputs.any_changed == 'true' - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `:robot: **Beep Boop**! This pull request is making changes to '${{ inputs.files }}'.\n\n:wave: ${{ inputs.reviewers }} you might be interested. :wink:` - }) diff --git a/.github/actions/pr_changed_files/action.yml b/.github/actions/pr_changed_files/action.yml deleted file mode 100644 index 70f97c9499430..0000000000000 --- a/.github/actions/pr_changed_files/action.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: 'Changed files in PR' -description: 'Get all changed files in a Pull Request' -author: 'ericLemanissier' -inputs: - files: - description: "Check for changes using only this list of files (Defaults to the entire repo)" - required: false - default: "" - -outputs: - all_changed_files: - description: List of all copied, modified, and added files. - value: ${{ steps.changed-files.outputs.all_changed_files }} - any_changed: - description: Return true only when any files provided using the files input have changed. - value: ${{ steps.changed-files.outputs.any_changed }} -runs: - using: "composite" - steps: - - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYVER }} - - name: Get changed files - id: changed-files - shell: python - env: - GITHUB_TOKEN: ${{ github.token }} - run: | - import json - import subprocess - import fnmatch - import os - from pathlib import Path - - patterns = [Path(p).parts for p in '''${{ inputs.files }}'''.splitlines()] - - res = subprocess.run(["gh", "api", "/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files", "--paginate"], capture_output=True, check=True) - files = [] - for f in json.loads(res.stdout): - if f["status"] == "removed": - continue - filename = Path(f["filename"]).parts - for pattern in patterns: - if len(pattern) != len(filename): - continue - if all(fnmatch.fnmatch(filename[i], pattern[i]) for i in range(len(pattern))): - files.append(f["filename"]) - break - with open(os.getenv("GITHUB_OUTPUT"), "a") as output_file: - output_file.write(f"any_changed={'true' if files else 'false'}\n") - output_file.write(f"all_changed_files={' '.join(files)}\n") diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index f3a08a0c9f04e..0000000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,61 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 30 - -# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 30 - -# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) -onlyLabels: [] - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - blocked - - infrastructure - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Set to true to ignore issues with an assignee (defaults to false) -exemptAssignees: false - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This pull request has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This pull request has been automatically closed because it has not had - recent activity. Thank you for your contributions. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: pulls - -# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': -# pulls: -# daysUntilStale: 30 -# markComment: > -# This pull request has been automatically marked as stale because it has not had -# recent activity. It will be closed if no further activity occurs. Thank you -# for your contributions. - -# issues: -# exemptLabels: -# - confirmed diff --git a/.github/workflows/alert-community.yml b/.github/workflows/alert-community.yml deleted file mode 100644 index 405926199ff5e..0000000000000 --- a/.github/workflows/alert-community.yml +++ /dev/null @@ -1,437 +0,0 @@ -name: "[service] Alert Community" - -on: - pull_request_target: - types: [opened] - -env: - PYVER: "3.10" - -jobs: - comment: - if: github.repository == 'conan-io/conan-center-index' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: master - - - uses: ./.github/actions/alert-community - with: - files: "docs/*/*" - reviewers: "@prince-chrismc @MartinDelille @Croydon" - - - uses: ./.github/actions/alert-community - with: - files: ".github/*/*" - reviewers: "@ericLemanissier @Croydon" - - - uses: ./.github/actions/alert-community - with: - files: "linter/*/*" - reviewers: "@ericLemanissier @Croydon" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/aaf/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/abseil/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/armadillo/*/*" - reviewers: "@samuel-emrys" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/avahi/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/b2/*/*" - reviewers: "@grafikrobot" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/bandit/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/benchmark/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/boost/*/*" - reviewers: "@grafikrobot @Hopobcn @jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/boost-ext-ut/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/bzip2/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/cereal/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/cmake/*/*" - reviewers: "@Croydon" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/cppcheck/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/create-dmg/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/dbus/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/double-conversion/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/eigen/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/elfio/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/ffmpeg/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/fmt/*/*" - reviewers: "@Hopobcn @jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/folly/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/foxi/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/fp16/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/g3log/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/gcc/*/*" - reviewers: "@samuel-emrys" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/geotrans/*/*" - reviewers: "@samuel-emrys" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/gflags/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/glew/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/glfw/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/glog/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/gtest/*/*" - reviewers: "@Hopobcn @jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/imgui/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/implot/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/jemalloc/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libalsa/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libarchive/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libbacktrace/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libcap/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libcurl/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libdwarf/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libelf/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libevent/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libffi/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libiberty/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libiconv/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libltc/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libpng/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libsodium/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libspatialite/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libunwind/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libuuid/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libxml2/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/llvm-core/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/lyra/*/*" - reviewers: "@grafikrobot" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/lz4/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/ms-gsl/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/nlohmann_json/*/*" - reviewers: "@Hopobcn @jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/onnx/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/openapi-generator/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/opengl/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/opengl-registry/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/openssl/*/*" - reviewers: "@Hopobcn @Croydon" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/protobuf/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/psimd/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/qt/*/*" - reviewers: "@ericLemanissier @jwillikers @MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/quazip/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/rtmidi/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/sentry-*/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/shapelib/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - 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/*/*" - reviewers: "@MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/wayland/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/wayland-protocols/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/xkbcommon/*/*" - reviewers: "@jwillikers" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/xorg/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/yaml-cpp/*/*" - reviewers: "@jwillikers @MartinDelille" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/xz_utils/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/zlib/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/zstd/*/*" - reviewers: "@Hopobcn" - - - uses: ./.github/actions/alert-community - with: - files: "recipes/libhal/*/*" - reviewers: "@kammce" diff --git a/.github/workflows/hooks-warnings.yml b/.github/workflows/hooks-warnings.yml deleted file mode 100644 index e19b8ea189eb5..0000000000000 --- a/.github/workflows/hooks-warnings.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: hooks warnings - -on: - issue_comment: - types: [created] - -jobs: - comment: - if: ${{ github.event.issue.pull_request && github.event.sender.login == 'conan-center-bot' }} - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - with: - script: | - warnings_map = new Map() - const link_regex = /\[All logs\]\((?https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*))\)/g; - for (const match of context.payload.comment.body.matchAll(link_regex)) - { - prefix = "https://c3i.jfrog.io/c3i/misc/summary.html?json=" - if(!match.groups.url.startsWith(prefix)) - continue; - url = match.groups.url.slice(prefix.length) - try { - result = await github.request({ - url: url, - }); - } catch(err) { - core.warning(`error ${err.status} for url ${err.request.url}`) - continue - } - for (const job of result.data) - { - if (job.build == null) - continue; - try { - log = await github.request({ - baseUrl: "https://c3i.jfrog.io/c3i/misc/", - url: job.build, - }); - } catch(err) { - core.warning(`error ${err.status} for url ${err.request.url}`) - continue - } - prefix = "[HOOK - conan-center.py] " - warnings = log.data.split("\n").filter(line => line.startsWith(prefix) && line.includes(" WARN: ")) - if(warnings.length == 0) - continue - if(!warnings_map.has(job.reference)) - warnings_map.set(job.reference, new Set()) - for(const warning of warnings) - { - msg = warning.slice(prefix.length) - warnings_map.get(job.reference).add(msg) - core.warning(msg) - } - } - } - if(warnings_map.size > 0) - { - comment = "
\n" - comment += "Hooks produced the following warnings" - const shaRegex = /(All green|Failure) in build \d+ \(`(?(\d|[a-z])+)`\):/g; - const shaMatch = shaRegex.exec(context.payload.comment.body) - if(shaMatch) - { - comment += " for commit " + shaMatch.groups.sha - } - comment += "\n\n" - for (const [ref, warnings] of warnings_map) - { - comment += "
\n" - comment += "" + ref + "\n\n```\n" - for(const warning of warnings) - comment += warning + "\n" - comment += "```\n
\n" - } - comment += "
\n" - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }) - } diff --git a/.github/workflows/linter-conan-v2.yml b/.github/workflows/linter-conan-v2.yml deleted file mode 100644 index 9b437a26e46d8..0000000000000 --- a/.github/workflows/linter-conan-v2.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: "[linter] Conan v2 migration" - -on: - pull_request: - -env: - PYTHONPATH: ${{github.workspace}} - PYVER: "3.8" - REQUIREMENTS: "pylint==2.14" - -jobs: - test_linter: - name: Test linter changes (v2 migration) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get changed files - uses: ./.github/actions/pr_changed_files - id: changed_files - with: - files: | - linter/** - .github/workflows/linter-conan-v2.yml - - - name: Get Conan v1 version - id: parse_conan_v1_version - if: steps.changed_files.outputs.any_changed == 'true' - uses: mikefarah/yq@master - with: - cmd: yq '.conan.version' '.c3i/config_v1.yml' - - - uses: actions/setup-python@v4 - if: steps.changed_files.outputs.any_changed == 'true' - with: - python-version: ${{ env.PYVER }} - - - name: Install requirements - if: steps.changed_files.outputs.any_changed == 'true' - run: | - pip install ${{ env.REQUIREMENTS }} conan==${{ steps.parse_conan_v1_version.outputs.result }} - - - name: Execute linter over all recipes in the repository - id: linter_recipes - if: steps.changed_files.outputs.any_changed == 'true' - run: | - echo '## Linter summary (recipes)' >> $GITHUB_STEP_SUMMARY - pylint --rcfile=linter/pylintrc_recipe `ls recipes/*/*/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --score=y --exit-zero - jq '[map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}] | sort_by(.length) | reverse' recipes.json > recipes2.json - jq -r '.[] | " * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY - - - name: Execute linter over all test_package/recipes in the repository - id: linter_test_package - if: steps.changed_files.outputs.any_changed == 'true' - run: | - echo '## Linter summary (test_package)' >> $GITHUB_STEP_SUMMARY - pylint --rcfile=linter/pylintrc_testpackage `ls recipes/*/*/test_package/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --exit-zero - jq '[map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}] | sort_by(.length) | reverse' recipes.json > recipes2.json - jq -r '.[] | " * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY - - conanfile_recipe: - name: Lint changed conanfile.py (v2 migration) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get changed files - id: changed-files - uses: ./.github/actions/pr_changed_files - with: - files: | - recipes/*/*/conanfile.py - - name: Get Conan v1 version - id: parse_conan_v1_version - if: steps.changed-files.outputs.any_changed == 'true' - uses: mikefarah/yq@master - with: - cmd: yq '.conan.version' '.c3i/config_v1.yml' - - uses: actions/setup-python@v4 - if: steps.changed-files.outputs.any_changed == 'true' - with: - python-version: ${{ env.PYVER }} - - name: Install dependencies - if: steps.changed-files.outputs.any_changed == 'true' - run: | - pip install ${{ env.REQUIREMENTS }} conan==${{ steps.parse_conan_v1_version.outputs.result }} - - name: Run linter - if: steps.changed-files.outputs.any_changed == 'true' - run: | - echo "::add-matcher::linter/recipe_linter.json" - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - pylint --rcfile=linter/pylintrc_recipe --output-format=parseable ${file} - done - - conanfile_test_package: - name: Lint changed test_package/conanfile.py (v2 migration) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get changed files - id: changed-files - uses: ./.github/actions/pr_changed_files - with: - files: | - recipes/*/*/test_*/conanfile.py - - name: Get Conan v1 version - id: parse_conan_v1_version - if: steps.changed-files.outputs.any_changed == 'true' - uses: mikefarah/yq@master - with: - cmd: yq '.conan.version' '.c3i/config_v1.yml' - - uses: actions/setup-python@v4 - if: steps.changed-files.outputs.any_changed == 'true' - with: - python-version: ${{ env.PYVER }} - - name: Install dependencies - if: steps.changed-files.outputs.any_changed == 'true' - run: | - pip install ${{ env.REQUIREMENTS }} conan==${{ steps.parse_conan_v1_version.outputs.result }} - - name: Run linter - if: steps.changed-files.outputs.any_changed == 'true' - run: | - echo "::add-matcher::linter/recipe_linter.json" - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - pylint --rcfile=linter/pylintrc_testpackage --ignore-paths="recipes/[^/]*/[^/]*/test_v1[^/]*/conanfile.py" --output-format=parseable ${file} - done diff --git a/.github/workflows/linter-yaml.yml b/.github/workflows/linter-yaml.yml deleted file mode 100644 index d7d4050e8071d..0000000000000 --- a/.github/workflows/linter-yaml.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: "[linter] YAML files" - -on: - pull_request: - -env: - PYTHONPATH: ${{github.workspace}} - PYVER: "3.8" - CONFIG_FILES_PATH: "recipes/*/config.yml" - CONANDATA_FILES_PATH: "recipes/*/*/conandata.yml" - -jobs: - test_linter: - # A job to run when the linter changes. We want to know in advance how many files will be broken - name: Test linter changes (YAML files) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get changed files - uses: ./.github/actions/pr_changed_files - id: changed_files - with: - files: | - linter/** - - - uses: actions/setup-python@v4 - if: steps.changed_files.outputs.any_changed == 'true' - with: - python-version: ${{ env.PYVER }} - - - name: Install dependencies - if: steps.changed_files.outputs.any_changed == 'true' - run: pip install yamllint strictyaml argparse - - - name: Run linter (config.yml) - if: steps.changed_files.outputs.any_changed == 'true' && always() - run: | - echo "::add-matcher::linter/yamllint_matcher.json" - yamllint --config-file linter/yamllint_rules.yml -f standard ${{ env.CONFIG_FILES_PATH }} - echo "::remove-matcher owner=yamllint_matcher::" - - - name: Run schema check (config.yml) - if: steps.changed_files.outputs.any_changed == 'true' && always() - run: | - for file in ${{ env.CONFIG_FILES_PATH }}; do - python3 linter/config_yaml_linter.py ${file} - done - - - name: Run linter (conandata.yml) - if: steps.changed_files.outputs.any_changed == 'true' && always() - run: | - echo "::add-matcher::linter/yamllint_matcher.json" - yamllint --config-file linter/yamllint_rules.yml -f standard ${{ env.CONANDATA_FILES_PATH }} - echo "::remove-matcher owner=yamllint_matcher::" - - - name: Run schema check (conandata.yml) - if: steps.changed_files.outputs.any_changed == 'true' && always() - run: | - for file in ${{ env.CONANDATA_FILES_PATH }}; do - python3 linter/conandata_yaml_linter.py ${file} - done - - lint_pr_files: - # Lint files modified in the pull_request - name: Lint changed files (YAML files) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYVER }} - - - name: Install dependencies - run: pip install yamllint strictyaml argparse - - ## Work on config.yml files - - name: Get changed files (config) - id: changed_files_config - if: always() - uses: ./.github/actions/pr_changed_files - with: - files: | - ${{ env.CONFIG_FILES_PATH }} - - - name: Run linter (config.yml) - if: steps.changed_files_config.outputs.any_changed == 'true' && always() - run: | - echo "::add-matcher::linter/yamllint_matcher.json" - for file in ${{ steps.changed_files_config.outputs.all_changed_files }}; do - yamllint --config-file linter/yamllint_rules.yml -f standard ${file} - done - echo "::remove-matcher owner=yamllint_matcher::" - - for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do - python3 linter/config_yaml_linter.py ${file} - done - - ## Work on conandata.yml files - - name: Get changed files (conandata) - id: changed_files_conandata - if: always() - uses: ./.github/actions/pr_changed_files - with: - files: | - ${{ env.CONANDATA_FILES_PATH }} - - - name: Run linter (conandata.yml) - if: steps.changed_files_conandata.outputs.any_changed == 'true' && always() - run: | - echo "::add-matcher::linter/yamllint_matcher.json" - for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do - yamllint --config-file linter/yamllint_rules.yml -f standard ${file} - done - echo "::remove-matcher owner=yamllint_matcher::" - - for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do - python3 linter/conandata_yaml_linter.py ${file} - done diff --git a/.github/workflows/markdown-links.yml b/.github/workflows/markdown-links.yml deleted file mode 100644 index 50c393f373fb1..0000000000000 --- a/.github/workflows/markdown-links.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: "[linter] Markdown links" - -on: - pull_request: - paths: - - '**.md' - -jobs: - markdown-link-check-pr: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - config-file: .github/workflows/mlc_config.json - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - check-modified-files-only: 'yes' diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json deleted file mode 100644 index d16005bb86641..0000000000000 --- a/.github/workflows/mlc_config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "retryOn429": true, - "retryCount": 5, - "fallbackRetryDelay": "30s", - "httpHeaders": [ - { - "urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"], - "headers": { - "Accept-Encoding": "zstd, br, gzip, deflate" - } - } - ] -} diff --git a/.github/workflows/on-push-do-doco.yml b/.github/workflows/on-push-do-doco.yml deleted file mode 100644 index f5206b720d4a9..0000000000000 --- a/.github/workflows/on-push-do-doco.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: docs_markdown_toc -on: - workflow_dispatch: - inputs: {} - push: - branches: - - master - paths: - - 'docs/**' - -jobs: - docs_markdown_toc: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Run MarkdownSnippets - run: | - dotnet tool install --global MarkdownSnippets.Tool - mdsnippets ${GITHUB_WORKSPACE} \ - --convention InPlaceOverwrite \ - --exclude-directories 'recipes' \ - --toc-level 5 - shell: bash - - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 - with: - branch: bot/action-doc-toc - commit-message: "[docs] Regenerate tables of contents" - title: "[docs] Regenerate tables of contents" - body: "Automatic update of the documentation TOCs." diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000000000..5e391a2d5e860 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,63 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale pull requests + + +on: + schedule: + - cron: '34 6 * * *' + +jobs: + stale: + if: github.repository == 'conan-io/conan-center-index' + + runs-on: ubuntu-latest + permissions: + pull-requests: write + issues: read + + + steps: + - uses: actions/stale@v9 + with: + # Do not make issues as stale + days-before-issue-stale: -1 + # Number of days before stale PRs are closed + days-before-pr-stale: 30 + + + # Do not close issues automatically + days-before-issue-close: -1 + # Idle number of days before closing stale PRs + days-before-pr-close: 30 + + # process older PRs first + ascending: true + + # Labels on PRs exempted from stale + exempt-pr-labels: blocked,infrastructure + + # Label to apply on staled PRs + stale-pr-label: 'stale' + + # Skip issues when having stale state + remove-issue-stale-when-updated: false + ignore-issue-updates: true + + + # Comment on the staled PRs + stale-pr-message: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. + + # Comment on the staled PRs while closed + close-pr-message: > + This pull request has been automatically closed because it has not had + recent activity. Thank you for your contributions. + + # Max number of operations per run + operations-per-run: 30 diff --git a/.gitignore b/.gitignore index 4955b6cd850e6..366db2f4800f6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ conanbuildinfo.txt conaninfo.txt graph_info.json build/ +.conanrunner/ +.conanrc # CMake CMakeUserPresets.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e24832e93e98..59b3554bdd7fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,9 +32,64 @@ To contribute follow the next steps: got everything working or even if you need help. Add the text to the issue body (besides other comments): "fixes #IssueNumber" in the body of the PR, referring to the issue of step 1. -The Conan Community works hard to review all the pull requests and provided assistance where need. +The Conan Community works hard to review all the pull requests and provide assistance where need. The [Review Process](docs/review_process.md) is partially automated with the help of @conan-center-index-bot :rocket: +## Pull Request scope + +Pull requests should propose changes to a single recipe only. If you believe modifications +to multiple recipes are necessary, we kindly ask that you open an issue first to discuss +the best approach with the maintainer team. + +Please ensure that pull requests have a **single**, clear objective that is evident to +reviewers, with all proposed changes directly supporting that goal. Please refrain from +including unrelated modifications, even if they appear minor or trivial. + +As the Conan client continues to evolve, we recognize that recipe conventions may change +over time, much like in programming languages themselves. However, please be aware that it +is not a goal in Conan Center to update all recipes to align with the latest conventions, +as this would be an ongoing task that would consume a significant part of our resources. +Changes of this kind will only be considered if they present tangible benefits to the +recipe consumers -such as bug fixes or new features-, and are clearly justified in the +pull request description. Our team will strive to upgrade recipes to the latest +conventions as resources permit. Thank you for your understanding and cooperation. + +Please keep in mind that the review team is tasked with assessing a high volume of pull +requests at any given time. To maintain an agile review process, and in accordance with +our previous +[announcement](https://github.com/conan-io/conan-center-index/discussions/25461), we +kindly ask that PRs refrain from performing large-scale refactorings to eliminate Conan +1.x compatibility, or refactoring recipe logic, unless the changes are directly related to +the PR objective (bugfix or feature). Pull requests that include changes unrelated to the +PR objective will not be reviewed and may be closed. + +## Pull Request limits + +The pull request workflow is constrained by our available resources, including the number +of team reviewers and CI capacity. Given Conan Center’s large user base and its role +within the Software Supply Chain, each pull request undergoes the same validation process +prior to merging. Our objective is to minimize disruption for our users and prioritize +security. + +To help manage the workload of the reviewing team and our CI resources, while ensuring +that all contributors have an equitable opportunity for their pull requests to be +reviewed, please note the following limits: + +- Pull requests from new contributors, or from trusted contributors after a period of + inactivity, need to be visually inspected by a team member before starting the CI job. +- For trusted contributors, pull requests will automatically be checked by CI up to a + maximum of 30 open pull requests by the same contributor. Beyond this limit, CI runs + will require manual approval by the team. +- Contributors are limited to a maximum of 50 open pull requests at any given time. + Additional pull requests will be closed or not reviewed until the limit is reduced. + +We thank you for playing a part in prioritizing your own pull requests before opening them +for review and CI checks. For use cases that may require modifying multiple recipes or +extensive changes across the repository, we encourage you to first open an issue. This +allows us to assess user interest, determine if the feature aligns with the project’s +goals, and discuss potential implementation strategies. This helps us prioritize focusing +on the impact proposed features have on the wider Conan Center community. + ## Issues If you think you found a bug in CCI or in a recipe, open an issue indicating the following: diff --git a/README.md b/README.md index 3206926309aed..54cfaefe6c2cc 100644 --- a/README.md +++ b/README.md @@ -14,26 +14,37 @@ The current Conan Center Index CI status can be found on https://status.conan.io Any maintenance, outage or important event related to the CI will be informed there. -### Add ConanCenter remote +### Configure the Conan Center remote -ConanCenter remote is configured by default in any Conan client installation. If, for any reason, you need to add it manually, just execute: +> [!IMPORTANT] +> The Conan Center remote URL changed for **Conan 2** on November 2024 - the new URL is the default on new installations of Conan since version 2.9.2. +> +> New recipe updates are only published to this remote and are only guaranteed to be compatible with recent versions of Conan 2. +> +> All previously published recipes and packages known to be compatible with Conan 2 are also served by this remote. + +To update an existing Conan 2 installation: ``` -conan remote add conancenter https://center.conan.io +conan remote update conancenter --url https://center2.conan.io ``` +#### Conan Center legacy remote + +The legacy remote at `https://center.conan.io` stopped receiving updates on 4 November 2024 and is frozen and will no longer received updates. +It is kept in this state to avoid breaking any existing Conan 1.x installations. + + ### How to consume recipes Starting to use recipes from this repository is as easy as running one simple command after installing Conan: ``` -conan install name/version@ [-g ] +conan install --require=name/version [-g ] ``` -Of course, we really encourage you to use a `conanfile.txt` or `conanfile.py` -to list all the requirements or your project and install them all together -(Conan will build a single graph and ensure congruency). +For further details, please see the [Conan documentation](https://docs.conan.io/2/tutorial/consuming_packages.html). :warning: It is very important to notice that recipes will evolve over time and, while they are fixing some issues, they might introduce new features and @@ -50,10 +61,8 @@ This is a list of shortcuts to some interesting topics: * :rocket: If you want to learn how to **contribute new recipes**, please read [docs/adding_packages/](docs/adding_packages/README.md). * :speech_balloon: **FAQ**: most common questions are listed in [docs/faqs.md](docs/faqs.md). -* :warning: The conan-center **hook errors** reported by CCI Bot can be found in the [docs/error_knowledge_base.md](docs/error_knowledge_base.md). * :hammer_and_wrench: The internal changes related to infrastructure can be checked in [docs/changelog.md](docs/changelog.md). * :world_map: There are various community lead initiatives which are outlined in [docs/community_resources.md](docs/community_resources.md). -* :magic_wand: To start preparing your recipes for **Conan 2.0**, please check [docs/v2_migration.md](docs/v2_migration.md). ### Reporting Issues @@ -65,7 +74,7 @@ You can open issues in the [issue tracker](https://github.com/conan-io/conan-cen - Specify the name and version (`zlib/1.2.11`) and any relevant details about the fail configuration: Applied profile, building machine... * :bulb: Request a **new library** to be added: - - Use the `[request]` label to search the library in the issue tracker in case the it was already requested. + - Use the `[request]` label to search the library in the issue tracker in case it was already requested. - If not, use the same `[request]` tag in the title of the issue to help identifying them. - Indicate the name and the version of the library you would like to have in the repository. Also links to the project's website, source download/repository and in general any relevant information that helps creating a recipe for it. diff --git a/docs/README.md b/docs/README.md index 566801917e5f3..3305d7c06b030 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,11 +14,7 @@ When pull requests are merged, the CI will upload the generated packages to the + [Developing Recipes Locally](developing_recipes_locally.md) + [Adding Packages to ConanCenter](adding_packages/README.md) :point_left: Best place to learn how to contribute + [Bumping versions to existing packages](bump_version.md) - + [Errors from the conan-center hook (KB-Hxxx)](error_knowledge_base.md) + [Review Process](review_process.md) - + [Labels](labels.md) - + [Supported platforms and configurations](supported_platforms_and_configurations.md) + [Consuming Recipes](consuming_recipes.md) :information_source: Learn how to limit the impact of recipe changes + [Community Resources](community_resources.md) - + [Preparing recipes for Conan 2.0](v2_migration.md) + [FAQs](faqs.md) diff --git a/docs/adding_packages/README.md b/docs/adding_packages/README.md index 409f61c38fc0e..a4d6c0e3a5b4f 100644 --- a/docs/adding_packages/README.md +++ b/docs/adding_packages/README.md @@ -4,44 +4,22 @@ ConanCenterIndex aims to provide the best quality packages of any open source pr Any C/C++ project can be made available by contributing a "recipe". Getting started is easy. Try building an existing package with our [developing recipes](../developing_recipes_locally.md) -tutorial. To deepen you understanding, start with the [How to provide a good recipe](#how-to-provide-a-good-recipe) section. +tutorial. To deepen you understanding, start with the [How to write a good recipe](#how-to-provide-a-good-recipe) section. You can follow the three steps (:one: :two: :three:) described below! :tada: ## Contents - - * [:one: Request access](#one-request-access) - * [Inactivity and user removal](#inactivity-and-user-removal) + * [:one: First time contributors](#one-first-time-contributors) * [:two: Creating a package](#two-creating-a-package) - * [How to provide a good recipe](#how-to-provide-a-good-recipe) + * [How to write a good recipe](#how-to-provide-a-good-recipe) * [:three: Submitting a Package](#three-submitting-a-package) * [The Build Service](#the-build-service) -## :one: Request access - -The first step to add packages to ConanCenter is requesting access. To enroll in ConanCenterIndex repository, please write a comment -requesting access in this GitHub [issue #4](https://github.com/conan-io/conan-center-index/issues/4). Feel free to introduce yourself and -your motivation to join ConanCenter community. - -This process helps ConanCenter against spam and malicious code. The process is not fully automated on purpose and the requests are -generally approved on a weekly basis. Feel free to continue to step :two: while waiting for approval. - -> **Note** The requests are reviewed manually, checking the GitHub profile activity of the requester to avoid any misuse of the service. -> 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. +## :one: First time contributors 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 - -For security reasons related to the CI, when a user no longer contributes for a long period, it will be considered inactive and removed from the authorized user's list. -For now, it's configured for **4 months**, and it's computed based on the latest commit, not comments or opened issues. -After that time, the CI bot will ask to remove the user name from the authorized users' list through the access request PR, which occurs a few times every week. - -When you are interested in contributing again, simply ask again to be included in the [issue #4](https://github.com/conan-io/conan-center-index/issues/4). -The process will be precisely like for newcomers. - ## :two: Creating a package Once you've successfully built an existing recipe following [developing recipes](../developing_recipes_locally.md) tutorial. @@ -66,14 +44,7 @@ In ConanCenter, our belief is recipes should always match upstream, in other wor * Options should [follow these recommendations](conanfile_attributes.md#options) as well as match the default value used by the upstream project. * [Package information](build_and_package.md), libraries, components should match as well. This includes exposing supported build system names. -Where dependencies are involved, there's no shortcuts, inspect the upstream's build scripts for how they are usually consumed. Pick the Conan -generator that matches. The most common example is CMake's `find_package` that can be satisfied by Conan's -[`CMakeDeps`](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmakedeps.html) generator. There are a few -things to be cautious about, many projects like to "vendor" other projects within them. This can be files checked into the repository or -downloaded during the build process. These should be removed, see the [Dependencies section](dependencies.md#handling-internal-dependencies) -for more information. - -### How to provide a good recipe +### How to write a good recipe Take a look at existing [recipes](https://github.com/conan-io/conan-center-index/tree/master/recipes) available in ConanCenterIndex which can be used as good examples, you can use them as the base for your recipe. The GitHub search is very good for matching code snippets, you can see if, @@ -95,7 +66,6 @@ The documents in this folder are written to explain each folder, file, method, a 4. [Dependencies](dependencies.md) 5. [Build and Package](build_and_package.md) 1. [Revisit Patches](sources_and_patches.md#policy-about-patching) -6. [Test Package](test_packages.md) The one place you are certain to find a lot of information is , this has the documentation for everything in Conan. There are helpful tutorials for cross-build, detailed explication for profiles and settings and much much more! @@ -110,8 +80,6 @@ The specific steps to submitting changes are: * Build and test the new recipe in several combinations. Check [developing recipes](../developing_recipes_locally.md) for tips. * [Commit and push to your fork repository](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository) then [submit a pull request](https://github.com/conan-io/conan-center-index/compare). -* Our automated [build service](#the-build-service) will build 100+ different configurations, and provide messages that indicate if there - were any issues found during the pull request on GitHub. When the pull request is [reviewed and merged](../review_process.md), those packages are published to [JFrog's ConanCenter](https://conan.io/center/) and are made available for everyone. @@ -120,14 +88,9 @@ and are made available for everyone. The **build service** associated to this repository will generate binary packages automatically for the most common platforms and compilers. See [the Supported Platforms and Configurations page](../supported_platforms_and_configurations.md) for a list of generated configurations. -For a C++ library, the system is currently generating more than 100 binary packages. +For a C++ library, the system is currently generating more than 30 binary packages. > **Note**: This not a testing service, it is a binary building service for **released** packages. Unit tests shouldn't be built nor run in recipes by default, see the [FAQs](../faqs.md#why-conancenter-does-not-build-and-execute-tests-in-recipes) for more. Before submitting a pull request, please ensure that it works locally for some configurations. -* The CI bot will start a new build only [after the author is approved](#one-request-access). Your PR may be reviewed in the mean time, but is not guaranteed. -* The CI system will also report errors and build logs by creating a comment in the pull-request, the message will include links to the logs for inspecting. -* The Actions are used to lint and ensure the latest conventions are being used. You'll see comments from bots letting you know. - -Packages generated and uploaded by this build service do not include any _user_ or _channel_ (we generally recommend using `@user/channel` for private package -repositories as an easy way to distinguish them from public ones). Once the packages are uploaded, you will be able to install them using the reference as -`name/version` so example `conan install fmt/9.1.0@` for 1.x client or `conan install --requires=fmt/9.1.0` for 2.x clients. +- The CI system will report the build logs in the Checks tab, in the pull-request. +- Linter and Hooks are automatically displayed in the Checks tab as well. diff --git a/docs/adding_packages/build_and_package.md b/docs/adding_packages/build_and_package.md index a64769f6e6b52..0235be181c3e4 100644 --- a/docs/adding_packages/build_and_package.md +++ b/docs/adding_packages/build_and_package.md @@ -17,61 +17,15 @@ Both methods often use build helpers to build binaries and install them into the ## Build Method -* `build()` method should focus on build only, not installation. During the build, nothing should be written in `package` folder. Installation step should only occur in `package()` method. - -* The build itself should only rely on local files. Nothing should be downloaded from the internet during this step. If external files are required, they should come from `requirements` or `build_requirements` in addition to source files downloaded in `source()` or coming from the recipe itself through `export()` or `export_sources()`. - -* Except for CMake, a working build toolchain (compiler, linker, archiver, etc.), and a "native generator" (`make` on *nix platforms, `mingw32-make` for MinGW, `MSBuild`/`NMake` for Visual Studio), the recipe should not assume that any other build tool is installed on the user-build machine (like Meson, autotools, or pkg-config). On Windows, the recipe should not assume that a shell is available (like MSYS2). Therefore, if the build method requires additional tools, they should be added to `build_requirements()`. - Tools explicitly marked as available by users through conf like `tools.gnu:make_program`, `tools.gnu:pkg_config`, `tools.microsoft.bash:path`, `tools.microsoft.bash:subsystem` should be taken into account to conditionally inject a build requirement (these conf should have precedence over build requirement equivalent hardcoded in the recipe). - -* It is forbidden to run other conan client commands during build. In other words, if upstream build files call conan under the hood (through `cmake-conan` for example or any other logic), this logic must be removed. - -* Settings from profile should be honored (`build_type`, `compiler.libcxx`, `compiler.cppstd`, `compiler.runtime` etc). - -* Compiler paths from host profile should be honored and properly propagated to underlying build system during the build: - - | compiler type | conf / env var | - |---------------|----------------| - | C compiler | `c` key of `tools.build:compiler_executables`, otherwise `CC` environment variable | - | C++ compiler | `cpp` key of `tools.build:compiler_executables`, otherwise `CXX` environment variable | - | ASM compiler | `asm` key of `tools.build:compiler_executables`, otherwise `CCAS` environment variable | - | CUDA compiler | `cuda` key of `tools.build:compiler_executables` | - | Fortran compiler | `fortran` key of `tools.build:compiler_executables`, otherwise `FC` environment variable | - | Objective-C compiler | `objc` key of `tools.build:compiler_executables` | - | Objective-C++ compiler | `objcpp` key of `tools.build:compiler_executables` | - | Resource files compiler | `rc` key of `tools.build:compiler_executables`, otherwise `RC` environment variable | - | Archiver | `AR` environment variable | - | Linker | `LD` environment variable | - - They should be curated on the fly if underlying build system expects a specific format (no spaces in path, forward slash instead of back slash, etc). - -* These compiler and linker conf from host profile should be honored and propagated to underlying build system during the build: - * `tools.build:cflags` - * `tools.build:cxxflags` - * `tools.build:defines` - * `tools.build:sharedlinklags` - * `tools.build:exelinkflags` - * `tools.apple:enable_bitcode` (only if host OS is `iOS`/`watchOS`/`tvOS`) - -* Multithread build (if supported by underlying build system): - * if some steps are sensitive to race conditions, monothread should be enforced. - * otherwise multithreaded build should be enabled with a number of cores controlled by `tools.build:jobs` conf from host profile if it is set, otherwise to all cores of build machine. +For the `build()` method, the general scope used to build artifacts. Please, read +the official reference to the [build()](https://docs.conan.io/2/reference/conanfile/methods/build.html) method and the +[Build packages: the build() method](https://docs.conan.io/2/tutorial/creating_packages/build_packages.html). ## Package Method -* CMake config files must be removed. They will be generated for consumers by `CMakeDeps` generator (or legacy `cmake_find_package`/`cmake_find_package_multi` generators). - -* pkg-config files must be removed. They will be generated for consumers by `PkgConfigDeps` generator (or legacy `pkg_config` generator). - -* On *nix systems, executables and shared libraries should have empty `RPATH`/`RUNPATH`/`LC_RPATH`. Though, a relative path pointing inside package itself is allowed. - -* On Apple OS family: - * shared libs: name field of `LC_ID_DYLIB` load command must be `@rpath/`. - * shared libs & executables: name field of each `LC_LOAD_DYLIB` load command should be `@rpath/` (except those refering to system libs or frameworks). - -* Installed files must not contain absolute paths specific to build machine. Relative paths to other packages is also forbidden since relative paths of dependencies during build may not be the same for consumers. Hardcoded relative paths pointing to a location in the package itself are allowed. - -* Static and shared flavors of the same library must not be packaged together. +The `package()` method is used to copy the artifacts to the `package_folder`. Please, read the official reference to the +[package()](https://docs.conan.io/2/reference/conanfile/methods/package.html) method and the +[Package files: the package() method](https://docs.conan.io/2/tutorial/creating_packages/package_method.html). ## Build System Examples @@ -82,31 +36,28 @@ General patterns about how they can be used for OSS in ConanCenterIndex can be f ### Header Only If you are looking for header-only projects, you can take a look on [header-only template](../package_templates/header_only). -Also, Conan Docs have a section about [how to package header-only libraries](https://docs.conan.io/1/howtos/header_only.html). +Also, Conan Docs have a section about [how to package header-only libraries](https://docs.conan.io/2/tutorial/creating_packages/other_types_of_packages/header_only_packages.html). ### CMake For C/C++ projects which use CMake for building, you can take a look on [cmake package template](../package_templates/cmake_package). -Another common use case for CMake based projects, both header only and compiled, is _modeling components_ to match the `find_package` and export the correct targets from Conan's generators. A basic examples of this is [cpu_features](https://github.com/conan-io/conan-center-index/blob/master/recipes/cpu_features/all/conanfile.py), a moderate/intermediate example is [cpprestsdk](https://github.com/conan-io/conan-center-index/blob/master/recipes/cpprestsdk/all/conanfile.py), and a very complex example is [OpenCV](https://github.com/conan-io/conan-center-index/blob/master/recipes/opencv/4.x/conanfile.py). - ### Autotools There is an [autotools package template](../package_templates/autotools_package/) amiable to start from. -However, if you need to use autotools for building, you can take a look on [libalsa](https://github.com/conan-io/conan-center-index/blob/master/recipes/libalsa/all/conanfile.py), [kmod](https://github.com/conan-io/conan-center-index/blob/master/recipes/kmod/all/conanfile.py), [libcap](https://github.com/conan-io/conan-center-index/blob/master/recipes/libcap/all/conanfile.py). - -Many projects offer [**pkg-config**'s](https://www.freedesktop.org/wiki/Software/pkg-config/) `*.pc` files which need to be modeled using components. A prime example of this is [Wayland](https://github.com/conan-io/conan-center-index/blob/master/recipes/wayland/all/conanfile.py). - ### No Upstream Build Scripts -For cases where a project only offers source files, but not a build script, you can add CMake support, but first, contact the upstream and open a PR offering building support. If it's rejected because the author doesn't want any kind of build script, or the project is abandoned, CCI can accept your build script. Take a look at [Bzip2](https://github.com/conan-io/conan-center-index/blob/master/recipes/bzip2/all/CMakeLists.txt) and [DirectShowBaseClasses](https://github.com/conan-io/conan-center-index/blob/master/recipes/directshowbaseclasses/all/CMakeLists.txt) as examples. +For cases where a project only offers source files but does not provide a build script, you can add CMake support. +However, it is essential to first contact the upstream maintainers and open a pull request (PR) offering building support. +If your PR is rejected because the author does not want any kind of build script, or if the project is abandoned, Conan Center Index (CCI) will consider accepting your build script based on the effort required to maintain it, as we aim to avoid adding scripts that may require significant ongoing maintenance. +Take a look at [Bzip2](https://github.com/conan-io/conan-center-index/blob/master/recipes/bzip2/all/CMakeLists.txt) as example. ### System Packages > **Note**: For exceptional cases where only system packages can be used and a regular Conan package may result in an incompatible and fragile package, a separated system package may be created. See the [FAQs](../faqs.md#can-i-install-packages-from-the-system-package-manager) for more. -The [SystemPackageTool](https://docs.conan.io/1/reference/conanfile/methods.html#systempackagetool) can easily manage a system package manager (e.g. apt, +The [package_manager](https://docs.conan.io/2/reference/tools/system/package_manager.html#conan-tools-system-package-manager) can easily manage a system package manager (e.g. apt, pacman, brew, choco) and install packages which are missing on Conan Center but available for most distributions. It is key to correctly fill in the `cpp_info` for the consumers of a system package to have access to whatever was installed. -As example there is [xorg](https://github.com/conan-io/conan-center-index/blob/master/recipes/xorg/all/conanfile.py). Also, it will require an exception rule for [conan-center hook](https://github.com/conan-io/hooks#conan-center), a [pull request](https://github.com/conan-io/hooks/pulls) should be open to allow it over the KB-H032. +As example there is [xorg](https://github.com/conan-io/conan-center-index/blob/master/recipes/xorg/all/conanfile.py). \ No newline at end of file diff --git a/docs/adding_packages/conandata_yml_format.md b/docs/adding_packages/conandata_yml_format.md index ed96865802cc0..943af159a6485 100644 --- a/docs/adding_packages/conandata_yml_format.md +++ b/docs/adding_packages/conandata_yml_format.md @@ -1,6 +1,6 @@ # conandata.yml -[conandata.yml](https://docs.conan.io/1/reference/config_files/conandata.yml.html) is a [YAML](https://yaml.org/) +[conandata.yml](https://docs.conan.io/2/tutorial/creating_packages/handle_sources_in_packages.html#using-the-conandata-yml-file) is a [YAML](https://yaml.org/) file to provide declarative data for the recipe (which is imperative). This is a built-in Conan feature (available since 1.22.0) without a fixed structure, but ConanCenter has a specific format to ensure quality of recipes. @@ -30,8 +30,7 @@ next sections with more detail: * [portability](#portability) * [conan](#conan) * [bugfix](#bugfix) - * [patch_source](#patch_source) - * [base_path](#base_path) + * [patch_source](#patch_source) ## sources @@ -114,7 +113,7 @@ sources: sha256: "f5d48c4b0d558c5d71e8bf6fcdf135b0943210c1ff91f8191dfc447419a6b12e" ``` -This approach requires a special code within [build](https://docs.conan.io/1/reference/conanfile/methods.html#build) method to handle. +This approach requires a special code within [build](https://docs.conan.io/2/reference/conanfile/methods/build.html) method to handle. ### Sources fields @@ -126,8 +125,9 @@ Usually, `url` has a [https](https://tools.ietf.org/html/rfc2660) scheme, but ot #### sha256 [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](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-filehash?view=powershell-7.4) you can use PowerShell). +You may use an [online service](https://hash.online-convert.com/sha256-generator) to compute `sha256` sum for the given file located at `url`. + +If you're using linux you can run `wget -q -O - url | sha256sum` to get the hash which uses the [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 @@ -172,7 +172,7 @@ An example of a full patch description could be: `port to Android: update config #### patch_type -_Required_ +_Recommended_ The `patch_type` field specifies the type of the patch. In ConanCenterIndex we currently accept only several kind of patches: @@ -219,7 +219,6 @@ Usually, the following kind of problems are good candidates for backports: * Data corruption. * Use of outdated or deprecated API or library. -As sources with backports don't act exactly the same as the version officially released, it may be a source of confusion for the consumers who are relying on the buggy behavior (even if it's completely wrong). Therefore, it's required to introduce a new `cci.` version for such backports, so consumers may choose to use either official version, or modified version with backport(s) included. #### patch_source @@ -235,9 +234,3 @@ _Recommended_ For the `patch_type: portability` there might be no patch source matching the definition above. Although we encourage contributors to submit all such portability fixes upstream first, it's not always possible (e.g. for projects no longer maintained). In that case, a link to the Conan issue is a valid patch source (if there is no issue, you may [create](https://github.com/conan-io/conan-center-index/issues/new/choose) one). For the `patch_type: conan`, it doesn't make sense to submit patch upstream, so there will be no patch source. - -#### base_path - -_Optional_ - -Specifies a sub-directory in project's sources to apply patch. This directory is relative to the [source_folder](https://docs.conan.io/1/reference/conanfile/attributes.html?highlight=source_folder#source-folder). Usually, it would be a `source_subfolder`, but could be a lower-level sub-directory (e.g. if it's a patch for a submodule). diff --git a/docs/adding_packages/conanfile_attributes.md b/docs/adding_packages/conanfile_attributes.md index fb7a767a13b95..f4b962c9c85e1 100644 --- a/docs/adding_packages/conanfile_attributes.md +++ b/docs/adding_packages/conanfile_attributes.md @@ -20,11 +20,11 @@ or are known by ConanCenter's build service and have special meaning. ## Attributes -These are a [key feature](https://docs.conan.io/1/reference/conanfile/attributes.html) which allow the Conan client to understand, +These are a [key feature](https://docs.conan.io/2/reference/conanfile/attributes.html) which allows the Conan client to understand, identify, and expose recipes and which project they expose. In ConanCenter, there are a few conventions that need to be respected to ensure recipes can be discovered there `conan search` command -of through the web UI. Many of which are enforces with the [hooks](../error_knowledge_base.md). +of through the web UI. ### Name @@ -38,50 +38,52 @@ Please see the FAQs for: ### Version -ConanCenter is geared towards quickly added new release, the build service always pass the version it is currently building to the recipe. The `version` attribute MUST NOT be added to any recipe - with exception to "system packages". #### ConanCenter specific releases format -The notation shown below is used for publishing packages which do not match the original library's official releases. This format which includes the "datestamp" corresponding to the date of a commit: `cci.`. +The notation shown below is used for publishing packages which do not match the original library's official releases. -In order to create reproducible builds, we also "commit-lock" to the latest commit on that day. Otherwise, users would get inconsistent results over time when rebuilding the package. An example of this is the [RapidJSON](https://github.com/Tencent/rapidjson) library, where its package reference is `rapidjson/cci.20200410` and its sources are locked the latest commit on that date in [config.yml](https://github.com/conan-io/conan-center-index/blob/master/recipes/rapidjson/config.yml#L4). The prefix `cci.` is mandatory to distinguish as a virtual version provided by CCI. If you are interested to know about the origin, please, read [here](https://github.com/conan-io/conan-center-index/pull/1464). +There are two cases to consider: + +* The library has not had any previous releases/tags. In this case, the version should be of the form + `0.0.0.cci.`. For example, `0.0.0.cci.20240402`. When/if a version of the library is ever released. + this will allow version ranges to properly identify the release as a newer version. +* The library has had previous releases/tags. In this case, the version should be of the form + `...cci.`. For example, `1.2.0.cci.20240402`. + This will allow version ranges to properly identify the release as a newer version. + +In order to create reproducible builds, we also "commit-lock" to the latest commit on that day, so the sources should point +to the commit hash of that day. Otherwise, users would get inconsistent results over time when rebuilding the package. ### License Attribute 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. +[SPDX license](https://spdx.org/licenses/) as a standard. This is for consumers, in particular in the enterprise sector, that do rely on SDPX compliant identifiers so that they can flag this as a custom license text. * 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 license is extracted from a specific document, prepend `DocumentRef--` to the license name. For example: `DocumentRef-README.md-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. 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 + license = "MIT" 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" + if Version(self.version) >= "2.0.0": + self.license = "BSD-3-Clause" ``` ## Order of methods and attributes Prefer the following order of documented methods in python code (`conanfile.py`, `test_package/conanfile.py`): -For `conan create` the order is listed [here](https://docs.conan.io/1/reference/commands/creator/create.html#methods-execution-order) -test packages recipes should append the following methods: - -* deploy -* test - -the order above resembles the execution order of methods on CI. therefore, for instance, `build` is always executed before `package` method, so `build` should appear before the -`package` in `conanfile.py`. +For `conan create` the order is listed [here](https://docs.conan.io/2/reference/commands/create.html#methods-execution-order). ## Settings @@ -140,61 +142,40 @@ Having the same naming conventions for the options helps consumers. It allows us ### Predefined Options and Known Defaults -ConanCenter supports many combinations, these are outline in the [supported configurations](../supported_platforms_and_configurations.md) document for each platform. -By default recipes should use `shared=False` with `fPIC=True`. If support, `header_only=False` is the default. +By default recipes should use `*/*:shared=False` with `*/*:fPIC=True`. If supported, `&:header_only=False` is the default. Usage of each option should follow the rules: * `shared` (with values `True` or `False`). The CI inspects the recipe looking for this option. The **default should be `shared=False`** and will generate all the configurations with values `shared=True` and `shared=False`. - > **Note**: The CI applies `shared=True` only to the package being built, while every other requirement will `shared=False`. To consume everything as a shared library you will set `--build=always` and/or `-o *:shared=True`) - > It's important to keep this in mind when trying to consume shared packages from ConanCenter - > as their requirements were linked inside the shared library. See [FAQs](../faqs.md#how-to-consume-a-graph-of-shared-libraries) for more information. - * `fPIC` (with values `True` or `False`). The **default should be `fPIC=True`** and will generate all the configurations with values `fPIC=True` and `fPIC=False`. - This option does not make sense on all the support configurations so it should be removed. + This option does not make sense on all the support configurations, so using `implements` is recommended: ```python - 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") + implements = ["auto_shared_fpic"] ``` * `header_only` (with values `True` or `False`). The **default should be `header_only=False`**. If the CI detects this option, it will generate all the configurations for the value `header_only=False` and add one more configuration with `header_only=True`. **Only one package** will be generated for `header_only=True`, so it is crucial that the package is actually a _header only_ library, with header files only (no libraries or executables inside). - Recipes with such option should include the following in their `package_id` method + Recipes with such options should include the following in their `implements` attribute: ```python - def package_id(self): - if self.options.header_only: - self.info.clear() + implements = ["auto_header_only"] ``` - ensuring that, when the option is active, the recipe ignores all the settings and only one package ID is generated. - ### Options to Avoid * `build_testing` should not be added, nor any other related unit test option. Options affect the package ID, therefore, testing should not be part of that. - Instead, use Conan config [skip_test](https://docs.conan.io/1/reference/config_files/global_conf.html#tools-configurations) feature: - - ```python - def generate(self): - tc = CMakeToolChain(self) - tc.variables['BUILD_TESTING'] = not self.conf.get("tools.build:skip_test", default=true, check_type=bool) - ``` + Instead, use Conan config [skip_test](https://docs.conan.io/2/reference/config_files/global_conf.html#user-tools-configurations) feature. - The `skip_test` configuration is supported by [CMake](https://docs.conan.io/1/reference/build_helpers/cmake.html#test) and [Meson](https://docs.conan.io/1/reference/build_helpers/meson.html#test). + The `skip_test` configuration is supported by [CMake](https://docs.conan.io/2/reference/tools/cmake/cmake.html) and [Meson](https://docs.conan.io/2/reference/tools/meson/meson.html). ### Removing from `package_id` - By default, options are included in the calculation for the `package_id` ([docs](https://docs.conan.io/1/reference/conanfile/methods.html#package-id)). + By default, options are included in the calculation for the `package_id` ([docs](https://docs.conan.io/2/reference/binary_model/package_id.html)). Options which do not impact the generated packages should be deleted, for instance adding a `#define` for a package. ```python diff --git a/docs/adding_packages/dependencies.md b/docs/adding_packages/dependencies.md index a69f895483ed0..998e6a22f1648 100644 --- a/docs/adding_packages/dependencies.md +++ b/docs/adding_packages/dependencies.md @@ -5,89 +5,24 @@ from handling "vendored" dependencies to what versions should be used. ## Contents - - * [List Dependencies](#list-dependencies) - * [Optional Requirements](#optional-requirements) - * [Build Requirements](#build-requirements) - * [Accessing Dependencies](#accessing-dependencies) - * [Handling Requirement's Options](#handling-requirements-options) - * [Verifying Dependency's Version](#verifying-dependencys-version) - * [Passing Requirement's info to `build()`](#passing-requirements-info-to-build) - * [Overriding the provided properties from the consumer](#overriding-the-provided-properties-from-the-consumer) + * [Handling Requirement's Options](#handling-requirements-options) * [Adherence to Build Service](#adherence-to-build-service) * [Version Ranges](#version-ranges) + * [Adding Version Ranges](#adding-version-ranges) * [Handling "internal" dependencies](#handling-internal-dependencies) -## List Dependencies - -Since all ConanCenterIndex recipes are to build and/or package projects they are exclusively done in [`conanfile.py`](https://docs.conan.io/1/reference/conanfile.html). This offers a few -ways to add requirements. The most common way is [requirements](https://docs.conan.io/1/reference/conanfile/methods.html#requirements): - -```py - def requirements(self): - self.requires("fmt/9.1.0") -``` - -> **Note**: With Conan 2.0, you'll also need to pay attention to new properties like the `transitive_header` attributed which is -> needed when a project include a dependencies header files in its public headers. - -When a project supports a range of version of a dependency, it's generally advised to pick the **most recent available in ConanCenter**. -This helps ensure there are fewer conflicts with other, up to-date, recipes that share the same requirement. - -### Optional Requirements - -Many projects support enabling certain features by adding dependencies. In ConanCenterIndex this is done by adding an option, see -[naming recommendation](conanfile_attributes.md#recommended-names), which should be set to match the upstream project's by default. - -```py -class ExampleConan(ConanFile): - options = { - "with_zlib": [True, False], # Possible values - } - default_options = { - "with_zlib": True, # Should match upstream's CMakeLists.txt `option(...)` - } - - def requirements(self): - if self.options.with_zlib: - self.requires("zlib/1.2.13") -``` - -If a dependency was added (or removed) with a release, then the `if` condition could check [`self.version`](https://docs.conan.io/1/reference/conanfile/attributes.html#version). Another common case is -`self.settings.os` dependant requirements which need to be added for certain plaforms. - -### Build Requirements - -In ConanCenter we only assume -[CMake is available](../faqs.md#why-recipes-that-use-build-tools-like-cmake-that-have-packages-in-conan-center-do-not-use-it-as-a-build-require-by-default). -If a project requires any other specific tool, those can be added as well. We like to do this with [build_requirements](https://docs.conan.io/1/reference/conanfile/methods.html#build-requirements): - -```py - def build_requirements(self): - self.tool_requires("ninja/1.1.0") -``` - -## Accessing Dependencies - -It's fairly common to need to pass information from a dependency to the project. This is the job of the [`generate()`](https://docs.conan.io/1/reference/conanfile/methods.html#generate) method. This -is generally covered by the built-in generators like [`CMakeDeps`](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmakedeps.html) -However the [`self.dependencies`](https://docs.conan.io/1/reference/conanfile/dependencies.html?highlight=generate) are available. -Alternatively, a project may depend on a specific versions or configuration of a dependency. This use case is again covered by the -[`self.dependencies`](https://docs.conan.io/1/reference/conanfile/dependencies.html?highlight=validate) within the -[`validate()`](https://docs.conan.io/1/reference/conanfile/methods.html#validate) method. Additionally it's possible to suggest the option's values while the graph is built through [`configure()`](https://docs.conan.io/1/reference/conanfile/methods.html#configure-config-options) -this is not guaranteed and not a common practice. -### Handling Requirement's Options +## Handling Requirement's Options Forcing options of dependencies inside a ConanCenter should be avoided, except if it is mandatory for the library to build. Our general belief is the users input should be the most important; it's unexpected for command line arguments to be over ruled by specifc recipes. -You need to use the [`validate()`](https://docs.conan.io/1/reference/conanfile/methods.html#validate) method in order to ensure they check after the Conan graph is completely built. +You need to use the [`validate()`](https://docs.conan.io/2/reference/conanfile/methods/validate.html) method in order to ensure they check after the Conan graph is completely built. Certain projects are dependent on the configuration (also known as options) of a dependency. This can be enforced in a recipe by -accessing the [`options`](https://docs.conan.io/1/reference/conanfile/dependencies.html?highlight=options) field of +accessing the [`options`](https://docs.conan.io/2/reference/conanfile/methods/generate.html#dependencies-interface) field of the dependency. ```py @@ -99,68 +34,6 @@ the dependency. raise ConanInvalidConfiguration(f"{self.ref} requires foobar/*:enable_feature=True.") ``` -### Verifying Dependency's Version - -Some project requirements need to respect a version constraint, this can be done as follows: - -```py -def validate(self): - if Version(self.dependencies["foobar"].ref.version) < "1.2": - raise ConanInvalidConfiguration(f"{self.ref} requires [foobar>=1.2] to build and work.") -``` - -### Passing Requirement's info to `build()` - -The [`self.dependencies`](https://docs.conan.io/1/reference/conanfile/dependencies.html) are limited to [`generate()`](https://docs.conan.io/1/reference/conanfile/methods.html#generate) and [`validate()`](https://docs.conan.io/1/reference/conanfile/methods.html#validate). This means configuring a projects build scripts -is a touch more complicated when working with unsupported build scripts. - -In general, with [CMake](https://cmake.org/) project, this can be very simple with the [`CMakeToolchain`](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmaketoolchain.html), such as: - -```py - def generate(self): - tc = CMakeToolchain(self) - # deps_cpp_info, deps_env_info and deps_user_info are no longer used - if self.dependencies["dependency"].options.foobar: - tc.variables["DEPENDENCY_LIBPATH"] = self.dependencies["dependency"].cpp_info.libdirs -``` - -This pattern can be recreated for less common build system by, generating a script to call configure or capture the -required values in a YAML files for example. - -> **Note**: This needs to be saved to disk because the [`conan install`](https://docs.conan.io/1/reference/commands/consumer/install.html) and [`conan build`](https://docs.conan.io/1/reference/commands/development/build.html) commands can be separated when -> developing packages so for this reason the `class` may not persists the information. This is a very common workflow, -> even used in ConanCenter in other areas such as testing. - -```py -from conan import ConanFile -from conan.tools.files import save, load - - -class ExampleConan(ConanFile): - _optional_build_args = [] - - @property - def _optional_build_args_filename(self): - return os.path.join(self.recipe_folder, self.folders.generators, "build_args.yml") - - def generate(self): - # This is required as `self.dependencies` is not available in `build()` or `test()` - if self.dependencies["foobar"].options.with_compression: - self._optional_build_args.append("--enable-foobar-compression") - - save(self, self._optional_build_args_filename, file) - - def build(self): - opts_args = load(self, self._optional_build_args_filename) - # Some magic setup - self.run(f"./configure.sh {opts_args}") -``` - -### Overriding the provided properties from the consumer - -> **Note**: This was adding in [Conan 1.55](https://github.com/conan-io/conan/pull/12609) to the generators... we need to -> write docs for when that's available - ## Adherence to Build Service It's very rare we layout "rules", most often it's guidelines, however in order to ensure graph and the package generated are usable @@ -168,34 +41,54 @@ for consumer, we do impose some limits on Conan features to provide a smoother f > **Note**: These are very specific to the ConanCenter being the default remote and may not be relevant to your specifc use case. -* [Version ranges](https://docs.conan.io/1/versioning/version_ranges.html) are generally not allowed (see below for exemption). -* Specify explicit [RREV](https://docs.conan.io/1/versioning/revisions.html) (recipe revision) of dependencies is not allowed. +* [Version ranges](https://docs.conan.io/2/tutorial/versioning/version_ranges.html#range-expressions) are generally not allowed ([see below](https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/dependencies.md#version-ranges) for exemptions). +* Specify explicit [RREV](https://docs.conan.io/2/tutorial/versioning/revisions.html) (recipe revision) of dependencies is not allowed. * Only ConanCenter recipes are allowed in `requires`/`requirements()` and `build_requires`/`build_requirements()`. -* [`python_requires`](https://docs.conan.io/1/reference/conanfile/other.html#python-requires) are not allowed. +* [`python_requires`](https://docs.conan.io/2/reference/extensions/python_requires.html) 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: + +Version ranges are being progressively introduced by Conan team maintainers and are being rolled out in phases, and we do not intend +to do it all at once. + +Version ranges for the following dependencies will be accepted in pull requests: * 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 -* Libcurl: `[>=X.YY <9]`, where `X.YY` is the minimum version of Libcurl required, starting from `7.78` +* CMake: `[>3.XX <4]`, where `3.XX` is the minimum version of CMake required by the relevant build scripts. Note that CCI recipes assume 3.15 is installed in the system, so add this +version range only when a requirement for a newer version is needed. +* doxygen: `[>=1.8 <2]` +* Libcurl: `[>=7.78 <9]` +* Zlib: `[>=1.2.11 <2]` +* Libpng: `[>=1.6 <2]` +* Expat: `[>=2.6.2 <3]` +* Libxml2: `[>=2.12.5 <3]` +* Libuv: `[>=1 <2]` +* qt5: `[~5.15]`, if your library depends on qt5, only the 5.15 minor version is allowed +* qt6: `[>=6.x <7]`, where 6.x is the lower bound of your needed qt6 version +* c-ares: `[>=1.27 <2]` +* zstd: `[~1.5]` it's equivalent to `[>=1.5 <1.6]` +* ninja: `[>=1.10.2 <2]` +* meson: `[>=1.2.3 <2]` +* pkgconf: `[>=2.2 <3]` +* xz_utils: `[>=5.4.5 <6]` -> **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. +Conan maintainers may introduce this for other dependencies over time. Outside of the cases outlined above, version ranges are not allowed in ConanCenter recipes. +### Adding Version 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, -> 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. +You might also see version ranges being added in pull requests by Conan maintainers, that +are not in the list above. These are being introduced on a case-by-case basis, and are being rolled out +in phases to ensure that they do not cause problems to users. Note that version ranges can +only be used for libraries and tools that have strong compatibility guarantees - and may not +be suitable in all cases. -Conan maintainers may introduce this for other dependencies over time. Outside of the cases outlined above, version ranges are not allowed in ConanCenter recipes. +Please do not open PRs that exclusively add version ranges to dependencies, unless they are solving +current conflicts, in which case we welcome them and they will be prioritized. ## Handling "internal" dependencies -Vendoring in library source code should be removed (best effort) to avoid potential ODR violations. If upstream takes care to rename -symbols, it may be acceptable. +Vendoring in library source code should be removed (in a best effort basis) to avoid potential ODR violations. +If upstream takes care to rename symbols, it may be acceptable. diff --git a/docs/adding_packages/folders_and_files.md b/docs/adding_packages/folders_and_files.md index b5a51c8d60309..4e9d94ec5889a 100644 --- a/docs/adding_packages/folders_and_files.md +++ b/docs/adding_packages/folders_and_files.md @@ -10,7 +10,6 @@ to work most efficiently. * [`config.yml`](#configyml) * [The _recipe folder_](#the-_recipe-folder_) * [`conandata.yml`](#conandatayml) - * [`conanfile.py`](#conanfilepy) * [`test_package`](#test_package) ## Recipe File Structure @@ -21,8 +20,6 @@ folders at a time. This is the canonical structure of one of these folders, where the same `conanfile.py` recipe is suitable to build all the versions of the library: -> **Note**: For updating the structure during the [v2 migration](../v2_migration.md) see the [test package](test_packages.md#cmake-targets) document. - ```txt . +-- recipes @@ -32,7 +29,7 @@ This is the canonical structure of one of these folders, where the same `conanfi | +-- conanfile.py | +-- conandata.yml | +-- patches/ -| +-- add-missing-string-header-2.1.0.patch +| +-- 2.1.0-0001-add-missing-string-header-.patch | +-- test_package/ | +-- conanfile.py | +-- CMakeLists.txt @@ -83,19 +80,7 @@ This contains every needed to build packages. #### `conandata.yml` This file lists **all the sources** that are needed to build the package. The most common examples are -source code, build scripts, license files. - -The file is organized into two sections, `"sources"` and `"patches"`, each one of them contains the files that are required -for each version of the library. Resources which need to be downloaded are listed under `"source"` should include a checksum -to validate that they do not change. This helps to ensure the build is reproducible at a later point in time. Often -modifications are required for a variety of reasons, which ones are associated to which version are listed under the `"patches"`. - -```yml -sources: - "9.0.0": - url: "https://github.com/fmtlib/fmt/archive/9.0.0.tar.gz" - sha256: "9a1e0e9e843a356d65c7604e2c8bf9402b50fe294c355de0095ebd42fb9bd2c5" -``` +source code, build scripts, license files. The Conandata is officially documented in [using the conandata.yml](https://docs.conan.io/2/tutorial/creating_packages/handle_sources_in_packages.html#using-the-conandata-yml-file). For more information about picking source tarballs, adding or removing versions, or what the rules are for patches, continue reading our [Sources and Patches](sources_and_patches.md) guide. @@ -106,87 +91,29 @@ For more information about picking source tarballs, adding or removing versions, A detailed breakdown of all the fields can be found in [conandata_yml_format.md](conandata_yml_format.md). We **strongly** recommend adding the [patch fields](conandata_yml_format.md#patches-fields) to help track where patches come from and what issue they solve. -Inside the `conanfile.py` recipe, this data is available in a `self.conan_data` attribute that can be used as follows: - -```py -def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) -``` - -See the [Export Patches](sources_and_patches.md#exporting-patches) and [Applying Patches](sources_and_patches.md#applying-patches) -for more use cases and examples. - -#### `conanfile.py` - -This file is the recipe, it contains the logic to build the libraries from source for all the configurations. -It's the single most important part of writing a package. Every `conanfile.py` should be accompanied by at least one -[folder to test the generated packages](#test_package). - -Each recipe should derive the `ConanFile` class and implement key attributes and methods. - -* Basic attributes and conversions can be found in [`ConanFile` attributes](conanfile_attributes.md) -* Some of the key methods are outlined in this document and will link to more details - -```python -from conan import ConanFile - -class FmtConan(ConanFile): - name = "fmt" - homepage = "https://github.com/fmtlib/fmt" - # ... -``` - -When a package needs other packages those can be include with the `requirements()` method. - -```python - def requirements(self): - self.requires("fmt/9.0.0") -``` - -For more information see the [Dependencies](dependencies.md) documentation. - -For compiled libraries, the `build()` method is used along side the [build helpers](https://docs.conan.io/1/reference/build_helpers.html). -This allows you to use the official build script from a project, see [build and package](build_and_package.md) instructions. - -```python - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() -``` - -Most of the projects with build scripts support installing the important files. Avoid installing documentation or examples. - -```python - def package(self): - cmake = CMake(self) - cmake.configure() - cmake.install() -``` - -For some projects, you will need to manually copy files. -Here's an example for a header only library: - -```python - def package(self): - copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) -``` +Inside the `conanfile.py` recipe, this data is available in through the [self.conan_data](https://docs.conan.io/2/reference/conanfile/attributes.html#conan-data) attribute. #### `test_package` All the packages in this repository need to be tested before they join ConanCenter. A `test_package` folder with its corresponding `conanfile.py` and a minimal project to test the package is strictly required. You can read about it in the -[Conan documentation](https://docs.conan.io/1/creating_packages/getting_started.html) and learn about ConanCenterIndex -specific conventions in [test package](test_packages.md) section. +[Conan documentation](https://docs.conan.io/2/tutorial/creating_packages/test_conan_packages.html#testing-conan-packages). + +The goal for the test package is to make sure the: -The goal for the test package is to make sure the +* Header files are available +* Libraries are available to link against +* Components are correctly exposed -* header files are available -* libraries are available to link against -* components are correctly exposed +When providing a test package, please: -> **Note** It's required to verify that the old generators are not broken. You can do so by using the pattern, see -> [KB-H073](../error_knowledge_base.md#kb-h078) for details. +* Create a minimal usage for the target project here +* Avoid upstream full examples, or code bigger than 15 lines +* Avoid networking connections +* Avoid background apps or servers +* Avoid GUI apps +* Avoid extra files like images, sounds and other binaries +* The propose is testing the generated artifacts ONLY Remember that the `test_` recipes should **test the package configuration that has just been generated** for the _host_ context, otherwise it will fail in cross-building scenarios. diff --git a/docs/adding_packages/sources_and_patches.md b/docs/adding_packages/sources_and_patches.md index 56ff5130c26e4..a57c7355f6978 100644 --- a/docs/adding_packages/sources_and_patches.md +++ b/docs/adding_packages/sources_and_patches.md @@ -14,8 +14,6 @@ These are a very important aspects and it helps us to establish the quality of t * [Adding old versions](#adding-old-versions) * [Policy about patching](#policy-about-patching) * [Format and Conventions](#format-and-conventions) - * [Exporting Patches](#exporting-patches) - * [Applying Patches](#applying-patches) * [Policy on patches](#policy-on-patches) ## Picking the Sources @@ -32,9 +30,8 @@ Where ever possible, downloading source files and compiling is mandated. Downloa Downloaded source code must have a deterministic results where the exact same archive is download each time. See [Conandata's `"sha"` fields](conandata_yml_format.md#sha256) for how this is achieved in ConanCenterIndex. -The sources stored under `self.source_folder` should not be modified. This will enable local workflows to "keep sources" and avoid extra downloads. -Any patch should be applied to the copy of this source code when a build is executed (basically in `build()` method). See [Applying Patches](#applying-patches) -below for more information. +The sources stored under `self.source_folder` should not apply patches or modifications in the `source()` method conditional to options or settings. +Patches should be applied in the `source()` method - taking special care that the patches are platform agnostic. Patches in the `build()` method can be considered where this is not possible, provided that `no_copy_source` is **not** set to `True`. ### Sources not accessible @@ -52,7 +49,9 @@ as a system recipe (`/system`) and making those binaries availabl In this repository we are building a subset of all the versions for a given library. This set of version changes over time as new versions are released and old ones stop being used. -We always welcome latest releases as soon as they are available, and from time to time we remove old versions mainly due to technical reasons: +We welcome the latest release version for its new features and improvements. However, we recommend exercising caution with fresh releases, as upstream may soon release patches or hotfixes to address any unforeseen issues. We usually wait until releases are a few days old to merge them. + +From time to time we remove old versions mainly due to technical reasons: the more versions we have, the more resources that are needed in the CI and the more time it takes to build each pull-request (also, the more chances of failing because of unexpected errors). @@ -61,18 +60,20 @@ more chances of failing because of unexpected errors). The Conan Team may ask you to remove more if they are taking a lot of resources. When removing old versions, please follow these considerations: * keep one version for every major release -* for the latest major release, at least three versions should be available (latest three minor versions) +* for the latest major release, at least two versions should be available (latest two minor versions) Logic associated with removed revisions implies that entries in the `config.yml` and `conandata.yml` files should also be removed. If anyone needs to recover them in the future, Git contains the full history and changes can be recovered from it. +Removed versions should not affect other recipes available in the repository. If a recipe depends on a removed version, it should be updated to +depend on the latest available version. + Please, note that even if those versions are removed from this repository, **the packages will always be accessible in ConanCenter remote** associated to the recipe revision used to build them. ### Adding old versions -We love to hear why in the opening description of the pull requests you need this exact version. -We usually don't add old versions unless there is a specific request for it. Adding versions that are not used by author of the pull request reduces overall resources and time from [the build services](README.md#the-build-service). +We usually don't add old versions unless there is a specific and well-motivated request for it. Adding versions that are not actively used by the author of the pull request reduces overall resources and time from [the build services](README.md#the-build-service). Take into account that the version might be removed in future pull requests according to the [guidelines above](#removing-old-versions). @@ -86,8 +87,7 @@ reading the changelog of the library, the documentation, or any statement by the Patch files are preferred over programmatic `replace_in_file` statements. This makes it easier to review and prevent unwanted side effects when new versions are added. They will be listed in [`conandata.yml`](conandata_yml_format.md) -file and exported together with the recipe. Patches must always include [patch fields](conandata_yml_format.md#patches-fields) -which are enforced by the [linters](../../linter/conandata_yaml_linter.py). +file and exported together with the recipe. Patches should include the required [patch fields](conandata_yml_format.md#patches-fields). Patches must be located in the recipe folder in a `patches/` sub-directory. @@ -100,50 +100,14 @@ There are a few recommendations about naming patches: By clearly indicating what the patch does, when it's applied, and how it relates to existing patches, you can help make the [review process](../review_process.md) easier for readers and help speed up your pull requests. -### Exporting Patches - -It's ideal to minimize the number of files in a package to exactly what's required. When recipes support multiple -versions with differing patches, it's strongly encouraged to only export the patches used for that given recipe. - -Make sure the `export_sources` attribute is replaced by -[`conan.tools.files.export_conandata_patches`](https://docs.conan.io/1/reference/conanfile/tools/files/patches.html?highlight=export_conandata_patches) -helper. - -```py -def export_sources(self): - export_conandata_patches(self) -``` - -### Applying Patches - -Patches can be applied in a separate method, the pattern name is `_patch_sources`. When applying patch files, -using [`conan.tools.files.apply_conandata_patches`](https://docs.conan.io/1/reference/conanfile/tools/files/patches.html?highlight=apply_conandata_patches) -is the best option. - -```py -def build(self): - apply_conandata_patches(self) -``` - -For more complicated cases, -[`conan.tools.files.rm`](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-rm) -or [`conan.tools.files.replace_in_file`](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-replace-in-file) -are good choices. - -```py -def _patch_sources(self): - # remove bundled libfmt - rmdir(self, os.path.join(self.source_folder, "lib", "fmt")) - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "${CMAKE_SOURCE_DIR}", "${CMAKE_CURRENT_SOURCE_DIR}") -``` ### 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. +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. +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/adding_packages/test_packages.md b/docs/adding_packages/test_packages.md deleted file mode 100644 index 220ff43cb0e59..0000000000000 --- a/docs/adding_packages/test_packages.md +++ /dev/null @@ -1,107 +0,0 @@ -# Test Packages - -This is the main way that ConanCenter is able to validate the contents of a package are valid. -It is required to provide a [`test_package/`](https://docs.conan.io/1/reference/commands/creator/create.html?highlight=test_package) -sub-directory with every recipe. These are expected to work regardless of the options or settings used as this is what consumer will encounter when doing a `conan create` -themselves. It's possible to have ConanCenter run `conan test` on more then one `test folder` by using the `test_` prefix. - - -## Contents - - * [Files and Structure](#files-and-structure) - * [CMake targets](#cmake-targets) - * [Testing more generators with `test_`](#testing-more-generators-with-test_something) - * [Testing CMake variables from FindModules](#testing-cmake-variables-from-findmodules) - * [How it works](#how-it-works) - * [Minimalist Source Code](#minimalist-source-code) - -### Files and Structure - -See the [recipe files and structures](README.md#recipe-files-structure) for a visual. - -All ConanCenterIndex recipe should have a two [test_folders](https://docs.conan.io/1/reference/commands/creator/create.html?highlight=test_folder) -One for the current CMake generator in `test_package/`. - -Please refer to the [Package Templates](../package_templates/) for the current practices about which files and what their content should be. - -### CMake targets - -When using CMake to test a package, the information should be consumed using the -[`CMakeDeps` generator](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmakedeps.html?highlight=cmakedeps). - -This typically will look like a `CMakeLists.txt` which contain lines similar to - -```cmake -find_package(fmt REQUIRED CONFIG) -# ... -target_link_libraries(test_ranges PRIVATE fmt::fmt) -``` - -Refer to the [package template](https://github.com/conan-io/conan-center-index/blob/master/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt) for more examples. - -In ConanCenterIndex, we try to accurately represent the names of the targets and the information provided by CMake's modules and config files that some libraries -provide. If CMake or the library itself don't enforce any target name, the default ones provided by Conan should be recommended. The minimal project -in the `test_package` folder should serve as an example of the best way to consume the package, and targets are preferred over raw variables. - -This rule applies for the _global_ target and for components ones. The following snippet should serve as example: - -We encourage contributors to check that not only the _global_ target works properly, but also the ones for the components. It can be -done creating and linking different libraries and/or executables. - -### Testing more generators with `test_` - -The CI will explore all the folders and run the tests for the ones matching `test_*/conanfile.py` pattern. You can find the output of all -of them together in the testing logs. - -Sometimes it is useful to test the package using different build systems (CMake, Autotools,...). Instead of adding complex logic to one -`test_package/conanfile.py` file, it is better to add another `test_/conanfile.py` file with a minimal example for that build system. That -way the examples will be short and easy to understand and maintain. In some other situations it could be useful to test different Conan generators -(e.g. `CMakeDeps`) using different folders and `conanfile.py` files. - -When using more than one `test_` folder, create a different project for each of them to keep the content of the `conanfile.py` and the -project files as simple as possible, without the need of extra logic to handle different scenarios. - -``` -. -+-- recipes -| +-- library_name/ -| +-- config.yml -| +-- all/ -| +-- ... -| +-- test_package/ -| +-- ... -| +-- test_cmakedeps/ -| +-- conanfile.py -| +-- CMakeLists.txt -| +-- test_package.cpp -``` - -### Testing CMake variables from FindModules - -Recipes which provide [Find Modules](https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html#find-modules) are strongly encouraged to -module the file name, targets and or variables. - -**We will provide better docs in the near future**, for now here are a few references: - -- Convo: https://github.com/conan-io/conan-center-index/pull/13511 -- early example: https://github.com/conan-io/conan-center-index/tree/master/recipes/libxml2/all/test_cmake_module_package -- Best reference: https://github.com/conan-io/conan-center-index/blob/master/recipes/expat/all/test_package_module/CMakeLists.txt#L9 - -### How it works - -The [build service](README.md#the-build-service) will explore all the folders and run the tests for the ones matching `test_*/conanfile.py` pattern. -You can find the output of all of them together in the testing logs. Only the end of the logs are posted even if an earlier "test folder" may have failed. - -> **Note**: If, for any reason, it is useful to write a test that should only be checked using Conan v1, you can do so by using the pattern -> `test_v1_*/conanfile.py` for the folder. Please, have a look to [linter notes](../v2_linter.md) to know how to prevent the linter from -> checking these files. - -Remember that the `test_` recipes should **test the package configuration that has just been generated** for the _host_ context, otherwise -it will fail in cross-building scenarios; before running executables, recipes should check -[`conan.tools.build.can_run`](https://docs.conan.io/1/reference/conanfile/tools/build.html?highlight=can_run#conan-tools-build-can-run) - -### Minimalist Source Code - -The contents of `test_package.c` or `test_package.cpp` should be as minimal as possible, including a few headers at most with simple -instantiation of objects to ensure linkage and dependencies are correct. Any build system can be used to test the package, but -CMake or Meson are usually preferred. diff --git a/docs/bump_version.md b/docs/bump_version.md index 132d4ff1bf685..895576989afa9 100644 --- a/docs/bump_version.md +++ b/docs/bump_version.md @@ -44,5 +44,4 @@ In case a patch should be re-used, it should be present in `conandata.yml` to th ## Reviewing and merging -Bumping version PRs follow the same regular [review process](review_process.md), except for being merged automatically -as listed on [Labels](labels.md#bump-version) section. +Bumping version PRs follow the same regular [review process](review_process.md). \ No newline at end of file diff --git a/docs/changelog.md b/docs/changelog.md index 10cbbd6810dde..6ee15d19c592c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,54 @@ # Changelog +### 04-Nov-2024 - 09:15 CET + +- [feature] Conan 1.x end of support and Conan 2.x as default version in the CI +- [feature] New CI infrastructure for Conan 2.x only + +### 12-Sep-2024 - 09:23 CEST + +- [feature] Add support for Conan 2.7.1 in the CI +- [feature] Add support for Conan 1.65.0 in the CI + +### 10-Jul-2024 - 13:22 CEST + +- [feature] Add support for Conan 2.5.0 in the CI +- [fix] Invalid configuration from tool requirement in Conan 1.x + +### 22-May-2024 - 12:04 CEST + +- [feature] Add support for Conan 2.3.1 in the CI +- [feature] Add support for Conan 1.64.1 in the CI + +### 03-April-2024 - 13:53 CEST + +- [feature] Add support for Conan 2.2.2 in the CI +- [feature] Add support for Conan 1.63.0 in the CI + +### 20-March-2024 - 11:13 CET + +- [fix] Changing Version Ranges in dependencies is now bump dependencies +- [fix] Static library package type should be built with both all static and all shared dependencies + +### 13-March-2024 - 11:08 CET + +- [feature] Build with both */*:shared=True/False option when package type is declared as ``shared-library``. +- [fix] Fix ValidateInfra python version check to be aligned with the latest Jenkins version. + +### 07-February-2024 - 15:43 CET + +- [feature] Add waiting list for new collaborators that are not found in access request issue. +- [feature] Skip building bump dependencies PRs by default. It will require manual CI trigger. + +### 24-January-2024 - 12:13 CET + +- [feature] Update Conan 1.x branch to version 1.62.0 +- [feature] Update Conan 2.x branch to version 2.0.16 +- [feature] Require review from maintainers for Bump version and Bump requirements +- [fix] Show header-only option in the build CI summary table +- [fix] Use build/host profile conf also in test package +- [fix] Use only string to handle Github labels + ### 05-December-2023 - 16:23 CET - [fix] Use the correct profile to test a tool_require. diff --git a/docs/community_resources.md b/docs/community_resources.md index 06aa0558a52f3..f2806f9377afb 100644 --- a/docs/community_resources.md +++ b/docs/community_resources.md @@ -6,8 +6,7 @@ This is a curated list of various bots and helpful tools that aim to making appr ## Contents * [Social Media and More](#social-media-and-more) - * [Bots](#bots) - * [Tools](#tools) + * [Bots](#bots) ## Social Media and More @@ -19,19 +18,6 @@ If you are looking to stay up to date with the last Conan news, follow us on Twi - [Updatable Recipes](https://github.com/qchateau/conan-center-bot): Automatically scans available recipes and checked for new upstream releases and tests one configuration - The results can be found here: https://qchateau.github.io/conan-center-bot/#/updatable -- [Conflicting Pull Requests](https://github.com/ericLemanissier/conan-center-conflicting-prs): Checks all the open pull requests for those which edit the same -recipe files and posts a message. - - The results can be found here: https://ericlemanissier.github.io/conan-center-conflicting-prs/ -- [Pending Review](https://github.com/prince-chrismc/conan-center-index-pending-review) - - The results can be found here: https://prince-chrismc.github.io/conan-center-index-pending-review/ -- [Pull Request In Progress Status](https://ericlemanissier.github.io/conan-center-pr-status/in_progress_jobs) - [System Package Checks](https://github.com/bincrafters/system-packages-checks): Builds automatically all `system` versions of recipes merged on CCI and being pull requested on a selection of Linux distributions and FreeBSD - The results can be found here: https://bincrafters.github.io/system-packages-checks/ - -## Tools - -- [FreeBSD Testing](https://github.com/ericLemanissier/conan-center-index/tree/freebsd): Detects pull requests with `FreeBSD` in the description and runs a test for -one configuration on that platform - - The results can be found here: https://github.com/ericLemanissier/conan-center-index/actions?query=workflow%3ACI -- [Bincrafters Conventions](https://github.com/bincrafters/bincrafters-conventions): Automatically updates Conan recipes to the latest conventions and rules diff --git a/docs/consuming_recipes.md b/docs/consuming_recipes.md index a777e97d08e79..b898282302020 100644 --- a/docs/consuming_recipes.md +++ b/docs/consuming_recipes.md @@ -29,8 +29,8 @@ There can be several causes if a recipe (a new revision) might stopped to work i New recipe revisions can take into account changes that are introduced in new Conan client version, sometimes these changes modify some experimental behavior without modifying recipe syntax. -This use case is covered by the [`required_conan_version`](https://docs.conan.io/1/reference/conanfile/other.html?highlight=required_conan_version#requiring-a-conan-version-for-the-recipe) feature. It will -substitute the syntax error by one nicer error provided by Conan client. +This use case is covered by the [`required_conan_version`](https://docs.conan.io/2/reference/conanfile/attributes.html#required-conan-version) feature. +It will substitute the syntax error by one nicer error provided by Conan client. To be sure that people using these new experimental features are using the required Conan version and testing the actual behavior of those features (feedback about them is very important to Conan). @@ -43,23 +43,19 @@ Conan is very flexible; you can add your own remote or modify your client’s co Here are a few choices: -- [Running your own Conan Server](https://docs.conan.io/1/uploading_packages/running_your_server.html) - great for local ad-hoc setups -- [Cache recipes in your own ArtifactoryCE](https://docs.conan.io/1/uploading_packages/using_artifactory.html) - recommended for production environments +- [Cache recipes in your own ArtifactoryCE](https://docs.conan.io/2/devops/devops_local_recipes_index.html) - recommended for production environments Using your own ArtifactoryCE instance is easy. You can [deploy it on-premise](https://conan.io/downloads.html) or use a -[cloud provided solution](https://jfrog.com/community/start-free) for **free**. Your project should -[use only this remote](https://docs.conan.io/1/reference/commands/misc/remote.html?highlight=add%20new) and new recipe +[cloud provided solution](https://jfrog.com/start-free) for **trial**. +Your project should [use only this remote](https://docs.conan.io/2/reference/commands/remote.html#conan-remote-add) and new recipe revisions are only pushed to your Artifactory after they have been validated in your project. -The minimum solution, if still choosing to rely on ConanCenter directly, involves small changes to your client configuration by pinning the revision of every reference you consume in your project using using: +The minimum solution, if still choosing to rely on ConanCenter directly, involves small changes to your client configuration by pinning the revision of every reference you consume in your project using the following: -- [recipe revision (RREV)](https://docs.conan.io/1/versioning/revisions.html) can be added to each requirement. +- [recipe revision (RREV)](https://docs.conan.io/2/tutorial/versioning/revisions.html#using-revisions) can be added to each requirement. Instead of `fmt/9.1.0` you can add a pound (or hashtag) to the end followed by the revision `fmt/9.1.0#c93359fba9fd21359d8db6f875d8a233`. - This feature needs to be enabled in Conan 1.x, see the [Activation Instructions](https://docs.conan.io/1/versioning/revisions.html#how-to-activate-the-revisions) for details. -- [Lockfiles](https://docs.conan.io/1/versioning/lockfiles.html) can be created with the `conan lock create` and read with by - adding `--lockfile=conan.lock` to `conan install` or `conan create` commands. See the [lockfile introduction](https://docs.conan.io/1/versioning/lockfiles/introduction.html#) for more information. - -> **Warning** Please, be aware there are some known bugs related to lockfiles that are not being fixed in Conan v1.x - we are really excited for the 2.0 improvements to be widely used. +- [Lockfiles](https://docs.conan.io/2/tutorial/versioning/lockfiles.html) can be created with the `conan lock create` and read with by + adding `--lockfile=conan.lock` to `conan install` or `conan create` commands. See the [lockfile introduction](https://docs.conan.io/2/tutorial/consuming_packages/intro_to_versioning.html#lockfiles) for more information. Both of these give you better control and will allow you to choose when to upgrade your Conan client. diff --git a/docs/developing_recipes_locally.md b/docs/developing_recipes_locally.md index 2d101facc3b5e..3a028a8c6ff61 100644 --- a/docs/developing_recipes_locally.md +++ b/docs/developing_recipes_locally.md @@ -4,15 +4,11 @@ Before you can contribute any code changes, you'll need to make sure you are fam This file is intended to provide all the commands you need to run in order to be an expert ConanCenterIndex contributor. -> **Note**: If you are working with Conan 2.0, the [instructions are below](#using-conan-20) - ## Contents * [Clone your fork](#clone-your-fork) * [Setup your environment](#setup-your-environment) - * [Installing the ConanCenter Hooks](#installing-the-conancenter-hooks) - * [Updating conan hooks on your machine](#updating-conan-hooks-on-your-machine) * [Basic Commands](#basic-commands) * [Try it yourself](#try-it-yourself) * [Debugging Failed Builds](#debugging-failed-builds) @@ -22,10 +18,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) + * [Docker build images used by ConanCenterIndex](#docker-build-images-used-by-conancenterindex) ## Clone your fork @@ -35,53 +28,21 @@ This file is intended to provide all the commands you need to run in order to be ## Setup your environment 1. Install a C++ development toolchain - ConanCenter's [build images](#testing-more-environments) are available -2. [Install the Conan client](https://docs.conan.io/1/installation.html) - make sure to keep it up to date! +2. [Install the Conan client](https://docs.conan.io/2/installation.html) - make sure to keep it up to date! 3. Install CMake - this is the only tool which is assumed to be present [see FAQ](faqs.md#why-recipes-that-use-build-tools-like-cmake-that-have-packages-in-conan-center-do-not-use-it-as-a-build-require-by-default) for details. > **Note**: It's recommended to use a dedicated Python virtualenv when installing with `pip`. -### Installing the ConanCenter Hooks - -> **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: - -```sh -conan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks -conan config set hooks.conan-center -``` - -> **Note**: Hooks are generally for package correctness and the pylinters are for the recipe syntax - -The hooks will show error messages but the `conan create` won’t fail unless you export the environment variable `CONAN_HOOK_ERROR_LEVEL=40`. -All hooks checks will print a similar message: - -```txt -[HOOK - conan-center.py] post_source(): [LIBCXX MANAGEMENT (KB-H011)] OK -[HOOK - conan-center.py] post_package(): ERROR: [PACKAGE LICENSE] No package licenses found -``` - -#### Updating conan hooks on your machine - -The hooks are updated from time to time, so it's worth keeping your own copy of the hooks updated regularly. To do this, simply run: - -```sh -conan config install -``` - ## Basic Commands We recommend working from the `recipes/project` folder itself. You can learn about the [recipe file structure](adding_packages/README.md#recipe-files-structure) to understand the folder and files located there. > **Note**: You can only change one recipe per pull request, and working from the [_recipe folder_](adding_packages/README.md#the-recipe-folder-conanfilepy) will help prevent making a few mistakes. The default for this folder is `all`, follow the link above to learn more. -The [entire workflow of a recipe](https://docs.conan.io/1/developing_packages/package_dev_flow.html) can be execute with the [`conan create`](https://docs.conan.io/1/reference/commands/creator/create.html). This should look like: - -* `conan create all/conanfile.py 0.0.0@ -pr:b=default -pr:h=default` +The [entire workflow of a recipe](https://docs.conan.io/2/tutorial/creating_packages.html) can be executed with the [`conan create`](https://docs.conan.io/2/reference/commands/create.html). This should look like: -ConanCenter also has a few [support settings and options](supported_platforms_and_configurations.md) which highly recommend to test. For example -`conan create all/conanfile.py 0.0.0@ -o project:shared=True -s build_type=Debug` is a easy way to test more configurations ensuring the package is correct. +* `conan create all/conanfile.py --version=0.1.0` ### Try it yourself @@ -89,110 +50,29 @@ For instance you can create packages for `fmt` in various supported configuratio ```sh cd recipes/fmt -conan create all/conanfile.py fmt/9.0.0@ -pr:b=default -pr:h=default -conan create all/conanfile.py fmt/9.0.0@ -o fmt:header_only=True -pr:b=default -pr:h=default -conan create all/conanfile.py fmt/9.0.0@ -s build_type=Debug -o fmt:shared=True -pr:b=default -pr:h=default +conan create all/conanfile.py --version=9.0.0 +conan create all/conanfile.py --version=9.0.0 -o "&:header_only=True" +conan create all/conanfile.py --version=9.0.0 -s build_type=Debug -o "*/*:shared=True" ``` ## Debugging Failed Builds -Some common errors related to Conan can be found on [troubleshooting](https://docs.conan.io/1/faq/troubleshooting.html) section. -For ConanCenter Hook errors, go to the [Error Knowledge Base](error_knowledge_base.md) page to know more about those. +Some common errors related to Conan can be found on [troubleshooting](https://docs.conan.io/2/knowledge/faq.html#troubleshooting) section. -To test with the same environment, the [build images](supported_platforms_and_configurations.md#build-images) are available. Instructions for using these images can be found in [Testing more environments](#testing-more-environments) section. In ConanCenterIndex, the most common failure point is upstream build scripts tailored to their specific use cases. It's not uncommon to [patch build scripts](adding_packages/sources_and_patches.md#rules) but make sure to read the -[patch policy](adding_packages/sources_and_patches.md#policy-about-patching). You are encouraged to submit pull requests upstream. - -## Running the Python Linters - -> **Warning**: This is not yet supported with Conan 2.0 - -Linters are always executed by GitHub Actions to validate parts of your recipe, for instance, if it uses migrated Conan tools imports. - -It is possible to run the linter locally the same way it is being run [using Github actions](../.github/workflows/linter-conan-v2.yml) by: - -* (Recommended) Use a dedicated Python virtualenv. -* Ensure you have required tools installed: `conan` and `pylint` (better to uses fixed versions) - - ```sh - pip install conan~=1.0 pylint==2.14 - ``` - -* Set environment variable `PYTHONPATH` to the root of the repository - - ```sh - export PYTHONPATH=your/path/conan-center-index - ``` - -* Now you just need to execute the `pylint` commands: - - ```sh - # Lint a recipe: - pylint --rcfile=linter/pylintrc_recipe recipes/fmt/all/conanfile.py - - # Lint the test_package - pylint --rcfile=linter/pylintrc_testpackage recipes/fmt/all/test_package/conanfile.py - ``` - -## Running the YAML Linters - -There's two levels of YAML validation, first is syntax and the second is schema. -The style rules are located in [`linter/yamllint_rules.yml`](../linter/yamllint_rules.yml) and are used to ensure consistence. -The [`config.yml`](adding_packages/README.md#configyml) is required for the build infrastructure and the -[`conandata.yml` patch fields](adding_packages/conandata_yml_format.md#patches-fields) have required elements that are enforced with -schema validation. There's are to encourage the best possible quality of recipes and make reviewing faster. - -### Yamllint - -* (Recommended) Use a dedicated Python virtualenv. -* Ensure you have required tools installed: `yamllint` (better to uses fixed versions) - - ```sh - pip install yamllint==1.28 - ``` - -* Now you just need to execute the `yamllint` commands: - - ```sh - # Lint a recipe: - yamllint --config-file linter/yamllint_rules.yml -f standard recipes/config.yml - yamllint --config-file linter/yamllint_rules.yml -f standard recipes/fmt/all/conandata.yml - ``` - -### Yamlschema - -* (Recommended) Use a dedicated Python virtualenv. -* Ensure you have required tools installed: `strictyaml` and `argparse` (better to uses fixed versions) - - ```sh - pip install strictyaml==1.16 argparse==1.4 - ``` - -* Now you just need to execute the validation scripts: +[patch policy](adding_packages/sources_and_patches.md#policy-about-patching). You are encouraged first to submit pull requests upstream. - ```sh - # Lint a config.yml: - python3 linter/config_yaml_linter.py recipes/fmt/config.yml - # Lint a conandata.yml - python3 linter/conandata_yaml_linter.py recipes/fmt/all/conandata.yml - ``` - -## Testing the different `test_*_package` +## Testing This can be selected when calling `conan create` or separately with `conan test` -```sh -# By adding the `-tf` argument -conan create recipes/fmt/all/conanfile.py 9.0.0@ -tf test_v1_package/ -pr:b=default -pr:h=default -``` - ```sh # Passing test package's conanfile directly (make sure to export first) -conan test recipes/fmt/all/test_v1_package/conanfile.py fmt/9.0.0@ -pr:h=default -pr:b=default +conan test recipes/fmt/all/test_package/conanfile.py fmt/9.0.0 ``` ## Testing more environments @@ -207,96 +87,12 @@ Assuming you've already tested it locally and it's been successfully exported to * You can also download them from CCI build summary 2. Build missing packages -Example. - -```sh -docker run -v/Users/barbarian/.conan:/home/conan/.conan conanio/gcc8 bash -c "conan profile new --detect gcc8" -docker run -v/Users/barbarian/.conan:/home/conan/.conan conanio/gcc8 bash -c "conan install -pr gcc8 fmt/9.0.0@ --build missing" -``` +Please, read [how to create Conan package using a Docker runner](https://docs.conan.io/2/examples/runners/docker/basic.html). > **Note**: If you are running on Mac M1, the follow Docker argument is required: `--platform=linux/amd64` If you are working with packages that have system dependencies that are managed by Conan -```sh -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 -[Conan 2.0 Migrations](https://docs.conan.io/1/conan_v2.html) docs. - -This should be non-intrusive. Conan 2.0 by default has a different `CONAN_USER_HOME` location, which means that it has separate caches, profiles, and settings. -This will leave your Conan 1.0 setup completely intact when using Conan 2.0. - -> **Note**: There are substantial changes to the CLI so very few of the commands will remain the same. -> The new [Unified Command Pattern](https://docs.conan.io/1/migrating_to_2.0/commands.html#unified-patterns-in-command-arguments), -> as an example, changes how settings and options are passed. - -### Installing Conan 2.0 beta - -Simply install Conan 2.0 with `pip install conan --upgrade --pre`. - -You can confirm the installation with: - -```sh -$ conan --version -Conan version 2.0.0-beta3 -$ conan config home -Current Conan home: /Users/barbarian/.conan2 -``` - -> **Note**: You will most likely see -> -> ```sh -> Initialized file: '/Users/barbarian/.conan2/settings.yml' -> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/compatibility/compatibility.py' -> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/compatibility/app_compat.py' -> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/compatibility/cppstd_compat.py' -> Initialized file: '/Users/barbarian/.conan2/extensions/plugins/profile.py' -> ``` -> -> When running the client for the first time. - -You will need to setup profiles. This is one of the changes in 2.0. The default profile is now opt-in and no longer generated automatically. - -```sh -conan profile detect -``` - -> **Warning**: This is a best guess, you need to make sure it's correct. - -### Trying it out - -Try building an existing recipe. We'll repeat the 1.x example with `fmt` to build the same configurations: - -```sh -cd recipes/fmt -conan create all/conanfile.py --version 9.0.0 -conan create all/conanfile.py --version 9.0.0 -o fmt/9.0.0:header_only=True -conan create all/conanfile.py --version 9.0.0 -s build_type=Debug -o fmt/9.0.0:shared=True -``` +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). \ No newline at end of file diff --git a/docs/error_knowledge_base.md b/docs/error_knowledge_base.md deleted file mode 100644 index 415d9fd2e98fc..0000000000000 --- a/docs/error_knowledge_base.md +++ /dev/null @@ -1,499 +0,0 @@ -# Errors from the conan-center hook (KB-Hxxx) - -These are located at [conan-io/hooks](https://github.com/conan-io/hooks/blob/master/hooks/conan-center.py). - -#### **#KB-H001: "DEPRECATED GLOBAL CPPSTD"** - -`Conan > 1.15` deprecated the usage of the global ``cppstd`` setting in favor of ``compiler.cppstd`` to [manage C++ standard](https://docs.conan.io/1/howtos/manage_cpp_standard.html). As a subsetting of the compiler, it shouldn't be declared in the `conanfile.py`. - -#### **#KB-H002: "REFERENCE LOWERCASE"** - -The package names in conan-center have to be [lowercase](https://github.com/conan-io/tribe/blob/main/design/017-lowercase-references.md). e.g: ``zlib/1.2.8``. - -#### **#KB-H003: "RECIPE METADATA"** - -The recipe has to declare the following attributes: - -- [url](https://docs.conan.io/1/reference/conanfile/attributes.html#url) -- [license](https://docs.conan.io/1/reference/conanfile/attributes.html#license) -- [description](https://docs.conan.io/1/reference/conanfile/attributes.html#description) -- [homepage](https://docs.conan.io/1/reference/conanfile/attributes.html#homepage). - -Also we recommend adding [topics](https://docs.conan.io/1/reference/conanfile/attributes.html#topics) attribute. - -#### **#KB-H005: "HEADER_ONLY, NO COPY SOURCE"** - -If the recipe calls [self.info.header_only()](https://docs.conan.io/1/howtos/header_only.html) in the [package_id()](https://docs.conan.io/1/reference/conanfile/methods.html#package-id) method and doesn't declare settings, it should use the [no_copy_source](https://docs.conan.io/1/reference/conanfile/attributes.html#no-copy-source) attribute to avoid unnecessary copies of the source code. - -#### **#KB-H006: "FPIC OPTION"** - -The recipe is not for a header-only library and should have an `fPIC` option: - -```python -class SomeRecipe(ConanFile): - ... - - options = {"fPIC": [True, False]} - default_options = {"fPIC": True} -``` - -#### **#KB-H007: "FPIC MANAGEMENT"** - -The recipe declares `fPIC` but doesn't remove the option for Windows (where it doesn't make sense). - -```python -class SomeRecipe(ConanFile): - ... - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC -``` - -Or, a package is built as `shared` library and `fPIC` is declared. The option `fPIC` should be removed: - -```python -class SomeRecipe(ConanFile): - ... - - def configure(self): - if self.options.shared: - del self.options.fPIC -``` - -Here we use [configure()](https://docs.conan.io/1/reference/conanfile/methods.html#configure-config-options) method, because user options are loaded after [config_options()](https://docs.conan.io/1/reference/conanfile/methods.html#configure-config-options) only. - -#### **#KB-H008: "VERSION RANGES"** - -See [Dependencies Version Ranges](adding_packages/dependencies.md#version-ranges) for details. - -#### **#KB-H009: "RECIPE FOLDER SIZE"** - -The recipe folder (including the `test_package` folder) cannot exceed 256KB. - -#### **#KB-H010: "IMMUTABLE SOURCES"** - -Create a file [conandata.yml](https://docs.conan.io/1/reference/config_files/conandata.yml.html) in the recipe folder containing the source code origins: - -**_recipes/lib/1.2.0/conandata.yml_**: - -```yaml -sources: - 1.2.0: - url: "http://downloads.sourceforge.net/project/mylib/1.2.0/sources.tar.gz" - sha256: "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d" -``` - -Then in the recipe, you can access the data to download the URL and validate the checksum doing: - -```python -class SomeRecipe(ConanFile): - ... - - def source(self): - tools.get(**self.conan_data["sources"][self.version]) -``` - -#### **#KB-H011: "LIBCXX MANAGEMENT"** - -If the library is detected as a pure C library (sources doesn't conatain any file with the following extensions: ["cc", "cpp", "cxx", "c++m", "cppm", "cxxm", "h++", "hh", "hxx", "hpp"]) then it has to remove the [compiler.libcxx](https://docs.conan.io/1/reference/config_files/settings.yml.html#c-standard-libraries-aka-compiler-libcxx) subsetting, because the cpp standard library shouldn't affect the binary ID: - -```python -class SomeRecipe(ConanFile): - ... - - def configure(self): - del self.settings.compiler.libcxx -``` - -#### **#KB-H012: "PACKAGE LICENSE"** - -The binary packages should contain a folder named `licenses` containing the contents (library, tool, etc) license/s. - -#### **#KB-H013: "DEFAULT PACKAGE LAYOUT"** - -The binary packages generally do not need any other files or folder except the following: `["lib", "bin", "include", "res", "licenses"]`. -This closely matches the default [`cpp_info`](https://docs.conan.io/1/reference/conanfile/methods.html#package-info) from the client. -The upstream package layout should be followed as much as possible, if a folder is not in the list (like `"share"`) then an exception -can very easily be added by adding it to [this list of exceptions](https://github.com/conan-io/hooks/blob/d587cfebbf2b31c16e477b79c0c2fd4501f60fc8/hooks/conan-center.py#L1089-L1090). - -> **Note**: We are in the process of evaluating this rule, looking at calculating the size impact for problematic packages - -#### **#KB-H014: "MATCHING CONFIGURATION"** - -The binary package contains some file that not corresponds to the configuration of the package, for example, binary libraries for a header-only library, a DLL file when the `settings.os != Windows` and so on. The error message will contain information about the offending file. - -#### **#KB-H015: "SHARED ARTIFACTS"** - -The binary package is shared (self.options.shared == True) but there is no `dll`, `so` or `dylib` files inside the package. - -#### **#KB-H016: "CMAKE-MODULES-CONFIG-FILES"** - -The binary package cannot contain module or config CMake files ("Find\*.cmake", "\*Config.cmake", "\*-config.cmake"). -The package shouldn't contain specific build-system files to inform to the consumers how to link with it. -In order to make sure that the package will be consumed with any build-system, conan-center repository encourages to declare a [def package_info(self)](https://docs.conan.io/1/reference/conanfile/methods.html#package-info) method with all the needed information about the package. - -The consumers of the package will be able to consume the packages using a specific [generators](https://docs.conan.io/1/using_packages/conanfile_txt.html#generators) for the build system they use. - -See also: [Why are CMake find/config files and pkg-config files not packaged?](faqs.md#why-are-cmake-findconfig-files-and-pkg-config-files-not-packaged). - -#### **#KB-H017: "PDB FILES NOT ALLOWED"** - -Because of the big size of the [PDB](https://github.com/Microsoft/microsoft-pdb) files (Program Databse, a debug information format) and the issues using them changing the original folders, the PDB files are not allowed to be packaged. - -See also: [Why PDB files are not allowed?](faqs.md#why-pdb-files-are-not-allowed). - -#### **#KB-H018: "LIBTOOL FILES PRESENCE"** - -Packaging [libtool files](https://www.linuxfromscratch.org/blfs/view/svn/introduction/la-files.html) (\*.la) instead of library files (\*.a) is not allowed. - -#### **#KB-H019: "CMAKE FILE NOT IN BUILD FOLDERS"** - -Some file with `*.cmake` extension has been found in a folder not declared in [cpp_info.builddirs](https://docs.conan.io/1/reference/conanfile/attributes.html#cpp-info). -It is only allowed to put build files in `builddirs` because the generators might be able to include them when needed, but only if they are located in well known paths. - -#### **#KB-H020: "PC-FILES"** - -For the same reasons explained at [KB-H016](#KB-H016) it is not allowed to package `*.pc` files. - -See also: [Why are CMake find/config files and pkg-config files not packaged?](faqs.md#why-are-cmake-findconfig-files-and-pkg-config-files-not-packaged). - -#### **#KB-H021: "MS RUNTIME FILES"** - -For the legal reasons, and in order to reduce the size of packages, it's not allowed to package Microsoft Visual Studio runtime libraries, such as `msvcr80.dll`, `msvcp80.dll`, `vcruntime140.dll` and so on. - -#### **#KB-H022: "CPPSTD MANAGEMENT"** - -If the library is detected as a pure C library (sources doesn't conatain any file with the following extensions: ["cc", "cpp", "cxx", "c++m", "cppm", "cxxm", "h++", "hh", "hxx", "hpp"]) then it has to remove the [compiler.cppstd](https://docs.conan.io/1/howtos/manage_cpp_standard.html) subsetting, because the cpp standard library shouldn't affect the binary ID: - -```python -class SomeRecipe(ConanFile): - ... - - def configure(self): - del self.settings.compiler.cppstd -``` - -#### **#KB-H023: "EXPORT LICENSE"** - -A recipe should not export any license file, as all recipes are under the same license type (in the root of this repo). - -```python -class SomeRecipe(ConanFile): - ... - - exports = "LICENSE.md" # not allowed -``` - -There is a complete explanation in the [FAQ](faqs.md#should-recipes-export-a-recipes-license). - -#### **#KB-H024: "TEST PACKAGE FOLDER"** - -The [test_package](https://docs.conan.io/1/creating_packages/getting_started.html) folder is required for every recipe in Conan Center Index. - -``` -. conanfile.py -. test_package - |- conanfile.py -``` - -#### **#KB-H025: "META LINES"** - -The following metadata lines (and similiar) are not allowed in recipes: - -- [Shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) to specify Python version: - -```python -#!/usr/bin/env python # not allowed -#!/usr/local/bin/python # not allowed - -class SomeRecipe(ConanFile): - ... -``` - -- [Vim](https://www.vim.org/) configuration: - -```python -# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # not allowed - -class SomeRecipe(ConanFile): - ... -``` - -- [Encoding](https://www.python.org/dev/peps/pep-0263/): - -```python -# -*- coding: utf-8 -*- # not allowed -# coding=utf-16 # not allowed - -class SomeRecipe(ConanFile): - ... -``` - -#### **#KB-H027: "CONAN CENTER INDEX URL"** - -The attribute [url](https://docs.conan.io/1/reference/conanfile/attributes.html#url) should point to the address where the recipe is located. -The current Conan Center Index address is - -#### **#KB-H028: "CMAKE MINIMUM VERSION"** - -All CMake files added to recipe package should contain a [minimal version](https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html) (Not necessarily 2.8.11, it can be any version) available in the file: - -```cmake -# CMakeLists.txt -cmake_minimum_required(VERSION 2.8.11) -project(conanwrapper) - -... -``` - -#### **#KB-H029: "TEST PACKAGE - RUN ENVIRONMENT"** - -The [RunEnvironment()](https://docs.conan.io/1/reference/build_helpers/run_environment.html#runenvironment) build helper is no longer needed in the `test_package/conanfile.py`. It has been integrated by [run_environment](https://docs.conan.io/1/devtools/running_packages.html#running-from-packages) parameter. - -```python -# test_package/conanfile.py -class TestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - - def test(self): - self.run("bin/test", run_environment=True) -``` - -#### **#KB-H030: "CONANDATA.YML FORMAT"** - -The structure of the [conandata.yml](https://docs.conan.io/1/reference/config_files/conandata.yml.html) file should follow the schema -defined in [Adding Packages - `Conandata.yml` Format](adding_packages/conandata_yml_format.md). - -#### **#KB-H031: "CONANDATA.YML REDUCE"** - -This [hook](https://docs.conan.io/1/extending/hooks.html) re-creates the information of the [conandata.yml](https://docs.conan.io/1/reference/config_files/conandata.yml.html) file, discarding the fields not relevant to the version of the package exported. This avoids creating new recipe revisions for every new change introduced in the file. -Any additional field in the YAML file will raise an error. - -#### **#KB-H032: "SYSTEM REQUIREMENTS"** - -[System requirements](https://docs.conan.io/1/reference/conanfile/methods.html#systempackagetool) can be used as an option when a Conan package is not available ,the same package can be installed by system package manager. However, it can cause reproducibility problems, since the package may vary according the distribution or OS. Conan is not able to track its metadata, so that, installing system packages by recipe is not allowed. - -See also: [Can I install packages from the system package manager?](faqs.md#can-i-install-packages-from-the-system-package-manager). - -#### **#KB-H034: "TEST PACKAGE - NO IMPORTS()"** - -The method [imports](https://docs.conan.io/1/reference/conanfile/methods.html#imports) helps the test package stage copying all dynamic libraries and special resources. However, the [run_environment](https://docs.conan.io/1/reference/conanfile/other.html#running-commands) parameter, used when running commands, is able to solve all paths to the dynamic libraries installed in your cache. - -#### **#KB-H037: "NO AUTHOR"** - -Since the entire community is maintaining all CCI recipes, putting just one name in a recipe is unfair, putting all names is unmanageable. All authors can be found in the Git logs. - -#### **#KB-H040: "NO TARGET NAME"** - -According the Conan issue [#6269](https://github.com/conan-io/conan/issues/6269), the attribute `cpp_info.name` should be avoided for Conan Center Index in favor of `cpp_info.names["cmake_find_package"]` and `cpp_info.names["cmake_find_package_multi"]`. - -See also: [Migrating legacy cpp_info attributes to set_property()](https://docs.conan.io/1/migrating_to_2.0/properties.html). - -#### **#KB-H041: "NO FINAL ENDLINE"** - -Source files should end with a final endline. -This avoids potential warnings/errors like `no new line at the end of file`. - -#### **#KB-H044: "NO REQUIRES.ADD()"** - -Both `self.requires.add()` and `self.build_requires.add()` have been deprecated in favor of [self.requires()](https://docs.conan.io/1/reference/conanfile/methods.html#requirements) and [self.build_requires()](https://docs.conan.io/1/reference/conanfile/methods.html#build-requirements) which were introduced on Conan 1.x. Both `add()` were introduced during Conan 0.x and since Conan 1.23 they no longer follow the original behavior. - -#### **#KB-H045: "DELETE OPTIONS"** - -The method `self.options.remove()` was introduced in Conan 0.x, however, Conan 1.x brings a more pythonic way for removing options from your recipe: `del self.options.` - -See also: [configure(), config_options()](https://docs.conan.io/1/reference/conanfile/methods.html#configure-config-options). - -#### **#KB-H046: "CMAKE VERBOSE MAKEFILE"** - -The CMake definition [CMAKE_VERBOSE_MAKEFILE](https://cmake.org/cmake/help/latest/variable/CMAKE_VERBOSE_MAKEFILE.html) helps for debugging when developing, however, for regular CI build, it increases the log size and it's only required when problems occur and need to be verified. - -#### **#KB-H048: "CMAKE VERSION REQUIRED"** - -> **Warning**: This is a legacy Conan 1.x details from the deprecated generators - -The file test_package/CMakeLists.txt should require CMake 3.15 by default: [cmake_minimum_required(VERSION 3.15)](https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html). The CMake wrapper file can require CMake 2.8, because Conan recipe and the test package are totally separated. However, if [CMAKE_CXX_STANDARD](https://cmake.org/cmake/help/latest/variable/CMAKE_CXX_STANDARD.html) or [CXX_STANDARD](https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD) is explicit, CMake 3.1 is mandatory. - -#### **#KB-H049: "CMAKE WINDOWS EXPORT ALL SYMBOLS"** - -The CMakeLists.txt definitions [CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS](https://cmake.org/cmake/help/v3.4/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.html) and [WINDOWS_EXPORT_ALL_SYMBOLS](https://cmake.org/cmake/help/v3.4/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html) are available since CMake 3.4 only. Any previous version will ignore it. - -#### **#KB-H050: "DEFAULT SHARED OPTION VALUE"** - -By default, all packages should be built as static library (the option ``shared`` is ``False`` in ``default_options``). However, some projects can be restricted to shared library only, for those cases, open a new [issue](https://github.com/conan-io/hooks/issues) to include the package name in the allowlist. - -#### **#KB-H051: "DEFAULT OPTIONS AS DICTIONARY"** - -The attribue [default_options](https://docs.conan.io/1/reference/conanfile/attributes.html#default-options) should be a dictionary, for example `default_options = {'shared': False, 'fPIC': True}`. - -#### **#KB-H052: "CONFIG.YML HAS NEW VERSION"** - -It's important to have new library version defined in both [config.yml](adding_packages/folders_and_files.md#configyml) and -[conandata.yml](adding_packages/folders_and_files.md#conandatayml), otherwise newly added version will not be checked and built -by CI and will not be available for download. - -#### **#KB-H053: "PRIVATE IMPORTS"** - -The recipe imports private Conan API, this is strongly discouraged - private imports are subjects to breaking changes. Avoid usage of private APIs, -request to publicly expose needed methods, if necessary. - -#### **#KB-H054: "LIBRARY DOES NOT EXIST"** - -Libraries which are listed on [Components](https://docs.conan.io/1/creating_packages/package_information.html#package-information-components) must be present in [libdirs](https://docs.conan.io/1/reference/conanfile/attributes.html#cpp-info). Check if the library name is correct, or if a library is only generated for a specific platform. - -#### **#KB-H055: "SINGLE REQUIRES"** - -Do not use [requirements()](https://docs.conan.io/1/reference/conanfile/methods.html#requirements) method and [self.requires](https://docs.conan.io/1/reference/conanfile/attributes.html#requires) attribute together in the same recipe. -The duality creates a heterogeneous way of solving dependencies, making it difficult to review and susceptible to prone errors. - -#### **#KB-H056: "LICENSE PUBLIC DOMAIN"** - -See [License Attribute](adding_packages/conanfile_attributes.md#license-attribute) for details. - -#### **#KB-H057: "TOOLS RENAME"** - -The [rename()](https://docs.conan.io/1/reference/conanfile/tools/files.html#conan-tools-rename) method will be the standard for Conan 2.0, and -also, it uses [robocopy](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy), which is safer on Windows. - -#### **#KB-H058: "ILLEGAL CHARACTERS"** - -Windows [naming conventions](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) and [reserved](https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words) characters must be avoided for file naming, otherwise the will not be supported on Windows. - -#### **#KB-H059: "CLASS NAME"** - -Generic class names can cause review confusion. To keep a better naming, it should use `Conan`. - -#### **#KB-H060: "NO CRLF"** - -Files with [CRLF](https://en.wikipedia.org/wiki/Newline) as endline can cause CI errors when building a package, due the conversion to LF and false detection from CI as changed file. -The [.gitattributes](https://git-scm.com/docs/gitattributes) file lists which files should be converted to LF when commit. However, if you want to enforce it in your local copy, you may run: - - > git config --local core.autocrlf false - > git config --local core.eol lf - -The [core.autocrlf](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration) disabled means that git will not convert from CRLF to LF on commit. The [core.eol](https://git-scm.com/docs/git-config) sets the specific line ending to be used for every commit. - -#### **#KB-H062: "TOOLS CROSS BUILDING"** - -Replace all occurrences of `tools.cross_building(self.settings)` with [tools.cross_building(self)](https://docs.conan.io/1/reference/tools.html#tools-cross-building). -When cross building, conan needs to compare [self.settings](https://docs.conan.io/1/reference/conanfile/attributes.html#settings) and [self.settings_build](https://docs.conan.io/1/systems_cross_building/cross_building.html), which are attributes of `self`. - -#### **#KB-H064: "INVALID TOPICS"** - -An invalid [topic](https://docs.conan.io/1/reference/conanfile/attributes.html#topics) has been detected. Remove or rename it. -Right now, topic `conan` is considered redundant and it's not needed to explicitly list it within recipe. - -#### **#KB-H065: "NO REQUIRED_CONAN_VERSION"** - -The recipe misses [required_conan_version](https://docs.conan.io/1/reference/conanfile/other.html#requiring-a-conan-version-for-the-recipe) attribute. -It may happen due to the usage of new features within recipe (such as `strip_root` parameter of the [tools.get](https://docs.conan.io/1/reference/conanfile/tools/files/downloads.html#conan-tools-files-get) helper). -The policy of Conan Center Index to support only the latest version of the Conan Client, so it's safe to put the version Conan Center Index currently runs into the recipe. -Otherwise, it's not an easy task on its own to determine the minimal version that has to be specified: checking the Conan Client [Changelog](https://docs.conan.io/1/changelog.html), one has to know in which Conan Client releases all the attributes, methods, build helpers, etc. used by the recipe were first introduced, and then select the most recent of them. -Consider adding the following code: - -```python -required_conan_version = ">=1.43.0" # use the version that Conan Center Index runs - -class SomeRecipe(ConanFile): - ... - -``` - -See also: [Submitting a Package](adding_packages/README.md#submitting-a-package). - -#### **#KB-H066: "SHORT_PATHS USAGE"** - -The recipe missess [short_paths](https://docs.conan.io/1/reference/conanfile/attributes.html#short-paths) attribute. -It may happen due to the very long paths within source, build or package directories during the package creating. -Consider adding the following code: - -```python -class SomeRecipe(ConanFile): - ... - - short_paths = True -``` - -See also: [Maximum Path Length Limitation](https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd). - -#### **#KB-H068: "TEST_TYPE MANAGEMENT"** - -In Conan 2.0, see [migration guide](https://docs.conan.io/1/migrating_to_2.0/recipes.html#changes-in-the-test-package-recipe), -the `test_package/conanfile.py` needs to declare the requirement being tested explicitly. To be prepared you -have to set the attribute `test_type="explicit"` (this will be ignored in 2.0) to make Conan activate the explicit -mode, then declaring the requirement using the `self.tested_reference_str` that contains the reference being tested. - -#### **#KB-H069: "TEST PACKAGE - NO DEFAULT OPTIONS"** - -This is to ensure the exact package that is built and uploaded is tested against. When `options` of `default_options` are modified in a -`test_package` it can possibly result in the graph being modified. The objective is to enforce quality of the packages and to avoid confusing -"missing packages" errors. - -#### **#KB-H070: "MANDATORY SETTINGS"** - -> :information_source: This rule was put in place as it was deemed safe for evaluation however there is room for improvement - -ConanCenter operates is profiles with a predefined list of settings, all of these much be present in the recipe to ensure `package_id`s are -computed correctly. Some libraries, for instance header-only, do not require all the settings and those should be deleted from the `package_id`. -This approach ensure consistency and reduces the learning curve. - -Recipes should include: - -```python -class SomeRecipe(ConanFile): - ... - - settings = "os", "compiler", "build_type", "arch" -``` - -- For header-only recipes ([example](https://github.com/conan-io/conan-center-index/blob/3a773e2d69ada3bd931252c43a48daf636ddfe87/recipes/eigen/all/conanfile.py#L35-L36)): - - ```python - def package_id(self): - self.info.header_only() - ``` - -There is the case when the package is header-only, but the options affects the generated artifact, (e.g. kanguru, pagmo2 ...), so you need to use `self.info.settings.clear()` instead. - -- @prince-chrismc This needs to a better example; For "tool" recipes ([example](https://github.com/conan-io/conan-center-index/blob/e604534bbe0ef56bdb1f8513b83404eff02aebc8/recipes/cmake/3.x.x/conanfile.py#L104-L105)) which only provide binaries, see [our packaging policy](adding_packages/build_and_package.md) for more, should do as follows: - - ```python - def package_id(self): - del self.info.settings.compiler - ``` - -#### **#KB-H071: "INCLUDE PATH DOES NOT EXIST"** - -It's erroneous to leave the default `include` directory when it's not present. Consider adding: - -```python -def package_info(self): - self.cpp_info.includedirs = [] -``` - -#### **#KB-H072: "PYLINT EXECUTION"** - -Pylint is executed by default over all `conanfile.py` files in ConanCenterIndex and it should not be skipped. It's an important tool which helps us keep a standard level of acceptance. Otherwise, it would be incredibly hard to review all recipes and keep them to the same level of standards. - -#### **#KB-H075: "REQUIREMENT OVERRIDE PARAMETER"** - -The [self.requires()](https://docs.conan.io/1/reference/conanfile/methods.html#requirements) allows to override a dependency version, forcing to use that version imposed by the recipe only. As a side-effect, dependencies can use different versions of the same project at the same package, which may cause unpredicted errors, like ABI incompatibility. For that reason, the `override` parameter is forbidden and should not be used. Instead, all dependencies should align their package versions, even when it's necessary to open more pull requests to update dependency versions. - -#### **#KB-H076: "EITHER STATIC OR SHARED OF EACH LIB"** - -It checks whether static & shared artifacts of the same lib are packaged together. Also, if there are tuples of (.a/.dylib) or (.a/.so) files with the same name. -So it works on Unix systems only, not Windows. Putting both same library name as shared and static in the very same package is considered an error, as it should be separated -and managed by the package option `shared`. - -#### **#KB-H077: "APPLE RELOCATABLE SHARED LIBS"** - -It checks whether installed shared libs are relocatable on Linux & macOS. All shared libs on macOS properly have `@rpath/` in install tree (@rpath token is supported since macOS 10.5 Leopard). - -## Deprecated errors - -The following errors from the hooks are deprecated and no longer reported: - -### **#KB-H047: "NO ASCII CHARACTERS"** - -According to PEP [263](https://www.python.org/dev/peps/pep-0263/), Unicode literals should only appear in Python code if the encoding is declared on one of the first two lines of the source file. Without such a declaration, any Unicode literal will cause a syntax error for Python 2 interpreters. diff --git a/docs/faqs.md b/docs/faqs.md index 8fc8cb331f121..d9f87971f7113 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -27,7 +27,6 @@ This section gathers the most common questions from the community related to pac * [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) - * [Why is a `build.check_min_cppstd` call not enough?](#why-is-a-buildcheck_min_cppstd-call-not-enough) * [What is the policy for adding older versions of a package?](#what-is-the-policy-for-adding-older-versions-of-a-package) * [What is the policy for removing older versions of a package?](#what-is-the-policy-for-removing-older-versions-of-a-package) * [Can I install packages from the system package manager?](#can-i-install-packages-from-the-system-package-manager) @@ -38,13 +37,10 @@ This section gathers the most common questions from the community related to pac * [How to protect my project from breaking changes in recipes?](#how-to-protect-my-project-from-breaking-changes-in-recipes) * [What's the policy on version ranges?](#whats-the-policy-on-version-ranges) * [How to consume a graph of shared libraries?](#how-to-consume-a-graph-of-shared-libraries) - * [How to watch only specific recipes?](#how-to-watch-only-specific-recipes) - * [Is it possible to disable Pylint?](#is-it-possible-to-disable-pylint) - * [How long can I be inactive before being removed from the authorized users list?](#how-long-can-i-be-inactive-before-being-removed-from-the-authorized-users-list) * [Can we add package which are parts of bigger projects like Boost?](#can-we-add-package-which-are-parts-of-bigger-projects-like-boost) * [Can I add my project which I will submit to Boost?](#can-i-add-my-project-which-i-will-submit-to-boost) * [Can I add options that do not affect `package_id` or the package contents](#can-i-add-options-that-do-not-affect-package_id-or-the-package-contents) - * [Can I use full_package_mode for a requirement in my recipe?](#can-i-use-full_package_mode-for-a-requirement-in-my-recipe) + ## What is the policy on recipe name collisions? @@ -83,7 +79,7 @@ For libraries with a too generic name, like `variant`, the name of the organizat We know that using `find_package()` and relying on the CMake behavior to find the dependencies is something that should be avoided in favor of the information provided by the package manager. -Conan has an abstraction over the packages build system and description by using [generators](https://docs.conan.io/1/reference/generators.html). Those generators translate the information of the dependency graph and create a suitable file that can be consumed by your build system. +Conan has an abstraction over the packages build system and description by using generators. Those generators translate the information of the dependency graph and create a suitable file that can be consumed by your build system. In the past, we have found that the logic of some of the CMake's find/config or pkg-config files can lead to broken scenarios due to issues with: @@ -93,23 +89,21 @@ In the past, we have found that the logic of some of the CMake's find/config or - Hardcoded versions of dependencies as well as build options that make overriding dependencies from the consumer not possible. We believe that the package manager should be the one responsible to handle this information in order to achieve a deterministic and controlled behavior. -Regarding the integration with CMake, Conan already provides ways to consume those packages in the same way by using generators like [cmake_find_package](https://docs.conan.io/1/reference/generators/cmake_find_package.html)* or [cmake_find_package_multi](https://docs.conan.io/1/reference/generators/cmake_find_package.html) and features like [components](https://docs.conan.io/1/creating_packages/package_information.html#using-components) to define internal libraries of a package and generate proper CMake targets or [build_modules](https://docs.conan.io/1/reference/conanfile/attributes.html) to package build system utilities like CMake macros. +Regarding the integration with CMake, Conan already provides ways to consume those packages in the same way by using generators like [CmakeDeps](https://docs.conan.io/2/reference/tools/cmake/cmakedeps.html) to define internal libraries of a package and generate proper CMake targets or [cmake_build_modules](https://docs.conan.io/2/examples/graph/tool_requires/use_cmake_modules.html) to package build system utilities like CMake macros. -Defining the package information in the recipe is also useful in order to consume those packages from a different build system, for example using pkg-config with the [pkg_config generator](https://docs.conan.io/1/reference/generators/pkg_config.html). +Defining the package information in the recipe is also useful in order to consume those packages from a different build system, for example using pkg-config with the [PkgConfigDeps](https://docs.conan.io/2/reference/tools/gnu/pkgconfigdeps.html). Finally, by not allowing these files we make packages agnostic to the consumer as the logic of those files is not in the package but in the way the consumer wants the information. If you really think this is an issue and there is something missing to cover the use case of a library you want to contribute to ConanCenter, please do not hesitate to open an issue and we will be happy to hear your feedback. -\* Take a look at the integrations section to learn more: https://docs.conan.io/1/integrations/build_system/cmake/cmake_find_package_generator.html - ## 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: ``` [tool_requires] -cmake/3.17.2 +cmake/[>=3.15 <4] ``` Other packages using more unusual build tools should refer to the [Dependencies - Adding Build Requirements](adding_packages/dependencies.md#build-requirements) section for more information. @@ -120,9 +114,9 @@ The C++ ecosystem has a lot of rare, unique and obscure build systems. Some of t The recipe is expected to encode the specifics of the build system, mapping the `settings`, `options` for the binary configuration, and also mapping `self.dependencies` so the build system can locate the dependencies libraries as required. For these cases, contributors are asked to help reviewers as much as possible as it's likely we will not have expertise. -> TODO: Add a link to docs.conan.io which explains how to write a custom generator in the 2.0 sense +In Conan 2.x is possible to use [custom generatros](https://docs.conan.io/2/reference/extensions/custom_generators.html). But this feature is not allowed in conan-center-index. -For quality assurance the build service is expected to be green and the [hooks](https://github.com/conan-io/hooks) will ensure the package contents match what is expected given the options. These recipes are more likely to have +For quality assurance the build service is expected to be green and the hooks will ensure the package contents match what is expected given the options. These recipes are more likely to have inconsistency with other recipes but make for excellent contributions. ## Are python requires allowed in the `conan-center-index`? @@ -140,12 +134,12 @@ Currently, the Jenkins orchestration library for this build service is not avail ## Why not x86 binaries? -As described in the [Supported platforms and configurations](supported_platforms_and_configurations.md), only the x86_64 architecture is available for download, the rest must be built from sources. The reasons behind this decision are: +Only the x86_64 architecture is available for download, the rest must be built from sources. The reasons behind this decision are: * Few users need different pre-built packages that are not x86_64 packages, this number is less than 10% of total users (data obtained through the download counter from Bintray), and tends to decrease over the years; * Some OS are putting the x86 as obsolete, examples [macOS](https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes) and Ubuntu 20.04; * For security reasons, most companies build their own packages from sources, even if they already have a pre-built version available, which further reduces the need for extra configurations; -* Each recipe results in around 130 packages, and this is only for x86_64, but not all packages are used, some settings remain with zero downloads throughout their life. So, imagine adding more settings that will rarely be used, but that will consume more resources as time and storage, this leaves us in an impractical situation. +* Each recipe results in several packages, and this is only for x86_64, but not all packages are used, some settings remain with zero downloads throughout their life. So, imagine adding more settings that will rarely be used, but that will consume more resources as time and storage, this leaves us in an impractical situation. ### But if there are no packages available, what will the x86 validation look like? @@ -161,7 +155,7 @@ Yes! You can learn more about default options in [Packaging Policy](adding_packa The project initially decided not to support the PDB files primarily due to the size of the final package, which could add an exaggerated size and not even used by users. In addition, PDB files need the source code to perform the debugging and even follow the path in which it was created and not the one used by the user, which makes it difficult to use when compared to the regular development flow with the IDE. -However, there are ways to get around this, one of them is through the [/Z7](https://docs.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format) compilation flag, which can be passed through [environment variables](https://docs.microsoft.com/en-us/cpp/build/reference/cl-environment-variables). You can use your [profile](https://docs.conan.io/1/reference/profiles.html#package-settings-and-env-vars) to customize your compiler command line. +However, there are ways to get around this, one of them is through the [/Z7](https://docs.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format) compilation flag, which can be passed through [environment variables](https://docs.microsoft.com/en-us/cpp/build/reference/cl-environment-variables). You can use your [profile](https://docs.conan.io/2/reference/config_files/profiles.html) to customize your compiler command line. ### Why is there no option for PDB, as there is for fPIC? @@ -203,7 +197,7 @@ After one month, we will welcome a PR removing the option that was deprecated. ## Can I split a project into an installer and library package? -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). +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/2/reference/commands/install.html#reference-commands-install-composition) 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? @@ -223,35 +217,17 @@ Regardless of why, if the recipe detects a problem where binaries might not be g incorrect packages which do not work as intended. Use `ConanInvalidConfiguration` which is specially support in ConanCenter. ```py -raise ConanInvalidConfiguration(f"The project {self.ref} requires liba.enable_feature=True.") -``` - -You should not be using the `self.output.warn` and it is not enough to alter consumers or stop the build service. - -## Why is a `build.check_min_cppstd` call not enough? - -Very often C++ projects require a minimum standard version, such as 14 or 17, in order to compile. Conan offers tools which enable checking the relevant setting is enabled and above this support for a certain version is present. Otherwise, it uses the compiler's default. - -```python -def configure(self): - build.check_min_cppstd(self, 14) 👈 Wrong! +raise ConanInvalidConfiguration(f"The project {self.ref} requires liba.enable_feature=True. See ") ``` -This fails to cover the vast number of use cases for the following reasons: +You should not be using the `self.output.warning` and it is not enough to alter consumers or stop the build service. -1. `cppstd` is not configured in the `--detect`ed profiles generated by Conan, the majority of users simply do not have this setting. -2. A shocking number of projects override this setting within their respective build scripts, this setting does not get applied in those cases. -3. Conan-Center-Index does **not** manage the `cppstd` setting for the compilers it supports to generate binaries. +Also, need to point upstream's issue/PR related to the same problem. In case it's a limitation in the recipe, the same should be clear and be merged without full support: -```python -def validate(self): - # 👇 Correct - if self.settings.compiler.cppstd: - build.check_min_cppstd(self, 14) +```py +raise ConanInvalidConfiguration(f"{self.ref} Conan recipe does not support Windows. Contributions are welcome!") ``` -As a result, all calls to `build.check_min_cppstd` must be guarded by a check for the setting and the only way to ensure the C++ standard is to check the compiler's version to know if it offers sufficient support. An example of this can be found [here](https://github.com/conan-io/conan/issues/8002). - ## What is the policy for adding older versions of a package? See [Adding older versions](adding_packages/sources_and_patches.md#adding-old-versions) for details. @@ -263,10 +239,8 @@ See [Removing older versions](adding_packages/sources_and_patches.md#removing-ol ## Can I install packages from the system package manager? It depends. You can not mix both regular projects with system packages, but you can provide package wrappers for system packages. However, Conan can not track system packages, like their version and options, which creates a fragile situation where affects libraries and binaries built in your package but can not be totally reproduced. -Also, system package managers require administrator permission to install packages, which is not always possible and may break limited users. Moreover, more than one Conan package may require the same system package and there is no way to track their mutual usage. -The hook [KB-H032](error_knowledge_base.md#KB-H032) does not allow `system_requirement` nor `SystemPackageTool` in recipes, to avoid mixing both regular projects with -system packages at same recipe. +Also, system package managers require administrator permission to install packages, which is not always possible and may break limited users. Moreover, more than one Conan package may require the same system package and there is no way to track their mutual usage. There are exceptions where some projects are closer to system drivers or hardware and packaging as a regular library could result in an incompatible Conan package. To deal with those cases, you are allowed to provide an exclusive Conan package which only installs system packages, see the [How-to](adding_packages/build_and_package.md#system-packages) for more. @@ -357,7 +331,7 @@ Since these references will be never available in ConanCenter, they will be deac If consumers activate the option explicitly (`with_intel_mkl=True`), Conan will fail because of the unknown reference. -Consumers may use an [override](https://docs.conan.io/1/using_packages/conanfile_txt.html#overriding-requirements) facility in order to use their own private references for Intel MKL, IPP or DNN libraries. +Consumers may use an [override](https://docs.conan.io/2/reference/conanfile/methods/requirements.html#override) facility in order to use their own private references for Intel MKL, IPP or DNN libraries. For instance, if you have a private reference `intel-mkl/2021@mycompany/stable`, then you may use the following override in your `conanfile.txt`: @@ -370,7 +344,7 @@ intel-mkl/2021@mycompany/stable This repository and the CI building recipes is continuously pushing to new Conan versions, sometimes adopting new features as soon as they are released -([Conan client changelog](https://docs.conan.io/1/changelog.html)). +([Conan client changelog](https://docs.conan.io/2/changelog.html)). You should expect that latest revision of recipes can introduce breaking changes and new features that will be broken unless you also upgrade Conan client (and sometimes you will @@ -386,50 +360,12 @@ See [Dependencies Version Ranges](adding_packages/dependencies.md#version-ranges ## How to consume a graph of shared libraries? -When the CI builds packages with `shared=True`, it applies the option only to the package being created, but not to -the requirements. As the default value for the `shared` option is usually `False`, you can expect that the dynamic -library that has just being generated has linked all its requirements as static libraries. - -It is important to remark the default [package id mode](https://docs.conan.io/1/creating_packages/define_abi_compatibility.html#versioning-schema) -used by Conan (which is the same default used by ConanCenter): `semver_direct_mode`. With this default only the major -version of the requirements is encoded in the package ID. - -The two previous behaviors together can lead to unexpected results for a user that want to consume a graph of -dependencies as shared libraries from ConanCenter. They might think that using `*:shared=True` in their profile is -enough, and indeed Conan will retrieve from ConanCenter all the dynamic libraries for all the graph of dependencies, but -**all of them will contain the logic of their respective requirements embedded in the dynamic library**, and this -logic is embedded at the time of building, so it might not match the version of the requirements that was resolved -by Conan, and for sure, the other dynamic libraries won't be used, only the ones linked directly by the consumer -project. See a more detailed [example here](https://github.com/conan-io/conan/issues/9712). - -In order to consume all those libraries as shared ones, building from sources is needed. This can be -easily achievable using `*:shared=True` in the _host_ profile and `--build` in the install command. With these inputs, -Conan will build from sources all the packages and use the shared libraries when linking. +When the CI builds packages with the option `*/*:shared=True`, this option is applied not only to the package being created but also to its requirements. +Since the default value for the shared option is typically `False`, you can generally expect that the dependency graph will consist of static libraries, +except for packages specifically defined with `package_type = "shared-library"`. -> **Note**: If you are hosting your own recipes, the proper solution for recipes would be to use something like -> [`shared_library_package_id`](https://docs.conan.io/1/reference/conanfile/methods.html?highlight=shared_library_package_id#self-info-shared-library-package-id), -> that will encode this information in the package ID and ensure that any change in the static libraries that are -> embedded into a shared one is taken into account when computing the package ID. -> -> In this repository we are not using it, because it will lead to many missing packages, making it impossible -> for the CI to actually build consumers in PRs. - -## How to watch only specific recipes? - -The [Code Owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) feature requires -write permission for any listed user in the file `.github/CODEOWNERS`, which makes it impossible to be accepted by Conan. However, that file is still important as it can be re-used in -a future Github Action to parse and communicate users. Meanwhile, there is the project https://app.github-file-watcher.com/, -which is able to notify users, but only after merging to the master branch. Feel free to contribute to a new Github Action that -implements a file watcher feature. - -## Is it possible to disable Pylint? - -No. The [pylint](v2_linter.md) has an important role of keeping any recipe prepared for [Conan v2 migration](v2_migration.md). In case you are having -difficult to understand [linter errors](linters.md), please comment on your pull request about the problem to receive help from the community. - -## How long can I be inactive before being removed from the authorized users list? - -Please, read [Inactivity and user removal section](adding_packages/README.md#inactivity-and-user-removal). +To work with a graph that includes only shared libraries, you must explicitly set the `-o */*:shared=True` option in your conan install command. +This ensures that the necessary shared libraries are included in your build environment. ## Can we add package which are parts of bigger projects like Boost? @@ -444,33 +380,11 @@ and does not install libraries with the boost prefix. Yes, but make sure it does not have Boost in the name. Use the [`author-name` convention](https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#what-is-the-policy-on-recipe-name-collisions) so there are no conflicts. In addition to follow the rules outlined above. +**NOTE**: In case you have no intention to submit to Boost, then you can use the project name as is (e.g `boost-foobar`). + ## Can I add options that do not affect `package_id` or the package contents Generally no, these sorts of options can most likely be set from a profile or downstream recipes. However if the project supports this option from its build script and would otherwise dynamically embed this into the CMake config files or generated pkg-config files then it should be allowed. Doing so requires [deleting the option from the `package_id`](adding_packages/conanfile_attributes.md#removing-from-package_id). - -## Can I use full_package_mode for a requirement in my recipe? - -For some irregular projects, they may need to be aligned when being used as a requirement, using the very same version, options, and settings and maybe not mixing shared with static linkage. -Those projects usually break between patch versions and are very sensitive, so we can not use different versions through Conan graph dependencies, -otherwise, it may result in unexpected behavior or even runtime errors. - -A very known project is GLib, which requires the very same configuration to prevent multiple instances when using static linkage. -As a solution, we could consume GLib on full package id mode, like: - -```python -def package_id(self): - self.info.requires["glib"].full_package_mode() -``` - -Perfect solution on the consumer side, but there is a side-effect: CCI will not re-generate all involved packages for any change in the dependencies graph with which glib is associated, which means, users will start to see **MISSING_PACKAGES** error during their pull requests. -As a trade-off, it would be necessary to update all recipes involved, by opening new PRs, -then it should generate new packages, but it takes many days and still is a process that is not supported by CCI internally. - -To have more context about it, please, visit issues #11684 and #11022 - -In summary, we do not recommend `full_package_mode` or any other custom package id mode for requirements on CCI, it will break other PRs soon or later. -Instead, prefer using `shared=True` by default, when needed. -Also, when having a similar situation, do not hesitate in opening an issue explaining your case, and ask for support from the community. diff --git a/docs/labels.md b/docs/labels.md deleted file mode 100644 index b5f3f5d9cf396..0000000000000 --- a/docs/labels.md +++ /dev/null @@ -1,96 +0,0 @@ -# Labels - -We use [GitHub labels](https://github.com/conan-io/conan-center-index/labels) to signal the status -of pull-requests and issues. Here you can find more information about the ones that have some -special meaning: - - -## Contents - - * [Bump dependencies](#bump-dependencies) - * [Bump version](#bump-version) - * [C3I Conan2 Ready](#c3i-conan2-ready) - * [Infrastructure](#infrastructure) - * [Stale](#stale) - * [Unexpected Error](#unexpected-error) - * [User-approval pending](#user-approval-pending) - * [Library Request](#library-request) - * [Question](#question) - * [Upstream Update](#upstream-update) - * [conan.io/center](#conaniocenter) - -## Bump dependencies - -Label [`Bump dependencies`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Bump+dependencies%22+) -is assigned by the bot to pull-requests that are just upgrading the version of the requirements that were already in the -recipe. - -> These pull-requests will be merged right away without requiring any approval (CI and CLA checks must have passed). - -If the pull request modifies anything else, the label won't be assigned, we need to be very careful about false positives. - -## Bump version - -Label [`Bump version`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Bump+version%22) -is assigned by the bot to pull-requests that are just adding a new version of the library. The new version should satisfy -some extra conditions: sources should provide from the same URL domain as previous versions. -For now, only [SEMVER](https://semver.org/#semantic-versioning-200) and `` are acceptable version formats. - -> These pull-requests will be merged right away without requiring any approval (CI and CLA checks must have passed). - -If the pull request modifies anything else, the label won't be assigned, we need to be very careful about false positives. - -## C3I Conan2 Ready - -Label [`c3i-conan2-ready`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22c3i-conan2-ready%22) -is assigned by the bot to pull-requests that are just adding a new package references which passed by Conan v2 and are not listed in `.c3i/conan_v2_ready_references.yml`. -This is a regression test, in case package is working with Conan v2, it can not be merged in a future pull request in case of failure. - -> These pull-requests will be merged right away without requiring any approval (CI and CLA checks must have passed). - -Only team members can open a pull request with these changes. - -## Infrastructure - -Label [`infrastructure`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3Ainfrastructure) is -manually assigned to pull requests that are waiting for something on the infrastructure side. Usually they are blocked and -cannot succeed because they need some tools, more memory,... these pull requests won't be marked as `stale`. - -## Stale - -Label [`stale`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3Astale) is assigned to -pull requests without any activity during a long period of time. These pull requests will be closed if they don't get -any further activity. - -## Unexpected Error - -Label [`Unexpected Error`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Unexpected+Error%22) -is assigned by the CI when the process finishes abnormally. -Usually it is some _random_ internal error and it won't happen next time the CI runs. -The CI will re-start your build automatically, the Github check `continuous-integration/jenkins/pr-merge` -will be changed to the status `Pending — This commit is being built` to signalize as running. - -> **Note**: Manually restarting a new build, by closing/opening the PR, will be added to the end of the CI build queue. - -## User-approval pending - -Label [`User-approval pending`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22User-approval+pending%22) -signals the pull request that have been submitted by an user who is not yet approved in ConanCenter. Once the user is -approved these pull requests will be triggered again automatically. - -## Library Request - -Request a new package to be created. - -## Question - -Further information is requested. Usually these are for issue where help is needed to solve a specific issue. These are a great way -to look for advice or recommendation about making changes to recipes. - -## Upstream Update - -Request a bump of a new package version. - -## conan.io/center - -Issues and features related to Web UI. diff --git a/docs/linters.md b/docs/linters.md deleted file mode 100644 index c108d63beb5a0..0000000000000 --- a/docs/linters.md +++ /dev/null @@ -1,190 +0,0 @@ -# ConanCenterIndex Linters - -Some linter configuration files are available in the folder [linter](../linter), which are executed by Github Actions -and are displayed during [code review](https://github.com/features/code-review) as annotations, to improve recipe quality. -They consume python scripts which are executed to fit CCI rules. Those scripts use [astroid](https://github.com/PyCQA/astroid) -and [pylint](https://pylint.pycqa.org/en/latest/) classes to parse Conan recipe files and manage their warnings and errors. - -Pylint by itself is not able to find ConanCenterIndex rules, so astroid is used to iterate over a conanfile's content and -validate CCI requirements. Pylint uses an [rcfile](https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html) -to configure plugins, warnings and errors which should be enabled or disabled. - - -## Contents - - * [Understanding the different linters](#understanding-the-different-linters) - * [Running the linters locally](#running-the-linters-locally) - * [Pylint configuration files](#pylint-configuration-files) - * [Linter Warning and Errors](#linter-warning-and-errors) - * [E9006 - conan-import-conanfile: ConanFile should be imported from conan](#e9006---conan-import-conanfile-conanfile-should-be-imported-from-conan) - * [E9005 - conan-missing-name: Every conan recipe must contain the attribute name](#e9005---conan-missing-name-every-conan-recipe-must-contain-the-attribute-name) - * [E9004 - conan-package-name: Conan package names must be lower-case](#e9004---conan-package-name-conan-package-names-must-be-lower-case) - * [E9007 - conan-test-no-name: Do not add name attribute in test package recipes](#e9007---conan-test-no-name-do-not-add-name-attribute-in-test-package-recipes) - * [E9008 - conan-import-errors: Deprecated imports should be replaced by new imports](#e9008---conan-import-errors-deprecated-imports-should-be-replaced-by-new-imports) - * [E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead](#e9009---conan-import-error-conanexception-conanserrors-is-deprecated-and-conanerrors-should-be-used-instead) - * [E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead](#e9010---conan-import-error-conaninvalidconfiguration-conanserrors-is-deprecated-and-conanerrors-should-be-used-instead) - * [E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private](#e9011---conan-import-tools-importing-conantools-or-conantoolsxxxzzzyyy-should-be-considered-as-private) - * [E9012 - conan-attr-version: Recipe should not contain version attribute](#e9012---conan-attr-version-recipe-should-not-contain-version-attribute) - -## Understanding the different linters - -There's a three classes of linters currently in place for ConanCenterIndex - -- ConanCenter Hook - these are responsible for validating the structure of the recipes and packages. -- Pylint Linter - these are used to ensure the code quality and conventions of a recipes (i.e `conanfile.py`) -- Yaml Checks - stylistic guidance and schema validation check for support files and best practices - -## Running the linters locally - -Check the [Developing Recipes](developing_recipes_locally.md) for more information on each of the three linters. - -## Pylint configuration files - -- [Pylint Recipe](../linter/pylintrc_recipe): This `rcfile` lists plugins and rules to be executed over all recipes (not test package) and validate them. -- [Pylint Test Package Recipe](../linter/pylintrc_testpackage): This `rcfile` lists plugins and rules to be executed over all recipes in test package folders only: - -## Linter Warning and Errors - -Here is the list of current warning and errors provided by pylint, when using CCI configuration. - -### E9006 - conan-import-conanfile: ConanFile should be imported from conan - -```python -from conans import ConanFile -``` - -Should be replaced by: - -```python -from conan import Conanfile -``` - -### E9005 - conan-missing-name: Every conan recipe must contain the attribute name - -The attribute `name` is always expected. On the other hand, `version` should not be listed. - -```python -def BazConanfile(ConanFile): - name = "baz" -``` - -### E9004 - conan-package-name: Conan package names must be lower-case - -The package name is always lower-case, even when the upstream uses another format - -```python -def FoobarConanfile(ConanFile): - name = "foobar" -``` - -### E9007 - conan-test-no-name: Do not add name attribute in test package recipes - -The test package is not a recipe, thus, it should not have a name - -```python -def TestPackageConanFile(ConanFile): - name = "test_package" # Wrong! -``` - -### E9008 - conan-import-errors: Deprecated imports should be replaced by new imports - -Read [v2_linter](v2_linter.md) for a list of mappings of v1 to v2. -Regular imports from `conans.tools` are now updated: - -```python -from conans import tools -... - -tools.rmdir(os.path.join(self.package_folder, "shared")) -``` - -Should be replaced by specialized tools, prepared for Conan 2.0 - -```python -from conan.tools.files import rmdir -... - -rmdir(self, os.path.join(self.package_folder, "shared")) -``` - -### E9009 - conan-import-error-conanexception: conans.errors is deprecated and conan.errors should be used instead - -```python -from conans.errors import ConanException -``` - -Should be replaced by: - -```python -from conan.errors import ConanException -``` - -Only the namespace `conans` has been replaced by `conan`. - -### E9010 - conan-import-error-conaninvalidconfiguration: conans.errors is deprecated and conan.errors should be used instead - -```python -from conans.errors import ConanInvalidConfiguration -``` - -Should be replaced by: - -```python -from conan.errors import ConanInvalidConfiguration -``` - -Only the namespace `conans` has been replaced by `conan`. - -### E9011 - conan-import-tools: Importing conan.tools or conan.tools.xxx.zzz.yyy should be considered as private - -Documented on [conanfile.tools](https://docs.conan.io/1/reference/conanfile/tools.html): -It's not allowed to use `tools.xxx` directly: - -```python -from conan import tools -... - -tools.scm.Version(self.version) -``` - -Neither sub modules: - -```python -from conan.tools.apple.apple import is_apple_os -``` - -Only modules under `conan.tools` and `conan.tools.xxx` are allowed: - -```python -from conan.tools.files import rmdir -from conan.tools import scm -``` - -### E9012 - conan-attr-version: Recipe should not contain version attribute - -All recipes on CCI should be generic enough to support as many versions as possible, so enforcing a specific -version as attribute will not allow to re-use the same recipe for multiple release versions. - -```python -from conan import ConanFile - -class FooConanFile(ConanFile): - version = "1.0.0" # Wrong! -``` - -The package version should be passed as command argument, e.g: - - conan create all/ 1.0.0@ -pr:h=default -pr:b=default - -Or, if you are running Conan 2.0: - - conan create all/ --version=1.0.0 -pr:h=default -pr:b=default - -The only exception is when providing ``system`` packages, which are allowed. - -```python -from conan import ConanFile - -class FooConanFile(ConanFile): - version = "system" # Okay! -``` diff --git a/docs/package_templates/README.md b/docs/package_templates/README.md index 76d696e57b0a0..1ea369a63a8ee 100644 --- a/docs/package_templates/README.md +++ b/docs/package_templates/README.md @@ -12,7 +12,7 @@ It's listed under [cmake_package](cmake_package) folder. It fits projects which #### Header only -It's listed under [header_only](header_only) folder. It fits projects which only copy header and have the same package ID always. +It's listed under [header_only](header_only) folder. It fits projects which only copy header and have the same package ID always. Please note that if the library in question does have a build system (e.g. CMake, Meson, Autotools) that contains install logic - that should be the preferred starting point for the recipe. Copying files directly into the package folder should be reserved for header only libraries where the upstream project does not provide this functionality. #### MSBuild package diff --git a/docs/package_templates/autotools_package/all/conandata.yml b/docs/package_templates/autotools_package/all/conandata.yml index 629a5640adc16..e11d72dbcdc2b 100644 --- a/docs/package_templates/autotools_package/all/conandata.yml +++ b/docs/package_templates/autotools_package/all/conandata.yml @@ -1,17 +1,13 @@ sources: - # Newer versions at the top "1.2.0": url: - "https://mirror1.net/package-1.2.0.tar.gz" - "https://mirror2.net/package-1.2.0.tar.gz" sha256: "________________________________________________________________" "1.1.0": - url: - - "https://mirror1.net/package-1.1.0.tar.gz" - - "https://mirror2.net/package-1.1.0.tar.gz" + url: "https://mirror2.net/package-1.1.0.tar.gz" sha256: "________________________________________________________________" patches: - # Newer versions at the top "1.1.0": - patch_file: "patches/0001-fix-cmake.patch" patch_description: "correct the order of cmake min and project" diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 0d8464ec8e6f0..db295ffc21b40 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -2,16 +2,15 @@ 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.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.env import Environment, VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir 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 -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.0.9" # # INFO: Please, remove all comments before pushing your PR! @@ -22,13 +21,13 @@ class PackageConan(ConanFile): name = "package" description = "short description" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ - # In case not listed there, use "LicenseRef-" + # In case not listed there, use "DocumentRef-:LicenseRef-" license = "" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" # no "conan" and project name in topics. Use topics from the upstream listed on GH topics = ("topic1", "topic2", "topic3") - # package_type should usually be "library" (if there is shared option) + # package_type should usually be "library", "shared-library" or "static-library" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -41,73 +40,53 @@ class PackageConan(ConanFile): "fPIC": True, "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) + # In case having config_options() or configure() method, the logic should be moved to the specific methods. + implements = ["auto_shared_fpic"] # no exports_sources attribute, but export_sources(self) method instead - # this allows finer grain exportation of patches per version def export_sources(self): export_conandata_patches(self) - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - def configure(self): + # Keep this logic only in case configure() is needed e.g pure-c project. + # Otherwise remove configure() and auto_shared_fpic will manage it. if self.options.shared: self.options.rm_safe("fPIC") - # for plain C projects only + # for plain C projects only. Otherwise, remove this method. 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 requirements(self): - # prefer self.requires method instead of requires attribute + # Prefer self.requirements() method instead of self.requires attribute. self.requires("dependency/0.8.1") if self.options.with_foobar: + # INFO: used in foo/baz.hpp:34 self.requires("foobar/0.1.0") + # Some dependencies on CCI are allowed to use version ranges. + # See https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/dependencies.md#version-ranges + self.requires("openssl/[>=1.1 <4]") def validate(self): # validate the minimum cpp standard supported. Only for C++ projects - 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." - ) + check_min_cppstd(self, 14) + + # Always comment the reason including the upstream issue. + # INFO: Upstream only support Unix systems. See if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") - # if another tool than the compiler or autotools is required to build the project (pkgconf, bison, flex etc) + # if a tool other than the compiler or autotools is required to build the project (pkgconf, bison, flex etc) def build_requirements(self): # only if we have to call autoreconf self.tool_requires("libtool/x.y.z") # only if upstream configure.ac relies on PKG_CHECK_MODULES macro if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/x.y.z") + self.tool_requires("pkgconf/[>=2.2 <3]") # required to suppport windows as a build machine - if self._settings_build.os == "Windows": + 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") @@ -118,21 +97,20 @@ def build_requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + # apply patches listed in conandata.yml + # Using patches is always the last resort to fix issues. If possible, try to fix the issue in the upstream project. + apply_conandata_patches(self) def generate(self): - # inject tool_requires env vars in build scope (not needed if there is no tool_requires) - env = VirtualBuildEnv(self) - env.generate() - # inject requires env vars in build scope + # inject required env vars into the build scope # it's required in case of native build when there is AutotoolsDeps & at least one dependency which might be shared, because configure tries to run a test executable if not cross_building(self): - env = VirtualRunEnv(self) - env.generate(scope="build") - # --fpic is automatically managed when 'fPIC'option is declared + VirtualRunEnv(self).generate(scope="build") + # --fpic is automatically managed when 'fPIC' option is declared # --enable/disable-shared is automatically managed when 'shared' option is declared tc = AutotoolsToolchain(self) # autotools usually uses 'yes' and 'no' to enable/disable options - yes_no = lambda v: "yes" if v else "no" + def yes_no(v): return "yes" if v else "no" tc.configure_args.extend([ f"--with-foobar={yes_no(self.options.with_foobar)}", "--enable-tools=no", @@ -143,8 +121,10 @@ def generate(self): tc = PkgConfigDeps(self) tc.generate() # generate dependencies for autotools - tc = AutotoolsDeps(self) - tc.generate() + # some recipes might require a workaround for MSVC (https://github.com/conan-io/conan/issues/12784): + # https://github.com/conan-io/conan-center-index/blob/00ce907b910d0d772f1c73bb699971c141c423c1/recipes/xapian-core/all/conanfile.py#L106-L135 + deps = AutotoolsDeps(self) + deps.generate() # If Visual Studio is supported if is_msvc(self): @@ -158,7 +138,7 @@ def generate(self): 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("AR", f"{ar_wrapper} lib") env.define("NM", "dumpbin -symbols") env.define("OBJDUMP", ":") env.define("RANLIB", ":") @@ -166,8 +146,7 @@ def generate(self): env.vars(self).save_script("conanbuild_msvc") def build(self): - # apply patches listed in conandata.yml - apply_conandata_patches(self) + autotools = Autotools(self) # (optional) run autoreconf to regenerate configure file (libtool should be in tool_requires) autotools.autoreconf() @@ -180,8 +159,9 @@ def package(self): autotools = Autotools(self) autotools.install() - # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + # 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")) + # Consider disabling these at first to verify that the package_info() output matches the info exported by the project. rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) @@ -191,7 +171,7 @@ def package(self): def package_info(self): self.cpp_info.libs = ["package_lib"] - # if package provides a pkgconfig file (package.pc, usually installed in /lib/pkgconfig/) + # if the package provides a pkgconfig file (package.pc, usually installed in /lib/pkgconfig/) self.cpp_info.set_property("pkg_config_name", "package") # If they are needed on Linux, m, pthread and dl are usually needed on FreeBSD too diff --git a/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt b/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt index 006bc198df7b0..c16ec6d748476 100644 --- a/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt +++ b/docs/package_templates/autotools_package/all/test_package/CMakeLists.txt @@ -1,11 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(test_package LANGUAGES C) # if the project is pure C -# project(test_package LANGUAGES CXX) # if the project uses c++ +project(test_package LANGUAGES CXX) find_package(package REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.c) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package +add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE package::package) -# In case the target project need a specific C++ standard -# target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/docs/package_templates/autotools_package/all/test_package/conanfile.py b/docs/package_templates/autotools_package/all/test_package/conanfile.py index 0a808db45f245..2e77b4246fa81 100644 --- a/docs/package_templates/autotools_package/all/test_package/conanfile.py +++ b/docs/package_templates/autotools_package/all/test_package/conanfile.py @@ -4,11 +4,9 @@ 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" + generators = "CMakeDeps", "CMakeToolchain" def layout(self): cmake_layout(self) diff --git a/docs/package_templates/autotools_package/all/test_package/test_package.c b/docs/package_templates/autotools_package/all/test_package/test_package.c deleted file mode 100644 index f949b7f4a20f4..0000000000000 --- a/docs/package_templates/autotools_package/all/test_package/test_package.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include "package/foobar.h" // Make sure includes work as expected - - -int main(void) { - printf("Create a minimal usage for the target project here.\n"); - printf("Avoid big examples, bigger than 100 lines\n"); - printf("Avoid networking connections.\n"); - printf("Avoid background apps or servers.\n"); - printf("The propose is testing the generated artifacts only.\n"); - - foobar_print_version(); // Make sure to call something that will require linkage for compiled libraries - - return EXIT_SUCCESS; -} diff --git a/docs/package_templates/autotools_package/all/test_package/test_package.cpp b/docs/package_templates/autotools_package/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2746a345c92f8 --- /dev/null +++ b/docs/package_templates/autotools_package/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include +#include "package/foobar.h" + + +int main(void) { + /* + * TODO: Remove this comment before pushing the testing code; + * + * Create a minimal usage for the target project here; + * Avoid upstream full examples, or code bigger than 15 lines; + * Avoid networking connections; + * Avoid background apps or servers; + * Avoid GUI apps; + * Avoid extra files like images, sounds and other binaries; + * The propose is testing the generated artifacts ONLY; + */ + + foobar_print_version(); // Make sure to call something that will require linkage for compiled libraries + + return EXIT_SUCCESS; +} diff --git a/docs/package_templates/cmake_package/all/conandata.yml b/docs/package_templates/cmake_package/all/conandata.yml index 629a5640adc16..dacc527595b61 100644 --- a/docs/package_templates/cmake_package/all/conandata.yml +++ b/docs/package_templates/cmake_package/all/conandata.yml @@ -1,17 +1,13 @@ sources: - # Newer versions at the top "1.2.0": url: - "https://mirror1.net/package-1.2.0.tar.gz" - "https://mirror2.net/package-1.2.0.tar.gz" sha256: "________________________________________________________________" "1.1.0": - url: - - "https://mirror1.net/package-1.1.0.tar.gz" - - "https://mirror2.net/package-1.1.0.tar.gz" + url: "https://mirror1.net/package-1.1.0.tar.gz" sha256: "________________________________________________________________" patches: - # Newer versions at the top "1.1.0": - patch_file: "patches/0001-fix-cmake.patch" patch_description: "correct the order of cmake min and project" diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index 9635abc398ca9..50a593703f186 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -2,14 +2,12 @@ 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, 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 +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 import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0.9" # # INFO: Please, remove all comments before pushing your PR! @@ -20,13 +18,13 @@ class PackageConan(ConanFile): name = "package" description = "short description" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ - # In case not listed there, use "LicenseRef-" + # In case not listed there, use "DocumentRef-:LicenseRef-" license = "" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" # no "conan" and project name in topics. Use topics from the upstream listed on GH topics = ("topic1", "topic2", "topic3") - # package_type should usually be "library" (if there is shared option) + # package_type should usually be "library", "shared-library" or "static-library" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -37,32 +35,16 @@ class PackageConan(ConanFile): "shared": False, "fPIC": 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", - } + # In case having config_options() or configure() method, the logic should be moved to the specific methods. + implements = ["auto_shared_fpic"] # no exports_sources attribute, but export_sources(self) method instead - # this allows finer grain exportation of patches per version def export_sources(self): export_conandata_patches(self) - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - def configure(self): + # Keep this logic only in case configure() is needed e.g pure-c project. + # Otherwise remove configure() and auto_shared_fpic will manage it. if self.options.shared: self.options.rm_safe("fPIC") # for plain C projects only @@ -70,62 +52,52 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") def layout(self): - # src_folder must use the same source folder name the project cmake_layout(self, src_folder="src") def requirements(self): - # prefer self.requires method instead of requires attribute + # Always prefer self.requirements() method instead of self.requires attribute. self.requires("dependency/0.8.1") + if self.options.with_foobar: + # INFO: used in foo/baz.hpp:34 + self.requires("foobar/0.1.0", transitive_headers=True, transitive_libs=True) + # Some dependencies on CCI are allowed to use version ranges. + # See https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/dependencies.md#version-ranges + self.requires("openssl/[>=1.1 <4]") 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) - 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 + # validate the minimum cpp standard supported. For C++ projects only. + check_min_cppstd(self, 14) + # in case it does not work in another configuration, it should be validated here. Always comment the reason including the upstream issue. + # INFO: Upstream does not support DLL: See 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 another tool than the compiler or CMake is required to build the project (pkgconf, bison, flex etc) + # if a tool other than the compiler or CMake newer than 3.15 is required to build the project (pkgconf, bison, flex etc) def build_requirements(self): - self.tool_requires("tool/x.y.z") + self.tool_requires("cmake/[>=3.16 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + # Using patches is always the last resort to fix issues. If possible, try to fix the issue in the upstream project. + apply_conandata_patches(self) def generate(self): - # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist + # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are set automatically as tc.variables when self.options.shared or self.options.fPIC exist tc = CMakeToolchain(self) # Boolean values are preferred instead of "ON"/"OFF" - tc.variables["PACKAGE_CUSTOM_DEFINITION"] = True + tc.cache_variables["PACKAGE_BUILD_TESTS"] = False if is_msvc(self): - # don't use self.settings.compiler.runtime - tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) - # deps_cpp_info, deps_env_info and deps_user_info are no longer used - if self.dependencies["dependency"].options.foobar: - tc.variables["DEPENDENCY_LIBPATH"] = self.dependencies["dependency"].cpp_info.libdirs - # cache_variables should be used sparingly, example setting cmake policies - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" - tc.generate() - # In case there are dependencies listed on requirements, CMakeDeps should be used - tc = CMakeDeps(self) + tc.cache_variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) tc.generate() - # In case there are dependencies listed on build_requirements, VirtualBuildEnv should be used - tc = VirtualBuildEnv(self) - tc.generate(scope="build") - def _patch_sources(self): - apply_conandata_patches(self) - # remove bundled xxhash - rm(self, "whateer.*", os.path.join(self.source_folder, "lib")) - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "...", "") + # In case there are dependencies listed under requirements, CMakeDeps should be used + deps = CMakeDeps(self) + # You can override the CMake package and target names if they don't match the names used in the project + deps.set_property("fontconfig", "cmake_file_name", "Fontconfig") + deps.set_property("fontconfig", "cmake_target_name", "Fontconfig::Fontconfig") + deps.generate() def build(self): - self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed cmake = CMake(self) cmake.configure() cmake.build() @@ -135,17 +107,16 @@ def package(self): cmake = CMake(self) cmake.install() - # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + # Some files extensions and folders are not allowed. Please, read the FAQs to get informed. + # Consider disabling these at first to verify that the package_info() output matches the info exported by the project. 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")) + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): + # library name to be packaged self.cpp_info.libs = ["package_lib"] - # if 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", "PACKAGE") @@ -161,9 +132,3 @@ def package_info(self): self.cpp_info.system_libs.append("m") self.cpp_info.system_libs.append("pthread") self.cpp_info.system_libs.append("dl") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "PACKAGE" - self.cpp_info.filenames["cmake_find_package_multi"] = "package" - self.cpp_info.names["cmake_find_package"] = "PACKAGE" - self.cpp_info.names["cmake_find_package_multi"] = "package" 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 b1b30db795a84..c16ec6d748476 100644 --- a/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt +++ b/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt @@ -1,12 +1,7 @@ cmake_minimum_required(VERSION 3.15) - -project(test_package LANGUAGES C) # if the project is pure C -# project(test_package LANGUAGES CXX) # if the project uses c++ +project(test_package LANGUAGES CXX) find_package(package 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 package::package) -# In case the target project need a specific C++ standard -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/docs/package_templates/cmake_package/all/test_package/conanfile.py b/docs/package_templates/cmake_package/all/test_package/conanfile.py index 02eb5ce439fb4..2e77b4246fa81 100644 --- a/docs/package_templates/cmake_package/all/test_package/conanfile.py +++ b/docs/package_templates/cmake_package/all/test_package/conanfile.py @@ -4,18 +4,16 @@ 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) + generators = "CMakeDeps", "CMakeToolchain" 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/docs/package_templates/cmake_package/all/test_package/test_package.cpp b/docs/package_templates/cmake_package/all/test_package/test_package.cpp index 8e653f30a5476..7480c357a3b18 100644 --- a/docs/package_templates/cmake_package/all/test_package/test_package.cpp +++ b/docs/package_templates/cmake_package/all/test_package/test_package.cpp @@ -1,14 +1,19 @@ #include -#include #include "package/foobar.hpp" int main(void) { - std::cout << "Create a minimal usage for the target project here." << std::endl; - std::cout << "Avoid big examples, bigger than 100 lines" << std::endl; - std::cout << "Avoid networking connections." << std::endl; - std::cout << "Avoid background apps or servers." << std::endl; - std::cout << "The propose is testing the generated artifacts only." << std::endl; + /* + * TODO: Remove this comment before pushing the testing code; + * + * Create a minimal usage for the target project here; + * Avoid upstream full examples, or code bigger than 15 lines; + * Avoid networking connections; + * Avoid background apps or servers; + * Avoid GUI apps; + * Avoid extra files like images, sounds and other binaries; + * The propose is testing the generated artifacts ONLY; + */ foobar.print_version(); diff --git a/docs/package_templates/cmake_package/config.yml b/docs/package_templates/cmake_package/config.yml index a885cbf942a74..d07c95e596619 100644 --- a/docs/package_templates/cmake_package/config.yml +++ b/docs/package_templates/cmake_package/config.yml @@ -1,5 +1,4 @@ versions: - # Newer versions at the top "1.2.0": folder: all "1.1.0": diff --git a/docs/package_templates/header_only/all/conandata.yml b/docs/package_templates/header_only/all/conandata.yml index 629a5640adc16..e11d72dbcdc2b 100644 --- a/docs/package_templates/header_only/all/conandata.yml +++ b/docs/package_templates/header_only/all/conandata.yml @@ -1,17 +1,13 @@ sources: - # Newer versions at the top "1.2.0": url: - "https://mirror1.net/package-1.2.0.tar.gz" - "https://mirror2.net/package-1.2.0.tar.gz" sha256: "________________________________________________________________" "1.1.0": - url: - - "https://mirror1.net/package-1.1.0.tar.gz" - - "https://mirror2.net/package-1.1.0.tar.gz" + url: "https://mirror2.net/package-1.1.0.tar.gz" sha256: "________________________________________________________________" patches: - # Newer versions at the top "1.1.0": - patch_file: "patches/0001-fix-cmake.patch" patch_description: "correct the order of cmake min and project" diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index 6e443b6024963..6615ea677d66a 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -3,101 +3,73 @@ 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.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.0" class PackageConan(ConanFile): name = "package" description = "short description" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ - # In case it's not listed there, use "LicenseRef-" + # In case it's not listed there, use "DocumentRef-:LicenseRef-" license = "" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" # Do not put "conan" nor the project name in topics. Use topics from the upstream listed on GH - # Keep 'header-only' as topic + # Include 'header-only' as a topic topics = ("topic1", "topic2", "topic3", "header-only") package_type = "header-library" - # Keep these or explain why it's not required for this particular case settings = "os", "arch", "compiler", "build_type" # 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 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", - } - # 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") 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) + self.requires("dependency/0.8.1") + # Some dependencies on CCI are allowed to use version ranges. + # See https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/dependencies.md#version-ranges + self.requires("openssl/[>=1.1 <4]") # 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: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." - ) - - # In case this library does not work in some another configuration, it should be validated here too + # Validate the minimum cpp standard supported when installing the package. For C++ projects only + check_min_cppstd(self, 14) + # in case it does not work in another configuration, it should be validated here. Always comment the reason including the upstream issue. + # INFO: Upstream does not support DLL: See if self.settings.os == "Windows": raise ConanInvalidConfiguration(f"{self.ref} can not be used on Windows.") 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 + # Using patches is always the last resort to fix issues. If possible, try to fix the issue in the upstream project. apply_conandata_patches(self) + # Suppress warning message about missing build() method when running Conan + def build(self): + pass + # 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, - "*.h", - os.path.join(self.source_folder, "include"), - os.path.join(self.package_folder, "include"), - ) + # Prefer CMake.install() or similar in case the upstream offers an official method to install the headers. + copy(self, "*.h", os.path.join(self.source_folder, "include"), 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 = [] - # 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... @@ -111,12 +83,10 @@ def package_info(self): # (package.pc, usually installed in /lib/pkgconfig/) self.cpp_info.set_property("pkg_config_name", "package") + # Folders not used for header-only + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + # 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.filenames["cmake_find_package"] = "PACKAGE" - self.cpp_info.filenames["cmake_find_package_multi"] = "package" - self.cpp_info.names["cmake_find_package"] = "PACKAGE" - self.cpp_info.names["cmake_find_package_multi"] = "package" diff --git a/docs/package_templates/header_only/all/test_package/CMakeLists.txt b/docs/package_templates/header_only/all/test_package/CMakeLists.txt index eaac388e85a10..c16ec6d748476 100644 --- a/docs/package_templates/header_only/all/test_package/CMakeLists.txt +++ b/docs/package_templates/header_only/all/test_package/CMakeLists.txt @@ -1,11 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(test_package LANGUAGES C) # if the project is pure C -# project(test_package LANGUAGES CXX) # if the project uses c++ +project(test_package LANGUAGES CXX) find_package(package 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 package::package) -# In case the target project need a specific C++ standard -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/docs/package_templates/header_only/all/test_package/conanfile.py b/docs/package_templates/header_only/all/test_package/conanfile.py index 0a808db45f245..2e77b4246fa81 100644 --- a/docs/package_templates/header_only/all/test_package/conanfile.py +++ b/docs/package_templates/header_only/all/test_package/conanfile.py @@ -4,11 +4,9 @@ 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" + generators = "CMakeDeps", "CMakeToolchain" def layout(self): cmake_layout(self) diff --git a/docs/package_templates/header_only/all/test_package/test_package.cpp b/docs/package_templates/header_only/all/test_package/test_package.cpp index 8e653f30a5476..7480c357a3b18 100644 --- a/docs/package_templates/header_only/all/test_package/test_package.cpp +++ b/docs/package_templates/header_only/all/test_package/test_package.cpp @@ -1,14 +1,19 @@ #include -#include #include "package/foobar.hpp" int main(void) { - std::cout << "Create a minimal usage for the target project here." << std::endl; - std::cout << "Avoid big examples, bigger than 100 lines" << std::endl; - std::cout << "Avoid networking connections." << std::endl; - std::cout << "Avoid background apps or servers." << std::endl; - std::cout << "The propose is testing the generated artifacts only." << std::endl; + /* + * TODO: Remove this comment before pushing the testing code; + * + * Create a minimal usage for the target project here; + * Avoid upstream full examples, or code bigger than 15 lines; + * Avoid networking connections; + * Avoid background apps or servers; + * Avoid GUI apps; + * Avoid extra files like images, sounds and other binaries; + * The propose is testing the generated artifacts ONLY; + */ foobar.print_version(); diff --git a/docs/package_templates/header_only/config.yml b/docs/package_templates/header_only/config.yml index a885cbf942a74..d07c95e596619 100644 --- a/docs/package_templates/header_only/config.yml +++ b/docs/package_templates/header_only/config.yml @@ -1,5 +1,4 @@ versions: - # Newer versions at the top "1.2.0": folder: all "1.1.0": diff --git a/docs/package_templates/meson_package/all/conandata.yml b/docs/package_templates/meson_package/all/conandata.yml index 629a5640adc16..e11d72dbcdc2b 100644 --- a/docs/package_templates/meson_package/all/conandata.yml +++ b/docs/package_templates/meson_package/all/conandata.yml @@ -1,17 +1,13 @@ sources: - # Newer versions at the top "1.2.0": url: - "https://mirror1.net/package-1.2.0.tar.gz" - "https://mirror2.net/package-1.2.0.tar.gz" sha256: "________________________________________________________________" "1.1.0": - url: - - "https://mirror1.net/package-1.1.0.tar.gz" - - "https://mirror2.net/package-1.1.0.tar.gz" + url: "https://mirror2.net/package-1.1.0.tar.gz" sha256: "________________________________________________________________" patches: - # Newer versions at the top "1.1.0": - patch_file: "patches/0001-fix-cmake.patch" patch_description: "correct the order of cmake min and project" diff --git a/docs/package_templates/meson_package/all/conanfile.py b/docs/package_templates/meson_package/all/conanfile.py index 617e18d12f4ad..adb9f19600283 100644 --- a/docs/package_templates/meson_package/all/conanfile.py +++ b/docs/package_templates/meson_package/all/conanfile.py @@ -2,17 +2,15 @@ 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.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 from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" # # INFO: Please, remove all comments before pushing your PR! @@ -23,13 +21,13 @@ class PackageConan(ConanFile): name = "package" description = "short description" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ - # In case not listed there, use "LicenseRef-" + # In case not listed there, use "DocumentRef-:LicenseRef-" license = "" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" # no "conan" and project name in topics. Use topics from the upstream listed on GH topics = ("topic1", "topic2", "topic3") - # package_type should usually be "library" (if there is shared option) + # package_type should usually be "library", "shared-library" or "static-library" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -42,75 +40,62 @@ class PackageConan(ConanFile): "fPIC": True, "feature": 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", - } + # In case having config_options() or configure() method, the logic should be moved to the specific methods. + implements = ["auto_shared_fpic"] # no exports_sources attribute, but export_sources(self) method instead - # this allows finer grain exportation of patches per version def export_sources(self): export_conandata_patches(self) - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - def configure(self): + # Keep this logic only in case configure() is needed e.g pure-c project. + # Otherwise remove configure() and auto_shared_fpic will manage it. if self.options.shared: self.options.rm_safe("fPIC") - # for plain C projects only + # for plain C projects only. Otherwise, remove this method. 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 requirements(self): - # prefer self.requires method instead of requires attribute + # Prefer self.requirements() method instead of self.requires attribute. self.requires("dependency/0.8.1") + if self.options.with_foobar: + # INFO: used in foo/baz.hpp:34 + self.requires("foobar/0.1.0") + # Some dependencies on CCI are allowed to use version ranges. + # See https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/dependencies.md#version-ranges + self.requires("openssl/[>=1.1 <4]") 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) - 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 + check_min_cppstd(self, 14) + # in case it does not work in another configuration, it should be validated here too + # Always comment the reason including the upstream issue. + # INFO: Upstream does not support DLL: See 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.") # if another tool than the compiler or Meson is required to build the project (pkgconf, bison, flex etc) def build_requirements(self): # CCI policy assumes that Meson may not be installed on consumers machine - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/[>=1.2.3 <2]") # pkgconf is largely used by Meson, it should be added in build requirement when there are dependencies if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + # apply patches listed in conandata.yml + # Using patches is always the last resort to fix issues. If possible, try to fix the issue in the upstream project. + apply_conandata_patches(self) 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 + def feature(v): return "enabled" if v else "disabled" + # default_library and static and fpic 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 @@ -122,21 +107,11 @@ def generate(self): # Meson project options may vary their types tc.project_options["tests"] = False tc.generate() - # In case there are dependencies listed on requirements, PkgConfigDeps should be used - tc = PkgConfigDeps(self) - tc.generate() - # In case there are dependencies listed on build_requirements, VirtualBuildEnv should be used - tc = VirtualBuildEnv(self) - tc.generate() - - def _patch_sources(self): - apply_conandata_patches(self) - # remove bundled xxhash - rm(self, "whateer.*", os.path.join(self.source_folder, "lib")) - replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "...", "") + # In case there are dependencies listed under requirements, PkgConfigDeps should be used + deps = PkgConfigDeps(self) + deps.generate() def build(self): - self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed meson = Meson(self) meson.configure() meson.build() @@ -146,11 +121,11 @@ def package(self): meson = Meson(self) meson.install() - # some files extensions and folders are not allowed. Please, read the FAQs to get informed. + # Some files extensions and folders are not allowed. Please, read the FAQs to get informed. + # Consider disabling these at first to verify that the package_info() output matches the info exported by the project. 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")) + rm(self, "*.pdb", self.package_folder, recursive=True) # In shared lib/executable files, meson 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) 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 8adddf3b7b73c..577771653eaef 100644 --- a/docs/package_templates/meson_package/all/test_package/conanfile.py +++ b/docs/package_templates/meson_package/all/test_package/conanfile.py @@ -5,11 +5,9 @@ import os -# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" - test_type = "explicit" + generators = "PkgConfigDeps", "MesonToolchain" def layout(self): basic_layout(self) @@ -18,9 +16,9 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/[>=1.2.3 <2]") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") def build(self): meson = Meson(self) diff --git a/docs/package_templates/meson_package/all/test_package/test_package.cpp b/docs/package_templates/meson_package/all/test_package/test_package.cpp index 315875d954777..7480c357a3b18 100644 --- a/docs/package_templates/meson_package/all/test_package/test_package.cpp +++ b/docs/package_templates/meson_package/all/test_package/test_package.cpp @@ -1,16 +1,19 @@ #include -#include #include "package/foobar.hpp" 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. - */ + * TODO: Remove this comment before pushing the testing code; + * + * Create a minimal usage for the target project here; + * Avoid upstream full examples, or code bigger than 15 lines; + * Avoid networking connections; + * Avoid background apps or servers; + * Avoid GUI apps; + * Avoid extra files like images, sounds and other binaries; + * The propose is testing the generated artifacts ONLY; + */ foobar.print_version(); diff --git a/docs/package_templates/meson_package/config.yml b/docs/package_templates/meson_package/config.yml index a885cbf942a74..d07c95e596619 100644 --- a/docs/package_templates/meson_package/config.yml +++ b/docs/package_templates/meson_package/config.yml @@ -1,5 +1,4 @@ versions: - # Newer versions at the top "1.2.0": folder: all "1.1.0": diff --git a/docs/package_templates/msbuild_package/all/conandata.yml b/docs/package_templates/msbuild_package/all/conandata.yml index 629a5640adc16..5f2e653489b97 100644 --- a/docs/package_templates/msbuild_package/all/conandata.yml +++ b/docs/package_templates/msbuild_package/all/conandata.yml @@ -1,5 +1,4 @@ sources: - # Newer versions at the top "1.2.0": url: - "https://mirror1.net/package-1.2.0.tar.gz" @@ -11,7 +10,6 @@ sources: - "https://mirror2.net/package-1.1.0.tar.gz" sha256: "________________________________________________________________" patches: - # Newer versions at the top "1.1.0": - patch_file: "patches/0001-fix-cmake.patch" patch_description: "correct the order of cmake min and project" diff --git a/docs/package_templates/msbuild_package/all/conanfile.py b/docs/package_templates/msbuild_package/all/conanfile.py index ca164fc1620f8..9b7ee02a4107c 100644 --- a/docs/package_templates/msbuild_package/all/conanfile.py +++ b/docs/package_templates/msbuild_package/all/conanfile.py @@ -1,49 +1,40 @@ from conan import ConanFile 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.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.layout import basic_layout from conan.tools.microsoft import MSBuild, MSBuildDeps, MSBuildToolchain, is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class PackageConan(ConanFile): name = "package" description = "short description" # Use short name only, conform to SPDX License List: https://spdx.org/licenses/ - # In case not listed there, use "LicenseRef-" + # In case not listed there, use "DocumentRef-:LicenseRef-" license = "" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/project/package" # no "conan" and project name in topics. Use topics from the upstream listed on GH topics = ("topic1", "topic2", "topic3") - # package_type should usually be "library" (if there is shared option) + # package_type should usually be "library", "shared-library" or "static-library" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], - "fPIC": [True, False], } default_options = { "shared": False, - "fPIC": True, } # no exports_sources attribute, but export_sources(self) method instead - # this allows finer grain exportation of patches per version 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") - # for plain C projects only + # for plain C projects only. Otherwise, this method is not needed self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") @@ -51,11 +42,19 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - # prefer self.requires method instead of requires attribute + # Prefer self.requirements() method instead of self.requires attribute. self.requires("dependency/0.8.1") + if self.options.with_foobar: + # used in foo/baz.hpp:34 + self.requires("foobar/0.1.0") + # A small number of dependencies on CCI are allowed to use version ranges. + # See https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/dependencies.md#version-ranges + self.requires("openssl/[>=1.1 <4]") def validate(self): - # in case it does not work in another configuration, it should validated here too + # in case it does not work in another configuration, it should be validated here too + # Always comment the reason including the upstream issue. + # INFO: Upstream does not support DLL: See if not is_msvc(self): raise ConanInvalidConfiguration(f"{self.ref} can be built only by Visual Studio and msvc.") @@ -65,6 +64,9 @@ def build_requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + # apply patches listed in conandata.yml + # Using patches is always the last resort to fix issues. If possible, try to fix the issue in the upstream project. + apply_conandata_patches(self) @property def _msbuild_configuration(self): @@ -88,37 +90,7 @@ def generate(self): deps.configuration = self._msbuild_configuration deps.generate() - def _patch_sources(self): - apply_conandata_patches(self) - # remove bundled xxhash - rm(self, "whateer.*", os.path.join(self.source_folder, "lib")) - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "...", "") - - # Allows to inject platform toolset, and props file generated by MSBuildToolchain & MSBuildDeps - # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client - vcxproj_files = ["path/to/vcxproj_file1", "path/to/vcxproj_file2", "..."] - 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"" - for vcxproj_file in vcxproj_files: - replace_in_file( - self, vcxproj_file, - # change this v142 value depending on actual value in vcxproj file - "v142", - f"{platform_toolset}", - ) - if props_path: - replace_in_file( - self, vcxproj_file, - "", - f"{import_conan_generators}", - ) - def build(self): - self._patch_sources() # It can be apply_conandata_patches(self) only in case no more patches are needed msbuild = MSBuild(self) msbuild.build_type = self._msbuild_configuration # customize according the solution file and compiler version 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 69086f9b189e8..c16ec6d748476 100644 --- a/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt +++ b/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.15) - -project(test_package LANGUAGES C) # if the project is pure C -# project(test_package LANGUAGES CXX) # if the project uses C++ +project(test_package LANGUAGES CXX) find_package(package 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 package::package) diff --git a/docs/package_templates/msbuild_package/all/test_package/conanfile.py b/docs/package_templates/msbuild_package/all/test_package/conanfile.py index 02eb5ce439fb4..2e77b4246fa81 100644 --- a/docs/package_templates/msbuild_package/all/test_package/conanfile.py +++ b/docs/package_templates/msbuild_package/all/test_package/conanfile.py @@ -4,18 +4,16 @@ 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) + generators = "CMakeDeps", "CMakeToolchain" 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/docs/package_templates/msbuild_package/all/test_package/test_package.cpp b/docs/package_templates/msbuild_package/all/test_package/test_package.cpp index 8e653f30a5476..7480c357a3b18 100644 --- a/docs/package_templates/msbuild_package/all/test_package/test_package.cpp +++ b/docs/package_templates/msbuild_package/all/test_package/test_package.cpp @@ -1,14 +1,19 @@ #include -#include #include "package/foobar.hpp" int main(void) { - std::cout << "Create a minimal usage for the target project here." << std::endl; - std::cout << "Avoid big examples, bigger than 100 lines" << std::endl; - std::cout << "Avoid networking connections." << std::endl; - std::cout << "Avoid background apps or servers." << std::endl; - std::cout << "The propose is testing the generated artifacts only." << std::endl; + /* + * TODO: Remove this comment before pushing the testing code; + * + * Create a minimal usage for the target project here; + * Avoid upstream full examples, or code bigger than 15 lines; + * Avoid networking connections; + * Avoid background apps or servers; + * Avoid GUI apps; + * Avoid extra files like images, sounds and other binaries; + * The propose is testing the generated artifacts ONLY; + */ foobar.print_version(); diff --git a/docs/package_templates/msbuild_package/config.yml b/docs/package_templates/msbuild_package/config.yml index a885cbf942a74..d07c95e596619 100644 --- a/docs/package_templates/msbuild_package/config.yml +++ b/docs/package_templates/msbuild_package/config.yml @@ -1,5 +1,4 @@ versions: - # Newer versions at the top "1.2.0": folder: all "1.1.0": diff --git a/docs/package_templates/prebuilt_tool_package/all/conandata.yml b/docs/package_templates/prebuilt_tool_package/all/conandata.yml index efcc89654623a..b9d6d85ec79e3 100644 --- a/docs/package_templates/prebuilt_tool_package/all/conandata.yml +++ b/docs/package_templates/prebuilt_tool_package/all/conandata.yml @@ -1,5 +1,4 @@ sources: - # Newer versions at the top "1.2.0": "Windows": "x86_64": diff --git a/docs/package_templates/prebuilt_tool_package/all/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/conanfile.py index aa042fd087498..eb1d1e11e7805 100644 --- a/docs/package_templates/prebuilt_tool_package/all/conanfile.py +++ b/docs/package_templates/prebuilt_tool_package/all/conanfile.py @@ -5,7 +5,7 @@ import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=2.0" class PackageConan(ConanFile): @@ -19,7 +19,7 @@ class PackageConan(ConanFile): package_type = "application" settings = "os", "arch", "compiler", "build_type" # even for pre-built executables - # not needed but supress warning message from conan commands + # not needed but suppress warning message from conan commands def layout(self): pass @@ -37,7 +37,7 @@ def validate(self): def source(self): pass - # download the source here, than copy to package folder + # download the source here, then copy to package folder def build(self): get( self, @@ -58,7 +58,3 @@ def package_info(self): 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/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py index b3a58664b7d6b..0358d4cb99039 100644 --- a/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py +++ b/docs/package_templates/prebuilt_tool_package/all/test_package/conanfile.py @@ -1,12 +1,12 @@ from conan import ConanFile -from conan.tools.build import can_run +from conan.tools.layout import basic_layout -# It will become the standard on Conan 2.x 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) diff --git a/docs/package_templates/prebuilt_tool_package/config.yml b/docs/package_templates/prebuilt_tool_package/config.yml index a885cbf942a74..d07c95e596619 100644 --- a/docs/package_templates/prebuilt_tool_package/config.yml +++ b/docs/package_templates/prebuilt_tool_package/config.yml @@ -1,5 +1,4 @@ versions: - # Newer versions at the top "1.2.0": folder: all "1.1.0": diff --git a/docs/review_process.md b/docs/review_process.md index cf9d98f130d9b..bae426df1eaf6 100644 --- a/docs/review_process.md +++ b/docs/review_process.md @@ -1,134 +1,69 @@ # Review process Behind the scenes of conan-center-index, there is a heavily automated process to test and merge pull requests. -As there is a lot of activity from many users and various bots (e.g. bumping versions or updating conventions), many PRs are opened every day. +As there is a lot of activity from many users and many PRs are opened every day. conan-center-index tries to make the process as smooth and simple as possible for the contributors, providing feedback in PRs. In this document will explain the review process in detail. ## Contents - * [conan-center-bot](#conan-center-bot) * [Green build](#green-build) * [Unexpected error](#unexpected-error) * [Avoiding conflicts](#avoiding-conflicts) - * [Draft](#draft) * [Getting your pull request reviewed](#getting-your-pull-request-reviewed) * [Rule of 2 reviews](#rule-of-2-reviews) * [Reviews from others](#reviews-from-others) * [Addressing review comments](#addressing-review-comments) - * [Automatic Merges](#automatic-merges) - * [Merge](#merge) - * [Package available to consume](#package-available-to-consume) - * [Updating web front end](#updating-web-front-end) + * [Package available to consume](#package-available-to-consume) + * [Updating web front end](#updating-web-front-end) * [Stale PRs](#stale-prs) -## [conan-center-bot](https://github.com/conan-center-bot) - -In general, reviews are driven by the automated [bot](https://github.com/conan-center-bot). The bot is responsible for: - -- Adding or removing labels (such as [Bump version](https://github.com/conan-io/conan-center-index/pulls?q=is%3Apr+is%3Aopen+label%3A%22Bump+version%22) or [Docs](https://github.com/conan-io/conan-center-index/pulls?q=is%3Apr+is%3Aopen+label%3ADocs)). -- Writing comments (most of the time, it's a build status, either failure with logs or success). -- Merging pull requests. -- Closing issues (after merging pull requests with GitHub keywords). -- Starting CI builds. -- Assigning CI status (running/failed/successful). - ## Green build The first important prerequisite is ensuring your PR is green (build is successful). It requires a bit of patience, because there are many PRs running and we're building a lot of configurations for a numerous versions of libraries. -Keep attention to the error messages from the bot, and address all the build failures. -The bot tries to provide all the helpful information needed to understand and reproduce an issue, such as: - -- The profile that failed (in other words, the configuration: architecture, operation system, compiler, etc.) -- Failed command line (it might have failed on early stages, like recipe syntax errors, hook errors or later stages, like build or test). -- Logs containing the actual output of the build process (note that some logs like *configure.log* or *CMakeError.log* are not captured, only stdout/stderr). +Keep attention to the error messages from the check tab on your PR, and address all the build failures. +The checks tries to provide all the helpful information needed to understand and reproduce an issue. -If you struggle to fix build errors yourself, you may want to ask for help from other users by mentioning (`@`) individual users in the pull request comments. +If you struggle to fix build errors yourself, you may want to ask for help from other users by mentioning (`@conan-io/barbarians`) group in the pull request comments. ### Unexpected error -Sometimes, build fails with `Unexpected error` message. This indicates an infrastructure problem, and usually it's unrelated to the changes within PR itself. - -To learn more, checkout the [label definition](labels.md#unexpected-error). +Sometimes, build fails with an unexpected error (e.g Pre-Checks hangs forever). This indicates an infrastructure problem, and usually it's unrelated to the changes within PR itself. When this occurs, please, ping `@conan-io/barbarians` in your PR describing your situation. ## Avoiding conflicts -Right now, neither GitHub itself nor conan-center-bot notify about merge conflicts, so it's the contributor's responsibility to periodically check for the conflicts. Pull Requests that have merge conflicts can't be merged, and all the conflicts have to be resolved first. - -Please [synchronize your branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) to take into account the latest changes in the main branch. This is important for ConanCenter to ensure it is building the correct recipe revision, see [this comment](https://github.com/conan-io/conan-center-index/pull/8797#discussion_r781993233) for details. One trick is to look out for comments from the [Community's Conflict PR Bot](https://github.com/prince-chrismc/conan-center-index/blob/patch-41/docs/community_resources.md#bots) which can anticipate possible problems. +Right now, the check `Related Pull Requests` shows other PRs that are affecting the recipe and may result in conflicts, so it's the contributor's responsibility to periodically check for the conflicts. Pull Requests that have merge conflicts can't be merged, and all the conflicts have to be resolved first. -## Draft +In case a PR that affects your recipe is merged first, then, you have to [synchronize your branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) to take into account the latest changes in the main branch. This is important for ConanCenter to ensure it is building the correct recipe revision. -Draft pull requests are also never merged, and they won't likely be reviewed. -Once you're done with your changes, remember to convert from "Draft" to "Normal" pull request. +One trick is to look the [List of open pull requests broken down by recipe](https://github.com/conan-io/conan-center-index/discussions/24240) which can anticipate possible problems. ## Getting your pull request reviewed -Each PR must be reviewed by several reviewers before it will be merged. It cannot be just reviews from anyone, we have two categories of reviewers: - -- Official reviewers: these are active team members who are responsible for developing Conan, ConanCenter, and ConanCenterIndex. -- Community reviewers: this list includes former Conan team members and ConanCenterIndex contributors who are very active and proven to be trusted - they frequently submit pull requests and provide their own useful reviews - -The list or reviewers, located [here](../.c3i/reviewers.yml), -is not constant and will change periodically based on contribution. -That also means **you can be included in this list** as well - submit PRs and provide reviews, and in time you may be added as a trusted contributor. - -> **Note**: GitHubs user interface does not support such custom rules so you should not rely solely on the message it provides. +Each PR must be reviewed before it will be merged. Extra reviews are welcome and appreciated, but the Conan team reviews are required. ### Rule of 2 reviews -At least 2 approving reviews are required, and at least one of them has to be from the official reviewers. -So, it might be 1 official + 1 community, or 2 official, but it couldn't be just 2 community reviews. -Approvals are only counted if they are associated with the latest commit in the PR, while "Change requested" ones (from the Conan team) will persist even if there are new commits. Don't hesitate to dismiss old reviews if the issues have already been addressed. +At least 2 approving reviews are required from maintainers are mandatory to merge a PR. -> **Note** Pull requests labelled as [`Bump version`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Bump+version%22) -> or [`Bump dependencies`](https://github.com/conan-io/conan-center-index/pulls?q=is%3Aopen+is%3Apr+label%3A%22Bump+dependencies%22+) are merged by -> the bot without requiring any approval. +Approvals are only counted if they are associated with the latest commit in the PR, while "Change requested" ones (from the Conan team) will persist even if there are new commits. -### Reviews from others +### Reviews from community -All reviews are still valuable and very helpful. Even if you're not listed as an official or community reviewer, **your reviews are very welcome**, so please do not hesitate to provide them. +All reviews are still valuable and very helpful. ### Addressing review comments Please ensure to address the review comments and respond to them in order to get your PR approved and finally merged. -It doesn't always mean accepting all the suggestions, but at least providing a response, so people can understand your position. - -## Automatic Merges - -The bot runs Automatic Merges every 20 minutes. Currently, it can only merge a single PR in this timeframe, so there is a theoretical limit of ~70 PRs merged per day (in practice, it's even less for reasons listed below). -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](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. -- PR has approved reviews (as described above). -- PR does not have any [official reviewers](#official-reviewers) requesting changes -- Master build is not running already (see below) - -If these conditions are fulfilled, the PR is merged (associated issues are automatically closed), and then the build of `master` is launched. - -The conan-center-bot will perform a [squash and merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-pull-request-commits). You don't need to rebase -your pull request, we ask you not to do it because it will dismiss any reviews and the reviewer will need to restart. - -### Merge - -After merging a pull request, if an actual merge happened (for instance, the recipe changed in PR was already updated in `master` by the time PR merged), -it will introduce a new recipe revision. Therefore, the build should be run one more time, so the `master` build is launched. -In reality this could happen frequently enough if there are multiple PRs aiming to update the same recipe (even if they touch different files in the same recipe). -Such builds can take hours for big packages (like boost), blocking other merges for a while. -So we really appreciate it if changes in `master` to the same recipe are already merged into the proposed PR. +Be polite and open to suggestions. Also, please, read the [code of conduct](code_of_conduct.md) to understand the expected behavior in the community. -### Package available to consume +## Package available to consume -New packages are promoted from the internal repository to ConanCenter. This process is an internal Artifactory promotion that is quite -fast, nevertheless there are some caches and CDNs that need to be invalidated and propagated before the package is finally available for consumption. -The process can take several minutes, so please, consider a *grace period* and understand that the package won't be available immediately. +New packages are promoted from the internal repository to ConanCenter. +The process can take few minutes, so please, consider a *grace period* and understand that the package won't be available immediately. -### Updating web front end +## Updating web front end [ConanCenter](https://conan.io/center/) doesn't directly pull the information from conan-center-index repository. Instead, it's updated by the conan center CI job as its own step. The metadata from the conan repository is @@ -137,4 +72,4 @@ That may explain the fact there are moments when the information showed in the f ## Stale PRs -Conan Center Index uses [stale bot](https://github.com/probot/stale) to close abandoned pull requests. It's configured by [stale.yml](../.github/stale.yml). When a pull request gets stale, we encourage anyone to take ownership of the PR (even submit changes to the author's branch if possible) so existing work doesn't get lost when the pull request is closed without merging. +Conan Center Index uses [stale bot](https://github.com/probot/stale) to close abandoned pull requests. It's configured by [stale.yml](../.github/workflows/stale.yml). When a pull request gets stale, we encourage anyone to take ownership of the PR (even submit changes to the author's branch if possible) so existing work doesn't get lost when the pull request is closed without merging. diff --git a/docs/supported_platforms_and_configurations.md b/docs/supported_platforms_and_configurations.md index f39ae2fe9c847..d04d4186e6d13 100644 --- a/docs/supported_platforms_and_configurations.md +++ b/docs/supported_platforms_and_configurations.md @@ -4,7 +4,7 @@ ## Contents * [Introduction](#introduction) - * [Build Images](#build-images) + * [Future Steps](#future-steps) * [Windows](#windows) * [Linux](#linux) * [MacOS](#macos) @@ -13,26 +13,28 @@ The pipeline iterates a fixed list of profiles for every Conan reference, it computes the packageID for each profile and discard duplicates. Then it -builds the packages for the remaining profiles and upload them to +builds the packages for the remaining profiles and promoted them to [JFrog ConanCenter](https://conan.io/center/) once the pull-request is merged. -Because duplicated packageIDs are discarded, the pipeline iterates the -profiles always in the same order and the profiles selected to build when -there is a duplicate follow some rules: +Currently, given the following supported platforms and configurations we +are generating **30 different binary packages for a C++ library**. - * Static linkage (option `shared=False`) is preferred over dynamic linking. - * On Windows, `MT/MTd` runtime linkage goes before `MD/MDd` linkage. - * Optimized binaries (`build_type=Release`) are preferred over its _debug_ counterpart. - * Older compiler versions are considered first. - * In Linux, GCC is iterated before Clang. -Currently, given the following supported platforms and configurations we -are generating **136 different binary packages for a C++ library** -and **88 for a C library**. +### Future Steps -### Build Images +With the introduction of our new, more flexible pipeline, +we will be implementing several enhancements to improve our build capabilities and support +a wider range of development environments. The following steps will be taken: -For more information see [conan-io/conan-docker-tools](https://github.com/conan-io/conan-docker-tools) +- Incorporate additional modern GCC versions for Linux builds: + - By adding the latest versions of GCC, we aim to ensure compatibility with the newest C++ standards and features, allowing developers to leverage the latest advancements in the language. +- Integrate more recent Clang versions for Linux builds: + - Clang is known for its fast compilation times and excellent diagnostics. By including more modern versions, we will provide developers with improved performance and better error reporting, enhancing the overall development experience. +- Include updated Apple-Clang versions for macOS builds: + - As macOS continues to evolve, it is crucial to support the latest Apple-Clang versions. This will ensure that our builds are optimized for the latest macOS features and provide a seamless experience for developers working in the Apple ecosystem. +- Add support for Android builds to the pipeline: + - Expanding our pipeline to include Android builds will enable developers to create and test applications for mobile platforms more efficiently. + This addition will help streamline the development process and ensure that our tools are versatile and adaptable to various environments. ## Windows @@ -42,46 +44,39 @@ For more information see [conan-io/conan-docker-tools](https://github.com/conan- > WinSDK version is rolled periodically as [discussed previously](https://github.com/conan-io/conan-center-index/issues/4450). > Please open an issue in case it needs to be updated. - Compilers: Visual Studio: - - - 2019 (19.29.30148) - -- Release (MT/MD) and Debug (MTd, MDd) + - Architectures: x86_64 -- Build types: Release, Debug -- Runtimes: MT/MD (Release), MTd/MDd (Debug) +- Build types: Release +- Runtime: dynamic (MD) - Options: - - Shared, Static (option `"shared": [True, False]` in the recipe when available) - - Header Only (option `"header_only": [True, False]` if available) - -> :warning: The profile with the option `shared=True` and runtime `MT/MTd` is not built. + - Shared, Static (option `"*/*:shared": [True, False]` in the recipe when available) + - Header Only (option `"&:header_only": [True, False]` is only added with the value True) ## Linux -- Python: 3.7.13 -- CMake: 3.15.7, 3.18.2 (same version expected after all use [new docker images](https://github.com/conan-io/conan-docker-tools/tree/master/modern)) +- Python: 3.7.17 +- CMake: 3.15.7, 3.18.6 (same version expected after all use [new docker images](https://github.com/conan-io/conan-docker-tools/tree/master/images)) - Compilers: - - GCC versions: 5, 7, 9, 10, 11 - - Clang versions: 12, 13 + - GCC versions: 11 - C++ Standard Library (`libcxx`): - - GCC compiler: `libstdc++`, `libstdc++11` - - Clang compiler: `libstdc++`, `libc++` + - GCC compiler: `libstdc++11` - Architectures: x86_64 -- Build types: Release, Debug +- Build types: Release - Options: - - Shared, Static (option `"shared": [True, False]` in the recipe when available) - - Header Only (option `"header_only": [True, False]` is only added with the value True) + - Shared, Static (option `"*/*:shared": [True, False]` in the recipe when available) + - Header Only (option `"&:header_only": [True, False]` is only added with the value True) ## MacOS - Python: 3.7.12 - CMake: 3.20.1 -- Compilers: Apple-clang versions 11.0.3, 12.0.5, 13.0.0 -- Macos SDK versions (for each apple-clang version respectively): 10.15, 11.3 -- Macos deployment target (`minos`): 10.15, 11.0, 11.3 +- Compilers: Apple-clang versions 13.0.0 +- Macos SDK versions (for each apple-clang version respectively): 11.3 +- Macos deployment target (`minos`): 11.0 - C++ Standard Library (`libcxx`): `libc++` -- Architectures: x86_64, armv8 -- Build types: Release, Debug +- Architectures: armv8 +- Build types: Release - Options: - - Shared, Static (option ``"shared": [True, False]`` in the recipe when available) - - Header Only (option `"header_only": [True, False]` is only added with the value True) + - Shared, Static (option `"*/*:shared": [True, False]` in the recipe when available) + - Header Only (option `"&:header_only": [True, False]` is only added with the value True) diff --git a/docs/v2_linter.md b/docs/v2_linter.md deleted file mode 100644 index 3d6e3a3f6be33..0000000000000 --- a/docs/v2_linter.md +++ /dev/null @@ -1,71 +0,0 @@ -# Linter to help migration to Conan v2 - - -## Contents - - * [Running the linter locally](#running-the-linter-locally) - * [Import ConanFile from `conan`](#import-conanfile-from-conan) - * [Import tools from `conan`](#import-tools-from-conan) - -We are leveraging on custom Pylint rules. This -linter will run for every pull-request that is submitted to the repository and will -raise some warnings and errors that should be addressed in order to migrate the -recipes to Conan v2. - -It is important to note that these rules are targeting Conan v2 compatibility layer, their -purpose is to fail for v1 syntax that will be no longer available in v2. Even if the syntax -if perfectly valid in Conan v1, the recipe might fail here because it is not v2-compliant. - -> **Note** Some of the errored checks might be just plain Python syntax errors, while -> others might be related to the custom rules added by us. - -Here you can find some examples of the extra rules we are adding: - -## Running the linter locally - -Check the [Developing Recipes](developing_recipes_locally.md#running-the-python-linters) for details. - -## Import ConanFile from `conan` - -The module `conans` is deprecated in Conan v2. Now all the imports should be done from -module `conan`: - -```python -from conan import ConanFile -``` - -## Import tools from `conan` - -All v2-compatible tools are available in module `conan.tools` under different submodules. Recipes -should start to import their tools from this new module. Some of the new tools accept new -argument, please, check the [Conan documentation](https://docs.conan.io/1/reference/conanfile/tools.html). - -Here is a list of different imports and their new equivalent (note that the interface for most of this functions changed, see their respective link to the documentation): - -| **Conan v1** | **Conan v2** | **Required Conan Version** | -|---|---|---| -| conans.tools.get | [conan.tools.files.get](https://docs.conan.io/1/reference/conanfile/tools/files/downloads.html#conan-tools-files-get) | 1.41.0 | -| conans.tools.download | [conan.tools.files.download](https://docs.conan.io/1/reference/conanfile/tools/files/downloads.html#conan-tools-files-download) | 1.41.0 | -| conans.tools.rmdir | [conan.tools.files.rmdir](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-rmdir) | 1.47.0 | -| conans.tools.patch | [conan.tools.files.patch](https://docs.conan.io/1/reference/tools.html#tools-patch) | 1.35.0 | -| conans.tools.remove_files_by_mask | [conan.tools.files.rm](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-rm) | 1.50.0 | -| conans.copy | [conan.tools.files.copy](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-copy) | 1.46.0 | -| conans.tools.load | [conan.tools.files.load](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-load) | 1.35.0 | -| conans.tools.save | [conan.tools.files.save](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-save) | 1.35.0 | -| conans.tools.rename | [conan.tools.files.rename](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-rename) | 1.37.0 | -| conans.tools.replace_in_file | [conan.tools.files.replace_in_file](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-replace-in-file) | 1.46.0 | -| conans.tools.mkdir | [conan.tools.files.mkdir](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-mkdir) | 1.35.0 | -| conans.tools.chdir | [conan.tools.files.chdir](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-chdir) | 1.40.0 | -| conans.tools.unzip | [conan.tools.files.unzip](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-unzip) | 1.46.0 | -| conans.tools.collect_libs | [conan.tools.files.collect_libs](https://docs.conan.io/1/reference/conanfile/tools/files/basic.html#conan-tools-files-collect-libs) | 1.46.0 | -| conans.tools.Version | [conan.tools.scm.Version](https://docs.conan.io/1/reference/conanfile/tools/scm/other.html#version) | 1.46.0 | -| conans.tools.sha256sum | [conan.tools.files.check_sha256](https://docs.conan.io/1/reference/conanfile/tools/files/checksum.html#conan-tools-files-check-sha256) | 1.46.0 | -| conans.tools.unix_path | [conan.tools.microsoft.unix_path](https://docs.conan.io/1/reference/conanfile/tools/microsoft.html#conan-tools-microsoft-unix-path) | 1.47.0 | -| conans.tools.is_apple_os | [conan.tools.apple.is_apple_os](https://docs.conan.io/1/reference/conanfile/tools/apple.html#is-apple-os) | 1.51.3 | -| conans.tools.cpu_count | [conan.tools.build.build_jobs](https://docs.conan.io/1/reference/conanfile/tools/build.html#conan-tools-build-build-jobs) | 1.43.0 | -| conans.tools.check_min_cppstd | [conan.tools.build.check_min_cppstd](https://docs.conan.io/1/reference/conanfile/tools/build.html#conan-tools-build-check-min-cppstd) | 1.50.0 | -| conans.tools.cross_building | [conan.tools.build.cross_building](https://docs.conan.io/1/reference/conanfile/tools/build.html#conan-tools-build-cross-building) | 1.46.0 | -| conans.errors.ConanInvalidConfiguration | [conan.errors.ConanInvalidConfiguration](https://docs.conan.io/1/migrating_to_2.0/recipes.html#migrating-the-recipes) | 1.47.0 | -| conans.errors.ConanException | [conan.errors.ConanException](https://docs.conan.io/1/migrating_to_2.0/recipes.html#migrating-the-recipes) | 1.47.0 | - ---- diff --git a/docs/v2_migration.md b/docs/v2_migration.md deleted file mode 100644 index 9139fefbde135..0000000000000 --- a/docs/v2_migration.md +++ /dev/null @@ -1,147 +0,0 @@ -# Preparing recipes for Conan 2.0 - -This is expected for recipes to be updates in each pull request. - -- Updated helpers are expected, this is enforced by the [v2_linter](v2_linter.md) -- Once a recipe publishes v2 packages, it must pass the v2 pipeline -- The v2 pipeline with **shortly be required** for changes to be merged. - - -## Contents - - * [Using Layout](#using-layout) - * [With New Generators](#with-new-generators) - * [With Multiple Build Helpers](#with-multiple-build-helpers) - * [CMakeToolchain](#cmaketoolchain) - * [New conf_info properties](#new-conf_info-properties) - * [New cpp_info set_property model](#new-cpp_info-set_property-model) - * [Translating .names information to cmake_target_name, cmake_module_target_name and cmake_file_name](#translating-names-information-to-cmake_target_name-cmake_module_target_name-and-cmake_file_name) - * [Translating .filenames information to cmake_file_name, cmake_module_file_name and cmake_find_mode](#translating-filenames-information-to-cmake_file_name-cmake_module_file_name-and-cmake_find_mode) - * [Translating .build_modules to cmake_build_modules](#translating-build_modules-to-cmake_build_modules) - * [PkgConfigDeps](#pkgconfigdeps) - -> **Note**: Read about the [linter in pull requests](v2_linter.md) to learn how this is being enforced. - -It's time to start thinking seriously about Conan v2 and prepare recipes -for the incoming changes. Conan v2 comes with many -changes and improvements, you can read about them in the -[Conan documentation](https://docs.conan.io/1/conan_v2.html). - -This document is a practical guide, offering extended information particular to Conan -Center Index recipes to get them ready to upgrade to Conan 2.0. - -## Using Layout - -All recipes should use a layout. Without one, more manual configuration of folders (e.g. source, build, etc) -and package structure will be required. - -### With New Generators - -When doing this there is no need to manually define `self._subfolder_[...]` in a recipe. -Simply use `self.source_folder` and `self.build_folder` instead of "subfolder properties" that used to be the norm. - -### With Multiple Build Helpers - -When different build tools are use, at least one layout needs to be set. - -```python - def layout(self): - if self._use_cmake(): - cmake_layout(self) - else: # using autotools - basic_layout(self) -``` - -The `src_folder` must be the same when using different layouts and should -not depend on settings or options. - -## CMakeToolchain - -The old `CMake.definition` should be replaced by `CMakeToolchain.variables` and moved to the `generate` method. -However, certain options need to be passed as `cache_variables`. You'll need to check project's `CMakeLists.txt` -as there are a few cases to look out for: - -- When an `option` is configured before `project()` is called. - - ```cmake - cmake_minimum_required(3.1) - option(BUILD_EXAMPLES "Build examples using foorbar") - project(foobar) - ``` - -- When an variable is declared with `CACHE`. - - ```cmake - cmake_minimum_required(3.1) - project(foobar) - set(USE_JPEG ON CACHE BOOL "include jpeg support?") - ``` - -For more information refere to the [CMakeToolchain docs](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmaketoolchain.html) -or check out the converstaion in conan-io/conan#11937 for the brave. - -## New conf_info properties - -As described in the documentation `self.user_info` has been depreated and you are now required to use -`self.conf_info` to define individual properties to expose to downstream recipes. -The [2.0 migrations docs](https://docs.conan.io/1/migrating_to_2.0/recipes.html#removed-self-user-info) -should cover the technical details, however for ConanCenterIndex we need to make sure there are no collisions -`conf_info` must be named `user.:`. - -For usage options of `conf_info`, the [documenation](https://docs.conan.io/1/reference/config_files/global_conf.html?highlight=conf_info#configuration-in-your-recipes) - -In ConanCenterIndex this will typically looks like: - -- defining a value - ```py - def package_info(self): - tool_path = os.path.join(self.package_folder, "bin", "tool") - self.conf_info.define("user.pkg:tool", tool_path) - ``` -- using a value - ```py - #generators = "VirtualBuildEnv", "VirtualRunEnv" - - def build_requirements(self): - self.tool_requires("tool/0.1") - - def build(self): - tool_path = self.conf_info.get("user.pkg:tool") - self.run(f"{tool_path} --build") - ``` - -> **Note**: This should only be used when absolutely required. In the vast majority of cases, the new -> ["Environments"](https://docs.conan.io/1/reference/conanfile/tools/env/environment.html?highlight=Virtual) -> will include the `self.cpp_info.bindirs` which will provide access to the tools in the correct scopes. - -## New cpp_info set_property model - -New Conan generators like -[CMakeDeps](https://docs.conan.io/1/reference/conanfile/tools/cmake/cmakedeps.html) -and -[PkgConfigDeps](https://docs.conan.io/1/reference/conanfile/tools/gnu/pkgconfigdeps.html), -don't listen to `cpp_info`'s ``.names``, ``.filenames`` or ``.build_modules`` attributes. -There is a new way of setting the `cpp_info` information with these -generators using the ``set_property(property_name, value)`` method. - -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. - -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 - -The variation of `names` is covered by the [Conan documentation](https://docs.conan.io/1/migrating_to_2.0/properties.html#migrating-from-names-to-cmake-target-name). - -### Translating .filenames information to cmake_file_name, cmake_module_file_name and cmake_find_mode - -As for `filenames`, refer to [this section](https://docs.conan.io/1/migrating_to_2.0/properties.html#migrating-from-filenames-to-cmake-file-name). - -### Translating .build_modules to cmake_build_modules - -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 - -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/docs/v2_roadmap.md b/docs/v2_roadmap.md deleted file mode 100644 index 324ec01c47527..0000000000000 --- a/docs/v2_roadmap.md +++ /dev/null @@ -1,150 +0,0 @@ -# Road to Conan v2 - - -## Contents - - * [Short term](#short-term) - * [Prepare the CI infrastructure](#prepare-the-ci-infrastructure) - * [Export recipes using Conan v2 (warning)](#export-recipes-using-conan-v2-warning) - * [Prepare a syntax linter (CCI specific)](#prepare-a-syntax-linter-cci-specific) - * [Run an scheduled job exporting all recipes](#run-an-scheduled-job-exporting-all-recipes) - * [Mid term](#mid-term) - * [Add CI running Conan v2 (hidden)](#add-ci-running-conan-v2-hidden) - * [Show CI results to contributors (info)](#show-ci-results-to-contributors-info) - * [Linter - turn more warnings to errors](#linter---turn-more-warnings-to-errors) - * [Export using Conan v2 becomes an error](#export-using-conan-v2-becomes-an-error) - * [Long term](#long-term) - * [CI running v2 is reported (and required)](#ci-running-v2-is-reported-and-required) - * [Conan v2 remote](#conan-v2-remote) - * [Webpage with v2 information](#webpage-with-v2-information) - * [Future](#future) - * [CI running Conan v1 dropping configuration support](#ci-running-conan-v1-dropping-configuration-support) - -> **Note** This document is not a [guide about how to migrate recipes to Conan v2](v2_migration.md). - -> **Note** This is a working document that will be updated as we walk -> this path. There are no dates intentionally, and if any they should be -> considered as an estimation, there are still some unknowns to provide -> certain steps and dates. - -Conan v2 is under heavy development and it will be released in the -following months. It comes with many improvements that will benefit -recipes and users, and we are willing to adopt it. - -It is a new major version that will come with many breaking changes. Lot -of the features and syntax that we were used to in Conan v1 will no longer -be available and will be supersedes by improved alternatives. All these -alternatives should be backported to v1.x releases, so **there will be a -subset of features that will work using Conan v1 and v2**. - -**Our main goal in ConanCenter during this migration process is to ensure -that recipes work with v1 and v2** and to make the transition as smooth as -possible for contributors and users. In the end we will be providing -working recipes and binaries for both versions. - -This process will require a lot of work also in the internals, we will keep -communicating those changes and the relevant updates in the -[changelog](changelog.md). Here there are the main steps that we are -planning for the following months. - -## Short term - -### Prepare the CI infrastructure - -Workers for Conan v2 will be ready for Windows, Macos and Linux alternatives. -[Modern docker images](https://github.com/conan-io/conan-docker-tools/tree/master/modern) with Conan v2 are already -available to use, for example `conanio/gcc11-ubuntu16.04:2.0.0-pre`. -Note that we will be using tag name `2.0.0-pre` until there is an -actual Conan v2 release, this tag will use the latest pre-release -available (alpha, beta or release candidate). - -### Export recipes using Conan v2 (warning) - -We will start to run `conan export` using Conan v2 and the result will be -added to the comments by the bot. Failing this command won't make the -pull-request fail at this moment, but we expect contributors to start -gaining awareness about changes in Conan v2. - -### Prepare a syntax linter (CCI specific) - -We want to provide a Conan recipe's linter in this repository. We will add -warnings and errors to it following the pace dictated by the community. -The purpose is that this linter will fail pull-requests if there is any -error and, this way, we can start to migrate small (and easy) bits of -recipes... and ensure that future pull-requests don't introduce -regressions. - -This linter can (and surely will) implement some of the checks that are -being currently done by [hooks](https://github.com/conan-io/hooks), but -the purpose is not replace them: - -* hooks are really useful from the CLI, and are easier to install and run. -* linter provides much better output in GitHub interface. - -### Run an scheduled job exporting all recipes - -The same way we [export all the recipes every night using Conan v1](https://github.com/conan-io/conan-center-index/issues/2232), we will -run something similar using Conan v2 and report the results to an issue in -this repository. - -It will help us to know how many recipes are fixed at a given time and -think about efforts and impact of next steps. - -## Mid term - -### Add CI running Conan v2 (hidden) - -We will start working on a CI running Conan v2. Once recipes start to be -exported successfully, next step is to start building the packages. - -We are going to prepare the CI and start running it behind the scenes -(sorry, at this moment hidden to users) in order to understand and -experiment ourself some challenges that will come with Conan v2: syntax, -configuration defaults,... - -### Show CI results to contributors (info) - -Once the errors start to make sense, we will start to provide these outputs -in pull-requests (although successful builds using v2 won't be required to -merge). Again, we expect some contributors to be aware of these errors, -maybe try to fix those builds, and for sure report feedback. - -### Linter - turn more warnings to errors - -During all this time, the plan is to move linter warnings to errors, one -by one and taking into account the effort required to fix them. With the -help of the linter more recipes should start to work (just `conan export`) -using Conan v2. - -### Export using Conan v2 becomes an error - -When a significant number (TBD) of recipes start to be exported -successfully, we will turn those export warnings into actual errors and -they will be become required to merge the pull-requests - -## Long term - -### CI running v2 is reported (and required) - -Next step is to start running and reporting the results of the builds using -v2 for all the configurations, like we do for Conan v1. At this time all -pull-requests need to work with v1 and v2 to be merged. - -### Conan v2 remote - -Packages built using Conan v2 are available for users on ``conancenter`` remote. - -### Webpage with v2 information - -ConanCenter webpage will start to show relevant information related to v2 -packages and, eventually, v2 information will be the only available. - -## Future - -After this process in completed, we will consider the deprecation and -decommission of the infrastructure to generate v1 packages. - -### CI running Conan v1 dropping configuration support - -The change should occur by steps, less used configurations, like older compiler versions, will be dropped first. -Any changed will notified before to occur, so users can be prepared. diff --git a/linter/__init__.py b/linter/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/linter/check_import_conanfile.py b/linter/check_import_conanfile.py deleted file mode 100644 index bd5a90391b096..0000000000000 --- a/linter/check_import_conanfile.py +++ /dev/null @@ -1,28 +0,0 @@ - -from pylint.checkers import BaseChecker -from pylint.interfaces import IAstroidChecker -from astroid import nodes, Const, AssignName - - -class ImportConanFile(BaseChecker): - """ - Import ConanFile from new 'conan' module - """ - - __implements__ = IAstroidChecker - - name = "conan-import-conanfile" - msgs = { - "E9006": ( - "Import ConanFile from new module: `from conan import ConanFile`. Old import is deprecated in Conan v2.", - "conan-import-conanfile", - "Import ConanFile from new module: `from conan import ConanFile`. Old import is deprecated in Conan v2.", - ), - } - - def visit_importfrom(self, node: nodes.ImportFrom) -> None: - basename = node.modname - if basename == 'conans': - names = [name for name, _ in node.names] - if 'ConanFile' in names: - self.add_message("conan-import-conanfile", node=node) diff --git a/linter/check_import_errors.py b/linter/check_import_errors.py deleted file mode 100644 index b6a0ac1aa9973..0000000000000 --- a/linter/check_import_errors.py +++ /dev/null @@ -1,77 +0,0 @@ - -from pylint.checkers import BaseChecker -from pylint.interfaces import IAstroidChecker -from astroid import nodes, Const, AssignName - - -class ImportErrors(BaseChecker): - """ - Import errors from new 'conan' module - """ - - __implements__ = IAstroidChecker - - name = "conan-import-errors" - msgs = { - "E9008": ( - "Import errors from new module: `from conan import errors`. Old import is deprecated in Conan v2.", - "conan-import-errors", - "Import errors from new module: `from conan import errors`. Old import is deprecated in Conan v2.", - ), - } - - def visit_importfrom(self, node: nodes.ImportFrom) -> None: - basename = node.modname - if basename == 'conans': - names = [name for name, _ in node.names] - if 'errors' in names: - self.add_message("conan-import-errors", node=node) - - -class ImportErrorsConanException(BaseChecker): - """ - Import errors from new 'conan' module - """ - - __implements__ = IAstroidChecker - - name = "conan-import-error-conanexception" - msgs = { - "E9009": ( - "Import ConanException from new module: `from conan.errors import ConanException`. Old import is deprecated in Conan v2.", - "conan-import-error-conanexception", - "Import ConanException from new module: `from conan.errors import ConanException`. Old import is deprecated in Conan v2.", - ), - } - - def visit_importfrom(self, node: nodes.ImportFrom) -> None: - basename = node.modname - if basename == 'conans.errors': - names = [name for name, _ in node.names] - if 'ConanException' in names: - self.add_message("conan-import-error-conanexception", node=node) - - -class ImportErrorsConanInvalidConfiguration(BaseChecker): - """ - Import errors from new 'conan' module - """ - - __implements__ = IAstroidChecker - - name = "conan-import-error-conaninvalidconfiguration" - msgs = { - "E9010": ( - "Import ConanInvalidConfiguration from new module: `from conan.errors import ConanInvalidConfiguration`. Old import is deprecated in Conan v2.", - "conan-import-error-conaninvalidconfiguration", - "Import ConanInvalidConfiguration from new module: `from conan.errors import ConanInvalidConfiguration`. Old import is deprecated in Conan v2.", - ), - } - - def visit_importfrom(self, node: nodes.ImportFrom) -> None: - basename = node.modname - if basename == 'conans.errors': - names = [name for name, _ in node.names] - if 'ConanInvalidConfiguration' in names: - self.add_message("conan-import-error-conaninvalidconfiguration", node=node) - diff --git a/linter/check_import_tools.py b/linter/check_import_tools.py deleted file mode 100644 index 1621c7b3dfd2a..0000000000000 --- a/linter/check_import_tools.py +++ /dev/null @@ -1,30 +0,0 @@ -import re -from email.mime import base -from pylint.checkers import BaseChecker -from pylint.interfaces import IAstroidChecker -from astroid import nodes, Const, AssignName - - -class ImportTools(BaseChecker): - """ - Import tools following pattern 'from conan.tools.xxxx import yyyyy' - """ - - __implements__ = IAstroidChecker - - name = "conan-import-tools" - msgs = { - "E9011": ( - "Import tools following pattern 'from conan.tools.xxxx import yyyyy' (https://docs.conan.io/en/latest/reference/conanfile/tools.html).", - "conan-import-tools", - "Import tools following pattern 'from conan.tools.xxxx import yyyyy' (https://docs.conan.io/en/latest/reference/conanfile/tools.html).", - ), - } - - def visit_importfrom(self, node: nodes.ImportFrom) -> None: - basename = node.modname - names = [name for name, _ in node.names] - if basename == 'conan' and 'tools' in names: - self.add_message("conan-import-tools", node=node) - elif re.match(r'conan\.tools\.[^.]+\..+', basename): - self.add_message("conan-import-tools", node=node) diff --git a/linter/check_layout_src_folder.py b/linter/check_layout_src_folder.py deleted file mode 100644 index b7d418884ca45..0000000000000 --- a/linter/check_layout_src_folder.py +++ /dev/null @@ -1,44 +0,0 @@ -from pylint.checkers import BaseChecker -from pylint.interfaces import IAstroidChecker -from astroid import nodes - -WHY_SRC_FOLDER = "Setting the `src_folder` for layouts will help keep an organized and clean workspace when developing recipes locally. " \ - "The extra folder will help ensure there are no collisions between the upstream sources and recipe's exports - which " \ - "also extends to what happens in the cache when creating packages" - - -class LayoutSrcFolder(BaseChecker): - """ - Ensure `src_folder=src` when using built-in layouts - """ - - __implements__ = IAstroidChecker - - name = "conan-layout-src-folder" - msgs = { - "E9012": ( - "layout is missing `src_folder` argument which should be to `src`", - "conan-missing-layout-src-folder", - WHY_SRC_FOLDER, - ), - "E9013": ( - "layout should set `src_folder` to `src`", - "conan-layout-src-folder-is-src", - WHY_SRC_FOLDER, - ), - } - - def visit_call(self, node: nodes.Call) -> None: - if not isinstance(node.func, nodes.Name): - return - - if node.func.name in ["cmake_layout", "bazel_layout", "basic_layout"]: - for kw in node.keywords: - if kw.arg == "src_folder": - if not kw.value or kw.value.as_string().strip("\"'") != "src": - self.add_message( - "conan-layout-src-folder-is-src", node=node, line=node.lineno - ) - break - else: - self.add_message("conan-missing-layout-src-folder", node=node, line=node.lineno) diff --git a/linter/check_package_name.py b/linter/check_package_name.py deleted file mode 100644 index 4c302243ff26c..0000000000000 --- a/linter/check_package_name.py +++ /dev/null @@ -1,52 +0,0 @@ -from pylint.checkers import BaseChecker -from pylint.interfaces import IAstroidChecker -from astroid import nodes, Const, AssignName -from pathlib import Path - - -class PackageName(BaseChecker): - """ - All packages must have a lower-case name - """ - - __implements__ = IAstroidChecker - - name = "conan-package-name" - msgs = { - "E9004": ( - "Reference name should be all lowercase", - "conan-bad-name", - "Use only lower-case on the package name: `name = 'foobar'`." - ), - "E9005": ( - "Missing name attribute", - "conan-missing-name", - "The member attribute `name` must be declared: `name = 'foobar'`." - ), - "E9007": ( - "No 'name' attribute in test_package conanfile", - "conan-test-no-name", - "No 'name' attribute in test_package conanfile." - ), - } - - def visit_classdef(self, node: nodes) -> None: - filename = Path(node.root().file) - is_test = filename.match('test_*/*.py') - - if node.basenames == ['ConanFile']: - for attr in node.body: - children = list(attr.get_children()) - if len(children) == 2 and \ - isinstance(children[0], AssignName) and \ - children[0].name == "name" and \ - isinstance(children[1], Const): - if is_test: - self.add_message("conan-test-no-name", node=attr, line=attr.lineno) - return - value = children[1].as_string() - if value.lower() != value: - self.add_message("conan-bad-name", node=attr, line=attr.lineno) - return - if not is_test: - self.add_message("conan-missing-name", node=node) diff --git a/linter/check_version_attribute.py b/linter/check_version_attribute.py deleted file mode 100644 index 66e61f47ef183..0000000000000 --- a/linter/check_version_attribute.py +++ /dev/null @@ -1,33 +0,0 @@ -from pylint.checkers import BaseChecker -from pylint.interfaces import IAstroidChecker -from astroid import nodes, Const, AssignName - - -class VersionAttribute(BaseChecker): - """ - All packages should not enforce a specific version in the recipe - """ - - __implements__ = IAstroidChecker - - name = "conan-attr-version" - msgs = { - "E9014": ( - "Recipe should not contain version attribute", - "conan-forced-version", - "Do not enforce a specific version in your recipe. Keep it generic for any version." - ), - } - - def visit_classdef(self, node: nodes) -> None: - if node.basenames == ['ConanFile']: - for attr in node.body: - children = list(attr.get_children()) - if len(children) == 2 and \ - isinstance(children[0], AssignName) and \ - children[0].name == "version" and \ - isinstance(children[1], Const): - value = children[1].as_string().replace('"', "").replace("'", "") - if value and value != "system": - self.add_message("conan-forced-version", node=attr, line=attr.lineno) - return diff --git a/linter/conandata_yaml_linter.py b/linter/conandata_yaml_linter.py deleted file mode 100644 index 51d27b850beec..0000000000000 --- a/linter/conandata_yaml_linter.py +++ /dev/null @@ -1,114 +0,0 @@ -import argparse -from strictyaml import ( - load, - Map, - Str, - YAMLValidationError, - MapPattern, - Optional, - Seq, - Enum, - Any, -) -from yaml_linting import file_path - - -CONANDATA_YAML_URL = "https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md" - - -def main(): - parser = argparse.ArgumentParser( - description="Validate Conan's 'conandata.yaml' file to ConanCenterIndex's requirements." - ) - parser.add_argument( - "path", - nargs="?", - type=file_path, - help="file to validate.", - ) - args = parser.parse_args() - - patch_fields = Map( - { - "patch_file": Str(), - "patch_description": Str(), - "patch_type": Enum( - ["official", "conan", "portability", "bugfix", "vulnerability"] - ), - Optional("patch_source"): Str(), - # No longer required for v2 recipes with layouts - Optional("base_path"): Str(), - } - ) - schema = Map( - { - "sources": MapPattern(Str(), Any(), minimum_keys=1), - Optional("patches"): MapPattern(Str(), Seq(Any()), minimum_keys=1), - } - ) - - with open(args.path, encoding="utf-8") as f: - content = f.read() - - try: - parsed = load(content, schema) - except YAMLValidationError as error: - pretty_print_yaml_validate_error(args, error) # Error when "source" is missing or when "patches" has no versions - return - except BaseException as error: - pretty_print_yaml_validate_error(args, error) # YAML could not be parsed - return - - if "patches" in parsed: - for version in parsed["patches"]: - patches = parsed["patches"][version] - if version not in parsed["sources"]: - print( - f"::warning file={args.path},line={patches.start_line},endline={patches.end_line}," - f"title=conandata.yml inconsistency" - f"::Patch(es) are listed for version `{version}`, but there is source for this version." - f" You should either remove `{version}` from the `patches` section, or add it to the" - f" `sources` section" - ) - for i, patch in enumerate(patches): - # Individual report errors for each patch object - try: - parsed["patches"][version][i].revalidate(patch_fields) - except YAMLValidationError as error: - pretty_print_yaml_validate_warning(args, error) # Warning when patch fields are not followed - continue - - # Make sure `patch_source` exists where it's encouraged - type = parsed["patches"][version][i]["patch_type"] - if ( - type in ["official", "bugfix", "vulnerability"] - and not "patch_source" in patch - ): - print( - f"::warning file={args.path},line={type.start_line},endline={type.end_line}," - f"title=conandata.yml schema warning" - f"::'patch_type' should have 'patch_source' as per {CONANDATA_YAML_URL}#patch_type" - " it is expected to have a source (e.g. a URL) to where it originates from to help with" - " reviewing and consumers to evaluate patches" - ) - - -def pretty_print_yaml_validate_error(args, error): - snippet = error.context_mark.get_snippet().replace("\n", "%0A") - print( - f"::error file={args.path},line={error.context_mark.line},endline={error.problem_mark.line+1}," - f"title=conandata.yml schema error" - f"::Schema outlined in {CONANDATA_YAML_URL}#patches-fields is not followed.%0A%0A{error.problem} in %0A{snippet}%0A" - ) - -def pretty_print_yaml_validate_warning(args, error): - snippet = error.context_mark.get_snippet().replace("\n", "%0A") - print( - f"::warning file={args.path},line={error.context_mark.line},endline={error.problem_mark.line+1}," - f"title=conandata.yml schema warning" - f"::Schema outlined in {CONANDATA_YAML_URL}#patches-fields is not followed.%0A%0A{error.problem} in %0A{snippet}%0A" - ) - - -if __name__ == "__main__": - main() diff --git a/linter/conanv2_transition.py b/linter/conanv2_transition.py deleted file mode 100644 index e330ff1d44590..0000000000000 --- a/linter/conanv2_transition.py +++ /dev/null @@ -1,24 +0,0 @@ -""" - -Pylint plugin/rules for conanfiles in Conan Center Index - -""" - -from pylint.lint import PyLinter -from linter.check_package_name import PackageName -from linter.check_import_conanfile import ImportConanFile -from linter.check_import_errors import ImportErrorsConanException, ImportErrorsConanInvalidConfiguration, ImportErrors -from linter.check_import_tools import ImportTools -from linter.check_layout_src_folder import LayoutSrcFolder -from linter.check_version_attribute import VersionAttribute - - -def register(linter: PyLinter) -> None: - linter.register_checker(PackageName(linter)) - linter.register_checker(ImportConanFile(linter)) - linter.register_checker(ImportErrors(linter)) - linter.register_checker(ImportErrorsConanException(linter)) - linter.register_checker(ImportErrorsConanInvalidConfiguration(linter)) - linter.register_checker(ImportTools(linter)) - linter.register_checker(LayoutSrcFolder(linter)) - linter.register_checker(VersionAttribute(linter)) diff --git a/linter/config_yaml_linter.py b/linter/config_yaml_linter.py deleted file mode 100644 index 29807e6ce3b99..0000000000000 --- a/linter/config_yaml_linter.py +++ /dev/null @@ -1,37 +0,0 @@ -import argparse -from strictyaml import load, Map, Str, YAMLValidationError, MapPattern -from yaml_linting import file_path - - -def main(): - parser = argparse.ArgumentParser( - description="Validate ConanCenterIndex's 'config.yaml' file." - ) - parser.add_argument( - "path", - nargs="?", - type=file_path, - help="file to validate.", - ) - args = parser.parse_args() - - schema = Map( - {"versions": MapPattern(Str(), Map({"folder": Str()}), minimum_keys=1)} - ) - - with open(args.path) as f: - content = f.read() - - try: - load(content, schema) - except YAMLValidationError as error: - e = error.__str__().replace("\n", "%0A") - print( - f"::error file={args.path},line={error.context_mark.line},endline={error.problem_mark.line}," - f"title=config.yml schema error" - f"::{e}\n" - ) - - -if __name__ == "__main__": - main() diff --git a/linter/pylintrc_recipe b/linter/pylintrc_recipe deleted file mode 100644 index 5b4db4ad401f0..0000000000000 --- a/linter/pylintrc_recipe +++ /dev/null @@ -1,30 +0,0 @@ -[MASTER] -load-plugins=linter.conanv2_transition, - linter.transform_conanfile, - linter.transform_imports - -py-version=3.6 -recursive=no -suggestion-mode=yes -unsafe-load-any-extension=no - -[MESSAGES CONTROL] -disable=fixme, - line-too-long, - missing-module-docstring, - missing-function-docstring, - missing-class-docstring, - invalid-name, - wrong-import-order, # TODO: Remove - import-outside-toplevel # TODO: Remove - -enable=conan-bad-name, - conan-missing-name, - conan-import-conanfile, - conan-forced-version - -[REPORTS] -evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error) / statement) * 10)) -output-format=text -reports=no -score=no diff --git a/linter/pylintrc_testpackage b/linter/pylintrc_testpackage deleted file mode 100644 index c5cf96e8cadf7..0000000000000 --- a/linter/pylintrc_testpackage +++ /dev/null @@ -1,32 +0,0 @@ -[MASTER] -load-plugins=linter.conanv2_transition, - linter.transform_conanfile, - linter.transform_imports - -py-version=3.6 -recursive=no -suggestion-mode=yes -unsafe-load-any-extension=no - -[MESSAGES CONTROL] -disable=fixme, - line-too-long, - missing-module-docstring, - missing-function-docstring, - missing-class-docstring, - invalid-name, - wrong-import-order, # TODO: Remove - import-outside-toplevel, # TODO: Remove - - # Not relevant to test package - conan-missing-layout-src-folder, - conan-layout-src-folder-is-src - -enable=conan-test-no-name, - conan-import-conanfile - -[REPORTS] -evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error) / statement) * 10)) -output-format=text -reports=no -score=no diff --git a/linter/recipe_linter.json b/linter/recipe_linter.json deleted file mode 100644 index 0b9ff4566b051..0000000000000 --- a/linter/recipe_linter.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "recipe_linter_fatals", - "severity": "error", - "pattern": [ - { - "regexp": "(\\S+):(\\d+): \\[(F\\d+\\(\\S+\\)),\\s(.+?)?\\](.+)", - "file": 1, - "line": 2, - "message": 5, - "code": 3 - } - ] - }, - { - "owner": "recipe_linter_errors", - "severity": "error", - "pattern": [ - { - "regexp": "(\\S+):(\\d+): \\[(E\\d+\\(\\S+\\)),\\s(.+?)?\\](.+)", - "file": 1, - "line": 2, - "message": 5, - "code": 3 - } - ] - }, - { - "owner": "recipe_linter_warnings", - "severity": "warning", - "pattern": [ - { - "regexp": "(\\S+):(\\d+): \\[(W\\d+\\(\\S+\\)),\\s(.+?)?\\](.+)", - "file": 1, - "line": 2, - "message": 5, - "code": 3 - } - ] - } - ] -} diff --git a/linter/transform_conanfile.py b/linter/transform_conanfile.py deleted file mode 100644 index 8e33d368643b1..0000000000000 --- a/linter/transform_conanfile.py +++ /dev/null @@ -1,74 +0,0 @@ - -# Class ConanFile doesn't declare all the valid members and functions, -# some are injected by Conan dynamically to the class. - -import textwrap -import astroid -from astroid.builder import AstroidBuilder -from astroid.manager import AstroidManager - - -def _settings_transform(): - module = AstroidBuilder(AstroidManager()).string_build( - textwrap.dedent(""" - class Settings(object): - os = None - arch = None - compiler = None - build_type = None - """) - ) - return module['Settings'] - -def _user_info_build_transform(): - module = AstroidBuilder(AstroidManager()).string_build( - textwrap.dedent(""" - class UserInfoBuild(defaultdict): - pass - """) - ) - return module['UserInfoBuild'] - - -def register(_): - pass - -def transform_conanfile(node): - """Transform definition of ConanFile class so dynamic fields are visible to pylint""" - - str_class = astroid.builtin_lookup("str") - dict_class = astroid.builtin_lookup("dict") - info_class = astroid.MANAGER.ast_from_module_name("conans.model.info").lookup( - "ConanInfo") - build_requires_class = astroid.MANAGER.ast_from_module_name( - "conans.client.graph.graph_manager").lookup("_RecipeBuildRequires") - file_copier_class = astroid.MANAGER.ast_from_module_name( - "conans.client.file_copier").lookup("FileCopier") - file_importer_class = astroid.MANAGER.ast_from_module_name( - "conans.client.importer").lookup("_FileImporter") - python_requires_class = astroid.MANAGER.ast_from_module_name( - "conans.client.graph.python_requires").lookup("PyRequires") - - dynamic_fields = { - "conan_data": str_class, - "build_requires": build_requires_class, - "tool_requires": build_requires_class, - "info_build": info_class, - "user_info_build": [_user_info_build_transform()], - "info": info_class, - "copy": file_copier_class, - "copy_deps": file_importer_class, - "python_requires": [str_class, python_requires_class], - "recipe_folder": str_class, - "settings_build": [_settings_transform()], - "settings_target": [_settings_transform()], - "conf": dict_class, - } - - for f, t in dynamic_fields.items(): - node.locals[f] = [i for i in t] - - -astroid.MANAGER.register_transform( - astroid.ClassDef, transform_conanfile, - lambda node: node.qname() == "conans.model.conan_file.ConanFile") diff --git a/linter/transform_imports.py b/linter/transform_imports.py deleted file mode 100644 index 78b72e4b16880..0000000000000 --- a/linter/transform_imports.py +++ /dev/null @@ -1,46 +0,0 @@ - -import astroid -from pylint.lint import PyLinter - -""" -Here we are transforming the imports to mimic future Conan v2 release. With -these changes, built-in checks in Pylint will raise with different errors, so -we are modifying the messages to point users in the right direction. -""" - - -def register(linter: PyLinter): - msge1101 = linter.msgs_store._messages_definitions["E1101"] - msge1101.msg += ". Please, check https://github.com/conan-io/conan-center-index/blob/master/docs/v2_linter.md" - linter.msgs_store.register_message(msge1101) - - msge0611 = linter.msgs_store._messages_definitions["E0611"] - msge0611.msg += ". Please, check https://github.com/conan-io/conan-center-index/blob/master/docs/v2_linter.md" - linter.msgs_store.register_message(msge0611) - -def transform_tools(module): - """ Transform import module """ - if 'get' in module.locals: - del module.locals['get'] - if 'cross_building' in module.locals: - del module.locals['cross_building'] - if 'rmdir' in module.locals: - del module.locals['rmdir'] - if 'Version' in module.locals: - del module.locals['Version'] - -def transform_errors(module): - pass - #if 'ConanInvalidConfiguration' in module.locals: - # del module.locals['ConanInvalidConfiguration'] - #if 'ConanException' in module.locals: - # del module.locals['ConanException'] - - -astroid.MANAGER.register_transform( - astroid.Module, transform_tools, - lambda node: node.qname() == "conans.tools") - -astroid.MANAGER.register_transform( - astroid.Module, transform_errors, - lambda node: node.qname() == "conans.errors") diff --git a/linter/yaml_linting.py b/linter/yaml_linting.py deleted file mode 100644 index 8b61d99ba39f9..0000000000000 --- a/linter/yaml_linting.py +++ /dev/null @@ -1,9 +0,0 @@ -import argparse - - -def file_path(a_string): - from os.path import isfile - - if not isfile(a_string): - raise argparse.ArgumentTypeError(f"{a_string} does not point to a file") - return a_string diff --git a/linter/yamllint_matcher.json b/linter/yamllint_matcher.json deleted file mode 100644 index 42a3ef93b5956..0000000000000 --- a/linter/yamllint_matcher.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "yamllint_matcher", - "pattern": [ - { - "regexp": "^(.*\\.ya?ml)$", - "file": 1 - }, - { - "regexp": "^\\s{2}(\\d+):(\\d+)\\s+(error|warning)\\s+(.*?)\\s+\\((.*)\\)$", - "line": 1, - "column": 2, - "severity": 3, - "message": 4, - "code": 5, - "loop": true - } - ] - } - ] -} diff --git a/linter/yamllint_rules.yml b/linter/yamllint_rules.yml deleted file mode 100644 index 7c0ce102ddc36..0000000000000 --- a/linter/yamllint_rules.yml +++ /dev/null @@ -1,26 +0,0 @@ -extends: default -rules: - document-start: - level: error - present: false - document-end: - level: error - present: false - empty-values: - forbid-in-block-mappings: true - forbid-in-flow-mappings: true - line-length: disable - indentation: - level: error - new-line-at-end-of-file: - level: error - trailing-spaces: - level: error - comments: - level: error - comments-indentation: - level: error - new-lines: - type: unix - key-duplicates: - level: error diff --git a/recipes/7bitconf/all/conandata.yml b/recipes/7bitconf/all/conandata.yml index 71f022ca93c84..4ddfe60caee6d 100644 --- a/recipes/7bitconf/all/conandata.yml +++ b/recipes/7bitconf/all/conandata.yml @@ -1,7 +1,15 @@ sources: + "1.2.0": + url: "https://github.com/7bitCoder/7bitConf/archive/refs/tags/v1.2.0.tar.gz" + sha256: "c2cc19618dc6616e463dbd7cc72da1fdd5b6df1b4f5d4bf8317455658ac63f0e" "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" +patches: + "1.2.0": + - patch_file: "patches/1.2.0-0001-fix-package-name.patch" + patch_description: "fix taocpp-json's package name" + patch_type: "conan" diff --git a/recipes/7bitconf/all/conanfile.py b/recipes/7bitconf/all/conanfile.py index 4865b328bad13..af6c2dd2e898f 100644 --- a/recipes/7bitconf/all/conanfile.py +++ b/recipes/7bitconf/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 +from conan.tools.files import get, copy, rmdir, apply_conandata_patches, copy, export_conandata_patches from conan.tools.scm import Version import os @@ -43,6 +43,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": self.options.rm_safe("fPIC") @@ -80,6 +83,7 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + apply_conandata_patches(self) if not self.options.header_only: tc = CMakeToolchain(self) tc.variables["_7BIT_CONF_BUILD_EXAMPLES"] = False diff --git a/recipes/7bitconf/all/patches/1.2.0-0001-fix-package-name.patch b/recipes/7bitconf/all/patches/1.2.0-0001-fix-package-name.patch new file mode 100644 index 0000000000000..1d71939004139 --- /dev/null +++ b/recipes/7bitconf/all/patches/1.2.0-0001-fix-package-name.patch @@ -0,0 +1,16 @@ +diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt +index 6cdab6c..04c9c4f 100644 +--- a/Source/CMakeLists.txt ++++ b/Source/CMakeLists.txt +@@ -27,9 +27,9 @@ elseif (_7BIT_CONF_HEADER_ONLY_LIB) + endif () + + if (_7BIT_CONF_HEADER_ONLY_LIB) +- target_link_libraries(7bitConf INTERFACE taocpp-json) ++ target_link_libraries(7bitConf INTERFACE taocpp::json) + else () +- target_link_libraries(7bitConf taocpp-json) ++ target_link_libraries(7bitConf taocpp::json) + endif () + + add_library(7bitConf::7bitConf ALIAS 7bitConf) diff --git a/recipes/7bitconf/config.yml b/recipes/7bitconf/config.yml index 73c245662b08d..03495144e3920 100644 --- a/recipes/7bitconf/config.yml +++ b/recipes/7bitconf/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "1.0.0": diff --git a/recipes/7bitdi/all/conandata.yml b/recipes/7bitdi/all/conandata.yml index 2bc8fbc5ed01d..ad96c33d43330 100644 --- a/recipes/7bitdi/all/conandata.yml +++ b/recipes/7bitdi/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "3.4.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.4.0.tar.gz" + sha256: "8381102f5966a5d83cf590b8fa45904d055d74ec90822628240786ab100fb929" + "3.3.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.3.0.tar.gz" + sha256: "b9ddb2fc263c79cb414544e97d44dcc8cd1e1a91b38129d96b7051728a4583b9" + "3.2.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.2.0.tar.gz" + sha256: "4549b651a28b309a31cb3b879b7f31069cbca041cfb9ffad82ccc26f78b8e5e0" + "3.1.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.1.0.tar.gz" + sha256: "345bf91e2a33cfe98628cac98c75488ddd55232b8c4bcfeba9b5001fec8d4f7c" + "3.0.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.0.0.tar.gz" + sha256: "aabb8e907c0cafb8e4b7c8367ed5dbb3cba2d83af090bdef9a7f855c0778c8f3" + "2.1.0": + url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v2.1.0.tar.gz" + sha256: "54edceb4f90bf652126310ca0b78150d05a02d7081cef3c9ccaba5f4dd112935" + "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/all/conanfile.py b/recipes/7bitdi/all/conanfile.py index 3bdbdc03629c3..6709e44476413 100644 --- a/recipes/7bitdi/all/conanfile.py +++ b/recipes/7bitdi/all/conanfile.py @@ -1,21 +1,20 @@ 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.cmake import CMake, CMakeToolchain, 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 SevenBitDIConan(ConanFile): name = "7bitdi" + description = "a simple C++ dependency injection library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/7bitcoder/7bitDI" - description = "7bitDI is a simple C++ dependency injection library." topics = ("cpp17", "dependency-injector", "injector", "header-only") - url = "https://github.com/conan-io/conan-center-index" - license = "MIT" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -29,6 +28,10 @@ class SevenBitDIConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 17 + @property def _minimum_compilers_version(self): return { @@ -61,12 +64,11 @@ def validate(self): compiler_name = str(compiler) if compiler.get_safe("cppstd"): - check_min_cppstd(self, 17) - + 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." + f"{self.ref} requires compiler {compiler_name} minimum version: {minimum_version} with C++{self._min_cppstd} support." ) def source(self): diff --git a/recipes/7bitdi/all/test_v1_package/CMakeLists.txt b/recipes/7bitdi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/7bitdi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/7bitdi/all/test_v1_package/conanfile.py b/recipes/7bitdi/all/test_v1_package/conanfile.py deleted file mode 100644 index 0f735b51a2642..0000000000000 --- a/recipes/7bitdi/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -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 tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/7bitdi/config.yml b/recipes/7bitdi/config.yml index 40341aa3db6cd..3fbfbf1ec3bc5 100644 --- a/recipes/7bitdi/config.yml +++ b/recipes/7bitdi/config.yml @@ -1,3 +1,17 @@ versions: + "3.4.0": + folder: all + "3.3.0": + folder: all + "3.2.0": + folder: all + "3.1.0": + folder: all + "3.0.0": + folder: all + "2.1.0": + folder: all + "2.0.0": + folder: all "1.0.0": folder: all diff --git a/recipes/7zip/19.00/conanfile.py b/recipes/7zip/19.00/conanfile.py deleted file mode 100644 index b1fa099b52650..0000000000000 --- a/recipes/7zip/19.00/conanfile.py +++ /dev/null @@ -1,121 +0,0 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -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.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-or-later", "BSD-3-Clause", "Unrar") - homepage = "https://www.7-zip.org" - topics = ("archive", "compression", "decompression", "zip") - package_type = "application" - settings = "os", "arch", "compiler", "build_type" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def validate(self): - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("Only Windows supported") - 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): - if Version(self.version) < "22": - self.build_requires("lzma_sdk/9.20") - - 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 source(self): - 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): - return { - "x86_64": "x64", - "x86": "x86", - }[str(self.settings.arch)] - - def _build_msvc(self): - 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 = 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 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 is_msvc(self): - self._build_msvc() - else: - self._build_autotools() - - def package(self): - 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": - 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_v1_package/conanfile.py b/recipes/7zip/19.00/test_v1_package/conanfile.py deleted file mode 100644 index e5371836902a7..0000000000000 --- a/recipes/7zip/19.00/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -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/19.00/conandata.yml b/recipes/7zip/all/conandata.yml similarity index 100% rename from recipes/7zip/19.00/conandata.yml rename to recipes/7zip/all/conandata.yml diff --git a/recipes/7zip/all/conanfile.py b/recipes/7zip/all/conanfile.py new file mode 100644 index 0000000000000..91093cc791c52 --- /dev/null +++ b/recipes/7zip/all/conanfile.py @@ -0,0 +1,123 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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.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-or-later", "BSD-3-Clause", "Unrar") + homepage = "https://www.7-zip.org" + topics = ("archive", "compression", "decompression", "zip") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def validate(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("Only Windows supported") + 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): + if Version(self.version) < "22": + self.build_requires("lzma_sdk/9.20") + + 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 source(self): + 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) + env = None + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + env = tc.environment() + env.define("IS_MINGW", "1") + tc.generate(env=env) + deps = AutotoolsDeps(self) + deps.generate() + + @property + def _msvc_platform(self): + return { + "x86_64": "x64", + "x86": "x86", + }[str(self.settings.arch)] + + def _build_msvc(self): + 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 = 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 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 is_msvc(self): + self._build_msvc() + else: + self._build_autotools() + + def package(self): + 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": + 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/all/test_package/conanfile.py similarity index 100% rename from recipes/7zip/19.00/test_package/conanfile.py rename to recipes/7zip/all/test_package/conanfile.py diff --git a/recipes/7zip/config.yml b/recipes/7zip/config.yml index 5f2a8f313a5d8..9e03b0cc48e12 100644 --- a/recipes/7zip/config.yml +++ b/recipes/7zip/config.yml @@ -1,7 +1,7 @@ versions: "23.01": - folder: "19.00" + folder: "all" "22.01": - folder: "19.00" + folder: "all" "19.00": - folder: "19.00" + folder: "all" diff --git a/recipes/aaf/all/conanfile.py b/recipes/aaf/all/conanfile.py index ee7906ff05936..b5c885b3792f5 100644 --- a/recipes/aaf/all/conanfile.py +++ b/recipes/aaf/all/conanfile.py @@ -35,7 +35,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("libjpeg/9e") if self.settings.os in ("FreeBSD", "Linux"): self.requires("util-linux-libuuid/2.39") @@ -60,6 +60,7 @@ def generate(self): tc.cache_variables["AAF_NO_STRUCTURED_STORAGE"] = not self.options.structured_storage jpeg_res_dirs = ";".join([p.replace("\\", "/") for p in self.dependencies["libjpeg"].cpp_info.aggregated_components().resdirs]) tc.variables["JPEG_RES_DIRS"] = jpeg_res_dirs + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/aaf/all/test_package/CMakeLists.txt b/recipes/aaf/all/test_package/CMakeLists.txt index 6b1e5d9915990..63a4f558ac58d 100644 --- a/recipes/aaf/all/test_package/CMakeLists.txt +++ b/recipes/aaf/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(aaf REQUIRED CONFIG) diff --git a/recipes/aaf/all/test_v1_package/CMakeLists.txt b/recipes/aaf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aaf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aaf/all/test_v1_package/conanfile.py b/recipes/aaf/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/aaf/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_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/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/all/test_package/CMakeLists.txt b/recipes/aaplus/all/test_package/CMakeLists.txt index 709ce7a5f945a..d9e5de6425942 100644 --- a/recipes/aaplus/all/test_package/CMakeLists.txt +++ b/recipes/aaplus/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(aaplus REQUIRED CONFIG) diff --git a/recipes/aaplus/all/test_v1_package/CMakeLists.txt b/recipes/aaplus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aaplus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aaplus/all/test_v1_package/conanfile.py b/recipes/aaplus/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/aaplus/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_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/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 1f04efd630a51..4e89ef1db5eec 100644 --- a/recipes/abseil/all/conandata.yml +++ b/recipes/abseil/all/conandata.yml @@ -1,63 +1,90 @@ sources: + "20250127.0": + url: "https://github.com/abseil/abseil-cpp/archive/20250127.0.tar.gz" + sha256: "16242f394245627e508ec6bb296b433c90f8d914f73b9c026fddb905e27276e8" + "20240722.1": + url: "https://github.com/abseil/abseil-cpp/archive/20240722.1.tar.gz" + sha256: "40cee67604060a7c8794d931538cb55f4d444073e556980c88b6c49bb9b19bb7" + "20240722.0": + url: "https://github.com/abseil/abseil-cpp/archive/20240722.0.tar.gz" + sha256: "f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3" + "20240116.2": + url: "https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz" + sha256: "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc" + "20240116.1": + url: "https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz" + sha256: "3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a" "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" - "20230125.2": - url: "https://github.com/abseil/abseil-cpp/archive/20230125.2.tar.gz" - sha256: "9a2b5752d7bfade0bdeee2701de17c9480620f8b237e1964c1b9967c75374906" - "20230125.1": - url: "https://github.com/abseil/abseil-cpp/archive/20230125.1.tar.gz" - sha256: "81311c17599b3712069ded20cca09a62ab0bf2a89dfa16993786c8782b7ed145" - "20230125.0": - url: "https://github.com/abseil/abseil-cpp/archive/20230125.0.tar.gz" - sha256: "3ea49a7d97421b88a8c48a0de16c16048e17725c7ec0f1d3ea2683a2a75adc21" "20220623.1": url: "https://github.com/abseil/abseil-cpp/archive/20220623.1.tar.gz" sha256: "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8" - "20220623.0": - url: "https://github.com/abseil/abseil-cpp/archive/20220623.0.tar.gz" - sha256: "4208129b49006089ba1d6710845a45e31c59b0ab6bff9e5788a87f55c5abd602" "20211102.0": url: "https://github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz" sha256: "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4" patches: - "20230802.1": - - patch_file: "patches/0003-absl-string-libm-20230802.patch" + "20240722.1": + - patch_file: "patches/0003-absl-string-libm-20240116.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" + "20240722.0": + - patch_file: "patches/0003-absl-string-libm-20240116.patch" patch_description: "link libm to absl string" patch_type: "portability" - "20230125.2": - - patch_file: "patches/0003-absl-string-libm.patch" + patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" + "20240116.2": + - patch_file: "patches/0003-absl-string-libm-20240116.patch" patch_description: "link libm to absl string" patch_type: "portability" - "20230125.1": - - patch_file: "patches/0003-absl-string-libm.patch" + patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" + - patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch" + patch_description: "Fix GCC 7 including in C++17 mode when it is not available (until GCC 8)" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303" + - patch_file: "patches/0004-test-allocator-testonly.patch" + patch_description: "Do not build test_allocator target when tests are disabled" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5" + - patch_file: "patches/0006-backport-arm-compilation-fix.patch" + patch_source: "https://github.com/abseil/abseil-cpp/pull/1710" + "20240116.1": + - patch_file: "patches/0003-absl-string-libm-20240116.patch" patch_description: "link libm to absl string" patch_type: "portability" - "20230125.0": - - patch_file: "patches/0003-absl-string-libm.patch" + patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" + - patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch" + patch_description: "Fix GCC 7 including in C++17 mode when it is not available (until GCC 8)" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303" + - patch_file: "patches/0004-test-allocator-testonly.patch" + patch_description: "Do not build test_allocator target when tests are disabled" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5" + - patch_file: "patches/0006-backport-arm-compilation-fix.patch" + patch_source: "https://github.com/abseil/abseil-cpp/pull/1710" + "20230802.1": + - patch_file: "patches/0003-absl-string-libm-20230802.patch" patch_description: "link libm to absl string" patch_type: "portability" - "20220623.1": + 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" + - patch_file: "patches/0006-backport-arm-compilation-fix.patch" + patch_source: "https://github.com/abseil/abseil-cpp/pull/1710" + "20230125.3": - patch_file: "patches/0003-absl-string-libm.patch" patch_description: "link libm to absl string" patch_type: "portability" - - patch_file: "patches/0005-has-unique-object-representations.patch" - patch_description: "Workaround bug in GCC 7.2" - patch_source: "https://github.com/abseil/abseil-cpp/pull/1250" - patch_type: "portability" - "20220623.0": + - patch_file: "patches/0006-backport-arm-compilation-fix.patch" + patch_source: "https://github.com/abseil/abseil-cpp/pull/1710" + "20220623.1": - patch_file: "patches/0003-absl-string-libm.patch" patch_description: "link libm to absl string" patch_type: "portability" @@ -65,6 +92,8 @@ patches: patch_description: "Workaround bug in GCC 7.2" patch_source: "https://github.com/abseil/abseil-cpp/pull/1250" patch_type: "portability" + - patch_file: "patches/0006-backport-arm-compilation-fix.patch" + patch_source: "https://github.com/abseil/abseil-cpp/pull/1710" "20211102.0": - patch_file: "patches/0003-absl-string-libm.patch" patch_description: "link libm to absl string" diff --git a/recipes/abseil/all/conanfile.py b/recipes/abseil/all/conanfile.py index b7ffcdd9c1625..928463daaaebf 100644 --- a/recipes/abseil/all/conanfile.py +++ b/recipes/abseil/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import check_min_cppstd, cross_building from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, load, replace_in_file, rmdir, save -from conan.tools.microsoft import is_msvc +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import json import os @@ -70,9 +70,14 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if self.options.shared and is_msvc(self): + if self.options.shared and is_msvc(self) and Version(self.version) < "20230802.1": # upstream tries its best to export symbols, but it's broken for the moment - raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio (yet)") + raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio, please use version 20230802.1 or newer") + + def build_requirements(self): + # https://github.com/abseil/abseil-cpp/blob/20240722.0/CMakeLists.txt#L19 + if Version(self.version) >= "20240722.0": + self.tool_requires("cmake/[>=3.16 <4]") def layout(self): cmake_layout(self, src_folder="src") @@ -90,6 +95,7 @@ def generate(self): if is_msvc(self): # see https://github.com/abseil/abseil-cpp/issues/649 tc.preprocessor_definitions["_HAS_DEPRECATED_RESULT_OF"] = 1 + tc.cache_variables["ABSL_MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.generate() def _patch_sources(self): @@ -98,7 +104,7 @@ def _patch_sources(self): # In case of cross-build, set CMAKE_SYSTEM_PROCESSOR if not set by toolchain or user if cross_building(self): toolchain_file = os.path.join(self.generators_folder, "conan_toolchain.cmake") - cmake_system_processor_block = textwrap.dedent("""\ + cmake_system_processor_block = textwrap.dedent(""" if(NOT CMAKE_SYSTEM_PROCESSOR) set(CMAKE_SYSTEM_PROCESSOR {}) endif() @@ -161,7 +167,7 @@ def _load_components_from_cmake_target_file(self, absl_target_file_path): if cmake_function_name == "add_library": cmake_imported_target_type = cmake_function_args[1] if cmake_imported_target_type in ["STATIC", "SHARED"]: - components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else [] + components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else ['abseil_dll'] elif cmake_function_name == "set_target_properties": target_properties = re.findall(r"(?PINTERFACE_COMPILE_DEFINITIONS|INTERFACE_INCLUDE_DIRECTORIES|INTERFACE_LINK_LIBRARIES)[\n|\s]+(?P.+)", cmake_function_args[2]) for target_property in target_properties: @@ -232,11 +238,6 @@ def package_info(self): self.cpp_info.components[pkgconfig_name].system_libs = values.get("system_libs", []) self.cpp_info.components[pkgconfig_name].frameworks = values.get("frameworks", []) self.cpp_info.components[pkgconfig_name].requires = values.get("requires", []) - if is_msvc(self) and self.settings.compiler.get_safe("cppstd") == "20": - self.cpp_info.components[pkgconfig_name].defines.extend([ - "_HAS_DEPRECATED_RESULT_OF", - "_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING", - ]) self.cpp_info.components[pkgconfig_name].names["cmake_find_package"] = cmake_target self.cpp_info.components[pkgconfig_name].names["cmake_find_package_multi"] = cmake_target diff --git a/recipes/abseil/all/patches/0003-absl-string-libm-20240116.patch b/recipes/abseil/all/patches/0003-absl-string-libm-20240116.patch new file mode 100644 index 0000000000000..640ce8d7b642d --- /dev/null +++ b/recipes/abseil/all/patches/0003-absl-string-libm-20240116.patch @@ -0,0 +1,15 @@ +--- a/absl/strings/CMakeLists.txt ++++ b/absl/strings/CMakeLists.txt +@@ -32,9 +32,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-test-allocator-testonly.patch b/recipes/abseil/all/patches/0004-test-allocator-testonly.patch new file mode 100644 index 0000000000000..909c1f791c488 --- /dev/null +++ b/recipes/abseil/all/patches/0004-test-allocator-testonly.patch @@ -0,0 +1,10 @@ +--- a/absl/container/CMakeLists.txt ++++ b/absl/container/CMakeLists.txt +@@ -213,6 +213,7 @@ absl_cc_library( + DEPS + absl::config + GTest::gmock ++ TESTONLY + ) + + absl_cc_test( diff --git a/recipes/abseil/all/patches/0006-backport-arm-compilation-fix.patch b/recipes/abseil/all/patches/0006-backport-arm-compilation-fix.patch new file mode 100644 index 0000000000000..9d339c45582c4 --- /dev/null +++ b/recipes/abseil/all/patches/0006-backport-arm-compilation-fix.patch @@ -0,0 +1,13 @@ +diff --git a/absl/copts/AbseilConfigureCopts.cmake b/absl/copts/AbseilConfigureCopts.cmake +index 73435e9..f95ea36 100644 +--- a/absl/copts/AbseilConfigureCopts.cmake ++++ b/absl/copts/AbseilConfigureCopts.cmake +@@ -42,7 +42,7 @@ if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES [[Clang]]) + string(TOUPPER "${_arch}" _arch_uppercase) + string(REPLACE "X86_64" "X64" _arch_uppercase ${_arch_uppercase}) + foreach(_flag IN LISTS ABSL_RANDOM_HWAES_${_arch_uppercase}_FLAGS) +- list(APPEND ABSL_RANDOM_RANDEN_COPTS "-Xarch_${_arch}" "${_flag}") ++ list(APPEND ABSL_RANDOM_RANDEN_COPTS "SHELL:-Xarch_${_arch} ${_flag}") + endforeach() + endforeach() + # If a compiler happens to deal with an argument for a currently unused diff --git a/recipes/abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch b/recipes/abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch new file mode 100644 index 0000000000000..f29ce6195fad0 --- /dev/null +++ b/recipes/abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch @@ -0,0 +1,53 @@ +From bb83aceacb554e79e7cd2404856f0be30bd00303 Mon Sep 17 00:00:00 2001 +From: Derek Mauro +Date: Tue, 12 Mar 2024 08:33:40 -0700 +Subject: [PATCH] Fix GCC7 C++17 build + +GCC did not support until GCC8. + +Fixes #1635 + +PiperOrigin-RevId: 615051227 +Change-Id: If7cd5802ead40805b1ff1c3bdfc10ba6d2858ef0 +--- + absl/hash/hash_test.cc | 2 +- + absl/hash/internal/hash.h | 12 ++++++++++-- + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h +index f4a94f9129f..b7d89b01807 100644 +--- a/absl/hash/internal/hash.h ++++ b/absl/hash/internal/hash.h +@@ -24,6 +24,15 @@ + #include + #endif + ++#include "absl/base/config.h" ++ ++// For feature testing and determining which headers can be included. ++#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L ++#include ++#else ++#include ++#endif ++ + #include + #include + #include +@@ -47,7 +56,6 @@ + #include + #include + +-#include "absl/base/config.h" + #include "absl/base/internal/unaligned_access.h" + #include "absl/base/port.h" + #include "absl/container/fixed_array.h" +@@ -61,7 +69,7 @@ + #include "absl/types/variant.h" + #include "absl/utility/utility.h" + +-#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L && \ ++#if defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L && \ + !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) + #include // NOLINT + #endif diff --git a/recipes/abseil/config.yml b/recipes/abseil/config.yml index a5bf2303085d1..88dde1f20ef60 100644 --- a/recipes/abseil/config.yml +++ b/recipes/abseil/config.yml @@ -1,17 +1,19 @@ versions: - "20230802.1": + "20250127.0": folder: all - "20230125.3": + "20240722.1": folder: all - "20230125.2": + "20240722.0": folder: all - "20230125.1": + "20240116.2": folder: all - "20230125.0": + "20240116.1": folder: all - "20220623.1": + "20230802.1": folder: all - "20220623.0": + "20230125.3": + folder: all + "20220623.1": folder: all "20211102.0": folder: all diff --git a/recipes/absent/all/test_package/CMakeLists.txt b/recipes/absent/all/test_package/CMakeLists.txt index a092e06169aaf..2321b6024db5e 100644 --- a/recipes/absent/all/test_package/CMakeLists.txt +++ b/recipes/absent/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(absent REQUIRED CONFIG) diff --git a/recipes/absent/all/test_v1_package/CMakeLists.txt b/recipes/absent/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index fb3acbf709bdb..0000000000000 --- a/recipes/absent/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -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/absent/all/test_v1_package/conanfile.py b/recipes/absent/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/absent/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_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/acado/all/test_v1_package/conanfile.py b/recipes/acado/all/test_v1_package/conanfile.py deleted file mode 100644 index e34dbc52de848..0000000000000 --- a/recipes/acado/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/test_v1_package/conanfile.py b/recipes/accellera-uvm-systemc/all/test_v1_package/conanfile.py deleted file mode 100644 index 7c46504cf008f..0000000000000 --- a/recipes/accellera-uvm-systemc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/test_package/CMakeLists.txt b/recipes/access_private/all/test_package/CMakeLists.txt index 6d981e9b4484e..011d886d78b15 100644 --- a/recipes/access_private/all/test_package/CMakeLists.txt +++ b/recipes/access_private/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(access_private REQUIRED CONFIG) diff --git a/recipes/access_private/all/test_v1_package/conanfile.py b/recipes/access_private/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/access_private/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_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/acl/all/test_package/CMakeLists.txt b/recipes/acl/all/test_package/CMakeLists.txt index 3c77dd4bcf50a..25fd96900886d 100644 --- a/recipes/acl/all/test_package/CMakeLists.txt +++ b/recipes/acl/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(acl REQUIRED CONFIG) diff --git a/recipes/acl/all/test_v1_package/CMakeLists.txt b/recipes/acl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/acl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/acl/all/test_v1_package/conanfile.py b/recipes/acl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/acl/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_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/ada/all/conandata.yml b/recipes/ada/all/conandata.yml index e07ea43a3e678..d02f03916e176 100644 --- a/recipes/ada/all/conandata.yml +++ b/recipes/ada/all/conandata.yml @@ -1,37 +1,22 @@ 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.9.2": + url: "https://github.com/ada-url/ada/archive/v2.9.2.tar.gz" + sha256: "f41575ad7eec833afd9f6a0d6101ee7dc2f947fdf19ae8f1b54a71d59f4ba5ec" + "2.9.1": + url: "https://github.com/ada-url/ada/archive/v2.9.1.tar.gz" + sha256: "64eb3d91db941645d1b68ac8d1cbb7b534fbe446b66c1da11e384e17fca975e7" + "2.9.0": + url: "https://github.com/ada-url/ada/archive/v2.9.0.tar.gz" + sha256: "8b992f0ce9134cb4eafb74b164d2ce2cb3af1900902162713b0e0c5ab0b6acd8" + "2.8.0": + url: "https://github.com/ada-url/ada/archive/v2.8.0.tar.gz" + sha256: "83b77fb53d1a9eea22b1484472cea0215c50478c9ea2b4b44b0ba3b52e07c139" + "2.7.8": + url: "https://github.com/ada-url/ada/archive/v2.7.8.tar.gz" + sha256: "8de067b7cb3da1808bf5439279aee6048d761ba246bf8a854c2af73b16b41c75" "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" diff --git a/recipes/ada/all/test_v1_package/CMakeLists.txt b/recipes/ada/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/ada/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ada/all/test_v1_package/conanfile.py b/recipes/ada/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/ada/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/ada/config.yml b/recipes/ada/config.yml index e97d7f2aa5a29..29ab8232ac483 100644 --- a/recipes/ada/config.yml +++ b/recipes/ada/config.yml @@ -1,25 +1,15 @@ versions: - "2.7.4": + "2.9.2": folder: all - "2.7.3": + "2.9.1": folder: all - "2.7.2": + "2.9.0": folder: all - "2.7.0": + "2.8.0": folder: all - "2.6.10": - folder: all - "2.6.7": - folder: all - "2.6.4": - folder: all - "2.6.2": + "2.7.8": folder: all - "2.6.0": + "2.6.10": folder: all "2.5.1": folder: all - "2.5.0": - folder: all - "2.4.2": - folder: all diff --git a/recipes/ade/all/conanfile.py b/recipes/ade/all/conanfile.py index 2e4dc8aa99a3a..a922feb05b441 100644 --- a/recipes/ade/all/conanfile.py +++ b/recipes/ade/all/conanfile.py @@ -1,9 +1,10 @@ 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, rmdir, save +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.scm import Version +from conan.errors import ConanException import os -import textwrap required_conan_version = ">=1.50.0" @@ -33,14 +34,16 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + 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.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.1.2d": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): @@ -55,34 +58,9 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) - # 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), - {"ade": "ade::ade"} - ) - - 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", "ade") self.cpp_info.set_property("cmake_target_name", "ade") self.cpp_info.libs = ["ade"] if self.settings.os == "Windows" and self.settings.compiler == "gcc": self.cpp_info.system_libs.append("ssp") - - # TODO: to remove in conan v2 once legacy 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/ade/all/test_package/CMakeLists.txt b/recipes/ade/all/test_package/CMakeLists.txt index c573b9026dcbc..ebde10dd57a6d 100644 --- a/recipes/ade/all/test_package/CMakeLists.txt +++ b/recipes/ade/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(ade REQUIRED CONFIG) diff --git a/recipes/ade/all/test_v1_package/CMakeLists.txt b/recipes/ade/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/ade/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/ade/all/test_v1_package/conanfile.py b/recipes/ade/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ade/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_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/aeron/all/test_package/CMakeLists.txt b/recipes/aeron/all/test_package/CMakeLists.txt index a3773bc5e7424..75ee2833ff1b2 100644 --- a/recipes/aeron/all/test_package/CMakeLists.txt +++ b/recipes/aeron/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(aeron REQUIRED CONFIG) diff --git a/recipes/aggeom-agg/all/test_package/CMakeLists.txt b/recipes/aggeom-agg/all/test_package/CMakeLists.txt index 5c9ab68de09d8..9246d03dcb855 100644 --- a/recipes/aggeom-agg/all/test_package/CMakeLists.txt +++ b/recipes/aggeom-agg/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(agg REQUIRED CONFIG) diff --git a/recipes/aggeom-agg/all/test_v1_package/CMakeLists.txt b/recipes/aggeom-agg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/aggeom-agg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/aggeom-agg/all/test_v1_package/conanfile.py b/recipes/aggeom-agg/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/aggeom-agg/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_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/ags/all/test_v1_package/CMakeLists.txt b/recipes/ags/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/ags/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index d026b4c142f4c..0000000000000 --- a/recipes/ags/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/alac/all/test_package/CMakeLists.txt b/recipes/alac/all/test_package/CMakeLists.txt index 237396b4c3323..f0b5294707f63 100644 --- a/recipes/alac/all/test_package/CMakeLists.txt +++ b/recipes/alac/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(alac REQUIRED CONFIG) diff --git a/recipes/alac/all/test_v1_package/CMakeLists.txt b/recipes/alac/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/alac/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/alac/all/test_v1_package/conanfile.py b/recipes/alac/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/alac/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_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/alembic/all/conanfile.py b/recipes/alembic/all/conanfile.py index 81ce4ae17f4f7..b0e76d94370d0 100644 --- a/recipes/alembic/all/conanfile.py +++ b/recipes/alembic/all/conanfile.py @@ -46,7 +46,7 @@ def layout(self): def requirements(self): self.requires("imath/3.1.9", transitive_headers=True) if self.options.with_hdf5: - self.requires("hdf5/1.14.2") + self.requires("hdf5/1.14.3") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/alpaca/all/test_package/CMakeLists.txt b/recipes/alpaca/all/test_package/CMakeLists.txt index 790a5eaae638a..82b1960df9de3 100644 --- a/recipes/alpaca/all/test_package/CMakeLists.txt +++ b/recipes/alpaca/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(alpaca REQUIRED CONFIG) diff --git a/recipes/alpaca/all/test_v1_package/CMakeLists.txt b/recipes/alpaca/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/alpaca/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/alpaca/all/test_v1_package/conanfile.py b/recipes/alpaca/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/alpaca/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/amgcl/all/conandata.yml b/recipes/amgcl/all/conandata.yml index cbd774ff5f231..2059663ce0b33 100644 --- a/recipes/amgcl/all/conandata.yml +++ b/recipes/amgcl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.4": + url: "https://github.com/ddemidov/amgcl/archive/1.4.4.tar.gz" + sha256: "02fd5418e14d669422f65fc739ce72bf9516ced2d8942574d4b8caa05dda9d8c" "1.4.3": url: "https://github.com/ddemidov/amgcl/archive/1.4.3.tar.gz" sha256: "e920d5767814ce697d707d1f359a16c9b9eb79eba28fe19e14c18c2a505fe0ad" diff --git a/recipes/amgcl/all/conanfile.py b/recipes/amgcl/all/conanfile.py index d2ddd6171e66f..e04106ab75c2b 100644 --- a/recipes/amgcl/all/conanfile.py +++ b/recipes/amgcl/all/conanfile.py @@ -2,6 +2,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.51.1" @@ -20,12 +21,19 @@ class AmgclConan(ConanFile): package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + options = { 'with_boost': [True, False] } + default_options = { 'with_boost': True } + + def config_options(self): + if Version(self.version) < "1.4.4": + del self.options.with_boost def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0") + if self.options.get_safe("with_boost"): + self.requires("boost/1.85.0") def package_id(self): self.info.clear() @@ -37,9 +45,6 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - pass - def package(self): copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(self, "*", src=os.path.join(self.source_folder, "amgcl"), diff --git a/recipes/amgcl/all/test_package/CMakeLists.txt b/recipes/amgcl/all/test_package/CMakeLists.txt index 9a31b491cc133..c1084b536b7e3 100644 --- a/recipes/amgcl/all/test_package/CMakeLists.txt +++ b/recipes/amgcl/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(amgcl REQUIRED CONFIG) diff --git a/recipes/amgcl/all/test_v1_package/CMakeLists.txt b/recipes/amgcl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/amgcl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/amgcl/all/test_v1_package/conanfile.py b/recipes/amgcl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/amgcl/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_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/amgcl/config.yml b/recipes/amgcl/config.yml index 1d12970eb4fba..02bed7da76340 100644 --- a/recipes/amgcl/config.yml +++ b/recipes/amgcl/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.4": + folder: all "1.4.3": folder: all "1.4.2": diff --git a/recipes/amqp-cpp/all/test_package/CMakeLists.txt b/recipes/amqp-cpp/all/test_package/CMakeLists.txt index dcd602f230785..dd0c79568abff 100644 --- a/recipes/amqp-cpp/all/test_package/CMakeLists.txt +++ b/recipes/amqp-cpp/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(amqpcpp REQUIRED CONFIG) diff --git a/recipes/amqp-cpp/all/test_v1_package/CMakeLists.txt b/recipes/amqp-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/amqp-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/amqp-cpp/all/test_v1_package/conanfile.py b/recipes/amqp-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/amqp-cpp/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_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/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/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 788c3990884da..2e3e6776d51e1 100644 --- a/recipes/android-ndk/all/conandata.yml +++ b/recipes/android-ndk/all/conandata.yml @@ -1,4 +1,56 @@ sources: + "r27c": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r27c-windows.zip" + sha256: "27e49f11e0cee5800983d8af8f4acd5bf09987aa6f790d4439dda9f3643d2494" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r27c-linux.zip" + sha256: "59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r27c-darwin.zip" + sha256: "8c5685457c58a88527367d46d3f14e8c727d962c39f85344cff0c0768a73c3b7" + "r27": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r27-windows.zip" + sha256: "342ceafd7581ae26a0bd650a5e0bbcd0aa2ee15eadfd7508b3dedeb1372d7596" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r27-linux.zip" + sha256: "2f17eb8bcbfdc40201c0b36e9a70826fcd2524ab7a2a235e2c71186c302da1dc" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r27-darwin.zip" + sha256: "2f2ef00b22fe22c1c9c78fda1b38ea7ffa6528e25eac0b70a92f8cb0093143be" + "r26d": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26d-windows.zip" + sha256: "9b285da57a36818cb65ea5b93ec74f8138f48a40182ff2994f6aade4580ed597" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26d-linux.zip" + sha256: "eefeafe7ccf177de7cc57158da585e7af119bb7504a63604ad719e4b2a328b54" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26d-darwin.zip" + sha256: "ee2d0531685a69164fc0a66705d3a30109223f6fc01f1008ca5d8bc3a32d628d" + "r26c": + "Windows": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26c-windows.zip" + sha256: "67d0c7e4ba853e9168584e8640a562af431dcf086c08efef3ec23ee827139303" + "Linux": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26c-linux.zip" + sha256: "6d6e659834d28bb24ba7ae66148ad05115ebbad7dabed1af9b3265674774fcf6" + "Macos": + "x86_64": + url: "https://dl.google.com/android/repository/android-ndk-r26c-darwin.zip" + sha256: "312756dfcbdbf389d35d651e17ca98683bd36cb83cc7bf7ad51cac5c06bd064b" "r26b": "Windows": "x86_64": diff --git a/recipes/android-ndk/all/conanfile.py b/recipes/android-ndk/all/conanfile.py index ecf241f5b5a1a..429c20e310764 100644 --- a/recipes/android-ndk/all/conanfile.py +++ b/recipes/android-ndk/all/conanfile.py @@ -305,7 +305,6 @@ def package_info(self): # changed to no longer include the triplet. bare = self._ndk_version_major >= 23 self.buildenv_info.define_path("AR", self._define_tool_var("AR", "ar", bare)) - self.buildenv_info.define_path("AS", self._define_tool_var("AS", "as", bare)) self.buildenv_info.define_path("RANLIB", self._define_tool_var("RANLIB", "ranlib", bare)) self.buildenv_info.define_path("STRIP", self._define_tool_var("STRIP", "strip", bare)) self.buildenv_info.define_path("ADDR2LINE", self._define_tool_var("ADDR2LINE", "addr2line", bare)) @@ -317,12 +316,6 @@ def package_info(self): if self._ndk_version_major < 23: self.buildenv_info.define_path("ELFEDIT", self._define_tool_var("ELFEDIT", "elfedit", bare)) - # The `ld` tool changed naming conventions earlier than others - if self._ndk_version_major >= 22: - self.buildenv_info.define_path("LD", self._define_tool_var_naked("LD", "ld")) - else: - self.buildenv_info.define_path("LD", self._define_tool_var("LD", "ld")) - self.buildenv_info.define("ANDROID_PLATFORM", f"android-{self.settings_target.os.api_level}") self.buildenv_info.define("ANDROID_TOOLCHAIN", "clang") self.buildenv_info.define("ANDROID_ABI", self._android_abi) diff --git a/recipes/android-ndk/all/test_package/CMakeLists.txt b/recipes/android-ndk/all/test_package/CMakeLists.txt index f776bcb524ea6..35cfafbe20b45 100644 --- a/recipes/android-ndk/all/test_package/CMakeLists.txt +++ b/recipes/android-ndk/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) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/android-ndk/all/test_package/conanfile.py b/recipes/android-ndk/all/test_package/conanfile.py index db186fc2c369f..3edc7462cdfed 100644 --- a/recipes/android-ndk/all/test_package/conanfile.py +++ b/recipes/android-ndk/all/test_package/conanfile.py @@ -1,6 +1,8 @@ from conan import ConanFile from conan.tools.cmake import CMake, cmake_layout +from conan.tools.scm import Version import os +import platform class TestPackgeConan(ConanFile): @@ -8,8 +10,13 @@ class TestPackgeConan(ConanFile): generators = "CMakeToolchain", "VirtualBuildEnv" test_type = "explicit" - def build_requirements(self): - self.tool_requires(self.tested_reference_str) + def requirements(self): + if self.settings.os == "Android": + # Assume we're testing as a tool requires + self.tool_requires(self.tested_reference_str) + else: + # only test the contents of the package on the current machine + self.requires(self.tested_reference_str) def layout(self): cmake_layout(self) @@ -22,10 +29,15 @@ def build(self): cmake.build() def test(self): - if self.settings.os == "Windows": - self.run("ndk-build.cmd --version") + ndk_build = "ndk-build.cmd" if self.settings.os == "Windows" else "ndk-build" + ndk_version = Version(self.tested_reference_str.split('/')[1]) + skip_run = platform.system() == "Darwin" and "arm" in platform.processor() and ndk_version < "r23c" + if not skip_run: + run_env = "conanbuild" if self.settings.os == "Android" else "conanrun" + self.run(f"{ndk_build} --version", env=run_env) else: - self.run("ndk-build --version") + self.output.warning("Skipped running ndk-build on macOS Apple Silicon in arm64 mode, please use a newer" + " version of the Android NDK") # INFO: Run the project that was built using Android NDK if self.settings.os == "Android": diff --git a/recipes/android-ndk/all/test_v1_package/CMakeLists.txt b/recipes/android-ndk/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/android-ndk/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -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 deleted file mode 100644 index d61cc4e4da75e..0000000000000 --- a/recipes/android-ndk/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,32 +0,0 @@ -import os -from conan import ConanFile -from conans import CMake -from conan.tools.build import cross_building - - -class TestPackgeConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - test_type = "explicit" - generators = "cmake", "cmake_find_package_multi" - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - - def build(self): - # It only makes sense to build a library, if the target os is Android - if self.settings.os == "Android": - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - if self.settings.os == "Windows": - self.run("ndk-build.cmd --version", run_environment=True) - else: - self.run("ndk-build --version", run_environment=True) - - # Run the project that was built using Android NDK - if self.settings.os == "Android": - test_file = os.path.join("bin", "test_package") - assert os.path.exists(test_file) diff --git a/recipes/android-ndk/config.yml b/recipes/android-ndk/config.yml index a7fa8c97dd42c..ccbdced0686a8 100644 --- a/recipes/android-ndk/config.yml +++ b/recipes/android-ndk/config.yml @@ -1,4 +1,12 @@ versions: + "r27c": + folder: all + "r27": + folder: all + "r26d": + folder: all + "r26c": + folder: all "r26b": folder: all "r26": diff --git a/recipes/angelscript/all/conandata.yml b/recipes/angelscript/all/conandata.yml index edfe7e005b855..a5590460838fe 100644 --- a/recipes/angelscript/all/conandata.yml +++ b/recipes/angelscript/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.37.0": + url: "https://www.angelcode.com/angelscript/sdk/files/angelscript_2.37.0.zip" + sha256: "0c52d1688016a0b2484e9ca549471c4e295df060770c57840144c64815f54f10" "2.36.1": url: "https://www.angelcode.com/angelscript/sdk/files/angelscript_2.36.1.zip" sha256: "58bb749af9c7e386304705f4e6e627ae41dfe03e0b6a73c3d0d2e017c4fc948f" diff --git a/recipes/angelscript/all/conanfile.py b/recipes/angelscript/all/conanfile.py index 88cdd729c8bf1..0a17df3020929 100644 --- a/recipes/angelscript/all/conanfile.py +++ b/recipes/angelscript/all/conanfile.py @@ -10,13 +10,13 @@ class AngelScriptConan(ConanFile): name = "angelscript" - license = "Zlib" - homepage = "http://www.angelcode.com/angelscript" - url = "https://github.com/conan-io/conan-center-index" description = ( "An extremely flexible cross-platform scripting library designed to " "allow applications to extend their functionality through external scripts." ) + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.angelcode.com/angelscript" topics = ("angelcode", "embedded", "scripting", "language", "compiler", "interpreter") package_type = "library" @@ -90,7 +90,7 @@ def package_info(self): # TODO: back to global scope in conan v2 once cmake_find_package* generators removed self.cpp_info.components["_angelscript"].libs = [f"angelscript{postfix}"] if self.settings.os in ("Linux", "FreeBSD", "SunOS"): - self.cpp_info.components["_angelscript"].system_libs.append("pthread") + self.cpp_info.components["_angelscript"].system_libs.extend(["m", "pthread"]) # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "Angelscript" diff --git a/recipes/angelscript/all/test_package/CMakeLists.txt b/recipes/angelscript/all/test_package/CMakeLists.txt index ee85cb2f6cc3c..b991dfa613ffe 100644 --- a/recipes/angelscript/all/test_package/CMakeLists.txt +++ b/recipes/angelscript/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(Angelscript REQUIRED CONFIG) diff --git a/recipes/angelscript/all/test_v1_package/CMakeLists.txt b/recipes/angelscript/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/angelscript/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/angelscript/all/test_v1_package/conanfile.py b/recipes/angelscript/all/test_v1_package/conanfile.py deleted file mode 100644 index a3b9c17e2ea29..0000000000000 --- a/recipes/angelscript/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import CMake, ConanFile, tools -import os - - -class AngelScriptTestConan(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/angelscript/config.yml b/recipes/angelscript/config.yml index f3cbb4fedf454..621b347e7a383 100644 --- a/recipes/angelscript/config.yml +++ b/recipes/angelscript/config.yml @@ -1,4 +1,6 @@ versions: + "2.37.0": + folder: all "2.36.1": folder: all "2.36.0": diff --git a/recipes/ann/all/CMakeLists.txt b/recipes/ann/all/CMakeLists.txt new file mode 100644 index 0000000000000..869e7fed035ec --- /dev/null +++ b/recipes/ann/all/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.15) +project(ANN LANGUAGES CXX) + +include(GNUInstallDirs) + +file(GLOB ANN_SRC_FILES ${ANN_SRC_DIR}/src/*.cpp) + +add_library(ANN ${ANN_SRC_FILES}) +target_include_directories(ANN PUBLIC ${ANN_SRC_DIR}/include) + +if(WIN32) + if(BUILD_SHARED_LIBS) + set_target_properties(ANN PROPERTIES + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN TRUE + ) + target_compile_definitions(ANN PRIVATE DLL_EXPORTS) + else() + target_compile_definitions(ANN PUBLIC ANN_STATIC) + endif() +endif() + +install(DIRECTORY ${ANN_SRC_DIR}/include/ANN DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install( + TARGETS ANN + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/recipes/ann/all/conandata.yml b/recipes/ann/all/conandata.yml new file mode 100644 index 0000000000000..664adc9ca8f3c --- /dev/null +++ b/recipes/ann/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.1.2": + url: "https://www.cs.umd.edu/~mount/ANN/Files/1.1.2/ann_1.1.2.tar.gz" + sha256: "eea03f2e224b66813226d775053316675375dcec45bd263674c052d9324a49a5" +patches: + "1.1.2": + - patch_file: "patches/1.1.2-0001-fix-windows-static.patch" + patch_description: "Fix windows static" + patch_type: "portability" + - patch_file: "patches/1.1.2-0002-fix-cppstd17+-register-keyword.patch" + patch_description: "Fix compilation with C++17 (or above) standard, by removing register keyword" + patch_type: "portability" diff --git a/recipes/ann/all/conanfile.py b/recipes/ann/all/conanfile.py new file mode 100644 index 0000000000000..01aac4245f259 --- /dev/null +++ b/recipes/ann/all/conanfile.py @@ -0,0 +1,71 @@ +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 +import os + +required_conan_version = ">=1.53.0" + + +class AnnConan(ConanFile): + name = "ann" + description = ( + "ANN is a library written in C++, which supports data structures and " + "algorithms for both exact and approximate nearest neighbor searching " + "in arbitrarily high dimensions." + ) + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.cs.umd.edu/~mount/ANN" + topics = ("nns", "nearest-neighbor-search") + 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) + 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.variables["ANN_SRC_DIR"] = self.source_folder.replace("\\", "/") + 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 package(self): + for license_file in ("Copyright.txt", "License.txt"): + copy(self, license_file, 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 = ["ANN"] + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("ANN_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/ann/all/patches/1.1.2-0001-fix-windows-static.patch b/recipes/ann/all/patches/1.1.2-0001-fix-windows-static.patch new file mode 100644 index 0000000000000..7e027ada50bbb --- /dev/null +++ b/recipes/ann/all/patches/1.1.2-0001-fix-windows-static.patch @@ -0,0 +1,11 @@ +--- a/include/ANN/ANN.h ++++ b/include/ANN/ANN.h +@@ -59,7 +59,7 @@ + #ifndef ANN_H + #define ANN_H + +-#ifdef WIN32 ++#if defined(_WIN32) && !defined(ANN_STATIC) + //---------------------------------------------------------------------- + // For Microsoft Visual C++, externally accessible symbols must be + // explicitly indicated with DLL_API, which is somewhat like "extern." diff --git a/recipes/ann/all/patches/1.1.2-0002-fix-cppstd17+-register-keyword.patch b/recipes/ann/all/patches/1.1.2-0002-fix-cppstd17+-register-keyword.patch new file mode 100644 index 0000000000000..b7ccbe07fc3a4 --- /dev/null +++ b/recipes/ann/all/patches/1.1.2-0002-fix-cppstd17+-register-keyword.patch @@ -0,0 +1,141 @@ +--- a/src/ANN.cpp ++++ b/src/ANN.cpp +@@ -48,9 +48,9 @@ ANNdist annDist( // interpoint squared distance + ANNpoint p, + ANNpoint q) + { +- register int d; +- register ANNcoord diff; +- register ANNcoord dist; ++ int d; ++ ANNcoord diff; ++ ANNcoord dist; + + dist = 0; + for (d = 0; d < dim; d++) { +--- a/src/kd_fix_rad_search.cpp ++++ b/src/kd_fix_rad_search.cpp +@@ -147,11 +147,11 @@ void ANNkd_split::ann_FR_search(ANNdist box_dist) + + void ANNkd_leaf::ann_FR_search(ANNdist box_dist) + { +- register ANNdist dist; // distance to data point +- register ANNcoord* pp; // data coordinate pointer +- register ANNcoord* qq; // query coordinate pointer +- register ANNcoord t; +- register int d; ++ ANNdist dist; // distance to data point ++ ANNcoord* pp; // data coordinate pointer ++ ANNcoord* qq; // query coordinate pointer ++ ANNcoord t; ++ int d; + + for (int i = 0; i < n_pts; i++) { // check points in bucket + +--- a/src/kd_pr_search.cpp ++++ b/src/kd_pr_search.cpp +@@ -180,12 +180,12 @@ void ANNkd_split::ann_pri_search(ANNdist box_dist) + + void ANNkd_leaf::ann_pri_search(ANNdist box_dist) + { +- register ANNdist dist; // distance to data point +- register ANNcoord* pp; // data coordinate pointer +- register ANNcoord* qq; // query coordinate pointer +- register ANNdist min_dist; // distance to k-th closest point +- register ANNcoord t; +- register int d; ++ ANNdist dist; // distance to data point ++ ANNcoord* pp; // data coordinate pointer ++ ANNcoord* qq; // query coordinate pointer ++ ANNdist min_dist; // distance to k-th closest point ++ ANNcoord t; ++ int d; + + min_dist = ANNprPointMK->max_key(); // k-th smallest distance so far + +--- a/src/kd_search.cpp ++++ b/src/kd_search.cpp +@@ -171,12 +171,12 @@ void ANNkd_split::ann_search(ANNdist box_dist) + + void ANNkd_leaf::ann_search(ANNdist box_dist) + { +- register ANNdist dist; // distance to data point +- register ANNcoord* pp; // data coordinate pointer +- register ANNcoord* qq; // query coordinate pointer +- register ANNdist min_dist; // distance to k-th closest point +- register ANNcoord t; +- register int d; ++ ANNdist dist; // distance to data point ++ ANNcoord* pp; // data coordinate pointer ++ ANNcoord* qq; // query coordinate pointer ++ ANNdist min_dist; // distance to k-th closest point ++ ANNcoord t; ++ int d; + + min_dist = ANNkdPointMK->max_key(); // k-th smallest distance so far + +--- a/src/kd_util.cpp ++++ b/src/kd_util.cpp +@@ -127,10 +127,10 @@ ANNdist annBoxDistance( // compute distance from point to box + const ANNpoint hi, // high point of box + int dim) // dimension of space + { +- register ANNdist dist = 0.0; // sum of squared distances +- register ANNdist t; ++ ANNdist dist = 0.0; // sum of squared distances ++ ANNdist t; + +- for (register int d = 0; d < dim; d++) { ++ for (int d = 0; d < dim; d++) { + if (q[d] < lo[d]) { // q is left of box + t = ANNdist(lo[d]) - ANNdist(q[d]); + dist = ANN_SUM(dist, ANN_POW(t)); +@@ -238,8 +238,8 @@ void annMedianSplit( + int l = 0; // left end of current subarray + int r = n-1; // right end of current subarray + while (l < r) { +- register int i = (r+l)/2; // select middle as pivot +- register int k; ++ int i = (r+l)/2; // select middle as pivot ++ int k; + + if (PA(i,d) > PA(r,d)) // make sure last > pivot + PASWAP(i,r) +--- a/src/pr_queue.h ++++ b/src/pr_queue.h +@@ -86,9 +86,9 @@ public: + PQinfo inf) // item info + { + if (++n > max_size) annError("Priority queue overflow.", ANNabort); +- register int r = n; ++ int r = n; + while (r > 1) { // sift up new item +- register int p = r/2; ++ int p = r/2; + ANN_FLOP(1) // increment floating ops + if (pq[p].key <= kv) // in proper order + break; +@@ -105,9 +105,9 @@ public: + { + kv = pq[1].key; // key of min item + inf = pq[1].info; // information of min item +- register PQkey kn = pq[n--].key;// last item in queue +- register int p = 1; // p points to item out of position +- register int r = p<<1; // left child of p ++ PQkey kn = pq[n--].key;// last item in queue ++ int p = 1; // p points to item out of position ++ int r = p<<1; // left child of p + while (r <= n) { // while r is still within the heap + ANN_FLOP(2) // increment floating ops + // set r to smaller child of p +--- a/src/pr_queue_k.h ++++ b/src/pr_queue_k.h +@@ -100,7 +100,7 @@ public: + PQKkey kv, // key value + PQKinfo inf) // item info + { +- register int i; ++ int i; + // slide larger values up + for (i = n; i > 0; i--) { + if (mk[i-1].key > kv) diff --git a/recipes/ann/all/test_package/CMakeLists.txt b/recipes/ann/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fe5808fbfdff7 --- /dev/null +++ b/recipes/ann/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ann REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ann::ann) diff --git a/recipes/joltphysics/all/test_package/conanfile.py b/recipes/ann/all/test_package/conanfile.py similarity index 100% rename from recipes/joltphysics/all/test_package/conanfile.py rename to recipes/ann/all/test_package/conanfile.py diff --git a/recipes/ann/all/test_package/test_package.cpp b/recipes/ann/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8a2ab526c32b2 --- /dev/null +++ b/recipes/ann/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + ANNpoint queryPt = annAllocPt(2); + return 0; +} diff --git a/recipes/ann/config.yml b/recipes/ann/config.yml new file mode 100644 index 0000000000000..8d13aefb6b4fb --- /dev/null +++ b/recipes/ann/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.2": + folder: all diff --git a/recipes/annoy/all/conandata.yml b/recipes/annoy/all/conandata.yml new file mode 100644 index 0000000000000..540727dc55607 --- /dev/null +++ b/recipes/annoy/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.17.3": + url: "https://github.com/spotify/annoy/archive/refs/tags/v1.17.3.tar.gz" + sha256: "c121d38cacd98f5103b24ca4e94ca097f18179eed3037e9eb93ad70ec1e6356e" diff --git a/recipes/annoy/all/conanfile.py b/recipes/annoy/all/conanfile.py new file mode 100644 index 0000000000000..a583978167f26 --- /dev/null +++ b/recipes/annoy/all/conanfile.py @@ -0,0 +1,44 @@ +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 AnnoyConan(ConanFile): + name = "annoy" + description = "Approximate Nearest Neighbors optimized for memory usage and loading/saving to disk" + license = "Apache-2.0" + homepage = "https://github.com/spotify/annoy" + url = "https://github.com/conan-io/conan-center-index" + topics = ("approximate-nearest-neighbors", "machine-learning", "nearest-neighbors", "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")) + for header in ["annoylib.h", "kissrandom.h", "mman.h"]: + copy(self, header, os.path.join(self.source_folder, "src"), os.path.join(self.package_folder, "include", "annoy")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Annoy") + self.cpp_info.set_property("cmake_target_name", "Annoy::Annoy") + + 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"] = "Annoy" + self.cpp_info.names["cmake_find_package_multi"] = "Annoy" diff --git a/recipes/annoy/all/test_package/CMakeLists.txt b/recipes/annoy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33d34348b2425 --- /dev/null +++ b/recipes/annoy/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Annoy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Annoy::Annoy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/annoy/all/test_package/conanfile.py b/recipes/annoy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/annoy/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/annoy/all/test_package/test_package.cpp b/recipes/annoy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ee5f4538042ea --- /dev/null +++ b/recipes/annoy/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include + +#include +#include + +int main() { + const int n = 3; + Annoy::AnnoyIndex index(n); + + double x[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; + double needle[3] = {0.1, 0.1, 0.8}; + + for (int i = 0; i < n; i++) { + index.add_item(i, x[i]); + } + index.build(-1); + + std::vector result; + index.get_nns_by_vector(needle, 1, -1, &result, nullptr); + std::cout << "Nearest neighbor to vector [1.0, 0.5, 0.5]: "; + for (int i : result) { + std::cout << i << " "; + } + std::cout << std::endl; + return 0; +} diff --git a/recipes/annoy/config.yml b/recipes/annoy/config.yml new file mode 100644 index 0000000000000..a138b582eaf2e --- /dev/null +++ b/recipes/annoy/config.yml @@ -0,0 +1,3 @@ +versions: + "1.17.3": + folder: all diff --git a/recipes/antlr4-cppruntime/all/conandata.yml b/recipes/antlr4-cppruntime/all/conandata.yml index f6974e320b559..097e94d1f8a00 100644 --- a/recipes/antlr4-cppruntime/all/conandata.yml +++ b/recipes/antlr4-cppruntime/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.13.2": + url: "https://github.com/antlr/antlr4/archive/refs/tags/4.13.2.tar.gz" + sha256: "9f18272a9b32b622835a3365f850dd1063d60f5045fb1e12ce475ae6e18a35bb" "4.13.1": url: "https://github.com/antlr/antlr4/archive/refs/tags/4.13.1.tar.gz" sha256: "da20d487524d7f0a8b13f73a8dc326de7fc2e5775f5a49693c0a4e59c6b1410c" @@ -18,6 +21,26 @@ sources: url: "https://github.com/antlr/antlr4/archive/refs/tags/4.9.3.tar.gz" sha256: "efe4057d75ab48145d4683100fec7f77d7f87fa258707330cadd1f8e6f7eecae" patches: + "4.13.2": + - patch_file: "patches/0005-update-IncludeChronoForMSVC.patch" + patch_description: "Fix the compiler errors reported by Visual Studio 2022 17.13 (MSVC 19.43.34808)." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/4738" + "4.13.1": + - patch_file: "patches/0005-update-IncludeChronoForMSVC.patch" + patch_description: "Fix the compiler errors reported by Visual Studio 2022 17.13 (MSVC 19.43.34808)." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/4738" + "4.13.0": + - patch_file: "patches/0005-update-IncludeChronoForMSVC.patch" + patch_description: "Fix the compiler errors reported by Visual Studio 2022 17.13 (MSVC 19.43.34808)." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/4738" + "4.12.0": + - patch_file: "patches/0005-update-IncludeChronoForMSVC.patch" + patch_description: "Fix the compiler errors reported by Visual Studio 2022 17.13 (MSVC 19.43.34808)." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/4738" "4.11.1": - patch_file: "patches/0002-update-FlatHashSet.patch" patch_description: "Fix the compiler errors reported by GCC 7 due to the new type FlatHashSet introduced in 4.11." @@ -27,6 +50,10 @@ patches: patch_description: "Fix the compiler errors reported by GCC 7 due to the new type FlatHashMap introduced in 4.11." patch_type: "portability" patch_source: "https://github.com/antlr/antlr4/pull/3885" + - patch_file: "patches/0005-update-IncludeChronoForMSVC.patch" + patch_description: "Fix the compiler errors reported by Visual Studio 2022 17.13 (MSVC 19.43.34808)." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/4738" "4.10.1": - patch_file: "patches/0004-update-DropLibuuid-4.10.x-1.patch" patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#1) which is not used since 4.9." @@ -36,6 +63,10 @@ patches: patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#2) which is not used since 4.9." patch_type: "backport" patch_source: "https://github.com/antlr/antlr4/pull/3787" + - patch_file: "patches/0005-update-IncludeChronoForMSVC.patch" + patch_description: "Fix the compiler errors reported by Visual Studio 2022 17.13 (MSVC 19.43.34808)." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/4738" "4.9.3": - patch_file: "patches/0001-update-cmakelist.patch" - patch_file: "patches/0004-update-DropLibuuid-4.9.3-1.patch" @@ -46,3 +77,7 @@ patches: patch_description: "Revise the CMakeLists.txt to remove the dependency on libuuid (#2) which is not used since 4.9." patch_type: "backport" patch_source: "https://github.com/antlr/antlr4/pull/3787" + - patch_file: "patches/0005-update-IncludeChronoForMSVC.patch" + patch_description: "Fix the compiler errors reported by Visual Studio 2022 17.13 (MSVC 19.43.34808)." + patch_type: "portability" + patch_source: "https://github.com/antlr/antlr4/pull/4738" diff --git a/recipes/antlr4-cppruntime/all/patches/0005-update-IncludeChronoForMSVC.patch b/recipes/antlr4-cppruntime/all/patches/0005-update-IncludeChronoForMSVC.patch new file mode 100644 index 0000000000000..bb3081f2134e0 --- /dev/null +++ b/recipes/antlr4-cppruntime/all/patches/0005-update-IncludeChronoForMSVC.patch @@ -0,0 +1,10 @@ +--- runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp ++++ runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +@@ -10,6 +10,7 @@ + #include "support/CPPUtils.h" + + #include "atn/ProfilingATNSimulator.h" ++#include + + using namespace antlr4; + using namespace antlr4::atn; diff --git a/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt b/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt index e4aff6ceb5ae4..0057724993e47 100644 --- a/recipes/antlr4-cppruntime/all/test_package/CMakeLists.txt +++ b/recipes/antlr4-cppruntime/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(antlr4-runtime REQUIRED CONFIG) diff --git a/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt b/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/antlr4-cppruntime/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py b/recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py deleted file mode 100644 index 90eb89e3f2f46..0000000000000 --- a/recipes/antlr4-cppruntime/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/antlr4-cppruntime/config.yml b/recipes/antlr4-cppruntime/config.yml index 05c77e20051f9..f6dbfc0dfa83b 100644 --- a/recipes/antlr4-cppruntime/config.yml +++ b/recipes/antlr4-cppruntime/config.yml @@ -1,4 +1,6 @@ versions: + "4.13.2": + folder: all "4.13.1": folder: all "4.13.0": diff --git a/recipes/antlr4/all/conandata.yml b/recipes/antlr4/all/conandata.yml new file mode 100644 index 0000000000000..bb6d82645f9fb --- /dev/null +++ b/recipes/antlr4/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "4.13.1": + jar: + url: "https://www.antlr.org/download/antlr-4.13.1-complete.jar" + sha256: "bc13a9c57a8dd7d5196888211e5ede657cb64a3ce968608697e4f668251a8487" + license: + url: "https://raw.githubusercontent.com/antlr/antlr4/4.13.1/LICENSE.txt" + sha256: "3db1fb3ee79a4b4f9918fc4d0f6133bf18a3cf787f126cd22f8aa9b862281c0c" diff --git a/recipes/antlr4/all/conanfile.py b/recipes/antlr4/all/conanfile.py new file mode 100644 index 0000000000000..b0a45cf87f544 --- /dev/null +++ b/recipes/antlr4/all/conanfile.py @@ -0,0 +1,75 @@ +from conan import ConanFile +from conan.tools.files import copy, download, save +import os +import stat + + +required_conan_version = ">=1.47.0" + + +class Antlr4Conan(ConanFile): + name = "antlr4" + description = "powerful parser generator for reading, processing, executing, or translating structured text or binary files." + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/antlr/antlr4" + topics = ("parser", "generator") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def requirements(self): + self.requires("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): + v = self.conan_data["sources"][self.version] + download( + self, + url=v["jar"]["url"], + filename=os.path.join(self.source_folder, "antlr-complete.jar"), + sha256=v["jar"]["sha256"], + ) + download( + self, + url=v["license"]["url"], + filename=os.path.join(self.source_folder, "LICENSE.txt"), + sha256=v["license"]["sha256"], + ) + + def package(self): + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="antlr-complete.jar", dst=os.path.join(self.package_folder, "res"), src=self.source_folder) + if self.settings.os == "Windows": + save(self, + path=os.path.join(self.package_folder, "bin", "antlr4.bat"), + content="""\ + java -classpath %CLASSPATH% org.antlr.v4.Tool %* + """ + ) + else: + bin_path = os.path.join(self.package_folder, "bin", "antlr4") + save(self, + path=bin_path, + content="""\ + #!/bin/bash + java -classpath $CLASSPATH org.antlr.v4.Tool $@ + """ + ) + st = os.stat(bin_path) + os.chmod(bin_path, st.st_mode | stat.S_IEXEC) + + def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + jar = os.path.join(self.package_folder, "res", "antlr-complete.jar") + self.runenv_info.prepend_path("CLASSPATH", jar) diff --git a/recipes/antlr4/all/test_package/conanfile.py b/recipes/antlr4/all/test_package/conanfile.py new file mode 100644 index 0000000000000..07c30b7476b74 --- /dev/null +++ b/recipes/antlr4/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("antlr4") diff --git a/recipes/antlr4/config.yml b/recipes/antlr4/config.yml new file mode 100644 index 0000000000000..641cda5e6add7 --- /dev/null +++ b/recipes/antlr4/config.yml @@ -0,0 +1,3 @@ +versions: + "4.13.1": + folder: all diff --git a/recipes/any-lite/all/test_package/CMakeLists.txt b/recipes/any-lite/all/test_package/CMakeLists.txt index 52b8d2bac37bb..dc9effd7d4623 100644 --- a/recipes/any-lite/all/test_package/CMakeLists.txt +++ b/recipes/any-lite/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(any-lite REQUIRED CONFIG) diff --git a/recipes/any-lite/all/test_v1_package/CMakeLists.txt b/recipes/any-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/any-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/any-lite/all/test_v1_package/conanfile.py b/recipes/any-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/any-lite/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_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/anyrpc/all/conanfile.py b/recipes/anyrpc/all/conanfile.py index 068094058cb31..7ffd3493682cb 100644 --- a/recipes/anyrpc/all/conanfile.py +++ b/recipes/anyrpc/all/conanfile.py @@ -1,8 +1,9 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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.53.0" @@ -89,8 +90,10 @@ def generate(self): tc.variables["BUILD_PROTOCOL_JSON"] = self.options.with_protocol_json tc.variables["BUILD_PROTOCOL_XML"] = self.options.with_protocol_xml tc.variables["BUILD_PROTOCOL_MESSAGEPACK"] = self.options.with_protocol_messagepack - # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.0.2": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) diff --git a/recipes/anyrpc/all/test_package/CMakeLists.txt b/recipes/anyrpc/all/test_package/CMakeLists.txt index f9c6894d75a0f..017e33ad09f43 100644 --- a/recipes/anyrpc/all/test_package/CMakeLists.txt +++ b/recipes/anyrpc/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_anyrpc CXX) diff --git a/recipes/anyrpc/all/test_v1_package/CMakeLists.txt b/recipes/anyrpc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/anyrpc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/anyrpc/all/test_v1_package/conanfile.py b/recipes/anyrpc/all/test_v1_package/conanfile.py deleted file mode 100644 index e946eccc88b51..0000000000000 --- a/recipes/anyrpc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - - -class TestAnyRpcV1Conan(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_anyrpc") - self.run(bin_path, run_environment=True) diff --git a/recipes/approvaltests.cpp/all/conandata.yml b/recipes/approvaltests.cpp/all/conandata.yml index b3f371f3d0cdd..f5f47fc15d2ea 100644 --- a/recipes/approvaltests.cpp/all/conandata.yml +++ b/recipes/approvaltests.cpp/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "10.13.0": + - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.13.0/ApprovalTests.v.10.13.0.hpp + sha256: c00f6390b81d9924dc646e9d32b61e1e09abda106c13704f714ac349241bb9ff + - url: "https://raw.githubusercontent.com/approvals/ApprovalTests.cpp/v.10.13.0/LICENSE" + sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 "10.12.2": - url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.10.12.2/ApprovalTests.v.10.12.2.hpp sha256: 4c43d0ea98669e3d6fbb5810cc47b19adaf88cabb1421b488aa306b08c434131 diff --git a/recipes/approvaltests.cpp/all/conanfile.py b/recipes/approvaltests.cpp/all/conanfile.py index a61797eefb14b..1bfdff95cf245 100644 --- a/recipes/approvaltests.cpp/all/conanfile.py +++ b/recipes/approvaltests.cpp/all/conanfile.py @@ -1,11 +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, download, rename from conan.tools.layout import basic_layout from conan.tools.scm import Version import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.53" class ApprovalTestsCppConan(ConanFile): @@ -38,10 +39,12 @@ class ApprovalTestsCppConan(ConanFile): @property def _header_file(self): return "ApprovalTests.hpp" + + @property + def _min_cppstd(self): + return 11 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 +52,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") @@ -64,6 +67,9 @@ def package_id(self): self.info.clear() def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + if Version(self.version) >= "10.2.0": if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration(f"{self.ref} with compiler gcc requires at least compiler version 5") diff --git a/recipes/approvaltests.cpp/all/test_v1_package/CMakeLists.txt b/recipes/approvaltests.cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8ce0e08c3c918..0000000000000 --- a/recipes/approvaltests.cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_v1_package LANGUAGES CXX) - -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/approvaltests.cpp/all/test_v1_package/conanfile.py b/recipes/approvaltests.cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 8a49736d0c6b2..0000000000000 --- a/recipes/approvaltests.cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +0,0 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def _approvaltests_option(self, name, default): - try: - return getattr(self.options["approvaltests.cpp"], name, default) - except (AttributeError, ConanException): - return default - - def build(self): - cmake = CMake(self) - cmake.definitions["WITH_BOOSTTEST"] = self._approvaltests_option("with_boosttest", False) - cmake.definitions["WITH_CATCH"] = self.options["approvaltests.cpp"].with_catch2 - cmake.definitions["WITH_GTEST"] = self.options["approvaltests.cpp"].with_gtest - cmake.definitions["WITH_DOCTEST"] = self.options["approvaltests.cpp"].with_doctest - cmake.definitions["WITH_CPPUTEST"] = self._approvaltests_option("with_cpputest", False) - 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/approvaltests.cpp/config.yml b/recipes/approvaltests.cpp/config.yml index caf3f177e07c7..6e7a92b2ed85a 100644 --- a/recipes/approvaltests.cpp/config.yml +++ b/recipes/approvaltests.cpp/config.yml @@ -1,4 +1,6 @@ versions: + "10.13.0": + folder: all "10.12.2": folder: all "10.12.1": diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py index c6efeb71fc33d..92e0be4b1f040 100644 --- a/recipes/apr-util/all/conanfile.py +++ b/recipes/apr-util/all/conanfile.py @@ -88,9 +88,9 @@ def requirements(self): if self.options.with_mysql: self.requires("libmysqlclient/8.1.0") if self.options.with_sqlite3: - self.requires("sqlite3/3.44.2") + self.requires("sqlite3/3.45.0") if self.options.with_expat: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_postgresql: self.requires("libpq/15.4") diff --git a/recipes/apr-util/all/test_package/CMakeLists.txt b/recipes/apr-util/all/test_package/CMakeLists.txt index c273ab3463a77..81bd2f09338c2 100644 --- a/recipes/apr-util/all/test_package/CMakeLists.txt +++ b/recipes/apr-util/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(apr-util REQUIRED CONFIG) diff --git a/recipes/apr/all/conanfile.py b/recipes/apr/all/conanfile.py index 932bac9dcf2ea..2f5b13dc054ed 100644 --- a/recipes/apr/all/conanfile.py +++ b/recipes/apr/all/conanfile.py @@ -1,3 +1,6 @@ +import os +import re + from conan import ConanFile from conan.errors import ConanException, ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name @@ -9,8 +12,6 @@ from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc from conan.tools.scm import Version -import os -import re required_conan_version = ">=1.54.0" @@ -69,7 +70,20 @@ def layout(self): def validate_build(self): if cross_building(self) and not is_msvc(self): - raise ConanInvalidConfiguration("apr recipe doesn't support cross-build yet due to runtime checks in autoconf") + msg = ("apr recipe doesn't support cross-build for all the platforms" + " due to runtime checks in autoconf. You can provide" + " a pre-built cached file as an user Conan conf variable to try it.\n\n" + "Via host profile:\n" + "[conf]\nuser.apr:cache_file=/path/to/cache_file\n\n" + "Via CLI: \n" + "-c \"user.apr:cache_file='/path/to/cache_file'\"") + # Cross-building for apr < 1.7.4 is not supported without a pre-built cached file + if Version(self.version) < "1.7.4" and self.conf.get("user.apr:cache_file") is None: + raise ConanInvalidConfiguration(msg) + # Conan provides for apr >= 1.7.4 and Linux some configuration flags to avoid + # entering a pre-built cached file + if self.settings.os != "Linux" and self.conf.get("user.apr:cache_file") is None: + raise ConanInvalidConfiguration(msg) def build_requirements(self): if not is_msvc(self): @@ -83,6 +97,47 @@ def build_requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def _get_cross_building_configure_args(self): + """ + The vast majority of projects that use autotools and make use of the AC_TRY_RUN macro, + do provide a default fallback when cross-compiling, as per the documentation here: + + * https://ftp.gnu.org/old-gnu/Manuals/autoconf-2.53/html_node/Test-Programs.html + + In that regard, APR cannot be cross-compiled by traditional means, and the only fallback + is to use a cache file. Indeed, the only way to cross-compile that is documented by upstream + is by pre-empting the configuration checks with a cache file that needs to be generated on + the target system: + + ./configure --cache-file={gnu_host_triplet}.cache + + The generated cache file can be repeatedly used to cross-compile to the targeted host system + by including it with the recipe data. + + This recipe is reading this custom user conf variable: + + [conf] + user.apr:cache_file=/path/to/{gnu_host_triplet}.cache + + So you can use it to cross-compile on your system. + """ + configure_args = [] + user_cache_file = self.conf.get("user.apr:cache_file", check_type=str) + if user_cache_file: + configure_args.append(f"--cache-file={user_cache_file}") + return configure_args + + self.output.warning("Trying to set some configuration arguments, but it" + " could fail. The best approach is to provide a" + " pre-built cached file.") + if self.settings.os == "Linux": + # Mandatory cross-building configuration flags (tested on Linux ARM and Intel) + configure_args.extend(["apr_cv_mutex_robust_shared=yes", + "ac_cv_file__dev_zero=yes", + "apr_cv_process_shared_works=yes", + "apr_cv_tcp_nodelay_with_cork=yes"]) + return configure_args + def generate(self): if is_msvc(self): tc = CMakeToolchain(self) @@ -95,7 +150,7 @@ def generate(self): tc = AutotoolsToolchain(self) tc.configure_args.append("--with-installbuilddir=${prefix}/res/build-1") if cross_building(self): - tc.configure_args.append("apr_cv_mutex_robust_shared=yes") + tc.configure_args.extend(self._get_cross_building_configure_args()) tc.generate() def _patch_sources(self): diff --git a/recipes/apr/all/test_package/CMakeLists.txt b/recipes/apr/all/test_package/CMakeLists.txt index c82ee1f7cca4b..8a56957c2a8fd 100644 --- a/recipes/apr/all/test_package/CMakeLists.txt +++ b/recipes/apr/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(apr REQUIRED CONFIG) diff --git a/recipes/apr/all/test_v1_package/CMakeLists.txt b/recipes/apr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/apr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/apr/all/test_v1_package/conanfile.py b/recipes/apr/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/apr/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_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/apriltag/all/conandata.yml b/recipes/apriltag/all/conandata.yml index 612b22768b3e7..cdf1bd2eb180f 100644 --- a/recipes/apriltag/all/conandata.yml +++ b/recipes/apriltag/all/conandata.yml @@ -1,20 +1,13 @@ sources: + "3.4.2": + url: "https://github.com/AprilRobotics/apriltag/archive/refs/tags/v3.4.2.tar.gz" + sha256: "7e021bab89f136aa3cf736f772a635aaa353f93f6f8859495f4bd8c519be4805" "3.1.4": url: "https://github.com/AprilRobotics/apriltag/archive/refs/tags/v3.1.4.tar.gz" sha256: "ad2888d432e9ddcad2f639f243479934a4cd677ed5d2f8dee3b3418617b64f5d" - "3.1.2": - url: "https://github.com/AprilRobotics/apriltag/archive/3.1.2.tar.gz" - sha256: "2759b044ff1dc9ef725e7c456b49283399ef78deee24754bc3617cbe369584f1" - "3.1.1": - url: "https://github.com/AprilRobotics/apriltag/archive/3.1.1.tar.gz" - sha256: "7349e1fcc8b2979230b46c0d62ccf2ba2bbd611d87ef80cfd37ffe74425f5efb" patches: "3.1.4": - - patch_file: "patches/3.1.4-0001-fix-cmake.patch" - - patch_file: "patches/3.1.1-0002-windows-nominmax.patch" - "3.1.2": - - patch_file: "patches/3.1.2-0001-fix-cmake.patch" - - patch_file: "patches/3.1.1-0002-windows-nominmax.patch" - "3.1.1": - - patch_file: "patches/3.1.1-0001-fix-cmake.patch" - - patch_file: "patches/3.1.1-0002-windows-nominmax.patch" + - patch_file: "patches/3.1.4-0001-disable-examples.patch" + patch_type: "conan" + patch_description: "Disable building of examples" + - patch_file: "patches/3.1.4-0002-fix-cmake.patch" diff --git a/recipes/apriltag/all/conanfile.py b/recipes/apriltag/all/conanfile.py index c5ee7a9043fc1..8c9220521508c 100644 --- a/recipes/apriltag/all/conanfile.py +++ b/recipes/apriltag/all/conanfile.py @@ -1,6 +1,6 @@ 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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import Version @@ -11,10 +11,10 @@ class ApriltagConan(ConanFile): name = "apriltag" - description = ("AprilTag is a visual fiducial system, useful for a wide variety of tasks \ - including augmented reality, robotics, and camera calibration") + description = ("AprilTag is a visual fiducial system, useful for a wide variety of tasks" + " including augmented reality, robotics, and camera calibration") homepage = "https://april.eecs.umich.edu/software/apriltag" - topics = ("robotics",) + topics = ("robotics", "computer-vision", "augmented-reality", "camera-calibration") license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" package_type = "library" @@ -45,24 +45,28 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if is_msvc(self): + if is_msvc(self) and Version(self.version) < "3.3.0": self.requires("pthreads4w/3.0.0", transitive_headers=True) - def validate(self): - if is_msvc(self) and self.settings.build_type == "Debug": - # segfault in test package... - raise ConanInvalidConfiguration(f"{self.ref} doesn't support Debug with msvc yet") + def build_requirements(self): + if Version(self.version) >= "3.4.0": + self.tool_requires("cmake/[>=3.16 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + VirtualBuildEnv(self).generate() tc = CMakeToolchain(self) - if Version(self.version) >= "3.1.4": - tc.variables["BUILD_PYTHON_WRAPPER"] = False - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.cache_variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_PYTHON_WRAPPER"] = False + if Version(self.version) < "3.4.0": + # Newer versions set it in the project CMakelists.txt + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if self.settings.os == "Windows": + tc.preprocessor_definitions["NOMINMAX"] = "" tc.generate() - if is_msvc(self): + if is_msvc(self) and Version(self.version) < "3.3.0": deps = CMakeDeps(self) deps.generate() @@ -73,7 +77,7 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + 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, "share")) @@ -83,9 +87,13 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "apriltag") self.cpp_info.set_property("cmake_target_name", "apriltag::apriltag") self.cpp_info.set_property("pkg_config_name", "apriltag") - self.cpp_info.libs = ["apriltag"] + suffix = "" + if self.settings.build_type == "Debug" and Version(self.version) >= "3.2.0": + suffix = "d" + self.cpp_info.libs = ["apriltag" + suffix] self.cpp_info.includedirs.append(os.path.join("include", "apriltag")) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m", "pthread"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["winmm"] + self.cpp_info.defines.append("NOMINMAX") diff --git a/recipes/apriltag/all/patches/3.1.1-0001-fix-cmake.patch b/recipes/apriltag/all/patches/3.1.1-0001-fix-cmake.patch deleted file mode 100644 index 74b09907feed6..0000000000000 --- a/recipes/apriltag/all/patches/3.1.1-0001-fix-cmake.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,24 +1,29 @@ --cmake_minimum_required(VERSION 3.1) --project(apriltag) -+cmake_minimum_required(VERSION 3.8) -+project(apriltag LANGUAGES C) - --find_package(OpenCV QUIET) - - include_directories(.) - aux_source_directory(common COMMON_SRC) - aux_source_directory(. APRILTAG_SRCS) - --set(CMAKE_BUILD_TYPE Release) - - # Library --add_library(${PROJECT_NAME} SHARED ${APRILTAG_SRCS} ${COMMON_SRC}) -+add_library(${PROJECT_NAME} ${APRILTAG_SRCS} ${COMMON_SRC}) -+target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) - if (MSVC) - # FindThreads will not find pthread.h with MSVC - # winmm is necessary for __imp_timeGetTime -- find_library(PTHREAD_LIBRARIES NAMES pthreads) -- target_link_libraries(${PROJECT_NAME} ${PTHREAD_LIBRARIES} winmm) -+ find_package(pthreads4w REQUIRED CONFIG) -+ target_link_libraries(${PROJECT_NAME} pthreads4w::pthreads4w winmm) -+ target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) - else() - find_package(Threads REQUIRED) -- target_link_libraries(${PROJECT_NAME} Threads::Threads m) -+ target_link_libraries(${PROJECT_NAME} Threads::Threads) -+ include(CheckFunctionExists) -+ check_function_exists(pow HAVE_MATH_SYSTEM) -+ if(NOT HAVE_MATH_SYSTEM) -+ target_link_libraries(${PROJECT_NAME} m) -+ endif() - endif() - - set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 3 VERSION 3.1.0) -@@ -39,6 +43,7 @@ set_source_files_properties(SOURCE ${TAG_FILES} PROPERTIES COMPILE_FLAGS -O0) - - # install library - install(TARGETS ${PROJECT_NAME} EXPORT apriltag -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) -@@ -63,16 +68,13 @@ install(FILES "${PROJECT_BINARY_DIR}/apriltag.pc" DESTINATION "lib/pkgconfig/") - - # Examples - # apriltag_demo --add_executable(apriltag_demo example/apriltag_demo.c) --target_link_libraries(apriltag_demo apriltag) - - # opencv_demo --if(OpenCV_FOUND) -+if(0) - add_executable(opencv_demo example/opencv_demo.cc) - target_link_libraries(opencv_demo apriltag ${OpenCV_LIBRARIES}) - install(TARGETS opencv_demo RUNTIME DESTINATION bin) --endif(OpenCV_FOUND) -+endif() - - # install example programs --install(TARGETS apriltag_demo RUNTIME DESTINATION bin) - diff --git a/recipes/apriltag/all/patches/3.1.1-0002-windows-nominmax.patch b/recipes/apriltag/all/patches/3.1.1-0002-windows-nominmax.patch deleted file mode 100644 index 6ca9d00b5704e..0000000000000 --- a/recipes/apriltag/all/patches/3.1.1-0002-windows-nominmax.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/common/time_util.h -+++ b/common/time_util.h -@@ -30,6 +30,7 @@ either expressed or implied, of the Regents of The University of Michigan. - #include - #include - #ifdef _WIN32 -+#define NOMINMAX - #include - typedef long long suseconds_t; - #endif ---- a/common/workerpool.c -+++ b/common/workerpool.c -@@ -33,6 +33,7 @@ either expressed or implied, of the Regents of The University of Michigan. - #include - #include - #ifdef _WIN32 -+#define NOMINMAX - #include - #else - #include diff --git a/recipes/apriltag/all/patches/3.1.2-0001-fix-cmake.patch b/recipes/apriltag/all/patches/3.1.2-0001-fix-cmake.patch deleted file mode 100644 index 58464b0668d96..0000000000000 --- a/recipes/apriltag/all/patches/3.1.2-0001-fix-cmake.patch +++ /dev/null @@ -1,83 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,26 +1,31 @@ --cmake_minimum_required(VERSION 3.1) --project(apriltag) -+cmake_minimum_required(VERSION 3.8) -+project(apriltag LANGUAGES C) - --find_package(OpenCV QUIET) - - include_directories(.) - aux_source_directory(common COMMON_SRC) - set(APRILTAG_SRCS apriltag.c apriltag_pose.c apriltag_quad_thresh.c) - --set(CMAKE_BUILD_TYPE Release) - - # Library - file(GLOB TAG_FILES ${CMAKE_SOURCE_DIR}/tag*.c) - set_source_files_properties(SOURCE ${TAG_FILES} PROPERTIES COMPILE_FLAGS -O0) --add_library(${PROJECT_NAME} SHARED ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) -+add_library(${PROJECT_NAME} ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) -+target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) - if (MSVC) - # FindThreads will not find pthread.h with MSVC - # winmm is necessary for __imp_timeGetTime -- find_library(PTHREAD_LIBRARIES NAMES pthreads) -- target_link_libraries(${PROJECT_NAME} ${PTHREAD_LIBRARIES} winmm) -+ find_package(pthreads4w REQUIRED CONFIG) -+ target_link_libraries(${PROJECT_NAME} pthreads4w::pthreads4w winmm) -+ target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) - else() - find_package(Threads REQUIRED) -- target_link_libraries(${PROJECT_NAME} Threads::Threads m) -+ target_link_libraries(${PROJECT_NAME} Threads::Threads) -+ include(CheckFunctionExists) -+ check_function_exists(pow HAVE_MATH_SYSTEM) -+ if(NOT HAVE_MATH_SYSTEM) -+ target_link_libraries(${PROJECT_NAME} m) -+ endif() - endif() - - set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 3 VERSION 3.1.0) -@@ -39,6 +43,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES - - # install library - install(TARGETS ${PROJECT_NAME} EXPORT apriltag -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) -@@ -63,6 +68,7 @@ install(FILES "${PROJECT_BINARY_DIR}/apriltag.pc" DESTINATION "lib/pkgconfig/") - - - # Python wrapper -+if(0) - SET(Python_ADDITIONAL_VERSIONS 3) - find_package(PythonLibs) - execute_process(COMMAND which python3 OUTPUT_QUIET RESULT_VARIABLE Python3_NOT_FOUND) -@@ -95,21 +101,19 @@ execute_process(COMMAND python3 -m site --user-site OUTPUT_VARIABLE PY_DEST) - string(STRIP ${PY_DEST} PY_DEST) - install(CODE "execute_process(COMMAND cp ${PROJECT_BINARY_DIR}/apriltag${PY_EXT_SUFFIX} ${PY_DEST})") - endif (NOT Python3_NOT_FOUND AND NOT Numpy_NOT_FOUND AND PYTHONLIBS_FOUND) -+endif() - - - # Examples - # apriltag_demo --add_executable(apriltag_demo example/apriltag_demo.c) --target_link_libraries(apriltag_demo apriltag) - - # opencv_demo --if(OpenCV_FOUND) -+if(0) - add_executable(opencv_demo example/opencv_demo.cc) - target_link_libraries(opencv_demo apriltag ${OpenCV_LIBRARIES}) - set_target_properties(opencv_demo PROPERTIES CXX_STANDARD 11) - install(TARGETS opencv_demo RUNTIME DESTINATION bin) --endif(OpenCV_FOUND) -+endif() - - # install example programs --install(TARGETS apriltag_demo RUNTIME DESTINATION bin) - diff --git a/recipes/apriltag/all/patches/3.1.4-0001-disable-examples.patch b/recipes/apriltag/all/patches/3.1.4-0001-disable-examples.patch new file mode 100644 index 0000000000000..a3696589cece2 --- /dev/null +++ b/recipes/apriltag/all/patches/3.1.4-0001-disable-examples.patch @@ -0,0 +1,15 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -101,6 +101,7 @@ + + + # Examples ++if(BUILD_EXAMPLES) + # apriltag_demo + add_executable(apriltag_demo example/apriltag_demo.c) + target_link_libraries(apriltag_demo apriltag) +@@ -115,3 +116,4 @@ + + # install example programs + install(TARGETS apriltag_demo RUNTIME DESTINATION bin) ++endif() diff --git a/recipes/apriltag/all/patches/3.1.4-0001-fix-cmake.patch b/recipes/apriltag/all/patches/3.1.4-0001-fix-cmake.patch deleted file mode 100644 index ba813f1dc3969..0000000000000 --- a/recipes/apriltag/all/patches/3.1.4-0001-fix-cmake.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,26 +1,31 @@ --cmake_minimum_required(VERSION 3.1) --project(apriltag) -+cmake_minimum_required(VERSION 3.8) -+project(apriltag LANGUAGES C) - --find_package(OpenCV QUIET) - - include_directories(.) - aux_source_directory(common COMMON_SRC) - set(APRILTAG_SRCS apriltag.c apriltag_pose.c apriltag_quad_thresh.c) - --set(CMAKE_BUILD_TYPE Release) - - # Library - file(GLOB TAG_FILES ${PROJECT_SOURCE_DIR}/tag*.c) - set_source_files_properties(SOURCE ${TAG_FILES} PROPERTIES COMPILE_FLAGS -O0) --add_library(${PROJECT_NAME} SHARED ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) -+add_library(${PROJECT_NAME} ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) -+target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) - if (MSVC) - # FindThreads will not find pthread.h with MSVC - # winmm is necessary for __imp_timeGetTime -- find_library(PTHREAD_LIBRARIES NAMES pthreads) -- target_link_libraries(${PROJECT_NAME} ${PTHREAD_LIBRARIES} winmm) -+ find_package(pthreads4w REQUIRED CONFIG) -+ target_link_libraries(${PROJECT_NAME} pthreads4w::pthreads4w winmm) -+ target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) - else() - find_package(Threads REQUIRED) -- target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads m) -+ target_link_libraries(${PROJECT_NAME} Threads::Threads) -+ include(CheckFunctionExists) -+ check_function_exists(pow HAVE_MATH_SYSTEM) -+ if(NOT HAVE_MATH_SYSTEM) -+ target_link_libraries(${PROJECT_NAME} m) -+ endif() - endif() - - set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 3 VERSION 3.1.0) -@@ -33,6 +37,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC - - # install library - install(TARGETS ${PROJECT_NAME} EXPORT apriltagTargets -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) -@@ -102,16 +107,13 @@ endif (NOT Python3_NOT_FOUND AND NOT Numpy_NOT_FOUND AND PYTHONLIBS_FOUND AND BU - - # Examples - # apriltag_demo --add_executable(apriltag_demo example/apriltag_demo.c) --target_link_libraries(apriltag_demo apriltag) - - # opencv_demo --if(OpenCV_FOUND) -+if(0) - add_executable(opencv_demo example/opencv_demo.cc) - target_link_libraries(opencv_demo apriltag ${OpenCV_LIBRARIES}) - set_target_properties(opencv_demo PROPERTIES CXX_STANDARD 11) - install(TARGETS opencv_demo RUNTIME DESTINATION bin) --endif(OpenCV_FOUND) -+endif() - - # install example programs --install(TARGETS apriltag_demo RUNTIME DESTINATION bin) diff --git a/recipes/apriltag/all/patches/3.1.4-0002-fix-cmake.patch b/recipes/apriltag/all/patches/3.1.4-0002-fix-cmake.patch new file mode 100644 index 0000000000000..7baec487b4ea0 --- /dev/null +++ b/recipes/apriltag/all/patches/3.1.4-0002-fix-cmake.patch @@ -0,0 +1,50 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,26 +1,31 @@ +-cmake_minimum_required(VERSION 3.1) +-project(apriltag) ++cmake_minimum_required(VERSION 3.15) ++project(apriltag LANGUAGES C) + +-find_package(OpenCV QUIET) + + include_directories(.) + aux_source_directory(common COMMON_SRC) + set(APRILTAG_SRCS apriltag.c apriltag_pose.c apriltag_quad_thresh.c) + +-set(CMAKE_BUILD_TYPE Release) + + # Library + file(GLOB TAG_FILES ${PROJECT_SOURCE_DIR}/tag*.c) + set_source_files_properties(SOURCE ${TAG_FILES} PROPERTIES COMPILE_FLAGS -O0) +-add_library(${PROJECT_NAME} SHARED ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) ++add_library(${PROJECT_NAME} ${APRILTAG_SRCS} ${COMMON_SRC} ${TAG_FILES}) ++target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) + if (MSVC) + # FindThreads will not find pthread.h with MSVC + # winmm is necessary for __imp_timeGetTime +- find_library(PTHREAD_LIBRARIES NAMES pthreads) +- target_link_libraries(${PROJECT_NAME} ${PTHREAD_LIBRARIES} winmm) ++ find_package(pthreads4w REQUIRED CONFIG) ++ target_link_libraries(${PROJECT_NAME} pthreads4w::pthreads4w winmm) ++ target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) + else() + find_package(Threads REQUIRED) +- target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads m) ++ target_link_libraries(${PROJECT_NAME} Threads::Threads) ++ include(CheckFunctionExists) ++ check_function_exists(pow HAVE_MATH_SYSTEM) ++ if(NOT HAVE_MATH_SYSTEM) ++ target_link_libraries(${PROJECT_NAME} m) ++ endif() + endif() + + set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 3 VERSION 3.1.0) +@@ -35,6 +30,7 @@ + install(TARGETS ${PROJECT_NAME} EXPORT apriltagTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + + # install header file hierarchy diff --git a/recipes/apriltag/all/test_package/CMakeLists.txt b/recipes/apriltag/all/test_package/CMakeLists.txt index 61df950dde2ef..7c90500a7fe82 100644 --- a/recipes/apriltag/all/test_package/CMakeLists.txt +++ b/recipes/apriltag/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(apriltag REQUIRED CONFIG) diff --git a/recipes/apriltag/all/test_package/test_package.c b/recipes/apriltag/all/test_package/test_package.c index 098b0a3741e4d..78f28e3f94542 100644 --- a/recipes/apriltag/all/test_package/test_package.c +++ b/recipes/apriltag/all/test_package/test_package.c @@ -10,8 +10,8 @@ int main(int argc, char *argv[]) apriltag_family_t *tf = tagStandard41h12_create(); apriltag_detector_add_family(td, tf); - tagStandard41h12_destroy(tf); apriltag_detector_destroy(td); + tagStandard41h12_destroy(tf); printf("Apriltag test_package ran successfully\n"); diff --git a/recipes/apriltag/all/test_v1_package/CMakeLists.txt b/recipes/apriltag/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/apriltag/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/apriltag/all/test_v1_package/conanfile.py b/recipes/apriltag/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/apriltag/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_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/apriltag/config.yml b/recipes/apriltag/config.yml index 6aa1925bfcd8e..0471f5090e86a 100644 --- a/recipes/apriltag/config.yml +++ b/recipes/apriltag/config.yml @@ -1,7 +1,5 @@ versions: - "3.1.4": - folder: all - "3.1.2": + "3.4.2": folder: all - "3.1.1": + "3.1.4": folder: all diff --git a/recipes/aravis/all/conandata.yml b/recipes/aravis/all/conandata.yml index 768365163e373..07eea0a5354b4 100644 --- a/recipes/aravis/all/conandata.yml +++ b/recipes/aravis/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.33": + url: "https://github.com/AravisProject/aravis/releases/download/0.8.33/aravis-0.8.33.tar.xz" + sha256: "3c4409a12ea70bba4de25e5b08c777112de854bc801896594f2cb6f8c2bd6fbc" "0.8.30": url: "https://github.com/AravisProject/aravis/releases/download/0.8.30/aravis-0.8.30.tar.xz" sha256: "40380f06fa04524a7875bd456e5a5ea78b2c058fa84b5598bc6e0642fcef00b0" @@ -8,9 +11,6 @@ sources: "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" @@ -24,7 +24,3 @@ patches: - 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 19795c53aec2d..1b412478f26e7 100644 --- a/recipes/aravis/all/conanfile.py +++ b/recipes/aravis/all/conanfile.py @@ -33,7 +33,6 @@ class AravisConan(ConanFile): "gst_plugin": [True, False], "tools": [True, False], "introspection": [True, False], - "gv_n_buffers": ["ANY"], } default_options = { "shared": False, @@ -43,7 +42,6 @@ class AravisConan(ConanFile): "gst_plugin": False, "tools": True, "introspection": False, - "gv_n_buffers": 16, } def export_sources(self): @@ -54,10 +52,6 @@ def config_options(self): del self.options.fPIC 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: @@ -72,8 +66,8 @@ def layout(self): def requirements(self): # glib-object.h and gio/gio.h are used in several public headers - self.requires("glib/2.78.0", transitive_headers=True) - self.requires("libxml2/2.11.4") + self.requires("glib/2.78.3", transitive_headers=True) + self.requires("libxml2/[>=2.12.5 <3]") self.requires("zlib/[>=1.2.11 <2]") if self.options.usb: @@ -93,21 +87,12 @@ def validate(self): "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): #windows build: meson/1.2.1 works, meson/1.2.2 breaks for some reason! - self.tool_requires("meson/1.2.1") + self.tool_requires("meson/1.4.0") self.tool_requires("glib/") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") if self.options.introspection: self.tool_requires("gobject-introspection/1.72.0") @@ -129,10 +114,6 @@ 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() diff --git a/recipes/aravis/all/patches/0.8.19-gst-shared-lib.patch b/recipes/aravis/all/patches/0.8.19-gst-shared-lib.patch deleted file mode 100644 index fec845831e656..0000000000000 --- a/recipes/aravis/all/patches/0.8.19-gst-shared-lib.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gst/meson.build -+++ b/gst/meson.build -@@ -15,7 +15,7 @@ gst_c_args = [ - - 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_v1_package/CMakeLists.txt b/recipes/aravis/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/aravis/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/aravis/all/test_v1_package/conanfile.py b/recipes/aravis/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/aravis/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_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/aravis/config.yml b/recipes/aravis/config.yml index 1aa8532edf0e6..456a2949d4232 100644 --- a/recipes/aravis/config.yml +++ b/recipes/aravis/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.33": + folder: all "0.8.30": folder: all "0.8.29": @@ -6,5 +8,3 @@ versions: # 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/test_v1_package/CMakeLists.txt b/recipes/archicad-apidevkit/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 50f1488b009a2..0000000000000 --- a/recipes/archicad-apidevkit/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) - - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS KEEP_RPATHS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/archicad-apidevkit/all/test_v1_package/conanfile.py b/recipes/archicad-apidevkit/all/test_v1_package/conanfile.py deleted file mode 100644 index af4b5cc85f42f..0000000000000 --- a/recipes/archicad-apidevkit/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake -from conan.errors import ConanInvalidConfiguration -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/arcus/all/conanfile.py b/recipes/arcus/all/conanfile.py index 8f6e301a39313..38ae3416bb350 100644 --- a/recipes/arcus/all/conanfile.py +++ b/recipes/arcus/all/conanfile.py @@ -45,7 +45,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("protobuf/3.21.9") + self.requires("protobuf/3.21.12") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/arcus/all/test_package/CMakeLists.txt b/recipes/arcus/all/test_package/CMakeLists.txt index 376d65791e678..bb3479bb1681f 100644 --- a/recipes/arcus/all/test_package/CMakeLists.txt +++ b/recipes/arcus/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(Arcus REQUIRED CONFIG) diff --git a/recipes/arcus/all/test_v1_package/CMakeLists.txt b/recipes/arcus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/arcus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/arcus/all/test_v1_package/conanfile.py b/recipes/arcus/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/arcus/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_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/arduinojson/all/conandata.yml b/recipes/arduinojson/all/conandata.yml index d44d34b58314d..83b7c3024a58d 100644 --- a/recipes/arduinojson/all/conandata.yml +++ b/recipes/arduinojson/all/conandata.yml @@ -1,10 +1,10 @@ sources: - "6.21.2": - url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.2/ArduinoJson-v6.21.2.zip" - sha256: "1dc888061f6e7828f7a0a4e71bf059796e5ce202ce6ddb4e3a2e384d32b5cba0" - "6.21.0": - url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.0/ArduinoJson-v6.21.0.zip" - sha256: "08f7cad5fca2393c40fcb479c43235a2fa7da1a40331377ddf617eda2f123583" + "7.0.1": + url: "https://github.com/bblanchon/ArduinoJson/archive/refs/tags/v7.0.1.tar.gz" + sha256: "85fd778a6aae9b1a249b4c090c6f8621c9c8ceaf9479a3cb07e3033325bf2ae2" + "6.21.4": + url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.4/ArduinoJson-v6.21.4.zip" + sha256: "60a5c4cd28d97047f63a1f9c9e8bd36a72c8b4c86809babcc2bd4b00e0502b9b" "6.20.1": url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.20.1/ArduinoJson-v6.20.1.zip" sha256: "3dc53f55dcb6913b9a097263852ddc7c030f6d93c8cf00efb5d0eff3dd4bd8b9" @@ -14,9 +14,6 @@ sources: "6.18.5": url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.18.5/ArduinoJson-v6.18.5.zip" sha256: "f10a904fa1f6372ee069ed2a5eff50530a29e9c10958a5bd24ce62eda7f7d74e" - "6.18.0": - url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.18.0/ArduinoJson-v6.18.0.zip" - sha256: "2ade6a0097845d6bc0292a7f9ffa58cbd7e11a34a26616ac9e40a7754a18f1a9" "6.16.1": url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.16.1/ArduinoJson-v6.16.1.zip" sha256: "d8cab18d50a9487766e195c68c14a552403994ecae3e5051d509e62914444ecd" diff --git a/recipes/arduinojson/all/conanfile.py b/recipes/arduinojson/all/conanfile.py index 74cc1a0a27699..ea98680d446ff 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" @@ -35,7 +35,7 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) def source(self): - has_arduinojson_root=Version(self.version) < "6.18.2" + has_arduinojson_root = not ("6.18.2" <= Version(self.version) < "7.0") get(self, **self.conan_data["sources"][self.version], strip_root=has_arduinojson_root) def build(self): diff --git a/recipes/arduinojson/all/test_package/CMakeLists.txt b/recipes/arduinojson/all/test_package/CMakeLists.txt index 759822ccd5496..ef0ab6ac72173 100644 --- a/recipes/arduinojson/all/test_package/CMakeLists.txt +++ b/recipes/arduinojson/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(ArduinoJson REQUIRED CONFIG) diff --git a/recipes/arduinojson/all/test_v1_package/CMakeLists.txt b/recipes/arduinojson/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/arduinojson/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/arduinojson/all/test_v1_package/conanfile.py b/recipes/arduinojson/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/arduinojson/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_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/arduinojson/config.yml b/recipes/arduinojson/config.yml index 3358de6326521..b6153cf1cddb2 100644 --- a/recipes/arduinojson/config.yml +++ b/recipes/arduinojson/config.yml @@ -1,7 +1,7 @@ versions: - "6.21.2": + "7.0.1": folder: all - "6.21.0": + "6.21.4": folder: all "6.20.1": folder: all @@ -9,8 +9,6 @@ versions: folder: all "6.18.5": folder: all - "6.18.0": - folder: all "6.16.1": folder: all "6.15.2": diff --git a/recipes/arg_router/all/test_v1_package/CMakeLists.txt b/recipes/arg_router/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8689ccd828863..0000000000000 --- a/recipes/arg_router/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.15) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/arg_router/all/test_v1_package/conanfile.py b/recipes/arg_router/all/test_v1_package/conanfile.py deleted file mode 100644 index ea5b012df89c5..0000000000000 --- a/recipes/arg_router/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,23 +0,0 @@ -import os - -from conans import ConanFile, CMake -from conan.tools.build import cross_building - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" - - 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): - cmd = os.path.join(self.cpp.build.bindir, - "conan_test_project") + " --help" - self.run(cmd, env="conanrun") diff --git a/recipes/argh/all/test_package/CMakeLists.txt b/recipes/argh/all/test_package/CMakeLists.txt index fcd79af5da306..40dd92341642b 100644 --- a/recipes/argh/all/test_package/CMakeLists.txt +++ b/recipes/argh/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(argh REQUIRED CONFIG) diff --git a/recipes/argh/all/test_v1_package/CMakeLists.txt b/recipes/argh/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/argh/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/argh/all/test_v1_package/conanfile.py b/recipes/argh/all/test_v1_package/conanfile.py deleted file mode 100644 index c394e09142659..0000000000000 --- a/recipes/argh/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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): - self.run(os.path.join("bin", "test_package")) diff --git a/recipes/argon2/all/test_package/CMakeLists.txt b/recipes/argon2/all/test_package/CMakeLists.txt index 665425a420e57..6774218035f72 100644 --- a/recipes/argon2/all/test_package/CMakeLists.txt +++ b/recipes/argon2/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(argon2 REQUIRED CONFIG) diff --git a/recipes/argon2/all/test_v1_package/CMakeLists.txt b/recipes/argon2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/argon2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/argon2/all/test_v1_package/conanfile.py b/recipes/argon2/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/argon2/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_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/argparse/all/conandata.yml b/recipes/argparse/all/conandata.yml index 719dc54ae5a72..2cb5937d87388 100644 --- a/recipes/argparse/all/conandata.yml +++ b/recipes/argparse/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.2": + url: "https://github.com/p-ranav/argparse/archive/v3.2.tar.gz" + sha256: "9dcb3d8ce0a41b2a48ac8baa54b51a9f1b6a2c52dd374e28cc713bab0568ec98" + "3.1": + url: "https://github.com/p-ranav/argparse/archive/v3.1.tar.gz" + sha256: "d01733552ca4a18ab501ae8b8be878131baa32e89090fafdeef018ebfa4c6e46" "3.0": url: "https://github.com/p-ranav/argparse/archive/v3.0.tar.gz" sha256: "ba7b465759bb01069d57302855eaf4d1f7d677f21ad7b0b00b92939645c30f47" diff --git a/recipes/argparse/all/conanfile.py b/recipes/argparse/all/conanfile.py index 11300088df46e..cae941dd0cc89 100644 --- a/recipes/argparse/all/conanfile.py +++ b/recipes/argparse/all/conanfile.py @@ -75,12 +75,11 @@ def package(self): copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=include_dst) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "argparse") self.cpp_info.set_property("cmake_target_name", "argparse::argparse") self.cpp_info.set_property("pkg_config_name", "argparse") if Version(self.version) <= "2.1": self.cpp_info.includedirs.append(os.path.join("include", "argparse")) - self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] - self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/argparse/all/test_v1_package/CMakeLists.txt b/recipes/argparse/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/argparse/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/argparse/all/test_v1_package/conanfile.py b/recipes/argparse/all/test_v1_package/conanfile.py deleted file mode 100644 index a3b19a8d499a6..0000000000000 --- a/recipes/argparse/all/test_v1_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 = os.path.join("bin", "test_package") - val = 42 - self.run(f"{bin_path} {val}", run_environment=True) diff --git a/recipes/argparse/config.yml b/recipes/argparse/config.yml index fef29e0dad433..f0eb676c68755 100644 --- a/recipes/argparse/config.yml +++ b/recipes/argparse/config.yml @@ -1,4 +1,8 @@ versions: + "3.2": + folder: all + "3.1": + folder: all "3.0": folder: all "2.9": diff --git a/recipes/args-parser/all/conandata.yml b/recipes/args-parser/all/conandata.yml index 427c4c05d81dd..5a22686895e16 100644 --- a/recipes/args-parser/all/conandata.yml +++ b/recipes/args-parser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.3.4": + url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.3.4.tar.gz" + sha256: "874be94baac622e16045b958539e91347f18fc0803356fb500757c0060222aa2" "6.3.3": url: "https://github.com/igormironchik/args-parser/archive/refs/tags/6.3.3.tar.gz" sha256: "67867d7ab624a8c2f391230c54c37830e6127f7f5c716ff634165f674d876b64" diff --git a/recipes/args-parser/all/conanfile.py b/recipes/args-parser/all/conanfile.py index f4ea312819ef0..45b750c9e57c9 100644 --- a/recipes/args-parser/all/conanfile.py +++ b/recipes/args-parser/all/conanfile.py @@ -56,7 +56,10 @@ def build(self): pass def package(self): - copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) <= "6.3.3": + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, "MIT.txt", src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) copy(self, "*.hpp", src=os.path.join(self.source_folder, "args-parser"), dst=os.path.join(self.package_folder, "include", "args-parser")) def package_info(self): diff --git a/recipes/args-parser/all/test_package/CMakeLists.txt b/recipes/args-parser/all/test_package/CMakeLists.txt index 94b80c9c35998..fb44391de6f7f 100644 --- a/recipes/args-parser/all/test_package/CMakeLists.txt +++ b/recipes/args-parser/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(args-parser REQUIRED CONFIG) diff --git a/recipes/args-parser/all/test_v1_package/CMakeLists.txt b/recipes/args-parser/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/args-parser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/args-parser/all/test_v1_package/conanfile.py b/recipes/args-parser/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/args-parser/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_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/args-parser/config.yml b/recipes/args-parser/config.yml index b67bad0e21e0f..9b0a8042dbf5e 100644 --- a/recipes/args-parser/config.yml +++ b/recipes/args-parser/config.yml @@ -1,4 +1,6 @@ versions: + "6.3.4": + folder: all "6.3.3": folder: all "6.3.2": diff --git a/recipes/argtable2/all/test_package/CMakeLists.txt b/recipes/argtable2/all/test_package/CMakeLists.txt index 9ae95a47d2481..de3d8b5a57f85 100644 --- a/recipes/argtable2/all/test_package/CMakeLists.txt +++ b/recipes/argtable2/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(argtable2 REQUIRED CONFIG) diff --git a/recipes/argtable2/all/test_v1_package/CMakeLists.txt b/recipes/argtable2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/argtable2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/argtable2/all/test_v1_package/conanfile.py b/recipes/argtable2/all/test_v1_package/conanfile.py deleted file mode 100644 index 5c79f133054fa..0000000000000 --- a/recipes/argtable2/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_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(f"{bin_path} -n", run_environment=True) diff --git a/recipes/argtable3/all/conanfile.py b/recipes/argtable3/all/conanfile.py index 86aef097f8805..589d3eddbd370 100644 --- a/recipes/argtable3/all/conanfile.py +++ b/recipes/argtable3/all/conanfile.py @@ -2,10 +2,10 @@ from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.errors import ConanException import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class Argtable3Conan(ConanFile): @@ -49,6 +49,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["ARGTABLE3_ENABLE_TESTS"] = False + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "3.2.2": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): @@ -59,21 +62,6 @@ def build(self): cmake.configure() cmake.build() - @property - def _module_file_rel_path(self): - return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") - - 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 package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) @@ -82,13 +70,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - # These targets were for versions < 3.2.1 (newer create argtable3::argtable3) - target_name = "argtable3" if self.options.shared else "argtable3_static" - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {target_name: "argtable3::argtable3"} - ) - def package_info(self): suffix = "" if not self.options.shared: @@ -103,11 +84,3 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "argtable3::argtable3") # These targets were for versions < 3.2.1 (newer create argtable3::argtable3) self.cpp_info.set_property("cmake_target_aliases", ["argtable3" if self.options.shared else "argtable3_static"]) - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "Argtable3" - self.cpp_info.filenames["cmake_find_package_multi"] = "Argtable3" - self.cpp_info.names["cmake_find_package"] = "argtable3" - self.cpp_info.names["cmake_find_package_multi"] = "argtable3" - 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/argtable3/all/test_v1_package/CMakeLists.txt b/recipes/argtable3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/argtable3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/argtable3/all/test_v1_package/conanfile.py b/recipes/argtable3/all/test_v1_package/conanfile.py deleted file mode 100644 index b36b4025b8a6a..0000000000000 --- a/recipes/argtable3/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(f"{bin_path} --help", run_environment=True) diff --git a/recipes/argz/all/conandata.yml b/recipes/argz/all/conandata.yml new file mode 100644 index 0000000000000..a8b111b9078ce --- /dev/null +++ b/recipes/argz/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2.1": + url: "https://github.com/stephenberry/argz/archive/refs/tags/v0.2.1.tar.gz" + sha256: "1a9d85ef7e4722f81ce426c2cf8ceaa0a10cc42e7762cdf2465ae6484ece9c7e" diff --git a/recipes/argz/all/conanfile.py b/recipes/argz/all/conanfile.py new file mode 100644 index 0000000000000..1d0b4e30fd7e6 --- /dev/null +++ b/recipes/argz/all/conanfile.py @@ -0,0 +1,70 @@ +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 ArgzConan(ConanFile): + name = "argz" + description = "A light weight C++ in memory argument parser" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/stephenberry/argz" + topics = ("argument", "parser", "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": "11", + "clang": "12", + "apple-clang": "14", + "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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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 = [] + + self.cpp_info.set_property("cmake_file_name", "argz") + self.cpp_info.set_property("cmake_target_name", "argz::argz") diff --git a/recipes/argz/all/test_package/CMakeLists.txt b/recipes/argz/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8904da5a62a1d --- /dev/null +++ b/recipes/argz/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(argz REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE argz::argz) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/argz/all/test_package/conanfile.py b/recipes/argz/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/argz/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/argz/all/test_package/test_package.cpp b/recipes/argz/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8e6558ac798fa --- /dev/null +++ b/recipes/argz/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include + +int main(int argc, char* argv[]) { + constexpr std::string_view version = "1.2.3"; + argz::about about{ "My program description", version }; + + std::string input{}; + std::string study{}; + int number = 123; + bool boolean = true; + std::optional number_opt{}; + argz::options opts{ + { { "input", 'i' }, input, "the input file"}, + { { "study", 's' }, study, "a study file"}, + { { "number" }, number, "input an int"}, + { { "boolean" }, boolean, "a boolean" }, + { { "number_opt" }, number_opt, "input an int"} + }; + + try { + argz::parse(about, opts, argc, argv); + } + catch (const std::exception& e) { + std::cerr << e.what() << '\n'; + } + + return 0; +} diff --git a/recipes/argz/config.yml b/recipes/argz/config.yml new file mode 100644 index 0000000000000..f975c1e3261f7 --- /dev/null +++ b/recipes/argz/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.1": + folder: all diff --git a/recipes/armadillo/all/conanfile.py b/recipes/armadillo/all/conanfile.py index 88da815dbce2a..deb141bccf54c 100644 --- a/recipes/armadillo/all/conanfile.py +++ b/recipes/armadillo/all/conanfile.py @@ -1,13 +1,14 @@ from conan import ConanFile 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.files import copy, get, rmdir, apply_conandata_patches, export_conandata_patches, save 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 +import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class ArmadilloConan(ConanFile): @@ -58,7 +59,7 @@ class ArmadilloConan(ConanFile): "shared": False, "fPIC": True, "use_blas": "openblas", - "use_lapack": False, + "use_lapack": "openblas", "use_hdf5": True, "use_superlu": False, "use_extern_rng": False, @@ -102,11 +103,6 @@ def configure(self): 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" ) @@ -190,11 +186,11 @@ def requirements(self): if self.options.use_hdf5 and Version(self.version) < "12": # Use the conan dependency if the system lib isn't being used # 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) + self.requires("hdf5/1.14.3", transitive_headers=True, transitive_libs=not self.options.use_wrapper) if self.options.use_blas == "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) + self.requires("openblas/0.3.25", transitive_libs=not self.options.use_wrapper) if ( self.options.use_blas == "intel_mkl" and self.options.use_lapack == "intel_mkl" @@ -244,17 +240,15 @@ def generate(self): tc.variables["BUILD_SHARED_LIBS"] = self.options.shared tc.variables["BUILD_SMOKE_TEST"] = False tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if Version(self.version) < "14.0.0": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support{ tc.generate() deps = CMakeDeps(self) deps.generate() def source(self): - get(self, - **self.conan_data["sources"][self.version], - strip_root=True, - filename="f{self.name}-{self.version}.tar.xz" - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): apply_conandata_patches(self) @@ -263,6 +257,40 @@ def build(self): cmake.configure() cmake.build() + @property + def _get_arma_version_name(self): + version_file = os.path.join(self.source_folder, "include", "armadillo_bits", "arma_version.hpp") + with open(version_file, "r") as f: + for line in f: + if "ARMA_VERSION_NAME" in line: + return line.split("\"")[-2].strip() + return "" + + @property + def _module_vars_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(ARMADILLO_FOUND TRUE) + if(DEFINED Armadillo_INCLUDE_DIRS) + set(ARMADILLO_INCLUDE_DIRS ${{Armadillo_INCLUDE_DIRS}}) + endif() + if(DEFINED Armadillo_LIBRARIES) + set(ARMADILLO_LIBRARIES ${{Armadillo_LIBRARIES}}) + endif() + set(ARMADILLO_VERSION_MAJOR "{Version(self.version).major}") + set(ARMADILLO_VERSION_MINOR "{Version(self.version).minor}") + set(ARMADILLO_VERSION_PATCH "{Version(self.version).patch}") + if(DEFINED Armadillo_VERSION_STRING) + set(ARMADILLO_VERSION_STRING ${{Armadillo_VERSION_STRING}}) + else() + set(ARMADILLO_VERSION_STRING "${{ARMADILLO_VERSION_MAJOR}}.${{ARMADILLO_VERSION_MINOR}}.${{ARMADILLO_VERSION_PATCH}}") + endif() + set(ARMADILLO_VERSION_NAME "{self._get_arma_version_name}") + """) + save(self, module_file, content) + def package(self): cmake = CMake(self) cmake.install() @@ -271,10 +299,17 @@ def package(self): copy(self, "NOTICE.txt", 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, "share")) + self._create_cmake_module_variables(os.path.join(self.package_folder, self._module_vars_rel_path)) + def package_info(self): self.cpp_info.libs = ["armadillo"] self.cpp_info.set_property("pkg_config_name", "armadillo") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Armadillo") + self.cpp_info.set_property("cmake_target_name", "Armadillo::Armadillo") + self.cpp_info.set_property("cmake_target_aliases", ["armadillo", "armadillo::armadillo"]) + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path]) if self.options.get_safe("use_extern_rng"): self.cpp_info.defines.append("ARMA_USE_EXTERN_RNG") diff --git a/recipes/armadillo/all/test_package/CMakeLists.txt b/recipes/armadillo/all/test_package/CMakeLists.txt index da38c2d4cf348..7f0a114a2e9e8 100644 --- a/recipes/armadillo/all/test_package/CMakeLists.txt +++ b/recipes/armadillo/all/test_package/CMakeLists.txt @@ -1,12 +1,32 @@ cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -find_package(armadillo CONFIG REQUIRED) +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 ${HDF5_TARGETS}) +target_link_libraries(example Armadillo::Armadillo ${HDF5_TARGETS}) set_property(TARGET example PROPERTY CXX_STANDARD 11) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindArmadillo.html are properly defined + +set(_custom_vars + ARMADILLO_FOUND + ARMADILLO_INCLUDE_DIRS + ARMADILLO_LIBRARIES + ARMADILLO_VERSION_MAJOR + ARMADILLO_VERSION_MINOR + ARMADILLO_VERSION_PATCH + ARMADILLO_VERSION_STRING + ARMADILLO_VERSION_NAME +) +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/armadillo/all/test_v1_package/CMakeLists.txt b/recipes/armadillo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3ac69a9731274..0000000000000 --- a/recipes/armadillo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.6) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(armadillo REQUIRED) - -add_executable(example ../test_package/src/example.cpp) -target_link_libraries(example armadillo::armadillo) -set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/armadillo/all/test_v1_package/conanfile.py b/recipes/armadillo/all/test_v1_package/conanfile.py deleted file mode 100644 index 5eba7cbe1bb9c..0000000000000 --- a/recipes/armadillo/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -import os - -from conans import ConanFile, CMake, tools - - -class ArmadilloTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - 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", "example") - self.run(bin_path, run_environment=True) diff --git a/recipes/arrow/all/conandata.yml b/recipes/arrow/all/conandata.yml index 4edf7cbfb21e7..a370e59e006ee 100644 --- a/recipes/arrow/all/conandata.yml +++ b/recipes/arrow/all/conandata.yml @@ -1,85 +1,55 @@ sources: + "19.0.1": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-19.0.1/apache-arrow-19.0.1.tar.gz?action=download" + sha256: "acb76266e8b0c2fbb7eb15d542fbb462a73b3fd1e32b80fad6c2fafd95a51160" + "18.1.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-18.1.0/apache-arrow-18.1.0.tar.gz?action=download" + sha256: "2dc8da5f8796afe213ecc5e5aba85bb82d91520eff3cf315784a52d0fa61d7fc" + "18.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-18.0.0/apache-arrow-18.0.0.tar.gz?action=download" + sha256: "abcf1934cd0cdddd33664e9f2d9a251d6c55239d1122ad0ed223b13a583c82a9" + "17.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-17.0.0/apache-arrow-17.0.0.tar.gz?action=download" + sha256: "9d280d8042e7cf526f8c28d170d93bfab65e50f94569f6a790982a878d8d898d" + "16.1.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-16.1.0/apache-arrow-16.1.0.tar.gz?action=download" + sha256: "c9e60c7e87e59383d21b20dc874b17153729ee153264af6d21654b7dff2c60d7" + "15.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-15.0.0/apache-arrow-15.0.0.tar.gz?action=download" + sha256: "01dd3f70e85d9b5b933ec92c0db8a4ef504a5105f78d2d8622e84279fb45c25d" "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" - "11.0.0": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-11.0.0/apache-arrow-11.0.0.tar.gz?action=download" - sha256: "2dd8f0ea0848a58785628ee3a57675548d509e17213a2f5d72b0d900b43f5430" - "10.0.1": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.1/apache-arrow-10.0.1.tar.gz?action=download" - sha256: "c814e0670112a22c1a6ec03ab420a52ae236a9a42e9e438c3cbd37f37e658fb3" - "10.0.0": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.0/apache-arrow-10.0.0.tar.gz?action=download" - sha256: "5b46fa4c54f53e5df0019fe0f9d421e93fc906b625ebe8e89eed010d561f1f12" - "8.0.1": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.1/apache-arrow-8.0.1.tar.gz?action=download" - sha256: "82d46929f7574715551da21700f100b39f99c3c4d6790f26cac86d869d64e94e" - "8.0.0": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.0/apache-arrow-8.0.0.tar.gz?action=download" - sha256: "ad9a05705117c989c116bae9ac70492fe015050e1b80fb0e38fde4b5d863aaa3" - "7.0.0": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-7.0.0/apache-arrow-7.0.0.tar.gz?action=download" - sha256: "e8f49b149a15ecef4e40fcfab1b87c113c6b1ee186005c169e5cdf95d31a99de" - "2.0.0": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-2.0.0/apache-arrow-2.0.0.tar.gz?action=download" - sha256: "be0342cc847bb340d86aeaef43596a0b6c1dbf1ede9c789a503d939e01c71fbe" - "1.0.0": - url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-1.0.0/apache-arrow-1.0.0.tar.gz?action=download" - sha256: "86ddb9feb48203a5aaf9cc4f2827525e20a2ca4d7239e492af17e74532ccf243" patches: - "8.0.1": - - patch_file: "patches/8.0.0-0005-install-utils.patch" - patch_description: "enable utilis installation" + "19.0.1": + - patch_file: "patches/19.0.1-0001-fix-cmake.patch" + patch_description: "use cci package" patch_type: "conan" - - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + - patch_file: "patches/19.0.1-0002-fix-downloaded-mimalloc.patch" patch_description: "use cci package" patch_type: "conan" - "8.0.0": - - patch_file: "patches/8.0.0-0005-install-utils.patch" - patch_description: "enable utilis installation" + "18.1.0": + - patch_file: "patches/18.0.0-0001-fix-cmake.patch" + patch_description: "use cci package" patch_type: "conan" - - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + "18.0.0": + - patch_file: "patches/18.0.0-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" - "7.0.0": - - patch_file: "patches/7.0.0-0006-install-utils.patch" - patch_description: "enable utilis installation" + "17.0.0": + - patch_file: "patches/16.0.0-0001-fix-cmake.patch" + patch_description: "use cci package" patch_type: "conan" - - patch_file: "patches/7.0.0-0007-fix-cmake.patch" + "16.1.0": + - patch_file: "patches/16.0.0-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" - "2.0.0": - - patch_file: "patches/2.0.0-0003-fix-shared-msvc.patch" - patch_description: "make shared enabled in msvc" - patch_type: "official" - - patch_file: "patches/2.0.0-0005-gandiva-engine.patch" - patch_description: "fix grandiva compilation error" - patch_type: "official" - - patch_file: "patches/2.0.0-0008-fix-cmake.patch" + "15.0.0": + - patch_file: "patches/11.0.0-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" - "1.0.0": - - patch_file: "patches/1.0.0-0003-fix-shared-msvc.patch" - patch_description: "make shared enabled in msvc" - patch_type: "official" - - patch_file: "patches/1.0.0-0005-fix-make12-namespace.patch" - patch_description: "fix ambiguous `make12` function between std and date" - patch_type: "official" - - patch_file: "patches/1.0.0-0006-fix-cmake.patch" + "14.0.2": + - patch_file: "patches/11.0.0-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" + \ No newline at end of file diff --git a/recipes/arrow/all/conanfile.py b/recipes/arrow/all/conanfile.py index dcd80308b7b01..7aef9d284d64a 100644 --- a/recipes/arrow/all/conanfile.py +++ b/recipes/arrow/all/conanfile.py @@ -1,15 +1,15 @@ +import os + from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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 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 +required_conan_version = ">=2.1.0" -required_conan_version = ">=1.53.0" class ArrowConan(ConanFile): name = "arrow" @@ -71,47 +71,47 @@ class ArrowConan(ConanFile): "shared": False, "fPIC": True, "gandiva": False, - "parquet": "auto", + "parquet": True, "skyhook": False, "substrait": False, "acero": False, "cli": False, - "compute": "auto", - "dataset_modules": "auto", + "compute": False, + "dataset_modules": False, "deprecated": True, "encryption": False, - "filesystem_layer": False, + "filesystem_layer": True, "hdfs_bridgs": False, "plasma": "deprecated", "simd_level": "default", "runtime_simd_level": "max", "with_backtrace": False, - "with_boost": "auto", + "with_boost": True, "with_brotli": False, "with_bz2": False, "with_csv": False, "with_cuda": False, - "with_flight_rpc": "auto", + "with_flight_rpc": False, "with_flight_sql": False, "with_gcs": False, - "with_gflags": "auto", - "with_jemalloc": "auto", + "with_gflags": False, + "with_jemalloc": False, "with_mimalloc": False, - "with_glog": "auto", - "with_grpc": "auto", + "with_glog": False, + "with_grpc": False, "with_json": False, - "with_thrift": "auto", - "with_llvm": "auto", - "with_openssl": "auto", + "with_thrift": True, + "with_llvm": False, + "with_openssl": False, "with_opentelemetry": False, "with_orc": False, - "with_protobuf": "auto", - "with_re2": "auto", + "with_protobuf": False, + "with_re2": False, "with_s3": False, - "with_utf8proc": "auto", + "with_utf8proc": False, "with_lz4": False, "with_snappy": False, - "with_zlib": False, + "with_zlib": True, "with_zstd": False, } short_paths = True @@ -120,22 +120,7 @@ class ArrowConan(ConanFile): 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" - - @property - def _compilers_minimum_version(self): - return { - "11": { - "clang": "3.9", - }, - "17": { - "gcc": "8", - "clang": "7", - "apple-clang": "10", - "Visual Studio": "15", - "msvc": "191", - }, - }.get(self._min_cppstd, {}) + return "17" def export_sources(self): export_conandata_patches(self) @@ -144,35 +129,10 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) < "2.0.0": - del self.options.simd_level - del self.options.runtime_simd_level - elif Version(self.version) < "6.0.0": - self.options.simd_level = "sse4_2" - if Version(self.version) < "6.0.0": - del self.options.with_gcs - if Version(self.version) < "7.0.0": - del self.options.skyhook - del self.options.with_flight_sql - del self.options.with_opentelemetry - 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() + if is_msvc(self): + self.options.with_boost = True + if Version(self.version) >= "19.0.0": + self.options.with_mimalloc = True def configure(self): if self.options.shared: @@ -181,127 +141,20 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - 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): - if self.options.parquet == "auto": - return bool(self.options.get_safe("substrait", False)) - else: - return bool(self.options.parquet) - - 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): - 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): - 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()): - return True - return False - else: - return bool(self.options.with_re2) - - 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): - 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): - 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): - if self.options.with_glog == "auto": - return False - else: - return bool(self.options.with_glog) - - 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): - if self.options.with_boost == "auto": - if self.options.gandiva: - return True - version = Version(self.version) - if version.major == "1": - if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): - return True - elif version.major >= "2": - if is_msvc(self): - return True - return False - else: - return bool(self.options.with_boost) - - 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): - 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): - if self.options.with_llvm == "auto": - return bool(self.options.gandiva) - else: - return bool(self.options.with_llvm) - - 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 _requires_rapidjson(self): - if self.options.with_json: - return True - if Version(self.version) >= "7.0.0" and self.options.encryption: - return True - return False + return self.options.with_json or self.options.encryption def requirements(self): if self.options.with_thrift: - self.requires("thrift/0.17.0") + self.requires("thrift/0.20.0") if self.options.with_protobuf: - self.requires("protobuf/3.21.9") + self.requires("protobuf/3.21.12") if self.options.with_jemalloc: self.requires("jemalloc/5.3.0") if self.options.with_mimalloc: self.requires("mimalloc/1.7.6") if self.options.with_boost: - self.requires("boost/1.83.0") + self.requires("boost/1.85.0") if self.options.with_gflags: self.requires("gflags/2.2.2") if self.options.with_glog: @@ -332,43 +185,53 @@ def requirements(self): self.requires("lz4/1.9.4") if self.options.with_snappy: self.requires("snappy/1.1.9") - if Version(self.version) >= "6.0.0" and \ - self.options.get_safe("simd_level") != None or \ - self.options.get_safe("runtime_simd_level") != None: - self.requires("xsimd/9.0.1") + if self.options.get_safe("simd_level") != None or \ + self.options.get_safe("runtime_simd_level") != None: + self.requires("xsimd/13.0.0") if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: - self.requires("zstd/1.5.5") + self.requires("zstd/[>=1.5 <1.6]") 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") + if self.options.with_orc: + self.requires("orc/2.0.0") 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" + # Do not allow options with 'auto' value + # TODO: Remove "auto" from the possible values for these options + auto_options = [option for option, value in self.options.items() if value == "auto"] + if auto_options: + raise ConanException("Options with value 'auto' are deprecated. Please set them true/false or use its default value." + f" Please change the following options: {auto_options}") + + # From https://github.com/conan-io/conan-center-index/pull/23163#issuecomment-2039808851 + if self.options.gandiva: + if not self.options.with_re2: + raise ConanException("'with_re2' option should be True when 'gandiva=True'") + if not self.options.with_boost: + raise ConanException("'with_boost' option should be True when 'gandiva=True'") + if not self.options.with_utf8proc: + raise ConanException("'with_utf8proc' option should be True when 'gandiva=True'") + if self.options.with_thrift and not self.options.with_boost: + raise ConanException("'with_boost' option should be True when 'thrift=True'") + if self.options.parquet: + if not self.options.with_thrift: + raise ConanException("'with_thrift' option should be True when 'parquet=True'") + if self.options.with_flight_rpc and not self.options.with_protobuf: + raise ConanException("'with_protobuf' option should be True when 'with_flight_rpc=True'") 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.") @@ -376,8 +239,11 @@ def validate(self): 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.") + if self.options.with_thrift and not self.options.with_zlib: + raise ConanInvalidConfiguration("arrow:with_thrift requires arrow:with_zlib") + + if self.options.parquet and not self.options.with_thrift: + raise ConanInvalidConfiguration("arrow:parquet requires arrow:with_thrift") def build_requirements(self): if Version(self.version) >= "13.0.0": @@ -414,7 +280,7 @@ def generate(self): tc.variables["ARROW_NO_DEPRECATED_API"] = not bool(self.options.deprecated) 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.options.compute + tc.variables["ARROW_COMPUTE"] = bool(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.options.with_jemalloc @@ -435,6 +301,7 @@ def generate(self): 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["ARROW_WITH_RE2"] = bool(self.options.with_re2) tc.variables["brotli_SOURCE"] = "SYSTEM" if self.options.with_brotli: tc.variables["ARROW_BROTLI_USE_SHARED"] = bool(self.dependencies["brotli"].options.shared) @@ -459,18 +326,17 @@ def generate(self): tc.variables["ZLIB_SOURCE"] = "SYSTEM" tc.variables["xsimd_SOURCE"] = "SYSTEM" tc.variables["ARROW_WITH_ZSTD"] = bool(self.options.with_zstd) - if Version(self.version) >= "2.0": - tc.variables["zstd_SOURCE"] = "SYSTEM" - tc.variables["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() - tc.variables["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() - else: - tc.variables["ZSTD_SOURCE"] = "SYSTEM" + tc.variables["zstd_SOURCE"] = "SYSTEM" + tc.variables["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() + tc.variables["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() if self.options.with_zstd: tc.variables["ARROW_ZSTD_USE_SHARED"] = bool(self.dependencies["zstd"].options.shared) tc.variables["ORC_SOURCE"] = "SYSTEM" tc.variables["ARROW_WITH_THRIFT"] = bool(self.options.with_thrift) + tc.variables["ARROW_THRIFT"] = bool(self.options.with_thrift) tc.variables["Thrift_SOURCE"] = "SYSTEM" if self.options.with_thrift: + tc.variables["ARROW_THRIFT"] = True 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 @@ -505,39 +371,22 @@ def generate(self): tc.generate() deps = CMakeDeps(self) + deps.set_property("mimalloc", "cmake_target_name", "mimalloc::mimalloc") deps.generate() def _patch_sources(self): apply_conandata_patches(self) - if "7.0.0" <= Version(self.version) < "10.0.0": - for filename in glob.glob(os.path.join(self.source_folder, "cpp", "cmake_modules", "Find*.cmake")): - if os.path.basename(filename) not in [ - "FindArrow.cmake", - "FindArrowAcero.cmake", - "FindArrowCUDA.cmake", - "FindArrowDataset.cmake", - "FindArrowFlight.cmake", - "FindArrowFlightSql.cmake", - "FindArrowFlightTesting.cmake", - "FindArrowPython.cmake", - "FindArrowPythonFlight.cmake", - "FindArrowSubstrait.cmake", - "FindArrowTesting.cmake", - "FindGandiva.cmake", - "FindParquet.cmake", - ]: - os.remove(filename) def build(self): self._patch_sources() - cmake =CMake(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.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy(self, pattern="NOTICE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - cmake =CMake(self) + cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) @@ -550,8 +399,10 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "Arrow") suffix = "_static" if is_msvc(self) and not self.options.shared else "" + cmake_suffix = "shared" if self.options.shared else "static" self.cpp_info.components["libarrow"].set_property("pkg_config_name", "arrow") + self.cpp_info.components["libarrow"].set_property("cmake_target_name", f"Arrow::arrow_{cmake_suffix}") self.cpp_info.components["libarrow"].libs = [f"arrow{suffix}"] if not self.options.shared: self.cpp_info.components["libarrow"].defines = ["ARROW_STATIC"] @@ -560,6 +411,7 @@ def package_info(self): if self.options.parquet: self.cpp_info.components["libparquet"].set_property("pkg_config_name", "parquet") + self.cpp_info.components["libparquet"].set_property("cmake_target_name", f"Parquet::parquet_{cmake_suffix}") self.cpp_info.components["libparquet"].libs = [f"parquet{suffix}"] self.cpp_info.components["libparquet"].requires = ["libarrow"] if not self.options.shared: @@ -567,6 +419,7 @@ def package_info(self): 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"].set_property("cmake_target_name", f"Arrow::arrow_substrait_{cmake_suffix}") self.cpp_info.components["libarrow_substrait"].libs = [f"arrow_substrait{suffix}"] self.cpp_info.components["libarrow_substrait"].requires = ["libparquet", "dataset"] @@ -574,6 +427,8 @@ def package_info(self): del self.options.plasma if self.options.acero: + self.cpp_info.components["libacero"].set_property("pkg_config_name", "acero") + self.cpp_info.components["libacero"].set_property("cmake_target_name", f"Acero::arrow_acero_{cmake_suffix}") 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" @@ -582,6 +437,7 @@ def package_info(self): if self.options.gandiva: self.cpp_info.components["libgandiva"].set_property("pkg_config_name", "gandiva") + self.cpp_info.components["libgandiva"].set_property("cmake_target_name", f"Gandiva::gandiva_{cmake_suffix}") self.cpp_info.components["libgandiva"].libs = [f"gandiva{suffix}"] self.cpp_info.components["libgandiva"].requires = ["libarrow"] if not self.options.shared: @@ -589,11 +445,16 @@ def package_info(self): 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"].set_property("cmake_target_name", f"ArrowFlight::arrow_flight_{cmake_suffix}") self.cpp_info.components["libarrow_flight"].libs = [f"arrow_flight{suffix}"] self.cpp_info.components["libarrow_flight"].requires = ["libarrow"] + # https://github.com/apache/arrow/pull/43137#pullrequestreview-2267476893 + if Version(self.version) >= "18.0.0" and self.options.with_openssl: + self.cpp_info.components["libarrow_flight"].requires.append("openssl::openssl") if self.options.get_safe("with_flight_sql"): self.cpp_info.components["libarrow_flight_sql"].set_property("pkg_config_name", "flight_sql") + self.cpp_info.components["libarrow_flight_sql"].set_property("cmake_target_name", f"ArrowFlightSql::arrow_flight_sql_{cmake_suffix}") self.cpp_info.components["libarrow_flight_sql"].libs = [f"arrow_flight_sql{suffix}"] self.cpp_info.components["libarrow_flight_sql"].requires = ["libarrow", "libarrow_flight"] @@ -601,6 +462,8 @@ def package_info(self): self.cpp_info.components["dataset"].libs = ["arrow_dataset"] if self.options.parquet: self.cpp_info.components["dataset"].requires = ["libparquet"] + if self.options.acero and Version(self.version) >= "19.0.0": + self.cpp_info.components["dataset"].requires = ["libacero"] 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") @@ -613,9 +476,8 @@ def package_info(self): self.cpp_info.components["libgandiva"].requires.append("boost::boost") 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") + # FIXME: only headers components is used + self.cpp_info.components["libarrow"].requires.append("boost::boost") if self.options.with_openssl: self.cpp_info.components["libarrow"].requires.append("openssl::openssl") if self.options.with_gflags: @@ -647,7 +509,8 @@ def package_info(self): 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") + # https://github.com/apache/arrow/blob/6b268f62a8a172249ef35f093009c740c32e1f36/cpp/src/arrow/CMakeLists.txt#L98 + self.cpp_info.components["libarrow"].requires.extend([f"aws-sdk-cpp::{x}" for x in ["cognito-identity", "core", "identity-management", "s3", "sts"]]) if self.options.get_safe("with_gcs"): self.cpp_info.components["libarrow"].requires.append("google-cloud-cpp::storage") if self.options.with_orc: @@ -668,32 +531,7 @@ 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.options.with_boost: - self.cpp_info.components["libarrow"].requires.append("boost::boost") if self.options.with_grpc: self.cpp_info.components["libarrow"].requires.append("grpc::grpc") 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/patches/1.0.0-0003-fix-shared-msvc.patch b/recipes/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch deleted file mode 100644 index 3c7e86d5ff279..0000000000000 --- a/recipes/arrow/all/patches/1.0.0-0003-fix-shared-msvc.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cpp/src/arrow/CMakeLists.txt -+++ cpp/src/arrow/CMakeLists.txt -@@ -490,6 +490,10 @@ - target_compile_definitions(arrow_static PUBLIC ARROW_STATIC) - endif() - -+if(ARROW_BUILD_SHARED AND WIN32) -+target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) -+endif() -+ - if(ARROW_WITH_BACKTRACE) - find_package(Backtrace) - diff --git a/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch b/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch deleted file mode 100644 index 5f0f6f4c52d5c..0000000000000 --- a/recipes/arrow/all/patches/1.0.0-0005-fix-make12-namespace.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/cpp/src/arrow/vendored/datetime/date.h b/cpp/src/arrow/vendored/datetime/date.h -index 02a4909..2b168d2 100644 ---- a/cpp/src/arrow/vendored/datetime/date.h -+++ b/cpp/src/arrow/vendored/datetime/date.h -@@ -5152,7 +5152,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, - if (modified == CharT{}) - #endif - { -- auto h = *fmt == CharT{'I'} ? make12(hms.hours()) : hms.hours(); -+ auto h = *fmt == CharT{'I'} ? arrow_vendored::date::make12(hms.hours()) : hms.hours(); - if (h < hours{10}) - os << CharT{'0'}; - os << h.count(); -@@ -5366,7 +5366,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, - save_ostream _(os); - os.fill('0'); - os.width(2); -- os << make12(tod.hours()).count() << CharT{':'}; -+ os << arrow_vendored::date::make12(tod.hours()).count() << CharT{':'}; - os.width(2); - os << tod.minutes().count() << CharT{':'}; - os.width(2); diff --git a/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch b/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch deleted file mode 100644 index eb6816262214b..0000000000000 --- a/recipes/arrow/all/patches/1.0.0-0006-fix-cmake.patch +++ /dev/null @@ -1,333 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 300f043..0127a7a 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -654,7 +654,7 @@ endif() - - if(ARROW_WITH_BROTLI) - # Order is important for static linking -- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) -+ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) - list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) - list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) - endif() -@@ -664,7 +664,7 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) - endif() - - if(ARROW_WITH_SNAPPY) -@@ -800,8 +800,11 @@ endif() - - if(ARROW_MIMALLOC) - add_definitions(-DARROW_MIMALLOC) -- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) -+ if (TARGET mimalloc-static) -+ list(APPEND ARROW_LINK_LIBS mimalloc-static) -+ else() -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) -+ endif() - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake -index eb10ebe..9c81017 100644 ---- a/cpp/cmake_modules/BuildUtils.cmake -+++ b/cpp/cmake_modules/BuildUtils.cmake -@@ -165,10 +165,10 @@ function(create_merged_static_lib output_target) - set(ar_script_path ${CMAKE_BINARY_DIR}/${ARG_NAME}.ar) - - file(WRITE ${ar_script_path}.in "CREATE ${output_lib_path}\n") -- file(APPEND ${ar_script_path}.in "ADDLIB $\n") -+ file(APPEND ${ar_script_path}.in "ADDLIB $\n") - - foreach(lib ${ARG_TO_MERGE}) -- file(APPEND ${ar_script_path}.in "ADDLIB $\n") -+ file(APPEND ${ar_script_path}.in "ADDLIB $\n") - endforeach() - - file(APPEND ${ar_script_path}.in "SAVE\nEND\n") -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index 807e2b9..016c8db 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -154,16 +154,7 @@ macro(build_dependency DEPENDENCY_NAME) - endmacro() - - macro(resolve_dependency DEPENDENCY_NAME) -- if(${DEPENDENCY_NAME}_SOURCE STREQUAL "AUTO") -- find_package(${DEPENDENCY_NAME} MODULE) -- if(NOT ${${DEPENDENCY_NAME}_FOUND}) -- build_dependency(${DEPENDENCY_NAME}) -- endif() -- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "BUNDLED") -- build_dependency(${DEPENDENCY_NAME}) -- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM") -- find_package(${DEPENDENCY_NAME} REQUIRED) -- endif() -+ find_package(${DEPENDENCY_NAME} REQUIRED) - endmacro() - - macro(resolve_dependency_with_version DEPENDENCY_NAME REQUIRED_VERSION) -@@ -765,6 +756,7 @@ endif() - # - Tests need Boost at runtime. - # - S3FS and Flight benchmarks need Boost at runtime. - if(ARROW_BUILD_INTEGRATION -+ OR ARROW_BOOST_REQUIRED - OR ARROW_BUILD_TESTS - OR ARROW_GANDIVA - OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) -@@ -785,7 +777,7 @@ if(ARROW_BOOST_REQUIRED) - elseif(BOOST_SOURCE STREQUAL "BUNDLED") - build_boost() - elseif(BOOST_SOURCE STREQUAL "SYSTEM") -- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) -+ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) - endif() - - if(TARGET Boost::system) -@@ -936,11 +928,11 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli) -+ resolve_dependency(brotli) - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon -+ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) -+ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) - endif() - - if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) -@@ -1146,9 +1138,10 @@ if(ARROW_NEED_GFLAGS) - endif() - endif() - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) -+ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) -+ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) - -- if(NOT TARGET ${GFLAGS_LIBRARIES}) -+ if(0) - if(TARGET gflags-shared) - set(GFLAGS_LIBRARIES gflags-shared) - elseif(TARGET gflags_shared) -@@ -1237,12 +1230,13 @@ endmacro() - if(ARROW_WITH_THRIFT) - # We already may have looked for Thrift earlier, when considering whether - # to build Boost, so don't look again if already found. -- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) -+ if(0) - # Thrift c++ code generated by 0.13 requires 0.11 or greater - resolve_dependency_with_version(Thrift 0.11.0) - endif() -+ find_package(Thrift CONFIG REQUIRED) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) - endif() - - # ---------------------------------------------------------------------- -@@ -1407,6 +1401,7 @@ endif() - # jemalloc - Unix-only high-performance allocator - - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1465,12 +1460,18 @@ if(ARROW_JEMALLOC) - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+if(0) - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1518,6 +1519,11 @@ if(ARROW_MIMALLOC) - add_dependencies(toolchain mimalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1918,11 +1924,16 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -- resolve_dependency(Lz4) -+ resolve_dependency(lz4) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) -+ if(TARGET LZ4::lz4_static) -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) -+ else() -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) -+ endif() -+ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) - endif() - - macro(build_zstd) -@@ -2037,10 +2048,10 @@ macro(build_re2) - endmacro() - - if(ARROW_GANDIVA) -- resolve_dependency(RE2) -+ resolve_dependency(re2) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) -+ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${RE2_INCLUDE_DIR}) - endif() - -@@ -2480,17 +2491,24 @@ if(ARROW_WITH_GRPC) - endif() - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) -+ # get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) -+ if(grpc_INCLUDE_DIRS_RELEASE) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) -+ elseif(grpc_INCLUDE_DIRS_DEBUG) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) -+ endif() - include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) -+ include_directories(SYSTEM ${absl_INCLUDE_DIR}) -+ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) - - if(GRPC_VENDORED) - set(GRPCPP_PP_INCLUDE TRUE) - else() - # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp - # depending on the gRPC version. -- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -+ if(EXISTS ${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE TRUE) -- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") -+ elseif(EXISTS ${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE FALSE) - else() - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index 5797a78..da6bd4d 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -292,10 +292,15 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() -+ - if(ARROW_MIMALLOC) -- list(APPEND _allocator_dependencies mimalloc_ep) -+ if (TARGET mimalloc-static) -+ list(APPEND _allocator_dependencies mimalloc-static) -+ else() -+ list(APPEND _allocator_dependencies mimalloc) -+ endif() - endif() - - if(_allocator_dependencies) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index 784bf7b..8f005a5 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -31,7 +31,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC -diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt -index 85e8db6..cd70c63 100644 ---- a/cpp/src/gandiva/CMakeLists.txt -+++ b/cpp/src/gandiva/CMakeLists.txt -@@ -25,7 +25,7 @@ add_custom_target(gandiva-benchmarks) - - add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) - --find_package(LLVMAlt REQUIRED) -+find_package(LLVM REQUIRED) - - if(LLVM_VERSION_MAJOR LESS "10") - set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) -@@ -88,9 +88,16 @@ set(SRC_FILES - random_generator_holder.cc - ${GANDIVA_PRECOMPILED_CC_PATH}) - --set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE RE2::re2) - --set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE RE2::re2) -+ function(get_all_targets var) -+ set(targets) -+ get_all_targets_recursive(targets ${CMAKE_CURRENT_SOURCE_DIR}) -+ set(${var} ${targets} PARENT_SCOPE) -+endfunction() -+ -+set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core re2::re2) -+ -+set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core re2::re2) - - if(ARROW_GANDIVA_STATIC_LIBSTDCPP - AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)) -@@ -131,7 +138,7 @@ add_arrow_lib(gandiva - arrow_dependencies - precompiled - EXTRA_INCLUDES -- $ -+ $ - SHARED_LINK_FLAGS - ${GANDIVA_SHARED_LINK_FLAGS} - SHARED_LINK_LIBS -@@ -203,7 +210,7 @@ endfunction() - - set(GANDIVA_INTERNALS_TEST_ARGUMENTS) - if(WIN32) -- list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS LLVM::LLVM_INTERFACE) -+ list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS llvm-core::llvm-core) - endif() - add_gandiva_test(internals-test - SOURCES -@@ -225,9 +232,9 @@ add_gandiva_test(internals-test - decimal_type_util_test.cc - random_generator_holder_test.cc - EXTRA_DEPENDENCIES -- LLVM::LLVM_INTERFACE -+ llvm-core::llvm-core - EXTRA_INCLUDES -- $ -+ $ - ${GANDIVA_INTERNALS_TEST_ARGUMENTS}) - - if(ARROW_GANDIVA_JAVA) diff --git a/recipes/arrow/all/patches/11.0.0-0001-fix-cmake.patch b/recipes/arrow/all/patches/11.0.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..1d5a752548ee2 --- /dev/null +++ b/recipes/arrow/all/patches/11.0.0-0001-fix-cmake.patch @@ -0,0 +1,42 @@ +diff --git a/cpp/cmake_modules/FindThriftAlt.cmake b/cpp/cmake_modules/FindThriftAlt.cmake +index f3e49021d..95177c2a6 100644 +--- a/cpp/cmake_modules/FindThriftAlt.cmake ++++ b/cpp/cmake_modules/FindThriftAlt.cmake +@@ -45,22 +45,21 @@ endif() + # * https://github.com/apache/thrift/pull/2725 + # * https://github.com/apache/thrift/pull/2726 + # * https://github.com/conda-forge/thrift-cpp-feedstock/issues/68 +-if(NOT WIN32) +- set(find_package_args "") +- if(ThriftAlt_FIND_VERSION) +- list(APPEND find_package_args ${ThriftAlt_FIND_VERSION}) +- endif() +- if(ThriftAlt_FIND_QUIETLY) +- list(APPEND find_package_args QUIET) +- endif() +- find_package(Thrift ${find_package_args}) +- if(Thrift_FOUND) +- set(ThriftAlt_FOUND TRUE) +- add_executable(thrift::compiler IMPORTED) +- set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION +- "${THRIFT_COMPILER}") +- return() +- endif() ++ ++set(find_package_args "") ++if(ThriftAlt_FIND_VERSION) ++ list(APPEND find_package_args ${ThriftAlt_FIND_VERSION}) ++endif() ++if(ThriftAlt_FIND_QUIETLY) ++ list(APPEND find_package_args QUIET) ++endif() ++find_package(Thrift ${find_package_args}) ++if(Thrift_FOUND) ++ set(ThriftAlt_FOUND TRUE) ++ add_executable(thrift::compiler IMPORTED) ++ set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION ++ "${THRIFT_COMPILER}") ++ return() + endif() + + function(extract_thrift_version) diff --git a/recipes/arrow/all/patches/16.0.0-0001-fix-cmake.patch b/recipes/arrow/all/patches/16.0.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..8c11ce258bb15 --- /dev/null +++ b/recipes/arrow/all/patches/16.0.0-0001-fix-cmake.patch @@ -0,0 +1,62 @@ +diff --git a/cpp/cmake_modules/FindThriftAlt.cmake b/cpp/cmake_modules/FindThriftAlt.cmake +index f3e49021d..3e63f1edf 100644 +--- a/cpp/cmake_modules/FindThriftAlt.cmake ++++ b/cpp/cmake_modules/FindThriftAlt.cmake +@@ -45,23 +45,23 @@ endif() + # * https://github.com/apache/thrift/pull/2725 + # * https://github.com/apache/thrift/pull/2726 + # * https://github.com/conda-forge/thrift-cpp-feedstock/issues/68 +-if(NOT WIN32) +- set(find_package_args "") +- if(ThriftAlt_FIND_VERSION) +- list(APPEND find_package_args ${ThriftAlt_FIND_VERSION}) +- endif() +- if(ThriftAlt_FIND_QUIETLY) +- list(APPEND find_package_args QUIET) +- endif() +- find_package(Thrift ${find_package_args}) +- if(Thrift_FOUND) +- set(ThriftAlt_FOUND TRUE) +- add_executable(thrift::compiler IMPORTED) +- set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION +- "${THRIFT_COMPILER}") +- return() +- endif() ++ ++set(find_package_args "") ++if(ThriftAlt_FIND_VERSION) ++ list(APPEND find_package_args ${ThriftAlt_FIND_VERSION}) ++endif() ++if(ThriftAlt_FIND_QUIETLY) ++ list(APPEND find_package_args QUIET) + endif() ++find_package(Thrift ${find_package_args}) ++if(Thrift_FOUND) ++ set(ThriftAlt_FOUND TRUE) ++ add_executable(thrift::compiler IMPORTED) ++ set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION ++ "${THRIFT_COMPILER}") ++ return() ++endif() ++ + + function(extract_thrift_version) + if(ThriftAlt_INCLUDE_DIR) +diff --git a/cpp/src/parquet/CMakeLists.txt b/cpp/src/parquet/CMakeLists.txt +index 93f2e72d8..e00f73f7d 100644 +--- a/cpp/src/parquet/CMakeLists.txt ++++ b/cpp/src/parquet/CMakeLists.txt +@@ -262,11 +262,11 @@ if(NOT PARQUET_MINIMAL_DEPENDENCY) + + # These are libraries that we will link privately with parquet_shared (as they + # do not need to be linked transitively by other linkers) +- list(APPEND PARQUET_SHARED_PRIVATE_LINK_LIBS thrift::thrift) ++ list(APPEND PARQUET_SHARED_PRIVATE_LINK_LIBS Boost::headers thrift::thrift) + + # Link publicly with parquet_static (because internal users need to + # transitively link all dependencies) +- list(APPEND PARQUET_STATIC_LINK_LIBS thrift::thrift) ++ list(APPEND PARQUET_STATIC_LINK_LIBS Boost::headers thrift::thrift) + if(NOT THRIFT_VENDORED) + list(APPEND PARQUET_STATIC_INSTALL_INTERFACE_LIBS thrift::thrift) + endif() diff --git a/recipes/arrow/all/patches/18.0.0-0001-fix-cmake.patch b/recipes/arrow/all/patches/18.0.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..1000d42f4af61 --- /dev/null +++ b/recipes/arrow/all/patches/18.0.0-0001-fix-cmake.patch @@ -0,0 +1,59 @@ +diff --git a/cpp/cmake_modules/FindThriftAlt.cmake b/cpp/cmake_modules/FindThriftAlt.cmake +index 98a706d..edf195e 100644 +--- a/cpp/cmake_modules/FindThriftAlt.cmake ++++ b/cpp/cmake_modules/FindThriftAlt.cmake +@@ -45,22 +45,20 @@ endif() + # * https://github.com/apache/thrift/pull/2725 + # * https://github.com/apache/thrift/pull/2726 + # * https://github.com/conda-forge/thrift-cpp-feedstock/issues/68 +-if(NOT WIN32) +- set(find_package_args "") +- if(ThriftAlt_FIND_VERSION) +- list(APPEND find_package_args ${ThriftAlt_FIND_VERSION}) +- endif() +- if(ThriftAlt_FIND_QUIETLY) +- list(APPEND find_package_args QUIET) +- endif() +- find_package(Thrift ${find_package_args}) +- if(Thrift_FOUND) +- set(ThriftAlt_FOUND TRUE) +- add_executable(thrift::compiler IMPORTED) +- set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION +- "${THRIFT_COMPILER}") +- return() +- endif() ++set(find_package_args "") ++if(ThriftAlt_FIND_VERSION) ++ list(APPEND find_package_args ${ThriftAlt_FIND_VERSION}) ++endif() ++if(ThriftAlt_FIND_QUIETLY) ++ list(APPEND find_package_args QUIET) ++endif() ++find_package(Thrift ${find_package_args}) ++if(Thrift_FOUND) ++ set(ThriftAlt_FOUND TRUE) ++ add_executable(thrift::compiler IMPORTED) ++ set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION ++ "${THRIFT_COMPILER}") ++ return() + endif() + + function(extract_thrift_version) +diff --git a/cpp/src/parquet/CMakeLists.txt b/cpp/src/parquet/CMakeLists.txt +index b984ef7..429fc6d 100644 +--- a/cpp/src/parquet/CMakeLists.txt ++++ b/cpp/src/parquet/CMakeLists.txt +@@ -263,11 +263,11 @@ if(NOT PARQUET_MINIMAL_DEPENDENCY) + + # These are libraries that we will link privately with parquet_shared (as they + # do not need to be linked transitively by other linkers) +- list(APPEND PARQUET_SHARED_PRIVATE_LINK_LIBS thrift::thrift) ++ list(APPEND PARQUET_SHARED_PRIVATE_LINK_LIBS Boost::headers thrift::thrift) + + # Link publicly with parquet_static (because internal users need to + # transitively link all dependencies) +- list(APPEND PARQUET_STATIC_LINK_LIBS thrift::thrift) ++ list(APPEND PARQUET_STATIC_LINK_LIBS Boost::headers thrift::thrift) + if(NOT THRIFT_VENDORED) + list(APPEND PARQUET_STATIC_INSTALL_INTERFACE_LIBS thrift::thrift) + endif() diff --git a/recipes/arrow/all/patches/19.0.1-0001-fix-cmake.patch b/recipes/arrow/all/patches/19.0.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..af7e309cf2c24 --- /dev/null +++ b/recipes/arrow/all/patches/19.0.1-0001-fix-cmake.patch @@ -0,0 +1,57 @@ +diff --git a/cpp/cmake_modules/FindThriftAlt.cmake b/cpp/cmake_modules/FindThriftAlt.cmake +index 98a706d..edf195e 100644 +--- a/cpp/cmake_modules/FindThriftAlt.cmake ++++ b/cpp/cmake_modules/FindThriftAlt.cmake +@@ -45,22 +45,20 @@ endif() + # * https://github.com/apache/thrift/pull/2725 + # * https://github.com/apache/thrift/pull/2726 + # * https://github.com/conda-forge/thrift-cpp-feedstock/issues/68 +-if(NOT WIN32) +- set(find_package_args "") +- if(ThriftAlt_FIND_VERSION) +- list(APPEND find_package_args ${ThriftAlt_FIND_VERSION}) +- endif() +- if(ThriftAlt_FIND_QUIETLY) +- list(APPEND find_package_args QUIET) +- endif() +- find_package(Thrift ${find_package_args}) +- if(Thrift_FOUND) +- set(ThriftAlt_FOUND TRUE) +- add_executable(thrift::compiler IMPORTED) +- set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION +- "${THRIFT_COMPILER}") +- return() +- endif() ++set(find_package_args "") ++if(ThriftAlt_FIND_VERSION) ++ list(APPEND find_package_args ${ThriftAlt_FIND_VERSION}) ++endif() ++if(ThriftAlt_FIND_QUIETLY) ++ list(APPEND find_package_args QUIET) ++endif() ++find_package(Thrift ${find_package_args}) ++if(Thrift_FOUND) ++ set(ThriftAlt_FOUND TRUE) ++ add_executable(thrift::compiler IMPORTED) ++ set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION ++ "${THRIFT_COMPILER}") ++ return() + endif() + + function(extract_thrift_version) +diff --git a/cpp/src/parquet/size_statistics.cc b/cpp/src/parquet/size_statistics.cc +index 1ce6c937a..e45eef3f0 100644 +--- a/cpp/src/parquet/size_statistics.cc ++++ b/cpp/src/parquet/size_statistics.cc +@@ -18,9 +18,11 @@ + #include "parquet/size_statistics.h" + + #include ++#include + #include + #include + #include ++#include + + #include "arrow/util/logging.h" + #include "parquet/exception.h" diff --git a/recipes/arrow/all/patches/19.0.1-0002-fix-downloaded-mimalloc.patch b/recipes/arrow/all/patches/19.0.1-0002-fix-downloaded-mimalloc.patch new file mode 100644 index 0000000000000..46725ea20a898 --- /dev/null +++ b/recipes/arrow/all/patches/19.0.1-0002-fix-downloaded-mimalloc.patch @@ -0,0 +1,15 @@ +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index abfe6d2..cc0f3c5 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -2259,6 +2259,10 @@ endif() + # mimalloc - Cross-platform high-performance allocator, from Microsoft + + if(ARROW_MIMALLOC) ++ find_package(mimalloc REQUIRED CONFIG) ++endif() ++ ++if(0) + if(NOT ARROW_ENABLE_THREADING) + message(FATAL_ERROR "Can't use mimalloc with ARROW_ENABLE_THREADING=OFF") + endif() diff --git a/recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch b/recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch deleted file mode 100644 index f3268abf74e2c..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0003-fix-shared-msvc.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cpp/src/arrow/CMakeLists.txt -+++ cpp/src/arrow/CMakeLists.txt -@@ -504,6 +504,10 @@ - target_compile_definitions(arrow_static PUBLIC ARROW_STATIC) - endif() - -+if(ARROW_BUILD_SHARED AND WIN32) -+target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) -+endif() -+ - if(ARROW_WITH_BACKTRACE) - find_package(Backtrace) - diff --git a/recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch b/recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch deleted file mode 100644 index 9fcc4b1a36a8a..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0005-gandiva-engine.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cpp/src/gandiva/engine.cc -+++ cpp/src/gandiva/engine.cc -@@ -64,6 +64,10 @@ - #include - #include - -+#if GANDIVA_LLVM_VERSION >= 11 -+#include -+#endif -+ - #if defined(_MSC_VER) - #pragma warning(pop) - #endif diff --git a/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch b/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch deleted file mode 100644 index 7153d641e0c61..0000000000000 --- a/recipes/arrow/all/patches/2.0.0-0008-fix-cmake.patch +++ /dev/null @@ -1,273 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 515e6af..7488161 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -109,7 +109,7 @@ set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support") - set(ARROW_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") - set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}") - --set(ARROW_LLVM_VERSIONS "10" "9" "8" "7") -+set(ARROW_LLVM_VERSIONS "13" "12" "11" "10" "9" "8" "7") - list(GET ARROW_LLVM_VERSIONS 0 ARROW_LLVM_VERSION_PRIMARY) - string(REGEX - REPLACE "^([0-9]+)(\\..+)?" "\\1" ARROW_LLVM_VERSION_PRIMARY_MAJOR -@@ -667,7 +667,7 @@ endif() - - if(ARROW_WITH_BROTLI) - # Order is important for static linking -- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) -+ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) - list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) - list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) - if(Brotli_SOURCE STREQUAL "SYSTEM") -@@ -683,9 +683,9 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) - if(Lz4_SOURCE STREQUAL "SYSTEM") -- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS lz4::lz4) - endif() - endif() - -@@ -842,8 +842,14 @@ endif() - - if(ARROW_MIMALLOC) - add_definitions(-DARROW_MIMALLOC) -- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) -+ if (TARGET mimalloc-static) -+ list(APPEND ARROW_LINK_LIBS mimalloc-static) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) -+ else() -+ list(APPEND ARROW_LINK_LIBS mimalloc) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) -+ endif() -+ - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index cc37a3c..8fe6db9 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -171,6 +171,7 @@ macro(provide_find_module DEPENDENCY_NAME) - endmacro() - - macro(resolve_dependency DEPENDENCY_NAME) -+if(0) - set(options) - set(one_value_args REQUIRED_VERSION) - cmake_parse_arguments(ARG -@@ -207,6 +208,14 @@ macro(resolve_dependency DEPENDENCY_NAME) - provide_find_module(${DEPENDENCY_NAME}) - list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) - endif() -+else() -+ if(ARG_REQUIRED_VERSION) -+ find_package(${DEPENDENCY_NAME} ${ARG_REQUIRED_VERSION} REQUIRED) -+ else() -+ find_package(${DEPENDENCY_NAME} REQUIRED) -+ endif() -+ list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) -+endif() - endmacro() - - # ---------------------------------------------------------------------- -@@ -826,6 +835,7 @@ endif() - # - Tests need Boost at runtime. - # - S3FS and Flight benchmarks need Boost at runtime. - if(ARROW_BUILD_INTEGRATION -+ OR ARROW_BOOST_REQUIRED - OR ARROW_BUILD_TESTS - OR ARROW_GANDIVA - OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) -@@ -846,7 +856,7 @@ if(ARROW_BOOST_REQUIRED) - elseif(BOOST_SOURCE STREQUAL "BUNDLED") - build_boost() - elseif(BOOST_SOURCE STREQUAL "SYSTEM") -- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) -+ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) - endif() - - if(TARGET Boost::system) -@@ -973,11 +983,11 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli) -+ resolve_dependency(brotli) - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon -+ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) -+ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) - endif() - - if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) -@@ -1200,9 +1210,10 @@ if(ARROW_NEED_GFLAGS) - endif() - endif() - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) -+ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) -+ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) - -- if(NOT TARGET ${GFLAGS_LIBRARIES}) -+ if(0) - if(TARGET gflags-shared) - set(GFLAGS_LIBRARIES gflags-shared) - elseif(TARGET gflags_shared) -@@ -1291,12 +1302,13 @@ endmacro() - if(ARROW_WITH_THRIFT) - # We already may have looked for Thrift earlier, when considering whether - # to build Boost, so don't look again if already found. -- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) -+ if(0) - # Thrift c++ code generated by 0.13 requires 0.11 or greater - resolve_dependency(Thrift REQUIRED_VERSION 0.11.0) - endif() -+ find_package(Thrift CONFIG REQUIRED) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) - endif() - - # ---------------------------------------------------------------------- -@@ -1461,6 +1473,7 @@ endif() - # jemalloc - Unix-only high-performance allocator - - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1519,12 +1532,18 @@ if(ARROW_JEMALLOC) - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+if(0) - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1572,6 +1591,11 @@ if(ARROW_MIMALLOC) - add_dependencies(toolchain mimalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1971,11 +1995,16 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -- resolve_dependency(Lz4) -+ resolve_dependency(lz4) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) -- include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) -+ if(TARGET LZ4::lz4_static) -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) -+ else() -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) -+ endif() -+ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) - endif() - - macro(build_zstd) -@@ -2090,10 +2119,10 @@ macro(build_re2) - endmacro() - - if(ARROW_GANDIVA) -- resolve_dependency(RE2) -+ resolve_dependency(re2) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) -+ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${RE2_INCLUDE_DIR}) - endif() - -@@ -2541,17 +2570,24 @@ if(ARROW_WITH_GRPC) - endif() - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) -+ if(grpc_INCLUDE_DIRS_RELEASE) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) -+ elseif(grpc_INCLUDE_DIRS_DEBUG) -+ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) -+ endif() -+ - include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) -+ include_directories(SYSTEM ${absl_INCLUDE_DIR}) -+ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) - - if(GRPC_VENDORED) - set(GRPCPP_PP_INCLUDE TRUE) - else() - # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp - # depending on the gRPC version. -- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -+ if(EXISTS ${gRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE TRUE) -- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") -+ elseif(EXISTS ${gRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE FALSE) - else() - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index 2751254..842fc9e 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -307,10 +307,14 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() - if(ARROW_MIMALLOC) -- list(APPEND _allocator_dependencies mimalloc_ep) -+ if (TARGET mimalloc-static) -+ list(APPEND _allocator_dependencies mimalloc-static) -+ else() -+ list(APPEND _allocator_dependencies mimalloc) -+ endif() - endif() - - if(_allocator_dependencies) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index 784bf7b..8f005a5 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -31,7 +31,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC diff --git a/recipes/arrow/all/patches/7.0.0-0006-install-utils.patch b/recipes/arrow/all/patches/7.0.0-0006-install-utils.patch deleted file mode 100644 index 468fe3a6a6ab5..0000000000000 --- a/recipes/arrow/all/patches/7.0.0-0006-install-utils.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt -index 495018e..f6cee6f 100644 ---- a/cpp/src/arrow/ipc/CMakeLists.txt -+++ b/cpp/src/arrow/ipc/CMakeLists.txt -@@ -61,8 +61,12 @@ endif() - if(ARROW_BUILD_UTILITIES OR ARROW_BUILD_INTEGRATION) - add_executable(arrow-file-to-stream file_to_stream.cc) - target_link_libraries(arrow-file-to-stream ${ARROW_UTIL_LIB}) -+ install(TARGETS arrow-file-to-stream ${INSTALL_IS_OPTIONAL} -+ DESTINATION ${CMAKE_INSTALL_BINDIR}) - add_executable(arrow-stream-to-file stream_to_file.cc) - target_link_libraries(arrow-stream-to-file ${ARROW_UTIL_LIB}) -+ install(TARGETS arrow-stream-to-file ${INSTALL_IS_OPTIONAL} -+ DESTINATION ${CMAKE_INSTALL_BINDIR}) - - if(ARROW_BUILD_INTEGRATION) - add_dependencies(arrow-integration arrow-file-to-stream) diff --git a/recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch b/recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch deleted file mode 100644 index 8b4d5d5518dcc..0000000000000 --- a/recipes/arrow/all/patches/7.0.0-0007-fix-cmake.patch +++ /dev/null @@ -1,347 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index 2d7baf1..dff5b1a 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -699,7 +699,7 @@ endif() - - if(ARROW_WITH_BROTLI) - # Order is important for static linking -- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) -+ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) - list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) - list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) - if(Brotli_SOURCE STREQUAL "SYSTEM") -@@ -715,10 +715,17 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -- if(Lz4_SOURCE STREQUAL "SYSTEM") -- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) -- endif() -+ if (TARGET LZ4::lz4_static) -+ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) -+ if(Lz4_SOURCE STREQUAL "SYSTEM") -+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_static) -+ endif() -+ else() -+ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_shared) -+ if(Lz4_SOURCE STREQUAL "SYSTEM") -+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_shared) -+ endif() -+endif() - endif() - - if(ARROW_WITH_SNAPPY) -@@ -907,8 +914,13 @@ endif() - - if(ARROW_MIMALLOC) - add_definitions(-DARROW_MIMALLOC) -- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) -+ if (TARGET mimalloc-static) -+ list(APPEND ARROW_LINK_LIBS mimalloc-static) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) -+ else() -+ list(APPEND ARROW_LINK_LIBS mimalloc) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) -+ endif() - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index bc38952..62bf314 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -954,7 +954,7 @@ endif() - - if(ARROW_BOOST_REQUIRED) - resolve_dependency(Boost -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_BOOST_REQUIRED_VERSION} -@@ -965,7 +965,7 @@ if(ARROW_BOOST_REQUIRED) - if(TARGET Boost::system) - set(BOOST_SYSTEM_LIBRARY Boost::system) - set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem) -- elseif(BoostAlt_FOUND) -+ elseif(Boost_FOUND) - set(BOOST_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY}) - set(BOOST_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY}) - else() -@@ -1108,9 +1108,9 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) -+ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon -+ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) - endif() -@@ -1302,22 +1302,17 @@ endmacro() - if(ARROW_NEED_GFLAGS) - set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") - resolve_dependency(gflags -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_GFLAGS_REQUIRED_VERSION} - IS_RUNTIME_DEPENDENCY - FALSE) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) -+ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) - -- if(NOT TARGET ${GFLAGS_LIBRARIES}) -- if(TARGET gflags-shared) -- set(GFLAGS_LIBRARIES gflags-shared) -- elseif(TARGET gflags_shared) -- set(GFLAGS_LIBRARIES gflags_shared) -- endif() -- endif() -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${gflags_LIBRARIES_TARGETS}) -+ set(GFLAGS_LIBRARIES gflags::gflags) - endif() - - # ---------------------------------------------------------------------- -@@ -1411,9 +1406,9 @@ if(ARROW_WITH_THRIFT) - thrift) - endif() - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) - -- string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) -+ string(REPLACE "." ";" VERSION_LIST ${Thrift_VERSION}) - list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) - list(GET VERSION_LIST 1 THRIFT_VERSION_MINOR) - list(GET VERSION_LIST 2 THRIFT_VERSION_PATCH) -@@ -1528,6 +1523,7 @@ if(ARROW_WITH_PROTOBUF) - set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") - endif() - resolve_dependency(Protobuf -+ USE_CONFIG - REQUIRED_VERSION - ${ARROW_PROTOBUF_REQUIRED_VERSION} - PC_PACKAGE_NAMES -@@ -1538,7 +1534,7 @@ if(ARROW_WITH_PROTOBUF) - endif() - - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR}) -+ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) - - if(TARGET arrow::protobuf::libprotobuf) - set(ARROW_PROTOBUF_LIBPROTOBUF arrow::protobuf::libprotobuf) -@@ -1547,9 +1543,9 @@ if(ARROW_WITH_PROTOBUF) - if(NOT TARGET protobuf::libprotobuf) - add_library(protobuf::libprotobuf UNKNOWN IMPORTED) - set_target_properties(protobuf::libprotobuf -- PROPERTIES IMPORTED_LOCATION "${PROTOBUF_LIBRARY}" -+ PROPERTIES IMPORTED_LOCATION "${Protobuf_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES -- "${PROTOBUF_INCLUDE_DIR}") -+ "${Protobuf_INCLUDE_DIR}") - endif() - set(ARROW_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) - endif() -@@ -1569,7 +1565,7 @@ if(ARROW_WITH_PROTOBUF) - set_target_properties(protobuf::libprotoc - PROPERTIES IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES -- "${PROTOBUF_INCLUDE_DIR}") -+ "${Protobuf_INCLUDE_DIR}") - endif() - set(ARROW_PROTOBUF_LIBPROTOC protobuf::libprotoc) - endif() -@@ -1600,6 +1596,7 @@ endif() - # jemalloc - Unix-only high-performance allocator - - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1665,12 +1662,18 @@ if(ARROW_JEMALLOC) - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS}) -+endif() - endif() - - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+if(0) - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1716,6 +1719,11 @@ if(ARROW_MIMALLOC) - add_dependencies(toolchain mimalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -2001,7 +2009,7 @@ endmacro() - if(ARROW_WITH_RAPIDJSON) - set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") - resolve_dependency(RapidJSON -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_RAPIDJSON_REQUIRED_VERSION} -@@ -2038,10 +2046,9 @@ endmacro() - - if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" - )) -- set(xsimd_SOURCE "BUNDLED") - resolve_dependency(xsimd) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) -+ include_directories(SYSTEM ${xsimd_INCLUDE_DIR}) - endif() - - macro(build_zlib) -@@ -2140,10 +2147,14 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) -+ resolve_dependency(lz4) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) -+ if (TARGET LZ4::lz4_static) -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) -+ else() -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) -+ endif() - include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) - endif() - -@@ -2274,7 +2285,7 @@ if(ARROW_WITH_RE2) - # Don't specify "PC_PACKAGE_NAMES re2" here because re2.pc may - # include -std=c++11. It's not compatible with C source and C++ - # source not uses C++ 11. -- resolve_dependency(re2 HAVE_ALT TRUE) -+ resolve_dependency(re2 USE_CONFIG TRUE) - if(${re2_SOURCE} STREQUAL "SYSTEM") - get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION) - string(APPEND ARROW_PC_LIBS_PRIVATE " ${RE2_LIB}") -@@ -2337,7 +2348,7 @@ endmacro() - if(ARROW_WITH_BZ2) - resolve_dependency(BZip2) - if(${BZip2_SOURCE} STREQUAL "SYSTEM") -- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") -+ string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZip2_LIBRARIES}") - endif() - - if(NOT TARGET BZip2::BZip2) -@@ -2346,7 +2357,7 @@ if(ARROW_WITH_BZ2) - PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") - endif() -- include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") -+ include_directories(SYSTEM "${BZip2_INCLUDE_DIR}") - endif() - - macro(build_utf8proc) -@@ -3555,7 +3566,7 @@ if(ARROW_WITH_GRPC) - set(gRPC_SOURCE "${Protobuf_SOURCE}") - endif() - resolve_dependency(gRPC -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_GRPC_REQUIRED_VERSION} -@@ -3573,9 +3584,9 @@ if(ARROW_WITH_GRPC) - else() - # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp - # depending on the gRPC version. -- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -+ if(EXISTS ${gRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE TRUE) -- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") -+ elseif(EXISTS ${gPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE FALSE) - else() - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") -@@ -4097,9 +4108,9 @@ macro(build_opentelemetry) - endmacro() - - if(ARROW_WITH_OPENTELEMETRY) -- set(opentelemetry-cpp_SOURCE "AUTO") -+ set(opentelemetry-cpp_SOURCE "SYSTEM") - resolve_dependency(opentelemetry-cpp) -- get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api -+ get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::opentelemetry_common - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) - message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index b984bc1..2c78cd9 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -323,10 +323,14 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() - if(ARROW_MIMALLOC) -- list(APPEND _allocator_dependencies mimalloc_ep) -+ if (TARGET mimalloc-static) -+ list(APPEND _allocator_dependencies mimalloc-static) -+ else() -+ list(APPEND _allocator_dependencies mimalloc) -+ endif() - endif() - - if(_allocator_dependencies) -diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt -index 2cf8c99..90ebb9a 100644 ---- a/cpp/src/arrow/flight/CMakeLists.txt -+++ b/cpp/src/arrow/flight/CMakeLists.txt -@@ -17,6 +17,9 @@ - - add_custom_target(arrow_flight) - -+# TODO: This is a temporary workaround. absl should be LINKED as TARGET. -+include_directories(SYSTEM ${absl_INCLUDE_DIR}) -+ - arrow_install_all_headers("arrow/flight") - - set(ARROW_FLIGHT_LINK_LIBS gRPC::grpc++ ${ARROW_PROTOBUF_LIBPROTOBUF}) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index 2dcfb01..0394c01 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -48,7 +48,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC diff --git a/recipes/arrow/all/patches/8.0.0-0005-install-utils.patch b/recipes/arrow/all/patches/8.0.0-0005-install-utils.patch deleted file mode 100644 index 397c4b1d043c7..0000000000000 --- a/recipes/arrow/all/patches/8.0.0-0005-install-utils.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index aba18c8..bb463d0 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -721,7 +721,7 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) -+ list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) - if(Lz4_SOURCE STREQUAL "SYSTEM") - list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) - endif() -@@ -907,8 +907,8 @@ endif() - if(ARROW_JEMALLOC) - add_definitions(-DARROW_JEMALLOC) - add_definitions(-DARROW_JEMALLOC_INCLUDE_DIR=${JEMALLOC_INCLUDE_DIR}) -- list(APPEND ARROW_LINK_LIBS jemalloc::jemalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS jemalloc::jemalloc) -+ list(APPEND ARROW_LINK_LIBS jemalloc) -+ list(APPEND ARROW_STATIC_LINK_LIBS jemalloc) - endif() - - if(ARROW_MIMALLOC) -diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt -index 495018e..3dcb35d 100644 ---- a/cpp/src/arrow/ipc/CMakeLists.txt -+++ b/cpp/src/arrow/ipc/CMakeLists.txt -@@ -61,9 +61,13 @@ endif() - if(ARROW_BUILD_UTILITIES OR ARROW_BUILD_INTEGRATION) - add_executable(arrow-file-to-stream file_to_stream.cc) - target_link_libraries(arrow-file-to-stream ${ARROW_UTIL_LIB}) -+ install(TARGETS arrow-file-to-stream ${INSTALL_IS_OPTIONAL} -+ DESTINATION ${CMAKE_INSTALL_BINDIR}) - add_executable(arrow-stream-to-file stream_to_file.cc) - target_link_libraries(arrow-stream-to-file ${ARROW_UTIL_LIB}) -- -+ install(TARGETS arrow-stream-to-file ${INSTALL_IS_OPTIONAL} -+ DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ - if(ARROW_BUILD_INTEGRATION) - add_dependencies(arrow-integration arrow-file-to-stream) - add_dependencies(arrow-integration arrow-stream-to-file) diff --git a/recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch b/recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch deleted file mode 100644 index eb60d6e795ad5..0000000000000 --- a/recipes/arrow/all/patches/8.0.0-0006-fix-cmake.patch +++ /dev/null @@ -1,425 +0,0 @@ -diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt -index bb463d0..ce2d1df 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -705,7 +705,7 @@ endif() - - if(ARROW_WITH_BROTLI) - # Order is important for static linking -- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) -+ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) - list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) - list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) - if(Brotli_SOURCE STREQUAL "SYSTEM") -@@ -721,11 +721,18 @@ if(ARROW_WITH_BZ2) - endif() - - if(ARROW_WITH_LZ4) -- list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) -- if(Lz4_SOURCE STREQUAL "SYSTEM") -- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) -+ if (TARGET LZ4::lz4_static) -+ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) -+ if(Lz4_SOURCE STREQUAL "SYSTEM") -+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_static) -+ endif() -+ else() -+ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_shared) -+ if(Lz4_SOURCE STREQUAL "SYSTEM") -+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_shared) - endif() - endif() -+endif() - - if(ARROW_WITH_SNAPPY) - list(APPEND ARROW_STATIC_LINK_LIBS Snappy::snappy) -@@ -913,8 +920,13 @@ endif() - - if(ARROW_MIMALLOC) - add_definitions(-DARROW_MIMALLOC) -- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) -- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) -+ if (TARGET mimalloc-static) -+ list(APPEND ARROW_LINK_LIBS mimalloc-static) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) -+ else() -+ list(APPEND ARROW_LINK_LIBS mimalloc) -+ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) -+ endif() - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake -index f070323..16faf73 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -959,6 +959,7 @@ endif() - # - Tests need Boost at runtime. - # - S3FS and Flight benchmarks need Boost at runtime. - if(ARROW_BUILD_INTEGRATION -+ OR ARROW_BOOST_REQUIRED - OR ARROW_BUILD_TESTS - OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) - OR (ARROW_S3 AND ARROW_BUILD_BENCHMARKS)) -@@ -975,7 +976,7 @@ endif() - - if(ARROW_BOOST_REQUIRED) - resolve_dependency(Boost -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_BOOST_REQUIRED_VERSION} -@@ -986,7 +987,7 @@ if(ARROW_BOOST_REQUIRED) - if(TARGET Boost::system) - set(BOOST_SYSTEM_LIBRARY Boost::system) - set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem) -- elseif(BoostAlt_FOUND) -+ elseif(Boost_FOUND) - set(BOOST_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY}) - set(BOOST_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY}) - else() -@@ -1129,9 +1130,9 @@ macro(build_brotli) - endmacro() - - if(ARROW_WITH_BROTLI) -- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) -+ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon -+ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) - endif() -@@ -1323,22 +1324,16 @@ endmacro() - if(ARROW_NEED_GFLAGS) - set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") - resolve_dependency(gflags -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_GFLAGS_REQUIRED_VERSION} - IS_RUNTIME_DEPENDENCY - FALSE) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) -- -- if(NOT TARGET ${GFLAGS_LIBRARIES}) -- if(TARGET gflags-shared) -- set(GFLAGS_LIBRARIES gflags-shared) -- elseif(TARGET gflags_shared) -- set(GFLAGS_LIBRARIES gflags_shared) -- endif() -- endif() -+ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${gflags_LIBRARIES_TARGETS}) -+ set(GFLAGS_LIBRARIES gflags::gflags) - endif() - - # ---------------------------------------------------------------------- -@@ -1432,9 +1427,9 @@ if(ARROW_WITH_THRIFT) - thrift) - endif() - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) - -- string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) -+ string(REPLACE "." ";" VERSION_LIST ${Thrift_VERSION}) - list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) - list(GET VERSION_LIST 1 THRIFT_VERSION_MINOR) - list(GET VERSION_LIST 2 THRIFT_VERSION_PATCH) -@@ -1557,6 +1552,7 @@ if(ARROW_WITH_PROTOBUF) - set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") - endif() - resolve_dependency(Protobuf -+ USE_CONFIG - REQUIRED_VERSION - ${ARROW_PROTOBUF_REQUIRED_VERSION} - PC_PACKAGE_NAMES -@@ -1567,7 +1563,7 @@ if(ARROW_WITH_PROTOBUF) - endif() - - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR}) -+ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) - - if(TARGET arrow::protobuf::libprotobuf) - set(ARROW_PROTOBUF_LIBPROTOBUF arrow::protobuf::libprotobuf) -@@ -1576,9 +1572,9 @@ if(ARROW_WITH_PROTOBUF) - if(NOT TARGET protobuf::libprotobuf) - add_library(protobuf::libprotobuf UNKNOWN IMPORTED) - set_target_properties(protobuf::libprotobuf -- PROPERTIES IMPORTED_LOCATION "${PROTOBUF_LIBRARY}" -+ PROPERTIES IMPORTED_LOCATION "${Protobuf_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES -- "${PROTOBUF_INCLUDE_DIR}") -+ "${Protobuf_INCLUDE_DIR}") - endif() - set(ARROW_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) - endif() -@@ -1598,7 +1594,7 @@ if(ARROW_WITH_PROTOBUF) - set_target_properties(protobuf::libprotoc - PROPERTIES IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES -- "${PROTOBUF_INCLUDE_DIR}") -+ "${Protobuf_INCLUDE_DIR}") - endif() - set(ARROW_PROTOBUF_LIBPROTOC protobuf::libprotoc) - endif() -@@ -1690,11 +1686,12 @@ macro(build_substrait) - - add_custom_target(substrait_gen ALL DEPENDS ${SUBSTRAIT_PROTO_GEN_ALL}) - -- set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${PROTOBUF_INCLUDE_DIR}) -+ set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${protobuf_INCLUDE_DIR}) - - add_library(substrait STATIC ${SUBSTRAIT_SOURCES}) - set_target_properties(substrait PROPERTIES POSITION_INDEPENDENT_CODE ON) - target_include_directories(substrait PUBLIC ${SUBSTRAIT_INCLUDES}) -+ target_include_directories(substrait PUBLIC ${PROTOBUF_INCLUDE_DIR}) - target_link_libraries(substrait INTERFACE ${ARROW_PROTOBUF_LIBPROTOBUF}) - add_dependencies(substrait substrait_gen) - -@@ -1711,6 +1708,7 @@ endif() - # jemalloc - Unix-only high-performance allocator - - if(ARROW_JEMALLOC) -+if(0) - message(STATUS "Building (vendored) jemalloc from source") - # We only use a vendored jemalloc as we want to control its version. - # Also our build of jemalloc is specially prefixed so that it will not -@@ -1780,12 +1778,18 @@ if(ARROW_JEMALLOC) - add_dependencies(jemalloc::jemalloc jemalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) -+else() -+ find_package(jemalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS}) -+endif() - endif() - - # ---------------------------------------------------------------------- - # mimalloc - Cross-platform high-performance allocator, from Microsoft - - if(ARROW_MIMALLOC) -+if(0) - message(STATUS "Building (vendored) mimalloc from source") - # We only use a vendored mimalloc as we want to control its build options. - -@@ -1836,6 +1840,11 @@ if(ARROW_MIMALLOC) - add_dependencies(toolchain mimalloc_ep) - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") -+ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -2121,7 +2130,7 @@ endmacro() - if(ARROW_WITH_RAPIDJSON) - set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") - resolve_dependency(RapidJSON -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_RAPIDJSON_REQUIRED_VERSION} -@@ -2158,10 +2167,10 @@ endmacro() - - if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" - )) -- set(xsimd_SOURCE "BUNDLED") -+ set(xsimd_SOURCE "SYSTEM") - resolve_dependency(xsimd) - # TODO: Don't use global includes but rather target_include_directories -- include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) -+ include_directories(SYSTEM ${xsimd_INCLUDE_DIR}) - endif() - - macro(build_zlib) -@@ -2260,10 +2269,14 @@ macro(build_lz4) - endmacro() - - if(ARROW_WITH_LZ4) -- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) -+ resolve_dependency(Lz4) - - # TODO: Don't use global includes but rather target_include_directories -- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) -+ if (TARGET LZ4::lz4_static) -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) -+ else() -+ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) -+ endif() - include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) - endif() - -@@ -2394,7 +2407,7 @@ if(ARROW_WITH_RE2) - # Don't specify "PC_PACKAGE_NAMES re2" here because re2.pc may - # include -std=c++11. It's not compatible with C source and C++ - # source not uses C++ 11. -- resolve_dependency(re2 HAVE_ALT TRUE) -+ resolve_dependency(re2 USE_CONFIG TRUE) - if(${re2_SOURCE} STREQUAL "SYSTEM") - get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION_${UPPERCASE_BUILD_TYPE}) - if(NOT RE2_LIB) -@@ -2464,7 +2477,7 @@ endmacro() - if(ARROW_WITH_BZ2) - resolve_dependency(BZip2) - if(${BZip2_SOURCE} STREQUAL "SYSTEM") -- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") -+ string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZip2_LIBRARIES}") - endif() - - if(NOT TARGET BZip2::BZip2) -@@ -2473,7 +2486,7 @@ if(ARROW_WITH_BZ2) - PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") - endif() -- include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") -+ include_directories(SYSTEM "${BZip2_INCLUDE_DIR}") - endif() - - macro(build_utf8proc) -@@ -3709,7 +3722,7 @@ if(ARROW_WITH_GRPC) - set(gRPC_SOURCE "${Protobuf_SOURCE}") - endif() - resolve_dependency(gRPC -- HAVE_ALT -+ USE_CONFIG - TRUE - REQUIRED_VERSION - ${ARROW_GRPC_REQUIRED_VERSION} -@@ -3727,9 +3740,9 @@ if(ARROW_WITH_GRPC) - else() - # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp - # depending on the gRPC version. -- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") -+ if(EXISTS ${gRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE TRUE) -- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") -+ elseif(EXISTS ${gRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h) - set(GRPCPP_PP_INCLUDE FALSE) - else() - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") -@@ -3937,7 +3950,7 @@ macro(build_google_cloud_cpp_storage) - endmacro() - - if(ARROW_WITH_GOOGLE_CLOUD_CPP) -- resolve_dependency(google_cloud_cpp_storage) -+ resolve_dependency(google_cloud_cpp) - get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${google_cloud_cpp_storage_INCLUDE_DIR}) -@@ -4264,9 +4277,9 @@ if(ARROW_WITH_OPENTELEMETRY) - # cURL is required whether we build from source or use an existing installation - # (OTel's cmake files do not call find_curl for you) - find_curl() -- set(opentelemetry-cpp_SOURCE "AUTO") -+ set(opentelemetry-cpp_SOURCE "SYSTEM") - resolve_dependency(opentelemetry-cpp) -- get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api -+ get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::opentelemetry_common - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) - message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index 690c51a..752f3b9 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -326,10 +326,14 @@ set(ARROW_TESTING_SRCS - - set(_allocator_dependencies "") # Empty list - if(ARROW_JEMALLOC) -- list(APPEND _allocator_dependencies jemalloc_ep) -+ list(APPEND _allocator_dependencies jemalloc::jemalloc) - endif() - if(ARROW_MIMALLOC) -- list(APPEND _allocator_dependencies mimalloc_ep) -+ if (TARGET mimalloc-static) -+ list(APPEND _allocator_dependencies mimalloc-static) -+ else() -+ list(APPEND _allocator_dependencies mimalloc) -+ endif() - endif() - - if(_allocator_dependencies) -diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt -index f9d1356..c9bcf79 100644 ---- a/cpp/src/arrow/flight/CMakeLists.txt -+++ b/cpp/src/arrow/flight/CMakeLists.txt -@@ -17,6 +17,9 @@ - - add_custom_target(arrow_flight) - -+# TODO: This is a temporary workaround. absl should be LINKED as TARGET. -+include_directories(SYSTEM ${absl_INCLUDE_DIR}) -+ - arrow_install_all_headers("arrow/flight") - - set(ARROW_FLIGHT_LINK_LIBS gRPC::grpc++ ${ARROW_PROTOBUF_LIBPROTOBUF}) -diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc -index ed1c2d8..37a89da 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -52,7 +52,7 @@ - // Needed to support jemalloc 3 and 4 - #define JEMALLOC_MANGLE - // Explicitly link to our version of jemalloc --#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" -+#include "jemalloc/jemalloc.h" - #endif - - #ifdef ARROW_MIMALLOC -diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt -index 71faf9a..3aabea1 100644 ---- a/cpp/src/gandiva/CMakeLists.txt -+++ b/cpp/src/gandiva/CMakeLists.txt -@@ -25,7 +25,7 @@ add_custom_target(gandiva-benchmarks) - - add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) - --find_package(LLVMAlt REQUIRED) -+find_package(LLVM REQUIRED) - - if(LLVM_VERSION_MAJOR LESS "10") - set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) -@@ -40,7 +40,7 @@ endif() - - add_definitions(-DGANDIVA_LLVM_VERSION=${LLVM_VERSION_MAJOR}) - --find_package(OpenSSLAlt REQUIRED) -+find_package(OpenSSL REQUIRED) - - # Set the path where the bitcode file generated, see precompiled/CMakeLists.txt - set(GANDIVA_PRECOMPILED_BC_PATH "${CMAKE_CURRENT_BINARY_DIR}/irhelpers.bc") -@@ -98,10 +98,11 @@ set(SRC_FILES - random_generator_holder.cc - ${GANDIVA_PRECOMPILED_CC_PATH}) - --set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE -- ${GANDIVA_OPENSSL_LIBS}) -+set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core NTERFACE -+ ${GANDIVA_OPENSSL_LIBS}) -+ -+set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core ${GANDIVA_OPENSSL_LIBS}) - --set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE ${GANDIVA_OPENSSL_LIBS}) - - if(ARROW_GANDIVA_STATIC_LIBSTDCPP AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX - )) -@@ -139,7 +140,7 @@ add_arrow_lib(gandiva - arrow_dependencies - precompiled - EXTRA_INCLUDES -- $ -+ $ - ${GANDIVA_OPENSSL_INCLUDE_DIR} - ${UTF8PROC_INCLUDE_DIR} - SHARED_LINK_FLAGS diff --git a/recipes/arrow/all/test_package/CMakeLists.txt b/recipes/arrow/all/test_package/CMakeLists.txt index 9b721bbe6a17c..62e6d3f928dd5 100644 --- a/recipes/arrow/all/test_package/CMakeLists.txt +++ b/recipes/arrow/all/test_package/CMakeLists.txt @@ -1,10 +1,16 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(Arrow REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE arrow::arrow) + +if (TARGET Arrow::arrow_shared) + target_link_libraries(${PROJECT_NAME} PRIVATE Arrow::arrow_shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE Arrow::arrow_static) +endif() + if (${Arrow_VERSION} VERSION_LESS "10.0.0") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) else() diff --git a/recipes/arrow/all/test_v1_package/CMakeLists.txt b/recipes/arrow/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2a9b48732268c..0000000000000 --- a/recipes/arrow/all/test_v1_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(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/arrow/all/test_v1_package/conanfile.py b/recipes/arrow/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/arrow/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/arrow/config.yml b/recipes/arrow/config.yml index c3c169ecfec73..6c7e62f82a602 100644 --- a/recipes/arrow/config.yml +++ b/recipes/arrow/config.yml @@ -1,29 +1,15 @@ versions: - "14.0.2": - folder: all - "14.0.1": - folder: all - "14.0.0": - folder: all - "13.0.0": - folder: all - "12.0.1": + "19.0.1": folder: all - "12.0.0": + "18.1.0": folder: all - "11.0.0": + "18.0.0": folder: all - "10.0.1": + "17.0.0": folder: all - "10.0.0": + "16.1.0": folder: all - "8.0.1": - folder: all - "8.0.0": - folder: all - "7.0.0": - folder: all - "2.0.0": - folder: all - "1.0.0": + "15.0.0": folder: all + "14.0.2": + folder: all \ No newline at end of file diff --git a/recipes/arsenalgear/all/conandata.yml b/recipes/arsenalgear/all/conandata.yml index 3b459d19be1fc..b4fd8ef5a1604 100644 --- a/recipes/arsenalgear/all/conandata.yml +++ b/recipes/arsenalgear/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: "https://github.com/JustWhit3/arsenalgear-cpp/archive/refs/tags/v2.1.1.tar.gz" + sha256: "5bcad6f0a2dfa3c271a532d60bfd7e45dd150fdd3c12503354718ff2b62ce967" "2.1.0": url: "https://github.com/JustWhit3/arsenalgear-cpp/archive/refs/tags/v2.1.0.tar.gz" sha256: "2548a0452f3c290f4912ccc3511ae70be62ef4cd8e5d372e27423184d72785f9" @@ -8,3 +11,13 @@ sources: "1.2.2": url: "https://github.com/JustWhit3/arsenalgear-cpp/archive/refs/tags/v1.2.2.tar.gz" sha256: "556155d0be0942bcdd5df02fcda258579915e76b5a70e7220de6ef38c8ca7779" +patches: + "2.1.1": + - patch_file: "patches/2.1.1-0001-fix-cmake.patch" + patch_description: "disable cppcheck" + patch_type: "conan" + "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 3c60d7e171cb3..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): @@ -64,9 +67,8 @@ def requirements(self): 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/arsenalgear/all/patches/2.1.1-0001-fix-cmake.patch b/recipes/arsenalgear/all/patches/2.1.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..b982bc01e9479 --- /dev/null +++ b/recipes/arsenalgear/all/patches/2.1.1-0001-fix-cmake.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e5a01e7..17fb0e5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,7 +47,7 @@ endif() + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS}" ) + + # Adding cppcheck properties +-if( CMAKE_BUILD_TYPE STREQUAL "Debug" ) ++if(0) + set( cppcheck cppcheck "--enable=warning" "--inconclusive" "--force" "--inline-suppr" ) + set_target_properties( arsenalgear PROPERTIES CXX_CPPCHECK ${cppcheck}) + endif() diff --git a/recipes/arsenalgear/all/test_package/CMakeLists.txt b/recipes/arsenalgear/all/test_package/CMakeLists.txt index 3ff34ca782123..6ca13422fe46f 100644 --- a/recipes/arsenalgear/all/test_package/CMakeLists.txt +++ b/recipes/arsenalgear/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) diff --git a/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt b/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index bc541ea90b512..0000000000000 --- a/recipes/arsenalgear/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/arsenalgear/all/test_v1_package/conanfile.py b/recipes/arsenalgear/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/arsenalgear/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/arsenalgear/config.yml b/recipes/arsenalgear/config.yml index b3de9cadbac04..2fc28a2652c51 100644 --- a/recipes/arsenalgear/config.yml +++ b/recipes/arsenalgear/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.1": + folder: all "2.1.0": folder: all "2.0.1": diff --git a/recipes/artery-font-format/all/conandata.yml b/recipes/artery-font-format/all/conandata.yml index b248576ab34a5..d7128685d341e 100644 --- a/recipes/artery-font-format/all/conandata.yml +++ b/recipes/artery-font-format/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1": + url: "https://github.com/Chlumsky/artery-font-format/archive/v1.1.tar.gz" + sha256: "cd8eb58590d85069312b831ce5bc6eba21778ef2fa8ca8ac06e1ecf8eca53a7c" "1.0.1": url: "https://github.com/Chlumsky/artery-font-format/archive/v1.0.1.tar.gz" sha256: "23dc9450d2364c9f1a67fcb0ae8f2bef365fabc5a3f4af55d9a646f8fbcdc537" diff --git a/recipes/artery-font-format/all/conanfile.py b/recipes/artery-font-format/all/conanfile.py index 0b2ff0a648da1..ec8583e598e0b 100644 --- a/recipes/artery-font-format/all/conanfile.py +++ b/recipes/artery-font-format/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.build import check_min_cppstd from conan.tools.files import get, copy import os @@ -7,24 +8,29 @@ class ArteryFontFormatConan(ConanFile): name = "artery-font-format" + description = "Artery Atlas Font format library" license = "MIT" - homepage = "https://github.com/Chlumsky/artery-font-format" url = "https://github.com/conan-io/conan-center-index" - description = "Artery Atlas Font format library" - topics = ("artery", "font", "atlas") + homepage = "https://github.com/Chlumsky/artery-font-format" + topics = ("artery", "font", "atlas", "header-only") package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return 11 + 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): - # header only: no build step - pass - def package(self): copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) copy( @@ -39,3 +45,7 @@ def package(self): 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/artery-font-format/all/test_package/CMakeLists.txt b/recipes/artery-font-format/all/test_package/CMakeLists.txt index 240a8cec38d93..d7b8e200d1115 100644 --- a/recipes/artery-font-format/all/test_package/CMakeLists.txt +++ b/recipes/artery-font-format/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package LANGUAGES CXX) find_package(artery-font-format REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} artery-font-format::artery-font-format) +target_link_libraries(${PROJECT_NAME} PRIVATE 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 26110ca175735..3a91c9439218e 100644 --- a/recipes/artery-font-format/all/test_package/conanfile.py +++ b/recipes/artery-font-format/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" @@ -24,5 +23,4 @@ def build(self): def test(self): 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(f"{bin_path} {arfont}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/artery-font-format/all/test_package/example.arfont b/recipes/artery-font-format/all/test_package/example.arfont deleted file mode 100644 index a1530434762b6..0000000000000 Binary files a/recipes/artery-font-format/all/test_package/example.arfont and /dev/null differ diff --git a/recipes/artery-font-format/all/test_package/test_package.cpp b/recipes/artery-font-format/all/test_package/test_package.cpp index 8e85c6f96e501..ff1d420aff0b0 100644 --- a/recipes/artery-font-format/all/test_package/test_package.cpp +++ b/recipes/artery-font-format/all/test_package/test_package.cpp @@ -1,32 +1,9 @@ -#include -#include #include #include -#include int main(int argc, char *argv[]) { - if (argc < 2) { - std::cerr << "usage: test_package \n"; - return EXIT_FAILURE; - } - - FILE *const font_file = fopen(argv[1], "rb"); - if (font_file == nullptr) { - std::cerr << "couldn't open font file" << std::endl; - return EXIT_FAILURE; - } - - artery_font::StdArteryFont font; - if (!artery_font::read(font, font_file)) { - std::cerr << "couldn't read artery font" << std::endl; - return EXIT_FAILURE; - } - - if (fclose(font_file) != 0) { - std::cerr << "an error occured when closing font file" << std::endl; - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; + auto list = artery_font::StdList(5); + std::cout << "There are " << list.length() << " elements in the list" << std::endl; + return EXIT_SUCCESS; } diff --git a/recipes/artery-font-format/config.yml b/recipes/artery-font-format/config.yml index 7b06dd8bf61ea..3c69caf4158b5 100644 --- a/recipes/artery-font-format/config.yml +++ b/recipes/artery-font-format/config.yml @@ -1,4 +1,6 @@ versions: + "1.1": + folder: all "1.0.1": folder: all "1.0": diff --git a/recipes/aruco/3.x.x/conandata.yml b/recipes/aruco/3.x.x/conandata.yml index eb3415158ea14..ac03e59367f66 100644 --- a/recipes/aruco/3.x.x/conandata.yml +++ b/recipes/aruco/3.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.15": + url: "https://downloads.sourceforge.net/project/aruco/3.1.15/3.1.15.zip" + sha256: "8408ad1621b92c885b0740641ab98ec022705d48a08deb6f071ffebf455cc8b2" "3.1.12": url: "https://downloads.sourceforge.net/project/aruco/3.1.12/aruco-3.1.12.zip" sha256: "70b9ec8aa8eac6fe3f622201747a3e32c77bbb5f015e28a95c1c7c91f8ee8a09" diff --git a/recipes/aruco/3.x.x/conanfile.py b/recipes/aruco/3.x.x/conanfile.py index fb95bc3ec62e7..2e12e936c956e 100644 --- a/recipes/aruco/3.x.x/conanfile.py +++ b/recipes/aruco/3.x.x/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, rmdir +from conan.tools.files import collect_libs, copy, get, rmdir, replace_in_file import os required_conan_version = ">=1.53.0" @@ -37,8 +37,11 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("opencv/4.5.5") - self.requires("eigen/3.4.0") + # Header used in public markerdetector.h + # cv::FileStorage::FileStorage used by aruco::CameraParameters::saveToFile + self.requires("opencv/4.9.0", transitive_headers=True, transitive_libs=True) + # Header used in levmarq.h + self.requires("eigen/3.4.0", transitive_headers=False) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -55,6 +58,7 @@ def generate(self): tc.variables["USE_OWN_EIGEN3"] = False tc.generate() deps = CMakeDeps(self) + deps.set_property("eigen", "cmake_additional_variables_prefixes", ["Eigen3"]) deps.generate() def build(self): diff --git a/recipes/aruco/3.x.x/test_package/CMakeLists.txt b/recipes/aruco/3.x.x/test_package/CMakeLists.txt index 30e5df3e94e16..700f6ecd674c0 100644 --- a/recipes/aruco/3.x.x/test_package/CMakeLists.txt +++ b/recipes/aruco/3.x.x/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(aruco REQUIRED CONFIG) diff --git a/recipes/aruco/3.x.x/test_package/test_package.cpp b/recipes/aruco/3.x.x/test_package/test_package.cpp index 4632ed7b42bd6..6a6b41f258933 100644 --- a/recipes/aruco/3.x.x/test_package/test_package.cpp +++ b/recipes/aruco/3.x.x/test_package/test_package.cpp @@ -1,10 +1,10 @@ -#include -#include +#include #include #include -#include +#include +#include int main() { cv::Mat image = cv::Mat::zeros(600,600,CV_8UC3); diff --git a/recipes/aruco/3.x.x/test_v1_package/CMakeLists.txt b/recipes/aruco/3.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aruco/3.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aruco/3.x.x/test_v1_package/conanfile.py b/recipes/aruco/3.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/aruco/3.x.x/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_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/aruco/config.yml b/recipes/aruco/config.yml index 243128b45c736..84539a1974a56 100644 --- a/recipes/aruco/config.yml +++ b/recipes/aruco/config.yml @@ -1,3 +1,5 @@ versions: + "3.1.15": + folder: 3.x.x "3.1.12": folder: 3.x.x diff --git a/recipes/asio-grpc/all/conandata.yml b/recipes/asio-grpc/all/conandata.yml index a64863b4c9e25..e72143c69d47f 100644 --- a/recipes/asio-grpc/all/conandata.yml +++ b/recipes/asio-grpc/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.4.1": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v3.4.1.tar.gz" + sha256: "3ca10e22ac628e1983ba87eff4e913e751dd66294a5ea76ca94a60ac014171f9" + "2.9.2": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.9.2.tar.gz" + sha256: "a025587278b3332f4c5dd0464b3d5313fbecb89fc58a6ec1d611f693d6b51ef2" "2.7.0": url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.7.0.tar.gz" sha256: "a4a3deeabbdef37a8e7238e25b6f26b63071151c4b49e1f2f86c528da54eed79" diff --git a/recipes/asio-grpc/all/conanfile.py b/recipes/asio-grpc/all/conanfile.py index fff2d0aaef3d8..1e58084469bee 100644 --- a/recipes/asio-grpc/all/conanfile.py +++ b/recipes/asio-grpc/all/conanfile.py @@ -21,11 +21,11 @@ class AsioGrpcConan(ConanFile): settings = "os", "arch", "compiler", "build_type" options = { "backend": ["boost", "asio", "unifex"], - "local_allocator": ["auto", "memory_resource", "boost_container", "recycling_allocator"], + "local_allocator": ["memory_resource", "boost_container", "recycling_allocator"], } default_options = { "backend": "boost", - "local_allocator": "auto", + # local_allocator default handled in config_options } no_copy_source = True @@ -43,30 +43,37 @@ def _compilers_minimum_version(self): "apple-clang": "11", } - def configure(self): - self._local_allocator_option = self.options.local_allocator - if self._local_allocator_option == "auto": + def config_options(self): + if Version(self.version) >= "3.0.0": + del self.options.local_allocator + else: libcxx = self.settings.compiler.get_safe("libcxx") compiler_version = Version(self.settings.compiler.version) prefer_boost_container = libcxx and str(libcxx) == "libc++" or \ - (self.settings.compiler == "gcc" and compiler_version < "9") or \ - (self.settings.compiler == "clang" and compiler_version < "12" and libcxx and str(libcxx) == "libstdc++") - self._local_allocator_option = "boost_container" if prefer_boost_container else "memory_resource" - if self._local_allocator_option == "recycling_allocator" and self.options.backend == "unifex": - raise ConanInvalidConfiguration(f"{self.name} 'recycling_allocator' cannot be used in combination with the 'unifex' backend.") + (self.settings.compiler == "gcc" and compiler_version < "9") or \ + (self.settings.compiler == "clang" and compiler_version < "12" and libcxx and str(libcxx) == "libstdc++") + self.options.local_allocator = "boost_container" if prefer_boost_container else "memory_resource" 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.83.0") + use_latest = Version(self.version) > "2.8" + self.requires("grpc/1.67.1", transitive_headers=True, transitive_libs=True) + if (self.options.get_safe("local_allocator") == "boost_container" and Version(self.version) < "3.0.0") or self.options.backend == "boost": + version = "1.86.0" if use_latest else "1.83.0" + self.requires(f"boost/{version}", transitive_headers=True) if self.options.backend == "asio": - self.requires("asio/1.28.2") + version = "1.32.0" if use_latest else "1.29.0" + self.requires(f"asio/{version}", transitive_headers=True) if self.options.backend == "unifex": - self.requires("libunifex/cci.20220430") + self.requires("libunifex/0.4.0", transitive_headers=True, transitive_libs=True) def package_id(self): + local_allocator = None + if "local_allocator" in self.info.options: + local_allocator = self.info.options.local_allocator self.info.clear() - self.info.options.local_allocator = self._local_allocator_option + if local_allocator is not None: + # Keep the local_allocator option in the package_id + self.info.options.local_allocator = local_allocator def layout(self): cmake_layout(self, src_folder="src") @@ -74,28 +81,28 @@ def layout(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) + compiler_version = Version(self.settings.compiler.version) 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.") + if Version(self.version) == "2.7.0" and self.settings.compiler == "gcc" and compiler_version.major == "11" and \ + compiler_version < "11.3": + raise ConanInvalidConfiguration(f"{self.ref} does not support gcc 11.0-11.2") + + if self.options.get_safe("local_allocator") == "recycling_allocator" and self.options.backend == "unifex": + raise ConanInvalidConfiguration(f'{self.name} -o="&:local_allocator=recycling_allocator" cannot be used in combination with the -o="&:backend=unifex" backend.') def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.variables["ASIO_GRPC_USE_BOOST_CONTAINER"] = self._local_allocator_option == "boost_container" - tc.variables["ASIO_GRPC_USE_RECYCLING_ALLOCATOR"] = self._local_allocator_option == "recycling_allocator" + if Version(self.version) < "3.0.0": + tc.variables["ASIO_GRPC_USE_BOOST_CONTAINER"] = self.options.get_safe("local_allocator") == "boost_container" + tc.variables["ASIO_GRPC_USE_RECYCLING_ALLOCATOR"] = self.options.get_safe("local_allocator") == "recycling_allocator" tc.generate() def build(self): @@ -114,7 +121,7 @@ def package_info(self): build_modules = [os.path.join("lib", "cmake", "asio-grpc", "AsioGrpcProtobufGenerator.cmake")] - self.cpp_info.requires = ["grpc::grpc++_unsecure"] + self.cpp_info.requires = ["grpc::grpc++"] if self.options.backend == "boost": self.cpp_info.defines = ["AGRPC_BOOST_ASIO"] self.cpp_info.requires.append("boost::headers") @@ -125,7 +132,7 @@ def package_info(self): self.cpp_info.defines = ["AGRPC_UNIFEX"] self.cpp_info.requires.append("libunifex::unifex") - if self._local_allocator_option == "boost_container": + if self.options.get_safe("local_allocator") == "boost_container" and Version(self.version) < "3.0.0": self.cpp_info.requires.append("boost::container") self.cpp_info.set_property("cmake_file_name", "asio-grpc") diff --git a/recipes/asio-grpc/all/test_package/CMakeLists.txt b/recipes/asio-grpc/all/test_package/CMakeLists.txt index 3566d527f1ca9..34b2ed3655f46 100644 --- a/recipes/asio-grpc/all/test_package/CMakeLists.txt +++ b/recipes/asio-grpc/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(asio-grpc REQUIRED CONFIG) @@ -7,10 +7,6 @@ add_executable(${PROJECT_NAME} 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() diff --git a/recipes/asio-grpc/all/test_package/test_package.cpp b/recipes/asio-grpc/all/test_package/test_package.cpp index b784be03686dc..6b7094c7b7c60 100644 --- a/recipes/asio-grpc/all/test_package/test_package.cpp +++ b/recipes/asio-grpc/all/test_package/test_package.cpp @@ -16,21 +16,10 @@ int main() { boost::asio::post(grpc_context, [] {}); #ifndef CROSSCOMPILING - std::unique_ptr stub; - grpc::ClientContext client_context; - std::unique_ptr> reader; - test::TestRequest request; - test::TestReply response; - grpc::Status status; - - boost::asio::post(grpc_context, [&]() { - stub = test::Test::NewStub(grpc::CreateChannel( + boost::asio::post(grpc_context, []() { + [[maybe_unused]] auto stub = test::Test::NewStub(grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials())); - request.set_message("hello"); - reader = agrpc::request(&test::Test::Stub::AsyncUnary, *stub, - client_context, request, grpc_context); - agrpc::finish(reader, response, status, - boost::asio::bind_executor(grpc_context, [](bool) {})); + [[maybe_unused]] test::TestRequest request; }); #endif } diff --git a/recipes/asio-grpc/config.yml b/recipes/asio-grpc/config.yml index 552070583e67e..16d4966cd5a77 100644 --- a/recipes/asio-grpc/config.yml +++ b/recipes/asio-grpc/config.yml @@ -1,4 +1,8 @@ versions: + "3.4.1": + folder: all + "2.9.2": + folder: all "2.7.0": folder: all "2.6.0": diff --git a/recipes/asio/all/conandata.yml b/recipes/asio/all/conandata.yml index 5d0a18b1c54ce..0c81e75fb73d0 100644 --- a/recipes/asio/all/conandata.yml +++ b/recipes/asio/all/conandata.yml @@ -1,76 +1,33 @@ sources: + "1.34.2": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-34-2.tar.gz" + sha256: "f3bac015305fbb700545bd2959fbc52d75a1ec2e05f9c7f695801273ceb78cf5" + "1.32.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-32-0.tar.gz" + sha256: "f1b94b80eeb00bb63a3c8cef5047d4e409df4d8a3fe502305976965827d95672" + "1.31.0": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-31-0.tar.gz" + sha256: "530540f973498c2d297771af1bc852f69b27509bbb56bc7ac3309c928373286f" + "1.30.2": + url: "https://github.com/chriskohlhoff/asio/archive/asio-1-30-2.tar.gz" + sha256: "755bd7f85a4b269c67ae0ea254907c078d408cce8e1a352ad2ed664d233780e8" + # keep 1.29.0 for crowcpp-crow, restinio, fast-dds, asio-grpc "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" + # keep 1.28.1 for openscenegraph, restinio, simple-websocket-server, websocketpp "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" + # keep 1.27.0 for cppserver "1.27.0": url: "https://github.com/chriskohlhoff/asio/archive/asio-1-27-0.tar.gz" sha256: "b31c63867daaba0e460ee2c85dc508a52c81db0a7318e0d2147f444b26f80ed7" - "1.26.0": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-26-0.tar.gz" - sha256: "935583f86825b7b212479277d03543e0f419a55677fa8cb73a79a927b858a72d" - "1.24.0": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-24-0.tar.gz" - sha256: "cbcaaba0f66722787b1a7c33afe1befb3a012b5af3ad7da7ff0f6b8c9b7a8a5b" - "1.23.0": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-23-0.tar.gz" - sha256: "facae7627ce6c716add3f328eee3d78c2e6e133a46ac5ecb80897b37ebacf05e" - "1.22.1": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-22-1.tar.gz" - sha256: "30cb54a5de5e465d10ec0c2026d6b5917f5e89fffabdbabeb1475846fc9a2cf0" - "1.22.0": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-22-0.tar.gz" - sha256: "17bfd506f6d55c85a33603277a256b42ca5883bf290930040489ffeeed23724a" - "1.21.0": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-21-0.tar.gz" - sha256: "5d2d2dcb7bfb39bff941cabbfc8c27ee322a495470bf0f3a7c5238648cf5e6a9" - "1.20.0": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-20-0.tar.gz" - sha256: "34a8f07be6f54e3753874d46ecfa9b7ab7051c4e3f67103c52a33dfddaea48e6" - "1.19.2": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-19-2.tar.gz" - sha256: "5ee191aee825dfb1325cbacf643d599b186de057c88464ea98f1bae5ba4ff47a" - "1.19.1": - url: "https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-19-1.tar.gz" - sha256: "2555e0a29256de5c77d6a34b14faefd28c76555e094ba0371acb0b91d483520e" - "1.19.0": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-19-0.tar.gz" - sha256: "11bc0e22fcdfb3f0b77574ac33760a3592c0dac7e7eece7668b823c158243629" - "1.18.2": - url: "https://github.com/chriskohlhoff/asio/archive/asio-1-18-2.tar.gz" - sha256: "8d67133b89e0f8b212e9f82fdcf1c7b21a978d453811e2cd941c680e72c2ca32" + # keep 1.18.1 for packio "1.18.1": url: "https://github.com/chriskohlhoff/asio/archive/asio-1-18-1.tar.gz" sha256: "39c721b987b7a0d2fe2aee64310bd128cd8cc10f43481604d18cb2d8b342fd40" - "1.18.0": - sha256: 820688d1e0387ff55194ae20036cbae0fb3c7d11b7c3f46492369723c01df96f - url: https://github.com/chriskohlhoff/asio/archive/asio-1-18-0.tar.gz - "1.17.0": - sha256: 46406a830f8334b3789e7352ed7309a39c7c30b685b0499d289eda4fd4ae2067 - url: https://github.com/chriskohlhoff/asio/archive/asio-1-17-0.tar.gz + # keep 1.16.1 for simple-websocket-server "1.16.1": sha256: e40bbd531530f08318b7c7d7e84e457176d8eae6f5ad2e3714dc27b9131ecd35 url: https://github.com/chriskohlhoff/asio/archive/asio-1-16-1.tar.gz - "1.16.0": - sha256: c87410ea62de6245aa239b9ed2057edf01d7f66acc3f5e50add9a29343c87512 - url: https://github.com/chriskohlhoff/asio/archive/asio-1-16-0.tar.gz - "1.14.1": - sha256: 5b12ce2cdb658025e67785f954f74b052709cfc9b5941b8fb889c049b0955e1d - url: https://github.com/chriskohlhoff/asio/archive/asio-1-14-1.tar.gz - "1.14.0": - sha256: bdb01a649c24d73ca4a836662e7af442d935313ed6deef6b07f17f3bc5f78d7a - url: https://github.com/chriskohlhoff/asio/archive/asio-1-14-0.tar.gz - "1.13.0": - sha256: 54a1208d20f2104dbd6b7a04a9262f5ab649f4b7a9faf7eac4c2294e9e104c06 - url: https://github.com/chriskohlhoff/asio/archive/asio-1-13-0.tar.gz - "1.12.2": - sha256: 1de23266b956674e766cd0b6c929a11259f2284ea8e96b765cc8c67b1689e0fd - url: https://github.com/chriskohlhoff/asio/archive/asio-1-12-2.tar.gz diff --git a/recipes/asio/all/test_package/CMakeLists.txt b/recipes/asio/all/test_package/CMakeLists.txt index c41c5729ae0a5..11ec957f70835 100644 --- a/recipes/asio/all/test_package/CMakeLists.txt +++ b/recipes/asio/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(asio REQUIRED CONFIG) diff --git a/recipes/asio/all/test_package/test_package.cpp b/recipes/asio/all/test_package/test_package.cpp index fb757317ed0a3..58cfbb784c75a 100644 --- a/recipes/asio/all/test_package/test_package.cpp +++ b/recipes/asio/all/test_package/test_package.cpp @@ -2,6 +2,11 @@ int main() { - auto && service = asio::io_service{}; +#if __has_include() + auto &&service = asio::io_service{}; (void)service; +#else + auto &&context = asio::io_context{}; + (void)context; +#endif } diff --git a/recipes/asio/all/test_v1_package/CMakeLists.txt b/recipes/asio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/asio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/asio/all/test_v1_package/conanfile.py b/recipes/asio/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/asio/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_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/asio/config.yml b/recipes/asio/config.yml index 5385ba9219644..34aa120a3856f 100644 --- a/recipes/asio/config.yml +++ b/recipes/asio/config.yml @@ -1,51 +1,19 @@ versions: - "1.29.0": - folder: all - "1.28.2": - folder: all - "1.28.1": - folder: all - "1.28.0": - folder: all - "1.27.0": - folder: all - "1.26.0": - folder: all - "1.24.0": - folder: all - "1.23.0": - folder: all - "1.22.1": + "1.34.2": folder: all - "1.22.0": + "1.32.0": folder: all - "1.21.0": + "1.31.0": folder: all - "1.20.0": + "1.30.2": folder: all - "1.19.2": - folder: all - "1.19.1": + "1.29.0": folder: all - "1.19.0": + "1.28.1": folder: all - "1.18.2": + "1.27.0": folder: all "1.18.1": folder: all - "1.18.0": - folder: all - "1.17.0": - folder: all "1.16.1": folder: all - "1.16.0": - folder: all - "1.14.1": - folder: all - "1.14.0": - folder: all - "1.13.0": - folder: all - "1.12.2": - folder: all diff --git a/recipes/asmjit/all/conandata.yml b/recipes/asmjit/all/conandata.yml index c714f763c3707..f9b2147272433 100644 --- a/recipes/asmjit/all/conandata.yml +++ b/recipes/asmjit/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "cci.20241216": + url: "https://github.com/asmjit/asmjit/archive/cfc9f813cc6ccda63cad872edb32b38e0662bedb.zip" + sha256: "fc1dd360336e271e915808db513128855c2482d3794e4786757ffc0f31013f80" + "cci.20240531": + url: "https://github.com/asmjit/asmjit/archive/d6c5be2212b9a50ba56ec6d1e9b68693c62136c1.zip" + sha256: "678549712d4708d0513fb0017d03211df415387aea4c031923d4dd5c07b43db6" "cci.20230325": url: "https://github.com/asmjit/asmjit/archive/51b10b19b6631434d3f9ad536a6fb140944a36d2.zip" sha256: "4f62b1b6247864417fb50a2928d541ccf8e9273b0c3ce36ccd443c9d6ca7bc9a" diff --git a/recipes/asmjit/all/conanfile.py b/recipes/asmjit/all/conanfile.py index ad8cb46dcf24d..b3eca7f4922d7 100644 --- a/recipes/asmjit/all/conanfile.py +++ b/recipes/asmjit/all/conanfile.py @@ -2,20 +2,20 @@ 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 +from conan.errors import ConanInvalidConfiguration import os required_conan_version = ">=1.53.0" - class AsmjitConan(ConanFile): name = "asmjit" description = "AsmJit is a lightweight library for machine code " \ "generation written in C++ language." license = "Zlib" topics = ("asmjit", "compiler", "assembler", "jit") - homepage = "https://asmjit.com" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://asmjit.com" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -27,6 +27,16 @@ class AsmjitConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + } + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -40,7 +50,17 @@ 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.version >= "cci.20240531": + 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} does not support {self.settings.compiler}/{self.settings.compiler.version}." + ) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.19 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/asmjit/all/test_package/CMakeLists.txt b/recipes/asmjit/all/test_package/CMakeLists.txt index 39640d23a5929..f8fba8f71f0a1 100644 --- a/recipes/asmjit/all/test_package/CMakeLists.txt +++ b/recipes/asmjit/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(asmjit REQUIRED CONFIG) diff --git a/recipes/asmjit/all/test_package/test_package.cpp b/recipes/asmjit/all/test_package/test_package.cpp index 4b85962e0942d..f6d920ca6d627 100644 --- a/recipes/asmjit/all/test_package/test_package.cpp +++ b/recipes/asmjit/all/test_package/test_package.cpp @@ -1,27 +1,16 @@ -#include +#include -#include - -typedef int (*Func)(void); +#include "asmjit/asmjit.h" int main(int argc, char* argv[]) { asmjit::JitRuntime rt; - asmjit::CodeHolder code; code.init(rt.environment()); - asmjit::x86::Assembler a(&code); - a.mov(asmjit::x86::eax, 1); - a.ret(); - - Func fn; - asmjit::Error err = rt.add(&fn, &code); - if (err) return 1; - - int result = fn(); - printf("%d\n", result); - - rt.release(fn); + std::cout << + unsigned((ASMJIT_LIBRARY_VERSION >> 16)) << "." << + unsigned((ASMJIT_LIBRARY_VERSION >> 8) & 0xFF) << "." << + unsigned((ASMJIT_LIBRARY_VERSION ) & 0xFF) << "\n"; return 0; } diff --git a/recipes/asmjit/all/test_v1_package/CMakeLists.txt b/recipes/asmjit/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/asmjit/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/asmjit/all/test_v1_package/conanfile.py b/recipes/asmjit/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/asmjit/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_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/asmjit/config.yml b/recipes/asmjit/config.yml index ea0049ba18227..e0ace1f3b044f 100644 --- a/recipes/asmjit/config.yml +++ b/recipes/asmjit/config.yml @@ -1,4 +1,8 @@ versions: + "cci.20241216": + folder: all + "cci.20240531": + folder: all "cci.20230325": folder: all "cci.20221111": diff --git a/recipes/asmtk/all/conandata.yml b/recipes/asmtk/all/conandata.yml new file mode 100644 index 0000000000000..0305fe3116b8e --- /dev/null +++ b/recipes/asmtk/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.0.0.cci.20230718": + url: "https://github.com/asmjit/asmtk/archive/e2752c85d39da4b0c5c729737a6faa25286b8e0c.zip" + sha256: "8cce0edf5f83df44853469c58037c59ae51b3630ed48be7c2370473f89d0986d" +patches: + "0.0.0.cci.20230718": + - patch_file: "patches/0001-update-cmakelist.patch" + patch_description: "Simple update to CMakeLists.txt to let asmtk link conan asmjit::asmjit instead of trying to do some magic" + patch_type: "conan" diff --git a/recipes/asmtk/all/conanfile.py b/recipes/asmtk/all/conanfile.py new file mode 100644 index 0000000000000..4897022fb9ed0 --- /dev/null +++ b/recipes/asmtk/all/conanfile.py @@ -0,0 +1,74 @@ +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, rmdir, apply_conandata_patches, export_conandata_patches +import os + +required_conan_version = ">=2.1" + +class AsmjitConan(ConanFile): + name = "asmtk" + description = "AsmTK provides concepts that are useful mostly in AOT code-generation." + license = "Zlib" + topics = ("asmjit", "compiler", "assembler", "jit", "asmtk") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://asmjit.com" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + def requirements(self): + # INFO: asmtk/globals.h: #include + # INFO asmtk consumes asmjit directly + self.requires("asmjit/cci.20240531", transitive_headers=True) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + 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.cache_variables["ASMTK_EMBED"] = False + tc.cache_variables["ASMTK_STATIC"] = not self.options.shared + tc.cache_variables["ASMTK_TEST"] = False + tc.cache_variables["ASMJIT_EXTERNAL"] = 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): + 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, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "asmtk") + self.cpp_info.set_property("cmake_target_name", "asmjit::asmtk") + + self.cpp_info.libs = ["asmtk"] + if not self.options.shared: + self.cpp_info.defines = ["ASMTK_STATIC"] diff --git a/recipes/asmtk/all/patches/0001-update-cmakelist.patch b/recipes/asmtk/all/patches/0001-update-cmakelist.patch new file mode 100644 index 0000000000000..e471e79ea5a7b --- /dev/null +++ b/recipes/asmtk/all/patches/0001-update-cmakelist.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,7 +171,7 @@ if (NOT ASMTK_EMBED) + $<$:${ASMTK_PRIVATE_CFLAGS_DBG}> + $<$>:${ASMTK_PRIVATE_CFLAGS_REL}>) + +- if(ASMJIT_EXTERNAL) ++ if(NOT ASMJIT_EXTERNAL) + target_link_libraries(asmtk PUBLIC ${ASMJIT_LIBRARY}) + find_path(ASMJIT_INCLUDE_DIR NAMES asmjit/asmjit.h) + target_include_directories(asmtk PRIVATE ${ASMJIT_INCLUDE_DIR}) \ No newline at end of file diff --git a/recipes/asmtk/all/test_package/CMakeLists.txt b/recipes/asmtk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2b6a3fb962b42 --- /dev/null +++ b/recipes/asmtk/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(asmtk REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE asmjit::asmtk asmjit::asmjit) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/asmtk/all/test_package/conanfile.py b/recipes/asmtk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9e627ca89b29 --- /dev/null +++ b/recipes/asmtk/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" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("asmjit/[*]") # whichever version was already resolved + + 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/asmtk/all/test_package/test_package.cpp b/recipes/asmtk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..32cd848e0803c --- /dev/null +++ b/recipes/asmtk/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include + +#include +#include + + +int main(void) { + asmjit::Environment env(asmjit::Arch::kX64); + asmjit::CodeHolder code; + code.init(env); + + asmjit::x86::Assembler assembler(&code); + asmtk::AsmParser parser(&assembler); + parser.parse( + "mov rax, rbx\n" + "vaddpd zmm0, zmm1, [rax + 128]\n"); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/recipes/asmtk/config.yml b/recipes/asmtk/config.yml new file mode 100644 index 0000000000000..ec4883f2dc46a --- /dev/null +++ b/recipes/asmtk/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.0.cci.20230718": + folder: all diff --git a/recipes/assimp/5.x/conan_deps.cmake b/recipes/assimp/5.x/conan_deps.cmake new file mode 100644 index 0000000000000..11760a38b203e --- /dev/null +++ b/recipes/assimp/5.x/conan_deps.cmake @@ -0,0 +1,43 @@ +find_package(minizip REQUIRED CONFIG) +link_libraries(minizip::minizip) + +find_package(pugixml REQUIRED CONFIG) +link_libraries(pugixml::pugixml) + +find_package(utf8cpp REQUIRED CONFIG) +link_libraries(utf8cpp::utf8cpp) + +find_package(ZLIB REQUIRED CONFIG) +link_libraries(ZLIB::ZLIB) + +if(WITH_CLIPPER) + find_package(clipper REQUIRED CONFIG) + link_libraries(clipper::clipper) +endif() +if(WITH_DRACO) + find_package(draco REQUIRED CONFIG) + link_libraries(draco::draco) + add_definitions(-DASSIMP_ENABLE_DRACO) +endif() +if(WITH_KUBAZIP) + find_package(zip REQUIRED CONFIG) + link_libraries(zip::zip) +endif() +if(WITH_OPENDDL) + find_package(openddlparser REQUIRED CONFIG) + link_libraries(openddlparser::openddlparser) +endif() +if(WITH_POLY2TRI) + find_package(poly2tri REQUIRED CONFIG) + link_libraries(poly2tri::poly2tri) +endif() +if(WITH_PUGIXML) +endif() +if(WITH_RAPIDJSON) + find_package(RapidJSON REQUIRED CONFIG) + link_libraries(rapidjson::rapidjson) +endif() +if(WITH_STB) + find_package(stb REQUIRED CONFIG) + link_libraries(stb::stb) +endif() diff --git a/recipes/assimp/5.x/conandata.yml b/recipes/assimp/5.x/conandata.yml index c99892ad1d8a8..677866f0307dc 100644 --- a/recipes/assimp/5.x/conandata.yml +++ b/recipes/assimp/5.x/conandata.yml @@ -1,31 +1,22 @@ sources: - "5.2.2": - url: "https://github.com/assimp/assimp/archive/refs/tags/v5.2.2.tar.gz" - sha256: "ad76c5d86c380af65a9d9f64e8fc57af692ffd80a90f613dfc6bd945d0b80bb4" + "5.4.3": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.4.3.tar.gz" + sha256: "66dfbaee288f2bc43172440a55d0235dfc7bf885dda6435c038e8000e79582cb" + "5.4.2": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.4.2.tar.gz" + sha256: "7414861a7b038e407b510e8b8c9e58d5bf8ca76c9dfe07a01d20af388ec5086a" + "5.4.1": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.4.1.tar.gz" + sha256: "a1bf71c4eb851ca336bba301730cd072b366403e98e3739d6a024f6313b8f954" + "5.3.1": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.3.1.tar.gz" + sha256: "a07666be71afe1ad4bc008c2336b7c688aca391271188eb9108d0c6db1be53f1" + "5.2.5": + url: "https://github.com/assimp/assimp/archive/refs/tags/v5.2.5.tar.gz" + sha256: "b5219e63ae31d895d60d98001ee5bb809fb2c7b2de1e7f78ceeb600063641e1a" "5.1.6": url: "https://github.com/assimp/assimp/archive/refs/tags/v5.1.6.tar.gz" sha256: "52ad3a3776ce320c8add531dbcb2d3b93f2e1f10fcff5ac30178b09ba934d084" - "5.1.0": - url: "https://github.com/assimp/assimp/archive/refs/tags/v5.1.0.tar.gz" - sha256: "b96f609bca45cc4747bf8ea4b696816ada484aed2812e60ea4d16aae18360b0b" - "5.0.1": - url: "https://github.com/assimp/assimp/archive/refs/tags/v5.0.1.tar.gz" - sha256: "11310ec1f2ad2cd46b95ba88faca8f7aaa1efe9aa12605c55e3de2b977b3dbfc" - "5.0.0": - url: "https://github.com/assimp/assimp/archive/refs/tags/v5.0.0.tar.gz" - sha256: "b0110a91650d6bb4000e3d5c2185bf77b0ff0a2e7a284bc2c4af81b33988b63c" patches: - "5.2.2": - - patch_file: "patches/0005-fix-unzip.patch" - - patch_file: "patches/0006-unvendor-deps-5.2.x.patch" "5.1.6": - - patch_file: "patches/0004-unvendor-deps-5.1.6.patch" - patch_file: "patches/0005-fix-unzip.patch" - "5.1.0": - - patch_file: "patches/0003-unvendor-deps-5.1.x.patch" - "5.0.1": - - patch_file: "patches/0001-unvendor-deps-5.0.x.patch" - - patch_file: "patches/0002-fix-all-exporters-disabled.patch" - "5.0.0": - - patch_file: "patches/0001-unvendor-deps-5.0.x.patch" - - patch_file: "patches/0002-fix-all-exporters-disabled.patch" diff --git a/recipes/assimp/5.x/conanfile.py b/recipes/assimp/5.x/conanfile.py index 375b192d92523..f06d14969a98f 100644 --- a/recipes/assimp/5.x/conanfile.py +++ b/recipes/assimp/5.x/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import stdcpp_library +from conan.tools.build import stdcpp_library, 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, replace_in_file, rmdir -from conan.tools.microsoft import is_msvc +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -104,8 +105,29 @@ class AssimpConan(ConanFile): options.update(dict.fromkeys(_format_option_map, [True, False])) default_options.update(dict.fromkeys(_format_option_map, True)) + short_paths = True + + @property + def _min_cppstd(self): + if Version(self.version) < "5.2.0": + return 11 + return 17 + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "5.2.0": + return {} + return { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + def export_sources(self): export_conandata_patches(self) + copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -136,8 +158,6 @@ def _depends_on_rapidjson(self): @property def _depends_on_draco(self): - if Version(self.version) < "5.1.0": - return False return self.options.with_gltf or self.options.with_gltf_exporter @property @@ -146,114 +166,171 @@ def _depends_on_clipper(self): @property def _depends_on_stb(self): - if Version(self.version) < "5.1.0": - return False return self.options.with_m3d or self.options.with_m3d_exporter or \ self.options.with_pbrt_exporter - @property - def _depends_on_zlib(self): - return self.options.with_assbin or self.options.with_assbin_exporter or \ - self.options.with_assxml_exporter or self.options.with_blend or self.options.with_fbx or \ - self.options.with_q3bsp or self.options.with_x or self.options.with_xgl - @property def _depends_on_openddlparser(self): - if Version(self.version) < "5.1.0": - return False return self.options.with_opengex def requirements(self): # TODO: unvendor others libs: # - Open3DGC self.requires("minizip/1.2.13") - self.requires("utfcpp/3.2.3") - if Version(self.version) < "5.1.0": - self.requires("irrxml/1.2") - else: - self.requires("pugixml/1.13") + self.requires("pugixml/1.14") + self.requires("utfcpp/4.0.1") + self.requires("zlib/[>=1.2.11 <2]") if self._depends_on_kuba_zip: - self.requires("kuba-zip/0.2.6") + self.requires("kuba-zip/0.3.0") if self._depends_on_poly2tri: self.requires("poly2tri/cci.20130502") if self._depends_on_rapidjson: - self.requires("rapidjson/cci.20220822") - if self._depends_on_zlib: - self.requires("zlib/[>=1.2.11 <2]") + self.requires("rapidjson/cci.20230929") if self._depends_on_draco: self.requires("draco/1.5.6") if self._depends_on_clipper: - self.requires("clipper/4.10.0") # Only 4.x supported + if Version(self.version) >= "5.3.0": + self.requires("clipper/6.4.2") + else: + self.requires("clipper/4.10.0") if self._depends_on_stb: - self.requires("stb/cci.20220909") + self.requires("stb/cci.20230920") if self._depends_on_openddlparser: - self.requires("openddl-parser/0.5.0") + self.requires("openddl-parser/0.5.1") def validate(self): - if self._depends_on_clipper and Version(self.dependencies["clipper"].ref.version).major != "4": + 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 Version(self.version) < "5.3.0" and self._depends_on_clipper and Version(self.dependencies["clipper"].ref.version).major != "4": raise ConanInvalidConfiguration("Only 'clipper/4.x' is supported") + def build_requirements(self): + if Version(self.version) >= "5.4.0": + self.tool_requires("cmake/[>=3.22 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - if Version(self.version) >= "5.1.0": - tc.variables["ASSIMP_HUNTER_ENABLED"] = False - tc.variables["ASSIMP_IGNORE_GIT_HASH"] = True - tc.variables["ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR"] = False - else: - tc.variables["HUNTER_ENABLED"] = False - tc.variables["IGNORE_GIT_HASH"] = True - tc.variables["SYSTEM_IRRXML"] = True tc.variables["ASSIMP_ANDROID_JNIIOSYSTEM"] = False tc.variables["ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT"] = False tc.variables["ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT"] = False tc.variables["ASSIMP_BUILD_ASSIMP_TOOLS"] = False + tc.variables["ASSIMP_BUILD_DOCS"] = False + tc.variables["ASSIMP_BUILD_DRACO"] = False + tc.variables["ASSIMP_BUILD_FRAMEWORK"] = False + tc.variables["ASSIMP_BUILD_MINIZIP"] = False tc.variables["ASSIMP_BUILD_SAMPLES"] = False tc.variables["ASSIMP_BUILD_TESTS"] = False + tc.variables["ASSIMP_BUILD_ZLIB"] = False tc.variables["ASSIMP_DOUBLE_PRECISION"] = self.options.double_precision + tc.variables["ASSIMP_HUNTER_ENABLED"] = False + tc.variables["ASSIMP_IGNORE_GIT_HASH"] = True + tc.variables["ASSIMP_INJECT_DEBUG_POSTFIX"] = False + tc.variables["ASSIMP_INSTALL"] = True tc.variables["ASSIMP_INSTALL_PDB"] = False tc.variables["ASSIMP_NO_EXPORT"] = False - tc.variables["ASSIMP_BUILD_MINIZIP"] = False + tc.variables["ASSIMP_OPT_BUILD_PACKAGES"] = False + tc.variables["ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR"] = False + tc.variables["ASSIMP_UBSAN"] = False + tc.variables["ASSIMP_WARNINGS_AS_ERRORS"] = False + tc.variables["USE_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["ASSIMP_BUILD_USE_CCACHE"] = False + for option, (definition, _) in self._format_option_map.items(): value = self.options.get_safe(option) if value is not None: tc.variables[definition] = value if self.settings.os == "Windows": tc.preprocessor_definitions["NOMINMAX"] = 1 - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" # to avoid warnings + if Version(self.version) < "5.4.0": + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + + tc.cache_variables["CMAKE_PROJECT_Assimp_INCLUDE"] = "conan_deps.cmake" + tc.cache_variables["WITH_CLIPPER"] = self._depends_on_clipper + tc.cache_variables["WITH_DRACO"] = self._depends_on_draco + tc.cache_variables["WITH_KUBAZIP"] = self._depends_on_kuba_zip + tc.cache_variables["WITH_OPENDDL"] = self._depends_on_openddlparser + tc.cache_variables["WITH_POLY2TRI"] = self._depends_on_poly2tri + tc.cache_variables["WITH_RAPIDJSON"] = self._depends_on_rapidjson + tc.cache_variables["WITH_STB"] = self._depends_on_stb tc.generate() cd = CMakeDeps(self) + cd.set_property("rapidjson", "cmake_target_name", "rapidjson::rapidjson") + cd.set_property("utfcpp", "cmake_target_name", "utf8cpp::utf8cpp") cd.generate() + venv = VirtualBuildEnv(self) + venv.generate() + def _patch_sources(self): apply_conandata_patches(self) # Don't force several compiler and linker flags - replace_mapping = [ - ("-fPIC", ""), - ("-g ", ""), - ("SET(CMAKE_POSITION_INDEPENDENT_CODE ON)", ""), - ('SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob2 /DEBUG:FULL /Zi")', ""), - ('SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")', ""), - ('SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")', ""), - ('SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")', ""), - ("/WX", "") - ] - - for before, after in replace_mapping: - replace_in_file(self, os.path.join( - self.source_folder, "CMakeLists.txt"), before, after, strict=False) - # Take care to not use these vendored libs - vendors = ["poly2tri", "rapidjson", "utf8cpp", "zip", "unzip", "stb", "zlib", "clipper"] - if Version(self.version) < "5.1.0": - vendors.append("irrXML") - else: - vendors.extend(["pugixml", "draco", "openddlparser"]) - for vendor in vendors: - rmdir(self, os.path.join(self.source_folder, "contrib", vendor)) + for pattern in [ + "-fPIC", + "-g ", + "SET(CMAKE_POSITION_INDEPENDENT_CODE ON)", + 'SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")', + 'SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")', + ]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), pattern, "") + + for pattern in ["-Werror", "/WX"]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), pattern, "") + replace_in_file(self, os.path.join(self.source_folder, "code", "CMakeLists.txt"), pattern, "") + + # Make sure vendored libs are not used by accident by removing their subdirs + allow_vendored = ["Open3DGC"] + for contrib_dir in self.source_path.joinpath("contrib").iterdir(): + if contrib_dir.is_dir() and contrib_dir.name not in allow_vendored: + rmdir(self, contrib_dir) + + # Do not include add vendored library sources to the build + # https://github.com/assimp/assimp/blob/v5.3.1/code/CMakeLists.txt#L1151-L1159 + code_cmakelists = self.source_path.joinpath("code", "CMakeLists.txt") + content = code_cmakelists.read_text(encoding="utf-8") + for vendored_lib in [ + "unzip_compile", + "Poly2Tri", + "Clipper", + "openddl_parser", + # "open3dgc", + "ziplib", + "Pugixml", + "stb", + ]: + content = content.replace("${%s_SRCS}" % vendored_lib, "") + code_cmakelists.write_text(content, encoding="utf-8") + + # Make vendored headers redirect to external ones. + for contrib_header, include in [ + (os.path.join("clipper", "clipper.hpp"), "polyclipping/clipper.hpp"), + (os.path.join("poly2tri", "poly2tri", "poly2tri.h"), "poly2tri/poly2tri.h"), + (os.path.join("stb", "stb_image.h"), "stb_image.h"), + (os.path.join("utf8cpp", "source", "utf8.h"), "utf8.h"), + (os.path.join("zip", "src", "zip.h"), "zip/zip.h"), + ]: + save(self, os.path.join(self.source_folder, "contrib", contrib_header), + f"#include <{include}>\n") + if Version(self.version) >= "5.4.0": + rmdir(self, self.source_path.joinpath("contrib", "utf8cpp")) + + # minizip is provided via conan_deps.cmake, no need to use pkgconfig + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "use_pkgconfig(UNZIP minizip)", "set(UNZIP_FOUND TRUE)") + + # ZLIB is unvendored, no need to install it + # https://github.com/assimp/assimp/blob/v5.3.1/CMakeLists.txt#L483-L487 + # https://github.com/assimp/assimp/blob/v5.1.6/CMakeLists.txt#L463-L466 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "INSTALL( TARGETS zlib", "set(_ #") def build(self): self._patch_sources() 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 deleted file mode 100644 index 2797e98541843..0000000000000 --- a/recipes/assimp/5.x/patches/0001-unvendor-deps-5.0.x.patch +++ /dev/null @@ -1,292 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -437,10 +437,14 @@ IF(HUNTER_ENABLED) - set(ASSIMP_BUILD_MINIZIP TRUE) - ELSE(HUNTER_ENABLED) - IF ( NOT ASSIMP_BUILD_ZLIB ) -- FIND_PACKAGE(ZLIB) -+ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR -+ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR -+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) -+ find_package(ZLIB REQUIRED) -+ endif() - ENDIF( NOT ASSIMP_BUILD_ZLIB ) - -- 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 ) -- use_pkgconfig(UNZIP minizip) -+ find_package(minizip REQUIRED CONFIG) -+ set(UNZIP_FOUND TRUE) - ENDIF( NOT ASSIMP_BUILD_MINIZIP ) - ELSE ( NOT IOS ) -- IF( NOT BUILD_SHARED_LIBS ) - IF( NOT ASSIMP_BUILD_MINIZIP ) -- use_pkgconfig(UNZIP minizip) -+ find_package(minizip REQUIRED CONFIG) -+ set(UNZIP_FOUND TRUE) - ENDIF( NOT ASSIMP_BUILD_MINIZIP ) -- ENDIF ( NOT BUILD_SHARED_LIBS ) - ENDIF ( NOT IOS ) - - IF ( ASSIMP_NO_EXPORT ) ---- a/code/3MF/D3MFExporter.cpp -+++ b/code/3MF/D3MFExporter.cpp -@@ -58,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include -+# include - #endif - - namespace Assimp { ---- a/code/Blender/BlenderTessellator.h -+++ b/code/Blender/BlenderTessellator.h -@@ -147,7 +147,7 @@ namespace Assimp - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" -+# include - #endif - - namespace Assimp ---- a/code/CMakeLists.txt -+++ b/code/CMakeLists.txt -@@ -866,6 +866,7 @@ IF(HUNTER_ENABLED) - hunter_add_package(irrXML) - find_package(irrXML CONFIG REQUIRED) - ELSE(HUNTER_ENABLED) -+ find_package(irrxml REQUIRED CONFIG) - # irrXML already included in contrib directory by parent CMakeLists.txt. - ENDIF(HUNTER_ENABLED) - -@@ -874,6 +875,7 @@ IF(HUNTER_ENABLED) - hunter_add_package(utf8) - find_package(utf8 CONFIG REQUIRED) - ELSE(HUNTER_ENABLED) -+ find_package(utf8cpp REQUIRED CONFIG) - # utf8 is header-only, so Assimp doesn't need to do anything. - ENDIF(HUNTER_ENABLED) - -@@ -882,6 +884,9 @@ IF(HUNTER_ENABLED) - hunter_add_package(polyclipping) - find_package(polyclipping CONFIG REQUIRED) - ELSE(HUNTER_ENABLED) -+ if(ASSIMP_BUILD_IFC_IMPORTER) -+ find_package(clipper REQUIRED CONFIG) -+ endif() - SET( Clipper_SRCS - ../contrib/clipper/clipper.hpp - ../contrib/clipper/clipper.cpp -@@ -894,6 +899,9 @@ IF(HUNTER_ENABLED) - hunter_add_package(poly2tri) - find_package(poly2tri CONFIG REQUIRED) - ELSE(HUNTER_ENABLED) -+ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) -+ find_package(poly2tri REQUIRED CONFIG) -+ endif() - SET( Poly2Tri_SRCS - ../contrib/poly2tri/poly2tri/common/shapes.cc - ../contrib/poly2tri/poly2tri/common/shapes.h -@@ -930,6 +938,9 @@ IF(HUNTER_ENABLED) - hunter_add_package(zip) - find_package(zip CONFIG REQUIRED) - ELSE(HUNTER_ENABLED) -+ if(ASSIMP_BUILD_3MF_EXPORTER) -+ find_package(zip REQUIRED CONFIG) -+ endif() - SET( ziplib_SRCS - ../contrib/zip/src/miniz.h - ../contrib/zip/src/zip.c -@@ -1025,8 +1036,9 @@ IF(HUNTER_ENABLED) - hunter_add_package(RapidJSON) - find_package(RapidJSON CONFIG REQUIRED) - ELSE(HUNTER_ENABLED) -- INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" ) -- INCLUDE_DIRECTORIES( "../contrib" ) -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(RapidJSON REQUIRED CONFIG) -+ endif() - ENDIF(HUNTER_ENABLED) - - # VC2010 fixes -@@ -1076,13 +1088,8 @@ SET( assimp_src - ${ASSIMP_EXPORTER_SRCS} - - # Third-party libraries -- ${IrrXML_SRCS} -- ${unzip_compile_SRCS} -- ${Poly2Tri_SRCS} -- ${Clipper_SRCS} - ${openddl_parser_SRCS} - ${open3dgc_SRCS} -- ${ziplib_SRCS} - # Necessary to show the headers in the project when using the VC++ generator: - - ${PUBLIC_HEADERS} -@@ -1094,6 +1101,7 @@ IF(NOT HUNTER_ENABLED) - INCLUDE_DIRECTORIES( - ${IRRXML_INCLUDE_DIR} - ../contrib/openddlparser/include -+ ../contrib # for Open3DGC - ) - ENDIF(NOT HUNTER_ENABLED) - -@@ -1125,7 +1133,24 @@ IF(HUNTER_ENABLED) - zip::zip - ) - ELSE(HUNTER_ENABLED) -- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} ) -+ target_link_libraries(assimp irrxml::irrxml utf8cpp) -+ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR -+ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR -+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) -+ target_link_libraries(assimp ZLIB::ZLIB) -+ endif() -+ if(ASSIMP_BUILD_IFC_IMPORTER) -+ target_link_libraries(assimp clipper::clipper) -+ endif() -+ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) -+ target_link_libraries(assimp poly2tri::poly2tri) -+ endif() -+ if(ASSIMP_BUILD_3MF_EXPORTER) -+ target_link_libraries(assimp zip::zip) -+ endif() -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp rapidjson) -+ endif() - ENDIF(HUNTER_ENABLED) - - if(ASSIMP_ANDROID_JNIIOSYSTEM) -@@ -1210,8 +1235,7 @@ ENDIF(APPLE) - # assimp can #include "unzip.h" - IF(NOT HUNTER_ENABLED) - if (UNZIP_FOUND) -- INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) -- TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) -+ target_link_libraries(assimp minizip::minizip) - else (UNZIP_FOUND) - INCLUDE_DIRECTORIES("../") - endif (UNZIP_FOUND) ---- a/code/Common/BaseImporter.cpp -+++ b/code/Common/BaseImporter.cpp -@@ -344,7 +344,7 @@ std::string BaseImporter::GetExtension( const std::string& file ) { - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/utf8cpp/source/utf8.h" -+# include - #endif - - // ------------------------------------------------------------------------------------------------ ---- a/code/Common/ZipArchiveIOSystem.cpp -+++ b/code/Common/ZipArchiveIOSystem.cpp -@@ -55,7 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include -+# include - #endif - - namespace Assimp { ---- a/code/Importer/IFC/IFCGeometry.cpp -+++ b/code/Importer/IFC/IFCGeometry.cpp -@@ -53,8 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # include - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" --# include "../contrib/clipper/clipper.hpp" -+# include -+# include - #endif - - #include ---- a/code/Importer/IFC/IFCLoader.cpp -+++ b/code/Importer/IFC/IFCLoader.cpp -@@ -55,7 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # ifdef ASSIMP_USE_HUNTER - # include - # else --# include -+# include - # endif - #endif - ---- a/code/Importer/IFC/IFCOpenings.cpp -+++ b/code/Importer/IFC/IFCOpenings.cpp -@@ -53,8 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # include - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" --# include "../contrib/clipper/clipper.hpp" -+# include -+# include - #endif - - #include ---- a/code/Importer/STEPParser/STEPFileEncoding.cpp -+++ b/code/Importer/STEPParser/STEPFileEncoding.cpp -@@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include -+# include - #endif - - #include ---- a/code/MMD/MMDPmxParser.cpp -+++ b/code/MMD/MMDPmxParser.cpp -@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/utf8cpp/source/utf8.h" -+# include - #endif - #include - ---- a/code/SIB/SIBImporter.cpp -+++ b/code/SIB/SIBImporter.cpp -@@ -63,7 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # include - #else - //# include "../contrib/ConvertUTF/ConvertUTF.h" --# include "../contrib/utf8cpp/source/utf8.h" -+# include - #endif - #include - #include ---- a/code/X3D/FIReader.cpp -+++ b/code/X3D/FIReader.cpp -@@ -63,7 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/utf8cpp/source/utf8.h" -+# include - #endif - #include - #include diff --git a/recipes/assimp/5.x/patches/0002-fix-all-exporters-disabled.patch b/recipes/assimp/5.x/patches/0002-fix-all-exporters-disabled.patch deleted file mode 100644 index 2e71d7e86ff86..0000000000000 --- a/recipes/assimp/5.x/patches/0002-fix-all-exporters-disabled.patch +++ /dev/null @@ -1,253 +0,0 @@ -patch from https://github.com/assimp/assimp/pull/2759 - ---- a/code/Common/Exporter.cpp -+++ b/code/Common/Exporter.cpp -@@ -105,90 +105,88 @@ void ExportScene3MF( const char*, IOSystem*, const aiScene*, const ExportPropert - void ExportAssimp2Json(const char* , IOSystem*, const aiScene* , const Assimp::ExportProperties*); - - // ------------------------------------------------------------------------------------------------ --// global array of all export formats which Assimp supports in its current build --Exporter::ExportFormatEntry gExporters[] = -+static void setupExporterArray(std::vector &exporters) - { - #ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER -- Exporter::ExportFormatEntry( "collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada ), -+ exporters.push_back(Exporter::ExportFormatEntry( "collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada )); - #endif - - #ifndef ASSIMP_BUILD_NO_X_EXPORTER -- Exporter::ExportFormatEntry( "x", "X Files", "x", &ExportSceneXFile, -- aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs ), -+ exporters.push_back(Exporter::ExportFormatEntry( "x", "X Files", "x", &ExportSceneXFile, -+ aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs )); - #endif - - #ifndef ASSIMP_BUILD_NO_STEP_EXPORTER -- Exporter::ExportFormatEntry( "stp", "Step Files", "stp", &ExportSceneStep, 0 ), -+ exporters.push_back(Exporter::ExportFormatEntry( "stp", "Step Files", "stp", &ExportSceneStep, 0 )); - #endif - - #ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER -- Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj, -- aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ ), -- Exporter::ExportFormatEntry( "objnomtl", "Wavefront OBJ format without material file", "obj", &ExportSceneObjNoMtl, -- aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ ), -+ exporters.push_back(Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj, -+ aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ )); -+ exporters.push_back(Exporter::ExportFormatEntry( "objnomtl", "Wavefront OBJ format without material file", "obj", &ExportSceneObjNoMtl, -+ aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ )); - #endif - - #ifndef ASSIMP_BUILD_NO_STL_EXPORTER -- Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL, -+ exporters.push_back(Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL, - aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices -- ), -- Exporter::ExportFormatEntry( "stlb", "Stereolithography (binary)", "stl" , &ExportSceneSTLBinary, -+ )); -+ exporters.push_back(Exporter::ExportFormatEntry( "stlb", "Stereolithography (binary)", "stl" , &ExportSceneSTLBinary, - aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices -- ), -+ )); - #endif - - #ifndef ASSIMP_BUILD_NO_PLY_EXPORTER -- Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly, -+ exporters.push_back(Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly, - aiProcess_PreTransformVertices -- ), -- Exporter::ExportFormatEntry( "plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary, -+ )); -+ exporters.push_back(Exporter::ExportFormatEntry( "plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary, - aiProcess_PreTransformVertices -- ), -+ )); - #endif - - #ifndef ASSIMP_BUILD_NO_3DS_EXPORTER -- Exporter::ExportFormatEntry( "3ds", "Autodesk 3DS (legacy)", "3ds" , &ExportScene3DS, -- aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices ), -+ exporters.push_back(Exporter::ExportFormatEntry( "3ds", "Autodesk 3DS (legacy)", "3ds" , &ExportScene3DS, -+ aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices )); - #endif - - #ifndef ASSIMP_BUILD_NO_GLTF_EXPORTER -- Exporter::ExportFormatEntry( "gltf2", "GL Transmission Format v. 2", "gltf", &ExportSceneGLTF2, -- aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), -- Exporter::ExportFormatEntry( "glb2", "GL Transmission Format v. 2 (binary)", "glb", &ExportSceneGLB2, -- aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), -- Exporter::ExportFormatEntry( "gltf", "GL Transmission Format", "gltf", &ExportSceneGLTF, -- aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), -- Exporter::ExportFormatEntry( "glb", "GL Transmission Format (binary)", "glb", &ExportSceneGLB, -- aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), -+ exporters.push_back(Exporter::ExportFormatEntry( "gltf2", "GL Transmission Format v. 2", "gltf", &ExportSceneGLTF2, -+ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType )); -+ exporters.push_back(Exporter::ExportFormatEntry( "glb2", "GL Transmission Format v. 2 (binary)", "glb", &ExportSceneGLB2, -+ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType )); -+ exporters.push_back(Exporter::ExportFormatEntry( "gltf", "GL Transmission Format", "gltf", &ExportSceneGLTF, -+ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType )); -+ exporters.push_back(Exporter::ExportFormatEntry( "glb", "GL Transmission Format (binary)", "glb", &ExportSceneGLB, -+ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType )); - #endif - - #ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER -- Exporter::ExportFormatEntry( "assbin", "Assimp Binary File", "assbin" , &ExportSceneAssbin, 0 ), -+ exporters.push_back(Exporter::ExportFormatEntry( "assbin", "Assimp Binary File", "assbin" , &ExportSceneAssbin, 0 )); - #endif - - #ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER -- Exporter::ExportFormatEntry( "assxml", "Assimp XML Document", "assxml" , &ExportSceneAssxml, 0 ), -+ exporters.push_back(Exporter::ExportFormatEntry( "assxml", "Assimp XML Document", "assxml" , &ExportSceneAssxml, 0 )); - #endif - - #ifndef ASSIMP_BUILD_NO_X3D_EXPORTER -- Exporter::ExportFormatEntry( "x3d", "Extensible 3D", "x3d" , &ExportSceneX3D, 0 ), -+ exporters.push_back(Exporter::ExportFormatEntry( "x3d", "Extensible 3D", "x3d" , &ExportSceneX3D, 0 )); - #endif - - #ifndef ASSIMP_BUILD_NO_FBX_EXPORTER -- Exporter::ExportFormatEntry( "fbx", "Autodesk FBX (binary)", "fbx", &ExportSceneFBX, 0 ), -- Exporter::ExportFormatEntry( "fbxa", "Autodesk FBX (ascii)", "fbx", &ExportSceneFBXA, 0 ), -+ exporters.push_back(Exporter::ExportFormatEntry( "fbx", "Autodesk FBX (binary)", "fbx", &ExportSceneFBX, 0 )); -+ exporters.push_back(Exporter::ExportFormatEntry( "fbxa", "Autodesk FBX (ascii)", "fbx", &ExportSceneFBXA, 0 )); - #endif - - #ifndef ASSIMP_BUILD_NO_3MF_EXPORTER -- Exporter::ExportFormatEntry( "3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0 ), -+ exporters.push_back(Exporter::ExportFormatEntry( "3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0 )); - #endif - - #ifndef ASSIMP_BUILD_NO_ASSJSON_EXPORTER -- Exporter::ExportFormatEntry( "assjson", "Assimp JSON Document", "json", &ExportAssimp2Json, 0) -+ exporters.push_back(Exporter::ExportFormatEntry( "assjson", "Assimp JSON Document", "json", &ExportAssimp2Json, 0)); - #endif --}; -+} - --#define ASSIMP_NUM_EXPORTERS (sizeof(gExporters)/sizeof(gExporters[0])) - - - class ExporterPimpl { -@@ -205,10 +203,7 @@ public: - GetPostProcessingStepInstanceList(mPostProcessingSteps); - - // grab all built-in exporters -- if ( 0 != ( ASSIMP_NUM_EXPORTERS ) ) { -- mExporters.resize( ASSIMP_NUM_EXPORTERS ); -- std::copy( gExporters, gExporters + ASSIMP_NUM_EXPORTERS, mExporters.begin() ); -- } -+ setupExporterArray(mExporters); - } - - ~ExporterPimpl() { -@@ -252,23 +247,27 @@ Exporter :: Exporter() - - // ------------------------------------------------------------------------------------------------ - Exporter::~Exporter() { -+ ai_assert(nullptr != pimpl); - FreeBlob(); - delete pimpl; - } - - // ------------------------------------------------------------------------------------------------ - void Exporter::SetIOHandler( IOSystem* pIOHandler) { -+ ai_assert(nullptr != pimpl); - pimpl->mIsDefaultIOHandler = !pIOHandler; - pimpl->mIOSystem.reset(pIOHandler); - } - - // ------------------------------------------------------------------------------------------------ - IOSystem* Exporter::GetIOHandler() const { -+ ai_assert(nullptr != pimpl); - return pimpl->mIOSystem.get(); - } - - // ------------------------------------------------------------------------------------------------ - bool Exporter::IsDefaultIOHandler() const { -+ ai_assert(nullptr != pimpl); - return pimpl->mIsDefaultIOHandler; - } - -@@ -295,6 +294,7 @@ void Exporter::SetProgressHandler(ProgressHandler* pHandler) { - // ------------------------------------------------------------------------------------------------ - const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId, - unsigned int pPreprocessing, const ExportProperties* pProperties) { -+ ai_assert(nullptr != pimpl); - if (pimpl->blob) { - delete pimpl->blob; - pimpl->blob = nullptr; -@@ -319,6 +319,7 @@ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const cha - aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const char* pPath, - unsigned int pPreprocessing, const ExportProperties* pProperties) { - ASSIMP_BEGIN_EXCEPTION_REGION(); -+ ai_assert(nullptr != pimpl); - - // when they create scenes from scratch, users will likely create them not in verbose - // format. They will likely not be aware that there is a flag in the scene to indicate -@@ -466,11 +467,13 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c - - // ------------------------------------------------------------------------------------------------ - const char* Exporter::GetErrorString() const { -+ ai_assert(nullptr != pimpl); - return pimpl->mError.c_str(); - } - - // ------------------------------------------------------------------------------------------------ - void Exporter::FreeBlob() { -+ ai_assert(nullptr != pimpl); - delete pimpl->blob; - pimpl->blob = nullptr; - -@@ -479,11 +482,13 @@ void Exporter::FreeBlob() { - - // ------------------------------------------------------------------------------------------------ - const aiExportDataBlob* Exporter::GetBlob() const { -+ ai_assert(nullptr != pimpl); - return pimpl->blob; - } - - // ------------------------------------------------------------------------------------------------ - const aiExportDataBlob* Exporter::GetOrphanedBlob() const { -+ ai_assert(nullptr != pimpl); - const aiExportDataBlob* tmp = pimpl->blob; - pimpl->blob = nullptr; - return tmp; -@@ -491,18 +496,20 @@ const aiExportDataBlob* Exporter::GetOrphanedBlob() const { - - // ------------------------------------------------------------------------------------------------ - size_t Exporter::GetExportFormatCount() const { -+ ai_assert(nullptr != pimpl); - return pimpl->mExporters.size(); - } - - // ------------------------------------------------------------------------------------------------ - const aiExportFormatDesc* Exporter::GetExportFormatDescription( size_t index ) const { -+ ai_assert(nullptr != pimpl); - if (index >= GetExportFormatCount()) { - return nullptr; - } - - // Return from static storage if the requested index is built-in. -- if (index < sizeof(gExporters) / sizeof(gExporters[0])) { -- return &gExporters[index].mDescription; -+ if (index < pimpl->mExporters.size()) { -+ return &pimpl->mExporters[index].mDescription; - } - - return &pimpl->mExporters[index].mDescription; -@@ -510,6 +517,7 @@ const aiExportFormatDesc* Exporter::GetExportFormatDescription( size_t index ) c - - // ------------------------------------------------------------------------------------------------ - aiReturn Exporter::RegisterExporter(const ExportFormatEntry& desc) { -+ ai_assert(nullptr != pimpl); - for(const ExportFormatEntry& e : pimpl->mExporters) { - if (!strcmp(e.mDescription.id,desc.mDescription.id)) { - return aiReturn_FAILURE; -@@ -522,6 +530,7 @@ aiReturn Exporter::RegisterExporter(const ExportFormatEntry& desc) { - - // ------------------------------------------------------------------------------------------------ - void Exporter::UnregisterExporter(const char* id) { -+ ai_assert(nullptr != pimpl); - for(std::vector::iterator it = pimpl->mExporters.begin(); - it != pimpl->mExporters.end(); ++it) { - if (!strcmp((*it).mDescription.id,id)) { 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 deleted file mode 100644 index 27151094d0e71..0000000000000 --- a/recipes/assimp/5.x/patches/0003-unvendor-deps-5.1.x.patch +++ /dev/null @@ -1,364 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -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 ) -- FIND_PACKAGE(ZLIB) -+ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR -+ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR -+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) -+ find_package(ZLIB REQUIRED) -+ endif() - 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 ) -- use_pkgconfig(UNZIP minizip) -+ find_package(minizip REQUIRED CONFIG) -+ set(UNZIP_FOUND TRUE) - ENDIF() - ELSE () - IF( NOT BUILD_SHARED_LIBS ) - IF( NOT ASSIMP_BUILD_MINIZIP ) -- use_pkgconfig(UNZIP minizip) -+ find_package(minizip REQUIRED CONFIG) -+ set(UNZIP_FOUND TRUE) - ENDIF() - ENDIF () - ENDIF () ---- a/code/AssetLib/3MF/D3MFExporter.cpp -+++ b/code/AssetLib/3MF/D3MFExporter.cpp -@@ -57,7 +57,7 @@ - #ifdef ASSIMP_USE_HUNTER - #include - #else --#include -+#include - #endif - - namespace Assimp { ---- a/code/AssetLib/Blender/BlenderTessellator.h -+++ b/code/AssetLib/Blender/BlenderTessellator.h -@@ -147,7 +147,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" -+# include - #endif - - namespace Assimp ---- a/code/AssetLib/IFC/IFCGeometry.cpp -+++ b/code/AssetLib/IFC/IFCGeometry.cpp -@@ -53,8 +53,8 @@ - # include - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" --# include "../contrib/clipper/clipper.hpp" -+# include -+# include - #endif - - #include ---- a/code/AssetLib/IFC/IFCLoader.cpp -+++ b/code/AssetLib/IFC/IFCLoader.cpp -@@ -54,7 +54,7 @@ - #ifdef ASSIMP_USE_HUNTER - #include - #else --#include -+#include - #endif - #endif - ---- a/code/AssetLib/IFC/IFCOpenings.cpp -+++ b/code/AssetLib/IFC/IFCOpenings.cpp -@@ -53,8 +53,8 @@ - # include - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" --# include "../contrib/clipper/clipper.hpp" -+# include -+# include - #endif - - #include ---- a/code/AssetLib/M3D/M3DWrapper.hpp -+++ b/code/AssetLib/M3D/M3DWrapper.h -@@ -59,7 +59,7 @@ - - // Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy. - #define STBI_ONLY_PNG --#include -+#include - - #include "m3d.h" - ---- a/code/AssetLib/MMD/MMDPmxParser.cpp -+++ b/code/AssetLib/MMD/MMDPmxParser.cpp -@@ -45,7 +45,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/utf8cpp/source/utf8.h" -+# include - #endif - #include - ---- a/code/AssetLib/SIB/SIBImporter.cpp -+++ b/code/AssetLib/SIB/SIBImporter.cpp -@@ -62,7 +62,7 @@ - #include - #else - //# include "../contrib/ConvertUTF/ConvertUTF.h" --#include "../contrib/utf8cpp/source/utf8.h" -+#include - #endif - #include - #include ---- a/code/AssetLib/STEPParser/STEPFileEncoding.cpp -+++ b/code/AssetLib/STEPParser/STEPFileEncoding.cpp -@@ -48,7 +48,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include -+# include - #endif - - #include ---- a/code/CMakeLists.txt -+++ b/code/CMakeLists.txt -@@ -887,6 +887,7 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(pugixml) - find_package(pugixml CONFIG REQUIRED) - ELSE() -+ find_package(pugixml REQUIRED CONFIG) - SET( Pugixml_SRCS - ../contrib/pugixml/src/pugiconfig.hpp - ../contrib/pugixml/src/pugixml.hpp -@@ -900,6 +901,7 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(utf8) - find_package(utf8cpp CONFIG REQUIRED) - ELSE() -+ find_package(utf8cpp REQUIRED CONFIG) - # utf8 is header-only, so Assimp doesn't need to do anything. - ENDIF() - -@@ -908,6 +910,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(polyclipping) - find_package(polyclipping CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_IFC_IMPORTER) -+ find_package(clipper REQUIRED CONFIG) -+ endif() - SET( Clipper_SRCS - ../contrib/clipper/clipper.hpp - ../contrib/clipper/clipper.cpp -@@ -920,6 +925,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(poly2tri) - find_package(poly2tri CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) -+ find_package(poly2tri REQUIRED CONFIG) -+ endif() - SET( Poly2Tri_SRCS - ../contrib/poly2tri/poly2tri/common/shapes.cc - ../contrib/poly2tri/poly2tri/common/shapes.h -@@ -957,6 +965,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(zip) - find_package(zip CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_3MF_EXPORTER) -+ find_package(zip REQUIRED CONFIG) -+ endif() - SET( ziplib_SRCS - ../contrib/zip/src/miniz.h - ../contrib/zip/src/zip.c -@@ -978,6 +989,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(openddlparser) - find_package(openddlparser CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_OPENGEX_IMPORTER) -+ find_package(openddlparser REQUIRED CONFIG) -+ endif() - SET ( openddl_parser_SRCS - ../contrib/openddlparser/code/OpenDDLParser.cpp - ../contrib/openddlparser/code/DDLNode.cpp -@@ -1052,7 +1066,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(RapidJSON) - find_package(RapidJSON CONFIG REQUIRED) - ELSE() -- INCLUDE_DIRECTORIES("../contrib/rapidjson/include") -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(RapidJSON REQUIRED CONFIG) -+ endif() - ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) - option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) - if(ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR) -@@ -1065,10 +1081,12 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(stb) - find_package(stb CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) -+ find_package(stb REQUIRED CONFIG) -+ endif() - SET( stb_SRCS - ../contrib/stb/stb_image.h - ) -- INCLUDE_DIRECTORIES("../contrib") - SOURCE_GROUP( Contrib\\stb FILES ${stb_SRCS}) - ENDIF() - -@@ -1123,14 +1141,7 @@ SET( assimp_src - ${ASSIMP_EXPORTER_SRCS} - - # Third-party libraries -- ${unzip_compile_SRCS} -- ${Poly2Tri_SRCS} -- ${Clipper_SRCS} -- ${openddl_parser_SRCS} - ${open3dgc_SRCS} -- ${ziplib_SRCS} -- ${Pugixml_SRCS} -- ${stb_SRCS} - # Necessary to show the headers in the project when using the VC++ generator: - - ${PUBLIC_HEADERS} -@@ -1141,7 +1152,7 @@ ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD ) - IF(NOT ASSIMP_HUNTER_ENABLED) - INCLUDE_DIRECTORIES( - ${IRRXML_INCLUDE_DIR} -- ../contrib/openddlparser/include -+ ../contrib # for Open3DGC - ) - ENDIF() - -@@ -1150,8 +1161,8 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) - INCLUDE_DIRECTORIES(${C4D_INCLUDES}) - ENDIF () - --IF (ASSIMP_BUILD_DRACO) -- INCLUDE_DIRECTORIES(${draco_INCLUDE_DIRS}) -+if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(draco REQUIRED CONFIG) - ADD_DEFINITIONS( -DASSIMP_ENABLE_DRACO ) - ENDIF() - -@@ -1162,9 +1173,7 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp) - - # enable warnings as errors ######################################## - IF (MSVC) -- TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX) - ELSE() -- TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror) - ENDIF() - - # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler -@@ -1195,9 +1204,32 @@ IF(ASSIMP_HUNTER_ENABLED) - target_link_libraries(assimp PUBLIC ${draco_LIBRARIES}) - endif() - ELSE() -- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES}) -- if (ASSIMP_BUILD_DRACO) -- target_link_libraries(assimp ${draco_LIBRARIES}) -+ target_link_libraries(assimp pugixml::pugixml utf8cpp) -+ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR -+ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR -+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) -+ target_link_libraries(assimp ZLIB::ZLIB) -+ endif() -+ if(ASSIMP_BUILD_IFC_IMPORTER) -+ target_link_libraries(assimp clipper::clipper) -+ endif() -+ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) -+ target_link_libraries(assimp poly2tri::poly2tri) -+ endif() -+ if(ASSIMP_BUILD_3MF_EXPORTER) -+ target_link_libraries(assimp zip::zip) -+ endif() -+ if(ASSIMP_BUILD_OPENGEX_IMPORTER) -+ target_link_libraries(assimp openddlparser::openddlparser) -+ endif() -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp rapidjson) -+ endif() -+ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) -+ target_link_libraries(assimp stb::stb) -+ endif() -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp draco::draco) - endif() - ENDIF() - -@@ -1279,8 +1311,7 @@ ENDIF() - # assimp can #include "unzip.h" - IF(NOT ASSIMP_HUNTER_ENABLED) - if (UNZIP_FOUND) -- INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) -- TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) -+ target_link_libraries(assimp minizip::minizip) - else () - INCLUDE_DIRECTORIES("../") - endif () ---- a/code/Common/Assimp.cpp -+++ b/code/Common/Assimp.cpp -@@ -1290,7 +1290,7 @@ - # endif - - # define STB_IMAGE_IMPLEMENTATION --# include "stb/stb_image.h" -+# include "stb_image.h" - - # if _MSC_VER - # pragma warning(pop) ---- a/code/Common/BaseImporter.cpp -+++ b/code/Common/BaseImporter.cpp -@@ -330,7 +330,7 @@ - #ifdef ASSIMP_USE_HUNTER - #include - #else --#include "../contrib/utf8cpp/source/utf8.h" -+#include - #endif - - // ------------------------------------------------------------------------------------------------ ---- a/code/Common/ZipArchiveIOSystem.cpp -+++ b/code/Common/ZipArchiveIOSystem.cpp -@@ -54,7 +54,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include -+# include - #endif - - namespace Assimp { ---- a/code/Pbrt/PbrtExporter.cpp -+++ b/code/Pbrt/PbrtExporter.cpp -@@ -83,7 +83,7 @@ - #include - #include - --#include "stb/stb_image.h" -+#include "stb_image.h" - - using namespace Assimp; - 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 deleted file mode 100644 index dedc3847ab7ea..0000000000000 --- a/recipes/assimp/5.x/patches/0004-unvendor-deps-5.1.6.patch +++ /dev/null @@ -1,340 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -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 ) -- FIND_PACKAGE(ZLIB) -+ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR -+ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR -+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) -+ find_package(ZLIB REQUIRED) -+ endif() - 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 ) -- use_pkgconfig(UNZIP minizip) -+ find_package(minizip REQUIRED CONFIG) -+ set(UNZIP_FOUND TRUE) - ENDIF() - ELSE () - IF( NOT BUILD_SHARED_LIBS ) - IF( NOT ASSIMP_BUILD_MINIZIP ) -- use_pkgconfig(UNZIP minizip) -+ find_package(minizip REQUIRED CONFIG) -+ set(UNZIP_FOUND TRUE) - ENDIF() - ENDIF () - ENDIF () ---- a/code/AssetLib/3MF/D3MFExporter.cpp -+++ b/code/AssetLib/3MF/D3MFExporter.cpp -@@ -57,7 +57,7 @@ - #ifdef ASSIMP_USE_HUNTER - #include - #else --#include -+#include - #endif - - namespace Assimp { ---- a/code/AssetLib/Blender/BlenderTessellator.h -+++ b/code/AssetLib/Blender/BlenderTessellator.h -@@ -147,7 +147,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" -+# include - #endif - - namespace Assimp ---- a/code/AssetLib/IFC/IFCGeometry.cpp -+++ b/code/AssetLib/IFC/IFCGeometry.cpp -@@ -53,8 +53,8 @@ - # include - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" --# include "../contrib/clipper/clipper.hpp" -+# include -+# include - #endif - - #include ---- a/code/AssetLib/IFC/IFCOpenings.cpp -+++ b/code/AssetLib/IFC/IFCOpenings.cpp -@@ -53,8 +53,8 @@ - # include - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" --# include "../contrib/clipper/clipper.hpp" -+# include -+# include - #endif - - #include ---- a/code/AssetLib/M3D/M3DWrapper.h -+++ b/code/AssetLib/M3D/M3DWrapper.h -@@ -59,7 +59,7 @@ - - // Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy. - #define STBI_ONLY_PNG --#include -+#include - - #include "m3d.h" - ---- a/code/AssetLib/MMD/MMDPmxParser.cpp -+++ b/code/AssetLib/MMD/MMDPmxParser.cpp -@@ -45,7 +45,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/utf8cpp/source/utf8.h" -+# include - #endif - #include - ---- a/code/AssetLib/SIB/SIBImporter.cpp -+++ b/code/AssetLib/SIB/SIBImporter.cpp -@@ -62,7 +62,7 @@ - #include - #else - //# include "../contrib/ConvertUTF/ConvertUTF.h" --#include "../contrib/utf8cpp/source/utf8.h" -+#include - #endif - #include - #include ---- a/code/AssetLib/STEPParser/STEPFileEncoding.cpp -+++ b/code/AssetLib/STEPParser/STEPFileEncoding.cpp -@@ -48,7 +48,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include -+# include - #endif - - #include ---- a/code/CMakeLists.txt -+++ b/code/CMakeLists.txt -@@ -888,6 +888,7 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(pugixml) - find_package(pugixml CONFIG REQUIRED) - ELSE() -+ find_package(pugixml REQUIRED CONFIG) - SET( Pugixml_SRCS - ../contrib/pugixml/src/pugiconfig.hpp - ../contrib/pugixml/src/pugixml.hpp -@@ -901,6 +902,7 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(utf8) - find_package(utf8cpp CONFIG REQUIRED) - ELSE() -+ find_package(utf8cpp REQUIRED CONFIG) - # utf8 is header-only, so Assimp doesn't need to do anything. - ENDIF() - -@@ -909,6 +911,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(polyclipping) - find_package(polyclipping CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_IFC_IMPORTER) -+ find_package(clipper REQUIRED CONFIG) -+ endif() - SET( Clipper_SRCS - ../contrib/clipper/clipper.hpp - ../contrib/clipper/clipper.cpp -@@ -921,6 +926,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(poly2tri) - find_package(poly2tri CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) -+ find_package(poly2tri REQUIRED CONFIG) -+ endif() - SET( Poly2Tri_SRCS - ../contrib/poly2tri/poly2tri/common/shapes.cc - ../contrib/poly2tri/poly2tri/common/shapes.h -@@ -960,6 +968,7 @@ IF(3MF IN_LIST ASSIMP_EXPORTERS_LIST) - hunter_add_package(zip) - find_package(zip CONFIG REQUIRED) - ELSE() -+ find_package(zip REQUIRED CONFIG) - SET( ziplib_SRCS - ../contrib/zip/src/miniz.h - ../contrib/zip/src/zip.c -@@ -982,6 +991,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(openddlparser) - find_package(openddlparser CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_OPENGEX_IMPORTER) -+ find_package(openddlparser REQUIRED CONFIG) -+ endif() - SET ( openddl_parser_SRCS - ../contrib/openddlparser/code/OpenDDLParser.cpp - ../contrib/openddlparser/code/DDLNode.cpp -@@ -1056,7 +1068,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(RapidJSON) - find_package(RapidJSON CONFIG REQUIRED) - ELSE() -- INCLUDE_DIRECTORIES("../contrib/rapidjson/include") -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(RapidJSON REQUIRED CONFIG) -+ endif() - ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) - option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) - if(ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR) -@@ -1069,10 +1083,12 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(stb) - find_package(stb CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) -+ find_package(stb REQUIRED CONFIG) -+ endif() - SET( stb_SRCS - ../contrib/stb/stb_image.h - ) -- INCLUDE_DIRECTORIES("../contrib") - SOURCE_GROUP( Contrib\\stb FILES ${stb_SRCS}) - ENDIF() - -@@ -1127,14 +1143,7 @@ SET( assimp_src - ${ASSIMP_EXPORTER_SRCS} - - # Third-party libraries -- ${unzip_compile_SRCS} -- ${Poly2Tri_SRCS} -- ${Clipper_SRCS} -- ${openddl_parser_SRCS} - ${open3dgc_SRCS} -- ${ziplib_SRCS} -- ${Pugixml_SRCS} -- ${stb_SRCS} - # Necessary to show the headers in the project when using the VC++ generator: - - ${PUBLIC_HEADERS} -@@ -1145,7 +1154,7 @@ ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD ) - IF(NOT ASSIMP_HUNTER_ENABLED) - INCLUDE_DIRECTORIES( - ${IRRXML_INCLUDE_DIR} -- ../contrib/openddlparser/include -+ ../contrib # for Open3DGC - ) - ENDIF() - -@@ -1154,8 +1163,8 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) - INCLUDE_DIRECTORIES(${C4D_INCLUDES}) - ENDIF () - --IF (ASSIMP_BUILD_DRACO) -- INCLUDE_DIRECTORIES(${draco_INCLUDE_DIRS}) -+if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(draco REQUIRED CONFIG) - ADD_DEFINITIONS( -DASSIMP_ENABLE_DRACO ) - ENDIF() - -@@ -1166,9 +1175,7 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp) - - # enable warnings as errors ######################################## - IF (MSVC) -- TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX) - ELSE() -- TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror) - ENDIF() - - # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler -@@ -1201,9 +1208,32 @@ IF(ASSIMP_HUNTER_ENABLED) - target_link_libraries(assimp PUBLIC ${draco_LIBRARIES}) - endif() - ELSE() -- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES}) -- if (ASSIMP_BUILD_DRACO) -- target_link_libraries(assimp ${draco_LIBRARIES}) -+ target_link_libraries(assimp pugixml::pugixml utf8cpp) -+ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR -+ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR -+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) -+ target_link_libraries(assimp ZLIB::ZLIB) -+ endif() -+ if(ASSIMP_BUILD_IFC_IMPORTER) -+ target_link_libraries(assimp clipper::clipper) -+ endif() -+ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) -+ target_link_libraries(assimp poly2tri::poly2tri) -+ endif() -+ if(ASSIMP_BUILD_3MF_EXPORTER) -+ target_link_libraries(assimp zip::zip) -+ endif() -+ if(ASSIMP_BUILD_OPENGEX_IMPORTER) -+ target_link_libraries(assimp openddlparser::openddlparser) -+ endif() -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp rapidjson) -+ endif() -+ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) -+ target_link_libraries(assimp stb::stb) -+ endif() -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp draco::draco) - endif() - ENDIF() - -@@ -1291,8 +1321,7 @@ ENDIF() - # assimp can #include "unzip.h" - IF(NOT ASSIMP_HUNTER_ENABLED) - if (UNZIP_FOUND) -- INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) -- TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) -+ target_link_libraries(assimp minizip::minizip) - else () - INCLUDE_DIRECTORIES("../") - endif () ---- a/code/Common/Assimp.cpp -+++ b/code/Common/Assimp.cpp -@@ -1290,7 +1290,7 @@ - # endif - - # define STB_IMAGE_IMPLEMENTATION --# include "stb/stb_image.h" -+# include "stb_image.h" - - # if _MSC_VER - # pragma warning(pop) ---- a/code/Common/BaseImporter.cpp -+++ b/code/Common/BaseImporter.cpp -@@ -331,7 +331,7 @@ - #ifdef ASSIMP_USE_HUNTER - #include - #else --#include "../contrib/utf8cpp/source/utf8.h" -+#include - #endif - - // ------------------------------------------------------------------------------------------------ ---- a/code/Pbrt/PbrtExporter.cpp -+++ b/code/Pbrt/PbrtExporter.cpp -@@ -83,7 +83,7 @@ - #include - #include - --#include "stb/stb_image.h" -+#include "stb_image.h" - - using namespace Assimp; - 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 deleted file mode 100644 index 9642d329d9a0a..0000000000000 --- a/recipes/assimp/5.x/patches/0006-unvendor-deps-5.2.x.patch +++ /dev/null @@ -1,340 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -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 ) -- FIND_PACKAGE(ZLIB) -+ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR -+ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR -+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) -+ find_package(ZLIB REQUIRED) -+ endif() - 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 ) -- use_pkgconfig(UNZIP minizip) -+ find_package(minizip REQUIRED CONFIG) -+ set(UNZIP_FOUND TRUE) - ENDIF() - ELSE () - IF( NOT BUILD_SHARED_LIBS ) - IF( NOT ASSIMP_BUILD_MINIZIP ) -- use_pkgconfig(UNZIP minizip) -+ find_package(minizip REQUIRED CONFIG) -+ set(UNZIP_FOUND TRUE) - ENDIF() - ENDIF () - ENDIF () ---- a/code/AssetLib/3MF/D3MFExporter.cpp -+++ b/code/AssetLib/3MF/D3MFExporter.cpp -@@ -57,7 +57,7 @@ - #ifdef ASSIMP_USE_HUNTER - #include - #else --#include -+#include - #endif - - namespace Assimp { ---- a/code/AssetLib/Blender/BlenderTessellator.h -+++ b/code/AssetLib/Blender/BlenderTessellator.h -@@ -147,7 +147,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" -+# include - #endif - - namespace Assimp ---- a/code/AssetLib/IFC/IFCGeometry.cpp -+++ b/code/AssetLib/IFC/IFCGeometry.cpp -@@ -53,8 +53,8 @@ - # include - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" --# include "../contrib/clipper/clipper.hpp" -+# include -+# include - #endif - - #include ---- a/code/AssetLib/IFC/IFCOpenings.cpp -+++ b/code/AssetLib/IFC/IFCOpenings.cpp -@@ -53,8 +53,8 @@ - # include - # include - #else --# include "../contrib/poly2tri/poly2tri/poly2tri.h" --# include "../contrib/clipper/clipper.hpp" -+# include -+# include - #endif - - #include ---- a/code/AssetLib/M3D/M3DWrapper.h -+++ b/code/AssetLib/M3D/M3DWrapper.h -@@ -59,7 +59,7 @@ - - // Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy. - #define STBI_ONLY_PNG --#include -+#include - - #include "m3d.h" - ---- a/code/AssetLib/MMD/MMDPmxParser.cpp -+++ b/code/AssetLib/MMD/MMDPmxParser.cpp -@@ -45,7 +45,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include "../contrib/utf8cpp/source/utf8.h" -+# include - #endif - #include - ---- a/code/AssetLib/SIB/SIBImporter.cpp -+++ b/code/AssetLib/SIB/SIBImporter.cpp -@@ -59,7 +59,7 @@ - #ifdef ASSIMP_USE_HUNTER - #include - #else --#include "../contrib/utf8cpp/source/utf8.h" -+#include - #endif - #include - #include ---- a/code/AssetLib/STEPParser/STEPFileEncoding.cpp -+++ b/code/AssetLib/STEPParser/STEPFileEncoding.cpp -@@ -48,7 +48,7 @@ - #ifdef ASSIMP_USE_HUNTER - # include - #else --# include -+# include - #endif - - #include ---- a/code/CMakeLists.txt -+++ b/code/CMakeLists.txt -@@ -899,6 +899,7 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(pugixml) - find_package(pugixml CONFIG REQUIRED) - ELSE() -+ find_package(pugixml REQUIRED CONFIG) - SET( Pugixml_SRCS - ../contrib/pugixml/src/pugiconfig.hpp - ../contrib/pugixml/src/pugixml.hpp -@@ -912,6 +913,7 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(utf8) - find_package(utf8cpp CONFIG REQUIRED) - ELSE() -+ find_package(utf8cpp REQUIRED CONFIG) - # utf8 is header-only, so Assimp doesn't need to do anything. - ENDIF() - -@@ -920,6 +922,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(polyclipping) - find_package(polyclipping CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_IFC_IMPORTER) -+ find_package(clipper REQUIRED CONFIG) -+ endif() - SET( Clipper_SRCS - ../contrib/clipper/clipper.hpp - ../contrib/clipper/clipper.cpp -@@ -932,6 +937,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(poly2tri) - find_package(poly2tri CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) -+ find_package(poly2tri REQUIRED CONFIG) -+ endif() - SET( Poly2Tri_SRCS - ../contrib/poly2tri/poly2tri/common/shapes.cc - ../contrib/poly2tri/poly2tri/common/shapes.h -@@ -971,6 +979,7 @@ IF(3MF IN_LIST ASSIMP_EXPORTERS_LIST) - hunter_add_package(zip) - find_package(zip CONFIG REQUIRED) - ELSE() -+ find_package(zip REQUIRED CONFIG) - SET( ziplib_SRCS - ../contrib/zip/src/miniz.h - ../contrib/zip/src/zip.c -@@ -993,6 +1002,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(openddlparser) - find_package(openddlparser CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_OPENGEX_IMPORTER) -+ find_package(openddlparser REQUIRED CONFIG) -+ endif() - SET ( openddl_parser_SRCS - ../contrib/openddlparser/code/OpenDDLParser.cpp - ../contrib/openddlparser/code/DDLNode.cpp -@@ -1067,7 +1079,9 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(RapidJSON) - find_package(RapidJSON CONFIG REQUIRED) - ELSE() -- INCLUDE_DIRECTORIES("../contrib/rapidjson/include") -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(RapidJSON REQUIRED CONFIG) -+ endif() - ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) - option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) - if(ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR) -@@ -1080,10 +1094,12 @@ IF(ASSIMP_HUNTER_ENABLED) - hunter_add_package(stb) - find_package(stb CONFIG REQUIRED) - ELSE() -+ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) -+ find_package(stb REQUIRED CONFIG) -+ endif() - SET( stb_SRCS - ../contrib/stb/stb_image.h - ) -- INCLUDE_DIRECTORIES("../contrib") - SOURCE_GROUP( Contrib\\stb FILES ${stb_SRCS}) - ENDIF() - -@@ -1138,14 +1154,7 @@ SET( assimp_src - ${ASSIMP_EXPORTER_SRCS} - - # Third-party libraries -- ${unzip_compile_SRCS} -- ${Poly2Tri_SRCS} -- ${Clipper_SRCS} -- ${openddl_parser_SRCS} - ${open3dgc_SRCS} -- ${ziplib_SRCS} -- ${Pugixml_SRCS} -- ${stb_SRCS} - # Necessary to show the headers in the project when using the VC++ generator: - - ${PUBLIC_HEADERS} -@@ -1156,7 +1165,7 @@ ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD ) - IF(NOT ASSIMP_HUNTER_ENABLED) - INCLUDE_DIRECTORIES( - ${IRRXML_INCLUDE_DIR} -- ../contrib/openddlparser/include -+ ../contrib # for Open3DGC - ) - ENDIF() - -@@ -1165,8 +1174,8 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) - INCLUDE_DIRECTORIES(${C4D_INCLUDES}) - ENDIF () - --IF (ASSIMP_BUILD_DRACO) -- INCLUDE_DIRECTORIES(${draco_INCLUDE_DIRS}) -+if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ find_package(draco REQUIRED CONFIG) - ADD_DEFINITIONS( -DASSIMP_ENABLE_DRACO ) - ENDIF() - -@@ -1177,9 +1186,7 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp) - - # enable warnings as errors ######################################## - IF (MSVC) -- TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX) - ELSE() -- TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror) - ENDIF() - - # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler -@@ -1212,9 +1219,32 @@ IF(ASSIMP_HUNTER_ENABLED) - target_link_libraries(assimp PUBLIC ${draco_LIBRARIES}) - endif() - ELSE() -- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES}) -- if (ASSIMP_BUILD_DRACO) -- target_link_libraries(assimp ${draco_LIBRARIES}) -+ target_link_libraries(assimp pugixml::pugixml utf8cpp) -+ if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR -+ ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR -+ ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER) -+ target_link_libraries(assimp ZLIB::ZLIB) -+ endif() -+ if(ASSIMP_BUILD_IFC_IMPORTER) -+ target_link_libraries(assimp clipper::clipper) -+ endif() -+ if(ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_IFC_IMPORTER) -+ target_link_libraries(assimp poly2tri::poly2tri) -+ endif() -+ if(ASSIMP_BUILD_3MF_EXPORTER) -+ target_link_libraries(assimp zip::zip) -+ endif() -+ if(ASSIMP_BUILD_OPENGEX_IMPORTER) -+ target_link_libraries(assimp openddlparser::openddlparser) -+ endif() -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp rapidjson) -+ endif() -+ if(ASSIMP_BUILD_M3D_IMPORTER OR ASSIMP_BUILD_M3D_EXPORTER OR ASSIMP_BUILD_PBRT_EXPORTER) -+ target_link_libraries(assimp stb::stb) -+ endif() -+ if(ASSIMP_BUILD_GLTF_IMPORTER OR ASSIMP_BUILD_GLTF_EXPORTER) -+ target_link_libraries(assimp draco::draco) - endif() - ENDIF() - -@@ -1302,8 +1332,7 @@ ENDIF() - # assimp can #include "unzip.h" - IF(NOT ASSIMP_HUNTER_ENABLED) - if (UNZIP_FOUND) -- INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) -- TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) -+ target_link_libraries(assimp minizip::minizip) - else () - INCLUDE_DIRECTORIES("../") - endif () ---- a/code/Common/Assimp.cpp -+++ b/code/Common/Assimp.cpp -@@ -1290,7 +1290,7 @@ - # endif - - # define STB_IMAGE_IMPLEMENTATION --# include "stb/stb_image.h" -+# include "stb_image.h" - - # if _MSC_VER - # pragma warning(pop) ---- a/code/Common/BaseImporter.cpp -+++ b/code/Common/BaseImporter.cpp -@@ -332,7 +332,7 @@ - #ifdef ASSIMP_USE_HUNTER - #include - #else --#include "../contrib/utf8cpp/source/utf8.h" -+#include - #endif - - // ------------------------------------------------------------------------------------------------ ---- a/code/Pbrt/PbrtExporter.cpp -+++ b/code/Pbrt/PbrtExporter.cpp -@@ -83,7 +83,7 @@ - #include - #include - --#include "stb/stb_image.h" -+#include "stb_image.h" - - using namespace Assimp; - diff --git a/recipes/assimp/5.x/test_package/CMakeLists.txt b/recipes/assimp/5.x/test_package/CMakeLists.txt index 6b0a89276dbf1..600f67a4d31b0 100644 --- a/recipes/assimp/5.x/test_package/CMakeLists.txt +++ b/recipes/assimp/5.x/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C CXX) find_package(assimp REQUIRED CONFIG) diff --git a/recipes/assimp/5.x/test_v1_package/CMakeLists.txt b/recipes/assimp/5.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/assimp/5.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/assimp/5.x/test_v1_package/conanfile.py b/recipes/assimp/5.x/test_v1_package/conanfile.py deleted file mode 100644 index 32dae739b46ce..0000000000000 --- a/recipes/assimp/5.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +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): - obj_path = os.path.join(self.source_folder, os.pardir, "test_package", "box.obj") - - bin_path = os.path.join("bin", "test_package") - self.run(f"{bin_path} {obj_path}", run_environment=True) - - bin_c_path = os.path.join("bin", "test_package_c") - self.run(f"{bin_c_path} {obj_path}", run_environment=True) diff --git a/recipes/assimp/config.yml b/recipes/assimp/config.yml index 2542b27436840..51044970f061a 100644 --- a/recipes/assimp/config.yml +++ b/recipes/assimp/config.yml @@ -1,11 +1,13 @@ versions: - "5.2.2": + "5.4.3": folder: "5.x" - "5.1.6": + "5.4.2": + folder: "5.x" + "5.4.1": folder: "5.x" - "5.1.0": + "5.3.1": folder: "5.x" - "5.0.1": + "5.2.5": folder: "5.x" - "5.0.0": + "5.1.6": folder: "5.x" diff --git a/recipes/astc-codec/all/test_package/CMakeLists.txt b/recipes/astc-codec/all/test_package/CMakeLists.txt index fecfc194504f2..bd9b02f84b1bf 100644 --- a/recipes/astc-codec/all/test_package/CMakeLists.txt +++ b/recipes/astc-codec/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(astc-codec REQUIRED CONFIG) diff --git a/recipes/astc-codec/all/test_package/atlas_small_4x4.astc b/recipes/astc-codec/all/test_package/atlas_small_4x4.astc deleted file mode 100644 index 0dd080b12d23f..0000000000000 Binary files a/recipes/astc-codec/all/test_package/atlas_small_4x4.astc and /dev/null differ diff --git a/recipes/astc-codec/all/test_package/conanfile.py b/recipes/astc-codec/all/test_package/conanfile.py index 9f50bbe4c73b2..98ab55852ad56 100644 --- a/recipes/astc-codec/all/test_package/conanfile.py +++ b/recipes/astc-codec/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - bees = os.path.join(self.source_folder, "atlas_small_4x4.astc") - self.run(f"{bin_path} {bees} 256 256", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/astc-codec/all/test_package/test_package.cpp b/recipes/astc-codec/all/test_package/test_package.cpp index ec0a2e3ad6195..266f4473a5391 100644 --- a/recipes/astc-codec/all/test_package/test_package.cpp +++ b/recipes/astc-codec/all/test_package/test_package.cpp @@ -8,21 +8,13 @@ int main(int argc, char **argv) { - if (argc < 4) { - std::cerr << "Need at least three argument\n"; - } - std::ifstream stream(argv[1], std::ios::in | std::ios::binary); + std::ifstream stream("fake-file.astc", std::ios::in | std::ios::binary); std::vector astc_data((std::istreambuf_iterator(stream)), std::istreambuf_iterator()); - const size_t width = std::stoi(argv[2]); - const size_t height = std::stoi(argv[3]); - - std::vector result; - result.resize(width * height * 4); - bool success = astc_codec::ASTCDecompressToRGBA( - astc_data.data(), astc_data.size(), width, height, astc_codec::FootprintType::k4x4, - result.data(), result.size(), /* stride */ width * 4); + astc_data.data(), 100, 100, 100, astc_codec::FootprintType::k4x4, NULL, 100, 100); + + std::cout << "Test: " << success << std::endl; stream.close(); diff --git a/recipes/astc-codec/all/test_v1_package/CMakeLists.txt b/recipes/astc-codec/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/astc-codec/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/astc-codec/all/test_v1_package/conanfile.py b/recipes/astc-codec/all/test_v1_package/conanfile.py deleted file mode 100644 index 3605ef5403092..0000000000000 --- a/recipes/astc-codec/all/test_v1_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 = os.path.join("bin", "test_package") - bees = os.path.join(self.source_folder, os.pardir, "test_package", "atlas_small_4x4.astc") - self.run(f"{bin_path} {bees} 256 256", run_environment=True) diff --git a/recipes/astro-informatics-so3/all/conandata.yml b/recipes/astro-informatics-so3/all/conandata.yml index 044d46996e9be..7fd6407fb8411 100644 --- a/recipes/astro-informatics-so3/all/conandata.yml +++ b/recipes/astro-informatics-so3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.6": + url: "https://github.com/astro-informatics/so3/archive/v1.3.6.tar.gz" + sha256: "9a8536b9998d54e7b61313548df01e989f07e15116ad49b471d7e321999f5f35" "1.3.4": url: "https://github.com/astro-informatics/so3/archive/refs/tags/v1.3.4.zip" sha256: "383431c3078faa073c3017ceb3e0108885ab7628e81af13488f9aa021b95bbc7" diff --git a/recipes/astro-informatics-so3/all/conanfile.py b/recipes/astro-informatics-so3/all/conanfile.py index e7486ed5b8c5a..a00f6ada8c83c 100644 --- a/recipes/astro-informatics-so3/all/conanfile.py +++ b/recipes/astro-informatics-so3/all/conanfile.py @@ -17,14 +17,12 @@ class AstroInformaticsSO3(ConanFile): homepage = "https://github.com/astro-informatics/so3" topics = ("physics", "astrophysics", "radio interferometry") - package_type = "library" + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], "fPIC": [True, False], } default_options = { - "shared": False, "fPIC": True, } @@ -40,8 +38,8 @@ 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.5.2", transitive_headers=True, transitive_libs=True) + self.requires("fftw/3.3.10") def validate(self): if is_msvc(self): @@ -68,9 +66,7 @@ def build(self): cmake.build() def package(self): - copy(self, "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/recipes/astro-informatics-so3/all/test_v1_package/CMakeLists.txt b/recipes/astro-informatics-so3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/astro-informatics-so3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index abcaeed3f89b6..0000000000000 --- a/recipes/astro-informatics-so3/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/astro-informatics-so3/config.yml b/recipes/astro-informatics-so3/config.yml index a81e52666d075..f8568797580a5 100644 --- a/recipes/astro-informatics-so3/config.yml +++ b/recipes/astro-informatics-so3/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.6": + folder: all "1.3.4": folder: all diff --git a/recipes/async_simple/all/conandata.yml b/recipes/async_simple/all/conandata.yml index b0f536ac75473..4befe3006ae91 100644 --- a/recipes/async_simple/all/conandata.yml +++ b/recipes/async_simple/all/conandata.yml @@ -1,5 +1,16 @@ sources: + "1.3": + url: "https://github.com/alibaba/async_simple/archive/refs/tags/v1.3.tar.gz" + sha256: "0BA0DC3397882611B538D04B8EE6668B1A04CE046128599205184C598B718743" + "1.2": + url: "https://github.com/alibaba/async_simple/archive/refs/tags/1.2.tar.gz" + sha256: "a59a2674ac2b0a3997b90873b2bf0fbe4d96fdedbe6a2628c16c92a65a3fa39a" "1.0.0": - url: - - "https://github.com/alibaba/async_simple/archive/refs/tags/1.0.tar.gz" + url: "https://github.com/alibaba/async_simple/archive/refs/tags/1.0.tar.gz" sha256: "b243fb7af5d61b534fe18b662d16498392bbce1deffdc68e58829aa31db7badf" +patches: + "1.0.0": + - patch_file: "patches/disable-asan-1.0.patch" + patch_description: "Add option for disabling address sanitizer in root CMakeLists" + patch_type: "portability" + patch_source: "https://github.com/alibaba/async_simple/commit/ccb760356b9d7481ca73f0c58d15928bf8b0aa0b" diff --git a/recipes/async_simple/all/conanfile.py b/recipes/async_simple/all/conanfile.py index 52e7c0ae4b223..f0da3ed24785b 100644 --- a/recipes/async_simple/all/conanfile.py +++ b/recipes/async_simple/all/conanfile.py @@ -1,7 +1,7 @@ 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 +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rename, replace_in_file from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.layout import basic_layout @@ -18,9 +18,18 @@ class AsyncSimpleConan(ConanFile): homepage = "https://github.com/alibaba/async_simple" topics = ("modules", "asynchronous", "coroutines", "cpp20", "header-only") - package_type = "header-library" + package_type = "library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": True + } @property def _min_cppstd(self): @@ -29,6 +38,8 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { + "Visual Studio": "17", + "msvc": "193", "gcc": "10.3", "clang": "13", "apple-clang": "14", @@ -37,59 +48,111 @@ def _compilers_minimum_version(self): def export_sources(self): export_conandata_patches(self) - def layout(self): - basic_layout(self, src_folder="src") + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.header_only: + self.options.rm_safe("fPIC") + self.options.rm_safe("shared") + elif self.options.shared: + self.options.rm_safe("fPIC") - def requirements(self): - pass + def layout(self): + if self.options.header_only: + basic_layout(self, src_folder="src") + else: + cmake_layout(self, src_folder="src") def package_id(self): - self.info.clear() + if self.info.options.header_only: + self.info.clear() def validate(self): - if self.settings.compiler.cppstd: + if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._min_cppstd) - 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." - ) - else: - raise ConanInvalidConfiguration("msvc not supported now") - - def build_requirements(self): - pass + 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 not self.options.header_only and self.settings.os == "Windows": + raise ConanInvalidConfiguration(f'{self.ref} cannot use uthread on Windows, and therefore it\'s only supported as a header-only library in this configuration with "{self.name}/*:header_only=True"') 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.cache_variables["ASYNC_SIMPLE_BUILD_DEMO_EXAMPLE"] = False + tc.cache_variables["ASYNC_SIMPLE_ENABLE_TESTS"] = False + tc.cache_variables["ASYNC_SIMPLE_ENABLE_ASAN"] = False + #libaio is only used in SimpleIOExecutor which is only used in executor tests and not meant for end users + tc.cache_variables["ASYNC_SIMPLE_DISABLE_AIO"] = True + tc.generate() + def build(self): apply_conandata_patches(self) + if not self.options.header_only: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), '-D_GLIBCXX_USE_CXX11_ABI=1', '') + 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) - copy( - self, - pattern="*.h", + + if self.options.header_only: + hCopyExcludes = ("test", "uthread", "executors") + if not self.options.header_only: + hCopyExcludes = ("test", "executors") + if self.options.shared: + if self.settings.os == "Macos": + sharedLibExt = "*.dylib*" + else: + sharedLibExt = "*.so*" + copy(self, pattern=sharedLibExt, + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.build_folder, "async_simple") + ) + else: + copy(self, pattern="*.a", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.build_folder, "async_simple") + ) + libTarget = os.path.join(self.package_folder, "lib", "libasync_simple.a") + if not os.path.isfile(libTarget): + rename(self, os.path.join(self.package_folder, "lib", "libasync_simple_static.a"), + libTarget) + + copy(self, pattern="*.h", dst=os.path.join(self.package_folder, "include/async_simple"), src=os.path.join(self.source_folder, "async_simple"), - excludes=("test", "executors", "uthread") + excludes=hCopyExcludes ) def package_info(self): - self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] - self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] + if not self.options.header_only: + self.cpp_info.libs = ["async_simple"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] self.cpp_info.set_property("cmake_file_name", "async_simple") - self.cpp_info.set_property("cmake_target_name", "async_simple::async_simple") + if self.options.header_only: + self.cpp_info.set_property("cmake_target_name", "async_simple::async_simple_header_only") + + self.cpp_info.components["_async_simple"].names["cmake_find_package"] = "async_simple_header_only" + self.cpp_info.components["_async_simple"].names["cmake_find_package_multi"] = "async_simple_header_only" + self.cpp_info.components["_async_simple"].set_property("cmake_target_name", "async_simple::async_simple_header_only") + else: + self.cpp_info.set_property("cmake_target_name", "async_simple::async_simple") + + self.cpp_info.components["_async_simple"].names["cmake_find_package"] = "async_simple" + self.cpp_info.components["_async_simple"].names["cmake_find_package_multi"] = "async_simple" + self.cpp_info.components["_async_simple"].set_property("cmake_target_name", "async_simple::async_simple") self.cpp_info.filenames["cmake_find_package"] = "async_simple" self.cpp_info.filenames["cmake_find_package_multi"] = "async_simple" self.cpp_info.names["cmake_find_package"] = "async_simple" self.cpp_info.names["cmake_find_package_multi"] = "async_simple" - self.cpp_info.components["_async_simple"].names["cmake_find_package"] = "async_simple_header_only" - self.cpp_info.components["_async_simple"].names["cmake_find_package_multi"] = "async_simple_header_only" - self.cpp_info.components["_async_simple"].set_property("cmake_target_name", "async_simple::async_simple_header_only") diff --git a/recipes/async_simple/all/patches/disable-asan-1.0.patch b/recipes/async_simple/all/patches/disable-asan-1.0.patch new file mode 100644 index 0000000000000..ce18632f1b35d --- /dev/null +++ b/recipes/async_simple/all/patches/disable-asan-1.0.patch @@ -0,0 +1,21 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,11 +106,13 @@ + #list(APPEND deplibs "-m64") + endif() + endif() +- +-if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") +- if (CMAKE_BUILD_TYPE STREQUAL "Debug") +- message("-- Use flag -fsanitize=address") +- list(APPEND CXX_FLAGS "-fsanitize=address") ++option(ASYNC_SIMPLE_ENABLE_ASAN "enable asan in debug when compiler is not msvc" ON) ++if (ASYNC_SIMPLE_ENABLE_ASAN) ++ if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") ++ if (CMAKE_BUILD_TYPE STREQUAL "Debug") ++ message("-- Use flag -fsanitize=address") ++ list(APPEND CXX_FLAGS "-fsanitize=address") ++ endif() + endif() + endif() + diff --git a/recipes/async_simple/all/test_package/CMakeLists.txt b/recipes/async_simple/all/test_package/CMakeLists.txt index 8b854aa258e40..ccb7b85dadd81 100644 --- a/recipes/async_simple/all/test_package/CMakeLists.txt +++ b/recipes/async_simple/all/test_package/CMakeLists.txt @@ -7,4 +7,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(async_simple REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE async_simple::async_simple_header_only) +if(ASYNC_SIMPLE_HEADER_ONLY) + target_link_libraries(test_package PRIVATE async_simple::async_simple_header_only) +else() + target_link_libraries(test_package PRIVATE async_simple::async_simple) +endif() diff --git a/recipes/async_simple/all/test_package/conanfile.py b/recipes/async_simple/all/test_package/conanfile.py index 1111583fea732..be622ed71cf62 100644 --- a/recipes/async_simple/all/test_package/conanfile.py +++ b/recipes/async_simple/all/test_package/conanfile.py @@ -1,13 +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, CMakeToolchain, cmake_layout import os # 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): @@ -15,7 +15,12 @@ def requirements(self): def layout(self): cmake_layout(self) - + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ASYNC_SIMPLE_HEADER_ONLY"] = self.dependencies[self.tested_reference_str].options.header_only + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/async_simple/all/test_v1_package/CMakeLists.txt b/recipes/async_simple/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/async_simple/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/async_simple/all/test_v1_package/conanfile.py b/recipes/async_simple/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/async_simple/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/async_simple/config.yml b/recipes/async_simple/config.yml index 5d96905a31039..e526b1e8db52a 100644 --- a/recipes/async_simple/config.yml +++ b/recipes/async_simple/config.yml @@ -1,4 +1,8 @@ versions: # Newer versions at the top + "1.3": + folder: all + "1.2": + folder: all "1.0.0": folder: all diff --git a/recipes/asyncplusplus/all/conandata.yml b/recipes/asyncplusplus/all/conandata.yml index 6e8a1f4ce6c53..44d6673d4265c 100644 --- a/recipes/asyncplusplus/all/conandata.yml +++ b/recipes/asyncplusplus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2": + url: "https://github.com/Amanieu/asyncplusplus/archive/v1.2.tar.gz" + sha256: "0711c8db231bf3eb1066400f49ed73b5c3211a10eb3b8c3e64da3d5fdee8a4bf" "1.1": url: "https://github.com/Amanieu/asyncplusplus/archive/v1.1.tar.gz" sha256: "d160d3a433a1e08f51c785742843182c2b81a7bc872766f57bf5f3108377b858" diff --git a/recipes/asyncplusplus/all/conanfile.py b/recipes/asyncplusplus/all/conanfile.py index 1846058ae1e44..e0b83a2a00e4a 100644 --- a/recipes/asyncplusplus/all/conanfile.py +++ b/recipes/asyncplusplus/all/conanfile.py @@ -2,6 +2,8 @@ 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.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version import os import textwrap @@ -12,9 +14,9 @@ class AsyncplusplusConan(ConanFile): name = "asyncplusplus" description = "Async++ concurrency framework for C++11" license = "MIT" - topics = ("async", "parallel", "task", "scheduler") - homepage = "https://github.com/Amanieu/asyncplusplus" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Amanieu/asyncplusplus" + topics = ("async", "parallel", "task", "scheduler") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -89,6 +91,9 @@ def package_info(self): self.cpp_info.defines = ["LIBASYNC_STATIC"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] + + if Version(self.version) >= "1.2" and is_msvc(self) and check_min_vs(self, 191): + self.cpp_info.cxxflags.extend(["/Zc:__cplusplus"]) # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "Async++" diff --git a/recipes/asyncplusplus/all/test_package/CMakeLists.txt b/recipes/asyncplusplus/all/test_package/CMakeLists.txt index 9a56b06843998..b72d1e9899727 100644 --- a/recipes/asyncplusplus/all/test_package/CMakeLists.txt +++ b/recipes/asyncplusplus/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(Async++ REQUIRED CONFIG) diff --git a/recipes/asyncplusplus/all/test_v1_package/CMakeLists.txt b/recipes/asyncplusplus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/asyncplusplus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/asyncplusplus/all/test_v1_package/conanfile.py b/recipes/asyncplusplus/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/asyncplusplus/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_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/asyncplusplus/config.yml b/recipes/asyncplusplus/config.yml index 3f8a45fae5832..03361fccd564f 100644 --- a/recipes/asyncplusplus/config.yml +++ b/recipes/asyncplusplus/config.yml @@ -1,3 +1,5 @@ versions: + "1.2": + folder: all "1.1": folder: all diff --git a/recipes/asyncpp/all/conandata.yml b/recipes/asyncpp/all/conandata.yml new file mode 100644 index 0000000000000..4b083e872c16b --- /dev/null +++ b/recipes/asyncpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2.4": + url: "https://github.com/petiaccja/asyncpp/archive/refs/tags/v0.2.4.tar.gz" + sha256: "58138FF5801D3A547EAAD9ADC2C30FE7A0D506C0E41DC56071CEAAD5747210B5" diff --git a/recipes/asyncpp/all/conanfile.py b/recipes/asyncpp/all/conanfile.py new file mode 100644 index 0000000000000..b93928908c5e6 --- /dev/null +++ b/recipes/asyncpp/all/conanfile.py @@ -0,0 +1,100 @@ +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.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class AsyncppRecipe(ConanFile): + name = "asyncpp" + description = "A C++20 coroutine library for asynchronous and parallel programming." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/petiaccja/asyncpp/" + topics = ("coroutine", "c++20", "async", "parallel", "concurrency") + + 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": "13", + "clang": "17", + "msvc": "193", + "Visual Studio": "17", + } + + 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." + ) + + if self.settings.compiler == "apple-clang": + # As per https://en.cppreference.com/w/cpp/compiler_support, apple-clang 14.0.0 partially supports C++20 but not jthread + raise ConanInvalidConfiguration(f"{self.ref} does not support apple-clang compiler, as it lacks jthread 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["ASYNCPP_BUILD_TESTS"] = "OFF" + tc.variables["ASYNCPP_BUILD_BENCHMARKS"] = "OFF" + tc.generate() + venv = VirtualBuildEnv(self) + venv.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.install() + + def package_info(self): + self.cpp_info.libs = ["asyncpp"] + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.bindirs = ["libs"] + + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/asyncpp/all/test_package/CMakeLists.txt b/recipes/asyncpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..74c5adfc3219b --- /dev/null +++ b/recipes/asyncpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(TestPackage LANGUAGES CXX) + +find_package(asyncpp CONFIG REQUIRED) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package asyncpp::asyncpp) +target_compile_features(test_package PUBLIC cxx_std_20) diff --git a/recipes/asyncpp/all/test_package/conanfile.py b/recipes/asyncpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..224348be46988 --- /dev/null +++ b/recipes/asyncpp/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 AsyncppTestConan(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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/asyncpp/all/test_package/test_package.cpp b/recipes/asyncpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..070acd2fe6b83 --- /dev/null +++ b/recipes/asyncpp/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include + +#include +#include + +using namespace asyncpp; + + +task message() { + co_return std::string("async++ installation works."); +} + + +int main() { + std::cout << join(message()) << std::endl; + return 0; +} diff --git a/recipes/asyncpp/config.yml b/recipes/asyncpp/config.yml new file mode 100644 index 0000000000000..a718e51b057ea --- /dev/null +++ b/recipes/asyncpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.4": + folder: all diff --git a/recipes/at-spi2-atk/all/test_package/CMakeLists.txt b/recipes/at-spi2-atk/all/test_package/CMakeLists.txt index afa2476357074..7b80ac51436dc 100644 --- a/recipes/at-spi2-atk/all/test_package/CMakeLists.txt +++ b/recipes/at-spi2-atk/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/at-spi2-core/all/test_package/CMakeLists.txt b/recipes/at-spi2-core/all/test_package/CMakeLists.txt index afa2476357074..7b80ac51436dc 100644 --- a/recipes/at-spi2-core/all/test_package/CMakeLists.txt +++ b/recipes/at-spi2-core/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/at-spi2-core/config.yml b/recipes/at-spi2-core/config.yml index f0d6f514974e4..c890631d2ad5f 100644 --- a/recipes/at-spi2-core/config.yml +++ b/recipes/at-spi2-core/config.yml @@ -23,3 +23,7 @@ versions: folder: new "2.50.0": folder: new + "2.51.0": + folder: new + "2.53.1": + folder: new diff --git a/recipes/at-spi2-core/new/conandata.yml b/recipes/at-spi2-core/new/conandata.yml index b27bb3ef5a258..225eb1193882e 100644 --- a/recipes/at-spi2-core/new/conandata.yml +++ b/recipes/at-spi2-core/new/conandata.yml @@ -1,10 +1,16 @@ sources: + "2.53.1": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.53/at-spi2-core-2.53.1.tar.xz" + sha256: "2affe2c88dae3defcd754c2c2bcecfb2e52b9541edf2e469f94b3a0bb1307cf4" + "2.51.0": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.51/at-spi2-core-2.51.0.tar.xz" + sha256: "8dd07c6160e3115f4f77e2205963449def6822a3dc85d495c5db389f56663037" "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 + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.50/at-spi2-core-2.50.0.tar.xz" + sha256: "e9f5a8c8235c9dd963b2171de9120301129c677dde933955e1df618b949c4adc" "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 + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.49/at-spi2-core-2.49.1.tar.xz" + sha256: "53ed9eb77e4c48b3bf6ac4afb5689391e0d7d0f44f7ca4443d8b13c7dd26119c" "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" diff --git a/recipes/at-spi2-core/new/conanfile.py b/recipes/at-spi2-core/new/conanfile.py index 02a871957ee4f..e12168d36a06f 100644 --- a/recipes/at-spi2-core/new/conanfile.py +++ b/recipes/at-spi2-core/new/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile -from conan.errors import ConanException, ConanInvalidConfiguration -from conan.tools.apple import fix_apple_shared_install_name +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, replace_in_file, rm, rmdir from conan.tools.gnu import PkgConfigDeps @@ -32,7 +32,7 @@ class AtSpi2CoreConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "with_x11": False, + "with_x11": True, } def export_sources(self): @@ -41,6 +41,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_x11 def configure(self): if self.options.shared: @@ -49,29 +51,27 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") def build_requirements(self): - self.tool_requires("meson/1.2.2") + 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.0.3") + self.tool_requires("pkgconf/2.1.0") self.tool_requires("glib/") def requirements(self): - self.requires("glib/2.78.0") - if self.options.with_x11: - self.requires("xorg/system") - if self.settings.os == "Linux": + self.requires("glib/2.78.3") + if self.settings.os in ["Linux", "FreeBSD"]: self.requires("dbus/1.15.8") + if self.options.get_safe("with_x11"): + self.requires("xorg/system") def validate(self): - if self.options.shared and not self.dependencies["glib"].options.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 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") + if Version(self.version) < "2.49.1" and self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported before version 2.49.1") + if Version(self.version) < "2.50.0" and is_apple_os(self): + raise ConanInvalidConfiguration("macOS is not supported before version 2.50.0") def layout(self): basic_layout(self, src_folder="src") @@ -86,10 +86,10 @@ def generate(self): tc = MesonToolchain(self) if Version(self.version) >= "2.47.1": tc.project_options["introspection"] = "disabled" - tc.project_options["x11"] = "enabled" if self.options.with_x11 else "disabled" + tc.project_options["x11"] = "enabled" if self.options.get_safe("with_x11") else "disabled" else: tc.project_options["introspection"] = "no" - tc.project_options["x11"] = "yes" if self.options.with_x11 else "no" + tc.project_options["x11"] = "yes" if self.options.get_safe("with_x11") else "no" if self.settings.os != "Linux": tc.project_options["atk_only"] = "true" @@ -124,24 +124,25 @@ def package(self): fix_apple_shared_install_name(self) fix_msvc_libname(self) - def package_info(self): - 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"] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["atspi"].set_property("pkg_config_name", "atspi-2") + 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-2.0", "glib::gobject-2.0"] + if self.options.with_x11: + self.cpp_info.components["atspi"].requires.extend(["xorg::x11", "xorg::xtst", "xorg::xi"]) + self.cpp_info.components["atk"].set_property("pkg_config_name", "atk") 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') - - 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') + self.cpp_info.components["atk"].includedirs = ["include/atk-1.0"] + self.cpp_info.components["atk"].requires = ["glib::glib-2.0", "glib::gobject-2.0"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["atk-bridge"].set_property("pkg_config_name", "atk-bridge-2.0") + 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 = ["atspi", "atk", "glib::gmodule-2.0"] def fix_msvc_libname(conanfile, remove_lib_prefix=True): diff --git a/recipes/at-spi2-core/new/test_package/conanfile.py b/recipes/at-spi2-core/new/test_package/conanfile.py index 5aab0703e7a4e..45e2b8f908a8f 100644 --- a/recipes/at-spi2-core/new/test_package/conanfile.py +++ b/recipes/at-spi2-core/new/test_package/conanfile.py @@ -17,9 +17,9 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.3.1") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def build(self): meson = Meson(self) diff --git a/recipes/atk/all/test_package/CMakeLists.txt b/recipes/atk/all/test_package/CMakeLists.txt index 331b8cd557e44..7396db8a9dc83 100644 --- a/recipes/atk/all/test_package/CMakeLists.txt +++ b/recipes/atk/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(atk REQUIRED CONFIG) diff --git a/recipes/atk/all/test_v1_package/CMakeLists.txt b/recipes/atk/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/atk/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/atk/all/test_v1_package/conanfile.py b/recipes/atk/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/atk/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_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/atomic_queue/all/conandata.yml b/recipes/atomic_queue/all/conandata.yml new file mode 100644 index 0000000000000..f19fe2ba05117 --- /dev/null +++ b/recipes/atomic_queue/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.6.3": + url: "https://github.com/max0x7ba/atomic_queue/archive/refs/tags/v1.6.3.tar.gz" + sha256: "0ad6e0203d90367f6a4e496449dfd9ad65b80168fadafef4eac08820c6bda79c" diff --git a/recipes/atomic_queue/all/conanfile.py b/recipes/atomic_queue/all/conanfile.py new file mode 100644 index 0000000000000..8e73409204f38 --- /dev/null +++ b/recipes/atomic_queue/all/conanfile.py @@ -0,0 +1,46 @@ +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.50.0" + +class CxxOptsConan(ConanFile): + name = "atomic_queue" + homepage = "https://github.com/max0x7ba/atomic_queue" + url = "https://github.com/conan-io/conan-center-index" + description = "Multiple-producer-multiple-consumer lock-free queues based on circular buffer and std::atomic." + license = "MIT" + topics = ("queue", "lockfree", "atomic") + 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, 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, "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): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/atomic_queue/all/test_package/CMakeLists.txt b/recipes/atomic_queue/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..51e7066a58b11 --- /dev/null +++ b/recipes/atomic_queue/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(atomic_queue REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE atomic_queue::atomic_queue) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/atomic_queue/all/test_package/conanfile.py b/recipes/atomic_queue/all/test_package/conanfile.py new file mode 100644 index 0000000000000..081c97abefb38 --- /dev/null +++ b/recipes/atomic_queue/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, cmake_layout + +required_conan_version = ">=1.50.0" + +class TestPackageConan(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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/atomic_queue/all/test_package/test_package.cpp b/recipes/atomic_queue/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bdfe611442b89 --- /dev/null +++ b/recipes/atomic_queue/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +int main(int argc, char* argv[]) +{ + atomic_queue::AtomicQueue q; + + const int iPush = 42; + q.push(iPush); + + const int iPop = q.pop(); + + return (iPush - iPop); +} diff --git a/recipes/atomic_queue/config.yml b/recipes/atomic_queue/config.yml new file mode 100644 index 0000000000000..6a0b843662fca --- /dev/null +++ b/recipes/atomic_queue/config.yml @@ -0,0 +1,3 @@ +versions: + "1.6.3": + folder: "all" diff --git a/recipes/au/all/conandata.yml b/recipes/au/all/conandata.yml new file mode 100644 index 0000000000000..c4c07e879ccfb --- /dev/null +++ b/recipes/au/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.1": + url: "https://github.com/aurora-opensource/au/archive/refs/tags/0.4.1.tar.gz" + sha256: "5e88a0ffcb0a0843f4bd4d4ea4429c793f85dfcb8c1e7f7978de6fecab739b84" diff --git a/recipes/au/all/conanfile.py b/recipes/au/all/conanfile.py new file mode 100644 index 0000000000000..ffa6d4c391e42 --- /dev/null +++ b/recipes/au/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.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 = ">=2.0" + + +class PackageConan(ConanFile): + name = "au" + description = "A C++14-compatible physical units library" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/aurora-opensource/au" + topics = ("units", "C++14", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + check_min_cppstd(self, 14) + + 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) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["AU_ENABLE_TESTING"] = False + tc.variables["AU_EXCLUDE_GTEST_DEPENDENCY"] = True + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + copy( + self, + "LICENSE.txt", + self.source_folder, + os.path.join(self.package_folder, "licenses"), + ) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Au") + self.cpp_info.set_property("cmake_target_name", "Au::au") + + 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") diff --git a/recipes/au/all/test_package/CMakeLists.txt b/recipes/au/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f77fbd5798db9 --- /dev/null +++ b/recipes/au/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(Au REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Au::au) diff --git a/recipes/au/all/test_package/conanfile.py b/recipes/au/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cef342207237c --- /dev/null +++ b/recipes/au/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 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/au/all/test_package/test_package.cpp b/recipes/au/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ff27bb3a89725 --- /dev/null +++ b/recipes/au/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include "au/au.hh" +#include "au/io.hh" +#include "au/units/meters.hh" + +using namespace au; + +int main(void) { + constexpr auto length = meters(100.0); + + std::cout << length << " == " << length.as(kilo(meters)) << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/au/config.yml b/recipes/au/config.yml new file mode 100644 index 0000000000000..3a9d5538921fc --- /dev/null +++ b/recipes/au/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.1": + folder: all diff --git a/recipes/audiofile/all/conandata.yml b/recipes/audiofile/all/conandata.yml index 288d8a5ec4d8c..8d041f83a5614 100644 --- a/recipes/audiofile/all/conandata.yml +++ b/recipes/audiofile/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.2": + url: "https://github.com/adamstark/AudioFile/archive/1.1.2.tar.gz" + sha256: "d090282207421e27be57c3df1199a9893e0321ea7c971585361a3fc862bb8c16" "1.1.1": url: "https://github.com/adamstark/AudioFile/archive/1.1.1.tar.gz" sha256: "664f9d5fbbf1ff6c603ae054a35224f12e9856a1d8680be567909015ccaac328" diff --git a/recipes/audiofile/all/test_package/CMakeLists.txt b/recipes/audiofile/all/test_package/CMakeLists.txt index fab8ac8a0b20c..a5978d241b1e0 100644 --- a/recipes/audiofile/all/test_package/CMakeLists.txt +++ b/recipes/audiofile/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(audiofile REQUIRED CONFIG) diff --git a/recipes/audiofile/all/test_package/conanfile.py b/recipes/audiofile/all/test_package/conanfile.py index fb1d035fc5b12..d120a992c06a6 100644 --- a/recipes/audiofile/all/test_package/conanfile.py +++ b/recipes/audiofile/all/test_package/conanfile.py @@ -22,5 +22,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - wav_path = os.path.join(self.source_folder, "sine.wav") - self.run(f"{bin_path} {wav_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/audiofile/all/test_package/sine.wav b/recipes/audiofile/all/test_package/sine.wav deleted file mode 100644 index a3225d12bf297..0000000000000 Binary files a/recipes/audiofile/all/test_package/sine.wav and /dev/null differ diff --git a/recipes/audiofile/all/test_package/test_package.cpp b/recipes/audiofile/all/test_package/test_package.cpp index d95bc64031cda..906aa9efa0327 100644 --- a/recipes/audiofile/all/test_package/test_package.cpp +++ b/recipes/audiofile/all/test_package/test_package.cpp @@ -1,18 +1,15 @@ // workaround for a missing include in v1.0.9 and earlier +#include +#include #include - #include -#include + int main(int argc, char **argv) { - if (argc < 2) { - std::cerr << "Need at least one argument" << std::endl; - return 1; - } AudioFile audioFile; - audioFile.load(argv[1]); + audioFile.load("fake-file.wav"); audioFile.printSummary(); return 0; } diff --git a/recipes/audiofile/all/test_v1_package/CMakeLists.txt b/recipes/audiofile/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/audiofile/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/audiofile/all/test_v1_package/conanfile.py b/recipes/audiofile/all/test_v1_package/conanfile.py deleted file mode 100644 index 21642db6ce1ba..0000000000000 --- a/recipes/audiofile/all/test_v1_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 = os.path.join("bin", "test_package") - wav_path = os.path.join(self.source_folder, os.pardir, "test_package", "sine.wav") - self.run(f"{bin_path} {wav_path}", run_environment=True) diff --git a/recipes/audiofile/config.yml b/recipes/audiofile/config.yml index 1b65530cbacc9..0189cfcafca9b 100644 --- a/recipes/audiofile/config.yml +++ b/recipes/audiofile/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.2": + folder: all "1.1.1": folder: all "1.1.0": diff --git a/recipes/audiowaveform/all/conandata.yml b/recipes/audiowaveform/all/conandata.yml new file mode 100644 index 0000000000000..2e2ba28ceca12 --- /dev/null +++ b/recipes/audiowaveform/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "1.10.1": + url: "https://github.com/bbc/audiowaveform/archive/refs/tags/1.10.1.tar.gz" + sha256: "bd283d84dc84fda84f4090fddde9a5bef924c588dd7bf6acaa8f7b946efb42a4" +patches: + "1.10.1": + - patch_file: "patches/0001-1.10.1_find_packages.patch" + patch_description: "Inject thirdparties from conan" + patch_type: "conan" + - patch_file: "patches/0002-1.10.1_remove_flags.patch" + patch_description: "Remove custom compile flags" + patch_type: "conan" + - patch_file: "patches/0003-1.10.1_remove_documentation.patch" + patch_description: "Remove documenation" + patch_type: "conan" diff --git a/recipes/audiowaveform/all/conanfile.py b/recipes/audiowaveform/all/conanfile.py new file mode 100644 index 0000000000000..4d5e42ee98a02 --- /dev/null +++ b/recipes/audiowaveform/all/conanfile.py @@ -0,0 +1,94 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +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 AudiowaveformConan(ConanFile): + name = "audiowaveform" + description = "C++ program to generate waveform data and render waveform images from audio files" + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://waveform.prototyping.bbc.co.uk/" + topics = ("audio", "c-plus-plus") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + pass + + def configure(self): + pass + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libgd/2.3.3") + self.requires("libid3tag/0.15.1b") + self.requires("libmad/0.15.1b") + self.requires("libsndfile/1.2.2") + self.requires("boost/1.85.0") + + def package_id(self): + del self.info.settings.compiler + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} can not be built on Visual Studio and msvc.") + + def build_requirements(self): + pass + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_TESTS"] = False + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + rm(self, "Find*.cmake", os.path.join(self.source_folder, "CMake")) + + def build(self): + self._patch_sources() + 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")) + + 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/audiowaveform/all/patches/0001-1.10.1_find_packages.patch b/recipes/audiowaveform/all/patches/0001-1.10.1_find_packages.patch new file mode 100644 index 0000000000000..e4f3afcf4da27 --- /dev/null +++ b/recipes/audiowaveform/all/patches/0001-1.10.1_find_packages.patch @@ -0,0 +1,66 @@ +Use packages that are provided by conan +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -88,40 +88,11 @@ if(BUILD_STATIC) + endif() + endif(BUILD_STATIC) + +-find_package(LibGD REQUIRED) +-if(LIBGD_FOUND) +- message(STATUS "LIBGD_INCLUDE_DIRS='${LIBGD_INCLUDE_DIRS}'") +- message(STATUS "LIBGD_LIBRARIES=${LIBGD_LIBRARIES}") +- include_directories(${LIBGD_INCLUDE_DIRS}) +-endif(LIBGD_FOUND) +- +-find_package(LibSndFile REQUIRED) +-if(LIBSNDFILE_FOUND) +- message(STATUS "LIBSNDFILE_INCLUDE_DIRS='${LIBSNDFILE_INCLUDE_DIRS}'") +- message(STATUS "LIBSNDFILE_LIBRARIES=${LIBSNDFILE_LIBRARIES}") +- include_directories(${LIBSNDFILE_INCLUDE_DIRS}) +-endif(LIBSNDFILE_FOUND) +- +-find_package(LibMad REQUIRED) +-if(LIBMAD_FOUND) +- message(STATUS "LIBMAD_INCLUDE_DIRS='${LIBMAD_INCLUDE_DIRS}'") +- message(STATUS "LIBMAD_LIBRARIES=${LIBMAD_LIBRARIES}") +- include_directories(${LIBMAD_INCLUDE_DIRS}) +-endif(LIBMAD_FOUND) +- +-find_package(LibId3Tag REQUIRED) +-if(LIBID3TAG_FOUND) +- message(STATUS "LIBID3TAG_INCLUDE_DIRS='${LIBID3TAG_INCLUDE_DIRS}'") +- message(STATUS "LIBID3TAG_LIBRARIES=${LIBID3TAG_LIBRARIES}") +- include_directories(${LIBID3TAG_INCLUDE_DIRS}) +-endif(LIBID3TAG_FOUND) +- +-find_package(Boost 1.46.0 COMPONENTS program_options filesystem regex system REQUIRED) +-if(Boost_FOUND) +- message(STATUS "Boost_INCLUDE_DIRS='${Boost_INCLUDE_DIRS}'") +- message(STATUS "Boost_LIBRARIES='${Boost_LIBRARIES}'") +- include_directories(${Boost_INCLUDE_DIRS}) +-endif(Boost_FOUND) ++find_package(libgd REQUIRED CONFIG) ++find_package(SndFile REQUIRED CONFIG) ++find_package(libmad REQUIRED CONFIG) ++find_package(libid3tag REQUIRED CONFIG) ++find_package(Boost COMPONENTS program_options filesystem regex REQUIRED) + + #------------------------------------------------------------------------------- + # +@@ -278,11 +249,11 @@ add_executable(audiowaveform ${SRCS}) + + # Specify libraries to link against. + set(LIBS +- ${LIBSNDFILE_LIBRARIES} +- ${LIBGD_LIBRARIES} +- ${LIBMAD_LIBRARIES} +- ${LIBID3TAG_LIBRARIES} +- ${Boost_LIBRARIES} ++ SndFile::sndfile ++ libgd::libgd ++ libmad::libmad ++ libid3tag::libid3tag ++ Boost::program_options Boost::filesystem Boost::regex + ) + + target_link_libraries(audiowaveform ${LIBS}) diff --git a/recipes/audiowaveform/all/patches/0002-1.10.1_remove_flags.patch b/recipes/audiowaveform/all/patches/0002-1.10.1_remove_flags.patch new file mode 100644 index 0000000000000..ac2bac6bbfe1a --- /dev/null +++ b/recipes/audiowaveform/all/patches/0002-1.10.1_remove_flags.patch @@ -0,0 +1,19 @@ +Remove custom compile flags +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -162,6 +162,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.6.3") + message(FATAL_ERROR "g++ 4.6.3 or later required") + endif() + ++if(0) + if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.7") + set(CMAKE_CXX_FLAGS "-std=c++11") + else() +@@ -178,6 +179,7 @@ if(APPLE AND BUILD_STATIC) + set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") + endif() ++endif() + + message(STATUS "CMAKE_CXX_COMPILER_VERSION='${CMAKE_CXX_COMPILER_VERSION}'") + message(STATUS "CMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'") diff --git a/recipes/audiowaveform/all/patches/0003-1.10.1_remove_documentation.patch b/recipes/audiowaveform/all/patches/0003-1.10.1_remove_documentation.patch new file mode 100644 index 0000000000000..c8cc66eaa8a38 --- /dev/null +++ b/recipes/audiowaveform/all/patches/0003-1.10.1_remove_documentation.patch @@ -0,0 +1,34 @@ +Remove documentation target +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -314,6 +314,7 @@ endif() + # + #------------------------------------------------------------------------------- + ++if(0) + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc) + + add_custom_command( +@@ -334,6 +335,7 @@ add_custom_target(doc + ) + + add_dependencies(audiowaveform doc) ++endif() + + #------------------------------------------------------------------------------- + # +@@ -347,6 +349,7 @@ message(STATUS "CMAKE_INSTALL_PREFIX='${CMAKE_INSTALL_PREFIX}'") + install(TARGETS audiowaveform DESTINATION bin) + + # Install man pages ++if(0) + install( + FILES ${PROJECT_BINARY_DIR}/doc/audiowaveform.1.gz + DESTINATION share/man/man1 +@@ -356,5 +359,6 @@ install( + FILES ${PROJECT_BINARY_DIR}/doc/audiowaveform.5.gz + DESTINATION share/man/man5 + ) ++endif() + + #------------------------------------------------------------------------------- diff --git a/recipes/audiowaveform/all/test_package/conanfile.py b/recipes/audiowaveform/all/test_package/conanfile.py new file mode 100644 index 0000000000000..5b8eaa02f81b6 --- /dev/null +++ b/recipes/audiowaveform/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +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): + self.run("audiowaveform --version") diff --git a/recipes/audiowaveform/config.yml b/recipes/audiowaveform/config.yml new file mode 100644 index 0000000000000..5492c2a9aab5c --- /dev/null +++ b/recipes/audiowaveform/config.yml @@ -0,0 +1,3 @@ +versions: + "1.10.1": + folder: all 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/all/test_v1_package/Makefile.am b/recipes/autoconf-archive/all/test_v1_package/Makefile.am deleted file mode 100644 index b5165c3af4560..0000000000000 --- a/recipes/autoconf-archive/all/test_v1_package/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -bin_PROGRAMS = test_package -test_package_sources = test_package.c diff --git a/recipes/autoconf-archive/all/test_v1_package/conanfile.py b/recipes/autoconf-archive/all/test_v1_package/conanfile.py deleted file mode 100644 index 99631c75c0149..0000000000000 --- a/recipes/autoconf-archive/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,52 +0,0 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import contextlib -import os -import shutil - -required_conan_version = ">=1.56.0" - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - exports_sources = "configure.ac", "Makefile.am", "test_package.c" - test_type = "explicit" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - self.build_requires("automake/1.16.5") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "cl -nologo", - "CXX": "cl -nologo", - } - with tools.environment_append(env): - yield - else: - yield - - def build(self): - for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), self.build_folder) - - # Work around the fact that "used_special_vars" in conans/client/tools/win.py doesn't handle ACLOCAL_PATH - aclocal_path = "$ACLOCAL_PATH:" + self.deps_env_info.vars["ACLOCAL_PATH"][0].lower() - self.run("ACLOCAL_PATH={} autoreconf -fiv".format(aclocal_path), win_bash=self._settings_build.os == "Windows") - with self._build_context(): - autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows") - autotools.libs = [] - autotools.configure() - autotools.make() - - def test(self): - if not tools.cross_building(self): - self.run(os.path.join(".", "test_package")) diff --git a/recipes/autoconf-archive/all/test_v1_package/configure.ac b/recipes/autoconf-archive/all/test_v1_package/configure.ac deleted file mode 100644 index e74fbe8a4a2dd..0000000000000 --- a/recipes/autoconf-archive/all/test_v1_package/configure.ac +++ /dev/null @@ -1,15 +0,0 @@ -AC_INIT([test_package], [1.0]) -AC_CONFIG_SRCDIR([test_package.c]) -AC_CONFIG_AUX_DIR([autostuff]) -AM_INIT_AUTOMAKE([foreign]) -AC_PROG_CC -m4_pattern_forbid([^AX_], - [Unexpanded AX_ macro found. Please install GNU autoconf-archive.]) -AX_CXX_BOOL() -AX_CXX_HAVE_VECTOR_AT() -AX_CXX_HAVE_BIND() -AX_PRINTF_SIZE_T() -AX_CHECK_AWK_INDEX() -AX_BERKELEY_DB() -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/recipes/autoconf-archive/all/test_v1_package/test_package.c b/recipes/autoconf-archive/all/test_v1_package/test_package.c deleted file mode 100644 index 88b53a74dc6fb..0000000000000 --- a/recipes/autoconf-archive/all/test_v1_package/test_package.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - printf("Hello world from test_package.c\n"); - return 0; -} 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/conandata.yml b/recipes/autoconf/all/conandata.yml index aefee4cae6132..9d182df49e442 100644 --- a/recipes/autoconf/all/conandata.yml +++ b/recipes/autoconf/all/conandata.yml @@ -1,8 +1,25 @@ sources: + "2.72": + url: + - "https://ftpmirror.gnu.org/autoconf/autoconf-2.72.tar.xz" + - "https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.xz" + sha256: "ba885c1319578d6c94d46e9b0dceb4014caafe2490e437a0dbca3f270a223f5a" "2.71": - sha256: "431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c" - url: "https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz" + url: + - "https://ftpmirror.gnu.org/autoconf/autoconf-2.71.tar.xz" + - "https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz" + sha256: "f14c83cfebcc9427f2c3cea7258bd90df972d92eb26752da4ddad81c87a0faa4" patches: + "2.72": + - patch_file: "patches/2.72-0001-relocatable-autoconf.patch" + patch_description: "Replace instances where absolute paths are embedded the generated files" + patch_type: "conan" + - patch_file: "patches/2.71-0002-no-perl-path-in-shebang.patch" + patch_description: "Avoid build machine's perl path to be embedded the generated files" + patch_type: "conan" + - patch_file: "patches/2.72-0003-disable-man-regeneration.patch" + patch_description: "Disable man regeneration" + patch_type: "conan" "2.71": - patch_file: "patches/2.71-0001-relocatable-autoconf.patch" patch_description: "Replace instances where absolute paths are embedded the generated files" diff --git a/recipes/autoconf/all/conanfile.py b/recipes/autoconf/all/conanfile.py index 6030c1664be5b..2a571221ded30 100644 --- a/recipes/autoconf/all/conanfile.py +++ b/recipes/autoconf/all/conanfile.py @@ -38,7 +38,10 @@ def requirements(self): self.requires("m4/1.4.19") # Needed at runtime by downstream clients as well def package_id(self): - self.info.clear() + del self.info.settings.arch + del self.info.settings.compiler + del self.info.settings.build_type + self.info.requires.clear() def build_requirements(self): self.tool_requires("m4/1.4.19") @@ -105,12 +108,6 @@ def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.resdirs = ["res"] - # 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.buildenv_info.define_path("AC_MACRODIR", dataroot_path) - self.buildenv_info.define_path("autom4te_perllibdir", dataroot_path) - bin_path = os.path.join(self.package_folder, "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")) diff --git a/recipes/autoconf/all/patches/2.72-0001-relocatable-autoconf.patch b/recipes/autoconf/all/patches/2.72-0001-relocatable-autoconf.patch new file mode 100644 index 0000000000000..a7ebbaa6c17bf --- /dev/null +++ b/recipes/autoconf/all/patches/2.72-0001-relocatable-autoconf.patch @@ -0,0 +1,262 @@ +diff --git a/Makefile.in b/Makefile.in +--- a/Makefile.in ++++ b/Makefile.in +@@ -427,7 +427,7 @@ + LIBOBJS = @LIBOBJS@ + LIBS = @LIBS@ + LTLIBOBJS = @LTLIBOBJS@ +-M4 = @M4@ ++M4 = /usr/bin/env m4 + M4_DEBUGFILE = @M4_DEBUGFILE@ + M4_GNU = @M4_GNU@ + MAKEINFO = @MAKEINFO@ +diff --git a/bin/autoconf.in b/bin/autoconf.in +--- a/bin/autoconf.in ++++ b/bin/autoconf.in +@@ -26,10 +26,14 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; ++ $ENV{'trailer_m4'} ||= "$pkgdatadir/autoconf/trailer.m4"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +diff --git a/bin/autoheader.in b/bin/autoheader.in +--- a/bin/autoheader.in ++++ b/bin/autoheader.in +@@ -29,10 +29,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, "$pkgdatadir"; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -54,7 +57,8 @@ + our ($config_h, %symbol, %verbatim); + + # Lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $config_h_in; + my @prepend_include; + my @include; +diff --git a/bin/autom4te.in b/bin/autom4te.in +--- a/bin/autom4te.in ++++ b/bin/autom4te.in +@@ -25,10 +25,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -48,7 +51,8 @@ + use Autom4te::XFile; + + # Data directory. +-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $pkgdatadir = $ENV{'AC_MACRODIR'} || "$scriptpath/../res/autoconf"; + + # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE. + my %language; +@@ -91,7 +95,7 @@ + my $freeze = 0; + + # $M4. +-my $m4 = $ENV{"M4"} || '@M4@'; ++my $m4 = $ENV{"M4"} || '/usr/bin/env m4'; + # Some non-GNU m4's don't reject the --help option, so give them /dev/null. + fatal "need GNU m4 1.4 or later: $m4" + if system "$m4 --help &1 | grep reload-state >/dev/null"; +@@ -321,6 +325,12 @@ + if /^\s*(\#.*)?$/; + + my @words = shellwords ($_); ++ # not using: s#AUTOCONF_M4DIR#$pkgdatadir#r to support perl <5.14 ++ my @words_clone = @words; ++ @words = (); ++ foreach ( @words_clone ) { ++ push(@words, do { (my $tmp = $_) =~ s#AUTOCONF_M4DIR#$pkgdatadir#; $tmp }); ++ } + my $type = shift @words; + if ($type eq 'begin-language:') + { +diff --git a/bin/autoreconf.in b/bin/autoreconf.in +--- a/bin/autoreconf.in ++++ b/bin/autoreconf.in +@@ -28,11 +28,14 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + my $buildauxdir; + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + $buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux'; +@@ -116,9 +119,10 @@ + "; + + # Lib files. +-my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@'; +-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@'; +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autoconf = $ENV{'AUTOCONF'} || "$scriptpath/@autoconf-name@"; ++my $autoheader = $ENV{'AUTOHEADER'} || "$scriptpath/@autoheader-name@"; ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $automake = $ENV{'AUTOMAKE'} || 'automake'; + my $aclocal = $ENV{'ACLOCAL'} || 'aclocal'; + my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize'; +diff --git a/bin/autoscan.in b/bin/autoscan.in +--- a/bin/autoscan.in ++++ b/bin/autoscan.in +@@ -27,10 +27,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -95,7 +98,8 @@ + my $log; + + # Autoconf and lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $autoconf = "$autom4te --language=autoconf"; + my @prepend_include; + my @include = ('@pkgdatadir@'); +diff --git a/bin/autoupdate.in b/bin/autoupdate.in +--- a/bin/autoupdate.in ++++ b/bin/autoupdate.in +@@ -28,10 +28,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +@@ -51,14 +54,15 @@ + use Autom4te::XFile; + + # Lib files. +-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; ++my $scriptpath = abs_path(dirname(__FILE__)); ++my $autom4te = $ENV{'AUTOM4TE'} || "$scriptpath/@autom4te-name@"; + my $autoconf = "$autom4te --language=autoconf"; + # We need to find m4sugar. + my @prepend_include; + my @include = ('@pkgdatadir@'); + my $force = 0; + # m4. +-my $m4 = $ENV{"M4"} || '@M4@'; ++my $m4 = $ENV{"M4"} || '/usr/bin/env m4'; + + + # $HELP +diff --git a/bin/ifnames.in b/bin/ifnames.in +--- a/bin/ifnames.in ++++ b/bin/ifnames.in +@@ -32,10 +32,13 @@ + use 5.006; + use strict; + use warnings FATAL => 'all'; ++use Cwd 'abs_path'; ++use File::Basename; + + BEGIN + { +- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; ++ my $scriptpath = abs_path(dirname(__FILE__)); ++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || "$scriptpath/../res/autoconf"; + unshift @INC, $pkgdatadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell +diff --git a/lib/autom4te.in b/lib/autom4te.in +--- a/lib/autom4te.in ++++ b/lib/autom4te.in +@@ -115,7 +115,7 @@ + # This intermediate language is used by aclocal to build aclocal.m4. + + begin-language: "Autoconf-without-aclocal-m4" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: --cache=autom4te.cache + args: autoconf/autoconf.m4f + args: acsite.m4? +@@ -142,7 +142,7 @@ + ## -------- ## + + begin-language: "Autotest" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: autotest/autotest.m4f + args: package.m4? + args: local.at? +@@ -156,7 +156,7 @@ + ## ---- ## + + begin-language: "M4sh" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: m4sugar/m4sh.m4f + args: --mode 777 + args: --language M4sugar +@@ -168,6 +168,6 @@ + ## ------- ## + + begin-language: "M4sugar" +-args: --prepend-include '@pkgdatadir@' ++args: --prepend-include 'AUTOCONF_M4DIR' + args: m4sugar/m4sugar.m4f + end-language: "M4sugar" diff --git a/recipes/autoconf/all/patches/2.72-0003-disable-man-regeneration.patch b/recipes/autoconf/all/patches/2.72-0003-disable-man-regeneration.patch new file mode 100644 index 0000000000000..af2e738435ff6 --- /dev/null +++ b/recipes/autoconf/all/patches/2.72-0003-disable-man-regeneration.patch @@ -0,0 +1,12 @@ +--- Makefile.in ++++ Makefile.in +@@ -2171,9 +2171,2 @@ + .PHONY: install-data-hook install-data-hook-make-aux-scripts-executable + +-man/autoconf.1: $(common_dep) man/autoconf.w man/autoconf.x $(binsrcdir)/autoconf.in +-man/autoheader.1: $(common_dep) man/autoheader.w man/autoheader.x $(binsrcdir)/autoheader.in +-man/autom4te.1: $(common_dep) man/autom4te.w man/autom4te.x $(binsrcdir)/autom4te.in +-man/autoreconf.1: $(common_dep) man/autoreconf.w man/autoreconf.x $(binsrcdir)/autoreconf.in +-man/autoscan.1: $(common_dep) man/autoscan.w man/autoscan.x $(binsrcdir)/autoscan.in +-man/autoupdate.1: $(common_dep) man/autoupdate.w man/autoupdate.x $(binsrcdir)/autoupdate.in +-man/ifnames.1: $(common_dep) man/ifnames.w man/ifnames.x $(binsrcdir)/ifnames.in diff --git a/recipes/autoconf/config.yml b/recipes/autoconf/config.yml index f45dc3e529288..946e15e5dab08 100644 --- a/recipes/autoconf/config.yml +++ b/recipes/autoconf/config.yml @@ -1,3 +1,5 @@ versions: + "2.72": + folder: all "2.71": folder: all diff --git a/recipes/automake/all/test_v1_package/Makefile.am b/recipes/automake/all/test_v1_package/Makefile.am deleted file mode 100644 index 655db7f1876cb..0000000000000 --- a/recipes/automake/all/test_v1_package/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -# @configure_input@ - -bin_PROGRAMS = test_package -test_package_SOURCES = test_package.cpp diff --git a/recipes/automake/all/test_v1_package/conanfile.py b/recipes/automake/all/test_v1_package/conanfile.py deleted file mode 100644 index 8362800620a5a..0000000000000 --- a/recipes/automake/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,89 +0,0 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conan.tools.microsoft import is_msvc -from contextlib import contextmanager -import os -import shutil - -required_conan_version = ">=1.45.0" - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - exports_sources = "configure.ac", "Makefile.am", "test_package_1.c", "test_package.cpp" - # DON'T COPY extra.m4 TO BUILD FOLDER!!! - test_type = "explicit" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def requirements(self): - self.requires(self.tested_reference_str) - - 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") - - @contextmanager - def _build_context(self): - if is_msvc(self): - with tools.vcvars(self): - with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): - yield - else: - yield - - _default_cc = { - "gcc": "gcc", - "clang": "clang", - "Visual Studio": "cl -nologo", - "apple-clang": "clang", - } - - @property - def _system_cc(self): - system_cc = os.environ.get("CC", None) - if not system_cc: - system_cc = self._default_cc.get(str(self.settings.compiler)) - return system_cc - - @property - def _user_info(self): - return getattr(self, "user_info_build", self.deps_user_info) - - def _build_scripts(self): - """Test compile script of automake""" - compile_script = self._user_info["automake"].compile - ar_script = self._user_info["automake"].ar_lib - assert os.path.isfile(ar_script) - assert os.path.isfile(compile_script) - - if self._system_cc: - with tools.vcvars(self) if is_msvc(self) else tools.no_op(): - self.run("{} {} test_package_1.c -o script_test".format(tools.unix_path(compile_script), self._system_cc), win_bash=tools.os_info.is_windows) - - def _build_autotools(self): - """Test autoreconf + configure + make""" - with tools.environment_append({"AUTOMAKE_CONAN_INCLUDES": [tools.unix_path(self.source_folder)]}): - self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) - 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) - with self._build_context(): - autotools.configure() - autotools.make() - - def build(self): - for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), self.build_folder) - - self._build_scripts() - self._build_autotools() - - def test(self): - if self._system_cc: - if not tools.cross_building(self): - self.run(os.path.join(".", "script_test"), run_environment=True) - - if not tools.cross_building(self): - self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/automake/all/test_v1_package/configure.ac b/recipes/automake/all/test_v1_package/configure.ac deleted file mode 100644 index 8a7ae1dc34e7f..0000000000000 --- a/recipes/automake/all/test_v1_package/configure.ac +++ /dev/null @@ -1,28 +0,0 @@ -AC_PREREQ([2.69]) -AC_INIT([test_package], [1.0]) -AC_CONFIG_AUX_DIR([build-aux]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) - -# Safety checks in case user overwritten --srcdir -AC_CONFIG_SRCDIR([test_package.cpp]) - -AC_CANONICAL_HOST - -# Test includes of extra including directories using conan -AUTOMAKE_TEST_PACKAGE_PREREQ([1.0]) -AUTOMAKE_TEST_PACKAGE_HELLO([argument1], [argument2], [...], [last argument]) - -AC_CONFIG_HEADER([config.h]) - -# Check for CC and CXX compiler -AC_PROG_CC -AC_PROG_CXX -## We can add more checks in this section -# -## Tells automake to create a Makefile -## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html -AC_CONFIG_FILES([Makefile]) -# -## Generate the output -AC_OUTPUT -# diff --git a/recipes/automake/all/test_v1_package/extra.m4 b/recipes/automake/all/test_v1_package/extra.m4 deleted file mode 100644 index 69c85f5ac945d..0000000000000 --- a/recipes/automake/all/test_v1_package/extra.m4 +++ /dev/null @@ -1,14 +0,0 @@ -dnl This file contains a macro to test adding extra include dirs using conan - -AC_DEFUN([AUTOMAKE_TEST_PACKAGE_PREREQ],[ - m4_define([CONAN_MACRO_VERSION], [1.3]) - m4_if(m4_version_compare(CONAN_MACRO_VERSION, [$1]), - -1, - [m4_fatal([extra.m4 version $1 or higher is required, but ]CONAN_MACRO_VERSION[ found])] - ) -])dnl AUTOMAKE_TEST_PACKAGE_PREREQ - -AC_DEFUN([AUTOMAKE_TEST_PACKAGE_HELLO],[ - echo "Hello world from the extra.m4 script!" - echo "My args were: $*" -])dnl diff --git a/recipes/automake/all/test_v1_package/test_package.cpp b/recipes/automake/all/test_v1_package/test_package.cpp deleted file mode 100644 index cd8c2f27c3587..0000000000000 --- a/recipes/automake/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "config.h" - -#include -#include - -int main(int argc, char** argv) { - std::cout << "test_package.cpp: " << "hello world from " PACKAGE_NAME "!\n"; - return EXIT_SUCCESS; -} diff --git a/recipes/automake/all/test_v1_package/test_package_1.c b/recipes/automake/all/test_v1_package/test_package_1.c deleted file mode 100644 index 9aaff6c18e30d..0000000000000 --- a/recipes/automake/all/test_v1_package/test_package_1.c +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -int main() { - puts("test_package.c says 'Hello World'!\n"); - return EXIT_SUCCESS; -} diff --git a/recipes/avahi/all/conandata.yml b/recipes/avahi/all/conandata.yml index 49b6c0881959d..6cf843ad984a8 100644 --- a/recipes/avahi/all/conandata.yml +++ b/recipes/avahi/all/conandata.yml @@ -2,3 +2,8 @@ sources: "0.8": url: "https://github.com/lathiat/avahi/releases/download/v0.8/avahi-0.8.tar.gz" sha256: "060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda" +patches: + "0.8": + - patch_file: "patches/0.8-0001-Avoid-conflicting-definition-with-strlcpy-in-glibc.patch" + patch_description: "Avoid conflicting definition with glibc strlcpy" + patch_type: "conan" diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py index fdd5b5034805a..c8b93b9dfcd14 100644 --- a/recipes/avahi/all/conanfile.py +++ b/recipes/avahi/all/conanfile.py @@ -3,7 +3,7 @@ from conan import ConanFile 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.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, rm from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout from conan.errors import ConanInvalidConfiguration @@ -32,6 +32,9 @@ class AvahiConan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def configure(self): if self.options.shared: self.options.rm_safe("fPIC") @@ -42,8 +45,8 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.78.1") - self.requires("expat/2.5.0") + self.requires("glib/2.78.3") + self.requires("expat/[>=2.6.2 <3]") self.requires("libdaemon/0.14") self.requires("dbus/1.15.8") self.requires("gdbm/1.23") @@ -56,7 +59,7 @@ def validate(self): def build_requirements(self): self.tool_requires("glib/") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -66,17 +69,19 @@ def generate(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("--enable-introspection=no") tc.configure_args.append("--disable-gtk3") tc.configure_args.append("--disable-mono") tc.configure_args.append("--disable-monodoc") 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("--with-distro=none") 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.configure_args.append("ac_cv_func_setproctitle=no") tc.generate() AutotoolsDeps(self).generate() PkgConfigDeps(self).generate() @@ -86,6 +91,7 @@ def generate(self): env.vars(self).save_script("conanbuild_pkg_config") def build(self): + apply_conandata_patches(self) autotools = Autotools(self) autotools.configure() autotools.make() @@ -107,7 +113,8 @@ def package_info(self): 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].libs = [avahi_lib] - self.cpp_info.components[lib].includedirs = ["include", os.path.join("include", avahi_lib)] + if lib != "common": + 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"] diff --git a/recipes/avahi/all/patches/0.8-0001-Avoid-conflicting-definition-with-strlcpy-in-glibc.patch b/recipes/avahi/all/patches/0.8-0001-Avoid-conflicting-definition-with-strlcpy-in-glibc.patch new file mode 100644 index 0000000000000..3a595ccc1cb70 --- /dev/null +++ b/recipes/avahi/all/patches/0.8-0001-Avoid-conflicting-definition-with-strlcpy-in-glibc.patch @@ -0,0 +1,79 @@ +From 495f8868f4cdad235608c7ac732ade17d3d49b17 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Wed, 6 Mar 2024 09:44:33 -0600 +Subject: [PATCH] Avoid conflicting definition with strlcpy in glibc + +--- + avahi-common/domain.c | 8 ++------ + avahi-compat-howl/text.c | 8 ++------ + 2 files changed, 4 insertions(+), 12 deletions(-) + +diff --git a/avahi-common/domain.c b/avahi-common/domain.c +index 3b1ab68..555aeb3 100644 +--- a/avahi-common/domain.c ++++ b/avahi-common/domain.c +@@ -477,9 +477,7 @@ int avahi_service_name_join(char *p, size_t size, const char *name, const char * + return AVAHI_OK; + } + +-#ifndef HAVE_STRLCPY +- +-static size_t strlcpy(char *dest, const char *src, size_t n) { ++static size_t avahi_strlcpy(char *dest, const char *src, size_t n) { + assert(dest); + assert(src); + +@@ -491,8 +489,6 @@ static size_t strlcpy(char *dest, const char *src, size_t n) { + return strlen(src); + } + +-#endif +- + int avahi_service_name_split(const char *p, char *name, size_t name_size, char *type, size_t type_size, char *domain, size_t domain_size) { + enum { + NAME, +@@ -524,7 +520,7 @@ int avahi_service_name_split(const char *p, char *name, size_t name_size, char * + + switch (state) { + case NAME: +- strlcpy(name, buf, name_size); ++ avahi_strlcpy(name, buf, name_size); + state = TYPE; + break; + +diff --git a/avahi-compat-howl/text.c b/avahi-compat-howl/text.c +index 7ef4df3..45f43ae 100644 +--- a/avahi-compat-howl/text.c ++++ b/avahi-compat-howl/text.c +@@ -37,9 +37,7 @@ struct _sw_text_record { + int buffer_valid; + }; + +-#ifndef HAVE_STRLCPY +- +-static size_t strlcpy(char *dest, const char *src, size_t n) { ++static size_t avahi_strlcpy(char *dest, const char *src, size_t n) { + assert(dest); + assert(src); + +@@ -51,8 +49,6 @@ static size_t strlcpy(char *dest, const char *src, size_t n) { + return strlen(src); + } + +-#endif +- + sw_result sw_text_record_init(sw_text_record *self) { + assert(self); + +@@ -244,7 +240,7 @@ sw_result sw_text_record_iterator_next( + if (avahi_string_list_get_pair(self->index, &mkey, &mvalue, &msize) < 0) + return SW_E_UNKNOWN; + +- strlcpy(key, mkey, SW_TEXT_RECORD_MAX_LEN); ++ avahi_strlcpy(key, mkey, SW_TEXT_RECORD_MAX_LEN); + memset(val, 0, SW_TEXT_RECORD_MAX_LEN); + memcpy(val, mvalue, msize); + *val_len = msize; +-- +2.44.0 + diff --git a/recipes/avahi/all/test_package/test_package.c b/recipes/avahi/all/test_package/test_package.c index 0b5b2dd52d5e2..99a41c3abe4ae 100644 --- a/recipes/avahi/all/test_package/test_package.c +++ b/recipes/avahi/all/test_package/test_package.c @@ -1,8 +1,10 @@ +#include #include #include "dns_sd.h" -#include "avahi-core/log.h" - +#include +#include +#include int main(void) { DNSServiceRef sdRef; @@ -16,5 +18,6 @@ int main(void) { { avahi_log_info("DNSServiceBrowse failed: %d\n", err); } + malloc_trim(0); // from return EXIT_SUCCESS; } diff --git a/recipes/avahi/all/test_v1_package/CMakeLists.txt b/recipes/avahi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/avahi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/avahi/all/test_v1_package/conanfile.py b/recipes/avahi/all/test_v1_package/conanfile.py deleted file mode 100644 index b6a26067f365d..0000000000000 --- a/recipes/avahi/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/avcpp/all/conandata.yml b/recipes/avcpp/all/conandata.yml index 1ba5e69f511c2..88c010aba2113 100644 --- a/recipes/avcpp/all/conandata.yml +++ b/recipes/avcpp/all/conandata.yml @@ -1,17 +1,30 @@ sources: + "2.4.0": + url: "https://github.com/h4tr3d/avcpp/archive/refs/tags/v2.4.0.tar.gz" + sha256: "47e044c10fa232f0d12d80351e675d5a5ef1480f81a93f288f33f8d03e94ae17" + "2.3.2": + url: "https://github.com/h4tr3d/avcpp/archive/refs/tags/v2.3.2.tar.gz" + sha256: "ce1a7296e6b1bf808ad4f9f486723c88e4cd12d80a96e226635ce3316ca73733" + "2.3.0": + url: "https://github.com/h4tr3d/avcpp/archive/refs/tags/v2.3.0.tar.gz" + sha256: "8ecb98caa9640a21772562c326f7c1f6ad99cd7f15d7ea40fe37d114fabbe2b5" "2.1.0": url: "https://github.com/h4tr3d/avcpp/archive/refs/tags/v2.1.0.tar.gz" sha256: "8398217dccb9f5b4cbb41e5bf4f73f47b461ed3ba8c3aefdda9f9dd714649855" - "cci.20220301": - url: "https://github.com/h4tr3d/avcpp/archive/fd4bc4662eb39853de8fcac4a663bebd0eea30b8.tar.gz" - sha256: "e48eae2ec154bc69aed16159c8b18c9ffb4925ba672b022e94a3c9b96782a4bf" - patches: - "2.1.0": - - patch_file: "patches/2.1.0-fix-ffmpeg.patch" + "2.4.0": + - patch_file: "patches/2.3.0-fix-ffmpeg.patch" + patch_description: "fix ffmpeg package name and remove ffmpeg from install targets" + patch_type: "conan" + "2.3.2": + - patch_file: "patches/2.3.0-fix-ffmpeg.patch" patch_description: "fix ffmpeg package name and remove ffmpeg from install targets" patch_type: "conan" - "cci.20220301": - - patch_file: "patches/cci.20220301-fix-ffmpeg.patch" + "2.3.0": + - patch_file: "patches/2.3.0-fix-ffmpeg.patch" + patch_description: "fix ffmpeg package name and remove ffmpeg from install targets" + patch_type: "conan" + "2.1.0": + - patch_file: "patches/2.1.0-fix-ffmpeg.patch" patch_description: "fix ffmpeg package name and remove ffmpeg from install targets" patch_type: "conan" diff --git a/recipes/avcpp/all/conanfile.py b/recipes/avcpp/all/conanfile.py index e1479bc47146c..dfef33000726b 100644 --- a/recipes/avcpp/all/conanfile.py +++ b/recipes/avcpp/all/conanfile.py @@ -56,7 +56,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("ffmpeg/5.0") + self.requires("ffmpeg/6.1", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -68,6 +68,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.19 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/avcpp/all/patches/2.3.0-fix-ffmpeg.patch b/recipes/avcpp/all/patches/2.3.0-fix-ffmpeg.patch new file mode 100644 index 0000000000000..e316cd9d624ba --- /dev/null +++ b/recipes/avcpp/all/patches/2.3.0-fix-ffmpeg.patch @@ -0,0 +1,46 @@ +diff --git CMakeLists.txt CMakeLists.txt +index b086352..91d3165 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -9,8 +9,6 @@ endif() + + project(AvCpp LANGUAGES CXX VERSION ${AVCPP_VERSION}) + +-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) +- + set(FFMPEG_PKG_CONFIG_SUFFIX "" CACHE STRING "This suffix uses for FFmpeg component names searches by pkg-config") + set(AV_ENABLE_STATIC On CACHE BOOL "Enable static library build (On)") + set(AV_ENABLE_SHARED On CACHE BOOL "Enable shared library build (On)") +@@ -31,8 +29,8 @@ set (AVCPP_WARNING_OPTIONS + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) + +-find_package(FFmpeg +- COMPONENTS AVCODEC AVFORMAT AVUTIL AVDEVICE AVFILTER SWSCALE SWRESAMPLE REQUIRED) ++find_package(ffmpeg ++ COMPONENTS avcodec avformat avutil avdevice avfilter swscale swresample REQUIRED) + + add_subdirectory(src) + +diff --git src/CMakeLists.txt src/CMakeLists.txt +index 3c00150..c3818cf 100644 +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -29,7 +29,7 @@ foreach(TARGET ${AV_TARGETS}) + + target_compile_options(${TARGET} PRIVATE ${AVCPP_WARNING_OPTIONS}) + target_compile_definitions(${TARGET} PUBLIC __STDC_CONSTANT_MACROS) +- target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC FFmpeg::FFmpeg) ++ target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC ffmpeg::ffmpeg) + target_include_directories(${TARGET} + PUBLIC + $ +@@ -58,7 +58,7 @@ if (AVCPP_NOT_SUBPROJECT) + # APPEND + # FILE ${CMAKE_CURRENT_BINARY_DIR}/avcpp-targets.cmake) + +- install(TARGETS ${AV_TARGETS} FFmpeg ++ install(TARGETS ${AV_TARGETS} + EXPORT avcpp-targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch b/recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch deleted file mode 100644 index 3207ead4b4610..0000000000000 --- a/recipes/avcpp/all/patches/cci.20220301-fix-ffmpeg.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a5fed05..d077b96 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,7 +6,7 @@ endif() - - project(AvCpp LANGUAGES CXX VERSION 2.0.99) - --set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) -+# set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) - - set(FFMPEG_PKG_CONFIG_SUFFIX "" CACHE STRING "This suffix uses for FFmpeg component names searches by pkg-config") - set(AV_ENABLE_STATIC On CACHE BOOL "Enable static library build (On)") -@@ -28,8 +28,8 @@ set (AVCPP_WARNING_OPTIONS - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads) - --find_package(FFmpeg -- COMPONENTS AVCODEC AVFORMAT AVUTIL AVDEVICE AVFILTER SWSCALE SWRESAMPLE REQUIRED) -+find_package(ffmpeg -+ COMPONENTS avcodec avformat avutil avdevice avfilter swscale swresample REQUIRED) - - add_subdirectory(src) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 80c6faa..262c16c 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -24,7 +24,7 @@ foreach(TARGET ${AV_TARGETS}) - add_library(${TARGET} ${TYPE} ${AV_SOURCES} ${AV_HEADERS}) - - target_compile_options(${TARGET} PRIVATE ${AVCPP_WARNING_OPTIONS}) -- target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC FFmpeg::FFmpeg) -+ target_link_libraries(${TARGET} PRIVATE Threads::Threads PUBLIC ffmpeg::ffmpeg) - target_include_directories(${TARGET} - PUBLIC - $ -@@ -53,7 +53,7 @@ if (AVCPP_NOT_SUBPROJECT) - # APPEND - # FILE ${CMAKE_CURRENT_BINARY_DIR}/avcpp-targets.cmake) - -- install(TARGETS ${AV_TARGETS} FFmpeg -+ install(TARGETS ${AV_TARGETS} - EXPORT avcpp-targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/avcpp/all/test_package/CMakeLists.txt b/recipes/avcpp/all/test_package/CMakeLists.txt index 7b07f0b83ed62..2ffc9a6f6e871 100644 --- a/recipes/avcpp/all/test_package/CMakeLists.txt +++ b/recipes/avcpp/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(avcpp REQUIRED CONFIG) diff --git a/recipes/avcpp/all/test_v1_package/CMakeLists.txt b/recipes/avcpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/avcpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/avcpp/all/test_v1_package/conanfile.py b/recipes/avcpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 6b551939fbde3..0000000000000 --- a/recipes/avcpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/avcpp/config.yml b/recipes/avcpp/config.yml index deb0eb011c7ea..ceaa4af535269 100644 --- a/recipes/avcpp/config.yml +++ b/recipes/avcpp/config.yml @@ -1,5 +1,9 @@ versions: - "2.1.0": + "2.4.0": + folder: all + "2.3.2": folder: all - "cci.20220301": + "2.3.0": + folder: all + "2.1.0": folder: all diff --git a/recipes/avir/all/test_v1_package/CMakeLists.txt b/recipes/avir/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/avir/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/avir/all/test_v1_package/conanfile.py b/recipes/avir/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/avir/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_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/aws-c-auth/all/conandata.yml b/recipes/aws-c-auth/all/conandata.yml index 47648a4e54a57..8889dcd6938e3 100644 --- a/recipes/aws-c-auth/all/conandata.yml +++ b/recipes/aws-c-auth/all/conandata.yml @@ -1,25 +1,10 @@ sources: - "0.7.7": - url: "https://github.com/awslabs/aws-c-auth/archive/v0.7.7.tar.gz" - sha256: "ea3c9e75b59b36aaf9147deec655d1669f197745bbe914cd3b8e234740be29ba" - "0.6.17": - url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.17.tar.gz" - sha256: "b43678ad3a779c9c7fccf8f931c162eaaf4d5d64d2955ac1fcfd32e538545c0f" - "0.6.11": - url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.11.tar.gz" - sha256: "d8a0d373cf8b0ff148a014ae2ba24c51f2e7a598b5b0cf3a6e64482c1cd37f90" - "0.6.8": - url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.8.tar.gz" - sha256: "48b1c0008265ea8e7d7b653b34640ce8111e00d6e0e3f4855f3fba71e1ac5704" + "0.8.4": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.8.4.tar.gz" + sha256: "5a49b43aba7d2be6217b73dc40256120d31a7d0ca2c3f96d06e5154beed5de7a" + "0.7.16": + url: "https://github.com/awslabs/aws-c-auth/archive/v0.7.16.tar.gz" + sha256: "7ee5afe05482f750dd0406b8b5b55dafb446fc21288f98c0b4118d62795003ba" "0.6.4": url: "https://github.com/awslabs/aws-c-auth/archive/v0.6.4.tar.gz" sha256: "119cec67e85b01af8c01b11d962c610d8e9b183cde96fee77db669cccaa19ac9" - "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 0181ea2ac5e2c..27874e432dde8 100644 --- a/recipes/aws-c-auth/all/conanfile.py +++ b/recipes/aws-c-auth/all/conanfile.py @@ -1,12 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, save, export_conandata_patches, apply_conandata_patches +from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version - import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class AwsCAuth(ConanFile): @@ -30,40 +28,31 @@ 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 - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") + implements = ["auto_shared_fpic"] + languages = "C" def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - 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-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) + if self.version == "0.8.4": + self.requires("aws-c-common/0.11.0", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.8.3") + # Are we overlinking? This has never been a requirement in upstream's CMakeLists.txt + self.requires("aws-c-io/0.15.4", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.9.3", transitive_headers=True) + self.requires("aws-c-sdkutils/0.2.3", transitive_headers=True) + if self.version == "0.7.16": + self.requires("aws-c-common/0.9.15", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.14") + self.requires("aws-c-io/0.14.7", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.8.1", transitive_headers=True) + self.requires("aws-c-sdkutils/0.1.15", transitive_headers=True) + if self.version == "0.6.4": + self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.12") + self.requires("aws-c-io/0.10.9", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.6.7", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -71,13 +60,14 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "0.8.4": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -87,27 +77,7 @@ def package(self): cmake = CMake(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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-auth") @@ -115,7 +85,3 @@ def package_info(self): 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 deleted file mode 100644 index bed12b1bd563b..0000000000000 --- a/recipes/aws-c-auth/all/patches/0.6.17-0001-fix-macro-usage.patch +++ /dev/null @@ -1,132 +0,0 @@ -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/all/test_package/CMakeLists.txt b/recipes/aws-c-auth/all/test_package/CMakeLists.txt index d0c587e8dd59d..2bb9e2bf9c45c 100644 --- a/recipes/aws-c-auth/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-auth/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(aws-c-auth REQUIRED CONFIG) diff --git a/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c23ed5cfe6d98..0000000000000 --- a/recipes/aws-c-auth/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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/aws-c-auth/all/test_v1_package/conanfile.py b/recipes/aws-c-auth/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/aws-c-auth/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/aws-c-auth/config.yml b/recipes/aws-c-auth/config.yml index 244301baade46..7fbeea62d48f6 100644 --- a/recipes/aws-c-auth/config.yml +++ b/recipes/aws-c-auth/config.yml @@ -1,13 +1,7 @@ versions: - "0.7.7": + "0.8.4": folder: all - "0.6.17": - folder: all - "0.6.11": - folder: all - "0.6.8": + "0.7.16": folder: all "0.6.4": folder: all - "0.6.0": - folder: all diff --git a/recipes/aws-c-cal/all/conandata.yml b/recipes/aws-c-cal/all/conandata.yml index 0bf0d966b7d3a..e848dc6714f18 100644 --- a/recipes/aws-c-cal/all/conandata.yml +++ b/recipes/aws-c-cal/all/conandata.yml @@ -1,56 +1,14 @@ 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" - "0.5.19": - url: "https://github.com/awslabs/aws-c-cal/archive/refs/tags/v0.5.19.tar.gz" - sha256: "23452ab7960c480f1ec0a96ac55bde32d7d27c4a664baeadc248923b19c12086" - "0.5.17": - url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.17.tar.gz" - sha256: "40297da04443d4ee2988d1c5fb0dc4a156d0e4cfaf80e6a1df1867452566d540" - "0.5.13": - url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.13.tar.gz" - sha256: "3aba3954877ea5271ce68361f3bd9c155b422b1149eed403874f6493285ca04d" + "0.8.3": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.8.3.tar.gz" + sha256: "413a5226a881eb2d7c7b453707c90b6ad1c0f63edfc15e87087f56d7d10c2a1b" + "0.6.14": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.6.14.tar.gz" + sha256: "2326304b15bec45b212f6b738020c21afa41f9da295936687e103f9f2efb7b5e" "0.5.12": url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.12.tar.gz" sha256: "350c29a288d5d498bd6574fca659cffc9453bf62691fbde5788399716c2bd132" 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" - patch_type: "backport" - patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" - "0.5.19": - - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" - patch_description: "Link to CoreFoundation on Apple" - patch_type: "backport" - patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" - "0.5.17": - - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" - patch_description: "Link to CoreFoundation on Apple" - patch_type: "backport" - patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" - "0.5.13": - - patch_file: "patches/0002-apple-corefoundation-0.5.13.patch" - patch_description: "Link to CoreFoundation on Apple" - patch_type: "backport" - patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" "0.5.12": - patch_file: "patches/0001-use-openssl-cmake-imported-target.patch" - patch_file: "patches/0002-apple-corefoundation-0.5.11.patch" diff --git a/recipes/aws-c-cal/all/conanfile.py b/recipes/aws-c-cal/all/conanfile.py index de7ce7d5e222d..979960dc6cca3 100644 --- a/recipes/aws-c-cal/all/conanfile.py +++ b/recipes/aws-c-cal/all/conanfile.py @@ -1,12 +1,11 @@ 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, export_conandata_patches, get, rmdir, save +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class AwsCCal(ConanFile): @@ -27,6 +26,9 @@ class AwsCCal(ConanFile): "fPIC": True, } + implements = ["auto_shared_fpic"] + languages = "C" + @property def _needs_openssl(self): return not (self.settings.os == "Windows" or is_apple_os(self)) @@ -34,40 +36,34 @@ def _needs_openssl(self): 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.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.20": - self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) - else: - self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + if self.version == "0.8.3": + self.requires("aws-c-common/0.11.0", transitive_headers=True, transitive_libs=True) + elif self.version == "0.6.14": + self.requires("aws-c-common/0.9.15", transitive_headers=True, transitive_libs=True) + elif self.version == "0.5.12": + self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) if self._needs_openssl: self.requires("openssl/[>=1.1 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False tc.variables["USE_OPENSSL"] = self._needs_openssl + if Version(self.version) < "0.8.3": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -77,27 +73,7 @@ def package(self): cmake = CMake(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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-cal") @@ -133,7 +109,3 @@ def package_info(self): crypto_link_flags = "-Wl," + ",".join(f"-u{symbol}" for symbol in crypto_symbols) 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.5.13.patch b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch deleted file mode 100644 index 422624b80de7e..0000000000000 --- a/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.5.13.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -78,7 +78,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.1.patch b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.1.patch deleted file mode 100644 index 616d8257a2980..0000000000000 --- a/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.1.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- 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 deleted file mode 100644 index 1059e3dd42f14..0000000000000 --- a/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.9.patch +++ /dev/null @@ -1,30 +0,0 @@ -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 a98182dc5ef67..98c061bc1c41d 100644 --- a/recipes/aws-c-cal/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-cal/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(aws-c-cal REQUIRED CONFIG) diff --git a/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-c-cal/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-c-cal/all/test_v1_package/conanfile.py b/recipes/aws-c-cal/all/test_v1_package/conanfile.py deleted file mode 100644 index e27da49632915..0000000000000 --- a/recipes/aws-c-cal/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +0,0 @@ -from conans import ConanFile, CMake, tools -from conan.tools.apple import is_apple_os -import os -import io - - -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() - cmake.build() - - def test(self): - if not tools.cross_building(self): - stream = io.StringIO() - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, stream, run_environment=True) - self.output.info(stream.getvalue()) - 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 f62f1684b8f2a..224236bdd6132 100644 --- a/recipes/aws-c-cal/config.yml +++ b/recipes/aws-c-cal/config.yml @@ -1,15 +1,7 @@ versions: - "0.6.9": + "0.8.3": folder: all - "0.6.1": - folder: all - "0.5.20": - folder: all - "0.5.19": - folder: all - "0.5.17": - folder: all - "0.5.13": + "0.6.14": folder: all "0.5.12": folder: all diff --git a/recipes/aws-c-common/all/conandata.yml b/recipes/aws-c-common/all/conandata.yml index 9261747efd7d9..b1b6a66237630 100644 --- a/recipes/aws-c-common/all/conandata.yml +++ b/recipes/aws-c-common/all/conandata.yml @@ -1,33 +1,10 @@ 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.6.20": - url: "https://github.com/awslabs/aws-c-common/archive/v0.6.20.tar.gz" - sha256: "6eb0b806c78b36a32eec9bcba8d2833e3973491a29d46fe3d11edc3f8d3e7f73" - "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" + "0.11.0": + url: "https://github.com/awslabs/aws-c-common/archive/v0.11.0.tar.gz" + sha256: "88115d6f3e4f79d8b2544ed8a95d8a9699985aed38aeb4779d7c9fffde1fee58" + "0.9.15": + url: "https://github.com/awslabs/aws-c-common/archive/v0.9.15.tar.gz" + sha256: "8f36c7a6a5d2e17365759d15591f800d3e76dcaa34a226389b92647cbd92393a" + "0.6.11": + url: "https://github.com/awslabs/aws-c-common/archive/v0.6.11.tar.gz" + sha256: "86159bd1128eee2813f705c275d319e14d1b77017fab46f6ca5dafcc66edaea9" diff --git a/recipes/aws-c-common/all/conanfile.py b/recipes/aws-c-common/all/conanfile.py index 4c7af96e0f6da..11147663a6957 100644 --- a/recipes/aws-c-common/all/conanfile.py +++ b/recipes/aws-c-common/all/conanfile.py @@ -1,14 +1,12 @@ 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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.files import copy, get 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 = ">=2.4" class AwsCCommon(ConanFile): @@ -35,28 +33,12 @@ class AwsCCommon(ConanFile): "cpu_extensions": True, } - 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.11": - del self.options.cpu_extensions - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") + implements = ["auto_shared_fpic"] + languages = "C" def layout(self): cmake_layout(self, src_folder="src") - def validate(self): - if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): - raise ConanInvalidConfiguration("Static runtime + shared is not working for more recent releases") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -64,15 +46,15 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False tc.variables["AWS_ENABLE_LTO"] = False - if Version(self.version) >= "0.6.0": - tc.variables["AWS_WARNINGS_ARE_ERRORS"] = False + tc.variables["AWS_WARNINGS_ARE_ERRORS"] = False if is_msvc(self): tc.variables["STATIC_CRT"] = is_msvc_static_runtime(self) + if Version(self.version) < "0.11.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.variables["USE_CPU_EXTENSIONS"] = self.options.get_safe("cpu_extensions", False) tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -81,28 +63,6 @@ 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", "aws-c-common")) - - # 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-common": "aws-c-common::aws-c-common"} - ) - - 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-common") @@ -113,14 +73,15 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["dl", "m", "pthread", "rt"] elif self.settings.os == "Windows": - self.cpp_info.system_libs = ["bcrypt", "ws2_32"] + self.cpp_info.system_libs = ["bcrypt", "ws2_32", "kernel32"] if Version(self.version) >= "0.6.13": self.cpp_info.system_libs.append("shlwapi") + if Version(self.version) >= "0.9.15": + self.cpp_info.system_libs.append("psapi") if not self.options.shared: if is_apple_os(self): self.cpp_info.frameworks = ["CoreFoundation"] - self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) - - # 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] + if Version(self.version) >= "0.11.0": + self.cpp_info.builddirs.append(os.path.join("lib", "cmake", "aws-c-common", "modules")) + else: + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) diff --git a/recipes/aws-c-common/all/patches/0001-disable-fPIC.patch b/recipes/aws-c-common/all/patches/0001-disable-fPIC.patch deleted file mode 100644 index 1c3c5cada4202..0000000000000 --- a/recipes/aws-c-common/all/patches/0001-disable-fPIC.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cmake/AwsCFlags.cmake -+++ cmake/AwsCFlags.cmake -@@ -62,8 +62,8 @@ - # Warning disables always go last to avoid future flags re-enabling them - list(APPEND AWS_C_FLAGS -Wno-long-long) - -- # Always enable position independent code, since this code will always end up in a shared lib -- list(APPEND AWS_C_FLAGS -fPIC) -+ # Don't always set fPIC as conan will handle position independent code. -+ # list(APPEND AWS_C_FLAGS -fPIC) - - if (LEGACY_COMPILER_SUPPORT) - list(APPEND AWS_C_FLAGS -Wno-strict-aliasing) diff --git a/recipes/aws-c-common/all/patches/0002-no-warnings-as-errors.patch b/recipes/aws-c-common/all/patches/0002-no-warnings-as-errors.patch deleted file mode 100644 index 8abe45bd0a3d6..0000000000000 --- a/recipes/aws-c-common/all/patches/0002-no-warnings-as-errors.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/cmake/AwsCFlags.cmake -+++ b/cmake/AwsCFlags.cmake -@@ -34,7 +34,7 @@ function(aws_set_common_properties target) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" PARENT_SCOPE) - endif() - -- list(APPEND AWS_C_FLAGS /W4 /WX /MP) -+ list(APPEND AWS_C_FLAGS /W4 /MP) - # /volatile:iso relaxes some implicit memory barriers that MSVC normally applies for volatile accesses - # Since we want to be compatible with user builds using /volatile:iso, use it for the tests. - list(APPEND AWS_C_FLAGS /volatile:iso) -@@ -49,7 +49,7 @@ function(aws_set_common_properties target) - list(APPEND AWS_C_FLAGS "${_FLAGS}") - - else() -- list(APPEND AWS_C_FLAGS -Wall -Werror -Wstrict-prototypes) -+ list(APPEND AWS_C_FLAGS -Wall -Wstrict-prototypes) - - if(NOT SET_PROPERTIES_NO_WEXTRA) - list(APPEND AWS_C_FLAGS -Wextra) diff --git a/recipes/aws-c-common/all/test_package/CMakeLists.txt b/recipes/aws-c-common/all/test_package/CMakeLists.txt index c60f5562de5c5..46d29bb19b0c7 100644 --- a/recipes/aws-c-common/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-common/all/test_package/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) find_package(aws-c-common REQUIRED CONFIG) +include(AwsCFlags) + add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-common) diff --git a/recipes/aws-c-common/config.yml b/recipes/aws-c-common/config.yml index 86ea79fbcf2ff..69e4cf26d909c 100644 --- a/recipes/aws-c-common/config.yml +++ b/recipes/aws-c-common/config.yml @@ -1,17 +1,7 @@ versions: - "0.9.6": + "0.11.0": folder: all - "0.9.3": + "0.9.15": folder: all - "0.9.0": - folder: all - "0.8.23": - folder: all - "0.8.2": - folder: all - "0.7.5": - folder: all - "0.6.20": - folder: all - "0.4.25": + "0.6.11": folder: all diff --git a/recipes/aws-c-compression/all/conandata.yml b/recipes/aws-c-compression/all/conandata.yml index d936f5ef9af18..ff6bb0a1156c9 100644 --- a/recipes/aws-c-compression/all/conandata.yml +++ b/recipes/aws-c-compression/all/conandata.yml @@ -1,13 +1,10 @@ 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" + "0.3.1": + url: "https://github.com/awslabs/aws-c-compression/archive/v0.3.1.tar.gz" + sha256: "d89fca17a37de762dc34f332d2da402343078da8dbd2224c46a11a88adddf754" + "0.2.18": + url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.18.tar.gz" + sha256: "517c361f3b7fffca08efd5ad251a20489794f056eab0dfffacc6d5b341df8e86" "0.2.14": url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.14.tar.gz" sha256: "8737863ced57d92f5a0bdde554bf0fe70eaa76aae118fec09a6c361dfc55d0d5" - "0.2.13": - url: "https://github.com/awslabs/aws-c-compression/archive/v0.2.13.tar.gz" - sha256: "6b6ebb223408b48a8b2c74ba7042ff61e5333dc900acd67c40ca1cd4b382c137" diff --git a/recipes/aws-c-compression/all/conanfile.py b/recipes/aws-c-compression/all/conanfile.py index a6b8eb1260a1b..12b55197a3293 100644 --- a/recipes/aws-c-compression/all/conanfile.py +++ b/recipes/aws-c-compression/all/conanfile.py @@ -1,11 +1,10 @@ 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.files import copy, get, rmdir from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class AwsCCompression(ConanFile): @@ -26,24 +25,19 @@ class AwsCCompression(ConanFile): "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") + implements = ["auto_shared_fpic"] + languages = "C" def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - 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) + if self.version == "0.3.1": + self.requires("aws-c-common/0.11.0", transitive_headers=True, transitive_libs=True) + if self.version == "0.2.18": + self.requires("aws-c-common/0.9.15", transitive_headers=True, transitive_libs=True) + if self.version == "0.2.14": + self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -51,6 +45,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "0.3.1": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) deps.generate() @@ -65,27 +61,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-compression")) - - # 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-compression": "aws-c-compression::aws-c-compression"} - ) - - 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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-compression") @@ -93,7 +69,3 @@ def package_info(self): self.cpp_info.libs = ["aws-c-compression"] if self.options.shared: self.cpp_info.defines.append("AWS_COMPRESSION_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-compression/all/test_package/CMakeLists.txt b/recipes/aws-c-compression/all/test_package/CMakeLists.txt index 8efb2e9b0efa5..e132d9839a3e1 100644 --- a/recipes/aws-c-compression/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-compression/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(aws-c-compression REQUIRED CONFIG) diff --git a/recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-c-compression/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-c-compression/all/test_v1_package/conanfile.py b/recipes/aws-c-compression/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/aws-c-compression/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_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/aws-c-compression/config.yml b/recipes/aws-c-compression/config.yml index aae181600c27e..f647bea593ea0 100644 --- a/recipes/aws-c-compression/config.yml +++ b/recipes/aws-c-compression/config.yml @@ -1,9 +1,7 @@ versions: - "0.2.17": + "0.3.1": folder: all - "0.2.15": + "0.2.18": folder: all "0.2.14": folder: all - "0.2.13": - folder: all diff --git a/recipes/aws-c-event-stream/all/conandata.yml b/recipes/aws-c-event-stream/all/conandata.yml index dd1f6736ca7be..d31e6ea1dd562 100644 --- a/recipes/aws-c-event-stream/all/conandata.yml +++ b/recipes/aws-c-event-stream/all/conandata.yml @@ -1,26 +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" - "0.2.12": - url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.12.tar.gz" - sha256: "cc4ebfe715d8df5b9e3f4a3ce9b67d5f480017a7ebbbfa1d5e64ea53ec672580" - "0.2.11": - url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.11.tar.gz" - sha256: "4818b8d3fe02016fcfdd033c1e9d8f6be07ccaeb38664fe8c31c0fd153ea56e6" + "0.5.1": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.5.1.tar.gz" + sha256: "22ce7a695b82debe118c9ecc641ea8bc7e59c9843f92d5acf8401fc86cac847a" + "0.4.2": + url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.4.2.tar.gz" + sha256: "c98b8fa05c2ca10aacfce7327b92a84669c2da95ccb8e7d7b3e3285fcec8beee" "0.2.7": url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.2.7.tar.gz" sha256: "bb5c94cdff70c1985fb0b5f30d81756cedb5a3c3075d37f7e1e2b34e2a33c8c0" - "0.1.5": - url: "https://github.com/awslabs/aws-c-event-stream/archive/v0.1.5.tar.gz" - sha256: "f1b423a487b5d6dca118bfc0d0c6cc596dc476b282258a3228e73a8f730422d4" -patches: - "0.1.5": - - patch_file: "patches/0001-disable-tests-bin.patch" - - patch_file: "patches/0002-use-PROJECT_SOURCE_DIR.patch" diff --git a/recipes/aws-c-event-stream/all/conanfile.py b/recipes/aws-c-event-stream/all/conanfile.py index e7d1df562c48b..7b9169f4aa426 100644 --- a/recipes/aws-c-event-stream/all/conanfile.py +++ b/recipes/aws-c-event-stream/all/conanfile.py @@ -1,11 +1,10 @@ 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, get, copy, rmdir, save +from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class AwsCEventStream(ConanFile): @@ -26,36 +25,25 @@ class AwsCEventStream(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: - self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") + implements = ["auto_shared_fpic"] + languages = "C" def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - 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") - elif Version(self.version) < "0.3.1": - self.requires("aws-c-io/0.13.4") - else: - self.requires("aws-c-io/0.13.35") + if self.version == "0.5.1": + self.requires("aws-c-common/0.11.0", transitive_headers=True, transitive_libs=True) + self.requires("aws-checksums/0.2.3") + self.requires("aws-c-io/0.15.4") + if self.version == "0.4.2": + self.requires("aws-c-common/0.9.15", transitive_headers=True, transitive_libs=True) + self.requires("aws-checksums/0.1.18") + self.requires("aws-c-io/0.14.7") + if self.version == "0.2.7": + self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) + self.requires("aws-checksums/0.1.12") + self.requires("aws-c-io/0.10.9") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -64,13 +52,14 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_BINARIES"] = False tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "0.5.1": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -80,27 +69,7 @@ def package(self): 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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-event-stream") @@ -108,7 +77,3 @@ def package_info(self): 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.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/patches/0001-disable-tests-bin.patch b/recipes/aws-c-event-stream/all/patches/0001-disable-tests-bin.patch deleted file mode 100644 index 21eae44486c93..0000000000000 --- a/recipes/aws-c-event-stream/all/patches/0001-disable-tests-bin.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -112,14 +112,18 @@ - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" - DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/" - COMPONENT Development) - - --include(CTest) --enable_testing() --add_subdirectory(tests) -+if(BUILD_TESTING) -+ include(CTest) -+ enable_testing() -+ add_subdirectory(tests) -+endif() - - if(NOT MSVC) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - endif() - --add_subdirectory(bin) -+if(BUILD_BINARIES) -+ add_subdirectory(bin) -+endif() diff --git a/recipes/aws-c-event-stream/all/patches/0002-use-PROJECT_SOURCE_DIR.patch b/recipes/aws-c-event-stream/all/patches/0002-use-PROJECT_SOURCE_DIR.patch deleted file mode 100644 index f2b60bb0f9a1d..0000000000000 --- a/recipes/aws-c-event-stream/all/patches/0002-use-PROJECT_SOURCE_DIR.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -70,25 +70,25 @@ - ${AWS_EVENT_STREAM_SRC} - ) - --add_library(${CMAKE_PROJECT_NAME} ${EVENT_STREAM_SRC}) --aws_set_common_properties(${CMAKE_PROJECT_NAME}) --aws_add_sanitizers(${CMAKE_PROJECT_NAME}) --aws_prepare_symbol_visibility_args(${CMAKE_PROJECT_NAME} "AWS_EVENT_STREAM") -+add_library(${PROJECT_NAME} ${EVENT_STREAM_SRC}) -+aws_set_common_properties(${PROJECT_NAME}) -+aws_add_sanitizers(${PROJECT_NAME}) -+aws_prepare_symbol_visibility_args(${PROJECT_NAME} "AWS_EVENT_STREAM") - --target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC -+target_include_directories(${PROJECT_NAME} PUBLIC - $ - $) - - --set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES VERSION 1.0.0) --set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES SOVERSION 0unstable) -+set_target_properties(${PROJECT_NAME} PROPERTIES VERSION 1.0.0) -+set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 0unstable) - - find_package(aws-c-common REQUIRED) - find_package(aws-checksums REQUIRED) - --target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC AWS::aws-c-common AWS::aws-checksums) -+target_link_libraries(${PROJECT_NAME} PUBLIC AWS::aws-c-common AWS::aws-checksums) - --aws_prepare_shared_lib_exports(${CMAKE_PROJECT_NAME}) -+aws_prepare_shared_lib_exports(${PROJECT_NAME}) - - install(FILES ${AWS_EVENT_STREAM_HEADERS} - DESTINATION "include/aws/event-stream" -@@ -100,17 +100,17 @@ - set (TARGET_DIR "static") - endif() - --install(EXPORT "${CMAKE_PROJECT_NAME}-targets" -- DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/${TARGET_DIR}/" -+install(EXPORT "${PROJECT_NAME}-targets" -+ DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/${TARGET_DIR}/" - NAMESPACE AWS:: - COMPONENT Development) - --configure_file("cmake/${CMAKE_PROJECT_NAME}-config.cmake" -- "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" -+configure_file("cmake/${PROJECT_NAME}-config.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" - @ONLY) - --install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" -- DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/" -+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" -+ DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/" - COMPONENT Development) - - diff --git a/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt b/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt index 05cae5027e20e..0c3c06b06f090 100644 --- a/recipes/aws-c-event-stream/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-event-stream/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(aws-c-event-stream REQUIRED CONFIG) diff --git a/recipes/aws-c-event-stream/all/test_package/test_package.c b/recipes/aws-c-event-stream/all/test_package/test_package.c index 1b923438da34f..2cb953a451bf1 100644 --- a/recipes/aws-c-event-stream/all/test_package/test_package.c +++ b/recipes/aws-c-event-stream/all/test_package/test_package.c @@ -15,7 +15,7 @@ int main() { int res = aws_event_stream_message_init(&message, allocator, NULL, NULL); if (res != 0) { - fprintf(stderr, "Failed to init messag\n"); + fprintf(stderr, "Failed to init message\n"); } if (sizeof(expected_data) != aws_event_stream_message_total_length(&message)) { @@ -31,5 +31,7 @@ int main() { } } + aws_event_stream_message_clean_up(&message); + return EXIT_SUCCESS; } 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 deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-c-event-stream/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-c-event-stream/all/test_v1_package/conanfile.py b/recipes/aws-c-event-stream/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/aws-c-event-stream/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/aws-c-event-stream/config.yml b/recipes/aws-c-event-stream/config.yml index 38b22762f5273..0deb815031928 100644 --- a/recipes/aws-c-event-stream/config.yml +++ b/recipes/aws-c-event-stream/config.yml @@ -1,15 +1,7 @@ versions: - "0.3.2": + "0.5.1": folder: all - "0.3.1": - folder: all - "0.2.15": - folder: all - "0.2.12": - folder: all - "0.2.11": + "0.4.2": folder: all "0.2.7": folder: all - "0.1.5": - folder: all diff --git a/recipes/aws-c-http/all/conandata.yml b/recipes/aws-c-http/all/conandata.yml index 68fa29d3753e7..6b177998eceed 100644 --- a/recipes/aws-c-http/all/conandata.yml +++ b/recipes/aws-c-http/all/conandata.yml @@ -1,19 +1,10 @@ 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" - "0.6.13": - url: "https://github.com/awslabs/aws-c-http/archive/v0.6.13.tar.gz" - sha256: "8c69f8fc58b7073039e598383da3e1fd9b23f392cb992dbe769a7b80f342dbaf" - "0.6.10": - url: "https://github.com/awslabs/aws-c-http/archive/v0.6.10.tar.gz" - sha256: "4413faf2b8f6a83c898bb535cf83542fa548d7ecc1acf681dc79b7959a07231a" + "0.9.3": + url: "https://github.com/awslabs/aws-c-http/archive/v0.9.3.tar.gz" + sha256: "63061321fd3234a4f8688cff1a6681089321519436a5f181e1bcb359204df7c8" + "0.8.1": + url: "https://github.com/awslabs/aws-c-http/archive/v0.8.1.tar.gz" + sha256: "83fb47e2d7956469bb328f16dea96663e96f8f20dc60dc4e9676b82804588530" "0.6.7": url: "https://github.com/awslabs/aws-c-http/archive/v0.6.7.tar.gz" sha256: "2244d1e26ce5b5f40f96e570b1c4332a07c645ef744644d5b90b089d3695ec3b" - "0.6.5": - url: "https://github.com/awslabs/aws-c-http/archive/v0.6.5.tar.gz" - sha256: "9cb82f1cfe1342f4bbd58f51b74beaeb6a544fb6792c48f9b0d3967619b33221" diff --git a/recipes/aws-c-http/all/conanfile.py b/recipes/aws-c-http/all/conanfile.py index a9bb3bc67dc42..cfa09b8ce714c 100644 --- a/recipes/aws-c-http/all/conanfile.py +++ b/recipes/aws-c-http/all/conanfile.py @@ -1,11 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, save +from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class AwsCHttp(ConanFile): @@ -26,33 +25,29 @@ class AwsCHttp(ConanFile): "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") + implements = ["auto_shared_fpic"] + languages = "C" def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - 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.32", transitive_headers=True, transitive_libs=True) + if self.version == "0.9.3": + self.requires("aws-c-common/0.11.0", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-compression/0.3.1") + # Upstream uses this even if it does not explicitly state it in the CMakeLists + # Maybe expecting the headers to be there transitively? + self.requires("aws-c-cal/0.8.3") + self.requires("aws-c-io/0.15.4", transitive_headers=True, transitive_libs=True) + if self.version == "0.8.1": + self.requires("aws-c-common/0.9.15", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-compression/0.2.18") + self.requires("aws-c-cal/0.6.14") + self.requires("aws-c-io/0.14.7", transitive_headers=True, transitive_libs=True) + if self.version == "0.6.7": + self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-compression/0.2.14") + self.requires("aws-c-io/0.10.9", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -60,6 +55,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "0.9.3": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) @@ -75,27 +72,7 @@ def package(self): cmake = CMake(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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-http") @@ -103,7 +80,3 @@ def package_info(self): self.cpp_info.libs = ["aws-c-http"] if self.options.shared: self.cpp_info.defines.append("AWS_HTTP_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-http/all/test_package/CMakeLists.txt b/recipes/aws-c-http/all/test_package/CMakeLists.txt index 94387e3cbcded..18342a4d34280 100644 --- a/recipes/aws-c-http/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-http/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(aws-c-http REQUIRED CONFIG) diff --git a/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-c-http/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-c-http/all/test_v1_package/conanfile.py b/recipes/aws-c-http/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/aws-c-http/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/aws-c-http/config.yml b/recipes/aws-c-http/config.yml index febd9410cb93f..7ea19b073784d 100644 --- a/recipes/aws-c-http/config.yml +++ b/recipes/aws-c-http/config.yml @@ -1,13 +1,7 @@ versions: - "0.7.14": + "0.9.3": folder: all - "0.6.22": - folder: all - "0.6.13": - folder: all - "0.6.10": + "0.8.1": folder: all "0.6.7": folder: all - "0.6.5": - folder: all diff --git a/recipes/aws-c-io/all/conandata.yml b/recipes/aws-c-io/all/conandata.yml index 1e15f1d87d7c3..8479134c2bf16 100644 --- a/recipes/aws-c-io/all/conandata.yml +++ b/recipes/aws-c-io/all/conandata.yml @@ -1,19 +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" - "0.11.2": - url: "https://github.com/awslabs/aws-c-io/archive/v0.11.2.tar.gz" - sha256: "b60270d23b6e2f4a5d80e64ca6538ba114cd6044b53752964c940f87e59bf0d9" - "0.10.20": - url: "https://github.com/awslabs/aws-c-io/archive/v0.10.20.tar.gz" - sha256: "293248ef96166826370223865bff2537bea5e08f6913919884c53add8238ba97" - "0.10.13": - url: "https://github.com/awslabs/aws-c-io/archive/v0.10.13.tar.gz" - sha256: "ee34a93190e35a5c372ba73661dd69c48986e051a4b26dedb62bc5aa78f1660f" + "0.15.4": + url: "https://github.com/awslabs/aws-c-io/archive/v0.15.4.tar.gz" + sha256: "e5202033b09df61ffb2a57284a04735ac013296decc107de1c4abd1ce7d5cfda" + "0.14.7": + url: "https://github.com/awslabs/aws-c-io/archive/v0.14.7.tar.gz" + sha256: "ecf1f660d7d43913aa8a416be6a2027101ce87c3b241344342d608335b4df7d4" + "0.10.9": + url: "https://github.com/awslabs/aws-c-io/archive/v0.10.9.tar.gz" + sha256: "c64464152abe8b7e23f10bc026ed54a15eaf0ec0aae625d28e2caf4489090327" diff --git a/recipes/aws-c-io/all/conanfile.py b/recipes/aws-c-io/all/conanfile.py index 36c3965b9abd8..40e5364df0979 100644 --- a/recipes/aws-c-io/all/conanfile.py +++ b/recipes/aws-c-io/all/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, save +from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" + +required_conan_version = ">=2.4" class AwsCIO(ConanFile): @@ -26,31 +26,30 @@ class AwsCIO(ConanFile): "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") + implements = ["auto_shared_fpic"] + languages = "C" def layout(self): cmake_layout(self, src_folder="src") 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.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.55") + # These versions come from aws-sdl-cpp prefetch_crt_dependency.sh file, + # dont bump them independently, check the file and update all the dependencies at once + if self.version == "0.15.4": + self.requires("aws-c-common/0.11.0", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.8.3") + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.requires("s2n/1.5.9") + if self.version == "0.14.7": + self.requires("aws-c-common/0.9.15", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.14") + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.requires("s2n/1.4.16") # 1.4.11 not available, using next available version + if self.version == "0.10.9": + self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.12") + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.requires("s2n/1.3.15") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -58,6 +57,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "0.15.4": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) @@ -73,27 +74,7 @@ def package(self): cmake = CMake(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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-io") @@ -103,9 +84,7 @@ def package_info(self): self.cpp_info.defines.append("AWS_IO_USE_IMPORT_EXPORT") if self.settings.os == "Macos": self.cpp_info.frameworks.append("Security") + if Version(self.version) >= "0.15.4": + self.cpp_info.frameworks.append("Network") if self.settings.os == "Windows": self.cpp_info.system_libs = ["crypt32", "secur32", "shlwapi"] - - # 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-io/all/test_package/CMakeLists.txt b/recipes/aws-c-io/all/test_package/CMakeLists.txt index de3176cc25055..7dcd7fe6dade7 100644 --- a/recipes/aws-c-io/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-io/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(aws-c-io REQUIRED CONFIG) diff --git a/recipes/aws-c-io/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-io/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index e45dc2bc298c6..0000000000000 --- a/recipes/aws-c-io/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(aws-c-io REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} AWS::aws-c-io) diff --git a/recipes/aws-c-io/all/test_v1_package/conanfile.py b/recipes/aws-c-io/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/aws-c-io/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/aws-c-io/config.yml b/recipes/aws-c-io/config.yml index 8a602cc8c0e60..e3faf87ae78c3 100644 --- a/recipes/aws-c-io/config.yml +++ b/recipes/aws-c-io/config.yml @@ -1,13 +1,7 @@ versions: - "0.13.35": + "0.15.4": folder: all - "0.13.32": + "0.14.7": folder: all - "0.13.4": - folder: all - "0.11.2": - folder: all - "0.10.20": - folder: all - "0.10.13": + "0.10.9": folder: all diff --git a/recipes/aws-c-mqtt/all/conandata.yml b/recipes/aws-c-mqtt/all/conandata.yml index 275052c56df7c..f89ac9b70db7f 100644 --- a/recipes/aws-c-mqtt/all/conandata.yml +++ b/recipes/aws-c-mqtt/all/conandata.yml @@ -1,19 +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" - "0.7.10": - url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.10.tar.gz" - sha256: "95667477e17bc99d49a1d6674d7fb98f9a0379b6966cb2ed4863152e959d9e8f" - "0.7.9": - url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.9.tar.gz" - sha256: "8556ae7c2b30ebb4ccb61becb120a848ea33315f7cf85436ebe5f21b75ab09c4" - "0.7.6": - url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.6.tar.gz" - sha256: "a02c0525f7ddcdc058cd9f507b2f3a8be0383fc946920ed32c9d780cc29703ac" + "0.12.1": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.12.1.tar.gz" + sha256: "04abe47c798bf9dcb95e25ea9acd62a35a3f22e58b61c16912a6275c2f8230fe" + "0.10.3": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.10.3.tar.gz" + sha256: "bb938d794b0757d669b5877526363dc6f6f0e43869ca19fc196ffd0f7a35f5b9" + "0.7.8": + url: "https://github.com/awslabs/aws-c-mqtt/archive/v0.7.8.tar.gz" + sha256: "bf5ed63706f3f1aed86a878462fac78e5f045dfc34567bfb86c38f8b9d9d51ef" diff --git a/recipes/aws-c-mqtt/all/conanfile.py b/recipes/aws-c-mqtt/all/conanfile.py index d97246f605d3f..538012f74ed4e 100644 --- a/recipes/aws-c-mqtt/all/conanfile.py +++ b/recipes/aws-c-mqtt/all/conanfile.py @@ -1,12 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, save +from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version - import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class AwsCMQTT(ConanFile): @@ -27,30 +25,26 @@ class AwsCMQTT(ConanFile): "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") + implements = ["auto_shared_fpic"] + languages = "C" def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - 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-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") + if self.version == "0.12.1": + self.requires("aws-c-common/0.11.0", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-http/0.9.3") + if self.version == "0.10.3": + self.requires("aws-c-common/0.9.15", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.14") + self.requires("aws-c-io/0.14.7", transitive_headers=True) + self.requires("aws-c-http/0.8.1") + if self.version == "0.7.8": + self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.12") + self.requires("aws-c-io/0.10.9", transitive_headers=True) + self.requires("aws-c-http/0.6.7") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -58,6 +52,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "0.12.1": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) @@ -73,27 +69,7 @@ def package(self): cmake = CMake(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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-mqtt") @@ -101,7 +77,3 @@ def package_info(self): self.cpp_info.libs = ["aws-c-mqtt"] if self.options.shared: self.cpp_info.defines.append("AWS_MQTT_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-mqtt/all/test_package/CMakeLists.txt b/recipes/aws-c-mqtt/all/test_package/CMakeLists.txt index 04c8de77ba626..79da95529e6f7 100644 --- a/recipes/aws-c-mqtt/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-mqtt/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(aws-c-mqtt REQUIRED CONFIG) diff --git a/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-c-mqtt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-c-mqtt/all/test_v1_package/conanfile.py b/recipes/aws-c-mqtt/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/aws-c-mqtt/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/aws-c-mqtt/config.yml b/recipes/aws-c-mqtt/config.yml index 788eeccfb0963..df750f5221cc7 100644 --- a/recipes/aws-c-mqtt/config.yml +++ b/recipes/aws-c-mqtt/config.yml @@ -1,13 +1,7 @@ versions: - "0.9.10": + "0.12.1": folder: all - "0.8.12": + "0.10.3": folder: all - "0.7.12": - folder: all - "0.7.10": - folder: all - "0.7.9": - folder: all - "0.7.6": + "0.7.8": folder: all diff --git a/recipes/aws-c-s3/all/conandata.yml b/recipes/aws-c-s3/all/conandata.yml index 776d2c58fad6a..6e32ecb4f26ee 100644 --- a/recipes/aws-c-s3/all/conandata.yml +++ b/recipes/aws-c-s3/all/conandata.yml @@ -1,13 +1,10 @@ sources: - "0.1.49": - url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.49.tar.gz" - sha256: "71acbba41a02477a6c352172da561bc2138bf239b936490c773d7aaa83afc9ab" - "0.1.37": - url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.37.tar.gz" - sha256: "2c35100c1739300e438d47f49aaa2c374001416a79fe3c6f27d79371fb2ac90b" - "0.1.29": - url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.29.tar.gz" - sha256: "bcbc38d091ad994fec2789bffd1d99e157c5e29a60685e836f028006e531bc60" - "0.1.27": - url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.27.tar.gz" - sha256: "8fccbf967c3b29f0feaa1ba3de158b7ead805c3b4302c45b7cad3429f045920c" + "0.7.11": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.7.11.tar.gz" + sha256: "6602c92c8b4602dee50636f4128a7842f7359314d030db35368120491b3582bc" + "0.5.5": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.5.5.tar.gz" + sha256: "81d3913826953cb634ef1183a0c241d5e117419a877b625d69d7e1e54bbe5219" + "0.1.26": + url: "https://github.com/awslabs/aws-c-s3/archive/v0.1.26.tar.gz" + sha256: "68467095ce2c523caa9ecac27453cd83f4c195c33c6ab8c8b0fa6534565d19bf" diff --git a/recipes/aws-c-s3/all/conanfile.py b/recipes/aws-c-s3/all/conanfile.py index 4854a0ec7c6d5..caf33fd9c013f 100644 --- a/recipes/aws-c-s3/all/conanfile.py +++ b/recipes/aws-c-s3/all/conanfile.py @@ -1,11 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, save +from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class AwsCS3(ConanFile): @@ -26,32 +25,33 @@ class AwsCS3(ConanFile): "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") + implements = ["auto_shared_fpic"] + languages = "C" 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.1.49": - self.requires("aws-c-auth/0.6.11", transitive_headers=True) - self.requires("aws-c-http/0.6.13") - self.requires("aws-c-io/0.10.20", transitive_headers=True) - else: - self.requires("aws-c-auth/0.6.17", transitive_headers=True) - self.requires("aws-c-http/0.6.22") - 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") + if self.version == "0.7.11": + self.requires("aws-c-common/0.11.0", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.8.3") + self.requires("aws-c-auth/0.8.4", transitive_headers=True) + self.requires("aws-c-http/0.9.3") + self.requires("aws-c-io/0.15.4", transitive_headers=True) + self.requires("aws-checksums/0.2.3") + if self.version == "0.5.5": + self.requires("aws-c-common/0.9.15", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.14") + self.requires("aws-c-auth/0.7.16", transitive_headers=True) + self.requires("aws-c-http/0.8.1") + self.requires("aws-c-io/0.14.7", transitive_headers=True) + self.requires("aws-checksums/0.1.18") + if self.version == "0.1.26": + self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.5.12") + self.requires("aws-c-auth/0.6.4", transitive_headers=True) + self.requires("aws-c-http/0.6.7") + self.requires("aws-c-io/0.10.9", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -59,6 +59,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "0.7.11": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) @@ -74,27 +76,7 @@ def package(self): cmake = CMake(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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-s3") @@ -102,7 +84,3 @@ def package_info(self): self.cpp_info.libs = ["aws-c-s3"] if self.options.shared: self.cpp_info.defines.append("AWS_S3_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-s3/all/test_package/CMakeLists.txt b/recipes/aws-c-s3/all/test_package/CMakeLists.txt index 8e0fdd1abc04c..c23f893b82745 100644 --- a/recipes/aws-c-s3/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-s3/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(aws-c-s3 REQUIRED CONFIG) diff --git a/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-c-s3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-c-s3/config.yml b/recipes/aws-c-s3/config.yml index 9a2f6a3845f5c..cefba29c997dd 100644 --- a/recipes/aws-c-s3/config.yml +++ b/recipes/aws-c-s3/config.yml @@ -1,9 +1,7 @@ versions: - "0.1.49": + "0.7.11": folder: all - "0.1.37": + "0.5.5": folder: all - "0.1.29": - folder: all - "0.1.27": + "0.1.26": folder: all diff --git a/recipes/aws-c-sdkutils/all/conandata.yml b/recipes/aws-c-sdkutils/all/conandata.yml index 4f2cc09884562..a80f1a1694cad 100644 --- a/recipes/aws-c-sdkutils/all/conandata.yml +++ b/recipes/aws-c-sdkutils/all/conandata.yml @@ -1,13 +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" - "0.1.2": - url: "https://github.com/awslabs/aws-c-sdkutils/archive/refs/tags/v0.1.2.tar.gz" - sha256: "d654670c145212ed3ce0699a988b9f83ebf3e7c44ed74d4d0772dc95ad46b38e" - "0.1.1": - url: "https://github.com/awslabs/aws-c-sdkutils/archive/refs/tags/v0.1.1.tar.gz" - sha256: "201a5f694c912c952f50abab54fa0e576db75ddf6e8710c589896038ff9673f7" + "0.2.3": + url: "https://github.com/awslabs/aws-c-sdkutils/archive/v0.2.3.tar.gz" + sha256: "5a0489d508341b84eea556e351717bc33524d3dfd6207ee3aba6068994ea6018" + "0.1.15": + url: "https://github.com/awslabs/aws-c-sdkutils/archive/v0.1.15.tar.gz" + sha256: "15fa30b8b0a357128388f2f40ab0ba3df63742fd333cc2f89cb91a9169f03bdc" diff --git a/recipes/aws-c-sdkutils/all/conanfile.py b/recipes/aws-c-sdkutils/all/conanfile.py index e2bfcefef6878..06e94d3664ffc 100644 --- a/recipes/aws-c-sdkutils/all/conanfile.py +++ b/recipes/aws-c-sdkutils/all/conanfile.py @@ -1,11 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, save +from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class AwsCSDKUtils(ConanFile): @@ -26,30 +25,25 @@ class AwsCSDKUtils(ConanFile): "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") + implements = ["auto_shared_fpic"] + languages = "C" def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - 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) + if self.version == "0.2.3": + self.requires("aws-c-common/0.11.0", transitive_headers=True, transitive_libs=True) + elif self.version == "0.1.15": + self.requires("aws-c-common/0.9.15", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) + if Version(self.version) < "0.2.3": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) @@ -65,27 +59,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-c-sdkutils")) - - # 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-sdkutils": "aws-c-sdkutils::aws-c-sdkutils"} - ) - - 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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-c-sdkutils") @@ -93,7 +67,3 @@ def package_info(self): self.cpp_info.libs = ["aws-c-sdkutils"] if self.options.shared: self.cpp_info.defines.append("AWS_SDKUTILS_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-sdkutils/all/test_package/CMakeLists.txt b/recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt index 4b5efc665c153..fc44f962fd196 100644 --- a/recipes/aws-c-sdkutils/all/test_package/CMakeLists.txt +++ b/recipes/aws-c-sdkutils/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(aws-c-sdkutils REQUIRED CONFIG) diff --git a/recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt b/recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-c-sdkutils/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-c-sdkutils/all/test_v1_package/conanfile.py b/recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/aws-c-sdkutils/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/aws-c-sdkutils/config.yml b/recipes/aws-c-sdkutils/config.yml index c2aa05a42982f..a1bc230ff12f9 100644 --- a/recipes/aws-c-sdkutils/config.yml +++ b/recipes/aws-c-sdkutils/config.yml @@ -1,9 +1,5 @@ versions: - "0.1.12": + "0.2.3": folder: all - "0.1.3": - folder: all - "0.1.2": - folder: all - "0.1.1": + "0.1.15": folder: all diff --git a/recipes/aws-cdi-sdk/all/test_package/CMakeLists.txt b/recipes/aws-cdi-sdk/all/test_package/CMakeLists.txt index d207864c9df26..bc30cc9d7180f 100644 --- a/recipes/aws-cdi-sdk/all/test_package/CMakeLists.txt +++ b/recipes/aws-cdi-sdk/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") diff --git a/recipes/aws-checksums/all/conandata.yml b/recipes/aws-checksums/all/conandata.yml index 989708680b889..af856dda15d0e 100644 --- a/recipes/aws-checksums/all/conandata.yml +++ b/recipes/aws-checksums/all/conandata.yml @@ -1,27 +1,10 @@ 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" + "0.2.3": + url: "https://github.com/awslabs/aws-checksums/archive/v0.2.3.tar.gz" + sha256: "c688f311db8a1b70bb6d22f6e8f2817b39e1419546e339cf753d61340969eeb4" + "0.1.18": + url: "https://github.com/awslabs/aws-checksums/archive/v0.1.18.tar.gz" + sha256: "bdba9d0a8b8330a89c6b8cbc00b9aa14f403d3449b37ff2e0d96d62a7301b2ee" "0.1.12": url: "https://github.com/awslabs/aws-checksums/archive/v0.1.12.tar.gz" sha256: "394723034b81cc7cd528401775bc7aca2b12c7471c92350c80a0e2fb9d2909fe" - "0.1.11": - url: "https://github.com/awslabs/aws-checksums/archive/v0.1.11.tar.gz" - sha256: "9312e305428655bcea1f81524c3a8f617ce5299b903187047078929e850fb6d4" - "0.1.5": - url: "https://github.com/awslabs/aws-checksums/archive/v0.1.5.tar.gz" - sha256: "6e6bed6f75cf54006b6bafb01b3b96df19605572131a2260fddaf0e87949ced0" -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 e2711f6d5488f..506e6cc9bbb89 100644 --- a/recipes/aws-checksums/all/conanfile.py +++ b/recipes/aws-checksums/all/conanfile.py @@ -1,11 +1,10 @@ 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.files import copy, get, rmdir from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class AwsChecksums(ConanFile): @@ -29,27 +28,19 @@ class AwsChecksums(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: - self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") + implements = ["auto_shared_fpic"] + languages = "C" def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) < "0.1.17": - self.requires("aws-c-common/0.8.2") - else: - self.requires("aws-c-common/0.9.6", transitive_headers=True) + if self.version == "0.2.3": + self.requires("aws-c-common/0.11.0", transitive_headers=True) + if self.version == "0.1.18": + self.requires("aws-c-common/0.9.15", transitive_headers=True) + if self.version == "0.1.12": + self.requires("aws-c-common/0.6.11", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -57,12 +48,13 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "0.2.3": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -72,27 +64,7 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "aws-checksums")) - - # 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-checksums": "aws-checksums::aws-checksums"} - ) - - 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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-checksums") @@ -100,7 +72,3 @@ def package_info(self): self.cpp_info.libs = ["aws-checksums"] if self.options.shared: self.cpp_info.defines.append("AWS_CHECKSUMS_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-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.patch b/recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.patch deleted file mode 100644 index 9a309a9f74658..0000000000000 --- a/recipes/aws-checksums/all/patches/0001-use-PROJECT_SOURCE_DIR.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -98,7 +98,7 @@ - target_compile_definitions(aws-checksums PRIVATE "-DDEBUG_BUILD") - endif() - --target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC -+target_include_directories(${PROJECT_NAME} PUBLIC - $ - $) - -@@ -129,7 +129,7 @@ - endif() - - install(FILES ${AWS_CHECKSUMS_HEADERS} DESTINATION "include/aws/checksums") --aws_prepare_shared_lib_exports(${CMAKE_PROJECT_NAME}) -+aws_prepare_shared_lib_exports(${PROJECT_NAME}) - - if (BUILD_SHARED_LIBS) - set (TARGET_DIR "shared") -@@ -137,14 +137,14 @@ - set (TARGET_DIR "static") - endif() - --install(EXPORT "${CMAKE_PROJECT_NAME}-targets" -- DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/${TARGET_DIR}/" -+install(EXPORT "${PROJECT_NAME}-targets" -+ DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/${TARGET_DIR}/" - NAMESPACE AWS::) - --configure_file("cmake/${CMAKE_PROJECT_NAME}-config.cmake" -- "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" -+configure_file("cmake/${PROJECT_NAME}-config.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" - @ONLY) - --install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake" -- DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/") -+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" -+ DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/") - diff --git a/recipes/aws-checksums/all/patches/0002-disable-overriding-fPIC.patch b/recipes/aws-checksums/all/patches/0002-disable-overriding-fPIC.patch deleted file mode 100644 index 31249bcf0671b..0000000000000 --- a/recipes/aws-checksums/all/patches/0002-disable-overriding-fPIC.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -83,9 +83,9 @@ - target_compile_definitions(aws-checksums PRIVATE "-DAWS_CHECKSUMS_EXPORTS") - endif() - --if(NOT MSVC) -- target_compile_options(aws-checksums PRIVATE -fPIC) --endif() -+#if(NOT MSVC) -+# target_compile_options(aws-checksums PRIVATE -fPIC) -+#endif() - - if(BUILD_JNI_BINDINGS) - find_package(JNI) diff --git a/recipes/aws-checksums/all/patches/0003-disable-building-tests.patch b/recipes/aws-checksums/all/patches/0003-disable-building-tests.patch deleted file mode 100644 index f62f7e4733e64..0000000000000 --- a/recipes/aws-checksums/all/patches/0003-disable-building-tests.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -109,7 +109,7 @@ - file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC}) - - include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tests) --add_executable(aws-checksums-tests ${TESTS}) -+add_executable(aws-checksums-tests EXCLUDE_FROM_ALL ${TESTS}) - target_compile_options(aws-checksums-tests PRIVATE ${_FLAGS}) - target_link_libraries(aws-checksums-tests aws-checksums) - set_target_properties(aws-checksums-tests PROPERTIES LINKER_LANGUAGE C) diff --git a/recipes/aws-checksums/all/test_package/CMakeLists.txt b/recipes/aws-checksums/all/test_package/CMakeLists.txt index 9922744f24e3f..6599cd8daf722 100644 --- a/recipes/aws-checksums/all/test_package/CMakeLists.txt +++ b/recipes/aws-checksums/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(aws-checksums REQUIRED CONFIG) diff --git a/recipes/aws-checksums/all/test_package/test_package.c b/recipes/aws-checksums/all/test_package/test_package.c index 773c9b3e1f5b7..a1e05db27b7a8 100644 --- a/recipes/aws-checksums/all/test_package/test_package.c +++ b/recipes/aws-checksums/all/test_package/test_package.c @@ -6,7 +6,7 @@ #define LOG_LEVEL AWS_LOG_LEVEL_TRACE -static int fill(uint8_t *buffer, size_t size) { +static void fill(uint8_t *buffer, size_t size) { size_t i; for(i = 0; i < size; ++i) { buffer[i] = i; diff --git a/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt b/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-checksums/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-checksums/all/test_v1_package/conanfile.py b/recipes/aws-checksums/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/aws-checksums/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_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/aws-checksums/config.yml b/recipes/aws-checksums/config.yml index efe23bdebe7e1..4b1370bd07741 100644 --- a/recipes/aws-checksums/config.yml +++ b/recipes/aws-checksums/config.yml @@ -1,11 +1,7 @@ versions: - "0.1.17": + "0.2.3": folder: all - "0.1.13": + "0.1.18": folder: all "0.1.12": folder: all - "0.1.11": - folder: all - "0.1.5": - folder: all diff --git a/recipes/aws-crt-cpp/all/conandata.yml b/recipes/aws-crt-cpp/all/conandata.yml index 5615e65f10a0b..430f624694892 100644 --- a/recipes/aws-crt-cpp/all/conandata.yml +++ b/recipes/aws-crt-cpp/all/conandata.yml @@ -1,26 +1,16 @@ sources: - "0.18.8": - url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.18.8.tar.gz" - sha256: "70ea622cf8c1a7028b24078e909ee5898990444436584178f58d61b50b5b197d" - "0.17.23": - url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.17.23.tar.gz" - sha256: "28061c3efa493519cfae46e4ea96389f03a81eeec7613d7da861dd8c5f4f6598" - "0.17.12": - url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.17.12.tar.gz" - sha256: "acdd8b83198c5a471f92702bc4101828fe55361005764143704c39acd6f80ffc" - "0.14.3": - url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.14.3.tar.gz" - sha256: "3ea16c43e691bab0c373ba1ad072f6535390c516ebda658dfaf4d074d920e0fb" + "0.31.0": + url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.31.0.tar.gz" + sha256: "4e920a5da67f77a4e2cbceb0f8d3a279f57888cde0abeae19b58bc8374d1cb3d" + "0.26.9": + url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.26.9.tar.gz" + sha256: "5b5760d34fbbfcc971f561296e828de4c788750472fd9bd3ac20068a083620f2" + "0.17.1a": + url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.17.1a.tar.gz" + sha256: "64053c8237e350cfbec24984a3696aaf914bfa64e6200ef19bebe9cf5bb0692b" patches: - "0.18.8": - - patch_file: "patches/0.17.23-fix-cast-error.patch" - patch_description: "fix const cast error" - patch_type: "portability" - "0.17.23": - - patch_file: "patches/0.17.23-fix-cast-error.patch" - patch_description: "fix const cast error" - patch_type: "portability" - "0.17.12": - - patch_file: "patches/0.17.12-fix-cast-error.patch" - patch_description: "fix const cast error" - patch_type: "portability" + "0.17.1a": + - patch_file: "patches/0.17.23-fix-cpp20-windows.patch" + patch_description: "Fixes cpp 20 builds for windows." + patch_type: "bugfix" + patch_source: "https://github.com/awslabs/aws-crt-cpp/pull/364" diff --git a/recipes/aws-crt-cpp/all/conanfile.py b/recipes/aws-crt-cpp/all/conanfile.py index 97c0f616bb653..3ec6996849cb4 100644 --- a/recipes/aws-crt-cpp/all/conanfile.py +++ b/recipes/aws-crt-cpp/all/conanfile.py @@ -1,19 +1,18 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, save +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.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout - +from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2" class AwsCrtCpp(ConanFile): name = "aws-crt-cpp" description = "C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++." - license = "Apache-2.0", + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/awslabs/aws-crt-cpp" topics = ("aws", "amazon", "cloud", "wrapper") @@ -28,54 +27,67 @@ class AwsCrtCpp(ConanFile): "fPIC": True, } - @property - def _min_cppstd(self): - return "11" + implements = ["auto_shared_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): - if self.options.shared: - self.options.rm_safe("fPIC") - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - 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-auth/0.6.11", transitive_headers=True) + if self.version == "0.31.0": + self.requires("aws-c-common/0.11.0") + self.requires("aws-c-sdkutils/0.2.3") + self.requires("aws-c-io/0.15.4", transitive_headers=True) + self.requires("aws-c-cal/0.8.3") + self.requires("aws-c-compression/0.3.1") + self.requires("aws-c-http/0.9.3", transitive_headers=True) + self.requires("aws-c-auth/0.8.4", transitive_headers=True) + self.requires("aws-c-mqtt/0.12.1", transitive_headers=True) + self.requires("aws-checksums/0.2.3") + self.requires("aws-c-event-stream/0.5.1") + self.requires("aws-c-s3/0.7.11") + elif self.version == "0.26.9": + # From add_subdirectory() calls in https://github.com/awslabs/aws-crt-cpp/blob/v0.26.9/CMakeLists.txt + self.requires("aws-c-common/0.9.15") + self.requires("aws-c-sdkutils/0.1.15") + self.requires("aws-c-io/0.14.7", transitive_headers=True) + self.requires("aws-c-cal/0.6.14") + self.requires("aws-c-compression/0.2.18") + self.requires("aws-c-http/0.8.1", transitive_headers=True) + self.requires("aws-c-auth/0.7.16", transitive_headers=True) + self.requires("aws-c-mqtt/0.10.3", transitive_headers=True) + self.requires("aws-checksums/0.1.18") + self.requires("aws-c-event-stream/0.4.2") + self.requires("aws-c-s3/0.5.5") + elif self.version == "0.17.1a": + # From add_subdirectory() calls in https://github.com/awslabs/aws-crt-cpp/blob/v0.17.1a/CMakeLists.txt#L95 + self.requires("aws-c-http/0.6.7", transitive_headers=True) + self.requires("aws-c-mqtt/0.7.8", transitive_headers=True) + self.requires("aws-c-cal/0.5.12") + self.requires("aws-c-compression/0.2.14") + self.requires("aws-c-auth/0.6.4", transitive_headers=True) + self.requires("aws-c-common/0.6.11") + self.requires("aws-c-io/0.10.9", transitive_headers=True) + self.requires("aws-checksums/0.1.12") 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-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") + self.requires("aws-c-s3/0.1.26") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_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) + if is_msvc(self): + tc.variables["AWS_STATIC_MSVC_RUNTIME_LIBRARY"] = is_msvc_static_runtime(self) tc.variables["BUILD_TESTING"] = False - tc.variables["BUILD_DEPS"] = False + tc.cache_variables["BUILD_DEPS"] = False + if Version(self.version) < "0.31.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) @@ -92,27 +104,7 @@ def package(self): cmake = CMake(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") + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "aws-crt-cpp") @@ -120,7 +112,3 @@ def package_info(self): 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.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-crt-cpp/all/patches/0.17.12-fix-cast-error.patch b/recipes/aws-crt-cpp/all/patches/0.17.12-fix-cast-error.patch deleted file mode 100644 index be886c030a52c..0000000000000 --- a/recipes/aws-crt-cpp/all/patches/0.17.12-fix-cast-error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/source/io/TlsOptions.cpp b/source/io/TlsOptions.cpp -index 9f9f8cf..e9913ef 100644 ---- a/source/io/TlsOptions.cpp -+++ b/source/io/TlsOptions.cpp -@@ -216,7 +216,7 @@ namespace Aws - - if (m_slotId) - { -- options.slot_id = &(*m_slotId); -+ options.slot_id = const_cast(&(*m_slotId)); - } - - if (m_userPin) diff --git a/recipes/aws-crt-cpp/all/patches/0.17.23-fix-cast-error.patch b/recipes/aws-crt-cpp/all/patches/0.17.23-fix-cast-error.patch deleted file mode 100644 index 676d3a87fbac2..0000000000000 --- a/recipes/aws-crt-cpp/all/patches/0.17.23-fix-cast-error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/source/io/TlsOptions.cpp b/source/io/TlsOptions.cpp -index 3018e4c..eb5e129 100644 ---- a/source/io/TlsOptions.cpp -+++ b/source/io/TlsOptions.cpp -@@ -213,7 +213,7 @@ namespace Aws - - if (m_slotId) - { -- options.slot_id = &(*m_slotId); -+ options.slot_id = const_cast(&(*m_slotId)); - } - - if (m_userPin) diff --git a/recipes/aws-crt-cpp/all/patches/0.17.23-fix-cpp20-windows.patch b/recipes/aws-crt-cpp/all/patches/0.17.23-fix-cpp20-windows.patch new file mode 100644 index 0000000000000..9f32e19e32b8b --- /dev/null +++ b/recipes/aws-crt-cpp/all/patches/0.17.23-fix-cpp20-windows.patch @@ -0,0 +1,28 @@ +From 3216ce53fa7f276ae4407a450cafafa9e809fea1 Mon Sep 17 00:00:00 2001 +From: Sam Bisciglia +Date: Tue, 12 Apr 2022 14:42:26 -0400 +Subject: [PATCH] Fixes cpp 20 builds for windows. (#364) + +--- +diff --git a/include/aws/crt/StringView.h b/include/aws/crt/StringView.h +index a0fec83..dc2f05b 100644 +--- a/include/aws/crt/StringView.h ++++ b/include/aws/crt/StringView.h +@@ -15,7 +15,7 @@ + #include + #include + +-#if __cplusplus >= 201703L || (defined(_MSC_LANG) && _MSC_LANG >= 201703L) ++#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) + # include + #endif + +@@ -53,7 +53,7 @@ namespace Aws + + basic_string_view &operator=(const basic_string_view &) noexcept = default; + +-#if __cplusplus >= 201703L || (defined(_MSC_LANG) && _MSC_LANG >= 201703L) ++#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) + constexpr basic_string_view(const std::basic_string_view &other) noexcept + : m_size(other.size()), m_data(other.data()) + { diff --git a/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt b/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt index 50b34b056a787..bb5ba9e89ee42 100644 --- a/recipes/aws-crt-cpp/all/test_package/CMakeLists.txt +++ b/recipes/aws-crt-cpp/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(aws-crt-cpp REQUIRED CONFIG) diff --git a/recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt b/recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-crt-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-crt-cpp/all/test_v1_package/conanfile.py b/recipes/aws-crt-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/aws-crt-cpp/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", "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/aws-crt-cpp/config.yml b/recipes/aws-crt-cpp/config.yml index a2a8f6922a602..6d838f5d35c1d 100644 --- a/recipes/aws-crt-cpp/config.yml +++ b/recipes/aws-crt-cpp/config.yml @@ -1,9 +1,7 @@ versions: - "0.18.8": + "0.31.0": folder: all - "0.17.23": + "0.26.9": folder: all - "0.17.12": - folder: all - "0.14.3": + "0.17.1a": folder: all diff --git a/recipes/aws-kvs-pic/all/conandata.yml b/recipes/aws-kvs-pic/all/conandata.yml index 4be3843841ab1..5e5052a1a9680 100644 --- a/recipes/aws-kvs-pic/all/conandata.yml +++ b/recipes/aws-kvs-pic/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/awslabs/amazon-kinesis-video-streams-pic/archive/refs/tags/v1.1.0.tar.gz" + sha256: "ef45723cd439f855bae2304d9488b68cd6d1e0dc3203c97ebd1cbb26197edb55" "1.0.1": url: "https://github.com/awslabs/amazon-kinesis-video-streams-pic/archive/refs/tags/v1.0.1.tar.gz" sha256: "d04732217c74687c5498665b353cb089d725ca7f5b5da61a3f984f7fbefb2ac9" diff --git a/recipes/aws-kvs-pic/all/conanfile.py b/recipes/aws-kvs-pic/all/conanfile.py index a0653e082edea..e8a1073232807 100644 --- a/recipes/aws-kvs-pic/all/conanfile.py +++ b/recipes/aws-kvs-pic/all/conanfile.py @@ -4,6 +4,7 @@ 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 +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -72,6 +73,10 @@ def package_info(self): 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"] + + if Version(self.version) >= "1.1.0": + if self.settings.build_type == "Debug": + self.cpp_info.components["kvspic"].defines = ["DEBUG_BUILD"] self.cpp_info.components["kvspicClient"].libs = ["kvspicClient"] self.cpp_info.components["kvspicClient"].set_property("pkg_config_name", "libkvspicClient") diff --git a/recipes/aws-kvs-pic/all/test_v1_package/CMakeLists.txt b/recipes/aws-kvs-pic/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/aws-kvs-pic/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index cba2c258bb2b4..0000000000000 --- a/recipes/aws-kvs-pic/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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 42adf0e62a4df..f7630e1054b00 100644 --- a/recipes/aws-kvs-pic/config.yml +++ b/recipes/aws-kvs-pic/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "1.0.1": folder: all "cci.20210812": diff --git a/recipes/aws-lambda-cpp/all/conanfile.py b/recipes/aws-lambda-cpp/all/conanfile.py index 0b0de62c879d3..849efb9333447 100644 --- a/recipes/aws-lambda-cpp/all/conanfile.py +++ b/recipes/aws-lambda-cpp/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.errors import ConanInvalidConfiguration, ConanException +from conan.tools.files import get, copy, rmdir, load, save, rename from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.scm import Version @@ -72,16 +72,29 @@ def build(self): cmake.configure() cmake.build() + def _extract_cmake_module(self): + cmake_module = load(self, os.path.join(self.source_folder, "cmake", "aws-lambda-runtime-config.cmake")) + start = "set(AWS_LAMBDA_PACKAGING_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/packager)" + start_index = cmake_module.find(start) + if start_index == -1: + raise ConanException("Could not extract aws_lambda_package_target from aws-lambda-runtime-config.cmake file.") + return cmake_module[start_index:] + def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() + + save(self, os.path.join(self.package_folder, "lib", "cmake", "aws_lambda_package_target.cmake"), self._extract_cmake_module()) + rename(self, os.path.join(self.package_folder, "lib", "aws-lambda-runtime", "cmake", "packager"), os.path.join(self.package_folder, "lib", "cmake", "packager")) 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.builddirs.append(os.path.join("lib", "cmake")) 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.set_property("cmake_build_modules", [os.path.join("lib", "cmake", "aws_lambda_package_target.cmake")]) 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 index 073c5e204a51e..1821ed75da1ec 100644 --- a/recipes/aws-lambda-cpp/all/test_package/CMakeLists.txt +++ b/recipes/aws-lambda-cpp/all/test_package/CMakeLists.txt @@ -6,3 +6,7 @@ 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) + +if(NOT COMMAND aws_lambda_package_target) + message(FATAL_ERROR "aws_lambda_package_target should have been defined as part of find_package(aws-lambda-runtime)") +endif() diff --git a/recipes/aws-libfabric/all/test_v1_package/CMakeLists.txt b/recipes/aws-libfabric/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/aws-libfabric/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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-libfabric/all/test_v1_package/conanfile.py b/recipes/aws-libfabric/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/aws-libfabric/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", "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/aws-sdk-cpp/all/conandata.yml b/recipes/aws-sdk-cpp/all/conandata.yml index 5818aef791db0..36f76d76bbf97 100644 --- a/recipes/aws-sdk-cpp/all/conandata.yml +++ b/recipes/aws-sdk-cpp/all/conandata.yml @@ -1,28 +1,19 @@ sources: + "1.11.352": + url: "https://github.com/aws/aws-sdk-cpp/archive/1.11.352.tar.gz" + sha256: "999583df108a5363ff33563f86ea23a528761ebea3577348867932ba7eeacae2" "1.9.234": url: "https://github.com/aws/aws-sdk-cpp/archive/1.9.234.tar.gz" sha256: "52e36cf568fe0b2a0fc82a9333c0b31ba843db16670f4ccbb7b9fd142f1b00a5" - "1.9.100": - url: "https://github.com/aws/aws-sdk-cpp/archive/1.9.100.tar.gz" - sha256: "f0930d14ec92b9ddf1e3c966d9a3fe70d2a01b80e79e3e76da78d108bb81e5c4" - "1.8.130": - url: "https://github.com/aws/aws-sdk-cpp/archive/1.8.130.tar.gz" - sha256: "5dd09baa28d3f6f4fb03fbba1a4269724d79bcca3d47752cd3e15caf97276bda" patches: + "1.11.352": + - patch_file: patches/1.11.352-0001-pulseaudio.patch + patch_description: Use pulseaudio from conan + patch_type: conan + - patch_file: patches/1.11.352-0002-disable-sort-links.patch + - patch_file: patches/1.9.100-0002-aws-plugin-conf.patch "1.9.234": - 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": - - 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": - - 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 678d3e32eb8c9..7f75a7b8cbd80 100644 --- a/recipes/aws-sdk-cpp/all/conanfile.py +++ b/recipes/aws-sdk-cpp/all/conanfile.py @@ -20,274 +20,408 @@ class AwsSdkCppConan(ConanFile): topics = ("aws", "cpp", "cross-platform", "amazon", "cloud") package_type = "library" settings = "os", "arch", "compiler", "build_type" + # This list comes from tools/code-generation/api-description, which then generates the sdk sources + # To generate for a new one, run the build once and check src/generated/src inside your build_folder, remove the common aws-sdk-cpp prefix + # and that's the list of sdks. The join it to the below one _sdks = ( - "access-management", - "accessanalyzer", - "acm", - "acm-pca", - "alexaforbusiness", - "amp", - "amplify", - "amplifybackend", - "apigateway", - "apigatewaymanagementapi", - "apigatewayv2", - "appconfig", - "appflow", - "appintegrations", - "application-autoscaling", - "application-insights", - "appmesh", - "appstream", - "appsync", - "athena", - "auditmanager", - "autoscaling", - "autoscaling-plans", - "awstransfer", - "backup", - "batch", - "braket", - "budgets", - "ce", - "chime", - "cloud9", - "clouddirectory", - "cloudformation", - "cloudfront", - "cloudhsm", - "cloudhsmv2", - "cloudsearch", - "cloudsearchdomain", - "cloudtrail", - "codeartifact", - "codebuild", - "codecommit", - "codedeploy", - "codeguru-reviewer", - "codeguruprofiler", - "codepipeline", - "codestar", - "codestar-connections", - "codestar-notifications", - "cognito-identity", - "cognito-idp", - "cognito-sync", - "comprehend", - "comprehendmedical", - "compute-optimizer", - "config", - "connect", - "connect-contact-lens", - "connectparticipant", - "cur", - "customer-profiles", - "databrew", - "dataexchange", - "datapipeline", - "datasync", - "dax", - "detective", - "devicefarm", - "devops-guru", - "directconnect", - "discovery", - "dlm", - "dms", - "docdb", - "ds", - "dynamodb", - "dynamodbstreams", - "ebs", - "ec2", - "ec2-instance-connect", - "ecr", - "ecr-public", - "ecs", - "eks", - "elastic-inference", - "elasticache", - "elasticbeanstalk", - "elasticfilesystem", - "elasticloadbalancing", - "elasticloadbalancingv2", - "elasticmapreduce", - "elastictranscoder", - "email", - "emr-containers", - "es", - "eventbridge", - "events", - "firehose", - "fms", - "forecast", - "forecastquery", - "frauddetector", - "fsx", - "gamelift", - "glacier", - "globalaccelerator", - "glue", - "greengrass", - "greengrassv2", - "groundstation", - "guardduty", - "health", - "healthlake", - "honeycode", - "iam", - "identity-management", - "identitystore", - "imagebuilder", - "importexport", - "inspector", - "iot", - "iot-data", - "iot-jobs-data", - "iot1click-devices", - "iot1click-projects", - "iotanalytics", - "iotdeviceadvisor", - "iotevents", - "iotevents-data", - "iotfleethub", - "iotsecuretunneling", - "iotsitewise", - "iotthingsgraph", - "iotwireless", - "ivs", - "kafka", - "kendra", - "kinesis", - "kinesis-video-archived-media", - "kinesis-video-media", - "kinesis-video-signaling", - "kinesisanalytics", - "kinesisanalyticsv2", - "kinesisvideo", - "kms", - "lakeformation", - "lambda", - "lex", - "lex-models", - "lexv2-models", - "lexv2-runtime", - "license-manager", - "lightsail", - "location", - "logs", - "lookoutvision", - "machinelearning", - "macie", - "macie2", - "managedblockchain", - "marketplace-catalog", - "marketplace-entitlement", - "marketplacecommerceanalytics", - "mediaconnect", - "mediaconvert", - "medialive", - "mediapackage", - "mediapackage-vod", - "mediastore", - "mediastore-data", - "mediatailor", - "meteringmarketplace", - "migrationhub-config", - "mobile", - "mobileanalytics", - "monitoring", - "mq", - "mturk-requester", - "mwaa", - "neptune", - "network-firewall", - "networkmanager", - "opsworks", - "opsworkscm", - "organizations", - "outposts", - "personalize", - "personalize-events", - "personalize-runtime", - "pi", - "pinpoint", - "pinpoint-email", - "polly", - "polly-sample", - "pricing", - "qldb", - "qldb-session", - "queues", - "quicksight", - "ram", - "rds", - "rds-data", - "redshift", - "redshift-data", - "rekognition", - "resource-groups", - "resourcegroupstaggingapi", - "robomaker", - "route53", - "route53domains", - "route53resolver", - "s3", - "s3-crt", - "s3-encryption", - "s3control", - "s3outposts", - "sagemaker", - "sagemaker-a2i-runtime", - "sagemaker-edge", - "sagemaker-featurestore-runtime", - "sagemaker-runtime", - "savingsplans", - "schemas", - "sdb", - "secretsmanager", - "securityhub", - "serverlessrepo", - "service-quotas", - "servicecatalog", - "servicecatalog-appregistry", - "servicediscovery", - "sesv2", - "shield", - "signer", - "sms", - "sms-voice", - "snowball", - "sns", - "sqs", - "ssm", - "sso", - "sso-admin", - "sso-oidc", - "states", - "storagegateway", - "sts", - "support", - "swf", - "synthetics", - "text-to-speech", - "textract", - "timestream-query", - "timestream-write", - "transcribe", - "transcribestreaming", - "transfer", - "translate", - "waf", - "waf-regional", - "wafv2", - "wellarchitected", - "workdocs", - "worklink", - "workmail", - "workmailmessageflow", - "workspaces", - "xray", + ('AWSMigrationHub', ['1.11.352']), + ('access-management', ['1.9.234', '1.11.352']), + ('accessanalyzer', ['1.9.234', '1.11.352']), + ('account', ['1.11.352']), + ('acm', ['1.9.234', '1.11.352']), + ('acm-pca', ['1.9.234', '1.11.352']), + ('alexaforbusiness', ['1.9.234']), + ('amp', ['1.9.234', '1.11.352']), + ('amplify', ['1.9.234', '1.11.352']), + ('amplifybackend', ['1.9.234', '1.11.352']), + ('amplifyuibuilder', ['1.11.352']), + ('apigateway', ['1.9.234', '1.11.352']), + ('apigatewaymanagementapi', ['1.9.234', '1.11.352']), + ('apigatewayv2', ['1.9.234', '1.11.352']), + ('appconfig', ['1.9.234', '1.11.352']), + ('appconfigdata', ['1.11.352']), + ('appfabric', ['1.11.352']), + ('appflow', ['1.9.234', '1.11.352']), + ('appintegrations', ['1.9.234', '1.11.352']), + ('application-autoscaling', ['1.9.234', '1.11.352']), + ('application-insights', ['1.9.234', '1.11.352']), + ('application-signals', ['1.11.352']), + ('applicationcostprofiler', ['1.11.352']), + ('appmesh', ['1.9.234', '1.11.352']), + ('apprunner', ['1.11.352']), + ('appstream', ['1.9.234', '1.11.352']), + ('appsync', ['1.9.234', '1.11.352']), + ('apptest', ['1.11.352']), + ('arc-zonal-shift', ['1.11.352']), + ('artifact', ['1.11.352']), + ('athena', ['1.9.234', '1.11.352']), + ('auditmanager', ['1.9.234', '1.11.352']), + ('autoscaling', ['1.9.234', '1.11.352']), + ('autoscaling-plans', ['1.9.234', '1.11.352']), + ('awstransfer', ['1.9.234', '1.11.352']), + ('b2bi', ['1.11.352']), + ('backup', ['1.9.234', '1.11.352']), + ('backup-gateway', ['1.11.352']), + ('batch', ['1.9.234', '1.11.352']), + ('bcm-data-exports', ['1.11.352']), + ('bedrock', ['1.11.352']), + ('bedrock-agent', ['1.11.352']), + ('bedrock-agent-runtime', ['1.11.352']), + ('bedrock-runtime', ['1.11.352']), + ('billingconductor', ['1.11.352']), + ('braket', ['1.9.234', '1.11.352']), + ('budgets', ['1.9.234', '1.11.352']), + ('ce', ['1.9.234', '1.11.352']), + ('chatbot', ['1.11.352']), + ('chime', ['1.9.234', '1.11.352']), + ('chime-sdk-identity', ['1.11.352']), + ('chime-sdk-media-pipelines', ['1.11.352']), + ('chime-sdk-meetings', ['1.11.352']), + ('chime-sdk-messaging', ['1.11.352']), + ('chime-sdk-voice', ['1.11.352']), + ('cleanrooms', ['1.11.352']), + ('cleanroomsml', ['1.11.352']), + ('cloud9', ['1.9.234', '1.11.352']), + ('cloudcontrol', ['1.11.352']), + ('clouddirectory', ['1.9.234', '1.11.352']), + ('cloudformation', ['1.9.234', '1.11.352']), + ('cloudfront', ['1.9.234', '1.11.352']), + ('cloudfront-keyvaluestore', ['1.11.352']), + ('cloudhsm', ['1.9.234', '1.11.352']), + ('cloudhsmv2', ['1.9.234', '1.11.352']), + ('cloudsearch', ['1.9.234', '1.11.352']), + ('cloudsearchdomain', ['1.9.234', '1.11.352']), + ('cloudtrail', ['1.9.234', '1.11.352']), + ('cloudtrail-data', ['1.11.352']), + ('codeartifact', ['1.9.234', '1.11.352']), + ('codebuild', ['1.9.234', '1.11.352']), + ('codecatalyst', ['1.11.352']), + ('codecommit', ['1.9.234', '1.11.352']), + ('codeconnections', ['1.11.352']), + ('codedeploy', ['1.9.234', '1.11.352']), + ('codeguru-reviewer', ['1.9.234', '1.11.352']), + ('codeguru-security', ['1.11.352']), + ('codeguruprofiler', ['1.9.234', '1.11.352']), + ('codepipeline', ['1.9.234', '1.11.352']), + ('codestar', ['1.9.234', '1.11.352']), + ('codestar-connections', ['1.9.234', '1.11.352']), + ('codestar-notifications', ['1.9.234', '1.11.352']), + ('cognito-identity', ['1.9.234', '1.11.352']), + ('cognito-idp', ['1.9.234', '1.11.352']), + ('cognito-sync', ['1.9.234', '1.11.352']), + ('comprehend', ['1.9.234', '1.11.352']), + ('comprehendmedical', ['1.9.234', '1.11.352']), + ('compute-optimizer', ['1.9.234', '1.11.352']), + ('config', ['1.9.234', '1.11.352']), + ('connect', ['1.9.234', '1.11.352']), + ('connect-contact-lens', ['1.9.234', '1.11.352']), + ('connectcampaigns', ['1.11.352']), + ('connectcases', ['1.11.352']), + ('connectparticipant', ['1.9.234', '1.11.352']), + ('controlcatalog', ['1.11.352']), + ('controltower', ['1.11.352']), + ('cost-optimization-hub', ['1.11.352']), + ('cur', ['1.9.234', '1.11.352']), + ('customer-profiles', ['1.9.234', '1.11.352']), + ('databrew', ['1.9.234', '1.11.352']), + ('dataexchange', ['1.9.234', '1.11.352']), + ('datapipeline', ['1.9.234', '1.11.352']), + ('datasync', ['1.9.234', '1.11.352']), + ('datazone', ['1.11.352']), + ('dax', ['1.9.234', '1.11.352']), + ('deadline', ['1.11.352']), + ('detective', ['1.9.234', '1.11.352']), + ('devicefarm', ['1.9.234', '1.11.352']), + ('devops-guru', ['1.9.234', '1.11.352']), + ('directconnect', ['1.9.234', '1.11.352']), + ('discovery', ['1.9.234', '1.11.352']), + ('dlm', ['1.9.234', '1.11.352']), + ('dms', ['1.9.234', '1.11.352']), + ('docdb', ['1.9.234', '1.11.352']), + ('docdb-elastic', ['1.11.352']), + ('drs', ['1.11.352']), + ('ds', ['1.9.234', '1.11.352']), + ('dynamodb', ['1.9.234', '1.11.352']), + ('dynamodbstreams', ['1.9.234', '1.11.352']), + ('ebs', ['1.9.234', '1.11.352']), + ('ec2', ['1.9.234', '1.11.352']), + ('ec2-instance-connect', ['1.9.234', '1.11.352']), + ('ecr', ['1.9.234', '1.11.352']), + ('ecr-public', ['1.9.234', '1.11.352']), + ('ecs', ['1.9.234', '1.11.352']), + ('eks', ['1.9.234', '1.11.352']), + ('eks-auth', ['1.11.352']), + ('elastic-inference', ['1.9.234', '1.11.352']), + ('elasticache', ['1.9.234', '1.11.352']), + ('elasticbeanstalk', ['1.9.234', '1.11.352']), + ('elasticfilesystem', ['1.9.234', '1.11.352']), + ('elasticloadbalancing', ['1.9.234', '1.11.352']), + ('elasticloadbalancingv2', ['1.9.234', '1.11.352']), + ('elasticmapreduce', ['1.9.234', '1.11.352']), + ('elastictranscoder', ['1.9.234', '1.11.352']), + ('email', ['1.9.234', '1.11.352']), + ('emr-containers', ['1.9.234', '1.11.352']), + ('emr-serverless', ['1.11.352']), + ('entityresolution', ['1.11.352']), + ('es', ['1.9.234', '1.11.352']), + ('eventbridge', ['1.9.234', '1.11.352']), + ('events', ['1.9.234', '1.11.352']), + ('evidently', ['1.11.352']), + ('finspace', ['1.11.352']), + ('finspace-data', ['1.11.352']), + ('firehose', ['1.9.234', '1.11.352']), + ('fis', ['1.11.352']), + ('fms', ['1.9.234', '1.11.352']), + ('forecast', ['1.9.234', '1.11.352']), + ('forecastquery', ['1.9.234', '1.11.352']), + ('frauddetector', ['1.9.234', '1.11.352']), + ('freetier', ['1.11.352']), + ('fsx', ['1.9.234', '1.11.352']), + ('gamelift', ['1.9.234', '1.11.352']), + ('glacier', ['1.9.234', '1.11.352']), + ('globalaccelerator', ['1.9.234', '1.11.352']), + ('glue', ['1.9.234', '1.11.352']), + ('grafana', ['1.11.352']), + ('greengrass', ['1.9.234', '1.11.352']), + ('greengrassv2', ['1.9.234', '1.11.352']), + ('groundstation', ['1.9.234', '1.11.352']), + ('guardduty', ['1.9.234', '1.11.352']), + ('health', ['1.9.234', '1.11.352']), + ('healthlake', ['1.9.234', '1.11.352']), + ('honeycode', ['1.9.234']), + ('iam', ['1.9.234', '1.11.352']), + ('identity-management', ['1.9.234', '1.11.352']), + ('identitystore', ['1.9.234', '1.11.352']), + ('imagebuilder', ['1.9.234', '1.11.352']), + ('importexport', ['1.9.234', '1.11.352']), + ('inspector', ['1.9.234', '1.11.352']), + ('inspector-scan', ['1.11.352']), + ('inspector2', ['1.11.352']), + ('internetmonitor', ['1.11.352']), + ('iot', ['1.9.234', '1.11.352']), + ('iot-data', ['1.9.234', '1.11.352']), + ('iot-jobs-data', ['1.9.234', '1.11.352']), + ('iot1click-devices', ['1.9.234', '1.11.352']), + ('iot1click-projects', ['1.9.234', '1.11.352']), + ('iotanalytics', ['1.9.234', '1.11.352']), + ('iotdeviceadvisor', ['1.9.234', '1.11.352']), + ('iotevents', ['1.9.234', '1.11.352']), + ('iotevents-data', ['1.9.234', '1.11.352']), + ('iotfleethub', ['1.9.234', '1.11.352']), + ('iotfleetwise', ['1.11.352']), + ('iotsecuretunneling', ['1.9.234', '1.11.352']), + ('iotsitewise', ['1.9.234', '1.11.352']), + ('iotthingsgraph', ['1.9.234', '1.11.352']), + ('iottwinmaker', ['1.11.352']), + ('iotwireless', ['1.9.234', '1.11.352']), + ('ivs', ['1.9.234', '1.11.352']), + ('ivs-realtime', ['1.11.352']), + ('ivschat', ['1.11.352']), + ('kafka', ['1.9.234', '1.11.352']), + ('kafkaconnect', ['1.11.352']), + ('kendra', ['1.9.234', '1.11.352']), + ('kendra-ranking', ['1.11.352']), + ('keyspaces', ['1.11.352']), + ('kinesis', ['1.9.234', '1.11.352']), + ('kinesis-video-archived-media', ['1.9.234', '1.11.352']), + ('kinesis-video-media', ['1.9.234', '1.11.352']), + ('kinesis-video-signaling', ['1.9.234', '1.11.352']), + ('kinesis-video-webrtc-storage', ['1.11.352']), + ('kinesisanalytics', ['1.9.234', '1.11.352']), + ('kinesisanalyticsv2', ['1.9.234', '1.11.352']), + ('kinesisvideo', ['1.9.234', '1.11.352']), + ('kms', ['1.9.234', '1.11.352']), + ('lakeformation', ['1.9.234', '1.11.352']), + ('lambda', ['1.9.234', '1.11.352']), + ('launch-wizard', ['1.11.352']), + ('lex', ['1.9.234', '1.11.352']), + ('lex-models', ['1.9.234', '1.11.352']), + ('lexv2-models', ['1.9.234', '1.11.352']), + ('lexv2-runtime', ['1.9.234', '1.11.352']), + ('license-manager', ['1.9.234', '1.11.352']), + ('license-manager-linux-subscriptions', ['1.11.352']), + ('license-manager-user-subscriptions', ['1.11.352']), + ('lightsail', ['1.9.234', '1.11.352']), + ('location', ['1.9.234', '1.11.352']), + ('logs', ['1.9.234', '1.11.352']), + ('lookoutequipment', ['1.11.352']), + ('lookoutmetrics', ['1.11.352']), + ('lookoutvision', ['1.9.234', '1.11.352']), + ('m2', ['1.11.352']), + ('machinelearning', ['1.9.234', '1.11.352']), + ('macie', ['1.9.234']), + ('macie2', ['1.9.234', '1.11.352']), + ('mailmanager', ['1.11.352']), + ('managedblockchain', ['1.9.234', '1.11.352']), + ('managedblockchain-query', ['1.11.352']), + ('marketplace-agreement', ['1.11.352']), + ('marketplace-catalog', ['1.9.234', '1.11.352']), + ('marketplace-deployment', ['1.11.352']), + ('marketplace-entitlement', ['1.9.234', '1.11.352']), + ('marketplacecommerceanalytics', ['1.9.234', '1.11.352']), + ('mediaconnect', ['1.9.234', '1.11.352']), + ('mediaconvert', ['1.9.234', '1.11.352']), + ('medialive', ['1.9.234', '1.11.352']), + ('mediapackage', ['1.9.234', '1.11.352']), + ('mediapackage-vod', ['1.9.234', '1.11.352']), + ('mediapackagev2', ['1.11.352']), + ('mediastore', ['1.9.234', '1.11.352']), + ('mediastore-data', ['1.9.234', '1.11.352']), + ('mediatailor', ['1.9.234', '1.11.352']), + ('medical-imaging', ['1.11.352']), + ('memorydb', ['1.11.352']), + ('meteringmarketplace', ['1.9.234', '1.11.352']), + ('mgn', ['1.11.352']), + ('migration-hub-refactor-spaces', ['1.11.352']), + ('migrationhub-config', ['1.9.234', '1.11.352']), + ('migrationhuborchestrator', ['1.11.352']), + ('migrationhubstrategy', ['1.11.352']), + ('mobile', ['1.9.234', '1.11.352']), + ('mobileanalytics', ['1.9.234']), + ('monitoring', ['1.9.234', '1.11.352']), + ('mq', ['1.9.234', '1.11.352']), + ('mturk-requester', ['1.9.234', '1.11.352']), + ('mwaa', ['1.9.234', '1.11.352']), + ('neptune', ['1.9.234', '1.11.352']), + ('neptune-graph', ['1.11.352']), + ('neptunedata', ['1.11.352']), + ('network-firewall', ['1.9.234', '1.11.352']), + ('networkmanager', ['1.9.234', '1.11.352']), + ('networkmonitor', ['1.11.352']), + ('nimble', ['1.11.352']), + ('oam', ['1.11.352']), + ('omics', ['1.11.352']), + ('opensearch', ['1.11.352']), + ('opensearchserverless', ['1.11.352']), + ('opsworks', ['1.9.234', '1.11.352']), + ('opsworkscm', ['1.9.234', '1.11.352']), + ('organizations', ['1.9.234', '1.11.352']), + ('osis', ['1.11.352']), + ('outposts', ['1.9.234', '1.11.352']), + ('panorama', ['1.11.352']), + ('payment-cryptography', ['1.11.352']), + ('payment-cryptography-data', ['1.11.352']), + ('pca-connector-ad', ['1.11.352']), + ('pca-connector-scep', ['1.11.352']), + ('personalize', ['1.9.234', '1.11.352']), + ('personalize-events', ['1.9.234', '1.11.352']), + ('personalize-runtime', ['1.9.234', '1.11.352']), + ('pi', ['1.9.234', '1.11.352']), + ('pinpoint', ['1.9.234', '1.11.352']), + ('pinpoint-email', ['1.9.234', '1.11.352']), + ('pinpoint-sms-voice-v2', ['1.11.352']), + ('pipes', ['1.11.352']), + ('polly', ['1.9.234', '1.11.352']), + # ('polly-sample', ['1.9.234']), # This gets generated, but is only sample code + ('pricing', ['1.9.234', '1.11.352']), + ('privatenetworks', ['1.11.352']), + ('proton', ['1.11.352']), + ('qbusiness', ['1.11.352']), + ('qconnect', ['1.11.352']), + ('qldb', ['1.9.234', '1.11.352']), + ('qldb-session', ['1.9.234', '1.11.352']), + ('queues', ['1.9.234', '1.11.352']), + ('quicksight', ['1.9.234', '1.11.352']), + ('ram', ['1.9.234', '1.11.352']), + ('rbin', ['1.11.352']), + ('rds', ['1.9.234', '1.11.352']), + ('rds-data', ['1.9.234', '1.11.352']), + ('redshift', ['1.9.234', '1.11.352']), + ('redshift-data', ['1.9.234', '1.11.352']), + ('redshift-serverless', ['1.11.352']), + ('rekognition', ['1.9.234', '1.11.352']), + ('repostspace', ['1.11.352']), + ('resiliencehub', ['1.11.352']), + ('resource-explorer-2', ['1.11.352']), + ('resource-groups', ['1.9.234', '1.11.352']), + ('resourcegroupstaggingapi', ['1.9.234', '1.11.352']), + ('robomaker', ['1.9.234', '1.11.352']), + ('rolesanywhere', ['1.11.352']), + ('route53', ['1.9.234', '1.11.352']), + ('route53-recovery-cluster', ['1.11.352']), + ('route53-recovery-control-config', ['1.11.352']), + ('route53-recovery-readiness', ['1.11.352']), + ('route53domains', ['1.9.234', '1.11.352']), + ('route53profiles', ['1.11.352']), + ('route53resolver', ['1.9.234', '1.11.352']), + ('rum', ['1.11.352']), + ('s3', ['1.9.234', '1.11.352']), + ('s3-crt', ['1.9.234', '1.11.352']), + ('s3-encryption', ['1.9.234', '1.11.352']), + ('s3control', ['1.9.234', '1.11.352']), + ('s3outposts', ['1.9.234', '1.11.352']), + ('sagemaker', ['1.9.234', '1.11.352']), + ('sagemaker-a2i-runtime', ['1.9.234', '1.11.352']), + ('sagemaker-edge', ['1.9.234', '1.11.352']), + ('sagemaker-featurestore-runtime', ['1.9.234', '1.11.352']), + ('sagemaker-geospatial', ['1.11.352']), + ('sagemaker-metrics', ['1.11.352']), + ('sagemaker-runtime', ['1.9.234', '1.11.352']), + ('savingsplans', ['1.9.234', '1.11.352']), + ('scheduler', ['1.11.352']), + ('schemas', ['1.9.234', '1.11.352']), + ('sdb', ['1.9.234', '1.11.352']), + ('secretsmanager', ['1.9.234', '1.11.352']), + ('securityhub', ['1.9.234', '1.11.352']), + ('securitylake', ['1.11.352']), + ('serverlessrepo', ['1.9.234', '1.11.352']), + ('service-quotas', ['1.9.234', '1.11.352']), + ('servicecatalog', ['1.9.234', '1.11.352']), + ('servicecatalog-appregistry', ['1.9.234', '1.11.352']), + ('servicediscovery', ['1.9.234', '1.11.352']), + ('sesv2', ['1.9.234', '1.11.352']), + ('shield', ['1.9.234', '1.11.352']), + ('signer', ['1.9.234', '1.11.352']), + ('simspaceweaver', ['1.11.352']), + ('sms', ['1.9.234', '1.11.352']), + ('sms-voice', ['1.9.234', '1.11.352']), + ('snow-device-management', ['1.11.352']), + ('snowball', ['1.9.234', '1.11.352']), + ('sns', ['1.9.234', '1.11.352']), + ('sqs', ['1.9.234', '1.11.352']), + ('ssm', ['1.9.234', '1.11.352']), + ('ssm-contacts', ['1.11.352']), + ('ssm-incidents', ['1.11.352']), + ('ssm-sap', ['1.11.352']), + ('sso', ['1.9.234', '1.11.352']), + ('sso-admin', ['1.9.234', '1.11.352']), + ('sso-oidc', ['1.9.234', '1.11.352']), + ('states', ['1.9.234', '1.11.352']), + ('storagegateway', ['1.9.234', '1.11.352']), + ('sts', ['1.9.234', '1.11.352']), + ('supplychain', ['1.11.352']), + ('support', ['1.9.234', '1.11.352']), + ('support-app', ['1.11.352']), + ('swf', ['1.9.234', '1.11.352']), + ('synthetics', ['1.9.234', '1.11.352']), + ('taxsettings', ['1.11.352']), + ('text-to-speech', ['1.9.234', '1.11.352']), + ('textract', ['1.9.234', '1.11.352']), + ('timestream-influxdb', ['1.11.352']), + ('timestream-query', ['1.9.234', '1.11.352']), + ('timestream-write', ['1.9.234', '1.11.352']), + ('tnb', ['1.11.352']), + ('transcribe', ['1.9.234', '1.11.352']), + ('transcribestreaming', ['1.9.234', '1.11.352']), + ('transfer', ['1.9.234', '1.11.352']), + ('translate', ['1.9.234', '1.11.352']), + ('trustedadvisor', ['1.11.352']), + ('verifiedpermissions', ['1.11.352']), + ('voice-id', ['1.11.352']), + ('vpc-lattice', ['1.11.352']), + ('waf', ['1.9.234', '1.11.352']), + ('waf-regional', ['1.9.234', '1.11.352']), + ('wafv2', ['1.9.234', '1.11.352']), + ('wellarchitected', ['1.9.234', '1.11.352']), + ('wisdom', ['1.11.352']), + ('workdocs', ['1.9.234', '1.11.352']), + ('worklink', ['1.9.234', '1.11.352']), + ('workmail', ['1.9.234', '1.11.352']), + ('workmailmessageflow', ['1.9.234', '1.11.352']), + ('workspaces', ['1.9.234', '1.11.352']), + ('workspaces-thin-client', ['1.11.352']), + ('workspaces-web', ['1.11.352']), + ('xray', ['1.9.234', '1.11.352']) ) options = { **{ @@ -295,22 +429,24 @@ class AwsSdkCppConan(ConanFile): "fPIC": [True, False], "min_size": [True, False], }, - **{ x: [True, False] for x in _sdks}, + **{sdk_name: [None, True, False] for sdk_name, _ in _sdks}, + } + default_options = { + **{ + "shared": False, + "fPIC": True, + "min_size": False + }, + **{sdk_name: None for sdk_name, _ in _sdks}, + # Overrides + "monitoring": True # TODO: Clarify why monitoring is True by default } - default_options = {key: False for key in options.keys()} - default_options["fPIC"] = True - default_options["access-management"] = True - default_options["identity-management"] = True - default_options["monitoring"] = True - default_options["queues"] = True - default_options["s3-encryption"] = True - default_options["transfer"] = True - default_options["text-to-speech"] = True short_paths = True @property def _internal_requirements(self): + # These modules and dependencies come from https://github.com/aws/aws-sdk-cpp/blob/1.11.352/cmake/sdksCommon.cmake#L147 and below return { "access-management": ["iam", "cognito-identity"], "identity-management": ["cognito-identity", "sts"], @@ -320,86 +456,139 @@ def _internal_requirements(self): "transfer": ["s3"], } - @property - def _use_aws_crt_cpp(self): - return Version(self.version) >= "1.9" - 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) < "1.9": - self.options.rm_safe("s3-crt") + + # Main modules are true by default, but the user can set them to false + for module in self._internal_requirements: + setattr(self.options, module, True) + + # Remove all sdk options not belonging to the current version + for sdk_name, sdk_versions in self._sdks: + if self.version not in sdk_versions: + self.options.rm_safe(sdk_name) def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + # If the user does not specify a value for a specific sdk: + # - Set it to True if it's a dependency of a main module that is set to True + for module, dependencies in self._internal_requirements.items(): + if self.options.get_safe(module): + for dependency in dependencies: + # Don't listen to the linter, get_safe should be compared like this to None + # TODO: Remove str comparison when Conan 1 is disabled + if str(self.options.get_safe(dependency)) == "None": + setattr(self.options, dependency, True) + + # - Otherwise set it to False + # This way there are no None options past this method, and we can control default values + # of the dependencies of the main modules but still give the user control over them + for sdk_name, sdk_versions in self._sdks: + # == None is true for both "was deleted" and "was not set by the user", + # ensure we only try to set the value to false for the latter + if self.version in sdk_versions and self.options.get_safe(sdk_name) == None: + setattr(self.options, sdk_name, False) + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - 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", transitive_headers=True) + # These versions come from prefetch_crt_dependency.sh, + # dont bump them independently, check the file + if self.version == "1.11.352": + self.requires("aws-crt-cpp/0.26.9", transitive_headers=True) + self.requires("aws-c-auth/0.7.16") + self.requires("aws-c-cal/0.6.14") + self.requires("aws-c-common/0.9.15") + self.requires("aws-c-compression/0.2.18") # No mention of this in the code + self.requires("aws-c-event-stream/0.4.2") + self.requires("aws-c-http/0.8.1") + self.requires("aws-c-io/0.14.7") + self.requires("aws-c-mqtt/0.10.3") + if self.options.get_safe("s3-crt"): + self.requires("aws-c-s3/0.5.5") + self.requires("aws-c-sdkutils/0.1.15") # No mention of this in the code + self.requires("aws-checksums/0.1.18") + # missing aws-lc, but only needed as openssl replacement if USE_OPENSSL is OFF + if self.version == "1.9.234": + self.requires("aws-crt-cpp/0.17.1a", transitive_headers=True) + self.requires("aws-c-auth/0.6.4") + self.requires("aws-c-cal/0.5.12") + self.requires("aws-c-common/0.6.11") + self.requires("aws-c-compression/0.2.14") + self.requires("aws-c-event-stream/0.2.7") + self.requires("aws-c-http/0.6.7") + self.requires("aws-c-io/0.10.9") + self.requires("aws-c-mqtt/0.7.8") + if self.options.get_safe("s3-crt"): + self.requires("aws-c-s3/0.1.26") + self.requires("aws-checksums/0.1.12") if self.settings.os != "Windows": - self.requires("openssl/[>=1.1 <4]") - self.requires("libcurl/[>=7.78.0 <9]") - if self.settings.os in ["Linux", "FreeBSD"]: + # Used transitively in core/utils/crypto/openssl/CryptoImpl.h public header + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + # Used transitively in core/http/curl/CurlHandleContainer.h public header + self.requires("libcurl/[>=7.78.0 <9]", transitive_headers=True) + if self.settings.os == "Linux": + # Pulseaudio -> libcap, libalsa only support linux, don't use pulseaudio on other platforms if self.options.get_safe("text-to-speech"): - self.requires("pulseaudio/14.2") + # Used transitively in text-to-speech/PulseAudioPCMOutputDriver.h public header + self.requires("pulseaudio/14.2", transitive_headers=True, transitive_libs=True) + # zlib is used if ENABLE_ZLIB_REQUEST_COMPRESSION is enabled, set ot ON by default + self.requires("zlib/[>=1.2.11 <2]") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def validate_build(self): + if self._settings_build.os == "Windows" and self.settings.os == "Android": + raise ConanInvalidConfiguration("Cross-building from Windows to Android is not supported") - def validate(self): if (self.options.shared - and self.settings.compiler == "gcc" - and Version(self.settings.compiler.version) < "6.0"): + and self.settings.compiler == "gcc" + 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 (Version(self.version) < "1.9.234" - and self.settings.compiler == "gcc" - 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 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": - raise ConanInvalidConfiguration( - "This version doesn't support arm8. " - "See https://github.com/aws/aws-sdk-cpp/issues/1542" - ) - - def package_id(self): - for hl_comp in self._internal_requirements.keys(): - if getattr(self.info.options, hl_comp): - for internal_requirement in self._internal_requirements[hl_comp]: - setattr(self.info.options, internal_requirement, True) + + def validate(self): + if is_msvc(self) and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Static runtime is not working for more recent releases") + if (is_msvc(self) and self.options.shared + and not self.dependencies["aws-c-common"].options.shared): + raise ConanInvalidConfiguration(f"{self.ref} with shared is not supported with aws-c-common static") + + # If the user has explicitly set a main module dependency to False, + # error out if the main module itself is not also disabled + for main_module, dependencies in self._internal_requirements.items(): + if self.options.get_safe(main_module): + for internal_requirement in dependencies: + if not self.options.get_safe(internal_requirement): + raise ConanInvalidConfiguration(f"-o={self.ref}:{main_module}=True requires -o={self.ref}:{internal_requirement}=True") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def _enabled_sdks(self): + for sdk in self._sdks: + if self.options.get_safe(sdk[0]): + yield sdk + 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) + for sdk_name, _ in self._enabled_sdks(): + build_only.append(sdk_name) tc.cache_variables["BUILD_ONLY"] = ";".join(build_only) tc.cache_variables["ENABLE_UNITY_BUILD"] = True @@ -407,10 +596,11 @@ def generate(self): tc.cache_variables["AUTORUN_UNIT_TESTS"] = False tc.cache_variables["BUILD_DEPS"] = False if self.settings.os != "Windows": + tc.cache_variables["USE_OPENSSL"] = True 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: + if is_msvc(self): tc.cache_variables["FORCE_SHARED_CRT"] = not is_msvc_static_runtime(self) if cross_building(self): @@ -429,10 +619,11 @@ def generate(self): 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")', "", - ) + if self.version == "1.9.234": + 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): self._patch_sources() @@ -446,15 +637,19 @@ def _res_folder(self): def _create_project_cmake_module(self): # package files needed to build other components (e.g. aws-cdi-sdk) with this SDK - for file in [ + dependant_files = [ "cmake/compiler_settings.cmake", "cmake/initialize_project_version.cmake", "cmake/utilities.cmake", "cmake/sdk_plugin_conf.cmake", "toolchains/cmakeProjectConfig.cmake", - "toolchains/pkg-config.pc.in", - "aws-cpp-sdk-core/include/aws/core/VersionConfig.h" - ]: + "toolchains/pkg-config.pc.in" + ] + if Version(self.version) >= "1.11.352": + dependant_files.append("src/aws-cpp-sdk-core/include/aws/core/VersionConfig.h") + else: + dependant_files.append("aws-cpp-sdk-core/include/aws/core/VersionConfig.h") + for file in dependant_files: 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), @@ -464,7 +659,7 @@ def _create_project_cmake_module(self): # avoid getting error from hook 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")) + 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", @@ -494,27 +689,25 @@ def package_info(self): 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-crt-cpp::aws-crt-cpp", + "aws-c-auth::aws-c-auth", + "aws-c-cal::aws-c-cal", "aws-c-common::aws-c-common", + "aws-c-compression::aws-c-compression", "aws-c-event-stream::aws-c-event-stream", + "aws-c-http::aws-c-http", + "aws-c-io::aws-c-io", + "aws-c-mqtt::aws-c-mqtt", "aws-checksums::aws-checksums", + "zlib::zlib" ] - if self._use_aws_crt_cpp: + + if Version(self.version) >= "1.11.352": self.cpp_info.components["core"].requires.extend([ - "aws-c-cal::aws-c-cal", - "aws-c-http::aws-c-http", - "aws-c-io::aws-c-io", - "aws-crt-cpp::aws-crt-cpp", + "aws-c-sdkutils::aws-c-sdkutils", ]) - # other components - enabled_sdks = [sdk for sdk in self._sdks if self.options.get_safe(sdk)] - for hl_comp in self._internal_requirements.keys(): - if getattr(self.options, hl_comp): - for internal_requirement in self._internal_requirements[hl_comp]: - if internal_requirement not in enabled_sdks: - enabled_sdks.append(internal_requirement) - - for sdk in enabled_sdks: + for sdk, _ in self._enabled_sdks(): # 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 @@ -528,7 +721,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 = f"aws-sdk-cpp-{sdk}_alias" # 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] @@ -543,14 +736,19 @@ def package_info(self): else: self.cpp_info.components["core"].requires.extend(["libcurl::curl", "openssl::openssl"]) - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["core"].system_libs.append("atomic") + if self.settings.os == "Linux": if self.options.get_safe("text-to-speech"): self.cpp_info.components["text-to-speech"].requires.append("pulseaudio::pulseaudio") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["core"].system_libs.append("atomic") + + if self.options.get_safe("s3-crt"): + self.cpp_info.components["s3-crt"].requires.append("aws-c-s3::aws-c-s3") + if self.settings.os == "Macos": if self.options.get_safe("text-to-speech"): - self.cpp_info.components["text-to-speech"].frameworks.append("CoreAudio") + self.cpp_info.components["text-to-speech"].frameworks.extend(["CoreAudio", "AudioToolbox"]) libcxx = stdcpp_library(self) if libcxx: diff --git a/recipes/aws-sdk-cpp/all/patches/1.11.352-0001-pulseaudio.patch b/recipes/aws-sdk-cpp/all/patches/1.11.352-0001-pulseaudio.patch new file mode 100644 index 0000000000000..c2a64d3dd0446 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.11.352-0001-pulseaudio.patch @@ -0,0 +1,32 @@ +diff --git a/src/aws-cpp-sdk-text-to-speech/CMakeLists.txt b/src/aws-cpp-sdk-text-to-speech/CMakeLists.txt +index 5a40f1906..4136a4690 100644 +--- a/src/aws-cpp-sdk-text-to-speech/CMakeLists.txt ++++ b/src/aws-cpp-sdk-text-to-speech/CMakeLists.txt +@@ -9,8 +9,6 @@ file( GLOB TEXT_TO_SPEECH_HEADERS "include/aws/text-to-speech/*.h" ) + + set(PLATFORM_LIBS "") + +-check_include_files("pulse/simple.h" HAVE_PULSE) +- + if(PLATFORM_WINDOWS) + file( GLOB TEXT_TO_SPEECH_PLATFORM_HEADERS "include/aws/text-to-speech/windows/*.h" ) + file( GLOB TEXT_TO_SPEECH_PLATFORM_SOURCE "source/text-to-speech/windows/*.cpp" ) +@@ -19,14 +17,15 @@ if(PLATFORM_WINDOWS) + set(PLATFORM_LIBS ${PLATFORM_LIBS} Winmm) + endif() + +-if (PLATFORM_LINUX) +- if(HAVE_PULSE) ++if (CMAKE_SYSTEM_NAME STREQUAL "Linux") ++ find_package(pulseaudio) ++ if(pulseaudio_FOUND) + file( GLOB TEXT_TO_SPEECH_PLATFORM_HEADERS "include/aws/text-to-speech/linux/*.h" ) + file( GLOB TEXT_TO_SPEECH_PLATFORM_SOURCE "source/text-to-speech/linux/*.cpp" ) + + 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} "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/patches/1.11.352-0002-disable-sort-links.patch b/recipes/aws-sdk-cpp/all/patches/1.11.352-0002-disable-sort-links.patch new file mode 100644 index 0000000000000..9ba1170c20c17 --- /dev/null +++ b/recipes/aws-sdk-cpp/all/patches/1.11.352-0002-disable-sort-links.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/sdks.cmake b/cmake/sdks.cmake +index 1b1ada7fc..606f5db18 100644 +--- a/cmake/sdks.cmake ++++ b/cmake/sdks.cmake +@@ -271,7 +271,7 @@ function(add_sdks) + + # the catch-all config needs to list all the targets in a dependency-sorted order + include(dependencies) +- sort_links(EXPORTS) ++ #sort_links(EXPORTS) + + # make an everything config by just including all the individual configs + file(WRITE ${CMAKE_BINARY_DIR}/aws-sdk-cpp-config.cmake "") \ No newline at end of file diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0001-disable-sort-links.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0001-disable-sort-links.patch deleted file mode 100644 index bd8fbce5589dc..0000000000000 --- a/recipes/aws-sdk-cpp/all/patches/1.8.130-0001-disable-sort-links.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/sdks.cmake b/cmake/sdks.cmake -index 975281faaa..ebedbcc6e5 100644 ---- a/cmake/sdks.cmake -+++ b/cmake/sdks.cmake -@@ -236,7 +236,7 @@ function(add_sdks) - - # the catch-all config needs to list all the targets in a dependency-sorted order - include(dependencies) -- sort_links(EXPORTS) -+ # sort_links(EXPORTS) - - # make an everything config by just including all the individual configs - file(WRITE ${CMAKE_BINARY_DIR}/aws-sdk-cpp-config.cmake "") diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0002-force-archive-directory-to-library-directory.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0002-force-archive-directory-to-library-directory.patch deleted file mode 100644 index ae9310e5bb684..0000000000000 --- a/recipes/aws-sdk-cpp/all/patches/1.8.130-0002-force-archive-directory-to-library-directory.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a653e38628..6761052856 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -295,11 +295,7 @@ if (CMAKE_INSTALL_INCLUDEDIR) - set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}") - endif() - --if(BUILD_SHARED_LIBS) -- set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}") --else() -- set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}") --endif() -+set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}") - - if (ENABLE_ADDRESS_SANITIZER) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g -fno-omit-frame-pointer") diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch deleted file mode 100644 index 6f85ba392127f..0000000000000 --- a/recipes/aws-sdk-cpp/all/patches/1.8.130-0003-disable-cmake-install-rpath-use-link-path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a653e38628..4aac800fde 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -142,7 +142,7 @@ else() - endif() - - # Add Linker search paths to RPATH so as to fix the problem where some linkers can't find cross-compiled dependent libraries in customer paths when linking executables. --set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true) -+# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true) - - # build third-party targets - if (BUILD_DEPS) 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 9930b981211f6..84537aa466936 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 @@ -1,5 +1,5 @@ diff --git a/aws-cpp-sdk-text-to-speech/CMakeLists.txt b/aws-cpp-sdk-text-to-speech/CMakeLists.txt -index b1054515d5..d1a34ddfc5 100644 +index b105451..7de9367 100644 --- a/aws-cpp-sdk-text-to-speech/CMakeLists.txt +++ b/aws-cpp-sdk-text-to-speech/CMakeLists.txt @@ -9,8 +9,6 @@ file( GLOB TEXT_TO_SPEECH_HEADERS "include/aws/text-to-speech/*.h" ) @@ -11,13 +11,15 @@ index b1054515d5..d1a34ddfc5 100644 if(PLATFORM_WINDOWS) file( GLOB TEXT_TO_SPEECH_PLATFORM_HEADERS "include/aws/text-to-speech/windows/*.h" ) file( GLOB TEXT_TO_SPEECH_PLATFORM_SOURCE "source/text-to-speech/windows/*.cpp" ) -@@ -20,13 +18,14 @@ if(PLATFORM_WINDOWS) +@@ -19,14 +17,15 @@ if(PLATFORM_WINDOWS) + set(PLATFORM_LIBS ${PLATFORM_LIBS} Winmm) endif() - if (PLATFORM_LINUX) +-if (PLATFORM_LINUX) - if(HAVE_PULSE) ++if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + find_package(pulseaudio) -+ if (1) ++ if (pulseaudio_FOUND) file( GLOB TEXT_TO_SPEECH_PLATFORM_HEADERS "include/aws/text-to-speech/linux/*.h" ) file( GLOB TEXT_TO_SPEECH_PLATFORM_SOURCE "source/text-to-speech/linux/*.cpp" ) diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0005-aws-plugin-conf.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0005-aws-plugin-conf.patch deleted file mode 100644 index b3eccfe69cc45..0000000000000 --- a/recipes/aws-sdk-cpp/all/patches/1.8.130-0005-aws-plugin-conf.patch +++ /dev/null @@ -1,44 +0,0 @@ -commit 1179cb040d6b9292d30eb7d444298cd286f9f574 -Author: dvirtz -Date: Tue Nov 16 21:38:45 2021 +0200 - - add a file to configure SDK plugins - -diff --git a/cmake/sdk_plugin_conf.cmake b/cmake/sdk_plugin_conf.cmake -new file mode 100644 -index 0000000000..474ead75bd ---- /dev/null -+++ b/cmake/sdk_plugin_conf.cmake -@@ -0,0 +1,32 @@ -+get_filename_component(AWS_NATIVE_SDK_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) -+set(SIMPLE_INSTALL TRUE) -+ -+if (CMAKE_INSTALL_BINDIR) -+ set(BINARY_DIRECTORY "${CMAKE_INSTALL_BINDIR}") -+endif() -+ -+if (CMAKE_INSTALL_LIBDIR) -+ set(LIBRARY_DIRECTORY "${CMAKE_INSTALL_LIBDIR}") -+endif() -+ -+if (CMAKE_INSTALL_INCLUDEDIR) -+ set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}") -+endif() -+ -+if(BUILD_SHARED_LIBS) -+ set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}") -+else() -+ set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}") -+endif() -+ -+if(DEFINED CMAKE_CXX_STANDARD) -+ set(STANDARD_DEFAULT ${CMAKE_CXX_STANDARD}) -+else() -+ set(STANDARD_DEFAULT "11") -+endif() -+set(CPP_STANDARD ${STANDARD_DEFAULT} CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.") -+ -+include(CMakePackageConfigHelpers) -+include(initialize_project_version) -+include(utilities) -+include(compiler_settings) diff --git a/recipes/aws-sdk-cpp/all/patches/1.8.130-0006-issue-1816.patch b/recipes/aws-sdk-cpp/all/patches/1.8.130-0006-issue-1816.patch deleted file mode 100644 index 6abce1b705a47..0000000000000 --- a/recipes/aws-sdk-cpp/all/patches/1.8.130-0006-issue-1816.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp -index c633f3fabe..abb1ab7332 100644 ---- aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp -+++ aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp -@@ -146,7 +146,6 @@ namespace Aws - AWS_LOGSTREAM_TRACE(CLASS_TAG, "Audio retrieved from Polly. " << result.GetContentType() << " with " - << result.GetRequestCharacters() << " characters syntesized"); - -- std::streamsize amountRead(0); - unsigned char buffer[BUFF_SIZE]; - - std::lock_guard m(m_driverLock); -@@ -159,7 +158,6 @@ namespace Aws - AWS_LOGSTREAM_TRACE(CLASS_TAG, "Writing " << read << " bytes to device."); - - successfullyPlayed = m_activeDriver->WriteBufferToDevice(buffer, (std::size_t)read); -- amountRead += read; - played = successfullyPlayed; - } - diff --git a/recipes/aws-sdk-cpp/all/patches/1.9.100-0001-disable-sort-links.patch b/recipes/aws-sdk-cpp/all/patches/1.9.100-0001-disable-sort-links.patch deleted file mode 100644 index 6e93f7675b327..0000000000000 --- a/recipes/aws-sdk-cpp/all/patches/1.9.100-0001-disable-sort-links.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/sdks.cmake b/cmake/sdks.cmake -index 0ec9981ddf..d86a9f4874 100644 ---- a/cmake/sdks.cmake -+++ b/cmake/sdks.cmake -@@ -250,7 +250,7 @@ function(add_sdks) - - # the catch-all config needs to list all the targets in a dependency-sorted order - include(dependencies) -- sort_links(EXPORTS) -+ #sort_links(EXPORTS) - - # make an everything config by just including all the individual configs - file(WRITE ${CMAKE_BINARY_DIR}/aws-sdk-cpp-config.cmake "") diff --git a/recipes/aws-sdk-cpp/all/patches/1.9.100-0003-issue-1816.patch b/recipes/aws-sdk-cpp/all/patches/1.9.100-0003-issue-1816.patch deleted file mode 100644 index 6abce1b705a47..0000000000000 --- a/recipes/aws-sdk-cpp/all/patches/1.9.100-0003-issue-1816.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp -index c633f3fabe..abb1ab7332 100644 ---- aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp -+++ aws-cpp-sdk-text-to-speech/source/text-to-speech/TextToSpeechManager.cpp -@@ -146,7 +146,6 @@ namespace Aws - AWS_LOGSTREAM_TRACE(CLASS_TAG, "Audio retrieved from Polly. " << result.GetContentType() << " with " - << result.GetRequestCharacters() << " characters syntesized"); - -- std::streamsize amountRead(0); - unsigned char buffer[BUFF_SIZE]; - - std::lock_guard m(m_driverLock); -@@ -159,7 +158,6 @@ namespace Aws - AWS_LOGSTREAM_TRACE(CLASS_TAG, "Writing " << read << " bytes to device."); - - successfullyPlayed = m_activeDriver->WriteBufferToDevice(buffer, (std::size_t)read); -- amountRead += read; - played = successfullyPlayed; - } - diff --git a/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt b/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt index dda85fd047b73..01a318283bbc1 100644 --- a/recipes/aws-sdk-cpp/all/test_package/CMakeLists.txt +++ b/recipes/aws-sdk-cpp/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(AWSSDK REQUIRED CONFIG) 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 37d0edc6941d9..4f6914e58a77b 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.8) +cmake_minimum_required(VERSION 3.15) add_project(aws-sdk-cpp-plugin "C++ AWS SDK plugin" AWS::aws-sdk-cpp-s3) diff --git a/recipes/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt b/recipes/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/aws-sdk-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/aws-sdk-cpp/all/test_v1_package/conanfile.py b/recipes/aws-sdk-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/aws-sdk-cpp/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_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/aws-sdk-cpp/config.yml b/recipes/aws-sdk-cpp/config.yml index 3af57130465e4..15dd4365a90bb 100644 --- a/recipes/aws-sdk-cpp/config.yml +++ b/recipes/aws-sdk-cpp/config.yml @@ -1,7 +1,5 @@ versions: - "1.9.234": - folder: "all" - "1.9.100": + "1.11.352": folder: "all" - "1.8.130": + "1.9.234": folder: "all" diff --git a/recipes/azure-sdk-for-cpp/all/CMakeLists.txt b/recipes/azure-sdk-for-cpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..46e5bc05a5d70 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper) + +# The cmake_wrapper allows users to build only modules they want and not the entire sdk, +# the CMakeLists.txt from source does not provide this modularity to users (it's all or nothing). + +foreach(sdk ${BUILD_LIST}) + if(${sdk} STREQUAL azure-core) + # Always build Core + add_subdirectory("src/sdk/core") + elseif(${sdk} STREQUAL azure-storage-common) + add_subdirectory("src/sdk/storage/azure-storage-common") + elseif(${sdk} STREQUAL azure-storage-blobs) + add_subdirectory("src/sdk/storage/azure-storage-blobs") + elseif(${sdk} STREQUAL azure-storage-files-shares) + add_subdirectory("src/sdk/storage/azure-storage-files-shares") + endif() +endforeach() diff --git a/recipes/azure-sdk-for-cpp/all/conandata.yml b/recipes/azure-sdk-for-cpp/all/conandata.yml new file mode 100644 index 0000000000000..62ba6f53644b1 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.11.3": + url: "https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/azure-core_1.11.3.tar.gz" + sha256: "c67e42622bf1ebafee29aa09f333e41adc24712b0c993ada5dd97c9265b444cc" diff --git a/recipes/azure-sdk-for-cpp/all/conanfile.py b/recipes/azure-sdk-for-cpp/all/conanfile.py new file mode 100644 index 0000000000000..cbd3a2311759b --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/conanfile.py @@ -0,0 +1,113 @@ +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 get, copy, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + +AZURE_SDK_MODULES = ( + "azure-storage-common", + "azure-storage-blobs", + "azure-storage-files-shares" +) + +class AzureSDKForCppConan(ConanFile): + name = "azure-sdk-for-cpp" + description = "Microsoft Azure Storage Client Library for C++" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Azure/azure-sdk-for-cpp" + topics = ("azure", "cpp", "cross-platform", "microsoft", "cloud") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + options.update({_name: [True, False] for _name in AZURE_SDK_MODULES}) + default_options = {"shared": False, "fPIC": True} + default_options.update({_name: True for _name in AZURE_SDK_MODULES}) # Build all modules by default, let users pick what they do not want + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + 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 requirements(self): + self.requires("openssl/[>=1.1 <4]") + self.requires("libcurl/[>=7.78 <9]") + self.requires("libxml2/[>=2.12.5 <3]") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + # Open to contributions for windows and apple + if self.settings.os != "Linux" and self.settings.os != "Macos": + raise ConanInvalidConfiguration( + f"{self.ref} Conan recipe in ConanCenter still does not support {self.settings.os}, contributions to the recipe welcome.") + + if self.settings.compiler != "gcc" and self.settings.compiler != "clang" and self.settings.compiler != "apple-clang": + raise ConanInvalidConfiguration( + f"{self.ref} Conan recipe in ConanCenter still does not support {self.settings.compiler}, contributions to the recipe welcome.") + + if self.settings.compiler == 'gcc' and Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration("Building requires GCC >= 6") + if (self.settings.compiler == 'clang' or self.settings.compiler == "apple-clang") and Version(self.settings.compiler.version) < "10": + raise ConanInvalidConfiguration("Building requires Clang >= 10") + + def generate(self): + tc = CMakeToolchain(self) + + build_list = ["azure-core"] + for sdk in AZURE_SDK_MODULES: + if self.options.get_safe(sdk): + build_list.append(sdk) + tc.cache_variables["BUILD_LIST"] = ";".join(build_list) + + tc.variables["AZ_ALL_LIBRARIES"] = "ON" + tc.variables["FETCH_SOURCE_DEPS"] = "OFF" + tc.cache_variables["BUILD_TESTING"] = "OFF" + tc.cache_variables["BUILD_WINDOWS_UWP"] = "ON" + tc.cache_variables["DISABLE_AZURE_CORE_OPENTELEMETRY"] = "ON" + tc.cache_variables["BUILD_TRANSPORT_CURL"] = "ON" + tc.cache_variables["WARNINGS_AS_ERRORS"] = "OFF" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(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() + + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "AzureSDK") + + # core component + self.cpp_info.components["azure-core"].set_property("cmake_target_name", "Azure::azure-core") + self.cpp_info.components["azure-core"].libs = ["azure-core"] + self.cpp_info.components["azure-core"].requires.extend(["openssl::openssl", "libcurl::curl", "libxml2::libxml2"]) + + enabled_sdks = [sdk for sdk in AZURE_SDK_MODULES if self.options.get_safe(sdk)] + for sdk in enabled_sdks: + self.cpp_info.components[sdk].set_property("cmake_target_name", f"Azure::{sdk}") + self.cpp_info.components[sdk].libs = [sdk] diff --git a/recipes/azure-sdk-for-cpp/all/test_package/CMakeLists.txt b/recipes/azure-sdk-for-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8d7eb9b551717 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(AzureSDK CONFIG REQUIRED) + +add_executable(test_azure-core test_azure-core.cc) +target_link_libraries(test_azure-core PRIVATE Azure::azure-core) + +add_executable(test_azure-storage-common test_azure-storage-common.cc) +target_link_libraries(test_azure-storage-common PRIVATE Azure::azure-core Azure::azure-storage-common) + +add_executable(test_azure-storage-blobs test_azure-storage-blobs.cc) +target_link_libraries(test_azure-storage-blobs PRIVATE Azure::azure-core Azure::azure-storage-common Azure::azure-storage-blobs) + +add_executable(test_azure-storage-files-shares test_azure-storage-files-shares.cc) +target_link_libraries(test_azure-storage-files-shares PRIVATE Azure::azure-core Azure::azure-storage-common Azure::azure-storage-files-shares) diff --git a/recipes/azure-sdk-for-cpp/all/test_package/conanfile.py b/recipes/azure-sdk-for-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2dfe88d001d05 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/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, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + @property + def _tested_modules(self): + return ["azure-core", + "azure-storage-common", + "azure-storage-blobs", + "azure-storage-files-shares"] + + 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): + for module in self._tested_modules: + bin_path = os.path.join(self.cpp.build.bindirs[0], f"test_{module}") + self.run(bin_path, env="conanrun") diff --git a/recipes/azure-sdk-for-cpp/all/test_package/test_azure-core.cc b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-core.cc new file mode 100644 index 0000000000000..bfd5501b81141 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-core.cc @@ -0,0 +1,10 @@ +#include +#include + +int main() +{ + std::vector data = {1, 2, 3, 4}; + Azure::Core::IO::MemoryBodyStream stream(data); + + return 0; +} diff --git a/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-blobs.cc b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-blobs.cc new file mode 100644 index 0000000000000..23cc6b485edbc --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-blobs.cc @@ -0,0 +1,10 @@ +#include + +using namespace Azure::Storage::Blobs; + +int main() +{ + BlobAudience audience{"TEST"}; + + return 0; +} diff --git a/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-common.cc b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-common.cc new file mode 100644 index 0000000000000..5fdbe6d99f6dc --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-common.cc @@ -0,0 +1,10 @@ +#include + +using namespace Azure::Storage; + +int main() +{ + ContentHash contentHash{}; + + return 0; +} diff --git a/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-files-shares.cc b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-files-shares.cc new file mode 100644 index 0000000000000..00034be2a0119 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/all/test_package/test_azure-storage-files-shares.cc @@ -0,0 +1,10 @@ +#include + +using namespace Azure::Storage::Files::Shares; + +int main() +{ + SetSharePropertiesOptions options; + + return 0; +} diff --git a/recipes/azure-sdk-for-cpp/config.yml b/recipes/azure-sdk-for-cpp/config.yml new file mode 100644 index 0000000000000..dc736edb41043 --- /dev/null +++ b/recipes/azure-sdk-for-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.11.3": + folder: "all" diff --git a/recipes/azure-storage-cpp/all/CMakeLists.txt b/recipes/azure-storage-cpp/all/CMakeLists.txt index 82ba25e8c2576..3d130cd5365bf 100644 --- a/recipes/azure-storage-cpp/all/CMakeLists.txt +++ b/recipes/azure-storage-cpp/all/CMakeLists.txt @@ -1,7 +1,16 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup() +find_package(cpprestsdk REQUIRED) +find_package(OpenSSL REQUIRED) +find_package(LibXml2 REQUIRED) +find_package(UUID QUIET) -add_subdirectory("source_subfolder/Microsoft.WindowsAzure.Storage") +add_subdirectory(src/Microsoft.WindowsAzure.Storage) + +target_link_libraries(azurestorage + cpprestsdk::cpprestsdk + OpenSSL::SSL + LibXml2::LibXml2 + $ +) diff --git a/recipes/azure-storage-cpp/all/conandata.yml b/recipes/azure-storage-cpp/all/conandata.yml index ccef8ba8c5bd6..5ce9572d0f722 100644 --- a/recipes/azure-storage-cpp/all/conandata.yml +++ b/recipes/azure-storage-cpp/all/conandata.yml @@ -4,5 +4,7 @@ sources: sha256: "446a821d115949f6511b7eb01e6a0e4f014b17bfeba0f3dc33a51750a9d5eca5" patches: "7.5.0": - - base_path: source_subfolder - patch_file: patches/0001-cmake-fixes.patch + - patch_file: "patches/fix-cpp17-incompatibility.patch" + patch_description: "Fix a minor C++17 incompatibility in util.cpp" + patch_type: "portability" + patch_source: "https://patch-diff.githubusercontent.com/raw/Azure/azure-storage-cpp/pull/366" diff --git a/recipes/azure-storage-cpp/all/conanfile.py b/recipes/azure-storage-cpp/all/conanfile.py index 92f05a255ac83..b86e79067f57c 100644 --- a/recipes/azure-storage-cpp/all/conanfile.py +++ b/recipes/azure-storage-cpp/all/conanfile.py @@ -1,19 +1,27 @@ -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.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, replace_in_file, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + class AzureStorageCppConan(ConanFile): name = "azure-storage-cpp" + description = "Microsoft Azure Storage Client Library for C++" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Azure/azure-storage-cpp" - description = "Microsoft Azure Storage Client Library for C++" topics = ("azure", "cpp", "cross-platform", "microsoft", "cloud") - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - exports_sources = ["CMakeLists.txt", "patches/**"] + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,16 +30,10 @@ class AzureStorageCppConan(ConanFile): "shared": False, "fPIC": True, } - short_paths = True - _cmake = None - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + # Use azure-sdk-for-cpp::azure-storage-blobs-cpp instead + # https://github.com/Azure/azure-sdk-for-cpp/blob/main/sdk/storage/MigrationGuide.md + deprecated = "azure-sdk-for-cpp" @property def _minimum_cpp_standard(self): @@ -40,41 +42,16 @@ def _minimum_cpp_standard(self): @property def _minimum_compiler_version(self): return { - "gcc": "5", + "gcc": "6", "Visual Studio": "14", + "msvc": "190", "clang": "3.4", "apple-clang": "5.1", } - def requirements(self): - self.requires("cpprestsdk/2.10.18") - if self.settings.os != "Windows": - self.requires("boost/1.76.0") - self.requires("libxml2/2.9.10") - self.requires("util-linux-libuuid/2.39") - if self.settings.os == "Macos": - self.requires("libgettext/0.20.1") - - 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["CMAKE_FIND_FRAMEWORK"] = "LAST" - self._cmake.definitions["BUILD_TESTS"] = False - self._cmake.definitions["BUILD_SAMPLES"] = False - if not self.settings.compiler.cppstd: - self._cmake.definitions["CMAKE_CXX_STANDARD"] = self._minimum_cpp_standard - - if self.settings.os == "Macos": - self._cmake.definitions["GETTEXT_LIB_DIR"] = self.deps_cpp_info["libgettext"].lib_paths[0] - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + 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": @@ -82,42 +59,100 @@ 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("cpprestsdk/2.10.19", transitive_headers=True, transitive_libs=True) + self.requires("libxml2/[>=2.12.5 <3]", transitive_headers=True, transitive_libs=True) + if self.settings.os != "Windows": + # Boost.Asio is used in a public header here: + # https://github.com/Azure/azure-storage-cpp/blob/v7.5.0/Microsoft.WindowsAzure.Storage/includes/wascore/timer_handler.h#L27 + self.requires("boost/1.83.0", transitive_headers=True, transitive_libs=True) + self.requires("util-linux-libuuid/2.39.2", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]") + if is_apple_os(self): + self.requires("libgettext/0.22") def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._minimum_cpp_standard) 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)) + 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." + ) # FIXME: Visual Studio 2015 & 2017 are supported but CI of CCI lacks several Win SDK components # https://github.com/conan-io/conan-center-index/issues/4195 - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) < "16": + if not check_min_vs(self, 192, raise_invalid=False): raise ConanInvalidConfiguration("Visual Studio < 2019 not yet supported in this recipe") - 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("Visual Studio build for shared library with MT runtime 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["CMAKE_FIND_FRAMEWORK"] = "LAST" + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_SAMPLES"] = False + if is_apple_os(self): + tc.variables["GETTEXT_LIB_DIR"] = self.dependencies["libgettext"].cpp_info.libdir + if not valid_min_cppstd(self, self._minimum_cpp_standard): + tc.variables["CMAKE_CXX_STANDARD"] = self._minimum_cpp_standard + # Allow non-cache_variables to be used + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("util-linux-libuuid", "cmake_file_name", "UUID") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + cmakelists_path = os.path.join(self.source_folder, "Microsoft.WindowsAzure.Storage", "CMakeLists.txt") + # Do not force C++11 and libc++ + replace_in_file(self, cmakelists_path, "-std=c++11", "") + replace_in_file(self, cmakelists_path, "-stdlib=libc++", "") + # Let Conan handle the Boost defines + replace_in_file(self, cmakelists_path, "add_definitions(-DBOOST_LOG_DYN_LINK)", "") + 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=self.source_path.parent) 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 = tools.collect_libs(self) if self.settings.os == "Windows": + # https://github.com/Azure/azure-storage-cpp/blob/v7.5.0/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt#L100 + self.cpp_info.libs = ["wastorage"] + # https://github.com/Azure/azure-storage-cpp/blob/v7.5.0/Microsoft.WindowsAzure.Storage/src/CMakeLists.txt#L90 self.cpp_info.system_libs = ["ws2_32", "rpcrt4", "xmllite", "bcrypt"] - if not self.options.shared: - self.cpp_info.defines = ["_NO_WASTORAGE_API"] + if is_msvc(self): + # https://github.com/Azure/azure-storage-cpp/blob/v7.5.0/Microsoft.WindowsAzure.Storage/CMakeLists.txt#L116-L120 + if self.options.shared: + self.cpp_info.defines = ["WASTORAGE_DLL", "_USRDLL"] + else: + self.cpp_info.defines = ["_NO_WASTORAGE_API"] + else: + self.cpp_info.libs = ["azurestorage"] diff --git a/recipes/azure-storage-cpp/all/patches/0001-cmake-fixes.patch b/recipes/azure-storage-cpp/all/patches/0001-cmake-fixes.patch deleted file mode 100644 index c775329eb84fe..0000000000000 --- a/recipes/azure-storage-cpp/all/patches/0001-cmake-fixes.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/Microsoft.WindowsAzure.Storage/CMakeLists.txt b/Microsoft.WindowsAzure.Storage/CMakeLists.txt -index ac9e65d..f5988f6 100644 ---- a/Microsoft.WindowsAzure.Storage/CMakeLists.txt -+++ b/Microsoft.WindowsAzure.Storage/CMakeLists.txt -@@ -46,9 +46,9 @@ if(UNIX) - find_package(OpenSSL 1.0.0 REQUIRED) - - -- find_package(UUID REQUIRED) -- find_package(Casablanca REQUIRED) -- find_package(LibXML2 REQUIRED) -+ find_package(libuuid REQUIRED) -+ find_package(cpprestsdk REQUIRED) -+ find_package(LibXml2 REQUIRED) - - if(BUILD_TESTS) - find_package(UnitTest++ REQUIRED) -@@ -57,7 +57,7 @@ if(UNIX) - - elseif(WIN32) - message("-- Setting WIN32 options") -- find_package(Casablanca REQUIRED) -+ find_package(cpprestsdk REQUIRED) - add_definitions(-DUNICODE -D_UNICODE -D_WIN32) - else() - message("-- Unsupported Build Platform.") -@@ -85,13 +85,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - - set(LD_FLAGS "${LD_FLAGS} -Wl,-z,defs") - -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") - - set(STRICT_CXX_FLAGS ${WARNINGS} "-Werror -pedantic") - -- if (BUILD_SHARED_LIBS) -- add_definitions(-DBOOST_LOG_DYN_LINK) -- endif() - add_definitions(-D_TURN_OFF_PLATFORM_STRING) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - message("-- Setting clang options") -@@ -100,14 +97,11 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(OSX_SUPPRESSIONS "-Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-reorder -Wno-unused-local-typedefs") - set(WARNINGS "${WARNINGS} ${OSX_SUPPRESSIONS}") - -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") - -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") -- if (BUILD_SHARED_LIBS) -- add_definitions(-DBOOST_LOG_DYN_LINK) -- endif() -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") - add_definitions(-D_TURN_OFF_PLATFORM_STRING) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - message("-- Setting MSVC options") -@@ -142,11 +136,11 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) - - set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) --set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${LibXML2_INCLUDE_DIR}) -+set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${cpprestsdk_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OpenSSL_INCLUDE_DIRS} ${libuuid_INCLUDE_DIRS} ${LibXml2_INCLUDE_DIR}) - - - set(AZURESTORAGE_LIBRARY azurestorage) --set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARY} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${UUID_LIBRARIES} ${LibXML2_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) -+set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${cpprestsdk_LIBRARIES} ${Boost_LIBRARIES} ${OpenSSL_LIBRARIES} ${libuuid_LIBRARIES} ${LibXml2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) - - # Set version numbers centralized - set (AZURESTORAGE_VERSION_MAJOR 7) diff --git a/recipes/azure-storage-cpp/all/patches/fix-cpp17-incompatibility.patch b/recipes/azure-storage-cpp/all/patches/fix-cpp17-incompatibility.patch new file mode 100644 index 0000000000000..23af9f8243be8 --- /dev/null +++ b/recipes/azure-storage-cpp/all/patches/fix-cpp17-incompatibility.patch @@ -0,0 +1,51 @@ +From b81d6349d3f6c05741978bab9b07372150c85137 Mon Sep 17 00:00:00 2001 +From: Adam Mensel +Date: Mon, 31 Aug 2020 19:44:24 -0600 +Subject: [PATCH 1/2] Use lambdas instead of std::fun_ptr, to get free C++17 + compatibility. + +--- + Microsoft.WindowsAzure.Storage/src/util.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Microsoft.WindowsAzure.Storage/src/util.cpp b/Microsoft.WindowsAzure.Storage/src/util.cpp +index cf0a3116..2d0d540c 100644 +--- a/Microsoft.WindowsAzure.Storage/src/util.cpp ++++ b/Microsoft.WindowsAzure.Storage/src/util.cpp +@@ -334,8 +334,8 @@ namespace azure { namespace storage { namespace core { + + utility::string_t str_trim_starting_trailing_whitespaces(const utility::string_t& str) + { +- auto non_space_begin = std::find_if(str.begin(), str.end(), std::not1(std::ptr_fun(isspace))); +- auto non_space_end = std::find_if(str.rbegin(), str.rend(), std::not1(std::ptr_fun(isspace))).base(); ++ auto non_space_begin = std::find_if(str.begin(), str.end(), [](char c) { return !std::isspace(c); }); ++ auto non_space_end = std::find_if(str.rbegin(), str.rend(), [](char c) { return !std::isspace(c); }).base(); + return utility::string_t(non_space_begin, non_space_end); + } + + +From b71db982b9f7065494c950c558f7e30b89026a89 Mon Sep 17 00:00:00 2001 +From: Adam Mensel +Date: Mon, 31 Aug 2020 23:02:29 -0600 +Subject: [PATCH 2/2] Keep the exact same logic as before, but still using a + lambda instead of std::fun_ptr. + +--- + Microsoft.WindowsAzure.Storage/src/util.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Microsoft.WindowsAzure.Storage/src/util.cpp b/Microsoft.WindowsAzure.Storage/src/util.cpp +index 2d0d540c..c2a3d7d4 100644 +--- a/Microsoft.WindowsAzure.Storage/src/util.cpp ++++ b/Microsoft.WindowsAzure.Storage/src/util.cpp +@@ -334,8 +334,8 @@ namespace azure { namespace storage { namespace core { + + utility::string_t str_trim_starting_trailing_whitespaces(const utility::string_t& str) + { +- auto non_space_begin = std::find_if(str.begin(), str.end(), [](char c) { return !std::isspace(c); }); +- auto non_space_end = std::find_if(str.rbegin(), str.rend(), [](char c) { return !std::isspace(c); }).base(); ++ auto non_space_begin = std::find_if(str.begin(), str.end(), [](int c) { return !isspace(c); }); ++ auto non_space_end = std::find_if(str.rbegin(), str.rend(), [](int c) { return !isspace(c); }).base(); + return utility::string_t(non_space_begin, non_space_end); + } + diff --git a/recipes/azure-storage-cpp/all/test_package/CMakeLists.txt b/recipes/azure-storage-cpp/all/test_package/CMakeLists.txt index 1c789ba4ceba1..b3dc1a61ac7d2 100644 --- a/recipes/azure-storage-cpp/all/test_package/CMakeLists.txt +++ b/recipes/azure-storage-cpp/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -set(CMAKE_CXX_STANDARD 11) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - find_package(azure-storage-cpp REQUIRED CONFIG) add_executable(example example.cpp) target_link_libraries(example azure-storage-cpp::azure-storage-cpp) +target_compile_features(example PRIVATE cxx_std_11) diff --git a/recipes/azure-storage-cpp/all/test_package/conanfile.py b/recipes/azure-storage-cpp/all/test_package/conanfile.py index 33fb4c0ecc216..8d52b7021efe1 100644 --- a/recipes/azure-storage-cpp/all/test_package/conanfile.py +++ b/recipes/azure-storage-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", "VirtualRunEnv" + test_type = "explicit" -class AwsSdkCppTestConan(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/b2/config.yml b/recipes/b2/config.yml index d807a6752466f..2570096ffbc69 100644 --- a/recipes/b2/config.yml +++ b/recipes/b2/config.yml @@ -1,53 +1,23 @@ 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": + "4.9.6": folder: portable - "4.9.1": + "4.10.0": folder: portable - "4.9.2": + "4.10.1": folder: portable - "4.9.3": + "5.0.0": folder: portable - "4.9.4": + "5.1.0": folder: portable - "4.9.5": + "5.2.0": folder: portable - "4.9.6": + "5.2.1": folder: portable - "4.10.0": + "5.3.0": folder: portable - "4.10.1": + "5.3.1": + folder: portable + "5.3.2": folder: portable diff --git a/recipes/b2/portable/conandata.yml b/recipes/b2/portable/conandata.yml index cc640fa9b092f..f2f0c29f09daa 100644 --- a/recipes/b2/portable/conandata.yml +++ b/recipes/b2/portable/conandata.yml @@ -1,61 +1,7 @@ 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" @@ -65,3 +11,24 @@ sources: "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" + "5.1.0": + url: "https://github.com/bfgroup/b2/releases/download/5.1.0/b2-5.1.0.tar.bz2" + sha256: "8429a2e7c9c4484f6a4bd7fb18743f0ea1dba41eb024479a9b23381bcb813623" + "5.2.0": + url: "https://github.com/bfgroup/b2/releases/download/5.2.0/b2-5.2.0.tar.bz2" + sha256: "c27adfb4e667d748bb7d3e18657938fa8bcf185b74a29bf091113299f532ed6d" + "5.2.1": + url: "https://github.com/bfgroup/b2/releases/download/5.2.1/b2-5.2.1.tar.bz2" + sha256: "6428edec31731aa479b4e7d8f83898831a0919352ec7d7f9874145abe165a578" + "5.3.0": + url: "https://github.com/bfgroup/b2/releases/download/5.3.0/b2-5.3.0.tar.bz2" + sha256: "89e851b6c8e596665afc6cc7054dca80178dc69d901fa71489fe26bb8fe147e5" + "5.3.1": + url: "https://github.com/bfgroup/b2/releases/download/5.3.1/b2-5.3.1.tar.bz2" + sha256: "55dbbb6fa42065ca7fae2671a8d37d2fb594b5845b5c28d8813e559825c2a398" + "5.3.2": + url: "https://github.com/bfgroup/b2/releases/download/5.3.2/b2-5.3.2.tar.bz2" + sha256: "881827649356dfa59caa30e169931424993c72a1626a502abb7ea474484eac26" diff --git a/recipes/b2/portable/conanfile.py b/recipes/b2/portable/conanfile.py index 829c74015b1ef..68803d254a16d 100644 --- a/recipes/b2/portable/conanfile.py +++ b/recipes/b2/portable/conanfile.py @@ -21,6 +21,8 @@ class B2Conan(ConanFile): url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch" + package_type = "application" + ''' * use_cxx_env: False, True @@ -63,10 +65,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'") @@ -90,6 +96,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) @@ -145,17 +154,24 @@ 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: envvars = VirtualBuildEnv(self).vars() - cxx = envvars.get("CXX") - if cxx: - command += f" --cxx={cxx}" - self._write_project_config(cxx) + cxx_env = envvars.get("CXX") + if cxx_env: + command += f" --cxx={cxx_env}" + self._write_project_config(cxx_env) + + cxxflags_env = envvars.get("CXXFLAGS") + if cxxflags_env: + cxxflags = f"{cxxflags} {cxxflags_env}" - cxxflags = envvars.get("CXXFLAGS") - if cxxflags: - command += f" --cxxflags={cxxflags}" + if cxxflags: + command += f' --cxxflags="{cxxflags}"' if b2_toolset != 'auto': command += " "+str(b2_toolset) @@ -179,6 +195,7 @@ def build(self): def package(self): copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.LICENSE", src=self._b2_engine_dir, dst=os.path.join(self.package_folder, "licenses")) copy(self, "*b2", dst=self._pkg_bin_dir, src=self._b2_output_dir) copy(self, "*b2.exe", dst=self._pkg_bin_dir, src=self._b2_output_dir) copy(self, "*.jam", dst=self._pkg_bin_dir, src=self._b2_output_dir) diff --git a/recipes/b2/portable/test_package/.gitignore b/recipes/b2/portable/test_package/.gitignore new file mode 100644 index 0000000000000..c97f963b3da62 --- /dev/null +++ b/recipes/b2/portable/test_package/.gitignore @@ -0,0 +1 @@ +*.sh diff --git a/recipes/b2/portable/test_v1_package/conanfile.py b/recipes/b2/portable/test_v1_package/conanfile.py deleted file mode 100644 index 53ed1a9a77b8b..0000000000000 --- a/recipes/b2/portable/test_v1_package/conanfile.py +++ /dev/null @@ -1,8 +0,0 @@ -from conan import ConanFile - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - self.run("b2 -v", run_environment=True) diff --git a/recipes/b64/all/test_v1_package/CMakeLists.txt b/recipes/b64/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/b64/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/b64/all/test_v1_package/conanfile.py b/recipes/b64/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/b64/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/backport-cpp/all/test_package/CMakeLists.txt b/recipes/backport-cpp/all/test_package/CMakeLists.txt index 2b33b3fe58289..56738fcfd7151 100644 --- a/recipes/backport-cpp/all/test_package/CMakeLists.txt +++ b/recipes/backport-cpp/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(Backport REQUIRED CONFIG) diff --git a/recipes/backport-cpp/all/test_v1_package/CMakeLists.txt b/recipes/backport-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7c4264b0a6d02..0000000000000 --- a/recipes/backport-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Backport REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE Backport::Backport) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/backport-cpp/all/test_v1_package/conanfile.py b/recipes/backport-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/backport-cpp/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_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/backward-cpp/all/conanfile.py b/recipes/backward-cpp/all/conanfile.py index 66cfef012cf47..e3b2633478277 100644 --- a/recipes/backward-cpp/all/conanfile.py +++ b/recipes/backward-cpp/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class BackwardCppConan(ConanFile): @@ -25,14 +25,14 @@ class BackwardCppConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "stack_walking": ["unwind", "libunwind", "backtrace"], - "stack_details": ["dw", "bfd", "dwarf", "backtrace_symbol"], + "stack_details": ["dw", "bfd", "backtrace_symbol", "dwarf"], } default_options = { "header_only": False, "shared": False, "fPIC": True, "stack_walking": "unwind", - "stack_details": "dwarf", + "stack_details": "dw", } @property @@ -79,14 +79,15 @@ def package_id(self): def requirements(self): if self.settings.os in ["Linux", "FreeBSD", "Android"]: if self._has_stack_walking("libunwind"): + # transitive_headers: backward.hpp:301 Requires unwind.h 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.190", transitive_headers=True) + # transitive_headers: backward.hpp:215 Requires elfuleils/libdw.h elfutils/libdwfl.h and dwarf.h + # transitive_libs: backward.hpp:1547 consumes dwarf_ranges() from libdw directly + self.requires("elfutils/0.190", transitive_headers=True, transitive_libs=True) if self._has_stack_details("bfd"): - self.requires("binutils/2.41", transitive_headers=True) + # transitive_headers: backward.hpp:205 Requires bfd.h + self.requires("binutils/2.42", transitive_headers=True) def validate(self): if self.settings.os not in self._supported_os: @@ -103,6 +104,10 @@ def validate(self): raise ConanInvalidConfiguration("Support for Apple Silicon is only available as of 1.6.") if not self._has_stack_details("backtrace_symbol"): raise ConanInvalidConfiguration("Stack details other than backtrace_symbol are not supported on macOS.") + if self._has_stack_details("dwarf"): + # INFO: backward-cpp consumes an old version of libdwarf which is API incompatible. + # See https://github.com/bombela/backward-cpp/issues/232 + raise ConanInvalidConfiguration("Stack details dwarf requires libdwarf <20191104 which is not available in Conan Center Index.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -111,17 +116,17 @@ 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") - tc.variables["STACK_DETAILS_DW"] = self._has_stack_details("dw") - tc.variables["STACK_DETAILS_BFD"] = self._has_stack_details("bfd") - tc.variables["STACK_DETAILS_DWARF"] = self._has_stack_details("dwarf") - tc.variables["BACKWARD_SHARED"] = self.options.shared - tc.variables["BACKWARD_TESTS"] = False - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.cache_variables["STACK_WALKING_UNWIND"] = self._has_stack_walking("unwind") + tc.cache_variables["STACK_WALKING_LIBUNWIND"] = self._has_stack_walking("libunwind") + tc.cache_variables["STACK_WALKING_BACKTRACE"] = self._has_stack_walking("backtrace") + tc.cache_variables["STACK_DETAILS_AUTO_DETECT"] = False + tc.cache_variables["STACK_DETAILS_BACKTRACE_SYMBOL"] = self._has_stack_details("backtrace_symbol") + tc.cache_variables["STACK_DETAILS_DW"] = self._has_stack_details("dw") + tc.cache_variables["STACK_DETAILS_BFD"] = self._has_stack_details("bfd") + tc.cache_variables["STACK_DETAILS_DWARF"] = False + tc.cache_variables["BACKWARD_SHARED"] = self.options.get_safe("shared", False) + tc.cache_variables["BACKWARD_TESTS"] = False + tc.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() deps = CMakeDeps(self) deps.generate() @@ -156,7 +161,7 @@ def package_info(self): 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_DWARF=0") self.cpp_info.defines.append(f"BACKWARD_HAS_PDB_SYMBOL={int(self.settings.os == 'Windows')}") if self.options.header_only: @@ -168,7 +173,3 @@ def package_info(self): self.cpp_info.system_libs.extend(["dl", "m"]) if self.settings.os == "Windows": self.cpp_info.system_libs.extend(["psapi", "dbghelp"]) - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "Backward" - self.cpp_info.names["cmake_find_package_multi"] = "Backward" diff --git a/recipes/backward-cpp/all/test_v1_package/CMakeLists.txt b/recipes/backward-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/backward-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/backward-cpp/all/test_v1_package/conanfile.py b/recipes/backward-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/backward-cpp/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_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/bacnet-stack/all/conandata.yml b/recipes/bacnet-stack/all/conandata.yml index d44111989de5e..41d4559c7823d 100644 --- a/recipes/bacnet-stack/all/conandata.yml +++ b/recipes/bacnet-stack/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.2": + url: "https://github.com/bacnet-stack/bacnet-stack/archive/refs/tags/bacnet-stack-1.3.2.tar.gz" + sha256: "e38cee9a96485692d5306bcd893ad02244efbecead12be8d2b2e3f3fc50328cb" "1.0.0": url: "https://github.com/bacnet-stack/bacnet-stack/archive/refs/tags/bacnet-stack-1.0.0.tar.gz" sha256: "8dad24decb3870bc8147a1ea5eecd5c6f8c1205ec48d5ae4d454085427122658" diff --git a/recipes/bacnet-stack/all/test_package/CMakeLists.txt b/recipes/bacnet-stack/all/test_package/CMakeLists.txt index ad98c1486c8f3..64b3ea22042cb 100644 --- a/recipes/bacnet-stack/all/test_package/CMakeLists.txt +++ b/recipes/bacnet-stack/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(bacnet-stack REQUIRED CONFIG) diff --git a/recipes/bacnet-stack/all/test_v1_package/CMakeLists.txt b/recipes/bacnet-stack/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/bacnet-stack/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bacnet-stack/all/test_v1_package/conanfile.py b/recipes/bacnet-stack/all/test_v1_package/conanfile.py deleted file mode 100644 index 6005bae433a02..0000000000000 --- a/recipes/bacnet-stack/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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): - bin_path = os.path.join("bin", "test_package") - bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/bacnet-stack/config.yml b/recipes/bacnet-stack/config.yml index c7f13630776fb..13d48541c0abc 100644 --- a/recipes/bacnet-stack/config.yml +++ b/recipes/bacnet-stack/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.2": + folder: "all" "1.0.0": folder: "all" diff --git a/recipes/baical-p7/all/conanfile.py b/recipes/baical-p7/all/conanfile.py index d193b92014a9d..0ac84fd55fb04 100644 --- a/recipes/baical-p7/all/conanfile.py +++ b/recipes/baical-p7/all/conanfile.py @@ -2,6 +2,8 @@ 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 +from conan.tools.scm import Version +from conan.errors import ConanException import os required_conan_version = ">=1.53.0" @@ -51,6 +53,9 @@ def generate(self): tc.variables["P7_TESTS_BUILD"] = False tc.cache_variables["P7_BUILD_SHARED"] = self.options.shared tc.variables["P7_EXAMPLES_BUILD"] = False + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "5.6": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): diff --git a/recipes/baical-p7/all/test_package/CMakeLists.txt b/recipes/baical-p7/all/test_package/CMakeLists.txt index 8eba5be9b5dc9..bbd4efeff41ee 100644 --- a/recipes/baical-p7/all/test_package/CMakeLists.txt +++ b/recipes/baical-p7/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(baical-p7 REQUIRED CONFIG) diff --git a/recipes/baical-p7/all/test_v1_package/CMakeLists.txt b/recipes/baical-p7/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/baical-p7/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/baical-p7/all/test_v1_package/conanfile.py b/recipes/baical-p7/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/baical-p7/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_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/bandit/all/test_package/CMakeLists.txt b/recipes/bandit/all/test_package/CMakeLists.txt index 58ffec4a070b7..9ce6f48fbe45f 100644 --- a/recipes/bandit/all/test_package/CMakeLists.txt +++ b/recipes/bandit/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(bandit REQUIRED CONFIG) diff --git a/recipes/bandit/all/test_v1_package/CMakeLists.txt b/recipes/bandit/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 08111eba078e8..0000000000000 --- a/recipes/bandit/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(bandit REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE bandit::bandit) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bandit/all/test_v1_package/conanfile.py b/recipes/bandit/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/bandit/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/base64/all/conandata.yml b/recipes/base64/all/conandata.yml index 05002bdfb4f04..f8a16e7db8b32 100644 --- a/recipes/base64/all/conandata.yml +++ b/recipes/base64/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/base64/all/test_package/CMakeLists.txt b/recipes/base64/all/test_package/CMakeLists.txt index d13d382a6be8a..40c4e92469802 100644 --- a/recipes/base64/all/test_package/CMakeLists.txt +++ b/recipes/base64/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(base64 REQUIRED CONFIG) diff --git a/recipes/base64/config.yml b/recipes/base64/config.yml index f6f488a641c0d..7e8cf882c17d0 100644 --- a/recipes/base64/config.yml +++ b/recipes/base64/config.yml @@ -1,4 +1,6 @@ versions: + "0.5.2": + folder: all "0.5.1": folder: all "0.5.0": diff --git a/recipes/basu/all/conandata.yml b/recipes/basu/all/conandata.yml new file mode 100644 index 0000000000000..3da511b3e486b --- /dev/null +++ b/recipes/basu/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "0.2.1": + url: "https://git.sr.ht/~emersion/basu/refs/download/v0.2.1/basu-0.2.1.tar.gz" + sha256: "d9b373a9fcb5d5eb5f6c1c56355f76edb7f2f52bc744570e80604e83455a19bd" + +patches: + "0.2.1": + - patch_file: "patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch" + patch_description: "add missing header to support old glibc" + patch_type: "portability" + patch_source: "https://lists.sr.ht/~emersion/public-inbox/patches/49899" diff --git a/recipes/basu/all/conanfile.py b/recipes/basu/all/conanfile.py new file mode 100644 index 0000000000000..5fbf09d93352b --- /dev/null +++ b/recipes/basu/all/conanfile.py @@ -0,0 +1,97 @@ +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 BasuConan(ConanFile): + name = "basu" + description = "The sd-bus library, extracted from systemd" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://git.sr.ht/~emersion/basu" + topics = ("dbus", "sd-bus", "systemd") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libcap": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libcap": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os != "Linux": + del self.options.with_libcap + + 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.get_safe("with_libcap"): + self.requires("libcap/2.69") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration( + f"{self.ref} does not support {self.settings.os}") + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + self.tool_requires("gperf/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): + feature = lambda option: "enabled" if option else "disabled" + + tc = MesonToolchain(self) + tc.project_options["auto_features"] = "disabled" + tc.project_options["libcap"] = feature(self.options.get_safe("with_libcap")) + 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, "LICENSE.LGPL2.1", 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 = ["basu"] + self.cpp_info.set_property("pkg_config_name", "basu") + self.cpp_info.system_libs.extend(["m", "pthread", "rt"]) diff --git a/recipes/basu/all/patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch b/recipes/basu/all/patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch new file mode 100644 index 0000000000000..69e899279f1ae --- /dev/null +++ b/recipes/basu/all/patches/0001-memfd-util.c-Use-F_ADD_SEALS-definition-from-missing.patch @@ -0,0 +1,34 @@ +From 8e4960e8b9d11d9be96e83b02bd3b08178ddce1b Mon Sep 17 00:00:00 2001 +From: Sergey Bobrenok +Date: Wed, 28 Feb 2024 20:42:19 +0300 +Subject: [PATCH basu] memfd-util.c: Use F_ADD_SEALS definition from missing.h + +uClibc and glibc (until version 2.27, 2018) implementations don't +support F_ADD_SEALS and other F_SEAL_xxx flags. +'missing.h' was removed from 'memfd-util.c' in 37dbb2fcb ("Remove +useless includes"). + +Upstream: https://lists.sr.ht/~emersion/public-inbox/patches/49899 + +Signed-off-by: Sergey Bobrenok +--- + src/basic/memfd-util.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/basic/memfd-util.c b/src/basic/memfd-util.c +index 89893ba..7e535c6 100644 +--- a/src/basic/memfd-util.c ++++ b/src/basic/memfd-util.c +@@ -7,6 +7,7 @@ + + #include "alloc-util.h" + #include "memfd-util.h" ++#include "missing.h" + + int memfd_set_sealed(int fd) { + #if defined(__FreeBSD__) && __FreeBSD__ < 13 + +base-commit: 684a41d68cfbb05e38aacb60a8548e21ddfbecdb +-- +2.44.0 + diff --git a/recipes/basu/all/test_package/conanfile.py b/recipes/basu/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cdcf9b281723d --- /dev/null +++ b/recipes/basu/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.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + 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/basu/all/test_package/meson.build b/recipes/basu/all/test_package/meson.build new file mode 100644 index 0000000000000..adf0ed21b4bcd --- /dev/null +++ b/recipes/basu/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('basu') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/basu/all/test_package/test_package.c b/recipes/basu/all/test_package/test_package.c new file mode 100644 index 0000000000000..9fe70e4d4a1ce --- /dev/null +++ b/recipes/basu/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include +#include + +#include + +int main(void) { + char *id = NULL; + int ret = 0; + + puts("decode object path"); + ret = sd_bus_path_decode("/foo/bar", "/foo", &id); + free(id); + if (ret > 0) { + puts("ok"); + return EXIT_SUCCESS; + } + puts("failed"); + return EXIT_FAILURE; +} diff --git a/recipes/basu/config.yml b/recipes/basu/config.yml new file mode 100644 index 0000000000000..f975c1e3261f7 --- /dev/null +++ b/recipes/basu/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.1": + folder: all diff --git a/recipes/battery-embed/all/conandata.yml b/recipes/battery-embed/all/conandata.yml new file mode 100644 index 0000000000000..b94490b90ffc3 --- /dev/null +++ b/recipes/battery-embed/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.19": + url: "https://github.com/batterycenter/embed/archive/refs/tags/v1.2.19.tar.gz" + sha256: "d472655b6eec215cd7cd20411f3596f22f597ea6a82fbbc5a5d7271e102b610e" diff --git a/recipes/battery-embed/all/conanfile.py b/recipes/battery-embed/all/conanfile.py new file mode 100644 index 0000000000000..42b1dc0f23c98 --- /dev/null +++ b/recipes/battery-embed/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.files import copy, get +from conan.tools.cmake import cmake_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class BatteryEmbedConan(ConanFile): + name = "battery-embed" + description = "A CMake/C++20 library to embed resource files at compile time" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/batterycenter/embed" + topics = ("embed") + package_type = "build-scripts" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "apple-clang": "13", + "Visual Studio": "16", + "msvc": "192", + } + + def export_sources(self): + copy(self, "embed.cmake", src=self.recipe_folder, dst=self.export_sources_folder) + + 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 package_id(self): + del self.info.settings.arch + del self.info.settings.compiler + del self.info.settings.build_type + del self.info.settings.os + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + copy(self, "embed.cmake", os.path.join(self.source_folder, os.pardir), self.recipe_folder) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "embed.cmake", self.recipe_folder, os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "CMakeLists.txt", self.source_folder, os.path.join(self.package_folder, "lib", "cmake", "battery-embed")) + + def package_info(self): + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] + self.cpp_info.includedirs = [] + + self.cpp_info.set_property("cmake_target_name", "battery::embed") + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "cmake", "embed.cmake")]) diff --git a/recipes/battery-embed/all/embed.cmake b/recipes/battery-embed/all/embed.cmake new file mode 100644 index 0000000000000..59fe1f00e55a0 --- /dev/null +++ b/recipes/battery-embed/all/embed.cmake @@ -0,0 +1,4 @@ +# cmake proxy module +cmake_minimum_required(VERSION 3.21) + +add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/battery-embed battery-embed-build) diff --git a/recipes/battery-embed/all/test_package/CMakeLists.txt b/recipes/battery-embed/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b5eb771902175 --- /dev/null +++ b/recipes/battery-embed/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(battery-embed REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +b_embed(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/battery-embed/all/test_package/conanfile.py b/recipes/battery-embed/all/test_package/conanfile.py new file mode 100644 index 0000000000000..065416112515f --- /dev/null +++ b/recipes/battery-embed/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_requirements(self): + self.tool_requires("cmake/[>=3.21 <4]") + + 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/battery-embed/all/test_package/test_package.cpp b/recipes/battery-embed/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..feb15d322e7f2 --- /dev/null +++ b/recipes/battery-embed/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include "battery/embed.hpp" + +int main(void) { + std::cout << b::embed<"test_package.cpp">() << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/battery-embed/config.yml b/recipes/battery-embed/config.yml new file mode 100644 index 0000000000000..a18e338f675d9 --- /dev/null +++ b/recipes/battery-embed/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.19": + folder: all diff --git a/recipes/bazel/all/conandata.yml b/recipes/bazel/all/conandata.yml index 36326bd6f856a..554c60438f66f 100644 --- a/recipes/bazel/all/conandata.yml +++ b/recipes/bazel/all/conandata.yml @@ -1,4 +1,82 @@ sources: + "7.2.1": + license: + url: "https://raw.githubusercontent.com/bazelbuild/bazel/7.2.1/LICENSE" + sha256: "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + Macos: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/7.2.1/bazel-7.2.1-darwin-x86_64" + sha256: "2c29176d6ce9ccdd16d5a15e348c756abd6e0005c77d4695b61871219295fa96" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/7.2.1/bazel-7.2.1-darwin-arm64" + sha256: "6ac72cd7c0b422e3e8162a6912f963ddee45c645bf7dadb924728a80076c38b2" + Linux: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/7.2.1/bazel-7.2.1-linux-x86_64" + sha256: "80ccd1ecb4b88750fbe5d7622d67072fddcba9da7808f13356555e480bf67875" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/7.2.1/bazel-7.2.1-linux-arm64" + sha256: "5a4cc979353671e438b9469b833924c2361e25a580cc278a75877aedc27c1c53" + Windows: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/7.2.1/bazel-7.2.1-windows-x86_64.exe" + sha256: "4926bd3bf580b8b3323e0d09bde5dc6120fdd262d99f753eb61fedfb9a2cfc49" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/7.2.1/bazel-7.2.1-windows-arm64.exe" + sha256: "d8b1a0da1c6e9d94a5ac4a2728d344e496c32e68cf27ed6a2c117d38fa994fc8" + + "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.5.0": + license: + url: "https://raw.githubusercontent.com/bazelbuild/bazel/6.5.0/LICENSE" + sha256: "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + Macos: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-darwin-x86_64" + sha256: "bbf9c2c03bac48e0514f46db0295027935535d91f6d8dcd960c53393559eab29" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-darwin-arm64" + sha256: "c6b6dc17efcdf13fba484c6fe0b6c3361b888ae7b9573bc25a2dbe8c502448eb" + Linux: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-linux-x86_64" + sha256: "a40ac69263440761199fcb8da47ad4e3f328cbe79ffbf4ecc14e5ba252857307" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-linux-arm64" + sha256: "5afe973cadc036496cac66f1414ca9be36881423f576db363d83afc9084c0c2f" + Windows: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-windows-x86_64.exe" + sha256: "6eae8e7f28e1b68b833503d1a58caf139c11e52de19df0d787d974653a0ea4c6" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-windows-arm64.exe" + sha256: "b40d2ab8aa0b8413b2bdd599ec1c571d09714275f35ba476e89b3fca6857a937" + "6.2.0": license: url: "https://raw.githubusercontent.com/bazelbuild/bazel/6.2.0/LICENSE" @@ -25,6 +103,55 @@ sources: 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.2.4": + license: + url: "https://raw.githubusercontent.com/bazelbuild/bazel/4.2.4/LICENSE" + sha256: "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" + Macos: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/4.2.4/bazel-4.2.4-darwin-x86_64" + sha256: "84e5c594ce4c1d4354b68c90f6e81eb3a7d89737f60c3e3f4a689212d984dbc6" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/4.2.4/bazel-4.2.4-darwin-arm64" + sha256: "6bc6acf5049f8ac78d083dce9538bade04186e56157e21330b0d565575547759" + Linux: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/4.2.4/bazel-4.2.4-linux-x86_64" + sha256: "29921e744399018efa0038bb770d2d11c77457e9162e5dcb58e6e11ab2bca7d3" + armv8: + url: "https://github.com/bazelbuild/bazel/releases/download/4.2.4/bazel-4.2.4-linux-arm64" + sha256: "1479d683ac64b8b4d8fc07f72da1c58914f4ef1113412beaa421b341b947a3dd" + Windows: + x86_64: + url: "https://github.com/bazelbuild/bazel/releases/download/4.2.4/bazel-4.2.4-windows-x86_64.exe" + sha256: "92103ac197fa53883e0671fbfda77b435619f94279fabf0694ec8623959348f8" + "4.0.0": license: url: "https://raw.githubusercontent.com/bazelbuild/bazel/4.0.0/LICENSE" diff --git a/recipes/bazel/config.yml b/recipes/bazel/config.yml index e55e6b68a69ee..51015201a5c54 100644 --- a/recipes/bazel/config.yml +++ b/recipes/bazel/config.yml @@ -1,5 +1,15 @@ versions: + "7.2.1": + folder: all + "7.0.0": + folder: all + "6.5.0": + folder: all "6.2.0": folder: all + "5.4.1": + folder: all + "4.2.4": + folder: all "4.0.0": folder: all diff --git a/recipes/bdwgc/all/conandata.yml b/recipes/bdwgc/all/conandata.yml index 8dfe6c5a2d882..3e842ffa56b67 100644 --- a/recipes/bdwgc/all/conandata.yml +++ b/recipes/bdwgc/all/conandata.yml @@ -11,6 +11,12 @@ sources: "8.2.4": url: "https://github.com/ivmai/bdwgc/releases/download/v8.2.4/gc-8.2.4.tar.gz" sha256: "3d0d3cdbe077403d3106bb40f0cbb563413d6efdbb2a7e1cd6886595dec48fc2" + "8.2.6": + url: "https://github.com/ivmai/bdwgc/releases/download/v8.2.6/gc-8.2.6.tar.gz" + sha256: "b9183fe49d4c44c7327992f626f8eaa1d8b14de140f243edb1c9dcff7719a7fc" + "8.2.8": + url: "https://github.com/ivmai/bdwgc/releases/download/v8.2.8/gc-8.2.8.tar.gz" + sha256: "7649020621cb26325e1fb5c8742590d92fb48ce5c259b502faf7d9fb5dabb160" patches: "8.0.4": - patch_file: "patches/update-cmake-8_0_4.patch" @@ -20,3 +26,7 @@ patches: - patch_file: "patches/update-cmake-8_2_2.patch" "8.2.4": - patch_file: "patches/update-cmake-8_2_4.patch" + "8.2.6": + - patch_file: "patches/update-cmake-8_2_6.patch" + "8.2.8": + - patch_file: "patches/update-cmake-8_2_6.patch" diff --git a/recipes/bdwgc/all/conanfile.py b/recipes/bdwgc/all/conanfile.py index 304326f5fe9b1..d284939f26c40 100644 --- a/recipes/bdwgc/all/conanfile.py +++ b/recipes/bdwgc/all/conanfile.py @@ -77,7 +77,7 @@ def layout(self): def requirements(self): if self.settings.os == "Windows": - self.requires("libatomic_ops/7.8.0") + 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_6.patch b/recipes/bdwgc/all/patches/update-cmake-8_2_6.patch new file mode 100644 index 0000000000000..1ae810763c0db --- /dev/null +++ b/recipes/bdwgc/all/patches/update-cmake-8_2_6.patch @@ -0,0 +1,15 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -177,6 +177,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/CMakeLists.txt b/recipes/bdwgc/all/test_package/CMakeLists.txt index 6b8623ba2be96..149cd7ed4efc7 100644 --- a/recipes/bdwgc/all/test_package/CMakeLists.txt +++ b/recipes/bdwgc/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(BDWgc CONFIG REQUIRED) diff --git a/recipes/bdwgc/all/test_v1_package/CMakeLists.txt b/recipes/bdwgc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8ab3169f9e927..0000000000000 --- a/recipes/bdwgc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(BDWgc REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE BDWgc::gc) diff --git a/recipes/bdwgc/all/test_v1_package/conanfile.py b/recipes/bdwgc/all/test_v1_package/conanfile.py deleted file mode 100644 index dfe389167a895..0000000000000 --- a/recipes/bdwgc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, CMake -from conan.tools.build import cross_building - - -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 cross_building(self): - self.run(os.path.join("bin","test_package"), run_environment=True) diff --git a/recipes/bdwgc/config.yml b/recipes/bdwgc/config.yml index b018b2961234b..2171a77e5a1a9 100644 --- a/recipes/bdwgc/config.yml +++ b/recipes/bdwgc/config.yml @@ -7,3 +7,7 @@ versions: folder: all "8.2.4": folder: all + "8.2.6": + folder: all + "8.2.8": + folder: all diff --git a/recipes/beauty/all/conandata.yml b/recipes/beauty/all/conandata.yml index 67db3d5af7757..42c96b3a5b488 100644 --- a/recipes/beauty/all/conandata.yml +++ b/recipes/beauty/all/conandata.yml @@ -1,7 +1,27 @@ sources: - "1.0.0-rc1": - url: "https://github.com/dfleury2/beauty/archive/refs/tags/1.0.0-rc1.tar.gz" - sha256: "e5c0cdffd9324ed0cbe771a4aaff3a572ec553dc0275bbaf4db754ce043ecf49" + "1.0.4": + url: "https://github.com/dfleury2/beauty/archive/refs/tags/1.0.4.tar.gz" + sha256: "8bfd3718470bdbed05b6b9253543d6ab9b33e21e25028e53fa513c67893a39f3" + "1.0.3": + url: "https://github.com/dfleury2/beauty/archive/refs/tags/1.0.3.tar.gz" + sha256: "1707b0974537cfd8d1d2fd0b5accd5a662c0b408042aa01384cf5840ecc43594" + "1.0.2": + url: "https://github.com/dfleury2/beauty/archive/refs/tags/1.0.2.tar.gz" + sha256: "627294d04a91c85e14d9c29475d539da5172c6d7306a48dca7c72413e47eebd6" patches: - "1.0.0-rc1": - - patch_file: "patches/0001-fix-cmake.patch" + "1.0.4": + - patch_file: "patches/0002-remove-openssl-target.patch" + patch_description: "Avoid defining openssl::openssl target when defined by Conan" + patch_type: "conan" + "1.0.3": + - patch_file: "patches/0002-remove-openssl-target.patch" + patch_description: "Avoid defining openssl::openssl target when defined by Conan" + patch_type: "conan" + "1.0.2": + - patch_file: "patches/0001-apple-compatibility.patch" + patch_description: "Handle pthread_setname_np not being defined on macOS" + patch_type: "portability" + patch_source: "https://github.com/dfleury2/beauty/pull/28" + - patch_file: "patches/0002-remove-openssl-target.patch" + patch_description: "Avoid defining openssl::openssl target when defined by Conan" + patch_type: "conan" diff --git a/recipes/beauty/all/conanfile.py b/recipes/beauty/all/conanfile.py index 2c01e08705dd5..f8b9acb4c99ef 100644 --- a/recipes/beauty/all/conanfile.py +++ b/recipes/beauty/all/conanfile.py @@ -2,6 +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.env import VirtualBuildEnv 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 @@ -12,34 +13,36 @@ class BeautyConan(ConanFile): name = "beauty" - homepage = "https://github.com/dfleury2/beauty" description = "HTTP Server above Boost.Beast" - topics = ("http", "server", "boost.beast") - url = "https://github.com/conan-io/conan-center-index" license = "MIT" - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dfleury2/beauty" + topics = ("http", "server", "boost.beast") 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": True, } @property def _min_cppstd(self): - return "20" + return "17" @property def _compilers_minimum_version(self): return { "gcc": "8", - "clang": "11", + "clang": "7", "Visual Studio": "16", "msvc": "192", + "apple-clang": "10" } def export_sources(self): @@ -59,9 +62,14 @@ def layout(self): def requirements(self): # 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) + if Version(self.version) >= "1.0.4": + # https://github.com/dfleury2/beauty/issues/30 + self.requires("boost/1.85.0", transitive_headers=True) + else: + self.requires("boost/1.84.0", transitive_headers=True) + if self.options.with_openssl: + # 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"): @@ -74,19 +82,25 @@ def validate(self): ) if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++": - raise ConanInvalidConfiguration("Only libc++ is supported for clang") + raise ConanInvalidConfiguration(f"{self.ref} clang compiler requires -s compiler.libcxx=libc++") if self.settings.compiler == "apple-clang" and self.options.shared: - raise ConanInvalidConfiguration("shared is not supported on apple-clang") + raise ConanInvalidConfiguration(f"The option {self.ref}:shared=True is not supported on Apple Clang. Use static instead.") if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration("shared is not supported on Visual Studio") + raise ConanInvalidConfiguration(f"{self.ref} shared=True is not supported with {self.settings.compiler}") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.21 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + VirtualBuildEnv(self).generate() tc = CMakeToolchain(self) + tc.variables["CONAN"] = False + tc.variables["BEAUTY_ENABLE_OPENSSL"] = self.options.with_openssl tc.generate() deps = CMakeDeps(self) deps.generate() @@ -107,6 +121,12 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "beauty") self.cpp_info.set_property("cmake_target_name", "beauty::beauty") self.cpp_info.libs = ["beauty"] - self.cpp_info.requires = ["boost::headers", "openssl::openssl"] + self.cpp_info.requires = ["boost::headers"] + if self.options.with_openssl: + self.cpp_info.requires.append("openssl::ssl") if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["m"] + self.cpp_info.system_libs = ["m", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["crypt32"] + if self.options.with_openssl: + self.cpp_info.defines = ["BEAUTY_ENABLE_OPENSSL"] diff --git a/recipes/beauty/all/patches/0001-apple-compatibility.patch b/recipes/beauty/all/patches/0001-apple-compatibility.patch new file mode 100644 index 0000000000000..8471b95a69d52 --- /dev/null +++ b/recipes/beauty/all/patches/0001-apple-compatibility.patch @@ -0,0 +1,22 @@ +From 3af29b660d623e8d7051e5392395c25712037a6a Mon Sep 17 00:00:00 2001 +From: Martin Valgur +Date: Wed, 17 Jan 2024 13:29:49 +0200 +Subject: [PATCH] Fix handling of pthread_setname_np on macOS + +--- + src/utils.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/utils.cpp b/src/utils.cpp +index eb15b68..72966c2 100644 +--- a/src/utils.cpp ++++ b/src/utils.cpp +@@ -191,7 +191,7 @@ make_uuid() + //--------------------------------------------------------------------------- + void + thread_set_name(const std::string& name) { +-#ifdef LINUX ++#if LINUX && _GNU_SOURCE + constexpr int TASK_COMM_LEN = 16; + + char thread_name[TASK_COMM_LEN] = ""; diff --git a/recipes/beauty/all/patches/0001-fix-cmake.patch b/recipes/beauty/all/patches/0001-fix-cmake.patch deleted file mode 100644 index 6bdf75a96f54e..0000000000000 --- a/recipes/beauty/all/patches/0001-fix-cmake.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.15) - project(Beauty) - set(VERSION 0.1-rc) - -+if(0) - if (CONAN_EXPORTED) - else() - if (NOT EXISTS ${CMAKE_BINARY_DIR}/conan_toolchain.cmake) -@@ -20,6 +21,7 @@ else() - endif() - - include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake) -+endif() - - # C++ - set(CMAKE_CXX_STANDARD 20) diff --git a/recipes/beauty/all/patches/0002-remove-openssl-target.patch b/recipes/beauty/all/patches/0002-remove-openssl-target.patch new file mode 100644 index 0000000000000..28cfd66f4489f --- /dev/null +++ b/recipes/beauty/all/patches/0002-remove-openssl-target.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7cc5bda..12a5e71 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,7 +27,6 @@ else() + + if (BEAUTY_ENABLE_OPENSSL) + find_package(OpenSSL REQUIRED) +- add_library(openssl::openssl ALIAS OpenSSL::SSL) + endif() + endif() + diff --git a/recipes/beauty/all/test_package/CMakeLists.txt b/recipes/beauty/all/test_package/CMakeLists.txt index 8673671fd5aab..0ea5c87314d7a 100644 --- a/recipes/beauty/all/test_package/CMakeLists.txt +++ b/recipes/beauty/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(beauty REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE beauty::beauty) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/beauty/all/test_v1_package/CMakeLists.txt b/recipes/beauty/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/beauty/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/beauty/all/test_v1_package/conanfile.py b/recipes/beauty/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/beauty/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_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/beauty/config.yml b/recipes/beauty/config.yml index ca2cfd0e152c6..55b20570619c0 100644 --- a/recipes/beauty/config.yml +++ b/recipes/beauty/config.yml @@ -1,3 +1,7 @@ versions: - "1.0.0-rc1": + "1.0.4": + folder: all + "1.0.3": + folder: all + "1.0.2": folder: all diff --git a/recipes/behaviortree.cpp/all/conan_deps.cmake b/recipes/behaviortree.cpp/all/conan_deps.cmake new file mode 100644 index 0000000000000..1bfd028b22003 --- /dev/null +++ b/recipes/behaviortree.cpp/all/conan_deps.cmake @@ -0,0 +1,16 @@ +# Inject unvendored dependencies provided by Conan + +if(WITH_LEXY) + find_package(lexy REQUIRED CONFIG) + link_libraries(foonathan::lexy) +endif() + +if(WITH_MINITRACE) + find_package(minitrace REQUIRED CONFIG) + link_libraries(minitrace::minitrace) +endif() + +if(WITH_TINYXML2) + find_package(tinyxml2 REQUIRED CONFIG) + link_libraries(tinyxml2::tinyxml2) +endif() diff --git a/recipes/behaviortree.cpp/all/conandata.yml b/recipes/behaviortree.cpp/all/conandata.yml index 8e188b3097d43..38e09ddf41730 100644 --- a/recipes/behaviortree.cpp/all/conandata.yml +++ b/recipes/behaviortree.cpp/all/conandata.yml @@ -1,28 +1,27 @@ sources: + "4.6.2": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.6.2.tar.gz" + sha256: "b0e7e53b27feae894e2df3f3faadfdd49f2108ebccfb1bd7cc0d405ffc56cecd" + "4.6.1": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.6.1.tar.gz" + sha256: "a4e0dd92b200eedfbc6a16bebe613aeeb84b685416211b68fd097d21254f324b" + "4.6.0": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.6.0.tar.gz" + sha256: "b24fed4f51212ea40bc492f7d4a310b1672bc05df6a83f2341c41ccf233307a9" + "4.5.2": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.5.2.tar.gz" + sha256: "1aaac034fc6a2f03d9347934e3baf3cabd5edc8bb416b9d7f5d944598019aeb9" "4.0.1": url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.0.1.tar.gz" sha256: "71544f72abea8e8c246b016b7e8d87d96f731c8aa96698058d8e69d40e56f9b9" + "3.8.6": + url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/3.8.6.tar.gz" + sha256: "df01713e61aa3b6f4a637dcff31dfd3c96c3c05fac226da8566a873a24ccde27" "3.7.0": url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/3.7.0.tar.gz" sha256: "ab0d8ac1a0df4dd43cf45da8a784bab7fdedf711bd0e227f7ed071f79b0c7b5c" - "3.5.6": - url: "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/3.5.6.tar.gz" - sha256: "543c428602b5acb7c5666aee34feb532e18ce7200870a79b23ff9aed17ee84c4" patches: - "4.0.1": - - patch_file: "patches/4.0.1-0001-remove-fpic.patch" - - patch_file: "patches/4.0.1-0002-find-zmq.patch" - - patch_file: "patches/4.0.1-0003-no-werror.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" - "3.7.0": - - patch_file: "patches/3.7.0-0001-remove-fpic.patch" - - patch_file: "patches/3.7.0-0002-find-zmq.patch" - - patch_file: "patches/3.7.0-0003-no-werror.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" - "3.5.6": - - patch_file: "patches/3.5.6-0001-remove-fpic.patch" - - patch_file: "patches/3.5.6-0002-find-zmq.patch" - - patch_file: "patches/3.5.6-0003-no-werror.patch" - - patch_file: "patches/3.5.6-0004-win-sigaction.patch" - - patch_file: "patches/3.5.6-0005-stdc-format.patch" + "4.6.2": + - patch_file: "patches/001-minitrace.patch" + patch_description: "Consume minitrace from Conan" + patch_type: "conan" diff --git a/recipes/behaviortree.cpp/all/conanfile.py b/recipes/behaviortree.cpp/all/conanfile.py index 54f5ae5ad8322..df11b679e6fcb 100644 --- a/recipes/behaviortree.cpp/all/conanfile.py +++ b/recipes/behaviortree.cpp/all/conanfile.py @@ -1,10 +1,11 @@ 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.env import VirtualBuildEnv +from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm +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 export_conandata_patches, apply_conandata_patches import os @@ -17,45 +18,78 @@ class BehaviorTreeCPPConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/BehaviorTree/BehaviorTree.CPP" topics = ("ai", "robotics", "games", "coordination") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "with_tools": [True, False], "with_coroutines": [True, False], + "enable_groot_interface": [True, False], + "enable_sqlite_logging": [True, False], + "enable_manual_selector": [True, False], + "use_v3_compatible_names": [True, False], } default_options = { "shared": False, "fPIC": True, "with_tools": False, "with_coroutines": False, + "enable_groot_interface": True, + "enable_sqlite_logging": True, + "enable_manual_selector": False, + "use_v3_compatible_names": False, + } + options_description = { + "with_tools": "Build commandline tools", + "with_coroutines": "Enable Boost coroutines", + "enable_groot_interface": "Add Groot2 connection (requires ZeroMQ)", + "enable_sqlite_logging": "Add SQLite logging", + "enable_manual_selector": "Build manual selector node", + "use_v3_compatible_names": "Use v3 compatible names", } @property def _minimum_cppstd_required(self): - return 14 if Version(self.version) < "4.0" else 17 + if Version(self.version) >= "4.0": + return 17 + return 14 @property def _minimum_compilers_version(self): - if Version(self.version) < "4.0": + if Version(self.version) >= "4.0": return { - "gcc": "5", - "clang": "5", + "gcc": "8", + "clang": "7", "apple-clang": "12", + "msvc": "192", + "Visual Studio": "16", } else: return { - "gcc": "8", - "clang": "7", + "gcc": "5", + "clang": "5", "apple-clang": "12", + "msvc": "191", + "Visual Studio": "15", } def export_sources(self): export_conandata_patches(self) + copy(self, "conan_deps.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 + if Version(self.version) < "4.0": + del self.options.use_v3_compatible_names + if Version(self.version) >= "4.1.0": + del self.options.with_coroutines + if Version(self.version) >= "4.1.1": + del self.options.enable_manual_selector + else: + del self.options.enable_groot_interface + del self.options.enable_sqlite_logging def configure(self): if self.options.shared: @@ -64,54 +98,153 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + @property + def _with_boost(self): + return self.options.get_safe("with_coroutines", False) + + @property + def _with_lexy(self): + # FIXME: using vendored version temporarily due to a missing CCI binary + # return Version(self.version) >= "4.0.0" + return False + + @property + def _with_minitrace(self): + return Version(self.version) >= "4.3.4" + + @property + def _with_ncurses(self): + return self.options.get_safe("enable_manual_selector", False) + + @property + def _with_sqlite3(self): + return self.options.get_safe("enable_sqlite_logging", False) + + @property + def _with_tinyxml2(self): + return Version(self.version) >= "4.0.0" + + @property + def _with_zeromq(self): + if Version(self.version) >= "4.1.1": + return self.options.enable_groot_interface + return Version(self.version) >= "4.0.0" + def requirements(self): - if self.options.with_coroutines: - self.requires("boost/1.80.0") - self.requires("ncurses/6.3") - self.requires("zeromq/4.3.4") - self.requires("cppzmq/4.9.0") + if self._with_boost: + self.requires("boost/1.83.0") + if self._with_ncurses: + self.requires("ncurses/6.4") + if self._with_lexy: + self.requires("foonathan-lexy/2022.12.1") + if self._with_minitrace: + self.requires("minitrace/cci.20230905") + if self._with_sqlite3: + self.requires("sqlite3/3.44.2") + if self._with_tinyxml2: + self.requires("tinyxml2/10.0.0") + if self._with_zeromq: + self.requires("zeromq/4.3.5") + + # TODO: other vendored dependencies + # - cppzmq is customized and not compatible with Conan version + # - cpp-sqlite + # - minicoro + # - wildcards def validate(self): if self.info.settings.os == "Windows" and self.info.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Windows.") if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cppstd_required) - check_min_vs(self, 191 if Version(self.version) < "4.0" else 192) - if not is_msvc(self): - minimum_version = self._minimum_compilers_version.get(str(self.info.settings.compiler), False) - if not minimum_version: - self.output.warn(f"{self.ref} requires C++{self._minimum_cppstd_required}. Your compiler is unknown. Assuming it supports C++{self._minimum_cppstd_required}.") - elif Version(self.info.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("BehaviorTree.CPP requires C++{}, which your compiler does not support." - .format(self._minimum_cppstd_required)) + minimum_version = self._minimum_compilers_version.get(str(self.info.settings.compiler), False) + if not minimum_version: + self.output.warn(f"{self.ref} requires C++{self._minimum_cppstd_required}. " + f"Your compiler is unknown. Assuming it supports C++{self._minimum_cppstd_required}.") + elif Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"BehaviorTree.CPP requires C++{self._minimum_cppstd_required}, which your compiler does not support." + ) if self.settings.compiler == "clang" and str(self.settings .compiler.libcxx) == "libstdc++": raise ConanInvalidConfiguration(f"{self.ref} needs recent libstdc++ with charconv. please switch to gcc, or to libc++") + if self.settings.compiler == "apple-clang" and cross_building(self) and self.settings.arch in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"Cross-compiling for {self.settings.arch} is not yet supported. Contributions are welcome!") + + def build_requirements(self): + if Version(self.version) >= "4.1.0": + self.tool_requires("cmake/[>=3.16.3 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_behaviortree_cpp_INCLUDE"] = "conan_deps.cmake" + tc.variables["WITH_LEXY"] = self._with_lexy + tc.variables["WITH_MINITRACE"] = self._with_minitrace + tc.variables["WITH_TINYXML2"] = self._with_tinyxml2 + if not self.options.get_safe("enable_manual_selector"): + # Avoid accidental use of system ncurses + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Curses"] = True if Version(self.version) < "4.0": tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_UNIT_TESTS"] = False tc.variables["BUILD_TOOLS"] = self.options.with_tools tc.variables["ENABLE_COROUTINES"] = self.options.with_coroutines + tc.variables["BUILD_MANUAL_SELECTOR"] = self.options.get_safe("enable_manual_selector", False) else: tc.variables["BTCPP_SHARED_LIBS"] = self.options.shared tc.variables["BTCPP_EXAMPLES"] = False tc.variables["BTCPP_UNIT_TESTS"] = False tc.variables["BTCPP_BUILD_TOOLS"] = self.options.with_tools - tc.variables["BTCPP_ENABLE_COROUTINES"] = self.options.with_coroutines + tc.variables["BTCPP_ENABLE_COROUTINES"] = self.options.get_safe("with_coroutines", False) + tc.variables["BTCPP_MANUAL_SELECTOR"] = self.options.get_safe("enable_manual_selector", False) + tc.variables["BTCPP_GROOT_INTERFACE"] = self.options.get_safe("enable_groot_interface", False) + tc.variables["BTCPP_SQLITE_LOGGING"] = self.options.get_safe("enable_sqlite_logging", False) + tc.variables["USE_V3_COMPATIBLE_NAMES"] = self.options.use_v3_compatible_names tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "4.1.0": + deps.set_property("zeromq", "cmake_file_name", "ZeroMQ") + else: + deps.set_property("zeromq", "cmake_file_name", "ZMQ") deps.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + # Let Conan handle -fPIC + replace_in_file(self, cmakelists, "set(CMAKE_POSITION_INDEPENDENT_CODE ON)\n", "") + # Unvendor lexy + if self._with_lexy: + rmdir(self, os.path.join(self.source_folder, "3rdparty", "lexy")) + save(self, os.path.join(self.source_folder, "3rdparty", "lexy", "CMakeLists.txt"), "") + # Unvendor minitrace + if self._with_minitrace: + rmdir(self, os.path.join(self.source_folder, "3rdparty", "minitrace")) + if Version(self.version) < "4.6.2": + # INFO: Version 4.6.2 removed minitrace via patch file 001-minitrace.patch + replace_in_file(self, cmakelists, "3rdparty/minitrace/minitrace.cpp", "") + replace_in_file(self, os.path.join(self.source_folder, "src", "loggers", "bt_minitrace_logger.cpp"), + "minitrace/minitrace.h", "minitrace.h") + # Unvendor tinyxml2 + if self._with_tinyxml2: + rmdir(self, os.path.join(self.source_folder, "3rdparty", "tinyxml2")) + replace_in_file(self, cmakelists, "3rdparty/tinyxml2/tinyxml2.cpp", "") + replace_in_file(self, os.path.join(self.source_folder, "src", "xml_parsing.cpp"), + "tinyxml2/tinyxml2.h", "tinyxml2.h") + # Ensure ZeroMQ and other packages are provided by Conan + rm(self, "Find*.cmake", os.path.join(self.source_folder, "cmake")) + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -125,39 +258,48 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - if Version(self.version) < "4.0": - self.cpp_info.set_property("cmake_file_name", "BehaviorTreeV3") + if Version(self.version) >= "4.0": + cmake_file_name = "BehaviorTree" + libname = "behaviortree_cpp" else: - self.cpp_info.set_property("cmake_file_name", "BehaviorTree") - - libname = "behaviortree_cpp_v3" if Version(self.version) < "4.0" else "behaviortree_cpp" + cmake_file_name = "BehaviorTreeV3" + libname = "behaviortree_cpp_v3" + self.cpp_info.set_property("cmake_file_name", cmake_file_name) self.cpp_info.set_property("cmake_target_name", f"BT::{libname}") + requires = [] + if self._with_boost: + requires.append("boost::coroutine") + if self._with_lexy: + requires.append("foonathan-lexy::foonathan-lexy") + if self._with_minitrace: + requires.append("minitrace::minitrace") + if self._with_ncurses: + requires.append("ncurses::ncurses") + if self._with_sqlite3: + requires.append("sqlite3::sqlite3") + if self._with_tinyxml2: + requires.append("tinyxml2::tinyxml2") + if self._with_zeromq: + requires.append("zeromq::zeromq") + postfix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" # TODO: back to global scope in conan v2 once cmake_find_package* generators removed self.cpp_info.components[libname].libs = [f"{libname}{postfix}"] - self.cpp_info.components[libname].requires = ["zeromq::zeromq", "cppzmq::cppzmq", "ncurses::ncurses"] - if self.options.with_coroutines: - self.cpp_info.components[libname].requires.append("boost::coroutine") + self.cpp_info.components[libname].requires = requires if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.components[libname].system_libs.append("pthread") + self.cpp_info.components[libname].system_libs.extend(["pthread", "dl"]) if Version(self.version) >= "4.0" and \ self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.components[libname].system_libs.append("stdc++fs") if self.options.with_tools: bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var with : {}".format(bin_path)) self.env_info.PATH.append(bin_path) # TODO: to remove in conan v2 once cmake_find_package* generators removed - if Version(self.version) < "4.0": - self.cpp_info.filenames["cmake_find_package"] = "BehaviorTreeV3" - self.cpp_info.filenames["cmake_find_package_multi"] = "BehaviorTreeV3" - else: - self.cpp_info.filenames["cmake_find_package"] = "BehaviorTree" - self.cpp_info.filenames["cmake_find_package_multi"] = "BehaviorTree" - + self.cpp_info.filenames["cmake_find_package"] = cmake_file_name + self.cpp_info.filenames["cmake_find_package_multi"] = cmake_file_name self.cpp_info.names["cmake_find_package"] = "BT" self.cpp_info.names["cmake_find_package_multi"] = "BT" self.cpp_info.components[libname].names["cmake_find_package"] = libname diff --git a/recipes/behaviortree.cpp/all/patches/001-minitrace.patch b/recipes/behaviortree.cpp/all/patches/001-minitrace.patch new file mode 100644 index 0000000000000..734c4e7f4c8b5 --- /dev/null +++ b/recipes/behaviortree.cpp/all/patches/001-minitrace.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9b6d1eb..fd0e84f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,6 +39,7 @@ endif() + + #---- Find other packages ---- + find_package(Threads REQUIRED) ++find_package(minitrace REQUIRED) + + + set(BEHAVIOR_TREE_LIBRARY ${PROJECT_NAME}) +@@ -80,10 +81,6 @@ endif() + + add_subdirectory(3rdparty/lexy) + +-add_library(minitrace STATIC 3rdparty/minitrace/minitrace.cpp) +-target_compile_definitions(minitrace PRIVATE MTR_ENABLED=True) +-set_property(TARGET minitrace PROPERTY POSITION_INDEPENDENT_CODE ON) +- + list(APPEND BT_SOURCE + src/action_node.cpp + src/basic_types.cpp +@@ -166,7 +163,7 @@ target_link_libraries(${BTCPP_LIBRARY} + Threads::Threads + ${CMAKE_DL_LIBS} + $ +- minitrace ++ minitrace::minitrace + PUBLIC + ${BTCPP_EXTRA_LIBRARIES} + ) diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch deleted file mode 100644 index 7cb2daad955aa..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0001-remove-fpic.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a390aed..aff91ec 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -36,7 +36,6 @@ if(NOT DEFINED BT_COROUTINES) - add_definitions(-DBT_NO_COROUTINES) - endif() - --set(CMAKE_POSITION_INDEPENDENT_CODE ON) - - #---- project configuration ---- - option(BUILD_EXAMPLES "Build tutorials and examples" ON) diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch deleted file mode 100644 index c717020c8e00a..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0002-find-zmq.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index aff91ec..242c214 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -45,14 +45,14 @@ option(BUILD_SHARED_LIBS "Build shared libraries" ON) - - #---- Find other packages ---- - find_package(Threads) --find_package(ZMQ) -+find_package(ZeroMQ) - - list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} - ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - message(STATUS "ZeroMQ found.") - add_definitions( -DZMQ_FOUND ) - list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) -@@ -202,8 +202,8 @@ if (WIN32) - add_library(${BEHAVIOR_TREE_LIBRARY} STATIC ${BT_SOURCE} ) - endif() - --if( ZMQ_FOUND ) -- list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZMQ_INCLUDE_DIRS}) -+if( ZeroMQ_FOUND ) -+ list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIRS}) - endif() - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC -@@ -211,7 +211,7 @@ target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PRIVATE - ${Boost_LIBRARIES} -- ${ZMQ_LIBRARIES}) -+ ${ZeroMQ_LIBRARIES}) - - #get_target_property(my_libs ${BEHAVIOR_TREE_LIBRARY} INTERFACE_LINK_LIBRARIES) - #list(REMOVE_ITEM _libs X) -@@ -227,8 +227,8 @@ target_include_directories(${BEHAVIOR_TREE_LIBRARY} PUBLIC - $ - ${BUILD_TOOL_INCLUDE_DIRS}) - --if( ZMQ_FOUND ) -- target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZMQ_FOUND) -+if( ZeroMQ_FOUND ) -+ target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZeroMQ_FOUND) - endif() - - if(MSVC) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 0801850..153b447 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -6,9 +6,9 @@ target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} ) - install(TARGETS bt3_log_cat - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - add_executable(bt3_recorder bt_recorder.cpp ) -- target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES}) -+ target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZeroMQ_LIBRARIES}) - install(TARGETS bt3_recorder - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - endif() diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch deleted file mode 100644 index 4996714060f93..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0003-no-werror.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 242c214..cb8d77a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -232,10 +232,10 @@ if( ZeroMQ_FOUND ) - endif() - - if(MSVC) -- target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE /W3 /WX) -+ target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE /W3) - else() - target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE -- -Wall -Wextra -Werror=return-type) -+ -Wall -Wextra) - endif() - - ###################################################### diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch deleted file mode 100644 index 75f9c74e55e10..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0004-win-sigaction.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/tools/bt_recorder.cpp b/tools/bt_recorder.cpp -index 3aa6740..4b36414 100644 ---- a/tools/bt_recorder.cpp -+++ b/tools/bt_recorder.cpp -@@ -16,12 +16,17 @@ static void s_signal_handler(int) - - static void CatchSignals(void) - { -+#ifdef _WIN32 -+ signal(SIGINT, s_signal_handler); -+ signal(SIGTERM, s_signal_handler); -+#else - struct sigaction action; - action.sa_handler = s_signal_handler; - action.sa_flags = 0; - sigemptyset(&action.sa_mask); - sigaction(SIGINT, &action, NULL); - sigaction(SIGTERM, &action, NULL); -+#endif - } - - int main(int argc, char* argv[]) diff --git a/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch b/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch deleted file mode 100644 index d1b1b47051f32..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.5.6-0005-stdc-format.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/3rdparty/minitrace/minitrace.h b/3rdparty/minitrace/minitrace.h -index c7d5b31..d68dc52 100644 ---- a/3rdparty/minitrace/minitrace.h -+++ b/3rdparty/minitrace/minitrace.h -@@ -21,6 +21,7 @@ - // More: - // http://www.altdevblogaday.com/2012/08/21/using-chrometracing-to-view-your-inline-profiling-data/ - -+#define __STDC_FORMAT_MACROS - #include - - #define MTR_ENABLED diff --git a/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch b/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch deleted file mode 100644 index b1bd9fd89538c..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.7.0-0001-remove-fpic.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cd490a5..843045e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -15,8 +15,6 @@ else() - add_definitions(-Wpedantic) - endif() - --set(CMAKE_POSITION_INDEPENDENT_CODE ON) -- - #---- project configuration ---- - option(BUILD_EXAMPLES "Build tutorials and examples" ON) - option(BUILD_SAMPLES "Build sample nodes" ON) diff --git a/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch b/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch deleted file mode 100644 index 7290476cc8726..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.7.0-0002-find-zmq.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 843045e..471c00e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -54,14 +54,14 @@ endif() - - #---- Find other packages ---- - find_package(Threads) --find_package(ZMQ) -+find_package(ZeroMQ) - - list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} - ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - message(STATUS "ZeroMQ found.") - add_definitions( -DZMQ_FOUND ) - list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) -@@ -193,8 +193,8 @@ else() - add_library(${BEHAVIOR_TREE_LIBRARY} STATIC ${BT_SOURCE}) - endif() - --if( ZMQ_FOUND ) -- list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZMQ_INCLUDE_DIRS}) -+if( ZeroMQ_FOUND ) -+ list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIRS}) - endif() - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC -@@ -202,7 +202,7 @@ target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC - - target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PRIVATE - ${Boost_LIBRARIES} -- ${ZMQ_LIBRARIES}) -+ ${ZeroMQ_LIBRARIES}) - - #get_target_property(my_libs ${BEHAVIOR_TREE_LIBRARY} INTERFACE_LINK_LIBRARIES) - #list(REMOVE_ITEM _libs X) -@@ -218,8 +218,8 @@ target_include_directories(${BEHAVIOR_TREE_LIBRARY} PUBLIC - $ - ${BUILD_TOOL_INCLUDE_DIRS}) - --if( ZMQ_FOUND ) -- target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZMQ_FOUND) -+if( ZeroMQ_FOUND ) -+ target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZeroMQ_FOUND) - endif() - - if(MSVC) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 2ad33b3..2dc969d 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -6,9 +6,9 @@ target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} ) - install(TARGETS bt3_log_cat - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - add_executable(bt3_recorder bt_recorder.cpp ) -- target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES}) -+ target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZeroMQ_LIBRARIES}) - install(TARGETS bt3_recorder - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - endif() diff --git a/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch b/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch deleted file mode 100644 index 5bf8893db1770..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/3.7.0-0003-no-werror.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 471c00e..7245461 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -225,7 +225,7 @@ endif() - if(MSVC) - else() - target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE -- -Wall -Wextra -Werror=return-type) -+ -Wall -Wextra) - endif() - - ############################################################# diff --git a/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch b/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch deleted file mode 100644 index 23931bd446392..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/4.0.1-0001-remove-fpic.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d03b8a7..a2f23cf 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -15,8 +15,6 @@ else() - add_definitions(-Wpedantic) - endif() - --set(CMAKE_POSITION_INDEPENDENT_CODE ON) -- - #---- project configuration ---- - option(BTCPP_SHARED_LIBS "Build shared libraries" ON) - option(BTCPP_ENABLE_COROUTINES "Enable boost coroutines" ON) diff --git a/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch b/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch deleted file mode 100644 index 6753b06f564d0..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/4.0.1-0002-find-zmq.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a2f23cf..d427d37 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -67,14 +67,14 @@ endif() - - #---- Find other packages ---- - find_package(Threads) --find_package(ZMQ) -+find_package(ZeroMQ) - - list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES - ${CMAKE_THREAD_LIBS_INIT} - ${CMAKE_DL_LIBS} - ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - message(STATUS "ZeroMQ found.") - add_definitions( -DZMQ_FOUND ) - list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp) -@@ -221,7 +221,7 @@ target_link_libraries(${BEHAVIOR_TREE_LIBRARY} - ${BEHAVIOR_TREE_PUBLIC_LIBRARIES} - PRIVATE - ${Boost_LIBRARIES} -- ${ZMQ_LIBRARIES} -+ ${ZeroMQ_LIBRARIES} - $ - ) - -@@ -243,8 +243,8 @@ target_include_directories(${BEHAVIOR_TREE_LIBRARY} PRIVATE - $ - ) - --if( ZMQ_FOUND ) -- target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZMQ_FOUND) -+if( ZeroMQ_FOUND ) -+ target_compile_definitions(${BEHAVIOR_TREE_LIBRARY} PUBLIC ZeroMQ_FOUND) - endif() - - if(MSVC) -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 163e703..b98f525 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -7,9 +7,9 @@ target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} ) - install(TARGETS bt3_log_cat - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - --if( ZMQ_FOUND ) -+if( ZeroMQ_FOUND ) - add_executable(bt3_recorder bt_recorder.cpp ) -- target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZMQ_LIBRARIES}) -+ target_link_libraries(bt3_recorder ${BEHAVIOR_TREE_LIBRARY} ${ZeroMQ_LIBRARIES}) - install(TARGETS bt3_recorder - DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION} ) - endif() diff --git a/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch b/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch deleted file mode 100644 index b69541449eb87..0000000000000 --- a/recipes/behaviortree.cpp/all/patches/4.0.1-0003-no-werror.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d427d37..0c10f52 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -250,7 +250,7 @@ endif() - if(MSVC) - else() - target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE -- -Wall -Wextra -Werror=return-type) -+ -Wall -Wextra) - endif() - - ############################################################# diff --git a/recipes/behaviortree.cpp/all/test_package/CMakeLists.txt b/recipes/behaviortree.cpp/all/test_package/CMakeLists.txt index d710fc297db68..1a15b0587ed16 100644 --- a/recipes/behaviortree.cpp/all/test_package/CMakeLists.txt +++ b/recipes/behaviortree.cpp/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) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/behaviortree.cpp/config.yml b/recipes/behaviortree.cpp/config.yml index e1234d5535a8c..12e603c7e2db2 100644 --- a/recipes/behaviortree.cpp/config.yml +++ b/recipes/behaviortree.cpp/config.yml @@ -1,7 +1,15 @@ versions: + "4.6.2": + folder: all + "4.6.1": + folder: all + "4.6.0": + folder: all + "4.5.2": + folder: all "4.0.1": folder: all - "3.7.0": + "3.8.6": folder: all - "3.5.6": + "3.7.0": folder: all diff --git a/recipes/benchmark/all/conandata.yml b/recipes/benchmark/all/conandata.yml index 8a3c24a77b927..19a4c28810f12 100644 --- a/recipes/benchmark/all/conandata.yml +++ b/recipes/benchmark/all/conandata.yml @@ -1,31 +1,15 @@ 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" - "1.7.1": - url: "https://github.com/google/benchmark/archive/refs/tags/v1.7.1.tar.gz" - sha256: "6430e4092653380d9dc4ccb45a1e2dc9259d581f4866dc0759713126056bc1d7" - "1.7.0": - url: "https://github.com/google/benchmark/archive/refs/tags/v1.7.0.tar.gz" - sha256: "3aff99169fa8bdee356eaa1f691e835a6e57b1efeadb8a0f9f228531158246ac" - "1.6.2": - url: "https://github.com/google/benchmark/archive/v1.6.2.tar.gz" - sha256: "a9f77e6188c1cd4ebedfa7538bf5176d6acc72ead6f456919e5f464ef2f06158" - "1.6.1": - url: "https://github.com/google/benchmark/archive/v1.6.1.tar.gz" - sha256: "6132883bc8c9b0df5375b16ab520fac1a85dc9e4cf5be59480448ece74b278d4" - "1.6.0": - url: "https://github.com/google/benchmark/archive/v1.6.0.tar.gz" - sha256: "1f71c72ce08d2c1310011ea6436b31e39ccab8c2db94186d26657d41747c85d6" - "1.5.6": - url: "https://github.com/google/benchmark/archive/v1.5.6.tar.gz" - sha256: "789f85b4810d13ff803834ea75999e41b326405d83d6a538baf01499eda96102" + "1.9.1": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.9.1.tar.gz" + sha256: "32131c08ee31eeff2c8968d7e874f3cb648034377dfc32a4c377fa8796d84981" + # keep 1.9.0, the last release for c++14 + "1.9.0": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.9.0.tar.gz" + sha256: "35a77f46cc782b16fac8d3b107fbfbb37dcd645f7c28eee19f3b8e0758b48994" + "1.8.5": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.5.tar.gz" + sha256: "d26789a2b46d8808a48a4556ee58ccc7c497fcd4c0af9b90197674a81e04798a" + # keep 1.8.4, the last release for c++11 + "1.8.4": + url: "https://github.com/google/benchmark/archive/refs/tags/v1.8.4.tar.gz" + sha256: "3e7059b6b11fb1bbe28e33e02519398ca94c1818874ebed18e504dc6f709be45" diff --git a/recipes/benchmark/all/conanfile.py b/recipes/benchmark/all/conanfile.py index 4143dd1a1d5dd..741a672cff970 100644 --- a/recipes/benchmark/all/conanfile.py +++ b/recipes/benchmark/all/conanfile.py @@ -1,20 +1,19 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.build import cross_building +from conan.tools.build import cross_building, check_min_cppstd 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, replace_in_file from conan.tools.microsoft import is_msvc, check_min_vs from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0.0" class BenchmarkConan(ConanFile): name = "benchmark" description = "A microbenchmark support library." license = "Apache-2.0" - url = "https://github.com/conan-io/conan-center-index/" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/benchmark" topics = ("google", "microbenchmark") @@ -35,10 +34,20 @@ class BenchmarkConan(ConanFile): "enable_libpfm": False, } + @property + def _min_cppstd(self): + if Version(self.version) >= "1.9.1": + return 17 + if Version(self.version) >= "1.8.5": + return 14 + if is_msvc(self): + return 14 + return 11 + 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": + if self.settings.os != "Linux": del self.options.enable_libpfm def configure(self): @@ -49,20 +58,26 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): + check_min_cppstd(self, self._min_cppstd) check_min_vs(self, "190") - 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]") + self.tool_requires("cmake/[>=3.16.3 <4]") + + def _patch_sources(self): + replace_in_file(self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD", + "#" + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._patch_sources() def generate(self): tc = CMakeToolchain(self) @@ -71,9 +86,8 @@ def generate(self): 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 + tc.variables["BENCHMARK_ENABLE_WERROR"] = False + tc.variables["BENCHMARK_FORCE_WERROR"] = False if self.settings.os != "Windows": if cross_building(self): tc.variables["HAVE_STD_REGEX"] = False @@ -103,7 +117,7 @@ def package_info(self): self.cpp_info.components["_benchmark"].set_property("cmake_target_name", "benchmark::benchmark") self.cpp_info.components["_benchmark"].libs = ["benchmark"] - if Version(self.version) >= "1.7.0" and not self.options.shared: + if not self.options.shared: self.cpp_info.components["_benchmark"].defines.append("BENCHMARK_STATIC_DEFINE") if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.components["_benchmark"].system_libs.extend(["pthread", "rt", "m"]) @@ -113,7 +127,6 @@ def package_info(self): 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/all/test_package/CMakeLists.txt b/recipes/benchmark/all/test_package/CMakeLists.txt index 58358ea09a5db..4d032c149750d 100644 --- a/recipes/benchmark/all/test_package/CMakeLists.txt +++ b/recipes/benchmark/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(benchmark REQUIRED CONFIG) diff --git a/recipes/benchmark/all/test_v1_package/CMakeLists.txt b/recipes/benchmark/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/benchmark/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/benchmark/all/test_v1_package/conanfile.py b/recipes/benchmark/all/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/benchmark/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/benchmark/config.yml b/recipes/benchmark/config.yml index f3ed1f1e95743..0ea1e08786454 100644 --- a/recipes/benchmark/config.yml +++ b/recipes/benchmark/config.yml @@ -1,21 +1,9 @@ versions: - "1.8.3": + "1.9.1": folder: all - "1.8.2": + "1.9.0": folder: all - "1.8.1": + "1.8.5": folder: all - "1.8.0": - folder: all - "1.7.1": - folder: all - "1.7.0": - folder: all - "1.6.2": - folder: all - "1.6.1": - folder: all - "1.6.0": - folder: all - "1.5.6": + "1.8.4": folder: all diff --git a/recipes/bertrand/all/test_package/CMakeLists.txt b/recipes/bertrand/all/test_package/CMakeLists.txt index 8d8eab3e4ede9..f317be5a9cc1e 100644 --- a/recipes/bertrand/all/test_package/CMakeLists.txt +++ b/recipes/bertrand/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(bertrand REQUIRED CONFIG) diff --git a/recipes/bertrand/all/test_v1_package/CMakeLists.txt b/recipes/bertrand/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 4b58a4f48ada0..0000000000000 --- a/recipes/bertrand/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(bertrand 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} PRIVATE bertrand::bertrand) diff --git a/recipes/bertrand/all/test_v1_package/conanfile.py b/recipes/bertrand/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/bertrand/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_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/bezier/all/conandata.yml b/recipes/bezier/all/conandata.yml new file mode 100644 index 0000000000000..4bb4e5cf2851f --- /dev/null +++ b/recipes/bezier/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2.1": + url: "https://github.com/oysteinmyrmo/bezier/archive/refs/tags/v0.2.1.tar.gz" + sha256: "fce93c766f31ec445f6f48d0d1438c128640f0728d29745ca9e5424d9daf944f" diff --git a/recipes/bezier/all/conanfile.py b/recipes/bezier/all/conanfile.py new file mode 100644 index 0000000000000..b308756aa16cc --- /dev/null +++ b/recipes/bezier/all/conanfile.py @@ -0,0 +1,63 @@ +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 BezierConan(ConanFile): + name = "bezier" + description = "A single header only C++ library for Bezier curve calculations and manipulations." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/oysteinmyrmo/bezier" + topics = ("curve", "header-only") + 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", + } + + 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.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=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/bezier/all/test_package/CMakeLists.txt b/recipes/bezier/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b5a9211efc1a8 --- /dev/null +++ b/recipes/bezier/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(bezier REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bezier::bezier) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bezier/all/test_package/conanfile.py b/recipes/bezier/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/bezier/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/bezier/all/test_package/test_package.cpp b/recipes/bezier/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..72113a98c3ad7 --- /dev/null +++ b/recipes/bezier/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include "bezier/bezier.h" + +int main(void) { + bezier::Bezier<3> cubicBezier({ {120, 160}, {35, 200}, {220, 260}, {220, 40} }); + + bezier::Point p = cubicBezier.valueAt(0.5); + std::cout << p.x << " " << p.y << std::endl; +} diff --git a/recipes/bezier/config.yml b/recipes/bezier/config.yml new file mode 100644 index 0000000000000..f975c1e3261f7 --- /dev/null +++ b/recipes/bezier/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.1": + folder: all diff --git a/recipes/bgfx/all/conanfile.py b/recipes/bgfx/all/conanfile.py index 9de812b7f94ea..7ce8c351c03cf 100644 --- a/recipes/bgfx/all/conanfile.py +++ b/recipes/bgfx/all/conanfile.py @@ -160,7 +160,7 @@ 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"} + "194": "2022", "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)]}" diff --git a/recipes/bigint/all/CMakeLists.txt b/recipes/bigint/all/CMakeLists.txt index acc15b2e4f05f..3f009c3150954 100644 --- a/recipes/bigint/all/CMakeLists.txt +++ b/recipes/bigint/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(bigint LANGUAGES CXX) include(GNUInstallDirs) diff --git a/recipes/bigint/all/test_package/CMakeLists.txt b/recipes/bigint/all/test_package/CMakeLists.txt index 301bd00b111ce..0039a20f379c9 100644 --- a/recipes/bigint/all/test_package/CMakeLists.txt +++ b/recipes/bigint/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(bigint REQUIRED CONFIG) diff --git a/recipes/bigint/all/test_v1_package/CMakeLists.txt b/recipes/bigint/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/bigint/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bigint/all/test_v1_package/conanfile.py b/recipes/bigint/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/bigint/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_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/bimg/all/conanfile.py b/recipes/bimg/all/conanfile.py index 83eb227558d62..e261d422055f7 100644 --- a/recipes/bimg/all/conanfile.py +++ b/recipes/bimg/all/conanfile.py @@ -130,7 +130,7 @@ 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"} + "194": "2022", "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)]}" diff --git a/recipes/bimg/all/test_package/CMakeLists.txt b/recipes/bimg/all/test_package/CMakeLists.txt index ffa49fe136f63..33453acadcd0d 100644 --- a/recipes/bimg/all/test_package/CMakeLists.txt +++ b/recipes/bimg/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) diff --git a/recipes/bimg/all/test_v1_package/CMakeLists.txt b/recipes/bimg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 667976629550a..0000000000000 --- a/recipes/bimg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/bimg/all/test_v1_package/conanfile.py b/recipes/bimg/all/test_v1_package/conanfile.py deleted file mode 100644 index 056e75eddb91c..0000000000000 --- a/recipes/bimg/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/binutils/all/conandata.yml b/recipes/binutils/all/conandata.yml index 92a40425b2590..f0dd0d5db997f 100644 --- a/recipes/binutils/all/conandata.yml +++ b/recipes/binutils/all/conandata.yml @@ -1,26 +1,16 @@ sources: + "2.42": + url: "https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz" + sha256: "f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800" "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" - "2.37": - url: "https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.gz" - sha256: "c44968b97cd86499efbc4b4ab7d98471f673e5414c554ef54afa930062dbbfcb" + url: "https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.xz" + sha256: "ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450" patches: + "2.42": + - patch_file: "patches/2.42-0001-no-texinfo.patch" + patch_type: "conan" + patch_description: "disable texinfo" "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 + patch_type: "conan" patch_description: "disable texinfo" diff --git a/recipes/binutils/all/conanfile.py b/recipes/binutils/all/conanfile.py index 1e04fbc03a87b..09d66fc511d1f 100644 --- a/recipes/binutils/all/conanfile.py +++ b/recipes/binutils/all/conanfile.py @@ -132,10 +132,8 @@ def build_requirements(self): self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type="str"): self.tool_requires("msys2/cci.latest") - - if self.version >= "2.39": - self.tool_requires("bison/3.8.2") - self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") def requirements(self): self.requires("zlib/[>=1.2.11 <2]") @@ -199,8 +197,6 @@ def package_info(self): # v2 exports self.buildenv_info.append_path("PATH", bindir) self.buildenv_info.append_path("PATH", absolute_target_bindir) - self.conf_info.define("user.binutils:gnu_triplet", self.options.target_triplet) - self.conf_info.define("user.binutils:prefix", self.options.prefix) # Add recipe path to enable running the self test in the test package. # Don't use this property in production code. It's unsupported. diff --git a/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch deleted file mode 100644 index 1e0698965c0de..0000000000000 --- a/recipes/binutils/all/patches/2.38-0001-no-texinfo.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- gas/Makefile.in -+++ gas/Makefile.in -@@ -1778,7 +1778,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 \ -@@ -1854,7 +1854,7 @@ info: info-recursive - - info-am: $(INFO_DEPS) info-local - --install-data-am: install-data-local install-info-am install-man -+install-data-am: install-man - - install-dvi: install-dvi-recursive - diff --git a/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch deleted file mode 100644 index fbd00f17e49e4..0000000000000 --- a/recipes/binutils/all/patches/2.40-0001-no-texinfo.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- 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.42-0001-no-texinfo.patch b/recipes/binutils/all/patches/2.42-0001-no-texinfo.patch new file mode 100644 index 0000000000000..231668a13cce4 --- /dev/null +++ b/recipes/binutils/all/patches/2.42-0001-no-texinfo.patch @@ -0,0 +1,51 @@ +--- bfd/Makefile.in ++++ bfd/Makefile.in +@@ -259,7 +259,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 +@@ -2050,7 +2050,7 @@ + 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 \ +@@ -2117,8 +2117,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 + + +--- gas/Makefile.in ++++ gas/Makefile.in +@@ -1825,7 +1825,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 \ +@@ -1901,7 +1901,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 + diff --git a/recipes/binutils/all/test_v1_package/Linux-armv7.s b/recipes/binutils/all/test_v1_package/Linux-armv7.s deleted file mode 100644 index 88c05d0d0aac9..0000000000000 --- a/recipes/binutils/all/test_v1_package/Linux-armv7.s +++ /dev/null @@ -1,23 +0,0 @@ - .arm - .arch armv7-a - - .global _start - - .text -_start: - # write(1, message, 14) - mov r7, #4 // system call 4 is write - mov r0, #1 // file handle 1 is stdout - adr r1, message // address of string to output - mov r2, #14 // number of bytes - swi #0 // do syscall into os (supervisor call) - - # exit(0) - mov r7, #1 // system call 1 is exit - mov r0, #0 // we want return code 0 - swi #0 // do syscall into os (supervisor call) - - .align 2 - -message: - .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Linux-armv8.s b/recipes/binutils/all/test_v1_package/Linux-armv8.s deleted file mode 100644 index c744b1ba7ea47..0000000000000 --- a/recipes/binutils/all/test_v1_package/Linux-armv8.s +++ /dev/null @@ -1,19 +0,0 @@ - .global _start - - .text -_start: - # write(1, message, 14) - mov x8, 64 // system call 64 is write - mov x0, 1 // file handle 1 is stdout - mov x1, message // address of string to output - mov x2, 14 // number of bytes - svc 0 // do syscall into os (supervisor call) - - # exit(0) - mov x8, 93 // system call 93 is exit - mov x0, 0 // we want return code 0 - svc 0 // do syscall into os (supervisor call) - - .section .rodata -message: - .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Linux-riscv.s b/recipes/binutils/all/test_v1_package/Linux-riscv.s deleted file mode 100644 index 21d80984c1b16..0000000000000 --- a/recipes/binutils/all/test_v1_package/Linux-riscv.s +++ /dev/null @@ -1,19 +0,0 @@ - .global _start - - .text -_start: - # write(1, message, 14) - addi a7, x0, 64 # system call 64 is write - addi a0, x0, 1 # file handle 1 is stdout - la a1, message # address of string to output - addi a2, x0, 14 # number of bytes - ecall # do syscall into os (environment call) - - # exit(0) - addi a7, x0, 93 # system call 93 is exit - addi a0, x0, 0 # we want return code 0 - ecall # do syscall into os (environment call) - - .data -message: - .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Linux-x86.s b/recipes/binutils/all/test_v1_package/Linux-x86.s deleted file mode 100644 index b932e52148e99..0000000000000 --- a/recipes/binutils/all/test_v1_package/Linux-x86.s +++ /dev/null @@ -1,20 +0,0 @@ - .global _start - - .text -_start: - # write(1, message, 14) - mov $4, %eax # system call 4 is write - mov $1, %ebx # file handle 1 is stdout - mov $message, %ecx # address of string to output - mov $14, %edx # number of bytes - int $0x80 # do syscall into os - - # exit(0) - mov $1, %eax # system call 1 is exit - xor %ebx, %ebx # we want return code 0 - int $0x80 # do syscall into os - - .data - -message: - .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Linux-x86_64.s b/recipes/binutils/all/test_v1_package/Linux-x86_64.s deleted file mode 100644 index b2bcbb46dbc56..0000000000000 --- a/recipes/binutils/all/test_v1_package/Linux-x86_64.s +++ /dev/null @@ -1,20 +0,0 @@ - .global _start - - .text -_start: - # write(1, message, 14) - mov $1, %rax # system call 1 is write - mov $1, %rdi # file handle 1 is stdout - mov $message, %rsi # address of string to output - mov $14, %rdx # number of bytes - syscall # do syscall into os - - # exit(0) - mov $60, %eax # system call 60 is exit - xor %rdi, %rdi # we want return code 0 - syscall # do syscall into os - - .section .data - -message: - .ascii "Hello, world!\n" diff --git a/recipes/binutils/all/test_v1_package/Windows-kernel32.def b/recipes/binutils/all/test_v1_package/Windows-kernel32.def deleted file mode 100644 index 88e93c499b32b..0000000000000 --- a/recipes/binutils/all/test_v1_package/Windows-kernel32.def +++ /dev/null @@ -1,7 +0,0 @@ -; The Windows test_package needs the following symbols from kernel32.dll - -LIBRARY kernel32 -EXPORTS - GetStdHandle - WriteConsoleA - ExitProcess diff --git a/recipes/binutils/all/test_v1_package/Windows-x86.s b/recipes/binutils/all/test_v1_package/Windows-x86.s deleted file mode 100644 index 8b6b27e91288f..0000000000000 --- a/recipes/binutils/all/test_v1_package/Windows-x86.s +++ /dev/null @@ -1,23 +0,0 @@ - .section .rdata,"dr" - -output: .ascii "Hello, world!\n" - - .text - .globl _start - -_start: - # GetStdHandle(STD_OUTPUT_HANDLE) - pushl $-11 # STD_OUTPUT_HANDLE (=COUNOUT$) - call _GetStdHandle # Retrieve console handle - - # WriteConsoleA($handle, output, 14, NULL, 0) - pushl $0 # lpReserved - pushl $0 # lpNumberOfCharsWritten (optional) - pushl $14 # nNumberOfCharsToWrite - pushl $output # lpBuffer - pushl %eax # hConsoleOutput - call _WriteConsoleA # Write to console - - # ExitProcess(0) - pushl $0 # Return 0 errorcode - call _ExitProcess # Exit process diff --git a/recipes/binutils/all/test_v1_package/Windows-x86_64.s b/recipes/binutils/all/test_v1_package/Windows-x86_64.s deleted file mode 100644 index 9d17a6a37a336..0000000000000 --- a/recipes/binutils/all/test_v1_package/Windows-x86_64.s +++ /dev/null @@ -1,26 +0,0 @@ - .section .rdata,"dr" - -output: .ascii "Hello, world!\n" - - .text - .globl _start - -_start: - # GetStdHandle(STD_OUTPUT_HANDLE) - mov $-11, %rcx # STD_OUTPUT_HANDLE (=COUNOUT$) - movq __imp_GetStdHandle(%rip), %rax # Get relocatable address of __imp_GetStdHandle - call *%rax # Retrieve console handle - - # WriteConsoleA($handle, "Hello world!\n", 14, NULL, 0) - pushq $0 # lpReserved - movq $0, %r9 # lpNumberOfCharsWritten (optional) - movq $14, %r8 # nNumberOfCharsToWrite - leaq output(%rip), %rdx # lpBuffer - movq %rax, %rcx # hConsoleOutput - movq __imp_WriteConsoleA(%rip), %rax # Get relocatable address of __imp_WriteConsoleA - call *%rax # Write to console - - # ExitProcess(0) - xorq %rcx, %rcx # Return 0 errorcode - movq __imp_ExitProcess(%rip), %rax # Get relocatable address of __imp__ExitProcess - call *%rax # Exit process diff --git a/recipes/binutils/all/test_v1_package/conanfile.py b/recipes/binutils/all/test_v1_package/conanfile.py deleted file mode 100644 index 6b7ddeed01c09..0000000000000 --- a/recipes/binutils/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,113 +0,0 @@ -from conans import ConanFile, tools -from io import StringIO -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - @property - def _target_arch(self): - return str(self.options["binutils"].target_arch) - - @property - def _target_os(self): - return str(self.options["binutils"].target_os) - - @property - def _test_linker_args(self): - args = [] - if self._target_os == "Windows": - args.extend(["--subsystem", "console", f"{self.build_folder}/lib/libkernel32.a"]) - return args - - @property - def _test_package_assembly_source(self): - part_arch = self._target_arch - if "armv7" in part_arch: - part_arch = "armv7" - elif part_arch in ("riscv32", "riscv64"): - part_arch = "riscv" - return os.path.join(self.source_folder, f"{self._target_os}-{part_arch}.s") - - def _append_gnu_triplet(self, exe): - return f"{self.deps_user_info['binutils'].prefix}{exe}" - - def build(self): - if not tools.cross_building(self): - - if not os.path.isfile(self._test_package_assembly_source): - self.output.warn(f"Missing {self._test_package_assembly_source}.\ntest_package does not support this target os/arch. Please consider adding it. (It's a great learning experience)") - else: - tools.mkdir(os.path.join(self.build_folder, "bin")) - tools.mkdir(os.path.join(self.build_folder, "lib")) - - gas = self._append_gnu_triplet("as") - ld = self._append_gnu_triplet("ld") - extension = "" - if self._target_os == "Windows": - extension = ".exe" - - # Create minimum import library for kernel32.dll - dlltool = f"{self.deps_user_info['binutils'].gnu_triplet}-dlltool" - - dlltool_args = [dlltool, "--input-def", f"{self.source_folder}/Windows-kernel32.def", "--output-lib", f"{self.build_folder}/lib/libkernel32.a"] - self.run(" ".join(dlltool_args)) - - - assembler_args = [gas, self._test_package_assembly_source, "-o", f"{self.build_folder}/object.o"] - linker_args = [ld, f"{self.build_folder}/object.o", "-o", f"{self.build_folder}/bin/test_package{extension}"] + self._test_linker_args - - self.run(" ".join(assembler_args)) - self.run(" ".join(linker_args)) - - def _can_run_target(self): - if self._settings_build.os != self._target_os: - return False - if self._settings_build.arch == "x86_64": - return self._target_arch in ("x86", "x86_64") - return self._settings_build.arch == self._target_arch - - def _has_as(self): - if self._target_os in ("Macos"): - return False - return True - - def _has_ld(self): - if self._target_os in ("Macos"): - return False - return True - - def test(self): - # Run selftest (conversion between conan os/arch <=> gnu triplet) - with tools.chdir(os.path.dirname(self.deps_user_info["binutils"].recipe_path)): - self.run(f"python -m unittest {os.path.basename(self.deps_user_info['binutils'].recipe_path)} --verbose") - - if not tools.cross_building(self): - if self._can_run_target() and os.path.isfile(self._test_package_assembly_source): - output = StringIO() - self.run(os.path.join("bin", "test_package"), output=output) - text = output.getvalue() - print(text) - assert "Hello, world!" in text - - bins = ["ar", "nm", "objcopy", "objdump", "ranlib", "readelf", "strip"] - if self._has_as(): - bins.append("as") - if self._has_ld(): - bins.append("ld") - - for bin in bins: - bin_path = os.path.realpath(tools.which(bin)) - self.output.info(f"Found {bin} at {bin_path}") - assert bin_path.startswith(self.deps_cpp_info["binutils"].rootpath) - - output = StringIO() - self.run("{} --version".format(bin_path), run_environment=True, output=output) - text = output.getvalue() - print(text) - assert str(self.requires["binutils"].ref.version) in text diff --git a/recipes/binutils/config.yml b/recipes/binutils/config.yml index 97d0d2ecab157..58766488a2584 100644 --- a/recipes/binutils/config.yml +++ b/recipes/binutils/config.yml @@ -1,9 +1,5 @@ versions: - "2.41": - folder: all - "2.40": + "2.42": folder: all - "2.38": - folder: all - "2.37": + "2.41": folder: all diff --git a/recipes/bison/all/test_package/CMakeLists.txt b/recipes/bison/all/test_package/CMakeLists.txt index 569311ba35a62..e38f298a546cf 100644 --- a/recipes/bison/all/test_package/CMakeLists.txt +++ b/recipes/bison/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(BISON REQUIRED) diff --git a/recipes/bison/all/test_v1_package/CMakeLists.txt b/recipes/bison/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/bison/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bison/all/test_v1_package/conanfile.py b/recipes/bison/all/test_v1_package/conanfile.py deleted file mode 100644 index 99ccbfcae8665..0000000000000 --- a/recipes/bison/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,31 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - test_type = "explicit" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - 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") - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - @property - def _mc_parser_source(self): - return os.path.join(self.source_folder, os.pardir, "test_package", "mc_parser.yy") - - def test(self): - self.run("bison --version") - self.run("yacc --version", win_bash=tools.os_info.is_windows) - self.run(f"bison -d {self._mc_parser_source}") diff --git a/recipes/bit-lite/all/test_package/CMakeLists.txt b/recipes/bit-lite/all/test_package/CMakeLists.txt index ed13431c56a28..b10f8e39b95de 100644 --- a/recipes/bit-lite/all/test_package/CMakeLists.txt +++ b/recipes/bit-lite/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(bit-lite REQUIRED CONFIG) diff --git a/recipes/bit-lite/all/test_v1_package/CMakeLists.txt b/recipes/bit-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a2c6ae82d037d..0000000000000 --- a/recipes/bit-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(bit-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::bit-lite) diff --git a/recipes/bit-lite/all/test_v1_package/conanfile.py b/recipes/bit-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/bit-lite/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_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/bitflags/all/test_package/CMakeLists.txt b/recipes/bitflags/all/test_package/CMakeLists.txt index 51b69634fef26..7841c2bf06e8b 100644 --- a/recipes/bitflags/all/test_package/CMakeLists.txt +++ b/recipes/bitflags/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(bitflags REQUIRED CONFIG) diff --git a/recipes/bitflags/all/test_v1_package/CMakeLists.txt b/recipes/bitflags/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/bitflags/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bitflags/all/test_v1_package/conanfile.py b/recipes/bitflags/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/bitflags/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", "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/bitmagic/all/conandata.yml b/recipes/bitmagic/all/conandata.yml index eef7267c67af3..7cde8279082b4 100644 --- a/recipes/bitmagic/all/conandata.yml +++ b/recipes/bitmagic/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "8.0.1": + url: "https://github.com/tlk00/BitMagic/archive/refs/tags/v8.0.1.tar.gz" + sha256: "9ef069c4b07da69f7a357eb3e8adf83c55cdd05deb03d52326ca13beb5896cb1" "7.13.4": url: "https://github.com/tlk00/BitMagic/archive/refs/tags/v7.13.4.tar.gz" sha256: "3a45e2f11396b09f963573af299d9ce03b6d100357d317c817cd91cca4ba84c4" diff --git a/recipes/bitmagic/all/test_package/CMakeLists.txt b/recipes/bitmagic/all/test_package/CMakeLists.txt index a756218c12bb7..3d7d134457fad 100644 --- a/recipes/bitmagic/all/test_package/CMakeLists.txt +++ b/recipes/bitmagic/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(bitmagic REQUIRED CONFIG) diff --git a/recipes/bitmagic/all/test_v1_package/CMakeLists.txt b/recipes/bitmagic/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/bitmagic/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bitmagic/all/test_v1_package/conanfile.py b/recipes/bitmagic/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/bitmagic/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_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/bitmagic/config.yml b/recipes/bitmagic/config.yml index f5ee671fc8132..b73f5f627eab8 100644 --- a/recipes/bitmagic/config.yml +++ b/recipes/bitmagic/config.yml @@ -1,4 +1,6 @@ versions: + "8.0.1": + folder: all "7.13.4": folder: all "7.12.3": diff --git a/recipes/bitserializer/all/conandata.yml b/recipes/bitserializer/all/conandata.yml index 1571f9c56284c..1271b051c1346 100644 --- a/recipes/bitserializer/all/conandata.yml +++ b/recipes/bitserializer/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.75": + url: "https://github.com/PavelKisliak/BitSerializer/archive/v0.75.tar.gz" + sha256: "2df980a59de48a19dee28d81a1c00cae1f60ca4d323a2bdf74be4ee9c9b8db05" + "0.70": + url: "https://github.com/PavelKisliak/BitSerializer/archive/v0.70.tar.gz" + sha256: "094b12c729b35bf2cede8b55e8193db7793482646f0307c17bcc736de6cce7c9" "0.65": url: "https://github.com/PavelKisliak/BitSerializer/archive/v0.65.tar.gz" sha256: "b4d90f13dd424faebe3ee57ee0cb86ff304e893990afd259c6a29d1f8533b2ef" diff --git a/recipes/bitserializer/all/conanfile.py b/recipes/bitserializer/all/conanfile.py index 5acbd3659a4cb..0f0a334d614b2 100644 --- a/recipes/bitserializer/all/conanfile.py +++ b/recipes/bitserializer/all/conanfile.py @@ -12,8 +12,8 @@ class BitserializerConan(ConanFile): name = "bitserializer" - description = "C++ 17 library for serialization to multiple output formats (JSON, XML, YAML, CSV)" - topics = ("serialization", "json", "xml", "yaml", "csv") + description = "C++ 17 library for serialization to multiple output formats (JSON, XML, YAML, CSV, MsgPack)" + topics = ("serialization", "json", "xml", "yaml", "csv", "msgpack") url = "https://github.com/conan-io/conan-center-index" homepage = "https://bitbucket.org/Pavel_Kisliak/bitserializer" license = "MIT" @@ -26,6 +26,7 @@ class BitserializerConan(ConanFile): "with_pugixml": [True, False], "with_rapidyaml": [True, False], "with_csv": [True, False], + "with_msgpack": [True, False], } default_options = { "fPIC": True, @@ -34,10 +35,9 @@ class BitserializerConan(ConanFile): "with_pugixml": False, "with_rapidyaml": False, "with_csv": False, + "with_msgpack": False, } - no_copy_source = True - @property def _min_cppstd(self): return "17" @@ -55,9 +55,9 @@ def _compilers_minimum_version(self): def _is_header_only(self, info=False): if Version(self.version) < "0.50": return True - # All components of library are header-only except csv-archive + # All components of library are header-only except csv-archive and msgpack-archive options = self.info.options if info else self.options - return not options.with_csv + return not (options.with_csv or options.get_safe("with_msgpack")) def config_options(self): if self.settings.os == "Windows" or Version(self.version) < "0.50": @@ -65,6 +65,8 @@ def config_options(self): if Version(self.version) < "0.50": del self.options.with_rapidyaml del self.options.with_csv + if Version(self.version) < "0.70": + del self.options.with_msgpack def configure(self): if self._is_header_only(): @@ -80,13 +82,13 @@ def layout(self): def requirements(self): if self.options.with_cpprestsdk: - self.requires("cpprestsdk/2.10.18", transitive_headers=True, transitive_libs=True) + self.requires("cpprestsdk/2.10.19", transitive_headers=True, transitive_libs=True) if self.options.with_rapidjson: - self.requires("rapidjson/cci.20220822", transitive_headers=True, transitive_libs=True) + self.requires("rapidjson/1.1.0", transitive_headers=True, transitive_libs=True) if self.options.with_pugixml: - self.requires("pugixml/1.13", transitive_headers=True, transitive_libs=True) + self.requires("pugixml/1.14", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_rapidyaml"): - self.requires("rapidyaml/0.4.1", transitive_headers=True, transitive_libs=True) + self.requires("rapidyaml/0.5.0", transitive_headers=True, transitive_libs=True) def package_id(self): if self._is_header_only(info=True): @@ -121,16 +123,19 @@ def generate(self): tc.variables["BUILD_PUGIXML_ARCHIVE"] = self.options.with_pugixml tc.variables["BUILD_RAPIDYAML_ARCHIVE"] = self.options.with_rapidyaml tc.variables["BUILD_CSV_ARCHIVE"] = self.options.with_csv + tc.variables["BUILD_MSGPACK_ARCHIVE"] = self.options.get_safe("with_msgpack") tc.generate() deps = CMakeDeps(self) deps.generate() def _patch_sources(self): - if Version(self.version) >= "0.50" and self.options.with_rapidyaml: + if Version(self.version) >= "0.50": # Remove 'ryml' subdirectory from #include replace_in_file( - self, os.path.join(self.source_folder, "include", "bitserializer", "rapidyaml_archive.h"), - "#include :BitSerializer::pugixml-archive> $<$:BitSerializer::rapidyaml-archive> $<$:BitSerializer::csv-archive> + $<$:BitSerializer::msgpack-archive> ) target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:"WITH_CPPRESTSDK"> @@ -38,4 +42,5 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:"WITH_PUGIXML"> $<$:"WITH_RAPIDYAML"> $<$:"WITH_CSV"> + $<$:"WITH_MSGPACK"> ) diff --git a/recipes/bitserializer/all/test_package/conanfile.py b/recipes/bitserializer/all/test_package/conanfile.py index abab9f750547c..86588bf359b36 100644 --- a/recipes/bitserializer/all/test_package/conanfile.py +++ b/recipes/bitserializer/all/test_package/conanfile.py @@ -23,6 +23,7 @@ def generate(self): tc.variables["WITH_PUGIXML"] = bitserializerOptions.with_pugixml tc.variables["WITH_RAPIDYAML"] = bitserializerOptions.get_safe("with_rapidyaml", False) tc.variables["WITH_CSV"] = bitserializerOptions.get_safe("with_csv", False) + tc.variables["WITH_MSGPACK"] = bitserializerOptions.get_safe("with_msgpack", False) tc.generate() def build(self): diff --git a/recipes/bitserializer/all/test_package/test_package.cpp b/recipes/bitserializer/all/test_package/test_package.cpp index aba11c808ba19..e3fd28d5e32b4 100644 --- a/recipes/bitserializer/all/test_package/test_package.cpp +++ b/recipes/bitserializer/all/test_package/test_package.cpp @@ -18,6 +18,9 @@ #ifdef WITH_CSV #include #endif +#ifdef WITH_MSGPACK +#include +#endif #include #include @@ -33,12 +36,28 @@ class CTest template void Serialize(TArchive& archive) { +#if BITSERIALIZER_VERSION >= 7000 + archive << BitSerializer::KeyValue("Message", mMessage); +#else archive << BitSerializer::MakeAutoKeyValue("Message", mMessage); +#endif } std::string mMessage; }; +std::string PrintAsHexString(const std::string& data) +{ + constexpr char hexChars[] = "0123456789ABCDEF"; + std::string result; + for (const char ch : data) + { + if (!result.empty()) result.push_back(' '); + result.append({ hexChars[(ch & 0xF0) >> 4], hexChars[(ch & 0x0F) >> 0] }); + } + return result; +} + template void TestArchive(const std::string& message) { @@ -47,21 +66,34 @@ void TestArchive(const std::string& message) BitSerializer::SerializationOptions serializationOptions; serializationOptions.streamOptions.writeBom = false; - CTest testObj[1] = { message }; + CTest testObj[1] = { message }; std::stringstream outputStream; BitSerializer::SaveObject(testObj, outputStream, serializationOptions); - std::cout << outputStream.str() << std::endl; +#if BITSERIALIZER_VERSION >= 7000 + const std::string result = TArchive::is_binary ? PrintAsHexString(outputStream.str()) : outputStream.str(); +#else + const std::string result = outputStream.str(); +#endif + std::cout << result<< std::endl; } int main() { std::cout << "BitSerializer version: " +#ifdef BITSERIALIZER_VERSION + << BitSerializer::Convert::To(BITSERIALIZER_VERSION_MAJOR) << "." + << BitSerializer::Convert::To(BITSERIALIZER_VERSION_MINOR) << "." + << BitSerializer::Convert::To(BITSERIALIZER_VERSION_PATCH) +#else << BitSerializer::Convert::To(BitSerializer::Version::Major) << "." << BitSerializer::Convert::To(BitSerializer::Version::Minor) << "." << BitSerializer::Convert::To(BitSerializer::Version::Maintenance) +#endif << std::endl; +#if !defined BITSERIALIZER_VERSION || BITSERIALIZER_HAS_FILESYSTEM // Some compilers does not link filesystem automatically std::cout << "Testing the link of C++17 filesystem: " << std::filesystem::temp_directory_path() << std::endl; +#endif #ifdef WITH_CPPRESTSDK TestArchive("Implementation based on cpprestsdk"); @@ -78,4 +110,7 @@ int main() { #ifdef WITH_CSV TestArchive("CSV archive (built-in implementation)"); #endif +#ifdef WITH_MSGPACK + TestArchive("MsgPack archive (built-in implementation)"); +#endif } diff --git a/recipes/bitserializer/all/test_v1_package/CMakeLists.txt b/recipes/bitserializer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/bitserializer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bitserializer/all/test_v1_package/conanfile.py b/recipes/bitserializer/all/test_v1_package/conanfile.py deleted file mode 100644 index 599ba5557b9dc..0000000000000 --- a/recipes/bitserializer/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,29 +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", "cmake_find_package_multi" - - def _bitserializer_option(self, name, default=None): - try: - return getattr(self.options["bitserializer"], name, default) - except (AttributeError, ConanException): - return default - - def build(self): - cmake = CMake(self) - cmake.definitions["WITH_CPPRESTSDK"] = self.options["bitserializer"].with_cpprestsdk - cmake.definitions["WITH_RAPIDJSON"] = self.options["bitserializer"].with_rapidjson - cmake.definitions["WITH_PUGIXML"] = self.options["bitserializer"].with_pugixml - cmake.definitions["WITH_RAPIDYAML"] = self._bitserializer_option("with_rapidyaml", False) - cmake.definitions["WITH_CSV"] = self._bitserializer_option("with_csv", 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) diff --git a/recipes/bitserializer/config.yml b/recipes/bitserializer/config.yml index 7319ee088f906..44ecb3aa4b5f4 100644 --- a/recipes/bitserializer/config.yml +++ b/recipes/bitserializer/config.yml @@ -1,4 +1,8 @@ versions: + "0.75": + folder: "all" + "0.70": + folder: "all" "0.65": folder: "all" "0.50": diff --git a/recipes/bitsery/all/conandata.yml b/recipes/bitsery/all/conandata.yml index 6d53e1633d5bf..fd5e93d076949 100644 --- a/recipes/bitsery/all/conandata.yml +++ b/recipes/bitsery/all/conandata.yml @@ -1,16 +1,10 @@ sources: + "5.2.4": + url: "https://github.com/fraillt/bitsery/archive/v5.2.4.tar.gz" + sha256: "ff741a3fee5420b31af31c7a8cefbcc3aaaf6f7f8c3ac49aa020f99b21d96020" "5.2.3": url: "https://github.com/fraillt/bitsery/archive/v5.2.3.tar.gz" sha256: "896d82ab4ccea9899ff2098aa69ad6d25e524ee1d4c747ce3232d0afe3cd05a5" "5.2.2": url: "https://github.com/fraillt/bitsery/archive/v5.2.2.tar.gz" sha256: "5e932c463f16db15228b2546632a5851a502c68e605a1e313b0f1a35c061e4ae" - "5.2.1": - url: "https://github.com/fraillt/bitsery/archive/v5.2.1.tar.gz" - sha256: "1e2ee66827c55ef82eaf6ef4c87a2c5b3a010dfe6c770eb0feeb3f0c35254d00" - "5.2.0": - url: "https://github.com/fraillt/bitsery/archive/v5.2.0.tar.gz" - sha256: "99f47bca227abb6b9e8030703dcc402ab930ff3bf0a87c89c3f0fb9536cad448" - "5.1.0": - url: "https://github.com/fraillt/bitsery/archive/v5.1.0.tar.gz" - sha256: "8f46667db5d0b62fdaab33612108498bcbcbe9cfa48d2cd220b2129734440a8d" diff --git a/recipes/bitsery/all/conanfile.py b/recipes/bitsery/all/conanfile.py index dd2f676b3757f..26bcf9c123505 100644 --- a/recipes/bitsery/all/conanfile.py +++ b/recipes/bitsery/all/conanfile.py @@ -13,13 +13,17 @@ class BitseryConan(ConanFile): "Header only C++ binary serialization library. It is designed around " "the networking requirements for real-time data delivery, especially for games." ) - topics = ("serialization", "binary", "header-only") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/fraillt/bitsery" - license = "MIT" + topics = ("serialization", "binary", "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() @@ -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 @@ -44,11 +44,8 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "Bitsery") self.cpp_info.set_property("cmake_target_name", "Bitsery::bitsery") - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["bitserylib"].bindirs = [] - self.cpp_info.components["bitserylib"].frameworkdirs = [] - self.cpp_info.components["bitserylib"].libdirs = [] - self.cpp_info.components["bitserylib"].resdirs = [] + 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"] = "Bitsery" @@ -56,3 +53,5 @@ def package_info(self): self.cpp_info.components["bitserylib"].names["cmake_find_package"] = "bitsery" self.cpp_info.components["bitserylib"].names["cmake_find_package_multi"] = "bitsery" self.cpp_info.components["bitserylib"].set_property("cmake_target_name", "Bitsery::bitsery") + self.cpp_info.components["bitserylib"].bindirs = [] + self.cpp_info.components["bitserylib"].libdirs = [] diff --git a/recipes/bitsery/all/test_package/CMakeLists.txt b/recipes/bitsery/all/test_package/CMakeLists.txt index ae7a2f24744c3..3e485e0222fa6 100644 --- a/recipes/bitsery/all/test_package/CMakeLists.txt +++ b/recipes/bitsery/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(Bitsery REQUIRED CONFIG) diff --git a/recipes/bitsery/all/test_v1_package/CMakeLists.txt b/recipes/bitsery/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be90dcf1b4730..0000000000000 --- a/recipes/bitsery/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Bitsery REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE Bitsery::bitsery) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bitsery/all/test_v1_package/conanfile.py b/recipes/bitsery/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/bitsery/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_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/bitsery/config.yml b/recipes/bitsery/config.yml index 07e67c2710fe5..ef54c243e956f 100644 --- a/recipes/bitsery/config.yml +++ b/recipes/bitsery/config.yml @@ -1,11 +1,7 @@ versions: + "5.2.4": + folder: all "5.2.3": folder: all "5.2.2": folder: all - "5.2.1": - folder: all - "5.2.0": - folder: all - "5.1.0": - folder: all 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/test_package/CMakeLists.txt b/recipes/blaze/all/test_package/CMakeLists.txt index 1b0a92218a093..abdb8fc402e35 100755 --- a/recipes/blaze/all/test_package/CMakeLists.txt +++ b/recipes/blaze/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(blaze REQUIRED CONFIG) diff --git a/recipes/blaze/all/test_v1_package/CMakeLists.txt b/recipes/blaze/all/test_v1_package/CMakeLists.txt deleted file mode 100755 index ec8caed27fa90..0000000000000 --- a/recipes/blaze/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(blaze REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE blaze::blaze) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/blaze/all/test_v1_package/conanfile.py b/recipes/blaze/all/test_v1_package/conanfile.py deleted file mode 100755 index 38f4483872d47..0000000000000 --- a/recipes/blaze/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_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/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 06ef79b273e89..54dc0ba094e18 100644 --- a/recipes/blend2d/all/conandata.yml +++ b/recipes/blend2d/all/conandata.yml @@ -1,28 +1,33 @@ sources: + "0.11.4": + url: "https://blend2d.com/download/blend2d-0.11.4.tar.gz" + sha256: "07f7d99d2ebb7b42a707a4f0035745b781faf9083933f944084f66e6246bb01c" + "0.11.3": + url: "https://blend2d.com/download/blend2d-0.11.3.tar.gz" + sha256: "6dfb2c0260073f2af6c3dfe6c30a31da637e6facf7802f6b2836cc3c4e74fdd8" + "0.11.1": + url: "https://blend2d.com/download/blend2d-0.11.1.tar.gz" + sha256: "f46d61b6aa477fea1a353a41f5906d4e861817ae059ed22fc6ecdd50ff859dd2" + # When upstream will have new release, tarball may be deleted. + # Use following url: https://github.com/blend2d/blend2d/archive/a7f947677e85441abe1769586d3bb935b4086a07.tar.gz "0.10.6": - url: "https://blend2d.com/download/blend2d-0.10.6.tar.xz" - sha256: "0377f747b76d5602874351501bbbd648ba73b486273a5dcabfd6dc85c4d289b4" + url: "https://github.com/blend2d/blend2d/archive/df124784fd3e9765251c74d412d88c625e3587e9.tar.gz" + sha256: "d8a91745c79beeab29d781357308b49ef51d009237b342ce50304ea618e977ad" "0.10.5": - url: "https://blend2d.com/download/blend2d-0.10.5.tar.xz" - sha256: "fff5a7b1a6b16c986f3d02052a9a030f138fbae3a9c16bf07915416515d6b9cd" + url: "https://github.com/blend2d/blend2d/archive/99fc3aa9a1d113e913df67166d40d2a81bef1dcb.tar.gz" + sha256: "cb7426a483156721c02b28cf65969bdeeb13ffed6cf9bc4a9493d7ec4d5de8c3" "0.10.4": - url: "https://blend2d.com/download/blend2d-0.10.4.tar.xz" - sha256: "6363e5c13c1c9e4709f949585a6af772ee13a16f75b0084f91b3918dece2fff3" + url: "https://github.com/blend2d/blend2d/archive/d60f62b9d008be096daff329dfe9b8409c344651.tar.gz" + sha256: "ce197422ae8ec0d0310895bebed396091e0144ec09482439d24040196957e740" "0.10": - url: "https://blend2d.com/download/blend2d-0.10.tar.xz" - sha256: "eaed6cc5f1fc33061a99d70cf166836994d952f75762bfacb397ee388e13ccc9" + url: "https://github.com/blend2d/blend2d/archive/000d55c75994fa88efcb7a31ae32be9ec8435f7d.tar.gz" + sha256: "7a986e14d08d687bfc7510bd762a29f01b1c2449b4e60f85268dd0072c65b698" "0.9": - url: "https://blend2d.com/download/blend2d-0.9.tar.xz" - sha256: "a70a2a57c67017afa1067a11807fef9808788c69b4012ba4d56a5c47a5ba87c3" + url: "https://github.com/blend2d/blend2d/archive/346555924752f085a2a06265858bc63c8987bf98.tar.gz" + sha256: "89639d60320e8d684c3708b849ede9ac660cbd2acc33de6baa846ee7fbed24b8" "0.8": - url: "https://blend2d.com/download/blend2d-0.8.zip" - sha256: "0c1e2cc94cd4aa054c527b2dc51d533c8783a8e31779de3ba7bb49f8bd9afca1" - "0.0.18": - url: "https://blend2d.com/download/blend2d-beta18.zip" - sha256: "02d23b185183705215241d7b161937bbda5b427c54cc5aa4c03238ef8dd1e60b" - "0.0.17": - url: "https://blend2d.com/download/blend2d-beta17.zip" - sha256: "06ee8fb0bea281d09291e498900093139426501a1a7f09dba0ec801dd340635e" + url: "https://github.com/blend2d/blend2d/archive/2910c87c5e8ddedcf80bbf4871bb59d70e1170c1.tar.gz" + sha256: "34ff6f0f2dd10b39e1e6a3b07c5f76844b38f780c6849a65a34351e76e36cd3d" patches: "0.10.6": - patch_file: "patches/0.10.6-0001-disable-embed-asmjit.patch" @@ -48,15 +53,3 @@ patches: - patch_file: "patches/0.8-0001-disable-embed-asmjit.patch" patch_description: "use asmjit cci package" patch_type: "conan" - "0.0.18": - - patch_file: "patches/0.0.17-0001-disable-embed-asmjit.patch" - patch_description: "use asmjit cci package" - patch_type: "conan" - - patch_file: "patches/0.0.18-0002-fix-gcc12-compilationerror.patch" - patch_description: "fix gcc12 compilation error, backport from upstream" - patch_type: "portability" - patch_source: "https://github.com/blend2d/blend2d/commit/2574d90ebc61b5195491cc79bfa6da162084242b" - "0.0.17": - - patch_file: "patches/0.0.17-0001-disable-embed-asmjit.patch" - patch_description: "use asmjit cci package" - patch_type: "conan" diff --git a/recipes/blend2d/all/conanfile.py b/recipes/blend2d/all/conanfile.py index adbef317cace4..5663998a64f81 100644 --- a/recipes/blend2d/all/conanfile.py +++ b/recipes/blend2d/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version from conan.tools.microsoft import check_min_vs +from conan.tools.env import VirtualBuildEnv import os required_conan_version = ">=1.53.0" @@ -45,7 +46,7 @@ def layout(self): def requirements(self): if self.options.with_jit: - self.requires("asmjit/cci.20230325") + self.requires("asmjit/cci.20240531") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -56,6 +57,10 @@ def validate(self): # https://github.com/blend2d/blend2d/commit/63db360c7eb2c1c3ca9cd92a867dbb23dc95ca7d check_min_vs(self, 192) + def build_requirements(self): + if Version(self.version) >= "0.11.1": + self.tool_requires("cmake/[>=3.18 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -67,15 +72,17 @@ def generate(self): tc.variables["BLEND2D_STATIC"] = not self.options.shared tc.variables["BLEND2D_NO_STDCXX"] = False tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["BLEND2D_EXTERNAL_ASMJIT"] = True if not valid_min_cppstd(self, 11): 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) deps.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") def build(self): apply_conandata_patches(self) diff --git a/recipes/blend2d/all/patches/0.0.17-0001-disable-embed-asmjit.patch b/recipes/blend2d/all/patches/0.0.17-0001-disable-embed-asmjit.patch deleted file mode 100644 index 6a3ccd1e255b1..0000000000000 --- a/recipes/blend2d/all/patches/0.0.17-0001-disable-embed-asmjit.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 52d295a..b1a78a5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -398,10 +398,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) -+ 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.0.18-0002-fix-gcc12-compilationerror.patch b/recipes/blend2d/all/patches/0.0.18-0002-fix-gcc12-compilationerror.patch deleted file mode 100644 index b089c5a2e867f..0000000000000 --- a/recipes/blend2d/all/patches/0.0.18-0002-fix-gcc12-compilationerror.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/src/blend2d/support/arenaallocator_p.h b/src/blend2d/support/arenaallocator_p.h -index d09b6da..eebd854 100644 ---- a/src/blend2d/support/arenaallocator_p.h -+++ b/src/blend2d/support/arenaallocator_p.h -@@ -445,7 +445,7 @@ public: - template - class BLArenaAllocatorTmp : public BLArenaAllocator { - public: -- BL_NONCOPYABLE(BLArenaAllocatorTmp) -+ BL_NONCOPYABLE(BLArenaAllocatorTmp) - - BL_INLINE explicit BLArenaAllocatorTmp(size_t blockSize, size_t blockAlignment = 1) noexcept - : BLArenaAllocator(blockSize, blockAlignment, _storage.data, N) {} -diff --git a/src/blend2d/support/arenahashmap_p.h b/src/blend2d/support/arenahashmap_p.h -index 29882e1..911d985 100644 ---- a/src/blend2d/support/arenahashmap_p.h -+++ b/src/blend2d/support/arenahashmap_p.h -@@ -185,7 +185,7 @@ public: - template - class BLArenaHashMap : public BLArenaHashMapBase { - public: -- BL_NONCOPYABLE(BLArenaHashMap) -+ BL_NONCOPYABLE(BLArenaHashMap) - - typedef NodeT Node; - -diff --git a/src/blend2d/support/scopedbuffer_p.h b/src/blend2d/support/scopedbuffer_p.h -index e14df50..379f519 100644 ---- a/src/blend2d/support/scopedbuffer_p.h -+++ b/src/blend2d/support/scopedbuffer_p.h -@@ -82,7 +82,7 @@ public: - template - class BLScopedBufferTmp : public BLScopedBuffer { - public: -- BL_NONCOPYABLE(BLScopedBufferTmp) -+ BL_NONCOPYABLE(BLScopedBufferTmp) - - uint8_t _storage[N]; - diff --git a/recipes/blend2d/all/test_v1_package/CMakeLists.txt b/recipes/blend2d/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/blend2d/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/blend2d/all/test_v1_package/conanfile.py b/recipes/blend2d/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/blend2d/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_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/blend2d/config.yml b/recipes/blend2d/config.yml index 219f4d22f536c..b62e83e2e1cd2 100644 --- a/recipes/blend2d/config.yml +++ b/recipes/blend2d/config.yml @@ -1,4 +1,10 @@ versions: + "0.11.4": + folder: all + "0.11.3": + folder: all + "0.11.1": + folder: all "0.10.6": folder: all "0.10.5": @@ -11,7 +17,3 @@ versions: folder: all "0.8": folder: all - "0.0.18": - folder: all - "0.0.17": - folder: all diff --git a/recipes/bliss/all/test_package/CMakeLists.txt b/recipes/bliss/all/test_package/CMakeLists.txt index 7ec1e7802e63f..c34245159b4fa 100644 --- a/recipes/bliss/all/test_package/CMakeLists.txt +++ b/recipes/bliss/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(bliss REQUIRED CONFIG) diff --git a/recipes/bliss/all/test_v1_package/CMakeLists.txt b/recipes/bliss/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/bliss/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bliss/all/test_v1_package/conanfile.py b/recipes/bliss/all/test_v1_package/conanfile.py deleted file mode 100644 index 44c5939c51bc9..0000000000000 --- a/recipes/bliss/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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): - cnf_file = os.path.join(self.source_folder, os.pardir, "test_package", "graph.cnf") - self.run(f"bliss {cnf_file}", run_environment=True) - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/bmx/all/conandata.yml b/recipes/bmx/all/conandata.yml new file mode 100644 index 0000000000000..8475d1cd96dbc --- /dev/null +++ b/recipes/bmx/all/conandata.yml @@ -0,0 +1,27 @@ +sources: + "1.6": + url: "https://github.com/bbc/bmx/archive/v1.6.tar.gz" + sha256: "41f163965cb7fffcc022ad4a099c295b3699709ce2306ee89b713cfcfda3b25a" + "1.3": + url: "https://github.com/bbc/bmx/releases/download/v1.3/bmx-1.3.tar.gz" + sha256: "c20cd34f201510affe62c079c7f9079a10dce3a44d7f61b21f9faff624fdaeab" + "1.2": + url: "https://github.com/bbc/bmx/archive/refs/tags/v1.2.tar.gz" + sha256: "e64d91b2d27478d6b892d72183e1ecf79c99880b079ce04442432f3caed1e259" +patches: + "1.6": + - patch_file: "patches/1.3-cmake-fixes.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "1.3": + - patch_file: "patches/1.3-cmake-fixes.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "1.2": + - patch_file: "patches/1.2-cmake-fixes.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + - patch_file: "patches/1.2-fix-cpp20.patch" + patch_description: "Fix a compilation problem with C++20" + patch_type: "portability" + patch_source: "https://github.com/bbc/bmx/pull/69" diff --git a/recipes/bmx/all/conanfile.py b/recipes/bmx/all/conanfile.py new file mode 100644 index 0000000000000..2a7415f432502 --- /dev/null +++ b/recipes/bmx/all/conanfile.py @@ -0,0 +1,140 @@ +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, copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class BmxConan(ConanFile): + name = "bmx" + description = ( + "Library for handling broadcast/production oriented media file formats. " + "Allows reading, modifying and writing media metadata and file essences." + ) + topics = ("vfx", "image", "picture", "video", "multimedia", "mxf") + license = "BSD-3-Clause" + homepage = "https://github.com/bbc/bmx" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libcurl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libcurl": 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 requirements(self): + # Required libraries + self.requires("uriparser/0.9.8") + self.requires("expat/[>=2.6.2 <3]") + + if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): + self.requires('libuuid/1.0.3') + + # Configuration dependent requirements + if self.options.with_libcurl: + self.requires("libcurl/[>=7.78.0 <9]") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + # Symbol export is currently not working properly on Windows so shared + # libraries are currently deactivated. This can later be revisited based + # on https://github.com/bbc/bmx/issues/80 + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration( + "Building as a shared library currently not supported on Windows!" + ) + + 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["BMX_BUILD_WITH_LIBCURL"] = self.options.with_libcurl + tc.generate() + + cd = CMakeDeps(self) + cd.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")) + + @staticmethod + def _conan_comp(name): + return f"bmx_{name.lower()}" + + def _add_component(self, name): + component = self.cpp_info.components[self._conan_comp(name)] + component.set_property("cmake_target_name", f"bmx::{name}") + component.names["cmake_find_package"] = name + component.names["cmake_find_package_multi"] = name + return component + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "bmx") + self.cpp_info.set_property("pkg_config_name", "bmx") + + self.cpp_info.names["cmake_find_package"] = "bmx" + self.cpp_info.names["cmake_find_package_multi"] = "bmx" + + # bbc-bmx::MXF + libmxf = self._add_component("MXF") + libmxf.libs = ["MXF"] + libmxf.requires = [] + if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): + libmxf.requires.append("libuuid::libuuid") + + # bbc-bmx::MXF++ + libmxfpp = self._add_component("MXF++") + libmxfpp.libs = ["MXF++"] + libmxfpp.requires = [ + "bmx_mxf" + ] + + # bbc-bmx::bmx + libbmx = self._add_component("bmx") + libbmx.libs = ["bmx"] + libbmx.requires = [ + "bmx_mxf", + "bmx_mxf++", + "expat::expat", + "uriparser::uriparser", + ] + if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): + libbmx.requires.append("libuuid::libuuid") + + if self.options.with_libcurl: + libbmx.requires.append("libcurl::libcurl") diff --git a/recipes/bmx/all/patches/1.2-cmake-fixes.patch b/recipes/bmx/all/patches/1.2-cmake-fixes.patch new file mode 100644 index 0000000000000..29a8742dbedbb --- /dev/null +++ b/recipes/bmx/all/patches/1.2-cmake-fixes.patch @@ -0,0 +1,141 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 6fe9540e7..8b2578852 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -34,7 +34,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + # Set the test samples output directory + if(BMX_TEST_SAMPLES_DIR STREQUAL "") +@@ -75,7 +75,7 @@ if(MSVC) + endforeach() + endif() + else() +- add_compile_options(-W -Wall -O2) ++ add_compile_options(-W -Wall) + + # Enable large file support on 32-bit systems. + add_definitions( +@@ -93,11 +93,25 @@ add_custom_target(bmx_test_data) + + include("${PROJECT_SOURCE_DIR}/cmake/libmxf.cmake") + include("${PROJECT_SOURCE_DIR}/cmake/libmxfpp.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#if(BMX_BUILD_WITH_LIBCURL) ++# include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++#endif() ++ ++find_package(expat REQUIRED) ++find_package(uriparser REQUIRED) ++if(UNIX AND NOT APPLE) ++ find_package(libuuid REQUIRED) ++ set(uuid_link_lib libuuid::libuuid) ++else() ++ # MSVC: "ole" will already be linked in ++ # APPLE: doesn't require uuid library ++ set(uuid_link_lib) ++endif() + if(BMX_BUILD_WITH_LIBCURL) +- include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++ find_package(CURL REQUIRED) + endif() + + configure_file(config.h.in config.h) +diff --git deps/libMXF/CMakeLists.txt deps/libMXF/CMakeLists.txt +index d36fde6c0..6a1af100b 100644 +--- deps/libMXF/CMakeLists.txt ++++ deps/libMXF/CMakeLists.txt +@@ -35,7 +35,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + # Set the test samples output directory + if(LIBMXF_TEST_SAMPLES_DIR STREQUAL "") +@@ -76,7 +76,7 @@ if(MSVC) + endforeach() + endif() + else() +- add_compile_options(-W -Wall -O2) ++ add_compile_options(-W -Wall) + + # Enable large file support on 32-bit systems. + add_definitions( +diff --git deps/libMXFpp/CMakeLists.txt deps/libMXFpp/CMakeLists.txt +index 2272a2709..924fdf770 100644 +--- deps/libMXFpp/CMakeLists.txt ++++ deps/libMXFpp/CMakeLists.txt +@@ -35,7 +35,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + if(MSVC) + add_compile_options(/W3 /EHsc) +@@ -61,7 +61,7 @@ if(MSVC) + endforeach() + endif() + else() +- add_compile_options(-W -Wall -O2) ++ add_compile_options(-W -Wall) + + # Enable large file support on 32-bit systems. + add_definitions( +diff --git deps/libMXFpp/libMXF++/CMakeLists.txt deps/libMXFpp/libMXF++/CMakeLists.txt +index 94d48c905..e6c6a63f9 100644 +--- deps/libMXFpp/libMXF++/CMakeLists.txt ++++ deps/libMXFpp/libMXF++/CMakeLists.txt +@@ -32,6 +32,8 @@ add_library(MXFpp + ${MXFpp_sources} + ) + ++target_compile_features(MXFpp PUBLIC cxx_std_11) ++ + target_include_directories(MXFpp PUBLIC + ${PROJECT_SOURCE_DIR} + ) +diff --git src/CMakeLists.txt src/CMakeLists.txt +index 1c0824d8a..94f9c00d6 100644 +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -26,6 +26,8 @@ target_include_directories(bmx PUBLIC + ${PROJECT_SOURCE_DIR}/include + ) + ++target_compile_features(bmx PUBLIC cxx_std_11) ++ + # Add path to header files if not included in MSVC distribution + if(MSVC) + include(CheckIncludeFile) +@@ -65,13 +67,14 @@ target_link_libraries(bmx + ${MXFpp_link_lib} + PRIVATE + ${uuid_link_lib} +- ${expat_link_lib} +- ${uriparser_link_lib} ++ expat::expat ++ uriparser::uriparser + ) + + if(BMX_BUILD_WITH_LIBCURL) +- target_link_libraries(bmx PRIVATE +- ${libcurl_link_lib} ++ # Linking public to see if the shared library for curls dependencies correctly link ++ target_link_libraries(bmx PUBLIC ++ CURL::libcurl + ) + endif() + diff --git a/recipes/bmx/all/patches/1.2-fix-cpp20.patch b/recipes/bmx/all/patches/1.2-fix-cpp20.patch new file mode 100644 index 0000000000000..862806a6a30d2 --- /dev/null +++ b/recipes/bmx/all/patches/1.2-fix-cpp20.patch @@ -0,0 +1,26 @@ +diff --git deps/libMXFpp/libMXF++/MXFVersion.cpp deps/libMXFpp/libMXF++/MXFVersion.cpp +index 333d5871..bb247a32 100644 +--- deps/libMXFpp/libMXF++/MXFVersion.cpp ++++ deps/libMXFpp/libMXF++/MXFVersion.cpp +@@ -33,6 +33,8 @@ + #include "config.h" + #endif + ++#include ++ + #include "git.h" + #include "fallback_git_version.h" + +diff --git src/common/Version.cpp src/common/Version.cpp +index a4f00e14..d51da64a 100644 +--- src/common/Version.cpp ++++ src/common/Version.cpp +@@ -219,7 +219,7 @@ mxfProductVersion bmx::get_bmx_mxf_product_version() + // Set the patch version value to the commit offset from the release tag. + // The commit offset is part of the git describe tag string which has the + // format "--g" +- string describe = bmx_git::DescribeTag(); ++ string describe = std::string(bmx_git::DescribeTag()); + #ifdef PACKAGE_GIT_VERSION_STRING + if (describe.empty() || describe == "unknown") + describe = PACKAGE_GIT_VERSION_STRING; diff --git a/recipes/bmx/all/patches/1.3-cmake-fixes.patch b/recipes/bmx/all/patches/1.3-cmake-fixes.patch new file mode 100644 index 0000000000000..51915e0cc5aa0 --- /dev/null +++ b/recipes/bmx/all/patches/1.3-cmake-fixes.patch @@ -0,0 +1,57 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 3139ef78e..a08fbb589 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -91,11 +91,26 @@ add_custom_target(bmx_test_data) + + include("${PROJECT_SOURCE_DIR}/cmake/libmxf.cmake") + include("${PROJECT_SOURCE_DIR}/cmake/libmxfpp.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#if(BMX_BUILD_WITH_LIBCURL) ++# include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++#endif() ++ ++find_package(expat REQUIRED) ++find_package(uriparser REQUIRED) ++if(UNIX AND NOT APPLE) ++ find_package(libuuid REQUIRED) ++ set(uuid_link_lib libuuid::libuuid) ++else() ++ # MSVC: "ole" will already be linked in ++ # APPLE: doesn't require uuid library ++ set(uuid_link_lib) ++endif() + if(BMX_BUILD_WITH_LIBCURL) + include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++ find_package(CURL REQUIRED) + endif() + + configure_file(config.h.in config.h) +diff --git src/CMakeLists.txt src/CMakeLists.txt +index 59c94b8b9..94f9c00d6 100644 +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -67,13 +67,14 @@ target_link_libraries(bmx + ${MXFpp_link_lib} + PRIVATE + ${uuid_link_lib} +- ${expat_link_lib} +- ${uriparser_link_lib} ++ expat::expat ++ uriparser::uriparser + ) + + if(BMX_BUILD_WITH_LIBCURL) +- target_link_libraries(bmx PRIVATE +- ${libcurl_link_lib} ++ # Linking public to see if the shared library for curls dependencies correctly link ++ target_link_libraries(bmx PUBLIC ++ CURL::libcurl + ) + endif() + diff --git a/recipes/bmx/all/test_package/CMakeLists.txt b/recipes/bmx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..94b52689c7505 --- /dev/null +++ b/recipes/bmx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(bmx REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +target_link_libraries(${PROJECT_NAME} PRIVATE bmx::bmx) diff --git a/recipes/bmx/all/test_package/conanfile.py b/recipes/bmx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/bmx/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/bmx/all/test_package/test_package.cpp b/recipes/bmx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..708a858acfc27 --- /dev/null +++ b/recipes/bmx/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include + +#include + +int main() { + std::cout << bmx::get_bmx_library_name() << " library version " << bmx::get_bmx_version_string() << std::endl; + + const auto mxf_version = mxf_get_version(); + std::cout << "MXF library version " + << mxf_version->major << '.' << mxf_version->minor << '.' << mxf_version->patch << std::endl; + + return 0; +} diff --git a/recipes/bmx/config.yml b/recipes/bmx/config.yml new file mode 100644 index 0000000000000..a4b757c178eb0 --- /dev/null +++ b/recipes/bmx/config.yml @@ -0,0 +1,7 @@ +versions: + "1.6": + folder: all + "1.3": + folder: all + "1.2": + folder: all diff --git a/recipes/boolean-lite/all/test_package/CMakeLists.txt b/recipes/boolean-lite/all/test_package/CMakeLists.txt index 3c97278b05cc2..4a9bee4400ef9 100644 --- a/recipes/boolean-lite/all/test_package/CMakeLists.txt +++ b/recipes/boolean-lite/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(boolean-lite REQUIRED CONFIG) diff --git a/recipes/boolean-lite/all/test_v1_package/CMakeLists.txt b/recipes/boolean-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b87d5ceee70b7..0000000000000 --- a/recipes/boolean-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(boolean-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::boolean-lite) diff --git a/recipes/boolean-lite/all/test_v1_package/conanfile.py b/recipes/boolean-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/boolean-lite/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_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/boolinq/all/test_package/CMakeLists.txt b/recipes/boolinq/all/test_package/CMakeLists.txt index bb2f73e7d69ee..fe9fec9c46e9e 100644 --- a/recipes/boolinq/all/test_package/CMakeLists.txt +++ b/recipes/boolinq/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(boolinq REQUIRED CONFIG) diff --git a/recipes/boolinq/all/test_v1_package/CMakeLists.txt b/recipes/boolinq/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index cdc0bcf4354a1..0000000000000 --- a/recipes/boolinq/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(boolinq REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE boolinq::boolinq) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/boolinq/all/test_v1_package/conanfile.py b/recipes/boolinq/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/boolinq/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_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/boost-ext-ut/all/conandata.yml b/recipes/boost-ext-ut/all/conandata.yml index f123657f3fbe3..81761a3dd0a75 100644 --- a/recipes/boost-ext-ut/all/conandata.yml +++ b/recipes/boost-ext-ut/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.1.0": + url: "https://github.com/boost-ext/ut/archive/v2.1.0.tar.gz" + sha256: "1c9c35c039ad3a9795a278447db6da0a4ec1a1d223bf7d64687ad28f673b7ae8" + "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" diff --git a/recipes/boost-ext-ut/all/conanfile.py b/recipes/boost-ext-ut/all/conanfile.py index a73d7aef01853..87082efe83c5e 100644 --- a/recipes/boost-ext-ut/all/conanfile.py +++ b/recipes/boost-ext-ut/all/conanfile.py @@ -52,6 +52,11 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): + if (Version(self.version) == "2.1.0" and self.settings.os == "Linux" and self.settings.compiler == "clang" and + 12 <= Version(self.settings.compiler.version) <= 16 and "libstdc++" in self.settings.compiler.libcxx): + # https://github.com/boost-ext/ut/issues/637 + raise ConanInvalidConfiguration(f"{self.ref} does support Clang + libstdc++. Use -s compiler.libcxx=libc++ or Clang >16.") + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) if Version(self.version) <= "1.1.8" and is_msvc(self): diff --git a/recipes/boost-ext-ut/all/test_package/CMakeLists.txt b/recipes/boost-ext-ut/all/test_package/CMakeLists.txt index 1f234990a3bc2..a0fef1e567646 100644 --- a/recipes/boost-ext-ut/all/test_package/CMakeLists.txt +++ b/recipes/boost-ext-ut/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(ut REQUIRED CONFIG) diff --git a/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt b/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b3e2caed93a69..0000000000000 --- a/recipes/boost-ext-ut/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.12) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(ut REQUIRED CONFIG) - -set(namespace Boost) -if(ut_VERSION VERSION_LESS "1.1.9") - set(namespace boost) -endif() - -add_executable(test_package ../test_package/test_package.cpp) -target_link_libraries(test_package PRIVATE "${namespace}::ut") -target_compile_features(test_package PRIVATE cxx_std_20) diff --git a/recipes/boost-ext-ut/all/test_v1_package/conanfile.py b/recipes/boost-ext-ut/all/test_v1_package/conanfile.py deleted file mode 100644 index 37ada808989d9..0000000000000 --- a/recipes/boost-ext-ut/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", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/boost-ext-ut/config.yml b/recipes/boost-ext-ut/config.yml index 483296a860daa..61e709f7dc6a2 100644 --- a/recipes/boost-ext-ut/config.yml +++ b/recipes/boost-ext-ut/config.yml @@ -1,7 +1,11 @@ versions: - "2.0.0": + "2.1.0": folder: "all" - "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/test_package/CMakeLists.txt b/recipes/boost-leaf/all/test_package/CMakeLists.txt index ca3f81cb32f1b..bda151dcf3071 100644 --- a/recipes/boost-leaf/all/test_package/CMakeLists.txt +++ b/recipes/boost-leaf/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(boost-leaf REQUIRED CONFIG) diff --git a/recipes/boost-leaf/all/test_v1_package/CMakeLists.txt b/recipes/boost-leaf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3b99781525c3c..0000000000000 --- a/recipes/boost-leaf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.12) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(boost-leaf REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/main.cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) -target_link_libraries(${PROJECT_NAME} PRIVATE boost::leaf) diff --git a/recipes/boost-leaf/all/test_v1_package/conanfile.py b/recipes/boost-leaf/all/test_v1_package/conanfile.py deleted file mode 100644 index 25bed518a9fa8..0000000000000 --- a/recipes/boost-leaf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - - -class LibhalTestPackageConan(ConanFile): - settings = "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(self.build_folder, "bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/boost/all/conandata.yml b/recipes/boost/all/conandata.yml index ee7228b61bc72..4db365c22a2b0 100644 --- a/recipes/boost/all/conandata.yml +++ b/recipes/boost/all/conandata.yml @@ -1,72 +1,91 @@ sources: + "1.87.0": + url: + - "https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.87.0/boost_1_87_0.tar.bz2" + sha256: "af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89" + "1.86.0": + url: + - "https://archives.boost.io/release/1.86.0/source/boost_1_86_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.86.0/boost_1_86_0.tar.bz2" + sha256: "1bed88e40401b2cb7a1f76d4bab499e352fa4d0c5f31c0dbae64e24d34d7513b" + "1.85.0": + url: + - "https://archives.boost.io/release/1.85.0/source/boost_1_85_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.85.0/boost_1_85_0.tar.bz2" + sha256: "7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617" + "1.84.0": + url: + - "https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2" + - "https://sourceforge.net/projects/boost/files/boost/1.84.0/boost_1_84_0.tar.bz2" + sha256: "cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454" "1.83.0": url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2" + - "https://archives.boost.io/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://archives.boost.io/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" + - "https://archives.boost.io/release/1.81.0/source/boost_1_81_0.tar.bz2" - "https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.bz2" sha256: "71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa" "1.80.0": url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2" + - "https://archives.boost.io/release/1.80.0/source/boost_1_80_0.tar.bz2" - "https://sourceforge.net/projects/boost/files/boost/1.80.0/boost_1_80_0.tar.bz2" sha256: "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0" "1.79.0": url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2" + - "https://archives.boost.io/release/1.79.0/source/boost_1_79_0.tar.bz2" - "https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2" sha256: "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" "1.78.0": url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2" + - "https://archives.boost.io/release/1.78.0/source/boost_1_78_0.tar.bz2" - "https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.bz2" sha256: "8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc" - "1.77.0": - url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2" - - "https://sourceforge.net/projects/boost/files/boost/1.77.0/boost_1_77_0.tar.bz2" - sha256: "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" - "1.76.0": - url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2" - - "https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2" - sha256: "f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41" - "1.75.0": - url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2" - - "https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2" - sha256: "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb" - "1.74.0": - url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2" - - "https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.bz2" - sha256: "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1" - "1.73.0": - url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.bz2" - - "https://sourceforge.net/projects/boost/files/boost/1.73.0/boost_1_73_0.tar.bz2" - sha256: "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402" - "1.72.0": - url: - - "https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2" - - "https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2" - sha256: "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722" - "1.71.0": - url: "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2" - sha256: "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee" patches: + "1.87.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.87.0-boost-fiber-fix-property-numa.patch" + patch_description: "Fix b2 numa=on property for Boost.Fiber" + patch_type: "official" + patch_source: https://github.com/boostorg/fiber/commit/238487b543e8863c647d31a82ccfc3fa11a960d9" + "1.86.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.85.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.85.0-container-aliasing-violation-fix.patch" + patch_description: "Fix aliasing violation in boost::container" + patch_type: "official" + patch_source: "https://github.com/boostorg/container/commit/20ad12f20e661978e90dc7f36d8ab8ac05e5a5a9" + "1.84.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.84.0-reimplement-string_set-as-any-string.patch" + patch_description: "Fix compilation with cppstd=20 on libcxx platforms (e.g. MacOS)" + patch_type: "official" + patch_source: "https://github.com/boostorg/locale/commit/c5e8f02c903696a213fc4b710f6740ccd1f07f4e" "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" @@ -153,191 +172,3 @@ patches: patch_description: "Don't skip install targets if there's no in ureqs" patch_type: "official" patch_source: "https://github.com/boostorg/build/pull/113" - "1.77.0": - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - patch_description: "Fails the build when there is no iconv backend" - patch_type: "conan" - - patch_file: "patches/boost_1_77_mpi_check.patch" - patch_description: "Fails the build when mpi is not configured" - patch_type: "conan" - - patch_file: "patches/1.69.0-locale-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.77.0-type_erasure-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.77.0-fiber-mingw.patch" - patch_description: "fix layout=versioned for clang@Macos + mingw@Windows" - patch_type: "conan" - - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" - patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" - patch_type: "conan" - "1.76.0": - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - patch_description: "Fails the build when there is no iconv backend" - patch_type: "conan" - - patch_file: "patches/boost_mpi_check.patch" - patch_description: "Fails the build when mpi is not configured" - patch_type: "conan" - - patch_file: "patches/1.69.0-locale-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.76.0-0001-fix-include-inside-boost-namespace.patch" - patch_description: "Fix #include inside boost namespace" - patch_type: "bugfix" - patch_source: "https://github.com/boostorg/math/pull/670" - - patch_file: "patches/1.77.0-type_erasure-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.77.0-boost_build-with-newer-b2.patch" - patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" - patch_type: "conan" - "1.75.0": - - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/python_base_prefix_since_1_74.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - patch_description: "Fails the build when there is no iconv backend" - patch_type: "conan" - - patch_file: "patches/boost_mpi_check.patch" - patch_description: "Fails the build when mpi is not configured" - patch_type: "conan" - - patch_file: "patches/1.69.0-locale-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.77.0-type_erasure-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" - patch_type: "conan" - "1.74.0": - - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/python_base_prefix_since_1_74.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - patch_description: "Fails the build when there is no iconv backend" - patch_type: "conan" - - patch_file: "patches/boost_mpi_check.patch" - patch_description: "Fails the build when mpi is not configured" - patch_type: "conan" - - patch_file: "patches/1.69.0-locale-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.69.0-random-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.69.0-type_erasure-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" - patch_type: "conan" - "1.73.0": - - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/python_base_prefix.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - patch_description: "Fails the build when there is no iconv backend" - patch_type: "conan" - - patch_file: "patches/boost_mpi_check.patch" - patch_description: "Fails the build when mpi is not configured" - patch_type: "conan" - - patch_file: "patches/1.69.0-locale-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.69.0-random-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.69.0-type_erasure-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" - patch_type: "conan" - "1.72.0": - - patch_file: "patches/bcp_namespace_issues_1_72.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/python_base_prefix.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/solaris_pthread_data.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/0001-revert-cease-dependence-on-range.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_log_filesystem_no_deprecated_1_72.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - patch_description: "Fails the build when there is no iconv backend" - patch_type: "conan" - - patch_file: "patches/boost_mpi_check.patch" - patch_description: "Fails the build when mpi is not configured" - patch_type: "conan" - - patch_file: "patches/1.69.0-locale-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.69.0-random-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.69.0-type_erasure-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" - patch_type: "conan" - "1.71.0": - - patch_file: "patches/bcp_namespace_issues_1_71.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/python_base_prefix.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/solaris_pthread_data.patch" - patch_description: "" - patch_type: "conan" - - patch_file: "patches/boost_locale_fail_on_missing_backend.patch" - patch_description: "Fails the build when there is no iconv backend" - patch_type: "conan" - - patch_file: "patches/boost_mpi_check.patch" - patch_description: "Fails the build when mpi is not configured" - patch_type: "conan" - - patch_file: "patches/1.69.0-contract-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.69.0-locale-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.69.0-random-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.69.0-type_erasure-no-system.patch" - patch_description: "This library links to boost_system, even though that library is header-only" - patch_type: "conan" - - patch_file: "patches/1.75.0-boost_build-with-newer-b2.patch" - patch_description: "Bump build_requires of 'b2' to '4.7.1' (was '4.5.0')" - patch_type: "conan" diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index 5bab9c6c7ebdd..98ad17a63842e 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanException, ConanInvalidConfiguration from conan.tools.apple import is_apple_os, to_apple_arch, XCRun -from conan.tools.build import build_jobs, check_min_cppstd, cross_building, valid_min_cppstd +from conan.tools.build import build_jobs, cross_building, valid_min_cppstd, supported_cppstd from conan.tools.env import VirtualBuildEnv from conan.tools.files import ( apply_conandata_patches, chdir, collect_libs, copy, export_conandata_patches, @@ -23,12 +23,13 @@ required_conan_version = ">=1.53.0" - # When adding (or removing) an option, also add this option to the list in # `rebuild-dependencies.yml` and re-run that script. CONFIGURE_OPTIONS = ( "atomic", + "charconv", "chrono", + "cobalt", "container", "context", "contract", @@ -46,6 +47,7 @@ "math", "mpi", "nowide", + "process", "program_options", "python", "random", @@ -81,7 +83,7 @@ class BoostConan(ConanFile): "filesystem_no_deprecated": [True, False], "filesystem_use_std_fs": [True, False], "filesystem_version": [None, "3", "4"], - "layout": ["system", "versioned", "tagged", "b2-default"], + "layout": ["system", "versioned", "tagged"], "magic_autolink": [True, False], # enables BOOST_ALL_NO_LIB "diagnostic_definitions": [True, False], # enables BOOST_LIB_DIAGNOSTIC "python_executable": [None, "ANY"], # system default python installation is used, if None @@ -160,24 +162,167 @@ def export(self): def export_sources(self): export_conandata_patches(self) + def _cppstd_flag(self, compiler_cppstd=None): + """Return the flag for the given C++ standard and compiler""" + # TODO: Replace it by Conan tool when available: https://github.com/conan-io/conan/issues/12603 + compiler = self.settings.get_safe("compiler") + compiler_version = self.settings.get_safe("compiler.version") + cppstd = self.settings.get_safe("compiler.cppstd") or compiler_cppstd + if not compiler or not compiler_version or not cppstd: + return "" + + def _cppstd_gcc(gcc_version, cppstd): + """Return the flag for the given C++ standard and GCC version""" + cppstd_flags = {} + cppstd_flags.setdefault("98", "98" if gcc_version >= "3.4" else None) + cppstd_flags.setdefault("11", "11" if gcc_version >= "4.7" else "0x" if gcc_version >= "4.3" else None) + cppstd_flags.setdefault("14", "14" if gcc_version >= "4.9" else "1y" if gcc_version >= "4.8" else None) + cppstd_flags.setdefault("17", "17" if gcc_version >= "5.2" else "1z" if gcc_version >= "5" else None) + cppstd_flags.setdefault("20", "2a" if gcc_version >= "8" else "20" if gcc_version >= "12" else None) + cppstd_flags.setdefault("23", "2b" if gcc_version >= "11" else None) + return cppstd_flags.get(cppstd.lstrip("gnu")) + + def _cppstd_clang(clang_version, cppstd): + """Return the flag for the given C++ standard and Clang version""" + cppstd_flags = {} + cppstd_flags.setdefault("98", "98" if clang_version >= "2.1" else None) + cppstd_flags.setdefault("11", "11" if clang_version >= "3.1" else "0x" if clang_version >= "2.1" else None) + cppstd_flags.setdefault("14", "14" if clang_version >= "3.5" else "1y" if clang_version >= "3.4" else None) + cppstd_flags.setdefault("17", "17" if clang_version >= "5" else "1z" if clang_version >= "3.5" else None) + cppstd_flags.setdefault("20", "2a" if clang_version >= "6" else "20" if clang_version >= "12" else None) + cppstd_flags.setdefault("23", "2b" if clang_version >= "13" else "23" if clang_version >= "17" else None) + return cppstd_flags.get(cppstd.lstrip("gnu")) + + + def _cppstd_apple_clang(clang_version, cppstd): + """Return the flag for the given C++ standard and Apple Clang version""" + cppstd_flags = {} + cppstd_flags.setdefault("98", "98" if clang_version >= "4.0" else None) + cppstd_flags.setdefault("11", "11" if clang_version >= "4.0" else None) + cppstd_flags.setdefault("14", "14" if clang_version >= "6.1" else "1y" if clang_version >= "5.1" else None) + cppstd_flags.setdefault("17", "17" if clang_version >= "9.1" else "1z" if clang_version >= "6.1" else None) + cppstd_flags.setdefault("20", "20" if clang_version >= "13.0" else "2a" if clang_version >= "10.0" else None) + cppstd_flags.setdefault("23", "2b" if clang_version >= "13.0" else None) + return cppstd_flags.get(cppstd.lstrip("gnu")) + + def _cppstd_msvc(visual_version, cppstd): + """Return the flag for the given C++ standard and MSVC version""" + cppstd_flags = {} + cppstd_flags.setdefault("98", "98") + cppstd_flags.setdefault("11", "11") + cppstd_flags.setdefault("14", "14" if visual_version >= "190" else None) + cppstd_flags.setdefault("17", "17" if visual_version >= "191" else "latest" if visual_version >= "190" else None) + cppstd_flags.setdefault("20", "20" if visual_version >= "192" else "latest" if visual_version >= "191" else None) + cppstd_flags.setdefault("23", "latest" if visual_version >= "193" else None) + return cppstd_flags.get(cppstd) + + func = {"gcc": _cppstd_gcc, "clang": _cppstd_clang, "apple-clang": _cppstd_apple_clang, "msvc": _cppstd_msvc}.get(compiler) + flag = cppstd + if func: + flag = func(Version(compiler_version), str(cppstd)) + return flag + @property def _min_compiler_version_default_cxx11(self): - # Minimum compiler version having c++ standard >= 11 - if self.settings.compiler == "apple-clang": - # For now, assume apple-clang will enable c++11 in the distant future - return 99 + """ Minimum compiler version having c++ standard >= 11 + """ return { "gcc": 6, "clang": 6, + "apple-clang": 99, # still uses C++98 by default. XCode does not reflect apple-clang "Visual Studio": 14, # guess "msvc": 190, # guess }.get(str(self.settings.compiler)) + @property + def _min_compiler_version_default_cxx14(self): + """ Minimum compiler version having c++ standard >= 14 + https://gcc.gnu.org/gcc-6/changes.html + https://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html#id9 + https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-150#remarks + """ + return { + "gcc": 6, + "clang": 6, + "apple-clang": 99, # still uses C++98 by default. XCode does not reflect apple-clang + "Visual Studio": 15, # guess + "msvc": 191, # guess + }.get(str(self.settings.compiler)) + + @property + def _min_compiler_version_default_cxx20(self): + return { + "gcc": 99, + "clang": 99, + "apple-clang": 99, + "Visual Studio": 99, + "msvc": 999, + }.get(str(self.settings.compiler)) + + @property + def _has_cppstd_11_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + return valid_min_cppstd(self, 11) + compiler_version = self._min_compiler_version_default_cxx11 + if compiler_version: + return (Version(self.settings.compiler.version) >= compiler_version) or "11" in supported_cppstd(self) + + @property + def _has_cppstd_14_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + return valid_min_cppstd(self, 14) + required_compiler_version = self._min_compiler_version_default_cxx14 + if required_compiler_version: + msvc_versions = {14: 190, 15: 191, 16: 192, 17: 193} + compiler_version = Version(self.settings.compiler.version) + is_visual_studio = str(self.settings.compiler) == "Visual Studio" + # supported_cppstd only supports msvc, but not Visual Studio as compiler + supported_cxx14 = "14" in supported_cppstd(self, "msvc", msvc_versions.get(compiler_version)) if is_visual_studio else "14" in supported_cppstd(self) + # supported_cppstd: lists GCC 5 due partial support for C++14, but not enough for Boost + return (compiler_version >= required_compiler_version) and supported_cxx14 + + @property + def _has_cppstd_20_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + if cppstd: + return valid_min_cppstd(self, 20) + required_compiler_version = self._min_compiler_version_default_cxx20 + if required_compiler_version: + msvc_versions = {14: 190, 15: 191, 16: 192, 17: 193} + compiler_version = Version(self.settings.compiler.version) + is_visual_studio = str(self.settings.compiler) == "Visual Studio" + # supported_cppstd only supports msvc, but not Visual Studio as compiler + supported_cxx20 = "20" in supported_cppstd(self, "msvc", msvc_versions.get(compiler_version)) if is_visual_studio else "20" in supported_cppstd(self) + # We still dont have a compiler using C++20 by default + return (compiler_version >= required_compiler_version) or supported_cxx20 + + @property + def _has_coroutine_supported(self): + cppstd = self.settings.compiler.get_safe("cppstd") + cppstd_20_supported = True + if cppstd: + cppstd_20_supported = valid_min_cppstd(self, 20) + # https://en.cppreference.com/w/cpp/compiler_support#cpp20 + # https://releases.llvm.org/14.0.0/tools/clang/docs/ReleaseNotes.html#clang-format: before is experimental header + # https://gcc.gnu.org/gcc-10/changes.html: requires -fcoroutines + min_compiler_versions = { + "apple-clang": "12", + "clang": "14", + "gcc": "10", + "msvc": "192", + "Visual Studio": "16",} + required_compiler_version = min_compiler_versions.get(str(self.settings.compiler)) + if not required_compiler_version: + return cppstd_20_supported + return cppstd_20_supported and Version(self.settings.compiler.version) >= required_compiler_version + @property def _min_compiler_version_nowide(self): # Nowide needs c++11 + swappable std::fstream return { - "gcc": 5, + "gcc": 4.8, "clang": 5, "Visual Studio": 14, # guess "msvc": 190, # guess @@ -276,7 +421,7 @@ def config_options(self): else: version_cxx11_standard_json = self._min_compiler_version_default_cxx11 if version_cxx11_standard_json: - if Version(self.settings.compiler.version) < version_cxx11_standard_json: + if not self._has_cppstd_11_supported: self.options.without_fiber = True self.options.without_json = True self.options.without_nowide = True @@ -286,6 +431,10 @@ def config_options(self): self.options.without_json = True self.options.without_nowide = True self.options.without_url = True + if Version(self.version) >= "1.85.0" and not self._has_cppstd_14_supported: + self.options.without_math = True + if Version(self.version) >= "1.86.0" and not self._has_cppstd_14_supported: + self.options.without_graph = True # iconv is off by default on Windows and Solaris if self._is_windows_platform or self.settings.os == "SunOS": @@ -303,27 +452,36 @@ def config_options(self): if dep_name not in self._configure_options: delattr(self.options, f"without_{dep_name}") - if Version(self.version) >= "1.76.0": - # Starting from 1.76.0, Boost.Math requires a c++11 capable compiler - # ==> disable it by default for older compilers or c++ standards - - def disable_math(): - super_modules = self._all_super_modules("math") - for smod in super_modules: - try: - setattr(self.options, f"without_{smod}", True) - except ConanException: - pass - - if self.settings.compiler.get_safe("cppstd"): - if not valid_min_cppstd(self, 11): - disable_math() - else: - min_compiler_version = self._min_compiler_version_default_cxx11 - if min_compiler_version is None: - self.output.warning("Assuming the compiler supports c++11 by default") - elif Version(self.settings.compiler.version) < min_compiler_version: - disable_math() + def disable_math(): + super_modules = self._all_super_modules("math") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + def disable_graph(): + super_modules = self._all_super_modules("graph") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + # Starting from 1.76.0, Boost.Math requires a c++11 capable compiler + # ==> disable it by default for older compilers or c++ standards + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 11): + disable_math() + else: + min_compiler_version = self._min_compiler_version_default_cxx11 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++11 by default") + elif not self._has_cppstd_11_supported: + disable_math() + # Boost.Math is not built when the compiler is GCC < 5 and uses C++11 + elif self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + disable_math() if Version(self.version) >= "1.79.0": # Starting from 1.79.0, Boost.Wave requires a c++11 capable compiler @@ -344,7 +502,10 @@ def disable_wave(): min_compiler_version = self._min_compiler_version_default_cxx11 if min_compiler_version is None: self.output.warning("Assuming the compiler supports c++11 by default") - elif Version(self.settings.compiler.version) < min_compiler_version: + elif not self._has_cppstd_11_supported: + disable_wave() + # Boost.Wave is not built when the compiler is GCC < 5 and uses C++11 + elif self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": disable_wave() if Version(self.version) >= "1.81.0": @@ -366,9 +527,78 @@ def disable_locale(): min_compiler_version = self._min_compiler_version_default_cxx11 if min_compiler_version is None: self.output.warning("Assuming the compiler supports c++11 by default") - elif Version(self.settings.compiler.version) < min_compiler_version: + elif not self._has_cppstd_11_supported: + disable_locale() + # Boost.Locale is not built when the compiler is GCC < 5 and uses C++11 + elif self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": disable_locale() + if Version(self.version) >= "1.84.0": + # Starting from 1.84.0, Boost.Cobalt requires a c++20 capable compiler + # ==> disable it by default for older compilers or c++ standards + + def disable_cobalt(): + super_modules = self._all_super_modules("cobalt") + for smod in super_modules: + try: + setattr(self.options, f"without_{smod}", True) + except ConanException: + pass + + if not self._has_coroutine_supported: + disable_cobalt() + elif self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 20): + disable_cobalt() + else: + min_compiler_version = self._min_compiler_version_default_cxx20 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++20 by default") + elif Version(self.settings.compiler.version) < min_compiler_version: + disable_cobalt() + + # FIXME: Compilation errors on msvc shared build for boost.fiber https://github.com/boostorg/fiber/issues/314 + if is_msvc(self): + self.options.without_fiber = True + + if Version(self.version) >= "1.85.0": + # Starting from 1.85.0, Boost.Math requires a c++14 capable compiler + # https://github.com/boostorg/math/blob/boost-1.85.0/README.md + # ==> disable it by default for older compilers or c++ standards + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 14): + disable_math() + else: + min_compiler_version = self._min_compiler_version_default_cxx14 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++14 by default") + elif not self._has_cppstd_14_supported: + disable_math() + + if Version(self.version) >= "1.86.0": + # Boost 1.86.0 updated more components that require C++14 and C++17 + # https://www.boost.org/users/history/version_1_86_0.html + if self.settings.compiler.get_safe("cppstd"): + if not valid_min_cppstd(self, 14): + disable_graph() + else: + min_compiler_version = self._min_compiler_version_default_cxx14 + if min_compiler_version is None: + self.output.warning("Assuming the compiler supports c++14 by default") + elif not self._has_cppstd_14_supported: + disable_graph() + + if self.settings.os == "iOS": + # the process library doesn't build (and doesn't even make sense) on iOS + self.options.without_process = True + + # TODO: Revisit on Boost 1.87.0 + # It's not possible to disable process only when having shared parsed already. + # https://github.com/boostorg/process/issues/408 + # https://github.com/boostorg/process/pull/409 + if Version(self.version) == "1.86.0" and is_msvc(self): + setattr(self.options, "without_process", True) + @property def _configure_options(self): return self._dependencies["configure_options"] @@ -388,6 +618,15 @@ def _stacktrace_addr2line_available(self): return False return not self.options.header_only and not self.options.without_stacktrace and self.settings.os != "Windows" + @property + def _stacktrace_from_exception_available(self): + if Version(self.version) == "1.85.0": + # https://github.com/boostorg/stacktrace/blob/boost-1.85.0/build/Jamfile.v2#L143 + return not self.options.header_only and not self.options.without_stacktrace and self.settings.os != "Windows" + elif Version(self.version) >= "1.86.0": + # https://github.com/boostorg/stacktrace/blob/boost-1.86.0/build/Jamfile.v2#L148 + return not self.options.header_only and not self.options.without_stacktrace and self._b2_architecture == "x86" + def configure(self): if self.options.header_only: self.options.rm_safe("shared") @@ -423,26 +662,55 @@ def configure(self): if self.options.get_safe("without_stacktrace", True): self.options.rm_safe("with_stacktrace_backtrace") - if self.options.layout == "b2-default": - self.options.layout = "versioned" if self.settings.os == "Windows" else "system" - if self.options.without_fiber: self.options.rm_safe("numa") + # Use verbosity from [conf] if specified + verbosity = self.conf.get("tools.build:verbosity", default="quiet") + if verbosity == "verbose" and int(self.options.debug_level) < 2: + self.options.debug_level.value = 2 + def layout(self): basic_layout(self, src_folder="src") @property def _cxx11_boost_libraries(self): libraries = ["fiber", "json", "nowide", "url"] - if Version(self.version) >= "1.76.0": - libraries.append("math") + libraries.append("math") if Version(self.version) >= "1.79.0": libraries.append("wave") if Version(self.version) >= "1.81.0": libraries.append("locale") + if Version(self.version) >= "1.84.0": + libraries.append("atomic") + libraries.append("filesystem") + libraries.append("log") + libraries.append("random") + libraries.append("stacktrace") + libraries.append("test") + libraries.append("thread") + if Version(self.version) >= "1.85.0": + libraries.append("system") + libraries.sort() + return list(filter(lambda library: f"without_{library}" in self.options, libraries)) + + @property + def _cxx14_boost_libraries(self): + libraries = [] + if Version(self.version) >= "1.85.0": + # https://github.com/boostorg/math/blob/develop/README.md#boost-math-library + libraries.append("math") libraries.sort() - return filter(lambda library: f"without_{library}" in self.options, libraries) + return list(filter(lambda library: f"without_{library}" in self.options, libraries)) + + @property + def _cxx20_boost_libraries(self): + libraries = [] + if Version(self.version) >= "1.84.0": + # https://github.com/boostorg/cobalt/blob/boost-1.84.0/build/Jamfile#L54 + libraries.append("cobalt") + libraries.sort() + return list(filter(lambda library: f"without_{library}" in self.options, libraries)) def validate(self): if not self.options.multithreading: @@ -457,6 +725,10 @@ def validate(self): if is_msvc(self) and self._shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Boost can not be built as shared library with MT runtime.") + # FIXME: In 1.84.0, there are compilation errors on msvc shared build for boost.fiber. https://github.com/boostorg/fiber/issues/314 + if Version(self.version) >= "1.84.0" and is_msvc(self) and self._shared and not self.options.without_fiber: + raise ConanInvalidConfiguration("Boost.fiber can not be built as shared library on MSVC.") + if not self.options.without_locale and self.options.i18n_backend_iconv == "off" and \ not self.options.i18n_backend_icu and not self._is_windows_platform: raise ConanInvalidConfiguration( @@ -480,16 +752,24 @@ def validate(self): if mincompiler_version and Version(self.settings.compiler.version) < mincompiler_version: raise ConanInvalidConfiguration("This compiler is too old to build Boost.nowide.") - if any([not self.options.get_safe(f"without_{library}", True) for library in self._cxx11_boost_libraries]): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) - else: - version_cxx11_standard = self._min_compiler_version_default_cxx11 - if version_cxx11_standard and Version(self.settings.compiler.version) < version_cxx11_standard: + for cxx_standard, boost_libraries, has_cppstd_supported in [ + (11, self._cxx11_boost_libraries, self._has_cppstd_11_supported), + (14, self._cxx14_boost_libraries, self._has_cppstd_14_supported), + (20, self._cxx20_boost_libraries, self._has_cppstd_20_supported)]: + if any([not self.options.get_safe(f"without_{library}", True) for library in boost_libraries]): + if (self.settings.compiler.get_safe("cppstd") and not valid_min_cppstd(self, cxx_standard)) or \ + not has_cppstd_supported: raise ConanInvalidConfiguration( - f"Boost.{{{','.join(self._cxx11_boost_libraries)}}} requires a c++11 compiler " - "(please set compiler.cppstd or use a newer compiler)" + f"Boost libraries {', '.join(boost_libraries)} requires a C++{cxx_standard} compiler. " + "Please, set compiler.cppstd or use a newer compiler version or disable from building." ) + if not self.options.get_safe("without_cobalt", True) and not self._has_coroutine_supported: + raise ConanInvalidConfiguration("Boost.Cobalt requires a C++20 capable compiler. " + "Please, set compiler.cppstd and use a newer compiler version, or disable from building.") + + # TODO: Revisit on Boost 1.87.0. Remove in case Process is fixed. + if Version(self.version) == "1.86.0" and is_msvc(self) and self.options.get_safe("shared") and self.options.get_safe("without_process", None) == False: + raise ConanInvalidConfiguration(f"{self.ref} Boost.Process will fail to be consumed as shared library on MSVC. See https://github.com/boostorg/process/issues/408.") def _with_dependency(self, dependency): """ @@ -535,14 +815,14 @@ def requirements(self): if self._with_bzip2: self.requires("bzip2/1.0.8") if self._with_lzma: - self.requires("xz_utils/5.4.4") + self.requires("xz_utils/[>=5.4.5 <6]") if self._with_zstd: - self.requires("zstd/1.5.5") + self.requires("zstd/[>=1.5 <1.6]") if self._with_stacktrace_backtrace: self.requires("libbacktrace/cci.20210118", transitive_headers=True, transitive_libs=True) if self._with_icu: - self.requires("icu/73.2") + self.requires("icu/74.2") if self._with_iconv: self.requires("libiconv/1.17") @@ -561,7 +841,7 @@ def package_id(self): def build_requirements(self): if not self.options.header_only: - self.tool_requires("b2/4.10.1") + self.tool_requires("b2/[>=5.2 <6]") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -903,7 +1183,7 @@ def _b2_os(self): @property def _b2_address_model(self): - if self.settings.arch in ("x86_64", "ppc64", "ppc64le", "mips64", "armv8", "armv8.3", "sparcv9"): + if self.settings.arch in ("x86_64", "ppc64", "ppc64le", "mips64", "armv8", "armv8.3", "sparcv9", "s390x"): return "64" return "32" @@ -1027,6 +1307,9 @@ def add_defines(library): if self._with_zstd: add_defines("zstd") + for define in self.conf.get("tools.build:defines", default=[], check_type=list): + flags.append(f"define={define}") + if is_msvc(self): flags.append(f"runtime-link={'static' if is_msvc_static_runtime(self) else 'shared'}") flags.append(f"runtime-debugging={'on' if 'd' in msvc_runtime_flag(self) else 'off'}") @@ -1047,9 +1330,18 @@ def add_defines(library): flags.append(f"toolset={self._toolset}") - if self.settings.get_safe("compiler.cppstd"): - cppstd_flag = AutotoolsToolchain(self).cppstd - flags.append(f"cxxflags={cppstd_flag}") + safe_cppstd = self.settings.get_safe("compiler.cppstd") + if safe_cppstd: + cppstd_version = self._cppstd_flag(safe_cppstd) + flags.append(f"cxxstd={cppstd_version}") + if "gnu" in safe_cppstd: + flags.append("cxxstd-dialect=gnu") + elif Version(self.version) >= "1.85.0" and self._has_cppstd_14_supported: + cppstd_version = self._cppstd_flag("14") + flags.append(f"cxxstd={cppstd_version}") + elif self._has_cppstd_11_supported: + cppstd_version = self._cppstd_flag("11") + flags.append(f"cxxstd={cppstd_version}") # LDFLAGS link_flags = [] @@ -1116,6 +1408,10 @@ def add_defines(library): cxx_flags.append("-fembed-bitcode") if self._with_stacktrace_backtrace: flags.append(f"-sLIBBACKTRACE_PATH={self.dependencies['libbacktrace'].package_folder}") + if self._stacktrace_from_exception_available and "x86" not in str(self.settings.arch): + # https://github.com/boostorg/stacktrace/blob/boost-1.85.0/src/from_exception.cpp#L29 + # This feature is guarded by BOOST_STACKTRACE_ALWAYS_STORE_IN_PADDING, but that is only enabled on x86. + flags.append("define=BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK=1") if self._with_iconv: flags.append(f"-sICONV_PATH={self.dependencies['libiconv'].package_folder}") if self._with_icu: @@ -1135,6 +1431,10 @@ def add_defines(library): if self.options.get_safe("addr2line_location"): cxx_flags.append(f"-DBOOST_STACKTRACE_ADDR2LINE_LOCATION={self.options.addr2line_location}") + if not self.options.get_safe('without_cobalt', True) and \ + (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "10"): + cxx_flags.append("-fcoroutines") + cxx_flags = f'cxxflags="{" ".join(cxx_flags)}"' flags.append(cxx_flags) @@ -1219,6 +1519,9 @@ def _create_user_config_jam(self, folder): def create_library_config(deps_name, name): aggregated_cpp_info = self.dependencies[deps_name].cpp_info.aggregated_components() + if len(aggregated_cpp_info.libs) == 0: + return "" + includedir = aggregated_cpp_info.includedirs[0].replace("\\", "/") includedir = f"\"{includedir}\"" libdir = aggregated_cpp_info.libdirs[0].replace("\\", "/") @@ -1335,7 +1638,7 @@ def _toolset(self): return str(self.settings.compiler) if self.settings.compiler == "sun-cc": return "sunpro" - if self.settings.compiler == "intel": + if "intel" in str(self.settings.compiler): return { "Macos": "intel-darwin", "Windows": "intel-win", @@ -1613,6 +1916,8 @@ def add_libprefix(n): libprefix = "" if is_msvc(self) and (not self._shared or n in self._dependencies["static_only"]): libprefix = "lib" + elif self._toolset == "clang-win": + libprefix = "lib" return libprefix + n all_detected_libraries = set(l[:-4] if l.endswith(".dll") else l for l in collect_libs(self)) @@ -1624,7 +1929,11 @@ def filter_transform_module_libraries(names): for name in names: if name in ("boost_stacktrace_windbg", "boost_stacktrace_windbg_cached") and self.settings.os != "Windows": continue - if name in ("boost_stacktrace_addr2line", "boost_stacktrace_backtrace", "boost_stacktrace_basic",) and self.settings.os == "Windows": + if name in ("boost_math_c99l", "boost_math_tr1l") and (str(self.settings.arch).startswith("ppc") or (Version(self.version) >= "1.87.0" and self.settings.os == "Emscripten")): + continue + if name in ("boost_stacktrace_addr2line", "boost_stacktrace_backtrace", "boost_stacktrace_basic") and self.settings.os == "Windows": + continue + if name == "boost_stacktrace_from_exception" and not self._stacktrace_from_exception_available: continue if name == "boost_stacktrace_addr2line" and not self._stacktrace_addr2line_available: continue @@ -1708,6 +2017,8 @@ def filter_transform_module_libraries(names): self.cpp_info.components["stacktrace_addr2line"].system_libs.append("dl") if self._with_stacktrace_backtrace: self.cpp_info.components["stacktrace_backtrace"].system_libs.append("dl") + if self._stacktrace_from_exception_available: + self.cpp_info.components["stacktrace_from_exception"].system_libs.append("dl") if self._stacktrace_addr2line_available: self.cpp_info.components["stacktrace_addr2line"].defines.extend([ @@ -1737,6 +2048,13 @@ def filter_transform_module_libraries(names): self.cpp_info.components[f"numpy{pyversion.major}{pyversion.minor}"].requires = ["numpy"] + if not self.options.get_safe("without_process"): + if self.settings.os == "Windows": + self.cpp_info.components["process"].system_libs.extend(["ntdll", "shell32", "advapi32", "user32"]) + if self._shared: + self.cpp_info.components["process"].defines.append("BOOST_PROCESS_DYN_LINK") + + if is_msvc(self) or self._is_clang_cl: # https://github.com/conan-community/conan-boost/issues/127#issuecomment-404750974 self.cpp_info.components["_libboost"].system_libs.append("bcrypt") @@ -1766,6 +2084,11 @@ def filter_transform_module_libraries(names): self.cpp_info.components["headers"].defines.append("BOOST_SP_USE_SPINLOCK") else: self.cpp_info.components["headers"].defines.extend(["BOOST_AC_DISABLE_THREADS", "BOOST_SP_DISABLE_THREADS"]) + + if not self.options.get_safe('without_cobalt', True) and \ + (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "10"): + self.cpp_info.components["cobalt"].cxxflags.append("-fcoroutines") + #TODO: remove in the future, user_info deprecated in conan2, but kept for compatibility while recipe is cross-compatible. self.user_info.stacktrace_addr2line_available = self._stacktrace_addr2line_available self.conf_info.define("user.boost:stacktrace_addr2line_available", self._stacktrace_addr2line_available) diff --git a/recipes/boost/all/dependencies/dependencies-1.71.0.yml b/recipes/boost/all/dependencies/dependencies-1.71.0.yml deleted file mode 100644 index 9c2d0a8c22410..0000000000000 --- a/recipes/boost/all/dependencies/dependencies-1.71.0.yml +++ /dev/null @@ -1,269 +0,0 @@ -configure_options: -- atomic -- chrono -- container -- context -- contract -- coroutine -- date_time -- exception -- fiber -- filesystem -- graph -- graph_parallel -- iostreams -- locale -- log -- math -- mpi -- program_options -- python -- random -- regex -- serialization -- stacktrace -- system -- test -- thread -- timer -- type_erasure -- wave -dependencies: - atomic: [] - chrono: - - system - container: [] - context: - - thread - contract: - - exception - - thread - coroutine: - - context - - exception - - system - - thread - date_time: - - serialization - exception: [] - fiber: - - context - - filesystem - fiber_numa: - - fiber - filesystem: - - system - graph: - - math - - random - - regex - - serialization - graph_parallel: - - filesystem - - graph - - mpi - - random - - serialization - iostreams: - - random - - regex - locale: - - thread - log: - - atomic - - container - - date_time - - exception - - filesystem - - locale - - random - - regex - - system - - thread - log_setup: - - log - math: - - atomic - 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 - numpy: - - python - prg_exec_monitor: - - test - program_options: [] - python: [] - random: - - math - - 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 - 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 - 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 - 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 - 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.71.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.72.0.yml b/recipes/boost/all/dependencies/dependencies-1.72.0.yml deleted file mode 100644 index f0213a24374bb..0000000000000 --- a/recipes/boost/all/dependencies/dependencies-1.72.0.yml +++ /dev/null @@ -1,270 +0,0 @@ -configure_options: -- atomic -- chrono -- container -- context -- contract -- coroutine -- date_time -- exception -- fiber -- filesystem -- graph -- graph_parallel -- iostreams -- locale -- log -- math -- mpi -- program_options -- python -- random -- regex -- serialization -- stacktrace -- system -- test -- thread -- timer -- type_erasure -- wave -dependencies: - atomic: [] - chrono: - - system - container: [] - context: - - thread - contract: - - exception - - thread - coroutine: - - context - - exception - - system - - thread - date_time: - - serialization - exception: [] - fiber: - - context - - filesystem - fiber_numa: - - fiber - filesystem: - - system - graph: - - math - - random - - regex - - serialization - graph_parallel: - - filesystem - - graph - - mpi - - random - - serialization - iostreams: - - random - - regex - locale: - - thread - log: - - atomic - - container - - date_time - - exception - - filesystem - - locale - - random - - regex - - system - - thread - log_setup: - - log - math: - - atomic - - chrono - 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 - numpy: - - python - prg_exec_monitor: - - test - program_options: [] - python: [] - random: - - math - - 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 - 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 - 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 - 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 - 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.72.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.73.0.yml b/recipes/boost/all/dependencies/dependencies-1.73.0.yml deleted file mode 100644 index d26d67c9c338d..0000000000000 --- a/recipes/boost/all/dependencies/dependencies-1.73.0.yml +++ /dev/null @@ -1,274 +0,0 @@ -configure_options: -- atomic -- chrono -- container -- context -- contract -- coroutine -- date_time -- exception -- fiber -- filesystem -- graph -- graph_parallel -- iostreams -- locale -- log -- math -- mpi -- nowide -- program_options -- python -- random -- regex -- serialization -- stacktrace -- system -- test -- thread -- timer -- type_erasure -- wave -dependencies: - atomic: [] - chrono: - - system - container: [] - context: - - thread - contract: - - exception - - thread - coroutine: - - context - - exception - - system - - thread - date_time: - - serialization - exception: [] - fiber: - - context - - filesystem - fiber_numa: - - fiber - filesystem: - - system - graph: - - math - - random - - regex - - serialization - graph_parallel: - - filesystem - - graph - - mpi - - random - - serialization - iostreams: - - random - - regex - locale: - - thread - log: - - atomic - - container - - date_time - - exception - - filesystem - - locale - - random - - regex - - system - - thread - log_setup: - - log - math: - - atomic - 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: - - math - - 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 - 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 - 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 - 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.73.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.74.0.yml b/recipes/boost/all/dependencies/dependencies-1.74.0.yml deleted file mode 100644 index 679e8d616f324..0000000000000 --- a/recipes/boost/all/dependencies/dependencies-1.74.0.yml +++ /dev/null @@ -1,273 +0,0 @@ -configure_options: -- atomic -- chrono -- container -- context -- contract -- coroutine -- date_time -- exception -- fiber -- filesystem -- graph -- graph_parallel -- iostreams -- locale -- log -- math -- mpi -- nowide -- program_options -- python -- random -- regex -- serialization -- stacktrace -- system -- test -- thread -- timer -- type_erasure -- wave -dependencies: - atomic: [] - chrono: - - system - container: [] - context: - - thread - contract: - - exception - - thread - coroutine: - - context - - exception - - system - - thread - date_time: [] - exception: [] - fiber: - - context - - filesystem - fiber_numa: - - fiber - filesystem: - - system - graph: - - math - - random - - regex - - serialization - graph_parallel: - - filesystem - - graph - - mpi - - random - - serialization - iostreams: - - random - - regex - locale: - - thread - log: - - atomic - - container - - date_time - - exception - - filesystem - - locale - - random - - regex - - system - - thread - log_setup: - - log - math: - - atomic - 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: - - math - - 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 - 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 - 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 - 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.74.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.75.0.yml b/recipes/boost/all/dependencies/dependencies-1.75.0.yml deleted file mode 100644 index 4d24ca98d6337..0000000000000 --- a/recipes/boost/all/dependencies/dependencies-1.75.0.yml +++ /dev/null @@ -1,280 +0,0 @@ -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 -- wave -dependencies: - atomic: [] - chrono: - - system - container: [] - context: - - thread - contract: - - exception - - thread - coroutine: - - context - - exception - - system - - thread - date_time: [] - exception: [] - fiber: - - context - - filesystem - fiber_numa: - - fiber - filesystem: - - system - graph: - - math - - random - - regex - - serialization - graph_parallel: - - filesystem - - graph - - mpi - - random - - serialization - iostreams: - - random - - regex - json: - - container - - exception - - system - locale: - - thread - log: - - atomic - - container - - date_time - - exception - - filesystem - - locale - - random - - regex - - system - - thread - log_setup: - - log - math: - - atomic - 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: - - math - - 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 - 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 - 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.75.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.76.0.yml b/recipes/boost/all/dependencies/dependencies-1.76.0.yml deleted file mode 100644 index b404c36315ae1..0000000000000 --- a/recipes/boost/all/dependencies/dependencies-1.76.0.yml +++ /dev/null @@ -1,279 +0,0 @@ -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 -- wave -dependencies: - atomic: [] - chrono: - - system - container: [] - context: - - thread - contract: - - exception - - thread - coroutine: - - context - - exception - - system - - thread - date_time: [] - exception: [] - fiber: - - context - - filesystem - fiber_numa: - - fiber - filesystem: - - system - graph: - - math - - random - - regex - - serialization - graph_parallel: - - filesystem - - graph - - mpi - - random - - serialization - iostreams: - - random - - regex - json: - - container - - exception - - system - locale: - - thread - log: - - atomic - - container - - date_time - - exception - - filesystem - - locale - - random - - regex - - system - - thread - log_setup: - - log - math: - - atomic - 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 - 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 - 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.76.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.77.0.yml b/recipes/boost/all/dependencies/dependencies-1.77.0.yml deleted file mode 100644 index 921d8f4f45b12..0000000000000 --- a/recipes/boost/all/dependencies/dependencies-1.77.0.yml +++ /dev/null @@ -1,277 +0,0 @@ -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 -- wave -dependencies: - atomic: [] - chrono: - - system - container: [] - context: [] - contract: - - exception - - thread - coroutine: - - context - - exception - - system - - thread - 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 - - exception - - 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 - 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 - 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.77.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.84.0.yml b/recipes/boost/all/dependencies/dependencies-1.84.0.yml new file mode 100644 index 0000000000000..064fb7bca5d2a --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.84.0.yml @@ -0,0 +1,283 @@ +configure_options: +- atomic +- chrono +- cobalt +- 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 + cobalt: + - container + - 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 + - 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 + cobalt: + - boost_cobalt + 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.84.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.85.0.yml b/recipes/boost/all/dependencies/dependencies-1.85.0.yml new file mode 100644 index 0000000000000..2306346f43372 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.85.0.yml @@ -0,0 +1,291 @@ +configure_options: +- atomic +- charconv +- chrono +- cobalt +- 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: [] + charconv: [] + chrono: + - system + cobalt: + - container + - 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 + - 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_from_exception: + - 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 + charconv: + - boost_charconv + chrono: + - boost_chrono + cobalt: + - boost_cobalt + 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_from_exception: + - boost_stacktrace_from_exception + 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.85.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.86.0.yml b/recipes/boost/all/dependencies/dependencies-1.86.0.yml new file mode 100644 index 0000000000000..ae5b6de30e121 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.86.0.yml @@ -0,0 +1,298 @@ +configure_options: +- atomic +- charconv +- chrono +- cobalt +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- process +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + charconv: [] + chrono: + - system + cobalt: + - container + - context + - 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 + - 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 + process: + - filesystem + - system + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_from_exception: + - 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 + charconv: + - boost_charconv + chrono: + - boost_chrono + cobalt: + - boost_cobalt + 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 + process: + - boost_process + 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_from_exception: + - boost_stacktrace_from_exception + 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.86.0 diff --git a/recipes/boost/all/dependencies/dependencies-1.87.0.yml b/recipes/boost/all/dependencies/dependencies-1.87.0.yml new file mode 100644 index 0000000000000..e85dd064e4727 --- /dev/null +++ b/recipes/boost/all/dependencies/dependencies-1.87.0.yml @@ -0,0 +1,299 @@ +configure_options: +- atomic +- charconv +- chrono +- cobalt +- container +- context +- contract +- coroutine +- date_time +- exception +- fiber +- filesystem +- graph +- graph_parallel +- iostreams +- json +- locale +- log +- math +- mpi +- nowide +- process +- program_options +- python +- random +- regex +- serialization +- stacktrace +- system +- test +- thread +- timer +- type_erasure +- url +- wave +dependencies: + atomic: [] + charconv: [] + chrono: + - system + cobalt: + - container + - context + - 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 + - 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 + process: + - filesystem + - system + - context + program_options: [] + python: [] + random: + - system + regex: [] + serialization: [] + stacktrace: [] + stacktrace_addr2line: + - stacktrace + stacktrace_backtrace: + - stacktrace + stacktrace_basic: + - stacktrace + stacktrace_from_exception: + - 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 + charconv: + - boost_charconv + chrono: + - boost_chrono + cobalt: + - boost_cobalt + 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 + process: + - boost_process + 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_from_exception: + - boost_stacktrace_from_exception + 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.87.0 diff --git a/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch b/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch deleted file mode 100644 index fd069197a95a0..0000000000000 --- a/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 188eac4acf37313fcec27d7b266c6517b99ed23d Mon Sep 17 00:00:00 2001 -From: Oliver Kowalke -Date: Sun, 1 Dec 2019 20:40:28 +0100 -Subject: [PATCH] Revert "Cease dependence on Range" - -This reverts commit 0c556bb59241e682bbcd3f572815149c5a9b17db. - -see #44 (One test fails to compile after boostorg/coroutine submodule updated) ---- - boost/coroutine/asymmetric_coroutine.hpp | 12 +++--------- - 1 file changed, 3 insertions(+), 9 deletions(-) - -diff --git a/boost/coroutine/asymmetric_coroutine.hpp b/boost/coroutine/asymmetric_coroutine.hpp -index f2ae16f..78b1842 100644 ---- a/boost/coroutine/asymmetric_coroutine.hpp -+++ b/boost/coroutine/asymmetric_coroutine.hpp -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -2390,19 +2391,12 @@ end( push_coroutine< R > & c) - - } - --// forward declaration of Boost.Range traits to break dependency on it --template --struct range_mutable_iterator; -- --template --struct range_const_iterator; -- - template< typename Arg > --struct range_mutable_iterator< coroutines::push_coroutine< Arg >, void > -+struct range_mutable_iterator< coroutines::push_coroutine< Arg > > - { typedef typename coroutines::push_coroutine< Arg >::iterator type; }; - - template< typename R > --struct range_mutable_iterator< coroutines::pull_coroutine< R >, void > -+struct range_mutable_iterator< coroutines::pull_coroutine< R > > - { typedef typename coroutines::pull_coroutine< R >::iterator type; }; - - } --- -2.21.0 - diff --git a/recipes/boost/all/patches/1.69.0-contract-no-system.patch b/recipes/boost/all/patches/1.69.0-contract-no-system.patch deleted file mode 100644 index d98fe7b2f7e3e..0000000000000 --- a/recipes/boost/all/patches/1.69.0-contract-no-system.patch +++ /dev/null @@ -1,11 +0,0 @@ -This library links to boost_system, even though that library is header-only. ---- libs/contract/build/Jamfile.v2 -+++ libs/contract/build/Jamfile.v2 -@@ -18,5 +18,5 @@ - ; - - # If lib as header-only, none of following will be used. --lib boost_contract : contract.cpp : shared /boost//system ; --lib boost_contract : contract.cpp : static /boost//system ; -+lib boost_contract : contract.cpp : shared ; -+lib boost_contract : contract.cpp : static ; diff --git a/recipes/boost/all/patches/1.69.0-random-no-system.patch b/recipes/boost/all/patches/1.69.0-random-no-system.patch deleted file mode 100644 index ad03e39931654..0000000000000 --- a/recipes/boost/all/patches/1.69.0-random-no-system.patch +++ /dev/null @@ -1,11 +0,0 @@ -This library links to boost_system, even though that library is header-only. ---- libs/random/build/Jamfile.v2 -+++ libs/random/build/Jamfile.v2 -@@ -13,6 +13,6 @@ - : usage-requirements shared:BOOST_RANDOM_DYN_LINK - ; - --lib boost_random : [ glob *.cpp ] /boost//system ; -+lib boost_random : [ glob *.cpp ] ; - - boost-install boost_random ; diff --git a/recipes/boost/all/patches/1.69.0-type_erasure-no-system.patch b/recipes/boost/all/patches/1.69.0-type_erasure-no-system.patch deleted file mode 100644 index c3b7cde662175..0000000000000 --- a/recipes/boost/all/patches/1.69.0-type_erasure-no-system.patch +++ /dev/null @@ -1,9 +0,0 @@ -This library links to boost_system, even though that library is header-only. ---- libs/type_erasure/build/Jamfile.v2 -+++ libs/type_erasure/build/Jamfile.v2 -@@ -12,4 +12,4 @@ - : usage-requirements shared:BOOST_TYPE_ERASURE_DYN_LINK - ; - --lib boost_type_erasure : dynamic_binding.cpp /boost//thread /boost//system ; -+lib boost_type_erasure : dynamic_binding.cpp /boost//thread ; diff --git a/recipes/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch b/recipes/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch deleted file mode 100644 index 4c22c748fe894..0000000000000 --- a/recipes/boost/all/patches/1.75.0-boost_build-with-newer-b2.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- tools/build/src/build/configure.jam.orig 2020-12-03 00:02:49.000000000 -0500 -+++ tools/build/src/build/configure.jam 2022-01-28 20:32:41.260634800 -0500 -@@ -454,7 +454,7 @@ - return [ find-builds-raw $(p) : $(ps) : $(what) : - $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : - $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : -- $(16) : $(17) : $(18) : $(19) ] ; -+ $(16) : $(17) : $(18) ] ; - } - - -@@ -518,7 +518,7 @@ - { - local project = [ project.current ] ; - self.message = $(message) ; -- for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 -+ for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 - { - local name = [ CALC $(i) - 1 ] ; - self.targets.$(name) = $($(i)[1]) ; -@@ -537,7 +537,7 @@ - } - rule all-properties ( ) - { -- local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; -+ local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ; - return $(self.props.$(i)) ; - } - rule check ( properties * ) -@@ -559,9 +559,7 @@ - : $(self.targets.14) $(self.what.14) - : $(self.targets.15) $(self.what.15) - : $(self.targets.16) $(self.what.16) -- : $(self.targets.17) $(self.what.17) -- : $(self.targets.18) $(self.what.18) -- : $(self.targets.19) $(self.what.19) ] ; -+ : $(self.targets.17) $(self.what.17) ] ; - if $(self.props.$(i)) - { - return [ property.evaluate-conditionals-in-context $(self.props.$(i)) : $(properties) ] ; ---- tools/build/src/util/indirect.jam.orig 2020-12-03 00:02:49.000000000 -0500 -+++ tools/build/src/util/indirect.jam 2022-01-28 20:32:41.249509200 -0500 -@@ -102,7 +102,7 @@ - { - return [ modules.call-in [ get-module $(r) ] : [ get-rule $(r) ] $(args) : - $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : $(10) : $(11) : -- $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) : $(19) ] ; -+ $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) ] ; - } - - diff --git a/recipes/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch b/recipes/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch deleted file mode 100644 index c06566b5a75fb..0000000000000 --- a/recipes/boost/all/patches/1.76.0-0001-fix-include-inside-boost-namespace.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1ec5c98d80de97f9e962c5627e1a0e6096099894 Mon Sep 17 00:00:00 2001 -From: Daniel Scharrer -Date: Wed, 28 Jul 2021 19:56:31 +0200 -Subject: [PATCH] Fix #include inside boost namespace - -The existing code fails to build if was not already included. ---- - boost/math/tools/mp.hpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/boost/math/tools/mp.hpp b/boost/math/tools/mp.hpp -index 35565646f..dc8440988 100644 ---- a/boost/math/tools/mp.hpp -+++ b/boost/math/tools/mp.hpp -@@ -13,6 +13,7 @@ - - #include - #include -+#include - - namespace boost { namespace math { namespace tools { namespace meta_programming { - -@@ -338,7 +339,6 @@ using mp_remove_if_q = mp_remove_if; - // Index sequence - // Use C++14 index sequence if available - #if defined(__cpp_lib_integer_sequence) && (__cpp_lib_integer_sequence >= 201304) --#include - template - using index_sequence = std::index_sequence; - --- -2.39.1 - diff --git a/recipes/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch b/recipes/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch deleted file mode 100644 index bdc7476f27137..0000000000000 --- a/recipes/boost/all/patches/1.77.0-boost_build-with-newer-b2.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- tools/build/src/build/configure.jam.orig 2021-08-05 05:42:46.000000000 -0400 -+++ tools/build/src/build/configure.jam 2022-01-28 19:55:37.960877600 -0500 -@@ -467,7 +467,7 @@ - return [ find-builds-raw $(p) : $(ps) : $(what) : - $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : - $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : -- $(16) : $(17) : $(18) : $(19) ] ; -+ $(16) : $(17) : $(18) ] ; - } - - -@@ -531,7 +531,7 @@ - { - local project = [ project.current ] ; - self.message = $(message) ; -- for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 -+ for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 - { - local name = [ CALC $(i) - 1 ] ; - self.targets.$(name) = $($(i)[1]) ; -@@ -550,7 +550,7 @@ - } - rule all-properties ( ) - { -- local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; -+ local i = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ; - return $(self.props.$(i)) ; - } - rule check ( properties * ) -@@ -572,9 +572,7 @@ - : $(self.targets.14) $(self.what.14) - : $(self.targets.15) $(self.what.15) - : $(self.targets.16) $(self.what.16) -- : $(self.targets.17) $(self.what.17) -- : $(self.targets.18) $(self.what.18) -- : $(self.targets.19) $(self.what.19) ] ; -+ : $(self.targets.17) $(self.what.17) ] ; - if $(self.props.$(i)) - { - return [ property.evaluate-conditionals-in-context $(self.props.$(i)) : $(properties) ] ; ---- tools/build/src/util/indirect.jam.orig 2021-08-05 05:42:46.000000000 -0400 -+++ tools/build/src/util/indirect.jam 2021-12-02 01:48:03.000000000 -0500 -@@ -102,7 +102,7 @@ - { - return [ modules.call-in [ get-module $(r) ] : [ get-rule $(r) ] $(args) : - $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) : $(10) : $(11) : -- $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) : $(19) ] ; -+ $(12) : $(13) : $(14) : $(15) : $(16) : $(17) : $(18) ] ; - } - - .parts_regex = "^([^@]*)@" "([^%]*)%" "([^%]+)$" ; 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/patches/1.84.0-reimplement-string_set-as-any-string.patch b/recipes/boost/all/patches/1.84.0-reimplement-string_set-as-any-string.patch new file mode 100644 index 0000000000000..15393721de8ee --- /dev/null +++ b/recipes/boost/all/patches/1.84.0-reimplement-string_set-as-any-string.patch @@ -0,0 +1,337 @@ +Fixes compilation with cppstd=20 on MacOS + +From c5e8f02c903696a213fc4b710f6740ccd1f07f4e Mon Sep 17 00:00:00 2001 +From: Alexander Grund +Date: Sun, 3 Dec 2023 20:06:27 +0100 +Subject: [PATCH] Reimplement `string_set` as `any_string` + +Use a better name for a type-erased string implemented using +`dynamic_cast` instead of storing&comparing the `typeid` of the char +type used. +This is a workaround for missing typeinfo for `char8_t` on e.g. libc++ +on FreeBSD 13.1. +It also simplifies memory management size calc/copy implementation. +--- + boost/locale/detail/any_string.hpp | 71 ++++++++++++++++++++++ + boost/locale/formatting.hpp | 51 ++-------------- + libs/locale/src/boost/locale/formatting.cpp | 45 -------------- + libs/locale/test/test_ios_info.cpp | 64 +++++++++++++++---- + 4 files changed, 127 insertions(+), 104 deletions(-) + create mode 100644 boost/locale/detail/any_string.hpp + +diff --git a/boost/locale/detail/any_string.hpp b/boost/locale/detail/any_string.hpp +new file mode 100644 +index 00000000..c0cc7ffb +--- /dev/null ++++ b/boost/locale/detail/any_string.hpp +@@ -0,0 +1,71 @@ ++// ++// Copyright (c) 2023 Alexander Grund ++// ++// Distributed under the Boost Software License, Version 1.0. ++// https://www.boost.org/LICENSE_1_0.txt ++ ++#ifndef BOOST_LOCALE_DETAIL_ANY_STRING_HPP_INCLUDED ++#define BOOST_LOCALE_DETAIL_ANY_STRING_HPP_INCLUDED ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/// \cond INTERNAL ++namespace boost { namespace locale { namespace detail { ++ /// Type-erased std::basic_string ++ class any_string { ++ struct BOOST_SYMBOL_VISIBLE base { ++ virtual ~base() = default; ++ virtual base* clone() const = 0; ++ ++ protected: ++ base() = default; ++ base(const base&) = default; ++ base(base&&) = delete; ++ base& operator=(const base&) = default; ++ base& operator=(base&&) = delete; ++ }; ++ template ++ struct BOOST_SYMBOL_VISIBLE impl : base { ++ explicit impl(const boost::basic_string_view value) : s(value) {} ++ impl* clone() const override { return new impl(*this); } ++ std::basic_string s; ++ }; ++ ++ std::unique_ptr s_; ++ ++ public: ++ any_string() = default; ++ any_string(const any_string& other) : s_(other.s_ ? other.s_->clone() : nullptr) {} ++ any_string(any_string&&) = default; ++ any_string& operator=(any_string other) // Covers the copy and move assignment ++ { ++ s_.swap(other.s_); ++ return *this; ++ } ++ ++ template ++ void set(const boost::basic_string_view s) ++ { ++ BOOST_ASSERT(!s.empty()); ++ s_.reset(new impl(s)); ++ } ++ ++ template ++ std::basic_string get() const ++ { ++ if(!s_) ++ throw std::bad_cast(); ++ return dynamic_cast&>(*s_).s; ++ } ++ }; ++ ++}}} // namespace boost::locale::detail ++ ++/// \endcond ++ ++#endif +diff --git a/boost/locale/formatting.hpp b/boost/locale/formatting.hpp +index d14e6f69..e3c8619e 100644 +--- a/boost/locale/formatting.hpp ++++ b/boost/locale/formatting.hpp +@@ -8,15 +8,13 @@ + #ifndef BOOST_LOCALE_FORMATTING_HPP_INCLUDED + #define BOOST_LOCALE_FORMATTING_HPP_INCLUDED + ++#include + #include +-#include +-#include + #include + #include + #include + #include + #include +-#include + + #ifdef BOOST_MSVC + # pragma warning(push) +@@ -130,13 +128,13 @@ namespace boost { namespace locale { + template + void date_time_pattern(const std::basic_string& str) + { +- date_time_pattern_set().set(str); ++ datetime_.set(str); + } + /// Get date/time pattern (strftime like) + template + std::basic_string date_time_pattern() const + { +- return date_time_pattern_set().get(); ++ return datetime_.get(); + } + + /// \cond INTERNAL +@@ -144,51 +142,10 @@ namespace boost { namespace locale { + /// \endcond + + private: +- class string_set; +- +- const string_set& date_time_pattern_set() const; +- string_set& date_time_pattern_set(); +- +- class BOOST_LOCALE_DECL string_set { +- public: +- string_set(); +- ~string_set(); +- string_set(const string_set& other); +- string_set& operator=(string_set other); +- void swap(string_set& other); +- +- template +- void set(const boost::basic_string_view s) +- { +- BOOST_ASSERT(!s.empty()); +- delete[] ptr; +- ptr = nullptr; +- type = &typeid(Char); +- size = sizeof(Char) * s.size(); +- ptr = size ? new char[size] : nullptr; +- memcpy(ptr, s.data(), size); +- } +- +- template +- std::basic_string get() const +- { +- if(type == nullptr || *type != typeid(Char)) +- throw std::bad_cast(); +- std::basic_string result(size / sizeof(Char), Char(0)); +- memcpy(&result.front(), ptr, size); +- return result; +- } +- +- private: +- const std::type_info* type; +- size_t size; +- char* ptr; +- }; +- + uint64_t flags_; + int domain_id_; + std::string time_zone_; +- string_set datetime_; ++ detail::any_string datetime_; + }; + + /// \brief This namespace includes all manipulators that can be used on IO streams +diff --git a/src/boost/locale/shared/formatting.cpp b/src/boost/locale/shared/formatting.cpp +index 489d1fd5..457ba782 100644 +--- a/libs/locale/src/boost/locale/shared/formatting.cpp ++++ b/libs/locale/src/boost/locale/shared/formatting.cpp +@@ -7,43 +7,8 @@ + #include + #include + #include "boost/locale/shared/ios_prop.hpp" +-#include +-#include + + namespace boost { namespace locale { +- +- ios_info::string_set::string_set() : type(nullptr), size(0), ptr(nullptr) {} +- ios_info::string_set::~string_set() +- { +- delete[] ptr; +- } +- ios_info::string_set::string_set(const string_set& other) +- { +- if(other.ptr != nullptr) { +- ptr = new char[other.size]; +- size = other.size; +- type = other.type; +- memcpy(ptr, other.ptr, size); +- } else { +- ptr = nullptr; +- size = 0; +- type = nullptr; +- } +- } +- +- void ios_info::string_set::swap(string_set& other) +- { +- std::swap(type, other.type); +- std::swap(size, other.size); +- std::swap(ptr, other.ptr); +- } +- +- ios_info::string_set& ios_info::string_set::operator=(string_set other) +- { +- swap(other); +- return *this; +- } +- + ios_info::ios_info() : flags_(0), domain_id_(0), time_zone_(time_zone::global()) {} + + ios_info::~ios_info() = default; +@@ -105,16 +70,6 @@ namespace boost { namespace locale { + return time_zone_; + } + +- const ios_info::string_set& ios_info::date_time_pattern_set() const +- { +- return datetime_; +- } +- +- ios_info::string_set& ios_info::date_time_pattern_set() +- { +- return datetime_; +- } +- + ios_info& ios_info::get(std::ios_base& ios) + { + return impl::ios_prop::get(ios); +diff --git a/libs/locale/test/test_ios_info.cpp b/libs/locale/test/test_ios_info.cpp +index 9b63aaed..79179a8f 100644 +--- a/libs/locale/test/test_ios_info.cpp ++++ b/libs/locale/test/test_ios_info.cpp +@@ -105,18 +105,6 @@ void test_member_methods() + + info.date_time_pattern(std::string("Pattern")); + TEST_EQ(info.date_time_pattern(), "Pattern"); +- +- info.date_time_pattern(ascii_to("WChar Pattern")); +- TEST_EQ(info.date_time_pattern(), ascii_to("WChar Pattern")); +- TEST_THROWS(info.date_time_pattern(), std::bad_cast); +- +- info.date_time_pattern(ascii_to("Char16 Pattern")); +- TEST_THROWS(info.date_time_pattern(), std::bad_cast); +- TEST_EQ(info.date_time_pattern(), ascii_to("Char16 Pattern")); +- +- info.date_time_pattern(ascii_to("Char32 Pattern")); +- TEST_THROWS(info.date_time_pattern(), std::bad_cast); +- TEST_EQ(info.date_time_pattern(), ascii_to("Char32 Pattern")); + } + } + +@@ -212,8 +200,60 @@ void test_manipulators() + TEST_EQ(info2.date_time_pattern(), L"My TZ"); + } + ++void test_any_string() ++{ ++ boost::locale::detail::any_string s; ++ TEST_THROWS(s.get(), std::bad_cast); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++ s.set("Char Pattern"); ++ TEST_EQ(s.get(), "Char Pattern"); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++ s.set(ascii_to("WChar Pattern")); ++ TEST_EQ(s.get(), ascii_to("WChar Pattern")); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++ s.set(ascii_to("Char16 Pattern")); ++ TEST_EQ(s.get(), ascii_to("Char16 Pattern")); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++ s.set(ascii_to("Char32 Pattern")); ++ TEST_EQ(s.get(), ascii_to("Char32 Pattern")); ++ TEST_THROWS(s.get(), std::bad_cast); ++ ++#ifndef BOOST_LOCALE_NO_CXX20_STRING8 ++ s.set(ascii_to("Char8 Pattern")); ++ TEST_EQ(s.get(), ascii_to("Char8 Pattern")); ++ TEST_THROWS(s.get(), std::bad_cast); ++#endif ++ ++ boost::locale::detail::any_string s1, s2, empty; ++ s1.set("Char"); ++ s2.set(ascii_to("WChar")); ++ // Copy ctor ++ boost::locale::detail::any_string s3(s1); ++ TEST_EQ(s3.get(), "Char"); ++ TEST_EQ(s1.get(), "Char"); ++ // Ensure deep copy ++ s3.set("Foo"); ++ TEST_EQ(s3.get(), "Foo"); ++ TEST_EQ(s1.get(), "Char"); ++ // Copy assign ++ s3 = s2; ++ TEST_EQ(s3.get(), ascii_to("WChar")); ++ TEST_EQ(s2.get(), ascii_to("WChar")); ++ // Move assign ++ s3 = std::move(s1); ++ TEST_EQ(s3.get(), "Char"); ++ // From empty ++ s3 = empty; ++ TEST_THROWS(s3.get(), std::bad_cast); ++} ++ + void test_main(int /*argc*/, char** /*argv*/) + { ++ test_any_string(); + test_member_methods(); + test_manipulators(); + } diff --git a/recipes/boost/all/patches/1.85.0-container-aliasing-violation-fix.patch b/recipes/boost/all/patches/1.85.0-container-aliasing-violation-fix.patch new file mode 100644 index 0000000000000..aa3c821fde524 --- /dev/null +++ b/recipes/boost/all/patches/1.85.0-container-aliasing-violation-fix.patch @@ -0,0 +1,417 @@ +From a92131b34b78f7f010881750ecb8b4ce274511d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= +Date: Sun, 28 Apr 2024 23:29:59 +0200 +Subject: [PATCH 1/1] Remove UB in flat_map implementation when the + implementation has a movable std::pair + +--- + boost/container/allocator_traits.hpp | 144 +++++++++++++++++- + boost/container/detail/construct_in_place.hpp | 36 ++++- + boost/container/flat_map.hpp | 67 ++++++-- + 3 files changed, 229 insertions(+), 18 deletions(-) + +diff --git a/boost/container/allocator_traits.hpp b/boost/container/allocator_traits.hpp +index cdb6683e8..8e2fafa7f 100644 +--- a/boost/container/allocator_traits.hpp ++++ b/boost/container/allocator_traits.hpp +@@ -32,6 +32,8 @@ + #include + #include //is_empty + #include ++#include ++#include + #ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP + #include + #endif +@@ -81,6 +83,144 @@ + + namespace boost { + namespace container { ++namespace dtl { ++ ++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) ++ ++template ++BOOST_CONTAINER_FORCEINLINE void construct_type(T *p, BOOST_FWD_REF(Args) ...args) ++{ ++ ::new((void*)p, boost_container_new_t()) T(::boost::forward(args)...); ++} ++ ++template < class Pair, class KeyType, class ... Args> ++typename dtl::enable_if< dtl::is_pair, void >::type ++construct_type ++ (Pair* p, try_emplace_t, BOOST_FWD_REF(KeyType) k, BOOST_FWD_REF(Args) ...args) ++{ ++ construct_type(dtl::addressof(p->first), ::boost::forward(k)); ++ BOOST_CONTAINER_TRY{ ++ construct_type(dtl::addressof(p->second), ::boost::forward(args)...); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename Pair::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++#else ++ ++#define BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ(N) \ ++template\ ++BOOST_CONTAINER_FORCEINLINE \ ++ typename dtl::disable_if_c::value, void >::type \ ++construct_type(T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ ++{\ ++ ::new((void*)p, boost_container_new_t()) T( BOOST_MOVE_FWD##N );\ ++}\ ++// ++BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ) ++#undef BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ ++ ++#define BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE(N) \ ++template < class Pair, class KeyType BOOST_MOVE_I##N BOOST_MOVE_CLASS##N>\ ++typename dtl::enable_if< dtl::is_pair, void >::type construct_type\ ++ (Pair* p, try_emplace_t, BOOST_FWD_REF(KeyType) k BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ ++{\ ++ construct_type(dtl::addressof(p->first), ::boost::forward(k));\ ++ BOOST_CONTAINER_TRY{\ ++ construct_type(dtl::addressof(p->second) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\ ++ }\ ++ BOOST_CONTAINER_CATCH(...) {\ ++ typedef typename Pair::first_type first_type;\ ++ dtl::addressof(p->first)->~first_type();\ ++ BOOST_CONTAINER_RETHROW\ ++ }\ ++ BOOST_CONTAINER_CATCH_END\ ++}\ ++// ++BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE) ++#undef BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE ++ ++#endif ++ ++template ++inline ++typename dtl::enable_if, void >::type ++construct_type(T* p) ++{ ++ dtl::construct_type(dtl::addressof(p->first)); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second)); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++ ++template ++inline ++typename dtl::enable_if_c ++ < dtl::is_pair::value ++ , void >::type ++construct_type(T* p, U &u) ++{ ++ dtl::construct_type(dtl::addressof(p->first), u.first); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second), u.second); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++template ++inline ++typename dtl::enable_if_c ++ < dtl::is_pair::type>::value && ++ !boost::move_detail::is_reference::value //This is needed for MSVC10 and ambiguous overloads ++ , void >::type ++construct_type(T* p, BOOST_RV_REF(U) u) ++{ ++ dtl::construct_type(dtl::addressof(p->first), ::boost::move(u.first)); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second), ::boost::move(u.second)); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++template ++inline ++typename dtl::enable_if, void >::type ++construct_type(T* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y) ++{ ++ dtl::construct_type(dtl::addressof(p->first), ::boost::forward(x)); ++ BOOST_CONTAINER_TRY{ ++ dtl::construct_type(dtl::addressof(p->second), ::boost::forward(y)); ++ } ++ BOOST_CONTAINER_CATCH(...) { ++ typedef typename T::first_type first_type; ++ dtl::addressof(p->first)->~first_type(); ++ BOOST_CONTAINER_RETHROW ++ } ++ BOOST_CONTAINER_CATCH_END ++} ++ ++} //namespace dtl + + #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + +@@ -419,7 +559,7 @@ struct allocator_traits + + template + inline static void priv_construct(dtl::false_type, Allocator &, T *p, BOOST_FWD_REF(Args) ...args) +- { ::new((void*)p, boost_container_new_t()) T(::boost::forward(args)...); } ++ { dtl::construct_type(p, ::boost::forward(args)...); } + #else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + public: + +@@ -450,7 +590,7 @@ struct allocator_traits + \ + template\ + inline static void priv_construct(dtl::false_type, Allocator &, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ +- { ::new((void*)p, boost_container_new_t()) T(BOOST_MOVE_FWD##N); }\ ++ { dtl::construct_type(p BOOST_MOVE_I##N BOOST_MOVE_FWD##N); }\ + // + BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL) + #undef BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL +diff --git a/boost/container/detail/construct_in_place.hpp b/boost/container/detail/construct_in_place.hpp +index d824d814a..bfdf05c2e 100644 +--- a/boost/container/detail/construct_in_place.hpp ++++ b/boost/container/detail/construct_in_place.hpp +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + namespace boost { + namespace container { +@@ -62,9 +63,42 @@ BOOST_CONTAINER_FORCEINLINE void construct_in_place(Allocator &a, T *dest, empla + + //Assignment + ++template ++BOOST_CONTAINER_FORCEINLINE ++ typename dtl::disable_if_c ++ < dtl::is_pair::type>::value ++ && dtl::is_pair::type>::value ++ , void>::type ++assign_in_place_ref(T &t, BOOST_FWD_REF(U) u) ++{ t = ::boost::forward(u); } ++ ++template ++BOOST_CONTAINER_FORCEINLINE ++ typename dtl::enable_if_c ++ < dtl::is_pair::type>::value ++ && dtl::is_pair::type>::value ++ , void>::type ++assign_in_place_ref(T &t, const U &u) ++{ ++ assign_in_place_ref(t.first, u.first); ++ assign_in_place_ref(t.second, u.second); ++} ++ ++template ++BOOST_CONTAINER_FORCEINLINE ++ typename dtl::enable_if_c ++ < dtl::is_pair::type>::value ++ && dtl::is_pair::type>::value ++ , void>::type ++assign_in_place_ref(T &t, BOOST_RV_REF(U) u) ++{ ++ assign_in_place_ref(t.first, ::boost::move(u.first)); ++ assign_in_place_ref(t.second, ::boost::move(u.second)); ++} ++ + template + BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, InpIt source) +-{ *dest = *source; } ++{ assign_in_place_ref(*dest, *source); } + + template + BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, value_init_construct_iterator) +diff --git a/boost/container/flat_map.hpp b/boost/container/flat_map.hpp +index b092fb212..e4843f566 100644 +--- a/boost/container/flat_map.hpp ++++ b/boost/container/flat_map.hpp +@@ -48,6 +48,11 @@ + #include + #endif + ++#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) ++#define BOOST_CONTAINER_STD_PAIR_IS_MOVABLE ++#endif ++ ++ + namespace boost { + namespace container { + +@@ -58,21 +63,37 @@ class flat_multimap; + + namespace dtl{ + ++#if defined(BOOST_CONTAINER_STD_PAIR_IS_MOVABLE) + template + BOOST_CONTAINER_FORCEINLINE static D &force(S &s) +-{ return *move_detail::force_ptr(&s); } ++{ return s; } + + template + BOOST_CONTAINER_FORCEINLINE static const D &force(const S &s) +-{ return *move_detail::force_ptr(&s); } ++{ return s; } ++ ++template ++BOOST_CONTAINER_FORCEINLINE static D force_copy(D s) ++{ return s; } ++ ++#else //!BOOST_CONTAINER_DOXYGEN_INVOKED ++ ++template ++BOOST_CONTAINER_FORCEINLINE static D &force(S &s) ++{ return *move_detail::launder_cast(&s); } ++ ++template ++BOOST_CONTAINER_FORCEINLINE static const D &force(const S &s) ++{ return *move_detail::launder_cast(&s); } + + template + BOOST_CONTAINER_FORCEINLINE static D force_copy(const S &s) + { +- const D *const vp = move_detail::force_ptr(&s); ++ const D *const vp = move_detail::launder_cast(&s); + D ret_val(*vp); + return ret_val; + } ++#endif //BOOST_CONTAINER_DOXYGEN_INVOKED + + } //namespace dtl{ + +@@ -118,18 +139,27 @@ class flat_map + private: + BOOST_COPYABLE_AND_MOVABLE(flat_map) + //This is the tree that we should store if pair was movable ++ typedef std::pair std_pair_t; + typedef dtl::flat_tree< +- std::pair, ++ std_pair_t, + dtl::select1st, + Compare, + AllocatorOrContainer> tree_t; + + //This is the real tree stored here. It's based on a movable pair ++ typedef dtl::pair dtl_pair_t; ++ ++ #ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE ++ typedef std_pair_t impl_pair_t; ++ #else ++ typedef dtl_pair_t impl_pair_t; ++ #endif ++ + typedef dtl::flat_tree< +- dtl::pair, ++ impl_pair_t, + dtl::select1st, + Compare, +- typename dtl::container_or_allocator_rebind >::type ++ typename dtl::container_or_allocator_rebind::type + > impl_tree_t; + impl_tree_t m_flat_tree; // flat tree representing flat_map + +@@ -851,7 +881,7 @@ class flat_map + //! @copydoc ::boost::container::flat_set::nth(size_type) const + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW +- { return dtl::force_copy(m_flat_tree.nth(n)); } ++ { return dtl::force_copy(m_flat_tree.nth(n)); } + + //! @copydoc ::boost::container::flat_set::index_of(iterator) + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline +@@ -1099,7 +1129,7 @@ class flat_map + template + inline BOOST_CONTAINER_DOC1ST + ( std::pair +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I std::pair >::type) + insert(BOOST_FWD_REF(Pair) x) + { +@@ -1153,7 +1183,7 @@ class flat_map + template + inline BOOST_CONTAINER_DOC1ST + ( iterator +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I iterator>::type) + insert(const_iterator p, BOOST_FWD_REF(Pair) x) + { +@@ -1777,17 +1807,24 @@ class flat_multimap + #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + private: + BOOST_COPYABLE_AND_MOVABLE(flat_multimap) ++ typedef std::pair std_pair_t; + typedef dtl::flat_tree< +- std::pair, ++ std_pair_t, + dtl::select1st, + Compare, + AllocatorOrContainer> tree_t; + //This is the real tree stored here. It's based on a movable pair ++ typedef dtl::pair dtl_pair_t; ++ #ifdef BOOST_CONTAINER_STD_PAIR_IS_MOVABLE ++ typedef std_pair_t impl_pair_t; ++ #else ++ typedef dtl_pair_t impl_pair_t; ++ #endif + typedef dtl::flat_tree< +- dtl::pair, ++ impl_pair_t, + dtl::select1st, + Compare, +- typename dtl::container_or_allocator_rebind >::type ++ typename dtl::container_or_allocator_rebind::type + > impl_tree_t; + impl_tree_t m_flat_tree; // flat tree representing flat_map + +@@ -2388,7 +2425,7 @@ class flat_multimap + //! @copydoc ::boost::container::flat_set::nth(size_type) const + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW +- { return dtl::force_copy(m_flat_tree.nth(n)); } ++ { return dtl::force_copy(m_flat_tree.nth(n)); } + + //! @copydoc ::boost::container::flat_set::index_of(iterator) + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline +@@ -2477,7 +2514,7 @@ class flat_multimap + template + inline BOOST_CONTAINER_DOC1ST + ( iterator +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I iterator >::type) + insert(BOOST_FWD_REF(Pair) x) + { return dtl::force_copy(m_flat_tree.emplace_equal(boost::forward(x))); } +@@ -2514,7 +2551,7 @@ class flat_multimap + template + inline BOOST_CONTAINER_DOC1ST + ( iterator +- , typename dtl::enable_if_c::value ++ , typename dtl::enable_if_c::value + BOOST_MOVE_I iterator>::type) + insert(const_iterator p, BOOST_FWD_REF(Pair) x) + { +-- +2.31.1 + diff --git a/recipes/boost/all/patches/1.87.0-boost-fiber-fix-property-numa.patch b/recipes/boost/all/patches/1.87.0-boost-fiber-fix-property-numa.patch new file mode 100644 index 0000000000000..a8bf6392441b7 --- /dev/null +++ b/recipes/boost/all/patches/1.87.0-boost-fiber-fix-property-numa.patch @@ -0,0 +1,60 @@ +From 238487b543e8863c647d31a82ccfc3fa11a960d9 Mon Sep 17 00:00:00 2001 +From: Oliver Kowalke +Date: Fri, 21 Feb 2025 15:28:56 +0100 +Subject: [PATCH 1/1] fix property numa + +--- + libs/fiber/boost-fiber-features.jam | 10 ++++++++++ + libs/fiber/build.jam | 5 +++++ + libs/fiber/build/Jamfile.v2 | 3 --- + 3 files changed, 15 insertions(+), 3 deletions(-) + create mode 100644 boost-fiber-features.jam + +diff --git a/libs/fiber/boost-fiber-features.jam b/libs/fiber/boost-fiber-features.jam +new file mode 100644 +index 0000000..d3eba2f +--- /dev/null ++++ b/libs/fiber/boost-fiber-features.jam +@@ -0,0 +1,10 @@ ++# Copyright René Ferdinand Rivera Morell 2023-2024 ++# Distributed under the Boost Software License, Version 1.0. ++# (See accompanying file LICENSE_1_0.txt or copy at ++# http://www.boost.org/LICENSE_1_0.txt) ++ ++import feature ; ++import os ; ++ ++feature.feature numa : on : optional propagated composite ; ++feature.compose on : BOOST_USE_NUMA ; +diff --git a/libs/fiber/build.jam b/libs/fiber/build.jam +index 27e70ae..81b929f 100644 +--- a/libs/fiber/build.jam ++++ b/libs/fiber/build.jam +@@ -5,6 +5,11 @@ + + require-b2 5.2 ; + ++import-search /boost/predef/tools/check ; ++ ++import predef ; ++import boost-fiber-features ; ++ + constant boost_dependencies : + /boost/assert//boost_assert + /boost/config//boost_config +diff --git a/libs/fiber/build/Jamfile.v2 b/libs/fiber/build/Jamfile.v2 +index e477938..08987b1 100644 +--- a/libs/fiber/build/Jamfile.v2 ++++ b/libs/fiber/build/Jamfile.v2 +@@ -14,9 +14,6 @@ import config : requires ; + import-search /boost/context ; + import boost-context-features ; + +-feature.feature numa : on : optional propagated composite ; +-feature.compose on : BOOST_USE_NUMA ; +- + constant boost_dependencies_private : + /boost/algorithm//boost_algorithm + /boost/filesystem//boost_filesystem +-- +2.31.1 diff --git a/recipes/boost/all/patches/bcp_namespace_issues_1_71.patch b/recipes/boost/all/patches/bcp_namespace_issues_1_71.patch deleted file mode 100644 index 94e748ef55f4b..0000000000000 --- a/recipes/boost/all/patches/bcp_namespace_issues_1_71.patch +++ /dev/null @@ -1,33 +0,0 @@ -From d0586e88122f41cd5ac9666db70c37d6f0fc7480 Mon Sep 17 00:00:00 2001 -From: Peter Dimov -Date: Sun, 26 May 2019 18:49:12 +0300 -Subject: [PATCH] Fix `bcp --namespace` issues - ---- - Jamroot | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/Jamroot b/Jamroot -index e0d7c90f51d..4e913c2b3f3 100644 ---- a/Jamroot -+++ b/Jamroot -@@ -140,7 +140,8 @@ import "class" : new ; - import property-set ; - import threadapi-feature ; - import option ; --import tools/boost_install/boost-install ; -+# Backslash because of `bcp --namespace` -+import tools/boost\_install/boost-install ; - - path-constant BOOST_ROOT : . ; - constant BOOST_VERSION : 1.71.0 ; -@@ -311,8 +312,8 @@ rule boost-install ( libraries * ) - # stage and install targets via boost-install, above. - rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * ) - { -+ autolink = shared:BOOST_$(name:U)_DYN_LINK=1 ; - name = boost_$(name) ; -- autolink = shared:$(name:U)_DYN_LINK=1 ; - lib $(name) - : $(sources) - : $(requirements) $(autolink) diff --git a/recipes/boost/all/patches/bcp_namespace_issues_1_72.patch b/recipes/boost/all/patches/bcp_namespace_issues_1_72.patch deleted file mode 100644 index 5ffe1ec157b19..0000000000000 --- a/recipes/boost/all/patches/bcp_namespace_issues_1_72.patch +++ /dev/null @@ -1,33 +0,0 @@ -From d0586e88122f41cd5ac9666db70c37d6f0fc7480 Mon Sep 17 00:00:00 2001 -From: Peter Dimov -Date: Sun, 26 May 2019 18:49:12 +0300 -Subject: [PATCH] Fix `bcp --namespace` issues - ---- - Jamroot | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/Jamroot b/Jamroot -index e0d7c90f51d..4e913c2b3f3 100644 ---- a/Jamroot -+++ b/Jamroot -@@ -140,7 +140,8 @@ import "class" : new ; - import property-set ; - import threadapi-feature ; - import option ; --import tools/boost_install/boost-install ; -+# Backslash because of `bcp --namespace` -+import tools/boost\_install/boost-install ; - - path-constant BOOST_ROOT : . ; - constant BOOST_VERSION : 1.72.0 ; -@@ -311,8 +312,8 @@ rule boost-install ( libraries * ) - # stage and install targets via boost-install, above. - rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * ) - { -+ autolink = shared:BOOST_$(name:U)_DYN_LINK=1 ; - name = boost_$(name) ; -- autolink = shared:$(name:U)_DYN_LINK=1 ; - lib $(name) - : $(sources) - : $(requirements) $(autolink) diff --git a/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch b/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch deleted file mode 100644 index 5e6c660ee96c2..0000000000000 --- a/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/tools/build/src/tools/qcc.jam b/tools/build/src/tools/qcc.jam -index 155b1ac3..64274e65 100644 ---- a/tools/build/src/tools/qcc.jam -+++ b/tools/build/src/tools/qcc.jam -@@ -48,7 +48,7 @@ generators.register-c-compiler qcc.compile.asm : ASM : OBJ : qcc ; - - - # Declare flags for compilation. --toolset.flags qcc.compile OPTIONS on : -gstabs+ ; -+toolset.flags qcc.compile OPTIONS on : -g ; - - # Declare flags and action for compilation. - toolset.flags qcc.compile OPTIONS off : -O0 ; -@@ -164,7 +164,7 @@ generators.override qcc.searched-lib-generator : searched-lib-generator ; - - # Declare flags for linking. - # First, the common flags. --toolset.flags qcc.link OPTIONS on : -gstabs+ ; -+toolset.flags qcc.link OPTIONS on : -g ; - toolset.flags qcc.link OPTIONS on : -p ; - toolset.flags qcc.link OPTIONS ; - toolset.flags qcc.link LINKPATH ; diff --git a/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch b/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch deleted file mode 100644 index 29b744e9667d3..0000000000000 --- a/recipes/boost/all/patches/boost_build_qcc_fix_debug_build_parameter_since_1_74.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/tools/build/src/tools/qcc.jam b/tools/build/src/tools/qcc.jam -index 740e907..b0653f1 100644 ---- a/tools/build/src/tools/qcc.jam -+++ b/tools/build/src/tools/qcc.jam -@@ -86,7 +86,7 @@ local rule check-target-platform - } - - # Declare flags for compilation. --toolset.flags qcc.compile OPTIONS on : -gstabs+ ; -+toolset.flags qcc.compile OPTIONS on : -g ; - - # Declare flags and action for compilation. - toolset.flags qcc.compile OPTIONS off : -O0 ; -@@ -216,7 +216,7 @@ generators.override qcc.searched-lib-generator : searched-lib-generator ; - - # Declare flags for linking. - # First, the common flags. --toolset.flags qcc.link OPTIONS on : -gstabs+ ; -+toolset.flags qcc.link OPTIONS on : -g ; - toolset.flags qcc.link OPTIONS on : -p ; - toolset.flags qcc.link OPTIONS ; - toolset.flags qcc.link LINKPATH ; diff --git a/recipes/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch b/recipes/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch deleted file mode 100644 index dffef671e7992..0000000000000 --- a/recipes/boost/all/patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/boost/core/uncaught_exceptions.hpp b/boost/core/uncaught_exceptions.hpp -index c39120b..436717f 100644 ---- a/boost/core/uncaught_exceptions.hpp -+++ b/boost/core/uncaught_exceptions.hpp -@@ -56,10 +56,15 @@ - // On Linux with clang and libc++ and on OS X, there is a version of cxxabi.h from libc++abi that doesn't declare __cxa_get_globals, but provides __cxa_uncaught_exceptions. - // The function only appeared in version _LIBCPPABI_VERSION >= 1002 of the library. Unfortunately, there are linking errors about undefined reference to __cxa_uncaught_exceptions - // on Ubuntu Trusty and OS X, so we avoid using it and forward-declare __cxa_get_globals instead. -+// On QNX SDP 7.0 (QCC 5.4.0), there are multiple cxxabi.h, one from glibcxx from gcc and another from libc++abi from LLVM. Which one is included will be determined by the qcc -+// command line arguments (-V and/or -Y; http://www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.utilities/topic/q/qcc.html). The LLVM libc++abi is missing the declaration -+// of __cxa_get_globals but it is also patched by QNX developers to not define _LIBCPPABI_VERSION. Older QNX SDP versions, up to and including 6.6, don't provide LLVM and libc++abi. -+// See https://github.com/boostorg/core/issues/59. - #if !defined(__FreeBSD__) && \ - ( \ - (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 407) || \ - defined(__OpenBSD__) || \ -+ (defined(__QNXNTO__) && !defined(__GLIBCXX__) && !defined(__GLIBCPP__)) || \ - defined(_LIBCPPABI_VERSION) \ - ) - namespace __cxxabiv1 { diff --git a/recipes/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch b/recipes/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch deleted file mode 100644 index bb010943f2bde..0000000000000 --- a/recipes/boost/all/patches/boost_log_filesystem_no_deprecated_1_72.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/libs/log/src/text_file_backend.cpp b/libs/log/src/text_file_backend.cpp -index 50cef3b..d5fd02e 100644 ---- a/libs/log/src/text_file_backend.cpp -+++ b/libs/log/src/text_file_backend.cpp -@@ -39,6 +39,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - #include diff --git a/recipes/boost/all/patches/boost_mpi_check.patch b/recipes/boost/all/patches/boost_mpi_check.patch deleted file mode 100644 index af7e45f610510..0000000000000 --- a/recipes/boost/all/patches/boost_mpi_check.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ru a/tools/build/src/tools/mpi.jam b/tools/build/src/tools/mpi.jam ---- a/tools/build/src/tools/mpi.jam 2019-12-10 01:20:16.000000000 +0100 -+++ b/tools/build/src/tools/mpi.jam 2020-09-02 13:17:22.942349254 +0200 -@@ -66,6 +66,8 @@ - import type ; - import path ; - -+import errors ; -+ - # Make this module a project - project.initialize $(__name__) ; - project mpi ; -@@ -539,6 +541,11 @@ - # Set up the "mpi" alias - alias mpi : : : : $(options) ; - } -+ -+ if ! $(.configured) -+ { -+ errors.user-error "MPI not configured" ; -+ } - } - - # States whether MPI has bee configured diff --git a/recipes/boost/all/patches/python_base_prefix.patch b/recipes/boost/all/patches/python_base_prefix.patch deleted file mode 100644 index 47371cba773df..0000000000000 --- a/recipes/boost/all/patches/python_base_prefix.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -ru a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam ---- a/tools/build/src/tools/python.jam -+++ b/tools/build/src/tools/python.jam -@@ -746,7 +746,7 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : - { - # Values to be extracted from python's sys module. These will be set by - # the probe rule, above, using Jam's dynamic scoping. -- local sys-elements = version platform prefix exec_prefix executable ; -+ local sys-elements = version platform base_prefix base_exec_prefix executable ; - local sys.$(sys-elements) ; - - # Compute the string Python's sys.platform needs to match. If not -@@ -786,10 +786,10 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : - { - debug-message ...requested configuration matched! ; - -- exec-prefix = $(sys.exec_prefix) ; -+ exec-prefix = $(sys.base_exec_prefix) ; - - compute-default-paths $(target-os) : $(sys.version) : -- $(sys.prefix) : $(sys.exec_prefix) ; -+ $(sys.base_prefix) : $(sys.base_exec_prefix) ; - - version = $(sys.version) ; - interpreter-cmd ?= $(cmd) ; diff --git a/recipes/boost/all/patches/python_base_prefix_since_1_74.patch b/recipes/boost/all/patches/python_base_prefix_since_1_74.patch deleted file mode 100644 index 2267fe4762dc8..0000000000000 --- a/recipes/boost/all/patches/python_base_prefix_since_1_74.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam -index cf8c379..3e3f095 100644 ---- a/tools/build/src/tools/python.jam -+++ b/tools/build/src/tools/python.jam -@@ -749,7 +749,7 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : - { - # Values to be extracted from python's sys module. These will be set by - # the probe rule, above, using Jam's dynamic scoping. -- local sys-elements = version platform prefix exec_prefix executable ; -+ local sys-elements = version platform base_prefix base_exec_prefix executable ; - local sys.$(sys-elements) ; - - # Compute the string Python's sys.platform needs to match. If not -@@ -789,10 +789,10 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : - { - debug-message ...requested configuration matched! ; - -- exec-prefix = $(sys.exec_prefix) ; -+ exec-prefix = $(sys.base_exec_prefix) ; - - compute-default-paths $(target-os) : $(sys.version) : -- $(sys.prefix) : $(sys.exec_prefix) ; -+ $(sys.base_prefix) : $(sys.base_exec_prefix) ; - - version = $(sys.version) ; - interpreter-cmd ?= $(cmd) ; diff --git a/recipes/boost/all/patches/solaris_pthread_data.patch b/recipes/boost/all/patches/solaris_pthread_data.patch deleted file mode 100644 index ea5e4d7048d4e..0000000000000 --- a/recipes/boost/all/patches/solaris_pthread_data.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp -index aefbeb4..bc9b136 100644 ---- a/boost/thread/pthread/thread_data.hpp -+++ b/boost/thread/pthread/thread_data.hpp -@@ -57,7 +57,7 @@ namespace boost - #else - std::size_t page_size = ::sysconf( _SC_PAGESIZE); - #endif --#if PTHREAD_STACK_MIN > 0 -+#ifdef PTHREAD_STACK_MIN - if (size +#include +// clang-format: on + +#include +#include + +#include +#include + +#if defined(BOOST_NAMESPACE) +namespace boost = BOOST_NAMESPACE; +#endif + +namespace proc = boost::process::v2; +namespace asio = boost::asio; + +int main() +{ + asio::io_context ctx; + asio::readable_pipe p{ctx}; + + const auto exe = proc::environment::find_executable("cmake"); + + proc::process c{ctx, exe, {"--version"}, proc::process_stdio{nullptr, p}}; + + std::string line; + boost::system::error_code ec; + + auto sz = asio::read(p, asio::dynamic_buffer(line), ec); + + std::cout << "CMake version: '" << line << "'" << std::endl; + + c.wait(); +} diff --git a/recipes/boost/all/test_v1_package/CMakeLists.txt b/recipes/boost/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c23ed5cfe6d98..0000000000000 --- a/recipes/boost/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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/boost/all/test_v1_package/conanfile.py b/recipes/boost/all/test_v1_package/conanfile.py deleted file mode 100644 index 4bdbddf498bcc..0000000000000 --- a/recipes/boost/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,52 +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", "cmake_find_package" - - def _boost_option(self, name, default): - try: - return getattr(self.options["boost"], name, default) - except (AttributeError, ConanException): - return default - - def build(self): - # FIXME: tools.vcvars added for clang-cl. Remove once conan supports clang-cl properly. (https://github.com/conan-io/conan-center-index/pull/1453) - with tools.vcvars(self.settings) if (self.settings.os == "Windows" and self.settings.compiler == "clang") else tools.no_op(): - cmake = CMake(self) - cmake.definitions["HEADER_ONLY"] = self.options["boost"].header_only - if not self.options["boost"].header_only: - cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared - cmake.definitions["WITH_PYTHON"] = not self.options["boost"].without_python - if not self.options["boost"].without_python: - pyversion = tools.Version(self.options["boost"].python_version) - cmake.definitions["PYTHON_VERSION_TO_SEARCH"] = pyversion - cmake.definitions["Python_EXECUTABLE"] = self.options["boost"].python_executable - cmake.definitions["WITH_RANDOM"] = not self.options["boost"].without_random - cmake.definitions["WITH_REGEX"] = not self.options["boost"].without_regex - cmake.definitions["WITH_TEST"] = not self.options["boost"].without_test - cmake.definitions["WITH_COROUTINE"] = not self.options["boost"].without_coroutine - cmake.definitions["WITH_CHRONO"] = not self.options["boost"].without_chrono - cmake.definitions["WITH_FIBER"] = not self.options["boost"].without_fiber - cmake.definitions["WITH_LOCALE"] = not self.options["boost"].without_locale - cmake.definitions["WITH_NOWIDE"] = not self._boost_option("without_nowide", True) - cmake.definitions["WITH_JSON"] = not self._boost_option("without_json", True) - cmake.definitions["WITH_STACKTRACE"] = not self.options["boost"].without_stacktrace - cmake.definitions["WITH_STACKTRACE_ADDR2LINE"] = self.deps_user_info["boost"].stacktrace_addr2line_available - cmake.definitions["WITH_STACKTRACE_BACKTRACE"] = self._boost_option("with_stacktrace_backtrace", False) - cmake.definitions["WITH_URL"] = not self._boost_option("without_url", True) - if self.options["boost"].namespace != 'boost' and not self.options["boost"].namespace_alias: - cmake.definitions['BOOST_NAMESPACE'] = self.options["boost"].namespace - cmake.configure() - # Disable parallel builds because c3i (=conan-center's test/build infrastructure) seems to choke here - cmake.parallel = False - cmake.build() - - def test(self): - if tools.cross_building(self): - return - self.run(f"ctest --output-on-failure -C {self.settings.build_type}", run_environment=True) - diff --git a/recipes/boost/config.yml b/recipes/boost/config.yml index f81f4b5e8e72b..08526a6d52f15 100644 --- a/recipes/boost/config.yml +++ b/recipes/boost/config.yml @@ -1,4 +1,12 @@ versions: + "1.87.0": + folder: all + "1.86.0": + folder: all + "1.85.0": + folder: all + "1.84.0": + folder: all "1.83.0": folder: all "1.82.0": @@ -11,17 +19,3 @@ versions: folder: all "1.78.0": folder: all - "1.77.0": - folder: all - "1.76.0": - folder: all - "1.75.0": - folder: all - "1.74.0": - folder: all - "1.73.0": - folder: all - "1.72.0": - folder: all - "1.71.0": - folder: all diff --git a/recipes/boostdep/all/test_v1_package/conanfile.py b/recipes/boostdep/all/test_v1_package/conanfile.py deleted file mode 100644 index 190cc18502e11..0000000000000 --- a/recipes/boostdep/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/botan/all/conandata.yml b/recipes/botan/all/conandata.yml index b4fd5502f1bd3..dd87f5eb9b704 100644 --- a/recipes/botan/all/conandata.yml +++ b/recipes/botan/all/conandata.yml @@ -1,58 +1,16 @@ sources: - "2.12.1": - url: "https://github.com/randombit/botan/archive/2.12.1.tar.gz" - sha256: "61d27332f053b0b1169659dc0fceb7de7d16cade230df3a14dfaa2c091888b98" - "2.13.0": - url: "https://github.com/randombit/botan/archive/2.13.0.tar.gz" - sha256: "29a57d8efd6ab297eab67cbf489a5a423b06e120e0520aff2583074e8aea151c" - "2.14.0": - url: "https://github.com/randombit/botan/archive/2.14.0.tar.gz" - sha256: "38e34b8ef7652e811382744425b82da1b1a7fb5f14cc281a7d3a18543eaf72f7" - "2.15.0": - url: "https://github.com/randombit/botan/archive/2.15.0.tar.gz" - sha256: "9a86b1a8adbac37fdff9cf5745b3a313020c33579d8fc51cb996c47d3adf5585" - "2.16.0": - url: "https://github.com/randombit/botan/archive/2.16.0.tar.gz" - sha256: "8f448b97120e884d755b946045753876d688b01f48f5e6a1cf37aebd5afecbe5" - "2.17.0": - url: "https://github.com/randombit/botan/archive/2.17.0.tar.gz" - sha256: "32874e4e14bf11428e1bc4919e5ee174a68e2f480d37bc79ed015b2b5ef87fef" - "2.17.1": - url: "https://github.com/randombit/botan/archive/2.17.1.tar.gz" - sha256: "ca562c00e61663c418bd9fdc6c70bdeaedafba8bef328cb6046a1d6390d39a71" - "2.17.2": - url: "https://github.com/randombit/botan/archive/2.17.2.tar.gz" - sha256: "3d99da64573abab6d6e8036a45f8c567a57721c8f23850e05aadd84fc2e0075c" - "2.17.3": - url: "https://github.com/randombit/botan/archive/2.17.3.tar.gz" - sha256: "544c62e43be0c60fff7ac8707ee99fe134c75bef06bded217d04f0a4b333519a" - "2.18.0": - url: "https://github.com/randombit/botan/archive/2.18.0.tar.gz" - sha256: "8556991402f9ecf5f84f1f2c4de20ca3fd14a5ebd775f065ea6676b36646a77d" - "2.18.1": - url: "https://github.com/randombit/botan/archive/2.18.1.tar.gz" - sha256: "4afebf2dbfa2f047d161437dcc544003d5822f47ceac97ada6a24948297bd3ed" - "2.18.2": - url: "https://github.com/randombit/botan/archive/2.18.2.tar.gz" - sha256: "10ded69c4fd4ade9d87527b394787beefa190b4ecb65ed04535bdd00e088cd96" - "2.19.1": - url: "https://github.com/randombit/botan/archive/2.19.1.tar.gz" - sha256: "eb5eaac0d8bf1dcf64b7ae39736d928fca8be1b24c27787873106e41a6c36725" - "2.19.2": - url: "https://github.com/randombit/botan/archive/2.19.2.tar.gz" - sha256: "47bb0330255cf1a439db3f2bc91894b2f41788e58eb71d27e0abf36038d93f1e" - "2.19.3": - url: "https://github.com/randombit/botan/archive/2.19.3.tar.gz" - sha256: "8f568bf74c2e476d92ac8a1cfc2ba8407ec038fe9458bd0a11e7da827a9b8199" -patches: - "2.12.1": - - patch_file: "patches/dll-dir.patch" - base_path: "sources" - - patch_file: "patches/fix-unrecognized-linker-flag.patch" - base_path: "sources" - "2.17.2": - - patch_file: "patches/vs2015-install-fix.patch" - base_path: "sources" - "2.18.2": - - patch_file: "patches/fix-amalgamation-build.patch" - base_path: "sources" + "3.6.1": + url: "https://github.com/randombit/botan/archive/3.6.1.tar.gz" + sha256: "a6c4e8dcb6c7f4b9b67e2c8b43069d65b548970ca17847e3b1e031d3ffdd874a" + "3.5.0": + url: "https://github.com/randombit/botan/archive/3.5.0.tar.gz" + sha256: "7d91d3349e6029e1a6929a50ab587f9fd4e29a9af3f3d698553451365564001f" + "3.4.0": + url: "https://github.com/randombit/botan/archive/3.4.0.tar.gz" + sha256: "6ef2a16a0527b1cfc9648a644877f7b95c4d07e8ef237273b030c623418c5e5b" + "3.3.0": + url: "https://github.com/randombit/botan/archive/3.3.0.tar.gz" + sha256: "57fefda7b9ab6f8409329620cdaf26d2d7e962b6a10eb321d331e9ecb796f804" + "2.19.5": + url: "https://github.com/randombit/botan/archive/2.19.5.tar.gz" + sha256: "8d4a3826787f9febbdc225172ad2d39d7d3960346c5721fe46cb27d480d7e1de" diff --git a/recipes/botan/all/conanfile.py b/recipes/botan/all/conanfile.py index e8599f32dde75..abc9b35bf1340 100644 --- a/recipes/botan/all/conanfile.py +++ b/recipes/botan/all/conanfile.py @@ -1,9 +1,21 @@ -from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os +import shutil +import platform -required_conan_version = ">=1.45.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name, XCRun +from conan.tools.build import build_jobs, check_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, VCVars, check_min_vs +from conan.tools.microsoft import unix_path +from conan.tools.scm import Version + + +required_conan_version = ">=1.55" class BotanConan(ConanFile): @@ -11,9 +23,10 @@ class BotanConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/randombit/botan" license = "BSD-2-Clause" - description = "Botan is a cryptography library written in C++11." - topics = ("cryptography", "crypto", "C++11", "tls") + description = "Botan is a cryptography library written in modern C++." + topics = ("cryptography", "crypto", "c++11", "c++20", "tls") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,7 +34,6 @@ class BotanConan(ConanFile): "amalgamation": [True, False], "with_bzip2": [True, False], "with_openssl": [True, False], - "single_amalgamation": [True, False], "with_sqlite3": [True, False], "with_zlib": [True, False], "with_boost": [True, False], @@ -39,8 +51,11 @@ class BotanConan(ConanFile): "with_neon": [True, False], "with_armv8crypto": [True, False], "with_powercrypto": [True, False], - "enable_modules": "ANY", - "system_cert_bundle": "ANY", + "enable_modules": [None, "ANY"], + "disable_modules": [None, "ANY"], + "enable_experimental_features": [True, False], + "enable_deprecated_features": [True, False], + "system_cert_bundle": [None, "ANY"], "module_policy": [None, "bsi", "modern", "nist"], } default_options = { @@ -49,7 +64,6 @@ class BotanConan(ConanFile): "amalgamation": True, "with_bzip2": False, "with_openssl": False, - "single_amalgamation": False, "with_sqlite3": False, "with_zlib": False, "with_boost": False, @@ -68,10 +82,15 @@ class BotanConan(ConanFile): "with_armv8crypto": True, "with_powercrypto": True, "enable_modules": None, + "disable_modules": None, + "enable_experimental_features": False, + "enable_deprecated_features": True, "system_cert_bundle": None, "module_policy": None, } + _extra_cxxflags = None + @property def _is_x86(self): return str(self.settings.arch) in ['x86', 'x86_64'] @@ -84,14 +103,8 @@ def _is_ppc(self): def _is_arm(self): return 'arm' in str(self.settings.arch) - @property - def _source_subfolder(self): - # Required to build at least 2.12.1 - return "sources" - 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': @@ -115,86 +128,146 @@ def config_options(self): del self.options.with_altivec del self.options.with_powercrypto - # --single-amalgamation option is no longer available - # See also https://github.com/randombit/botan/pull/2246 - if tools.Version(self.version) >= '2.14.0': - del self.options.single_amalgamation + # Support for the OpenSSL provider was removed in 2.19.2 + if Version(self.version) >= '2.19.2': + del self.options.with_openssl def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): if self.options.with_bzip2: self.requires("bzip2/1.0.8") - if self.options.with_openssl: - self.requires("openssl/1.1.1o") + if self.options.get_safe('with_openssl', False): + self.requires("openssl/[>=1.1 <3]") if self.options.with_zlib: - 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.45.1") if self.options.with_boost: - self.requires("boost/1.79.0") + self.requires("boost/1.84.0") @property def _required_boost_components(self): return ['coroutine', 'system'] + @property + def _min_cppstd(self): + # From the same links as below + return 11 if Version(self.version) < "3.0.0" else 20 + + @property + def _compilers_minimum_version(self): + if Version(self.version).major < 3: + # From https://github.com/randombit/botan/blob/2.19.3/doc/support.rst + return { + "gcc": "4.8", + "clang": "3.5", + "Visual Studio": "14", + "msvc": "190", + } + else: + # From https://github.com/randombit/botan/blob/master/doc/support.rst + return { + "gcc": "11.2", + "clang": "14", + "apple-clang": "14", + "Visual Studio": "17", + "msvc": "193", + } + def validate(self): if self.options.with_boost: - 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 self.options['boost'].shared or self.options['boost'].magic_autolink or miss_boost_required_comp: - raise ConanInvalidConfiguration('{0} requires non-header-only static boost, without magic_autolink, and with these components: {1}'.format(self.name, ', '.join(self._required_boost_components))) + boost_opts = self.dependencies['boost'].options + miss_boost_required_comp = any(getattr(boost_opts, 'without_{}'.format(boost_comp), True) for boost_comp in self._required_boost_components) + if boost_opts.header_only or boost_opts.shared or boost_opts.magic_autolink or miss_boost_required_comp: + raise ConanInvalidConfiguration( + f"{self.name} requires non-header-only static boost, " + f"without magic_autolink, and with these components: {', '.join(self._required_boost_components)}") + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) compiler = self.settings.compiler - version = tools.Version(self.settings.compiler.version) + compiler_name = str(compiler) + compiler_version = Version(compiler.version) - if compiler == 'Visual Studio' and version < '14': - raise ConanInvalidConfiguration("Botan doesn't support MSVC < 14") + check_min_vs(self, self._compilers_minimum_version["msvc"]) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(compiler_name, 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 {compiler_name} {minimum_version})." + ) + if not minimum_version: + self.output.warning(f"{self.name} recipe lacks information about the {compiler_name} compiler support.") - elif compiler == 'gcc' and version >= '5' and compiler.libcxx != 'libstdc++11': + if self.settings.compiler == 'gcc' and compiler_version >= "5" and self.settings.compiler.libcxx != 'libstdc++11': raise ConanInvalidConfiguration( 'Using Botan with GCC >= 5 on Linux requires "compiler.libcxx=libstdc++11"') - elif compiler == 'clang' and compiler.libcxx not in ['libstdc++11', 'libc++']: + if (self.settings.compiler == 'clang' and self.settings.os == "Linux" and self.settings.compiler.libcxx not in ['libstdc++11', 'libc++'] + and self.settings.os != "Android"): raise ConanInvalidConfiguration( 'Using Botan with Clang on Linux requires either "compiler.libcxx=libstdc++11" ' \ 'or "compiler.libcxx=libc++"') # Some older compilers cannot handle the amalgamated build anymore # See also https://github.com/randombit/botan/issues/2328 - if tools.Version(self.version) >= '2.14.0' and self.options.amalgamation: - if (compiler == 'apple-clang' and version < '10') or \ - (compiler == 'gcc' and version < '8') or \ - (compiler == 'clang' and version < '7'): + if self.options.amalgamation: + if (self.settings.compiler == 'apple-clang' and compiler_version < '10') or \ + (self.settings.compiler == 'gcc' and compiler_version < '8') or \ + (self.settings.compiler == 'clang' and compiler_version < '7'): raise ConanInvalidConfiguration( - 'botan amalgamation is not supported for {}/{}'.format(compiler, version)) + f"botan amalgamation is not supported for {compiler}/{compiler_version}") - if self.options.get_safe("single_amalgamation", False) and not self.options.amalgamation: - raise ConanInvalidConfiguration("botan:single_amalgamation=True requires botan:amalgamation=True") + def layout(self): + basic_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) + + @property + def _cxxflags(self): + global_cxxflags = " ".join(self.conf.get("tools.build:cxxflags", default=[], check_type=list)) + env_cxxflags = VirtualBuildEnv(self).vars().get("CXXFLAGS", default="") + cxxflags = f"{env_cxxflags} {global_cxxflags}".strip() + return cxxflags if len(cxxflags) > 1 else None + + def generate(self): + if is_msvc(self): + ms = VCVars(self) + ms.generate() + + # This is to work around botan's configure script that *replaces* its + # standard (platform dependent) flags in presence of an environment + # variable ${CXXFLAGS}. Most notably, this would build botan with + # disabled compiler optimizations. + self._extra_cxxflags = self._cxxflags + self.buildenv.unset('CXXFLAGS') + VirtualBuildEnv(self).generate() def build(self): - for patch in self.conan_data.get('patches', {}).get(self.version, []): - tools.patch(**patch) - with tools.chdir(self._source_subfolder): + apply_conandata_patches(self) + with chdir(self, self.source_folder): self.run(self._configure_cmd) self.run(self._make_cmd) def package(self): - self.copy(pattern='license.txt', dst='licenses', src=self._source_subfolder) - with tools.chdir(self._source_subfolder): + copy(self, "license.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + # Note: this will fail to properly consider the package_folder if a "conan build" followed by a "conan export-pkg" is executed self.run(self._make_install_cmd) + if Version(self.version) >= "3.3.0": + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + fix_apple_shared_install_name(self) def package_info(self): - major_version = tools.Version(self.version).major + major_version = Version(self.version).major self.cpp_info.set_property("pkg_config_name", f"botan-{major_version}") - self.cpp_info.names["pkg_config"] = f"botan-{major_version}" - self.cpp_info.libs = ["botan" if is_msvc(self) else f"botan-{major_version}"] + self.cpp_info.libs = ["botan" if is_msvc(self) and major_version < 3 else f"botan-{major_version}"] if self.settings.os == 'Linux': - self.cpp_info.system_libs.extend(['dl', 'rt', 'pthread']) + self.cpp_info.system_libs.extend(['dl', 'rt', 'pthread', 'm']) if self.settings.os == 'Macos': self.cpp_info.frameworks = ['Security', 'CoreFoundation'] if self.settings.os == 'Windows': @@ -213,17 +286,17 @@ def _botan_os(self): return {'Windows': 'windows', 'Linux': 'linux', 'Macos': 'darwin', - 'Android': 'linux', + 'Android': 'android', 'baremetal': 'none', 'iOS': 'ios'}.get(str(self.settings.os)) def _dependency_build_flags(self, dependency): # Since botan has a custom build system, we need to specifically inject # these build parameters so that it picks up the correct dependencies. - dep_cpp_info = self.deps_cpp_info[dependency] + dep_cpp_info = self.dependencies[dependency].cpp_info return \ - ['--with-external-includedir={}'.format(include_path) for include_path in dep_cpp_info.include_paths] + \ - ['--with-external-libdir={}'.format(lib_path) for lib_path in dep_cpp_info.lib_paths] + \ + ['--with-external-includedir={}'.format(include_path) for include_path in dep_cpp_info.includedirs] + \ + ['--with-external-libdir={}'.format(lib_path) for lib_path in dep_cpp_info.libdirs] + \ ['--define-build-macro={}'.format(define) for define in dep_cpp_info.defines] @property @@ -256,48 +329,55 @@ def _configure_cmd(self): elif self.settings.arch in ['x86_64']: botan_abi_flags.append('-arch x86_64') - if self.options.get_safe('fPIC', True): + if self.options.get_safe('fPIC', True) and not is_msvc(self): botan_extra_cxx_flags.append('-fPIC') - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): if self.settings.get_safe('os.version'): # Required, see https://github.com/conan-io/conan-center-index/pull/3456 - macos_min_version = tools.apple_deployment_target_flag(self.settings.os, - self.settings.get_safe('os.version'), - self.settings.get_safe('os.sdk'), - self.settings.get_safe('os.subsystem'), - self.settings.get_safe('arch')) + macos_min_version = macos_min_version = AutotoolsToolchain(self).apple_min_version_flag botan_extra_cxx_flags.append(macos_min_version) - macos_sdk_path = '-isysroot {}'.format(tools.XCRun(self.settings).sdk_path) + macos_sdk_path = '-isysroot {}'.format(XCRun(self).sdk_path) botan_extra_cxx_flags.append(macos_sdk_path) - # This is to work around botan's configure script that *replaces* its - # standard (platform dependent) flags in presence of an environment - # variable ${CXXFLAGS}. Most notably, this would build botan with - # disabled compiler optimizations. - environment_cxxflags = tools.get_env('CXXFLAGS') - if environment_cxxflags: - del os.environ['CXXFLAGS'] - botan_extra_cxx_flags.append(environment_cxxflags) + if self._extra_cxxflags: + botan_extra_cxx_flags.append(self._extra_cxxflags) + + if Version(self.version) >= '3.4': + # Botan 3.4.0 introduced a 'module life cycle' feature, before that + # the experimental/deprecated feature switches are ignored. + + if self.options.enable_experimental_features: + build_flags.append('--enable-experimental-features') + else: + build_flags.append('--disable-experimental-features') + + if self.options.enable_deprecated_features: + build_flags.append('--enable-deprecated-features') + else: + build_flags.append('--disable-deprecated-features') if self.options.enable_modules: build_flags.append('--minimized-build') build_flags.append('--enable-modules={}'.format(self.options.enable_modules)) + if self.options.disable_modules: + build_flags.append('--disable-modules={}'.format(self.options.disable_modules)) + if self.options.amalgamation: build_flags.append('--amalgamation') - if self.options.get_safe('single_amalgamation'): - build_flags.append('--single-amalgamation-file') - if self.options.system_cert_bundle: build_flags.append('--system-cert-bundle={}'.format(self.options.system_cert_bundle)) + if self.conf.get("tools.build:sysroot"): + build_flags.append(f'--with-sysroot-dir={self.conf.get("tools.build:sysroot")}') + if self.options.with_bzip2: build_flags.append('--with-bzip2') build_flags.extend(self._dependency_build_flags('bzip2')) - if self.options.with_openssl: + if self.options.get_safe('with_openssl', False): build_flags.append('--with-openssl') build_flags.extend(self._dependency_build_flags('openssl')) @@ -375,11 +455,17 @@ def _configure_cmd(self): if is_msvc(self): build_flags.append(f"--msvc-runtime={msvc_runtime_flag(self)}") + if self._is_glibc_older_than_2_25_on_linux and Version(self.version) >= '3.0': + # INFO: Botan 3.0+ requires glibc >= 2.25. Disable features to make it backward compatible + # FIXME: CCI Docker images are running Ubuntu 16.04. Remove it after supporting later version. + self.output.warning("Disabling usage of getentropy(), getrandom(), and explicit_bzero() due to old glibc version") + build_flags.append('--without-os-features=getentropy,getrandom,explicit_bzero') + build_flags.append('--without-pkg-config') call_python = 'python' if self.settings.os == 'Windows' else '' - prefix = tools.unix_path(self.package_folder) if self._is_mingw_windows else self.package_folder + prefix = unix_path(self, self.package_folder) if self._is_mingw_windows else self.package_folder botan_abi = ' '.join(botan_abi_flags) if botan_abi_flags else ' ' botan_cxx_extras = ' '.join(botan_extra_cxx_flags) if botan_extra_cxx_flags else ' ' @@ -392,7 +478,7 @@ def _configure_cmd(self): ' --extra-cxxflags="{cxxflags}"' ' --cc={compiler}' ' --cpu={cpu}' - ' --prefix={prefix}' + ' --prefix="{prefix}"' ' --os={os}' ' {build_flags}').format( python_call=call_python, @@ -413,27 +499,23 @@ def _make_cmd(self): @property def _make_program(self): - return tools.get_env('CONAN_MAKE_PROGRAM', tools.which('make') or tools.which('mingw32-make')) + return self.conf.get("tools.gnu:make_program", os.getenv('CONAN_MAKE_PROGRAM', shutil.which('make') or shutil.which('mingw32-make'))) @property def _gnumake_cmd(self): make_ldflags = 'LDFLAGS=-lc++abi' if self._is_linux_clang_libcxx else '' - make_cmd = ('{ldflags}' ' {make}' ' -j{cpucount}').format( - ldflags=make_ldflags, make=self._make_program, cpucount=tools.cpu_count()) + make_cmd = f"{make_ldflags} {self._make_program} -j{build_jobs(self)}" return make_cmd @property def _nmake_cmd(self): - vcvars = tools.vcvars_command(self.settings) - make_cmd = vcvars + ' && nmake' - return make_cmd + return 'nmake' @property def _make_install_cmd(self): if is_msvc(self): - vcvars = tools.vcvars_command(self.settings) - make_install_cmd = vcvars + ' && nmake install' + make_install_cmd = '{make} install'.format(make=self._nmake_cmd) else: make_install_cmd = '{make} install'.format(make=self._make_program) return make_install_cmd @@ -445,3 +527,21 @@ def _is_linux_clang_libcxx(self): self.settings.compiler == 'clang' and self.settings.compiler.libcxx == 'libc++' ) + + @property + def _is_glibc_older_than_2_25_on_linux(self): + # FIXME: glibc below 2.25 lacks support for certain syscalls that botan assumes + # to be present. Once CCI updated their CI images and provides a newer + # glibc, we can (and should) remove this workaround. + # + # https://github.com/conan-io/conan-center-index/pull/18079#issuecomment-1919206949 + # https://github.com/conan-io/conan-center-index/pull/18079#issuecomment-1919486839 + + if self.settings.os != 'Linux': + return False + libver = platform.libc_ver() + return ( + self.settings.os == 'Linux' and + libver[0] == 'glibc' and + Version(libver[1]) < '2.25' + ) diff --git a/recipes/botan/all/patches/backport-getrandom-via-syscall-to-3.0.0.patch b/recipes/botan/all/patches/backport-getrandom-via-syscall-to-3.0.0.patch new file mode 100644 index 0000000000000..54f8088a3d1e3 --- /dev/null +++ b/recipes/botan/all/patches/backport-getrandom-via-syscall-to-3.0.0.patch @@ -0,0 +1,24 @@ +diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp +index 8a24ed9f6..45af0c507 100644 +--- a/src/lib/rng/system_rng/system_rng.cpp ++++ b/src/lib/rng/system_rng/system_rng.cpp +@@ -25,6 +25,7 @@ + #include + #elif defined(BOTAN_TARGET_OS_HAS_GETRANDOM) + #include ++ #include + #include + #elif defined(BOTAN_TARGET_OS_HAS_DEV_RANDOM) + #include +@@ -216,7 +217,11 @@ class System_RNG_Impl final : public RandomNumberGenerator + size_t len = output.size(); + while(len > 0) + { ++#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 25 ++ const ssize_t got = ::syscall(SYS_getrandom, buf, len, flags); ++#else + const ssize_t got = ::getrandom(buf, len, flags); ++#endif + + if(got < 0) + { diff --git a/recipes/botan/all/patches/backport-getrandom-via-syscall-to-3.1.0.patch b/recipes/botan/all/patches/backport-getrandom-via-syscall-to-3.1.0.patch new file mode 100644 index 0000000000000..dd376536584eb --- /dev/null +++ b/recipes/botan/all/patches/backport-getrandom-via-syscall-to-3.1.0.patch @@ -0,0 +1,24 @@ +diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp +index b42ea5543..dcff78931 100644 +--- a/src/lib/rng/system_rng/system_rng.cpp ++++ b/src/lib/rng/system_rng/system_rng.cpp +@@ -26,6 +26,7 @@ + #elif defined(BOTAN_TARGET_OS_HAS_GETRANDOM) + #include + #include ++ #include + #elif defined(BOTAN_TARGET_OS_HAS_DEV_RANDOM) + #include + #include +@@ -211,7 +212,11 @@ class System_RNG_Impl final : public RandomNumberGenerator { + uint8_t* buf = output.data(); + size_t len = output.size(); + while(len > 0) { ++ #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 25 ++ const ssize_t got = ::syscall(SYS_getrandom, buf, len, flags); ++ #else + const ssize_t got = ::getrandom(buf, len, flags); ++ #endif + + if(got < 0) { + if(errno == EINTR) { diff --git a/recipes/botan/all/patches/dll-dir.patch b/recipes/botan/all/patches/dll-dir.patch deleted file mode 100644 index d0cda481f6695..0000000000000 --- a/recipes/botan/all/patches/dll-dir.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/scripts/install.py b/src/scripts/install.py -index 4cbce5a8e..ed6fe897f 100755 ---- a/src/scripts/install.py -+++ b/src/scripts/install.py -@@ -191,7 +191,7 @@ def main(args): - libname = cfg['libname'] - soname_base = libname + '.dll' - copy_executable(os.path.join(out_dir, soname_base), -- prepend_destdir(os.path.join(lib_dir, soname_base))) -+ prepend_destdir(os.path.join(bin_dir, soname_base))) - else: - soname_patch = cfg['soname_patch'] - soname_abi = cfg['soname_abi'] diff --git a/recipes/botan/all/patches/fix-unrecognized-linker-flag.patch b/recipes/botan/all/patches/fix-unrecognized-linker-flag.patch deleted file mode 100644 index d70cce86690b9..0000000000000 --- a/recipes/botan/all/patches/fix-unrecognized-linker-flag.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/configure.py b/configure.py -index 8b413db57..46331e78c 100755 ---- a/configure.py -+++ b/configure.py -@@ -2147,6 +2147,12 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch, - 'mod_list': sorted([m.basename for m in modules]) - } - -+ if cc.basename == 'msvc' and variables['cxx_abi_flags'] != '': -+ # MSVC linker doesn't support/need the ABI options, -+ # just transfer them over to just the compiler invocations -+ variables['cc_compile_flags'] = '%s %s' % (variables['cxx_abi_flags'], variables['cc_compile_flags']) -+ variables['cxx_abi_flags'] = '' -+ - variables['lib_flags'] = cc.gen_lib_flags(options, variables) - variables['cmake_lib_flags'] = cmake_escape(variables['lib_flags']) - diff --git a/recipes/botan/all/patches/vs2015-install-fix.patch b/recipes/botan/all/patches/vs2015-install-fix.patch deleted file mode 100644 index c53e1a6c17844..0000000000000 --- a/recipes/botan/all/patches/vs2015-install-fix.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 42317bbcc7fe715b0a9f066bb52ed3c59dcc257e Mon Sep 17 00:00:00 2001 -From: Hannes Rantzsch -Date: Tue, 1 Dec 2020 09:40:38 +0100 -Subject: [PATCH] Backport a fix for a build issue in VS 2015 - -See https://github.com/randombit/botan/pull/2526 for details ---- - configure.py | 2 +- - src/build-data/makefile.in | 10 +++++----- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/configure.py b/configure.py -index 88eeaa575..f7affad72 100755 ---- a/configure.py -+++ b/configure.py -@@ -1994,7 +1994,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch, - def choose_python_exe(): - exe = sys.executable - -- if exe[1] == ':': # Windows style paths -+ if options.os == 'mingw': # mingw doesn't handle the backslashes in the absolute path well - return exe.replace('\\', '/') - - return exe -diff --git a/src/build-data/makefile.in b/src/build-data/makefile.in -index 4d68ab1ec..b215bebb5 100644 ---- a/src/build-data/makefile.in -+++ b/src/build-data/makefile.in -@@ -48,19 +48,19 @@ docs: %{doc_stamp_file} - %{endif} - - %{doc_stamp_file}: %{doc_dir}/*.rst %{doc_dir}/api_ref/*.rst %{doc_dir}/dev_ref/*.rst -- $(PYTHON_EXE) $(SCRIPTS_DIR)/build_docs.py --build-dir="%{build_dir}" -+ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/build_docs.py" --build-dir="%{build_dir}" - - clean: -- $(PYTHON_EXE) $(SCRIPTS_DIR)/cleanup.py --build-dir="%{build_dir}" -+ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/cleanup.py" --build-dir="%{build_dir}" - - distclean: -- $(PYTHON_EXE) $(SCRIPTS_DIR)/cleanup.py --build-dir="%{build_dir}" --distclean -+ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/cleanup.py" --build-dir="%{build_dir}" --distclean - - install: %{install_targets} -- $(PYTHON_EXE) $(SCRIPTS_DIR)/install.py --prefix="%{prefix}" --build-dir="%{build_dir}" --bindir=%{bindir} --libdir=%{libdir} --docdir=%{docdir} --includedir=%{includedir} -+ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/install.py" --prefix="%{prefix}" --build-dir="%{build_dir}" --bindir="%{bindir}" --libdir="%{libdir}" --docdir="%{docdir}" --includedir="%{includedir}" - - check: tests -- $(PYTHON_EXE) $(SCRIPTS_DIR)/check.py --build-dir="%{build_dir}" -+ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/check.py" --build-dir="%{build_dir}" - - # Object Files - LIBOBJS = %{join lib_objs} --- -2.29.2 - diff --git a/recipes/botan/all/test_package/CMakeLists.txt b/recipes/botan/all/test_package/CMakeLists.txt index 5021b4e27691a..65e374a2711cc 100644 --- a/recipes/botan/all/test_package/CMakeLists.txt +++ b/recipes/botan/all/test_package/CMakeLists.txt @@ -1,11 +1,13 @@ -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(botan REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} botan::botan) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +if(botan_VERSION_STRING VERSION_LESS "3.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +endif() diff --git a/recipes/botan/all/test_package/conanfile.py b/recipes/botan/all/test_package/conanfile.py index f4b0754b85efb..82bdc745af784 100644 --- a/recipes/botan/all/test_package/conanfile.py +++ b/recipes/botan/all/test_package/conanfile.py @@ -1,10 +1,25 @@ -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 +from conan.tools.microsoft import is_msvc, VCVars 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 generate(self): + if is_msvc(self): + ms = VCVars(self) + ms.generate() def build(self): cmake = CMake(self) @@ -12,6 +27,6 @@ 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") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.build_folder, self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/botan/config.yml b/recipes/botan/config.yml index 7fdc77ee53c3b..5fc1a89cc5cd4 100644 --- a/recipes/botan/config.yml +++ b/recipes/botan/config.yml @@ -1,31 +1,11 @@ versions: - "2.12.1": + "3.6.1": folder: all - "2.13.0": + "3.5.0": folder: all - "2.14.0": + "3.4.0": folder: all - "2.15.0": + "3.3.0": folder: all - "2.16.0": - folder: all - "2.17.0": - folder: all - "2.17.1": - folder: all - "2.17.2": - folder: all - "2.17.3": - folder: all - "2.18.0": - folder: all - "2.18.1": - folder: all - "2.18.2": - folder: all - "2.19.1": - folder: all - "2.19.2": - folder: all - "2.19.3": + "2.19.5": folder: all diff --git a/recipes/box2d/2.4.x/conandata.yml b/recipes/box2d/2.4.x/conandata.yml deleted file mode 100644 index c7372e2a8f037..0000000000000 --- a/recipes/box2d/2.4.x/conandata.yml +++ /dev/null @@ -1,10 +0,0 @@ -sources: - "2.4.0": - url: "https://github.com/erincatto/Box2D/archive/v2.4.0.zip" - sha256: "6aebbc54c93e367c97e382a57ba12546731dcde51526964c2ab97dec2050f8b9" - "2.4.1": - url: "https://github.com/erincatto/box2d/archive/refs/tags/v2.4.1.tar.gz" - sha256: "d6b4650ff897ee1ead27cf77a5933ea197cbeef6705638dd181adc2e816b23c2" -patches: - "2.4.0": - - patch_file: "patches/0001-install-and-allow-shared.patch" diff --git a/recipes/box2d/2.4.x/conanfile.py b/recipes/box2d/2.4.x/conanfile.py deleted file mode 100644 index ae09ce435deda..0000000000000 --- a/recipes/box2d/2.4.x/conanfile.py +++ /dev/null @@ -1,71 +0,0 @@ -import os -from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rm, rmdir, copy -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.scm import Version - -required_conan_version = ">=1.52.0" - - -class Box2dConan(ConanFile): - name = "box2d" - license = "Zlib" - description = "Box2D is a 2D physics engine for games" - homepage = "http://box2d.org/" - url = "https://github.com/conan-io/conan-center-index" - topics = ("physics-engine", "graphic", "2d", "collision") - 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": - try: - del self.options.fPIC - except Exception: - pass - - def configure(self): - if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - - 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) - - def generate(self): - tc = CMakeToolchain(self) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" - tc.variables["BOX2D_BUILD_TESTBED"] = False - tc.variables["BOX2D_BUILD_UNIT_TESTS"] = False - tc.generate() - - def build(self): - apply_conandata_patches(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.configure() - cmake.install() - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - rm(self, "*.pdb", self.package_folder, recursive=True) - - def package_info(self): - self.cpp_info.names["cmake_find_package"] = "box2d" - self.cpp_info.names["cmake_find_package_multi"] = "box2d" - self.cpp_info.libs = ["box2d"] - if Version(self.version) >= "2.4.1" and self.options.shared: - self.cpp_info.defines.append("B2_SHARED") diff --git a/recipes/box2d/2.4.x/test_package/CMakeLists.txt b/recipes/box2d/2.4.x/test_package/CMakeLists.txt deleted file mode 100644 index fb4d8d7f5888a..0000000000000 --- a/recipes/box2d/2.4.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -find_package(box2d REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} box2d::box2d) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/box2d/2.4.x/test_package/conanfile.py b/recipes/box2d/2.4.x/test_package/conanfile.py deleted file mode 100644 index d1ce1a2cbc477..0000000000000 --- a/recipes/box2d/2.4.x/test_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -import os -from conan import ConanFile -from conan.tools.build import can_run -from conan.tools.cmake import CMake, cmake_layout - - -class Box2DTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - 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/box2d/2.4.x/test_package/test_package.cpp b/recipes/box2d/2.4.x/test_package/test_package.cpp deleted file mode 100644 index 7dfa813bc1d2e..0000000000000 --- a/recipes/box2d/2.4.x/test_package/test_package.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include "box2d/box2d.h" - -int main(void) { - b2Vec2 gravity(0.0f, -10.0f); - b2World world(gravity); - - b2BodyDef groundBodyDef; - groundBodyDef.position.Set(0.0f, -10.0f); - - b2Body* groundBody = world.CreateBody(&groundBodyDef); - b2PolygonShape groundBox; - groundBox.SetAsBox(50.0f, 10.0f); - - return 0; -} diff --git a/recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt b/recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 373fb5bb61846..0000000000000 --- a/recipes/box2d/2.4.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(box2d REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} box2d::box2d) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/box2d/2.4.x/test_v1_package/conanfile.py b/recipes/box2d/2.4.x/test_v1_package/conanfile.py deleted file mode 100644 index 7513484720425..0000000000000 --- a/recipes/box2d/2.4.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -class Box2DTestConan(ConanFile): - settings = "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/box2d/2.4.x/test_v1_package/test_package.cpp b/recipes/box2d/2.4.x/test_v1_package/test_package.cpp deleted file mode 100644 index 7dfa813bc1d2e..0000000000000 --- a/recipes/box2d/2.4.x/test_v1_package/test_package.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include "box2d/box2d.h" - -int main(void) { - b2Vec2 gravity(0.0f, -10.0f); - b2World world(gravity); - - b2BodyDef groundBodyDef; - groundBodyDef.position.Set(0.0f, -10.0f); - - b2Body* groundBody = world.CreateBody(&groundBodyDef); - b2PolygonShape groundBox; - groundBox.SetAsBox(50.0f, 10.0f); - - return 0; -} diff --git a/recipes/box2d/all/conandata.yml b/recipes/box2d/all/conandata.yml index 857c8f5d17268..d29e61fd2e0e5 100644 --- a/recipes/box2d/all/conandata.yml +++ b/recipes/box2d/all/conandata.yml @@ -1,4 +1,28 @@ sources: - "2.3.1": - url: "https://github.com/erincatto/Box2D/archive/v2.3.1.zip" - sha256: "8ddd947400c59bcf09774bd75787e6253098a0bd337f5c61dae38b91aea678cf" + "3.0.0": + url: "https://github.com/erincatto/box2d/archive/refs/tags/v3.0.0.tar.gz" + sha256: "64ad759006cd2377c99367f51fb36942b57f0e9ad690ed41548dd620e6f6c8b1" + "2.4.2": + url: "https://github.com/erincatto/box2d/archive/refs/tags/v2.4.2.tar.gz" + sha256: "85b9b104d256c985e6e244b4227d447897fac429071cc114e5cc819dae848852" + "2.4.1": + url: "https://github.com/erincatto/box2d/archive/refs/tags/v2.4.1.tar.gz" + sha256: "d6b4650ff897ee1ead27cf77a5933ea197cbeef6705638dd181adc2e816b23c2" + "2.4.0": + url: "https://github.com/erincatto/Box2D/archive/v2.4.0.zip" + sha256: "6aebbc54c93e367c97e382a57ba12546731dcde51526964c2ab97dec2050f8b9" +patches: + "3.0.0": + - patch_file: "patches/3.0.0-0001-fix-cmake.patch" + patch_description: "fix installer" + patch_type: "conan" + - patch_file: "patches/3.0.0-0002-use-cci.patch" + patch_description: "use cci package" + patch_type: "conan" + - patch_file: "patches/3.0.0-0003-remove-compile-warnings-as-error.patch" + patch_description: "remove warnings as errors" + patch_type: "conan" + "2.4.0": + - patch_file: "patches/0001-install-and-allow-shared.patch" + patch_description: "add install, allow shared build" + patch_type: "conan" diff --git a/recipes/box2d/all/conanfile.py b/recipes/box2d/all/conanfile.py index e5adde1f2b06a..085cd30b96269 100644 --- a/recipes/box2d/all/conanfile.py +++ b/recipes/box2d/all/conanfile.py @@ -1,68 +1,117 @@ import os -from conan import ConanFile, tools -from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rm, rmdir, copy +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.53.0" class Box2dConan(ConanFile): name = "box2d" - license = "Zlib" description = "Box2D is a 2D physics engine for games" - topics = ("physics", "engine", "game development") - homepage = "http://box2d.org/" + license = "Zlib" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], - "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True,} + homepage = "http://box2d.org/" + topics = ("physics-engine", "graphic", "2d", "collision") + 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_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "8", + "msvc": "193", + "Visual Studio": "17", + } + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") + if Version(self.version) >= "3.0.0": + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): - cmake_layout(self, src_folder="Box2D") + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) >= "3.0.0": + self.requires("simde/0.8.2") + + def validate(self): + if Version(self.version) < "3.0.0": + return + + 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 C17, which your compiler does not support." + ) + + def build_requirements(self): + if Version(self.version) >= "3.0.0": + self.tool_requires("cmake/[>=3.22 <4]") def source(self): - 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 generate(self): tc = CMakeToolchain(self) - tc.variables["BOX2D_BUILD_SHARED"] = self.options.shared - tc.variables["BOX2D_BUILD_STATIC"] = not self.options.shared - if self.settings.os == "Windows" and self.options.shared: - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True - tc.variables["BOX2D_BUILD_EXAMPLES"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.cache_variables["CMAKE_COMPILE_WARNING_AS_ERROR"] = False + if Version(self.version) < "3.0.0": + tc.variables["BOX2D_BUILD_TESTBED"] = False + tc.variables["BOX2D_BUILD_UNIT_TESTS"] = False + else: + tc.variables["BOX2D_SAMPLES"] = False + tc.variables["BOX2D_VALIDATE"] = False + tc.variables["BOX2D_UNIT_TESTS"] = False tc.generate() + if Version(self.version) >= "3.0.0": + deps = CMakeDeps(self) + deps.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) - cmake.configure(build_script_folder="Box2D") + cmake.configure() cmake.build() def package(self): - tools.files.copy(self, "License.txt", src=os.path.join(self.source_folder, "Box2D"), dst=os.path.join(self.package_folder,"licenses")) - tools.files.copy(self, os.path.join("Box2D", "*.h"), src=os.path.join(self.source_folder, "Box2D"), dst=os.path.join(self.package_folder, "include")) - tools.files.copy(self, "*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) - tools.files.copy(self, "*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) - tools.files.copy(self, "*.so*", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) - tools.files.copy(self, "*.dylib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) - tools.files.copy(self, "*.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "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", "cmake")) + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): - self.cpp_info.libs = ["Box2D"] - if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.system_libs = ["m"] + self.cpp_info.names["cmake_find_package"] = "box2d" + self.cpp_info.names["cmake_find_package_multi"] = "box2d" + self.cpp_info.libs = ["box2d"] + if Version(self.version) >= "3.0.0" and is_msvc(self) and self.options.shared: + self.cpp_info.defines.append("BOX2D_DLL") + elif Version(self.version) >= "2.4.1" and self.options.shared: + self.cpp_info.defines.append("B2_SHARED") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/box2d/2.4.x/patches/0001-install-and-allow-shared.patch b/recipes/box2d/all/patches/0001-install-and-allow-shared.patch similarity index 100% rename from recipes/box2d/2.4.x/patches/0001-install-and-allow-shared.patch rename to recipes/box2d/all/patches/0001-install-and-allow-shared.patch diff --git a/recipes/box2d/all/patches/3.0.0-0001-fix-cmake.patch b/recipes/box2d/all/patches/3.0.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..156dff0943ae2 --- /dev/null +++ b/recipes/box2d/all/patches/3.0.0-0001-fix-cmake.patch @@ -0,0 +1,17 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5078d14..7ec17bc 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -180,4 +180,11 @@ endif() + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "src" FILES ${BOX2D_SOURCE_FILES}) + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/../include" PREFIX "include" FILES ${BOX2D_API_FILES}) + +-install(TARGETS box2d) ++include(GNUInstallDirs) ++ ++install(TARGETS box2d ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++install(FILES ${BOX2D_API_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/box2d) diff --git a/recipes/box2d/all/patches/3.0.0-0002-use-cci.patch b/recipes/box2d/all/patches/3.0.0-0002-use-cci.patch new file mode 100644 index 0000000000000..b9d850f931bb8 --- /dev/null +++ b/recipes/box2d/all/patches/3.0.0-0002-use-cci.patch @@ -0,0 +1,76 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8c1390e..d6590d7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,7 +53,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) + set(CMAKE_VERBOSE_MAKEFILE ON) + + # The Box2D library uses simde https://github.com/simd-everywhere/simde +-add_subdirectory(extern/simde) ++# add_subdirectory(extern/simde) + add_subdirectory(src) + + # This hides samples, test, and doxygen from apps that use box2d via FetchContent +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5078d14..7ec17bc 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -78,7 +78,7 @@ add_library(box2d ${BOX2D_SOURCE_FILES} ${BOX2D_API_FILES}) + # turned this off to make Box2D easier to use without cmake + # include(GenerateExportHeader) + # generate_export_header(box2d) +- ++find_package(simde REQUIRED CONFIG) + target_include_directories(box2d + PUBLIC + $ +@@ -89,7 +89,7 @@ target_include_directories(box2d + ) + + # SIMDE is used to support SIMD math on multiple platforms +-target_link_libraries(box2d PRIVATE simde) ++target_link_libraries(box2d PRIVATE simde::simde) + + # Box2D uses C17 + set_target_properties(box2d PROPERTIES +diff --git a/src/contact_solver.c b/src/contact_solver.c +index b190501..c61e250 100644 +--- a/src/contact_solver.c ++++ b/src/contact_solver.c +@@ -9,8 +9,8 @@ + #include "core.h" + #include "solver_set.h" + #include "world.h" +-#include "x86/avx2.h" +-#include "x86/fma.h" ++#include "simde/x86/avx2.h" ++#include "simde/x86/fma.h" + + // Soft contact constraints with sub-stepping support + // http://mmacklin.com/smallsteps.pdf +diff --git a/src/contact_solver.h b/src/contact_solver.h +index e265e93..dcdc1fb 100644 +--- a/src/contact_solver.h ++++ b/src/contact_solver.h +@@ -4,7 +4,7 @@ + #pragma once + + #include "solver.h" +-#include "x86/avx.h" ++#include "simde/x86/avx.h" + + typedef struct b2ContactSim b2ContactSim; + +diff --git a/src/solver.c b/src/solver.c +index d83a471..a115417 100644 +--- a/src/solver.c ++++ b/src/solver.c +@@ -17,7 +17,7 @@ + #include "world.h" + + // for mm_pause +-#include "x86/sse2.h" ++#include "simde/x86/sse2.h" + + #include + #include diff --git a/recipes/box2d/all/patches/3.0.0-0003-remove-compile-warnings-as-error.patch b/recipes/box2d/all/patches/3.0.0-0003-remove-compile-warnings-as-error.patch new file mode 100644 index 0000000000000..7492d23b4527a --- /dev/null +++ b/recipes/box2d/all/patches/3.0.0-0003-remove-compile-warnings-as-error.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d6590d7..2323e7c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,7 +46,6 @@ endif() + + # C++17 needed for imgui + set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_COMPILE_WARNING_AS_ERROR ON) + + # set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/recipes/box2d/all/test_package/CMakeLists.txt b/recipes/box2d/all/test_package/CMakeLists.txt index 22c1118333f4f..4648d77c658ec 100644 --- a/recipes/box2d/all/test_package/CMakeLists.txt +++ b/recipes/box2d/all/test_package/CMakeLists.txt @@ -1,7 +1,13 @@ -cmake_minimum_required(VERSION 3.4) -project(test_package) +cmake_minimum_required(VERSION 3.21) +project(test_package LANGUAGES C CXX) -find_package(box2d) +find_package(box2d REQUIRED CONFIG) -add_executable(test_package test_package.cpp) -target_link_libraries(test_package box2d::box2d) +if(box2d_VERSION VERSION_LESS "3.0.0") + add_executable(${PROJECT_NAME} test_package.cpp) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + add_executable(${PROJECT_NAME} test_package3.c) + target_compile_features(${PROJECT_NAME} PRIVATE c_std_17) +endif() +target_link_libraries(${PROJECT_NAME} PRIVATE box2d::box2d) diff --git a/recipes/box2d/all/test_package/conanfile.py b/recipes/box2d/all/test_package/conanfile.py index a3a0294a68898..3526395bd33d5 100644 --- a/recipes/box2d/all/test_package/conanfile.py +++ b/recipes/box2d/all/test_package/conanfile.py @@ -1,11 +1,13 @@ import os -from conan import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout - +from conan.tools.scm import Version class Box2DTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" def layout(self): cmake_layout(self) @@ -13,12 +15,15 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + def build_requirements(self): + self.tool_requires("cmake/[>=3.21 <4]") + def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not tools.build.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/box2d/all/test_package/test_package.cpp b/recipes/box2d/all/test_package/test_package.cpp index 045f0bf063169..31112b0dcea5a 100644 --- a/recipes/box2d/all/test_package/test_package.cpp +++ b/recipes/box2d/all/test_package/test_package.cpp @@ -1,88 +1,15 @@ -#include -#include +#include "box2d/box2d.h" -#include - -// This is a simple example of building and running a simulation -// using Box2D. Here we create a large ground box and a small dynamic -// box. -// There are no graphics for this example. Box2D is meant to be used -// with your rendering engine in your game engine. -int main(int argc, char **argv) -{ - B2_NOT_USED(argc); - B2_NOT_USED(argv); - - // Define the gravity vector. +int main(void) { b2Vec2 gravity(0.0f, -10.0f); - - // Construct a world object, which will hold and simulate the rigid bodies. b2World world(gravity); - // Define the ground body. b2BodyDef groundBodyDef; groundBodyDef.position.Set(0.0f, -10.0f); - // Call the body factory which allocates memory for the ground body - // from a pool and creates the ground box shape (also from a pool). - // The body is also added to the world. - b2Body *groundBody = world.CreateBody(&groundBodyDef); - - // Define the ground box shape. + b2Body* groundBody = world.CreateBody(&groundBodyDef); b2PolygonShape groundBox; - - // The extents are the half-widths of the box. groundBox.SetAsBox(50.0f, 10.0f); - // Add the ground fixture to the ground body. - groundBody->CreateFixture(&groundBox, 0.0f); - - // Define the dynamic body. We set its position and call the body factory. - b2BodyDef bodyDef; - bodyDef.type = b2_dynamicBody; - bodyDef.position.Set(0.0f, 4.0f); - b2Body *body = world.CreateBody(&bodyDef); - - // Define another box shape for our dynamic body. - b2PolygonShape dynamicBox; - dynamicBox.SetAsBox(1.0f, 1.0f); - - // Define the dynamic body fixture. - b2FixtureDef fixtureDef; - fixtureDef.shape = &dynamicBox; - - // Set the box density to be non-zero, so it will be dynamic. - fixtureDef.density = 1.0f; - - // Override the default friction. - fixtureDef.friction = 0.3f; - - // Add the shape to the body. - body->CreateFixture(&fixtureDef); - - // Prepare for simulation. Typically we use a time step of 1/60 of a - // second (60Hz) and 10 iterations. This provides a high quality simulation - // in most game scenarios. - float32 timeStep = 1.0f / 60.0f; - int32 velocityIterations = 6; - int32 positionIterations = 2; - - // This is our little game loop. - for (int32 i = 0; i < 60; ++i) - { - // Instruct the world to perform a single step of simulation. - // It is generally best to keep the time step and iterations fixed. - world.Step(timeStep, velocityIterations, positionIterations); - - // Now print the position and angle of the body. - b2Vec2 position = body->GetPosition(); - float32 angle = body->GetAngle(); - - printf("%4.2f %4.2f %4.2f\n", position.x, position.y, angle); - } - - // When the world destructor is called, all bodies and joints are freed. This can - // create orphaned pointers, so be careful about your world management. - return 0; } diff --git a/recipes/box2d/all/test_package/test_package3.c b/recipes/box2d/all/test_package/test_package3.c new file mode 100644 index 0000000000000..abad79d1a39be --- /dev/null +++ b/recipes/box2d/all/test_package/test_package3.c @@ -0,0 +1,13 @@ +#include "box2d/box2d.h" + +int main() { + b2WorldDef worldDef = b2DefaultWorldDef(); + + worldDef.gravity = (b2Vec2){0.0f, -10.0f}; + b2WorldId worldId = b2CreateWorld(&worldDef); + + b2BodyDef groundBodyDef = b2DefaultBodyDef(); + groundBodyDef.position = (b2Vec2){0.0f, -10.0f}; + + return 0; +} diff --git a/recipes/box2d/all/test_v1_package/CMakeLists.txt b/recipes/box2d/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 458981ad5eb24..0000000000000 --- a/recipes/box2d/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(test_package ../test_package/test_package.cpp) -target_link_libraries(test_package ${CONAN_LIBS}) diff --git a/recipes/box2d/all/test_v1_package/conanfile.py b/recipes/box2d/all/test_v1_package/conanfile.py deleted file mode 100644 index 133228fb54665..0000000000000 --- a/recipes/box2d/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -class Box2DTestConan(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/box2d/config.yml b/recipes/box2d/config.yml index 1922ed59d887d..476a7f5aa4a7c 100644 --- a/recipes/box2d/config.yml +++ b/recipes/box2d/config.yml @@ -1,7 +1,9 @@ versions: - "2.3.1": + "3.0.0": + folder: "all" + "2.4.2": folder: "all" - "2.4.0": - folder: "2.4.x" "2.4.1": - folder: "2.4.x" + folder: "all" + "2.4.0": + folder: "all" diff --git a/recipes/breakpad/all/conandata.yml b/recipes/breakpad/all/conandata.yml index da051fdc78d51..6793f8f71cb91 100644 --- a/recipes/breakpad/all/conandata.yml +++ b/recipes/breakpad/all/conandata.yml @@ -7,3 +7,5 @@ patches: - patch_file: "patches/0001-Use_conans_lss.patch" - patch_file: "patches/0002-Remove-hardcoded-fpic.patch" - patch_file: "patches/0003-Fix-gcc11-compilation.patch" + - patch_file: "patches/0004-Fix-gcc13-compilation.patch" + - patch_file: "patches/0005-Apply-upstream-fixes.patch" diff --git a/recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch b/recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch new file mode 100644 index 0000000000000..01bc339d5581d --- /dev/null +++ b/recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch @@ -0,0 +1,10 @@ +--- a/src/client/linux/handler/minidump_descriptor.h ++++ b/src/client/linux/handler/minidump_descriptor.h +@@ -30,6 +30,7 @@ + #ifndef CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_ + #define CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_ + ++#include + #include + #include + diff --git a/recipes/breakpad/all/patches/0005-Apply-upstream-fixes.patch b/recipes/breakpad/all/patches/0005-Apply-upstream-fixes.patch new file mode 100644 index 0000000000000..631bde13234de --- /dev/null +++ b/recipes/breakpad/all/patches/0005-Apply-upstream-fixes.patch @@ -0,0 +1,24 @@ +--- a/src/processor/exploitability_linux.cc ++++ b/src/processor/exploitability_linux.cc +@@ -516,18 +516,17 @@ + raw_bytes_tmpfile); + FILE* objdump_fp = popen(cmd, "r"); + if (!objdump_fp) { +- fclose(objdump_fp); + unlink(raw_bytes_tmpfile); + BPLOG(ERROR) << "Failed to call objdump."; + return false; + } +- if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) <= 0) { +- fclose(objdump_fp); ++ if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) != buffer_len) { ++ pclose(objdump_fp); + unlink(raw_bytes_tmpfile); + BPLOG(ERROR) << "Failed to read objdump output."; + return false; + } +- fclose(objdump_fp); ++ pclose(objdump_fp); + unlink(raw_bytes_tmpfile); + return true; + } diff --git a/recipes/breakpad/all/test_package/CMakeLists.txt b/recipes/breakpad/all/test_package/CMakeLists.txt index 65d0c4df5bef2..c89f55e200d01 100644 --- a/recipes/breakpad/all/test_package/CMakeLists.txt +++ b/recipes/breakpad/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(breakpad REQUIRED CONFIG) diff --git a/recipes/breakpad/all/test_v1_package/CMakeLists.txt b/recipes/breakpad/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/breakpad/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/breakpad/all/test_v1_package/conanfile.py b/recipes/breakpad/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/breakpad/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_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/bredis/all/conandata.yml b/recipes/bredis/all/conandata.yml new file mode 100644 index 0000000000000..b75947b37ddc5 --- /dev/null +++ b/recipes/bredis/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.12": + url: "https://github.com/basiliscos/cpp-bredis/archive/refs/tags/v0.12.tar.gz" + sha256: "c5a6aa58835d5ef8cd97c4ae7e677f6237ef4ee01ae4a609293e2351c01db6cc" diff --git a/recipes/bredis/all/conanfile.py b/recipes/bredis/all/conanfile.py new file mode 100644 index 0000000000000..c73f99338488a --- /dev/null +++ b/recipes/bredis/all/conanfile.py @@ -0,0 +1,57 @@ +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 BredisConan(ConanFile): + name = "bredis" + description = "Boost::ASIO low-level redis client (connector)" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/basiliscos/cpp-bredis" + topics = ("redis", "network", "asio", "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.85.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) + + 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"), + ) + 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/bredis/all/test_package/CMakeLists.txt b/recipes/bredis/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ede594d5b149f --- /dev/null +++ b/recipes/bredis/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(bredis REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bredis::bredis) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/bredis/all/test_package/conanfile.py b/recipes/bredis/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/bredis/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/bredis/all/test_package/test_package.cpp b/recipes/bredis/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9a85a98f4bd7f --- /dev/null +++ b/recipes/bredis/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +#include "bredis/Connection.hpp" +#include "bredis/MarkerHelpers.hpp" + +int main(int argc, const char **argv) { + // Basic test avoiding any kind of access to network layer + bredis::bredis_category category; + std::cout << category.name() << '\n'; + return 0; +} diff --git a/recipes/bredis/config.yml b/recipes/bredis/config.yml new file mode 100644 index 0000000000000..f30ab3fc58bb9 --- /dev/null +++ b/recipes/bredis/config.yml @@ -0,0 +1,3 @@ +versions: + "0.12": + folder: all diff --git a/recipes/brigand/all/test_package/CMakeLists.txt b/recipes/brigand/all/test_package/CMakeLists.txt index edca2f720d504..77972531d0275 100644 --- a/recipes/brigand/all/test_package/CMakeLists.txt +++ b/recipes/brigand/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(brigand REQUIRED CONFIG) diff --git a/recipes/brigand/all/test_v1_package/CMakeLists.txt b/recipes/brigand/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c08f269548f6a..0000000000000 --- a/recipes/brigand/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(brigand REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE brigand::brigand) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/brigand/all/test_v1_package/conanfile.py b/recipes/brigand/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/brigand/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_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/brotli/all/conandata.yml b/recipes/brotli/all/conandata.yml index 35c9587456f43..ca204d5238bef 100644 --- a/recipes/brotli/all/conandata.yml +++ b/recipes/brotli/all/conandata.yml @@ -5,9 +5,6 @@ sources: "1.0.9": 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" patches: "1.1.0": - patch_file: "patches/1.1.0-target-props.patch" @@ -17,7 +14,3 @@ patches: - 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/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 47e559afcc649..29ecdd2daf05c 100644 --- a/recipes/brotli/all/conanfile.py +++ b/recipes/brotli/all/conanfile.py @@ -10,7 +10,7 @@ class BrotliConan(ConanFile): name = "brotli" description = "Brotli compression format" - license = "MIT", + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/brotli" topics = ("brotli", "compression") @@ -81,6 +81,7 @@ def generate(self): if Version(self.version) < "1.1.0": # To install relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -96,34 +97,23 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - includedir = os.path.join("include", "brotli") + # brotlicommon self.cpp_info.components["brotlicommon"].set_property("pkg_config_name", "libbrotlicommon") - self.cpp_info.components["brotlicommon"].includedirs.append(includedir) self.cpp_info.components["brotlicommon"].libs = [self._get_decorated_lib("brotlicommon")] if self.settings.os == "Windows" and self.options.shared: self.cpp_info.components["brotlicommon"].defines.append("BROTLI_SHARED_COMPILATION") # brotlidec self.cpp_info.components["brotlidec"].set_property("pkg_config_name", "libbrotlidec") - self.cpp_info.components["brotlidec"].includedirs.append(includedir) self.cpp_info.components["brotlidec"].libs = [self._get_decorated_lib("brotlidec")] self.cpp_info.components["brotlidec"].requires = ["brotlicommon"] # brotlienc self.cpp_info.components["brotlienc"].set_property("pkg_config_name", "libbrotlienc") - self.cpp_info.components["brotlienc"].includedirs.append(includedir) self.cpp_info.components["brotlienc"].libs = [self._get_decorated_lib("brotlienc")] self.cpp_info.components["brotlienc"].requires = ["brotlicommon"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["brotlienc"].system_libs = ["m"] - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed. - # do not set this target in CMakeDeps, it was a mistake, there is no official brotil config file, nor Find module file - self.cpp_info.names["cmake_find_package"] = "Brotli" - self.cpp_info.names["cmake_find_package_multi"] = "Brotli" - self.cpp_info.components["brotlicommon"].names["pkg_config"] = "libbrotlicommon" - self.cpp_info.components["brotlidec"].names["pkg_config"] = "libbrotlidec" - self.cpp_info.components["brotlienc"].names["pkg_config"] = "libbrotlienc" - def _get_decorated_lib(self, name): libname = name if Version(self.version) < "1.1.0" and not self.options.shared: diff --git a/recipes/brotli/all/test_package/CMakeLists.txt b/recipes/brotli/all/test_package/CMakeLists.txt index 00f09fcd40122..e8d64d15a6f82 100644 --- a/recipes/brotli/all/test_package/CMakeLists.txt +++ b/recipes/brotli/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(brotli REQUIRED CONFIG) diff --git a/recipes/brotli/all/test_v1_package/CMakeLists.txt b/recipes/brotli/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c67747eec972a..0000000000000 --- a/recipes/brotli/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Brotli REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE Brotli::Brotli) diff --git a/recipes/brotli/all/test_v1_package/conanfile.py b/recipes/brotli/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/brotli/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_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/brotli/config.yml b/recipes/brotli/config.yml index f4b59633d9f83..fb52cb4435669 100644 --- a/recipes/brotli/config.yml +++ b/recipes/brotli/config.yml @@ -3,5 +3,3 @@ versions: folder: all "1.0.9": folder: all - "1.0.7": - folder: all diff --git a/recipes/brynet/all/test_package/CMakeLists.txt b/recipes/brynet/all/test_package/CMakeLists.txt index a89c4946c1650..4ba225b2f821c 100644 --- a/recipes/brynet/all/test_package/CMakeLists.txt +++ b/recipes/brynet/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(brynet REQUIRED CONFIG) diff --git a/recipes/brynet/all/test_v1_package/CMakeLists.txt b/recipes/brynet/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/brynet/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/brynet/all/test_v1_package/conanfile.py b/recipes/brynet/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/brynet/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_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/bshoshany-thread-pool/all/conandata.yml b/recipes/bshoshany-thread-pool/all/conandata.yml index dee19ad62ca27..1da44176fd8f6 100644 --- a/recipes/bshoshany-thread-pool/all/conandata.yml +++ b/recipes/bshoshany-thread-pool/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "5.0.0": + sha256: "617a8fbc2c360577f498998f336777c73d581810831d4ce9c920f11ec680b07b" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v5.0.0.tar.gz" + "4.1.0": + sha256: "be7abecbc420bb87919eeef729b13ff7c29d5ce547bdae284923296c695415bd" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v4.1.0.tar.gz" + "4.0.1": + sha256: "34d25503e17e58198613d9306313f8358cfaaa9320f2b7694dc599b90a1858a7" + url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v4.0.1.tar.gz" "3.5.0": sha256: "d3efd5c434f6e99f4cff7b8219cbb586dc06bc0aeaf17cd174813a2333961306" url: "https://github.com/bshoshany/thread-pool/archive/refs/tags/v3.5.0.tar.gz" diff --git a/recipes/bshoshany-thread-pool/all/conanfile.py b/recipes/bshoshany-thread-pool/all/conanfile.py index 3da6e90d6c057..676f0aaab09a2 100644 --- a/recipes/bshoshany-thread-pool/all/conanfile.py +++ b/recipes/bshoshany-thread-pool/all/conanfile.py @@ -12,10 +12,10 @@ class BShoshanyThreadPoolConan(ConanFile): name = "bshoshany-thread-pool" - description = "BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library" + description = "BS::thread_pool: a fast, lightweight, modern, and easy-to-use C++17 / C++20 / C++23 thread pool library" homepage = "https://github.com/bshoshany/thread-pool" license = "MIT" - topics = ("concurrency", "cpp17", "header-only", "library", "multi-threading", "parallel-computing", "thread-pool", "threads") + topics = ("concurrency", "cpp17", "cpp20", "cpp23", "header-only", "library", "multi-threading", "parallel-computing", "thread-pool", "threads", "module", "modules") url = "https://github.com/conan-io/conan-center-index" package_type = "header-library" settings = "arch", "build_type", "compiler", "os" @@ -58,8 +58,11 @@ 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: + elif Version(self.version) < "5.0.0": copy(self, "*.hpp", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + else: + copy(self, "BS_thread_pool.hpp", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + copy(self, "BS.thread_pool.cppm", os.path.join(self.source_folder, "modules"), os.path.join(self.package_folder, "modules")) def package_info(self): self.cpp_info.bindirs = [] diff --git a/recipes/bshoshany-thread-pool/all/test_package/test_package.cpp b/recipes/bshoshany-thread-pool/all/test_package/test_package.cpp index bbde93d5eba55..94a1ee699375b 100644 --- a/recipes/bshoshany-thread-pool/all/test_package/test_package.cpp +++ b/recipes/bshoshany-thread-pool/all/test_package/test_package.cpp @@ -1,59 +1,18 @@ #include "BS_thread_pool.hpp" - -BS::synced_stream sync_out; -BS::thread_pool pool; - -std::condition_variable ID_cv, total_cv; -std::mutex ID_mutex, total_mutex; -BS::concurrency_t count_unique_threads() -{ - const BS::concurrency_t num_tasks = pool.get_thread_count() * 2; - std::vector thread_IDs(num_tasks); - std::unique_lock total_lock(total_mutex); - BS::concurrency_t total_count = 0; - bool ID_release = false; - pool.wait_for_tasks(); - for (std::thread::id& id : thread_IDs) - pool.push_task( - [&total_count, &id, &ID_release] - { - id = std::this_thread::get_id(); - { - const std::scoped_lock total_lock_local(total_mutex); - ++total_count; - } - total_cv.notify_one(); - std::unique_lock ID_lock_local(ID_mutex); - ID_cv.wait(ID_lock_local, [&ID_release] { return ID_release; }); - }); - total_cv.wait(total_lock, [&total_count] { return total_count == pool.get_thread_count(); }); - { - const std::scoped_lock ID_lock(ID_mutex); - ID_release = true; - } - ID_cv.notify_all(); - total_cv.wait(total_lock, [&total_count, &num_tasks] { return total_count == num_tasks; }); - pool.wait_for_tasks(); - std::sort(thread_IDs.begin(), thread_IDs.end()); - return static_cast(std::unique(thread_IDs.begin(), thread_IDs.end()) - thread_IDs.begin()); -} +#include int main() { - const char* line = "------------------------------------------"; - sync_out.println(line); - sync_out.println("Testing thread pool..."); - BS::concurrency_t unique_threads = count_unique_threads(); - if (pool.get_thread_count() == unique_threads) + BS::thread_pool pool; + std::cout << "Testing thread pool...\n"; + if (pool.get_thread_count() == std::thread::hardware_concurrency()) { - sync_out.println("SUCCESS: Created ", unique_threads, " unique threads!"); - sync_out.println(line); + std::cout << "SUCCESS: Created " << pool.get_thread_count() << " unique threads!\n"; return EXIT_SUCCESS; } else { - sync_out.println("ERROR: Failed to create ", unique_threads, " unique threads!"); - sync_out.println(line); + std::cout << "ERROR: Failed to create " << pool.get_thread_count() << " unique threads!\n"; return EXIT_FAILURE; } } diff --git a/recipes/bshoshany-thread-pool/all/test_v1_package/CMakeLists.txt b/recipes/bshoshany-thread-pool/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/bshoshany-thread-pool/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bshoshany-thread-pool/all/test_v1_package/conanfile.py b/recipes/bshoshany-thread-pool/all/test_v1_package/conanfile.py deleted file mode 100644 index 2fc6ad2a6a2ba..0000000000000 --- a/recipes/bshoshany-thread-pool/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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): - bin_path = os.path.join("bin", "test_package") - self.run("{0}".format(bin_path), run_environment=True) diff --git a/recipes/bshoshany-thread-pool/config.yml b/recipes/bshoshany-thread-pool/config.yml index cabaf98e03ae7..d8b70a63fd691 100644 --- a/recipes/bshoshany-thread-pool/config.yml +++ b/recipes/bshoshany-thread-pool/config.yml @@ -1,13 +1,19 @@ versions: - "3.5.0": - folder: all - "3.4.0": - folder: all - "3.3.0": - folder: all - "3.2.0": - folder: all - "3.1.0": - folder: all - "3.0.0": - folder: all + "5.0.0": + folder: all + "4.1.0": + folder: all + "4.0.1": + folder: all + "3.5.0": + folder: all + "3.4.0": + folder: all + "3.3.0": + folder: all + "3.2.0": + folder: all + "3.1.0": + folder: all + "3.0.0": + folder: all diff --git a/recipes/btyacc/all/test_package/CMakeLists.txt b/recipes/btyacc/all/test_package/CMakeLists.txt index d2daa6eb3e652..3db20f435899c 100644 --- a/recipes/btyacc/all/test_package/CMakeLists.txt +++ b/recipes/btyacc/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) enable_testing() diff --git a/recipes/btyacc/all/test_v1_package/CMakeLists.txt b/recipes/btyacc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c23ed5cfe6d98..0000000000000 --- a/recipes/btyacc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 1b50aeffd40ff..0000000000000 --- a/recipes/btyacc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/bullet3/all/test_package/CMakeLists.txt b/recipes/bullet3/all/test_package/CMakeLists.txt index 35fb321995112..c2f3bb01bee3e 100644 --- a/recipes/bullet3/all/test_package/CMakeLists.txt +++ b/recipes/bullet3/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(Bullet REQUIRED CONFIG) diff --git a/recipes/bullet3/all/test_v1_package/CMakeLists.txt b/recipes/bullet3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/bullet3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bullet3/all/test_v1_package/conanfile.py b/recipes/bullet3/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/bullet3/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_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/butteraugli/all/conanfile.py b/recipes/butteraugli/all/conanfile.py index 35cd9c65cf914..113630ce7e2ab 100644 --- a/recipes/butteraugli/all/conanfile.py +++ b/recipes/butteraugli/all/conanfile.py @@ -45,7 +45,7 @@ def layout(self): def requirements(self): if self.options.tool: - self.requires("libpng/1.6.39") + self.requires("libpng/[>=1.6 <2]") self.requires("libjpeg/9e") def validate(self): diff --git a/recipes/butteraugli/all/test_package/CMakeLists.txt b/recipes/butteraugli/all/test_package/CMakeLists.txt index 7f874ff8ee8e1..0dabb2113ddcb 100644 --- a/recipes/butteraugli/all/test_package/CMakeLists.txt +++ b/recipes/butteraugli/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(butteraugli REQUIRED CONFIG) diff --git a/recipes/butteraugli/all/test_v1_package/CMakeLists.txt b/recipes/butteraugli/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/butteraugli/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/butteraugli/all/test_v1_package/conanfile.py b/recipes/butteraugli/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/butteraugli/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_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/bvdberg-ctest/all/conandata.yml b/recipes/bvdberg-ctest/all/conandata.yml index c756f17b12c18..31bd2b82ba362 100644 --- a/recipes/bvdberg-ctest/all/conandata.yml +++ b/recipes/bvdberg-ctest/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/bvdberg/ctest/archive/1.1.0.tar.gz" + sha256: "6792d7a21f62ec9caa64fc5106c8c8eed9201f1d98571917d370d0b5af721f49" "1.0.0": - sha256: 80c5899f529dc57c1eb44113fe452cd90fd69cd1ab3a0431635282f56837205c - url: https://github.com/bvdberg/ctest/archive/1.0.0.tar.gz + url: "https://github.com/bvdberg/ctest/archive/1.0.0.tar.gz" + sha256: "80c5899f529dc57c1eb44113fe452cd90fd69cd1ab3a0431635282f56837205c" diff --git a/recipes/bvdberg-ctest/all/conanfile.py b/recipes/bvdberg-ctest/all/conanfile.py index 7786a8fb5c6c8..28b74d733c02a 100644 --- a/recipes/bvdberg-ctest/all/conanfile.py +++ b/recipes/bvdberg-ctest/all/conanfile.py @@ -6,14 +6,13 @@ required_conan_version = ">=1.50.0" - class BvdbergCtestConan(ConanFile): name = "bvdberg-ctest" + description = "ctest is a unit test framework for software written in C." license = "Apache-2.0" - homepage = "https://github.com/bvdberg/ctest" 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") + homepage = "https://github.com/bvdberg/ctest" + topics = ("testing", "testing-framework", "unit-testing", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -26,14 +25,11 @@ def package_id(self): def validate(self): if self.settings.os == "Windows": - raise ConanInvalidConfiguration("Windows not supported") + raise ConanInvalidConfiguration(f"{self.ref} does not support Windows.") 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, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) diff --git a/recipes/bvdberg-ctest/all/test_package/CMakeLists.txt b/recipes/bvdberg-ctest/all/test_package/CMakeLists.txt index 85fca601d8ec2..0cb2674a42fff 100644 --- a/recipes/bvdberg-ctest/all/test_package/CMakeLists.txt +++ b/recipes/bvdberg-ctest/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(bvdberg-ctest REQUIRED CONFIG) diff --git a/recipes/bvdberg-ctest/all/test_package/conanfile.py b/recipes/bvdberg-ctest/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/bvdberg-ctest/all/test_package/conanfile.py +++ b/recipes/bvdberg-ctest/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/bvdberg-ctest/all/test_v1_package/CMakeLists.txt b/recipes/bvdberg-ctest/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index fd0d83ce8ad41..0000000000000 --- a/recipes/bvdberg-ctest/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(bvdberg-ctest REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE bvdberg-ctest::bvdberg-ctest) diff --git a/recipes/bvdberg-ctest/all/test_v1_package/conanfile.py b/recipes/bvdberg-ctest/all/test_v1_package/conanfile.py deleted file mode 100644 index f2243371b7f1d..0000000000000 --- a/recipes/bvdberg-ctest/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_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") - bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/bvdberg-ctest/config.yml b/recipes/bvdberg-ctest/config.yml index c7f13630776fb..fcbfca5b9011e 100644 --- a/recipes/bvdberg-ctest/config.yml +++ b/recipes/bvdberg-ctest/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.0": + folder: "all" "1.0.0": folder: "all" diff --git a/recipes/bx/all/conanfile.py b/recipes/bx/all/conanfile.py index c1e1bfa91952f..cc80401d96abd 100644 --- a/recipes/bx/all/conanfile.py +++ b/recipes/bx/all/conanfile.py @@ -105,7 +105,7 @@ 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"} + "194": "2022", "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)]}" diff --git a/recipes/bx/all/test_package/CMakeLists.txt b/recipes/bx/all/test_package/CMakeLists.txt index 71a1766827d58..121f1700ed5da 100644 --- a/recipes/bx/all/test_package/CMakeLists.txt +++ b/recipes/bx/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) diff --git a/recipes/bx/all/test_v1_package/CMakeLists.txt b/recipes/bx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3a070c42e7447..0000000000000 --- a/recipes/bx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(bx REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF) -target_link_libraries(${PROJECT_NAME} bx::bx) diff --git a/recipes/bx/all/test_v1_package/conanfile.py b/recipes/bx/all/test_v1_package/conanfile.py deleted file mode 100644 index d2959af78862a..0000000000000 --- a/recipes/bx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class BxTestPackageConan(ConanFile): - settings = "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/bx/all/test_v1_package/test_package.cpp b/recipes/bx/all/test_v1_package/test_package.cpp deleted file mode 100644 index e62d29351461a..0000000000000 --- a/recipes/bx/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() { - float tLerp = bx::lerp(0.0f, 10.0f, 0.5f); - BX_TRACE("Lerped 0.0f to 10.0f at 0.5f, result %f", tLerp); - BX_ASSERT(bx::isEqual(tLerp, 5.0f, 0.1f), "isEqual failed"); - return 0; -} diff --git a/recipes/byte-lite/all/conanfile.py b/recipes/byte-lite/all/conanfile.py index 67d695dbd0333..b53cb06ab6fdb 100644 --- a/recipes/byte-lite/all/conanfile.py +++ b/recipes/byte-lite/all/conanfile.py @@ -14,18 +14,18 @@ class ByteLiteConan(ConanFile): C++98, C++11 and later") topics = ("cpp11", "cpp14", "cpp17", "byte", "byte-implementations") 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,19 +38,4 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "byte-lite") self.cpp_info.set_property("cmake_target_name", "nonstd::byte-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"] = "byte-lite" - self.cpp_info.filenames["cmake_find_package_multi"] = "byte-lite" - self.cpp_info.names["cmake_find_package"] = "nonstd" - self.cpp_info.names["cmake_find_package_multi"] = "nonstd" - self.cpp_info.components["bytelite"].names["cmake_find_package"] = "byte-lite" - self.cpp_info.components["bytelite"].names["cmake_find_package_multi"] = "byte-lite" - self.cpp_info.components["bytelite"].set_property("cmake_target_name", "nonstd::byte-lite") - self.cpp_info.components["bytelite"].bindirs = [] - self.cpp_info.components["bytelite"].frameworkdirs = [] - self.cpp_info.components["bytelite"].libdirs = [] - self.cpp_info.components["bytelite"].resdirs = [] diff --git a/recipes/byte-lite/all/test_package/CMakeLists.txt b/recipes/byte-lite/all/test_package/CMakeLists.txt index 2c4833803c8c9..850c4b1f611d4 100644 --- a/recipes/byte-lite/all/test_package/CMakeLists.txt +++ b/recipes/byte-lite/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(byte-lite REQUIRED CONFIG) diff --git a/recipes/byte-lite/all/test_package/test_package.cpp b/recipes/byte-lite/all/test_package/test_package.cpp index bf423f8963b2a..62a18e7db80fc 100644 --- a/recipes/byte-lite/all/test_package/test_package.cpp +++ b/recipes/byte-lite/all/test_package/test_package.cpp @@ -1,14 +1,8 @@ #include "nonstd/byte.hpp" -#include - -using namespace nonstd; +#include int main() { - byte b1 = to_byte( 0x5a ); // to_byte() is non-standard, needed for pre-C++17 - byte b2 = to_byte( 0xa5 ); - - byte r1 = b1 ^ b2; if( 0xff != to_integer( r1 ) ) throw std::exception(); // not (yet) standard, needs C++11 - byte r2 = b1 ^ b2; if( 0xff != to_integer( r2 ) ) throw std::exception(); + std::cout << "Byte lite version: " << byte_lite_VERSION << ", Test package successful\n"; } diff --git a/recipes/byte-lite/all/test_v1_package/CMakeLists.txt b/recipes/byte-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 65ad56138429f..0000000000000 --- a/recipes/byte-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(byte-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::byte-lite) diff --git a/recipes/byte-lite/all/test_v1_package/conanfile.py b/recipes/byte-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/byte-lite/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_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/bzip2/all/CMakeLists.txt b/recipes/bzip2/all/CMakeLists.txt index cce959a4a45c5..f284ce573f58d 100644 --- a/recipes/bzip2/all/CMakeLists.txt +++ b/recipes/bzip2/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(bzip2 LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/bzip2/all/conandata.yml b/recipes/bzip2/all/conandata.yml index 01ba013179e10..d2d24878a6faa 100644 --- a/recipes/bzip2/all/conandata.yml +++ b/recipes/bzip2/all/conandata.yml @@ -1,9 +1,15 @@ sources: "1.0.8": - url: "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" + url: + - "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" + - "https://mirrors.kernel.org/sourceware/bzip2/bzip2-1.0.8.tar.gz" + - "https://www.mirrorservice.org/sites/sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" sha256: "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" "1.0.6": - url: "https://sourceware.org/pub/bzip2/bzip2-1.0.6.tar.gz" + url: + - "https://sourceware.org/pub/bzip2/bzip2-1.0.6.tar.gz" + - "https://mirrors.kernel.org/sourceware/bzip2/bzip2-1.0.6.tar.gz" + - "https://www.mirrorservice.org/sites/sourceware.org/pub/bzip2/bzip2-1.0.6.tar.gz" sha256: "a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd" patches: "1.0.6": diff --git a/recipes/bzip2/all/conanfile.py b/recipes/bzip2/all/conanfile.py index 9bba05c82a828..ce77ac1450e7d 100644 --- a/recipes/bzip2/all/conanfile.py +++ b/recipes/bzip2/all/conanfile.py @@ -11,8 +11,8 @@ class Bzip2Conan(ConanFile): name = "bzip2" url = "https://github.com/conan-io/conan-center-index" - homepage = "http://www.bzip.org" - license = "bzip2-1.0.8" + homepage = "https://sourceware.org/bzip2" + license = "bzip2-1.0.6" description = "bzip2 is a free and open-source file compression program that uses the Burrows Wheeler algorithm." topics = ("data-compressor", "file-compression") package_type = "library" diff --git a/recipes/bzip2/all/test_package/CMakeLists.txt b/recipes/bzip2/all/test_package/CMakeLists.txt index 364bed2972661..69b7ef336d82f 100644 --- a/recipes/bzip2/all/test_package/CMakeLists.txt +++ b/recipes/bzip2/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(BZip2 REQUIRED) diff --git a/recipes/bzip2/all/test_v1_package/CMakeLists.txt b/recipes/bzip2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/bzip2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bzip2/all/test_v1_package/conanfile.py b/recipes/bzip2/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/bzip2/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/bzip3/all/CMakeLists.txt b/recipes/bzip3/all/CMakeLists.txt index f58db5b429ac9..904e747a12435 100644 --- a/recipes/bzip3/all/CMakeLists.txt +++ b/recipes/bzip3/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(bzip3 LANGUAGES C) option(BZIP3_WITH_THREAD "enable thread" OFF) diff --git a/recipes/bzip3/all/conandata.yml b/recipes/bzip3/all/conandata.yml index 47c1259bdc988..68d493ae40fb5 100644 --- a/recipes/bzip3/all/conandata.yml +++ b/recipes/bzip3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.1": + url: "https://github.com/kspalaiologos/bzip3/releases/download/1.5.1/bzip3-1.5.1.tar.xz" + sha256: "53b844f9d9fb1d75faa4d3a9d9026017caaf50bb200b320d1685c6506b8f3b37" "1.4.0": url: "https://github.com/kspalaiologos/bzip3/releases/download/1.4.0/bzip3-1.4.0.tar.xz" sha256: "516489784351abe027dc8b4bcad74d12937c5668d317e27de8c5cebc4d7884dc" diff --git a/recipes/bzip3/all/test_package/CMakeLists.txt b/recipes/bzip3/all/test_package/CMakeLists.txt index e47e03f4174fe..ca686f3d6010c 100644 --- a/recipes/bzip3/all/test_package/CMakeLists.txt +++ b/recipes/bzip3/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(bzip3 REQUIRED CONFIG) diff --git a/recipes/bzip3/all/test_v1_package/CMakeLists.txt b/recipes/bzip3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/bzip3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/bzip3/all/test_v1_package/conanfile.py b/recipes/bzip3/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/bzip3/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_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/bzip3/config.yml b/recipes/bzip3/config.yml index 75a3fe45d3d11..f0b9252049691 100644 --- a/recipes/bzip3/config.yml +++ b/recipes/bzip3/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.1": + folder: all "1.4.0": folder: all "1.3.2": diff --git a/recipes/c-ares/all/conandata.yml b/recipes/c-ares/all/conandata.yml index 71897bd8283d0..0f9eff8b0e74c 100644 --- a/recipes/c-ares/all/conandata.yml +++ b/recipes/c-ares/all/conandata.yml @@ -1,62 +1,38 @@ 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" - "1.19.0": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_19_0/c-ares-1.19.0.tar.gz" - sha256: "bfceba37e23fd531293829002cac0401ef49a6dc55923f7f92236585b7ad1dd3" - "1.18.1": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_18_1/c-ares-1.18.1.tar.gz" - sha256: "1a7d52a8a84a9fbffb1be9133c0f6e17217d91ea5a6fa61f6b4729cda78ebbcf" - "1.17.2": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_17_2/c-ares-1.17.2.tar.gz" - sha256: "4803c844ce20ce510ef0eb83f8ea41fa24ecaae9d280c468c582d2bb25b3913d" - "1.17.1": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_17_1/c-ares-1.17.1.tar.gz" - sha256: "d73dd0f6de824afd407ce10750ea081af47eba52b8a6cb307d220131ad93fc40" - "1.16.1": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_16_1/c-ares-1.16.1.tar.gz" - sha256: "d08312d0ecc3bd48eee0a4cc0d2137c9f194e0a28de2028928c0f6cae85f86ce" - "1.15.0": - url: "https://github.com/c-ares/c-ares/releases/download/cares-1_15_0/c-ares-1.15.0.tar.gz" - sha256: "6cdb97871f2930530c97deb7cf5c8fa4be5a0b02c7cea6e7c7667672a39d6852" - "1.14.0": - url: "https://github.com/c-ares/c-ares/files/1731591/c-ares-1.14.0.tar.gz" - sha256: "45d3c1fd29263ceec2afc8ff9cd06d5f8f889636eb4e80ce3cc7f0eaf7aadc6e" + "1.34.5": + url: "https://github.com/c-ares/c-ares/releases/download/v1.34.5/c-ares-1.34.5.tar.gz" + sha256: "7d935790e9af081c25c495fd13c2cfcda4792983418e96358ef6e7320ee06346" + "1.34.3": + url: "https://github.com/c-ares/c-ares/releases/download/v1.34.3/c-ares-1.34.3.tar.gz" + sha256: "26e1f7771da23e42a18fdf1e58912a396629e53a2ac71b130af93bbcfb90adbe" + "1.34.1": + url: "https://github.com/c-ares/c-ares/releases/download/v1.34.1/c-ares-1.34.1.tar.gz" + sha256: "7e846f1742ab5998aced36d170408557de5292b92ec404fb0f7422f946d60103" + "1.33.1": + url: "https://github.com/c-ares/c-ares/releases/download/v1.33.1/c-ares-1.33.1.tar.gz" + sha256: "06869824094745872fa26efd4c48e622b9bd82a89ef0ce693dc682a23604f415" + "1.33.0": + url: "https://github.com/c-ares/c-ares/releases/download/v1.33.0/c-ares-1.33.0.tar.gz" + sha256: "3e41df2f172041eb4ecb754a464c11ccc5046b2a1c8b1d6a40dac45d3a3b2346" + "1.32.3": + url: "https://github.com/c-ares/c-ares/releases/download/v1.32.3/c-ares-1.32.3.tar.gz" + sha256: "5f02cc809aac3f6cc5edc1fac6c4423fd5616d7406ce47b904c24adf0ff2cd0f" + "1.32.2": + url: "https://github.com/c-ares/c-ares/releases/download/v1.32.2/c-ares-1.32.2.tar.gz" + sha256: "072ff6b30b9682d965b87eb9b77851dc1cd8e6d8090f6821a56bd8fa89595061" + "1.32.1": + url: "https://github.com/c-ares/c-ares/releases/download/v1.32.1/c-ares-1.32.1.tar.gz" + sha256: "63be2c4ee121faa47e9766f735b4cde750fff2c563f81c11e572d3dc6401e5e7" + "1.31.0": + url: "https://github.com/c-ares/c-ares/releases/download/v1.31.0/c-ares-1.31.0.tar.gz" + sha256: "0167a33dba96ca8de29f3f598b1e6cabe531799269fd63d0153aa0e6f5efeabd" + # keep 1.25.0 for libnghttp2, trantor, libcoro + "1.25.0": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_25_0/c-ares-1.25.0.tar.gz" + sha256: "71832b93a48f5ff579c505f4869120c14e57b783275367207f1a98314aa724e5" patches: - "1.17.1": - - patch_file: "patches/upstream-pr-395-bundle-destination-v16-17.patch" - patch_description: "add `BUNDLE DESTINATION` to install" + "1.33.0": + - patch_file: "patches/1.33.0-0001-fix-tcp-fastopen.patch" + patch_description: "fix compilation error for TCP_FASTOPEN_CONNECT" patch_type: "portability" - patch_source: "https://github.com/c-ares/c-ares/pull/395" - "1.16.1": - - patch_file: "patches/upstream-pr-395-bundle-destination-v16-17.patch" - patch_description: "add `BUNDLE DESTINATION` to install" - patch_type: "portability" - patch_source: "https://github.com/c-ares/c-ares/pull/395" - "1.15.0": - - patch_file: "patches/upstream-pr-395-bundle-destination-v15.patch" - patch_description: "add `BUNDLE DESTINATION` to install" - patch_type: "portability" - patch_source: "https://github.com/c-ares/c-ares/pull/395" - "1.14.0": - - patch_file: "patches/option-tools.patch" - patch_description: "add `CARES_BUILD_TOOLS` option" - patch_type: "conan" - patch_source: "https://github.com/c-ares/c-ares/pull/214" - - patch_file: "patches/upstream-pr-395-bundle-destination-v14.patch" - patch_description: "add `BUNDLE DESTINATION` to install" - patch_type: "portability" - patch_source: "https://github.com/c-ares/c-ares/pull/395" + patch_source: "https://github.com/c-ares/c-ares/commit/4abdf7de3678d98f474bd2abeedea741f6c50231" diff --git a/recipes/c-ares/all/conanfile.py b/recipes/c-ares/all/conanfile.py index 7eea8faebb9ed..e4428917c336f 100644 --- a/recipes/c-ares/all/conanfile.py +++ b/recipes/c-ares/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, collect_libs, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.files import collect_libs, copy, get, rm, rmdir, apply_conandata_patches, export_conandata_patches from conan.tools.scm import Version import os @@ -10,12 +10,11 @@ class CAresConan(ConanFile): name = "c-ares" + description = "A C library for asynchronous DNS requests" license = "MIT" url = "https://github.com/conan-io/conan-center-index" - description = "A C library for asynchronous DNS requests" - topics = ("dns", "resolver", "async") homepage = "https://c-ares.haxx.se/" - + topics = ("dns", "resolver", "async") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -83,10 +82,11 @@ def package_info(self): self.cpp_info.components["cares"].defines.append("CARES_STATICLIB") if self.settings.os == "Linux": self.cpp_info.components["cares"].system_libs.append("rt") + if Version(self.version) >= "1.23.0": + self.cpp_info.components["cares"].system_libs.append("pthread") elif self.settings.os == "Windows": self.cpp_info.components["cares"].system_libs.extend(["ws2_32", "advapi32"]) - if Version(self.version) >= "1.18.0": - self.cpp_info.components["cares"].system_libs.append("iphlpapi") + self.cpp_info.components["cares"].system_libs.append("iphlpapi") elif is_apple_os(self): self.cpp_info.components["cares"].system_libs.append("resolv") diff --git a/recipes/c-ares/all/patches/1.33.0-0001-fix-tcp-fastopen.patch b/recipes/c-ares/all/patches/1.33.0-0001-fix-tcp-fastopen.patch new file mode 100644 index 0000000000000..a5aff6174105f --- /dev/null +++ b/recipes/c-ares/all/patches/1.33.0-0001-fix-tcp-fastopen.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/ares__socket.c b/src/lib/ares__socket.c +index 2e360ef..86e281f 100644 +--- a/src/lib/ares__socket.c ++++ b/src/lib/ares__socket.c +@@ -56,7 +56,7 @@ + #include + #include + +-#if defined(__linux__) && defined(MSG_FASTOPEN) ++#if defined(__linux__) && defined(TCP_FASTOPEN_CONNECT) + # define TFO_SUPPORTED 1 + # define TFO_SKIP_CONNECT 0 + # define TFO_USE_SENDTO 0 diff --git a/recipes/c-ares/all/patches/option-tools.patch b/recipes/c-ares/all/patches/option-tools.patch deleted file mode 100644 index 650eca0948612..0000000000000 --- a/recipes/c-ares/all/patches/option-tools.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -670,6 +670,8 @@ SET (CARES_FOUND 1 CACHE INTERNAL "CARES LIBRARY FOUND") - SET (CARES_LIBRARIES ${PROJECT_NAME}::cares CACHE INTERNAL "CARES LIBRARIES") - - -+OPTION (CARES_BUILD_TOOLS "Build tools" ON) -+IF(CARES_BUILD_TOOLS) - # Build ahost - ADD_EXECUTABLE (ahost ahost.c ${SAMPLESOURCES}) - TARGET_COMPILE_DEFINITIONS (ahost PRIVATE HAVE_CONFIG_H=1) -@@ -695,3 +697,4 @@ TARGET_LINK_LIBRARIES (acountry PRIVATE ${PROJECT_NAME}) - IF (CARES_INSTALL) - INSTALL (TARGETS acountry ${TARGETS_INST_DEST}) - ENDIF () -+ENDIF() diff --git a/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v14.patch b/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v14.patch deleted file mode 100644 index 14536414d1c00..0000000000000 --- a/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v14.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -65,6 +65,7 @@ SET (PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package) - # Destinations for installing different kinds of targets (pass to install command). - SET (TARGETS_INST_DEST - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} diff --git a/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v15.patch b/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v15.patch deleted file mode 100644 index 5049967cdd9a6..0000000000000 --- a/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v15.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -66,6 +66,7 @@ SET (PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package) - # Destinations for installing different kinds of targets (pass to install command). - SET (TARGETS_INST_DEST - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} diff --git a/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v16-17.patch b/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v16-17.patch deleted file mode 100644 index ca07d535842b0..0000000000000 --- a/recipes/c-ares/all/patches/upstream-pr-395-bundle-destination-v16-17.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -74,6 +74,7 @@ SET (PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package) - # Destinations for installing different kinds of targets (pass to install command). - SET (TARGETS_INST_DEST - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) diff --git a/recipes/c-ares/all/test_package/CMakeLists.txt b/recipes/c-ares/all/test_package/CMakeLists.txt index 18c37b0445afc..e6ae244786e08 100644 --- a/recipes/c-ares/all/test_package/CMakeLists.txt +++ b/recipes/c-ares/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(c-ares REQUIRED CONFIG) diff --git a/recipes/c-ares/all/test_package/test_package.c b/recipes/c-ares/all/test_package/test_package.c index 0023e9dae2282..0636b1f4dce35 100644 --- a/recipes/c-ares/all/test_package/test_package.c +++ b/recipes/c-ares/all/test_package/test_package.c @@ -103,7 +103,6 @@ main(void) return 1; } - ares_gethostbyname(channel, "google.com", AF_INET, callback, NULL); wait_ares(channel); ares_destroy(channel); ares_library_cleanup(); diff --git a/recipes/c-ares/all/test_v1_package/CMakeLists.txt b/recipes/c-ares/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/c-ares/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/c-ares/all/test_v1_package/conanfile.py b/recipes/c-ares/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/c-ares/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_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/c-ares/config.yml b/recipes/c-ares/config.yml index fcaa857492587..c5bbac1f5f471 100644 --- a/recipes/c-ares/config.yml +++ b/recipes/c-ares/config.yml @@ -1,25 +1,21 @@ versions: - "1.22.1": + "1.34.5": folder: all - "1.22.0": + "1.34.3": folder: all - "1.21.0": + "1.34.1": folder: all - "1.20.1": + "1.33.1": folder: all - "1.19.1": + "1.33.0": folder: all - "1.19.0": + "1.32.3": folder: all - "1.18.1": + "1.32.2": folder: all - "1.17.2": + "1.32.1": folder: all - "1.17.1": + "1.31.0": folder: all - "1.16.1": - folder: all - "1.15.0": - folder: all - "1.14.0": + "1.25.0": folder: all diff --git a/recipes/c-blosc/all/conanfile.py b/recipes/c-blosc/all/conanfile.py index 9f604b7efb491..1db3664b69e69 100644 --- a/recipes/c-blosc/all/conanfile.py +++ b/recipes/c-blosc/all/conanfile.py @@ -1,11 +1,12 @@ 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, 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.53.0" +required_conan_version = ">=2.1" class CbloscConan(ConanFile): @@ -92,6 +93,9 @@ def generate(self): tc.variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True # Generate a relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.21.5": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) diff --git a/recipes/c-blosc/all/test_package/CMakeLists.txt b/recipes/c-blosc/all/test_package/CMakeLists.txt index e73da46b32d37..ec23969a6216a 100644 --- a/recipes/c-blosc/all/test_package/CMakeLists.txt +++ b/recipes/c-blosc/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(c-blosc REQUIRED CONFIG) diff --git a/recipes/c-blosc/all/test_v1_package/CMakeLists.txt b/recipes/c-blosc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/c-blosc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/c-blosc/all/test_v1_package/conanfile.py b/recipes/c-blosc/all/test_v1_package/conanfile.py deleted file mode 100644 index 72910d4a2a0b5..0000000000000 --- a/recipes/c-blosc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conan import ConanFile, tools -from conans import CMake -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.build.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 0708127cd17a6..78b637c31568b 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,72 +1,58 @@ sources: + "2.17.0": + url: "https://github.com/Blosc/c-blosc2/archive/v2.17.0.tar.gz" + sha256: "f8d5b7167f6032bc286b4de63a7feae281d1845d962edcfa21d81a025eef2bb2" + "2.15.0": + url: "https://github.com/Blosc/c-blosc2/archive/v2.15.0.tar.gz" + sha256: "1e7d9d099963ad0123ddd76b2b715b5aa1ea4b95c491d3a11508e487ebab7307" + "2.14.4": + url: "https://github.com/Blosc/c-blosc2/archive/v2.14.4.tar.gz" + sha256: "b5533c79aacc9ac152c80760ed1295a6608938780c3e1eecd7e53ea72ad986b0" + "2.13.1": + url: "https://github.com/Blosc/c-blosc2/archive/v2.13.1.tar.gz" + sha256: "6e7f5940269acd54d8dfe87c2102a442ad0407b1a62266a6f916134bae234399" + "2.13.0": + url: "https://github.com/Blosc/c-blosc2/archive/v2.13.0.tar.gz" + sha256: "d886798ff0a63948a4076f2ed60f0dc18be3aa1299ac1aff2cf705419cbe1bea" + "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" - "2.6.1": - url: "https://github.com/Blosc/c-blosc2/archive/v2.6.1.tar.gz" - sha256: "514a793368093893c1a7cae030f7e31faca7f86465ae69dd576f256d8bf28c08" - "2.6.0": - url: "https://github.com/Blosc/c-blosc2/archive/v2.6.0.tar.gz" - sha256: "ca4fc79a7c4a4d4f53da856ee0bb7083c16236210fdd6263397124572c25a507" - "2.4.3": - url: "https://github.com/Blosc/c-blosc2/archive/v2.4.3.tar.gz" - sha256: "d4aa5e0794598794f20ab950e973d44f0d0d9c133ea1a5a07cb200fa54d2e036" patches: - "2.11.3": - - patch_file: "patches/2.11.1-0001-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" - "2.11.2": - - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + "2.17.0": + - patch_file: "patches/2.17.0-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": + "2.15.0": - 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" + "2.14.4": + - patch_file: "patches/2.10.5-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" + "2.13.1": + - patch_file: "patches/2.10.5-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" + "2.13.0": + - patch_file: "patches/2.10.5-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" - "2.6.1": - - patch_file: "patches/2.6.0-0001-fix-cmake.patch" + "2.12.0": + - patch_file: "patches/2.10.5-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" - "2.6.0": - - patch_file: "patches/2.6.0-0001-fix-cmake.patch" + "2.11.3": + - patch_file: "patches/2.10.5-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" - "2.4.3": - - patch_file: "patches/2.4.1-0001-fix-cmake.patch" + "2.10.5": + - patch_file: "patches/2.10.5-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 9f202af962843..eca34c334ec9c 100644 --- a/recipes/c-blosc2/all/conanfile.py +++ b/recipes/c-blosc2/all/conanfile.py @@ -2,7 +2,7 @@ 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 +from conan.tools.files import get, copy, rm, rmdir, export_conandata_patches, apply_conandata_patches from conan.tools.microsoft import is_msvc from conan.tools.scm import Version @@ -18,7 +18,7 @@ class CBlosc2Conan(ConanFile): license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Blosc/c-blosc2" - topics = ("c-blosc", "blosc", "compression") + topics = ("c-blosc", "blosc", "compression", "cache", "store") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -68,7 +68,7 @@ def requirements(self): if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_zlib in ["zlib-ng", "zlib-ng-compat"]: - self.requires("zlib-ng/2.1.5") + self.requires("zlib-ng/2.2.0") elif self.options.with_zlib == "zlib": self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: @@ -111,9 +111,18 @@ def generate(self): tc.cache_variables["BUILD_PLUGINS"] = bool(self.options.with_plugins) if self.options.with_zlib == "zlib-ng-compat": tc.preprocessor_definitions["ZLIB_COMPAT"] = "1" + if Version(self.version) >= "2.15.2": + tc.cache_variables["WITH_ZLIB_OPTIM"] = self.settings.arch != "wasm" tc.generate() deps = CMakeDeps(self) + if self.options.with_lz4: + deps.set_property("lz4", "cmake_file_name", "LZ4") + if self.options.with_zlib =="zlib-ng": + deps.set_property("zlib-ng", "cmake_file_name", "ZLIB_NG") + deps.set_property("zlib-ng", "cmake_target_name", "ZLIB_NG::ZLIB_NG") + if self.options.with_zstd: + deps.set_property("zstd", "cmake_file_name", "ZSTD") deps.generate() def _patch_sources(self): 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 deleted file mode 100644 index 17ad6d731a77c..0000000000000 --- a/recipes/c-blosc2/all/patches/2.10.0-0001-fix-cmake.patch +++ /dev/null @@ -1,106 +0,0 @@ -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 deleted file mode 100644 index fb1f3b574be59..0000000000000 --- a/recipes/c-blosc2/all/patches/2.10.2-0001-fix-cmake.patch +++ /dev/null @@ -1,139 +0,0 @@ -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 index 743a69c503d24..7b59364e4a949 100644 --- 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 @@ -1,138 +1,54 @@ -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) +@@ -79,8 +79,8 @@ 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}) + 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) +@@ -138,8 +138,8 @@ 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}) + target_include_directories(blosc2_shared PUBLIC ${ZSTD_INCLUDE_DIR}) + target_link_libraries(blosc2_shared 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}) + set(LIBS ${LIBS} ${LZ4_LIBRARY}) 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}) + set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) 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}) + set(LIBS ${LIBS} ${ZSTD_LIBRARY}) 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 deleted file mode 100644 index 5a88b5696c4af..0000000000000 --- a/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch +++ /dev/null @@ -1,124 +0,0 @@ -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.17.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.17.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..01cd1e32a1df2 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.17.0-0001-fix-cmake.patch @@ -0,0 +1,49 @@ +diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt +index 6b38f29..e26bb86 100644 +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -82,7 +82,7 @@ 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}) + endif() +@@ -141,7 +141,7 @@ 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}) +@@ -187,7 +187,7 @@ if(NOT WIN32) + set(LIBS ${LIBS} ${CMAKE_DL_LIBS}) + endif() + +-if(LZ4_FOUND) ++if(lz4_FOUND) + set(LIBS ${LIBS} ${LZ4_LIBRARY}) + else() + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) +@@ -196,7 +196,7 @@ else() + endif() + + if(NOT DEACTIVATE_ZLIB) +- if(ZLIB_NG_FOUND) ++ if(zlib-ng_FOUND) + set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) + elseif(ZLIB_FOUND) + set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) +@@ -209,7 +209,7 @@ if(NOT DEACTIVATE_ZLIB) + endif() + + if(NOT DEACTIVATE_ZSTD) +- if(ZSTD_FOUND) ++ if(zstd_FOUND) + set(LIBS ${LIBS} ${ZSTD_LIBRARY}) + else() + # Enable assembly code only when not using MSVC *and* x86 is there diff --git a/recipes/c-blosc2/all/patches/2.4.1-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.4.1-0001-fix-cmake.patch deleted file mode 100644 index 565d775f0be52..0000000000000 --- a/recipes/c-blosc2/all/patches/2.4.1-0001-fix-cmake.patch +++ /dev/null @@ -1,119 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 866c7f6..c2e2501 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -144,26 +144,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,8 +184,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 441bab6..f17e467 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.4) - 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.6.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch deleted file mode 100644 index 5c30c1a180c48..0000000000000 --- a/recipes/c-blosc2/all/patches/2.6.0-0001-fix-cmake.patch +++ /dev/null @@ -1,122 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 43910d1..199ef1d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -144,26 +144,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) -- set(HAVE_ZLIB_NG TRUE) -+ 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,9 +184,9 @@ endif() - - if(NOT DEACTIVATE_ZSTD) - if(PREFER_EXTERNAL_ZSTD) -- find_package(ZSTD) -- if(NOT ZSTD_FOUND) -- message(STATUS "No ZSTD library found. Using internal sources.") -+ find_package(zstd) -+ if(NOT zstd_FOUND) -+ message(STATUS "No ZSTD library found. Using internal sources.") - endif() - else() - message(STATUS "Using ZSTD internal sources.") -diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt -index 441bab6..f17e467 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.4) - 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 deleted file mode 100644 index a0812cb90ffab..0000000000000 --- a/recipes/c-blosc2/all/patches/2.8.0-0001-fix-cmake.patch +++ /dev/null @@ -1,119 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bb7882f..92ac61c 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 365de33..74ed32e 100644 ---- a/blosc/CMakeLists.txt -+++ b/blosc/CMakeLists.txt -@@ -18,16 +18,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.4) - 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() -@@ -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.4) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} -@@ -99,8 +99,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}) -@@ -108,10 +108,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_LIBRARY}) - 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) -@@ -121,8 +121,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/test_v1_package/CMakeLists.txt b/recipes/c-blosc2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2a9b48732268c..0000000000000 --- a/recipes/c-blosc2/all/test_v1_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(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/c-blosc2/all/test_v1_package/conanfile.py b/recipes/c-blosc2/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/c-blosc2/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/c-blosc2/config.yml b/recipes/c-blosc2/config.yml index 217462db7de18..b453a7fbd75bc 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,21 +1,17 @@ versions: - "2.11.3": - folder: all - "2.11.2": - folder: all - "2.11.1": + "2.17.0": folder: all - "2.10.5": + "2.15.0": folder: all - "2.10.2": + "2.14.4": folder: all - "2.10.0": + "2.13.1": folder: all - "2.8.0": + "2.13.0": folder: all - "2.6.1": + "2.12.0": folder: all - "2.6.0": + "2.11.3": folder: all - "2.4.3": + "2.10.5": folder: all diff --git a/recipes/c-client/all/test_package/CMakeLists.txt b/recipes/c-client/all/test_package/CMakeLists.txt index 0ae631dc1d0fb..2e17ee060a59c 100644 --- a/recipes/c-client/all/test_package/CMakeLists.txt +++ b/recipes/c-client/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(c-client REQUIRED CONFIG) diff --git a/recipes/c-client/all/test_v1_package/CMakeLists.txt b/recipes/c-client/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/c-client/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/c-client/all/test_v1_package/conanfile.py b/recipes/c-client/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/c-client/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_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/c-dbg-macro/all/test_package/CMakeLists.txt b/recipes/c-dbg-macro/all/test_package/CMakeLists.txt index c764c0709047b..831ae2a652da6 100644 --- a/recipes/c-dbg-macro/all/test_package/CMakeLists.txt +++ b/recipes/c-dbg-macro/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 C) find_package(c-dbg-macro REQUIRED) diff --git a/recipes/c-dbg-macro/all/test_v1_package/CMakeLists.txt b/recipes/c-dbg-macro/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 4c9e7ffdd2a28..0000000000000 --- a/recipes/c-dbg-macro/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(test_package ../test_package/test_package.c) diff --git a/recipes/c-dbg-macro/all/test_v1_package/conanfile.py b/recipes/c-dbg-macro/all/test_v1_package/conanfile.py deleted file mode 100644 index c795b378cca50..0000000000000 --- a/recipes/c-dbg-macro/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -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): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/c4core/all/conandata.yml b/recipes/c4core/all/conandata.yml index ab9592ebfbdbe..d5996e1b92d2c 100644 --- a/recipes/c4core/all/conandata.yml +++ b/recipes/c4core/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "0.2.5": + url: "https://github.com/biojppm/c4core/releases/download/v0.2.5/c4core-0.2.5-src.tgz" + sha256: "758f23718cbdc9465f104249561c4028858caf3355a90616b54d1dd937a981b1" + "0.2.2": + url: "https://github.com/biojppm/c4core/releases/download/v0.2.2/c4core-0.2.2-src.tgz" + sha256: "beea43a5bdc64616d897cc0af728f408e35e2d75a8bb6014e6e25e90e0484578" + "0.2.1": + url: "https://github.com/biojppm/c4core/releases/download/v0.2.1/c4core-0.2.1-src.tgz" + sha256: "6447896444c59002af58c8543d0bc64184b9a5c5992c8fc09d6d71935d039f89" + "0.2.0": + url: "https://github.com/biojppm/c4core/releases/download/v0.2.0/c4core-0.2.0-src.tgz" + sha256: "7843e6fb41c200fff69fc71105dbbf56bb410bdbab6b330e02cbe18430fe23bd" "0.1.11": url: "https://github.com/biojppm/c4core/releases/download/v0.1.11/c4core-0.1.11-src.tgz" sha256: "67f4443f3742424f42453594e26e656f616dddfcf225a1d810e00473a741408c" @@ -12,6 +24,22 @@ sources: url: "https://github.com/biojppm/c4core/releases/download/v0.1.8/c4core-0.1.8-src.tgz" sha256: "95c0663192c6bff7a098b50afcb05d22a34dd0fd8e6be2e1b61edad2b9675fde" patches: + "0.2.5": + - patch_file: "patches/0.2.5-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" + "0.2.2": + - patch_file: "patches/0.2.2-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" + "0.2.1": + - patch_file: "patches/0.2.0-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" + "0.2.0": + - patch_file: "patches/0.2.0-0001-make-fast_float-external.patch" + patch_description: "use cci's fast_float recipe" + patch_type: "conan" "0.1.11": - patch_file: "patches/0.1.11-0001-make-fast_float-external.patch" patch_description: "use cci's fast_float recipe" diff --git a/recipes/c4core/all/conanfile.py b/recipes/c4core/all/conanfile.py index d0a1927baa811..91680b53adcd5 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/6.0.0", transitive_headers=True) + self.requires("fast_float/6.1.0", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -82,7 +82,7 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - rm(self, "*.natvis", os.path.join(self.package_folder, "include")) + rm(self, "*.natvis", os.path.join(self.package_folder, "include"), recursive=True) def package_info(self): self.cpp_info.libs = ["c4core"] diff --git a/recipes/c4core/all/patches/0.2.0-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.2.0-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..2fbe458a72084 --- /dev/null +++ b/recipes/c4core/all/patches/0.2.0-0001-make-fast_float-external.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f1d62be..cda061c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,7 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h ++# c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -95,7 +95,10 @@ c4_add_library(c4core + SOURCE_ROOT ${C4CORE_SRC_DIR} + SOURCES ${C4CORE_SRC_FILES} + ) +-if(NOT C4CORE_WITH_FASTFLOAT) ++if(C4CORE_WITH_FASTFLOAT) ++ find_package(FastFloat REQUIRED CONFIG) ++ target_link_libraries(c4core PUBLIC "FastFloat::fast_float") ++else() + target_compile_definitions(c4core PUBLIC -DC4CORE_NO_FAST_FLOAT) + endif() + if(C4CORE_NO_DEBUG_BREAK) +diff --git a/src/c4/ext/fast_float.hpp b/src/c4/ext/fast_float.hpp +index 77fac4f..db14534 100644 +--- a/src/c4/ext/fast_float.hpp ++++ b/src/c4/ext/fast_float.hpp +@@ -18,7 +18,7 @@ + # pragma GCC diagnostic ignored "-Wold-style-cast" + #endif + +-#include "c4/ext/fast_float_all.h" ++#include "fast_float/fast_float.h" + + #ifdef _MSC_VER + # pragma warning(pop) diff --git a/recipes/c4core/all/patches/0.2.2-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.2.2-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..159c3bcb4195b --- /dev/null +++ b/recipes/c4core/all/patches/0.2.2-0001-make-fast_float-external.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 79451c5..c93511a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,7 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h ++# c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -95,7 +95,10 @@ c4_add_library(c4core + SOURCE_ROOT ${C4CORE_SRC_DIR} + SOURCES ${C4CORE_SRC_FILES} + ) +-if(NOT C4CORE_WITH_FASTFLOAT) ++if(C4CORE_WITH_FASTFLOAT) ++ find_package(FastFloat REQUIRED CONFIG) ++ target_link_libraries(c4core PUBLIC "FastFloat::fast_float") ++else() + target_compile_definitions(c4core PUBLIC -DC4CORE_NO_FAST_FLOAT) + endif() + if(C4CORE_NO_DEBUG_BREAK) +diff --git a/src/c4/ext/fast_float.hpp b/src/c4/ext/fast_float.hpp +index 4bf3c0d..b6a3a77 100644 +--- a/src/c4/ext/fast_float.hpp ++++ b/src/c4/ext/fast_float.hpp +@@ -20,7 +20,7 @@ + # pragma GCC diagnostic ignored "-Wold-style-cast" + #endif + +-#include "c4/ext/fast_float_all.h" ++#include "fast_float/fast_float.h" + + #ifdef _MSC_VER + # pragma warning(pop) diff --git a/recipes/c4core/all/patches/0.2.5-0001-make-fast_float-external.patch b/recipes/c4core/all/patches/0.2.5-0001-make-fast_float-external.patch new file mode 100644 index 0000000000000..d9cc59f6cb2a0 --- /dev/null +++ b/recipes/c4core/all/patches/0.2.5-0001-make-fast_float-external.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ba9983c..124e87b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -78,7 +78,7 @@ set(C4CORE_SRC_FILES + if(C4CORE_WITH_FASTFLOAT) + list(APPEND C4CORE_SRC_FILES + c4/ext/fast_float.hpp +- c4/ext/fast_float_all.h ++# c4/ext/fast_float_all.h + ) + endif() + set(C4CORE_AMALGAMATED ${C4CORE_SRC_DIR}/../src_singleheader/c4/c4core_all.hpp) +@@ -97,7 +97,10 @@ c4_add_library(c4core + SOURCE_ROOT ${C4CORE_SRC_DIR} + SOURCES ${C4CORE_SRC_FILES} + ) +-if(NOT C4CORE_WITH_FASTFLOAT) ++if(C4CORE_WITH_FASTFLOAT) ++ find_package(FastFloat REQUIRED CONFIG) ++ target_link_libraries(c4core PUBLIC "FastFloat::fast_float") ++else() + target_compile_definitions(c4core PUBLIC -DC4CORE_NO_FAST_FLOAT) + endif() + if(C4CORE_NO_DEBUG_BREAK) +diff --git a/src/c4/ext/fast_float.hpp b/src/c4/ext/fast_float.hpp +index f54e073..a2d5c44 100644 +--- a/src/c4/ext/fast_float.hpp ++++ b/src/c4/ext/fast_float.hpp +@@ -25,7 +25,7 @@ + # endif + #endif + +-#include "c4/ext/fast_float_all.h" ++#include "fast_float/fast_float.h" + + #ifdef _MSC_VER + # pragma warning(pop) diff --git a/recipes/c4core/all/test_package/CMakeLists.txt b/recipes/c4core/all/test_package/CMakeLists.txt index e0b34e28e562b..1f617cdd5cfa6 100644 --- a/recipes/c4core/all/test_package/CMakeLists.txt +++ b/recipes/c4core/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) diff --git a/recipes/c4core/all/test_v1_package/CMakeLists.txt b/recipes/c4core/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index bc541ea90b512..0000000000000 --- a/recipes/c4core/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/c4core/all/test_v1_package/conanfile.py b/recipes/c4core/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/c4core/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/c4core/config.yml b/recipes/c4core/config.yml index b3f909b6c9664..75a1e9b414fa4 100644 --- a/recipes/c4core/config.yml +++ b/recipes/c4core/config.yml @@ -1,4 +1,12 @@ versions: + "0.2.5": + folder: all + "0.2.2": + folder: all + "0.2.1": + folder: all + "0.2.0": + folder: all "0.1.11": folder: all "0.1.10": diff --git a/recipes/caches/all/conandata.yml b/recipes/caches/all/conandata.yml new file mode 100644 index 0000000000000..75c0527673146 --- /dev/null +++ b/recipes/caches/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.0": + url: "https://github.com/JoelLefkowitz/caches/archive/refs/tags/v0.4.0.tar.gz" + sha256: "51108728e9ec649de752db921d9aca64d56ecd1aba762d4e47e1a6c0c9d0c859" diff --git a/recipes/caches/all/conanfile.py b/recipes/caches/all/conanfile.py new file mode 100644 index 0000000000000..89d1a08b7b07a --- /dev/null +++ b/recipes/caches/all/conanfile.py @@ -0,0 +1,55 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=2.0.0" + + +class CachesConan(ConanFile): + name = "caches" + description = "Extensible cache templates." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/JoelLefkowitz/caches" + topics = ( + "cache", + "fifo", + "lifo", + "lru", + "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 build(self): + pass + + def package(self): + copy( + self, + "LICENSE.md", + self.source_folder, + os.path.join(self.package_folder, "licenses"), + ) + copy( + self, + "*.[ht]pp", + os.path.join(self.source_folder, "src"), + os.path.join(self.package_folder, "include", "caches"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/caches/all/test_package/CMakeLists.txt b/recipes/caches/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f754067c1c1d0 --- /dev/null +++ b/recipes/caches/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(caches REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE caches::caches) diff --git a/recipes/caches/all/test_package/conanfile.py b/recipes/caches/all/test_package/conanfile.py new file mode 100644 index 0000000000000..25a3258042e56 --- /dev/null +++ b/recipes/caches/all/test_package/conanfile.py @@ -0,0 +1,34 @@ +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", + "arch", + "compiler", + "build_type", + ) + + generators = ( + "CMakeDeps", + "CMakeToolchain", + ) + + def layout(self): + cmake_layout(self) + + def build_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/caches/all/test_package/test_package.cpp b/recipes/caches/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e65be0ddea235 --- /dev/null +++ b/recipes/caches/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include +#include +#include + +struct Resource { + size_t id; +}; + +int main() { + caches::LIFOCache(); + caches::FIFOCache(); + caches::LRUCache(); + caches::StoreCache(); +} diff --git a/recipes/caches/config.yml b/recipes/caches/config.yml new file mode 100644 index 0000000000000..af29e78bd9b25 --- /dev/null +++ b/recipes/caches/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.0": + folder: all diff --git a/recipes/caf/all/conandata.yml b/recipes/caf/all/conandata.yml index 4b177005e2f51..bc37447b0b44e 100644 --- a/recipes/caf/all/conandata.yml +++ b/recipes/caf/all/conandata.yml @@ -1,43 +1,19 @@ sources: + "1.0.2": + url: "https://github.com/actor-framework/actor-framework/archive/1.0.2.tar.gz" + sha256: "ef4dd00ca7c59cd61dc336b6a8efbd6150ca85c404d213ecb61f6bcee4094ffc" + "1.0.0": + url: "https://github.com/actor-framework/actor-framework/archive/1.0.0.tar.gz" + sha256: "602018239d23a1805d35ebda704fd5c969a0693fc513fcf7459063b628459e5b" "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" - "0.18.5": - url: "https://github.com/actor-framework/actor-framework/archive/0.18.5.tar.gz" - sha256: "4c96f896f000218bb65890b4d7175451834add73750d5f33b0c7fe82b7d5a679" - "0.18.2": - url: "https://github.com/actor-framework/actor-framework/archive/0.18.2.tar.gz" - sha256: "03837dbef73a13c3e4cac76c009d018f48d1d97b182277230f204984c9542ccc" - "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 08713d4f8b3b0..a3b2de97d78cc 100644 --- a/recipes/caf/all/conanfile.py +++ b/recipes/caf/all/conanfile.py @@ -1,22 +1,22 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import check_min_cppstd, valid_min_cppstd +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, copy, get, rmdir from conan.tools.scm import Version -import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.0" class CAFConan(ConanFile): name = "caf" description = "An open source implementation of the Actor Model in C++" + license = "BSD-3-Clause", "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/actor-framework/actor-framework" - topics = "actor-framework", "actor-model", "pattern-matching", "actors" - license = "BSD-3-Clause", "BSL-1.0" - + topics = ("actor-framework", "actor-model", "pattern-matching", "actors") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -32,21 +32,6 @@ class CAFConan(ConanFile): "with_openssl": True, } - @property - def _min_cppstd(self): - return "17" - - @property - def _minimum_compilers_version(self): - return { - "Visual Studio": "16", - "msvc": "192", - "gcc": "7", - "clang": "6", # Should be 5 but clang 5 has a bug that breaks compiling CAF - # see https://github.com/actor-framework/actor-framework/issues/1226 - "apple-clang": "10", - } - def export_sources(self): export_conandata_patches(self) @@ -66,15 +51,11 @@ def requirements(self): 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._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." - ) + check_min_cppstd(self, "17") + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "6": + raise ConanInvalidConfiguration("Link errors with clang 5. " + "See https://github.com/actor-framework/actor-framework/issues/1226") if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) > "10.0" and \ self.settings.arch == "x86": raise ConanInvalidConfiguration("clang >= 11.0 does not support x86") @@ -88,13 +69,14 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - if not valid_min_cppstd(self, self._min_cppstd): - tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + cppstd = str(self.settings.compiler.cppstd).replace("gnu", "") + if Version(self.version) >= "1.0.0": + tc.variables["CAF_CXX_VERSION"] = cppstd tc.variables["CAF_ENABLE_OPENSSL_MODULE"] = self.options.with_openssl tc.variables["CAF_ENABLE_EXAMPLES"] = False tc.variables["CAF_ENABLE_TOOLS"] = False tc.variables["CAF_ENABLE_TESTING"] = False - tc.variables["CAF_LOG_LEVEL"] = self.options.log_level.value.upper() + tc.variables["CAF_LOG_LEVEL"] = str(self.options.log_level).upper() tc.generate() deps = CMakeDeps(self) deps.generate() @@ -131,14 +113,3 @@ def package_info(self): self.cpp_info.components["caf_openssl"].set_property("cmake_target_name", "CAF::openssl") self.cpp_info.components["caf_openssl"].libs = ["caf_openssl"] self.cpp_info.components["caf_openssl"].requires = ["caf_io", "openssl::openssl"] - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "CAF" - self.cpp_info.names["cmake_find_package_multi"] = "CAF" - self.cpp_info.components["caf_core"].names["cmake_find_package"] = "core" - self.cpp_info.components["caf_core"].names["cmake_find_package_multi"] = "core" - self.cpp_info.components["caf_io"].names["cmake_find_package"] = "io" - self.cpp_info.components["caf_io"].names["cmake_find_package_multi"] = "io" - if self.options.with_openssl: - self.cpp_info.components["caf_openssl"].names["cmake_find_package"] = "openssl" - self.cpp_info.components["caf_openssl"].names["cmake_find_package_multi"] = "openssl" diff --git a/recipes/caf/all/test_package/CMakeLists.txt b/recipes/caf/all/test_package/CMakeLists.txt index 7ef7e73d1a37d..511d1d5b2d5ff 100644 --- a/recipes/caf/all/test_package/CMakeLists.txt +++ b/recipes/caf/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(CAF REQUIRED CONFIG) diff --git a/recipes/caf/all/test_v1_package/CMakeLists.txt b/recipes/caf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/caf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/caf/all/test_v1_package/conanfile.py b/recipes/caf/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/caf/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_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/caf/config.yml b/recipes/caf/config.yml index 548a9345742d5..c4e014dc65945 100644 --- a/recipes/caf/config.yml +++ b/recipes/caf/config.yml @@ -1,15 +1,9 @@ versions: - "0.19.4": + "1.0.2": folder: all - "0.19.3": + "1.0.0": folder: all - "0.19.2": + "0.19.4": folder: all "0.18.6": folder: all - "0.18.5": - folder: all - "0.18.2": - folder: all - "0.18.0": - folder: all diff --git a/recipes/cairo/all/conandata.yml b/recipes/cairo/all/conandata.yml index a2d821e85845f..ab830d86cca25 100644 --- a/recipes/cairo/all/conandata.yml +++ b/recipes/cairo/all/conandata.yml @@ -1,26 +1,45 @@ sources: - "1.17.2": - sha256: "6b70d4655e2a47a22b101c666f4b29ba746eda4aa8a0f7255b32b2e9408801df" + "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": + 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.2.tar.xz" - - "https://www.mirrorservice.org/sites/tinycorelinux.net/11.x/x86_64/tcz/src/cairo/cairo-1.17.2.tar.xz" - "1.16.0": - sha256: "5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331" - url: - - "https://www.cairographics.org/releases/cairo-1.16.0.tar.xz" - - "https://mirror.koddos.net/blfs/conglomeration/cairo/cairo-1.16.0.tar.xz" + - "https://www.cairographics.org/snapshots/cairo-1.17.4.tar.xz" + - "https://mirror.koddos.net/blfs/conglomeration/cairo/cairo-1.17.4.tar.xz" + sha256: "74b24c1ed436bbe87499179a3b27c43f4143b8676d8ad237a6fa787401959705" patches: - "1.17.2": - - patch_file: "patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch" + "1.18.0": + - patch_file: "patches/1.18.0-msvc-alloca.patch" + patch_type: "backport" + patch_description: "Fix alloca undefined with MSVC" + patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/520" + "1.17.4": - patch_file: "patches/binutils-2.34-libbfd-fix.patch" + patch_type: "backport" patch_description: "fix build with newer versions of bfd" - patch_type: backport - patch_source: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/128 + patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/commit/e30259f6237571c61992433c110bc6e1ef900244" base_path: "util/cairo-trace" - "1.16.0": - - patch_file: "patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch" - - patch_file: "patches/binutils-2.34-libbfd-fix.patch" - patch_description: "fix build with newer versions of bfd" - patch_type: backport - patch_source: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/128 + - patch_file: "patches/cairo-1.17.4-trace-cflags-fix.patch" + patch_type: "conan" + patch_description: | + Add missing 'PACKAGE' and 'PACKAGE_VERSION' defines for libbfd headers included by 'lookup-symbol.c'. base_path: "util/cairo-trace" + - patch_file: "patches/cairo-1.17.4-xlib-xrender-option.patch" + patch_type: "conan" + patch_description: >- + This patch adds option to enable or disable xlib-xrender component. + Without it 'xrender' is always required when 'xlib' option is enabled. @sh0 + - patch_file: "patches/cairo-1.17.4-symbol-lookup-backport.patch" + patch_type: "backport" + patch_description: "add symbol-lookup option to allow disabling bfd/libiberty usage" + patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/commit/e0cf7b869fb1c6b73cf4a9aad2fc8aea4ff1f6ee" + - patch_file: "patches/cairo-1.17.4-encoding-backport.patch" + patch_type: "backport" + patch_description: "use encoding=utf-8 when reading/writing files in helper script" + patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/commit/9732f4e80f906fab85b97ae55ee44bfd3ee4945e" diff --git a/recipes/cairo/all/conanfile.py b/recipes/cairo/all/conanfile.py index 1e8675e64a203..9b42f6bc4a8e0 100644 --- a/recipes/cairo/all/conanfile.py +++ b/recipes/cairo/all/conanfile.py @@ -1,36 +1,28 @@ +import glob import os 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, - copy, - export_conandata_patches, - get, - replace_in_file, - rename, - rm, - rmdir -) -from conan.tools.gnu import PkgConfigDeps, Autotools, AutotoolsDeps, AutotoolsToolchain +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.gnu import PkgConfigDeps from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.meson import MesonToolchain, Meson +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version -required_conan_version = ">=1.54.0" +required_conan_version = ">=1.53.0" class CairoConan(ConanFile): name = "cairo" description = "Cairo is a 2D graphics library with support for multiple output devices" - topics = ("graphics") + topics = ("cairo", "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], @@ -41,6 +33,12 @@ class CairoConan(ConanFile): "with_xlib_xrender": [True, False], "with_xcb": [True, False], "with_glib": [True, False], + "with_lzo": [True, False], + "with_zlib": [True, False], + "with_png": [True, False], + "with_opengl": [False, "desktop", "gles2", "gles3"], + "with_symbol_lookup": [True, False], + "tee": [True, False], } default_options = { "shared": False, @@ -48,9 +46,15 @@ class CairoConan(ConanFile): "with_freetype": True, "with_fontconfig": True, "with_xlib": True, - "with_xlib_xrender": False, + "with_xlib_xrender": True, "with_xcb": True, "with_glib": True, + "with_lzo": True, + "with_zlib": True, + "with_png": True, + "with_opengl": "desktop", + "with_symbol_lookup": False, + "tee": False, } short_paths = True @@ -64,14 +68,13 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - del self.options.with_fontconfig - if is_msvc(self): - del self.options.with_freetype - del self.options.with_glib - 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 Version(self.version) >= "1.17.8" or self.settings.os == "Windows" or is_apple_os(self): + del self.options.with_opengl def configure(self): if self.options.shared: @@ -83,259 +86,266 @@ def layout(self): basic_layout(self, src_folder="src") 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.14.2") - if self.settings.os == "Linux": + self.requires("pixman/0.43.4") + if self.options.with_zlib and self.options.with_png: + self.requires("expat/[>=2.6.2 <3]") + if self.options.with_lzo: + self.requires("lzo/2.10") + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_freetype: + self.requires("freetype/2.13.2", transitive_headers=True, transitive_libs=True) + if self.options.with_fontconfig: + self.requires("fontconfig/2.15.0", transitive_headers=True, transitive_libs=True) + if self.options.with_png: + self.requires("libpng/[>=1.6 <2]") + if self.options.with_glib: + self.requires("glib/2.78.3") + 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") - if self.options.get_safe("with_glib", True): - self.requires("glib/2.76.3") - self.requires("zlib/1.2.13") - self.requires("pixman/0.40.0") - self.requires("libpng/1.6.40") - - def package_id(self): - if self.options.get_safe("with_glib") and not self.dependencies["glib"].options.shared: - self.info.requires["glib"].full_package_mode() + self.requires("xorg/system", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("with_opengl") == "desktop": + 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", transitive_headers=True, transitive_libs=True) def validate(self): - if is_msvc(self): - # TODO autotools build results in LNK1127 error from a library in the WindowsSDK on CCI - # should be retested in case this is just a CCI environment issue - raise ConanInvalidConfiguration("MSVC autotools build is not supported. Use the Meson build instead.") + if self.options.get_safe("with_xlib_xrender") and not self.options.get_safe("with_xlib"): + raise ConanInvalidConfiguration("'with_xlib_xrender' option requires 'with_xlib' option to be enabled as well!") + if self.options.with_glib: + if self.dependencies["glib"].options.shared: + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Linking shared glib with the MSVC static runtime is not supported" + ) + elif self.options.shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) def build_requirements(self): - self.tool_requires("libtool/2.4.7") - if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.3") - if self._settings_build.os == "Windows": - self.win_bash = True - if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): - self.tool_requires("msys2/cci.latest") - if is_msvc(self): - self.tool_requires("automake/1.16.5") - else: - self.tool_requires("gtk-doc-stub/cci.20181216") + self.tool_requires("meson/1.4.0") + 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 _create_toolchain(self, namespace, directory): - def is_enabled(value): - return "yes" if value else "no" - - def dep_path(dependency): - return unix_path(self, self.deps_cpp_info[dependency].rootpath) - - tc = AutotoolsToolchain(self, namespace=namespace) - tc.configure_args += [ - f"--datarootdir={unix_path(self, os.path.join(self.package_folder, 'res'))}", - f"--enable-ft={is_enabled(self.options.get_safe('with_freetype', True))}", - f"--enable-gobject={is_enabled(self.options.get_safe('with_glib', True))}", - f"--enable-fc={is_enabled(self.options.get_safe('with_fontconfig'))}", - f"--enable-xlib={is_enabled(self.options.get_safe('with_xlib'))}", - f"--enable-xlib_xrender={is_enabled(self.options.get_safe('with_xlib_xrender'))}", - f"--enable-xcb={is_enabled(self.options.get_safe('xcb'))}", - "--disable-gtk-doc" - ] - if is_msvc(self): - tc.make_args += [ - "--directory", directory, - "-f", "Makefile.win32", - f"CFG={str(self.settings.build_type).lower()}", - "CAIRO_HAS_FC_FONT=0", - f"ZLIB_PATH={dep_path('zlib')}", - f"LIBPNG_PATH={dep_path('libpng')}", - f"PIXMAN_PATH={dep_path('pixman')}", - f"FREETYPE_PATH={dep_path('freetype')}", - f"GOBJECT_PATH={dep_path('glib')}" - ] - tc.extra_cflags += ["-FS"] - - if self.settings.compiler in ["gcc", "clang", "apple-clang"]: - tc.extra_cflags.append("-Wno-enum-conversion") - - return tc - def generate(self): - VirtualBuildEnv(self).generate() - - if not cross_building(self): - VirtualRunEnv(self).generate(scope="build") + def is_enabled(value): + return "enabled" if value else "disabled" + + env = VirtualBuildEnv(self) + env.generate() + + pkg_deps = PkgConfigDeps(self) + pkg_deps.generate() + + options = dict() + options["tests"] = "disabled" + options["zlib"] = is_enabled(self.options.with_zlib) + 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 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 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")) - tc_main = self._create_toolchain("main", unix_path(self, self.source_folder)) - tc_main.generate() + # future options to add, see meson_options.txt. + # for now, disabling explicitly, to avoid non-reproducible auto-detection of system libs - if is_msvc(self): - tc_gobject = self._create_toolchain("gobject", unix_path(self, os.path.join(self.source_folder, "util", "cairo-gobject"))) - tc_gobject.generate() + version = Version(self.version) + if version < "1.17.6": + options["cogl"] = "disabled" # https://gitlab.gnome.org/GNOME/cogl + options["directfb"] = "disabled" + 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 in ["Linux", "FreeBSD"]: + options["xlib-xrender"] = is_enabled(self.options.with_xlib_xrender) - PkgConfigDeps(self).generate() - deps = AutotoolsDeps(self) - if is_msvc(self): - cppflags = deps.vars().get("CPPFLAGS") - deps.environment.append('CFLAGS', cppflags.replace("/I", "-I")) - ldflags = deps.vars().get("LDFLAGS") - deps.environment.define('LDFLAGS', ldflags.replace("/LIBPATH:", "-LIBPATH:")) - deps.environment.append('LDFLAGS', deps.vars().get("LIBS")) + options["gtk2-utils"] = "disabled" + options["spectre"] = "disabled" # https://www.freedesktop.org/wiki/Software/libspectre/ - deps.generate() + meson = MesonToolchain(self) + meson.project_options.update(options) - def _patch_sources(self): - apply_conandata_patches(self) + if cross_building(self): + meson.properties["ipc_rmid_deferred_release"] = self.settings.os == "Linux" - def fix_freetype_version(): - replace_in_file( - self, - os.path.join(self.source_folder, "configure.ac"), - "FREETYPE_MIN_VERSION=9.7.3", - f"FREETYPE_MIN_VERSION={Version(self.dependencies['freetype'].ref.version)}" - ) + if is_apple_os(self) and Version(self.version) < "1.17.6": + # This was fixed in the meson build from 1.17.6 + meson.c_link_args += ["-framework", "ApplicationServices", "-framework", "CoreFoundation"] - def exclude_tests_and_docs_from_build(): - makefile_am = os.path.join(self.source_folder, "Makefile.am") - replace_in_file(self, makefile_am, "SUBDIRS += boilerplate test perf", "") - replace_in_file(self, makefile_am, "SUBDIRS = src doc util", "SUBDIRS = src util") + if not self.options.shared: + meson.c_args.append("-DCAIRO_WIN32_STATIC_BUILD") - fix_freetype_version() - exclude_tests_and_docs_from_build() + meson.generate() - if self.options.get_safe("with_freetype"): - replace_in_file(self, os.path.join(self.source_folder, "src", "cairo-ft-font.c"), - "#if HAVE_UNISTD_H", "#ifdef HAVE_UNISTD_H") + def build(self): + apply_conandata_patches(self) - if is_msvc(self): - # https://cairographics.org/end_to_end_build_for_win32/ - win32_common = os.path.join(self.source_folder, "build", "Makefile.win32.common") - replace_in_file(self, win32_common, "-MD ", f"-{self.settings.compiler.runtime} ") - replace_in_file(self, win32_common, "-MDd ", f"-{self.settings.compiler.runtime} ") - replace_in_file(self, win32_common, "$(PIXMAN_PATH)/lib/pixman-1.lib", - self.deps_cpp_info["pixman"].libs[0] + ".lib") - replace_in_file(self, win32_common, "$(FREETYPE_PATH)/lib/freetype.lib", - self.deps_cpp_info["freetype"].libs[0] + ".lib") - replace_in_file(self, win32_common, "$(ZLIB_PATH)/lib/zlib1.lib", - self.deps_cpp_info["zlib"].libs[0] + ".lib") - replace_in_file(self, win32_common, "$(LIBPNG_PATH)/lib/libpng16.lib", - self.deps_cpp_info["libpng"].libs[0] + ".lib") + # Dependency freetype2 found: NO found 2.11.0 but need: '>= 9.7.3' + if self.options.with_freetype: + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "freetype_required_version = '>= 9.7.3'", + f"freetype_required_version = '>= {self.dependencies['freetype'].ref.version}'") + meson = Meson(self) + meson.configure() + meson.build() - def build(self): - self._patch_sources() - autotools = Autotools(self, namespace="main") + def _fix_library_names(self, path): if is_msvc(self): - autotools.make() - autotools_gobject = Autotools(self, namespace="gobject") - autotools_gobject.make() - else: - autotools.autoreconf() - autotools.configure() - autotools.make() + for filename_old in glob.glob(os.path.join(path, "*.a")): + root, _ = os.path.splitext(filename_old) + folder, basename = os.path.split(root) + rename(self, filename_old, os.path.join(folder, basename.replace("lib", "") + ".lib")) def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - if is_msvc(self): - src = os.path.join(self.source_folder, "src") - inc = os.path.join(self.package_folder, "include", "cairo") - copy(self, "cairo-version.h", (src if Version(self.version) >= "1.17.4" else self.source_folder), inc) - copy(self, "cairo-features.h", src, inc) - copy(self, "cairo.h", src, inc) - copy(self, "cairo-deprecated.h", src, inc) - copy(self, "cairo-win32.h", src, inc) - copy(self, "cairo-script.h", src, inc) - copy(self, "cairo-ft.h", src, inc) - copy(self, "cairo-ps.h", src, inc) - copy(self, "cairo-pdf.h", src, inc) - copy(self, "cairo-svg.h", src, inc) - copy(self, "cairo-gobject.h", inc, os.path.join(self.source_folder, "util", "cairo-gobject")) - - config = str(self.settings.build_type).lower() - lib_src_path = os.path.join(self.source_folder, "src", config) - cairo_gobject_src_path = os.path.join(self.source_folder, "util", "cairo-gobject", config) - lib_dest_path = os.path.join(self.package_folder, "lib") - runtime_dest_path = os.path.join(self.package_folder, "bin") - - if self.options.shared: - copy(self, "*cairo.lib", lib_src_path, lib_dest_path) - copy(self, "*cairo.dll", lib_src_path, runtime_dest_path) - copy(self, "*cairo-gobject.lib", cairo_gobject_src_path, lib_dest_path) - copy(self, "*cairo-gobject.dll", cairo_gobject_src_path, runtime_dest_path) - else: - copy(self, "cairo-static.lib", lib_src_path, lib_dest_path) - copy(self, "cairo-gobject.lib", cairo_gobject_src_path, lib_dest_path) - rename(self, os.path.join(lib_dest_path, "cairo-static.lib"), os.path.join(lib_dest_path, "cairo.lib")) - else: - autotools = Autotools(self, namespace="main") - autotools.install() - + meson = Meson(self) + meson.install() + self._fix_library_names(os.path.join(self.package_folder, "lib")) copy(self, "COPYING*", self.source_folder, os.path.join(self.package_folder, "licenses")) - rm(self, "*.la", self.package_folder, recursive=True) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) fix_apple_shared_install_name(self) def package_info(self): + base_requirements = {"pixman::pixman"} + base_system_libs = {} + + def add_component_and_base_requirements(component, requirements, system_libs=None): + self.cpp_info.components[component].set_property("pkg_config_name", component) + self.cpp_info.components[component].requires += ["cairo_"] + requirements + base_requirements.update(set(requirements)) + if system_libs is not None: + self.cpp_info.components[component].system_libs += system_libs + base_system_libs.update(set(system_libs)) + self.cpp_info.set_property("pkg_config_name", "cairo-all-do-no-use") self.cpp_info.components["cairo_"].set_property("pkg_config_name", "cairo") self.cpp_info.components["cairo_"].libs = ["cairo"] self.cpp_info.components["cairo_"].includedirs.insert(0, os.path.join("include", "cairo")) - self.cpp_info.components["cairo_"].requires = ["pixman::pixman", "libpng::libpng", "zlib::zlib"] - if self.options.get_safe("with_freetype", True): - self.cpp_info.components["cairo_"].requires.append("freetype::freetype") - - if self.settings.os == "Windows": - self.cpp_info.components["cairo_"].system_libs.extend(["gdi32", "msimg32", "user32"]) - if not self.options.shared: - self.cpp_info.components["cairo_"].defines.append("CAIRO_WIN32_STATIC_BUILD=1") - else: - if self.options.with_glib: - self.cpp_info.components["cairo_"].requires.extend(["glib::gobject-2.0", "glib::glib-2.0"]) - if self.options.with_fontconfig: - self.cpp_info.components["cairo_"].requires.append("fontconfig::fontconfig") - - if self.settings.os == "Linux": - self.cpp_info.components["cairo_"].system_libs = ["pthread", "rt"] + 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") self.cpp_info.components["cairo_"].cflags = ["-pthread"] self.cpp_info.components["cairo_"].cxxflags = ["-pthread"] - if self.options.with_xcb: - self.cpp_info.components["cairo_"].requires.extend(["xorg::xcb-shm", "xorg::xcb"]) - if self.options.with_xlib_xrender: - self.cpp_info.components["cairo_"].requires.extend(["xorg::xcb-render"]) - if self.options.with_xlib: - self.cpp_info.components["cairo_"].requires.extend(["xorg::x11", "xorg::xext"]) - if is_apple_os(self): - self.cpp_info.components["cairo_"].frameworks.append("CoreGraphics") + if self.options.with_lzo: + self.cpp_info.components["cairo_"].requires.append("lzo::lzo") - if self.settings.os == "Windows": - self.cpp_info.components["cairo-win32"].set_property("pkg_config_name", "cairo-win32") - self.cpp_info.components["cairo-win32"].requires = ["cairo_", "pixman::pixman", "libpng::libpng"] + if self.options.with_zlib: + self.cpp_info.components["cairo_"].requires.append("zlib::zlib") - if self.options.get_safe("with_glib", True): - self.cpp_info.components["cairo-gobject"].set_property("pkg_config_name", "cairo-gobject") - self.cpp_info.components["cairo-gobject"].libs = ["cairo-gobject"] - self.cpp_info.components["cairo-gobject"].requires = ["cairo_", "glib::gobject-2.0", "glib::glib-2.0"] - if self.settings.os != "Windows": - if self.options.with_fontconfig: - self.cpp_info.components["cairo-fc"].set_property("pkg_config_name", "cairo-fc") - self.cpp_info.components["cairo-fc"].requires = ["cairo_", "fontconfig::fontconfig"] - if self.options.get_safe("with_freetype", True): - self.cpp_info.components["cairo-ft"].set_property("pkg_config_name", "cairo-ft") - self.cpp_info.components["cairo-ft"].requires = ["cairo_", "freetype::freetype"] - - self.cpp_info.components["cairo-pdf"].set_property("pkg_config_name", "cairo-pdf") - self.cpp_info.components["cairo-pdf"].requires = ["cairo_", "zlib::zlib"] - - if self.settings.os == "Linux": - if self.options.with_xlib: - self.cpp_info.components["cairo-xlib"].set_property("pkg_config_name", "cairo-xlib") - self.cpp_info.components["cairo-xlib"].requires = ["cairo_", "xorg::x11", "xorg::xext"] + if self.options.with_png: + add_component_and_base_requirements("cairo-png", ["libpng::libpng"]) + add_component_and_base_requirements("cairo-svg", ["libpng::libpng"]) + + if self.options.with_fontconfig: + add_component_and_base_requirements("cairo-fc", ["fontconfig::fontconfig"]) + + if self.options.with_freetype: + add_component_and_base_requirements("cairo-ft", ["freetype::freetype"]) + + if self.options.get_safe("with_xlib"): + add_component_and_base_requirements("cairo-xlib", ["xorg::x11", "xorg::xext"]) + + if self.options.get_safe("with_xlib_xrender"): + add_component_and_base_requirements("cairo-xlib-xrender", ["xorg::xrender"]) + + if self.options.get_safe("with_xcb"): + add_component_and_base_requirements("cairo-xcb", ["xorg::xcb", "xorg::xcb-render"]) + add_component_and_base_requirements("cairo-xcb-shm", ["xorg::xcb", "xorg::xcb-shm"]) + + if self.options.get_safe("with_xlib"): + add_component_and_base_requirements("cairo-xlib-xcb", ["xorg::x11-xcb"]) if is_apple_os(self): self.cpp_info.components["cairo-quartz"].set_property("pkg_config_name", "cairo-quartz") self.cpp_info.components["cairo-quartz"].requires = ["cairo_"] - self.cpp_info.components["cairo-quartz"].frameworks.extend(["CoreFoundation", "CoreGraphics", "ApplicationServices"]) + + self.cpp_info.components["cairo-quartz-image"].set_property("pkg_config_name", "cairo-quartz-image") + self.cpp_info.components["cairo-quartz-image"].requires = ["cairo_"] self.cpp_info.components["cairo-quartz-font"].set_property("pkg_config_name", "cairo-quartz-font") self.cpp_info.components["cairo-quartz-font"].requires = ["cairo_"] + + self.cpp_info.components["cairo_"].frameworks += ["ApplicationServices", "CoreFoundation", "CoreGraphics"] + + if self.settings.os == "Windows": + self.cpp_info.components["cairo-win32"].set_property("pkg_config_name", "cairo-win32") + self.cpp_info.components["cairo-win32"].requires = ["cairo_"] + + self.cpp_info.components["cairo-win32-font"].set_property("pkg_config_name", "cairo-win32-font") + self.cpp_info.components["cairo-win32-font"].requires = ["cairo_"] + + self.cpp_info.components["cairo_"].system_libs.extend(["gdi32", "msimg32", "user32"]) + + if not self.options.shared: + self.cpp_info.components["cairo_"].defines.append("CAIRO_WIN32_STATIC_BUILD=1") + + if self.options.get_safe("with_opengl"): + if self.options.with_opengl == "desktop": + add_component_and_base_requirements("cairo-gl", ["opengl::opengl"]) + + if self.settings.os in ["Linux", "FreeBSD"]: + add_component_and_base_requirements("cairo-glx", ["opengl::opengl"]) + + if self.settings.os == "Windows": + add_component_and_base_requirements("cairo-wgl", ["glext::glext", "wglext::wglext", "khrplatform::khrplatform"]) + + elif self.options.with_opengl == "gles3": + add_component_and_base_requirements("cairo-glesv3", [], ["GLESv2"]) + elif self.options.with_opengl == "gles2": + add_component_and_base_requirements("cairo-glesv2", [], ["GLESv2"]) + if self.settings.os in ["Linux", "FreeBSD"]: + add_component_and_base_requirements("cairo-egl", ["egl::egl"]) + + if self.options.with_zlib: + add_component_and_base_requirements("cairo-script", ["zlib::zlib"]) + add_component_and_base_requirements("cairo-ps", ["zlib::zlib"]) + add_component_and_base_requirements("cairo-pdf", ["zlib::zlib"]) + self.cpp_info.components["cairo-script-interpreter"].set_property("pkg_config_name", "cairo-script-interpreter") + self.cpp_info.components["cairo-script-interpreter"].libs = ["cairo-script-interpreter"] + self.cpp_info.components["cairo-script-interpreter"].requires = ["cairo_"] + + if self.options.with_png: + add_component_and_base_requirements("cairo-xml", ["zlib::zlib"]) + add_component_and_base_requirements("cairo-util_", ["expat::expat"]) + + if self.options.tee: + self.cpp_info.components["cairo-tee"].set_property("pkg_config_name", "cairo-tee") + self.cpp_info.components["cairo-tee"].requires = ["cairo_"] + + # util directory + if self.options.with_glib: + self.cpp_info.components["cairo-gobject"].set_property("pkg_config_name", "cairo-gobject") + self.cpp_info.components["cairo-gobject"].libs = ["cairo-gobject"] + self.cpp_info.components["cairo-gobject"].requires = ["cairo_", "glib::gobject-2.0", "glib::glib-2.0"] + + self.cpp_info.components["cairo_"].requires += list(base_requirements) + self.cpp_info.components["cairo_"].system_libs += list(base_system_libs) diff --git a/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch b/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch deleted file mode 100644 index 1554d7bb38ba6..0000000000000 --- a/recipes/cairo/all/patches/0001-msvc-update-build-scripts-to-compile-with-more-featu.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 2801a57b7dae8060f4b4c2dede65cf4ce79da62b Mon Sep 17 00:00:00 2001 -From: Ignacio Casal Quinteiro -Date: Tue, 28 Feb 2017 11:10:37 +0100 -Subject: [PATCH] msvc: update build scripts to compile with more features - -This also adds support to build cairo-gobject ---- - build/Makefile.win32.common | 52 +++++++++++++++++++++++++++++++-------- - build/Makefile.win32.features | 13 +++++----- - util/cairo-gobject/Makefile.win32 | 24 ++++++++++++++++++ - 3 files changed, 73 insertions(+), 16 deletions(-) - create mode 100644 util/cairo-gobject/Makefile.win32 - -diff --git a/build/Makefile.win32.common b/build/Makefile.win32.common -index 7d7e973..38063a7 100644 ---- a/build/Makefile.win32.common -+++ b/build/Makefile.win32.common -@@ -23,34 +23,66 @@ CFG_CFLAGS := -MD -O2 - CFG_LDFLAGS := - endif - -+ifeq ($(ARCH),) -+ARCH=Win32 -+endif -+ -+ifeq ($(INSTALL_DIR),) -+INSTALL_DIR=$(top_srcdir)/../../../../gtk/$(ARCH)/$(CFG) -+endif -+ - ifeq ($(PIXMAN_PATH),) --PIXMAN_PATH := $(top_builddir)/../pixman -+PIXMAN_PATH := $(INSTALL_DIR) - endif --PIXMAN_CFLAGS := -I$(PIXMAN_PATH)/pixman/ --PIXMAN_LIBS := $(PIXMAN_PATH)/pixman/$(CFG)/pixman-1.lib -+PIXMAN_CFLAGS := -I$(PIXMAN_PATH)/include/pixman-1 -+PIXMAN_LIBS := $(PIXMAN_PATH)/lib/pixman-1.lib - - CAIRO_LIBS = gdi32.lib msimg32.lib user32.lib - - ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1) - ifeq ($(LIBPNG_PATH),) --LIBPNG_PATH := $(top_builddir)/../libpng -+LIBPNG_PATH := $(INSTALL_DIR) - endif --LIBPNG_CFLAGS += -I$(LIBPNG_PATH)/ --CAIRO_LIBS += $(LIBPNG_PATH)/libpng.lib -+LIBPNG_CFLAGS += -I$(LIBPNG_PATH)/include -+CAIRO_LIBS += $(LIBPNG_PATH)/lib/libpng16.lib - endif - - ifeq ($(CAIRO_HAS_PS_SURFACE)$(CAIRO_HAS_PDF_SURFACE),00) - else - ifeq ($(ZLIB_PATH),) --ZLIB_PATH := $(top_builddir)/../zlib -+ZLIB_PATH := $(INSTALL_DIR) -+endif -+ZLIB_CFLAGS += -I$(ZLIB_PATH)/include -+CAIRO_LIBS += $(ZLIB_PATH)/lib/zlib1.lib -+endif -+ -+ifeq ($(CAIRO_HAS_FT_FONT),1) -+ifeq ($(FREETYPE_PATH),) -+FREETYPE_PATH := $(INSTALL_DIR) -+endif -+FREETYPE_CFLAGS += -I$(FREETYPE_PATH)/include -+CAIRO_LIBS += $(FREETYPE_PATH)/lib/freetype.lib -+endif -+ -+ifeq ($(CAIRO_HAS_FC_FONT),1) -+ifeq ($(FONTCONFIG_PATH),) -+FONTCONFIG_PATH := $(INSTALL_DIR) -+endif -+FONTCONFIG_CFLAGS += -I$(FONTCONFIG_PATH)/include -+CAIRO_LIBS += $(FONTCONFIG_PATH)/lib/fontconfig.lib -+endif -+ -+ifeq ($(CAIRO_HAS_GOBJECT_FUNCTIONS),1) -+ifeq ($(GOBJECT_PATH),) -+GOBJECT_PATH := $(INSTALL_DIR) - endif --ZLIB_CFLAGS += -I$(ZLIB_PATH)/ --CAIRO_LIBS += $(ZLIB_PATH)/zdll.lib -+GOBJECT_CFLAGS := -I$(GOBJECT_PATH)/include/glib-2.0 -I$(GOBJECT_PATH)/lib/glib-2.0/include -+GOBJECT_LIBS := $(GOBJECT_PATH)/lib/glib-2.0.lib $(GOBJECT_PATH)/lib/gobject-2.0.lib - endif - - DEFAULT_CFLAGS = -nologo $(CFG_CFLAGS) - DEFAULT_CFLAGS += -I. -I$(top_srcdir) -I$(top_srcdir)/src --DEFAULT_CFLAGS += $(PIXMAN_CFLAGS) $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS) -+DEFAULT_CFLAGS += $(PIXMAN_CFLAGS) $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) - - CAIRO_CFLAGS = $(DEFAULT_CFLAGS) $(CFLAGS) - -diff --git a/build/Makefile.win32.features b/build/Makefile.win32.features -index 8cb155d..db3f0ac 100644 ---- a/build/Makefile.win32.features -+++ b/build/Makefile.win32.features -@@ -26,16 +26,17 @@ CAIRO_HAS_EGL_FUNCTIONS=0 - CAIRO_HAS_GLX_FUNCTIONS=0 - CAIRO_HAS_WGL_FUNCTIONS=0 - CAIRO_HAS_SCRIPT_SURFACE=1 --CAIRO_HAS_FT_FONT=0 --CAIRO_HAS_FC_FONT=0 -+CAIRO_HAS_FT_FONT=1 -+CAIRO_HAS_FC_FONT=1 - CAIRO_HAS_PS_SURFACE=1 - CAIRO_HAS_PDF_SURFACE=1 - CAIRO_HAS_SVG_SURFACE=1 - CAIRO_HAS_TEST_SURFACES=0 --CAIRO_HAS_TEE_SURFACE=0 --CAIRO_HAS_XML_SURFACE=0 -+CAIRO_HAS_TEE_SURFACE=1 -+CAIRO_HAS_XML_SURFACE=1 - CAIRO_HAS_PTHREAD=0 --CAIRO_HAS_GOBJECT_FUNCTIONS=0 --CAIRO_HAS_TRACE=0 -+CAIRO_HAS_GOBJECT_FUNCTIONS=1 -+CAIRO_HAS_TRACE=1 - CAIRO_HAS_INTERPRETER=1 - CAIRO_HAS_SYMBOL_LOOKUP=0 -+CAIRO_HAS_IMAGE_SURFACE=1 -diff --git a/util/cairo-gobject/Makefile.win32 b/util/cairo-gobject/Makefile.win32 -new file mode 100644 -index 0000000..1f63511 ---- /dev/null -+++ b/util/cairo-gobject/Makefile.win32 -@@ -0,0 +1,24 @@ -+top_srcdir = ../.. -+include $(top_srcdir)/build/Makefile.win32.common -+ -+CAIRO_LIB = $(top_srcdir)/src/$(CFG)/cairo.lib -+SOURCES = \ -+ cairo-gobject-enums.c \ -+ cairo-gobject-structs.c -+ -+OBJECTS = $(patsubst %.c, $(CFG)/%.obj, $(SOURCES)) -+ -+dynamic: inform $(CFG)/cairo-gobject.dll -+ -+$(CFG)/%.obj: %.c $(top_srcdir)/src/cairo-features.h -+ @mkdir -p $(CFG)/`dirname $<` -+ @$(CC) $(CAIRO_CFLAGS) $(GOBJECT_CFLAGS) -c -Fo"$@" $< -+ -+$(CFG)/cairo-gobject.dll: $(OBJECTS) -+ @$(LD) $(CAIRO_LDFLAGS) $(GOBJECT_LDFLAGS) -DLL -OUT:$@ $(CAIRO_LIB) $(GOBJECT_LIBS) $(OBJECTS) -+ -+all: inform $(CFG)/cairo-gobject.dll -+ @echo "Built successfully!" -+ @echo "You should copy the following files to a proper place now:" -+ @echo "" -+ @echo " util/cairo-gobject/$(CFG)/cairo-gobject.dll" --- -2.9.3 - diff --git a/recipes/cairo/all/patches/1.18.0-msvc-alloca.patch b/recipes/cairo/all/patches/1.18.0-msvc-alloca.patch new file mode 100644 index 0000000000000..3be0a4002a73e --- /dev/null +++ b/recipes/cairo/all/patches/1.18.0-msvc-alloca.patch @@ -0,0 +1,28 @@ +From 27cdee5e4cf19e7959b80fe1a39e61188de1b654 Mon Sep 17 00:00:00 2001 +From: Dan Yeaw +Date: Sat, 30 Sep 2023 13:30:51 -0400 +Subject: [PATCH] Fix alloca undefined with MSVC + +Conditionally includes malloc.h when compiling with +MSVC so that alloca is defined. +--- + src/cairo-colr-glyph-render.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/cairo-colr-glyph-render.c b/src/cairo-colr-glyph-render.c +index 28254fd51..a9ad84bbf 100644 +--- a/src/cairo-colr-glyph-render.c ++++ b/src/cairo-colr-glyph-render.c +@@ -43,6 +43,10 @@ + #include + #include + ++#ifdef _MSC_VER ++#include ++#endif ++ + #if HAVE_FT_COLR_V1 + + #include +-- +GitLab diff --git a/recipes/cairo/meson/patches/cairo-1.17.4-encoding-backport.patch b/recipes/cairo/all/patches/cairo-1.17.4-encoding-backport.patch similarity index 100% rename from recipes/cairo/meson/patches/cairo-1.17.4-encoding-backport.patch rename to recipes/cairo/all/patches/cairo-1.17.4-encoding-backport.patch diff --git a/recipes/cairo/meson/patches/cairo-1.17.4-symbol-lookup-backport.patch b/recipes/cairo/all/patches/cairo-1.17.4-symbol-lookup-backport.patch similarity index 100% rename from recipes/cairo/meson/patches/cairo-1.17.4-symbol-lookup-backport.patch rename to recipes/cairo/all/patches/cairo-1.17.4-symbol-lookup-backport.patch diff --git a/recipes/cairo/meson/patches/cairo-1.17.4-trace-cflags-fix.patch b/recipes/cairo/all/patches/cairo-1.17.4-trace-cflags-fix.patch similarity index 100% rename from recipes/cairo/meson/patches/cairo-1.17.4-trace-cflags-fix.patch rename to recipes/cairo/all/patches/cairo-1.17.4-trace-cflags-fix.patch diff --git a/recipes/cairo/meson/patches/cairo-1.17.4-xlib-xrender-option.patch b/recipes/cairo/all/patches/cairo-1.17.4-xlib-xrender-option.patch similarity index 100% rename from recipes/cairo/meson/patches/cairo-1.17.4-xlib-xrender-option.patch rename to recipes/cairo/all/patches/cairo-1.17.4-xlib-xrender-option.patch diff --git a/recipes/cairo/all/test_package/CMakeLists.txt b/recipes/cairo/all/test_package/CMakeLists.txt index 4f33d55898eb2..83adc4effa23e 100644 --- a/recipes/cairo/all/test_package/CMakeLists.txt +++ b/recipes/cairo/all/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/all/test_v1_package/CMakeLists.txt b/recipes/cairo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 692a4909c85a7..0000000000000 --- a/recipes/cairo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -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/cairo/all/test_v1_package/conanfile.py b/recipes/cairo/all/test_v1_package/conanfile.py deleted file mode 100644 index 24f9e474d6cd2..0000000000000 --- a/recipes/cairo/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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, skip_x64_x86=True): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - diff --git a/recipes/cairo/config.yml b/recipes/cairo/config.yml index 8e74221deaa9f..ec5b451e74c04 100644 --- a/recipes/cairo/config.yml +++ b/recipes/cairo/config.yml @@ -1,13 +1,9 @@ versions: "1.18.0": - folder: meson + folder: all "1.17.8": - folder: meson + folder: all "1.17.6": - folder: meson - "1.17.4": - folder: meson - "1.17.2": folder: all - "1.16.0": + "1.17.4": folder: all diff --git a/recipes/cairo/meson/conandata.yml b/recipes/cairo/meson/conandata.yml deleted file mode 100644 index 278a3653016c5..0000000000000 --- a/recipes/cairo/meson/conandata.yml +++ /dev/null @@ -1,40 +0,0 @@ -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": - 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" - - "https://mirror.koddos.net/blfs/conglomeration/cairo/cairo-1.17.4.tar.xz" - sha256: "74b24c1ed436bbe87499179a3b27c43f4143b8676d8ad237a6fa787401959705" -patches: - "1.17.4": - - patch_file: "patches/binutils-2.34-libbfd-fix.patch" - patch_type: "backport" - patch_description: "fix build with newer versions of bfd" - patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/commit/e30259f6237571c61992433c110bc6e1ef900244" - base_path: "util/cairo-trace" - - patch_file: "patches/cairo-1.17.4-trace-cflags-fix.patch" - patch_type: "conan" - patch_description: | - Add missing 'PACKAGE' and 'PACKAGE_VERSION' defines for libbfd headers included by 'lookup-symbol.c'. - base_path: "util/cairo-trace" - - patch_file: "patches/cairo-1.17.4-xlib-xrender-option.patch" - patch_type: "conan" - patch_description: >- - This patch adds option to enable or disable xlib-xrender component. - Without it 'xrender' is always required when 'xlib' option is enabled. @sh0 - - patch_file: "patches/cairo-1.17.4-symbol-lookup-backport.patch" - patch_type: "backport" - patch_description: "add symbol-lookup option to allow disabling bfd/libiberty usage" - patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/commit/e0cf7b869fb1c6b73cf4a9aad2fc8aea4ff1f6ee" - - patch_file: "patches/cairo-1.17.4-encoding-backport.patch" - patch_type: "backport" - patch_description: "use encoding=utf-8 when reading/writing files in helper script" - patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/commit/9732f4e80f906fab85b97ae55ee44bfd3ee4945e" diff --git a/recipes/cairo/meson/conanfile.py b/recipes/cairo/meson/conanfile.py deleted file mode 100644 index 76c7813fd5b69..0000000000000 --- a/recipes/cairo/meson/conanfile.py +++ /dev/null @@ -1,347 +0,0 @@ -import glob -import os - -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.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.gnu import PkgConfigDeps -from conan.tools.layout import basic_layout -from conan.tools.meson import MesonToolchain, Meson -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conan.tools.scm import Version - -required_conan_version = ">=1.53.0" - - -class CairoConan(ConanFile): - name = "cairo" - description = "Cairo is a 2D graphics library with support for multiple output devices" - topics = ("cairo", "graphics") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://cairographics.org/" - license = ("LGPL-2.1-only", "MPL-1.1") - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - "with_freetype": [True, False], - "with_fontconfig": [True, False], - "with_xlib": [True, False], - "with_xlib_xrender": [True, False], - "with_xcb": [True, False], - "with_glib": [True, False], - "with_lzo": [True, False], - "with_zlib": [True, False], - "with_png": [True, False], - "with_opengl": [False, "desktop", "gles2", "gles3"], - "with_symbol_lookup": [True, False], - "tee": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - "with_freetype": True, - "with_fontconfig": True, - "with_xlib": True, - "with_xlib_xrender": True, - "with_xcb": True, - "with_glib": True, - "with_lzo": True, - "with_zlib": True, - "with_png": True, - "with_opengl": "desktop", - "with_symbol_lookup": False, - "tee": False, - } - short_paths = 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": - del self.options.fPIC - 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 Version(self.version) >= "1.17.8" or self.settings.os == "Windows" or is_apple_os(self): - del self.options.with_opengl - - 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("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.11 <2]") - if self.options.with_freetype: - self.requires("freetype/2.13.2", transitive_headers=True, transitive_libs=True) - if self.options.with_fontconfig: - self.requires("fontconfig/2.14.2", transitive_headers=True, transitive_libs=True) - if self.options.with_png: - self.requires("libpng/1.6.40") - if self.options.with_glib: - self.requires("glib/2.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", transitive_headers=True, transitive_libs=True) - if self.options.get_safe("with_opengl") == "desktop": - 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", 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"): - raise ConanInvalidConfiguration("'with_xlib_xrender' option requires 'with_xlib' option to be enabled as well!") - if self.options.with_glib: - if self.dependencies["glib"].options.shared: - if is_msvc_static_runtime(self): - raise ConanInvalidConfiguration( - "Linking shared glib with the MSVC static runtime is not supported" - ) - elif self.options.shared: - raise ConanInvalidConfiguration( - "Linking a shared library against static glib can cause unexpected behaviour." - ) - - def build_requirements(self): - self.tool_requires("meson/1.3.0") - 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): - def is_enabled(value): - return "enabled" if value else "disabled" - - env = VirtualBuildEnv(self) - env.generate() - - pkg_deps = PkgConfigDeps(self) - pkg_deps.generate() - - options = dict() - options["tests"] = "disabled" - options["zlib"] = is_enabled(self.options.with_zlib) - 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 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 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")) - - # future options to add, see meson_options.txt. - # for now, disabling explicitly, to avoid non-reproducible auto-detection of system libs - - version = Version(self.version) - if version < "1.17.6": - options["cogl"] = "disabled" # https://gitlab.gnome.org/GNOME/cogl - options["directfb"] = "disabled" - 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 in ["Linux", "FreeBSD"]: - options["xlib-xrender"] = is_enabled(self.options.with_xlib_xrender) - - options["gtk2-utils"] = "disabled" - options["spectre"] = "disabled" # https://www.freedesktop.org/wiki/Software/libspectre/ - - meson = MesonToolchain(self) - meson.project_options.update(options) - - if is_apple_os(self) and Version(self.version) < "1.17.6": - # This was fixed in the meson build from 1.17.6 - meson.c_link_args += ["-framework", "ApplicationServices", "-framework", "CoreFoundation"] - - if not self.options.shared: - meson.c_args.append("-DCAIRO_WIN32_STATIC_BUILD") - - meson.generate() - - def build(self): - apply_conandata_patches(self) - - # Dependency freetype2 found: NO found 2.11.0 but need: '>= 9.7.3' - if self.options.with_freetype: - replace_in_file(self, os.path.join(self.source_folder, "meson.build"), - "freetype_required_version = '>= 9.7.3'", - f"freetype_required_version = '>= {self.dependencies['freetype'].ref.version}'") - meson = Meson(self) - meson.configure() - meson.build() - - def _fix_library_names(self, path): - if is_msvc(self): - for filename_old in glob.glob(os.path.join(path, "*.a")): - root, _ = os.path.splitext(filename_old) - folder, basename = os.path.split(root) - rename(self, filename_old, os.path.join(folder, basename.replace("lib", "") + ".lib")) - - def package(self): - meson = Meson(self) - meson.install() - self._fix_library_names(os.path.join(self.package_folder, "lib")) - copy(self, "COPYING*", self.source_folder, os.path.join(self.package_folder, "licenses")) - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - fix_apple_shared_install_name(self) - - def package_info(self): - base_requirements = {"pixman::pixman"} - base_system_libs = {} - - def add_component_and_base_requirements(component, requirements, system_libs=None): - self.cpp_info.components[component].set_property("pkg_config_name", component) - self.cpp_info.components[component].requires += ["cairo_"] + requirements - base_requirements.update(set(requirements)) - if system_libs is not None: - self.cpp_info.components[component].system_libs += system_libs - base_system_libs.update(set(system_libs)) - - self.cpp_info.set_property("pkg_config_name", "cairo-all-do-no-use") - - self.cpp_info.components["cairo_"].set_property("pkg_config_name", "cairo") - self.cpp_info.components["cairo_"].libs = ["cairo"] - self.cpp_info.components["cairo_"].includedirs.insert(0, os.path.join("include", "cairo")) - - 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") - self.cpp_info.components["cairo_"].cflags = ["-pthread"] - self.cpp_info.components["cairo_"].cxxflags = ["-pthread"] - - if self.options.with_lzo: - self.cpp_info.components["cairo_"].requires.append("lzo::lzo") - - if self.options.with_zlib: - self.cpp_info.components["cairo_"].requires.append("zlib::zlib") - - if self.options.with_png: - add_component_and_base_requirements("cairo-png", ["libpng::libpng"]) - add_component_and_base_requirements("cairo-svg", ["libpng::libpng"]) - - if self.options.with_fontconfig: - add_component_and_base_requirements("cairo-fc", ["fontconfig::fontconfig"]) - - if self.options.with_freetype: - add_component_and_base_requirements("cairo-ft", ["freetype::freetype"]) - - if self.options.get_safe("with_xlib"): - add_component_and_base_requirements("cairo-xlib", ["xorg::x11", "xorg::xext"]) - - if self.options.get_safe("with_xlib_xrender"): - add_component_and_base_requirements("cairo-xlib-xrender", ["xorg::xrender"]) - - if self.options.get_safe("with_xcb"): - add_component_and_base_requirements("cairo-xcb", ["xorg::xcb", "xorg::xcb-render"]) - add_component_and_base_requirements("cairo-xcb-shm", ["xorg::xcb", "xorg::xcb-shm"]) - - if self.options.get_safe("with_xlib"): - add_component_and_base_requirements("cairo-xlib-xcb", ["xorg::x11-xcb"]) - - if is_apple_os(self): - self.cpp_info.components["cairo-quartz"].set_property("pkg_config_name", "cairo-quartz") - self.cpp_info.components["cairo-quartz"].requires = ["cairo_"] - - self.cpp_info.components["cairo-quartz-image"].set_property("pkg_config_name", "cairo-quartz-image") - self.cpp_info.components["cairo-quartz-image"].requires = ["cairo_"] - - self.cpp_info.components["cairo-quartz-font"].set_property("pkg_config_name", "cairo-quartz-font") - self.cpp_info.components["cairo-quartz-font"].requires = ["cairo_"] - - self.cpp_info.components["cairo_"].frameworks += ["ApplicationServices", "CoreFoundation", "CoreGraphics"] - - if self.settings.os == "Windows": - self.cpp_info.components["cairo-win32"].set_property("pkg_config_name", "cairo-win32") - self.cpp_info.components["cairo-win32"].requires = ["cairo_"] - - self.cpp_info.components["cairo-win32-font"].set_property("pkg_config_name", "cairo-win32-font") - self.cpp_info.components["cairo-win32-font"].requires = ["cairo_"] - - self.cpp_info.components["cairo_"].system_libs.extend(["gdi32", "msimg32", "user32"]) - - if not self.options.shared: - self.cpp_info.components["cairo_"].defines.append("CAIRO_WIN32_STATIC_BUILD=1") - - if self.options.get_safe("with_opengl"): - if self.options.with_opengl == "desktop": - add_component_and_base_requirements("cairo-gl", ["opengl::opengl"]) - - if self.settings.os in ["Linux", "FreeBSD"]: - add_component_and_base_requirements("cairo-glx", ["opengl::opengl"]) - - if self.settings.os == "Windows": - add_component_and_base_requirements("cairo-wgl", ["glext::glext", "wglext::wglext", "khrplatform::khrplatform"]) - - elif self.options.with_opengl == "gles3": - add_component_and_base_requirements("cairo-glesv3", [], ["GLESv2"]) - elif self.options.with_opengl == "gles2": - add_component_and_base_requirements("cairo-glesv2", [], ["GLESv2"]) - if self.settings.os in ["Linux", "FreeBSD"]: - add_component_and_base_requirements("cairo-egl", ["egl::egl"]) - - if self.options.with_zlib: - add_component_and_base_requirements("cairo-script", ["zlib::zlib"]) - add_component_and_base_requirements("cairo-ps", ["zlib::zlib"]) - add_component_and_base_requirements("cairo-pdf", ["zlib::zlib"]) - self.cpp_info.components["cairo-script-interpreter"].set_property("pkg_config_name", "cairo-script-interpreter") - self.cpp_info.components["cairo-script-interpreter"].libs = ["cairo-script-interpreter"] - self.cpp_info.components["cairo-script-interpreter"].requires = ["cairo_"] - - if self.options.with_png: - add_component_and_base_requirements("cairo-xml", ["zlib::zlib"]) - add_component_and_base_requirements("cairo-util_", ["expat::expat"]) - - if self.options.tee: - self.cpp_info.components["cairo-tee"].set_property("pkg_config_name", "cairo-tee") - self.cpp_info.components["cairo-tee"].requires = ["cairo_"] - - # util directory - if self.options.with_glib: - self.cpp_info.components["cairo-gobject"].set_property("pkg_config_name", "cairo-gobject") - self.cpp_info.components["cairo-gobject"].libs = ["cairo-gobject"] - self.cpp_info.components["cairo-gobject"].requires = ["cairo_", "glib::gobject-2.0", "glib::glib-2.0"] - - self.cpp_info.components["cairo_"].requires += list(base_requirements) - self.cpp_info.components["cairo_"].system_libs += list(base_system_libs) diff --git a/recipes/cairo/meson/patches/binutils-2.34-libbfd-fix.patch b/recipes/cairo/meson/patches/binutils-2.34-libbfd-fix.patch deleted file mode 100644 index 197f3fbc3cad0..0000000000000 --- a/recipes/cairo/meson/patches/binutils-2.34-libbfd-fix.patch +++ /dev/null @@ -1,43 +0,0 @@ -The libbfd issues were fixed in upstream with following commit: - - From e30259f6237571c61992433c110bc6e1ef900244 Mon Sep 17 00:00:00 2001 - From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= - Date: Tue, 23 Feb 2021 11:36:24 +0000 - Subject: cairo-trace: fix build with newer versions of bfd - - https://cgit.freedesktop.org/cairo/commit/?id=e30259f6237571c61992433c110bc6e1ef900244 - -Note that the upstream commit was more comprehensive, but cannot be directly -applied to 1.17.4 version. Any new cairo version beyond 1.17.4 will likely -not need this fix. - ---- lookup-symbol.c.original 2021-08-05 22:21:15.819998378 +0300 -+++ lookup-symbol.c 2021-08-05 22:26:05.212448342 +0300 -@@ -145,14 +145,26 @@ - if (symbol->found) - return; - -+#ifdef bfd_get_section_flags - if ((bfd_get_section_flags (symtab->bfd, section) & SEC_ALLOC) == 0) -+#else -+ if ((bfd_section_flags (section) & SEC_ALLOC) == 0) -+#endif - return; - -+#ifdef bfd_get_section_vma - vma = bfd_get_section_vma (symtab->bfd, section); -+#else -+ vma = bfd_section_vma (section); -+#endif - if (symbol->pc < vma) - return; - -- size = bfd_section_size (symtab->bfd, section); -+#ifdef bfd_get_section_size -+ size = bfd_get_section_size (section); -+#else -+ size = bfd_section_size (section); -+#endif - if (symbol->pc >= vma + size) - return; - diff --git a/recipes/cairo/meson/test_package/CMakeLists.txt b/recipes/cairo/meson/test_package/CMakeLists.txt deleted file mode 100644 index 83adc4effa23e..0000000000000 --- a/recipes/cairo/meson/test_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package C) - -find_package(cairo CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE cairo::cairo) diff --git a/recipes/cairo/meson/test_package/conanfile.py b/recipes/cairo/meson/test_package/conanfile.py deleted file mode 100644 index e904c93b97465..0000000000000 --- a/recipes/cairo/meson/test_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -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 = "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/cairo/meson/test_package/test_package.c b/recipes/cairo/meson/test_package/test_package.c deleted file mode 100644 index 5854291cea177..0000000000000 --- a/recipes/cairo/meson/test_package/test_package.c +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include - -#if defined(WIN32) && CAIRO_HAS_WIN32_SURFACE && CAIRO_HAS_WIN32_FONT - -#include -#include - -#endif - -int main() -{ -#if defined(WIN32) && CAIRO_HAS_WIN32_SURFACE && CAIRO_HAS_WIN32_FONT - - HDC hDC = GetDC(0); - if (hDC) - { - cairo_surface_t * surface = cairo_win32_surface_create(hDC); - if (surface) - { - HFONT hFont = (HFONT)GetStockObject(SYSTEM_FONT); - cairo_font_face_t* font = cairo_win32_font_face_create_for_hfont(hFont); - if (font) - cairo_font_face_destroy(font); - - cairo_surface_destroy(surface); - } - ReleaseDC(0, hDC); - } -#endif - - printf("cairo version is %s\n", cairo_version_string()); - - return 0; -} diff --git a/recipes/cairo/meson/test_v1_package/CMakeLists.txt b/recipes/cairo/meson/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cairo/meson/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cairo/meson/test_v1_package/conanfile.py b/recipes/cairo/meson/test_v1_package/conanfile.py deleted file mode 100644 index 24f9e474d6cd2..0000000000000 --- a/recipes/cairo/meson/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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, skip_x64_x86=True): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - diff --git a/recipes/cairomm/all/conanfile.py b/recipes/cairomm/all/conanfile.py index 96f403d024d1e..4380e40cd818e 100644 --- a/recipes/cairomm/all/conanfile.py +++ b/recipes/cairomm/all/conanfile.py @@ -4,7 +4,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import is_apple_os +from conan.tools.apple import fix_apple_shared_install_name, 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 @@ -58,7 +58,7 @@ def layout(self): def requirements(self): self.requires("cairo/1.18.0", transitive_headers=True, transitive_libs=True) - self.requires("fontconfig/2.14.2", transitive_headers=True, transitive_libs=True) + self.requires("fontconfig/2.15.0", 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: @@ -76,9 +76,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -140,6 +140,8 @@ def package(self): for dir_to_remove in ["pkgconfig", f"cairomm-{self._abi_version}"]: rmdir(self, os.path.join(self.package_folder, "lib", dir_to_remove)) + fix_apple_shared_install_name(self) + def package_info(self): name = f"cairomm-{self._abi_version}" self.cpp_info.components[name].set_property("pkg_config_name", name) diff --git a/recipes/cairomm/all/test_v1_package/CMakeLists.txt b/recipes/cairomm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cairomm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index a691174f8ed16..0000000000000 --- a/recipes/cairomm/all/test_v1_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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - diff --git a/recipes/cajun-jsonapi/all/test_package/CMakeLists.txt b/recipes/cajun-jsonapi/all/test_package/CMakeLists.txt index 6361de2a69cab..c040404ab5631 100644 --- a/recipes/cajun-jsonapi/all/test_package/CMakeLists.txt +++ b/recipes/cajun-jsonapi/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(cajun-jsonapi REQUIRED) diff --git a/recipes/cajun-jsonapi/all/test_v1_package/CMakeLists.txt b/recipes/cajun-jsonapi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7ea0378c83fe1..0000000000000 --- a/recipes/cajun-jsonapi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/cajun-jsonapi/all/test_v1_package/conanfile.py b/recipes/cajun-jsonapi/all/test_v1_package/conanfile.py deleted file mode 100644 index e065617c053bc..0000000000000 --- a/recipes/cajun-jsonapi/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -from conans import ConanFile, CMake, tools, RunEnvironment -import os - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - - 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/calceph/all/conandata.yml b/recipes/calceph/all/conandata.yml index f4d850c349cf0..ccee59129b991 100644 --- a/recipes/calceph/all/conandata.yml +++ b/recipes/calceph/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.5.5": + url: "https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.5.5.tar.gz" + sha256: "f7acf529a9267793126d7fdbdf79d4d26ae33274c99d09a9fc9d6191a3c72aca" "3.5.1": url: "https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.5.1.tar.gz" sha256: "33cc0be1b8ffb647aff9d3ac1cf025e460451e00144050d3bbc4f13bceb11c1d" diff --git a/recipes/calceph/all/conanfile.py b/recipes/calceph/all/conanfile.py index fda6184d24ab9..cd9be15961cb0 100644 --- a/recipes/calceph/all/conanfile.py +++ b/recipes/calceph/all/conanfile.py @@ -1,5 +1,4 @@ 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 chdir, copy, get, replace_in_file, rm, rmdir @@ -15,11 +14,12 @@ class CalcephConan(ConanFile): name = "calceph" description = "C Library designed to access the binary planetary ephemeris " \ "files, such INPOPxx, JPL DExxx and SPICE ephemeris files." - license = ["CECILL-C", "CECILL-B", "CECILL-2.1"] + license = ("CECILL-C", "CECILL-B", "CECILL-2.1") topics = ("ephemeris", "astronomy", "space", "planet") homepage = "https://www.imcce.fr/inpop/calceph" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -43,7 +43,10 @@ def config_options(self): del self.options.threadsafe 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") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") @@ -51,10 +54,6 @@ def configure(self): 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 shared builds with Visual Studio yet") - def build_requirements(self): if self._settings_build.os == "Windows" and not is_msvc(self): self.win_bash = True diff --git a/recipes/calceph/all/test_package/CMakeLists.txt b/recipes/calceph/all/test_package/CMakeLists.txt index 5c6dc64f12782..a2dac7876fb23 100644 --- a/recipes/calceph/all/test_package/CMakeLists.txt +++ b/recipes/calceph/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(calceph REQUIRED CONFIG) diff --git a/recipes/calceph/all/test_v1_package/CMakeLists.txt b/recipes/calceph/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/calceph/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/calceph/all/test_v1_package/conanfile.py b/recipes/calceph/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/calceph/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_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/calceph/config.yml b/recipes/calceph/config.yml index 8843656f63225..6a2ba2d0468ee 100644 --- a/recipes/calceph/config.yml +++ b/recipes/calceph/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.5": + folder: all "3.5.1": folder: all "3.5.0": diff --git a/recipes/canary/all/test_package/CMakeLists.txt b/recipes/canary/all/test_package/CMakeLists.txt index 81f2b230ac92c..50c6682a67fa3 100644 --- a/recipes/canary/all/test_package/CMakeLists.txt +++ b/recipes/canary/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(canary REQUIRED) diff --git a/recipes/canary/all/test_v1_package/CMakeLists.txt b/recipes/canary/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 81f2b230ac92c..0000000000000 --- a/recipes/canary/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) - -find_package(canary REQUIRED) - -add_executable(test_package test_package.cpp) -target_link_libraries(test_package PUBLIC canary::canary) -target_compile_features(test_package PRIVATE cxx_std_11) diff --git a/recipes/canary/all/test_v1_package/conanfile.py b/recipes/canary/all/test_v1_package/conanfile.py deleted file mode 100644 index f8bae5c00ce0a..0000000000000 --- a/recipes/canary/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -import os - -from conans import CMake, ConanFile, tools - - -class TestPackage(ConanFile): - settings = "os", "compiler", "build_type", "arch" - 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(".", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/canary/all/test_v1_package/test_package.cpp b/recipes/canary/all/test_v1_package/test_package.cpp deleted file mode 100644 index ccec8d0783be7..0000000000000 --- a/recipes/canary/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -int main() -{ - try { - auto index = canary::get_interface_index("vcan0"); - std::cout << "vcan0 interface index: " << index << "\n"; - } - catch (std::exception& exc) { - std::cout << "unable to find vcan0: " << exc.what() << "\n"; - } - - return 0; -} diff --git a/recipes/canvas_ity/all/test_package/CMakeLists.txt b/recipes/canvas_ity/all/test_package/CMakeLists.txt index d050dc832dd0b..66230fba6b55c 100644 --- a/recipes/canvas_ity/all/test_package/CMakeLists.txt +++ b/recipes/canvas_ity/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(canvas_ity REQUIRED CONFIG) diff --git a/recipes/canvas_ity/all/test_v1_package/CMakeLists.txt b/recipes/canvas_ity/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/canvas_ity/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/canvas_ity/all/test_v1_package/conanfile.py b/recipes/canvas_ity/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/canvas_ity/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/capnproto/all/conandata.yml b/recipes/capnproto/all/conandata.yml index e635b41da8f05..c893479a0fa87 100644 --- a/recipes/capnproto/all/conandata.yml +++ b/recipes/capnproto/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.1.0": + url: "https://github.com/capnproto/capnproto/archive/v1.1.0.tar.gz" + sha256: "c0a0d78a07e821f7bae26c7fcac20a9202eb3d639a673b2606b76092a1f35b6b" + "1.0.2": + url: "https://github.com/capnproto/capnproto/archive/v1.0.2.tar.gz" + sha256: "3cfd0ed58080d78b3a3381305489f2175cdaf1ef1cb55425d8fc8246a76bdff3" "1.0.1": url: "https://github.com/capnproto/capnproto/archive/v1.0.1.tar.gz" sha256: "5bdb16f6b389a9e29b04214b9bae1759e8b7fe2b45049d7e3f1f286ba050a200" @@ -27,6 +33,14 @@ sources: url: "https://github.com/capnproto/capnproto/archive/v0.7.0.tar.gz" sha256: "76c7114a3d142ad08b7208b3964a26e72a6320ee81331d3f0b87569fc9c47a28" patches: + "1.1.0": + - patch_file: "patches/0015-disable-tests-for-1.0.0.patch" + patch_description: "disable test build" + patch_type: "conan" + "1.0.2": + - patch_file: "patches/0015-disable-tests-for-1.0.0.patch" + patch_description: "disable test build" + patch_type: "conan" "1.0.1": - patch_file: "patches/0015-disable-tests-for-1.0.0.patch" patch_description: "disable test build" diff --git a/recipes/capnproto/all/conanfile.py b/recipes/capnproto/all/conanfile.py index 591f5effa85d6..72ebf7b50b400 100644 --- a/recipes/capnproto/all/conanfile.py +++ b/recipes/capnproto/all/conanfile.py @@ -13,7 +13,7 @@ import os import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class CapnprotoConan(ConanFile): @@ -52,10 +52,6 @@ def _minimum_compilers_version(self): "apple-clang": "5.1", } - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - def export_sources(self): export_conandata_patches(self) @@ -101,7 +97,7 @@ def validate(self): def build_requirements(self): if self.settings.os != "Windows": self.tool_requires("libtool/2.4.7") - if self._settings_build.os == "Windows": + 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") @@ -116,6 +112,8 @@ def generate(self): tc.variables["EXTERNAL_CAPNP"] = False tc.variables["CAPNP_LITE"] = False tc.variables["WITH_OPENSSL"] = self.options.with_openssl + if Version(self.version) < "2": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support (v2 branch does not need this) tc.generate() deps = CMakeDeps(self) deps.generate() @@ -238,9 +236,3 @@ def package_info(self): 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] - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/capnproto/all/test_package/CMakeLists.txt b/recipes/capnproto/all/test_package/CMakeLists.txt index 8ffc65e9ffa4b..5e0d93f57dde5 100644 --- a/recipes/capnproto/all/test_package/CMakeLists.txt +++ b/recipes/capnproto/all/test_package/CMakeLists.txt @@ -3,19 +3,9 @@ project(test_package LANGUAGES CXX) find_package(CapnProto REQUIRED capnp capnp-rpc CONFIG) -capnp_generate_cpp(addressbookSources addressbookHeaders addressbook.capnp) -add_executable(addressbook addressbook.c++ ${addressbookSources}) + +add_executable(addressbook test_package.c++ ${addressbookSources}) target_include_directories(addressbook PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(addressbook PRIVATE CapnProto::capnp) target_compile_features(addressbook PRIVATE cxx_std_14) -capnp_generate_cpp(calculatorSources calculatorHeaders calculator.capnp) -add_library(calculator_protocol STATIC ${calculatorSources}) -target_include_directories(calculator_protocol PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(calculator_protocol PUBLIC CapnProto::capnp-rpc) -target_compile_features(calculator_protocol PUBLIC cxx_std_14) - -add_executable(calculator-client calculator-client.c++) -target_link_libraries(calculator-client PRIVATE calculator_protocol) -add_executable(calculator-server calculator-server.c++) -target_link_libraries(calculator-server PRIVATE calculator_protocol) diff --git a/recipes/capnproto/all/test_package/addressbook.c++ b/recipes/capnproto/all/test_package/addressbook.c++ deleted file mode 100644 index b2bece9472b88..0000000000000 --- a/recipes/capnproto/all/test_package/addressbook.c++ +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// This sample code appears in the documentation for the C++ implementation. -// -// If Cap'n Proto is installed, build the sample like: -// capnp compile -oc++ addressbook.capnp -// c++ -std=c++14 -Wall addressbook.c++ addressbook.capnp.c++ `pkg-config --cflags --libs capnp` -o addressbook -// -// If Cap'n Proto is not installed, but the source is located at $SRC and has been -// compiled in $BUILD (often both are simply ".." from here), you can do: -// $BUILD/capnp compile -I$SRC/src -o$BUILD/capnpc-c++ addressbook.capnp -// c++ -std=c++14 -Wall addressbook.c++ addressbook.capnp.c++ -I$SRC/src -L$BUILD/.libs -lcapnp -lkj -o addressbook -// -// Run like: -// ./addressbook write | ./addressbook read -// Use "dwrite" and "dread" to use dynamic code instead. - -// TODO(test): Needs cleanup. - -#include "addressbook.capnp.h" -#include -#include -#include - -using addressbook::Person; -using addressbook::AddressBook; - -void writeAddressBook(int fd) { - ::capnp::MallocMessageBuilder message; - - AddressBook::Builder addressBook = message.initRoot(); - ::capnp::List::Builder people = addressBook.initPeople(2); - - Person::Builder alice = people[0]; - alice.setId(123); - alice.setName("Alice"); - alice.setEmail("alice@example.com"); - // Type shown for explanation purposes; normally you'd use auto. - ::capnp::List::Builder alicePhones = - alice.initPhones(1); - alicePhones[0].setNumber("555-1212"); - alicePhones[0].setType(Person::PhoneNumber::Type::MOBILE); - alice.getEmployment().setSchool("MIT"); - - Person::Builder bob = people[1]; - bob.setId(456); - bob.setName("Bob"); - bob.setEmail("bob@example.com"); - auto bobPhones = bob.initPhones(2); - bobPhones[0].setNumber("555-4567"); - bobPhones[0].setType(Person::PhoneNumber::Type::HOME); - bobPhones[1].setNumber("555-7654"); - bobPhones[1].setType(Person::PhoneNumber::Type::WORK); - bob.getEmployment().setUnemployed(); - - writePackedMessageToFd(fd, message); -} - -void printAddressBook(int fd) { - ::capnp::PackedFdMessageReader message(fd); - - AddressBook::Reader addressBook = message.getRoot(); - - for (Person::Reader person : addressBook.getPeople()) { - std::cout << person.getName().cStr() << ": " - << person.getEmail().cStr() << std::endl; - for (Person::PhoneNumber::Reader phone: person.getPhones()) { - const char* typeName = "UNKNOWN"; - switch (phone.getType()) { - case Person::PhoneNumber::Type::MOBILE: typeName = "mobile"; break; - case Person::PhoneNumber::Type::HOME: typeName = "home"; break; - case Person::PhoneNumber::Type::WORK: typeName = "work"; break; - } - std::cout << " " << typeName << " phone: " - << phone.getNumber().cStr() << std::endl; - } - Person::Employment::Reader employment = person.getEmployment(); - switch (employment.which()) { - case Person::Employment::UNEMPLOYED: - std::cout << " unemployed" << std::endl; - break; - case Person::Employment::EMPLOYER: - std::cout << " employer: " - << employment.getEmployer().cStr() << std::endl; - break; - case Person::Employment::SCHOOL: - std::cout << " student at: " - << employment.getSchool().cStr() << std::endl; - break; - case Person::Employment::SELF_EMPLOYED: - std::cout << " self-employed" << std::endl; - break; - } - } -} - -#if !CAPNP_LITE - -#include "addressbook.capnp.h" -#include -#include -#include -#include -#include - -using ::capnp::DynamicValue; -using ::capnp::DynamicStruct; -using ::capnp::DynamicEnum; -using ::capnp::DynamicList; -using ::capnp::List; -using ::capnp::Schema; -using ::capnp::StructSchema; -using ::capnp::EnumSchema; - -using ::capnp::Void; -using ::capnp::Text; -using ::capnp::MallocMessageBuilder; -using ::capnp::PackedFdMessageReader; - -void dynamicWriteAddressBook(int fd, StructSchema schema) { - // Write a message using the dynamic API to set each - // field by text name. This isn't something you'd - // normally want to do; it's just for illustration. - - MallocMessageBuilder message; - - // Types shown for explanation purposes; normally you'd - // use auto. - DynamicStruct::Builder addressBook = - message.initRoot(schema); - - DynamicList::Builder people = - addressBook.init("people", 2).as(); - - DynamicStruct::Builder alice = - people[0].as(); - alice.set("id", 123); - alice.set("name", "Alice"); - alice.set("email", "alice@example.com"); - auto alicePhones = alice.init("phones", 1).as(); - auto phone0 = alicePhones[0].as(); - phone0.set("number", "555-1212"); - phone0.set("type", "mobile"); - alice.get("employment").as() - .set("school", "MIT"); - - auto bob = people[1].as(); - bob.set("id", 456); - bob.set("name", "Bob"); - bob.set("email", "bob@example.com"); - - // Some magic: We can convert a dynamic sub-value back to - // the native type with as()! - List::Builder bobPhones = - bob.init("phones", 2).as>(); - bobPhones[0].setNumber("555-4567"); - bobPhones[0].setType(Person::PhoneNumber::Type::HOME); - bobPhones[1].setNumber("555-7654"); - bobPhones[1].setType(Person::PhoneNumber::Type::WORK); - bob.get("employment").as() - .set("unemployed", ::capnp::VOID); - - writePackedMessageToFd(fd, message); -} - -void dynamicPrintValue(DynamicValue::Reader value) { - // Print an arbitrary message via the dynamic API by - // iterating over the schema. Look at the handling - // of STRUCT in particular. - - switch (value.getType()) { - case DynamicValue::VOID: - std::cout << ""; - break; - case DynamicValue::BOOL: - std::cout << (value.as() ? "true" : "false"); - break; - case DynamicValue::INT: - std::cout << value.as(); - break; - case DynamicValue::UINT: - std::cout << value.as(); - break; - case DynamicValue::FLOAT: - std::cout << value.as(); - break; - case DynamicValue::TEXT: - std::cout << '\"' << value.as().cStr() << '\"'; - break; - case DynamicValue::LIST: { - std::cout << "["; - bool first = true; - for (auto element: value.as()) { - if (first) { - first = false; - } else { - std::cout << ", "; - } - dynamicPrintValue(element); - } - std::cout << "]"; - break; - } - case DynamicValue::ENUM: { - auto enumValue = value.as(); - KJ_IF_MAYBE(enumerant, enumValue.getEnumerant()) { - std::cout << - enumerant->getProto().getName().cStr(); - } else { - // Unknown enum value; output raw number. - std::cout << enumValue.getRaw(); - } - break; - } - case DynamicValue::STRUCT: { - std::cout << "("; - auto structValue = value.as(); - bool first = true; - for (auto field: structValue.getSchema().getFields()) { - if (!structValue.has(field)) continue; - if (first) { - first = false; - } else { - std::cout << ", "; - } - std::cout << field.getProto().getName().cStr() - << " = "; - dynamicPrintValue(structValue.get(field)); - } - std::cout << ")"; - break; - } - default: - // There are other types, we aren't handling them. - std::cout << "?"; - break; - } -} - -void dynamicPrintMessage(int fd, StructSchema schema) { - PackedFdMessageReader message(fd); - dynamicPrintValue(message.getRoot(schema)); - std::cout << std::endl; -} - -#endif // !CAPNP_LITE - -int main(int argc, char* argv[]) { - if (argc != 2) { - std::cerr << "Missing arg." << std::endl; - return 1; - } else if (strcmp(argv[1], "write") == 0) { - writeAddressBook(1); - } else if (strcmp(argv[1], "read") == 0) { - printAddressBook(0); -#if !CAPNP_LITE - } else if (strcmp(argv[1], "dwrite") == 0) { - StructSchema schema = Schema::from(); - dynamicWriteAddressBook(1, schema); - } else if (strcmp(argv[1], "dread") == 0) { - StructSchema schema = Schema::from(); - dynamicPrintMessage(0, schema); -#endif - } else { - std::cerr << "Invalid arg: " << argv[1] << std::endl; - return 1; - } - return 0; -} diff --git a/recipes/capnproto/all/test_package/addressbook.capnp b/recipes/capnproto/all/test_package/addressbook.capnp deleted file mode 100644 index 1a6c60937e8af..0000000000000 --- a/recipes/capnproto/all/test_package/addressbook.capnp +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -# Licensed under the MIT License: -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -@0x9eb32e19f86ee174; - -using Cxx = import "/capnp/c++.capnp"; -$Cxx.namespace("addressbook"); - -struct Person { - id @0 :UInt32; - name @1 :Text; - email @2 :Text; - phones @3 :List(PhoneNumber); - - struct PhoneNumber { - number @0 :Text; - type @1 :Type; - - enum Type { - mobile @0; - home @1; - work @2; - } - } - - employment :union { - unemployed @4 :Void; - employer @5 :Text; - school @6 :Text; - selfEmployed @7 :Void; - # We assume that a person is only one of these. - } -} - -struct AddressBook { - people @0 :List(Person); -} diff --git a/recipes/capnproto/all/test_package/calculator-client.c++ b/recipes/capnproto/all/test_package/calculator-client.c++ deleted file mode 100644 index 5d8452921cde9..0000000000000 --- a/recipes/capnproto/all/test_package/calculator-client.c++ +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include "calculator.capnp.h" -#include -#include -#include -#include - -class PowerFunction final: public Calculator::Function::Server { - // An implementation of the Function interface wrapping pow(). Note that - // we're implementing this on the client side and will pass a reference to - // the server. The server will then be able to make calls back to the client. - -public: - kj::Promise call(CallContext context) { - auto params = context.getParams().getParams(); - KJ_REQUIRE(params.size() == 2, "Wrong number of parameters."); - context.getResults().setValue(pow(params[0], params[1])); - return kj::READY_NOW; - } -}; - -int main(int argc, const char* argv[]) { - if (argc != 2) { - std::cerr << "usage: " << argv[0] << " HOST:PORT\n" - "Connects to the Calculator server at the given address and " - "does some RPCs." << std::endl; - return 1; - } - - capnp::EzRpcClient client(argv[1]); - Calculator::Client calculator = client.getMain(); - - // Keep an eye on `waitScope`. Whenever you see it used is a place where we - // stop and wait for the server to respond. If a line of code does not use - // `waitScope`, then it does not block! - auto& waitScope = client.getWaitScope(); - - { - // Make a request that just evaluates the literal value 123. - // - // What's interesting here is that evaluate() returns a "Value", which is - // another interface and therefore points back to an object living on the - // server. We then have to call read() on that object to read it. - // However, even though we are making two RPC's, this block executes in - // *one* network round trip because of promise pipelining: we do not wait - // for the first call to complete before we send the second call to the - // server. - - std::cout << "Evaluating a literal... "; - std::cout.flush(); - - // Set up the request. - auto request = calculator.evaluateRequest(); - request.getExpression().setLiteral(123); - - // Send it, which returns a promise for the result (without blocking). - auto evalPromise = request.send(); - - // Using the promise, create a pipelined request to call read() on the - // returned object, and then send that. - auto readPromise = evalPromise.getValue().readRequest().send(); - - // Now that we've sent all the requests, wait for the response. Until this - // point, we haven't waited at all! - auto response = readPromise.wait(waitScope); - KJ_ASSERT(response.getValue() == 123); - - std::cout << "PASS" << std::endl; - } - - { - // Make a request to evaluate 123 + 45 - 67. - // - // The Calculator interface requires that we first call getOperator() to - // get the addition and subtraction functions, then call evaluate() to use - // them. But, once again, we can get both functions, call evaluate(), and - // then read() the result -- four RPCs -- in the time of *one* network - // round trip, because of promise pipelining. - - std::cout << "Using add and subtract... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - Calculator::Function::Client subtract = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - { - // Get the "subtract" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::SUBTRACT); - subtract = request.send().getFunc(); - } - - // Build the request to evaluate 123 + 45 - 67. - auto request = calculator.evaluateRequest(); - - auto subtractCall = request.getExpression().initCall(); - subtractCall.setFunction(subtract); - auto subtractParams = subtractCall.initParams(2); - subtractParams[1].setLiteral(67); - - auto addCall = subtractParams[0].initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[0].setLiteral(123); - addParams[1].setLiteral(45); - - // Send the evaluate() request, read() the result, and wait for read() to - // finish. - auto evalPromise = request.send(); - auto readPromise = evalPromise.getValue().readRequest().send(); - - auto response = readPromise.wait(waitScope); - KJ_ASSERT(response.getValue() == 101); - - std::cout << "PASS" << std::endl; - } - - { - // Make a request to evaluate 4 * 6, then use the result in two more - // requests that add 3 and 5. - // - // Since evaluate() returns its result wrapped in a `Value`, we can pass - // that `Value` back to the server in subsequent requests before the first - // `evaluate()` has actually returned. Thus, this example again does only - // one network round trip. - - std::cout << "Pipelining eval() calls... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - Calculator::Function::Client multiply = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - { - // Get the "multiply" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::MULTIPLY); - multiply = request.send().getFunc(); - } - - // Build the request to evaluate 4 * 6 - auto request = calculator.evaluateRequest(); - - auto multiplyCall = request.getExpression().initCall(); - multiplyCall.setFunction(multiply); - auto multiplyParams = multiplyCall.initParams(2); - multiplyParams[0].setLiteral(4); - multiplyParams[1].setLiteral(6); - - auto multiplyResult = request.send().getValue(); - - // Use the result in two calls that add 3 and add 5. - - auto add3Request = calculator.evaluateRequest(); - auto add3Call = add3Request.getExpression().initCall(); - add3Call.setFunction(add); - auto add3Params = add3Call.initParams(2); - add3Params[0].setPreviousResult(multiplyResult); - add3Params[1].setLiteral(3); - auto add3Promise = add3Request.send().getValue().readRequest().send(); - - auto add5Request = calculator.evaluateRequest(); - auto add5Call = add5Request.getExpression().initCall(); - add5Call.setFunction(add); - auto add5Params = add5Call.initParams(2); - add5Params[0].setPreviousResult(multiplyResult); - add5Params[1].setLiteral(5); - auto add5Promise = add5Request.send().getValue().readRequest().send(); - - // Now wait for the results. - KJ_ASSERT(add3Promise.wait(waitScope).getValue() == 27); - KJ_ASSERT(add5Promise.wait(waitScope).getValue() == 29); - - std::cout << "PASS" << std::endl; - } - - { - // Our calculator interface supports defining functions. Here we use it - // to define two functions and then make calls to them as follows: - // - // f(x, y) = x * 100 + y - // g(x) = f(x, x + 1) * 2; - // f(12, 34) - // g(21) - // - // Once again, the whole thing takes only one network round trip. - - std::cout << "Defining functions... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - Calculator::Function::Client multiply = nullptr; - Calculator::Function::Client f = nullptr; - Calculator::Function::Client g = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - { - // Get the "multiply" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::MULTIPLY); - multiply = request.send().getFunc(); - } - - { - // Define f. - auto request = calculator.defFunctionRequest(); - request.setParamCount(2); - - { - // Build the function body. - auto addCall = request.getBody().initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[1].setParameter(1); // y - - auto multiplyCall = addParams[0].initCall(); - multiplyCall.setFunction(multiply); - auto multiplyParams = multiplyCall.initParams(2); - multiplyParams[0].setParameter(0); // x - multiplyParams[1].setLiteral(100); - } - - f = request.send().getFunc(); - } - - { - // Define g. - auto request = calculator.defFunctionRequest(); - request.setParamCount(1); - - { - // Build the function body. - auto multiplyCall = request.getBody().initCall(); - multiplyCall.setFunction(multiply); - auto multiplyParams = multiplyCall.initParams(2); - multiplyParams[1].setLiteral(2); - - auto fCall = multiplyParams[0].initCall(); - fCall.setFunction(f); - auto fParams = fCall.initParams(2); - fParams[0].setParameter(0); - - auto addCall = fParams[1].initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[0].setParameter(0); - addParams[1].setLiteral(1); - } - - g = request.send().getFunc(); - } - - // OK, we've defined all our functions. Now create our eval requests. - - // f(12, 34) - auto fEvalRequest = calculator.evaluateRequest(); - auto fCall = fEvalRequest.initExpression().initCall(); - fCall.setFunction(f); - auto fParams = fCall.initParams(2); - fParams[0].setLiteral(12); - fParams[1].setLiteral(34); - auto fEvalPromise = fEvalRequest.send().getValue().readRequest().send(); - - // g(21) - auto gEvalRequest = calculator.evaluateRequest(); - auto gCall = gEvalRequest.initExpression().initCall(); - gCall.setFunction(g); - gCall.initParams(1)[0].setLiteral(21); - auto gEvalPromise = gEvalRequest.send().getValue().readRequest().send(); - - // Wait for the results. - KJ_ASSERT(fEvalPromise.wait(waitScope).getValue() == 1234); - KJ_ASSERT(gEvalPromise.wait(waitScope).getValue() == 4244); - - std::cout << "PASS" << std::endl; - } - - { - // Make a request that will call back to a function defined locally. - // - // Specifically, we will compute 2^(4 + 5). However, exponent is not - // defined by the Calculator server. So, we'll implement the Function - // interface locally and pass it to the server for it to use when - // evaluating the expression. - // - // This example requires two network round trips to complete, because the - // server calls back to the client once before finishing. In this - // particular case, this could potentially be optimized by using a tail - // call on the server side -- see CallContext::tailCall(). However, to - // keep the example simpler, we haven't implemented this optimization in - // the sample server. - - std::cout << "Using a callback... "; - std::cout.flush(); - - Calculator::Function::Client add = nullptr; - - { - // Get the "add" function from the server. - auto request = calculator.getOperatorRequest(); - request.setOp(Calculator::Operator::ADD); - add = request.send().getFunc(); - } - - // Build the eval request for 2^(4+5). - auto request = calculator.evaluateRequest(); - - auto powCall = request.getExpression().initCall(); - powCall.setFunction(kj::heap()); - auto powParams = powCall.initParams(2); - powParams[0].setLiteral(2); - - auto addCall = powParams[1].initCall(); - addCall.setFunction(add); - auto addParams = addCall.initParams(2); - addParams[0].setLiteral(4); - addParams[1].setLiteral(5); - - // Send the request and wait. - auto response = request.send().getValue().readRequest() - .send().wait(waitScope); - KJ_ASSERT(response.getValue() == 512); - - std::cout << "PASS" << std::endl; - } - - return 0; -} diff --git a/recipes/capnproto/all/test_package/calculator-server.c++ b/recipes/capnproto/all/test_package/calculator-server.c++ deleted file mode 100644 index c2593be3a9064..0000000000000 --- a/recipes/capnproto/all/test_package/calculator-server.c++ +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -// Licensed under the MIT License: -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include "calculator.capnp.h" -#include -#include -#include -#include - -typedef unsigned int uint; - -kj::Promise readValue(Calculator::Value::Client value) { - // Helper function to asynchronously call read() on a Calculator::Value and - // return a promise for the result. (In the future, the generated code might - // include something like this automatically.) - - return value.readRequest().send() - .then([](capnp::Response result) { - return result.getValue(); - }); -} - -kj::Promise evaluateImpl( - Calculator::Expression::Reader expression, - capnp::List::Reader params = capnp::List::Reader()) { - // Implementation of CalculatorImpl::evaluate(), also shared by - // FunctionImpl::call(). In the latter case, `params` are the parameter - // values passed to the function; in the former case, `params` is just an - // empty list. - - switch (expression.which()) { - case Calculator::Expression::LITERAL: - return expression.getLiteral(); - - case Calculator::Expression::PREVIOUS_RESULT: - return readValue(expression.getPreviousResult()); - - case Calculator::Expression::PARAMETER: { - KJ_REQUIRE(expression.getParameter() < params.size(), - "Parameter index out-of-range."); - return params[expression.getParameter()]; - } - - case Calculator::Expression::CALL: { - auto call = expression.getCall(); - auto func = call.getFunction(); - - // Evaluate each parameter. - kj::Array> paramPromises = - KJ_MAP(param, call.getParams()) { - return evaluateImpl(param, params); - }; - - // Join the array of promises into a promise for an array. - kj::Promise> joinedParams = - kj::joinPromises(kj::mv(paramPromises)); - - // When the parameters are complete, call the function. - return joinedParams.then([KJ_CPCAP(func)](kj::Array&& paramValues) mutable { - auto request = func.callRequest(); - request.setParams(paramValues); - return request.send().then( - [](capnp::Response&& result) { - return result.getValue(); - }); - }); - } - - default: - // Throw an exception. - KJ_FAIL_REQUIRE("Unknown expression type."); - } -} - -class ValueImpl final: public Calculator::Value::Server { - // Simple implementation of the Calculator.Value Cap'n Proto interface. - -public: - ValueImpl(double value): value(value) {} - - kj::Promise read(ReadContext context) { - context.getResults().setValue(value); - return kj::READY_NOW; - } - -private: - double value; -}; - -class FunctionImpl final: public Calculator::Function::Server { - // Implementation of the Calculator.Function Cap'n Proto interface, where the - // function is defined by a Calculator.Expression. - -public: - FunctionImpl(uint paramCount, Calculator::Expression::Reader body) - : paramCount(paramCount) { - this->body.setRoot(body); - } - - kj::Promise call(CallContext context) { - auto params = context.getParams().getParams(); - KJ_REQUIRE(params.size() == paramCount, "Wrong number of parameters."); - - return evaluateImpl(body.getRoot(), params) - .then([KJ_CPCAP(context)](double value) mutable { - context.getResults().setValue(value); - }); - } - -private: - uint paramCount; - // The function's arity. - - capnp::MallocMessageBuilder body; - // Stores a permanent copy of the function body. -}; - -class OperatorImpl final: public Calculator::Function::Server { - // Implementation of the Calculator.Function Cap'n Proto interface, wrapping - // basic binary arithmetic operators. - -public: - OperatorImpl(Calculator::Operator op): op(op) {} - - kj::Promise call(CallContext context) { - auto params = context.getParams().getParams(); - KJ_REQUIRE(params.size() == 2, "Wrong number of parameters."); - - double result; - switch (op) { - case Calculator::Operator::ADD: result = params[0] + params[1]; break; - case Calculator::Operator::SUBTRACT:result = params[0] - params[1]; break; - case Calculator::Operator::MULTIPLY:result = params[0] * params[1]; break; - case Calculator::Operator::DIVIDE: result = params[0] / params[1]; break; - default: - KJ_FAIL_REQUIRE("Unknown operator."); - } - - context.getResults().setValue(result); - return kj::READY_NOW; - } - -private: - Calculator::Operator op; -}; - -class CalculatorImpl final: public Calculator::Server { - // Implementation of the Calculator Cap'n Proto interface. - -public: - kj::Promise evaluate(EvaluateContext context) override { - return evaluateImpl(context.getParams().getExpression()) - .then([KJ_CPCAP(context)](double value) mutable { - context.getResults().setValue(kj::heap(value)); - }); - } - - kj::Promise defFunction(DefFunctionContext context) override { - auto params = context.getParams(); - context.getResults().setFunc(kj::heap( - params.getParamCount(), params.getBody())); - return kj::READY_NOW; - } - - kj::Promise getOperator(GetOperatorContext context) override { - context.getResults().setFunc(kj::heap( - context.getParams().getOp())); - return kj::READY_NOW; - } -}; - -int main(int argc, const char* argv[]) { - if (argc != 2) { - std::cerr << "usage: " << argv[0] << " ADDRESS[:PORT]\n" - "Runs the server bound to the given address/port.\n" - "ADDRESS may be '*' to bind to all local addresses.\n" - ":PORT may be omitted to choose a port automatically." << std::endl; - return 1; - } - - // Set up a server. - capnp::EzRpcServer server(kj::heap(), argv[1]); - - // Write the port number to stdout, in case it was chosen automatically. - auto& waitScope = server.getWaitScope(); - uint port = server.getPort().wait(waitScope); - if (port == 0) { - // The address format "unix:/path/to/socket" opens a unix domain socket, - // in which case the port will be zero. - std::cout << "Listening on Unix socket..." << std::endl; - } else { - std::cout << "Listening on port " << port << "..." << std::endl; - } - - // Run forever, accepting connections and handling requests. - kj::NEVER_DONE.wait(waitScope); -} diff --git a/recipes/capnproto/all/test_package/calculator.capnp b/recipes/capnproto/all/test_package/calculator.capnp deleted file mode 100644 index adc8294e57578..0000000000000 --- a/recipes/capnproto/all/test_package/calculator.capnp +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors -# Licensed under the MIT License: -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -@0x85150b117366d14b; - -interface Calculator { - # A "simple" mathematical calculator, callable via RPC. - # - # But, to show off Cap'n Proto, we add some twists: - # - # - You can use the result from one call as the input to the next - # without a network round trip. To accomplish this, evaluate() - # returns a `Value` object wrapping the actual numeric value. - # This object may be used in a subsequent expression. With - # promise pipelining, the Value can actually be used before - # the evaluate() call that creates it returns! - # - # - You can define new functions, and then call them. This again - # shows off pipelining, but it also gives the client the - # opportunity to define a function on the client side and have - # the server call back to it. - # - # - The basic arithmetic operators are exposed as Functions, and - # you have to call getOperator() to obtain them from the server. - # This again demonstrates pipelining -- using getOperator() to - # get each operator and then using them in evaluate() still - # only takes one network round trip. - - evaluate @0 (expression :Expression) -> (value :Value); - # Evaluate the given expression and return the result. The - # result is returned wrapped in a Value interface so that you - # may pass it back to the server in a pipelined request. To - # actually get the numeric value, you must call read() on the - # Value -- but again, this can be pipelined so that it incurs - # no additional latency. - - struct Expression { - # A numeric expression. - - union { - literal @0 :Float64; - # A literal numeric value. - - previousResult @1 :Value; - # A value that was (or, will be) returned by a previous - # evaluate(). - - parameter @2 :UInt32; - # A parameter to the function (only valid in function bodies; - # see defFunction). - - call :group { - # Call a function on a list of parameters. - function @3 :Function; - params @4 :List(Expression); - } - } - } - - interface Value { - # Wraps a numeric value in an RPC object. This allows the value - # to be used in subsequent evaluate() requests without the client - # waiting for the evaluate() that returns the Value to finish. - - read @0 () -> (value :Float64); - # Read back the raw numeric value. - } - - defFunction @1 (paramCount :Int32, body :Expression) - -> (func :Function); - # Define a function that takes `paramCount` parameters and returns the - # evaluation of `body` after substituting these parameters. - - interface Function { - # An algebraic function. Can be called directly, or can be used inside - # an Expression. - # - # A client can create a Function that runs on the server side using - # `defFunction()` or `getOperator()`. Alternatively, a client can - # implement a Function on the client side and the server will call back - # to it. However, a function defined on the client side will require a - # network round trip whenever the server needs to call it, whereas - # functions defined on the server and then passed back to it are called - # locally. - - call @0 (params :List(Float64)) -> (value :Float64); - # Call the function on the given parameters. - } - - getOperator @2 (op :Operator) -> (func :Function); - # Get a Function representing an arithmetic operator, which can then be - # used in Expressions. - - enum Operator { - add @0; - subtract @1; - multiply @2; - divide @3; - } -} diff --git a/recipes/capnproto/all/test_package/conanfile.py b/recipes/capnproto/all/test_package/conanfile.py index d4d32590a51cc..85b7dcba030f5 100644 --- a/recipes/capnproto/all/test_package/conanfile.py +++ b/recipes/capnproto/all/test_package/conanfile.py @@ -14,11 +14,7 @@ def layout(self): cmake_layout(self) 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) + self.requires(self.tested_reference_str, run=True) def generate(self): VirtualRunEnv(self).generate() @@ -34,5 +30,7 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "addressbook") - self.run(f"{bin_path} write", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "addressbook") + self.run(bin_path, env="conanrun") + + self.run("capnp id") diff --git a/recipes/capnproto/all/test_package/test_package.c++ b/recipes/capnproto/all/test_package/test_package.c++ new file mode 100644 index 0000000000000..8ed58079da0b0 --- /dev/null +++ b/recipes/capnproto/all/test_package/test_package.c++ @@ -0,0 +1,9 @@ +#include +#include + + +int main() { + capnp::MallocMessageBuilder message; + std::cout << sizeof(message) << std::endl; + return 0; +} diff --git a/recipes/capnproto/all/test_v1_package/CMakeLists.txt b/recipes/capnproto/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/capnproto/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/capnproto/all/test_v1_package/conanfile.py b/recipes/capnproto/all/test_v1_package/conanfile.py deleted file mode 100644 index 9c7aa58ab8868..0000000000000 --- a/recipes/capnproto/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,26 +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" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(self.tested_reference_str) - - def build(self): - with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "addressbook") - self.run(f"{bin_path} write", run_environment=True) diff --git a/recipes/capnproto/config.yml b/recipes/capnproto/config.yml index 887e41e533af8..bab3d2366d363 100644 --- a/recipes/capnproto/config.yml +++ b/recipes/capnproto/config.yml @@ -1,4 +1,8 @@ versions: + "1.1.0": + folder: all + "1.0.2": + folder: all "1.0.1": folder: all "1.0.0": diff --git a/recipes/capstone/all/conandata.yml b/recipes/capstone/all/conandata.yml index d7a89de82f179..b49957e5739d0 100644 --- a/recipes/capstone/all/conandata.yml +++ b/recipes/capstone/all/conandata.yml @@ -1,4 +1,7 @@ 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" @@ -6,6 +9,10 @@ sources: 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" diff --git a/recipes/capstone/all/test_package/CMakeLists.txt b/recipes/capstone/all/test_package/CMakeLists.txt index 7c02e4fe66493..62469e8bf8ccd 100644 --- a/recipes/capstone/all/test_package/CMakeLists.txt +++ b/recipes/capstone/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(capstone REQUIRED CONFIG) diff --git a/recipes/capstone/config.yml b/recipes/capstone/config.yml index 62f80ddacb005..77f1d8f750fd6 100644 --- a/recipes/capstone/config.yml +++ b/recipes/capstone/config.yml @@ -1,4 +1,6 @@ versions: + "5.0.1": + folder: "all" "5.0": folder: "all" "4.0.2": diff --git a/recipes/cargs/all/conandata.yml b/recipes/cargs/all/conandata.yml index 21e38ee9fe720..4947b6c17c0a0 100644 --- a/recipes/cargs/all/conandata.yml +++ b/recipes/cargs/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.2.0": + url: "https://github.com/likle/cargs/archive/v1.2.0.tar.gz" + sha256: "0b33379e3d3c8cb3e22f33d3e1a260adcd366970868bc9b7c47237f24188ff25" + "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/test_v1_package/CMakeLists.txt b/recipes/cargs/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cargs/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6c9d5dba712c7..0000000000000 --- a/recipes/cargs/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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..f86b56ea8cf6a 100644 --- a/recipes/cargs/config.yml +++ b/recipes/cargs/config.yml @@ -1,4 +1,8 @@ versions: + "1.2.0": + folder: all + "1.1.0": + folder: all "1.0.3": folder: all "1.0.1": diff --git a/recipes/cassandra-cpp-driver/all/conanfile.py b/recipes/cassandra-cpp-driver/all/conanfile.py index 5cfe8683bd139..3e74ad89df6c3 100644 --- a/recipes/cassandra-cpp-driver/all/conanfile.py +++ b/recipes/cassandra-cpp-driver/all/conanfile.py @@ -1,8 +1,9 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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 +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -123,8 +124,9 @@ def generate(self): if self.settings.os == "Linux": tc.variables["CASS_USE_TIMERFD"] = self.options.use_timerfd - # Relocatable shared lib on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.17.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) diff --git a/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt b/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt index 4d590e1005c29..00ed35ce16c1e 100644 --- a/recipes/cassandra-cpp-driver/all/test_package/CMakeLists.txt +++ b/recipes/cassandra-cpp-driver/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(cassandra-cpp-driver REQUIRED CONFIG) diff --git a/recipes/cassandra-cpp-driver/all/test_v1_package/CMakeLists.txt b/recipes/cassandra-cpp-driver/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/cassandra-cpp-driver/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cassandra-cpp-driver/all/test_v1_package/conanfile.py b/recipes/cassandra-cpp-driver/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/cassandra-cpp-driver/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/catch2/2.x.x/test_package/CMakeLists.txt b/recipes/catch2/2.x.x/test_package/CMakeLists.txt index 7cf72543951f1..768d5acc4d08e 100644 --- a/recipes/catch2/2.x.x/test_package/CMakeLists.txt +++ b/recipes/catch2/2.x.x/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) enable_testing() diff --git a/recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt b/recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index c23ed5cfe6d98..0000000000000 --- a/recipes/catch2/2.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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/catch2/2.x.x/test_v1_package/conanfile.py b/recipes/catch2/2.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 2ee47800e04e6..0000000000000 --- a/recipes/catch2/2.x.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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["WITH_MAIN"] = self.options["catch2"].with_main - cmake.definitions["WITH_BENCHMARK"] = self.options["catch2"].with_main and self.options["catch2"].with_benchmark - cmake.definitions["WITH_PREFIX"] = self.options["catch2"].with_prefix - 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} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/catch2/3.x.x/conandata.yml b/recipes/catch2/3.x.x/conandata.yml index 85ef2d28e9683..cd4ccd2b75d8b 100644 --- a/recipes/catch2/3.x.x/conandata.yml +++ b/recipes/catch2/3.x.x/conandata.yml @@ -1,47 +1,19 @@ sources: - "3.5.0": - url: "https://github.com/catchorg/Catch2/archive/v3.5.0.tar.gz" - sha256: "f6d4f8d78a9b59ec72a81d49f58d18eb317372ac07f8d9432710a079e69fd66a" + "3.8.1": + url: "https://github.com/catchorg/Catch2/archive/v3.8.1.tar.gz" + sha256: "18b3f70ac80fccc340d8c6ff0f339b2ae64944782f8d2fca2bd705cf47cadb79" + "3.8.0": + url: "https://github.com/catchorg/Catch2/archive/v3.8.0.tar.gz" + sha256: "1ab2de20460d4641553addfdfe6acd4109d871d5531f8f519a52ea4926303087" + "3.7.1": + url: "https://github.com/catchorg/Catch2/archive/v3.7.1.tar.gz" + sha256: "c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c" + "3.6.0": + url: "https://github.com/catchorg/Catch2/archive/v3.6.0.tar.gz" + sha256: "485932259a75c7c6b72d4b874242c489ea5155d17efa345eb8cc72159f49f356" + "3.5.4": + url: "https://github.com/catchorg/Catch2/archive/v3.5.4.tar.gz" + sha256: "b7754b711242c167d8f60b890695347f90a1ebc95949a045385114165d606dbb" "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" - "3.3.1": - url: "https://github.com/catchorg/Catch2/archive/v3.3.1.tar.gz" - sha256: "d90351cdc55421f640c553cfc0875a8c834428679444e8062e9187d05b18aace" - "3.3.0": - url: "https://github.com/catchorg/Catch2/archive/v3.3.0.tar.gz" - sha256: "fe2f29a54ca775c2dd04bb97ffb79d398e6210e3caa174348b5cd3b7e4ca887d" - "3.2.1": - url: "https://github.com/catchorg/Catch2/archive/v3.2.1.tar.gz" - sha256: "4613d3e8142b672159fcae252a4860d72c8cf8e2df5043b1ae3541db9ef5d73c" - "3.2.0": - url: "https://github.com/catchorg/Catch2/archive/v3.2.0.tar.gz" - sha256: "feee04647e28ac3cbeff46cb42abc8ee2d8d5f646d36e3fb3ba274b8c69a58ea" - "3.1.0": - url: "https://github.com/catchorg/Catch2/archive/v3.1.0.tar.gz" - sha256: "c252b2d9537e18046d8b82535069d2567f77043f8e644acf9a9fffc22ea6e6f7" - "3.0.1": - url: "https://github.com/catchorg/Catch2/archive/v3.0.1.tar.gz" - sha256: "8c4173c68ae7da1b5b505194a0c2d6f1b2aef4ec1e3e7463bde451f26bbaf4e7" -patches: - "3.1.0": - - patch_file: "patches/3.1.0-0001-fix-dll-install.patch" - patch_description: "Install dll in bin folder" - patch_type: "portability" - patch_source: "https://github.com/catchorg/Catch2/pull/2485" - - patch_file: "patches/3.1.0-0002-dllimport-global-symbols-msvc.patch" - patch_description: "Fix import of global symbols for msvc shared" - patch_type: "portability" - patch_source: "https://github.com/catchorg/Catch2/pull/2527" - "3.0.1": - - patch_file: "patches/3.0.1-0001-allow-shared.patch" - patch_description: "Allow to build catch2 as a shared library" - patch_type: "portability" - patch_source: "https://github.com/catchorg/Catch2/commit/bea58bf8bbfca887f871c3aa2d720ba62c01f855" - - patch_file: "patches/3.0.1-0002-dllimport-global-symbols-msvc.patch" - patch_description: "Fix import of global symbols for msvc shared" - patch_type: "portability" - patch_source: "https://github.com/catchorg/Catch2/pull/2527" diff --git a/recipes/catch2/3.x.x/conanfile.py b/recipes/catch2/3.x.x/conanfile.py index 6f59c5ce8e188..22692ccc62115 100644 --- a/recipes/catch2/3.x.x/conanfile.py +++ b/recipes/catch2/3.x.x/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, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.files import copy, get, rmdir, save from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class Catch2Conan(ConanFile): name = "catch2" description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD" - topics = ("catch2", "unit-test", "tdd", "bdd") license = "BSL-1.0" - homepage = "https://github.com/catchorg/Catch2" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/catchorg/Catch2" + topics = ("catch2", "unit-test", "tdd", "bdd") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -35,33 +35,19 @@ class Catch2Conan(ConanFile): "console_width": "80", "no_posix_signals": False, } - - @property - def _min_cppstd(self): - return "14" + # disallow cppstd compatibility, as it affects the ABI in this library + # see https://github.com/conan-io/conan-center-index/issues/19008 + extension_properties = {"compatibility_cppstd": False} @property def _min_console_width(self): # Catch2 doesn't build if less than this value return 46 - @property - def _compilers_minimum_version(self): - return { - "gcc": "7", - "Visual Studio": "15", - "msvc": "191", - "clang": "5", - "apple-clang": "10", - } - @property def _default_reporter_str(self): return str(self.options.default_reporter).strip('"') - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -73,14 +59,12 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def build_requirements(self): + if Version(self.version) >= "3.8.0": + 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 doesn't support", - ) + check_min_cppstd(self, 14) try: if int(self.options.console_width) < self._min_console_width: @@ -108,7 +92,6 @@ def generate(self): tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -175,13 +158,3 @@ def package_info(self): if self.options.default_reporter: defines.append(f"CATCH_CONFIG_DEFAULT_REPORTER={self._default_reporter_str}") self.cpp_info.components["catch2_with_main"].defines = defines - - # TODO: to remove in conan v2 once legacy generators removed - self.cpp_info.filenames["cmake_find_package"] = "Catch2" - self.cpp_info.filenames["cmake_find_package_multi"] = "Catch2" - self.cpp_info.names["cmake_find_package"] = "catch2" - self.cpp_info.names["cmake_find_package_multi"] = "catch2" - self.cpp_info.components["_catch2"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["_catch2"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - self.cpp_info.components["catch2_with_main"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["catch2_with_main"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch b/recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch deleted file mode 100644 index 38c31d266b121..0000000000000 --- a/recipes/catch2/3.x.x/patches/3.0.1-0001-allow-shared.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -263,9 +263,7 @@ set(REPORTER_SOURCES - ) - set(REPORTER_FILES ${REPORTER_HEADERS} ${REPORTER_SOURCES}) - --# Fixme: STATIC because for dynamic, we would need to handle visibility --# and I don't want to do the annotations right now --add_library(Catch2 STATIC -+add_library(Catch2 - ${REPORTER_FILES} - ${INTERNAL_FILES} - ${BENCHMARK_HEADERS} -@@ -318,7 +316,7 @@ target_include_directories(Catch2 - ) - - --add_library(Catch2WithMain STATIC -+add_library(Catch2WithMain - ${SOURCES_DIR}/internal/catch_main.cpp - ) - add_build_reproducibility_settings(Catch2WithMain) -@@ -338,8 +336,12 @@ if (NOT_SUBPROJECT) - Catch2WithMain - EXPORT - Catch2Targets -- DESTINATION -+ LIBRARY DESTINATION -+ ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION - ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION -+ ${CMAKE_INSTALL_BINDIR} - ) - - -@@ -409,3 +411,27 @@ endif() - - list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2WithMain) - set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE) -+ -+ -+# We still do not support building dynamic library with hidden visibility -+# so we want to check & warn users if they do this. However, we won't abort -+# the configuration step so that we don't have to also provide an override. -+if (BUILD_SHARED_LIBS) -+ if (MSVC) -+ set_target_properties(Catch2 Catch2WithMain -+ PROPERTIES -+ WINDOWS_EXPORT_ALL_SYMBOLS ON -+ ) -+ endif() -+ -+ get_target_property(_VisPreset Catch2 CXX_VISIBILITY_PRESET) -+ if (NOT MSVC AND _VisPreset STREQUAL "hidden") -+ set_target_properties(Catch2 Catch2WithMain -+ PROPERTIES -+ CXX_VISIBILITY_PRESET "default" -+ VISIBILITY_INLINES_HIDDEN OFF -+ ) -+ message(WARNING "Setting Catch2's visibility to default." -+ " Hidden visibility is not supported.") -+ endif() -+endif() diff --git a/recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch b/recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch deleted file mode 100644 index c797f9d544f0c..0000000000000 --- a/recipes/catch2/3.x.x/patches/3.0.1-0002-dllimport-global-symbols-msvc.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- a/CMake/CatchConfigOptions.cmake -+++ b/CMake/CatchConfigOptions.cmake -@@ -45,6 +45,7 @@ set(_OverridableOptions - foreach(OptionName ${_OverridableOptions}) - AddOverridableConfigOption(${OptionName}) - endforeach() -+set(CATCH_CONFIG_SHARED_LIBRARY ${BUILD_SHARED_LIBS}) - - set(_OtherConfigOptions - "DISABLE_EXCEPTIONS" ---- a/src/catch2/catch_tostring.hpp -+++ b/src/catch2/catch_tostring.hpp -@@ -296,13 +296,13 @@ namespace Catch { - template<> - struct StringMaker { - static std::string convert(float value); -- static int precision; -+ CATCH_EXPORT static int precision; - }; - - template<> - struct StringMaker { - static std::string convert(double value); -- static int precision; -+ CATCH_EXPORT static int precision; - }; - - template ---- a/src/catch2/catch_user_config.hpp.in -+++ b/src/catch2/catch_user_config.hpp.in -@@ -181,6 +181,8 @@ - #cmakedefine CATCH_CONFIG_PREFIX_ALL - #cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG - -+#cmakedefine CATCH_CONFIG_SHARED_LIBRARY -+ - - // ------ - // "Variable" defines, these have actual values ---- a/src/catch2/internal/catch_compiler_capabilities.hpp -+++ b/src/catch2/internal/catch_compiler_capabilities.hpp -@@ -364,5 +364,15 @@ - # define CATCH_CONFIG_COLOUR_WIN32 - #endif - -+#if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \ -+ !defined( CATCH_CONFIG_STATIC ) -+# ifdef Catch2_EXPORTS -+# define CATCH_EXPORT //__declspec( dllexport ) // not needed -+# else -+# define CATCH_EXPORT __declspec( dllimport ) -+# endif -+#else -+# define CATCH_EXPORT -+#endif - - #endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED ---- a/src/catch2/internal/catch_context.hpp -+++ b/src/catch2/internal/catch_context.hpp -@@ -8,6 +8,8 @@ - #ifndef CATCH_CONTEXT_HPP_INCLUDED - #define CATCH_CONTEXT_HPP_INCLUDED - -+#include -+ - namespace Catch { - - class IResultCapture; -@@ -28,7 +30,7 @@ namespace Catch { - virtual void setConfig( IConfig const* config ) = 0; - - private: -- static IMutableContext *currentContext; -+ CATCH_EXPORT static IMutableContext *currentContext; - friend IMutableContext& getCurrentMutableContext(); - friend void cleanUpContext(); - static void createContext(); diff --git a/recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch b/recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch deleted file mode 100644 index c7027940432a6..0000000000000 --- a/recipes/catch2/3.x.x/patches/3.1.0-0001-fix-dll-install.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -359,8 +359,12 @@ if (NOT_SUBPROJECT) - Catch2WithMain - EXPORT - Catch2Targets -- DESTINATION -+ LIBRARY DESTINATION -+ ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION - ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION -+ ${CMAKE_INSTALL_BINDIR} - ) - - diff --git a/recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch b/recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch deleted file mode 100644 index 63e221c1fb44c..0000000000000 --- a/recipes/catch2/3.x.x/patches/3.1.0-0002-dllimport-global-symbols-msvc.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- a/CMake/CatchConfigOptions.cmake -+++ b/CMake/CatchConfigOptions.cmake -@@ -45,6 +45,7 @@ set(_OverridableOptions - foreach(OptionName ${_OverridableOptions}) - AddOverridableConfigOption(${OptionName}) - endforeach() -+set(CATCH_CONFIG_SHARED_LIBRARY ${BUILD_SHARED_LIBS}) - - set(_OtherConfigOptions - "DISABLE_EXCEPTIONS" ---- a/src/catch2/catch_tostring.hpp -+++ b/src/catch2/catch_tostring.hpp -@@ -296,13 +296,13 @@ namespace Catch { - template<> - struct StringMaker { - static std::string convert(float value); -- static int precision; -+ CATCH_EXPORT static int precision; - }; - - template<> - struct StringMaker { - static std::string convert(double value); -- static int precision; -+ CATCH_EXPORT static int precision; - }; - - template ---- a/src/catch2/catch_user_config.hpp.in -+++ b/src/catch2/catch_user_config.hpp.in -@@ -181,6 +181,8 @@ - #cmakedefine CATCH_CONFIG_PREFIX_ALL - #cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG - -+#cmakedefine CATCH_CONFIG_SHARED_LIBRARY -+ - - // ------ - // "Variable" defines, these have actual values ---- a/src/catch2/internal/catch_compiler_capabilities.hpp -+++ b/src/catch2/internal/catch_compiler_capabilities.hpp -@@ -376,5 +376,15 @@ - # define CATCH_CONFIG_COLOUR_WIN32 - #endif - -+#if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \ -+ !defined( CATCH_CONFIG_STATIC ) -+# ifdef Catch2_EXPORTS -+# define CATCH_EXPORT //__declspec( dllexport ) // not needed -+# else -+# define CATCH_EXPORT __declspec( dllimport ) -+# endif -+#else -+# define CATCH_EXPORT -+#endif - - #endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED ---- a/src/catch2/internal/catch_context.hpp -+++ b/src/catch2/internal/catch_context.hpp -@@ -8,6 +8,8 @@ - #ifndef CATCH_CONTEXT_HPP_INCLUDED - #define CATCH_CONTEXT_HPP_INCLUDED - -+#include -+ - namespace Catch { - - class IResultCapture; -@@ -28,7 +30,7 @@ namespace Catch { - virtual void setConfig( IConfig const* config ) = 0; - - private: -- static IMutableContext *currentContext; -+ CATCH_EXPORT static IMutableContext *currentContext; - friend IMutableContext& getCurrentMutableContext(); - friend void cleanUpContext(); - static void createContext(); diff --git a/recipes/catch2/3.x.x/test_package/CMakeLists.txt b/recipes/catch2/3.x.x/test_package/CMakeLists.txt index 1e2b06644735c..310e1f1a4088d 100644 --- a/recipes/catch2/3.x.x/test_package/CMakeLists.txt +++ b/recipes/catch2/3.x.x/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(Catch2 REQUIRED CONFIG) diff --git a/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt b/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/catch2/3.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/catch2/3.x.x/test_v1_package/conanfile.py b/recipes/catch2/3.x.x/test_v1_package/conanfile.py deleted file mode 100644 index b62a348e1044b..0000000000000 --- a/recipes/catch2/3.x.x/test_v1_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.definitions["WITH_PREFIX"] = self.options["catch2"].with_prefix - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "standalone"), run_environment=True) - self.run(os.path.join("bin", "benchmark"), run_environment=True) diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index df92faa46a85a..876d41afe73af 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -1,21 +1,15 @@ versions: - "3.5.0": + "3.8.1": folder: 3.x.x - "3.4.0": - folder: 3.x.x - "3.3.2": - folder: 3.x.x - "3.3.1": + "3.8.0": folder: 3.x.x - "3.3.0": + "3.7.1": folder: 3.x.x - "3.2.1": + "3.6.0": folder: 3.x.x - "3.2.0": + "3.5.4": folder: 3.x.x - "3.1.0": - folder: 3.x.x - "3.0.1": + "3.4.0": folder: 3.x.x "2.13.10": folder: 2.x.x 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 ca431f6e0685b..f4a03cfdc3858 100644 --- a/recipes/ccache/all/conandata.yml +++ b/recipes/ccache/all/conandata.yml @@ -1,49 +1,16 @@ sources: + "4.11": + url: "https://github.com/ccache/ccache/releases/download/v4.11/ccache-4.11.tar.gz" + sha256: "7dba208540dc61cedd5c93df8c960055a35f06e29a0a3cf766962251d4a5c766" + "4.10.2": + url: "https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2.tar.gz" + sha256: "108100960bb7e64573ea925af2ee7611701241abb36ce0aae3354528403a7d87" + "4.10": + url: "https://github.com/ccache/ccache/releases/download/v4.10/ccache-4.10.tar.gz" + sha256: "16972ba62c8499045edc3ae7d7b8a0b419a961567f5ff0f01bf5a44194204775" + "4.9.1": + url: "https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1.tar.xz" + sha256: "4c03bc840699127d16c3f0e6112e3f40ce6a230d5873daa78c60a59c7ef59d25" "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" - "4.8": - url: "https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8.tar.xz" - sha256: "b963ee3bf88d7266b8a0565e4ba685d5666357f0a7e364ed98adb0dc1191fcbb" - "4.7.4": - 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 8234bde469ffe..51f4ace979296 100644 --- a/recipes/ccache/all/conanfile.py +++ b/recipes/ccache/all/conanfile.py @@ -1,17 +1,18 @@ from conan import ConanFile from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps from conan.errors import ConanInvalidConfiguration -from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.files import copy, get from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.microsoft import check_min_vs, is_msvc import os -required_conan_version = ">=1.55.0" +required_conan_version = ">=2.0.9" class CcacheConan(ConanFile): name = "ccache" + package_type = "application" description = ( "Ccache (or “ccacheâ€) is a compiler cache. It speeds up recompilation " "by caching previous compilations and detecting when the same " @@ -41,20 +42,20 @@ def _compilers_minimum_version(self): "apple-clang": "11", } - def export_sources(self): - export_conandata_patches(self) - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zstd/1.5.5") + self.requires("zstd/[>=1.5 <1.6]") if self.options.redis_storage_backend: - self.requires("hiredis/1.1.0") + self.requires("hiredis/1.2.0") + + if Version(self.version) >= "4.10": + self.requires("fmt/[>=10.2.1 <=11.1.1]") # Explicitly tested with all versions in this range + self.requires("xxhash/[~0.8]") def validate(self): - if self.settings.compiler.cppstd: - check_min_cppstd(self, self._min_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) @@ -66,12 +67,15 @@ def validate(self): self.settings.compiler.libcxx == "libstdc++": raise ConanInvalidConfiguration(f"{self.ref} requires C++ filesystem library, that is not supported by Clang 11 + libstdc++.") + if self.settings.os == "Windows" and self.settings.arch == "armv8" and Version(self.version) < "4.10": + raise ConanInvalidConfiguration("ccache does not support ARMv8 on Windows before version 4.10") + def build_requirements(self): self.tool_requires("cmake/[>=3.15 <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], destination=self.source_folder, + strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -80,17 +84,26 @@ def generate(self): tc.variables["ZSTD_FROM_INTERNET"] = False tc.variables["ENABLE_DOCUMENTATION"] = False tc.variables["ENABLE_TESTING"] = False + tc.variables["STATIC_LINK"] = False # Don't link static runtimes and let Conan handle it tc.generate() deps = CMakeDeps(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") + if Version(self.version) >= "4.10": + deps.set_property("fmt", "cmake_file_name", "Fmt") + deps.set_property("fmt", "cmake_find_mode", "module") + deps.set_property("fmt", "cmake_target_name", "dep_fmt") + deps.set_property("zstd", "cmake_file_name", "Zstd") + deps.set_property("zstd", "cmake_target_name", "dep_zstd") + deps.set_property("hiredis", "cmake_file_name", "Hiredis") + deps.set_property("hiredis", "cmake_target_name", "dep_hiredis") + else: + deps.set_property("hiredis", "cmake_target_name", "HIREDIS::HIREDIS") + deps.set_property("zstd", "cmake_target_name", "ZSTD::ZSTD") deps.set_property("zstd", "cmake_find_mode", "module") + deps.set_property("hiredis", "cmake_find_mode", "module") deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -101,7 +114,5 @@ def package(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.env_info.PATH.append(bin_path) + self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] diff --git a/recipes/ccache/all/patches/4.7.4-cmake-msvc-runtime.patch b/recipes/ccache/all/patches/4.7.4-cmake-msvc-runtime.patch deleted file mode 100644 index 0bc4c5ce8f995..0000000000000 --- a/recipes/ccache/all/patches/4.7.4-cmake-msvc-runtime.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -97,7 +97,7 @@ - - # Link MSVC runtime statically. - if(MSVC) -- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -+ - # Link MINGW runtime statically. - elseif(WIN32) - if((CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR (CMAKE_CXX_COMPILER_ID STREQUAL Clang)) 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 deleted file mode 100644 index f55e169ebc167..0000000000000 --- a/recipes/ccache/all/patches/4.7.4-use-intrinsics-if-msbuild.patch +++ /dev/null @@ -1,34 +0,0 @@ -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/all/patches/4.8-cmake-msvc-runtime.patch b/recipes/ccache/all/patches/4.8-cmake-msvc-runtime.patch deleted file mode 100644 index 0bc4c5ce8f995..0000000000000 --- a/recipes/ccache/all/patches/4.8-cmake-msvc-runtime.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -97,7 +97,7 @@ - - # Link MSVC runtime statically. - if(MSVC) -- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -+ - # Link MINGW runtime statically. - elseif(WIN32) - if((CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR (CMAKE_CXX_COMPILER_ID STREQUAL Clang)) diff --git a/recipes/ccache/all/test_package/conanfile.py b/recipes/ccache/all/test_package/conanfile.py index 2239cf70535aa..a327bdf66b777 100644 --- a/recipes/ccache/all/test_package/conanfile.py +++ b/recipes/ccache/all/test_package/conanfile.py @@ -4,12 +4,10 @@ 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 requirements(self): + self.requires(self.tested_reference_str) def test(self): if can_run(self): - self.run("ccache --version") + self.run("ccache --version", env="conanrun") diff --git a/recipes/ccache/all/test_v1_package/conanfile.py b/recipes/ccache/all/test_v1_package/conanfile.py deleted file mode 100644 index e357214905abd..0000000000000 --- a/recipes/ccache/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,9 +0,0 @@ -from conans import ConanFile, tools - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - if not tools.cross_building(self): - self.run("ccache --version", run_environment=True) diff --git a/recipes/ccache/config.yml b/recipes/ccache/config.yml index 98dd3df9a94de..0619b32de4eda 100644 --- a/recipes/ccache/config.yml +++ b/recipes/ccache/config.yml @@ -1,11 +1,11 @@ versions: - "4.8.3": + "4.11": folder: all - "4.8.2": + "4.10.2": folder: all - "4.8.1": + "4.10": folder: all - "4.8": + "4.9.1": folder: all - "4.7.4": + "4.8.3": folder: all diff --git a/recipes/cccl/all/conandata.yml b/recipes/cccl/all/conandata.yml index 20725ee2a4b27..fb38d228060e4 100644 --- a/recipes/cccl/all/conandata.yml +++ b/recipes/cccl/all/conandata.yml @@ -5,3 +5,14 @@ sources: "1.3": url: https://github.com/swig/cccl/archive/cccl-1.3.tar.gz sha256: 1E34E315CE3AB890D39A75FFABAACCE2E55FE5ED21591F036A45AFDA43A3E989 +patches: + "1.3": + - patch_file: "patches/0001-uname-detect-msys.patch" + patch_type: "official" + patch_description: "Use uname to detect MSYS2 intead of MATCHTYPE" + patch_source: "https://github.com/swig/cccl/commit/6cc59b3a14fc9c2a2301eae9809c64fbdb1b524d" + "1.1": + - patch_file: "patches/0001-uname-detect-msys.patch" + patch_type: "official" + patch_description: "Use uname to detect MSYS2 intead of MATCHTYPE" + patch_source: "https://github.com/swig/cccl/commit/6cc59b3a14fc9c2a2301eae9809c64fbdb1b524d" diff --git a/recipes/cccl/all/conanfile.py b/recipes/cccl/all/conanfile.py index 3d0509b8a7502..0e62a7474f4ce 100644 --- a/recipes/cccl/all/conanfile.py +++ b/recipes/cccl/all/conanfile.py @@ -1,11 +1,14 @@ from conan import ConanFile -from conan.tools.files import get, replace_in_file, copy +from conan.tools.files import get, replace_in_file, copy, export_conandata_patches, apply_conandata_patches from conan.tools.layout import basic_layout from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc import os +required_conan_version = ">=2.1.0" + + class CcclConan(ConanFile): name = "cccl" description = "Unix cc compiler to Microsoft's cl compiler wrapper" @@ -14,6 +17,7 @@ class CcclConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" + package_type = "application" options = { "muffle": [True, False], "verbose": [True, False], @@ -27,6 +31,9 @@ class CcclConan(ConanFile): def _cccl_dir(self): return os.path.join(self.package_folder, "bin") + def export_sources(self): + export_conandata_patches(self) + def layout(self): basic_layout(self, src_folder="src") @@ -38,8 +45,8 @@ def validate(self): raise ConanInvalidConfiguration("This recipe only supports msvc/Visual Studio.") 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) + apply_conandata_patches(self) def build(self): cccl_path = os.path.join(self.source_folder, self.source_folder, "cccl") @@ -80,13 +87,3 @@ def package_info(self): self.buildenv_info.define("CC", cccl) self.buildenv_info.define("CXX", cccl) self.buildenv_info.define("LD", cccl) - - # TODO: Legacy, to be removed on Conan 2.0 - self.env_info.PATH.append(self._cccl_dir) - - self.output.info(f"Setting CC to '{cccl}'") - self.env_info.CC = cccl - self.output.info(f"Setting CXX to '{cccl}'") - self.env_info.CXX = cccl - self.output.info(f"Setting LD to '{cccl}'") - self.env_info.LD = cccl diff --git a/recipes/cccl/all/patches/0001-uname-detect-msys.patch b/recipes/cccl/all/patches/0001-uname-detect-msys.patch new file mode 100644 index 0000000000000..20c59e7fe4a25 --- /dev/null +++ b/recipes/cccl/all/patches/0001-uname-detect-msys.patch @@ -0,0 +1,42 @@ +From 6cc59b3a14fc9c2a2301eae9809c64fbdb1b524d Mon Sep 17 00:00:00 2001 +From: William S Fulton +Date: Fri, 7 Mar 2025 19:04:20 +0000 +Subject: [PATCH] Use uname -o to detect msys instead of x86_64-pc-msys + +Closes #20 +--- + README.markdown | 2 ++ + cccl | 5 +++-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/README.markdown b/README.markdown +index 1b69922..f0c3273 100644 +--- a/README.markdown ++++ b/README.markdown +@@ -69,8 +69,10 @@ do anything but copy the cccl script, though. + + cccl uses and hence requires ports of the following Unix utilities: + - bash ++ - grep + - sed + - tr ++ - uname + + cccl is a bash shell script which makes use of these utilities. Therefore, you + will need at the very least a Windows versions of these utilities. The easiest +diff --git a/cccl b/cccl +index 28571fe..d681117 100755 +--- a/cccl ++++ b/cccl +@@ -30,8 +30,9 @@ given by [OPTIONS] that Unix cc understands into parameters that cl understands. + EOF + } + +-case $MACHTYPE in +- *-msys) ++operating_system=$(uname -o) ++case $operating_system in ++ Msys) + slash="-" + ;; + *) diff --git a/recipes/cccl/all/test_package/conanfile.py b/recipes/cccl/all/test_package/conanfile.py index b0e11ede43362..623cefce108d3 100644 --- a/recipes/cccl/all/test_package/conanfile.py +++ b/recipes/cccl/all/test_package/conanfile.py @@ -9,25 +9,20 @@ class CcclTestConan(ConanFile): test_type = "explicit" win_bash = True - @property - def _settings_build(self): - # TODO: Remove for Conan v2 - 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", default=False, check_type=bool): + 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 build(self): - if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + if self.settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): return # cccl needs a bash if there isn't a bash we can't build cxx = "cccl " src = os.path.join(self.source_folder, "example.cpp").replace("\\", "/") self.run(f"{cxx} {src} -o example", cwd=self.build_folder) def test(self): - if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): + if self.settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): return # cccl needs a bash if there isn't a bash we can't build if can_run(self): self.run("./example") #test self.run still runs in bash, so it needs "./"; seems weird but okay... diff --git a/recipes/cccl/all/test_v1_package/conanfile.py b/recipes/cccl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38669b537fb21..0000000000000 --- a/recipes/cccl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,35 +0,0 @@ -from conans import ConanFile, tools -from conan.tools.microsoft import is_msvc -import os - - -class CcclTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - 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 build(self): - environment = {} - if is_msvc(self): - environment.update(tools.vcvars_dict(self.settings)) - #for k in environment.keys(): - #self.output.highlight(k) - #self.output.highlight(environment[k]) - with tools.environment_append(environment): - cxxTest = tools.get_env("CXX") - #cxxB = self.buildenv_info.vars["CXX"] - self.output.highlight(f"tools.get_env(\"CXX\") = {cxxTest}") - #self.output.highlight(f"self.buildenv_info.vars[\"CXX\"] = {cxxB}") - cxx = "sh cccl " - self.run("{cxx} {src} -o example".format( - cxx=cxx, src=os.path.join(self.source_folder, "example.cpp")), win_bash=self.settings.os is "Windows", run_environment=True) - - def test(self): - if not tools.cross_building(self): - self.run(os.path.join(self.build_folder, "example")) diff --git a/recipes/cccl/all/test_v1_package/example.cpp b/recipes/cccl/all/test_v1_package/example.cpp deleted file mode 100644 index ef5068e37c8cc..0000000000000 --- a/recipes/cccl/all/test_v1_package/example.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - std::cout << "Hello world\n"; - return 0; -} diff --git a/recipes/ccfits/all/test_package/CMakeLists.txt b/recipes/ccfits/all/test_package/CMakeLists.txt index 2112b47f62dd2..24fe89783fc2a 100644 --- a/recipes/ccfits/all/test_package/CMakeLists.txt +++ b/recipes/ccfits/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(ccfits REQUIRED CONFIG) diff --git a/recipes/ccfits/all/test_v1_package/CMakeLists.txt b/recipes/ccfits/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/ccfits/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ccfits/all/test_v1_package/conanfile.py b/recipes/ccfits/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ccfits/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_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/cctag/all/conandata.yml b/recipes/cctag/all/conandata.yml index 13ba480ba9f39..85f3e81e772c2 100644 --- a/recipes/cctag/all/conandata.yml +++ b/recipes/cctag/all/conandata.yml @@ -1,9 +1,29 @@ sources: + "1.0.4": + url: "https://github.com/alicevision/CCTag/archive/refs/tags/v1.0.4.tar.gz" + sha256: "f4ced6138419f4ad09d62d4373738c172586c91068faff8bf08c2caa5e76d516" + "1.0.3": + url: "https://github.com/alicevision/CCTag/archive/refs/tags/v1.0.3.tar.gz" + sha256: "25396b03c4aa3c1be241a2a8518a29511cb4fff695caa5126203fbba8e8e444d" "1.0.1": url: "https://github.com/alicevision/CCTag/archive/refs/tags/v1.0.1.tar.gz" sha256: "ae8a819bc978eb13bb1061a204c214da835e56c9b7dc775237ed6b2191011dec" patches: + "1.0.3": + - patch_file: "patches/1.0.3-0001-honor-vc-runtime.patch" + patch_description: "Honor vc runtime" + patch_type: "conan" + - patch_file: "patches/1.0.3-0002-fix-boost-deprecated-includes.patch" + patch_description: "Fix deprecated Boost includes" + patch_type: "portability" "1.0.1": - - patch_file: "patches/0001-honor-vc-runtime.patch" + - patch_file: "patches/1.0.1-0001-honor-vc-runtime.patch" patch_description: "Honor vc runtime" patch_type: "conan" + - patch_file: "patches/1.0.3-0002-fix-boost-deprecated-includes.patch" + patch_description: "Fix deprecated Boost includes" + patch_type: "portability" + - patch_file: "patches/1.0.1-0002-fix-missing-define.patch" + patch_description: "Add missing _GNU_SOURCE define" + patch_type: "bugfix" + patch_source: "https://github.com/alicevision/CCTag/commit/b49d710ab6870a865c20c943a65bd6dca906a184" diff --git a/recipes/cctag/all/conanfile.py b/recipes/cctag/all/conanfile.py index 773c86527b19a..617a9b8ecd704 100644 --- a/recipes/cctag/all/conanfile.py +++ b/recipes/cctag/all/conanfile.py @@ -4,6 +4,7 @@ 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_static_runtime +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -18,6 +19,7 @@ class CCTagConan(ConanFile): homepage = "https://github.com/alicevision/CCTag" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,6 +28,7 @@ class CCTagConan(ConanFile): "visual_debug": [True, False], "no_cout": [True, False], "with_cuda": [True, False], + "cuda_cc_list": [None, "ANY"], } default_options = { "shared": False, @@ -34,6 +37,7 @@ class CCTagConan(ConanFile): "visual_debug": False, "no_cout": True, "with_cuda": False, + "cuda_cc_list": None, # e.g. "5.2;7.5;8.2", builds all up to 7.5 by default } def export_sources(self): @@ -47,14 +51,23 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def package_id(self): + if not self.info.options.with_cuda: + del self.info.options.cuda_cc_list + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.80.0") - self.requires("eigen/3.4.0") - self.requires("onetbb/2020.3") - self.requires("opencv/4.5.5") + # boost/1.85.0 not compatible because of "error: 'numeric' is not a namespace-name" error + boost_version = "1.85.0" if Version(self.version) >= "1.0.4" else "1.84.0" + self.requires(f"boost/{boost_version}", transitive_headers=True, transitive_libs=True) + self.requires("eigen/3.4.0", transitive_headers=True) + if Version(self.version) >= "1.0.3": + self.requires("onetbb/2021.10.0") + else: + self.requires("onetbb/2020.3.3") + self.requires("opencv/4.9.0", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): @@ -64,27 +77,22 @@ def _required_boost_components(self): ] 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) + 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.settings.compiler == "Visual Studio" and not self.options.shared and \ - is_msvc_static_runtime(self) and self.dependencies["onetbb"].options.shared: + if is_msvc_static_runtime(self) and not self.options.shared and self.dependencies["onetbb"].options.shared: raise ConanInvalidConfiguration("this specific configuration is prevented due to internal c3i limitations") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 14) - # FIXME: add cuda support - if self.options.with_cuda: - raise ConanInvalidConfiguration("CUDA not supported yet") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -93,16 +101,18 @@ def generate(self): tc.variables["CCTAG_SERIALIZE"] = self.options.serialize tc.variables["CCTAG_VISUAL_DEBUG"] = self.options.visual_debug tc.variables["CCTAG_NO_COUT"] = self.options.no_cout - tc.variables["CCTAG_WITH_CUDA"] = self.options.with_cuda tc.variables["CCTAG_BUILD_APPS"] = False - tc.variables["CCTAG_CUDA_CC_CURRENT_ONLY"] = False - tc.variables["CCTAG_NVCC_WARNINGS"] = False tc.variables["CCTAG_EIGEN_NO_ALIGN"] = True tc.variables["CCTAG_USE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) tc.variables["CCTAG_ENABLE_SIMD_AVX2"] = False tc.variables["CCTAG_BUILD_TESTS"] = False tc.variables["CCTAG_BUILD_DOC"] = False - tc.variables["CCTAG_NO_THRUST_COPY_IF"] = False + + tc.variables["CCTAG_WITH_CUDA"] = self.options.with_cuda + tc.variables["CCTAG_CUDA_CC_CURRENT_ONLY"] = False + tc.variables["CCTAG_NVCC_WARNINGS"] = False + if self.options.cuda_cc_list: + tc.variables["CCTAG_CUDA_CC_LIST_INIT"] = self.options.cuda_cc_list tc.generate() deps = CMakeDeps(self) @@ -118,6 +128,12 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "${OpenCV_LIBS}", "opencv_core opencv_videoio opencv_imgproc opencv_imgcodecs") + # From https://github.com/alicevision/CCTag/pull/210/files CCTAG_CUDA_CC_LIST_INIT0 variable doesn't exists anymore in favor of a chooseCudaCC() cmake function + if Version(self.version) < "1.0.4": + # Remove very old CUDA compute capabilities + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CCTAG_CUDA_CC_LIST_INIT0 3.5 3.7 5.0 5.2)", + "set(CCTAG_CUDA_CC_LIST_INIT0 5.0 5.2)") def build(self): self._patch_sources() @@ -139,17 +155,31 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["dl", "pthread"]) self.cpp_info.requires = [ - "boost::atomic", "boost::chrono", "boost::date_time", "boost::exception", - "boost::filesystem", "boost::serialization", "boost::system", - "boost::thread", "boost::timer", "boost::math_c99", "eigen::eigen", - "onetbb::onetbb", "opencv::opencv_core", "opencv::opencv_videoio", - "opencv::opencv_imgproc", "opencv::opencv_imgcodecs", + "boost::atomic", + "boost::chrono", + "boost::date_time", + "boost::exception", + "boost::filesystem", + "boost::math_c99", + "boost::serialization", + "boost::system", + "boost::thread", + "boost::timer", + "eigen::eigen", + "onetbb::onetbb", + "opencv::opencv_core", + "opencv::opencv_imgcodecs", + "opencv::opencv_imgproc", + "opencv::opencv_videoio", ] if self.settings.os == "Windows": self.cpp_info.requires.append("boost::stacktrace_windbg") else: self.cpp_info.requires.append("boost::stacktrace_basic") + # CCTag links against shared CUDA runtime by default and does not use it in headers, + # so we don't need to explicitly link against it. + # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "CCTag" self.cpp_info.names["cmake_find_package_multi"] = "CCTag" diff --git a/recipes/cctag/all/patches/0001-honor-vc-runtime.patch b/recipes/cctag/all/patches/1.0.1-0001-honor-vc-runtime.patch similarity index 100% rename from recipes/cctag/all/patches/0001-honor-vc-runtime.patch rename to recipes/cctag/all/patches/1.0.1-0001-honor-vc-runtime.patch diff --git a/recipes/cctag/all/patches/1.0.1-0002-fix-missing-define.patch b/recipes/cctag/all/patches/1.0.1-0002-fix-missing-define.patch new file mode 100644 index 0000000000000..26658b4f5bbf2 --- /dev/null +++ b/recipes/cctag/all/patches/1.0.1-0002-fix-missing-define.patch @@ -0,0 +1,29 @@ +From b49d710ab6870a865c20c943a65bd6dca906a184 Mon Sep 17 00:00:00 2001 +From: Simone Gasparini +Date: Fri, 7 Oct 2022 23:37:33 +0200 +Subject: [PATCH] [cctag] add osx fix _GNU_SOURCE + +as per +https://github.com/boostorg/stacktrace/issues/88 +--- + src/cctag/utils/Exceptions.hpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/cctag/utils/Exceptions.hpp b/src/cctag/utils/Exceptions.hpp +index 1e16b9b5..46067cff 100644 +--- a/src/cctag/utils/Exceptions.hpp ++++ b/src/cctag/utils/Exceptions.hpp +@@ -7,6 +7,13 @@ + */ + #ifndef _CCTAG_EXCEPTIONS_HPP_ + #define _CCTAG_EXCEPTIONS_HPP_ ++ ++// This fix is necessary on Apple and on Windows using cygwin to avoid the compilation error ++// #error "Boost.Stacktrace requires `_Unwind_Backtrace` function. ++// see https://github.com/boostorg/stacktrace/issues/88 ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE ++#endif + + #include + #include diff --git a/recipes/cctag/all/patches/1.0.3-0001-honor-vc-runtime.patch b/recipes/cctag/all/patches/1.0.3-0001-honor-vc-runtime.patch new file mode 100644 index 0000000000000..25d94454a5b93 --- /dev/null +++ b/recipes/cctag/all/patches/1.0.3-0001-honor-vc-runtime.patch @@ -0,0 +1,20 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -41,7 +41,7 @@ + else() + message(STATUS "Building in ${CMAKE_BUILD_TYPE} configuration") + endif() +- ++if(0) + # ensure the proper linker flags when building the static version on MSVC + if(MSVC AND NOT BUILD_SHARED_LIBS) + foreach(config "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO") +@@ -65,7 +65,7 @@ + endif() + list(APPEND CUDA_NVCC_FLAGS -Xcompiler ${CCTAG_MVSC_LINKER}) + endif() +- ++endif() + set(CCTAG_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD ${CCTAG_CXX_STANDARD}) + set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/recipes/cctag/all/patches/1.0.3-0002-fix-boost-deprecated-includes.patch b/recipes/cctag/all/patches/1.0.3-0002-fix-boost-deprecated-includes.patch new file mode 100644 index 0000000000000..503defa4a3e7e --- /dev/null +++ b/recipes/cctag/all/patches/1.0.3-0002-fix-boost-deprecated-includes.patch @@ -0,0 +1,16 @@ +Fixes "This header is deprecated. Use instead.", etc. deprecation warnings. +--- src/cctag/CCTagMarkersBank.hpp ++++ src/cctag/CCTagMarkersBank.hpp +@@ -9,9 +9,9 @@ + #define VISION_MARKER_CCTAG_MARKERS_BANK_HPP + + #include +-#include +-#include +-#include ++#include ++#include ++#include + #include + + #include diff --git a/recipes/cctag/all/test_package/CMakeLists.txt b/recipes/cctag/all/test_package/CMakeLists.txt index 726cfa83f1842..13a45a1a55e3a 100644 --- a/recipes/cctag/all/test_package/CMakeLists.txt +++ b/recipes/cctag/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(CCTag REQUIRED CONFIG) diff --git a/recipes/cctag/all/test_v1_package/CMakeLists.txt b/recipes/cctag/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cctag/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cctag/all/test_v1_package/conanfile.py b/recipes/cctag/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cctag/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_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/cctag/config.yml b/recipes/cctag/config.yml index 715e55357a17b..20e7cbd11f28a 100644 --- a/recipes/cctag/config.yml +++ b/recipes/cctag/config.yml @@ -1,3 +1,7 @@ versions: + "1.0.4": + folder: all + "1.0.3": + folder: all "1.0.1": folder: all diff --git a/recipes/cctz/all/conandata.yml b/recipes/cctz/all/conandata.yml index 112fd00e61958..79ee8c2ac2c09 100644 --- a/recipes/cctz/all/conandata.yml +++ b/recipes/cctz/all/conandata.yml @@ -1,8 +1,20 @@ sources: + "2.4": + url: "https://github.com/google/cctz/archive/v2.4.tar.gz" + sha256: "e1a00957d472044808a24a26f1ba020f36dc26949a69c214562d96b74093adb3" "2.3": url: "https://github.com/google/cctz/archive/v2.3.tar.gz" sha256: "8615b20d4e33e02a271c3b93a3b208e3d7d5d66880f5f6208b03426e448f32db" patches: + "2.4": + - patch_file: "patches/2.4-0001-fix-installation.patch" + patch_description: "fix install destination" + patch_type: "portability" "2.3": - - patch_file: "patches/0001-fix-installation.patch" - - patch_file: "patches/0002-fix-frameworks-apple.patch" + - patch_file: "patches/2.3-0001-fix-installation.patch" + patch_description: "fix install destination" + patch_type: "portability" + - patch_file: "patches/2.3-0002-fix-frameworks-apple.patch" + patch_description: "link CoreFoundation on macOS" + patch_type: "portability" + patch_source: "https://github.com/google/cctz/pull/97" diff --git a/recipes/cctz/all/conanfile.py b/recipes/cctz/all/conanfile.py index f4eb7ecd52b25..32c808f5562c7 100644 --- a/recipes/cctz/all/conanfile.py +++ b/recipes/cctz/all/conanfile.py @@ -3,19 +3,19 @@ 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 check_min_vs +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class CCTZConan(ConanFile): name = "cctz" + description = "C++ library for translating between absolute and civil times" + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/cctz" - description = "C++ library for translating between absolute and civil times" topics = ("time", "timezones") - license = "Apache-2.0" - package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -54,10 +54,13 @@ def generate(self): tc.variables["BUILD_TOOLS"] = self.options.build_tools tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_BENCHMARK"] = False # For shared msvc tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) <= "2.4": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support (master branch already has 3.16) tc.generate() def build(self): @@ -80,7 +83,3 @@ def package_info(self): self.cpp_info.system_libs.append("m") elif is_apple_os(self): self.cpp_info.frameworks.append("CoreFoundation") - - # TODO: to remove in conan v2 - if self.options.build_tools: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/cctz/all/patches/0001-fix-installation.patch b/recipes/cctz/all/patches/2.3-0001-fix-installation.patch similarity index 100% rename from recipes/cctz/all/patches/0001-fix-installation.patch rename to recipes/cctz/all/patches/2.3-0001-fix-installation.patch diff --git a/recipes/cctz/all/patches/0002-fix-frameworks-apple.patch b/recipes/cctz/all/patches/2.3-0002-fix-frameworks-apple.patch similarity index 100% rename from recipes/cctz/all/patches/0002-fix-frameworks-apple.patch rename to recipes/cctz/all/patches/2.3-0002-fix-frameworks-apple.patch diff --git a/recipes/cctz/all/patches/2.4-0001-fix-installation.patch b/recipes/cctz/all/patches/2.4-0001-fix-installation.patch new file mode 100644 index 0000000000000..14cc64c0dac26 --- /dev/null +++ b/recipes/cctz/all/patches/2.4-0001-fix-installation.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 472f26f..553876c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -170,7 +170,7 @@ include(GNUInstallDirs) + install(TARGETS cctz + EXPORT ${PROJECT_NAME}-targets + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cctz +- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) diff --git a/recipes/cctz/all/test_package/CMakeLists.txt b/recipes/cctz/all/test_package/CMakeLists.txt index ed91192a576a9..de8a6b168dcf2 100644 --- a/recipes/cctz/all/test_package/CMakeLists.txt +++ b/recipes/cctz/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(cctz REQUIRED CONFIG) diff --git a/recipes/cctz/all/test_v1_package/CMakeLists.txt b/recipes/cctz/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cctz/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cctz/all/test_v1_package/conanfile.py b/recipes/cctz/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cctz/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_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/cctz/config.yml b/recipes/cctz/config.yml index 3b05bfcc11215..fc444f7e23a6d 100644 --- a/recipes/cctz/config.yml +++ b/recipes/cctz/config.yml @@ -1,3 +1,5 @@ versions: + "2.4": + folder: all "2.3": folder: all diff --git a/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt b/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt index d4bbd419ef9db..c679b4733dd5a 100644 --- a/recipes/cd3-boost-unit-definitions/all/test_package/CMakeLists.txt +++ b/recipes/cd3-boost-unit-definitions/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(BoostUnitDefinitions REQUIRED CONFIG) diff --git a/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt b/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b5b37b01b534c..0000000000000 --- a/recipes/cd3-boost-unit-definitions/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py b/recipes/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/cd3-boost-unit-definitions/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/celero/all/conandata.yml b/recipes/celero/all/conandata.yml index 5c189657151ee..854be338c3c4d 100644 --- a/recipes/celero/all/conandata.yml +++ b/recipes/celero/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.9.0": + url: "https://github.com/DigitalInBlue/Celero/archive/v2.9.0.tar.gz" + sha256: "d59df84696e0dd58022d2c42837362c06eba6d1e29bac61f7b3143bc73d779e5" "2.8.2": url: "https://github.com/DigitalInBlue/Celero/archive/v2.8.2.tar.gz" sha256: "7d2131ba27ca5343b31f1e04777ed3e666e2ad7f785e79c960c872fc48cd5f88" @@ -6,11 +9,33 @@ sources: url: "https://github.com/DigitalInBlue/Celero/archive/v2.6.0.tar.gz" sha256: "a5b72da254f81d42369382ba3157229b6b32ebbb670a22b185f80db95535e66e" patches: + "2.9.0": + - patch_file: "patches/0005-2.9.0-drop-runtime.patch" + patch_description: "remove /MT /MD flags" + patch_type: "conan" + - patch_file: "patches/0006-2.9.0-fix-install-target.patch" + patch_description: "fix install target for Windows" + patch_type: "portability" "2.8.2": - patch_file: "patches/0004-2.8.2-missing-include.patch" + patch_description: "include memory header" + patch_type: "portability" + patch_source: "https://github.com/DigitalInBlue/Celero/pull/160" - patch_file: "patches/0005-drop-runtime.patch" + patch_description: "remove /MT /MD flags" + patch_type: "conan" "2.6.0": - patch_file: "patches/0001-cmake-install-pic-cxx-standard-sytem-libs.patch" + patch_description: "disable PIC, remove /std:c++14 flag, fix install path" + patch_type: "conan" - patch_file: "patches/0002-lowercase-include-system-libs-windows.patch" + patch_description: "lowercase include file names" + patch_type: "portability" - patch_file: "patches/0003-typo-declspec.patch" + patch_description: "fix typo declspec" + patch_type: "portability" + patch_source: "https://github.com/DigitalInBlue/Celero/pull/147" - patch_file: "patches/0004-2.6.0-missing-include.patch" + patch_description: "include memory header" + patch_type: "portability" + patch_source: "https://github.com/DigitalInBlue/Celero/pull/160" diff --git a/recipes/celero/all/conanfile.py b/recipes/celero/all/conanfile.py index d919314d7d0cb..b3f3afce2b69a 100644 --- a/recipes/celero/all/conanfile.py +++ b/recipes/celero/all/conanfile.py @@ -14,10 +14,9 @@ class CeleroConan(ConanFile): name = "celero" description = "C++ Benchmarking Library" license = "Apache-2.0" - topics = ("benchmark", "benchmark-tests", "measurements", "microbenchmarks") - homepage = "https://github.com/DigitalInBlue/Celero" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/DigitalInBlue/Celero" + topics = ("benchmark", "benchmark-tests", "measurements", "microbenchmarks") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -66,6 +65,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.9.0": + self.tool_requires("cmake/[>=3.22 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -90,6 +93,7 @@ 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", "celero")) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self._create_cmake_module_alias_targets( @@ -119,7 +123,7 @@ def package_info(self): if not self.options.shared: self.cpp_info.defines = ["CELERO_STATIC"] if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.system_libs = ["pthread"] + self.cpp_info.system_libs = ["pthread", "m"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["powrprof", "psapi"] diff --git a/recipes/celero/all/patches/0005-2.9.0-drop-runtime.patch b/recipes/celero/all/patches/0005-2.9.0-drop-runtime.patch new file mode 100644 index 0000000000000..8810f2aa3b2d3 --- /dev/null +++ b/recipes/celero/all/patches/0005-2.9.0-drop-runtime.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3f12ab9..73474a1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -66,17 +66,17 @@ macro(CeleroSetDefaultCompilerOptions) + target_compile_options(${PROJECT_NAME} PRIVATE /permissive-) + target_compile_options(${PROJECT_NAME} PRIVATE /MP) + +- if (NOT CELERO_COMPILE_DYNAMIC_LIBRARIES) +- if(VCPKG_CRT_LINKAGE) +- if(VCPKG_CRT_LINKAGE STREQUAL "static") +- target_compile_options(${PROJECT_NAME} PRIVATE /MT$<$:d>) +- else() +- target_compile_options(${PROJECT_NAME} PRIVATE /MD$<$:d>) +- endif() +- else() +- target_compile_options(${PROJECT_NAME} PRIVATE /MT$<$:d>) +- endif() +- endif() ++ # if (NOT CELERO_COMPILE_DYNAMIC_LIBRARIES) ++ # if(VCPKG_CRT_LINKAGE) ++ # if(VCPKG_CRT_LINKAGE STREQUAL "static") ++ # target_compile_options(${PROJECT_NAME} PRIVATE /MT$<$:d>) ++ # else() ++ # target_compile_options(${PROJECT_NAME} PRIVATE /MD$<$:d>) ++ # endif() ++ # else() ++ # target_compile_options(${PROJECT_NAME} PRIVATE /MT$<$:d>) ++ # endif() ++ # endif() + + if(CELERO_ENABLE_WARNINGS_AS_ERRORS) + target_compile_options(${PROJECT_NAME} PRIVATE /WX) diff --git a/recipes/celero/all/patches/0006-2.9.0-fix-install-target.patch b/recipes/celero/all/patches/0006-2.9.0-fix-install-target.patch new file mode 100644 index 0000000000000..b8f71eb1f7916 --- /dev/null +++ b/recipes/celero/all/patches/0006-2.9.0-fix-install-target.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3f12ab9..8c0c2e2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -274,8 +274,10 @@ install( + ) + install( + TARGETS celero +- DESTINATION ${CMAKE_INSTALL_LIBDIR} + EXPORT celero-targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + install( + EXPORT celero-targets diff --git a/recipes/celero/all/test_package/CMakeLists.txt b/recipes/celero/all/test_package/CMakeLists.txt index 0a511951ebd5f..3be937a08a8aa 100644 --- a/recipes/celero/all/test_package/CMakeLists.txt +++ b/recipes/celero/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(Celero REQUIRED CONFIG) diff --git a/recipes/celero/all/test_v1_package/CMakeLists.txt b/recipes/celero/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/celero/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/celero/all/test_v1_package/conanfile.py b/recipes/celero/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/celero/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_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/celero/config.yml b/recipes/celero/config.yml index 3f32427faf7d1..0aacb0a653fc9 100644 --- a/recipes/celero/config.yml +++ b/recipes/celero/config.yml @@ -1,4 +1,6 @@ versions: + "2.9.0": + folder: all "2.8.2": folder: all "2.6.0": diff --git a/recipes/cereal/all/test_package/CMakeLists.txt b/recipes/cereal/all/test_package/CMakeLists.txt index 70514b278957b..c647cffc9ba85 100644 --- a/recipes/cereal/all/test_package/CMakeLists.txt +++ b/recipes/cereal/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(cereal REQUIRED CONFIG) diff --git a/recipes/cereal/all/test_v1_package/CMakeLists.txt b/recipes/cereal/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3bc0d9666049d..0000000000000 --- a/recipes/cereal/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(cereal REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE cereal::cereal) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cereal/all/test_v1_package/conanfile.py b/recipes/cereal/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cereal/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_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/ceres-solver/all/test_package/CMakeLists.txt b/recipes/ceres-solver/all/test_package/CMakeLists.txt index f3987035886ae..ced1edddbe074 100644 --- a/recipes/ceres-solver/all/test_package/CMakeLists.txt +++ b/recipes/ceres-solver/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(Ceres REQUIRED CONFIG) diff --git a/recipes/cern-root/all/conanfile.py b/recipes/cern-root/all/conanfile.py index be3871ebefe4c..df3e4ad2e2372 100644 --- a/recipes/cern-root/all/conanfile.py +++ b/recipes/cern-root/all/conanfile.py @@ -90,7 +90,7 @@ def requirements(self): self.requires("opengl/system") self.requires("openssl/1.1.1l") self.requires("pcre/8.44") - self.requires("sqlite3/3.36.0") + self.requires("sqlite3/[>=3.36 <4]") self.requires("tbb/2020.3") self.requires("xorg/system") self.requires("xxhash/0.8.0") diff --git a/recipes/cern-root/all/test_package/CMakeLists.txt b/recipes/cern-root/all/test_package/CMakeLists.txt index d6093677e3757..6e58842887914 100644 --- a/recipes/cern-root/all/test_package/CMakeLists.txt +++ b/recipes/cern-root/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/certify/all/conanfile.py b/recipes/certify/all/conanfile.py index 89408b2501d3b..e89aca37b04b6 100644 --- a/recipes/certify/all/conanfile.py +++ b/recipes/certify/all/conanfile.py @@ -38,7 +38,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.83.0") + self.requires("boost/[>=1.83.0 <2]") self.requires("openssl/[>=1.1 <4]") def package_id(self): @@ -84,8 +84,15 @@ def package(self): 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"] + component_requirements = [ + "boost::headers", + "boost::filesystem", + "boost::date_time", + "openssl::openssl" + ] + + self.cpp_info.requires = component_requirements + self.cpp_info.components["_certify"].requires = component_requirements self.cpp_info.components["_certify"].names["cmake_find_package"] = "core" self.cpp_info.components["_certify"].names["cmake_find_package_multi"] = "core" diff --git a/recipes/cfgfile/all/test_package/CMakeLists.txt b/recipes/cfgfile/all/test_package/CMakeLists.txt index 678ffe7224c31..a592f01bab094 100644 --- a/recipes/cfgfile/all/test_package/CMakeLists.txt +++ b/recipes/cfgfile/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(cfgfile REQUIRED CONFIG) diff --git a/recipes/cfgfile/all/test_v1_package/CMakeLists.txt b/recipes/cfgfile/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8af52c8273805..0000000000000 --- a/recipes/cfgfile/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -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/cfgfile/all/test_v1_package/conanfile.py b/recipes/cfgfile/all/test_v1_package/conanfile.py deleted file mode 100644 index 54b7d470785a9..0000000000000 --- a/recipes/cfgfile/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,23 +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): - if not tools.cross_building(self, skip_x64_x86=True): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(str(self.requires["cfgfile"])) - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - cfg_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.cfg") - self.run("{} \"{}\"".format(bin_path, cfg_path), run_environment=True) diff --git a/recipes/cfitsio/all/conandata.yml b/recipes/cfitsio/all/conandata.yml index 8fe35bec67203..136d6931652c7 100644 --- a/recipes/cfitsio/all/conandata.yml +++ b/recipes/cfitsio/all/conandata.yml @@ -1,26 +1,32 @@ sources: + "4.4.0": + url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.4.0.tar.gz" + sha256: "95900cf95ae760839e7cb9678a7b2fad0858d6ac12234f934bd1cb6bfc246ba9" + "4.3.1": + url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.3.1.tar.gz" + sha256: "47a7c8ee05687be1e1d8eeeb94fb88f060fbf3cd8a4df52ccb88d5eb0f5062be" "4.3.0": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.3.0.tar.gz" - sha256: "734ab0198714fe43eab94a67d6987085bde5573e6babde4d05799a8d04ebb04c" + sha256: "fdadc01d09cf9f54253802c5ec87eb10de51ce4130411415ae88c30940621b8b" "4.2.0": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.2.0.tar.gz" - sha256: "ef9881973ecb9fe55732a4c1bb5ca96e63b624728f6319556939e0fe25f495e8" + sha256: "eba53d1b3f6e345632bb09a7b752ec7ced3d63ec5153a848380f3880c5d61889" "4.1.0": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.1.0.tar.gz" - sha256: "748994dd1c819b88567e3539ea1f0ec2dd39fc0ed2884c033afa3da66efb5f4e" + sha256: "b367c695d2831958e7166921c3b356d5dfa51b1ecee505b97416ba39d1b6c17a" "4.0.0": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-4.0.0.tar.gz" - sha256: "88735b69bb017ee92823b9e7ee14efeae2e57fb6c00503ed3aa2820e850a7b5e" + sha256: "b2a8efba0b9f86d3e1bd619f662a476ec18112b4f27cc441cc680a4e3777425e" "3.490": url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.49.tar.gz" - sha256: "8cc4beddd0ff389fb81bde9c181e0e3c419c15ec8a66df201ff4619a93715558" - "3.480": - url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.48.tar.gz" - sha256: "fc369363616753fa4dbe9bf28fa7e49cc1b057081229d89b52087d85ef303314" - "3.470": - url: "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.47.tar.gz" - sha256: "985606e058403c073a68d95be74e9696f0ded9414520784457a1d4cba8cca7e2" + sha256: "5b65a20d5c53494ec8f638267fca4a629836b7ac8dd0ef0266834eab270ed4b3" patches: + "4.4.0": + - patch_file: "patches/windows-use-strtok_s.patch" + - patch_file: "patches/fix-cmake-4.2.0.patch" + "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" @@ -36,9 +42,3 @@ patches: "3.490": - patch_file: "patches/windows-use-strtok_s.patch" - patch_file: "patches/fix-cmake-3.490.patch" - "3.480": - - patch_file: "patches/windows-use-strtok_s.patch" - - patch_file: "patches/fix-cmake-3.470.patch" - "3.470": - - patch_file: "patches/windows-use-strtok_s.patch" - - patch_file: "patches/fix-cmake-3.470.patch" diff --git a/recipes/cfitsio/all/conanfile.py b/recipes/cfitsio/all/conanfile.py index 782f21cb2a73b..e2f5688059f62 100644 --- a/recipes/cfitsio/all/conanfile.py +++ b/recipes/cfitsio/all/conanfile.py @@ -1,9 +1,10 @@ +import glob +import os + 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 glob -import os required_conan_version = ">=1.54.0" @@ -12,7 +13,7 @@ class CfitsioConan(ConanFile): name = "cfitsio" description = "C library for reading and writing data files in FITS " \ "(Flexible Image Transport System) data format" - license = "CFITSIO" + license = ("CFITSIO", "NASA-1.3") topics = ("fits", "image", "nasa", "astronomy", "astrophysics", "space") homepage = "https://heasarc.gsfc.nasa.gov/fitsio/" url = "https://github.com/conan-io/conan-center-index" @@ -104,7 +105,11 @@ def build(self): cmake.build() def package(self): - copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) >= "4.4.0": + copy(self, "NASA*", src=os.path.join(self.source_folder, "licenses"), + 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", "pkgconfig")) diff --git a/recipes/cfitsio/all/patches/fix-cmake-3.470.patch b/recipes/cfitsio/all/patches/fix-cmake-3.470.patch deleted file mode 100644 index 46df9c1140c70..0000000000000 --- a/recipes/cfitsio/all/patches/fix-cmake-3.470.patch +++ /dev/null @@ -1,223 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -3,8 +3,8 @@ - # Suppress warning about WIN32 no longer being defined on Cygwin: - SET(CMAKE_LEGACY_CYGWIN_WIN32 0) - -+CMAKE_MINIMUM_REQUIRED(VERSION 3.1) - PROJECT(CFITSIO) --CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) - - # Allow @rpath token in target install name on Macs. - # See "cmake --help-policy CMP0042" for more information. -@@ -12,12 +12,14 @@ IF(POLICY CMP0042) - CMAKE_POLICY(SET CMP0042 NEW) - ENDIF() - --INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) --INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -+INCLUDE(CheckSymbolExists) -+INCLUDE(CheckCSourceCompiles) - - # Allow the developer to select if Dynamic or Static libraries are built - OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON) - OPTION (USE_PTHREADS "Thread-safe build (using pthreads)" OFF) -+OPTION(CFITSIO_USE_SSE2 "Enable use of instructions in the SSE2 extended instruction set" OFF) -+OPTION(CFITSIO_USE_SSSE3 "Enable use of instructions in the SSSE3 extended instruction set" OFF) - - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") - set (LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") -@@ -55,12 +57,19 @@ IF (BUILD_SHARED_LIBS) - ENDIF (BUILD_SHARED_LIBS) - - --FILE(GLOB H_FILES "*.h") -+SET(H_FILES fitsio.h fitsio2.h longnam.h) -+SET(LINK_LIBS "") - - IF (USE_PTHREADS) -- FIND_PACKAGE(pthreads REQUIRED) -- INCLUDE_DIRECTORIES(${PTHREADS_INCLUDE_DIR}) -- ADD_DEFINITIONS(-D_REENTRANT) -+ SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) -+ SET(THREADS_PREFER_PTHREAD_FLAG TRUE) -+ FIND_PACKAGE(Threads REQUIRED) -+ IF(CMAKE_USE_PTHREADS_INIT) -+ LIST(APPEND LINK_LIBS "Threads::Threads") -+ ELSE() -+ find_package(pthreads4w REQUIRED CONFIG) -+ LIST(APPEND LINK_LIBS "pthreads4w::pthreads4w") -+ ENDIF() - ENDIF() - - # Math library (not available in MSVC or MINGW) -@@ -71,35 +80,36 @@ ELSE() - ENDIF() - - # Support for remote file drivers is not implemented for native Windows: --IF (NOT MSVC) -+IF (NOT WIN32) - # Find library needed for gethostbyname: -- CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) -- IF(NOT CMAKE_HAVE_GETHOSTBYNAME) -- CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_HAVE_GETHOSTBYNAME) -- ENDIF() -+ CHECK_SYMBOL_EXISTS(gethostbyname "netdb.h" CMAKE_HAVE_GETHOSTBYNAME) - - # Find library needed for connect: -- CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT) -- IF(NOT CMAKE_HAVE_CONNECT) -- CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_HAVE_CONNECT) -- ENDIF() -+ CHECK_SYMBOL_EXISTS(connect "sys/types.h;sys/socket.h" CMAKE_HAVE_CONNECT) - - # Define HAVE_NET_SERVICES if gethostbyname & connect were found: - IF (CMAKE_HAVE_GETHOSTBYNAME AND CMAKE_HAVE_CONNECT) - ADD_DEFINITIONS(-DHAVE_NET_SERVICES) -+ CHECK_SYMBOL_EXISTS(fmemopen "stdio.h" HAVE_FMEMOPEN) -+ IF(HAVE_FMEMOPEN) -+ ADD_DEFINITIONS(-DHAVE_FMEMOPEN) -+ ENDIF() - ENDIF () - - # Find curl library, for HTTPS support: -- FIND_PACKAGE(CURL) -- IF (CURL_FOUND) -- INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) -- ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) -+ OPTION(UseCurl "UseCurl" ON) -+ IF (UseCurl) -+ FIND_PACKAGE(CURL) -+ IF (CURL_FOUND) -+ LIST(APPEND LINK_LIBS "CURL::libcurl") -+ ADD_DEFINITIONS(-DCFITSIO_HAVE_CURL) -+ ENDIF() - ENDIF() - ENDIF() - - SET(SRC_FILES - buffers.c cfileio.c checksum.c -- drvrfile.c drvrmem.c drvrnet.c -+ drvrfile.c drvrmem.c drvrnet.c drvrsmem.c - editcol.c edithdu.c eval_f.c eval_l.c eval_y.c - f77_wrap1.c f77_wrap2.c f77_wrap3.c f77_wrap4.c - fits_hcompress.c fits_hdecompress.c fitscore.c -@@ -123,27 +133,99 @@ SET(SRC_FILES - - # Only include zlib source files if we are building a shared library. - # Users will need to link their executable with zlib independently. --IF (BUILD_SHARED_LIBS) -- set(SRC_FILES ${SRC_FILES} -- zlib/adler32.c zlib/crc32.c zlib/deflate.c zlib/infback.c -- zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/trees.c -- zlib/uncompr.c zlib/zutil.c -- ) -+find_package(ZLIB REQUIRED) -+LIST(APPEND LINK_LIBS "ZLIB::ZLIB") -+ -+IF(CFITSIO_USE_SSE2) -+ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") -+ ADD_COMPILE_OPTIONS(-msse2) -+ ENDIF() -+ IF(MSVC) -+ ADD_DEFINITIONS(-D__SSE2__=1) -+ ENDIF() -+ENDIF() -+ -+IF(CFITSIO_USE_SSSE3) -+ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR -+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") -+ ADD_COMPILE_OPTIONS(-mssse3) -+ ENDIF() -+ IF(MSVC) -+ ADD_DEFINITIONS(-D__SSE2__=1 -D__SSSE3__=1) -+ ENDIF() -+ENDIF() -+ -+OPTION(CFITSIO_USE_BZIP2 "Enable bzip2 support" OFF) -+IF(CFITSIO_USE_BZIP2) -+ FIND_PACKAGE(BZip2 REQUIRED) -+ LIST(APPEND LINK_LIBS "BZip2::BZip2") -+ ADD_DEFINITIONS(-DHAVE_BZIP2=1) -+ENDIF() -+ -+# Test for the unix ftruncate function -+CHECK_SYMBOL_EXISTS(ftruncate "unistd.h" HAVE_FTRUNCATE) -+IF(HAVE_FTRUNCATE) -+ ADD_DEFINITIONS(-DHAVE_FTRUNCATE) -+ENDIF() -+ -+# Check is System V IPC is supported on this machine -+CHECK_C_SOURCE_COMPILES(" -+#include -+#include -+#include -+int main() { -+ shmat(0,0,0); -+ shmdt(0); -+ shmget(0, 0, 0); -+ semget(0, 0, 0); -+ return 0; -+}" HAVE_SHMEM_SERVICES) -+IF(HAVE_SHMEM_SERVICES) -+ ADD_DEFINITIONS(-DHAVE_SHMEM_SERVICES) -+ -+ # Some systems define flock_t, for others we have to define it ourselves -+ CHECK_C_SOURCE_COMPILES(" -+ #include -+ int main() { -+ flock_t filler; -+ return 0; -+ }" HAVE_FLOCK_T) -+ IF(HAVE_FLOCK_T) -+ ADD_DEFINITIONS(-DHAVE_FLOCK_T) -+ ENDIF() -+ -+ # Check union semun -+ CHECK_C_SOURCE_COMPILES(" -+ #include -+ #include -+ #include -+ int main() { -+ union semun filler; -+ return 0; -+ }" HAVE_UNION_SEMUN) -+ IF(HAVE_UNION_SEMUN) -+ ADD_DEFINITIONS(-DHAVE_UNION_SEMUN) -+ ENDIF() - ENDIF() - - ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) --TARGET_LINK_LIBRARIES(${LIB_NAME} ${PTHREADS_LIBRARY} ${M_LIB} ${CURL_LIBRARIES}) -+TARGET_LINK_LIBRARIES(${LIB_NAME} ${LINK_LIBS} ${M_LIB}) -+if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "12") -+ TARGET_COMPILE_OPTIONS(${LIB_NAME} PRIVATE -Wno-error=implicit-function-declaration) -+endif() - - SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_MAJOR_VERSION}) --install(TARGETS ${LIB_NAME} DESTINATION ${LIB_DESTINATION}) - install(TARGETS ${LIB_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) - install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) - --# Only build test code and executables if building a shared library: --IF (BUILD_SHARED_LIBS) -+# Do not build test code and executables: -+IF (FALSE) - - ENABLE_TESTING() - -@@ -173,7 +255,7 @@ IF (BUILD_SHARED_LIBS) - set_target_properties(FPack Funpack PROPERTIES LINK_FLAGS "setargv.obj") - endif(MSVC) - --ENDIF(BUILD_SHARED_LIBS) -+ENDIF() - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cfitsio.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/cfitsio.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cfitsio.pc DESTINATION lib/pkgconfig/) diff --git a/recipes/cfitsio/all/test_package/CMakeLists.txt b/recipes/cfitsio/all/test_package/CMakeLists.txt index 15673258662b0..687e9b63172fd 100644 --- a/recipes/cfitsio/all/test_package/CMakeLists.txt +++ b/recipes/cfitsio/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(cfitsio REQUIRED CONFIG) diff --git a/recipes/cfitsio/all/test_v1_package/CMakeLists.txt b/recipes/cfitsio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cfitsio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cfitsio/all/test_v1_package/conanfile.py b/recipes/cfitsio/all/test_v1_package/conanfile.py deleted file mode 100644 index 6fb307c712d29..0000000000000 --- a/recipes/cfitsio/all/test_v1_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 = os.path.join("bin", "test_package") - fits_name = os.path.join(self.source_folder, os.pardir, "test_package", "file011.fits") - self.run(f"{bin_path} \"{fits_name}\"", run_environment=True) diff --git a/recipes/cfitsio/config.yml b/recipes/cfitsio/config.yml index 052075e2e1199..bfb174dc329f7 100644 --- a/recipes/cfitsio/config.yml +++ b/recipes/cfitsio/config.yml @@ -1,4 +1,8 @@ versions: + "4.4.0": + folder: all + "4.3.1": + folder: all "4.3.0": folder: all "4.2.0": @@ -9,7 +13,3 @@ versions: folder: all "3.490": folder: all - "3.480": - folder: all - "3.470": - folder: all diff --git a/recipes/cgal/all/conandata.yml b/recipes/cgal/all/conandata.yml index eda02a9fb3ec4..df69f91fa95f3 100644 --- a/recipes/cgal/all/conandata.yml +++ b/recipes/cgal/all/conandata.yml @@ -14,9 +14,24 @@ sources: "5.5.3": sha256: 0a04f662693256328b05babfabb5e3a5b7db2f5a58d52e3c520df9d0828ddd73 url: https://github.com/CGAL/cgal/releases/download/v5.5.3/CGAL-5.5.3.tar.xz + "5.5.5": + sha256: c74aab989e0fefc98f1e76f96831f6a75a92ade4ea0de7501947dc42e3ec987c + url: https://github.com/CGAL/cgal/releases/download/v5.5.5/CGAL-5.5.5.tar.xz "5.6": sha256: dcab9b08a50a06a7cc2cc69a8a12200f8d8f391b9b8013ae476965c10b45161f url: https://github.com/CGAL/cgal/releases/download/v5.6/CGAL-5.6.tar.xz + "5.6.1": + sha256: cdb15e7ee31e0663589d3107a79988a37b7b1719df3d24f2058545d1bcdd5837 + url: https://github.com/CGAL/cgal/releases/download/v5.6.1/CGAL-5.6.1.tar.xz + "5.6.2": + sha256: 458f60df8e8f1f2fdad93c8f24e1aa8f4b095cc61a14fac81b90680d7306a42e + url: https://github.com/CGAL/cgal/releases/download/v5.6.2/CGAL-5.6.2.tar.xz + "6.0": + sha256: ed53a1498569a22341b482e579c6a3caf9ecbfb6e013f5a90ce780138073b520 + url: https://github.com/CGAL/cgal/releases/download/v6.0/CGAL-6.0-library.tar.xz + "6.0.1": + sha256: c752737f91d1af71fa96038f0e37945ce82a5f1fffb6200172cfcdd77755a356 + url: https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1-library.tar.xz patches: "5.3.2": - patch_file: "patches/0001-fix-for-conan.patch" @@ -43,3 +58,8 @@ patches: patch_type: bugfix patch_source: https://github.com/CGAL/cgal/pull/7502 patch_description: Fix Eigen3 support in CGAL + "5.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 diff --git a/recipes/cgal/all/conanfile.py b/recipes/cgal/all/conanfile.py index 2d4d74dba1bec..68460d558b139 100644 --- a/recipes/cgal/all/conanfile.py +++ b/recipes/cgal/all/conanfile.py @@ -2,7 +2,7 @@ import textwrap from conan import ConanFile 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.files import get, replace_in_file, rmdir, rm, copy, save, export_conandata_patches, apply_conandata_patches from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration @@ -22,17 +22,21 @@ class CgalConan(ConanFile): generators = "CMakeDeps" short_paths = True + @property + def _requires_cpp17(self): + return Version(self.version) >= "6.0" + @property def _min_cppstd(self): - return "14" + return "17" if self._requires_cpp17 else "14" @property def _minimum_compilers_version(self): return { "Visual Studio": "15", "msvc": "191", - "gcc": "5", - "clang": "5", + "gcc": "7" if self._requires_cpp17 else "5", + "clang": "7" if self._requires_cpp17 else "5", "apple-clang": "5.1", } @@ -43,9 +47,10 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.82.0") + self.requires("boost/1.83.0") self.requires("eigen/3.4.0") - self.requires("mpfr/4.1.0") + self.requires("mpfr/4.2.1") + self.requires("gmp/6.3.0") def package_id(self): self.info.clear() @@ -62,8 +67,7 @@ def validate(self): 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) + apply_conandata_patches(self) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -92,82 +96,90 @@ def package(self): 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 + CGAL requires C++14 or C++17, and specific compilers flags to enable the possibility to set FPU rounding modes. + This CMake module, from the upstream 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") -''') + content = "" + if Version(self.version) < "6.0": + 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() + ''') + + else: + content = textwrap.dedent('''\ + include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupCGALDependencies.cmake) + ''') + content += textwrap.dedent('''\ + 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 diff --git a/recipes/cgal/all/patches/0001-fix-for-conan.patch b/recipes/cgal/all/patches/0001-fix-for-conan.patch index 9f5f7328fbcd1..36b4eaceca05a 100644 --- a/recipes/cgal/all/patches/0001-fix-for-conan.patch +++ b/recipes/cgal/all/patches/0001-fix-for-conan.patch @@ -1,7 +1,7 @@ -diff --git a/Installation/cmake/modules/CGAL_Eigen3_support.cmake b/Installation/cmake/modules/CGAL_Eigen3_support.cmake +diff --git a/cmake/modules/CGAL_Eigen3_support.cmake b/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 +--- a/cmake/modules/CGAL_Eigen3_support.cmake ++++ b/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) diff --git a/recipes/cgal/config.yml b/recipes/cgal/config.yml index 3d807cdb944c7..3222dda4bec5c 100644 --- a/recipes/cgal/config.yml +++ b/recipes/cgal/config.yml @@ -9,5 +9,15 @@ versions: folder: all "5.5.3": folder: all + "5.5.5": + folder: all "5.6": folder: all + "5.6.1": + folder: all + "5.6.2": + folder: all + "6.0": + folder: all + "6.0.1": + folder: all diff --git a/recipes/cgif/all/test_v1_package/CMakeLists.txt b/recipes/cgif/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cgif/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cgif/all/test_v1_package/conanfile.py b/recipes/cgif/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cgif/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_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/cglm/all/test_v1_package/CMakeLists.txt b/recipes/cglm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9735bda16bdf4..0000000000000 --- a/recipes/cglm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cglm/all/test_v1_package/conanfile.py b/recipes/cglm/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/cglm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/cgltf/all/CMakeLists.txt b/recipes/cgltf/all/CMakeLists.txt index 86b1d0c12f541..cd2adc8ef9258 100644 --- a/recipes/cgltf/all/CMakeLists.txt +++ b/recipes/cgltf/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(cgltf C) set(SOURCES_DIR ${CMAKE_CURRENT_LIST_DIR}/src) diff --git a/recipes/cgltf/all/test_v1_package/CMakeLists.txt b/recipes/cgltf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cgltf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cgns/all/test_package/CMakeLists.txt b/recipes/cgns/all/test_package/CMakeLists.txt index bb8b97918cf4b..3613c1177165b 100644 --- a/recipes/cgns/all/test_package/CMakeLists.txt +++ b/recipes/cgns/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(CGNS CONFIG REQUIRED) diff --git a/recipes/charls/all/test_package/CMakeLists.txt b/recipes/charls/all/test_package/CMakeLists.txt index a05d57b66979e..552dfd4f92ddb 100644 --- a/recipes/charls/all/test_package/CMakeLists.txt +++ b/recipes/charls/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 C CXX) find_package(charls CONFIG REQUIRED) diff --git a/recipes/charls/all/test_v1_package/CMakeLists.txt b/recipes/charls/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/charls/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/charls/all/test_v1_package/conanfile.py b/recipes/charls/all/test_v1_package/conanfile.py deleted file mode 100644 index 4e87a21d76c99..0000000000000 --- a/recipes/charls/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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_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/chef-fun/all/test_package/CMakeLists.txt b/recipes/chef-fun/all/test_package/CMakeLists.txt index 6b9b67b1de88f..159ae0e981f56 100644 --- a/recipes/chef-fun/all/test_package/CMakeLists.txt +++ b/recipes/chef-fun/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(chef-fun REQUIRED CONFIG) diff --git a/recipes/chef-fun/all/test_v1_package/CMakeLists.txt b/recipes/chef-fun/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a8d0c7626a3cb..0000000000000 --- a/recipes/chef-fun/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) # if the project uses 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/chef-fun/all/test_v1_package/conanfile.py b/recipes/chef-fun/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/chef-fun/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/chipmunk2d/all/conandata.yml b/recipes/chipmunk2d/all/conandata.yml index 0fcc6c23d2ed4..41e39beaf8dc2 100644 --- a/recipes/chipmunk2d/all/conandata.yml +++ b/recipes/chipmunk2d/all/conandata.yml @@ -2,3 +2,10 @@ sources: "7.0.3": url: "https://chipmunk-physics.net/release/Chipmunk-7.x/Chipmunk-7.0.3.tgz" sha256: "048b0c9eff91c27bab8a54c65ad348cebd5a982ac56978e8f63667afbb63491a" + +patches: + "7.0.3": + - patch_file: "patches/0001-remove-sysctl-linux-win.patch" + patch_type: bugfix + patch_source: https://github.com/slembcke/Chipmunk2D/pull/175 + patch_description: "Needed to build with glib > 2.30" diff --git a/recipes/chipmunk2d/all/conanfile.py b/recipes/chipmunk2d/all/conanfile.py index 785d8d95d890d..53afb4be1c99c 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, replace_in_file +from conan.tools.files import copy, get, replace_in_file, apply_conandata_patches, export_conandata_patches import os required_conan_version = ">=1.53.0" @@ -52,9 +52,13 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() + def export_sources(self): + export_conandata_patches(self) + def _patch_sources(self): # The finite-math-only optimization has no effect and can cause linking errors # when linked against glibc >= 2.31 + apply_conandata_patches(self) replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-ffast-math", "-ffast-math -fno-finite-math-only") diff --git a/recipes/chipmunk2d/all/patches/0001-remove-sysctl-linux-win.patch b/recipes/chipmunk2d/all/patches/0001-remove-sysctl-linux-win.patch new file mode 100644 index 0000000000000..8b123a7652b29 --- /dev/null +++ b/recipes/chipmunk2d/all/patches/0001-remove-sysctl-linux-win.patch @@ -0,0 +1,16 @@ +--- a/src/cpHastySpace.c ++++ b/src/cpHastySpace.c +@@ -7,8 +7,12 @@ + //TODO: Move all the thread stuff to another file + + //#include +-#ifndef _WIN32 ++ ++#ifdef __APPLE__ + #include ++#endif ++ ++#ifndef _WIN32 + #include + #else + #ifndef WIN32_LEAN_AND_MEAN diff --git a/recipes/chipmunk2d/all/test_package/CMakeLists.txt b/recipes/chipmunk2d/all/test_package/CMakeLists.txt index b51652c38fd2b..d4bcd04b17d2d 100644 --- a/recipes/chipmunk2d/all/test_package/CMakeLists.txt +++ b/recipes/chipmunk2d/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(chipmunk2d REQUIRED CONFIG) diff --git a/recipes/chipmunk2d/all/test_v1_package/CMakeLists.txt b/recipes/chipmunk2d/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/chipmunk2d/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/chipmunk2d/all/test_v1_package/conanfile.py b/recipes/chipmunk2d/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/chipmunk2d/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_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/chunkio/all/conandata.yml b/recipes/chunkio/all/conandata.yml new file mode 100644 index 0000000000000..0996c6fec0b7e --- /dev/null +++ b/recipes/chunkio/all/conandata.yml @@ -0,0 +1,26 @@ +sources: + "1.5.2": + url: "https://github.com/fluent/chunkio/archive/refs/tags/v1.5.2.tar.gz" + sha256: "c73e809215454c34a79ed2a7d38abc6058da99dad8564de85e2919100fb987a5" + "1.1.6": + url: "https://github.com/fluent/chunkio/archive/refs/tags/v1.1.6.tar.gz" + sha256: "755dda0b8ccf6f5ff804b2c1a3caa938bae7b0f37d73afa12c1bf1fab4fd4c86" +patches: + "1.5.2": + - patch_file: "patches/1.5.2-0001-add-installer.patch" + patch_description: "add installer" + patch_type: "conan" + - patch_file: "patches/1.1.6-0003-disable-pic.patch" + patch_description: "disable pic on static build" + patch_type: "portability" + "1.1.6": + - patch_file: "patches/1.1.6-0001-add-installer.patch" + patch_description: "add installer" + patch_type: "conan" + - patch_file: "patches/1.1.6-0002-fix-wrong-target.patch" + patch_description: "fix wrong target" + patch_type: "bugfix" + patch_source: "https://github.com/fluent/chunkio/issues/104" + - patch_file: "patches/1.1.6-0003-disable-pic.patch" + patch_description: "disable pic on static build" + patch_type: "portability" diff --git a/recipes/chunkio/all/conanfile.py b/recipes/chunkio/all/conanfile.py new file mode 100644 index 0000000000000..eb5a32d2f4c2b --- /dev/null +++ b/recipes/chunkio/all/conanfile.py @@ -0,0 +1,79 @@ +from conan import ConanFile +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 +from conan.errors import ConanException +import os + +required_conan_version = ">=2.1" + +class ChunkIOConan(ConanFile): + name = "chunkio" + description = "Simple library to manage chunks of data in memory and file system" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fluent/chunkio" + topics = ("chunk", "io", "memory", "file") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_filesystem": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_filesystem": 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["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.variables["CIO_LIB_STATIC"] = not self.options.shared + tc.variables["CIO_LIB_SHARED"] = self.options.shared + tc.variables["CIO_BACKEND_FILESYSTEM"] = self.options.with_filesystem + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.5.2": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") + 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 = ["chunkio-shared"] if self.options.shared else ["chunkio-static", "cio-crc32"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("shlwapi") + if Version(self.version) >= "1.5.0": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/chunkio/all/patches/1.1.6-0001-add-installer.patch b/recipes/chunkio/all/patches/1.1.6-0001-add-installer.patch new file mode 100644 index 0000000000000..52a5dd664faf7 --- /dev/null +++ b/recipes/chunkio/all/patches/1.1.6-0001-add-installer.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e6d5dcb..ebf3c4c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -109,10 +109,15 @@ include_directories( + + add_subdirectory(deps/crc32) + add_subdirectory(src) +-add_subdirectory(tools) ++#add_subdirectory(tools) + + # Tests + if(CIO_TESTS) + enable_testing() + add_subdirectory(tests) + endif() ++ ++include(GNUInstallDirs) ++ ++install(DIRECTORY include/chunkio DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++install(DIRECTORY deps/monkey/include/monkey DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +diff --git a/deps/crc32/CMakeLists.txt b/deps/crc32/CMakeLists.txt +index 8ae1823..0b7dba0 100644 +--- a/deps/crc32/CMakeLists.txt ++++ b/deps/crc32/CMakeLists.txt +@@ -3,3 +3,12 @@ set(src + ) + + add_library(cio-crc32 STATIC ${src}) ++ ++if(CIO_LIB_STATIC) ++ include(GNUInstallDirs) ++ install( ++ TARGETS cio-crc32 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a4fc2d3..51736bc 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -50,3 +50,22 @@ endif() + if (NOT CIO_LIB_STATIC AND NOT CIO_LIB_SHARED) + message(FATAL_ERROR "What are you doing?, you should build something") + endif() ++ ++include(GNUInstallDirs) ++ ++if(CIO_LIB_STATIC) ++ install( ++ TARGETS chunkio-static ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() ++ ++if(CIO_LIB_SHARED) ++ install( ++ TARGETS chunkio-shared ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() diff --git a/recipes/chunkio/all/patches/1.1.6-0002-fix-wrong-target.patch b/recipes/chunkio/all/patches/1.1.6-0002-fix-wrong-target.patch new file mode 100644 index 0000000000000..3b36da5f199b1 --- /dev/null +++ b/recipes/chunkio/all/patches/1.1.6-0002-fix-wrong-target.patch @@ -0,0 +1,14 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a4fc2d3..51736bc 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -41,7 +41,7 @@ endif() + + if (CIO_LIB_SHARED) + add_library(chunkio-shared SHARED ${src}) +- target_link_libraries(chunkio-static ${libs}) ++ target_link_libraries(chunkio-shared ${libs}) + if(CIO_SANITIZE_ADDRESS) + add_sanitizers(chunkio-shared) + endif() + diff --git a/recipes/chunkio/all/patches/1.1.6-0003-disable-pic.patch b/recipes/chunkio/all/patches/1.1.6-0003-disable-pic.patch new file mode 100644 index 0000000000000..02733d0726a39 --- /dev/null +++ b/recipes/chunkio/all/patches/1.1.6-0003-disable-pic.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ebf3c4c..2db2794 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,7 +7,9 @@ set(CIO_VERSION_PATCH 6) + set(CIO_VERSION_STR "${CIO_VERSION_MAJOR}.${CIO_VERSION_MINOR}.${CIO_VERSION_PATCH}") + + # CFLAGS +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++if(BUILD_SHARED_LIBS) ++ set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++endif() + if(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 ") + else() diff --git a/recipes/chunkio/all/patches/1.5.2-0001-add-installer.patch b/recipes/chunkio/all/patches/1.5.2-0001-add-installer.patch new file mode 100644 index 0000000000000..6e02f8052fa98 --- /dev/null +++ b/recipes/chunkio/all/patches/1.5.2-0001-add-installer.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dbc7d48..a3810a5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -118,10 +118,15 @@ include_directories( + + add_subdirectory(deps/crc32) + add_subdirectory(src) +-add_subdirectory(tools) ++# add_subdirectory(tools) + + # Tests + if(CIO_TESTS) + enable_testing() + add_subdirectory(tests) + endif() ++ ++include(GNUInstallDirs) ++install(FILES ${PROJECT_BINARY_DIR}/include/chunkio/cio_info.h ${PROJECT_BINARY_DIR}/include/chunkio/cio_version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/chunkio) ++install(DIRECTORY include/chunkio DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "*.in" EXCLUDE) ++install(DIRECTORY deps/monkey/include/monkey DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +diff --git a/deps/crc32/CMakeLists.txt b/deps/crc32/CMakeLists.txt +index 8ae1823..0b7dba0 100644 +--- a/deps/crc32/CMakeLists.txt ++++ b/deps/crc32/CMakeLists.txt +@@ -3,3 +3,12 @@ set(src + ) + + add_library(cio-crc32 STATIC ${src}) ++ ++if(CIO_LIB_STATIC) ++ include(GNUInstallDirs) ++ install( ++ TARGETS cio-crc32 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index bb52273..b6e37b1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -51,3 +51,22 @@ endif() + if (NOT CIO_LIB_STATIC AND NOT CIO_LIB_SHARED) + message(FATAL_ERROR "What are you doing?, you should build something") + endif() ++ ++include(GNUInstallDirs) ++ ++if(CIO_LIB_STATIC) ++ install( ++ TARGETS chunkio-static ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() ++ ++if(CIO_LIB_SHARED) ++ install( ++ TARGETS chunkio-shared ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ) ++endif() diff --git a/recipes/chunkio/all/test_package/CMakeLists.txt b/recipes/chunkio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b429e0efccdb7 --- /dev/null +++ b/recipes/chunkio/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(chunkio REQUIRED CONFIG) + +if(chunkio_VERSION VERSION_LESS "1.5.0") + add_executable(${PROJECT_NAME} test_package.c) +else() + add_executable(${PROJECT_NAME} test_package_1_5_0.c) +endif() +target_link_libraries(${PROJECT_NAME} PRIVATE chunkio::chunkio) diff --git a/recipes/libassert/all/test_package/conanfile.py b/recipes/chunkio/all/test_package/conanfile.py similarity index 100% rename from recipes/libassert/all/test_package/conanfile.py rename to recipes/chunkio/all/test_package/conanfile.py diff --git a/recipes/chunkio/all/test_package/test_package.c b/recipes/chunkio/all/test_package/test_package.c new file mode 100644 index 0000000000000..1c8100c442be2 --- /dev/null +++ b/recipes/chunkio/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#include "chunkio/chunkio.h" +#include + +static int log_cb(struct cio_ctx *ctx, int level, const char *file, int line, + char *str) +{ + (void) ctx; + + printf("[cio-test-fs] %-60s => %s:%i\n", str, file, line); + return 0; +} + +int main() { + int flags = CIO_CHECKSUM; + struct cio_ctx *ctx = cio_create(NULL, log_cb, CIO_LOG_INFO, flags); + + cio_destroy(ctx); + + return 0; +} diff --git a/recipes/chunkio/all/test_package/test_package_1_5_0.c b/recipes/chunkio/all/test_package/test_package_1_5_0.c new file mode 100644 index 0000000000000..ebbc2de6796ec --- /dev/null +++ b/recipes/chunkio/all/test_package/test_package_1_5_0.c @@ -0,0 +1,23 @@ +#include "chunkio/chunkio.h" +#include + +static int log_cb(struct cio_ctx *ctx, int level, const char *file, int line, + char *str) +{ + (void) ctx; + + printf("[cio-test-fs] %-60s => %s:%i\n", str, file, line); + return 0; +} + +int main() { + struct cio_options options; + cio_options_init(&options); + options.flags = CIO_CHECKSUM; + options.log_level = CIO_LOG_INFO; + struct cio_ctx *ctx = cio_create(&options); + + cio_destroy(ctx); + + return 0; +} diff --git a/recipes/chunkio/config.yml b/recipes/chunkio/config.yml new file mode 100644 index 0000000000000..2ac2738283086 --- /dev/null +++ b/recipes/chunkio/config.yml @@ -0,0 +1,5 @@ +versions: + "1.5.2": + folder: "all" + "1.1.6": + folder: "all" diff --git a/recipes/cigi-ccl/all/conandata.yml b/recipes/cigi-ccl/all/conandata.yml new file mode 100644 index 0000000000000..f77d32f6993f8 --- /dev/null +++ b/recipes/cigi-ccl/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "4.0.6a": + url: + - "https://master.dl.sourceforge.net/project/cigi/CIGI%20Class%20Library%20%28CCL%29/CCL%20Version%204.0.6a/ccl_4_0%20rev6a.zip" + sha256: "a55099c0418c663e572109bd62ed2f7b411c51af7b404212988e36360e8a13cc" diff --git a/recipes/cigi-ccl/all/conanfile.py b/recipes/cigi-ccl/all/conanfile.py new file mode 100644 index 0000000000000..5237537049f2f --- /dev/null +++ b/recipes/cigi-ccl/all/conanfile.py @@ -0,0 +1,102 @@ +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, is_msvc_static_runtime +from conan.tools.apple import is_apple_os +import os + +required_conan_version = ">=1.53.0" + +class CigiClConan(ConanFile): + name = "cigi-ccl" + description = "Industry standard communication with compliant image generators" + license = "LGPL-2.1-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://cigi.sourceforge.io/product_ccl.php" + topics = ("simulation", "interface engines", "data visualization") + 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 validate(self): + if is_apple_os(self): + # CigiOutgoingMsg.cpp:196:38: error: use of undeclared identifier 'PTHREAD_MUTEX_RECURSIVE_NP' + raise ConanInvalidConfiguration(f"{self.settings.os} Conan recipe is not supported on Apple. Contributions are welcome.") + + 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["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + + tc.generate() + + def _patch_sources(self): + cmake_lists_fixes = { + # This old CMakeLists.txt had PROJECT() before CMAKE_MINIMUM_REQUIRED(); this order must be inverted + "CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7)": "", + "PROJECT(ccl)": "CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7)\nPROJECT(ccl)", + # Using backslash for path is being interpreted as invalid escape sequence in newer versions of CMake + "Header Files\\": "Header Files/", + "Source Files\\": "Source Files/", + # Incorrectly tries to install both the static and shared targets + "INSTALL(TARGETS cigicl-static cigicl-shared": f"INSTALL(TARGETS {'cigicl-shared' if self.options.shared else 'cigicl-static'}" + } + + for old, new in cmake_lists_fixes.items(): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), old, new) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + if self.options.shared: + cmake.build(target="cigicl-shared") + else: + cmake.build(target="cigicl-static") + + def package(self): + cmake = CMake(self) + cmake.install() + + copy(self, "license.html", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING", 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")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "cigicl") + build_type_suffix = "" + if self.settings.build_type == "Debug" and self.settings.os == "Windows": + build_type_suffix = "D" + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) + + if self.options.shared: + self.cpp_info.libs = ["ccl_dll" + build_type_suffix] + self.cpp_info.defines = ["CCL_DLL"] + else: + self.cpp_info.libs = ["ccl_lib" + build_type_suffix] diff --git a/recipes/cigi-ccl/all/test_package/CMakeLists.txt b/recipes/cigi-ccl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9ff9e1c44f12c --- /dev/null +++ b/recipes/cigi-ccl/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(cigi-ccl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE cigi-ccl::cigi-ccl) diff --git a/recipes/cigi-ccl/all/test_package/conanfile.py b/recipes/cigi-ccl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f5cf204295e19 --- /dev/null +++ b/recipes/cigi-ccl/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/cigi-ccl/all/test_package/test_package.cpp b/recipes/cigi-ccl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9a4a0a228de16 --- /dev/null +++ b/recipes/cigi-ccl/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main(void) { + CigiOutgoingMsg message; + message.CreateBuffer(); + return 0; +} diff --git a/recipes/cigi-ccl/config.yml b/recipes/cigi-ccl/config.yml new file mode 100644 index 0000000000000..f73e93e2624ef --- /dev/null +++ b/recipes/cigi-ccl/config.yml @@ -0,0 +1,3 @@ +versions: + "4.0.6a": + folder: all diff --git a/recipes/cimg/all/conandata.yml b/recipes/cimg/all/conandata.yml index df56684723fbd..96bd683acd199 100644 --- a/recipes/cimg/all/conandata.yml +++ b/recipes/cimg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "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" diff --git a/recipes/cimg/all/conanfile.py b/recipes/cimg/all/conanfile.py index b626bca664ae6..fa4663a48bbd0 100644 --- a/recipes/cimg/all/conanfile.py +++ b/recipes/cimg/all/conanfile.py @@ -70,7 +70,7 @@ def requirements(self): if self.options.enable_openexr: self.requires("openexr/3.2.1") if self.options.enable_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.enable_tiff: self.requires("libtiff/4.6.0") if self.options.enable_ffmpeg: diff --git a/recipes/cimg/all/test_package/CMakeLists.txt b/recipes/cimg/all/test_package/CMakeLists.txt index 449f2a9e10e69..6338384d71429 100644 --- a/recipes/cimg/all/test_package/CMakeLists.txt +++ b/recipes/cimg/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(cimg REQUIRED CONFIG) diff --git a/recipes/cimg/config.yml b/recipes/cimg/config.yml index 0ba296b3e93c6..70cd903d901e9 100644 --- a/recipes/cimg/config.yml +++ b/recipes/cimg/config.yml @@ -1,4 +1,6 @@ versions: + "3.3.2": + folder: all "3.3.0": folder: all "3.2.6": diff --git a/recipes/circularbuffer/all/conandata.yml b/recipes/circularbuffer/all/conandata.yml index ba45559184f9d..3b5cc436148eb 100644 --- a/recipes/circularbuffer/all/conandata.yml +++ b/recipes/circularbuffer/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.0": + url: "https://github.com/rlogiacco/CircularBuffer/archive/refs/tags/1.4.0.tar.gz" + sha256: "e01a837d2fe46fea168e8d36e1a4225d9414a855484d55b5a240f239ab53fc0a" "1.3.3": url: "https://github.com/rlogiacco/CircularBuffer/archive/refs/tags/1.3.3.tar.gz" sha256: "d558029c9ab5012a8bbf9a89bd130eb320bdeb69e3f8bd96851ddc1e5dc24eba" diff --git a/recipes/circularbuffer/all/conanfile.py b/recipes/circularbuffer/all/conanfile.py index 695a6ea119334..2bdc97e38979c 100644 --- a/recipes/circularbuffer/all/conanfile.py +++ b/recipes/circularbuffer/all/conanfile.py @@ -10,10 +10,10 @@ class CircularBufferConan(ConanFile): name = "circularbuffer" description = "Arduino circular buffer library" - topics = ("circular buffer", "arduino", "data-structures") license = "LGPL-3.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/rlogiacco/CircularBuffer" + topics = ("circular buffer", "arduino", "data-structures", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -29,7 +29,7 @@ def source(self): def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "CircularBuffer.h", + 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) diff --git a/recipes/circularbuffer/all/test_package/CMakeLists.txt b/recipes/circularbuffer/all/test_package/CMakeLists.txt index 933c1c7ab13f6..95df0ee16539a 100644 --- a/recipes/circularbuffer/all/test_package/CMakeLists.txt +++ b/recipes/circularbuffer/all/test_package/CMakeLists.txt @@ -6,3 +6,7 @@ find_package(circularbuffer CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE circularbuffer::circularbuffer) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(circularbuffer_VERSION VERSION_GREATER_EQUAL "1.4.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE CIRCULARBUFFER_1_4_0_LATER) +endif() diff --git a/recipes/circularbuffer/all/test_package/test_package.cpp b/recipes/circularbuffer/all/test_package/test_package.cpp index c9d59e4b258c6..eb914270c4c82 100644 --- a/recipes/circularbuffer/all/test_package/test_package.cpp +++ b/recipes/circularbuffer/all/test_package/test_package.cpp @@ -1,4 +1,8 @@ +#ifdef CIRCULARBUFFER_1_4_0_LATER +#include +#else #include +#endif int main() { CircularBuffer buffer; diff --git a/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt b/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/circularbuffer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/circularbuffer/all/test_v1_package/conanfile.py b/recipes/circularbuffer/all/test_v1_package/conanfile.py deleted file mode 100644 index 90eb89e3f2f46..0000000000000 --- a/recipes/circularbuffer/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/circularbuffer/config.yml b/recipes/circularbuffer/config.yml index 3abfca40293f6..623dc27ffe730 100644 --- a/recipes/circularbuffer/config.yml +++ b/recipes/circularbuffer/config.yml @@ -1,3 +1,5 @@ versions: + "1.4.0": + folder: all "1.3.3": folder: all diff --git a/recipes/cista/all/conandata.yml b/recipes/cista/all/conandata.yml index 1547b3bc2b229..02747f36f74ac 100644 --- a/recipes/cista/all/conandata.yml +++ b/recipes/cista/all/conandata.yml @@ -1,4 +1,14 @@ sources: + "0.15": + - url: "https://github.com/felixguendling/cista/releases/download/v0.15/cista.h" + sha256: "45685fde5c5ef576ad821c4db7f01e375eb2668aa6dafd6b9627fe58ce0641eb" + - url: "https://raw.githubusercontent.com/felixguendling/cista/v0.15/LICENSE" + sha256: "fcd47e35fd6dc22feec454c5c1e572ccb7587dedd91d824528ebbb00a7f37c56" + "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/test_package/CMakeLists.txt b/recipes/cista/all/test_package/CMakeLists.txt index 17a27c55f0b49..4e04ff497cea4 100644 --- a/recipes/cista/all/test_package/CMakeLists.txt +++ b/recipes/cista/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(cista REQUIRED CONFIG) diff --git a/recipes/cista/all/test_v1_package/CMakeLists.txt b/recipes/cista/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/cista/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cista/all/test_v1_package/conanfile.py b/recipes/cista/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cista/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_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/cista/config.yml b/recipes/cista/config.yml index ac2c19b16c278..205c7eaece71d 100644 --- a/recipes/cista/config.yml +++ b/recipes/cista/config.yml @@ -1,4 +1,8 @@ versions: + "0.15": + folder: all + "0.14": + folder: all "0.11": folder: all "0.10": diff --git a/recipes/cityhash/all/test_package/CMakeLists.txt b/recipes/cityhash/all/test_package/CMakeLists.txt index 9fbe304115d9e..81a18b39019c3 100644 --- a/recipes/cityhash/all/test_package/CMakeLists.txt +++ b/recipes/cityhash/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(cityhash REQUIRED CONFIG) diff --git a/recipes/cityhash/all/test_v1_package/CMakeLists.txt b/recipes/cityhash/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cityhash/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cityhash/all/test_v1_package/conanfile.py b/recipes/cityhash/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cityhash/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_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/civetweb/all/conanfile.py b/recipes/civetweb/all/conanfile.py index b393da542821b..d7ccad2b88226 100644 --- a/recipes/civetweb/all/conanfile.py +++ b/recipes/civetweb/all/conanfile.py @@ -22,6 +22,7 @@ class CivetwebConan(ConanFile): "fPIC": [True, False], "shared": [True, False], "ssl_dynamic_loading": [True, False], + "thread_stack_size": [None, "ANY"], "with_caching": [True, False], "with_cgi": [True, False], "with_cxx": [True, False], @@ -39,6 +40,7 @@ class CivetwebConan(ConanFile): "fPIC": True, "shared": False, "ssl_dynamic_loading": False, + "thread_stack_size": None, "with_caching": True, "with_cgi": True, "with_cxx": True, @@ -92,6 +94,8 @@ def requirements(self): def validate(self): if self.options.get_safe("ssl_dynamic_loading") and not self.dependencies["openssl"].options.shared: raise ConanInvalidConfiguration("ssl_dynamic_loading requires shared openssl") + if self.options.thread_stack_size and not str(self.options.thread_stack_size).isdigit(): + raise ConanInvalidConfiguration("-o='civetweb/*:thread_stack_size' should be a positive integer") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -122,6 +126,8 @@ def generate(self): tc.variables["CIVETWEB_ENABLE_THIRD_PARTY_OUTPUT"] = self.options.with_third_party_output tc.variables["CIVETWEB_ENABLE_WEBSOCKETS"] = self.options.with_websockets tc.variables["CIVETWEB_SERVE_NO_FILES"] = not self.options.with_static_files + if self.options.thread_stack_size: + tc.variables["CIVETWEB_THREAD_STACK_SIZE"] = self.options.thread_stack_size if self._has_zlib_option: tc.variables["CIVETWEB_ENABLE_ZLIB"] = self.options.with_zlib diff --git a/recipes/civetweb/all/test_package/CMakeLists.txt b/recipes/civetweb/all/test_package/CMakeLists.txt index 8ec3a0b53c970..2a31b6d93f3fd 100644 --- a/recipes/civetweb/all/test_package/CMakeLists.txt +++ b/recipes/civetweb/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(civetweb REQUIRED) diff --git a/recipes/civetweb/all/test_v1_package/CMakeLists.txt b/recipes/civetweb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/civetweb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/civetweb/all/test_v1_package/conanfile.py b/recipes/civetweb/all/test_v1_package/conanfile.py deleted file mode 100644 index 6f09f10193d23..0000000000000 --- a/recipes/civetweb/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, tools, 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 tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/cjson/all/conandata.yml b/recipes/cjson/all/conandata.yml index 3c51bd5b253a1..32c4ecff90851 100644 --- a/recipes/cjson/all/conandata.yml +++ b/recipes/cjson/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.7.18": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.18.tar.gz" + sha256: "3aa806844a03442c00769b83e99970be70fbef03735ff898f4811dd03b9f5ee5" + "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" diff --git a/recipes/cjson/all/conanfile.py b/recipes/cjson/all/conanfile.py index e715bfc8ad197..1c91b5335f595 100644 --- a/recipes/cjson/all/conanfile.py +++ b/recipes/cjson/all/conanfile.py @@ -1,24 +1,23 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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 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.54.0" +required_conan_version = ">=2.1" class CjsonConan(ConanFile): name = "cjson" description = "Ultralightweight JSON parser in ANSI C." license = "MIT" - topics = ("json", "parser") - homepage = "https://github.com/DaveGamble/cJSON" url = "https://github.com/conan-io/conan-center-index" - - package_type = "library" + homepage = "https://github.com/DaveGamble/cJSON" + topics = ("json", "parser") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -69,8 +68,11 @@ def generate(self): tc.variables["ENABLE_LOCALES"] = self.options.use_locales tc.variables["ENABLE_FUZZING"] = False tc.variables["ENABLE_CUSTOM_COMPILER_FLAGS"] = False - # Relocatable shared libs on macOS + # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.7.18": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): @@ -86,30 +88,6 @@ def package(self): 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* & pkg_config generators removed - targets = {"cjson": "cJSON::cjson"} - if self.options.utils: - targets.update({"cjson_utils": "cJSON::cjson_utils"}) - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - targets - ) - - 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", "cJSON") @@ -124,18 +102,3 @@ def package_info(self): self.cpp_info.components["cjson_utils"].set_property("pkg_config_name", "libcjson_utils") self.cpp_info.components["cjson_utils"].libs = ["cjson_utils"] self.cpp_info.components["cjson_utils"].requires = ["_cjson"] - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "cJSON" - self.cpp_info.names["cmake_find_package_multi"] = "cJSON" - self.cpp_info.components["_cjson"].names["cmake_find_package"] = "cjson" - self.cpp_info.components["_cjson"].names["cmake_find_package_multi"] = "cjson" - self.cpp_info.components["_cjson"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["_cjson"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - self.cpp_info.components["_cjson"].names["pkg_config"] = "libcjson" - if self.options.utils: - self.cpp_info.components["cjson_utils"].names["cmake_find_package"] = "cjson_utils" - self.cpp_info.components["cjson_utils"].names["cmake_find_package_multi"] = "cjson_utils" - self.cpp_info.components["cjson_utils"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["cjson_utils"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - self.cpp_info.components["cjson_utils"].names["pkg_config"] = "libcjson_utils" diff --git a/recipes/cjson/all/test_package/CMakeLists.txt b/recipes/cjson/all/test_package/CMakeLists.txt index 84258514da5b3..716152892c55b 100644 --- a/recipes/cjson/all/test_package/CMakeLists.txt +++ b/recipes/cjson/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(cJSON REQUIRED CONFIG) diff --git a/recipes/cjson/all/test_v1_package/CMakeLists.txt b/recipes/cjson/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cjson/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cjson/all/test_v1_package/conanfile.py b/recipes/cjson/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cjson/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_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/cjson/config.yml b/recipes/cjson/config.yml index 7d96cfac89098..08843263806b5 100644 --- a/recipes/cjson/config.yml +++ b/recipes/cjson/config.yml @@ -1,4 +1,8 @@ versions: + "1.7.18": + folder: all + "1.7.17": + folder: all "1.7.16": folder: all "1.7.15": diff --git a/recipes/clara/all/test_package/CMakeLists.txt b/recipes/clara/all/test_package/CMakeLists.txt index 1f340c9983632..38c1cc34a25a7 100644 --- a/recipes/clara/all/test_package/CMakeLists.txt +++ b/recipes/clara/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) # if the project uses c++ find_package(clara REQUIRED CONFIG) diff --git a/recipes/clara/all/test_v1_package/CMakeLists.txt b/recipes/clara/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/clara/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/clara/all/test_v1_package/conanfile.py b/recipes/clara/all/test_v1_package/conanfile.py deleted file mode 100644 index 2489ddc6e36c1..0000000000000 --- a/recipes/clara/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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("{} --width 640".format(bin_path), run_environment=True) - self.run("{} --help".format(bin_path), run_environment=True) diff --git a/recipes/clhep/all/conandata.yml b/recipes/clhep/all/conandata.yml index 048d5c59d63e1..0b47cdc0ae08e 100644 --- a/recipes/clhep/all/conandata.yml +++ b/recipes/clhep/all/conandata.yml @@ -1,4 +1,7 @@ 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" @@ -6,6 +9,16 @@ sources: 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" diff --git a/recipes/clhep/all/conanfile.py b/recipes/clhep/all/conanfile.py index 693c03e14c222..d048e4990d8dd 100644 --- a/recipes/clhep/all/conanfile.py +++ b/recipes/clhep/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class ClhepConan(ConanFile): @@ -57,6 +57,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["CLHEP_SINGLE_THREAD"] = False tc.variables["CLHEP_BUILD_DOCS"] = False + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -112,19 +113,7 @@ def package_info(self): self.cpp_info.components[conan_comp].libs = [lib_name] self.cpp_info.components[conan_comp].system_libs = system_libs self.cpp_info.components[conan_comp].requires = requires - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.components[conan_comp].names["cmake_find_package"] = cmake_target - self.cpp_info.components[conan_comp].names["cmake_find_package_multi"] = cmake_target - self.cpp_info.components[conan_comp].names["pkg_config"] = pkg_config_name self.cpp_info.components["clheplib"].requires.append(conan_comp) - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "CLHEP" - self.cpp_info.names["cmake_find_package_multi"] = "CLHEP" - self.cpp_info.names["pkg_config"] = "clhep" - self.cpp_info.components["clheplib"].names["cmake_find_package"] = f"CLHEP{suffix}" - self.cpp_info.components["clheplib"].names["cmake_find_package_multi"] = f"CLHEP{suffix}" self.cpp_info.components["clheplib"].set_property("cmake_target_name", f"CLHEP::CLHEP{suffix}") - self.cpp_info.components["clheplib"].names["pkg_config"] = "clhep" self.cpp_info.components["clheplib"].set_property("pkg_config_name", "clhep") diff --git a/recipes/clhep/all/test_package/CMakeLists.txt b/recipes/clhep/all/test_package/CMakeLists.txt index a757fede3cd0c..821dd7224678d 100644 --- a/recipes/clhep/all/test_package/CMakeLists.txt +++ b/recipes/clhep/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(CLHEP REQUIRED CONFIG) diff --git a/recipes/clhep/all/test_v1_package/CMakeLists.txt b/recipes/clhep/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/clhep/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/clhep/all/test_v1_package/conanfile.py b/recipes/clhep/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/clhep/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_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/clhep/config.yml b/recipes/clhep/config.yml index ad9dd349ce89d..87edeeec0d29b 100644 --- a/recipes/clhep/config.yml +++ b/recipes/clhep/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.7.1": + folder: all "2.4.6.4": folder: all "2.4.1.3": diff --git a/recipes/cli/all/conandata.yml b/recipes/cli/all/conandata.yml new file mode 100644 index 0000000000000..ab550920bd481 --- /dev/null +++ b/recipes/cli/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.2.0": + url: "https://github.com/daniele77/cli/archive/refs/tags/v2.2.0.tar.gz" + sha256: "67c6329471cd5a98b9ab29da0012f94f61497f0b60591bb0ab714d4c09c4f2b0" + "2.1.0": + url: "https://github.com/daniele77/cli/archive/refs/tags/v2.1.0.tar.gz" + sha256: "dfc9fc7c72a6cdfdf852d89f151699b57460ff49775a8ff27d2a69477649acf9" diff --git a/recipes/cli/all/conanfile.py b/recipes/cli/all/conanfile.py new file mode 100644 index 0000000000000..d36d374460adf --- /dev/null +++ b/recipes/cli/all/conanfile.py @@ -0,0 +1,64 @@ +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 + +class CLIConan(ConanFile): + name = "cli" + description = "A library for interactive command line interfaces in modern C++" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/daniele77/cli" + topics = "cli-interface", "cpp14", "no-dependencies", "header-only" + package_type = "header-library" + settings = "os", "compiler", "build_type", "arch" + no_copy_source = True + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "6", + "Visual Studio": "16", + "msvc": "192", + "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.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", 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 = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/cli/all/test_package/CMakeLists.txt b/recipes/cli/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..db3334ac223dd --- /dev/null +++ b/recipes/cli/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cli CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cli::cli) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/cli/all/test_package/conanfile.py b/recipes/cli/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c5ef71ffe76fe --- /dev/null +++ b/recipes/cli/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain +from conan.tools.build import can_run + +class cliTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps" + test_type = "explicit" + + 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 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/cli/all/test_package/test_package.cpp b/recipes/cli/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..238aaf7e42157 --- /dev/null +++ b/recipes/cli/all/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include + +using namespace cli; +using namespace std; + + +int main() +{ + auto rootMenu = make_unique< Menu >( "cli" ); + rootMenu -> Insert( + "hello", + [](std::ostream& out){ out << "Hello, world\n"; }, + "Print hello world" ); + + Cli cli( std::move(rootMenu) ); + cli.ExitAction( [](auto& out){ out << "Goodbye and thanks for all the fish.\n"; } ); + + CliFileSession input(cli); + + return 0; +} diff --git a/recipes/cli/config.yml b/recipes/cli/config.yml new file mode 100644 index 0000000000000..57df2fc911f74 --- /dev/null +++ b/recipes/cli/config.yml @@ -0,0 +1,5 @@ +versions: + "2.2.0": + folder: all + "2.1.0": + folder: all diff --git a/recipes/cli11/all/conandata.yml b/recipes/cli11/all/conandata.yml index fb856253269aa..44c32b8821b3b 100644 --- a/recipes/cli11/all/conandata.yml +++ b/recipes/cli11/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "2.5.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.5.0.tar.gz" + sha256: "17e02b4cddc2fa348e5dbdbb582c59a3486fa2b2433e70a0c3bacb871334fd55" + "2.4.2": + url: "https://github.com/CLIUtils/CLI11/archive/v2.4.2.tar.gz" + sha256: "f2d893a65c3b1324c50d4e682c0cdc021dd0477ae2c048544f39eed6654b699a" + "2.4.1": + url: "https://github.com/CLIUtils/CLI11/archive/v2.4.1.tar.gz" + sha256: "73b7ec52261ce8fe980a29df6b4ceb66243bb0b779451dbd3d014cfec9fdbb58" + "2.4.0": + url: "https://github.com/CLIUtils/CLI11/archive/v2.4.0.tar.gz" + sha256: "d2ce8d5318d2a7a7d1120e2a18caac49cd65423d5d4158cbbc0267e6768af522" "2.3.2": url: "https://github.com/CLIUtils/CLI11/archive/v2.3.2.tar.gz" sha256: "aac0ab42108131ac5d3344a9db0fdf25c4db652296641955720a4fbe52334e22" diff --git a/recipes/cli11/all/conanfile.py b/recipes/cli11/all/conanfile.py index e28dd119e7d21..227ff9075e44e 100644 --- a/recipes/cli11/all/conanfile.py +++ b/recipes/cli11/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.files import get, copy, rmdir from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version import os required_conan_version = ">=1.52.0" @@ -12,20 +13,39 @@ class CLI11Conan(ConanFile): license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/CLIUtils/CLI11" - topics = "cli-parser", "cpp11", "no-dependencies", "cli", "header-only" + topics = "cli-parser", "cpp11", "no-dependencies", "cli" package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + options = { + "header_only": [True, False] + } + default_options = { + "header_only": True + } + @property def _min_cppstd(self): return "11" + @property + def _supports_compilation(self): + return Version(self.version) >= "2.3" + + def configure(self): + if not self._supports_compilation: + # TODO: Back to config_options after Conan 1 freeze + del self.options.header_only + elif not self.options.header_only: + self.package_type = "static-library" + def layout(self): cmake_layout(self, src_folder="src") def package_id(self): - self.info.clear() + if not self._supports_compilation or self.info.options.header_only: + self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -36,6 +56,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + if self._supports_compilation: + tc.variables["CLI11_PRECOMPILED"] = not self.options.header_only tc.variables["CLI11_BUILD_EXAMPLES"] = False tc.variables["CLI11_BUILD_TESTS"] = False tc.variables["CLI11_BUILD_DOCS"] = False @@ -59,6 +81,11 @@ def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + if self._supports_compilation and not self.options.get_safe("header_only"): + self.cpp_info.libdirs = ["lib"] + self.cpp_info.libs = ["CLI11"] + self.cpp_info.defines = ["CLI11_COMPILE"] + 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 340e598340044..a5cc1000feeb3 100644 --- a/recipes/cli11/all/test_package/CMakeLists.txt +++ b/recipes/cli11/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(CLI11 REQUIRED CONFIG) diff --git a/recipes/cli11/all/test_v1_package/CMakeLists.txt b/recipes/cli11/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 145dcc03e0f3d..0000000000000 --- a/recipes/cli11/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cli11/all/test_v1_package/conanfile.py b/recipes/cli11/all/test_v1_package/conanfile.py deleted file mode 100644 index b30e638816fc5..0000000000000 --- a/recipes/cli11/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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): - bin_path = os.path.join("bin","test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/cli11/config.yml b/recipes/cli11/config.yml index 37bc8ba7326b9..197ac2bb0905e 100644 --- a/recipes/cli11/config.yml +++ b/recipes/cli11/config.yml @@ -1,4 +1,12 @@ versions: + "2.5.0": + folder: all + "2.4.2": + folder: all + "2.4.1": + folder: all + "2.4.0": + folder: all "2.3.2": folder: all "2.3.1": diff --git a/recipes/clickhouse-cpp/all/conanfile.py b/recipes/clickhouse-cpp/all/conanfile.py index 4f321b7e267a7..a11bdcb964b24 100644 --- a/recipes/clickhouse-cpp/all/conanfile.py +++ b/recipes/clickhouse-cpp/all/conanfile.py @@ -61,7 +61,7 @@ def layout(self): def requirements(self): self.requires("lz4/1.9.4") self.requires("abseil/20230125.3", transitive_headers=True) - self.requires("cityhash/cci.20130801") + self.requires("cityhash/1.0.1") if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") diff --git a/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt b/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt index ede8071f6e744..3fd234fc34f8c 100644 --- a/recipes/clickhouse-cpp/all/test_package/CMakeLists.txt +++ b/recipes/clickhouse-cpp/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(clickhouse-cpp REQUIRED CONFIG) diff --git a/recipes/clickhouse-cpp/all/test_v1_package/CMakeLists.txt b/recipes/clickhouse-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/clickhouse-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/clickhouse-cpp/all/test_v1_package/conanfile.py b/recipes/clickhouse-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/clickhouse-cpp/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_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/clipboard_lite/all/test_package/CMakeLists.txt b/recipes/clipboard_lite/all/test_package/CMakeLists.txt index 2d472ecc585a3..2aa9c6b86e4cd 100644 --- a/recipes/clipboard_lite/all/test_package/CMakeLists.txt +++ b/recipes/clipboard_lite/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(clipboard_lite REQUIRED CONFIG) diff --git a/recipes/clipp/all/test_v1_package/CMakeLists.txt b/recipes/clipp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/clipp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/clipp/all/test_v1_package/conanfile.py b/recipes/clipp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/clipp/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_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/clipper/all/conanfile.py b/recipes/clipper/all/conanfile.py index 7b0a2de7fb05b..34c47e4d8e17a 100644 --- a/recipes/clipper/all/conanfile.py +++ b/recipes/clipper/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class ClipperConan(ConanFile): @@ -13,6 +13,7 @@ class ClipperConan(ConanFile): topics = ("clipping", "polygon") url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.angusj.com/delphi/clipper.php" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -44,8 +45,9 @@ def generate(self): tc = CMakeToolchain(self) # Export symbols for msvc shared tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True - # To install relocatable shared libs on Macos + # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -66,9 +68,3 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed. - # Do not use these CMake names in CMakeDeps, it was a mistake, - # clipper doesn't provide CMake config file - self.cpp_info.names["cmake_find_package"] = "polyclipping" - self.cpp_info.names["cmake_find_package_multi"] = "polyclipping" diff --git a/recipes/clipper/all/test_package/CMakeLists.txt b/recipes/clipper/all/test_package/CMakeLists.txt index cb269d6010aa1..16706854129e8 100644 --- a/recipes/clipper/all/test_package/CMakeLists.txt +++ b/recipes/clipper/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(clipper REQUIRED CONFIG) diff --git a/recipes/clipper/all/test_v1_package/CMakeLists.txt b/recipes/clipper/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 5a89ce2e8d32a..0000000000000 --- a/recipes/clipper/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(polyclipping REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE polyclipping::polyclipping) -target_compile_definitions(${PROJECT_NAME} PRIVATE CLIPPER_MAJOR_VERSION=${CLIPPER_MAJOR_VERSION}) diff --git a/recipes/clipper/all/test_v1_package/conanfile.py b/recipes/clipper/all/test_v1_package/conanfile.py deleted file mode 100644 index d963e4448d15a..0000000000000 --- a/recipes/clipper/all/test_v1_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.definitions["CLIPPER_MAJOR_VERSION"] = tools.Version(self.deps_cpp_info["clipper"].version).major - 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/clipper2/all/conandata.yml b/recipes/clipper2/all/conandata.yml index 317fd4373a1de..5d1e76ef64605 100644 --- a/recipes/clipper2/all/conandata.yml +++ b/recipes/clipper2/all/conandata.yml @@ -1,7 +1,10 @@ sources: + "1.4.0": + url: "https://github.com/AngusJohnson/Clipper2/archive/refs/tags/Clipper2_1.4.0.tar.gz" + sha256: "b83f71bb6a338f4f82116089c5ae867dbc43a2d651b5441380970dd966edd959" "1.3.0": - url: "https://github.com/AngusJohnson/Clipper2/archive/refs/tags/Cliper2_1.3.0.tar.gz" - sha256: "f7e1a706f5f786ed1be8ae969ce15ca569ce36d8de1c3d3f3dacfb3ce0c493e8" + url: "https://github.com/AngusJohnson/Clipper2/archive/refs/tags/Clipper2_1.3.0.tar.gz" + sha256: "8e537ec320e140afaa8fba1f23120416693cc1d71b0f76ad801d24b88b5e0b3c" "1.2.4": url: "https://github.com/AngusJohnson/Clipper2/archive/refs/tags/Clipper2_1.2.4.tar.gz" sha256: "a013d391c25c5f665cdb5cbd75cdd842dcc28f6e1bd098454beb359f6f212f33" diff --git a/recipes/clipper2/all/conanfile.py b/recipes/clipper2/all/conanfile.py index fe88fd67b3e80..c01db389a4cf8 100644 --- a/recipes/clipper2/all/conanfile.py +++ b/recipes/clipper2/all/conanfile.py @@ -1,6 +1,6 @@ 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.files import get, copy, rmdir, export_conandata_patches, apply_conandata_patches, 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 @@ -21,11 +21,15 @@ class Clipper2Conan(ConanFile): "shared": [True, False], "fPIC": [True, False], "usingz": ["ON", "OFF", "ONLY"], + "with_max_precision": ["ANY"], + "with_hi_precision": [True, False], } default_options = { "shared": False, "fPIC": True, "usingz": "ON", + "with_max_precision": 8, + "with_hi_precision": False, } @property @@ -48,6 +52,10 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "1.2.4": + del self.options.with_max_precision + if Version(self.version) < "1.4.0": + del self.options.with_hi_precision def configure(self): if self.options.shared: @@ -75,10 +83,18 @@ def generate(self): tc.variables["CLIPPER2_EXAMPLES"] = False tc.variables["CLIPPER2_TESTS"] = False tc.variables["CLIPPER2_USINGZ"] = self.options.usingz + if "with_hi_precision" in self.options: + tc.variables["CLIPPER2_HI_PRECISION"] = self.options.with_hi_precision + if "with_max_precision" in self.options: + tc.variables["CLIPPER2_MAX_PRECISION"] = self.options.with_max_precision tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CPP", "CMakeLists.txt"), "-Werror", "") def build(self): - apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, "CPP")) cmake.build() @@ -89,6 +105,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", "cmake")) def package_info(self): if self.options.usingz != "ONLY": diff --git a/recipes/clipper2/config.yml b/recipes/clipper2/config.yml index 49b239cf22a6f..4c35529540bb1 100644 --- a/recipes/clipper2/config.yml +++ b/recipes/clipper2/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.0": + folder: all "1.3.0": folder: all "1.2.4": diff --git a/recipes/clove-unit/all/conandata.yml b/recipes/clove-unit/all/conandata.yml index b80516fa1a975..132c2a02e4558 100644 --- a/recipes/clove-unit/all/conandata.yml +++ b/recipes/clove-unit/all/conandata.yml @@ -1,16 +1,25 @@ sources: + "2.4.6": + url: "https://github.com/fdefelici/clove-unit/archive/v2.4.6.tar.gz" + sha256: "ecdbd6c4b11bc1eb6e0e5022104f053cb5d1f1ef95e04499a6e29e21289e5063" + "2.4.5": + url: "https://github.com/fdefelici/clove-unit/archive/v2.4.5.tar.gz" + sha256: "e4db72612adf00d7c7c9512cb9990768f5f3e62a72039929b78ba17d5a6f4308" + "2.4.4": + url: "https://github.com/fdefelici/clove-unit/archive/v2.4.4.tar.gz" + sha256: "25e611e1d4286c73d9cce7bbc99f83e00629551602351fec1edcbb669243e047" "2.4.1": url: "https://github.com/fdefelici/clove-unit/archive/v2.4.1.tar.gz" - sha256: ede833e361b5b62052bd0976386307d1d962c7ab20a0e24eb6e970d409c726fe + sha256: "ede833e361b5b62052bd0976386307d1d962c7ab20a0e24eb6e970d409c726fe" "2.4.0": url: "https://github.com/fdefelici/clove-unit/archive/v2.4.0.tar.gz" - sha256: d5005854d7b3b6ed1b470c2df353fadd80a2ed5a80bb85efc074b9d55315e78d + sha256: "d5005854d7b3b6ed1b470c2df353fadd80a2ed5a80bb85efc074b9d55315e78d" "2.3.0": url: "https://github.com/fdefelici/clove-unit/archive/v2.3.0.tar.gz" - sha256: ca94d33643bbe1ff2205f7e6405f3e9c5a95d2f3a076a126814e64b46e3cce8e + sha256: "ca94d33643bbe1ff2205f7e6405f3e9c5a95d2f3a076a126814e64b46e3cce8e" "2.2.4": url: "https://github.com/fdefelici/clove-unit/archive/v2.2.4.tar.gz" - sha256: 0341f13b3e897952f1643eea2ca70cf014c4a086cf83375270980ac05f9d51aa + sha256: "0341f13b3e897952f1643eea2ca70cf014c4a086cf83375270980ac05f9d51aa" "2.2.3": url: "https://github.com/fdefelici/clove-unit/archive/v2.2.3.tar.gz" - sha256: 65f80d600ddec35f7ba70370f10e2df268d68c589e5cddbdcad815b6dbb61dfd + sha256: "65f80d600ddec35f7ba70370f10e2df268d68c589e5cddbdcad815b6dbb61dfd" diff --git a/recipes/clove-unit/all/conanfile.py b/recipes/clove-unit/all/conanfile.py index 630528ab512d9..3e530c191a833 100644 --- a/recipes/clove-unit/all/conanfile.py +++ b/recipes/clove-unit/all/conanfile.py @@ -8,13 +8,14 @@ class CloveUnitConan(ConanFile): name = "clove-unit" description = "Single-header Unit Testing framework for C (interoperable with C++) with test autodiscovery feature" - topics = ("unit-testing", "testing", "unit testing", "test") + license = "MIT" homepage = "https://github.com/fdefelici/clove-unit" url = "https://github.com/conan-io/conan-center-index" - license = "MIT" + topics = ("unit-testing", "testing", "unit testing", "test", "header-only") 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") diff --git a/recipes/clove-unit/all/test_v1_package/CMakeLists.txt b/recipes/clove-unit/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 5e4401df6124d..0000000000000 --- a/recipes/clove-unit/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/clove-unit/all/test_v1_package/conanfile.py b/recipes/clove-unit/all/test_v1_package/conanfile.py deleted file mode 100644 index 7e264aad8e8ec..0000000000000 --- a/recipes/clove-unit/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/clove-unit/config.yml b/recipes/clove-unit/config.yml index e5228fd78f381..e49f2ea78422d 100644 --- a/recipes/clove-unit/config.yml +++ b/recipes/clove-unit/config.yml @@ -1,4 +1,10 @@ versions: + "2.4.6": + folder: "all" + "2.4.5": + folder: "all" + "2.4.4": + folder: "all" "2.4.1": folder: "all" "2.4.0": diff --git a/recipes/cmake/3.x.x/conanfile.py b/recipes/cmake/3.x.x/conanfile.py index f6de583315097..042191e304bd0 100644 --- a/recipes/cmake/3.x.x/conanfile.py +++ b/recipes/cmake/3.x.x/conanfile.py @@ -37,8 +37,8 @@ def config_options(self): self.options.with_openssl = False def requirements(self): - if self.options.with_openssl: - self.requires("openssl/1.1.1t") + if self.options.get_safe("with_openssl", default=False): + self.requires("openssl/[>=1.1 <4]") def validate_build(self): if self.settings.os == "Windows" and self.options.bootstrap: diff --git a/recipes/cmake/binary/conandata.yml b/recipes/cmake/binary/conandata.yml index 6eae0c6e97427..1d497875e0690 100644 --- a/recipes/cmake/binary/conandata.yml +++ b/recipes/cmake/binary/conandata.yml @@ -1,4 +1,346 @@ sources: + "4.0.1": + Linux: + armv8: + url: "https://cmake.org/files/ReleaseCandidate/cmake-4.0.1-linux-aarch64.tar.gz" + sha256: "e4549bc77be50c4dacac18602befe0ec5cfc19444dbc64e16256f5ae98f7b63e" + x86_64: + url: "https://cmake.org/files/ReleaseCandidate/cmake-4.0.1-linux-x86_64.tar.gz" + sha256: "d66c11c010588c8256ee20a26b45977cd5b2f4aee2b742d4b8a353769940d147" + Macos: + universal: + url: "https://cmake.org/files/ReleaseCandidate/cmake-4.0.1-macos-universal.tar.gz" + sha256: "5bb98e3096f0efe159bd862c2f293a43b5ebee6c0646bbc5fe7244cf2fc1c261" + Windows: + armv8: + url: "https://cmake.org/files/ReleaseCandidate/cmake-4.0.1-windows-arm64.zip" + sha256: "3de43c9c826349bba61eef04de90c12c2ad8632b0e0af31c57145f6da69898fb" + x86_64: + url: "https://cmake.org/files/ReleaseCandidate/cmake-4.0.1-windows-x86_64.zip" + sha256: "31742b9a264b36897e0c904ab3520baf00a5b5ac5bc801aeede28d0d217eec65" + "3.31.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.31/cmake-3.31.6-linux-aarch64.tar.gz" + sha256: "b4cc788d63112b2749b40627e719eb5d3b8ed8f00c36d77189f4019cfe64bc9e" + x86_64: + url: "https://cmake.org/files/v3.31/cmake-3.31.6-linux-x86_64.tar.gz" + sha256: "5a1133ff103c71eb5120e2cc3de922733e7d8a26a98ae716397e8676adb367bf" + Macos: + universal: + url: "https://cmake.org/files/v3.31/cmake-3.31.6-macos10.10-universal.tar.gz" + sha256: "dc49fe67e0841e1d21b9e694d4858bbc06118165be5ebd8da0f2028216d56e6c" + Windows: + armv8: + url: "https://cmake.org/files/v3.31/cmake-3.31.6-windows-arm64.zip" + sha256: "fa648fd417f44e6cb08928964a480ade0d18df421f9b623639dba22f9b301e4e" + x86_64: + url: "https://cmake.org/files/v3.31/cmake-3.31.6-windows-x86_64.zip" + sha256: "d163cd3ab4959b0a53fa8988f2ddbd2e6c501658201e6a154386bad9dbe4f836" + "3.31.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.31/cmake-3.31.5-linux-aarch64.tar.gz" + sha256: "eb92af175ea91e3706ff62484088c3a3774ef3e1a8c399111785dd5f47010164" + x86_64: + url: "https://cmake.org/files/v3.31/cmake-3.31.5-linux-x86_64.tar.gz" + sha256: "2984e70515ff60c5e4a41922b5d715a8168a696a89721e3b114e36f453244f72" + Macos: + universal: + url: "https://cmake.org/files/v3.31/cmake-3.31.5-macos10.10-universal.tar.gz" + sha256: "1b5ebc625e981701e2ab3061e0ebb745b848b55536502293621ee676aefdcf1d" + Windows: + armv8: + url: "https://cmake.org/files/v3.31/cmake-3.31.5-windows-arm64.zip" + sha256: "a734e4e970fdaa4b5957157c059556f56ca5d655014cd4b5fd9194aaba316f31" + x86_64: + url: "https://cmake.org/files/v3.31/cmake-3.31.5-windows-x86_64.zip" + sha256: "d4d2d4b9ccd68dae975a066fcd42ea9807ef40f79ee6971923fd3788e7917585" + "3.31.3": + Linux: + armv8: + url: "https://cmake.org/files/v3.31/cmake-3.31.3-linux-aarch64.tar.gz" + sha256: "d46f9bbbb5f66a057ae223aaeba906b0b9d4aad715d427ffa891f3591e35a7fc" + x86_64: + url: "https://cmake.org/files/v3.31/cmake-3.31.3-linux-x86_64.tar.gz" + sha256: "442b93b3db0f6c6501a74add587acca5ea6b8c1526ccca7bc8d89fc592036971" + Macos: + universal: + url: "https://cmake.org/files/v3.31/cmake-3.31.3-macos10.10-universal.tar.gz" + sha256: "b99f09524ef3389b1b32f6f6641d55566adc6e1122f7a21cf3fca2f72b9bf6e5" + Windows: + armv8: + url: "https://cmake.org/files/v3.31/cmake-3.31.3-windows-arm64.zip" + sha256: "469f601300462e1b27313b69b8361e8c8584021f3dbd383e824c28cd4fa64668" + x86_64: + url: "https://cmake.org/files/v3.31/cmake-3.31.3-windows-x86_64.zip" + sha256: "d41e863589a3c152b1d14ecac2ffd1926f29aba64528984fcda8fd2b630f44ff" + "3.31.0": + Linux: + armv8: + url: "https://cmake.org/files/v3.31/cmake-3.31.0-linux-aarch64.tar.gz" + sha256: "e0f74862734c2d14ef8ac5a71941691531db0bbebee0a9c20a8e96e8a97390f9" + x86_64: + url: "https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.tar.gz" + sha256: "0fcb338b4515044f9ac77543550ac92c314c58f6f95aafcac5cd36aa75db6924" + Macos: + universal: + url: "https://cmake.org/files/v3.31/cmake-3.31.0-macos10.10-universal.tar.gz" + sha256: "58863bf65412e0fcaacd7dae2fcf0b5f33d78e46d0b84b547c946c59f4d19960" + Windows: + armv8: + url: "https://cmake.org/files/v3.31/cmake-3.31.0-windows-arm64.zip" + sha256: "3bae17886ad47909aadd89e41932a109a8b6a708faef6f28de2d4554c7c08276" + x86_64: + url: "https://cmake.org/files/v3.31/cmake-3.31.0-windows-x86_64.zip" + sha256: "f4b499f71cf44115a1d711d4867da3c6bd2f3f4d7121c213ace979757640385c" + "3.30.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.5-linux-aarch64.tar.gz" + sha256: "da7dead2c92c1747b40d506d7f7d68590f5bab175316d2e7af73e48a2e417e48" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.5-linux-x86_64.tar.gz" + sha256: "f747d9b23e1a252a8beafb4ed2bc2ddf78cff7f04a8e4de19f4ff88e9b51dc9d" + Macos: + universal: + url: "https://cmake.org/files/v3.30/cmake-3.30.5-macos10.10-universal.tar.gz" + sha256: "db21c9d92e544b3a47820627fe89bde8191e6bfb49b9e43d726cec5a5ef96ca7" + Windows: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.5-windows-arm64.zip" + sha256: "b5fa431bd569b591717a9a0f77c0ab56b072ef8603f924401227c178ac7072d9" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.5-windows-x86_64.zip" + sha256: "5ab6e1faf20256ee4f04886597e8b6c3b1bd1297b58a68a58511af013710004b" + "3.30.1": + Linux: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-linux-aarch64.tar.gz" + sha256: "ad234996f8750f11d7bd0d17b03f55c434816adf1f1671aab9e8bab21a43286a" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-linux-x86_64.tar.gz" + sha256: "ac31f077ef3378641fa25a3cb980d21b2f083982d3149a8f2eb9154f2b53696b" + Macos: + universal: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-macos10.10-universal.tar.gz" + sha256: "4c1beda2bb2ab830f22fdb29aa6cc844f9b0eb32cca0fb4f01b407688944d181" + Windows: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-windows-arm64.zip" + sha256: "02b433f70aa549449be2d53046d0179590bf3b6290d9fda3fbbb23f96a4f2802" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.1-windows-x86_64.zip" + sha256: "cf7788ff9d92812da194847d4ec874fc576f34079987d0f20c96cd09e2a16220" + "3.30.0": + Linux: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-linux-aarch64.tar.gz" + sha256: "3db7f12dadc91be9b30f0e5a71038c51d7f5b7cc03e32625621a052e9996bef0" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-linux-x86_64.tar.gz" + sha256: "09846a3858583f38189b59177586adf125a08c15f3cddcaf7d7d7081ac86969f" + Macos: + universal: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-macos10.10-universal.tar.gz" + sha256: "54f237212362efa3f192508eeb25d98f2150779ed45c46a77fe356597c3d2749" + Windows: + armv8: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-windows-arm64.zip" + sha256: "cb8fb65a8f523daa0ce6c531407ae10fcab8d0eefe18a6ef9fb718c54307d6e3" + x86_64: + url: "https://cmake.org/files/v3.30/cmake-3.30.0-windows-x86_64.zip" + sha256: "f8d2da0eaf3bab9cf065e97bd6d8e1819886f8671d3d4c7bb93cb774123fa448" + "3.29.7": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-linux-aarch64.tar.gz" + sha256: "ee8cf1ceaef011578ec070c13471c4b26e87f065315155e11177063b0743da68" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-linux-x86_64.tar.gz" + sha256: "fb0837495a3a1d044f5101d0a76d294c825ff85c10a32c42d7167604278344f7" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-macos10.10-universal.tar.gz" + sha256: "3a148e37bf57c419e40817d6208916a33eff8c1757b0947d9991eca902916559" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-windows-arm64.zip" + sha256: "ae87f2ff173deeb3ae8891d31c8f92ebabab8a4c29a074c5c5d39b38dde706d2" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.7-windows-x86_64.zip" + sha256: "3d9580b54faa0651f4cb0bccdff222bd123366b35a8b1051ee33a64915384ee4" + "3.29.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-linux-aarch64.tar.gz" + sha256: "4d6b0a551db9da7a034a09372f716cf2094413d7fd8a787051854154b0b3b343" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-linux-x86_64.tar.gz" + sha256: "28fef61e64840b784da6db35218fd3ae179ff8bf0be1c8a9d075d6185a0e4fdc" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-macos10.10-universal.tar.gz" + sha256: "a65f9e66c63bb79f3b6f00e4b67367b6f6c40030ee41cf06580818a74a84b3e9" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-windows-arm64.zip" + sha256: "8f0df498d8b1a076fc9305dde5a06427262a0476e89d4c670a49147b0bc30761" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.6-windows-x86_64.zip" + sha256: "5c648eac06c33477e510bae14ce1f969e9abb38992b71f245633b182fccb474d" + "3.29.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-linux-aarch64.tar.gz" + sha256: "6eb655ee89c50611f2370c5a3293bd2fe1920b73dff50b71fb3357d56a9d28d8" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-linux-x86_64.tar.gz" + sha256: "92629f95e15e7c2e88726c57a984ffdc5cf248e354f7ab791bc86d2ad513903e" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-macos10.10-universal.tar.gz" + sha256: "a110d173ab839854fc0b19b9f29f213c1112106e2858c1a1fe7973d4bb13a536" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-windows-arm64.zip" + sha256: "9c67d16560125ebf1278ef1b3072914a60bff780522b28c0096f364f775a8e55" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.5-windows-x86_64.zip" + sha256: "f85db8361cb7eb11ceb6b2f1ee42bec7234bb8d9e487ea78c00de64771768d92" + "3.29.4": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-linux-aarch64.tar.gz" + sha256: "9210619e7907b14858178743d5b7ba70ce846d98a6a65bcdbd83c08b932ba6a5" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-linux-x86_64.tar.gz" + sha256: "64e5473169dd43055fbf2c138cae6e5ec10f30a0606d24f12078e68466320cf4" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-macos10.10-universal.tar.gz" + sha256: "44a59c584122676463bf5bdd2c7dee2ac02944e065a71cc30c57541a20d3465c" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-windows-arm64.zip" + sha256: "16ce291dd34189a60d7add96b4148adfdbb46b6b2478086cb43abe2e5ff34ad3" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.4-windows-x86_64.zip" + sha256: "1c8bfbc5537553edccded62f8f03475a161280c1b64f54c887824c6eb4e773ff" + "3.29.3": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-linux-aarch64.tar.gz" + sha256: "ae61d262b2771ba9cbdf1eeac288e64d6510d2f0417d2d92e27807d269ac90fa" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-linux-x86_64.tar.gz" + sha256: "90b543a30220401db0e08347af067545be158ce89ffb09b7df1516cda8617329" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-macos10.10-universal.tar.gz" + sha256: "1a7ecdd1dc8baaede55d1011f60b5871ff908fa640f7e96ab5520f38ef97bba0" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-windows-arm64.zip" + sha256: "8d7d65e46a45bdbf8b4416d29ef6ad9a80f0b26afb5d6afab358e34b1b30a556" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.3-windows-x86_64.zip" + sha256: "6423ed300e6aa1b15c4aeae9a7399157f53fc84a2fb7242ca64c8dfd83e5f8a6" + "3.29.2": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-linux-aarch64.tar.gz" + sha256: "ca883c6dc3ce9eebd833804f0f940ecbbff603520cfd169ee58916dbbc23c2b8" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-linux-x86_64.tar.gz" + sha256: "0416c70cf88e8f92efcbfe292e181bc09ead7d70e29ab37b697522c01121eab5" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-macos10.10-universal.tar.gz" + sha256: "0b542389345b28d2f73122b72ec9b899947e643fd86cf8f42bae2718884d2ad3" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-windows-arm64.zip" + sha256: "5b16a0db4966c04582c40131038de49d5b0161fcd950dc9e955753dfab858882" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.2-windows-x86_64.zip" + sha256: "86b5de51f60a0e9d62be4d8ca76ea467d154083d356fcc9af1409606be341cd8" + "3.29.0": + Linux: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-linux-aarch64.tar.gz" + sha256: "2cb768a14b28a4478bb931d917dbc419305b82433bdecc046df98e7c336225fa" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-linux-x86_64.tar.gz" + sha256: "f06258f52c5649752dfb10c4c2e1d8167c760c8826f078c6f5c332fa9d976bf8" + Macos: + universal: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-macos10.10-universal.tar.gz" + sha256: "868f356c56a3c35e8f39f0d4fb7e579cb2eb0ac06c26520d6a203d91bdc7ad09" + Windows: + armv8: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-windows-arm64.zip" + sha256: "e5bea5c45b61f105429fc664364c5280acd40770cc74235b79e7422f608a9849" + x86_64: + url: "https://cmake.org/files/v3.29/cmake-3.29.0-windows-x86_64.zip" + sha256: "9ab28eba1ab7911a0e57ab274f5990a283fffa1d22eb711792d5562e5869f9ef" + "3.28.6": + Linux: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-linux-aarch64.tar.gz" + sha256: "7909cc2128ce9442c63ce674a0bfb0e4f4ce04cef667d887e15ad5670d594ba7" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-linux-x86_64.tar.gz" + sha256: "931e3c0d546ee03ca72bb147ccd9b49e3b6252f765f66bf21b9d165519940458" + Macos: + universal: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-macos10.10-universal.tar.gz" + sha256: "cbda8e719b3239e304b339cdd90e946c09dac5ad2d57c93bf1b1d3914685d9a7" + Windows: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-windows-arm64.zip" + sha256: "63e4ebd2dadb5ad63faaf4ed38db40d3fec92d1b050d2a4e69011ea3ee699d29" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.6-windows-x86_64.zip" + sha256: "a8f2e684ead94a64fd3517a38857a5b3f7f8d68d15c49ca1143d18797eaf9cac" + "3.28.5": + Linux: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-linux-aarch64.tar.gz" + sha256: "5b4a86b456058266bd4caa9c59187fab4b1ace823acdd9741d2d24fed5a4f50b" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-linux-x86_64.tar.gz" + sha256: "c5460b8a0ecfea7c0ac99d78427e19409ea9133e29a604e1f8c0e6806a8f6934" + Macos: + universal: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-macos10.10-universal.tar.gz" + sha256: "62956bf3c26b396cee20dddf2914d63d882cff4245e13c29c72f7841c03d56e4" + Windows: + armv8: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-windows-arm64.zip" + sha256: "47056df28bc543c528f85f15c46180dbed750e5ebd0180f936a2e3ee22ddea56" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.5-windows-x86_64.zip" + sha256: "0fbea146a782e4b82a799384a2109e46ce27f3ad70c30d3f8c9ef751e1e28040" + "3.28.1": + Linux: + armv8: + 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.28/cmake-3.28.1-linux-x86_64.tar.gz" + sha256: "f76398c24362ad87bad1a3d6f1e8f4377632b5b1c360c4ba1fd7cd205fd9d8d4" + Macos: + universal: + 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.28/cmake-3.28.1-windows-arm64.zip" + sha256: "a839b8d32c11b24f078142b5b8c3361a955ebc65788f0f0353b2121fe2f74e49" + x86_64: + url: "https://cmake.org/files/v3.28/cmake-3.28.1-windows-x86_64.zip" + sha256: "671332249bc7cc7424523d6c2b5edd3e3de90a43b8b82e8782f42da4fe4c562d" "3.27.9": Linux: armv8: diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index cdf491b2833f0..393cf405b4fc0 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,4 +1,40 @@ versions: + "4.0.1": + folder: "binary" + "3.31.6": + folder: "binary" + "3.31.5": + folder: "binary" + "3.31.3": + folder: "binary" + "3.31.0": + folder: "binary" + "3.30.5": + folder: "binary" + "3.30.1": + folder: "binary" + "3.30.0": + folder: "binary" + "3.29.7": + folder: "binary" + "3.29.6": + folder: "binary" + "3.29.5": + folder: "binary" + "3.29.4": + folder: "binary" + "3.29.3": + folder: "binary" + "3.29.2": + folder: "binary" + "3.29.0": + folder: "binary" + "3.28.6": + folder: "binary" + "3.28.5": + folder: "binary" + "3.28.1": + folder: "binary" "3.27.9": folder: "binary" "3.27.7": diff --git a/recipes/cminpack/all/test_package/CMakeLists.txt b/recipes/cminpack/all/test_package/CMakeLists.txt index cc33b8b3543ef..9ff50c4a012a5 100644 --- a/recipes/cminpack/all/test_package/CMakeLists.txt +++ b/recipes/cminpack/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(CMinpack REQUIRED CONFIG) diff --git a/recipes/cminpack/all/test_v1_package/CMakeLists.txt b/recipes/cminpack/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cminpack/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cminpack/all/test_v1_package/conanfile.py b/recipes/cminpack/all/test_v1_package/conanfile.py deleted file mode 100644 index 0cdc195d14862..0000000000000 --- a/recipes/cminpack/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +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", "cminpack_test_double") - self.run(bin_path, run_environment=True) - bin_path = os.path.join("bin", "cminpack_test_float") - self.run(bin_path, run_environment=True) 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/all/test_package/CMakeLists.txt b/recipes/cmocka/all/test_package/CMakeLists.txt index 23601e264af84..9a46733953657 100644 --- a/recipes/cmocka/all/test_package/CMakeLists.txt +++ b/recipes/cmocka/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(cmocka REQUIRED CONFIG) diff --git a/recipes/cmocka/all/test_v1_package/CMakeLists.txt b/recipes/cmocka/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cmocka/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cmocka/all/test_v1_package/conanfile.py b/recipes/cmocka/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cmocka/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_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/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/cmp/all/CMakeLists.txt b/recipes/cmp/all/CMakeLists.txt index cc7e397ad25e6..7ad1c0beb6f84 100644 --- a/recipes/cmp/all/CMakeLists.txt +++ b/recipes/cmp/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(cmp LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/cmp/all/test_package/CMakeLists.txt b/recipes/cmp/all/test_package/CMakeLists.txt index 059b67a026f33..ed09e6bd134ad 100644 --- a/recipes/cmp/all/test_package/CMakeLists.txt +++ b/recipes/cmp/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(cmp REQUIRED CONFIG) diff --git a/recipes/cmp/all/test_v1_package/CMakeLists.txt b/recipes/cmp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cmp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cmp/all/test_v1_package/conanfile.py b/recipes/cmp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cmp/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_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/cn-cbor/all/conandata.yml b/recipes/cn-cbor/all/conandata.yml index 4de861bba88a9..617cedf518b2c 100644 --- a/recipes/cn-cbor/all/conandata.yml +++ b/recipes/cn-cbor/all/conandata.yml @@ -1,4 +1,4 @@ sources: "1.0.0": - sha256: eca2bcc15b8400037fd95748724287afbb966e34d4d0275a496b4872bcea9d77 - url: https://github.com/jimsch/cn-cbor/archive/1.0.0.zip + url: "https://github.com/jimsch/cn-cbor/archive/1.0.0.zip" + sha256: "eca2bcc15b8400037fd95748724287afbb966e34d4d0275a496b4872bcea9d77" diff --git a/recipes/cn-cbor/all/conanfile.py b/recipes/cn-cbor/all/conanfile.py index 91eccd3167699..d10556f9c9031 100644 --- a/recipes/cn-cbor/all/conanfile.py +++ b/recipes/cn-cbor/all/conanfile.py @@ -2,7 +2,6 @@ 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 @@ -42,8 +41,6 @@ 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") @@ -52,10 +49,16 @@ def source(self): 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.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.cache_variables["CN_CBOR_FATAL_WARNINGS"] = False + tc.cache_variables["CN_CBOR_COVERALLS"] = False + tc.cache_variables["CN_CBOR_BUILD_TESTS"] = False + tc.cache_variables["CN_CBOR_BUILD_DOCS"] = False + # For v1.0.0 + tc.cache_variables["fatal_warnings"] = False + tc.cache_variables["coveralls"] = False + tc.cache_variables["build_tests"] = False + tc.cache_variables["build_docs"] = False tc.generate() def build(self): @@ -64,7 +67,9 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) cmake = CMake(self) cmake.install() os.remove(os.path.join(self.package_folder, "README.md")) diff --git a/recipes/cn-cbor/all/test_package/conanfile.py b/recipes/cn-cbor/all/test_package/conanfile.py index fae501d0afb9e..ef5d7042163ec 100644 --- a/recipes/cn-cbor/all/test_package/conanfile.py +++ b/recipes/cn-cbor/all/test_package/conanfile.py @@ -6,7 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" def requirements(self): diff --git a/recipes/cn-cbor/all/test_v1_package/CMakeLists.txt b/recipes/cn-cbor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cn-cbor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 9de3689208f00..0000000000000 --- a/recipes/cn-cbor/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/cn-cbor/config.yml b/recipes/cn-cbor/config.yml index 8f50af2b049ed..c7f13630776fb 100644 --- a/recipes/cn-cbor/config.yml +++ b/recipes/cn-cbor/config.yml @@ -1,4 +1,3 @@ ---- versions: "1.0.0": folder: "all" diff --git a/recipes/cnats/all/conandata.yml b/recipes/cnats/all/conandata.yml new file mode 100644 index 0000000000000..27d58af7a72ff --- /dev/null +++ b/recipes/cnats/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "3.8.0": + url: "https://github.com/nats-io/nats.c/archive/refs/tags/v3.8.0.tar.gz" + sha256: "465811380cdc6eab3304e40536d03f99977a69c0e56fcf566000c29dd075e4dd" + "3.8.2": + url: "https://github.com/nats-io/nats.c/archive/refs/tags/v3.8.2.tar.gz" + sha256: "083ee03cf5a413629d56272e88ad3229720c5006c286e8180c9e5b745c10f37d" + "3.8.3": + url: "https://github.com/nats-io/nats.c/archive/refs/tags/v3.8.3.tar.gz" + sha256: "fe7e9ce7636446cc3fe0f47f6a235c4783299e00d5e5c4a1f8689d20707871db" + "3.9.1": + url: "https://github.com/nats-io/nats.c/archive/refs/tags/v3.9.1.tar.gz" + sha256: "56836bb30a2da93eaa6df0dfa27e796e6be0933b5b3d4d83b5c76d3b80304290" + "3.9.2": + url: "https://github.com/nats-io/nats.c/archive/refs/tags/v3.9.2.tar.gz" + sha256: "28c4f39b88f095d78d653e8d4fe4581163fe96ecde5f9683933f0d82fd889a57" + "3.9.3": + url: "https://github.com/nats-io/nats.c/archive/refs/tags/v3.9.3.tar.gz" + sha256: "b5dd3971b72fa5fc4c5b6d71c6900dc0a8a20465824fc23c0054f7f319e97952" + "3.10.1": + url: "https://github.com/nats-io/nats.c/archive/refs/tags/v3.10.1.tar.gz" + sha256: "1765533bbc1270ab7c89e3481b4778db7d1e7b4db2fa906b6602cd5c02846222" diff --git a/recipes/cnats/all/conanfile.py b/recipes/cnats/all/conanfile.py new file mode 100644 index 0000000000000..278a31f6d04c5 --- /dev/null +++ b/recipes/cnats/all/conanfile.py @@ -0,0 +1,115 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rename, mkdir, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.54.0" + + +class PackageConan(ConanFile): + name = "cnats" + description = "A C client for NATS" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://nats.io/" + topics = ("messaging", "message-bus", "message-queue", "messaging-library", "nats-client") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tls": [True, False], + "with_sodium": [True, False], + "enable_streaming": [True, False], + "with_experimental" : [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_tls": True, + "with_sodium": False, + "enable_streaming": False, + "with_experimental" : 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 requirements(self): + if self.options.with_tls: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_sodium: + self.requires("libsodium/1.0.20") + # FIXME: C3I Jenkins does not have protobuf-c static x shared deps for now + if self.options.enable_streaming: + self.requires("protobuf-c/1.4.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["NATS_BUILD_WITH_TLS"] = self.options.with_tls + tc.variables["NATS_BUILD_USE_SODIUM"] = self.options.with_sodium + tc.variables["NATS_BUILD_EXAMPLES"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["NATS_BUILD_LIB_STATIC"] = not self.options.shared + tc.variables["NATS_BUILD_LIB_SHARED"] = self.options.shared + if self.options.with_tls: + tc.variables["NATS_BUILD_TLS_USE_OPENSSL_1_1_API"] = Version(self.dependencies["openssl"].ref.version) >= "1.1" + tc.variables["NATS_BUILD_STREAMING"] = self.options.enable_streaming + tc.variables["NATS_WITH_EXPERIMENTAL"] = self.options.with_experimental + 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() + if self.settings.os == "Windows" and self.options.shared: + mkdir(self, os.path.join(self.package_folder, "bin")) + rename(self, os.path.join(self.package_folder, "lib", f"{self._nats_library_name}.dll"), os.path.join(self.package_folder, "bin", f"{self._nats_library_name}.dll")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + @property + def _nats_library_name(self): + suffix = "" if self.options.shared else "_static" + debug = "d" if self.settings.build_type == "Debug" else "" + return f"nats{suffix}{debug}" + + def package_info(self): + self.cpp_info.libs = [self._nats_library_name] + self.cpp_info.set_property("cmake_file_name", "cnats") + self.cpp_info.set_property("cmake_target_name", f"cnats::{self._nats_library_name}") + self.cpp_info.set_property("pkg_config_name", "libnats") + + if self.options.enable_streaming: + self.cpp_info.defines.append("NATS_HAS_STREAMING") + if self.options.with_experimental: + self.cpp_info.defines.append("NATS_WITH_EXPERIMENTAL") + if self.settings.os == "Windows" and self.options.shared: + self.cpp_info.defines.append("nats_IMPORTS") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "rt"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/cnats/all/test_package/CMakeLists.txt b/recipes/cnats/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6c0bde85724d3 --- /dev/null +++ b/recipes/cnats/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(cnats REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cnats::${CNATS_TARGET}) diff --git a/recipes/cnats/all/test_package/conanfile.py b/recipes/cnats/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6c38f16815ae8 --- /dev/null +++ b/recipes/cnats/all/test_package/conanfile.py @@ -0,0 +1,37 @@ +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) + + @property + def _nats_library_name(self): + suffix = "" if self.dependencies["cnats"].options.shared else "_static" + debug = "d" if self.dependencies["cnats"].settings.build_type == "Debug" else "" + return f"nats{suffix}{debug}" + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CNATS_TARGET"] = self._nats_library_name + 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") + self.run(bin_path, env="conanrun") diff --git a/recipes/cnats/all/test_package/test_package.cpp b/recipes/cnats/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e9578180d8c82 --- /dev/null +++ b/recipes/cnats/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +#include "nats/nats.h" + + +int main() { + std::cout << "NATS Version: " << nats_GetVersion() << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/cnats/config.yml b/recipes/cnats/config.yml new file mode 100644 index 0000000000000..44f05da3bc715 --- /dev/null +++ b/recipes/cnats/config.yml @@ -0,0 +1,15 @@ +versions: + "3.8.0": + folder: all + "3.8.2": + folder: all + "3.8.3": + folder: all + "3.9.1": + folder: all + "3.9.2": + folder: all + "3.9.3": + folder: all + "3.10.1": + folder: all diff --git a/recipes/cnpy/all/test_package/CMakeLists.txt b/recipes/cnpy/all/test_package/CMakeLists.txt index 18d71adb9d0d4..71a2162e67e45 100644 --- a/recipes/cnpy/all/test_package/CMakeLists.txt +++ b/recipes/cnpy/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(cnpy REQUIRED CONFIG) diff --git a/recipes/cnpy/all/test_v1_package/CMakeLists.txt b/recipes/cnpy/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cnpy/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cnpy/all/test_v1_package/conanfile.py b/recipes/cnpy/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cnpy/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_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/co/all/CMakeLists.txt b/recipes/co/all/CMakeLists.txt index c986d294c7547..f52f2456d347d 100644 --- a/recipes/co/all/CMakeLists.txt +++ b/recipes/co/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(conanbuildinfo.cmake) diff --git a/recipes/co/all/test_package/CMakeLists.txt b/recipes/co/all/test_package/CMakeLists.txt index d9ea9b93dcee7..55770bc0b9d39 100644 --- a/recipes/co/all/test_package/CMakeLists.txt +++ b/recipes/co/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) set(CMAKE_CXX_STANDARD 11) diff --git a/recipes/cocoyaxi/all/test_package/CMakeLists.txt b/recipes/cocoyaxi/all/test_package/CMakeLists.txt index 2d0878488574e..22507caa612de 100644 --- a/recipes/cocoyaxi/all/test_package/CMakeLists.txt +++ b/recipes/cocoyaxi/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(cocoyaxi REQUIRED CONFIG) diff --git a/recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt b/recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 882cedffb12e9..0000000000000 --- a/recipes/cocoyaxi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(cocoyaxi REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE cocoyaxi::co) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cocoyaxi/all/test_v1_package/conanfile.py b/recipes/cocoyaxi/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cocoyaxi/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_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/coin-cbc/all/test_package/CMakeLists.txt b/recipes/coin-cbc/all/test_package/CMakeLists.txt index 18c2470c6a65f..0fc6781d4e7fc 100644 --- a/recipes/coin-cbc/all/test_package/CMakeLists.txt +++ b/recipes/coin-cbc/all/test_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/coin-cgl/all/test_package/CMakeLists.txt b/recipes/coin-cgl/all/test_package/CMakeLists.txt index 7c4558f1caa45..032093501795e 100644 --- a/recipes/coin-cgl/all/test_package/CMakeLists.txt +++ b/recipes/coin-cgl/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(PkgConfig REQUIRED) diff --git a/recipes/coin-clp/all/test_package/CMakeLists.txt b/recipes/coin-clp/all/test_package/CMakeLists.txt index be407d0b8fd6f..0363a2827f002 100644 --- a/recipes/coin-clp/all/test_package/CMakeLists.txt +++ b/recipes/coin-clp/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(PkgConfig REQUIRED) diff --git a/recipes/coin-lemon/all/conanfile.py b/recipes/coin-lemon/all/conanfile.py index 2ea80d94c93ce..05e26747e95d8 100644 --- a/recipes/coin-lemon/all/conanfile.py +++ b/recipes/coin-lemon/all/conanfile.py @@ -1,9 +1,11 @@ from conan import ConanFile +from conan.errors import ConanException 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" +required_conan_version = ">=2.1" class CoinLemonConan(ConanFile): @@ -50,10 +52,11 @@ def generate(self): tc.variables["LEMON_ENABLE_SOPLEX"] = False # For msvc shared tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True - # Relocatable shared libs on Macos + # To install relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - # For Ninja generator - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0058"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.3.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def _patch_sources(self): @@ -88,8 +91,3 @@ def package_info(self): self.cpp_info.defines.append("LEMON_ONLY_TEMPLATES") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "LEMON" - self.cpp_info.names["cmake_find_package_multi"] = "LEMON" - self.cpp_info.names["pkg_config"] = "lemon" diff --git a/recipes/coin-lemon/all/test_v1_package/CMakeLists.txt b/recipes/coin-lemon/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/coin-lemon/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/coin-lemon/all/test_v1_package/conanfile.py b/recipes/coin-lemon/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/coin-lemon/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_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/coin-osi/all/test_package/CMakeLists.txt b/recipes/coin-osi/all/test_package/CMakeLists.txt index d49eef53308a3..8fd1fe7c60738 100644 --- a/recipes/coin-osi/all/test_package/CMakeLists.txt +++ b/recipes/coin-osi/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(PkgConfig REQUIRED) diff --git a/recipes/coin-utils/all/conanfile.py b/recipes/coin-utils/all/conanfile.py index 98f96c3d12201..78854eb346b37 100644 --- a/recipes/coin-utils/all/conanfile.py +++ b/recipes/coin-utils/all/conanfile.py @@ -55,6 +55,7 @@ def layout(self): def requirements(self): self.requires("bzip2/1.0.8") self.requires("zlib/[>=1.2.11 <2]") + # TODO: add blas and lapack support def validate(self): if self.settings.os == "Windows" and self.options.shared: @@ -86,6 +87,8 @@ def generate(self): env.generate(scope="build") tc = AutotoolsToolchain(self) + tc.configure_args.append("--without-blas") + tc.configure_args.append("--without-lapack") if is_msvc(self): tc.configure_args.append(f"--enable-msvc={self.settings.compiler.runtime}") tc.extra_cxxflags.append("-EHsc") diff --git a/recipes/coin-utils/all/test_package/CMakeLists.txt b/recipes/coin-utils/all/test_package/CMakeLists.txt index 761c9f0a9c670..e9d56822ef9ef 100644 --- a/recipes/coin-utils/all/test_package/CMakeLists.txt +++ b/recipes/coin-utils/all/test_package/CMakeLists.txt @@ -1,8 +1,11 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(PkgConfig REQUIRED) pkg_check_modules(CoinUtils REQUIRED IMPORTED_TARGET coinutils) +add_executable(${PROJECT_NAME}_pkgconfig test_package.cpp) +target_link_libraries(${PROJECT_NAME}_pkgconfig PRIVATE PkgConfig::CoinUtils) -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::CoinUtils) +find_package(coin-utils REQUIRED CONFIG) +add_executable(${PROJECT_NAME}_cmake test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cmake PRIVATE coin-utils::coin-utils) diff --git a/recipes/coin-utils/all/test_package/conanfile.py b/recipes/coin-utils/all/test_package/conanfile.py index 7ab87ca07735c..0a6ce61d2c57d 100644 --- a/recipes/coin-utils/all/test_package/conanfile.py +++ b/recipes/coin-utils/all/test_package/conanfile.py @@ -6,7 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeToolchain", "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv" + generators = "CMakeToolchain", "CMakeDeps", "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv" test_type = "explicit" def layout(self): @@ -26,5 +26,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_pkgconfig") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package_cmake") self.run(bin_path, env="conanrun") diff --git a/recipes/coin-utils/all/test_v1_package/conanfile.py b/recipes/coin-utils/all/test_v1_package/conanfile.py index b3607270e232e..340d3fd656e33 100644 --- a/recipes/coin-utils/all/test_v1_package/conanfile.py +++ b/recipes/coin-utils/all/test_v1_package/conanfile.py @@ -4,7 +4,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "pkg_config" + generators = "cmake", "cmake_find_package_multi", "pkg_config" def build_requirements(self): self.build_requires("pkgconf/2.0.3") @@ -16,5 +16,7 @@ def build(self): def test(self): if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") + bin_path = os.path.join("bin", "test_package_pkgconfig") + self.run(bin_path, run_environment=True) + bin_path = os.path.join("bin", "test_package_cmake") self.run(bin_path, run_environment=True) diff --git a/recipes/commata/all/conandata.yml b/recipes/commata/all/conandata.yml index 0bbd21e7700bf..f7365910ab510 100644 --- a/recipes/commata/all/conandata.yml +++ b/recipes/commata/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "1.0.2": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v1.0.2.tar.gz" + sha256: "55999ba71e167fa05055069a1e02e79b4ce6b9c1c98f5c0b64db93b5fcec8f1a" + "1.0.1": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v1.0.1.tar.gz" + sha256: "b6e91ede0ec8b7c69ced1e243eba204717e05fcd9ae26163a54425ca800124ef" + "1.0.0": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v1.0.0.tar.gz" + sha256: "ecf0a88f6a4616d10770522b4ef4838e4100511759eb640270f6b932e4b7df69" + "0.2.9": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.9.tar.gz" + sha256: "24c404e90e2f01a2f9e46e55c2f8121a3f146d1f2dfb819b8d7ab5cf13bd6a9f" + "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" @@ -8,12 +26,18 @@ sources: "0.2.5": url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.5.tar.gz" sha256: "d1be1f366267af6c466c29f846f5968f57626a8a6635a2ea9a3de3f6fb88e53b" - "0.2.4-bug1": - url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.4-bug1.tar.gz" - sha256: "fcde251d9b41f1601e1f8b2181613b4bf33c4318678700e2b3b54bf24bc9e1e3" - "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" +patches: + "0.2.9": + - patch_file: "patches/0.2.9-0001-include-set.patch" + patch_description: "include header" + patch_type: "portability" + patch_source: "https://github.com/furfurylic/commata/pull/3" + - patch_file: "patches/0.2.9-0002-additional-missing-includes.patch" + patch_description: "add more missing headers" + patch_type: "portability" + patch_source: "https://github.com/furfurylic/commata/commit/07c6f43f0fae0237569d12420aded35f8ccf792f" + "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/patches/0.2.9-0001-include-set.patch b/recipes/commata/all/patches/0.2.9-0001-include-set.patch new file mode 100644 index 0000000000000..1519e2f79a965 --- /dev/null +++ b/recipes/commata/all/patches/0.2.9-0001-include-set.patch @@ -0,0 +1,12 @@ +diff --git a/include/commata/field_scanners.hpp b/include/commata/field_scanners.hpp +index 9b19b8c..9606732 100644 +--- a/include/commata/field_scanners.hpp ++++ b/include/commata/field_scanners.hpp +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #include "text_error.hpp" + #include "text_value_translation.hpp" diff --git a/recipes/commata/all/patches/0.2.9-0002-additional-missing-includes.patch b/recipes/commata/all/patches/0.2.9-0002-additional-missing-includes.patch new file mode 100644 index 0000000000000..87671798cc1bd --- /dev/null +++ b/recipes/commata/all/patches/0.2.9-0002-additional-missing-includes.patch @@ -0,0 +1,14 @@ +diff --git a/include/commata/field_handling.hpp b/include/commata/field_handling.hpp +index 04ab67e..8b438b6 100644 +--- a/include/commata/field_handling.hpp ++++ b/include/commata/field_handling.hpp +@@ -6,7 +6,9 @@ + #ifndef COMMATA_GUARD_CD40E918_ACCD_4879_BB48_7D9B8B823369 + #define COMMATA_GUARD_CD40E918_ACCD_4879_BB48_7D9B8B823369 + ++#include + #include ++#include + + namespace commata { + diff --git a/recipes/commata/all/test_package/CMakeLists.txt b/recipes/commata/all/test_package/CMakeLists.txt index f69f5f2677dd5..41b041dc2ae5f 100644 --- a/recipes/commata/all/test_package/CMakeLists.txt +++ b/recipes/commata/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(commata REQUIRED CONFIG) @@ -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/all/test_v1_package/CMakeLists.txt b/recipes/commata/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/commata/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/commata/all/test_v1_package/conanfile.py b/recipes/commata/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/commata/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/commata/config.yml b/recipes/commata/config.yml index 02125db50fd0d..20b99ca15d2a6 100644 --- a/recipes/commata/config.yml +++ b/recipes/commata/config.yml @@ -1,13 +1,19 @@ versions: - "0.2.6-bug1": + "1.0.2": folder: all - "0.2.6": + "1.0.1": folder: all - "0.2.5": + "1.0.0": folder: all - "0.2.4-bug1": + "0.2.9": folder: all - "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/compute_library/all/conandata.yml b/recipes/compute_library/all/conandata.yml new file mode 100644 index 0000000000000..3b952c4dbb5e0 --- /dev/null +++ b/recipes/compute_library/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "23.08": + url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.08.tar.gz" + sha256: "62f514a555409d4401e5250b290cdf8cf1676e4eb775e5bd61ea6a740a8ce24f" + "23.02.1": + url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.02.1.tar.gz" + sha256: "c3a443e26539f866969242e690cf0651ef629149741ee18732f954c734da6763" diff --git a/recipes/compute_library/all/conanfile.py b/recipes/compute_library/all/conanfile.py new file mode 100644 index 0000000000000..6becfaaa8f1bb --- /dev/null +++ b/recipes/compute_library/all/conanfile.py @@ -0,0 +1,149 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rm, chdir +from conan.tools.build import check_min_cppstd, cross_building, build_jobs +from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.53.0" + + +class ComputeLibraryConan(ConanFile): + name = "compute_library" + description = "The Compute Library is a set of computer vision and machine learning functions optimized for both Arm CPUs and GPUs using SIMD technologies" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ARM-software/ComputeLibrary" + topics = ("android", "linux", "machine-learning", "arm", "computer-vision", "neural-network") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "enable_openmp": [True, False], + "enable_opencl": [True, False], + "enable_neon": [True, False], + "enable_multi_isa": [True, False], + } + default_options = { + "shared": False, + "enable_openmp": False, + "enable_opencl": True, + "enable_neon": True, + "enable_multi_isa": False, + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "5.1", + } + + def config_options(self): + # INFO: Neon option is reserved to arm architecture + if "arm" not in str(self.settings.arch): + del self.options.enable_neon + # INFO: OpenMP option only works with g++, according to the documentation + if self.settings.compiler == "clang": + del self.options.enable_openmp + # INFO: OpenCL fails to build with MacOS + if self.settings.os == "Macos": + del self.options.enable_opencl + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("scons/4.3.0") + + def requirements(self): + if self.options.get_safe("enable_opencl"): + self.requires("opencl-headers/2023.04.17") + + 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.") + # INFO: https://github.com/ARM-software/ComputeLibrary#supported-systems + supported_os = ["Android", "Linux", "OpenBSD", "Macos", "Tizen", "Windows"] + if str(self.settings.os) not in supported_os: + raise ConanInvalidConfiguration(f"{self.ref} does not support {self.settings.os}. It is only supported on {supported_os}.") + if self.settings.os == "Windows": + if cross_building(self): + # INFO: https://arm-software.github.io/ComputeLibrary/latest/how_to_build.xhtml#S1_6_windows_host + raise ConanInvalidConfiguration(f"Using scons directly from the Windows command line is known to cause problems. Please, try native native build on Windows ARM or cross-build on Linux Ubuntu.") + if "arm" in str(self.settings.arch): + # INFO: https://arm-software.github.io/ComputeLibrary/latest/how_to_build.xhtml#S1_6_3_WoA + self.output.warn("Native builds on Windows are experimental and some features from the library interacting with the OS are missing.") + if "x86" in str(self.settings.arch): + raise ConanInvalidConfiguration(f"{self.ref} does not support native builds on Windows x86/x86_64. It is only supported on Windows ARM.") + if "arm" not in str(self.settings.arch) and "x86" not in str(self.settings.arch): + # INFO: https://github.com/ARM-software/ComputeLibrary#supported-architecturestechnologies + raise ConanInvalidConfiguration(f"{self.ref} does not support {self.settings.arch}. It is only supported on arm and x86.") + if "x86" in str(self.settings.arch) and self.settings.os != "Macos" and not self.options.get_safe("enable_opencl", False): + raise ConanInvalidConfiguration(f"{self.ref} can be built for x86_64 targets only with enable_neon=False and enable_opencl=True.") + if self.settings.os == "Linux" and self.settings.compiler == "clang": + # INFO: https://arm-software.github.io/ComputeLibrary/latest/how_to_build.xhtml#S1_2_linux + raise ConanInvalidConfiguration(f"{self.ref} does not support Linux with clang. It is only supported on Linux with gcc.") + if "armv8" not in str(self.settings.arch) and self.options.enable_multi_isa: + raise ConanInvalidConfiguration(f"{self.ref} does not support multi_isa option for {self.settings.arch}. It is only supported on armv8.") + if self.settings.arch == "armv8" and self.settings_build.arch == "x86_64" and self.settings.os == "Macos" and self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration(f"Mac Intel is not supported for armv8-a. Please, use Mac M1 as native build.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate(scope="build") + + def build(self): + # INFO: Using scons to build the library we don't have control over shared/static and install step, it is done all together always + # INFO: https://arm-software.github.io/ComputeLibrary/latest/how_to_build.xhtml + yes_no = lambda v: "1" if v else "0" + debug = yes_no(self.settings.build_type == "Debug") + build_os = str(self.settings.os).lower() + arch = {"armv8": "armv8a", "x86": "x86_32", "armv7": "armv7a", "armv7hf": "armv7a-hf"}.get(str(self.settings.arch), str(self.settings.arch)) + neon = yes_no(self.options.get_safe("enable_neon")) + opencl = yes_no(self.options.get_safe("enable_opencl", False)) + openmp = yes_no(self.options.get_safe("enable_openmp")) + multi_isa = yes_no(self.options.enable_multi_isa) + build = "cross_compile" if cross_building(self) else "native" + with chdir(self, self.source_folder): + self.run(f"scons Werror=0 validation_tests=0 examples=0 gemm_tuner=0 multi_isa={multi_isa} openmp={openmp} debug={debug} neon={neon} opencl={opencl} os={build_os} arch={arch} build={build} build_dir={self.build_folder} install_dir={self.package_folder} -j{build_jobs(self)} toolchain_prefix=''", env="conanbuild") + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + # INFO: Artifacts are installed during build step, so we just need to remove what we don't want + rm(self, "*.bazel", self.package_folder, recursive=True) + rm(self, "*.cpp", self.package_folder, recursive=True) + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.so*", os.path.join(self.package_folder, "lib")) + rm(self, "*.dylib*", os.path.join(self.package_folder, "lib")) + + def package_info(self): + suffix = "" if self.options.shared else "-static" + self.cpp_info.libs = [f"arm_compute{suffix}", f"arm_compute_core{suffix}", f"arm_compute_graph{suffix}"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] diff --git a/recipes/compute_library/all/test_package/CMakeLists.txt b/recipes/compute_library/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4c1184efde1e9 --- /dev/null +++ b/recipes/compute_library/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(compute_library REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE compute_library::compute_library) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/compute_library/all/test_package/conanfile.py b/recipes/compute_library/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/compute_library/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/compute_library/all/test_package/test_package.cpp b/recipes/compute_library/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2457b9908b8ac --- /dev/null +++ b/recipes/compute_library/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include +#include "arm_compute/core/Version.h" + + +int main(void) { + std::cout << "ComputeLibrary information:" << std::endl; + std::cout << arm_compute::build_information() << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/compute_library/config.yml b/recipes/compute_library/config.yml new file mode 100644 index 0000000000000..118236bce990b --- /dev/null +++ b/recipes/compute_library/config.yml @@ -0,0 +1,5 @@ +versions: + "23.08": + folder: all + "23.02.1": + folder: all diff --git a/recipes/concurrencpp/all/test_package/CMakeLists.txt b/recipes/concurrencpp/all/test_package/CMakeLists.txt index 8a9efdb5e56ab..98e3234d94895 100644 --- a/recipes/concurrencpp/all/test_package/CMakeLists.txt +++ b/recipes/concurrencpp/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(concurrencpp REQUIRED CONFIG) diff --git a/recipes/concurrencpp/all/test_v1_package/CMakeLists.txt b/recipes/concurrencpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/concurrencpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/concurrencpp/all/test_v1_package/conanfile.py b/recipes/concurrencpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/concurrencpp/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_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/concurrentqueue/all/test_package/CMakeLists.txt b/recipes/concurrentqueue/all/test_package/CMakeLists.txt index a0355afc44419..d26a325c5efc5 100644 --- a/recipes/concurrentqueue/all/test_package/CMakeLists.txt +++ b/recipes/concurrentqueue/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(concurrentqueue REQUIRED CONFIG) diff --git a/recipes/concurrentqueue/all/test_v1_package/CMakeLists.txt b/recipes/concurrentqueue/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2f4b988bcfd06..0000000000000 --- a/recipes/concurrentqueue/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(concurrentqueue REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE concurrentqueue::concurrentqueue) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/concurrentqueue/all/test_v1_package/conanfile.py b/recipes/concurrentqueue/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/concurrentqueue/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_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/confu_json/all/conandata.yml b/recipes/confu_json/all/conandata.yml index 5d78ae9d25a41..96bebd1cc3eab 100644 --- a/recipes/confu_json/all/conandata.yml +++ b/recipes/confu_json/all/conandata.yml @@ -1,13 +1,4 @@ sources: - "1.0.0": - url: "https://github.com/werto87/confu_json/archive/refs/tags/v1.0.0.tar.gz" - sha256: "f165172220b440d37a7a8301e490cf791b3b25b0cc3f2a08b355609c5f777db0" - "0.0.10": - url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.10.tar.gz" - sha256: "b31aab1bce952c0dc0bfc1f955a7b88be5103350b5a5eee1a4586ccec0e51fc1" - "0.0.9": - url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.9.tar.gz" - sha256: "29b2940b939cb04f11fdab4964c86bcb23ac75c588550bf54048e024444d2718" - "0.0.5": - url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.5.tar.gz" - sha256: "bc506d4b7836a7689b1c6a2d89bb0c3441f774c8f845fef79d85c71099df5bf9" + "1.1.1": + url: "https://github.com/werto87/confu_json/archive/refs/tags/v1.1.1.tar.gz" + sha256: "6b302c7c4b926db8ff0de65254eb0422eab04385a389715b88297bebf5378c35" diff --git a/recipes/confu_json/all/conanfile.py b/recipes/confu_json/all/conanfile.py index 3137417ca016a..496405f1bc15d 100644 --- a/recipes/confu_json/all/conanfile.py +++ b/recipes/confu_json/all/conanfile.py @@ -3,85 +3,44 @@ 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.51.1" +required_conan_version = ">=2.0" class ConfuJson(ConanFile): name = "confu_json" homepage = "https://github.com/werto87/confu_json" - description = "uses boost::fusion to help with serialization; json <-> user defined type" - topics = ("json parse", "serialization", "user defined type") + description = "Uses boost::fusion to help with serialization; json <-> user defined type" + topics = ("json", "serialization", "user-defined-type", "header-only") license = "BSL-1.0" 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" if Version(self.version) < "1.0.0" else "17" - - @property - def _compilers_minimum_version(self): - return { - "17": { - "Visual Studio": "17", - "msvc": "193", - "gcc": "7", - "clang": "7", - }, - "20": { - "Visual Studio": "17", - "msvc": "193", - "gcc": "10", - "clang": "10", - }, - }.get(self._min_cppstd, {}) def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0") - self.requires("magic_enum/0.8.2") + self.requires("boost/1.85.0") + self.requires("magic_enum/0.9.6") def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler == "apple-clang": - raise ConanInvalidConfiguration("apple-clang is not supported. Pull request welcome") - - if self.settings.compiler == "gcc" and Version(self.version) < "1.0.0": - raise ConanInvalidConfiguration("gcc is only supported in versions greater than or equal 1.0.0.") - - if is_msvc(self) and Version(self.version) < "0.0.9": - raise ConanInvalidConfiguration("Visual Studio is not supported in versions before confu_json/0.0.9") - - 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." - ) + check_min_cppstd(self, 20) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def build(self): - pass - def package(self): - copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "*.h*", src=os.path.join(self.source_folder, "confu_json"), - dst=os.path.join(self.package_folder, "include", "confu_json")) + copy(self, "LICENSE.md", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.h*", os.path.join(self.source_folder, "confu_json"), + os.path.join(self.package_folder, "include", "confu_json")) def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + self.cpp_info.requires = ["boost::headers", "magic_enum::magic_enum"] diff --git a/recipes/confu_json/all/test_package/CMakeLists.txt b/recipes/confu_json/all/test_package/CMakeLists.txt index cbb13e9d5f0af..eb6d533e601eb 100644 --- a/recipes/confu_json/all/test_package/CMakeLists.txt +++ b/recipes/confu_json/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) find_package(confu_json REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE confu_json::confu_json) -if(confu_json_VERSION VERSION_LESS "1.0.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) -else() - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/confu_json/all/test_v1_package/CMakeLists.txt b/recipes/confu_json/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/confu_json/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/confu_json/all/test_v1_package/conanfile.py b/recipes/confu_json/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/confu_json/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_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/confu_json/config.yml b/recipes/confu_json/config.yml index 337baede02ad0..60d31991f5141 100644 --- a/recipes/confu_json/config.yml +++ b/recipes/confu_json/config.yml @@ -1,9 +1,3 @@ versions: - "1.0.0": - folder: all - "0.0.10": - folder: all - "0.0.9": - folder: all - "0.0.5": + "1.1.1": folder: all diff --git a/recipes/coost/all/test_package/CMakeLists.txt b/recipes/coost/all/test_package/CMakeLists.txt index f7ac5b551babf..16f7349bf5a56 100644 --- a/recipes/coost/all/test_package/CMakeLists.txt +++ b/recipes/coost/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(coost REQUIRED CONFIG) 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..c70109c5ba246 --- /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": "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"): + 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/cose-c/all/test_v1_package/CMakeLists.txt b/recipes/cose-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cose-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6dffe66394a26..0000000000000 --- a/recipes/cose-c/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/cotila/all/test_v1_package/CMakeLists.txt b/recipes/cotila/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cotila/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index e1ab7e3d234d6..0000000000000 --- a/recipes/cotila/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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-channel/all/conandata.yml b/recipes/cpp-channel/all/conandata.yml new file mode 100644 index 0000000000000..ed231f8fb8014 --- /dev/null +++ b/recipes/cpp-channel/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.8.3": + url: "https://github.com/andreiavrammsd/cpp-channel/archive/refs/tags/v0.8.3.tar.gz" + sha256: "49539a9e387797bd91d1713588f7c88beef98d69919bfb7b0712ed060527567a" + "0.8.2": + url: "https://github.com/andreiavrammsd/cpp-channel/archive/refs/tags/v0.8.2.tar.gz" + sha256: "7666ec6ef275029593dc97bf35057761bc049298d71597a640da1e659c39a667" diff --git a/recipes/cpp-channel/all/conanfile.py b/recipes/cpp-channel/all/conanfile.py new file mode 100644 index 0000000000000..2dfc0cff05ee7 --- /dev/null +++ b/recipes/cpp-channel/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 +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.52.0" + +class CppCHannelConan(ConanFile): + name = "cpp-channel" + description = "Thread-safe container for sharing data between threads" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/andreiavrammsd/cpp-channel" + topics = ("channel", "golang", "container", "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 == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 7") + + 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="*.hpp", + 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"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cpp-channel/all/test_package/CMakeLists.txt b/recipes/cpp-channel/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6e53e2494f389 --- /dev/null +++ b/recipes/cpp-channel/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cpp-channel REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-channel::cpp-channel) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpp-channel/all/test_package/conanfile.py b/recipes/cpp-channel/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cpp-channel/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-channel/all/test_package/test_package.cpp b/recipes/cpp-channel/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f0fa8b9f9e593 --- /dev/null +++ b/recipes/cpp-channel/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include "msd/channel.hpp" + +int main() +{ + msd::channel ch{10}; + + int in{}; + + in = 1; + ch << in; + + in = 2; + ch << in; + + in = 3; + ch << in; + + for (auto out : ch) { + std::cout << out << '\n'; + + if (ch.empty()) { + break; + } + } +} diff --git a/recipes/cpp-channel/config.yml b/recipes/cpp-channel/config.yml new file mode 100644 index 0000000000000..eda9ea75e51a5 --- /dev/null +++ b/recipes/cpp-channel/config.yml @@ -0,0 +1,5 @@ +versions: + "0.8.3": + folder: all + "0.8.2": + folder: all diff --git a/recipes/cpp-dump/all/conandata.yml b/recipes/cpp-dump/all/conandata.yml new file mode 100644 index 0000000000000..adaa64a423425 --- /dev/null +++ b/recipes/cpp-dump/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.7.0": + url: "https://github.com/philip82148/cpp-dump/archive/refs/tags/v0.7.0.tar.gz" + sha256: "b27a0854a405aa10619f341f66e26a6c39dca1ad41a26dd4fa6d86ad6752c4f8" + "0.6.0": + url: "https://github.com/philip82148/cpp-dump/archive/refs/tags/v0.6.0.tar.gz" + sha256: "22bc5fafa22ac7c1e99db8824fdabec4af6baabed0c8b7cc80a0205dfb550414" + "0.5.0": + url: "https://github.com/philip82148/cpp-dump/archive/refs/tags/v0.5.0.tar.gz" + sha256: "31fa8b03c9ee820525137be28f37b36e2abe7fd91df7d67681cb894db2230fe6" diff --git a/recipes/cpp-dump/all/conanfile.py b/recipes/cpp-dump/all/conanfile.py new file mode 100644 index 0000000000000..36c04e6dd12c9 --- /dev/null +++ b/recipes/cpp-dump/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.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 CppDumpConan(ConanFile): + name = "cpp-dump" + description = "An all-round dump function library for C++ that can print any type, even user-defined types." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/philip82148/cpp-dump" + topics = ("debug", "dump", "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) + if Version(self.version) < "0.7.0": + copy( + self, + pattern="dump.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include", "hpp"), + src=os.path.join(self.source_folder, "hpp"), + ) + else: + copy( + self, + pattern="*dump.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + ) + copy( + self, + pattern="*.hpp", + dst=os.path.join(self.package_folder, "include", "cpp-dump"), + src=os.path.join(self.source_folder, "cpp-dump"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/cpp-dump/all/test_package/CMakeLists.txt b/recipes/cpp-dump/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..79f40a47d7e0c --- /dev/null +++ b/recipes/cpp-dump/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cpp-dump REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp-dump::cpp-dump) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cpp-dump/all/test_package/conanfile.py b/recipes/cpp-dump/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cpp-dump/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-dump/all/test_package/test_package.cpp b/recipes/cpp-dump/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..187dc7393224b --- /dev/null +++ b/recipes/cpp-dump/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include +#include +#include + +int main() { + std::clog << std::endl; + + std::vector> my_vector{{3, 5, 8, 9, 7}, {9, 3, 2, 3, 8}}; + CPP_DUMP(my_vector); + + std::clog << std::endl; +} diff --git a/recipes/cpp-dump/config.yml b/recipes/cpp-dump/config.yml new file mode 100644 index 0000000000000..d61439bae1bc3 --- /dev/null +++ b/recipes/cpp-dump/config.yml @@ -0,0 +1,7 @@ +versions: + "0.7.0": + folder: all + "0.6.0": + folder: all + "0.5.0": + folder: all diff --git a/recipes/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml index 7e54c58b1975d..02f6533d9cad2 100644 --- a/recipes/cpp-httplib/all/conandata.yml +++ b/recipes/cpp-httplib/all/conandata.yml @@ -1,25 +1,38 @@ sources: - "0.14.2": - url: "https://github.com/yhirose/cpp-httplib/archive/v0.14.2.tar.gz" - sha256: "dbcf5590e8ed35c6745c2ad659a5ebec92f05187d1506eec24449d6db95e5084" + "0.19.0": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.19.0.tar.gz" + sha256: "c9b9e0524666e1cd088f0874c57c1ce7c0eaa8552f9f4e15c755d5201fc8c608" + "0.18.3": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.18.3.tar.gz" + sha256: "a0567bcd6c3fe5cef1b329b96245119047f876b49e06cc129a36a7a8dffe173e" + "0.18.2": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.18.2.tar.gz" + sha256: "7dc9be587e7432b75a892832df33d6819460b5462ccd59fc462ba012fef5bf72" + "0.18.1": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.18.1.tar.gz" + sha256: "405abd8170f2a446fc8612ac635d0db5947c0d2e156e32603403a4496255ff00" + "0.18.0": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.18.0.tar.gz" + sha256: "6ed5894bbbc4a34a0f4c5e962672d0003d2ea099bbadacc66f6dee2b213ff394" + "0.17.3": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.17.3.tar.gz" + sha256: "95bd6dba4241656c59d6f0854d408d14c220f7c71e673319ee27d30aee741aaa" + "0.17.1": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.17.1.tar.gz" + sha256: "044c5a233da242e981d9543dd136a5945e0549c5641a0373934db88bbd192f41" + "0.16.3": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.16.3.tar.gz" + sha256: "c1742fc7179aaae2a67ad9bba0740b7e9ffaf4f5e62feef53101ecdef1478716" + "0.16.0": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.16.0.tar.gz" + sha256: "c125022eb85eaa12235518dc4638be93b62c3216d0f87b655af7b17b71b38851" + "0.15.3": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.15.3.tar.gz" + sha256: "2121bbf38871bb2aafb5f7f2b9b94705366170909f434428352187cb0216124e" + "0.14.3": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.14.3.tar.gz" + sha256: "dcf6486d9030937636d8a4f820ca9531808fd7edb283893dddbaa05f99357e63" + # keep 0.14.1 for enjincppsdk and microservice-essentials "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.10.9": - url: "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.10.9.tar.gz" - sha256: "95ac0740ef760829a079c01a44164fd74af3fdc0748a40fc6beefd0276fd2345" diff --git a/recipes/cpp-httplib/all/conanfile.py b/recipes/cpp-httplib/all/conanfile.py index a9367f94e5c40..acf164da9f9fc 100644 --- a/recipes/cpp-httplib/all/conanfile.py +++ b/recipes/cpp-httplib/all/conanfile.py @@ -1,20 +1,19 @@ 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" +required_conan_version = ">=2.1" class CpphttplibConan(ConanFile): name = "cpp-httplib" description = "A C++11 single-file header-only cross platform HTTP/HTTPS library." license = "MIT" - homepage = "https://github.com/yhirose/cpp-httplib" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/yhirose/cpp-httplib" topics = ("http", "https", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @@ -22,32 +21,37 @@ class CpphttplibConan(ConanFile): "with_openssl": [True, False], "with_zlib": [True, False], "with_brotli": [True, False], + "use_macos_keychain_certs": [True, False], } default_options = { "with_openssl": False, "with_zlib": False, "with_brotli": False, + "use_macos_keychain_certs": True, } no_copy_source = True def config_options(self): - if Version(self.version) < "0.7.2": - del self.options.with_brotli + if self.settings.os != "Macos": + del self.options.use_macos_keychain_certs def requirements(self): if self.options.with_openssl: - self.requires("openssl/[>=1.1 <4]") + if Version(self.version) < "0.15": + self.requires("openssl/[>=1.1 <4]") + else: + # New version of httplib.h requires OpenSSL 3 + self.requires("openssl/[>=3 <4]") if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") - if self.options.get_safe("with_brotli"): - self.requires("brotli/1.0.9") + if self.options.with_brotli: + self.requires("brotli/1.1.0") def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def layout(self): basic_layout(self, src_folder="src") @@ -55,9 +59,6 @@ def layout(self): 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, "httplib.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "httplib")) @@ -72,13 +73,12 @@ 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"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["crypt32", "cryptui", "ws2_32"] - - # TODO: to remove in conan v2 once legacy generators removed - self.cpp_info.names["cmake_find_package"] = "httplib" - self.cpp_info.names["cmake_find_package_multi"] = "httplib" + elif self.settings.os == "Macos" and self.options.with_openssl and self.options.get_safe("use_macos_keychain_certs"): + self.cpp_info.frameworks = ["CoreFoundation", "Security"] + self.cpp_info.defines.append("CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN") diff --git a/recipes/cpp-httplib/all/test_package/conanfile.py b/recipes/cpp-httplib/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/cpp-httplib/all/test_package/conanfile.py +++ b/recipes/cpp-httplib/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/cpp-httplib/all/test_v1_package/CMakeLists.txt b/recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpp-httplib/all/test_v1_package/conanfile.py b/recipes/cpp-httplib/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cpp-httplib/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_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml index 190ca8b340419..73ef779efbbca 100644 --- a/recipes/cpp-httplib/config.yml +++ b/recipes/cpp-httplib/config.yml @@ -1,17 +1,25 @@ versions: - "0.14.2": + "0.19.0": folder: all - "0.14.1": + "0.18.3": + folder: all + "0.18.2": + folder: all + "0.18.1": folder: all - "0.14.0": + "0.18.0": folder: all - "0.13.3": + "0.17.3": folder: all - "0.13.1": + "0.17.1": folder: all - "0.12.6": + "0.16.3": folder: all - "0.11.4": + "0.16.0": folder: all - "0.10.9": + "0.15.3": + folder: all + "0.14.3": + folder: all + "0.14.1": folder: all diff --git a/recipes/cpp-ipc/all/test_v1_package/CMakeLists.txt b/recipes/cpp-ipc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cpp-ipc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/cpp-ipc/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", "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-jwt/all/test_package/CMakeLists.txt b/recipes/cpp-jwt/all/test_package/CMakeLists.txt index 5141de159bdfd..e14c3a7e3646f 100644 --- a/recipes/cpp-jwt/all/test_package/CMakeLists.txt +++ b/recipes/cpp-jwt/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(cpp-jwt REQUIRED CONFIG) diff --git a/recipes/cpp-jwt/all/test_v1_package/CMakeLists.txt b/recipes/cpp-jwt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cpp-jwt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpp-jwt/all/test_v1_package/conanfile.py b/recipes/cpp-jwt/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cpp-jwt/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_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-optparse/all/CMakeLists.txt b/recipes/cpp-optparse/all/CMakeLists.txt index 85cb504fb1461..ff72ea5eb68ab 100644 --- a/recipes/cpp-optparse/all/CMakeLists.txt +++ b/recipes/cpp-optparse/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(cpp-optparse LANGUAGES CXX) include(GNUInstallDirs) diff --git a/recipes/cpp-optparse/all/test_package/CMakeLists.txt b/recipes/cpp-optparse/all/test_package/CMakeLists.txt index 39cb8da083e2d..9f240be2f5ebb 100644 --- a/recipes/cpp-optparse/all/test_package/CMakeLists.txt +++ b/recipes/cpp-optparse/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(cpp-optparse REQUIRED CONFIG) diff --git a/recipes/cpp-optparse/all/test_v1_package/CMakeLists.txt b/recipes/cpp-optparse/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cpp-optparse/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpp-optparse/all/test_v1_package/conanfile.py b/recipes/cpp-optparse/all/test_v1_package/conanfile.py deleted file mode 100644 index 9f45afc4e29a1..0000000000000 --- a/recipes/cpp-optparse/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_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(f"{bin_path} --help", run_environment=True) diff --git a/recipes/cpp-peglib/0.x.x/test_package/CMakeLists.txt b/recipes/cpp-peglib/0.x.x/test_package/CMakeLists.txt index 9f2b801df306b..59ec255848740 100644 --- a/recipes/cpp-peglib/0.x.x/test_package/CMakeLists.txt +++ b/recipes/cpp-peglib/0.x.x/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(cpp-peglib CONFIG REQUIRED) diff --git a/recipes/cpp-peglib/0.x.x/test_v1_package/CMakeLists.txt b/recipes/cpp-peglib/0.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index fad4cae2ba206..0000000000000 --- a/recipes/cpp-peglib/0.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(cpp-peglib CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE cpp-peglib::cpp-peglib) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cpp-peglib/0.x.x/test_v1_package/conanfile.py b/recipes/cpp-peglib/0.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cpp-peglib/0.x.x/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_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-peglib/1.x.x/conandata.yml b/recipes/cpp-peglib/1.x.x/conandata.yml index 22a7588040467..dcadbbf685932 100644 --- a/recipes/cpp-peglib/1.x.x/conandata.yml +++ b/recipes/cpp-peglib/1.x.x/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.9.1": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.9.1.tar.gz" + sha256: "f57aa0f14372cbb772af29e3a4549a8033ea07eb25c39949cba6178e0e2ba9cc" + "1.9.0": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.9.0.tar.gz" + sha256: "6f4f0956ea2f44fd1c5882f8adc5782451ba9d227c467d214196390ddedb024c" + "1.8.8": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.8.tar.gz" + sha256: "3019d8084a146562fe2fd4c71e3226ac6e3994e8cee21cab27b3cd5a86bcef34" + "1.8.7": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.7.tar.gz" + sha256: "400696cc7e721b23aeac28a1ae12ceec235e2671888993da2ce012f6acdf83d4" + "1.8.6": + url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.6.tar.gz" + sha256: "b2ebdc135a66074a386d377b761b38e050088fba6482575ca3028d0e184ecd91" "1.8.5": url: "https://github.com/yhirose/cpp-peglib/archive/v1.8.5.tar.gz" sha256: "2813f7ffdeb570959b879ce2bf3921bf4f2edc0d9f1568c4429eceadff9ab114" 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 b4be9dd643afb..7a4fb660f3b98 100644 --- a/recipes/cpp-peglib/1.x.x/test_package/CMakeLists.txt +++ b/recipes/cpp-peglib/1.x.x/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(cpp-peglib CONFIG) diff --git a/recipes/cpp-peglib/1.x.x/test_v1_package/CMakeLists.txt b/recipes/cpp-peglib/1.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cpp-peglib/1.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpp-peglib/1.x.x/test_v1_package/conanfile.py b/recipes/cpp-peglib/1.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cpp-peglib/1.x.x/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_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-peglib/config.yml b/recipes/cpp-peglib/config.yml index e7a9a93559bfa..2235c38ce3f5b 100644 --- a/recipes/cpp-peglib/config.yml +++ b/recipes/cpp-peglib/config.yml @@ -1,4 +1,14 @@ versions: + "1.9.1": + folder: "1.x.x" + "1.9.0": + folder: "1.x.x" + "1.8.8": + folder: "1.x.x" + "1.8.7": + folder: "1.x.x" + "1.8.6": + folder: "1.x.x" "1.8.5": folder: "1.x.x" "1.8.4": diff --git a/recipes/cpp-smtpclient-library/all/conandata.yml b/recipes/cpp-smtpclient-library/all/conandata.yml new file mode 100644 index 0000000000000..0616c7456fb7f --- /dev/null +++ b/recipes/cpp-smtpclient-library/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "1.1.10": + url: "https://github.com/jeremydumais/CPP-SMTPClient-library/archive/refs/tags/v1.1.10.zip" + sha256: "760e34417fa00b7bd56618f0d9e382867b65729c16175da1abb77d70fe1d1cd6" + diff --git a/recipes/cpp-smtpclient-library/all/conanfile.py b/recipes/cpp-smtpclient-library/all/conanfile.py new file mode 100644 index 0000000000000..89723ff0b0df5 --- /dev/null +++ b/recipes/cpp-smtpclient-library/all/conanfile.py @@ -0,0 +1,78 @@ +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, replace_in_file +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + + +required_conan_version = ">=2.0.9" + +class PackageConan(ConanFile): + name = "cpp-smtpclient-library" + description = "An SMTP client library built in C++ that support authentication and secure connections" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jeremydumais/CPP-SMTPClient-library" + topics = ("c", "cpp", "cpp-library", "macos", "windows", "linux", "smtp", "email") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + check_min_cppstd(self, 14) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_SSL_LIBRARY}", "OpenSSL::Crypto OpenSSL::SSL") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "ssl crypto", "OpenSSL::Crypto OpenSSL::SSL") + + def generate(self): + tc = CMakeToolchain(self) + if is_msvc(self): + tc.cache_variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "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.libdirs = [os.path.join("lib", "smtpclient")] + self.cpp_info.libs = ["smtpclient"] + self.cpp_info.set_property("cmake_module_file_name", "smtpclient") + self.cpp_info.set_property("cmake_module_target_name", "smtpclient::smtpclient") + self.cpp_info.set_property("cmake_file_name", "smtpclient") + self.cpp_info.set_property("cmake_target_name", "smtpclient::smtpclient") + if not self.options.shared: + self.cpp_info.defines.append("SMTPCLIENT_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/recipes/cpp-smtpclient-library/all/test_package/CMakeLists.txt b/recipes/cpp-smtpclient-library/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fd1acffa01ddb --- /dev/null +++ b/recipes/cpp-smtpclient-library/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(smtpclient REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE smtpclient::smtpclient) diff --git a/recipes/cpp-smtpclient-library/all/test_package/conanfile.py b/recipes/cpp-smtpclient-library/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2e77b4246fa81 --- /dev/null +++ b/recipes/cpp-smtpclient-library/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" + + 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-smtpclient-library/all/test_package/test_package.cpp b/recipes/cpp-smtpclient-library/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..959f150770cff --- /dev/null +++ b/recipes/cpp-smtpclient-library/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include "smtpclient/cpp/credential.hpp" + + +int main(void) { + jed_utils::cpp::Credential creds("Test", "Test2"); + + return EXIT_SUCCESS; +} diff --git a/recipes/cpp-smtpclient-library/config.yml b/recipes/cpp-smtpclient-library/config.yml new file mode 100644 index 0000000000000..819d7ead0f90a --- /dev/null +++ b/recipes/cpp-smtpclient-library/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.10": + folder: all diff --git a/recipes/cpp-sort/all/conandata.yml b/recipes/cpp-sort/all/conandata.yml index 48e5289632674..c155d44a961c8 100644 --- a/recipes/cpp-sort/all/conandata.yml +++ b/recipes/cpp-sort/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.16.0": + url: "https://github.com/Morwenn/cpp-sort/archive/1.16.0.tar.gz" + sha256: "54eb65de5655ce58719d45616f29e4b9060135b9cc8b526bcfc9f5434975ea8c" "1.15.0": url: "https://github.com/Morwenn/cpp-sort/archive/1.15.0.tar.gz" sha256: "886e813a4b87c6361e9b50c0a66c73b3b812f0ce0b7039ff3991eddce77e0dc7" diff --git a/recipes/cpp-sort/all/conanfile.py b/recipes/cpp-sort/all/conanfile.py index e0e093c1fa165..8dec2c54472db 100644 --- a/recipes/cpp-sort/all/conanfile.py +++ b/recipes/cpp-sort/all/conanfile.py @@ -54,22 +54,11 @@ 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._min_cppstd} features " - f"which are not supported by compiler {compiler} {version}." - ) - raise ConanInvalidConfiguration(msg) - except KeyError: - msg = ( - f"{self.ref} recipe lacks information about the {compiler} compiler, " - f"support for the required C++{self._min_cppstd} 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], strip_root=True) diff --git a/recipes/cpp-sort/all/test_package/CMakeLists.txt b/recipes/cpp-sort/all/test_package/CMakeLists.txt index da13330ac49af..086f028835c2d 100644 --- a/recipes/cpp-sort/all/test_package/CMakeLists.txt +++ b/recipes/cpp-sort/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) diff --git a/recipes/cpp-sort/all/test_v1_package/CMakeLists.txt b/recipes/cpp-sort/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2a9b48732268c..0000000000000 --- a/recipes/cpp-sort/all/test_v1_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(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cpp-sort/all/test_v1_package/conanfile.py b/recipes/cpp-sort/all/test_v1_package/conanfile.py deleted file mode 100644 index b6f0560ab0e48..0000000000000 --- a/recipes/cpp-sort/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class CppsortTestConan(ConanFile): - settings = "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/cpp-sort/config.yml b/recipes/cpp-sort/config.yml index acbaa54fefe9c..ce014d3a22c71 100644 --- a/recipes/cpp-sort/config.yml +++ b/recipes/cpp-sort/config.yml @@ -1,4 +1,6 @@ versions: + "1.16.0": + folder: all "1.15.0": folder: all "1.14.0": diff --git a/recipes/cpp-taskflow/all/test_package/CMakeLists.txt b/recipes/cpp-taskflow/all/test_package/CMakeLists.txt index 5694d2375840f..8c86326cb083d 100644 --- a/recipes/cpp-taskflow/all/test_package/CMakeLists.txt +++ b/recipes/cpp-taskflow/all/test_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/cpp-validator/all/conanfile.py b/recipes/cpp-validator/all/conanfile.py index 3da277d18f9a6..befec7e45358b 100644 --- a/recipes/cpp-validator/all/conanfile.py +++ b/recipes/cpp-validator/all/conanfile.py @@ -64,7 +64,7 @@ def validate(self): def requirements(self): self.requires("boost/1.83.0") - self.requires("fmt/10.1.1") + self.requires("fmt/10.2.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/cpp-yyjson/all/conandata.yml b/recipes/cpp-yyjson/all/conandata.yml new file mode 100644 index 0000000000000..acb24326f9a42 --- /dev/null +++ b/recipes/cpp-yyjson/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.6.0": + url: "https://github.com/yosh-matsuda/cpp-yyjson/archive/refs/tags/v0.6.0.tar.gz" + sha256: "e146e5e2de023a83ffafba52320506bd25512e6ae9d13ee7836110f659253914" + "0.5.0": + url: "https://github.com/yosh-matsuda/cpp-yyjson/archive/refs/tags/v0.5.0.tar.gz" + sha256: "c1d44460c9ca3c21d5cfaea882ffaca83565c24984c5d17322e0b74a84ececfc" diff --git a/recipes/cpp-yyjson/all/conanfile.py b/recipes/cpp-yyjson/all/conanfile.py new file mode 100644 index 0000000000000..1e453082ca159 --- /dev/null +++ b/recipes/cpp-yyjson/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 copy, get +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 CppYyjsonConan(ConanFile): + name = "cpp-yyjson" + description = "Ultra-fast and intuitive C++ JSON reader/writer with yyjson backend" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/yosh-matsuda/cpp-yyjson" + topics = ("json", "reader", "writer", "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": "11", + "clang": "15", + "apple-clang": "14", + "Visual Studio": "17", + "msvc": "193", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) < "0.6.0": + self.requires("yyjson/0.9.0") + else: + self.requires("yyjson/0.10.0") + self.requires("fmt/10.2.1") + self.requires("nameof/0.10.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): + 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, + "*.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 is_msvc(self): + self.cpp_info.cxxflags.append("/Zc:preprocessor") + + self.cpp_info.set_property("cmake_file_name", "cpp_yyjson") + self.cpp_info.set_property("cmake_target_name", "cpp_yyjson::cpp_yyjson") diff --git a/recipes/cpp-yyjson/all/test_package/CMakeLists.txt b/recipes/cpp-yyjson/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f2fd7795754c4 --- /dev/null +++ b/recipes/cpp-yyjson/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cpp_yyjson REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cpp_yyjson::cpp_yyjson) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/cpp-yyjson/all/test_package/conanfile.py b/recipes/cpp-yyjson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/cpp-yyjson/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-yyjson/all/test_package/test_package.cpp b/recipes/cpp-yyjson/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f4345c086ba90 --- /dev/null +++ b/recipes/cpp-yyjson/all/test_package/test_package.cpp @@ -0,0 +1,52 @@ +#include +#include +#include + +#include "cpp_yyjson.hpp" + +using namespace yyjson; + +auto json_str = R"( +{ + "id": 1, + "pi": 3.141592, + "name": "example", + "array": [0, 1, 2, 3, 4], + "currency": { + "USD": 129.66, + "EUR": 140.35, + "GBP": 158.72 + }, + "success": true +})"; + +int main() { + // Read JSON string and cast as an object class + auto obj = *read(json_str).as_object(); + + // Key access to the JSON object class + auto id = *obj["id"].as_int(); + auto pi = *obj["pi"].as_real(); + auto name = *obj["name"].as_string(); + auto success = *obj["success"].as_bool(); + + // JSON array/object classes adapt the range concept + auto list = *obj["array"].as_array(); + for (const auto& v : list) { + // `write` returns JSON read-only string + std::cout << v.write() << std::endl; + } + + // The range value type of object class is a key-value pair + auto dict = *obj["currency"].as_object(); + for (const auto& [k, v] : dict) { + std::cout << "{" << k << ": " << v.write() << "}" << std::endl; + } + + // JSON array/object to container conversion + auto numbers = cast>(list); + auto currency = cast>(dict); + + // Stringify read-only string + std::cout << obj.write() << std::endl; +} diff --git a/recipes/cpp-yyjson/config.yml b/recipes/cpp-yyjson/config.yml new file mode 100644 index 0000000000000..33d7618432d30 --- /dev/null +++ b/recipes/cpp-yyjson/config.yml @@ -0,0 +1,5 @@ +versions: + "0.6.0": + folder: all + "0.5.0": + folder: all diff --git a/recipes/cpp_project_framework/all/test_v1_package/CMakeLists.txt b/recipes/cpp_project_framework/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cpp_project_framework/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 0761aa549fc91..0000000000000 --- a/recipes/cpp_project_framework/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -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/test_package/CMakeLists.txt b/recipes/cppbenchmark/all/test_package/CMakeLists.txt index ba1f47741565b..9fdc7e740b356 100644 --- a/recipes/cppbenchmark/all/test_package/CMakeLists.txt +++ b/recipes/cppbenchmark/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(cppbenchmark REQUIRED CONFIG) diff --git a/recipes/cppbenchmark/all/test_v1_package/CMakeLists.txt b/recipes/cppbenchmark/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/cppbenchmark/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cppbenchmark/all/test_v1_package/conanfile.py b/recipes/cppbenchmark/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/cppbenchmark/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/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index 309e9e9115ce0..9b55f72b91aa7 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -1,10 +1,28 @@ sources: + "2.17.1": + url: "https://github.com/danmar/cppcheck/archive/2.17.1.tar.gz" + sha256: "bfd681868248ec03855ca7c2aea7bcb1f39b8b18860d76aec805a92a967b966c" + "2.17.0": + url: "https://github.com/danmar/cppcheck/archive/2.17.0.tar.gz" + sha256: "5a639adf8d5f2520a280eb0f0fc25605cd8a3d4336a27f4a3e3e0f0c0c9789da" + "2.16.2": + url: "https://github.com/danmar/cppcheck/archive/2.16.2.tar.gz" + sha256: "521b996cb56b0c30f89e022abcb50aef85d7219cb7a7162fa81fe40fe6394206" + "2.16.0": + url: "https://github.com/danmar/cppcheck/archive/2.16.0.tar.gz" + sha256: "f1a97c8cef5ee9d0abb57e9244549d4fe18d4ecac80cf82e250d1fc5f38b1501" + "2.15.0": + url: "https://github.com/danmar/cppcheck/archive/2.15.0.tar.gz" + sha256: "98bcc40ac8062635b492fb096d7815376a176ae26749d6c708083f4637f7c0bb" + "2.14.2": + url: "https://github.com/danmar/cppcheck/archive/2.14.2.tar.gz" + sha256: "9c3acea5f489336bd83a8ea33917a9a04a80c56d874bf270287e7de27acf2d00" + "2.13.4": + url: "https://github.com/danmar/cppcheck/archive/2.13.4.tar.gz" + sha256: "d6ea064ebab76c6aa000795440479767d8d814dd29405918df4c1bbfcd6cb86c" "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" @@ -18,10 +36,6 @@ sources: url: "https://github.com/danmar/cppcheck/archive/2.8.2.tar.gz" sha256: "30ba99ab54089c44b83f02e2453da046a7edff5237950d4A0eb1eba4afcb4f45" patches: - "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" diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index fa5b72926399e..5847820ea9577 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -4,31 +4,39 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class CppcheckConan(ConanFile): name = "cppcheck" + description = "Cppcheck is an analysis tool for C/C++ code." + license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/danmar/cppcheck" topics = ("code quality", "static analyzer", "linter") - description = "Cppcheck is an analysis tool for C/C++ code." - license = "GPL-3.0-or-later" package_type = "application" settings = "os", "arch", "compiler", "build_type" - options = {"have_rules": [True, False]} - default_options = {"have_rules": True} - - def layout(self): - cmake_layout(self, src_folder="src") + options = { + "have_rules": [True, False], + } + default_options = { + "have_rules": True, + } def export_sources(self): export_conandata_patches(self) + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): if self.options.get_safe("have_rules"): self.requires("pcre/8.45") + def package_id(self): + 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) @@ -40,6 +48,8 @@ def generate(self): if Version(self.version) >= "2.11.0": tc.variables["DISABLE_DMAKE"] = True tc.variables["FILESDIR"] = "bin" + if Version(self.version) < "2.14.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) @@ -57,17 +67,10 @@ def package(self): cmake = CMake(self) cmake.install() - def package_id(self): - del self.info.settings.compiler - del self.info.settings.build_type - def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] bin_folder = os.path.join(self.package_folder, "bin") - self.output.info(f"Append {bin_folder} to environment variable PATH") - self.env_info.PATH.append(bin_folder) cppcheck_htmlreport = os.path.join(bin_folder, "cppcheck-htmlreport") - self.env_info.CPPCHECK_HTMLREPORT = cppcheck_htmlreport self.runenv_info.define_path("CPPCHECK_HTMLREPORT", cppcheck_htmlreport) 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 deleted file mode 100644 index 7f30a7cb1d7d4..0000000000000 --- a/recipes/cppcheck/all/patches/0004-pcre-debuglib-name-2.12.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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/all/test_v1_package/conanfile.py b/recipes/cppcheck/all/test_v1_package/conanfile.py deleted file mode 100644 index 0102e14ac0191..0000000000000 --- a/recipes/cppcheck/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conan import ConanFile -from conan.tools.build import can_run -import sys - - -class TestPackageConan(ConanFile): - settings = "os", "arch" - generators = "VirtualRunEnv" - - def test(self): - if can_run(self): - self.run("cppcheck --enable=warning,style,performance --std=c++11 .", - cwd=self.source_folder, run_environment=True) - if self.settings.os == "Windows": - self.run(f"{sys.executable} %CPPCHECK_HTMLREPORT% -h", run_environment=True) - else: - self.run("cppcheck-htmlreport -h", run_environment=True) diff --git a/recipes/cppcheck/all/test_v1_package/file_to_check.cpp b/recipes/cppcheck/all/test_v1_package/file_to_check.cpp deleted file mode 100644 index 33c14ce1d76c0..0000000000000 --- a/recipes/cppcheck/all/test_v1_package/file_to_check.cpp +++ /dev/null @@ -1,3 +0,0 @@ -int main() { - return 0; -} diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml index 0fb8b3e88183b..7a24632a89143 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -1,7 +1,19 @@ versions: - "2.12.1": + "2.17.1": + folder: all + "2.17.0": + folder: all + "2.16.2": + folder: all + "2.16.0": folder: all - "2.12": + "2.15.0": + folder: all + "2.14.2": + folder: all + "2.13.4": + folder: all + "2.12.1": folder: all "2.11.1": folder: all diff --git a/recipes/cppcodec/all/test_package/CMakeLists.txt b/recipes/cppcodec/all/test_package/CMakeLists.txt index d359976811ee3..e0143f6d44979 100644 --- a/recipes/cppcodec/all/test_package/CMakeLists.txt +++ b/recipes/cppcodec/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(cppcodec REQUIRED CONFIG) diff --git a/recipes/cppcodec/all/test_v1_package/CMakeLists.txt b/recipes/cppcodec/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 4e3738c68e0b9..0000000000000 --- a/recipes/cppcodec/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(cppcodec REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE cppcodec::cppcodec) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/cppcodec/all/test_v1_package/conanfile.py b/recipes/cppcodec/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cppcodec/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_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/cppcommon/all/conanfile.py b/recipes/cppcommon/all/conanfile.py index 9e2726f3581c5..87459c520bc72 100644 --- a/recipes/cppcommon/all/conanfile.py +++ b/recipes/cppcommon/all/conanfile.py @@ -60,11 +60,11 @@ def layout(self): def requirements(self): if Version(self.version) < "1.0.3" or self.version == "cci.20201104": - self.requires("fmt/8.1.1") + self.requires("fmt/8.1.1", transitive_headers=True) else: - self.requires("fmt/10.1.0", transitive_headers=True) + self.requires("fmt/10.2.0", transitive_headers=True, transitive_libs=True) if self.settings.os == "Linux": - self.requires("util-linux-libuuid/2.39") + self.requires("util-linux-libuuid/2.39.2", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/cppcommon/all/test_package/CMakeLists.txt b/recipes/cppcommon/all/test_package/CMakeLists.txt index 0c4ae375149ae..8f52d2a7270c1 100644 --- a/recipes/cppcommon/all/test_package/CMakeLists.txt +++ b/recipes/cppcommon/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(cppcommon REQUIRED CONFIG) diff --git a/recipes/cppfront/all/conandata.yml b/recipes/cppfront/all/conandata.yml index 4a9575e4249b6..41ca7a255f0d2 100644 --- a/recipes/cppfront/all/conandata.yml +++ b/recipes/cppfront/all/conandata.yml @@ -1,13 +1,4 @@ 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" - "cci.20221024": - url: "https://github.com/hsutter/cppfront/archive/b1754dbd53a496a9104b43ecde6064c9980246bd.zip" - sha256: "8668bddbd7fc06d4975c867521c005f898eca8f83f018e7c28b54dbcf9aa3ab9" - "cci.20220924": - url: "https://github.com/hsutter/cppfront/archive/98f6dd46957e100f813245241f183c8aedbcb36f.zip" - sha256: "db51c1ac634d45c6047c7eec5c29993ff215443edadf334370f53d09a11cc5b1" + "0.8.0": + url: "https://github.com/hsutter/cppfront/archive/refs/tags/v0.8.0.tar.gz" + sha256: "7fb573599960bc0a46a71ed103ff97adbf938d4a0df754dc952a44fdcacfc571" diff --git a/recipes/cppfront/all/conanfile.py b/recipes/cppfront/all/conanfile.py index 7f4f580a8ec02..63d0fe03c6f48 100644 --- a/recipes/cppfront/all/conanfile.py +++ b/recipes/cppfront/all/conanfile.py @@ -11,10 +11,11 @@ class CppfrontConan(ConanFile): name = "cppfront" description = "Cppfront is a experimental compiler from a potential C++ 'syntax 2' (Cpp2) to today's 'syntax 1' (Cpp1)" - topics = ("cpp2", "compiler") + license = "CC-BY-NC-ND-4.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/hsutter/cppfront" - license = "CC-BY-NC-ND-4.0" + topics = ("cpp2", "compiler") + package_type = "application" settings = "os", "arch", "compiler", "build_type" @property @@ -25,10 +26,12 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "gcc": "11", - "Visual Studio": "16.9", - "msvc": "192.9", + # cppfront requires constexpr source_location + "Visual Studio": "17", + "msvc": "193", "clang": "12", - "apple-clang": "13", + # cppfront requires which is available on apple-clang 14.3 or later.. + "apple-clang": "14.3", } def export_sources(self): diff --git a/recipes/cppfront/all/test_package/conanfile.py b/recipes/cppfront/all/test_package/conanfile.py index 5c77415f9d7dc..c71fdc5de19bd 100644 --- a/recipes/cppfront/all/test_package/conanfile.py +++ b/recipes/cppfront/all/test_package/conanfile.py @@ -6,19 +6,18 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "VirtualBuildEnv" - test_type = "explicit" + generators = "VirtualRunEnv" def layout(self): basic_layout(self) - def build_requirements(self): - self.tool_requires(self.tested_reference_str) + def requirements(self): + self.requires(self.tested_reference_str) def build(self): copy(self, "pure2-hello.cpp2", src=self.recipe_folder, dst=self.build_folder) - self.run("cppfront {}".format(os.path.join(self.build_folder, "pure2-hello.cpp2"))) + self.run("cppfront {}".format(os.path.join(self.build_folder, "pure2-hello.cpp2")), env="conanrun") def test(self): - self.run("cppfront -h") + self.run("cppfront -h", env="conanrun") assert os.path.isfile(os.path.join(self.build_folder, "pure2-hello.cpp")) diff --git a/recipes/cppfront/all/test_v1_package/conanfile.py b/recipes/cppfront/all/test_v1_package/conanfile.py deleted file mode 100644 index 13f05370739e6..0000000000000 --- a/recipes/cppfront/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -from conans import ConanFile -import os -import shutil - - -class TestPackageV1Conan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - test_type = "explicit" - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - - def build(self): - shutil.copy2(src=os.path.join(self.source_folder, os.pardir, "test_package", "pure2-hello.cpp2"), - dst=os.path.join(self.build_folder, "pure2-hello.cpp2")) - self.run("cppfront {}".format(os.path.join(self.build_folder, "pure2-hello.cpp2"))) - - def test(self): - self.run("cppfront -h") - assert os.path.isfile(os.path.join(self.build_folder, "pure2-hello.cpp")) diff --git a/recipes/cppfront/config.yml b/recipes/cppfront/config.yml index 5474e123fd52d..675f954f2770e 100644 --- a/recipes/cppfront/config.yml +++ b/recipes/cppfront/config.yml @@ -1,9 +1,3 @@ versions: - "cci.20231017": - folder: all - "cci.20230103": - folder: all - "cci.20221024": - folder: all - "cci.20220924": + "0.8.0": folder: all diff --git a/recipes/cppitertools/all/conandata.yml b/recipes/cppitertools/all/conandata.yml index 0337148504871..fd9fe319c4c76 100644 --- a/recipes/cppitertools/all/conandata.yml +++ b/recipes/cppitertools/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2": + url: "https://github.com/ryanhaining/cppitertools/archive/v2.2.tar.gz" + sha256: "d4e796c9d8ec769fbd68df92943d238d0c43667307995ede058069e770827481" "2.1": 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 d59270a8f393a..659bbfc9000e1 100644 --- a/recipes/cppitertools/all/conanfile.py +++ b/recipes/cppitertools/all/conanfile.py @@ -64,7 +64,10 @@ def source(self): def package(self): 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/**')) + if Version(self.version) < "2.2": + copy(self, "*.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "cppitertools"), excludes=('examples/**', 'test/**')) + else: + copy(self, "*.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include"), excludes=('examples/**', 'test/**')) def package_info(self): self.cpp_info.bindirs = [] diff --git a/recipes/cppitertools/config.yml b/recipes/cppitertools/config.yml index be27564df143f..e9b25cf4d1839 100644 --- a/recipes/cppitertools/config.yml +++ b/recipes/cppitertools/config.yml @@ -1,3 +1,5 @@ versions: + "2.2": + folder: "all" "2.1": folder: "all" diff --git a/recipes/cppkafka/all/conandata.yml b/recipes/cppkafka/all/conandata.yml index 741ef5502bb96..19152c1beae0c 100644 --- a/recipes/cppkafka/all/conandata.yml +++ b/recipes/cppkafka/all/conandata.yml @@ -1,9 +1,15 @@ sources: + "0.4.1": + url: "https://github.com/mfontanini/cppkafka/archive/refs/tags/v0.4.1.tar.gz" + sha256: "45770ae0404cb9ba73d659618c51cd55b574c66ed3c7b148360222fb524b0ff7" "0.4.0": url: "https://github.com/mfontanini/cppkafka/archive/refs/tags/0.4.0.tar.gz" sha256: "f4f05eb7a180a856663b02ec0b777283275ef88e5523f3013fd51c6c4ab63b5a" patches: + "0.4.1": + - patch_file: "patches/0.4.0-0001-no-template-export.patch" + - patch_file: "patches/0.4.1-0003-clean-rpath.patch" "0.4.0": - - patch_file: "patches/0001-no-template-export.patch" - - patch_file: "patches/0002-cppstd.patch" - - patch_file: "patches/0003-clean-rpath.patch" + - patch_file: "patches/0.4.0-0001-no-template-export.patch" + - patch_file: "patches/0.4.0-0002-cppstd.patch" + - patch_file: "patches/0.4.0-0003-clean-rpath.patch" diff --git a/recipes/cppkafka/all/conanfile.py b/recipes/cppkafka/all/conanfile.py index 41a226efdbb76..1f97490b74bf8 100644 --- a/recipes/cppkafka/all/conanfile.py +++ b/recipes/cppkafka/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" @@ -10,11 +11,10 @@ class CppKafkaConan(ConanFile): name = "cppkafka" description = "Modern C++ Apache Kafka client library (wrapper for librdkafka)" - topics = ("librdkafka", "kafka") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mfontanini/cppkafka" - license = "MIT" - + topics = ("librdkafka", "kafka") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -41,8 +41,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.81.0") - self.requires("librdkafka/2.0.2") + self.requires("boost/1.83.0", transitive_headers=True) + self.requires("librdkafka/2.3.0", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -57,7 +57,7 @@ def generate(self): tc.variables["CPPKAFKA_DISABLE_TESTS"] = True tc.variables["CPPKAFKA_DISABLE_EXAMPLES"] = True tc.variables["CPPKAFKA_RDKAFKA_STATIC_LIB"] = False # underlying logic is useless - if self.settings.os == "Windows": + if Version(self.version) < "0.4.1" and self.settings.os == "Windows": tc.preprocessor_definitions["NOMINMAX"] = 1 tc.generate() cd = CMakeDeps(self) diff --git a/recipes/cppkafka/all/patches/0001-no-template-export.patch b/recipes/cppkafka/all/patches/0.4.0-0001-no-template-export.patch similarity index 100% rename from recipes/cppkafka/all/patches/0001-no-template-export.patch rename to recipes/cppkafka/all/patches/0.4.0-0001-no-template-export.patch diff --git a/recipes/cppkafka/all/patches/0002-cppstd.patch b/recipes/cppkafka/all/patches/0.4.0-0002-cppstd.patch similarity index 100% rename from recipes/cppkafka/all/patches/0002-cppstd.patch rename to recipes/cppkafka/all/patches/0.4.0-0002-cppstd.patch diff --git a/recipes/cppkafka/all/patches/0003-clean-rpath.patch b/recipes/cppkafka/all/patches/0.4.0-0003-clean-rpath.patch similarity index 100% rename from recipes/cppkafka/all/patches/0003-clean-rpath.patch rename to recipes/cppkafka/all/patches/0.4.0-0003-clean-rpath.patch diff --git a/recipes/cppkafka/all/patches/0.4.1-0003-clean-rpath.patch b/recipes/cppkafka/all/patches/0.4.1-0003-clean-rpath.patch new file mode 100644 index 0000000000000..86c2d7f5ce27a --- /dev/null +++ b/recipes/cppkafka/all/patches/0.4.1-0003-clean-rpath.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6c667df..46c5590 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,7 +28,7 @@ if (NOT CMAKE_CXX_FLAGS) + add_definitions("-DNOGDI=1") + add_definitions("-DNOMINMAX=1") + else() +- set(CMAKE_CXX_FLAGS "-Wall") ++# set(CMAKE_CXX_FLAGS "-Wall") + endif() + endif() + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 214ccd4..d2667ce 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -46,8 +46,8 @@ set_target_properties(${TARGET_NAME} PROPERTIES + ARCHIVE_OUTPUT_NAME "${TARGET_NAME}" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}" + LIBRARY_OUTPUT_NAME "${TARGET_NAME}" +- INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}" +- INSTALL_RPATH_USE_LINK_PATH TRUE ++ # INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}" ++ # INSTALL_RPATH_USE_LINK_PATH TRUE + VERSION ${CPPKAFKA_VERSION} + SOVERSION ${CPPKAFKA_VERSION}) + # In CMake >= 3.15 Boost::boost == Boost::headers diff --git a/recipes/cppkafka/all/test_package/CMakeLists.txt b/recipes/cppkafka/all/test_package/CMakeLists.txt index cceda19c2c398..75a757663b0cd 100644 --- a/recipes/cppkafka/all/test_package/CMakeLists.txt +++ b/recipes/cppkafka/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(CppKafka REQUIRED CONFIG) diff --git a/recipes/cppkafka/all/test_v1_package/CMakeLists.txt b/recipes/cppkafka/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cppkafka/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cppkafka/all/test_v1_package/conanfile.py b/recipes/cppkafka/all/test_v1_package/conanfile.py deleted file mode 100644 index a500b98343c74..0000000000000 --- a/recipes/cppkafka/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/cppkafka/config.yml b/recipes/cppkafka/config.yml index da269653d6e6b..bf6438ecd493c 100644 --- a/recipes/cppkafka/config.yml +++ b/recipes/cppkafka/config.yml @@ -1,3 +1,5 @@ versions: + "0.4.1": + folder: "all" "0.4.0": folder: "all" diff --git a/recipes/cpprestsdk/all/conanfile.py b/recipes/cpprestsdk/all/conanfile.py index c75c41fcad7c4..65b0f34df4a95 100644 --- a/recipes/cpprestsdk/all/conanfile.py +++ b/recipes/cpprestsdk/all/conanfile.py @@ -4,9 +4,10 @@ apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir ) +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class CppRestSDKConan(ConanFile): @@ -83,6 +84,8 @@ def generate(self): tc.variables["CPPREST_HTTP_CLIENT_IMPL"] = self.options.http_client_impl if self.options.get_safe("http_listener_impl"): tc.variables["CPPREST_HTTP_LISTENER_IMPL"] = self.options.http_listener_impl + if Version(self.version) <= "2.10.15": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) deps.generate() @@ -112,7 +115,13 @@ def package_info(self): # cpprestsdk_boost_internal self.cpp_info.components["cpprestsdk_boost_internal"].set_property("cmake_target_name", "cpprestsdk::cpprestsdk_boost_internal") self.cpp_info.components["cpprestsdk_boost_internal"].includedirs = [] - self.cpp_info.components["cpprestsdk_boost_internal"].requires = ["boost::boost"] + ## List of Boost components cpprestsdk depends on: + ## see https://github.com/microsoft/cpprestsdk/blob/v2.10.19/Release/cmake/cpprest_find_boost.cmake#L77-L106 + self.cpp_info.components["cpprestsdk_boost_internal"].requires = ["boost::headers", "boost::system"] + if self.settings.os != "Windows": + self.cpp_info.components["cpprestsdk_boost_internal"].requires.extend(["boost::random", "boost::thread", "boost::filesystem", "boost::chrono", "boost::atomic"]) + if self.settings.os != "Android": + self.cpp_info.components["cpprestsdk_boost_internal"].requires.extend(["boost::date_time", "boost::regex"]) # cpprestsdk_openssl_internal self.cpp_info.components["cpprestsdk_openssl_internal"].set_property("cmake_target_name", "cpprestsdk::cpprestsdk_openssl_internal") self.cpp_info.components["cpprestsdk_openssl_internal"].includedirs = [] diff --git a/recipes/cpprestsdk/all/test_package/CMakeLists.txt b/recipes/cpprestsdk/all/test_package/CMakeLists.txt index c83f3ebd18fed..27fe068245ac4 100644 --- a/recipes/cpprestsdk/all/test_package/CMakeLists.txt +++ b/recipes/cpprestsdk/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(cpprestsdk REQUIRED CONFIG) diff --git a/recipes/cpprestsdk/all/test_v1_package/CMakeLists.txt b/recipes/cpprestsdk/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cpprestsdk/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpprestsdk/all/test_v1_package/conanfile.py b/recipes/cpprestsdk/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cpprestsdk/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_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/cppserver/all/conandata.yml b/recipes/cppserver/all/conandata.yml index c101e66da5ee2..9091f49b5f32f 100644 --- a/recipes/cppserver/all/conandata.yml +++ b/recipes/cppserver/all/conandata.yml @@ -2,12 +2,6 @@ sources: "1.0.2.0": url: "https://github.com/chronoxor/CppServer/archive/1.0.2.0.tar.gz" sha256: "512b2ada2ddebcedcfac814e3d0784ccef410506dab5dcf64c56302b40e042d4" - "1.0.1.0": - url: "https://github.com/chronoxor/CppServer/archive/1.0.1.0.tar.gz" - sha256: "eff49607a18821de6b992e6b0d9c3d48fa6726242546a1da08cbc2832f901ffc" - "1.0.0.0": - url: "https://github.com/chronoxor/CppServer/archive/1.0.0.0.tar.gz" - sha256: "dc70fb24231ac4c06e813a0489ff911dd5c48f844b75856b1e753ac8dbd64772" patches: "1.0.2.0": - patch_file: "patches/0001-cmake-clean-up-1-0-2-0.patch" @@ -19,23 +13,4 @@ patches: - patch_file: "patches/0003-remove-asio-defines-1-0-0-0.patch" patch_description: "remove asio defines" patch_type: "portability" - "1.0.1.0": - - patch_file: "patches/0001-cmake-clean-up-1-0-1-0.patch" - patch_description: "use cci packages, disable test/example builds" - patch_type: "conan" - - patch_file: "patches/0002-define-win32-winnt-1-0-1-0.patch" - patch_description: "add win32/winnt defines" - patch_type: "portability" - - patch_file: "patches/0003-remove-asio-defines-1-0-0-0.patch" - patch_description: "remove asio defines" - patch_type: "portability" - "1.0.0.0": - - patch_file: "patches/0001-cmake-clean-up-1-0-0-0.patch" - patch_description: "use cci packages, disable test/example builds" - patch_type: "conan" - - patch_file: "patches/0002-define-win32-winnt-1-0-0-0.patch" - patch_description: "add win32/winnt defines" - patch_type: "portability" - - patch_file: "patches/0003-remove-asio-defines-1-0-0-0.patch" - patch_description: "remove asio defines" - patch_type: "portability" + diff --git a/recipes/cppserver/all/conanfile.py b/recipes/cppserver/all/conanfile.py index 785bad0fb6e29..275c862bc2512 100644 --- a/recipes/cppserver/all/conanfile.py +++ b/recipes/cppserver/all/conanfile.py @@ -1,5 +1,4 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, collect_libs from conan.tools.build import check_min_cppstd from conan.tools.scm import Version @@ -28,20 +27,6 @@ class CppServer(ConanFile): "shared": False, } - @property - def _min_cppstd(self): - return 17 - - @property - def _compilers_minimum_version(self): - return { - "gcc": "9", - "Visual Studio": "15", - "msvc": "191", - "clang": "5", - "apple-clang": "10", - } - def export_sources(self): export_conandata_patches(self) @@ -57,18 +42,12 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("asio/1.27.0") - self.requires("openssl/[>=1.1 <4]") - self.requires("cppcommon/1.0.3.0") + self.requires("asio/1.27.0", transitive_headers=True) + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) + self.requires("cppcommon/1.0.3.0", 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 not minimum_version: - self.output.warn(f"{self.ref} requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration(f"{self.ref} requires a compiler that supports at least C++17") + check_min_cppstd(self, 17) def build_requirements(self): if Version(self.version) >= "1.0.2.0": diff --git a/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-0-0.patch b/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-0-0.patch deleted file mode 100644 index 757a8d7c15126..0000000000000 --- a/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-0-0.patch +++ /dev/null @@ -1,143 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5a21eed..399a8ed 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -18,50 +18,51 @@ 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 --if(CYGWIN) -- set(OPENSSL_ROOT_DIR "/usr/lib") -- set(OPENSSL_INCLUDE_DIR "/usr/include") -- set(OPENSSL_CRYPTO_LIBRARY "/usr/lib/libcrypto.dll.a") -- set(OPENSSL_SSL_LIBRARY "/usr/lib/libssl.dll.a") --elseif(MINGW) -- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/MinGW") -- set(OPENSSL_USE_STATIC_LIBS TRUE) --elseif(MSVC) -- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/VS") -- set(OPENSSL_USE_STATIC_LIBS TRUE) -- set(OPENSSL_MSVC_STATIC_RT TRUE) --endif() -+# if(CYGWIN) -+# set(OPENSSL_ROOT_DIR "/usr/lib") -+# set(OPENSSL_INCLUDE_DIR "/usr/include") -+# set(OPENSSL_CRYPTO_LIBRARY "/usr/lib/libcrypto.dll.a") -+# set(OPENSSL_SSL_LIBRARY "/usr/lib/libssl.dll.a") -+# elseif(MINGW) -+# set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/MinGW") -+# set(OPENSSL_USE_STATIC_LIBS TRUE) -+# elseif(MSVC) -+# set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/VS") -+# set(OPENSSL_USE_STATIC_LIBS TRUE) -+# set(OPENSSL_MSVC_STATIC_RT TRUE) -+# endif() - find_package(OpenSSL REQUIRED) --if(WIN32) -+if(FALSE) - find_package(Crypt) - find_package(WinSock) - endif() - - # Modules --add_subdirectory("modules") -+# add_subdirectory("modules") - - # Link libraries --list(APPEND LINKLIBS ${OPENSSL_LIBRARIES}) -+list(APPEND LINKLIBS OpenSSL::SSL) - if(WIN32) -- list(APPEND LINKLIBS ${CRYPT_LIBRARIES}) -- list(APPEND LINKLIBS ${WINSOCK_LIBRARIES}) -+ list(APPEND LINKLIBS crypt32) -+ list(APPEND LINKLIBS mswsock ws2_32) - endif() --list(APPEND LINKLIBS cppcommon) -+find_package(cppcommon REQUIRED) -+list(APPEND LINKLIBS cppcommon::cppcommon) - - # OpenSSL libraries - message(STATUS "OpenSSL version: ${OPENSSL_VERSION} ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}") - - # System directories --include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") -+# include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") - - # Library - file(GLOB_RECURSE LIB_HEADER_FILES "include/*.h") -@@ -70,14 +71,16 @@ file(GLOB_RECURSE LIB_SOURCE_FILES "source/*.cpp") - add_library(cppserver ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) - set_target_properties(cppserver PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") - target_include_directories(cppserver PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") --target_link_libraries(cppserver ${LINKLIBS} asio) -+find_package(asio REQUIRED) -+target_link_libraries(cppserver ${LINKLIBS} asio::asio) -+target_compile_features(cppserver PUBLIC cxx_std_17) - list(APPEND INSTALL_TARGETS cppserver) - list(APPEND LINKLIBS cppserver) - - # Additional module components: benchmarks, examples, plugins, tests, tools and install - if(NOT CPPSERVER_MODULE) - -- # Examples -+if(FALSE) - 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") -@@ -90,8 +93,8 @@ if(NOT CPPSERVER_MODULE) - list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) - list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) - endforeach() -- -- # Benchmarks -+endif() -+if(FALSE) - 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") -@@ -104,8 +107,8 @@ if(NOT CPPSERVER_MODULE) - list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) - list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) - endforeach() -- -- # Tests -+endif() -+if(FALSE) - file(GLOB TESTS_HEADER_FILES "tests/*.h") - file(GLOB TESTS_INLINE_FILES "tests/*.inl") - file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") -@@ -119,15 +122,15 @@ if(NOT CPPSERVER_MODULE) - # CTest - enable_testing() - add_test(cppserver-tests cppserver-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/cppserver/all/patches/0001-cmake-clean-up-1-0-1-0.patch b/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-1-0.patch deleted file mode 100644 index b15e8478995a1..0000000000000 --- a/recipes/cppserver/all/patches/0001-cmake-clean-up-1-0-1-0.patch +++ /dev/null @@ -1,130 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 95e9c9e..8616cb6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -17,52 +17,21 @@ if(DOXYGEN_FOUND) - endif() - endif() - --# CMake module path --set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -- --# Compiler features --include(SetCompilerFeatures) --include(SetCompilerWarnings) --include(SetPlatformFeatures) --include(SystemInformation) -- - # External packages --if(CYGWIN) -- set(OPENSSL_ROOT_DIR "/usr/lib") -- set(OPENSSL_INCLUDE_DIR "/usr/include") -- set(OPENSSL_CRYPTO_LIBRARY "/usr/lib/libcrypto.dll.a") -- set(OPENSSL_SSL_LIBRARY "/usr/lib/libssl.dll.a") --elseif(MINGW) -- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/MinGW") -- set(OPENSSL_USE_STATIC_LIBS TRUE) --elseif(MSVC) -- set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenSSL/VS") -- set(OPENSSL_USE_STATIC_LIBS TRUE) -- set(OPENSSL_MSVC_STATIC_RT TRUE) --endif() - find_package(OpenSSL REQUIRED) --if(WIN32) -- find_package(Crypt) -- find_package(WinSock) --endif() -- --# Modules --add_subdirectory("modules") - - # Link libraries --list(APPEND LINKLIBS ${OPENSSL_LIBRARIES}) -+list(APPEND LINKLIBS OpenSSL::SSL) - if(WIN32) -- list(APPEND LINKLIBS ${CRYPT_LIBRARIES}) -- list(APPEND LINKLIBS ${WINSOCK_LIBRARIES}) -+ list(APPEND LINKLIBS crypt32) -+ list(APPEND LINKLIBS mswsock ws2_32) - endif() --list(APPEND LINKLIBS cppcommon) -+find_package(cppcommon REQUIRED) -+list(APPEND LINKLIBS cppcommon::cppcommon) - - # OpenSSL libraries - message(STATUS "OpenSSL version: ${OPENSSL_VERSION} ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}") - --# System directories --include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/modules") -- - # Library - file(GLOB_RECURSE LIB_HEADER_FILES "include/*.h" "source/*.h") - file(GLOB_RECURSE LIB_INLINE_FILES "include/*.inl" "source/*.inl") -@@ -70,7 +39,9 @@ file(GLOB_RECURSE LIB_SOURCE_FILES "include/*.cpp" "source/*.cpp") - add_library(cppserver ${LIB_HEADER_FILES} ${LIB_INLINE_FILES} ${LIB_SOURCE_FILES}) - set_target_properties(cppserver PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}" FOLDER "libraries") - target_include_directories(cppserver PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") --target_link_libraries(cppserver ${LINKLIBS} asio) -+find_package(asio REQUIRED) -+target_link_libraries(cppserver ${LINKLIBS} asio::asio) -+target_compile_features(cppserver PUBLIC cxx_std_17) - list(APPEND INSTALL_TARGETS cppserver) - list(APPEND LINKLIBS cppserver) - -@@ -78,6 +49,7 @@ list(APPEND LINKLIBS cppserver) - if(NOT CPPSERVER_MODULE) - - # Examples -+ if(FALSE) - 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") -@@ -90,8 +62,10 @@ if(NOT CPPSERVER_MODULE) - list(APPEND INSTALL_TARGETS ${EXAMPLE_TARGET}) - list(APPEND INSTALL_TARGETS_PDB ${EXAMPLE_TARGET}) - endforeach() -+ endif() - - # Benchmarks -+ if(FALSE) - 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") -@@ -104,8 +78,10 @@ if(NOT CPPSERVER_MODULE) - list(APPEND INSTALL_TARGETS ${BENCHMARK_TARGET}) - list(APPEND INSTALL_TARGETS_PDB ${BENCHMARK_TARGET}) - endforeach() -+ endif() - - # Tests -+ if(FALSE) - file(GLOB TESTS_HEADER_FILES "tests/*.h") - file(GLOB TESTS_INLINE_FILES "tests/*.inl") - file(GLOB TESTS_SOURCE_FILES "tests/*.cpp") -@@ -115,19 +91,22 @@ if(NOT CPPSERVER_MODULE) - target_link_libraries(cppserver-tests ${LINKLIBS}) - list(APPEND INSTALL_TARGETS cppserver-tests) - list(APPEND INSTALL_TARGETS_PDB cppserver-tests) -+ endif() - - # CTest -+ if(FALSE) - enable_testing() - add_test(cppserver-tests cppserver-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/cppserver/all/patches/0002-define-win32-winnt-1-0-0-0.patch b/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-0-0.patch deleted file mode 100644 index cdbb5c5ddcac9..0000000000000 --- a/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-0-0.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 399a8ed..d4590f4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -77,6 +77,10 @@ target_compile_features(cppserver PUBLIC cxx_std_17) - list(APPEND INSTALL_TARGETS cppserver) - list(APPEND LINKLIBS cppserver) - -+if(WIN32 AND NOT MSVC) -+ target_compile_definitions(cppserver PUBLIC -D_WIN32_WINNT=_WIN32_WINNT_VISTA) -+endif() -+ - # Additional module components: benchmarks, examples, plugins, tests, tools and install - if(NOT CPPSERVER_MODULE) - diff --git a/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-1-0.patch b/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-1-0.patch deleted file mode 100644 index 0365fe4134964..0000000000000 --- a/recipes/cppserver/all/patches/0002-define-win32-winnt-1-0-1-0.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8616cb6..7d26a40 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -45,6 +45,10 @@ target_compile_features(cppserver PUBLIC cxx_std_17) - list(APPEND INSTALL_TARGETS cppserver) - list(APPEND LINKLIBS cppserver) - -+if(WIN32 AND NOT MSVC) -+ target_compile_definitions(cppserver PUBLIC -D_WIN32_WINNT=_WIN32_WINNT_VISTA) -+endif() -+ - # Additional module components: benchmarks, examples, plugins, tests, tools and install - if(NOT CPPSERVER_MODULE) - diff --git a/recipes/cppserver/all/test_package/CMakeLists.txt b/recipes/cppserver/all/test_package/CMakeLists.txt index 6a18a7561cd17..4852cb9f7bb9b 100644 --- a/recipes/cppserver/all/test_package/CMakeLists.txt +++ b/recipes/cppserver/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(cppserver REQUIRED CONFIG) diff --git a/recipes/cppserver/all/test_v1_package/CMakeLists.txt b/recipes/cppserver/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/cppserver/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cppserver/all/test_v1_package/conanfile.py b/recipes/cppserver/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/cppserver/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/cppserver/config.yml b/recipes/cppserver/config.yml index bb5222f546170..0e31cf1dfe1b0 100644 --- a/recipes/cppserver/config.yml +++ b/recipes/cppserver/config.yml @@ -1,7 +1,3 @@ versions: "1.0.2.0": folder: all - "1.0.1.0": - folder: all - "1.0.0.0": - folder: all diff --git a/recipes/cpptoml/all/test_package/CMakeLists.txt b/recipes/cpptoml/all/test_package/CMakeLists.txt index f67d21d53d2fc..074e8081a714f 100644 --- a/recipes/cpptoml/all/test_package/CMakeLists.txt +++ b/recipes/cpptoml/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(cpptoml CONFIG REQUIRED) diff --git a/recipes/cpptoml/all/test_v1_package/CMakeLists.txt b/recipes/cpptoml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cpptoml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpptoml/all/test_v1_package/conanfile.py b/recipes/cpptoml/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cpptoml/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_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/cpptrace/all/conandata.yml b/recipes/cpptrace/all/conandata.yml index d032d0a5a873d..b4d1d1d5cce15 100644 --- a/recipes/cpptrace/all/conandata.yml +++ b/recipes/cpptrace/all/conandata.yml @@ -1,23 +1,50 @@ sources: - # Newer versions at the top + "0.8.3": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.8.3.tar.gz" + sha256: "34f186741a84716edc1b64b372aa1a5b9ec2629d38ab97e5c2a5284b58a8dee8" + "0.8.2": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.8.2.tar.gz" + sha256: "618fb746174f76eb03c7ece059ebdcfe39b7b6adca6a5da0c9f9bc6a4764d7f9" + "0.7.5": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.7.5.tar.gz" + sha256: "7df0cae3d7da9be2dc82616292cc86a4a08a8209898716231aef80477a8ca35d" + "0.7.4": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.7.4.tar.gz" + sha256: "1241790cace5d59ddf21ce5d046f71cd26448a3c8c15d123157498ba81e3543d" + "0.7.3": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.7.3.tar.gz" + sha256: "8b83200860db148a7fd0b2594e7affc6a55809da256e132d6f0d5b202b2e26dd" + "0.7.2": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.7.2.tar.gz" + sha256: "62835abfd91a840e4d212c850695b576523fe6f9036bc5c3e52183b6eb9905c5" + "0.7.1": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.7.1.tar.gz" + sha256: "63df54339feb0c68542232229777df057e1848fc8294528613971bbf42889e83" + "0.7.0": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.7.0.tar.gz" + sha256: "b5c1fbd162f32b8995d9b1fefb1b57fac8b1a0e790f897b81cdafe3625d12001" + "0.6.3": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.6.3.tar.gz" + sha256: "665bf76645ec7b9e6d785a934616f0138862c36cdb58b0d1c9dd18dd4c57395a" + "0.6.2": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.6.2.tar.gz" + sha256: "02a0540b5b1be0788565f48b065b456d3eab81ae2323a50e75ed36449a0143ed" + "0.6.1": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.6.1.tar.gz" + sha256: "4bb478eedbe4b2c0093ef7af4f64795304850e03312e658076b25ef8d6019c75" + # 0.6.0 is required by libassert v2 + "0.6.0": + url: "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.6.0.tar.gz" + sha256: "7c2996f03d15f61016bc81fe7fa5220b1cc42498333c5c0e699ad2f96b918b96" + # 0.3.1 is required by libassert v1 "0.3.1": - url: - - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.3.1.tar.gz" + 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 is required by libassert v1 "0.2.1": - url: - - "https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v0.2.1.tar.gz" + 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" diff --git a/recipes/cpptrace/all/conanfile.py b/recipes/cpptrace/all/conanfile.py index f96b276006f6d..0752a706273f0 100644 --- a/recipes/cpptrace/all/conanfile.py +++ b/recipes/cpptrace/all/conanfile.py @@ -1,6 +1,6 @@ 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.files import get, copy, rmdir, replace_in_file 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 @@ -21,10 +21,12 @@ class CpptraceConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "unwind": ["default", "libunwind"], } default_options = { "shared": False, "fPIC": True, + "unwind": "default", } @property @@ -43,7 +45,12 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libdwarf/0.8.0") + if Version(self.version) >= "0.4.0": + self.requires("libdwarf/0.11.1") + else: + self.requires("libdwarf/0.8.0") + if self.options.unwind == "libunwind": + self.requires("libunwind/1.8.0", transitive_libs=True) def validate(self): if self.settings.compiler.cppstd: @@ -52,6 +59,13 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._patch_sources() + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) >= "0.7.5": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "Autoconfig.cmake"), + "set(CMAKE_CXX_STANDARD 11)", "") def export_sources(self): export_conandata_patches(self) @@ -60,19 +74,21 @@ 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"): + if Version(self.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 + if self.options.unwind == "libunwind": + tc.variables["CPPTRACE_UNWIND_WITH_LIBUNWIND"] = True + tc.cache_variables["CPPTRACE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) tc.generate() tc = CMakeDeps(self) tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -85,12 +101,7 @@ def package(self): 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"] @@ -105,6 +116,9 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.system_libs.append("dbghelp") + if not self.options.shared: + self.cpp_info.defines.append("CPPTRACE_STATIC_DEFINE") + # 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" 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 deleted file mode 100644 index d75b21cd35c7f..0000000000000 --- a/recipes/cpptrace/all/patches/0.3.0/0001-cpptrace_export.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 index 413751877cee8..8f30d3137fd43 100644 --- a/recipes/cpptrace/all/test_package/CMakeLists.txt +++ b/recipes/cpptrace/all/test_package/CMakeLists.txt @@ -1,10 +1,12 @@ cmake_minimum_required(VERSION 3.15) - -project(test_package CXX) +project(test_package LANGUAGES 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) + +if(${cpptrace_VERSION} VERSION_GREATER_EQUAL "0.4.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE CTRACE) +endif() diff --git a/recipes/cpptrace/all/test_package/conanfile.py b/recipes/cpptrace/all/test_package/conanfile.py index 1e7a9ff877d53..f5cf204295e19 100644 --- a/recipes/cpptrace/all/test_package/conanfile.py +++ b/recipes/cpptrace/all/test_package/conanfile.py @@ -3,7 +3,6 @@ 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" diff --git a/recipes/cpptrace/all/test_package/test_package.cpp b/recipes/cpptrace/all/test_package/test_package.cpp index bc640e59ffc24..9e8a6c33d9933 100644 --- a/recipes/cpptrace/all/test_package/test_package.cpp +++ b/recipes/cpptrace/all/test_package/test_package.cpp @@ -1,9 +1,17 @@ #include #include +#include #include +#ifdef CTRACE +#include +#endif int main() { cpptrace::generate_trace().print(); + +#ifdef CTRACE + ctrace_stacktrace c_trace = ctrace_generate_trace(0, SIZE_MAX); +#endif return EXIT_SUCCESS; } diff --git a/recipes/cpptrace/config.yml b/recipes/cpptrace/config.yml index c4a25b816da1e..345d04a1daa14 100644 --- a/recipes/cpptrace/config.yml +++ b/recipes/cpptrace/config.yml @@ -1,8 +1,29 @@ versions: - # Newer versions at the top - "0.3.1": + "0.8.3": + folder: all + "0.8.2": + folder: all + "0.7.5": + folder: all + "0.7.4": + folder: all + "0.7.3": + folder: all + "0.7.2": + folder: all + "0.7.1": folder: all - "0.3.0": + "0.7.0": + folder: all + "0.6.3": + folder: all + "0.6.2": + folder: all + "0.6.1": + folder: all + "0.6.0": + folder: all + "0.3.1": folder: all "0.2.1": folder: all diff --git a/recipes/cppunit/all/test_package/CMakeLists.txt b/recipes/cppunit/all/test_package/CMakeLists.txt index e62b0d941a7cc..e8a7dba005c26 100644 --- a/recipes/cppunit/all/test_package/CMakeLists.txt +++ b/recipes/cppunit/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(cppunit REQUIRED CONFIG) diff --git a/recipes/cppunit/all/test_v1_package/CMakeLists.txt b/recipes/cppunit/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cppunit/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cppunit/all/test_v1_package/conanfile.py b/recipes/cppunit/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cppunit/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_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/cpputest/all/conanfile.py b/recipes/cpputest/all/conanfile.py index ee586cab99d82..45815e21994e0 100644 --- a/recipes/cpputest/all/conanfile.py +++ b/recipes/cpputest/all/conanfile.py @@ -1,10 +1,10 @@ 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 +from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class CppUTestConan(ConanFile): @@ -56,6 +56,8 @@ def generate(self): tc.variables["LONGLONG"] = True tc.variables["COVERAGE"] = False tc.variables["TESTS"] = False + if Version(self.version) <= "4.0": # Master branch already support CMake 4 (not yet released) + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -71,30 +73,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "CppUTest")) - # 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), - { - "CppUTest": "CppUTest::CppUTest", - "CppUTestExt": "CppUTest::CppUTestExt", - } - ) - - 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", "CppUTest") self.cpp_info.set_property("pkg_config_name", "cpputest") @@ -110,17 +88,3 @@ def package_info(self): self.cpp_info.components["CppUTestExt"].set_property("cmake_target_name", "CppUTestExt") self.cpp_info.components["CppUTestExt"].libs = ["CppUTestExt"] self.cpp_info.components["CppUTestExt"].requires = ["CppUTest"] - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "CppUTest" - self.cpp_info.names["cmake_find_package_multi"] = "CppUTest" - self.cpp_info.names["pkg_config"] = "cpputest" - self.cpp_info.components["CppUTest"].names["cmake_find_package"] = "CppUTest" - self.cpp_info.components["CppUTest"].names["cmake_find_package_multi"] = "CppUTest" - self.cpp_info.components["CppUTest"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["CppUTest"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - if self.options.with_extensions: - self.cpp_info.components["CppUTestExt"].names["cmake_find_package"] = "CppUTestExt" - self.cpp_info.components["CppUTestExt"].names["cmake_find_package_multi"] = "CppUTestExt" - self.cpp_info.components["CppUTestExt"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["CppUTestExt"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/cpputest/all/test_package/CMakeLists.txt b/recipes/cpputest/all/test_package/CMakeLists.txt index d28cda840f45c..ade5d98987124 100644 --- a/recipes/cpputest/all/test_package/CMakeLists.txt +++ b/recipes/cpputest/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(CppUTest REQUIRED CONFIG) diff --git a/recipes/cpputest/all/test_v1_package/CMakeLists.txt b/recipes/cpputest/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cpputest/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpputest/all/test_v1_package/conanfile.py b/recipes/cpputest/all/test_v1_package/conanfile.py deleted file mode 100644 index 32e223569cdb0..0000000000000 --- a/recipes/cpputest/all/test_v1_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.definitions["WITH_EXTENSIONS"] = self.options["cpputest"].with_extensions - 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/cppzmq/all/test_package/CMakeLists.txt b/recipes/cppzmq/all/test_package/CMakeLists.txt index 207bcc2f27a5a..27da2505b655c 100644 --- a/recipes/cppzmq/all/test_package/CMakeLists.txt +++ b/recipes/cppzmq/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(cppzmq REQUIRED CONFIG) diff --git a/recipes/cppzmq/all/test_v1_package/CMakeLists.txt b/recipes/cppzmq/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/cppzmq/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cppzmq/all/test_v1_package/conanfile.py b/recipes/cppzmq/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cppzmq/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_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/cpr/all/conandata.yml b/recipes/cpr/all/conandata.yml index 02059bab669a9..80f5b817364f3 100644 --- a/recipes/cpr/all/conandata.yml +++ b/recipes/cpr/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.11.2": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.11.2.tar.gz" + sha256: "3795a3581109a9ba5e48fbb50f9efe3399a3ede22f2ab606b71059a615cd6084" + "1.11.1": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.11.1.tar.gz" + sha256: "e84b8ef348f41072609f53aab05bdaab24bf5916c62d99651dfbeaf282a8e0a2" + "1.11.0": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.11.0.tar.gz" + sha256: "fdafa3e3a87448b5ddbd9c7a16e7276a78f28bbe84a3fc6edcfef85eca977784" "1.10.5": url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.5.tar.gz" sha256: "c8590568996cea918d7cf7ec6845d954b9b95ab2c4980b365f582a665dea08d8" @@ -15,6 +24,20 @@ sources: url: "https://github.com/libcpr/cpr/archive/refs/tags/1.7.2.tar.gz" sha256: "aa38a414fe2ffc49af13a08b6ab34df825fdd2e7a1213d032d835a779e14176f" patches: + "1.11.2": + - patch_file: "patches/008-1.11.2-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" + - patch_file: "patches/009-1.11.2-windows-msvc-runtime.patch" + patch_description: "dont hardcode value of CMAKE_MSVC_RUNTIME_LIBRARY and use from conan toolchain instead" + "1.11.1": + - patch_file: "patches/008-1.11.0-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" + "1.11.0": + - patch_file: "patches/008-1.11.0-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" "1.10.5": - patch_file: "patches/008-1.10.0-remove-warning-flags.patch" patch_description: "disable warning flags and warning as error" diff --git a/recipes/cpr/all/conanfile.py b/recipes/cpr/all/conanfile.py index b2e254935a1fd..a7893dee17926 100644 --- a/recipes/cpr/all/conanfile.py +++ b/recipes/cpr/all/conanfile.py @@ -12,9 +12,6 @@ class CprConan(ConanFile): - _AUTO_SSL = "auto" - _NO_SSL = "off" - name = "cpr" description = "C++ Requests: Curl for People, a spiritual port of Python Requests" license = "MIT" @@ -27,14 +24,14 @@ class CprConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "with_ssl": ["openssl", "darwinssl", "winssl", _AUTO_SSL, _NO_SSL], + "with_ssl": [False, "openssl", "darwinssl", "winssl"], "signal": [True, False], "verbose_logging": [True, False], } default_options = { "shared": False, "fPIC": True, - "with_ssl": _AUTO_SSL, + "with_ssl": "openssl", "signal": True, "verbose_logging": False, } @@ -47,7 +44,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): return { "17": { - "gcc": "9", + "gcc": "7", "clang": "7", "apple-clang": "10", "Visual Studio": "15", @@ -70,6 +67,10 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + self.options.with_ssl = "winssl" + + if is_apple_os(self): + self.options.with_ssl = "darwinssl" if Version(self.version) < "1.10.0": del self.options.verbose_logging @@ -83,10 +84,7 @@ def layout(self): def requirements(self): 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]: + if self.options.with_ssl == "openssl": self.requires("openssl/[>=1.1 <4]") def validate(self): @@ -101,24 +99,15 @@ def validate(self): 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 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( - f"{self.ref}:with_ssl={self.options.with_ssl} requires libcurl:with_ssl={self.options.with_ssl}" - ) + if self.options.with_ssl: + ssl_library = str(self.options.with_ssl) - if ssl_library == "winssl" and self.dependencies["libcurl"].options.with_ssl != "schannel": - raise ConanInvalidConfiguration( - f"{self.ref}:with_ssl=winssl requires libcurl:with_ssl=schannel" - ) + if ssl_library == "openssl" and is_apple_os(self): + raise ConanInvalidConfiguration("OpenSSL is not supported on macOS. Use DarwinSSL instead.") + 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 self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") @@ -143,9 +132,7 @@ def generate(self): 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 self.options.with_ssl == CprConan._NO_SSL: - tc.variables["CPR_ENABLE_SSL"] = False + tc.variables["CPR_ENABLE_SSL"] = bool(self.options.with_ssl) if self.options.get_safe("verbose_logging", False): tc.variables["CURL_VERBOSE_LOGGING"] = True @@ -180,3 +167,8 @@ def package_info(self): self.cpp_info.libs = ["cpr"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") + + if Version(self.version) >= "1.11.0" and \ + ((self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9") or \ + (self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") in ["libstdc++", "libstdc++11"])): + self.cpp_info.system_libs = ["stdc++fs"] diff --git a/recipes/cpr/all/patches/008-1.11.0-remove-warning-flags.patch b/recipes/cpr/all/patches/008-1.11.0-remove-warning-flags.patch new file mode 100644 index 0000000000000..4a2124c047e5a --- /dev/null +++ b/recipes/cpr/all/patches/008-1.11.0-remove-warning-flags.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 70d3296..eb020b4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -379,14 +379,14 @@ if(CPR_BUILD_TESTS) + restore_variable(DESTINATION CMAKE_CXX_CLANG_TIDY BACKUP CMAKE_CXX_CLANG_TIDY_BKP) + endif() + +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +-else() +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") +- if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +- # Disable C++98 compatibility support in clang: https://github.com/libcpr/cpr/issues/927 +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-nonportable-system-include-path -Wno-exit-time-destructors -Wno-undef -Wno-global-constructors -Wno-switch-enum -Wno-old-style-cast -Wno-covered-switch-default -Wno-undefined-func-template") +- endif() +-endif() ++# if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") ++# else() ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") ++# if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++# # Disable C++98 compatibility support in clang: https://github.com/libcpr/cpr/issues/927 ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-nonportable-system-include-path -Wno-exit-time-destructors -Wno-undef -Wno-global-constructors -Wno-switch-enum -Wno-old-style-cast -Wno-covered-switch-default -Wno-undefined-func-template") ++# endif() ++# endif() + + add_subdirectory(cpr) + add_subdirectory(include) diff --git a/recipes/cpr/all/patches/008-1.11.2-remove-warning-flags.patch b/recipes/cpr/all/patches/008-1.11.2-remove-warning-flags.patch new file mode 100644 index 0000000000000..3766c6ff11ab1 --- /dev/null +++ b/recipes/cpr/all/patches/008-1.11.2-remove-warning-flags.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3f6e1d0..6e1e8ff 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -390,14 +390,14 @@ if(CPR_BUILD_TESTS) + restore_variable(DESTINATION CMAKE_CXX_CLANG_TIDY BACKUP CMAKE_CXX_CLANG_TIDY_BKP) + endif() + +-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +-else() +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") +- if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +- # Disable C++98 compatibility support in clang: https://github.com/libcpr/cpr/issues/927 +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-nonportable-system-include-path -Wno-exit-time-destructors -Wno-undef -Wno-global-constructors -Wno-switch-enum -Wno-old-style-cast -Wno-covered-switch-default -Wno-undefined-func-template") +- endif() +-endif() ++#if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") ++#else() ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror") ++# if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++# # Disable C++98 compatibility support in clang: https://github.com/libcpr/cpr/issues/927 ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-nonportable-system-include-path -Wno-exit-time-destructors -Wno-undef -Wno-global-constructors -Wno-switch-enum -Wno-old-style-cast -Wno-covered-switch-default -Wno-undefined-func-template") ++# endif() ++#endif() + + add_subdirectory(cpr) + add_subdirectory(include) diff --git a/recipes/cpr/all/patches/009-1.11.2-windows-msvc-runtime.patch b/recipes/cpr/all/patches/009-1.11.2-windows-msvc-runtime.patch new file mode 100644 index 0000000000000..2d95a89a9a861 --- /dev/null +++ b/recipes/cpr/all/patches/009-1.11.2-windows-msvc-runtime.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3f6e1d0..ba830cb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -77,7 +77,7 @@ cpr_option(CPR_DEBUG_SANITIZER_FLAG_UB "Enables the UndefinedBehaviorSanitizer f + cpr_option(CPR_DEBUG_SANITIZER_FLAG_ALL "Enables all sanitizers for debug builds except the ThreadSanitizer since it is incompatible with the other sanitizers." OFF) + message(STATUS "=======================================================") + +-if (MSVC) ++if (0) + if (BUILD_SHARED_LIBS) + message(STATUS "Build windows dynamic libs.") + else() diff --git a/recipes/cpr/all/test_v1_package/CMakeLists.txt b/recipes/cpr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cpr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpr/all/test_v1_package/conanfile.py b/recipes/cpr/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cpr/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_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/cpr/config.yml b/recipes/cpr/config.yml index 48b580f3173d9..e9e5c2c955c00 100644 --- a/recipes/cpr/config.yml +++ b/recipes/cpr/config.yml @@ -1,4 +1,10 @@ versions: + "1.11.2": + folder: all + "1.11.1": + folder: all + "1.11.0": + folder: all "1.10.5": folder: all "1.10.4": diff --git a/recipes/cprocessing/all/test_v1_package/CMakeLists.txt b/recipes/cprocessing/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/cprocessing/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cprocessing/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_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/test_package/CMakeLists.txt b/recipes/cpu_features/all/test_package/CMakeLists.txt index 34c33e1cc8a13..f7b9b09a7d4f6 100644 --- a/recipes/cpu_features/all/test_package/CMakeLists.txt +++ b/recipes/cpu_features/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(CpuFeatures REQUIRED CONFIG) diff --git a/recipes/cpu_features/all/test_v1_package/CMakeLists.txt b/recipes/cpu_features/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cpu_features/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpu_features/all/test_v1_package/conanfile.py b/recipes/cpu_features/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/cpu_features/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_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/cpuinfo/all/conandata.yml b/recipes/cpuinfo/all/conandata.yml index 56ce9c275f3d9..5d3ebdc36307e 100644 --- a/recipes/cpuinfo/all/conandata.yml +++ b/recipes/cpuinfo/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/cpuinfo/all/conanfile.py b/recipes/cpuinfo/all/conanfile.py index 24edf5382c77c..58abd3608a84f 100644 --- a/recipes/cpuinfo/all/conanfile.py +++ b/recipes/cpuinfo/all/conanfile.py @@ -108,3 +108,6 @@ def package_info(self): self.cpp_info.components["cpuinfo"].requires = ["clog"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["cpuinfo"].system_libs.append("pthread") + + if self.settings.os == "Android": + self.cpp_info.components["cpuinfo"].system_libs.append("log") diff --git a/recipes/cpuinfo/all/test_package/CMakeLists.txt b/recipes/cpuinfo/all/test_package/CMakeLists.txt index 96ba94c8edef5..fff96bbe2bba9 100644 --- a/recipes/cpuinfo/all/test_package/CMakeLists.txt +++ b/recipes/cpuinfo/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 C) find_package(cpuinfo REQUIRED CONFIG) diff --git a/recipes/cpuinfo/all/test_v1_package/CMakeLists.txt b/recipes/cpuinfo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/cpuinfo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/cpuinfo/all/test_v1_package/conanfile.py b/recipes/cpuinfo/all/test_v1_package/conanfile.py deleted file mode 100644 index ea57bb8b3a514..0000000000000 --- a/recipes/cpuinfo/all/test_v1_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.definitions["CPUINFO_VERSION"] = self.deps_cpp_info["cpuinfo"].version.split('.')[1] - 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/cpuinfo/config.yml b/recipes/cpuinfo/config.yml index 8e98d8506c888..a71ccd412f08d 100644 --- a/recipes/cpuinfo/config.yml +++ b/recipes/cpuinfo/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20231129": + folder: all "cci.20230118": folder: all "cci.20220618": diff --git a/recipes/cpython/all/conandata.yml b/recipes/cpython/all/conandata.yml index f9fd51067c8b3..3959aff0dc825 100644 --- a/recipes/cpython/all/conandata.yml +++ b/recipes/cpython/all/conandata.yml @@ -1,72 +1,95 @@ sources: - "3.10.0": - url: "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz" - sha256: "c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758" - "3.9.7": - url: "https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz" - sha256: "a838d3f9360d157040142b715db34f0218e535333696a5569dc6f854604eb9d1" - "3.8.12": - url: "https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz" - sha256: "316aa33f3b7707d041e73f246efedb297a70898c4b91f127f66dc8d80c596f1a" - "3.7.12": - url: "https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz" - sha256: "33b4daaf831be19219659466d12645f87ecec6eb21d4d9f9711018a7b66cce46" - "2.7.18": - url: "https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz" - sha256: "da3080e3b488f648a3d7a4560ddee895284c3380b11d6de75edb986526b9a814" + "3.12.7": + url: "https://www.python.org/ftp/python/3.12.7/Python-3.12.7.tgz" + sha256: "73ac8fe780227bf371add8373c3079f42a0dc62deff8d612cd15a618082ab623" + "3.12.2": + url: "https://www.python.org/ftp/python/3.12.2/Python-3.12.2.tgz" + sha256: "a7c4f6a9dc423d8c328003254ab0c9338b83037bd787d680826a5bf84308116e" + "3.11.9": + url: "https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz" + sha256: "e7de3240a8bc2b1e1ba5c81bf943f06861ff494b69fda990ce2722a504c6153d" + "3.10.14": + url: "https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz" + sha256: "cefea32d3be89c02436711c95a45c7f8e880105514b78680c14fe76f5709a0f6" + "3.9.19": + url: "https://www.python.org/ftp/python/3.9.19/Python-3.9.19.tgz" + sha256: "f5f9ec8088abca9e399c3b62fd8ef31dbd2e1472c0ccb35070d4d136821aaf71" + "3.8.19": + url: "https://www.python.org/ftp/python/3.8.19/Python-3.8.19.tgz" + sha256: "c7fa55a36e5c7a19ec37d8f90f60a2197548908c9ac8b31e7c0dbffdd470eeac" patches: - "3.10.0": - - patch_file: "patches/3.10.0-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0002-_msi-vcxproj.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.10.0-0003-_ctypes-ffi.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.10.0-0005-disable-macos-tcltk.patch" - base_path: "source_subfolder" + "3.12.7": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.12/3.12.1-0001-_ctypes-ffi.patch" + patch_description: "Support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "3.9.7": - - patch_file: "patches/3.9.7-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0002-_msi-vcxproj.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0003-_ctypes-ffi.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.9.7-0005-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.12/3.12.1-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.12.2": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.12/3.12.1-0001-_ctypes-ffi.patch" + patch_description: "Support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "3.8.12": - - patch_file: "patches/3.8.12-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.8.12-0002-_ctypes-ffi.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.8.12-0004-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.12/3.12.1-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.11.9": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.11/3.11.7-0001-_ctypes-ffi.patch" + patch_description: "Support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "3.7.12": - - patch_file: "patches/3.7.9-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch" - base_path: "source_subfolder" - - patch_file: "patches/3.7.9-0003-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.10.14": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.10/3.10.0-0003-_ctypes-ffi.patch" + patch_description: "Remove duplicate libffi symbols and support shared libffi" + patch_type: "portability" - patch_file: "patches/3.x-0001-relocatable-python-config.patch" - base_path: "source_subfolder" - "2.7.18": - - patch_file: "patches/2.7.18-0001-msvc.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.7.18-0002-add-support-msvc-14.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.7.18-0003-msvc-fix-static.patch" - base_path: "source_subfolder" - - patch_file: "patches/2.7.18-0004-disable-macos-tcltk.patch" - base_path: "source_subfolder" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.9.19": + - patch_file: "patches/3.9/3.9.7-0002-_msi-vcxproj.patch" + patch_description: "Fix ARM/ARM64 mismatch in project file" + patch_type: "bugfix" + - patch_file: "patches/3.9/3.9.7-0003-_ctypes-ffi.patch" + patch_description: "Remove duplicate libffi symbols and support shared libffi" + patch_type: "portability" + - patch_file: "patches/3.x-0001-relocatable-python-config.patch" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" + "3.8.19": + - patch_file: "patches/3.8/3.8.12-0002-_ctypes-ffi.patch" + patch_description: "Remove duplicate libffi symbols and support shared libffi" + patch_type: "portability" + - patch_file: "patches/3.x-0001-relocatable-python-config.patch" + patch_description: "Allow package to be relocatable" + patch_type: "conan" + - patch_file: "patches/3.x-0002-remove-module-deps.patch" + patch_description: "Remove section of solution file forcing projects to be built that might not be used for this recipe" + patch_type: "conan" diff --git a/recipes/cpython/all/conanfile.py b/recipes/cpython/all/conanfile.py index 4fa1d1da6334e..c98c3381c1c65 100644 --- a/recipes/cpython/all/conanfile.py +++ b/recipes/cpython/all/conanfile.py @@ -1,21 +1,29 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools -from conans.errors import ConanInvalidConfiguration -from io import StringIO import os import re import textwrap -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.env import VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, mkdir, replace_in_file, rm, rmdir, save, unzip +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuildDeps, MSBuildToolchain, MSBuild, is_msvc, is_msvc_static_runtime, msvc_runtime_flag, msvs_toolset +from conan.tools.scm import Version + +required_conan_version = ">=1.58.0" class CPythonConan(ConanFile): name = "cpython" + description = "Python is a programming language that lets you work quickly and integrate systems more effectively." + license = "Python-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.python.org" - description = "Python is a programming language that lets you work quickly and integrate systems more effectively." topics = ("python", "cpython", "language", "script") - license = ("Python-2.0",) - exports_sources = "patches/**" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,11 +38,6 @@ class CPythonConan(ConanFile): "with_sqlite3": [True, False], "with_tkinter": [True, False], "with_curses": [True, False], - - # Python 2 options - "unicode": ["ucs2", "ucs4"], - "with_bsddb": [True, False], - # Python 3 options "with_lzma": [True, False], # options that don't change package id @@ -53,286 +56,426 @@ class CPythonConan(ConanFile): "with_sqlite3": True, "with_tkinter": True, "with_curses": True, - - # Python 2 options - "unicode": "ucs2", - "with_bsddb": False, # True, # FIXME: libdb package missing (#5309/#5392) - # Python 3 options "with_lzma": True, # options that don't change package id "env_vars": True, } - - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _version_number_only(self): - return re.match(r"^([0-9.]+)", self.version).group(1) - - @property - def _version_tuple(self): - return tuple(self._version_number_only.split(".")) + short_paths = True @property def _supports_modules(self): - return self.settings.compiler != "Visual Studio" or self.options.shared + return not is_msvc(self) or self.options.shared @property def _version_suffix(self): - if self.settings.compiler == "Visual Studio": - joiner = "" - else: - joiner = "." - return joiner.join(self._version_tuple[:2]) + v = Version(self.version) + joiner = "" if is_msvc(self) else "." + return f"{v.major}{joiner}{v.minor}" - @property - def _is_py3(self): - return tools.Version(self._version_number_only).major == "3" - - @property - def _is_py2(self): - return tools.Version(self._version_number_only).major == "2" + 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": + if is_msvc(self): del self.options.lto del self.options.docstrings del self.options.pymalloc del self.options.with_curses del self.options.with_gdbm del self.options.with_nis - if self._is_py2: - # Python 2.xx does not support following options - del self.options.with_lzma - elif self._is_py3: - # Python 3.xx does not support following options - del self.options.with_bsddb - del self.options.unicode - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self._supports_modules: - del self.options.with_bz2 - del self.options.with_sqlite3 - del self.options.with_tkinter - - del self.options.with_bsddb - del self.options.with_lzma - if self.settings.compiler == "Visual Studio": - # The msbuild generator only works with Visual Studio - self.generators.append("MSBuildDeps") - - def validate(self): - if self.options.shared: - if self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime: - raise ConanInvalidConfiguration("cpython does not support MT(d) runtime when building a shared cpython library") - if self.settings.compiler == "Visual Studio": - if self.options.optimizations: - raise ConanInvalidConfiguration("This recipe does not support optimized MSVC cpython builds (yet)") - # FIXME: should probably throw when cross building - # FIXME: optimizations for Visual Studio, before building the final `build_type`: - # 1. build the MSVC PGInstrument build_type, - # 2. run the instrumented binaries, (PGInstrument should have created a `python.bat` file in the PCbuild folder) - # 3. build the MSVC PGUpdate build_type - if self.settings.build_type == "Debug" and "d" not in self.settings.compiler.runtime: - raise ConanInvalidConfiguration("Building debug cpython requires a debug runtime (Debug cpython requires _CrtReportMode symbol, which only debug runtimes define)") - if self._is_py2: - if self.settings.compiler.version >= tools.Version("14"): - self.output.warn("Visual Studio versions 14 and higher were never officially supported by the CPython developers") - if str(self.settings.arch) not in self._msvc_archs: - raise ConanInvalidConfiguration("Visual Studio does not support this architecture") + self.options.rm_safe("with_bz2") + self.options.rm_safe("with_sqlite3") + self.options.rm_safe("with_tkinter") + self.options.rm_safe("with_lzma") - if not self.options.shared and tools.Version(self._version_number_only) >= "3.10": - raise ConanInvalidConfiguration("Static msvc build disabled (>=3.10) due to \"AttributeError: module 'sys' has no attribute 'winver'\"") - - if self.options.get_safe("with_curses", False) and not self.options["ncurses"].with_widec: - raise ConanInvalidConfiguration("cpython requires ncurses with wide character support") - - def package_id(self): - del self.info.options.env_vars - - 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") - @property - def _with_libffi(self): - # cpython 3.7.x on MSVC uses an ancient libffi 2.00-beta (which is not available at cci, and is API/ABI incompatible with current 3.2+) - return self._supports_modules \ - and (self.settings.compiler != "Visual Studio" or tools.Version(self._version_number_only) >= "3.8") + def build_requirements(self): + if Version(self.version) >= "3.11" and not is_msvc(self) and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") def requirements(self): - self.requires("zlib/1.2.11") + self.requires("zlib/[>=1.2.11 <2]") if self._supports_modules: - self.requires("openssl/1.1.1l") - self.requires("expat/2.4.1") - if self._with_libffi: - self.requires("libffi/3.2.1") - if tools.Version(self._version_number_only) < "3.8": - self.requires("mpdecimal/2.4.2") - elif tools.Version(self._version_number_only) < "3.10": + self.requires("openssl/[>=1.1 <4]") + self.requires("expat/[>=2.6.2 <3]") + self.requires("libffi/3.4.4") + if Version(self.version) < "3.10" or is_apple_os(self): + # FIXME: mpdecimal > 2.5.0 on MacOS causes the _decimal module to not be importable self.requires("mpdecimal/2.5.0") else: - self.requires("mpdecimal/2.5.0") # FIXME: no 2.5.1 to troubleshoot apple + self.requires("mpdecimal/2.5.1") if self.settings.os != "Windows": - if not tools.is_apple_os(self.settings.os): - self.requires("libuuid/1.0.3") - self.requires("libxcrypt/4.4.25") + if not is_apple_os(self): + self.requires("util-linux-libuuid/2.39.2") + # In <3.9 and lower patch versions of 3.9/10/11, crypt.h was exposed in Python.h + # This was removed in 3.11 and backported: https://github.com/python/cpython/issues/88914 + # For the sake of this recipe, we only have later patch versions, so this version check + # may be slightly inaccurate if a lower patch version is desired. + transitive_crypt = Version(self.version) < "3.9" + self.requires("libxcrypt/4.4.36", transitive_headers=transitive_crypt, transitive_libs=transitive_crypt) if self.options.get_safe("with_bz2"): self.requires("bzip2/1.0.8") if self.options.get_safe("with_gdbm", False): - self.requires("gdbm/1.19") + self.requires("gdbm/1.23") if self.options.get_safe("with_nis", False): # TODO: Add nis when available. raise ConanInvalidConfiguration("nis is not available on CCI (yet)") if self.options.get_safe("with_sqlite3"): - self.requires("sqlite3/3.36.0") + self.requires("sqlite3/3.45.2") if self.options.get_safe("with_tkinter"): self.requires("tk/8.6.10") if self.options.get_safe("with_curses", False): - self.requires("ncurses/6.2") - if self.options.get_safe("with_bsddb", False): - self.requires("libdb/5.3.28") + # Used in a public header + # https://github.com/python/cpython/blob/v3.10.13/Include/py_curses.h#L34 + self.requires("ncurses/6.4", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_lzma", False): - self.requires("xz_utils/5.2.5") + self.requires("xz_utils/5.4.5") + + def package_id(self): + del self.info.options.env_vars + + def validate(self): + if self.options.shared: + if is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "cpython does not support MT(d) runtime when building a shared cpython library" + ) + if is_msvc(self): + if self.options.optimizations: + raise ConanInvalidConfiguration( + "This recipe does not support optimized MSVC cpython builds (yet)" + ) + # FIXME: should probably throw when cross building + # FIXME: optimizations for Visual Studio, before building the final `build_type`: + # 1. build the MSVC PGInstrument build_type, + # 2. run the instrumented binaries, (PGInstrument should have created a `python.bat` file in the PCbuild folder) + # 3. build the MSVC PGUpdate build_type + if self.settings.build_type == "Debug" and "d" not in msvc_runtime_flag(self): + raise ConanInvalidConfiguration( + "Building debug cpython requires a debug runtime (Debug cpython requires _CrtReportMode" + " symbol, which only debug runtimes define)" + ) + if str(self.settings.arch) not in self._msvc_archs: + raise ConanInvalidConfiguration("Visual Studio does not support this architecture") + if not self.options.shared and Version(self.version) >= "3.10": + # Static CPython on Windows is only loosely supported, see https://github.com/python/cpython/issues/110234 + # 3.10 fails during the test, 3.11 fails during the build (missing symbol that seems to be DLL specific: PyWin_DLLhModule) + raise ConanInvalidConfiguration("Static msvc build disabled (>=3.10) due to \"AttributeError: module 'sys' has no attribute 'winver'\"") + + if self.options.get_safe("with_curses", False) and not self.dependencies["ncurses"].options.with_widec: + raise ConanInvalidConfiguration("cpython requires ncurses with wide character support") + + if self._supports_modules: + if Version(self.version) >= "3.9.0": + if self.dependencies["mpdecimal"].ref.version < Version("2.5.0"): + raise ConanInvalidConfiguration("cpython 3.9.0 (and newer) requires (at least) mpdecimal 2.5.0") + + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == 9 and Version(self.version) >= "3.12": + raise ConanInvalidConfiguration("FIXME: GCC 9 produces an internal compiler error locally, and a link error in CCI") + + def source(self): + 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) - self._autotools.libs = [] + def _generate_autotools(self): + tc = AutotoolsToolchain(self, prefix=self.package_folder) + # Not necessary, just cleans up the output + tc.update_configure_args({"--enable-static": None, "--disable-static": None}) yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), + tc.configure_args += [ "--with-doc-strings={}".format(yes_no(self.options.docstrings)), "--with-pymalloc={}".format(yes_no(self.options.pymalloc)), "--with-system-expat", - "--with-system-ffi", "--enable-optimizations={}".format(yes_no(self.options.optimizations)), "--with-lto={}".format(yes_no(self.options.lto)), "--with-pydebug={}".format(yes_no(self.settings.build_type == "Debug")), + "--with-system-libmpdec", + "--with-openssl={}".format(self.dependencies["openssl"].package_folder), ] - if self._is_py2: - conf_args.extend([ - "--enable-unicode={}".format(yes_no(self.options.unicode)), - ]) - if self._is_py3: - conf_args.extend([ - "--with-system-libmpdec", - "--with-openssl={}".format(self.deps_cpp_info["openssl"].rootpath), - "--enable-loadable-sqlite-extensions={}".format(yes_no(not self.options["sqlite3"].omit_load_extension)), - ]) - if self.settings.compiler == "intel": - conf_args.extend(["--with-icc"]) - if tools.get_env("CC") or self.settings.compiler != "gcc": - conf_args.append("--without-gcc") - if self.options.with_tkinter: + if Version(self.version) < "3.12": + tc.configure_args.append("--with-system-ffi") + if Version(self.version) >= "3.10": + tc.configure_args.append("--disable-test-modules") + if self.options.get_safe("with_sqlite3"): + tc.configure_args.append("--enable-loadable-sqlite-extensions={}".format( + yes_no(not self.dependencies["sqlite3"].options.omit_load_extension) + )) + if self.options.with_tkinter and Version(self.version) < "3.11": tcltk_includes = [] tcltk_libs = [] # FIXME: collect using some conan util (https://github.com/conan-io/conan/issues/7656) for dep in ("tcl", "tk", "zlib"): - tcltk_includes += ["-I{}".format(d) for d in self.deps_cpp_info[dep].include_paths] - tcltk_libs += ["-l{}".format(lib) for lib in self.deps_cpp_info[dep].libs] - if self.settings.os == "Linux" and not self.options["tk"].shared: + cpp_info = self.dependencies[dep].cpp_info.aggregated_components() + tcltk_includes += [f"-I{d}" for d in cpp_info.includedirs] + tcltk_libs += [f"-L{lib}" for lib in cpp_info.libdirs] + tcltk_libs += [f"-l{lib}" for lib in cpp_info.libs] + if self.settings.os in ["Linux", "FreeBSD"] and not self.dependencies["tk"].options.shared: # FIXME: use info from xorg.components (x11, xscrnsaver) - tcltk_libs.extend(["-l{}".format(lib) for lib in ("X11", "Xss")]) - conf_args.extend([ + tcltk_libs.extend([f"-l{lib}" for lib in ("X11", "Xss")]) + tc.configure_args += [ "--with-tcltk-includes={}".format(" ".join(tcltk_includes)), "--with-tcltk-libs={}".format(" ".join(tcltk_libs)), - ]) - if self.settings.os in ("Linux", "FreeBSD"): - # Building _testembed fails due to missing pthread/rt symbols - self._autotools.link_flags.append("-lpthread") - - build = None - if tools.cross_building(self) and not tools.cross_building(self, skip_x64_x86=True): - # Building from x86_64 to x86 is not a "real" cross build, so set build == host - build = tools.get_gnu_triplet(str(self.settings.os), str(self.settings.arch), str(self.settings.compiler)) - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder, build=build) - return self._autotools + ] + if not is_apple_os(self): + tc.extra_ldflags.append('-Wl,--as-needed') + + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + if Version(self.version) >= "3.11": + pkgdeps = PkgConfigDeps(self) + pkgdeps.generate() + + def generate(self): + VirtualRunEnv(self).generate(scope="build") + + if is_msvc(self): + # The msbuild generator only works with Visual Studio + deps = MSBuildDeps(self) + deps.generate() + # The toolchain.props is not injected yet, but it also generates VCVars + toolchain = MSBuildToolchain(self) + toolchain.properties["IncludeExternals"] = "true" + toolchain.generate() + else: + self._generate_autotools() + + def _msvc_project_path(self, name): + return os.path.join(self.source_folder, "PCBuild", f"{name}.vcxproj") + + def _regex_replace_in_file(self, filename, pattern, replacement): + content = load(self, filename) + content = re.sub(pattern, replacement, content) + save(self, filename, content) + + def _inject_conan_props_file(self, project_basename, dep_name, condition=True): + if condition: + search = '' + replace_in_file(self, + self._msvc_project_path(project_basename), + search, + search + f'') + + def _patch_setup_py(self): + setup_py = os.path.join(self.source_folder, "setup.py") + if Version(self.version) < "3.10": + replace_in_file(self, setup_py, ":libmpdec.so.2", "mpdec") + + if self.options.get_safe("with_curses", False): + libcurses = self.dependencies["ncurses"].cpp_info.components["libcurses"] + tinfo = self.dependencies["ncurses"].cpp_info.components["tinfo"] + libs = libcurses.libs + libcurses.system_libs + tinfo.libs + tinfo.system_libs + replace_in_file(self, setup_py, + "curses_libs = ", + "curses_libs = {} #".format(repr(libs))) + + if self._supports_modules: + openssl = self.dependencies["openssl"].cpp_info.aggregated_components() + zlib = self.dependencies["zlib"].cpp_info.aggregated_components() + if Version(self.version) < "3.11": + replace_in_file(self, setup_py, + "openssl_includes = ", + f"openssl_includes = {openssl.includedirs + zlib.includedirs} #") + replace_in_file(self, setup_py, + "openssl_libdirs = ", + f"openssl_libdirs = {openssl.libdirs + zlib.libdirs} #") + replace_in_file(self, setup_py, + "openssl_libs = ", + f"openssl_libs = {openssl.libs + zlib.libs} #") + + if Version(self.version) < "3.11": + replace_in_file(self, setup_py, "if (MACOS and self.detect_tkinter_darwin())", "if (False)") + + def _patch_msvc_projects(self): + # Don't build vendored bz2 + self._regex_replace_in_file(self._msvc_project_path("_bz2"), r'.*Include=\"\$\(bz2Dir\).*', "") + + if self._supports_modules: + # Don't import vendored libffi + replace_in_file(self, self._msvc_project_path("_ctypes"), '', "") + if Version(self.version) < "3.11": + # Don't add this define, it should be added conditionally by the libffi package + replace_in_file(self, self._msvc_project_path("_ctypes"), "FFI_BUILDING;", "") + + # Don't import vendored openssl + replace_in_file(self, self._msvc_project_path("_hashlib"), '', "") + replace_in_file(self, self._msvc_project_path("_ssl"), '', "") + + # For mpdecimal, we need to remove all headers and all c files *except* the main module file, _decimal.c + self._regex_replace_in_file(self._msvc_project_path("_decimal"), r'.*Include=\"\.\.\\Modules\\_decimal\\.*\.h.*', "") + self._regex_replace_in_file(self._msvc_project_path("_decimal"), r'.*Include=\"\.\.\\Modules\\_decimal\\libmpdec\\.*\.c.*', "") + # There is also an assembly file with a complicated build step as part of the mpdecimal build + replace_in_file(self, self._msvc_project_path("_decimal"), "", "-->") + # Remove extra include directory + replace_in_file(self, self._msvc_project_path("_decimal"), r"..\Modules\_decimal\libmpdec;", "") + + # Don't include vendored sqlite3 + replace_in_file(self, self._msvc_project_path("_sqlite3"), + '', + '') + + # Remove hardcoded reference to lzma library + replace_in_file(self, self._msvc_project_path("_lzma"), "$(OutDir)liblzma$(PyDebugExt).lib;", "") + # Don't include vendored lzma + replace_in_file(self, self._msvc_project_path("_lzma"), + '', + '') + + # Don't include vendored expat project + replace_in_file(self, self._msvc_project_path("pyexpat"), + r"$(PySourcePath)Modules\expat;", + "") + # Remove XML_STATIC, this should conditionally be set by the expat library. + # TODO: Why HAVE_EXPAT_H? (It is at least removed in later versions) + replace_in_file(self, self._msvc_project_path("pyexpat"), ("HAVE_EXPAT_H;" if Version(self.version) < "3.11" else "") + "XML_STATIC;", "") + self._regex_replace_in_file(self._msvc_project_path("pyexpat"), r'.*Include=\"\.\.\\Modules\\expat\\.*" />', "") + + # Don't include vendored expat headers + replace_in_file(self, self._msvc_project_path("_elementtree"), + r"..\Modules\expat;", + "") + # Remove XML_STATIC, this should conditionally be set by the expat library. + replace_in_file(self, self._msvc_project_path("_elementtree"), "XML_STATIC;", "") + # Remove vendored expat + self._regex_replace_in_file(self._msvc_project_path("_elementtree"), r'.*Include=\"\.\.\\Modules\\expat\\.*" />', "") + + if Version(self.version) >= "3.9": + # deflate.c has warning 4244 disabled, need special patching else it breaks the regex below + # Add an extra space to avoid being picked up by the regex + replace_in_file(self, self._msvc_project_path("pythoncore"), + r'', + r'') + # Don't use vendored zlib + self._regex_replace_in_file(self._msvc_project_path("pythoncore"), r'.*Include=\"\$\(zlibDir\).*', "") + + # Don't use vendored tcl/tk include dir + replace_in_file(self, self._msvc_project_path("_tkinter"), "$(tcltkDir)include;", "") + # Don't use hardcoded tcl/tk library + replace_in_file(self, self._msvc_project_path("_tkinter"), "$(tcltkLib);", "") + # TODO: Why? + replace_in_file(self, self._msvc_project_path("_tkinter"), + "", + "") + # Don't use vendored tcl/tk + self._regex_replace_in_file(self._msvc_project_path("_tkinter"), r'.*Include=\"\$\(tcltkdir\).*', "") + + # Disable "ValidateUcrtbase" target (TODO: Why?) + replace_in_file(self, self._msvc_project_path("python"), "$(Configuration) != 'PGInstrument'", "False") + + if Version(self.version) < "3.11": + # TODO: Why? + replace_in_file(self, self._msvc_project_path("_freeze_importlib"), + "', + r'') + + self._inject_conan_props_file("_bz2", "bzip2", self.options.get_safe("with_bz2")) + self._inject_conan_props_file("_elementtree", "expat", self._supports_modules) + self._inject_conan_props_file("pyexpat", "expat", self._supports_modules) + self._inject_conan_props_file("_hashlib", "openssl", self._supports_modules) + self._inject_conan_props_file("_ssl", "openssl", self._supports_modules) + self._inject_conan_props_file("_sqlite3", "sqlite3", self.options.get_safe("with_sqlite3")) + self._inject_conan_props_file("_tkinter", "tk", self.options.get_safe("with_tkinter")) + self._inject_conan_props_file("pythoncore", "zlib") + self._inject_conan_props_file("python", "zlib") + self._inject_conan_props_file("pythonw", "zlib") + self._inject_conan_props_file("_ctypes", "libffi", self._supports_modules) + self._inject_conan_props_file("_decimal", "mpdecimal", self._supports_modules) + self._inject_conan_props_file("_lzma", "xz_utils", self.options.get_safe("with_lzma")) + self._inject_conan_props_file("_bsddb", "libdb", self.options.get_safe("with_bsddb")) def _patch_sources(self): - for patch in self.conan_data.get("patches",{}).get(self.version, []): - tools.patch(**patch) - if self._is_py3 and tools.Version(self._version_number_only) < "3.10": - tools.replace_in_file(os.path.join(self._source_subfolder, "setup.py"), - ":libmpdec.so.2", "mpdec") - if self.settings.compiler == "Visual Studio": + apply_conandata_patches(self) + # <=3.10 requires a lot of manual injection of dependencies through setup.py + # 3.12 removes setup.py completely, and uses pkgconfig dependencies + # 3.11 is an in awkward transition state where some dependencies use pkgconfig, and others use setup.py + if Version(self.version) < "3.12": + self._patch_setup_py() + if Version(self.version) >= "3.11": + replace_in_file(self, os.path.join(self.source_folder, "configure"), + 'OPENSSL_LIBS="-lssl -lcrypto"', + 'OPENSSL_LIBS="-lssl -lcrypto -lz"') + if is_msvc(self): runtime_library = { "MT": "MultiThreaded", "MTd": "MultiThreadedDebug", "MD": "MultiThreadedDLL", "MDd": "MultiThreadedDebugDLL", - }[str(self.settings.compiler.runtime)] + }[msvc_runtime_flag(self)] self.output.info("Patching runtime") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pyproject.props"), - "MultiThreadedDLL", runtime_library) - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pyproject.props"), - "MultiThreadedDebugDLL", runtime_library) + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pyproject.props"), + "MultiThreadedDLL", runtime_library) + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pyproject.props"), + "MultiThreadedDebugDLL", runtime_library) # Remove vendored packages - tools.rmdir(os.path.join(self._source_subfolder, "Modules", "_decimal", "libmpdec")) - tools.rmdir(os.path.join(self._source_subfolder, "Modules", "expat")) + rmdir(self, os.path.join(self.source_folder, "Modules", "_decimal", "libmpdec")) + rmdir(self, os.path.join(self.source_folder, "Modules", "expat")) - if self.options.get_safe("with_curses", False): - # FIXME: this will link to ALL libraries of ncurses. Only need to link to ncurses(w) (+ eventually tinfo) - tools.replace_in_file(os.path.join(self._source_subfolder, "setup.py"), - "curses_libs = ", - "curses_libs = {} #".format(repr(self.deps_cpp_info["ncurses"].libs + self.deps_cpp_info["ncurses"].system_libs))) + if Version(self.version) < "3.12": + replace_in_file(self, os.path.join(self.source_folder, "Makefile.pre.in"), + "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'", + "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'") # Enable static MSVC cpython if not self.options.shared: - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythoncore.vcxproj"), - "","Py_NO_BUILD_SHARED;") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythoncore.vcxproj"), - "Py_ENABLE_SHARED", "Py_NO_ENABLE_SHARED") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythoncore.vcxproj"), - "DynamicLibrary", "StaticLibrary") - - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "python.vcxproj"), - "", "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "python.vcxproj"), - "", "Py_NO_ENABLE_SHARED;") - - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythonw.vcxproj"), - "", "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") - tools.replace_in_file(os.path.join(self._source_subfolder, "PCbuild", "pythonw.vcxproj"), - "", "Py_NO_ENABLE_SHARED;%(PreprocessorDefinitions)") - - def _upgrade_single_project_file(self, project_file): - """ - `devenv /upgrade ` will upgrade *ALL* projects referenced by the project. - By temporarily moving the solution project, only one project is upgraded - This is needed for static cpython or for disabled optional dependencies (e.g. tkinter=False) - Restore it afterwards because it is needed to build some targets. - """ - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln.bak")) - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj.bak")) - with tools.vcvars(self.settings): - self.run("devenv \"{}\" /upgrade".format(project_file), run_environment=True) - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln.bak"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln")) - tools.rename(os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj.bak"), - os.path.join(self._source_subfolder, "PCbuild", "pcbuild.proj")) + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + "", + "Py_NO_BUILD_SHARED;") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + "Py_ENABLE_SHARED", + "Py_NO_ENABLE_SHARED") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + "DynamicLibrary", + "StaticLibrary") + + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "python.vcxproj"), + "", + "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "python.vcxproj"), + "", + "Py_NO_ENABLE_SHARED;") + + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythonw.vcxproj"), + "", + "shlwapi.lib;ws2_32.lib;pathcch.lib;version.lib;%(AdditionalDependencies)") + replace_in_file(self, os.path.join(self.source_folder, "PCbuild", "pythonw.vcxproj"), + "", + "Py_NO_ENABLE_SHARED;%(PreprocessorDefinitions)") + + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, os.path.join(self.source_folder, "PCbuild", "pythoncore.vcxproj"), + '', + f'', + ) + + if is_msvc(self): + self._patch_msvc_projects() @property def _solution_projects(self): if self.options.shared: - solution_path = os.path.join(self._source_subfolder, "PCbuild", "pcbuild.sln") - projects = set(m.group(1) for m in re.finditer("\"([^\"]+)\\.vcxproj\"", open(solution_path).read())) + solution_path = os.path.join(self.source_folder, "PCbuild", "pcbuild.sln") + projects = set(m.group(1) for m in re.finditer('"([^"]+)\\.vcxproj"', open(solution_path).read())) def project_build(name): if os.path.basename(name) in self._msvc_discarded_projects: @@ -341,39 +484,31 @@ def project_build(name): return False return True - def sort_importance(key): - importance = ( - "pythoncore", # The python library MUST be built first. All modules and executables depend on it - "python", # Build the python executable next (for convenience, when debugging) - ) - try: - return importance.index(key) - except ValueError: - return len(importance) - - projects = sorted((p for p in projects if project_build(p)), key=sort_importance) + projects = list(filter(project_build, projects)) return projects else: - return "pythoncore", "python", "pythonw" + return ["pythoncore", "python", "pythonw"] @property def _msvc_discarded_projects(self): - discarded = {"python_uwp", "pythonw_uwp"} + discarded = { + "python_uwp", + "pythonw_uwp", + "_freeze_importlib", + "sqlite3", + "bdist_wininst", + "liblzma", + "openssl", + "xxlimited", + } if not self.options.with_bz2: discarded.add("bz2") if not self.options.with_sqlite3: discarded.add("_sqlite3") if not self.options.with_tkinter: discarded.add("_tkinter") - if self._is_py2: - # Python 2 Visual Studio projects NOT to build - discarded = discarded.union({"bdist_wininst", "libeay", "ssleay", "sqlite3", "tcl", "tk", "tix"}) - if not self.options.with_bsddb: - discarded.add("_bsddb") - elif self._is_py3: - discarded = discarded.union({"bdist_wininst", "liblzma", "openssl", "sqlite3", "xxlimited"}) - if not self.options.with_lzma: - discarded.add("_lzma") + if not self.options.with_lzma: + discarded.add("_lzma") return discarded @property @@ -381,50 +516,31 @@ def _msvc_archs(self): archs = { "x86": "Win32", "x86_64": "x64", + "armv7": "ARM", + "armv8_32": "ARM", + "armv8": "ARM64", } - if tools.Version(self._version_number_only) >= "3.8": - archs.update({ - "armv7": "ARM", - "armv8_32": "ARM", - "armv8": "ARM64", - }) return archs def _msvc_build(self): msbuild = MSBuild(self) - msbuild_properties = { - "IncludeExternals": "true", - } + msbuild.platform = self._msvc_archs[str(self.settings.arch)] + projects = self._solution_projects - self.output.info("Building {} Visual Studio projects: {}".format(len(projects), projects)) + self.output.info(f"Building {len(projects)} Visual Studio projects: {projects}") - with tools.no_op(): - for project_i, project in enumerate(projects, 1): - self.output.info("[{}/{}] Building project '{}'...".format(project_i, len(projects), project)) - project_file = os.path.join(self._source_subfolder, "PCbuild", project + ".vcxproj") - self._upgrade_single_project_file(project_file) - msbuild.build(project_file, upgrade_project=False, build_type="Debug" if self.settings.build_type == "Debug" else "Release", - platforms=self._msvc_archs, properties=msbuild_properties) + sln = os.path.join(self.source_folder, "PCbuild", "pcbuild.sln") + # FIXME: Solution files do not pick up the toolset automatically. + cmd = msbuild.command(sln, targets=projects) + self.run(f"{cmd} /p:PlatformToolset={msvs_toolset(self)}") def build(self): - # FIXME: these checks belong in validate, but the versions of dependencies are not available there yet - if self._supports_modules: - if tools.Version(self._version_number_only) < "3.8.0": - if tools.Version(self.deps_cpp_info["mpdecimal"].version) >= "2.5.0": - raise ConanInvalidConfiguration("cpython versions lesser then 3.8.0 require a mpdecimal lesser then 2.5.0") - elif tools.Version(self._version_number_only) >= "3.9.0": - if tools.Version(self.deps_cpp_info["mpdecimal"].version) < "2.5.0": - raise ConanInvalidConfiguration("cpython 3.9.0 (and newer) requires (at least) mpdecimal 2.5.0") - - if self._with_libffi: - if tools.Version(self.deps_cpp_info["libffi"].version) >= "3.3" and self.settings.compiler == "Visual Studio" and "d" in str(self.settings.compiler.runtime): - raise ConanInvalidConfiguration("libffi versions >= 3.3 cause 'read access violations' when using a debug runtime (MTd/MDd)") - self._patch_sources() - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self._msvc_build() else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure() autotools.make() @property @@ -432,44 +548,40 @@ def _msvc_artifacts_path(self): build_subdir_lut = { "x86_64": "amd64", "x86": "win32", + "armv7": "arm32", + "armv8_32": "arm32", + "armv8": "arm64", } - if tools.Version(self._version_number_only) >= "3.8": - build_subdir_lut.update({ - "armv7": "arm32", - "armv8_32": "arm32", - "armv8": "arm64", - }) - return os.path.join(self._source_subfolder, "PCbuild", build_subdir_lut[str(self.settings.arch)]) + return os.path.join(self.source_folder, "PCbuild", build_subdir_lut[str(self.settings.arch)]) @property def _msvc_install_subprefix(self): return "bin" def _copy_essential_dlls(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): # Until MSVC builds support cross building, copy dll's of essential (shared) dependencies to python binary location. # These dll's are required when running the layout tool using the newly built python executable. dest_path = os.path.join(self.build_folder, self._msvc_artifacts_path) - if self._with_libffi: - for bin_path in self.deps_cpp_info["libffi"].bin_paths: - self.copy("*.dll", src=bin_path, dst=dest_path) - for bin_path in self.deps_cpp_info["expat"].bin_paths: - self.copy("*.dll", src=bin_path, dst=dest_path) - for bin_path in self.deps_cpp_info["zlib"].bin_paths: - self.copy("*.dll", src=bin_path, dst=dest_path) + for bin_path in self.dependencies["libffi"].cpp_info.bindirs: + copy(self, "*.dll", src=bin_path, dst=dest_path) + for bin_path in self.dependencies["expat"].cpp_info.bindirs: + copy(self, "*.dll", src=bin_path, dst=dest_path) + for bin_path in self.dependencies["zlib"].cpp_info.bindirs: + copy(self, "*.dll", src=bin_path, dst=dest_path) def _msvc_package_layout(self): self._copy_essential_dlls() install_prefix = os.path.join(self.package_folder, self._msvc_install_subprefix) - tools.mkdir(install_prefix) + mkdir(self, install_prefix) build_path = self._msvc_artifacts_path infix = "_d" if self.settings.build_type == "Debug" else "" # FIXME: if cross building, use a build python executable here - python_built = os.path.join(build_path, "python{}.exe".format(infix)) + python_built = os.path.join(build_path, f"python{infix}.exe") layout_args = [ - os.path.join(self._source_subfolder, "PC", "layout", "main.py"), + os.path.join(self.source_folder, "PC", "layout", "main.py"), "-v", - "-s", self._source_subfolder, + "-s", self.source_folder, "-b", build_path, "--copy", install_prefix, "-p", @@ -481,16 +593,12 @@ def _msvc_package_layout(self): layout_args.append("--include-tcltk") if self.settings.build_type == "Debug": layout_args.append("-d") - python_args = " ".join("\"{}\"".format(a) for a in layout_args) - self.run("{} {}".format(python_built, python_args), run_environment=True) + python_args = " ".join(f'"{a}"' for a in layout_args) + self.run(f"{python_built} {python_args}") - tools.rmdir(os.path.join(self.package_folder, "bin", "tcl")) + rmdir(self, os.path.join(self.package_folder, "bin", "tcl")) - for file in os.listdir(install_prefix): - if re.match("vcruntime.*", file): - os.unlink(os.path.join(install_prefix, file)) - continue - os.unlink(os.path.join(install_prefix, "LICENSE.txt")) + rm(self, "LICENSE.txt", install_prefix) for file in os.listdir(os.path.join(install_prefix, "libs")): if not re.match("python.*", file): os.unlink(os.path.join(install_prefix, "libs", file)) @@ -498,45 +606,130 @@ def _msvc_package_layout(self): def _msvc_package_copy(self): build_path = self._msvc_artifacts_path infix = "_d" if self.settings.build_type == "Debug" else "" - self.copy("*.exe", src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) - self.copy("*.dll", src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) - self.copy("*.pyd", src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "DLLs")) - self.copy("python{}{}.lib".format(self._version_suffix, infix), src=build_path, dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "libs")) - self.copy("*", src=os.path.join(self._source_subfolder, "Include"), dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) - self.copy("pyconfig.h", src=os.path.join(self._source_subfolder, "PC"), dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) - self.copy("*.py", src=os.path.join(self._source_subfolder, "lib"), dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib")) - tools.rmdir(os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib", "test")) + copy(self, "*.exe", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) + copy(self, "*.dll", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix)) + copy(self, "*.pyd", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "DLLs")) + copy(self, f"python{self._version_suffix}{infix}.lib", + src=build_path, + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "libs")) + copy(self, "*", + src=os.path.join(self.source_folder, "Include"), + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) + copy(self, "pyconfig.h", + src=os.path.join(self.source_folder, "PC"), + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "include")) + copy(self, "*.py", + src=os.path.join(self.source_folder, "lib"), + dst=os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib")) + rmdir(self, os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib", "test")) packages = {} get_name_version = lambda fn: fn.split(".", 2)[:2] - whldir = os.path.join(self._source_subfolder, "Lib", "ensurepip", "_bundled") + whldir = os.path.join(self.source_folder, "Lib", "ensurepip", "_bundled") for fn in filter(lambda n: n.endswith(".whl"), os.listdir(whldir)): name, version = get_name_version(fn) add = True if name in packages: pname, pversion = get_name_version(packages[name]) - add = tools.Version(version) > tools.Version(pversion) + add = Version(version) > Version(pversion) if add: packages[name] = fn for fname in packages.values(): - tools.unzip(filename=os.path.join(whldir, fname), destination=os.path.join(self.package_folder, "bin", "Lib", "site-packages")) + unzip(self, filename=os.path.join(whldir, fname), + destination=os.path.join(self.package_folder, "bin", "Lib", "site-packages")) + + interpreter_path = os.path.join(build_path, self._cpython_interpreter_name) + lib_dir_path = os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib").replace("\\", "/") + self.run(f"{interpreter_path} -c \"import compileall; compileall.compile_dir('{lib_dir_path}')\"") + + @property + def _exact_lib_name(self): + prefix = "" if self.settings.os == "Windows" else "lib" + if self.settings.os == "Windows": + extension = "lib" + elif not self.options.shared: + extension = "a" + elif is_apple_os(self): + extension = "dylib" + else: + extension = "so" + return f"{prefix}{self._lib_name}.{extension}" + + @property + def _cmake_module_path(self): + if is_msvc(self): + # On Windows, `lib` is for Python modules, `libs` is for compiled objects. + # Usually CMake modules are packaged with the latter. + return os.path.join(self._msvc_install_subprefix, "libs", "cmake") + else: + return os.path.join("lib", "cmake") + + def _write_cmake_findpython_wrapper_file(self): + template = textwrap.dedent(""" + if (DEFINED Python3_VERSION_STRING) + set(_CONAN_PYTHON_SUFFIX "3") + else() + set(_CONAN_PYTHON_SUFFIX "") + endif() + set(Python${_CONAN_PYTHON_SUFFIX}_EXECUTABLE @PYTHON_EXECUTABLE@) + set(Python${_CONAN_PYTHON_SUFFIX}_LIBRARY @PYTHON_LIBRARY@) + + # Fails if these are set beforehand + unset(Python${_CONAN_PYTHON_SUFFIX}_INCLUDE_DIRS) + unset(Python${_CONAN_PYTHON_SUFFIX}_INCLUDE_DIR) + + include(${CMAKE_ROOT}/Modules/FindPython${_CONAN_PYTHON_SUFFIX}.cmake) + + # Sanity check: The former comes from FindPython(3), the latter comes from the injected find module + if(NOT Python${_CONAN_PYTHON_SUFFIX}_VERSION STREQUAL Python${_CONAN_PYTHON_SUFFIX}_VERSION_STRING) + message(FATAL_ERROR "CMake detected wrong cpython version - this is likely a bug with the cpython Conan package") + endif() + + if (TARGET Python${_CONAN_PYTHON_SUFFIX}::Module) + set_target_properties(Python${_CONAN_PYTHON_SUFFIX}::Module PROPERTIES INTERFACE_LINK_LIBRARIES cpython::python) + endif() + if (TARGET Python${_CONAN_PYTHON_SUFFIX}::SABIModule) + set_target_properties(Python${_CONAN_PYTHON_SUFFIX}::SABIModule PROPERTIES INTERFACE_LINK_LIBRARIES cpython::python) + endif() + if (TARGET Python${_CONAN_PYTHON_SUFFIX}::Python) + set_target_properties(Python${_CONAN_PYTHON_SUFFIX}::Python PROPERTIES INTERFACE_LINK_LIBRARIES cpython::embed) + endif() + """) + + # In order for the package to be relocatable, these variables must be relative to the installed CMake file + if is_msvc(self): + python_exe = "${CMAKE_CURRENT_LIST_DIR}/../../" + self._cpython_interpreter_name + python_library = "${CMAKE_CURRENT_LIST_DIR}/../" + self._exact_lib_name + else: + python_exe = "${CMAKE_CURRENT_LIST_DIR}/../../bin/" + self._cpython_interpreter_name + python_library = "${CMAKE_CURRENT_LIST_DIR}/../" + self._exact_lib_name - self.run("{} -c \"import compileall; compileall.compile_dir('{}')\"".format(os.path.join(build_path, self._cpython_interpreter_name), os.path.join(self.package_folder, self._msvc_install_subprefix, "Lib").replace("\\", "/")), - run_environment=True) + cmake_file = os.path.join(self.package_folder, self._cmake_module_path, "use_conan_python.cmake") + content = template.replace("@PYTHON_EXECUTABLE@", python_exe).replace("@PYTHON_LIBRARY@", python_library) + save(self, cmake_file, content) def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - if self.settings.compiler == "Visual Studio": - if self._is_py2 or not self.options.shared: - self._msvc_package_copy() - else: + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + if self.options.shared: self._msvc_package_layout() - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "vcruntime*") + else: + self._msvc_package_copy() + rm(self, "vcruntime*", os.path.join(self.package_folder, "bin"), recursive=True) else: - 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")) + autotools = Autotools(self) + if is_apple_os(self): + # FIXME: See https://github.com/python/cpython/issues/109796, this workaround is mentioned there + autotools.make(target="sharedinstall", args=["DESTDIR="]) + autotools.install(args=["DESTDIR="]) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) # Rewrite shebangs of python scripts for filename in os.listdir(os.path.join(self.package_folder, "bin")): @@ -550,23 +743,25 @@ def package(self): if not(firstline.startswith(b"#!") and b"/python" in firstline and b"/bin/sh" not in firstline): continue text = fn.read() - self.output.info("Rewriting shebang of {}".format(filename)) + self.output.info(f"Rewriting shebang of {filename}") with open(filepath, "wb") as fn: - fn.write(textwrap.dedent("""\ + fn.write(textwrap.dedent(f"""\ #!/bin/sh ''':' __file__="$0" while [ -L "$__file__" ]; do __file__="$(dirname "$__file__")/$(readlink "$__file__")" done - exec "$(dirname "$__file__")/python{}" "$0" "$@" + exec "$(dirname "$__file__")/python{self._version_suffix}" "$0" "$@" ''' - """.format(self._version_suffix)).encode()) + """).encode()) fn.write(text) if not os.path.exists(self._cpython_symlink): - os.symlink("python{}".format(self._version_suffix), self._cpython_symlink) - self._fix_install_name() + os.symlink(f"python{self._version_suffix}", self._cpython_symlink) + fix_apple_shared_install_name(self) + + self._write_cmake_findpython_wrapper_file() @property def _cpython_symlink(self): @@ -577,14 +772,12 @@ def _cpython_symlink(self): @property def _cpython_interpreter_name(self): - if self.settings.compiler == "Visual Studio": - suffix = "" - else: - suffix = self._version_suffix - python = "python{}".format(suffix) - if self.settings.compiler == "Visual Studio": + python = "python" + if is_msvc(self): if self.settings.build_type == "Debug": python += "_d" + else: + python += self._version_suffix if self.settings.os == "Windows": python += ".exe" return python @@ -596,79 +789,71 @@ def _cpython_interpreter_path(self): @property def _abi_suffix(self): res = "" - if self._is_py3: - if self.settings.build_type == "Debug": - res += "d" - if tools.Version(self._version_number_only) < "3.8": - if self.options.get_safe("pymalloc", False): - res += "m" + if self.settings.build_type == "Debug": + res += "d" return res @property def _lib_name(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): if self.settings.build_type == "Debug": lib_ext = "_d" else: lib_ext = "" else: - lib_ext = self._abi_suffix + (".dll.a" if self.options.shared and self.settings.os == "Windows" else "") - return "python{}{}".format(self._version_suffix, lib_ext) - - def _fix_install_name(self): - if tools.is_apple_os(self.settings.os) and self.options.shared: - buffer = StringIO() - python = os.path.join(self.package_folder, "bin", "python") - self.run('otool -L "%s"' % python, output=buffer) - lines = buffer.getvalue().strip().split('\n')[1:] - for line in lines: - library = line.split()[0] - if library.startswith(self.package_folder): - new = library.replace(self.package_folder, "@executable_path/..") - self.output.info("patching {}, replace {} with {}".format(python, library, new)) - self.run("install_name_tool -change {} {} {}".format(library, new, python)) + lib_ext = self._abi_suffix + return f"python{self._version_suffix}{lib_ext}" def package_info(self): - # FIXME: conan components Python::Interpreter component, need a target type - # self.cpp_info.names["cmake_find_package"] = "Python" - # self.cpp_info.names["cmake_find_package_multi"] = "Python" - # FIXME: conan components need to generate multiple .pc files (python2, python-27) - - py_version = tools.Version(self._version_number_only) + py_version = Version(self.version) # python component: "Build a C extension for Python" - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self.cpp_info.components["python"].includedirs = [os.path.join(self._msvc_install_subprefix, "include")] libdir = os.path.join(self._msvc_install_subprefix, "libs") else: - self.cpp_info.components["python"].includedirs.append(os.path.join("include", "python{}{}".format(self._version_suffix, self._abi_suffix))) + self.cpp_info.components["python"].includedirs.append( + os.path.join("include", f"python{self._version_suffix}{self._abi_suffix}") + ) libdir = "lib" if self.options.shared: self.cpp_info.components["python"].defines.append("Py_ENABLE_SHARED") else: self.cpp_info.components["python"].defines.append("Py_NO_ENABLE_SHARED") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["python"].system_libs.extend(["dl", "m", "pthread", "util"]) elif self.settings.os == "Windows": - self.cpp_info.components["python"].system_libs.extend(["pathcch", "shlwapi", "version", "ws2_32"]) + self.cpp_info.components["python"].system_libs.extend( + ["pathcch", "shlwapi", "version", "ws2_32"] + ) self.cpp_info.components["python"].requires = ["zlib::zlib"] if self.settings.os != "Windows": self.cpp_info.components["python"].requires.append("libxcrypt::libxcrypt") - self.cpp_info.components["python"].names["pkg_config"] = "python-{}.{}".format(py_version.major, py_version.minor) + self.cpp_info.components["python"].set_property( + "pkg_config_name", f"python-{py_version.major}.{py_version.minor}" + ) + self.cpp_info.components["python"].set_property( + "pkg_config_aliases", [f"python{py_version.major}"] + ) self.cpp_info.components["python"].libdirs = [] - self.cpp_info.components["_python_copy"].names["pkg_config"] = "python{}".format(py_version.major) - self.cpp_info.components["_python_copy"].requires = ["python"] - self.cpp_info.components["_python_copy"].libdirs = [] - # embed component: "Embed Python into an application" self.cpp_info.components["embed"].libs = [self._lib_name] self.cpp_info.components["embed"].libdirs = [libdir] - self.cpp_info.components["embed"].names["pkg_config"] = "python-{}.{}-embed".format(py_version.major, py_version.minor) + self.cpp_info.components["embed"].includedirs = [] + self.cpp_info.components["embed"].set_property( + "pkg_config_name", f"python-{py_version.major}.{py_version.minor}-embed" + ) + self.cpp_info.components["embed"].set_property( + "pkg_config_aliases", [f"python{py_version.major}-embed"] + ) self.cpp_info.components["embed"].requires = ["python"] - self.cpp_info.components["_embed_copy"].requires = ["embed"] - self.cpp_info.components["_embed_copy"].names["pkg_config"] = ["python{}-embed".format(py_version.major)] - self.cpp_info.components["_embed_copy"].libdirs = [] + # Transparent integration with CMake's FindPython(3) + self.cpp_info.set_property("cmake_file_name", "Python3") + self.cpp_info.set_property("cmake_module_file_name", "Python") + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_build_modules", [os.path.join(self._cmake_module_path, "use_conan_python.cmake")]) + self.cpp_info.builddirs = [self._cmake_module_path] if self._supports_modules: # hidden components: the C extensions of python are built as dynamically loaded shared libraries. @@ -677,12 +862,11 @@ def package_info(self): "openssl::openssl", "expat::expat", "mpdecimal::mpdecimal", + "libffi::libffi", ] - if self._with_libffi: - self.cpp_info.components["_hidden"].requires.append("libffi::libffi") if self.settings.os != "Windows": - if not tools.is_apple_os(self.settings.os): - self.cpp_info.components["_hidden"].requires.append("libuuid::libuuid") + if not is_apple_os(self): + self.cpp_info.components["_hidden"].requires.append("util-linux-libuuid::util-linux-libuuid") self.cpp_info.components["_hidden"].requires.append("libxcrypt::libxcrypt") if self.options.with_bz2: self.cpp_info.components["_hidden"].requires.append("bzip2::bzip2") @@ -692,47 +876,68 @@ def package_info(self): self.cpp_info.components["_hidden"].requires.append("sqlite3::sqlite3") if self.options.get_safe("with_curses", False): self.cpp_info.components["_hidden"].requires.append("ncurses::ncurses") - if self.options.get_safe("with_bsddb"): - self.cpp_info.components["_hidden"].requires.append("libdb::libdb") if self.options.get_safe("with_lzma"): self.cpp_info.components["_hidden"].requires.append("xz_utils::xz_utils") if self.options.get_safe("with_tkinter"): self.cpp_info.components["_hidden"].requires.append("tk::tk") + self.cpp_info.components["_hidden"].includedirs = [] self.cpp_info.components["_hidden"].libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_hidden"].system_libs.append("nsl") if self.options.env_vars: bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.runenv_info.append_path("PATH", bindir) + self.buildenv_info.append_path("PATH", bindir) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Appending PATH environment variable: {bindir}") self.env_info.PATH.append(bindir) python = self._cpython_interpreter_path + self.conf_info.define("user.cpython:python", python) self.user_info.python = python if self.options.env_vars: - self.output.info("Setting PYTHON environment variable: {}".format(python)) + self.runenv_info.append_path("PYTHON", python) + self.buildenv_info.append_path("PYTHON", python) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Appending PYTHON environment variable: {python}") self.env_info.PYTHON = python - if self.settings.compiler == "Visual Studio": + if is_msvc(self): pythonhome = os.path.join(self.package_folder, "bin") - elif tools.is_apple_os(self.settings.os): - pythonhome = self.package_folder else: - version = tools.Version(self._version_number_only) - pythonhome = os.path.join(self.package_folder, "lib", "python{}.{}".format(version.major, version.minor)) + pythonhome = self.package_folder + self.conf_info.define("user.cpython:pythonhome", pythonhome) self.user_info.pythonhome = pythonhome - pythonhome_required = self.settings.compiler == "Visual Studio" or tools.is_apple_os(self.settings.os) + pythonhome_required = is_msvc(self) or is_apple_os(self) + self.conf_info.define("user.cpython:module_requires_pythonhome", pythonhome_required) self.user_info.module_requires_pythonhome = pythonhome_required - if self.settings.compiler == "Visual Studio": + if is_msvc(self): if self.options.env_vars: - self.output.info("Setting PYTHONHOME environment variable: {}".format(pythonhome)) + # FIXME: On Windows, defining this breaks the packaged Python executable, but fixes + # separately built executables with an embedded interpreter trying to run standard Python + # modules. However, NOT defining this reverses the situation, normal Python executables + #work, but embedded interpreters break. + # The docs at https://python.readthedocs.io/en/latest/using/cmdline.html#envvar-PYTHONHOME + # seem to not be accurate to Windows (https://discuss.python.org/t/the-document-on-pythonhome-might-be-wrong/19614/5) + #self.runenv_info.append_path("PYTHONHOME", pythonhome) + #self.buildenv_info.append_path("PYTHONHOME", pythonhome) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Setting PYTHONHOME environment variable: {pythonhome}") self.env_info.PYTHONHOME = pythonhome - if self._is_py2: - python_root = "" - else: - python_root = self.package_folder - if self.options.env_vars: - self.output.info("Setting PYTHON_ROOT environment variable: {}".format(python_root)) - self.env_info.PYTHON_ROOT = python_root + python_root = self.package_folder + if self.options.env_vars: + self.runenv_info.append_path("PYTHON_ROOT", python_root) + self.buildenv_info.append_path("PYTHON_ROOT", python_root) + + # TODO remove once Conan 1.x is no longer supported + self.output.info(f"Setting PYTHON_ROOT environment variable: {python_root}") + self.env_info.PYTHON_ROOT = python_root + self.conf_info.define("user.cpython:python_root", python_root) self.user_info.python_root = python_root diff --git a/recipes/cpython/all/patches/2.7.18-0001-msvc.patch b/recipes/cpython/all/patches/2.7.18-0001-msvc.patch deleted file mode 100644 index 2c101049df531..0000000000000 --- a/recipes/cpython/all/patches/2.7.18-0001-msvc.patch +++ /dev/null @@ -1,278 +0,0 @@ ---- PCbuild/_bsddb.vcxproj -+++ PCbuild/_bsddb.vcxproj -@@ -46,7 +46,7 @@ - NotSet - - -- -+ - - .pyd - -@@ -75,7 +75,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -64,7 +64,7 @@ - $(opensslIncludeDir);%(AdditionalIncludeDirectories) - - -- ws2_32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies) -+ ws2_32.lib;%(AdditionalDependencies) - - - -@@ -75,14 +75,14 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -96,10 +96,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -64,7 +64,7 @@ - $(opensslIncludeDir);%(AdditionalIncludeDirectories) - - -- ws2_32.lib;crypt32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies) -+ ws2_32.lib;crypt32.lib;%(AdditionalDependencies) - - - -@@ -75,14 +75,14 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - {86937f53-c189-40ef-8ce8-8759d8e7d480} - false ---- PCbuild/bz2.vcxproj -+++ PCbuild/bz2.vcxproj -@@ -47,7 +47,7 @@ - NotSet - - -- -+ - - .pyd - -@@ -72,13 +72,13 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -61,15 +61,15 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - 0x1D100000 - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -58,19 +58,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -61,11 +61,11 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -77,12 +77,12 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - diff --git a/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch b/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch deleted file mode 100644 index 6034410d3d265..0000000000000 --- a/recipes/cpython/all/patches/2.7.18-0002-add-support-msvc-14.patch +++ /dev/null @@ -1,59 +0,0 @@ -Patches from https://bugs.python.org/issue30742 - ---- Modules/posixmodule.c -+++ Modules/posixmodule.c -@@ -563,7 +563,10 @@ typedef struct { - char osfile; - } my_ioinfo; - -+#if _MSC_VER < 1900 // MSVS2013 and lower (https://bugs.python.org/issue30742) - extern __declspec(dllimport) char * __pioinfo[]; -+#endif -+ - #define IOINFO_L2E 5 - #define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) - #define IOINFO_ARRAYS 64 -@@ -575,6 +578,7 @@ extern __declspec(dllimport) char * __pioinfo[]; - int - _PyVerify_fd(int fd) - { -+#if _MSC_VER < 1900 // MSVS2013 and lower (https://bugs.python.org/issue30742) - const int i1 = fd >> IOINFO_L2E; - const int i2 = fd & ((1 << IOINFO_L2E) - 1); - -@@ -607,6 +611,13 @@ _PyVerify_fd(int fd) - fail: - errno = EBADF; - return 0; -+#else -+ //a call to _get_osfhandle with invalid fd sets errno to EBADF -+ if (_get_osfhandle(fd) == INVALID_HANDLE_VALUE) -+ return 0; -+ else -+ return 1; -+#endif - } - - /* the special case of checking dup2. The target fd must be in a sensible range */ ---- Modules/timemodule.c -+++ Modules/timemodule.c -@@ -803,7 +803,18 @@ inittimezone(PyObject *m) { - - And I'm lazy and hate C so nyer. - */ --#if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) -+#if defined(HAVE_TZNAME) && (_MSC_VER >= 1900) //MSVS2015+ (https://bugs.python.org/issue30742) -+ tzset(); -+ PyModule_AddIntConstant(m, "timezone", _timezone); -+#ifdef HAVE_ALTZONE -+ PyModule_AddIntConstant(m, "altzone", altzone); -+#else -+ PyModule_AddIntConstant(m, "altzone", _timezone - 3600); -+#endif -+ PyModule_AddIntConstant(m, "daylight", _daylight); -+ PyModule_AddObject(m, "tzname", -+ Py_BuildValue("(zz)", _tzname[0], _tzname[1])); -+#elif defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) - tzset(); - #ifdef PYOS_OS2 - PyModule_AddIntConstant(m, "timezone", _timezone); diff --git a/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch b/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch deleted file mode 100644 index 9eb079402733d..0000000000000 --- a/recipes/cpython/all/patches/2.7.18-0003-msvc-fix-static.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- PC/dl_nt.c -+++ PC/dl_nt.c -@@ -107,5 +107,7 @@ - } - return TRUE; - } -- -+#else -+ULONG_PTR _Py_ActivateActCtx() { return 0; } -+void _Py_DeactivateActCtx(ULONG_PTR cookie) {} - #endif /* Py_ENABLE_SHARED */ diff --git a/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch b/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch deleted file mode 100644 index 5c61acd74bd5c..0000000000000 --- a/recipes/cpython/all/patches/2.7.18-0004-disable-macos-tcltk.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1928,9 +1928,9 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (host_platform == 'darwin' and -- self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -- return -+ #if (host_platform == 'darwin' and -+ # self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -+ # return - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.10.0-0001-msvc.patch b/recipes/cpython/all/patches/3.10.0-0001-msvc.patch deleted file mode 100644 index e9b1faf061f3b..0000000000000 --- a/recipes/cpython/all/patches/3.10.0-0001-msvc.patch +++ /dev/null @@ -1,416 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -58,2 +58,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -120,1 +120,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -151,1 +151,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -71,7 +71,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -101,17 +101,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_ctypes.vcxproj -+++ PCbuild/_ctypes.vcxproj -@@ -71,7 +71,7 @@ - _ctypes - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -94,7 +94,7 @@ - - - -- FFI_BUILDING;%(PreprocessorDefinitions) -+ %(PreprocessorDefinitions) - - - /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -71,7 +71,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -98,11 +98,11 @@ - CONFIG_32;ANSI;%(PreprocessorDefinitions) - CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;MASM;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -71,7 +71,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -94,10 +94,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -111,10 +111,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -74,1 +74,1 @@ -- -+ -@@ -129,4 +129,4 @@ -- -+ ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -73,1 +73,1 @@ -- -+ -@@ -302,7 +302,7 @@ - - - -- -+ - - - -@@ -496,7 +496,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -71,7 +71,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -71,7 +71,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -99,9 +99,9 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -71,7 +71,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -93,12 +93,12 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -71,7 +71,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -90,19 +90,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -77,7 +77,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -93,12 +93,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -108,10 +108,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 0288bdae92ee9..0000000000000 --- a/recipes/cpython/all/patches/3.10.0-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -627,10 +627,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch deleted file mode 100644 index ec23890e0a717..0000000000000 --- a/recipes/cpython/all/patches/3.10.0-0005-disable-macos-tcltk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setup.py -+++ setup.py -@@ -2094,8 +2094,8 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (MACOS and self.detect_tkinter_darwin()): -- return True -+ #if (MACOS and self.detect_tkinter_darwin()): -+ # return True - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.10.0-0003-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.10/3.10.0-0003-_ctypes-ffi.patch similarity index 100% rename from recipes/cpython/all/patches/3.10.0-0003-_ctypes-ffi.patch rename to recipes/cpython/all/patches/3.10/3.10.0-0003-_ctypes-ffi.patch diff --git a/recipes/cpython/all/patches/3.11/3.11.7-0001-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.11/3.11.7-0001-_ctypes-ffi.patch new file mode 100644 index 0000000000000..65027b60406fd --- /dev/null +++ b/recipes/cpython/all/patches/3.11/3.11.7-0001-_ctypes-ffi.patch @@ -0,0 +1,37 @@ +diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c +index 9bdf1db856..799f99e809 100644 +--- a/Modules/_ctypes/cfield.c ++++ b/Modules/_ctypes/cfield.c +@@ -1473,7 +1473,11 @@ P_get(void *ptr, Py_ssize_t size) + return PyLong_FromVoidPtr(*(void **)ptr); + } + +-static struct fielddesc formattable[] = { ++#define FORMATTABLE_SIZE 30 ++static struct fielddesc formattable[FORMATTABLE_SIZE]; ++ ++static void formattable_init(void) { ++struct fielddesc my_formattable[] = { + { 's', s_set, s_get, NULL}, + { 'b', b_set, b_get, NULL}, + { 'B', B_set, B_get, NULL}, +@@ -1510,6 +1514,11 @@ static struct fielddesc formattable[] = { + { 'O', O_set, O_get, NULL}, + { 0, NULL, NULL, NULL}, + }; ++ size_t nb = 1; ++ for (struct fielddesc *pos = my_formattable; pos->code; ++pos, ++nb); ++ if (FORMATTABLE_SIZE < nb) abort(); ++ memcpy(formattable, my_formattable, nb * sizeof(struct fielddesc)); ++} + + /* + Ideas: Implement VARIANT in this table, using 'V' code. +@@ -1597,6 +1606,7 @@ _ctypes_get_fielddesc(const char *fmt) + + if (!initialized) { + initialized = 1; ++ formattable_init(); + _ctypes_init_fielddesc(); + } + diff --git a/recipes/cpython/all/patches/3.12/3.12.1-0001-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.12/3.12.1-0001-_ctypes-ffi.patch new file mode 100644 index 0000000000000..06bb62c5abd9f --- /dev/null +++ b/recipes/cpython/all/patches/3.12/3.12.1-0001-_ctypes-ffi.patch @@ -0,0 +1,37 @@ +diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c +index 128506a9ee..ee9ade67b8 100644 +--- a/Modules/_ctypes/cfield.c ++++ b/Modules/_ctypes/cfield.c +@@ -1448,7 +1448,11 @@ P_get(void *ptr, Py_ssize_t size) + return PyLong_FromVoidPtr(*(void **)ptr); + } + +-static struct fielddesc formattable[] = { ++#define FORMATTABLE_SIZE 30 ++static struct fielddesc formattable[FORMATTABLE_SIZE]; ++ ++static void formattable_init(void) { ++struct fielddesc my_formattable[] = { + { 's', s_set, s_get, NULL}, + { 'b', b_set, b_get, NULL}, + { 'B', B_set, B_get, NULL}, +@@ -1485,6 +1489,11 @@ static struct fielddesc formattable[] = { + { 'O', O_set, O_get, NULL}, + { 0, NULL, NULL, NULL}, + }; ++ size_t nb = 1; ++ for (struct fielddesc *pos = my_formattable; pos->code; ++pos, ++nb); ++ if (FORMATTABLE_SIZE < nb) abort(); ++ memcpy(formattable, my_formattable, nb * sizeof(struct fielddesc)); ++} + + /* + Ideas: Implement VARIANT in this table, using 'V' code. +@@ -1572,6 +1581,7 @@ _ctypes_get_fielddesc(const char *fmt) + + if (!initialized) { + initialized = 1; ++ formattable_init(); + _ctypes_init_fielddesc(); + } + diff --git a/recipes/cpython/all/patches/3.12/3.12.1-0002-remove-module-deps.patch b/recipes/cpython/all/patches/3.12/3.12.1-0002-remove-module-deps.patch new file mode 100644 index 0000000000000..1d9d31f011d72 --- /dev/null +++ b/recipes/cpython/all/patches/3.12/3.12.1-0002-remove-module-deps.patch @@ -0,0 +1,50 @@ +diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln +index bdddec60da..f6a30955bf 100644 +--- a/PCbuild/pcbuild.sln ++++ b/PCbuild/pcbuild.sln +@@ -9,45 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution + EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" +- ProjectSection(ProjectDependencies) = postProject +- {9E48B300-37D1-11DD-8C41-005056C00008} = {9E48B300-37D1-11DD-8C41-005056C00008} +- {9EC7190A-249F-4180-A900-548FDCF3055F} = {9EC7190A-249F-4180-A900-548FDCF3055F} +- {78D80A15-BD8C-44E2-B49E-1F05B0A0A687} = {78D80A15-BD8C-44E2-B49E-1F05B0A0A687} +- {6901D91C-6E48-4BB7-9FEC-700C8131DF1D} = {6901D91C-6E48-4BB7-9FEC-700C8131DF1D} +- {54B1431F-B86B-4ACB-B28C-88BCF93191D8} = {54B1431F-B86B-4ACB-B28C-88BCF93191D8} +- {F749B822-B489-4CA5-A3AD-CE078F5F338A} = {F749B822-B489-4CA5-A3AD-CE078F5F338A} +- {D06B6426-4762-44CC-8BAD-D79052507F2F} = {D06B6426-4762-44CC-8BAD-D79052507F2F} +- {36D0C52C-DF4E-45D0-8BC7-E294C3ABC781} = {36D0C52C-DF4E-45D0-8BC7-E294C3ABC781} +- {CB435430-EBB1-478B-8F4E-C256F6838F55} = {CB435430-EBB1-478B-8F4E-C256F6838F55} +- {17E1E049-C309-4D79-843F-AE483C264AEA} = {17E1E049-C309-4D79-843F-AE483C264AEA} +- {384C224A-7474-476E-A01B-750EA7DE918C} = {384C224A-7474-476E-A01B-750EA7DE918C} +- {12728250-16EC-4DC6-94D7-E21DD88947F8} = {12728250-16EC-4DC6-94D7-E21DD88947F8} +- {86937F53-C189-40EF-8CE8-8759D8E7D480} = {86937F53-C189-40EF-8CE8-8759D8E7D480} +- {28B5D777-DDF2-4B6B-B34F-31D938813856} = {28B5D777-DDF2-4B6B-B34F-31D938813856} +- {31FFC478-7B4A-43E8-9954-8D03E2187E9C} = {31FFC478-7B4A-43E8-9954-8D03E2187E9C} +- {F9D71780-F393-11E0-BE50-0800200C9A66} = {F9D71780-F393-11E0-BE50-0800200C9A66} +- {494BAC80-A60C-43A9-99E7-ACB691CE2C4D} = {494BAC80-A60C-43A9-99E7-ACB691CE2C4D} +- {C6E20F84-3247-4AD6-B051-B073268F73BA} = {C6E20F84-3247-4AD6-B051-B073268F73BA} +- {B244E787-C445-441C-BDF4-5A4F1A3A1E51} = {B244E787-C445-441C-BDF4-5A4F1A3A1E51} +- {18CAE28C-B454-46C1-87A0-493D91D97F03} = {18CAE28C-B454-46C1-87A0-493D91D97F03} +- {13CECB97-4119-4316-9D42-8534019A5A44} = {13CECB97-4119-4316-9D42-8534019A5A44} +- {885D4898-D08D-4091-9C40-C700CFE3FC5A} = {885D4898-D08D-4091-9C40-C700CFE3FC5A} +- {447F05A8-F581-4CAC-A466-5AC7936E207E} = {447F05A8-F581-4CAC-A466-5AC7936E207E} +- {ECC7CEAC-A5E5-458E-BB9E-2413CC847881} = {ECC7CEAC-A5E5-458E-BB9E-2413CC847881} +- {4946ECAC-2E69-4BF8-A90A-F5136F5094DF} = {4946ECAC-2E69-4BF8-A90A-F5136F5094DF} +- {FDB84CBB-2FB6-47C8-A2D6-091E0833239D} = {FDB84CBB-2FB6-47C8-A2D6-091E0833239D} +- {73FCD2BD-F133-46B7-8EC1-144CD82A59D5} = {73FCD2BD-F133-46B7-8EC1-144CD82A59D5} +- {2097F1C1-597C-4167-93E3-656A7D6339B2} = {2097F1C1-597C-4167-93E3-656A7D6339B2} +- {A2697BD3-28C1-4AEC-9106-8B748639FD16} = {A2697BD3-28C1-4AEC-9106-8B748639FD16} +- {900342D7-516A-4469-B1AD-59A66E49A25F} = {900342D7-516A-4469-B1AD-59A66E49A25F} +- {6DAC66D9-E703-4624-BE03-49112AB5AA62} = {6DAC66D9-E703-4624-BE03-49112AB5AA62} +- {0E9791DB-593A-465F-98BC-681011311617} = {0E9791DB-593A-465F-98BC-681011311617} +- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} +- {EB6E69DD-04BF-4543-9B92-49FAABCEAC2E} = {EB6E69DD-04BF-4543-9B92-49FAABCEAC2E} +- {16BFE6F0-22EF-40B5-B831-7E937119EF10} = {16BFE6F0-22EF-40B5-B831-7E937119EF10} +- {FCBE1EF2-E0F0-40B1-88B5-00A35D378742} = {FCBE1EF2-E0F0-40B1-88B5-00A35D378742} +- {A840DDFB-ED50-484B-B527-B32E7CF90FD5} = {A840DDFB-ED50-484B-B527-B32E7CF90FD5} +- EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" + ProjectSection(ProjectDependencies) = postProject diff --git a/recipes/cpython/all/patches/3.7.9-0001-msvc.patch b/recipes/cpython/all/patches/3.7.9-0001-msvc.patch deleted file mode 100644 index 29be01b13f5b5..0000000000000 --- a/recipes/cpython/all/patches/3.7.9-0001-msvc.patch +++ /dev/null @@ -1,416 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -58,2 +58,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -85,1 +85,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -110,1 +110,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -39,7 +39,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -69,17 +69,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -39,7 +39,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -64,11 +64,11 @@ - _CRT_SECURE_NO_WARNINGS;MASM;%(PreprocessorDefinitions) - CONFIG_32;PPRO;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -39,7 +39,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -65,8 +65,8 @@ -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -39,7 +39,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -62,10 +62,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -79,10 +79,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -39,7 +39,7 @@ - _sqlite3 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -95,10 +95,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/openssl.vcxproj -+++ PCbuild/openssl.vcxproj -@@ -74,6 +74,6 @@ nmake - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -39,7 +39,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -58,19 +58,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -38,7 +38,7 @@ - {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} - pythoncore - -- -+ - - - DynamicLibrary -@@ -215,7 +215,7 @@ - - - -- -+ - - - -@@ -409,7 +409,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -39,7 +39,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -54,7 +54,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -39,7 +39,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -54,7 +54,7 @@ - - - -- -+ - - - -@@ -67,9 +67,9 @@ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -45,7 +45,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -61,12 +61,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -76,10 +76,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 92e44c8ea6ee5..0000000000000 --- a/recipes/cpython/all/patches/3.7.9-0002-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -618,10 +618,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch deleted file mode 100644 index f5ffba2f61232..0000000000000 --- a/recipes/cpython/all/patches/3.7.9-0003-disable-macos-tcltk.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1829,9 +1829,9 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (host_platform == 'darwin' and -- self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -- return -+ #if (host_platform == 'darwin' and -+ # self.detect_tkinter_darwin(inc_dirs, lib_dirs)): -+ # return - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.8.12-0001-msvc.patch b/recipes/cpython/all/patches/3.8.12-0001-msvc.patch deleted file mode 100644 index 4e390810d2dde..0000000000000 --- a/recipes/cpython/all/patches/3.8.12-0001-msvc.patch +++ /dev/null @@ -1,431 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -60,2 +60,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -118,1 +118,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -149,1 +149,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -71,7 +71,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -101,17 +101,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_ctypes.vcxproj -+++ PCbuild/_ctypes.vcxproj -@@ -71,7 +71,7 @@ - _ctypes - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -94,7 +94,7 @@ - - - -- FFI_BUILDING;%(PreprocessorDefinitions) -+ %(PreprocessorDefinitions) - - - /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -71,7 +71,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -98,11 +98,11 @@ - CONFIG_32;ANSI;%(PreprocessorDefinitions) - CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -71,7 +71,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -94,10 +94,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -111,10 +111,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -71,7 +71,7 @@ - _sqlite3 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -127,10 +127,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -70,7 +70,7 @@ - {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} - pythoncore - -- -+ - - - DynamicLibrary -@@ -272,7 +272,7 @@ - - - -- -+ - - - -@@ -468,7 +468,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -71,7 +71,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -71,7 +71,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -99,9 +99,9 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -71,7 +71,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -93,12 +93,12 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -71,7 +71,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -91,18 +91,18 @@ - - - $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -77,7 +77,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -93,12 +93,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -108,10 +108,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 21527d0ed307f..0000000000000 --- a/recipes/cpython/all/patches/3.8.12-0003-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -606,10 +606,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch deleted file mode 100644 index 90af822b58070..0000000000000 --- a/recipes/cpython/all/patches/3.8.12-0004-disable-macos-tcltk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1838,8 +1838,8 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (MACOS and self.detect_tkinter_darwin()): -- return True -+ #if (MACOS and self.detect_tkinter_darwin()): -+ # return True - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.8.12-0002-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.8/3.8.12-0002-_ctypes-ffi.patch similarity index 100% rename from recipes/cpython/all/patches/3.8.12-0002-_ctypes-ffi.patch rename to recipes/cpython/all/patches/3.8/3.8.12-0002-_ctypes-ffi.patch diff --git a/recipes/cpython/all/patches/3.9.7-0001-msvc.patch b/recipes/cpython/all/patches/3.9.7-0001-msvc.patch deleted file mode 100644 index fac9247123880..0000000000000 --- a/recipes/cpython/all/patches/3.9.7-0001-msvc.patch +++ /dev/null @@ -1,434 +0,0 @@ ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -60,2 +60,0 @@ --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" --EndProject ---- PCbuild/python.vcxproj -+++ PCbuild/python.vcxproj -@@ -118,1 +118,1 @@ -- -+ ---- PCbuild/_freeze_importlib.vcxproj -+++ PCbuild/_freeze_importlib.vcxproj -@@ -149,1 +149,1 @@ -- -+ --> ---- PCbuild/_bz2.vcxproj -+++ PCbuild/_bz2.vcxproj -@@ -71,7 +71,7 @@ - bz2 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -101,17 +101,17 @@ - - - -- -+ - - -- -- -+ - - - ---- PCbuild/_ctypes.vcxproj -+++ PCbuild/_ctypes.vcxproj -@@ -71,7 +71,7 @@ - _ctypes - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -94,7 +94,7 @@ - - - -- FFI_BUILDING;%(PreprocessorDefinitions) -+ %(PreprocessorDefinitions) - - - /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) ---- PCbuild/_decimal.vcxproj -+++ PCbuild/_decimal.vcxproj -@@ -71,7 +71,7 @@ - _decimal - Win32Proj - -- -+ - - - DynamicLibrary -@@ -98,11 +98,11 @@ - CONFIG_32;ANSI;%(PreprocessorDefinitions) - CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) -- ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) -+ ..\Modules\_decimal;%(AdditionalIncludeDirectories) - - - -- -+ - - - -- -+ - - -- -+ - - - ---- PCbuild/_lzma.vcxproj -+++ PCbuild/_lzma.vcxproj -@@ -71,7 +71,7 @@ - lzma - Win32Proj - -- -+ - - - DynamicLibrary -@@ -94,10 +94,10 @@ - - - $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) -- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) -+ $(ConanPreprocessorDefinitions);WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) - - -- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -111,10 +111,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/_sqlite3.vcxproj -+++ PCbuild/_sqlite3.vcxproj -@@ -71,7 +71,7 @@ - _sqlite3 - Win32Proj - -- -+ - - - DynamicLibrary -@@ -127,10 +127,10 @@ - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} - false - -- -+ - - - ---- PCbuild/pythoncore.vcxproj -+++ PCbuild/pythoncore.vcxproj -@@ -70,7 +70,7 @@ - {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} - pythoncore - -- -+ - - - DynamicLibrary -@@ -295,7 +295,7 @@ - - - -- -+ - - - -@@ -497,7 +497,7 @@ - - - -- -+ - - - ---- PCbuild/_hashlib.vcxproj -+++ PCbuild/_hashlib.vcxproj -@@ -71,7 +71,7 @@ - _hashlib - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - ---- PCbuild/_ssl.vcxproj -+++ PCbuild/_ssl.vcxproj -@@ -71,7 +71,7 @@ - _ssl - Win32Proj - -- -+ - - - DynamicLibrary -@@ -86,7 +86,7 @@ - - - -- -+ - - - -@@ -99,9 +99,9 @@ - - - -- -+ - - - ---- PCbuild/_elementtree.vcxproj -+++ PCbuild/_elementtree.vcxproj -@@ -71,7 +71,7 @@ - _elementtree - Win32Proj - -- -+ - - - DynamicLibrary -@@ -93,12 +93,12 @@ - - - -- ..\Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;%(PreprocessorDefinitions) - - - -- -+ - - - -- -+ - - - ---- PCbuild/pyexpat.vcxproj -+++ PCbuild/pyexpat.vcxproj -@@ -71,7 +71,7 @@ - {D06B6426-4762-44CC-8BAD-D79052507F2F} - pyexpat - -- -+ - - - DynamicLibrary -@@ -90,19 +90,19 @@ - - - -- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) -- _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) -+ %(AdditionalIncludeDirectories) -+ _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;%(PreprocessorDefinitions) - - - -- -- -+ - - - -- -+ - - - ---- PCbuild/_tkinter.vcxproj -+++ PCbuild/_tkinter.vcxproj -@@ -77,7 +77,7 @@ - DynamicLibrary - NotSet - -- -+ - - .pyd - -@@ -93,12 +93,12 @@ - - - -- $(tcltkDir)include;%(AdditionalIncludeDirectories) -+ %(AdditionalIncludeDirectories) - WITH_APPINIT;%(PreprocessorDefinitions) -- Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) -+ - - -- $(tcltkLib);%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - -@@ -108,10 +108,10 @@ - - - -- -+ - - - {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} ---- PCbuild/pcbuild.sln -+++ PCbuild/pcbuild.sln -@@ -9,9 +9,6 @@ - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" -- ProjectSection(ProjectDependencies) = postProject -- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} -- EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" - EndProject diff --git a/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch b/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch deleted file mode 100644 index 0bec735b3653d..0000000000000 --- a/recipes/cpython/all/patches/3.9.7-0004-setup.py-pass-CFLAGS-CPPFLAGS.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.pre.in -+++ Makefile.pre.in -@@ -630,10 +630,10 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC) $(CONFIGURE_CFLAGS) $(CONFIGURE_CPPFLAGS)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch b/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch deleted file mode 100644 index 68a48853b3089..0000000000000 --- a/recipes/cpython/all/patches/3.9.7-0005-disable-macos-tcltk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setup.py -+++ setup.py -@@ -1986,8 +1986,8 @@ - # Rather than complicate the code below, detecting and building - # AquaTk is a separate method. Only one Tkinter will be built on - # Darwin - either AquaTk, if it is found, or X11 based Tk. -- if (MACOS and self.detect_tkinter_darwin()): -- return True -+ #if (MACOS and self.detect_tkinter_darwin()): -+ # return True - - # Assume we haven't found any of the libraries or include files - # The versions with dots are used on Unix, and the versions without diff --git a/recipes/cpython/all/patches/3.9.7-0002-_msi-vcxproj.patch b/recipes/cpython/all/patches/3.9/3.9.7-0002-_msi-vcxproj.patch similarity index 100% rename from recipes/cpython/all/patches/3.9.7-0002-_msi-vcxproj.patch rename to recipes/cpython/all/patches/3.9/3.9.7-0002-_msi-vcxproj.patch diff --git a/recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch b/recipes/cpython/all/patches/3.9/3.9.7-0003-_ctypes-ffi.patch similarity index 100% rename from recipes/cpython/all/patches/3.9.7-0003-_ctypes-ffi.patch rename to recipes/cpython/all/patches/3.9/3.9.7-0003-_ctypes-ffi.patch diff --git a/recipes/cpython/all/patches/3.x-0002-remove-module-deps.patch b/recipes/cpython/all/patches/3.x-0002-remove-module-deps.patch new file mode 100644 index 0000000000000..38a642520abb1 --- /dev/null +++ b/recipes/cpython/all/patches/3.x-0002-remove-module-deps.patch @@ -0,0 +1,10 @@ +--- PCbuild/pcbuild.sln ++++ PCbuild/pcbuild.sln +@@ -9,7 +9,4 @@ + EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcxproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" +- ProjectSection(ProjectDependencies) = postProject +- {0E9791DB-593A-465F-98BC-681011311618} = {0E9791DB-593A-465F-98BC-681011311618} +- EndProjectSection + EndProject diff --git a/recipes/cpython/all/test_package/CMakeLists.txt b/recipes/cpython/all/test_package/CMakeLists.txt index 525329324757f..68886bdf4d074 100644 --- a/recipes/cpython/all/test_package/CMakeLists.txt +++ b/recipes/cpython/all/test_package/CMakeLists.txt @@ -1,100 +1,21 @@ -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(Python3 REQUIRED COMPONENTS Interpreter Development.Module Development.Embed) -set(CACHE PY_VERSION_MAJOR "" CACHE STRING "MAJOR version of python") -set(CACHE PY_VERSION_MAJOR_MINOR "" CACHE STRING "MAJOR.MINOR version of python") -set(CACHE PY_VERSION "" CACHE STRING "Required version of python") -set(CACHE PY_VERSION_SUFFIX "" CACHE STRING "Suffix of python") - -set(Python_ADDITIONAL_VERSIONS ${PY_VERSION}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR_MINOR}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR}${PY_VERSION_SUFFIX} ${PY_VERSION} ${PY_VERSION_MAJOR_MINOR} ${PY_VERSION_MAJOR}) -message("Using Python_ADDITIONAL_VERSIONS: ${Python_ADDITIONAL_VERSIONS}") - -find_package(PythonInterp REQUIRED) -find_package(PythonLibs REQUIRED) - -string(FIND "${PYTHON_EXECUTABLE}" "${CONAN_CPYTHON_ROOT}" ROOT_SUBPOS) -if(ROOT_SUBPOS EQUAL -1) - message(FATAL_ERROR "found wrong python interpreter: ${PYTHON_EXECUTABLE}") -endif() - -message(STATUS "FindPythonInterp:") -message(STATUS "PYTHON_VERSION_STRING: ${PYTHON_VERSION_STRING}") -message(STATUS "PYTHON_VERSION_MAJOR: ${PYTHON_VERSION_MAJOR}") -message(STATUS "PYTHON_VERSION_MINOR: ${PYTHON_VERSION_MINOR}") -message(STATUS "PYTHON_VERSION_PATCH: ${PYTHON_VERSION_PATCH}") -message(STATUS "=============================================") -message(STATUS "FindPythonLibs:") -message(STATUS "PYTHON_LIBRARIES: ${PYTHON_LIBRARIES}") -message(STATUS "PYTHON_INCLUDE_PATH: ${PYTHON_INCLUDE_PATH} (deprecated)") -message(STATUS "PYTHON_INCLUDE_DIRS: ${PYTHON_INCLUDE_DIRS}") -message(STATUS "PYTHON_DEBUG_LIBRARIES: ${PYTHON_DEBUG_LIBRARIES} (deprecated)") -message(STATUS "PYTHONLIBS_VERSION_STRING: ${PYTHONLIBS_VERSION_STRING}") - -if(NOT PYTHON_VERSION_STRING AND NOT PYTHONLIBS_VERSION_STRING) - message(FATAL_ERROR "Version of python interpreter and libraries not found") -endif() - -if(PYTHON_VERSION_STRING) - if(NOT PYTHON_VERSION_STRING VERSION_EQUAL "${PY_VERSION}") - message("PYTHON_VERSION_STRING does not match PY_VERSION") - message(FATAL_ERROR "CMake detected wrong cpython version") - endif() -endif() - -if(PYTHONLIBS_VERSION_STRING) - if(NOT PYTHONLIBS_VERSION_STRING STREQUAL "${PY_FULL_VERSION}") - message("PYTHONLIBS_VERSION_STRING does not match PY_FULL_VERSION") - message(FATAL_ERROR "CMake detected wrong cpython version") - endif() -endif() +message("Python3_EXECUTABLE: ${Python3_EXECUTABLE}") +message("Python3_INTERPRETER_ID: ${Python3_INTERPRETER_ID}") +message("Python3_VERSION: ${Python3_VERSION}") +message("Python3_INCLUDE_DIRS: ${Python3_INCLUDE_DIRS}") +message("Python3_LIBRARIES: ${Python3_LIBRARIES}") option(BUILD_MODULE "Build python module") - if(BUILD_MODULE) - add_library(spam MODULE "py${PY_VERSION_MAJOR}/test_module.c") - target_include_directories(spam - PRIVATE - ${PYTHON_INCLUDE_DIRS} - ) - target_link_libraries(spam PRIVATE - ${PYTHON_LIBRARIES} - ) - set_property(TARGET spam PROPERTY PREFIX "") + python3_add_library(spam "test_module.c") if(MSVC) - if(CONAN_SETTINGS_BUILD_TYPE STREQUAL "Debug") - set(SUFFIX "_d.pyd") - else() - set(SUFFIX ".pyd") - endif() - set_property(TARGET spam PROPERTY SUFFIX "${SUFFIX}") - endif() - - option(USE_FINDPYTHON_X "Use new-style FindPythonX module") - if(USE_FINDPYTHON_X AND NOT (CMAKE_VERSION VERSION_LESS "3.16")) - # Require CMake 3.16 because this version introduces Python${PY_VERSION_MAJOR}_FIND_ABI - find_package(Python${PY_VERSION_MAJOR} REQUIRED COMPONENTS Interpreter Development) - message("Python${PY_VERSION_MAJOR}_EXECUTABLE: ${Python${PY_VERSION_MAJOR}_EXECUTABLE}") - message("Python${PY_VERSION_MAJOR}_INTERPRETER_ID: ${Python${PY_VERSION_MAJOR}_INTERPRETER_ID}") - message("Python${PY_VERSION_MAJOR}_VERSION: ${Python${PY_VERSION_MAJOR}_VERSION}") - message("Python${PY_VERSION_MAJOR}_INCLUDE_DIRS: ${Python${PY_VERSION_MAJOR}_INCLUDE_DIRS}") - message("Python${PY_VERSION_MAJOR}_LIBRARIES: ${Python${PY_VERSION_MAJOR}_LIBRARIES}") - if(NOT Python${PY_VERSION_MAJOR}_VERSION STREQUAL "${PY_VERSION}") - message("Python_ADDITIONAL_VERSIONS does not match PY_VERSION") - message(FATAL_ERROR "CMake detected wrong cpython version") - endif() - - if(PY_VERSION_MAJOR STREQUAL "2") - python2_add_library(spam2 "py${PY_VERSION_MAJOR}/test_module.c") - elseif(PY_VERSION_MAJOR STREQUAL "3") - python3_add_library(spam2 "py${PY_VERSION_MAJOR}/test_module.c") - else() - message(FATAL_ERROR "Unknown PY_VERSION_MAJOR") - endif() + set_target_properties(spam PROPERTIES DEBUG_POSTFIX "_d") endif() endif() -add_executable(${PROJECT_NAME} "py${PY_VERSION_MAJOR}/test_package.c") -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} "test_package.c") +target_link_libraries(${PROJECT_NAME} PRIVATE Python3::Python) diff --git a/recipes/cpython/all/test_package/conanfile.py b/recipes/cpython/all/test_package/conanfile.py index 8abc18e4492c5..6f20bfa199e7a 100644 --- a/recipes/cpython/all/test_package/conanfile.py +++ b/recipes/cpython/all/test_package/conanfile.py @@ -1,192 +1,185 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools, RunEnvironment -from conans.errors import ConanException -from io import StringIO import os -import re -import shutil +from io import StringIO +from conan import ConanFile, conan_version +from conan.errors import ConanException +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import Environment, VirtualRunEnv +from conan.tools.gnu import AutotoolsDeps +from conan.tools.microsoft import is_msvc, VCVars +from conan.tools.scm import Version -class CmakePython3Abi(object): - def __init__(self, debug, pymalloc, unicode): - self.debug, self.pymalloc, self.unicode = debug, pymalloc, unicode +conan2 = conan_version.major >= 2 - _cmake_lut = { - None: "ANY", - True: "ON", - False: "OFF", - } +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" - @property - def suffix(self): - return "{}{}{}".format( - "d" if self.debug else "", - "m" if self.pymalloc else "", - "u" if self.unicode else "", - ) + def requirements(self): + self.requires(self.tested_reference_str) - @property - def cmake_arg(self): - return ";".join(self._cmake_lut[a] for a in (self.debug, self.pymalloc, self.unicode)) + def build_requirements(self): + # The main recipe does not require CMake, but we test with it. + # The interesting problem that arises here is if you have CMake installed + # with your global pip, then it will fail to run in this test package. + # To avoid that, just add a requirement on CMake. + self.tool_requires("cmake/[>=3.16 <4]") - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def layout(self): + cmake_layout(self) @property - def _py_version(self): - return re.match(r"^([0-9.]+)", self.deps_cpp_info["cpython"].version).group(1) + def _python(self): + if conan2: + return self.dependencies["cpython"].conf_info.get("user.cpython:python", check_type=str) + else: + return self.deps_user_info["cpython"].python - @property - def _pymalloc(self): - return bool("pymalloc" in self.options["cpython"] and self.options["cpython"].pymalloc) + def _cpython_option(self, name): + if conan2: + return self.dependencies["cpython"].options.get_safe(name, False) + else: + try: + return getattr(self.options["cpython"], name, False) + except ConanException: + return False @property - def _cmake_abi(self): - if self._py_version < tools.Version("3.8"): - return CmakePython3Abi( - debug=self.settings.build_type == "Debug", - pymalloc=self._pymalloc, - unicode=False, - ) + def _py_version(self): + if conan2: + return Version(self.dependencies["cpython"].ref.version) else: - return CmakePython3Abi( - debug=self.settings.build_type == "Debug", - pymalloc=False, - unicode=False, - ) + return Version(self.deps_cpp_info["cpython"].version) @property - def _cmake_try_FindPythonX(self): - if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug": - return False - return True + def _test_setuptools(self): + # TODO Should we still try to test this? + # https://github.com/python/cpython/pull/101039 + return can_run(self) and self._supports_modules and self._py_version < "3.12" @property def _supports_modules(self): - return self.settings.compiler != "Visual Studio" or self.options["cpython"].shared + return not is_msvc(self) or self._cpython_option("shared") - def build(self): - if not tools.cross_building(self, skip_x64_x86=True): - command = "{} --version".format(self.deps_user_info["cpython"].python) - buffer = StringIO() - self.run(command, output=buffer, ignore_errors=True, run_environment=True) - self.output.info("output: %s" % buffer.getvalue()) - self.run(command, run_environment=True) + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_MODULE"] = self._supports_modules + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + try: + # CMakeToolchain might generate VCVars, but we need it + # unconditionally for the setuptools build. + VCVars(self).generate() + except ConanException: + pass + + # The build also needs access to the run environment to run the python executable + VirtualRunEnv(self).generate(scope="run") + VirtualRunEnv(self).generate(scope="build") + if self._test_setuptools: + # Just for the distutils build + AutotoolsDeps(self).generate(scope="build") + + def build(self): cmake = CMake(self) - py_major = self.deps_cpp_info["cpython"].version.split(".")[0] - cmake.definitions["BUILD_MODULE"] = self._supports_modules - cmake.definitions["PY_VERSION_MAJOR"] = py_major - cmake.definitions["PY_VERSION_MAJOR_MINOR"] = ".".join(self._py_version.split(".")[:2]) - cmake.definitions["PY_FULL_VERSION"] = self.deps_cpp_info["cpython"].version - cmake.definitions["PY_VERSION"] = self._py_version - cmake.definitions["PY_VERSION_SUFFIX"] = self._cmake_abi.suffix - cmake.definitions["PYTHON_EXECUTABLE"] = self.deps_user_info["cpython"].python - cmake.definitions["USE_FINDPYTHON_X".format(py_major)] = self._cmake_try_FindPythonX - cmake.definitions["Python{}_EXECUTABLE".format(py_major)] = self.deps_user_info["cpython"].python - cmake.definitions["Python{}_ROOT_DIR".format(py_major)] = self.deps_cpp_info["cpython"].rootpath - cmake.definitions["Python{}_USE_STATIC_LIBS".format(py_major)] = not self.options["cpython"].shared - cmake.definitions["Python{}_FIND_FRAMEWORK".format(py_major)] = "NEVER" - cmake.definitions["Python{}_FIND_REGISTRY".format(py_major)] = "NEVER" - cmake.definitions["Python{}_FIND_IMPLEMENTATIONS".format(py_major)] = "CPython" - cmake.definitions["Python{}_FIND_STRATEGY".format(py_major)] = "LOCATION" - - if self.settings.compiler != "Visual Studio": - if tools.Version(self._py_version) < tools.Version("3.8"): - cmake.definitions["Python{}_FIND_ABI".format(py_major)] = self._cmake_abi.cmake_arg - - with tools.environment_append(RunEnvironment(self).vars): - cmake.configure() + cmake.configure() cmake.build() - if not tools.cross_building(self, skip_x64_x86=True): - if self._supports_modules: - with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): - modsrcfolder = "py2" if tools.Version(self.deps_cpp_info["cpython"].version).major < "3" else "py3" - tools.mkdir(os.path.join(self.build_folder, modsrcfolder)) - for fn in os.listdir(os.path.join(self.source_folder, modsrcfolder)): - shutil.copy(os.path.join(self.source_folder, modsrcfolder, fn), os.path.join(self.build_folder, modsrcfolder, fn)) - shutil.copy(os.path.join(self.source_folder, "setup.py"), os.path.join(self.build_folder, "setup.py")) - env = { - "DISTUTILS_USE_SDK": "1", - "MSSdk": "1" - } - env.update(**AutoToolsBuildEnvironment(self).vars) - with tools.environment_append(env): - setup_args = [ - "{}/setup.py".format(self.source_folder), - # "conan", - # "--install-folder", self.build_folder, - "build", - "--build-base", self.build_folder, - "--build-platlib", os.path.join(self.build_folder, "lib_setuptools"), - ] - if self.settings.build_type == "Debug": - setup_args.append("--debug") - self.run("{} {}".format(self.deps_user_info["cpython"].python, " ".join("\"{}\"".format(a) for a in setup_args)), run_environment=True) + if self._test_setuptools: + os.environ["DISTUTILS_USE_SDK"] = "1" + os.environ["MSSdk"] = "1" + setup_args = [ + os.path.join(self.source_folder, "setup.py"), + "build", + "--build-base", self.build_folder, + "--build-platlib", os.path.join(self.build_folder, "lib_setuptools"), + # Bandaid fix: setuptools places temporary files in a subdirectory of the build folder where the + # entirety of the absolute path up to this folder is appended (with seemingly no way to stop this), + # essentially doubling the path length. This may run into Windows max path lengths, so we give ourselves + # a little bit of wiggle room by making this directory name as short as possible. One of the directory + # names goes from (for example) "temp.win-amd64-3.10-pydebug" to "t", saving us roughly 25 characters. + "--build-temp", "t", + ] + if self.settings.build_type == "Debug": + setup_args.append("--debug") + args = " ".join(f'"{a}"' for a in setup_args) + self.run(f"{self._python} {args}") def _test_module(self, module, should_work): try: - self.run("{} {}/test_package.py -b {} -t {} ".format( - self.deps_user_info["cpython"].python, self.source_folder, self.build_folder, module), run_environment=True) - works = True - except ConanException as e: - works = False - exception = e - if should_work == works: - self.output.info("Result of test was expected.") - else: - if works: - raise ConanException("Module '{}' works, but should not have worked".format(module)) - else: - self.output.warn("Module '{}' does not work, but should have worked".format(module)) - raise exception - - def _cpython_option(self, name): - try: - return getattr(self.options["cpython"], name, False) + self.run(f"{self._python} \"{self.source_folder}/test_package.py\" -b \"{self.build_folder}\" -t {module}", env="conanrun") except ConanException: - return False + if should_work: + self.output.warning(f"Module '{module}' does not work, but should have worked") + raise + self.output.info("Module failed as expected") + return + if not should_work: + raise ConanException(f"Module '{module}' works, but should not have worked") + self.output.info("Module worked as expected") def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - self.run("{} -c \"print('hello world')\"".format(self.deps_user_info["cpython"].python), run_environment=True) + if can_run(self): + self.run(f"{self._python} --version", env="conanrun") + + self.run(f"{self._python} -c \"print('hello world')\"", env="conanrun") buffer = StringIO() - self.run("{} -c \"import sys; print('.'.join(str(s) for s in sys.version_info[:3]))\"".format(self.deps_user_info["cpython"].python), run_environment=True, output=buffer) + self.run(f"{self._python} -c \"import sys; print('.'.join(str(s) for s in sys.version_info[:3]))\"", buffer, env="conanrun") self.output.info(buffer.getvalue()) version_detected = buffer.getvalue().splitlines()[-1].strip() if self._py_version != version_detected: - raise ConanException("python reported wrong version. Expected {exp}. Got {res}.".format(exp=self._py_version, res=version_detected)) + raise ConanException( + f"python reported wrong version. Expected {self._py_version}. Got {version_detected}." + ) if self._supports_modules: self._test_module("gdbm", self._cpython_option("with_gdbm")) self._test_module("bz2", self._cpython_option("with_bz2")) - self._test_module("bsddb", self._cpython_option("with_bsddb")) self._test_module("lzma", self._cpython_option("with_lzma")) self._test_module("tkinter", self._cpython_option("with_tkinter")) - with tools.environment_append({"TERM": "ansi"}): - self._test_module("curses", self._cpython_option("with_curses")) - + os.environ["TERM"] = "ansi" + self._test_module("curses", self._cpython_option("with_curses")) self._test_module("expat", True) - self._test_module("sqlite3", True) + self._test_module("sqlite3", self._cpython_option("with_sqlite3")) self._test_module("decimal", True) self._test_module("ctypes", True) - - if tools.is_apple_os(self.settings.os) and not self.options["cpython"].shared: - self.output.info("Not testing the module, because these seem not to work on apple when cpython is built as a static library") + env = Environment() + if self.settings.os != "Windows": + env.define_path("OPENSSL_CONF", os.path.join(os.sep, "dev", "null")) + with env.vars(self).apply(): + self._test_module("ssl", True) + + if is_apple_os(self) and not self._cpython_option("shared"): + self.output.info( + "Not testing the module, because these seem not to work on apple when cpython is built as" + " a static library" + ) # FIXME: find out why cpython on apple does not allow to use modules linked against a static python else: if self._supports_modules: - with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib")]}): - self.output.info("Testing module (spam) using cmake built module") - self._test_module("spam", True) + os.environ["PYTHONPATH"] = os.path.join(self.build_folder, self.cpp.build.libdirs[0]) + self.output.info("Testing module (spam) using cmake built module") + self._test_module("spam", True) - with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib_setuptools")]}): + if self._test_setuptools: + os.environ["PYTHONPATH"] = os.path.join(self.build_folder, "lib_setuptools") self.output.info("Testing module (spam) using setup.py built module") self._test_module("spam", True) - # MSVC builds need PYTHONHOME set. - with tools.environment_append({"PYTHONHOME": self.deps_user_info["cpython"].pythonhome}) if self.deps_user_info["cpython"].module_requires_pythonhome == "True" else tools.no_op(): - self.run(os.path.join("bin", "test_package"), run_environment=True) + del os.environ["PYTHONPATH"] + + # MSVC builds need PYTHONHOME set. Linux and Mac don't require it to be set if tested after building, + # but if the package is relocated then it needs to be set. + if conan2: + os.environ["PYTHONHOME"] = self.dependencies["cpython"].conf_info.get("user.cpython:pythonhome", check_type=str) + else: + os.environ["PYTHONHOME"] = self.deps_user_info["cpython"].pythonhome + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cpython/all/test_package/py2/test_module.c b/recipes/cpython/all/test_package/py2/test_module.c deleted file mode 100644 index 9c5af39ab391b..0000000000000 --- a/recipes/cpython/all/test_package/py2/test_module.c +++ /dev/null @@ -1,42 +0,0 @@ -#include - -#include - -static PyObject *SpamError; - -static PyObject * -spam_system(PyObject *self, PyObject *args) -{ - const char *command; - int sts; - - if (!PyArg_ParseTuple(args, "s", &command)) - return NULL; - sts = system(command); - if (sts < 0) { - PyErr_SetString(SpamError, "System command failed"); - return NULL; - } - return PyLong_FromLong(sts); -} - -const char spam_doc[] = "This is an example spam doc."; - -static PyMethodDef SpamMethods[] = { - {"system", spam_system, METH_VARARGS, "Execute a shell command."}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - -PyMODINIT_FUNC -initspam(void) -{ - PyObject *m; - - m = Py_InitModule("spam", SpamMethods); - if (m == NULL) - return; - PyModule_AddStringConstant(m, "__doc__", spam_doc); - SpamError = PyErr_NewException("spam.error", NULL, NULL); - Py_INCREF(SpamError); - PyModule_AddObject(m, "error", SpamError); -} diff --git a/recipes/cpython/all/test_package/py2/test_package.c b/recipes/cpython/all/test_package/py2/test_package.c deleted file mode 100644 index 5e5d839b5a6a1..0000000000000 --- a/recipes/cpython/all/test_package/py2/test_package.c +++ /dev/null @@ -1,12 +0,0 @@ -#include - -int -main(int argc, char *argv[]) -{ - Py_SetProgramName(argv[0]); /* optional but recommended */ - Py_Initialize(); - PyRun_SimpleString("from time import time,ctime\n" - "print 'Today is',ctime(time())\n"); - Py_Finalize(); - return 0; -} diff --git a/recipes/cpython/all/test_package/py3/test_package.c b/recipes/cpython/all/test_package/py3/test_package.c deleted file mode 100644 index f5dfe41cd757c..0000000000000 --- a/recipes/cpython/all/test_package/py3/test_package.c +++ /dev/null @@ -1,21 +0,0 @@ -#define PY_SSIZE_T_CLEAN -#include - -int -main(int argc, char *argv[]) -{ - wchar_t *program = Py_DecodeLocale(argv[0], NULL); - if (program == NULL) { - fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); - exit(1); - } - Py_SetProgramName(program); /* optional but recommended */ - Py_Initialize(); - PyRun_SimpleString("from time import time, ctime\n" - "print('Today is', ctime(time()))\n"); - if (Py_FinalizeEx() < 0) { - exit(120); - } - PyMem_RawFree(program); - return 0; -} diff --git a/recipes/cpython/all/test_package/setup.py b/recipes/cpython/all/test_package/setup.py index cd1754cef8131..2cf4febef6264 100644 --- a/recipes/cpython/all/test_package/setup.py +++ b/recipes/cpython/all/test_package/setup.py @@ -1,5 +1,4 @@ import os -import sys # Hack to work around Python 3.8+ secure dll loading: # see https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew @@ -8,24 +7,14 @@ if os.path.isdir(directory): os.add_dll_directory(directory) -PY2 = (2, 0) <= sys.version_info < (3, 0) -PY3 = (3, 0) <= sys.version_info < (4, 0) - -if PY2: - subdir = "py2" - from distutils.core import setup, Extension -elif PY3: - subdir = "py3" - from setuptools import setup, Extension -else: - raise Exception +from setuptools import setup, Extension +script_dir = os.path.dirname(os.path.realpath(__file__)) setup( name="test_package", version="1.0", - use_2to3=True, ext_modules=[ - Extension("spam", [os.path.join(subdir, "test_module.c")]), + Extension("spam", [os.path.join(script_dir, "test_module.c")]), ], ) diff --git a/recipes/cpython/all/test_package/py3/test_module.c b/recipes/cpython/all/test_package/test_module.c similarity index 100% rename from recipes/cpython/all/test_package/py3/test_module.c rename to recipes/cpython/all/test_package/test_module.c diff --git a/recipes/cpython/all/test_package/test_package.c b/recipes/cpython/all/test_package/test_package.c new file mode 100644 index 0000000000000..cf1688e39502a --- /dev/null +++ b/recipes/cpython/all/test_package/test_package.c @@ -0,0 +1,20 @@ +#define PY_SSIZE_T_CLEAN +#include + +int +main(int argc, char *argv[]) +{ + wchar_t *program = Py_DecodeLocale(argv[0], NULL); + if (program == NULL) { + fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); + exit(1); + } + Py_Initialize(); + PyRun_SimpleString("from time import time, ctime\n" + "print('Today is', ctime(time()))\n"); + if (Py_FinalizeEx() < 0) { + exit(120); + } + PyMem_RawFree(program); + return 0; +} diff --git a/recipes/cpython/all/test_package/test_package.py b/recipes/cpython/all/test_package/test_package.py index f77d2837c6376..bed43fac74c62 100644 --- a/recipes/cpython/all/test_package/test_package.py +++ b/recipes/cpython/all/test_package/test_package.py @@ -14,12 +14,13 @@ def add_test(fn): global ALL_TESTS - name = fn.__name__[fn.__name__.find("_")+1:] + name = fn.__name__[fn.__name__.find("_") + 1 :] def inner_fn(): print("testing {}".format(name)) sys.stdout.flush() fn() + ALL_TESTS[name] = inner_fn return fn @@ -30,13 +31,13 @@ def test_expat(): # 3 handler functions def start_element(name, attrs): - print('Start element:', name, attrs) + print("Start element:", name, attrs) def end_element(name): - print('End element:', name) + print("End element:", name) def char_data(data): - print('Character data:', repr(data)) + print("Character data:", repr(data)) p = xml.parsers.expat.ParserCreate() @@ -44,18 +45,18 @@ def char_data(data): p.EndElementHandler = end_element p.CharacterDataHandler = char_data - p.Parse(""" + p.Parse( + """ Text goes here More text - """, 1) + """, + 1, + ) @add_test def test_gdbm(): - if sys.version_info < (3, 0): - import gdbm - else: - import dbm.gnu as gdbm + import dbm.gnu as gdbm dbfile = "gdbm.db" @@ -85,10 +86,8 @@ def test_spam(): if "This is an example spam doc." not in spam.__doc__: raise Exception("spam.__doc__ does not contain the expected text") - cmd = { - "Windows": "dir", - }.get(platform.system(), "ls") - print("About to run spam.system(\"{}\")".format(cmd)) + cmd = {"Windows": "dir"}.get(platform.system(), "ls") + print('About to run spam.system("{}")'.format(cmd)) sys.stdout.flush() spam.system(cmd) @@ -103,24 +102,6 @@ def test_bz2(): raise Exception("bz2.compress returned no data") -@add_test -def test_bsddb(): - import bsddb - - db = bsddb.btopen("bsddb.db", "c") - db["key1"] = "value1" - db["key2"] = "value2" - db.close() - - db = bsddb.btopen("bsddb.db", "r") - if len(db) != 2: - raise Exception("Wrong length") - if db["key1"] != "value1": - raise Exception("value1 incorrect {}".format(db["key1"])) - if db["key2"] != "value2": - raise Exception("value2 incorrect {}".format(db["key2"])) - - @add_test def test_lzma(): import lzma @@ -133,6 +114,7 @@ def test_lzma(): @add_test def test_sqlite3(): import sqlite3 + conn = sqlite3.connect("sqlite3.db") c = conn.cursor() @@ -141,16 +123,16 @@ def test_sqlite3(): c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") conn.commit() - t = ('RHAT',) - c.execute('SELECT * FROM stocks WHERE symbol=?', t) + t = ("RHAT",) + c.execute("SELECT * FROM stocks WHERE symbol=?", t) # Larger example that inserts many records at a time purchases = [ - ('2006-03-28', 'BUY', 'IBM', 1000, 45.00), - ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00), - ('2006-04-06', 'SELL', 'IBM', 500, 53.00), + ("2006-03-28", "BUY", "IBM", 1000, 45.00), + ("2006-04-05", "BUY", "MSFT", 1000, 72.00), + ("2006-04-06", "SELL", "IBM", 500, 53.00), ] - c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases) + c.executemany("INSERT INTO stocks VALUES (?,?,?,?,?)", purchases) conn.commit() conn.close() conn = sqlite3.connect("sqlite3.db") @@ -161,15 +143,15 @@ def test_sqlite3(): raise Exception("Need 4 stocks") print(data) conn.close() + # Remove the file so subsequent tests don't fail + os.remove("sqlite3.db") @add_test def test_decimal(): - if sys.version_info >= (3, ): - # Check whether the _decimal package was built successfully - import _decimal as decimal - else: - import decimal + # Check whether the _decimal package was built successfully + import _decimal as decimal + decimal.getcontext().prec = 6 print("1/7 =", decimal.Decimal(1) / decimal.Decimal(7)) decimal.getcontext().prec = 40 @@ -199,6 +181,14 @@ def test_tkinter(): print("tk version: {}".format(_tkinter.TK_VERSION)) +@add_test +def test_ssl(): + import ssl + + default_context = ssl.create_default_context() + print("default_context.options={}".format(default_context.options)) + + def main(): parser = argparse.ArgumentParser() parser.add_argument("-b", dest="build_folder", help="build_folder", required=True) diff --git a/recipes/cpython/all/test_v1_package/CMakeLists.txt b/recipes/cpython/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..6014dcdd6efcb --- /dev/null +++ b/recipes/cpython/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,96 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +set(CACHE PY_VERSION_MAJOR "" CACHE STRING "MAJOR version of python") +set(CACHE PY_VERSION_MAJOR_MINOR "" CACHE STRING "MAJOR.MINOR version of python") +set(CACHE PY_VERSION "" CACHE STRING "Required version of python") +set(CACHE PY_VERSION_SUFFIX "" CACHE STRING "Suffix of python") + +set(Python_ADDITIONAL_VERSIONS ${PY_VERSION}${PY_VERSION_SUFFIX} ${PY_VERSION_MAJOR_MINOR}${PY_VERSION_SUFFIX} 3${PY_VERSION_SUFFIX} ${PY_VERSION} ${PY_VERSION_MAJOR_MINOR} 3) +message("Using Python_ADDITIONAL_VERSIONS: ${Python_ADDITIONAL_VERSIONS}") + +find_package(PythonInterp REQUIRED) +find_package(PythonLibs REQUIRED) + +string(FIND "${PYTHON_EXECUTABLE}" "${CONAN_CPYTHON_ROOT}" ROOT_SUBPOS) +if(ROOT_SUBPOS EQUAL -1) + message(FATAL_ERROR "found wrong python interpreter: ${PYTHON_EXECUTABLE}") +endif() + +message(STATUS "FindPythonInterp:") +message(STATUS "PYTHON_VERSION_STRING: ${PYTHON_VERSION_STRING}") +message(STATUS "PYTHON_VERSION_MAJOR: ${PYTHON_VERSION_MAJOR}") +message(STATUS "PYTHON_VERSION_MINOR: ${PYTHON_VERSION_MINOR}") +message(STATUS "PYTHON_VERSION_PATCH: ${PYTHON_VERSION_PATCH}") +message(STATUS "=============================================") +message(STATUS "FindPythonLibs:") +message(STATUS "PYTHON_LIBRARIES: ${PYTHON_LIBRARIES}") +message(STATUS "PYTHON_INCLUDE_PATH: ${PYTHON_INCLUDE_PATH} (deprecated)") +message(STATUS "PYTHON_INCLUDE_DIRS: ${PYTHON_INCLUDE_DIRS}") +message(STATUS "PYTHON_DEBUG_LIBRARIES: ${PYTHON_DEBUG_LIBRARIES} (deprecated)") +message(STATUS "PYTHONLIBS_VERSION_STRING: ${PYTHONLIBS_VERSION_STRING}") + +if(NOT PYTHON_VERSION_STRING AND NOT PYTHONLIBS_VERSION_STRING) + message(FATAL_ERROR "Version of python interpreter and libraries not found") +endif() + +if(PYTHON_VERSION_STRING) + if(NOT PYTHON_VERSION_STRING VERSION_EQUAL "${PY_VERSION}") + message("PYTHON_VERSION_STRING does not match PY_VERSION") + message(FATAL_ERROR "CMake detected wrong cpython version") + endif() +endif() + +if(PYTHONLIBS_VERSION_STRING) + if(NOT PYTHONLIBS_VERSION_STRING STREQUAL "${PY_FULL_VERSION}") + message("PYTHONLIBS_VERSION_STRING does not match PY_FULL_VERSION") + message(FATAL_ERROR "CMake detected wrong cpython version") + endif() +endif() + +option(BUILD_MODULE "Build python module") + +set(SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../test_package") + +if(BUILD_MODULE) + add_library(spam MODULE "${SOURCE_DIR}/test_module.c") + target_include_directories(spam + PRIVATE + ${PYTHON_INCLUDE_DIRS} + ) + target_link_libraries(spam PRIVATE + ${PYTHON_LIBRARIES} + ) + set_property(TARGET spam PROPERTY PREFIX "") + if(MSVC) + if(CONAN_SETTINGS_BUILD_TYPE STREQUAL "Debug") + set(SUFFIX "_d.pyd") + else() + set(SUFFIX ".pyd") + endif() + set_property(TARGET spam PROPERTY SUFFIX "${SUFFIX}") + endif() + + option(USE_FINDPYTHON_X "Use new-style FindPythonX module") + if(USE_FINDPYTHON_X AND NOT (CMAKE_VERSION VERSION_LESS "3.16")) + # Require CMake 3.16 because this version introduces Python3_FIND_ABI + find_package(Python3 REQUIRED COMPONENTS Interpreter Development) + message("Python3_EXECUTABLE: ${Python3_EXECUTABLE}") + message("Python3_INTERPRETER_ID: ${Python3_INTERPRETER_ID}") + message("Python3_VERSION: ${Python3_VERSION}") + message("Python3_INCLUDE_DIRS: ${Python3_INCLUDE_DIRS}") + message("Python3_LIBRARIES: ${Python3_LIBRARIES}") + if(NOT Python3_VERSION STREQUAL "${PY_VERSION}") + message("Python_ADDITIONAL_VERSIONS does not match PY_VERSION") + message(FATAL_ERROR "CMake detected wrong cpython version") + endif() + + python3_add_library(spam2 "${SOURCE_DIR}/test_module.c") + endif() +endif() + +add_executable(${PROJECT_NAME} "${SOURCE_DIR}/test_package.c") +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/cpython/all/test_v1_package/conanfile.py b/recipes/cpython/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..2fdcf049eb972 --- /dev/null +++ b/recipes/cpython/all/test_v1_package/conanfile.py @@ -0,0 +1,160 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools, RunEnvironment +from conans.errors import ConanException +from conan.tools.env import VirtualRunEnv +from io import StringIO +import os +import re + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + @property + def _py_version(self): + return re.match(r"^([0-9.]+)", self.deps_cpp_info["cpython"].version).group(1) + + @property + def _test_setuptools(self): + # TODO Should we still try to test this? + # https://github.com/python/cpython/pull/101039 + return not tools.cross_building(self, skip_x64_x86=True) and self._supports_modules and self._py_version < tools.Version("3.12") + + @property + def _cmake_try_FindPythonX(self): + if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug": + return False + return True + + @property + def _supports_modules(self): + return self.settings.compiler != "Visual Studio" or self.options["cpython"].shared + + def generate(self): + # The build also needs access to the run environment to run the python executable + VirtualRunEnv(self).generate(scope="run") + VirtualRunEnv(self).generate(scope="build") + + def build_requirements(self): + # The main recipe does not require CMake, but we test with it. + # The interesting problem that arises here is if you have CMake installed + # with your global pip, then it will fail to run in this test package. + # To avoid that, just add a requirement on CMake. + self.tool_requires("cmake/[>=3.15 <4]") + + def build(self): + if not tools.cross_building(self, skip_x64_x86=True): + command = "{} --version".format(self.deps_user_info["cpython"].python) + buffer = StringIO() + self.run(command, output=buffer, ignore_errors=True, run_environment=True) + self.output.info("output: %s" % buffer.getvalue()) + self.run(command, run_environment=True) + + cmake = CMake(self) + cmake.definitions["BUILD_MODULE"] = self._supports_modules + cmake.definitions["PY_VERSION_MAJOR_MINOR"] = ".".join(self._py_version.split(".")[:2]) + cmake.definitions["PY_FULL_VERSION"] = self.deps_cpp_info["cpython"].version + cmake.definitions["PY_VERSION"] = self._py_version + cmake.definitions["PY_VERSION_SUFFIX"] = "d" if self.settings.build_type == "Debug" else "" + cmake.definitions["PYTHON_EXECUTABLE"] = self.deps_user_info["cpython"].python + cmake.definitions["USE_FINDPYTHON_X"] = self._cmake_try_FindPythonX + cmake.definitions["Python3_EXECUTABLE"] = self.deps_user_info["cpython"].python + cmake.definitions["Python3_ROOT_DIR"] = self.deps_cpp_info["cpython"].rootpath + cmake.definitions["Python3_USE_STATIC_LIBS"] = not self.options["cpython"].shared + cmake.definitions["Python3_FIND_FRAMEWORK"] = "NEVER" + cmake.definitions["Python3_FIND_REGISTRY"] = "NEVER" + cmake.definitions["Python3_FIND_IMPLEMENTATIONS"] = "CPython" + cmake.definitions["Python3_FIND_STRATEGY"] = "LOCATION" + + with tools.environment_append(RunEnvironment(self).vars): + cmake.configure() + cmake.build() + + if self._test_setuptools: + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + env = { + "DISTUTILS_USE_SDK": "1", + "MSSdk": "1" + } + env.update(**AutoToolsBuildEnvironment(self).vars) + with tools.environment_append(env): + setup_args = [ + os.path.join(self.source_folder, "..", "test_package", "setup.py"), + "build", + "--build-base", self.build_folder, + "--build-platlib", os.path.join(self.build_folder, "lib_setuptools"), + # Bandaid fix: setuptools places temporary files in a subdirectory of the build folder where the + # entirety of the absolute path up to this folder is appended (with seemingly no way to stop this), + # essentially doubling the path length. This may run into Windows max path lengths, so we give ourselves + # a little bit of wiggle room by making this directory name as short as possible. One of the directory + # names goes from (for example) "temp.win-amd64-3.10-pydebug" to "t", saving us roughly 25 characters. + "--build-temp", "t", + ] + if self.settings.build_type == "Debug": + setup_args.append("--debug") + self.run("{} {}".format(self.deps_user_info["cpython"].python, " ".join("\"{}\"".format(a) for a in setup_args)), run_environment=True) + + def _test_module(self, module, should_work): + try: + self.run("{} \"{}/../test_package/test_package.py\" -b \"{}\" -t {} ".format( + self.deps_user_info["cpython"].python, self.source_folder, self.build_folder, module), run_environment=True) + works = True + except ConanException as e: + works = False + exception = e + if should_work == works: + self.output.info("Result of test was expected.") + else: + if works: + raise ConanException("Module '{}' works, but should not have worked".format(module)) + else: + self.output.warn("Module '{}' does not work, but should have worked".format(module)) + raise exception + + def _cpython_option(self, name): + try: + return getattr(self.options["cpython"], name, False) + except ConanException: + return False + + def test(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run("{} -c \"print('hello world')\"".format(self.deps_user_info["cpython"].python), run_environment=True) + + buffer = StringIO() + self.run("{} -c \"import sys; print('.'.join(str(s) for s in sys.version_info[:3]))\"".format(self.deps_user_info["cpython"].python), run_environment=True, output=buffer) + self.output.info(buffer.getvalue()) + version_detected = buffer.getvalue().splitlines()[-1].strip() + if self._py_version != version_detected: + raise ConanException("python reported wrong version. Expected {exp}. Got {res}.".format(exp=self._py_version, res=version_detected)) + + if self._supports_modules: + self._test_module("gdbm", self._cpython_option("with_gdbm")) + self._test_module("bz2", self._cpython_option("with_bz2")) + self._test_module("lzma", self._cpython_option("with_lzma")) + self._test_module("tkinter", self._cpython_option("with_tkinter")) + with tools.environment_append({"TERM": "ansi"}): + self._test_module("curses", self._cpython_option("with_curses")) + + self._test_module("expat", True) + self._test_module("sqlite3", True) + self._test_module("decimal", True) + self._test_module("ctypes", True) + + if tools.is_apple_os(self.settings.os) and not self.options["cpython"].shared: + self.output.info("Not testing the module, because these seem not to work on apple when cpython is built as a static library") + # FIXME: find out why cpython on apple does not allow to use modules linked against a static python + else: + if self._supports_modules: + with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib")]}): + self.output.info("Testing module (spam) using cmake built module") + self._test_module("spam", True) + + if self._test_setuptools: + with tools.environment_append({"PYTHONPATH": [os.path.join(self.build_folder, "lib_setuptools")]}): + self.output.info("Testing module (spam) using setup.py built module") + self._test_module("spam", True) + + # MSVC builds need PYTHONHOME set. Linux and Mac don't require it to be set if tested after building, + # but if the package is relocated then it needs to be set. + with tools.environment_append({"PYTHONHOME": self.deps_user_info["cpython"].pythonhome}): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/cpython/config.yml b/recipes/cpython/config.yml index e3abf3ec8acb2..a2b9627fa470b 100644 --- a/recipes/cpython/config.yml +++ b/recipes/cpython/config.yml @@ -1,11 +1,13 @@ versions: - "3.10.0": + "3.12.7": folder: "all" - "3.9.7": + "3.12.2": folder: "all" - "3.8.12": + "3.11.9": folder: "all" - "3.7.12": + "3.10.14": folder: "all" - "2.7.18": + "3.9.19": + folder: "all" + "3.8.19": folder: "all" diff --git a/recipes/cqrlib/all/CMakeLists.txt b/recipes/cqrlib/all/CMakeLists.txt index 1c86519b249a8..67e09ae1f2b7a 100644 --- a/recipes/cqrlib/all/CMakeLists.txt +++ b/recipes/cqrlib/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(CQRlib LANGUAGES C) add_library(CQRlib ${CQRLIB_SRC_DIR}/cqrlib.c) diff --git a/recipes/cqrlib/all/test_package/CMakeLists.txt b/recipes/cqrlib/all/test_package/CMakeLists.txt index 5e9a386c11d30..7120e0b1e4c44 100644 --- a/recipes/cqrlib/all/test_package/CMakeLists.txt +++ b/recipes/cqrlib/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(cqrlib REQUIRED CONFIG) diff --git a/recipes/cqrlib/all/test_v1_package/CMakeLists.txt b/recipes/cqrlib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b455e3e89e446..0000000000000 --- a/recipes/cqrlib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(cqrlib REQUIRED CONFIG) - -add_executable(${PROJECT_NAME}_c ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME}_c PRIVATE cqrlib::cqrlib) - -add_executable(${PROJECT_NAME}_cpp ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME}_cpp PRIVATE cqrlib::cqrlib) diff --git a/recipes/cqrlib/all/test_v1_package/conanfile.py b/recipes/cqrlib/all/test_v1_package/conanfile.py deleted file mode 100644 index 302285c48aded..0000000000000 --- a/recipes/cqrlib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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_c = os.path.join("bin", "test_package_c") - self.run(bin_path_c, run_environment=True) - bin_path_cpp = os.path.join("bin", "test_package_cpp") - self.run(bin_path_cpp, run_environment=True) diff --git a/recipes/cr/all/conandata.yml b/recipes/cr/all/conandata.yml new file mode 100644 index 0000000000000..caacd3f558624 --- /dev/null +++ b/recipes/cr/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20221105": + url: "https://github.com/fungos/cr/archive/0e7fef63555cf73c70e4d9ae42f8a6e9cefb8e69.zip" + sha256: "43c076800b19cb9f994ee7e77020e79ea2a01257f221d2f6d80e656f2507069e" diff --git a/recipes/cr/all/conanfile.py b/recipes/cr/all/conanfile.py new file mode 100644 index 0000000000000..b6dc7c42f14b8 --- /dev/null +++ b/recipes/cr/all/conanfile.py @@ -0,0 +1,70 @@ +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.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class CrConan(ConanFile): + name = "cr" + description = "cr.h: A Simple C Hot Reload Header-only Library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fungos/cr" + topics = ("hot-reload", "hot-swapping", "live-coding", "gamedev", "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": "7", + "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.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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "cr.h", self.source_folder, 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.extend(["pthread", "dl", "rt"]) + elif is_apple_os(self): + self.cpp_info.system_libs.append("dl") + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("dbghelp") diff --git a/recipes/cr/all/test_package/CMakeLists.txt b/recipes/cr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..420798776cd30 --- /dev/null +++ b/recipes/cr/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(cr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE cr::cr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/cr/all/test_package/conanfile.py b/recipes/cr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/cr/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/cr/all/test_package/test_package.cpp b/recipes/cr/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3be840e09fd11 --- /dev/null +++ b/recipes/cr/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#define CR_HOST +#include + +void dummy() { + cr_plugin ctx; + cr_plugin_open(ctx, "xyz.dll"); + cr_plugin_update(ctx); + cr_plugin_close(ctx); +} + +int main() {} diff --git a/recipes/cr/config.yml b/recipes/cr/config.yml new file mode 100644 index 0000000000000..35012be65fa98 --- /dev/null +++ b/recipes/cr/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221105": + folder: all diff --git a/recipes/crashpad/all/conandata.yml b/recipes/crashpad/all/conandata.yml index 78196c9e613a3..309c5ff4f2de1 100644 --- a/recipes/crashpad/all/conandata.yml +++ b/recipes/crashpad/all/conandata.yml @@ -1,11 +1,4 @@ sources: - "cci.20210507": - crashpad: - url: "https://github.com/chromium/crashpad/archive/d9bc7cf06aef74e928f9afc3dee33b60121b9c73.tar.gz" - sha256: "49f4b10f1de9b6d33743eccecace6b0fc9d7fe92e5e550ba5e099e6db9a11f0f" - mini_chromium: - url: "https://github.com/chromium/mini_chromium/archive/ccb198907cecf072d8f5b2543d4d348e834a298a.tar.gz" - sha256: "f40a77a4580cd1cb9af71602917a0e85b62bf0f74641b6ed81dd9fb2f2012ea9" "cci.20220219": crashpad: url: "https://github.com/chromium/crashpad/archive/e9937cb36cd12f24d73a07c4b91168cf1885b5db.tar.gz" @@ -14,36 +7,13 @@ sources: url: "https://github.com/chromium/mini_chromium/archive/822fada4a9972e3e2f36a981da770539025beb0a.tar.gz" sha256: "2c3bf30d324fcb60eeef84dd6aaf7fb75b70e37bdb3716ab3ea10cda51c4b05c" patches: - "cci.20210507": - - patch_file: "patches/cci.20210507-0001-fix-openssl-link-order.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0003-compilers-from-env.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0005-allow-all-archs.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch" - base_path: "source_subfolder" - - patch_file: "patches/cci.20210507-0007-use-system-zlib.patch" - base_path: "source_subfolder" "cci.20220219": - patch_file: "patches/cci.20220219-0001-fix-openssl-link-order.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0002-remove-fPIC-Werror-LTO.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0003-compilers-from-env.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0004-use-conan-linux-syscall-support-package.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0005-allow-all-archs.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0006-mini_chromium-win_helper-py3.patch" - base_path: "source_subfolder" - # reused patch from cci.20210507 + # reused patch from cci.20210507 - patch_file: "patches/cci.20210507-0007-use-system-zlib.patch" - base_path: "source_subfolder" - patch_file: "patches/cci.20220219-0007-static-lib-tool_support.patch" - base_path: "source_subfolder" diff --git a/recipes/crashpad/all/conanfile.py b/recipes/crashpad/all/conanfile.py index 42d603abefb4c..7b7d6c74f963c 100644 --- a/recipes/crashpad/all/conanfile.py +++ b/recipes/crashpad/all/conanfile.py @@ -1,21 +1,30 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from contextlib import contextmanager +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, save, chdir +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +from conan.tools.apple import XCRun, is_apple_os +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.microsoft import VCVars, is_msvc +from conan.tools.gnu import AutotoolsDeps, AutotoolsToolchain + + import os import textwrap -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.64.0" class CrashpadConan(ConanFile): name = "crashpad" description = "Crashpad is a crash-reporting system." url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "crashpad", "crash", "error", "stacktrace", "collecting", "reporting") + topics = ("crashpad", "crash", "error", "stacktrace", "collecting", "reporting") license = "Apache-2.0" homepage = "https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md" - provides = "crashpad", "mini_chromium" + provides = "mini_chromium" settings = "os", "arch", "compiler", "build_type" + package_type = "static-library" options = { "fPIC": [True, False], "http_transport": ["libcurl", "socket", None], @@ -26,17 +35,16 @@ class CrashpadConan(ConanFile): "http_transport": None, "with_tls": "openssl", } - exports_sources = "patches/*" - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def _minimum_compiler_cxx14(self): return { "apple-clang": 10, "gcc": 5, "clang": "3.9", + "msvc": "190", "Visual Studio": 14, }.get(str(self.settings.compiler)) @@ -49,46 +57,46 @@ def config_options(self): self.options.http_transport = "socket" def build_requirements(self): - self.build_requires("ninja/1.10.2") - self.build_requires("gn/cci.20210429") + self.tool_requires("ninja/1.10.2") + self.tool_requires("gn/cci.20210429") def requirements(self): # FIXME: use mini_chromium conan package instead of embedded package (if possible) - self.requires("zlib/1.2.12") + self.requires("zlib/[>=1.2.12 <2]") if self.settings.os in ("Linux", "FreeBSD"): self.requires("linux-syscall-support/cci.20200813") if self.options.http_transport != "socket": del self.options.with_tls if self.options.http_transport == "libcurl": - self.requires("libcurl/7.82.0") + self.requires("libcurl/[>=7.78 <9]") if self.options.get_safe("with_tls") == "openssl": - self.requires("openssl/1.1.1o") + self.requires("openssl/[>=1.1 <4]") def validate(self): - if self.settings.compiler == "Visual Studio": + if is_msvc(self): if self.options.http_transport in ("libcurl", "socket"): raise ConanInvalidConfiguration("http_transport={} is not valid when building with Visual Studio".format(self.options.http_transport)) if self.options.http_transport == "libcurl": - if not self.options["libcurl"].shared: + if not self.dependencies["libcurl"].options.shared: # FIXME: is this true? - self.output.warn("crashpad needs a shared libcurl library") + self.output.warning("crashpad needs a shared libcurl library") min_compiler_version = self._minimum_compiler_cxx14() if min_compiler_version: - if tools.Version(self.settings.compiler.version) < min_compiler_version: + if Version(self.settings.compiler.version) < min_compiler_version: raise ConanInvalidConfiguration("crashpad needs a c++14 capable compiler, version >= {}".format(min_compiler_version)) else: - self.output.warn("This recipe does not know about the current compiler and assumes it has sufficient c++14 supports.") + self.output.warning("This recipe does not know about the current compiler and assumes it has sufficient c++14 supports.") if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, 14) def source(self): - tools.get(**self.conan_data["sources"][self.version]["crashpad"], destination=self._source_subfolder, strip_root=True) - tools.get(**self.conan_data["sources"][self.version]["mini_chromium"], - destination=os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium"), strip_root=True) + get(self, **self.conan_data["sources"][self.version]["crashpad"], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version]["mini_chromium"], + destination=os.path.join(self.source_folder, "third_party", "mini_chromium", "mini_chromium"), strip_root=True) @property def _gn_os(self): - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): if self.settings.os == "Macos": return "mac" else: @@ -105,31 +113,18 @@ def _gn_arch(self): "x86": "x86", }.get(str(self.settings.arch), str(self.settings.arch)) - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - yield - else: - env_defaults = {} - if self.settings.compiler == "gcc": - env_defaults.update({ - "CC": "gcc", - "CXX": "g++", - "LD": "g++", - }) - elif self.settings.compiler in ("clang", "apple-clang"): - env_defaults.update({ - "CC": "clang", - "CXX": "clang++", - "LD": "clang++", - }) - env = {} - for key, value in env_defaults.items(): - if not tools.get_env(key): - env[key] = value - with tools.environment_append(env): - yield + def generate(self): + VCVars(self).generate() + env = Environment() + if self.settings.compiler == "gcc": + env.define("CC", "gcc") + env.define("CXX", "g++") + env.define("LD", "g++") + elif str(self.settings.compiler) in ("clang", "apple-clang"): + env.define("CC", "clang") + env.define("CXX", "clang++") + env.define("LD", "clang++") + env.vars(self).save_script("conanbuild_gn") @property def _http_transport_impl(self): @@ -138,40 +133,31 @@ def _http_transport_impl(self): else: return str(self.options.http_transport) - def _version_greater_equal_to_cci_20220219(self): - return self.version >= "cci.20220219" - - def _has_separate_util_net_lib(self): - return self._version_greater_equal_to_cci_20220219() - - def _needs_to_link_tool_support(self): - return self._version_greater_equal_to_cci_20220219() - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + apply_conandata_patches(self) - if self.settings.compiler == "Visual Studio": - tools.replace_in_file(os.path.join(self._source_subfolder, "third_party", "zlib", "BUILD.gn"), + if is_msvc(self): + replace_in_file(self, os.path.join(self.source_folder, "third_party", "zlib", "BUILD.gn"), "libs = [ \"z\" ]", - "libs = [ {} ]".format(", ".join("\"{}.lib\"".format(l) for l in self.deps_cpp_info["zlib"].libs))) + "libs = [ \"zlib.lib\" ]") if self.settings.compiler == "gcc": - toolchain_path = os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium", "build", "config", "BUILD.gn") + toolchain_path = os.path.join(self.source_folder, "third_party", "mini_chromium", "mini_chromium", "build", "config", "BUILD.gn") # Remove gcc-incompatible compiler arguments for comp_arg in ("-Wheader-hygiene", "-Wnewline-eof", "-Wstring-conversion", "-Wexit-time-destructors", "-fobjc-call-cxx-cdtors", "-Wextra-semi", "-Wimplicit-fallthrough"): - tools.replace_in_file(toolchain_path, - "\"{}\"".format(comp_arg), "\"\"") + replace_in_file(self, toolchain_path, "\"{}\"".format(comp_arg), "\"\"") + + deps = AutotoolsDeps(self).vars() + tc = AutotoolsToolchain(self).vars() + def _get_flags(name): + return [f for f in filter(None, [tc.get(name), deps.get(name)])] - autotools = AutoToolsBuildEnvironment(self) - extra_cflags = autotools.flags + ["-D{}".format(d) for d in autotools.defines] + extra_cflags = _get_flags("CPPFLAGS") extra_cflags_c = [] - extra_cflags_cc = autotools.cxx_flags - extra_ldflags = autotools.link_flags + extra_cflags_cc = _get_flags("CXXFLAGS") + extra_ldflags = _get_flags("LDFLAGS") + _get_flags("LIBS") if self.options.get_safe("fPIC"): extra_cflags.append("-fPIC") - extra_cflags.extend("-I {}".format(inc) for inc in autotools.include_paths) - extra_ldflags.extend("-{}{}".format("LIBPATH:" if self.settings.compiler == "Visual Studio" else "L ", libdir) for libdir in autotools.library_paths) if self.settings.compiler == "clang": if self.settings.compiler.get_safe("libcxx"): stdlib = { @@ -190,47 +176,46 @@ def build(self): "extra_cflags_cc=\\\"{}\\\"".format(" ".join(extra_cflags_cc)), "extra_ldflags=\\\"{}\\\"".format(" ".join(extra_ldflags)), ] - with tools.chdir(self._source_subfolder): - with self._build_context(): - self.run("gn gen out/Default --args=\"{}\"".format(" ".join(gn_args)), run_environment=True) - targets = ["client", "minidump", "crashpad_handler", "snapshot"] - if self.settings.os == "Windows": - targets.append("crashpad_handler_com") - self.run("ninja -C out/Default {targets} -j{parallel}".format( - targets=" ".join(targets), - parallel=tools.cpu_count()), run_environment=True) + with chdir(self, self.source_folder): + self.run("gn gen out/Default --args=\"{}\"".format(" ".join(gn_args))) + targets = ["client", "minidump", "crashpad_handler", "snapshot"] + if self.settings.os == "Windows": + targets.append("crashpad_handler_com") + self.run("ninja -C out/Default {targets} -j{parallel}".format( + targets=" ".join(targets), + parallel=os.cpu_count())) def lib_filename(name): - prefix, suffix = ("", ".lib") if self.settings.compiler == "Visual Studio" else ("lib", ".a") + prefix, suffix = ("", ".lib") if is_msvc(self) else ("lib", ".a") return "{}{}{}".format(prefix, name, suffix) - tools.rename(os.path.join(self._source_subfolder, "out", "Default", "obj", "client", lib_filename("common")), - os.path.join(self._source_subfolder, "out", "Default", "obj", "client", lib_filename("client_common"))) - tools.rename(os.path.join(self._source_subfolder, "out", "Default", "obj", "handler", lib_filename("common")), - os.path.join(self._source_subfolder, "out", "Default", "obj", "handler", lib_filename("handler_common"))) + rename(self, os.path.join(self.source_folder, "out", "Default", "obj", "client", lib_filename("common")), + os.path.join(self.source_folder, "out", "Default", "obj", "client", lib_filename("client_common"))) + rename(self, os.path.join(self.source_folder, "out", "Default", "obj", "handler", lib_filename("common")), + os.path.join(self.source_folder, "out", "Default", "obj", "handler", lib_filename("handler_common"))) 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")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "client"), dst=os.path.join("include", "client")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "util"), dst=os.path.join("include", "util")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium", "base"), dst=os.path.join("include", "base")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "third_party", "mini_chromium", "mini_chromium", "build"), dst=os.path.join("include", "build")) - self.copy("*.h", src=os.path.join(self._source_subfolder, "out", "Default", "gen", "build"), dst=os.path.join("include", "build")) + copy(self, "*.h", src=os.path.join(self.source_folder, "client"), dst=os.path.join(self.package_folder, "include", "client")) + copy(self, "*.h", src=os.path.join(self.source_folder, "util"), dst=os.path.join(self.package_folder, "include", "util")) + copy(self, "*.h", src=os.path.join(self.source_folder, "third_party", "mini_chromium", "mini_chromium", "base"), dst=os.path.join(self.package_folder, "include", "base")) + copy(self, "*.h", src=os.path.join(self.source_folder, "third_party", "mini_chromium", "mini_chromium", "build"), dst=os.path.join(self.package_folder, "include", "build")) + copy(self, "*.h", src=os.path.join(self.source_folder, "out", "Default", "gen", "build"), dst=os.path.join(self.package_folder, "include", "build")) - self.copy("*.a", src=os.path.join(self._source_subfolder, "out", "Default"), dst="lib", keep_path=False) + copy(self, "*.a", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "lib"), keep_path=False) - self.copy("*.lib", src=os.path.join(self._source_subfolder, "out", "Default"), dst="lib", keep_path=False) - self.copy("crashpad_handler", src=os.path.join(self._source_subfolder, "out", "Default"), dst="bin", keep_path=False) - self.copy("crashpad_handler.exe", src=os.path.join(self._source_subfolder, "out", "Default"), dst="bin", keep_path=False) - self.copy("crashpad_handler_com.com", src=os.path.join(self._source_subfolder, "out", "Default"), dst="bin", keep_path=False) + copy(self, "*.lib", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "crashpad_handler", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "crashpad_handler.exe", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "crashpad_handler_com.com", src=os.path.join(self.source_folder, "out", "Default"), dst=os.path.join(self.package_folder, "bin"), keep_path=False) if self.settings.os == "Windows": - tools.rename(os.path.join(self.package_folder, "bin", "crashpad_handler_com.com"), + rename(self, os.path.join(self.package_folder, "bin", "crashpad_handler_com.com"), os.path.join(self.package_folder, "bin", "crashpad_handler.com")) # Remove accidentally copied libraries. These are used by the executables, not by the libraries. - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*getopt*") + rm(self, "*getopt*", os.path.join(self.package_folder, "lib"), recursive=True) - tools.save(os.path.join(self.package_folder, "lib", "cmake", "crashpad-cxx.cmake"), + save(self, os.path.join(self.package_folder, "lib", "cmake", "crashpad-cxx.cmake"), textwrap.dedent("""\ if(TARGET crashpad::mini_chromium_base) target_compile_features(crashpad::mini_chromium_base INTERFACE cxx_std_14) @@ -239,9 +224,9 @@ def package(self): def package_info(self): self.cpp_info.components["mini_chromium_base"].libs = ["base"] - self.cpp_info.components["mini_chromium_base"].build_modules = [os.path.join(self.package_folder, "lib", "cmake", "crashpad-cxx.cmake")] + self.cpp_info.set_property("cmake_build_modules", [os.path.join(self.package_folder, "lib", "cmake", "crashpad-cxx.cmake")]) self.cpp_info.components["mini_chromium_base"].builddirs = [os.path.join("lib", "cmake")] - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): if self.settings.os == "Macos": self.cpp_info.components["mini_chromium_base"].frameworks = ["ApplicationServices", "CoreFoundation", "Foundation", "IOKit", "Security"] else: # iOS @@ -249,7 +234,7 @@ def package_info(self): self.cpp_info.components["util"].libs = ["util"] self.cpp_info.components["util"].requires = ["mini_chromium_base", "zlib::zlib"] - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): self.cpp_info.components["util"].libs.append("mig_output") if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.components["util"].libs.append("compat") @@ -277,7 +262,7 @@ def package_info(self): self.cpp_info.components["snapshot"].libs = ["snapshot"] self.cpp_info.components["snapshot"].requires = ["context", "client_common", "mini_chromium_base", "util"] - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): self.cpp_info.components["snapshot"].frameworks.extend(["OpenCL"]) self.cpp_info.components["format"].libs = ["format"] @@ -286,15 +271,11 @@ def package_info(self): self.cpp_info.components["minidump"].libs = ["minidump"] self.cpp_info.components["minidump"].requires = ["snapshot", "mini_chromium_base", "util"] - extra_handler_common_req = [] - if self._has_separate_util_net_lib(): - self.cpp_info.components["net"].libs = ["net"] - extra_handler_common_req = ["net"] + self.cpp_info.components["net"].libs = ["net"] + extra_handler_common_req = ["net"] - extra_handler_req = [] - if self._needs_to_link_tool_support(): - self.cpp_info.components["tool_support"].libs = ["tool_support"] - extra_handler_req = ["tool_support"] + self.cpp_info.components["tool_support"].libs = ["tool_support"] + extra_handler_req = ["tool_support"] self.cpp_info.components["handler_common"].libs = ["handler_common"] self.cpp_info.components["handler_common"].requires = ["client_common", "snapshot", "util"] + extra_handler_common_req @@ -303,5 +284,4 @@ def package_info(self): self.cpp_info.components["handler"].requires = ["client", "util", "handler_common", "minidump", "snapshot"] + extra_handler_req 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/crashpad/all/patches/cci.20210507-0001-fix-openssl-link-order.patch b/recipes/crashpad/all/patches/cci.20210507-0001-fix-openssl-link-order.patch deleted file mode 100644 index fa25c29585519..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0001-fix-openssl-link-order.patch +++ /dev/null @@ -1,23 +0,0 @@ -Order of ssl and crypto is wrong (first ssl, then crypto) ---- util/BUILD.gn -+++ util/BUILD.gn -@@ -402,8 +402,8 @@ - deps += [ "//third_party/boringssl" ] - } else { - libs = [ -- "crypto", - "ssl", -+ "crypto", - ] - } - } -@@ -670,8 +670,8 @@ - deps += [ "//third_party/boringssl" ] - } else { - libs = [ -- "crypto", - "ssl", -+ "crypto", - ] - } - } diff --git a/recipes/crashpad/all/patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch b/recipes/crashpad/all/patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch deleted file mode 100644 index dbe02c56b50c4..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0002-remove-fPIC-Werror-LTO.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -+++ third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -@@ -103,7 +103,7 @@ - } - } else if (mini_chromium_is_win) { - cflags = [ -- "/GL", # LTCG. -+ # LTCG. - "/O2", - "/Ob2", # Both explicit and auto inlining. - "/Oy-", # Disable omitting frame pointers, must be after /O2. -@@ -113,9 +113,9 @@ - ldflags = [ - "/OPT:ICF", - "/OPT:REF", -- "/LTCG", -+ - ] -- arflags = [ "/LTCG" ] -+ arflags = [ ] - } - } - -@@ -128,7 +128,7 @@ - cflags = [ - "-Wall", - "-Wendif-labels", -- "-Werror", -+ - "-Wextra", - "-Wextra-semi", - "-Wheader-hygiene", -@@ -239,7 +239,7 @@ - "/D_UNICODE", - "/FS", - "/W4", -- "/WX", -+ - "/Zi", - "/bigobj", # Support larger number of sections in obj file. - "/wd4100", # Unreferenced formal parameter. -@@ -319,7 +319,7 @@ - - if ((mini_chromium_is_posix && !mini_chromium_is_mac && - !mini_chromium_is_ios) || mini_chromium_is_fuchsia) { -- cflags += [ "-fPIC" ] -+ - ldflags += [ - # This must follow Fuchsia’s fdio library above. - "-Wl,--as-needed", ---- third_party/mini_chromium/mini_chromium/build/common.gypi -+++ third_party/mini_chromium/mini_chromium/build/common.gypi -@@ -124,7 +124,7 @@ - - ['OS=="linux" or OS=="android"', { - 'cflags': [ -- '-fPIC', -+ - '-fno-exceptions', - '-fno-strict-aliasing', # See http://crbug.com/32204 - '-fstack-protector-all', # Implies -fstack-protector -@@ -148,7 +148,7 @@ - '_FILE_OFFSET_BITS=64', - ], - 'ldflags': [ -- '-fPIC', -+ - '-pthread', - '-Wl,--as-needed', - '-Wl,-z,noexecstack', diff --git a/recipes/crashpad/all/patches/cci.20210507-0003-compilers-from-env.patch b/recipes/crashpad/all/patches/cci.20210507-0003-compilers-from-env.patch deleted file mode 100644 index 3d2fca3db7ec9..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0003-compilers-from-env.patch +++ /dev/null @@ -1,14 +0,0 @@ -Allow compiling crashpad with gcc (fetch compiler from environment variables) ---- third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -+++ third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -@@ -393,8 +393,8 @@ - ar = rebase_path(clang_path, root_build_dir) + "/bin/llvm-ar" - ld = cxx - } else { -- cc = "clang" -- cxx = "clang++" -+ cc = getenv("CC") -+ cxx = getenv("CXX") - asm = cxx - ld = cxx - diff --git a/recipes/crashpad/all/patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch b/recipes/crashpad/all/patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch deleted file mode 100644 index 849ed17734c92..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0004-use-conan-linux-syscall-support-package.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- third_party/lss/lss.h -+++ third_party/lss/lss.h -@@ -16,9 +16,9 @@ - #define CRASHPAD_THIRD_PARTY_LSS_LSS_H_ - - #if defined(CRASHPAD_LSS_SOURCE_EXTERNAL) --#include "third_party/lss/linux_syscall_support.h" -+#include - #elif defined(CRASHPAD_LSS_SOURCE_EMBEDDED) --#include "third_party/lss/lss/linux_syscall_support.h" -+#include - #else - #error Unknown lss source - #endif diff --git a/recipes/crashpad/all/patches/cci.20210507-0005-allow-all-archs.patch b/recipes/crashpad/all/patches/cci.20210507-0005-allow-all-archs.patch deleted file mode 100644 index ae7425fb742f1..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0005-allow-all-archs.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -+++ third_party/mini_chromium/mini_chromium/build/config/BUILD.gn -@@ -193,7 +193,7 @@ - "arm64", - ] - } else { -- assert(false, "Unsupported architecture") -+ print("Unknown architecture -> assume conan knows how to handle it") - } - } - -@@ -268,7 +268,7 @@ - "-m64", - ] - } else { -- assert(false, "Unsupported architecture") -+ print("Unknown architecture -> assume conan knows how to handle it") - } - - # This is currently required by the clang toolchain build that DEPS uses -@@ -302,7 +302,7 @@ - } else if (target_cpu == "x64") { - common_flags += [ "--target=x86_64-fuchsia" ] - } else { -- assert(false, "Unsupported architecture") -+ print("Unknown architecture -> assume conan knows how to handle it") - } - - # fdio is listed in ldflags instead of libs because it’s important for it to ---- util/BUILD.gn -+++ util/BUILD.gn -@@ -145,7 +145,7 @@ if (crashpad_is_mac || crashpad_is_ios) { - "arm64", - ] - } else { -- assert(false, "Unsupported architecture") -+ print("Unknown architecture -> assume conan knows how to handle it") - } - } - diff --git a/recipes/crashpad/all/patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch b/recipes/crashpad/all/patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch deleted file mode 100644 index be8423bbda8e1..0000000000000 --- a/recipes/crashpad/all/patches/cci.20210507-0006-mini_chromium-win_helper-py3.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- third_party/mini_chromium/mini_chromium/build/win_helper.py -+++ third_party/mini_chromium/mini_chromium/build/win_helper.py -@@ -4,7 +4,10 @@ - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. - --import _winreg -+try: -+ import _winreg -+except ImportError: -+ import winreg as _winreg - import os - import re - import subprocess -@@ -62,7 +65,7 @@ - CreateProcess() documentation for more details.""" - block = '' - nul = '\0' -- for key, value in envvar_dict.iteritems(): -+ for key, value in envvar_dict.items(): - block += key + '=' + value + nul - block += nul - return block -@@ -81,7 +84,7 @@ - archs = ('x86', 'amd64', 'arm64') - result = [] - for arch in archs: -- # Extract environment variables for subprocesses. -+ sys.stderr.write("install_dir {} script_path {}".format(install_dir, script_path)) - args = [os.path.join(install_dir, script_path)] - script_arch_name = arch - if script_path.endswith('SetEnv.cmd') and arch == 'amd64': -@@ -94,12 +97,12 @@ - variables, _ = popen.communicate() - if popen.returncode != 0: - raise Exception('"%s" failed with error %d' % (args, popen.returncode)) -- env = _ExtractImportantEnvironment(variables) -+ env = _ExtractImportantEnvironment(variables.decode()) - - env_block = _FormatAsEnvironmentBlock(env) - basename = 'environment.' + arch - with open(os.path.join(out_dir, basename), 'wb') as f: -- f.write(env_block) -+ f.write(env_block.encode()) - result.append(basename) - return result - -@@ -139,10 +142,10 @@ - link = subprocess.Popen(args, env=env, shell=True, stdout=subprocess.PIPE) - out, _ = link.communicate() - for line in out.splitlines(): -- if (not line.startswith(' Creating library ') and -- not line.startswith('Generating code') and -- not line.startswith('Finished generating code')): -- print line -+ if (not line.startswith(b' Creating library ') and -+ not line.startswith(b'Generating code') and -+ not line.startswith(b'Finished generating code')): -+ print(line) - return link.returncode - - def ExecAsmWrapper(self, arch, *args): -@@ -152,11 +155,11 @@ - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - out, _ = popen.communicate() - for line in out.splitlines(): -- if (not line.startswith('Copyright (C) Microsoft Corporation') and -- not line.startswith('Microsoft (R) Macro Assembler') and -- not line.startswith(' Assembling: ') and -+ if (not line.startswith(b'Copyright (C) Microsoft Corporation') and -+ not line.startswith(b'Microsoft (R) Macro Assembler') and -+ not line.startswith(b' Assembling: ') and - line): -- print line -+ print(line) - return popen.returncode - - def ExecGetVisualStudioData(self, outdir, toolchain_path): -@@ -178,7 +181,7 @@ - 'Microsoft Visual Studio', 'Installer', 'vswhere.exe') - if os.path.exists(vswhere_path): - installation_path = subprocess.check_output( -- [vswhere_path, '-latest', '-property', 'installationPath']).strip() -+ [vswhere_path, '-latest', '-property', 'installationPath']).strip().decode() - if installation_path: - return (installation_path, - os.path.join('VC', 'Auxiliary', 'Build', 'vcvarsall.bat')) -@@ -207,7 +210,7 @@ - x86_environment_file = "%s" - x64_environment_file = "%s" - arm64_environment_file = "%s"''' % (install_dir, x86_file, x64_file, arm64_file) -- print result -+ print(result) - return 0 - - def ExecStamp(self, path): diff --git a/recipes/crashpad/all/test_package/CMakeLists.txt b/recipes/crashpad/all/test_package/CMakeLists.txt index 6c1d84c7e3d82..371eb858142f4 100644 --- a/recipes/crashpad/all/test_package/CMakeLists.txt +++ b/recipes/crashpad/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(crashpad REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE crashpad::crashpad) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/crashpad/all/test_package/conanfile.py b/recipes/crashpad/all/test_package/conanfile.py index a0d87c14b0333..46a8950cd70ed 100644 --- a/recipes/crashpad/all/test_package/conanfile.py +++ b/recipes/crashpad/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 +from conan.tools.files import mkdir, save, load 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 generate(self): + save(self, os.path.join(self.generators_folder, "bindir"), + os.path.join(self.dependencies["crashpad"].package_folder, "bin")) def build(self): cmake = CMake(self) @@ -12,14 +26,14 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): test_env_dir = "test_env" - tools.mkdir(test_env_dir) - bin_path = os.path.join("bin", "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["crashpad"].rootpath, "bin", handler_exe) - self.run("%s %s/db %s" % (bin_path, test_env_dir, handler_bin_path), run_environment=True) + mkdir(self, test_env_dir) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + bindir = load(self, os.path.join(self.generators_folder, "bindir")) + handler_exe = "crashpad_handler" + (".exe" if self.settings.os == "Windows" else "") + handler_bin_path = os.path.join(bindir, handler_exe) + self.run(f"{bin_path} {test_env_dir}/db {handler_bin_path}", env="conanrun") if self.settings.os == "Windows": - handler_exe = "crashpad_handler.com" - handler_bin_path = os.path.join(self.deps_cpp_info["crashpad"].rootpath, "bin", handler_exe) - self.run("%s %s/db %s" % (bin_path, test_env_dir, handler_bin_path), run_environment=True) + handler_bin_path = os.path.join(bindir, "crashpad_handler.com") + self.run(f"{bin_path} {test_env_dir}/db {handler_bin_path}", env="conanrun") diff --git a/recipes/crashpad/config.yml b/recipes/crashpad/config.yml index 104465b6c7315..63942e1b1104b 100644 --- a/recipes/crashpad/config.yml +++ b/recipes/crashpad/config.yml @@ -1,5 +1,3 @@ versions: - "cci.20210507": - folder: all "cci.20220219": folder: all diff --git a/recipes/crc32c/all/test_package/CMakeLists.txt b/recipes/crc32c/all/test_package/CMakeLists.txt index 4bb96eb2a3d2f..6650b51d30a59 100644 --- a/recipes/crc32c/all/test_package/CMakeLists.txt +++ b/recipes/crc32c/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(Crc32c CONFIG REQUIRED) diff --git a/recipes/crc32c/all/test_v1_package/CMakeLists.txt b/recipes/crc32c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/crc32c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/crc32c/all/test_v1_package/conanfile.py b/recipes/crc32c/all/test_v1_package/conanfile.py deleted file mode 100644 index 968e0fcd39136..0000000000000 --- a/recipes/crc32c/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_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/all/test_package/CMakeLists.txt b/recipes/crc_cpp/all/test_package/CMakeLists.txt index ba67401c34bcc..9a04729bbab5d 100644 --- a/recipes/crc_cpp/all/test_package/CMakeLists.txt +++ b/recipes/crc_cpp/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(crc_cpp REQUIRED CONFIG) diff --git a/recipes/crc_cpp/all/test_v1_package/CMakeLists.txt b/recipes/crc_cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/crc_cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/crc_cpp/all/test_v1_package/conanfile.py b/recipes/crc_cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/crc_cpp/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_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/crcpp/all/conandata.yml b/recipes/crcpp/all/conandata.yml new file mode 100644 index 0000000000000..f414dda91410c --- /dev/null +++ b/recipes/crcpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.0.0": + url: "https://github.com/d-bahr/CRCpp/archive/refs/tags/release-1.2.0.0.tar.gz" + sha256: "382d399b939207d81537a874ec4b05abc7f59772be58425a0dd048711d43db14" diff --git a/recipes/crcpp/all/conanfile.py b/recipes/crcpp/all/conanfile.py new file mode 100644 index 0000000000000..3315a073a6447 --- /dev/null +++ b/recipes/crcpp/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 CRCPPConan(ConanFile): + name = "crcpp" + description = "Easy to use and fast C++ CRC library." + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/d-bahr/CRCpp/" + topics = ("crc", "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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + os.path.join(self.source_folder, "inc"), + 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/crcpp/all/test_package/CMakeLists.txt b/recipes/crcpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..365caf83cf9bb --- /dev/null +++ b/recipes/crcpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(crcpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE crcpp::crcpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/crcpp/all/test_package/conanfile.py b/recipes/crcpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/crcpp/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/crcpp/all/test_package/test_package.cpp b/recipes/crcpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4546a70d708c2 --- /dev/null +++ b/recipes/crcpp/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include +#include "CRC.h" + + +int main(void) { + const char myString[] = { 'H', 'E', 'L', 'L', 'O', ' ', 'W', 'O', 'R', 'L', 'D' }; + + std::uint32_t crc = CRC::Calculate(myString, sizeof(myString), CRC::CRC_32()); + + std::cout << std::hex << crc; + + return 0; +} diff --git a/recipes/crcpp/config.yml b/recipes/crcpp/config.yml new file mode 100644 index 0000000000000..f3be59d8c2e85 --- /dev/null +++ b/recipes/crcpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.0.0": + folder: all diff --git a/recipes/create-dmg/all/test_v1_package/conanfile.py b/recipes/create-dmg/all/test_v1_package/conanfile.py deleted file mode 100644 index 3d9d911ea4f98..0000000000000 --- a/recipes/create-dmg/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -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("create-dmg --version", run_environment=True) diff --git a/recipes/croncpp/all/conandata.yml b/recipes/croncpp/all/conandata.yml index 7f25de8a50772..30cf4b9d03ad4 100644 --- a/recipes/croncpp/all/conandata.yml +++ b/recipes/croncpp/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "cci.20220503": - url: "https://github.com/mariusbancila/croncpp/archive/5c28f410db1af9507ef8469c9796a7070e5e8e2e.tar.gz" - sha256: "cabc480c78ebf12b11bd9fcd705a7ecb1c85ac88a8c9debe8de67f30abd808a8" + "2023.03.30": + url: "https://github.com/mariusbancila/croncpp/archive/refs/tags/v2023.03.30.tar.gz" + sha256: "0731b7f900a670c009585eb5e9639722aeff6531dbbd5bfc9ce895459733837e" diff --git a/recipes/croncpp/all/conanfile.py b/recipes/croncpp/all/conanfile.py index ffab100ea6a29..7c51f39f65111 100644 --- a/recipes/croncpp/all/conanfile.py +++ b/recipes/croncpp/all/conanfile.py @@ -1,9 +1,8 @@ -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 +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os required_conan_version = ">=1.52.0" @@ -25,7 +24,7 @@ def _min_cppstd(self): return 11 def layout(self): - cmake_layout(self, src_folder="src") + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() @@ -37,21 +36,18 @@ def validate(self): 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): - 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")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + 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", "croncpp") + self.cpp_info.set_property("cmake_target_name","croncpp::croncpp") diff --git a/recipes/croncpp/config.yml b/recipes/croncpp/config.yml index 162ec03638ac6..858a21517c5cd 100644 --- a/recipes/croncpp/config.yml +++ b/recipes/croncpp/config.yml @@ -1,3 +1,3 @@ versions: - "cci.20220503": + "2023.03.30": folder: "all" diff --git a/recipes/crossdb/all/conandata.yml b/recipes/crossdb/all/conandata.yml new file mode 100644 index 0000000000000..37ed5c22fe039 --- /dev/null +++ b/recipes/crossdb/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.11.0": + url: "https://github.com/crossdb-org/crossdb/archive/refs/tags/0.11.0.tar.gz" + sha256: "ca72397cfe14317b3774988fe1747bfd3daa8b6dfa8e151fa84d2e58987ab5c2" + "0.10.0": + url: "https://github.com/crossdb-org/crossdb/archive/refs/tags/0.10.0.tar.gz" + sha256: "8b4ed2063f508bc3353d6346a7d9bf78bb04fe05ddfe6e86f1f33cc44f71b2d4" + "0.9.0": + url: "https://github.com/crossdb-org/crossdb/archive/refs/tags/0.9.0.tar.gz" + sha256: "04defc43f0b5102cc6a341ba9e328302416982c04cc4c59bc16aef19cc1b020c" diff --git a/recipes/crossdb/all/conanfile.py b/recipes/crossdb/all/conanfile.py new file mode 100644 index 0000000000000..ff7c7497a7a9e --- /dev/null +++ b/recipes/crossdb/all/conanfile.py @@ -0,0 +1,58 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +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.tools.apple import fix_apple_shared_install_name +from conan.tools.scm import Version +import os + +required_conan_version = ">=2.1" + +class CrossDBConan(ConanFile): + name = "crossdb" + description = "Ultra High-performance Lightweight Embedded and Server OLTP RDBMS" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/crossdb-org/crossdb" + topics = ("database", "oltp", "embedded") + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + def configure(self): + 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 is_msvc(self): + raise ConanInvalidConfiguration(f"${self.ref} does not support MSVC") + + 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_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.11.0": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") + tc.generate() + + def build(self): + 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() + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["crossdb"] + + if Version(self.version) >= "0.10.0" and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/crossdb/all/test_package/CMakeLists.txt b/recipes/crossdb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f725ff69c516e --- /dev/null +++ b/recipes/crossdb/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(crossdb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE crossdb::crossdb) diff --git a/recipes/crossdb/all/test_package/conanfile.py b/recipes/crossdb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/crossdb/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/crossdb/all/test_package/test_package.c b/recipes/crossdb/all/test_package/test_package.c new file mode 100644 index 0000000000000..37adfa21e3091 --- /dev/null +++ b/recipes/crossdb/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include + +#include + +int main () { + printf("Cross DB Version: %s\n", xdb_version()); + return EXIT_SUCCESS; +} diff --git a/recipes/crossdb/config.yml b/recipes/crossdb/config.yml new file mode 100644 index 0000000000000..f474fc5aafc7f --- /dev/null +++ b/recipes/crossdb/config.yml @@ -0,0 +1,7 @@ +versions: + "0.11.0": + folder: all + "0.10.0": + folder: all + "0.9.0": + folder: all diff --git a/recipes/crossguid/all/test_package/CMakeLists.txt b/recipes/crossguid/all/test_package/CMakeLists.txt index d114028593025..21f1331b694a5 100644 --- a/recipes/crossguid/all/test_package/CMakeLists.txt +++ b/recipes/crossguid/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(crossguid REQUIRED CONFIG) diff --git a/recipes/crow/all/test_package/CMakeLists.txt b/recipes/crow/all/test_package/CMakeLists.txt index 33ae887aa6aea..d6cd92c156ed4 100644 --- a/recipes/crow/all/test_package/CMakeLists.txt +++ b/recipes/crow/all/test_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/crowcpp-crow/all/conandata.yml b/recipes/crowcpp-crow/all/conandata.yml index 6e89143bb07c8..91575e2322dc2 100644 --- a/recipes/crowcpp-crow/all/conandata.yml +++ b/recipes/crowcpp-crow/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.2.0": + url: "https://github.com/CrowCpp/crow/archive/refs/tags/v1.2.0.tar.gz" + sha256: "c80d0b23c6a20f8aa6fe776669dc8a9fb984046891d2f70bfc0539d16998164b" + "1.1.0": + url: "https://github.com/CrowCpp/crow/archive/refs/tags/v1.1.0.tar.gz" + sha256: "f4281c3f25769dbc82437dd4199a8ba07b2a6e8a2f42e36a6fd805c493aae5ca" "1.0+5": url: "https://github.com/CrowCpp/crow/archive/refs/tags/v1.0+5.tar.gz" sha256: "4eb1b80b97dda4a3c4f613c581c734e0221911c88ff859ed679bda3dd5d7b319" @@ -17,18 +23,3 @@ sources: "0.3+2": url: "https://github.com/CrowCpp/crow/archive/refs/tags/v0.3+2.tar.gz" sha256: "982fe978c113506aefe77c413befb3ab21fffb09d9bdf287ec8e8ba59bd786e7" - "0.3": - url: "https://github.com/CrowCpp/Crow/archive/refs/tags/v0.3.tar.gz" - sha256: "95538db88fba73c0bc87bbc40b62dcf488012c133a895634ade015009ebb4f25" - "0.2": - url: "https://github.com/CrowCpp/Crow/archive/refs/tags/0.2.tar.gz" - sha256: "c419767f0a336f2add71fc8b311ad95434d59601fb8b0e5ba3048407d85d0a71" -patches: - "0.2": - - patch_file: "patches/0.2/0001-normalize-buildsystem.patch" - patch_description: "Skip tests and examples from build" - patch_type: "conan" - - patch_file: "patches/0.2/0002-replace-uint.patch" - patch_description: "Replace uint (not default type) with unsigned" - patch_type: "bugfix" - patch_source: "https://github.com/CrowCpp/Crow/commit/5fe3a45793604a50f5c9086909dfa1b50dfa3e88" diff --git a/recipes/crowcpp-crow/all/conanfile.py b/recipes/crowcpp-crow/all/conanfile.py index ff4bbd7ba2b66..5e2434c0c17d3 100644 --- a/recipes/crowcpp-crow/all/conanfile.py +++ b/recipes/crowcpp-crow/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.files import get, copy from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.scm import Version @@ -14,6 +14,7 @@ class CrowConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "http://crowcpp.org/" topics = ("web", "microframework", "header-only") + package_type = "header-library" settings = "os", "compiler", "arch", "build_type" options = { "amalgamation": [True, False], @@ -30,9 +31,6 @@ class CrowConan(ConanFile): def _min_cppstd(self): return 11 - def export_sources(self): - export_conandata_patches(self) - def configure(self): if Version(self.version) < "1.0": del self.options.with_ssl @@ -42,9 +40,10 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.83.0") - if self.version == "0.2": - self.requires("openssl/[>=1.1 <4]") + if Version(self.version) < "1.1.0": + self.requires("boost/1.83.0") + else: + self.requires("asio/1.29.0", transitive_headers=True) if Version(self.version) >= "1.0": if self.options.with_ssl: self.requires("openssl/[>=1.1 <3]") @@ -74,8 +73,6 @@ def generate(self): tc.generate() def build(self): - apply_conandata_patches(self) - if self.options.amalgamation: cmake = CMake(self) cmake.configure() @@ -113,17 +110,19 @@ def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.requires.append("boost::headers") + if Version(self.version) < "1.1.0": + self.cpp_info.requires.append("boost::headers") + else: + self.cpp_info.requires.append("asio::asio") if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["pthread"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["wsock32", "ws2_32"] 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") @@ -131,8 +130,3 @@ def package_info(self): if self.options.with_compression: self.cpp_info.defines.append("CROW_ENABLE_COMPRESSION") self.cpp_info.requires.append("zlib::zlib") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "Crow" - self.cpp_info.names["cmake_find_package_multi"] = "Crow" - diff --git a/recipes/crowcpp-crow/all/patches/0.2/0001-normalize-buildsystem.patch b/recipes/crowcpp-crow/all/patches/0.2/0001-normalize-buildsystem.patch deleted file mode 100644 index 67c9be1d0235b..0000000000000 --- a/recipes/crowcpp-crow/all/patches/0.2/0001-normalize-buildsystem.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f00e9a9..61961da 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,6 +1,7 @@ - cmake_minimum_required(VERSION 3.15) - project (crow_all) - -+if(BUILD_TESTING) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") - - find_package(Tcmalloc) -@@ -43,15 +44,17 @@ include_directories("${PROJECT_INCLUDE_DIR}") - include_directories("${PROJECT_SOURCE_DIR}") - - add_subdirectory(examples) -+endif() - - if (MSVC) - else() -+ if (BUILD_TESTING) - add_subdirectory(tests) - - enable_testing() - add_test(NAME crow_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/unittest) - add_test(NAME template_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tests/template/test.py WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests/template) -- -+ endif() - - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/crow_all.h - COMMAND python ${PROJECT_SOURCE_DIR}/scripts/merge_all.py diff --git a/recipes/crowcpp-crow/all/patches/0.2/0002-replace-uint.patch b/recipes/crowcpp-crow/all/patches/0.2/0002-replace-uint.patch deleted file mode 100644 index c6f95ea173f09..0000000000000 --- a/recipes/crowcpp-crow/all/patches/0.2/0002-replace-uint.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/include/crow/http_connection.h b/include/crow/http_connection.h -index 2216687..04a992d 100644 ---- a/include/crow/http_connection.h -+++ b/include/crow/http_connection.h -@@ -627,7 +627,7 @@ namespace crow - - boost::array buffer_; - -- const uint res_stream_threshold_ = 1048576; -+ const unsigned res_stream_threshold_ = 1048576; - - HTTPParser parser_; - request req_; -diff --git a/include/crow/multipart.h b/include/crow/multipart.h -index 7deb8d4..7b63c20 100644 ---- a/include/crow/multipart.h -+++ b/include/crow/multipart.h -@@ -48,7 +48,7 @@ namespace crow - std::stringstream str; - std::string delimiter = dd + boundary; - -- for (uint i=0 ; i= "8.7.0": raise ConanInvalidConfiguration("cryptopp 8.7.0 and higher do not support shared builds") @@ -97,6 +106,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["CRYPTOPP_USE_OPENMP"] = self.options.use_openmp tc.cache_variables["CMAKE_DISABLE_FIND_PACKAGE_Git"] = True tc.generate() @@ -179,6 +189,12 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.components["libcryptopp"].system_libs = ["bcrypt", "ws2_32"] + if not self.options.shared and self.options.use_openmp: + if self.settings.compiler in ("gcc", "clang"): + openmp_flag = ["-fopenmp"] + self.cpp_info.components["libcryptopp"].sharedlinkflags = openmp_flag + self.cpp_info.components["libcryptopp"].exelinkflags = openmp_flag + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["pkg_config"] = "libcryptopp" self.cpp_info.components["libcryptopp"].names["cmake_find_package"] = legacy_cmake_target diff --git a/recipes/cryptopp/all/patches/8.9.0-0001-cve-2023-50980.patch b/recipes/cryptopp/all/patches/8.9.0-0001-cve-2023-50980.patch new file mode 100644 index 0000000000000..6406e30851781 --- /dev/null +++ b/recipes/cryptopp/all/patches/8.9.0-0001-cve-2023-50980.patch @@ -0,0 +1,78 @@ +https://github.com/weidai11/cryptopp/issues/1248 +https://github.com/weidai11/cryptopp/commit/eb383b8e1622 +https://github.com/weidai11/cryptopp/commit/641ae35258de +https://github.com/weidai11/cryptopp/commit/93208e83937a +--- a/gf2n.cpp ++++ b/gf2n.cpp +@@ -135,6 +135,14 @@ PolynomialMod2 PolynomialMod2::Monomial(size_t i) + + PolynomialMod2 PolynomialMod2::Trinomial(size_t t0, size_t t1, size_t t2) + { ++ // Asserts and checks due to Bing Shi ++ CRYPTOPP_ASSERT(t0 > t1); ++ CRYPTOPP_ASSERT(t1 > t2); ++ ++ // The test is relaxed because of ECIES. The high order exponent is t0, but the other exponents are not in descending order. ++ if (t1 > t0 || t2 > t0) ++ throw InvalidArgument("PolynomialMod2: exponents must be in descending order"); ++ + PolynomialMod2 r((word)0, t0+1); + r.SetBit(t0); + r.SetBit(t1); +@@ -144,6 +152,16 @@ PolynomialMod2 PolynomialMod2::Trinomial(size_t t0, size_t t1, size_t t2) + + PolynomialMod2 PolynomialMod2::Pentanomial(size_t t0, size_t t1, size_t t2, size_t t3, size_t t4) + { ++ // Asserts and checks due to Bing Shi ++ CRYPTOPP_ASSERT(t0 > t1); ++ CRYPTOPP_ASSERT(t1 > t2); ++ CRYPTOPP_ASSERT(t2 > t3); ++ CRYPTOPP_ASSERT(t3 > t4); ++ ++ // The test is relaxed because of ECIES. The high order exponent is t0, but the other exponents are not in descending order. ++ if (t1 > t0 || t2 > t0 || t3 > t0 || t4 > t0) ++ throw InvalidArgument("PolynomialMod2: exponents must be in descending order"); ++ + PolynomialMod2 r((word)0, t0+1); + r.SetBit(t0); + r.SetBit(t1); +@@ -655,7 +673,12 @@ GF2NT::GF2NT(unsigned int c0, unsigned int c1, unsigned int c2) + , t0(c0), t1(c1) + , result((word)0, m) + { ++ // Asserts and checks due to Bing Shi + CRYPTOPP_ASSERT(c0 > c1 && c1 > c2 && c2==0); ++ ++ // The test is relaxed because of ECIES. The high order exponent is t0, but the other exponents are not in descending order. ++ if (c1 > c0 || c2 > c0) ++ throw InvalidArgument("GF2NT: exponents must be in descending order"); + } + + const GF2NT::Element& GF2NT::MultiplicativeInverse(const Element &a) const +@@ -964,7 +987,12 @@ GF2NP * BERDecodeGF2NP(BufferedTransformation &bt) + GF2NT233::GF2NT233(unsigned int c0, unsigned int c1, unsigned int c2) + : GF2NT(c0, c1, c2) + { ++ // Asserts and checks due to Bing Shi + CRYPTOPP_ASSERT(c0 > c1 && c1 > c2 && c2==0); ++ ++ // The test is relaxed because of ECIES. The high order exponent is t0, but the other exponents are not in descending order. ++ if (c1 > c0 || c2 > c0) ++ throw InvalidArgument("GF2NT233: exponents must be in descending order"); + } + + const GF2NT::Element& GF2NT233::Multiply(const Element &a, const Element &b) const +--- a/gf2n.h ++++ b/gf2n.h +@@ -69,9 +69,11 @@ public: + static PolynomialMod2 CRYPTOPP_API Monomial(size_t i); + /// \brief Provides x^t0 + x^t1 + x^t2 + /// \return x^t0 + x^t1 + x^t2 ++ /// \pre The coefficients should be provided in descending order. That is,
t0 > t1 > t2
.
+ 		static PolynomialMod2 CRYPTOPP_API Trinomial(size_t t0, size_t t1, size_t t2);
+ 		/// \brief Provides x^t0 + x^t1 + x^t2 + x^t3 + x^t4
+ 		/// \return x^t0 + x^t1 + x^t2 + x^t3 + x^t4
++		/// \pre The coefficients should be provided in descending order. That is, 
t0 > t1 > t2 > t3 > t4
.
+ 		static PolynomialMod2 CRYPTOPP_API Pentanomial(size_t t0, size_t t1, size_t t2, size_t t3, size_t t4);
+ 		/// \brief Provides x^(n-1) + ... + x + 1
+ 		/// \return x^(n-1) + ... + x + 1
diff --git a/recipes/cryptopp/all/test_package/test_package.cpp b/recipes/cryptopp/all/test_package/test_package.cpp
index 2460e01097c84..da386a7df8d69 100644
--- a/recipes/cryptopp/all/test_package/test_package.cpp
+++ b/recipes/cryptopp/all/test_package/test_package.cpp
@@ -1,13 +1,8 @@
-#include "cryptopp/cryptlib.h"
-#include "cryptopp/osrng.h" // AutoSeededRandomPool
-
-#include 
+#include 
+#include 
 
 int main() {
-  printf("CryptoPP version: %d\n", CRYPTOPP_VERSION);
-
-  CryptoPP::AutoSeededRandomPool rng;
-  printf("This is a random number from CryptoPP: %d\n", rng.GenerateByte());
-
+  std::cout << "CryptoPP LibraryVersion() = " << CryptoPP::LibraryVersion() << std::endl;
+  std::cout << "CryptoPP HeaderVersion() = " << CryptoPP::HeaderVersion() << std::endl;
   return 0;
 }
diff --git a/recipes/cryptopp/all/test_v1_package/CMakeLists.txt b/recipes/cryptopp/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 0d20897301b68..0000000000000
--- a/recipes/cryptopp/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/cryptopp/all/test_v1_package/conanfile.py b/recipes/cryptopp/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/cryptopp/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_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/config.yml b/recipes/cryptopp/config.yml
index 58c17b09dbebf..d6ae70c1dd554 100644
--- a/recipes/cryptopp/config.yml
+++ b/recipes/cryptopp/config.yml
@@ -1,4 +1,6 @@
 versions:
+  "8.9.0":
+    folder: "all"
   "8.8.0":
     folder: "all"
   "8.7.0":
@@ -7,7 +9,3 @@ versions:
     folder: "all"
   "8.5.0":
     folder: "all"
-  "8.4.0":
-    folder: "all"
-  "8.2.0":
-    folder: "all"
diff --git a/recipes/cs_libguarded/all/test_package/CMakeLists.txt b/recipes/cs_libguarded/all/test_package/CMakeLists.txt
index d5463ebc7c858..adcc6201eff28 100644
--- a/recipes/cs_libguarded/all/test_package/CMakeLists.txt
+++ b/recipes/cs_libguarded/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)
 
 add_executable(${PROJECT_NAME} test_package.cpp)
diff --git a/recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt b/recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 925ecbe19e448..0000000000000
--- a/recipes/cs_libguarded/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/cs_libguarded/all/test_v1_package/conanfile.py b/recipes/cs_libguarded/all/test_v1_package/conanfile.py
deleted file mode 100644
index 5a05af3c2dfd2..0000000000000
--- a/recipes/cs_libguarded/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,18 +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/csm/all/CMakeLists.txt b/recipes/csm/all/CMakeLists.txt
index 757e60e4da746..3419eba1bddc1 100644
--- a/recipes/csm/all/CMakeLists.txt
+++ b/recipes/csm/all/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.15)
 project(csm LANGUAGES CXX)
 
 find_package(Threads REQUIRED)
diff --git a/recipes/csm/all/test_package/CMakeLists.txt b/recipes/csm/all/test_package/CMakeLists.txt
index 3d1c614448318..6acf8f6b8cdfa 100644
--- a/recipes/csm/all/test_package/CMakeLists.txt
+++ b/recipes/csm/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(csm REQUIRED CONFIG)
diff --git a/recipes/csm/all/test_v1_package/CMakeLists.txt b/recipes/csm/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 0d20897301b68..0000000000000
--- a/recipes/csm/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/csm/all/test_v1_package/conanfile.py b/recipes/csm/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/csm/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_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/cspice/all/conandata.yml b/recipes/cspice/all/conandata.yml
index ed4687777f4ca..6d3456f365414 100644
--- a/recipes/cspice/all/conandata.yml
+++ b/recipes/cspice/all/conandata.yml
@@ -16,6 +16,9 @@ sources:
         "x86_64":
           url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z"
           sha256: "60a95b51a6472f1afe7e40d77ebdee43c12bb5b8823676ccc74692ddfede06ce"
+        "armv8":
+          url: "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z"
+          sha256: "60a95b51a6472f1afe7e40d77ebdee43c12bb5b8823676ccc74692ddfede06ce"
     "Windows":
       "Visual Studio":
         "x86":
diff --git a/recipes/cspice/all/test_package/CMakeLists.txt b/recipes/cspice/all/test_package/CMakeLists.txt
index 19e72e03db2a8..e9db440682797 100644
--- a/recipes/cspice/all/test_package/CMakeLists.txt
+++ b/recipes/cspice/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(cspice REQUIRED CONFIG)
diff --git a/recipes/csvmonkey/all/test_package/CMakeLists.txt b/recipes/csvmonkey/all/test_package/CMakeLists.txt
index fd4b892a1c012..7b5c36a0b7b60 100644
--- a/recipes/csvmonkey/all/test_package/CMakeLists.txt
+++ b/recipes/csvmonkey/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(csvmonkey CONFIG REQUIRED)
diff --git a/recipes/csvmonkey/all/test_v1_package/CMakeLists.txt b/recipes/csvmonkey/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 925ecbe19e448..0000000000000
--- a/recipes/csvmonkey/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/csvmonkey/all/test_v1_package/conanfile.py b/recipes/csvmonkey/all/test_v1_package/conanfile.py
deleted file mode 100644
index 5a05af3c2dfd2..0000000000000
--- a/recipes/csvmonkey/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,18 +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/ctpg/all/test_v1_package/CMakeLists.txt b/recipes/ctpg/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/ctpg/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index 90eb89e3f2f46..0000000000000
--- a/recipes/ctpg/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,17 +0,0 @@
-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/ctrack/all/conandata.yml b/recipes/ctrack/all/conandata.yml
new file mode 100644
index 0000000000000..f43d2b2b61b59
--- /dev/null
+++ b/recipes/ctrack/all/conandata.yml
@@ -0,0 +1,4 @@
+sources:
+  "1.0.2":
+    url: "https://github.com/Compaile/ctrack/releases/download/v1.0.2/ctrack-main.zip"
+    sha256: "1a41a831c28977504b49b6966c46e65939271eca90fbe297e248a3e0bf05ac5a"
diff --git a/recipes/ctrack/all/conanfile.py b/recipes/ctrack/all/conanfile.py
new file mode 100644
index 0000000000000..439699d0f2442
--- /dev/null
+++ b/recipes/ctrack/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.scm import Version
+import os
+
+required_conan_version = ">=1.52.0"
+
+class CtrackConan(ConanFile):
+    name = "ctrack"
+    description = "A lightweight, high-performance C++ benchmarking and tracking library for effortless function profiling in both development and production environments."
+    license = "MIT"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://github.com/Compaile/ctrack"
+    topics = ("benchmark", "tracking", "profiling", "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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
+        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 = []
+
+        self.cpp_info.set_property("cmake_file_name", "ctrack")
+        self.cpp_info.set_property("cmake_target_name", "ctrack::ctrack")
diff --git a/recipes/ctrack/all/test_package/CMakeLists.txt b/recipes/ctrack/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..c5cbaf058679d
--- /dev/null
+++ b/recipes/ctrack/all/test_package/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.15)
+project(test_package LANGUAGES CXX)
+
+find_package(ctrack REQUIRED CONFIG)
+
+add_executable(${PROJECT_NAME} test_package.cpp)
+target_link_libraries(${PROJECT_NAME} PRIVATE ctrack::ctrack)
+target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
diff --git a/recipes/ctrack/all/test_package/conanfile.py b/recipes/ctrack/all/test_package/conanfile.py
new file mode 100644
index 0000000000000..3a91c9439218e
--- /dev/null
+++ b/recipes/ctrack/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/ctrack/all/test_package/test_package.cpp b/recipes/ctrack/all/test_package/test_package.cpp
new file mode 100644
index 0000000000000..a7b05d6ea6f7c
--- /dev/null
+++ b/recipes/ctrack/all/test_package/test_package.cpp
@@ -0,0 +1,25 @@
+// In older gcc,  header requires tbb library.
+// adding following line  to fix compilation error due to this
+#define  CTRACK_DISABLE_EXECUTION_POLICY
+#include "ctrack.hpp"
+#include 
+
+void expensiveOperation() {
+    CTRACK;
+    // Simulating some work
+    for (int i = 0; i < 5; ++i) {
+        std::cout << i << " ";
+    }
+    std::cout << std::endl;
+}
+
+int main() {
+    for (int i = 0; i < 2; ++i) {
+        expensiveOperation();
+    }
+
+    // Print results to console
+    ctrack::result_print();
+
+    return 0;
+}
diff --git a/recipes/ctrack/config.yml b/recipes/ctrack/config.yml
new file mode 100644
index 0000000000000..8457ca9a4a8cd
--- /dev/null
+++ b/recipes/ctrack/config.yml
@@ -0,0 +1,3 @@
+versions:
+  "1.0.2":
+    folder: all
diff --git a/recipes/ctre/all/conandata.yml b/recipes/ctre/all/conandata.yml
index c31706ca559c2..14d4398b08a9b 100644
--- a/recipes/ctre/all/conandata.yml
+++ b/recipes/ctre/all/conandata.yml
@@ -1,4 +1,7 @@
 sources:
+  "3.9.0":
+    url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.9.0.tar.gz"
+    sha256: "55778712968d4f3ad00e9d20fc4d2149d14d96b4ff3dab086613797cd2ccd2b2"
   "3.8.1":
     url: "https://github.com/hanickadot/compile-time-regular-expressions/archive/v3.8.1.tar.gz"
     sha256: "0ce8760d43b3b97b43364cd32ee663e5c8b8b4bfd58e7890042eff6ac52db605"
diff --git a/recipes/ctre/all/test_package/CMakeLists.txt b/recipes/ctre/all/test_package/CMakeLists.txt
index a3f2fba7b1674..a3da9a3311cd3 100644
--- a/recipes/ctre/all/test_package/CMakeLists.txt
+++ b/recipes/ctre/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(ctre CONFIG REQUIRED)
diff --git a/recipes/ctre/all/test_v1_package/CMakeLists.txt b/recipes/ctre/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index bdcd221de0a2c..0000000000000
--- a/recipes/ctre/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required(VERSION 3.8)
-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/ctre/all/test_v1_package/conanfile.py b/recipes/ctre/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f44a943c8f6..0000000000000
--- a/recipes/ctre/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import os
-from conans import ConanFile, CMake, tools
-
-class CtreTestConan(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/ctre/config.yml b/recipes/ctre/config.yml
index 02f3f62c0a451..218ac700f6381 100644
--- a/recipes/ctre/config.yml
+++ b/recipes/ctre/config.yml
@@ -1,4 +1,6 @@
 versions:
+  "3.9.0":
+    folder: all
   "3.8.1":
     folder: all
   "3.8":
diff --git a/recipes/ctrl-c/all/CMakeLists.txt b/recipes/ctrl-c/all/CMakeLists.txt
new file mode 100644
index 0000000000000..405a4c3952405
--- /dev/null
+++ b/recipes/ctrl-c/all/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.15)
+project(ctrl-c LANGUAGES CXX)
+
+add_library(ctrl-c ${CTRL_C_SRC_DIR}/src/ctrl-c.cpp)
+set_target_properties(ctrl-c PROPERTIES
+    PUBLIC_HEADER ${CTRL_C_SRC_DIR}/src/ctrl-c.h
+)
+target_compile_features(ctrl-c PUBLIC cxx_std_11)
+
+include(GNUInstallDirs)
+install(
+    TARGETS ctrl-c
+    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/ctrl-c/all/conandata.yml b/recipes/ctrl-c/all/conandata.yml
new file mode 100644
index 0000000000000..e988e2cde6c0a
--- /dev/null
+++ b/recipes/ctrl-c/all/conandata.yml
@@ -0,0 +1,4 @@
+sources:
+  "1.0.0":
+    url: "https://github.com/evgenykislov/ctrl-c/archive/refs/tags/v1.0.0.tar.gz"
+    sha256: "9f63ff2e02ac62a19e30208af746d5a2655ecf040773b6c7d1e27e85be45ee1a"
diff --git a/recipes/ctrl-c/all/conanfile.py b/recipes/ctrl-c/all/conanfile.py
new file mode 100644
index 0000000000000..6ef4188f79f42
--- /dev/null
+++ b/recipes/ctrl-c/all/conanfile.py
@@ -0,0 +1,75 @@
+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
+from conan.tools.microsoft import is_msvc
+import os
+
+
+required_conan_version = ">=1.53.0"
+
+
+class CtrlCConan(ConanFile):
+    name = "ctrl-c"
+    description = "Crossplatform code to handle Ctrl+C signal"
+    license = "MIT"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://github.com/evgenykislov/ctrl-c/"
+    topics = ("crossplatform", "signal", "sigint")
+    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"]
+
+    @property
+    def _min_cppstd(self):
+        return 11
+
+    def config_options(self):
+        if self.settings.os == "Windows":
+            del self.options.fPIC
+
+    def configure(self):
+        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 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["CTRL_C_SRC_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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
+        cmake = CMake(self)
+        cmake.install()
+
+    def package_info(self):
+        self.cpp_info.libs = ["ctrl-c"]
+
+        if self.settings.os in ["Linux", "FreeBSD"]:
+            self.cpp_info.system_libs.append("m")
diff --git a/recipes/ctrl-c/all/test_package/CMakeLists.txt b/recipes/ctrl-c/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..6e5e89641e866
--- /dev/null
+++ b/recipes/ctrl-c/all/test_package/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.15)
+project(test_package LANGUAGES CXX)
+
+find_package(ctrl-c REQUIRED CONFIG)
+
+add_executable(${PROJECT_NAME} test_package.cpp)
+target_link_libraries(${PROJECT_NAME} PRIVATE ctrl-c::ctrl-c)
+target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
diff --git a/recipes/ctrl-c/all/test_package/conanfile.py b/recipes/ctrl-c/all/test_package/conanfile.py
new file mode 100644
index 0000000000000..ef5d7042163ec
--- /dev/null
+++ b/recipes/ctrl-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.bindir, "test_package")
+            self.run(bin_path, env="conanrun")
diff --git a/recipes/ctrl-c/all/test_package/test_package.cpp b/recipes/ctrl-c/all/test_package/test_package.cpp
new file mode 100644
index 0000000000000..a36109950fc83
--- /dev/null
+++ b/recipes/ctrl-c/all/test_package/test_package.cpp
@@ -0,0 +1,8 @@
+#include "ctrl-c.h"
+
+int main(void) {
+    auto id = CtrlCLibrary::SetCtrlCHandler([](CtrlCLibrary::CtrlSignal signal){ return true;});
+    CtrlCLibrary::ResetCtrlCHandler(id);
+
+    return 0;
+}
diff --git a/recipes/ctrl-c/config.yml b/recipes/ctrl-c/config.yml
new file mode 100644
index 0000000000000..40341aa3db6cd
--- /dev/null
+++ b/recipes/ctrl-c/config.yml
@@ -0,0 +1,3 @@
+versions:
+  "1.0.0":
+    folder: all
diff --git a/recipes/cubicinterpolation/all/conanfile.py b/recipes/cubicinterpolation/all/conanfile.py
index 2525795c99b74..bc39a02e7855c 100644
--- a/recipes/cubicinterpolation/all/conanfile.py
+++ b/recipes/cubicinterpolation/all/conanfile.py
@@ -42,8 +42,7 @@ def layout(self):
         cmake_layout(self, src_folder="src")
 
     def requirements(self):
-        # TODO: update boost dependency as soon as we deprecate conan1.x (see discussion in #11207)
-        self.requires("boost/1.83.0")
+        self.requires("boost/1.85.0")
         self.requires("eigen/3.4.0")
 
     @property
diff --git a/recipes/cubicinterpolation/all/test_package/CMakeLists.txt b/recipes/cubicinterpolation/all/test_package/CMakeLists.txt
index 0ce4681457d9e..e26105bc89b2a 100644
--- a/recipes/cubicinterpolation/all/test_package/CMakeLists.txt
+++ b/recipes/cubicinterpolation/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(CubicInterpolation REQUIRED CONFIG)
diff --git a/recipes/cubicinterpolation/all/test_v1_package/CMakeLists.txt b/recipes/cubicinterpolation/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 7ea0378c83fe1..0000000000000
--- a/recipes/cubicinterpolation/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.1)
-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/cubicinterpolation/all/test_v1_package/conanfile.py b/recipes/cubicinterpolation/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/cubicinterpolation/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_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/cuda-api-wrappers/all/conandata.yml b/recipes/cuda-api-wrappers/all/conandata.yml
index 5990b0d96ecd6..54d1121cafbd2 100644
--- a/recipes/cuda-api-wrappers/all/conandata.yml
+++ b/recipes/cuda-api-wrappers/all/conandata.yml
@@ -1,7 +1,16 @@
 sources:
-  "0.7":
-    url: "https://github.com/eyalroz/cuda-api-wrappers/archive/0.7b1.tar.gz"
-    sha256: "1ed5912d8f602ccd176865b824de17f462cb57142eb2a685d7cc034831e54a71"
+  "0.8.0":
+    url: "https://github.com/eyalroz/cuda-api-wrappers/archive/refs/tags/v0.8.0.tar.gz"
+    sha256: "16c68e450e553d2839f00503a44e85b32c4f4e08f154e9f7c85f706bc5c79bf3"
+  "0.7.1":
+    url: "https://github.com/eyalroz/cuda-api-wrappers/archive/refs/tags/v0.7.1.tar.gz"
+    sha256: "fa30c9fe43a62f5a3fd82a5deb477838fbf0bf455c73a2d2bb5ab6284184900b"
+  "0.7.0":
+    url: "https://github.com/eyalroz/cuda-api-wrappers/archive/refs/tags/v0.7.0.tar.gz"
+    sha256: "a47d11607ffa0c41cfffe689840a14125520da3f4bb504267e9d232ebb846457"
+  "0.6.8":
+    url: "https://github.com/eyalroz/cuda-api-wrappers/archive/refs/tags/v0.6.8.tar.gz"
+    sha256: "a0d1b062dbe41c99d06df4ae7885a053c2ae3815d6fe12df0458bc5277d08ed7"
   "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
index bca11c0ee8633..8fee85b7bb52b 100644
--- a/recipes/cuda-api-wrappers/all/conanfile.py
+++ b/recipes/cuda-api-wrappers/all/conanfile.py
@@ -3,6 +3,7 @@
 from conan import ConanFile
 from conan.tools.files import get, copy
 from conan.tools.layout import basic_layout
+from conan.tools.scm import Version
 
 required_conan_version = ">=1.52.0"
 
@@ -44,6 +45,9 @@ def package(self):
     def package_info(self):
         self.cpp_info.bindirs = []
         self.cpp_info.libdirs = []
-
+        self.cpp_info.set_property("cmake_target_name", "cuda-api-wrappers::runtime-and-driver")
+        if Version(self.version) < "0.7.0":
+            # For previously published versions the target name was different, maintain compatibility
+            self.cpp_info.set_property("cmake_target_aliases", ["cuda-api-wrappers::cuda-api-wrappers"])
         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
index 60f8a4074a3bc..afb719ebe5b23 100644
--- a/recipes/cuda-api-wrappers/all/test_package/CMakeLists.txt
+++ b/recipes/cuda-api-wrappers/all/test_package/CMakeLists.txt
@@ -4,7 +4,7 @@ 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_link_libraries(${PROJECT_NAME} PRIVATE cuda-api-wrappers::runtime-and-driver)
 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/config.yml b/recipes/cuda-api-wrappers/config.yml
index b1edd3de7d7ae..8f11aca98582d 100644
--- a/recipes/cuda-api-wrappers/config.yml
+++ b/recipes/cuda-api-wrappers/config.yml
@@ -1,5 +1,11 @@
 versions:
-  "0.7":
+  "0.8.0":
+    folder: all
+  "0.7.1":
+    folder: all
+  "0.7.0":
+    folder: all
+  "0.6.8":
     folder: all
   "0.6.3":
     folder: all
diff --git a/recipes/cunit/all/test_package/CMakeLists.txt b/recipes/cunit/all/test_package/CMakeLists.txt
index b32c10a586ed8..9407d80405f5c 100644
--- a/recipes/cunit/all/test_package/CMakeLists.txt
+++ b/recipes/cunit/all/test_package/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.15)
 project(test_package)
 
 find_package(cunit CONFIG REQUIRED)
diff --git a/recipes/curlpp/all/conandata.yml b/recipes/curlpp/all/conandata.yml
new file mode 100644
index 0000000000000..81a27c2d764c6
--- /dev/null
+++ b/recipes/curlpp/all/conandata.yml
@@ -0,0 +1,15 @@
+sources:
+  "0.8.1.cci.20240530":
+    url: "https://github.com/jpbarrette/curlpp/archive/8840ec806a75a6def9ed07845a620f6d170e5821.tar.gz"
+    sha256: "1260326d966ec75a50feccb5411268f9aeca667d97f8132973bdb0783ecceb3c"
+patches:
+  "0.8.1.cci.20240530":
+    - patch_file: "patches/0001-disable-static-on-shared.patch"
+      patch_description: "disable building static library on shared=True"
+      patch_type: "conan"
+    - patch_file: "patches/0002-disable-cpp11.patch"
+      patch_description: "disable specifying C++11"
+      patch_type: "conan"
+    - patch_file: "patches/0003-replace-project-declaration.patch"
+      patch_description: "switch positions between project() and cmake_minimum_required()"
+      patch_type: "conan"
diff --git a/recipes/curlpp/all/conanfile.py b/recipes/curlpp/all/conanfile.py
new file mode 100644
index 0000000000000..706675da9ba61
--- /dev/null
+++ b/recipes/curlpp/all/conanfile.py
@@ -0,0 +1,90 @@
+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, rm
+from conan.tools.scm import Version
+from conan.tools.microsoft import is_msvc
+import os
+
+required_conan_version = ">=1.53.0"
+
+class CurlppConan(ConanFile):
+    name = "curlpp"
+    description = "C++ wrapper around libcURL"
+    license = "MIT"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://github.com/jpbarrette/curlpp"
+    topics = ("curl", "libcurl")
+    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):
+        # As it's a wrapper, it includes curl symbols in its public headers
+        self.requires("libcurl/8.9.1", transitive_headers=True, transitive_libs=True)
+
+    def validate(self):
+        if self.settings.compiler.get_safe("cppstd"):
+            check_min_cppstd(self, self._min_cppstd)
+        else:
+            if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6":
+                raise ConanInvalidConfiguration("${self.ref} requires C++11. Please set 'compiler.cppstd=11'.")
+            if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14":
+                raise ConanInvalidConfiguration("${self.ref} requires C++11. Please set 'compiler.cppstd=11'.")
+
+    def source(self):
+        get(self, **self.conan_data["sources"][self.version], strip_root=True)
+
+    def generate(self):
+        tc = CMakeToolchain(self)
+        tc.variables["CURLPP_BUILD_SHARED_LIBS"] = self.options.shared
+        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, "LICENSE", os.path.join(self.source_folder, "doc"), 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"))
+        rm(self, "curlpp-config", os.path.join(self.package_folder, "bin"))
+
+    def package_info(self):
+        self.cpp_info.libs = ["libcurlpp" if is_msvc(self) and not self.options.shared else "curlpp"]
+
+        self.cpp_info.set_property("cmake_file_name", "curlpp")
+        self.cpp_info.set_property("cmake_target_name", "curlpp::curlpp")
diff --git a/recipes/curlpp/all/patches/0001-disable-static-on-shared.patch b/recipes/curlpp/all/patches/0001-disable-static-on-shared.patch
new file mode 100644
index 0000000000000..4660e359d71c2
--- /dev/null
+++ b/recipes/curlpp/all/patches/0001-disable-static-on-shared.patch
@@ -0,0 +1,34 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4f550b5..ca97e64 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -108,7 +108,7 @@ if(CURLPP_BUILD_SHARED_LIBS)
+    target_include_directories(${PROJECT_NAME} PUBLIC $)
+    target_link_libraries(${PROJECT_NAME} PUBLIC CURL::libcurl ${CONAN_LIBS})
+    set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 1 VERSION 1.0.0)
+-endif()
++else()
+ 
+ add_library(${PROJECT_NAME}_static STATIC ${HeaderFileList} ${SourceFileList})
+ add_library(${PROJECT_NAME}::${PROJECT_NAME}_static ALIAS ${PROJECT_NAME}_static)
+@@ -126,16 +126,16 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES OUTPUT_NAME ${PROJECT_NA
+ # so we add a "lib" prefix (which is default on other platforms anyway):
+ SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES PREFIX "lib")
+-target_link_libraries(${PROJECT_NAME}_static ${CURL_LIBRARIES} ${CONAN_LIBS})
+-
++target_link_libraries(${PROJECT_NAME}_static CURL::libcurl ${CONAN_LIBS})
++endif()
+ # install headers
+ install(FILES "${PROJECT_SOURCE_DIR}/cmake/curlppConfig.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/curlpp")
+ install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ if(CURLPP_BUILD_SHARED_LIBS)
+   install(TARGETS curlpp EXPORT curlppTargets INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+-endif()
++else()
+   install(TARGETS curlpp_static EXPORT curlppTargets INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+-  
++endif()
+ install(
+     EXPORT curlppTargets
+     DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/curlpp"
diff --git a/recipes/curlpp/all/patches/0002-disable-cpp11.patch b/recipes/curlpp/all/patches/0002-disable-cpp11.patch
new file mode 100644
index 0000000000000..972db13b339f7
--- /dev/null
+++ b/recipes/curlpp/all/patches/0002-disable-cpp11.patch
@@ -0,0 +1,26 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ca97e64..bdb257e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -22,7 +22,7 @@ if(WIN32)
+     cmake_minimum_required(VERSION 3.4)
+ 
+     # c++ 11 support from cmake 3.4 or newer
+-    set(CMAKE_CXX_STANDARD 11) # C++11...
++    # set(CMAKE_CXX_STANDARD 11) # C++11...
+     set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required...
+     set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11
+ 
+@@ -43,10 +43,10 @@ if(WIN32)
+         #
+         # for non-windows platform we try to keep cmake 2.8 support
+         # since entreprise distribution tends to have 2.8 version.
+-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++        # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+     else()
+         # c++ 11 support from cmake 3.1 or newer
+-        set(CMAKE_CXX_STANDARD 11) # C++11...
++        # set(CMAKE_CXX_STANDARD 11) # C++11...
+         set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required...
+         set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11
+     endif()
diff --git a/recipes/curlpp/all/patches/0003-replace-project-declaration.patch b/recipes/curlpp/all/patches/0003-replace-project-declaration.patch
new file mode 100644
index 0000000000000..d5aa092f726ef
--- /dev/null
+++ b/recipes/curlpp/all/patches/0003-replace-project-declaration.patch
@@ -0,0 +1,19 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bfba06b..7f4c6fd 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,3 @@
+-project(curlpp)
+-
+-
+ # In response to CMake 3.0 generating warnings regarding policy CMP0042,
+ # the OSX RPATH settings have been updated per recommendations found
+ # in the CMake Wiki:
+@@ -52,6 +49,7 @@ if(WIN32)
+     endif()
+ endif()
+ 
++project(curlpp)
+ 
+ # Conan.io integration
+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake)
diff --git a/recipes/curlpp/all/test_package/CMakeLists.txt b/recipes/curlpp/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..b5fa1057f20ec
--- /dev/null
+++ b/recipes/curlpp/all/test_package/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.15)
+project(test_package LANGUAGES CXX)
+
+find_package(curlpp REQUIRED CONFIG)
+
+add_executable(${PROJECT_NAME} test_package.cpp)
+target_link_libraries(${PROJECT_NAME} PRIVATE curlpp::curlpp)
+target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
diff --git a/recipes/curlpp/all/test_package/conanfile.py b/recipes/curlpp/all/test_package/conanfile.py
new file mode 100644
index 0000000000000..ef5d7042163ec
--- /dev/null
+++ b/recipes/curlpp/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/curlpp/all/test_package/test_package.cpp b/recipes/curlpp/all/test_package/test_package.cpp
new file mode 100644
index 0000000000000..a1ad47c5108eb
--- /dev/null
+++ b/recipes/curlpp/all/test_package/test_package.cpp
@@ -0,0 +1,11 @@
+
+#include 
+#include 
+#include 
+
+using namespace curlpp::options;
+
+int main(int, char **) {
+    curlpp::Easy myRequest;
+	myRequest.setOpt("http://example.com");
+}
diff --git a/recipes/curlpp/config.yml b/recipes/curlpp/config.yml
new file mode 100644
index 0000000000000..1925bfdc53ee3
--- /dev/null
+++ b/recipes/curlpp/config.yml
@@ -0,0 +1,3 @@
+versions:
+  "0.8.1.cci.20240530":
+    folder: all
diff --git a/recipes/cutlass/all/conandata.yml b/recipes/cutlass/all/conandata.yml
new file mode 100644
index 0000000000000..0ca7d634c756e
--- /dev/null
+++ b/recipes/cutlass/all/conandata.yml
@@ -0,0 +1,10 @@
+sources:
+  "3.5.1":
+    url: "https://github.com/NVIDIA/cutlass/archive/refs/tags/v3.5.1.tar.gz"
+    sha256: "20b7247cda2d257cbf8ba59ba3ca40a9211c4da61a9c9913e32b33a2c5883a36"
+  "3.5.0":
+    url: "https://github.com/NVIDIA/cutlass/archive/refs/tags/v3.5.0.tar.gz"
+    sha256: "ef6af8526e3ad04f9827f35ee57eec555d09447f70a0ad0cf684a2e426ccbcb6"
+  "3.1.0":
+    url: "https://github.com/NVIDIA/cutlass/archive/refs/tags/v3.1.0.tar.gz"
+    sha256: "821aa2e5b709a2e5d3922dcf2c5d445b4898a6ef8bac683cfb00125eafbca029"
diff --git a/recipes/cutlass/all/conanfile.py b/recipes/cutlass/all/conanfile.py
new file mode 100644
index 0000000000000..b134b6034bae1
--- /dev/null
+++ b/recipes/cutlass/all/conanfile.py
@@ -0,0 +1,106 @@
+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.env import VirtualBuildEnv
+from conan.tools.files import copy, get, rmdir, replace_in_file
+from conan.tools.scm import Version
+
+required_conan_version = ">=1.52.0"
+
+
+class CutlassConan(ConanFile):
+    name = "cutlass"
+    description = "CUTLASS: CUDA Templates for Linear Algebra Subroutines"
+    license = "BSD-3-Clause"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://github.com/NVIDIA/cutlass"
+    topics = ("linear-algebra", "gpu", "cuda", "deep-learning", "nvidia", "header-only")
+
+    package_type = "header-library"
+    settings = "os", "arch", "compiler", "build_type"
+    short_paths = True
+    # TODO: add header_only=False option
+
+    @property
+    def _min_cppstd(self):
+        return 17
+
+    @property
+    def _compilers_minimum_version(self):
+        return {
+            "gcc": "7",
+            "clang": "7",
+            "apple-clang": "7",
+            "msvc": "192",
+            "Visual Studio": "16",
+        }
+
+    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)
+        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.19 <4]")
+
+    def source(self):
+        get(self, **self.conan_data["sources"][self.version], strip_root=True)
+
+    def generate(self):
+        # Install via CMake to ensure headers are configured correctly
+        tc = CMakeToolchain(self)
+        tc.cache_variables["CMAKE_SUPPRESS_REGENERATION"] = True
+        tc.cache_variables["CUTLASS_REVISION"]=f"v{self.version}"
+        tc.cache_variables["CUTLASS_NATIVE_CUDA"] = False
+        tc.cache_variables["CUTLASS_ENABLE_HEADERS_ONLY"] = True
+        tc.cache_variables["CUTLASS_ENABLE_TOOLS"] = False
+        tc.cache_variables["CUTLASS_ENABLE_LIBRARY"] = False
+        tc.cache_variables["CUTLASS_ENABLE_PROFILER"] = False
+        tc.cache_variables["CUTLASS_ENABLE_PERFORMANCE"] = False
+        tc.cache_variables["CUTLASS_ENABLE_TESTS"] = False
+        tc.cache_variables["CUTLASS_ENABLE_GTEST_UNIT_TESTS"] = False
+        tc.cache_variables["CUTLASS_ENABLE_CUBLAS"] = False
+        tc.cache_variables["CUTLASS_ENABLE_CUDNN"] = False
+        tc.generate()
+        VirtualBuildEnv(self).generate()
+
+    def _patch_sources(self):
+        # Don't look for CUDA, we're only installing the headers
+        replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "include(${CMAKE_CURRENT_SOURCE_DIR}/CUDA.cmake)",
+                                                                                 """
+                                                                                 if(NOT CUTLASS_ENABLE_HEADERS_ONLY)
+                                                                                 include(${CMAKE_CURRENT_SOURCE_DIR}/CUDA.cmake)
+                                                                                 endif()""")
+
+    def build(self):
+        self._patch_sources()
+        cmake = CMake(self)
+        cmake.configure()
+        cmake.build()
+
+    def package(self):
+        copy(self, "LICENSE.txt", self.source_folder, 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, "test"))
+
+
+    def package_info(self):
+        self.cpp_info.set_property("cmake_file_name", "NvidiaCutlass")
+        self.cpp_info.set_property("cmake_target_name", "nvidia::cutlass::cutlass")
+        self.cpp_info.bindirs = []
+        self.cpp_info.libdirs = []
diff --git a/recipes/cutlass/all/test_package/CMakeLists.txt b/recipes/cutlass/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..a4872b3ed37c7
--- /dev/null
+++ b/recipes/cutlass/all/test_package/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.15)
+project(test_package LANGUAGES CXX)
+
+find_package(NvidiaCutlass REQUIRED CONFIG)
+
+add_executable(${PROJECT_NAME} test_package.cpp)
+target_link_libraries(${PROJECT_NAME} PRIVATE nvidia::cutlass::cutlass)
+target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
diff --git a/recipes/cutlass/all/test_package/conanfile.py b/recipes/cutlass/all/test_package/conanfile.py
new file mode 100644
index 0000000000000..3a91c9439218e
--- /dev/null
+++ b/recipes/cutlass/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/cutlass/all/test_package/test_package.cpp b/recipes/cutlass/all/test_package/test_package.cpp
new file mode 100644
index 0000000000000..9e74847cbedd3
--- /dev/null
+++ b/recipes/cutlass/all/test_package/test_package.cpp
@@ -0,0 +1,10 @@
+#include 
+
+#include 
+
+int main() {
+    std::cout << "CUTLASS version: " <<
+        cutlass::getVersionMajor() << "." <<
+        cutlass::getVersionMinor() << "." <<
+        cutlass::getVersionPatch() << std::endl;
+}
diff --git a/recipes/cutlass/config.yml b/recipes/cutlass/config.yml
new file mode 100644
index 0000000000000..105bf52d45213
--- /dev/null
+++ b/recipes/cutlass/config.yml
@@ -0,0 +1,7 @@
+versions:
+  "3.5.1":
+    folder: all
+  "3.5.0":
+    folder: all
+  "3.1.0":
+    folder: all
diff --git a/recipes/cwalk/all/conandata.yml b/recipes/cwalk/all/conandata.yml
index 89588e33be62f..0ae84f70cd58a 100644
--- a/recipes/cwalk/all/conandata.yml
+++ b/recipes/cwalk/all/conandata.yml
@@ -1,4 +1,7 @@
 sources:
+  "1.2.8":
+    url: "https://github.com/likle/cwalk/archive/v1.2.8.tar.gz"
+    sha256: "48b99bd46f0b9ce027ca882b003e44a5db0369dec6fd9898fd5420aa282d780f"
   "1.2.7":
     url: "https://github.com/likle/cwalk/archive/v1.2.7.tar.gz"
     sha256: "ae424ec30830c970412e34d9092eaa6131d91af289cdad0ad66a7b1c58e768e7"
@@ -18,15 +21,31 @@ sources:
     url: "https://github.com/likle/cwalk/archive/v1.0.0.zip"
     sha256: "9ff6d85f88e7fe4877698afb40745d301491c1d3fca96f08d1622f5fe3494182"
 patches:
+  "1.2.8":
+    - patch_file: "patches/0001-fix-cmake-1.2.8.patch"
+      patch_description: "disable warnings"
+      patch_type: "conan"
   "1.2.7":
     - patch_file: "patches/0001-fix-cmake-1.2.5.patch"
+      patch_description: "disable warnings"
+      patch_type: "conan"
   "1.2.6":
     - patch_file: "patches/0001-fix-cmake-1.2.5.patch"
+      patch_description: "disable warnings"
+      patch_type: "conan"
   "1.2.5":
     - patch_file: "patches/0001-fix-cmake-1.2.5.patch"
+      patch_description: "disable warnings"
+      patch_type: "conan"
   "1.2.2":
     - patch_file: "patches/0001-fix-cmake-1.2.2.patch"
+      patch_description: "add installer, disable test"
+      patch_type: "conan"
   "1.1.0":
     - patch_file: "patches/0001-fix-cmake-1.1.0.patch"
+      patch_description: "add installer, disable test"
+      patch_type: "conan"
   "1.0.0":
     - patch_file: "patches/0001-fix-cmake-1.0.0.patch"
+      patch_description: "add installer, disable test"
+      patch_type: "conan"
diff --git a/recipes/cwalk/all/conanfile.py b/recipes/cwalk/all/conanfile.py
index bf570216dca5f..dc9e4e2bd3639 100644
--- a/recipes/cwalk/all/conanfile.py
+++ b/recipes/cwalk/all/conanfile.py
@@ -13,13 +13,12 @@ class CwalkConan(ConanFile):
     description = "Path library for C/C++. Cross-Platform for Windows, " \
                   "MacOS and Linux. Supports UNIX and Windows path styles " \
                   "on those platforms."
-    url = "https://github.com/conan-io/conan-center-index"
     license = "MIT"
+    url = "https://github.com/conan-io/conan-center-index"
     homepage = "https://likle.github.io/cwalk/"
     topics = ("cross-platform", "windows", "macos", "osx", "linux",
               "path-manipulation", "path", "directory", "file", "file-system",
               "unc", "path-parsing", "file-path")
-
     package_type = "library"
     settings = "os", "arch", "compiler", "build_type"
     options = {
@@ -65,6 +64,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"))
 
         # TODO: to remove in conan v2 once cmake_find_package_* generators removed
         self._create_cmake_module_alias_targets(
@@ -93,6 +93,8 @@ def package_info(self):
         self.cpp_info.libs = ["cwalk"]
         if self.options.shared and Version(self.version) >= "1.2.5":
             self.cpp_info.defines.append("CWK_SHARED")
+        if Version(self.version) >= "1.2.8":
+            self.cpp_info.set_property("pkg_config_name", "cwalk")
 
         # TODO: to remove in conan v2 once cmake_find_package_* generators removed
         self.cpp_info.filenames["cmake_find_package"] = "Cwalk"
diff --git a/recipes/cwalk/all/patches/0001-fix-cmake-1.2.8.patch b/recipes/cwalk/all/patches/0001-fix-cmake-1.2.8.patch
new file mode 100644
index 0000000000000..fb90bad966d4c
--- /dev/null
+++ b/recipes/cwalk/all/patches/0001-fix-cmake-1.2.8.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ed38852..9d4ec62 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -41,7 +41,7 @@ endif()
+ add_library(cwalk
+   "${INCLUDE_DIRECTORY}/cwalk.h"
+   "${SOURCE_DIRECTORY}/cwalk.c")
+-enable_warnings(cwalk)
++# enable_warnings(cwalk)
+ target_include_directories(cwalk PUBLIC
+   $
+   $
diff --git a/recipes/cwalk/all/test_package/CMakeLists.txt b/recipes/cwalk/all/test_package/CMakeLists.txt
index 873589b946c24..49a93bc2fcd52 100644
--- a/recipes/cwalk/all/test_package/CMakeLists.txt
+++ b/recipes/cwalk/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 C)
 
 find_package(Cwalk REQUIRED CONFIG)
diff --git a/recipes/cwalk/all/test_v1_package/CMakeLists.txt b/recipes/cwalk/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 0d20897301b68..0000000000000
--- a/recipes/cwalk/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/cwalk/all/test_v1_package/conanfile.py b/recipes/cwalk/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/cwalk/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_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/cwalk/config.yml b/recipes/cwalk/config.yml
index 3a4a484ff7332..42be9164c47b3 100644
--- a/recipes/cwalk/config.yml
+++ b/recipes/cwalk/config.yml
@@ -1,4 +1,6 @@
 versions:
+  "1.2.8":
+    folder: all
   "1.2.7":
     folder: all
   "1.2.6":
diff --git a/recipes/cxxgraph/all/conandata.yml b/recipes/cxxgraph/all/conandata.yml
new file mode 100644
index 0000000000000..3b4bdb95b9d3a
--- /dev/null
+++ b/recipes/cxxgraph/all/conandata.yml
@@ -0,0 +1,7 @@
+sources:
+  "4.1.0":
+    url: "https://github.com/ZigRazor/CXXGraph/archive/refs/tags/v4.1.0.tar.gz"
+    sha256: "1f6601abfcb692f35bfe14f2a34b2302f70213a257b0f7d541a110d6bd460040"
+  "3.1.0":
+    url: "https://github.com/ZigRazor/CXXGraph/archive/refs/tags/v3.1.0.tar.gz"
+    sha256: "54838d0d35a6f2685cf45e50e888146aef3c1a10fbbdddb939b3985c7953087a"
diff --git a/recipes/cxxgraph/all/conanfile.py b/recipes/cxxgraph/all/conanfile.py
new file mode 100644
index 0000000000000..9765a25c1f6eb
--- /dev/null
+++ b/recipes/cxxgraph/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.files import copy, get
+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 CxxgraphConan(ConanFile):
+    name = "cxxgraph"
+    description = "Header-Only C++ Library for Graph Representation and Algorithms"
+    license = "MPL-2.0"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://github.com/ZigRazor/CXXGraph/"
+    topics = ("graph", "partitioning-algorithms", "dijkstra-algorithm", "graph-theory-algorithms", "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": "17",
+            "msvc": "193",
+        }
+
+    def configure(self):
+        if Version(self.version) < "4.0.0":
+            self.license = "AGPL-3.0-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, 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."
+            )
+
+        # TODO: remove this check once the bug is fixed
+        # https://github.com/ZigRazor/CXXGraph/pull/416
+        # https://github.com/ZigRazor/CXXGraph/pull/417
+        if is_msvc(self):
+            raise ConanInvalidConfiguration(f"{self.ref} doesn't support Visual Studio due to fold expression bug")
+
+    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",
+            os.path.join(self.source_folder, "include"),
+            os.path.join(self.package_folder, "include"),
+        )
+        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.extend(["pthread"])
diff --git a/recipes/cxxgraph/all/test_package/CMakeLists.txt b/recipes/cxxgraph/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..833f2dae3436f
--- /dev/null
+++ b/recipes/cxxgraph/all/test_package/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.15)
+project(test_package LANGUAGES CXX)
+
+find_package(cxxgraph REQUIRED CONFIG)
+
+add_executable(${PROJECT_NAME} test_package.cpp)
+target_link_libraries(${PROJECT_NAME} PRIVATE cxxgraph::cxxgraph)
+target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
diff --git a/recipes/cxxgraph/all/test_package/conanfile.py b/recipes/cxxgraph/all/test_package/conanfile.py
new file mode 100644
index 0000000000000..3a91c9439218e
--- /dev/null
+++ b/recipes/cxxgraph/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/cxxgraph/all/test_package/test_package.cpp b/recipes/cxxgraph/all/test_package/test_package.cpp
new file mode 100644
index 0000000000000..f651fa10d2f1e
--- /dev/null
+++ b/recipes/cxxgraph/all/test_package/test_package.cpp
@@ -0,0 +1,34 @@
+#include 
+
+#include "CXXGraph/CXXGraph.hpp"
+
+int main() {
+  CXXGraph::Node node0("0", 0);
+  CXXGraph::Node node1("1", 1);
+  CXXGraph::Node node2("2", 2);
+  CXXGraph::Node node3("3", 3);
+
+  CXXGraph::UndirectedWeightedEdge edge1(1, node1, node2, 2.0);
+  CXXGraph::UndirectedWeightedEdge edge2(2, node2, node3, 2.0);
+  CXXGraph::UndirectedWeightedEdge edge3(3, node0, node1, 2.0);
+  CXXGraph::UndirectedWeightedEdge edge4(4, node0, node3, 1.0);
+
+  CXXGraph::T_EdgeSet edgeSet;
+  edgeSet.insert(std::make_shared>(edge1));
+  edgeSet.insert(std::make_shared>(edge2));
+  edgeSet.insert(std::make_shared>(edge3));
+  edgeSet.insert(std::make_shared>(edge4));
+
+  // Can print out the edges for debugging
+  std::cout << edge1 << "\n";
+  std::cout << edge2 << "\n";
+  std::cout << edge3 << "\n";
+  std::cout << edge4 << "\n";
+
+  CXXGraph::Graph graph(edgeSet);
+  auto res = graph.dijkstra(node0, node2);
+
+  std::cout << "Dijkstra Result: " << res.result << "\n";
+
+  return 0;
+}
diff --git a/recipes/cxxgraph/config.yml b/recipes/cxxgraph/config.yml
new file mode 100644
index 0000000000000..e92b5abf9b97b
--- /dev/null
+++ b/recipes/cxxgraph/config.yml
@@ -0,0 +1,5 @@
+versions:
+  "4.1.0":
+    folder: all
+  "3.1.0":
+    folder: all
diff --git a/recipes/cxxopts/all/conandata.yml b/recipes/cxxopts/all/conandata.yml
index ed4fef59dd9bc..607b321614b3b 100644
--- a/recipes/cxxopts/all/conandata.yml
+++ b/recipes/cxxopts/all/conandata.yml
@@ -1,4 +1,7 @@
 sources:
+  "3.2.0":
+    url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.2.0.tar.gz"
+    sha256: "9f43fa972532e5df6c5fd5ad0f5bac606cdec541ccaf1732463d8070bbb7f03b"
   "3.1.1":
     url: "https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.1.1.tar.gz"
     sha256: "523175f792eb0ff04f9e653c90746c12655f10cb70f1d5e6d6d9491420298a08"
diff --git a/recipes/cxxopts/all/test_package/CMakeLists.txt b/recipes/cxxopts/all/test_package/CMakeLists.txt
index 00a1aead37e8f..38d92109613b0 100644
--- a/recipes/cxxopts/all/test_package/CMakeLists.txt
+++ b/recipes/cxxopts/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)
 
 enable_testing()
diff --git a/recipes/cxxopts/all/test_v1_package/CMakeLists.txt b/recipes/cxxopts/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 0d20897301b68..0000000000000
--- a/recipes/cxxopts/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/cxxopts/all/test_v1_package/conanfile.py b/recipes/cxxopts/all/test_v1_package/conanfile.py
deleted file mode 100644
index c68398ab15a88..0000000000000
--- a/recipes/cxxopts/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,27 +0,0 @@
-from conans import ConanFile, CMake, tools
-from io import StringIO
-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):
-            output = StringIO()
-            bin_path = os.path.join("bin", "test_package")
-            option_string = "-f 41 --bar baria --baz"
-            if self.options["cxxopts"].unicode:
-                option_string += " -q quxis"
-            self.run(f"{bin_path} {option_string}", run_environment=True, output=output)
-            output_lines = set(output.getvalue().splitlines())
-            expected_lines = {"foo:41", "bar:baria", "baz:1"}
-            if self.options["cxxopts"].unicode:
-                expected_lines.add("qux:quxis")
-            assert(expected_lines.issubset(output_lines))
diff --git a/recipes/cxxopts/config.yml b/recipes/cxxopts/config.yml
index 60f4de8e82260..eeafb07402ec8 100644
--- a/recipes/cxxopts/config.yml
+++ b/recipes/cxxopts/config.yml
@@ -1,4 +1,6 @@
 versions:
+  "3.2.0":
+    folder: all
   "3.1.1":
     folder: all
   "3.0.0":
diff --git a/recipes/cyclonedds-cxx/all/conanfile.py b/recipes/cyclonedds-cxx/all/conanfile.py
index 723b2660aff69..746610a5ede85 100644
--- a/recipes/cyclonedds-cxx/all/conanfile.py
+++ b/recipes/cyclonedds-cxx/all/conanfile.py
@@ -21,10 +21,12 @@ class CycloneDDSCXXConan(ConanFile):
     options = {
         "shared": [True, False],
         "fPIC": [True, False],
+        "with_shm": [True, False],
     }
     default_options = {
         "shared": False,
         "fPIC": True,
+        "with_shm": False,
     }
 
     @property
@@ -69,6 +71,9 @@ def requirements(self):
         #      :34
         self.requires("cyclonedds/{}".format(self.version), transitive_headers=True)
 
+        if self.options.with_shm:
+            self.requires("iceoryx/2.0.5")
+
     def validate(self):
         if self.settings.compiler.get_safe("cppstd"):
             check_min_cppstd(self, self._min_cppstd)
@@ -78,6 +83,10 @@ def validate(self):
                 f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
             )
 
+        if self.options.with_shm != self.dependencies['cyclonedds'].options.with_shm:
+            raise ConanInvalidConfiguration(
+                "cyclonedds-cxx and cyclonedds must be built with the same 'with_shm' option")
+
     def build_requirements(self):
         self.tool_requires("cmake/[>=3.16 <4]")
 
@@ -93,13 +102,14 @@ def generate(self):
         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_SHM"] = self.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()
+        deps = CMakeDeps(self)
+        deps.set_property("iceoryx", "cmake_file_name", "iceoryx_binding_c")
+        deps.generate()
 
     def _patch_sources(self):
         cmakelists = os.path.join(self.source_folder, "CMakeLists.txt")
@@ -150,13 +160,17 @@ def package_info(self):
         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"].includedirs = [os.path.join("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")
+        self.cpp_info.components["ddscxx"].requires = ["cyclonedds::CycloneDDS"]
+        if self.options.with_shm:
+            self.cpp_info.components["ddscxx"].requires.append("iceoryx::iceoryx")
         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.cpp_info.components["idlcxx"].requires = ["cyclonedds::idl"]
         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
index 4092a05fa5b94..f43c4dca3ca61 100644
--- a/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt
+++ b/recipes/cyclonedds-cxx/all/test_package/CMakeLists.txt
@@ -6,10 +6,10 @@ 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)
+target_link_libraries(test_package PRIVATE CycloneDDS-CXX::ddscxx)
 
 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)
+  target_link_libraries(test_message PRIVATE MessageLib CycloneDDS-CXX::ddscxx)
 endif()
diff --git a/recipes/cyclonedds/all/conanfile.py b/recipes/cyclonedds/all/conanfile.py
index f35480b98cba1..0101b2ed6cfa2 100644
--- a/recipes/cyclonedds/all/conanfile.py
+++ b/recipes/cyclonedds/all/conanfile.py
@@ -77,7 +77,7 @@ 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 <4]")
 
@@ -107,6 +107,7 @@ def generate(self):
         tc.variables["BUILD_IDLC_TESTING"] = False
         tc.variables["BUILD_DDSPERF"] = False
         tc.variables["BUILD_IDLC_TESTING"] = False
+        tc.cache_variables["ENABLE_LTO"] = False
         # variables which effects build
         tc.variables["ENABLE_SSL"] = self.options.with_ssl
         tc.variables["ENABLE_SHM"] = self.options.with_shm
diff --git a/recipes/cyclonedds/all/test_v1_package/CMakeLists.txt b/recipes/cyclonedds/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 0d20897301b68..0000000000000
--- a/recipes/cyclonedds/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/cyclonedds/all/test_v1_package/conanfile.py b/recipes/cyclonedds/all/test_v1_package/conanfile.py
deleted file mode 100644
index 1a9e66f7126fc..0000000000000
--- a/recipes/cyclonedds/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import os
-from conans import ConanFile, CMake
-from conan.tools import build
-
-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 build.cross_building(self):
-            bin_path = os.path.join("bin", "test_package")
-            self.run(bin_path, run_environment=True)
diff --git a/recipes/cyrus-sasl/all/conandata.yml b/recipes/cyrus-sasl/all/conandata.yml
index d24e3377974b4..dc549d33ab497 100644
--- a/recipes/cyrus-sasl/all/conandata.yml
+++ b/recipes/cyrus-sasl/all/conandata.yml
@@ -5,3 +5,14 @@ sources:
   "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"
+patches:
+  "2.1.28":
+    - patch_file: "patches/0001-use-attr-on-gnu.patch"
+      patch_source: https://github.com/cyrusimap/cyrus-sasl/commit/06f41c41e5c0f62ed5c1d703a9e2da42dfdb71f6
+      patch_description: "Fix https://github.com/cyrusimap/cyrus-sasl/issues/831"
+      patch_type: "official"
+  "2.1.27":
+    - patch_file: "patches/0001-use-attr-on-gnu.patch"
+      patch_source: https://github.com/cyrusimap/cyrus-sasl/commit/06f41c41e5c0f62ed5c1d703a9e2da42dfdb71f6
+      patch_description: "Fix https://github.com/cyrusimap/cyrus-sasl/issues/831"
+      patch_type: "official"
diff --git a/recipes/cyrus-sasl/all/conanfile.py b/recipes/cyrus-sasl/all/conanfile.py
index d9623fba3aec4..679cd0fdc5c3e 100644
--- a/recipes/cyrus-sasl/all/conanfile.py
+++ b/recipes/cyrus-sasl/all/conanfile.py
@@ -3,10 +3,10 @@
 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
+from conan.tools.files import copy, get, rm, rmdir, replace_in_file, export_conandata_patches, apply_conandata_patches
 from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain
 from conan.tools.layout import basic_layout
-from conan.tools.microsoft import unix_path
+from conan.tools.microsoft import unix_path, is_msvc, MSBuildDeps, MSBuildToolchain, MSBuild
 import os
 
 required_conan_version = ">=1.54.0"
@@ -41,6 +41,7 @@ class CyrusSaslConan(ConanFile):
         "with_postgresql": [True, False],
         "with_mysql": [True, False],
         "with_sqlite3": [True, False],
+        "with_saslauthd": [True, False],
     }
     default_options = {
         "shared": False,
@@ -57,8 +58,12 @@ class CyrusSaslConan(ConanFile):
         "with_postgresql": False,
         "with_mysql": False,
         "with_sqlite3": False,
+        "with_saslauthd": True,
     }
 
+    def export_sources(self):
+        export_conandata_patches(self)
+
     @property
     def _settings_build(self):
         return getattr(self, "settings_build", self.settings)
@@ -66,6 +71,16 @@ def _settings_build(self):
     def config_options(self):
         if self.settings.os == "Windows":
             del self.options.fPIC
+            # saslauthd doesn't compile on Windows
+            # https://www.cyrusimap.org/sasl/sasl/windows.html#install-windows
+            del self.options.with_saslauthd
+        if is_msvc(self):
+            # always required
+            del self.options.with_openssl
+            # not used
+            del self.options.with_postgresql
+            del self.options.with_mysql
+            del self.options.with_sqlite3
 
     def configure(self):
         if self.options.shared:
@@ -77,36 +92,32 @@ def layout(self):
         basic_layout(self, src_folder="src")
 
     def requirements(self):
-        if self.options.with_openssl:
+        if is_msvc(self) or self.options.with_openssl:
             self.requires("openssl/[>=1.1 <4]")
-        if self.options.with_postgresql:
+        if self.options.get_safe("with_postgresql"):
             self.requires("libpq/15.4")
-        if self.options.with_mysql:
+        if self.options.get_safe("with_mysql"):
             self.requires("libmysqlclient/8.1.0")
-        if self.options.with_sqlite3:
+        if self.options.get_safe("with_sqlite3"):
             self.requires("sqlite3/3.44.2")
 
     def validate(self):
-        if self.settings.os == "Windows":
-            raise ConanInvalidConfiguration(
-                "Cyrus SASL package is not compatible with Windows yet."
-            )
+        if is_msvc(self) and not self.options.shared:
+            raise ConanInvalidConfiguration("Static library output is not supported when building with MSVC")
         if self.options.with_gssapi:
             raise ConanInvalidConfiguration(
                 f"{self.name}:with_gssapi=True requires krb5 recipe, not yet available in conan-center",
             )
 
     def build_requirements(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")
+        if not is_msvc(self):
+            self.tool_requires("gnu-config/cci.20210814")
 
     def source(self):
         get(self, **self.conan_data["sources"][self.version], strip_root=True)
+        apply_conandata_patches(self)
 
-    def generate(self):
+    def _generate_autotools(self):
         env = VirtualBuildEnv(self)
         env.generate()
         if not cross_building(self):
@@ -135,6 +146,7 @@ def generate(self):
             "--with-mysql={}".format(rootpath_no(self.options.with_mysql, "libmysqlclient")),
             "--without-sqlite",
             "--with-sqlite3={}".format(rootpath_no(self.options.with_sqlite3, "sqlite3")),
+            "--with-saslauthd={}".format(yes_no(self.options.with_saslauthd)),
         ])
         if self.options.with_gssapi:
             tc.configure_args.append("--with-gss_impl=mit")
@@ -143,26 +155,93 @@ def generate(self):
         deps = AutotoolsDeps(self)
         deps.generate()
 
-    def _patch_sources(self):
+    def _patch_sources_autotools(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=os.path.join(self.source_folder, "config"))
+                     src=os.path.dirname(gnu_config),
+                     dst=os.path.join(self.source_folder, "config"))
 
-    def build(self):
-        self._patch_sources()
+    def _build_autotools(self):
+        self._patch_sources_autotools()
         autotools = Autotools(self)
         autotools.configure()
         autotools.make()
 
+    @property
+    def _msbuild_configuration(self):
+        return "Debug" if self.settings.build_type == "Debug" else "Release"
+
+    def _generate_msvc(self):
+        tc = MSBuildToolchain(self)
+        tc.configuration = self._msbuild_configuration
+        # disable OpenSSL 3 warnings, which get raised as errors
+        tc.cxxflags.append("/wo4996")
+        tc.generate()
+
+        deps = MSBuildDeps(self)
+        deps.configuration = self._msbuild_configuration
+        deps.generate()
+
+    def _patch_sources_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""
+        for vcxproj_file in self.source_path.joinpath("win32").glob("*.vcxproj"):
+            replace_in_file(self, vcxproj_file,
+                            "v140",
+                            f"{platform_toolset}")
+            replace_in_file(self, vcxproj_file, "8.1", "")
+            if props_path:
+                replace_in_file(self, vcxproj_file,
+                                '',
+                                f'{import_conan_generators}')
+        replace_in_file(self, os.path.join(self.source_folder, "win32", "openssl.props"),
+                        "libeay32.lib;", "")
+        # https://github.com/cyrusimap/cyrus-sasl/issues/730
+        copy(self, "md5global.h",
+             src=os.path.join(self.source_folder, "win32", "include"),
+             dst=os.path.join(self.source_folder, "include"))
+
+    def _build_msvc(self):
+        self._patch_sources_msvc()
+        msbuild = MSBuild(self)
+        msbuild.build_type = self._msbuild_configuration
+        msbuild.build(sln=os.path.join(self.source_folder, "win32", "cyrus-sasl-common.sln"))
+        msbuild.build(sln=os.path.join(self.source_folder, "win32", "cyrus-sasl-core.sln"))
+        # TODO: add sasldb support
+        # msbuild.build(sln=os.path.join(self.source_folder, "win32", "cyrus-sasl-sasldb.sln"))
+        if self.options.with_gssapi:
+            msbuild.build(sln=os.path.join(self.source_folder, "win32", "cyrus-sasl-gssapiv2.sln"))
+
+    def generate(self):
+        if is_msvc(self):
+            self._generate_msvc()
+        else:
+            self._generate_autotools()
+
+    def build(self):
+        if is_msvc(self):
+            self._build_msvc()
+        else:
+            self._build_autotools()
+
     def package(self):
         copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
-        autotools = Autotools(self)
-        autotools.install()
+        if is_msvc(self):
+            copy(self, "*/sasl2.lib", os.path.join(self.source_folder, "win32"), os.path.join(self.package_folder, "lib"), keep_path=False)
+            copy(self, "*/sasl2.dll", os.path.join(self.source_folder, "win32"), 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", "sasl"))
+        else:
+            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"), recursive=True)
@@ -172,5 +251,12 @@ def package_info(self):
         self.cpp_info.set_property("pkg_config_name", "libsasl2")
         self.cpp_info.libs = ["sasl2"]
 
+        if self.settings.os in ["Linux", "FreeBSD"]:
+            self.cpp_info.system_libs = ["resolv"]
+            if self.options.with_saslauthd:
+                self.cpp_info.system_libs.append("crypt")
+        elif is_msvc(self):
+            self.cpp_info.system_libs = ["ws2_32"]
+
         # TODO: to remove in conan v2
         self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
diff --git a/recipes/cyrus-sasl/all/patches/0001-use-attr-on-gnu.patch b/recipes/cyrus-sasl/all/patches/0001-use-attr-on-gnu.patch
new file mode 100644
index 0000000000000..0933974795e5b
--- /dev/null
+++ b/recipes/cyrus-sasl/all/patches/0001-use-attr-on-gnu.patch
@@ -0,0 +1,31 @@
+From 06f41c41e5c0f62ed5c1d703a9e2da42dfdb71f6 Mon Sep 17 00:00:00 2001
+From: Howard Chu 
+Date: Wed, 24 Jul 2024 19:27:04 +0100
+Subject: [PATCH] include: only use __attribute__ on Gnu C
+
+It's a compiler-specific feature and we can't depend on other
+compilers supporting it identically or at all.
+Fix #831.
+
+Signed-off-by: Howard Chu 
+---
+ include/prop.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/include/prop.h b/include/prop.h
+index fed3fa77..ea38707a 100644
+--- a/include/prop.h
++++ b/include/prop.h
+@@ -53,6 +53,12 @@
+ # define LIBSASL_VAR extern
+ #endif /* WIN32 */
+ 
++/* Only use __attribute__ on Gnu C */
++#ifndef __GNUC__
++#undef __attribute__
++#define __attribute__(foo)
++#endif /* __GNUC__ */
++
+ /* the resulting structure for property values
+  */
+ struct propval {
diff --git a/recipes/cyrus-sasl/all/test_package/test_package.c b/recipes/cyrus-sasl/all/test_package/test_package.c
index 8851f184023fd..482da5d15274f 100644
--- a/recipes/cyrus-sasl/all/test_package/test_package.c
+++ b/recipes/cyrus-sasl/all/test_package/test_package.c
@@ -1,4 +1,5 @@
 #include 
+#include 
 
 #include 
 
@@ -8,6 +9,7 @@ int main(int argc, char *argv[])
     sasl_version_info(&implementation, &version, NULL, NULL, NULL, NULL);
     printf("--------------------------->Tests are done.<--------------------------\n");
     printf("SASL Using implementation: %s, version: %s\n", implementation, version);
+    printf("SASL Utils version: %d\n", SASL_UTILS_VERSION);
     printf("//////////////////////////////////////////////////////////////////////\n");
     return 0;
 }
diff --git a/recipes/czmq/all/conanfile.py b/recipes/czmq/all/conanfile.py
index 7b0ce0b66f5a1..df813b1ec7e7b 100644
--- a/recipes/czmq/all/conanfile.py
+++ b/recipes/czmq/all/conanfile.py
@@ -1,14 +1,13 @@
 from conan import ConanFile
-from conan.errors import ConanInvalidConfiguration
+from conan.errors import ConanInvalidConfiguration, ConanException
 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, copy, rm, rmdir, save
+from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir
 from conan.tools.microsoft import is_msvc
 from conan.tools.scm import Version
 import os
-import textwrap
 
-required_conan_version = ">=1.53.0"
+required_conan_version = ">=2.1"
 
 
 class CzmqConan(ConanFile):
@@ -98,6 +97,9 @@ def generate(self):
             tc.preprocessor_definitions["_NOEXCEPT"] = "noexcept"
         # Relocatable shared libs on macOS
         tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW"
+        tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support
+        if Version(self.version) > "4.2.1": # pylint: disable=conan-unreachable-upper-version
+            raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4")
         tc.generate()
 
         dpes = CMakeDeps(self)
@@ -120,26 +122,6 @@ def package(self):
         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),
-            {self._czmq_target: "czmq::czmq"}
-        )
-
-    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")
-
     @property
     def _czmq_target(self):
         return "czmq" if self.options.shared else "czmq-static"
@@ -148,6 +130,7 @@ def package_info(self):
         self.cpp_info.set_property("cmake_file_name", "czmq")
         self.cpp_info.set_property("cmake_target_name", self._czmq_target)
         self.cpp_info.set_property("pkg_config_name", "libczmq")
+
         prefix = "lib" if is_msvc(self) and not self.options.shared else ""
         self.cpp_info.libs = [f"{prefix}czmq"]
         if not self.options.shared:
@@ -157,6 +140,4 @@ def package_info(self):
         elif self.settings.os == "Windows":
             self.cpp_info.system_libs.append("rpcrt4")
 
-        # 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/czmq/all/test_package/CMakeLists.txt b/recipes/czmq/all/test_package/CMakeLists.txt
index 5ffa50b2e16b5..05f944993aa39 100644
--- a/recipes/czmq/all/test_package/CMakeLists.txt
+++ b/recipes/czmq/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 CXX)
 
 find_package(czmq REQUIRED CONFIG)
diff --git a/recipes/czmq/all/test_v1_package/CMakeLists.txt b/recipes/czmq/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index be00a8c7f57c7..0000000000000
--- a/recipes/czmq/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/czmq/all/test_v1_package/conanfile.py b/recipes/czmq/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/czmq/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_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/dacap-clip/all/conandata.yml b/recipes/dacap-clip/all/conandata.yml
index f4f5540f11df5..4c3c17aeedcf5 100644
--- a/recipes/dacap-clip/all/conandata.yml
+++ b/recipes/dacap-clip/all/conandata.yml
@@ -1,4 +1,10 @@
 sources:
+  "1.9":
+    url: "https://github.com/dacap/clip/archive/refs/tags/v1.9.tar.gz"
+    sha256: "e8af414c720784a6005419afb087786c05602e998ec52b2efe9e3112b7535d30"
+  "1.8":
+    url: "https://github.com/dacap/clip/archive/refs/tags/v1.8.tar.gz"
+    sha256: "a54d243451fb483590ffd9239a3c55f8d8e672d44df63dc2b81da01a229074bc"
   "1.7":
     url: "https://github.com/dacap/clip/archive/refs/tags/v1.7.tar.gz"
     sha256: "f494d306f3425e984368cbd94ffb213e0a3b3d44c3ab169e5134788d3342535c"
diff --git a/recipes/dacap-clip/all/conanfile.py b/recipes/dacap-clip/all/conanfile.py
index c4021d403c55f..9c743f68fab4e 100644
--- a/recipes/dacap-clip/all/conanfile.py
+++ b/recipes/dacap-clip/all/conanfile.py
@@ -7,6 +7,7 @@
 from conan.tools.microsoft import is_msvc
 from conan.tools.apple import is_apple_os
 from conan.tools.build import check_min_cppstd
+from conan.tools.scm import Version
 
 required_conan_version = ">=1.53.0"
 
@@ -23,11 +24,13 @@ class DacapClipConan(ConanFile):
         "shared": [True, False],
         "fPIC": [True, False],
         "with_png": [True, False],
+        "with_image": [True, False],
     }
     default_options = {
         "shared": False,
         "fPIC": True,
         "with_png": True,
+        "with_image": True,
     }
 
     @property
@@ -37,19 +40,21 @@ def _min_cppstd(self):
     def config_options(self):
         if self.settings.os == "Windows":
             del self.options.fPIC
+        if self.settings.os not in ["Linux", "FreeBSD"]:
+            del self.options.with_png
+        if Version(self.version) < "1.8":
+            del self.options.with_image
 
     def configure(self):
         if self.options.shared:
             self.options.rm_safe("fPIC")
-        if self.settings.os not in ["Linux", "FreeBSD"]:
-            del self.options.with_png
 
     def layout(self):
         cmake_layout(self, src_folder="src")
 
     def requirements(self):
         if self.options.get_safe("with_png", False):
-            self.requires("libpng/1.6.37")
+            self.requires("libpng/[>=1.6 <2]")
         if self.settings.os == "Linux":
             self.requires("xorg/system")
 
@@ -67,6 +72,7 @@ def generate(self):
         toolchain.variables["CLIP_EXAMPLES"] = False
         toolchain.variables["CLIP_TESTS"] = False
         toolchain.variables["CLIP_X11_WITH_PNG"] = self.options.get_safe("with_png", False)
+        toolchain.variables["CLIP_ENABLE_IMAGE"] = self.options.get_safe("with_image", False)
         if is_msvc(self):
             toolchain.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = bool(self.options.shared)
         toolchain.generate()
@@ -93,6 +99,8 @@ def package_info(self):
 
         if self.options.get_safe("with_png", False):
             self.cpp_info.requires.append("libpng::libpng")
+        if self.options.get_safe("with_image", False):
+            self.cpp_info.defines.append("CLIP_ENABLE_IMAGE=1")
 
         if self.settings.os in ["Linux", "FreeBSD"]:
             self.cpp_info.requires.append("xorg::xcb")
@@ -108,6 +116,6 @@ def package_info(self):
         self.cpp_info.set_property("cmake_file_name", "clip")
         self.cpp_info.set_property("cmake_target_name", "clip::clip")
 
-        # TODO: Remove on Conan 2.0
+    # TODO: Remove on Conan 2.0
         self.cpp_info.names["cmake_find_package"] = "clip"
         self.cpp_info.names["cmake_find_package_multi"] = "clip"
diff --git a/recipes/dacap-clip/all/test_package/CMakeLists.txt b/recipes/dacap-clip/all/test_package/CMakeLists.txt
index 3913723472269..23d1fed50c093 100644
--- a/recipes/dacap-clip/all/test_package/CMakeLists.txt
+++ b/recipes/dacap-clip/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(clip REQUIRED CONFIG)
diff --git a/recipes/dacap-clip/all/test_v1_package/CMakeLists.txt b/recipes/dacap-clip/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 784c43a27c83a..0000000000000
--- a/recipes/dacap-clip/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-cmake_minimum_required(VERSION 3.8)
-project(test_package CXX)
-
-include("${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake")
-conan_basic_setup(TARGETS)
-
-find_package(clip REQUIRED CONFIG)
-
-add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)
-target_link_libraries(${PROJECT_NAME} clip::clip)
-target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
diff --git a/recipes/dacap-clip/all/test_v1_package/conanfile.py b/recipes/dacap-clip/all/test_v1_package/conanfile.py
deleted file mode 100644
index e9bf8aa5f82dd..0000000000000
--- a/recipes/dacap-clip/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import os
-
-from conans import ConanFile, CMake
-from conan.tools.build import cross_building
-
-
-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 cross_building(self):
-            bin_path = os.path.join("bin", "test_package")
-            self.run(bin_path, run_environment=True)
diff --git a/recipes/dacap-clip/config.yml b/recipes/dacap-clip/config.yml
index f10766e09880a..baafafbfe03c1 100644
--- a/recipes/dacap-clip/config.yml
+++ b/recipes/dacap-clip/config.yml
@@ -1,4 +1,8 @@
 versions:
+  "1.9":
+    folder: "all"
+  "1.8":
+    folder: "all"
   "1.7":
     folder: "all"
   "1.6":
diff --git a/recipes/dataframe/all/conandata.yml b/recipes/dataframe/all/conandata.yml
index 6ea3f55c476e4..64c739f1fc850 100644
--- a/recipes/dataframe/all/conandata.yml
+++ b/recipes/dataframe/all/conandata.yml
@@ -1,4 +1,25 @@
 sources:
+  "3.5.0":
+    url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/3.5.0.tar.gz"
+    sha256: "36d7c935f720d5300ea93941599b4d53884198fb504ad60b9a1b55189199ee4d"
+  "3.4.0":
+    url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/3.4.0.tar.gz"
+    sha256: "84aafa6bd1bf2000232e380f12eea0de01b2d0da88930aa4416aee524a8736aa"
+  "3.3.0":
+    url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/3.3.0.tar.gz"
+    sha256: "57a722592a29ee8fca902983411c78e7f4179c402a8b0b905f96916c9694672a"
+  "3.2.0":
+    url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/3.2.0.tar.gz"
+    sha256: "44c513ef7956976738c2ca37384a220c5383e95fc363ad933541c6f3eef9d294"
+  "3.1.0":
+    url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/3.1.0.tar.gz"
+    sha256: "09280a81f17d87d171062210c904c1acd94b1cdcf4c040eaa16cc9d224d526d4"
+  "3.0.0":
+    url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/3.0.0.tar.gz"
+    sha256: "9266fb85c518a251a5440e490c81615601791f2de2fad8755aa09f13a0c541f9"
+  "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"
@@ -8,21 +29,6 @@ sources:
   "2.0.0":
     url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/2.0.0.tar.gz"
     sha256: "df46ab60153f75ef0a1ab269e6b107ec34fdc467993c3984029d7deb5e0fab6c"
-  "1.22.0":
-    url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/1.22.0.tar.gz"
-    sha256: "4b244241cd56893fccb22f7c874588f0d86b444912382ed6e9a4cf95e55ffda2"
-  "1.21.0":
-    url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/1.21.0.tar.gz"
-    sha256: "a6b07eaaf628225a34e4402c1a6e311430e8431455669ac03691d92f44081172"
-  "1.20.0":
-    url: "https://github.com/hosseinmoein/DataFrame/archive/refs/tags/1.20.0.tar.gz"
-    sha256: "5c241c71823c6975251f49316e03724f06cd3a288892f5a76dd504fe08700b6d"
-  "1.19.0":
-    url: "https://github.com/hosseinmoein/DataFrame/archive/1.19.0.tar.gz"
-    sha256: "81382e9c68df7c52f69f645b1830fcd3634eedc07fa3d2024ee6c57cf2cdb7ff"
-  "1.18.0":
-    url: "https://github.com/hosseinmoein/DataFrame/archive/1.18.0.tar.gz"
-    sha256: "8cdb8b246263fbd8fcef07b6300f6aefb58b3a54cd67e5cbe5383bc948305844"
 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 33deb412912f9..0d0d764dc9b68 100644
--- a/recipes/dataframe/all/conanfile.py
+++ b/recipes/dataframe/all/conanfile.py
@@ -15,7 +15,7 @@ class DataFrameConan(ConanFile):
     name = "dataframe"
     description = (
         "C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ "
-        "using native types, continuous memory storage, and no pointers are involved"
+        "using native types and contiguous memory storage"
     )
     license = "BSD-3-Clause"
     url = "https://github.com/conan-io/conan-center-index"
@@ -50,7 +50,12 @@ class DataFrameConan(ConanFile):
 
     @property
     def _min_cppstd(self):
-        return "20" if Version(self.version) >= "2.1.0" else "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):
@@ -69,6 +74,13 @@ def _minimum_compilers_version(self):
                 "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):
@@ -86,9 +98,6 @@ def layout(self):
         cmake_layout(self, src_folder="src")
 
     def validate(self):
-        if is_msvc(self) and self.options.shared and Version(self.version) < "1.20.0":
-            raise ConanInvalidConfiguration(f"{self.ref} doesn't support shared lib with Visual Studio")
-
         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)
@@ -110,33 +119,13 @@ def source(self):
 
     def generate(self):
         tc = CMakeToolchain(self)
-        if Version(self.version) >= "1.20.0":
-            tc.variables["HMDF_TESTING"] = False
-            tc.variables["HMDF_EXAMPLES"] = False
-            tc.variables["HMDF_BENCHMARKS"] = False
-        elif Version(self.version) >= "1.14.0":
-            tc.variables["ENABLE_TESTING"] = False
+        tc.variables["HMDF_TESTING"] = False
+        tc.variables["HMDF_EXAMPLES"] = False
+        tc.variables["HMDF_BENCHMARKS"] = False
         tc.generate()
 
-    def _patch_sources(self):
-        apply_conandata_patches(self)
-        # Don't pollute RPATH
-        if Version(self.version) < "1.20.0":
-            replace_in_file(
-                self,
-                os.path.join(self.source_folder, "CMakeLists.txt"),
-                textwrap.dedent("""\
-                    include(AddInstallRPATHSupport)
-                    add_install_rpath_support(BIN_DIRS "${CMAKE_INSTALL_FULL_LIBDIR}"
-                                              LIB_DIRS "${CMAKE_INSTALL_FULL_BINDIR}"
-                                              INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}"
-                                              USE_LINK_PATH)
-                """),
-                "",
-            )
-
     def build(self):
-        self._patch_sources()
+        apply_conandata_patches(self)
         cmake = CMake(self)
         cmake.configure()
         cmake.build()
@@ -164,10 +153,7 @@ def package_info(self):
             self.cpp_info.system_libs.extend(["pthread", "rt", "m"])
         if is_msvc(self):
             self.cpp_info.defines.append("_USE_MATH_DEFINES")
-            if Version(self.version) < "1.20.0" and not self.options.shared:
-                # weird but required in those versions of dataframe
-                self.cpp_info.defines.append("LIBRARY_EXPORTS")
-        if Version(self.version) >= "1.20.0" and self.options.shared:
+        if self.options.shared:
             self.cpp_info.defines.append("HMDF_SHARED")
 
         # TODO: to remove in conan v2 once cmake_find_package_* generators removed
diff --git a/recipes/dataframe/all/test_package/CMakeLists.txt b/recipes/dataframe/all/test_package/CMakeLists.txt
index b1fa419a617f6..b68eb3afa6e78 100644
--- a/recipes/dataframe/all/test_package/CMakeLists.txt
+++ b/recipes/dataframe/all/test_package/CMakeLists.txt
@@ -1,11 +1,13 @@
-cmake_minimum_required(VERSION 3.12)
+cmake_minimum_required(VERSION 3.15)
 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)
-if (DataFrame_VERSION VERSION_GREATER_EQUAL "2.1.0")
+if(DataFrame_VERSION VERSION_GREATER_EQUAL "2.3.0")
+    target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
+elseif(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)
diff --git a/recipes/dataframe/all/test_v1_package/CMakeLists.txt b/recipes/dataframe/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index be00a8c7f57c7..0000000000000
--- a/recipes/dataframe/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/dataframe/all/test_v1_package/conanfile.py b/recipes/dataframe/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/dataframe/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_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/dataframe/config.yml b/recipes/dataframe/config.yml
index 7972770297f04..381de834dd298 100644
--- a/recipes/dataframe/config.yml
+++ b/recipes/dataframe/config.yml
@@ -1,17 +1,23 @@
 versions:
-  "2.2.0":
+  "3.5.0":
     folder: all
-  "2.1.0":
+  "3.4.0":
     folder: all
-  "2.0.0":
+  "3.3.0":
+    folder: all
+  "3.2.0":
     folder: all
-  "1.22.0":
+  "3.1.0":
     folder: all
-  "1.21.0":
+  "3.0.0":
     folder: all
-  "1.20.0":
+  "2.3.0":
     folder: all
-  "1.19.0":
+  # last version for C++20
+  "2.2.0":
+    folder: all
+  "2.1.0":
     folder: all
-  "1.18.0":
+  # last version for C++17
+  "2.0.0":
     folder: all
diff --git a/recipes/date/all/conandata.yml b/recipes/date/all/conandata.yml
index bed2d768a8963..94e4bf0b1e51f 100644
--- a/recipes/date/all/conandata.yml
+++ b/recipes/date/all/conandata.yml
@@ -1,4 +1,10 @@
 sources:
+  "3.0.3":
+    url: "https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.3.tar.gz"
+    sha256: "30de45a34a2605cca33a993a9ea54e8f140f23b1caf1acf3c2fd436c42c7d942"
+  "3.0.2":
+    url: "https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.2.tar.gz"
+    sha256: "0449667ea85c5b411c28d08a53f1e420c73416caa5b693c249dac9763eb97b7c"
   "3.0.1":
     url: "https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.1.tar.gz"
     sha256: "7a390f200f0ccd207e8cff6757e04817c1a0aec3e327b006b7eb451c57ee3538"
diff --git a/recipes/date/all/conanfile.py b/recipes/date/all/conanfile.py
index 315ca73f8ae1f..8db1625fd6096 100644
--- a/recipes/date/all/conanfile.py
+++ b/recipes/date/all/conanfile.py
@@ -73,9 +73,10 @@ def generate(self):
         tc.variables["USE_SYSTEM_TZ_DB"] = self.options.use_system_tz_db
         tc.variables["USE_TZ_DB_IN_DOT"] = self.options.use_tz_db_in_dot
         tc.variables["BUILD_TZ_LIB"] = not self.options.header_only
-        # workaround for clang 5 not having string_view
-        if Version(self.version) >= "3.0.0" and self.settings.compiler == "clang" \
-                and Version(self.settings.compiler.version) <= "5.0":
+        # workaround for gcc 7 and clang 5 not having string_view
+        if Version(self.version) >= "3.0.0" and \
+            ((self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "7.0") or \
+             (self.settings.compiler == "clang" and Version(self.settings.compiler.version) <= "5.0")):
             tc.cache_variables["DISABLE_STRING_VIEW"] = True
         tc.generate()
 
@@ -91,20 +92,13 @@ def build(self):
 
     def package(self):
         copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
-        if self.options.header_only:
-            src = os.path.join(self.source_folder, "include", "date")
-            dst = os.path.join(self.package_folder, "include", "date")
-            copy(self, "date.h", dst=dst, src=src)
-            copy(self, "tz.h", dst=dst, src=src)
-            copy(self, "ptz.h", dst=dst, src=src)
-            copy(self, "iso_week.h", dst=dst, src=src)
-            copy(self, "julian.h", dst=dst, src=src)
-            copy(self, "islamic.h", dst=dst, src=src)
-        else:
+        if not self.options.header_only:
             cmake = CMake(self)
             cmake.install()
             rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
             rmdir(self, os.path.join(self.package_folder, "CMake"))
+        copy(self, "*.h", dst=os.path.join(self.package_folder, "include", "date"),
+                src=os.path.join(self.source_folder, "include", "date"))
 
     def package_info(self):
         self.cpp_info.set_property("cmake_file_name", "date")
@@ -120,18 +114,13 @@ def package_info(self):
             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 in ["Linux", "FreeBSD"]:
-                self.cpp_info.components["date-tz"].system_libs.append("pthread")
-                self.cpp_info.components["date-tz"].system_libs.append("m")
+                self.cpp_info.components["date-tz"].system_libs.extend(["m", "pthread"])
 
             if not self.options.use_system_tz_db:
                 self.cpp_info.components["date-tz"].requires.append("libcurl::libcurl")
 
-            if self.options.use_system_tz_db and not self.settings.os == "Windows":
-                use_os_tzdb = 1
-            else:
-                use_os_tzdb = 0
-
-            defines = ["USE_OS_TZDB={}".format(use_os_tzdb)]
+            use_os_tzdb = 1 if self.options.use_system_tz_db and not self.settings.os == "Windows" else 0
+            defines = [f"USE_OS_TZDB={use_os_tzdb}"]
             if self.settings.os == "Windows" and self.options.shared:
                 defines.append("DATE_USE_DLL=1")
 
diff --git a/recipes/date/all/test_package/CMakeLists.txt b/recipes/date/all/test_package/CMakeLists.txt
index 276e986aaf0a2..7a4b3fe1c9b08 100644
--- a/recipes/date/all/test_package/CMakeLists.txt
+++ b/recipes/date/all/test_package/CMakeLists.txt
@@ -1,7 +1,7 @@
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.15)
 project(test_package LANGUAGES CXX)
 
-find_package(date REQUIRED CONFIG)
+find_package(date REQUIRED)
 
 add_executable(${PROJECT_NAME} test_package.cpp)
 target_link_libraries(${PROJECT_NAME} PRIVATE date::date)
diff --git a/recipes/date/all/test_package/test_package.cpp b/recipes/date/all/test_package/test_package.cpp
index 8dcac9f656989..4ccf632e8e904 100644
--- a/recipes/date/all/test_package/test_package.cpp
+++ b/recipes/date/all/test_package/test_package.cpp
@@ -1,60 +1,16 @@
 #include "date/date.h"
 #include "date/tz.h"
-
-#include 
-#include 
 #include 
-#include 
-
-class ZoneOffset {
-public:
-    explicit ZoneOffset(std::chrono::minutes offset)
-        : _offset(offset) {}
-
-    template 
-    auto to_local(date::sys_time tp) const
-        -> date::local_time::type> {
-        using namespace date;
-        using namespace std::chrono;
-        using LT = local_time::type>;
-        return LT{(tp + _offset).time_since_epoch()};
-    }
-
-    template 
-    auto to_sys(date::local_time tp) const
-        -> date::sys_time::type> {
-        using namespace date;
-        using namespace std::chrono;
-        using ST = sys_time::type>;
-        return ST{(tp - _offset).time_since_epoch()};
-    }
-
-private:
-    std::chrono::minutes _offset;
-};
 
 int main() {
-    using namespace std::chrono;
-    using namespace date;
-
-    auto date1 = 2015_y/March/22;
-    std::cout << date1 << '\n';
-    auto date2 = March/22/2015;
-    std::cout << date2 << '\n';
-    auto date3 = 22_d/March/2015;
-    std::cout << date3 << '\n';
-
-    ZoneOffset p3_45{hours{3} + minutes{45}};
-    zoned_time zt{&p3_45, floor(system_clock::now())};
-    std::cout << zt.get_sys_time() << " (sys time)\n";
-    std::cout << zt.get_local_time() << " (local time)\n";
+    const date::year_month_day conan_two(date::year(2023), date::month(2), date::day(22));
+    std::cout << "Conan was released on: " << conan_two << std::endl;
 
 #ifndef DATE_HEADER_ONLY
     try {
-        auto tz = date::current_zone()->name();
-        std::cout << "timezone: " << tz << std::endl;
-    } catch (const std::exception & e) {
-         std::cout << "exception caught " << e.what() << std::endl;
+        const date::time_zone* tz = date::current_zone();
+    }
+    catch (const std::exception & e) {
     }
 #endif
 
diff --git a/recipes/date/all/test_v1_package/CMakeLists.txt b/recipes/date/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 925ecbe19e448..0000000000000
--- a/recipes/date/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/date/all/test_v1_package/conanfile.py b/recipes/date/all/test_v1_package/conanfile.py
deleted file mode 100644
index 09dc5f4a353ed..0000000000000
--- a/recipes/date/all/test_v1_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.definitions["DATE_HEADER_ONLY"] = self.options["date:header_only"]
-        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/date/config.yml b/recipes/date/config.yml
index f4831f05aaf9e..7fe264ed2099a 100644
--- a/recipes/date/config.yml
+++ b/recipes/date/config.yml
@@ -1,4 +1,8 @@
 versions:
+  "3.0.3":
+    folder: all
+  "3.0.2":
+    folder: all
   "3.0.1":
     folder: all
   "3.0.0":
diff --git a/recipes/dav1d/all/conandata.yml b/recipes/dav1d/all/conandata.yml
index 7841b712b35c9..be4e7f8263cbc 100644
--- a/recipes/dav1d/all/conandata.yml
+++ b/recipes/dav1d/all/conandata.yml
@@ -1,16 +1,13 @@
 sources:
+  "1.4.3":
+    url: "http://ftp.videolan.org/pub/videolan/dav1d/1.4.3/dav1d-1.4.3.tar.xz"
+    sha256: "42fe524bcc82ea3a830057178faace22923a79bad3d819a4962d8cfc54c36f19"
+  "1.4.1":
+    url: "http://ftp.videolan.org/pub/videolan/dav1d/1.4.1/dav1d-1.4.1.tar.xz"
+    sha256: "8d407dd5fe7986413c937b14e67f36aebd06e1fa5cfec679d10e548476f2d5f8"
+  "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"
-  "1.0.0":
-    url: "http://ftp.videolan.org/pub/videolan/dav1d/1.0.0/dav1d-1.0.0.tar.xz"
-    sha256: "51737db7e4897e599684f873a4725176dd3c779e639411d7c4fce134bb5ebb82"
-  "0.9.1":
-    url: "http://ftp.videolan.org/pub/videolan/dav1d/0.9.1/dav1d-0.9.1.tar.xz"
-    sha256: "a35d6468013eb14e8093ea463594f8b89aba1775a3005fc9ec6fa36b2d2c71d7"
-  "0.8.1":
-    url: "http://ftp.videolan.org/pub/videolan/dav1d/0.8.1/dav1d-0.8.1.tar.xz"
-    sha256: "a4b503063d411dd129f5eb43616675e613b36ac0aa1e449976d645c05add21ea"
diff --git a/recipes/dav1d/all/conanfile.py b/recipes/dav1d/all/conanfile.py
index 5882f930a7dbd..08d0c4d8be0f5 100644
--- a/recipes/dav1d/all/conanfile.py
+++ b/recipes/dav1d/all/conanfile.py
@@ -5,7 +5,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
 
 required_conan_version = ">=1.53.0"
@@ -26,7 +25,7 @@ class Dav1dConan(ConanFile):
         "bit_depth": ["all", 8, 16],
         "with_tools": [True, False],
         "assembly": [True, False],
-        "with_avx512": [True, False],
+        "with_avx512": ["deprecated", True, False],
     }
     default_options = {
         "shared": False,
@@ -34,7 +33,7 @@ class Dav1dConan(ConanFile):
         "bit_depth": "all",
         "with_tools": True,
         "assembly": True,
-        "with_avx512": False,
+        "with_avx512": "deprecated",
     }
 
     def config_options(self):
@@ -43,24 +42,27 @@ def config_options(self):
         if is_msvc(self) and self.settings.build_type == "Debug":
             # debug builds with assembly often causes linker hangs or LNK1000
             self.options.assembly = False
-        if Version(self.version) < "1.0.0":
-            del self.options.with_avx512
 
     def configure(self):
         if self.options.shared:
             self.options.rm_safe("fPIC")
         self.settings.rm_safe("compiler.cppstd")
         self.settings.rm_safe("compiler.libcxx")
-        if not self.options.assembly:
-            self.options.rm_safe("with_avx512")
 
     def layout(self):
         basic_layout(self, src_folder="src")
 
+    def package_id(self):
+        del self.info.options.with_avx512
+
+    def validate(self):
+        if self.options.with_avx512 != "deprecated":
+            self.output.warning("The 'with_avx512' option is deprecated and has no effect")
+
     def build_requirements(self):
-        self.tool_requires("meson/1.2.1")
+        self.tool_requires("meson/1.4.0")
         if self.options.assembly:
-            self.tool_requires("nasm/2.15.05")
+            self.tool_requires("nasm/2.16.01")
 
     def source(self):
         get(self, **self.conan_data["sources"][self.version], strip_root=True)
@@ -72,8 +74,6 @@ def generate(self):
         tc = MesonToolchain(self)
         tc.project_options["enable_tests"] = False
         tc.project_options["enable_asm"] = self.options.assembly
-        if Version(self.version) < "1.0.0":
-            tc.project_options["enable_avx512"] = self.options.get_safe("with_avx512", False)
         tc.project_options["enable_tools"] = self.options.with_tools
         if self.options.bit_depth == "all":
             tc.project_options["bitdepths"] = "8,16"
diff --git a/recipes/dav1d/all/test_package/CMakeLists.txt b/recipes/dav1d/all/test_package/CMakeLists.txt
index 7ef99743f0b06..dff4e1904899e 100644
--- a/recipes/dav1d/all/test_package/CMakeLists.txt
+++ b/recipes/dav1d/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(dav1d REQUIRED CONFIG)
diff --git a/recipes/dav1d/all/test_v1_package/CMakeLists.txt b/recipes/dav1d/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 0d20897301b68..0000000000000
--- a/recipes/dav1d/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/dav1d/all/test_v1_package/conanfile.py b/recipes/dav1d/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/dav1d/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_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/dav1d/config.yml b/recipes/dav1d/config.yml
index 2ef77329e43db..d5bc79ec13e97 100644
--- a/recipes/dav1d/config.yml
+++ b/recipes/dav1d/config.yml
@@ -1,11 +1,9 @@
 versions:
-  "1.2.1":
-    folder: "all"
-  "1.1.0":
+  "1.4.3":
     folder: "all"
-  "1.0.0":
+  "1.4.1":
     folder: "all"
-  "0.9.1":
+  "1.3.0":
     folder: "all"
-  "0.8.1":
+  "1.2.1":
     folder: "all"
diff --git a/recipes/daw_header_libraries/all/conandata.yml b/recipes/daw_header_libraries/all/conandata.yml
index f07d3ecdd0bdb..7e7d062b09499 100644
--- a/recipes/daw_header_libraries/all/conandata.yml
+++ b/recipes/daw_header_libraries/all/conandata.yml
@@ -1,31 +1,34 @@
 sources:
+  "2.118.0":
+    url: "https://github.com/beached/header_libraries/archive/v2.118.0.tar.gz"
+    sha256: "2a3e093c2f69db979e7672d33b97f7f24cda23ff753fafe90a3aaf25ac965a70"
+  "2.114.0":
+    url: "https://github.com/beached/header_libraries/archive/v2.114.0.tar.gz"
+    sha256: "c36229424bd68ee8936ad688127303aee69ecd5400a905df75138ed95cbfef53"
+  "2.110.0":
+    url: "https://github.com/beached/header_libraries/archive/v2.110.0.tar.gz"
+    sha256: "6515bb7a130656adff9f1f17d6be69dbd7c40dbcebbe418e9d0cf15bbc71bffc"
+  "2.107.0":
+    url: "https://github.com/beached/header_libraries/archive/v2.107.0.tar.gz"
+    sha256: "b84f7666d004da466d0035e9f475797395e90b6e8f23e000816b45aa13d4fc35"
+  "2.106.2":
+    url: "https://github.com/beached/header_libraries/archive/v2.106.2.tar.gz"
+    sha256: "33609d83aec5a6081efebf871627b7a8bddc2b7f0eb8d4ac14756d403d29d089"
+  "2.106.1":
+    url: "https://github.com/beached/header_libraries/archive/v2.106.1.tar.gz"
+    sha256: "393815fbf249ca1220a216899cae3d2672ca193f9db228a0b99925a9b0f90854"
+  "2.106.0":
+    url: "https://github.com/beached/header_libraries/archive/v2.106.0.tar.gz"
+    sha256: "7838ada09afa69e7a42d742991c4b24b32ba27681e7b4dadf7b1e45c168937b5"
+  "2.101.0":
+    url: "https://github.com/beached/header_libraries/archive/v2.101.0.tar.gz"
+    sha256: "468b3a40b90295f1da8eb79ae5723909269c020e7e8bf3d93d3f4fac7c35195b"
+  "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"
-  "2.88.0":
-    url: "https://github.com/beached/header_libraries/archive/v2.88.0.tar.gz"
-    sha256: "2a634763f3d34f206f6b352ac9609a89d501059afea0ba7c857bd55adc435890"
-  "2.85.1":
-    url: "https://github.com/beached/header_libraries/archive/v2.85.1.tar.gz"
-    sha256: "fb4880e254a481e3c750261fdb75a1696afc9ef4404e095a7f3ba0683bcd9930"
-  "2.79.0":
-    url: "https://github.com/beached/header_libraries/archive/v2.79.0.tar.gz"
-    sha256: "2dfa8fc9495499379cff39ed648c6bba156a87eb177fc91a860045a410aebb99"
-  "2.76.3":
-    url: "https://github.com/beached/header_libraries/archive/v2.76.3.tar.gz"
-    sha256: "2d66f9aec38fb9a42779e0283fa2fc5842e04d34f2bf655c72a9beb4bf5cc8c8"
-  "2.76.2":
-    url: "https://github.com/beached/header_libraries/archive/v2.76.2.tar.gz"
-    sha256: "bfa2da192360a66e400d03a52f8a7bf0fccd23de1f446a812a8890b11df2c592"
-  "2.74.2":
-    url: "https://github.com/beached/header_libraries/archive/v2.74.2.tar.gz"
-    sha256: "32871df3d314cc9b4e293a9a8c79968d1c963dfd3dd60965dbf704eb18acb218"
diff --git a/recipes/daw_header_libraries/all/conanfile.py b/recipes/daw_header_libraries/all/conanfile.py
index b6840ea09fa55..98257810d2c5a 100644
--- a/recipes/daw_header_libraries/all/conanfile.py
+++ b/recipes/daw_header_libraries/all/conanfile.py
@@ -16,7 +16,7 @@ class DawHeaderLibrariesConan(ConanFile):
     license = "BSL-1.0"
     url = "https://github.com/conan-io/conan-center-index"
     homepage = "https://github.com/beached/header_libraries"
-    topics = ("algorithms", "helpers", "data-structures")
+    topics = ("algorithms", "helpers", "data-structures", "header-only")
     package_type = "header-library"
     settings = "os", "arch", "compiler", "build_type"
     no_copy_source = True
@@ -44,7 +44,6 @@ def package_id(self):
     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.get_safe("compiler.version")) < minimum_version:
             raise ConanInvalidConfiguration(
@@ -54,9 +53,6 @@ def validate(self):
     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="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"))
diff --git a/recipes/daw_header_libraries/all/test_package/CMakeLists.txt b/recipes/daw_header_libraries/all/test_package/CMakeLists.txt
index 817fb2a992dc4..d3209b287ea40 100644
--- a/recipes/daw_header_libraries/all/test_package/CMakeLists.txt
+++ b/recipes/daw_header_libraries/all/test_package/CMakeLists.txt
@@ -1,9 +1,13 @@
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.15)
 
 project(test_package LANGUAGES CXX)
 
 find_package(daw-header-libraries REQUIRED CONFIG)
 
-add_executable(${PROJECT_NAME} test_package.cpp)
+if(daw-header-libraries_VERSION VERSION_LESS "2.109.0")
+    add_executable(${PROJECT_NAME} test_package_old.cpp)
+else()
+    add_executable(${PROJECT_NAME} test_package.cpp)
+endif()
 target_link_libraries(${PROJECT_NAME} PRIVATE daw::daw-header-libraries)
 target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
diff --git a/recipes/daw_header_libraries/all/test_package/test_package.cpp b/recipes/daw_header_libraries/all/test_package/test_package.cpp
index 7b47a51d28ef5..63fa16b601f2d 100644
--- a/recipes/daw_header_libraries/all/test_package/test_package.cpp
+++ b/recipes/daw_header_libraries/all/test_package/test_package.cpp
@@ -1,7 +1,7 @@
-#include "daw/daw_carray.h"
+#include "daw/daw_bounded_array.h"
 
 int main() {
-    daw::carray t = { 1, 2, 3, 4, 5, 6 };
+    daw::array t = { 1, 2, 3, 4, 5, 6 };
 
     auto val = t[3];
 
diff --git a/recipes/daw_header_libraries/all/test_package/test_package_old.cpp b/recipes/daw_header_libraries/all/test_package/test_package_old.cpp
new file mode 100644
index 0000000000000..7b47a51d28ef5
--- /dev/null
+++ b/recipes/daw_header_libraries/all/test_package/test_package_old.cpp
@@ -0,0 +1,9 @@
+#include "daw/daw_carray.h"
+
+int main() {
+    daw::carray t = { 1, 2, 3, 4, 5, 6 };
+
+    auto val = t[3];
+
+    return 0;
+}
diff --git a/recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt b/recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index bc541ea90b512..0000000000000
--- a/recipes/daw_header_libraries/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-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/daw_header_libraries/all/test_v1_package/conanfile.py b/recipes/daw_header_libraries/all/test_v1_package/conanfile.py
deleted file mode 100644
index 5a05af3c2dfd2..0000000000000
--- a/recipes/daw_header_libraries/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,18 +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/daw_header_libraries/config.yml b/recipes/daw_header_libraries/config.yml
index e5da3ea85fe21..155232f2792e6 100644
--- a/recipes/daw_header_libraries/config.yml
+++ b/recipes/daw_header_libraries/config.yml
@@ -1,21 +1,23 @@
 versions:
-  "2.96.1":
+  "2.118.0":
+    folder: all
+  "2.114.0":
     folder: all
-  "2.95.0":
+  "2.110.0":
     folder: all
-  "2.93.1":
+  "2.107.0":
     folder: all
-  "2.92.0":
+  "2.106.2":
     folder: all
-  "2.88.0":
+  "2.106.1":
     folder: all
-  "2.85.1":
+  "2.106.0":
     folder: all
-  "2.79.0":
+  "2.101.0":
     folder: all
-  "2.76.3":
+  "2.98.5":
     folder: all
-  "2.76.2":
+  "2.97.0":
     folder: all
-  "2.74.2":
+  "2.96.1":
     folder: all
diff --git a/recipes/daw_json_link/all/conandata.yml b/recipes/daw_json_link/all/conandata.yml
index 3262aaa6ca666..4226c99f417b1 100644
--- a/recipes/daw_json_link/all/conandata.yml
+++ b/recipes/daw_json_link/all/conandata.yml
@@ -1,4 +1,16 @@
 sources:
+  "3.29.2":
+    url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.29.2.tar.gz"
+    sha256: "a0450a2d724d83a600d48d503eb11094039a7a4b607fa59b1d7ce83483b1f8b4"
+  "3.28.3":
+    url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.28.3.tar.gz"
+    sha256: "c9973e8da74c4a6eb84fbd1f86f8048a697068af7dec6aee602e08e9f4df39db"
+  "3.24.1":
+    url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.24.1.tar.gz"
+    sha256: "439b4678377950f165e3d49d472c0676f0ef2fae3c5e6e7febddd5633f6e4f39"
+  "3.23.2":
+    url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.23.2.tar.gz"
+    sha256: "fd1234a14c126c79076e0b6e6eceae42afd465c419dc7a7393c69c28aa7f53d4"
   "3.23.0":
     url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.23.0.tar.gz"
     sha256: "a01e9a3a48784a47dbb60bd21ecbe7e05a7d30cec75ea6d55b1789f6aefe5f05"
@@ -20,15 +32,28 @@ sources:
   "3.15.0":
     url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.15.0.tar.gz"
     sha256: "6f72c69944e33f56823d941b09c8d17ece44b224e802ae0a3416c32f2bdbec40"
-  "3.14.1":
-    url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.14.1.tar.gz"
-    sha256: "a761c594dabd14b7484f5d286db31e9272f633d2ad0dab44cdae5ff3f06db6fb"
-  "3.14.0":
-    url: "https://github.com/beached/daw_json_link/archive/refs/tags/v3.14.tar.gz"
-    sha256: "07171e1b8f09f525116627015b6618990dc9cfb32357ba821512c0508730c9a4"
-  "3.12.0":
-    url: "https://github.com/beached/daw_json_link/archive/v3.12.0.tar.gz"
-    sha256: "b32097954caae14071893232fd85febbfda1deec34bb939f6aad76c077c6c5d5"
-  "3.11.1":
-    url: "https://github.com/beached/daw_json_link/archive/v3.11.1.tar.gz"
-    sha256: "d2b5cb221892c6b1ecd30fd2e45d168d6b378e97d134e75349703104c5882309"
+# When updating this, ensure that the versions are consistent across the rest of the daw libraries
+daw_headers_mapping:
+  "3.29.2": "2.110.0"
+  "3.28.3": "2.110.0"
+  "3.24.1": "2.110.0"
+  "3.23.2": "2.101.0"
+  "3.23.0": "2.97.0"
+  "3.20.1": "2.97.0"
+  "3.19.0": "2.97.0"
+  "3.17.2": "2.97.0"
+  "3.17.1": "2.97.0"
+  "3.16.0": "2.97.0"
+  "3.15.0": "2.97.0"
+daw_utf_mapping:
+  "3.29.2": "2.2.5"
+  "3.28.3": "2.2.5"
+  "3.24.1": "2.2.5"
+  "3.23.2": "2.2.4"
+  "3.23.0": "2.2.3"
+  "3.20.1": "2.2.3"
+  "3.19.0": "2.2.3"
+  "3.17.2": "2.2.3"
+  "3.17.1": "2.2.3"
+  "3.16.0": "2.2.3"
+  "3.15.0": "2.2.3"
diff --git a/recipes/daw_json_link/all/conanfile.py b/recipes/daw_json_link/all/conanfile.py
index a22aa6b41c06b..eeaf0710c5e7a 100644
--- a/recipes/daw_json_link/all/conanfile.py
+++ b/recipes/daw_json_link/all/conanfile.py
@@ -39,8 +39,10 @@ def layout(self):
         cmake_layout(self, src_folder="src")
 
     def requirements(self):
-        self.requires("daw_header_libraries/2.96.1")
-        self.requires("daw_utf_range/2.2.3")
+        corresponding_daw_header_version = self.conan_data["daw_headers_mapping"][self.version]
+        self.requires(f"daw_header_libraries/{corresponding_daw_header_version}")
+        corresponding_daw_utf_version = self.conan_data["daw_utf_mapping"][self.version]
+        self.requires(f"daw_utf_range/{corresponding_daw_utf_version}")
 
     def package_id(self):
         self.info.clear()
diff --git a/recipes/daw_json_link/all/test_package/CMakeLists.txt b/recipes/daw_json_link/all/test_package/CMakeLists.txt
index 5162d77931f1e..36907964ea985 100644
--- a/recipes/daw_json_link/all/test_package/CMakeLists.txt
+++ b/recipes/daw_json_link/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(daw-json-link REQUIRED CONFIG)
diff --git a/recipes/daw_json_link/all/test_v1_package/CMakeLists.txt b/recipes/daw_json_link/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index b4b25bff2f0cd..0000000000000
--- a/recipes/daw_json_link/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/daw_json_link/all/test_v1_package/conanfile.py b/recipes/daw_json_link/all/test_v1_package/conanfile.py
deleted file mode 100644
index 103e285f2d1a0..0000000000000
--- a/recipes/daw_json_link/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,16 +0,0 @@
-from conans import ConanFile, CMake, tools
-import os
-
-class DawJsonLinkTestConan(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/daw_json_link/config.yml b/recipes/daw_json_link/config.yml
index cd93a25c55255..d7ebeba1581e3 100644
--- a/recipes/daw_json_link/config.yml
+++ b/recipes/daw_json_link/config.yml
@@ -1,4 +1,12 @@
 versions:
+  "3.29.2":
+    folder: "all"
+  "3.28.3":
+    folder: "all"
+  "3.24.1":
+    folder: "all"
+  "3.23.2":
+    folder: "all"
   "3.23.0":
     folder: "all"
   "3.20.1":
@@ -13,11 +21,3 @@ versions:
     folder: "all"
   "3.15.0":
     folder: "all"
-  "3.14.1":
-    folder: "all"
-  "3.14.0":
-    folder: "all"
-  "3.12.0":
-    folder: "all"
-  "3.11.1":
-    folder: "all"
diff --git a/recipes/daw_utf_range/all/conandata.yml b/recipes/daw_utf_range/all/conandata.yml
index 179be6adbbd6e..ee9d8569fa27c 100644
--- a/recipes/daw_utf_range/all/conandata.yml
+++ b/recipes/daw_utf_range/all/conandata.yml
@@ -1,10 +1,22 @@
 sources:
+  "2.2.5":
+    url: "https://github.com/beached/utf_range/archive/v2.2.5.tar.gz"
+    sha256: "18cc142c319c817da86ed037813cd50a16ff1af8e041a22b8af11beaef30ca32"
+  "2.2.4":
+    url: "https://github.com/beached/utf_range/archive/v2.2.4.tar.gz"
+    sha256: "e6df85d6da445c16507e738d70c6313df2a70e64b739a05d6437b06a5f83b8b1"
   "2.2.3":
     url: "https://github.com/beached/utf_range/archive/v2.2.3.tar.gz"
     sha256: "cfa36285ffbdf8d4d08fbbe95d054e67ad845c064a92419ea68a770415ad7a98"
   "2.2.2":
-    url: "https://github.com/beached/utf_range/archive/refs/tags/v2.2.2.tar.gz"
+    url: "https://github.com/beached/utf_range/archive/v2.2.2.tar.gz"
     sha256: "5380ade7c7eb5c82a748211896fc7385eaec00d3215af1374aec8f0e326f91fd"
   "2.2.0":
-    url: "https://github.com/beached/utf_range/archive/refs/tags/v2.2.0.tar.gz"
+    url: "https://github.com/beached/utf_range/archive/v2.2.0.tar.gz"
     sha256: "00f60360736062403c8a7a94dd07c750366958f20d1864578faecf2e09d84265"
+daw_headers_mapping:
+  "2.2.5": "2.110.0"
+  "2.2.4": "2.101.0"
+  "2.2.3": "2.97.0"
+  "2.2.2": "2.97.0"
+  "2.2.0": "2.97.0"
diff --git a/recipes/daw_utf_range/all/conanfile.py b/recipes/daw_utf_range/all/conanfile.py
index 23fff04d5723f..bb05e8ba48169 100644
--- a/recipes/daw_utf_range/all/conanfile.py
+++ b/recipes/daw_utf_range/all/conanfile.py
@@ -15,7 +15,7 @@ class DawUtfRangeConan(ConanFile):
     license = "BSL-1.0"
     url = "https://github.com/conan-io/conan-center-index"
     homepage = "https://github.com/beached/utf_range/"
-    topics = ("utf", "validator", "iterator")
+    topics = ("utf", "validator", "iterator", "header-only")
     package_type = "header-library"
     settings = "os", "arch", "compiler", "build_type"
     no_copy_source = True
@@ -38,7 +38,8 @@ def layout(self):
         cmake_layout(self, src_folder="src")
 
     def requirements(self):
-        self.requires("daw_header_libraries/2.96.1")
+        corresponding_daw_header_version = self.conan_data["daw_headers_mapping"][self.version]
+        self.requires(f"daw_header_libraries/{corresponding_daw_header_version}")
 
     def package_id(self):
         self.info.clear()
diff --git a/recipes/daw_utf_range/all/test_package/CMakeLists.txt b/recipes/daw_utf_range/all/test_package/CMakeLists.txt
index 423476843bbe4..930316324fb98 100644
--- a/recipes/daw_utf_range/all/test_package/CMakeLists.txt
+++ b/recipes/daw_utf_range/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(daw-utf-range REQUIRED CONFIG)
diff --git a/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt b/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index be00a8c7f57c7..0000000000000
--- a/recipes/daw_utf_range/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/daw_utf_range/all/test_v1_package/conanfile.py b/recipes/daw_utf_range/all/test_v1_package/conanfile.py
deleted file mode 100644
index e4d8733790192..0000000000000
--- a/recipes/daw_utf_range/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import os
-from conans import ConanFile, CMake, tools
-
-class DawUtfRangeTestConan(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/daw_utf_range/config.yml b/recipes/daw_utf_range/config.yml
index 20edb7543cf05..86bdc8b77e0d5 100644
--- a/recipes/daw_utf_range/config.yml
+++ b/recipes/daw_utf_range/config.yml
@@ -1,4 +1,8 @@
 versions:
+  "2.2.5":
+    folder: "all"
+  "2.2.4":
+    folder: "all"
   "2.2.3":
     folder: "all"
   "2.2.2":
diff --git a/recipes/dbcppp/all/test_package/CMakeLists.txt b/recipes/dbcppp/all/test_package/CMakeLists.txt
index c5a24dec129dd..628a9f1b36bab 100644
--- a/recipes/dbcppp/all/test_package/CMakeLists.txt
+++ b/recipes/dbcppp/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(dbcppp REQUIRED CONFIG)
diff --git a/recipes/dbcppp/all/test_v1_package/CMakeLists.txt b/recipes/dbcppp/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 925ecbe19e448..0000000000000
--- a/recipes/dbcppp/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/dbcppp/all/test_v1_package/conanfile.py b/recipes/dbcppp/all/test_v1_package/conanfile.py
deleted file mode 100644
index e4d8733790192..0000000000000
--- a/recipes/dbcppp/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import os
-from conans import ConanFile, CMake, tools
-
-class DawUtfRangeTestConan(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/dbg-macro/all/test_v1_package/CMakeLists.txt b/recipes/dbg-macro/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/dbg-macro/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index e9e25c6e641af..0000000000000
--- a/recipes/dbg-macro/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,18 +0,0 @@
-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/dbus-cxx/2.x.x/conandata.yml b/recipes/dbus-cxx/2.x.x/conandata.yml
new file mode 100644
index 0000000000000..b497c34ab561f
--- /dev/null
+++ b/recipes/dbus-cxx/2.x.x/conandata.yml
@@ -0,0 +1,4 @@
+sources:
+  "2.5.2":
+    url: "https://github.com/dbus-cxx/dbus-cxx/archive/refs/tags/2.5.2.tar.gz"
+    sha256: "a739a29efc9ad42ba6518b38e13bb44c12947d4f7503d211c12823233e277987"
diff --git a/recipes/dbus-cxx/2.x.x/conanfile.py b/recipes/dbus-cxx/2.x.x/conanfile.py
new file mode 100644
index 0000000000000..50cbc20b6168a
--- /dev/null
+++ b/recipes/dbus-cxx/2.x.x/conanfile.py
@@ -0,0 +1,127 @@
+import os
+
+from conan import ConanFile
+from conan.errors import ConanInvalidConfiguration
+from conan.tools.build import check_min_cppstd
+from conan.tools.cmake import CMakeDeps
+from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain
+from conan.tools.files import get, replace_in_file, rmdir, copy
+from conan.tools.gnu import PkgConfigDeps
+from conan.tools.microsoft import is_msvc
+
+
+class DbusCXX(ConanFile):
+    name = "dbus-cxx"
+    license = "LGPL-3.0-only", "BSD-3-Clause"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "http://dbus-cxx.github.io"
+    description = "DBus-cxx provides an object-oriented interface to DBus"
+    topics = "bus", "interprocess", "message"
+    package_type = "shared-library"
+    settings = "os", "compiler", "build_type", "arch"
+    options = {
+        "fPIC": [True, False],
+        "with_glib": [True, False],
+        "with_qt": [True, False],
+        "with_uv": [True, False],
+    }
+    # Default to a relocatable static library with only the default
+    # standalone dispatcher
+    default_options = {
+        "fPIC": True,
+        "with_glib": False,
+        "with_qt": False,
+        "with_uv": False,
+    }
+
+    def validate(self):
+        if self.settings.os != "Linux":
+            raise ConanInvalidConfiguration("The recipe only supports Linux.")
+        check_min_cppstd(self, 17)
+        # FIXME: Next release will likely be able to use static/shared mode.
+        if self.options.get_safe("with_uv") and not self.dependencies["libuv"].options.shared:
+            raise ConanInvalidConfiguration(f"libuv needs to be shared for "
+                                            f"{self.name}/{self.version}: \"libuv/*:shared=True\"")
+
+    def requirements(self):
+        self.requires("libsigcpp/3.0.7", transitive_headers=True)
+        if self.options.get_safe("with_glib"):
+            self.requires("glib/2.81.0", transitive_headers=True)
+        if self.options.get_safe("with_uv"):
+            self.requires("libuv/[>=1 <2]", transitive_headers=True)
+        if self.options.with_qt:
+            self.requires("qt/[~5.15]", transitive_headers=True)
+
+    def source(self):
+        get(self, **self.conan_data["sources"][self.version], strip_root=True)
+        # Version 2.5.2
+        replace_in_file(self, os.path.join(self.source_folder, "dbus-cxx-uv", "CMakeLists.txt"),
+                        "pkg_search_module( LIBUV REQUIRED libuv )",
+                        "pkg_search_module( LIBUV IMPORTED_TARGET libuv )")
+        replace_in_file(self, os.path.join(self.source_folder, "dbus-cxx-uv", "CMakeLists.txt"),
+                        "target_link_libraries( dbus-cxx-uv PUBLIC ${LIBUV_LIBRARIES} )",
+                        "target_link_libraries( dbus-cxx-uv PUBLIC PkgConfig::LIBUV )")
+
+    def layout(self):
+        cmake_layout(self, src_folder="src")
+
+    def generate(self):
+        tc = CMakeToolchain(self)
+        tc.cache_variables["BUILD_TESTING"] = False
+        tc.cache_variables["ENABLE_CODE_COVERAGE_REPORT"] = False
+        tc.cache_variables["ENABLE_EXAMPLES"] = False
+        tc.cache_variables["ENABLE_TOOLS"] = False  # note: requires expat lib
+        tc.cache_variables["BUILD_SITE"] = False
+        tc.cache_variables["ENABLE_GLIB_SUPPORT"] = self.options.with_glib
+        tc.cache_variables["ENABLE_QT_SUPPORT"] = self.options.with_qt
+        tc.cache_variables["ENABLE_UV_SUPPORT"] = self.options.with_uv
+        # FIXME: libuv: Next release will likely use these lines
+        # if self.options.with_uv and not self.dependencies["libuv"].options.shared:
+        #     tc.cache_variables["UV_STATIC"] = True
+        tc.generate()
+        deps = PkgConfigDeps(self)
+        deps.generate()
+        deps = CMakeDeps(self)
+        deps.generate()
+
+    def build(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()
+        # remove useless folders
+        rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
+        rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
+
+    def package_info(self):
+        # dbus-cxx
+        self.cpp_info.components["dbus-cxx"].libs = ["dbus-cxx"]
+        self.cpp_info.components["dbus-cxx"].requires = ["libsigcpp::sigc++"]
+        self.cpp_info.components["dbus-cxx"].includedirs = ['include/dbus-cxx-2.0']
+        self.cpp_info.components["dbus-cxx"].set_property("cmake_target_name", "dbus-cxx")
+        self.cpp_info.components["dbus-cxx"].set_property("pkg_config_name", "dbus-cxx-2.0")
+        # dbus-cxx-glib
+        if self.options.with_glib:
+            self.cpp_info.components["dbus-cxx-glib"].libs = ["dbus-cxx-glib"]
+            self.cpp_info.components["dbus-cxx-glib"].requires = ["dbus-cxx", "libsigcpp::sigc++", "glib::glib-2.0"]
+            self.cpp_info.components["dbus-cxx-glib"].includedirs = ['include/dbus-cxx-glib-2.0']
+            self.cpp_info.components["dbus-cxx-glib"].set_property("cmake_target_name", "dbus-cxx-glib")
+            self.cpp_info.components["dbus-cxx-glib"].set_property("pkg_config_name", "dbus-cxx-glib-2.0")
+        # dbus-cxx-qt
+        if self.options.with_qt:
+            self.cpp_info.components["dbus-cxx-qt"].libs = ["dbus-cxx-qt"]
+            self.cpp_info.components["dbus-cxx-qt"].requires = ["dbus-cxx", "libsigcpp::sigc++", "qt::qtCore"]
+            self.cpp_info.components["dbus-cxx-qt"].includedirs = ['include/dbus-cxx-qt-2.0']
+            self.cpp_info.components["dbus-cxx-qt"].set_property("cmake_target_name", "dbus-cxx-qt")
+            self.cpp_info.components["dbus-cxx-qt"].set_property("pkg_config_name", "dbus-cxx-qt-2.0")
+        # dbus-cxx-uv
+        if self.options.get_safe("with_uv"):
+            self.cpp_info.components["dbus-cxx-uv"].libs = ["dbus-cxx-uv"]
+            self.cpp_info.components["dbus-cxx-uv"].requires = ["dbus-cxx", "libsigcpp::sigc++", "libuv::libuv"]
+            self.cpp_info.components["dbus-cxx-uv"].includedirs = ['include/dbus-cxx-uv-2.0']
+            self.cpp_info.components["dbus-cxx-uv"].set_property("cmake_target_name", "dbus-cxx-uv")
+            self.cpp_info.components["dbus-cxx-uv"].set_property("pkg_config_name", "dbus-cxx-uv-2.0")
diff --git a/recipes/dbus-cxx/2.x.x/test_package/CMakeLists.txt b/recipes/dbus-cxx/2.x.x/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..0697eeeb36ba1
--- /dev/null
+++ b/recipes/dbus-cxx/2.x.x/test_package/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required (VERSION 3.15)
+project (test_package CXX)
+
+find_package (dbus-cxx REQUIRED CONFIG)
+
+add_executable (${PROJECT_NAME} test_package.cpp)
+target_link_libraries (${PROJECT_NAME} dbus-cxx::dbus-cxx)
+target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
diff --git a/recipes/dbus-cxx/2.x.x/test_package/conanfile.py b/recipes/dbus-cxx/2.x.x/test_package/conanfile.py
new file mode 100644
index 0000000000000..8463ba22384e7
--- /dev/null
+++ b/recipes/dbus-cxx/2.x.x/test_package/conanfile.py
@@ -0,0 +1,25 @@
+import os
+
+from conan import ConanFile
+from conan.tools.cmake import CMake, cmake_layout
+from conan.tools.build import can_run
+
+class DbusCXXTest(ConanFile):
+    settings = "os", "compiler", "build_type", "arch"
+    generators = "CMakeToolchain", "CMakeDeps"
+
+    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):
+            bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
+            self.run(bin_path, env="conanrun")
diff --git a/recipes/dbus-cxx/2.x.x/test_package/test_package.cpp b/recipes/dbus-cxx/2.x.x/test_package/test_package.cpp
new file mode 100644
index 0000000000000..cbdb43e702a2a
--- /dev/null
+++ b/recipes/dbus-cxx/2.x.x/test_package/test_package.cpp
@@ -0,0 +1,7 @@
+#include 
+
+int main()
+{
+    auto connection = DBus::Connection::create( DBus::BusType::SESSION );
+    return 0;
+}
diff --git a/recipes/dbus-cxx/config.yml b/recipes/dbus-cxx/config.yml
new file mode 100644
index 0000000000000..5b146bc4b8d85
--- /dev/null
+++ b/recipes/dbus-cxx/config.yml
@@ -0,0 +1,3 @@
+versions:
+  "2.5.2":
+    folder: 2.x.x
diff --git a/recipes/dbus/1.x.x/conandata.yml b/recipes/dbus/1.x.x/conandata.yml
deleted file mode 100644
index 04a0982deff4b..0000000000000
--- a/recipes/dbus/1.x.x/conandata.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-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"
-patches:
-  "1.15.2":
-    - patch_file: "patches/0003-meson-monotonic-clock-check.patch"
-      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.15.0":
-    - patch_file: "patches/0003-meson-monotonic-clock-check.patch"
-      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"
diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py
deleted file mode 100644
index c20fd3f03b189..0000000000000
--- a/recipes/dbus/1.x.x/conanfile.py
+++ /dev/null
@@ -1,189 +0,0 @@
-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.env import VirtualBuildEnv
-from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save
-from conan.tools.gnu import PkgConfigDeps
-from conan.tools.layout import basic_layout
-from conan.tools.meson import Meson, MesonToolchain
-from conan.tools.scm import Version
-import os
-import textwrap
-
-required_conan_version = ">=1.53.0"
-
-
-class DbusConan(ConanFile):
-    name = "dbus"
-    license = ("AFL-2.1", "GPL-2.0-or-later")
-    url = "https://github.com/conan-io/conan-center-index"
-    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 = "library"
-    settings = "os", "arch", "compiler", "build_type"
-    short_paths = True
-    options = {
-        "shared": [True, False],
-        "fPIC": [True, False],
-        "system_socket": [None, "ANY"],
-        "system_pid_file": [None, "ANY"],
-        "with_x11": [True, False],
-        "with_glib": [True, False],
-        "with_systemd": [True, False],
-        "with_selinux": [True, False],
-        "session_socket_dir": ["ANY"],
-    }
-    default_options = {
-        "shared": False,
-        "fPIC": True,
-        "system_socket": None,
-        "system_pid_file": None,
-        "with_x11": False,
-        "with_glib": False,
-        "with_systemd": False,
-        "with_selinux": False,
-        "session_socket_dir": "/tmp",
-    }
-
-    def export_sources(self):
-        export_conandata_patches(self)
-
-    def config_options(self):
-        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):
-        basic_layout(self, src_folder="src")
-
-    def requirements(self):
-        self.requires("expat/2.5.0")
-        if self.options.with_glib:
-            self.requires("glib/2.77.0")
-        if self.options.get_safe("with_systemd"):
-            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 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):
-        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)
-
-    def generate(self):
-        env = VirtualBuildEnv(self)
-        env.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)
-        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"))
-        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"))
-        mkdir(self, os.path.join(self.package_folder, "res"))
-        for i in ["var", "share", "etc"]:
-            rename(self, os.path.join(self.package_folder, i), os.path.join(self.package_folder, "res", i))
-
-        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", "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(
-            os.path.join(self.package_folder, self._module_file_rel_path),
-            {"dbus-1": "dbus-1::dbus-1"}
-        )
-
-    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", "DBus1")
-        self.cpp_info.set_property("cmake_target_name", "dbus-1")
-        self.cpp_info.set_property("pkg_config_name", "dbus-1")
-        self.cpp_info.includedirs.extend([
-            os.path.join("include", "dbus-1.0"),
-            os.path.join("lib", "dbus-1.0", "include"),
-        ])
-        self.cpp_info.resdirs = ["res"]
-        self.cpp_info.libs = ["dbus-1"]
-        if self.settings.os == "Linux":
-            self.cpp_info.system_libs.append("rt")
-        if self.settings.os == "Windows":
-            self.cpp_info.system_libs.extend(["iphlpapi", "ws2_32"])
-        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"
-        self.cpp_info.names["cmake_find_package"] = "dbus-1"
-        self.cpp_info.names["cmake_find_package_multi"] = "dbus-1"
-        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"] = "dbus-1"
diff --git a/recipes/dbus/1.x.x/test_package/CMakeLists.txt b/recipes/dbus/1.x.x/test_package/CMakeLists.txt
deleted file mode 100644
index 497b3ee2b047c..0000000000000
--- a/recipes/dbus/1.x.x/test_package/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required(VERSION 3.1)
-project(test_package LANGUAGES C)
-
-find_package(DBus1 REQUIRED CONFIG)
-
-add_executable(${PROJECT_NAME} test_package.c)
-target_link_libraries(${PROJECT_NAME} PRIVATE dbus-1)
diff --git a/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt b/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 925ecbe19e448..0000000000000
--- a/recipes/dbus/1.x.x/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/dbus/1.x.x/test_v1_package/conanfile.py b/recipes/dbus/1.x.x/test_v1_package/conanfile.py
deleted file mode 100644
index 3a412edafcc0d..0000000000000
--- a/recipes/dbus/1.x.x/test_v1_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):
-            self.run("dbus-monitor --help", run_environment=True)
-            bin_path = os.path.join("bin", "test_package")
-            self.run(bin_path, run_environment=True)
diff --git a/recipes/dbus/all/conandata.yml b/recipes/dbus/all/conandata.yml
new file mode 100644
index 0000000000000..691acef617739
--- /dev/null
+++ b/recipes/dbus/all/conandata.yml
@@ -0,0 +1,29 @@
+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"
+patches:
+  "1.15.8":
+    - patch_file: "patches/0001-meson-Use-check_header-to-confirm-headers-work.patch"
+      patch_type: "portability"
+      patch_description: "Fix build with Visual Studio 2022"
+      patch_source: "https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/454"
+  "1.15.2":
+    - patch_file: "patches/0003-meson-monotonic-clock-check.patch"
+      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.15.0":
+    - patch_file: "patches/0003-meson-monotonic-clock-check.patch"
+      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"
diff --git a/recipes/dbus/all/conanfile.py b/recipes/dbus/all/conanfile.py
new file mode 100644
index 0000000000000..b8c7c6cfea6f9
--- /dev/null
+++ b/recipes/dbus/all/conanfile.py
@@ -0,0 +1,224 @@
+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.env import VirtualBuildEnv
+from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, 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
+from conan.tools.scm import Version
+import os
+import textwrap
+
+required_conan_version = ">=1.64.0 <2 || >=2.2.0"
+
+
+class DbusConan(ConanFile):
+    name = "dbus"
+    # license is AFL-2.1 OR GPL-2.0-or-later with several other compatible licenses for smaller sections of code
+    license = "(AFL-2.1 OR GPL-2.0-or-later) AND DocumentRef-COPYING"
+    url = "https://github.com/conan-io/conan-center-index"
+    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 = "library"
+    settings = "os", "arch", "compiler", "build_type"
+    short_paths = True
+    options = {
+        "shared": [True, False],
+        "fPIC": [True, False],
+        "dbus_user": [None, "ANY"],
+        "message_bus": [True, False],
+        "system_socket": [None, "ANY"],
+        "system_pid_file": [None, "ANY"],
+        "with_x11": [True, False],
+        "with_systemd": [True, False],
+        "with_selinux": [True, False],
+        "session_socket_dir": [None, "ANY"],
+    }
+    default_options = {
+        "shared": False,
+        "fPIC": True,
+        "dbus_user": "messagebus",
+        "message_bus": False,
+        "system_socket": None,
+        "system_pid_file": None,
+        "with_x11": False,
+        "with_systemd": False,
+        "with_selinux": False,
+        "session_socket_dir": "/tmp",
+    }
+
+    @property
+    def _has_message_bus_option(self):
+        return Version(self.version) > "1.15.2"
+
+    def export_sources(self):
+        export_conandata_patches(self)
+
+    def config_options(self):
+        if self.settings.os not in ["Linux", "FreeBSD"]:
+            del self.options.with_systemd
+            del self.options.with_x11
+            del self.options.with_selinux
+        if self.settings.os == "Windows":
+            del self.options.fPIC
+        if not self._has_message_bus_option:
+            self.options.rm_safe("message_bus")
+
+    def configure(self):
+        self.settings.rm_safe("compiler.cppstd")
+        self.settings.rm_safe("compiler.libcxx")
+        if self.options.shared:
+            self.options.rm_safe("fPIC")
+        if not self.options.get_safe("message_bus"):
+            self.options.rm_safe("dbus_user")
+
+    def layout(self):
+        basic_layout(self, src_folder="src")
+
+    def requirements(self):
+        self.requires("expat/[>=2.6.2 <3]")
+        if self.options.get_safe("with_systemd"):
+            self.requires("libsystemd/253.6")
+        if self.options.get_safe("with_selinux"):
+            self.requires("libselinux/3.6")
+        if self.options.get_safe("with_x11"):
+            # X11 is only linked into an executable and should not be propagated as a library dependency.
+            # It should still be provided in a VirtualRunEnv context, though,
+            # but Conan as of v2.2 does not yet provide a fine-grained enough control over this.
+            self.requires("xorg/system", visible=False)
+
+    def package_id(self):
+        # The dbus_user option only effects the installation of dbus during the package method.
+        # Otherwise, it only appears in the system.conf file in the package.
+        self.info.options.rm_safe("dbus_user")
+
+    def validate(self):
+        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):
+        self.tool_requires("meson/1.4.0")
+        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()
+        tc = MesonToolchain(self)
+        tc.project_options["asserts"] = not is_apple_os(self)
+        tc.project_options["checks"] = False
+        tc.project_options["datadir"] = os.path.join("res", "share")
+        tc.project_options["sysconfdir"] = os.path.join("res", "etc")
+        tc.project_options["doxygen_docs"] = "disabled"
+        tc.project_options["ducktype_docs"] = "disabled"
+        tc.project_options["qt_help"] = "disabled"
+        tc.project_options["modular_tests"] = "disabled"
+        tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux") else "disabled"
+        if self.options.session_socket_dir:
+            tc.project_options["session_socket_dir"] = str(self.options.session_socket_dir)
+        tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd") else "disabled"
+        if self.options.get_safe("with_systemd"):
+            tc.project_options["systemd_system_unitdir"] = "/res/lib/systemd/system"
+            tc.project_options["systemd_user_unitdir"] = "/res/usr/lib/systemd/system"
+        if self._has_message_bus_option:
+            tc.project_options["message_bus"] = bool(self.options.message_bus)
+        if self.options.get_safe("dbus_user"):
+            tc.project_options["dbus_user"] = str(self.options.dbus_user)
+        if self.options.system_pid_file:
+            tc.project_options["system_pid_file"] = str(self.options.system_pid_file)
+        if self.options.system_socket:
+            tc.project_options["system_socket"] = str(self.options.system_socket)
+        if is_apple_os(self):
+            tc.project_options["launchd_agent_dir"] = os.path.join("res", "LaunchAgents")
+        tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11") else "disabled"
+        tc.project_options["xml_docs"] = "disabled"
+        tc.generate()
+        deps = PkgConfigDeps(self)
+        deps.generate()
+
+    def _patch_sources(self):
+        apply_conandata_patches(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, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses"))
+        copy(self, "*", os.path.join(self.source_folder, "LICENSES"), os.path.join(self.package_folder, "licenses"))
+        meson = Meson(self)
+        meson.install()
+
+        rm(self, "*.pdb", os.path.join(self.package_folder, "bin"))
+        rmdir(self, os.path.join(self.package_folder, "res", "share", "doc"))
+
+        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)
+        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(
+            os.path.join(self.package_folder, self._module_file_rel_path),
+            {"dbus-1": "dbus-1::dbus-1"}
+        )
+
+    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", "DBus1")
+        self.cpp_info.set_property("cmake_target_name", "dbus-1")
+        self.cpp_info.set_property("pkg_config_name", "dbus-1")
+        self.cpp_info.includedirs.extend([
+            os.path.join("include", "dbus-1.0"),
+            os.path.join("lib", "dbus-1.0", "include"),
+        ])
+        self.cpp_info.resdirs = ["res"]
+        self.cpp_info.libs = ["dbus-1"]
+        if self.settings.os == "Linux":
+            self.cpp_info.system_libs.append("rt")
+        if self.settings.os == "Windows":
+            self.cpp_info.system_libs.extend(["iphlpapi", "ws2_32"])
+        else:
+            self.cpp_info.system_libs.append("pthread")
+
+        if not self.options.shared:
+            self.cpp_info.defines.append("DBUS_STATIC_BUILD")
+
+        self.cpp_info.requires.append("expat::expat")
+        if self.options.get_safe("with_systemd"):
+            self.cpp_info.requires.append("libsystemd::libsystemd")
+        if self.options.get_safe("with_selinux"):
+            self.cpp_info.requires.append("libselinux::selinux")
+
+        # 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"
+        self.cpp_info.names["cmake_find_package"] = "dbus-1"
+        self.cpp_info.names["cmake_find_package_multi"] = "dbus-1"
+        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"] = "dbus-1"
diff --git a/recipes/dbus/all/patches/0001-meson-Use-check_header-to-confirm-headers-work.patch b/recipes/dbus/all/patches/0001-meson-Use-check_header-to-confirm-headers-work.patch
new file mode 100755
index 0000000000000..6c048934702b3
--- /dev/null
+++ b/recipes/dbus/all/patches/0001-meson-Use-check_header-to-confirm-headers-work.patch
@@ -0,0 +1,46 @@
+From e52ccaf7c3abf9d0adccfd001c1417ce08a7f335 Mon Sep 17 00:00:00 2001
+From: Thomas Sondergaard 
+Date: Thu, 4 Jan 2024 17:45:46 +0100
+Subject: [PATCH] meson: Use check_header to confirm headers work
+
+instead of using has_header use check_header to confirm the header
+works. This is necessary to get the meson build to work with Visual
+Studio 2022. It has  but it does not actually work when
+compiling a C program. A minimal C program that include 
+fails with the following errors:
+
+    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(36): error C2061: syntax error: identifier 'atomic_bool'
+    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(36): error C2059: syntax error: ';'
+    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(37): error C2061: syntax error: identifier 'atomic_char'
+    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(37): error C2059: syntax error: ';'
+    ...
+    ...
+
+check_header is consistent with CMake's
+
+    check_include_file(stdatomic.h  HAVE_STDATOMIC_H)
+
+which is why the CMake-based build of dbus works with Visual Studio
+2022, while the meson build doesn't.
+
+Fixes #494
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 17b2a837..19b41cd9 100644
+--- a/meson.build
++++ b/meson.build
+@@ -705,7 +705,7 @@ check_headers = [
+ 
+ foreach header : check_headers
+     macro = 'HAVE_' + header.underscorify().to_upper()
+-    config.set(macro, cc.has_header(header, args: compile_args_c) ? 1 : false)
++    config.set(macro, cc.check_header(header, args: compile_args_c) ? 1 : false)
+ endforeach
+ 
+ execinfo = cc.find_library('execinfo', required: false)
+-- 
+2.43.0.windows.1
+
diff --git a/recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch b/recipes/dbus/all/patches/0003-meson-monotonic-clock-check.patch
similarity index 100%
rename from recipes/dbus/1.x.x/patches/0003-meson-monotonic-clock-check.patch
rename to recipes/dbus/all/patches/0003-meson-monotonic-clock-check.patch
diff --git a/recipes/dbus/all/test_package/CMakeLists.txt b/recipes/dbus/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..ab965e9a2598b
--- /dev/null
+++ b/recipes/dbus/all/test_package/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.15)
+project(test_package LANGUAGES C)
+
+find_package(DBus1 REQUIRED CONFIG)
+
+add_executable(${PROJECT_NAME} test_package.c)
+target_link_libraries(${PROJECT_NAME} PRIVATE dbus-1)
diff --git a/recipes/dbus/1.x.x/test_package/conanfile.py b/recipes/dbus/all/test_package/conanfile.py
similarity index 100%
rename from recipes/dbus/1.x.x/test_package/conanfile.py
rename to recipes/dbus/all/test_package/conanfile.py
diff --git a/recipes/dbus/1.x.x/test_package/test_package.c b/recipes/dbus/all/test_package/test_package.c
similarity index 100%
rename from recipes/dbus/1.x.x/test_package/test_package.c
rename to recipes/dbus/all/test_package/test_package.c
diff --git a/recipes/dbus/config.yml b/recipes/dbus/config.yml
index a6d5fb2e5d5f7..e3b8080de35a7 100644
--- a/recipes/dbus/config.yml
+++ b/recipes/dbus/config.yml
@@ -1,9 +1,9 @@
 versions:
   "1.15.8":
-    folder: 1.x.x
+    folder: all
   "1.15.6":
-    folder: 1.x.x
+    folder: all
   "1.15.2":
-    folder: 1.x.x
+    folder: all
   "1.15.0":
-    folder: 1.x.x
+    folder: all
diff --git a/recipes/dcmtk/all/conandata.yml b/recipes/dcmtk/all/conandata.yml
index 7ae433b2e0c08..db05530c82900 100644
--- a/recipes/dcmtk/all/conandata.yml
+++ b/recipes/dcmtk/all/conandata.yml
@@ -1,8 +1,26 @@
 sources:
+  "3.6.8":
+    url: "https://dicom.offis.de/download/dcmtk/dcmtk368/dcmtk-3.6.8.tar.gz"
+    sha256: "232076655503138debf2f624109f1799e539354f186ce4e04b27cf82a9d8720f"
   "3.6.7":
     url: "https://dicom.offis.de/download/dcmtk/dcmtk367/dcmtk-3.6.7.tar.gz"
     sha256: "7c58298e3e8d60232ee6fc8408cfadd14463cc11a3c4ca4c59af5988c7e9710a"
 patches:
+  "3.6.8":
+    - patch_file: "patches/3.6.8-0001-cmake-robust-deps-handling.patch"
+      patch_description: "CMake: robust discovery with find_package() and use imported targets"
+      patch_type: conan
+    - patch_file: "patches/3.6.8-0002-cmake-check-openssl-symbol.patch"
+      patch_description: "CMake: fix OpenSSL compatibility checks"
+      patch_type: conan
+    - patch_file: "patches/3.6.8-0003-fix-two-segmentation-faults.patch"
+      patch_description: "Fix CVE-2024-34508 and CVE-2024-34509 (SEGFAULT from malformed C-Store request)"
+      patch_type: vulnerability
+      patch_source: "https://github.com/DCMTK/dcmtk/commit/c78e434c0c5f9d932874f0b17a8b4ce305ca01f5"
+    - patch_file: "patches/3.6.8-0004-disable-oficonv-passthrough.patch"
+      patch_description: "Fix data corruption in UTF8-to-UTF8 conversion"
+      patch_type: bugfix
+      patch_source: "https://github.com/DCMTK/dcmtk/commit/8ccfd5a07024e50b160da0231524da535c745b79"
   "3.6.7":
     - patch_file: "patches/3.6.7-0001-cmake-robust-deps-handling.patch"
       patch_description: "CMake: robust discovery with find_package() and use imported targets"
@@ -10,3 +28,11 @@ patches:
     - patch_file: "patches/3.6.7-0002-cmake-check-openssl-symbol.patch"
       patch_description: "CMake: fix OpenSSL compatibility checks"
       patch_type: conan
+    - patch_file: "patches/3.6.7-0003-ambiguous-overload-operator-equal.patch"
+      patch_description: "C++20: Fix ambiguous overload for operator== between DB_SerializedTagKey and DcmTagKey"
+      patch_type: portability
+      patch_source: "https://github.com/DCMTK/dcmtk/pull/88"
+    - patch_file: "patches/3.6.7-0004-fix-two-segmentation-faults.patch"
+      patch_description: "Fix CVE-2024-34508 and CVE-2024-34509 (SEGFAULT from malformed C-Store request)"
+      patch_type: vulnerability
+      patch_source: "https://github.com/DCMTK/dcmtk/commit/c78e434c0c5f9d932874f0b17a8b4ce305ca01f5"
diff --git a/recipes/dcmtk/all/conanfile.py b/recipes/dcmtk/all/conanfile.py
index 6980bbc99c18d..c8c4804f39f44 100644
--- a/recipes/dcmtk/all/conanfile.py
+++ b/recipes/dcmtk/all/conanfile.py
@@ -3,12 +3,13 @@
 
 from conan import ConanFile
 from conan.errors import ConanInvalidConfiguration
-from conan.tools.build import cross_building
+from conan.tools.build import cross_building, 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.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rename, rmdir, save
 from conan.tools.microsoft import is_msvc, is_msvc_static_runtime
+from conan.tools.scm import Version
 
-required_conan_version = ">=1.54.0"
+required_conan_version = ">=2.0"
 
 
 class DCMTKConan(ConanFile):
@@ -63,6 +64,7 @@ class DCMTKConan(ConanFile):
 
     def export_sources(self):
         export_conandata_patches(self)
+        copy(self, "*.h", os.path.join(self.recipe_folder, "crossbuild"), os.path.join(self.export_sources_folder, "src"))
 
     def config_options(self):
         if self.settings.os == "Windows":
@@ -96,13 +98,13 @@ def requirements(self):
         elif self.options.charset_conversion == "icu":
             self.requires("icu/73.2")
         if self.options.with_libxml2:
-            self.requires("libxml2/2.11.4")
+            self.requires("libxml2/[2.12.5 <3]")
         if self.options.with_zlib:
             self.requires("zlib/[>=1.2.11 <2]")
         if self.options.with_openssl:
             self.requires("openssl/[>=1 <4]")
         if self.options.with_libpng:
-            self.requires("libpng/1.6.40")
+            self.requires("libpng/[>=1.6 <2]")
         if self.options.with_libtiff:
             self.requires("libtiff/4.6.0")
         if self.options.get_safe("with_tcpwrappers"):
@@ -113,11 +115,16 @@ def package_id(self):
         del self.info.options.builtin_dictionary
         del self.info.options.external_dictionary
 
+    def validate_build(self):
+        if cross_building(self):
+            if self.settings.os == "Macos" and self.settings.arch != "x86_64":
+                raise ConanInvalidConfiguration("MacOS crossbuilding is only supported to target x86_64")
+            else:
+                # Note: other cross-building scenarios have not been tested and may also need to be marked as invalid
+                self.output.warning("Crossbuilding has not been tested and may not work. Please report to Conan Center Index if you find any issues.")
+
     def validate(self):
-        if hasattr(self, "settings_build") and cross_building(self) and \
-           self.settings.os == "Macos" and self.settings.arch == "armv8":
-            # FIXME: Probable issue with flags, build includes header 'mmintrin.h'
-            raise ConanInvalidConfiguration("Cross building to Macos M1 is not supported (yet)")
+        check_min_cppstd(self, 11)
 
     def source(self):
         get(self, **self.conan_data["sources"][self.version], strip_root=True)
@@ -150,12 +157,38 @@ def generate(self):
         tc.variables["DCMTK_ENABLE_CXX11"] = True
         tc.variables["DCMTK_ENABLE_MANPAGE"] = False
         tc.cache_variables["DCMTK_DEFAULT_DICT"] = self.options.default_dict
+        if self.options.charset_conversion and Version(self.version) >= "3.6.8":
+            charset_conversion = { "libiconv": "libiconv", "icu": "ICU" }
+            tc.cache_variables["DCMTK_ENABLE_CHARSET_CONVERSION"] = charset_conversion[str(self.options.charset_conversion)]
         tc.variables["DCMTK_USE_DCMDICTPATH"] = self.options.use_dcmdictpath
         if self.settings.os == "Windows":
             tc.variables["DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS"] = False
         if is_msvc(self):
             tc.variables["DCMTK_ICONV_FLAGS_ANALYZED"] = True
             tc.variables["DCMTK_COMPILE_WIN32_MULTITHREADED_DLL"] = not is_msvc_static_runtime(self)
+
+        if Version(self.version) >= "3.6.7" and cross_building(self):
+            # See https://support.dcmtk.org/redmine/projects/dcmtk/wiki/Cross_Compiling
+            tc.cache_variables["DCMTK_NO_TRY_RUN"] = True
+            if self.options.charset_conversion == "libiconv":
+                tc.cache_variables["DCMTK_ICONV_FLAGS_ANALYZED"] = True
+                tc.cache_variables["DCMTK_FIXED_ICONV_CONVERSION_FLAGS"] = "AbortTranscodingOnIllegalSequence"
+            if self.options.enable_stl:
+                # The recipe has C++11 as the minimum, and these should be available
+                # under that assumption
+                variables = ['HAVE_STL_VECTOR_TEST_RESULT', 'HAVE_STL_ALGORITHM_TEST_RESULT',
+                             'HAVE_STL_LIMITS_TEST_RESULT', 'HAVE_STL_LIST_TEST_RESULT', 'HAVE_STL_MAP_TEST_RESULT',
+                             'HAVE_STL_MEMORY_TEST_RESULT', 'HAVE_STL_STACK_TEST_RESULT',
+                             'HAVE_STL_STRING_TEST_RESULT', 'HAVE_STL_TYPE_TRAITS_TEST_RESULT',
+                             'HAVE_STL_TUPLE_TEST_RESULT', 'HAVE_STL_SYSTEM_ERROR_TEST_RESULT']
+                for var in variables:
+                    tc.cache_variables[var] = True
+            if self.settings.os == "Macos" and self.settings.arch == "x86_64":
+                dst_dir = os.path.join(self.build_folder, "config", "include", "dcmtk", "config")
+                arith_h = "arith_h_Macos_x86_64.h"
+                copy(self, arith_h, self.source_folder, dst_dir)
+                rename(self, os.path.join(dst_dir, arith_h), os.path.join(dst_dir, "arith.h"))
+           
         tc.generate()
 
         deps = CMakeDeps(self)
@@ -287,7 +320,7 @@ def tcpwrappers():
         def xml2():
             return ["libxml2::libxml2"] if self.options.with_libxml2 else []
 
-        return {
+        components = {
             "ofstd"   : charset_conversion(),
             "oflog"   : ["ofstd"],
             "dcmdata" : ["ofstd", "oflog"] + zlib(),
@@ -314,7 +347,15 @@ def xml2():
             "dcmseg"  : ["dcmfg", "dcmiod", "dcmdata", "ofstd", "oflog"],
             "dcmtract": ["dcmiod", "dcmdata", "ofstd", "oflog"],
             "dcmpmap" : ["dcmfg", "dcmiod", "dcmdata", "ofstd", "oflog"],
+            "dcmect"  : ["dcmfg", "dcmiod", "dcmdata", "ofstd", "oflog"],
         }
+        if Version(self.version) >= "3.6.8":
+            components["dcmxml"] = ["dcmdata", "ofstd", "oflog"] + zlib() + xml2()
+            components["oficonv"] = []
+            components["dcmpstat"] += ["dcmiod"]
+            components["i2d"] += ["dcmxml"]
+            components["ofstd"] += ["oficonv"]
+        return components
 
     @property
     def _dcm_datadictionary_path(self):
@@ -326,36 +367,34 @@ def package_info(self):
 
         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
+            # Before 3.6.7, targets were not namespaced, therefore they are also exposed for convenience
             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
 
-            # 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 is_msvc(self):
+                # Required for the __cplusplus check at
+                # https://github.com/DCMTK/dcmtk/blob/DCMTK-3.6.8/config/include/dcmtk/config/osconfig.h.in#L1489
+                self.cpp_info.components[target_lib].cxxflags.append("/Zc:__cplusplus")
 
+        system_libs = []
         if self.settings.os == "Windows":
-            self.cpp_info.components["ofstd"].system_libs.extend([
-                "iphlpapi", "ws2_32", "netapi32", "wsock32"
-            ])
+            system_libs = ["iphlpapi", "ws2_32", "netapi32", "wsock32"]
         elif self.settings.os in ["Linux", "FreeBSD"]:
-            self.cpp_info.components["ofstd"].system_libs.append("m")
+            system_libs = ["m", "nsl"]
             if self.options.with_multithreading:
-                self.cpp_info.components["ofstd"].system_libs.append("pthread")
+                system_libs.append("pthread")
+            if Version(self.version) >= "3.6.8":
+                system_libs.append("rt")
+        if Version(self.version) >= "3.6.8":
+            self.cpp_info.components["oficonv"].system_libs = system_libs
+        else:
+            self.cpp_info.components["ofstd"].system_libs = system_libs
 
         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.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
diff --git a/recipes/dcmtk/all/crossbuild/arith_h_Macos_x86_64.h b/recipes/dcmtk/all/crossbuild/arith_h_Macos_x86_64.h
new file mode 100644
index 0000000000000..e52386cfbaf82
--- /dev/null
+++ b/recipes/dcmtk/all/crossbuild/arith_h_Macos_x86_64.h
@@ -0,0 +1,58 @@
+#ifndef CONFIG_ARITH_H
+#define CONFIG_ARITH_H
+
+#define DCMTK_SIGNED_CHAR_DIGITS10 2
+#define DCMTK_UNSIGNED_CHAR_DIGITS10 2
+#define DCMTK_SIGNED_SHORT_DIGITS10 4
+#define DCMTK_UNSIGNED_SHORT_DIGITS10 4
+#define DCMTK_SIGNED_INT_DIGITS10 9
+#define DCMTK_UNSIGNED_INT_DIGITS10 9
+#define DCMTK_SIGNED_LONG_DIGITS10 18
+#define DCMTK_UNSIGNED_LONG_DIGITS10 19
+#define DCMTK_FLOAT_MAX_DIGITS10 9
+#define DCMTK_DOUBLE_MAX_DIGITS10 17
+#define DCMTK_CHAR_TRAPS OFTrue
+#define DCMTK_CHAR_MODULO OFTrue
+#define DCMTK_SIGNED_CHAR_TRAPS OFTrue
+#define DCMTK_SIGNED_CHAR_MODULO OFTrue
+#define DCMTK_UNSIGNED_CHAR_TRAPS OFTrue
+#define DCMTK_UNSIGNED_CHAR_MODULO OFTrue
+#define DCMTK_SIGNED_SHORT_TRAPS OFTrue
+#define DCMTK_SIGNED_SHORT_MODULO OFTrue
+#define DCMTK_UNSIGNED_SHORT_TRAPS OFTrue
+#define DCMTK_UNSIGNED_SHORT_MODULO OFTrue
+#define DCMTK_SIGNED_INT_TRAPS OFTrue
+#define DCMTK_SIGNED_INT_MODULO OFTrue
+#define DCMTK_UNSIGNED_INT_TRAPS OFTrue
+#define DCMTK_UNSIGNED_INT_MODULO OFTrue
+#define DCMTK_SIGNED_LONG_TRAPS OFTrue
+#define DCMTK_SIGNED_LONG_MODULO OFTrue
+#define DCMTK_UNSIGNED_LONG_TRAPS OFTrue
+#define DCMTK_UNSIGNED_LONG_MODULO OFTrue
+#define DCMTK_FLOAT_TRAPS OFFalse
+#define DCMTK_DOUBLE_TRAPS OFFalse
+#define DCMTK_FLOAT_HAS_INFINITY OFTrue
+#define DCMTK_FLOAT_INFINITY *OFreinterpret_cast( const float*, "\000\000\200\177" )
+#define DCMTK_DOUBLE_HAS_INFINITY OFTrue
+#define DCMTK_DOUBLE_INFINITY *OFreinterpret_cast( const double*, "\000\000\000\000\000\000\360\177" )
+#define DCMTK_FLOAT_HAS_QUIET_NAN OFTrue
+#define DCMTK_FLOAT_QUIET_NAN *OFreinterpret_cast( const float*, "\000\000\300\177" )
+#define DCMTK_DOUBLE_HAS_QUIET_NAN OFTrue
+#define DCMTK_DOUBLE_QUIET_NAN *OFreinterpret_cast( const double*, "\000\000\000\000\000\000\370\177" )
+#define DCMTK_FLOAT_HAS_SIGNALING_NAN OFFalse
+#define DCMTK_FLOAT_SIGNALING_NAN *OFreinterpret_cast( const float*, "\001\000\200\177" )
+#define DCMTK_DOUBLE_HAS_SIGNALING_NAN OFFalse
+#define DCMTK_DOUBLE_SIGNALING_NAN *OFreinterpret_cast( const double*, "\001\000\000\000\000\000\360\177" )
+#define DCMTK_FLOAT_IS_IEC559 OFFalse
+#define DCMTK_DOUBLE_IS_IEC559 OFFalse
+#define DCMTK_FLOAT_HAS_DENORM OFdenorm_present
+#define DCMTK_FLOAT_DENORM_MIN *OFreinterpret_cast( const float*, "\001\000\000\000" )
+#define DCMTK_DOUBLE_HAS_DENORM OFdenorm_present
+#define DCMTK_DOUBLE_DENORM_MIN *OFreinterpret_cast( const double*, "\001\000\000\000\000\000\000\000" )
+#define DCMTK_FLOAT_TINYNESS_BEFORE OFTrue
+#define DCMTK_DOUBLE_TINYNESS_BEFORE OFTrue
+#define DCMTK_FLOAT_HAS_DENORM_LOSS OFTrue
+#define DCMTK_DOUBLE_HAS_DENORM_LOSS OFTrue
+#define DCMTK_ROUND_STYLE 1
+
+#endif // CONFIG_ARITH_H
diff --git a/recipes/dcmtk/all/patches/3.6.7-0003-ambiguous-overload-operator-equal.patch b/recipes/dcmtk/all/patches/3.6.7-0003-ambiguous-overload-operator-equal.patch
new file mode 100644
index 0000000000000..d4b6242e861a2
--- /dev/null
+++ b/recipes/dcmtk/all/patches/3.6.7-0003-ambiguous-overload-operator-equal.patch
@@ -0,0 +1,26 @@
+--- a/dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h
++++ b/dcmqrdb/include/dcmtk/dcmqrdb/dcmqridx.h
+@@ -122,10 +122,22 @@ struct DCMTK_DCMQRDB_EXPORT DB_SerializedTagKey
+     inline DB_SerializedTagKey(const DcmTagKey& rhs) { *this = rhs; }
+     inline DB_SerializedTagKey& operator=(const DcmTagKey& tk) { key[0] = tk.getGroup(); key[1] = tk.getElement(); return *this; }
+     inline operator DcmTagKey() const { return DcmTagKey( key[0], key[1] ); }
+-    inline bool operator==(const DB_SerializedTagKey& rhs) const { return key[0] == rhs.key[0] && key[1] == rhs.key[1]; }
+     Uint16 key[2];
+ };
+ 
++inline bool operator==(const DB_SerializedTagKey& lhs, const DB_SerializedTagKey& rhs)
++{
++    return lhs.key[0] == rhs.key[0] && lhs.key[1] == rhs.key[1];
++}
++inline bool operator==(const DB_SerializedTagKey& lhs, const DcmTagKey& rhs)
++{
++    return lhs == DB_SerializedTagKey(rhs);
++}
++inline bool operator==(const DcmTagKey& lhs, const DB_SerializedTagKey& rhs)
++{
++    return rhs == lhs;
++}
++
+ /* ENSURE THAT DBVERSION IS INCREMENTED WHENEVER ONE OF THESE STRUCTS IS MODIFIED */
+ 
+ struct DCMTK_DCMQRDB_EXPORT DB_SerializedCharPtr
diff --git a/recipes/dcmtk/all/patches/3.6.7-0004-fix-two-segmentation-faults.patch b/recipes/dcmtk/all/patches/3.6.7-0004-fix-two-segmentation-faults.patch
new file mode 100644
index 0000000000000..225b610e167f4
--- /dev/null
+++ b/recipes/dcmtk/all/patches/3.6.7-0004-fix-two-segmentation-faults.patch
@@ -0,0 +1,60 @@
+--- a/dcmdata/libsrc/dcelem.cc
++++ b/dcmdata/libsrc/dcelem.cc
+@@ -717,6 +717,13 @@ OFCondition DcmElement::loadValue(DcmInputStream *inStream)
+             if (isStreamNew)
+                 delete readStream;
+         }
++        else
++        {
++            errorFlag = EC_InvalidStream; // incomplete dataset read from stream
++            DCMDATA_ERROR("DcmElement: " << getTagName() << " " << getTag()
++                << " larger (" << getLengthField() << ") than remaining bytes ("
++                << getTransferredBytes() << ") in file, premature end of stream");
++        }
+     }
+     /* return result value */
+     return errorFlag;
+diff --git a/dcmnet/libsrc/dimcmd.cc b/dcmnet/libsrc/dimcmd.cc
+index 6dca39546..ffd225f4b 100644
+--- a/dcmnet/libsrc/dimcmd.cc
++++ b/dcmnet/libsrc/dimcmd.cc
+@@ -205,22 +205,25 @@ getString(DcmDataset *obj, DcmTagKey t, char *s, int maxlen, OFBool *spacePadded
+             return parseErrorWithMsg("dimcmd:getString: string too small", t);
+         } else {
+             ec =  elem->getString(aString);
+-            strncpy(s, aString, maxlen);
+-            if (spacePadded)
++            if (ec.good())
+             {
+-                /* before we remove leading and tailing spaces we want to know
+-                 * whether the string is actually space padded. Required to communicate
+-                 * with dumb peers which send space padded UIDs and fail if they
+-                 * receive correct UIDs back.
+-                 *
+-                 * This test can only detect space padded strings if
+-                 * dcmEnableAutomaticInputDataCorrection is false; otherwise the padding
+-                 * has already been removed by dcmdata at this stage.
+-                 */
+-                size_t s_len = strlen(s);
+-                if ((s_len > 0)&&(s[s_len-1] == ' ')) *spacePadded = OFTrue; else *spacePadded = OFFalse;
++                strncpy(s, aString, maxlen);
++                if (spacePadded)
++                {
++                    /* before we remove leading and tailing spaces we want to know
++                     * whether the string is actually space padded. Required to communicate
++                     * with dumb peers which send space padded UIDs and fail if they
++                     * receive correct UIDs back.
++                     *
++                     * This test can only detect space padded strings if
++                     * dcmEnableAutomaticInputDataCorrection is false; otherwise the padding
++                     * has already been removed by dcmdata at this stage.
++                     */
++                    size_t s_len = strlen(s);
++                    if ((s_len > 0)&&(s[s_len-1] == ' ')) *spacePadded = OFTrue; else *spacePadded = OFFalse;
++                }
++                DU_stripLeadingAndTrailingSpaces(s);
+             }
+-            DU_stripLeadingAndTrailingSpaces(s);
+         }
+     }
+     return (ec.good())? ec : DIMSE_PARSEFAILED;
\ No newline at end of file
diff --git a/recipes/dcmtk/all/patches/3.6.8-0001-cmake-robust-deps-handling.patch b/recipes/dcmtk/all/patches/3.6.8-0001-cmake-robust-deps-handling.patch
new file mode 100644
index 0000000000000..41e42340ad638
--- /dev/null
+++ b/recipes/dcmtk/all/patches/3.6.8-0001-cmake-robust-deps-handling.patch
@@ -0,0 +1,158 @@
+--- CMake/3rdparty.cmake
++++ CMake/3rdparty.cmake
+@@ -25,7 +25,7 @@
+ 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.")
+@@ -34,21 +34,13 @@
+     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.")
+@@ -57,13 +49,13 @@
+       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 "")
+@@ -75,15 +67,11 @@
+       list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
+       CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10002000L\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.2 or newer")
+         set(DCMTK_WITH_OPENSSL OFF CACHE BOOL "" FORCE)
+@@ -94,7 +82,7 @@
+ 
+   # 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 "")
+@@ -103,13 +91,13 @@
+       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 "")
+@@ -118,7 +106,7 @@
+       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()
+ 
+@@ -139,11 +127,10 @@
+ 
+   # 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)
+@@ -153,7 +140,7 @@
+             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 "")
+@@ -161,24 +148,24 @@
+       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.8-0002-cmake-check-openssl-symbol.patch b/recipes/dcmtk/all/patches/3.6.8-0002-cmake-check-openssl-symbol.patch
new file mode 100644
index 0000000000000..a4cd32b6e2766
--- /dev/null
+++ b/recipes/dcmtk/all/patches/3.6.8-0002-cmake-check-openssl-symbol.patch
@@ -0,0 +1,107 @@
+--- CMake/dcmtkPrepare.cmake
++++ CMake/dcmtkPrepare.cmake
+@@ -689,57 +689,59 @@
+   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("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("NID_dsa_with_SHA512" "openssl/obj_mac.h" HAVE_OPENSSL_PROTOTYPE_NID_DSA_WITH_SHA512)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS("NID_ecdsa_with_SHA3_256" "openssl/obj_mac.h" HAVE_OPENSSL_PROTOTYPE_NID_ECDSA_WITH_SHA3_256)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS("NID_sha512_256WithRSAEncryption" "openssl/obj_mac.h" HAVE_OPENSSL_PROTOTYPE_NID_SHA512_256WITHRSAENCRYPTION)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS("RAND_egd" "openssl/rand.h" HAVE_OPENSSL_PROTOTYPE_RAND_EGD)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_get0_param" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET0_PARAM)
+-  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_3_RFC_AES_128_CCM_8_SHA256" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_3_RFC_AES_128_CCM_8_SHA256)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS("TLS1_3_RFC_AES_256_GCM_SHA384" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_3_RFC_AES_256_GCM_SHA384)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS("TLS1_3_RFC_CHACHA20_POLY1305_SHA256" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_3_RFC_CHACHA20_POLY1305_SHA256)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS("TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS("TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384)
+-  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_CTX_get0_cert" "openssl/x509_vfy.h" HAVE_OPENSSL_PROTOTYPE_X509_STORE_CTX_GET0_CERT)
+-  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("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("NID_dsa_with_SHA512" "openssl/obj_mac.h" HAVE_OPENSSL_PROTOTYPE_NID_DSA_WITH_SHA512)
++  check_symbol_exists("NID_ecdsa_with_SHA3_256" "openssl/obj_mac.h" HAVE_OPENSSL_PROTOTYPE_NID_ECDSA_WITH_SHA3_256)
++  check_symbol_exists("NID_sha512_256WithRSAEncryption" "openssl/obj_mac.h" HAVE_OPENSSL_PROTOTYPE_NID_SHA512_256WITHRSAENCRYPTION)
++  check_symbol_exists("RAND_egd" "openssl/rand.h" HAVE_OPENSSL_PROTOTYPE_RAND_EGD)
++  check_symbol_exists("SSL_CTX_get0_param" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET0_PARAM)
++  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_3_RFC_AES_128_CCM_8_SHA256" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_3_RFC_AES_128_CCM_8_SHA256)
++  check_symbol_exists("TLS1_3_RFC_AES_256_GCM_SHA384" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_3_RFC_AES_256_GCM_SHA384)
++  check_symbol_exists("TLS1_3_RFC_CHACHA20_POLY1305_SHA256" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_3_RFC_CHACHA20_POLY1305_SHA256)
++  check_symbol_exists("TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8)
++  check_symbol_exists("TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384)
++  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_CTX_get0_cert" "openssl/x509_vfy.h" HAVE_OPENSSL_PROTOTYPE_X509_STORE_CTX_GET0_CERT)
++  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/3.6.8-0003-fix-two-segmentation-faults.patch b/recipes/dcmtk/all/patches/3.6.8-0003-fix-two-segmentation-faults.patch
new file mode 100644
index 0000000000000..225b610e167f4
--- /dev/null
+++ b/recipes/dcmtk/all/patches/3.6.8-0003-fix-two-segmentation-faults.patch
@@ -0,0 +1,60 @@
+--- a/dcmdata/libsrc/dcelem.cc
++++ b/dcmdata/libsrc/dcelem.cc
+@@ -717,6 +717,13 @@ OFCondition DcmElement::loadValue(DcmInputStream *inStream)
+             if (isStreamNew)
+                 delete readStream;
+         }
++        else
++        {
++            errorFlag = EC_InvalidStream; // incomplete dataset read from stream
++            DCMDATA_ERROR("DcmElement: " << getTagName() << " " << getTag()
++                << " larger (" << getLengthField() << ") than remaining bytes ("
++                << getTransferredBytes() << ") in file, premature end of stream");
++        }
+     }
+     /* return result value */
+     return errorFlag;
+diff --git a/dcmnet/libsrc/dimcmd.cc b/dcmnet/libsrc/dimcmd.cc
+index 6dca39546..ffd225f4b 100644
+--- a/dcmnet/libsrc/dimcmd.cc
++++ b/dcmnet/libsrc/dimcmd.cc
+@@ -205,22 +205,25 @@ getString(DcmDataset *obj, DcmTagKey t, char *s, int maxlen, OFBool *spacePadded
+             return parseErrorWithMsg("dimcmd:getString: string too small", t);
+         } else {
+             ec =  elem->getString(aString);
+-            strncpy(s, aString, maxlen);
+-            if (spacePadded)
++            if (ec.good())
+             {
+-                /* before we remove leading and tailing spaces we want to know
+-                 * whether the string is actually space padded. Required to communicate
+-                 * with dumb peers which send space padded UIDs and fail if they
+-                 * receive correct UIDs back.
+-                 *
+-                 * This test can only detect space padded strings if
+-                 * dcmEnableAutomaticInputDataCorrection is false; otherwise the padding
+-                 * has already been removed by dcmdata at this stage.
+-                 */
+-                size_t s_len = strlen(s);
+-                if ((s_len > 0)&&(s[s_len-1] == ' ')) *spacePadded = OFTrue; else *spacePadded = OFFalse;
++                strncpy(s, aString, maxlen);
++                if (spacePadded)
++                {
++                    /* before we remove leading and tailing spaces we want to know
++                     * whether the string is actually space padded. Required to communicate
++                     * with dumb peers which send space padded UIDs and fail if they
++                     * receive correct UIDs back.
++                     *
++                     * This test can only detect space padded strings if
++                     * dcmEnableAutomaticInputDataCorrection is false; otherwise the padding
++                     * has already been removed by dcmdata at this stage.
++                     */
++                    size_t s_len = strlen(s);
++                    if ((s_len > 0)&&(s[s_len-1] == ' ')) *spacePadded = OFTrue; else *spacePadded = OFFalse;
++                }
++                DU_stripLeadingAndTrailingSpaces(s);
+             }
+-            DU_stripLeadingAndTrailingSpaces(s);
+         }
+     }
+     return (ec.good())? ec : DIMSE_PARSEFAILED;
\ No newline at end of file
diff --git a/recipes/dcmtk/all/patches/3.6.8-0004-disable-oficonv-passthrough.patch b/recipes/dcmtk/all/patches/3.6.8-0004-disable-oficonv-passthrough.patch
new file mode 100644
index 0000000000000..535c23f69d8b9
--- /dev/null
+++ b/recipes/dcmtk/all/patches/3.6.8-0004-disable-oficonv-passthrough.patch
@@ -0,0 +1,35 @@
+--- a/config/docs/macros.txt
++++ b/config/docs/macros.txt
+@@ -70,6 +70,20 @@ DCMTK_ENABLE_ACR_NEMA_DATASET_PRESENT_COMPATIBILITY
+     if backwards compatibility with ACR-NEMA is desired. If this is
+     important, compile with this macro enabled.
+
++DCMTK_ENABLE_ICONV_PASSTHROUGH
++  Affected: oficonv
++  Type of modification: Activates feature
++  Explanation: If compiled with this macro, the oficonv libary will
++    simply copy input to output during a character set conversion if
++    input and output encoding are the same. This is more efficient, but
++    means that in invalid byte sequences in the source will remain
++    undetected and copied to the target, whereas the default behaviour
++    would detect this and stop the conversion. It is also incompatible
++    with the behaviour of the GNU iconv library.
++    In DCMTK 3.6.8, this feature was always enabled.
++    PATCH(conan-center-index): disabled by default in 3.6.8 as well to 
++    avoid regression https://support.dcmtk.org/redmine/issues/1143
++
+ DCMTK_ENABLE_STRICT_HUFFMAN_TABLE_CHECK
+   Affected: dcmjpeg
+   Type of modification: Activates feature
+--- a/oficonv/libsrc/citrus_iconv.c
++++ b/oficonv/libsrc/citrus_iconv.c
+@@ -139,8 +139,7 @@ open_shared(struct _citrus_iconv_shared * * rci,
+     size_t len_convname;
+     int ret;
+
+-#define INCOMPATIBLE_WITH_GNU_ICONV
+-#ifdef INCOMPATIBLE_WITH_GNU_ICONV
++#ifdef DCMTK_ENABLE_ICONV_PASSTHROUGH
+     /* 
+      * Use a pass-through when the (src,dest) encodings are the same.
+      */
\ No newline at end of file
diff --git a/recipes/dcmtk/all/test_package/CMakeLists.txt b/recipes/dcmtk/all/test_package/CMakeLists.txt
index 4e506092ed288..0e71714e4b9f5 100644
--- a/recipes/dcmtk/all/test_package/CMakeLists.txt
+++ b/recipes/dcmtk/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(DCMTK REQUIRED CONFIG)
diff --git a/recipes/dcmtk/all/test_v1_package/CMakeLists.txt b/recipes/dcmtk/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index be00a8c7f57c7..0000000000000
--- a/recipes/dcmtk/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/dcmtk/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_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 8e28175b23370..b11effedf16d6 100644
--- a/recipes/dcmtk/config.yml
+++ b/recipes/dcmtk/config.yml
@@ -1,3 +1,5 @@
 versions:
+  "3.6.8":
+    folder: "all"
   "3.6.7":
     folder: "all"
diff --git a/recipes/dd-opentracing-cpp/all/CMakeLists.txt b/recipes/dd-opentracing-cpp/all/CMakeLists.txt
deleted file mode 100644
index 4adab61a177bf..0000000000000
--- a/recipes/dd-opentracing-cpp/all/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-cmake_minimum_required(VERSION 3.1)
-project(cmake_wrapper)
-
-include(conanbuildinfo.cmake)
-conan_basic_setup()
-
-if(CONAN_COMPILER MATCHES "clang" AND CONAN_COMPILER_VERSION VERSION_LESS "4.0")
-    add_compile_options(-ftemplate-depth=1024)
-endif()
-
-add_subdirectory(source_subfolder)
diff --git a/recipes/dd-opentracing-cpp/all/conandata.yml b/recipes/dd-opentracing-cpp/all/conandata.yml
index 5c4a8f88936e6..d9d5dcbf278c1 100644
--- a/recipes/dd-opentracing-cpp/all/conandata.yml
+++ b/recipes/dd-opentracing-cpp/all/conandata.yml
@@ -1,8 +1,12 @@
 sources:
+  "1.3.7":
+    url: "https://github.com/DataDog/dd-opentracing-cpp/archive/refs/tags/v1.3.7.tar.gz"
+    sha256: "8d39c6b23f941a2d11571daaccc04e69539a3fcbcc50a631837560d5861a7b96"
   "1.3.0":
-    url: https://github.com/DataDog/dd-opentracing-cpp/archive/refs/tags/v1.3.0.tar.gz
-    sha256: 16aad0c0daed054d4bcdf68cf069956e8d3b0c60a33c2162ad655a17b33b65e4
+    url: "https://github.com/DataDog/dd-opentracing-cpp/archive/refs/tags/v1.3.0.tar.gz"
+    sha256: "16aad0c0daed054d4bcdf68cf069956e8d3b0c60a33c2162ad655a17b33b65e4"
 patches:
+  "1.3.7":
+    - patch_file: "patches/1.3.7/0001-Find-packages-setup.patch"
   "1.3.0":
-    - base_path: "source_subfolder"
-      patch_file: "patches/0001-Find-packages-setup.patch"
+    - patch_file: "patches/1.3.0/0001-Find-packages-setup.patch"
diff --git a/recipes/dd-opentracing-cpp/all/conanfile.py b/recipes/dd-opentracing-cpp/all/conanfile.py
index 39cb79ab41f5f..953c532aa7291 100644
--- a/recipes/dd-opentracing-cpp/all/conanfile.py
+++ b/recipes/dd-opentracing-cpp/all/conanfile.py
@@ -1,17 +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, CMakeDeps, CMakeToolchain, cmake_layout
+from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
+from conan.tools.scm import Version
+
+required_conan_version = ">=1.53.0"
 
 
 class DatadogOpenTracingConan(ConanFile):
     name = "dd-opentracing-cpp"
     description = "Monitoring service for cloud-scale applications based on OpenTracing "
     license = "Apache-2.0"
-    topics = ("instrumentration", "monitoring", "security", "tracing")
-    homepage = "https://github.com/DataDog/dd-opentracing-cpp"
     url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://github.com/DataDog/dd-opentracing-cpp"
+    topics = ("instrumentation", "monitoring", "security", "tracing")
 
+    package_type = "library"
     settings = "os", "arch", "compiler", "build_type"
     options = {
         "shared": [True, False],
@@ -22,30 +29,18 @@ class DatadogOpenTracingConan(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"
-
     @property
     def _compilers_minimum_version(self):
         return {
             "gcc": "5",
             "Visual Studio": "15",
+            "msvc": "191",
             "clang": "3.4",
             "apple-clang": "7",
         }
 
     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":
@@ -53,68 +48,59 @@ 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("opentracing-cpp/1.6.0")
-        self.requires("zlib/1.2.11")
-        self.requires("libcurl/7.80.0")
-        self.requires("msgpack/3.3.0")
-        self.requires("nlohmann_json/3.10.5")
+        self.requires("opentracing-cpp/1.6.0", transitive_headers=True, transitive_libs=True)
+        self.requires("zlib/[>=1.2.11 <2]")
+        self.requires("libcurl/[>=7.78 <9]")
+        self.requires("msgpack-cxx/6.1.0")
+        self.requires("nlohmann_json/3.11.2")
+
+    @property
+    def _min_cppstd(self):
+        return 14
 
     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("Datadog-opentracing requires C++14, which your compiler does not support.")
-        else:
-            self.output.warn("Datadog-opentracing requires C++14. Your compiler is unknown. Assuming it supports C++14.")
+            if 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 generate(self):
+        tc = CMakeToolchain(self)
+        tc.variables["BUILD_PLUGIN"] = False
+        tc.variables["BUILD_SHARED"] = self.options.shared
+        tc.variables["BUILD_STATIC"] = not self.options.shared
+        tc.variables["BUILD_TESTING"] = False
+        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.definitions["BUILD_PLUGIN"] = False
-        self._cmake.definitions["BUILD_SHARED"] = self.options.shared
-        self._cmake.definitions["BUILD_STATIC"] = not self.options.shared
-        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):
-        # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed
-        self.cpp_info.components["dd_opentracing"].libs = ["dd_opentracing"]
-        self.cpp_info.components["dd_opentracing"].defines.append(
-            "DD_OPENTRACING_SHARED" if self.options.shared else "DD_OPENTRACING_STATIC"
-        )
+        self.cpp_info.libs = ["dd_opentracing"]
+        self.cpp_info.defines.append("DD_OPENTRACING_SHARED" if self.options.shared else "DD_OPENTRACING_STATIC")
         if self.settings.os in ("Linux", "FreeBSD"):
-            self.cpp_info.components["dd_opentracing"].system_libs.append("pthread")
-
-        # TODO: to remove in conan v2 once cmake_find_package_* generators removed.
-        #       Do not support these names in CMakeDeps, it was a mistake, upstream doesn't export targets
-        self.cpp_info.names["cmake_find_package"] = "DataDogOpenTracing"
-        self.cpp_info.names["cmake_find_package_multi"] = "DataDogOpenTracing"
-        target_suffix = "" if self.options.shared else "-static"
-        self.cpp_info.components["dd_opentracing"].names["cmake_find_package"] = "dd_opentracing" + target_suffix
-        self.cpp_info.components["dd_opentracing"].names["cmake_find_package_multi"] = "dd_opentracing" + target_suffix
-        self.cpp_info.components["dd_opentracing"].requires = [
-            "opentracing-cpp::opentracing-cpp", "zlib::zlib", "libcurl::libcurl",
-            "msgpack::msgpack", "nlohmann_json::nlohmann_json",
-        ]
+            self.cpp_info.system_libs.append("pthread")
diff --git a/recipes/dd-opentracing-cpp/all/patches/0001-Find-packages-setup.patch b/recipes/dd-opentracing-cpp/all/patches/0001-Find-packages-setup.patch
deleted file mode 100644
index 3308c5a043699..0000000000000
--- a/recipes/dd-opentracing-cpp/all/patches/0001-Find-packages-setup.patch
+++ /dev/null
@@ -1,65 +0,0 @@
----
- CMakeLists.txt | 30 ++++++++++--------------------
- 1 file changed, 10 insertions(+), 20 deletions(-)
-
---- CMakeLists.txt
-+++ CMakeLists.txt
-@@ -34,17 +34,12 @@ include_directories(include)
- set(CMAKE_LIBRARY_PATH deps/lib)
- 
- # Dependencies
--find_path(OPENTRACING_INCLUDE_DIR NAMES opentracing/tracer.h)
--find_library(OPENTRACING_LIB opentracing)
-+find_package(OpenTracing REQUIRED)
- find_package(ZLIB REQUIRED)
--find_library(MSGPACK_LIB msgpack)
--find_package(CURL)
-+find_package(msgpack REQUIRED)
-+find_package(CURL REQUIRED)
- find_package(Threads REQUIRED)
- 
--# Code Sanitizers
--set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/3rd_party/sanitizers-cmake" ${CMAKE_MODULE_PATH})
--find_package(Sanitizers)
--
- # Code
- install(DIRECTORY include/datadog DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
- file(GLOB DD_OPENTRACING_SOURCES "src/*.cpp")
-@@ -58,29 +53,24 @@ else()
- endif()
- 
- # Outputs
--set(DATADOG_LINK_LIBRARIES ${OPENTRACING_LIB} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} Threads::Threads)
-+set(DATADOG_LINK_LIBRARIES OpenTracing::OpenTracing CURL::CURL msgpack::msgpack ZLIB::ZLIB Threads::Threads)
- 
- ## Shared lib
- if(BUILD_SHARED)
-   add_library(dd_opentracing SHARED ${DD_OPENTRACING_SOURCES})
--  add_sanitizers(dd_opentracing)
-   target_link_libraries(dd_opentracing ${DATADOG_LINK_LIBRARIES})
-   set_target_properties(dd_opentracing PROPERTIES SOVERSION ${SOVERSION})
--  target_compile_definitions(dd_opentracing PRIVATE DD_OPENTRACING_SHARED)
--  install(TARGETS dd_opentracing
--          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
--          ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
-+  target_compile_definitions(dd_opentracing PUBLIC DD_OPENTRACING_SHARED)
-+  install(TARGETS dd_opentracing)
- endif()
- 
- ## Static lib
- if(BUILD_STATIC)
-   add_library(dd_opentracing-static STATIC ${DD_OPENTRACING_SOURCES})
--  add_sanitizers(dd_opentracing-static)
--  set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing POSITION_INDEPENDENT_CODE ON)
--  target_compile_definitions(dd_opentracing PRIVATE DD_OPENTRACING_STATIC)
--  install(TARGETS dd_opentracing-static
--          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
--          ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
-+  target_link_libraries(dd_opentracing-static ${DATADOG_LINK_LIBRARIES})
-+  set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing)
-+  target_compile_definitions(dd_opentracing-static PUBLIC DD_OPENTRACING_STATIC)
-+  install(TARGETS dd_opentracing-static)
- endif()
- 
- ## Plugin
-
diff --git a/recipes/dd-opentracing-cpp/all/patches/1.3.0/0001-Find-packages-setup.patch b/recipes/dd-opentracing-cpp/all/patches/1.3.0/0001-Find-packages-setup.patch
new file mode 100644
index 0000000000000..da57cbb9c9845
--- /dev/null
+++ b/recipes/dd-opentracing-cpp/all/patches/1.3.0/0001-Find-packages-setup.patch
@@ -0,0 +1,54 @@
+--- CMakeLists.txt
++++ CMakeLists.txt
+@@ -34,16 +34,11 @@
+ set(CMAKE_LIBRARY_PATH deps/lib)
+ 
+ # Dependencies
+-find_path(OPENTRACING_INCLUDE_DIR NAMES opentracing/tracer.h)
+-find_library(OPENTRACING_LIB opentracing)
++find_package(OpenTracing REQUIRED CONFIG)
+ find_package(ZLIB REQUIRED)
+-find_library(MSGPACK_LIB msgpack)
+-find_package(CURL)
++find_package(msgpack REQUIRED CONFIG)
++find_package(CURL REQUIRED CONFIG)
+ find_package(Threads REQUIRED)
+-
+-# Code Sanitizers
+-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/3rd_party/sanitizers-cmake" ${CMAKE_MODULE_PATH})
+-find_package(Sanitizers)
+ 
+ # Code
+ install(DIRECTORY include/datadog DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+@@ -58,16 +53,16 @@
+ endif()
+ 
+ # Outputs
+-set(DATADOG_LINK_LIBRARIES ${OPENTRACING_LIB} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} Threads::Threads)
++set(DATADOG_LINK_LIBRARIES OpenTracing::OpenTracing CURL::libcurl msgpack-cxx ZLIB::ZLIB Threads::Threads)
+ 
+ ## Shared lib
+ if(BUILD_SHARED)
+   add_library(dd_opentracing SHARED ${DD_OPENTRACING_SOURCES})
+-  add_sanitizers(dd_opentracing)
+   target_link_libraries(dd_opentracing ${DATADOG_LINK_LIBRARIES})
+   set_target_properties(dd_opentracing PROPERTIES SOVERSION ${SOVERSION})
+   target_compile_definitions(dd_opentracing PRIVATE DD_OPENTRACING_SHARED)
+   install(TARGETS dd_opentracing
++          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+           LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+           ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
+@@ -75,9 +70,9 @@
+ ## Static lib
+ if(BUILD_STATIC)
+   add_library(dd_opentracing-static STATIC ${DD_OPENTRACING_SOURCES})
+-  add_sanitizers(dd_opentracing-static)
+-  set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing POSITION_INDEPENDENT_CODE ON)
+-  target_compile_definitions(dd_opentracing PRIVATE DD_OPENTRACING_STATIC)
++  target_link_libraries(dd_opentracing-static ${DATADOG_LINK_LIBRARIES})
++  set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing)
++  target_compile_definitions(dd_opentracing-static PUBLIC DD_OPENTRACING_STATIC)
+   install(TARGETS dd_opentracing-static
+           LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+           ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/recipes/dd-opentracing-cpp/all/patches/1.3.7/0001-Find-packages-setup.patch b/recipes/dd-opentracing-cpp/all/patches/1.3.7/0001-Find-packages-setup.patch
new file mode 100644
index 0000000000000..9c70c924a04a6
--- /dev/null
+++ b/recipes/dd-opentracing-cpp/all/patches/1.3.7/0001-Find-packages-setup.patch
@@ -0,0 +1,60 @@
+--- CMakeLists.txt
++++ CMakeLists.txt
+@@ -35,15 +35,10 @@
+ set(CMAKE_LIBRARY_PATH deps/lib)
+ 
+ # Dependencies
+-find_path(OPENTRACING_INCLUDE_DIR NAMES opentracing/tracer.h)
+-find_library(OPENTRACING_LIB opentracing)
+-find_library(MSGPACK_LIB msgpack)
+-find_package(CURL)
++find_package(OpenTracing REQUIRED CONFIG)
++find_package(msgpack REQUIRED CONFIG)
++find_package(CURL REQUIRED CONFIG)
+ find_package(Threads REQUIRED)
+-
+-# Code Sanitizers
+-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/3rd_party/sanitizers-cmake" ${CMAKE_MODULE_PATH})
+-find_package(Sanitizers)
+ 
+ # Code
+ install(DIRECTORY include/datadog DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+@@ -64,12 +59,12 @@
+ if(BUILD_COVERAGE)
+   set(COVERAGE_LIBRARIES gcov)
+ endif()
+-set(DATADOG_LINK_LIBRARIES ${OPENTRACING_LIB} ${CURL_LIBRARIES} Threads::Threads ${COVERAGE_LIBRARIES})
++set(DATADOG_LINK_LIBRARIES OpenTracing::OpenTracing CURL::libcurl ${msgpack_LIBRARIES} ZLIB::ZLIB Threads::Threads)
++include_directories(${msgpack_INCLUDE_DIRS})
+ 
+ ## Shared lib
+ if(BUILD_SHARED)
+   add_library(dd_opentracing SHARED ${DD_OPENTRACING_SOURCES})
+-  add_sanitizers(dd_opentracing)
+   if(BUILD_COVERAGE)
+     target_link_options(dd_opentracing PRIVATE -fprofile-arcs -ftest-coverage)
+   endif()
+@@ -77,6 +72,7 @@
+   set_target_properties(dd_opentracing PROPERTIES SOVERSION ${SOVERSION})
+   target_compile_definitions(dd_opentracing PUBLIC DD_OPENTRACING_SHARED)
+   install(TARGETS dd_opentracing
++          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+           LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+           ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
+@@ -84,13 +80,10 @@
+ ## Static lib
+ if(BUILD_STATIC)
+   add_library(dd_opentracing-static STATIC ${DD_OPENTRACING_SOURCES})
+-  add_sanitizers(dd_opentracing-static)
+   target_link_libraries(dd_opentracing-static ${DATADOG_LINK_LIBRARIES})
+-  set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing POSITION_INDEPENDENT_CODE ON)
++  set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing)
+   target_compile_definitions(dd_opentracing-static PUBLIC DD_OPENTRACING_STATIC)
+-  install(TARGETS dd_opentracing-static
+-          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+-          ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++  install(TARGETS dd_opentracing-static)
+ endif()
+ 
+ ## Object lib
diff --git a/recipes/dd-opentracing-cpp/all/test_package/CMakeLists.txt b/recipes/dd-opentracing-cpp/all/test_package/CMakeLists.txt
index 61e5eac8d9ed0..f80f836e06bd4 100644
--- a/recipes/dd-opentracing-cpp/all/test_package/CMakeLists.txt
+++ b/recipes/dd-opentracing-cpp/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(dd-opentracing-cpp REQUIRED CONFIG)
 
 add_executable(${PROJECT_NAME} test_package.cpp)
-target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
+target_link_libraries(${PROJECT_NAME} PRIVATE dd-opentracing-cpp::dd-opentracing-cpp)
 set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)
diff --git a/recipes/dd-opentracing-cpp/all/test_package/conanfile.py b/recipes/dd-opentracing-cpp/all/test_package/conanfile.py
index 5c09494bc67c0..ef5d7042163ec 100644
--- a/recipes/dd-opentracing-cpp/all/test_package/conanfile.py
+++ b/recipes/dd-opentracing-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"
+    generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
+    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/dd-opentracing-cpp/config.yml b/recipes/dd-opentracing-cpp/config.yml
index 426a0e4c79e9b..670c8dce3f891 100644
--- a/recipes/dd-opentracing-cpp/config.yml
+++ b/recipes/dd-opentracing-cpp/config.yml
@@ -1,3 +1,5 @@
 versions:
+  "1.3.7":
+    folder: all
   "1.3.0":
     folder: all
diff --git a/recipes/debug_assert/all/conandata.yml b/recipes/debug_assert/all/conandata.yml
index cfa7ab5250ed4..dc2038ed34a68 100644
--- a/recipes/debug_assert/all/conandata.yml
+++ b/recipes/debug_assert/all/conandata.yml
@@ -1,4 +1,7 @@
 sources:
-  '1.3.3':
-    url: https://github.com/foonathan/debug_assert/archive/v1.3.3.zip
-    sha256: c0871c7bb8d7e0f36cfae9a5ba526ea0c0fcaa41203ffb4280de27cb030e7383
+  "1.3.4":
+    url: "https://github.com/foonathan/debug_assert/archive/v1.3.4.zip"
+    sha256: "e29925b1b51e10b46e8c4f3d57a86db6a7ebc7cdec53fe30c1b0ca22ef845f43"
+  "1.3.3":
+    url: "https://github.com/foonathan/debug_assert/archive/v1.3.3.zip"
+    sha256: "c0871c7bb8d7e0f36cfae9a5ba526ea0c0fcaa41203ffb4280de27cb030e7383"
diff --git a/recipes/debug_assert/config.yml b/recipes/debug_assert/config.yml
index 416be34945c37..3b34bc0f54258 100644
--- a/recipes/debug_assert/config.yml
+++ b/recipes/debug_assert/config.yml
@@ -1,3 +1,5 @@
 versions:
-  '1.3.3':
+  "1.3.4":
+    folder: all
+  "1.3.3":
     folder: all
diff --git a/recipes/decimal_for_cpp/all/test_package/CMakeLists.txt b/recipes/decimal_for_cpp/all/test_package/CMakeLists.txt
index ee7bfe5c692c5..f11b229fe79f1 100644
--- a/recipes/decimal_for_cpp/all/test_package/CMakeLists.txt
+++ b/recipes/decimal_for_cpp/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(decimal_for_cpp REQUIRED CONFIG)
diff --git a/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt b/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index be00a8c7f57c7..0000000000000
--- a/recipes/decimal_for_cpp/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/decimal_for_cpp/all/test_v1_package/conanfile.py b/recipes/decimal_for_cpp/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/decimal_for_cpp/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_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/deco/all/test_v1_package/CMakeLists.txt b/recipes/deco/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/deco/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index f64055b093b4d..0000000000000
--- a/recipes/deco/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,18 +0,0 @@
-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/depot_tools/all/conandata.yml b/recipes/depot_tools/all/conandata.yml
index 76dffe6ab4ef4..c5be0b81adc6c 100644
--- a/recipes/depot_tools/all/conandata.yml
+++ b/recipes/depot_tools/all/conandata.yml
@@ -1,4 +1,6 @@
 sources:
+  "cci.20241206":
+    url: "https://chromium.googlesource.com/chromium/tools/depot_tools.git/+archive/ba733f35cde8ae85e7ca85956cdc63b297dc9425.tar.gz"
   "20200407":
     url: "https://chromium.googlesource.com/chromium/tools/depot_tools/+archive/48c5c9c50455c625c58dab2fbb0904cac467168c.tar.gz"
   "cci.20201009":
@@ -6,4 +8,3 @@ sources:
 patches:
   "cci.20201009":
     - patch_file: "patches/001-use-system-python.patch"
-      base_path: "source_subfolder"
diff --git a/recipes/depot_tools/all/conanfile.py b/recipes/depot_tools/all/conanfile.py
index 45bfe37d78533..a56140f75a3c9 100644
--- a/recipes/depot_tools/all/conanfile.py
+++ b/recipes/depot_tools/all/conanfile.py
@@ -1,24 +1,33 @@
 import os
 import shutil
-from conans import ConanFile, tools
+
+from conan import ConanFile
+from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
+from conan.tools.layout import basic_layout
+
+required_conan_version = ">=1.52.0"
 
 
 class DepotToolsConan(ConanFile):
     name = "depot_tools"
-    url = "https://github.com/conan-io/conan-center-index"
-    homepage = "https://chromium.googlesource.com/chromium/tools/depot_tools"
     description = "Tools for working with Chromium development."
-    topics = ("depot_tools", "chromium")
     license = "BSD-3-Clause"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://chromium.googlesource.com/chromium/tools/depot_tools"
+    topics = ("chromium", "pre-built")
+
+    package_type = "application"
+    settings = "os", "arch", "compiler", "build_type"
     short_paths = True
-    no_copy_source = True
-    settings = "os", "arch", "build_type", "compiler"
-    exports_sources = ["patches/**"]
 
+    def export_sources(self):
+        export_conandata_patches(self)
+
+    def layout(self):
+        basic_layout(self, src_folder="src")
 
-    @property
-    def _source_subfolder(self):
-        return os.path.join(self.source_folder, "source_subfolder")
+    def package_id(self):
+        self.info.clear()
 
     def _dereference_symlinks(self):
         """
@@ -30,7 +39,7 @@ def _dereference_symlinks(self):
         if self.settings.os != "Windows":
             return
 
-        for root, dirs, files in os.walk(self._source_subfolder):
+        for root, dirs, files in os.walk(self.source_folder):
             symlinks = [os.path.join(root, f) for f in files if os.path.islink(os.path.join(root, f))]
             for symlink in symlinks:
                 dest = os.readlink(symlink)
@@ -38,55 +47,60 @@ def _dereference_symlinks(self):
                 shutil.copy(os.path.join(root, dest), symlink, follow_symlinks=False)
                 self.output.info("Replaced symlink '%s' with its destination file '%s'" % (symlink, dest))
 
-    def source(self):
-        tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder)
+    def build(self):
+        get(self, **self.conan_data["sources"][self.version], destination=self.source_folder)
         self._dereference_symlinks()
-
-        for patch in self.conan_data.get("patches", {}).get(self.version, []):
-            tools.patch(**patch)
-
-    def package(self):
-        self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
-        self.copy(pattern="*", dst="bin", src=self._source_subfolder)
-        self._fix_permissions()
+        apply_conandata_patches(self)
 
     def _fix_permissions(self):
+        if self.settings.os == "Windows":
+            return
 
         def chmod_plus_x(name):
             os.chmod(name, os.stat(name).st_mode | 0o111)
 
-        if self.settings.os != "Windows":
-            for root, _, files in os.walk(self.package_folder):
-                for file_it in files:
-                    filename = os.path.join(root, file_it)
-                    with open(filename, 'rb') as f:
-                        sig = f.read(4)
-                        if type(sig) is str:
-                            sig = [ord(s) for s in sig]
-                        if len(sig) >= 2 and sig[0] == 0x23 and sig[1] == 0x21:
-                            self.output.info('chmod on script file %s' % file_it)
-                            chmod_plus_x(filename)
-                        elif sig == [0x7F, 0x45, 0x4C, 0x46]:
-                            self.output.info('chmod on ELF file %s' % file_it)
-                            chmod_plus_x(filename)
-                        elif \
-                                sig == [0xCA, 0xFE, 0xBA, 0xBE] or \
-                                sig == [0xBE, 0xBA, 0xFE, 0xCA] or \
-                                sig == [0xFE, 0xED, 0xFA, 0xCF] or \
-                                sig == [0xCF, 0xFA, 0xED, 0xFE] or \
-                                sig == [0xFE, 0xED, 0xFA, 0xCE] or \
-                                sig == [0xCE, 0xFA, 0xED, 0xFE]:
-                            self.output.info('chmod on Mach-O file %s' % file_it)
-                            chmod_plus_x(filename)
+        for root, _, files in os.walk(self.package_folder):
+            for file_it in files:
+                filename = os.path.join(root, file_it)
+                with open(filename, "rb") as f:
+                    sig = tuple(f.read(4))
+                if len(sig) >= 2 and sig[0] == 0x23 and sig[1] == 0x21:
+                    self.output.info(f"chmod on script file {file_it}")
+                    chmod_plus_x(filename)
+                elif sig == (0x7F, 0x45, 0x4C, 0x46):
+                    self.output.info(f"chmod on ELF file {file_it}")
+                    chmod_plus_x(filename)
+                elif sig in [
+                    (0xCA, 0xFE, 0xBA, 0xBE),
+                    (0xBE, 0xBA, 0xFE, 0xCA),
+                    (0xFE, 0xED, 0xFA, 0xCF),
+                    (0xCF, 0xFA, 0xED, 0xFE),
+                    (0xFE, 0xED, 0xFA, 0xCE),
+                    (0xCE, 0xFA, 0xED, 0xFE),
+                ]:
+                    self.output.info(f"chmod on Mach-O file {file_it}")
+                    chmod_plus_x(filename)
 
-    def package_id(self):
-        del self.info.settings.arch
-        del self.info.settings.build_type
-        del self.info.settings.compiler
+    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, "bin"),
+             src=self.source_folder)
+        self._fix_permissions()
 
     def package_info(self):
+        self.cpp_info.frameworkdirs = []
+        self.cpp_info.libdirs = []
+        self.cpp_info.resdirs = []
+        self.cpp_info.includedirs = []
+
+        self.runenv_info.define("DEPOT_TOOLS_UPDATE", "0")
+        self.buildenv_info.define("DEPOT_TOOLS_UPDATE", "0")
+
+        # TODO: Legacy, to be removed on Conan 2.0
         bin_path = os.path.join(self.package_folder, "bin")
-        self.output.info("Appending PATH env var with : {}".format(bin_path))
+        self.output.info(f"Appending PATH env var with : {bin_path}")
         self.env_info.PATH.append(bin_path)
-
         self.env_info.DEPOT_TOOLS_UPDATE = "0"
diff --git a/recipes/depot_tools/all/test_package/conanfile.py b/recipes/depot_tools/all/test_package/conanfile.py
index 38bf21d14dbee..f933a36b59620 100644
--- a/recipes/depot_tools/all/test_package/conanfile.py
+++ b/recipes/depot_tools/all/test_package/conanfile.py
@@ -1,7 +1,24 @@
-from conans import ConanFile
+from conan import ConanFile
+from conan.tools.layout import basic_layout
+from conan.tools.scm import Version
+import os
 
 
 class TestPackageConan(ConanFile):
+    settings = "os", "arch", "compiler", "build_type"
+    generators = "VirtualBuildEnv"
+
+    def layout(self):
+        basic_layout(self)
+
+    def build_requirements(self):
+        self.tool_requires(self.tested_reference_str)
+
     def test(self):
-        # cit: Chrome Infrastructure CLI
-        self.run("cit --help", run_environment=True)
+        if Version(self.dependencies.build[self.tested_reference_str].ref.version) != "cci.20241206":
+            # INFO: cit was deprecated on 2023-07-28
+            # See the commit d062c2eb80f09740268101be72db13167c898a5d
+            self.run("cit --help")
+        # INFO: The depot tools has its own python interpreter and it will download several dependencies at the first run
+        # When running gclient or other tools, their shebang is prepared to use the python interpreter from depot tools
+        assert os.path.exists(os.path.join(self.dependencies.build[self.tested_reference_str].cpp_info.bindir, "gclient"))
diff --git a/recipes/depot_tools/config.yml b/recipes/depot_tools/config.yml
index 67beecc3322c0..a008700eadbce 100644
--- a/recipes/depot_tools/config.yml
+++ b/recipes/depot_tools/config.yml
@@ -3,3 +3,5 @@ versions:
     folder: all
   "cci.20201009":
     folder: all
+  "cci.20241206":
+    folder: all
diff --git a/recipes/detools/all/test_package/old b/recipes/detools/all/test_package/old
deleted file mode 100644
index 0368e11feda26..0000000000000
Binary files a/recipes/detools/all/test_package/old and /dev/null differ
diff --git a/recipes/detools/all/test_package/patch b/recipes/detools/all/test_package/patch
deleted file mode 100644
index 99321d7000aa0..0000000000000
Binary files a/recipes/detools/all/test_package/patch and /dev/null differ
diff --git a/recipes/detools/all/test_package/test_package.c b/recipes/detools/all/test_package/test_package.c
index 7567264b2867b..b2e3a040fb0d5 100644
--- a/recipes/detools/all/test_package/test_package.c
+++ b/recipes/detools/all/test_package/test_package.c
@@ -1,38 +1,7 @@
 #include 
 #include "detools.h"
 
-/* Helper functions. */
-static int flash_read(void *arg_p, void *dst_p, uintptr_t src, size_t size)
-{
-    return (0);
-}
-
-static int flash_write(void *arg_p, uintptr_t dst, void *src_p, size_t size)
-{
-    return (0);
-}
-
-static int flash_erase(void *arg_p, uintptr_t addr, size_t size)
-{
-    return (0);
-}
-
-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)
+static int dummy_function()
 {
     return (0);
 }
@@ -44,16 +13,15 @@ int main()
     int res;
     size_t patch_size = 512;
 
-    /* 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,
+                                            dummy_function,
+                                            dummy_function,
+                                            dummy_function,
+                                            dummy_function,
+                                            dummy_function,
                                             patch_size,
                                             NULL);
-
+    printf("detools_apply_patch_in_place_init: %d\n", res);
     if (res != 0) {
         return (res);
     }
diff --git a/recipes/detours/all/conanfile.py b/recipes/detours/all/conanfile.py
index 7bea0de65a209..c75aa1faad0dc 100644
--- a/recipes/detours/all/conanfile.py
+++ b/recipes/detours/all/conanfile.py
@@ -40,10 +40,9 @@ def validate(self):
         if self.settings.os != "Windows":
             raise ConanInvalidConfiguration("Only os=Windows 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)")
+            self.output.warning("Detours might behave unexpectedly when not built with static runtime (MT)")
         if self.settings.build_type != "Release":
-            raise ConanInvalidConfiguration("Detours only supports the Release build type")
+            self.output.warning("Detours might behave unexpectedly when not built with Release build type")
         try:
             self.output.info(f"target process is {self._target_processor}")
         except KeyError:
diff --git a/recipes/detours/all/test_v1_package/CMakeLists.txt b/recipes/detours/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/detours/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index 43240d491944c..0000000000000
--- a/recipes/detours/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,22 +0,0 @@
-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/devil/all/conandata.yml b/recipes/devil/all/conandata.yml
new file mode 100644
index 0000000000000..74ea90398189d
--- /dev/null
+++ b/recipes/devil/all/conandata.yml
@@ -0,0 +1,23 @@
+sources:
+  # Newer versions at the top
+  "1.8.0":
+    url:
+    - "https://github.com/DentonW/DevIL/archive/refs/tags/v1.8.0.tar.gz"
+    sha256: "52129f247b26fcb5554643c9e6bbee75c4b9717735fdbf3c6ebff08cee38ad37"
+patches:
+  "1.8.0":
+    - patch_file: "patches/1.8.0-jp2_fix.patch"
+      patch_description: "Make devil build with supported versions of jasper"
+      patch_type: "conan"
+    - patch_file: "patches/1.8.0-jpeg_fix.patch"
+      patch_description: "Make devil build with newer versions of libjpeg"
+      patch_type: "conan"
+    - patch_file: "patches/1.8.0-remove_register_keyword.patch"
+      patch_description: "Remove invalid register keyword"
+      patch_type: "conan"
+    - patch_file: "patches/1.8.0-avoid-methoddef-dllimport-error.patch"
+      patch_description: "remove uses of METHODDEF from libjpeg as they are unneeded and cause errors in MSVC"
+      patch_type: "conan"
+    - patch_file: "patches/1.8.0-install-ilut-config-h.patch"
+      patch_description: "ensure ilut_config.h is installed"
+      patch_type: "conan"
diff --git a/recipes/devil/all/conanfile.py b/recipes/devil/all/conanfile.py
new file mode 100644
index 0000000000000..c0ac54d3bb270
--- /dev/null
+++ b/recipes/devil/all/conanfile.py
@@ -0,0 +1,154 @@
+from conan import ConanFile
+from conan.tools.apple import fix_apple_shared_install_name
+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, rm, rmdir
+from conan.tools.scm import Version
+from conan.errors import ConanException
+import os
+
+
+required_conan_version = ">=2.1"
+
+
+class DevilConan(ConanFile):
+    name = "devil"
+    description = "Developer's Image Library (DevIL) is a programmer's library to develop applications with very " \
+                  "powerful image loading capabilities, yet is easy for a developer to learn and use."
+    license = "LGPL-2.1-only"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://openil.sourceforge.net/"
+    topics = ("devil", "image")
+    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],
+        "with_jasper": [True, False],
+        "with_squish": [True, False],
+        "with_lcms": [True, False]
+    }
+    default_options = {
+        "shared": False,
+        "fPIC": True,
+        "with_png": True,
+        "with_jpeg": True,
+        "with_tiff": True,
+        "with_jasper": True,
+        "with_squish": True,
+        "with_lcms": True
+    }
+
+    implements = ["auto_shared_fpic"]
+
+    def export_sources(self):
+        export_conandata_patches(self)
+
+    def layout(self):
+        cmake_layout(self, src_folder="src")
+
+    def requirements(self):
+        if self.options.with_png:
+            self.requires("libpng/[>=1.6 <2]")
+        if self.options.with_jpeg:
+            self.requires("libjpeg/9e")
+        if self.options.with_tiff:
+            self.requires("libtiff/4.7.0")
+        if self.options.with_jasper:
+            self.requires("jasper/4.2.4")
+        if self.options.with_squish:
+            self.requires("libsquish/1.15")
+        if self.options.with_lcms:
+            self.requires("lcms/2.16")
+
+    def source(self):
+        get(self, **self.conan_data["sources"][self.version], strip_root=True)
+        self._patch_sources()
+
+    def generate(self):
+        tc = CMakeToolchain(self)
+
+        # The CMakeLists will try to call find_package regardless of options
+        # ensure that even if they are picked up by the system, they are not used
+        tc.variables["IL_NO_PNG"] = not self.options.with_png
+        tc.variables["IL_NO_JPG"] = not self.options.with_jpeg
+        tc.variables["IL_NO_TIF"] = not self.options.with_tiff
+        tc.variables["IL_NO_JP2"] = not self.options.with_jasper
+        tc.variables["IL_NO_LCMS"] = not self.options.with_lcms
+        tc.variables["IL_USE_DXTC_SQUISH"] = self.options.with_squish
+        tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support
+        if Version(self.version) > "1.8.0": # pylint: disable=conan-unreachable-upper-version
+            raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4")
+        tc.generate()
+
+        deps = CMakeDeps(self)
+        deps.generate()
+
+    def _patch_sources(self):
+        apply_conandata_patches(self)
+        # Let Conan handle the shared/static build
+        replace_in_file(self, os.path.join(self.source_folder, "DevIL", "src-ILU", "CMakeLists.txt"),
+                        "add_library(ILU SHARED ",
+                        "add_library(ILU ")
+
+        replace_in_file(self, os.path.join(self.source_folder, "DevIL", "src-ILUT", "CMakeLists.txt"),
+                        "add_library(ILUT SHARED ",
+                        "add_library(ILUT ")
+
+    def build(self):
+        cmake = CMake(self)
+        cmake.configure(build_script_folder=os.path.join(self.source_folder, "DevIL"))
+        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", "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"))
+        fix_apple_shared_install_name(self)
+
+    def package_info(self):
+        self.cpp_info.set_property("cmake_file_name", "DevIL")
+        self.cpp_info.set_property("cmake_target_name", "DevIL::DevIL")
+
+        if self.settings.os == "Windows":
+            self.cpp_info.components["IL"].libs = ["DevIL"]
+        else:
+            self.cpp_info.components["IL"].libs = ["IL"]
+        self.cpp_info.components["IL"].set_property("cmake_target_name", "DevIL::IL")
+        il_requires = []
+        if self.options.with_png:
+            il_requires.append("libpng::libpng")
+        if self.options.with_jpeg:
+            il_requires.append("libjpeg::libjpeg")
+        if self.options.with_tiff:
+            il_requires.append("libtiff::libtiff")
+        if self.options.with_jasper:
+            il_requires.append("jasper::jasper")
+        if self.options.with_squish:
+            il_requires.append("libsquish::libsquish")
+        if self.options.with_lcms:
+            il_requires.append("lcms::lcms")
+        self.cpp_info.components["IL"].requires = il_requires
+
+        self.cpp_info.components["ILU"].libs = ["ILU"]
+        self.cpp_info.components["ILU"].set_property("cmake_target_name", "DevIL::ILU")
+        if self.options.with_tiff:
+            self.cpp_info.components["ILU"].requires = [
+                "libtiff::libtiff"
+            ]
+        self.cpp_info.components["ILUT"].libs = ["ILUT"]
+        self.cpp_info.components["ILUT"].set_property("cmake_target_name", "DevIL::ILUT")
+
+        if not self.options.shared:
+            self.cpp_info.components["IL"].defines = ["IL_STATIC_LIB"]
+            self.cpp_info.components["ILU"].defines = ["IL_STATIC_LIB"]
+            self.cpp_info.components["ILUT"].defines = ["IL_STATIC_LIB"]
diff --git a/recipes/devil/all/patches/1.8.0-avoid-methoddef-dllimport-error.patch b/recipes/devil/all/patches/1.8.0-avoid-methoddef-dllimport-error.patch
new file mode 100644
index 0000000000000..0e6174af77c19
--- /dev/null
+++ b/recipes/devil/all/patches/1.8.0-avoid-methoddef-dllimport-error.patch
@@ -0,0 +1,82 @@
+--- a/DevIL/src-IL/src/il_jpeg.cpp
++++ b/DevIL/src-IL/src/il_jpeg.cpp
+@@ -219,7 +219,7 @@ typedef iread_mgr * iread_ptr;
+ #define INPUT_BUF_SIZE  4096  // choose an efficiently iread'able size
+ 
+ 
+-METHODDEF(void)
++static void
+ init_source (j_decompress_ptr cinfo)
+ {
+ 	iread_ptr src = (iread_ptr) cinfo->src;
+@@ -227,7 +227,7 @@ init_source (j_decompress_ptr cinfo)
+ }
+ 
+ 
+-METHODDEF(boolean)
++static boolean
+ fill_input_buffer (j_decompress_ptr cinfo)
+ {
+ 	iread_ptr src = (iread_ptr) cinfo->src;
+@@ -259,7 +259,7 @@ fill_input_buffer (j_decompress_ptr cinfo)
+ }
+ 
+ 
+-METHODDEF(void)
++static void
+ skip_input_data (j_decompress_ptr cinfo, long num_bytes)
+ {
+ 	iread_ptr src = (iread_ptr) cinfo->src;
+@@ -275,14 +275,14 @@ skip_input_data (j_decompress_ptr cinfo, long num_bytes)
+ }
+ 
+ 
+-METHODDEF(void)
++static void
+ term_source (j_decompress_ptr cinfo)
+ {
+ 	// no work necessary here
+ }
+ 
+ 
+-GLOBAL(void)
++void
+ devil_jpeg_read_init (j_decompress_ptr cinfo)
+ {
+ 	iread_ptr src;
+@@ -371,7 +371,7 @@ typedef iwrite_mgr *iwrite_ptr;
+ #define OUTPUT_BUF_SIZE 4096
+ 
+ 
+-METHODDEF(void)
++static void
+ init_destination(j_compress_ptr cinfo)
+ {
+ 	iwrite_ptr dest = (iwrite_ptr)cinfo->dest;
+@@ -384,7 +384,7 @@ init_destination(j_compress_ptr cinfo)
+ 	return;
+ }
+ 
+-METHODDEF(boolean)
++static boolean
+ empty_output_buffer (j_compress_ptr cinfo)
+ {
+ 	iwrite_ptr dest = (iwrite_ptr)cinfo->dest;
+@@ -394,7 +394,7 @@ empty_output_buffer (j_compress_ptr cinfo)
+ 	return static_cast< boolean >( IL_TRUE );
+ }
+ 
+-METHODDEF(void)
++static void
+ term_destination (j_compress_ptr cinfo)
+ {
+ 	iwrite_ptr dest = (iwrite_ptr)cinfo->dest;
+@@ -403,7 +403,7 @@ term_destination (j_compress_ptr cinfo)
+ }
+ 
+ 
+-GLOBAL(void)
++void
+ devil_jpeg_write_init(j_compress_ptr cinfo)
+ {
+ 	iwrite_ptr dest;
diff --git a/recipes/devil/all/patches/1.8.0-install-ilut-config-h.patch b/recipes/devil/all/patches/1.8.0-install-ilut-config-h.patch
new file mode 100644
index 0000000000000..9e714b4088a27
--- /dev/null
+++ b/recipes/devil/all/patches/1.8.0-install-ilut-config-h.patch
@@ -0,0 +1,11 @@
+--- a/DevIL/src-ILUT/CMakeLists.txt
++++ b/DevIL/src-ILUT/CMakeLists.txt
+@@ -76,7 +76,7 @@ install (TARGETS ILUT
+     LIBRARY DESTINATION lib
+     RUNTIME DESTINATION bin
+ )
+-install (FILES ../include/IL/ilut.h DESTINATION include/IL)
++install (FILES ../include/IL/ilut.h ../include/IL/ilut_config.h DESTINATION include/IL)
+ 
+ install(FILES
+     ${CMAKE_CURRENT_BINARY_DIR}/ILUT.pc
diff --git a/recipes/devil/all/patches/1.8.0-jp2_fix.patch b/recipes/devil/all/patches/1.8.0-jp2_fix.patch
new file mode 100644
index 0000000000000..5fecfe09c7eee
--- /dev/null
+++ b/recipes/devil/all/patches/1.8.0-jp2_fix.patch
@@ -0,0 +1,18 @@
+--- a/DevIL/src-IL/src/il_jp2.cpp
++++ b/DevIL/src-IL/src/il_jp2.cpp
+@@ -314,13 +314,13 @@ ILboolean iLoadJp2Internal(jas_stream_t	*Stream, ILimage *Image)
+ 
+ 
+ 
+-static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, int cnt)
++static ssize_t iJp2_file_read(jas_stream_obj_t *obj, char *buf, size_t cnt)
+ {
+ 	obj;
+ 	return iread(buf, 1, cnt);
+ }
+ 
+-static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, int cnt)
++static ssize_t iJp2_file_write(jas_stream_obj_t *obj, const char *buf, size_t cnt)
+ {
+ 	obj;
+ 	return iwrite(buf, 1, cnt);
diff --git a/recipes/devil/all/patches/1.8.0-jpeg_fix.patch b/recipes/devil/all/patches/1.8.0-jpeg_fix.patch
new file mode 100644
index 0000000000000..d70cc922bd579
--- /dev/null
+++ b/recipes/devil/all/patches/1.8.0-jpeg_fix.patch
@@ -0,0 +1,73 @@
+--- a/DevIL/src-IL/src/il_jpeg.cpp
++++ b/DevIL/src-IL/src/il_jpeg.cpp
+@@ -245,7 +245,7 @@ fill_input_buffer (j_decompress_ptr cinfo)
+ 		src->buffer[0] = (JOCTET) 0xFF;
+ 		src->buffer[1] = (JOCTET) JPEG_EOI;
+ 		nbytes = 2;
+-		return IL_FALSE;
++		return static_cast< boolean >( IL_FALSE );
+ 	}
+ 	if (nbytes < INPUT_BUF_SIZE) {
+ 		ilGetError();  // Gets rid of the IL_FILE_READ_ERROR.
+@@ -253,9 +253,9 @@ fill_input_buffer (j_decompress_ptr cinfo)
+ 
+ 	src->pub.next_input_byte = src->buffer;
+ 	src->pub.bytes_in_buffer = nbytes;
+-	src->start_of_file = IL_FALSE;
++	src->start_of_file = static_cast< boolean >( IL_FALSE );
+ 
+-	return IL_TRUE;
++	return static_cast< boolean >( IL_TRUE );
+ }
+ 
+ 
+@@ -334,13 +334,13 @@ ILboolean iLoadJpegInternal()
+ 
+ 	if ((result = setjmp(JpegJumpBuffer) == 0) != IL_FALSE) {
+ 		jpeg_create_decompress(&JpegInfo);
+-		JpegInfo.do_block_smoothing = IL_TRUE;
+-		JpegInfo.do_fancy_upsampling = IL_TRUE;
++		JpegInfo.do_block_smoothing = static_cast< boolean >( IL_TRUE );
++		JpegInfo.do_fancy_upsampling = static_cast< boolean >( IL_TRUE );
+ 
+ 		//jpeg_stdio_src(&JpegInfo, iGetFile());
+ 
+ 		devil_jpeg_read_init(&JpegInfo);
+-		jpeg_read_header(&JpegInfo, IL_TRUE);
++		jpeg_read_header(&JpegInfo, static_cast< boolean >( IL_TRUE ));
+ 
+ 		result = ilLoadFromJpegStruct(&JpegInfo);
+ 
+@@ -391,7 +391,7 @@ empty_output_buffer (j_compress_ptr cinfo)
+ 	iwrite(dest->buffer, 1, OUTPUT_BUF_SIZE);
+ 	dest->pub.next_output_byte = dest->buffer;
+ 	dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
+-	return IL_TRUE;
++	return static_cast< boolean >( IL_TRUE );
+ }
+ 
+ METHODDEF(void)
+@@ -554,12 +554,12 @@ ILboolean iSaveJpegInternal()
+ //#endif//IL_USE_JPEGLIB_UNMODIFIED
+ 
+ 	// Set the quality output
+-	jpeg_set_quality(&JpegInfo, iGetInt(IL_JPG_QUALITY), IL_TRUE);
++	jpeg_set_quality(&JpegInfo, iGetInt(IL_JPG_QUALITY), static_cast(IL_TRUE));
+ 	// Sets progressive saving here
+ 	if (ilGetBoolean(IL_JPG_PROGRESSIVE))
+ 		jpeg_simple_progression(&JpegInfo);
+ 
+-	jpeg_start_compress(&JpegInfo, IL_TRUE);
++	jpeg_start_compress(&JpegInfo, static_cast(IL_TRUE));
+ 
+ 	//row_stride = image_width * 3;	// JSAMPLEs per row in image_buffer
+ 
+@@ -970,7 +970,7 @@ ILboolean ilSaveFromJpegStruct(void *_JpegInfo)
+ 	JpegInfo->image_height = TempImage->Height;
+ 	JpegInfo->input_components = TempImage->Bpp;  // # of color components per pixel
+ 
+-	jpeg_start_compress(JpegInfo, IL_TRUE);
++	jpeg_start_compress(JpegInfo, static_cast(IL_TRUE));
+ 
+ 	//row_stride = image_width * 3;	// JSAMPLEs per row in image_buffer
+ 
diff --git a/recipes/devil/all/patches/1.8.0-remove_register_keyword.patch b/recipes/devil/all/patches/1.8.0-remove_register_keyword.patch
new file mode 100644
index 0000000000000..861cfa9c82256
--- /dev/null
+++ b/recipes/devil/all/patches/1.8.0-remove_register_keyword.patch
@@ -0,0 +1,15 @@
+--- a/DevIL/src-IL/src/il_manip.cpp
++++ b/DevIL/src-IL/src/il_manip.cpp
+@@ -37,9 +37,9 @@ ILushort ILAPIENTRY ilFloatToHalf(ILuint i) {
+ 	// of float and half (127 versus 15).
+ 	//
+ 
+-	register int s =  (i >> 16) & 0x00008000;
+-	register int e = ((i >> 23) & 0x000000ff) - (127 - 15);
+-	register int m =   i        & 0x007fffff;
++	int s =  (i >> 16) & 0x00008000;
++	int e = ((i >> 23) & 0x000000ff) - (127 - 15);
++	int m =   i        & 0x007fffff;
+ 
+ 	//
+ 	// Now reassemble s, e and m into a half:
diff --git a/recipes/devil/all/test_package/CMakeLists.txt b/recipes/devil/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..d17240799670c
--- /dev/null
+++ b/recipes/devil/all/test_package/CMakeLists.txt
@@ -0,0 +1,9 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(test_devil LANGUAGES CXX)
+
+find_package(DevIL 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 DevIL::IL DevIL::ILU DevIL::ILUT DevIL::DevIL)
diff --git a/recipes/devil/all/test_package/conanfile.py b/recipes/devil/all/test_package/conanfile.py
new file mode 100644
index 0000000000000..7b984260fd10f
--- /dev/null
+++ b/recipes/devil/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 TestDevilConan(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_devil")
+            self.run(bin_path, env="conanrun")
diff --git a/recipes/devil/all/test_package/test_package.cpp b/recipes/devil/all/test_package/test_package.cpp
new file mode 100644
index 0000000000000..995955b900e72
--- /dev/null
+++ b/recipes/devil/all/test_package/test_package.cpp
@@ -0,0 +1,14 @@
+#include 
+#include 
+#include 
+#include 
+
+
+int main() {
+    ilInit();
+    iluGetImageInfo(0);
+
+    ilShutDown();
+
+    return EXIT_SUCCESS;
+}
diff --git a/recipes/devil/config.yml b/recipes/devil/config.yml
new file mode 100644
index 0000000000000..4d72270a88048
--- /dev/null
+++ b/recipes/devil/config.yml
@@ -0,0 +1,3 @@
+versions:
+  "1.8.0":
+    folder: all
diff --git a/recipes/dfp/all/conandata.yml b/recipes/dfp/all/conandata.yml
index ef5dd3970cc87..753d76e24d813 100644
--- a/recipes/dfp/all/conandata.yml
+++ b/recipes/dfp/all/conandata.yml
@@ -1,4 +1,7 @@
 sources:
+  "1.0.3":
+    url: "https://github.com/epam/DFP/releases/download/1.0.3/native-sources.tar.gz"
+    sha256: "362e324687d6b8ca42490811331052c46cccb64a2cf078f3b6c8df92a374497c"
   "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/config.yml b/recipes/dfp/config.yml
index 8457ca9a4a8cd..f625d5d2b747f 100644
--- a/recipes/dfp/config.yml
+++ b/recipes/dfp/config.yml
@@ -1,3 +1,5 @@
 versions:
+  "1.0.3":
+    folder: all
   "1.0.2":
     folder: all
diff --git a/recipes/di/all/test_v1_package/CMakeLists.txt b/recipes/di/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/di/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index da134b42a75e3..0000000000000
--- a/recipes/di/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,16 +0,0 @@
-from conans import ConanFile, CMake, tools
-import os
-
-
-class DiConan(ConanFile):
-    settings = "os", "compiler", "build_type", "arch"
-    generators = "cmake", "cmake_find_package_multi"
-
-    def build(self):
-        cmake = CMake(self)
-        cmake.configure()
-        cmake.build()
-
-    def test(self):
-        if not tools.cross_building(self.settings):
-            self.run(os.path.join("bin", "example"), run_environment=True)
diff --git a/recipes/dice-template-library/all/conandata.yml b/recipes/dice-template-library/all/conandata.yml
index 3dcfa182d3a53..580b85f394958 100644
--- a/recipes/dice-template-library/all/conandata.yml
+++ b/recipes/dice-template-library/all/conandata.yml
@@ -1,4 +1,22 @@
 sources:
+  "1.9.0":
+    url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.9.0.tar.gz"
+    sha256: "ca82a61bd445e0eaf69e68fc4a96d037c8b2ea36ff7762042dbb6f47a89f99e9"
+  "1.8.0":
+    url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.8.0.tar.gz"
+    sha256: "cb20717cb596b156b098146d043caa158618e055b8edbeb4d3245cd11e1c8276"
+  "1.6.0":
+    url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.6.0.tar.gz"
+    sha256: "4eb176930beb05dba183d4a48fd9e9716676fe92f0a98a8f527cb8791b0d64fd"
+  "1.5.0":
+    url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.5.0.tar.gz"
+    sha256: "5ab4155097af5674dc9b34d1643db9ea8b30f78d15c1e547c58396ea31068ffd"
+  "1.3.0":
+    url: "https://github.com/dice-group/dice-template-library/archive/refs/tags/v1.3.0.tar.gz"
+    sha256: "2e61e95eeedf31f7041a6694c0789c5d1a5e3f9e4db87546cb83c9189808d4f5"
+  "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"
diff --git a/recipes/dice-template-library/all/conanfile.py b/recipes/dice-template-library/all/conanfile.py
index 9b90b9971293f..c799a85eb10c5 100644
--- a/recipes/dice-template-library/all/conanfile.py
+++ b/recipes/dice-template-library/all/conanfile.py
@@ -33,6 +33,7 @@ def _compilers_minimum_version(self):
         return {
             "gcc": "10.2",
             "clang": "12",
+            "apple-clang": "14",
         }
 
     def layout(self):
@@ -42,8 +43,6 @@ def package_id(self):
         self.info.clear()
 
     def validate(self):
-        if self.settings.compiler == "apple-clang":
-            raise ConanInvalidConfiguration("apple-clang is not supported because a full concept implementation is needed")
         if is_msvc(self):
             raise ConanInvalidConfiguration("MSVC is not supported because a full concept implementation is needed")
 
diff --git a/recipes/dice-template-library/all/test_v1_package/CMakeLists.txt b/recipes/dice-template-library/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/dice-template-library/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index fd66d89b7cd91..0000000000000
--- a/recipes/dice-template-library/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", "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 f1e3df07fed83..37901e90b8f3b 100644
--- a/recipes/dice-template-library/config.yml
+++ b/recipes/dice-template-library/config.yml
@@ -1,4 +1,16 @@
 versions:
+  "1.9.0":
+    folder: all
+  "1.8.0":
+    folder: all
+  "1.6.0":
+    folder: all
+  "1.5.0":
+    folder: all
+  "1.3.0":
+    folder: all
+  "1.2.0":
+    folder: all
   "1.1.0":
     folder: all
   "1.0.0":
diff --git a/recipes/diligent-core/all/CMakeLists.txt b/recipes/diligent-core/all/CMakeLists.txt
deleted file mode 100644
index a00123a14d403..0000000000000
--- a/recipes/diligent-core/all/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-cmake_minimum_required(VERSION 3.2)
-project(cmake_wrapper)
-
-find_package(SPIRV-Tools REQUIRED CONFIG)
-find_package(spirv-cross REQUIRED CONFIG)
-find_package(glslang REQUIRED CONFIG)
-find_package(volk REQUIRED CONFIG)
-find_package(xxHash REQUIRED CONFIG)
-
-add_library(glslang INTERFACE)
-target_link_libraries(glslang INTERFACE glslang::glslang)
-target_include_directories(glslang INTERFACE ${glslang_INCLUDE_DIR}/glslang)
-
-add_library(SPIRV ALIAS glslang::SPIRV)
-add_library(SPIRV-Headers ALIAS SPIRV-Headers::SPIRV-Headers)
-
-add_library(SPIRV-Tools-opt    ALIAS spirv-tools::spirv-tools)
-add_library(spirv-tools-core   ALIAS spirv-tools::spirv-tools)
-add_library(SPIRV-Tools-static ALIAS spirv-tools::spirv-tools)
-
-add_subdirectory(source_subfolder)
-
diff --git a/recipes/diligent-core/all/conan_deps.cmake b/recipes/diligent-core/all/conan_deps.cmake
new file mode 100644
index 0000000000000..22d5c713e1417
--- /dev/null
+++ b/recipes/diligent-core/all/conan_deps.cmake
@@ -0,0 +1,15 @@
+find_package(SPIRV-Tools REQUIRED CONFIG)
+find_package(spirv-cross REQUIRED CONFIG)
+find_package(volk REQUIRED CONFIG)
+find_package(xxHash REQUIRED CONFIG)
+
+if (NOT ${DILIGENT_NO_GLSLANG})
+    find_package(glslang REQUIRED CONFIG)
+    add_library(glslang INTERFACE)
+    target_link_libraries(glslang INTERFACE glslang::glslang)
+    target_include_directories(glslang INTERFACE ${glslang_INCLUDE_DIR}/glslang)
+    add_library(SPIRV ALIAS glslang::SPIRV)
+endif()
+
+add_library(SPIRV-Headers ALIAS SPIRV-Headers::SPIRV-Headers)
+add_library(spirv-tools-core   ALIAS spirv-tools::spirv-tools)
diff --git a/recipes/diligent-core/all/conandata.yml b/recipes/diligent-core/all/conandata.yml
index a48d5fbd77dc8..1b7fc1ffdeef6 100644
--- a/recipes/diligent-core/all/conandata.yml
+++ b/recipes/diligent-core/all/conandata.yml
@@ -23,37 +23,21 @@ sources:
 patches:
   "api.252003":
     - patch_file: "patches/0023-252003-fix-warning-as-error.patch"
-      base_path: "source_subfolder"
   "2.5.2":
     - patch_file: "patches/0014-252-exclude-tests.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0015-252-dont-install-3d-party-license.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0016-252-fix-glslang-usage.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0017-252-fix-glslang-include.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0018-252-fix-warning-as-error.patch"
-      base_path: "source_subfolder"
   "2.5.1":
     - patch_file: "patches/0001-remove_warning_as_error.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0002-use_conan_dependencies.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0003-use_volk_from_conan.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0005-spirv-cross-namespace-override.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0006-install-linux-platform-header.diff"
-      base_path: "source_subfolder"
   "api.250014":
     - patch_file: "patches/0007-API250014-remove_warning_as_error.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0009-API250014-use_conan_dependencies_in_third_party.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0010-API250014-use_volk_from_conan.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0013-API250014-use-vulkan-headers-in-archiver.patch"
-      base_path: "source_subfolder"
     - patch_file: "patches/0005-spirv-cross-namespace-override.patch"
-      base_path: "source_subfolder"
diff --git a/recipes/diligent-core/all/conanfile.py b/recipes/diligent-core/all/conanfile.py
index a02de86844027..5b7a0c26b76e5 100644
--- a/recipes/diligent-core/all/conanfile.py
+++ b/recipes/diligent-core/all/conanfile.py
@@ -3,7 +3,8 @@
 from conan.errors import ConanInvalidConfiguration
 from conan.tools.build import cross_building, check_min_cppstd
 from conan.tools.scm import Version
-from conan.tools.files import rm, get, rmdir, rename, collect_libs, patches, export_conandata_patches, copy, apply_conandata_patches
+from conan.tools.files import rm, get, rmdir, rename, collect_libs, export_conandata_patches, copy, apply_conandata_patches, replace_in_file
+from conan.tools.microsoft import visual
 from conan.tools.apple import is_apple_os
 import os
 
@@ -34,6 +35,7 @@ class DiligentCoreConan(ConanFile):
     def _minimum_compilers_version(self):
         return {
             "Visual Studio": "16",
+            "msvc": "192",
             "gcc": "6",
             "clang": "3.4",
             "apple-clang": "5.1",
@@ -48,29 +50,28 @@ def validate(self):
             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.output.warning("{} recipe lacks information about the {} compiler support.".format(
                 self.name, self.settings.compiler))
         else:
             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))
-        if self.settings.compiler == "Visual Studio" and "MT" in self.settings.compiler.runtime:
+        if visual.is_msvc_static_runtime(self):
             raise ConanInvalidConfiguration("Visual Studio build with MT runtime is not supported")
 
     def export_sources(self):
-        copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder, keep_path=False)
+        copy(self, "conan_deps.cmake", src=self.recipe_folder, dst=os.path.join(self.export_sources_folder, "src"), keep_path=False)
         export_conandata_patches(self)
         
     def source(self):
-        get(self, **self.conan_data["sources"][self.version],
-            destination=os.path.join(self.source_folder, "source_subfolder"), strip_root=True)
+        get(self, **self.conan_data["sources"][self.version], strip_root=True)
 
     def package_id(self):
-        if self.settings.compiler == "Visual Studio":
-            if "MD" in self.settings.compiler.runtime:
-                self.info.settings.compiler.runtime = "MD/MDd"
-            else:
+        if visual.is_msvc(self.info):
+            if visual.is_msvc_static_runtime(self.info):
                 self.info.settings.compiler.runtime = "MT/MTd"
+            else:
+                self.info.settings.compiler.runtime = "MD/MDd"
 
     def generate(self):
         tc = CMakeToolchain(self)
@@ -79,8 +80,7 @@ def generate(self):
         tc.variables["DILIGENT_BUILD_TESTS"] = False
         tc.variables["DILIGENT_NO_DXC"] = True
         tc.variables["DILIGENT_NO_GLSLANG"] = not self.options.with_glslang
-        tc.variables["SPIRV_CROSS_NAMESPACE_OVERRIDE"] = self.options["spirv-cross"].namespace
-        tc.variables["BUILD_SHARED_LIBS"] = False
+        tc.variables["SPIRV_CROSS_NAMESPACE_OVERRIDE"] = self.dependencies["spirv-cross"].options.namespace
         tc.variables["DILIGENT_CLANG_COMPILE_OPTIONS"] = ""
         tc.variables["DILIGENT_MSVC_COMPILE_OPTIONS"] = ""
         tc.variables["ENABLE_RTTI"] = True
@@ -92,34 +92,37 @@ def generate(self):
         deps.generate()
 
     def layout(self):
-        cmake_layout(self)
+        cmake_layout(self, src_folder="src")
 
     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
+            self.options.rm_safe("fPIC")
 
     def _patch_sources(self):
-        patches.apply_conandata_patches(self)
+        apply_conandata_patches(self)
+        replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"),
+                        "project(DiligentCore)",
+                        "project(DiligentCore)\n\ninclude(conan_deps.cmake)")
 
     def build_requirements(self):
-        self.tool_requires("cmake/3.24.2")
+        self.tool_requires("cmake/[>=3.24 <4]")
 
     def requirements(self):
         self.requires("opengl/system")
         if self.settings.os == "Linux":
-            self.requires("wayland/1.21.0")
+            self.requires("wayland/1.22.0")
 
         self.requires("spirv-cross/1.3.224.0")
         self.requires("spirv-tools/1.3.224.0")
         if self.options.with_glslang:
             self.requires("glslang/1.3.224.0")
-        self.requires("vulkan-headers/1.3.224.1")
+        self.requires("vulkan-headers/1.3.224.0")
         self.requires("vulkan-validationlayers/1.3.224.1")
-        self.requires("volk/1.3.224.1")
+        self.requires("volk/1.3.224.0")
         self.requires("xxhash/0.8.1")
 
         if self.settings.os in ["Linux", "FreeBSD"]:
@@ -144,21 +147,25 @@ def _diligent_platform(self):
             return "PLATFORM_TVOS"
 
     def build(self):
-        apply_conandata_patches(self)
+        self._patch_sources()
         cmake = CMake(self)
-        cmake.configure()
+        # By default, Diligent builds static and shared versions of every main library. We select the one we
+        # want based on options.shared in package(). To avoid building every intermediate library as SHARED,
+        # we have to disable BUILD_SHARED_LIBS.
+        # However, BUILD_SHARED_LIBS cannot be disabled normally (in the toolchain in configure()), because
+        # Conan outputs that override after the standard line that enables BUILD_SHARED_LIBS. Since the latter
+        # is a CACHE variable that cannot be overwritten with another set(), we have to specify it on the
+        # command-line, so it takes effect before the toolchain is parsed.
+        cmake.configure(variables={"BUILD_SHARED_LIBS": "OFF"})
         cmake.build()
 
     def package(self):
         cmake = CMake(self)
         cmake.install()
-        rename(self, src=os.path.join(self.package_folder, "include", "source_subfolder"),
-        dst=os.path.join(self.package_folder, "include", "DiligentCore"))
-
         rmdir(self, os.path.join(self.package_folder, "Licenses"))
         rmdir(self, os.path.join(self.package_folder, "lib"))
         rmdir(self, os.path.join(self.package_folder, "bin"))
-        copy(self, "License.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.package_folder, self.source_folder, "source_subfolder"))
+        copy(self, "License.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.package_folder, self.source_folder))
 
         if self.options.shared:
             copy(self, pattern="*.dylib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False)
@@ -184,37 +191,37 @@ def package_info(self):
         self.cpp_info.libs = collect_libs(self)
         # included as discussed here https://github.com/conan-io/conan-center-index/pull/10732#issuecomment-1123596308
         self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include"))
-        self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "DiligentCore", "Common"))
-
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore"))
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Common", "interface"))
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "interface"))
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngine", "interface"))
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngineVulkan", "interface"))
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngineOpenGL", "interface"))
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsAccessories", "interface"))
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsTools", "interface"))
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "HLSL2GLSLConverterLib", "interface"))
-        archiver_path = os.path.join("include", "DiligentCore", "Graphics", "Archiver", "interface")
+        self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "Common"))
+
+        self.cpp_info.includedirs.append(os.path.join("include"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Common", "interface"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "interface"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngine", "interface"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngineVulkan", "interface"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngineOpenGL", "interface"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsAccessories", "interface"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsTools", "interface"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "HLSL2GLSLConverterLib", "interface"))
+        archiver_path = os.path.join("include", "Graphics", "Archiver", "interface")
         if os.path.isdir(archiver_path):
             self.cpp_info.includedirs.append(archiver_path)
 
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Primitives", "interface"))
-        self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Basic", "interface"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Primitives", "interface"))
+        self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Basic", "interface"))
         if self.settings.os == "Android":
-            self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Android", "interface"))
+            self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Android", "interface"))
         elif is_apple_os(self):
-            self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Apple", "interface"))
+            self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Apple", "interface"))
         elif self.settings.os == "Emscripten":
-            self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Emscripten", "interface"))
+            self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Emscripten", "interface"))
         elif self.settings.os == "Linux":
-            self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Linux", "interface"))
+            self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Linux", "interface"))
         elif self.settings.os == "Windows":
-            self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Platforms", "Win32", "interface"))
-            self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngineD3D11", "interface"))
-            self.cpp_info.includedirs.append(os.path.join("include", "DiligentCore", "Graphics", "GraphicsEngineD3D12", "interface"))
+            self.cpp_info.includedirs.append(os.path.join("include", "Platforms", "Win32", "interface"))
+            self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngineD3D11", "interface"))
+            self.cpp_info.includedirs.append(os.path.join("include", "Graphics", "GraphicsEngineD3D12", "interface"))
 
-        self.cpp_info.defines.append("SPIRV_CROSS_NAMESPACE_OVERRIDE={}".format(self.options["spirv-cross"].namespace))
+        self.cpp_info.defines.append("SPIRV_CROSS_NAMESPACE_OVERRIDE={}".format(self.dependencies["spirv-cross"].options.namespace))
         self.cpp_info.defines.append("{}=1".format(self._diligent_platform()))
 
         if self.settings.os in ["Macos", "Linux"]:
diff --git a/recipes/diligent-core/all/test_package/CMakeLists.txt b/recipes/diligent-core/all/test_package/CMakeLists.txt
index 927e85d16c3ed..1960d37cb752f 100644
--- a/recipes/diligent-core/all/test_package/CMakeLists.txt
+++ b/recipes/diligent-core/all/test_package/CMakeLists.txt
@@ -1,24 +1,17 @@
 cmake_minimum_required(VERSION 3.1)
 project(test_package)
 
-include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
-conan_basic_setup()
+find_package(diligent-core REQUIRED CONFIG)
 
-if(WIN32)
-  set(FILE2STRING_PATH "${CONAN_BIN_DIRS_DILIGENT-CORE}/File2String.exe")
-else()
-  set(FILE2STRING_PATH "${CONAN_BIN_DIRS_DILIGENT-CORE}/File2String")
-endif()
-
-set(FILE "${CONAN_RES_DIRS_DILIGENT}/HLSLDefinitions.fxh")
+set(FILE "${core_INCLUDE_DIR}/../res/HLSLDefinitions.fxh")
 set(CONVERTED_FILE "${PROJECT_BINARY_DIR}/HLSLDefinitions.h")
 
 add_custom_command(OUTPUT ${CONVERTED_FILE}
-                   COMMAND ${FILE2STRING_PATH} ${FILE} ${CONVERTED_FILE}
+                   COMMAND File2String ${FILE} ${CONVERTED_FILE}
                    MAIN_DEPENDENCY ${FILE} # the primary input source file to the command
                    COMMENT "Processing shader ${FILE}"
                    VERBATIM)
 
 add_executable(${PROJECT_NAME} test_package.cpp)
-target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
+target_link_libraries(${PROJECT_NAME} diligent-core::diligent-core)
 set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
diff --git a/recipes/diligent-core/all/test_package/conanfile.py b/recipes/diligent-core/all/test_package/conanfile.py
index f2355b8294daf..fc51d8e4aee2d 100644
--- a/recipes/diligent-core/all/test_package/conanfile.py
+++ b/recipes/diligent-core/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
-from conan.tools.build import cross_building
 
 class TestPackageConan(ConanFile):
     settings = "os", "compiler", "build_type", "arch"
-    generators = "cmake"
+    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)
@@ -12,6 +19,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/diligent-fx/all/CMakeLists.txt b/recipes/diligent-fx/all/CMakeLists.txt
index f624602d00651..4bb35d8a74cdd 100644
--- a/recipes/diligent-fx/all/CMakeLists.txt
+++ b/recipes/diligent-fx/all/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.15)
 project(cmake_wrapper)
 
 include(conanbuildinfo.cmake)
diff --git a/recipes/diligent-fx/all/test_package/CMakeLists.txt b/recipes/diligent-fx/all/test_package/CMakeLists.txt
index 0d1ec0133b8f6..558d9414ecd07 100644
--- a/recipes/diligent-fx/all/test_package/CMakeLists.txt
+++ b/recipes/diligent-fx/all/test_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/diligent-tools/all/CMakeLists.txt b/recipes/diligent-tools/all/CMakeLists.txt
index 67d43c91fddd2..382ea6caf260e 100644
--- a/recipes/diligent-tools/all/CMakeLists.txt
+++ b/recipes/diligent-tools/all/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.15)
 project(cmake_wrapper)
 
 include(BuildUtils.cmake)
diff --git a/recipes/diligent-tools/all/test_package/CMakeLists.txt b/recipes/diligent-tools/all/test_package/CMakeLists.txt
index 86493ca2e0e0f..ccda42d05fc4d 100644
--- a/recipes/diligent-tools/all/test_package/CMakeLists.txt
+++ b/recipes/diligent-tools/all/test_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/diligentgraphics-spirv-headers/all/test_package/CMakeLists.txt b/recipes/diligentgraphics-spirv-headers/all/test_package/CMakeLists.txt
index 1a13bcce874fc..e444b945e71e9 100644
--- a/recipes/diligentgraphics-spirv-headers/all/test_package/CMakeLists.txt
+++ b/recipes/diligentgraphics-spirv-headers/all/test_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/diligentgraphics-spirv-tools/all/test_package/CMakeLists.txt b/recipes/diligentgraphics-spirv-tools/all/test_package/CMakeLists.txt
index 17a8d915b246e..bdf72550e3053 100644
--- a/recipes/diligentgraphics-spirv-tools/all/test_package/CMakeLists.txt
+++ b/recipes/diligentgraphics-spirv-tools/all/test_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/diligentgraphics-vulkan-headers/all/test_package/CMakeLists.txt b/recipes/diligentgraphics-vulkan-headers/all/test_package/CMakeLists.txt
index 5e69638f3fc18..f20545ba29445 100644
--- a/recipes/diligentgraphics-vulkan-headers/all/test_package/CMakeLists.txt
+++ b/recipes/diligentgraphics-vulkan-headers/all/test_package/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.15)
 project(test_package C)
 
 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
diff --git a/recipes/dime/all/test_v1_package/CMakeLists.txt b/recipes/dime/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/dime/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index c1e0ae2f456f0..0000000000000
--- a/recipes/dime/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,17 +0,0 @@
-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/test_v1_package/CMakeLists.txt b/recipes/directshowbaseclasses/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/directshowbaseclasses/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index a9a22676d134f..0000000000000
--- a/recipes/directshowbaseclasses/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,16 +0,0 @@
-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
index 6289c24e10856..ad2d7265cac43 100644
--- a/recipes/directx-headers/all/conandata.yml
+++ b/recipes/directx-headers/all/conandata.yml
@@ -1,4 +1,7 @@
 sources:
+  "1.614.0":
+    url: "https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v1.614.0.tar.gz"
+    sha256: "1cd54449799501a4ad129a4c7ccf0c026bbb699f937ba299d92de3aacd29c5be"
   "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/config.yml b/recipes/directx-headers/config.yml
index 15678ab870488..5129440c45004 100644
--- a/recipes/directx-headers/config.yml
+++ b/recipes/directx-headers/config.yml
@@ -1,3 +1,5 @@
 versions:
+  "1.614.0":
+    folder: all
   "1.610.2":
     folder: all
diff --git a/recipes/dirent/all/test_package/CMakeLists.txt b/recipes/dirent/all/test_package/CMakeLists.txt
index 682b23e6c7c90..aaf25d1bbe576 100644
--- a/recipes/dirent/all/test_package/CMakeLists.txt
+++ b/recipes/dirent/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(dirent REQUIRED CONFIG)
diff --git a/recipes/dirent/all/test_v1_package/CMakeLists.txt b/recipes/dirent/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index be00a8c7f57c7..0000000000000
--- a/recipes/dirent/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/dirent/all/test_v1_package/conanfile.py b/recipes/dirent/all/test_v1_package/conanfile.py
deleted file mode 100644
index 5a05af3c2dfd2..0000000000000
--- a/recipes/dirent/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,18 +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/discount/all/conanfile.py b/recipes/discount/all/conanfile.py
index c7bfdf5809fd4..98ef48d244829 100644
--- a/recipes/discount/all/conanfile.py
+++ b/recipes/discount/all/conanfile.py
@@ -1,11 +1,12 @@
 from conan import ConanFile
-from conan.errors import ConanInvalidConfiguration
+from conan.errors import ConanInvalidConfiguration, ConanException
 from conan.tools.build import cross_building
 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"
+required_conan_version = ">=2.1"
 
 
 class DiscountConan(ConanFile):
@@ -59,6 +60,9 @@ def generate(self):
         tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True
         # Relocatable shared lib on Macos
         tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW"
+        tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support
+        if Version(self.version) > "2.2.7": # pylint: disable=conan-unreachable-upper-version
+            raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4")
         tc.generate()
 
     def build(self):
@@ -79,11 +83,4 @@ def package_info(self):
         self.cpp_info.set_property("pkg_config_name", "libmarkdown")
         # TODO: back to global scope in conan v2 once cmake_find_package_* & pkg_config generators removed
         self.cpp_info.components["_discount"].libs = ["markdown"]
-
-        # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed
-        self.cpp_info.names["cmake_find_package"] = "discount"
-        self.cpp_info.names["cmake_find_package_multi"] = "discount"
-        self.cpp_info.names["pkg_config"] = "libmarkdown"
-        self.cpp_info.components["_discount"].names["cmake_find_package"] = "libmarkdown"
-        self.cpp_info.components["_discount"].names["cmake_find_package_multi"] = "libmarkdown"
         self.cpp_info.components["_discount"].set_property("pkg_config_name", "libmarkdown")
diff --git a/recipes/discount/all/test_package/CMakeLists.txt b/recipes/discount/all/test_package/CMakeLists.txt
index a38ae26b913bf..b50b050572d7f 100644
--- a/recipes/discount/all/test_package/CMakeLists.txt
+++ b/recipes/discount/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(discount REQUIRED CONFIG)
diff --git a/recipes/discount/all/test_v1_package/CMakeLists.txt b/recipes/discount/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 0d20897301b68..0000000000000
--- a/recipes/discount/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/discount/all/test_v1_package/conanfile.py b/recipes/discount/all/test_v1_package/conanfile.py
deleted file mode 100644
index 38f4483872d47..0000000000000
--- a/recipes/discount/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_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/dispenso/all/conandata.yml b/recipes/dispenso/all/conandata.yml
new file mode 100644
index 0000000000000..b025fdf2f9ff6
--- /dev/null
+++ b/recipes/dispenso/all/conandata.yml
@@ -0,0 +1,9 @@
+sources:
+  "1.3.0":
+    url: "https://github.com/facebookincubator/dispenso/archive/refs/tags/v1.3.0.tar.gz"
+    sha256: "824afe8d0d36bfd9bc9b1cbe9be89e7f3ed642a3612766d1c99d5f8dfc647c63"
+patches:
+  "1.3.0":
+    - patch_file: "patches/1.3.0-001-unvendorize-concurrentqueue.patch"
+      patch_type: "conan"
+      patch_description: "Unvendorize concurrentqueue dependency"
diff --git a/recipes/dispenso/all/conanfile.py b/recipes/dispenso/all/conanfile.py
new file mode 100644
index 0000000000000..3c8d02f91bd44
--- /dev/null
+++ b/recipes/dispenso/all/conanfile.py
@@ -0,0 +1,118 @@
+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, export_conandata_patches, apply_conandata_patches, rm, rmdir
+from conan.tools.scm import Version
+import os
+
+
+required_conan_version = ">=1.53.0"
+
+
+class DispensoPackage(ConanFile):
+    name = "dispenso"
+    description = "Dispenso is a library for working with sets of tasks in parallel"
+    license = "MIT"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://github.com/facebookincubator/dispenso"
+    topics = ("tasks", "parallel", "threads")
+    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 {
+            "apple-clang": "10",
+            "clang": "7",
+            "gcc": "7",
+            "msvc": "191",
+            "Visual Studio": "15",
+        }
+
+    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 export_sources(self):
+        export_conandata_patches(self)
+
+    def layout(self):
+        cmake_layout(self, src_folder="src")
+
+    def requirements(self):
+        # Part of the public api in dispenso/thread_pool.h (and more), unvendorized
+        self.requires("concurrentqueue/1.0.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."
+            )
+
+    def source(self):
+        get(self, **self.conan_data["sources"][self.version], strip_root=True)
+
+    def generate(self):
+        tc = CMakeToolchain(self)
+        tc.variables["DISPENSO_SHARED_LIB"] = self.options.shared
+        if self.settings.os == "Windows":
+            tc.preprocessor_definitions["NOMINMAX"] = 1
+            tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = 1
+        if self.settings.get_safe("compiler.cppstd") is None:
+            # TODO: Remove once Conan 1 is deprecated, this is needed so apple-clang
+            # can compile, as it defaults to C++98
+            tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd
+        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", 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"))
+        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 = ["dispenso"]
+
+        self.cpp_info.set_property("cmake_file_name", "Dispenso")
+        self.cpp_info.set_property("cmake_target_name", "Dispenso::dispenso")
+
+        if self.settings.os in ["Linux", "FreeBSD"]:
+            self.cpp_info.system_libs.extend(["pthread", "m"])
+
+        if self.settings.os == "Windows":
+            self.cpp_info.system_libs.extend(["synchronization", "winmm"])
+            self.cpp_info.defines.append("NOMINMAX")
diff --git a/recipes/dispenso/all/patches/1.3.0-001-unvendorize-concurrentqueue.patch b/recipes/dispenso/all/patches/1.3.0-001-unvendorize-concurrentqueue.patch
new file mode 100644
index 0000000000000..59c0de38973fc
--- /dev/null
+++ b/recipes/dispenso/all/patches/1.3.0-001-unvendorize-concurrentqueue.patch
@@ -0,0 +1,36 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7af1b8a..05c86a6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -48,8 +48,6 @@ elseif (THREAD_SANITIZER)
+   add_link_options(-fsanitize=thread)
+ endif()
+ 
+-set(CMAKE_CXX_STANDARD 14 CACHE STRING "the C++ standard to use for this project")
+-
+ ###########################################################
+ # Targets
+ add_subdirectory(dispenso)
+diff --git a/dispenso/CMakeLists.txt b/dispenso/CMakeLists.txt
+index 24a8c48..9231949 100644
+--- a/dispenso/CMakeLists.txt
++++ b/dispenso/CMakeLists.txt
+@@ -33,16 +33,15 @@ endif()
+ target_include_directories(dispenso
+ PUBLIC
+   $
+-  $
+   $
+   $
+-  $
+ )
+ 
+ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+ set(THREADS_PREFER_PTHREAD_FLAG TRUE)
+ find_package(Threads REQUIRED)
+-target_link_libraries(dispenso PUBLIC Threads::Threads)
++find_package(concurrentqueue REQUIRED)
++target_link_libraries(dispenso PUBLIC Threads::Threads concurrentqueue::concurrentqueue)
+ 
+ check_cxx_source_compiles("
+ #include 
diff --git a/recipes/dispenso/all/test_package/CMakeLists.txt b/recipes/dispenso/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..37b4a548d33a9
--- /dev/null
+++ b/recipes/dispenso/all/test_package/CMakeLists.txt
@@ -0,0 +1,9 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(test_package LANGUAGES CXX)
+
+find_package(Dispenso REQUIRED CONFIG)
+
+add_executable(${PROJECT_NAME} test_package.cpp)
+target_link_libraries(${PROJECT_NAME} PRIVATE Dispenso::dispenso)
+target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
diff --git a/recipes/dispenso/all/test_package/conanfile.py b/recipes/dispenso/all/test_package/conanfile.py
new file mode 100644
index 0000000000000..ef5d7042163ec
--- /dev/null
+++ b/recipes/dispenso/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/dispenso/all/test_package/test_package.cpp b/recipes/dispenso/all/test_package/test_package.cpp
new file mode 100644
index 0000000000000..cd298492d0fe8
--- /dev/null
+++ b/recipes/dispenso/all/test_package/test_package.cpp
@@ -0,0 +1,9 @@
+#include 
+#include "dispenso/parallel_for.h"
+
+
+int main(void) {
+    dispenso::parallel_for(0, 5, [] (size_t j) {
+        std::cout << j << std::endl;
+   });
+}
diff --git a/recipes/dispenso/config.yml b/recipes/dispenso/config.yml
new file mode 100644
index 0000000000000..426a0e4c79e9b
--- /dev/null
+++ b/recipes/dispenso/config.yml
@@ -0,0 +1,3 @@
+versions:
+  "1.3.0":
+    folder: all
diff --git a/recipes/djinni-generator/all/test_v1_package/conanfile.py b/recipes/djinni-generator/all/test_v1_package/conanfile.py
deleted file mode 100644
index 456428a9a8670..0000000000000
--- a/recipes/djinni-generator/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,21 +0,0 @@
-
-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-support-lib/1.x.x/test_v1_package/CMakeLists.txt b/recipes/djinni-support-lib/1.x.x/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/djinni-support-lib/1.x.x/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index c534d392ac09f..0000000000000
--- a/recipes/djinni-support-lib/1.x.x/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,19 +0,0 @@
-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/test_v1_package/CMakeLists.txt b/recipes/djinni-support-lib/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 91630d79f4abb..0000000000000
--- a/recipes/djinni-support-lib/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-project(test_package)
-
-include(${CMAKE_BINARY_DIR}/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
deleted file mode 100644
index c534d392ac09f..0000000000000
--- a/recipes/djinni-support-lib/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,19 +0,0 @@
-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/djvulibre/all/conandata.yml b/recipes/djvulibre/all/conandata.yml
new file mode 100644
index 0000000000000..8f7d4ad051f7b
--- /dev/null
+++ b/recipes/djvulibre/all/conandata.yml
@@ -0,0 +1,9 @@
+sources:
+  "3.5.28":
+    url: "http://downloads.sourceforge.net/djvu/djvulibre-3.5.28.tar.gz"
+    sha256: "fcd009ea7654fde5a83600eb80757bd3a76998e47d13c66b54c8db849f8f2edc"
+patches:
+  "3.5.28":
+    - patch_file: "patches/remove-register-keyword.patch"
+      patch_type: "portability"
+      patch_description: "Remove deprecated 'register' keyword for C++17 compatibility"
diff --git a/recipes/djvulibre/all/conanfile.py b/recipes/djvulibre/all/conanfile.py
new file mode 100644
index 0000000000000..02736d758043d
--- /dev/null
+++ b/recipes/djvulibre/all/conanfile.py
@@ -0,0 +1,187 @@
+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, stdcpp_library
+from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv
+from conan.tools.files import copy, get, rm, rmdir, save, rename, export_conandata_patches, apply_conandata_patches
+from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps
+from conan.tools.layout import basic_layout
+from conan.tools.microsoft import is_msvc, unix_path, check_min_vs
+import os
+
+required_conan_version = ">=1.54.0"
+
+
+class DjVuLibreConan(ConanFile):
+    name = "djvulibre"
+    description = "Library and utilities to create, manipulate and view DjVu documents"
+    license = "GPL-2.0-or-later"
+    url = "https://github.com/conan-io/conan-center-index"
+    homepage = "https://djvu.sourceforge.net/"
+    topics = ("djvu", "file-format", "document-format")
+
+    package_type = "library"
+    settings = "os", "arch", "compiler", "build_type"
+    options = {
+        "shared": [True, False],
+        "fPIC": [True, False],
+        "tools": [True, False],
+        "with_libjpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg"],
+    }
+    default_options = {
+        "shared": False,
+        "fPIC": True,
+        "tools": False,
+        "with_libjpeg": "libjpeg",
+    }
+
+    @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:
+            self.options.rm_safe("fPIC")
+
+    def layout(self):
+        basic_layout(self, src_folder="src")
+
+    def requirements(self):
+        self.requires("libiconv/1.17")
+        if self.options.with_libjpeg == "libjpeg":
+            self.requires("libjpeg/9e")
+        elif self.options.with_libjpeg == "libjpeg-turbo":
+            self.requires("libjpeg-turbo/3.0.2")
+        elif self.options.with_libjpeg == "mozjpeg":
+            self.requires("mozjpeg/4.1.5")
+        self.requires("libtiff/4.6.0")
+
+    def validate(self):
+        if self.settings.os == "Windows" and not self.options.shared:
+            # __declspec(dllimport) or __declspec(dllexport) is always set for symbols
+            raise ConanInvalidConfiguration("Static linking is not supported on Windows")
+
+    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")
+        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):
+        VirtualBuildEnv(self).generate()
+        if not cross_building(self):
+            VirtualRunEnv(self).generate(scope="build")
+
+        tc = AutotoolsToolchain(self)
+        jpeg = self.dependencies[self.options.with_libjpeg.value].cpp_info.aggregated_components()
+        tiff = self.dependencies["libtiff"].cpp_info.aggregated_components()
+        tc.configure_args.extend([
+            f"JPEG_LIBS={' '.join(f'-l{l}' for l in jpeg.libs)}",
+            f"TIFF_LIBS={' '.join(f'-l{l}' for l in tiff.libs)}",
+        ])
+        if is_msvc(self):
+            tc.extra_cxxflags.append("-EHsc")
+            if check_min_vs(self, "180", raise_invalid=False):
+                tc.extra_cflags.append("-FS")
+                tc.extra_cxxflags.append("-FS")
+            tc.extra_ldflags.append("-ladvapi32")
+        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")
+            env.define("NM", "dumpbin -symbols")
+            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")
+        else:
+            deps = AutotoolsDeps(self)
+            deps.generate()
+
+    def _patch_sources(self):
+        apply_conandata_patches(self)
+        if not self.options.tools:
+            save(self, os.path.join(self.source_folder, "tools", "Makefile.am"), "")
+            save(self, os.path.join(self.source_folder, "xmltools", "Makefile.am"), "")
+
+    def build(self):
+        self._patch_sources()
+        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"))
+        rmdir(self, os.path.join(self.package_folder, "share", "man"))
+        rmdir(self, os.path.join(self.package_folder, "share", "icons"))
+        rename(self, os.path.join(self.package_folder, "share"), os.path.join(self.package_folder, "res"))
+        fix_apple_shared_install_name(self)
+        if is_msvc(self) and self.options.shared:
+            rename(self, os.path.join(self.package_folder, "lib", "djvulibre.dll.lib"),
+                         os.path.join(self.package_folder, "lib", "djvulibre.lib"))
+
+    def package_info(self):
+        self.cpp_info.set_property("pkg_config_name", "ddjvuapi")
+        self.cpp_info.libs = ["djvulibre"]
+        self.cpp_info.resdirs = ["res"]
+
+        if self.settings.os in ["Linux", "FreeBSD"]:
+            self.cpp_info.system_libs.extend(["m", "pthread"])
+        elif is_apple_os(self):
+            self.cpp_info.frameworks.extend(["CoreFoundation"])
+        elif self.settings.os == "Windows":
+            self.cpp_info.system_libs.append("advapi32")
+
+        # Implemented in C++ but exports a pure C API
+        if stdcpp_library(self):
+            self.cpp_info.system_libs.append(stdcpp_library(self))
diff --git a/recipes/djvulibre/all/patches/remove-register-keyword.patch b/recipes/djvulibre/all/patches/remove-register-keyword.patch
new file mode 100644
index 0000000000000..d6a6af75193b6
--- /dev/null
+++ b/recipes/djvulibre/all/patches/remove-register-keyword.patch
@@ -0,0 +1,34 @@
+--- libdjvu/GBitmap.h
++++ libdjvu/GBitmap.h
+@@ -620,7 +620,7 @@
+ inline int
+ GBitmap::read_run(unsigned char *&data)
+ {
+-  register int z=*data++;
++  int z=*data++;
+   return (z>=RUNOVERFLOWVALUE)?
+     ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z;
+ }
+@@ -628,7 +628,7 @@
+ inline int
+ GBitmap::read_run(const unsigned char *&data)
+ {
+-  register int z=*data++;
++  int z=*data++;
+   return (z>=RUNOVERFLOWVALUE)?
+     ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z;
+ }
+--- libdjvu/MMX.h
++++ libdjvu/MMX.h
+@@ -172,9 +172,9 @@
+ #define MMXir(op,imm,dst) \
+   __asm { op dst,imm }
+ #define MMXar(op,addr,dst) \
+-  { register __int64 var=*(__int64*)(addr); __asm { op dst,var } }
++  { __int64 var=*(__int64*)(addr); __asm { op dst,var } }
+ #define MMXra(op,src,addr) \
+-  { register __int64 var; __asm { op [var],src };  *(__int64*)addr = var; } 
++  { __int64 var; __asm { op [var],src };  *(__int64*)addr = var; } 
+ // Probably not as efficient as GCC macros
+ #define MMX 1
+ #endif
diff --git a/recipes/djvulibre/all/test_package/CMakeLists.txt b/recipes/djvulibre/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..78eb45bda8ee3
--- /dev/null
+++ b/recipes/djvulibre/all/test_package/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.15)
+project(test_package LANGUAGES C)
+
+find_package(djvulibre REQUIRED CONFIG)
+
+add_executable(${PROJECT_NAME} test_package.c)
+target_link_libraries(${PROJECT_NAME} PRIVATE djvulibre::djvulibre)
+target_compile_features(${PROJECT_NAME} PRIVATE c_std_99)
diff --git a/recipes/djvulibre/all/test_package/conanfile.py b/recipes/djvulibre/all/test_package/conanfile.py
new file mode 100644
index 0000000000000..3a91c9439218e
--- /dev/null
+++ b/recipes/djvulibre/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/djvulibre/all/test_package/test_package.c b/recipes/djvulibre/all/test_package/test_package.c
new file mode 100644
index 0000000000000..9c8f3383716ca
--- /dev/null
+++ b/recipes/djvulibre/all/test_package/test_package.c
@@ -0,0 +1,15 @@
+#include 
+#include 
+
+int main() {
+    ddjvu_context_t* context = ddjvu_context_create("test_package");
+    if (!context) {
+        printf("Failed to create djvu context\n");
+        return 1;
+    }
+    printf("DjVu context initialized successfully.\n");
+    int cache_size = ddjvu_cache_get_size(context);
+    printf("Cache size: %d\n", cache_size);
+    ddjvu_context_release(context);
+    return 0;
+}
diff --git a/recipes/djvulibre/config.yml b/recipes/djvulibre/config.yml
new file mode 100644
index 0000000000000..9cb2b472d3ed1
--- /dev/null
+++ b/recipes/djvulibre/config.yml
@@ -0,0 +1,3 @@
+versions:
+  "3.5.28":
+    folder: all
diff --git a/recipes/dlib/all/conanfile.py b/recipes/dlib/all/conanfile.py
index bad5b166dc9bf..869da077da94a 100644
--- a/recipes/dlib/all/conanfile.py
+++ b/recipes/dlib/all/conanfile.py
@@ -8,7 +8,7 @@
 import os
 
 
-required_conan_version = ">=1.53.0"
+required_conan_version = ">=2.1"
 
 
 class DlibConan(ConanFile):
@@ -92,13 +92,13 @@ def requirements(self):
         if self.options.with_jpeg:
             self.requires("libjpeg/9e")
         if self.options.with_png:
-            self.requires("libpng/1.6.40")
+            self.requires("libpng/[>=1.6 <2]")
         if self.options.get_safe("with_webp"):
             self.requires("libwebp/1.3.2")
         if self.options.with_sqlite3:
-            self.requires("sqlite3/3.44.2")
+            self.requires("sqlite3/3.45.0")
         if self.options.with_openblas:
-            self.requires("openblas/0.3.20")
+            self.requires("openblas/0.3.26")
 
     def validate(self):
         if self.settings.compiler.cppstd:
@@ -177,6 +177,8 @@ def generate(self):
                 tc.variables["USE_SSE4_INSTRUCTIONS"] = self.options.with_sse4
             if self.options.with_avx != "auto":
                 tc.variables["USE_AVX_INSTRUCTIONS"] = self.options.with_avx
+        if Version(self.version) < "19.24.2":
+            tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support
         tc.generate()
         tc = CMakeDeps(self)
         tc.generate()
diff --git a/recipes/dlpack/all/conandata.yml b/recipes/dlpack/all/conandata.yml
index 1ee4d67252887..f541482d88868 100644
--- a/recipes/dlpack/all/conandata.yml
+++ b/recipes/dlpack/all/conandata.yml
@@ -1,4 +1,7 @@
 sources:
+  "1.0":
+    url: "https://github.com/dmlc/dlpack/archive/v1.0.tar.gz"
+    sha256: "f8cfdcb634ff3cf0e3d9a3426e019e1c6469780a3b0020c9bc4ecc09cf9abcb1"
   "0.8":
     url: "https://github.com/dmlc/dlpack/archive/v0.8.tar.gz"
     sha256: "cf965c26a5430ba4cc53d61963f288edddcd77443aa4c85ce722aaf1e2f29513"
diff --git a/recipes/dlpack/all/test_package/CMakeLists.txt b/recipes/dlpack/all/test_package/CMakeLists.txt
index 45718466e5323..14c3536a1616e 100644
--- a/recipes/dlpack/all/test_package/CMakeLists.txt
+++ b/recipes/dlpack/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(dlpack REQUIRED CONFIG)
diff --git a/recipes/dlpack/all/test_package/test_package.cpp b/recipes/dlpack/all/test_package/test_package.cpp
index 6304024f2e652..9c286d918cb1b 100644
--- a/recipes/dlpack/all/test_package/test_package.cpp
+++ b/recipes/dlpack/all/test_package/test_package.cpp
@@ -4,7 +4,11 @@
 
 int main()
 {
-#if DLPACK_VERSION < 60
+#ifdef DLPACK_MAJOR_VERSION // Since 1.0
+    int major = DLPACK_MAJOR_VERSION;
+    int minor = DLPACK_MINOR_VERSION;
+    int patch = 0;
+#elif DLPACK_VERSION < 60
     int major = (DLPACK_VERSION >> 6) & 7;
     int minor = (DLPACK_VERSION >> 3) & 7;
     int patch = DLPACK_VERSION & 7;
diff --git a/recipes/dlpack/all/test_v1_package/CMakeLists.txt b/recipes/dlpack/all/test_v1_package/CMakeLists.txt
deleted file mode 100644
index 9d54a092e0a67..0000000000000
--- a/recipes/dlpack/all/test_v1_package/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-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/dlpack/all/test_v1_package/conanfile.py b/recipes/dlpack/all/test_v1_package/conanfile.py
deleted file mode 100644
index c492184eec19c..0000000000000
--- a/recipes/dlpack/all/test_v1_package/conanfile.py
+++ /dev/null
@@ -1,19 +0,0 @@
-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/dlpack/config.yml b/recipes/dlpack/config.yml
index a1b8905afe4b1..001dc29f3eaea 100644
--- a/recipes/dlpack/config.yml
+++ b/recipes/dlpack/config.yml
@@ -1,4 +1,6 @@
 versions:
+  "1.0":
+    folder: "all"
   "0.8":
     folder: "all"
   "0.6":
diff --git a/recipes/dnet/all/conandata.yml b/recipes/dnet/all/conandata.yml
new file mode 100644
index 0000000000000..f4b4a52916d3d
--- /dev/null
+++ b/recipes/dnet/all/conandata.yml
@@ -0,0 +1,7 @@
+sources:
+  "1.18.0":
+    url: "https://github.com/ofalk/libdnet/archive/refs/tags/libdnet-1.18.0.tar.gz"
+    sha256: "a4a82275c7d83b85b1daac6ebac9461352731922161f1dcdcccd46c318f583c9"
+  "1.17.0":
+    url: "https://github.com/ofalk/libdnet/archive/refs/tags/libdnet-1.17.0.tar.gz"
+    sha256: "6be1ed0763151ede4c9665a403f1c9d974b2ffab2eacdb26b22078e461aae1dc"
diff --git a/recipes/dnet/all/conanfile.py b/recipes/dnet/all/conanfile.py
new file mode 100644
index 0000000000000..c8d803e208864
--- /dev/null
+++ b/recipes/dnet/all/conanfile.py
@@ -0,0 +1,70 @@
+from conan import ConanFile
+from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
+from conan.tools.files import copy, get, rmdir
+import os
+
+
+required_conan_version = ">=1.56.0"
+
+
+class dnetConan(ConanFile):
+    name = "dnet"
+    description = "Provides a simplified, portable interface to several low-level networking routines."
+    homepage = "https://github.com/ofalk/libdnet"
+    topics = ("dnet", "libdnet", "libdumbnet")
+    license = "BSD-3-Clause"
+    url = "https://github.com/conan-io/conan-center-index"
+    package_type = "library"
+    options = {
+        "shared": [True, False],
+        "fPIC": [True, False],
+    }
+    default_options = {
+        "shared": False,
+        "fPIC": True
+    }
+    settings = "os", "arch", "compiler", "build_type"
+
+
+    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")
+        # This is a pure C project
+        self.settings.rm_safe("compiler.cppstd")
+        self.settings.rm_safe("compiler.libcxx")
+
+    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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
+        cmake = CMake(self)
+        cmake.configure()
+        cmake.install()
+        rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
+
+    def package_info(self):
+        self.cpp_info.libs.append("dnet")
+        self.cpp_info.includedirs.append(os.path.join("include", "dnet"))
+ 
+        if self.settings.os == 'Windows':
+            self.cpp_info.system_libs = ['Iphlpapi', 'wsock32']
diff --git a/recipes/dnet/all/test_package/CMakeLists.txt b/recipes/dnet/all/test_package/CMakeLists.txt
new file mode 100644
index 0000000000000..0459fc57862bf
--- /dev/null
+++ b/recipes/dnet/all/test_package/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.15)
+project(test_package C)
+
+find_package(dnet REQUIRED CONFIG)
+
+add_executable(${PROJECT_NAME} test_package.c)
+target_link_libraries(${PROJECT_NAME} PRIVATE dnet::dnet)
diff --git a/recipes/dnet/all/test_package/conanfile.py b/recipes/dnet/all/test_package/conanfile.py
new file mode 100644
index 0000000000000..dcfce1e159562
--- /dev/null
+++ b/recipes/dnet/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("{} {}".format(bin_path, "127.0.0.1"), env="conanrun")
diff --git a/recipes/dnet/all/test_package/test_package.c b/recipes/dnet/all/test_package/test_package.c
new file mode 100644
index 0000000000000..6102a898664e5
--- /dev/null
+++ b/recipes/dnet/all/test_package/test_package.c
@@ -0,0 +1,39 @@
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
+#include 
+#elif defined(_WIN32)
+#include 
+#endif
+
+void addr_usage(void)
+{
+	fprintf(stderr, "Usage: dnet addr 
...\n"); + exit(1); +} + +int main(int argc, char *argv[]) +{ + struct addr addr; + int c, len; + + if (argc == 1 || *(argv[1]) == '-') + addr_usage(); + + for (c = 1; c < argc; c++) { + if (addr_aton(argv[c], &addr) < 0) + addr_usage(); + + len = addr.addr_bits / 8; + + if (write(1, addr.addr_data8, len) != len) + err(1, "write"); + } + return 0; +} diff --git a/recipes/dnet/config.yml b/recipes/dnet/config.yml new file mode 100644 index 0000000000000..a8840ca57e8bd --- /dev/null +++ b/recipes/dnet/config.yml @@ -0,0 +1,5 @@ +versions: + "1.18.0": + folder: "all" + "1.17.0": + folder: "all" diff --git a/recipes/docopt.cpp/all/test_package/CMakeLists.txt b/recipes/docopt.cpp/all/test_package/CMakeLists.txt index 2f25c54702003..0ee318a289538 100644 --- a/recipes/docopt.cpp/all/test_package/CMakeLists.txt +++ b/recipes/docopt.cpp/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(docopt REQUIRED CONFIG) diff --git a/recipes/docopt.cpp/all/test_v1_package/CMakeLists.txt b/recipes/docopt.cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/docopt.cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/docopt.cpp/all/test_v1_package/conanfile.py b/recipes/docopt.cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 85a33f9580148..0000000000000 --- a/recipes/docopt.cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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(f"{bin_path} --help", run_environment=True) diff --git a/recipes/doctest/2.x.x/test_package/CMakeLists.txt b/recipes/doctest/2.x.x/test_package/CMakeLists.txt index c3a61e866425e..346872a8aace7 100644 --- a/recipes/doctest/2.x.x/test_package/CMakeLists.txt +++ b/recipes/doctest/2.x.x/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(doctest REQUIRED CONFIG) diff --git a/recipes/doctest/2.x.x/test_v1_package/CMakeLists.txt b/recipes/doctest/2.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/doctest/2.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/doctest/2.x.x/test_v1_package/conanfile.py b/recipes/doctest/2.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/doctest/2.x.x/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_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/double-conversion/all/conanfile.py b/recipes/double-conversion/all/conanfile.py index 9abd55fe46dcf..d174a4f2914d7 100644 --- a/recipes/double-conversion/all/conanfile.py +++ b/recipes/double-conversion/all/conanfile.py @@ -2,9 +2,10 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir, rm from conan.tools.microsoft import check_min_vs +from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class DoubleConversionConan(ConanFile): @@ -46,6 +47,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if Version(self.version) <= "3.3.0": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): diff --git a/recipes/double-conversion/all/test_package/CMakeLists.txt b/recipes/double-conversion/all/test_package/CMakeLists.txt index cdc70c7766f8f..244191c0fa103 100644 --- a/recipes/double-conversion/all/test_package/CMakeLists.txt +++ b/recipes/double-conversion/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(double-conversion REQUIRED CONFIG) diff --git a/recipes/double-conversion/all/test_v1_package/CMakeLists.txt b/recipes/double-conversion/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/double-conversion/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/double-conversion/all/test_v1_package/conanfile.py b/recipes/double-conversion/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/double-conversion/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_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/doxygen/all/conandata.yml b/recipes/doxygen/all/conandata.yml index 32fdd824d1e93..e343c63fe00f1 100644 --- a/recipes/doxygen/all/conandata.yml +++ b/recipes/doxygen/all/conandata.yml @@ -1,63 +1,16 @@ sources: + "1.13.2": + url: "https://github.com/doxygen/doxygen/releases/download/Release_1_13_2/doxygen-1.13.2.src.tar.gz" + sha256: "3a25e3386c26ea5494c784e946327225debfbc5dbfa8b13549010a315aace66d" + "1.12.0": + url: "https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.src.tar.gz" + sha256: "a3a3dba2018ef409d83d81a2fc42a0d19bdbe087252ef342bf214b51b8b01634" "1.9.4": url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.9.4.src.tar.gz" sha256: "a15e9cd8c0d02b7888bc8356eac200222ecff1defd32f3fe05257d81227b1f37" - "1.9.2": - url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.9.2.src.tar.gz" - sha256: "060f254bcef48673cc7ccf542736b7455b67c110b30fdaa33512a5b09bbecee5" - "1.9.1": - url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.9.1.src.tar.gz" - sha256: "67aeae1be4e1565519898f46f1f7092f1973cce8a767e93101ee0111717091d1" - "1.8.20": - url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.8.20.src.tar.gz" - sha256: "e0db6979286fd7ccd3a99af9f97397f2bae50532e4ecb312aa18862f8401ddec" - "1.8.18": - url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.8.18.src.tar.gz" - sha256: "18173d9edc46d2d116c1f92a95d683ec76b6b4b45b817ac4f245bb1073d00656" - "1.8.17": - url: "https://sourceforge.net/projects/doxygen/files/doxygen-1.8.17.src.tar.gz" - sha256: "2cba988af2d495541cbbe5541b3bee0ee11144dcb23a81eada19f5501fd8b599" patches: "1.9.4": - patch_file: "patches/1.9.4-0001-enable-modern-compilers.patch" 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 e3bd611aea91d..f86de9d6011bb 100644 --- a/recipes/doxygen/all/conanfile.py +++ b/recipes/doxygen/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, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get -from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file +from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.4" class DoxygenConan(ConanFile): @@ -26,25 +27,9 @@ class DoxygenConan(ConanFile): default_options = { "enable_parse": True, "enable_search": True, - "enable_app": False, + "enable_app": False } - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - @property - def _minimum_compiler_version(self): - if Version(self.version) <= "1.9.1": - return { - "gcc": "5", - } - return { - "gcc": "7", # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66297 - "Visual Studio": "15", - "msvc": "191", - } - def export_sources(self): export_conandata_patches(self) @@ -56,28 +41,34 @@ def requirements(self): self.requires("xapian-core/1.4.19") 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")]}] - def validate(self): - minimum_compiler_version = self._minimum_compiler_version.get(str(self.settings.compiler)) - if minimum_compiler_version and Version(self.settings.compiler.version) < minimum_compiler_version: - raise ConanInvalidConfiguration(f"Compiler version too old. At least {minimum_compiler_version} is required.") - if Version(self.version) == "1.8.18": - check_min_vs(self, "191") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("Doxygen requires GCC >=5") + + if self.settings.compiler == "msvc" and Version(self.settings.compiler.version) < "191": + raise ConanInvalidConfiguration("Doxygen requires Visual Studio 2017 or newer") + + check_min_cppstd(self, "17") def build_requirements(self): - if self._settings_build.os == "Windows": + if self.settings_build.os == "Windows": self.tool_requires("winflexbison/2.5.24") else: self.tool_requires("flex/2.6.4") self.tool_requires("bison/3.8.2") + self.tool_requires("cmake/[>=3.19 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + #Do not build manpages + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "add_subdirectory(doc)", "") + replace_in_file(self, cmakelists, "set(CMAKE_CXX_STANDARD", "##set(CMAKE_CXX_STANDARD") def generate(self): tc = CMakeToolchain(self) @@ -89,10 +80,10 @@ def generate(self): tc.generate() deps = CMakeDeps(self) + deps.set_property("libiconv", "cmake_additional_variables_prefixes", ["ICONV"]) deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -106,8 +97,3 @@ 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-0001-xapian.patch b/recipes/doxygen/all/patches/1.8-0001-xapian.patch deleted file mode 100644 index c892c87957f88..0000000000000 --- a/recipes/doxygen/all/patches/1.8-0001-xapian.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/addon/doxysearch/CMakeLists.txt 2020-08-24 13:12:55.000000000 +0200 -+++ b/addon/doxysearch/CMakeLists.txt 2022-12-16 20:41:07.040801300 +0100 -@@ -1,8 +1,8 @@ --find_package(Xapian REQUIRED) -+find_package(xapian REQUIRED) - find_package(ZLIB REQUIRED) - - if (WIN32) -- set(WIN_EXTRA_LIBS "uuid.lib rpcrt4.lib ws2_32.lib") -+ set(WIN_EXTRA_LIBS uuid.lib rpcrt4.lib ws2_32.lib) - endif() - - include_directories( 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 deleted file mode 100644 index 39ee763500256..0000000000000 --- a/recipes/doxygen/all/patches/1.8.17-0002-fix-iconv-linkage.patch +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100644 index 9bd67ebc094cd..0000000000000 --- a/recipes/doxygen/all/patches/1.8.18-0002-fix-iconv-linkage.patch +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100644 index c32eb98953039..0000000000000 --- a/recipes/doxygen/all/patches/1.8.20-0002-fix-iconv-linkage.patch +++ /dev/null @@ -1,65 +0,0 @@ -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-0001-imported-target.patch b/recipes/doxygen/all/patches/1.9.1-0001-imported-target.patch deleted file mode 100644 index 170bfd9753ce3..0000000000000 --- a/recipes/doxygen/all/patches/1.9.1-0001-imported-target.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/libmscgen/mscgen_bool.h b/libmscgen/mscgen_bool.h -index e982d80..d16ef98 100644 ---- libmscgen/mscgen_bool.h -+++ libmscgen/mscgen_bool.h -@@ -23,6 +23,14 @@ - #ifndef MSCGEN_BOOL_H - #define MSCGEN_BOOL_H - -+/* Some system headers define TRUE and FALSE so undefine them first */ -+#ifdef TRUE -+#undef TRUE -+#endif -+#ifdef FALSE -+#undef FALSE -+#endif -+ - typedef enum - { - FALSE = 0, -diff --git a/qtools/qglobal.h b/qtools/qglobal.h -index 0deef5d..86846f8 100644 ---- qtools/qglobal.h -+++ qtools/qglobal.h -@@ -357,6 +356,7 @@ typedef const char *pcchar; - typedef __int64 int64; - typedef unsigned __int64 uint64; - #else -+#include - #if !defined(_OS_AIX_) || !defined(_H_INTTYPES) - typedef long long int64; - #endif -diff --git a/src/doxygen.cpp b/src/doxygen.cpp -index 3fdde9bc..1b32e273 100644 ---- src/doxygen.cpp -+++ src/doxygen.cpp -@@ -12,6 +12,7 @@ - * input used in their production; they are not affected by this license. - * - */ -+#include - - #include - -@@ -32,7 +33,6 @@ - #include - #include - #include --#include - - #include "version.h" - #include "doxygen.h" -diff --git a/src/util.cpp b/src/util.cpp -index 7fcd5ed..399e7a2 100644 ---- src/util.cpp -+++ src/util.cpp -@@ -13,13 +13,13 @@ - * input used in their production; they are not affected by this license. - * - */ -+#include - - #include - #include - #include - #include - #include --#include - #include - - #include 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 deleted file mode 100644 index 6a3bb24247325..0000000000000 --- a/recipes/doxygen/all/patches/1.9.1-0002-fix-iconv-linkage.patch +++ /dev/null @@ -1,65 +0,0 @@ -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-0001-imported-target.patch b/recipes/doxygen/all/patches/1.9.2-0001-imported-target.patch deleted file mode 100644 index aa88aa13aa307..0000000000000 --- a/recipes/doxygen/all/patches/1.9.2-0001-imported-target.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- libmscgen/mscgen_bool.h -+++ libmscgen/mscgen_bool.h -@@ -23,6 +23,14 @@ - #ifndef MSCGEN_BOOL_H - #define MSCGEN_BOOL_H - -+/* Some system headers define TRUE and FALSE so undefine them first */ -+#ifdef TRUE -+#undef TRUE -+#endif -+#ifdef FALSE -+#undef FALSE -+#endif -+ - typedef enum - { - FALSE = 0, 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 deleted file mode 100644 index 699ac1e93addc..0000000000000 --- a/recipes/doxygen/all/patches/1.9.2-0002-fix-iconv-linkage.patch +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100644 index c8e1489aa5a64..0000000000000 --- a/recipes/doxygen/all/patches/1.9.4-0002-fix-iconv-linkage.patch +++ /dev/null @@ -1,65 +0,0 @@ -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/conanfile.py b/recipes/doxygen/all/test_package/conanfile.py index 17e0d51d2d0e2..aeb3db4ed040f 100644 --- a/recipes/doxygen/all/test_package/conanfile.py +++ b/recipes/doxygen/all/test_package/conanfile.py @@ -4,13 +4,11 @@ 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 requirements(self): + self.requires(self.tested_reference_str) def test(self): if can_run(self): self.output.info("Doxygen Version:") - self.run("doxygen --version") + self.run("doxygen --version", env="conanrun") diff --git a/recipes/doxygen/config.yml b/recipes/doxygen/config.yml index 2157880ecf476..b98364abc347a 100644 --- a/recipes/doxygen/config.yml +++ b/recipes/doxygen/config.yml @@ -1,13 +1,7 @@ versions: - "1.9.4": - folder: "all" - "1.9.2": - folder: "all" - "1.9.1": + "1.13.2": folder: "all" - "1.8.20": - folder: "all" - "1.8.18": - folder: "all" - "1.8.17": + "1.12.0": folder: "all" + "1.9.4": + folder: "all" \ No newline at end of file diff --git a/recipes/dpp/all/conandata.yml b/recipes/dpp/all/conandata.yml new file mode 100644 index 0000000000000..72137f59232db --- /dev/null +++ b/recipes/dpp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "10.0.35": + url: + - "https://github.com/brainboxdotcc/DPP/archive/refs/tags/v10.0.35.zip" + sha256: "ebe82b0c3c7678d31bc26ad7ab9aedfd66057a559c541750ede5d19a0ed0c245" + "10.0.34": + url: + - "https://github.com/brainboxdotcc/DPP/archive/refs/tags/v10.0.34.zip" + sha256: "944dcaa19638ff88feceae2f543662675eb8aceb59458ad369edc28819e05054" diff --git a/recipes/dpp/all/conanfile.py b/recipes/dpp/all/conanfile.py new file mode 100644 index 0000000000000..b33af815685ca --- /dev/null +++ b/recipes/dpp/all/conanfile.py @@ -0,0 +1,81 @@ +import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=2" + +class DPPConan(ConanFile): + name = "dpp" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/brainboxdotcc/DPP" + description = "D++ is a lightweight and efficient library for Discord" + topics = ("discord") + package_type = "shared-library" + settings = "os", "compiler", "build_type", "arch" + + def validate(self): + check_min_cppstd(self, "17") + + def requirements(self): + self.requires("nlohmann_json/3.11.2", transitive_libs=True, transitive_headers=True) + self.requires("openssl/[>=1.1 <4]") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("opus/1.4") + + 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): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.cache_variables["DPP_NO_VCPKG"] = True + tc.cache_variables["DPP_USE_EXTERNAL_JSON"] = True + tc.cache_variables["CONAN_EXPORTED"] = True + tc.cache_variables["BUILD_VOICE_SUPPORT"] = True + tc.cache_variables["DPP_BUILD_TEST"] = False + tc.cache_variables["BUILD_SHARED_LIBS"] = True + if Version(self.version) <= "10.0.34": + # Workaround for Neon not compiling in old versions + tc.cache_variables["AVX_TYPE"] = "AVX0" + if self.settings.os == "Macos" and cross_building(self) and self.settings.arch == "x86_64": + tc.cache_variables["AVX1_EXITCODE"] = "0" + tc.cache_variables["AVX2_EXITCODE"] = "0" + tc.cache_variables["AVX512_EXITCODE"] = "-1" + tc.cache_variables["AVX1024_EXITCODE"] = "-1" + tc.generate() + + def build(self): + 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["dpp"] + self.cpp_info.set_property("cmake_file_name", "dpp") + self.cpp_info.set_property("cmake_target_name", "dpp::dpp") + # On windows only, the headers and libs go into dpp-10.0 subdirectories. + if self.settings.os == "Windows": + self.cpp_info.includedirs = ["include/dpp-10.0"] + self.cpp_info.libdirs = ["lib/dpp-10.0"] + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + self.cpp_info.defines = ["DPP_USE_EXTERNAL_JSON"] diff --git a/recipes/dpp/all/test_package/CMakeLists.txt b/recipes/dpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6aad9088d01aa --- /dev/null +++ b/recipes/dpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) +find_package(dpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE dpp::dpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/dpp/all/test_package/conanfile.py b/recipes/dpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/dpp/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/dpp/all/test_package/test_package.cpp b/recipes/dpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..90606cfd59042 --- /dev/null +++ b/recipes/dpp/all/test_package/test_package.cpp @@ -0,0 +1,5 @@ +#include + +int main() { + dpp::cluster test_cluster(""); +} diff --git a/recipes/dpp/config.yml b/recipes/dpp/config.yml new file mode 100644 index 0000000000000..7b7ac472d8862 --- /dev/null +++ b/recipes/dpp/config.yml @@ -0,0 +1,5 @@ +versions: + "10.0.35": + folder: all + "10.0.34": + folder: all diff --git a/recipes/draco/all/test_package/CMakeLists.txt b/recipes/draco/all/test_package/CMakeLists.txt index df800aa1ddc46..a7945ac46de36 100644 --- a/recipes/draco/all/test_package/CMakeLists.txt +++ b/recipes/draco/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(draco REQUIRED CONFIG) diff --git a/recipes/draco/all/test_v1_package/CMakeLists.txt b/recipes/draco/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/draco/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/draco/all/test_v1_package/conanfile.py b/recipes/draco/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/draco/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_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/dragonbox/all/test_package/CMakeLists.txt b/recipes/dragonbox/all/test_package/CMakeLists.txt index 7523e1c1d0d5d..bce78c28085b0 100644 --- a/recipes/dragonbox/all/test_package/CMakeLists.txt +++ b/recipes/dragonbox/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) diff --git a/recipes/dragonbox/all/test_v1_package/CMakeLists.txt b/recipes/dragonbox/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/dragonbox/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/dragonbox/all/test_v1_package/conanfile.py b/recipes/dragonbox/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/dragonbox/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/drflac/all/CMakeLists.txt b/recipes/drflac/all/CMakeLists.txt index f2a49258562bf..22eacd545353d 100644 --- a/recipes/drflac/all/CMakeLists.txt +++ b/recipes/drflac/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(dr_flac LANGUAGES C) include(GNUInstallDirs) @@ -14,7 +14,7 @@ add_library(${CMAKE_PROJECT_NAME} dr_flac.c) target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${DRFLAC_SRC_DIR}) -set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES +set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER ${DRFLAC_SRC_DIR}/dr_flac.h C_STANDARD 99 ) 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/all/test_package/CMakeLists.txt b/recipes/drflac/all/test_package/CMakeLists.txt index 1db07f8a402a7..a528e0f24b805 100644 --- a/recipes/drflac/all/test_package/CMakeLists.txt +++ b/recipes/drflac/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 C) find_package(drflac CONFIG REQUIRED) diff --git a/recipes/drflac/all/test_v1_package/CMakeLists.txt b/recipes/drflac/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/drflac/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/drflac/all/test_v1_package/conanfile.py b/recipes/drflac/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/drflac/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_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/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/CMakeLists.txt b/recipes/drmp3/all/CMakeLists.txt index c44a0bb77d180..7493b60e1c5e7 100644 --- a/recipes/drmp3/all/CMakeLists.txt +++ b/recipes/drmp3/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(dr_mp3 LANGUAGES C) include(GNUInstallDirs) @@ -10,7 +10,7 @@ add_library(${CMAKE_PROJECT_NAME} dr_mp3.c) target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${DRMP3_SRC_DIR}) -set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES +set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER ${DRMP3_SRC_DIR}/dr_mp3.h C_STANDARD 99 ) 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/all/test_package/CMakeLists.txt b/recipes/drmp3/all/test_package/CMakeLists.txt index d5c1b7eb10c20..0f465a4d577f1 100644 --- a/recipes/drmp3/all/test_package/CMakeLists.txt +++ b/recipes/drmp3/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 C) find_package(drmp3 CONFIG REQUIRED) diff --git a/recipes/drmp3/all/test_v1_package/CMakeLists.txt b/recipes/drmp3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/drmp3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/drmp3/all/test_v1_package/conanfile.py b/recipes/drmp3/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/drmp3/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_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/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 32fb63a308bd7..1689f5184dc30 100644 --- a/recipes/drogon/all/conandata.yml +++ b/recipes/drogon/all/conandata.yml @@ -1,133 +1,16 @@ sources: - "1.9.0": - url: "https://github.com/drogonframework/drogon/archive/v1.9.0.tar.gz" - sha256: "35793c1b64c32ebbea5a6cb3b1c22bcd0820e948674ecba92022ec05b41c848b" + "1.9.10": + url: "https://github.com/drogonframework/drogon/archive/v1.9.10.tar.gz" + sha256: "5de93fe16682388f363bb4b26ab00b0253d39108d8e7f53d5637c1b7da59a48f" "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" - "1.8.2": - url: "https://github.com/drogonframework/drogon/archive/v1.8.2.tar.gz" - sha256: "1182cab00c33e400eac617c6dbf44fa2f358e1844990b6b8c5c87783024f9971" - "1.8.0": - url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.8.0.tar.gz" - sha256: "bc6503cf213ed961d4a5e9fd7cb8e75b6b11045a67840ea2241e57321dd8711b" - "1.7.5": - url: "https://github.com/drogonframework/drogon/archive/refs/tags/v1.7.5.tar.gz" - sha256: "e2af7c55dcabafef16f26f5b3242692f5a2b54c19b7b626840bf9132d24766f6" patches: - "1.9.0": - - patch_file: "patches/1.8.5-0001-remove-shared-libs.patch" - patch_description: "remove shared libs option" - patch_type: "conan" - - patch_file: "patches/1.9.0-0002-find-cci-packages.patch" + "1.9.10": + - patch_file: "patches/1.9.7-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\ - \ subproject" - patch_type: "conan" - - patch_file: "patches/1.8.0-0002-find-package-jsoncpp.patch" - patch_description: "Fix jsoncpp cmake target name" - patch_type: "conan" - - 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\ - \ subproject" - patch_type: "conan" - - patch_file: "patches/1.8.0-0002-find-package-jsoncpp.patch" - patch_description: "Fix jsoncpp cmake target name" - patch_type: "conan" - - 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" - patch_type: "conan" - - patch_file: "patches/1.8.0-0002-find-package-jsoncpp.patch" - patch_description: "Fix jsoncpp cmake target name" - patch_type: "conan" - - 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" - patch_type: "conan" - - patch_file: "patches/1.7.5-0002-remove-boost-components.patch" - patch_description: "Do not consume specific Boost components" - patch_type: "conan" - - patch_file: "patches/1.7.5-0003-find-package-trantor.patch" - patch_description: "Fix Trantor cmake target name" - patch_type: "conan" - - 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 44120c268dd5c..327857acc06db 100644 --- a/recipes/drogon/all/conanfile.py +++ b/recipes/drogon/all/conanfile.py @@ -1,14 +1,13 @@ 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.scm import Version from conan.tools.microsoft import is_msvc -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class DrogonConan(ConanFile): @@ -57,8 +56,6 @@ 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: @@ -73,44 +70,15 @@ def configure(self): elif not self.options.with_postgres: del self.options.with_postgres_batch - @property - def _min_cppstd(self): - return 14 if Version(self.version) < "1.8.2" else 17 - - @property - def _compilers_minimum_version(self): - return { - "14": { - "Visual Studio": "15", - "msvc": "191", - "gcc": "6", - "clang": "5", - "apple-clang": "10", - }, - "17": { - "Visual Studio": "16", - "msvc": "192", - "gcc": "8", - "clang": "7", - "apple-clang": "12", - } - }.get(str(self._min_cppstd), {}) 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.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 self.settings.compiler.get_safe("cppstd") == "14" and not self.options.with_boost: - raise ConanInvalidConfiguration(f"{self.ref} requires boost on C++14") + check_min_cppstd(self, 17) def requirements(self): - self.requires("trantor/1.5.14", transitive_headers=True, transitive_libs=True) + if Version(self.version) < "1.9.7": + self.requires("trantor/1.5.19", transitive_headers=True, transitive_libs=True) + else: + self.requires("trantor/1.5.21", 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]") @@ -125,9 +93,9 @@ def requirements(self): if self.options.get_safe("with_postgres"): self.requires("libpq/15.4") if self.options.get_safe("with_mysql"): - self.requires("libmysqlclient/8.1.0") + self.requires("mariadb-connector-c/3.4.3") if self.options.get_safe("with_sqlite"): - self.requires("sqlite3/3.44.2") + self.requires("sqlite3/3.45.0") if self.options.get_safe("with_redis"): self.requires("hiredis/1.2.0") if self.options.get_safe("with_yaml_cpp", False): @@ -154,13 +122,17 @@ def generate(self): 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) + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared 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.variables["USE_SUBMODULE"] = False tc.generate() + deps = CMakeDeps(self) + if self.options.get_safe("with_mysql"): + deps.set_property("mariadb-connector-c", "cmake_file_name", "MySQL") + deps.set_property("mariadb-connector-c", "cmake_target_name", "MySQL_lib") + deps.generate() def build(self): apply_conandata_patches(self) @@ -181,16 +153,5 @@ def package_info(self): if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.system_libs.append("stdc++fs") - if self.options.with_ctl: - 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.set_property("cmake_file_name", "Drogon") self.cpp_info.set_property("cmake_target_name", "Drogon::Drogon") - - # TODO: Remove after Conan 2.0 - self.cpp_info.filenames["cmake_find_package"] = "Drogon" - self.cpp_info.filenames["cmake_find_package_multi"] = "Drogon" - self.cpp_info.names["cmake_find_package"] = "Drogon" - self.cpp_info.names["cmake_find_package_multi"] = "Drogon" diff --git a/recipes/drogon/all/patches/1.7.5-0001-disable_trantor.patch b/recipes/drogon/all/patches/1.7.5-0001-disable_trantor.patch deleted file mode 100644 index bd56d16c697b5..0000000000000 --- a/recipes/drogon/all/patches/1.7.5-0001-disable_trantor.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 146d2b8..f83e119 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -52,7 +52,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - endif () - - if (BUILD_DROGON_SHARED) -- set(BUILD_TRANTOR_SHARED TRUE) - set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) - find_package(Threads) - # set(BUILD_EXAMPLES FALSE) -@@ -110,7 +109,6 @@ target_include_directories( - $ - $ - $ -- $ - $ - $) - -@@ -120,8 +118,6 @@ if (WIN32) - PRIVATE $) - endif (WIN32) - --add_subdirectory(trantor) -- - target_link_libraries(${PROJECT_NAME} PUBLIC trantor) - - if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") diff --git a/recipes/drogon/all/patches/1.7.5-0002-remove-boost-components.patch b/recipes/drogon/all/patches/1.7.5-0002-remove-boost-components.patch deleted file mode 100644 index 6823964b810ea..0000000000000 --- a/recipes/drogon/all/patches/1.7.5-0002-remove-boost-components.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f83e119..46a23fd 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -177,7 +177,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") - endif () - - if(NEED_BOOST_FS) -- find_package(Boost 1.49.0 COMPONENTS filesystem system REQUIRED) -+ # TODO: component specified find_package is always failed. Need to fix it. -+ find_package(Boost 1.49.0 REQUIRED) - message(STATUS "Using Boost filesytem::path") - message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIR}) - include_directories(${BOOST_INCLUDE_DIRS}) diff --git a/recipes/drogon/all/patches/1.7.5-0003-find-package-trantor.patch b/recipes/drogon/all/patches/1.7.5-0003-find-package-trantor.patch deleted file mode 100644 index d2e449648defd..0000000000000 --- a/recipes/drogon/all/patches/1.7.5-0003-find-package-trantor.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 46a23fd..d2e2f69 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -118,7 +118,8 @@ if (WIN32) - PRIVATE $) - endif (WIN32) - --target_link_libraries(${PROJECT_NAME} PUBLIC trantor) -+find_package(Trantor REQUIRED) -+target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor) - - if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") - target_link_libraries(${PROJECT_NAME} PRIVATE network) diff --git a/recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch b/recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch deleted file mode 100644 index dc4849690a251..0000000000000 --- a/recipes/drogon/all/patches/1.7.5-0004-find-package-jsoncpp.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d2e2f69..61fb3bf 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -199,9 +199,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}) - - if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" - AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" 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 deleted file mode 100644 index 61bc8404888cc..0000000000000 --- a/recipes/drogon/all/patches/1.7.5-0005-remove-msvc-check.patch +++ /dev/null @@ -1,92 +0,0 @@ -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-0001-disable-unused-data.patch b/recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch deleted file mode 100644 index 3038da266a3a2..0000000000000 --- a/recipes/drogon/all/patches/1.8.0-0001-disable-unused-data.patch +++ /dev/null @@ -1,41 +0,0 @@ -index ca6dff2..ba015d2 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) - -@@ -106,7 +105,6 @@ target_include_directories( - $ - $ - $ -- $ - $ - $) - -@@ -116,9 +114,8 @@ if (WIN32) - PRIVATE $) - endif (WIN32) - --add_subdirectory(trantor) -- --target_link_libraries(${PROJECT_NAME} PUBLIC trantor) -+find_package(Trantor REQUIRED) -+target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor) - - if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") - target_link_libraries(${PROJECT_NAME} PRIVATE network) -@@ -177,7 +174,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") - endif () - - if(NEED_BOOST_FS) -- find_package(Boost 1.49.0 COMPONENTS filesystem system REQUIRED) -+ # TODO: component specified find_package is always failed. Need to fix it. -+ find_package(Boost 1.49.0 REQUIRED) - message(STATUS "Using Boost filesytem::path") - message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIR}) - include_directories(${BOOST_INCLUDE_DIRS}) diff --git a/recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch b/recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch deleted file mode 100644 index 2402bc2bfdf71..0000000000000 --- a/recipes/drogon/all/patches/1.8.0-0002-find-package-jsoncpp.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ba015d2..02c2ccc 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -195,9 +195,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}) - - if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" - AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" diff --git a/recipes/drogon/all/patches/1.8.0-0003-find-package-sqlite.patch b/recipes/drogon/all/patches/1.8.0-0003-find-package-sqlite.patch deleted file mode 100644 index 908cb3b2952e3..0000000000000 --- a/recipes/drogon/all/patches/1.8.0-0003-find-package-sqlite.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5d92323..b971267 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -394,7 +394,7 @@ # Find sqlite3. - 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.0-0004-remove-msvc-check.patch b/recipes/drogon/all/patches/1.8.0-0004-remove-msvc-check.patch deleted file mode 100644 index 5b0923c887cc6..0000000000000 --- a/recipes/drogon/all/patches/1.8.0-0004-remove-msvc-check.patch +++ /dev/null @@ -1,117 +0,0 @@ -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-0003-find-package-sqlite.patch b/recipes/drogon/all/patches/1.8.2-0003-find-package-sqlite.patch deleted file mode 100644 index c54242f8776df..0000000000000 --- a/recipes/drogon/all/patches/1.8.2-0003-find-package-sqlite.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5d92323..b971267 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -402,7 +402,7 @@ # Find sqlite3. - 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.2-0004-support-gcc13.patch b/recipes/drogon/all/patches/1.8.2-0004-support-gcc13.patch deleted file mode 100644 index 477d23fb1fd63..0000000000000 --- a/recipes/drogon/all/patches/1.8.2-0004-support-gcc13.patch +++ /dev/null @@ -1,12 +0,0 @@ -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.3-0003-find-package-sqlite.patch b/recipes/drogon/all/patches/1.8.3-0003-find-package-sqlite.patch deleted file mode 100644 index f4d98d1fd03e8..0000000000000 --- a/recipes/drogon/all/patches/1.8.3-0003-find-package-sqlite.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 680dc46..28cbcf4 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -405,7 +405,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-0001-remove-shared-libs.patch b/recipes/drogon/all/patches/1.8.4-0001-remove-shared-libs.patch deleted file mode 100644 index f51304849a04f..0000000000000 --- a/recipes/drogon/all/patches/1.8.4-0001-remove-shared-libs.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 362fa96c66cc6..0000000000000 --- a/recipes/drogon/all/patches/1.8.4-0002-find-package-jsoncpp.patch +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 6f97d35a4d314..0000000000000 --- a/recipes/drogon/all/patches/1.8.4-0003-find-package-sqlite.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index a9fca7863aea7..0000000000000 --- a/recipes/drogon/all/patches/1.8.4-0004-find-package-yaml-cpp.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 9920eee534139..0000000000000 --- a/recipes/drogon/all/patches/1.8.5-0001-remove-shared-libs.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 8bf9e60842f93..0000000000000 --- a/recipes/drogon/all/patches/1.8.5-0002-find-cci-packages.patch +++ /dev/null @@ -1,71 +0,0 @@ -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 index 3da404b88ccc2..a6d95280df272 100644 --- 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 @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index a3ba35a..26fed2a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -198,9 +198,9 @@ else() +@@ -199,9 +199,9 @@ else() endif() # jsoncpp @@ -15,7 +15,7 @@ index a3ba35a..26fed2a 100755 # yamlcpp if(BUILD_YAML_CONFIG) -@@ -212,7 +212,7 @@ if(BUILD_YAML_CONFIG) +@@ -213,7 +213,7 @@ if(BUILD_YAML_CONFIG) message(STATUS "yaml-cpp not used") else() message(STATUS "yaml-cpp found ") @@ -24,7 +24,7 @@ index a3ba35a..26fed2a 100755 target_compile_definitions(${PROJECT_NAME} PUBLIC HAS_YAML_CPP) endif() else() -@@ -444,7 +444,7 @@ if (BUILD_SQLITE) +@@ -445,7 +445,7 @@ if (BUILD_SQLITE) find_package(SQLite3 QUIET) find_package(unofficial-sqlite3 QUIET) if (SQLite3_FOUND) @@ -33,7 +33,7 @@ index a3ba35a..26fed2a 100755 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) +@@ -468,10 +468,10 @@ if (BUILD_SQLITE) endif (BUILD_SQLITE) if (BUILD_REDIS) @@ -47,7 +47,7 @@ index a3ba35a..26fed2a 100755 set(DROGON_SOURCES ${DROGON_SOURCES} nosql_lib/redis/src/RedisClientImpl.cc -@@ -490,10 +490,10 @@ if (BUILD_REDIS) +@@ -491,10 +491,10 @@ if (BUILD_REDIS) nosql_lib/redis/src/SubscribeContext.h nosql_lib/redis/src/RedisSubscriberImpl.h) @@ -60,7 +60,7 @@ index a3ba35a..26fed2a 100755 set(DROGON_SOURCES ${DROGON_SOURCES} lib/src/RedisClientSkipped.cc -@@ -502,7 +502,7 @@ if (NOT Hiredis_FOUND) +@@ -503,7 +503,7 @@ if (NOT Hiredis_FOUND) set(private_headers ${private_headers} lib/src/RedisClientManager.h) 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 deleted file mode 100644 index cf206b982069b..0000000000000 --- a/recipes/drogon/all/patches/1.9.0-0002-find-cci-packages.patch +++ /dev/null @@ -1,72 +0,0 @@ -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/all/patches/1.9.7-0002-find-cci-packages.patch b/recipes/drogon/all/patches/1.9.7-0002-find-cci-packages.patch new file mode 100644 index 0000000000000..4d05a185fea36 --- /dev/null +++ b/recipes/drogon/all/patches/1.9.7-0002-find-cci-packages.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 91b9b9b..9a2773f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -186,9 +186,9 @@ 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) +@@ -200,7 +200,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() +@@ -438,7 +438,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) +@@ -461,10 +461,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 +@@ -484,10 +484,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 +@@ -496,7 +496,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/test_package/CMakeLists.txt b/recipes/drogon/all/test_package/CMakeLists.txt index cf16e9b501eaa..bd6d670b2f268 100644 --- a/recipes/drogon/all/test_package/CMakeLists.txt +++ b/recipes/drogon/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(Drogon CONFIG REQUIRED) diff --git a/recipes/drogon/all/test_package/conanfile.py b/recipes/drogon/all/test_package/conanfile.py index 84eaa369e4a72..99d0db4a34c2c 100644 --- a/recipes/drogon/all/test_package/conanfile.py +++ b/recipes/drogon/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/drogon/all/test_v1_package/CMakeLists.txt b/recipes/drogon/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/drogon/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/drogon/all/test_v1_package/conanfile.py b/recipes/drogon/all/test_v1_package/conanfile.py deleted file mode 100644 index db6f728ae05ec..0000000000000 --- a/recipes/drogon/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -import os -from conans import ConanFile, CMake -from conan.tools.build import cross_building - -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 cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/drogon/config.yml b/recipes/drogon/config.yml index fb2e690403f06..3766eefec39a8 100644 --- a/recipes/drogon/config.yml +++ b/recipes/drogon/config.yml @@ -1,19 +1,5 @@ versions: - "1.9.0": + "1.9.10": 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": - folder: "all" - "1.8.0": - folder: "all" - "1.7.5": - folder: "all" diff --git a/recipes/drwav/all/CMakeLists.txt b/recipes/drwav/all/CMakeLists.txt index 64cb2f4533122..307f838eb1278 100644 --- a/recipes/drwav/all/CMakeLists.txt +++ b/recipes/drwav/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(dr_wav LANGUAGES C) include(GNUInstallDirs) @@ -11,7 +11,7 @@ add_library(${CMAKE_PROJECT_NAME} dr_wav.c) target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${DRWAV_SRC_DIR}) -set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES +set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER ${DRWAV_SRC_DIR}/dr_wav.h C_STANDARD 99 ) diff --git a/recipes/drwav/all/conandata.yml b/recipes/drwav/all/conandata.yml index cfc31466349bc..7757121179bae 100644 --- a/recipes/drwav/all/conandata.yml +++ b/recipes/drwav/all/conandata.yml @@ -1,13 +1,14 @@ sources: # 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 + url: "https://github.com/mackron/dr_libs/archive/d35a3bc5efd02455d98cbe12b94647136f09b42d.zip" sha256: "4886462b8ed26f12b8bceccb80f1447075ed5e73240089f2a78e0c32b444b370" - # NOTE: https://github.com/mackron/dr_libs/blob/4f6da71ed357ade92dc91f00e6be7301ec9a82a3/dr_wav.h#L3 "0.13.7": - url: https://github.com/mackron/dr_libs/archive/4f6da71ed357ade92dc91f00e6be7301ec9a82a3.zip + 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/all/test_package/CMakeLists.txt b/recipes/drwav/all/test_package/CMakeLists.txt index 6e57f5fb28026..f7f08b96d2d3a 100644 --- a/recipes/drwav/all/test_package/CMakeLists.txt +++ b/recipes/drwav/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 C) find_package(drwav CONFIG REQUIRED) diff --git a/recipes/drwav/all/test_v1_package/CMakeLists.txt b/recipes/drwav/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/drwav/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/drwav/all/test_v1_package/conanfile.py b/recipes/drwav/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/drwav/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_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/drwav/config.yml b/recipes/drwav/config.yml index b1c16872231f4..35331ff9db236 100644 --- a/recipes/drwav/config.yml +++ b/recipes/drwav/config.yml @@ -1,4 +1,6 @@ versions: + "0.13.14": + folder: all "0.13.12": folder: all "0.13.7": diff --git a/recipes/dsp-filters/all/conanfile.py b/recipes/dsp-filters/all/conanfile.py index d4ef17870d051..c306b31282c6d 100644 --- a/recipes/dsp-filters/all/conanfile.py +++ b/recipes/dsp-filters/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class DSPFiltersConan(ConanFile): name = "dsp-filters" @@ -50,11 +50,12 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support 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() diff --git a/recipes/dtl/all/conandata.yml b/recipes/dtl/all/conandata.yml index 7ae1dc4743d98..b14780dd20c90 100644 --- a/recipes/dtl/all/conandata.yml +++ b/recipes/dtl/all/conandata.yml @@ -1,10 +1,10 @@ sources: + "1.21": + url: "https://github.com/cubicdaiya/dtl/archive/v1.21.tar.gz" + sha256: "90ed2dbf4e6d687737fe25f118bbcb6aed778cecc3f2115d191a032bf8643dbd" "1.20": url: "https://github.com/cubicdaiya/dtl/archive/v1.20.tar.gz" sha256: "579f81bca88f4b9760a59d99c5a95bd8dd5dc2f20f33f1f9b5f64cb08979f54d" "1.19": url: "https://github.com/cubicdaiya/dtl/archive/v1.19.tar.gz" sha256: "f47b99dd11e5d771ad32a8dc960db4ab2fbe349fb0346fa0795f53c846a99c5d" - "cci.20210404": - url: "https://github.com/cubicdaiya/dtl/archive/0551c22f5ee3d30dbc4b0700bde5acdb6f1a9348.tar.gz" - sha256: "59c2e770454c935200179aa4457f72741aec2319072862950b2490d0758d4e43" diff --git a/recipes/dtl/all/conanfile.py b/recipes/dtl/all/conanfile.py index c53d228db8921..bc5ebc68cd927 100644 --- a/recipes/dtl/all/conanfile.py +++ b/recipes/dtl/all/conanfile.py @@ -1,9 +1,9 @@ import os from conan import ConanFile -from conan.tools.build import check_min_cppstd -from conan.tools.files import copy, get +from conan.tools.files import copy, get, replace_in_file from conan.tools.layout import basic_layout +from conan.tools.scm import Version required_conan_version = ">=1.52.0" @@ -28,6 +28,9 @@ def package_id(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + if Version(self.version) < "1.21": + # See https://github.com/cubicdaiya/dtl/pull/18 + replace_in_file(self, os.path.join(self.source_folder, "dtl", "Diff.hpp"), "void enableTrivial () const {", "void enableTrivial () {") def package(self): copy(self, "COPYING", diff --git a/recipes/dtl/all/test_v1_package/CMakeLists.txt b/recipes/dtl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/dtl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/dtl/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", "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/dtl/config.yml b/recipes/dtl/config.yml index 66e68aaaf6fad..c7b2d5892fa8b 100644 --- a/recipes/dtl/config.yml +++ b/recipes/dtl/config.yml @@ -1,7 +1,7 @@ versions: + "1.21": + folder: "all" "1.20": folder: "all" "1.19": folder: "all" - "cci.20210404": - folder: "all" diff --git a/recipes/duckdb/all/conandata.yml b/recipes/duckdb/all/conandata.yml index 82ad639285d87..8b2ec0fe0cfc7 100644 --- a/recipes/duckdb/all/conandata.yml +++ b/recipes/duckdb/all/conandata.yml @@ -1,66 +1,79 @@ sources: + "1.1.3": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v1.1.3.tar.gz" + sha256: "2aea0af898ad753fee82b776fea1bf78ccbc9648986e7f7a87372df5e74cdb98" + "1.1.2": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v1.1.2.tar.gz" + sha256: "a3319a64c390ed0454c869b2e4fc0af2413cd49f55cd0f1400aaed9069cdbc4c" + "1.1.1": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v1.1.1.tar.gz" + sha256: "a764cef80287ccfd8555884d8facbe962154e7c747043c0842cd07873b4d6752" + "1.1.0": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v1.1.0.tar.gz" + sha256: "d9be2c6d3a5ebe2b3d33044fb2cb535bb0bd972a27ae38c4de5e1b4caa4bf68d" + "1.0.0": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v1.0.0.tar.gz" + sha256: "04e472e646f5cadd0a3f877a143610674b0d2bcf9f4102203ac3c3d02f1c5f26" + "0.10.2": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.10.2.tar.gz" + sha256: "662a0ba5c35d678ab6870db8f65ffa1c72e6096ad525a35b41b275139684cea6" + "0.10.1": + url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.10.1.tar.gz" + sha256: "83bd4944c070fd0bd287fbe62919fa887f35d7422ba0fa66e13d4ed098f3791a" "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" - "0.6.1": - url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.1.tar.gz" - sha256: "ea9bba89ae3e461f3fc9f83911b2f3b6c386c23463bcf7b1ed6bb4cc13e822a4" - "0.6.0": - url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.6.0.tar.gz" - sha256: "700b09114f8b99892a9d19ba21ca962ae65d1ea8085622418a2fa50ff915b244" - "0.5.1": - 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" + "1.1.3": + - patch_file: "patches/1.1.1-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_file: "patches/1.1.1-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" + "1.1.2": + - patch_file: "patches/1.1.1-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_file: "patches/1.1.1-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" + "1.1.1": + - patch_file: "patches/1.1.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_file: "patches/1.1.1-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" + "1.1.0": + - patch_file: "patches/1.1.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_file: "patches/1.1.0-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" + "1.0.0": + - patch_file: "patches/1.0.0-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" patch_type: "portability" - "0.6.1": - - patch_file: "patches/0.6.0-0001-fix-cmake.patch" + - patch_file: "patches/1.0.0-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" + patch_type: "portability" + "0.10.2": + - patch_file: "patches/0.10.2-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_file: "patches/0.10.1-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" 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" + "0.10.1": + - patch_file: "patches/0.10.1-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" patch_type: "portability" - - patch_file: "patches/0.6.0-0002-include-stdlib.patch" - patch_description: "include stdlib for abort function" + - patch_file: "patches/0.10.1-0002-msvc-bicobj.patch" + patch_description: "add /bigobj flag" 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" + "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" diff --git a/recipes/duckdb/all/conanfile.py b/recipes/duckdb/all/conanfile.py index 2010b8b18210e..bc6bf23afbd34 100644 --- a/recipes/duckdb/all/conanfile.py +++ b/recipes/duckdb/all/conanfile.py @@ -1,7 +1,7 @@ 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.build import check_min_cppstd, cross_building from conan.tools.scm import Version from conan.tools.microsoft import is_msvc from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout @@ -9,7 +9,7 @@ import glob import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class DuckdbConan(ConanFile): name = "duckdb" @@ -23,15 +23,16 @@ class DuckdbConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_autocomplete": [True, False], "with_icu": [True, False], - "with_parquet": [True, False], "with_tpch": [True, False], "with_tpcds": [True, False], "with_fts": [True, False], - "with_httpfs": [True, False], "with_visualizer": [True, False], + "with_httpfs": [True, False], "with_json": [True, False], "with_excel": [True, False], + "with_inet": [True, False], "with_sqlsmith": [True, False], "with_odbc": [True, False], "with_query_log": [True, False], @@ -42,15 +43,16 @@ class DuckdbConan(ConanFile): default_options = { "shared": False, "fPIC": True, + "with_autocomplete": False, "with_icu": False, - "with_parquet": False, "with_tpch": False, "with_tpcds": False, "with_fts": False, - "with_httpfs": False, "with_visualizer": False, + "with_httpfs": False, "with_json": False, "with_excel": False, + "with_inet": False, "with_sqlsmith": False, "with_odbc": False, "with_query_log": False, @@ -70,8 +72,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 + if Version(self.version) >= "1.1.0": + del self.options.with_odbc def configure(self): if self.options.shared: @@ -82,7 +84,7 @@ def layout(self): def requirements(self): # FIXME: duckdb vendors a bunch of deps by modify the source code to have their own namespace - if self.options.with_odbc: + if self.options.get_safe("with_odbc"): self.requires("odbc/2.3.11") if self.options.with_httpfs: self.requires("openssl/[>=1.1 <4]") @@ -92,7 +94,7 @@ def validate(self): 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": + 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): @@ -104,18 +106,35 @@ def generate(self): tc.variables["DUCKDB_MINOR_VERSION"] = Version(self.version).minor tc.variables["DUCKDB_PATCH_VERSION"] = Version(self.version).patch tc.variables["DUCKDB_DEV_ITERATION"] = 0 - tc.variables["BUILD_ICU_EXTENSION"] = self.options.with_icu - 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 - tc.variables["BUILD_HTTPFS_EXTENSION"] = self.options.with_httpfs - tc.variables["BUILD_VISUALIZER_EXTENSION"] = self.options.with_visualizer - tc.variables["BUILD_JSON_EXTENSION"] = self.options.with_json - tc.variables["BUILD_EXCEL_EXTENSION"] = self.options.with_excel - tc.variables["BUILD_SQLSMITH_EXTENSION"] = self.options.with_sqlsmith - tc.variables["BUILD_ODBC_DRIVER"] = self.options.with_odbc + tc.variables["OVERRIDE_GIT_DESCRIBE"] = f"v{self.version}" + + build_extensions = "" + if self.options.with_icu: + build_extensions += ";icu" + if self.options.with_autocomplete: + build_extensions += ";autocomplete" + if self.options.with_tpch: + build_extensions += ";tpch" + if self.options.with_tpcds: + build_extensions += ";tpcds" + if self.options.with_fts: + build_extensions += ";fts" + if self.options.with_visualizer: + build_extensions += ";visualizer" + if self.options.with_httpfs: + build_extensions += ";httpfs" + if self.options.with_json: + build_extensions += ";json" + if self.options.with_excel: + build_extensions += ";excel" + if self.options.with_inet: + build_extensions += ";inet" + if self.options.with_sqlsmith: + build_extensions += ";sqlsmith" + tc.variables["BUILD_EXTENSIONS"] = build_extensions + + if "with_odbc" in self.options: + tc.variables["BUILD_ODBC_DRIVER"] = self.options.with_odbc tc.variables["FORCE_QUERY_LOG"] = self.options.with_query_log tc.variables["BUILD_SHELL"] = self.options.with_shell tc.variables["DISABLE_THREADS"] = not self.options.with_threads @@ -126,6 +145,8 @@ def generate(self): tc.variables["ENABLE_UBSAN"] = False if is_msvc(self) and not self.options.shared: tc.preprocessor_definitions["DUCKDB_API"] = "" + if Version(self.version) >= "0.10.0" and cross_building(self): + tc.variables["DUCKDB_EXPLICIT_PLATFORM"] = f"{self.settings.os}_{self.settings.arch}" tc.generate() dpes = CMakeDeps(self) @@ -135,13 +156,13 @@ def build(self): apply_conandata_patches(self) if is_msvc(self) and not self.options.shared: replace_in_file(self, os.path.join(self.source_folder, "src", "include", "duckdb.h"), - "#define DUCKDB_API __declspec(dllimport)", - "#define DUCKDB_API" - ) + "#define DUCKDB_API __declspec(dllimport)", + "#define DUCKDB_API" + ) replace_in_file(self, os.path.join(self.source_folder, "src", "include", "duckdb", "common", "winapi.hpp"), - "#define DUCKDB_API __declspec(dllimport)", - "#define DUCKDB_API" - ) + "#define DUCKDB_API __declspec(dllimport)", + "#define DUCKDB_API" + ) cmake = CMake(self) cmake.configure() @@ -176,9 +197,14 @@ def package_info(self): "duckdb_fastpforlib", "duckdb_mbedtls", ] - if Version(self.version) >= "0.6.0": - self.cpp_info.libs.append("duckdb_fsst") - + self.cpp_info.libs.append("duckdb_fsst") + if Version(self.version) >= "0.10.0": + self.cpp_info.libs.append("duckdb_skiplistlib") + if Version(self.version) >= "0.10.3": + self.cpp_info.libs.append("duckdb_yyjson") + + if self.options.with_autocomplete: + self.cpp_info.libs.append("autocomplete_extension") if self.options.with_icu: self.cpp_info.libs.append("icu_extension") if self.options.get_safe("with_parquet", True): @@ -189,16 +215,19 @@ def package_info(self): self.cpp_info.libs.append("tpcds_extension") if self.options.with_fts: self.cpp_info.libs.append("fts_extension") - if self.options.with_httpfs: - self.cpp_info.libs.append("httpfs_extension") if self.options.with_visualizer: self.cpp_info.libs.append("visualizer_extension") - if Version(self.version) >= "0.6.0" and self.settings.os == "Linux": + if self.options.with_httpfs: + self.cpp_info.libs.append("httpfs_extension") + if (self.settings.os == "Linux" and + (Version(self.version) < "0.10.1" or self.settings.arch == "x86_64")): self.cpp_info.libs.append("jemalloc_extension") if self.options.with_json: self.cpp_info.libs.append("json_extension") if self.options.with_excel: self.cpp_info.libs.append("excel_extension") + if self.options.with_inet: + self.cpp_info.libs.append("inet_extension") if self.options.with_sqlsmith: self.cpp_info.libs.append("sqlsmith_extension") @@ -207,8 +236,5 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") - - if self.options.with_shell: - binpath = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH env var: {binpath}") - self.env_info.PATH.append(binpath) + if Version(self.version) >= "0.10.0": + self.cpp_info.system_libs.extend(["rstrtmgr", "bcrypt"]) diff --git a/recipes/duckdb/all/patches/0.10.1-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.10.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..7843bec6ccf0e --- /dev/null +++ b/recipes/duckdb/all/patches/0.10.1-0001-fix-cmake.patch @@ -0,0 +1,118 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aebc060..4698e32 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -836,7 +836,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 d45ae7f..c13ca96 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -92,21 +92,21 @@ else() + duckdb_fastpforlib + duckdb_skiplistlib + 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 $ + $) +@@ -121,10 +121,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 baf7823..4bef643 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -38,6 +38,14 @@ add_library(duckdb_odbc SHARED ${ALL_OBJECT_FILES} duckdb_odbc.def) + 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) + endif() +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e29c33e..fb926b5 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,20 +26,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.10.1-0002-msvc-bicobj.patch b/recipes/duckdb/all/patches/0.10.1-0002-msvc-bicobj.patch new file mode 100644 index 0000000000000..4dd0c46e33839 --- /dev/null +++ b/recipes/duckdb/all/patches/0.10.1-0002-msvc-bicobj.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aebc060..4a696b6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -508,7 +508,7 @@ if(NOT MSVC) + endif() + else() + set(CMAKE_CXX_WINDOWS_FLAGS +- "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8") ++ "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8 /bigobj") + if(TREAT_WARNINGS_AS_ERRORS) + set(CMAKE_CXX_WINDOWS_FLAGS "${CMAKE_CXX_WINDOWS_FLAGS} /WX") + endif() diff --git a/recipes/duckdb/all/patches/0.10.2-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.10.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..a64da2a33b94d --- /dev/null +++ b/recipes/duckdb/all/patches/0.10.2-0001-fix-cmake.patch @@ -0,0 +1,137 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5f199d3..64c86c6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -816,12 +816,12 @@ function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY EXTENSION_VERS + COMMAND emcc $.lib -o $ -sSIDE_MODULE=1 -O3 + ) + endif() +- add_custom_command( +- TARGET ${TARGET_NAME} +- POST_BUILD +- COMMAND +- ${CMAKE_COMMAND} -DEXTENSION=$ -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DDUCKDB_VERSION="${DUCKDB_NORMALIZED_VERSION}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/scripts/null.txt -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/scripts/append_metadata.cmake +- ) ++ # add_custom_command( ++ # TARGET ${TARGET_NAME} ++ # POST_BUILD ++ # COMMAND ++ # ${CMAKE_COMMAND} -DEXTENSION=$ -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DDUCKDB_VERSION="${DUCKDB_NORMALIZED_VERSION}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/scripts/null.txt -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/scripts/append_metadata.cmake ++ # ) + add_dependencies(${TARGET_NAME} duckdb_platform) + if (NOT EXTENSION_CONFIG_BUILD AND NOT ${EXTENSION_TESTS_ONLY} AND NOT CLANG_TIDY) + add_dependencies(duckdb_local_extension_repo ${TARGET_NAME}) +@@ -842,7 +842,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 d45ae7f..c13ca96 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -92,21 +92,21 @@ else() + duckdb_fastpforlib + duckdb_skiplistlib + 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 $ + $) +@@ -121,10 +121,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 baf7823..4bef643 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -38,6 +38,14 @@ add_library(duckdb_odbc SHARED ${ALL_OBJECT_FILES} duckdb_odbc.def) + 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) + endif() +diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e29c33e..fb926b5 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,20 +26,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.5.1-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.5.1-0001-fix-cmake.patch deleted file mode 100644 index 4c586f0038760..0000000000000 --- a/recipes/duckdb/all/patches/0.5.1-0001-fix-cmake.patch +++ /dev/null @@ -1,82 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cc43104..5b034d2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -196,6 +196,8 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") - set(SUN TRUE) - endif() - -+if(0) # conan patch -+ - execute_process( - COMMAND git log -1 --format=%h - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -@@ -236,6 +238,10 @@ else() - set(DUCKDB_VERSION "v${DUCKDB_MAJOR_VERSION}.${DUCKDB_MINOR_VERSION}.${DUCKDB_PATCH_VERSION}-dev${DUCKDB_DEV_ITERATION}") - endif() - -+else() # conan patch -+set(DUCKDB_VERSION "v${DUCKDB_MAJOR_VERSION}.${DUCKDB_MINOR_VERSION}.${DUCKDB_PATCH_VERSION}-dev${DUCKDB_DEV_ITERATION}") -+endif() # conan patch -+ - option(AMALGAMATION_BUILD - "Build from the amalgamation files, rather than from the normal sources." - FALSE) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 7e07a47..8027d90 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -166,9 +166,18 @@ if(BUILD_PYTHON - endif() - endif() - --install( -- TARGETS duckdb duckdb_static -- EXPORT "${DUCKDB_EXPORT_SET}" -- LIBRARY DESTINATION "${INSTALL_LIB_DIR}" -- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" -- RUNTIME DESTINATION "${INSTALL_BIN_DIR}") -+if(BUILD_SHARED_LIBS) -+ install( -+ 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 9d116b9..b46e5bd 100644 ---- a/tools/odbc/CMakeLists.txt -+++ b/tools/odbc/CMakeLists.txt -@@ -53,3 +53,11 @@ 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} -+) -diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt -index cef9622..ca7e1f1 100644 ---- a/tools/sqlite3_api_wrapper/CMakeLists.txt -+++ b/tools/sqlite3_api_wrapper/CMakeLists.txt -@@ -14,7 +14,7 @@ add_library(sqlite3_api_wrapper_static STATIC sqlite3_api_wrapper.cpp - target_link_libraries(sqlite3_api_wrapper_static duckdb_static duckdb_utf8proc) - link_threads(sqlite3_api_wrapper_static) - --if(NOT WIN32) -+if(BUILD_SHARED_LIBS AND NOT WIN32) - add_library(sqlite3_api_wrapper SHARED sqlite3_api_wrapper.cpp - ${ALL_OBJECT_FILES}) - target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS}) diff --git a/recipes/duckdb/all/patches/0.6.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.6.0-0001-fix-cmake.patch deleted file mode 100644 index d43649a21a753..0000000000000 --- a/recipes/duckdb/all/patches/0.6.0-0001-fix-cmake.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index b1bb843..4a4949c 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -167,9 +167,18 @@ if(BUILD_PYTHON - endif() - endif() - --install( -- TARGETS duckdb duckdb_static -- EXPORT "${DUCKDB_EXPORT_SET}" -- LIBRARY DESTINATION "${INSTALL_LIB_DIR}" -- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" -- RUNTIME DESTINATION "${INSTALL_BIN_DIR}") -+if(BUILD_SHARED_LIBS) -+ install( -+ 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 9d116b9..b46e5bd 100644 ---- a/tools/odbc/CMakeLists.txt -+++ b/tools/odbc/CMakeLists.txt -@@ -53,3 +53,11 @@ 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} -+) -diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt -index e785d4f..922746f 100644 ---- a/tools/sqlite3_api_wrapper/CMakeLists.txt -+++ b/tools/sqlite3_api_wrapper/CMakeLists.txt -@@ -17,7 +17,7 @@ add_library(sqlite3_api_wrapper_static STATIC ${SQLITE_API_WRAPPER_FILES}) - target_link_libraries(sqlite3_api_wrapper_static duckdb_static duckdb_utf8proc) - 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.6.0-0002-include-stdlib.patch b/recipes/duckdb/all/patches/0.6.0-0002-include-stdlib.patch deleted file mode 100644 index e9e04e59a49cc..0000000000000 --- a/recipes/duckdb/all/patches/0.6.0-0002-include-stdlib.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/extension/jemalloc/jemalloc/include/jemalloc/internal/jemalloc_preamble.h b/extension/jemalloc/jemalloc/include/jemalloc/internal/jemalloc_preamble.h -index 47455cb..cfd73bc 100644 ---- a/extension/jemalloc/jemalloc/include/jemalloc/internal/jemalloc_preamble.h -+++ b/extension/jemalloc/jemalloc/include/jemalloc/internal/jemalloc_preamble.h -@@ -4,6 +4,7 @@ - #include - #include - #include -+#include - - #include "jemalloc/internal/jemalloc_internal_defs.h" - #include "jemalloc/internal/jemalloc_internal_decls.h" diff --git a/recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch deleted file mode 100644 index 0ba6b7e472f9a..0000000000000 --- a/recipes/duckdb/all/patches/0.7.0-0001-fix-cmake.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 99cd46c..3f3d039 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -182,9 +182,18 @@ if(BUILD_PYTHON - endif() - endif() - --install( -- TARGETS duckdb duckdb_static -- EXPORT "${DUCKDB_EXPORT_SET}" -- LIBRARY DESTINATION "${INSTALL_LIB_DIR}" -- ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" -- RUNTIME DESTINATION "${INSTALL_BIN_DIR}") -+if(BUILD_SHARED_LIBS) -+ install( -+ 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 e785d4f..922746f 100644 ---- a/tools/sqlite3_api_wrapper/CMakeLists.txt -+++ b/tools/sqlite3_api_wrapper/CMakeLists.txt -@@ -17,7 +17,7 @@ add_library(sqlite3_api_wrapper_static STATIC ${SQLITE_API_WRAPPER_FILES}) - target_link_libraries(sqlite3_api_wrapper_static duckdb_static duckdb_utf8proc) - 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.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/0.8.0-0001-fix-cmake.patch deleted file mode 100644 index 6daffba956a1a..0000000000000 --- a/recipes/duckdb/all/patches/0.8.0-0001-fix-cmake.patch +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100644 index 5cd9417ef53c9..0000000000000 --- a/recipes/duckdb/all/patches/0.8.1-0001-fix-cmake.patch +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100644 index 40ae0d24ebe51..0000000000000 --- a/recipes/duckdb/all/patches/0.9.0-0001-fix-cmake.patch +++ /dev/null @@ -1,122 +0,0 @@ -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/1.0.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/1.0.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..a557864ae780a --- /dev/null +++ b/recipes/duckdb/all/patches/1.0.0-0001-fix-cmake.patch @@ -0,0 +1,125 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ec66b57..6321321 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -843,12 +843,12 @@ function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY EXTENSION_VERS + COMMAND emcc $ -o $.wasm -O3 -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="_${NAME}_init,_${NAME}_version" ${WASM_THREAD_FLAGS} ${TO_BE_LINKED} + ) + endif() +- add_custom_command( +- TARGET ${TARGET_NAME} +- POST_BUILD +- COMMAND +- ${CMAKE_COMMAND} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DDUCKDB_VERSION="${DUCKDB_NORMALIZED_VERSION}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake +- ) ++ # add_custom_command( ++ # TARGET ${TARGET_NAME} ++ # POST_BUILD ++ # COMMAND ++ # ${CMAKE_COMMAND} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DDUCKDB_VERSION="${DUCKDB_NORMALIZED_VERSION}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake ++ # ) + add_dependencies(${TARGET_NAME} duckdb_platform) + if (NOT EXTENSION_CONFIG_BUILD AND NOT ${EXTENSION_TESTS_ONLY} AND NOT CLANG_TIDY) + add_dependencies(duckdb_local_extension_repo ${TARGET_NAME}) +@@ -869,7 +869,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 06c0c9a..ac1c4ad 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -93,21 +93,21 @@ else() + duckdb_skiplistlib + duckdb_mbedtls + duckdb_yyjson) +- ++ 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 $ + $) +@@ -123,10 +123,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 baf7823..4447d26 100644 +--- a/tools/odbc/CMakeLists.txt ++++ b/tools/odbc/CMakeLists.txt +@@ -37,6 +37,13 @@ add_library(duckdb_odbc SHARED ${ALL_OBJECT_FILES} duckdb_odbc.def) + + 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 e29c33e..9e387f9 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,12 +26,12 @@ 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() +- ++if(0) + include_directories(../../third_party/catch) + + include_directories(test/include) +@@ -43,3 +43,4 @@ if(WIN32 OR ZOS) + else() + target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) + endif() ++endif() diff --git a/recipes/duckdb/all/patches/1.0.0-0002-msvc-bicobj.patch b/recipes/duckdb/all/patches/1.0.0-0002-msvc-bicobj.patch new file mode 100644 index 0000000000000..ddefcf5673104 --- /dev/null +++ b/recipes/duckdb/all/patches/1.0.0-0002-msvc-bicobj.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 50d10e8..a06f30c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -537,7 +537,7 @@ if(NOT MSVC) + endif() + else() + set(CMAKE_CXX_WINDOWS_FLAGS +- "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8") ++ "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8 /bigobj") + if(TREAT_WARNINGS_AS_ERRORS) + set(CMAKE_CXX_WINDOWS_FLAGS "${CMAKE_CXX_WINDOWS_FLAGS} /WX") + endif() diff --git a/recipes/duckdb/all/patches/1.1.0-0001-fix-cmake.patch b/recipes/duckdb/all/patches/1.1.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..988bca9f377f1 --- /dev/null +++ b/recipes/duckdb/all/patches/1.1.0-0001-fix-cmake.patch @@ -0,0 +1,110 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7dc2bb7..89c0adc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -896,12 +896,12 @@ function(build_loadable_extension_directory NAME ABI_TYPE OUTPUT_DIRECTORY EXTEN + set(FOOTER_VERSION_VALUE ${CAPI_VERSION}) + endif() + +- add_custom_command( +- TARGET ${TARGET_NAME} +- POST_BUILD +- COMMAND +- ${CMAKE_COMMAND} -DABI_TYPE=${ABI_TYPE} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DVERSION_FIELD="${FOOTER_VERSION_VALUE}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake +- ) ++ # add_custom_command( ++ # TARGET ${TARGET_NAME} ++ # POST_BUILD ++ # COMMAND ++ # ${CMAKE_COMMAND} -DABI_TYPE=${ABI_TYPE} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DVERSION_FIELD="${FOOTER_VERSION_VALUE}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake ++ # ) + add_dependencies(${TARGET_NAME} duckdb_platform) + if (NOT EXTENSION_CONFIG_BUILD AND NOT ${EXTENSION_TESTS_ONLY} AND NOT CLANG_TIDY) + add_dependencies(duckdb_local_extension_repo ${TARGET_NAME}) +@@ -931,7 +931,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 3e757a4..957f0e4 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -109,7 +109,7 @@ else() + duckdb_skiplistlib + duckdb_mbedtls + duckdb_yyjson) +- ++ if(BUILD_SHARED_LIBS) + add_library(duckdb SHARED ${ALL_OBJECT_FILES}) + + if(WIN32 AND NOT MINGW) +@@ -135,16 +135,16 @@ else() + 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 $ + $) +@@ -160,10 +160,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/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e29c33e..9e387f9 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,12 +26,12 @@ 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() +- ++if(0) + include_directories(../../third_party/catch) + + include_directories(test/include) +@@ -43,3 +43,4 @@ if(WIN32 OR ZOS) + else() + target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) + endif() ++endif() diff --git a/recipes/duckdb/all/patches/1.1.0-0002-msvc-bicobj.patch b/recipes/duckdb/all/patches/1.1.0-0002-msvc-bicobj.patch new file mode 100644 index 0000000000000..838678649e638 --- /dev/null +++ b/recipes/duckdb/all/patches/1.1.0-0002-msvc-bicobj.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 89c0adc..af5b786 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -574,7 +574,7 @@ if(NOT MSVC) + endif() + else() + set(CMAKE_CXX_WINDOWS_FLAGS +- "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8") ++ "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8 /bigobj") + if(TREAT_WARNINGS_AS_ERRORS) + set(CMAKE_CXX_WINDOWS_FLAGS "${CMAKE_CXX_WINDOWS_FLAGS} /WX") + endif() diff --git a/recipes/duckdb/all/patches/1.1.1-0001-fix-cmake.patch b/recipes/duckdb/all/patches/1.1.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..426c745da3cdf --- /dev/null +++ b/recipes/duckdb/all/patches/1.1.1-0001-fix-cmake.patch @@ -0,0 +1,110 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5c2503e..f7ab0e8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -892,12 +892,12 @@ function(build_loadable_extension_directory NAME ABI_TYPE OUTPUT_DIRECTORY EXTEN + set(FOOTER_VERSION_VALUE ${CAPI_VERSION}) + endif() + +- add_custom_command( +- TARGET ${TARGET_NAME} +- POST_BUILD +- COMMAND +- ${CMAKE_COMMAND} -DABI_TYPE=${ABI_TYPE} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DVERSION_FIELD="${FOOTER_VERSION_VALUE}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake +- ) ++ # add_custom_command( ++ # TARGET ${TARGET_NAME} ++ # POST_BUILD ++ # COMMAND ++ # ${CMAKE_COMMAND} -DABI_TYPE=${ABI_TYPE} -DEXTENSION=$${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DVERSION_FIELD="${FOOTER_VERSION_VALUE}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake ++ # ) + add_dependencies(${TARGET_NAME} duckdb_platform) + if (NOT EXTENSION_CONFIG_BUILD AND NOT ${EXTENSION_TESTS_ONLY} AND NOT CLANG_TIDY) + add_dependencies(duckdb_local_extension_repo ${TARGET_NAME}) +@@ -927,7 +927,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 3e757a4..957f0e4 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -109,7 +109,7 @@ else() + duckdb_skiplistlib + duckdb_mbedtls + duckdb_yyjson) +- ++ if(BUILD_SHARED_LIBS) + add_library(duckdb SHARED ${ALL_OBJECT_FILES}) + + if(WIN32 AND NOT MINGW) +@@ -135,16 +135,16 @@ else() + 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 $ + $) +@@ -160,10 +160,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/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt +index e29c33e..9e387f9 100644 +--- a/tools/sqlite3_api_wrapper/CMakeLists.txt ++++ b/tools/sqlite3_api_wrapper/CMakeLists.txt +@@ -26,12 +26,12 @@ 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() +- ++if(0) + include_directories(../../third_party/catch) + + include_directories(test/include) +@@ -43,3 +43,4 @@ if(WIN32 OR ZOS) + else() + target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper) + endif() ++endif() diff --git a/recipes/duckdb/all/patches/1.1.1-0002-msvc-bicobj.patch b/recipes/duckdb/all/patches/1.1.1-0002-msvc-bicobj.patch new file mode 100644 index 0000000000000..b8385d1df35d3 --- /dev/null +++ b/recipes/duckdb/all/patches/1.1.1-0002-msvc-bicobj.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f7ab0e8..a00353d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -570,7 +570,7 @@ if(NOT MSVC) + endif() + else() + set(CMAKE_CXX_WINDOWS_FLAGS +- "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8") ++ "/wd4244 /wd4267 /wd4200 /wd26451 /wd26495 /D_CRT_SECURE_NO_WARNINGS /utf-8 /bigobj") + if(TREAT_WARNINGS_AS_ERRORS) + set(CMAKE_CXX_WINDOWS_FLAGS "${CMAKE_CXX_WINDOWS_FLAGS} /WX") + endif() diff --git a/recipes/duckdb/all/test_package/CMakeLists.txt b/recipes/duckdb/all/test_package/CMakeLists.txt index 139856fb65898..00f9c96e30be6 100644 --- a/recipes/duckdb/all/test_package/CMakeLists.txt +++ b/recipes/duckdb/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(duckdb REQUIRED CONFIG) diff --git a/recipes/duckdb/all/test_v1_package/CMakeLists.txt b/recipes/duckdb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/duckdb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/duckdb/all/test_v1_package/conanfile.py b/recipes/duckdb/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/duckdb/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/duckdb/config.yml b/recipes/duckdb/config.yml index 77e20cf10a797..edd51719c20ac 100644 --- a/recipes/duckdb/config.yml +++ b/recipes/duckdb/config.yml @@ -1,17 +1,17 @@ versions: - "0.9.2": + "1.1.3": folder: "all" - "0.9.0": + "1.1.2": folder: "all" - "0.8.1": + "1.1.1": folder: "all" - "0.8.0": + "1.1.0": folder: "all" - "0.7.1": + "1.0.0": folder: "all" - "0.6.1": + "0.10.2": folder: "all" - "0.6.0": + "0.10.1": folder: "all" - "0.5.1": + "0.9.2": folder: "all" diff --git a/recipes/duckx/all/conandata.yml b/recipes/duckx/all/conandata.yml new file mode 100644 index 0000000000000..f22f7365670c4 --- /dev/null +++ b/recipes/duckx/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.2.2": + url: "https://github.com/amiremohamadi/DuckX/archive/refs/tags/v1.2.2.tar.gz" + sha256: "ca924b9dc3a38184f617d2ec96b91deae3f06caf42a4508c23dd9943dcf9da39" +patches: + "1.2.2": + - patch_file: "patches/0001-use-cci.patch" + patch_description: "use cci packages" + patch_type: "conan" diff --git a/recipes/duckx/all/conanfile.py b/recipes/duckx/all/conanfile.py new file mode 100644 index 0000000000000..8afefe6cb2eb7 --- /dev/null +++ b/recipes/duckx/all/conanfile.py @@ -0,0 +1,83 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.53.0" + +class DuckxConan(ConanFile): + name = "duckx" + description = " C++ library for creating and updating Microsoft Word (.docx) files." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/amiremohamadi/DuckX/" + topics = ("docx", "docx-files", "office") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": False, + "pugixml/*:header_only": 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("pugixml/1.14", transitive_headers=True) + self.requires("kuba-zip/0.3.1", transitive_headers=True) + + def validate(self): + if self.info.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if not self.dependencies["pugixml"].options.header_only: + raise ConanInvalidConfiguration(f"{self.ref} requires header_only pugixml.") + + 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["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + 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, "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")) + + def package_info(self): + self.cpp_info.libs = ["duckx"] + diff --git a/recipes/duckx/all/patches/0001-use-cci.patch b/recipes/duckx/all/patches/0001-use-cci.patch new file mode 100644 index 0000000000000..fc24422c57061 --- /dev/null +++ b/recipes/duckx/all/patches/0001-use-cci.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f452186..14a8c03 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,15 +9,19 @@ endif() + option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF) + option(BUILD_SAMPLE "Build provided sample" OFF) + +-set(HEADERS src/duckx.hpp src/zip.h src/miniz.h +- src/pugixml.hpp src/pugiconfig.hpp) +-set(SOURCES src/duckx.cpp src/zip.c src/pugixml.cpp) ++find_package(pugixml REQUIRED CONFIG) ++find_package(zip REQUIRED CONFIG) ++ ++set(HEADERS src/duckx.hpp ++ ) ++set(SOURCES src/duckx.cpp) + + if(BUILD_SHARED_LIBS) + add_library(duckx SHARED ${HEADERS} ${SOURCES}) + else() + add_library(duckx STATIC ${HEADERS} ${SOURCES}) + endif() ++target_link_libraries(duckx PRIVATE pugixml::pugixml zip::zip) + + add_library(duckx::duckx ALIAS duckx) + +diff --git a/src/duckx.cpp b/src/duckx.cpp +index 7379d02..4d66e62 100644 +--- a/src/duckx.cpp ++++ b/src/duckx.cpp +@@ -292,7 +292,7 @@ void duckx::Document::save() const { + // Open the original zip and copy all files which are not replaced by duckX + zip_t* orig_zip = zip_open(original_file.c_str(), ZIP_DEFAULT_COMPRESSION_LEVEL, 'r'); + // Loop & copy each relevant entry in the original zip +- int orig_zip_entry_ct = zip_total_entries(orig_zip); ++ int orig_zip_entry_ct = zip_entries_total(orig_zip); + for (int i = 0; i < orig_zip_entry_ct; i++) + { + zip_entry_openbyindex(orig_zip, i); +diff --git a/src/duckx.hpp b/src/duckx.hpp +index fd54d10..c3350d3 100644 +--- a/src/duckx.hpp ++++ b/src/duckx.hpp +@@ -12,7 +12,7 @@ + #include + + #include "pugixml.hpp" +-#include "zip.h" ++#include "zip/zip.h" + + + // TODO: Use container-iterator design pattern! diff --git a/recipes/duckx/all/test_package/CMakeLists.txt b/recipes/duckx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fc42d4028cd4f --- /dev/null +++ b/recipes/duckx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(duckx REQUIRED CONFDIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE duckx::duckx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/objectbox/all/test_package/conanfile.py b/recipes/duckx/all/test_package/conanfile.py similarity index 100% rename from recipes/objectbox/all/test_package/conanfile.py rename to recipes/duckx/all/test_package/conanfile.py diff --git a/recipes/duckx/all/test_package/test_package.cpp b/recipes/duckx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..053be6a46c0e6 --- /dev/null +++ b/recipes/duckx/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include "duckx.hpp" + +int main() { + duckx::Document doc{}; + + return 0; +} diff --git a/recipes/duckx/config.yml b/recipes/duckx/config.yml new file mode 100644 index 0000000000000..af40d9653a378 --- /dev/null +++ b/recipes/duckx/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.2": + folder: all diff --git a/recipes/duktape/all/test_v1_package/CMakeLists.txt b/recipes/duktape/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/duktape/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index d47b5097e761e..0000000000000 --- a/recipes/duktape/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/test_package/CMakeLists.txt b/recipes/dylib/all/test_package/CMakeLists.txt index b3c80ba7c695b..fad30266e6beb 100644 --- a/recipes/dylib/all/test_package/CMakeLists.txt +++ b/recipes/dylib/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) enable_testing() diff --git a/recipes/earcut/all/test_v1_package/CMakeLists.txt b/recipes/earcut/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index cf60ef4f067f3..0000000000000 --- a/recipes/earcut/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/earcut/all/test_v1_package/conanfile.py b/recipes/earcut/all/test_v1_package/conanfile.py deleted file mode 100644 index a8c92dea63335..0000000000000 --- a/recipes/earcut/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/eastl/all/conanfile.py b/recipes/eastl/all/conanfile.py index 0e2ac3111ed3a..67d07a329b25e 100644 --- a/recipes/eastl/all/conanfile.py +++ b/recipes/eastl/all/conanfile.py @@ -15,7 +15,7 @@ from conan.tools.microsoft import is_msvc, check_min_vs from conan.tools.scm import Version -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class EastlConan(ConanFile): @@ -80,7 +80,7 @@ def validate(self): 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") @@ -92,6 +92,8 @@ def generate(self): tc.variables["EASTL_BUILD_BENCHMARK"] = False tc.variables["EASTL_BUILD_TESTS"] = False tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + if Version(self.version) < "3.21.23": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() CMakeDeps(self).generate() @@ -136,9 +138,3 @@ def package_info(self): 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/easy_profiler/all/test_v1_package/CMakeLists.txt b/recipes/easy_profiler/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/easy_profiler/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/easy_profiler/all/test_v1_package/conanfile.py b/recipes/easy_profiler/all/test_v1_package/conanfile.py deleted file mode 100644 index 8037a9296cc42..0000000000000 --- a/recipes/easy_profiler/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -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/easyexif/all/CMakeLists.txt b/recipes/easyexif/all/CMakeLists.txt index de50a2ead5152..0e4ae0258643c 100644 --- a/recipes/easyexif/all/CMakeLists.txt +++ b/recipes/easyexif/all/CMakeLists.txt @@ -1,6 +1,8 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(easyexif) +include(GNUInstallDirs) + set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_STANDARD 11) @@ -8,12 +10,14 @@ if(WIN32 AND BUILD_SHARED_LIBS) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() -add_library(easyexif exif.cpp) -target_include_directories(easyexif PUBLIC exif.h) +add_library(easyexif ${EASYEXIF_SRC_DIR}/exif.cpp) +target_include_directories(easyexif PUBLIC ${EASYEXIF_SRC_DIR}/exif.h) +set_target_properties( + easyexif + PROPERTIES + PUBLIC_HEADER "${EASYEXIF_SRC_DIR}/exif.h" +) install(TARGETS easyexif - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) -install(FILES exif.h DESTINATION include/easyexif) - + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/easyexif +) diff --git a/recipes/easyexif/all/conanfile.py b/recipes/easyexif/all/conanfile.py index c2f91926a073b..8b47ebbc93442 100644 --- a/recipes/easyexif/all/conanfile.py +++ b/recipes/easyexif/all/conanfile.py @@ -10,12 +10,13 @@ class EasyExifConan(ConanFile): name = "easyexif" description = "Tiny ISO-compliant C++ EXIF parsing library, third-party dependency free." - topics = ("conan", "exif", "image", "multimedia", "format", "graphics") + topics = ("exif", "image", "multimedia", "format", "graphics") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mayanklahiri/easyexif" license = "BSD-2-Clause" - exports_sources = "CMakeLists.txt" + settings = "os", "compiler", "build_type", "arch" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False] @@ -30,23 +31,31 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + @property + def _min_cppstd(self): + return 11 + def validate(self): - if self.info.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, 11) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) def layout(self): - cmake_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) def generate(self): tc = CMakeToolchain(self) + tc.variables["EASYEXIF_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.generate() def build(self): cmake = CMake(self) - cmake.configure() + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() def package(self): @@ -56,3 +65,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["easyexif"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/easyexif/all/test_package/CMakeLists.txt b/recipes/easyexif/all/test_package/CMakeLists.txt index 2cf2b33919697..418b220626ca8 100644 --- a/recipes/easyexif/all/test_package/CMakeLists.txt +++ b/recipes/easyexif/all/test_package/CMakeLists.txt @@ -1,10 +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) # if the project uses c++ -add_executable(example example.cpp) +find_package(easyexif REQUIRED CONFIG) -set_target_properties(example PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON) -target_link_libraries(example ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} example.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE easyexif::easyexif) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/easyexif/all/test_package/conanfile.py b/recipes/easyexif/all/test_package/conanfile.py index f0acb990f0375..9da36f4d489c2 100644 --- a/recipes/easyexif/all/test_package/conanfile.py +++ b/recipes/easyexif/all/test_package/conanfile.py @@ -1,10 +1,20 @@ import os -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 -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) @@ -12,6 +22,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/easyexif/all/test_v1_package/CMakeLists.txt b/recipes/easyexif/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a84ec58a29d01..0000000000000 --- a/recipes/easyexif/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(easyexif REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/example.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE easyexif::easyexif) diff --git a/recipes/easyexif/all/test_v1_package/conanfile.py b/recipes/easyexif/all/test_v1_package/conanfile.py deleted file mode 100644 index a691174f8ed16..0000000000000 --- a/recipes/easyexif/all/test_v1_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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - diff --git a/recipes/easyhttpcpp/all/conanfile.py b/recipes/easyhttpcpp/all/conanfile.py index 519369a7d9e1a..f7d394b063a2d 100644 --- a/recipes/easyhttpcpp/all/conanfile.py +++ b/recipes/easyhttpcpp/all/conanfile.py @@ -1,11 +1,12 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class EasyhttpcppConan(ConanFile): @@ -49,6 +50,7 @@ def layout(self): def requirements(self): self.requires("poco/1.12.4", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]") @property def _required_poco_components(self): @@ -60,7 +62,7 @@ def _required_poco_components(self): return comps def validate(self): - if any([not self.dependencies["poco"].options.get_safe(comp, False) for comp in self._required_poco_components]): + if any(not self.dependencies["poco"].options.get_safe(comp, False) for comp in self._required_poco_components): raise ConanInvalidConfiguration( f"{self.ref} requires the following poco options enabled: {', '.join(self._required_poco_components)}" ) @@ -78,6 +80,9 @@ def generate(self): if self.settings.os == "Windows" and self.options.shared: tc.preprocessor_definitions["EASYHTTPCPP_DLL"] = "1" tc.preprocessor_definitions["EASYHTTPCPP_API_EXPORTS"] = "1" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.1.0": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) deps.generate() @@ -113,13 +118,6 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.components["easyhttp"].requires.append("poco::poco_netsslwin") else: - self.cpp_info.components["easyhttp"].requires.append("poco::poco_netssl") - - # TODO: to remove in conan v2 - self.cpp_info.filenames["cmake_find_package"] = "easyhttpcppeasyhttp" - self.cpp_info.filenames["cmake_find_package_multi"] = "easyhttpcppeasyhttp" - self.cpp_info.names["cmake_find_package"] = "easyhttpcpp" - self.cpp_info.names["cmake_find_package_multi"] = "easyhttpcpp" - self.cpp_info.components["easyhttp"].names["cmake_find_package"] = "easyhttp" - self.cpp_info.components["easyhttp"].names["cmake_find_package_multi"] = "easyhttp" + self.cpp_info.components["easyhttp"].requires.extend(["poco::poco_netssl", "openssl::ssl"]) + self.cpp_info.components["easyhttp"].set_property("cmake_target_name", "easyhttpcpp::easyhttp") diff --git a/recipes/easyhttpcpp/all/test_package/CMakeLists.txt b/recipes/easyhttpcpp/all/test_package/CMakeLists.txt index 1c309d560ea6a..4b3733866715e 100644 --- a/recipes/easyhttpcpp/all/test_package/CMakeLists.txt +++ b/recipes/easyhttpcpp/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(easyhttpcppeasyhttp REQUIRED CONFIG) diff --git a/recipes/easyhttpcpp/all/test_package/test_package.cpp b/recipes/easyhttpcpp/all/test_package/test_package.cpp index 1162499f997bc..918e40ef436e8 100644 --- a/recipes/easyhttpcpp/all/test_package/test_package.cpp +++ b/recipes/easyhttpcpp/all/test_package/test_package.cpp @@ -1,76 +1,8 @@ -/* - * Copyright 2017 Sony Corporation - */ - -#include "easyhttpcpp/EasyHttp.h" - +#include #include -#include - -void displayUsage(char** argv) -{ - std::cout << "Usage: " << argv[0] << " " << std::endl; - std::cout << " Fetches the resource identified by and prints it to the standard output" - << std::endl; -} - -void dumpResponse(easyhttpcpp::Response::Ptr pResponse) -{ - std::cout << "Http status code: " << pResponse->getCode() << std::endl; - std::cout << "Http status message: " << pResponse->getMessage() << std::endl; - std::cout << "Http response headers:\n" << pResponse->getHeaders()->toString() << std::endl; - - // dump response body if text - const std::string contentType = pResponse->getHeaderValue("Content-Type", ""); - if (Poco::isubstr(contentType, "text/html") != std::string::npos) { - std::cout << "Http response body:\n" << pResponse->getBody()->toString() << std::endl; - } -} - -int main(int argc, char** argv) -{ - // need a url to execute easyhttpcpp http client - if (argc < 2) { - displayUsage(argv); - return 1; - } - std::string url = argv[1]; - - // HTTP GET the url - std::cout << "HTTP GET url: " << url << std::endl; - - try { - // cache dir = current working dir; cache size = 100 KB - easyhttpcpp::HttpCache::Ptr pCache = easyhttpcpp::HttpCache::createCache(Poco::Path::current(), 1024 * 100); - - // a default http connection pool - easyhttpcpp::ConnectionPool::Ptr pConnectionPool = easyhttpcpp::ConnectionPool::createConnectionPool(); - - // configure http cache and connection pool instance (optional but recommended) - easyhttpcpp::EasyHttp::Builder httpClientBuilder; - httpClientBuilder.setCache(pCache) - .setConnectionPool(pConnectionPool); - - // create http client - easyhttpcpp::EasyHttp::Ptr pHttpClient = httpClientBuilder.build(); - - // create a new request and execute synchronously - easyhttpcpp::Request::Builder requestBuilder; - easyhttpcpp::Request::Ptr pRequest = requestBuilder.setUrl(url).build(); - easyhttpcpp::Call::Ptr pCall = pHttpClient->newCall(pRequest); - easyhttpcpp::Response::Ptr pResponse = pCall->execute(); - - if (!pResponse->isSuccessful()) { - std::cout << "HTTP GET Error: (" << pResponse->getCode() << ")" << std::endl; - } else { - std::cout << "HTTP GET Success!" << std::endl; - } - // dump response - dumpResponse(pResponse); - } catch (const std::exception& e) { - std::cout << "Error occurred: " << e.what() << std::endl; - } +int main() { + std::cout << "EasyHttpCpp version: " << easyhttpcpp::common::ProjectVersion::asString() << "\n"; return 0; } diff --git a/recipes/easyhttpcpp/all/test_v1_package/CMakeLists.txt b/recipes/easyhttpcpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/easyhttpcpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/easyhttpcpp/all/test_v1_package/conanfile.py b/recipes/easyhttpcpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 5da5f0f382b3f..0000000000000 --- a/recipes/easyhttpcpp/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_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(f"{bin_path} http://localhost:80", run_environment=True) diff --git a/recipes/easyloggingpp/all/conanfile.py b/recipes/easyloggingpp/all/conanfile.py index 7cacb1c38e312..d7420c60a2cb6 100644 --- a/recipes/easyloggingpp/all/conanfile.py +++ b/recipes/easyloggingpp/all/conanfile.py @@ -1,10 +1,11 @@ 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, replace_in_file -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class EasyloggingppConan(ConanFile): @@ -54,6 +55,9 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + def validate(self): + check_min_cppstd(self, 11) + def layout(self): cmake_layout(self, src_folder="src") @@ -69,7 +73,7 @@ def _public_defines(self): defines.append("ELPP_THREAD_SAFE") if self.options.enable_debug_errors: defines.append("ELPP_DEBUG_ERRORS") - if self.options.enable_default_logfile: + if not self.options.enable_default_logfile: defines.append("ELPP_NO_DEFAULT_LOG_FILE") if self.options.disable_logs: defines.append("ELPP_DISABLE_LOGS") @@ -86,7 +90,7 @@ def _public_defines(self): if self.options.disable_verbose_logs: defines.append("ELPP_DISABLE_VERBOSE_LOGS") if self.options.disable_trace_logs: - defines.append("lib_utc_datetime") + defines.append("ELPP_DISABLE_TRACE_LOGS") if self.options.lib_utc_datetime: defines.append("ELPP_UTC_DATETIME") return defines @@ -117,3 +121,6 @@ def package(self): def package_info(self): self.cpp_info.libs = ["easyloggingpp"] self.cpp_info.defines = self._public_defines + + if self.options.enable_thread_safe and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/easyloggingpp/all/test_v1_package/CMakeLists.txt b/recipes/easyloggingpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/easyloggingpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/easyloggingpp/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", "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/easylzma/all/conandata.yml b/recipes/easylzma/all/conandata.yml index 80c52f3ee8642..017988dc8c801 100644 --- a/recipes/easylzma/all/conandata.yml +++ b/recipes/easylzma/all/conandata.yml @@ -6,3 +6,4 @@ patches: "0.0.7": - patch_file: "patches/memleaksfix.patch" - patch_file: "patches/cmake-no-cflags.patch" + - patch_file: "patches/cmake4-support.patch" diff --git a/recipes/easylzma/all/conanfile.py b/recipes/easylzma/all/conanfile.py index 46a81f3f9abbc..a9ebfeb6ca504 100644 --- a/recipes/easylzma/all/conanfile.py +++ b/recipes/easylzma/all/conanfile.py @@ -53,8 +53,7 @@ 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.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): diff --git a/recipes/easylzma/all/patches/cmake4-support.patch b/recipes/easylzma/all/patches/cmake4-support.patch new file mode 100644 index 0000000000000..7c82de9d2c3eb --- /dev/null +++ b/recipes/easylzma/all/patches/cmake4-support.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 10ef840..1735338 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,4 +51,4 @@ ENDIF () + + ADD_SUBDIRECTORY(src) + ADD_SUBDIRECTORY(elzma) +-ADD_SUBDIRECTORY(test) ++# ADD_SUBDIRECTORY(test) +diff --git a/elzma/CMakeLists.txt b/elzma/CMakeLists.txt +index 159b48f..1149176 100644 +--- a/elzma/CMakeLists.txt ++++ b/elzma/CMakeLists.txt +@@ -33,7 +33,7 @@ ADD_EXECUTABLE(elzma ${SRCS}) + TARGET_LINK_LIBRARIES(elzma easylzma_s) + + # make a hard link (or copy on win32) from unelzma to elzma +-GET_TARGET_PROPERTY(binPath elzma LOCATION) ++# GET_TARGET_PROPERTY(binPath elzma LOCATION) + IF (WIN32) + SET(exeExt ".exe") + SET(hardLinkCommand ${CMAKE_COMMAND} -E copy_if_different) +@@ -42,6 +42,7 @@ ELSE (WIN32) + SET(exeExt ) + ENDIF (WIN32) + ADD_CUSTOM_COMMAND(TARGET elzma POST_BUILD +- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir} ++ # COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir} ++ COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${binDir} + COMMAND ${hardLinkCommand} elzma${exeExt} unelzma${exeExt} + WORKING_DIRECTORY "${binDir}") diff --git a/recipes/easylzma/all/test_v1_package/CMakeLists.txt b/recipes/easylzma/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/easylzma/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6c9d5dba712c7..0000000000000 --- a/recipes/easylzma/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/all/test_package/CMakeLists.txt b/recipes/ecos/all/test_package/CMakeLists.txt index 006729666b6b5..7879444344bbd 100644 --- a/recipes/ecos/all/test_package/CMakeLists.txt +++ b/recipes/ecos/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(ecos REQUIRED CONFIG) diff --git a/recipes/ecos/all/test_v1_package/CMakeLists.txt b/recipes/ecos/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 465202cc7e581..0000000000000 --- a/recipes/ecos/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(ecos REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE ecos::ecos) diff --git a/recipes/ecos/all/test_v1_package/conanfile.py b/recipes/ecos/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ecos/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_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/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/edlib/all/test_package/CMakeLists.txt b/recipes/edlib/all/test_package/CMakeLists.txt index 502714cc3a9ba..2f66d225f2fa5 100644 --- a/recipes/edlib/all/test_package/CMakeLists.txt +++ b/recipes/edlib/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(edlib REQUIRED CONFIG) diff --git a/recipes/edlib/all/test_v1_package/CMakeLists.txt b/recipes/edlib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/edlib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/edlib/all/test_v1_package/conanfile.py b/recipes/edlib/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/edlib/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_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/edyn/all/test_v1_package/CMakeLists.txt b/recipes/edyn/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/edyn/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/edyn/all/test_v1_package/conanfile.py b/recipes/edyn/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/edyn/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_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/effcee/all/test_package/CMakeLists.txt b/recipes/effcee/all/test_package/CMakeLists.txt index 52906cfefeb69..af96edd6008f0 100644 --- a/recipes/effcee/all/test_package/CMakeLists.txt +++ b/recipes/effcee/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(effcee REQUIRED) diff --git a/recipes/effcee/all/test_v1_package/CMakeLists.txt b/recipes/effcee/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/effcee/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/effcee/all/test_v1_package/conanfile.py b/recipes/effcee/all/test_v1_package/conanfile.py deleted file mode 100644 index 12dd810a6ab3b..0000000000000 --- a/recipes/effcee/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - - 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/efsw/all/conandata.yml b/recipes/efsw/all/conandata.yml new file mode 100644 index 0000000000000..7dd750f85dbbc --- /dev/null +++ b/recipes/efsw/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + # Newer versions at the top + "1.4.1": + url: "https://github.com/SpartanJ/efsw/archive/refs/tags/1.4.1.tar.gz" + sha256: "f0ddee587928737c6a3dc92eb88266a804c77279cbdf29d47e5e6f6ad6c7fd9a" + "1.4.0": + url: "https://github.com/SpartanJ/efsw/archive/refs/tags/1.4.0.tar.gz" + sha256: "9eed5fc8471767faa44134f5379d4de02825e3756007dafa482fd1656e42bc4a" diff --git a/recipes/efsw/all/conanfile.py b/recipes/efsw/all/conanfile.py new file mode 100644 index 0000000000000..05d9db6ba0105 --- /dev/null +++ b/recipes/efsw/all/conanfile.py @@ -0,0 +1,75 @@ +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, rm, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + + +required_conan_version = ">=2.1" + + +class EfswConan(ConanFile): + name = "efsw" + description = "efsw is a C++ cross-platform file system watcher and notifier." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/SpartanJ/efsw" + topics = ("file system", "watch", "cross-platform") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + def validate(self): + check_min_cppstd(self, 11) + + 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["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.variables["BUILD_TEST_APP"] = False + tc.variables["BUILD_STATIC_LIBS"] = False + tc.generate() + + def _patch_sources(self): + # INFO: Honor fPIC option. The upstream sets fPIC to ON always + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + + 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", "pkgconfig")) + 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 = ["efsw"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] + if self.settings.os == "Macos": + self.cpp_info.frameworks = ["Cocoa", "CoreFoundation", "CoreServices"] diff --git a/recipes/efsw/all/test_package/CMakeLists.txt b/recipes/efsw/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..060bcf241df10 --- /dev/null +++ b/recipes/efsw/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(efsw REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE efsw::efsw) diff --git a/recipes/efsw/all/test_package/conanfile.py b/recipes/efsw/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cef342207237c --- /dev/null +++ b/recipes/efsw/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 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/efsw/all/test_package/test_package.cpp b/recipes/efsw/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..05eff3352085a --- /dev/null +++ b/recipes/efsw/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include // EXIT_SUCCESS +#include "efsw/efsw.hpp" + +int main() { + efsw::FileWatcher* fileWatcher = new efsw::FileWatcher(); + + std::cout << "Follows symlinks?: " << fileWatcher->followSymlinks() << std::endl; + + delete fileWatcher; + + return EXIT_SUCCESS; +} diff --git a/recipes/efsw/config.yml b/recipes/efsw/config.yml new file mode 100644 index 0000000000000..4b2c882b0c67a --- /dev/null +++ b/recipes/efsw/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.1": + folder: all + "1.4.0": + folder: all diff --git a/recipes/egl-headers/all/test_package/CMakeLists.txt b/recipes/egl-headers/all/test_package/CMakeLists.txt index 26e09ca1aa867..d39670ff153ab 100644 --- a/recipes/egl-headers/all/test_package/CMakeLists.txt +++ b/recipes/egl-headers/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(egl-headers REQUIRED CONFIG) diff --git a/recipes/egl-headers/all/test_v1_package/CMakeLists.txt b/recipes/egl-headers/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/egl-headers/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/egl-headers/all/test_v1_package/conanfile.py b/recipes/egl-headers/all/test_v1_package/conanfile.py deleted file mode 100644 index 90f7a062ba0d0..0000000000000 --- a/recipes/egl-headers/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake -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/egl/system/test_v1_package/CMakeLists.txt b/recipes/egl/system/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7a8ae2ad50945..0000000000000 --- a/recipes/egl/system/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_v1_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/egl/system/test_v1_package/conanfile.py b/recipes/egl/system/test_v1_package/conanfile.py deleted file mode 100644 index 1d0bdd3779793..0000000000000 --- a/recipes/egl/system/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - - 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/eigen/all/test_v1_package/CMakeLists.txt b/recipes/eigen/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/eigen/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/eigen/all/test_v1_package/conanfile.py b/recipes/eigen/all/test_v1_package/conanfile.py deleted file mode 100644 index 41edcae379d5b..0000000000000 --- a/recipes/eigen/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -import os - -from conan.tools.build import cross_building -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): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/elfio/all/test_package/CMakeLists.txt b/recipes/elfio/all/test_package/CMakeLists.txt index 50113becf9a2c..9ed8d9b15e5c8 100755 --- a/recipes/elfio/all/test_package/CMakeLists.txt +++ b/recipes/elfio/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(elfio REQUIRED CONFIG) diff --git a/recipes/elfio/all/test_v1_package/CMakeLists.txt b/recipes/elfio/all/test_v1_package/CMakeLists.txt deleted file mode 100755 index 0d20897301b68..0000000000000 --- a/recipes/elfio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/elfio/all/test_v1_package/conanfile.py b/recipes/elfio/all/test_v1_package/conanfile.py deleted file mode 100755 index 38f4483872d47..0000000000000 --- a/recipes/elfio/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_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/elfutils/all/conanfile.py b/recipes/elfutils/all/conanfile.py index 7d15bdd2937ed..335bc4fcad4d0 100644 --- a/recipes/elfutils/all/conanfile.py +++ b/recipes/elfutils/all/conanfile.py @@ -73,22 +73,22 @@ def requirements(self): if self.options.with_bzlib: self.requires("bzip2/1.0.8") if self.options.with_lzma: - self.requires("xz_utils/5.4.5") + self.requires("xz_utils/[>=5.4.5 <6]") if self.options.get_safe("with_zstd"): - self.requires("zstd/1.5.5") + self.requires("zstd/[~1.5]") if self.options.get_safe("libdebuginfod"): self.requires("libcurl/[>=7.78.0 <9]") if self.options.debuginfod: self.requires("libmicrohttpd/0.9.75") def build_requirements(self): - self.tool_requires("gettext/0.21") + self.tool_requires("gettext/0.22.5") self.tool_requires("automake/1.16.5") self.build_requires("m4/1.4.19") self.build_requires("flex/2.6.4") self.tool_requires("bison/3.8.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): @@ -171,6 +171,7 @@ 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["libelf"].set_property("pkg_config_name", "libelf") if self.options.with_bzlib: self.cpp_info.components["libelf"].requires.append("bzip2::bzip2") if self.options.with_lzma: @@ -182,6 +183,7 @@ def package_info(self): self.cpp_info.components["libdw"].libs = ["dw"] self.cpp_info.components["libdw"].requires = ["libelf"] + self.cpp_info.components["libdw"].set_property("pkg_config_name", "libdw") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libdw"].system_libs.extend(["dl"]) @@ -192,6 +194,7 @@ def package_info(self): if self.options.get_safe("libdebuginfod"): self.cpp_info.components["libdebuginfod"].libs = ["debuginfod"] self.cpp_info.components["libdebuginfod"].requires = ["libcurl::curl"] + self.cpp_info.components["libdebuginfod"].set_property("pkg_config_name", "libdebuginfod") # utilities bin_path = os.path.join(self.package_folder, "bin") diff --git a/recipes/embedded_ringbuf_cpp/all/test_package/CMakeLists.txt b/recipes/embedded_ringbuf_cpp/all/test_package/CMakeLists.txt index ac26e4c63d05b..4d07b7ee4540b 100644 --- a/recipes/embedded_ringbuf_cpp/all/test_package/CMakeLists.txt +++ b/recipes/embedded_ringbuf_cpp/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(embedded_ringbuf_cpp CONFIG REQUIRED) diff --git a/recipes/embree/all/conandata.yml b/recipes/embree/all/conandata.yml new file mode 100644 index 0000000000000..871010273df4a --- /dev/null +++ b/recipes/embree/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.3.3": + url: "https://github.com/embree/embree/archive/refs/tags/v4.3.3.tar.gz" + sha256: "8a3bc3c3e21aa209d9861a28f8ba93b2f82ed0dc93341dddac09f1f03c36ef2d" diff --git a/recipes/embree/all/conanfile.py b/recipes/embree/all/conanfile.py new file mode 100644 index 0000000000000..5dc630dc38bea --- /dev/null +++ b/recipes/embree/all/conanfile.py @@ -0,0 +1,126 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=2.0.9" + +class EmbreeConan(ConanFile): + name = "embree" + description = "Intel's collection of high-performance ray tracing kernels." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://embree.github.io/" + topics = ("embree", "raytracing", "rendering") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + + default_options = { + "shared": False, + "fPIC": True + } + implements = ["auto_shared_fpic"] + + @property + def _has_sse_avx(self): + return self.settings.arch in ["x86", "x86_64"] + + @property + def _has_neon(self): + return "arm" in self.settings.arch + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os != "Emscripten": + self.requires("onetbb/2021.12.0") + + def validate(self): + check_min_cppstd(self, 14) + # See https://github.com/RenderKit/embree/blob/master/CMakeLists.txt#L538 + if ( + self.settings.compiler == "apple-clang" + and not self.options.shared + and Version(self.settings.compiler.version) >= "9.0" + ): + raise ConanInvalidConfiguration(f"{self.ref} static with apple-clang >=9 and multiple ISA (simd) 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["EMBREE_STATIC_LIB"] = not self.options.shared + tc.variables["BUILD_TESTING"] = False + tc.variables["EMBREE_INSTALL_DEPENDENCIES"] = False + tc.variables["EMBREE_TUTORIALS"] = False + tc.variables["EMBREE_BACKFACE_CULLING"] = False + tc.variables["EMBREE_IGNORE_INVALID_RAYS"] = False + tc.variables["EMBREE_ISPC_SUPPORT"] = False + tc.variables["EMBREE_TASKING_SYSTEM"] = "INTERNAL" if is_apple_os(self) or self.settings.os == "Emscripten" else "TBB" + tc.variables["EMBREE_MAX_ISA"] = "NONE" + tc.variables["EMBREE_ISA_NEON"] = self._has_neon + tc.variables["EMBREE_ISA_NEON2X"] = self._has_neon + tc.variables["EMBREE_ISA_SSE2"] = self._has_sse_avx + tc.variables["EMBREE_ISA_SSE42"] = self._has_sse_avx + # For Emscripten disable TBB and all ISAs. It will compile only for SSE + if self.settings.os == "Emscripten": + tc.variables["EMBREE_ISA_AVX"] = self._has_sse_avx + tc.variables["EMBREE_ISA_AVX2"] = self._has_sse_avx + tc.variables["EMBREE_ISA_AVX512"] = self._has_sse_avx and not is_msvc(self) + if is_msvc(self): + tc.variables["USE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + + deps = CMakeDeps(self) + deps.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, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.command", os.path.join(self.package_folder)) + rm(self, "*.cmake", os.path.join(self.package_folder)) + rm(self, "embree-vars.sh", os.path.join(self.package_folder)) + rm(self, "embree-vars.csh", os.path.join(self.package_folder)) + + # Remove MS runtime files + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + rm(self, pattern=dll_pattern_to_remove, folder=os.path.join(self.package_folder, "bin"), recursive=True) + + def package_info(self): + self.cpp_info.libs = ["embree4"] + if not self.options.shared: + self.cpp_info.libs.extend(["sys", "math", "simd", "lexers", "tasking"]) + if self._has_sse_avx: + self.cpp_info.libs.extend(["embree_sse42", "embree_avx", "embree_avx2"]) + if not is_msvc(self): + self.cpp_info.libs.append("embree_avx512") + if self._has_neon: + self.cpp_info.libs.extend(["embree_avx2"]) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m", "pthread"]) diff --git a/recipes/embree/all/test_package/CMakeLists.txt b/recipes/embree/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..24a76f24afbfa --- /dev/null +++ b/recipes/embree/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(embree REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE embree::embree) diff --git a/recipes/embree/all/test_package/conanfile.py b/recipes/embree/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/embree/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/embree/all/test_package/test_package.cpp b/recipes/embree/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..53ec64e813a94 --- /dev/null +++ b/recipes/embree/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include +#include + +int main() { + RTCDevice device = rtcNewDevice(NULL); + RTCScene scene = rtcNewScene(device); + RTCGeometry geom = rtcNewGeometry(device, RTC_GEOMETRY_TYPE_TRIANGLE); + + rtcReleaseGeometry(geom); + rtcReleaseScene(scene); + rtcReleaseDevice(device); + + return 0; +} \ No newline at end of file diff --git a/recipes/embree/config.yml b/recipes/embree/config.yml new file mode 100644 index 0000000000000..4582d013631e7 --- /dev/null +++ b/recipes/embree/config.yml @@ -0,0 +1,3 @@ +versions: + "4.3.3": + folder: all diff --git a/recipes/embree3/all/test_package/CMakeLists.txt b/recipes/embree3/all/test_package/CMakeLists.txt index fe2724327bb76..4b2a61321d40f 100644 --- a/recipes/embree3/all/test_package/CMakeLists.txt +++ b/recipes/embree3/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(embree REQUIRED CONFIG) diff --git a/recipes/embree3/all/test_v1_package/CMakeLists.txt b/recipes/embree3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/embree3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/embree3/all/test_v1_package/conanfile.py b/recipes/embree3/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/embree3/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_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/emhash/all/conandata.yml b/recipes/emhash/all/conandata.yml new file mode 100644 index 0000000000000..4034de3bcdd95 --- /dev/null +++ b/recipes/emhash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240601": + url: "https://github.com/ktprime/emhash/archive/3efa77ef32786a033b379071fe8af3dc705736ca.tar.gz" + sha256: "db6c524f3acb487f88221aff75a9198700478ece4ea2a9a25b013ef7375bc819" diff --git a/recipes/emhash/all/conanfile.py b/recipes/emhash/all/conanfile.py new file mode 100644 index 0000000000000..7618a4de1e403 --- /dev/null +++ b/recipes/emhash/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 EmhashConan(ConanFile): + name = "emhash" + description = "Fast and memory efficient c++ flat hash map/set" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ktprime/emhash" + topics = ("flat", "map", "set", "hash", "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="*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=self.source_folder, + excludes=["bench", "test", "thirdparty",] + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/emhash/all/test_package/CMakeLists.txt b/recipes/emhash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..123ccacccfde9 --- /dev/null +++ b/recipes/emhash/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(emhash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE emhash::emhash) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/emhash/all/test_package/conanfile.py b/recipes/emhash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/emhash/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/emhash/all/test_package/test_package.cpp b/recipes/emhash/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0fa8241e36634 --- /dev/null +++ b/recipes/emhash/all/test_package/test_package.cpp @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +#define EMH_EXT +#include "hash_table5.hpp" + +int main(void) { + // constructor + emhash5::HashMap m1(4); + m1.reserve(100); + for (int i = 1; i < 100; i++) + m1.emplace_unique(i, i); //key must be unique, performance is better than emplace, operator[]. + + auto no_value = m1.at(0); //no_value = 0; no exception throw!!!. only return zero for integer value. + + // list constructor + emhash5::HashMap m2 = { + {1, "foo"}, + {3, "bar"}, + {2, "baz"}, + }; + + auto* pvalue = m2.try_get(1); //return nullptr if key is not exist + if (m2.try_set(4, "for")) printf("set success"); + if (!m2.try_set(1, "new")) printf("set failed"); + std::string ovalue = m2.set_get(1, "new"); //ovalue = "foo" and m2[1] == "new" + + for(auto& p: m2) + std::cout << " " << p.first << " => " << p.second << '\n'; + + // copy constructor + emhash5::HashMap m3 = m2; + // move constructor + emhash5::HashMap m4 = std::move(m2); + + //insert. insert_unique. emplace + m2.insert_unique(4, "four"); + m2[4] = "four_again"; + m2.emplace(std::make_pair(4, "four")); + m2.insert({{6, "six"}, {5, "five"}}); + + // range constructor + std::vector, int>> v = { {0x12, 1}, {0x01,-1} }; + emhash5::HashMap, double> m5(v.begin(), v.end()); +} diff --git a/recipes/emhash/config.yml b/recipes/emhash/config.yml new file mode 100644 index 0000000000000..155d30b32fcf1 --- /dev/null +++ b/recipes/emhash/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240601": + folder: all diff --git a/recipes/emio/all/conandata.yml b/recipes/emio/all/conandata.yml index 9c81336117348..54492753857b0 100644 --- a/recipes/emio/all/conandata.yml +++ b/recipes/emio/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.9.0": + url: "https://github.com/Viatorus/emio/archive/0.9.0.tar.gz" + sha256: "63b1eca2ac9a66d443352717302305998300f259216b20f686c02db594b1d87b" + "0.8.0": + url: "https://github.com/Viatorus/emio/archive/0.8.0.tar.gz" + sha256: "86436eeb16cac7c7c74a7c1af9fe7bbbc1aa18d3d96e7bba9791c15ebe9ebdc7" + "0.7.0": + url: "https://github.com/viatorus/emio/archive/0.7.0.tar.gz" + sha256: "1ef5304964eee109c13477f2d84822ee474612475049a377b59e33a5fe05d7eb" "0.6.1": url: "https://github.com/viatorus/emio/archive/0.6.1.tar.gz" sha256: "118bb67581d68b33d9764e016700014ad63b68520b5786c0d12036f33bcef0dc" diff --git a/recipes/emio/all/conanfile.py b/recipes/emio/all/conanfile.py index 8eb00bd9ec66b..7785d5a02da74 100644 --- a/recipes/emio/all/conanfile.py +++ b/recipes/emio/all/conanfile.py @@ -57,6 +57,6 @@ def source(self): 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, "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")) diff --git a/recipes/emio/config.yml b/recipes/emio/config.yml index 01ed4761ab018..265e3b7a259ee 100644 --- a/recipes/emio/config.yml +++ b/recipes/emio/config.yml @@ -1,4 +1,10 @@ versions: + "0.9.0": + folder: all + "0.8.0": + folder: all + "0.7.0": + folder: all "0.6.1": folder: all "0.6.0": diff --git a/recipes/emsdk/all/conandata.yml b/recipes/emsdk/all/conandata.yml index 09c67e41502df..454e2ddd01a6d 100644 --- a/recipes/emsdk/all/conandata.yml +++ b/recipes/emsdk/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.1.73": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.73.tar.gz" + sha256: "01e5e57a1f4ad74bff88134f00f4827aeb3b72b3bf91de9c8ad8bfa12ab9479a" + "3.1.72": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.72.tar.gz" + sha256: "62886722da99173789f1efc31b754c83c8ea09575035ce7fdfe5a7389bb3cec3" "3.1.50": url: "https://github.com/emscripten-core/emsdk/archive/3.1.50.tar.gz" sha256: "7491a881eb5ee15fe81bbabcfff1fd571e45ccdb24a81890af429f9970cbd1f3" @@ -20,6 +26,9 @@ sources: "3.1.44": url: "https://github.com/emscripten-core/emsdk/archive/3.1.44.tar.gz" sha256: "cb8cded78f6953283429d724556e89211e51ac4d871fcf38e0b32405ee248e91" + "3.1.38": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.38.tar.gz" + sha256: "45ffb273503e48aae28c04549026b9cbdd750a5d36e3da3e22bc9977d2bfd61f" "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 3fd73e6da5530..cc38cd3c728ca 100644 --- a/recipes/emsdk/config.yml +++ b/recipes/emsdk/config.yml @@ -1,4 +1,8 @@ versions: + "3.1.73": + folder: all + "3.1.72": + folder: all "3.1.50": folder: all "3.1.49": @@ -13,6 +17,8 @@ versions: folder: all "3.1.44": folder: all + "3.1.38": + folder: all "3.1.31": folder: all "3.1.30": @@ -52,4 +58,4 @@ versions: "2.0.31": folder: all "2.0.30": - folder: all + folder: all \ No newline at end of file diff --git a/recipes/enchant/all/conandata.yml b/recipes/enchant/all/conandata.yml index 6da09cd5f8f1b..bc61ba887bce4 100644 --- a/recipes/enchant/all/conandata.yml +++ b/recipes/enchant/all/conandata.yml @@ -1,7 +1,7 @@ sources: "2.3.2": + url: "https://github.com/rrthomas/enchant/releases/download/v2.3.2/enchant-2.3.2.tar.gz" sha256: "ce9ba47fd4d34031bd69445598a698a6611602b2b0e91d705e91a6f5099ead6e" - url: https://github.com/AbiWord/enchant/releases/download/v2.3.2/enchant-2.3.2.tar.gz patches: "2.3.2": - patch_file: patches/0001-add-visibility-annotations.patch diff --git a/recipes/enchant/all/conanfile.py b/recipes/enchant/all/conanfile.py index 4ccf80abd3897..a721d40fc7a3b 100644 --- a/recipes/enchant/all/conanfile.py +++ b/recipes/enchant/all/conanfile.py @@ -15,7 +15,7 @@ class EnchantConan(ConanFile): ) license = "LGPL-2.1-or-later" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://abiword.github.io/enchant/" + homepage = "https://rrthomas.github.io/enchant/" topics = ("enchant", "spell", "spell-check") package_type = "shared-library" diff --git a/recipes/enchant/all/test_v1_package/CMakeLists.txt b/recipes/enchant/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/enchant/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index a8c92dea63335..0000000000000 --- a/recipes/enchant/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/enet/all/conandata.yml b/recipes/enet/all/conandata.yml index c03ba9c9c59fb..346f8469ae010 100644 --- a/recipes/enet/all/conandata.yml +++ b/recipes/enet/all/conandata.yml @@ -1,22 +1,17 @@ sources: + "1.3.18": + url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.18.tar.gz" + sha256: "28603c895f9ed24a846478180ee72c7376b39b4bb1287b73877e5eae7d96b0dd" "1.3.17": url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.17.tar.gz" sha256: "1e0b4bc0b7127a2d779dd7928f0b31830f5b3dcb7ec9588c5de70033e8d2434a" "1.3.16": url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.16.tar.gz" sha256: "b3aa85b43e4309fec9441b4e6639c268e22962a578bd5e2307bb3a7b6fe73714" - "1.3.15": - url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.15.tar.gz" - sha256: "e749887a19b5a4a0a16daae2d695fd7ed581ec517f3b15aedc3cdce2d999d471" - "1.3.14": - url: "https://github.com/lsalzman/enet/archive/refs/tags/v1.3.14.tar.gz" - sha256: "3660e12d32164b2d814a897f50caa4e68db6396c00ef22806db45c2308b439e6" patches: + "1.3.18": + - patch_file: "patches/fix-cmake-1.3.18.patch" "1.3.17": - patch_file: "patches/fix-cmake.patch" "1.3.16": - patch_file: "patches/fix-cmake.patch" - "1.3.15": - - patch_file: "patches/fix-cmake.patch" - "1.3.14": - - patch_file: "patches/fix-cmake.patch" diff --git a/recipes/enet/all/conanfile.py b/recipes/enet/all/conanfile.py index cc4771c9c977b..91bbd184f63d0 100644 --- a/recipes/enet/all/conanfile.py +++ b/recipes/enet/all/conanfile.py @@ -2,9 +2,10 @@ 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 +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class EnetConan(ConanFile): @@ -49,6 +50,8 @@ def generate(self): tc = CMakeToolchain(self) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "1.3.18": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): diff --git a/recipes/enet/all/patches/fix-cmake-1.3.18.patch b/recipes/enet/all/patches/fix-cmake-1.3.18.patch new file mode 100644 index 0000000000000..6a6af96885d57 --- /dev/null +++ b/recipes/enet/all/patches/fix-cmake-1.3.18.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6459b6..d7e68bd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,19 +84,27 @@ set(SOURCE_FILES + source_group(include FILES ${INCLUDE_FILES}) + source_group(source FILES ${SOURCE_FILES}) + +-add_library(enet STATIC ++if(MSVC AND BUILD_SHARED_LIBS) ++ add_definitions(-DENET_DLL) ++ add_definitions(-DENET_BUILDING_LIB) ++endif() ++add_library(enet + ${INCLUDE_FILES} + ${SOURCE_FILES} + ) + +-if (MINGW) ++if (WIN32) + target_link_libraries(enet winmm ws2_32) + endif() + +-install(TARGETS enet +- RUNTIME DESTINATION bin +- ARCHIVE DESTINATION lib/static +- LIBRARY DESTINATION lib) +- +-install(DIRECTORY include/ +- DESTINATION include) ++include(GNUInstallDirs) ++install( ++ TARGETS enet ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) ++install( ++ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/enet ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) diff --git a/recipes/enet/all/test_package/CMakeLists.txt b/recipes/enet/all/test_package/CMakeLists.txt index 4d708d2778b59..d7581fea515b1 100644 --- a/recipes/enet/all/test_package/CMakeLists.txt +++ b/recipes/enet/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(enet REQUIRED CONFIG) diff --git a/recipes/enet/all/test_v1_package/CMakeLists.txt b/recipes/enet/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/enet/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/enet/all/test_v1_package/conanfile.py b/recipes/enet/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/enet/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_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/enet/config.yml b/recipes/enet/config.yml index 1e0720325112a..9574bb80165a0 100644 --- a/recipes/enet/config.yml +++ b/recipes/enet/config.yml @@ -1,9 +1,7 @@ versions: + "1.3.18": + folder: all "1.3.17": folder: all "1.3.16": folder: all - "1.3.15": - folder: all - "1.3.14": - folder: all diff --git a/recipes/enhex-generic_serialization/all/test_v1_package/CMakeLists.txt b/recipes/enhex-generic_serialization/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/enhex-generic_serialization/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6ab1666628a5d..0000000000000 --- a/recipes/enhex-generic_serialization/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/enhex-strong_type/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/enhex-strong_type/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index c48d1d23bfccd..0000000000000 --- a/recipes/enhex-strong_type/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/enjincppsdk/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/enjincppsdk/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 4a5eb7410ea85..0000000000000 --- a/recipes/enjincppsdk/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/enkits/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/enkits/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 910ae60d10438..0000000000000 --- a/recipes/enkits/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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 index a566be23b4893..31733be82e383 100644 --- a/recipes/ensmallen/all/conandata.yml +++ b/recipes/ensmallen/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.21.0": + url: "https://ensmallen.org/files/ensmallen-2.21.0.tar.gz" + sha256: "076f9d84e1ebc84c0ae19ee63accfc8fd3ec850f8993784bd9277776c3af2932" "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 index 7b6250290ad81..093bca4ec6467 100644 --- a/recipes/ensmallen/all/conanfile.py +++ b/recipes/ensmallen/all/conanfile.py @@ -25,7 +25,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("armadillo/12.2.0") + self.requires("armadillo/12.6.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/ensmallen/config.yml b/recipes/ensmallen/config.yml index 3af3934850762..0bd90f07549cf 100644 --- a/recipes/ensmallen/config.yml +++ b/recipes/ensmallen/config.yml @@ -1,3 +1,5 @@ versions: + "2.21.0": + folder: all "2.19.1": folder: all diff --git a/recipes/entityx/all/test_package/CMakeLists.txt b/recipes/entityx/all/test_package/CMakeLists.txt index 3469e1c7a6f88..3acc2a54643a3 100644 --- a/recipes/entityx/all/test_package/CMakeLists.txt +++ b/recipes/entityx/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(entityx REQUIRED CONFIG) diff --git a/recipes/entityx/all/test_v1_package/CMakeLists.txt b/recipes/entityx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/entityx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/entityx/all/test_v1_package/conanfile.py b/recipes/entityx/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/entityx/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_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/entt/3.x.x/conandata.yml b/recipes/entt/3.x.x/conandata.yml index 24bd7f949e5dc..bc82c187f9e2a 100644 --- a/recipes/entt/3.x.x/conandata.yml +++ b/recipes/entt/3.x.x/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.14.0": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.14.0.tar.gz" + sha256: "e31f6e95a30e2977a50449ef9a607a9ff40febe6f9da2a8144a183f8606f7719" + "3.13.2": + url: "https://github.com/skypjack/entt/archive/refs/tags/v3.13.2.tar.gz" + sha256: "cb556aa543d01177b62de41321759e02d96078948dda72705b3d7fe68af88489" "3.12.2": url: "https://github.com/skypjack/entt/archive/refs/tags/v3.12.2.tar.gz" sha256: "3F3E43988218DAECC0530CCAF45E960F7F7416E1FCF2C69799160C18B6A2FEE3" diff --git a/recipes/entt/3.x.x/test_package/CMakeLists.txt b/recipes/entt/3.x.x/test_package/CMakeLists.txt index 317de178fe28d..5ae0c05c4831a 100644 --- a/recipes/entt/3.x.x/test_package/CMakeLists.txt +++ b/recipes/entt/3.x.x/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(EnTT REQUIRED CONFIG) diff --git a/recipes/entt/3.x.x/test_v1_package/CMakeLists.txt b/recipes/entt/3.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/entt/3.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/entt/3.x.x/test_v1_package/conanfile.py b/recipes/entt/3.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/entt/3.x.x/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_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/entt/config.yml b/recipes/entt/config.yml index 3eaedc6257e18..b6987050a29e9 100644 --- a/recipes/entt/config.yml +++ b/recipes/entt/config.yml @@ -1,4 +1,8 @@ versions: + "3.14.0": + folder: 3.x.x + "3.13.2": + folder: 3.x.x "3.12.2": folder: 3.x.x "3.11.1": diff --git a/recipes/enum-flags/all/test_package/CMakeLists.txt b/recipes/enum-flags/all/test_package/CMakeLists.txt index 62594120f0543..4e2870bed1db8 100644 --- a/recipes/enum-flags/all/test_package/CMakeLists.txt +++ b/recipes/enum-flags/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(enumflags REQUIRED CONFIG) diff --git a/recipes/enum-flags/all/test_v1_package/CMakeLists.txt b/recipes/enum-flags/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/enum-flags/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/enum-flags/all/test_v1_package/conanfile.py b/recipes/enum-flags/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/enum-flags/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_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/enumbitmask/all/conandata.yml b/recipes/enumbitmask/all/conandata.yml new file mode 100644 index 0000000000000..cd53c7f619e50 --- /dev/null +++ b/recipes/enumbitmask/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + url: "https://github.com/Reputeless/EnumBitmask/archive/refs/tags/v1.0.tar.gz" + sha256: "233efdefa4d0cfc8d8664ab7326db29835cc874b0af4926a7d93a184b250013d" diff --git a/recipes/enumbitmask/all/conanfile.py b/recipes/enumbitmask/all/conanfile.py new file mode 100644 index 0000000000000..e26040a23cf68 --- /dev/null +++ b/recipes/enumbitmask/all/conanfile.py @@ -0,0 +1,67 @@ +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.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class EnumBitmaskConan(ConanFile): + name = "enumbitmask" + description = "A C++ library to enable bitmask operators for an enum class type" + license = "CC0-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Reputeless/EnumBitmask" + topics = ("enum", "bitmask", "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=self.source_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/enumbitmask/all/test_package/CMakeLists.txt b/recipes/enumbitmask/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7e634d8528a16 --- /dev/null +++ b/recipes/enumbitmask/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(enumbitmask REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE enumbitmask::enumbitmask) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/enumbitmask/all/test_package/conanfile.py b/recipes/enumbitmask/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/enumbitmask/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/enumbitmask/all/test_package/test_package.cpp b/recipes/enumbitmask/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..80e777f36555c --- /dev/null +++ b/recipes/enumbitmask/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include + +#include "EnumBitmask.hpp" + +enum class OpenMode { + Append = 1, + Binary = 2, + Input = 4, + Output = 8, +}; +DEFINE_BITMASK_OPERATORS(OpenMode) + + +int main() { + constexpr auto mode = OpenMode::Binary | OpenMode::Input; + + constexpr auto flag = mode & OpenMode::Binary; + + return 0; +} diff --git a/recipes/enumbitmask/config.yml b/recipes/enumbitmask/config.yml new file mode 100644 index 0000000000000..edab1ee152d36 --- /dev/null +++ b/recipes/enumbitmask/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all diff --git a/recipes/erikzenker-hsm/all/conanfile.py b/recipes/erikzenker-hsm/all/conanfile.py index dd35c89776d73..175f305fea06f 100644 --- a/recipes/erikzenker-hsm/all/conanfile.py +++ b/recipes/erikzenker-hsm/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=2.0" class HsmConan(ConanFile): @@ -21,32 +21,28 @@ class HsmConan(ConanFile): "complex meta programming code to a minimum." ) topics = ("state-machine", "template-meta-programming") - + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps" + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): - self.requires("boost/1.81.0") + self.requires("boost/1.83.0") def package_id(self): self.info.clear() def validate(self): - # FIXME: should use self.info.settings instead of self.settings for conan v2 - # https://github.com/erikzenker/hsm#dependencies - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 17) + check_min_cppstd(self, 17) if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "8": raise ConanInvalidConfiguration("clang 8+ is required") if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": raise ConanInvalidConfiguration("GCC 8+ is required") - 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) @@ -69,3 +65,5 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "hsm") self.cpp_info.set_property("cmake_target_name", "hsm::hsm") self.cpp_info.requires = ["boost::headers"] + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/erikzenker-hsm/all/test_package/CMakeLists.txt b/recipes/erikzenker-hsm/all/test_package/CMakeLists.txt index 2fe2bc0003d31..32e89c378eda2 100644 --- a/recipes/erikzenker-hsm/all/test_package/CMakeLists.txt +++ b/recipes/erikzenker-hsm/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(hsm CONFIG REQUIRED) diff --git a/recipes/erikzenker-hsm/all/test_package/conanfile.py b/recipes/erikzenker-hsm/all/test_package/conanfile.py index 185c9f3ab199a..d0e96eeca32df 100644 --- a/recipes/erikzenker-hsm/all/test_package/conanfile.py +++ b/recipes/erikzenker-hsm/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 HsmTestConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "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/erikzenker-hsm/all/test_v1_package/CMakeLists.txt b/recipes/erikzenker-hsm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/erikzenker-hsm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/erikzenker-hsm/all/test_v1_package/conanfile.py b/recipes/erikzenker-hsm/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/erikzenker-hsm/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_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/erkir/all/conandata.yml b/recipes/erkir/all/conandata.yml index 24a6857c0b7eb..f16d2da6950e6 100644 --- a/recipes/erkir/all/conandata.yml +++ b/recipes/erkir/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.1.1": + url: "https://github.com/vahancho/erkir/archive/refs/tags/v2.1.1.tar.gz" + sha256: "b314824c126bf933e2f08e5335e12b7ef3ded9ceb341d542276455d991e7e85d" "2.0.0": url: "https://github.com/vahancho/erkir/archive/refs/tags/v2.0.0.tar.gz" sha256: "98d095adcf0f2f11e3ba345bd5bbe890568cde69de9680b2c2a424f0008453ac" @@ -6,6 +9,16 @@ sources: url: "https://github.com/vahancho/erkir/archive/refs/tags/1.0.0.tar.gz" sha256: "0bc5122fe2fef0f9036de275483af7f8adb947f6e8dd63fc18ac085ef31e9421" patches: + "2.1.1": + - patch_file: "patches/2.0.0-0001-remove-specify-architecture.patch" + patch_description: "fix supported architectures limited to x86/x86_64" + patch_type: "conan" + - patch_file: "patches/2.1.1-0002-fix-cmake.patch" + patch_description: "disable shared and fPIC options" + patch_type: "conan" + - patch_file: "patches/2.1.1-0003-fix-erkir_export.patch" + patch_description: "define ERKIR_EXPORT as empty on static build" + patch_type: "conan" "2.0.0": - patch_file: "patches/2.0.0-0001-remove-specify-architecture.patch" patch_description: "fix supported architectures limited to x86/x86_64" diff --git a/recipes/erkir/all/conanfile.py b/recipes/erkir/all/conanfile.py index 941e33312f121..10808e03cf409 100644 --- a/recipes/erkir/all/conanfile.py +++ b/recipes/erkir/all/conanfile.py @@ -81,7 +81,11 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "erkir") - self.cpp_info.set_property("cmake_target_name", "erkir::erkir") postfix = "d" if Version(self.version) >= "2.0.0" and self.settings.build_type == "Debug" else "" self.cpp_info.libs = [f"erkir{postfix}"] + + if Version(self.version) >= "2.1.0" and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + self.cpp_info.set_property("cmake_file_name", "erkir") + self.cpp_info.set_property("cmake_target_name", "erkir::erkir") diff --git a/recipes/erkir/all/patches/2.1.1-0002-fix-cmake.patch b/recipes/erkir/all/patches/2.1.1-0002-fix-cmake.patch new file mode 100644 index 0000000000000..0a92d7aabdffc --- /dev/null +++ b/recipes/erkir/all/patches/2.1.1-0002-fix-cmake.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d72f102..7bf1655 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.9) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # The project definition + project(erkir VERSION 2.1.1 +@@ -14,7 +14,7 @@ project(erkir VERSION 2.1.1 + include(GNUInstallDirs) + + # General options +-option(BUILD_SHARED_LIBS "Build using shared libraries" ON) ++# option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + option(ENABLE_TESTING "Enable unit test build" OFF) + + if (0) diff --git a/recipes/erkir/all/patches/2.1.1-0003-fix-erkir_export.patch b/recipes/erkir/all/patches/2.1.1-0003-fix-erkir_export.patch new file mode 100644 index 0000000000000..a12676d0ed400 --- /dev/null +++ b/recipes/erkir/all/patches/2.1.1-0003-fix-erkir_export.patch @@ -0,0 +1,28 @@ +diff --git a/include/export.h b/include/export.h +index edcb0b3..e090174 100644 +--- a/include/export.h ++++ b/include/export.h +@@ -1,7 +1,7 @@ + #ifndef __EXPORT_H_ + #define __EXPORT_H_ + +-#ifdef _WIN32 ++#if defined(_WIN32) && defined(ERKIR_SHARED) + #ifdef MAKEDLL + # define ERKIR_EXPORT __declspec(dllexport) + #else +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ad88fd6..519a300 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -38,6 +38,10 @@ if (MSVC) + target_compile_definitions(${TARGET} PUBLIC MAKEDLL) + endif() + ++if (BUILD_SHARED_LIBS) ++ target_compile_definitions(${TARGET} PUBLIC ERKIR_SHARED) ++endif() ++ + ############################################################################### + # The installation and packaging + # diff --git a/recipes/erkir/all/test_package/CMakeLists.txt b/recipes/erkir/all/test_package/CMakeLists.txt index 135087f122cde..9e9980bc73536 100644 --- a/recipes/erkir/all/test_package/CMakeLists.txt +++ b/recipes/erkir/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) diff --git a/recipes/erkir/all/test_v1_package/CMakeLists.txt b/recipes/erkir/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/erkir/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/erkir/all/test_v1_package/conanfile.py b/recipes/erkir/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/erkir/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/erkir/config.yml b/recipes/erkir/config.yml index 870fb33e55af0..65dc9fbda0110 100644 --- a/recipes/erkir/config.yml +++ b/recipes/erkir/config.yml @@ -1,4 +1,6 @@ versions: + "2.1.1": + folder: all "2.0.0": folder: all "1.0.0": diff --git a/recipes/etc2comp/all/test_v1_package/CMakeLists.txt b/recipes/etc2comp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/etc2comp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6c9d5dba712c7..0000000000000 --- a/recipes/etc2comp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/etcd-cpp-apiv3/all/conandata.yml b/recipes/etcd-cpp-apiv3/all/conandata.yml new file mode 100644 index 0000000000000..639ef314f4821 --- /dev/null +++ b/recipes/etcd-cpp-apiv3/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.15.4": + url: "https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3/archive/refs/tags/v0.15.4.tar.gz" + sha256: "4516ecfa420826088c187efd42dad249367ca94ea6cdfc24e3030c3cf47af7b4" diff --git a/recipes/etcd-cpp-apiv3/all/conanfile.py b/recipes/etcd-cpp-apiv3/all/conanfile.py new file mode 100644 index 0000000000000..2d42f65ab0601 --- /dev/null +++ b/recipes/etcd-cpp-apiv3/all/conanfile.py @@ -0,0 +1,110 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import get, copy, rmdir +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + +class EtcdCppApiv3Conan(ConanFile): + name = "etcd-cpp-apiv3" + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3" + license = "BSD-3-Clause" + description = ("C++ library for etcd's v3 client APIs, i.e., ETCDCTL_API=3.") + topics = ("etcd", "api", ) + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "6", + "msvc": "191", + "Visual Studio": "15", + } + + 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): + if not self._is_legacy_one_profile: + self.tool_requires("protobuf/") + self.tool_requires("grpc/") + + def requirements(self): + self.requires("protobuf/3.21.12") + self.requires("openssl/[>=1.1 <4]") + self.requires("grpc/1.54.3") + self.requires("cpprestsdk/2.10.19", transitive_headers=True, transitive_libs=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.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if self._is_legacy_one_profile: + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = CMakeToolchain(self) + tc.variables["gRPC_VERSION"] = self.dependencies["grpc"].ref.version + tc.variables["ETCD_CMAKE_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", self._min_cppstd) + tc.variables["OpenSSL_DIR"] = self.dependencies["openssl"].package_folder.replace('\\', '/') + tc.generate() + + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + + def build(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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["etcd-cpp-api"] diff --git a/recipes/etcd-cpp-apiv3/all/test_package/CMakeLists.txt b/recipes/etcd-cpp-apiv3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..31b21296bffaa --- /dev/null +++ b/recipes/etcd-cpp-apiv3/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(etcd-cpp-apiv3 REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE etcd-cpp-apiv3::etcd-cpp-apiv3) diff --git a/recipes/etcd-cpp-apiv3/all/test_package/conanfile.py b/recipes/etcd-cpp-apiv3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/etcd-cpp-apiv3/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/etcd-cpp-apiv3/all/test_package/test_package.cpp b/recipes/etcd-cpp-apiv3/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b481840dd6d30 --- /dev/null +++ b/recipes/etcd-cpp-apiv3/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include +#include "etcd/Client.hpp" + +static const std::string etcd_url = + etcdv3::detail::resolve_etcd_endpoints("http://127.0.0.1:2379"); + +int main() +{ + etcd::Client* etcd = etcd::Client::WithUser(etcd_url, "root", "root"); + return EXIT_SUCCESS; +} diff --git a/recipes/etcd-cpp-apiv3/config.yml b/recipes/etcd-cpp-apiv3/config.yml new file mode 100644 index 0000000000000..810f6e84b1f61 --- /dev/null +++ b/recipes/etcd-cpp-apiv3/config.yml @@ -0,0 +1,3 @@ +versions: + "0.15.4": + folder: all diff --git a/recipes/eternal/all/test_package/CMakeLists.txt b/recipes/eternal/all/test_package/CMakeLists.txt index 332722f9d1b68..e16f69fe66661 100644 --- a/recipes/eternal/all/test_package/CMakeLists.txt +++ b/recipes/eternal/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(eternal REQUIRED CONFIG) diff --git a/recipes/eternal/all/test_v1_package/CMakeLists.txt b/recipes/eternal/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/eternal/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/eternal/all/test_v1_package/conanfile.py b/recipes/eternal/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/eternal/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/etl/all/conandata.yml b/recipes/etl/all/conandata.yml index 74e149bfbcab5..5952b547b0543 100644 --- a/recipes/etl/all/conandata.yml +++ b/recipes/etl/all/conandata.yml @@ -1,49 +1,10 @@ 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" - "20.35.11": - url: "https://github.com/ETLCPP/etl/archive/20.35.11.tar.gz" - sha256: "64a9eed9b9ac8a278349aac8e5888320fda0e090ba24373651767b7a8b8793fc" - "20.35.8": - url: "https://github.com/ETLCPP/etl/archive/20.35.8.tar.gz" - sha256: "7d0a6402b24fc91cf66328b95391a38c52d20f582f42497fb9b0a99d71ab8879" - "20.35.7": - url: "https://github.com/ETLCPP/etl/archive/20.35.7.tar.gz" - sha256: "20127e36c12a33142645dd5ec0a08d12b34ce9b33986847eeaa8c4201e025895" - "20.34.0": - url: "https://github.com/ETLCPP/etl/archive/20.34.0.tar.gz" - sha256: "56e25968f20167a161ee50c3eecda3daa91f696660ba59654c1afd22e502c465" + "20.40.0": + url: "https://github.com/ETLCPP/etl/archive/refs/tags/20.40.0.tar.gz" + sha256: "b47ca70e7394f50dd2d65dddfd088757525488ac2fd934f435705fbf3ffe6d3d" + "20.39.4": + url: "https://github.com/ETLCPP/etl/archive/20.39.4.tar.gz" + sha256: "ce1222ed12fb39ae7a6160f8c33da61534d6b4c4d0d36be622910bbd545f5ee7" + "20.38.17": + url: "https://github.com/ETLCPP/etl/archive/20.38.17.tar.gz" + sha256: "5b490aca3faad3796a48bf0980e74f2a67953967fad3c051a6d4981051cb0b9a" \ No newline at end of file diff --git a/recipes/etl/all/conanfile.py b/recipes/etl/all/conanfile.py index a1737588ee965..52ededc6ecbe6 100644 --- a/recipes/etl/all/conanfile.py +++ b/recipes/etl/all/conanfile.py @@ -1,20 +1,17 @@ from conan import ConanFile -from conan.tools.files import get, copy, save +from conan.tools.files import get, copy from conan.tools.layout import basic_layout import os -import textwrap - required_conan_version = ">=1.50.0" - class EmbeddedTemplateLibraryConan(ConanFile): name = "etl" description = "A C++ template library for embedded applications" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.etlcpp.com/" - topics = ("cpp", "embedded", "template", "container", "utility", "framework", "messaging") + topics = ("cpp", "embedded", "template", "container", "utility", "framework", "messaging", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -28,36 +25,10 @@ def package_id(self): def source(self): 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")) - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self._create_cmake_module_alias_targets( - self, - os.path.join(self.package_folder, self._module_file_rel_path), - {"etl": "etl::etl"} - ) - - @staticmethod - def _create_cmake_module_alias_targets(conanfile, 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(conanfile, 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", "etl") self.cpp_info.set_property("cmake_target_name", "etl::etl") @@ -65,8 +36,3 @@ def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) - - # 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/etl/all/test_package/CMakeLists.txt b/recipes/etl/all/test_package/CMakeLists.txt index abf67a0fae7ee..eb48755440389 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) +cmake_minimum_required(VERSION 3.15) 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} PRIVATE etl::etl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/etl/all/test_v1_package/CMakeLists.txt b/recipes/etl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 19dd51b438baa..0000000000000 --- a/recipes/etl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -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::etl) diff --git a/recipes/etl/all/test_v1_package/conanfile.py b/recipes/etl/all/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/etl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/etl/config.yml b/recipes/etl/config.yml index 57618035ca09f..9837f5b126b5b 100644 --- a/recipes/etl/config.yml +++ b/recipes/etl/config.yml @@ -1,33 +1,7 @@ versions: - "20.38.10": + "20.40.0": folder: all - "20.38.7": + "20.39.4": folder: all - "20.38.6": - folder: all - "20.38.4": - folder: all - "20.38.3": - folder: all - "20.38.0": - folder: all - "20.37.3": - folder: all - "20.37.2": - folder: all - "20.37.1": - folder: all - "20.37.0": - folder: all - "20.36.0": - folder: all - "20.35.14": - folder: all - "20.35.11": - folder: all - "20.35.8": - folder: all - "20.35.7": - folder: all - "20.34.0": + "20.38.17": folder: all diff --git a/recipes/eudev/all/conandata.yml b/recipes/eudev/all/conandata.yml new file mode 100644 index 0000000000000..72fcfaa216122 --- /dev/null +++ b/recipes/eudev/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.2.14": + url: "https://github.com/eudev-project/eudev/releases/download/v3.2.14/eudev-3.2.14.tar.gz" + sha256: "8da4319102f24abbf7fff5ce9c416af848df163b29590e666d334cc1927f006f" diff --git a/recipes/eudev/all/conanfile.py b/recipes/eudev/all/conanfile.py new file mode 100644 index 0000000000000..597e9d9b84092 --- /dev/null +++ b/recipes/eudev/all/conanfile.py @@ -0,0 +1,148 @@ +import os +import re + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, load, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout + + +required_conan_version = ">=1.54.0" + + +class EudevConan(ConanFile): + name = "eudev" + description = "eudev is a standalone dynamic and persistent device naming support (aka userspace devfs) daemon that runs independently from the init system." + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eudev-project/eudev" + topics = ("device", "udev") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "hwdb": [True, False], + "mtd_probe": [True, False], + "programs": [True, False], + "with_kmod": [True, False], + "with_libblkid": [True, False], + "with_selinux": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "hwdb": False, + "mtd_probe": False, + "programs": True, + "with_kmod": True, + "with_libblkid": True, + "with_selinux": True, + } + provides = "libudev" + + 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("acl/2.3.1") + self.requires("libcap/2.69") + self.requires("libxslt/1.1.42") + self.requires("linux-headers-generic/6.5.9") + + if self.options.with_kmod: + self.requires("kmod/30") + if self.options.with_libblkid: + self.requires("libmount/2.39.2") + if self.options.with_selinux: + self.requires("libselinux/3.6") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + + 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/2.2.0") + + 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) + def yes_no(v): + return "yes" if v else "no" + tc.configure_args.extend([ + "--sysconfdir=${prefix}/res", + f"--enable-programs={yes_no(self.options.programs)}", + f"--enable-blkid={yes_no(self.options.with_libblkid)}", + f"--enable-selinux={yes_no(self.options.with_selinux)}", + f"--enable-kmod={yes_no(self.options.with_kmod)}", + f"--enable-hwdb={yes_no(self.options.hwdb)}", + f"--enable-mtd_probe={yes_no(self.options.mtd_probe)}", + "--enable-manpages=no", + ]) + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + @property + def _libudev_version_txt(self): + return os.path.join(self.package_folder, "res", f"{self.name}-libudev-version.txt") + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + pkg_config = load(self, os.path.join(self.package_folder, "lib", "pkgconfig", "libudev.pc")) + libudev_version = next(re.finditer("^Version: ([^\n$]+)[$\n]", pkg_config, flags=re.MULTILINE)).group(1) + save(self, self._libudev_version_txt, libudev_version) + + 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.libs = ["udev"] + libudev_version = load(self, self._libudev_version_txt).strip() + self.cpp_info.set_property("pkg_config_name", "libudev") + self.cpp_info.set_property("system_package_version", str(libudev_version)) + pkgconfig_variables = { + 'exec_prefix': '${prefix}', + } + self.cpp_info.set_property( + "pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items())) + self.cpp_info.requires = ["acl::acl", "libcap::cap", "libxslt::xslt", "linux-headers-generic::linux-headers-generic"] + if self.options.with_kmod: + self.cpp_info.requires.append("kmod::kmod") + if self.options.with_libblkid: + self.cpp_info.requires.append("libmount::libblkid") + if self.options.with_selinux: + self.cpp_info.requires.append("libselinux::selinux") + + # todo Remove this workaround for Conan v1 + self.cpp_info.set_property("component_version", str(libudev_version)) diff --git a/recipes/eudev/all/test_package/CMakeLists.txt b/recipes/eudev/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ba37277275903 --- /dev/null +++ b/recipes/eudev/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(eudev REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE eudev::eudev) diff --git a/recipes/eudev/all/test_package/conanfile.py b/recipes/eudev/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0ce98f8735f95 --- /dev/null +++ b/recipes/eudev/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.gnu import PkgConfig +from conan.tools.scm import Version + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "PkgConfigDeps", "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): + pkg_config = PkgConfig(self, "libudev", pkg_config_path=self.generators_folder) + assert Version(pkg_config.version) >= 251, f"{pkg_config.version} should be >= 251" + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/eudev/all/test_package/test_package.c b/recipes/eudev/all/test_package/test_package.c new file mode 100644 index 0000000000000..05b8913de0a37 --- /dev/null +++ b/recipes/eudev/all/test_package/test_package.c @@ -0,0 +1,25 @@ +#include +#include +#include + + +int main() { + struct udev *udev; + struct udev_enumerate *enumerate; + + udev = udev_new(); + if (!udev) { + fprintf(stderr, "Cannot create udev context.\n"); + return 1; + } + + enumerate = udev_enumerate_new(udev); + if (!enumerate) { + fprintf(stderr, "Cannot create enumerate context.\n"); + } + + udev_enumerate_unref(enumerate); + udev_unref(udev); + + return EXIT_SUCCESS; +} diff --git a/recipes/eudev/config.yml b/recipes/eudev/config.yml new file mode 100644 index 0000000000000..3420dd6df85af --- /dev/null +++ b/recipes/eudev/config.yml @@ -0,0 +1,3 @@ +versions: + "3.2.14": + folder: all diff --git a/recipes/eventpp/all/conandata.yml b/recipes/eventpp/all/conandata.yml new file mode 100644 index 0000000000000..71d384d9d4cba --- /dev/null +++ b/recipes/eventpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.3": + url: "https://github.com/wqking/eventpp/archive/v0.1.3.tar.gz" + sha256: "D87ABA67223FD9ACED2BA55EB82BD534007E43E1B919106A53FCD3070FA125EA" diff --git a/recipes/eventpp/all/conanfile.py b/recipes/eventpp/all/conanfile.py new file mode 100644 index 0000000000000..93267303876fd --- /dev/null +++ b/recipes/eventpp/all/conanfile.py @@ -0,0 +1,48 @@ +from conan import ConanFile +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.51.1" + +class EventppConan(ConanFile): + name = "eventpp" + description = "Event Dispatcher and callback list for C++" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/wqking/eventpp" + topics = ("observer-pattern", "event-dispatcher", "signal", "slot", "publish-subscribe", "nested-events", "thread-safe", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @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.get_safe("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, 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 = [] diff --git a/recipes/eventpp/all/test_package/CMakeLists.txt b/recipes/eventpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..07e2e0fdf4f6f --- /dev/null +++ b/recipes/eventpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(eventpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE eventpp::eventpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/eventpp/all/test_package/conanfile.py b/recipes/eventpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/eventpp/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/eventpp/all/test_package/test_package.cpp b/recipes/eventpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..565b7248f28f9 --- /dev/null +++ b/recipes/eventpp/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +int main(void) { + eventpp::CallbackList callbackList; + + callbackList.append([](const int i, const bool b) { + (void) i; + (void) b; + }); + + callbackList(1, true); + + return 0; +} diff --git a/recipes/eventpp/config.yml b/recipes/eventpp/config.yml new file mode 100644 index 0000000000000..b7f57204004e4 --- /dev/null +++ b/recipes/eventpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.3": + folder: all diff --git a/recipes/evmc/all/test_package/CMakeLists.txt b/recipes/evmc/all/test_package/CMakeLists.txt index d3cab735f84a2..e337e7ff919eb 100644 --- a/recipes/evmc/all/test_package/CMakeLists.txt +++ b/recipes/evmc/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(evmc REQUIRED CONFIG) diff --git a/recipes/exiv2/all/conandata.yml b/recipes/exiv2/all/conandata.yml index 55858f820d83f..49ba0667271df 100644 --- a/recipes/exiv2/all/conandata.yml +++ b/recipes/exiv2/all/conandata.yml @@ -1,10 +1,13 @@ sources: + "0.28.3": + url: "https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.3.tar.gz" + sha256: "1315e17d454bf4da3cc0edb857b1d2c143670f3485b537d0f946d9ed31d87b70" + "0.28.2": + url: "https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.2.tar.gz" + sha256: "543bead934135f20f438e0b6d8858c55c5fcb7ff80f5d1d55489965f1aad58b9" "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" diff --git a/recipes/exiv2/all/conanfile.py b/recipes/exiv2/all/conanfile.py index 8957750b23fe0..93bf130b53027 100644 --- a/recipes/exiv2/all/conanfile.py +++ b/recipes/exiv2/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration -from conan.tools.build import check_min_cppstd +from conan.tools.build import check_min_cppstd, check_max_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, replace_in_file from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, check_min_vs @@ -17,9 +17,9 @@ class Exiv2Conan(ConanFile): description = "Exiv2 is a C++ library and a command-line utility " \ "to read, write, delete and modify Exif, IPTC, XMP and ICC image metadata." license = "GPL-2.0" - topics = ("image", "exif", "xmp") - homepage = "https://www.exiv2.org" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.exiv2.org" + topics = ("image", "exif", "xmp") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -73,23 +73,22 @@ def layout(self): def requirements(self): self.requires("libiconv/1.17") if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") self.requires("zlib/[>=1.2.11 <2]") if self.options.with_xmp == "bundled": - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_curl: 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") + self.requires("inih/58") 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_cppstd(self, min_cppstd) check_min_vs(self, 191) compilers_minimum_version = { @@ -97,16 +96,12 @@ def validate(self): "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') + 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." + ) + else: # https://github.com/Exiv2/exiv2/tree/v0.27.7#217-building-with-c11-and-other-compilers check_max_cppstd(self, 14) @@ -167,30 +162,6 @@ def package(self): 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 - targets = {"exiv2lib": "exiv2::exiv2lib"} - if self.options.with_xmp == "bundled": - targets.update({"exiv2-xmp": "exiv2::exiv2-xmp"}) - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - targets - ) - - 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", "exiv2") self.cpp_info.set_property("pkg_config_name", "exiv2") @@ -223,10 +194,3 @@ def package_info(self): 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" 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/test_package/CMakeLists.txt b/recipes/exiv2/all/test_package/CMakeLists.txt index 69bbd22508c9b..134f926110304 100644 --- a/recipes/exiv2/all/test_package/CMakeLists.txt +++ b/recipes/exiv2/all/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(exiv2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} exiv2lib) +target_link_libraries(${PROJECT_NAME} PRIVATE exiv2lib) if(${exiv2_VERSION} VERSION_GREATER_EQUAL "0.28.0") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/exiv2/all/test_v1_package/CMakeLists.txt b/recipes/exiv2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/exiv2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/exiv2/all/test_v1_package/conanfile.py b/recipes/exiv2/all/test_v1_package/conanfile.py deleted file mode 100644 index b6a26067f365d..0000000000000 --- a/recipes/exiv2/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/exiv2/config.yml b/recipes/exiv2/config.yml index d503f95292a28..572fad2a57e09 100644 --- a/recipes/exiv2/config.yml +++ b/recipes/exiv2/config.yml @@ -1,7 +1,9 @@ versions: - "0.28.1": + "0.28.3": + folder: all + "0.28.2": folder: all - "0.28.0": + "0.28.1": folder: all "0.27.5": folder: all diff --git a/recipes/expat/all/conandata.yml b/recipes/expat/all/conandata.yml index f3b9d575c901c..5a91c7abf6175 100644 --- a/recipes/expat/all/conandata.yml +++ b/recipes/expat/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "2.7.1": + url: "https://github.com/libexpat/libexpat/releases/download/R_2_7_1/expat-2.7.1.tar.xz" + sha256: "354552544b8f99012e5062f7d570ec77f14b412a3ff5c7d8d0dae62c0d217c30" + "2.7.0": + url: "https://github.com/libexpat/libexpat/releases/download/R_2_7_0/expat-2.7.0.tar.xz" + sha256: "25df13dd2819e85fb27a1ce0431772b7047d72af81ae78dc26b4c6e0805f48d1" + "2.6.4": + url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_4/expat-2.6.4.tar.xz" + sha256: "a695629dae047055b37d50a0ff4776d1d45d0a4c842cf4ccee158441f55ff7ee" + "2.6.3": + url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_3/expat-2.6.3.tar.xz" + sha256: "274db254a6979bde5aad404763a704956940e465843f2a9bd9ed7af22e2c0efc" + "2.6.2": + url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_2/expat-2.6.2.tar.xz" + sha256: "ee14b4c5d8908b1bec37ad937607eab183d4d9806a08adee472c3c3121d27364" + "2.6.0": + url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_0/expat-2.6.0.tar.xz" + sha256: "cb5f5a8ea211e1cabd59be0a933a52e3c02cc326e86a4d387d8d218e7ee47a3e" "2.5.0": url: "https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.xz" sha256: "ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe" @@ -8,27 +26,6 @@ sources: "2.4.8": sha256: "f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25" url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.xz" - "2.4.7": - sha256: "9875621085300591f1e64c18fd3da3a0eeca4a74f884b9abac2758ad1bd07a7d" - url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_7/expat-2.4.7.tar.xz" - "2.4.6": - sha256: "de55794b7a9bc214852fdc075beaaecd854efe1361597e6268ee87946951289b" - url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_6/expat-2.4.6.tar.xz" - "2.4.5": - sha256: "f2af8fc7cdc63a87920da38cd6d12cb113c3c3a3f437495b1b6541e0cff32579" - url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_5/expat-2.4.5.tar.xz" - "2.4.4": - sha256: "b5d25d6e373351c2ed19b562b4732d01d2589ac8c8e9e7962d8df1207cc311b8" - url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_4/expat-2.4.4.tar.xz" - "2.4.3": - sha256: "b1f9f1b1a5ebb0acaa88c9ff79bfa4e145823b78aa5185e5c5d85f060824778a" - url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_3/expat-2.4.3.tar.xz" - "2.4.2": - sha256: "a2fb692e8e610406168296f25ba500ae8ce22cb4c8947a8689894d744b6deb02" - url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_2/expat-2.4.2.tar.gz" - "2.4.1": - sha256: "a00ae8a6b96b63a3910ddc1100b1a7ef50dc26dceb65ced18ded31ab392f132b" - url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_1/expat-2.4.1.tar.gz" "2.3.0": sha256: "89df123c62f2c2e2b235692d9fe76def6a9ab03dbe95835345bf412726eb1987" url: "https://github.com/libexpat/libexpat/releases/download/R_2_3_0/expat-2.3.0.tar.gz" diff --git a/recipes/expat/all/test_package/CMakeLists.txt b/recipes/expat/all/test_package/CMakeLists.txt index 5129dd0d2152f..56d288f365fbc 100644 --- a/recipes/expat/all/test_package/CMakeLists.txt +++ b/recipes/expat/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(expat REQUIRED CONFIG) diff --git a/recipes/expat/config.yml b/recipes/expat/config.yml index e09e9d75495cc..61fbbb0aef04b 100644 --- a/recipes/expat/config.yml +++ b/recipes/expat/config.yml @@ -1,23 +1,21 @@ versions: - "2.5.0": - folder: all - "2.4.9": + "2.7.1": folder: all - "2.4.8": + "2.7.0": folder: all - "2.4.7": + "2.6.4": folder: all - "2.4.6": + "2.6.3": folder: all - "2.4.5": + "2.6.2": folder: all - "2.4.4": + "2.6.0": folder: all - "2.4.3": + "2.5.0": folder: all - "2.4.2": + "2.4.9": folder: all - "2.4.1": + "2.4.8": folder: all "2.3.0": folder: all diff --git a/recipes/expected-lite/all/conandata.yml b/recipes/expected-lite/all/conandata.yml index d3a6677071af2..bbd60fdda1306 100644 --- a/recipes/expected-lite/all/conandata.yml +++ b/recipes/expected-lite/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.8.0": + url: "https://github.com/martinmoene/expected-lite/archive/v0.8.0.tar.gz" + sha256: "27649f30bd9d4fe7b193ab3eb6f78c64d0f585c24c085f340b4722b3d0b5e701" + "0.7.0": + url: "https://github.com/martinmoene/expected-lite/archive/v0.7.0.tar.gz" + sha256: "8e266cd304d405e02a6b4abf881ab7d8e203ca719c513711cf89a3b4e5d97918" "0.6.3": url: "https://github.com/martinmoene/expected-lite/archive/v0.6.3.tar.gz" sha256: "b2f90d5f03f6423ec67cc3c06fd0c4e813ec10c4313062b875b37d17593b57b4" diff --git a/recipes/expected-lite/all/conanfile.py b/recipes/expected-lite/all/conanfile.py index 591dbe00d1ead..d964e10b21ad2 100644 --- a/recipes/expected-lite/all/conanfile.py +++ b/recipes/expected-lite/all/conanfile.py @@ -9,11 +9,11 @@ class ExpectedLiteConan(ConanFile): name = "expected-lite" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/martinmoene/expected-lite" description = "expected lite - Expected objects in C++11 and later in a single-file header-only library" - topics = ("cpp11", "cpp14", "cpp17", "expected", "expected-implementations") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/expected-lite" + topics = ("cpp11", "cpp14", "cpp17", "expected", "expected-implementations", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/expected-lite/all/test_package/CMakeLists.txt b/recipes/expected-lite/all/test_package/CMakeLists.txt index 1d87701ed4e32..6259dabb634c5 100644 --- a/recipes/expected-lite/all/test_package/CMakeLists.txt +++ b/recipes/expected-lite/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(expected-lite REQUIRED CONFIG) diff --git a/recipes/expected-lite/all/test_package/conanfile.py b/recipes/expected-lite/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/expected-lite/all/test_package/conanfile.py +++ b/recipes/expected-lite/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/expected-lite/all/test_v1_package/CMakeLists.txt b/recipes/expected-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index d57a2501c92f1..0000000000000 --- a/recipes/expected-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(expected-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::expected-lite) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/expected-lite/all/test_v1_package/conanfile.py b/recipes/expected-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/expected-lite/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_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/expected-lite/config.yml b/recipes/expected-lite/config.yml index 9fcad808e37e7..1cfd509cacf71 100644 --- a/recipes/expected-lite/config.yml +++ b/recipes/expected-lite/config.yml @@ -1,4 +1,8 @@ versions: + "0.8.0": + folder: all + "0.7.0": + folder: all "0.6.3": folder: all "0.6.2": diff --git a/recipes/exprtk/all/conandata.yml b/recipes/exprtk/all/conandata.yml index 8720b949093ed..f5d45981f8145 100755 --- a/recipes/exprtk/all/conandata.yml +++ b/recipes/exprtk/all/conandata.yml @@ -1,4 +1,8 @@ sources: + "0.0.3": + url: "https://github.com/ArashPartow/exprtk/archive/0.0.3.tar.gz" + sha256: "f9dec6975e86c702033d6a65ba9a0368eba31a61b89d74f2b5d24457c02c8439" + "0.0.2": url: "https://github.com/ArashPartow/exprtk/archive/0.0.2.tar.gz" sha256: "7e8de4a0bfc9855c1316d8b8bc422061aef9a307c2f42d2e66298980463195c1" diff --git a/recipes/exprtk/all/conanfile.py b/recipes/exprtk/all/conanfile.py index 4df0e1b342c15..d791fd83adf69 100755 --- a/recipes/exprtk/all/conanfile.py +++ b/recipes/exprtk/all/conanfile.py @@ -2,9 +2,10 @@ from conan.tools.build import check_min_cppstd from conan.tools.layout import basic_layout from conan.tools.files import get, copy, load, save +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class ExprTkConan(ConanFile): @@ -18,10 +19,6 @@ class ExprTkConan(ConanFile): 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") @@ -29,19 +26,22 @@ def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler.cppstd: - check_min_cppstd(self, self._min_cppstd) + check_min_cppstd(self, 11) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def _extract_license(self): - exprtk_header_file = "exprtk.hpp" - file = os.path.join(self.source_folder, exprtk_header_file) - file_content = load(self, file) - license_end = "/MIT *" - license_contents = file_content[2:file_content.find(license_end) + len(license_end)] - save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + if Version(self.version) >= "0.0.3": + license_file = "license.txt" + copy(self, license_file, src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + else: + exprtk_header_file = "exprtk.hpp" + file = os.path.join(self.source_folder, exprtk_header_file) + file_content = load(self, file) + license_end = "/MIT *" + license_contents = file_content[2:file_content.find(license_end) + len(license_end)] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package(self): self._extract_license() diff --git a/recipes/exprtk/all/test_package/CMakeLists.txt b/recipes/exprtk/all/test_package/CMakeLists.txt index 632ea1ba6d56e..fefc8269bc4bf 100755 --- a/recipes/exprtk/all/test_package/CMakeLists.txt +++ b/recipes/exprtk/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) diff --git a/recipes/exprtk/all/test_package/test_package.cpp b/recipes/exprtk/all/test_package/test_package.cpp index 8ae4a2288e7ce..f668e5bbe9c03 100755 --- a/recipes/exprtk/all/test_package/test_package.cpp +++ b/recipes/exprtk/all/test_package/test_package.cpp @@ -1,78 +1,9 @@ -/* - ************************************************************** - * C++ Mathematical Expression Toolkit Library * - * * - * Exprtk Test Package * - * Author: Arash Partow (1999-2022) * - * URL: https://www.partow.net/programming/exprtk/index.html * - * * - * Copyright notice: * - * Free use of the Mathematical Expression Toolkit Library is * - * permitted under the guidelines and in accordance with the * - * most current version of the MIT License. * - * http://www.opensource.org/licenses/MIT * - * * - ************************************************************** -*/ - - -#include -#include - #include - - -template -void test_function() -{ - typedef exprtk::symbol_table symbol_table_t; - typedef exprtk::expression expression_t; - typedef exprtk::parser parser_t; - typedef exprtk::parser_error::type error_t; - - symbol_table_t symbol_table; - expression_t expression; - parser_t parser; - - T x = 1; - T y = 2; - - const std::string expression_string = "x * y + 3"; - - symbol_table.add_variable("x",x); - symbol_table.add_variable("y",y); - - expression.register_symbol_table(symbol_table); - - if (!parser.compile(expression_string,expression)) - { - printf("Error: %s\tExpression: %s\n", - parser.error().c_str(), - expression_string.c_str()); - - for (std::size_t i = 0; i < parser.error_count(); ++i) - { - const error_t error = parser.get_error(i); - - printf("Error: %02d Position: %02d " - "Type: [%s] " - "Message: %s " - "Expression: %s\n", - static_cast(i), - static_cast(error.token.position), - exprtk::parser_error::to_str(error.mode).c_str(), - error.diagnostic.c_str(), - expression_string.c_str()); - } - - return; - } - - expression.value(); -} +#include int main() { - test_function(); + std::cout << exprtk::information::library << std::endl; + std::cout << "Test package successful\n"; return 0; } diff --git a/recipes/exprtk/all/test_v1_package/CMakeLists.txt b/recipes/exprtk/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/exprtk/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/exprtk/all/test_v1_package/conanfile.py b/recipes/exprtk/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/exprtk/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/exprtk/config.yml b/recipes/exprtk/config.yml index 9873c37c1518d..33fef0a6d37b3 100755 --- a/recipes/exprtk/config.yml +++ b/recipes/exprtk/config.yml @@ -1,4 +1,6 @@ versions: + "0.0.3": + folder: "all" "0.0.2": folder: "all" "0.0.1": diff --git a/recipes/extra-cmake-modules/all/conandata.yml b/recipes/extra-cmake-modules/all/conandata.yml index 141faff804ef5..f556f71e55d06 100644 --- a/recipes/extra-cmake-modules/all/conandata.yml +++ b/recipes/extra-cmake-modules/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "6.2.0": + url: "https://download.kde.org/stable/frameworks/6.2/extra-cmake-modules-6.2.0.tar.xz" + sha256: "6374bfa0dded8be265c702acd5de11eecd2851c625b93e1c87d8d0f5f1a8ebe1" + "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" diff --git a/recipes/extra-cmake-modules/config.yml b/recipes/extra-cmake-modules/config.yml index 9ff0f9399df41..101fb016a65c8 100644 --- a/recipes/extra-cmake-modules/config.yml +++ b/recipes/extra-cmake-modules/config.yml @@ -1,4 +1,8 @@ versions: + "6.2.0": + folder: "all" + "5.113.0": + folder: "all" "5.111.0": folder: "all" "5.108.0": diff --git a/recipes/ezc3d/all/test_package/CMakeLists.txt b/recipes/ezc3d/all/test_package/CMakeLists.txt index b1b2099ff3c1c..d2bb880d7869d 100644 --- a/recipes/ezc3d/all/test_package/CMakeLists.txt +++ b/recipes/ezc3d/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(ezc3d REQUIRED CONFIG) diff --git a/recipes/ezc3d/all/test_v1_package/CMakeLists.txt b/recipes/ezc3d/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/ezc3d/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ezc3d/all/test_v1_package/conanfile.py b/recipes/ezc3d/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ezc3d/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_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/faac/all/test_package/CMakeLists.txt b/recipes/faac/all/test_package/CMakeLists.txt index d2d4532f8451f..59d84adbb9485 100644 --- a/recipes/faac/all/test_package/CMakeLists.txt +++ b/recipes/faac/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(faac REQUIRED CONFIG) diff --git a/recipes/faac/all/test_v1_package/CMakeLists.txt b/recipes/faac/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/faac/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/faac/all/test_v1_package/conanfile.py b/recipes/faac/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/faac/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_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/fakeit/all/conandata.yml b/recipes/fakeit/all/conandata.yml index 9b66729378da9..e412e4270b67e 100644 --- a/recipes/fakeit/all/conandata.yml +++ b/recipes/fakeit/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.1": + url: "https://github.com/eranpeer/FakeIt/archive/2.4.1.tar.gz" + sha256: "f5234a36d42363cb7ccd2cf99c8a754c832d9092035d984ad40aafa5371d0e95" "2.4.0": url: "https://github.com/eranpeer/FakeIt/archive/2.4.0.tar.gz" sha256: "eb79459ad6a97a5c985e3301b0d44538bdce2ba26115afe040f3874688edefb5" diff --git a/recipes/fakeit/all/conanfile.py b/recipes/fakeit/all/conanfile.py index 93fa295330a4d..4d9a65b5c58a1 100644 --- a/recipes/fakeit/all/conanfile.py +++ b/recipes/fakeit/all/conanfile.py @@ -36,11 +36,11 @@ def requirements(self): if self.options.integration == "boost": self.requires("boost/1.83.0") elif self.options.integration == "catch": - self.requires("catch2/3.4.0") + self.requires("catch2/3.5.2") elif self.options.integration == "gtest": self.requires("gtest/1.14.0") elif self.options.integration == "qtest": - self.requires("qt/6.6.0") + self.requires("qt/6.6.1") elif self.options.integration == "standalone": pass else: diff --git a/recipes/fakeit/all/test_package/CMakeLists.txt b/recipes/fakeit/all/test_package/CMakeLists.txt index 6beebe71b3c83..27346b7c974ea 100644 --- a/recipes/fakeit/all/test_package/CMakeLists.txt +++ b/recipes/fakeit/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(fakeit REQUIRED CONFIG) diff --git a/recipes/fakeit/all/test_v1_package/CMakeLists.txt b/recipes/fakeit/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/fakeit/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fakeit/all/test_v1_package/conanfile.py b/recipes/fakeit/all/test_v1_package/conanfile.py deleted file mode 100644 index a1bf8d95c2742..0000000000000 --- a/recipes/fakeit/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - - -class FakeItTestV1Conan(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/fakeit/config.yml b/recipes/fakeit/config.yml index 2d2179fc9b476..0755f94e23640 100644 --- a/recipes/fakeit/config.yml +++ b/recipes/fakeit/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.1": + folder: all "2.4.0": folder: all "2.3.2": diff --git a/recipes/faker-cxx/all/conandata.yml b/recipes/faker-cxx/all/conandata.yml new file mode 100644 index 0000000000000..33704b20363da --- /dev/null +++ b/recipes/faker-cxx/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.0.0": + url: "https://github.com/cieslarmichal/faker-cxx/archive/refs/tags/v3.0.0.tar.gz" + sha256: "63d6846376593e05da690136cabe8e7bf42ddcdd4edad3ae9b48696f86d80468" + "2.0.0": + url: "https://github.com/cieslarmichal/faker-cxx/archive/refs/tags/v2.0.0.tar.gz" + sha256: "8a7f5441f4453af868444675878a2d9a74918c1595caa65d537d3ea327e46a49" diff --git a/recipes/faker-cxx/all/conanfile.py b/recipes/faker-cxx/all/conanfile.py new file mode 100644 index 0000000000000..326381b2e9f9c --- /dev/null +++ b/recipes/faker-cxx/all/conanfile.py @@ -0,0 +1,103 @@ +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.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class FakerCXXConan(ConanFile): + name = "faker-cxx" + description = "C++ Faker library based on faker-js/faker. " + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cieslarmichal/faker-cxx" + topics = ("faker", "fake",) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_std_format": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_std_format": False, + } + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "12", + "clang": "16", + "apple-clang": "16", + "Visual Studio": "17", + "msvc": "193", + } + + 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 not self.options.with_std_format: + self.requires("fmt/10.2.1") + + 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." + ) + if self.settings.os == "Windows" and self.options.shared: + # https://github.com/cieslarmichal/faker-cxx/issues/753 + raise ConanInvalidConfiguration(f"{self.ref} is not prepared to generated shared library on Windows.") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.22 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_SYSTEM_DEPENDENCIES"] = True + tc.variables["BUILD_TESTING"] = False + tc.variables["WARNINGS_AS_ERRORS"] = False + tc.variables["WITH_STD_FORMAT"] = self.options.with_std_format + tc.generate() + deps = CMakeDeps(self) + deps.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")) + + def package_info(self): + self.cpp_info.libs = ["faker-cxx"] + + self.cpp_info.set_property("cmake_file_name", "faker-cxx") + self.cpp_info.set_property("cmake_target_name", "faker-cxx::faker-cxx") diff --git a/recipes/faker-cxx/all/test_package/CMakeLists.txt b/recipes/faker-cxx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2485457ffc81e --- /dev/null +++ b/recipes/faker-cxx/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(faker-cxx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE faker-cxx::faker-cxx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +if(faker-cxx_VERSION VERSION_LESS "3.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE FAKER_CXX_2) +endif() diff --git a/recipes/faker-cxx/all/test_package/conanfile.py b/recipes/faker-cxx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/faker-cxx/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/faker-cxx/all/test_package/test_package.cpp b/recipes/faker-cxx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7251d095e5300 --- /dev/null +++ b/recipes/faker-cxx/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#ifdef FAKER_CXX_2 + #include "faker-cxx/Internet.h" + #include "faker-cxx/String.h" + #include "faker-cxx/Date.h" +#else + #include "faker-cxx/internet.h" + #include "faker-cxx/string.h" + #include "faker-cxx/date.h" +#endif + +int main() +{ + const auto id = faker::string::uuid(); + const auto email = faker::internet::email(); + const auto password = faker::internet::password(); + const auto createdAt = faker::date::pastDate(5, faker::date::DateFormat::ISO); + const auto updatedAt = faker::date::recentDate(2, faker::date::DateFormat::ISO); + + std::cout << "id: " << id << ", email: " << email << ", password: " << password << ", createdAt: " << createdAt << ", updatedAt: " << updatedAt << "\n"; + + return 0; +} diff --git a/recipes/faker-cxx/config.yml b/recipes/faker-cxx/config.yml new file mode 100644 index 0000000000000..70df618778342 --- /dev/null +++ b/recipes/faker-cxx/config.yml @@ -0,0 +1,5 @@ +versions: + "3.0.0": + folder: all + "2.0.0": + folder: all diff --git a/recipes/farmhash/all/CMakeLists.txt b/recipes/farmhash/all/CMakeLists.txt index fd338ded4ae99..bd8943058e61a 100644 --- a/recipes/farmhash/all/CMakeLists.txt +++ b/recipes/farmhash/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(farmhash LANGUAGES CXX) include(GNUInstallDirs) diff --git a/recipes/farmhash/all/test_package/CMakeLists.txt b/recipes/farmhash/all/test_package/CMakeLists.txt index 8229712d40a9e..ae97d656231f6 100644 --- a/recipes/farmhash/all/test_package/CMakeLists.txt +++ b/recipes/farmhash/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(farmhash REQUIRED CONFIG) diff --git a/recipes/farmhash/all/test_v1_package/CMakeLists.txt b/recipes/farmhash/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/farmhash/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/farmhash/all/test_v1_package/conanfile.py b/recipes/farmhash/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/farmhash/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_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/fast-cdr/all/conandata.yml b/recipes/fast-cdr/all/conandata.yml index 021355947389f..a1647a8bd5d43 100644 --- a/recipes/fast-cdr/all/conandata.yml +++ b/recipes/fast-cdr/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.2.5": + url: "https://github.com/eProsima/Fast-CDR/archive/v2.2.5.tar.gz" + sha256: "b01fd34135e9be5183bb69f31fa5b74c53ba6eca30a5b21de0120d21ece22a51" + "2.2.3": + url: "https://github.com/eProsima/Fast-CDR/archive/v2.2.3.tar.gz" + sha256: "2501ef0930727d3b3ac1819672a6df8631a58fbcf7f005947046c2de46e8da69" + "2.2.0": + url: "https://github.com/eProsima/Fast-CDR/archive/v2.2.0.tar.gz" + sha256: "8a75ee3aed59f495e95208050920d2c2146df92f073809505a3bd29011c21f20" "2.1.0": url: "https://github.com/eProsima/Fast-CDR/archive/v2.1.0.tar.gz" sha256: "7ee3b3e977381f76f8d9ab1e1df7b5202556505b104afb3f03ee79bbe6507aa0" @@ -11,21 +20,6 @@ sources: "1.0.27": url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.27.tar.gz" sha256: "a9bc8fd31a2c2b95e6d2fb46e6ce1ad733e86dc4442f733479e33ed9cdc54bf6" - "1.0.26": - url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.26.tar.gz" - sha256: "812b29dd9fa8b79395dea3f4b810f9ab9e820fa4f0a666338c279b739a36595d" - "1.0.24": - url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.24.tar.gz" - sha256: "ecd688ab89ff1c03b9031c314891ae60995e2e73d919b93569eb840d6e87dec2" - "1.0.23": - url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.23.tar.gz" - sha256: "6f7c9c6c0c82c150b5ea2b0a58d5c9a466b87a1fcfca40d5786d99d4963a6721" - "1.0.22": - url: "https://github.com/eProsima/Fast-CDR/archive/v1.0.22.tar.gz" - sha256: "7ca7f09c633963622431bdb216eeb4145e378f81a2ce5113e341b9eee55e4f44" - "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" diff --git a/recipes/fast-cdr/all/test_package/CMakeLists.txt b/recipes/fast-cdr/all/test_package/CMakeLists.txt index 2a71d2d409cc4..5c78b1057382f 100644 --- a/recipes/fast-cdr/all/test_package/CMakeLists.txt +++ b/recipes/fast-cdr/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(fastcdr REQUIRED CONFIG) diff --git a/recipes/fast-cdr/all/test_v1_package/CMakeLists.txt b/recipes/fast-cdr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/fast-cdr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fast-cdr/all/test_v1_package/conanfile.py b/recipes/fast-cdr/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/fast-cdr/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_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/fast-cdr/config.yml b/recipes/fast-cdr/config.yml index 9cc6db5bd0315..5e80a3438b5ca 100644 --- a/recipes/fast-cdr/config.yml +++ b/recipes/fast-cdr/config.yml @@ -1,4 +1,10 @@ versions: + "2.2.5": + folder: all + "2.2.3": + folder: all + "2.2.0": + folder: all "2.1.0": folder: all "2.0.0": @@ -7,13 +13,3 @@ versions: folder: all "1.0.27": folder: all - "1.0.26": - folder: all - "1.0.24": - folder: all - "1.0.23": - folder: all - "1.0.22": - folder: all - "1.0.21": - folder: all diff --git a/recipes/fast-cpp-csv-parser/all/conandata.yml b/recipes/fast-cpp-csv-parser/all/conandata.yml index 87d270e80c74e..00225e59aaf16 100644 --- a/recipes/fast-cpp-csv-parser/all/conandata.yml +++ b/recipes/fast-cpp-csv-parser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20240102": + url: "https://github.com/ben-strasser/fast-cpp-csv-parser/archive/a71a87e700b0fb92645c6b124742cbf326e0f7b1.tar.gz" + sha256: "635d34234b9ebfefde42af3431547a5da29a112dd43cdbb532f79844b3b761d8" "cci.20211104": url: "https://github.com/ben-strasser/fast-cpp-csv-parser/archive/5a417973b4cea674a5e4a3b88a23098a2ab75479.zip" sha256: "33a22bda2603a87b8f36c79673339490f58656d92a4882e788de3f4ef7ec57b2" diff --git a/recipes/fast-cpp-csv-parser/all/test_package/CMakeLists.txt b/recipes/fast-cpp-csv-parser/all/test_package/CMakeLists.txt index 9136830af77ff..7fd27a7564f1b 100644 --- a/recipes/fast-cpp-csv-parser/all/test_package/CMakeLists.txt +++ b/recipes/fast-cpp-csv-parser/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(fast-cpp-csv-parser REQUIRED CONFIG) 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 deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/fast-cpp-csv-parser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fast-cpp-csv-parser/all/test_v1_package/conanfile.py b/recipes/fast-cpp-csv-parser/all/test_v1_package/conanfile.py deleted file mode 100644 index 47d6b79839192..0000000000000 --- a/recipes/fast-cpp-csv-parser/all/test_v1_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 = os.path.join("bin", "test_package") - csv_name = os.path.join(self.source_folder, os.pardir, "test_package", "test_package.csv") - self.run(f"{bin_path} {csv_name}", run_environment=True) diff --git a/recipes/fast-cpp-csv-parser/config.yml b/recipes/fast-cpp-csv-parser/config.yml index ca4b1e35049ab..383c881ec3492 100644 --- a/recipes/fast-cpp-csv-parser/config.yml +++ b/recipes/fast-cpp-csv-parser/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20240102": + folder: all "cci.20211104": folder: all "cci.20200830": diff --git a/recipes/fast-dds/all/conandata.yml b/recipes/fast-dds/all/conandata.yml index ab4d2d857dbe4..f53bf9511da8b 100644 --- a/recipes/fast-dds/all/conandata.yml +++ b/recipes/fast-dds/all/conandata.yml @@ -1,44 +1,50 @@ sources: + "2.14.3": + url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.14.3.tar.gz" + sha256: "292e4170e4689d878eb5ddd38661134a704a1541402a4f564353190e4aadd23d" + "2.14.0": + url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.14.0.tar.gz" + sha256: "a6f12bce6b77f265cab81abde5dc2e08133be9a55bc29e573c84571d44eddbc2" + "2.13.3": + url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.13.3.tar.gz" + sha256: "0f33596a8a48b5da4c43a964f2dc70127c6449defd5698944dddbdfb16d2b268" "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" - "2.3.3": - url: "https://github.com/eProsima/Fast-DDS/archive/refs/tags/v2.3.3.tar.gz" - sha256: "5ebf27d810c6ab68eef7d42937cd421d85e50509ae96883239979a1b3a2f4f82" - "2.3.2": - 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" + "2.14.3": + - patch_file: "patches/2.13.3-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" + "2.14.0": + - patch_file: "patches/2.13.3-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_file: "patches/2.13.3-0002-add-gettid-macro-for-glibc-compat.patch" + patch_type: "conan" + patch_description: "Add gettid macro for glibc compat. See: eProsima/Fast-DDS#4565" + "2.13.3": + - patch_file: "patches/2.13.3-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_file: "patches/2.13.3-0002-add-gettid-macro-for-glibc-compat.patch" + patch_type: "conan" + patch_description: "Add gettid macro for glibc compat. See: eProsima/Fast-DDS#4565" + "2.11.2": + - 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.3": - - patch_file: "patches/2.3.X-0001-fix-find-asio-and-tinyxml2.patch" + "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.2": - - patch_file: "patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch" + "2.3.4": + - patch_file: "patches/2.3.X-0001-fix-find-asio-and-tinyxml2.patch" patch_type: "conan" patch_description: "Fixup find asio and tinyxml2" diff --git a/recipes/fast-dds/all/conanfile.py b/recipes/fast-dds/all/conanfile.py index e8ad7b42a13f0..bdeaac9382380 100644 --- a/recipes/fast-dds/all/conanfile.py +++ b/recipes/fast-dds/all/conanfile.py @@ -49,11 +49,18 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): - return { - "gcc": "5", - "clang": "3.9", - "apple-clang": "8", - } + if Version(self.version) < "2.11.0": + return { + "gcc": "8", + "clang": "12", + "apple-clang": "12", + } + else: + return { + "gcc": "9", + "clang": "15", + "apple-clang": "15", + } def export_sources(self): export_conandata_patches(self) @@ -63,6 +70,7 @@ def config_options(self): del self.options.fPIC def configure(self): + self.options["fast-cdr"].shared = self.options.shared if self.options.shared: self.options.rm_safe("fPIC") @@ -70,14 +78,19 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("tinyxml2/9.0.0") - self.requires("asio/1.28.0") # This is now a package_type = header - self.requires("fast-cdr/1.0.27", transitive_headers=True, transitive_libs=True) + self.requires("tinyxml2/10.0.0") + self.requires("asio/1.29.0") # This is now a package_type = header + # Fast-DDS < 2.12 uses Fast-CDR 1.x + if Version(self.version) < "2.12.0": + self.requires("fast-cdr/1.1.0", transitive_headers=True, transitive_libs=True) + else: + self.requires("fast-cdr/2.1.0", transitive_headers=True, transitive_libs=True) self.requires("foonathan-memory/0.7.3") if self.options.with_ssl: self.requires("openssl/[>=1.1 <4]") def validate(self): + # fast-dds requires C++11 if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) check_min_vs(self, "192") @@ -87,10 +100,11 @@ def validate(self): 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 "MT" in msvc_runtime_flag(self): # This combination leads to an fast-dds error when linking # linking dynamic '*.dll' and static MT runtime - raise ConanInvalidConfiguration("Mixing a dll {} library with a static runtime is a bad idea".format(self.name)) + raise ConanInvalidConfiguration("Mixing a dll {} library with a static runtime is not supported".format(self.name)) def build_requirements(self): if Version(self.version) >= "2.7.0": 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 deleted file mode 100644 index bada751126e81..0000000000000 --- a/recipes/fast-dds/all/patches/2.11.1-0001-fix-find-asio-and-tinyxml2.patch +++ /dev/null @@ -1,31 +0,0 @@ -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.13.3-0001-fix-find-asio-and-tinyxml2.patch b/recipes/fast-dds/all/patches/2.13.3-0001-fix-find-asio-and-tinyxml2.patch new file mode 100644 index 0000000000000..414ee059e1b42 --- /dev/null +++ b/recipes/fast-dds/all/patches/2.13.3-0001-fix-find-asio-and-tinyxml2.patch @@ -0,0 +1,31 @@ +From 7d4f8a198ce34570c3c5b678f74240a8c5b9eae8 Mon Sep 17 00:00:00 2001 +From: Wade Hunkapiller +Date: Mon, 18 Mar 2024 15:57:02 -0500 +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 5ccb97a1b..ac6630c44 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -234,9 +234,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.39.3 + diff --git a/recipes/fast-dds/all/patches/2.13.3-0002-add-gettid-macro-for-glibc-compat.patch b/recipes/fast-dds/all/patches/2.13.3-0002-add-gettid-macro-for-glibc-compat.patch new file mode 100644 index 0000000000000..da528c2501e0d --- /dev/null +++ b/recipes/fast-dds/all/patches/2.13.3-0002-add-gettid-macro-for-glibc-compat.patch @@ -0,0 +1,31 @@ +From 12de52b7074f653cf9a1d1fed8f9f83a4030319d Mon Sep 17 00:00:00 2001 +From: WADE HUNKAPILLER +Date: Fri, 15 Mar 2024 10:45:45 -0500 +Subject: [PATCH] add gettid macro for glibc compat + +--- + src/cpp/utils/threading/threading_pthread.ipp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/cpp/utils/threading/threading_pthread.ipp b/src/cpp/utils/threading/threading_pthread.ipp +index 75ad33f2d..252f60c77 100644 +--- a/src/cpp/utils/threading/threading_pthread.ipp ++++ b/src/cpp/utils/threading/threading_pthread.ipp +@@ -25,6 +25,14 @@ + #include + #include + ++#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 30))) ++ #include ++ #ifndef SYS_gettid ++ #error "SYS_gettid unavailable on this system" ++ #endif ++ #define gettid() ((pid_t)syscall(SYS_gettid)) ++#endif ++ + namespace eprosima { + + template +-- +2.39.3 + diff --git a/recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch b/recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch deleted file mode 100644 index 5d4d5bc2037bb..0000000000000 --- a/recipes/fast-dds/all/patches/2.3.2-0001-fix-find-asio-and-tinyxml2.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8a9cb0209..400c681e7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -225,8 +225,8 @@ if(NOT BUILD_SHARED_LIBS) - endif() - - eprosima_find_package(fastcdr REQUIRED) --eprosima_find_thirdparty(Asio asio VERSION 1.10.8) --eprosima_find_thirdparty(TinyXML2 tinyxml2) -+eprosima_find_thirdparty(asio REQUIRED) -+eprosima_find_thirdparty(tinyxml2 REQUIRED) - - find_package(foonathan_memory REQUIRED) - message(STATUS "Found foonathan_memory: ${foonathan_memory_DIR}") -diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt -index 04d313bf2..efd1f9f7a 100644 ---- a/src/cpp/CMakeLists.txt -+++ b/src/cpp/CMakeLists.txt -@@ -434,7 +434,7 @@ elseif(NOT EPROSIMA_INSTALLER) - $ - $ - PRIVATE -- ${Asio_INCLUDE_DIR} -+ ${asio_INCLUDE_DIR} - ${TINYXML2_INCLUDE_DIR} - $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> - ${THIRDPARTY_BOOST_INCLUDE_DIR} -@@ -455,7 +455,7 @@ elseif(NOT EPROSIMA_INSTALLER) - # Link library to external libraries. - target_link_libraries(${PROJECT_NAME} ${PRIVACY} fastcdr foonathan_memory - ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} -- ${TINYXML2_LIBRARY} -+ tinyxml2::tinyxml2 - $<$:OpenSSL::SSL$OpenSSL::Crypto> - $<$:iphlpapi$Shlwapi> - ${THIRDPARTY_BOOST_LINK_LIBS} -@@ -536,7 +536,7 @@ if(UNIX AND EPROSIMA_INSTALLER) - COMPONENT headers - ) - -- set_public_headers_directory(${Asio_INCLUDE_DIR} "" -+ set_public_headers_directory(${asio_INCLUDE_DIR} "" - DESTINATION thirdparty/asio - COMPONENT headers - ) diff --git a/recipes/fast-dds/all/test_package/CMakeLists.txt b/recipes/fast-dds/all/test_package/CMakeLists.txt index d158385cb30f9..fbfb035dfe0a2 100644 --- a/recipes/fast-dds/all/test_package/CMakeLists.txt +++ b/recipes/fast-dds/all/test_package/CMakeLists.txt @@ -3,11 +3,21 @@ project(test_package CXX) find_package(fastdds REQUIRED CONFIG) -add_executable(${PROJECT_NAME} - test_package.cpp +add_executable(${PROJECT_NAME} test_package.cpp) + +if ("${fastdds_VERSION}" VERSION_LESS "2.12.0") + target_sources(${PROJECT_NAME} PRIVATE msg/HelloWorld.cxx - msg/HelloWorldPubSubTypes.cxx -) + msg/HelloWorldPubSubTypes.cxx) + target_include_directories(${PROJECT_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/msg) +else() + target_sources(${PROJECT_NAME} PRIVATE + msg2/HelloWorld.cxx + msg2/HelloWorldPubSubTypes.cxx) + target_include_directories(${PROJECT_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/msg2) +endif() target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) target_link_libraries(${PROJECT_NAME} fastrtps) diff --git a/recipes/fast-dds/all/test_package/msg2/HelloWorld.cxx b/recipes/fast-dds/all/test_package/msg2/HelloWorld.cxx new file mode 100644 index 0000000000000..ef9331d5d9e6d --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg2/HelloWorld.cxx @@ -0,0 +1,165 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +HelloWorld::HelloWorld() +{ +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + m_message = x.m_message; +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + m_message = std::move(x.m_message); +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + + m_index = x.m_index; + m_message = x.m_message; + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" + diff --git a/recipes/fast-dds/all/test_package/msg2/HelloWorld.h b/recipes/fast-dds/all/test_package/msg2/HelloWorld.h new file mode 100644 index 0000000000000..b95bcb5b146dd --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg2/HelloWorld.h @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + diff --git a/recipes/fast-dds/all/test_package/msg2/HelloWorld.idl b/recipes/fast-dds/all/test_package/msg2/HelloWorld.idl new file mode 100644 index 0000000000000..0fd2c355aeefa --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg2/HelloWorld.idl @@ -0,0 +1,5 @@ +struct HelloWorld +{ + unsigned long index; + string message; +}; diff --git a/recipes/fast-dds/all/test_package/msg2/HelloWorldCdrAux.hpp b/recipes/fast-dds/all/test_package/msg2/HelloWorldCdrAux.hpp new file mode 100644 index 0000000000000..9f346d306beca --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg2/HelloWorldCdrAux.hpp @@ -0,0 +1,48 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorldCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + +#include "HelloWorld.h" + +constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; +constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const HelloWorld& data); + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/recipes/fast-dds/all/test_package/msg2/HelloWorldCdrAux.ipp b/recipes/fast-dds/all/test_package/msg2/HelloWorldCdrAux.ipp new file mode 100644 index 0000000000000..42e91f3cc384a --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg2/HelloWorldCdrAux.ipp @@ -0,0 +1,128 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorldCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + +#include "HelloWorldCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const HelloWorld& data, + size_t& current_alignment) +{ + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.index(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.message(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const HelloWorld& data) +{ + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.index() + << eprosima::fastcdr::MemberId(1) << data.message() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + HelloWorld& data) +{ + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.index(); + break; + + case 1: + dcdr >> data.message(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const HelloWorld& data) +{ + static_cast(scdr); + static_cast(data); +} + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/recipes/fast-dds/all/test_package/msg2/HelloWorldPubSubTypes.cxx b/recipes/fast-dds/all/test_package/msg2/HelloWorldPubSubTypes.cxx new file mode 100644 index 0000000000000..85cb477896e60 --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg2/HelloWorldPubSubTypes.cxx @@ -0,0 +1,221 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorldPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "HelloWorldPubSubTypes.h" +#include "HelloWorldCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + + +HelloWorldPubSubType::HelloWorldPubSubType() +{ + setName("HelloWorld"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = HelloWorld_max_key_cdr_typesize > 16 ? HelloWorld_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +HelloWorldPubSubType::~HelloWorldPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool HelloWorldPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + HelloWorld* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool HelloWorldPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + HelloWorld* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function HelloWorldPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* HelloWorldPubSubType::createData() +{ + return reinterpret_cast(new HelloWorld()); +} + +void HelloWorldPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool HelloWorldPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + HelloWorld* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + HelloWorld_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else + eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) + { + m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; +} + diff --git a/recipes/fast-dds/all/test_package/msg2/HelloWorldPubSubTypes.h b/recipes/fast-dds/all/test_package/msg2/HelloWorldPubSubTypes.h new file mode 100644 index 0000000000000..cb61cd6ba2335 --- /dev/null +++ b/recipes/fast-dds/all/test_package/msg2/HelloWorldPubSubTypes.h @@ -0,0 +1,132 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorldPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "HelloWorld.h" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated HelloWorld is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + + + + +/*! + * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef HelloWorld type; + + eProsima_user_DllExport HelloWorldPubSubType(); + + eProsima_user_DllExport ~HelloWorldPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ + diff --git a/recipes/fast-dds/all/test_package/test_package.cpp b/recipes/fast-dds/all/test_package/test_package.cpp index 89ac973375f14..f183dbe4586b0 100644 --- a/recipes/fast-dds/all/test_package/test_package.cpp +++ b/recipes/fast-dds/all/test_package/test_package.cpp @@ -5,12 +5,12 @@ #include #include -#include "msg/HelloWorld.h" -#include "msg/HelloWorldPubSubTypes.h" +#include "HelloWorld.h" +#include "HelloWorldPubSubTypes.h" int main() { - // Define msg to send + // Define msg to send HelloWorld hello; hello.index(0); hello.message("HelloWorld"); diff --git a/recipes/fast-dds/config.yml b/recipes/fast-dds/config.yml index 1a933c21ca9ca..101b2295a806a 100644 --- a/recipes/fast-dds/config.yml +++ b/recipes/fast-dds/config.yml @@ -1,13 +1,13 @@ versions: - "2.11.2": + "2.14.3": folder: all - "2.11.1": + "2.14.0": folder: all - "2.10.1": + "2.13.3": folder: all - "2.3.4": + "2.11.2": folder: all - "2.3.3": + "2.10.1": folder: all - "2.3.2": + "2.3.4": folder: all diff --git a/recipes/fast_double_parser/all/conandata.yml b/recipes/fast_double_parser/all/conandata.yml index e6359076757f6..b8e8bab6d1227 100644 --- a/recipes/fast_double_parser/all/conandata.yml +++ b/recipes/fast_double_parser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.0": + url: "https://github.com/lemire/fast_double_parser/archive/v0.8.0.tar.gz" + sha256: "9ad74e059cc7c3e53a3057ca97a74c88ae2a6a7d36ce470193557cbd05ee8f92" "0.7.0": url: "https://github.com/lemire/fast_double_parser/archive/v0.7.0.tar.gz" sha256: "eb80a1d9c406bbe8cb22fffd3c007651f716abd03225009302d8aba8e9c4df77" diff --git a/recipes/fast_double_parser/all/conanfile.py b/recipes/fast_double_parser/all/conanfile.py index 872d82f578707..824ad38a512bb 100644 --- a/recipes/fast_double_parser/all/conanfile.py +++ b/recipes/fast_double_parser/all/conanfile.py @@ -10,12 +10,12 @@ class FastDoubleParserConan(ConanFile): name = "fast_double_parser" description = "Fast function to parse strings into double (binary64) floating-point values, enforces the RFC 7159 (JSON standard) grammar: 4x faster than strtod" - topics = ("numerical", "header-only") + license = ("Apache-2.0", "BSL-1.0") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lemire/fast_double_parser" - license = ("Apache-2.0", "BSL-1.0") + topics = ("numerical", "header-only") package_type = "header-library" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True def layout(self): diff --git a/recipes/fast_double_parser/all/test_package/CMakeLists.txt b/recipes/fast_double_parser/all/test_package/CMakeLists.txt index 00ff6376bfebe..f6b8c9e891868 100644 --- a/recipes/fast_double_parser/all/test_package/CMakeLists.txt +++ b/recipes/fast_double_parser/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(fast_double_parser REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} fast_double_parser::fast_double_parser) +target_link_libraries(${PROJECT_NAME} PRIVATE fast_double_parser::fast_double_parser) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/fast_double_parser/all/test_v1_package/CMakeLists.txt b/recipes/fast_double_parser/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/fast_double_parser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fast_double_parser/all/test_v1_package/conanfile.py b/recipes/fast_double_parser/all/test_v1_package/conanfile.py deleted file mode 100644 index 90eb89e3f2f46..0000000000000 --- a/recipes/fast_double_parser/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/fast_double_parser/config.yml b/recipes/fast_double_parser/config.yml index d61439bae1bc3..4dec0affe6753 100644 --- a/recipes/fast_double_parser/config.yml +++ b/recipes/fast_double_parser/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.0": + folder: all "0.7.0": folder: all "0.6.0": diff --git a/recipes/fast_float/all/conandata.yml b/recipes/fast_float/all/conandata.yml index 291d202302e37..187b0fbd90a11 100644 --- a/recipes/fast_float/all/conandata.yml +++ b/recipes/fast_float/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "8.0.0": + url: "https://github.com/fastfloat/fast_float/archive/v8.0.0.tar.gz" + sha256: "f312f2dc34c61e665f4b132c0307d6f70ad9420185fa831911bc24408acf625d" + "7.0.0": + url: "https://github.com/fastfloat/fast_float/archive/v7.0.0.tar.gz" + sha256: "d2a08e722f461fe699ba61392cd29e6b23be013d0f56e50c7786d0954bffcb17" + "6.1.5": + url: "https://github.com/fastfloat/fast_float/archive/v6.1.5.tar.gz" + sha256: "597126ff5edc3ee59d502c210ded229401a30dafecb96a513135e9719fcad55f" + "6.1.4": + url: "https://github.com/fastfloat/fast_float/archive/v6.1.4.tar.gz" + sha256: "12cb6d250824160ca16bcb9d51f0ca7693d0d10cb444f34f1093bc02acfce704" + "6.1.3": + url: "https://github.com/fastfloat/fast_float/archive/v6.1.3.tar.gz" + sha256: "7dd99cc2ff44e07dc2a42bed0c6b8c4a8ee4e3b1c330f77073b6cfdb48724c8e" + "6.1.1": + url: "https://github.com/fastfloat/fast_float/archive/v6.1.1.tar.gz" + sha256: "10159a4a58ba95fe9389c3c97fe7de9a543622aa0dcc12dd9356d755e9a94cb4" + "6.1.0": + url: "https://github.com/fastfloat/fast_float/archive/v6.1.0.tar.gz" + sha256: "5a629e1f18f037ad0016c41ead630ea471cccbcdf60239ed3466c491d8e7c908" "6.0.0": url: "https://github.com/fastfloat/fast_float/archive/v6.0.0.tar.gz" sha256: "7e98671ef4cc7ed7f44b3b13f80156c8d2d9244fac55deace28bd05b0a2c7c8e" diff --git a/recipes/fast_float/all/conanfile.py b/recipes/fast_float/all/conanfile.py index ec98c563d0552..70247daa50c98 100644 --- a/recipes/fast_float/all/conanfile.py +++ b/recipes/fast_float/all/conanfile.py @@ -11,9 +11,9 @@ class FastFloatConan(ConanFile): description = "Fast and exact implementation of the C++ from_chars " \ "functions for float and double types." 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" + topics = ("conversion", "from_chars", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -50,3 +50,5 @@ def package_info(self): self.cpp_info.components["fastfloat"].names["cmake_find_package"] = "fast_float" self.cpp_info.components["fastfloat"].names["cmake_find_package_multi"] = "fast_float" self.cpp_info.components["fastfloat"].set_property("cmake_target_name", "FastFloat::fast_float") + self.cpp_info.components["fastfloat"].bindirs = [] + self.cpp_info.components["fastfloat"].libdirs = [] diff --git a/recipes/fast_float/all/test_package/CMakeLists.txt b/recipes/fast_float/all/test_package/CMakeLists.txt index 4e77f3f59c71c..0b1f459eff3e0 100644 --- a/recipes/fast_float/all/test_package/CMakeLists.txt +++ b/recipes/fast_float/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(FastFloat REQUIRED CONFIG) diff --git a/recipes/fast_float/all/test_package/conanfile.py b/recipes/fast_float/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/fast_float/all/test_package/conanfile.py +++ b/recipes/fast_float/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/fast_float/all/test_v1_package/CMakeLists.txt b/recipes/fast_float/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/fast_float/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fast_float/all/test_v1_package/conanfile.py b/recipes/fast_float/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/fast_float/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_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/fast_float/config.yml b/recipes/fast_float/config.yml index 4e03f0967676d..b6bbecff94936 100644 --- a/recipes/fast_float/config.yml +++ b/recipes/fast_float/config.yml @@ -1,4 +1,18 @@ versions: + "8.0.0": + folder: all + "7.0.0": + folder: all + "6.1.5": + folder: all + "6.1.4": + folder: all + "6.1.3": + folder: all + "6.1.1": + folder: all + "6.1.0": + folder: all "6.0.0": folder: all "5.3.0": diff --git a/recipes/fast_io/all/conandata.yml b/recipes/fast_io/all/conandata.yml new file mode 100644 index 0000000000000..849d1ed038071 --- /dev/null +++ b/recipes/fast_io/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "cci.20240729": + url: "https://github.com/cppfastio/fast_io/archive/44617e9368b64047fabd00cd98b037c1c2fc7fb2.tar.gz" + sha256: "077692f72f2a7e3fed44fa5b37613d058657738c2592addfcb6559cf1ae30716" + "cci.20240219": + url: "https://github.com/cppfastio/fast_io/archive/316afccde333721b059a761b25217084e84a9ca0.tar.gz" + sha256: "9feab7802957c8069b2a112f97bfb885d503ff5d7f433197f47636f40a20188a" diff --git a/recipes/fast_io/all/conanfile.py b/recipes/fast_io/all/conanfile.py new file mode 100644 index 0000000000000..32f435f8730b5 --- /dev/null +++ b/recipes/fast_io/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 FastIoConan(ConanFile): + name = "fast_io" + description = "fast_io is a C++ io exception-safe RAII library based on C++ 20 Concepts. It is at least 10 times faster than cstdio than iostream." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cppfastio/fast_io" + topics = ("cstdio", "iostream", "io", "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": "13", + "clang": "15", + # Apple-Clang 13 is not enough in this case, + # partial support for concepts + "apple-clang": "14", + "Visual Studio": "17", + "msvc": "193", + } + + 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.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=os.path.join(self.source_folder, "include"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/fast_io/all/test_package/CMakeLists.txt b/recipes/fast_io/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4c7b9716f8c5b --- /dev/null +++ b/recipes/fast_io/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(fast_io REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fast_io::fast_io) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/fast_io/all/test_package/conanfile.py b/recipes/fast_io/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b9d7f11e89dcd --- /dev/null +++ b/recipes/fast_io/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fast_io/all/test_package/test_package.cpp b/recipes/fast_io/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0e163592d3756 --- /dev/null +++ b/recipes/fast_io/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include "fast_io.h" + +int main() { + fast_io::io::print(4, " " ,4, "\n"); + + return 0; +} diff --git a/recipes/fast_io/config.yml b/recipes/fast_io/config.yml new file mode 100644 index 0000000000000..7559ae4709057 --- /dev/null +++ b/recipes/fast_io/config.yml @@ -0,0 +1,5 @@ +versions: + "cci.20240729": + folder: all + "cci.20240219": + folder: all diff --git a/recipes/fastgltf/all/conandata.yml b/recipes/fastgltf/all/conandata.yml index 7785359a1abd0..545c9bc5e4cc0 100644 --- a/recipes/fastgltf/all/conandata.yml +++ b/recipes/fastgltf/all/conandata.yml @@ -1,21 +1,7 @@ sources: - "0.6.1": - url: "https://github.com/spnda/fastgltf/archive/refs/tags/v0.6.1.tar.gz" - sha256: "5f10b153ec941f5e6465425f542d3864f586aca040b0b659cb9ae70d42369390" - "0.5.0": - url: "https://github.com/spnda/fastgltf/archive/refs/tags/v0.5.0.tar.gz" - sha256: "f67558da009bfd1174b3f32606c41c20fe6fbcb70fc516e9f7bf0f63c06e87ff" - "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" + "0.8.0": + url: "https://github.com/spnda/fastgltf/archive/refs/tags/v0.8.0.tar.gz" + sha256: "0bc88a0858c88d94306443946a5a1606118b7d5e4960f1e6186a3632e9df38fb" + "0.7.2": + url: "https://github.com/spnda/fastgltf/archive/refs/tags/v0.7.2.tar.gz" + sha256: "292fc9d0d5a6726c90db88c1aadf09e6d152ffc0ebffe6fb968736c47288511c" diff --git a/recipes/fastgltf/all/conanfile.py b/recipes/fastgltf/all/conanfile.py index 9eda29e2b49eb..871bcd951544e 100644 --- a/recipes/fastgltf/all/conanfile.py +++ b/recipes/fastgltf/all/conanfile.py @@ -1,13 +1,11 @@ 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.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.59.0" +required_conan_version = ">2.0" class fastgltf(ConanFile): @@ -34,31 +32,10 @@ class fastgltf(ConanFile): "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") @@ -67,35 +44,29 @@ def layout(self): cmake_layout(self, src_folder='src') def requirements(self): - self.requires("simdjson/3.2.0") + self.requires("simdjson/3.11.5") 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." - ) + check_min_cppstd(self, 17) 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 + tc.variables["FASTGLTF_USE_CUSTOM_SMALLVECTOR"] = 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.variables["FASTGLTF_COMPILE_AS_CPP20"] = "20" in str(self.settings.get_safe("compiler.cppstd")) tc.generate() deps = CMakeDeps(self) deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -108,3 +79,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["fastgltf"] + if "20" in str(self.settings.get_safe("compiler.cppstd")): + self.cpp_info.defines.append("FASTGLTF_CPP_20") 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 deleted file mode 100644 index 488ed53394d16..0000000000000 --- a/recipes/fastgltf/all/patches/0.5.0-0001-find_package-simdjson.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index d3ad49785a09a..0000000000000 --- a/recipes/fastgltf/all/patches/0.6.1-0001-find_package-simdjson.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 index 7718a933cdc53..f4b4e719cdf11 100644 --- a/recipes/fastgltf/all/test_package/CMakeLists.txt +++ b/recipes/fastgltf/all/test_package/CMakeLists.txt @@ -1,11 +1,7 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) 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/test_package.cpp b/recipes/fastgltf/all/test_package/test_package.cpp index 1e9f5938b4446..8c8feea8d5fe9 100644 --- a/recipes/fastgltf/all/test_package/test_package.cpp +++ b/recipes/fastgltf/all/test_package/test_package.cpp @@ -1,24 +1,8 @@ -#include -#ifdef FASTGLTF_0_5_0_LATER -# include -#else -# include -#endif - -#include -#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::Exporter exporter; + exporter.setUserPointer(nullptr); - 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"); + return 0; } diff --git a/recipes/fastgltf/all/test_v1_package/CMakeLists.txt b/recipes/fastgltf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/fastgltf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fastgltf/all/test_v1_package/conanfile.py b/recipes/fastgltf/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/fastgltf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/fastgltf/config.yml b/recipes/fastgltf/config.yml index 355c180a5e90b..884ba94a455c4 100644 --- a/recipes/fastgltf/config.yml +++ b/recipes/fastgltf/config.yml @@ -1,7 +1,5 @@ versions: - "0.6.1": + "0.8.0": folder: all - "0.5.0": - folder: all - "0.4.0": + "0.7.2": folder: all diff --git a/recipes/fastpfor/all/conandata.yml b/recipes/fastpfor/all/conandata.yml index e16837fea8797..28f460ca23316 100644 --- a/recipes/fastpfor/all/conandata.yml +++ b/recipes/fastpfor/all/conandata.yml @@ -1,17 +1,9 @@ sources: - "cci.20221225": - url: "https://github.com/lemire/FastPFor/archive/3e7358f8656b4456f4ea1762075553f2984fefcf.tar.gz" - sha256: "cc50b03421db3aa21be2243f5996ea6d027a6563e0863b77cfc46dd08bcfcaf5" - "cci.20220205": - url: "https://github.com/lemire/FastPFor/archive/773283d4a11fa2440a1b3b28fd77f775e86d7898.tar.gz" - sha256: "d4419512420f3bcc65862c5c367021f201b5ba3e8cb0dad895cdf444e0867b30" - + "0.2.0": + url: "https://github.com/lemire/FastPFor/archive/refs/tags/v0.2.0.tar.gz" + sha256: "d9f0eacf9c3c61866cda23bae35107ca9c5d35fa7b7a96ca9ccc85803d7e753d" patches: - "cci.20221225": - - patch_file: "patches/cci.20221225-0001-fix-cmake.patch" - patch_description: "enable shared build, disable unittest/utility" - patch_type: "conan" - "cci.20220205": - - patch_file: "patches/cci.20220205-0001-fix-cmake.patch" + "0.2.0": + - patch_file: "patches/0.2.0-0001-fix-cmake.patch" patch_description: "enable shared build, disable unittest/utility" patch_type: "conan" diff --git a/recipes/fastpfor/all/conanfile.py b/recipes/fastpfor/all/conanfile.py index 3ea949a5a46d9..3e02d3498b338 100644 --- a/recipes/fastpfor/all/conanfile.py +++ b/recipes/fastpfor/all/conanfile.py @@ -2,10 +2,13 @@ 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, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.apple import is_apple_os +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" + class FastPFORConan(ConanFile): name = "fastpfor" description = "Fast integer compression" @@ -13,13 +16,12 @@ class FastPFORConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lemire/FastPFor" topics = ("compression", "sorted-lists", "simd", "x86", "x86-64") + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], "fPIC": [True, False], } default_options = { - "shared": False, "fPIC": True, } @@ -30,30 +32,37 @@ 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.arch != "x86_64": - raise ConanInvalidConfiguration(f"{self.settings.arch} architecture is not supported") + @property + def _has_simde(self): + return "arm" in str(self.settings.arch) + + def requirements(self): + if self._has_simde: + self.requires("simde/0.8.0", transitive_headers=True) - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, "11") + def validate(self): + check_min_cppstd(self, 11) + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "15.0": + raise ConanInvalidConfiguration("${self.ref} doesn't support ${self.settings.compiler} < 15.0") def source(self): 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 + tc.variables["WITH_TEST"] = False + if self._has_simde: + tc.cache_variables["SUPPORT_NEON"] = True + tc.preprocessor_definitions["SIMDE_ENABLE_NATIVE_ALIASES"] = 1 + tc.generate() + tc = CMakeDeps(self) tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -75,8 +84,5 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "FastPFOR" - self.cpp_info.filenames["cmake_find_package_multi"] = "FastPFOR" - self.cpp_info.names["cmake_find_package"] = "FastPFOR" - self.cpp_info.names["cmake_find_package_multi"] = "FastPFOR" + if self._has_simde: + self.cpp_info.defines = ["SIMDE_ENABLE_NATIVE_ALIASES"] diff --git a/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..8ba1054fb355a --- /dev/null +++ b/recipes/fastpfor/all/patches/0.2.0-0001-fix-cmake.patch @@ -0,0 +1,85 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f06b25f..1f6bd0f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,7 +4,7 @@ + # Copyright (c) 2012 Louis Dionne + # + cmake_minimum_required(VERSION 3.0) +-set (CMAKE_CXX_STANDARD 11) # for constexpr specifier and other goodies ++# set (CMAKE_CXX_STANDARD 11) # for constexpr specifier and other goodies + + if (NOT CMAKE_BUILD_TYPE) + message(STATUS "No build type selected, default to Release") +@@ -62,7 +62,7 @@ if( SUPPORT_SSE42 ) + MESSAGE( STATUS "SSE 4.2 support detected" ) + else() + if (SUPPORT_NEON) +- include("${CMAKE_MODULE_PATH}/simde.cmake") ++ find_package(simde REQUIRED CONFIG) + MESSAGE(STATUS "USING SIMDE FOR SIMD OPERATIONS") + else () + MESSAGE(STATUS "SIMDE and SSE 4.2 support not detected") +@@ -103,6 +103,10 @@ elseif(WIN32) + if(NOT MSVC12) + message(STATUS "On Windows, only MSVC version 12 is supported!") + endif() ++ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") ++ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX") ++ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /arch:AVX") ++ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX") + else () + message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") + endif() +@@ -129,19 +133,19 @@ add_library(FastPFOR STATIC + src/streamvbyte.c) + set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + +- ++if(0) + # other executables + add_executable(gapstats src/gapstats.cpp) + add_executable(partitionbylength src/partitionbylength.cpp) + add_executable(csv2maropu src/csv2maropu.cpp) +- ++endif() + if (SUPPORT_NEON) +- target_link_libraries(FastPFOR PUBLIC simde) +- target_link_libraries(gapstats PUBLIC simde) +- target_link_libraries(partitionbylength PUBLIC simde) +- target_link_libraries(csv2maropu PUBLIC simde) ++ target_link_libraries(FastPFOR PUBLIC simde::simde) ++ # target_link_libraries(gapstats PUBLIC simde::simde) ++ # target_link_libraries(partitionbylength PUBLIC simde::simde) ++ # target_link_libraries(csv2maropu PUBLIC simde::simde) + endif() +- ++if(0) + add_executable(entropy src/entropy.cpp) + target_link_libraries(entropy FastPFOR) + +@@ -149,7 +153,7 @@ if( SUPPORT_SSE42 ) + add_executable(benchbitpacking src/benchbitpacking.cpp) + target_link_libraries(benchbitpacking FastPFOR) + endif() +- ++endif() + find_package(snappy) + if(NOT ${snappy_FOUND}) + message(STATUS "Snappy was not found. codecssnappy and " +@@ -158,6 +162,7 @@ else() + message(STATUS "Snappy was found. Building additional targets " + "codecssnappy and inmemorybenchmarksnappy.") + include_directories(${snappy_INCLUDE_DIRS}) ++ if(0) + add_executable(codecssnappy src/codecs.cpp) + set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) + target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) +@@ -165,6 +170,7 @@ else() + add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) + set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) + target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) ++ endif() + endif() + + option(WITH_TEST "Build with Google Test" ON) diff --git a/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch deleted file mode 100644 index 831aaf49de782..0000000000000 --- a/recipes/fastpfor/all/patches/cci.20220205-0001-fix-cmake.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5520747..dfccbc1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -94,6 +94,10 @@ elseif(WIN32) - if(NOT MSVC12) - message(STATUS "On Windows, only MSVC version 12 is supported!") - endif() -+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") -+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX") -+ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /arch:AVX") -+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX") - else () - message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") - endif() -@@ -108,7 +112,7 @@ MESSAGE( STATUS "CMAKE_C_FLAGS_RELEASE: " ${CMAKE_C_FLAGS_RELEASE} ) - - # library target - include_directories(headers) --add_library(FastPFOR STATIC -+add_library(FastPFOR - src/bitpacking.cpp - src/bitpackingaligned.cpp - src/bitpackingunaligned.cpp -@@ -117,9 +121,8 @@ add_library(FastPFOR STATIC - src/simdbitpacking.cpp - src/varintdecode.c - src/streamvbyte.c) --set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) -- - -+if(0) - # other executables - add_executable(gapstats src/gapstats.cpp) - add_executable(partitionbylength src/partitionbylength.cpp) -@@ -132,6 +135,7 @@ if( SUPPORT_SSE42 ) - add_executable(benchbitpacking src/benchbitpacking.cpp) - target_link_libraries(benchbitpacking FastPFOR) - endif() -+endif(0) - - find_package(snappy) - if(NOT ${snappy_FOUND}) -@@ -141,6 +145,8 @@ else() - message(STATUS "Snappy was found. Building additional targets " - "codecssnappy and inmemorybenchmarksnappy.") - include_directories(${snappy_INCLUDE_DIRS}) -+ -+ if(0) - add_executable(codecssnappy src/codecs.cpp) - set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) - target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) -@@ -148,8 +154,10 @@ else() - add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) - set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) - target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) -+ endif(0) - endif() - -+if(0) - # Download and unpack googletest at configure time - configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) - execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -@@ -207,7 +215,7 @@ target_link_libraries(FastPFOR_unittest gtest FastPFOR) - enable_testing() - add_test("unit" unit) - add_test("FastPFOR_unittest" FastPFOR_unittest) -- -+endif(0) - - include(GNUInstallDirs) - install(TARGETS FastPFOR diff --git a/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch b/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch deleted file mode 100644 index 9ac6f1894f7c7..0000000000000 --- a/recipes/fastpfor/all/patches/cci.20221225-0001-fix-cmake.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 118fc00..d57a46e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -94,6 +94,10 @@ elseif(WIN32) - if(NOT MSVC12) - message(STATUS "On Windows, only MSVC version 12 is supported!") - endif() -+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") -+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX") -+ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /arch:AVX") -+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX") - else () - message(FATAL_ERROR "Please, use GCC, Clang, or the Intel compiler!") - endif() -@@ -108,7 +112,7 @@ MESSAGE( STATUS "CMAKE_C_FLAGS_RELEASE: " ${CMAKE_C_FLAGS_RELEASE} ) - - # library target - include_directories(headers) --add_library(FastPFOR STATIC -+add_library(FastPFOR - src/bitpacking.cpp - src/bitpackingaligned.cpp - src/bitpackingunaligned.cpp -@@ -118,9 +122,9 @@ add_library(FastPFOR STATIC - src/simdbitpacking.cpp - src/varintdecode.c - src/streamvbyte.c) --set_target_properties(FastPFOR PROPERTIES POSITION_INDEPENDENT_CODE TRUE) - - -+if(0) - # other executables - add_executable(gapstats src/gapstats.cpp) - add_executable(partitionbylength src/partitionbylength.cpp) -@@ -133,6 +137,7 @@ if( SUPPORT_SSE42 ) - add_executable(benchbitpacking src/benchbitpacking.cpp) - target_link_libraries(benchbitpacking FastPFOR) - endif() -+endif() - - find_package(snappy) - if(NOT ${snappy_FOUND}) -@@ -142,6 +147,7 @@ else() - message(STATUS "Snappy was found. Building additional targets " - "codecssnappy and inmemorybenchmarksnappy.") - include_directories(${snappy_INCLUDE_DIRS}) -+ if(0) - add_executable(codecssnappy src/codecs.cpp) - set_target_properties(codecssnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) - target_link_libraries(codecssnappy FastPFOR ${snappy_LIBRARIES}) -@@ -149,8 +155,10 @@ else() - add_executable(inmemorybenchmarksnappy src/inmemorybenchmark.cpp) - set_target_properties(inmemorybenchmarksnappy PROPERTIES DEFINE_SYMBOL USESNAPPY) - target_link_libraries(inmemorybenchmarksnappy FastPFOR ${snappy_LIBRARIES}) -+ endif() - endif() - -+if(0) - # Download and unpack googletest at configure time - configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) - execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -@@ -208,7 +216,7 @@ target_link_libraries(FastPFOR_unittest gtest FastPFOR) - enable_testing() - add_test("unit" unit) - add_test("FastPFOR_unittest" FastPFOR_unittest) -- -+endif() - - include(GNUInstallDirs) - install(TARGETS FastPFOR diff --git a/recipes/fastpfor/all/test_package/CMakeLists.txt b/recipes/fastpfor/all/test_package/CMakeLists.txt index f466c43ce9867..d3287d7ee8cb8 100644 --- a/recipes/fastpfor/all/test_package/CMakeLists.txt +++ b/recipes/fastpfor/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(FastPFOR REQUIRED CONFIG) diff --git a/recipes/fastpfor/all/test_v1_package/CMakeLists.txt b/recipes/fastpfor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/fastpfor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fastpfor/all/test_v1_package/conanfile.py b/recipes/fastpfor/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/fastpfor/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/fastpfor/config.yml b/recipes/fastpfor/config.yml index 216ef81b387a5..b370fcee5fe7c 100644 --- a/recipes/fastpfor/config.yml +++ b/recipes/fastpfor/config.yml @@ -1,5 +1,3 @@ versions: - "cci.20221225": - folder: all - "cci.20220205": + "0.2.0": folder: all diff --git a/recipes/fastprng/all/test_package/CMakeLists.txt b/recipes/fastprng/all/test_package/CMakeLists.txt index a0f34e4c094ac..6baa5340cbad9 100644 --- a/recipes/fastprng/all/test_package/CMakeLists.txt +++ b/recipes/fastprng/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(fastprng CONFIG REQUIRED) diff --git a/recipes/fastprng/all/test_v1_package/CMakeLists.txt b/recipes/fastprng/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7ea0378c83fe1..0000000000000 --- a/recipes/fastprng/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/fastprng/all/test_v1_package/conanfile.py b/recipes/fastprng/all/test_v1_package/conanfile.py deleted file mode 100644 index aaf25befb2087..0000000000000 --- a/recipes/fastprng/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/fcl/all/conanfile.py b/recipes/fcl/all/conanfile.py index 7e41afda3be3f..2fd6a5fe45165 100644 --- a/recipes/fcl/all/conanfile.py +++ b/recipes/fcl/all/conanfile.py @@ -47,10 +47,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("eigen/3.4.0") - self.requires("libccd/2.1") + # Used in fcl/common/types.h public header + self.requires("eigen/3.4.0", transitive_headers=True) + # Used in fcl/narrowphase/detail/convexity_based_algorithm/support.h + self.requires("libccd/2.1", transitive_headers=True) if self.options.with_octomap: - self.requires("octomap/1.9.7") + # Used in fcl/geometry/octree/octree.h + self.requires("octomap/1.9.7", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -63,25 +66,25 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["FCL_ENABLE_PROFILING"] = False - tc.variables["FCL_TREAT_WARNINGS_AS_ERRORS"] = False - tc.variables["FCL_HIDE_ALL_SYMBOLS"] = False - tc.variables["FCL_STATIC_LIBRARY"] = not self.options.shared - tc.variables["FCL_USE_X64_SSE"] = False # Let consumer decide to add relevant compile options, fcl doesn't have simd intrinsics - tc.variables["FCL_USE_HOST_NATIVE_ARCH"] = False - tc.variables["FCL_USE_SSE"] = False - tc.variables["FCL_COVERALLS"] = False - tc.variables["FCL_COVERALLS_UPLOAD"] = False - tc.variables["FCL_WITH_OCTOMAP"] = self.options.with_octomap + tc.cache_variables["FCL_ENABLE_PROFILING"] = False + tc.cache_variables["FCL_TREAT_WARNINGS_AS_ERRORS"] = False + tc.cache_variables["FCL_HIDE_ALL_SYMBOLS"] = False + tc.cache_variables["FCL_STATIC_LIBRARY"] = not self.options.shared + tc.cache_variables["FCL_USE_X64_SSE"] = False # Let consumer decide to add relevant compile options, fcl doesn't have simd intrinsics + tc.cache_variables["FCL_USE_HOST_NATIVE_ARCH"] = False + tc.cache_variables["FCL_USE_SSE"] = False + tc.cache_variables["FCL_COVERALLS"] = False + tc.cache_variables["FCL_COVERALLS_UPLOAD"] = False + tc.cache_variables["FCL_WITH_OCTOMAP"] = self.options.with_octomap if self.options.with_octomap: - octomap_version_str = self.dependencies["octomap"].ref.version - tc.variables["OCTOMAP_VERSION"] = octomap_version_str + octomap_version_str = str(self.dependencies["octomap"].ref.version) + tc.cache_variables["OCTOMAP_VERSION"] = octomap_version_str octomap_version = Version(octomap_version_str) - tc.variables["OCTOMAP_MAJOR_VERSION"] = octomap_version.major - tc.variables["OCTOMAP_MINOR_VERSION"] = octomap_version.minor - tc.variables["OCTOMAP_PATCH_VERSION"] = octomap_version.patch - tc.variables["BUILD_TESTING"] = False - tc.variables["FCL_NO_DEFAULT_RPATH"] = False + tc.cache_variables["OCTOMAP_MAJOR_VERSION"] = str(octomap_version.major) + tc.cache_variables["OCTOMAP_MINOR_VERSION"] = str(octomap_version.minor) + tc.cache_variables["OCTOMAP_PATCH_VERSION"] = str(octomap_version.patch) + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["FCL_NO_DEFAULT_RPATH"] = False tc.generate() cd = CMakeDeps(self) diff --git a/recipes/fcl/all/test_package/CMakeLists.txt b/recipes/fcl/all/test_package/CMakeLists.txt index 8f41ad8aed5d9..2ba1ce491f25d 100644 --- a/recipes/fcl/all/test_package/CMakeLists.txt +++ b/recipes/fcl/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(fcl REQUIRED CONFIG) diff --git a/recipes/fcl/all/test_package/test_package.cpp b/recipes/fcl/all/test_package/test_package.cpp index 0f0651d6aa60c..7142e516a4b32 100644 --- a/recipes/fcl/all/test_package/test_package.cpp +++ b/recipes/fcl/all/test_package/test_package.cpp @@ -1,78 +1,15 @@ -/* -From test_broadphase_dynamic_AABB_tree.cpp test in FCL test directory -*/ - -#include "fcl/common/types.h" -#include "fcl/geometry/shape/sphere.h" -#include "fcl/broadphase/broadphase_dynamic_AABB_tree.h" +#include #include -#include +#include int main() { - auto sphere0 = std::make_shared(0.1); - auto sphere1 = std::make_shared(0.2); - fcl::CollisionObjectd object0(sphere0); - fcl::CollisionObjectd object1(sphere1); - const fcl::Vector3d position0(0.1, 0.2, 0.3); - const fcl::Vector3d position1(0.11, 0.21, 0.31); - - // We will use `objects` to check the order of the two collision objects in - // our callback function. - // - // We use std::vector that contains *pointers* to CollisionObjectd, - // instead of std::vector that contains CollisionObjectd's. - // Previously we used std::vector, and it failed the - // Eigen alignment assertion on Win32. We also tried, without success, the - // custom allocator: - // std::vector>, - // but some platforms failed to build. - std::vector objects = {&object0, &object1}; - std::vector positions = {&position0, &position1}; - - fcl::DynamicAABBTreeCollisionManager dynamic_tree; - for (int i = 0; i < static_cast(objects.size()); ++i) { - objects[i]->setTranslation(*positions[i]); - objects[i]->computeAABB(); - dynamic_tree.registerObject(objects[i]); - } - - // Pack the data for callback function. - struct CallBackData { - bool expect_object0_then_object1; - std::vector* objects; - } data; - data.expect_object0_then_object1 = false; - data.objects = &objects; - - // This callback function tests the order of the two collision objects from - // the dynamic tree against the `data`. We assume that the first two - // parameters are always objects[0] and objects[1] in two possible orders, - // so we can safely ignore the second parameter. We do not use the last - // double& parameter, which specifies the distance beyond which the - // pair of objects will be skipped. - auto distance_callback = [](fcl::CollisionObjectd* a, fcl::CollisionObjectd*, - void* callback_data, double&) -> bool { - // Unpack the data. - auto data = static_cast(callback_data); - const std::vector& objects = *(data->objects); - const bool object0_first = a == objects[0]; - // EXPECT_EQ(data->expect_object0_then_object1, object0_first); - // TODO(DamrongGuoy): Remove the statement below when we solve the - // repeatability problem as mentioned in: - // https://github.com/flexible-collision-library/fcl/issues/368 - // Expect to switch the order next time. - data->expect_object0_then_object1 = !data->expect_object0_then_object1; - // Return true to stop the tree traversal. - return true; - }; - // We repeat update() and distance() many times. Each time, in the - // callback function, we check the order of the two objects. - for (int count = 0; count < 8; ++count) { - dynamic_tree.update(); - dynamic_tree.distance(&data, distance_callback); - } - - return 0; + using namespace fcl; + std::shared_ptr> box_geometry_1(new Box()); + std::shared_ptr> box_geometry_2(new Box()); + CollisionObject box_object_1(box_geometry_1); + CollisionObject box_object_2(box_geometry_2); + DistanceRequest request; + DistanceResult result; + std::cout << "Distance: " << distance(&box_object_1, &box_object_2, request, result) << std::endl; } diff --git a/recipes/fcl/all/test_v1_package/CMakeLists.txt b/recipes/fcl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/fcl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fcl/all/test_v1_package/conanfile.py b/recipes/fcl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/fcl/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_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/fernandovelcic-hexdump/all/test_v1_package/CMakeLists.txt b/recipes/fernandovelcic-hexdump/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/fernandovelcic-hexdump/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 84ee68733e516..0000000000000 --- a/recipes/fernandovelcic-hexdump/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/ffmpeg/all/conandata.yml b/recipes/ffmpeg/all/conandata.yml index 83ed14628cf42..a4db323a42973 100644 --- a/recipes/ffmpeg/all/conandata.yml +++ b/recipes/ffmpeg/all/conandata.yml @@ -1,48 +1,65 @@ sources: + "7.1.1": + url: "https://ffmpeg.org//releases/ffmpeg-7.1.1.tar.bz2" + sha256: "0c8da2f11579a01e014fc007cbacf5bb4da1d06afd0b43c7f8097ec7c0f143ba" + "7.0.1": + url: "https://ffmpeg.org//releases/ffmpeg-7.0.1.tar.bz2" + sha256: "5e77e84b6434d656106fafe3bceccc77176449014f3eba24d33db3fbd0939dc9" + "6.1.1": + url: "http://ffmpeg.org/releases/ffmpeg-6.1.1.tar.bz2" + sha256: "5e3133939a61ef64ac9b47ffd29a5ea6e337a4023ef0ad972094b4da844e3a20" "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" - "4.4": - url: "https://ffmpeg.org/releases/ffmpeg-4.4.tar.bz2" - sha256: "42093549751b582cf0f338a21a3664f52e0a9fbe0d238d3c992005e493607d0e" - "4.3.2": - url: "https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2" - sha256: "ab3a6d6a70358ba0a5f67f37f91f6656b7302b02e98e5b8c846c16763c99913a" - "4.2.1": - url: "https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.bz2" - sha256: "682a9fa3f6864d7f0dbf224f86b129e337bc60286e0d00dffcd710998d521624" patches: - "5.1": + "5.1.3": + - patch_file: "patches/5.1-0001-fix-libsvtav1-compressed_ten_bit_format.patch" + patch_description: "Compatibility with libsvtav1 > 1.2.0" + patch_type: "portability" + patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/031f1561cd286596cdb374da32f8aa816ce3b135" + - patch_file: "patches/5.1-0002-fix-libsvtav1-vbv_bufsize-1.patch" + patch_description: "Compatibility with libsvtav1 > 1.2.0" + patch_type: "portability" + patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/1c6fd7d756afe0f8b7df14dbf7a95df275f8f5ee" + - patch_file: "patches/5.1-0003-fix-libsvtav1-vbv_bufsize-2.patch" + patch_description: "Compatibility with libsvtav1 > 1.2.0" + patch_type: "portability" + patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/96748ac54f998ba6fe22802799c16b4eba8d4ccc" - patch_file: "patches/5.0-0001-fix-hwcontext_vulkan.patch" patch_description: "Compatibility with vulkan >= 1.3.239" patch_type: "portability" patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/eb0455d64690eed0068e5cb202f72ecdf899837c" - "5.0": + - patch_file: "patches/5.1-0004-fix-binutils.patch" + patch_description: "Compatibility with binutils >= 2.41" + patch_type: "portability" + patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/effadce6c756247ea8bae32dc13bb3e6f464f0eb" + "5.0.3": - patch_file: "patches/5.0-0001-fix-hwcontext_vulkan.patch" patch_description: "Compatibility with vulkan >= 1.3.239" patch_type: "portability" patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/eb0455d64690eed0068e5cb202f72ecdf899837c" + - patch_file: "patches/5.1-0004-fix-binutils.patch" + patch_description: "Compatibility with binutils >= 2.41" + patch_type: "portability" + patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/effadce6c756247ea8bae32dc13bb3e6f464f0eb" + "4.4.4": + - patch_file: "patches/4.4-0001-fix-aom_codec_av1_dx_algo.patch" + patch_description: "Compatibility with shared libaom" + patch_type: "portability" + patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/d92fdc714496d43234733c315894abe0beeb3529" + - patch_file: "patches/5.1-0004-fix-binutils.patch" + patch_description: "Compatibility with binutils >= 2.41" + patch_type: "portability" + patch_source: "https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/effadce6c756247ea8bae32dc13bb3e6f464f0eb" diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index b62169338c0de..38715f8f1dd76 100644 --- a/recipes/ffmpeg/all/conanfile.py +++ b/recipes/ffmpeg/all/conanfile.py @@ -1,11 +1,11 @@ -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 cross_building from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv from conan.tools.files import ( apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, - replace_in_file, rm, rmdir + replace_in_file, rm, rmdir, save, load ) from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout @@ -46,6 +46,9 @@ class FFMpegConan(ConanFile): "with_lzma": [True, False], "with_libiconv": [True, False], "with_freetype": [True, False], + "with_fontconfig": [True, False], + "with_fribidi": [True, False], + "with_harfbuzz": [True, False], "with_openjpeg": [True, False], "with_openh264": [True, False], "with_opus": [True, False], @@ -65,12 +68,20 @@ class FFMpegConan(ConanFile): "with_vdpau": [True, False], "with_vulkan": [True, False], "with_xcb": [True, False], + "with_soxr": [True, False], "with_appkit": [True, False], "with_avfoundation": [True, False], "with_coreimage": [True, False], "with_audiotoolbox": [True, False], "with_videotoolbox": [True, False], "with_programs": [True, False], + "with_libsvtav1": [True, False], + "with_libaom": [True, False], + "with_libdav1d": [True, False], + "with_libdrm": [True, False], + "with_jni": [True, False], + "with_mediacodec": [True, False], + "with_xlib": [True, False], "disable_everything": [True, False], "disable_all_encoders": [True, False], "disable_encoders": [None, "ANY"], @@ -123,6 +134,9 @@ class FFMpegConan(ConanFile): "with_lzma": True, "with_libiconv": True, "with_freetype": True, + "with_fontconfig": False, + "with_fribidi": False, + "with_harfbuzz": False, "with_openjpeg": True, "with_openh264": True, "with_opus": True, @@ -142,12 +156,20 @@ class FFMpegConan(ConanFile): "with_vdpau": True, "with_vulkan": False, "with_xcb": True, + "with_soxr": False, "with_appkit": True, "with_avfoundation": True, "with_coreimage": True, "with_audiotoolbox": True, "with_videotoolbox": True, "with_programs": True, + "with_libsvtav1": True, + "with_libaom": True, + "with_libdav1d": True, + "with_libdrm": False, + "with_jni": False, + "with_mediacodec": False, + "with_xlib": True, "disable_everything": False, "disable_all_encoders": False, "disable_encoders": None, @@ -211,16 +233,30 @@ def _dependencies(self): "with_libfdk_aac": ["avcodec"], "with_libwebp": ["avcodec"], "with_freetype": ["avfilter"], + "with_fontconfig": ["avfilter"], + "with_fribidi": ["avfilter"], + "with_harfbuzz": ["avfilter"], "with_zeromq": ["avfilter", "avformat"], "with_libalsa": ["avdevice"], "with_xcb": ["avdevice"], + "with_soxr": ["swresample"], "with_pulse": ["avdevice"], "with_sdl": ["with_programs"], + "with_libsvtav1": ["avcodec"], + "with_libaom": ["avcodec"], + "with_libdav1d": ["avcodec"], + "with_mediacodec": ["with_jni"], + "with_xlib": ["avdevice"], } @property - def _version_supports_vulkan(self): - return Version(self.version) >= "4.3.0" + def _version_supports_libsvtav1(self): + return Version(self.version) >= "5.1.0" + + @property + def _version_supports_harfbuzz(self): + # https://github.com/FFmpeg/FFmpeg/compare/n6.0.1...n6.1#diff-90d08e583c4c9c6f391b2ae90f819f600a6326928ea9512c9e0c6d98e9f29ac2R235 + return Version(self.version) >= "6.1" def export_sources(self): export_conandata_patches(self) @@ -228,13 +264,15 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self.settings.os in ["Linux", "FreeBSD"]: + if self.settings.os not in ["Linux", "FreeBSD"]: del self.options.with_vaapi del self.options.with_vdpau del self.options.with_vulkan del self.options.with_xcb del self.options.with_libalsa del self.options.with_pulse + del self.options.with_xlib + del self.options.with_libdrm if self.settings.os != "Macos": del self.options.with_appkit if self.settings.os not in ["Macos", "iOS", "tvOS"]: @@ -243,8 +281,15 @@ def config_options(self): del self.options.with_videotoolbox if not is_apple_os(self): del self.options.with_avfoundation - if not self._version_supports_vulkan: - self.options.rm_safe("with_vulkan") + if not self.settings.os == "Android": + del self.options.with_jni + del self.options.with_mediacodec + if not self._version_supports_libsvtav1: + self.options.rm_safe("with_libsvtav1") + if not self._version_supports_harfbuzz: + self.options.rm_safe("with_harfbuzz") + if self.settings.os == "Android": + del self.options.with_libfdk_aac def configure(self): if self.options.shared: @@ -264,12 +309,18 @@ def requirements(self): self.requires("xz_utils/5.4.5") if self.options.with_libiconv: self.requires("libiconv/1.17") - if self.options.with_freetype: - self.requires("freetype/2.13.0") + if self.options.get_safe("with_freetype"): + self.requires("freetype/2.13.2") + if self.options.get_safe("with_fontconfig"): + self.requires("fontconfig/2.15.0") + if self.options.get_safe("with_fribidi"): + self.requires("fribidi/1.0.13") + if self.options.get_safe("with_harfbuzz"): + self.requires("harfbuzz/8.3.0") if self.options.with_openjpeg: - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.with_openh264: - self.requires("openh264/2.3.1") + self.requires("openh264/2.4.1") if self.options.with_vorbis: self.requires("vorbis/1.3.7") if self.options.with_opus: @@ -279,31 +330,41 @@ def requirements(self): if self.options.with_sdl: self.requires("sdl/2.28.5") if self.options.with_libx264: - self.requires("libx264/cci.20220602") + self.requires("libx264/cci.20240224") if self.options.with_libx265: self.requires("libx265/3.4") if self.options.with_libvpx: - self.requires("libvpx/1.11.0") + self.requires("libvpx/1.14.1") if self.options.with_libmp3lame: self.requires("libmp3lame/3.100") - if self.options.with_libfdk_aac: - self.requires("libfdk_aac/2.0.2") + if self.options.get_safe("with_libfdk_aac"): + self.requires("libfdk_aac/2.0.3") if self.options.with_libwebp: 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.10") - if self.options.get_safe("with_xcb") or self.options.get_safe("with_vaapi"): + if self.options.get_safe("with_xcb") or self.options.get_safe("with_xlib"): self.requires("xorg/system") + if self.options.get_safe("with_soxr"): + self.requires("soxr/0.1.3") if self.options.get_safe("with_pulse"): self.requires("pulseaudio/14.2") if self.options.get_safe("with_vaapi"): self.requires("vaapi/system") if self.options.get_safe("with_vdpau"): self.requires("vdpau/system") - if self._version_supports_vulkan and self.options.get_safe("with_vulkan"): + if self.options.get_safe("with_vulkan"): self.requires("vulkan-loader/1.3.243.0") + if self.options.get_safe("with_libsvtav1"): + self.requires("libsvtav1/2.1.0") + if self.options.with_libaom: + self.requires("libaom-av1/3.6.1") + if self.options.get_safe("with_libdav1d"): + self.requires("dav1d/1.4.3") + if self.options.get_safe("with_libdrm"): + self.requires("libdrm/2.4.119") def validate(self): if self.options.with_ssl == "securetransport" and not is_apple_os(self): @@ -320,11 +381,28 @@ def validate(self): raise ConanInvalidConfiguration("FFmpeg '{}' option requires '{}' option to be enabled".format( dependency, "' or '".join(features))) + if Version(self.version) >= "6.1" and conan_version.major == 1 and is_msvc(self) and self.options.shared: + # Linking fails with "Argument list too long" for some reason on Conan v1 + raise ConanInvalidConfiguration("MSVC shared build is not supported for Conan v1") + + if Version(self.version) == "7.0.1" and self.settings.build_type == "Debug": + # FIXME: FFMpeg fails to build in Debug mode with the following error: + # ld: libavcodec/libavcodec.a(vvcdsp_init.o): in function `ff_vvc_put_pixels2_8_sse4': + # src/libavcodec/x86/vvc/vvcdsp_init.c:69: undefined reference to `ff_h2656_put_pixels2_8_sse4' + # May be related https://github.com/ffvvc/FFmpeg/issues/234 + raise ConanInvalidConfiguration(f"{self.ref} Conan recipe does not support build_type=Debug. Contributions are welcome to fix this issue.") + 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/2.0.3") + if Version(self.version) >= "7.0": + # INFO: FFmpeg 7.0+ added avcodec vvc_mc.asm which fails to assemble with yasm 1.3.0 + # src/libavcodec/x86/vvc/vvc_mc.asm:55: error: operand 1: expression is not simple or relocatable + self.tool_requires("nasm/2.16.01") + else: + self.tool_requires("yasm/1.3.0") + if self.settings.os != "Linux" and not self.conf.get("tools.gnu:pkg_config", check_type=str): + # See https://github.com/conan-io/conan-center-index/pull/26447#discussion_r1926682155 + self.tool_requires("pkgconf/[>=2.1 <3]") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): @@ -370,11 +448,10 @@ def _patch_sources(self): "#define X264_API_IMPORTS 1", "") if self.options.with_ssl == "openssl": # https://trac.ffmpeg.org/ticket/5675 - openssl_libraries = " ".join( - [f"-l{lib}" for lib in self.dependencies["openssl"].cpp_info.aggregated_components().libs]) + openssl_libs = load(self, os.path.join(self.build_folder, "openssl_libs.list")) replace_in_file(self, os.path.join(self.source_folder, "configure"), "check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||", - f"check_lib openssl openssl/ssl.h OPENSSL_init_ssl {openssl_libraries} || ") + f"check_lib openssl openssl/ssl.h OPENSSL_init_ssl {openssl_libs} || ") replace_in_file(self, os.path.join(self.source_folder, "configure"), "echo libx264.lib", "echo x264.lib") @@ -448,6 +525,9 @@ def opt_append_disable_if_set(args, what, v): opt_enable_disable("zlib", self.options.with_zlib), opt_enable_disable("lzma", self.options.with_lzma), opt_enable_disable("iconv", self.options.with_libiconv), + opt_enable_disable("libfreetype", self.options.get_safe("with_freetype")), + opt_enable_disable("libfontconfig", self.options.get_safe("with_fontconfig")), + opt_enable_disable("libfribidi", self.options.get_safe("with_fribidi")), opt_enable_disable("libopenjpeg", self.options.with_openjpeg), opt_enable_disable("libopenh264", self.options.with_openh264), opt_enable_disable("libvorbis", self.options.with_vorbis), @@ -458,39 +538,37 @@ def opt_append_disable_if_set(args, what, v): opt_enable_disable("libx265", self.options.with_libx265), opt_enable_disable("libvpx", self.options.with_libvpx), opt_enable_disable("libmp3lame", self.options.with_libmp3lame), - opt_enable_disable("libfdk-aac", self.options.with_libfdk_aac), + opt_enable_disable("libfdk-aac", self.options.get_safe("with_libfdk_aac")), opt_enable_disable("libwebp", self.options.with_libwebp), + opt_enable_disable("libaom", self.options.with_libaom), opt_enable_disable("openssl", self.options.with_ssl == "openssl"), opt_enable_disable("alsa", self.options.get_safe("with_libalsa")), - opt_enable_disable( - "libpulse", self.options.get_safe("with_pulse")), + opt_enable_disable("libpulse", self.options.get_safe("with_pulse")), opt_enable_disable("vaapi", self.options.get_safe("with_vaapi")), + opt_enable_disable("libdrm", self.options.get_safe("with_libdrm")), opt_enable_disable("vdpau", self.options.get_safe("with_vdpau")), opt_enable_disable("libxcb", self.options.get_safe("with_xcb")), - opt_enable_disable( - "libxcb-shm", self.options.get_safe("with_xcb")), - opt_enable_disable( - "libxcb-shape", self.options.get_safe("with_xcb")), - opt_enable_disable( - "libxcb-xfixes", self.options.get_safe("with_xcb")), + opt_enable_disable("libxcb-shm", self.options.get_safe("with_xcb")), + opt_enable_disable("libxcb-shape", self.options.get_safe("with_xcb")), + opt_enable_disable("libxcb-xfixes", self.options.get_safe("with_xcb")), + opt_enable_disable("libsoxr", self.options.get_safe("with_soxr")), opt_enable_disable("appkit", self.options.get_safe("with_appkit")), - opt_enable_disable( - "avfoundation", self.options.get_safe("with_avfoundation")), - opt_enable_disable( - "coreimage", self.options.get_safe("with_coreimage")), - opt_enable_disable( - "audiotoolbox", self.options.get_safe("with_audiotoolbox")), - opt_enable_disable( - "videotoolbox", self.options.get_safe("with_videotoolbox")), - opt_enable_disable("securetransport", - self.options.with_ssl == "securetransport"), + opt_enable_disable("avfoundation", self.options.get_safe("with_avfoundation")), + opt_enable_disable("coreimage", self.options.get_safe("with_coreimage")), + opt_enable_disable("audiotoolbox", self.options.get_safe("with_audiotoolbox")), + opt_enable_disable("videotoolbox", self.options.get_safe("with_videotoolbox")), + opt_enable_disable("securetransport", self.options.with_ssl == "securetransport"), + opt_enable_disable("vulkan", self.options.get_safe("with_vulkan")), + opt_enable_disable("libdav1d", self.options.get_safe("with_libdav1d")), + opt_enable_disable("jni", self.options.get_safe("with_jni")), + opt_enable_disable("mediacodec", self.options.get_safe("with_mediacodec")), + opt_enable_disable("xlib", self.options.get_safe("with_xlib")), "--disable-cuda", # FIXME: CUDA support "--disable-cuvid", # FIXME: CUVID support # Licenses - opt_enable_disable("nonfree", self.options.with_libfdk_aac or (self.options.with_ssl and ( + opt_enable_disable("nonfree", self.options.get_safe("with_libfdk_aac") or (self.options.with_ssl and ( self.options.with_libx264 or self.options.with_libx265 or self.options.postproc))), - opt_enable_disable( - "gpl", self.options.with_libx264 or self.options.with_libx265 or self.options.postproc) + opt_enable_disable("gpl", self.options.with_libx264 or self.options.with_libx265 or self.options.postproc) ] # Individual Component Options @@ -553,8 +631,10 @@ def opt_append_disable_if_set(args, what, v): args.extend(self._split_and_format_options_string( "disable-filter", self.options.disable_filters)) - if self._version_supports_vulkan: - args.append(opt_enable_disable("vulkan", self.options.get_safe("with_vulkan"))) + if self._version_supports_libsvtav1: + args.append(opt_enable_disable("libsvtav1", self.options.get_safe("with_libsvtav1"))) + if self._version_supports_harfbuzz: + args.append(opt_enable_disable("libharfbuzz", self.options.get_safe("with_harfbuzz"))) if is_apple_os(self): # relocatable shared libs args.append("--install-name-dir=@rpath") @@ -596,11 +676,12 @@ def opt_append_disable_if_set(args, what, v): ranlib = buildenv_vars.get("RANLIB") if ranlib: args.append(f"--ranlib={unix_path(self, ranlib)}") - # for some reason pkgconf from conan can't find .pc files on Linux in the context of ffmpeg configure... - if self._settings_build.os != "Linux": - pkg_config = self.conf.get("tools.gnu:pkg_config", default=buildenv_vars.get("PKG_CONFIG"), check_type=str) - if pkg_config: - args.append(f"--pkg-config={unix_path(self, pkg_config)}") + pkg_config = self.conf.get("tools.gnu:pkg_config", default=buildenv_vars.get("PKG_CONFIG"), check_type=str) + if pkg_config: + # the ffmpeg configure script hardcodes the name of the executable, + # unlike other tools that use the PKG_CONFIG environment variable + # if we are aware the user has requested a specific pkg-config, we pass it to the configure script + args.append(f"--pkg-config={unix_path(self, pkg_config)}") if is_msvc(self): args.append("--toolchain=msvc") if not check_min_vs(self, "190", raise_invalid=False): @@ -655,6 +736,10 @@ def opt_append_disable_if_set(args, what, v): deps = PkgConfigDeps(self) deps.generate() + if self.options.with_ssl == "openssl": + openssl_libs = " ".join([f"-l{lib}" for lib in self.dependencies["openssl"].cpp_info.aggregated_components().libs]) + save(self, os.path.join(self.build_folder, "openssl_libs.list"), openssl_libs) + def _split_and_format_options_string(self, flag_name, options_list): if not options_list: return [] @@ -728,256 +813,167 @@ def _set_component_version(self, component_name): def package_info(self): if self.options.with_programs: if self.options.with_sdl: - self.cpp_info.components["programs"].requires = [ - "sdl::libsdl2"] - + self.cpp_info.components["programs"].requires = ["sdl::libsdl2"] + + def _add_component(name, dependencies): + component = self.cpp_info.components[name] + component.set_property("pkg_config_name", f"lib{name}") + self._set_component_version(name) + component.libs = [name] + if name != "avutil": + component.requires = ["avutil"] + for dep in dependencies: + if self.options.get_safe(dep): + component.requires.append(dep) + if self.settings.os in ("FreeBSD", "Linux"): + component.system_libs.append("m") + return component + + avutil = _add_component("avutil", []) if self.options.avdevice: - self.cpp_info.components["avdevice"].set_property( - "pkg_config_name", "libavdevice") - self.cpp_info.components["avdevice"].libs = ["avdevice"] - self.cpp_info.components["avdevice"].requires = ["avutil"] - if self.options.avfilter: - self.cpp_info.components["avdevice"].requires.append( - "avfilter") - if self.options.swscale: - self.cpp_info.components["avdevice"].requires.append("swscale") - if self.options.avformat: - self.cpp_info.components["avdevice"].requires.append( - "avformat") - if self.options.avcodec: - self.cpp_info.components["avdevice"].requires.append("avcodec") - if self.options.swresample: - self.cpp_info.components["avdevice"].requires.append( - "swresample") - if self.options.postproc: - self.cpp_info.components["avdevice"].requires.append( - "postproc") - self._set_component_version("avdevice") - + avdevice = _add_component("avdevice", ["avfilter", "swscale", "avformat", "avcodec", "swresample", "postproc"]) if self.options.avfilter: - self.cpp_info.components["avfilter"].set_property( - "pkg_config_name", "libavfilter") - self.cpp_info.components["avfilter"].libs = ["avfilter"] - self.cpp_info.components["avfilter"].requires = ["avutil"] - if self.options.swscale: - self.cpp_info.components["avfilter"].requires.append("swscale") - if self.options.avformat: - self.cpp_info.components["avfilter"].requires.append( - "avformat") - if self.options.avcodec: - self.cpp_info.components["avfilter"].requires.append("avcodec") - if self.options.swresample: - self.cpp_info.components["avfilter"].requires.append( - "swresample") - if self.options.postproc: - self.cpp_info.components["avfilter"].requires.append( - "postproc") - self._set_component_version("avfilter") - + avfilter = _add_component("avfilter", ["swscale", "avformat", "avcodec", "swresample", "postproc"]) if self.options.avformat: - self.cpp_info.components["avformat"].set_property( - "pkg_config_name", "libavformat") - self.cpp_info.components["avformat"].libs = ["avformat"] - self.cpp_info.components["avformat"].requires = ["avutil"] - if self.options.avcodec: - self.cpp_info.components["avformat"].requires.append("avcodec") - if self.options.swresample: - self.cpp_info.components["avformat"].requires.append( - "swresample") - self._set_component_version("avformat") - + avformat = _add_component("avformat", ["avcodec", "swscale"]) if self.options.avcodec: - self.cpp_info.components["avcodec"].set_property( - "pkg_config_name", "libavcodec") - self.cpp_info.components["avcodec"].libs = ["avcodec"] - self.cpp_info.components["avcodec"].requires = ["avutil"] - if self.options.swresample: - self.cpp_info.components["avcodec"].requires.append( - "swresample") - self._set_component_version("avcodec") - + avcodec = _add_component("avcodec", ["swresample"]) if self.options.swscale: - self.cpp_info.components["swscale"].set_property( - "pkg_config_name", "libswscale") - self.cpp_info.components["swscale"].libs = ["swscale"] - self.cpp_info.components["swscale"].requires = ["avutil"] - self._set_component_version("swscale") - + _add_component("swscale", []) if self.options.swresample: - self.cpp_info.components["swresample"].set_property( - "pkg_config_name", "libswresample") - self.cpp_info.components["swresample"].libs = ["swresample"] - self.cpp_info.components["swresample"].requires = ["avutil"] - self._set_component_version("swresample") - + swresample = _add_component("swresample", []) + if self.options.get_safe("with_soxr"): + swresample.requires.append("soxr::soxr") if self.options.postproc: - self.cpp_info.components["postproc"].set_property( - "pkg_config_name", "libpostproc") - self.cpp_info.components["postproc"].libs = ["postproc"] - self.cpp_info.components["postproc"].requires = ["avutil"] - self._set_component_version("postproc") - - self.cpp_info.components["avutil"].set_property( - "pkg_config_name", "libavutil") - self.cpp_info.components["avutil"].libs = ["avutil"] - self._set_component_version("avutil") + _add_component("postproc", []) if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.components["avutil"].system_libs = [ - "pthread", "m", "dl"] - if self.options.swresample: - self.cpp_info.components["swresample"].system_libs = ["m"] - if self.options.swscale: - self.cpp_info.components["swscale"].system_libs = ["m"] - if self.options.postproc: - self.cpp_info.components["postproc"].system_libs = ["m"] + avutil.system_libs.extend(["pthread", "dl"]) if self.options.get_safe("fPIC"): if self.settings.compiler in ("gcc", "clang"): # https://trac.ffmpeg.org/ticket/1713 # https://ffmpeg.org/platform.html#Advanced-linking-configuration # https://ffmpeg.org/pipermail/libav-user/2014-December/007719.html - self.cpp_info.components["avcodec"].exelinkflags.append( - "-Wl,-Bsymbolic") - self.cpp_info.components["avcodec"].sharedlinkflags.append( - "-Wl,-Bsymbolic") - if self.options.avformat: - self.cpp_info.components["avformat"].system_libs = ["m"] + avcodec.exelinkflags.append("-Wl,-Bsymbolic") + avcodec.sharedlinkflags.append("-Wl,-Bsymbolic") if self.options.avfilter: - self.cpp_info.components["avfilter"].system_libs = [ - "m", "pthread"] - if self.options.avdevice: - self.cpp_info.components["avdevice"].system_libs = ["m"] + avfilter.system_libs.append("pthread") elif self.settings.os == "Windows": if self.options.avcodec: - self.cpp_info.components["avcodec"].system_libs = ["mfplat", "mfuuid", "strmiids"] + avcodec.system_libs = ["mfplat", "mfuuid", "strmiids"] if self.options.avdevice: - self.cpp_info.components["avdevice"].system_libs = [ - "ole32", "psapi", "strmiids", "uuid", "oleaut32", "shlwapi", "gdi32", "vfw32"] - self.cpp_info.components["avutil"].system_libs = [ - "user32", "bcrypt"] - self.cpp_info.components["avformat"].system_libs = ["secur32"] + avdevice.system_libs = ["ole32", "psapi", "strmiids", "uuid", "oleaut32", "shlwapi", "gdi32", "vfw32"] + avutil.system_libs = ["user32", "bcrypt"] + avformat.system_libs = ["secur32"] elif is_apple_os(self): if self.options.avdevice: - self.cpp_info.components["avdevice"].frameworks = [ - "CoreFoundation", "Foundation", "CoreGraphics"] + avdevice.frameworks = ["CoreFoundation", "Foundation", "CoreGraphics"] if self.options.avfilter: - self.cpp_info.components["avfilter"].frameworks = [ - "CoreGraphics"] + avfilter.frameworks = ["CoreGraphics"] if self.options.avcodec: - self.cpp_info.components["avcodec"].frameworks = [ - "CoreFoundation", "CoreVideo", "CoreMedia"] + avcodec.frameworks = ["CoreFoundation", "CoreVideo", "CoreMedia"] if self.settings.os == "Macos": if self.options.avdevice: - self.cpp_info.components["avdevice"].frameworks.append( - "OpenGL") + avdevice.frameworks.append("OpenGL") if self.options.avfilter: - self.cpp_info.components["avfilter"].frameworks.append( - "OpenGL") + avfilter.frameworks.append("OpenGL") if self.options.avdevice: if self.options.get_safe("with_libalsa"): - self.cpp_info.components["avdevice"].requires.append( - "libalsa::libalsa") + avdevice.requires.append("libalsa::libalsa") if self.options.get_safe("with_xcb"): - self.cpp_info.components["avdevice"].requires.append( - "xorg::xcb") + avdevice.requires.extend(["xorg::xcb", "xorg::xcb-shm", "xorg::xcb-xfixes", "xorg::xcb-shape", "xorg::xv", "xorg::xext"]) + if self.options.get_safe("with_xlib"): + avdevice.requires.extend(["xorg::x11", "xorg::xext", "xorg::xv"]) if self.options.get_safe("with_pulse"): - self.cpp_info.components["avdevice"].requires.append( - "pulseaudio::pulseaudio") + avdevice.requires.append("pulseaudio::pulseaudio") if self.options.get_safe("with_appkit"): - self.cpp_info.components["avdevice"].frameworks.append( - "AppKit") + avdevice.frameworks.append("AppKit") if self.options.get_safe("with_avfoundation"): - self.cpp_info.components["avdevice"].frameworks.append( - "AVFoundation") + avdevice.frameworks.append("AVFoundation") if self.options.get_safe("with_audiotoolbox"): - self.cpp_info.components["avdevice"].frameworks.append( - "CoreAudio") + avdevice.frameworks.append("CoreAudio") + if self.settings.os == "Android" and not self.options.shared: + avdevice.system_libs.extend(["android", "camera2ndk", "mediandk"]) if self.options.avcodec: if self.options.with_zlib: - self.cpp_info.components["avcodec"].requires.append( - "zlib::zlib") + avcodec.requires.append("zlib::zlib") if self.options.with_lzma: - self.cpp_info.components["avcodec"].requires.append( - "xz_utils::xz_utils") + avcodec.requires.append("xz_utils::xz_utils") if self.options.with_libiconv: - self.cpp_info.components["avcodec"].requires.append( - "libiconv::libiconv") + avcodec.requires.append("libiconv::libiconv") if self.options.with_openjpeg: - self.cpp_info.components["avcodec"].requires.append( - "openjpeg::openjpeg") + avcodec.requires.append("openjpeg::openjpeg") if self.options.with_openh264: - self.cpp_info.components["avcodec"].requires.append( - "openh264::openh264") + avcodec.requires.append("openh264::openh264") if self.options.with_vorbis: - self.cpp_info.components["avcodec"].requires.append( - "vorbis::vorbis") + avcodec.requires.append("vorbis::vorbis") if self.options.with_opus: - self.cpp_info.components["avcodec"].requires.append( - "opus::opus") + avcodec.requires.append("opus::opus") if self.options.with_libx264: - self.cpp_info.components["avcodec"].requires.append( - "libx264::libx264") + avcodec.requires.append("libx264::libx264") if self.options.with_libx265: - self.cpp_info.components["avcodec"].requires.append( - "libx265::libx265") + avcodec.requires.append("libx265::libx265") if self.options.with_libvpx: - self.cpp_info.components["avcodec"].requires.append( - "libvpx::libvpx") + avcodec.requires.append("libvpx::libvpx") if self.options.with_libmp3lame: - self.cpp_info.components["avcodec"].requires.append( - "libmp3lame::libmp3lame") - if self.options.with_libfdk_aac: - self.cpp_info.components["avcodec"].requires.append( - "libfdk_aac::libfdk_aac") + avcodec.requires.append("libmp3lame::libmp3lame") + if self.options.get_safe("with_libfdk_aac"): + avcodec.requires.append("libfdk_aac::libfdk_aac") if self.options.with_libwebp: - self.cpp_info.components["avcodec"].requires.append( - "libwebp::libwebp") + avcodec.requires.append("libwebp::libwebp") if self.options.get_safe("with_audiotoolbox"): - self.cpp_info.components["avcodec"].frameworks.append( - "AudioToolbox") + avcodec.frameworks.append("AudioToolbox") if self.options.get_safe("with_videotoolbox"): - self.cpp_info.components["avcodec"].frameworks.append( - "VideoToolbox") + avcodec.frameworks.append("VideoToolbox") + if self.options.get_safe("with_libsvtav1"): + avcodec.requires.extend(["libsvtav1::decoder", "libsvtav1::encoder"]) + if self.options.get_safe("with_libaom"): + avcodec.requires.append("libaom-av1::libaom-av1") + if self.options.get_safe("with_libdav1d"): + avcodec.requires.append("dav1d::dav1d") if self.options.avformat: if self.options.with_bzip2: - self.cpp_info.components["avformat"].requires.append( - "bzip2::bzip2") + avformat.requires.append("bzip2::bzip2") if self.options.with_zeromq: - self.cpp_info.components["avformat"].requires.append( - "zeromq::libzmq") + avformat.requires.append("zeromq::libzmq") if self.options.with_ssl == "openssl": - self.cpp_info.components["avformat"].requires.append( - "openssl::ssl") + avformat.requires.append("openssl::ssl") elif self.options.with_ssl == "securetransport": - self.cpp_info.components["avformat"].frameworks.append( - "Security") + avformat.frameworks.append("Security") if self.options.avfilter: - if self.options.with_freetype: - self.cpp_info.components["avfilter"].requires.append( - "freetype::freetype") + if self.options.get_safe("with_freetype"): + avfilter.requires.append("freetype::freetype") + if self.options.get_safe("with_fontconfig"): + avfilter.requires.append("fontconfig::fontconfig") + if self.options.get_safe("with_fribidi"): + avfilter.requires.append("fribidi::fribidi") + if self.options.get_safe("with_harfbuzz"): + avfilter.requires.append("harfbuzz::harfbuzz") if self.options.with_zeromq: - self.cpp_info.components["avfilter"].requires.append( - "zeromq::libzmq") + avfilter.requires.append("zeromq::libzmq") if self.options.get_safe("with_appkit"): - self.cpp_info.components["avfilter"].frameworks.append( - "AppKit") + avfilter.frameworks.append("AppKit") if self.options.get_safe("with_coreimage"): - self.cpp_info.components["avfilter"].frameworks.append( - "CoreImage") + avfilter.frameworks.append("CoreImage") if Version(self.version) >= "5.0" and is_apple_os(self): - self.cpp_info.components["avfilter"].frameworks.append("Metal") + avfilter.frameworks.append("Metal") + if self.options.get_safe("with_libdrm"): + avutil.requires.append("libdrm::libdrm_libdrm") if self.options.get_safe("with_vaapi"): - self.cpp_info.components["avutil"].requires.extend( - ["vaapi::vaapi", "xorg::x11"]) + avutil.requires.append("vaapi::vaapi") + if self.options.get_safe("with_xcb"): + avutil.requires.append("xorg::x11") if self.options.get_safe("with_vdpau"): - self.cpp_info.components["avutil"].requires.append("vdpau::vdpau") + avutil.requires.append("vdpau::vdpau") + + if self.options.with_ssl == "openssl": + avutil.requires.append("openssl::ssl") - if self._version_supports_vulkan and self.options.get_safe("with_vulkan"): - self.cpp_info.components["avutil"].requires.append( - "vulkan-loader::vulkan-loader") + if self.options.get_safe("with_vulkan"): + avutil.requires.append("vulkan-loader::vulkan-loader") diff --git a/recipes/ffmpeg/all/patches/4.4-0001-fix-aom_codec_av1_dx_algo.patch b/recipes/ffmpeg/all/patches/4.4-0001-fix-aom_codec_av1_dx_algo.patch new file mode 100644 index 0000000000000..5855404e33592 --- /dev/null +++ b/recipes/ffmpeg/all/patches/4.4-0001-fix-aom_codec_av1_dx_algo.patch @@ -0,0 +1,11 @@ +--- a/libavcodec/libaomdec.c ++++ b/libavcodec/libaomdec.c +@@ -224,7 +224,7 @@ static av_cold int aom_free(AVCodecContext *avctx) + + static av_cold int av1_init(AVCodecContext *avctx) + { +- return aom_init(avctx, &aom_codec_av1_dx_algo); ++ return aom_init(avctx, aom_codec_av1_dx()); + } + + AVCodec ff_libaom_av1_decoder = { diff --git a/recipes/ffmpeg/all/patches/5.1-0001-fix-libsvtav1-compressed_ten_bit_format.patch b/recipes/ffmpeg/all/patches/5.1-0001-fix-libsvtav1-compressed_ten_bit_format.patch new file mode 100644 index 0000000000000..f60f6d44f6e9d --- /dev/null +++ b/recipes/ffmpeg/all/patches/5.1-0001-fix-libsvtav1-compressed_ten_bit_format.patch @@ -0,0 +1,22 @@ +--- a/libavcodec/libsvtav1.c ++++ b/libavcodec/libsvtav1.c +@@ -124,16 +124,12 @@ static int svt_print_error(void *log_ctx, EbErrorType err, + + static int alloc_buffer(EbSvtAv1EncConfiguration *config, SvtContext *svt_enc) + { +- const int pack_mode_10bit = +- (config->encoder_bit_depth > 8) && (config->compressed_ten_bit_format == 0) ? 1 : 0; +- const size_t luma_size_8bit = +- config->source_width * config->source_height * (1 << pack_mode_10bit); +- const size_t luma_size_10bit = +- (config->encoder_bit_depth > 8 && pack_mode_10bit == 0) ? luma_size_8bit : 0; ++ const size_t luma_size = config->source_width * config->source_height * ++ (config->encoder_bit_depth > 8 ? 2 : 1); + + EbSvtIOFormat *in_data; + +- svt_enc->raw_size = (luma_size_8bit + luma_size_10bit) * 3 / 2; ++ svt_enc->raw_size = luma_size * 3 / 2; + + // allocate buffer for in and out + svt_enc->in_buf = av_mallocz(sizeof(*svt_enc->in_buf)); diff --git a/recipes/ffmpeg/all/patches/5.1-0002-fix-libsvtav1-vbv_bufsize-1.patch b/recipes/ffmpeg/all/patches/5.1-0002-fix-libsvtav1-vbv_bufsize-1.patch new file mode 100644 index 0000000000000..9df9fbb5d685c --- /dev/null +++ b/recipes/ffmpeg/all/patches/5.1-0002-fix-libsvtav1-vbv_bufsize-1.patch @@ -0,0 +1,20 @@ +--- a/libavcodec/libsvtav1.c ++++ b/libavcodec/libsvtav1.c +@@ -179,7 +179,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, + param->min_qp_allowed = avctx->qmin; + } + param->max_bit_rate = avctx->rc_max_rate; +- param->vbv_bufsize = avctx->rc_buffer_size; ++ param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate; + + if (svt_enc->crf > 0) { + param->qp = svt_enc->crf; +@@ -296,7 +296,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, + avctx->bit_rate = param->rate_control_mode > 0 ? + param->target_bit_rate : 0; + avctx->rc_max_rate = param->max_bit_rate; +- avctx->rc_buffer_size = param->vbv_bufsize; ++ avctx->rc_buffer_size = param->maximum_buffer_size_ms * avctx->bit_rate / 1000LL; + + if (avctx->bit_rate || avctx->rc_max_rate || avctx->rc_buffer_size) { + AVCPBProperties *cpb_props = ff_add_cpb_side_data(avctx); diff --git a/recipes/ffmpeg/all/patches/5.1-0003-fix-libsvtav1-vbv_bufsize-2.patch b/recipes/ffmpeg/all/patches/5.1-0003-fix-libsvtav1-vbv_bufsize-2.patch new file mode 100644 index 0000000000000..6bf52193253d7 --- /dev/null +++ b/recipes/ffmpeg/all/patches/5.1-0003-fix-libsvtav1-vbv_bufsize-2.patch @@ -0,0 +1,12 @@ +--- a/libavcodec/libsvtav1.c ++++ b/libavcodec/libsvtav1.c +@@ -179,7 +179,8 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, + param->min_qp_allowed = avctx->qmin; + } + param->max_bit_rate = avctx->rc_max_rate; +- param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate; ++ if (avctx->bit_rate && avctx->rc_buffer_size) ++ param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate; + + if (svt_enc->crf > 0) { + param->qp = svt_enc->crf; diff --git a/recipes/ffmpeg/all/patches/5.1-0004-fix-binutils.patch b/recipes/ffmpeg/all/patches/5.1-0004-fix-binutils.patch new file mode 100644 index 0000000000000..53a596d0ee7d4 --- /dev/null +++ b/recipes/ffmpeg/all/patches/5.1-0004-fix-binutils.patch @@ -0,0 +1,73 @@ +From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= +Date: Sun, 16 Jul 2023 18:18:02 +0300 +Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift + instructions within inline assembly + +Fixes assembling with binutil as >= 2.41 + +Signed-off-by: James Almer +--- + libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h +index 6298f5ed1983b..ca7e2dffc1076 100644 +--- a/libavcodec/x86/mathops.h ++++ b/libavcodec/x86/mathops.h +@@ -35,12 +35,20 @@ + static av_always_inline av_const int MULL(int a, int b, unsigned shift) + { + int rt, dummy; ++ if (__builtin_constant_p(shift)) + __asm__ ( + "imull %3 \n\t" + "shrdl %4, %%edx, %%eax \n\t" + :"=a"(rt), "=d"(dummy) +- :"a"(a), "rm"(b), "ci"((uint8_t)shift) ++ :"a"(a), "rm"(b), "i"(shift & 0x1F) + ); ++ else ++ __asm__ ( ++ "imull %3 \n\t" ++ "shrdl %4, %%edx, %%eax \n\t" ++ :"=a"(rt), "=d"(dummy) ++ :"a"(a), "rm"(b), "c"((uint8_t)shift) ++ ); + return rt; + } + +@@ -113,19 +121,31 @@ __asm__ volatile(\ + // avoid +32 for shift optimization (gcc should do that ...) + #define NEG_SSR32 NEG_SSR32 + static inline int32_t NEG_SSR32( int32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("sarl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("sarl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + + #define NEG_USR32 NEG_USR32 + static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("shrl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("shrl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + diff --git a/recipes/ffmpeg/config.yml b/recipes/ffmpeg/config.yml index 0ea4ae6cca888..d3ea718a909d2 100644 --- a/recipes/ffmpeg/config.yml +++ b/recipes/ffmpeg/config.yml @@ -1,25 +1,17 @@ versions: + "7.1.1": + folder: "all" + "7.0.1": + folder: "all" + "6.1.1": + folder: "all" "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": - folder: "all" - "4.3.2": - folder: "all" - "4.2.1": - folder: "all" diff --git a/recipes/fft/all/CMakeLists.txt b/recipes/fft/all/CMakeLists.txt index 373435ea9437a..dfe6992094247 100644 --- a/recipes/fft/all/CMakeLists.txt +++ b/recipes/fft/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.15) project(fft LANGUAGES C) option(FFT_THREADS "use threads" OFF) diff --git a/recipes/fft/all/test_package/CMakeLists.txt b/recipes/fft/all/test_package/CMakeLists.txt index a87685a9ccd7a..f14a2d03b90a6 100644 --- a/recipes/fft/all/test_package/CMakeLists.txt +++ b/recipes/fft/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(fft REQUIRED CONFIG) diff --git a/recipes/fft/all/test_v1_package/CMakeLists.txt b/recipes/fft/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/fft/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fft/all/test_v1_package/conanfile.py b/recipes/fft/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/fft/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_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/fftw/all/conanfile.py b/recipes/fftw/all/conanfile.py index ef1e6d55efb6e..48fcc3185c1a8 100644 --- a/recipes/fftw/all/conanfile.py +++ b/recipes/fftw/all/conanfile.py @@ -49,7 +49,6 @@ class FFTWConan(ConanFile): "combinedthreads": False, "simd": False, } - _current_precision = None def export_sources(self): export_conandata_patches(self) @@ -93,11 +92,6 @@ def generate(self): 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}")] @@ -107,23 +101,21 @@ def on_off(value): return "ON" if value else 'OFF' apply_conandata_patches(self) - for self._current_precision in self._all_precisions: + for 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) + "ENABLE_FLOAT": on_off(current_precision == SINGLE), + "ENABLE_LONG_DOUBLE": on_off(current_precision == LONGDOUBLE), + "ENABLE_QUAD_PRECISION": on_off(current_precision == QUAD) } cmake.configure(variables=variables) cmake.build() + cmake.install() def package(self): copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - 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")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): cmake_config_name = cmake_namespace = "FFTW3" @@ -136,10 +128,10 @@ def package_info(self): self.cpp_info.names["cmake_find_package"] = cmake_namespace self.cpp_info.names["cmake_find_package_multi"] = cmake_namespace - for self._current_precision in self._all_precisions: - prec_suffix = self._prec_suffix[self._current_precision] + for precision in self._all_precisions: + prec_suffix = self._prec_suffix[precision] cmake_target_name = pkgconfig_name = lib_name = "fftw3" + prec_suffix - component_name = f"fftwlib_{self._current_precision}" + component_name = f"fftwlib_{precision}" component = self.cpp_info.components[component_name] # TODO: back to global scope in conan v2 once cmake_find_package_* & pkg_config generators removed @@ -150,7 +142,7 @@ def package_info(self): 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: + if precision == QUAD: component.system_libs.extend(['quadmath']) if self.options.threads: component.system_libs.append("pthread") diff --git a/recipes/fftw/all/test_package/CMakeLists.txt b/recipes/fftw/all/test_package/CMakeLists.txt index e2445bdf7545e..ed4651165292a 100644 --- a/recipes/fftw/all/test_package/CMakeLists.txt +++ b/recipes/fftw/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) option(ENABLE_DOUBLE_PRECISION "Enable FFTW single precision" ON) diff --git a/recipes/fftw/all/test_v1_package/CMakeLists.txt b/recipes/fftw/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/fftw/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fftw/all/test_v1_package/conanfile.py b/recipes/fftw/all/test_v1_package/conanfile.py deleted file mode 100644 index bc42b2f516ea2..0000000000000 --- a/recipes/fftw/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +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.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() - - 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/fire-hpp/all/conandata.yml b/recipes/fire-hpp/all/conandata.yml index 0ac5acb1e3d98..e30c0635694c3 100644 --- a/recipes/fire-hpp/all/conandata.yml +++ b/recipes/fire-hpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0": + url: "https://github.com/kongaskristjan/fire-hpp/archive/v1.0.tar.gz" + sha256: "73086d72a785a57bac8833d4f92799e8e769fef1d2ca46399cfbdb82a5c22f84" "0.2": - sha256: 50ac76005e5d45590355a51e5e1b62aba65c56f2003335acce0370da13d77b28 - url: https://github.com/kongaskristjan/fire-hpp/archive/v0.2.tar.gz + url: "https://github.com/kongaskristjan/fire-hpp/archive/v0.2.tar.gz" + sha256: "50ac76005e5d45590355a51e5e1b62aba65c56f2003335acce0370da13d77b28" diff --git a/recipes/fire-hpp/all/test_package/CMakeLists.txt b/recipes/fire-hpp/all/test_package/CMakeLists.txt index 8068292a31341..fe3a31529853d 100644 --- a/recipes/fire-hpp/all/test_package/CMakeLists.txt +++ b/recipes/fire-hpp/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(fire-hpp REQUIRED CONFIG) diff --git a/recipes/fire-hpp/config.yml b/recipes/fire-hpp/config.yml index 7e65100e62b2c..14d66964f38cc 100644 --- a/recipes/fire-hpp/config.yml +++ b/recipes/fire-hpp/config.yml @@ -1,3 +1,5 @@ versions: + "1.0": + folder: all "0.2": folder: all diff --git a/recipes/fixed-containers/all/conandata.yml b/recipes/fixed-containers/all/conandata.yml new file mode 100644 index 0000000000000..e2bbaf816f1d4 --- /dev/null +++ b/recipes/fixed-containers/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240225": + url: "https://github.com/teslamotors/fixed-containers/archive/095b1bc100903a4c49cbec13842288f57e84b4f3.tar.gz" + sha256: "5d3624cd2c1fdfd1b054b03005804f2b7a2a6c2c114943976821c64b20a94588" diff --git a/recipes/fixed-containers/all/conanfile.py b/recipes/fixed-containers/all/conanfile.py new file mode 100644 index 0000000000000..9729326c0e725 --- /dev/null +++ b/recipes/fixed-containers/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 +import os + +required_conan_version = ">=1.52.0" + +class FixedContainersConan(ConanFile): + name = "fixed-containers" + description = "C++ Fixed Containers" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/teslamotors/fixed-containers/" + topics = ("constexpr", "containers", "compile-time", "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": "11", + "clang": "12", + "Visual Studio": "16", + "msvc": "192", + # apple-clang has support std::lexicographical_compare_three_way since 15. + "apple-clang": "15", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("magic_enum/0.9.3", 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) + 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", "fixed_containers") + self.cpp_info.set_property("cmake_target_name", "fixed_containers::fixed_containers") diff --git a/recipes/fixed-containers/all/test_package/CMakeLists.txt b/recipes/fixed-containers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..24c19844b253b --- /dev/null +++ b/recipes/fixed-containers/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(fixed_containers) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fixed_containers::fixed_containers) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/popt/all/test_package/conanfile.py b/recipes/fixed-containers/all/test_package/conanfile.py similarity index 100% rename from recipes/popt/all/test_package/conanfile.py rename to recipes/fixed-containers/all/test_package/conanfile.py diff --git a/recipes/fixed-containers/all/test_package/test_package.cpp b/recipes/fixed-containers/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d129e8622b3d9 --- /dev/null +++ b/recipes/fixed-containers/all/test_package/test_package.cpp @@ -0,0 +1,19 @@ +#include "fixed_containers/fixed_vector.hpp" +#include "fixed_containers/enum_utils.hpp" + +int main(void) { + constexpr auto v1 = []() { + fixed_containers::FixedVector v{}; + v.push_back(0); + v.emplace_back(1); + v.push_back(2); + return v; + }(); + static_assert(v1[0] == 0); + static_assert(v1[1] == 1); + static_assert(v1[2] == 2); + static_assert(v1.size() == 3); + static_assert(v1.capacity() == 11); + + return 0; +} diff --git a/recipes/fixed-containers/config.yml b/recipes/fixed-containers/config.yml new file mode 100644 index 0000000000000..5b3feee9a17dd --- /dev/null +++ b/recipes/fixed-containers/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240225": + folder: all diff --git a/recipes/fixed_math/1.x.x/conandata.yml b/recipes/fixed_math/1.x.x/conandata.yml new file mode 100644 index 0000000000000..3e20dff4a8b77 --- /dev/null +++ b/recipes/fixed_math/1.x.x/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.2": + url: "https://github.com/arturbac/fixed_math/archive/refs/tags/v1.0.2.tar.gz" + sha256: "6c87217286e3b93ce5e1fff0bbbb08a9751d04f416cd76ddd5ddd37a8c6772cf" diff --git a/recipes/fixed_math/1.x.x/conanfile.py b/recipes/fixed_math/1.x.x/conanfile.py new file mode 100644 index 0000000000000..aed8cfa5c1d05 --- /dev/null +++ b/recipes/fixed_math/1.x.x/conanfile.py @@ -0,0 +1,143 @@ +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, replace_in_file +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + +class FixedMathConan(ConanFile): + name = "fixed_math" + description = "A High-Performance C++17 Library for Fixed-Point 48.16 Arithmetic" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/arturbac/fixed_math/" + topics = ("mathematics", "fixed-point") + 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 _compilers_minimum_version(self): + return { + "gcc": "10", # fixed_math requires __has_builtin + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + def config_options(self): + if self.settings.os == "Windows": + self.package_type = "static-library" + del self.options.fPIC + + def configure(self): + if self.settings.os == "Windows": + self.options.rm_safe("shared") + if self.options.header_only: + self.options.rm_safe("shared") + self.options.rm_safe("fPIC") + self.package_type = "header-library" + elif self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + + def layout(self): + 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 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 build_requirements(self): + if not self.options.header_only: + self.tool_requires("cmake/[>=3.21 <4]") + + 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) + if is_msvc(self): + tc.variables["CMAKE_CXX_FLAGS"] = "/Zc:__cplusplus" + tc.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") + + def build(self): + if not self.options.header_only: + # fix install path (https://github.com/arturbac/fixed_math/issues/8) + replace_in_file(self, os.path.join(self.source_folder, "fixed_lib", "CMakeLists.txt"), + "${CMAKE_INSTALL_INCLUDEDIR}/fixed_math", + "${CMAKE_INSTALL_INCLUDEDIR}/fixedmath") + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENCE", self.source_folder, os.path.join(self.package_folder, "licenses")) + if not self.options.header_only: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: + # fix install path (https://github.com/arturbac/fixed_math/issues/8) + copy( + self, + "*.h", + os.path.join(self.source_folder, "fixed_lib", "include", "fixedmath"), + os.path.join(self.package_folder, "include", "fixedmath"), + ) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "fixed_lib", "include", "fixedmath"), + os.path.join(self.package_folder, "include", "fixedmath"), + ) + + def package_info(self): + if self.options.header_only: + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + else: + self.cpp_info.libs = ["fixed_math"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + self.cpp_info.set_property("cmake_file_name", "fixed_math") + self.cpp_info.set_property("cmake_target_name", "fixed_math::fixed_math") + + if is_msvc(self): + self.cpp_info.cxxflags.append("/Zc:__cplusplus") diff --git a/recipes/fixed_math/1.x.x/test_package/CMakeLists.txt b/recipes/fixed_math/1.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d63966d4ccdd2 --- /dev/null +++ b/recipes/fixed_math/1.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(fixed_math REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fixed_math::fixed_math) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/fixed_math/1.x.x/test_package/conanfile.py b/recipes/fixed_math/1.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/fixed_math/1.x.x/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/fixed_math/1.x.x/test_package/test_package.cpp b/recipes/fixed_math/1.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..9337496e2cbd5 --- /dev/null +++ b/recipes/fixed_math/1.x.x/test_package/test_package.cpp @@ -0,0 +1,39 @@ +#include + +#include "fixedmath/fixed_math.hpp" +#include "fixedmath/iostream.h" + +using fixedmath::fixed_t; +using fixedmath::operator ""_fix; + +//fixed and all functionality is constexpr so You can declare constants see features [1] +inline constexpr fixed_t foo_constant{ fixedmath::tan( 15 * fixedmath::phi/180) }; + +constexpr fixed_t my_function( fixed_t value ) { + using namespace fixedmath; + return foo_constant + sin(value) / (1.41_fix - 2*cos(value) / 4); +} + +int main() { + // converting to/from fixed_t + // construction from other arithmetic types is explicit + fixed_t val { 3.14 }; + + //- there is no implicit assignment from other types + float some_float{val}; + fixed_t some_fixed{some_float}; + + some_fixed = fixed_t{some_float}; + + //- converting to other arithmetic types coud be done with static cast and is explicit + double some_double { static_cast(some_fixed) }; + + // for constant values postfix operator _fix may be used + some_fixed = some_float * 2.45_fix; //operation with float is promoted to fixed_t + some_double = 4.15 * some_fixed; //operation with double is promoted to double + + std::cout << some_fixed << '\n'; + std::cout << some_double << '\n'; + + return 0; +} diff --git a/recipes/fixed_math/all/conandata.yml b/recipes/fixed_math/all/conandata.yml new file mode 100644 index 0000000000000..a7ea4a2ff9968 --- /dev/null +++ b/recipes/fixed_math/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.0.0": + url: "https://github.com/arturbac/fixed_math/archive/refs/tags/v2.0.0.tar.gz" + sha256: "a02efd417592f9cb3d21fc39877aba76fe5c37b3e68b11769065202f71242f66" diff --git a/recipes/fixed_math/all/conanfile.py b/recipes/fixed_math/all/conanfile.py new file mode 100644 index 0000000000000..4684b16404cb7 --- /dev/null +++ b/recipes/fixed_math/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 copy, get +from conan.tools.scm import Version +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + +class FixedMathConan(ConanFile): + name = "fixed_math" + description = "A High-Performance C++17 Library for Fixed-Point 48.16 Arithmetic" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/arturbac/fixed_math/" + topics = ("mathematics", "fixed-point", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 23 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "17", + "msvc": "193", + "gcc": "12", + "clang": "15", + "apple-clang": "16", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENCE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + os.path.join(self.source_folder, "fixed_lib", "include"), + os.path.join(self.package_folder, "include"), + ) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "fixed_lib", "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", "fixed_math") + self.cpp_info.set_property("cmake_target_name", "fixed_math::fixed_math") + + if is_msvc(self): + self.cpp_info.cxxflags.append("/Zc:__cplusplus") diff --git a/recipes/fixed_math/all/test_package/CMakeLists.txt b/recipes/fixed_math/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2b820757c217b --- /dev/null +++ b/recipes/fixed_math/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.20) +project(test_package LANGUAGES CXX) + +find_package(fixed_math REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fixed_math::fixed_math) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23) diff --git a/recipes/fixed_math/all/test_package/conanfile.py b/recipes/fixed_math/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/fixed_math/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/fixed_math/all/test_package/test_package.cpp b/recipes/fixed_math/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7fbb1e6d1d25b --- /dev/null +++ b/recipes/fixed_math/all/test_package/test_package.cpp @@ -0,0 +1,37 @@ +#include + +#include "fixedmath/fixed_math.hpp" +#include "fixedmath/iostream.h" + +using fixedmath::fixed_t; +using fixedmath::operator""_fix; + +// fixed and all functionality is constexpr so You can declare constants see features [1] +inline constexpr fixed_t foo_constant{fixedmath::fobj::tan(15 * fixedmath::phi / 180)}; + +constexpr fixed_t my_function(fixed_t value) { + using namespace fixedmath; + // You can use funcioons or function objects + return foo_constant + fobj::sin(value) / (1.41_fix - 2 * func::cos(value) / 4); +} + +int main() { + // converting to/from fixed_t + // construction from other arithmetic types is explicit + fixed_t val1{3.14}; + fixed_t val2{3u}; + + //- there is no implicit assignment from other types + float some_float{3.14f}; + fixed_t some_fixed; + some_fixed = fixed_t{some_float}; + + //- converting to other arithmetic types coud be done with static cast and is explicit + double some_double(some_fixed); + + // for constant values postfix operator _fix may be used + some_fixed = some_float * 2.45_fix; // operation with float is promoted to fixed_t + some_double = 4.15 * some_fixed; // operation with double is promoted to double + + std::cout << some_double << " " << my_function(some_fixed) << std::endl; +} diff --git a/recipes/fixed_math/config.yml b/recipes/fixed_math/config.yml new file mode 100644 index 0000000000000..3a4c749874ca0 --- /dev/null +++ b/recipes/fixed_math/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.0": + folder: all + "1.0.2": + folder: 1.x.x diff --git a/recipes/flac/all/conandata.yml b/recipes/flac/all/conandata.yml index b0d1e5271b850..f682811c8ae09 100644 --- a/recipes/flac/all/conandata.yml +++ b/recipes/flac/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.5.0": + url: "https://github.com/xiph/flac/releases/download/1.5.0/flac-1.5.0.tar.xz" + sha256: "f2c1c76592a82ffff8413ba3c4a1299b6c7ab06c734dee03fd88630485c2b920" + "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,9 +12,17 @@ sources: url: "https://github.com/xiph/flac/archive/1.3.3.tar.gz" sha256: "668cdeab898a7dd43cf84739f7e1f3ed6b35ece2ef9968a5c7079fe9adfe1689" patches: + "1.5.0": + - patch_file: "patches/1.4.2-002-ignore-dll_export-define.patch" + patch_description: "Ignore autotools-specific DLL_EXPORT define in export.h" + patch_type: "conan" + "1.4.3": + - patch_file: "patches/1.4.2-002-ignore-dll_export-define.patch" + patch_description: "Ignore autotools-specific DLL_EXPORT define in export.h" + patch_type: "conan" "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_file: "patches/1.4.2-002-ignore-dll_export-define.patch" + patch_description: "Ignore autotools-specific DLL_EXPORT define in export.h" patch_type: "conan" "1.3.3": - patch_file: "patches/fix-cmake-1.3.3.patch" diff --git a/recipes/flac/all/conanfile.py b/recipes/flac/all/conanfile.py index e8e39c9a71f0a..9a289e460977f 100644 --- a/recipes/flac/all/conanfile.py +++ b/recipes/flac/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.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 -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class FlacConan(ConanFile): @@ -14,7 +15,7 @@ class FlacConan(ConanFile): topics = ("flac", "codec", "audio", ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/xiph/flac" - license = ("BSD-3-Clause", "GPL-2.0-or-later", "LPGL-2.1-or-later", "GFDL-1.2") + license = ("BSD-3-Clause", "GPL-2.0-or-later", "LGPL-2.1-or-later", "GFDL-1.2") settings = "os", "arch", "compiler", "build_type" options = { @@ -55,7 +56,11 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_DOCS"] = False + tc.variables["BUILD_PROGRAMS"] = not is_apple_os(self) or self.settings.os == "Macos" tc.variables["BUILD_TESTING"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + if Version(self.version) < "1.3.4": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() cd = CMakeDeps(self) cd.generate() @@ -63,8 +68,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() @@ -98,17 +108,5 @@ def package_info(self): self.cpp_info.components["libflac"].defines = ["FLAC__NO_DLL"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libflac"].system_libs += ["m"] - - 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 - self.cpp_info.filenames["cmake_find_package"] = "flac" - self.cpp_info.filenames["cmake_find_package_multi"] = "flac" - self.cpp_info.names["cmake_find_package"] = "FLAC" - self.cpp_info.names["cmake_find_package_multi"] = "FLAC" - self.cpp_info.components["libflac"].names["cmake_find_package"] = "FLAC" - self.cpp_info.components["libflac"].names["cmake_find_package_multi"] = "FLAC" - self.cpp_info.components["libflac++"].names["cmake_find_package"] = "FLAC++" - self.cpp_info.components["libflac++"].names["cmake_find_package_multi"] = "FLAC++" + if Version(self.version) >= "1.5.0": + self.cpp_info.components["libflac"].system_libs += ["pthread"] diff --git a/recipes/flac/all/patches/1.4.2-002-ignore-dll_export-define.patch b/recipes/flac/all/patches/1.4.2-002-ignore-dll_export-define.patch new file mode 100644 index 0000000000000..0ce0853b69c7e --- /dev/null +++ b/recipes/flac/all/patches/1.4.2-002-ignore-dll_export-define.patch @@ -0,0 +1,22 @@ +--- include/FLAC/export.h ++++ include/FLAC/export.h +@@ -74,7 +74,7 @@ + */ + #if defined(_WIN32) + +-#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT)) ++#if defined(FLAC__NO_DLL) + #define FLAC_API + #else + #ifdef FLAC_API_EXPORTS +--- include/FLAC++/export.h ++++ include/FLAC++/export.h +@@ -73,7 +73,7 @@ + * by libtool, must override FLAC__NO_DLL on building shared components + */ + #if defined(_WIN32) +-#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT)) ++#if defined(FLAC__NO_DLL) + #define FLACPP_API + #else + #ifdef FLACPP_API_EXPORTS 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/all/test_package/CMakeLists.txt b/recipes/flac/all/test_package/CMakeLists.txt index 3b8634d9cb495..3482c62bbe096 100644 --- a/recipes/flac/all/test_package/CMakeLists.txt +++ b/recipes/flac/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(flac REQUIRED FLAC++ CONFIG) diff --git a/recipes/flac/all/test_v1_package/CMakeLists.txt b/recipes/flac/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3da5fc64af2ab..0000000000000 --- a/recipes/flac/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(flac REQUIRED FLAC++ CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE FLAC::FLAC++) diff --git a/recipes/flac/all/test_v1_package/conanfile.py b/recipes/flac/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/flac/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_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/flac/config.yml b/recipes/flac/config.yml index fac8ae5f33f51..d4b37fa26c5b1 100644 --- a/recipes/flac/config.yml +++ b/recipes/flac/config.yml @@ -1,4 +1,8 @@ versions: + "1.5.0": + folder: all + "1.4.3": + folder: all "1.4.2": folder: all "1.3.3": diff --git a/recipes/flann/all/conanfile.py b/recipes/flann/all/conanfile.py index 6a9cd05129f49..b6618904d5a2e 100644 --- a/recipes/flann/all/conanfile.py +++ b/recipes/flann/all/conanfile.py @@ -3,9 +3,10 @@ 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 +from conan.errors import ConanException import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class FlannConan(ConanFile): @@ -65,6 +66,9 @@ def generate(self): tc.variables["USE_OPENMP"] = False # Generate a relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.9.2": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() cd = CMakeDeps(self) @@ -141,11 +145,3 @@ def package_info(self): if not self.options.shared: self.cpp_info.components["flann_c"].defines.append("FLANN_STATIC") self.cpp_info.components["flann_c"].requires = ["flann_cpp"] - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "Flann" - self.cpp_info.names["cmake_find_package_multi"] = "flann" - self.cpp_info.components["flann_cpp"].names["cmake_find_package"] = flann_cpp_lib - self.cpp_info.components["flann_cpp"].names["cmake_find_package_multi"] = flann_cpp_lib - self.cpp_info.components["flann_c"].names["cmake_find_package"] = flann_c_lib - self.cpp_info.components["flann_c"].names["cmake_find_package_multi"] = flann_c_lib diff --git a/recipes/flann/all/test_package/CMakeLists.txt b/recipes/flann/all/test_package/CMakeLists.txt index 78713ac43c143..92cdd0e62206c 100644 --- a/recipes/flann/all/test_package/CMakeLists.txt +++ b/recipes/flann/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(flann REQUIRED CONFIG) diff --git a/recipes/flann/all/test_v1_package/CMakeLists.txt b/recipes/flann/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/flann/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/flann/all/test_v1_package/conanfile.py b/recipes/flann/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/flann/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_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/flatbuffers/all/conandata.yml b/recipes/flatbuffers/all/conandata.yml index bff177589ebd1..79e823d7d62db 100644 --- a/recipes/flatbuffers/all/conandata.yml +++ b/recipes/flatbuffers/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "24.12.23": + url: "https://github.com/google/flatbuffers/archive/v24.12.23.tar.gz" + sha256: "7e2ef35f1af9e2aa0c6a7d0a09298c2cb86caf3d4f58c0658b306256e5bcab10" + "24.3.25": + url: "https://github.com/google/flatbuffers/archive/v24.3.25.tar.gz" + sha256: "4157c5cacdb59737c5d627e47ac26b140e9ee28b1102f812b36068aab728c1ed" + "24.3.7": + url: "https://github.com/google/flatbuffers/archive/v24.3.7.tar.gz" + sha256: "bfff9d2150fcff88f844e8c608b02b2a0e94c92aea39b04c0624783464304784" "23.5.26": url: "https://github.com/google/flatbuffers/archive/v23.5.26.tar.gz" sha256: "1cce06b17cddd896b6d73cc047e36a254fb8df4d7ea18a46acf16c4c0cd3f3f3" @@ -8,9 +17,6 @@ sources: "23.1.21": url: "https://github.com/google/flatbuffers/archive/v23.1.21.tar.gz" sha256: "d84cb25686514348e615163b458ae0767001b24b42325f426fd56406fd384238" - "23.1.4": - url: "https://github.com/google/flatbuffers/archive/v23.1.4.tar.gz" - sha256: "801871ff3747838c0dd9730fc44ca9cc453ff42f9c8a0a2f1b33776d2ca5e4b9" "22.12.06": url: "https://github.com/google/flatbuffers/archive/v22.12.06.tar.gz" sha256: "209823306f2cbedab6ff70997e0d236fcfd1864ca9ad082cbfdb196e7386daed" @@ -23,15 +29,9 @@ sources: "22.9.29": url: "https://github.com/google/flatbuffers/archive/refs/tags/v22.9.29.tar.gz" sha256: "372df01795c670f6538055a7932fc7eb3e81b3653be4a216c081e9c3c26b1b6d" - "22.9.24": - url: "https://github.com/google/flatbuffers/archive/refs/tags/v22.9.24.tar.gz" - sha256: "40e0788873012def4d66a2fdbac15fbe012784473c01a703ccb5be33383556bf" "2.0.8": url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.8.tar.gz" sha256: "f97965a727d26386afaefff950badef2db3ab6af9afe23ed6d94bfb65f95f37e" - "2.0.6": - url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.6.tar.gz" - sha256: "e2dc24985a85b278dd06313481a9ca051d048f9474e0f199e372fea3ea4248c9" "2.0.5": url: "https://github.com/google/flatbuffers/archive/refs/tags/v2.0.5.tar.gz" sha256: "b01e97c988c429e164c5c7df9e87c80007ca87f593c0d73733ba536ddcbc8f98" @@ -39,10 +39,6 @@ sources: url: "https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz" sha256: "62f2223fb9181d1d6338451375628975775f7522185266cd5296571ac152bc45" patches: - "2.0.6": - - patch_file: "patches/0004-no-flatc-execution-build-time.patch" - patch_description: "No flatc execution during build time" - patch_type: "conan" "2.0.5": - patch_file: "patches/0002-apple-no-universal-build.patch" patch_description: "Don't use universal2 architecture" @@ -50,3 +46,8 @@ patches: - patch_file: "patches/0003-no-flatc-execution-build-time.patch" patch_description: "No flatc execution during build time" patch_type: "conan" + "1.12.0": + - patch_file: "patches/0005-arm-cxx-compiler-build.patch" + patch_description: "IAR ARM C++ Compiler build bugfix" + patch_type: "backport" + patch_source: "https://github.com/google/flatbuffers/commit/82fac326c5981a85233b8ae7e0d7ec8fda432963" diff --git a/recipes/flatbuffers/all/conanfile.py b/recipes/flatbuffers/all/conanfile.py index 06610b4d9bfd6..62177b5e2c772 100644 --- a/recipes/flatbuffers/all/conanfile.py +++ b/recipes/flatbuffers/all/conanfile.py @@ -1,12 +1,12 @@ from conan import ConanFile from conan.tools.apple import is_apple_os -from conan.tools.build import check_min_cppstd, valid_min_cppstd +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import export_conandata_patches, apply_conandata_patches, collect_libs, copy, get, replace_in_file, rmdir from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class FlatbuffersConan(ConanFile): @@ -18,6 +18,7 @@ class FlatbuffersConan(ConanFile): description = "Memory Efficient Serialization Library" settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -56,17 +57,17 @@ def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def build_requirements(self): # since 23.3.3 version, flatbuffers cmake scripts were refactored to use cmake 3.8 version # see https://github.com/google/flatbuffers/pull/7801 - if Version(self.version) >= "2.0.7" and Version(self.version) < "23.3.3": + if Version(self.version) >= "2.0.8" and Version(self.version) < "23.3.3": self.tool_requires("cmake/[>=3.16 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._patch_sources() def generate(self): tc = CMakeToolchain(self) @@ -89,12 +90,11 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True # Relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "2.0.8": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support # Fix iOS/tvOS/watchOS if is_apple_os(self): tc.variables["CMAKE_MACOSX_BUNDLE"] = False - # Inject at least C++11 standard (would be more elegant to rely on cxx_std_11 compile feature upstream) - if not valid_min_cppstd(self, 11): - tc.variables["CMAKE_CXX_STANDARD"] = 11 tc.generate() def _patch_sources(self): @@ -112,7 +112,6 @@ def _patch_sources(self): "RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}") def build(self): - self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -156,17 +155,3 @@ def package_info(self): os.path.join(self._module_path, "BuildFlatBuffers.cmake"), ] self.cpp_info.set_property("cmake_build_modules", build_modules) - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "flatbuffers" - self.cpp_info.filenames["cmake_find_package_multi"] = "flatbuffers" - self.cpp_info.names["cmake_find_package"] = "flatbuffers" - self.cpp_info.names["cmake_find_package_multi"] = "flatbuffers" - self.cpp_info.components["libflatbuffers"].names["cmake_find_package"] = cmake_target - self.cpp_info.components["libflatbuffers"].names["cmake_find_package_multi"] = cmake_target - self.cpp_info.components["libflatbuffers"].build_modules["cmake_find_package"] = build_modules - self.cpp_info.components["libflatbuffers"].build_modules["cmake_find_package_multi"] = build_modules - self.cpp_info.components["libflatbuffers"].set_property("cmake_file_name", f"flatbuffers::{cmake_target}") - self.cpp_info.components["libflatbuffers"].set_property("pkg_config_name", "flatbuffers") - if self._has_flatc(): - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch b/recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch deleted file mode 100644 index 11da02ea5d8c9..0000000000000 --- a/recipes/flatbuffers/all/patches/0004-no-flatc-execution-build-time.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 21e90151..2ce3eb48 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -536,6 +536,7 @@ function(compile_flatbuffers_schema_to_embedded_binary SRC_FBS OPT) - register_generated_output(${GEN_BFBS_HEADER}) - endfunction() - -+if(0) - # Look if we have python 3.5 installed so that we can run the generate code - # python script after flatc is built. - find_package(Python3 3.5 COMPONENTS Interpreter) -@@ -559,6 +560,7 @@ if(Python3_Interpreter_FOUND) - else() - message("No Python3 interpreter found! Unable to generate files automatically.") - endif() -+endif() - - if(FLATBUFFERS_BUILD_TESTS) - file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/tests" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/recipes/flatbuffers/all/patches/0005-arm-cxx-compiler-build.patch b/recipes/flatbuffers/all/patches/0005-arm-cxx-compiler-build.patch new file mode 100644 index 0000000000000..7ea43002f8643 --- /dev/null +++ b/recipes/flatbuffers/all/patches/0005-arm-cxx-compiler-build.patch @@ -0,0 +1,16 @@ +diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h +index c4dc5bcd..0f3a7dfd 100644 +--- a/include/flatbuffers/flatbuffers.h ++++ b/include/flatbuffers/flatbuffers.h +@@ -1871,10 +1871,7 @@ class FlatBufferBuilder { + vector_downward &buf_; + + private: +- TableKeyComparator &operator=(const TableKeyComparator &other) { +- buf_ = other.buf_; +- return *this; +- } ++ FLATBUFFERS_DELETE_FUNC(TableKeyComparator &operator=(const TableKeyComparator &other)) + }; + /// @endcond + diff --git a/recipes/flatbuffers/all/test_package/CMakeLists.txt b/recipes/flatbuffers/all/test_package/CMakeLists.txt index 59f9fe8ba9801..4bb176dd12af1 100644 --- a/recipes/flatbuffers/all/test_package/CMakeLists.txt +++ b/recipes/flatbuffers/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(FlatBuffers REQUIRED CONFIG) diff --git a/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt b/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/flatbuffers/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/flatbuffers/all/test_v1_package/conanfile.py b/recipes/flatbuffers/all/test_v1_package/conanfile.py deleted file mode 100644 index 949b7060f8e9c..0000000000000 --- a/recipes/flatbuffers/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +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" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build(self): - cmake = CMake(self) - cmake.definitions["FLATBUFFERS_HEADER_ONLY"] = self.options["flatbuffers"].header_only - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) - self.run(os.path.join("bin", "sample_binary"), run_environment=True) diff --git a/recipes/flatbuffers/config.yml b/recipes/flatbuffers/config.yml index 58021445a86c5..f47f4f0982cc3 100644 --- a/recipes/flatbuffers/config.yml +++ b/recipes/flatbuffers/config.yml @@ -1,12 +1,16 @@ versions: + "24.12.23": + folder: all + "24.3.25": + folder: all + "24.3.7": + folder: all "23.5.26": folder: all "23.3.3": folder: all "23.1.21": folder: all - "23.1.4": - folder: all "22.12.06": folder: all "22.11.23": @@ -15,12 +19,8 @@ versions: folder: all "22.9.29": folder: all - "22.9.24": - folder: all "2.0.8": folder: all - "2.0.6": - folder: all "2.0.5": folder: all "1.12.0": diff --git a/recipes/flatbush/all/conandata.yml b/recipes/flatbush/all/conandata.yml index f43d2fb04fed7..4382ecd215405 100644 --- a/recipes/flatbush/all/conandata.yml +++ b/recipes/flatbush/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.1": + url: "https://github.com/chusitoo/flatbush/archive/refs/tags/v1.2.1.zip" + sha256: "7f8226cb9a58cc75c99800a8fb213b1c2c5df81051ec559d5ff7b4ed0e8c097a" "1.2.0": url: "https://github.com/chusitoo/flatbush/archive/refs/tags/v1.2.0.zip" sha256: "d8d0471ad6aba1e4b1160abc38a0fe21a35e3ea1c2a9509ce9910072f7fc24bb" diff --git a/recipes/flatbush/all/test_v1_package/CMakeLists.txt b/recipes/flatbush/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/flatbush/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 5b0ef1df32f11..0000000000000 --- a/recipes/flatbush/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +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", "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 2424e32f70b3e..7b2fedacd7387 100644 --- a/recipes/flatbush/config.yml +++ b/recipes/flatbush/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.1": + folder: "all" "1.2.0": folder: "all" "1.1.0": diff --git a/recipes/flatc/all/CMakeLists.txt b/recipes/flatc/all/CMakeLists.txt index 2765caac4dc2c..4eb6274764230 100644 --- a/recipes/flatc/all/CMakeLists.txt +++ b/recipes/flatc/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) include(conanbuildinfo.cmake) conan_basic_setup() diff --git a/recipes/flatc/all/test_package/CMakeLists.txt b/recipes/flatc/all/test_package/CMakeLists.txt index 345fa69ffef50..3ec149de1499b 100644 --- a/recipes/flatc/all/test_package/CMakeLists.txt +++ b/recipes/flatc/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/flatcc/all/CMakeLists.txt b/recipes/flatcc/all/CMakeLists.txt deleted file mode 100644 index 07ec7f05275cb..0000000000000 --- a/recipes/flatcc/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/flatcc/all/conanfile.py b/recipes/flatcc/all/conanfile.py index 09f5cab415518..8509d971bbcd8 100644 --- a/recipes/flatcc/all/conanfile.py +++ b/recipes/flatcc/all/conanfile.py @@ -1,52 +1,53 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -import functools -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, can_run +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.tools.scm import Version + +required_conan_version = ">=1.53.0" + class FlatccConan(ConanFile): name = "flatcc" description = "C language binding for Flatbuffers, an efficient cross platform serialization library" license = "Apache-2.0" - topics = ("flatbuffers", "serialization") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/dvidelabs/flatcc" + topics = ("flatbuffers", "serialization") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = { "shared": [True, False], - "fPIC": [True, False], - "portable": [True, False], - "gnu_posix_memalign": [True, False], - "runtime_lib_only": [True, False], - "verify_assert": [True, False], - "verify_trace": [True, False], - "reflection": [True, False], - "native_optim": [True, False], - "fast_double": [True, False], - "ignore_const_condition": [True, False], + options = { + "shared": [True, False], + "fPIC": [True, False], + "portable": [True, False], + "gnu_posix_memalign": [True, False], + "runtime_lib_only": [True, False], + "verify_assert": [True, False], + "verify_trace": [True, False], + "reflection": [True, False], + "native_optim": [True, False], + "fast_double": [True, False], + "ignore_const_condition": [True, False], } - default_options = { "shared": False, - "fPIC": True, - "portable": False, - "gnu_posix_memalign": True, - "runtime_lib_only": False, - "verify_assert": False, - "verify_trace": False, - "reflection": True, - "native_optim": False, - "fast_double": False, - "ignore_const_condition": False + default_options = { + "shared": False, + "fPIC": True, + "portable": False, + "gnu_posix_memalign": True, + "runtime_lib_only": False, + "verify_assert": False, + "verify_trace": False, + "reflection": True, + "native_optim": False, + "fast_double": False, + "ignore_const_condition": False, } - generators = "cmake" - exports_sources = ["CMakeLists.txt"] - - @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": @@ -54,58 +55,62 @@ 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.os == "Windows": - if self.settings.compiler == "Visual Studio" and self.options.shared: - #Building flatcc shared libs with Visual Studio is broken + if is_msvc(self) and self.options.shared: + # Building flatcc shared libs with Visual Studio is broken raise ConanInvalidConfiguration("Building flatcc libraries shared is not supported") - if tools.Version(self.version) == "0.6.0" and self.settings.compiler == "gcc": + if Version(self.version) == "0.6.0" and self.settings.compiler == "gcc": raise ConanInvalidConfiguration("Building flatcc with MinGW is not supported") + if cross_building(self) and not can_run(self): + raise ConanInvalidConfiguration(f"Cross-building for a non-native architecture ({self.settings.arch}) 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) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["FLATCC_PORTABLE"] = self.options.portable - cmake.definitions["FLATCC_GNU_POSIX_MEMALIGN"] = self.options.gnu_posix_memalign - cmake.definitions["FLATCC_RTONLY"] = self.options.runtime_lib_only - cmake.definitions["FLATCC_INSTALL"] = True - cmake.definitions["FLATCC_COVERAGE"] = False - cmake.definitions["FLATCC_DEBUG_VERIFY"] = self.options.verify_assert - cmake.definitions["FLATCC_TRACE_VERIFY"] = self.options.verify_trace - cmake.definitions["FLATCC_REFLECTION"] = self.options.reflection - cmake.definitions["FLATCC_NATIVE_OPTIM"] = self.options.native_optim - cmake.definitions["FLATCC_FAST_DOUBLE"] = self.options.fast_double - cmake.definitions["FLATCC_IGNORE_CONST_COND"] = self.options.ignore_const_condition - cmake.definitions["FLATCC_TEST"] = False - cmake.definitions["FLATCC_ALLOW_WERROR"] = False - cmake.configure(build_folder=self._build_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FLATCC_PORTABLE"] = self.options.portable + tc.variables["FLATCC_GNU_POSIX_MEMALIGN"] = self.options.gnu_posix_memalign + tc.variables["FLATCC_RTONLY"] = self.options.runtime_lib_only + tc.variables["FLATCC_INSTALL"] = True + tc.variables["FLATCC_COVERAGE"] = False + tc.variables["FLATCC_DEBUG_VERIFY"] = self.options.verify_assert + tc.variables["FLATCC_TRACE_VERIFY"] = self.options.verify_trace + tc.variables["FLATCC_REFLECTION"] = self.options.reflection + tc.variables["FLATCC_NATIVE_OPTIM"] = self.options.native_optim + tc.variables["FLATCC_FAST_DOUBLE"] = self.options.fast_double + tc.variables["FLATCC_IGNORE_CONST_COND"] = self.options.ignore_const_condition + tc.variables["FLATCC_TEST"] = False + tc.variables["FLATCC_ALLOW_WERROR"] = False + tc.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() - if self.settings.build_type == "Debug" and not tools.os_info.is_windows: + if self.settings.build_type == "Debug" and not self.settings.os == "Windows": debug_suffix = "_d" if self.settings.build_type == "Debug" else "" - os.rename(os.path.join(self.package_folder, "bin", "flatcc%s" % debug_suffix), + os.rename(os.path.join(self.package_folder, "bin", f"flatcc{debug_suffix}"), os.path.join(self.package_folder, "bin", "flatcc")) - # Copy license file - 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): - bin_path = os.path.join(self.package_folder, "bin") - self.output.info('Appending PATH environment variable: %s' % bin_path) - self.env_info.PATH.append(bin_path) debug_suffix = "_d" if self.settings.build_type == "Debug" else "" if not self.options.runtime_lib_only: - self.cpp_info.libs.append("flatcc%s" % debug_suffix) - self.cpp_info.libs.append("flatccrt%s" % debug_suffix) + self.cpp_info.libs.append(f"flatcc{debug_suffix}") + self.cpp_info.libs.append(f"flatccrt{debug_suffix}") + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) diff --git a/recipes/flatcc/all/test_package/CMakeLists.txt b/recipes/flatcc/all/test_package/CMakeLists.txt index 3a1e3c2e0ae88..30545f8db3c32 100644 --- a/recipes/flatcc/all/test_package/CMakeLists.txt +++ b/recipes/flatcc/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(flatcc_example) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(flatcc_example LANGUAGES C) find_package(flatcc REQUIRED CONFIG) @@ -14,20 +11,14 @@ include_directories("${GEN_DIR}" "${INC_DIR}") add_executable(monster monster.c) -#On MacOS System Integrity Protection (SIP) will clear the DYLD_LIBRARY_PATH variable. -#As a result calling flatcc from cmake will currently not work if the flatcc executable -# is linked shared. As a workaround we generate the flatbuffer C files in the Conan recipe -# when on MacOS and flatcc option 'shared' is True. -if (NOT MACOS_SIP_WORKAROUND) - add_custom_target(gen_monster_fbs ALL) - add_custom_command ( - TARGET gen_monster_fbs - COMMAND cmake -E make_directory "${GEN_DIR}" - COMMAND flatcc -a -o "${GEN_DIR}" "${FBS_DIR}/monster.fbs" - DEPENDS flatcc "${FBS_DIR}/monster.fbs" - ) +add_custom_target(gen_monster_fbs ALL) +add_custom_command ( + TARGET gen_monster_fbs + COMMAND cmake -E make_directory "${GEN_DIR}" + COMMAND flatcc -a -o "${GEN_DIR}" "${FBS_DIR}/monster.fbs" + DEPENDS flatcc "${FBS_DIR}/monster.fbs" +) - add_dependencies(monster gen_monster_fbs) -endif() +add_dependencies(monster gen_monster_fbs) target_link_libraries(monster flatcc::flatcc) diff --git a/recipes/flatcc/all/test_package/conanfile.py b/recipes/flatcc/all/test_package/conanfile.py index 35aa66924f6ab..862b0fa5fd360 100644 --- a/recipes/flatcc/all/test_package/conanfile.py +++ b/recipes/flatcc/all/test_package/conanfile.py @@ -1,35 +1,46 @@ -import os.path +import os -from conans import ConanFile, CMake, tools, RunEnvironment -from conans.errors import ConanException +from conan import ConanFile, conan_version +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.env import VirtualRunEnv -class FlatccTestConan(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 build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + @property + def _skip_shared_macos(self): + return conan_version.major == 1 and self.options["flatcc"].shared and is_apple_os(self) + + def generate(self): + VirtualRunEnv(self).generate(scope="build") + VirtualRunEnv(self).generate(scope="run") + def build(self): - if tools.cross_building(self): + if self._skip_shared_macos: return - - env_build = RunEnvironment(self) - with tools.environment_append(env_build.vars): - cmake = CMake(self) - if tools.os_info.is_macos and self.options["flatcc"].shared: - # Because of MacOS System Integraty Protection it is currently not possible to run the flatcc - # executable from cmake if it is linked shared. As a temporary work-around run flatcc here in - # the build function. - tools.mkdir(os.path.join(self.build_folder, "generated")) - self.run("flatcc -a -o " + os.path.join(self.build_folder, "generated") + " " + os.path.join(self.source_folder, "monster.fbs"), run_environment=True) - cmake.definitions["MACOS_SIP_WORKAROUND"] = True - cmake.configure() - cmake.build() + cmake = CMake(self) + cmake.configure() + cmake.build() def test(self): - if tools.cross_building(self): - bin_path = os.path.join(self.deps_cpp_info["flatcc"].rootpath, "bin", "flatcc") - if not os.path.isfile(bin_path) or not os.access(bin_path, os.X_OK): - raise ConanException("flatcc doesn't exist.") - else: - bin_path = os.path.join(self.build_folder, "bin", "monster") - self.run(bin_path, cwd=self.source_folder, run_environment=True) + if self._skip_shared_macos: + return + if can_run(self): + self.run("flatcc --version") + bin_path = os.path.join(self.cpp.build.bindir, "monster") + self.run(bin_path, env="conanrun") diff --git a/recipes/flecs/all/conandata.yml b/recipes/flecs/all/conandata.yml index aa41772cdfb91..a7555bd48992d 100644 --- a/recipes/flecs/all/conandata.yml +++ b/recipes/flecs/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "4.0.4": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v4.0.4.tar.gz" + sha256: "a3b6238a913f65d90db18759ab5442393901da914e4a9bfe30aa8823687dce86" + "4.0.0": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v4.0.0.tar.gz" + sha256: "6c9826c8602f797acd775269d143763adfb3d3a93031cc81bced2b6d267469d2" + "3.2.11": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.2.11.tar.gz" + sha256: "8ebc5f6f3ec7bbba30b0afe9d22f157437925772857ea1c6e4201eb5d31b4fe5" "3.2.8": url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.2.8.tar.gz" sha256: "b40453a77b66e220408c50b119da54b153c248cf6f7025575e3fd1a8ff79f748" diff --git a/recipes/flecs/all/conanfile.py b/recipes/flecs/all/conanfile.py index b4d76faa5ed41..772d3a2cb6618 100644 --- a/recipes/flecs/all/conanfile.py +++ b/recipes/flecs/all/conanfile.py @@ -17,6 +17,7 @@ class FlecsConan(ConanFile): homepage = "https://github.com/SanderMertens/flecs" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -53,6 +54,7 @@ def generate(self): else: tc.variables["FLECS_STATIC"] = not self.options.shared tc.variables["FLECS_SHARED"] = self.options.shared + tc.variables["FLECS_TESTS"] = False tc.variables["FLECS_PIC"] = self.options.get_safe("fPIC", True) tc.generate() diff --git a/recipes/flecs/all/test_package/CMakeLists.txt b/recipes/flecs/all/test_package/CMakeLists.txt index fc32143d0f19f..b79a4a8894f06 100644 --- a/recipes/flecs/all/test_package/CMakeLists.txt +++ b/recipes/flecs/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(flecs REQUIRED CONFIG) diff --git a/recipes/flecs/all/test_package/conanfile.py b/recipes/flecs/all/test_package/conanfile.py index 0a6bc68712d90..1a364276dd853 100644 --- a/recipes/flecs/all/test_package/conanfile.py +++ b/recipes/flecs/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, cmake_layout, 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 +15,12 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + def generate(self): + tc = CMakeToolchain(self) + if self.dependencies[self.tested_reference_str].ref.version < "4.0.0": + tc.preprocessor_definitions["LESS_VERSION_4"] = "1" + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/flecs/all/test_package/test_package.c b/recipes/flecs/all/test_package/test_package.c index 6b277544863db..9a75f507a8f98 100644 --- a/recipes/flecs/all/test_package/test_package.c +++ b/recipes/flecs/all/test_package/test_package.c @@ -11,8 +11,11 @@ int main() { ecs_world_t *world = ecs_init(); ECS_COMPONENT(world, Position); - +#ifdef LESS_VERSION_4 ecs_entity_t e = ecs_new_id(world); +#else + ecs_entity_t e = ecs_new(world); +#endif ecs_set(world, e, Position, {10.0f, 20.0f}); const char *name = ecs_get_name(world, e); diff --git a/recipes/flecs/all/test_v1_package/CMakeLists.txt b/recipes/flecs/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/flecs/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/flecs/all/test_v1_package/conanfile.py b/recipes/flecs/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/flecs/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_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/flecs/config.yml b/recipes/flecs/config.yml index df52862429336..42ef506fbd38c 100644 --- a/recipes/flecs/config.yml +++ b/recipes/flecs/config.yml @@ -1,4 +1,10 @@ versions: + "4.0.4": + folder: all + "4.0.0": + folder: all + "3.2.11": + folder: all "3.2.8": folder: all "3.2.4": diff --git a/recipes/flex/all/test_v1_package/CMakeLists.txt b/recipes/flex/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b93b03cb34ebf..0000000000000 --- a/recipes/flex/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(FLEX REQUIRED) -flex_target(flex_scanner basic_nr.l ${PROJECT_BINARY_DIR}/basic_nr.cpp) - -add_executable(${PROJECT_NAME} basic_nr.cpp) -target_include_directories(${PROJECT_NAME} PRIVATE ${FLEX_INCLUDE_DIRS}) -target_link_libraries(${PROJECT_NAME} PRIVATE ${FLEX_LIBRARIES}) diff --git a/recipes/flex/all/test_v1_package/basic_nr.l b/recipes/flex/all/test_v1_package/basic_nr.l deleted file mode 100644 index 71fa5d65f82c6..0000000000000 --- a/recipes/flex/all/test_v1_package/basic_nr.l +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This file is part of flex. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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 the University 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. - */ - -%option C++ noyywrap - -%{ -int mylineno = 0; -%} - -string \"[^\n"]+\" - -ws [ \t]+ - -alpha [A-Za-z] -dig [0-9] -name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)* -num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)? -num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)? -number {num1}|{num2} - -%% - -{ws} /* skip blanks and tabs */ - -"/*" { - int c; - - while((c = yyinput()) != 0) - { - if(c == '\n') - ++mylineno; - - else if(c == '*') - { - if((c = yyinput()) == '/') - break; - else - unput(c); - } - } - } - -{number} std::cout << "number " << YYText() << '\n'; - -\n mylineno++; - -{name} std::cout << "name " << YYText() << '\n'; - -{string} std::cout << "string " << YYText() << '\n'; - -%% - -extern "C" { - int yylex() {return 0;} -} - -#include - -int main( int argc, const char *argv[]) { - if (argc < 2) { - fprintf(stderr, "Need an argument\n"); - return 1; - } - std::ifstream ifs(argv[1]); - FlexLexer *lexer = new yyFlexLexer(ifs, std::cout); - while(lexer->yylex() != 0) - ; - return 0; -} diff --git a/recipes/flex/all/test_v1_package/basic_nr.txt b/recipes/flex/all/test_v1_package/basic_nr.txt deleted file mode 100644 index 3dca798730b64..0000000000000 --- a/recipes/flex/all/test_v1_package/basic_nr.txt +++ /dev/null @@ -1,6 +0,0 @@ -/* this is a multi line comment -still in the comment -and done */ -foo = "bar" -num = 43 -setting = false diff --git a/recipes/flex/all/test_v1_package/conanfile.py b/recipes/flex/all/test_v1_package/conanfile.py deleted file mode 100644 index 4d0b7ff593f64..0000000000000 --- a/recipes/flex/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import re -from io import StringIO - -from conans import ConanFile, tools, CMake - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - self.tool_requires(self.tested_reference_str) - - def _assert_expected_version(self): - - def tested_reference_version(): - tokens = re.split('[@#]', self.tested_reference_str) - return tokens[0].split("/", 1)[1] - - output = StringIO() - self.run(f"flex --version", output, run_environment=False) - output_str = str(output.getvalue()) - self.output.info("Installed version: {}".format(output_str)) - expected_version = tested_reference_version() - self.output.info("Expected version: {}".format(expected_version)) - assert_flex_version = "flex {}".format(expected_version) - assert(assert_flex_version in output_str) - - def build(self): - # Let's check flex version installed - self._assert_expected_version() - # FIXME: CMake legacy is not working as expected when cross-compiling - 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): - bin_path = os.path.join("bin", "test_package") - txt_file = os.path.join(self.source_folder, "basic_nr.txt") - self.run(f"{bin_path} {txt_file}", run_environment=True) 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/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/conandata.yml b/recipes/fltk/all/conandata.yml index 0f349ed128921..9b0e61e3a559e 100644 --- a/recipes/fltk/all/conandata.yml +++ b/recipes/fltk/all/conandata.yml @@ -1,9 +1,18 @@ sources: + "1.4.1": + url: "https://github.com/fltk/fltk/archive/refs/tags/release-1.4.1.tar.gz" + sha256: "26d3e521cbf3498f122fa86f6e45fc33b84135f9eb2125f6366ef09e8eae8c91" + "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": - patch_file: "patches/1.3.8-0001-remove-fluid.patch" - patch_file: "patches/1.3.8-0002-fix-resources.patch" diff --git a/recipes/fltk/all/conanfile.py b/recipes/fltk/all/conanfile.py index 4b4a216b2a0e2..73a381ab68648 100644 --- a/recipes/fltk/all/conanfile.py +++ b/recipes/fltk/all/conanfile.py @@ -4,6 +4,8 @@ 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 +from conan.tools.microsoft import msvc_runtime_flag +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -36,6 +38,14 @@ class FltkConan(ConanFile): "with_xft": False, } + @property + def _is_cl_like(self): + return self.settings.compiler.get_safe("runtime") is not None + + @property + def _is_cl_like_static_runtime(self): + return self._is_cl_like and "MT" in msvc_runtime_flag(self) + def export_sources(self): export_conandata_patches(self) @@ -68,31 +78,55 @@ def layout(self): def requirements(self): self.requires("zlib/[>=1.2.11 <2]") self.requires("libjpeg/9e") - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") 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("fontconfig/2.15.0") self.requires("xorg/system") if self.options.with_xft: - self.requires("libxft/2.3.6") + self.requires("libxft/2.3.8") + if Version(self.version) >= "1.4.0": + self.requires("gtk/system", options={"version": "3"}) + self.requires("wayland/1.22.0") + self.requires("xkbcommon/1.6.0") + self.requires("dbus/1.15.8") def source(self): 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: - tc.variables["OPTION_ABI_VERSION"] = self.options.abi_version + if Version(self.version) < "1.4.0": + tc.variables["OPTION_BUILD_SHARED_LIBS"] = self.options.shared + 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: + 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 + else: + tc.variables["FLTK_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["FLTK_BUILD_GL"] = self.options.with_gl + tc.variables["FLTK_USE_PTHREADS"] = self.options.with_threads + tc.variables["FLTK_BUILD_HTML_DOCS"] = False + tc.variables["FLTK_BUILD_PDF_DOCS"] = False + tc.variables["FLTK_USE_XFT"] = self.options.with_xft + if self.options.abi_version: + tc.variables["FLTK_ABI_VERSION"] = self.options.abi_version + tc.variables["FLTK_USE_SYSTEM_LIBJPEG"] = True + tc.variables["FLTK_USE_SYSTEM_ZLIB"] = True + tc.variables["FLTK_USE_SYSTEM_LIBPNG"] = True + tc.variables["FLTK_BUILD_FLUID"] = False + if Version(self.version) >= "1.3.9" and self._is_cl_like: + tc.variables["FLTK_MSVC_RUNTIME_DLL"] = not self._is_cl_like_static_runtime tc.generate() tc = CMakeDeps(self) tc.generate() @@ -137,7 +171,5 @@ def package_info(self): 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" + if Version(self.version) >= "1.4.0": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/fltk/config.yml b/recipes/fltk/config.yml index 76eba86fa7f6d..f5a5523357cb7 100644 --- a/recipes/fltk/config.yml +++ b/recipes/fltk/config.yml @@ -1,3 +1,7 @@ versions: + "1.4.1": + folder: "all" + "1.3.9": + folder: "all" "1.3.8": folder: "all" diff --git a/recipes/flux/all/conandata.yml b/recipes/flux/all/conandata.yml new file mode 100644 index 0000000000000..0e08f22b473ce --- /dev/null +++ b/recipes/flux/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.4.0": + url: "https://github.com/tcbrindle/flux/archive/refs/tags/v0.4.0.zip" + sha256: "d17c656934688e085197eb6bd576a2e468d2b513c4f3be60121b8863c0830e13" + "cci.20240115": + url: "https://codeload.github.com/tcbrindle/flux/zip/e942a678ed3b46c7f7ffeebe47eed5c5bec005b2" + sha256: "3832fb160417d14cfb3636c8edab04b2d0cd6c230b4d474a18bb1389fa1c3b8f" diff --git a/recipes/flux/all/conanfile.py b/recipes/flux/all/conanfile.py new file mode 100644 index 0000000000000..275dd18e535b9 --- /dev/null +++ b/recipes/flux/all/conanfile.py @@ -0,0 +1,77 @@ +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.52.0" + + +class PackageConan(ConanFile): + name = "flux" + description = ("Flux is an experimental C++20 library for working with sequences of values. " + "It offers similar facilities to C++20 ranges, D ranges, Python itertools, " + "Rust iterators and related libraries for other languages.") + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tcbrindle/flux" + topics = ("algorithms", "collections", "sequences", "ranges", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + # https://github.com/tcbrindle/flux/blob/e942a678/CMakeLists.txt#L21 + if is_msvc(self): + return 23 + return 20 + + @property + def _compilers_minimum_version(self): + # https://github.com/tcbrindle/flux?tab=readme-ov-file#compiler-support + return { + "apple-clang": "15", + "clang": "16", + "gcc": "11", + "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"): + 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_1_0.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "flux") + self.cpp_info.set_property("cmake_target_name", "flux::flux") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + diff --git a/recipes/flux/all/test_package/CMakeLists.txt b/recipes/flux/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..584da8ad2d297 --- /dev/null +++ b/recipes/flux/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(flux REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE flux::flux) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/flux/all/test_package/conanfile.py b/recipes/flux/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/flux/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/flux/all/test_package/test_package.cpp b/recipes/flux/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..54a70bdd39bbc --- /dev/null +++ b/recipes/flux/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +int main() { + constexpr auto result = flux::from(std::array{1, 2, 3, 4, 5}) + .filter(flux::pred::even) + .map([](int i) { return i * 2; }) + .sum(); + static_assert(result == 12); +} diff --git a/recipes/flux/config.yml b/recipes/flux/config.yml new file mode 100644 index 0000000000000..e1fec433b2cec --- /dev/null +++ b/recipes/flux/config.yml @@ -0,0 +1,5 @@ +versions: + "0.4.0": + folder: all + "cci.20240115": + folder: all diff --git a/recipes/fmt/all/conandata.yml b/recipes/fmt/all/conandata.yml index 1ddc76ef1e667..df6bec2cb564b 100644 --- a/recipes/fmt/all/conandata.yml +++ b/recipes/fmt/all/conandata.yml @@ -1,4 +1,31 @@ sources: + "11.2.0": + url: "https://github.com/fmtlib/fmt/releases/download/11.2.0/fmt-11.2.0.zip" + sha256: "203eb4e8aa0d746c62d8f903df58e0419e3751591bb53ff971096eaa0ebd4ec3" + "11.1.4": + url: "https://github.com/fmtlib/fmt/releases/download/11.1.4/fmt-11.1.4.zip" + sha256: "49b039601196e1a765e81c5c9a05a61ed3d33f23b3961323d7322e4fe213d3e6" + "11.1.3": + url: "https://github.com/fmtlib/fmt/releases/download/11.1.3/fmt-11.1.3.zip" + sha256: "7df2fd3426b18d552840c071c977dc891efe274051d2e7c47e2c83c3918ba6df" + "11.1.1": + url: "https://github.com/fmtlib/fmt/releases/download/11.1.1/fmt-11.1.1.zip" + sha256: "a25124e41c15c290b214c4dec588385153c91b47198dbacda6babce27edc4b45" + "11.0.2": + url: "https://github.com/fmtlib/fmt/releases/download/11.0.2/fmt-11.0.2.zip" + sha256: "40fc58bebcf38c759e11a7bd8fdc163507d2423ef5058bba7f26280c5b9c5465" + "11.0.1": + url: "https://github.com/fmtlib/fmt/releases/download/11.0.1/fmt-11.0.1.zip" + sha256: "62ca45531814109b5d6cef0cf2fd17db92c32a30dd23012976e768c685534814" + "11.0.0": + url: "https://github.com/fmtlib/fmt/releases/download/11.0.0/fmt-11.0.0.zip" + sha256: "583ce480ef07fad76ef86e1e2a639fc231c3daa86c4aa6bcba524ce908f30699" + "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" diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index ab898ea991411..993117f02a93e 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -6,17 +6,18 @@ from conan.tools.layout import basic_layout from conan.tools.build import check_min_cppstd from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class FmtConan(ConanFile): name = "fmt" - homepage = "https://github.com/fmtlib/fmt" description = "A safe and fast alternative to printf and IOStreams." - topics = ("format", "iostream", "printf") - url = "https://github.com/conan-io/conan-center-index" license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fmtlib/fmt" + topics = ("format", "iostream", "printf") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -25,6 +26,7 @@ class FmtConan(ConanFile): "fPIC": [True, False], "with_fmt_alias": [True, False], "with_os_api": [True, False], + "with_unicode": [True, False], } default_options = { "header_only": False, @@ -32,12 +34,17 @@ class FmtConan(ConanFile): "fPIC": True, "with_fmt_alias": False, "with_os_api": True, + "with_unicode": True, } @property def _has_with_os_api_option(self): return Version(self.version) >= "7.0.0" + @property + def _has_with_unicode_option(self): + return Version(self.version) >= "11.0.0" + def export_sources(self): export_conandata_patches(self) @@ -48,6 +55,8 @@ def config_options(self): del self.options.with_os_api elif str(self.settings.os) == "baremetal": self.options.with_os_api = False + if not self._has_with_unicode_option: + del self.options.with_unicode def configure(self): if self.options.header_only: @@ -85,6 +94,8 @@ def generate(self): tc.cache_variables["FMT_LIB_DIR"] = "lib" if self._has_with_os_api_option: tc.cache_variables["FMT_OS"] = bool(self.options.with_os_api) + if self._has_with_unicode_option: + tc.cache_variables["FMT_UNICODE"] = bool(self.options.with_unicode) tc.generate() def build(self): @@ -95,7 +106,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: @@ -110,8 +124,20 @@ def package_info(self): target = "fmt-header-only" if self.options.header_only else "fmt" self.cpp_info.set_property("cmake_file_name", "fmt") self.cpp_info.set_property("cmake_target_name", f"fmt::{target}") + + # Mirror upstream find package version policy: + # https://github.com/fmtlib/fmt/blob/11.1.1/CMakeLists.txt#L403-L407 + self.cpp_info.set_property("cmake_config_version_compat", "AnyNewerVersion") self.cpp_info.set_property("pkg_config_name", "fmt") + if is_msvc(self): + if self.options.get_safe("with_unicode"): + self.cpp_info.components["_fmt"].cxxflags.append("/utf-8") + else: + # Set the FMT_UNICODE=0, as defined publicly upstream + # https://github.com/fmtlib/fmt/blob/11.1.1/CMakeLists.txt#L371 + self.cpp_info.components["_fmt"].defines.append("FMT_UNICODE=0") + # TODO: back to global scope in conan v2 once cmake_find_package* generators removed if self.options.with_fmt_alias: self.cpp_info.components["_fmt"].defines.append("FMT_STRING_ALIAS=1") @@ -120,7 +146,6 @@ def package_info(self): self.cpp_info.components["_fmt"].defines.append("FMT_HEADER_ONLY=1") self.cpp_info.components["_fmt"].libdirs = [] self.cpp_info.components["_fmt"].bindirs = [] - else: postfix = "d" if self.settings.build_type == "Debug" else "" libname = "fmt" + postfix @@ -130,10 +155,4 @@ def package_info(self): if self.options.shared: self.cpp_info.components["_fmt"].defines.append("FMT_SHARED") - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "fmt" - self.cpp_info.names["cmake_find_package_multi"] = "fmt" - self.cpp_info.names["pkg_config"] = "fmt" - self.cpp_info.components["_fmt"].names["cmake_find_package"] = target - self.cpp_info.components["_fmt"].names["cmake_find_package_multi"] = target self.cpp_info.components["_fmt"].set_property("cmake_target_name", f"fmt::{target}") diff --git a/recipes/fmt/all/patches/fix-install-6.0.0.patch b/recipes/fmt/all/patches/fix-install-6.0.0.patch deleted file mode 100644 index c64f2ea628b1b..0000000000000 --- a/recipes/fmt/all/patches/fix-install-6.0.0.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -259,7 +259,9 @@ if (FMT_INSTALL) - - # Install the library and headers. - install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name} -- DESTINATION ${FMT_LIB_DIR}) -+ LIBRARY DESTINATION ${FMT_LIB_DIR} -+ ARCHIVE DESTINATION ${FMT_LIB_DIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - - install(FILES $ - DESTINATION ${FMT_LIB_DIR} OPTIONAL) diff --git a/recipes/fmt/all/patches/fix-mingw-msvc2015-export-assert-fail-6.1.0.patch b/recipes/fmt/all/patches/fix-mingw-msvc2015-export-assert-fail-6.1.0.patch deleted file mode 100644 index 4623c31cff962..0000000000000 --- a/recipes/fmt/all/patches/fix-mingw-msvc2015-export-assert-fail-6.1.0.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/include/fmt/core.h -+++ b/include/fmt/core.h -@@ -167,9 +167,9 @@ - - #if !defined(FMT_HEADER_ONLY) && defined(_WIN32) - # ifdef FMT_EXPORT --# define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllexport) -+# define FMT_API __declspec(dllexport) - # elif defined(FMT_SHARED) --# define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllimport) -+# define FMT_API __declspec(dllimport) - # define FMT_EXTERN_TEMPLATE_API FMT_API - # endif - #endif -@@ -224,7 +224,7 @@ namespace internal { - // A workaround for gcc 4.8 to make void_t work in a SFINAE context. - template struct void_t_impl { using type = void; }; - --void assert_fail(const char* file, int line, const char* message); -+FMT_API void assert_fail(const char* file, int line, const char* message); - - #ifndef FMT_ASSERT - # ifdef NDEBUG diff --git a/recipes/fmt/all/test_package/test_package.cpp b/recipes/fmt/all/test_package/test_package.cpp index 736bcb6a40958..c8074af5f8eff 100644 --- a/recipes/fmt/all/test_package/test_package.cpp +++ b/recipes/fmt/all/test_package/test_package.cpp @@ -40,7 +40,6 @@ namespace fmt { int main() { const std::string thing("World"); fmt::print("PRINT: Hello {}!\n", thing); - fmt::printf("PRINTF: Hello, %s!\n", thing); const std::string formatted = fmt::format("{0}{1}{0}", "abra", "cad"); fmt::print("{}\n", formatted); diff --git a/recipes/fmt/all/test_v1_package/CMakeLists.txt b/recipes/fmt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/fmt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/fmt/all/test_v1_package/conanfile.py b/recipes/fmt/all/test_v1_package/conanfile.py deleted file mode 100644 index f99cfc80791d2..0000000000000 --- a/recipes/fmt/all/test_v1_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.definitions["FMT_HEADER_ONLY"] = self.options["fmt"].header_only - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) - self.run(os.path.join("bin", "test_ranges"), run_environment=True) diff --git a/recipes/fmt/config.yml b/recipes/fmt/config.yml index 74db66d3ff403..4ab7da716b0f9 100644 --- a/recipes/fmt/config.yml +++ b/recipes/fmt/config.yml @@ -1,4 +1,22 @@ versions: + "11.2.0": + folder: all + "11.1.4": + folder: all + "11.1.3": + folder: all + "11.1.1": + folder: all + "11.0.2": + folder: all + "11.0.1": + folder: all + "11.0.0": + folder: all + "10.2.1": + folder: all + "10.2.0": + folder: all "10.1.1": folder: all "10.1.0": diff --git a/recipes/fmtlog/all/conanfile.py b/recipes/fmtlog/all/conanfile.py index 759d3b12c6861..9bc3a7f6a4839 100644 --- a/recipes/fmtlog/all/conanfile.py +++ b/recipes/fmtlog/all/conanfile.py @@ -67,7 +67,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/10.1.0", transitive_headers=True, transitive_libs=True) + self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) def package_id(self): if self.info.options.header_only: diff --git a/recipes/fmtlog/all/test_package/CMakeLists.txt b/recipes/fmtlog/all/test_package/CMakeLists.txt index 42a1ef5c3a35e..27404ba41bb28 100644 --- a/recipes/fmtlog/all/test_package/CMakeLists.txt +++ b/recipes/fmtlog/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) diff --git a/recipes/fmtlog/all/test_v1_package/CMakeLists.txt b/recipes/fmtlog/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 885bdb9ba0ee8..0000000000000 --- a/recipes/fmtlog/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(fmtlog REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE fmtlog::fmtlog) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/fmtlog/all/test_v1_package/conanfile.py b/recipes/fmtlog/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/fmtlog/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/folly/all/CMakeLists.txt b/recipes/folly/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- a/recipes/folly/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/folly/all/conan_deps.cmake b/recipes/folly/all/conan_deps.cmake new file mode 100644 index 0000000000000..075e362b62636 --- /dev/null +++ b/recipes/folly/all/conan_deps.cmake @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.17) +# Set the dependency flags expected by https://github.com/facebook/folly/blob/v2023.12.18.00/CMake/folly-deps.cmake + +macro(custom_find_package package_name variable_prefix) + find_package(${package_name} REQUIRED CONFIG ${ARGN}) + list(APPEND FROM FOUND VERSION VERSION_STRING INCLUDE_DIRS INCLUDE_DIR INCLUDE_DIR LIBRARIES LIBRARIES LIBRARIES DEFINITIONS) + list(APPEND TO FOUND VERSION VERSION_STRING INCLUDE_DIRS INCLUDE_DIR INCLUDE LIB LIBRARY LIBRARIES DEFINITIONS) + + foreach (from_substr to_substr IN ZIP_LISTS FROM TO) + set(src_var ${package_name}_${from_substr}) + set(dst_var ${variable_prefix}_${to_substr}) + if (NOT DEFINED ${src_var}) + continue() + endif() + if ((DEFINED ${dst_var}) AND ("${${dst_var}}" STREQUAL "${${src_var}}")) + # if they're equal, skip + continue() + endif() + message(DEBUG "custom_find_package definining ${dst_var} with ${src_var} contents: ${${src_var}}") + set(${dst_var} ${${src_var}}) + endforeach() +endmacro() + +custom_find_package(BZip2 BZIP2) +custom_find_package(DoubleConversion DOUBLE_CONVERSION REQUIRED) +custom_find_package(Gflags LIBGFLAGS) +custom_find_package(Glog GLOG) +custom_find_package(LZ4 LZ4) +custom_find_package(LibEvent LIBEVENT REQUIRED) +custom_find_package(LibLZMA LIBLZMA) +custom_find_package(Libsodium LIBSODIUM) +custom_find_package(OpenSSL OPENSSL REQUIRED) +custom_find_package(Snappy SNAPPY) +custom_find_package(ZLIB ZLIB) +custom_find_package(Zstd ZSTD) +custom_find_package(fmt FMT REQUIRED) + +if (NOT MSVC) + custom_find_package(LibDwarf LIBDWARF) +endif() +if (UNIX AND NOT APPLE) + custom_find_package(LibUring LIBURING) + custom_find_package(LibUnwind LIBUNWIND) + custom_find_package(Libiberty LIBIBERTY) +endif() \ No newline at end of file diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 8fcc8945ab40d..a21030554ee04 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -1,56 +1,4 @@ sources: - "2019.10.21.00": - url: "https://github.com/facebook/folly/archive/v2019.10.21.00.tar.gz" - sha256: "6efcc2b2090691a9fe3d339c433d102d6399bbdc6dc4893080d59f15f648f393" - "2020.08.10.00": - url: "https://github.com/facebook/folly/archive/v2020.08.10.00.tar.gz" - sha256: "e81140d04a4e89e3f848e528466a9b3d3ae37d7eeb9e65467fca50d70918eef6" - "2022.01.31.00": - url: "https://github.com/facebook/folly/archive/v2022.01.31.00.tar.gz" - sha256: "d764b9a7832d967bb7cfea4bcda15d650315aa4d559fde1da2a52b015cd88b9c" -patches: - "2019.10.21.00": - - patch_file: "patches/0001-find-packages.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-compiler-flags.patch" - base_path: "source_subfolder" - - patch_file: "patches/0003-boost-shared-ptr.patch" - base_path: "source_subfolder" - - patch_file: "patches/0004-disable-posix-names.patch" - base_path: "source_subfolder" - - patch_file: "patches/0005-include-atomic.patch" - base_path: "source_subfolder" - - patch_file: "patches/0006-duplicate-hash.patch" - base_path: "source_subfolder" - - patch_file: "patches/0007-allow-builtins.patch" - base_path: "source_subfolder" - - patch_file: "patches/0013-include-bit.patch" - base_path: "source_subfolder" - - patch_file: "patches/0020-include-ssizet.patch" - base_path: "source_subfolder" - "2020.08.10.00": - - patch_file: "patches/0008-find-packages.patch" - base_path: "source_subfolder" - - patch_file: "patches/0009-ill-formed-atomic-copy.patch" - base_path: "source_subfolder" - - patch_file: "patches/0010-duplicate-hash.patch" - base_path: "source_subfolder" - - patch_file: "patches/0011-disable-logger-example.patch" - base_path: "source_subfolder" - - patch_file: "patches/0012-compiler-flags.patch" - base_path: "source_subfolder" - - patch_file: "patches/0014-find-librt.patch" - base_path: "source_subfolder" - - patch_file: "patches/0015-benchmark-format-macros.patch" - base_path: "source_subfolder" - "2022.01.31.00": - - patch_file: "patches/0016-find-packages.patch" - base_path: "source_subfolder" - - patch_file: "patches/0017-compiler-flags.patch" - base_path: "source_subfolder" - - patch_file: "patches/0018-find-glog.patch" - base_path: "source_subfolder" - - patch_file: "patches/0019-exclude-example.patch" - base_path: "source_subfolder" - - patch_file: "patches/0022-fix-windows-minmax.patch" - base_path: "source_subfolder" + "2024.08.12.00": + url: "https://github.com/facebook/folly/releases/download/v2024.08.12.00/folly-v2024.08.12.00.tar.gz" + sha256: "18d7be721721db547cb9c5dd5cc50df05cd88b0a8e683e3126ec6f9ce2c41c4d" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 06dc6965155a7..8e3f12f1c173b 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -1,14 +1,16 @@ -from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conan.tools.build import can_run -from conan.tools.scm import Version -from conan.tools import files from conan import ConanFile -from conans import CMake, tools -from conan.errors import ConanInvalidConfiguration -import functools +from conan.errors import ConanInvalidConfiguration, ConanException +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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os -required_conan_version = ">=1.45.0" + +required_conan_version = ">=2.1" class FollyConan(ConanFile): @@ -19,278 +21,258 @@ class FollyConan(ConanFile): homepage = "https://github.com/facebook/folly" license = "Apache-2.0" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "use_sse4_2" : [True, False], } default_options = { "shared": False, "fPIC": True, - "use_sse4_2" : False } - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _minimum_cpp_standard(self): - return 17 if Version(self.version) >= "2022.01.31.00" else 14 + def _min_cppstd(self): + return 17 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): + # https://github.com/facebook/folly/blob/v2024.07.08.00/folly/Portability.h return { - "Visual Studio": "15", - "gcc": "5", - "clang": "6", - "apple-clang": "8", - } if self._minimum_cpp_standard == 14 else { - "gcc": "7", + "gcc": "10", + "clang": "10", + "apple-clang": "14", + "msvc": "192", "Visual Studio": "16", - "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"]) - + copy(self, "conan_deps.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 - if str(self.settings.arch) not in ['x86', 'x86_64']: - del self.options.use_sse4_2 - def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + if is_msvc(self): + # Folly does not support shared library on Windows: https://github.com/facebook/folly/issues/962 + self.package_type = "static-library" + del self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.78.0") + self.requires("boost/1.85.0", transitive_headers=True, transitive_libs=True) self.requires("bzip2/1.0.8") - self.requires("double-conversion/3.2.0") + self.requires("double-conversion/3.3.0", transitive_headers=True, transitive_libs=True) self.requires("gflags/2.2.2") - self.requires("glog/0.4.0") - self.requires("libevent/2.1.12") - self.requires("openssl/1.1.1q") - self.requires("lz4/1.9.3") - self.requires("snappy/1.1.9") - self.requires("zlib/1.2.12") - self.requires("zstd/1.5.2") + self.requires("glog/0.7.1", transitive_headers=True, transitive_libs=True) + self.requires("libevent/2.1.12", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]") + self.requires("lz4/1.10.0", transitive_libs=True) + self.requires("snappy/1.2.1") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("zstd/1.5.5", transitive_libs=True) if not is_msvc(self): - self.requires("libdwarf/20191104") - self.requires("libsodium/1.0.18") - self.requires("xz_utils/5.2.5") - # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") - if self.settings.os == "Linux": + self.requires("libdwarf/0.9.1") + self.requires("libsodium/1.0.20") + self.requires("xz_utils/[>=5.4.5 <6]") + if self.settings.os in ["Linux", "FreeBSD"]: self.requires("libiberty/9.1.0") - self.requires("libunwind/1.5.0") - if Version(self.version) >= "2020.08.10.00": - self.requires("fmt/7.1.3") + self.requires("libunwind/1.8.0") + if self.settings.os == "Linux": + self.requires("liburing/2.6") + # INFO: Folly does not support fmt 11 on MSVC: https://github.com/facebook/folly/issues/2250 + self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) + + def build_requirements(self): + # INFO: Required due ZIP_LISTS CMake feature in conan_deps.cmake + self.tool_requires("cmake/[>=3.17 <4]") @property def _required_boost_components(self): return ["context", "filesystem", "program_options", "regex", "system", "thread"] + @property + def _required_boost_conan_components(self): + return [f"boost::{comp}" for comp in self._required_boost_components] + + @property + def _required_boost_cmake_targets(self): + return [f"Boost::{comp}" for comp in self._required_boost_components] + 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)) - else: - 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)) - - if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": - raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") - - if self.settings.os == "Macos" and self.settings.arch != "x86_64": - raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") + 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 == "Windows" and self.settings.arch != "x86_64": - raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") + raise ConanInvalidConfiguration(f"{self.ref} Folly requires a 64bit target architecture on Windows.") - if self.settings.os in ["Macos", "Windows"] and self.options.shared: - raise ConanInvalidConfiguration("Folly could not be built on {} as shared library".format(self.settings.os)) + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14.0": + # https://github.com/facebook/folly/issues/2266 + raise ConanInvalidConfiguration(f"{self.ref} could not be built by apple-clang < 14.0. Use apple-clang >= 14.0") - if Version(self.version) == "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: - raise ConanInvalidConfiguration("Folly could not be built by clang as a shared library") + boost = self.dependencies["boost"] + if boost.options.header_only: + raise ConanInvalidConfiguration(f"{self.ref} could not be built with a header only Boost. Use -o 'boost/*:header_only=False'") - if self.options["boost"].header_only: - raise ConanInvalidConfiguration("Folly could not be built with a header only Boost") - - miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components) + miss_boost_required_comp = any(getattr(boost.options, f"without_{boost_comp}", True) for boost_comp in self._required_boost_components) if miss_boost_required_comp: - raise ConanInvalidConfiguration("Folly requires these boost components: {}".format(", ".join(self._required_boost_components))) - - 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 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.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: - raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") - - # FIXME: Freeze max. CMake version at 3.16.2 to fix the Linux build - def build_requirements(self): - self.build_requires("cmake/3.16.9") + required_components = ", ".join(self._required_boost_components) + raise ConanInvalidConfiguration(f"{self.ref} requires these Boost components: {required_components}. Try with '-o boost/*:without_{required_components}=False'") 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=False) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_folly_INCLUDE"] = "conan_deps.cmake" + # Folly fails to check Gflags: https://github.com/conan-io/conan/issues/12012 + tc.variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + + if is_apple_os(self) and cross_building(self): + # INFO: Folly fails to configure Mac M1 -> Mac Intel: + # CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately: HAVE_VSNPRINTF_ERRORS_EXITCODE (advanced) + for var in ["FOLLY_HAVE_UNALIGNED_ACCESS", "FOLLY_HAVE_LINUX_VDSO", "FOLLY_HAVE_WCHAR_SUPPORT", "HAVE_VSNPRINTF_ERRORS"]: + tc.cache_variables[f"{var}_EXITCODE"] = 0 + + # Folly is not respecting this from the helper https://github.com/conan-io/conan-center-index/pull/15726/files#r1097068754 + tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + # Relocatable shared lib on Macos + if is_apple_os(self): + 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" + # Honor Boost_ROOT set by boost recipe + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0074"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2024.08.12.00": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") + + + # 2019.10.21.00 -> either MSVC_ flags or CXX_STD + if is_msvc(self): + cxx_std_value = "c++latest" if str(self.settings.compiler.cppstd) > "17" else f"c++{str(self.settings.compiler.cppstd)}" + tc.cache_variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value + tc.cache_variables["MSVC_ENABLE_ALL_WARNINGS"] = False + tc.cache_variables["MSVC_USE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.preprocessor_definitions["NOMINMAX"] = "" + + if not self.dependencies["boost"].options.header_only: + tc.cache_variables["BOOST_LINK_STATIC"] = not self.dependencies["boost"].options.shared + + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0074"] = "NEW" # Honor Boost_ROOT set by boost recipe + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("boost", "cmake_file_name", "Boost") + deps.set_property("bzip2", "cmake_file_name", "BZip2") + deps.set_property("double-conversion", "cmake_file_name", "DoubleConversion") + deps.set_property("fmt", "cmake_file_name", "fmt") + deps.set_property("gflags", "cmake_file_name", "Gflags") + deps.set_property("glog", "cmake_file_name", "Glog") + deps.set_property("libdwarf", "cmake_file_name", "LibDwarf") + deps.set_property("libevent", "cmake_file_name", "LibEvent") + deps.set_property("libiberty", "cmake_file_name", "Libiberty") + deps.set_property("libsodium", "cmake_file_name", "Libsodium") + deps.set_property("libunwind", "cmake_file_name", "LibUnwind") + deps.set_property("liburing", "cmake_file_name", "LibUring") + deps.set_property("lz4", "cmake_file_name", "LZ4") + deps.set_property("openssl", "cmake_file_name", "OpenSSL") + deps.set_property("snappy", "cmake_file_name", "Snappy") + deps.set_property("xz_utils", "cmake_file_name", "LibLZMA") + deps.set_property("zlib", "cmake_file_name", "ZLIB") + deps.set_property("zstd", "cmake_file_name", "Zstd") + deps.generate() + + def _patch_sources(self): + # Make sure will consume Conan dependencies + folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") + replace_in_file(self, folly_deps, " MODULE", " REQUIRED CONFIG") + replace_in_file(self, folly_deps, "${Boost_LIBRARIES}", f"{' '.join(self._required_boost_cmake_targets)}") + replace_in_file(self, folly_deps, "OpenSSL 1.1.1", "OpenSSL") + # Disable example + save(self, os.path.join(self.source_folder, "folly", "logging", "example", "CMakeLists.txt"), "") + # Disable custom find modules to use Conan CMakeDeps instead + rm(self, "Find*.cmake", os.path.join(self.source_folder, "CMake")) + rm(self, "Find*.cmake", os.path.join(self.source_folder, "build", "fbcode_builder", "CMake")) + # Skip generating .pc file to avoid Windows errors when trying to compile with pkg-config + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "gen_pkgconfig_vars(FOLLY_PKGCONFIG folly_deps)", "") - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): + self._patch_sources() cmake = CMake(self) - if can_run(self): - cmake.definitions["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE"] = "0" - cmake.definitions["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE__TRYRUN_OUTPUT"] = "" - cmake.definitions["FOLLY_HAVE_LINUX_VDSO_EXITCODE"] = "0" - cmake.definitions["FOLLY_HAVE_LINUX_VDSO_EXITCODE__TRYRUN_OUTPUT"] = "" - cmake.definitions["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE"] = "0" - cmake.definitions["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE__TRYRUN_OUTPUT"] = "" - cmake.definitions["HAVE_VSNPRINTF_ERRORS_EXITCODE"] = "0" - cmake.definitions["HAVE_VSNPRINTF_ERRORS_EXITCODE__TRYRUN_OUTPUT"] = "" - - if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ['x86', 'x86_64']: - # in folly, if simd >=sse4.2, we also needs -mfma flag to avoid compiling error. - if not is_msvc(self): - cmake.definitions["CMAKE_C_FLAGS"] = "-mfma" - cmake.definitions["CMAKE_CXX_FLAGS"] = "-mfma" - else: - cmake.definitions["CMAKE_C_FLAGS"] = "/arch:FMA" - cmake.definitions["CMAKE_CXX_FLAGS"] = "/arch:FMA" - - cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - - cxx_std_flag = tools.cppstd_flag(self.settings) - cxx_std_value = cxx_std_flag.split('=')[1] if cxx_std_flag else "c++{}".format(self._minimum_cpp_standard) - cmake.definitions["CXX_STD"] = cxx_std_value - if is_msvc: - cmake.definitions["MSVC_LANGUAGE_VERSION"] = cxx_std_value - cmake.definitions["MSVC_ENABLE_ALL_WARNINGS"] = False - cmake.definitions["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) 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(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() - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - files.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, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "folly") - self.cpp_info.set_property("cmake_target_name", "Folly::folly") + self.cpp_info.set_property("cmake_target_name", "folly::folly") self.cpp_info.set_property("pkg_config_name", "libfolly") - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - if Version(self.version) == "2019.10.21.00": - self.cpp_info.components["libfolly"].libs = [ - "follybenchmark", - "folly_test_util", - "folly" - ] - elif Version(self.version) >= "2020.08.10.00": - if self.settings.os == "Linux": - self.cpp_info.components["libfolly"].libs = [ - "folly_exception_counter", - "folly_exception_tracer", - "folly_exception_tracer_base", - "folly_test_util", - "follybenchmark", - "folly" - ] - else: - self.cpp_info.components["libfolly"].libs = [ - "folly_test_util", - "follybenchmark", - "folly" - ] - - self.cpp_info.components["libfolly"].requires = [ - "boost::boost", - "bzip2::bzip2", + self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly") + self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly") + self.cpp_info.components["libfolly"].libs = ["folly"] + self.cpp_info.components["libfolly"].requires = ["fmt::fmt"] + self._required_boost_conan_components + [ "double-conversion::double-conversion", "gflags::gflags", "glog::glog", "libevent::libevent", "lz4::lz4", "openssl::openssl", + "bzip2::bzip2", "snappy::snappy", "zlib::zlib", "zstd::zstd", "libsodium::libsodium", - "xz_utils::xz_utils" + "xz_utils::xz_utils", ] if not is_msvc(self): self.cpp_info.components["libfolly"].requires.append("libdwarf::libdwarf") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libfolly"].requires.extend(["libiberty::libiberty", "libunwind::libunwind"]) + if self.settings.os == "Linux": + self.cpp_info.components["libfolly"].requires.append("liburing::liburing") self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl", "rt"]) - - if Version(self.version) >= "2020.08.10.00": - self.cpp_info.components["libfolly"].requires.append("fmt::fmt") - if self.settings.os == "Linux": - self.cpp_info.components["libfolly"].defines.extend(["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"]) - + self.cpp_info.components["libfolly"].defines.extend(["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"]) elif self.settings.os == "Windows": self.cpp_info.components["libfolly"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) - if (self.settings.os == "Linux" and self.settings.compiler == "clang" and - self.settings.compiler.libcxx == "libstdc++") or \ - (self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and - Version(self.settings.compiler.version.value) == "9.0" and self.settings.compiler.libcxx == "libc++"): + if self.settings.get_safe("compiler.libcxx") == "libstdc++" or \ + (self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) == "9.0" and \ + self.settings.get_safe("compiler.libcxx") == "libc++"): self.cpp_info.components["libfolly"].system_libs.append("atomic") - if self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": self.cpp_info.components["libfolly"].system_libs.append("c++abi") - if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ['x86', 'x86_64']: - self.cpp_info.components["libfolly"].defines = ["FOLLY_SSE=4", "FOLLY_SSE_MINOR=2"] - - # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed - self.cpp_info.filenames["cmake_find_package"] = "folly" - self.cpp_info.filenames["cmake_find_package_multi"] = "folly" - self.cpp_info.names["cmake_find_package"] = "Folly" - self.cpp_info.names["cmake_find_package_multi"] = "Folly" - self.cpp_info.names["pkg_config"] = "libfolly" - self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly" - self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly" - self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly") - self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly") - - if Version(self.version) >= "2019.10.21.00": - self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark") - self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark") - self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"] - self.cpp_info.components["follybenchmark"].requires = ["libfolly"] + self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark") + self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark") + self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"] + self.cpp_info.components["follybenchmark"].requires = ["libfolly"] - self.cpp_info.components["folly_test_util"].set_property("cmake_target_name", "Folly::folly_test_util") - self.cpp_info.components["folly_test_util"].set_property("pkg_config_name", "libfolly_test_util") - self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"] - self.cpp_info.components["folly_test_util"].requires = ["libfolly"] + self.cpp_info.components["folly_test_util"].set_property("cmake_target_name", "Folly::folly_test_util") + self.cpp_info.components["folly_test_util"].set_property("pkg_config_name", "libfolly_test_util") + self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"] + self.cpp_info.components["folly_test_util"].requires = ["libfolly"] - if Version(self.version) >= "2020.08.10.00" and self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["folly_exception_tracer_base"].set_property("cmake_target_name", "Folly::folly_exception_tracer_base") self.cpp_info.components["folly_exception_tracer_base"].set_property("pkg_config_name", "libfolly_exception_tracer_base") self.cpp_info.components["folly_exception_tracer_base"].libs = ["folly_exception_tracer_base"] diff --git a/recipes/folly/all/patches/0001-find-packages.patch b/recipes/folly/all/patches/0001-find-packages.patch deleted file mode 100644 index 4cee77cd34c1c..0000000000000 --- a/recipes/folly/all/patches/0001-find-packages.patch +++ /dev/null @@ -1,93 +0,0 @@ -diff --git a/CMake/FindLibsodium.cmake b/CMake/FindLibsodium.cmake -index 18d4d0c..2b3cd2a 100644 ---- a/CMake/FindLibsodium.cmake -+++ b/CMake/FindLibsodium.cmake -@@ -15,7 +15,7 @@ - find_path(LIBSODIUM_INCLUDE_DIR NAMES sodium.h) - mark_as_advanced(LIBSODIUM_INCLUDE_DIR) - --find_library(LIBSODIUM_LIBRARY NAMES sodium) -+find_library(LIBSODIUM_LIBRARY NAMES sodium libsodium PATHS ${CONAN_LIBSODIUM_ROOT}) - mark_as_advanced(LIBSODIUM_LIBRARY) - - include(FindPackageHandleStandardArgs) -diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 048e1cd..da3ab8e 100644 ---- a/CMake/folly-deps.cmake -+++ b/CMake/folly-deps.cmake -@@ -36,19 +36,19 @@ find_package(DoubleConversion MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) - --find_package(Gflags MODULE) --set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) --list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBGFLAGS_LIBRARY}) --list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) -- --find_package(Glog MODULE) -+find_package(gflags MODULE REQUIRED) -+set(FOLLY_HAVE_LIBGFLAGS ${GFLAGS_FOUND}) -+list(APPEND FOLLY_LINK_LIBRARIES ${CONAN_LIBS_GFLAGS}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${CONAN_INCLUDE_DIRS_GFLAGS}) -+list(APPEND CMAKE_REQUIRED_LIBRARIES ${gflags_LIBRARY}) -+list(APPEND CMAKE_REQUIRED_INCLUDES ${gflags_INCLUDE_DIR}) -+ -+find_package(glog MODULE) - set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) - list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) - --find_package(LibEvent MODULE REQUIRED) -+find_package(Libevent MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) - -diff --git a/build/fbcode_builder/CMake/FindGflags.cmake b/build/fbcode_builder/CMake/FindGflags.cmake -index 246ceac..385605e 100644 ---- a/build/fbcode_builder/CMake/FindGflags.cmake -+++ b/build/fbcode_builder/CMake/FindGflags.cmake -@@ -48,8 +48,13 @@ if (gflags_FOUND) - else() - FIND_PATH(LIBGFLAGS_INCLUDE_DIR gflags/gflags.h) - -- FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflagsd gflags_staticd) -- FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags gflags_static) -+ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") -+ FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflagsd gflags_nothreads_staticd gflags_nothreads_static_debug PATHS ${CONAN_GFLAGS_ROOT}) -+ FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags gflags_nothreads_static PATHS ${CONAN_GFLAGS_ROOT}) -+ else() -+ FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflags gflags_nothreads_debug PATHS ${CONAN_GFLAGS_ROOT}) -+ FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags_nothreads gflags PATHS ${CONAN_GFLAGS_ROOT}) -+ endif() - - INCLUDE(SelectLibraryConfigurations) - SELECT_LIBRARY_CONFIGURATIONS(LIBGFLAGS) -diff --git a/build/fbcode_builder/CMake/FindGlog.cmake b/build/fbcode_builder/CMake/FindGlog.cmake -index a589b2e..15aef75 100644 ---- a/build/fbcode_builder/CMake/FindGlog.cmake -+++ b/build/fbcode_builder/CMake/FindGlog.cmake -@@ -8,8 +8,7 @@ - - include(FindPackageHandleStandardArgs) - --find_library(GLOG_LIBRARY glog -- PATHS ${GLOG_LIBRARYDIR}) -+find_library(GLOG_LIBRARY glog glogd PATHS ${CONAN_GLOG_ROOT}) - - find_path(GLOG_INCLUDE_DIR glog/logging.h - PATHS ${GLOG_INCLUDEDIR}) -diff --git a/build/fbcode_builder/CMake/FindLibEvent.cmake b/build/fbcode_builder/CMake/FindLibEvent.cmake -index dd11ebd..9ef0807 100644 ---- a/build/fbcode_builder/CMake/FindLibEvent.cmake -+++ b/build/fbcode_builder/CMake/FindLibEvent.cmake -@@ -50,7 +50,7 @@ if (TARGET event) - endif() - else() - find_path(LIBEVENT_INCLUDE_DIR event.h PATHS ${LibEvent_INCLUDE_PATHS}) -- find_library(LIBEVENT_LIB NAMES event PATHS ${LibEvent_LIB_PATHS}) -+ find_library(LIBEVENT_LIB NAMES event libevent PATHS ${CONAN_LIBEVENT_ROOT}) - - if (LIBEVENT_LIB AND LIBEVENT_INCLUDE_DIR) - set(LibEvent_FOUND TRUE) diff --git a/recipes/folly/all/patches/0002-compiler-flags.patch b/recipes/folly/all/patches/0002-compiler-flags.patch deleted file mode 100644 index b9213ff6d4895..0000000000000 --- a/recipes/folly/all/patches/0002-compiler-flags.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake -index 7fba75f..019d30f 100644 ---- a/CMake/FollyCompilerUnix.cmake -+++ b/CMake/FollyCompilerUnix.cmake -@@ -28,9 +28,9 @@ set( - ) - mark_as_advanced(CXX_STD) - --set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra") -+set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}") --set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") -+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}") - - # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") -@@ -44,7 +44,6 @@ function(apply_folly_compile_options_to_target THETARGET) - ) - target_compile_options(${THETARGET} - PRIVATE -- -g - -std=${CXX_STD} - -finput-charset=UTF-8 - -fsigned-char diff --git a/recipes/folly/all/patches/0003-boost-shared-ptr.patch b/recipes/folly/all/patches/0003-boost-shared-ptr.patch deleted file mode 100644 index 7608d6b2e9e2b..0000000000000 --- a/recipes/folly/all/patches/0003-boost-shared-ptr.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/folly/portability/PThread.cpp b/folly/portability/PThread.cpp -index f8cd6d4..0908668 100644 ---- a/folly/portability/PThread.cpp -+++ b/folly/portability/PThread.cpp -@@ -18,7 +18,9 @@ - - #if !FOLLY_HAVE_PTHREAD && defined(_WIN32) - #include // @manual -- -+#include -+#include -+#include - #include - - #include -@@ -683,7 +685,7 @@ int pthread_setspecific(pthread_key_t key, const void* value) { - // function, which we don't want to do. - boost::detail::set_tss_data( - realKey, -- boost::shared_ptr(), -+ 0,0, - const_cast(value), - false); - return 0; diff --git a/recipes/folly/all/patches/0004-disable-posix-names.patch b/recipes/folly/all/patches/0004-disable-posix-names.patch deleted file mode 100644 index 9efd4e24140e1..0000000000000 --- a/recipes/folly/all/patches/0004-disable-posix-names.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/folly/portability/Windows.h b/folly/portability/Windows.h -index f7990ca..b22fac5 100644 ---- a/folly/portability/Windows.h -+++ b/folly/portability/Windows.h -@@ -26,16 +26,12 @@ - // These have to be this way because we define our own versions - // of close(), because the normal Windows versions don't handle - // sockets at all. --#ifndef __STDC__ --/* nolint */ --#define __STDC__ 1 --#include // @manual nolint --#include // @manual nolint --#undef __STDC__ --#else --#include // @manual nolint --#include // @manual nolint --#endif -+#include -+#pragma push_macro("_CRT_INTERNAL_NONSTDC_NAMES") -+#define _CRT_INTERNAL_NONSTDC_NAMES 0 -+#include -+#include -+#pragma pop_macro("_CRT_INTERNAL_NONSTDC_NAMES") - - #if defined(min) || defined(max) - #error Windows.h needs to be included by this header, or else NOMINMAX needs \ diff --git a/recipes/folly/all/patches/0005-include-atomic.patch b/recipes/folly/all/patches/0005-include-atomic.patch deleted file mode 100644 index 0eb9382e49a9d..0000000000000 --- a/recipes/folly/all/patches/0005-include-atomic.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/portability/PThread.cpp b/folly/portability/PThread.cpp -index 2891c4c..7c98975 100644 ---- a/folly/portability/PThread.cpp -+++ b/folly/portability/PThread.cpp -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #include - #include diff --git a/recipes/folly/all/patches/0006-duplicate-hash.patch b/recipes/folly/all/patches/0006-duplicate-hash.patch deleted file mode 100644 index f8905d003157e..0000000000000 --- a/recipes/folly/all/patches/0006-duplicate-hash.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/folly/hash/Hash.h b/folly/hash/Hash.h -index 33fa553..4266cf1 100644 ---- a/folly/hash/Hash.h -+++ b/folly/hash/Hash.h -@@ -730,7 +730,7 @@ struct TupleHasher<0, Ts...> { - - // Custom hash functions. - namespace std { --#if FOLLY_SUPPLY_MISSING_INT128_TRAITS -+#if 0 - template <> - struct hash<__int128> : folly::detail::integral_hasher<__int128> {}; - diff --git a/recipes/folly/all/patches/0007-allow-builtins.patch b/recipes/folly/all/patches/0007-allow-builtins.patch deleted file mode 100644 index de09722f02acc..0000000000000 --- a/recipes/folly/all/patches/0007-allow-builtins.patch +++ /dev/null @@ -1,128 +0,0 @@ -diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h -index 971cb8819..e68de4456 100644 ---- a/folly/portability/Builtins.h -+++ b/folly/portability/Builtins.h -@@ -41,7 +41,6 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { - } - } - --#if !defined(_MSC_VER) || (_MSC_VER < 1923) - FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { - unsigned long index; - return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); -@@ -93,7 +92,6 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { - return int(_BitScanForward64(&index, x) ? index : 64); - } - #endif --#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) - - FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { - unsigned long index; -@@ -119,15 +117,12 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { - return int(__popcnt(x)); - } - --#if !defined(_MSC_VER) || (_MSC_VER < 1923) - FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { - static_assert(sizeof(x) == 4, ""); - return int(__popcnt(x)); - } --#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) - #endif - --#if !defined(_MSC_VER) || (_MSC_VER < 1923) - #if defined(_M_IX86) - FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { - return int(__popcnt((unsigned int)(x >> 32))) + -@@ -138,7 +133,6 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { - return int(__popcnt64(x)); - } - #endif --#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) - - FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { - // I really hope frame is zero... --- - -diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h -index e68de4456..30caf4003 100644 ---- a/folly/portability/Builtins.h -+++ b/folly/portability/Builtins.h -@@ -16,7 +16,7 @@ - - #pragma once - --#if defined(_WIN32) && !defined(__clang__) -+#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__clang__) - #include - #include - #include --- -see https://github.com/facebook/folly/issues/1412 -diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h -index 30caf4003..e8ef97266 100644 ---- a/folly/portability/Builtins.h -+++ b/folly/portability/Builtins.h -@@ -22,6 +22,14 @@ - #include - #include - -+// MSVC had added support for __builtin_clz etc. in 16.3 (1923) but it will be -+// removed in 16.8 (1928). -+#if (_MSC_VER >= 1923) && (_MSC_VER < 1928) -+#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 1 -+#else -+#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 0 -+#endif -+ - namespace folly { - namespace portability { - namespace detail { -@@ -41,6 +49,7 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { - } - } - -+#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { - unsigned long index; - return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); -@@ -92,6 +101,7 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { - return int(_BitScanForward64(&index, x) ? index : 64); - } - #endif -+#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - - FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { - unsigned long index; -@@ -117,12 +127,15 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { - return int(__popcnt(x)); - } - -+#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { - static_assert(sizeof(x) == 4, ""); - return int(__popcnt(x)); - } -+#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - #endif - -+#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - #if defined(_M_IX86) - FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { - return int(__popcnt((unsigned int)(x >> 32))) + -@@ -133,6 +146,7 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { - return int(__popcnt64(x)); - } - #endif -+#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - - FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { - // I really hope frame is zero... -@@ -141,3 +155,5 @@ FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { - return _ReturnAddress(); - } - #endif -+ -+#undef FOLLY_DETAIL_MSC_BUILTIN_SUPPORT --- - diff --git a/recipes/folly/all/patches/0008-find-packages.patch b/recipes/folly/all/patches/0008-find-packages.patch deleted file mode 100644 index 3329a68425e3b..0000000000000 --- a/recipes/folly/all/patches/0008-find-packages.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 3169b972d52..23dc6d509b1 100644 ---- a/CMake/folly-deps.cmake -+++ b/CMake/folly-deps.cmake -@@ -46,11 +46,11 @@ find_package(Boost 1.51.0 MODULE - list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) - --find_package(DoubleConversion MODULE REQUIRED) -+find_package(double-conversion MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) - --find_package(Gflags MODULE) -+find_package(gflags MODULE) - set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) - if(LIBGFLAGS_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) -@@ -59,12 +59,12 @@ if(LIBGFLAGS_FOUND) - list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) - endif() - --find_package(Glog MODULE) -+find_package(glog MODULE) - set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) - list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) - --find_package(LibEvent MODULE REQUIRED) -+find_package(Libevent MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) - -@@ -96,14 +96,14 @@ if (LIBLZMA_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) - endif() - --find_package(LZ4 MODULE) -+find_package(lz4 MODULE) - set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) - if (LZ4_FOUND) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) - list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) - endif() - --find_package(Zstd MODULE) -+find_package(zstd MODULE) - set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) - if(ZSTD_FOUND) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) -@@ -117,11 +117,11 @@ if (SNAPPY_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) - endif() - --find_package(LibDwarf) -+find_package(libdwarf) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) - --find_package(Libiberty) -+find_package(libiberty) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) - -@@ -133,7 +133,7 @@ find_package(LibUring) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) - --find_package(Libsodium) -+find_package(libsodium) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) - diff --git a/recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch b/recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch deleted file mode 100644 index 58f95224f3873..0000000000000 --- a/recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/folly/fibers/SemaphoreBase.cpp b/folly/fibers/SemaphoreBase.cpp -index 06e9ecc7111..77e2da75c18 100644 ---- a/folly/fibers/SemaphoreBase.cpp -+++ b/folly/fibers/SemaphoreBase.cpp -@@ -170,7 +170,7 @@ namespace { - class FutureWaiter final : public fibers::Baton::Waiter { - public: - explicit FutureWaiter(int64_t tokens) -- : semaphoreWaiter(SemaphoreBase::Waiter(tokens)) { -+ : semaphoreWaiter(tokens) { - semaphoreWaiter.baton.setWaiter(*this); - } - diff --git a/recipes/folly/all/patches/0010-duplicate-hash.patch b/recipes/folly/all/patches/0010-duplicate-hash.patch deleted file mode 100644 index 69268c6acf6f6..0000000000000 --- a/recipes/folly/all/patches/0010-duplicate-hash.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/folly/hash/Hash.h b/folly/hash/Hash.h -index a8a50e8e8dc..d7a3da8e61f 100644 ---- a/folly/hash/Hash.h -+++ b/folly/hash/Hash.h -@@ -733,7 +733,7 @@ struct TupleHasher<0, Ts...> { - - // Custom hash functions. - namespace std { --#if FOLLY_SUPPLY_MISSING_INT128_TRAITS -+#if 0 - template <> - struct hash<__int128> : folly::detail::integral_hasher<__int128> {}; - diff --git a/recipes/folly/all/patches/0011-disable-logger-example.patch b/recipes/folly/all/patches/0011-disable-logger-example.patch deleted file mode 100644 index fa20905367fb1..0000000000000 --- a/recipes/folly/all/patches/0011-disable-logger-example.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/CMakeLists.txt b/folly/CMakeLists.txt -index 08de7daf20f..cdc1f03bf46 100644 ---- a/folly/CMakeLists.txt -+++ b/folly/CMakeLists.txt -@@ -27,7 +27,6 @@ install( - ) - - add_subdirectory(experimental/exception_tracer) --add_subdirectory(logging/example) - - if (PYTHON_EXTENSIONS) - # Create tree of symbolic links in structure required for successful diff --git a/recipes/folly/all/patches/0012-compiler-flags.patch b/recipes/folly/all/patches/0012-compiler-flags.patch deleted file mode 100644 index 358500a1800cd..0000000000000 --- a/recipes/folly/all/patches/0012-compiler-flags.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake -index 8dcaf141a3a..200fe8d3798 100644 ---- a/CMake/FollyCompilerUnix.cmake -+++ b/CMake/FollyCompilerUnix.cmake -@@ -28,9 +28,9 @@ set( - ) - mark_as_advanced(CXX_STD) - --set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra") -+set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}") --set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") -+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}") - - # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") -@@ -43,7 +43,6 @@ function(apply_folly_compile_options_to_target THETARGET) - ) - target_compile_options(${THETARGET} - PRIVATE -- -g - -std=${CXX_STD} - -finput-charset=UTF-8 - -fsigned-char diff --git a/recipes/folly/all/patches/0013-include-bit.patch b/recipes/folly/all/patches/0013-include-bit.patch deleted file mode 100644 index 1a8ac249a146b..0000000000000 --- a/recipes/folly/all/patches/0013-include-bit.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/folly/lang/Bits.h -+++ b/folly/lang/Bits.h -@@ -64,6 +64,10 @@ - #include - #include - -+#if __has_include() && __cpp_lib_bit_cast -+#include -+#endif -+ - namespace folly { - - #if __cpp_lib_bit_cast diff --git a/recipes/folly/all/patches/0014-find-librt.patch b/recipes/folly/all/patches/0014-find-librt.patch deleted file mode 100644 index 90a1f0f7b9ada..0000000000000 --- a/recipes/folly/all/patches/0014-find-librt.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMake/FollyConfigChecks.cmake b/CMake/FollyConfigChecks.cmake -index 6b8b308c7..908d72d51 100644 ---- a/CMake/FollyConfigChecks.cmake -+++ b/CMake/FollyConfigChecks.cmake -@@ -83,6 +83,13 @@ string(REGEX REPLACE - CMAKE_REQUIRED_FLAGS - "${CMAKE_REQUIRED_FLAGS}") - -+if (CMAKE_SYSTEM_NAME STREQUAL "Linux") -+ find_library(LIBRT rt) -+ if (LIBRT) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES "rt") -+ endif() -+endif() -+ - check_symbol_exists(pthread_atfork pthread.h FOLLY_HAVE_PTHREAD_ATFORK) - - # Unfortunately check_symbol_exists() does not work for memrchr(): diff --git a/recipes/folly/all/patches/0015-benchmark-format-macros.patch b/recipes/folly/all/patches/0015-benchmark-format-macros.patch deleted file mode 100644 index 14f8b2088a1b3..0000000000000 --- a/recipes/folly/all/patches/0015-benchmark-format-macros.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/folly/Benchmark.cpp b/folly/Benchmark.cpp -index 389ee46a1..390b7674b 100644 ---- a/folly/Benchmark.cpp -+++ b/folly/Benchmark.cpp -@@ -16,6 +16,10 @@ - - // @author Andrei Alexandrescu (andrei.alexandrescu@fb.com) - -+#ifndef __STDC_FORMAT_MACROS -+#define __STDC_FORMAT_MACROS 1 -+#endif -+ - #include - - #include diff --git a/recipes/folly/all/patches/0016-find-packages.patch b/recipes/folly/all/patches/0016-find-packages.patch deleted file mode 100644 index c6cd14fad52c9..0000000000000 --- a/recipes/folly/all/patches/0016-find-packages.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 9c9d9ea60..e78611542 100644 ---- a/CMake/folly-deps.cmake -+++ b/CMake/folly-deps.cmake -@@ -48,25 +48,25 @@ find_package(Boost 1.51.0 MODULE - list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) - --find_package(DoubleConversion MODULE REQUIRED) -+find_package(double-conversion MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) - --find_package(Gflags MODULE) --set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) --if(LIBGFLAGS_FOUND) -- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) -- set(FOLLY_LIBGFLAGS_LIBRARY ${LIBGFLAGS_LIBRARY}) -- set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR}) -+find_package(gflags MODULE) -+set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) -+if(gflags_FOUND) -+ list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIRS}) -+ set(FOLLY_LIBGFLAGS_LIBRARY ${gflags_LIBRARIES}) -+ set(FOLLY_LIBGFLAGS_INCLUDE ${gflags_INCLUDE_DIRS}) - endif() - --find_package(Glog MODULE) -+find_package(glog MODULE) - set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) - list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) - --find_package(LibEvent MODULE REQUIRED) -+find_package(Libevent MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) - -@@ -104,14 +104,14 @@ if (LIBLZMA_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) - endif() - --find_package(LZ4 MODULE) -+find_package(lz4 MODULE) - set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) - if (LZ4_FOUND) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) - list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) - endif() - --find_package(Zstd MODULE) -+find_package(zstd MODULE) - set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) - if(ZSTD_FOUND) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) -@@ -125,11 +125,11 @@ if (SNAPPY_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) - endif() - --find_package(LibDwarf) -+find_package(libdwarf) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) - --find_package(Libiberty) -+find_package(libiberty) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) - -@@ -141,7 +141,7 @@ find_package(LibUring) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) - --find_package(Libsodium) -+find_package(libsodium) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) - diff --git a/recipes/folly/all/patches/0017-compiler-flags.patch b/recipes/folly/all/patches/0017-compiler-flags.patch deleted file mode 100644 index 1290e801ba4ba..0000000000000 --- a/recipes/folly/all/patches/0017-compiler-flags.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake -index 8dcaf14..200fe8d 100644 ---- a/CMake/FollyCompilerUnix.cmake -+++ b/CMake/FollyCompilerUnix.cmake -@@ -28,9 +28,9 @@ set( - ) - mark_as_advanced(CXX_STD) - --set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra") -+set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}") --set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") -+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}") - - # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") -@@ -43,7 +43,6 @@ function(apply_folly_compile_options_to_target THETARGET) - ) - target_compile_options(${THETARGET} - PRIVATE -- -g - -std=${CXX_STD} - -finput-charset=UTF-8 - -fsigned-char diff --git a/recipes/folly/all/patches/0018-find-glog.patch b/recipes/folly/all/patches/0018-find-glog.patch deleted file mode 100644 index b2d17ad455a7b..0000000000000 --- a/recipes/folly/all/patches/0018-find-glog.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/build/fbcode_builder/CMake/FindGlog.cmake b/build/fbcode_builder/CMake/FindGlog.cmake -index 752647c..aa2fa1c 100644 ---- a/build/fbcode_builder/CMake/FindGlog.cmake -+++ b/build/fbcode_builder/CMake/FindGlog.cmake -@@ -10,9 +10,9 @@ include(FindPackageHandleStandardArgs) - include(SelectLibraryConfigurations) - - find_library(GLOG_LIBRARY_RELEASE glog -- PATHS ${GLOG_LIBRARYDIR}) -+ PATHS ${CONAN_GLOG_ROOT}) - find_library(GLOG_LIBRARY_DEBUG glogd -- PATHS ${GLOG_LIBRARYDIR}) -+ PATHS ${CONAN_GLOG_ROOT}) - - find_path(GLOG_INCLUDE_DIR glog/logging.h - PATHS ${GLOG_INCLUDEDIR}) diff --git a/recipes/folly/all/patches/0019-exclude-example.patch b/recipes/folly/all/patches/0019-exclude-example.patch deleted file mode 100644 index d2afb310ff8a0..0000000000000 --- a/recipes/folly/all/patches/0019-exclude-example.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/CMakeLists.txt b/folly/CMakeLists.txt -index 883f27c..2d2086f 100644 ---- a/folly/CMakeLists.txt -+++ b/folly/CMakeLists.txt -@@ -28,7 +28,6 @@ install( - ) - - add_subdirectory(experimental/exception_tracer) --add_subdirectory(logging/example) - - if (PYTHON_EXTENSIONS) - # Create tree of symbolic links in structure required for successful diff --git a/recipes/folly/all/patches/0020-include-ssizet.patch b/recipes/folly/all/patches/0020-include-ssizet.patch deleted file mode 100644 index 0575fecd13e84..0000000000000 --- a/recipes/folly/all/patches/0020-include-ssizet.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/executors/ExecutorWithPriority.h b/folly/executors/ExecutorWithPriority.h -index b95a6c4..18b8110 100644 ---- a/folly/executors/ExecutorWithPriority.h -+++ b/folly/executors/ExecutorWithPriority.h -@@ -18,6 +18,7 @@ - - #include - #include -+#include - - namespace folly { - diff --git a/recipes/folly/all/patches/0021-typedef-clockid.patch b/recipes/folly/all/patches/0021-typedef-clockid.patch deleted file mode 100644 index fb46c057d58ce..0000000000000 --- a/recipes/folly/all/patches/0021-typedef-clockid.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/portability/Time.h b/folly/portability/Time.h -index 994a09e5d70..e4f0d101ca9 100644 ---- a/folly/portability/Time.h -+++ b/folly/portability/Time.h -@@ -49,7 +49,6 @@ - #define CLOCK_PROCESS_CPUTIME_ID 2 - #define CLOCK_THREAD_CPUTIME_ID 3 - --typedef uint8_t clockid_t; - extern "C" int clock_gettime(clockid_t clk_id, struct timespec* ts); - extern "C" int clock_getres(clockid_t clk_id, struct timespec* ts); - #endif diff --git a/recipes/folly/all/patches/0022-fix-windows-minmax.patch b/recipes/folly/all/patches/0022-fix-windows-minmax.patch deleted file mode 100644 index 1fc69a43a83e5..0000000000000 --- a/recipes/folly/all/patches/0022-fix-windows-minmax.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMake/FollyCompilerMSVC.cmake b/CMake/FollyCompilerMSVC.cmake -index ec2ce1a1d..16deda71c 100644 ---- a/CMake/FollyCompilerMSVC.cmake -+++ b/CMake/FollyCompilerMSVC.cmake -@@ -289,6 +289,7 @@ function(apply_folly_compile_options_to_target THETARGET) - # And the extra defines: - target_compile_definitions(${THETARGET} - PUBLIC -+ NOMINMAX - _CRT_NONSTDC_NO_WARNINGS # Don't deprecate posix names of functions. - _CRT_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. - _SCL_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. diff --git a/recipes/folly/all/test_package/CMakeLists.txt b/recipes/folly/all/test_package/CMakeLists.txt index 6a9df4ea0b752..82796f7de6547 100644 --- a/recipes/folly/all/test_package/CMakeLists.txt +++ b/recipes/folly/all/test_package/CMakeLists.txt @@ -4,13 +4,5 @@ project(test_package CXX) find_package(folly REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} - Folly::folly - Folly::follybenchmark) - - -if (${FOLLY_VERSION} VERSION_LESS "2021.07.20.00") - set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) -else() - set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) -endif() +target_link_libraries(${PROJECT_NAME} PRIVATE Folly::folly) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/folly/all/test_package/conanfile.py b/recipes/folly/all/test_package/conanfile.py index 63889d5258fa5..7aa104bd186ed 100644 --- a/recipes/folly/all/test_package/conanfile.py +++ b/recipes/folly/all/test_package/conanfile.py @@ -1,21 +1,19 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout -required_conan_version = ">=1.43.0" class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) def generate(self): tc = CMakeToolchain(self) - tc.variables["FOLLY_VERSION"] = self.dependencies["folly"].ref.version tc.generate() def layout(self): @@ -28,4 +26,4 @@ def build(self): def test(self): if can_run(self): - self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") + self.run(os.path.join(self.cpp.build.bindir, "test_package"), env="conanrun") diff --git a/recipes/folly/all/test_package/test_package.cpp b/recipes/folly/all/test_package/test_package.cpp index cc522b8b0280d..247e44f76e0fd 100644 --- a/recipes/folly/all/test_package/test_package.cpp +++ b/recipes/folly/all/test_package/test_package.cpp @@ -1,29 +1,12 @@ #include #include -#include + #include -#include -#include -#include -#include -#if FOLLY_HAVE_ELF -#include -#endif +#include -static void print_uri(const folly::fbstring& value) { - const folly::Uri uri(value); - std::cout << "The authority from " << value << " is " << uri.authority() << std::endl; -} int main() { - folly::ThreadedExecutor executor; - folly::Promise promise; - folly::Future future = promise.getSemiFuture().via(&executor); - folly::Future unit = std::move(future).thenValue(print_uri); - promise.setValue("https://github.com/bincrafters"); - std::move(unit).get(); -#if FOLLY_HAVE_ELF - folly::symbolizer::ElfFile elffile; -#endif + folly::fbstring address{"127.0.0.1"}; + folly::IPAddress::validate(address); return EXIT_SUCCESS; } diff --git a/recipes/folly/all/test_v1_package/CMakeLists.txt b/recipes/folly/all/test_v1_package/CMakeLists.txt index f8cc697ab67d2..c2866c350e271 100644 --- a/recipes/folly/all/test_v1_package/CMakeLists.txt +++ b/recipes/folly/all/test_v1_package/CMakeLists.txt @@ -4,14 +4,5 @@ project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(folly CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} Folly::folly) - - -if (${FOLLY_VERSION} VERSION_LESS "2021.07.20.00") - set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) -else() - set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/folly/all/test_v1_package/conanfile.py b/recipes/folly/all/test_v1_package/conanfile.py index 8b8cfae4c1882..49a3a66ea5bad 100644 --- a/recipes/folly/all/test_v1_package/conanfile.py +++ b/recipes/folly/all/test_v1_package/conanfile.py @@ -8,11 +8,10 @@ class TestPackageConan(ConanFile): def build(self): cmake = CMake(self) - cmake.definitions["FOLLY_VERSION"] = self.deps_cpp_info["folly"].version cmake.configure() cmake.build() def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - self.run(command=bin_path, run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/folly/all/test_v1_package/test_package.cpp b/recipes/folly/all/test_v1_package/test_package.cpp deleted file mode 100644 index cc522b8b0280d..0000000000000 --- a/recipes/folly/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#if FOLLY_HAVE_ELF -#include -#endif - -static void print_uri(const folly::fbstring& value) { - const folly::Uri uri(value); - std::cout << "The authority from " << value << " is " << uri.authority() << std::endl; -} - -int main() { - folly::ThreadedExecutor executor; - folly::Promise promise; - folly::Future future = promise.getSemiFuture().via(&executor); - folly::Future unit = std::move(future).thenValue(print_uri); - promise.setValue("https://github.com/bincrafters"); - std::move(unit).get(); -#if FOLLY_HAVE_ELF - folly::symbolizer::ElfFile elffile; -#endif - return EXIT_SUCCESS; -} diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 6a14a274c3fe9..e799fbeee0433 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,7 +1,3 @@ versions: - "2019.10.21.00": - folder: all - "2020.08.10.00": - folder: all - "2022.01.31.00": - folder: all + "2024.08.12.00": + folder: all diff --git a/recipes/fontconfig/all/conandata.yml b/recipes/fontconfig/all/conandata.yml index d4f92f5455a44..6691cd7b19491 100644 --- a/recipes/fontconfig/all/conandata.yml +++ b/recipes/fontconfig/all/conandata.yml @@ -1,7 +1,16 @@ sources: - "2.13.92": - url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.92.tar.gz" - sha256: "3406a05b83a42231e3df68d02bc0a0cf47b3f2e8f11c8ede62267daf5f130016" - "2.13.91": - url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.91.tar.gz" - sha256: "19e5b1bc9d013a52063a44e1307629711f0bfef35b9aca16f9c793971e2eb1e5" + "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" + "2.13.93": + url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.93.tar.gz" + sha256: "0f302a18ee52dde0793fe38b266bf269dfe6e0c0ae140e30d72c6cca5dc08db5" +patches: + "2.13.93": + - patch_file: "patches/0001-meson-win32.patch" + patch_type: "portability" + patch_source: "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/7bfbaecf819a8b1630dfc8f56126e31f985d5fb3" + patch_description: "Windows: Fix symlink privilege error detection" diff --git a/recipes/fontconfig/all/conanfile.py b/recipes/fontconfig/all/conanfile.py index ddc997bea245a..dd6e6f661f713 100644 --- a/recipes/fontconfig/all/conanfile.py +++ b/recipes/fontconfig/all/conanfile.py @@ -1,15 +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 cross_building -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv -from conan.tools.files import copy, get, replace_in_file, rm, rmdir -from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps +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.microsoft import is_msvc +from conan.tools.meson import Meson, MesonToolchain + import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class FontconfigConan(ConanFile): @@ -29,9 +31,8 @@ class FontconfigConan(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": @@ -40,30 +41,21 @@ 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") + self.settings.rm_safe("compiler.cppstd") def layout(self): basic_layout(self, src_folder="src") def requirements(self): self.requires("freetype/2.13.2") - self.requires("expat/2.5.0") - if self.settings.os == "Linux": - self.requires("util-linux-libuuid/2.39.2") - - def validate(self): - if is_msvc(self): - raise ConanInvalidConfiguration("fontconfig does not support Visual Studio for versions < 2.13.93.") + self.requires("expat/[>=2.6.2 <3]") 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/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") + self.tool_requires("meson/1.4.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) @@ -71,62 +63,40 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if not cross_building(self): - env = VirtualRunEnv(self) - env.generate(scope="build") - - tc = AutotoolsToolchain(self) - yes_no = lambda v: "yes" if v else "no" - tc.configure_args.extend([ - f"--enable-shared={yes_no(self.options.shared)}", - f"--enable-static={yes_no(not self.options.shared)}", - "--disable-docs", - "--disable-nls", - "--sysconfdir=${prefix}/bin/etc", - "--datadir=${prefix}/bin/share", - "--datarootdir=${prefix}/bin/share", - "--localstatedir=${prefix}/bin/var", - ]) - tc.generate() - deps = AutotoolsDeps(self) - deps.generate() deps = PkgConfigDeps(self) deps.generate() + tc = MesonToolchain(self) + tc.project_options.update({ + "doc": "disabled", + "nls": "disabled", + "tests": "disabled", + "tools": "disabled", + "sysconfdir": os.path.join("res", "etc"), + "datadir": os.path.join("res", "share"), + }) + tc.generate() + def _patch_files(self): - # fontconfig requires libtool version number, change it for the corresponding freetype one - replace_in_file( - self, os.path.join(self.generators_folder, "freetype2.pc"), - "Version: {}".format(self.dependencies["freetype"].ref.version), - "Version: {}".format(self.dependencies["freetype"].conf_info.get("user.freetype:libtool_version")), - ) - # disable fc-cache test to enable cross compilation but also builds with shared libraries on MacOS - replace_in_file(self, - os.path.join(self.source_folder, "Makefile.in"), - "@CROSS_COMPILING_TRUE@RUN_FC_CACHE_TEST = false", - "RUN_FC_CACHE_TEST=false" - ) + apply_conandata_patches(self) def build(self): self._patch_files() - autotools = Autotools(self) - autotools.configure() - replace_in_file(self, os.path.join(self.build_folder, "Makefile"), "po-conf test", "po-conf") - autotools.make() + 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")) - autotools = Autotools(self) - autotools.install() - rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - rm(self, "*.conf", os.path.join(self.package_folder, "bin", "etc", "fonts", "conf.d")) + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rm(self, "*.pdb", self.package_folder, recursive=True) + rm(self, "*.conf", os.path.join(self.package_folder, "res", "etc", "fonts", "conf.d")) rm(self, "*.def", os.path.join(self.package_folder, "lib")) - 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, "etc")) - 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("cmake_find_mode", "both") @@ -137,14 +107,26 @@ def package_info(self): if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs.extend(["m", "pthread"]) - fontconfig_file = os.path.join(self.package_folder, "bin", "etc", "fonts", "fonts.conf") - self.runenv_info.prepend_path("FONTCONFIG_FILE", fontconfig_file) - - fontconfig_path = os.path.join(self.package_folder, "bin", "etc", "fonts") - self.runenv_info.prepend_path("FONTCONFIG_PATH", fontconfig_path) + fontconfig_path = os.path.join(self.package_folder, "res", "etc", "fonts") + self.runenv_info.append_path("FONTCONFIG_PATH", fontconfig_path) # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "Fontconfig" self.cpp_info.names["cmake_find_package_multi"] = "Fontconfig" - self.env_info.FONTCONFIG_FILE = fontconfig_file self.env_info.FONTCONFIG_PATH = fontconfig_path + +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/fontconfig/meson/patches/0001-meson-win32.patch b/recipes/fontconfig/all/patches/0001-meson-win32.patch similarity index 100% rename from recipes/fontconfig/meson/patches/0001-meson-win32.patch rename to recipes/fontconfig/all/patches/0001-meson-win32.patch diff --git a/recipes/fontconfig/all/test_package/CMakeLists.txt b/recipes/fontconfig/all/test_package/CMakeLists.txt index 5def13d67bcff..7f5fafe583462 100644 --- a/recipes/fontconfig/all/test_package/CMakeLists.txt +++ b/recipes/fontconfig/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) find_package(Fontconfig REQUIRED) diff --git a/recipes/fontconfig/all/test_package/conanfile.py b/recipes/fontconfig/all/test_package/conanfile.py index 98ab55852ad56..42aa9d19c7fbe 100644 --- a/recipes/fontconfig/all/test_package/conanfile.py +++ b/recipes/fontconfig/all/test_package/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile -from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run import os diff --git a/recipes/fontconfig/all/test_v1_package/CMakeLists.txt b/recipes/fontconfig/all/test_v1_package/CMakeLists.txt index 0d20897301b68..9e65290cb3f89 100644 --- a/recipes/fontconfig/all/test_v1_package/CMakeLists.txt +++ b/recipes/fontconfig/all/test_v1_package/CMakeLists.txt @@ -1,8 +1,9 @@ cmake_minimum_required(VERSION 3.1) -project(test_package) +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) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/ +) diff --git a/recipes/fontconfig/config.yml b/recipes/fontconfig/config.yml index a3042d0ed624f..1d4c62bc9edab 100644 --- a/recipes/fontconfig/config.yml +++ b/recipes/fontconfig/config.yml @@ -1,9 +1,7 @@ versions: + "2.15.0": + folder: all "2.14.2": - folder: meson - "2.13.93": - folder: meson - "2.13.92": folder: all - "2.13.91": + "2.13.93": folder: all diff --git a/recipes/fontconfig/meson/conandata.yml b/recipes/fontconfig/meson/conandata.yml deleted file mode 100644 index e2b11bfd27f49..0000000000000 --- a/recipes/fontconfig/meson/conandata.yml +++ /dev/null @@ -1,13 +0,0 @@ -sources: - "2.14.2": - url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.14.2.tar.xz" - sha256: "dba695b57bce15023d2ceedef82062c2b925e51f5d4cc4aef736cf13f60a468b" - "2.13.93": - url: "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.93.tar.gz" - sha256: "0f302a18ee52dde0793fe38b266bf269dfe6e0c0ae140e30d72c6cca5dc08db5" -patches: - "2.13.93": - - patch_file: "patches/0001-meson-win32.patch" - patch_type: "portability" - patch_source: "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/7bfbaecf819a8b1630dfc8f56126e31f985d5fb3" - patch_description: "Windows: Fix symlink privilege error detection" diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py deleted file mode 100644 index 550cc9984a1bb..0000000000000 --- a/recipes/fontconfig/meson/conanfile.py +++ /dev/null @@ -1,142 +0,0 @@ -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 ( - 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.scm import Version - -import os - -required_conan_version = ">=1.53.0" - - -class FontconfigConan(ConanFile): - name = "fontconfig" - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - description = "Fontconfig is a library for configuring and customizing font access" - homepage = "https://gitlab.freedesktop.org/fontconfig/fontconfig" - topics = ("fonts", "freedesktop") - 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): - basic_layout(self, src_folder="src") - - def requirements(self): - self.requires("freetype/2.13.2") - self.requires("expat/2.5.0") - if self.settings.os == "Linux": - self.requires("util-linux-libuuid/2.39.2") - - def build_requirements(self): - self.tool_requires("gperf/3.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/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() - - deps = PkgConfigDeps(self) - deps.generate() - - tc = MesonToolchain(self) - tc.project_options.update({ - "doc": "disabled", - "nls": "disabled", - "tests": "disabled", - "tools": "disabled" - }) - tc.generate() - - def _patch_files(self): - apply_conandata_patches(self) - replace_in_file(self, os.path.join(self.source_folder, "meson.build"), - "freetype_req = '>= 21.0.15'", - f"freetype_req = '{Version(self.dependencies['freetype'].ref.version)}'") - - def build(self): - self._patch_files() - 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() - 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")) - rmdir(self, os.path.join(self.package_folder, "etc")) - 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("cmake_find_mode", "both") - self.cpp_info.set_property("cmake_file_name", "Fontconfig") - self.cpp_info.set_property("cmake_target_name", "Fontconfig::Fontconfig") - self.cpp_info.set_property("pkg_config_name", "fontconfig") - self.cpp_info.libs = ["fontconfig"] - if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.system_libs.extend(["m", "pthread"]) - - fontconfig_file = os.path.join(self.package_folder, "bin", "etc", "fonts", "fonts.conf") - self.runenv_info.prepend_path("FONTCONFIG_FILE", fontconfig_file) - - fontconfig_path = os.path.join(self.package_folder, "bin", "etc", "fonts") - self.runenv_info.prepend_path("FONTCONFIG_PATH", fontconfig_path) - - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "Fontconfig" - self.cpp_info.names["cmake_find_package_multi"] = "Fontconfig" - self.env_info.FONTCONFIG_FILE = fontconfig_file - self.env_info.FONTCONFIG_PATH = fontconfig_path - -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/fontconfig/meson/test_package/CMakeLists.txt b/recipes/fontconfig/meson/test_package/CMakeLists.txt deleted file mode 100644 index 5def13d67bcff..0000000000000 --- a/recipes/fontconfig/meson/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(test_package LANGUAGES C) - -find_package(Fontconfig REQUIRED) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Fontconfig::Fontconfig) -target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fontconfig/meson/test_package/conanfile.py b/recipes/fontconfig/meson/test_package/conanfile.py deleted file mode 100644 index 42aa9d19c7fbe..0000000000000 --- a/recipes/fontconfig/meson/test_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -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", "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/fontconfig/meson/test_package/test_package.c b/recipes/fontconfig/meson/test_package/test_package.c deleted file mode 100644 index 7703ab64bbdec..0000000000000 --- a/recipes/fontconfig/meson/test_package/test_package.c +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include - -int main() { - FcConfig* config = FcInitLoadConfigAndFonts(); - FcPattern* pat = FcNameParse((const FcChar8*)"Arial"); - FcConfigSubstitute(config, pat, FcMatchPattern); - FcDefaultSubstitute(pat); - char* fontFile; - FcResult result; - FcPattern* font = FcFontMatch(config, pat, &result); - if (font) { - FcChar8* file = NULL; - if (FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch) { - fontFile = (char*)file; - printf("%s\n",fontFile); - } - } else { - printf("Ops! I can't find any font!\n"); - } - FcPatternDestroy(pat); - return EXIT_SUCCESS; -} diff --git a/recipes/fontconfig/meson/test_v1_package/CMakeLists.txt b/recipes/fontconfig/meson/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9e65290cb3f89..0000000000000 --- a/recipes/fontconfig/meson/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/fontconfig/meson/test_v1_package/conanfile.py b/recipes/fontconfig/meson/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/fontconfig/meson/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/foonathan-lexy/all/test_package/CMakeLists.txt b/recipes/foonathan-lexy/all/test_package/CMakeLists.txt index caf4fe13f8177..ecc04824046f8 100644 --- a/recipes/foonathan-lexy/all/test_package/CMakeLists.txt +++ b/recipes/foonathan-lexy/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) diff --git a/recipes/foonathan-lexy/all/test_v1_package/CMakeLists.txt b/recipes/foonathan-lexy/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/foonathan-lexy/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/foonathan-lexy/all/test_v1_package/conanfile.py b/recipes/foonathan-lexy/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/foonathan-lexy/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/foonathan-memory/all/test_package/CMakeLists.txt b/recipes/foonathan-memory/all/test_package/CMakeLists.txt index f778dab17e9aa..d33e72cfbc6e4 100644 --- a/recipes/foonathan-memory/all/test_package/CMakeLists.txt +++ b/recipes/foonathan-memory/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(foonathan_memory REQUIRED CONFIG) diff --git a/recipes/foonathan-memory/all/test_v1_package/CMakeLists.txt b/recipes/foonathan-memory/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/foonathan-memory/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/foonathan-memory/all/test_v1_package/conanfile.py b/recipes/foonathan-memory/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/foonathan-memory/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_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/forestdb/all/test_v1_package/CMakeLists.txt b/recipes/forestdb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/forestdb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 751b9d5bc7b9c..0000000000000 --- a/recipes/forestdb/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/conandata.yml b/recipes/foxglove-schemas-protobuf/all/conandata.yml index 658f5043f7c66..f381ebbb906bf 100644 --- a/recipes/foxglove-schemas-protobuf/all/conandata.yml +++ b/recipes/foxglove-schemas-protobuf/all/conandata.yml @@ -1,4 +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 + url: https://github.com/foxglove/foxglove-sdk/archive/refs/tags/releases/python/foxglove-schemas-protobuf/v0.1.0.tar.gz + sha256: 6479c73250f0f7268a77cb2b1d379e17c2e78a7553e467daf0d2f353a28868b3 diff --git a/recipes/foxglove-schemas-protobuf/all/conanfile.py b/recipes/foxglove-schemas-protobuf/all/conanfile.py index 5a5291f2d6ec4..8d38a2ede4027 100644 --- a/recipes/foxglove-schemas-protobuf/all/conanfile.py +++ b/recipes/foxglove-schemas-protobuf/all/conanfile.py @@ -8,13 +8,13 @@ import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0" class FoxgloveSchemasProtobufConan(ConanFile): name = "foxglove-schemas-protobuf" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/foxglove/schemas" + homepage = "https://github.com/foxglove/foxglove-sdk" description = "Protobuf schemas for Foxglove" license = "MIT" topics = ("foxglove", "protobuf", "schemas") @@ -64,11 +64,11 @@ def validate(self): 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) + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) + + def build_requirements(self): + self.tool_requires("protobuf/") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/foxglove-schemas-protobuf/all/test_package/CMakeLists.txt b/recipes/foxglove-schemas-protobuf/all/test_package/CMakeLists.txt index 793bfe03abb6b..862ae58614318 100644 --- a/recipes/foxglove-schemas-protobuf/all/test_package/CMakeLists.txt +++ b/recipes/foxglove-schemas-protobuf/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(foxglove-schemas-protobuf CONFIG REQUIRED) diff --git a/recipes/foxglove-websocket/all/conandata.yml b/recipes/foxglove-websocket/all/conandata.yml index 697b11f6c928c..0171190b402fc 100644 --- a/recipes/foxglove-websocket/all/conandata.yml +++ b/recipes/foxglove-websocket/all/conandata.yml @@ -1,4 +1,13 @@ sources: + 1.4.0: + url: https://github.com/foxglove/ws-protocol/archive/refs/tags/releases/cpp/v1.4.0.tar.gz + sha256: 2257383f1ae39c775fb624c78efa2faa4b3aa22c24f84c0b9940aa7848270cfc + 1.3.1: + url: https://github.com/foxglove/ws-protocol/archive/refs/tags/releases/cpp/v1.3.1.tar.gz + sha256: 48bae8599603da893e559b952e7fec1392aeb55cc6d59288feac6e6428e61bef + 1.3.0: + url: https://github.com/foxglove/ws-protocol/archive/refs/tags/releases/cpp/v1.3.0.tar.gz + sha256: 5c1d4cda60a89bf635ef0150e8cd2f4da569f92beb8ac8555795ed7fd47f2a21 1.2.0: url: https://github.com/foxglove/ws-protocol/archive/refs/tags/releases/cpp/v1.2.0.tar.gz sha256: 0471d3932500ed6acd87a99cd76e048366c82f2527c1631afcee4f8ab71c4ab7 diff --git a/recipes/foxglove-websocket/all/test_package/CMakeLists.txt b/recipes/foxglove-websocket/all/test_package/CMakeLists.txt index 869000fbad0c4..acbf44d74748d 100644 --- a/recipes/foxglove-websocket/all/test_package/CMakeLists.txt +++ b/recipes/foxglove-websocket/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(foxglove-websocket REQUIRED CONFIG) diff --git a/recipes/foxglove-websocket/all/test_v1_package/CMakeLists.txt b/recipes/foxglove-websocket/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/foxglove-websocket/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/foxglove-websocket/all/test_v1_package/conanfile.py b/recipes/foxglove-websocket/all/test_v1_package/conanfile.py deleted file mode 100644 index a4da47d572258..0000000000000 --- a/recipes/foxglove-websocket/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - - -class TestPackageConan(ConanFile): - settings = ("os", "arch", "compiler", "build_type") - generators = ("cmake", "cmake_find_package_multi") - test_type = "explicit" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def requirements(self): - self.requires(self.tested_reference_str) - - 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-websocket/config.yml b/recipes/foxglove-websocket/config.yml index 6f923ecb4a132..afd9f5b51aa04 100644 --- a/recipes/foxglove-websocket/config.yml +++ b/recipes/foxglove-websocket/config.yml @@ -1,4 +1,10 @@ versions: + 1.4.0: + folder: all + 1.3.1: + folder: all + 1.3.0: + folder: all 1.2.0: folder: all 1.1.0: diff --git a/recipes/foxi/all/test_package/CMakeLists.txt b/recipes/foxi/all/test_package/CMakeLists.txt index ab378d1724765..9d4aeb2aeed13 100644 --- a/recipes/foxi/all/test_package/CMakeLists.txt +++ b/recipes/foxi/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(foxi REQUIRED CONFIG) diff --git a/recipes/foxi/all/test_v1_package/CMakeLists.txt b/recipes/foxi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a1ab465c8f39c..0000000000000 --- a/recipes/foxi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(foxi REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE foxi::foxi) diff --git a/recipes/foxi/all/test_v1_package/conanfile.py b/recipes/foxi/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/foxi/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_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/fp16/all/test_package/CMakeLists.txt b/recipes/fp16/all/test_package/CMakeLists.txt index 1e502f0857d7c..1971278833de1 100644 --- a/recipes/fp16/all/test_package/CMakeLists.txt +++ b/recipes/fp16/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 C) find_package(fp16 REQUIRED CONFIG) diff --git a/recipes/fp16/all/test_v1_package/CMakeLists.txt b/recipes/fp16/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index d609dc2f83e68..0000000000000 --- a/recipes/fp16/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(fp16 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE fp16::fp16) -target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fp16/all/test_v1_package/conanfile.py b/recipes/fp16/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/fp16/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_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/fpgen/all/test_v1_package/CMakeLists.txt b/recipes/fpgen/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/fpgen/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 3f4a9f50f389e..0000000000000 --- a/recipes/fpgen/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/freealut/all/conandata.yml b/recipes/freealut/all/conandata.yml new file mode 100644 index 0000000000000..4ac03e7d67b4e --- /dev/null +++ b/recipes/freealut/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0": + url: "http://ftp.debian.org/debian/pool/main/f/freealut/freealut_1.1.0.orig.tar.gz" + sha256: "60d1ea8779471bb851b89b49ce44eecb78e46265be1a6e9320a28b100c8df44f" diff --git a/recipes/freealut/all/conanfile.py b/recipes/freealut/all/conanfile.py new file mode 100644 index 0000000000000..42eae88dfb458 --- /dev/null +++ b/recipes/freealut/all/conanfile.py @@ -0,0 +1,96 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm, rmdir +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.54" + +class FreeAlutConan(ConanFile): + name = "freealut" + description = "freealut is a free implementation of OpenAL's ALUT standard." + topics = ("openal", "audio", "api") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://openal.org" + license = "LGPL-2.0-or-later" + 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": + self.options.rm_safe("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 validate(self): + # FIXME: freealut supports Windows and Macos, but the recipe needs some help to work. + if self.settings.os in ["Windows", "Macos"] and \ + not self.options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} recipe is currently not prepared for Windows or Macos. Contributions are welcome." + ) + + # freealut's cmake currently is using find_library instead of the package finders so it wouldn't get its public compile definitions. + # This causes al.h to be preprocessed as a dynamic library. Since Windows symbols are different for dynamic and static methods they aren't found. + if self.settings.os == "Windows" and \ + not self.dependencies["openal-soft"].options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} cmake is currently not prepared to use openal-soft as a static library on Windows. Add option openal-soft/*:shared=True." + ) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("openal-soft/1.22.2", transitive_headers=True, transitive_libs=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeDeps(self) + tc.generate() + tc = CMakeToolchain(self) + # 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.cache_variables["CMAKE_POLICY_DEFAULT_CMP0003"] = "NEW" + tc.variables["BUILD_STATIC"] = not self.options.shared + # INFO: CMakeDeps generates CamelCase variables + tc.variables["OPENAL_LIB_DIR"] = os.path.join(self.dependencies["openal-soft"].package_folder, "lib") + tc.variables["OPENAL_INCLUDE_DIR"] = os.path.join(self.dependencies["openal-soft"].package_folder, "include") + if self.settings.os == "Windows": + tc.variables["OPENAL_INCLUDE_DIR"] += ";" + os.path.join(self.dependencies["openal-soft"].package_folder, "include", "AL") + tc.variables["OPENAL_LIB_DIR"] = tc.variables["OPENAL_LIB_DIR"].replace("\\","/") + tc.variables["OPENAL_INCLUDE_DIR"] = tc.variables["OPENAL_INCLUDE_DIR"].replace("\\","/") + tc.generate() + + def build(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")) + if not self.options.shared: + rm(self, "*.so*", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.libs = ['alut'] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] + if self.options.shared: + self.cpp_info.defines.append("ALUT_BUILD_LIBRARY") diff --git a/recipes/freealut/all/test_package/CMakeLists.txt b/recipes/freealut/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4ba52d1b57dea --- /dev/null +++ b/recipes/freealut/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(freealut REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE freealut::freealut) diff --git a/recipes/freealut/all/test_package/conanfile.py b/recipes/freealut/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/freealut/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/freealut/all/test_package/test_package.c b/recipes/freealut/all/test_package/test_package.c new file mode 100644 index 0000000000000..eebaa554d158e --- /dev/null +++ b/recipes/freealut/all/test_package/test_package.c @@ -0,0 +1,40 @@ +#include +#include +#include + +/* + This program checks that the version of OpenAL in the + library agrees with the header file we're compiled against. +*/ + +int +main (int argc, char **argv) +{ + ALboolean ok = AL_FALSE; + + alutInit (&argc, argv); + +#ifdef ALUT_API_MAJOR_VERSION + if (alutGetMajorVersion () != ALUT_API_MAJOR_VERSION || + alutGetMinorVersion () != ALUT_API_MINOR_VERSION) + { + fprintf (stderr, + "WARNING: The ALUT library is version %d.%d.x but says it's %d.%d.x!\n", + alutGetMajorVersion (), alutGetMinorVersion (), + ALUT_API_MAJOR_VERSION, ALUT_API_MINOR_VERSION); + } + else + { + fprintf (stderr, "The ALUT library is at version %d.%d.x.\n", + alutGetMajorVersion (), alutGetMinorVersion ()); + ok = AL_TRUE; + } +#else + fprintf (stderr, "WARNING: Your copy of is pre-1.0.0,\n"); + fprintf (stderr, "but you are running the ALUT test suite from ALUT\n"); + fprintf (stderr, "version 1.0.0 or later.\n"); +#endif + + alutExit (); + return ok ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/freealut/config.yml b/recipes/freealut/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/freealut/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/freeglut/all/conandata.yml b/recipes/freeglut/all/conandata.yml index e132a04abbb80..964de8ca2d213 100644 --- a/recipes/freeglut/all/conandata.yml +++ b/recipes/freeglut/all/conandata.yml @@ -8,3 +8,51 @@ sources: "3.2.1": sha256: "d4000e02102acaf259998c870e25214739d1f16f67f99cb35e4f46841399da68" url: "https://github.com/FreeGLUTProject/freeglut/releases/download/v3.2.1/freeglut-3.2.1.tar.gz" +patches: + "3.4.0": + - patch_file: "patches/3.4.0-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch" + patch_description: "Use find_package and pkg_check_modules to find dependencies" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/147" + patch_type: "conan" + - patch_file: "patches/3.4.0-0002-Use-find_library-to-locate-GL-libraries-not-provided.patch" + patch_description: "Use find_library to locate GL libraries" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/148" + patch_type: "portability" + - patch_file: "patches/3.4.0-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch" + patch_description: "Incorporate the include directory for glu.h in CMake" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/154" + patch_type: "portability" + "3.2.2": + - patch_file: "patches/3.2.1-0002-fixed-android-undefined-reference-to-glutCreateMenuU.patch" + patch_description: "Add a missing function definition" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/122" + patch_type: "portability" + - patch_file: "patches/3.2.2-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch" + patch_description: "Use find_package and pkg_check_modules to find dependencies" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/147" + patch_type: "conan" + - patch_file: "patches/3.2.2-0002-Use-find_library-to-locate-GL-libraries-not-provided.patch" + patch_description: "Use find_library to locate GL libraries" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/148" + patch_type: "portability" + - patch_file: "patches/3.2.2-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch" + patch_description: "Incorporate the include directory for glu.h in CMake" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/154" + patch_type: "portability" + "3.2.1": + - patch_file: "patches/3.2.1-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch" + patch_description: "Use find_package and pkg_check_modules to find dependencies" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/147" + patch_type: "conan" + - patch_file: "patches/3.2.1-0002-fixed-android-undefined-reference-to-glutCreateMenuU.patch" + patch_description: "Add a missing function definition" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/122" + patch_type: "portability" + - patch_file: "patches/3.2.1-0003-Use-find_library-to-locate-GL-libraries-not-provided.patch" + patch_description: "Use find_library to locate GL libraries" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/148" + patch_type: "portability" + - patch_file: "patches/3.2.1-0004-Incorporate-the-include-directory-for-glu.h-in-CMake.patch" + patch_description: "Incorporate the include directory for glu.h in CMake" + patch_source: "https://github.com/FreeGLUTProject/freeglut/pull/154" + patch_type: "portability" diff --git a/recipes/freeglut/all/conanfile.py b/recipes/freeglut/all/conanfile.py index d8b38c56cfa8c..dc8ac66bf9e42 100644 --- a/recipes/freeglut/all/conanfile.py +++ b/recipes/freeglut/all/conanfile.py @@ -1,7 +1,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import collect_libs, copy, get, rmdir +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, rmdir +from conan.tools.gnu import PkgConfigDeps from conan.tools.scm import Version import os @@ -11,7 +13,7 @@ class freeglutConan(ConanFile): name = "freeglut" description = "Open-source alternative to the OpenGL Utility Toolkit (GLUT) library" - topics = ("opengl", "gl", "glut", "utility", "toolkit", "graphics") + topics = ("gl", "glut", "graphics," "opengl", "toolkit", "utility") url = "https://github.com/conan-io/conan-center-index" homepage = "http://freeglut.sourceforge.net" license = "X11" @@ -24,6 +26,8 @@ class freeglutConan(ConanFile): "print_errors_at_runtime": [True, False], "print_warnings_at_runtime": [True, False], "replace_glut": [True, False], + "with_wayland": [True, False], + } default_options = { "shared": False, @@ -32,11 +36,41 @@ class freeglutConan(ConanFile): "print_errors_at_runtime": True, "print_warnings_at_runtime": True, "replace_glut": True, + "with_wayland": True, } + @property + def _requires_libglvnd_egl(self): + return self._requires_libglvnd_gles or self.options.get_safe("with_wayland") + + @property + def _requires_libglvnd_gles(self): + return self._with_libglvnd and self.options.get_safe("gles") + + @property + def _requires_libglvnd_glx(self): + return self._with_libglvnd and not self.options.get_safe("gles") + + @property + def _with_libglvnd(self): + return self.settings.os in ["FreeBSD", "Linux"] + + @property + def _with_x11(self): + return self.settings.os in ["FreeBSD", "Linux"] and not self.options.get_safe("with_wayland") + + 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 not in ["Android", "FreeBSD", "Linux"]: + self.options.rm_safe("gles") + else: + self.options.gles = self.settings.os == "Android" + if self.settings.os != "Linux": + self.options.rm_safe("with_wayland") def configure(self): if self.options.shared: @@ -44,13 +78,31 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if self._requires_libglvnd_egl: + self.options["libglvnd"].egl = True + if self._requires_libglvnd_gles: + self.options["libglvnd"].gles1 = True + self.options["libglvnd"].gles2 = True + if self._requires_libglvnd_glx: + self.options["libglvnd"].glx = True + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("opengl/system") - self.requires("glu/system") - if self.settings.os == "Linux": + if is_apple_os(self) or self.settings.os == "Windows": + self.requires("glu/system") + else: + # FreeGLUT includes glu.h in freeglut_std.h. + self.requires("mesa-glu/9.0.3", transitive_headers=True) + if self._with_libglvnd: + self.requires("libglvnd/1.7.0") + else: + self.requires("opengl/system") + if self.options.get_safe("with_wayland"): + self.requires("wayland/1.22.0") + self.requires("xkbcommon/1.6.0") + if self._with_x11: self.requires("xorg/system") def validate(self): @@ -64,6 +116,15 @@ def validate(self): (self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "11.0"): # see https://github.com/dcnieho/FreeGLUT/issues/86 raise ConanInvalidConfiguration(f"{self.ref} does not support gcc >= 10 and clang >= 11") + if self._requires_libglvnd_egl and not self.dependencies["libglvnd"].options.egl: + raise ConanInvalidConfiguration(f"{self.ref} requires the egl option of libglvnd to be enabled when either the gles option or with_wayland option is enabled") + if self._requires_libglvnd_gles and not self.dependencies["libglvnd"].options.gles1: + raise ConanInvalidConfiguration(f"{self.ref} requires the gles1 option of libglvnd to be enabled when the gles option is enabled") + if self._requires_libglvnd_gles and not self.dependencies["libglvnd"].options.gles2: + raise ConanInvalidConfiguration(f"{self.ref} requires the gles2 option of libglvnd to be enabled when the gles option is enabled") + if self._requires_libglvnd_glx and not self.dependencies["libglvnd"].options.glx: + raise ConanInvalidConfiguration(f"{self.ref} requires the glx option of libglvnd to be enabled when the gles option is disabled") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -73,22 +134,28 @@ def generate(self): tc.variables["FREEGLUT_BUILD_DEMOS"] = False tc.variables["FREEGLUT_BUILD_STATIC_LIBS"] = not self.options.shared tc.variables["FREEGLUT_BUILD_SHARED_LIBS"] = self.options.shared - tc.variables["FREEGLUT_GLES"] = self.options.gles + tc.variables["FREEGLUT_GLES"] = self.options.get_safe("gles", False) tc.variables["FREEGLUT_PRINT_ERRORS"] = self.options.print_errors_at_runtime tc.variables["FREEGLUT_PRINT_WARNINGS"] = self.options.print_warnings_at_runtime + tc.variables["FREEGLUT_WAYLAND"] = self.options.get_safe("with_wayland", False) tc.variables["FREEGLUT_INSTALL_PDB"] = False tc.variables["INSTALL_PDB"] = False tc.variables["FREEGLUT_REPLACE_GLUT"] = self.options.replace_glut tc.preprocessor_definitions["FREEGLUT_LIB_PRAGMAS"] = "0" tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + pkg_config_deps = PkgConfigDeps(self) + pkg_config_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")) + copy(self, "COPYING", 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")) @@ -107,7 +174,7 @@ def package_info(self): # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed self.cpp_info.components["freeglut_"].libs = collect_libs(self) - if self.settings.os == "Linux": + if self.settings.os in ["FreeBSD", "Linux"]: self.cpp_info.components["freeglut_"].system_libs.extend(["pthread", "m", "dl", "rt"]) elif self.settings.os == "Windows": if not self.options.shared: @@ -124,6 +191,22 @@ def package_info(self): self.cpp_info.components["freeglut_"].names["cmake_find_package_multi"] = config_target self.cpp_info.components["freeglut_"].set_property("cmake_target_name", f"FreeGLUT::{config_target}") self.cpp_info.components["freeglut_"].set_property("pkg_config_name", pkg_config) - self.cpp_info.components["freeglut_"].requires.extend(["opengl::opengl", "glu::glu"]) - if self.settings.os == "Linux": + if self._requires_libglvnd_egl: + self.cpp_info.components["freeglut_"].requires.append("libglvnd::egl") + if self._requires_libglvnd_gles: + self.cpp_info.components["freeglut_"].requires.append("libglvnd::gles1") + self.cpp_info.components["freeglut_"].requires.append("libglvnd::gles2") + if self._requires_libglvnd_glx: + self.cpp_info.components["freeglut_"].requires.append("libglvnd::gl") + if self._with_libglvnd: + self.cpp_info.components["freeglut_"].requires.append("libglvnd::opengl") + else: + self.cpp_info.components["freeglut_"].requires.append("opengl::opengl") + if self._with_x11: self.cpp_info.components["freeglut_"].requires.append("xorg::xorg") + if self.options.get_safe("with_wayland"): + self.cpp_info.components["freeglut_"].requires.extend(["wayland::wayland-client", "wayland::wayland-cursor", "wayland::wayland-egl", "xkbcommon::xkbcommon"]) + if is_apple_os(self) or self.settings.os == "Windows": + self.cpp_info.components["freeglut_"].requires.append("glu::glu") + else: + self.cpp_info.components["freeglut_"].requires.append("mesa-glu::mesa-glu") diff --git a/recipes/freeglut/all/patches/3.2.1-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch b/recipes/freeglut/all/patches/3.2.1-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch new file mode 100644 index 0000000000000..9e1c3b9056866 --- /dev/null +++ b/recipes/freeglut/all/patches/3.2.1-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch @@ -0,0 +1,94 @@ +From 4c573afc0453f3572c494d22b4f3bad9a9ce4073 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Tue, 7 Nov 2023 07:38:42 -0600 +Subject: [PATCH] Use find_package and pkg_check_modules to find more + dependencies + +This commit enhances the use of the FindOpenGL CMake module. +This requires CMake version 3.10 for the OpenGL::EGL imported target. +CMake 3.11 and later enable CMake policy CMP0072. +This prefers the GLVND libraries when available. + +Finds the Wayland and xkbcommon dependencies with pkg_check_modules. +This works with the pkg-config files provided by the upstream projects. +--- + CMakeLists.txt | 53 +++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 46 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6f403afa..a2a95c02 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,9 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) +-PROJECT(freeglut) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR) ++PROJECT(freeglut LANGUAGES C) ++ ++if (POLICY CMP0072) ++ cmake_policy(SET CMP0072 NEW) ++endif() + + # for multiarch LIBDIR support (requires cmake>=2.8.8) + INCLUDE(GNUInstallDirs) +@@ -257,17 +261,52 @@ ENDIF() + # GLES1 and GLES2 libraries are compatible and can be co-linked. + IF(FREEGLUT_GLES) + LIST(APPEND PUBLIC_DEFINITIONS -DFREEGLUT_GLES) +- LIST(APPEND LIBS GLESv2 GLESv1_CM EGL) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.27") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL GLES2 OpenGL) ++ LIST(APPEND LIBS GLESv1_CM OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) ++ elseif(NOT CMAKE_VERSION VERSION_LESS "3.10") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) ++ LIST(APPEND LIBS GLESv2 GLESv1_CM OpenGL::EGL OpenGL::OpenGL) ++ else() ++ FIND_PACKAGE(OpenGL REQUIRED) ++ LIST(APPEND LIBS EGL GLESv2 GLESv1_CM) ++ endif() + ELSE() +- FIND_PACKAGE(OpenGL REQUIRED) +- LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) +- INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.10") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS OpenGL) ++ LIST(APPEND LIBS OpenGL::GL) ++ else() ++ FIND_PACKAGE(OpenGL REQUIRED) ++ LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) ++ INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) ++ endif() + ENDIF() + + # For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL + IF(FREEGLUT_WAYLAND) + ADD_DEFINITIONS(-DFREEGLUT_WAYLAND) +- LIST(APPEND LIBS wayland-client wayland-cursor wayland-egl EGL xkbcommon) ++ INCLUDE(FindPkgConfig) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.10") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) ++ LIST(APPEND LIBS OpenGL::EGL OpenGL::OpenGL) ++ else() ++ FIND_PACKAGE(OpenGL REQUIRED) ++ LIST(APPEND LIBS EGL) ++ endif() ++ if(NOT CMAKE_VERSION VERSION_LESS "3.6") ++ PKG_CHECK_MODULES(wayland-client REQUIRED IMPORTED_TARGET wayland-client) ++ PKG_CHECK_MODULES(wayland-cursor REQUIRED IMPORTED_TARGET wayland-cursor) ++ PKG_CHECK_MODULES(wayland-egl REQUIRED IMPORTED_TARGET wayland-egl) ++ PKG_CHECK_MODULES(xkbcommon REQUIRED IMPORTED_TARGET xkbcommon) ++ LIST(APPEND LIBS PkgConfig::wayland-client PkgConfig::wayland-cursor PkgConfig::wayland-egl PkgConfig::xkbcommon) ++ else() ++ PKG_CHECK_MODULES(wayland-client REQUIRED) ++ PKG_CHECK_MODULES(wayland-cursor REQUIRED) ++ PKG_CHECK_MODULES(wayland-egl REQUIRED) ++ PKG_CHECK_MODULES(xkbcommon REQUIRED) ++ LIST(APPEND LIBS ${wayland-client_LINK_LIBRARIES} ${wayland-cursor_LINK_LIBRARIES} ${wayland-egl_LINK_LIBRARIES} ${xkbcommon_LINK_LIBRARIES}) ++ INCLUDE_DIRECTORIES(${wayland-client_INCLUDE_DIRS} ${wayland-cursor_INCLUDE_DIRS} ${wayland-egl_INCLUDE_DIRS} ${xkbcommon_INCLUDE_DIRS}) ++ endif() + ENDIF() + + # lib m for math, not needed on windows +-- +2.41.0 + diff --git a/recipes/freeglut/all/patches/3.2.1-0002-fixed-android-undefined-reference-to-glutCreateMenuU.patch b/recipes/freeglut/all/patches/3.2.1-0002-fixed-android-undefined-reference-to-glutCreateMenuU.patch new file mode 100644 index 0000000000000..039c12be9d43d --- /dev/null +++ b/recipes/freeglut/all/patches/3.2.1-0002-fixed-android-undefined-reference-to-glutCreateMenuU.patch @@ -0,0 +1,25 @@ +From 782e63b2eacd47155864d0d1d9b70615418e3083 Mon Sep 17 00:00:00 2001 +From: Jonatha Gabriel +Date: Sun, 4 Sep 2022 23:25:23 -0300 +Subject: [PATCH] fixed android undefined reference to glutCreateMenuUcall + +--- + src/gles_stubs.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/gles_stubs.c b/src/gles_stubs.c +index bc87c0d8..63a19209 100644 +--- a/src/gles_stubs.c ++++ b/src/gles_stubs.c +@@ -18,6 +18,8 @@ GLboolean fgCheckActiveMenu ( SFG_Window *window, int button, GLboolean pressed, + return GL_FALSE; + } + ++int FGAPIENTRY glutCreateMenuUcall( FGCBMenuUC callback, FGCBUserData userData ) { return 0; } ++ + int glutCreateMenu( void (* callback)( int menu ) ) { return 0; } + void glutDestroyMenu( int menu ) {} + int glutGetMenu( void ) { return 0; } +-- +2.41.0 + diff --git a/recipes/freeglut/all/patches/3.2.1-0003-Use-find_library-to-locate-GL-libraries-not-provided.patch b/recipes/freeglut/all/patches/3.2.1-0003-Use-find_library-to-locate-GL-libraries-not-provided.patch new file mode 100644 index 0000000000000..2a08c1427e3f1 --- /dev/null +++ b/recipes/freeglut/all/patches/3.2.1-0003-Use-find_library-to-locate-GL-libraries-not-provided.patch @@ -0,0 +1,65 @@ +From 9564dbb645a4be08aff7b65ac35b56e185a7598c Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Tue, 7 Nov 2023 11:00:39 -0600 +Subject: [PATCH] Use find_library to locate GL libraries not provided by + FindOpenGL + +FindOpenGL is used to find the OpenGL libraries. +It doesn't find all of the necessary libraries, however. +These missing libraries have been added to the link line directly. +This is problematic when FindOpenGL is pointed at OpenGL libraries somewhere outside LD_LIBRARY_PATH and the system's default linker paths. +In such cases, the libraries won't be found at link time. + +CMake's find_library function can be used instead to add the libraries as this commit does. +This function can use the location of the GL libraries that were already found as a hint. +Furthermore, this allows consumers to use CMake cache variables to set the exact libraries to use if needed. +--- + CMakeLists.txt | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a2a95c02..772e73f3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -263,13 +263,23 @@ IF(FREEGLUT_GLES) + LIST(APPEND PUBLIC_DEFINITIONS -DFREEGLUT_GLES) + if(NOT CMAKE_VERSION VERSION_LESS "3.27") + FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL GLES2 OpenGL) +- LIST(APPEND LIBS GLESv1_CM OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) ++ CMAKE_PATH(GET OPENGL_gles2_LIBRARY PARENT_PATH _OPENGL_LIBDIR) ++ FIND_LIBRARY(GLES1_LIBRARY GLESv1_CM HINTS ${_OPENGL_LIBDIR} REQUIRED) ++ LIST(APPEND LIBS ${GLES1_LIBRARY} OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) + elseif(NOT CMAKE_VERSION VERSION_LESS "3.10") + FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) +- LIST(APPEND LIBS GLESv2 GLESv1_CM OpenGL::EGL OpenGL::OpenGL) ++ GET_FILENAME_COMPONENT(_OPENGL_LIBDIR ${OPENGL_egl_LIBRARY} DIRECTORY) ++ FIND_LIBRARY(GLES1_LIBRARY GLESv1_CM HINTS ${_OPENGL_LIBDIR}) ++ FIND_LIBRARY(GLES2_LIBRARY GLESv2 HINTS ${_OPENGL_LIBDIR}) ++ LIST(APPEND LIBS ${GLES1_LIBRARY} ${GLES2_LIBRARY} OpenGL::EGL OpenGL::OpenGL) + else() + FIND_PACKAGE(OpenGL REQUIRED) +- LIST(APPEND LIBS EGL GLESv2 GLESv1_CM) ++ LIST(GET ${OPENGL_LIBRARIES} 0 _OPENGL_LIB) ++ GET_FILENAME_COMPONENT(_OPENGL_LIBDIR ${_OPENGL_LIB} DIRECTORY) ++ FIND_LIBRARY(EGL_LIBRARY EGL HINTS ${_OPENGL_LIBDIR}) ++ FIND_LIBRARY(GLES1_LIBRARY GLESv1_CM HINTS ${_OPENGL_LIBDIR}) ++ FIND_LIBRARY(GLES2_LIBRARY GLESv2 HINTS ${_OPENGL_LIBDIR}) ++ LIST(APPEND LIBS ${EGL_LIBRARY} ${GLES1_LIBRARY} ${GLES2_LIBRARY}) + endif() + ELSE() + if(NOT CMAKE_VERSION VERSION_LESS "3.10") +@@ -291,7 +301,10 @@ IF(FREEGLUT_WAYLAND) + LIST(APPEND LIBS OpenGL::EGL OpenGL::OpenGL) + else() + FIND_PACKAGE(OpenGL REQUIRED) +- LIST(APPEND LIBS EGL) ++ LIST(GET ${OPENGL_LIBRARIES} 0 _OPENGL_LIB) ++ GET_FILENAME_COMPONENT(_OPENGL_LIBDIR ${_OPENGL_LIB} DIRECTORY) ++ FIND_LIBRARY(EGL_LIBRARY EGL HINTS ${_OPENGL_LIBDIR}) ++ LIST(APPEND LIBS ${EGL_LIBRARY}) + endif() + if(NOT CMAKE_VERSION VERSION_LESS "3.6") + PKG_CHECK_MODULES(wayland-client REQUIRED IMPORTED_TARGET wayland-client) +-- +2.41.0 + diff --git a/recipes/freeglut/all/patches/3.2.1-0004-Incorporate-the-include-directory-for-glu.h-in-CMake.patch b/recipes/freeglut/all/patches/3.2.1-0004-Incorporate-the-include-directory-for-glu.h-in-CMake.patch new file mode 100644 index 0000000000000..a2fd409a85d19 --- /dev/null +++ b/recipes/freeglut/all/patches/3.2.1-0004-Incorporate-the-include-directory-for-glu.h-in-CMake.patch @@ -0,0 +1,61 @@ +From c81e600ace29bf5f3ded5e2650859f3303aaac6e Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Wed, 7 Feb 2024 10:09:25 -0600 +Subject: [PATCH] Incorporate the include directory for glu.h in CMake + +FreeGLUT doesn't properly check for the glu.h header file when it is required. +The glu.h header is not necessary when FreeGLUT is built for GLES. +However, the demos require use libGLU and so require the include and the library. + +CMake's FindOpenGL didn't properly search for the glu.h header file until very recently. +Refer to this PR: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9216. + +This PR checks for the glu.h header and adds the corresponding include directory when it is required. +For versions of CMake prior to 3.29, the include directory for GLU is added even when linking against the OpenGL::GLU target. +Like the FindOpenGL module, GLU include directories are ignored on Windows. +--- + CMakeLists.txt | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 772e73f3..162eec40 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -290,6 +290,17 @@ ELSE() + LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) + INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + endif() ++ ++ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") ++ # CMake 3.29 properly locates the include directory for glu.h in the OPENGL_GLU_INCLUDE_DIR variable for us. ++ if(CMAKE_VERSION VERSION_LESS "3.29") ++ FIND_PATH(OPENGL_GLU_INCLUDE_DIR NAMES GL/glu.h OpenGL/glu.h HINTS ${OPENGL_INCLUDE_DIR}) ++ endif() ++ if(NOT OPENGL_GLU_INCLUDE_DIR) ++ message(FATAL_ERROR "Failed to find the glu.h header file.") ++ endif() ++ INCLUDE_DIRECTORIES(${OPENGL_GLU_INCLUDE_DIR}) ++ endif() + ENDIF() + + # For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL +@@ -566,7 +577,15 @@ INSTALL(FILES ${FREEGLUT_HEADERS} DESTINATION include/GL COMPONENT Devel) + # Optionally build demos, on by default. + option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON ) + +-SET(DEMO_LIBS ${OPENGL_glu_LIBRARY} ${LIBS}) ++set(DEMO_LIBS ${LIBS}) ++if (FREEGLUT_BUILD_DEMOS) ++ if (OPENGL_GLU_FOUND) ++ list(APPEND DEMO_LIBS ${OPENGL_glu_LIBRARY}) ++ else() ++ message(FATAL_ERROR "Failed to find the GLU library which is required to build the demos.") ++ endif() ++endif() ++ + # lib m for math, not needed on windows + IF (NOT WIN32) + LIST(APPEND DEMO_LIBS m) +-- +2.43.2 + diff --git a/recipes/freeglut/all/patches/3.2.2-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch b/recipes/freeglut/all/patches/3.2.2-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch new file mode 100644 index 0000000000000..83ea577575c3c --- /dev/null +++ b/recipes/freeglut/all/patches/3.2.2-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch @@ -0,0 +1,94 @@ +From 4b4f63a41d4ee33a4b3c048bb4281051acbad106 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Tue, 7 Nov 2023 07:38:42 -0600 +Subject: [PATCH] Use find_package and pkg_check_modules to find more + dependencies + +This commit enhances the use of the FindOpenGL CMake module. +This requires CMake version 3.10 for the OpenGL::EGL imported target. +CMake 3.11 and later enable CMake policy CMP0072. +This prefers the GLVND libraries when available. + +Finds the Wayland and xkbcommon dependencies with pkg_check_modules. +This works with the pkg-config files provided by the upstream projects. +--- + CMakeLists.txt | 53 +++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 46 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ac8c8df3..f97f14ff 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,9 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) +-PROJECT(freeglut) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR) ++PROJECT(freeglut LANGUAGES C) ++ ++if (POLICY CMP0072) ++ cmake_policy(SET CMP0072 NEW) ++endif() + + # for multiarch LIBDIR support (requires cmake>=2.8.8) + INCLUDE(GNUInstallDirs) +@@ -261,17 +265,52 @@ ENDIF() + # GLES1 and GLES2 libraries are compatible and can be co-linked. + IF(FREEGLUT_GLES) + LIST(APPEND PUBLIC_DEFINITIONS -DFREEGLUT_GLES) +- LIST(APPEND LIBS GLESv2 GLESv1_CM EGL) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.27") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL GLES2 OpenGL) ++ LIST(APPEND LIBS GLESv1_CM OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) ++ elseif(NOT CMAKE_VERSION VERSION_LESS "3.10") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) ++ LIST(APPEND LIBS GLESv2 GLESv1_CM OpenGL::EGL OpenGL::OpenGL) ++ else() ++ FIND_PACKAGE(OpenGL REQUIRED) ++ LIST(APPEND LIBS EGL GLESv2 GLESv1_CM) ++ endif() + ELSE() +- FIND_PACKAGE(OpenGL REQUIRED) +- LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) +- INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.10") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS OpenGL) ++ LIST(APPEND LIBS OpenGL::GL) ++ else() ++ FIND_PACKAGE(OpenGL REQUIRED) ++ LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) ++ INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) ++ endif() + ENDIF() + + # For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL + IF(FREEGLUT_WAYLAND) + ADD_DEFINITIONS(-DFREEGLUT_WAYLAND) +- LIST(APPEND LIBS wayland-client wayland-cursor wayland-egl EGL xkbcommon) ++ INCLUDE(FindPkgConfig) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.10") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) ++ LIST(APPEND LIBS OpenGL::EGL OpenGL::OpenGL) ++ else() ++ FIND_PACKAGE(OpenGL REQUIRED) ++ LIST(APPEND LIBS EGL) ++ endif() ++ if(NOT CMAKE_VERSION VERSION_LESS "3.6") ++ PKG_CHECK_MODULES(wayland-client REQUIRED IMPORTED_TARGET wayland-client) ++ PKG_CHECK_MODULES(wayland-cursor REQUIRED IMPORTED_TARGET wayland-cursor) ++ PKG_CHECK_MODULES(wayland-egl REQUIRED IMPORTED_TARGET wayland-egl) ++ PKG_CHECK_MODULES(xkbcommon REQUIRED IMPORTED_TARGET xkbcommon) ++ LIST(APPEND LIBS PkgConfig::wayland-client PkgConfig::wayland-cursor PkgConfig::wayland-egl PkgConfig::xkbcommon) ++ else() ++ PKG_CHECK_MODULES(wayland-client REQUIRED) ++ PKG_CHECK_MODULES(wayland-cursor REQUIRED) ++ PKG_CHECK_MODULES(wayland-egl REQUIRED) ++ PKG_CHECK_MODULES(xkbcommon REQUIRED) ++ LIST(APPEND LIBS ${wayland-client_LINK_LIBRARIES} ${wayland-cursor_LINK_LIBRARIES} ${wayland-egl_LINK_LIBRARIES} ${xkbcommon_LINK_LIBRARIES}) ++ INCLUDE_DIRECTORIES(${wayland-client_INCLUDE_DIRS} ${wayland-cursor_INCLUDE_DIRS} ${wayland-egl_INCLUDE_DIRS} ${xkbcommon_INCLUDE_DIRS}) ++ endif() + ENDIF() + + # lib m for math, not needed on windows +-- +2.41.0 + diff --git a/recipes/freeglut/all/patches/3.2.2-0002-Use-find_library-to-locate-GL-libraries-not-provided.patch b/recipes/freeglut/all/patches/3.2.2-0002-Use-find_library-to-locate-GL-libraries-not-provided.patch new file mode 100644 index 0000000000000..42975bdd0a638 --- /dev/null +++ b/recipes/freeglut/all/patches/3.2.2-0002-Use-find_library-to-locate-GL-libraries-not-provided.patch @@ -0,0 +1,65 @@ +From 0bf1cd0cf4291ef130dcbf708128c72440ed6178 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Tue, 7 Nov 2023 11:00:39 -0600 +Subject: [PATCH] Use find_library to locate GL libraries not provided by + FindOpenGL + +FindOpenGL is used to find the OpenGL libraries. +It doesn't find all of the necessary libraries, however. +These missing libraries have been added to the link line directly. +This is problematic when FindOpenGL is pointed at OpenGL libraries somewhere outside LD_LIBRARY_PATH and the system's default linker paths. +In such cases, the libraries won't be found at link time. + +CMake's find_library function can be used instead to add the libraries as this commit does. +This function can use the location of the GL libraries that were already found as a hint. +Furthermore, this allows consumers to use CMake cache variables to set the exact libraries to use if needed. +--- + CMakeLists.txt | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f97f14ff..c2549b1b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -267,13 +267,23 @@ IF(FREEGLUT_GLES) + LIST(APPEND PUBLIC_DEFINITIONS -DFREEGLUT_GLES) + if(NOT CMAKE_VERSION VERSION_LESS "3.27") + FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL GLES2 OpenGL) +- LIST(APPEND LIBS GLESv1_CM OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) ++ CMAKE_PATH(GET OPENGL_gles2_LIBRARY PARENT_PATH _OPENGL_LIBDIR) ++ FIND_LIBRARY(GLES1_LIBRARY GLESv1_CM HINTS ${_OPENGL_LIBDIR} REQUIRED) ++ LIST(APPEND LIBS ${GLES1_LIBRARY} OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) + elseif(NOT CMAKE_VERSION VERSION_LESS "3.10") + FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) +- LIST(APPEND LIBS GLESv2 GLESv1_CM OpenGL::EGL OpenGL::OpenGL) ++ GET_FILENAME_COMPONENT(_OPENGL_LIBDIR ${OPENGL_egl_LIBRARY} DIRECTORY) ++ FIND_LIBRARY(GLES1_LIBRARY GLESv1_CM HINTS ${_OPENGL_LIBDIR}) ++ FIND_LIBRARY(GLES2_LIBRARY GLESv2 HINTS ${_OPENGL_LIBDIR}) ++ LIST(APPEND LIBS ${GLES1_LIBRARY} ${GLES2_LIBRARY} OpenGL::EGL OpenGL::OpenGL) + else() + FIND_PACKAGE(OpenGL REQUIRED) +- LIST(APPEND LIBS EGL GLESv2 GLESv1_CM) ++ LIST(GET ${OPENGL_LIBRARIES} 0 _OPENGL_LIB) ++ GET_FILENAME_COMPONENT(_OPENGL_LIBDIR ${_OPENGL_LIB} DIRECTORY) ++ FIND_LIBRARY(EGL_LIBRARY EGL HINTS ${_OPENGL_LIBDIR}) ++ FIND_LIBRARY(GLES1_LIBRARY GLESv1_CM HINTS ${_OPENGL_LIBDIR}) ++ FIND_LIBRARY(GLES2_LIBRARY GLESv2 HINTS ${_OPENGL_LIBDIR}) ++ LIST(APPEND LIBS ${EGL_LIBRARY} ${GLES1_LIBRARY} ${GLES2_LIBRARY}) + endif() + ELSE() + if(NOT CMAKE_VERSION VERSION_LESS "3.10") +@@ -295,7 +305,10 @@ IF(FREEGLUT_WAYLAND) + LIST(APPEND LIBS OpenGL::EGL OpenGL::OpenGL) + else() + FIND_PACKAGE(OpenGL REQUIRED) +- LIST(APPEND LIBS EGL) ++ LIST(GET ${OPENGL_LIBRARIES} 0 _OPENGL_LIB) ++ GET_FILENAME_COMPONENT(_OPENGL_LIBDIR ${_OPENGL_LIB} DIRECTORY) ++ FIND_LIBRARY(EGL_LIBRARY EGL HINTS ${_OPENGL_LIBDIR}) ++ LIST(APPEND LIBS ${EGL_LIBRARY}) + endif() + if(NOT CMAKE_VERSION VERSION_LESS "3.6") + PKG_CHECK_MODULES(wayland-client REQUIRED IMPORTED_TARGET wayland-client) +-- +2.41.0 + diff --git a/recipes/freeglut/all/patches/3.2.2-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch b/recipes/freeglut/all/patches/3.2.2-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch new file mode 100644 index 0000000000000..997edcafc5966 --- /dev/null +++ b/recipes/freeglut/all/patches/3.2.2-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch @@ -0,0 +1,61 @@ +From 278ac11cf27c8112021735240dc0b34fe849045e Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Wed, 7 Feb 2024 10:09:25 -0600 +Subject: [PATCH] Incorporate the include directory for glu.h in CMake + +FreeGLUT doesn't properly check for the glu.h header file when it is required. +The glu.h header is not necessary when FreeGLUT is built for GLES. +However, the demos require use libGLU and so require the include and the library. + +CMake's FindOpenGL didn't properly search for the glu.h header file until very recently. +Refer to this PR: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9216. + +This PR checks for the glu.h header and adds the corresponding include directory when it is required. +For versions of CMake prior to 3.29, the include directory for GLU is added even when linking against the OpenGL::GLU target. +Like the FindOpenGL module, GLU include directories are ignored on Windows. +--- + CMakeLists.txt | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c2549b1b..4ebc33af 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -294,6 +294,17 @@ ELSE() + LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) + INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + endif() ++ ++ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") ++ # CMake 3.29 properly locates the include directory for glu.h in the OPENGL_GLU_INCLUDE_DIR variable for us. ++ if(CMAKE_VERSION VERSION_LESS "3.29") ++ FIND_PATH(OPENGL_GLU_INCLUDE_DIR NAMES GL/glu.h OpenGL/glu.h HINTS ${OPENGL_INCLUDE_DIR}) ++ endif() ++ if(NOT OPENGL_GLU_INCLUDE_DIR) ++ message(FATAL_ERROR "Failed to find the glu.h header file.") ++ endif() ++ INCLUDE_DIRECTORIES(${OPENGL_GLU_INCLUDE_DIR}) ++ endif() + ENDIF() + + # For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL +@@ -578,7 +589,15 @@ INSTALL(FILES ${FREEGLUT_HEADERS} DESTINATION include/GL COMPONENT Devel) + # Optionally build demos, on by default. + option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON ) + +-SET(DEMO_LIBS ${OPENGL_glu_LIBRARY} ${LIBS}) ++set(DEMO_LIBS ${LIBS}) ++if (FREEGLUT_BUILD_DEMOS) ++ if (OPENGL_GLU_FOUND) ++ list(APPEND DEMO_LIBS ${OPENGL_glu_LIBRARY}) ++ else() ++ message(FATAL_ERROR "Failed to find the GLU library which is required to build the demos.") ++ endif() ++endif() ++ + # lib m for math, not needed on windows + IF (NOT WIN32) + LIST(APPEND DEMO_LIBS m) +-- +2.43.2 + diff --git a/recipes/freeglut/all/patches/3.4.0-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch b/recipes/freeglut/all/patches/3.4.0-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch new file mode 100644 index 0000000000000..ccc7efdb7a68d --- /dev/null +++ b/recipes/freeglut/all/patches/3.4.0-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch @@ -0,0 +1,100 @@ +From c60bc900b74d4e18994200550d26ae860899003f Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Thu, 2 Nov 2023 15:27:49 -0500 +Subject: [PATCH] Use find_package and pkg_check_modules to find more + dependencies + +This commit enhances the use of the FindOpenGL CMake module. +This requires CMake version 3.10 for the OpenGL::EGL imported target. +CMake 3.11 and later enable CMake policy CMP0072. +This prefers the GLVND libraries when available. + +Finds the Wayland and xkbcommon dependencies with pkg_check_modules. +This works with the pkg-config files provided by the upstream projects. +--- + CMakeLists.txt | 53 +++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 46 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 832d8672..87a54ae5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,9 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) +-PROJECT(freeglut C) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR) ++PROJECT(freeglut LANGUAGES C) ++ ++if (POLICY CMP0072) ++ cmake_policy(SET CMP0072 NEW) ++endif() + + # for multiarch LIBDIR support (requires cmake>=2.8.8) + INCLUDE(GNUInstallDirs) +@@ -292,7 +296,16 @@ ENDIF() + # GLES1 and GLES2 libraries are compatible and can be co-linked. + IF(FREEGLUT_GLES) + LIST(APPEND PUBLIC_DEFINITIONS -DFREEGLUT_GLES) +- LIST(APPEND LIBS GLESv2 GLESv1_CM EGL) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.27") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL GLES2 OpenGL) ++ LIST(APPEND LIBS GLESv1_CM OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) ++ elseif(NOT CMAKE_VERSION VERSION_LESS "3.10") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) ++ LIST(APPEND LIBS GLESv2 GLESv1_CM OpenGL::EGL OpenGL::OpenGL) ++ else() ++ FIND_PACKAGE(OpenGL REQUIRED) ++ LIST(APPEND LIBS EGL GLESv2 GLESv1_CM) ++ endif() + ELSE() + # On OS X, we need to link against the X11 OpenGL libraries, NOT the Cocoa OpenGL libraries. + # To do that, you need to manually find two of the libraries before calling FindOpenGL +@@ -304,15 +317,41 @@ ELSE() + find_library(OPENGL_glu_LIBRARY NAME GLU HINTS ${X11_LIB_PATH}) + endif() + +- FIND_PACKAGE(OpenGL REQUIRED) +- LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) +- INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.10") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS OpenGL) ++ LIST(APPEND LIBS OpenGL::GL) ++ else() ++ FIND_PACKAGE(OpenGL REQUIRED) ++ LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) ++ INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) ++ endif() + ENDIF() + + # For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL + IF(FREEGLUT_WAYLAND) + ADD_DEFINITIONS(-DFREEGLUT_WAYLAND) +- LIST(APPEND LIBS wayland-client wayland-cursor wayland-egl EGL xkbcommon) ++ INCLUDE(FindPkgConfig) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.10") ++ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) ++ LIST(APPEND LIBS OpenGL::EGL OpenGL::OpenGL) ++ else() ++ FIND_PACKAGE(OpenGL REQUIRED) ++ LIST(APPEND LIBS EGL) ++ endif() ++ if(NOT CMAKE_VERSION VERSION_LESS "3.6") ++ PKG_CHECK_MODULES(wayland-client REQUIRED IMPORTED_TARGET wayland-client) ++ PKG_CHECK_MODULES(wayland-cursor REQUIRED IMPORTED_TARGET wayland-cursor) ++ PKG_CHECK_MODULES(wayland-egl REQUIRED IMPORTED_TARGET wayland-egl) ++ PKG_CHECK_MODULES(xkbcommon REQUIRED IMPORTED_TARGET xkbcommon) ++ LIST(APPEND LIBS PkgConfig::wayland-client PkgConfig::wayland-cursor PkgConfig::wayland-egl PkgConfig::xkbcommon) ++ else() ++ PKG_CHECK_MODULES(wayland-client REQUIRED) ++ PKG_CHECK_MODULES(wayland-cursor REQUIRED) ++ PKG_CHECK_MODULES(wayland-egl REQUIRED) ++ PKG_CHECK_MODULES(xkbcommon REQUIRED) ++ LIST(APPEND LIBS ${wayland-client_LINK_LIBRARIES} ${wayland-cursor_LINK_LIBRARIES} ${wayland-egl_LINK_LIBRARIES} ${xkbcommon_LINK_LIBRARIES}) ++ INCLUDE_DIRECTORIES(${wayland-client_INCLUDE_DIRS} ${wayland-cursor_INCLUDE_DIRS} ${wayland-egl_INCLUDE_DIRS} ${xkbcommon_INCLUDE_DIRS}) ++ endif() + ENDIF() + + # lib m for math, not needed on windows +-- +2.41.0 + diff --git a/recipes/freeglut/all/patches/3.4.0-0002-Use-find_library-to-locate-GL-libraries-not-provided.patch b/recipes/freeglut/all/patches/3.4.0-0002-Use-find_library-to-locate-GL-libraries-not-provided.patch new file mode 100644 index 0000000000000..585a7de277647 --- /dev/null +++ b/recipes/freeglut/all/patches/3.4.0-0002-Use-find_library-to-locate-GL-libraries-not-provided.patch @@ -0,0 +1,65 @@ +From 4840a7d77e772d96074af64b6234cbc6e881d223 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Tue, 7 Nov 2023 11:00:39 -0600 +Subject: [PATCH] Use find_library to locate GL libraries not provided by + FindOpenGL + +FindOpenGL is used to find the OpenGL libraries. +It doesn't find all of the necessary libraries, however. +These missing libraries have been added to the link line directly. +This is problematic when FindOpenGL is pointed at OpenGL libraries somewhere outside LD_LIBRARY_PATH and the system's default linker paths. +In such cases, the libraries won't be found at link time. + +CMake's find_library function can be used instead to add the libraries as this commit does. +This function can use the location of the GL libraries that were already found as a hint. +Furthermore, this allows consumers to use CMake cache variables to set the exact libraries to use if needed. +--- + CMakeLists.txt | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 87a54ae5..afb4d735 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -298,13 +298,23 @@ IF(FREEGLUT_GLES) + LIST(APPEND PUBLIC_DEFINITIONS -DFREEGLUT_GLES) + if(NOT CMAKE_VERSION VERSION_LESS "3.27") + FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL GLES2 OpenGL) +- LIST(APPEND LIBS GLESv1_CM OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) ++ CMAKE_PATH(GET OPENGL_gles2_LIBRARY PARENT_PATH _OPENGL_LIBDIR) ++ FIND_LIBRARY(GLES1_LIBRARY GLESv1_CM HINTS ${_OPENGL_LIBDIR} REQUIRED) ++ LIST(APPEND LIBS ${GLES1_LIBRARY} OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) + elseif(NOT CMAKE_VERSION VERSION_LESS "3.10") + FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) +- LIST(APPEND LIBS GLESv2 GLESv1_CM OpenGL::EGL OpenGL::OpenGL) ++ GET_FILENAME_COMPONENT(_OPENGL_LIBDIR ${OPENGL_egl_LIBRARY} DIRECTORY) ++ FIND_LIBRARY(GLES1_LIBRARY GLESv1_CM HINTS ${_OPENGL_LIBDIR}) ++ FIND_LIBRARY(GLES2_LIBRARY GLESv2 HINTS ${_OPENGL_LIBDIR}) ++ LIST(APPEND LIBS ${GLES1_LIBRARY} ${GLES2_LIBRARY} OpenGL::EGL OpenGL::OpenGL) + else() + FIND_PACKAGE(OpenGL REQUIRED) +- LIST(APPEND LIBS EGL GLESv2 GLESv1_CM) ++ LIST(GET ${OPENGL_LIBRARIES} 0 _OPENGL_LIB) ++ GET_FILENAME_COMPONENT(_OPENGL_LIBDIR ${_OPENGL_LIB} DIRECTORY) ++ FIND_LIBRARY(EGL_LIBRARY EGL HINTS ${_OPENGL_LIBDIR}) ++ FIND_LIBRARY(GLES1_LIBRARY GLESv1_CM HINTS ${_OPENGL_LIBDIR}) ++ FIND_LIBRARY(GLES2_LIBRARY GLESv2 HINTS ${_OPENGL_LIBDIR}) ++ LIST(APPEND LIBS ${EGL_LIBRARY} ${GLES1_LIBRARY} ${GLES2_LIBRARY}) + endif() + ELSE() + # On OS X, we need to link against the X11 OpenGL libraries, NOT the Cocoa OpenGL libraries. +@@ -336,7 +346,10 @@ IF(FREEGLUT_WAYLAND) + LIST(APPEND LIBS OpenGL::EGL OpenGL::OpenGL) + else() + FIND_PACKAGE(OpenGL REQUIRED) +- LIST(APPEND LIBS EGL) ++ LIST(GET ${OPENGL_LIBRARIES} 0 _OPENGL_LIB) ++ GET_FILENAME_COMPONENT(_OPENGL_LIBDIR ${_OPENGL_LIB} DIRECTORY) ++ FIND_LIBRARY(EGL_LIBRARY EGL HINTS ${_OPENGL_LIBDIR}) ++ LIST(APPEND LIBS ${EGL_LIBRARY}) + endif() + if(NOT CMAKE_VERSION VERSION_LESS "3.6") + PKG_CHECK_MODULES(wayland-client REQUIRED IMPORTED_TARGET wayland-client) +-- +2.41.0 + diff --git a/recipes/freeglut/all/patches/3.4.0-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch b/recipes/freeglut/all/patches/3.4.0-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch new file mode 100644 index 0000000000000..883e8141aa971 --- /dev/null +++ b/recipes/freeglut/all/patches/3.4.0-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch @@ -0,0 +1,69 @@ +From 90f733b3adec8b3f97a24d4dd9dc47a595a17c2c Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Wed, 7 Feb 2024 10:09:25 -0600 +Subject: [PATCH] Incorporate the include directory for glu.h in CMake + +FreeGLUT doesn't properly check for the glu.h header file when it is required. +The glu.h header is not necessary when FreeGLUT is built for GLES. +However, the demos require use libGLU and so require the include and the library. + +CMake's FindOpenGL didn't properly search for the glu.h header file until very recently. +Refer to this PR: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9216. + +This PR checks for the glu.h header and adds the corresponding include directory when it is required. +For versions of CMake prior to 3.29, the include directory for GLU is added even when linking against the OpenGL::GLU target. +Like the FindOpenGL module, GLU include directories are ignored on Windows. +--- + CMakeLists.txt | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index afb4d735..aaf854d8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -324,6 +324,7 @@ ELSE() + get_filename_component(X11_LIB_PATH ${X11_Xi_LIB} DIRECTORY) + + find_library(OPENGL_gl_LIBRARY NAME GL HINTS ${X11_LIB_PATH}) ++ find_path(OPENGL_GLU_INCLUDE_DIR NAMES GL/glu.h OpenGL/glu.h HINTS ${X11_Xi_INCLUDE_PATH}) + find_library(OPENGL_glu_LIBRARY NAME GLU HINTS ${X11_LIB_PATH}) + endif() + +@@ -335,6 +336,17 @@ ELSE() + LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) + INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + endif() ++ ++ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") ++ # CMake 3.29 properly locates the include directory for glu.h in the OPENGL_GLU_INCLUDE_DIR variable for us. ++ if(CMAKE_VERSION VERSION_LESS "3.29") ++ FIND_PATH(OPENGL_GLU_INCLUDE_DIR NAMES GL/glu.h OpenGL/glu.h HINTS ${OPENGL_INCLUDE_DIR}) ++ endif() ++ if(NOT OPENGL_GLU_INCLUDE_DIR) ++ message(FATAL_ERROR "Failed to find the glu.h header file.") ++ endif() ++ INCLUDE_DIRECTORIES(${OPENGL_GLU_INCLUDE_DIR}) ++ endif() + ENDIF() + + # For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL +@@ -599,7 +611,15 @@ INSTALL(FILES ${FREEGLUT_HEADERS} DESTINATION include/GL COMPONENT Devel) + # Optionally build demos, on by default. + option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON ) + +-SET(DEMO_LIBS ${OPENGL_glu_LIBRARY} ${LIBS}) ++set(DEMO_LIBS ${LIBS}) ++if (FREEGLUT_BUILD_DEMOS) ++ if (OPENGL_GLU_FOUND) ++ list(APPEND DEMO_LIBS ${OPENGL_glu_LIBRARY}) ++ else() ++ message(FATAL_ERROR "Failed to find the GLU library which is required to build the demos.") ++ endif() ++endif() ++ + # lib m for math, not needed on windows + IF (NOT WIN32) + LIST(APPEND DEMO_LIBS m) +-- +2.43.2 + diff --git a/recipes/freeglut/all/test_package/CMakeLists.txt b/recipes/freeglut/all/test_package/CMakeLists.txt index 8010c630a0049..9640aaa16d3b0 100644 --- a/recipes/freeglut/all/test_package/CMakeLists.txt +++ b/recipes/freeglut/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(FreeGLUT REQUIRED CONFIG) diff --git a/recipes/freeglut/all/test_package/conanfile.py b/recipes/freeglut/all/test_package/conanfile.py index 6e146f0e38642..0a6bc68712d90 100644 --- a/recipes/freeglut/all/test_package/conanfile.py +++ b/recipes/freeglut/all/test_package/conanfile.py @@ -14,7 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("opengl/system") def build(self): cmake = CMake(self) diff --git a/recipes/freeglut/all/test_package_module/CMakeLists.txt b/recipes/freeglut/all/test_package_module/CMakeLists.txt index cfee51d49e44b..91faaebf9894b 100644 --- a/recipes/freeglut/all/test_package_module/CMakeLists.txt +++ b/recipes/freeglut/all/test_package_module/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(GLUT REQUIRED MODULE) diff --git a/recipes/freeglut/all/test_package_module/conanfile.py b/recipes/freeglut/all/test_package_module/conanfile.py index 6e146f0e38642..0a6bc68712d90 100644 --- a/recipes/freeglut/all/test_package_module/conanfile.py +++ b/recipes/freeglut/all/test_package_module/conanfile.py @@ -14,7 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("opengl/system") def build(self): cmake = CMake(self) diff --git a/recipes/freeglut/all/test_v1_package/CMakeLists.txt b/recipes/freeglut/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/freeglut/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/freeglut/all/test_v1_package/conanfile.py b/recipes/freeglut/all/test_v1_package/conanfile.py deleted file mode 100644 index f044ed5376bf7..0000000000000 --- a/recipes/freeglut/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +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" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - self.requires("opengl/system") - - 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/freeglut/all/test_v1_package_module/CMakeLists.txt b/recipes/freeglut/all/test_v1_package_module/CMakeLists.txt deleted file mode 100644 index 27f7a57e7a0b3..0000000000000 --- a/recipes/freeglut/all/test_v1_package_module/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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_module - ${CMAKE_CURRENT_BINARY_DIR}/test_package_module) diff --git a/recipes/freeglut/all/test_v1_package_module/conanfile.py b/recipes/freeglut/all/test_v1_package_module/conanfile.py deleted file mode 100644 index f0bc95c494a3c..0000000000000 --- a/recipes/freeglut/all/test_v1_package_module/conanfile.py +++ /dev/null @@ -1,22 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - self.requires("opengl/system") - - 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/freeimage/all/conandata.yml b/recipes/freeimage/all/conandata.yml index ab58bf12a8d2b..a988135b5daba 100644 --- a/recipes/freeimage/all/conandata.yml +++ b/recipes/freeimage/all/conandata.yml @@ -1,6 +1,6 @@ sources: "3.18.0": - url: "http://downloads.sourceforge.net/project/freeimage/Source Distribution/3.18.0/FreeImage3180.zip" + url: "http://downloads.sourceforge.net/project/freeimage/Source%20Distribution/3.18.0/FreeImage3180.zip" sha256: "f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd" patches: "3.18.0": diff --git a/recipes/freeimage/all/conanfile.py b/recipes/freeimage/all/conanfile.py index 7b598ff9ef76d..9a83848609751 100644 --- a/recipes/freeimage/all/conanfile.py +++ b/recipes/freeimage/all/conanfile.py @@ -71,13 +71,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/3.0.0") + self.requires("libjpeg-turbo/3.0.2") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") if self.options.with_jpeg2000: - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_webp: self.requires("libwebp/1.3.2") if self.options.with_tiff or self.options.with_openexr: diff --git a/recipes/freeimage/all/test_package/CMakeLists.txt b/recipes/freeimage/all/test_package/CMakeLists.txt index a3aaf996ceb62..fc445f5b804f0 100644 --- a/recipes/freeimage/all/test_package/CMakeLists.txt +++ b/recipes/freeimage/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(freeimage CONFIG REQUIRED) diff --git a/recipes/freeimage/all/test_package/conanfile.py b/recipes/freeimage/all/test_package/conanfile.py index 9f97d7f9f47a9..0a6bc68712d90 100644 --- a/recipes/freeimage/all/test_package/conanfile.py +++ b/recipes/freeimage/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - bees = os.path.join(self.source_folder, "test.png") - self.run(f"{bin_path} {bees}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/freeimage/all/test_package/test.png b/recipes/freeimage/all/test_package/test.png deleted file mode 100644 index 11640c7488fb1..0000000000000 Binary files a/recipes/freeimage/all/test_package/test.png and /dev/null differ diff --git a/recipes/freeimage/all/test_package/test_package.cpp b/recipes/freeimage/all/test_package/test_package.cpp index 0adc1a0375b01..b2164b2ffb68d 100644 --- a/recipes/freeimage/all/test_package/test_package.cpp +++ b/recipes/freeimage/all/test_package/test_package.cpp @@ -11,39 +11,14 @@ void FreeImageErrorHandler(FREE_IMAGE_FORMAT fif, const char* message) std::cerr << "FreeImage error: " << message << std::endl; } -int main(int argc, char** argv ) -{ - if (argc < 2) { - std::cerr << "Need at least one argument" << std::endl; - return 1; - } +int main(int argc, char** argv ) { #if NEED_INIT FreeImage_Initialise(); #endif FreeImage_SetOutputMessage(FreeImageErrorHandler); - - std::cout << "FreeImage " << FreeImage_GetVersion() << ", with:" << std::endl; - - for (int i = 0; i < FreeImage_GetFIFCount(); ++i) - { - std::cout << "\t- " << FreeImage_GetFIFExtensionList((FREE_IMAGE_FORMAT)i) << std::endl; - } - - const char * image_file = argv[1]; - FREE_IMAGE_FORMAT fif = FIF_UNKNOWN; - fif = FreeImage_GetFileType(image_file, 0); - if (fif == FIF_UNKNOWN) { - fif = FreeImage_GetFIFFromFilename(image_file); - } - if ((fif != FIF_UNKNOWN) && FreeImage_FIFSupportsReading(fif)) { - FIBITMAP* dib = FreeImage_Load(fif, image_file, 0); - if (dib) - { - FreeImage_Unload(dib); - } - } + std::cout << "FreeImage " << FreeImage_GetVersion() << std::endl; #if NEED_INIT FreeImage_DeInitialise(); diff --git a/recipes/freeimage/all/test_v1_package/CMakeLists.txt b/recipes/freeimage/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/freeimage/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/freeimage/all/test_v1_package/conanfile.py b/recipes/freeimage/all/test_v1_package/conanfile.py deleted file mode 100644 index 6895afd01c85c..0000000000000 --- a/recipes/freeimage/all/test_v1_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 = os.path.join("bin", "test_package") - bees = os.path.join(self.source_folder, os.pardir, "test_package", "test.png") - self.run(f"{bin_path} {bees}", run_environment=True) diff --git a/recipes/freetype/all/conandata.yml b/recipes/freetype/all/conandata.yml index 8e6b6b6c5bfe8..ffe78e299e4fb 100644 --- a/recipes/freetype/all/conandata.yml +++ b/recipes/freetype/all/conandata.yml @@ -1,14 +1,4 @@ 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" - - "https://sourceforge.net/projects/freetype/files/freetype2/2.13.0/freetype-2.13.0.tar.xz" - sha256: "5ee23abd047636c24b2d43c6625dcafc66661d1aca64dec9e0d05df29592624c" "2.12.1": url: - "https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.xz" @@ -24,8 +14,3 @@ sources: - "https://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.xz" - "https://sourceforge.net/projects/freetype/files/freetype2/2.10.4/freetype-2.10.4.tar.xz" sha256: "86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784" -patches: - "2.13.0": - - patch_file: "patches/2.13.0-0001-fix-fallthrough.patch" - patch_description: "Fix FALL_THROUGH macro for clang 10 & 11" - patch_type: "portability" diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index 1415f8ffb0446..ff1598068ddb2 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import ( - apply_conandata_patches, collect_libs, copy, export_conandata_patches, load, + collect_libs, copy, load, get, rename, replace_in_file, rmdir, save ) from conan.tools.scm import Version @@ -9,7 +9,7 @@ import re import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class FreetypeConan(ConanFile): @@ -40,18 +40,9 @@ class FreetypeConan(ConanFile): "subpixel": False, } - @property - def _has_with_brotli_option(self): - return Version(self.version) >= "2.10.2" - - 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_with_brotli_option: - del self.options.with_brotli def configure(self): if self.options.shared: @@ -64,12 +55,12 @@ def layout(self): def requirements(self): if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_zlib: 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"): + if self.options.with_brotli: self.requires("brotli/1.1.0") def source(self): @@ -90,28 +81,26 @@ def generate(self): # TODO: Harfbuzz can be added as an option as soon as it is available. tc.variables["FT_REQUIRE_HARFBUZZ"] = False tc.variables["FT_DISABLE_HARFBUZZ"] = True - if self._has_with_brotli_option: - tc.variables["FT_REQUIRE_BROTLI"] = self.options.with_brotli - tc.variables["FT_DISABLE_BROTLI"] = not self.options.with_brotli + tc.variables["FT_REQUIRE_BROTLI"] = self.options.with_brotli + tc.variables["FT_DISABLE_BROTLI"] = not self.options.with_brotli else: tc.variables["FT_WITH_ZLIB"] = self.options.with_zlib tc.variables["FT_WITH_PNG"] = self.options.with_png tc.variables["FT_WITH_BZIP2"] = self.options.with_bzip2 # TODO: Harfbuzz can be added as an option as soon as it is available. tc.variables["FT_WITH_HARFBUZZ"] = False - if self._has_with_brotli_option: - tc.variables["FT_WITH_BROTLI"] = self.options.with_brotli + tc.variables["FT_WITH_BROTLI"] = self.options.with_brotli # Generate a relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "2.13.3": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def _patch_sources(self): - apply_conandata_patches(self) # Do not accidentally enable dependencies we have disabled cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - find_harfbuzz = "find_package(HarfBuzz {})".format("1.3.0" if Version(self.version) < "2.10.2" else "${HARFBUZZ_MIN_VERSION}") if_harfbuzz_found = "if ({})".format("HARFBUZZ_FOUND" if Version(self.version) < "2.11.0" else "HarfBuzz_FOUND") - replace_in_file(self, cmakelists, find_harfbuzz, "") + replace_in_file(self, cmakelists, "find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION})", "") replace_in_file(self, cmakelists, if_harfbuzz_found, "if(0)") if not self.options.with_png: replace_in_file(self, cmakelists, "find_package(PNG)", "") @@ -122,16 +111,15 @@ def _patch_sources(self): if not self.options.with_bzip2: replace_in_file(self, cmakelists, "find_package(BZip2)", "") replace_in_file(self, cmakelists, "if (BZIP2_FOUND)", "if(0)") - if self._has_with_brotli_option: - # the custom FindBrotliDec of upstream is too fragile - replace_in_file(self, cmakelists, - "find_package(BrotliDec REQUIRED)", - "find_package(Brotli REQUIRED)\n" - "set(BROTLIDEC_FOUND 1)\n" - "set(BROTLIDEC_LIBRARIES \"brotli::brotli\")") - if not self.options.with_brotli: - replace_in_file(self, cmakelists, "find_package(BrotliDec)", "") - replace_in_file(self, cmakelists, "if (BROTLIDEC_FOUND)", "if(0)") + # the custom FindBrotliDec of upstream is too fragile + replace_in_file(self, cmakelists, + "find_package(BrotliDec REQUIRED)", + "find_package(Brotli REQUIRED)\n" + "set(BROTLIDEC_FOUND 1)\n" + "set(BROTLIDEC_LIBRARIES \"brotli::brotli\")") + if not self.options.with_brotli: + replace_in_file(self, cmakelists, "find_package(BrotliDec)", "") + replace_in_file(self, cmakelists, "if (BROTLIDEC_FOUND)", "if(0)") config_h = os.path.join(self.source_folder, "include", "freetype", "config", "ftoption.h") if self.options.subpixel: @@ -254,19 +242,8 @@ def package_info(self): libtool_version = load(self, self._libtool_version_txt).strip() self.conf_info.define("user.freetype:libtool_version", libtool_version) - # FIXME: need to do override the pkg_config version (pkg_config_custom_content does not work) - # self.cpp_info.version["pkg_config"] = pkg_config_version + self.cpp_info.set_property("system_package_version", libtool_version) - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.filenames["cmake_find_package"] = "Freetype" - self.cpp_info.filenames["cmake_find_package_multi"] = "freetype" - self.cpp_info.names["cmake_find_package"] = "Freetype" - self.cpp_info.names["cmake_find_package_multi"] = "Freetype" - self.cpp_info.build_modules["cmake_find_package"] = [self._module_vars_rel_path] - self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_target_rel_path] - self.cpp_info.names["pkg_config"] = "freetype2" + self.cpp_info.set_property("component_version", libtool_version) freetype_config = os.path.join(self.package_folder, "bin", "freetype-config") - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) - self.env_info.FT2_CONFIG = freetype_config self._chmod_plus_x(freetype_config) - self.user_info.LIBTOOL_VERSION = libtool_version diff --git a/recipes/freetype/all/patches/2.13.0-0001-fix-fallthrough.patch b/recipes/freetype/all/patches/2.13.0-0001-fix-fallthrough.patch deleted file mode 100644 index 0386998dea7bb..0000000000000 --- a/recipes/freetype/all/patches/2.13.0-0001-fix-fallthrough.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/include/freetype/internal/compiler-macros.h -+++ b/include/freetype/internal/compiler-macros.h -@@ -42,8 +42,8 @@ FT_BEGIN_HEADER - ( defined( __cplusplus ) && __cplusplus > 201402L ) - # define FALL_THROUGH [[__fallthrough__]] - # elif ( defined( __GNUC__ ) && __GNUC__ >= 7 ) || \ -- ( defined( __clang__ ) && __clang_major__ >= 10 ) --# define FALL_THROUGH __attribute__(( __fallthrough__ )) -+ ( defined( __clang__ ) && __clang_major__ >= 12 ) -+# define FALL_THROUGH __attribute__((fallthrough)) - # else - # define FALL_THROUGH ( (void)0 ) - # endif diff --git a/recipes/freetype/all/test_package/CMakeLists.txt b/recipes/freetype/all/test_package/CMakeLists.txt index 9ac9bd88e8a63..daf57e167b0ad 100644 --- a/recipes/freetype/all/test_package/CMakeLists.txt +++ b/recipes/freetype/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(freetype REQUIRED CONFIG) diff --git a/recipes/freetype/all/test_package/OpenSans-Bold.ttf b/recipes/freetype/all/test_package/OpenSans-Bold.ttf index fd79d43bea029..1588c2ced3a6c 100644 Binary files a/recipes/freetype/all/test_package/OpenSans-Bold.ttf and b/recipes/freetype/all/test_package/OpenSans-Bold.ttf differ diff --git a/recipes/freetype/all/test_package/conanfile.py b/recipes/freetype/all/test_package/conanfile.py index 5da019d033eb1..7c01d32f07d5a 100644 --- a/recipes/freetype/all/test_package/conanfile.py +++ b/recipes/freetype/all/test_package/conanfile.py @@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" + license = "OFL-1.1-no-RFN" def layout(self): cmake_layout(self) diff --git a/recipes/freetype/all/test_package_module/conanfile.py b/recipes/freetype/all/test_package_module/conanfile.py index e789c017730b3..c01bc5d128062 100644 --- a/recipes/freetype/all/test_package_module/conanfile.py +++ b/recipes/freetype/all/test_package_module/conanfile.py @@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" + license = "OFL-1.1-no-RFN" def layout(self): cmake_layout(self) diff --git a/recipes/freetype/all/test_v1_package/CMakeLists.txt b/recipes/freetype/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/freetype/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/freetype/all/test_v1_package/conanfile.py b/recipes/freetype/all/test_v1_package/conanfile.py deleted file mode 100644 index da2d908b1d4a7..0000000000000 --- a/recipes/freetype/all/test_v1_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 = os.path.join("bin", "test_package") - font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") - self.run(f"{bin_path} {font_path}", run_environment=True) diff --git a/recipes/freetype/all/test_v1_package_module/CMakeLists.txt b/recipes/freetype/all/test_v1_package_module/CMakeLists.txt deleted file mode 100644 index 27f7a57e7a0b3..0000000000000 --- a/recipes/freetype/all/test_v1_package_module/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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_module - ${CMAKE_CURRENT_BINARY_DIR}/test_package_module) diff --git a/recipes/freetype/all/test_v1_package_module/conanfile.py b/recipes/freetype/all/test_v1_package_module/conanfile.py deleted file mode 100644 index 7834358365541..0000000000000 --- a/recipes/freetype/all/test_v1_package_module/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" - - 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") - font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") - self.run(f"{bin_path} {font_path}", run_environment=True) diff --git a/recipes/freetype/config.yml b/recipes/freetype/config.yml index a1ef7bebb603a..d5b191e4495ca 100644 --- a/recipes/freetype/config.yml +++ b/recipes/freetype/config.yml @@ -1,8 +1,10 @@ versions: + "2.13.3": + folder: meson "2.13.2": - folder: all + folder: meson "2.13.0": - folder: all + folder: meson "2.12.1": folder: all "2.11.1": diff --git a/recipes/freetype/meson/conandata.yml b/recipes/freetype/meson/conandata.yml new file mode 100644 index 0000000000000..361e211d1b780 --- /dev/null +++ b/recipes/freetype/meson/conandata.yml @@ -0,0 +1,40 @@ +sources: + "2.13.3": + url: + - "https://download.savannah.gnu.org/releases/freetype/freetype-2.13.3.tar.xz" + - "https://sourceforge.net/projects/freetype/files/freetype2/2.13.3/freetype-2.13.3.tar.xz" + sha256: "0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289" + "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" + - "https://sourceforge.net/projects/freetype/files/freetype2/2.13.0/freetype-2.13.0.tar.xz" + sha256: "5ee23abd047636c24b2d43c6625dcafc66661d1aca64dec9e0d05df29592624c" +patches: + "2.13.3": + - patch_file: "patches/2.13.3-0002-meson-Fix-static-windows.patch" + patch_description: "meson: define DLL_EXPORT for shared library only" + patch_source: "https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/341" + patch_type: "portability" + "2.13.2": + - patch_file: "patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch" + patch_description: "meson: Use the standard dependency mechanism to find bzip2" + patch_source: "https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/318" + patch_type: "portability" + - patch_file: "patches/2.13.0-0002-meson-Fix-static-windows.patch" + patch_description: "meson: define DLL_EXPORT for shared library only" + patch_source: "https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/341" + patch_type: "portability" + "2.13.0": + - patch_file: "patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch" + patch_description: "meson: Use the standard dependency mechanism to find bzip2" + patch_source: "https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/318" + patch_type: "portability" + - patch_file: "patches/2.13.0-0002-meson-Fix-static-windows.patch" + patch_description: "meson: define DLL_EXPORT for shared library only" + patch_source: "https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/341" + patch_type: "portability" diff --git a/recipes/freetype/meson/conanfile.py b/recipes/freetype/meson/conanfile.py new file mode 100644 index 0000000000000..c48b965407536 --- /dev/null +++ b/recipes/freetype/meson/conanfile.py @@ -0,0 +1,258 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.files import ( + apply_conandata_patches, copy, export_conandata_patches, load, + get, rename, replace_in_file, rm, 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 +from conan.tools.scm import Version +import os +import re +import shutil +import textwrap + +required_conan_version = ">=1.53.0" + + +class FreetypeConan(ConanFile): + name = "freetype" + description = "FreeType is a freely available software library to render fonts." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freetype.org" + license = "FTL" + topics = ("freetype", "fonts") + package_type = "library" + short_paths = True + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_png": [True, False], + "with_zlib": [True, False], + "with_bzip2": [True, False], + "with_brotli": [True, False], + "subpixel": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_png": True, + "with_zlib": True, + "with_bzip2": True, + "with_brotli": True, + "subpixel": 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.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_png: + self.requires("libpng/[>=1.6 <2]") + if self.options.with_zlib: + 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.1.0") + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + 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): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def feature(option): + return "enabled" if option else "disabled" + + tc = MesonToolchain(self) + tc.project_options["brotli"] = feature(self.options.with_brotli) + tc.project_options["bzip2"] = feature(self.options.with_bzip2) + # Harfbuzz support introduces a circular dependency between Harfbuzz and Freetype. + # They both have options to require each other. + tc.project_options["harfbuzz"] = "disabled" + tc.project_options["png"] = feature(self.options.with_png) + tc.project_options["tests"] = "disabled" + tc.project_options["zlib"] = "system" if self.options.with_zlib else "disabled" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + config_h = os.path.join(self.source_folder, "include", "freetype", "config", "ftoption.h") + if self.options.subpixel: + replace_in_file(self, config_h, "/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */", "#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def _make_freetype_config(self, version): + freetype_config_in = os.path.join(self.source_folder, "builds", "unix", "freetype-config.in") + if not os.path.isdir(os.path.join(self.package_folder, "bin")): + os.makedirs(os.path.join(self.package_folder, "bin")) + freetype_config = os.path.join(self.package_folder, "bin", "freetype-config") + rename(self, freetype_config_in, freetype_config) + staticlibs = "-lm -lfreetype" if self.settings.os == "Linux" else "-lfreetype" + replace_in_file(self, freetype_config, r"%PKG_CONFIG%", r"/bin/false") # never use pkg-config + replace_in_file(self, freetype_config, r"%prefix%", r"$conan_prefix") + replace_in_file(self, freetype_config, r"%exec_prefix%", r"$conan_exec_prefix") + replace_in_file(self, freetype_config, r"%includedir%", r"$conan_includedir") + replace_in_file(self, freetype_config, r"%libdir%", r"$conan_libdir") + replace_in_file(self, freetype_config, r"%ft_version%", r"$conan_ftversion") + replace_in_file(self, freetype_config, r"%LIBSSTATIC_CONFIG%", r"$conan_staticlibs") + replace_in_file(self, freetype_config, r"export LC_ALL", textwrap.dedent("""\ + export LC_ALL + BINDIR=$(dirname $0) + conan_prefix=$(dirname $BINDIR) + conan_exec_prefix=${{conan_prefix}}/bin + conan_includedir=${{conan_prefix}}/include + conan_libdir=${{conan_prefix}}/lib + conan_ftversion={version} + conan_staticlibs="{staticlibs}" + """).format(version=version, staticlibs=staticlibs)) + + def _extract_libtool_version(self): + conf_raw = load(self, os.path.join(self.source_folder, "builds", "unix", "configure.raw")) + return re.search(r"^version_info='([0-9:]+)'", conf_raw, flags=re.M).group(1).replace(":", ".") + + @property + def _libtool_version_txt(self): + return os.path.join(self.package_folder, "res", "freetype-libtool-version.txt") + + def package(self): + meson = Meson(self) + meson.install() + + # As a workaround to support versions of CMake before 3.29, rename the libfreetype.a static library to freetype.lib on Windows. + if self.settings.os == "Windows" and not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libfreetype.a"), os.path.join(self.package_folder, "lib", "freetype.lib")) + + ver = Version(self.version) + if self.settings.os == "Windows" and self.options.shared and ver >= "2.13.0" and ver < "2.14.0": + # Duplicate DLL name for backwards compatibility with earlier recipe revisions + # See https://github.com/conan-io/conan-center-index/issues/23768 + suffix = "d" if self.settings.build_type == "Debug" else "" + src = os.path.join(self.package_folder, "bin", "freetype-6.dll") + dst = os.path.join(self.package_folder, "bin", f"freetype{suffix}.dll") + shutil.copyfile(src, dst) + + libtool_version = self._extract_libtool_version() + + save(self, self._libtool_version_txt, libtool_version) + self._make_freetype_config(libtool_version) + + doc_folder = os.path.join(self.source_folder, "docs") + license_folder = os.path.join(self.package_folder, "licenses") + copy(self, "FTL.TXT", doc_folder, license_folder) + copy(self, "GPLv2.TXT", doc_folder, license_folder) + copy(self, "LICENSE.TXT", doc_folder, license_folder) + + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + 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_variables( + os.path.join(self.package_folder, self._module_vars_rel_path) + ) + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_target_rel_path), + {"freetype": "Freetype::Freetype"} + ) + + fix_apple_shared_install_name(self) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(FREETYPE_FOUND TRUE) + if(DEFINED Freetype_INCLUDE_DIRS) + set(FREETYPE_INCLUDE_DIRS ${{Freetype_INCLUDE_DIRS}}) + endif() + if(DEFINED Freetype_LIBRARIES) + set(FREETYPE_LIBRARIES ${{Freetype_LIBRARIES}}) + endif() + set(FREETYPE_VERSION_STRING "{self.version}") + """) + save(self, module_file, content) + + def _create_cmake_module_alias_targets(self, 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)) + save(self, module_file, content) + + @property + 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 + def _chmod_plus_x(filename): + if os.name == "posix" and (os.stat(filename).st_mode & 0o111) != 0o111: + os.chmod(filename, os.stat(filename).st_mode | 0o111) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "Freetype") + self.cpp_info.set_property("cmake_file_name", "freetype") + self.cpp_info.set_property("cmake_target_name", "Freetype::Freetype") + self.cpp_info.set_property("cmake_target_aliases", ["freetype"]) # other possible target name in upstream config file + self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path]) + self.cpp_info.set_property("pkg_config_name", "freetype2") + self.cpp_info.libs = ["freetype"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.includedirs.append(os.path.join("include", "freetype2")) + + libtool_version = load(self, self._libtool_version_txt).strip() + self.conf_info.define("user.freetype:libtool_version", libtool_version) + self.cpp_info.set_property("system_package_version", libtool_version) + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.set_property("component_version", libtool_version) + self.cpp_info.filenames["cmake_find_package"] = "Freetype" + self.cpp_info.filenames["cmake_find_package_multi"] = "freetype" + self.cpp_info.names["cmake_find_package"] = "Freetype" + self.cpp_info.names["cmake_find_package_multi"] = "Freetype" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_vars_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_target_rel_path] + self.cpp_info.names["pkg_config"] = "freetype2" + freetype_config = os.path.join(self.package_folder, "bin", "freetype-config") + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.FT2_CONFIG = freetype_config + self._chmod_plus_x(freetype_config) + self.user_info.LIBTOOL_VERSION = libtool_version diff --git a/recipes/freetype/meson/patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch b/recipes/freetype/meson/patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch new file mode 100644 index 0000000000000..c38db5d6a0d6c --- /dev/null +++ b/recipes/freetype/meson/patches/2.13.0-0001-meson-Use-the-standard-dependency-mechanism-to-find-.patch @@ -0,0 +1,31 @@ +From 2598fa002859d2af1c846363ff64e72d2ebde16a Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Mon, 4 Mar 2024 12:14:51 -0600 +Subject: [PATCH] meson: Use the standard dependency mechanism to find bzip2 + +This follows standard conventions in Meson by using the pkg-config file. +This change allows Conan to switch to the Meson build system. +--- + meson.build | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index f81de3e2f..c5cb8ea52 100644 +--- a/meson.build ++++ b/meson.build +@@ -316,8 +316,10 @@ else + endif + + # BZip2 support +-bzip2_dep = cc.find_library('bz2', +- required: get_option('bzip2')) ++bzip2_dep = dependency('bzip2', required: false) ++if not bzip2_dep.found() ++ bzip2_dep = cc.find_library('bz2', has_headers: ['bzlib.h'], required: get_option('bzip2')) ++endif + + if bzip2_dep.found() + ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_BZIP2'] +-- +2.44.0 + diff --git a/recipes/freetype/meson/patches/2.13.0-0002-meson-Fix-static-windows.patch b/recipes/freetype/meson/patches/2.13.0-0002-meson-Fix-static-windows.patch new file mode 100644 index 0000000000000..7faf662f6ebdf --- /dev/null +++ b/recipes/freetype/meson/patches/2.13.0-0002-meson-Fix-static-windows.patch @@ -0,0 +1,12 @@ +--- a/meson.build ++++ b/meson.build +@@ -368,7 +368,8 @@ ftoption_h = custom_target('ftoption.h', + ft2_sources += ftoption_h + ft2_defines += ['-DFT_CONFIG_OPTIONS_H='] + +-if host_machine.system() == 'windows' ++if host_machine.system() == 'windows' and \ ++ get_option('default_library') == 'shared' + ft2_defines += ['-DDLL_EXPORT=1'] + endif + diff --git a/recipes/freetype/meson/patches/2.13.3-0002-meson-Fix-static-windows.patch b/recipes/freetype/meson/patches/2.13.3-0002-meson-Fix-static-windows.patch new file mode 100644 index 0000000000000..e001a8bdca37c --- /dev/null +++ b/recipes/freetype/meson/patches/2.13.3-0002-meson-Fix-static-windows.patch @@ -0,0 +1,12 @@ +--- a/meson.build ++++ b/meson.build +@@ -373,7 +373,8 @@ ftoption_h = custom_target('ftoption.h', + ft2_sources += ftoption_h + ft2_defines += ['-DFT_CONFIG_OPTIONS_H='] + +-if host_machine.system() == 'windows' ++if host_machine.system() == 'windows' and \ ++ get_option('default_library') == 'shared' + ft2_defines += ['-DDLL_EXPORT=1'] + endif + diff --git a/recipes/freetype/meson/test_package/CMakeLists.txt b/recipes/freetype/meson/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..daf57e167b0ad --- /dev/null +++ b/recipes/freetype/meson/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(freetype REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE freetype) diff --git a/recipes/freetype/meson/test_package/OpenSans-Bold.ttf b/recipes/freetype/meson/test_package/OpenSans-Bold.ttf new file mode 100644 index 0000000000000..1588c2ced3a6c Binary files /dev/null and b/recipes/freetype/meson/test_package/OpenSans-Bold.ttf differ diff --git a/recipes/freetype/meson/test_package/conanfile.py b/recipes/freetype/meson/test_package/conanfile.py new file mode 100644 index 0000000000000..c762b4d9a11e2 --- /dev/null +++ b/recipes/freetype/meson/test_package/conanfile.py @@ -0,0 +1,29 @@ +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 = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + license = "OFL-1.1-no-RFN" + short_paths = True + + 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") + font_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", env="conanrun") diff --git a/recipes/freetype/meson/test_package/test_package.c b/recipes/freetype/meson/test_package/test_package.c new file mode 100644 index 0000000000000..332eeaeae1c39 --- /dev/null +++ b/recipes/freetype/meson/test_package/test_package.c @@ -0,0 +1,142 @@ +/* example1.c */ +/* */ +/* This small program shows how to print a rotated string with the */ +/* FreeType 2 library. */ + +#include "ft2build.h" +#include FT_FREETYPE_H + +#include +#include +#include +#include + + + +#define WIDTH 640 +#define HEIGHT 480 + + +/* origin is the upper left corner */ +unsigned char image[HEIGHT][WIDTH]; + + +/* Replace this function with something useful. */ + +void +draw_bitmap( FT_Bitmap* bitmap, + FT_Int x, + FT_Int y) +{ + FT_Int i, j, p, q; + FT_Int x_max = x + bitmap->width; + FT_Int y_max = y + bitmap->rows; + + + /* for simplicity, we assume that `bitmap->pixel_mode' */ + /* is `FT_PIXEL_MODE_GRAY' (i.e., not a bitmap font) */ + + for ( i = x, p = 0; i < x_max; i++, p++ ) + { + for ( j = y, q = 0; j < y_max; j++, q++ ) + { + if ( i < 0 || j < 0 || + i >= WIDTH || j >= HEIGHT ) + continue; + + image[j][i] |= bitmap->buffer[q * bitmap->width + p]; + } + } +} + + +int +main( int argc, + char** argv ) +{ + FT_Library library; + FT_Face face; + + FT_GlyphSlot slot; + FT_Matrix matrix; /* transformation matrix */ + FT_Vector pen; /* untransformed origin */ + FT_Error error; + + char* filename; + char* text; + + double angle; + int target_height; + size_t n, num_chars; + + if (argc < 2) { + fprintf(stderr, "Usage: %s FONT\n", argv[0]); + return EXIT_FAILURE; + } + + filename = argv[1]; + text = "conan-center-index"; + num_chars = strlen( text ); + angle = ( 25.0 / 360 ) * 3.14159 * 2; /* use 25 degrees */ + target_height = HEIGHT; + + error = FT_Init_FreeType( &library ); /* initialize library */ + if (error) { + exit(EXIT_FAILURE); + } + + error = FT_New_Face( library, filename, 0, &face );/* create face object */ + if (error) { + exit(EXIT_FAILURE); + } + + /* use 50pt at 100dpi */ + error = FT_Set_Char_Size( face, 50 * 64, 0, 100, 0 ); + if (error) { + exit(EXIT_FAILURE); + } + + /* cmap selection omitted; */ + /* for simplicity we assume that the font contains a Unicode cmap */ + + slot = face->glyph; + + /* set up matrix */ + matrix.xx = (FT_Fixed)( cos( angle ) * 0x10000L ); + matrix.xy = (FT_Fixed)(-sin( angle ) * 0x10000L ); + matrix.yx = (FT_Fixed)( sin( angle ) * 0x10000L ); + matrix.yy = (FT_Fixed)( cos( angle ) * 0x10000L ); + + /* the pen position in 26.6 cartesian space coordinates; */ + /* start at (300,200) relative to the upper left corner */ + pen.x = 300 * 64; + pen.y = ( target_height - 200 ) * 64; + + for ( n = 0; n < num_chars; n++ ) + { + /* set transformation */ + FT_Set_Transform( face, &matrix, &pen ); + + /* load glyph image into the slot (erase previous one) */ + error = FT_Load_Char( face, text[n], FT_LOAD_RENDER); + if (error) { + exit(EXIT_FAILURE); + } + + /* now, draw to our target surface (convert position) */ + draw_bitmap( &slot->bitmap, + slot->bitmap_left, + target_height - slot->bitmap_top ); + + /* increment pen position */ + pen.x += slot->advance.x; + pen.y += slot->advance.y; + } + + FT_Done_Face ( face ); + FT_Done_FreeType( library ); + + return EXIT_SUCCESS; +} + +/* EOF */ diff --git a/recipes/freetype/meson/test_package_module/CMakeLists.txt b/recipes/freetype/meson/test_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..a6125556234ed --- /dev/null +++ b/recipes/freetype/meson/test_package_module/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(Freetype REQUIRED MODULE) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindFreetype.html +# are properly defined in conan generators +set(_custom_vars + FREETYPE_FOUND + FREETYPE_INCLUDE_DIRS + FREETYPE_LIBRARIES + FREETYPE_VERSION_STRING +) +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() + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Freetype::Freetype) diff --git a/recipes/freetype/meson/test_package_module/conanfile.py b/recipes/freetype/meson/test_package_module/conanfile.py new file mode 100644 index 0000000000000..ac4c13a76a824 --- /dev/null +++ b/recipes/freetype/meson/test_package_module/conanfile.py @@ -0,0 +1,29 @@ +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", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + license = "OFL-1.1-no-RFN" + short_paths = True + + 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") + font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", env="conanrun") diff --git a/recipes/gdcm/all/test_v1_package/CMakeLists.txt b/recipes/freetype/meson/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/gdcm/all/test_v1_package/CMakeLists.txt rename to recipes/freetype/meson/test_v1_package/CMakeLists.txt diff --git a/recipes/freetype/meson/test_v1_package/conanfile.py b/recipes/freetype/meson/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..fba25cb7ecbbc --- /dev/null +++ b/recipes/freetype/meson/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" + license = "OFL-1.1-no-RFN" + + 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") + font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", run_environment=True) diff --git a/recipes/freetype/meson/test_v1_package_module/CMakeLists.txt b/recipes/freetype/meson/test_v1_package_module/CMakeLists.txt new file mode 100644 index 0000000000000..8d5fc09fe6811 --- /dev/null +++ b/recipes/freetype/meson/test_v1_package_module/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package_module + ${CMAKE_CURRENT_BINARY_DIR}/test_package_module) diff --git a/recipes/freetype/meson/test_v1_package_module/conanfile.py b/recipes/freetype/meson/test_v1_package_module/conanfile.py new file mode 100644 index 0000000000000..1ddffa6741246 --- /dev/null +++ b/recipes/freetype/meson/test_v1_package_module/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" + license = "OFL-1.1-no-RFN" + + 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") + font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") + self.run(f"{bin_path} {font_path}", run_environment=True) diff --git a/recipes/freexl/all/conanfile.py b/recipes/freexl/all/conanfile.py index 6f97355b38f7c..7cbab97fd7d07 100644 --- a/recipes/freexl/all/conanfile.py +++ b/recipes/freexl/all/conanfile.py @@ -54,7 +54,7 @@ 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("expat/[>=2.6.2 <3]") self.requires("minizip/1.2.13") def build_requirements(self): diff --git a/recipes/freexl/all/test_package/CMakeLists.txt b/recipes/freexl/all/test_package/CMakeLists.txt index e92c3ad896b62..d69600f6cbbec 100644 --- a/recipes/freexl/all/test_package/CMakeLists.txt +++ b/recipes/freexl/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(freexl REQUIRED CONFIG) diff --git a/recipes/freexl/all/test_package/conanfile.py b/recipes/freexl/all/test_package/conanfile.py index fa2bdcf79755e..0a6bc68712d90 100644 --- a/recipes/freexl/all/test_package/conanfile.py +++ b/recipes/freexl/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - xls_path = os.path.join(self.source_folder, "simple2003_21.xls") - self.run(f"{bin_path} {xls_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/freexl/all/test_package/simple2003_21.xls b/recipes/freexl/all/test_package/simple2003_21.xls deleted file mode 100644 index 20e5d1313430a..0000000000000 Binary files a/recipes/freexl/all/test_package/simple2003_21.xls and /dev/null differ diff --git a/recipes/freexl/all/test_package/test_package.c b/recipes/freexl/all/test_package/test_package.c index 8c12ee6b6e6ed..17c8e6a9e25c3 100644 --- a/recipes/freexl/all/test_package/test_package.c +++ b/recipes/freexl/all/test_package/test_package.c @@ -1,317 +1,11 @@ -#include - -#include #include -#include - -int main(int argc, char **argv) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return -1; - } - - const void *handle; - int ret; - unsigned int info; - const char *worksheet_name; - unsigned short active_idx; - unsigned int num_rows; - unsigned short num_columns; - FreeXL_CellValue cell_value; - - ret = freexl_open(argv[1], &handle); - if (ret != FREEXL_OK) { - fprintf(stderr, "OPEN ERROR: %d\n", ret); - return -1; - } - - ret = freexl_get_info(handle, FREEXL_CFBF_VERSION, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for CFBF version: %d\n", ret); - return -3; - } - if (info != FREEXL_UNKNOWN) { - fprintf(stderr, "Unexpected CFBF_VERSION: %d\n", info); - return -4; - } - - ret = freexl_get_info(handle, FREEXL_CFBF_SECTOR_SIZE, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for sector size: %d\n", ret); - return -5; - } - if (info != FREEXL_UNKNOWN) { - fprintf(stderr, "Unexpected CFBF_SECTOR_SIZE: %d\n", info); - return -6; - } - - ret = freexl_get_info(handle, FREEXL_CFBF_FAT_COUNT, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for fat count: %d\n", ret); - return -7; - } - if (info != 0) { - fprintf(stderr, "Unexpected CFBF_FAT_COUNT: %d\n", info); - return -8; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_VERSION, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF version: %d\n", ret); - return -9; - } - if (info != FREEXL_BIFF_VER_2) { - fprintf(stderr, "Unexpected BIFF version: %d\n", info); - return -10; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_MAX_RECSIZE, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF record size: %d\n", ret); - return -11; - } - if (info != FREEXL_UNKNOWN) { - fprintf(stderr, "Unexpected BIFF max record size: %d\n", info); - return -12; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_DATEMODE, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF date mode: %d\n", ret); - return -13; - } - if (info != FREEXL_BIFF_DATEMODE_1900) { - fprintf(stderr, "Unexpected BIFF date mode: %d\n", info); - return -14; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_PASSWORD, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF password mode: %d\n", ret); - return -15; - } - if (info != FREEXL_BIFF_PLAIN) { - fprintf(stderr, "Unexpected BIFF password mode: %d\n", info); - return -16; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_CODEPAGE, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF codepage: %d\n", ret); - return -17; - } - if (info != FREEXL_BIFF_CP1252) { - fprintf(stderr, "Unexpected BIFF codepage: %d\n", info); - return -18; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_SHEET_COUNT, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF worksheet count: %d\n", ret); - return -19; - } - if (info != 1) { - fprintf(stderr, "Unexpected BIFF worksheet count: %d\n", info); - return -20; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_FORMAT_COUNT, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF format count: %d\n", ret); - return -21; - } - if (info != 10) { - fprintf(stderr, "Unexpected BIFF format count: %d\n", info); - return -22; - } - - ret = freexl_get_info(handle, FREEXL_BIFF_XF_COUNT, &info); - if (ret != FREEXL_OK) { - fprintf(stderr, "GET_INFO ERROR for BIFF extended format count: %d\n", ret); - return -23; - } - if (info != 6) { - fprintf(stderr, "Unexpected BIFF extended format count: %d\n", info); - return -24; - } - - /* We only have one worksheet, zero index */ - ret = freexl_get_worksheet_name(handle, 0, &worksheet_name); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting worksheet name: %d\n", ret); - return -25; - } - if (strcmp(worksheet_name, "Worksheet") != 0) { - fprintf(stderr, "Unexpected worksheet name: %s\n", worksheet_name); - return -26; - } - - ret = freexl_select_active_worksheet(handle, 0); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error setting active worksheet: %d\n", ret); - return -27; - } - - ret = freexl_get_active_worksheet(handle, &active_idx); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting active worksheet: %d\n", ret); - return -28; - } - if (active_idx != 0) { - fprintf(stderr, "Unexpected active sheet: %d\n", info); - return -29; - } - - ret = freexl_worksheet_dimensions(handle, &num_rows, &num_columns); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting worksheet dimensions: %d\n", ret); - return -30; - } - if ((num_rows != 4) || (num_columns != 6)) { - fprintf(stderr, "Unexpected active sheet dimensions: %u x %u\n", - num_rows, num_columns); - return -31; - } - - ret = freexl_get_cell_value(handle, 0, 0, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (0,0): %d\n", ret); - return -32; - } - if (cell_value.type != FREEXL_CELL_TEXT) { - fprintf(stderr, "Unexpected cell (0,0) type: %u\n", cell_value.type); - return -33; - } - if (strcmp(cell_value.value.text_value, "Column 1") != 0) { - fprintf(stderr, "Unexpected cell (0,0) value: %s\n", cell_value.value.text_value); - return -34; - } - - ret = freexl_get_cell_value(handle, 3, 0, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,0): %d\n", ret); - return -35; - } - if (cell_value.type != FREEXL_CELL_DOUBLE) { - fprintf(stderr, "Unexpected cell (3,0) type: %u\n", cell_value.type); - return -36; - } - if (cell_value.value.double_value != 3.14) { - fprintf(stderr, "Unexpected cell (3,0) value: %g\n", cell_value.value.double_value); - return -37; - } - - ret = freexl_get_cell_value(handle, 3, 1, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,1): %d\n", ret); - return -38; - } - if (cell_value.type != FREEXL_CELL_DOUBLE) { - fprintf(stderr, "Unexpected cell (3,1) type: %u\n", cell_value.type); - return -39; - } - if (cell_value.value.double_value != -56.3089) { - fprintf(stderr, "Unexpected cell (3,1) value: %g\n", cell_value.value.double_value); - return -40; - } - - ret = freexl_get_cell_value(handle, 3, 2, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,2): %d\n", ret); - return -41; - } - if (cell_value.type != FREEXL_CELL_DOUBLE) { - fprintf(stderr, "Unexpected cell (3,2) type: %u\n", cell_value.type); - return -42; - } - if (cell_value.value.double_value != 0.67) { - fprintf(stderr, "Unexpected cell (3,2) value: %g\n", cell_value.value.double_value); - return -43; - } - - ret = freexl_get_cell_value(handle, 3, 3, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,3): %d\n", ret); - return -44; - } - if (cell_value.type != FREEXL_CELL_DATE) { - fprintf(stderr, "Unexpected cell (3,3) type: %u\n", cell_value.type); - return -45; - } - if (strcmp(cell_value.value.text_value, "1967-10-01") != 0) { - fprintf(stderr, "Unexpected cell (3,3) value: %s\n", cell_value.value.text_value); - return -46; - } - - ret = freexl_get_cell_value(handle, 3, 4, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,4): %d\n", ret); - return -47; - } - if (cell_value.type != FREEXL_CELL_INT) { - fprintf(stderr, "Unexpected cell (3,4) type: %u\n", cell_value.type); - return -48; - } - if (cell_value.value.int_value != 4) { - fprintf(stderr, "Unexpected cell (3,4) value: %d\n", cell_value.value.int_value); - return -49; - } - - ret = freexl_get_cell_value(handle, 3, 5, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (3,5): %d\n", ret); - return -50; - } - if (cell_value.type != FREEXL_CELL_INT) { - fprintf(stderr, "Unexpected cell (3,5) type: %u\n", cell_value.type); - return -51; - } - if (cell_value.value.int_value != 237) { - fprintf(stderr, "Unexpected cell (3,5) value: %d\n", cell_value.value.int_value); - return -52; - } - - ret = freexl_get_cell_value(handle, 1, 5, &cell_value); - if (ret != FREEXL_OK) { - fprintf(stderr, "Error getting cell value (1,5): %d\n", ret); - return -53; - } - if (cell_value.type != FREEXL_CELL_TIME) { - fprintf(stderr, "Unexpected cell (1,5) type: %u\n", cell_value.type); - return -54; - } - if (strcmp(cell_value.value.text_value, "23:34:04") != 0) { - fprintf(stderr, "Unexpected cell (1,5) value: %s\n", cell_value.value.text_value); - return -55; - } +#include "freexl.h" - /* error cases */ - ret = freexl_get_cell_value(handle, 7, 3, &cell_value); - if (ret != FREEXL_ILLEGAL_CELL_ROW_COL) { - fprintf(stderr, "Unexpected result for (7,3): %d\n", ret); - return -56; - } - ret = freexl_get_cell_value(handle, 2, 99, &cell_value); - if (ret != FREEXL_ILLEGAL_CELL_ROW_COL) { - fprintf(stderr, "Unexpected result for (2,99): %d\n", ret); - return -57; - } - ret = freexl_get_cell_value(handle, 4, 2, &cell_value); - if (ret != FREEXL_ILLEGAL_CELL_ROW_COL) { - fprintf(stderr, "Unexpected result for (4,2): %d\n", ret); - return -58; - } - ret = freexl_get_cell_value(handle, 3, 6, &cell_value); - if (ret != FREEXL_ILLEGAL_CELL_ROW_COL) { - fprintf(stderr, "Unexpected result for (3,6): %d\n", ret); - return -59; - } - ret = freexl_close(handle); - if (ret != FREEXL_OK) { - fprintf(stderr, "CLOSE ERROR: %d\n", ret); - return -2; - } +int main() { + const void *handle; + int ret; + ret = freexl_open("", &handle); + freexl_close(handle); - return 0; } diff --git a/recipes/freexl/all/test_v1_package/CMakeLists.txt b/recipes/freexl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/freexl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/freexl/all/test_v1_package/conanfile.py b/recipes/freexl/all/test_v1_package/conanfile.py deleted file mode 100644 index 305903625c5ac..0000000000000 --- a/recipes/freexl/all/test_v1_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 = os.path.join("bin", "test_package") - xls_path = os.path.join(self.source_folder, os.pardir, "test_package", "simple2003_21.xls") - self.run(f"{bin_path} {xls_path}", run_environment=True) diff --git a/recipes/fribidi/all/test_package/CMakeLists.txt b/recipes/fribidi/all/test_package/CMakeLists.txt index 7afbb0e9ea3b3..3d7faa2cbc29f 100644 --- a/recipes/fribidi/all/test_package/CMakeLists.txt +++ b/recipes/fribidi/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(fribidi REQUIRED CONFIG) diff --git a/recipes/fribidi/all/test_v1_package/CMakeLists.txt b/recipes/fribidi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/fribidi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fribidi/all/test_v1_package/conanfile.py b/recipes/fribidi/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/fribidi/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_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/frozen/all/conandata.yml b/recipes/frozen/all/conandata.yml index 4d9b977925cb2..cf0083d308f87 100644 --- a/recipes/frozen/all/conandata.yml +++ b/recipes/frozen/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/serge-sans-paille/frozen/archive/1.2.0.tar.gz" + sha256: "ed8339c017d7c5fe019ac2c642477f435278f0dc643c1d69d3f3b1e95915e823" "1.1.1": url: "https://github.com/serge-sans-paille/frozen/archive/1.1.1.tar.gz" sha256: "f7c7075750e8fceeac081e9ef01944f221b36d9725beac8681cbd2838d26be45" diff --git a/recipes/frozen/all/test_package/CMakeLists.txt b/recipes/frozen/all/test_package/CMakeLists.txt index bf59d5df3d910..89771339ae209 100644 --- a/recipes/frozen/all/test_package/CMakeLists.txt +++ b/recipes/frozen/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(frozen REQUIRED CONFIG) diff --git a/recipes/frozen/all/test_v1_package/CMakeLists.txt b/recipes/frozen/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/frozen/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/frozen/all/test_v1_package/conanfile.py b/recipes/frozen/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/frozen/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_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/frozen/config.yml b/recipes/frozen/config.yml index 9234b604d8ed1..188555eba6e58 100644 --- a/recipes/frozen/config.yml +++ b/recipes/frozen/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.1": folder: all "1.0.1": diff --git a/recipes/frugally-deep/all/conandata.yml b/recipes/frugally-deep/all/conandata.yml index 04211f2fa9dd0..f21cbc6a6513e 100644 --- a/recipes/frugally-deep/all/conandata.yml +++ b/recipes/frugally-deep/all/conandata.yml @@ -1,22 +1,19 @@ sources: - "0.15.25-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.25-p0.tar.gz" - sha256: "d1204bc13ace603e97696aa7a1331d6af819c3a9b4952b4fd1e3d72dd8f524c3" - "0.15.24-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.24-p0.tar.gz" - sha256: "118b0219a3f17c6d5a3535874acb145ee2079fd309e1fb83884facc684810baf" - "0.15.19-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.19-p0.tar.gz" - sha256: "acaba428ae19ef8d57a53b3767373cd96770c190dd57909e52d2759be89ac942" - "0.15.18-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.18-p0.tar.gz" - sha256: "b721bd7b2fa842a1a10f00008e079c057fab7a5cfc4c394d64238ee59ad7e189" - "0.15.16-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.16-p0.tar.gz" - sha256: "778b8cf0da847239a2ad21c611331b231831c6c175154c68ca30dd87489336a5" - "0.15.13-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.13-p0.tar.gz" - sha256: "ca18c7b8dc0df3a36dba3c2578df35592e61ff51e5bbaa1c1ed3e6c529e14075" - "0.15.1-p0": - url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.1-p0.tar.gz" - sha256: "ab15cb540a8ddeffa56cd8235bfdf709f5d6b3b2543d9ec83658c5d9bad02f18" + "0.17.1": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.17.1.tar.gz" + sha256: "f3130dc0d01640e12ea7cb88e440ec9ac716b89ce45eae3f1d1eb937194c305f" + "0.16.2": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.16.2.tar.gz" + sha256: "b16af09606dcf02359de53b7c47323baaeda9a174e1c87e126c3127c55571971" + "0.16.0": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.16.0.tar.gz" + sha256: "5ffe8dddb43a645094b2ca1d48e4ee78e685fbef3c89f08cea8425a39dad9865" + "0.15.31": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.31.tar.gz" + sha256: "49bf5e30ad2d33e464433afbc8b6fe8536fc959474004a1ce2ac03d7c54bc8ba" + "0.15.30": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.30.tar.gz" + sha256: "8932f7b42612598402269a54f957af09084dc2cb812d32887d991d6e45b280fb" + "0.15.29": + url: "https://github.com/Dobiasd/frugally-deep/archive/v0.15.29.tar.gz" + sha256: "032cd525d4a7b9b3ebe28fd5e3984ac3e569da496f65d52c81030aabd9d0c52e" diff --git a/recipes/frugally-deep/all/conanfile.py b/recipes/frugally-deep/all/conanfile.py index 45f4704b4ab53..f2070b97639e6 100644 --- a/recipes/frugally-deep/all/conanfile.py +++ b/recipes/frugally-deep/all/conanfile.py @@ -39,8 +39,8 @@ def layout(self): def requirements(self): self.requires("eigen/3.4.0") - self.requires("functionalplus/0.2.20-p0") - self.requires("nlohmann_json/3.11.2") + self.requires("functionalplus/0.2.24") + self.requires("nlohmann_json/3.11.3") def package_id(self): self.info.clear() diff --git a/recipes/frugally-deep/all/test_v1_package/CMakeLists.txt b/recipes/frugally-deep/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/frugally-deep/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/frugally-deep/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_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 f442d1c950420..38f2a6e1c5da2 100644 --- a/recipes/frugally-deep/config.yml +++ b/recipes/frugally-deep/config.yml @@ -1,15 +1,13 @@ versions: - "0.15.25-p0": + "0.17.1": folder: all - "0.15.24-p0": + "0.16.2": folder: all - "0.15.19-p0": + "0.16.0": folder: all - "0.15.18-p0": + "0.15.31": folder: all - "0.15.16-p0": + "0.15.30": folder: all - "0.15.13-p0": - folder: all - "0.15.1-p0": + "0.15.29": folder: all diff --git a/recipes/frugen/all/conandata.yml b/recipes/frugen/all/conandata.yml new file mode 100644 index 0000000000000..cc18fdc792d99 --- /dev/null +++ b/recipes/frugen/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + "2.0": + url: "https://codeberg.org/IPMITool/frugen/archive/v2.0.tar.gz" + sha256: "cb5c59cf3593b162b9faedf1e5ae3b1f7e32fb732a61ada6baf7de69632bff77" +patches: + "2.0": + - patch_file: "patches/0001-cmake-use-find_package-to-locate-json-c-library.patch" + patch_description: "Upstream prefer to use pkg_check_modules instead of find_package to keep capatibility with old versions" + patch_type: "conan" + - patch_file: "patches/0002-libfru-fix-build-on-MacOS.patch" + patch_description: "Fixes build on MacOS" + patch_type: "portability" + - patch_file: "patches/0003-let-conan-choose-optimization-flags.patch" + patch_description: "Let Conan choose optimization flags" + patch_type: "conan" diff --git a/recipes/frugen/all/conanfile.py b/recipes/frugen/all/conanfile.py new file mode 100644 index 0000000000000..17b6eeec90bab --- /dev/null +++ b/recipes/frugen/all/conanfile.py @@ -0,0 +1,83 @@ +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, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=2.1" + +class FrugenConan(ConanFile): + name = "frugen" + description = "IPMI FRU Information generator / editor tool and library" + license = ("Apache-2.0", "GPL-2.0-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://codeberg.org/IPMITool/frugen" + topics = ("hardware", "ipmi", "fru") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_json": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_json": True + } + implements = ["auto_shared_fpic"] + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("MSVC not supported by the library") + + 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): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_json: + self.requires("json-c/0.18") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_SHARED_LIB"] = self.options.shared + tc.cache_variables["ENABLE_JSON"] = self.options.with_json + if self.settings.os != "Macos": + tc.cache_variables["BINARY_STATIC"] = not self.options.shared + tc.cache_variables["BINARY_32BIT"] = False + tc.cache_variables["DEBUG_OUTPUT"] = False + # Dont let CMake find doxygen and try to build documentation + tc.cache_variables["CMAKE_DISABLE_FIND_PACKAGE_Doxygen"] = True + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + if self.options.shared: + self.cpp_info.components["fru-shared"].libs = ["fru"] + else: + self.cpp_info.components["fru-static"].libs = ["fru"] diff --git a/recipes/frugen/all/patches/0001-cmake-use-find_package-to-locate-json-c-library.patch b/recipes/frugen/all/patches/0001-cmake-use-find_package-to-locate-json-c-library.patch new file mode 100644 index 0000000000000..a2f037fa6302d --- /dev/null +++ b/recipes/frugen/all/patches/0001-cmake-use-find_package-to-locate-json-c-library.patch @@ -0,0 +1,38 @@ +From 00ff4c451deaa70da84fbac8d810d94ef7d59ab9 Mon Sep 17 00:00:00 2001 +From: "Andrei K." +Date: Sun, 17 Nov 2024 11:32:43 +0400 +Subject: [PATCH] cmake: use find_package to locate json-c library + +Signed-off-by: Andrei K. +--- + CMakeLists.txt | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 086b827..763c0b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -115,17 +115,10 @@ else(BINARY_STATIC OR NOT BUILD_SHARED_LIB) + endif(BINARY_STATIC OR NOT BUILD_SHARED_LIB) + + if(ENABLE_JSON) +- find_package(PkgConfig) +- pkg_check_modules(json-c REQUIRED json-c) +- ++ find_package(json-c CONFIG REQUIRED) ++ message (STATUS "Using JSON Library found at " ${json-c_DIR}) + add_definitions(-D__HAS_JSON__) +- if(JSON_STATIC OR BINARY_STATIC) +- target_link_libraries(frugen ${json-c_STATIC_LIBRARIES}) +- else() +- target_link_libraries(frugen ${json-c_LIBRARIES}) +- endif() +- +- target_include_directories(frugen PRIVATE ${json-c_INCLUDE_DIRS}) ++ target_link_libraries(frugen json-c::json-c) + else(ENABLE_JSON) + message (WARNING "JSON library support *disabled*!") + endif(ENABLE_JSON) +-- +2.45.2 + diff --git a/recipes/frugen/all/patches/0002-libfru-fix-build-on-MacOS.patch b/recipes/frugen/all/patches/0002-libfru-fix-build-on-MacOS.patch new file mode 100644 index 0000000000000..39e84842b9ae0 --- /dev/null +++ b/recipes/frugen/all/patches/0002-libfru-fix-build-on-MacOS.patch @@ -0,0 +1,87 @@ +From b31cf1c79730d5f288cd10361a05eb6b01d0698e Mon Sep 17 00:00:00 2001 +From: "Andrei K." +Date: Sun, 17 Nov 2024 17:29:35 +0400 +Subject: [PATCH] libfru: fix build on MacOS + +* remove explicit include of : it should be included in +* redefine endiangs manipulation functions +* rename uuid_t structure since there is same named type defined on + MacOS +* add type casting for print off_t variable - there is no portable way + to pass off_t to printf + +Signed-off-by: Andrei K. +--- + fru.c | 21 +++++++++++++++++---- + frugen.c | 2 +- + 2 files changed, 18 insertions(+), 5 deletions(-) + +diff --git a/fru.c b/fru.c +index 01aaef9..c0f79d9 100644 +--- a/fru.c ++++ b/fru.c +@@ -26,7 +26,20 @@ + #include "fru-errno.h" + + #define _BSD_SOURCE +-#include ++ ++#if defined(__APPLE__) ++#include ++ ++#define htobe16(x) OSSwapHostToBigInt16(x) ++#define htole16(x) OSSwapHostToLittleInt16(x) ++#define be16toh(x) OSSwapBigToHostInt16(x) ++#define le16toh(x) OSSwapLittleToHostInt16(x) ++ ++#define htobe32(x) OSSwapHostToBigInt32(x) ++#define htole32(x) OSSwapHostToLittleInt32(x) ++#define be32toh(x) OSSwapBigToHostInt32(x) ++#define le32toh(x) OSSwapLittleToHostInt32(x) ++#endif + + #ifdef __STANDALONE__ + #include +@@ -1354,7 +1367,7 @@ typedef union __attribute__((packed)) { + uint8_t clock_seq_low; + uint8_t node[6]; + }; +-} uuid_t; ++} fru_uuid_t; + #pragma pack(pop) + + static bool is_mr_rec_valid(fru_mr_rec_t *rec, size_t limit, fru_flags_t flags) +@@ -1476,7 +1489,7 @@ int fru_mr_mgmt_str2rec(fru_mr_rec_t **rec, + int fru_mr_uuid2rec(fru_mr_rec_t **rec, const char *str) + { + size_t len; +- uuid_t uuid; ++ fru_uuid_t uuid; + + if (!str) return -EFAULT; + +@@ -1531,7 +1544,7 @@ int fru_mr_uuid2rec(fru_mr_rec_t **rec, const char *str) + int fru_mr_rec2uuid(char **str, fru_mr_mgmt_rec_t *mgmt, fru_flags_t flags) + { + size_t i; +- uuid_t uuid; ++ fru_uuid_t uuid; + + if (!mgmt || !str) { + return -EFAULT; +diff --git a/frugen.c b/frugen.c +index b0aa76f..36a0c78 100644 +--- a/frugen.c ++++ b/frugen.c +@@ -314,7 +314,7 @@ void load_from_binary_file(const char *fname, + fatal("Cannot allocate buffer"); + } + +- debug(2, "Reading the template file of size %lu...", statbuf.st_size); ++ debug(2, "Reading the template file of size %ld...", (long) statbuf.st_size); + if (read(fd, buffer, statbuf.st_size) != statbuf.st_size) { + fatal("Cannot read file"); + } +-- +2.45.2 + diff --git a/recipes/frugen/all/patches/0003-let-conan-choose-optimization-flags.patch b/recipes/frugen/all/patches/0003-let-conan-choose-optimization-flags.patch new file mode 100644 index 0000000000000..192ce4029c7b6 --- /dev/null +++ b/recipes/frugen/all/patches/0003-let-conan-choose-optimization-flags.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 763c0b3..0ce32df 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,8 +39,8 @@ option(ENABLE_JSON "enable JSON support" ON) + option(JSON_STATIC "link json-c library statically" OFF) + option(DEBUG_OUTPUT "show extra debug output" OFF) + +-set(CMAKE_C_FLAGS_RELEASE "-Os -Wall -Werror -Wfatal-errors") +-set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -Wall -Werror -Wfatal-errors") ++# set(CMAKE_C_FLAGS_RELEASE "-Os -Wall -Werror -Wfatal-errors") ++# set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -Wall -Werror -Wfatal-errors") + if(MSVC) + # warning level 4 + add_compile_options(/W4) diff --git a/recipes/frugen/all/test_package/CMakeLists.txt b/recipes/frugen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0398769665301 --- /dev/null +++ b/recipes/frugen/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(frugen REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) + +if(BUILD_SHARED_LIB) + target_link_libraries(${PROJECT_NAME} PRIVATE frugen::fru-shared) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE frugen::fru-static) +endif() diff --git a/recipes/frugen/all/test_package/conanfile.py b/recipes/frugen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..48f478322d8cc --- /dev/null +++ b/recipes/frugen/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +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" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED_LIB"] = self.dependencies['frugen'].options.shared + tc.generate() + deps = CMakeDeps(self) + deps.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") + self.run(bin_path, env="conanrun") diff --git a/recipes/frugen/all/test_package/test_package.c b/recipes/frugen/all/test_package/test_package.c new file mode 100644 index 0000000000000..b239825897989 --- /dev/null +++ b/recipes/frugen/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include "fru.h" + +int main(void) { + uint8_t buffer[64] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF}; + if (!find_fru_header(buffer, sizeof(buffer), FRU_NOFLAGS)) { + printf("Failed to find FRU information block"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/frugen/config.yml b/recipes/frugen/config.yml new file mode 100644 index 0000000000000..eab700ad534a3 --- /dev/null +++ b/recipes/frugen/config.yml @@ -0,0 +1,3 @@ +versions: + "2.0": + folder: all diff --git a/recipes/fruit/all/conanfile.py b/recipes/fruit/all/conanfile.py index 9ad222d0dcc88..2ad826874c3e8 100644 --- a/recipes/fruit/all/conanfile.py +++ b/recipes/fruit/all/conanfile.py @@ -4,13 +4,13 @@ from fnmatch import fnmatch from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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" +required_conan_version = ">=2.1" class FruitConan(ConanFile): @@ -100,6 +100,9 @@ def generate(self): tc.variables["CMAKE_CXX_STANDARD"] = 11 tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "3.7.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() tc = CMakeDeps(self) tc.generate() diff --git a/recipes/fruit/all/test_package/CMakeLists.txt b/recipes/fruit/all/test_package/CMakeLists.txt index a965663f9c6ad..f1146ddbf5e06 100644 --- a/recipes/fruit/all/test_package/CMakeLists.txt +++ b/recipes/fruit/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(fruit REQUIRED CONFIG) diff --git a/recipes/fruit/all/test_v1_package/CMakeLists.txt b/recipes/fruit/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7ea0378c83fe1..0000000000000 --- a/recipes/fruit/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/fruit/all/test_v1_package/conanfile.py b/recipes/fruit/all/test_v1_package/conanfile.py deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/fruit/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", "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/fswatch/all/conandata.yml b/recipes/fswatch/all/conandata.yml new file mode 100644 index 0000000000000..a068dc0bee813 --- /dev/null +++ b/recipes/fswatch/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.17.1.cci.20220902": + url: "https://github.com/emcrisostomo/fswatch/archive/ba411e0d0fabcd5cbf0881f1380482e2f5ab9f47.zip" + sha256: "278476f0f2178bf59dac494c07d6a9b9d181eac8d14f37d17eaf8c6d04a3b4d9" diff --git a/recipes/fswatch/all/conanfile.py b/recipes/fswatch/all/conanfile.py new file mode 100644 index 0000000000000..bede6a08e2e05 --- /dev/null +++ b/recipes/fswatch/all/conanfile.py @@ -0,0 +1,94 @@ +import os +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.files import get, copy, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.apple import is_apple_os +from conan.errors import ConanInvalidConfiguration + + +required_conan_version = ">=2.0.9" + + +class WatcherConan(ConanFile): + name = "fswatch" + description = "A cross-platform file change monitor with multiple backends" + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/emcrisostomo/fswatch" + topics = ("watch", "filesystem", "event", "monitor") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True + } + implements = ["auto_shared_fpic"] + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate_build(self): + if is_apple_os(self) and cross_building(self): + # INFO: Cmake error: "VERSION_GREATER_EQUAL" "9.0" Unknown arguments specified + raise ConanInvalidConfiguration(f"{self.ref} does not support cross-building on {self.settings.os}") + + def validate(self): + check_min_cppstd(self, 11) + if is_msvc(self): + # INFO: fswatch requires pthread always and fails CMake when using MSVC + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC due pthread requirement.") + + def requirements(self): + self.requires("libgettext/0.22") + + def build_requirements(self): + self.tool_requires("gettext/0.22.5") + + def _apply_patches(self): + # Remove hardcoded CXX standard + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD 11)", + "") + + # Dont compile tests + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_subdirectory(test/src)", + "") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._apply_patches() + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(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, "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")) + + def package_info(self): + self.cpp_info.libs = ["fswatch"] + self.cpp_info.set_property("cmake_file_name", "fswatch") + self.cpp_info.set_property("cmake_target_name", "fswatch::fswatch") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] + elif self.settings.os == "Macos": + self.cpp_info.frameworks = ["CoreFoundation", "CoreServices"] diff --git a/recipes/fswatch/all/test_package/CMakeLists.txt b/recipes/fswatch/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a4b5491d33cc7 --- /dev/null +++ b/recipes/fswatch/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(fswatch REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fswatch::fswatch) diff --git a/recipes/fswatch/all/test_package/conanfile.py b/recipes/fswatch/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cb428fdb55ba5 --- /dev/null +++ b/recipes/fswatch/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +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 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/fswatch/all/test_package/test_package.cpp b/recipes/fswatch/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..13d2528437ace --- /dev/null +++ b/recipes/fswatch/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main() { + const auto directory_children = fsw::get_directory_children("."); + + return EXIT_SUCCESS; +} diff --git a/recipes/fswatch/config.yml b/recipes/fswatch/config.yml new file mode 100644 index 0000000000000..21934360d84a7 --- /dev/null +++ b/recipes/fswatch/config.yml @@ -0,0 +1,3 @@ +versions: + "1.17.1.cci.20220902": + folder: all diff --git a/recipes/ftjam/all/test_v1_package/conanfile.py b/recipes/ftjam/all/test_v1_package/conanfile.py deleted file mode 100644 index 2c48aab90b45b..0000000000000 --- a/recipes/ftjam/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,32 +0,0 @@ -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 56009c498942c..1c758c9219d3b 100644 --- a/recipes/ftxui/all/conandata.yml +++ b/recipes/ftxui/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.0.2": + url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v6.0.2.tar.gz" + sha256: "ace3477a8dd7cdb911dbc75e7b43cdcc9cf1d4a3cc3fb41168ecc31c06626cb9" "5.0.0": url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v5.0.0.tar.gz" sha256: "a2991cb222c944aee14397965d9f6b050245da849d8c5da7c72d112de2786b5b" @@ -18,6 +21,10 @@ sources: url: "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v2.0.0.tar.gz" sha256: "d891695ef22176f0c09f8261a37af9ad5b262dd670a81e6b83661a23abc2c54f" patches: + "6.0.2": + - patch_file: "patches/6.0.2-0001-disable-pic.patch" + patch_description: "add runtime destionation for windows shared build" + patch_type: "conan" "4.1.1": - patch_file: "patches/4.1.1-0002-install-dll.patch" patch_description: "add runtime destionation for windows shared build" diff --git a/recipes/ftxui/all/patches/6.0.2-0001-disable-pic.patch b/recipes/ftxui/all/patches/6.0.2-0001-disable-pic.patch new file mode 100644 index 0000000000000..610a6598da4cc --- /dev/null +++ b/recipes/ftxui/all/patches/6.0.2-0001-disable-pic.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/ftxui_set_options.cmake b/cmake/ftxui_set_options.cmake +index 185739e..549022f 100644 +--- a/cmake/ftxui_set_options.cmake ++++ b/cmake/ftxui_set_options.cmake +@@ -53,7 +53,7 @@ function(ftxui_set_options library) + # does not add it when linking a static library. This is a problem when the + # static library is later linked into a shared library. + # Doing it helps some users. +- set_property(TARGET ${library} PROPERTY POSITION_INDEPENDENT_CODE ON) ++ # set_property(TARGET ${library} PROPERTY POSITION_INDEPENDENT_CODE ON) + + # Add as many warning as possible: + if (WIN32) diff --git a/recipes/ftxui/all/test_package/CMakeLists.txt b/recipes/ftxui/all/test_package/CMakeLists.txt index 44e0ebf683f7a..b53a7d988968f 100644 --- a/recipes/ftxui/all/test_package/CMakeLists.txt +++ b/recipes/ftxui/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(ftxui REQUIRED CONFIG) diff --git a/recipes/ftxui/all/test_v1_package/CMakeLists.txt b/recipes/ftxui/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/ftxui/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ftxui/all/test_v1_package/conanfile.py b/recipes/ftxui/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/ftxui/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/ftxui/config.yml b/recipes/ftxui/config.yml index 7747269b92a0d..d05f778845c9f 100644 --- a/recipes/ftxui/config.yml +++ b/recipes/ftxui/config.yml @@ -1,4 +1,6 @@ versions: + "6.0.2": + folder: all "5.0.0": folder: all "4.1.1": diff --git a/recipes/function2/all/test_package/CMakeLists.txt b/recipes/function2/all/test_package/CMakeLists.txt index 85a339e09a26c..44e68b94b245f 100644 --- a/recipes/function2/all/test_package/CMakeLists.txt +++ b/recipes/function2/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) diff --git a/recipes/function2/all/test_v1_package/CMakeLists.txt b/recipes/function2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/function2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/function2/all/test_v1_package/conanfile.py b/recipes/function2/all/test_v1_package/conanfile.py deleted file mode 100644 index 8037a9296cc42..0000000000000 --- a/recipes/function2/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -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/functionalplus/all/conandata.yml b/recipes/functionalplus/all/conandata.yml index 0abf05e252793..ce67a8c16c149 100644 --- a/recipes/functionalplus/all/conandata.yml +++ b/recipes/functionalplus/all/conandata.yml @@ -1,22 +1,13 @@ sources: - "0.2.20-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.20-p0.tar.gz" - sha256: "6a8e56bd7976b7d5a6a31001f36bc199c2997f1144994fa0b48a1a5b8497abbc" - "0.2.18-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.18-p0.tar.gz" - sha256: "ffc63fc86f89a205accafa85c35790eda307adf5f1d6d51bb7ceb5c5e21e013b" - "0.2.17-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.17-p0.tar.gz" - sha256: "c41514b24a81ad47a8f98b3ef3a3bd3fe8109085f7965e9678386b08721e3620" - "0.2.16": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.16-p0.tar.gz" - sha256: "6026e64260afbd6941aaf19559d6e5dc51cbb3e045ef8d8e158d96bcd8651ed6" - "0.2.15": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.15-p0.tar.gz" - sha256: "4c76104ec8f6da5e66ed768380bdf128e0ba01725056c40a3c1b850cf4b441ad" - "0.2.14-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.14-p0.tar.gz" - sha256: "68a0e715aa18d2fe558fede06d65ec125959895efe4d0ef21b102037c9864ba1" - "0.2.13-p0": - url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.13-p0.tar.gz" - sha256: "62f61ce6500859f0d77306b1644b5c6992287688de38e170b17b8a66b2448b54" + "0.2.25": + url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.25.tar.gz" + sha256: "9b5e24bbc92f43b977dc83efbc173bcf07dbe07f8718fc2670093655b56fcee3" + "0.2.24": + url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.24.tar.gz" + sha256: "446c63ac3f2045e7587f694501882a3d7c7b962b70bcc08deacf5777bdaaff8c" + "0.2.23": + url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.23.tar.gz" + sha256: "5c2d28d2ba7d0cdeab9e31bbf2e7f8a9d6f2ff6111a54bfc11d1b05422096f19" + "0.2.22": + url: "https://github.com/Dobiasd/FunctionalPlus/archive/v0.2.22.tar.gz" + sha256: "79378668dff6ffa8abc1abde2c2fe37dc6fe1ac040c55d5ee7886924fa6a1376" diff --git a/recipes/functionalplus/all/test_package/CMakeLists.txt b/recipes/functionalplus/all/test_package/CMakeLists.txt index ee3481206b2db..d873c5851a708 100644 --- a/recipes/functionalplus/all/test_package/CMakeLists.txt +++ b/recipes/functionalplus/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(FunctionalPlus REQUIRED CONFIG) diff --git a/recipes/functionalplus/all/test_v1_package/CMakeLists.txt b/recipes/functionalplus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index d0b01f5d3cd02..0000000000000 --- a/recipes/functionalplus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(FunctionalPlus REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE FunctionalPlus::fplus) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/functionalplus/all/test_v1_package/conanfile.py b/recipes/functionalplus/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/functionalplus/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_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/functionalplus/config.yml b/recipes/functionalplus/config.yml index bc5d04d53c4bd..1aa00fc767fdd 100644 --- a/recipes/functionalplus/config.yml +++ b/recipes/functionalplus/config.yml @@ -1,15 +1,9 @@ versions: - "0.2.20-p0": + "0.2.25": folder: all - "0.2.18-p0": + "0.2.24": folder: all - "0.2.17-p0": + "0.2.23": folder: all - "0.2.16": - folder: all - "0.2.15": - folder: all - "0.2.14-p0": - folder: all - "0.2.13-p0": + "0.2.22": folder: all diff --git a/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt b/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt index 5126c69942f53..1750affe490f1 100644 --- a/recipes/functions-framework-cpp/all/test_package/CMakeLists.txt +++ b/recipes/functions-framework-cpp/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(functions_framework_cpp REQUIRED CONFIG) diff --git a/recipes/fusepp/all/test_v1_package/CMakeLists.txt b/recipes/fusepp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/fusepp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 46d9d6bbaf311..0000000000000 --- a/recipes/fusepp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/fxdiv/all/test_package/CMakeLists.txt b/recipes/fxdiv/all/test_package/CMakeLists.txt index 4681666d5bdaf..3e2e36c341be2 100644 --- a/recipes/fxdiv/all/test_package/CMakeLists.txt +++ b/recipes/fxdiv/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 C) find_package(fxdiv REQUIRED CONFIG) diff --git a/recipes/fxdiv/all/test_v1_package/CMakeLists.txt b/recipes/fxdiv/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/fxdiv/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/fxdiv/all/test_v1_package/conanfile.py b/recipes/fxdiv/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/fxdiv/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_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/g3log/all/test_package/CMakeLists.txt b/recipes/g3log/all/test_package/CMakeLists.txt index c9d535ba3d96a..52aa14918dcc0 100644 --- a/recipes/g3log/all/test_package/CMakeLists.txt +++ b/recipes/g3log/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(g3log REQUIRED CONFIG) diff --git a/recipes/g3log/all/test_v1_package/CMakeLists.txt b/recipes/g3log/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/g3log/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/g3log/all/test_v1_package/conanfile.py b/recipes/g3log/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/g3log/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_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/gaia-ecs/all/conandata.yml b/recipes/gaia-ecs/all/conandata.yml new file mode 100644 index 0000000000000..0f7a267f7719c --- /dev/null +++ b/recipes/gaia-ecs/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.8.6": + url: "https://github.com/richardbiely/gaia-ecs/archive/refs/tags/v0.8.6.tar.gz" + sha256: "9CAC0AC6F2FB19DFFF07D097F5DC0A97FF1CA4AEC3405219CB2D2A03601AB03F" diff --git a/recipes/gaia-ecs/all/conanfile.py b/recipes/gaia-ecs/all/conanfile.py new file mode 100644 index 0000000000000..ad8069272b4bb --- /dev/null +++ b/recipes/gaia-ecs/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +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 GaiaConan(ConanFile): + name = "gaia-ecs" + description = "A simple and powerful entity component system (ECS) written in C++17 " + topics = ("gamedev", "performance", "entity", "ecs") + homepage = "https://github.com/richardbiely/gaia-ecs" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _min_cppstd(self): + return "17" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "10", + "clang": "7.0", + "apple-clang": "10.0", + "intel-cc": "2021.2" + } + + 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", 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): + if self.settings.os in ["FreeBSD", "Linux"]: + self.cpp_info.system_libs = ["pthread"] + + self.cpp_info.set_property("cmake_file_name", "gaia") + self.cpp_info.set_property("cmake_target_name", "gaia::gaia") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + # TODO: remove when v1 support drops + self.cpp_info.names["cmake_find_package"] = "gaia" + self.cpp_info.names["cmake_find_package_multi"] = "gaia" diff --git a/recipes/gaia-ecs/all/test_package/CMakeLists.txt b/recipes/gaia-ecs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b62628cb5b7d0 --- /dev/null +++ b/recipes/gaia-ecs/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(gaia REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE gaia::gaia) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/gaia-ecs/all/test_package/conanfile.py b/recipes/gaia-ecs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/gaia-ecs/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/gaia-ecs/all/test_package/test_package.cpp b/recipes/gaia-ecs/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..105e808a6373e --- /dev/null +++ b/recipes/gaia-ecs/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + gaia::ecs::World w; + gaia::ecs::Entity e = w.add(); + (void) w.valid(e); + return 0; +} diff --git a/recipes/gaia-ecs/config.yml b/recipes/gaia-ecs/config.yml new file mode 100644 index 0000000000000..5169c9c9c27e4 --- /dev/null +++ b/recipes/gaia-ecs/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.6": + folder: all diff --git a/recipes/gainput/all/test_package/CMakeLists.txt b/recipes/gainput/all/test_package/CMakeLists.txt index f0a0ee2f13583..92c5cd2b288a2 100644 --- a/recipes/gainput/all/test_package/CMakeLists.txt +++ b/recipes/gainput/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(gainput REQUIRED CONFIG) diff --git a/recipes/gainput/all/test_v1_package/CMakeLists.txt b/recipes/gainput/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7e3274020b8ef..0000000000000 --- a/recipes/gainput/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(gainput REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE gainput::gainput) diff --git a/recipes/gainput/all/test_v1_package/conanfile.py b/recipes/gainput/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/gainput/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_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/gamenetworkingsockets/all/CMakeLists.txt b/recipes/gamenetworkingsockets/all/CMakeLists.txt deleted file mode 100644 index 7a80c0b2c26dc..0000000000000 --- a/recipes/gamenetworkingsockets/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(TARGETS) - -add_subdirectory("source_subfolder") diff --git a/recipes/gamenetworkingsockets/all/conandata.yml b/recipes/gamenetworkingsockets/all/conandata.yml index 882c3ee20c6d7..44325d5f8a183 100644 --- a/recipes/gamenetworkingsockets/all/conandata.yml +++ b/recipes/gamenetworkingsockets/all/conandata.yml @@ -1,10 +1,4 @@ sources: - "1.3.0": - url: "https://github.com/ValveSoftware/GameNetworkingSockets/archive/refs/tags/v1.3.0.zip" - sha256: "22e409546babc449c44f492b253b547a2f5f11abe11a100686a10a990b5091cd" -patches: - "1.3.0": - - patch_file: "patches/001-disable-runtime-override.patch" - base_path: "source_subfolder" - - patch_file: "patches/002-either-static-or-shared.patch" - base_path: "source_subfolder" + "1.4.1": + url: "https://github.com/ValveSoftware/GameNetworkingSockets/archive/refs/tags/v1.4.1.tar.gz" + sha256: "1cfb2bf79c51a08ae4e8b7ff5e9c1266b43cfff6f53ecd3e7bc5e3fcb2a22503" diff --git a/recipes/gamenetworkingsockets/all/conanfile.py b/recipes/gamenetworkingsockets/all/conanfile.py index cb91ff14df39f..a00e706e2cc9e 100644 --- a/recipes/gamenetworkingsockets/all/conanfile.py +++ b/recipes/gamenetworkingsockets/all/conanfile.py @@ -1,109 +1,124 @@ -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.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rmdir, replace_in_file +from conan.tools.gnu import PkgConfigDeps + +required_conan_version = ">=1.53.0" class GameNetworkingSocketsConan(ConanFile): name = "gamenetworkingsockets" description = "GameNetworkingSockets is a basic transport layer for games." - topics = ("networking", "game-development") + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ValveSoftware/GameNetworkingSockets" - license = "BSD-3-Clause" - generators = "cmake", "pkg_config" - settings = "os", "arch", "compiler", "build_type" - exports_sources = ["CMakeLists.txt", "patches/**"] + topics = ("networking", "game-development") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "encryption": ["openssl", "libsodium", "bcrypt"] + "encryption": ["openssl", "libsodium", "bcrypt"], } - default_options = { "shared": False, "fPIC": True, - "encryption": "openssl" + "encryption": "openssl", } - _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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("protobuf/3.21.12") + if self.options.encryption == "openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.encryption == "libsodium": + self.requires("libsodium/1.0.20") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) if self.options.encryption == "bcrypt" and self.settings.os != "Windows": raise ConanInvalidConfiguration("bcrypt is only valid on Windows") def build_requirements(self): - self.build_requires("protobuf/3.17.1") + self.tool_requires("protobuf/") - def requirements(self): - self.requires("protobuf/3.17.1") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + venv = VirtualRunEnv(self) + venv.generate(scope="build") + + tc = CMakeToolchain(self) + tc.variables["GAMENETWORKINGSOCKETS_BUILD_EXAMPLES"] = False + tc.variables["GAMENETWORKINGSOCKETS_BUILD_TESTS"] = False + tc.variables["Protobuf_USE_STATIC_LIBS"] = not self.dependencies["protobuf"].options.shared + tc.variables["Protobuf_IMPORT_DIRS"] = os.path.join(self.source_folder, "src", "common").replace("\\", "/") + crypto = { + "openssl": "OpenSSL", + "libsodium": "libsodium", + "bcrypt": "BCrypt", + } + tc.variables["USE_CRYPTO"] = crypto[str(self.options.encryption)] + crypto25519 = { + "openssl": "OpenSSL", + "libsodium": "libsodium", + "bcrypt": "Reference", + } + tc.variables["USE_CRYPTO25519"] = crypto25519[str(self.options.encryption)] if self.options.encryption == "openssl": - self.requires("openssl/1.1.1l") - elif self.options.encryption == "libsodium": - self.requires("libsodium/1.0.18") + tc.variables["OPENSSL_NEW_ENOUGH"] = True + tc.variables["OPENSSL_HAS_25519_RAW"] = True + tc.generate() - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + tc = CMakeDeps(self) + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + # Disable MSVC runtime override + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "configure_msvc_runtime()", "") def build(self): self._patch_sources() - 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["BUILD_STATIC"] = not self.options.shared - self._cmake.definitions["BUILD_SHARED"] = self.options.shared - self._cmake.definitions["GAMENETWORKINGSOCKETS_BUILD_EXAMPLES"] = False - self._cmake.definitions["GAMENETWORKINGSOCKETS_BUILD_TESTS"] = False - self._cmake.definitions["Protobuf_USE_STATIC_LIBS"] = not self.options["protobuf"].shared - crypto = {"openssl": "OpenSSL", "libsodium": "libsodium", "bcrypt": "BCrypt"} - self._cmake.definitions["USE_CRYPTO"] = crypto[str(self.options.encryption)] - crypto25519 = {"openssl": "OpenSSL", "libsodium": "libsodium", "bcrypt": "Reference"} - self._cmake.definitions["USE_CRYPTO25519"] = crypto25519[str(self.options.encryption)] - if self.options.encryption == "openssl": - self._cmake.definitions["OPENSSL_NEW_ENOUGH"] = True - self._cmake.definitions["OPENSSL_HAS_25519_RAW"] = True - 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"] = "GameNetworkingSockets" - self.cpp_info.names["cmake_find_package_multi"] = "GameNetworkingSockets" - self.cpp_info.names["pkg_config"] = "GameNetworkingSockets" + self.cpp_info.set_property("cmake_file_name", "GameNetworkingSockets") + self.cpp_info.set_property("cmake_target_name", "GameNetworkingSockets::GameNetworkingSockets") + self.cpp_info.set_property("pkg_config_name", "GameNetworkingSockets") self.cpp_info.includedirs.append(os.path.join("include", "GameNetworkingSockets")) if self.options.shared: self.cpp_info.libs = ["GameNetworkingSockets"] @@ -120,7 +135,10 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] elif self.settings.os == "Windows": - self.cpp_info.system_libs = ["ws2_32", "crypt32", "winmm"] + self.cpp_info.system_libs = ["ws2_32", "crypt32", "winmm", "iphlpapi"] if self.options.encryption == "bcrypt": self.cpp_info.system_libs += ["bcrypt"] - + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "GameNetworkingSockets" + self.cpp_info.names["cmake_find_package_multi"] = "GameNetworkingSockets" diff --git a/recipes/gamenetworkingsockets/all/patches/001-disable-runtime-override.patch b/recipes/gamenetworkingsockets/all/patches/001-disable-runtime-override.patch deleted file mode 100644 index 652aea2685bb8..0000000000000 --- a/recipes/gamenetworkingsockets/all/patches/001-disable-runtime-override.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/tmp/CMakeLists.txt -index 3471701..49efee3 100644 ---- a/CMakeLists.txt -+++ b/tmp/CMakeLists.txt -@@ -35,7 +35,7 @@ endif() - - include(FlagsMSVC) - set(MSVC_RUNTIME "dynamic") --configure_msvc_runtime() -+# configure_msvc_runtime() - print_default_msvc_flags() - - add_definitions( -DVALVE_CRYPTO_ENABLE_25519 ) diff --git a/recipes/gamenetworkingsockets/all/patches/002-either-static-or-shared.patch b/recipes/gamenetworkingsockets/all/patches/002-either-static-or-shared.patch deleted file mode 100644 index 47b3eec1ee41e..0000000000000 --- a/recipes/gamenetworkingsockets/all/patches/002-either-static-or-shared.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 7040ab3..c75897e 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -282,28 +282,38 @@ macro(gamenetworkingsockets_common GNS_TARGET) - - endmacro() - -+if (BUILD_SHARED) - add_library(GameNetworkingSockets SHARED "") - add_library(GameNetworkingSockets::GameNetworkingSockets ALIAS GameNetworkingSockets) - add_library(GameNetworkingSockets::shared ALIAS GameNetworkingSockets) - gamenetworkingsockets_common(GameNetworkingSockets) - -+install( -+ TARGETS GameNetworkingSockets -+ EXPORT GameNetworkingSockets -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+) -+endif() -+ -+if (BUILD_STATIC) - add_library(GameNetworkingSockets_s STATIC "") - add_library(GameNetworkingSockets::GameNetworkingSockets_s ALIAS GameNetworkingSockets_s) - add_library(GameNetworkingSockets::static ALIAS GameNetworkingSockets_s) - target_compile_definitions(GameNetworkingSockets_s INTERFACE STEAMNETWORKINGSOCKETS_STATIC_LINK) - gamenetworkingsockets_common(GameNetworkingSockets_s) - --# Install rules -- - install( -- TARGETS -- GameNetworkingSockets -- GameNetworkingSockets_s -+ TARGETS GameNetworkingSockets_s - EXPORT GameNetworkingSockets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -- ) -+) -+endif() -+ -+# Install rules - - install(DIRECTORY ../include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GameNetworkingSockets) - diff --git a/recipes/gamenetworkingsockets/all/test_package/CMakeLists.txt b/recipes/gamenetworkingsockets/all/test_package/CMakeLists.txt index cb6bc1b893324..b45b07ce89114 100644 --- a/recipes/gamenetworkingsockets/all/test_package/CMakeLists.txt +++ b/recipes/gamenetworkingsockets/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(GameNetworkingSockets REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) target_link_libraries(${PROJECT_NAME} GameNetworkingSockets::GameNetworkingSockets) diff --git a/recipes/gamenetworkingsockets/all/test_package/conanfile.py b/recipes/gamenetworkingsockets/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/gamenetworkingsockets/all/test_package/conanfile.py +++ b/recipes/gamenetworkingsockets/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/gamenetworkingsockets/config.yml b/recipes/gamenetworkingsockets/config.yml index 426a0e4c79e9b..4709a2eb80f4c 100644 --- a/recipes/gamenetworkingsockets/config.yml +++ b/recipes/gamenetworkingsockets/config.yml @@ -1,3 +1,3 @@ versions: - "1.3.0": + "1.4.1": folder: all diff --git a/recipes/games101-cgl/all/conandata.yml b/recipes/games101-cgl/all/conandata.yml new file mode 100644 index 0000000000000..73b714f87c14e --- /dev/null +++ b/recipes/games101-cgl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/endingly/games101-cgl/archive/refs/tags/v0.1.0.zip" + sha256: dc17b76ed4f2d9222c17a75ab22e07f156f077d0a243f35539b4439cc0cb9ae9 diff --git a/recipes/games101-cgl/all/conanfile.py b/recipes/games101-cgl/all/conanfile.py new file mode 100644 index 0000000000000..370dac2201804 --- /dev/null +++ b/recipes/games101-cgl/all/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir, rm +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.55.0" + +class Games101CglConan(ConanFile): + name = "games101-cgl" + description = "The package is for Games101's homework8 subproject" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/endingly/games101-cgl" + topics = ("games101", "graphics") + 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("freetype/2.13.2") + self.requires("glew/2.2.0", transitive_headers=True) + self.requires("glfw/3.4", transitive_headers=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.25 <4.0.0]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + toolchain = CMakeToolchain(self) + toolchain.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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", "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): + suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["CGL" + suffix] + + self.cpp_info.set_property("cmake_file_name", "games101-cgl") + self.cpp_info.set_property("cmake_target_name", "games101-cgl::games101-cgl") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self.cpp_info.filenames["cmake_find_package"] = "games101-cgl" + self.cpp_info.filenames["cmake_find_package_multi"] = "games101-cgl" + self.cpp_info.names["cmake_find_package"] = "games101-cgl" + self.cpp_info.names["cmake_find_package_multi"] = "games101-cgl" diff --git a/recipes/games101-cgl/all/test_package/CMakeLists.txt b/recipes/games101-cgl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d1e06891ebc0 --- /dev/null +++ b/recipes/games101-cgl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(games101-cgl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE games101-cgl::games101-cgl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/games101-cgl/all/test_package/conanfile.py b/recipes/games101-cgl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fbb7f543162 --- /dev/null +++ b/recipes/games101-cgl/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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/games101-cgl/all/test_package/test_package.cpp b/recipes/games101-cgl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..94b4226d74ca7 --- /dev/null +++ b/recipes/games101-cgl/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int main() { + CGL::Vector2D vector{5, 4}; + std::cout << vector << '\n'; +} diff --git a/recipes/games101-cgl/config.yml b/recipes/games101-cgl/config.yml new file mode 100644 index 0000000000000..6c11a439d0bc2 --- /dev/null +++ b/recipes/games101-cgl/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: all diff --git a/recipes/gamma/all/test_package/CMakeLists.txt b/recipes/gamma/all/test_package/CMakeLists.txt index 98f55fe7ea287..4e6dc3a84952e 100644 --- a/recipes/gamma/all/test_package/CMakeLists.txt +++ b/recipes/gamma/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(gamma REQUIRED CONFIG) diff --git a/recipes/gamma/all/test_v1_package/CMakeLists.txt b/recipes/gamma/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/gamma/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gamma/all/test_v1_package/conanfile.py b/recipes/gamma/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/gamma/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_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/gcc/all/conanfile.py b/recipes/gcc/all/conanfile.py index 103152cf95e82..da18e51121b44 100644 --- a/recipes/gcc/all/conanfile.py +++ b/recipes/gcc/all/conanfile.py @@ -29,20 +29,23 @@ def configure(self): if self.settings.compiler in ["clang", "apple-clang"]: # Can't remove this from cxxflags with autotools - so get rid of it del self.settings.compiler.libcxx + + # https://github.com/gcc-mirror/gcc/blob/6b5248d15c6d10325c6cbb92a0e0a9eb04e3f122/libcody/configure#L2505C11-L2505C25 + del self.settings.compiler.cppstd def build_requirements(self): if self.settings.os == "Linux": # binutils recipe is broken for Macos, and Windows uses tools # distributed with msys/mingw - self.tool_requires("binutils/2.38") + self.tool_requires("binutils/2.42") self.tool_requires("flex/2.6.4") def requirements(self): self.requires("mpc/1.2.0") - self.requires("mpfr/4.1.0") - self.requires("gmp/6.2.1") - self.requires("zlib/1.2.13") - self.requires("isl/0.24") + self.requires("mpfr/4.2.0") + self.requires("gmp/6.3.0") + self.requires("zlib/[>=1.2.13 <2]") + self.requires("isl/0.26") def package_id(self): del self.info.settings.compiler diff --git a/recipes/gcem/all/conandata.yml b/recipes/gcem/all/conandata.yml index 5aa429fe457fd..08aecb09abbd3 100644 --- a/recipes/gcem/all/conandata.yml +++ b/recipes/gcem/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.18.0": + url: "https://github.com/kthohr/gcem/archive/v1.18.0.tar.gz" + sha256: "8e71a9f5b62956da6c409dda44b483f98c4a98ae72184f3aa4659ae5b3462e61" "1.17.0": url: "https://github.com/kthohr/gcem/archive/v1.17.0.tar.gz" sha256: "74cc499e2db247c32f1ce82fc22022d22e0f0a110ecd19281269289a9e78a6f8" diff --git a/recipes/gcem/all/test_package/CMakeLists.txt b/recipes/gcem/all/test_package/CMakeLists.txt index 434ba12e4a1c5..d2be8b1b6c53c 100644 --- a/recipes/gcem/all/test_package/CMakeLists.txt +++ b/recipes/gcem/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(gcem REQUIRED CONFIG) diff --git a/recipes/gcem/all/test_v1_package/CMakeLists.txt b/recipes/gcem/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/gcem/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gcem/all/test_v1_package/conanfile.py b/recipes/gcem/all/test_v1_package/conanfile.py deleted file mode 100644 index 071ca3ed857af..0000000000000 --- a/recipes/gcem/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_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/gcem/config.yml b/recipes/gcem/config.yml index f63fe5ab6f014..93586d1055a3b 100644 --- a/recipes/gcem/config.yml +++ b/recipes/gcem/config.yml @@ -1,4 +1,6 @@ versions: + "1.18.0": + folder: all "1.17.0": folder: all "1.16.0": diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index a2ce278d92965..95d7d28009f99 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -1,13 +1,13 @@ versions: - "3.7.0": + "3.10.3": folder: "post_3.5.0" - "3.5.2": + "3.8.3": folder: "post_3.5.0" - "3.5.1": + "3.7.3": + folder: "post_3.5.0" + "3.5.3": folder: "post_3.5.0" "3.4.3": folder: "pre_3.5.0" "3.4.1": folder: "pre_3.5.0" - "3.3.3": - 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 7c7f67a48db89..1a526ad3ffa0e 100644 --- a/recipes/gdal/post_3.5.0/CMakeLists.txt +++ b/recipes/gdal/post_3.5.0/CMakeLists.txt @@ -1,50 +1,7 @@ cmake_minimum_required(VERSION 3.15) project(gdal_cmake_wrapper) -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -include(CMakePushCheckState) - - -if (${GDAL_USE_POPPLER}) - find_package(poppler) - set(Poppler_VERSION_STRING ${poppler_VERSION}) - add_library(Poppler::Poppler ALIAS poppler::libpoppler) -endif() - -file(GLOB CONAN_GENERATED_CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Find*.cmake") -foreach(CMAKE_FILE ${CONAN_GENERATED_CMAKE_FILES}) - include(${CMAKE_FILE}) -endforeach() - -if (${GDAL_USE_ARROW}) - find_package(Arrow REQUIRED) - add_library(arrow_shared ALIAS arrow::arrow) -endif() - -if (${GDAL_USE_CRYPTOPP}) - find_package(cryptopp REQUIRED) - add_library(CRYPTOPP::CRYPTOPP ALIAS ${TARGET_FOR_CRYPTOPP}) -endif() - -if (${GDAL_USE_DEFLATE}) - find_package(libdeflate REQUIRED) - add_library(Deflate::Deflate ALIAS ${TARGET_FOR_DEFLATE}) -endif() - -if (${GDAL_USE_LZ4}) - find_package(lz4 REQUIRED) - add_library(LZ4::LZ4 ALIAS lz4::lz4) -endif() - -if (${GDAL_USE_BLOSC}) - find_package(c-blosc REQUIRED) - add_library(Blosc::Blosc ALIAS c-blosc::c-blosc) -endif() - -if (${GDAL_USE_OPENEXR}) +if (GDAL_USE_OPENEXR) find_package(Imath REQUIRED) find_package(OpenEXR REQUIRED) add_library(OpenEXR::IlmImf ALIAS OpenEXR::IlmThread) @@ -56,62 +13,4 @@ if (${GDAL_USE_OPENEXR}) target_include_directories(OpenEXR::OpenEXR INTERFACE ${OpenEXR_INCLUDE_DIR}) endif() -if (${GDAL_USE_FREEXL}) - find_package(freexl REQUIRED) - add_library(FREEXL::freexl ALIAS freexl::freexl) -endif() - -if (${GDAL_USE_OPENJPEG}) - add_library(OPENJPEG::OpenJPEG ALIAS OpenJPEG::OpenJPEG) -endif() - -if (${GDAL_USE_GIF}) - find_package(GIF REQUIRED) -endif() - -if (${GDAL_USE_CFITSIO}) - find_package(cfitsio) - add_library(CFITSIO::CFITSIO ALIAS cfitsio::cfitsio) -endif() - -if (${GDAL_USE_SQLITE3}) - find_package(SQLite3) -endif() - -if (${GDAL_USE_LIBXML2}) - find_package(LibXml2) -endif() - -if (${GDAL_USE_POSTGRESQL}) - find_package(PostgreSQL) - add_library(PostgreSQL::PostgreSQL ALIAS PostgreSQL::pq) -endif() - -if (${GDAL_USE_HDF5}) - find_package(HDF5) - set(HDF5_C_LIBRARIES HDF5::C) -endif() - -if ("${GDAL_CONAN_PACKAGE_FOR_MYSQL}" STREQUAL "libmysqlclient") - find_package(mysql REQUIRED) -endif() -if ("${GDAL_CONAN_PACKAGE_FOR_MYSQL}" STREQUAL "mariadb-connector-c") - find_package(mariadb-connector-c REQUIRED) -endif() - -if (${GDAL_USE_ZLIB}) - find_package(ZLIB) -endif() - -if ("${GDAL_CONAN_PACKAGE_FOR_JPEG}" STREQUAL "libjpeg-turbo") - find_package(libjpeg-turbo REQUIRED) - add_library(JPEG::JPEG ALIAS ${TARGET_FOR_JPEG}) -endif() - -if (${GDAL_USE_PCRE2}) - find_package(PCRE2 REQUIRED) - add_library(PCRE2::PCRE2-8 ALIAS PCRE2::8BIT) -endif() - - -add_subdirectory("source_subfolder") +add_subdirectory(src) diff --git a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake new file mode 100644 index 0000000000000..cc5455d748073 --- /dev/null +++ b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake @@ -0,0 +1,48 @@ +function(define_find_package2 pkgname include_file library_name) +endfunction() +function(find_package2 pkgname) + # Remove args unsupported by find_package() + list(REMOVE_ITEM ARGN OUT_DEPENDENCY _find_dependency) + # Force CONFIG mode + list(REMOVE_ITEM ARGN MODULE NO_CONFIG NO_MODULE) + string(TOUPPER ${pkgname} key) + if(DEFINED GDAL_USE_${key} AND NOT GDAL_USE_${key}) + set(${pkgname}_FOUND) + set(${key}_FOUND) + return() + endif() + find_package(${pkgname} ${ARGN} + QUIET + CONFIG + GLOBAL + # Forbid the use of system libs entirely + NO_DEFAULT_PATH + PATHS ${CMAKE_PREFIX_PATH} + ) + # Add variables with upper-case package name in addition to the default ones + set(targets "") + foreach(lib ${${pkgname}_LIBRARIES}) + if(TARGET ${lib}) + list(APPEND targets ${lib}) + endif() + endforeach() + # Add upper-case variables + set(${key}_DEFINITIONS "${${pkgname}_DEFINITIONS}" CACHE STRING "") + set(${key}_FOUND ${${pkgname}_FOUND} CACHE BOOL "") + set(${key}_INCLUDE_DIR "${${pkgname}_INCLUDE_DIR}" CACHE STRING "") + set(${key}_INCLUDE_DIRS "${${pkgname}_INCLUDE_DIRS}" CACHE STRING "") + set(${key}_LIBRARIES "${${pkgname}_LIBRARIES}" CACHE STRING "") + set(${key}_LIBRARY "${${pkgname}_LIBRARIES}" CACHE STRING "") + set(${key}_TARGET "${targets}" CACHE STRING "") + set(${key}_VERSION ${${pkgname}_VERSION} CACHE BOOL "") + + # Add as cache vars for global visibility + set(${pkgname}_FOUND ${${pkgname}_FOUND} CACHE BOOL "") + set(${pkgname}_TARGET "${targets}" CACHE STRING "") + set(${pkgname}_VERSION ${${pkgname}_VERSION_STRING} CACHE BOOL "") + + message(STATUS "Found ${pkgname}: ${${pkgname}_FOUND}") + message(STATUS " ${key}_TARGET: ${${key}_TARGET}") + message(STATUS " ${key}_LIBRARIES: ${${key}_LIBRARIES}") + message(STATUS " ${key}_INCLUDE_DIRS: ${${key}_INCLUDE_DIRS}") +endfunction() diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 6ac086393ccfd..bf09eacffdc09 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -1,20 +1,63 @@ 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" - "3.5.1": - url: "https://github.com/OSGeo/gdal/releases/download/v3.5.1/gdal-3.5.1.tar.gz" - sha256: "7c4406ca010dc8632703a0a326f39e9db25d9f1f6ebaaeca64a963e3fac123d1" + "3.10.3": + url: "https://github.com/OSGeo/gdal/releases/download/v3.10.3/gdal-3.10.3.tar.gz" + sha256: "e4bf7f104acbcb3e2d16c97fd1af2b92b28d0ba59d17d976e3ef08b794f4153b" + "3.8.3": + url: "https://github.com/OSGeo/gdal/releases/download/v3.8.3/gdal-3.8.3.tar.gz" + sha256: "f7a30387a8239e9da26200f787a02136df2ee6473e86b36d05ad682761a049ea" + "3.7.3": + url: "https://github.com/OSGeo/gdal/releases/download/v3.7.3/gdal-3.7.3.tar.gz" + sha256: "f66161e10b8b89a8a541cd760cd36d490114ed3f020a26db1489a6154db5d2be" + "3.5.3": + url: "https://github.com/OSGeo/gdal/releases/download/v3.5.3/gdal-3.5.3.tar.gz" + sha256: "a9ea0300d17e35bab71df4f16e62bb2fb8081caf994ab3ee0502ce4cf0d4e593" 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" - "3.5.1": - - patch_file: "patches/3.5.1/0-replace-find-package.patch" - base_path: "source_subfolder" + "3.10.3": + - patch_file: "patches/3.10.3/0-replace-find-package.patch" + patch_description: "Use custom version of find_package() for Conan deps" + patch_type: "conan" + - patch_file: "patches/3.10.3/1-do-not-force-private-linking.patch" + patch_description: "Fix private linking not working for some Conan dependencies" + patch_type: "conan" + - patch_file: "patches/3.10.3/2-allow-cycles-in-cmake-targets.patch" + patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" + patch_type: "conan" + - patch_file: "patches/3.10.3/3-use-arrow-version-for-parquet.patch" + patch_description: "Use Arrow version output from find_package() for Parquet and ArrowDataset" + patch_type: "conan" + "3.8.3": + - patch_file: "patches/3.8.1/0-replace-find-package.patch" + patch_description: "Use custom version of find_package() for Conan deps" + patch_type: "conan" + - patch_file: "patches/3.7.3/1-do-not-force-private-linking.patch" + patch_description: "Fix private linking not working for some Conan dependencies" + patch_type: "conan" + - patch_file: "patches/3.7.3/2-use-arrow-version-for-parquet.patch" + patch_description: "Use Arrow version output from find_package() for Parquet and ArrowDataset" + patch_type: "conan" + - patch_file: "patches/3.5.3/2-allow-cycles-in-cmake-targets.patch" + patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" + patch_type: "conan" + "3.7.3": + - patch_file: "patches/3.7.3/0-replace-find-package.patch" + patch_description: "Use custom version of find_package() for Conan deps" + patch_type: "conan" + - patch_file: "patches/3.7.3/1-do-not-force-private-linking.patch" + patch_description: "Fix private linking not working for some Conan dependencies" + patch_type: "conan" + - patch_file: "patches/3.7.3/2-use-arrow-version-for-parquet.patch" + patch_description: "Use Arrow version output from find_package() for Parquet and ArrowDataset" + patch_type: "conan" + - patch_file: "patches/3.5.3/2-allow-cycles-in-cmake-targets.patch" + patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" + patch_type: "conan" + "3.5.3": + - patch_file: "patches/3.5.3/0-replace-find-package.patch" + patch_description: "Use custom version of find_package() for Conan deps" + patch_type: "conan" + - patch_file: "patches/3.5.3/1-do-not-force-private-linking.patch" + patch_description: "Fix private linking not working for some Conan dependencies" + patch_type: "conan" + - patch_file: "patches/3.5.3/2-allow-cycles-in-cmake-targets.patch" + patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" + patch_type: "conan" diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 3e0847981c026..d8a99ed4aacda 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -1,43 +1,41 @@ +import os + 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 -import functools -import 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, copy, export_conandata_patches, get, rename, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=2.0.5" + class GdalConan(ConanFile): name = "gdal" description = "GDAL is an open source X/MIT licensed translator library " \ "for raster and vector geospatial data formats." license = "MIT" - topics = ("osgeo", "geospatial", "raster", "vector") - homepage = "https://github.com/OSGeo/gdal" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OSGeo/gdal" + topics = ("osgeo", "geospatial", "raster", "vector") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - - # A list of gdal dependencies can be taken from cmake/helpers/CheckDependentLibraries.cmake - # within gdal sources with the command: - # grep -E '^[ \t]*gdal_check_package\(' cmake/helpers/CheckDependentLibraries.cmake \ - # | sed 's/[ \t]*gdal_check_package(\([a-zA-Z_0-9]\+\) "\(.*\)"\(.*\)/{ 'dep': \'\1\', 'descr': \'\2\' },/' \ - # | sort | uniq - options = { "shared": [True, False], "fPIC": [True, False], "tools": [True, False], "with_armadillo": [True, False], "with_arrow": [True, False], + "with_basisu": [True, False], "with_blosc": [True, False], + "with_brunsli": [True, False], "with_cfitsio": [True, False], - # with_cypto option has been renamed with_openssl in version 3.5.1 - "with_crypto": [True, False, "deprecated"], "with_cryptopp": [True, False], "with_curl": [True, False], "with_dds": [True, False], + "with_ecw": [True, False], "with_expat": [True, False], "with_exr": [True, False], "with_freexl": [True, False], @@ -47,48 +45,62 @@ class GdalConan(ConanFile): "with_hdf4": [True, False], "with_hdf5": [True, False], "with_heif": [True, False], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo"], + "with_jxl": [True, False], "with_kea": [True, False], + "with_lerc": [True, False], + "with_libaec": [True, False], + "with_libarchive": [True, False], + "with_libcsf": [True, False], "with_libdeflate": [True, False], "with_libiconv": [True, False], - "with_jpeg": [None, "libjpeg", "libjpeg-turbo"], "with_libkml": [True, False], - "with_libtiff": [True, False], + "with_lzma": [True, False], "with_lz4": [True, False], "with_mongocxx": [True, False], - "with_mysql": [None, "libmysqlclient", "mariadb-connector-c"], + "with_mysql": [False, "libmysqlclient", "mariadb-connector-c"], "with_netcdf": [True, False], "with_odbc": [True, False], + "with_opencad": [True, False], + "with_opencl": [True, False], "with_openjpeg": [True, False], "with_openssl": [True, False], "with_pcre": [True, False], "with_pcre2": [True, False], + # "with_pdfium": [True, False], "with_pg": [True, False], "with_png": [True, False], "with_podofo": [True, False], "with_poppler": [True, False], - "with_proj": [True, False], + "with_publicdecompwt": [True, False], "with_qhull": [True, False], + "with_rasterlite2": [True, False], + "with_shapelib": [True, False], + "with_spatialite": [True, False], "with_sqlite3": [True, False], + "with_tiledb": [True, False], "with_webp": [True, False], "with_xerces": [True, False], "with_xml2": [True, False], - "with_zlib": [True, False], "with_zstd": [True, False], + "gdal_optional_drivers": [True, False], + "ogr_optional_drivers": [True, False], } - default_options = { "shared": False, "fPIC": True, "tools": False, "with_armadillo": False, - "with_arrow": False, + "with_arrow": True, + "with_basisu": False, "with_blosc": False, + "with_brunsli": False, "with_cfitsio": False, - "with_crypto": "deprecated", "with_cryptopp": False, - "with_curl": False, + "with_curl": True, "with_dds": False, - "with_expat": False, + "with_ecw": False, + "with_expat": True, "with_exr": False, "with_freexl": False, "with_geos": True, @@ -97,215 +109,222 @@ class GdalConan(ConanFile): "with_hdf4": False, "with_hdf5": False, "with_heif": False, + "with_jpeg": "libjpeg", + "with_jxl": False, "with_kea": False, + "with_lerc": True, + "with_libaec": False, + "with_libarchive": False, + "with_libcsf": True, "with_libdeflate": True, "with_libiconv": True, - "with_jpeg": "libjpeg", "with_libkml": False, - "with_libtiff": True, + "with_lzma": False, "with_lz4": False, "with_mongocxx": False, - "with_mysql": None, + "with_mysql": False, "with_netcdf": False, "with_odbc": False, + "with_opencad": False, + "with_opencl": True, "with_openjpeg": False, "with_openssl": False, "with_pcre": False, "with_pcre2": False, + # "with_pdfium": False, "with_pg": False, "with_png": True, "with_podofo": False, "with_poppler": False, - "with_proj": True, + "with_publicdecompwt": False, "with_qhull": True, + "with_rasterlite2": False, + "with_shapelib": True, + "with_spatialite": False, "with_sqlite3": True, + "with_tiledb": False, "with_webp": False, "with_xerces": False, "with_xml2": False, - "with_zlib": True, "with_zstd": False, + "gdal_optional_drivers": True, + "ogr_optional_drivers": True, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build" - 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) + copy(self, "*.cmake", + src=os.path.join(self.recipe_folder, "cmake"), + dst=os.path.join(self.export_sources_folder, "src", "cmake", "helpers")) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "3.7": + # Latest versions of Arrow are no longer compatible with GDAL 3.5 + self.options.with_arrow = False + if Version(self.version) < "3.8": + del self.options.with_libaec def configure(self): - if self.options.with_crypto != "deprecated": - self.output.error("with_crypto option is deprecated, use with_openssl instead.") - if self.options.shared: - try: - del self.options.fPIC - except: - pass + self.options.rm_safe("fPIC") + + # Newer gdal requires this flag for + # ogr/ogrsf_frmts/parquet build correctly + if self.options.with_arrow and Version(self.version) >= "3.10.0": + self.options["arrow"].filesystem_layer = True + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("json-c/0.16") + self.requires("json-c/0.17") self.requires("libgeotiff/1.7.1") - + self.requires("libtiff/4.6.0") + self.requires("proj/9.3.1") + # Used in a public header here: + # https://github.com/OSGeo/gdal/blob/v3.7.1/port/cpl_minizip_ioapi.h#L26 + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) if self.options.with_armadillo: - self.requires("armadillo/10.7.3") - + self.requires("armadillo/12.6.4") if self.options.with_arrow: - self.requires("arrow/8.0.1") - + self.requires("arrow/14.0.2") + if self.options.with_basisu: + self.requires("libbasisu/1.15.0") if self.options.with_blosc: - self.requires("c-blosc/1.21.1") - + self.requires("c-blosc/1.21.5") + if self.options.with_brunsli: + self.requires("brunsli/cci.20231024") if self.options.with_cfitsio: - self.requires("cfitsio/4.1.0") - + self.requires("cfitsio/4.3.1") if self.options.with_cryptopp: - self.requires("cryptopp/8.7.0") - + self.requires("cryptopp/8.9.0") if self.options.with_curl: - self.requires("libcurl/8.2.0") - + self.requires("libcurl/[>=7.78 <9]") if self.options.with_dds: self.requires("crunch/cci.20190615") - + if self.options.with_ecw: + self.requires("libecwj2/3.3") if self.options.with_expat: - self.requires("expat/2.5.0") - + self.requires("expat/[>2.6.2 <3]") if self.options.with_exr: - self.requires("openexr/3.1.9") + self.requires("openexr/3.2.1") self.requires("imath/3.1.9") - if self.options.with_freexl: - self.requires("freexl/1.0.6") - + self.requires("freexl/2.0.0") if self.options.with_geos: - self.requires("geos/3.11.1") - + self.requires("geos/3.12.0") if self.options.with_gif: self.requires("giflib/5.2.1") - if self.options.with_gta: self.requires("libgta/1.2.1") - if self.options.with_hdf4: - self.requires("hdf4/4.2.15") - + self.requires("hdf4/4.2.16-2") if self.options.with_hdf5: - self.requires("hdf5/1.13.1") - + self.requires("hdf5/1.14.3") 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") + 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") + if self.options.with_jxl: + self.requires("libjxl/0.6.1") if self.options.with_kea: self.requires("kealib/1.4.14") - + if self.options.with_lerc: + self.requires("lerc/4.0.1") + if self.options.get_safe("with_libaec"): + self.requires("libaec/1.0.6") + if self.options.with_libarchive: + self.requires("libarchive/3.7.2") if self.options.with_libdeflate: - self.requires("libdeflate/1.18") - + self.requires("libdeflate/[>=1.19 <=1.22]") #tested with these if self.options.with_libiconv: self.requires("libiconv/1.17") - if self.options.with_libkml: self.requires("libkml/1.3.0") - - if self.options.with_libtiff: - self.requires("libtiff/4.5.1") - + if self.options.with_lzma: + self.requires("xz_utils/[>=5.4.5 <6]") if self.options.with_lz4: self.requires("lz4/1.9.4") - if self.options.with_mongocxx: - self.requires("mongo-cxx-driver/3.6.7") - + self.requires("mongo-cxx-driver/3.8.1") if self.options.with_mysql == "libmysqlclient": - self.requires("libmysqlclient/8.0.30") + self.requires("libmysqlclient/8.1.0") elif self.options.with_mysql == "mariadb-connector-c": - self.requires("mariadb-connector-c/3.1.12") - + self.requires("mariadb-connector-c/3.3.3") if self.options.with_netcdf: self.requires("netcdf/4.8.1") - if self.options.with_odbc: self.requires("odbc/2.3.11") - + if self.options.with_opencl: + self.requires("opencl-icd-loader/2023.12.14") if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") - if self.options.with_openssl: - self.requires("openssl/1.1.1u") - + self.requires("openssl/[>=1.1 <4]") if self.options.with_pcre: self.requires("pcre/8.45") - if self.options.with_pcre2: self.requires("pcre2/10.42") - + # TODO: pdfium recipe needs to be compatible with https://github.com/rouault/pdfium_build_gdal_3_8 + # if self.options.with_pdfium: + # self.requires("pdfium/95.0.4629") if self.options.with_pg: - self.requires("libpq/14.5") - + # libpq 15+ is not supported + self.requires("libpq/14.9") if self.options.with_png: - self.requires("libpng/1.6.40") - + self.requires("libpng/[>=1.6 <2]") if self.options.with_podofo: self.requires("podofo/0.9.7") - if self.options.with_poppler: self.requires("poppler/21.07.0") - - if self.options.with_proj: - self.requires("proj/9.1.1") - if self.options.with_qhull: self.requires("qhull/8.0.1") - + if self.options.with_rasterlite2: + self.requires("librasterlite2/1.1.0-beta1") + if self.options.with_spatialite: + self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.42.0") - + self.requires("sqlite3/[>=3.44 <4]") + if self.options.with_tiledb: + self.requires("tiledb/2.17.4") if self.options.with_webp: - self.requires("libwebp/1.3.1") - + self.requires("libwebp/1.3.2") if self.options.with_xerces: - self.requires("xerces-c/3.2.3") - + self.requires("xerces-c/3.2.5") if self.options.with_xml2: - self.requires("libxml2/2.10.3") - - if self.options.with_zlib: - self.requires("zlib/1.2.13") - + self.requires("libxml2/[>=2.12.5 <3]") if self.options.with_zstd: - self.requires("zstd/1.5.5") + self.requires("zstd/[>=1.5 <1.6]") + # Use of external shapelib is not recommended and is currently broken. + # https://github.com/OSGeo/gdal/issues/5711 + # if self.options.with_shapelib: + # self.requires("shapelib/1.6.0") 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 - def validate(self): - if self.options.get_safe("with_pcre") and self.options.get_safe("with_pcre2"): + if Version(self.version) >= "3.10.0": + check_min_cppstd(self, 17) + else: + check_min_cppstd(self, 11) + + for option in ["crypto", "zlib", "proj", "libtiff"]: + if self.options.get_safe(f"with_{option}") != "deprecated": + self.output.warning(f"{self.ref}:with_{option} option is deprecated. The {option} dependecy is always enabled now.") + if self.options.with_pcre and self.options.with_pcre2: raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both") - if self.options.get_safe("with_sqlite3") and not self.options["sqlite3"].enable_column_metadata: + if self.options.with_sqlite3 and not self.dependencies["sqlite3"].options.enable_column_metadata: raise ConanInvalidConfiguration("gdql requires sqlite3:enable_column_metadata=True") - if self.options.get_safe("with_libtiff") and self.options["libtiff"].jpeg != self.options.get_safe("with_jpeg"): + if self.dependencies["libtiff"].options.jpeg != self.options.with_jpeg: msg = "libtiff:jpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." # For some reason, the ConanInvalidConfiguration message is not shown, only # ERROR: At least two recipes provides the same functionality: @@ -314,591 +333,490 @@ def validate(self): self.output.error(msg) raise ConanInvalidConfiguration(msg) - if self.options.get_safe("with_poppler") and self.options["poppler"].with_libjpeg != self.options.get_safe("with_jpeg"): + if self.options.with_poppler and self.dependencies["poppler"].options.with_libjpeg != self.options.with_jpeg: msg = "poppler:with_libjpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." self.output.error(msg) raise ConanInvalidConfiguration(msg) - 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) - - if self.options.get_safe("fPIC", True): - cmake.definitions[ - "GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = True - - cmake.definitions["BUILD_JAVA_BINDINGS"] = False - cmake.definitions["BUILD_CSHARP_BINDINGS"] = False - cmake.definitions["BUILD_PYTHON_BINDINGS"] = False - - cmake.definitions["BUILD_TESTING"] = False - cmake.definitions["GDAL_USE_ZLIB_INTERNAL"] = False - cmake.definitions["GDAL_USE_JSONC_INTERNAL"] = False - cmake.definitions["GDAL_USE_JPEG_INTERNAL"] = False - cmake.definitions["GDAL_USE_JPEG12_INTERNAL"] = False - cmake.definitions["GDAL_USE_TIFF_INTERNAL"] = False - cmake.definitions["GDAL_USE_GEOTIFF_INTERNAL"] = False - cmake.definitions["GDAL_USE_GIF_INTERNAL"] = False - cmake.definitions["GDAL_USE_PNG_INTERNAL"] = False - - cmake.definitions["GDAL_USE_LERC_INTERNAL"] = True - cmake.definitions["GDAL_USE_SHAPELIB_INTERNAL"] = True - - cmake.definitions["BUILD_APPS"] = self.options.tools - - cmake.definitions["SQLite3_HAS_COLUMN_METADATA"] = \ - self.options["sqlite3"].enable_column_metadata - - cmake.definitions["SQLite3_HAS_RTREE"] = self.options[ - "sqlite3"].enable_rtree - - cmake.definitions["GDAL_USE_JSONC"] = True - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_JSONC"] = "json-c" - - cmake.definitions["GDAL_USE_GEOTIFF"] = True - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GEOTIFF"] = "libgeotiff" - cmake.definitions["TARGET_FOR_GEOTIFF"] = "GeoTIFF::GeoTIFF" - - cmake.definitions["GDAL_USE_ARMADILLO"] = self.options.with_armadillo - if self.options.with_armadillo: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ARMADILLO"] = "armadillo" - cmake.definitions["TARGET_FOR_ARMADILLO"] = \ - self.dependencies["armadillo"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["Armadillo_FOUND"] = False - - cmake.definitions["GDAL_USE_ARROW"] = self.options.with_arrow - if self.options.with_arrow: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ARROW"] = "arrow" - cmake.definitions["TARGET_FOR_ARROW"] = \ - self.dependencies["arrow"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["Arrow_FOUND"] = False - - cmake.definitions["GDAL_USE_BLOSC"] = self.options.with_blosc - if self.options.with_blosc: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_BLOSC"] = "c-blosc" - cmake.definitions["TARGET_FOR_BLOSC"] = \ - self.dependencies["c-blosc"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["Blosc_FOUND"] = False - - cmake.definitions["GDAL_USE_CFITSIO"] = self.options.with_cfitsio - if self.options.with_cfitsio: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CFITSIO"] = "cfitsio" - cmake.definitions["TARGET_FOR_CFITSIO"] = \ - self.dependencies["cfitsio"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["CFITSIO_FOUND"] = False - - cmake.definitions["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp - if self.options.with_cryptopp: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CRYPTOPP"] = "cryptopp" - cmake.definitions["TARGET_FOR_CRYPTOPP"] = \ - self.dependencies["cryptopp"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["CryptoPP_FOUND"] = False - - cmake.definitions["GDAL_USE_CURL"] = self.options.with_curl - if self.options.with_curl: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CURL"] = "libcurl" - cmake.definitions["TARGET_FOR_CURL"] = \ - self.dependencies["libcurl"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["CURL_FOUND"] = False - - cmake.definitions["GDAL_USE_CRNLIB"] = self.options.with_dds - if self.options.with_dds: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CRNLIB"] = "crunch" - cmake.definitions["TARGET_FOR_CRNLIB"] = \ - self.dependencies["crunch"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["Crnlib_FOUND"] = False - - cmake.definitions["GDAL_USE_EXPAT"] = self.options.with_expat - if self.options.with_expat: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_EXPAT"] = "expat" - cmake.definitions["TARGET_FOR_EXPAT"] = "EXPAT::EXPAT" - else: - cmake.definitions["EXPAT_FOUND"] = False - - cmake.definitions["GDAL_USE_OPENEXR"] = self.options.with_exr - if self.options.with_exr: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENEXR"] = "openexr" - cmake.definitions["TARGET_FOR_OPENEXR"] = \ - self.dependencies["openexr"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["OpenEXR_FOUND"] = False - - cmake.definitions["GDAL_USE_FREEXL"] = self.options.with_freexl - if self.options.with_freexl: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_FREEXL"] = "freexl" - cmake.definitions["TARGET_FOR_FREEXL"] = "freexl::freexl" - else: - cmake.definitions["FreeXL_FOUND"] = False - - cmake.definitions["GDAL_USE_GEOS"] = self.options.with_geos - if self.options.with_geos: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GEOS"] = "geos" - cmake.definitions["TARGET_FOR_GEOS"] = \ - self.dependencies["geos"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["GEOS_FOUND"] = False - - cmake.definitions["GDAL_USE_GIF"] = self.options.with_gif - if self.options.with_gif: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GIF"] = "giflib" - cmake.definitions["TARGET_FOR_GIF"] = \ - self.dependencies["giflib"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["GIF_FOUND"] = False - - cmake.definitions["GDAL_USE_GTA"] = self.options.with_gta - if self.options.with_gta: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GTA"] = "libgta" - cmake.definitions["TARGET_FOR_GTA"] = \ - self.dependencies["libgta"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["GTA_FOUND"] = False - - cmake.definitions["GDAL_USE_HDF4"] = self.options.with_hdf4 - if self.options.with_hdf4: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HDF4"] = "hdf4" - cmake.definitions["TARGET_FOR_HDF4"] = \ - self.dependencies["hdf4"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["HDF4_FOUND"] = False - - cmake.definitions["GDAL_USE_HDF5"] = self.options.with_hdf5 - if self.options.with_hdf5: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HDF5"] = "hdf5" - cmake.definitions["TARGET_FOR_HDF5"] = \ - self.dependencies["hdf5"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["HDF5_FOUND"] = False - - cmake.definitions["GDAL_USE_HEIF"] = self.options.with_heif - if self.options.with_heif: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HEIF"] = "libheif" - cmake.definitions["TARGET_FOR_HEIF"] = \ - self.dependencies["libheif"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["HEIF_FOUND"] = False - - cmake.definitions["GDAL_USE_KEA"] = self.options.with_kea - if self.options.with_kea: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_KEA"] = "kealib" - cmake.definitions["TARGET_FOR_KEA"] = \ - self.dependencies["kealib"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["KEA_FOUND"] = False - - cmake.definitions["GDAL_USE_DEFLATE"] = self.options.with_libdeflate - if self.options.with_libdeflate: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_DEFLATE"] = "libdeflate" - cmake.definitions["TARGET_FOR_DEFLATE"] = \ - self.dependencies["libdeflate"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["Deflate_FOUND"] = False - - cmake.definitions["GDAL_USE_ICONV"] = self.options.with_libiconv - if self.options.with_libiconv: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ICONV"] = "libiconv" - cmake.definitions["TARGET_FOR_ICONV"] = \ - self.dependencies["libiconv"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["Iconv_FOUND"] = False - - if self.options.with_jpeg == "libjpeg" or self.options.with_jpeg == "libjpeg-turbo": - print(f'self.options.with_jpeg: {self.options.with_jpeg}') - cmake.definitions["GDAL_USE_JPEG"] = True - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_JPEG"] = self.options.with_jpeg - cmake.definitions["TARGET_FOR_JPEG"] = ( - "JPEG::JPEG" if self.options.with_jpeg == "libjpeg" else - self.dependencies["libjpeg-turbo"].cpp_info.components["turbojpeg"] \ - .get_property("cmake_target_name")) - else: - cmake.definitions["JPEG_FOUND"] = False - - cmake.definitions["GDAL_USE_LIBKML"] = self.options.with_libkml - if self.options.with_libkml: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LIBKML"] = "libkml" - cmake.definitions["TARGET_FOR_LIBKML"] = \ - self.dependencies["libkml"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["LibKML_FOUND"] = False - - cmake.definitions["GDAL_USE_TIFF"] = self.options.with_libtiff - if self.options.with_libtiff: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_TIFF"] = "libtiff" - cmake.definitions["TARGET_FOR_TIFF"] = \ - self.dependencies["libtiff"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["TIFF_FOUND"] = False - - cmake.definitions["GDAL_USE_LZ4"] = self.options.with_lz4 - if self.options.with_lz4: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LZ4"] = "lz4" - cmake.definitions["TARGET_FOR_LZ4"] = \ - self.dependencies["lz4"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["LZ4_FOUND"] = False - - cmake.definitions["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx - if self.options.with_mongocxx: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_MONGOCXX"] = "mongo-cxx-driver" - cmake.definitions["TARGET_FOR_MONGOCXX"] = \ - self.dependencies["mongo-cxx-driver"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["MONGOCXX_FOUND"] = False - - if self.options.with_mysql == "libmysqlclient" or self.options.with_mysql == "mariadb-connector-c": - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_MYSQL"] = str(self.options.with_mysql) - cmake.definitions["TARGET_FOR_MYSQL"] = \ - "mariadb-connector-c::mariadb-connector-c" \ - if self.options.with_mysql == "mariadb-connector-c" \ - else "libmysqlclient::libmysqlclient" - else: - cmake.definitions["MYSQL_FOUND"] = False - - cmake.definitions["GDAL_USE_NETCDF"] = self.options.with_netcdf - if self.options.with_netcdf: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_NETCDF"] = "netcdf" - cmake.definitions["TARGET_FOR_NETCDF"] = \ - self.dependencies["netcdf"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["NetCDF_FOUND"] = False - - cmake.definitions["GDAL_USE_ODBC"] = self.options.with_odbc - if self.options.with_odbc: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ODBC"] = "odbc" - cmake.definitions["TARGET_FOR_ODBC"] = \ - self.dependencies["odbc"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["ODBC_FOUND"] = False - - cmake.definitions["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg - if self.options.with_openjpeg: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENJPEG"] = "openjpeg" - cmake.definitions["TARGET_FOR_OPENJPEG"] = \ - self.dependencies["openjpeg"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["OPENJPEG_FOUND"] = False - - cmake.definitions["GDAL_USE_OPENSSL"] = self.options.with_openssl - if self.options.with_openssl: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENSSL"] = "openssl" - cmake.definitions["TARGET_FOR_OPENSSL"] = \ - self.dependencies["openssl"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["OpenSSL_FOUND"] = False - - cmake.definitions["GDAL_USE_PCRE"] = self.options.with_pcre - if self.options.with_pcre: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PCRE"] = "pcre" - cmake.definitions["TARGET_FOR_PCRE"] = \ - self.dependencies["pcre"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["PCRE_FOUND"] = False - - cmake.definitions["GDAL_USE_PCRE2"] = self.options.with_pcre2 - if self.options.with_pcre2: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PCRE2"] = "pcre2" - cmake.definitions["TARGET_FOR_PCRE2"] = \ - self.dependencies["pcre2"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["PCRE2_FOUND"] = False - - cmake.definitions["GDAL_USE_PDFIUM"] = False - cmake.definitions["PDFIUM_FOUND"] = False - - cmake.definitions["GDAL_USE_POSTGRESQL"] = self.options.with_pg - if self.options.with_pg: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_POSTGRESQL"] = "libpq" - cmake.definitions["TARGET_FOR_POSTGRESQL"] = \ - self.dependencies["libpq"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["PostgreSQL_FOUND"] = False - - cmake.definitions["GDAL_USE_PNG"] = self.options.with_png - if self.options.with_png: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PNG"] = "libpng" - cmake.definitions["TARGET_FOR_PNG"] = \ - self.dependencies["libpng"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["PNG_FOUND"] = False - - cmake.definitions["GDAL_USE_PODOFO"] = self.options.with_podofo - if self.options.with_podofo: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PODOFO"] = "podofo" - cmake.definitions["TARGET_FOR_PODOFO"] = \ - self.dependencies["podofo"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["Podofo_FOUND"] = False - - cmake.definitions["GDAL_USE_POPPLER"] = self.options.with_poppler - if self.options.with_poppler: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_POPPLER"] = "poppler" - cmake.definitions["TARGET_FOR_POPPLER"] = \ - self.dependencies["poppler"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["Poppler_FOUND"] = False - - cmake.definitions["GDAL_USE_PROJ"] = self.options.with_proj - if self.options.with_proj: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PROJ"] = "proj" - cmake.definitions["TARGET_FOR_PROJ"] = \ - self.dependencies["proj"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["PROJ_FOUND"] = False - - cmake.definitions["GDAL_USE_QHULL"] = self.options.with_qhull - if self.options.with_qhull: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_QHULL"] = "qhull" - cmake.definitions["TARGET_FOR_QHULL"] = \ - self.dependencies["qhull"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["QHULL_FOUND"] = False + if self.options.with_arrow and Version(self.version) >= "3.10.0" and not self.dependencies["arrow"].options.filesystem_layer: + raise ConanInvalidConfiguration("Gdal[>=3.10.0] requires -o arrow/*:filesystem_layer=True") - cmake.definitions["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.cache_variables["GDAL_SET_INSTALL_RELATIVE_RPATH"] = True + + tc.cache_variables["BUILD_JAVA_BINDINGS"] = False + tc.cache_variables["BUILD_CSHARP_BINDINGS"] = False + tc.cache_variables["BUILD_PYTHON_BINDINGS"] = False + tc.cache_variables["BUILD_APPS"] = self.options.tools + tc.cache_variables["BUILD_TESTING"] = False + + tc.cache_variables["GDAL_USE_ARCHIVE"] = self.options.with_libarchive + tc.cache_variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo + tc.cache_variables["GDAL_USE_ARROW"] = self.options.with_arrow + tc.cache_variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow and self.dependencies["arrow"].options.dataset_modules + tc.cache_variables["GDAL_USE_BASISU"] = self.options.with_basisu + tc.cache_variables["GDAL_USE_BLOSC"] = self.options.with_blosc + tc.cache_variables["GDAL_USE_BRUNSLI"] = self.options.with_brunsli + tc.cache_variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio + tc.cache_variables["GDAL_USE_CRNLIB"] = self.options.with_dds + tc.cache_variables["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp + tc.cache_variables["GDAL_USE_CURL"] = self.options.with_curl + tc.cache_variables["GDAL_USE_DEFLATE"] = self.options.with_libdeflate + tc.cache_variables["GDAL_USE_ECW"] = self.options.with_ecw + tc.cache_variables["GDAL_USE_EXPAT"] = self.options.with_expat + tc.cache_variables["GDAL_USE_FILEGDB"] = False + tc.cache_variables["GDAL_USE_FREEXL"] = self.options.with_freexl + tc.cache_variables["GDAL_USE_FYBA"] = False + tc.cache_variables["GDAL_USE_GEOS"] = self.options.with_geos + tc.cache_variables["GDAL_USE_GEOTIFF"] = True + tc.cache_variables["GDAL_USE_GEOTIFF_INTERNAL"] = False + tc.cache_variables["GDAL_USE_GIF"] = self.options.with_gif + tc.cache_variables["GDAL_USE_GIF_INTERNAL"] = False + tc.cache_variables["GDAL_USE_GTA"] = self.options.with_gta + tc.cache_variables["GDAL_USE_HDF4"] = self.options.with_hdf4 + tc.cache_variables["GDAL_USE_HDF5"] = self.options.with_hdf5 + tc.cache_variables["GDAL_USE_HDFS"] = False + tc.cache_variables["GDAL_USE_HEIF"] = self.options.with_heif + tc.cache_variables["GDAL_USE_ICONV"] = self.options.with_libiconv + tc.cache_variables["GDAL_USE_IDB"] = False + tc.cache_variables["GDAL_USE_JPEG"] = bool(self.options.with_jpeg) + tc.cache_variables["GDAL_USE_JPEG_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JPEG12_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JSONC"] = True + tc.cache_variables["GDAL_USE_JSONC_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JXL"] = self.options.with_jxl + tc.cache_variables["GDAL_USE_JXL_THREADS"] = self.options.with_jxl + tc.cache_variables["GDAL_USE_KDU"] = False + tc.cache_variables["GDAL_USE_KEA"] = self.options.with_kea + tc.cache_variables["GDAL_USE_LERC"] = self.options.with_lerc + tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = False + tc.cache_variables["GDAL_USE_LIBAEC"] = self.options.get_safe("with_libaec", False) + tc.cache_variables["GDAL_USE_LIBCSF"] = False + tc.cache_variables["GDAL_USE_LIBCSF_INTERNAL"] = self.options.with_libcsf + tc.cache_variables["GDAL_USE_LIBKML"] = self.options.with_libkml + tc.cache_variables["GDAL_USE_LIBLZMA"] = self.options.with_lzma + tc.cache_variables["GDAL_USE_LIBQB3"] = False + tc.cache_variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 + tc.cache_variables["GDAL_USE_LURATECH"] = False + tc.cache_variables["GDAL_USE_LZ4"] = self.options.with_lz4 + tc.cache_variables["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx + tc.cache_variables["GDAL_USE_MRSID"] = False + tc.cache_variables["GDAL_USE_MSSQL_NCLI"] = False + tc.cache_variables["GDAL_USE_MSSQL_ODBC"] = False + tc.cache_variables["GDAL_USE_MYSQL"] = bool(self.options.with_mysql) + tc.cache_variables["GDAL_USE_NETCDF"] = self.options.with_netcdf + tc.cache_variables["GDAL_USE_ODBC"] = self.options.with_odbc + tc.cache_variables["GDAL_USE_ODBCCPP"] = False + tc.cache_variables["GDAL_USE_OGDI"] = False + tc.cache_variables["GDAL_USE_OPENCAD"] = False + tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = self.options.with_opencad + tc.cache_variables["GDAL_USE_OPENCL"] = self.options.with_opencl + tc.cache_variables["GDAL_USE_OPENEXR"] = self.options.with_exr + tc.cache_variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg + tc.cache_variables["GDAL_USE_OPENSSL"] = self.options.with_openssl + tc.cache_variables["GDAL_USE_ORACLE"] = False + tc.cache_variables["GDAL_USE_PARQUET"] = self.options.with_arrow and self.dependencies["arrow"].options.parquet + tc.cache_variables["GDAL_USE_PCRE"] = self.options.with_pcre + tc.cache_variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 + tc.cache_variables["GDAL_USE_PDFIUM"] = False # self.options.with_pdfium + tc.cache_variables["GDAL_USE_PNG"] = self.options.with_png + tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False + tc.cache_variables["GDAL_USE_PODOFO"] = self.options.with_podofo + tc.cache_variables["GDAL_USE_POPPLER"] = self.options.with_poppler + tc.cache_variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg + tc.cache_variables["GDAL_USE_PUBLICDECOMPWT"] = self.options.with_publicdecompwt + tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull + tc.cache_variables["GDAL_USE_QHULL_INTERNAL"] = False + tc.cache_variables["GDAL_USE_RASTERLITE2"] = self.options.with_rasterlite2 + tc.cache_variables["GDAL_USE_SFCGAL"] = False + tc.cache_variables["GDAL_USE_SHAPELIB"] = False + tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = self.options.with_shapelib + tc.cache_variables["GDAL_USE_SPATIALITE"] = self.options.with_spatialite + tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 + tc.cache_variables["GDAL_USE_TEIGHA"] = False + tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False + tc.cache_variables["GDAL_USE_TILEDB"] = self.options.with_tiledb + tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp + tc.cache_variables["GDAL_USE_XERCESC"] = self.options.with_xerces + tc.cache_variables["GDAL_USE_ZLIB"] = True + tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False + tc.cache_variables["GDAL_USE_ZSTD"] = self.options.with_zstd + + tc.cache_variables["Parquet_FOUND"] = self.options.with_arrow and self.dependencies["arrow"].options.parquet + tc.cache_variables["ArrowDataset_FOUND"] = self.options.with_arrow and self.dependencies["arrow"].options.dataset_modules + + # General workaround for try_compile() tests in the project + # https://github.com/conan-io/conan/issues/12180 + tc.variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = self.settings.build_type + # https://github.com/OSGeo/gdal/blob/v3.8.1/cmake/modules/packages/FindSQLite3.cmake if self.options.with_sqlite3: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_SQLITE3"] = "sqlite3" - cmake.definitions["TARGET_FOR_SQLITE3"] = \ - self.dependencies["sqlite3"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["SQLite3_FOUND"] = False - - cmake.definitions["GDAL_USE_WEBP"] = self.options.with_webp - if self.options.with_webp: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_WEBP"] = "libwebp" - cmake.definitions["TARGET_FOR_WEBP"] = \ - self.dependencies["libwebp"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["WebP_FOUND"] = False - - cmake.definitions["GDAL_USE_XERCESC"] = self.options.with_xerces - if self.options.with_xerces: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_XERCESC"] = "xerces-c" - cmake.definitions["TARGET_FOR_XERCESC"] = \ - self.dependencies["xerces-c"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["XercesC_FOUND"] = False - - cmake.definitions["GDAL_USE_LIBXML2"] = self.options.with_xml2 - if self.options.with_xml2: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LIBXML2"] = "libxml2" - cmake.definitions["TARGET_FOR_LIBXML2"] = \ - self.dependencies["libxml2"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["LibXml2_FOUND"] = False - - cmake.definitions["GDAL_USE_ZLIB"] = self.options.with_zlib - if self.options.with_zlib: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ZLIB"] = "zlib" - cmake.definitions["TARGET_FOR_ZLIB"] = \ - self.dependencies["zlib"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["ZLIB_FOUND"] = False - - cmake.definitions["GDAL_USE_ZSTD"] = self.options.with_zstd - if self.options.with_zstd: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ZSTD"] = "zstd" - cmake.definitions["TARGET_FOR_ZSTD"] = \ - self.dependencies["zstd"].cpp_info.get_property("cmake_target_name") - else: - cmake.definitions["ZSTD_FOUND"] = False - - - for k, v in cmake.definitions.items(): - print(k, " = ", v) - - cmake.configure(build_folder=self._build_subfolder) - return cmake - - def build(self): + tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata + tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree + tc.cache_variables["SQLite3_HAS_LOAD_EXTENSION"] = not self.dependencies["sqlite3"].options.omit_load_extension + tc.cache_variables["SQLite3_HAS_PROGRESS_HANDLER"] = True + tc.cache_variables["SQLite3_HAS_MUTEX_ALLOC"] = True + tc.preprocessor_definitions["SQLite3_HAS_COLUMN_METADATA"] = 1 if self.dependencies["sqlite3"].options.enable_column_metadata else 0 + tc.preprocessor_definitions["SQLite3_HAS_RTREE"] = 1 if self.dependencies["sqlite3"].options.enable_rtree else 0 + # https://github.com/OSGeo/gdal/blob/v3.8.0/cmake/helpers/CheckDependentLibraries.cmake#L419-L450 + tc.cache_variables["HAVE_JPEGTURBO_DUAL_MODE_8_12"] = ( + self.options.with_jpeg == "libjpeg-turbo" and + bool(self.dependencies["libjpeg-turbo"].options.get_safe("enable12bit")) + ) + # https://github.com/OSGeo/gdal/blob/v3.8.0/port/CMakeLists.txt + tc.cache_variables["BLOSC_HAS_BLOSC_CBUFFER_VALIDATE"] = ( + self.options.with_blosc and + Version(self.dependencies["c-blosc"].ref.version) >= "1.21.5" + ) + # https://github.com/OSGeo/gdal/blob/v3.8.0/frmts/hdf5/CMakeLists.txt#L61-L64 + tc.cache_variables["GDAL_ENABLE_HDF5_GLOBAL_LOCK"] = ( + self.options.with_hdf5 and + bool(self.dependencies["hdf5"].options.get_safe("threadsafe")) + ) + # https://github.com/OSGeo/gdal/blob/v3.8.0/frmts/hdf4/CMakeLists.txt#L28-L46 + tc.cache_variables["HDF4_HAS_MAXOPENFILES"] = ( + self.options.with_hdf4 and + Version(self.dependencies["hdf4"].ref.version) >= "4.2.5" + ) + # https://github.com/OSGeo/gdal/blob/4bb78aab3ae9ab5433042bc27239d1555cbe272e/cmake/helpers/CheckDependentLibraries.cmake#L301-L318 + # The detection fails for some reason + # Setting it to non-const is compatible with all platforms + tc.cache_variables["_ICONV_SECOND_ARGUMENT_IS_NOT_CONST"] = True + + # https://github.com/OSGeo/gdal/blob/v3.10.1/gdal.cmake#L31C8-L31C35 + tc.cache_variables["GDAL_BUILD_OPTIONAL_DRIVERS"] = self.options.gdal_optional_drivers + tc.cache_variables["OGR_BUILD_OPTIONAL_DRIVERS"] = self.options.ogr_optional_drivers + + tc.generate() + + + deps = CMakeDeps(self) + # https://gdal.org/development/building_from_source.html#cmake-package-dependent-options + # Based on `grep -hPIR '(gdal_check_package|find_package2)\(' ~/.conan2/p/b/gdal*/b/src/cmake | sort -u` + conan_to_cmake_pkg_name = { + "armadillo": "Armadillo", + "arrow": "Arrow", + "brunsli": "BRUNSLI", + "c-blosc": "Blosc", + "cfitsio": "CFITSIO", + "crunch": "Crnlib", + "cryptopp": "CryptoPP", + "expat": "EXPAT", + "freexl": "FreeXL", + # "fyba": "FYBA", + "geos": "GEOS", + "giflib": "GIF", + "hdf4": "HDF4", + "hdf5": "HDF5", + # "hdfs": "HDFS", + "json-c": "JSONC", + "kealib": "KEA", + "lerc": "LERC", + "libaec": "LIBAEC", + "libarchive": "ARCHIVE", + "libbasisu": "basisu", + # "libcsf": "LIBCSF", + "libcurl": "CURL", + "libdeflate": "Deflate", + "libecwj2": "ECW", + "libgeotiff": "GeoTIFF", + "libgta": "GTA", + "libheif": "HEIF", + "libiconv": "Iconv", + "libjpeg": "JPEG", + "libjpeg-turbo": "JPEG", + "libjxl": "JXL", + "libkml": "LibKML", + "libmysqlclient": "MySQL", + "libpng": "PNG", + "libpq": "PostgreSQL", + # "libqb3": "libQB3", + "librasterlite2": "RASTERLITE2", + "libspatialite": "SPATIALITE", + "libtiff": "TIFF", + "libwebp": "WebP", + "libxml2": "LibXml2", + "lz4": "LZ4", + "mariadb-connector-c": "MySQL", + "mongo-cxx-driver": "MONGOCXX", + "netcdf": "NetCDF", + "odbc": "ODBC", + # "odbccpp": "ODBCCPP", + # "ogdi": "OGDI", + # "opencad": "OpenCAD", + "opencl-icd-loader": "OpenCL", + "openexr": "OpenEXR", + "openjpeg": "OpenJPEG", + "openssl": "OpenSSL", + "pcre": "PCRE", + "pcre2": "PCRE2", + "pdfium": "PDFIUM", + "podofo": "Podofo", + "poppler": "Poppler", + "proj": "PROJ", + "qhull": "QHULL", + # "sfcgal": "SFCGAL", + "shapelib": "Shapelib", + "sqlite3": "SQLite3", + "tiledb": "TileDB", + "xerces-c": "XercesC", + "xz_utils": "LibLZMA", + "zlib": "ZLIB", + "zstd": "ZSTD", + # Closed-source/proprietary libraries + # "filegdb": "FileGDB", + # "idb": "IDB", + # "kdu": "KDU", + # "luratech": "LURATECH", + # "mrsid": "MRSID", + # "mssql_ncli": "MSSQL_NCLI", + # "mssql_odbc": "MSSQL_ODBC", + # "oracle": "Oracle", + # "rdb": "rdb", + # "teigha": "TEIGHA", + } + for conan_name, cmake_name in conan_to_cmake_pkg_name.items(): + deps.set_property(conan_name, "cmake_find_mode", "config") + deps.set_property(conan_name, "cmake_file_name", cmake_name) + + renamed_targets = { + "arrow::libarrow": "Arrow::arrow_shared" if Version(self.version) >= "3.7" else "arrow_shared", + "arrow::dataset": "ArrowDataset::arrow_dataset_shared", + "arrow::libparquet": "Parquet::parquet_shared", + "brunsli::brunslidec-c": "BRUNSLI::DECODE", + "brunsli::brunslienc-c": "BRUNSLI::ENCODE", + "c-blosc": "Blosc::Blosc", + "cfitsio": "CFITSIO::CFITSIO", + "crunch": "CRNLIB::Crnlib", + "cryptopp": "CRYPTOPP::CRYPTOPP", + "freexl": "FREEXL::freexl", + "geos": "GEOS::GEOS", + "hdf4": "HDF4::HDF4", + "hdfs": "HDFS::HDFS", + "kealib": "KEA::KEA", + "lerc": "LERC::LERC", + "libaec": "LIBAEC::LIBAEC", + "libarchive": "ARCHIVE::ARCHIVE", + "libbasisu": "basisu::basisu_lib", + "libdeflate": "Deflate::Deflate", + "libecwj2": "ECW::ECW_ALL", + "libgeotiff": "GEOTIFF::GEOTIFF", + "libheif": "HEIF::HEIF", + "libjxl::jxl": "JXL::JXL", + "libjxl::jxl_threads": "JXL_THREADS::JXL_THREADS", + "libjpeg": "JPEG::JPEG", + "libjpeg-turbo::jpeg": "JPEG::JPEG", + "libkml::kmldom": "LIBKML::DOM", + "libkml::kmlengine": "LIBKML::ENGINE", + "libkml": "LIBKML::LibKML", + "librasterlite2": "RASTERLITE2::RASTERLITE2", + "libspatialite": "SPATIALITE::SPATIALITE", + "libwebp": "WEBP::WebP", + "lz4": "LZ4::LZ4", + "mongo-cxx-driver::bsoncxx": "MONGOCXX::BSONCXX", + "mongo-cxx-driver::mongocxx": "MONGOCXX::MONGOCXX", + "netcds": "netCDF::netcdf", + "opencl-icd-loader": "OpenCL::OpenCL", + "openjpeg": "OPENJPEG::OpenJPEG", + "pcre": "PCRE::PCRE", + "pcre2::pcre2-8": "PCRE2::PCRE2-8", + "pdfium": "PDFIUM::PDFIUM", + "podofo": "PODOFO::Podofo", + "poppler": "Poppler::Poppler", + "shapelib": "SHAPELIB::shp", + "tiledb": "TileDB::tiledb_shared", + "xz_utils": "LibLZMA::LibLZMA", + "zstd": "ZSTD::zstd", + } + for component, new_target_name in renamed_targets.items(): + deps.set_property(component, "cmake_target_name", new_target_name) + + deps.generate() + + def _patch_sources(self): apply_conandata_patches(self) - cmake = self._configure_cmake() + # Fix Deflate::Deflate not being correctly propagated internally. + replace_in_file(self, os.path.join(self.source_folder, "port", "CMakeLists.txt"), + "PRIVATE Deflate::Deflate", + "PUBLIC Deflate::Deflate") + # Workaround for JXL_THREADS being provided by the JXL package on CCI. + replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), + "JXL_THREADS", "JXL", strict=False) + # Workaround for Parquet and ArrowDataset being provided by Arrow on CCI. + if Version(self.version) < "3.10.0": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), + "gdal_check_package(Parquet", "# gdal_check_package(Parquet") + if Version(self.version) >= "3.6.0" and Version(self.version) < "3.10.0": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), + "gdal_check_package(ArrowDataset", "# gdal_check_package(ArrowDataset") + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): - self.copy("LICENSE.TXT", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.TXT", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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", "pkgconfig")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rename(self, os.path.join(self.package_folder, "share"), + os.path.join(self.package_folder, "res")) + rmdir(self, os.path.join(self.package_folder, "res", "bash-completion")) + rmdir(self, os.path.join(self.package_folder, "res", "man")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "GDAL") self.cpp_info.set_property("cmake_target_name", "GDAL::GDAL") self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("pkg_config_name", "gdal") - self.cpp_info.names["cmake_find_package"] = "GDAL" - self.cpp_info.names["cmake_find_package_multi"] = "GDAL" - self.cpp_info.filenames["cmake_find_package"] = "GDAL" - self.cpp_info.filenames["cmake_find_package_multi"] = "GDAL" - + # https://github.com/OSGeo/gdal/blob/v3.7.2/gdal.cmake#L384-L392 + # FIXME: set the correct postfix for MinGW shared builds libname = "gdal" - if self.settings.os == "Windows": + if is_msvc(self): if self.settings.build_type == "Debug": libname += "d" - self.cpp_info.libs = [ libname ] - - self.cpp_info.requires.extend(['json-c::json-c']) - self.cpp_info.requires.extend(['libgeotiff::libgeotiff']) - + self.cpp_info.libs = [libname] + self.cpp_info.resdirs = ["res"] + + self.cpp_info.requires.extend(["json-c::json-c"]) + self.cpp_info.requires.extend(["libgeotiff::libgeotiff"]) + self.cpp_info.requires.extend(["libtiff::libtiff"]) + self.cpp_info.requires.extend(["proj::projlib"]) + self.cpp_info.requires.extend(["zlib::zlib"]) if self.options.with_armadillo: - self.cpp_info.requires.extend(['armadillo::armadillo']) - + self.cpp_info.requires.extend(["armadillo::armadillo"]) if self.options.with_arrow: - self.cpp_info.requires.extend(['arrow::libarrow']) - + self.cpp_info.requires.extend(["arrow::libarrow"]) + if self.dependencies["arrow"].options.parquet: + self.cpp_info.requires.extend(["arrow::libparquet"]) + if self.dependencies["arrow"].options.dataset_modules: + self.cpp_info.requires.extend(["arrow::dataset"]) + if self.options.with_basisu: + self.cpp_info.requires.extend(["libbasisu::libbasisu"]) + if self.options.with_brunsli: + self.cpp_info.requires.extend(["brunsli::brunsli"]) if self.options.with_blosc: - self.cpp_info.requires.extend(['c-blosc::c-blosc']) - + self.cpp_info.requires.extend(["c-blosc::c-blosc"]) if self.options.with_cfitsio: - self.cpp_info.requires.extend(['cfitsio::cfitsio']) - + self.cpp_info.requires.extend(["cfitsio::cfitsio"]) if self.options.with_cryptopp: - self.cpp_info.requires.extend(['cryptopp::libcryptopp']) - + self.cpp_info.requires.extend(["cryptopp::libcryptopp"]) if self.options.with_curl: - self.cpp_info.requires.extend(['libcurl::curl']) - + self.cpp_info.requires.extend(["libcurl::curl"]) if self.options.with_dds: - self.cpp_info.requires.extend(['crunch::crunch']) - + self.cpp_info.requires.extend(["crunch::crunch"]) + if self.options.with_ecw: + self.cpp_info.requires.extend(["libecwj2::libecwj2"]) if self.options.with_expat: - self.cpp_info.requires.extend(['expat::expat']) - + self.cpp_info.requires.extend(["expat::expat"]) if self.options.with_exr: - self.cpp_info.requires.extend(['openexr::openexr', 'imath::imath']) - + self.cpp_info.requires.extend(["openexr::openexr", "imath::imath"]) if self.options.with_freexl: - self.cpp_info.requires.extend(['freexl::freexl']) - + self.cpp_info.requires.extend(["freexl::freexl"]) if self.options.with_geos: - self.cpp_info.requires.extend(['geos::geos_c']) - + self.cpp_info.requires.extend(["geos::geos_c"]) if self.options.with_gif: - self.cpp_info.requires.extend(['giflib::giflib']) - + self.cpp_info.requires.extend(["giflib::giflib"]) if self.options.with_gta: - self.cpp_info.requires.extend(['libgta::libgta']) - + self.cpp_info.requires.extend(["libgta::libgta"]) if self.options.with_hdf4: - self.cpp_info.requires.extend(['hdf4::hdf4']) - + self.cpp_info.requires.extend(["hdf4::hdf4"]) if self.options.with_hdf5: - self.cpp_info.requires.extend(['hdf5::hdf5_c']) - + self.cpp_info.requires.extend(["hdf5::hdf5_c"]) if self.options.with_heif: - self.cpp_info.requires.extend(['libheif::libheif']) - + self.cpp_info.requires.extend(["libheif::libheif"]) + if self.options.with_jxl: + self.cpp_info.requires.extend(["libjxl::libjxl"]) if self.options.with_kea: - self.cpp_info.requires.extend(['kealib::kealib']) - + self.cpp_info.requires.extend(["kealib::kealib"]) + if self.options.with_lerc: + self.cpp_info.requires.extend(["lerc::lerc"]) + if self.options.get_safe("with_libaec"): + self.cpp_info.requires.extend(["libaec::libaec"]) + if self.options.with_libarchive: + self.cpp_info.requires.extend(["libarchive::libarchive"]) if self.options.with_libdeflate: - self.cpp_info.requires.extend(['libdeflate::libdeflate']) - + self.cpp_info.requires.extend(["libdeflate::libdeflate"]) if self.options.with_libiconv: - self.cpp_info.requires.extend(['libiconv::libiconv']) - + self.cpp_info.requires.extend(["libiconv::libiconv"]) if self.options.with_jpeg == "libjpeg": - self.cpp_info.requires.extend(['libjpeg::libjpeg']) + self.cpp_info.requires.extend(["libjpeg::libjpeg"]) elif self.options.with_jpeg == "libjpeg-turbo": - self.cpp_info.requires.extend(['libjpeg-turbo::turbojpeg']) - + self.cpp_info.requires.extend(["libjpeg-turbo::turbojpeg"]) if self.options.with_libkml: - self.cpp_info.requires.extend(['libkml::kmldom', 'libkml::kmlengine']) - - if self.options.with_libtiff: - self.cpp_info.requires.extend(['libtiff::libtiff']) - + self.cpp_info.requires.extend(["libkml::kmldom", "libkml::kmlengine"]) + if self.options.with_lzma: + self.cpp_info.requires.extend(["xz_utils::xz_utils"]) if self.options.with_lz4: - self.cpp_info.requires.extend(['lz4::lz4']) - + self.cpp_info.requires.extend(["lz4::lz4"]) if self.options.with_mongocxx: - self.cpp_info.requires.extend(['mongo-cxx-driver::mongo-cxx-driver']) - + self.cpp_info.requires.extend(["mongo-cxx-driver::mongo-cxx-driver"]) if self.options.with_mysql == "libmysqlclient": - self.cpp_info.requires.extend(['libmysqlclient::libmysqlclient']) + self.cpp_info.requires.extend(["libmysqlclient::libmysqlclient"]) elif self.options.with_mysql == "mariadb-connector-c": - self.cpp_info.requires.extend(['mariadb-connector-c::mariadb-connector-c']) - + self.cpp_info.requires.extend(["mariadb-connector-c::mariadb-connector-c"]) if self.options.with_netcdf: - self.cpp_info.requires.extend(['netcdf::netcdf']) - + self.cpp_info.requires.extend(["netcdf::netcdf"]) if self.options.with_odbc: - self.cpp_info.requires.extend(['odbc::odbc']) - + self.cpp_info.requires.extend(["odbc::odbc"]) + if self.options.with_opencl: + self.cpp_info.requires.extend(["opencl-icd-loader::opencl-icd-loader"]) if self.options.with_openjpeg: - self.cpp_info.requires.extend(['openjpeg::openjpeg']) - + self.cpp_info.requires.extend(["openjpeg::openjpeg"]) if self.options.with_openssl: - self.cpp_info.requires.extend(['openssl::ssl']) - + self.cpp_info.requires.extend(["openssl::ssl"]) if self.options.with_pcre: - self.cpp_info.requires.extend(['pcre::pcre']) - + self.cpp_info.requires.extend(["pcre::pcre"]) if self.options.with_pcre2: - self.cpp_info.requires.extend(['pcre2::pcre2-8']) - + self.cpp_info.requires.extend(["pcre2::pcre2-8"]) + # if self.options.with_pdfium: + # self.cpp_info.requires.extend(["pdfium::pdfium"]) if self.options.with_pg: - self.cpp_info.requires.extend(['libpq::pq']) - + self.cpp_info.requires.extend(["libpq::pq"]) if self.options.with_png: - self.cpp_info.requires.extend(['libpng::libpng']) - + self.cpp_info.requires.extend(["libpng::libpng"]) if self.options.with_podofo: - self.cpp_info.requires.extend(['podofo::podofo']) - + self.cpp_info.requires.extend(["podofo::podofo"]) if self.options.with_poppler: - self.cpp_info.requires.extend(['poppler::libpoppler']) - - if self.options.with_proj: - self.cpp_info.requires.extend(['proj::projlib']) - + self.cpp_info.requires.extend(["poppler::libpoppler"]) + if self.options.with_rasterlite2: + self.cpp_info.requires.extend(["librasterlite2::librasterlite2"]) if self.options.with_qhull: - self.cpp_info.requires.extend(['qhull::libqhull']) - + self.cpp_info.requires.extend(["qhull::libqhull"]) + if self.options.with_spatialite: + self.cpp_info.requires.extend(["libspatialite::libspatialite"]) if self.options.with_sqlite3: - self.cpp_info.requires.extend(['sqlite3::sqlite']) - + self.cpp_info.requires.extend(["sqlite3::sqlite"]) + if self.options.with_tiledb: + self.cpp_info.requires.extend(["tiledb::tiledb"]) if self.options.with_webp: - self.cpp_info.requires.extend(['libwebp::libwebp']) - + self.cpp_info.requires.extend(["libwebp::libwebp"]) if self.options.with_xerces: - self.cpp_info.requires.extend(['xerces-c::xerces-c']) - + self.cpp_info.requires.extend(["xerces-c::xerces-c"]) if self.options.with_xml2: - self.cpp_info.requires.extend(['libxml2::libxml2']) - - if self.options.with_zlib: - self.cpp_info.requires.extend(['zlib::zlib']) - + self.cpp_info.requires.extend(["libxml2::libxml2"]) if self.options.with_zstd: - self.cpp_info.requires.extend(['zstd::zstdlib']) + self.cpp_info.requires.extend(["zstd::zstdlib"]) + + # Based on https://github.com/OSGeo/gdal/blob/v3.7.2/port/CMakeLists.txt + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs += ["pthread"] + elif self.settings.os == "Windows": + if is_msvc(self): + self.cpp_info.system_libs += ["wbemuuid"] + if self.options.with_openssl: + self.cpp_info.system_libs += ["crypt32"] gdal_data_path = os.path.join(self.package_folder, "res", "gdal") - self.output.info( - "Prepending to GDAL_DATA environment variable: {}".format( - gdal_data_path)) - self.runenv_info.prepend_path("GDAL_DATA", gdal_data_path) - # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator - self.env_info.GDAL_DATA = gdal_data_path + self.runenv_info.define_path("GDAL_DATA", gdal_data_path) if self.options.tools: - self.buildenv_info.prepend_path("GDAL_DATA", gdal_data_path) - 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.buildenv_info.define_path("GDAL_DATA", gdal_data_path) diff --git a/recipes/gdal/post_3.5.0/patches/3.10.3/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.10.3/0-replace-find-package.patch new file mode 100644 index 0000000000000..b3ff7b8dfb470 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.10.3/0-replace-find-package.patch @@ -0,0 +1,36 @@ +--- cmake/helpers/CheckDependentLibrariesCommon.cmake ++++ cmake/helpers/CheckDependentLibrariesCommon.cmake +@@ -11,7 +11,7 @@ + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++include(ConanFindPackage) + include(CheckSymbolExists) + + option( +@@ -109,9 +109,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() ++ find_package2(${name} QUIET) ++ if(FALSE) + set(_find_package_args) + # For some reason passing the HDF5 version requirement cause a linking error of the libkea driver on Conda Windows builds... + if (_GCP_VERSION AND NOT ("${name}" STREQUAL "TileDB") AND NOT ("${name}" STREQUAL "HDF5")) +--- cmake/helpers/CheckDependentLibraries.cmake ++++ cmake/helpers/CheckDependentLibraries.cmake +@@ -176,8 +176,8 @@ + NAMES json-c + TARGETS json-c::json-c JSONC::JSONC + ) +-gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) ++find_package2(JSONC REQUIRED) ++if(FALSE) + 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}") \ No newline at end of file diff --git a/recipes/gdal/post_3.5.0/patches/3.10.3/1-do-not-force-private-linking.patch b/recipes/gdal/post_3.5.0/patches/3.10.3/1-do-not-force-private-linking.patch new file mode 100644 index 0000000000000..7fc1880491459 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.10.3/1-do-not-force-private-linking.patch @@ -0,0 +1,20 @@ +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -394,7 +394,7 @@ + set(_oneValueArgs) + set(_multiValueArgs PRIVATE) + cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) +- if (NOT _DRIVER_PRIVATE) ++ if (FALSE AND NOT _DRIVER_PRIVATE) + message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") + endif () + is_plugin(RES ${target}) +@@ -411,6 +411,7 @@ + else () + gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) ++ target_link_libraries(${ARGV}) + endif () + + # For debugging purposes diff --git a/recipes/gdal/post_3.5.0/patches/3.10.3/2-allow-cycles-in-cmake-targets.patch b/recipes/gdal/post_3.5.0/patches/3.10.3/2-allow-cycles-in-cmake-targets.patch new file mode 100644 index 0000000000000..edb94bfed0140 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.10.3/2-allow-cycles-in-cmake-targets.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -363,6 +363,7 @@ + target_compile_options(${_TARGET} PRIVATE ${_res}) + endif () + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) ++ list(REMOVE_ITEM _res ${_LIB}) + if (_res) + gdal_target_interfaces(${_TARGET} ${_res}) + endif () +diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake +--- a/cmake/helpers/GdalGenerateConfig.cmake ++++ b/cmake/helpers/GdalGenerateConfig.cmake +@@ -50,6 +50,7 @@ + if(TARGET "${_lib}") + get_target_property(_link_libraries ${_lib} INTERFACE_LINK_LIBRARIES) + get_target_property(_type ${_lib} TYPE) ++ list(REMOVE_ITEM _link_libraries ${_lib}) + if(_link_libraries AND NOT TYPE STREQUAL "SHARED_LIBRARY") + list(INSERT ARGN 0 ${_link_libraries}) + endif() diff --git a/recipes/gdal/post_3.5.0/patches/3.10.3/3-use-arrow-version-for-parquet.patch b/recipes/gdal/post_3.5.0/patches/3.10.3/3-use-arrow-version-for-parquet.patch new file mode 100644 index 0000000000000..985f3a0de2cfc --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.10.3/3-use-arrow-version-for-parquet.patch @@ -0,0 +1,20 @@ +--- ogr/ogrsf_frmts/parquet/CMakeLists.txt ++++ ogr/ogrsf_frmts/parquet/CMakeLists.txt +@@ -41,7 +41,7 @@ + $) + endif() + +-if(${Parquet_VERSION} VERSION_GREATER_EQUAL 10.0) ++if(${ARROW_VERSION} VERSION_GREATER_EQUAL 10.0) + if(ARROW_USE_STATIC_LIBRARIES) + gdal_target_link_libraries(ogr_Parquet PRIVATE Arrow::arrow_static Parquet::parquet_static) + else() +@@ -57,7 +57,7 @@ + + if (GDAL_USE_ARROWDATASET) + target_compile_definitions(ogr_Parquet PRIVATE -DGDAL_USE_ARROWDATASET) +- if(${ArrowDataset_VERSION} VERSION_GREATER_EQUAL 10.0) ++ if(${ARROW_VERSION} VERSION_GREATER_EQUAL 10.0) + if(ARROW_USE_STATIC_LIBRARIES) + gdal_target_link_libraries(ogr_Parquet PRIVATE ArrowDataset::arrow_dataset_static) + else() \ No newline at end of file diff --git a/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch deleted file mode 100644 index e790a586d8abd..0000000000000 --- a/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch +++ /dev/null @@ -1,266 +0,0 @@ -diff --git a/alg/CMakeLists.txt b/alg/CMakeLists.txt -index edf75158c7..4200309ca8 100644 ---- a/alg/CMakeLists.txt -+++ b/alg/CMakeLists.txt -@@ -72,7 +72,7 @@ if (GDAL_USE_OPENCL) - 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 --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt -index a49165d14a..91d6170067 100644 ---- a/apps/CMakeLists.txt -+++ b/apps/CMakeLists.txt -@@ -25,7 +25,7 @@ target_include_directories( - 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 --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake -index 7fa3b565c7..77a610f223 100644 ---- a/cmake/helpers/CheckDependentLibraries.cmake -+++ b/cmake/helpers/CheckDependentLibraries.cmake -@@ -11,7 +11,10 @@ Detect GDAL dependencies and set variable HAVE_* - include(CheckFunctionExists) - include(CMakeDependentOption) - include(FeatureSummary) --include(DefineFindPackage2) -+ -+# Conan recipes should rely on config files from generators so let's just disble GDAL's -+include(ConanFindPackage) -+ - include(CheckSymbolExists) - - option( -@@ -111,47 +114,7 @@ macro (gdal_check_package name purpose) - set(_find_dependency_args "") - find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) - if (NOT DEFINED ${key}_FOUND) -- 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 () -+ message(FATAL_ERROR "Conan recipes should rely on config files from generators so let's just disble GDAL's") - endif () - if (${key}_FOUND OR ${name}_FOUND) - set(HAVE_${key} ON) -@@ -321,14 +284,15 @@ if (GDAL_USE_CRYPTOPP) - 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 (NOT PROJ_FOUND) -+# find_package(proj 8 CONFIG QUIET) -+#endif() - 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 () - -@@ -379,15 +343,10 @@ gdal_check_package(JSONC "json-c library (external)" CAN_DISABLE - 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) -@@ -482,7 +441,7 @@ if (GDAL_USE_RASTERLITE2) - endif () - cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) - --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 --git a/cmake/helpers/ConanFindPackage.cmake b/cmake/helpers/ConanFindPackage.cmake -new file mode 100644 -index 0000000000..9dfa8193a3 ---- /dev/null -+++ b/cmake/helpers/ConanFindPackage.cmake -@@ -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 --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt -index e5b7138e91..039cac7361 100644 ---- a/frmts/hfa/CMakeLists.txt -+++ b/frmts/hfa/CMakeLists.txt -@@ -15,7 +15,8 @@ add_gdal_driver( - 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 --git a/gdal.cmake b/gdal.cmake -index ff1ca7e6f6..e98875f1b9 100644 ---- a/gdal.cmake -+++ b/gdal.cmake -@@ -795,25 +795,6 @@ if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK) - ${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 --git a/ogr/CMakeLists.txt b/ogr/CMakeLists.txt -index 19ba4e12fe..87cd123c54 100644 ---- a/ogr/CMakeLists.txt -+++ b/ogr/CMakeLists.txt -@@ -88,12 +88,12 @@ endif () - - 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 --git a/ogr/ogr_proj_p.h b/ogr/ogr_proj_p.h -index 88928ad1ad..7cdd587db7 100644 ---- a/ogr/ogr_proj_p.h -+++ b/ogr/ogr_proj_p.h -@@ -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/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch deleted file mode 100644 index b01b5b271034c..0000000000000 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch +++ /dev/null @@ -1,266 +0,0 @@ -diff --git a/alg/CMakeLists.txt b/alg/CMakeLists.txt -index edf75158c7..4200309ca8 100644 ---- a/alg/CMakeLists.txt -+++ b/alg/CMakeLists.txt -@@ -72,7 +72,7 @@ if (GDAL_USE_OPENCL) - 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 --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt -index 8b02cea456..ad4adbfc9e 100644 ---- a/apps/CMakeLists.txt -+++ b/apps/CMakeLists.txt -@@ -25,7 +25,7 @@ target_include_directories( - 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 --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake -index 0a66b44fec..152ff42ff7 100644 ---- a/cmake/helpers/CheckDependentLibraries.cmake -+++ b/cmake/helpers/CheckDependentLibraries.cmake -@@ -11,7 +11,10 @@ Detect GDAL dependencies and set variable HAVE_* - include(CheckFunctionExists) - include(CMakeDependentOption) - include(FeatureSummary) --include(DefineFindPackage2) -+ -+# Conan recipes should rely on config files from generators so let's just disble GDAL's -+include(ConanFindPackage) -+ - include(CheckSymbolExists) - - option( -@@ -111,47 +114,7 @@ macro (gdal_check_package name purpose) - set(_find_dependency_args "") - find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) - if (NOT DEFINED ${key}_FOUND) -- 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 () -+ message(FATAL_ERROR "Conan recipes should rely on config files from generators so let's just disble GDAL's") - endif () - if (${key}_FOUND OR ${name}_FOUND) - set(HAVE_${key} ON) -@@ -345,14 +308,15 @@ if (GDAL_USE_CRYPTOPP) - 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 (NOT PROJ_FOUND) -+# find_package(proj 8 CONFIG QUIET) -+#endif() - 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 () - -@@ -412,15 +376,10 @@ gdal_check_package(JSONC "json-c library (external)" CAN_DISABLE - 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) -@@ -517,7 +476,7 @@ if (GDAL_USE_RASTERLITE2) - endif () - cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) - --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 --git a/cmake/helpers/ConanFindPackage.cmake b/cmake/helpers/ConanFindPackage.cmake -new file mode 100644 -index 0000000000..9dfa8193a3 ---- /dev/null -+++ b/cmake/helpers/ConanFindPackage.cmake -@@ -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 --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt -index e5b7138e91..039cac7361 100644 ---- a/frmts/hfa/CMakeLists.txt -+++ b/frmts/hfa/CMakeLists.txt -@@ -15,7 +15,8 @@ add_gdal_driver( - 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 --git a/gdal.cmake b/gdal.cmake -index 4bae2e2760..7695df40c8 100644 ---- a/gdal.cmake -+++ b/gdal.cmake -@@ -787,25 +787,6 @@ if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK) - ${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 --git a/ogr/CMakeLists.txt b/ogr/CMakeLists.txt -index 19ba4e12fe..87cd123c54 100644 ---- a/ogr/CMakeLists.txt -+++ b/ogr/CMakeLists.txt -@@ -88,12 +88,12 @@ endif () - - 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 --git a/ogr/ogr_proj_p.h b/ogr/ogr_proj_p.h -index 88928ad1ad..7cdd587db7 100644 ---- a/ogr/ogr_proj_p.h -+++ b/ogr/ogr_proj_p.h -@@ -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/post_3.5.0/patches/3.5.3/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch new file mode 100644 index 0000000000000..a13e4429270d1 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch @@ -0,0 +1,74 @@ +diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake +--- a/cmake/helpers/CheckDependentLibraries.cmake ++++ b/cmake/helpers/CheckDependentLibraries.cmake +@@ -11,7 +11,7 @@ + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++include(ConanFindPackage) + include(CheckSymbolExists) + + option( +@@ -109,8 +109,8 @@ + string(TOUPPER ${name} key) + set(_find_dependency "") + set(_find_dependency_args "") +- find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) +- if (NOT DEFINED ${key}_FOUND) ++ find_package2(${name} QUIET) ++ if (FALSE) + set(_find_package_args) + if (_GCP_VERSION) + list(APPEND _find_package_args ${_GCP_VERSION}) +@@ -345,7 +345,7 @@ + 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) ++find_package2(PROJ 9 CONFIG REQUIRED) + if (NOT PROJ_FOUND) + find_package(PROJ 8 CONFIG QUIET) + endif() +@@ -411,8 +411,8 @@ + NAMES json-c + TARGETS json-c::json-c JSONC::JSONC + ) +-gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) ++find_package2(JSONC REQUIRED) ++if(FALSE) + 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}") +@@ -517,9 +517,9 @@ + endif () + cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) + +-find_package(LibKML COMPONENTS DOM ENGINE) ++find_package2(LibKML COMPONENTS DOM ENGINE) + if (GDAL_USE_LIBKML) + if (NOT LibKML_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") + endif () + endif () +@@ -540,8 +540,8 @@ + gdal_check_package(MRSID "MrSID raster SDK" CAN_DISABLE) + gdal_check_package(Armadillo "C++ library for linear algebra (used for TPS transformation)" CAN_DISABLE) + if (ARMADILLO_FOUND) +- # On Conda, the armadillo package has no dependency on lapack, but the later is required for successful linking. So +- # try to build & link a test program using Armadillo. ++ # On Conda, the armadillo package has no dependency on lapack, but the later is required for successful linking. So try to build & link a test program using Armadillo. ++ include(CMakePushCheckState) + cmake_push_check_state(RESET) + set(CMAKE_REQUIRED_INCLUDES "${ARMADILLO_INCLUDE_DIRS}") + set(CMAKE_REQUIRED_LIBRARIES "${ARMADILLO_LIBRARIES}") +@@ -646,7 +646,7 @@ + gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) + + # OpenJPEG's cmake-CONFIG is broken, so call module explicitly +-find_package(OpenJPEG MODULE) ++find_package2(OpenJPEG MODULE) + if (GDAL_USE_OPENJPEG) + if (NOT OPENJPEG_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/1-do-not-force-private-linking.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/1-do-not-force-private-linking.patch new file mode 100644 index 0000000000000..e45427d007600 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.3/1-do-not-force-private-linking.patch @@ -0,0 +1,20 @@ +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -280,7 +280,7 @@ + set(_oneValueArgs) + set(_multiValueArgs PRIVATE) + cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) +- if (NOT _DRIVER_PRIVATE) ++ if (FALSE AND NOT _DRIVER_PRIVATE) + message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") + endif () + is_plugin(RES ${target}) +@@ -289,6 +289,7 @@ + else () + gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) ++ target_link_libraries(${ARGV}) + endif () + endfunction() + diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/2-allow-cycles-in-cmake-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/2-allow-cycles-in-cmake-targets.patch new file mode 100644 index 0000000000000..31bc2e5a8587d --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.3/2-allow-cycles-in-cmake-targets.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -249,6 +249,7 @@ + target_compile_options(${_TARGET} PRIVATE ${_res}) + endif () + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) ++ list(REMOVE_ITEM _res ${_LIB}) + if (_res) + gdal_target_interfaces(${_TARGET} ${_res}) + endif () +diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake +--- a/cmake/helpers/GdalGenerateConfig.cmake ++++ b/cmake/helpers/GdalGenerateConfig.cmake +@@ -50,6 +50,7 @@ + if(TARGET "${_lib}") + get_target_property(_link_libraries ${_lib} INTERFACE_LINK_LIBRARIES) + get_target_property(_type ${_lib} TYPE) ++ list(REMOVE_ITEM _link_libraries ${_lib}) + if(_link_libraries AND NOT TYPE STREQUAL "SHARED_LIBRARY") + list(INSERT ARGN 0 ${_link_libraries}) + endif() 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 deleted file mode 100644 index 34401a53eae6d..0000000000000 --- a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch +++ /dev/null @@ -1,282 +0,0 @@ -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/post_3.5.0/patches/3.7.3/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/0-replace-find-package.patch new file mode 100644 index 0000000000000..e25f0d63223d9 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/0-replace-find-package.patch @@ -0,0 +1,64 @@ +diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/CheckDependentLibraries.cmake +--- ./a/cmake/helpers/CheckDependentLibraries.cmake ++++ ./b/cmake/helpers/CheckDependentLibraries.cmake +@@ -11,7 +11,7 @@ + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++include(ConanFindPackage) + include(CheckSymbolExists) + + option( +@@ -109,9 +109,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() ++ find_package2(${name} QUIET) ++ if (FALSE) + set(_find_package_args) + if (_GCP_VERSION) + list(APPEND _find_package_args ${_GCP_VERSION}) +@@ -368,7 +367,7 @@ + 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) ++find_package2(PROJ 9 CONFIG REQUIRED) + if (NOT PROJ_FOUND) + find_package(PROJ 8 CONFIG QUIET) + endif() +@@ -457,8 +456,8 @@ + NAMES json-c + TARGETS json-c::json-c JSONC::JSONC + ) +-gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) ++find_package2(JSONC REQUIRED) ++if(FALSE) + 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}") +@@ -566,9 +565,9 @@ + 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_package2(LibKML COMPONENTS DOM ENGINE) + if (GDAL_USE_LIBKML) + if (NOT LibKML_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") + endif () + endif () +@@ -733,7 +732,7 @@ + gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) + + # OpenJPEG's cmake-CONFIG is broken, so call module explicitly +-find_package(OpenJPEG MODULE) ++find_package2(OpenJPEG MODULE) + if (GDAL_USE_OPENJPEG) + if (NOT OPENJPEG_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch new file mode 100644 index 0000000000000..d5b761df32ded --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch @@ -0,0 +1,20 @@ +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -280,7 +280,7 @@ + set(_oneValueArgs) + set(_multiValueArgs PRIVATE) + cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) +- if (NOT _DRIVER_PRIVATE) ++ if (FALSE AND NOT _DRIVER_PRIVATE) + message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") + endif () + is_plugin(RES ${target}) +@@ -297,6 +297,7 @@ + else () + gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) ++ target_link_libraries(${ARGV}) + endif () + + # For debugging purposes diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/2-use-arrow-version-for-parquet.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/2-use-arrow-version-for-parquet.patch new file mode 100644 index 0000000000000..f0b3b9cdcea82 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/2-use-arrow-version-for-parquet.patch @@ -0,0 +1,20 @@ +--- ogr/ogrsf_frmts/parquet/CMakeLists.txt ++++ ogr/ogrsf_frmts/parquet/CMakeLists.txt +@@ -9,7 +9,7 @@ add_gdal_driver(TARGET ogr_Parquet + gdal_standard_includes(ogr_Parquet) + target_include_directories(ogr_Parquet PRIVATE $ + $) +-if(${Parquet_VERSION} VERSION_GREATER_EQUAL 10.0) ++if(${ARROW_VERSION} VERSION_GREATER_EQUAL 10.0) + if(ARROW_USE_STATIC_LIBRARIES) + gdal_target_link_libraries(ogr_Parquet PRIVATE Arrow::arrow_static Parquet::parquet_static) + else() +@@ -26,7 +26,7 @@ endif() + + if (GDAL_USE_ARROWDATASET) + target_compile_definitions(ogr_Parquet PRIVATE -DGDAL_USE_ARROWDATASET) +- if(${ArrowDataset_VERSION} VERSION_GREATER_EQUAL 10.0) ++ if(${ARROW_VERSION} VERSION_GREATER_EQUAL 10.0) + if(ARROW_USE_STATIC_LIBRARIES) + gdal_target_link_libraries(ogr_Parquet PRIVATE ArrowDataset::arrow_dataset_static) + else() \ No newline at end of file diff --git a/recipes/gdal/post_3.5.0/patches/3.8.1/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.8.1/0-replace-find-package.patch new file mode 100644 index 0000000000000..c82d659742baf --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.8.1/0-replace-find-package.patch @@ -0,0 +1,52 @@ +--- cmake/helpers/CheckDependentLibraries.cmake ++++ cmake/helpers/CheckDependentLibraries.cmake +@@ -11,7 +11,7 @@ + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++include(ConanFindPackage) + include(CheckSymbolExists) + + option( +@@ -109,9 +109,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() ++ find_package2(${name} QUIET) ++ if(FALSE) + set(_find_package_args) + if (_GCP_VERSION) + list(APPEND _find_package_args ${_GCP_VERSION}) +@@ -368,7 +367,7 @@ + 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) ++find_package2(PROJ 9 CONFIG REQUIRED) + if (NOT PROJ_FOUND) + find_package(PROJ 8 CONFIG QUIET) + endif() +@@ -457,8 +456,8 @@ + NAMES json-c + TARGETS json-c::json-c JSONC::JSONC + ) +-gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) ++find_package2(JSONC REQUIRED) ++if(FALSE) + 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}") +@@ -727,7 +726,7 @@ + gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) + + # OpenJPEG's cmake-CONFIG is broken, so call module explicitly +-find_package(OpenJPEG MODULE) ++find_package2(OpenJPEG MODULE) + if (GDAL_USE_OPENJPEG) + if (NOT OPENJPEG_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") diff --git a/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt index 861d8d69409b0..356b571fb9c63 100644 --- a/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt +++ b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -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) - -find_package(GDAL REQUIRED) +find_package(GDAL REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} GDAL::GDAL) diff --git a/recipes/gdal/post_3.5.0/test_package/conanfile.py b/recipes/gdal/post_3.5.0/test_package/conanfile.py index 9dced2ad9cf71..9ae9dd1c61f74 100644 --- a/recipes/gdal/post_3.5.0/test_package/conanfile.py +++ b/recipes/gdal/post_3.5.0/test_package/conanfile.py @@ -1,12 +1,20 @@ -from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake import os +from conan import ConanFile, conan_version +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", "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) @@ -14,10 +22,11 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - if self.options["gdal"].tools: - self.run("gdal_translate --formats", run_environment=True) - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - bin_path_c = os.path.join("bin", "test_package_c") - self.run(bin_path_c, run_environment=True) + if can_run(self): + gdal_options = self.options["gdal"] if conan_version < "2" else self.dependencies["gdal"].options + if gdal_options.tools: + self.run("gdal_translate --formats", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") + bin_path_c = os.path.join(self.cpp.build.bindir, "test_package_c") + self.run(bin_path_c, env="conanrun") diff --git a/recipes/gdal/pre_3.5.0/conandata.yml b/recipes/gdal/pre_3.5.0/conandata.yml index 49983edc62730..16129b5ac3029 100644 --- a/recipes/gdal/pre_3.5.0/conandata.yml +++ b/recipes/gdal/pre_3.5.0/conandata.yml @@ -5,9 +5,6 @@ sources: "3.4.1": url: "https://github.com/OSGeo/gdal/releases/download/v3.4.1/gdal-3.4.1.tar.gz" sha256: "e360387bc25ec24940f46afbeada48002d72c74aaf9eccf2a40e8d74e711a2e4" - "3.3.3": - url: "https://github.com/OSGeo/gdal/releases/download/v3.3.3/gdal-3.3.3.tar.gz" - sha256: "28925ea4717b02185ee208bfc121a94fa0bc1dfe9cb862fd3868c2a0394d605a" patches: "3.4.3": - patch_file: "patches/3.4.x/fix-autotools-3.4.3.patch" @@ -21,9 +18,3 @@ patches: - patch_file: "patches/3.4.x/fix-include-jsonc-3.4.1.patch" - patch_file: "patches/3.4.x/fix-include-xerces.patch" - patch_file: "patches/3.4.x/fix-include-podofo.patch" - "3.3.3": - - patch_file: "patches/3.3.x/fix-autotools-3.3.3.patch" - - patch_file: "patches/3.3.x/fix-nmake.patch" - - 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" diff --git a/recipes/gdal/pre_3.5.0/conanfile.py b/recipes/gdal/pre_3.5.0/conanfile.py index 65bbd7d92d812..046a6f99e292f 100644 --- a/recipes/gdal/pre_3.5.0/conanfile.py +++ b/recipes/gdal/pre_3.5.0/conanfile.py @@ -165,37 +165,6 @@ class GdalConan(ConanFile): def _settings_build(self): return getattr(self, "settings_build", self.settings) - @property - def _has_with_exr_option(self): - return Version(self.version) >= "3.1.0" - - @property - def _has_with_libdeflate_option(self): - return Version(self.version) >= "3.2.0" - - @property - def _has_with_heif_option(self): - return Version(self.version) >= "3.2.0" - - @property - def _has_with_blosc_option(self): - return Version(self.version) >= "3.4.0" - - @property - def _has_with_lz4_option(self): - return Version(self.version) >= "3.4.0" - - @property - def _has_with_brunsli_option(self): - return Version(self.version) >= "3.4.0" - - @property - def _has_with_pcre2_option(self): - return Version(self.version) >= "3.4.1" - - @property - def _has_reentrant_qhull_support(self): - return Version(self.version) >= "3.4.1" def export_sources(self): export_conandata_patches(self) @@ -203,22 +172,6 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - # if Version(self.version) < "3.0.0": - # del self.options.with_tiledb - if not self._has_with_exr_option: - del self.options.with_exr - if not self._has_with_libdeflate_option: - del self.options.with_libdeflate - if not self._has_with_heif_option: - del self.options.with_heif - if not self._has_with_blosc_option: - del self.options.with_blosc - if not self._has_with_lz4_option: - del self.options.with_lz4 - if not self._has_with_brunsli_option: - del self.options.with_brunsli - if not self._has_with_pcre2_option: - del self.options.with_pcre2 def configure(self): if self.options.shared: @@ -239,7 +192,7 @@ def configure(self): self.options.rm_safe("with_png") # and it's not trivial to fix if self.options.with_qhull: - self.options["qhull"].reentrant = self._has_reentrant_qhull_support + self.options["qhull"].reentrant = True def layout(self): basic_layout(self, src_folder="src") @@ -249,24 +202,23 @@ def requirements(self): 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.5.1") - self.requires("proj/9.2.1") - if Version(self.version) >= "3.1.0": - self.requires("flatbuffers/2.0.5") + self.requires("libtiff/4.6.0") + self.requires("proj/9.3.1") + 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.18") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_libdeflate: + self.requires("libdeflate/1.22") if self.options.with_libiconv: self.requires("libiconv/1.17") if self.options.get_safe("with_zstd"): self.requires("zstd/1.5.5") - if self.options.get_safe("with_blosc"): + if self.options.with_blosc: self.requires("c-blosc/1.21.3") - if self.options.get_safe("with_lz4"): + if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_pg: - self.requires("libpq/14.5") + self.requires("libpq/15.4") # if self.options.with_libgrass: # self.requires("libgrass/x.x.x") if self.options.with_cfitsio: @@ -274,7 +226,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.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_dds: self.requires("crunch/cci.20190615") if self.options.with_gta: @@ -318,7 +270,7 @@ def requirements(self): if self.options.with_xerces: self.requires("xerces-c/3.2.4") if self.options.with_expat: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_libkml: self.requires("libkml/1.3.0") if self.options.with_odbc and self.settings.os != "Windows": @@ -326,13 +278,13 @@ def requirements(self): # if self.options.with_dods_root: # self.requires("libdap/3.20.6") if self.options.with_curl: - self.requires("libcurl/8.2.1") + self.requires("libcurl/[>=8.2 <9]") 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.42.0") + self.requires("sqlite3/3.44.2") # if self.options.with_rasterlite2: # self.requires("rasterlite2/x.x.x") if self.options.get_safe("with_pcre"): @@ -367,12 +319,12 @@ def requirements(self): if self.options.with_cryptopp: self.requires("cryptopp/8.7.0") if self.options.with_crypto: - self.requires("openssl/1.1.1u") + self.requires("openssl/[>=1.1 <4]") # 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"): + if self.options.with_exr: self.requires("openexr/3.1.9") - if self.options.get_safe("with_heif"): + if self.options.with_heif: self.requires("libheif/1.13.0") def validate(self): @@ -383,15 +335,13 @@ def validate(self): raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both") if self.options.get_safe("with_pcre2") and not self.dependencies["pcre2"].options.build_pcre2_8: raise ConanInvalidConfiguration("gdal:with_pcre2=True requires pcre2:build_pcre2_8=True") - if self.options.get_safe("with_brunsli"): + if self.options.with_brunsli: raise ConanInvalidConfiguration("brunsli not available in conan-center yet") - if self.options.get_safe("with_libdeflate") and not self.options.get_safe("with_zlib", True): + if self.options.with_libdeflate and not self.options.get_safe("with_zlib", True): raise ConanInvalidConfiguration("gdal:with_libdeflate=True requires gdal:with_zlib=True") if self.options.with_qhull: - if self._has_reentrant_qhull_support and not self.dependencies["qhull"].options.reentrant: + if not self.dependencies["qhull"].options.reentrant: raise ConanInvalidConfiguration(f"{self.ref} depends on reentrant qhull.") - elif not self._has_reentrant_qhull_support and self.dependencies["qhull"].options.reentrant: - raise ConanInvalidConfiguration(f"{self.ref} depends on non-reentrant qhull.") if hasattr(self, "settings_build") and cross_building(self): if self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can't cross-build shared lib") @@ -405,14 +355,14 @@ def validate(self): if mongocxx_version < "3.0.0": # TODO: handle mongo-cxx-driver v2 raise ConanInvalidConfiguration(f"{self.ref} with mongo-cxx-driver < 3.0.0 not yet supported in this recipe.") - elif mongocxx_version < "3.4.0": + if mongocxx_version < "3.4.0": raise ConanInvalidConfiguration(f"{self.ref} with mongo-cxx-driver v3 requires 3.4.0 at least.") 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): @@ -433,9 +383,8 @@ def _patch_sources(self): os.path.join("frmts", "zlib"), # os.path.join("ogr", "ogrsf_frmts", "cad", "libopencad"), # TODO: uncomment when libopencad available os.path.join("ogr", "ogrsf_frmts", "geojson", "libjson"), + os.path.join("ogr", "ogrsf_frmts", "flatgeobuf", "flatbuffers"), ] - if Version(self.version) >= "3.1.0": - embedded_libs.append(os.path.join("ogr", "ogrsf_frmts", "flatgeobuf", "flatbuffers")) for lib_subdir in embedded_libs: rmdir(self, os.path.join(self.source_folder, lib_subdir)) @@ -467,12 +416,8 @@ def _patch_sources(self): replace_in_file(self, gnumakefile_apps, "default: gdal-config-inst gdal-config $(BIN_LIST)", "default: gdal-config-inst gdal-config") - if Version(self.version) < "3.4.0": - clean_pattern = "$(RM) *.o $(BIN_LIST) core gdal-config gdal-config-inst" - else: - clean_pattern = "$(RM) *.o $(BIN_LIST) $(NON_DEFAULT_LIST) core gdal-config gdal-config-inst" replace_in_file(self, gnumakefile_apps, - clean_pattern, + "$(RM) *.o $(BIN_LIST) $(NON_DEFAULT_LIST) core gdal-config gdal-config-inst", "$(RM) *.o core gdal-config gdal-config-inst") replace_in_file(self, gnumakefile_apps, "for f in $(BIN_LIST) ; do $(INSTALL) $$f $(DESTDIR)$(INST_BIN) ; done", @@ -599,8 +544,7 @@ def _nmake_args(self): ]) if self.dependencies["netcdf"].options.netcdf4 and self.dependencies["netcdf"].options.with_hdf5: args.append("NETCDF_HAS_NC4=YES") - if Version(self.version) >= "3.3.0" and \ - os.path.isfile(os.path.join(rootpath("netcdf"), "include", "netcdf_mem.h")): + if os.path.isfile(os.path.join(rootpath("netcdf"), "include", "netcdf_mem.h")): args.append("NETCDF_HAS_NETCDF_MEM=YES") if self.options.with_curl: args.append("CURL_INC=\"-I{}\"".format(include_paths("libcurl"))) @@ -611,7 +555,7 @@ def _nmake_args(self): if self.options.get_safe("with_zlib", True): args.append("ZLIB_EXTERNAL_LIB=1") args.append("ZLIB_INC=\"-I{}\"".format(include_paths("zlib"))) - if self.options.get_safe("with_libdeflate"): + if self.options.with_libdeflate: args.append("LIBDEFLATE_CFLAGS=\"-I{}\"".format(include_paths("libdeflate"))) if self.options.with_poppler: poppler_version = version("poppler") @@ -624,9 +568,9 @@ def _nmake_args(self): args.append("PODOFO_ENABLED=YES") if self.options.get_safe("with_zstd"): args.append("ZSTD_CFLAGS=\"-I{}\"".format(include_paths("zstd"))) - if self.options.get_safe("with_blosc"): + if self.options.with_blosc: args.append("BLOSC_CFLAGS=\"-I{}\"".format(include_paths("c-blosc"))) - if self.options.get_safe("with_lz4"): + if self.options.with_lz4: args.append("LZ4_CFLAGS=\"-I{}\"".format(include_paths("lz4"))) if self.options.with_webp: args.append("WEBP_ENABLED=YES") @@ -648,7 +592,7 @@ def _nmake_args(self): args.append("OPENSSL_INC=\"-I{}\"".format(include_paths("openssl"))) if self.options.without_lerc: args.append("HAVE_LERC=0") - if self.options.get_safe("with_brunsli"): + if self.options.with_brunsli: args.extend([ "BRUNSLI_DIR=\"{}\"".format(rootpath("brunsli")), "BRUNSLI_INC=\"{}\"".format(include_paths("brunsli")), @@ -661,9 +605,9 @@ def _nmake_args(self): args.append("CHARLS_FLAGS=-DCHARLS_2") if self.options.with_dds: args.append("CRUNCH_INC=\"-I{}\"".format(include_paths("crunch"))) - if self.options.get_safe("with_exr"): + if self.options.with_exr: args.append("EXR_INC=\"-I{}\"".format(include_paths("openexr"))) - if self.options.get_safe("with_heif"): + if self.options.with_heif: args.append("HEIF_INC=\"-I{}\"".format(include_paths("libheif"))) return args @@ -729,22 +673,16 @@ def generate(self): # Depencencies: tc.configure_args.append("--with-proj=yes") # always required ! tc.configure_args.append("--with-libz={}".format(yes_no(self.options.with_zlib))) - if self._has_with_libdeflate_option: - tc.configure_args.append("--with-libdeflate={}".format(yes_no(self.options.with_libdeflate))) + tc.configure_args.append("--with-libdeflate={}".format(yes_no(self.options.with_libdeflate))) tc.configure_args.append("--with-libiconv-prefix={}".format(rootpath_no(self.options.with_libiconv, "libiconv"))) tc.configure_args.append("--with-liblzma=no") # always disabled: liblzma is an optional transitive dependency of gdal (through libtiff). tc.configure_args.append("--with-zstd={}".format(yes_no(self.options.get_safe("with_zstd")))) # Optional direct dependency of gdal only if lerc lib enabled - if self._has_with_blosc_option: - tc.configure_args.append("--with-blosc={}".format(yes_no(self.options.with_blosc))) - if self._has_with_lz4_option: - tc.configure_args.append("--with-lz4={}".format(yes_no(self.options.with_lz4))) + tc.configure_args.append("--with-blosc={}".format(yes_no(self.options.with_blosc))) + tc.configure_args.append("--with-lz4={}".format(yes_no(self.options.with_lz4))) # Drivers: if not (self.options.with_zlib and self.options.with_png and bool(self.options.with_jpeg)): # MRF raster driver always depends on zlib, libpng and libjpeg: https://github.com/OSGeo/gdal/issues/2581 - if Version(self.version) < "3.0.0": - tc.configure_args.append("--without-mrf") - else: - tc.configure_args.append("--disable-driver-mrf") + tc.configure_args.append("--disable-driver-mrf") tc.configure_args.append("--with-pg={}".format(yes_no(self.options.with_pg))) tc.configure_args.extend(["--without-grass", "--without-libgrass"]) # TODO: to implement when libgrass lib available tc.configure_args.append("--with-cfitsio={}".format(rootpath_no(self.options.with_cfitsio, "cfitsio"))) @@ -800,15 +738,10 @@ def generate(self): tc.configure_args.append("--without-spatialite") # TODO: to implement when libspatialite lib available tc.configure_args.append("--with-sqlite3={}".format(yes_no(self.options.get_safe("with_sqlite3")))) tc.configure_args.append("--without-rasterlite2") # TODO: to implement when rasterlite2 lib available - if self._has_with_pcre2_option: - tc.configure_args.append("--with-pcre2={}".format(yes_no(self.options.get_safe("with_pcre2")))) + tc.configure_args.append("--with-pcre2={}".format(yes_no(self.options.get_safe("with_pcre2")))) tc.configure_args.append("--with-pcre={}".format(yes_no(self.options.get_safe("with_pcre")))) tc.configure_args.append("--without-teigha") # commercial library tc.configure_args.append("--without-idb") # commercial library - if Version(self.version) < "3.2.0": - tc.configure_args.append("--without-sde") # commercial library - if Version(self.version) < "3.3.0": - tc.configure_args.append("--without-epsilon") tc.configure_args.append("--with-webp={}".format(rootpath_no(self.options.with_webp, "libwebp"))) tc.configure_args.append("--with-geos={}".format(yes_no(self.options.with_geos))) tc.configure_args.append("--without-sfcgal") # TODO: to implement when sfcgal lib available @@ -834,27 +767,19 @@ def generate(self): tc.configure_args.append("--without-python") tc.configure_args.append("--without-java") tc.configure_args.append("--without-hdfs") - if Version(self.version) >= "3.0.0": - tc.configure_args.append("--without-tiledb") # TODO: to implement when tiledb lib available + tc.configure_args.append("--without-tiledb") # TODO: to implement when tiledb lib available tc.configure_args.append("--without-mdb") tc.configure_args.append("--without-rasdaman") # TODO: to implement when rasdaman lib available - if self._has_with_brunsli_option: - tc.configure_args.append("--with-brunsli={}".format(yes_no(self.options.with_brunsli))) - if Version(self.version) >= "3.1.0": - tc.configure_args.append("--without-rdb") # commercial library + tc.configure_args.append("--with-brunsli={}".format(yes_no(self.options.with_brunsli))) + tc.configure_args.append("--without-rdb") # commercial library tc.configure_args.append("--without-armadillo") # TODO: to implement when armadillo lib available tc.configure_args.append("--with-cryptopp={}".format(rootpath_no(self.options.with_cryptopp, "cryptopp"))) tc.configure_args.append("--with-crypto={}".format(yes_no(self.options.with_crypto))) - if Version(self.version) >= "3.3.0": - tc.configure_args.append("--with-lerc={}".format(internal_no(not self.options.without_lerc))) - else: - tc.configure_args.append("--with-lerc={}".format(yes_no(not self.options.without_lerc))) + tc.configure_args.append("--with-lerc={}".format(internal_no(not self.options.without_lerc))) if self.options.with_null: tc.configure_args.append("--with-null") - if self._has_with_exr_option: - tc.configure_args.append("--with-exr={}".format(yes_no(self.options.with_exr))) - if self._has_with_heif_option: - tc.configure_args.append("--with-heif={}".format(yes_no(self.options.with_heif))) + tc.configure_args.append("--with-exr={}".format(yes_no(self.options.with_exr))) + tc.configure_args.append("--with-heif={}".format(yes_no(self.options.with_heif))) tc.generate() AutotoolsDeps(self).generate() @@ -910,7 +835,7 @@ def package_info(self): self.cpp_info.system_libs.append("pthread") elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["psapi", "ws2_32"]) - if Version(self.version) >= "3.2.0" and is_msvc(self): + if is_msvc(self): self.cpp_info.system_libs.append("wbemuuid") if self.options.with_odbc and not self.options.shared: self.cpp_info.system_libs.extend(["odbc32", "odbccp32"]) diff --git a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-autotools-3.3.3.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-autotools-3.3.3.patch deleted file mode 100644 index a5746b4d1e05f..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-autotools-3.3.3.patch +++ /dev/null @@ -1,302 +0,0 @@ ---- a/GDALmake.opt.in -+++ b/GDALmake.opt.in -@@ -600,7 +600,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 -@@ -1175,6 +1175,10 @@ AC_ARG_WITH(libdeflate, - [enable libdeflate usage (optional for faster Deflate support (still requires zlib) (ARG=yes/no/prefix), enabled by default)]),,) - - if test "$with_libdeflate" != "no" ; then -+# AC_CHECK_LIB tests not robust enough (don't handle static libdeflate on windows) -+if test "$with_libdeflate" = "yes" ; then -+ LIBDEFLATE_SETTING=yes -+else - - if test "$with_libdeflate" != "" -a "$with_libdeflate" != "yes"; then - AC_CHECK_LIB(deflate, libdeflate_zlib_decompress, [libdeflate_lib=yes], [libdeflate_lib=no],-L$with_libdeflate/lib) -@@ -1204,13 +1208,13 @@ if test "$with_libdeflate" != "no" ; then - fi - - fi -+fi - - if test "$LIBDEFLATE_SETTING" = "yes" ; then - if test "$with_libdeflate" != "" -a "$with_libdeflate" != "yes"; then - EXTRA_INCLUDES="-I$with_libdeflate/include $EXTRA_INCLUDES" - LIBS="-L$with_libdeflate/lib -ldeflate $LIBS" -- else -- LIBS="-ldeflate $LIBS" -+ # Too fragile: libdeflate static lib name on windows is libdeflatestatic - fi - fi - -@@ -1378,7 +1382,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 - -@@ -1402,23 +1406,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) -@@ -1430,8 +1422,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" -@@ -1462,11 +1457,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,) -@@ -1889,8 +1880,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 -@@ -2222,7 +2213,6 @@ else - - DDS_SETTING=yes - CRUNCHDIR="$with_dds" -- LIBS="-L$with_dds/lib/ -lcrunch $LIBS" - echo "using libcrunch from $with_dds." - - fi -@@ -2373,7 +2363,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" -@@ -2875,6 +2864,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 -@@ -3005,7 +2998,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 -@@ -3074,21 +3066,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 -@@ -3940,18 +3932,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= - -@@ -4045,8 +4034,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" -@@ -4059,6 +4051,7 @@ m4_foreach_w([frmt],EXPAT_DRIVERS,[ - fi - ]) - -+fi - fi - - AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT) -@@ -4305,7 +4298,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 - -@@ -4550,13 +4542,18 @@ 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=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]) -- STRIP_SYSTEM_LIBRARY_PATHS("${GEOS_LIBS}") -- GEOS_LIBS="$STRIPPED_LIBRARY_NAME" - LIBS="${GEOS_LIBS} ${LIBS}" - fi -+fi -+AC_SUBST(HAVE_GEOS, $HAVE_GEOS) - - dnl --------------------------------------------------------------------------- - dnl Check if SFCGAL library is available. -@@ -4588,20 +4585,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 - -@@ -4688,7 +4683,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) - -@@ -4794,8 +4791,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 -@@ -5953,7 +5949,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.3.x/fix-include-jsonc.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-jsonc.patch deleted file mode 100644 index e88043df4189f..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.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.3.x/fix-include-podofo.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-podofo.patch deleted file mode 100644 index aa86489f0296b..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.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.3.x/fix-include-xerces.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-include-xerces.patch deleted file mode 100644 index 8b08760381794..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.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.3.x/fix-nmake.patch b/recipes/gdal/pre_3.5.0/patches/3.3.x/fix-nmake.patch deleted file mode 100644 index 4c0ef454c2aac..0000000000000 --- a/recipes/gdal/pre_3.5.0/patches/3.3.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\blockdir\asciitiledir.obj \ -@@ -70,11 +74,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-3.0.20-find-charls.patch" patch_description: "allow using charls >= 2.2.0" diff --git a/recipes/gdcm/all/conanfile.py b/recipes/gdcm/all/conanfile.py index d65646a1f9550..dd9ef9798d769 100644 --- a/recipes/gdcm/all/conanfile.py +++ b/recipes/gdcm/all/conanfile.py @@ -57,14 +57,14 @@ def layout(self): def requirements(self): self.requires("charls/2.4.2") - self.requires("expat/2.5.0") - self.requires("openjpeg/2.5.0") + self.requires("expat/[>=2.6.2 <3]") + self.requires("openjpeg/2.5.2") if self.options.with_zlibng: - self.requires("zlib-ng/2.1.3") + self.requires("zlib-ng/2.2.0") else: self.requires("zlib/[>=1.2.11 <2]") if self.settings.os != "Windows": - self.requires("util-linux-libuuid/2.39") + self.requires("util-linux-libuuid/2.39.2") if Version(self.version) >= Version("3.0.20"): self.requires("libiconv/1.17") if self.options.with_json: 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/0006-3.0.24-json.patch b/recipes/gdcm/all/patches/0006-3.0.24-json.patch new file mode 100644 index 0000000000000..6aa3414ba7c29 --- /dev/null +++ b/recipes/gdcm/all/patches/0006-3.0.24-json.patch @@ -0,0 +1,13 @@ +--- a/Source/Common/CMakeLists.txt ++++ b/Source/Common/CMakeLists.txt +@@ -52,9 +52,7 @@ unset(CMAKE_REQUIRED_LIBRARIES) + CHECK_SYMBOL_EXISTS(gettimeofday "sys/time.h" GDCM_HAVE_GETTIMEOFDAY) + # json-c API changed: + if(GDCM_USE_SYSTEM_JSON) +- set(CMAKE_REQUIRED_INCLUDES ${JSON_INCLUDE_DIRS}) +- set(CMAKE_REQUIRED_LIBRARIES ${JSON_LIBRARIES}) +- CHECK_SYMBOL_EXISTS(json_object_object_get_ex "json.h" GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX) ++ set(GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX ON CACHE INTERNAL "") + endif() + + include(CheckCXXSourceCompiles) 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/DCMTK_JPEGExt_12Bits.dcm b/recipes/gdcm/all/test_package/DCMTK_JPEGExt_12Bits.dcm deleted file mode 100644 index a38d4be8214fc..0000000000000 Binary files a/recipes/gdcm/all/test_package/DCMTK_JPEGExt_12Bits.dcm and /dev/null differ diff --git a/recipes/gdcm/all/test_package/conanfile.py b/recipes/gdcm/all/test_package/conanfile.py index 68791e0d3201c..09886ae651d09 100644 --- a/recipes/gdcm/all/test_package/conanfile.py +++ b/recipes/gdcm/all/test_package/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.files import mkdir import os + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" @@ -23,8 +24,4 @@ def build(self): def test(self): if can_run(self): 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) - output_file = os.path.join(test_dir, "output.dcm") - self.run(f"\"{bin_path}\" \"{input_file}\" \"{output_file}\"", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/gdcm/all/test_package/test_package.cpp b/recipes/gdcm/all/test_package/test_package.cpp index 38a0b1316570a..3e8750a344529 100644 --- a/recipes/gdcm/all/test_package/test_package.cpp +++ b/recipes/gdcm/all/test_package/test_package.cpp @@ -1,104 +1,8 @@ -/*========================================================================= - - Program: GDCM (Grassroots DICOM). A DICOM library - - Copyright (c) 2006-2011 Mathieu Malaterre - All rights reserved. - See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -/* - * This example is ... guess what this is for :) - */ - #include "gdcmReader.h" -#include "gdcmUIDGenerator.h" -#include "gdcmWriter.h" -#include "gdcmAttribute.h" - -#include - -#ifdef GDCM_USE_SYSTEM_OPENSSL -#include "gdcmCryptoFactory.h" -void test_openssl_link() -{ - (void)gdcm::CryptoFactory::GetFactoryInstance(gdcm::CryptoFactory::OPENSSL); -} -#endif - -#ifdef GDCM_USE_SYSTEM_JSON -#include "gdcmJSON.h" -void test_json_link() -{ - gdcm::JSON json; - json.PrettyPrintOn(); -} -#endif -bool test_uid() +int main() { - gdcm::UIDGenerator uid; - uid.SetRoot( "1.2.3.4.0.0.1" ); - const char *s = uid.Generate(); - return gdcm::UIDGenerator::IsValid(s); -} - -int main(int argc, char* argv[]) -{ - if (argc < 3) - { - std::cerr << argv[0] << " input.dcm output.dcm" << std::endl; - return 1; - } - const char* filename = argv[1]; - const char* outfilename = argv[2]; - - // Instanciate the reader: gdcm::Reader reader; - reader.SetFileName(filename); - if (!reader.Read()) - { - std::cerr << "Could not read: " << filename << std::endl; - return 1; - } - - // If we reach here, we know for sure only 1 thing: - // It is a valid DICOM file (potentially an old ACR-NEMA 1.0/2.0 file) - // (Maybe, it's NOT a Dicom image -could be a DICOMDIR, a RTSTRUCT, etc-) - - // The output of gdcm::Reader is a gdcm::File - gdcm::File& file = reader.GetFile(); - - // the dataset is the the set of element we are interested in: - gdcm::DataSet& ds = file.GetDataSet(); - - // Contruct a static(*) type for Image Comments : - gdcm::Attribute<0x0020, 0x4000> imagecomments; - imagecomments.SetValue("Hello, World !"); - - // Now replace the Image Comments from the dataset with our: - ds.Replace(imagecomments.GetAsDataElement()); - - // Write the modified DataSet back to disk - gdcm::Writer writer; - writer.CheckFileMetaInformationOff(); // Do not attempt to reconstruct the file meta to preserve the file - // as close to the original as possible. - writer.SetFileName(outfilename); - writer.SetFile(file); - if (!writer.Write()) - { - std::cerr << "Could not write: " << outfilename << std::endl; - return 1; - } - std::cout << "GDCM test: success\n"; + reader.SetFileName("myFileName"); return 0; } - -/* - * (*) static type, means that extra DICOM information VR & VM are computed at compilation time. - * The compiler is deducing those values from the template arguments of the class. - */ diff --git a/recipes/gdcm/all/test_v1_package/conanfile.py b/recipes/gdcm/all/test_v1_package/conanfile.py deleted file mode 100644 index a38d3dbb55dca..0000000000000 --- a/recipes/gdcm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,23 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -from conan.tools.files import mkdir -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") - input_file = os.path.join(self.source_folder, os.pardir, "test_package", "DCMTK_JPEGExt_12Bits.dcm") - test_dir = "test_dir" - mkdir(self, test_dir) - output_file = os.path.join(test_dir, "output.dcm") - self.run([bin_path, input_file, output_file], run_environment=True) diff --git a/recipes/gdcm/config.yml b/recipes/gdcm/config.yml index 868e7933ac4a6..3820bf3dda38c 100644 --- a/recipes/gdcm/config.yml +++ b/recipes/gdcm/config.yml @@ -1,4 +1,10 @@ versions: + "3.0.24": + folder: "all" + "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 4f44d797427e7..edcf9d96b7ad2 100644 --- a/recipes/gdk-pixbuf/all/conanfile.py +++ b/recipes/gdk-pixbuf/all/conanfile.py @@ -1,3 +1,5 @@ +import os + from conan import ConanFile, conan_version from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name @@ -10,15 +12,13 @@ from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version -import os - -required_conan_version = ">=1.56.0 <2 || >=2.0.6" +required_conan_version = ">=1.56.0 <2 || >=2.0.8" class GdkPixbufConan(ConanFile): name = "gdk-pixbuf" description = "toolkit for image loading and pixel buffer manipulation" - topics = ("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,36 +63,35 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.77.0", transitive_headers=True, transitive_libs=True) + self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) if self.options.with_libpng: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_libtiff: - self.requires("libtiff/4.4.0") + self.requires("libtiff/4.6.0") if self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.2") elif self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_libjpeg == "mozjpeg": - self.requires("mozjpeg/4.1.1") + self.requires("mozjpeg/4.1.5") def validate(self): 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 == "Macos": - # when running gdk-pixbuf-query-loaders - # dyld: malformed mach-o: load commands size (97560) > 32768 - raise ConanInvalidConfiguration("This package does not support Macos currently") if self.dependencies["glib"].options.shared and is_msvc_static_runtime(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.3 <2]") + # FIXME: unify libgettext and gettext?? + # INFO: gettext provides msgfmt, which is required to build the .mo files + self.tool_requires("gettext/0.22.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.2 <3]") self.tool_requires("glib/") if self.options.with_introspection: self.tool_requires("gobject-introspection/1.72.0") @@ -113,7 +112,6 @@ def generate(self): deps = PkgConfigDeps(self) deps.generate() - tc = MesonToolchain(self) enabled_disabled = lambda v: "enabled" if v else "disabled" true_false = lambda v: "true" if v else "false" @@ -125,8 +123,6 @@ def generate(self): "man": "false", "installed_tests": "false" }) - if Version(self.version) < "2.42.0": - tc.project_options["gir"] = "false" if Version(self.version) >= "2.42.8": tc.project_options.update({ @@ -140,7 +136,6 @@ def generate(self): "tiff": true_false(self.options.with_libtiff), "jpeg": true_false(self.options.with_libjpeg) }) - # Workaround for https://bugs.llvm.org/show_bug.cgi?id=16404 # Only really for the purposes of building on CCI - end users can # workaround this by appropriately setting global linker flags in their profile @@ -150,21 +145,42 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - meson_build = os.path.join(self.source_folder, "meson.build") + gdk_meson_build = os.path.join(self.source_folder, "gdk-pixbuf", "meson.build") + replace_in_file(self, meson_build, "subdir('tests')", "#subdir('tests')") replace_in_file(self, meson_build, "subdir('thumbnailer')", "#subdir('thumbnailer')") - replace_in_file(self, meson_build, - "gmodule_dep.get_variable(pkgconfig: 'gmodule_supported')" if Version(self.version) >= "2.42.6" - else "gmodule_dep.get_pkgconfig_variable('gmodule_supported')", "'true'") + replace_in_file(self, meson_build, "gmodule_dep.get_variable(pkgconfig: 'gmodule_supported')", "'true'") # workaround https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/203 - if Version(self.version) >= "2.42.6": - replace_in_file(self, os.path.join(self.source_folder, "build-aux", "post-install.py"), - "close_fds=True", "close_fds=(sys.platform != 'win32')") + replace_in_file(self, os.path.join(self.source_folder, "build-aux", "post-install.py"), + "close_fds=True", "close_fds=(sys.platform != 'win32')") if Version(self.version) >= "2.42.9": - replace_in_file(self, meson_build, "is_msvc_like ? 'png' : 'libpng'", "'libpng'") - replace_in_file(self, meson_build, "is_msvc_like ? 'jpeg' : 'libjpeg'", "'libjpeg'") - replace_in_file(self, meson_build, "is_msvc_like ? 'tiff' : 'libtiff-4'", "'libtiff-4'") + replace_in_file(self, meson_build, "is_msvc_like = ", "is_msvc_like = false #") + # Fix libtiff and libpng not being linked against when building statically + # Reported upstream: https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/159 + replace_in_file(self, gdk_meson_build, + "dependencies: gdk_pixbuf_deps + [ gdkpixbuf_dep ],", + "dependencies: loaders_deps + gdk_pixbuf_deps + [ gdkpixbuf_dep ],") + # Forcing Conan libgettext instead of system one (if OS != Linux) + if self.settings.os != "Linux": + # FIXME: unify libgettext and gettext ?? + replace_in_file(self, meson_build, + "intl_dep = cc.find_library('intl', required: false)", + "intl_dep = dependency('libgettext', version: '>=0.21', required: false, method: 'pkg-config')") + if self.settings.os == "Macos" and self.options.shared: + # Workaround to avoid generating gdk-pixbuf/loaders.cache fails + # Error output: + # [167/167] Generating gdk-pixbuf/loaders.cache with a custom command (wrapped by meson to capture output) + # FAILED: gdk-pixbuf/loaders.cache + # meson.py --internal exe --capture gdk-pixbuf/loaders.cache -- xxxx/gdk-pixbuf/gdk-pixbuf-query-loaders + # --- stderr --- + # dyld[25158]: Library not loaded: /lib/libgnuintl.8.dylib + # Reason: tried: '/lib/libgnuintl.8.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/lib/libgnuintl.8.dylib' (no such file) + # + # Obviously, the libgnuintl.8.dylib is in the VirtualRunEnv, but the current env is not passed to + # the meson custom_target function as it's wrappering the execution + # custom_target admits also an "env" parameter, but it's not working as expected + replace_in_file(self, gdk_meson_build, "build_by_default: true", "build_by_default: false") def build(self): self._patch_sources() @@ -195,10 +211,13 @@ def package_info(self): self.cpp_info.exelinkflags = ldflags self.cpp_info.sharedlinkflags = ldflags + # Breaking change since Conan >= 2.0.8 + # Related to https://github.com/conan-io/conan/pull/14233 + libdir_variable = "libdir1" if Version(conan_version) < "2.0" else "libdir" pkgconfig_variables = { "bindir": "${prefix}/bin", "gdk_pixbuf_binary_version": "2.10.0", - "gdk_pixbuf_binarydir": "${libdir1}/gdk-pixbuf-2.0/2.10", + "gdk_pixbuf_binarydir": "${%s}/gdk-pixbuf-2.0/2.10" % libdir_variable, "gdk_pixbuf_moduledir": "${gdk_pixbuf_binarydir}/loaders", "gdk_pixbuf_cache_file": "${gdk_pixbuf_binarydir}/loaders.cache", "gdk_pixbuf_csource": "${bindir}/gdk-pixbuf-csource", @@ -213,6 +232,7 @@ def package_info(self): self.runenv_info.define_path("GDK_PIXBUF_PIXDATA", gdk_pixbuf_pixdata) self.env_info.GDK_PIXBUF_PIXDATA = gdk_pixbuf_pixdata # remove in conan v2? + 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"): diff --git a/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt b/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt index 66c6c2f99bdd2..122958e7bc465 100644 --- a/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt +++ b/recipes/gdk-pixbuf/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(gdk-pixbuf REQUIRED CONFIG) diff --git a/recipes/gegles-spdlog_setup/all/conanfile.py b/recipes/gegles-spdlog_setup/all/conanfile.py index fd9faf40ac95a..5724281400475 100644 --- a/recipes/gegles-spdlog_setup/all/conanfile.py +++ b/recipes/gegles-spdlog_setup/all/conanfile.py @@ -39,8 +39,8 @@ def layout(self): def requirements(self): self.requires("cpptoml/0.1.1") - self.requires("spdlog/1.12.0") - self.requires("fmt/10.1.1") + self.requires("spdlog/1.14.1") + self.requires("fmt/10.2.1") def package_id(self): self.info.clear() diff --git a/recipes/gemmlowp/all/test_package/CMakeLists.txt b/recipes/gemmlowp/all/test_package/CMakeLists.txt index f1605354570fc..a3058bd0daee1 100644 --- a/recipes/gemmlowp/all/test_package/CMakeLists.txt +++ b/recipes/gemmlowp/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(gemmlowp REQUIRED CONFIG) diff --git a/recipes/gemmlowp/all/test_v1_package/CMakeLists.txt b/recipes/gemmlowp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/gemmlowp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gemmlowp/all/test_v1_package/conanfile.py b/recipes/gemmlowp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/gemmlowp/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_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/genie/all/conandata.yml b/recipes/genie/all/conandata.yml index 1b0883fe01d12..dcbfe49e2dc2e 100644 --- a/recipes/genie/all/conandata.yml +++ b/recipes/genie/all/conandata.yml @@ -11,3 +11,6 @@ sources: "1170": url: "https://github.com/bkaradzic/GENie/archive/22cc907a4351db46c55f73e6aa901f1b2f0c52ad.zip" sha256: "C7691E50F8FB6F2346D0D3CEED14A26F9DE7AEE658CE30B61770F8BE87C1FE00" + "1181": + url: "https://github.com/bkaradzic/GENie/archive/dde7e5ba4286c90117ba8261c810a904cc305326.zip" + sha256: "8C445842E6B2C3B364BEAE527B241F640DBB08A311D9B077E80642B76A38D0DD" \ No newline at end of file diff --git a/recipes/genie/all/conanfile.py b/recipes/genie/all/conanfile.py index d29587bee35bc..731e87cc4f266 100644 --- a/recipes/genie/all/conanfile.py +++ b/recipes/genie/all/conanfile.py @@ -57,8 +57,10 @@ def _os(self): }[str(self.settings.os)] def _patch_compiler(self, cc, cxx): - replace_in_file(self, os.path.join(self.source_folder, "build", f"gmake.{self._os}", "genie.make"), "CC = gcc", f"CC = {cc}") - replace_in_file(self, os.path.join(self.source_folder, "build", f"gmake.{self._os}", "genie.make"), "CXX = g++", f"CXX = {cxx}") + makefile = os.path.join(self.source_folder, "build", f"gmake.{self._os}", "genie.make") + + replace_in_file(self, makefile, "CC = gcc", f"CC = {cc}" if cc else "") + replace_in_file(self, makefile, "CXX = g++", f"CXX = {cxx}" if cxx else "") @property def _genie_config(self): @@ -79,19 +81,7 @@ def build(self): self._patch_compiler("cccl", "cccl") self.run("make", cwd=self.source_folder) else: - cc = os.environ.get("CC") - cxx = os.environ.get("CXX") - if is_apple_os(self): - if not cc: - cc = "clang" - if not cxx: - cxx = "clang" - else: - if not cc: - cc = "clang" if self.settings.compiler == "clang" else "gcc" - if not cxx: - cxx = "clang++" if self.settings.compiler == "clang" else "g++" - self._patch_compiler(cc, cxx) + self._patch_compiler("", "") autotools = Autotools(self) autotools.make(args=[f"-C {self.source_folder}", f"OS={self._os}", f"config={self._genie_config}"]) diff --git a/recipes/genie/all/test_v1_package/conanfile.py b/recipes/genie/all/test_v1_package/conanfile.py deleted file mode 100644 index 00bbdee2789b3..0000000000000 --- a/recipes/genie/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,11 +0,0 @@ -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("genie ninja", run_environment=True, cwd=os.path.join(self.source_folder, "..", "test_package")) diff --git a/recipes/genie/config.yml b/recipes/genie/config.yml index f8c262eda3d07..47e75e6eafb62 100644 --- a/recipes/genie/config.yml +++ b/recipes/genie/config.yml @@ -7,3 +7,5 @@ versions: folder: "all" "1170": folder: "all" + "1181": + folder: "all" \ No newline at end of file diff --git a/recipes/geographiclib/all/conandata.yml b/recipes/geographiclib/all/conandata.yml index 1f35984a98249..6f7b35b699b25 100644 --- a/recipes/geographiclib/all/conandata.yml +++ b/recipes/geographiclib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4": + url: "https://github.com/geographiclib/geographiclib/archive/refs/tags/v2.4.tar.gz" + sha256: "aa7edc6d86fcc297be6e6d6d53ddb6e622a46ef36fe9317335cac91bf471b5a9" "2.3": url: "https://github.com/geographiclib/geographiclib/archive/refs/tags/v2.3.tar.gz" sha256: "18131077061ef8be14064f073f6dba2897a138519733803af807f861a01976c1" diff --git a/recipes/geographiclib/all/conanfile.py b/recipes/geographiclib/all/conanfile.py index 0fb1787e60859..62fa23933a44e 100644 --- a/recipes/geographiclib/all/conanfile.py +++ b/recipes/geographiclib/all/conanfile.py @@ -2,11 +2,13 @@ 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.env import VirtualBuildEnv from conan.tools.files import ( - apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, - replace_in_file, rm, rmdir + apply_conandata_patches, copy, export_conandata_patches, get, + replace_in_file, rm, rmdir, collect_libs ) from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.53.0" @@ -34,6 +36,35 @@ class GeographiclibConan(ConanFile): "tools": True, } + @property + def _min_cppstd(self): + if Version(self.version) >= "2.4": + return 14 + if Version(self.version) >= "1.51": + return 11 + return None + + @property + def _compilers_minimum_version(self): + if self._min_cppstd == 11: + # Minimum compiler version having C++11 math functions + return { + "apple-clang": "3.3", + "gcc": "4.9", + "clang": "6", + "Visual Studio": "14", # guess + "msvc": "190", + } + elif self._min_cppstd == 14: + return { + "gcc": "7", + "clang": "6", + "Visual Studio": "16", + "msvc": "192", + "apple-clang": "14", + } + return {} + def export_sources(self): export_conandata_patches(self) @@ -48,36 +79,28 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - @property - def _compilers_minimum_version(self): - # Minimum compiler version having C++11 math functions - return { - "apple-clang": "3.3", - "gcc": "4.9", - "clang": "6", - "Visual Studio": "14", # guess - "msvc": "190", - } - def validate(self): - if Version(self.version) >= "1.51": - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + if self.settings.compiler.get_safe("cppstd") and self._min_cppstd: + check_min_cppstd(self, self._min_cppstd) - def loose_lt_semver(v1, v2): - return all(int(p1) < int(p2) for p1, p2 in zip(str(v1).split("."), str(v2).split("."))) + def loose_lt_semver(v1, v2): + 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): - raise ConanInvalidConfiguration( - f"{self.ref} requires C++11 math functions, which your compiler does not support." - ) + 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." + ) if self.options.precision not in ["float", "double"]: # FIXME: add support for extended, quadruple and variable precisions # (may require external libs: boost multiprecision for quadruple, mpfr for variable) raise ConanInvalidConfiguration("extended, quadruple and variable precisions not yet supported in this recipe") + def build_requirements(self): + if Version(self.version) >= "2.4": + self.tool_requires("cmake/[>=3.16 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -97,6 +120,8 @@ def generate(self): tc.variables["GEOGRAPHICLIB_PRECISION"] = self._cmake_option_precision tc.generate() + VirtualBuildEnv(self).generate() + def _patch_sources(self): apply_conandata_patches(self) cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") @@ -105,11 +130,6 @@ def _patch_sources(self): 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 - if not self.options.tools: - 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", "") @@ -132,13 +152,24 @@ def package(self): ]: rmdir(self, os.path.join(os.path.join(self.package_folder, folder))) rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if not self.options.tools: + rmdir(self, os.path.join(self.package_folder, "sbin")) + bin_files = [it for it in os.listdir(os.path.join(self.package_folder, "bin")) if not it.endswith(".dll")] + for it in bin_files: + rm(self, it, os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "geographiclib") self.cpp_info.set_property("cmake_target_name", "GeographicLib::GeographicLib") self.cpp_info.set_property("pkg_config_name", "geographiclib") + # Geographic library name is GeographicLib since version 2.x (was Geographic before) + # It uses a debug postfix _d on Windows or when using multi-configuration generators (like Ninja Multi-Config) + # It's hard to track when using multi-configuration generators, so collect_libs is used + # Plus, it adds -i postfix on Windows when using shared libraries self.cpp_info.libs = collect_libs(self) self.cpp_info.defines.append("GEOGRAPHICLIB_SHARED_LIB={}".format("1" if self.options.shared else "0")) + 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.filenames["cmake_find_package"] = "geographiclib" diff --git a/recipes/geographiclib/all/test_v1_package/CMakeLists.txt b/recipes/geographiclib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/geographiclib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/geographiclib/all/test_v1_package/conanfile.py b/recipes/geographiclib/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/geographiclib/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_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/geographiclib/config.yml b/recipes/geographiclib/config.yml index 23b0bc998f804..2557b05844a79 100644 --- a/recipes/geographiclib/config.yml +++ b/recipes/geographiclib/config.yml @@ -1,4 +1,6 @@ versions: + "2.4": + folder: all "2.3": folder: all "1.52": diff --git a/recipes/geos/all/conandata.yml b/recipes/geos/all/conandata.yml index cce81a5d0af84..1c16e5baab94b 100644 --- a/recipes/geos/all/conandata.yml +++ b/recipes/geos/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.13.0": + url: "https://github.com/libgeos/geos/releases/download/3.13.0/geos-3.13.0.tar.bz2" + sha256: "47ec83ff334d672b9e4426695f15da6e6368244214971fabf386ff8ef6df39e4" + "3.12.2": + url: "https://github.com/libgeos/geos/releases/download/3.12.2/geos-3.12.2.tar.bz2" + sha256: "34c7770bf0090ee88488af98767d08e779f124fa33437e0aabec8abd4609fec6" "3.12.0": url: "https://github.com/libgeos/geos/releases/download/3.12.0/geos-3.12.0.tar.bz2" sha256: "d96db96011259178a35555a0f6d6e75a739e52a495a6b2aa5efb3d75390fbc39" @@ -17,9 +23,3 @@ 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 5bfc63783c7e5..1eefc045b2934 100644 --- a/recipes/geos/all/conanfile.py +++ b/recipes/geos/all/conanfile.py @@ -2,7 +2,7 @@ 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, export_conandata_patches, apply_conandata_patches +from conan.tools.files import copy, get, rmdir, replace_in_file from conan.tools.scm import Version import os @@ -11,11 +11,11 @@ class GeosConan(ConanFile): name = "geos" - description = "C++11 library for performing operations on two-dimensional vector geometries" + description = "GEOS is a C++ library for performing operations on two-dimensional vector geometries." license = "LGPL-2.1" - topics = ("osgeo", "geometry", "topology", "geospatial") - homepage = "https://trac.osgeo.org/geos" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libgeos.org/" + topics = ("osgeo", "geometry", "topology", "geospatial") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -51,9 +51,6 @@ def _compilers_minimum_version(self): 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 @@ -96,8 +93,15 @@ def generate(self): tc.variables["BUILD_GEOSOP"] = self.options.utils tc.generate() + def _patch_sources(self): + # Avoid setting CMAKE_BUILD_TYPE default when multi-config generators are used. + # https://github.com/libgeos/geos/pull/945 + if Version(self.version) <= "3.12.1": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_BUILD_TYPE ${DEFAULT_BUILD_TYPE})", "") + def build(self): - apply_conandata_patches(self) + self._patch_sources() 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 deleted file mode 100644 index d0abdd50a8211..0000000000000 --- a/recipes/geos/all/patches/3.12.0-0001-fix-cmake.patch +++ /dev/null @@ -1,31 +0,0 @@ -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/all/test_package/CMakeLists.txt b/recipes/geos/all/test_package/CMakeLists.txt index 18b308026f83b..7f38f9c290c82 100644 --- a/recipes/geos/all/test_package/CMakeLists.txt +++ b/recipes/geos/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(geos CONFIG REQUIRED geos_c) diff --git a/recipes/geos/all/test_v1_package/CMakeLists.txt b/recipes/geos/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/geos/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/geos/all/test_v1_package/conanfile.py b/recipes/geos/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/geos/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_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/geos/config.yml b/recipes/geos/config.yml index bbc8ab7daf85c..b2d68bf99ca6a 100644 --- a/recipes/geos/config.yml +++ b/recipes/geos/config.yml @@ -1,4 +1,8 @@ versions: + "3.13.0": + folder: all + "3.12.2": + folder: all "3.12.0": folder: all "3.11.2": diff --git a/recipes/geotrans/all/test_package/CMakeLists.txt b/recipes/geotrans/all/test_package/CMakeLists.txt index 5e9431340ab31..af6e5ea59e49d 100644 --- a/recipes/geotrans/all/test_package/CMakeLists.txt +++ b/recipes/geotrans/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(geotrans REQUIRED dtcc ccs CONFIG) diff --git a/recipes/geotrans/all/test_v1_package/CMakeLists.txt b/recipes/geotrans/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/geotrans/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/geotrans/all/test_v1_package/conanfile.py b/recipes/geotrans/all/test_v1_package/conanfile.py deleted file mode 100644 index 2f992fa32bae6..0000000000000 --- a/recipes/geotrans/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,29 +0,0 @@ -from conans import ConanFile, CMake, tools -from contextlib import contextmanager -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() - - @contextmanager - def _workaround_2profiles(self): - if hasattr(self, "settings_build"): - with tools.environment_append( - {"MSPCCS_DATA": os.path.join(self.deps_cpp_info["geotrans"].rootpath, "res")} - ): - yield - else: - yield - - def test(self): - if not tools.cross_building(self): - with self._workaround_2profiles(): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/getdns/all/CMakeLists.txt b/recipes/getdns/all/CMakeLists.txt deleted file mode 100644 index f96c6dd4ed727..0000000000000 --- a/recipes/getdns/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(WIN32) - set(CMAKE_REQUIRED_LIBRARIES ws2_32) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/getdns/all/conan_deps.cmake b/recipes/getdns/all/conan_deps.cmake new file mode 100644 index 0000000000000..0925ccf84a265 --- /dev/null +++ b/recipes/getdns/all/conan_deps.cmake @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper) + +# Wrapper for find_package() that sets variables in the format expected by the project +macro(custom_find_package name) + find_package(${name} REQUIRED CONFIG + # Allow only Conan packages + NO_DEFAULT_PATH + PATHS ${CMAKE_PREFIX_PATH} + ) + string(TOUPPER ${name} name_upper) + set(${name_upper}_FOUND TRUE) + set(${name_upper}_INCLUDE_DIR ${${name}_INCLUDE_DIR}) + set(${name_upper}_LIBRARIES ${${name}_LIBRARIES}) +endmacro() + +custom_find_package(OpenSSL) +if(BUILD_LIBEV) + custom_find_package(Libev) +endif() +if(BUILD_LIBEVENT2) + custom_find_package(Libevent2) +endif() +if(BUILD_LIBUV) + custom_find_package(Libuv) +endif() +if(USE_LIBIDN2) + custom_find_package(Libidn2) +endif() diff --git a/recipes/getdns/all/conandata.yml b/recipes/getdns/all/conandata.yml index 63656d1d51254..a97e641f541f4 100644 --- a/recipes/getdns/all/conandata.yml +++ b/recipes/getdns/all/conandata.yml @@ -1,14 +1,11 @@ sources: - "1.6.0": - url: "https://getdnsapi.net/dist/getdns-1.6.0.tar.gz" - sha256: "40e5737471a3902ba8304b0fd63aa7c95802f66ebbc6eae53c487c8e8a380f4a" + "1.7.3": + url: "https://getdnsapi.net/dist/getdns-1.7.3.tar.gz" + sha256: "f1404ca250f02e37a118aa00cf0ec2cbe11896e060c6d369c6761baea7d55a2c" patches: - "1.6.0": - - patch_file: "patches/1.6.0-0001-install-runtimes.patch" - base_path: "source_subfolder" + "1.7.3": - patch_file: "patches/1.6.0-0002-fix-exports-extension-libraries.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.6.0-0004-dont-install-symlinked-license.patch" - base_path: "source_subfolder" + - patch_file: "patches/1.7.3-fix-windows-build.patch" + patch_description: "Fix Windows build" + patch_source: "https://github.com/getdnsapi/getdns/pull/538" + patch_type: "portability" diff --git a/recipes/getdns/all/conanfile.py b/recipes/getdns/all/conanfile.py index a1d7aed1728a6..33e5e1ab9e6c1 100644 --- a/recipes/getdns/all/conanfile.py +++ b/recipes/getdns/all/conanfile.py @@ -1,24 +1,28 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import glob import os +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, rm +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" + class GetDnsConan(ConanFile): name = "getdns" description = "A modern asynchronous DNS API" - topics = "conan", "getdns", "asynchronous", "event" license = "BSD-3-Clause" - homepage = "https://getdnsapi.net/" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://getdnsapi.net/" + topics = ("dns", "asynchronous", "event") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - exports_sources = "CMakeLists.txt", "patches/**" options = { "shared": [True, False], "fPIC": [True, False], - "tls": [False, "gnutls"], - "stub_only": ["auto", True, False], - "with_libev": ["auto", True, False], + "with_libev": [True, False], "with_libevent": [True, False], "with_libuv": [True, False], "with_libidn2": [True, False], @@ -26,36 +30,15 @@ class GetDnsConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "stub_only": "auto", - "tls": False, - "with_libev": "auto", + "with_libev": True, "with_libevent": True, "with_libuv": True, - "with_libidn2": True, + "with_libidn2": True } - generators = "cmake", "pkg_config", "cmake_find_package" - - _cmake = None - - @property - def _with_libev(self): - if self.options.with_libev == "auto": - return self.settings.os != "Windows" - else: - return self.options.with_libev - - @property - def _stub_only(self): - if self.options.stub_only == "auto": - # FIXME: uncomment the next line when libunbound is available - # return self.settings.os == "Windows" - return True - else: - return self.options.stub_only - - @property - def _source_subfolder(self): - return "source_subfolder" + + def export_sources(self): + export_conandata_patches(self) + copy(self, "conan_deps.cmake", src=self.recipe_folder, dst=os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -63,108 +46,119 @@ 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): - self.requires("openssl/1.1.1j") - if self._with_libev: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_libev: self.requires("libev/4.33") if self.options.with_libevent: self.requires("libevent/2.1.12") if self.options.with_libuv: - self.requires("libuv/1.41.0") + self.requires("libuv/1.48.0") if self.options.with_libidn2: self.requires("libidn2/2.3.0") - if self.options.tls == "gnutls": - self.requires("nettle/3.6") - # FIXME: missing gnutls recipe - raise ConanInvalidConfiguration("gnutls is not (yet) available on cci") - if not self._stub_only: - # FIXME: missing libunbound recipe - raise ConanInvalidConfiguration("libunbound is not (yet) available on cci") def build_requirements(self): - self.build_requires("pkgconf/1.7.3") + self.tool_requires("cmake/[>=3.20 <4]") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("getdns-{}".format(self.version), self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = not self.options["openssl"].shared - self._cmake.definitions["ENABLE_SHARED"] = self.options.shared - self._cmake.definitions["ENABLE_STATIC"] = not self.options.shared - self._cmake.definitions["ENABLE_STUB_ONLY"] = self._stub_only - self._cmake.definitions["BUILD_LIBEV"] = self._with_libev - self._cmake.definitions["BUILD_LIBEVENT2"] = self.options.with_libevent - self._cmake.definitions["BUILD_LIBUV"] = self.options.with_libuv - self._cmake.definitions["USE_LIBIDN2"] = self.options.with_libidn2 - self._cmake.definitions["USE_GNUTLS"] = self.options.tls == "gnutls" - self._cmake.definitions["BUILD_TESTING"] = False - - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_getdns_INCLUDE"] = "conan_deps.cmake" + tc.variables["OPENSSL_USE_STATIC_LIBS"] = not self.dependencies["openssl"].options.shared + tc.variables["ENABLE_SHARED"] = self.options.shared + tc.variables["ENABLE_STATIC"] = not self.options.shared + # INFO: Disabling stub-only requires libunbound + tc.variables["ENABLE_STUB_ONLY"] = True + tc.variables["BUILD_LIBEV"] = self.options.with_libev + tc.variables["BUILD_LIBEVENT2"] = self.options.with_libevent + tc.variables["BUILD_LIBUV"] = self.options.with_libuv + tc.variables["USE_LIBIDN2"] = self.options.with_libidn2 + # INFO: GnuTLS requires libdane support and is not supported by MSVC + tc.variables["USE_GNUTLS"] = False + # Force use of internal strptime when cross-compiling + tc.variables["FORCE_COMPAT_STRPTIME"] = True + tc.variables["BUILD_TESTING"] = False + # To fix OpenSSL try_compile() checks + # https://github.com/conan-io/conan/issues/12180 + tc.variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + if self.settings.compiler in ["clang", "apple-clang"]: + # INFO: https://github.com/getdnsapi/getdns/issues/544 + # TODO: Change to extra_clfags when CCI only uses Conan 2.x + tc.blocks["cmake_flags_init"].template += '\nstring(APPEND CMAKE_C_FLAGS_INIT " -Wno-incompatible-function-pointer-types")' + if self.options.with_libidn2 and is_msvc(self): + # INFO: getdns_static.lib(convert.c.obj): error LNK2019: unresolved external symbol __imp_idn2_lookup_u8 + tc.preprocessor_definitions.update({it: 1 for it in self.dependencies["libidn2"].cpp_info.defines}) + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("libev", "cmake_file_name", "Libev") + deps.set_property("libev", "cmake_target_name", "Libev::Libev") + deps.set_property("libevent", "cmake_file_name", "Libevent2") + deps.set_property("libevent::core", "cmake_target_name", "Libevent2::Libevent_core") + deps.set_property("libidn2", "cmake_file_name", "Libidn2") + deps.set_property("libidn2", "cmake_target_name", "Libidn2::Libidn2") + deps.set_property("libuv", "cmake_file_name", "Libuv") + deps.set_property("libuv", "cmake_target_name", "Libuv::Libuv") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + rm(self, "Find*.cmake", os.path.join(self.source_folder, "cmake", "modules")) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - # Use FindOpenSSL.cmake to let check_function_exists succeed - # Remove other cmake modules as they use FindPkgConfig - for fn in glob.glob("Find*cmake"): - if "OpenSSL" not in fn: - os.unlink(fn) - cmake = self._configure_cmake() + self._patch_sources() + 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, "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")) - tools.rmdir(os.path.join(self.package_folder, "share")) - - def package_id(self): - self.info.options.stub_only = self._stub_only - self.info.options.with_libev = self._with_libev + 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): libsuffix = "" - if self.settings.compiler == "Visual Studio" and not self.options.shared: + if is_msvc(self) and not self.options.shared: libsuffix = "_static" - self.cpp_info.components["libgetdns"].libs = ["getdns" + libsuffix] self.cpp_info.components["libgetdns"].includedirs.append(os.path.join("include", "getdns")) - self.cpp_info.components["libgetdns"].names["pkg_config"]= "getdns" + self.cpp_info.components["libgetdns"].set_property("pkg_config_name", "getdns") self.cpp_info.components["libgetdns"].requires = ["openssl::openssl"] if self.options.with_libidn2: self.cpp_info.components["libgetdns"].requires.append("libidn2::libidn2") - if self.options.with_libidn2: - self.cpp_info.components["libgetdns"].requires.append("libidn2::libidn2") - if self.options.tls == "gnutls": - self.cpp_info.components["libgetdns"].requires.extend(["nettle::nettle", "gnutls::gnutls"]) + if self.settings.os == "Windows": + self.cpp_info.components["libgetdns"].system_libs.extend(["ws2_32", "crypt32", "gdi32", "iphlpapi", "psapi", "userenv"]) if self.options.with_libevent: - self.cpp_info.components["dns_ex_event"].libs = ["getdns_ex_event" + libsuffix] - self.cpp_info.components["dns_ex_event"].requires= ["libgetdns", "libevent::libevent"] - self.cpp_info.components["dns_ex_event"].names["pkg_config"]= "getdns_ext_event" + self.cpp_info.components["dns_ext_event"].libs = ["getdns_ext_event" + libsuffix] + self.cpp_info.components["dns_ext_event"].requires = ["libgetdns", "libevent::libevent"] + self.cpp_info.components["dns_ext_event"].set_property("pkg_config_name", "getdns_ext_event") - if self._with_libev: - self.cpp_info.components["dns_ex_ev"].libs = ["getdns_ex_ev" + libsuffix] - self.cpp_info.components["dns_ex_ev"].requires = ["libgetdns", "libev::libev"] - self.cpp_info.components["dns_ex_ev"].names["pkg_config"]= "getdns_ext_ev" + if self.options.with_libev: + self.cpp_info.components["dns_ext_ev"].libs = ["getdns_ext_ev" + libsuffix] + self.cpp_info.components["dns_ext_ev"].requires = ["libgetdns", "libev::libev"] + self.cpp_info.components["dns_ext_ev"].set_property("pkg_config_name", "getdns_ext_ev") if self.options.with_libuv: - self.cpp_info.components["dns_ex_uv"].libs = ["getdns_ex_uv" + libsuffix] - self.cpp_info.components["dns_ex_uv"].requires = ["libgetdns", "libuv::libuv"] - self.cpp_info.components["dns_ex_uv"].names["pkg_config"]= "getdns_ext_uv" + self.cpp_info.components["dns_ext_uv"].libs = ["getdns_ext_uv" + libsuffix] + self.cpp_info.components["dns_ext_uv"].requires = ["libgetdns", "libuv::libuv"] + self.cpp_info.components["dns_ext_uv"].set_property("pkg_config_name", "getdns_ext_uv") + # TODO: Remove after dropping support for Conan 1.x in ConanCenterIndex 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/getdns/all/patches/1.6.0-0001-install-runtimes.patch b/recipes/getdns/all/patches/1.6.0-0001-install-runtimes.patch deleted file mode 100644 index de23061cc40af..0000000000000 --- a/recipes/getdns/all/patches/1.6.0-0001-install-runtimes.patch +++ /dev/null @@ -1,33 +0,0 @@ -Based on https://github.com/getdnsapi/getdns/pull/477 - ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -1055,22 +1055,22 @@ - endif () - endif () - if (ENABLE_SHARED) -- install(TARGETS getdns_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -+ install(TARGETS getdns_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - if (USE_LIBEV) -- install(TARGETS getdns_ex_ev_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -+ install(TARGETS getdns_ex_ev_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif () - if (USE_LIBEVENT2) -- install(TARGETS getdns_ex_event_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -+ install(TARGETS getdns_ex_event_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif () - if (USE_LIBUV) -- install(TARGETS getdns_ex_uv_shared LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -+ install(TARGETS getdns_ex_uv_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif () - endif () - if (BUILD_GETDNS_QUERY) -- install(TARGETS getdns_query RUNTIME DESTINATION bin) -+ install(TARGETS getdns_query RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif () - if (BUILD_GETDNS_SERVER_MON) -- install(TARGETS getdns_server_mon RUNTIME DESTINATION bin) -+ install(TARGETS getdns_server_mon RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif () - - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/getdns DESTINATION include) diff --git a/recipes/getdns/all/patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch b/recipes/getdns/all/patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch deleted file mode 100644 index 9e446cae01b2a..0000000000000 --- a/recipes/getdns/all/patches/1.6.0-0003-let-find-modules-use-pkgconfig.patch +++ /dev/null @@ -1,641 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -659,9 +659,9 @@ - target_include_directories(getdns_objects PRIVATE src/ssl_dane) - set(USE_DANESSL 1) - endif () --if (Libidn_FOUND) -- target_include_directories(getdns_objects PRIVATE ${LIBIDN_INCLUDE_DIR}) --endif () -+#if (Libidn_FOUND) -+# target_include_directories(getdns_objects PRIVATE ${LIBIDN_INCLUDE_DIR}) -+#endif () - if (Libidn2_FOUND) - target_include_directories(getdns_objects PRIVATE ${LIBIDN2_INCLUDE_DIR}) - endif () -@@ -695,9 +695,9 @@ - if (Libunbound_FOUND) - target_link_libraries(getdns PUBLIC Libunbound::Libunbound) - endif () -- if (Libidn_FOUND) -- target_link_libraries(getdns PUBLIC Libidn::Libidn) -- endif () -+# if (Libidn_FOUND) -+# target_link_libraries(getdns PUBLIC Libidn::Libidn) -+# endif () - if (Libidn2_FOUND) - target_link_libraries(getdns PUBLIC Libidn2::Libidn2) - endif () ---- cmake/modules/FindGnuTLS.cmake -+++ cmake/modules/FindGnuTLS.cmake -@@ -30,51 +30,65 @@ - - #]=======================================================================] - --find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h -- HINTS -- "${GNUTLS_DIR}" -- "${GNUTLS_DIR}/include" --) -- --find_library(GNUTLS_LIBRARY NAMES gnutls libgnutls -- HINTS -- "${GNUTLS_DIR}" -- "${GNUTLS_DIR}/lib" --) -- --find_library(GNUTLS_DANE_LIBRARY NAMES gnutls-dane libgnutls-dane -- HINTS -- "${GNUTLS_DIR}" -- "${GNUTLS_DIR}/lib" --) -- --set(GNUTLS_LIBRARIES "") -- --if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY AND GNUTLS_DANE_LIBRARY) -- if (NOT TARGET GnuTLS::GnuTLS) -- add_library(GnuTLS::GnuTLS UNKNOWN IMPORTED) -- set_target_properties(GnuTLS::GnuTLS PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}" -- IMPORTED_LINK_INTERFACE_LANGUAGES "C" -- IMPORTED_LOCATION "${GNUTLS_LIBRARY}" -- ) -- endif () -- if (NOT TARGET GnuTLS::Dane) -- add_library(GnuTLS::Dane UNKNOWN IMPORTED) -- set_target_properties(GnuTLS::Dane PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}" -- IMPORTED_LINK_INTERFACE_LANGUAGES "C" -- IMPORTED_LOCATION "${GNUTLS_DANE_LIBRARY}" -- ) -- endif () -- -- if (NOT GNUTLS_VERSION AND GNUTLS_INCLUDE_DIR) -- file(STRINGS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h" GNUTLS_VER_H REGEX "^#define GNUTLS_VERSION_(MAJOR|MINOR|PATCH) ") -- string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3c" GNUTLS_VERSION "${GNUTLS_VER_H}") -- endif () -+include(FindPkgConfig) -+if(PKG_CONFIG_FOUND) -+ pkg_check_modules(PkgGnuTLS IMPORTED_TARGET GLOBAL QUIET gnutls) -+ pkg_check_modules(PkgGnuTLSDane IMPORTED_TARGET GLOBAL QUIET gnutls-dane) - endif() - --list(APPEND GNUTLS_LIBRARIES "${GNUTLS_LIBRARY}" "${GNUTLS_DANE_LIBRARY}") -+if(PkgGnuTLS_FOUND AND PkgGnuTLSDane_FOUND) -+ set(GNUTLS_INCLUDE_DIR ${PkgGnuTLS_INCLUDE_DIRS} $PkgGnuTLSDane_INCLUDE_DIRS}) -+ set(NETTLE_LIBRARIES ${PkgGnuTLS_LIBRARIES} ${PkgGnuTLSDane_LIBRARIES}) -+ set(NETTLE_VERSION ${PkgGnuTLS_VERSION}) -+ add_library(GnuTLS::GnuTLS ALIAS PkgConfig::PkgGnuTLS) -+ add_library(GnuTLS::Dane ALIAS PkgConfig::PkgGnuTLSDane) -+else() -+ find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h -+ HINTS -+ "${GNUTLS_DIR}" -+ "${GNUTLS_DIR}/include" -+ ) -+ -+ find_library(GNUTLS_LIBRARY NAMES gnutls libgnutls -+ HINTS -+ "${GNUTLS_DIR}" -+ "${GNUTLS_DIR}/lib" -+ ) -+ -+ find_library(GNUTLS_DANE_LIBRARY NAMES gnutls-dane libgnutls-dane -+ HINTS -+ "${GNUTLS_DIR}" -+ "${GNUTLS_DIR}/lib" -+ ) -+ -+ set(GNUTLS_LIBRARIES "") -+ -+ if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY AND GNUTLS_DANE_LIBRARY) -+ if (NOT TARGET GnuTLS::GnuTLS) -+ add_library(GnuTLS::GnuTLS UNKNOWN IMPORTED) -+ set_target_properties(GnuTLS::GnuTLS PROPERTIES -+ INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}" -+ IMPORTED_LINK_INTERFACE_LANGUAGES "C" -+ IMPORTED_LOCATION "${GNUTLS_LIBRARY}" -+ ) -+ endif () -+ if (NOT TARGET GnuTLS::Dane) -+ add_library(GnuTLS::Dane UNKNOWN IMPORTED) -+ set_target_properties(GnuTLS::Dane PROPERTIES -+ INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}" -+ IMPORTED_LINK_INTERFACE_LANGUAGES "C" -+ IMPORTED_LOCATION "${GNUTLS_DANE_LIBRARY}" -+ ) -+ endif () -+ -+ if (NOT GNUTLS_VERSION AND GNUTLS_INCLUDE_DIR) -+ file(STRINGS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h" GNUTLS_VER_H REGEX "^#define GNUTLS_VERSION_(MAJOR|MINOR|PATCH) ") -+ string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3c" GNUTLS_VERSION "${GNUTLS_VER_H}") -+ endif () -+ endif() -+ -+ list(APPEND GNUTLS_LIBRARIES "${GNUTLS_LIBRARY}" "${GNUTLS_DANE_LIBRARY}") -+endif() - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(GnuTLS ---- cmake/modules/FindLibevent2.cmake -+++ cmake/modules/FindLibevent2.cmake -@@ -28,37 +28,49 @@ - - #]=======================================================================] - --find_path(LIBEVENT2_INCLUDE_DIR event2/event.h -- HINTS -- "${LIBEVENT2_DIR}" -- "${LIBEVENT2_DIR}/include" --) -- --find_library(LIBEVENT2_LIBRARY NAMES event_core libevent_core -- HINTS -- "${LIBEVENT2_DIR}" -- "${LIBEVENT2_DIR}/lib" --) -- --set(LIBEVENT2_LIBRARIES "") -- --if (LIBEVENT2_INCLUDE_DIR AND LIBEVENT2_LIBRARY) -- if (NOT TARGET Libevent2::Libevent_core) -- add_library(Libevent2::Libevent_core UNKNOWN IMPORTED) -- set_target_properties(Libevent2::Libevent_core PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT2_INCLUDE_DIR}" -- IMPORTED_LINK_INTERFACE_LANGUAGES "C" -- IMPORTED_LOCATION "${LIBEVENT2_LIBRARY}" -- ) -- endif () -- -- if (NOT LIBEVENT2_VERSION AND LIBEVENT2_INCLUDE_DIR AND EXISTS "${LIBEVENT2_INCLUDE_DIR}/event2/event.h") -- file(STRINGS "${LIBEVENT2_INCLUDE_DIR}/event2/event-config.h" LIBEVENT2_H REGEX "^#define _?EVENT_+VERSION ") -- string(REGEX REPLACE "^.*EVENT_+VERSION \"([^\"]+)\".*$" "\\1" LIBEVENT2_VERSION "${LIBEVENT2_H}") -- endif () -+include(FindPkgConfig) -+if(PKG_CONFIG_FOUND) -+ pkg_check_modules(PkgLibevent IMPORTED_TARGET GLOBAL QUIET libevent>=2) - endif() - --list(APPEND LIBEVENT2_LIBRARIES "${LIBEVENT2_LIBRARY}") -+if(PkgLibevent_FOUND) -+ set(LIBEVENT2_INCLUDE_DIR ${PkgLibevent_INCLUDE_DIRS}) -+ set(LIBEVENT2_LIBRARIES ${PkgLibevent_LIBRARIES}) -+ set(LIBEVENT2_VERSION ${PkgLibevent_VERSION}) -+ add_library(Libevent2::Libevent_core ALIAS PkgConfig::PkgLibevent) -+else() -+ find_path(LIBEVENT2_INCLUDE_DIR event2/event.h -+ HINTS -+ "${LIBEVENT2_DIR}" -+ "${LIBEVENT2_DIR}/include" -+ ) -+ -+ find_library(LIBEVENT2_LIBRARY NAMES event_core libevent_core -+ HINTS -+ "${LIBEVENT2_DIR}" -+ "${LIBEVENT2_DIR}/lib" -+ ) -+ -+ set(LIBEVENT2_LIBRARIES "") -+ -+ if (LIBEVENT2_INCLUDE_DIR AND LIBEVENT2_LIBRARY) -+ if (NOT TARGET Libevent2::Libevent_core) -+ add_library(Libevent2::Libevent_core UNKNOWN IMPORTED) -+ set_target_properties(Libevent2::Libevent_core PROPERTIES -+ INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT2_INCLUDE_DIR}" -+ IMPORTED_LINK_INTERFACE_LANGUAGES "C" -+ IMPORTED_LOCATION "${LIBEVENT2_LIBRARY}" -+ ) -+ endif () -+ -+ if (NOT LIBEVENT2_VERSION AND LIBEVENT2_INCLUDE_DIR AND EXISTS "${LIBEVENT2_INCLUDE_DIR}/event2/event.h") -+ file(STRINGS "${LIBEVENT2_INCLUDE_DIR}/event2/event-config.h" LIBEVENT2_H REGEX "^#define _?EVENT_+VERSION ") -+ string(REGEX REPLACE "^.*EVENT_+VERSION \"([^\"]+)\".*$" "\\1" LIBEVENT2_VERSION "${LIBEVENT2_H}") -+ endif () -+ endif() -+ -+ list(APPEND LIBEVENT2_LIBRARIES "${LIBEVENT2_LIBRARY}") -+endif() - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Libevent2 ---- cmake/modules/FindLibidn2.cmake -+++ cmake/modules/FindLibidn2.cmake -@@ -28,37 +28,49 @@ - - #]=======================================================================] - --find_path(LIBIDN2_INCLUDE_DIR idn2.h -- HINTS -- "${LIBIDN2_DIR}" -- "${LIBIDN2_DIR}/include" --) -- --find_library(LIBIDN2_LIBRARY NAMES idn2 libidn2 -- HINTS -- "${LIBIDN2_DIR}" -- "${LIBIDN2_DIR}/lib" --) -- --set(LIBIDN2_LIBRARIES "") -- --if (LIBIDN2_INCLUDE_DIR AND LIBIDN2_LIBRARY) -- if (NOT TARGET Libidn2::Libidn2) -- add_library(Libidn2::Libidn2 UNKNOWN IMPORTED) -- set_target_properties(Libidn2::Libidn2 PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${LIBIDN2_INCLUDE_DIR}" -- IMPORTED_LINK_INTERFACE_LANGUAGES "C" -- IMPORTED_LOCATION "${LIBIDN2_LIBRARY}" -+include(FindPkgConfig) -+if(PKG_CONFIG_FOUND) -+ pkg_check_modules(PkgLibIdn2 IMPORTED_TARGET GLOBAL libidn2) -+endif() -+ -+if(PkgLibIdn2_FOUND) -+ set(LIBIDN2_INCLUDE_DIR ${PkgLibIdn2_INCLUDE_DIRS}) -+ set(LIBIDN2_LIBRARIES ${PkgLibIdn2_LIBRARIES}) -+ set(LIBIDN2_VERSION ${PkgLibIdn2_VERSION}) -+ add_library(Libidn2::Libidn2 ALIAS PkgConfig::PkgLibIdn2) -+else() -+ find_path(LIBIDN2_INCLUDE_DIR idn2.h -+ HINTS -+ "${LIBIDN2_DIR}" -+ "${LIBIDN2_DIR}/include" -+ ) -+ -+ find_library(LIBIDN2_LIBRARY NAMES idn2 libidn2 -+ HINTS -+ "${LIBIDN2_DIR}" -+ "${LIBIDN2_DIR}/lib" -+ ) -+ -+ set(LIBIDN2_LIBRARIES "") -+ -+ if (LIBIDN2_INCLUDE_DIR AND LIBIDN2_LIBRARY) -+ if (NOT TARGET Libidn2::Libidn2) -+ add_library(Libidn2::Libidn2 UNKNOWN IMPORTED) -+ set_target_properties(Libidn2::Libidn2 PROPERTIES -+ INTERFACE_INCLUDE_DIRECTORIES "${LIBIDN2_INCLUDE_DIR}" -+ IMPORTED_LINK_INTERFACE_LANGUAGES "C" -+ IMPORTED_LOCATION "${LIBIDN2_LIBRARY}" - ) -- endif () -+ endif () - -- if (NOT LIBIDN2_VERSION AND LIBIDN2_INCLUDE_DIR AND EXISTS "${LIBIDN2_INCLUDE_DIR}/unbound.h") -- file(STRINGS "${LIBIDN2_INCLUDE_DIR}/idn2.h" LIBIDN2_H REGEX "^#define IDN2_VERSION ") -- string(REGEX REPLACE "^.*IDN2_VERSION \"([0-9.]+)\".*$" "\\1" LIBIDN2_VERSION "${LIBIDN2_H}") -- endif () --endif() -+ if (NOT LIBIDN2_VERSION AND LIBIDN2_INCLUDE_DIR AND EXISTS "${LIBIDN2_INCLUDE_DIR}/unbound.h") -+ file(STRINGS "${LIBIDN2_INCLUDE_DIR}/idn2.h" LIBIDN2_H REGEX "^#define IDN2_VERSION ") -+ string(REGEX REPLACE "^.*IDN2_VERSION \"([0-9.]+)\".*$" "\\1" LIBIDN2_VERSION "${LIBIDN2_H}") -+ endif () - --list(APPEND LIBIDN2_LIBRARIES "${LIBIDN2_LIBRARY}") -+ list(APPEND LIBIDN2_LIBRARIES "${LIBIDN2_LIBRARY}") -+ endif() -+endif() - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Libidn2 ---- cmake/modules/FindLibunbound.cmake -+++ cmake/modules/FindLibunbound.cmake -@@ -28,58 +28,70 @@ - - #]=======================================================================] - --find_path(LIBUNBOUND_INCLUDE_DIR unbound.h -- HINTS -- "${LIBUNBOUND_DIR}" -- "${LIBUNBOUND_DIR}/include" --) -- --find_library(LIBUNBOUND_LIBRARY NAMES unbound -- HINTS -- "${LIBUNBOUND_DIR}" -- "${LIBUNBOUND_DIR}/lib" --) -- --set(LIBUNBOUND_LIBRARIES "") -- --if (UNIX) -- find_package(Threads REQUIRED) -- find_package(OpenSSL REQUIRED) -- -- list(APPEND LIBUNBOUND_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") -- list(APPEND LIBUNBOUND_LIBRARIES "${OPENSSL_LIBRARIES}") -+include(FindPkgConfig) -+if(PKG_CONFIG_FOUND) -+ pkg_check_modules(PkgLibunbound IMPORTED_TARGET GLOBAL QUIET libunbound) - endif() - --if (LIBUNBOUND_INCLUDE_DIR AND LIBUNBOUND_LIBRARY) -- if (NOT TARGET Libunbound::Libunbound) -- add_library(Libunbound::Libunbound UNKNOWN IMPORTED) -- set_target_properties(Libunbound::Libunbound PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${LIBUNBOUND_INCLUDE_DIR}" -- IMPORTED_LINK_INTERFACE_LANGUAGES "C" -- IMPORTED_LOCATION "${LIBUNBOUND_LIBRARY}" -- ) -- -- if(UNIX AND TARGET Threads::Threads) -- set_property(TARGET Libunbound::Libunbound APPEND PROPERTY -- INTERFACE_LINK_LIBRARIES Threads::Threads) -- endif () -- if(UNIX AND TARGET OpenSSL::SSL) -- set_property(TARGET Libunbound::Libunbound APPEND PROPERTY -- INTERFACE_LINK_LIBRARIES OpenSSL::SSL) -+if(PkgLibunbound_FOUND) -+ set(LIBUNBOUND_INCLUDE_DIR ${PkgLibunbound_INCLUDE_DIRS}) -+ set(LIBUNBOUND_LIBRARIES ${PkgLibunbound_LIBRARIES}) -+ set(LIBUNBOUND_VERSION ${PkgLibunbound_VERSION}) -+ add_library(Libunbound::Libunbound ALIAS PkgConfig::PkgLibunbound) -+else() -+ find_path(LIBUNBOUND_INCLUDE_DIR unbound.h -+ HINTS -+ "${LIBUNBOUND_DIR}" -+ "${LIBUNBOUND_DIR}/include" -+ ) -+ -+ find_library(LIBUNBOUND_LIBRARY NAMES unbound -+ HINTS -+ "${LIBUNBOUND_DIR}" -+ "${LIBUNBOUND_DIR}/lib" -+ ) -+ -+ set(LIBUNBOUND_LIBRARIES "") -+ -+ if (UNIX) -+ find_package(Threads REQUIRED) -+ find_package(OpenSSL REQUIRED) -+ -+ list(APPEND LIBUNBOUND_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") -+ list(APPEND LIBUNBOUND_LIBRARIES "${OPENSSL_LIBRARIES}") -+ endif() -+ -+ if (LIBUNBOUND_INCLUDE_DIR AND LIBUNBOUND_LIBRARY) -+ if (NOT TARGET Libunbound::Libunbound) -+ add_library(Libunbound::Libunbound UNKNOWN IMPORTED) -+ set_target_properties(Libunbound::Libunbound PROPERTIES -+ INTERFACE_INCLUDE_DIRECTORIES "${LIBUNBOUND_INCLUDE_DIR}" -+ IMPORTED_LINK_INTERFACE_LANGUAGES "C" -+ IMPORTED_LOCATION "${LIBUNBOUND_LIBRARY}" -+ ) -+ -+ if(UNIX AND TARGET Threads::Threads) -+ set_property(TARGET Libunbound::Libunbound APPEND PROPERTY -+ INTERFACE_LINK_LIBRARIES Threads::Threads) -+ endif () -+ if(UNIX AND TARGET OpenSSL::SSL) -+ set_property(TARGET Libunbound::Libunbound APPEND PROPERTY -+ INTERFACE_LINK_LIBRARIES OpenSSL::SSL) -+ endif () -+ if(UNIX AND TARGET OpenSSL::Crypto) -+ set_property(TARGET Libunbound::Libunbound APPEND PROPERTY -+ INTERFACE_LINK_LIBRARIES OpenSSL::Crypto) -+ endif () - endif () -- if(UNIX AND TARGET OpenSSL::Crypto) -- set_property(TARGET Libunbound::Libunbound APPEND PROPERTY -- INTERFACE_LINK_LIBRARIES OpenSSL::Crypto) -+ -+ if (NOT LIBUNBOUND_VERSION AND LIBUNBOUND_INCLUDE_DIR AND EXISTS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h") -+ file(STRINGS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h" LIBUNBOUND_H REGEX "^#define UNBOUND_VERSION_M[A-Z]+") -+ string(REGEX REPLACE "^.*MAJOR ([0-9]+).*MINOR ([0-9]+).*MICRO ([0-9]+).*$" "\\1.\\2.\\3" LIBUNBOUND_VERSION "${LIBUNBOUND_H}") - endif () -- endif () -- -- if (NOT LIBUNBOUND_VERSION AND LIBUNBOUND_INCLUDE_DIR AND EXISTS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h") -- file(STRINGS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h" LIBUNBOUND_H REGEX "^#define UNBOUND_VERSION_M[A-Z]+") -- string(REGEX REPLACE "^.*MAJOR ([0-9]+).*MINOR ([0-9]+).*MICRO ([0-9]+).*$" "\\1.\\2.\\3" LIBUNBOUND_VERSION "${LIBUNBOUND_H}") -- endif () --endif() -- --list(APPEND LIBUNBOUND_LIBRARIES "${LIBUNBOUND_LIBRARY}") -+ endif() -+ -+ list(APPEND LIBUNBOUND_LIBRARIES "${LIBUNBOUND_LIBRARY}") -+endif - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Libunbound ---- cmake/modules/FindLibuv.cmake -+++ cmake/modules/FindLibuv.cmake -@@ -28,42 +28,54 @@ - - #]=======================================================================] - --find_path(LIBUV_INCLUDE_DIR uv.h -- HINTS -- "${LIBUV_DIR}" -- "${LIBUV_DIR}/include" --) -- --find_library(LIBUV_LIBRARY NAMES uv libuv -- HINTS -- "${LIBUV_DIR}" -- "${LIBUV_DIR}/lib" --) -- --set(LIBUV_LIBRARIES "") -- --if (LIBUV_INCLUDE_DIR AND LIBUV_LIBRARY) -- if (NOT TARGET Libuv::Libuv) -- add_library(Libuv::Libuv UNKNOWN IMPORTED) -- set_target_properties(Libuv::Libuv PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${LIBUV_INCLUDE_DIR}" -- IMPORTED_LINK_INTERFACE_LANGUAGES "C" -- IMPORTED_LOCATION "${LIBUV_LIBRARY}" -- ) -- endif () -+include(FindPkgConfig) -+if(PKG_CONFIG_FOUND) -+ pkg_check_modules(PkgLibuv IMPORTED_TARGET GLOBAL QUIET libuv) -+endif() - -- if (NOT LIBUV_VERSION AND LIBUV_INCLUDE_DIR) -- if (EXISTS "${LIBUV_INCLUDE_DIR}/uv-version.h") -- file(STRINGS "${LIBUV_INCLUDE_DIR}/uv-version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ") -- elseif (EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h") -- file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ") -+if(PkgLibuv_FOUND) -+ set(LIBUV_INCLUDE_DIR ${PkgLibuv_INCLUDE_DIRS}) -+ set(LIBUV_LIBRARIES ${PkgLibuv_LIBRARIES}) -+ set(LIBUV_VERSION ${PkgLibuv_VERSION}) -+ add_library(Libuv::Libuv ALIAS PkgConfig::PkgLibuv) -+else() -+ find_path(LIBUV_INCLUDE_DIR uv.h -+ HINTS -+ "${LIBUV_DIR}" -+ "${LIBUV_DIR}/include" -+ ) -+ -+ find_library(LIBUV_LIBRARY NAMES uv libuv -+ HINTS -+ "${LIBUV_DIR}" -+ "${LIBUV_DIR}/lib" -+ ) -+ -+ set(LIBUV_LIBRARIES "") -+ -+ if (LIBUV_INCLUDE_DIR AND LIBUV_LIBRARY) -+ if (NOT TARGET Libuv::Libuv) -+ add_library(Libuv::Libuv UNKNOWN IMPORTED) -+ set_target_properties(Libuv::Libuv PROPERTIES -+ INTERFACE_INCLUDE_DIRECTORIES "${LIBUV_INCLUDE_DIR}" -+ IMPORTED_LINK_INTERFACE_LANGUAGES "C" -+ IMPORTED_LOCATION "${LIBUV_LIBRARY}" -+ ) - endif () -- string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3" LIBUV_VERSION "${LIBUV_VER_H}") -- endif () -+ -+ if (NOT LIBUV_VERSION AND LIBUV_INCLUDE_DIR) -+ if (EXISTS "${LIBUV_INCLUDE_DIR}/uv-version.h") -+ file(STRINGS "${LIBUV_INCLUDE_DIR}/uv-version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ") -+ elseif (EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h") -+ file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ") -+ endif () -+ string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3" LIBUV_VERSION "${LIBUV_VER_H}") -+ endif () -+ endif() -+ -+ list(APPEND LIBUV_LIBRARIES "${LIBUV_LIBRARY}") - endif() - --list(APPEND LIBUV_LIBRARIES "${LIBUV_LIBRARY}") -- - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Libuv - REQUIRED_VARS LIBUV_LIBRARIES LIBUV_INCLUDE_DIR ---- cmake/modules/FindNettle.cmake -+++ cmake/modules/FindNettle.cmake -@@ -30,62 +30,76 @@ - - #]=======================================================================] - --find_path(NETTLE_INCLUDE_DIR nettle/version.h -- HINTS -- "${NETTLE_DIR}" -- "${NETTLE_DIR}/include" --) -- --find_library(NETTLE_LIBRARY NAMES nettle libnettle -- HINTS -- "${NETTLE_DIR}" -- "${NETTLE_DIR}/lib" --) -- --find_library(HOGWEED_LIBRARY NAMES hogweed libhogweed -- HINTS -- "${NETTLE_DIR}" -- "${NETTLE_DIR}/lib" --) -- --set(NETTLE_LIBRARIES "") -- --# May need gmp library on Unix. --if (UNIX) -- find_library(NETTLE_GMP_LIBRARY gmp) -- -- if (NETTLE_GMP_LIBRARY) -- list(APPEND NETTLE_LIBRARIES "${NETTLE_GMP_LIBRARY}") -- endif () --endif () -- --if (NETTLE_INCLUDE_DIR AND NETTLE_LIBRARY AND HOGWEED_LIBRARY) -- if (NOT TARGET Nettle::Nettle) -- add_library(Nettle::Nettle UNKNOWN IMPORTED) -- set_target_properties(Nettle::Nettle PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}" -- INTERFACE_LINK_LIBRARIES "${NETTLE_LIBRARIES}" -- IMPORTED_LINK_INTERFACE_LANGUAGES "C" -- IMPORTED_LOCATION "${NETTLE_LIBRARY}" -- ) -- endif () -- if (NOT TARGET Nettle::Hogweed) -- add_library(Nettle::Hogweed UNKNOWN IMPORTED) -- set_target_properties(Nettle::Hogweed PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}" -- IMPORTED_LINK_INTERFACE_LANGUAGES "C" -- IMPORTED_LOCATION "${HOGWEED_LIBRARY}" -- ) -- endif () -+include(FindPkgConfig) -+if(PKG_CONFIG_FOUND) -+ pkg_check_modules(PkgNettle IMPORTED_TARGET GLOBAL nettle) -+ pkg_check_modules(PkgHogweed IMPORTED_TARGET GLOBAL QUIET hogweed) -+endif() - -- if (NOT NETTLE_VERSION AND NETTLE_INCLUDE_DIR) -- file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" NETTLE_VER_H REGEX "^#define NETTLE_VERSION_(MAJOR|MINOR) ") -- string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*$" "\\1.\\2" NETTLE_VERSION "${NETTLE_VER_H}") -+if(PkgNettle_FOUND AND PkHogweed_FOUND) -+ set(NETTLE_INCLUDE_DIR ${PkgNettle_INCLUDE_DIRS} ${PkgHogweed_INCLUDE_DIRS}) -+ set(NETTLE_LIBRARIES ${PkgNettle_LIBRARIES} ${PkgHogweed_LIBRARIES}) -+ set(NETTLE_VERSION ${PkgNettle_VERSION}) -+ add_library(Nettle::Nettle ALIAS PkgConfig::PkgNettle) -+ add_library(Nettle::Hogweed ALIAS PkgConfig::PkgHogweed) -+else() -+ find_path(NETTLE_INCLUDE_DIR nettle/version.h -+ HINTS -+ "${NETTLE_DIR}" -+ "${NETTLE_DIR}/include" -+ ) -+ -+ find_library(NETTLE_LIBRARY NAMES nettle libnettle -+ HINTS -+ "${NETTLE_DIR}" -+ "${NETTLE_DIR}/lib" -+ ) -+ -+ find_library(HOGWEED_LIBRARY NAMES hogweed libhogweed -+ HINTS -+ "${NETTLE_DIR}" -+ "${NETTLE_DIR}/lib" -+ ) -+ -+ set(NETTLE_LIBRARIES "") -+ -+ # May need gmp library on Unix. -+ if (UNIX) -+ find_library(NETTLE_GMP_LIBRARY gmp) -+ -+ if (NETTLE_GMP_LIBRARY) -+ list(APPEND NETTLE_LIBRARIES "${NETTLE_GMP_LIBRARY}") -+ endif () - endif () -+ -+ if (NETTLE_INCLUDE_DIR AND NETTLE_LIBRARY AND HOGWEED_LIBRARY) -+ if (NOT TARGET Nettle::Nettle) -+ add_library(Nettle::Nettle UNKNOWN IMPORTED) -+ set_target_properties(Nettle::Nettle PROPERTIES -+ INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}" -+ INTERFACE_LINK_LIBRARIES "${NETTLE_LIBRARIES}" -+ IMPORTED_LINK_INTERFACE_LANGUAGES "C" -+ IMPORTED_LOCATION "${NETTLE_LIBRARY}" -+ ) -+ endif () -+ if (NOT TARGET Nettle::Hogweed) -+ add_library(Nettle::Hogweed UNKNOWN IMPORTED) -+ set_target_properties(Nettle::Hogweed PROPERTIES -+ INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}" -+ IMPORTED_LINK_INTERFACE_LANGUAGES "C" -+ IMPORTED_LOCATION "${HOGWEED_LIBRARY}" -+ ) -+ endif () -+ -+ if (NOT NETTLE_VERSION AND NETTLE_INCLUDE_DIR) -+ file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" NETTLE_VER_H REGEX "^#define NETTLE_VERSION_(MAJOR|MINOR) ") -+ string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*$" "\\1.\\2" NETTLE_VERSION "${NETTLE_VER_H}") -+ endif () -+ endif() -+ -+ list(APPEND NETTLE_LIBRARIES "${NETTLE_LIBRARY}" "${HOGWEED_LIBRARY}") - endif() - --list(APPEND NETTLE_LIBRARIES "${NETTLE_LIBRARY}" "${HOGWEED_LIBRARY}") -- - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Nettle - REQUIRED_VARS NETTLE_LIBRARIES NETTLE_INCLUDE_DIR diff --git a/recipes/getdns/all/patches/1.6.0-0004-dont-install-symlinked-license.patch b/recipes/getdns/all/patches/1.6.0-0004-dont-install-symlinked-license.patch deleted file mode 100644 index fadb8d2d20e5f..0000000000000 --- a/recipes/getdns/all/patches/1.6.0-0004-dont-install-symlinked-license.patch +++ /dev/null @@ -1,16 +0,0 @@ -Avoids weird issue on c3i Windows builders: - - CMake Error at source_subfolder/cmake_install.cmake:104 (file): - file INSTALL cannot read symlink - "C:/J/w/cci_PR-2903@2/.conan/data/getdns/1.6.0/_/_/build/dd6d0e14f162a68e24ee52fee674d130eac57dea/source_subfolder/COPYING" - to duplicate at - "C:/J/w/cci_PR-2903@2/.conan/data/getdns/1.6.0/_/_/package/dd6d0e14f162a68e24ee52fee674d130eac57dea/share/doc/getdns/COPYING": - File exists. - Call Stack (most recent call first): - - ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -1080,1 +1080,1 @@ --install(FILES AUTHORS ChangeLog COPYING LICENSE NEWS README.md DESTINATION ${docdir}) -+install(FILES AUTHORS ChangeLog NEWS README.md DESTINATION ${docdir}) diff --git a/recipes/getdns/all/patches/1.7.3-fix-windows-build.patch b/recipes/getdns/all/patches/1.7.3-fix-windows-build.patch new file mode 100644 index 0000000000000..dc0f91e105f96 --- /dev/null +++ b/recipes/getdns/all/patches/1.7.3-fix-windows-build.patch @@ -0,0 +1,121 @@ +From bfd53d3cc3afbf199fa27f74bf4b35c1ad955c2e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rados=C5=82aw=20Szkodzi=C5=84ski?= +Date: Tue, 3 Jan 2023 14:14:07 +0100 +Subject: [PATCH] Fix Windows build + +Fixes all found instances of missing APIs and headers on Windows. +--- + src/anchor.c | 12 ++++++++++++ + src/compat/mkstemp.c | 6 +++--- + src/gldns/parse.c | 2 +- + src/gldns/parseutil.c | 2 ++ + src/stub.c | 5 +++++ + 5 files changed, 23 insertions(+), 4 deletions(-) + +diff --git a/src/anchor.c b/src/anchor.c +index f50c4a3d1..fc357b649 100644 +--- a/src/anchor.c ++++ b/src/anchor.c +@@ -551,7 +551,11 @@ static void tas_rinse(getdns_context *context, tas_connection *a) + GETDNS_CLEAR_EVENT(a->loop, &a->event); + a->event.ev = NULL; + if (a->fd >= 0) ++#ifdef USE_WINSOCK ++ closesocket(a->fd); ++#else + close(a->fd); ++#endif + a->fd = -1; + if (a->xml.data) + GETDNS_FREE(context->mf, a->xml.data); +@@ -662,7 +666,11 @@ static void tas_reconnect_cb(void *userarg) + , "Waiting for second document timeout. Reconnecting...\n"); + + GETDNS_CLEAR_EVENT(a->loop, &a->event); ++#ifdef USE_WINSOCK ++ closesocket(a->fd); ++#else + close(a->fd); ++#endif + a->fd = -1; + if (a->state == TAS_READ_PS7_HDR) { + a->state = TAS_RETRY; +@@ -778,7 +786,11 @@ static void tas_read_cb(void *userarg) + if (n == 0) { + DEBUG_ANCHOR("Connection closed\n"); + GETDNS_CLEAR_EVENT(a->loop, &a->event); ++#ifdef USE_WINSOCK ++ closesocket(a->fd); ++#else + close(a->fd); ++#endif + a->fd = -1; + if (a->state == TAS_READ_PS7_HDR) { + a->state = TAS_RETRY; +diff --git a/src/compat/mkstemp.c b/src/compat/mkstemp.c +index 49d3e919a..86d1dfd67 100644 +--- a/src/compat/mkstemp.c ++++ b/src/compat/mkstemp.c +@@ -30,14 +30,14 @@ + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#include +-#include + #include ++#include + #include ++#include + + int mkstemp(char *template) + { + if (_mktemp_s(template, strlen(template) + 1) != 0) + return -1; +- return open(template, _O_CREAT | _O_EXCL | _O_RDWR, _S_IWRITE | _S_IREAD); ++ return _open(template, _O_CREAT | _O_EXCL | _O_RDWR, _S_IWRITE | _S_IREAD); + } +diff --git a/src/gldns/parse.c b/src/gldns/parse.c +index 367fa80f3..c107c0df9 100644 +--- a/src/gldns/parse.c ++++ b/src/gldns/parse.c +@@ -13,7 +13,7 @@ + #include "gldns/gbuffer.h" + + #include +-#include ++#include + + gldns_lookup_table gldns_directive_types[] = { + { GLDNS_DIR_TTL, "$TTL" }, +diff --git a/src/gldns/parseutil.c b/src/gldns/parseutil.c +index 293496a90..1e4367898 100644 +--- a/src/gldns/parseutil.c ++++ b/src/gldns/parseutil.c +@@ -14,7 +14,9 @@ + + #include "config.h" + #include "gldns/parseutil.h" ++#ifdef HAVE_SYS_TIME_H + #include ++#endif + #include + #include + +diff --git a/src/stub.c b/src/stub.c +index ee3193126..ab393885d 100644 +--- a/src/stub.c ++++ b/src/stub.c +@@ -903,8 +903,13 @@ stub_tcp_write(int fd, getdns_tcp_state *tcp, getdns_network_req *netreq) + just fall back to a 'normal' write. */ + if (written == -1 + && _getdns_socketerror() == _getdns_EISCONN) ++#ifdef USE_WINSOCK ++ written = send(fd, (const char *)(netreq->query - 2) ++ , pkt_len + 2, 0); ++#else + written = write(fd, netreq->query - 2 + , pkt_len + 2); ++#endif + } else + written = send(fd, (const char *)(netreq->query - 2) + , pkt_len + 2, 0); diff --git a/recipes/getdns/all/test_package/CMakeLists.txt b/recipes/getdns/all/test_package/CMakeLists.txt index 3a403dc404b41..e78d760c7b17a 100644 --- a/recipes/getdns/all/test_package/CMakeLists.txt +++ b/recipes/getdns/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(getdns REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE getdns::getdns) diff --git a/recipes/getdns/all/test_package/conanfile.py b/recipes/getdns/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/getdns/all/test_package/conanfile.py +++ b/recipes/getdns/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/getdns/all/test_package/test_package.c b/recipes/getdns/all/test_package/test_package.c index c55c14f559026..b60140d92b44b 100644 --- a/recipes/getdns/all/test_package/test_package.c +++ b/recipes/getdns/all/test_package/test_package.c @@ -1,26 +1,10 @@ #include "getdns.h" -#include #include -#define CHECK(V) if ((V) != GETDNS_RETURN_GOOD) { \ - fprintf(stderr, "Fail: " #V "!\n"); \ - return 1; \ -} - -int main() -{ - getdns_context *context; - CHECK(getdns_context_create(&context, 1)); - getdns_dict *info = getdns_context_get_api_information(context); - if (info == NULL) { - fprintf(stderr, "Could not get api information\n"); - return 1; - } - char *txt = getdns_pretty_print_dict(info); - printf("%s\n", txt); - free(txt); - getdns_dict_destroy(info); +int main() { + getdns_context *context = NULL; + getdns_context_create(&context, 0); getdns_context_destroy(context); - return 0; + return EXIT_SUCCESS; } diff --git a/recipes/getdns/config.yml b/recipes/getdns/config.yml index 10acb3ad5b1e8..e14fae48c780f 100644 --- a/recipes/getdns/config.yml +++ b/recipes/getdns/config.yml @@ -1,3 +1,3 @@ versions: - "1.6.0": + "1.7.3": folder: "all" diff --git a/recipes/getopt-for-visual-studio/all/test_package/CMakeLists.txt b/recipes/getopt-for-visual-studio/all/test_package/CMakeLists.txt index 1f997dfbcef54..cdb43f1e9a647 100644 --- a/recipes/getopt-for-visual-studio/all/test_package/CMakeLists.txt +++ b/recipes/getopt-for-visual-studio/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(getopt-for-visual-studio) diff --git a/recipes/getopt-for-visual-studio/all/test_v1_package/CMakeLists.txt b/recipes/getopt-for-visual-studio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/getopt-for-visual-studio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/getopt-for-visual-studio/all/test_v1_package/conanfile.py b/recipes/getopt-for-visual-studio/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/getopt-for-visual-studio/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_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/gettext/all/conandata.yml b/recipes/gettext/all/conandata.yml index e03cab34f1431..cc749fa1165fe 100644 --- a/recipes/gettext/all/conandata.yml +++ b/recipes/gettext/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.22.5": + url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.gz" + sha256: "ec1705b1e969b83a9f073144ec806151db88127f5e40fe5a94cb6c8fa48996a0" "0.21": url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz" sha256: "c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12" @@ -6,14 +9,26 @@ sources: url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz" sha256: "66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c" patches: + "0.22.5": + - patch_file: "patches/0004-autopoint-relocatable.patch" + patch_description: "relocatable autopoint with resources relative to script" + patch_type: "conan" + - patch_file: "patches/0.22.5-0001-fix-macos-crossbuild.patch" + patch_description: "fix ability to crossbuild on macos and assume macOS newer than 10.4" + patch_type: "conan" "0.21": - - patch_file: "patches/0002-memmove-is-intrinsic-function-on-MSVC.patch" - patch_file: "patches/0004-autopoint-relocatable.patch" patch_description: "relocatable autopoint with resources relative to script" patch_type: "conan" + - patch_file: "patches/0.21-clang-16-noreturn-attribute-warning.patch" + patch_description: "apply the __atribute_noreturn__ to print_and_abort" + patch_source: "https://github.com/coreutils/gnulib/commit/0cc39712803ade7b2d4b89c36b143dad72404063" + patch_type: "conan" + - patch_file: "patches/0.21-include-stdlib_h.patch" + patch_description: "include stdlib.h for newer gcc" + patch_type: "portability" "0.20.1": - patch_file: "patches/0.20.1-0001-fix-build-errors-with-MSVC.patch" - - patch_file: "patches/0002-memmove-is-intrinsic-function-on-MSVC.patch" - patch_file: "patches/0.20.1-0003-Reported-by-Gabor-Z.-Papp-gzp-papp.hu.patch" - patch_file: "patches/0004-autopoint-relocatable.patch" patch_description: "relocatable autopoint with resources relative to script" diff --git a/recipes/gettext/all/conanfile.py b/recipes/gettext/all/conanfile.py index 433bf975c1087..03a7b60fc24c2 100644 --- a/recipes/gettext/all/conanfile.py +++ b/recipes/gettext/all/conanfile.py @@ -50,7 +50,8 @@ def build_requirements(self): 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): + + if self.version >= Version("0.22") or is_msvc(self): self.build_requires("automake/1.16.5") def source(self): @@ -84,6 +85,19 @@ def generate(self): if check_min_vs(self, "180", raise_invalid=False): tc.extra_cflags.append("-FS") #TODO: reference github issue + # prevent redefining compiler instrinsic functions + tc.configure_args.extend([ + 'ac_cv_func_memmove=yes', + 'ac_cv_func_memset=yes' + ]) + + # Skip checking for the 'n' printf format directly + # in msvc, as it is known to not be available due to security concerns. + # Skipping it avoids a GUI prompt during ./configure for a debug build + # See https://github.com/conan-io/conan-center-index/issues/23698] + if self.settings.build_type == "Debug": + tc.configure_args.extend(['gl_cv_func_printf_directive_n=no']) + # The flag above `--with-libiconv-prefix` fails to correctly detect libiconv on windows+msvc # so it needs an extra nudge. We could use `AutotoolsDeps` but it's currently affected by the # following outstanding issue: https://github.com/conan-io/conan/issues/12784 diff --git a/recipes/gettext/all/patches/0.21-clang-16-noreturn-attribute-warning.patch b/recipes/gettext/all/patches/0.21-clang-16-noreturn-attribute-warning.patch new file mode 100644 index 0000000000000..59ee5067e98dd --- /dev/null +++ b/recipes/gettext/all/patches/0.21-clang-16-noreturn-attribute-warning.patch @@ -0,0 +1,78 @@ +diff --git a/gettext-tools/gnulib-lib/obstack.c b/gettext-tools/gnulib-lib/obstack.c +index a6757b8..7d4439f 100644 +--- a/gettext-tools/gnulib-lib/obstack.c ++++ b/gettext-tools/gnulib-lib/obstack.c +@@ -326,7 +326,7 @@ int obstack_exit_failure = EXIT_FAILURE; + # include + # endif + +-static _Noreturn void ++static __attribute_noreturn__ void + print_and_abort (void) + { + /* Don't change any of these strings. Yes, it would be possible to add +diff --git a/gettext-tools/gnulib-lib/obstack.h b/gettext-tools/gnulib-lib/obstack.h +index cb59627..e0494a1 100644 +--- a/gettext-tools/gnulib-lib/obstack.h ++++ b/gettext-tools/gnulib-lib/obstack.h +@@ -153,7 +153,7 @@ + + /* Not the same as _Noreturn, since it also works with function pointers. */ + #ifndef __attribute_noreturn__ +-# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C ++# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ || 0x5110 <= __SUNPRO_C + # define __attribute_noreturn__ __attribute__ ((__noreturn__)) + # else + # define __attribute_noreturn__ +diff --git a/gettext-tools/libgettextpo/obstack.c b/gettext-tools/libgettextpo/obstack.c +index a6757b8..7d4439f 100644 +--- a/gettext-tools/libgettextpo/obstack.c ++++ b/gettext-tools/libgettextpo/obstack.c +@@ -326,7 +326,7 @@ int obstack_exit_failure = EXIT_FAILURE; + # include + # endif + +-static _Noreturn void ++static __attribute_noreturn__ void + print_and_abort (void) + { + /* Don't change any of these strings. Yes, it would be possible to add +diff --git a/gettext-tools/libgettextpo/obstack.h b/gettext-tools/libgettextpo/obstack.h +index cb59627..e0494a1 100644 +--- a/gettext-tools/libgettextpo/obstack.h ++++ b/gettext-tools/libgettextpo/obstack.h +@@ -153,7 +153,7 @@ + + /* Not the same as _Noreturn, since it also works with function pointers. */ + #ifndef __attribute_noreturn__ +-# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C ++# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ || 0x5110 <= __SUNPRO_C + # define __attribute_noreturn__ __attribute__ ((__noreturn__)) + # else + # define __attribute_noreturn__ +diff --git a/libtextstyle/lib/obstack.c b/libtextstyle/lib/obstack.c +index a6757b8..7d4439f 100644 +--- a/libtextstyle/lib/obstack.c ++++ b/libtextstyle/lib/obstack.c +@@ -326,7 +326,7 @@ int obstack_exit_failure = EXIT_FAILURE; + # include + # endif + +-static _Noreturn void ++static __attribute_noreturn__ void + print_and_abort (void) + { + /* Don't change any of these strings. Yes, it would be possible to add +diff --git a/libtextstyle/lib/obstack.h b/libtextstyle/lib/obstack.h +index cb59627..e0494a1 100644 +--- a/libtextstyle/lib/obstack.h ++++ b/libtextstyle/lib/obstack.h +@@ -153,7 +153,7 @@ + + /* Not the same as _Noreturn, since it also works with function pointers. */ + #ifndef __attribute_noreturn__ +-# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C ++# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ || 0x5110 <= __SUNPRO_C + # define __attribute_noreturn__ __attribute__ ((__noreturn__)) + # else + # define __attribute_noreturn__ diff --git a/recipes/gettext/all/patches/0.21-include-stdlib_h.patch b/recipes/gettext/all/patches/0.21-include-stdlib_h.patch new file mode 100644 index 0000000000000..721436bc3f295 --- /dev/null +++ b/recipes/gettext/all/patches/0.21-include-stdlib_h.patch @@ -0,0 +1,12 @@ +diff --git a/gettext-tools/src/locating-rule.c b/gettext-tools/src/locating-rule.c +index 15faee1..66ec48a 100644 +--- a/gettext-tools/src/locating-rule.c ++++ b/gettext-tools/src/locating-rule.c +@@ -47,6 +47,7 @@ + #include + #include + #include "xalloc.h" ++#include + + #define _(str) gettext (str) + diff --git a/recipes/gettext/all/patches/0.22.5-0001-fix-macos-crossbuild.patch b/recipes/gettext/all/patches/0.22.5-0001-fix-macos-crossbuild.patch new file mode 100644 index 0000000000000..9deceb328f646 --- /dev/null +++ b/recipes/gettext/all/patches/0.22.5-0001-fix-macos-crossbuild.patch @@ -0,0 +1,26 @@ +diff --git a/gettext-runtime/configure b/gettext-runtime/configure +index 75c8e6f..6e4df72 100755 +--- a/gettext-runtime/configure ++++ b/gettext-runtime/configure +@@ -36149,7 +36149,7 @@ fi + haiku*) use_elf_origin_trick=yes ;; + # On Mac OS X 10.4 or newer, use Mac OS X tools. See + # . +- darwin | darwin[1-7].*) ;; ++ darwin | darwin[1-7].*) use_macos_tools=yes ;; + darwin*) use_macos_tools=yes ;; + esac + if test $is_noop = yes; then +diff --git a/gettext-tools/configure b/gettext-tools/configure +index c62f256..f3a66ed 100755 +--- a/gettext-tools/configure ++++ b/gettext-tools/configure +@@ -49566,7 +49566,7 @@ fi + haiku*) use_elf_origin_trick=yes ;; + # On Mac OS X 10.4 or newer, use Mac OS X tools. See + # . +- darwin | darwin[1-7].*) ;; ++ darwin | darwin[1-7].*) use_macos_tools=yes ;; + darwin*) use_macos_tools=yes ;; + esac + if test $is_noop = yes; then diff --git a/recipes/gettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch b/recipes/gettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch deleted file mode 100644 index dbbf7b795a53e..0000000000000 --- a/recipes/gettext/all/patches/0002-memmove-is-intrinsic-function-on-MSVC.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 9b2e480278d36c4d7b6f988621a3a9f699cc730f Mon Sep 17 00:00:00 2001 -From: SSE4 -Date: Wed, 10 Jul 2019 03:55:56 -0700 -Subject: [PATCH 2/2] - memmove is intrinsic function on MSVC - -Signed-off-by: SSE4 ---- - gettext-runtime/gnulib-lib/memmove.c | 4 ++++ - gettext-tools/gnulib-lib/memmove.c | 4 ++++ - gettext-tools/gnulib-lib/memset.c | 4 ++++ - 3 files changed, 12 insertions(+) - -diff --git a/gettext-runtime/gnulib-lib/memmove.c b/gettext-runtime/gnulib-lib/memmove.c -index 0f040540c..bc8883ae4 100644 ---- a/gettext-runtime/gnulib-lib/memmove.c -+++ b/gettext-runtime/gnulib-lib/memmove.c -@@ -7,6 +7,8 @@ - - #include - -+#ifndef _MSC_VER -+ - void * - memmove (void *dest0, void const *source0, size_t length) - { -@@ -24,3 +26,5 @@ memmove (void *dest0, void const *source0, size_t length) - } - return dest0; - } -+ -+#endif -diff --git a/gettext-tools/gnulib-lib/memmove.c b/gettext-tools/gnulib-lib/memmove.c -index 0f040540c..bc8883ae4 100644 ---- a/gettext-tools/gnulib-lib/memmove.c -+++ b/gettext-tools/gnulib-lib/memmove.c -@@ -7,6 +7,8 @@ - - #include - -+#ifndef _MSC_VER -+ - void * - memmove (void *dest0, void const *source0, size_t length) - { -@@ -24,3 +26,5 @@ memmove (void *dest0, void const *source0, size_t length) - } - return dest0; - } -+ -+#endif -diff --git a/gettext-tools/gnulib-lib/memset.c b/gettext-tools/gnulib-lib/memset.c -index 4e60124e7..b595fa966 100644 ---- a/gettext-tools/gnulib-lib/memset.c -+++ b/gettext-tools/gnulib-lib/memset.c -@@ -18,6 +18,8 @@ - - #include - -+#ifndef _MSC_VER -+ - void * - memset (void *str, int c, size_t len) - { -@@ -27,3 +29,5 @@ memset (void *str, int c, size_t len) - *st++ = c; - return str; - } -+ -+#endif --- -2.21.0.windows.1 - diff --git a/recipes/gettext/all/test_package/conanfile.py b/recipes/gettext/all/test_package/conanfile.py index 8ef53a96f7ded..38cf5d5e86a20 100644 --- a/recipes/gettext/all/test_package/conanfile.py +++ b/recipes/gettext/all/test_package/conanfile.py @@ -1,57 +1,24 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.env import Environment, VirtualRunEnv, VirtualBuildEnv -from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.env import VirtualRunEnv from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - exports_sources = "configure.ac", test_type = "explicit" - win_bash = True - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) def requirements(self): self.requires(self.tested_reference_str) - def build_requirements(self): - self.tool_requires(self.tested_reference_str) - self.tool_requires("automake/1.16.5") - 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 layout(self): basic_layout(self, src_folder="src") def generate(self): - buildenv = VirtualBuildEnv(self) - buildenv.generate() - - at = AutotoolsToolchain(self) - at.generate() - - if is_msvc(self): - env = Environment() - env.define("CC", "cl -nologo") - env.define("LD", "link -nologo") - env.vars(self).save_script("conanbuild_libsmacker_msvc") - runenv = VirtualRunEnv(self) runenv.generate() - def build(self): - - autotools = Autotools(self) - autotools.autoreconf() - autotools.configure() - - def test(self): if can_run(self): for exe in ["gettext", "ngettext", "msgcat", "msgmerge"]: diff --git a/recipes/gettext/all/test_package/src/configure.ac b/recipes/gettext/all/test_package/src/configure.ac deleted file mode 100644 index b2c4f352a64de..0000000000000 --- a/recipes/gettext/all/test_package/src/configure.ac +++ /dev/null @@ -1,6 +0,0 @@ -AC_INIT([test_package_gettext],[1.0]) -AC_PREREQ([2.69]) - -AM_GNU_GETTEXT_REQUIRE_VERSION([0.20]) -AM_GNU_GETTEXT([external], [need-ngettext]) -AM_ICONV diff --git a/recipes/gettext/all/test_v1_package/conanfile.py b/recipes/gettext/all/test_v1_package/conanfile.py index 9e810ecf433fc..d35f2c0d29fb4 100644 --- a/recipes/gettext/all/test_v1_package/conanfile.py +++ b/recipes/gettext/all/test_v1_package/conanfile.py @@ -18,7 +18,8 @@ def requirements(self): def build_requirements(self): self.build_requires(self.tested_reference_str) - self.build_requires("automake/1.16.4") + self.build_requires("automake/1.16.5") + self.build_requires("xz_utils/5.4.5") if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): self.build_requires("msys2/cci.latest") diff --git a/recipes/gettext/config.yml b/recipes/gettext/config.yml index dc03f51a1d462..00bba3996ff90 100644 --- a/recipes/gettext/config.yml +++ b/recipes/gettext/config.yml @@ -1,4 +1,6 @@ versions: + "0.22.5": + folder: all "0.21": folder: all "0.20.1": diff --git a/recipes/gf-complete/all/conandata.yml b/recipes/gf-complete/all/conandata.yml index 58f9543628ba7..8fe397e19e0a6 100644 --- a/recipes/gf-complete/all/conandata.yml +++ b/recipes/gf-complete/all/conandata.yml @@ -8,4 +8,3 @@ sources: patches: "cci.20170410": - patch_file: "patches/0001-fix-msvc-cci.20170410.patch" - base_path: "source_subfolder" diff --git a/recipes/gf-complete/all/conanfile.py b/recipes/gf-complete/all/conanfile.py index 0947d375fcf7d..1d8d0803dbf13 100644 --- a/recipes/gf-complete/all/conanfile.py +++ b/recipes/gf-complete/all/conanfile.py @@ -1,162 +1,198 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration -import contextlib 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 cross_building +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, replace_in_file, rm, collect_libs +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path + +required_conan_version = ">=1.53.0" class GfCompleteConan(ConanFile): name = "gf-complete" description = "A library for Galois Field arithmetic" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ceph/gf-complete" - license = "BSD-3-Clause" topics = ("galois field", "math", "algorithms") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "neon": [True, False, "auto"], "sse": [True, False, "auto"], - "avx": [True, False, "auto"] + "avx": [True, False, "auto"], } default_options = { "shared": False, "fPIC": True, "neon": "auto", "sse": "auto", - "avx": "auto" + "avx": "auto", } - 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 config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC if self.settings.arch not in ["x86", "x86_64"]: - del self.options.sse - del self.options.avx + self.options.rm_safe("sse") + self.options.rm_safe("avx") if "arm" not in self.settings.arch: - del self.options.neon + self.options.rm_safe("neon") 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.settings.compiler == "Visual Studio": + if is_msvc(self): self.requires("getopt-for-visual-studio/20200201") def validate(self): - if self.settings.compiler == "Visual Studio": - if self.options.shared: - raise ConanInvalidConfiguration("gf-complete doesn't support shared with Visual Studio") + if is_msvc(self): if self.version == "1.03": raise ConanInvalidConfiguration("gf-complete 1.03 doesn't support Visual Studio") 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], destination=self._source_subfolder, strip_root=True) + 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) + apply_conandata_patches(self) # Don't build tests and examples (and also tools if Visual Studio) to_build = ["src"] - if self.settings.compiler != "Visual Studio": + if not is_msvc(self): to_build.append("tools") - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.am"), - "SUBDIRS = src tools test examples", - "SUBDIRS = {}".format(" ".join(to_build))) + replace_in_file( + self, + os.path.join(self.source_folder, "Makefile.am"), + "SUBDIRS = src tools test examples", + "SUBDIRS = {}".format(" ".join(to_build)), + ) # Honor build type settings and fPIC option for subdir in ["src", "tools"]: for flag in ["-O3", "-fPIC"]: - tools.replace_in_file(os.path.join(self._source_subfolder, subdir, "Makefile.am"), - flag, "") - - @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.deps_user_info["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "LD": "{} link -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].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) - self._autotools.libs = [] - if self.settings.compiler == "Visual Studio": - self._autotools.flags.append("-FS") - elif "x86" in self.settings.arch: - self._autotools.flags.append("-mstackrealign") - + replace_in_file(self, os.path.join(self.source_folder, subdir, "Makefile.am"), flag, "") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + if not is_msvc(self) and "x86" in self.settings.arch: + tc.extra_cxxflags.append("-mstackrealign") 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)), - ] - - if "arm" in self.settings.arch: + if "arm" in str(self.settings.arch): if self.options.neon != "auto": - conf_args.append("--enable-neon={}".format(yes_no(self.options.neon))) - + tc.configure_args.append("--enable-neon={}".format(yes_no(self.options.neon))) if self.settings.arch in ["x86", "x86_64"]: if self.options.sse != "auto": - conf_args.append("--enable-sse={}".format(yes_no(self.options.sse))) - + tc.configure_args.append("--enable-sse={}".format(yes_no(self.options.sse))) if self.options.avx != "auto": - conf_args.append("--enable-avx={}".format(yes_no(self.options.avx))) - - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - - return self._autotools + tc.configure_args.append("--enable-avx={}".format(yes_no(self.options.avx))) + if is_msvc(self): + if self.options.shared: + tc.extra_ldflags.append("-no-undefined") + tc.extra_ldflags.append("-Wl,--export-all-symbols") + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.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") + + 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 reversed(self.dependencies.host.topological_sort.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") + else: + deps = AutotoolsDeps(self) + deps.generate() def build(self): self._patch_sources() - 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() + with chdir(self, self.source_folder): + 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() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + rm(self, "*.la", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.libs = ["gf_complete"] + self.cpp_info.libs = collect_libs(self) - if self.settings.compiler != "Visual Studio": + if not is_msvc(self): 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/gf-complete/all/test_package/CMakeLists.txt b/recipes/gf-complete/all/test_package/CMakeLists.txt index fd126a732c403..1e6c99d7b2ace 100644 --- a/recipes/gf-complete/all/test_package/CMakeLists.txt +++ b/recipes/gf-complete/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(gf-complete REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE gf-complete::gf-complete) set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/gf-complete/all/test_package/conanfile.py b/recipes/gf-complete/all/test_package/conanfile.py index 6bc1a2f31ef01..ef5d7042163ec 100644 --- a/recipes/gf-complete/all/test_package/conanfile.py +++ b/recipes/gf-complete/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, 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/gflags/all/conanfile.py b/recipes/gflags/all/conanfile.py index 985562e799cab..d769a91f746e8 100644 --- a/recipes/gflags/all/conanfile.py +++ b/recipes/gflags/all/conanfile.py @@ -1,10 +1,11 @@ from conan import ConanFile +from conan.errors import ConanException from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import collect_libs, copy, get, rmdir, save +from conan.tools.files import collect_libs, copy, get, rmdir +from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class GflagsConan(ConanFile): @@ -58,6 +59,9 @@ def generate(self): tc.variables["REGISTER_BUILD_DIR"] = False tc.variables["REGISTER_INSTALL_PREFIX"] = False tc.variables["GFLAGS_NAMESPACE"] = self.options.namespace + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.2.2": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): @@ -72,27 +76,6 @@ def package(self): 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 legacy generators removed - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {"gflags": "gflags::gflags"} - ) - - 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", "gflags") self.cpp_info.set_property("cmake_target_name", "gflags::gflags") @@ -103,7 +86,3 @@ def package_info(self): self.cpp_info.system_libs.extend(["shlwapi"]) elif self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["pthread", "m"]) - - # TODO: to remove in conan v2 once legacy 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/gflags/all/test_package/CMakeLists.txt b/recipes/gflags/all/test_package/CMakeLists.txt index 5b23a3ac87bb6..a1316bc9b6b17 100644 --- a/recipes/gflags/all/test_package/CMakeLists.txt +++ b/recipes/gflags/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(gflags REQUIRED CONFIG) diff --git a/recipes/gflags/all/test_v1_package/CMakeLists.txt b/recipes/gflags/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/gflags/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gflags/all/test_v1_package/conanfile.py b/recipes/gflags/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/gflags/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_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/ghc-filesystem/all/test_package/CMakeLists.txt b/recipes/ghc-filesystem/all/test_package/CMakeLists.txt index b3075eb110867..481cc25b30a69 100644 --- a/recipes/ghc-filesystem/all/test_package/CMakeLists.txt +++ b/recipes/ghc-filesystem/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(ghc_filesystem REQUIRED CONFIG) diff --git a/recipes/ghc-filesystem/all/test_v1_package/CMakeLists.txt b/recipes/ghc-filesystem/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/ghc-filesystem/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ghc-filesystem/all/test_v1_package/conanfile.py b/recipes/ghc-filesystem/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ghc-filesystem/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_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/giflib/5.1.x/conanfile.py b/recipes/giflib/5.1.x/conanfile.py index 9853dbf433ace..ea0071d4e3468 100644 --- a/recipes/giflib/5.1.x/conanfile.py +++ b/recipes/giflib/5.1.x/conanfile.py @@ -1,19 +1,27 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os import shutil -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, copy, get, rename, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path + +required_conan_version = ">=1.53.0" class GiflibConan(ConanFile): name = "giflib" description = "A library and utilities for reading and writing GIF images." - url = "https://github.com/conan-io/conan-center-index" license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "http://giflib.sourceforge.net" - topics = ("giflib", "image", "multimedia", "format", "graphics") + topics = ("image", "multimedia", "format", "graphics") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,25 +32,16 @@ class GiflibConan(ConanFile): "fPIC": True, } - # The exported files I took them from https://github.com/bjornblissing/osg-3rdparty-cmake/tree/master/giflib - # refactored a little - exports_sources = ["unistd.h", "gif_lib.h"] - - @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): + # The exported files I took them from + # https://github.com/bjornblissing/osg-3rdparty-cmake/tree/master/giflib + # refactored a little + copy(self, "unistd.h", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "gif_lib.h", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -50,110 +49,100 @@ 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 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") + 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) + 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_defines.append("USE_GIF_DLL" if self.options.shared else "USE_GIF_LIB") + 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)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + # ar-lib wrapper is added by ./configure automatically + # 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 _patch_sources(self): + # disable util build - tools and internal libs + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), + "SUBDIRS = lib util pic $(am__append_1)", + "SUBDIRS = lib pic $(am__append_1)") + + if is_msvc(self): + # add unistd.h for VS + shutil.copy(os.path.join(self.export_sources_folder, "unistd.h"), + os.path.join(self.source_folder, "lib")) + # fully replace gif_lib.h for VS, with patched version + ver_components = self.version.split(".") + header_path = os.path.join(self.source_folder, "lib", "gif_lib.h") + shutil.copy(os.path.join(self.export_sources_folder, "gif_lib.h"), header_path) + replace_in_file(self, header_path, "@GIFLIB_MAJOR@", ver_components[0]) + replace_in_file(self, header_path, "@GIFLIB_MINOR@", ver_components[1]) + replace_in_file(self, header_path, "@GIFLIB_RELEASE@", ver_components[2]) + 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 is_apple_os(self): + # relocatable shared lib on macOS + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "-install_name \\$rpath/\\$soname", + "-install_name \\@rpath/\\$soname") def build(self): - # disable util build - tools and internal libs - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.in"), - "SUBDIRS = lib util pic $(am__append_1)", - "SUBDIRS = lib pic $(am__append_1)") - - if self._is_msvc: - self.build_visual() - else: - self.build_configure() - - def build_visual(self): - # fully replace gif_lib.h for VS, with patched version - ver_components = self.version.split(".") - tools.replace_in_file("gif_lib.h", "@GIFLIB_MAJOR@", ver_components[0]) - tools.replace_in_file("gif_lib.h", "@GIFLIB_MINOR@", ver_components[1]) - tools.replace_in_file("gif_lib.h", "@GIFLIB_RELEASE@", ver_components[2]) - shutil.copy("gif_lib.h", os.path.join(self._source_subfolder, "lib")) - # add unistd.h for VS - shutil.copy("unistd.h", os.path.join(self._source_subfolder, "lib")) - - with tools.chdir(self._source_subfolder): - if self.settings.arch == "x86": - host = "i686-w64-mingw32" - elif self.settings.arch == "x86_64": - host = "x86_64-w64-mingw32" - else: - raise ConanInvalidConfiguration("unsupported architecture %s" % self.settings.arch) - if self.options.shared: - options = "--disable-static --enable-shared" - else: - options = "--enable-static --disable-shared" - - cflags = "" - if not self.options.shared: - cflags = "-DUSE_GIF_LIB" - - prefix = tools.unix_path(os.path.abspath(self.package_folder)) - with tools.vcvars(self.settings): - command = "./configure " \ - "{options} " \ - "--host={host} " \ - "--prefix={prefix} " \ - 'CC="$PWD/compile cl -nologo" ' \ - 'CFLAGS="-{runtime} {cflags}" ' \ - 'CXX="$PWD/compile cl -nologo" ' \ - 'CXXFLAGS="-{runtime} {cflags}" ' \ - 'CPPFLAGS="-I{prefix}/include" ' \ - 'LDFLAGS="-L{prefix}/lib" ' \ - 'LD="link" ' \ - 'NM="dumpbin -symbols" ' \ - 'STRIP=":" ' \ - 'AR="$PWD/ar-lib lib" ' \ - 'RANLIB=":" '.format(host=host, prefix=prefix, options=options, - runtime=self.settings.compiler.runtime, cflags=cflags) - self.run(command, win_bash=True) - self.run("make", win_bash=True) - self.run("make install", win_bash=True) - - def build_configure(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")) - env_build = 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)), - ] - with tools.chdir(self._source_subfolder): - if tools.is_apple_os(self.settings.os): - # relocatable shared lib on macOS - tools.replace_in_file( - "configure", - "-install_name \\$rpath/\\$soname", - "-install_name \\@rpath/\\$soname" - ) - - self.run("chmod +x configure") - env_build.configure(args=args) - env_build.make() - env_build.make(args=["install"]) + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="COPYING*", dst="licenses", src=self._source_subfolder, ignore_case=True, keep_path=False) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "share")) - if self._is_msvc and self.options.shared: - tools.rename(os.path.join(self.package_folder, "lib", "gif.dll.lib"), + 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, keep_path=False) + rm(self, "*.la", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "share")) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "gif.dll.lib"), os.path.join(self.package_folder, "lib", "gif.lib")) def package_info(self): @@ -161,9 +150,10 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "GIF") self.cpp_info.set_property("cmake_target_name", "GIF::GIF") - self.cpp_info.names["cmake_find_package"] = "GIF" - self.cpp_info.names["cmake_find_package_multi"] = "GIF" - self.cpp_info.libs = ["gif"] - if self._is_msvc: + if is_msvc(self): self.cpp_info.defines.append("USE_GIF_DLL" if self.options.shared else "USE_GIF_LIB") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "GIF" + self.cpp_info.names["cmake_find_package_multi"] = "GIF" diff --git a/recipes/giflib/5.1.x/test_package/CMakeLists.txt b/recipes/giflib/5.1.x/test_package/CMakeLists.txt index 95fca5bec20b2..b39dc8b19722d 100644 --- a/recipes/giflib/5.1.x/test_package/CMakeLists.txt +++ b/recipes/giflib/5.1.x/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(GIF REQUIRED) +find_package(GIF REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} GIF::GIF) diff --git a/recipes/giflib/5.1.x/test_package/conanfile.py b/recipes/giflib/5.1.x/test_package/conanfile.py index 9c22b9663e80c..77c3c08f8b8ed 100644 --- a/recipes/giflib/5.1.x/test_package/conanfile.py +++ b/recipes/giflib/5.1.x/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" + 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,8 +31,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): img_name = os.path.join(self.source_folder, "testimg.gif") - bin_path = os.path.join("bin", "test_package") - command = "{} {}".format(bin_path, img_name) - self.run(command, run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(f"{bin_path} {img_name}", env="conanrun") diff --git a/recipes/giflib/5.2.x/CMakeLists.txt b/recipes/giflib/5.2.x/CMakeLists.txt index 2d4e86b610d29..e676b16d18f06 100644 --- a/recipes/giflib/5.2.x/CMakeLists.txt +++ b/recipes/giflib/5.2.x/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(gif LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/giflib/5.2.x/conandata.yml b/recipes/giflib/5.2.x/conandata.yml index e36e2cd9d7be2..5833d90506e97 100644 --- a/recipes/giflib/5.2.x/conandata.yml +++ b/recipes/giflib/5.2.x/conandata.yml @@ -1,7 +1,25 @@ sources: + "5.2.2": + url: "https://downloads.sourceforge.net/project/giflib/giflib-5.2.2.tar.gz" + sha256: "be7ffbd057cadebe2aa144542fd90c6838c6a083b5e8a9048b8ee3b66b29d5fb" "5.2.1": url: "https://downloads.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz" sha256: "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd" patches: + "5.2.2": + - patch_file: "patches/0000-msvc-strtok_r.patch" + patch_description: "Use strtok_s instead of strtok_r with MSVC" + patch_type: "portability" + - patch_file: "patches/5.2.2-0001-msvc-export.patch" + patch_description: "export symbols with MSVC" + patch_type: "portability" "5.2.1": + - patch_file: "patches/0000-msvc-strtok_r.patch" + patch_description: "Use strtok_s instead of strtok_r with MSVC" + patch_type: "portability" - patch_file: "patches/0001-msvc-unistd.patch" + patch_description: "import unistd in non windows os" + patch_type: "portability" + - patch_file: "patches/5.2.1-0002-msvc-export.patch" + patch_description: "export symbols with MSVC" + patch_type: "portability" diff --git a/recipes/giflib/5.2.x/conanfile.py b/recipes/giflib/5.2.x/conanfile.py index 439c512e9402a..4a1ab9027e884 100644 --- a/recipes/giflib/5.2.x/conanfile.py +++ b/recipes/giflib/5.2.x/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0.9" class GiflibConan(ConanFile): @@ -79,8 +79,3 @@ def package_info(self): self.cpp_info.libs = ["gif"] if is_msvc(self): self.cpp_info.defines.append("USE_GIF_DLL" if self.options.shared else "USE_GIF_LIB") - - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "GIF" - self.cpp_info.names["cmake_find_package_multi"] = "GIF" - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/giflib/5.2.x/patches/0000-msvc-strtok_r.patch b/recipes/giflib/5.2.x/patches/0000-msvc-strtok_r.patch new file mode 100644 index 0000000000000..e9b7a0f9661b8 --- /dev/null +++ b/recipes/giflib/5.2.x/patches/0000-msvc-strtok_r.patch @@ -0,0 +1,15 @@ +diff --git a/gif_font.c b/gif_font.c +index d90783c..0fd20ed 100644 +--- a/gif_font.c ++++ b/gif_font.c +@@ -11,6 +11,10 @@ SPDX-License-Identifier: MIT + + #include "gif_lib.h" + ++#ifdef _MSC_VER ++# define strtok_r strtok_s ++#endif ++ + /***************************************************************************** + Ascii 8 by 8 regular font - only first 128 characters are supported. + *****************************************************************************/ diff --git a/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch b/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch index 05112f7bfb6f7..1a777f5c69b47 100644 --- a/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch +++ b/recipes/giflib/5.2.x/patches/0001-msvc-unistd.patch @@ -1,18 +1,3 @@ -diff --git a/gif_font.c b/gif_font.c -index d90783c..0fd20ed 100644 ---- a/gif_font.c -+++ b/gif_font.c -@@ -11,6 +11,10 @@ SPDX-License-Identifier: MIT - - #include "gif_lib.h" - -+#ifdef _MSC_VER -+# define strtok_r strtok_s -+#endif -+ - /***************************************************************************** - Ascii 8 by 8 regular font - only first 128 characters are supported. - *****************************************************************************/ diff --git a/gif_hash.h b/gif_hash.h index 6a1b585..6311cd1 100644 --- a/gif_hash.h @@ -29,233 +14,3 @@ index 6a1b585..6311cd1 100644 #include #define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */ -diff --git a/gif_lib.h b/gif_lib.h -index ebdbd3c..bf0d373 100644 ---- a/gif_lib.h -+++ b/gif_lib.h -@@ -13,6 +13,20 @@ SPDX-License-Identifier: MIT - extern "C" { - #endif /* __cplusplus */ - -+#ifdef _MSC_VER -+ #ifdef USE_GIF_LIB -+ #define GIF_EXPORT -+ #else /* USE_GIF_LIB */ -+ #ifdef USE_GIF_DLL -+ #define GIF_EXPORT __declspec(dllimport) -+ #else /* USE_GIF_DLL */ -+ #define GIF_EXPORT __declspec(dllexport) -+ #endif /* USE_GIF_DLL */ -+ #endif /* USE_GIF_LIB */ -+#else -+ #define GIF_EXPORT -+#endif /* _MSC_VER */ -+ - #define GIFLIB_MAJOR 5 - #define GIFLIB_MINOR 2 - #define GIFLIB_RELEASE 1 -@@ -125,13 +139,13 @@ typedef struct GraphicsControlBlock { - ******************************************************************************/ - - /* Main entry points */ --GifFileType *EGifOpenFileName(const char *GifFileName, -+GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, - const bool GifTestExistence, int *Error); --GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); --GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); --int EGifSpew(GifFileType * GifFile); --const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ --int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); -+GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); -+GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); -+GIF_EXPORT int EGifSpew(GifFileType * GifFile); -+GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ -+GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); - - #define E_GIF_SUCCEEDED 0 - #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ -@@ -146,31 +160,31 @@ int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); - #define E_GIF_ERR_NOT_WRITEABLE 10 - - /* These are legacy. You probably do not want to call them directly */ --int EGifPutScreenDesc(GifFileType *GifFile, -+GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, - const int GifWidth, const int GifHeight, - const int GifColorRes, - const int GifBackGround, - const ColorMapObject *GifColorMap); --int EGifPutImageDesc(GifFileType *GifFile, -+GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, - const int GifLeft, const int GifTop, - const int GifWidth, const int GifHeight, - const bool GifInterlace, - const ColorMapObject *GifColorMap); --void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); --int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, -+GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); -+GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, - int GifLineLen); --int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); --int EGifPutComment(GifFileType *GifFile, const char *GifComment); --int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); --int EGifPutExtensionBlock(GifFileType *GifFile, -+GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); -+GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment); -+GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); -+GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile, - const int GifExtLen, const void *GifExtension); --int EGifPutExtensionTrailer(GifFileType *GifFile); --int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, -+GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); -+GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, - const int GifExtLen, - const void *GifExtension); --int EGifPutCode(GifFileType *GifFile, int GifCodeSize, -+GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, - const GifByteType *GifCodeBlock); --int EGifPutCodeNext(GifFileType *GifFile, -+GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, - const GifByteType *GifCodeBlock); - - /****************************************************************************** -@@ -178,11 +192,11 @@ int EGifPutCodeNext(GifFileType *GifFile, - ******************************************************************************/ - - /* Main entry points */ --GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); --GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); --int DGifSlurp(GifFileType * GifFile); --GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ -- int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); -+GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); -+GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); -+GIF_EXPORT int DGifSlurp(GifFileType * GifFile); -+GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ -+GIF_EXPORT int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); - - #define D_GIF_SUCCEEDED 0 - #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ -@@ -200,26 +214,26 @@ GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new - #define D_GIF_ERR_EOF_TOO_SOON 113 - - /* These are legacy. You probably do not want to call them directly */ --int DGifGetScreenDesc(GifFileType *GifFile); --int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); --int DGifGetImageHeader(GifFileType *GifFile); --int DGifGetImageDesc(GifFileType *GifFile); --int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); --int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); --int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, -+GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); -+GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); -+GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile); -+GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile); -+GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); -+GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); -+GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, - GifByteType **GifExtension); --int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); --int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, -+GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); -+GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, - GifByteType **GifCodeBlock); --int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); --int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); --const char *DGifGetGifVersion(GifFileType *GifFile); -+GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); -+GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); -+GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile); - - - /****************************************************************************** - Error handling and reporting. - ******************************************************************************/ --extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ -+GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ - - /***************************************************************************** - Everything below this point is new after version 1.2, supporting `slurp -@@ -230,43 +244,43 @@ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ - Color map handling from gif_alloc.c - ******************************************************************************/ - --extern ColorMapObject *GifMakeMapObject(int ColorCount, -+GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount, - const GifColorType *ColorMap); --extern void GifFreeMapObject(ColorMapObject *Object); --extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, -+GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object); -+GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, - const ColorMapObject *ColorIn2, - GifPixelType ColorTransIn2[]); --extern int GifBitSize(int n); -+GIF_EXPORT extern int GifBitSize(int n); - - /****************************************************************************** - Support for the in-core structures allocation (slurp mode). - ******************************************************************************/ - --extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); --extern int GifAddExtensionBlock(int *ExtensionBlock_Count, -+GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); -+GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count, - ExtensionBlock **ExtensionBlocks, - int Function, - unsigned int Len, unsigned char ExtData[]); --extern void GifFreeExtensions(int *ExtensionBlock_Count, -+GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count, - ExtensionBlock **ExtensionBlocks); --extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, -+GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, - const SavedImage *CopyFrom); --extern void GifFreeSavedImages(GifFileType *GifFile); -+GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile); - - /****************************************************************************** - 5.x functions for GIF89 graphics control blocks - ******************************************************************************/ - --int DGifExtensionToGCB(const size_t GifExtensionLength, -+GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, - const GifByteType *GifExtension, - GraphicsControlBlock *GCB); --size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, -+GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, - GifByteType *GifExtension); - --int DGifSavedExtensionToGCB(GifFileType *GifFile, -+GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, - int ImageIndex, - GraphicsControlBlock *GCB); --int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, -+GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, - GifFileType *GifFile, - int ImageIndex); - -@@ -276,21 +290,21 @@ int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, - - #define GIF_FONT_WIDTH 8 - #define GIF_FONT_HEIGHT 8 --extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; -+GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; - --extern void GifDrawText8x8(SavedImage *Image, -+GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image, - const int x, const int y, - const char *legend, const int color); - --extern void GifDrawBox(SavedImage *Image, -+GIF_EXPORT extern void GifDrawBox(SavedImage *Image, - const int x, const int y, - const int w, const int d, const int color); - --extern void GifDrawRectangle(SavedImage *Image, -+GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image, - const int x, const int y, - const int w, const int d, const int color); - --extern void GifDrawBoxedText8x8(SavedImage *Image, -+GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image, - const int x, const int y, - const char *legend, - const int border, const int bg, const int fg); diff --git a/recipes/giflib/5.2.x/patches/5.2.1-0002-msvc-export.patch b/recipes/giflib/5.2.x/patches/5.2.1-0002-msvc-export.patch new file mode 100644 index 0000000000000..d9383c54a5729 --- /dev/null +++ b/recipes/giflib/5.2.x/patches/5.2.1-0002-msvc-export.patch @@ -0,0 +1,230 @@ +diff --git a/gif_lib.h b/gif_lib.h +index ebdbd3c..bf0d373 100644 +--- a/gif_lib.h ++++ b/gif_lib.h +@@ -13,6 +13,20 @@ SPDX-License-Identifier: MIT + extern "C" { + #endif /* __cplusplus */ + ++#ifdef _MSC_VER ++ #ifdef USE_GIF_LIB ++ #define GIF_EXPORT ++ #else /* USE_GIF_LIB */ ++ #ifdef USE_GIF_DLL ++ #define GIF_EXPORT __declspec(dllimport) ++ #else /* USE_GIF_DLL */ ++ #define GIF_EXPORT __declspec(dllexport) ++ #endif /* USE_GIF_DLL */ ++ #endif /* USE_GIF_LIB */ ++#else ++ #define GIF_EXPORT ++#endif /* _MSC_VER */ ++ + #define GIFLIB_MAJOR 5 + #define GIFLIB_MINOR 2 + #define GIFLIB_RELEASE 1 +@@ -125,13 +139,13 @@ typedef struct GraphicsControlBlock { + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *EGifOpenFileName(const char *GifFileName, ++GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, + const bool GifTestExistence, int *Error); +-GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); +-GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); +-int EGifSpew(GifFileType * GifFile); +-const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ +-int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); ++GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); ++GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); ++GIF_EXPORT int EGifSpew(GifFileType * GifFile); ++GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ ++GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + + #define E_GIF_SUCCEEDED 0 + #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ +@@ -146,31 +160,31 @@ int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + #define E_GIF_ERR_NOT_WRITEABLE 10 + + /* These are legacy. You probably do not want to call them directly */ +-int EGifPutScreenDesc(GifFileType *GifFile, ++GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, + const int GifWidth, const int GifHeight, + const int GifColorRes, + const int GifBackGround, + const ColorMapObject *GifColorMap); +-int EGifPutImageDesc(GifFileType *GifFile, ++GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, + const int GifLeft, const int GifTop, + const int GifWidth, const int GifHeight, + const bool GifInterlace, + const ColorMapObject *GifColorMap); +-void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); +-int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, ++GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); ++GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, + int GifLineLen); +-int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); +-int EGifPutComment(GifFileType *GifFile, const char *GifComment); +-int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); +-int EGifPutExtensionBlock(GifFileType *GifFile, ++GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); ++GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment); ++GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); ++GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile, + const int GifExtLen, const void *GifExtension); +-int EGifPutExtensionTrailer(GifFileType *GifFile); +-int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, ++GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); ++GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, + const int GifExtLen, + const void *GifExtension); +-int EGifPutCode(GifFileType *GifFile, int GifCodeSize, ++GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, + const GifByteType *GifCodeBlock); +-int EGifPutCodeNext(GifFileType *GifFile, ++GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, + const GifByteType *GifCodeBlock); + + /****************************************************************************** +@@ -178,11 +192,11 @@ int EGifPutCodeNext(GifFileType *GifFile, + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); +-GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); +-int DGifSlurp(GifFileType * GifFile); +-GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ +- int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); ++GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); ++GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); ++GIF_EXPORT int DGifSlurp(GifFileType * GifFile); ++GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ ++GIF_EXPORT int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); + + #define D_GIF_SUCCEEDED 0 + #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ +@@ -200,26 +214,26 @@ GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new + #define D_GIF_ERR_EOF_TOO_SOON 113 + + /* These are legacy. You probably do not want to call them directly */ +-int DGifGetScreenDesc(GifFileType *GifFile); +-int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); +-int DGifGetImageHeader(GifFileType *GifFile); +-int DGifGetImageDesc(GifFileType *GifFile); +-int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +-int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); +-int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, ++GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); ++GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile); ++GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); ++GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); ++GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, + GifByteType **GifExtension); +-int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); +-int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, ++GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); ++GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, + GifByteType **GifCodeBlock); +-int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); +-int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); +-const char *DGifGetGifVersion(GifFileType *GifFile); ++GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); ++GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); ++GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile); + + + /****************************************************************************** + Error handling and reporting. + ******************************************************************************/ +-extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ ++GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + + /***************************************************************************** + Everything below this point is new after version 1.2, supporting `slurp +@@ -230,43 +244,43 @@ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + Color map handling from gif_alloc.c + ******************************************************************************/ + +-extern ColorMapObject *GifMakeMapObject(int ColorCount, ++GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount, + const GifColorType *ColorMap); +-extern void GifFreeMapObject(ColorMapObject *Object); +-extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, ++GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object); ++GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, + const ColorMapObject *ColorIn2, + GifPixelType ColorTransIn2[]); +-extern int GifBitSize(int n); ++GIF_EXPORT extern int GifBitSize(int n); + + /****************************************************************************** + Support for the in-core structures allocation (slurp mode). + ******************************************************************************/ + +-extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); +-extern int GifAddExtensionBlock(int *ExtensionBlock_Count, ++GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); ++GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks, + int Function, + unsigned int Len, unsigned char ExtData[]); +-extern void GifFreeExtensions(int *ExtensionBlock_Count, ++GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks); +-extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, ++GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, + const SavedImage *CopyFrom); +-extern void GifFreeSavedImages(GifFileType *GifFile); ++GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile); + + /****************************************************************************** + 5.x functions for GIF89 graphics control blocks + ******************************************************************************/ + +-int DGifExtensionToGCB(const size_t GifExtensionLength, ++GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, + const GifByteType *GifExtension, + GraphicsControlBlock *GCB); +-size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, + GifByteType *GifExtension); + +-int DGifSavedExtensionToGCB(GifFileType *GifFile, ++GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, + int ImageIndex, + GraphicsControlBlock *GCB); +-int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + GifFileType *GifFile, + int ImageIndex); + +@@ -276,21 +290,21 @@ int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + + #define GIF_FONT_WIDTH 8 + #define GIF_FONT_HEIGHT 8 +-extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; ++GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; + +-extern void GifDrawText8x8(SavedImage *Image, ++GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, const int color); + +-extern void GifDrawBox(SavedImage *Image, ++GIF_EXPORT extern void GifDrawBox(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +-extern void GifDrawRectangle(SavedImage *Image, ++GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +-extern void GifDrawBoxedText8x8(SavedImage *Image, ++GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, + const int border, const int bg, const int fg); diff --git a/recipes/giflib/5.2.x/patches/5.2.2-0001-msvc-export.patch b/recipes/giflib/5.2.x/patches/5.2.2-0001-msvc-export.patch new file mode 100644 index 0000000000000..bdeb9f0885c6a --- /dev/null +++ b/recipes/giflib/5.2.x/patches/5.2.2-0001-msvc-export.patch @@ -0,0 +1,220 @@ +diff --git a/gif_lib.h b/gif_lib.h +--- a/gif_lib.h ++++ b/gif_lib.h +@@ -13,6 +13,20 @@ + extern "C" { + #endif /* __cplusplus */ + ++#ifdef _MSC_VER ++ #ifdef USE_GIF_LIB ++ #define GIF_EXPORT ++ #else /* USE_GIF_LIB */ ++ #ifdef USE_GIF_DLL ++ #define GIF_EXPORT __declspec(dllimport) ++ #else /* USE_GIF_DLL */ ++ #define GIF_EXPORT __declspec(dllexport) ++ #endif /* USE_GIF_DLL */ ++ #endif /* USE_GIF_LIB */ ++#else ++ #define GIF_EXPORT ++#endif /* _MSC_VER */ ++ + #define GIFLIB_MAJOR 5 + #define GIFLIB_MINOR 2 + #define GIFLIB_RELEASE 2 +@@ -125,13 +139,13 @@ + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *EGifOpenFileName(const char *GifFileName, ++GIF_EXPORT GifFileType *EGifOpenFileName(const char *GifFileName, + const bool GifTestExistence, int *Error); +-GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); +-GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); +-int EGifSpew(GifFileType *GifFile); +-const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ +-int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); ++GIF_EXPORT GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); ++GIF_EXPORT GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); ++GIF_EXPORT int EGifSpew(GifFileType *GifFile); ++GIF_EXPORT const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ ++GIF_EXPORT int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); + + #define E_GIF_SUCCEEDED 0 + #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ +@@ -146,39 +160,39 @@ + #define E_GIF_ERR_NOT_WRITEABLE 10 + + /* These are legacy. You probably do not want to call them directly */ +-int EGifPutScreenDesc(GifFileType *GifFile, const int GifWidth, ++GIF_EXPORT int EGifPutScreenDesc(GifFileType *GifFile, const int GifWidth, + const int GifHeight, const int GifColorRes, + const int GifBackGround, + const ColorMapObject *GifColorMap); +-int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop, ++GIF_EXPORT int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop, + const int GifWidth, const int GifHeight, + const bool GifInterlace, + const ColorMapObject *GifColorMap); +-void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); +-int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +-int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); +-int EGifPutComment(GifFileType *GifFile, const char *GifComment); +-int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); +-int EGifPutExtensionBlock(GifFileType *GifFile, const int GifExtLen, ++GIF_EXPORT void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); ++GIF_EXPORT int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); ++GIF_EXPORT int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); ++GIF_EXPORT int EGifPutComment(GifFileType *GifFile, const char *GifComment); ++GIF_EXPORT int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); ++GIF_EXPORT int EGifPutExtensionBlock(GifFileType *GifFile, const int GifExtLen, + const void *GifExtension); +-int EGifPutExtensionTrailer(GifFileType *GifFile); +-int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, ++GIF_EXPORT int EGifPutExtensionTrailer(GifFileType *GifFile); ++GIF_EXPORT int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, + const int GifExtLen, const void *GifExtension); +-int EGifPutCode(GifFileType *GifFile, int GifCodeSize, ++GIF_EXPORT int EGifPutCode(GifFileType *GifFile, int GifCodeSize, + const GifByteType *GifCodeBlock); +-int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock); ++GIF_EXPORT int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock); + + /****************************************************************************** + GIF decoding routines + ******************************************************************************/ + + /* Main entry points */ +-GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); +-GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); +-int DGifSlurp(GifFileType *GifFile); +-GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, ++GIF_EXPORT GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); ++GIF_EXPORT GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); ++GIF_EXPORT int DGifSlurp(GifFileType *GifFile); ++GIF_EXPORT GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, + int *Error); /* new one (TVT) */ +-int DGifCloseFile(GifFileType *GifFile, int *ErrorCode); ++GIF_EXPORT int DGifCloseFile(GifFileType *GifFile, int *ErrorCode); + + #define D_GIF_SUCCEEDED 0 + #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ +@@ -196,25 +210,25 @@ + #define D_GIF_ERR_EOF_TOO_SOON 113 + + /* These are legacy. You probably do not want to call them directly */ +-int DGifGetScreenDesc(GifFileType *GifFile); +-int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); +-int DGifGetImageHeader(GifFileType *GifFile); +-int DGifGetImageDesc(GifFileType *GifFile); +-int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); +-int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); +-int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, ++GIF_EXPORT int DGifGetScreenDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); ++GIF_EXPORT int DGifGetImageHeader(GifFileType *GifFile); ++GIF_EXPORT int DGifGetImageDesc(GifFileType *GifFile); ++GIF_EXPORT int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); ++GIF_EXPORT int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); ++GIF_EXPORT int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, + GifByteType **GifExtension); +-int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); +-int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, ++GIF_EXPORT int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); ++GIF_EXPORT int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, + GifByteType **GifCodeBlock); +-int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); +-int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); +-const char *DGifGetGifVersion(GifFileType *GifFile); ++GIF_EXPORT int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); ++GIF_EXPORT int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); ++GIF_EXPORT const char *DGifGetGifVersion(GifFileType *GifFile); + + /****************************************************************************** + Error handling and reporting. + ******************************************************************************/ +-extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ ++GIF_EXPORT extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ + + /***************************************************************************** + Everything below this point is new after version 1.2, supporting `slurp +@@ -225,42 +239,42 @@ + Color map handling from gif_alloc.c + ******************************************************************************/ + +-extern ColorMapObject *GifMakeMapObject(int ColorCount, ++GIF_EXPORT extern ColorMapObject *GifMakeMapObject(int ColorCount, + const GifColorType *ColorMap); +-extern void GifFreeMapObject(ColorMapObject *Object); +-extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, ++GIF_EXPORT extern void GifFreeMapObject(ColorMapObject *Object); ++GIF_EXPORT extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, + const ColorMapObject *ColorIn2, + GifPixelType ColorTransIn2[]); +-extern int GifBitSize(int n); ++GIF_EXPORT extern int GifBitSize(int n); + + /****************************************************************************** + Support for the in-core structures allocation (slurp mode). + ******************************************************************************/ + +-extern void GifApplyTranslation(SavedImage *Image, ++GIF_EXPORT extern void GifApplyTranslation(SavedImage *Image, + const GifPixelType Translation[]); +-extern int GifAddExtensionBlock(int *ExtensionBlock_Count, ++GIF_EXPORT extern int GifAddExtensionBlock(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks, int Function, + unsigned int Len, unsigned char ExtData[]); +-extern void GifFreeExtensions(int *ExtensionBlock_Count, ++GIF_EXPORT extern void GifFreeExtensions(int *ExtensionBlock_Count, + ExtensionBlock **ExtensionBlocks); +-extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, ++GIF_EXPORT extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, + const SavedImage *CopyFrom); +-extern void GifFreeSavedImages(GifFileType *GifFile); ++GIF_EXPORT extern void GifFreeSavedImages(GifFileType *GifFile); + + /****************************************************************************** + 5.x functions for GIF89 graphics control blocks + ******************************************************************************/ + +-int DGifExtensionToGCB(const size_t GifExtensionLength, ++GIF_EXPORT int DGifExtensionToGCB(const size_t GifExtensionLength, + const GifByteType *GifExtension, + GraphicsControlBlock *GCB); +-size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, + GifByteType *GifExtension); + +-int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex, ++GIF_EXPORT int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex, + GraphicsControlBlock *GCB); +-int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, ++GIF_EXPORT int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, + GifFileType *GifFile, int ImageIndex); + + /****************************************************************************** +@@ -269,18 +283,18 @@ + + #define GIF_FONT_WIDTH 8 + #define GIF_FONT_HEIGHT 8 +-extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; ++GIF_EXPORT extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; + +-extern void GifDrawText8x8(SavedImage *Image, const int x, const int y, ++GIF_EXPORT extern void GifDrawText8x8(SavedImage *Image, const int x, const int y, + const char *legend, const int color); + +-extern void GifDrawBox(SavedImage *Image, const int x, const int y, const int w, ++GIF_EXPORT extern void GifDrawBox(SavedImage *Image, const int x, const int y, const int w, + const int d, const int color); + +-extern void GifDrawRectangle(SavedImage *Image, const int x, const int y, ++GIF_EXPORT extern void GifDrawRectangle(SavedImage *Image, const int x, const int y, + const int w, const int d, const int color); + +-extern void GifDrawBoxedText8x8(SavedImage *Image, const int x, const int y, ++GIF_EXPORT extern void GifDrawBoxedText8x8(SavedImage *Image, const int x, const int y, + const char *legend, const int border, + const int bg, const int fg); + diff --git a/recipes/giflib/5.2.x/test_package/CMakeLists.txt b/recipes/giflib/5.2.x/test_package/CMakeLists.txt index 909c7abfcc3fc..d40a4c2c931fb 100644 --- a/recipes/giflib/5.2.x/test_package/CMakeLists.txt +++ b/recipes/giflib/5.2.x/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(GIF REQUIRED) +find_package(GIF REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE GIF::GIF) diff --git a/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt b/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/giflib/5.2.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/giflib/5.2.x/test_v1_package/conanfile.py b/recipes/giflib/5.2.x/test_v1_package/conanfile.py deleted file mode 100644 index 15e08a8cf4897..0000000000000 --- a/recipes/giflib/5.2.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +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(f"{bin_path} testimg.gif", run_environment=True) - assert os.path.isfile("testimg.gif") - if self.options["giflib"].utils: - self.run("gif2rgb -o testimg.rgb testimg.gif", run_environment=True) - assert os.path.isfile("testimg.rgb.R") diff --git a/recipes/giflib/config.yml b/recipes/giflib/config.yml index 1ccf672c09135..c70c4f2d279f1 100644 --- a/recipes/giflib/config.yml +++ b/recipes/giflib/config.yml @@ -1,4 +1,6 @@ versions: + "5.2.2": + folder: "5.2.x" "5.2.1": folder: "5.2.x" "5.1.4": diff --git a/recipes/ginkgo/all/conandata.yml b/recipes/ginkgo/all/conandata.yml index 8927c006e472b..471710d33e7c9 100644 --- a/recipes/ginkgo/all/conandata.yml +++ b/recipes/ginkgo/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.0": + url: "https://github.com/ginkgo-project/ginkgo/archive/v1.8.0.tar.gz" + sha256: "421efaed1be2ef11d230b79fc68bcf7e264a2c57ae52aff6dec7bd90f8d4ae30" "1.7.0": url: "https://github.com/ginkgo-project/ginkgo/archive/v1.7.0.tar.gz" sha256: "f4b362bcb046bc53fbe2e578662b939222d0c44b96449101829e73ecce02bcb3" diff --git a/recipes/ginkgo/all/conanfile.py b/recipes/ginkgo/all/conanfile.py index 89bbd2a608d1e..9eb411b3e5186 100644 --- a/recipes/ginkgo/all/conanfile.py +++ b/recipes/ginkgo/all/conanfile.py @@ -2,7 +2,13 @@ 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 +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 @@ -43,7 +49,7 @@ def _min_cppstd(self): def _minimum_compilers_version(self): return { "Visual Studio": "16", - "msvc": "192", + "msvc": "193", "gcc": "5.4", "clang": "3.9", "apple-clang": "10.0", @@ -126,7 +132,12 @@ 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", + 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")) @@ -139,56 +150,85 @@ def package_info(self): debug_suffix = "d" if self.settings.build_type == "Debug" else "" has_dpcpp_device = Version(self.version) >= "1.4.0" + # Shared MSVC builds ues a separate library for part of Ginkgo since 1.8.0 + has_config_library = Version(self.version) >= "1.8.0" and self.options.shared and self.settings.os == "Windows" - self.cpp_info.components["ginkgo_core"].set_property("cmake_target_name", "Ginkgo::ginkgo") - self.cpp_info.components["ginkgo_core"].set_property("pkg_config_name", "ginkgo") - self.cpp_info.components["ginkgo_core"].libs = [ - "ginkgo" + debug_suffix] + self.cpp_info.components["ginkgo_core"].set_property( + "cmake_target_name", "Ginkgo::ginkgo" + ) + self.cpp_info.components["ginkgo_core"].set_property( + "pkg_config_name", "ginkgo" + ) + self.cpp_info.components["ginkgo_core"].libs = ["ginkgo" + debug_suffix] self.cpp_info.components["ginkgo_core"].requires = [ - "ginkgo_omp", "ginkgo_cuda", "ginkgo_reference", "ginkgo_hip" + "ginkgo_omp", + "ginkgo_cuda", + "ginkgo_reference", + "ginkgo_hip", ] - self.cpp_info.components["ginkgo_cuda"].set_property("cmake_target_name", "Ginkgo::ginkgo_cuda") - self.cpp_info.components["ginkgo_cuda"].libs = [ - "ginkgo_cuda" + debug_suffix] + self.cpp_info.components["ginkgo_cuda"].set_property( + "cmake_target_name", "Ginkgo::ginkgo_cuda" + ) + self.cpp_info.components["ginkgo_cuda"].libs = ["ginkgo_cuda" + debug_suffix] self.cpp_info.components["ginkgo_cuda"].requires = ["ginkgo_hip"] - self.cpp_info.components["ginkgo_omp"].set_property("cmake_target_name", "Ginkgo::ginkgo_omp") - self.cpp_info.components["ginkgo_omp"].libs = [ - "ginkgo_omp" + debug_suffix] - self.cpp_info.components["ginkgo_omp"].requires = [ - "ginkgo_cuda", "ginkgo_hip"] + self.cpp_info.components["ginkgo_omp"].set_property( + "cmake_target_name", "Ginkgo::ginkgo_omp" + ) + self.cpp_info.components["ginkgo_omp"].libs = ["ginkgo_omp" + debug_suffix] + self.cpp_info.components["ginkgo_omp"].requires = ["ginkgo_cuda", "ginkgo_hip"] - self.cpp_info.components["ginkgo_hip"].set_property("cmake_target_name", "Ginkgo::ginkgo_hip") - self.cpp_info.components["ginkgo_hip"].libs = [ - "ginkgo_hip" + debug_suffix] + self.cpp_info.components["ginkgo_hip"].set_property( + "cmake_target_name", "Ginkgo::ginkgo_hip" + ) + self.cpp_info.components["ginkgo_hip"].libs = ["ginkgo_hip" + debug_suffix] - self.cpp_info.components["ginkgo_reference"].set_property("cmake_target_name", "Ginkgo::ginkgo_reference") + self.cpp_info.components["ginkgo_reference"].set_property( + "cmake_target_name", "Ginkgo::ginkgo_reference" + ) self.cpp_info.components["ginkgo_reference"].libs = [ - "ginkgo_reference" + debug_suffix] + "ginkgo_reference" + debug_suffix + ] - if has_dpcpp_device: # Always add these components + if has_dpcpp_device: # Always add these components # See https://github.com/conan-io/conan-center-index/pull/7044#discussion_r698181588 self.cpp_info.components["ginkgo_core"].requires += ["ginkgo_dpcpp"] self.cpp_info.components["ginkgo_core"].requires += ["ginkgo_device"] - self.cpp_info.components["ginkgo_dpcpp"].set_property("cmake_target_name", "Ginkgo::ginkgo_dpcpp") + self.cpp_info.components["ginkgo_dpcpp"].set_property( + "cmake_target_name", "Ginkgo::ginkgo_dpcpp" + ) self.cpp_info.components["ginkgo_dpcpp"].libs = [ - "ginkgo_dpcpp" + debug_suffix] + "ginkgo_dpcpp" + debug_suffix + ] - self.cpp_info.components["ginkgo_device"].set_property("cmake_target_name", "Ginkgo::ginkgo_device") + self.cpp_info.components["ginkgo_device"].set_property( + "cmake_target_name", "Ginkgo::ginkgo_device" + ) self.cpp_info.components["ginkgo_device"].libs = [ - "ginkgo_device" + debug_suffix] + "ginkgo_device" + debug_suffix + ] self.cpp_info.components["ginkgo_omp"].requires += [ - "ginkgo_dpcpp", "ginkgo_device"] + "ginkgo_dpcpp", + "ginkgo_device", + ] self.cpp_info.components["ginkgo_reference"].requires += ["ginkgo_device"] self.cpp_info.components["ginkgo_hip"].requires += ["ginkgo_device"] self.cpp_info.components["ginkgo_cuda"].requires += ["ginkgo_device"] self.cpp_info.components["ginkgo_dpcpp"].requires += ["ginkgo_device"] + + if has_config_library: + self.cpp_info.components["ginkgo_core"].requires += ["ginkgo_config"] + + self.cpp_info.components["ginkgo_config"].set_property("cmake_target_name", "Ginkgo::ginkgo_core") + self.cpp_info.components["ginkgo_config"].libs = ["ginkgo_core" + debug_suffix] # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.names["cmake_find_package"] = "Ginkgo" self.cpp_info.names["cmake_find_package_multi"] = "Ginkgo" self.cpp_info.components["ginkgo_core"].names["cmake_find_package"] = "ginkgo" - self.cpp_info.components["ginkgo_core"].names["cmake_find_package_multi"] = "ginkgo" + self.cpp_info.components["ginkgo_core"].names[ + "cmake_find_package_multi" + ] = "ginkgo" diff --git a/recipes/ginkgo/config.yml b/recipes/ginkgo/config.yml index 4283c517286f9..ae16141456580 100644 --- a/recipes/ginkgo/config.yml +++ b/recipes/ginkgo/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.0": + folder: all "1.7.0": folder: all "1.4.0": diff --git a/recipes/gklib/all/patches/004-increase-minimum-cmakelists.patch b/recipes/gklib/all/patches/004-increase-minimum-cmakelists.patch index fc47c174baee0..392f6f72c8ca5 100644 --- a/recipes/gklib/all/patches/004-increase-minimum-cmakelists.patch +++ b/recipes/gklib/all/patches/004-increase-minimum-cmakelists.patch @@ -13,7 +13,7 @@ index 2bc6f77..9ef8038 100644 +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) -+cmake_minimum_required(VERSION 3.4) ++cmake_minimum_required(VERSION 3.5) project(GKlib C) option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF) diff --git a/recipes/gklib/all/test_v1_package/CMakeLists.txt b/recipes/gklib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9735bda16bdf4..0000000000000 --- a/recipes/gklib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gklib/all/test_v1_package/conanfile.py b/recipes/gklib/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/gklib/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/glad/all/conanfile.py b/recipes/glad/all/conanfile.py index 6e5e16777a859..8d05570ad234d 100644 --- a/recipes/glad/all/conanfile.py +++ b/recipes/glad/all/conanfile.py @@ -5,6 +5,8 @@ from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir from conan.errors import ConanInvalidConfiguration +required_conan_version = ">=2" + class GladConan(ConanFile): name = "glad" description = "Multi-Language GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs." @@ -13,6 +15,7 @@ class GladConan(ConanFile): homepage = "https://github.com/Dav1dde/glad" license = "MIT" settings = "os", "compiler", "build_type", "arch" + package_type = "library" options = { "shared": [True, False], @@ -91,7 +94,8 @@ def layout(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - + apply_conandata_patches(self) + def generate(self): tc = CMakeToolchain(self) if "gl_profile" in self.options: @@ -103,10 +107,10 @@ def generate(self): tc.variables["GLAD_GENERATOR"] = "c" if self.settings.build_type == "Release" else "c-debug" tc.variables["GLAD_EXPORT"] = True tc.variables["GLAD_INSTALL"] = True + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/glad/all/test_v1_package/CMakeLists.txt b/recipes/glad/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 393ceb7e700f6..0000000000000 --- a/recipes/glad/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/glad/all/test_v1_package/conanfile.py b/recipes/glad/all/test_v1_package/conanfile.py deleted file mode 100644 index 90eb89e3f2f46..0000000000000 --- a/recipes/glad/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml index 049a93b0fe130..30d4bca072699 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,25 +1,52 @@ sources: - "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" + "5.0.2": + url: "https://github.com/stephenberry/glaze/archive/v5.0.2.tar.gz" + sha256: "ed47ba0b5dcef5a2d2a41b4863e91a3b509c469a70c1a1fed885545d1b672681" + "5.0.0": + url: "https://github.com/stephenberry/glaze/archive/v5.0.0.tar.gz" + sha256: "37e4ab809f18c5497a35481f347c1ed63761324644e358d92a7a11fe647fd44a" + "4.4.3": + url: "https://github.com/stephenberry/glaze/archive/v4.4.3.tar.gz" + sha256: "d0dd03f156f95860bf9c2957da0704ee0f7651e21089ff34e3d26fa0190e8684" + "4.3.1": + url: "https://github.com/stephenberry/glaze/archive/v4.3.1.tar.gz" + sha256: "934b16d0a00dfc2b06bc2920a6444b8a6a34edb4f0fe872f8ad7a044518a37e3" + "4.0.1": + url: "https://github.com/stephenberry/glaze/archive/v4.0.1.tar.gz" + sha256: "0026aca33201ee6d3a820fb5926f36ba8c838bfd3120e2e179b0eee62b5bd231" + "3.6.2": + url: "https://github.com/stephenberry/glaze/archive/v3.6.2.tar.gz" + sha256: "74b14656b7a47c0a03d0a857adf5059e8c2351a7a84623593be0dd16b293216c" + "3.6.1": + url: "https://github.com/stephenberry/glaze/archive/v3.6.1.tar.gz" + sha256: "70324ad952adee32d6bbf95a0983f0c1623ce61bd237aa28c8337af2d8bb9ed5" + # keep 3.4.3 for breaking change: API(naming) change + "3.4.3": + url: "https://github.com/stephenberry/glaze/archive/v3.4.3.tar.gz" + sha256: "2af1ecc9fbdcb8182d5633979a12b950f6728dd0d76f02affa1e11b1a3369314" + "3.4.1": + url: "https://github.com/stephenberry/glaze/archive/v3.4.1.tar.gz" + sha256: "73a38c4d7731714581061a918b33ad57cf38404abc68d9a58dbe57d56fe26a79" + "3.3.4": + url: "https://github.com/stephenberry/glaze/archive/v3.3.4.tar.gz" + sha256: "7fe31c14e7ede69d937aa8f126894fef11ebf3156f25cb95446d3d6d38e9da9c" + "3.3.2": + url: "https://github.com/stephenberry/glaze/archive/v3.3.2.tar.gz" + sha256: "e492d3f662c3c096ce7abac86780af6c84f74c4f19b29223ad92fccc054aafad" + "3.3.1": + url: "https://github.com/stephenberry/glaze/archive/v3.3.1.tar.gz" + sha256: "edb16f7b75bf9a7c86a704c006a9859474e1d49467f8ddeabdc8c3a3d5a982a2" + "3.1.9": + url: "https://github.com/stephenberry/glaze/archive/v3.1.9.tar.gz" + sha256: "adfce5acc9d3d88525c006a525e8f21d2a4bb628b5f7022720625f052d88a73d" + "3.1.7": + url: "https://github.com/stephenberry/glaze/archive/v3.1.7.tar.gz" + sha256: "388483bb3dfa1fe25c1dfec24f0afd1651e0303833cfa1b7f51020a2569e992a" + # keep 2.9.5 for c++20 compilers + "2.9.5": + url: "https://github.com/stephenberry/glaze/archive/v2.9.5.tar.gz" + sha256: "67fda0fb0cc701451c261bb1e0c94d63bafaaba13390527521e02a034eff085e" + # keep 2.8.4 for breaking change: pure reflection support for C style arrays + "2.8.4": + url: "https://github.com/stephenberry/glaze/archive/v2.8.4.tar.gz" + sha256: "6ca8e63783f0a1dbe69f50c0bc289134301ecf930ada83489b9715cdd2a49252" diff --git a/recipes/glaze/all/conanfile.py b/recipes/glaze/all/conanfile.py index f991920259f6a..e353497cda64e 100644 --- a/recipes/glaze/all/conanfile.py +++ b/recipes/glaze/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.51.1" @@ -21,17 +22,26 @@ class GlazeConan(ConanFile): @property def _min_cppstd(self): - return 20 + return "20" if Version(self.version) < "3.0.0" else "23" @property def _compilers_minimum_version(self): return { - "Visual Studio": "17", - "msvc": "193", - "gcc": "10" if Version(self.version) < "1.9.0" else "11", - "clang": "12", - "apple-clang": "13.1", - } + "20": { + "Visual Studio": "17", + "msvc": "193", + "gcc": "11" if Version(self.version) < "2.6.3" else "12", + "clang": "14", + "apple-clang": "13.1", + }, + "23": { + "Visual Studio": "17", + "msvc": "193", + "gcc": "12", + "clang": "15", + "apple-clang": "14", + }, + }.get(self._min_cppstd, {}) def layout(self): basic_layout(self, src_folder="src") @@ -40,7 +50,7 @@ def package_id(self): self.info.clear() def validate(self): - if self.settings.get_safe("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: @@ -63,3 +73,5 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + if is_msvc(self): + self.cpp_info.cxxflags.append("/Zc:preprocessor") diff --git a/recipes/glaze/all/test_package/CMakeLists.txt b/recipes/glaze/all/test_package/CMakeLists.txt index 4811c5114c3c2..fc973c8b2b019 100644 --- a/recipes/glaze/all/test_package/CMakeLists.txt +++ b/recipes/glaze/all/test_package/CMakeLists.txt @@ -1,8 +1,12 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.20) project(test_package LANGUAGES CXX) 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_GREATER_EQUAL "3.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +endif() diff --git a/recipes/glaze/all/test_package/conanfile.py b/recipes/glaze/all/test_package/conanfile.py index a9fb96656f203..9fd1075c52a6b 100644 --- a/recipes/glaze/all/test_package/conanfile.py +++ b/recipes/glaze/all/test_package/conanfile.py @@ -15,6 +15,9 @@ def requirements(self): def layout(self): cmake_layout(self) + def build_requirements(self): + self.tool_requires("cmake/[>=3.20 <4]") + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml index 2c2e8c3fdb89e..afe9d0b62da3a 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,17 +1,33 @@ versions: - "1.9.5": + "5.0.2": folder: all - "1.8.5": + "5.0.0": folder: all - "1.8.4": + "4.4.3": folder: all - "1.8.3": + "4.3.1": folder: all - "1.8.2": + "4.0.1": folder: all - "1.8.1": + "3.6.2": folder: all - "1.7.0": + "3.6.1": folder: all - "1.6.1": + "3.4.3": + folder: all + "3.4.1": + folder: all + "3.3.4": + folder: all + "3.3.2": + folder: all + "3.3.1": + folder: all + "3.1.9": + folder: all + "3.1.7": + folder: all + "2.9.5": + folder: all + "2.8.4": folder: all diff --git a/recipes/glbinding/all/conandata.yml b/recipes/glbinding/all/conandata.yml index c3868ee88cb4c..9b8d3422ed887 100644 --- a/recipes/glbinding/all/conandata.yml +++ b/recipes/glbinding/all/conandata.yml @@ -1,8 +1,13 @@ sources: + "3.3.0": + url: "https://github.com/cginternals/glbinding/archive/v3.3.0.tar.gz" + sha256: "a0aa5e67b538649979a71705313fc2b2c3aa49cf9af62a97f7ee9a665fd30564" "3.1.0": url: "https://github.com/cginternals/glbinding/archive/v3.1.0.tar.gz" sha256: "6729b260787108462ec6d8954f32a3f11f959ada7eebf1a2a33173b68762849e" patches: + "3.3.0": + - patch_file: "patches/3.3/cmake-install.patch" "3.1.0": - - patch_file: "patches/cmake-install.patch" - - patch_file: "patches/getProcAddr.patch" + - patch_file: "patches/3.1/cmake-install.patch" + - patch_file: "patches/3.1/getProcAddr.patch" diff --git a/recipes/glbinding/all/patches/cmake-install.patch b/recipes/glbinding/all/patches/3.1/cmake-install.patch similarity index 100% rename from recipes/glbinding/all/patches/cmake-install.patch rename to recipes/glbinding/all/patches/3.1/cmake-install.patch diff --git a/recipes/glbinding/all/patches/getProcAddr.patch b/recipes/glbinding/all/patches/3.1/getProcAddr.patch similarity index 100% rename from recipes/glbinding/all/patches/getProcAddr.patch rename to recipes/glbinding/all/patches/3.1/getProcAddr.patch diff --git a/recipes/glbinding/all/patches/3.3/cmake-install.patch b/recipes/glbinding/all/patches/3.3/cmake-install.patch new file mode 100644 index 0000000000000..2e146402917de --- /dev/null +++ b/recipes/glbinding/all/patches/3.3/cmake-install.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -179,11 +179,11 @@ if(UNIX AND SYSTEM_DIR_INSTALL) + set(INSTALL_INIT "/etc/init") # /etc/init (upstart init scripts) + else() + # Install into local directory +- set(INSTALL_ROOT ".") # ./ ++ set(INSTALL_ROOT "share") # ./ + set(INSTALL_CMAKE "cmake") # ./cmake + set(INSTALL_EXAMPLES ".") # ./ + set(INSTALL_DATA ".") # ./ +- set(INSTALL_BIN ".") # ./ ++ set(INSTALL_BIN "bin") # ./ + set(INSTALL_SHARED "lib") # ./lib + set(INSTALL_LIB "lib") # ./lib + set(INSTALL_INCLUDE "include") # ./include diff --git a/recipes/glbinding/all/test_package/CMakeLists.txt b/recipes/glbinding/all/test_package/CMakeLists.txt index ff080ea67fff7..c51ace2d51b6e 100644 --- a/recipes/glbinding/all/test_package/CMakeLists.txt +++ b/recipes/glbinding/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(glbinding REQUIRED CONFIG) diff --git a/recipes/glbinding/all/test_v1_package/CMakeLists.txt b/recipes/glbinding/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/glbinding/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/glbinding/all/test_v1_package/conanfile.py b/recipes/glbinding/all/test_v1_package/conanfile.py deleted file mode 100644 index 67eb137fb4f2d..0000000000000 --- a/recipes/glbinding/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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 requirements(self): - self.requires("glfw/3.3.8") - - 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/glbinding/config.yml b/recipes/glbinding/config.yml index baa80af0c4b7d..e574d205652e6 100644 --- a/recipes/glbinding/config.yml +++ b/recipes/glbinding/config.yml @@ -1,3 +1,5 @@ versions: + "3.3.0": + folder: all "3.1.0": folder: all diff --git a/recipes/glew/all/conanfile.py b/recipes/glew/all/conanfile.py index 3aaec716377cb..98701723a8e2d 100644 --- a/recipes/glew/all/conanfile.py +++ b/recipes/glew/all/conanfile.py @@ -1,9 +1,11 @@ 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 apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class GlewConan(ConanFile): @@ -19,6 +21,7 @@ class GlewConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_egl": [True, False], + "with_glu": ["mesa-glu", "system"] } default_options = { "shared": False, @@ -29,11 +32,21 @@ class GlewConan(ConanFile): def export_sources(self): export_conandata_patches(self) + def validate(self): + if self.options.with_glu == "mesa-glu" and (is_apple_os(self) or self.settings.os == "Windows"): + raise ConanInvalidConfiguration("mesa-glu only suppported on Linux.") + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC del self.options.with_egl + if self.options.with_glu == None: + if is_apple_os(self) or self.settings.os == "Windows": + self.options.with_glu = "system" + else: + self.options.with_glu = "mesa-glu" + def configure(self): if self.options.shared: self.options.rm_safe("fPIC") @@ -45,7 +58,11 @@ def layout(self): def requirements(self): self.requires("opengl/system") - self.requires("glu/system") + # GL/glew.h includes glu.h. + if self.options.with_glu == "mesa-glu": + self.requires("mesa-glu/9.0.3", transitive_headers=True) + else: + self.requires("glu/system", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -74,7 +91,6 @@ def package_info(self): glewlib_target_name = "glew" if self.options.shared else "glew_s" self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_module_file_name", "GLEW") - self.cpp_info.set_property("cmake_file_name", "glew") self.cpp_info.set_property("cmake_target_name", "GLEW::GLEW") self.cpp_info.set_property("pkg_config_name", "glew") self.cpp_info.components["glewlib"].set_property("cmake_module_target_name", "GLEW::GLEW") @@ -90,12 +106,9 @@ def package_info(self): self.cpp_info.components["glewlib"].libs = [lib_name] if self.settings.os == "Windows" and not self.options.shared: self.cpp_info.components["glewlib"].defines.append("GLEW_STATIC") - self.cpp_info.components["glewlib"].requires = ["opengl::opengl", "glu::glu"] - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "GLEW" - self.cpp_info.filenames["cmake_find_package_multi"] = "glew" - self.cpp_info.names["cmake_find_package"] = "GLEW" - self.cpp_info.names["cmake_find_package_multi"] = "GLEW" - self.cpp_info.components["glewlib"].names["cmake_find_package"] = "GLEW" - self.cpp_info.components["glewlib"].names["cmake_find_package_multi"] = glewlib_target_name + self.cpp_info.components["glewlib"].requires = ["opengl::opengl"] + + if self.options.with_glu == "mesa-glu": + self.cpp_info.components["glewlib"].requires.append("mesa-glu::mesa-glu") + else: + self.cpp_info.components["glewlib"].requires.append("glu::glu") diff --git a/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch b/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch index d64b6d88a9c4b..88f1032be9460 100644 --- a/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch +++ b/recipes/glew/all/patches/0001-fix-cmake-2.1.0.patch @@ -1,7 +1,7 @@ --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -1,10 +1,10 @@ -+cmake_minimum_required (VERSION 2.8.12) ++cmake_minimum_required (VERSION 3.5) +project (glew C) if ( NOT DEFINED CMAKE_BUILD_TYPE ) set( CMAKE_BUILD_TYPE Release CACHE STRING "Build type" ) diff --git a/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch b/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch index 8373c5364c4dd..e7280cbabafb6 100644 --- a/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch +++ b/recipes/glew/all/patches/0001-fix-cmake-2.2.0.patch @@ -1,7 +1,7 @@ --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -1,10 +1,10 @@ -+cmake_minimum_required (VERSION 2.8.12) ++cmake_minimum_required (VERSION 3.5) +project (glew C) if ( NOT DEFINED CMAKE_BUILD_TYPE ) set( CMAKE_BUILD_TYPE Release CACHE STRING "Build type" ) diff --git a/recipes/glew/all/test_v1_package/CMakeLists.txt b/recipes/glew/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index abaffb362cf82..0000000000000 --- a/recipes/glew/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(GLEW REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE GLEW::GLEW) diff --git a/recipes/glew/all/test_v1_package/conanfile.py b/recipes/glew/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/glew/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/glfw/all/conandata.yml b/recipes/glfw/all/conandata.yml index bb5660da3ad7d..55bea05ef59a0 100644 --- a/recipes/glfw/all/conandata.yml +++ b/recipes/glfw/all/conandata.yml @@ -1,25 +1,13 @@ sources: + "3.4": + url: "https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip" + sha256: "b5ec004b2712fd08e8861dc271428f048775200a2df719ccf575143ba749a3e9" "3.3.8": url: "https://github.com/glfw/glfw/releases/download/3.3.8/glfw-3.3.8.zip" sha256: "4d025083cc4a3dd1f91ab9b9ba4f5807193823e565a5bcf4be202669d9911ea6" "3.3.7": url: "https://github.com/glfw/glfw/releases/download/3.3.7/glfw-3.3.7.zip" sha256: "4ef0c544a8ace9a6cd0e0aef8250090f89fea1bf96e9fc1d9d6f76386c290c9c" - "3.3.6": - url: "https://github.com/glfw/glfw/releases/download/3.3.6/glfw-3.3.6.zip" - sha256: "45537305d44c0a9f3612d4ec4a48414547cf854bff3ed613078f7ec648a12781" - "3.3.5": - url: "https://github.com/glfw/glfw/releases/download/3.3.5/glfw-3.3.5.zip" - sha256: "98a8639cfcd4f9ed2748cfa531c217e0364b64884b43e3336c62c58802eaa34f" - "3.3.4": - url: "https://github.com/glfw/glfw/releases/download/3.3.4/glfw-3.3.4.zip" - sha256: "bbd2c42c660b725e9755eb417e40b373f0d4c03138c9b2e210d02cd308bd99cd" - "3.3.3": - url: "https://github.com/glfw/glfw/releases/download/3.3.3/glfw-3.3.3.zip" - sha256: "723087ad45b40cd333be7d1a2cd5e09a28facb7f3acdb69f3e5613bd20543977" - "3.3.2": - 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" @@ -36,31 +24,4 @@ patches: 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" - patch_type: "portability" - patch_source: "https://github.com/glfw/glfw/commit/3327050ca66ad34426a82c217c2d60ced61526b7" - - patch_file: "patches/3.3.2-0002-macos-relocatable.patch" - 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" + \ No newline at end of file diff --git a/recipes/glfw/all/conanfile.py b/recipes/glfw/all/conanfile.py index c27f9801a9ee6..feaae050b7850 100644 --- a/recipes/glfw/all/conanfile.py +++ b/recipes/glfw/all/conanfile.py @@ -9,7 +9,7 @@ import os import textwrap -required_conan_version = ">=1.60.0 <2 || >=2.0.5" +required_conan_version = ">=2.0.5" class GlfwConan(ConanFile): @@ -52,6 +52,8 @@ def config_options(self): 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") + if Version(self.version) >= "3.4": + self.options.rm_safe("vulkan_static") def configure(self): if self.options.shared: @@ -61,14 +63,18 @@ def configure(self): if self.options.get_safe("with_wayland"): self.options["xkbcommon"].with_wayland = True + self.options["wayland"].shared = True + self.options["xkbcommon"].shared = 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.243.0") + # libs=False because glfw does not link to opengl, it + # loads it via dlopen or equivalent + self.requires("opengl/system", libs=False, transitive_headers=True) + if self.options.get_safe("vulkan_static"): + self.requires("vulkan-loader/1.3.268.0") if self.settings.os in ["Linux", "FreeBSD"]: if self.options.get_safe("with_x11", True): self.requires("xorg/system") @@ -77,16 +83,22 @@ def requirements(self): 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") + if self.options.get_safe("with_wayland"): + xkbcommon_options = self.dependencies["xkbcommon"].options + if not 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") + if not xkbcommon_options.shared: + raise ConanInvalidConfiguration(f"{self.ref} always loads xkbcommon dependencies dynamically and does not support static linkage") + if not self.dependencies["wayland"].options.shared: + raise ConanInvalidConfiguration(f"{self.ref} always loads wayland dependencies dynamically and does not support static linkage") def build_requirements(self): if self.options.get_safe("with_wayland"): - self.tool_requires("wayland-protocols/1.32") + self.tool_requires("wayland-protocols/1.33") 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") + self.tool_requires("pkgconf/[>=2.2 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -108,7 +120,8 @@ def generate(self): 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 Version(self.version) < "3.4": + tc.cache_variables["GLFW_VULKAN_STATIC"] = self.options.get_safe("vulkan_static", False) if is_msvc(self): tc.cache_variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) tc.generate() @@ -123,10 +136,8 @@ def generate(self): 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_prefix = self.dependencies.build["wayland-protocols"].package_folder + wp_version = self.dependencies.build["wayland-protocols"].ref.version wp_pkg_content = textwrap.dedent(f"""\ prefix={wp_prefix} datarootdir=${{prefix}}/res @@ -142,13 +153,13 @@ def _patch_sources(self): apply_conandata_patches(self) # don't force PIC replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), - "POSITION_INDEPENDENT_CODE ON", "") + "POSITION_INDEPENDENT_CODE ON", "") # don't force static link to libgcc if MinGW replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), - "target_link_libraries(glfw PRIVATE \"-static-libgcc\")", "") + "target_link_libraries(glfw PRIVATE \"-static-libgcc\")", "") # Allow to link vulkan-loader into shared glfw - if self.options.vulkan_static: + if self.options.get_safe("vulkan_static"): cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") replace_in_file( self, @@ -216,12 +227,38 @@ def package_info(self): "AppKit", "Cocoa", "CoreFoundation", "CoreGraphics", "CoreServices", "Foundation", "IOKit", ]) + self.cpp_info.requires = ["opengl::opengl"] + if self.options.get_safe("vulkan_static"): + self.cpp_info.requires.append("vulkan-loader::vulkan-loader") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.get_safe("with_x11", True): + # https://github.com/glfw/glfw/blob/3.4/src/CMakeLists.txt#L181-L218 + # https://github.com/glfw/glfw/blob/3.3.2/CMakeLists.txt#L196-L233 + self.cpp_info.requires.extend([ + "xorg::x11", # Also includes Xkb and Xshape + "xorg::xrandr", + "xorg::xinerama", + "xorg::xcursor", + "xorg::xi", + ]) + if self.options.get_safe("with_wayland"): + # https://github.com/glfw/glfw/blob/3.4/src/CMakeLists.txt#L163-L167 + self.cpp_info.requires.extend([ + "wayland::wayland-client", + "wayland::wayland-cursor", + "wayland::wayland-egl", + "xkbcommon::xkbcommon" + ]) - # backward support of cmake_find_package, cmake_find_package_multi & pkg_config generators - self.cpp_info.filenames["cmake_find_package"] = "glfw3" - self.cpp_info.filenames["cmake_find_package_multi"] = "glfw3" - self.cpp_info.names["cmake_find_package"] = "glfw" - self.cpp_info.names["cmake_find_package_multi"] = "glfw" - 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"] = "glfw3" + # Starting with version 3.4, glfw loads the platform libraries at runtime + # and hence does not need to link with them. + self.cpp_info.requires = [] + if Version(self.version) < "3.4": + self.cpp_info.requires.append("opengl::opengl") + if self.options.get_safe("vulkan_static"): + self.cpp_info.requires.append("vulkan-loader::vulkan-loader") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.get_safe("with_x11", True): + self.cpp_info.requires.append("xorg::x11") + if self.options.get_safe("with_wayland"): + self.cpp_info.requires.extend(["wayland::wayland", "xkbcommon::xkbcommon"]) diff --git a/recipes/glfw/all/patches/3.3.2-0001-fix-objc-cmake3.19+.patch b/recipes/glfw/all/patches/3.3.2-0001-fix-objc-cmake3.19+.patch deleted file mode 100644 index 54c1246a85ae3..0000000000000 --- a/recipes/glfw/all/patches/3.3.2-0001-fix-objc-cmake3.19+.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -72,7 +72,7 @@ if (_GLFW_X11 OR _GLFW_WAYLAND) - endif() - endif() - --if (APPLE) -+if ("${CMAKE_VERSION}" VERSION_LESS "3.16" AND APPLE) - # For some reason CMake didn't know about .m until version 3.16 - set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m - cocoa_window.m nsgl_context.m PROPERTIES diff --git a/recipes/glfw/all/patches/3.3.2-0002-macos-relocatable.patch b/recipes/glfw/all/patches/3.3.2-0002-macos-relocatable.patch deleted file mode 100644 index 82f93cbaed918..0000000000000 --- a/recipes/glfw/all/patches/3.3.2-0002-macos-relocatable.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -160,8 +160,6 @@ if (BUILD_SHARED_LIBS) - # Add -fno-common to work around a bug in Apple's GCC - target_compile_options(glfw PRIVATE "-fno-common") - -- set_target_properties(glfw PROPERTIES -- INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}") - endif() - - if (UNIX) 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 deleted file mode 100644 index c2db9f04c4980..0000000000000 --- a/recipes/glfw/all/patches/3.3.2-0003-Wayland-Remove-extra-cmake-modules-dependency.patch +++ /dev/null @@ -1,122 +0,0 @@ -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 deleted file mode 100644 index 9ad41b0f7b967..0000000000000 --- a/recipes/glfw/all/patches/3.3.3-0001-Wayland-Remove-extra-cmake-modules-dependency.patch +++ /dev/null @@ -1,122 +0,0 @@ -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/test_package/CMakeLists.txt b/recipes/glfw/all/test_package/CMakeLists.txt index b6a8569c50ff8..d4fd9128472c1 100644 --- a/recipes/glfw/all/test_package/CMakeLists.txt +++ b/recipes/glfw/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(glfw3 REQUIRED CONFIG) diff --git a/recipes/glfw/all/test_v1_package/CMakeLists.txt b/recipes/glfw/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/glfw/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/glfw/all/test_v1_package/conanfile.py b/recipes/glfw/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/glfw/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_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/glfw/config.yml b/recipes/glfw/config.yml index a0746c2e38c76..4de833422197f 100644 --- a/recipes/glfw/config.yml +++ b/recipes/glfw/config.yml @@ -1,15 +1,7 @@ versions: + "3.4": + folder: all "3.3.8": folder: all "3.3.7": folder: all - "3.3.6": - folder: all - "3.3.5": - folder: all - "3.3.4": - folder: all - "3.3.3": - folder: all - "3.3.2": - folder: all diff --git a/recipes/gli/all/conanfile.py b/recipes/gli/all/conanfile.py index 0cb3644185589..95708d6bbe9df 100644 --- a/recipes/gli/all/conanfile.py +++ b/recipes/gli/all/conanfile.py @@ -38,7 +38,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glm/cci.20230113") + self.requires("glm/1.0.1") def package_id(self): self.info.clear() diff --git a/recipes/gli/all/test_package/CMakeLists.txt b/recipes/gli/all/test_package/CMakeLists.txt index 928ba41028f6b..f800cda6ced76 100644 --- a/recipes/gli/all/test_package/CMakeLists.txt +++ b/recipes/gli/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(gli REQUIRED CONFIG) diff --git a/recipes/glib/all/conandata.yml b/recipes/glib/all/conandata.yml index 826e4f114106f..9723a1277a5c1 100644 --- a/recipes/glib/all/conandata.yml +++ b/recipes/glib/all/conandata.yml @@ -1,39 +1,33 @@ sources: + "2.81.0": + url: "https://download.gnome.org/sources/glib/2.81/glib-2.81.0.tar.xz" + sha256: "1665188ed9cc941c0a189dc6295e6859872523d1bfc84a5a84732a7ae87b02e4" "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.75.3": - url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.3.tar.xz" - sha256: "7c517d0aff456c35a039bce8a8df7a08ce95a8285b09d1849f8865f633f7f871" patches: + "2.81.0": + - patch_file: "patches/dont-use-python-packaging-2.81.0.patch" + patch_type: bugfix + patch_description: replace package.version.Version by internal code + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3352 + "2.78.3": + - patch_file: "patches/remove-distutils-2.77.0.patch" + patch_type: bugfix + patch_description: remove distutils + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4133 "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_file: "patches/remove-distutils.patch" patch_type: bugfix - patch_description: fix libintl discovery - patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3352 + patch_description: remove distutils + patch_source: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4133 diff --git a/recipes/glib/all/conanfile.py b/recipes/glib/all/conanfile.py index 6ccdcc81fb42a..8afcfae16e711 100644 --- a/recipes/glib/all/conanfile.py +++ b/recipes/glib/all/conanfile.py @@ -10,7 +10,7 @@ import shutil -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class GLibConan(ConanFile): @@ -51,9 +51,13 @@ def config_options(self): if self.settings.os != "Linux": del self.options.with_mount del self.options.with_selinux + self.options.with_elf = self.settings.os == "Linux" if is_msvc(self): del self.options.with_elf + if self.settings.os == "Neutrino": + del self.options.with_elf + def configure(self): if self.options.shared: self.options.rm_safe("fPIC") @@ -68,11 +72,11 @@ def requirements(self): self.requires("libffi/3.4.4") self.requires("pcre2/10.42") if self.options.get_safe("with_elf"): - self.requires("libelf/0.8.13") + self.requires("elfutils/0.190") if self.options.get_safe("with_mount"): - self.requires("libmount/2.39") + self.requires("libmount/2.39.2") if self.options.get_safe("with_selinux"): - self.requires("libselinux/3.5") + self.requires("libselinux/3.6") if self.settings.os != "Linux": # for Linux, gettext is provided by libc self.requires("libgettext/0.22", transitive_headers=True, transitive_libs=True) @@ -81,9 +85,9 @@ def requirements(self): self.requires("libiconv/1.17") def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/[>=1.2.3 <2]") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -97,10 +101,16 @@ def generate(self): 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": + if self.settings.os == "FreeBSD" or self.settings.os == "Neutrino": tc.project_options["xattr"] = "false" tc.project_options["tests"] = "false" tc.project_options["libelf"] = "enabled" if self.options.get_safe("with_elf") else "disabled" + + if self.settings.os == "Neutrino": + tc.cross_build["host"]["system"] = "qnx" + tc.c_link_args.append("-lm") + tc.c_link_args.append("-lsocket") + tc.generate() def _patch_sources(self): @@ -110,7 +120,7 @@ def _patch_sources(self): "subdir('fuzzing')", "#subdir('fuzzing')", ) # https://gitlab.gnome.org/GNOME/glib/-/issues/2152 - if self.settings.os != "Linux": + if self.settings.os != "Linux" and self.settings.os != "Neutrino": # allow to find gettext replace_in_file(self, os.path.join(self.source_folder, "meson.build"), @@ -197,6 +207,15 @@ def package_info(self): self.cpp_info.components["gthread-2.0"].system_libs.append("pthread") self.cpp_info.components["gio-2.0"].system_libs.append("dl") + if self.settings.os == "Neutrino": + self.cpp_info.components["gmodule-export-2.0"].sharedlinkflags.append("-Wl,--export-dynamic") + self.cpp_info.components["gmodule-2.0"].sharedlinkflags.append("-Wl,--export-dynamic") + self.cpp_info.components["glib-2.0"].system_libs.append("m") + self.cpp_info.components["glib-2.0"].system_libs.append("socket") + self.cpp_info.components["gmodule-no-export-2.0"].system_libs.append("c") + self.cpp_info.components["gio-2.0"].system_libs.append("c") + self.cpp_info.components["gio-2.0"].system_libs.append("socket") + if self.settings.os == "Windows": self.cpp_info.components["glib-2.0"].system_libs += ["ws2_32", "ole32", "shell32", "user32", "advapi32"] self.cpp_info.components["gio-2.0"].system_libs.extend(["iphlpapi", "dnsapi", "shlwapi"]) @@ -230,7 +249,7 @@ def package_info(self): self.cpp_info.components["gio-2.0"].requires.append("libselinux::libselinux") if self.options.get_safe("with_elf"): - self.cpp_info.components["gresource"].requires.append("libelf::libelf") # this is actually an executable + self.cpp_info.components["gresource"].requires.append("elfutils::libelf") # this is actually an executable self.env_info.GLIB_COMPILE_SCHEMAS = os.path.join(self.package_folder, "bin", "glib-compile-schemas") self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch b/recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch new file mode 100644 index 0000000000000..a97c9a79ae133 --- /dev/null +++ b/recipes/glib/all/patches/dont-use-python-packaging-2.81.0.patch @@ -0,0 +1,148 @@ +diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in +index 9c409e6..1913b6d 100755 +--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in ++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#!/usr/bin/env @PYTHON@ + + # GDBus - GLib D-Bus Library + # +diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build +index 67ea9f2..2ee1fc8 100644 +--- a/gio/gdbus-2.0/codegen/meson.build ++++ b/gio/gdbus-2.0/codegen/meson.build +@@ -31,7 +31,7 @@ gdbus_codegen_conf = configuration_data() + gdbus_codegen_conf.set('VERSION', glib_version) + gdbus_codegen_conf.set('MAJOR_VERSION', major_version) + gdbus_codegen_conf.set('MINOR_VERSION', minor_version) +-gdbus_codegen_conf.set('PYTHON', python.full_path()) ++gdbus_codegen_conf.set('PYTHON', python_name) + gdbus_codegen_conf.set('DATADIR', glib_datadir) + + # Install gdbus-codegen executable +diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py +index 6399945..86024d7 100644 +--- a/gio/gdbus-2.0/codegen/utils.py ++++ b/gio/gdbus-2.0/codegen/utils.py +@@ -21,10 +21,9 @@ + # + # Author: David Zeuthen + +-import packaging.version + import os + import sys +- ++import re + + # pylint: disable=too-few-public-methods + class Color: +@@ -161,11 +160,35 @@ def lookup_brief_docs(annotations): + def version_cmp_key(key): + # If the 'since' version is 'UNRELEASED', compare higher than anything else + # If it is empty put a 0 in its place as this will +- # allow LooseVersion to work and will always compare lower. ++ # allow _parse_version() to work and will always compare lower. + if key[0] == "UNRELEASED": + v = "9999" + elif key[0]: + v = str(key[0]) + else: + v = "0" +- return (packaging.version.Version(v), key[1]) ++ return (_parse_version(v), key[1]) ++ ++ ++def _parse_version(version): ++ """ ++ Parse a version string into a list of integers and strings. ++ ++ This function takes a version string and breaks it down into its component parts. ++ It separates numeric and non-numeric segments, converting numeric segments to integers. ++ ++ Args: ++ version (str): The version string to parse. ++ ++ Returns: ++ list: A list where each element is either an integer (for numeric parts) ++ or a string (for non-numeric parts). ++ ++ Example: ++ >>> parseversion("1.2.3a") ++ [1, 2, 3, 'a'] ++ >>> parseversion("2.0.0-rc1") ++ [2, 0, 0, 'rc1'] ++ """ ++ blocks = re.findall(r"(\d+|\w+)", version) ++ return [int(b) if b.isdigit() else b for b in blocks] +diff --git a/glib/gtester-report.in b/glib/gtester-report.in +index 0745d53..b8291d2 100644 +--- a/glib/gtester-report.in ++++ b/glib/gtester-report.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#! /usr/bin/env @PYTHON@ + # GLib Testing Framework Utility -*- Mode: python; -*- + # Copyright (C) 2007 Imendio AB + # Authors: Tim Janik +diff --git a/glib/meson.build b/glib/meson.build +index b2dd569..5c29bb7 100644 +--- a/glib/meson.build ++++ b/glib/meson.build +@@ -502,7 +502,7 @@ endif + + report_conf = configuration_data() + report_conf.set('GLIB_VERSION', glib_version) +-report_conf.set('PYTHON', python.full_path()) ++report_conf.set('PYTHON', python_name) + configure_file( + input: 'gtester-report.in', + output: 'gtester-report', +diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in +index 0578b74..aa5af43 100755 +--- a/gobject/glib-genmarshal.in ++++ b/gobject/glib-genmarshal.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#!/usr/bin/env @PYTHON@ + + # pylint: disable=too-many-lines, missing-docstring, invalid-name + +diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in +index 7e794e9..e10b910 100755 +--- a/gobject/glib-mkenums.in ++++ b/gobject/glib-mkenums.in +@@ -1,4 +1,4 @@ +-#!@PYTHON@ ++#!/usr/bin/env @PYTHON@ + + # If the code below looks horrible and unpythonic, do not panic. + # +diff --git a/gobject/meson.build b/gobject/meson.build +index 78b732b..2129aaf 100644 +--- a/gobject/meson.build ++++ b/gobject/meson.build +@@ -87,7 +87,7 @@ python_tools = [ + + python_tools_conf = configuration_data() + python_tools_conf.set('VERSION', glib_version) +-python_tools_conf.set('PYTHON', python.full_path()) ++python_tools_conf.set('PYTHON', python_name) + + foreach tool: python_tools + tool_bin = configure_file( +diff --git a/meson.build b/meson.build +index bcc2887..6cca73d 100644 +--- a/meson.build ++++ b/meson.build +@@ -2457,7 +2457,9 @@ endif + + glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) + +-python = import('python').find_installation(modules: ['packaging']) ++python = import('python').find_installation() ++# used for '#!/usr/bin/env ' ++python_name = 'python3' + + python_version = python.language_version() + python_version_req = '>=3.7' diff --git a/recipes/glib/all/patches/libintl-discovery-2.75.3.patch b/recipes/glib/all/patches/libintl-discovery-2.75.3.patch deleted file mode 100644 index 0df94096d0615..0000000000000 --- a/recipes/glib/all/patches/libintl-discovery-2.75.3.patch +++ /dev/null @@ -1,49 +0,0 @@ -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/remove-distutils-2.77.0.patch b/recipes/glib/all/patches/remove-distutils-2.77.0.patch new file mode 100644 index 0000000000000..ba054b959ca4f --- /dev/null +++ b/recipes/glib/all/patches/remove-distutils-2.77.0.patch @@ -0,0 +1,51 @@ +diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py +index 0204610..f8d758c 100644 +--- a/gio/gdbus-2.0/codegen/utils.py ++++ b/gio/gdbus-2.0/codegen/utils.py +@@ -19,7 +19,7 @@ + # + # Author: David Zeuthen + +-import distutils.version ++import re + import os + import sys + +@@ -159,11 +159,35 @@ def lookup_brief_docs(annotations): + def version_cmp_key(key): + # If the 'since' version is 'UNRELEASED', compare higher than anything else + # If it is empty put a 0 in its place as this will +- # allow LooseVersion to work and will always compare lower. ++ # allow _parse_version() to work and will always compare lower. + if key[0] == "UNRELEASED": + v = "9999" + elif key[0]: + v = str(key[0]) + else: + v = "0" +- return (distutils.version.LooseVersion(v), key[1]) ++ return (_parse_version(v), key[1]) ++ ++ ++def _parse_version(version): ++ """ ++ Parse a version string into a list of integers and strings. ++ ++ This function takes a version string and breaks it down into its component parts. ++ It separates numeric and non-numeric segments, converting numeric segments to integers. ++ ++ Args: ++ version (str): The version string to parse. ++ ++ Returns: ++ list: A list where each element is either an integer (for numeric parts) ++ or a string (for non-numeric parts). ++ ++ Example: ++ >>> parseversion("1.2.3a") ++ [1, 2, 3, 'a'] ++ >>> parseversion("2.0.0-rc1") ++ [2, 0, 0, 'rc1'] ++ """ ++ blocks = re.findall(r"(\d+|\w+)", version) ++ return [int(b) if b.isdigit() else b for b in blocks] diff --git a/recipes/glib/all/patches/remove-distutils.patch b/recipes/glib/all/patches/remove-distutils.patch new file mode 100644 index 0000000000000..3096261030b0d --- /dev/null +++ b/recipes/glib/all/patches/remove-distutils.patch @@ -0,0 +1,51 @@ +diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py +index 95559d3..2b7a176 100644 +--- a/gio/gdbus-2.0/codegen/utils.py ++++ b/gio/gdbus-2.0/codegen/utils.py +@@ -19,7 +19,7 @@ + # + # Author: David Zeuthen + +-import distutils.version ++import re + import os + import sys + +@@ -155,11 +155,35 @@ def lookup_brief_docs(annotations): + def version_cmp_key(key): + # If the 'since' version is 'UNRELEASED', compare higher than anything else + # If it is empty put a 0 in its place as this will +- # allow LooseVersion to work and will always compare lower. ++ # allow _parse_version() to work and will always compare lower. + if key[0] == "UNRELEASED": + v = "9999" + elif key[0]: + v = str(key[0]) + else: + v = "0" +- return (distutils.version.LooseVersion(v), key[1]) ++ return (_parse_version(v), key[1]) ++ ++ ++def _parse_version(version): ++ """ ++ Parse a version string into a list of integers and strings. ++ ++ This function takes a version string and breaks it down into its component parts. ++ It separates numeric and non-numeric segments, converting numeric segments to integers. ++ ++ Args: ++ version (str): The version string to parse. ++ ++ Returns: ++ list: A list where each element is either an integer (for numeric parts) ++ or a string (for non-numeric parts). ++ ++ Example: ++ >>> parseversion("1.2.3a") ++ [1, 2, 3, 'a'] ++ >>> parseversion("2.0.0-rc1") ++ [2, 0, 0, 'rc1'] ++ """ ++ blocks = re.findall(r"(\d+|\w+)", version) ++ return [int(b) if b.isdigit() else b for b in blocks] diff --git a/recipes/glib/all/test_package/CMakeLists.txt b/recipes/glib/all/test_package/CMakeLists.txt index 44f2423e0f831..c2e2b58b04658 100644 --- a/recipes/glib/all/test_package/CMakeLists.txt +++ b/recipes/glib/all/test_package/CMakeLists.txt @@ -1,17 +1,7 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -add_executable(${PROJECT_NAME} test_package.c) +find_package(glib CONFIG REQUIRED) -if (CMAKE_SYSTEM_NAME STREQUAL "Windows") - find_package(glib CONFIG REQUIRED) - target_link_libraries(${PROJECT_NAME} PRIVATE glib::glib-2.0 glib::gio-2.0 glib::gmodule-2.0 glib::gobject-2.0 glib::gthread-2.0) -else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(glib-2.0 REQUIRED IMPORTED_TARGET glib-2.0) - pkg_check_modules(gio-2.0 REQUIRED IMPORTED_TARGET gio-2.0) - pkg_check_modules(gmodule-2.0 REQUIRED IMPORTED_TARGET gmodule-2.0) - pkg_check_modules(gobject-2.0 REQUIRED IMPORTED_TARGET gobject-2.0) - pkg_check_modules(gthread-2.0 REQUIRED IMPORTED_TARGET gthread-2.0) - target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::glib-2.0 PkgConfig::gio-2.0 PkgConfig::gmodule-2.0 PkgConfig::gobject-2.0 PkgConfig::gthread-2.0) -endif() +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE glib::glib-2.0 glib::gio-2.0 glib::gmodule-2.0 glib::gobject-2.0 glib::gthread-2.0) diff --git a/recipes/glib/all/test_package/conanfile.py b/recipes/glib/all/test_package/conanfile.py index 168cdc2e86991..686967e0621b8 100644 --- a/recipes/glib/all/test_package/conanfile.py +++ b/recipes/glib/all/test_package/conanfile.py @@ -1,47 +1,19 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain -from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv -from conan.tools.gnu import PkgConfig, PkgConfigDeps +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_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/2.0.3") - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() - virtual_run_env = VirtualRunEnv(self) - virtual_run_env.generate() - - if self.settings.os == "Macos": - env = Environment() - # Avoid conflicts with system libiconv - # see: https://github.com/conan-io/conan-center-index/pull/17610#issuecomment-1552921286 - env.define_path("DYLD_FALLBACK_LIBRARY_PATH", "$DYLD_LIBRARY_PATH") - env.define_path("DYLD_LIBRARY_PATH", "") - env.vars(self, scope="run").save_script("conanrun_macos_runtimepath") - - if self.settings.os == "Windows": - deps = CMakeDeps(self) - deps.generate() - else: - virtual_build_env = VirtualBuildEnv(self) - virtual_build_env.generate() - pkg_config_deps = PkgConfigDeps(self) - pkg_config_deps.generate() + self.requires(self.tested_reference_str, run=True) def build(self): cmake = CMake(self) @@ -52,8 +24,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") - if self.settings.os != "Windows": - pkg_config = PkgConfig(self, "gio-2.0", pkg_config_path=self.generators_folder) - gdbus_codegen = pkg_config.variables["gdbus_codegen"] - self.run(f"{gdbus_codegen} -h", env="conanrun") + self.run("gdbus-codegen -h", env="conanrun") diff --git a/recipes/glib/all/test_v1_package/CMakeLists.txt b/recipes/glib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/glib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/glib/all/test_v1_package/conanfile.py b/recipes/glib/all/test_v1_package/conanfile.py deleted file mode 100644 index 3247118701674..0000000000000 --- a/recipes/glib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +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", "pkg_config" - - def build_requirements(self): - if self.settings.os != "Windows": - self.tool_requires("pkgconf/2.0.3") - - def build(self): - if self.settings.os != "Windows": - with tools.environment_append({'PKG_CONFIG_PATH': "."}): - pkg_config = tools.PkgConfig("gio-2.0") - self.run(f"{pkg_config.variables['gdbus_codegen']} -h", run_environment=True) - - with tools.environment_append({'PKG_CONFIG_PATH': "."}): - 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/glib/config.yml b/recipes/glib/config.yml index f0bd1289c0ca6..178cce999a640 100644 --- a/recipes/glib/config.yml +++ b/recipes/glib/config.yml @@ -1,19 +1,9 @@ versions: - "2.78.3": - folder: all - "2.78.1": + "2.81.0": folder: all - "2.78.0": + "2.78.3": folder: all "2.77.3": folder: all - "2.77.2": - folder: all - "2.77.1": - folder: all - "2.77.0": - folder: all "2.76.3": folder: all - "2.75.3": - folder: all diff --git a/recipes/glibmm/all/conandata.yml b/recipes/glibmm/all/conandata.yml index 171a01a50da60..830679f3678f2 100644 --- a/recipes/glibmm/all/conandata.yml +++ b/recipes/glibmm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.78.1": + url: "https://download.gnome.org/sources/glibmm/2.78/glibmm-2.78.1.tar.xz" + sha256: "f473f2975d26c3409e112ed11ed36406fb3843fa975df575c22d4cb843085f61" "2.75.0": url: "https://download.gnome.org/sources/glibmm/2.75/glibmm-2.75.0.tar.xz" sha256: "60bb12e66488aa8ce41f0eb2f3612f89f5ddc887e3e4d45498524bf60b266b3d" @@ -8,26 +11,3 @@ sources: "2.66.4": url: "https://download.gnome.org/sources/glibmm/2.66/glibmm-2.66.4.tar.xz" sha256: "199ace5682d81b15a1d565480b4a950682f2db6402c8aa5dd7217d71edff81d5" - -patches: - "2.75.0": - - patch_file: "patches/enable_static_libs_2_75_0.patch" - patch_type: portability - patch_description: enable static library build for msvc - - patch_file: "patches/fix_initialization_order_fiasco_2_75_0.patch" - patch_type: bugfix - patch_description: fix initialization order for static library - "2.72.1": - - patch_file: "patches/enable_static_libs_2_72_1.patch" - patch_type: portability - patch_description: enable static library build for msvc - - patch_file: "patches/fix_initialization_order_fiasco_2_72_1.patch" - patch_type: bugfix - patch_description: fix initialization order for static library - "2.66.4": - - patch_file: "patches/enable_static_libs_2_66_4.patch" - patch_type: portability - patch_description: enable static library build for msvc - - patch_file: "patches/fix_initialization_order_fiasco_2_66_4.patch" - patch_type: bugfix - patch_description: fix initialization order for static library diff --git a/recipes/glibmm/all/conanfile.py b/recipes/glibmm/all/conanfile.py index a6d3f4c904bd4..d36d4666df42d 100644 --- a/recipes/glibmm/all/conanfile.py +++ b/recipes/glibmm/all/conanfile.py @@ -1,22 +1,13 @@ -import os import glob +import os import shutil -from conan import ConanFile, conan_version +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, - rename, - rm, - rmdir -) +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 @@ -33,16 +24,8 @@ class GlibmmConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "glibmm is a C++ API for parts of glib that are useful for C++." topics = ("giomm",) - package_type = "library" + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - } short_paths = True @property @@ -57,25 +40,14 @@ def _glibmm_lib(self): def _giomm_lib(self): return f"giomm-{self._abi_version}" - def export_sources(self): - export_conandata_patches(self) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - if self.options.shared: - wildcard = "" if Version(conan_version) < "2.0.0" else "/*" - self.options[f"glib{wildcard}"].shared = True + self.options["glib"].shared = True def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.78.0", transitive_headers=True) + self.requires("glib/2.78.3", transitive_headers=True) if self._abi_version == "2.68": self.requires("libsigcpp/3.0.7", transitive_headers=True) else: @@ -83,12 +55,12 @@ def requirements(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - if self._abi_version == "2.68": + if Version(self._abi_version) >= "2.68": check_min_cppstd(self, 17) else: check_min_cppstd(self, 11) - if self.options.shared and not self.dependencies["glib"].options.shared: + if not self.dependencies["glib"].options.shared: raise ConanInvalidConfiguration( "Linking a shared library against static glib can cause unexpected behaviour." ) @@ -97,9 +69,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.2.2") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -120,22 +92,9 @@ def generate(self): tc.generate() def _patch_sources(self): - apply_conandata_patches(self) meson_build = os.path.join(self.source_folder, "meson.build") replace_in_file(self, meson_build, "subdir('tests')", "") if is_msvc(self): - # GLiBMM_GEN_EXTRA_DEFS_STATIC is not defined anywhere and is not - # used anywhere except here - # when building a static build !defined(GLiBMM_GEN_EXTRA_DEFS_STATIC) - # evaluates to 0 - if not self.options.shared: - replace_in_file(self, - os.path.join(self.source_folder, "tools", - "extra_defs_gen", "generate_extra_defs.h"), - "#if defined (_MSC_VER) && !defined (GLIBMM_GEN_EXTRA_DEFS_STATIC)", - "#if 0", - ) - # 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 Windows SDK is not standard @@ -150,15 +109,6 @@ def build(self): meson.build() def package(self): - def rename_msvc_static_libs(): - lib_folder = os.path.join(self.package_folder, "lib") - rename(self, os.path.join(lib_folder, f"libglibmm-{self._abi_version}.a"), - os.path.join(lib_folder, f"{self._glibmm_lib}.lib")) - rename(self, os.path.join(lib_folder, f"libgiomm-{self._abi_version}.a"), - os.path.join(lib_folder, f"{self._giomm_lib}.lib")) - rename(self, os.path.join(lib_folder, f"libglibmm_generate_extra_defs-{self._abi_version}.a"), - os.path.join(lib_folder, f"glibmm_generate_extra_defs-{self._abi_version}.lib")) - meson = Meson(self) meson.install() @@ -166,8 +116,6 @@ def rename_msvc_static_libs(): if is_msvc(self): rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - if not self.options.shared: - rename_msvc_static_libs() for directory in [self._glibmm_lib, self._giomm_lib]: directory_path = os.path.join(self.package_folder, "lib", directory, "include", "*.h") diff --git a/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch b/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch deleted file mode 100644 index c94b5200949f7..0000000000000 --- a/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson -index e50dcccf..19e64a46 100644 ---- a/glib/glibmmconfig.h.meson -+++ b/glib/glibmmconfig.h.meson -@@ -47,7 +47,9 @@ - # if defined(_MSC_VER) - # define GLIBMM_MSC 1 - # define GLIBMM_WIN32 1 --# define GLIBMM_DLL 1 -+# ifndef GLIBMM_STATIC_LIB -+# define GLIBMM_DLL 1 -+# endif - # elif defined(__CYGWIN__) - # define GLIBMM_CONFIGURE 1 - # elif defined(__MINGW32__) -diff --git a/glib/meson.build b/glib/meson.build -index 4feee0fd..9382645a 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -36,12 +36,6 @@ pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) - - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - if library_build_type == 'static' - pkg_conf_data.set('GLIBMM_STATIC_LIB', 1) - pkg_conf_data.set('GIOMM_STATIC_LIB', 1) diff --git a/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch b/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch deleted file mode 100644 index b9ec412d84d2e..0000000000000 --- a/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson -index ef4753d..58b343c 100644 ---- a/glib/glibmmconfig.h.meson -+++ b/glib/glibmmconfig.h.meson -@@ -27,7 +27,9 @@ - # if defined(_MSC_VER) - # define GLIBMM_MSC 1 - # define GLIBMM_WIN32 1 --# define GLIBMM_DLL 1 -+# ifndef GLIBMM_STATIC_LIB -+# define GLIBMM_DLL 1 -+# endif - # elif defined(__CYGWIN__) - # define GLIBMM_CONFIGURE 1 - # elif defined(__MINGW32__) -diff --git a/glib/meson.build b/glib/meson.build -index 0c20a91..6b8baa0 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -36,12 +36,6 @@ pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) - - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - if library_build_type == 'static' - pkg_conf_data.set('GLIBMM_STATIC_LIB', 1) - pkg_conf_data.set('GIOMM_STATIC_LIB', 1) diff --git a/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch b/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch deleted file mode 100644 index f24c64bb5bd54..0000000000000 --- a/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson -index ef4753d7..b926720b 100644 ---- a/glib/glibmmconfig.h.meson -+++ b/glib/glibmmconfig.h.meson -@@ -27,7 +27,9 @@ - # if defined(_MSC_VER) - # define GLIBMM_MSC 1 - # define GLIBMM_WIN32 1 --# define GLIBMM_DLL 1 -+# ifndef GLIBMM_STATIC_LIB -+# define GLIBMM_DLL 1 -+# endif - # elif defined(__CYGWIN__) - # define GLIBMM_CONFIGURE 1 - # elif defined(__MINGW32__) -diff --git a/glib/meson.build b/glib/meson.build -index d16621e9..3eb8bc47 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -37,12 +37,6 @@ pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) - - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - if library_build_type == 'static' - pkg_conf_data.set('GLIBMM_STATIC_LIB', 1) - pkg_conf_data.set('GIOMM_STATIC_LIB', 1) diff --git a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch deleted file mode 100644 index 3cf9f867ed1f0..0000000000000 --- a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch +++ /dev/null @@ -1,163 +0,0 @@ -Author: Hesham -Date: Fri May 6 20:02:25 2022 +0000 - - Fix initialization order fiasco - - By default global static initialization with shared libraries begins down - the linking chain upwards, so that the deepest dependency initializes first - This is not guaranteed with static libraries, which might cause glibmm to - initialize before glib. This fix uses lazy initialization for static vars - in glibmm that depend on glib. - -diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc -index 057abed..e51d01b 100644 ---- a/glib/glibmm/class.cc -+++ b/glib/glibmm/class.cc -@@ -170,7 +170,11 @@ Class::clone_custom_type( - } - - // Initialize the static quark to store/get custom type properties. -+#if GLIB_STATIC_COMPILATION -+GQuark Class::iface_properties_quark = 0; -+#else - GQuark Class::iface_properties_quark = g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif - - // static - void -diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc -index ab96892..267a6c0 100644 ---- a/glib/glibmm/init.cc -+++ b/glib/glibmm/init.cc -@@ -14,15 +14,25 @@ - * License along with this library. If not, see . - */ - -+#include - #include - #include - -+#if GLIB_STATIC_COMPILATION -+#include -+#endif -+ - namespace Glib - { - - void - init() - { -+#if GLIB_STATIC_COMPILATION -+ Glib::Class::iface_properties_quark = -+ g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif -+ - // Also calls Glib::wrap_register_init() and Glib::wrap_init(). - Glib::Error::register_init(); - } -diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc -index a2624e5..d9f1095 100644 ---- a/glib/glibmm/property.cc -+++ b/glib/glibmm/property.cc -@@ -89,8 +89,10 @@ struct custom_properties_type - }; - - // The quark used for storing/getting the custom properties of custom types. --static const GQuark custom_properties_quark = -- g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+static const GQuark& custom_properties_quark() { -+ static const GQuark custom_properties_quark_ = g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+ return custom_properties_quark_; -+} - - // Delete the custom properties data when an object of a custom type is finalized. - void destroy_notify_obj_custom_props(void* data) -@@ -111,12 +113,12 @@ custom_properties_type* - get_obj_custom_props(GObject* obj) - { - auto obj_custom_props = -- static_cast(g_object_get_qdata(obj, custom_properties_quark)); -+ static_cast(g_object_get_qdata(obj, custom_properties_quark())); - if (!obj_custom_props) - { - obj_custom_props = new custom_properties_type(); - g_object_set_qdata_full( -- obj, custom_properties_quark, obj_custom_props, destroy_notify_obj_custom_props); -+ obj, custom_properties_quark(), obj_custom_props, destroy_notify_obj_custom_props); - } - return obj_custom_props; - } -diff --git a/untracked/gio/giomm/application.cc b/untracked/gio/giomm/application.cc -index 43ae9df..0d12c9d 100644 ---- a/untracked/gio/giomm/application.cc -+++ b/untracked/gio/giomm/application.cc -@@ -51,8 +51,13 @@ struct ExtraApplicationData - } - }; - --GQuark quark_extra_application_data = -- g_quark_from_string("glibmm__Gio::Application::quark_extra_application_data"); -+static GQuark& -+quark_extra_application_data() -+{ -+ static GQuark quark_extra_application_data_ = -+ g_quark_from_string("glibmm__Gio::Application::quark_extra_application_data"); -+ return quark_extra_application_data_; -+} - - void - Application_delete_extra_application_data(gpointer data) -@@ -465,11 +470,11 @@ Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustring& - gchar* arg_desc = arg_description.empty() ? nullptr : g_strdup(arg_description.c_str()); - - ExtraApplicationData* extra_application_data = -- static_cast(g_object_get_qdata(gobject_, quark_extra_application_data)); -+ static_cast(g_object_get_qdata(gobject_, quark_extra_application_data())); - if (!extra_application_data) - { - extra_application_data = new ExtraApplicationData(); -- g_object_set_qdata_full(gobject_, quark_extra_application_data, extra_application_data, -+ g_object_set_qdata_full(gobject_, quark_extra_application_data(), extra_application_data, - Application_delete_extra_application_data); - } - -@@ -1546,5 +1551,3 @@ void Gio::Application::run_mainloop_vfunc() - - - } // namespace Gio -- -- -diff --git a/untracked/glib/glibmm/binding.cc b/untracked/glib/glibmm/binding.cc -index d0d4f47..0528893 100644 ---- a/untracked/glib/glibmm/binding.cc -+++ b/untracked/glib/glibmm/binding.cc -@@ -29,7 +29,10 @@ - namespace - { - // TODO: When we can break ABI, replace this GQuark by a new data member in Glib::Binding. --GQuark quark_manage = g_quark_from_string("glibmm__Glib::Binding::manage"); -+GQuark& quark_manage() { -+ static GQuark quark_manage_ = g_quark_from_string("glibmm__Glib::Binding::manage"); -+ return quark_manage_; -+} - - struct BindingTransformSlots - { -@@ -150,7 +153,7 @@ Binding::unbind() - void - Binding::unreference() const - { -- if (!g_object_get_qdata(gobject_, quark_manage)) -+ if (!g_object_get_qdata(gobject_, quark_manage())) - { - GBinding* const binding = const_cast(gobj()); - -@@ -168,7 +171,7 @@ void - Binding::set_manage() - { - // Any pointer can be set, just not nullptr. -- g_object_set_qdata(gobject_, quark_manage, this); -+ g_object_set_qdata(gobject_, quark_manage(), this); - } - - const Glib::RefPtr& diff --git a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch deleted file mode 100644 index e2f8e705abbe0..0000000000000 --- a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch +++ /dev/null @@ -1,95 +0,0 @@ -Author: Hesham -Date: Fri May 6 19:37:32 2022 +0000 - - Fix initialization order fiasco - - By default global static initialization with shared libraries begins down - the linking chain upwards, so that the deepest dependency initializes first - This is not guaranteed with static libraries, which might cause glibmm to - initialize before glib. This fix uses lazy initialization for static vars - in glibmm that depend on glib. - -diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc -index 36c3c4b..f735129 100644 ---- a/glib/glibmm/class.cc -+++ b/glib/glibmm/class.cc -@@ -157,7 +157,11 @@ Class::clone_custom_type( - } - - // Initialize the static quark to store/get custom type properties. -+#if GLIB_STATIC_COMPILATION -+GQuark Class::iface_properties_quark = 0; -+#else - GQuark Class::iface_properties_quark = g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif - - // static - void -diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc -index 0b34447..6b70a4c 100644 ---- a/glib/glibmm/init.cc -+++ b/glib/glibmm/init.cc -@@ -14,12 +14,17 @@ - * License along with this library. If not, see . - */ - -+#include - #include - #include - #include - #include - #include - -+#if GLIB_STATIC_COMPILATION -+#include -+#endif -+ - namespace - { - bool init_to_users_preferred_locale = true; -@@ -45,6 +50,11 @@ void init() - if (is_initialized) - return; - -+#if GLIB_STATIC_COMPILATION -+ Glib::Class::iface_properties_quark = -+ g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif -+ - if (init_to_users_preferred_locale) - { - try -diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc -index 56dad84..630b35b 100644 ---- a/glib/glibmm/property.cc -+++ b/glib/glibmm/property.cc -@@ -89,8 +89,12 @@ struct custom_properties_type - }; - - // The quark used for storing/getting the custom properties of custom types. --static const GQuark custom_properties_quark = -- g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+static const GQuark& -+custom_properties_quark() -+{ -+ static GQuark custom_properties_quark_ = g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+ return custom_properties_quark_; -+} - - // Delete the custom properties data when an object of a custom type is finalized. - void destroy_notify_obj_custom_props(void* data) -@@ -111,12 +115,12 @@ custom_properties_type* - get_obj_custom_props(GObject* obj) - { - auto obj_custom_props = -- static_cast(g_object_get_qdata(obj, custom_properties_quark)); -+ static_cast(g_object_get_qdata(obj, custom_properties_quark())); - if (!obj_custom_props) - { - obj_custom_props = new custom_properties_type(); - g_object_set_qdata_full( -- obj, custom_properties_quark, obj_custom_props, destroy_notify_obj_custom_props); -+ obj, custom_properties_quark(), obj_custom_props, destroy_notify_obj_custom_props); - } - return obj_custom_props; - } diff --git a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch deleted file mode 100644 index 6a24ae04d3038..0000000000000 --- a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc -index 31f92c61..f5befb2d 100644 ---- a/glib/glibmm/class.cc -+++ b/glib/glibmm/class.cc -@@ -166,7 +166,11 @@ Class::clone_custom_type( - } - - // Initialize the static quark to store/get custom type properties. -+#if GLIB_STATIC_COMPILATION -+GQuark Class::iface_properties_quark = 0; -+#else - GQuark Class::iface_properties_quark = g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif - - // static - void -diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc -index 0b34447d..6b70a4c2 100644 ---- a/glib/glibmm/init.cc -+++ b/glib/glibmm/init.cc -@@ -14,12 +14,17 @@ - * License along with this library. If not, see . - */ - -+#include - #include - #include - #include - #include - #include - -+#if GLIB_STATIC_COMPILATION -+#include -+#endif -+ - namespace - { - bool init_to_users_preferred_locale = true; -@@ -45,6 +50,11 @@ void init() - if (is_initialized) - return; - -+#if GLIB_STATIC_COMPILATION -+ Glib::Class::iface_properties_quark = -+ g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif -+ - if (init_to_users_preferred_locale) - { - try -diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc -index 56dad849..630b35b1 100644 ---- a/glib/glibmm/property.cc -+++ b/glib/glibmm/property.cc -@@ -89,8 +89,12 @@ struct custom_properties_type - }; - - // The quark used for storing/getting the custom properties of custom types. --static const GQuark custom_properties_quark = -- g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+static const GQuark& -+custom_properties_quark() -+{ -+ static GQuark custom_properties_quark_ = g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+ return custom_properties_quark_; -+} - - // Delete the custom properties data when an object of a custom type is finalized. - void destroy_notify_obj_custom_props(void* data) -@@ -111,12 +115,12 @@ custom_properties_type* - get_obj_custom_props(GObject* obj) - { - auto obj_custom_props = -- static_cast(g_object_get_qdata(obj, custom_properties_quark)); -+ static_cast(g_object_get_qdata(obj, custom_properties_quark())); - if (!obj_custom_props) - { - obj_custom_props = new custom_properties_type(); - g_object_set_qdata_full( -- obj, custom_properties_quark, obj_custom_props, destroy_notify_obj_custom_props); -+ obj, custom_properties_quark(), obj_custom_props, destroy_notify_obj_custom_props); - } - return obj_custom_props; - } diff --git a/recipes/glibmm/all/test_v1_package/CMakeLists.txt b/recipes/glibmm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/glibmm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/glibmm/all/test_v1_package/conanfile.py b/recipes/glibmm/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/glibmm/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_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/glibmm/config.yml b/recipes/glibmm/config.yml index 6aaa4e9d859bb..c3ca69bc81afd 100644 --- a/recipes/glibmm/config.yml +++ b/recipes/glibmm/config.yml @@ -1,4 +1,6 @@ versions: + "2.78.1": + folder: "all" "2.75.0": folder: "all" "2.72.1": diff --git a/recipes/glm/all/conandata.yml b/recipes/glm/all/conandata.yml index ea5c8f567b661..f0837f7018575 100644 --- a/recipes/glm/all/conandata.yml +++ b/recipes/glm/all/conandata.yml @@ -1,22 +1,7 @@ sources: - "cci.20230113": - url: "https://github.com/g-truc/glm/archive/efec5db081e3aad807d0731e172ac597f6a39447.zip" - sha256: "e7a1abc208278cc3f0dba59c5170d83863b3375f98136d588b8beb74825e503c" - "cci.20220420": - url: "https://github.com/g-truc/glm/archive/cc98465e3508535ba8c7f6208df934c156a018dc.zip" - sha256: "06d48e336857777d2d1f7da9ccd59e4b9d79720dbd70886d48837d19cda997bb" + "1.0.1": + url: "https://github.com/g-truc/glm/releases/download/1.0.1/glm-1.0.1-light.zip" + sha256: "9A995DE4DA09723BD33EF194E6B79818950E5A8F2E154792F02E4615277CFB8D" "0.9.9.8": url: "https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip" sha256: "37e2a3d62ea3322e43593c34bae29f57e3e251ea89f4067506c94043769ade4c" - "0.9.9.7": - url: "https://github.com/g-truc/glm/releases/download/0.9.9.7/glm-0.9.9.7.zip" - sha256: "6b79c3d06d9745d1cce3f38c0c15666596f9aefff25ddb74df3af0a02f011ee1" - "0.9.9.6": - url: "https://github.com/g-truc/glm/releases/download/0.9.9.6/glm-0.9.9.6.zip" - sha256: "9db7339c3b8766184419cfe7942d668fecabe9013ccfec8136b39e11718817d0" - "0.9.9.5": - url: "https://github.com/g-truc/glm/releases/download/0.9.9.5/glm-0.9.9.5.zip" - sha256: "4fe34860ce69156f63eea6c3d84c91cadfc330353cf275ff394aef4e163cafee" - "0.9.5.4": - url: "https://github.com/g-truc/glm/releases/download/0.9.5.4/glm-0.9.5.4.zip" - sha256: "c25002f109104bb8eb37a7e74c745cbc0a713ec5d9a857050c7878edb5ee246c" diff --git a/recipes/glm/all/conanfile.py b/recipes/glm/all/conanfile.py index 468e10f82d8df..71d8ed1fa37de 100644 --- a/recipes/glm/all/conanfile.py +++ b/recipes/glm/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import copy, get, load, save +from conan.tools.files import copy, get from conan.tools.layout import basic_layout from conan.tools.scm import Version import os @@ -25,33 +25,20 @@ def package_id(self): self.info.clear() def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=self.version < Version("1.0.0")) def build(self): pass def package(self): - glm_version = self.version if self.version.startswith("cci") else Version(self._get_semver()) - if glm_version == "0.9.8" or (glm_version == "0.9.9" and self._get_tweak_number() < 6): - save(self, os.path.join(self.package_folder, "licenses", "copying.txt"), self._get_license()) - else: + if self.version < Version("1.0.0"): copy(self, "copying.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - for headers in ("*.hpp", "*.inl", "*.h"): + else: + copy(self, "copying.txt", src=os.path.join(self.source_folder, "glm"), dst=os.path.join(self.package_folder, "licenses")) + for headers in ("*.hpp", "*.inl", "*.h", "*.cppm"): copy(self, headers, src=os.path.join(self.source_folder, "glm"), dst=os.path.join(self.package_folder, "include", "glm")) - def _get_semver(self): - return self.version.rsplit(".", 1)[0] - - def _get_tweak_number(self): - return int(self.version.rsplit(".", 1)[-1]) - - def _get_license(self): - manual = load(self, os.path.join(self.source_folder, "manual.md")) - begin = manual.find("### The Happy Bunny License (Modified MIT License)") - end = manual.find("\n![](./doc/manual/frontpage2.png)", begin) - return manual[begin:end] - def package_info(self): self.cpp_info.set_property("cmake_file_name", "glm") self.cpp_info.set_property("cmake_target_name", "glm::glm") diff --git a/recipes/glm/all/test_package/CMakeLists.txt b/recipes/glm/all/test_package/CMakeLists.txt index a15bbd78f6de4..5de03002d5c8a 100644 --- a/recipes/glm/all/test_package/CMakeLists.txt +++ b/recipes/glm/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(glm REQUIRED CONFIG) diff --git a/recipes/glm/all/test_v1_package/CMakeLists.txt b/recipes/glm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/glm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/glm/all/test_v1_package/conanfile.py b/recipes/glm/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/glm/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_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/glm/config.yml b/recipes/glm/config.yml index ee1899a79d2af..c716b00aceaa5 100644 --- a/recipes/glm/config.yml +++ b/recipes/glm/config.yml @@ -1,15 +1,5 @@ versions: - "cci.20230113": - folder: all - "cci.20220420": + "1.0.1": folder: all "0.9.9.8": folder: all - "0.9.9.7": - folder: all - "0.9.9.6": - folder: all - "0.9.9.5": - folder: all - "0.9.5.4": - folder: all diff --git a/recipes/glog/all/conandata.yml b/recipes/glog/all/conandata.yml index 280f568cd746b..e306da3baebab 100644 --- a/recipes/glog/all/conandata.yml +++ b/recipes/glog/all/conandata.yml @@ -1,15 +1,10 @@ sources: + "0.7.1": + url: "https://github.com/google/glog/archive/refs/tags/v0.7.1.tar.gz" + sha256: "00e4a87e87b7e7612f519a41e491f16623b12423620006f59f5688bfd8d13b08" + "0.7.0": + url: "https://github.com/google/glog/archive/refs/tags/v0.7.0.tar.gz" + sha256: "375106b5976231b92e66879c1a92ce062923b9ae573c42b56ba28b112ee4cc11" "0.6.0": - sha256: 8a83bf982f37bb70825df71a9709fa90ea9f4447fb3c099e1d720a439d88bad6 - url: https://github.com/google/glog/archive/refs/tags/v0.6.0.tar.gz - "0.5.0": - sha256: eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5 - url: https://github.com/google/glog/archive/refs/tags/v0.5.0.tar.gz - "0.4.0": - sha256: f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c - url: https://github.com/google/glog/archive/v0.4.0.tar.gz -patches: - "0.5.0": - - patch_file: "patches/0001-fix-msvc-snprintf.patch" - patch_description: "Use stdio.h instead of cstdio.h for snprintf" - patch_type: "conan" + url: "https://github.com/google/glog/archive/refs/tags/v0.6.0.tar.gz" + sha256: "8a83bf982f37bb70825df71a9709fa90ea9f4447fb3c099e1d720a439d88bad6" diff --git a/recipes/glog/all/conanfile.py b/recipes/glog/all/conanfile.py index 7e06e74b5074e..d47735a7b0f26 100644 --- a/recipes/glog/all/conanfile.py +++ b/recipes/glog/all/conanfile.py @@ -1,8 +1,9 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd import os required_conan_version = ">=1.54.0" @@ -10,12 +11,11 @@ class GlogConan(ConanFile): name = "glog" + description = "Google logging library" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/google/glog/" - description = "Google logging library" topics = ("logging",) - license = "BSD-3-Clause" - package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -33,13 +33,10 @@ class GlogConan(ConanFile): "with_unwind": True, } - 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 not in ["Linux", "FreeBSD"] or Version(self.version) < "0.5.0": + if self.settings.os not in ["Linux", "FreeBSD"]: del self.options.with_unwind def configure(self): @@ -55,11 +52,19 @@ def requirements(self): if self.options.with_gflags: 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.7.2") + if self.options.get_safe("with_unwind"): + self.requires("libunwind/1.8.0", transitive_headers=True, transitive_libs=True) + + def validate(self): + if Version(self.version) < "0.7.0": + return + + check_min_cppstd(self, 14) def build_requirements(self): - if Version(self.version) >= "0.6.0": + if Version(self.version) >= "0.7.0": + self.tool_requires("cmake/[>=3.22 <4]") + elif Version(self.version) >= "0.6.0": self.tool_requires("cmake/[>=3.16 <4]") def source(self): @@ -72,36 +77,26 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["WITH_GFLAGS"] = self.options.with_gflags tc.variables["WITH_THREADS"] = self.options.with_threads - if Version(self.version) >= "0.5.0": - tc.variables["WITH_PKGCONFIG"] = True - if self.settings.os == "Emscripten": - tc.variables["WITH_SYMBOLIZE"] = False - tc.variables["HAVE_SYSCALL_H"] = False - tc.variables["HAVE_SYS_SYSCALL_H"] = False - else: - tc.variables["WITH_SYMBOLIZE"] = True - tc.variables["WITH_UNWIND"] = self.options.get_safe("with_unwind", default=False) + tc.variables["WITH_PKGCONFIG"] = True + if self.settings.os == "Emscripten": + tc.variables["WITH_SYMBOLIZE"] = False + tc.variables["HAVE_SYSCALL_H"] = False + tc.variables["HAVE_SYS_SYSCALL_H"] = False + else: + tc.variables["WITH_SYMBOLIZE"] = True + tc.variables["WITH_UNWIND"] = self.options.get_safe("with_unwind", default=False) tc.variables["BUILD_TESTING"] = False tc.variables["WITH_GTEST"] = False + # TODO: Remove after fixing https://github.com/conan-io/conan/issues/12012 + # Needed for https://github.com/google/glog/blob/v0.7.1/CMakeLists.txt#L81 + # and https://github.com/google/glog/blob/v0.7.1/CMakeLists.txt#L90 + tc.variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) tc.generate() tc = CMakeDeps(self) tc.generate() - def _patch_sources(self): - apply_conandata_patches(self) - # do not force PIC - if Version(self.version) <= "0.5.0": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON)", - "") - # INFO: avoid "CONAN_LIB::gflags_gflags_nothreads_RELEASE" but the target was not found. - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "determine_gflags_namespace", - "# determine_gflags_namespace") - def build(self): - self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -129,3 +124,5 @@ def package_info(self): self.cpp_info.defines.append(f"GOOGLE_GLOG_DLL_DECL={decl}") if self.options.with_gflags and not self.options.shared: self.cpp_info.defines.extend(["GFLAGS_DLL_DECLARE_FLAG=", "GFLAGS_DLL_DEFINE_FLAG="]) + if Version(self.version) >= "0.7.0": + self.cpp_info.defines.extend(["GLOG_USE_GLOG_EXPORT="]) diff --git a/recipes/glog/all/patches/0001-fix-msvc-snprintf.patch b/recipes/glog/all/patches/0001-fix-msvc-snprintf.patch deleted file mode 100644 index c92d98cb82e67..0000000000000 --- a/recipes/glog/all/patches/0001-fix-msvc-snprintf.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -141,7 +141,7 @@ check_cxx_compiler_flag (-Wunnamed-type-template-args - - # NOTE: Cannot use check_function_exists here since >=vc-14.0 can define - # snprintf as an inline function --check_symbol_exists (snprintf cstdio HAVE_SNPRINTF) -+check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF) - - check_library_exists (dbghelp UnDecorateSymbolName "" HAVE_DBGHELP) - diff --git a/recipes/glog/all/test_package/CMakeLists.txt b/recipes/glog/all/test_package/CMakeLists.txt index 28603535e29e9..0bb99e50cc6b4 100644 --- a/recipes/glog/all/test_package/CMakeLists.txt +++ b/recipes/glog/all/test_package/CMakeLists.txt @@ -1,7 +1,10 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(glog REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE glog::glog) +if (glog_VERSION VERSION_GREATER_EQUAL "0.7.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/glog/all/test_v1_package/CMakeLists.txt b/recipes/glog/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/glog/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/glog/all/test_v1_package/conanfile.py b/recipes/glog/all/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/glog/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/glog/config.yml b/recipes/glog/config.yml index babcbfb79d964..b93cc3a7e946b 100644 --- a/recipes/glog/config.yml +++ b/recipes/glog/config.yml @@ -1,7 +1,7 @@ versions: - "0.6.0": + "0.7.1": folder: all - "0.5.0": + "0.7.0": folder: all - "0.4.0": + "0.6.0": folder: all diff --git a/recipes/glshaderpp/all/test_v1_package/CMakeLists.txt b/recipes/glshaderpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/glshaderpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6e16e1852823f..0000000000000 --- a/recipes/glshaderpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/glslang/all/CMakeLists.txt b/recipes/glslang/all/CMakeLists.txt index 17ed662273267..a777fe23aa5df 100644 --- a/recipes/glslang/all/CMakeLists.txt +++ b/recipes/glslang/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) # TODO: diff --git a/recipes/glslang/all/conandata.yml b/recipes/glslang/all/conandata.yml index c41da7c94f094..091cef7cb2d40 100644 --- a/recipes/glslang/all/conandata.yml +++ b/recipes/glslang/all/conandata.yml @@ -1,55 +1,20 @@ +# Add only the SDK release versions from https://github.com/KhronosGroup/glslang/tags for consistency sources: + "1.3.268.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "8cfb4824f185bc246cd41cceedbfcdf14abd3d2fa861512baf81df8a263b9283" + "1.3.261.1": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "eb1f9c2ff0a1409151d7749fb37bc1988dc1fd908444c1e4f43d4190c90befcd" + "1.3.243.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "18b8f296874ac19d034bfb9060238c87b6d67a39af0dfd305d3252762c265f9f" "1.3.239.0": url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.239.0.tar.gz" sha256: "8b040328c18399b7bbf5bef84fac3d7b7376b39ec6833b7e19b7961bf7a72017" "1.3.236.0": url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.236.0.tar.gz" sha256: "fb6f323a36efcd98766bb72f598008f73c4c92bce69c79fc98ad2b3cdca0c263" - "1.3.231.1": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.231.1.tar.gz" - sha256: "df3857f01c1aa9ee1927d2feaaa431406d243958e07791e9aed4cb5ab22a5f2b" - "1.3.224.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.224.0.tar.gz" - sha256: "c43c6aa149fa1165e01b375b4d95cbc23b4fc72bd9972a89c55dd1eaa8a360ca" - "1.3.216.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.216.0.tar.gz" - sha256: "3f80a926390faedd33e6ed17ec68340abace83913b285174e2dee87156577be5" - "1.3.211.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.211.0.tar.gz" - sha256: "4335eec84b87d64130e860dad5d6dc1f722277d4e0ff5027153e2743628cb221" - "1.3.204.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.204.0.tar.gz" - sha256: "c6bec993194377944fb8d6d585a90e1288994660782d709e30fa1d91810d6820" - "11.7.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/11.7.0.tar.gz" - sha256: "b6c83864c3606678d11675114fa5f358c519fe1dad9a781802bcc87fb8fa32d5" - "11.6.0": - url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/11.6.0.tar.gz" - sha256: "99ecd3a0c2c2219293d76723846f762a9f3e7dd0dc2a4f346d0fc3a05a0ce000" - "11.5.0": - url: "https://github.com/KhronosGroup/glslang/archive/11.5.0.tar.gz" - sha256: "fd0b5e3bda591bb08bd3049655a99a0a55f0de4059b9c8f7b397e4b19cf5d51f" - "8.13.3559": - url: "https://github.com/KhronosGroup/glslang/archive/8.13.3559.tar.gz" - sha256: "c58fdcf7e00943ba10f9ae565b2725ec9d5be7dab7c8e82cac72fcaa83c652ca" -patches: - "1.3.239.0": - - patch_file: "patches/1.3.236.0-0001-no-force-glslang-pic.patch" - "1.3.236.0": - - patch_file: "patches/1.3.236.0-0001-no-force-glslang-pic.patch" - "1.3.231.1": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "1.3.224.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "1.3.216.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "1.3.211.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "1.3.204.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "11.7.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "11.6.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" - "11.5.0": - - patch_file: "patches/0001-no-force-glslang-pic.patch" + "1.2.198.0": + url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "b2a0541caf01de4fc411cbb32c805a3bd0f6578432e532c5fa6336d187a4a1b1" diff --git a/recipes/glslang/all/conanfile.py b/recipes/glslang/all/conanfile.py index 7d393607fb969..348ea446276ae 100644 --- a/recipes/glslang/all/conanfile.py +++ b/recipes/glslang/all/conanfile.py @@ -1,20 +1,22 @@ +import os +import re + from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import is_apple_os +from conan.errors import ConanInvalidConfiguration, ConanException 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.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version -import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class GlslangConan(ConanFile): name = "glslang" description = "Khronos-reference front end for GLSL/ESSL, partial front " \ "end for HLSL, and a SPIR-V generator." - license = ["BSD-3-Clause", "NVIDIA"] + license = "DocumentRef-LICENSE.txt:LicenseRef-glslang" topics = ("glsl", "hlsl", "spirv", "spir-v", "validation", "translation") homepage = "https://github.com/KhronosGroup/glslang" url = "https://github.com/conan-io/conan-center-index" @@ -42,7 +44,6 @@ class GlslangConan(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": @@ -55,30 +56,18 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - @property - def _get_compatible_spirv_tools_version(self): - return { - "11.7.0": "2021.4", - "11.6.0": "2021.3", - "11.5.0": "2021.2", - "8.13.3559": "2020.5", - }.get(str(self.version), self.version) - def requirements(self): if self.options.enable_optimizer: - self.requires(f"spirv-tools/{self._get_compatible_spirv_tools_version}") + self.requires(f"spirv-tools/{self.version}") def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) # see https://github.com/KhronosGroup/glslang/issues/2283 - glslang_version = Version(self.version) - if (self.options.shared and - (self.settings.os == "Windows" or \ - (glslang_version >= "7.0.0" and glslang_version < "11.0.0" and is_apple_os(self))) - ): - raise ConanInvalidConfiguration(f"{self.ref} shared library build is broken on {self.settings.os}") + if self.options.shared: + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} shared library build is broken on {self.settings.os}") if self.options.enable_optimizer and self.dependencies["spirv-tools"].options.shared: raise ConanInvalidConfiguration( @@ -86,70 +75,58 @@ def validate(self): "because SPIRV-Tools-opt is not built if shared" ) + def build_requirements(self): + if Version(self.version) >= "1.3.261": + self.tool_requires("cmake/[>=3.17.2 <4]") + 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["BUILD_EXTERNAL"] = False tc.variables["SKIP_GLSLANG_INSTALL"] = False tc.variables["ENABLE_SPVREMAPPER"] = self.options.spv_remapper tc.variables["ENABLE_GLSLANG_BINARIES"] = self.options.build_executables - glslang_version = Version(self.version) - if glslang_version < "7.0.0" or glslang_version >= "8.13.3743": - tc.variables["ENABLE_GLSLANG_JS"] = False - tc.variables["ENABLE_GLSLANG_WEBMIN"] = False - tc.variables["ENABLE_GLSLANG_WEBMIN_DEVEL"] = False - else: - tc.variables["ENABLE_GLSLANG_WEB"] = False - tc.variables["ENABLE_GLSLANG_WEB_DEVEL"] = False + tc.variables["ENABLE_GLSLANG_JS"] = False + tc.variables["ENABLE_GLSLANG_WEBMIN"] = False + tc.variables["ENABLE_GLSLANG_WEBMIN_DEVEL"] = False tc.variables["ENABLE_EMSCRIPTEN_SINGLE_FILE"] = False tc.variables["ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE"] = False tc.variables["ENABLE_HLSL"] = self.options.hlsl - if glslang_version < "7.0.0" or glslang_version >= "8.13.3743": - tc.variables["ENABLE_RTTI"] = True + tc.variables["ENABLE_RTTI"] = True tc.variables["ENABLE_OPT"] = self.options.enable_optimizer if self.options.enable_optimizer: tc.variables["spirv-tools_SOURCE_DIR"] = self.dependencies["spirv-tools"].package_folder.replace("\\", "/") tc.variables["ENABLE_PCH"] = False tc.variables["ENABLE_CTEST"] = False tc.variables["USE_CCACHE"] = False - if (glslang_version < "7.0.0" or glslang_version >= "11.6.0") and self.settings.os == "Windows": - tc.variables["OVERRIDE_MSVCCRT"] = False - if is_apple_os(self): - tc.variables["CMAKE_MACOSX_BUNDLE"] = False - if glslang_version < "1.3.231" or glslang_version >= "7.0.0": - # Generate a relocatable shared lib on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.variables["OVERRIDE_MSVCCRT"] = False + tc.variables["CMAKE_MACOSX_BUNDLE"] = False + # Generate a relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # glslang builds intermediate static libs, but Conan does not set -fPIC for shared builds + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + if Version(self.version) < "1.3.224.1": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) deps.generate() def _patch_sources(self): - apply_conandata_patches(self) - # Do not force PIC if static (but keep it if shared, because OGLCompiler, OSDependent, - # GenericCodeGen and MachineIndependent are still static and linked to glslang shared) - if not self.options.shared: - cmake_files_to_fix = [ - {"target": "OGLCompiler", "relpath": os.path.join("OGLCompilersDLL", "CMakeLists.txt")}, - {"target": "SPIRV" , "relpath": os.path.join("SPIRV", "CMakeLists.txt")}, - {"target": "SPVRemapper", "relpath": os.path.join("SPIRV", "CMakeLists.txt")}, - {"target": "OSDependent", "relpath": os.path.join("glslang", "OSDependent", "Unix","CMakeLists.txt")}, - {"target": "OSDependent", "relpath": os.path.join("glslang", "OSDependent", "Windows","CMakeLists.txt")}, - {"target": "HLSL" , "relpath": os.path.join("hlsl", "CMakeLists.txt")}, - ] - glslang_version = Version(self.version) - if glslang_version >= "7.0.0" and glslang_version < "11.0.0": - cmake_files_to_fix.append({"target": "glslang", "relpath": os.path.join("glslang", "CMakeLists.txt")}) - else: - cmake_files_to_fix.append({"target": "glslang-default-resource-limits", "relpath": os.path.join("StandAlone" , "CMakeLists.txt")}) - cmake_files_to_fix.append({"target": "MachineIndependent", "relpath": os.path.join("glslang", "CMakeLists.txt")}) - cmake_files_to_fix.append({"target": "GenericCodeGen", "relpath": os.path.join("glslang", "CMakeLists.txt")}) - for cmake_file in cmake_files_to_fix: - replace_in_file(self, os.path.join(self.source_folder, cmake_file["relpath"]), - "set_property(TARGET {} PROPERTY POSITION_INDEPENDENT_CODE ON)".format(cmake_file["target"]), - "") + for cmake_file in sorted(self.source_path.rglob("CMakeLists.txt")): + content = cmake_file.read_text(encoding="utf8") + if "POSITION_INDEPENDENT_CODE ON" in content: + content = re.sub(r"set_property\(TARGET \S+ PROPERTY POSITION_INDEPENDENT_CODE ON\)\n", "", content) + content = content.replace("POSITION_INDEPENDENT_CODE ON", "") + cmake_file.write_text(content, encoding="utf8") + self.output.info(f"Patched fPIC handling in {cmake_file.relative_to(self.source_path)}") + if "POSITION_INDEPENDENT_CODE" in content: + raise ConanException(f"POSITION_INDEPENDENT_CODE found in {cmake_file}, please update the recipe") def build(self): self._patch_sources() @@ -158,7 +135,7 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE.txt", 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")) @@ -166,22 +143,19 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "glslang") - self.cpp_info.set_property("cmake_target_name", "glslang::glslang-do-not-use") # because glslang-core target is glslang::glslang + self.cpp_info.set_property("cmake_target_name", "glslang::_glslang-do-not-use") # because glslang-core target is glslang::glslang lib_suffix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" - glslang_version = Version(self.version) - has_machineindependent = (glslang_version < "7.0.0" or glslang_version >= "11.0.0") and not self.options.shared - has_genericcodegen = (glslang_version < "7.0.0" or glslang_version >= "11.0.0") and not self.options.shared - has_osdependent = glslang_version < "1.3.231" or glslang_version >= "7.0.0" or not self.options.shared - has_oglcompiler = glslang_version < "1.3.231" or glslang_version >= "7.0.0" or not self.options.shared + has_machineindependent = not self.options.shared + has_genericcodegen = not self.options.shared + has_osdependent = not self.options.shared + has_oglcompiler = not self.options.shared # glslang self.cpp_info.components["glslang-core"].set_property("cmake_target_name", "glslang::glslang") - self.cpp_info.components["glslang-core"].names["cmake_find_package"] = "glslang" - self.cpp_info.components["glslang-core"].names["cmake_find_package_multi"] = "glslang" self.cpp_info.components["glslang-core"].libs = [f"glslang{lib_suffix}"] - if (glslang_version < "7.0.0" or glslang_version >= "11.0.0") and self.options.shared: + if self.options.shared: self.cpp_info.components["glslang-core"].defines.append("GLSLANG_IS_SHARED_LIBRARY") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["glslang-core"].system_libs.extend(["m", "pthread"]) @@ -200,8 +174,6 @@ def package_info(self): if has_machineindependent: # MachineIndependent self.cpp_info.components["machineindependent"].set_property("cmake_target_name", "glslang::MachineIndependent") - self.cpp_info.components["machineindependent"].names["cmake_find_package"] = "MachineIndependent" - self.cpp_info.components["machineindependent"].names["cmake_find_package_multi"] = "MachineIndependent" self.cpp_info.components["machineindependent"].libs = [f"MachineIndependent{lib_suffix}"] if has_genericcodegen: self.cpp_info.components["machineindependent"].requires.append("genericcodegen") @@ -213,15 +185,11 @@ def package_info(self): if has_genericcodegen: # GenericCodeGen self.cpp_info.components["genericcodegen"].set_property("cmake_target_name", "glslang::GenericCodeGen") - self.cpp_info.components["genericcodegen"].names["cmake_find_package"] = "GenericCodeGen" - self.cpp_info.components["genericcodegen"].names["cmake_find_package_multi"] = "GenericCodeGen" self.cpp_info.components["genericcodegen"].libs = [f"GenericCodeGen{lib_suffix}"] if has_osdependent: # OSDependent self.cpp_info.components["osdependent"].set_property("cmake_target_name", "glslang::OSDependent") - self.cpp_info.components["osdependent"].names["cmake_find_package"] = "OSDependent" - self.cpp_info.components["osdependent"].names["cmake_find_package_multi"] = "OSDependent" self.cpp_info.components["osdependent"].libs = [f"OSDependent{lib_suffix}"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["osdependent"].system_libs.append("pthread") @@ -229,14 +197,10 @@ def package_info(self): if has_oglcompiler: # OGLCompiler self.cpp_info.components["oglcompiler"].set_property("cmake_target_name", "glslang::OGLCompiler") - self.cpp_info.components["oglcompiler"].names["cmake_find_package"] = "OGLCompiler" - self.cpp_info.components["oglcompiler"].names["cmake_find_package_multi"] = "OGLCompiler" self.cpp_info.components["oglcompiler"].libs = [f"OGLCompiler{lib_suffix}"] # SPIRV self.cpp_info.components["spirv"].set_property("cmake_target_name", "glslang::SPIRV") - self.cpp_info.components["spirv"].names["cmake_find_package"] = "SPIRV" - self.cpp_info.components["spirv"].names["cmake_find_package_multi"] = "SPIRV" self.cpp_info.components["spirv"].libs = [f"SPIRV{lib_suffix}"] self.cpp_info.components["spirv"].requires = ["glslang-core"] if self.options.enable_optimizer: @@ -246,16 +210,13 @@ def package_info(self): # HLSL if self.options.hlsl: self.cpp_info.components["hlsl"].set_property("cmake_target_name", "glslang::HLSL") - self.cpp_info.components["hlsl"].names["cmake_find_package"] = "HLSL" - self.cpp_info.components["hlsl"].names["cmake_find_package_multi"] = "HLSL" self.cpp_info.components["hlsl"].libs = [f"HLSL{lib_suffix}"] # SPVRemapper if self.options.spv_remapper: self.cpp_info.components["spvremapper"].set_property("cmake_target_name", "glslang::SPVRemapper") - self.cpp_info.components["spvremapper"].names["cmake_find_package"] = "SPVRemapper" - self.cpp_info.components["spvremapper"].names["cmake_find_package_multi"] = "SPVRemapper" self.cpp_info.components["spvremapper"].libs = [f"SPVRemapper{lib_suffix}"] - if self.options.build_executables: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + if Version(self.version) >= "1.3.243": + self.cpp_info.components["glslang-default-resource-limits"].set_property("cmake_target_name", "glslang::glslang-default-resource-limits") + self.cpp_info.components["glslang-default-resource-limits"].libs = [f"glslang-default-resource-limits{lib_suffix}"] diff --git a/recipes/glslang/all/patches/0001-no-force-glslang-pic.patch b/recipes/glslang/all/patches/0001-no-force-glslang-pic.patch deleted file mode 100644 index 00e2266d3a9ae..0000000000000 --- a/recipes/glslang/all/patches/0001-no-force-glslang-pic.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/glslang/CMakeLists.txt -+++ b/glslang/CMakeLists.txt -@@ -167,7 +167,6 @@ - add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${GLSLANG_SOURCES} ${GLSLANG_HEADERS}) - set_target_properties(glslang PROPERTIES - FOLDER glslang -- POSITION_INDEPENDENT_CODE ON - VERSION "${GLSLANG_VERSION}" - SOVERSION "${GLSLANG_VERSION_MAJOR}") - target_link_libraries(glslang PRIVATE OGLCompiler OSDependent MachineIndependent) diff --git a/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch b/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch deleted file mode 100644 index 10a3ace245afd..0000000000000 --- a/recipes/glslang/all/patches/1.3.236.0-0001-no-force-glslang-pic.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/glslang/CMakeLists.txt -+++ b/glslang/CMakeLists.txt -@@ -169,7 +169,6 @@ set(GLSLANG_HEADERS - add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${GLSLANG_SOURCES} ${GLSLANG_HEADERS}) - set_target_properties(glslang PROPERTIES - FOLDER glslang -- POSITION_INDEPENDENT_CODE ON - VERSION "${GLSLANG_VERSION}" - SOVERSION "${GLSLANG_VERSION_MAJOR}") - target_link_libraries(glslang PRIVATE OGLCompiler OSDependent MachineIndependent) diff --git a/recipes/glslang/all/test_package/CMakeLists.txt b/recipes/glslang/all/test_package/CMakeLists.txt index 02d778d679219..51e0b6597db5c 100644 --- a/recipes/glslang/all/test_package/CMakeLists.txt +++ b/recipes/glslang/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(glslang REQUIRED CONFIG) diff --git a/recipes/glslang/all/test_v1_package/CMakeLists.txt b/recipes/glslang/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/glslang/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/glslang/all/test_v1_package/conanfile.py b/recipes/glslang/all/test_v1_package/conanfile.py deleted file mode 100644 index d939929a7a456..0000000000000 --- a/recipes/glslang/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - shader_name = os.path.join(self.source_folder, os.pardir, "test_package", "test_package.vert") - self.run(f"glslangValidator \"{shader_name}\"", run_environment=True) diff --git a/recipes/glslang/config.yml b/recipes/glslang/config.yml index 99298a61152e6..87519b61c9623 100644 --- a/recipes/glslang/config.yml +++ b/recipes/glslang/config.yml @@ -1,23 +1,13 @@ versions: - "1.3.239.0": - folder: all - "1.3.236.0": - folder: all - "1.3.231.1": - folder: all - "1.3.224.0": + "1.3.268.0": folder: all - "1.3.216.0": + "1.3.261.1": folder: all - "1.3.211.0": + "1.3.243.0": folder: all - "1.3.204.0": - folder: all - "11.7.0": - folder: all - "11.6.0": + "1.3.239.0": folder: all - "11.5.0": + "1.3.236.0": folder: all - "8.13.3559": + "1.2.198.0": folder: all diff --git a/recipes/glu/all/conanfile.py b/recipes/glu/all/conanfile.py index 77dcc692f82dd..17787ed1bf0f7 100644 --- a/recipes/glu/all/conanfile.py +++ b/recipes/glu/all/conanfile.py @@ -29,6 +29,9 @@ def package_id(self): self.info.clear() def system_requirements(self): + if self.settings.os not in ["Linux", "FreeBSD", "SunOS"]: + return + dnf = package_manager.Dnf(self) dnf.install(["mesa-libGLU-devel"], update=True, check=True) @@ -47,6 +50,9 @@ def system_requirements(self): pkg = package_manager.Pkg(self) pkg.install(["libGLU"], update=True, check=True) + pkg_util = package_manager.PkgUtil(self) + pkg_util.install(["mesalibs"], update=True, check=True) + def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.includedirs = [] @@ -54,6 +60,6 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.system_libs = ["glu32"] - elif self.settings.os in ["Linux", "FreeBSD"]: + elif self.settings.os in ["Linux", "FreeBSD", "SunOS"]: pkg_config = PkgConfig(self, 'glu') pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD") diff --git a/recipes/glu/all/test_package/CMakeLists.txt b/recipes/glu/all/test_package/CMakeLists.txt index 56f2fb9c24114..0306d8ad5051d 100644 --- a/recipes/glu/all/test_package/CMakeLists.txt +++ b/recipes/glu/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(glu REQUIRED CONFIG) diff --git a/recipes/glu/all/test_v1_package/CMakeLists.txt b/recipes/glu/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/glu/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/glu/all/test_v1_package/conanfile.py b/recipes/glu/all/test_v1_package/conanfile.py deleted file mode 100644 index a500b98343c74..0000000000000 --- a/recipes/glu/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/gm2calc/all/test_v1_package/CMakeLists.txt b/recipes/gm2calc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/gm2calc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 5ff327440fd86..0000000000000 --- a/recipes/gm2calc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/gmp/all/test_package/CMakeLists.txt b/recipes/gmp/all/test_package/CMakeLists.txt index ba2fbfaf5b1f9..264e5af18d86e 100644 --- a/recipes/gmp/all/test_package/CMakeLists.txt +++ b/recipes/gmp/all/test_package/CMakeLists.txt @@ -1,24 +1,13 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -enable_testing() - find_package(gmp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE gmp::libgmp) -add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}) - -if(TEST_PIC) - set(CMAKE_POSITION_INDEPENDENT_CODE ON) - add_executable(${PROJECT_NAME}_pic test_package.c) - target_link_libraries(${PROJECT_NAME}_pic PRIVATE gmp::libgmp) - add_test(NAME ${PROJECT_NAME}_pic_test COMMAND ${PROJECT_NAME}_pic) -endif() if(ENABLE_CXX) enable_language(CXX) add_executable(${PROJECT_NAME}_cpp test_package.cpp) target_link_libraries(${PROJECT_NAME}_cpp PRIVATE gmp::gmpxx) - add_test(NAME ${PROJECT_NAME}_cpp_test COMMAND ${PROJECT_NAME}_cpp) endif() diff --git a/recipes/gmp/all/test_package/conanfile.py b/recipes/gmp/all/test_package/conanfile.py index 408e5ddb1389c..9f0e5d3db8fa5 100644 --- a/recipes/gmp/all/test_package/conanfile.py +++ b/recipes/gmp/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 -from conan.tools.files import chdir +import os class TestPackageConan(ConanFile): @@ -18,7 +18,6 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) tc.variables["ENABLE_CXX"] = self.dependencies["gmp"].options.enable_cxx - tc.variables["TEST_PIC"] = "fPIC" in self.dependencies["gmp"].options and self.dependencies["gmp"].options.fPIC tc.generate() def build(self): @@ -27,7 +26,8 @@ def build(self): cmake.build() def test(self): - if not can_run(self): - return - with chdir(self, self.folders.build_folder): - self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun") + if can_run(self): + bin_path = self.cpp.build.bindirs[0] + self.run(os.path.join(bin_path, "test_package"), env="conanrun") + if self.dependencies['gmp'].options.enable_cxx: + self.run(os.path.join(bin_path, "test_package_cpp"), env="conanrun") diff --git a/recipes/gmp/all/test_package/test_package.c b/recipes/gmp/all/test_package/test_package.c index 855fb40978336..14783504f48a1 100644 --- a/recipes/gmp/all/test_package/test_package.c +++ b/recipes/gmp/all/test_package/test_package.c @@ -1,25 +1,9 @@ #include -#include -#include - int main (void) { - mpz_t a,b,c; - mpz_init_set_str(a, "1234", 10); - mpz_init_set_str(b, "4321", 10); - mpz_init(c); - - mpz_add(c, a, b); - - char *a_str = mpz_get_str(NULL, 10, a); - char *b_str = mpz_get_str(NULL, 10, b); - char *c_str = mpz_get_str(NULL, 10, c); - - printf("%s + %s = %s\n", a_str, b_str, c_str); - - free(a_str); - free(b_str); - free(c_str); + mpz_t a; + mpz_init(a); + mpz_clear(a); - return EXIT_SUCCESS; + return 0; } diff --git a/recipes/gmp/all/test_v1_package/CMakeLists.txt b/recipes/gmp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 81f52f58013af..0000000000000 --- a/recipes/gmp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -if(ENABLE_CXX) - enable_language(CXX) -endif() - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(gmp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE gmp::GMP) - -if(TEST_PIC) - add_library(${PROJECT_NAME}_shared SHARED ../test_package/test_package.c) - target_link_libraries(${PROJECT_NAME}_shared PRIVATE gmp::GMP) -endif() - -if(ENABLE_CXX) - add_executable(${PROJECT_NAME}_cpp ../test_package/test_package.cpp) - target_link_libraries(${PROJECT_NAME}_cpp PRIVATE gmp::GMPXX) -endif() diff --git a/recipes/gmp/all/test_v1_package/conanfile.py b/recipes/gmp/all/test_v1_package/conanfile.py deleted file mode 100644 index 716c611a38e8a..0000000000000 --- a/recipes/gmp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +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.definitions["ENABLE_CXX"] = self.options["gmp"].enable_cxx - cmake.definitions["TEST_PIC"] = "fPIC" in self.options["gmp"] and self.options["gmp"].fPIC - 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["gmp"].enable_cxx: - bin_path = os.path.join("bin", "test_package_cpp") - self.run(bin_path, run_environment=True) diff --git a/recipes/gn/all/conandata.yml b/recipes/gn/all/conandata.yml index 171741d9a625a..7bda923d38021 100644 --- a/recipes/gn/all/conandata.yml +++ b/recipes/gn/all/conandata.yml @@ -1,3 +1,5 @@ sources: + "cci.20240611": + url: "https://gn.googlesource.com/gn/+archive/b2afae122eeb6ce09c52d63f67dc53fc517dbdc8.tar.gz" "cci.20210429": url: "https://gn.googlesource.com/gn/+archive/6771ce569fb4803dad7a427aa2e2c23e960b917e.tar.gz" diff --git a/recipes/gn/all/conanfile.py b/recipes/gn/all/conanfile.py index 14fc7169fc53f..500098d4d263f 100644 --- a/recipes/gn/all/conanfile.py +++ b/recipes/gn/all/conanfile.py @@ -1,128 +1,163 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from contextlib import contextmanager -import conan.tools.files as tools_files -import conan.tools.scm as tools_scm import os +import shutil import sys import textwrap import time -required_conan_version = ">=1.46.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os, XCRun +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv, Environment +from conan.tools.files import chdir, copy, get, load, save, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, VCVars +from conan.tools.scm import Version + +required_conan_version = ">=1.47.0" class GnConan(ConanFile): name = "gn" description = "GN is a meta-build system that generates build files for Ninja." - url = "https://github.com/conan-io/conan-center-index" - topics = ("gn", "build", "system", "ninja") license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://gn.googlesource.com/" + topics = ("build system", "ninja") + + 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 + @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + if self.version == "cci.20210429": + return 17 + else: + return 20 @property - def _minimum_compiler_version_supporting_cxx17(self): - return { - "Visual Studio": 15, - "gcc": 7, - "clang": 4, - "apple-clang": 10, - }.get(str(self.settings.compiler)) - - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 17) + def _minimum_compiler_version(self): + if self._min_cppstd == 17: + return { + "Visual Studio": 15, + "msvc": 191, + "gcc": 7, + "clang": 4, + "apple-clang": 10, + }.get(str(self.settings.compiler)) else: - if self._minimum_compiler_version_supporting_cxx17: - if tools_scm.Version(self.settings.compiler.version) < self._minimum_compiler_version_supporting_cxx17: - raise ConanInvalidConfiguration("gn requires a compiler supporting c++17") - else: - self.output.warn("gn recipe does not recognize the compiler. gn requires a compiler supporting c++17. Assuming it does.") + return { + "gcc": "11", + "clang": "12", + "apple-clang": "15", + "msvc": "192", + "Visual Studio": "16", + }.get(str(self.settings.compiler)) - def package_id(self): - del self.info.settings.compiler + def validate_build(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + if self._minimum_compiler_version and Version(self.settings.compiler.version) < self._minimum_compiler_version: + raise ConanInvalidConfiguration(f"gn requires a compiler supporting C++{self._min_cppstd}") - def source(self): - tools_files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder) def build_requirements(self): # FIXME: add cpython build requirements for `build/gen.py`. - self.build_requires("ninja/1.10.2") + self.tool_requires("ninja/1.11.1") - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - yield - else: - compiler_defaults = {} - if self.settings.compiler == "gcc": - compiler_defaults = { - "CC": "gcc", - "CXX": "g++", - "AR": "ar", - "LD": "g++", - } - elif self.settings.compiler == "clang": - compiler_defaults = { - "CC": "clang", - "CXX": "clang++", - "AR": "ar", - "LD": "clang++", - } - env = {} - for k in ("CC", "CXX", "AR", "LD"): - v = tools.get_env(k, compiler_defaults.get(k, None)) - if v: - env[k] = v - with tools.environment_append(env): - yield - - @staticmethod - def _to_gn_platform(os_, compiler): - if tools.is_apple_os(os_): + def source(self): + get(self, **self.conan_data["sources"][self.version]) + + @property + def _gn_platform(self): + if is_apple_os(self): return "darwin" - if compiler == "Visual Studio": + if is_msvc(self): return "msvc" # Assume gn knows about the os - return str(os_).lower() + return str(self.settings.os).lower() + + @property + def _cxx(self): + compilers_by_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) + cxx = compilers_by_conf.get("cpp") or VirtualBuildEnv(self).vars().get("CXX") + if cxx: + return cxx + if self.settings.compiler == "apple-clang": + return XCRun(self).cxx + compiler_version = self.settings.compiler.version + major = Version(compiler_version).major + if self.settings.compiler == "gcc": + return shutil.which(f"g++-{compiler_version}") or shutil.which(f"g++-{major}") or shutil.which("g++") or "" + if self.settings.compiler == "clang": + return shutil.which(f"clang++-{compiler_version}") or shutil.which(f"clang++-{major}") or shutil.which("clang++") or "" + return "" + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + # Make sure CXX env var is set, otherwise gn defaults it to clang++ + # https://gn.googlesource.com/gn/+/refs/heads/main/build/gen.py#386 + env = Environment() + env.define("CXX", self._cxx) + env.vars(self).save_script("conanbuild_gn") + + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + + configure_args = [ + "--no-last-commit-position", + f"--host={self._gn_platform}", + ] + if self.settings.build_type in ["Debug", "RelWithDebInfo"]: + configure_args.append("-d") + save(self, os.path.join(self.source_folder, "configure_args"), " ".join(configure_args)) def build(self): - with tools.chdir(self._source_subfolder): - with self._build_context(): - # Generate dummy header to be able to run `build/ben.py` with `--no-last-commit-position`. This allows running the script without the tree having to be a git checkout. - tools.save(os.path.join("src", "gn", "last_commit_position.h"), - textwrap.dedent("""\ - #pragma once - #define LAST_COMMIT_POSITION "1" - #define LAST_COMMIT_POSITION_NUM 1 - """)) - conf_args = [ - "--no-last-commit-position", - "--host={}".format(self._to_gn_platform(self.settings.os, self.settings.compiler)), - ] - if self.settings.build_type == "Debug": - conf_args.append("-d") - self.run("{} build/gen.py {}".format(sys.executable, " ".join(conf_args)), run_environment=True) - # Try sleeping one second to avoid time skew of the generated ninja.build file (and having to re-run build/gen.py) - time.sleep(1) - build_args = [ - "-C", "out", - "-j{}".format(tools.cpu_count()), - ] - self.run("ninja {}".format(" ".join(build_args)), run_environment=True) + with chdir(self, self.source_folder): + # Generate dummy header to be able to run `build/gen.py` with `--no-last-commit-position`. + # This allows running the script without the tree having to be a git checkout. + save(self, os.path.join(self.source_folder, "src", "gn", "last_commit_position.h"), + textwrap.dedent("""\ + #pragma once + #define LAST_COMMIT_POSITION "1" + #define LAST_COMMIT_POSITION_NUM 1 + """), + ) + + # Disable GenerateLastCommitPosition() + replace_in_file(self, os.path.join(self.source_folder, "build/gen.py"), + "def GenerateLastCommitPosition(host, header):", + "def GenerateLastCommitPosition(host, header):\n return") + + self.run(f"{sys.executable} build/gen.py " + load(self, "configure_args")) + self.run(f"ninja -C out -j{os.cpu_count()} -v") def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("gn", src=os.path.join(self._source_subfolder, "out"), dst="bin") - self.copy("gn.exe", src=os.path.join(self._source_subfolder, "out"), dst="bin") + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if self.settings.os == "Windows": + copy(self, "gn.exe", + src=os.path.join(self.source_folder, "out"), + dst=os.path.join(self.package_folder, "bin")) + else: + copy(self, "gn", + src=os.path.join(self.source_folder, "out"), + dst=os.path.join(self.package_folder, "bin")) def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + 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) - self.cpp_info.includedirs = [] diff --git a/recipes/gn/all/test_package/conanfile.py b/recipes/gn/all/test_package/conanfile.py index 6afe525facbbe..4a3175e52589e 100644 --- a/recipes/gn/all/test_package/conanfile.py +++ b/recipes/gn/all/test_package/conanfile.py @@ -1,46 +1,28 @@ -from conans import ConanFile, CMake, tools -from contextlib import contextmanager import os +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run, cross_building +from conan.tools.env import VirtualRunEnv, VirtualBuildEnv +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" + generators = "VCVars" + test_type = "explicit" def build_requirements(self): - self.build_requires("ninja/1.10.2") + self.tool_requires(self.tested_reference_str) + self.tool_requires("ninja/1.11.1") - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - yield - else: - compiler_defaults = {} - if self.settings.compiler == "gcc": - compiler_defaults = { - "CC": "gcc", - "CXX": "g++", - "AR": "ar", - "LD": "g++", - } - elif self.settings.compiler in ("apple-clang", "clang"): - compiler_defaults = { - "CC": "clang", - "CXX": "clang++", - "AR": "ar", - "LD": "clang++", - } - env = {} - for k in ("CC", "CXX", "AR", "LD"): - v = tools.get_env(k, compiler_defaults.get(k, None)) - if v: - env[k] = v - with tools.environment_append(env): - yield + def layout(self): + basic_layout(self) @property def _target_os(self): - if tools.is_apple_os(self.settings.os): + if is_apple_os(self): return "mac" # Assume gn knows about the os return { @@ -53,17 +35,22 @@ def _target_cpu(self): "x86_64": "x64", }.get(str(self.settings.arch), str(self.settings.arch)) + def generate(self): + VirtualBuildEnv(self).generate() + VirtualRunEnv(self).generate(scope="run") + VirtualRunEnv(self).generate(scope="build") + def build(self): - if not tools.cross_building(self.settings): - with tools.chdir(self.source_folder): - gn_args = [ - os.path.relpath(os.path.join(self.build_folder, "bin"), os.getcwd()).replace("\\", "/"), - "--args=\"target_os=\\\"{os_}\\\" target_cpu=\\\"{cpu}\\\"\"".format(os_=self._target_os, cpu=self._target_cpu), - ] - self.run("gn gen {}".format(" ".join(gn_args)), run_environment=True) - with self._build_context(): - self.run("ninja -v -j{} -C bin".format(tools.cpu_count()), run_environment=True) + if not cross_building(self): + rel_bindir = unix_path(self, os.path.relpath(os.path.join(self.cpp.build.bindir), os.getcwd())) + gn_args = [ + rel_bindir, + f'--args="target_os=\\"{self._target_os}\\" target_cpu=\\"{self._target_cpu}\\""', + ] + self.run("gn gen " + " ".join(gn_args)) + self.run(f"ninja -v -j{os.cpu_count()} -C {rel_bindir}") 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/gn/all/test_package/test_package.cpp b/recipes/gn/all/test_package/test_package.cpp index 576931dcb63ac..7a70c493ae50a 100644 --- a/recipes/gn/all/test_package/test_package.cpp +++ b/recipes/gn/all/test_package/test_package.cpp @@ -3,7 +3,7 @@ #include -int main(int argc, char* argv[]) { +int main() { std::cout << get_test_shared_text() << "\n"; std::cout << get_test_static_text() << "\n"; return 0; diff --git a/recipes/gn/config.yml b/recipes/gn/config.yml index 7831e6ed51225..864345cea83ba 100644 --- a/recipes/gn/config.yml +++ b/recipes/gn/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20240611": + folder: all "cci.20210429": folder: all diff --git a/recipes/gnu-config/all/test_v1_package/conanfile.py b/recipes/gnu-config/all/test_v1_package/conanfile.py deleted file mode 100644 index f98dcb17dfac3..0000000000000 --- a/recipes/gnu-config/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +0,0 @@ -from conans import ConanFile, tools -from conans.errors import ConanException - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - 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 test(self): - self.run("config.guess", run_environment=True, win_bash=tools.os_info.is_windows) - try: - triplet = tools.get_gnu_triplet(str(self.settings.os), str(self.settings.arch), str(self.settings.compiler)) - self.run(f"config.sub {triplet}", run_environment=True, win_bash=tools.os_info.is_windows) - except ConanException: - self.output.info("Current configuration is not supported by GNU config.\nIgnoring...") diff --git a/recipes/gnulib/all/conandata.yml b/recipes/gnulib/all/conandata.yml index 5a178c6fd8562..f0a11d9e7bc47 100644 --- a/recipes/gnulib/all/conandata.yml +++ b/recipes/gnulib/all/conandata.yml @@ -1,4 +1,7 @@ sources: - "20200224": - url: "http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=d279bc6d9f9323e19ad8c32b6d12ff96dfb0f5ba;sf=tgz" - sha256: "171142863dd860b3a5babc0f6172048313cf9d98d00a289be9c154bf015ac68d" + "20231231": + url: "http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=4f6545e79c4a7cd7feb2c8f23f1d5167e7165907;sf=tgz" + sha256: "8b95e1ac4dc3a925dd282031445f544f332cdb0b0df2f0b97f5675b7ec42acff" + "20230218": + url: "http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=bb3fd10;sf=tgz" + sha256: "e94cb8a4f85439e3b6509f22bd8a132bbf0cc0f22996c67cdc0c7329142b6498" diff --git a/recipes/gnulib/all/conanfile.py b/recipes/gnulib/all/conanfile.py index 8f85099afedec..ad906d69a08cb 100644 --- a/recipes/gnulib/all/conanfile.py +++ b/recipes/gnulib/all/conanfile.py @@ -1,51 +1,49 @@ -from conans import ConanFile, tools import os -import shutil -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 GnuLibConanFile(ConanFile): name = "gnulib" description = "Gnulib is a central location for common GNU code, intended to be shared among GNU packages." - homepage = "https://www.gnu.org/software/gnulib/" + license = ("GPL-3.0-or-later", "LGPL-3.0-or-later", "Public-domain") url = "https://github.com/conan-io/conan-center-index" - topics = ("gnulib", "library", "gnu") - license = ("GPL-3.0-or-later", "LGPL-3.0-or-later", "Unlicense") + homepage = "https://www.gnu.org/software/gnulib/" + topics = ("library", "gnu") + package_type = "build-scripts" + 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.header_only() + self.info.clear() def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True, filename="gnulib.tar.gz") + get(self, **self.conan_data["sources"][self.version], strip_root=True, filename="gnulib.tar.gz") def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - - # The following line did not work, so do it the long way... - # shutil.copy(os.path.join(self.source_folder, self._source_subfolder), os.path.join(self.package_folder, "bin")) - - gnulib_dir = os.path.join(self.source_folder, self._source_subfolder) - for root, _, files in os.walk(gnulib_dir): - relpath = os.path.relpath(root, gnulib_dir) - dstdir = os.path.join(self.package_folder, "bin", relpath) - try: - os.makedirs(dstdir) - except FileExistsError: - pass - for file in files: - src = os.path.join(root, file) - dst = os.path.join(dstdir, file) - shutil.copy(src, dst) + copy(self, "COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*", + dst=os.path.join(self.package_folder, "bin"), + src=self.source_folder) def package_info(self): + self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] + # Set GNULIB_SRCDIR for the standard ./bootstrap script from build-aux + # https://github.com/digitalocean/gnulib/blob/master/build-aux/bootstrap#L58-L62 + self.buildenv_info.define_path("GNULIB_SRCDIR", os.path.join(self.package_folder, "bin")) + + # TODO: Legacy, to be removed on Conan 2.0 binpath = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment var: {}".format(binpath)) self.env_info.PATH.append(binpath) diff --git a/recipes/gnulib/all/test_package/conanfile.py b/recipes/gnulib/all/test_package/conanfile.py index 39d8fd2e49aac..09e7f8d503e60 100644 --- a/recipes/gnulib/all/test_package/conanfile.py +++ b/recipes/gnulib/all/test_package/conanfile.py @@ -1,60 +1,68 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -import contextlib import os -import shutil + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import copy, save, chdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.microsoft import is_msvc, unix_path class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - exports_sources = "configure.ac", "Makefile.am", "test_package.c" + settings = "os", "arch", "compiler", "build_type" + test_type = "explicit" + win_bash = True # Needed in Conan v1 to avoid "Cannot wrap command with different envs." @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def build_requirements(self): - 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") - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "AR": "{} lib".format(tools.unix_path(os.path.join(self.build_folder, "build-aux", "ar-lib"))), - "CC": "cl -nologo", - "CXX": "cl -nologo", - "LD": "link -nologo", - "NM": "dumpbin -symbols", - "OBJDUMP": ":", - "RANLIB": ":", - "STRIP": ":", - } - with tools.environment_append(env): - yield - else: - yield + self.tool_requires(self.tested_reference_str) + 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("automake/1.16.5") + self.tool_requires("libtool/2.4.7") + + def layout(self): + cmake_layout(self) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(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.define("LD", "link -nologo") + # ar-lib wrapper is added automatically by ./configure, no need to set AR + env.vars(self).save_script("conanbuild_msvc") def build(self): - for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), dst=os.path.join(self.build_folder, src)) - with tools.chdir(self.build_folder): - for fn in ("COPYING", "NEWS", "INSTALL", "README", "AUTHORS", "ChangeLog"): - tools.save(fn, "\n") - with tools.run_environment(self): - self.run("gnulib-tool --list", win_bash=tools.os_info.is_windows, run_environment=True) - self.run("gnulib-tool --import getopt-posix", win_bash=tools.os_info.is_windows, run_environment=True) - # m4 built with Visual Studio does not support executing *nix utils (e.g. `test`) - with tools.environment_append({"M4":None}) if self.settings.os == "Windows" else tools.no_op(): - self.run("{} -fiv".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows, run_environment=True) - - with self._build_context(): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.configure() - autotools.make() + for src in ["configure.ac", "Makefile.am", "test_package.c"]: + copy(self, src, src=self.source_folder, dst=self.build_folder) + for fn in ("COPYING", "NEWS", "INSTALL", "README", "AUTHORS", "ChangeLog"): + save(self, os.path.join(self.build_folder, fn), "\n") + self.run("gnulib-tool --list") + self.run("gnulib-tool --import getopt-posix", env="conanbuild") + with chdir(self, self.build_folder): + autotools = Autotools(self) + if self._settings_build.os == "Windows": + # Disable m4 from Conan, which is not able to run shell commands with syscmd() + os.environ["M4"] = "" + # autotools.autoreconf() does not have build_script_folder param in Conan v1, so using .run() + self.run("autoreconf -fiv") + autotools.configure(self.build_folder) + autotools.make() 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 = unix_path(self, os.path.join(self.build_folder, "test_package")) + self.run(bin_path, env="conanrun") diff --git a/recipes/gnulib/config.yml b/recipes/gnulib/config.yml index 3f6aba5ec0fcc..ee83643c5044f 100644 --- a/recipes/gnulib/config.yml +++ b/recipes/gnulib/config.yml @@ -1,3 +1,5 @@ versions: - "20200224": + "20231231": + folder: all + "20230218": folder: all diff --git a/recipes/gnutls/all/conandata.yml b/recipes/gnutls/all/conandata.yml index ffbcf3dfbc66a..92c4817c69f19 100644 --- a/recipes/gnutls/all/conandata.yml +++ b/recipes/gnutls/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "3.8.7": + url: + - "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-3.8.7.tar.xz" + - "http://www.ring.gr.jp/pub/net/gnupg/gnutls/v3.8/gnutls-3.8.7.tar.xz" + - "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.8/gnutls-3.8.7.tar.xz" + sha256: "fe302f2b6ad5a564bcb3678eb61616413ed5277aaf8e7bf7cdb9a95a18d9f477" + "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" @@ -6,8 +18,17 @@ sources: - "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz" sha256: "c58ad39af0670efe6a8aee5e3a8b2331a1200418b64b7c51977fb396d4617114" patches: + "3.8.2": + - patch_file: "patches/3.8.2-0001-ossstaues-argument-fix.patch" + patch_description: "specify osstatus_error takes in an OSStatus as its first argument" + patch_type: "backport" + patch_source: "https://gitlab.com/gnutls/gnutls/-/commit/925b7072ac1a242b0968f889585e61993f9ca449.patch" "3.7.8": - - patch_description: "Fix Mac OS build when linking to libtasn1" + - patch_file: "patches/3.7.8-0001-fix-isdigit.patch" + patch_description: "Fix Mac OS build when linking to libtasn1" patch_type: "portability" patch_source: "https://github.com/xbmc/inputstream.ffmpegdirect/blob/Matrix/depends/common/gnutls/03-undo-libtasn1-cisdigit.patch" - patch_file: "patches/0001-fix-isdigit.patch" + - patch_file: "patches/3.7.8-0002-ossstaues-argument-fix.patch" + patch_description: "specify osstatus_error takes in an OSStatus as its first argument (reapplied from 3.8.2)" + patch_type: "backport" + patch_source: "https://gitlab.com/gnutls/gnutls/-/commit/925b7072ac1a242b0968f889585e61993f9ca449.patch" diff --git a/recipes/gnutls/all/conanfile.py b/recipes/gnutls/all/conanfile.py index 193f97471c98a..4f1bb9180932b 100644 --- a/recipes/gnutls/all/conanfile.py +++ b/recipes/gnutls/all/conanfile.py @@ -65,7 +65,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("nettle/3.8.1") + self.requires("nettle/3.9.1") self.requires("gmp/6.3.0") self.requires("libiconv/1.17") if self.options.with_zlib: @@ -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/2.0.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/all/patches/0001-fix-isdigit.patch b/recipes/gnutls/all/patches/3.7.8-0001-fix-isdigit.patch similarity index 100% rename from recipes/gnutls/all/patches/0001-fix-isdigit.patch rename to recipes/gnutls/all/patches/3.7.8-0001-fix-isdigit.patch diff --git a/recipes/gnutls/all/patches/3.7.8-0002-ossstaues-argument-fix.patch b/recipes/gnutls/all/patches/3.7.8-0002-ossstaues-argument-fix.patch new file mode 100644 index 0000000000000..e91a76a05b55a --- /dev/null +++ b/recipes/gnutls/all/patches/3.7.8-0002-ossstaues-argument-fix.patch @@ -0,0 +1,13 @@ +diff --git a/lib/system/certs.c b/lib/system/certs.c +index 611c645..b1eb414 100644 +--- a/lib/system/certs.c ++++ b/lib/system/certs.c +@@ -278,7 +278,7 @@ int add_system_trust(gnutls_x509_trust_list_t list, unsigned int tl_flags, + } + #elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + static +-int osstatus_error(status) ++int osstatus_error(OSStatus status) + { + CFStringRef err_str = SecCopyErrorMessageString(status, NULL); + _gnutls_debug_log("Error loading system root certificates: %s\n", diff --git a/recipes/gnutls/all/patches/3.8.2-0001-ossstaues-argument-fix.patch b/recipes/gnutls/all/patches/3.8.2-0001-ossstaues-argument-fix.patch new file mode 100644 index 0000000000000..efe2c3114f52e --- /dev/null +++ b/recipes/gnutls/all/patches/3.8.2-0001-ossstaues-argument-fix.patch @@ -0,0 +1,26 @@ +From 925b7072ac1a242b0968f889585e61993f9ca449 Mon Sep 17 00:00:00 2001 +From: Mark Harfouche +Date: Mon, 27 Nov 2023 12:20:23 +0000 +Subject: [PATCH] specify osstatus_error takes in an OSStatus as its first + argument + +Signed-off-by: Mark Harfouche +--- + lib/system/certs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/system/certs.c b/lib/system/certs.c +index 9619ed18c1..779d928609 100644 +--- a/lib/system/certs.c ++++ b/lib/system/certs.c +@@ -289,7 +289,7 @@ static int add_system_trust(gnutls_x509_trust_list_t list, + return r; + } + #elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 +-static int osstatus_error(status) ++static int osstatus_error(OSStatus status) + { + CFStringRef err_str = SecCopyErrorMessageString(status, NULL); + _gnutls_debug_log("Error loading system root certificates: %s\n", +-- +GitLab diff --git a/recipes/gnutls/all/test_package/CMakeLists.txt b/recipes/gnutls/all/test_package/CMakeLists.txt index 0529758951292..1d5ac636501e3 100644 --- a/recipes/gnutls/all/test_package/CMakeLists.txt +++ b/recipes/gnutls/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 C) find_package(GnuTLS REQUIRED) diff --git a/recipes/gnutls/all/test_v1_package/CMakeLists.txt b/recipes/gnutls/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/gnutls/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gnutls/all/test_v1_package/conanfile.py b/recipes/gnutls/all/test_v1_package/conanfile.py deleted file mode 100644 index e335244ee18cf..0000000000000 --- a/recipes/gnutls/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -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/gnutls/config.yml b/recipes/gnutls/config.yml index c993c311a349d..70ce87bedbde5 100644 --- a/recipes/gnutls/config.yml +++ b/recipes/gnutls/config.yml @@ -1,3 +1,7 @@ versions: + "3.8.7": + folder: "all" + "3.8.2": + folder: "all" "3.7.8": folder: "all" diff --git a/recipes/gobject-introspection/all/conandata.yml b/recipes/gobject-introspection/all/conandata.yml index 47eccc41d1faf..4203b61eacd08 100644 --- a/recipes/gobject-introspection/all/conandata.yml +++ b/recipes/gobject-introspection/all/conandata.yml @@ -1,19 +1,7 @@ sources: + "1.78.1": + url: "https://download.gnome.org/sources/gobject-introspection/1.78/gobject-introspection-1.78.1.tar.xz" + sha256: "bd7babd99af7258e76819e45ba4a6bc399608fe762d83fde3cac033c50841bb4" "1.72.0": - sha256: "02fe8e590861d88f83060dd39cda5ccaa60b2da1d21d0f95499301b186beaabc" url: "https://download.gnome.org/sources/gobject-introspection/1.72/gobject-introspection-1.72.0.tar.xz" - "1.70.0": - url: "https://download.gnome.org/sources/gobject-introspection/1.70/gobject-introspection-1.70.0.tar.xz" - sha256: "902b4906e3102d17aa2fcb6dad1c19971c70f2a82a159ddc4a94df73a3cafc4a" - "1.69.0": - url: "https://download.gnome.org/sources/gobject-introspection/1.69/gobject-introspection-1.69.0.tar.xz" - sha256: "c668cbe4a3aad7539e2cf669ab576ce7fbadac6890472f4095ca215dbbebee99" - "1.68.0": - url: "https://download.gnome.org/sources/gobject-introspection/1.68/gobject-introspection-1.68.0.tar.xz" - sha256: "d229242481a201b84a0c66716de1752bca41db4133672cfcfb37c93eb6e54a27" - "1.67.1": - url: "https://download.gnome.org/sources/gobject-introspection/1.67/gobject-introspection-1.67.1.tar.xz" - sha256: "9635184d668794609f9fe661c5bde11c106385d26c3babe291c24e3655987e47" - "1.66.1": - url: "https://download.gnome.org/sources/gobject-introspection/1.66/gobject-introspection-1.66.1.tar.xz" - sha256: "dd44a55ee5f426ea22b6b89624708f9e8d53f5cc94e5485c15c87cb30e06161d" + sha256: "02fe8e590861d88f83060dd39cda5ccaa60b2da1d21d0f95499301b186beaabc" diff --git a/recipes/gobject-introspection/all/conanfile.py b/recipes/gobject-introspection/all/conanfile.py index 4e30ffbb5f86f..74c5c3b60e338 100644 --- a/recipes/gobject-introspection/all/conanfile.py +++ b/recipes/gobject-introspection/all/conanfile.py @@ -1,129 +1,188 @@ -from conans import ConanFile, tools, Meson, VisualStudioBuildEnvironment -from conans.errors import ConanInvalidConfiguration import os -import shutil -import glob -required_conan_version = ">=1.36.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +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 MesonToolchain, Meson +from conan.tools.env import Environment +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.scm import Version +from conan import conan_version + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" + class GobjectIntrospectionConan(ConanFile): name = "gobject-introspection" - description = "GObject introspection is a middleware layer between C libraries (using GObject) and language bindings" - topics = ("conan", "gobject-instrospection") + description = ("GObject introspection is a middleware layer between " + "C libraries (using GObject) and language bindings") + license = "LGPL-2.1-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.gnome.org/GNOME/gobject-introspection" - license = "LGPL-2.1" - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" - generators = "pkg_config" + topics = ("gobject-instrospection",) - @property - def _is_msvc(self): - return self.settings.compiler == "Visual Studio" - - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "build_introspection_data": [True, False], + } + default_options = { + "fPIC": True, + "build_introspection_data": True, + } + short_paths = True def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.os == "Windows": - raise ConanInvalidConfiguration("%s recipe does not support windows. Contributions are welcome!" % self.name) + if self.settings.os in ["Windows", "Macos"] or cross_building(self): + # FIXME: tools/g-ir-scanner fails to load glib + self.options.build_introspection_data = False + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if self.options.get_safe("build_introspection_data"): + # INFO: g-ir-scanner looks for dynamic glib and gobject libraries when running + self.options["glib"].shared = True + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + # https://gitlab.gnome.org/GNOME/gobject-introspection/-/blob/1.76.1/meson.build?ref_type=tags#L127-131 + self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) + # ffi.h is exposed by public header gobject-introspection-1.0/girffi.h + self.requires("libffi/3.4.4", transitive_headers=True) + + def validate(self): + if self.settings.os == "Windows" and self.settings.build_type == "Debug": + # fatal error LNK1104: cannot open file 'python37_d.lib' + raise ConanInvalidConfiguration( + f"{self.ref} debug build on Windows is disabled due to debug version of Python libs likely not being available. Contributions to fix this are welcome.") + if self.options.build_introspection_data and not self.dependencies["glib"].options.shared: + # FIXME: tools/g-ir-scanner fails to load glib + # tools/g-ir-scanner --output=gir/GLib-2.0.gir ... + # ERROR: can't resolve libraries to shared libraries: glib-2.0, gobject-2.0 + raise ConanInvalidConfiguration(f"{self.ref} requires shared glib to be built as shared. Use -o 'glib/*:shared=True'.") + if self.options.build_introspection_data and self.settings.os in ["Windows", "Macos"]: + # FIXME: tools/g-ir-scanner', '--output=gir/GLib-2.0.gir' ... ERROR: can't resolve libraries to shared libraries: glib-2.0, gobject-2.0 + # FIXME: g-ir-scanner fails to find libgnuintl + # giscanner/_giscanner.cpython-37m-darwin.so, 0x0002): Library not loaded: /lib/libgnuintl.8.dylib + raise ConanInvalidConfiguration(f"{self.ref} fails to run g-ir-scanner due glib loaded as shared. Use -o 'glib/*:shared=False'. Contributions to fix this are welcome.") + if self.options.build_introspection_data and cross_building(self): + raise ConanInvalidConfiguration(f"{self.ref} build_introspection_data is not supported when cross-building. Use '&:build_introspection_data=False'.") def build_requirements(self): - if tools.Version(self.version) >= "1.71.0": - self.build_requires("meson/0.62.2") - else: - # https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/414 - self.build_requires("meson/0.59.3") - self.build_requires("pkgconf/1.7.4") + self.tool_requires("meson/[>=1.2.3 <2]") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") if self.settings.os == "Windows": - self.build_requires("winflexbison/2.5.24") + self.tool_requires("winflexbison/2.5.25") else: - self.build_requires("flex/2.6.4") - self.build_requires("bison/3.7.6") - - def requirements(self): - self.requires("glib/2.73.0") + self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") + self.tool_requires("glib/") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def _configure_meson(self): - meson = Meson(self) - defs = dict() - defs["build_introspection_data"] = self.options["glib"].shared - defs["datadir"] = os.path.join(self.package_folder, "res") - - meson.configure( - source_folder=self._source_subfolder, - args=["--wrap-mode=nofallback"], - build_folder=self._build_subfolder, - defs=defs, - ) - return meson + 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 = MesonToolchain(self) + if cross_building(self): + tc.project_options["gi_cross_use_prebuilt_gi"] = "false" + tc.project_options["build_introspection_data"] = self.options.build_introspection_data + tc.project_options["datadir"] = "res" + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + # INFO: g-ir-scanner uses PKG_CONFIG_PATH directly instead of pkg-config Meson module + env = Environment() + env.define_path("PKG_CONFIG_PATH", self.generators_folder) + envvars = env.vars(self) + envvars.save_script("pkg_config_env") + + def _patch_sources(self): + # Disable tests + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "subdir('tests')", + "#subdir('tests')") + # Look for data files in res/ instead of share/ + replace_in_file(self, os.path.join(self.source_folder, "tools", "g-ir-tool-template.in"), + "os.path.join(filedir, '..', 'share')", + "os.path.join(filedir, '..', 'res')") + if Version(conan_version) < "2": + # INFO: Conan 1.x generates PkgConfigDeps with libdir1 and includedir1 variables only for glib due its modules + replace_in_file(self, os.path.join(self.source_folder, "gir", "meson.build"), + "glib_dep.get_variable(pkgconfig: 'libdir')", + "glib_dep.get_variable(pkgconfig: 'libdir1')") + replace_in_file(self, os.path.join(self.source_folder, "gir", "meson.build"), + "join_paths(glib_dep.get_variable(pkgconfig: 'includedir'), 'glib-2.0')", + "join_paths(glib_dep.get_variable(pkgconfig: 'includedir1'), 'glib-2.0')") + # gir/meson.build expects the gio-unix-2.0 includedir to be passed as a build flag. + # Patch this for glib from Conan. + replace_in_file(self, os.path.join(self.source_folder, "gir", "meson.build"), + "join_paths(giounix_dep.get_variable(pkgconfig: 'includedir'), 'gio-unix-2.0')", + "giounix_dep.get_variable(pkgconfig: 'includedir1')") + else: + # gir/meson.build expects the gio-unix-2.0 includedir to be passed as a build flag. + # Patch this for glib from Conan. + replace_in_file(self, os.path.join(self.source_folder, "gir", "meson.build"), + "join_paths(giounix_dep.get_variable(pkgconfig: 'includedir'), 'gio-unix-2.0')", + "giounix_dep.get_variable(pkgconfig: 'includedir')") def build(self): - tools.replace_in_file( - os.path.join(self._source_subfolder, "meson.build"), - "subdir('tests')", - "#subdir('tests')", - ) - tools.replace_in_file( - os.path.join(self._source_subfolder, "meson.build"), - "if meson.version().version_compare('>=0.54.0')", - "if false", - ) - - with tools.environment_append( - VisualStudioBuildEnvironment(self).vars - if self._is_msvc - else {"PKG_CONFIG_PATH": self.build_folder} - ): - meson = self._configure_meson() - meson.build() + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - with tools.environment_append( - VisualStudioBuildEnvironment(self).vars - ) if self._is_msvc else tools.no_op(): - meson = self._configure_meson() - meson.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) - for pdb_file in glob.glob(os.path.join(self.package_folder, "bin", "*.pdb")): - os.unlink(pdb_file) + copy(self, "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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.names["pkg_config"] = "gobject-introspection-1.0" + self.cpp_info.set_property("pkg_config_name", "gobject-introspection-1.0") self.cpp_info.libs = ["girepository-1.0"] - self.cpp_info.includedirs.append( - os.path.join("include", "gobject-introspection-1.0") - ) - - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var with: {}".format(bin_path)) - self.env_info.PATH.append(bin_path) + self.cpp_info.includedirs.append(os.path.join("include", "gobject-introspection-1.0")) exe_ext = ".exe" if self.settings.os == "Windows" else "" pkgconfig_variables = { - 'datadir': '${prefix}/res', - 'bindir': '${prefix}/bin', - 'g_ir_scanner': '${bindir}/g-ir-scanner', - 'g_ir_compiler': '${bindir}/g-ir-compiler%s' % exe_ext, - 'g_ir_generate': '${bindir}/g-ir-generate%s' % exe_ext, - 'gidatadir': '${datadir}/gobject-introspection-1.0', - 'girdir': '${datadir}/gir-1.0', - 'typelibdir': '${libdir}/girepository-1.0', + "datadir": "${prefix}/res", + "bindir": "${prefix}/bin", + "libdir": "${prefix}/lib", + "g_ir_scanner": "${bindir}/g-ir-scanner", + "g_ir_compiler": "${bindir}/g-ir-compiler%s" % exe_ext, + "g_ir_generate": "${bindir}/g-ir-generate%s" % exe_ext, + "gidatadir": "${datadir}/gobject-introspection-1.0", + "girdir": "${datadir}/gir-1.0", + "typelibdir": "${libdir}/girepository-1.0", } 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()), + ) + self.buildenv_info.define_path("GI_GIR_PATH", os.path.join(self.package_folder, "res", "gir-1.0")) + self.buildenv_info.define_path("GI_TYPELIB_PATH", os.path.join(self.package_folder, "lib", "girepository-1.0")) + + # TODO: remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) + self.env_info.GI_GIR_PATH = os.path.join(self.package_folder, "res", "gir-1.0") + self.env_info.GI_TYPELIB_PATH = os.path.join(self.package_folder, "lib", "girepository-1.0") diff --git a/recipes/gobject-introspection/all/test_package/CMakeLists.txt b/recipes/gobject-introspection/all/test_package/CMakeLists.txt index 7b9b613cbb24a..228388b92ebea 100644 --- a/recipes/gobject-introspection/all/test_package/CMakeLists.txt +++ b/recipes/gobject-introspection/all/test_package/CMakeLists.txt @@ -1,8 +1,12 @@ -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(gobject-introspection REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(test_basic test_basic.c) +target_link_libraries(test_basic PRIVATE gobject-introspection::gobject-introspection) + +if(GLIB_INTROSPECTION_DATA_AVAILABLE) + add_executable(test_girepository test_girepository.c) + target_link_libraries(test_girepository PRIVATE gobject-introspection::gobject-introspection) +endif() diff --git a/recipes/gobject-introspection/all/test_package/conanfile.py b/recipes/gobject-introspection/all/test_package/conanfile.py index 32d4b65e5f11e..ec823a4f6e977 100644 --- a/recipes/gobject-introspection/all/test_package/conanfile.py +++ b/recipes/gobject-introspection/all/test_package/conanfile.py @@ -1,26 +1,57 @@ -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, CMakeToolchain +from conan.tools.files import save, load +from conan.tools.apple import is_apple_os + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package", "pkg_config" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build(self): - if self.settings.os != 'Windows': - with tools.environment_append({'PKG_CONFIG_PATH': "."}): - pkg_config = tools.PkgConfig("gobject-introspection-1.0") - for tool in ["g_ir_compiler", "g_ir_generate", "g_ir_scanner"]: - self.run('%s --version' % pkg_config.variables[tool], run_environment=True) - self.run('g-ir-annotation-tool --version', run_environment=True) - self.run('g-ir-inspect -h', run_environment=True) + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self) + def generate(self): + introspection_data = self.dependencies["glib"].options.shared and not is_apple_os(self) + tc = CMakeToolchain(self) + tc.variables["GLIB_INTROSPECTION_DATA_AVAILABLE"] = introspection_data + tc.generate() + save(self, os.path.join(self.build_folder, "gobject_introspection_data"), str(introspection_data)) + save(self, os.path.join(self.build_folder, "gobject_introspection_bin"), + self.dependencies["gobject-introspection"].cpp_info.bindirs[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) + if can_run(self): + if self.settings.os != "Windows": + gobject_introspection_bin = load(self, os.path.join(self.build_folder, "gobject_introspection_bin")) + gobject_introspection_data = load(self, os.path.join(self.build_folder, "gobject_introspection_data")) == "True" + for tool in ["g-ir-compiler", "g-ir-generate", "g-ir-scanner", "g-ir-annotation-tool"]: + if not gobject_introspection_data and tool in ["g-ir-scanner", "g-ir-annotation-tool"]: + continue + tool_path = os.path.join(gobject_introspection_bin, tool) + if os.path.exists(tool_path): + self.run(f"{tool_path} --version", env="conanrun") + else: + raise Exception(f"Tool {tool} not found in {gobject_introspection_bin}") + tool_path = os.path.join(gobject_introspection_bin, "g-ir-inspect") + if os.path.exists(tool_path): + self.run(f"{tool_path} -h", env="conanrun") + + bin_path = os.path.join(self.cpp.build.bindir, "test_basic") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_girepository") + if os.path.exists(bin_path): + self.run(bin_path, env="conanrun") diff --git a/recipes/gobject-introspection/all/test_package/test_basic.c b/recipes/gobject-introspection/all/test_package/test_basic.c new file mode 100644 index 0000000000000..44d8cd552ebdd --- /dev/null +++ b/recipes/gobject-introspection/all/test_package/test_basic.c @@ -0,0 +1,12 @@ +#include +#include + +#include "girepository.h" + +int main(void) { + printf("gobject introspection version %d.%d.%d\n", + gi_get_major_version(), + gi_get_minor_version(), + gi_get_micro_version()); + return EXIT_SUCCESS; +} diff --git a/recipes/gobject-introspection/all/test_package/test_girepository.c b/recipes/gobject-introspection/all/test_package/test_girepository.c new file mode 100644 index 0000000000000..d6994f8155c80 --- /dev/null +++ b/recipes/gobject-introspection/all/test_package/test_girepository.c @@ -0,0 +1,7 @@ +#include +#include "girepository.h" + +int main() { + GIRepository* repository = g_irepository_get_default(); + return EXIT_SUCCESS; +} diff --git a/recipes/gobject-introspection/all/test_package/test_package.c b/recipes/gobject-introspection/all/test_package/test_package.c deleted file mode 100644 index c1b18cd52e49e..0000000000000 --- a/recipes/gobject-introspection/all/test_package/test_package.c +++ /dev/null @@ -1,12 +0,0 @@ -#include - -#include "girepository.h" - -int main(int argc, char **argv) -{ - printf("gobject introspection version %d.%d.%d\n", - gi_get_major_version(), - gi_get_minor_version(), - gi_get_micro_version()); - return 0; -} diff --git a/recipes/gobject-introspection/config.yml b/recipes/gobject-introspection/config.yml index 06afabf3f5bc4..42a826aff4ed3 100644 --- a/recipes/gobject-introspection/config.yml +++ b/recipes/gobject-introspection/config.yml @@ -1,13 +1,5 @@ versions: - "1.72.0": - folder: all - "1.70.0": - folder: all - "1.69.0": + "1.78.1": folder: all - "1.68.0": - folder: all - "1.67.1": - folder: all - "1.66.1": + "1.72.0": folder: all diff --git a/recipes/godot-cpp/all/conanfile.py b/recipes/godot-cpp/all/conanfile.py index 625aabfb6d902..a99c635a67338 100644 --- a/recipes/godot-cpp/all/conanfile.py +++ b/recipes/godot-cpp/all/conanfile.py @@ -1,8 +1,16 @@ -import glob import os -from conans import 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.env import VirtualBuildEnv +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.53.0" class GodotCppConan(ConanFile): @@ -12,20 +20,81 @@ class GodotCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/godotengine/godot-cpp" topics = ("game-engine", "game-development", "c++") + + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" - build_requires = ["scons/3.1.2"] + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires(f"godot_headers/{self.version}", transitive_headers=True) + + def package_id(self): + if self.info.settings.build_type != "Debug": + self.info.settings.build_type = "Release" + + def validate(self): + minimal_cpp_standard = 14 + if self.settings.compiler.cppstd: + check_min_cppstd(self, minimal_cpp_standard) + + minimal_version = { + "gcc": "5", + "clang": "4", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + + compiler = str(self.settings.compiler) + if compiler not in minimal_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++{minimal_cpp_standard}" + ) + return + + version = Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + if compiler in ["apple-clang", "clang"]: + raise ConanInvalidConfiguration( + f"{self.name} requires a clang version that supports the '-Og' flag" + ) + raise ConanInvalidConfiguration( + f"{self.name} requires a compiler that supports at least C++{minimal_cpp_standard}" + ) + + def build_requirements(self): + self.tool_requires("scons/4.3.0") @property def _bits(self): - return 64 if self.settings.get_safe("arch") in ["x86_64", "armv8"] else 32 + return 32 if self.settings.arch in ["x86"] else 64 + + @property + def _godot_headers(self): + return self.dependencies["godot_headers"].cpp_info @property def _custom_api_file(self): - return "{}/api.json".format(self._godot_headers.res_paths[0]) + return f"{self._godot_headers.resdirs[0]}/api.json" @property def _headers_dir(self): - return self._godot_headers.include_paths[0] + return self._godot_headers.includedirs[0] @property def _platform(self): @@ -34,98 +103,67 @@ def _platform(self): "Linux": "linux", "Macos": "osx", } - return flag_map[self.settings.get_safe("os")] + return flag_map[str(self.settings.os)] @property def _target(self): - return "debug" if self.settings.get_safe("build_type") == "Debug" else "release" + return "debug" if self.settings.build_type == "Debug" else "release" @property def _use_llvm(self): - return self.settings.get_safe("compiler") in ["clang", "apple-clang"] + return self.settings.compiler in ["clang", "apple-clang"] @property def _use_mingw(self): - return self._platform == "windows" and self.settings.compiler == "gcc" + return self.settings.os == "Windows" and self.settings.compiler == "gcc" @property def _libname(self): - return "godot-cpp.{platform}.{target}.{bits}".format(platform=self._platform, target=self._target, bits=self._bits) - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _godot_headers(self): - return self.deps_cpp_info["godot_headers"] + return f"godot-cpp.{self._platform}.{self._target}.{self._bits}" def source(self): - tools.get(**self.conan_data["sources"][self.version]) - tools.rename(glob.glob("godot-cpp-*")[0], self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def requirements(self): - self.requires("godot_headers/{}".format(self.version)) - - def configure(self): - minimal_cpp_standard = "14" - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_cpp_standard) - - minimal_version = { - "gcc": "5", - "clang": "4", - "apple-clang": "10", - "Visual Studio": "15", - } - - compiler = str(self.settings.compiler) - if compiler not in minimal_version: - self.output.warn( - "{} recipe lacks information about the {} compiler standard version support".format(self.name, compiler)) - self.output.warn( - "{} requires a compiler that supports at least C++{}".format(self.name, minimal_cpp_standard)) - return - - version = tools.Version(self.settings.compiler.version) - if version < minimal_version[compiler]: - if compiler in ["apple-clang", "clang"]: - raise ConanInvalidConfiguration( - "{} requires a clang version that supports the '-Og' flag".format(self.name)) - raise ConanInvalidConfiguration( - "{} requires a compiler that supports at least C++{}".format(self.name, minimal_cpp_standard)) + def generate(self): + VirtualBuildEnv(self).generate() def build(self): self.run("python --version") - if self.settings.os == "Macos": + if is_apple_os(self): self.run("which python") self.run("scons --version") - self.run( - " ".join([ - "scons", - "-C{}".format(self._source_subfolder), - "-j{}".format(tools.cpu_count()), - "generate_bindings=yes", - "use_custom_api_file=yes", - "bits={}".format(self._bits), - "custom_api_file={}".format(self._custom_api_file), - "headers_dir={}".format(self._headers_dir), - "platform={}".format(self._platform), - "target={}".format(self._target), - "use_llvm={}".format(self._use_llvm), - "use_mingw={}".format(self._use_mingw), - ]) - ) + self.run(" ".join([ + "scons", + f"-C{self.source_folder}", + f"-j{os.cpu_count()}", + "generate_bindings=yes", + "use_custom_api_file=yes", + f"bits={self._bits}", + f"custom_api_file={self._custom_api_file}", + f"headers_dir={self._headers_dir}", + f"platform={self._platform}", + f"target={self._target}", + f"use_llvm={self._use_llvm}", + f"use_mingw={self._use_mingw}", + ])) def package(self): - self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) - self.copy("*.hpp", dst="include/godot-cpp", src=os.path.join(self._source_subfolder, "include")) - self.copy("*.a", dst="lib", src=os.path.join(self._source_subfolder, "bin")) - self.copy("*.lib", dst="lib", src=os.path.join(self._source_subfolder, "bin")) + 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/godot-cpp"), + src=os.path.join(self.source_folder, "include")) + copy(self, "*.a", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.source_folder, "bin")) + copy(self, "*.lib", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.source_folder, "bin")) def package_info(self): - if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio": - self.cpp_info.libs = ["lib{}".format(self._libname)] + if is_msvc(self): + self.cpp_info.libs = [f"lib{self._libname}"] else: self.cpp_info.libs = [self._libname] @@ -134,9 +172,3 @@ def package_info(self): os.path.join("include", "godot-cpp", "core"), os.path.join("include", "godot-cpp", "gen"), ] - - def package_id(self): - if self._target == "release": - self.info.settings.build_type = "Release" - else: - self.info.settings.build_type = "Debug" diff --git a/recipes/godot-cpp/all/test_package/CMakeLists.txt b/recipes/godot-cpp/all/test_package/CMakeLists.txt index cb623ce6ed58f..49d358aeae0ef 100644 --- a/recipes/godot-cpp/all/test_package/CMakeLists.txt +++ b/recipes/godot-cpp/all/test_package/CMakeLists.txt @@ -1,9 +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() +find_package(godot-cpp 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") +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} godot-cpp::godot-cpp) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/godot-cpp/all/test_package/conanfile.py b/recipes/godot-cpp/all/test_package/conanfile.py index 4dea15a1318e1..ef5d7042163ec 100644 --- a/recipes/godot-cpp/all/test_package/conanfile.py +++ b/recipes/godot-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", "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/godot_headers/all/conandata.yml b/recipes/godot_headers/all/conandata.yml index de60664696e4b..8f004a1d2a043 100644 --- a/recipes/godot_headers/all/conandata.yml +++ b/recipes/godot_headers/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/godot_headers/all/test_package/CMakeLists.txt b/recipes/godot_headers/all/test_package/CMakeLists.txt index 60556215726fc..ad8303b50e451 100644 --- a/recipes/godot_headers/all/test_package/CMakeLists.txt +++ b/recipes/godot_headers/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(godot_headers REQUIRED CONFIG) diff --git a/recipes/godot_headers/all/test_v1_package/CMakeLists.txt b/recipes/godot_headers/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/godot_headers/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/godot_headers/all/test_v1_package/conanfile.py b/recipes/godot_headers/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/godot_headers/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_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/godot_headers/config.yml b/recipes/godot_headers/config.yml index 07764b9a8e270..6aadd92e7a3d8 100644 --- a/recipes/godot_headers/config.yml +++ b/recipes/godot_headers/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.3": + folder: all "3.5.2": folder: all "3.5.1": 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 deleted file mode 100644 index 943f3345fcb41..0000000000000 --- a/recipes/google-cloud-cpp/2.x/components_2_12_0.py +++ /dev/null @@ -1,411 +0,0 @@ -# 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_19_0.py b/recipes/google-cloud-cpp/2.x/components_2_19_0.py new file mode 100644 index 0000000000000..704bb08158fe3 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/components_2_19_0.py @@ -0,0 +1,695 @@ +# 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', 'longrunning_operations_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'], + "config_protos": ['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'], + "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', 'type_interval_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'], + "edgenetwork_protos": ['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'], + "netapp_protos": ['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'], + "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', 'rpc_status_protos'], + "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'], + "securesourcemanager_protos": ['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'], + "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_resource_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'], + "sql_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'], + "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'], + "telcoautomation_protos": ['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'], + "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'], + "compute_internal_protos": ["protobuf::libprotobuf"], + "cloud_extended_operations_protos": ["protobuf::libprotobuf"], + "compute_accelerator_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_addresses_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_autoscalers_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_backend_buckets_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_backend_services_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_disk_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_disks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_external_vpn_gateways_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_firewall_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_firewalls_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_forwarding_rules_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_addresses_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_forwarding_rules_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_network_endpoint_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_operations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_organization_operations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_global_public_delegated_prefixes_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_health_checks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_http_health_checks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_https_health_checks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_image_family_views_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_images_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_instance_group_managers_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_instance_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_instance_templates_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_instances_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_interconnect_attachments_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_interconnect_locations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_interconnects_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_license_codes_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_licenses_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_machine_images_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_machine_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_network_attachments_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_network_edge_security_services_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_network_endpoint_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_network_firewall_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_networks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_node_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_node_templates_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_node_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_packet_mirrorings_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_projects_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_public_advertised_prefixes_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_public_delegated_prefixes_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_autoscalers_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_backend_services_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_commitments_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_disk_types_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_disks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_health_check_services_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_health_checks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_instance_group_managers_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_instance_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_instance_templates_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_instances_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_network_endpoint_groups_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_network_firewall_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_notification_endpoints_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_operations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_security_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_region_ssl_certificates_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_ssl_policies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_subnetworks_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_grpc_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_http_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_https_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_instances_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_pools_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_ssl_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_tcp_proxies_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_target_vpn_gateways_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_url_maps_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_vpn_gateways_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_vpn_tunnels_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_zone_operations_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], + "compute_zones_protos": ["compute_internal_protos", "cloud_extended_operations_protos", "protobuf::libprotobuf"], +} + +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", + "cloud_extended_operations_protos", + "cloudbuild_protos", + "commerce_protos", + "composer_protos", + "compute_accelerator_types_protos", + "compute_addresses_protos", + "compute_autoscalers_protos", + "compute_backend_buckets_protos", + "compute_backend_services_protos", + "compute_disk_types_protos", + "compute_disks_protos", + "compute_external_vpn_gateways_protos", + "compute_firewall_policies_protos", + "compute_firewalls_protos", + "compute_forwarding_rules_protos", + "compute_global_addresses_protos", + "compute_global_forwarding_rules_protos", + "compute_global_network_endpoint_groups_protos", + "compute_global_operations_protos", + "compute_global_organization_operations_protos", + "compute_global_public_delegated_prefixes_protos", + "compute_health_checks_protos", + "compute_http_health_checks_protos", + "compute_https_health_checks_protos", + "compute_image_family_views_protos", + "compute_images_protos", + "compute_instance_group_managers_protos", + "compute_instance_groups_protos", + "compute_instance_templates_protos", + "compute_instances_protos", + "compute_interconnect_attachments_protos", + "compute_interconnect_locations_protos", + "compute_interconnects_protos", + "compute_internal_protos", + "compute_license_codes_protos", + "compute_licenses_protos", + "compute_machine_images_protos", + "compute_machine_types_protos", + "compute_network_attachments_protos", + "compute_network_edge_security_services_protos", + "compute_network_endpoint_groups_protos", + "compute_network_firewall_policies_protos", + "compute_networks_protos", + "compute_node_groups_protos", + "compute_node_templates_protos", + "compute_node_types_protos", + "compute_packet_mirrorings_protos", + "compute_projects_protos", + "compute_public_advertised_prefixes_protos", + "compute_public_delegated_prefixes_protos", + "compute_region_autoscalers_protos", + "compute_region_backend_services_protos", + "compute_region_commitments_protos", + "compute_region_disk_types_protos", + "compute_region_disks_protos", + "compute_region_health_check_services_protos", + "compute_region_health_checks_protos", + "compute_region_instance_group_managers_protos", + "compute_region_instance_groups_protos", + "compute_region_instance_templates_protos", + "compute_region_instances_protos", + "compute_region_network_endpoint_groups_protos", + "compute_region_network_firewall_policies_protos", + "compute_region_notification_endpoints_protos", + "compute_region_operations_protos", + "compute_region_security_policies_protos", + "compute_region_ssl_certificates_protos", + "compute_ssl_policies_protos", + "compute_subnetworks_protos", + "compute_target_grpc_proxies_protos", + "compute_target_http_proxies_protos", + "compute_target_https_proxies_protos", + "compute_target_instances_protos", + "compute_target_pools_protos", + "compute_target_ssl_proxies_protos", + "compute_target_tcp_proxies_protos", + "compute_target_vpn_gateways_protos", + "compute_url_maps_protos", + "compute_vpn_gateways_protos", + "compute_vpn_tunnels_protos", + "compute_zone_operations_protos", + "compute_zones_protos", + "confidentialcomputing_protos", + "config_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", + "edgenetwork_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", + "netapp_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", + "securesourcemanager_protos", + "securitycenter_protos", + "servicecontrol_protos", + "servicedirectory_protos", + "servicemanagement_protos", + "serviceusage_protos", + "shell_protos", + "spanner_protos", + "speech_protos", + "sql_protos", + "storage_protos", + "storageinsights_protos", + "storagetransfer_protos", + "support_protos", + "talent_protos", + "tasks_protos", + "telcoautomation_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", + "compute_accelerator_types", + "compute_addresses", + "compute_autoscalers", + "compute_backend_buckets", + "compute_backend_services", + "compute_disk_types", + "compute_disks", + "compute_external_vpn_gateways", + "compute_firewall_policies", + "compute_firewalls", + "compute_forwarding_rules", + "compute_global_addresses", + "compute_global_forwarding_rules", + "compute_global_network_endpoint_groups", + "compute_global_operations", + "compute_global_organization_operations", + "compute_global_public_delegated_prefixes", + "compute_health_checks", + "compute_http_health_checks", + "compute_https_health_checks", + "compute_image_family_views", + "compute_images", + "compute_instance_group_managers", + "compute_instance_groups", + "compute_instance_templates", + "compute_instances", + "compute_interconnect_attachments", + "compute_interconnect_locations", + "compute_interconnects", + "compute_license_codes", + "compute_licenses", + "compute_machine_images", + "compute_machine_types", + "compute_network_attachments", + "compute_network_edge_security_services", + "compute_network_endpoint_groups", + "compute_network_firewall_policies", + "compute_networks", + "compute_node_groups", + "compute_node_templates", + "compute_node_types", + "compute_packet_mirrorings", + "compute_projects", + "compute_public_advertised_prefixes", + "compute_public_delegated_prefixes", + "compute_region_autoscalers", + "compute_region_backend_services", + "compute_region_commitments", + "compute_region_disk_types", + "compute_region_disks", + "compute_region_health_check_services", + "compute_region_health_checks", + "compute_region_instance_group_managers", + "compute_region_instance_groups", + "compute_region_instance_templates", + "compute_region_instances", + "compute_region_network_endpoint_groups", + "compute_region_network_firewall_policies", + "compute_region_notification_endpoints", + "compute_region_operations", + "compute_region_security_policies", + "compute_region_ssl_certificates", + "compute_ssl_policies", + "compute_subnetworks", + "compute_target_grpc_proxies", + "compute_target_http_proxies", + "compute_target_https_proxies", + "compute_target_instances", + "compute_target_pools", + "compute_target_ssl_proxies", + "compute_target_tcp_proxies", + "compute_target_vpn_gateways", + "compute_url_maps", + "compute_vpn_gateways", + "compute_vpn_tunnels", + "compute_zone_operations", + "compute_zones", + "confidentialcomputing", + "config", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "contentwarehouse", + "datacatalog", + "datafusion", + "datamigration", + "dataplex", + "dataproc", + "datastore", + "datastream", + "deploy", + "dialogflow_cx", + "dialogflow_es", + "discoveryengine", + "dlp", + "documentai", + "domains", + "edgecontainer", + "edgenetwork", + "essentialcontacts", + "eventarc", + "filestore", + "functions", + "gkebackup", + "gkehub", + "gkemulticloud", + "iam", + "iap", + "ids", + "kms", + "language", + "logging", + "managedidentities", + "memcache", + "metastore", + "migrationcenter", + "monitoring", + "netapp", + "networkconnectivity", + "networkmanagement", + "networksecurity", + "networkservices", + "notebooks", + "oauth2", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policysimulator", + "policytroubleshooter", + "privateca", + "profiler", + "pubsub", + "rapidmigrationassessment", + "recaptchaenterprise", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securesourcemanager", + "securitycenter", + "servicecontrol", + "servicedirectory", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "sql", + "storage", + "storageinsights", + "storagetransfer", + "support", + "talent", + "tasks", + "telcoautomation", + "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_28_0.py b/recipes/google-cloud-cpp/2.x/components_2_28_0.py new file mode 100644 index 0000000000000..dafa862192730 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/components_2_28_0.py @@ -0,0 +1,573 @@ +# Automatically generated by /usr/local/google/home/dbolduc/code/git/conan-center-index/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_date_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_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "apphub_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_field_info_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', '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'], + "backupdr_protos": ['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_field_info_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', 'longrunning_operations_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_date_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'], + "cloudcontrolspartner_protos": ['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_interval_protos'], + "cloudquotas_protos": ['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'], + "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'], + "config_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_field_info_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', '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', 'type_interval_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'], + "developerconnect_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_field_info_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_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'], + "edgenetwork_protos": ['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', 'type_date_protos', 'type_dayofweek_protos', 'type_timeofday_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', 'type_date_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++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "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_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'], + "managedkafka_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_field_info_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', 'type_interval_protos'], + "netapp_protos": ['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'], + "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_field_info_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_field_info_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'], + "privilegedaccessmanager_protos": ['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'], + "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'], + "publicca_protos": ['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_field_info_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'protobuf::libprotobuf', 'rpc_status_protos'], + "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'], + "securesourcemanager_protos": ['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'], + "securitycenter_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'], + "securitycentermanagement_protos": ['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', '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_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'], + "servicehealth_protos": ['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'], + "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_resource_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_field_info_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos'], + "sql_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'], + "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'], + "storagecontrol_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_field_info_protos', 'api_http_protos', 'api_launch_stage_protos', 'api_resource_protos', 'api_routing_protos', 'grpc::_grpc', 'grpc::grpc++', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_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'], + "telcoautomation_protos": ['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'], + "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++', 'iam_v1_policy_protos', 'longrunning_operations_protos', 'protobuf::libprotobuf', 'rpc_status_protos', 'type_expr_protos'], + "video_protos": ['api_annotations_protos', 'api_client_protos', 'api_field_behavior_protos', 'api_field_info_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_field_info_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'], + "cloud_extended_operations_protos": ["protobuf::libprotobuf"], + "compute_protos": ["cloud_extended_operations_protos", "protobuf::libprotobuf"], +} + +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_field_info_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", + "apphub_protos", + "artifactregistry_protos", + "asset_protos", + "assuredworkloads_protos", + "automl_protos", + "backupdr_protos", + "baremetalsolution_protos", + "batch_protos", + "beyondcorp_protos", + "bigquery_protos", + "bigtable_protos", + "billing_protos", + "binaryauthorization_protos", + "certificatemanager_protos", + "channel_protos", + "cloud_common_common_protos", + "cloud_extended_operations_protos", + "cloudbuild_protos", + "cloudcontrolspartner_protos", + "cloudquotas_protos", + "commerce_protos", + "composer_protos", + "compute_protos", + "confidentialcomputing_protos", + "config_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", + "developerconnect_protos", + "dialogflow_cx_protos", + "dialogflow_es_protos", + "discoveryengine_protos", + "dlp_protos", + "documentai_protos", + "domains_protos", + "edgecontainer_protos", + "edgenetwork_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", + "longrunning_operations_protos", + "managedidentities_protos", + "managedkafka_protos", + "memcache_protos", + "metastore_protos", + "migrationcenter_protos", + "monitoring_protos", + "netapp_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", + "privilegedaccessmanager_protos", + "profiler_protos", + "publicca_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", + "securesourcemanager_protos", + "securitycenter_protos", + "securitycentermanagement_protos", + "servicecontrol_protos", + "servicedirectory_protos", + "servicehealth_protos", + "servicemanagement_protos", + "serviceusage_protos", + "shell_protos", + "spanner_protos", + "speech_protos", + "sql_protos", + "storage_protos", + "storagecontrol_protos", + "storageinsights_protos", + "storagetransfer_protos", + "support_protos", + "talent_protos", + "tasks_protos", + "telcoautomation_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", + "apphub", + "artifactregistry", + "asset", + "assuredworkloads", + "automl", + "backupdr", + "baremetalsolution", + "batch", + "beyondcorp", + "bigquery", + "bigtable", + "billing", + "binaryauthorization", + "certificatemanager", + "channel", + "cloudbuild", + "cloudcontrolspartner", + "cloudquotas", + "commerce", + "composer", + "compute_accelerator_types", + "compute_addresses", + "compute_autoscalers", + "compute_backend_buckets", + "compute_backend_services", + "compute_disk_types", + "compute_disks", + "compute_external_vpn_gateways", + "compute_firewall_policies", + "compute_firewalls", + "compute_forwarding_rules", + "compute_global_addresses", + "compute_global_forwarding_rules", + "compute_global_network_endpoint_groups", + "compute_global_operations", + "compute_global_organization_operations", + "compute_global_public_delegated_prefixes", + "compute_health_checks", + "compute_http_health_checks", + "compute_https_health_checks", + "compute_image_family_views", + "compute_images", + "compute_instance_group_managers", + "compute_instance_groups", + "compute_instance_templates", + "compute_instances", + "compute_interconnect_attachments", + "compute_interconnect_locations", + "compute_interconnects", + "compute_license_codes", + "compute_licenses", + "compute_machine_images", + "compute_machine_types", + "compute_network_attachments", + "compute_network_edge_security_services", + "compute_network_endpoint_groups", + "compute_network_firewall_policies", + "compute_networks", + "compute_node_groups", + "compute_node_templates", + "compute_node_types", + "compute_packet_mirrorings", + "compute_projects", + "compute_public_advertised_prefixes", + "compute_public_delegated_prefixes", + "compute_region_autoscalers", + "compute_region_backend_services", + "compute_region_commitments", + "compute_region_disk_types", + "compute_region_disks", + "compute_region_health_check_services", + "compute_region_health_checks", + "compute_region_instance_group_managers", + "compute_region_instance_groups", + "compute_region_instance_templates", + "compute_region_instances", + "compute_region_network_endpoint_groups", + "compute_region_network_firewall_policies", + "compute_region_notification_endpoints", + "compute_region_operations", + "compute_region_security_policies", + "compute_region_ssl_certificates", + "compute_ssl_policies", + "compute_subnetworks", + "compute_target_grpc_proxies", + "compute_target_http_proxies", + "compute_target_https_proxies", + "compute_target_instances", + "compute_target_pools", + "compute_target_ssl_proxies", + "compute_target_tcp_proxies", + "compute_target_vpn_gateways", + "compute_url_maps", + "compute_vpn_gateways", + "compute_vpn_tunnels", + "compute_zone_operations", + "compute_zones", + "confidentialcomputing", + "config", + "connectors", + "contactcenterinsights", + "container", + "containeranalysis", + "contentwarehouse", + "datacatalog", + "datafusion", + "datamigration", + "dataplex", + "dataproc", + "datastore", + "datastream", + "deploy", + "developerconnect", + "dialogflow_cx", + "dialogflow_es", + "discoveryengine", + "dlp", + "documentai", + "domains", + "edgecontainer", + "edgenetwork", + "essentialcontacts", + "eventarc", + "filestore", + "functions", + "gkebackup", + "gkehub", + "gkemulticloud", + "iam", + "iap", + "ids", + "kms", + "language", + "logging", + "managedidentities", + "managedkafka", + "memcache", + "metastore", + "migrationcenter", + "monitoring", + "netapp", + "networkconnectivity", + "networkmanagement", + "networksecurity", + "networkservices", + "notebooks", + "oauth2", + "optimization", + "orgpolicy", + "osconfig", + "oslogin", + "policysimulator", + "policytroubleshooter", + "privateca", + "privilegedaccessmanager", + "profiler", + "publicca", + "pubsub", + "rapidmigrationassessment", + "recaptchaenterprise", + "recommender", + "redis", + "resourcemanager", + "resourcesettings", + "retail", + "run", + "scheduler", + "secretmanager", + "securesourcemanager", + "securitycenter", + "securitycentermanagement", + "servicecontrol", + "servicedirectory", + "servicehealth", + "servicemanagement", + "serviceusage", + "shell", + "spanner", + "speech", + "sql", + "storage", + "storagecontrol", + "storageinsights", + "storagetransfer", + "support", + "talent", + "tasks", + "telcoautomation", + "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 deleted file mode 100644 index 9244c68af5641..0000000000000 --- a/recipes/google-cloud-cpp/2.x/components_2_5_0.py +++ /dev/null @@ -1,364 +0,0 @@ -# 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/conandata.yml b/recipes/google-cloud-cpp/2.x/conandata.yml index dfb3c94da034e..65a9e8f5f8351 100644 --- a/recipes/google-cloud-cpp/2.x/conandata.yml +++ b/recipes/google-cloud-cpp/2.x/conandata.yml @@ -1,39 +1,26 @@ 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" + "2.19.0": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.19.0.tar.gz" + sha256: "63f009092afd900cb812050bcecf607e37d762ac911e0bcbf4af9a432da91890" + "2.28.0": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.28.0.tar.gz" + sha256: "1d51910cb4419f6100d8b9df6bccd33477d09f50e378f12b06dae0f137ed7bc6" patches: - "2.5.0": - - 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" - patch_type: backport - - patch_file: "patches/2.5.0/003-use-conan-msvc-runtime.patch" + "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 - - 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" + "2.19.0": + - patch_file: "patches/2.19.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_file: "patches/2.19.0/002-add-find-package-threads.patch" + patch_description: "Missing find_package() in CMake files" + patch_type: conan + "2.28.0": + - patch_file: "patches/2.28.0/001-add-find-package-threads.patch" + patch_description: "Missing find_package() in CMake files" patch_type: conan diff --git a/recipes/google-cloud-cpp/2.x/conanfile.py b/recipes/google-cloud-cpp/2.x/conanfile.py index e3b497dfc81db..bf23faefd5366 100644 --- a/recipes/google-cloud-cpp/2.x/conanfile.py +++ b/recipes/google-cloud-cpp/2.x/conanfile.py @@ -3,7 +3,7 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd, cross_building from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.env import VirtualRunEnv +from conan.tools.env import VirtualBuildEnv, 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 @@ -19,9 +19,9 @@ # 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 +import components_2_19_0 +import components_2_28_0 required_conan_version = ">=1.56.0" @@ -45,33 +45,37 @@ 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", + exports = ["components_2_15_1.py", + "components_2_19_0.py", + "components_2_28_0.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, + '2.19.0': components_2_19_0.COMPONENTS, + '2.28.0': components_2_28_0.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, + '2.19.0': components_2_19_0.PROTO_COMPONENTS, + '2.28.0': components_2_28_0.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, + "2.19.0": components_2_19_0.DEPENDENCIES, + "2.28.0": components_2_28_0.DEPENDENCIES, } # Some components require custom dependency definitions. _REQUIRES_CUSTOM_DEPENDENCIES = { - "bigquery", "bigtable", "iam", "pubsub", "spanner", "storage", + "bigquery", "bigtable", "iam", "oauth2", "pubsub", "spanner", "storage", } + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def export_sources(self): export_conandata_patches(self) @@ -99,19 +103,20 @@ def validate(self): "Recipe not prepared for cross-building (yet)" ) - if self.version not in self._GA_COMPONENTS: + if str(self.version) not in self._GA_COMPONENTS: + print(f"{type(self.version)} {self.version}") raise ConanInvalidConfiguration( - "The components are unknown for version %s" % self.version + f"The components are unknown for version {self.version}. Expected one of {self._GA_COMPONENTS.keys()}" ) - if self.version not in self._PROTO_COMPONENTS: + if str(self.version) not in self._PROTO_COMPONENTS: raise ConanInvalidConfiguration( - "The proto components are unknown for version %s" % self.version + f"The proto components are unknown for version {self.version}. Expected one of {self._PROTO_COMPONENTS.keys()}" ) - if self.version not in self._PROTO_COMPONENT_DEPENDENCIES: + if str(self.version) not in self._PROTO_COMPONENT_DEPENDENCIES: raise ConanInvalidConfiguration( - "The inter-component dependencies are unknown for version %s" % self.version + f"The inter-component components are unknown for version {self.version}. Expected one of {self._PROTO_COMPONENT_DEPENDENCIES.keys()}" ) if ( @@ -145,9 +150,9 @@ def source(self): def requirements(self): # 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("abseil/[>=20230125.3 <=20230802.1]", transitive_headers=True) self.requires("grpc/1.54.3", transitive_headers=True) - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.3") self.requires("crc32c/1.1.2") # The rest require less pinning. self.requires("libcurl/[>=7.78 <9]") @@ -156,16 +161,20 @@ def requirements(self): def build_requirements(self): # For the `grpc-cpp-plugin` executable, and indirectly `protoc` - self.tool_requires("grpc/") + if not self._is_legacy_one_profile: + self.tool_requires("grpc/") def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + tc.variables["GOOGLE_CLOUD_CPP_WITH_MOCKS"] = 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") + VirtualBuildEnv(self).generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") deps = CMakeDeps(self) deps.generate() @@ -178,14 +187,9 @@ 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": - 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') + 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() @@ -206,13 +210,10 @@ def _generate_proto_requires(self, component): '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.get(self.version, []).copy() + result = self._GA_COMPONENTS.get(str(self.version), []).copy() for c in self._SKIPPED_COMPONENTS: result.remove(c) # TODO - these do not build on Android due to conflicts between OS @@ -220,6 +221,8 @@ def _components(self): if self.settings.os == "Android": result.remove('accesscontextmanager') result.remove('talent') + if self.settings.os == "Windows" and Version(self.version) >= '2.28.0': + result.remove('securitycenter') return result def _proto_components(self): @@ -231,11 +234,14 @@ def _proto_components(self): if self.settings.os == "Android": result.remove('accesscontextmanager_protos') result.remove('talent_protos') - if Version(self.version) >= '2.15.1': - # This was converted to an interface library starting on 2.15.1 + if Version(self.version) <= '2.19.0': + # Handling of these proto libraries was simplified in the 2.28.0 + # `conanfile.py`. We prefer not to regenerate the old + # `components_*.py` files, so we manually skip the protos in here. 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') + if self.settings.os == "Windows" and Version(self.version) >= '2.28.0': + result.remove('securitycenter_protos') return result def package(self): @@ -256,6 +262,24 @@ def _add_grpc_component(self, component, protos, extra=None): self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" + # The compute librar(ies) do not use gRPC, and they have many components + # with dependencies between them + def _add_compute_component(self, component, protos): + SHARED_REQUIRES=["rest_protobuf_internal", "rest_internal", "common"] + # Common components shared by other compute components + COMPUTE_COMMON_COMPONENTS = [ + 'compute_global_operations', + 'compute_global_organization_operations', + 'compute_region_operations', + 'compute_zone_operations', + ] + requires = [protos] + if component not in COMPUTE_COMMON_COMPONENTS: + requires = requires + COMPUTE_COMMON_COMPONENTS + self.cpp_info.components[component].requires = requires + SHARED_REQUIRES + self.cpp_info.components[component].libs = [f"google_cloud_cpp_{component}"] + self.cpp_info.components[component].names["pkg_config"] = f"google_cloud_cpp_{component}" + def package_info(self): self.cpp_info.components["common"].requires = ["abseil::absl_any", "abseil::absl_flat_hash_map", "abseil::absl_memory", "abseil::absl_optional", "abseil::absl_time"] self.cpp_info.components["common"].libs = ["google_cloud_cpp_common"] @@ -263,25 +287,17 @@ def package_info(self): self.cpp_info.components["rest_internal"].requires = ["common", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] self.cpp_info.components["rest_internal"].libs = ["google_cloud_cpp_rest_internal"] - self.cpp_info.components["rest_internal"].names["pkg_config"] = "google_cloud_cpp_common" + self.cpp_info.components["rest_internal"].names["pkg_config"] = "google_cloud_cpp_rest_internal" # A small number of gRPC-generated stubs are used directly in the common components # shared by all gRPC-based libraries. These must be defined without reference to `grpc_utils`. - 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", - } + GRPC_UTILS_REQUIRED_PROTOS = { + "iam_credentials_v1_iamcredentials_protos", + "iam_v1_policy_protos", + "longrunning_operations_protos", + "rpc_error_details_protos", + "rpc_status_protos", + } for component in GRPC_UTILS_REQUIRED_PROTOS: self._add_proto_component(component) @@ -290,45 +306,32 @@ def package_info(self): self.cpp_info.components["grpc_utils"].names["pkg_config"] = "google_cloud_cpp_grpc_utils" for component in self._proto_components(): - if Version(self.version) >= '2.15.1' and component == 'storage_protos': - # Starting with v2.15.1 the `storage_protos` are compiled only - # when needed. They are not used in Conan because they are only - # needed for an experimental library, supporting an allow-listed - # service. + if component == 'storage_protos': + # 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"] + 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' 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' and Version(self.version) < '2.15.1': - self._add_proto_component("cloud_dialogflow_v2_protos") - self._add_grpc_component(component, "cloud_dialogflow_v2_protos") + # `compute` components do not depend on gRPC + if component.startswith("compute_"): + # Individual compute proto libraries were replaced with a single + # `compute_protos` library. + if Version(self.version) >= '2.28.0': + protos = "compute_protos" + self._add_compute_component(component, protos) continue # `storage` is the only component that does not depend on a matching `*_protos` library if component in self._REQUIRES_CUSTOM_DEPENDENCIES: @@ -340,6 +343,18 @@ def package_info(self): self._add_grpc_component("pubsub", "pubsub_protos", ["abseil::absl_flat_hash_map"]) self._add_grpc_component("spanner", "spanner_protos", ["abseil::absl_fixed_array", "abseil::absl_numeric", "abseil::absl_strings", "abseil::absl_time"]) + if Version(self.version) >= '2.19.0': + self.cpp_info.components["rest_protobuf_internal"].requires = ["rest_internal", "grpc_utils", "common"] + self.cpp_info.components["rest_protobuf_internal"].libs = ["google_cloud_cpp_rest_protobuf_internal"] + self.cpp_info.components["rest_protobuf_internal"].names["pkg_config"] = "google_cloud_cpp_rest_protobuf_internal" + # The `google-cloud-cpp::compute` interface library groups all the compute + # libraries in a single target. + self.cpp_info.components["compute"].requires = [c for c in self._components() if c.startswith("compute_")] + # The `google-cloud-cpp::oauth2` library does not depend on gRPC or any protos. + self.cpp_info.components["oauth2"].requires = ["rest_internal", "common", "nlohmann_json::nlohmann_json", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] + self.cpp_info.components["oauth2"].libs = ["google_cloud_cpp_oauth2"] + self.cpp_info.components["oauth2"].names["pkg_config"] = "google_cloud_cpp_oauth2" + self.cpp_info.components["storage"].requires = ["rest_internal", "common", "nlohmann_json::nlohmann_json", "abseil::absl_memory", "abseil::absl_strings", "abseil::absl_str_format", "abseil::absl_time", "abseil::absl_variant", "crc32c::crc32c", "libcurl::libcurl", "openssl::ssl", "openssl::crypto", "zlib::zlib"] self.cpp_info.components["storage"].libs = ["google_cloud_cpp_storage"] self.cpp_info.components["storage"].names["pkg_config"] = "google_cloud_cpp_storage" diff --git a/recipes/google-cloud-cpp/2.x/extract_dependencies.py b/recipes/google-cloud-cpp/2.x/extract_dependencies.py index a957a6eca412b..0235b7b50d130 100755 --- a/recipes/google-cloud-cpp/2.x/extract_dependencies.py +++ b/recipes/google-cloud-cpp/2.x/extract_dependencies.py @@ -25,6 +25,8 @@ # 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. +# +# This list maps onto google_cloud_cpp_load_protodeps()'s `targets_to_omit`. _PROTO_DEPS_REMOVED_TARGETS = { "cloud_kms_v1_kms_protos", "cloud_orgpolicy_v1_orgpolicy_protos", @@ -35,13 +37,15 @@ # Used in _generate_proto_requires(): the *.deps files are generated from # Bazel and contain a few targets that have incorrect names for CMake. +# +# This list maps onto google_cloud_cpp_load_protodeps()'s `targets_substitutions`. _PROTO_DEPS_REPLACED_TARGETS = { "grafeas_v1_grafeas_protos": "grafeas_protos", + "iam_v2_policy_protos": "iam_v2_protos", + "logging_type_type_protos": "logging_type_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. @@ -77,7 +81,6 @@ "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", @@ -103,7 +106,6 @@ "api_field_behavior_protos", "api_context_protos", "api_logging_protos", - "iam_credentials_v1_common_protos", "iam_credentials_v1_iamcredentials_protos", } @@ -115,107 +117,7 @@ "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. +# `google-cloud-cpp` manages these dependencies using CMake code. _HARD_CODED_DEPENDENCIES = { "api_annotations_protos": ["api_http_protos"], "api_auth_protos": ["api_annotations_protos"], @@ -280,7 +182,7 @@ def _components(source_folder): # 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 + raise Exception("Missing 'libraries.bzl' file") # 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 @@ -343,6 +245,7 @@ def main(): proto_components = _PROTO_BASE_COMPONENTS.copy() files = sorted(glob.glob(os.path.join(deps_folder, "*.deps"))) experimental = set(_experimental_components(source_folder)) + components = set(_components(source_folder)) for filename in files: component = os.path.basename(filename).replace(".deps", "") component = _PROTO_DEPS_REPLACED_NAMES.get(component, component) @@ -351,6 +254,9 @@ def main(): # The Conan package only compiles the GA components, so we need # to skip these. continue + if component == "compute": + # `compute` does not use gRPC or the `*.deps` files. + continue component = component + "_protos" deps = _generate_proto_requires(filename) proto_components.add(component) @@ -361,12 +267,16 @@ def main(): proto_components.add(component) proto_components.update(deps) print(f' "{component}": {sorted(deps)},') + print(f' "cloud_extended_operations_protos": ["protobuf::libprotobuf"],') + print(f' "compute_protos": ["cloud_extended_operations_protos", "protobuf::libprotobuf"],') + proto_components.add("cloud_extended_operations_protos") + proto_components.add("compute_protos") 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)] + names = ['"%s"' % c for c in components] joined = ",\n ".join(sorted(names)) print(f"\nCOMPONENTS = {{\n {joined}\n}}") 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 deleted file mode 100644 index bfefce3078428..0000000000000 --- a/recipes/google-cloud-cpp/2.x/patches/2.12.0/001-use-conan-msvc-runtime.patch +++ /dev/null @@ -1,53 +0,0 @@ -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.19.0/001-use-conan-msvc-runtime.patch b/recipes/google-cloud-cpp/2.x/patches/2.19.0/001-use-conan-msvc-runtime.patch new file mode 100644 index 0000000000000..926222913c3a8 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.19.0/001-use-conan-msvc-runtime.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aebfc6b1..f1c4f196 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 ce44aafe..cdaba904 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 c3df633c..6a85dfe8 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.19.0/002-add-find-package-threads.patch b/recipes/google-cloud-cpp/2.x/patches/2.19.0/002-add-find-package-threads.patch new file mode 100644 index 0000000000000..5eee169050480 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.19.0/002-add-find-package-threads.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f1c4f196..53497f0a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -187,6 +187,7 @@ add_custom_target(google-cloud-cpp-protos) + add_custom_target(doxygen-docs) + add_custom_target(all-docfx) + ++find_package(Threads REQUIRED) + find_package(absl CONFIG REQUIRED) + if (GOOGLE_CLOUD_CPP_ENABLE_GRPC) + find_package(gRPC REQUIRED QUIET) diff --git a/recipes/google-cloud-cpp/2.x/patches/2.28.0/001-add-find-package-threads.patch b/recipes/google-cloud-cpp/2.x/patches/2.28.0/001-add-find-package-threads.patch new file mode 100644 index 0000000000000..00d1143424d10 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/patches/2.28.0/001-add-find-package-threads.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 96297b4a..f274a111 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -218,6 +218,7 @@ add_custom_target(google-cloud-cpp-protos) + add_custom_target(doxygen-docs) + add_custom_target(all-docfx) + ++find_package(Threads REQUIRED) + find_package(absl CONFIG REQUIRED) + if (GOOGLE_CLOUD_CPP_ENABLE_GRPC) + find_package(gRPC REQUIRED QUIET) 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 deleted file mode 100644 index 4099fd00cae2f..0000000000000 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/002-interface-library-properties.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/cmake/CompileProtos.cmake b/cmake/CompileProtos.cmake -index 366edba..74c27bf 100644 ---- a/cmake/CompileProtos.cmake -+++ b/cmake/CompileProtos.cmake -@@ -315,6 +315,10 @@ include(GNUInstallDirs) - - # Install headers for a C++ proto library. - function (google_cloud_cpp_install_proto_library_headers target) -+ get_target_property(type ${target} TYPE) -+ if ("${type}" STREQUAL "INTERFACE_LIBRARY") -+ return() -+ endif () - get_target_property(target_sources ${target} SOURCES) - foreach (header ${target_sources}) - # Skip anything that is not a header file. -@@ -332,6 +336,10 @@ endfunction () - - # Install protos for a C++ proto library. - function (google_cloud_cpp_install_proto_library_protos target source_dir) -+ get_target_property(type ${target} TYPE) -+ if ("${type}" STREQUAL "INTERFACE_LIBRARY") -+ return() -+ endif () - get_target_property(target_protos ${target} PROTO_SOURCES) - 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 0ddf345..2a00f2d 100644 ---- a/google/cloud/dialogflow_es/CMakeLists.txt -+++ b/google/cloud/dialogflow_es/CMakeLists.txt -@@ -37,7 +37,12 @@ endif () - - include(CompileProtos) - add_library(google_cloud_cpp_dialogflow_es_protos INTERFACE) --external_googleapis_set_version_and_alias(dialogflow_es_protos) -+set_target_properties( -+ google_cloud_cpp_dialogflow_es_protos -+ PROPERTIES EXPORT_NAME google-cloud-cpp::dialogflow_es_protos) -+add_library(google-cloud-cpp::dialogflow_es_protos ALIAS -+ google_cloud_cpp_dialogflow_es_protos) -+ - target_link_libraries( - google_cloud_cpp_dialogflow_es_protos - PUBLIC 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 deleted file mode 100644 index f021f480b2dd1..0000000000000 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/003-use-conan-msvc-runtime.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 236c6e1..f961398 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -68,7 +68,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 057fe6b..dbffd7b 100644 ---- a/cmake/GoogleCloudCppCommon.cmake -+++ b/cmake/GoogleCloudCppCommon.cmake -@@ -21,9 +21,6 @@ get_filename_component(GOOGLE_CLOUD_CPP_SUBPROJECT - # 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 0cb7a9a..d9016a0 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 ad2bd4b..cd1eb3a 100644 ---- a/external/googleapis/CMakeLists.txt -+++ b/external/googleapis/CMakeLists.txt -@@ -147,8 +147,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.5.0/004-remove-duplicate-protos.patch b/recipes/google-cloud-cpp/2.x/patches/2.5.0/004-remove-duplicate-protos.patch deleted file mode 100644 index 3bae252294281..0000000000000 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/004-remove-duplicate-protos.patch +++ /dev/null @@ -1,108 +0,0 @@ -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 deleted file mode 100644 index 4ecbc354da0bd..0000000000000 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/005-interface-library-properties.patch +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100644 index ef18553443bda..0000000000000 --- a/recipes/google-cloud-cpp/2.x/patches/2.5.0/006-cannot-use-or-with-windows.patch +++ /dev/null @@ -1,45 +0,0 @@ -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/2.x/test_package/CMakeLists.txt b/recipes/google-cloud-cpp/2.x/test_package/CMakeLists.txt index 5d76b297da5c5..a3c3a27d44c93 100644 --- a/recipes/google-cloud-cpp/2.x/test_package/CMakeLists.txt +++ b/recipes/google-cloud-cpp/2.x/test_package/CMakeLists.txt @@ -7,12 +7,22 @@ find_package(google-cloud-cpp CONFIG REQUIRED) # should pick what we test with a view to detecting # the most common packaging problems. -# Bigtable, Pub/Sub and Spanner have signficant amounts of -# custom code and thus some amount of ad-hoc dependencies on -# absl::* components. -# Storage has custom code and does not depend on gRPC or Protobuf. -# Speech is a good model for most other libraries. -foreach(component IN ITEMS "bigtable" "pubsub" "spanner" "speech" "storage") +set(tests + # Bigtable, Pub/Sub and Spanner have signficant amounts of + # custom code and thus some amount of ad-hoc dependencies on + # absl::* components. + "bigtable" "pubsub" "spanner" + # Storage has custom code and does not depend on gRPC or Protobuf. + "storage" + # Speech is a good model for most other libraries. + "speech") +if (WITH_COMPUTE) + # Compute does not use gRPC and has a different structure from most + # libraries. + list(APPEND tests "compute") +endif () + +foreach(component IN LISTS tests) add_executable("${component}" "${component}.cpp") target_compile_features("${component}" PRIVATE cxx_std_14) target_link_libraries("${component}" google-cloud-cpp::${component}) diff --git a/recipes/google-cloud-cpp/2.x/test_package/compute.cpp b/recipes/google-cloud-cpp/2.x/test_package/compute.cpp new file mode 100644 index 0000000000000..59d7b98bea158 --- /dev/null +++ b/recipes/google-cloud-cpp/2.x/test_package/compute.cpp @@ -0,0 +1,12 @@ +#include + +int main(int argc, char *argv[]) { + if (argc != 1) { + std::cerr << "Usage: compute\n"; + return 1; + } + std::cout << "Testing google-cloud-cpp::compute library " << google::cloud::version_string() << "\n"; + namespace disks = ::google::cloud::compute_disks_v1; + auto client = disks::DisksClient(disks::MakeDisksConnectionRest()); + return 0; +} diff --git a/recipes/google-cloud-cpp/2.x/test_package/conanfile.py b/recipes/google-cloud-cpp/2.x/test_package/conanfile.py index a3be7ec5660ae..a1ab26b6de654 100644 --- a/recipes/google-cloud-cpp/2.x/test_package/conanfile.py +++ b/recipes/google-cloud-cpp/2.x/test_package/conanfile.py @@ -3,7 +3,9 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.build import can_run -from conan.tools.env import VirtualRunEnv +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.scm import Version + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" @@ -12,15 +14,32 @@ class TestPackageConan(ConanFile): def requirements(self): self.requires(self.tested_reference_str) + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def layout(self): cmake_layout(self) + + def _supports_compute(self): + if not hasattr(self, "dependencies"): + # This is typically a Conan v1 build. We skip the test for compute + # because it is difficult to establish the `google-cloud-cpp` + # version, and Conan v1 is being retired, and the support is tested + # as part of the Conan v2 build. + return False + return Version(self.dependencies["google-cloud-cpp"].ref.version) >= "2.19.0" def generate(self): tc = CMakeToolchain(self) + tc.variables["WITH_COMPUTE"] = self._supports_compute() tc.generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") + else: + VirtualBuildEnv(self).generate() # Environment so that the compiled test executable can load shared libraries - runenv = VirtualRunEnv(self) - runenv.generate(scope="run") + VirtualRunEnv(self).generate(scope="run") deps = CMakeDeps(self) deps.generate() @@ -35,3 +54,6 @@ def test(self): for test in ["bigtable", "pubsub", "spanner", "speech", "storage"]: cmd = os.path.join(self.cpp.build.bindir, test) self.run(cmd, env="conanrun") + if self._supports_compute(): + cmd = os.path.join(self.cpp.build.bindir, "compute") + self.run(cmd, env="conanrun") diff --git a/recipes/google-cloud-cpp/2.x/test_v1_package/CMakeLists.txt b/recipes/google-cloud-cpp/2.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d63e750dab0a..0000000000000 --- a/recipes/google-cloud-cpp/2.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.10...3.24) -project(google-cloud-cpp-test 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/google-cloud-cpp/2.x/test_v1_package/conanfile.py b/recipes/google-cloud-cpp/2.x/test_v1_package/conanfile.py deleted file mode 100644 index 7d052b9b26983..0000000000000 --- a/recipes/google-cloud-cpp/2.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +0,0 @@ -import os - -from conans import ConanFile, CMake, tools -from conan.tools.build import can_run - - -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 can_run(self): - return - for test in ["bigtable", "pubsub", "spanner", "speech", "storage"]: - cmd = os.path.join("bin", test) - self.run(cmd, run_environment=True) diff --git a/recipes/google-cloud-cpp/all/CMakeLists.txt b/recipes/google-cloud-cpp/all/CMakeLists.txt deleted file mode 100644 index a342eb16dcf1a..0000000000000 --- a/recipes/google-cloud-cpp/all/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -if(MSVC) - add_definitions("-D_SILENCE_CXX20_REL_OPS_DEPRECATION_WARNING") - add_definitions("-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING") -endif() - -add_subdirectory("source_subfolder") diff --git a/recipes/google-cloud-cpp/all/conandata.yml b/recipes/google-cloud-cpp/all/conandata.yml index a410b93b2e064..ab3c9439c131a 100644 --- a/recipes/google-cloud-cpp/all/conandata.yml +++ b/recipes/google-cloud-cpp/all/conandata.yml @@ -1,23 +1,16 @@ sources: - "1.26.1": - url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.26.1.tar.gz" - sha256: "83108515fc59c72cdb87f178712256f4b0098e1ca5dc6f64c2c20dd2f1e1559d" - "1.27.0": - url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.27.0.tar.gz" - sha256: "84a7ac7b63db986bb737462e374c11fc6f35f6020ccaacec1d0e4d61ec929528" - "1.30.1": - url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.30.1.tar.gz" - sha256: "b651a58cb44bd715f0cb8e42c7ea58490b3e768a35ede01d798b983eef88e143" - "1.31.1": - url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.31.1.tar.gz" - sha256: "dc7cbf95b506a84b48cf71e0462985d262183edeaabdacaaee2109852394a609" "1.40.1": url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.40.1.tar.gz" sha256: "fb62f0e7dc964c5d3cd0d85977b85f3e0e7dce97e9029abf9c32ecc29db07043" -patches: - "1.26.1": - - patch_file: "patches/0001-googleapis-folder.patch" - base_path: "source_subfolder" + "1.31.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.31.1.tar.gz" + sha256: "dc7cbf95b506a84b48cf71e0462985d262183edeaabdacaaee2109852394a609" + "1.30.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.30.1.tar.gz" + sha256: "b651a58cb44bd715f0cb8e42c7ea58490b3e768a35ede01d798b983eef88e143" "1.27.0": - - patch_file: "patches/0001-googleapis-folder.patch" - base_path: "source_subfolder" + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.27.0.tar.gz" + sha256: "84a7ac7b63db986bb737462e374c11fc6f35f6020ccaacec1d0e4d61ec929528" + "1.26.1": + url: "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v1.26.1.tar.gz" + sha256: "83108515fc59c72cdb87f178712256f4b0098e1ca5dc6f64c2c20dd2f1e1559d" diff --git a/recipes/google-cloud-cpp/all/conanfile.py b/recipes/google-cloud-cpp/all/conanfile.py index 30fac004d5e19..e54c3ef7dc95c 100644 --- a/recipes/google-cloud-cpp/all/conanfile.py +++ b/recipes/google-cloud-cpp/all/conanfile.py @@ -1,41 +1,45 @@ import os import textwrap -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.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.33.0" class GoogleCloudCppConan(ConanFile): name = "google-cloud-cpp" description = "C++ Client Libraries for Google Cloud Services" license = "Apache-2.0" - topics = "google", "cloud", "google-cloud-storage", "google-cloud-platform", "google-cloud-pubsub", "google-cloud-spanner", "google-cloud-bigtable" + topics = ( + "google", "cloud", "google-cloud-storage", "google-cloud-platform", + "google-cloud-pubsub", "google-cloud-spanner", "google-cloud-bigtable" + ) homepage = "https://github.com/googleapis/google-cloud-cpp" url = "https://github.com/conan-io/conan-center-index" - generators = "cmake", "cmake_find_package_multi", "cmake_find_package" + 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, + } short_paths = True - _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"]) + def _minimum_compiler_versions(self): + return { + "gcc": "5.4", + "clang": "6", + } def config_options(self): if self.settings.os == "Windows": @@ -43,71 +47,77 @@ 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("abseil/[>=20230125.3 <=20230802.1]", transitive_headers=True) + self.requires("crc32c/1.1.2") + self.requires("grpc/1.54.3") + self.requires("libcurl/[>=7.78.0 <9]") + self.requires("nlohmann_json/3.11.3") + self.requires("openssl/[>=1.1 <4]") + self.requires("protobuf/3.21.12") + # TODO: googleapis is hard to unvendorize, as it creates google-cloud-cpp:: targets + # and it's not trivial to replace them with the googleapis:: targets, + # there's not clean 1:1 mapping between them either way + # self.requires("googleapis/cci.20220531") + + def build_requirements(self): + self.tool_requires("grpc/") + self.tool_requires("protobuf/") + def validate(self): - if self.settings.os == 'Windows' and self.options.shared: + if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("Fails to compile for Windows 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)") - if tools.Version(self.version) >= "1.30.0": - if self.settings.compiler == 'clang' and tools.Version(self.settings.compiler.version) < "6.0": - raise ConanInvalidConfiguration("Clang version must be at least 6.0.") + if self.settings.compiler.get_safe("cppstd"): + if self.settings.compiler == "msvc": + check_min_cppstd(self, 20) + check_min_cppstd(self, 11) - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + check_min_vs(self, "192") - if self.settings.compiler == 'gcc' and tools.Version(self.settings.compiler.version) < "5.4": - raise ConanInvalidConfiguration("Building requires GCC >= 5.4") - if self.settings.compiler == 'clang' and tools.Version(self.settings.compiler.version) < "3.8": - raise ConanInvalidConfiguration("Building requires clang >= 3.8") - if self.settings.compiler == 'Visual Studio' and tools.Version(self.settings.compiler.version) < "16": - raise ConanInvalidConfiguration("Building requires VS >= 2019") + minimum_version = self._minimum_compiler_versions.get(str(self.settings.compiler)) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires {self.settings.compiler} >= {minimum_version}") def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - - def requirements(self): - self.requires('protobuf/3.20.0') - self.requires('grpc/1.45.2') - self.requires('nlohmann_json/3.10.5') - self.requires('crc32c/1.1.2') - self.requires('abseil/20211102.0') - self.requires('libcurl/7.80.0') - self.requires('openssl/1.1.1n') - # TODO: Add googleapis once it is available in CCI (now it is embedded) - - @functools.lru_cache(1) - def _configure_cmake(self): - # Do not build in parallel for certain configurations, it fails writting/reading files at the same time - parallel = not (self.settings.compiler == "Visual Studio" and self.settings.compiler.version == "16" and self.version in ["1.31.1", "1.30.1"]) - cmake = CMake(self, parallel=parallel) - cmake.definitions["BUILD_TESTING"] = 0 - - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False - - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_BIGTABLE"] = True - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_BIGQUERY"] = True - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_SPANNER"] = True - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_STORAGE"] = True - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_FIRESTORE"] = True - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_PUBSUB"] = True - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_IAM"] = True - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_LOGGING"] = True - cmake.definitions["GOOGLE_CLOUD_CPP_ENABLE_GENERATOR"] = True - - cmake.configure() - return cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = 0 + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_WERROR"] = False + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK"] = False + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_CCACHE"] = False + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_BIGTABLE"] = True + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_BIGQUERY"] = True + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_SPANNER"] = True + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_STORAGE"] = True + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_FIRESTORE"] = True + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_PUBSUB"] = True + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_IAM"] = True + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_LOGGING"] = True + tc.cache_variables["GOOGLE_CLOUD_CPP_ENABLE_GENERATOR"] = False + + if is_msvc(self): + tc.preprocessor_definitions["_SILENCE_CXX20_REL_OPS_DEPRECATION_WARNING"] = 1 + tc.preprocessor_definitions["_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING"] = 1 + 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) - - if tools.Version(self.version) < "1.33.0": + if Version(self.version) < "1.33.0": # Do not override CMAKE_CXX_STANDARD if provided - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), textwrap.dedent("""\ set(CMAKE_CXX_STANDARD 11 @@ -117,258 +127,262 @@ def _patch_sources(self): set(CMAKE_CXX_STANDARD 11 CACHE STRING "Configure the C++ standard version for all targets.") endif() """)) + if self.version == "1.40.1": + replace_in_file(self, os.path.join(self.source_folder, "google", "cloud", "internal", "openssl_util.h"), + "#include ", "#include \n#include ") 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() - 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.components["common"].requires = ["abseil::absl_any", "abseil::absl_flat_hash_map", "abseil::absl_memory", "abseil::absl_optional", "abseil::absl_time"] self.cpp_info.components["common"].libs = ["google_cloud_cpp_common"] - self.cpp_info.components["common"].names["pkg_config"] = "google_cloud_cpp_common" + self.cpp_info.components["common"].set_property("pkg_config_name", "google_cloud_cpp_common") self.cpp_info.components["experimental-bigquery"].requires = ["grpc_utils", "common", "cloud_bigquery_protos"] self.cpp_info.components["experimental-bigquery"].libs = ["google_cloud_cpp_bigquery"] - self.cpp_info.components["experimental-bigquery"].names["pkg_config"] = "google_cloud_cpp_bigquery" + self.cpp_info.components["experimental-bigquery"].set_property("pkg_config_name", "google_cloud_cpp_bigquery") self.cpp_info.components["bigtable"].requires = ["abseil::absl_memory", "bigtable_protos", "common", "grpc_utils", "grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["bigtable"].libs = ["google_cloud_cpp_bigtable"] - self.cpp_info.components["bigtable"].names["pkg_config"] = "google_cloud_cpp_bigtable" + self.cpp_info.components["bigtable"].set_property("pkg_config_name", "google_cloud_cpp_bigtable") - if tools.Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before + if Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before self.cpp_info.components["experimental-firestore"].requires = ["common"] self.cpp_info.components["experimental-firestore"].libs = ["google_cloud_cpp_firestore"] - self.cpp_info.components["experimental-firestore"].names["pkg_config"] = "google_cloud_cpp_firestore" - + self.cpp_info.components["experimental-firestore"].set_property("pkg_config_name", "google_cloud_cpp_firestore") + self.cpp_info.components["bigtable_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos", "longrunning_operations_protos", "rpc_status_protos", "api_auth_protos"] self.cpp_info.components["bigtable_protos"].libs = ["google_cloud_cpp_bigtable_protos"] - self.cpp_info.components["bigtable_protos"].names["pkg_config"] = "google_cloud_cpp_bigtable_protos" + self.cpp_info.components["bigtable_protos"].set_property("pkg_config_name", "google_cloud_cpp_bigtable_protos") self.cpp_info.components["cloud_bigquery_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos", "rpc_status_protos", "api_http_protos"] self.cpp_info.components["cloud_bigquery_protos"].libs = ["google_cloud_cpp_cloud_bigquery_protos"] - self.cpp_info.components["cloud_bigquery_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_bigquery_protos" + self.cpp_info.components["cloud_bigquery_protos"].set_property("pkg_config_name", "google_cloud_cpp_cloud_bigquery_protos") self.cpp_info.components["cloud_speech_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "longrunning_operations_protos", "rpc_status_protos"] self.cpp_info.components["cloud_speech_protos"].libs = ["google_cloud_cpp_cloud_speech_protos"] - self.cpp_info.components["cloud_speech_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_speech_protos" + self.cpp_info.components["cloud_speech_protos"].set_property("pkg_config_name", "google_cloud_cpp_cloud_speech_protos") self.cpp_info.components["cloud_texttospeech_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos"] self.cpp_info.components["cloud_texttospeech_protos"].libs = ["google_cloud_cpp_cloud_texttospeech_protos"] - self.cpp_info.components["cloud_texttospeech_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_texttospeech_protos" + self.cpp_info.components["cloud_texttospeech_protos"].set_property("pkg_config_name", "google_cloud_cpp_cloud_texttospeech_protos") self.cpp_info.components["iam_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos"] self.cpp_info.components["iam_protos"].libs = ["google_cloud_cpp_iam_protos"] - self.cpp_info.components["iam_protos"].names["pkg_config"] = "google_cloud_cpp_iam_protos" + self.cpp_info.components["iam_protos"].set_property("pkg_config_name", "google_cloud_cpp_iam_protos") self.cpp_info.components["pubsub_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos"] self.cpp_info.components["pubsub_protos"].libs = ["google_cloud_cpp_pubsub_protos"] - self.cpp_info.components["pubsub_protos"].names["pkg_config"] = "google_cloud_cpp_pubsub_protos" + self.cpp_info.components["pubsub_protos"].set_property("pkg_config_name", "google_cloud_cpp_pubsub_protos") self.cpp_info.components["spanner_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos", "longrunning_operations_protos", "rpc_status_protos"] self.cpp_info.components["spanner_protos"].libs = ["google_cloud_cpp_spanner_protos"] - self.cpp_info.components["spanner_protos"].names["pkg_config"] = "google_cloud_cpp_spanner_protos" + self.cpp_info.components["spanner_protos"].set_property("pkg_config_name", "google_cloud_cpp_spanner_protos") self.cpp_info.components["storage_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "iam_v1_iam_policy_protos", "iam_v1_policy_protos"] self.cpp_info.components["storage_protos"].libs = ["google_cloud_cpp_storage_protos"] - self.cpp_info.components["storage_protos"].names["pkg_config"] = "google_cloud_cpp_storage_protos" + self.cpp_info.components["storage_protos"].set_property("pkg_config_name", "google_cloud_cpp_storage_protos") self.cpp_info.components["longrunning_operations_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "rpc_status_protos"] self.cpp_info.components["longrunning_operations_protos"].libs = ["google_cloud_cpp_longrunning_operations_protos"] - self.cpp_info.components["longrunning_operations_protos"].names["pkg_config"] = "google_cloud_cpp_longrunning_operations_protos" + self.cpp_info.components["longrunning_operations_protos"].set_property("pkg_config_name", "google_cloud_cpp_longrunning_operations_protos") self.cpp_info.components["api_http_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["api_http_protos"].libs = ["google_cloud_cpp_api_http_protos"] - self.cpp_info.components["api_http_protos"].names["pkg_config"] = "google_cloud_cpp_api_http_protos" + self.cpp_info.components["api_http_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_http_protos") self.cpp_info.components["api_annotations_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_http_protos"] self.cpp_info.components["api_annotations_protos"].libs = ["google_cloud_cpp_api_annotations_protos"] - self.cpp_info.components["api_annotations_protos"].names["pkg_config"] = "google_cloud_cpp_api_annotations_protos" + self.cpp_info.components["api_annotations_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_annotations_protos") self.cpp_info.components["api_auth_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] self.cpp_info.components["api_auth_protos"].libs = ["google_cloud_cpp_api_auth_protos"] - self.cpp_info.components["api_auth_protos"].names["pkg_config"] = "google_cloud_cpp_api_auth_protos" + self.cpp_info.components["api_auth_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_auth_protos") self.cpp_info.components["api_client_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["api_client_protos"].libs = ["google_cloud_cpp_api_client_protos"] - self.cpp_info.components["api_client_protos"].names["pkg_config"] = "google_cloud_cpp_api_client_protos" + self.cpp_info.components["api_client_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_client_protos") self.cpp_info.components["api_distribution_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["api_distribution_protos"].libs = ["google_cloud_cpp_api_distribution_protos"] - self.cpp_info.components["api_distribution_protos"].names["pkg_config"] = "google_cloud_cpp_api_distribution_protos" + self.cpp_info.components["api_distribution_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_distribution_protos") self.cpp_info.components["api_field_behavior_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["api_field_behavior_protos"].libs = ["google_cloud_cpp_api_field_behavior_protos"] - self.cpp_info.components["api_field_behavior_protos"].names["pkg_config"] = "google_cloud_cpp_api_field_behavior_protos" + self.cpp_info.components["api_field_behavior_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_field_behavior_protos") self.cpp_info.components["api_label_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["api_label_protos"].libs = ["google_cloud_cpp_api_label_protos"] - self.cpp_info.components["api_label_protos"].names["pkg_config"] = "google_cloud_cpp_api_label_protos" + self.cpp_info.components["api_label_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_label_protos") self.cpp_info.components["api_launch_stage_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["api_launch_stage_protos"].libs = ["google_cloud_cpp_api_launch_stage_protos"] - self.cpp_info.components["api_launch_stage_protos"].names["pkg_config"] = "google_cloud_cpp_api_launch_stage_protos" + self.cpp_info.components["api_launch_stage_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_launch_stage_protos") self.cpp_info.components["api_metric_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_launch_stage_protos", "api_label_protos"] self.cpp_info.components["api_metric_protos"].libs = ["google_cloud_cpp_api_metric_protos"] - self.cpp_info.components["api_metric_protos"].names["pkg_config"] = "google_cloud_cpp_api_metric_protos" + self.cpp_info.components["api_metric_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_metric_protos") self.cpp_info.components["api_monitored_resource_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_launch_stage_protos", "api_label_protos"] self.cpp_info.components["api_monitored_resource_protos"].libs = ["google_cloud_cpp_api_monitored_resource_protos"] - self.cpp_info.components["api_monitored_resource_protos"].names["pkg_config"] = "google_cloud_cpp_api_monitored_resource_protos" + self.cpp_info.components["api_monitored_resource_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_monitored_resource_protos") self.cpp_info.components["api_resource_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["api_resource_protos"].libs = ["google_cloud_cpp_api_resource_protos"] - self.cpp_info.components["api_resource_protos"].names["pkg_config"] = "google_cloud_cpp_api_resource_protos" + self.cpp_info.components["api_resource_protos"].set_property("pkg_config_name", "google_cloud_cpp_api_resource_protos") self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_field_behavior_protos", "api_resource_protos", "rpc_status_protos"] self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].libs = ["google_cloud_cpp_devtools_cloudtrace_v2_trace_protos"] - self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].names["pkg_config"] = "google_cloud_cpp_devtools_cloudtrace_v2_trace_protos" + self.cpp_info.components["devtools_cloudtrace_v2_trace_protos"].set_property("pkg_config_name", "google_cloud_cpp_devtools_cloudtrace_v2_trace_protos") self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "devtools_cloudtrace_v2_trace_protos", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "rpc_status_protos"] self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].libs = ["google_cloud_cpp_devtools_cloudtrace_v2_tracing_protos"] - self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].names["pkg_config"] = "google_cloud_cpp_devtools_cloudtrace_v2_tracing_protos" + self.cpp_info.components["devtools_cloudtrace_v2_tracing_protos"].set_property("pkg_config_name", "google_cloud_cpp_devtools_cloudtrace_v2_tracing_protos") cmp_logging_type_type_protos = None - if tools.Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before + if Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before cmp_logging_type_type_protos = "logging_type_protos" self.cpp_info.components[cmp_logging_type_type_protos].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] self.cpp_info.components[cmp_logging_type_type_protos].libs = ["google_cloud_cpp_logging_type_protos"] - self.cpp_info.components[cmp_logging_type_type_protos].names["pkg_config"] = "google_cloud_cpp_logging_type_protos" + self.cpp_info.components[cmp_logging_type_type_protos].set_property("pkg_config_name", "google_cloud_cpp_logging_type_protos") else: cmp_logging_type_type_protos = "logging_type_type_protos" self.cpp_info.components[cmp_logging_type_type_protos].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] self.cpp_info.components[cmp_logging_type_type_protos].libs = ["google_cloud_cpp_logging_type_type_protos"] - self.cpp_info.components[cmp_logging_type_type_protos].names["pkg_config"] = "google_cloud_cpp_logging_type_type_protos" + self.cpp_info.components[cmp_logging_type_type_protos].set_property("pkg_config_name", "google_cloud_cpp_logging_type_type_protos") self.cpp_info.components["logging_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_distribution_protos", "api_field_behavior_protos", "api_metric_protos", "api_monitored_resource_protos", "api_resource_protos", cmp_logging_type_type_protos, "rpc_status_protos"] self.cpp_info.components["logging_protos"].libs = ["google_cloud_cpp_logging_protos"] - self.cpp_info.components["logging_protos"].names["pkg_config"] = "google_cloud_cpp_logging_protos" + self.cpp_info.components["logging_protos"].set_property("pkg_config_name", "google_cloud_cpp_logging_protos") self.cpp_info.components["monitoring_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_distribution_protos", "api_field_behavior_protos", "api_label_protos", "api_launch_stage_protos", "api_metric_protos", "api_monitored_resource_protos", "api_resource_protos", "rpc_status_protos", "type_calendar_period_protos"] self.cpp_info.components["monitoring_protos"].libs = ["google_cloud_cpp_monitoring_protos"] - self.cpp_info.components["monitoring_protos"].names["pkg_config"] = "google_cloud_cpp_monitoring_protos" + self.cpp_info.components["monitoring_protos"].set_property("pkg_config_name", "google_cloud_cpp_monitoring_protos") self.cpp_info.components["iam_v1_options_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos"] self.cpp_info.components["iam_v1_options_protos"].libs = ["google_cloud_cpp_iam_v1_options_protos"] - self.cpp_info.components["iam_v1_options_protos"].names["pkg_config"] = "google_cloud_cpp_iam_v1_options_protos" + self.cpp_info.components["iam_v1_options_protos"].set_property("pkg_config_name", "google_cloud_cpp_iam_v1_options_protos") self.cpp_info.components["iam_v1_policy_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "type_expr_protos"] self.cpp_info.components["iam_v1_policy_protos"].libs = ["google_cloud_cpp_iam_v1_policy_protos"] - self.cpp_info.components["iam_v1_policy_protos"].names["pkg_config"] = "google_cloud_cpp_iam_v1_policy_protos" + self.cpp_info.components["iam_v1_policy_protos"].set_property("pkg_config_name", "google_cloud_cpp_iam_v1_policy_protos") self.cpp_info.components["iam_v1_iam_policy_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "iam_v1_options_protos", "iam_v1_policy_protos"] self.cpp_info.components["iam_v1_iam_policy_protos"].libs = ["google_cloud_cpp_iam_v1_iam_policy_protos"] - self.cpp_info.components["iam_v1_iam_policy_protos"].names["pkg_config"] = "google_cloud_cpp_iam_v1_iam_policy_protos" + self.cpp_info.components["iam_v1_iam_policy_protos"].set_property("pkg_config_name", "google_cloud_cpp_iam_v1_iam_policy_protos") self.cpp_info.components["rpc_error_details_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["rpc_error_details_protos"].libs = ["google_cloud_cpp_rpc_error_details_protos"] - self.cpp_info.components["rpc_error_details_protos"].names["pkg_config"] = "google_cloud_cpp_rpc_error_details_protos" + self.cpp_info.components["rpc_error_details_protos"].set_property("pkg_config_name", "google_cloud_cpp_rpc_error_details_protos") self.cpp_info.components["rpc_status_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "rpc_error_details_protos"] self.cpp_info.components["rpc_status_protos"].libs = ["google_cloud_cpp_rpc_status_protos"] - self.cpp_info.components["rpc_status_protos"].names["pkg_config"] = "google_cloud_cpp_rpc_status_protos" + self.cpp_info.components["rpc_status_protos"].set_property("pkg_config_name", "google_cloud_cpp_rpc_status_protos") self.cpp_info.components["type_calendar_period_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_calendar_period_protos"].libs = ["google_cloud_cpp_type_calendar_period_protos"] - self.cpp_info.components["type_calendar_period_protos"].names["pkg_config"] = "google_cloud_cpp_type_calendar_period_protos" + self.cpp_info.components["type_calendar_period_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_calendar_period_protos") self.cpp_info.components["type_color_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_color_protos"].libs = ["google_cloud_cpp_type_color_protos"] - self.cpp_info.components["type_color_protos"].names["pkg_config"] = "google_cloud_cpp_type_color_protos" + self.cpp_info.components["type_color_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_color_protos") self.cpp_info.components["type_date_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_date_protos"].libs = ["google_cloud_cpp_type_date_protos"] - self.cpp_info.components["type_date_protos"].names["pkg_config"] = "google_cloud_cpp_type_date_protos" + self.cpp_info.components["type_date_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_date_protos") self.cpp_info.components["type_datetime_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_datetime_protos"].libs = ["google_cloud_cpp_type_datetime_protos"] - self.cpp_info.components["type_datetime_protos"].names["pkg_config"] = "google_cloud_cpp_type_datetime_protos" + self.cpp_info.components["type_datetime_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_datetime_protos") self.cpp_info.components["type_dayofweek_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_dayofweek_protos"].libs = ["google_cloud_cpp_type_dayofweek_protos"] - self.cpp_info.components["type_dayofweek_protos"].names["pkg_config"] = "google_cloud_cpp_type_dayofweek_protos" + self.cpp_info.components["type_dayofweek_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_dayofweek_protos") self.cpp_info.components["type_expr_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_expr_protos"].libs = ["google_cloud_cpp_type_expr_protos"] - self.cpp_info.components["type_expr_protos"].names["pkg_config"] = "google_cloud_cpp_type_expr_protos" + self.cpp_info.components["type_expr_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_expr_protos") self.cpp_info.components["type_fraction_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_fraction_protos"].libs = ["google_cloud_cpp_type_fraction_protos"] - self.cpp_info.components["type_fraction_protos"].names["pkg_config"] = "google_cloud_cpp_type_fraction_protos" + self.cpp_info.components["type_fraction_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_fraction_protos") self.cpp_info.components["type_interval_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_interval_protos"].libs = ["google_cloud_cpp_type_interval_protos"] - self.cpp_info.components["type_interval_protos"].names["pkg_config"] = "google_cloud_cpp_type_interval_protos" + self.cpp_info.components["type_interval_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_interval_protos") self.cpp_info.components["type_latlng_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_latlng_protos"].libs = ["google_cloud_cpp_type_latlng_protos"] - self.cpp_info.components["type_latlng_protos"].names["pkg_config"] = "google_cloud_cpp_type_latlng_protos" + self.cpp_info.components["type_latlng_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_latlng_protos") self.cpp_info.components["type_localized_text_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_localized_text_protos"].libs = ["google_cloud_cpp_type_localized_text_protos"] - self.cpp_info.components["type_localized_text_protos"].names["pkg_config"] = "google_cloud_cpp_type_localized_text_protos" + self.cpp_info.components["type_localized_text_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_localized_text_protos") self.cpp_info.components["type_money_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_money_protos"].libs = ["google_cloud_cpp_type_money_protos"] - self.cpp_info.components["type_money_protos"].names["pkg_config"] = "google_cloud_cpp_type_money_protos" + self.cpp_info.components["type_money_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_money_protos") self.cpp_info.components["type_month_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_month_protos"].libs = ["google_cloud_cpp_type_month_protos"] - self.cpp_info.components["type_month_protos"].names["pkg_config"] = "google_cloud_cpp_type_month_protos" + self.cpp_info.components["type_month_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_month_protos") self.cpp_info.components["type_phone_number_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_phone_number_protos"].libs = ["google_cloud_cpp_type_phone_number_protos"] - self.cpp_info.components["type_phone_number_protos"].names["pkg_config"] = "google_cloud_cpp_type_phone_number_protos" + self.cpp_info.components["type_phone_number_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_phone_number_protos") self.cpp_info.components["type_postal_address_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_postal_address_protos"].libs = ["google_cloud_cpp_type_postal_address_protos"] - self.cpp_info.components["type_postal_address_protos"].names["pkg_config"] = "google_cloud_cpp_type_postal_address_protos" + self.cpp_info.components["type_postal_address_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_postal_address_protos") self.cpp_info.components["type_quaternion_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_quaternion_protos"].libs = ["google_cloud_cpp_type_quaternion_protos"] - self.cpp_info.components["type_quaternion_protos"].names["pkg_config"] = "google_cloud_cpp_type_quaternion_protos" + self.cpp_info.components["type_quaternion_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_quaternion_protos") self.cpp_info.components["type_timeofday_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf"] self.cpp_info.components["type_timeofday_protos"].libs = ["google_cloud_cpp_type_timeofday_protos"] - self.cpp_info.components["type_timeofday_protos"].names["pkg_config"] = "google_cloud_cpp_type_timeofday_protos" + self.cpp_info.components["type_timeofday_protos"].set_property("pkg_config_name", "google_cloud_cpp_type_timeofday_protos") self.cpp_info.components["cloud_dialogflow_v2_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "longrunning_operations_protos", "rpc_status_protos", "type_latlng_protos"] self.cpp_info.components["cloud_dialogflow_v2_protos"].libs = ["google_cloud_cpp_cloud_dialogflow_v2_protos"] - self.cpp_info.components["cloud_dialogflow_v2_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_dialogflow_v2_protos" + self.cpp_info.components["cloud_dialogflow_v2_protos"].set_property("pkg_config_name", "google_cloud_cpp_cloud_dialogflow_v2_protos") - if tools.Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before + if Version(self.version) < "1.40.1": # FIXME: Probably this library was removed before self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].requires = ["grpc::grpc++", "grpc::grpc", "protobuf::libprotobuf", "api_annotations_protos", "api_client_protos", "api_field_behavior_protos", "api_resource_protos", "longrunning_operations_protos", "rpc_status_protos", "type_latlng_protos"] self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].libs = ["google_cloud_cpp_cloud_dialogflow_v2beta1_protos"] - self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].names["pkg_config"] = "google_cloud_cpp_cloud_dialogflow_v2beta1_protos" + self.cpp_info.components["cloud_dialogflow_v2beta1_protos"].set_property("pkg_config_name", "google_cloud_cpp_cloud_dialogflow_v2beta1_protos") self.cpp_info.components["grpc_utils"].requires = ["abseil::absl_function_ref", "abseil::absl_memory", "abseil::absl_time", "rpc_status_protos", "common", "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" + self.cpp_info.components["grpc_utils"].set_property("pkg_config_name", "google_cloud_cpp_grpc_utils") self.cpp_info.components["experimental-iam"].requires = ["grpc_utils", "common", "iam_protos"] self.cpp_info.components["experimental-iam"].libs = ["google_cloud_cpp_iam"] - self.cpp_info.components["experimental-iam"].names["pkg_config"] = "google_cloud_cpp_iam" + self.cpp_info.components["experimental-iam"].set_property("pkg_config_name", "google_cloud_cpp_iam") self.cpp_info.components["experimental-logging"].requires = ["grpc_utils", "common", "logging_protos"] self.cpp_info.components["experimental-logging"].libs = ["google_cloud_cpp_logging"] - self.cpp_info.components["experimental-logging"].names["pkg_config"] = "google_cloud_cpp_logging" + self.cpp_info.components["experimental-logging"].set_property("pkg_config_name", "google_cloud_cpp_logging") self.cpp_info.components["pubsub"].requires = ["grpc_utils", "common", "pubsub_protos", "abseil::absl_flat_hash_map"] self.cpp_info.components["pubsub"].libs = ["google_cloud_cpp_pubsub"] - self.cpp_info.components["pubsub"].names["pkg_config"] = "google_cloud_cpp_pubsub" + self.cpp_info.components["pubsub"].set_property("pkg_config_name", "google_cloud_cpp_pubsub") self.cpp_info.components["spanner"].requires = ["abseil::absl_fixed_array", "abseil::absl_memory", "abseil::absl_numeric", "abseil::absl_strings", "abseil::absl_time", "grpc_utils", "common", "spanner_protos"] self.cpp_info.components["spanner"].libs = ["google_cloud_cpp_spanner"] - self.cpp_info.components["spanner"].names["pkg_config"] = "google_cloud_cpp_spanner" + self.cpp_info.components["spanner"].set_property("pkg_config_name", "google_cloud_cpp_spanner") self.cpp_info.components["storage"].requires = ["abseil::absl_memory", "abseil::absl_strings", "abseil::absl_str_format", "abseil::absl_time", "abseil::absl_variant", "common", "nlohmann_json::nlohmann_json", "crc32c::crc32c", "libcurl::libcurl", "openssl::ssl", "openssl::crypto"] self.cpp_info.components["storage"].libs = ["google_cloud_cpp_storage"] - self.cpp_info.components["storage"].names["pkg_config"] = "google_cloud_cpp_storage" + self.cpp_info.components["storage"].set_property("pkg_config_name", "google_cloud_cpp_storage") diff --git a/recipes/google-cloud-cpp/all/patches/0001-googleapis-folder.patch b/recipes/google-cloud-cpp/all/patches/0001-googleapis-folder.patch deleted file mode 100644 index 0fc76cae5ba7c..0000000000000 --- a/recipes/google-cloud-cpp/all/patches/0001-googleapis-folder.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/external/googleapis/CMakeLists.txt b/external/googleapis/CMakeLists.txt -index c3f1ef1..fb65356 100644 ---- a/external/googleapis/CMakeLists.txt -+++ b/external/googleapis/CMakeLists.txt -@@ -25,7 +25,7 @@ set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256 - "6762083f829f998c3971efa2ba858c21d4ac4ba77feb9650bad7d358e3add2a5") - - set(EXTERNAL_GOOGLEAPIS_SOURCE -- "${CMAKE_BINARY_DIR}/external/googleapis/src/googleapis_download") -+ "${PROJECT_BINARY_DIR}/external/googleapis/src/googleapis_download") - - set(EXTERNAL_GOOGLEAPIS_PROTO_FILES - "google/api/http.proto" -@@ -161,7 +161,7 @@ include(ExternalProject) - ExternalProject_Add( - googleapis_download - EXCLUDE_FROM_ALL ON -- PREFIX "${CMAKE_BINARY_DIR}/external/googleapis" -+ PREFIX "${PROJECT_BINARY_DIR}/external/googleapis" - URL ${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL} - URL_HASH SHA256=${GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256} - PATCH_COMMAND diff --git a/recipes/google-cloud-cpp/all/test_package/CMakeLists.txt b/recipes/google-cloud-cpp/all/test_package/CMakeLists.txt index a657ae7a34ce1..7ec50c6e07dfe 100644 --- a/recipes/google-cloud-cpp/all/test_package/CMakeLists.txt +++ b/recipes/google-cloud-cpp/all/test_package/CMakeLists.txt @@ -1,14 +1,8 @@ -cmake_minimum_required(VERSION 3.5) -project(google-cloud-cpp-storage-quickstart CXX C) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(google-cloud-cpp REQUIRED CONFIG) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -find_package(google-cloud-cpp REQUIRED) - -# Once the packages are found, define the targets. -add_executable(storage storage.cpp) -target_link_libraries(storage google-cloud-cpp::storage) +add_executable(${PROJECT_NAME} storage.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE google-cloud-cpp::storage) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/google-cloud-cpp/all/test_package/conanfile.py b/recipes/google-cloud-cpp/all/test_package/conanfile.py index 39f0d1104e661..9adb575c7818b 100644 --- a/recipes/google-cloud-cpp/all/test_package/conanfile.py +++ b/recipes/google-cloud-cpp/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, cmake_layout 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 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", "storage") - self.run("%s bucket_name" % bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(f"{bin_path} bucket_name", env="conanrun") diff --git a/recipes/google-cloud-cpp/config.yml b/recipes/google-cloud-cpp/config.yml index ad2df7e79e43a..fc485bd919336 100644 --- a/recipes/google-cloud-cpp/config.yml +++ b/recipes/google-cloud-cpp/config.yml @@ -1,17 +1,13 @@ versions: - "1.26.1": - folder: "all" - "1.27.0": - folder: "all" - "1.30.1": - folder: "all" - "1.31.1": - folder: "all" - "1.40.1": - folder: "all" - "2.5.0": + "2.28.0": folder: "2.x" - "2.12.0": + "2.19.0": folder: "2.x" "2.15.1": folder: "2.x" + "1.40.1": + folder: "all" + "1.31.1": + folder: "all" + "1.30.1": + folder: "all" diff --git a/recipes/googleapis/all/test_package/CMakeLists.txt b/recipes/googleapis/all/test_package/CMakeLists.txt index aba09b40ee6df..b657f3e7bdeed 100644 --- a/recipes/googleapis/all/test_package/CMakeLists.txt +++ b/recipes/googleapis/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(googleapis REQUIRED CONFIG) diff --git a/recipes/googleapis/all/test_v1_package/CMakeLists.txt b/recipes/googleapis/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/googleapis/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/googleapis/all/test_v1_package/conanfile.py b/recipes/googleapis/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/googleapis/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/gperf/all/conanfile.py b/recipes/gperf/all/conanfile.py index 6527eca9695ee..0ed1afdf40204 100644 --- a/recipes/gperf/all/conanfile.py +++ b/recipes/gperf/all/conanfile.py @@ -39,6 +39,10 @@ def build_requirements(self): if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") + # gperf makefile relies on GNU Make behaviour + if self._settings_build.os == "FreeBSD": + self.tool_requires("make/4.4.1") + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) diff --git a/recipes/gperf/all/test_v1_package/conanfile.py b/recipes/gperf/all/test_v1_package/conanfile.py deleted file mode 100644 index 45466856213a3..0000000000000 --- a/recipes/gperf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,9 +0,0 @@ -from conans import ConanFile, tools - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - if not tools.cross_building(self): - self.run("gperf --version", run_environment=True) diff --git a/recipes/gperftools/all/conandata.yml b/recipes/gperftools/all/conandata.yml index b141978957b85..fe3e23057591f 100644 --- a/recipes/gperftools/all/conandata.yml +++ b/recipes/gperftools/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.16": + url: "https://github.com/gperftools/gperftools/releases/download/gperftools-2.16/gperftools-2.16.tar.gz" + sha256: "f12624af5c5987f2cc830ee534f754c3c5961eec08004c26a8b80de015cf056f" + "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" diff --git a/recipes/gperftools/all/conanfile.py b/recipes/gperftools/all/conanfile.py index d1bcecf43d394..9b3639725e4ab 100644 --- a/recipes/gperftools/all/conanfile.py +++ b/recipes/gperftools/all/conanfile.py @@ -1,7 +1,7 @@ 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.build import cross_building, check_min_cppstd, stdcpp_library 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 @@ -59,7 +59,19 @@ class GperftoolsConan(ConanFile): @property def _min_cppstd(self): - return 11 + return "11" if Version(self.version) < "2.16" else "17" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) def config_options(self): if self.settings.os == "Windows": @@ -93,6 +105,11 @@ def layout(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 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.") @@ -184,12 +201,7 @@ def build(self): autotools.make() def package(self): - copy( - self, - pattern="COPYING", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) autotools.install() @@ -200,6 +212,9 @@ def package(self): def _add_component(self, lib): self.cpp_info.components[lib].libs = [lib] + self.cpp_info.components[lib].set_property("pkg_config_name", f"lib{lib}") + if stdcpp_library(self): + self.cpp_info.components[lib].system_libs.append(stdcpp_library(self)) def package_info(self): self._add_component("tcmalloc_minimal") @@ -217,6 +232,8 @@ def package_info(self): for component in self.cpp_info.components.values(): if self.settings.os in ["Linux", "FreeBSD"]: component.system_libs.extend(["pthread", "m"]) + component.cflags.append("-pthread") + component.cxxflags.append("-pthread") if self.options.get_safe("enable_libunwind"): component.requires.append("libunwind::libunwind") diff --git a/recipes/gperftools/all/test_package/CMakeLists.txt b/recipes/gperftools/all/test_package/CMakeLists.txt index 0f311015a73f5..5baf67b50cd5e 100644 --- a/recipes/gperftools/all/test_package/CMakeLists.txt +++ b/recipes/gperftools/all/test_package/CMakeLists.txt @@ -1,12 +1,11 @@ cmake_minimum_required(VERSION 3.15) -project(test_package LANGUAGES CXX) +project(test_package LANGUAGES C) find_package(gperftools REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) +add_executable(${PROJECT_NAME} test_package.c) 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) +add_executable(${PROJECT_NAME}_minimal test_package.c) 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/test_package.c b/recipes/gperftools/all/test_package/test_package.c new file mode 100644 index 0000000000000..1c8031c880cd6 --- /dev/null +++ b/recipes/gperftools/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include + +#include +#include +#include + +int main() { + void *p = tc_malloc(100); + tc_free(p); + puts(tc_version(NULL, NULL, NULL)); + return p == 0 ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/recipes/gperftools/all/test_package/test_package.cpp b/recipes/gperftools/all/test_package/test_package.cpp deleted file mode 100644 index ee9b96dfbc3cd..0000000000000 --- a/recipes/gperftools/all/test_package/test_package.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#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 index 65392d0c25ec5..11bc45e75f53f 100644 --- a/recipes/gperftools/config.yml +++ b/recipes/gperftools/config.yml @@ -1,4 +1,10 @@ versions: + "2.16": + folder: all + "2.15": + folder: all + "2.14.0": + folder: all "2.13.0": folder: all "2.12.0": diff --git a/recipes/graaf/all/conandata.yml b/recipes/graaf/all/conandata.yml new file mode 100644 index 0000000000000..917a61c227f2b --- /dev/null +++ b/recipes/graaf/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.1": + url: "https://github.com/bobluppes/graaf/archive/v1.1.1.tar.gz" + sha256: "2829e160c44463763faed593bb5b62e9bdfa26554c1fe949f564f2ca622381ff" diff --git a/recipes/graaf/all/conanfile.py b/recipes/graaf/all/conanfile.py new file mode 100644 index 0000000000000..9243ad086b838 --- /dev/null +++ b/recipes/graaf/all/conanfile.py @@ -0,0 +1,46 @@ +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 = ">=2" + + +class GraafConan(ConanFile): + name = "graaf" + description = ( + "Graaf: A Lightweight, Header-Only C++20 Graph Library." + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bobluppes/graaf" + topics = ("graph", "header-only") + settings = "compiler" + package_type = "header-library" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + check_min_cppstd(self, 20) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE.md", 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.set_property("cmake_file_name", "graaflib") + self.cpp_info.set_property("cmake_target_name", "Graaf::Graaf") diff --git a/recipes/graaf/all/test_package/CMakeLists.txt b/recipes/graaf/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0159454d323df --- /dev/null +++ b/recipes/graaf/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(graaflib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +target_link_libraries(${PROJECT_NAME} PRIVATE Graaf::Graaf) diff --git a/recipes/graaf/all/test_package/conanfile.py b/recipes/graaf/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/graaf/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/graaf/all/test_package/test_package.cpp b/recipes/graaf/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a00eda9d6806a --- /dev/null +++ b/recipes/graaf/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +int main() +{ + graaf::directed_graph g; + + const auto a = g.add_vertex('a'); + const auto b = g.add_vertex('b'); + const auto c = g.add_vertex('c'); + + g.add_edge(a, b, 1); + g.add_edge(a, c, 1); + + return 0; +} diff --git a/recipes/graaf/config.yml b/recipes/graaf/config.yml new file mode 100644 index 0000000000000..60d31991f5141 --- /dev/null +++ b/recipes/graaf/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.1": + folder: all diff --git a/recipes/graphene/all/conanfile.py b/recipes/graphene/all/conanfile.py index 8f5581630fd90..ccf6c76d58f43 100644 --- a/recipes/graphene/all/conanfile.py +++ b/recipes/graphene/all/conanfile.py @@ -51,7 +51,7 @@ def layout(self): def requirements(self): if self.options.with_glib: - self.requires("glib/2.78.0") + self.requires("glib/2.78.3") def validate(self): if self.settings.compiler == "gcc": @@ -70,9 +70,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.3.1") if not self.conf.get("tools.gnu:pkg_config", default=False): - self.tool_requires("pkgconf/2.0.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/graphene/all/test_package/CMakeLists.txt b/recipes/graphene/all/test_package/CMakeLists.txt index 086ffbaad4058..0568fb7e83c54 100644 --- a/recipes/graphene/all/test_package/CMakeLists.txt +++ b/recipes/graphene/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(graphene CONFIG REQUIRED) diff --git a/recipes/graphthewy/all/test_v1_package/CMakeLists.txt b/recipes/graphthewy/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/graphthewy/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 3c2537c3ee226..0000000000000 --- a/recipes/graphthewy/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/greg7mdp-gtl/all/conandata.yml b/recipes/greg7mdp-gtl/all/conandata.yml index c22694a6e750c..b401f2186d351 100644 --- a/recipes/greg7mdp-gtl/all/conandata.yml +++ b/recipes/greg7mdp-gtl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://github.com/greg7mdp/gtl/archive/refs/tags/v1.2.0.tar.gz" + sha256: "1547ab78f62725c380f50972f7a49ffd3671ded17a3cb34305da5c953c6ba8e7" "1.1.8": url: "https://github.com/greg7mdp/gtl/archive/v1.1.8.tar.gz" sha256: "6bda4c07bd966a88740ee07e3df23863a93d7b5365e0eea7f13cde9eda961b86" diff --git a/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt b/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt index 4de04c5c56508..b11453244aa1d 100644 --- a/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt +++ b/recipes/greg7mdp-gtl/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(gtl REQUIRED CONFIG) diff --git a/recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt b/recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9652e22fc19d5..0000000000000 --- a/recipes/greg7mdp-gtl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/greg7mdp-gtl/all/test_v1_package/conanfile.py b/recipes/greg7mdp-gtl/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/greg7mdp-gtl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/greg7mdp-gtl/config.yml b/recipes/greg7mdp-gtl/config.yml index cd16082304dc7..ae3262a541e37 100644 --- a/recipes/greg7mdp-gtl/config.yml +++ b/recipes/greg7mdp-gtl/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.8": folder: all "1.1.5": diff --git a/recipes/grpc-proto/all/CMakeLists.txt b/recipes/grpc-proto/all/CMakeLists.txt index bdbe441b33bae..a2b761bc5bc2d 100644 --- a/recipes/grpc-proto/all/CMakeLists.txt +++ b/recipes/grpc-proto/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(grpc-proto) diff --git a/recipes/grpc-proto/all/test_package/CMakeLists.txt b/recipes/grpc-proto/all/test_package/CMakeLists.txt index 3ea2dba3ece4d..90b909f54d07b 100644 --- a/recipes/grpc-proto/all/test_package/CMakeLists.txt +++ b/recipes/grpc-proto/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(grpc-proto REQUIRED CONFIG) diff --git a/recipes/grpc-proto/all/test_v1_package/CMakeLists.txt b/recipes/grpc-proto/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 02d1682084fb5..0000000000000 --- a/recipes/grpc-proto/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_v1_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/grpc-proto/all/test_v1_package/conanfile.py b/recipes/grpc-proto/all/test_v1_package/conanfile.py deleted file mode 100644 index 85f1fc3729bb9..0000000000000 --- a/recipes/grpc-proto/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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 requirements(self): - self.requires(self.tested_reference_str) - - 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/grpc/all/cmake/grpc_plugin_template.cmake.in b/recipes/grpc/all/cmake/grpc_plugin_template.cmake.in index 4685c5c34b8fc..5ab1d94fab8cd 100644 --- a/recipes/grpc/all/cmake/grpc_plugin_template.cmake.in +++ b/recipes/grpc/all/cmake/grpc_plugin_template.cmake.in @@ -1,28 +1,28 @@ if(NOT TARGET @target_name@) + # Find @executable_name@ + ## Workaround for legacy "cmake" generator in case of cross-build if(CMAKE_CROSSCOMPILING) find_program(@find_program_variable@ NAMES @executable_name@ PATHS ENV PATH NO_DEFAULT_PATH ) - else() + endif() + ## And here this will work fine with "CMakeToolchain" (for native & cross-build) + ## and legacy "cmake" generator in case of native build + if(NOT @find_program_variable@) + find_program(@find_program_variable@ NAMES @executable_name@) + endif() + ## Last resort: we search in package folder directly + if(NOT @find_program_variable@) find_program(@find_program_variable@ NAMES @executable_name@ PATHS "${CMAKE_CURRENT_LIST_DIR}/@relative_path@bin/" NO_DEFAULT_PATH ) endif() - # TODO: In conan v2 with CMakeToolchain, can be replaced by: - # find_program(@find_program_variable@ NAMES @executable_name@)) - # # Nice enough to handle grpc not in build_requires for native build - # if(NOT @find_program_variable@ AND NOT CMAKE_CROSSCOMPILING) - # find_program(@find_program_variable@ - # NAMES @executable_name@ - # PATHS "${CMAKE_CURRENT_LIST_DIR}/@relative_path@bin/" - # NO_DEFAULT_PATH - # ) - # endif() + # Define @target_name@ imported target if(@find_program_variable@) get_filename_component(@find_program_variable@ "${@find_program_variable@}" ABSOLUTE) add_executable(@target_name@ IMPORTED) diff --git a/recipes/grpc/all/conandata.yml b/recipes/grpc/all/conandata.yml index 02c1ca609ebd2..c44ee7e68be74 100644 --- a/recipes/grpc/all/conandata.yml +++ b/recipes/grpc/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.71.0": + url: "https://github.com/grpc/grpc/archive/v1.71.0.tar.gz" + sha256: "0d631419e54ec5b29def798623ee3bf5520dac77abeab3284ef7027ec2363f91" + "1.69.0": + url: "https://github.com/grpc/grpc/archive/v1.69.0.tar.gz" + sha256: "cd256d91781911d46a57506978b3979bfee45d5086a1b6668a3ae19c5e77f8dc" + "1.67.1": + url: "https://github.com/grpc/grpc/archive/v1.67.1.tar.gz" + sha256: "d74f8e99a433982a12d7899f6773e285c9824e1d9a173ea1d1fb26c9bd089299" + "1.65.0": + url: "https://github.com/grpc/grpc/archive/v1.65.0.tar.gz" + sha256: "ebc3acfde70cfae3f4f04b8dbb72259540cb1dc427be362569fbc2607dabfe39" "1.54.3": url: "https://github.com/grpc/grpc/archive/v1.54.3.tar.gz" sha256: "17e4e1b100657b88027721220cbfb694d86c4b807e9257eaf2fb2d273b41b1b1" @@ -8,15 +20,12 @@ sources: "1.50.0": url: "https://github.com/grpc/grpc/archive/v1.50.0.tar.gz" sha256: "76900ab068da86378395a8e125b5cc43dfae671e09ff6462ddfef18676e2165a" - "1.48.4": - url: "https://github.com/grpc/grpc/archive/v1.48.4.tar.gz" - sha256: "0c3faa83e39d4f1ab55fe1476362b9ac3b81632a46dce7fd4d50271bce816b53" patches: + "1.54.3": + - patch_file: "patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch" + patch_type: "backport" + patch_source: "https://github.com/grpc/grpc/commit/5c3400e8dc08d0810e3301d7e8cd8a718c82eeed" "1.50.1": - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" "1.50.0": - patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch" - "1.48.4": - - patch_file: "patches/v1.48.x/001-disable-cppstd-override.patch" - patch_description: "disable cpp std override" - patch_type: "portability" diff --git a/recipes/grpc/all/conanfile.py b/recipes/grpc/all/conanfile.py index 998e680f1000a..1120094833241 100644 --- a/recipes/grpc/all/conanfile.py +++ b/recipes/grpc/all/conanfile.py @@ -1,27 +1,27 @@ import os +import yaml from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os -from conan.tools.build import can_run, cross_building, valid_min_cppstd, check_min_cppstd +from conan.tools.build import cross_building, valid_min_cppstd, check_min_cppstd from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rmdir from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0.5" class GrpcConan(ConanFile): name = "grpc" - package_type = "library" description = "Google's RPC (remote procedure call) library and framework." license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/grpc/grpc" topics = ("rpc",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -36,7 +36,9 @@ class GrpcConan(ConanFile): "php_plugin": [True, False], "python_plugin": [True, False], "ruby_plugin": [True, False], - "secure": [True, False] + "otel_plugin": [True, False], + "secure": [True, False], + "with_libsystemd": [True, False] } default_options = { "shared": False, @@ -50,10 +52,12 @@ class GrpcConan(ConanFile): "php_plugin": True, "python_plugin": True, "ruby_plugin": True, + "otel_plugin": False, "secure": False, + "with_libsystemd": True } - short_paths = True + _target_info = None @property def _grpc_plugin_template(self): @@ -61,7 +65,14 @@ def _grpc_plugin_template(self): @property def _cxxstd_required(self): - return 14 if Version(self.version) >= "1.47" else 11 + return 17 if Version(self.version) >= "1.70" else 14 + + @property + def _supports_libsystemd(self): + return self.settings.os in ["Linux", "FreeBSD"] and Version(self.version) >= "1.52" + + def export(self): + copy(self, f"target_info/grpc_{self.version}.yml", src=self.recipe_folder, dst=self.export_folder) def export_sources(self): copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) @@ -71,6 +82,10 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if not self._supports_libsystemd: + del self.options.with_libsystemd + if Version(self.version) < "1.65.0": + del self.options.otel_plugin def configure(self): if self.options.shared: @@ -84,25 +99,36 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - # abseil is public. See https://github.com/conan-io/conan-center-index/pull/17284#issuecomment-1526082638 - 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) + # abseil requires: + # transitive_headers=True because grpc headers include abseil headers + # transitive_libs=True because generated code (grpc_cpp_plugin) require symbols from abseil + if Version(self.version) > "1.65.0": + self.requires("protobuf/5.27.0", transitive_headers=True) + self.requires("abseil/[>=20240116.1 <=20250127.0]", transitive_headers=True, transitive_libs=True) + elif Version(self.version) >= "1.62.0" and Version(self.version) <= "1.65.0": + self.requires("protobuf/5.27.0", transitive_headers=True) + self.requires("abseil/[>=20240116.1 <20240117.0]", transitive_headers=True, transitive_libs=True) else: - self.requires("abseil/20230125.3", transitive_headers=True, transitive_libs=True) - self.requires("c-ares/1.19.1") + self.requires("abseil/[>=20230125.3 <=20230802.1]", transitive_headers=True, transitive_libs=True) + self.requires("protobuf/3.21.12", transitive_headers=True) + self.requires("c-ares/[>=1.19.1 <2]") self.requires("openssl/[>=1.1 <4]") self.requires("re2/20230301") self.requires("zlib/[>=1.2.11 <2]") - self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True, run=can_run(self)) + if self.options.get_safe("with_libsystemd"): + if Version(self.version) >= "1.67.0": + self.requires("libsystemd/255.10") + else: + self.requires("libsystemd/255") + if self.options.get_safe("otel_plugin"): + self.requires("opentelemetry-cpp/1.14.2") def package_id(self): del self.info.options.secure def validate(self): check_min_vs(self, "190") + if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} shared not supported by Visual Studio") @@ -112,16 +138,17 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._cxxstd_required) - 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("protobuf/3.21.12") + # cmake >=3.25 required to use `cmake -E env --modify` below + # note: grpc 1.69.0 requires cmake >=3.16 + self.tool_requires("cmake/[>=3.25 <4]") + self.tool_requires("protobuf/") if cross_building(self): # when cross compiling we need pre compiled grpc plugins for protoc self.tool_requires(f"grpc/{self.version}") @@ -130,11 +157,6 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - # Set up environment so that we can run grpc-cpp-plugin at build time - VirtualBuildEnv(self).generate() - if can_run(self): - VirtualRunEnv(self).generate(scope="build") - # This doesn't work yet as one would expect, because the install target builds everything # and we need the install target because of the generated CMake files # @@ -160,6 +182,7 @@ def generate(self): tc.cache_variables["gRPC_SSL_PROVIDER"] = "package" tc.cache_variables["gRPC_PROTOBUF_PROVIDER"] = "package" tc.cache_variables["gRPC_ABSL_PROVIDER"] = "package" + tc.cache_variables["gRPC_OPENTELEMETRY_PROVIDER"] = "package" tc.cache_variables["gRPC_BUILD_GRPC_CPP_PLUGIN"] = self.options.cpp_plugin tc.cache_variables["gRPC_BUILD_GRPC_CSHARP_PLUGIN"] = self.options.csharp_plugin @@ -168,6 +191,12 @@ def generate(self): tc.cache_variables["gRPC_BUILD_GRPC_PHP_PLUGIN"] = self.options.php_plugin tc.cache_variables["gRPC_BUILD_GRPC_PYTHON_PLUGIN"] = self.options.python_plugin tc.cache_variables["gRPC_BUILD_GRPC_RUBY_PLUGIN"] = self.options.ruby_plugin + tc.cache_variables["gRPC_BUILD_GRPCPP_OTEL_PLUGIN"] = self.options.get_safe("otel_plugin", False) + + # Never download unnecessary archives + # (supported in gRPC >= 1.62.0) + tc.cache_variables["gRPC_DOWNLOAD_ARCHIVES"] = False + # Consumed targets (abseil) via interface target_compiler_feature can propagate newer standards if not valid_min_cppstd(self, self._cxxstd_required): @@ -177,8 +206,11 @@ def generate(self): # workaround for: install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False - if is_msvc(self) and Version(self.version) >= "1.48": - tc.cache_variables["CMAKE_SYSTEM_VERSION"] = "10.0.18362.0" + if self._supports_libsystemd: + tc.cache_variables["gRPC_USE_SYSTEMD"] = self.options.with_libsystemd + + if Version(self.version) >= "1.62.0": + tc.cache_variables["gRPC_DOWNLOAD_ARCHIVES"] = False tc.generate() @@ -188,23 +220,53 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - # On macOS if all the following are true: - # - protoc from protobuf has shared library dependencies - # - grpc_cpp_plugin has shared library deps (when crossbuilding) - # - using `make` as the cmake generator - # Make will run commands via `/bin/sh` which will strip all env vars that start with `DYLD*` - # This workaround wraps the protoc command to be invoked by CMake with a modified environment - settings_build = getattr(self, "settings_build", self.settings) - if settings_build.os == "Macos": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + # Management of shared libs when grpc has shared dependencies (like protobuf) + # As the grpc_cpp_plugin that executes during the build will need those packages shared libs + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + variable, repl = None, None + if self.settings_build.os == "Macos": + # On macOS if all the following are true: + # - protoc from protobuf has shared library dependencies + # - grpc_cpp_plugin has shared library deps (when crossbuilding) + # - using `make` as the cmake generator + # Make will run commands via `/bin/sh` which will strip all env vars that start with `DYLD*` + # This workaround wraps the protoc command to be invoked by CMake with a modified environment + variable, repl = "DYLD_LIBRARY_PATH", "$ENV{DYLD_LIBRARY_PATH}" # to bypass OSX restrictions + elif not cross_building(self) and self.settings_build.os == "Linux": + # CMAKE_LIBRARY_PATH is defined by conan_toolchain.cmake, in Linux it is "lib" dir of .so dependencies + variable, repl = "LD_LIBRARY_PATH", "$" # to allow using protobuf/abseil as shared deps + elif not cross_building(self) and self.settings_build.os == "Windows": + # CONAN_RUNTIME_LIB_DIRS defined by conan_toolchain.cmake points to the "bin" folder in Linux, containing the DLLs + variable, repl = "PATH", "$" # to allow using protobuf/abseil as shared deps + + if variable and repl: + replace_in_file(self, cmakelists, "COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}", - 'COMMAND ${CMAKE_COMMAND} -E env "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}" ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}') + f'COMMAND ${{CMAKE_COMMAND}} -E env --modify "{variable}=path_list_prepend:{repl}" ${{_gRPC_PROTOBUF_PROTOC_EXECUTABLE}}') + + if self.settings.os == "Macos" and Version(self.version) >= "1.64": + # See https://github.com/grpc/grpc/issues/36654#issuecomment-2228569158 + replace_in_file(self, cmakelists, f"target_compile_features(upb_textformat_lib PUBLIC cxx_std_{self._cxxstd_required})", + f"""target_compile_features(upb_textformat_lib PUBLIC cxx_std_{self._cxxstd_required}) + target_link_options(upb_textformat_lib PRIVATE -Wl,-undefined,dynamic_lookup) + target_link_options(upb_json_lib PRIVATE -Wl,-undefined,dynamic_lookup) + """) + def build(self): self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() + @property + def target_info(self): + if self._target_info: + return self._target_info + target_info_file = os.path.join(self.recipe_folder, "target_info", f"grpc_{self.version}.yml") + with open(target_info_file) as f: + self._target_info = yaml.safe_load(f) + return self._target_info + def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) @@ -214,46 +276,14 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) # Create one custom module file per executable in order to emulate - # CMake executables imported targets of grpc - for plugin_option, values in self._grpc_plugins.items(): - if self.options.get_safe(plugin_option): - target = values["target"] - executable = values["executable"] + # CMake executables imported targets of grpc plugins. + for plugin_info in self.target_info["grpc_plugins"]: + target = plugin_info["target"] + executable = plugin_info["executable"] + option_name = executable.replace("grpc_", "") + if self.options.get_safe(option_name): self._create_executable_module_file(target, executable) - @property - def _grpc_plugins(self): - return { - "cpp_plugin": { - "target": "gRPC::grpc_cpp_plugin", - "executable": "grpc_cpp_plugin", - }, - "csharp_plugin": { - "target": "gRPC::grpc_csharp_plugin", - "executable": "grpc_csharp_plugin", - }, - "node_plugin": { - "target": "gRPC::grpc_node_plugin", - "executable": "grpc_node_plugin", - }, - "objective_c_plugin": { - "target": "gRPC::grpc_objective_c_plugin", - "executable": "grpc_objective_c_plugin", - }, - "php_plugin": { - "target": "gRPC::grpc_php_plugin", - "executable": "grpc_php_plugin", - }, - "python_plugin": { - "target": "gRPC::grpc_python_plugin", - "executable": "grpc_python_plugin", - }, - "ruby_plugin": { - "target": "gRPC::grpc_ruby_plugin", - "executable": "grpc_ruby_plugin", - }, - } - def _create_executable_module_file(self, target, executable): module_abs_path = os.path.join(self.package_folder, self._module_path) @@ -281,111 +311,27 @@ def _module_path(self): @property def _grpc_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 crypt32(): - return ["crypt32"] if self.settings.os == "Windows" else [] - - def ws2_32(): - return ["ws2_32"] if self.settings.os == "Windows" else [] - - def wsock32(): - return ["wsock32"] if self.settings.os == "Windows" else [] - - def corefoundation(): - return ["CoreFoundation"] if is_apple_os(self) else [] - - components = { - "address_sorting": { - "lib": "address_sorting", - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - }, - "gpr": { - "lib": "gpr", - "requires": [ - "upb", "abseil::absl_base", "abseil::absl_memory", - "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(), - }, - "_grpc": { - "lib": "grpc", - "requires": [ - "address_sorting", "gpr", "upb", "abseil::absl_bind_front", - "abseil::absl_flat_hash_map", "abseil::absl_inlined_vector", - "abseil::absl_statusor", "abseil::absl_random_random", - "c-ares::cares", "openssl::crypto", - "openssl::ssl", "re2::re2", "zlib::zlib", - ], - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - "frameworks": corefoundation(), - }, - "grpc++": { - "lib": "grpc++", - "requires": ["_grpc", "protobuf::libprotobuf"], - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - }, - "grpc++_alts": { - "lib": "grpc++_alts", - "requires": ["grpc++", "protobuf::libprotobuf"], - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - }, - "grpc++_error_details": { - "lib": "grpc++_error_details", - "requires": ["grpc++", "protobuf::libprotobuf"], - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - }, - "upb": { - "lib": "upb", - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - }, - "grpc_plugin_support": { - "lib": "grpc_plugin_support", - "requires": ["protobuf::libprotoc", "protobuf::libprotobuf"], - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - }, - } - - if not self.options.secure: - components.update({ - "grpc_unsecure": { - "lib": "grpc_unsecure", - "requires": [ - "address_sorting", "gpr", "upb", "abseil::absl_flat_hash_map", - "abseil::absl_inlined_vector", "abseil::absl_statusor", - "c-ares::cares", "re2::re2", "zlib::zlib", - "abseil::absl_random_random", - ], - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - "frameworks": corefoundation(), - }, - "grpc++_unsecure": { - "lib": "grpc++_unsecure", - "requires": ["grpc_unsecure", "protobuf::libprotobuf"], - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - }, - }) - - if self.options.codegen: - components.update({ - "grpc++_reflection": { - "lib": "grpc++_reflection", - "requires": ["grpc++", "protobuf::libprotobuf"], - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - }, - "grpcpp_channelz": { - "lib": "grpcpp_channelz", - "requires": ["grpc++", "protobuf::libprotobuf"], - "system_libs": libm() + pthread() + crypt32() + ws2_32() + wsock32(), - }, - }) + system_libs = [] + if self.settings.os == "Windows": + system_libs = ["crypt32", "ws2_32", "wsock32"] + elif self.settings.os in ["Linux", "FreeBSD"]: + system_libs = ["m", "pthread"] + + libsystemd = ["libsystemd::libsystemd"] if self._supports_libsystemd and self.options.with_libsystemd else [] + + targets = self.target_info['grpc_targets'] + components = {} + for target in targets: + if self.options.secure and target['name'] in ["grpc_unsecure", "grpc++_unsecure"]: + continue + if not self.options.codegen and target['name'] in ["grpc++_reflection", "grpcpp_channelz"]: + continue + components[target['name']] = { + "lib": target['lib'], + "requires": target.get('requires', []) + libsystemd, + "system_libs": system_libs, + "frameworks": target.get('frameworks', []), + } return components @@ -394,7 +340,6 @@ def package_info(self): self.cpp_info.resdirs = ["res"] ssl_roots_file_path = os.path.join(self.package_folder, "res", "grpc", "roots.pem") self.runenv_info.define_path("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", ssl_roots_file_path) - self.env_info.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH = ssl_roots_file_path # remove in conan v2? for component, values in self._grpc_components.items(): target = values.get("lib") @@ -405,29 +350,16 @@ def package_info(self): self.cpp_info.components[component].libs = [lib] self.cpp_info.components[component].requires = values.get("requires", []) self.cpp_info.components[component].system_libs = values.get("system_libs", []) - self.cpp_info.components[component].frameworks = values.get("frameworks", []) - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components[component].names["cmake_find_package"] = target - self.cpp_info.components[component].names["cmake_find_package_multi"] = target + if is_apple_os(self): + self.cpp_info.components[component].frameworks = values.get("frameworks", []) # Executable imported targets are added through custom CMake module files, # since conan generators don't know how to emulate these kind of targets. grpc_modules = [] - for plugin_option, values in self._grpc_plugins.items(): - if self.options.get_safe(plugin_option): - grpc_module_filename = "{}.cmake".format(values["executable"]) + for plugin_info in self.target_info["grpc_plugins"]: + executable = plugin_info["executable"] + option_name = executable.replace("grpc_", "") + if self.options.get_safe(option_name): + grpc_module_filename = "{}.cmake".format(executable) grpc_modules.append(os.path.join(self._module_path, grpc_module_filename)) self.cpp_info.set_property("cmake_build_modules", grpc_modules) - - if any(self.options.get_safe(plugin_option) for plugin_option in self._grpc_plugins.keys()): - 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.cpp_info.names["cmake_find_package"] = "gRPC" - self.cpp_info.names["cmake_find_package_multi"] = "gRPC" - if grpc_modules: - self.cpp_info.components["grpc_execs"].build_modules["cmake_find_package"] = grpc_modules - self.cpp_info.components["grpc_execs"].build_modules["cmake_find_package_multi"] = grpc_modules 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 deleted file mode 100644 index dee7836ac518b..0000000000000 --- a/recipes/grpc/all/patches/v1.48.x/001-disable-cppstd-override.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1ecaea8eb7..0788b88177 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -226,21 +226,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) --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/src/core/ext/xds/xds_http_fault_filter.cc b/src/core/ext/xds/xds_http_fault_filter.cc -index 2a10d2fd27..0900fedf61 100644 ---- a/src/core/ext/xds/xds_http_fault_filter.cc -+++ b/src/core/ext/xds/xds_http_fault_filter.cc -@@ -109,7 +109,7 @@ absl::StatusOr ParseHttpFaultIntoJson( - int abort_http_status_code = - envoy_extensions_filters_http_fault_v3_FaultAbort_http_status( - fault_abort); -- if (abort_http_status_code != 0 and abort_http_status_code != 200) { -+ if (abort_http_status_code != 0 && abort_http_status_code != 200) { - abort_grpc_status_code = - grpc_http2_status_to_grpc_status(abort_http_status_code); - } diff --git a/recipes/grpc/all/patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch b/recipes/grpc/all/patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch new file mode 100644 index 0000000000000..a0b7846cd9ddb --- /dev/null +++ b/recipes/grpc/all/patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch @@ -0,0 +1,57 @@ +From 64d855b0ddd944369e96b24210a1ce59e704a779 Mon Sep 17 00:00:00 2001 +From: Kirill +Date: Tue, 2 Apr 2024 13:17:47 -0700 +Subject: [PATCH] [CMake] Add gRPC_USE_SYSTEMD option (#34384) + +Issue https://github.com/grpc/grpc/issues/34304 + +Allows to disable systemd support, +as well as linking with libsystemd, +when it is not required. + +The option has three possible values: +AUTO - Default, Will try to find libsystemd. If found, systemd support will be enabled. +ON - Enable systemd support. Build will fail if libsystemd is not found. +OFF - Disable systemd support. + +Closes #34384 + +COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34384 from kirpichik:cmake-use-systemd-option 96f5f4bd68251ca62ccc45a2d44a68a8203531ac +PiperOrigin-RevId: 621274356 +--- + cmake/systemd.cmake | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake +index a34210177e..559c8d24b6 100644 +--- a/cmake/systemd.cmake ++++ b/cmake/systemd.cmake +@@ -12,9 +12,20 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-find_package(systemd) +-if(TARGET systemd) +- set(_gRPC_SYSTEMD_LIBRARIES systemd ${SYSTEMD_LINK_LIBRARIES}) +- add_definitions(-DHAVE_LIBSYSTEMD) ++set(gRPC_USE_SYSTEMD "AUTO" CACHE STRING "Build with libsystemd support if available. Can be ON, OFF or AUTO") ++ ++if (NOT gRPC_USE_SYSTEMD STREQUAL "OFF") ++ if (gRPC_USE_SYSTEMD STREQUAL "ON") ++ find_package(systemd REQUIRED) ++ elseif (gRPC_USE_SYSTEMD STREQUAL "AUTO") ++ find_package(systemd) ++ else() ++ message(FATAL_ERROR "Unknown value for gRPC_USE_SYSTEMD = ${gRPC_USE_SYSTEMD}") ++ endif() ++ ++ if(TARGET systemd) ++ set(_gRPC_SYSTEMD_LIBRARIES systemd ${SYSTEMD_LINK_LIBRARIES}) ++ add_definitions(-DHAVE_LIBSYSTEMD) ++ endif() ++ set(_gRPC_FIND_SYSTEMD "if(NOT systemd_FOUND)\n find_package(systemd)\nendif()") + endif() +-set(_gRPC_FIND_SYSTEMD "if(NOT systemd_FOUND)\n find_package(systemd)\nendif()") +-- +2.43.0 + diff --git a/recipes/grpc/all/target_info/grpc_1.50.0.yml b/recipes/grpc/all/target_info/grpc_1.50.0.yml new file mode 100644 index 0000000000000..693b7c8e2a330 --- /dev/null +++ b/recipes/grpc/all/target_info/grpc_1.50.0.yml @@ -0,0 +1,120 @@ +grpc_version: 1.50.0 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + - name: "gpr" + lib: "gpr" + requires: + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_memory + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_any_invocable + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_any_invocable + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc++" + lib: "grpc++" + requires: + - protobuf::libprotobuf + - abseil::absl_cleanup + - _grpc + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - protobuf::libprotobuf + - grpc_unsecure + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - protobuf::libprotoc + - protobuf::libprotobuf + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "upb" + lib: "upb" +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" diff --git a/recipes/grpc/all/target_info/grpc_1.50.1.yml b/recipes/grpc/all/target_info/grpc_1.50.1.yml new file mode 100644 index 0000000000000..3bf059795e135 --- /dev/null +++ b/recipes/grpc/all/target_info/grpc_1.50.1.yml @@ -0,0 +1,120 @@ +grpc_version: 1.50.1 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + - name: "gpr" + lib: "gpr" + requires: + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_memory + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_any_invocable + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_any_invocable + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc++" + lib: "grpc++" + requires: + - protobuf::libprotobuf + - abseil::absl_cleanup + - _grpc + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - protobuf::libprotobuf + - grpc_unsecure + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - protobuf::libprotoc + - protobuf::libprotobuf + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - protobuf::libprotobuf + - grpc++ + - name: "upb" + lib: "upb" +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" diff --git a/recipes/grpc/all/target_info/grpc_1.54.3.yml b/recipes/grpc/all/target_info/grpc_1.54.3.yml new file mode 100644 index 0000000000000..a97cd9a17b217 --- /dev/null +++ b/recipes/grpc/all/target_info/grpc_1.54.3.yml @@ -0,0 +1,152 @@ +grpc_version: 1.54.3 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + requires: + - zlib::zlib + - name: "gpr" + lib: "gpr" + requires: + - zlib::zlib + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_flags + - abseil::absl_flags_marshalling + - abseil::absl_any_invocable + - abseil::absl_memory + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - zlib::zlib + - c-ares::cares + - address_sorting + - re2::re2 + - upb + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - address_sorting + - upb + frameworks: ['CoreFoundation'] + - name: "grpc++" + lib: "grpc++" + requires: + - protobuf::libprotobuf + - zlib::zlib + - _grpc + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc_unsecure + - name: "grpc_authorization_provider" + lib: "grpc_authorization_provider" + requires: + - protobuf::libprotobuf + - zlib::zlib + - re2::re2 + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - gpr + - upb + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - protobuf::libprotoc + - protobuf::libprotobuf + - zlib::zlib + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - protobuf::libprotobuf + - zlib::zlib + - grpc++ + - name: "upb" + lib: "upb" + requires: + - zlib::zlib +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" diff --git a/recipes/grpc/all/target_info/grpc_1.65.0.yml b/recipes/grpc/all/target_info/grpc_1.65.0.yml new file mode 100644 index 0000000000000..14d6c7bc379f9 --- /dev/null +++ b/recipes/grpc/all/target_info/grpc_1.65.0.yml @@ -0,0 +1,176 @@ +grpc_version: 1.65.0 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + - name: "gpr" + lib: "gpr" + requires: + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_log_severity + - abseil::absl_flags + - abseil::absl_flags_marshalling + - abseil::absl_any_invocable + - abseil::absl_check + - abseil::absl_log_globals + - abseil::absl_log + - abseil::absl_memory + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - upb_json_lib + - upb_textformat_lib + - re2::re2 + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - utf8_range_lib + - upb_message_lib + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + frameworks: ['CoreFoundation'] + - name: "upb_base_lib" + lib: "upb_base_lib" + - name: "upb_json_lib" + lib: "upb_json_lib" + requires: + - utf8_range_lib + - upb_message_lib + - name: "upb_mem_lib" + lib: "upb_mem_lib" + - name: "upb_message_lib" + lib: "upb_message_lib" + requires: + - upb_base_lib + - upb_mem_lib + - name: "upb_textformat_lib" + lib: "upb_textformat_lib" + requires: + - utf8_range_lib + - upb_message_lib + - name: "utf8_range_lib" + lib: "utf8_range_lib" + - name: "grpc++" + lib: "grpc++" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - _grpc + - protobuf::libprotobuf + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - grpc_unsecure + - protobuf::libprotobuf + - name: "grpc_authorization_provider" + lib: "grpc_authorization_provider" + requires: + - utf8_range_lib + - upb_message_lib + - re2::re2 + - zlib::zlib + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - protobuf::libprotobuf + - protobuf::libprotoc + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - grpc++ +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" + - target: "gRPC::grpc_otel_plugin" + executable: "grpc_otel_plugin" diff --git a/recipes/grpc/all/target_info/grpc_1.67.1.yml b/recipes/grpc/all/target_info/grpc_1.67.1.yml new file mode 100644 index 0000000000000..9ccbc327f9b2e --- /dev/null +++ b/recipes/grpc/all/target_info/grpc_1.67.1.yml @@ -0,0 +1,187 @@ +grpc_version: 1.67.1 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + - name: "gpr" + lib: "gpr" + requires: + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_log_severity + - abseil::absl_flags + - abseil::absl_flags_marshalling + - abseil::absl_any_invocable + - abseil::absl_check + - abseil::absl_log_globals + - abseil::absl_log + - abseil::absl_memory + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - upb_json_lib + - upb_textformat_lib + - re2::re2 + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + frameworks: ['CoreFoundation'] + - name: "upb_base_lib" + lib: "upb_base_lib" + - name: "upb_mini_descriptor_lib" + lib: "upb_mini_descriptor_lib" + requires: + - upb_base_lib + - upb_mem_lib + - name: "upb_wire_lib" + lib: "upb_wire_lib" + requires: + - utf8_range_lib + - upb_message_lib + - name: "upb_json_lib" + lib: "upb_json_lib" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - name: "upb_mem_lib" + lib: "upb_mem_lib" + - name: "upb_message_lib" + lib: "upb_message_lib" + requires: + - upb_base_lib + - upb_mem_lib + - name: "upb_textformat_lib" + lib: "upb_textformat_lib" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - name: "utf8_range_lib" + lib: "utf8_range_lib" + - name: "grpc++" + lib: "grpc++" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - _grpc + - protobuf::libprotobuf + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - grpc_unsecure + - protobuf::libprotobuf + - name: "grpc_authorization_provider" + lib: "grpc_authorization_provider" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - upb_message_lib + - re2::re2 + - zlib::zlib + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - protobuf::libprotobuf + - protobuf::libprotoc + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - grpc++ +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" + - target: "gRPC::grpc_otel_plugin" + executable: "grpc_otel_plugin" diff --git a/recipes/grpc/all/target_info/grpc_1.69.0.yml b/recipes/grpc/all/target_info/grpc_1.69.0.yml new file mode 100644 index 0000000000000..fd3786584adda --- /dev/null +++ b/recipes/grpc/all/target_info/grpc_1.69.0.yml @@ -0,0 +1,188 @@ +grpc_version: 1.69.0 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + - name: "gpr" + lib: "gpr" + requires: + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_log_severity + - abseil::absl_flags + - abseil::absl_flags_marshalling + - abseil::absl_any_invocable + - abseil::absl_check + - abseil::absl_log_globals + - abseil::absl_log + - abseil::absl_memory + - abseil::absl_bits + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - abseil::absl_variant + - name: "_grpc" + lib: "grpc" + requires: + - upb_json_lib + - upb_textformat_lib + - re2::re2 + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + frameworks: ['CoreFoundation'] + - name: "upb_base_lib" + lib: "upb_base_lib" + - name: "upb_mini_descriptor_lib" + lib: "upb_mini_descriptor_lib" + requires: + - upb_base_lib + - upb_mem_lib + - name: "upb_wire_lib" + lib: "upb_wire_lib" + requires: + - utf8_range_lib + - upb_message_lib + - name: "upb_json_lib" + lib: "upb_json_lib" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - name: "upb_mem_lib" + lib: "upb_mem_lib" + - name: "upb_message_lib" + lib: "upb_message_lib" + requires: + - upb_base_lib + - upb_mem_lib + - name: "upb_textformat_lib" + lib: "upb_textformat_lib" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - name: "utf8_range_lib" + lib: "utf8_range_lib" + - name: "grpc++" + lib: "grpc++" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - _grpc + - protobuf::libprotobuf + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - grpc_unsecure + - protobuf::libprotobuf + - name: "grpc_authorization_provider" + lib: "grpc_authorization_provider" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - re2::re2 + - zlib::zlib + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_cleanup + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - abseil::absl_status + - protobuf::libprotobuf + - protobuf::libprotoc + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - grpc++ +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" + - target: "gRPC::grpc_otel_plugin" + executable: "grpc_otel_plugin" diff --git a/recipes/grpc/all/target_info/grpc_1.71.0.yml b/recipes/grpc/all/target_info/grpc_1.71.0.yml new file mode 100644 index 0000000000000..4ec68e32472ad --- /dev/null +++ b/recipes/grpc/all/target_info/grpc_1.71.0.yml @@ -0,0 +1,183 @@ +grpc_version: 1.71.0 +grpc_targets: + - name: "address_sorting" + lib: "address_sorting" + - name: "gpr" + lib: "gpr" + requires: + - abseil::absl_base + - abseil::absl_core_headers + - abseil::absl_log_severity + - abseil::absl_cleanup + - abseil::absl_flags + - abseil::absl_flags_marshalling + - abseil::absl_any_invocable + - abseil::absl_check + - abseil::absl_log_globals + - abseil::absl_log + - abseil::absl_memory + - abseil::absl_bits + - abseil::absl_random_random + - abseil::absl_status + - abseil::absl_cord + - abseil::absl_str_format + - abseil::absl_strings + - abseil::absl_synchronization + - abseil::absl_time + - abseil::absl_optional + - name: "_grpc" + lib: "grpc" + requires: + - upb_json_lib + - upb_textformat_lib + - re2::re2 + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - openssl::ssl + - openssl::crypto + - address_sorting + frameworks: ['CoreFoundation'] + - name: "grpc_unsecure" + lib: "grpc_unsecure" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - zlib::zlib + - abseil::absl_algorithm_container + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_bind_front + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_random_bit_gen_ref + - abseil::absl_random_distributions + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + frameworks: ['CoreFoundation'] + - name: "upb_base_lib" + lib: "upb_base_lib" + - name: "upb_mini_descriptor_lib" + lib: "upb_mini_descriptor_lib" + requires: + - upb_base_lib + - upb_mem_lib + - name: "upb_wire_lib" + lib: "upb_wire_lib" + requires: + - utf8_range_lib + - upb_message_lib + - name: "upb_json_lib" + lib: "upb_json_lib" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - name: "upb_mem_lib" + lib: "upb_mem_lib" + - name: "upb_message_lib" + lib: "upb_message_lib" + requires: + - upb_base_lib + - upb_mem_lib + - name: "upb_textformat_lib" + lib: "upb_textformat_lib" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - name: "utf8_range_lib" + lib: "utf8_range_lib" + - name: "grpc++" + lib: "grpc++" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - _grpc + - protobuf::libprotobuf + - name: "grpc++_alts" + lib: "grpc++_alts" + requires: + - grpc++ + - name: "grpc++_error_details" + lib: "grpc++_error_details" + requires: + - grpc++ + - name: "grpc++_reflection" + lib: "grpc++_reflection" + requires: + - grpc++ + - name: "grpc++_unsecure" + lib: "grpc++_unsecure" + requires: + - abseil::absl_absl_check + - abseil::absl_absl_log + - grpc_unsecure + - protobuf::libprotobuf + - name: "grpc_authorization_provider" + lib: "grpc_authorization_provider" + requires: + - upb_mini_descriptor_lib + - upb_wire_lib + - re2::re2 + - zlib::zlib + - abseil::absl_config + - abseil::absl_no_destructor + - abseil::absl_flat_hash_map + - abseil::absl_flat_hash_set + - abseil::absl_inlined_vector + - abseil::absl_function_ref + - abseil::absl_hash + - abseil::absl_type_traits + - abseil::absl_statusor + - abseil::absl_span + - abseil::absl_utility + - c-ares::cares + - gpr + - address_sorting + - name: "grpc_plugin_support" + lib: "grpc_plugin_support" + requires: + - abseil::absl_status + - protobuf::libprotobuf + - protobuf::libprotoc + - name: "grpcpp_channelz" + lib: "grpcpp_channelz" + requires: + - grpc++ +grpc_plugins: + - target: "gRPC::grpc_cpp_plugin" + executable: "grpc_cpp_plugin" + - target: "gRPC::grpc_csharp_plugin" + executable: "grpc_csharp_plugin" + - target: "gRPC::grpc_node_plugin" + executable: "grpc_node_plugin" + - target: "gRPC::grpc_objective_c_plugin" + executable: "grpc_objective_c_plugin" + - target: "gRPC::grpc_php_plugin" + executable: "grpc_php_plugin" + - target: "gRPC::grpc_python_plugin" + executable: "grpc_python_plugin" + - target: "gRPC::grpc_ruby_plugin" + executable: "grpc_ruby_plugin" diff --git a/recipes/grpc/all/test_package/CMakeLists.txt b/recipes/grpc/all/test_package/CMakeLists.txt index 36ab1457a65dd..9bdf7d4baad66 100644 --- a/recipes/grpc/all/test_package/CMakeLists.txt +++ b/recipes/grpc/all/test_package/CMakeLists.txt @@ -2,29 +2,22 @@ cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -find_package(protobuf CONFIG REQUIRED QUIET) -find_package(gRPC CONFIG REQUIRED QUIET) +find_package(gRPC CONFIG REQUIRED) -message("DYLD_LIBRARY_PATH from CMake: $ENV{DYLD_LIBRARY_PATH}") -add_executable(${PROJECT_NAME} test_package.cpp helloworld.proto) +add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) # grpc 1.47.0 requires c++14 target_link_libraries(${PROJECT_NAME} PRIVATE - protobuf::libprotobuf $,gRPC::grpc++_unsecure,gRPC::grpc++> ) -target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -if(TEST_ACTUAL_SERVER) - target_compile_definitions(${PROJECT_NAME} PRIVATE -DTEST_ACTUAL_SERVER) -endif() -protobuf_generate( - TARGET ${PROJECT_NAME} - LANGUAGE cpp -) -protobuf_generate( - TARGET ${PROJECT_NAME} - LANGUAGE grpc - GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc - PLUGIN protoc-gen-grpc=$ -) + +if(CHECK_GRPC_CPP_PLUGIN) + if(NOT GRPC_CPP_PLUGIN_PROGRAM) + message(FATAL_ERROR "grpc_cpp_plugin not found") + endif() + + if(NOT TARGET gRPC::grpc_cpp_plugin) + message(FATAL_ERROR "grpc_cpp_plugin target not defined, but expected") + endif() +endif() \ No newline at end of file diff --git a/recipes/grpc/all/test_package/conanfile.py b/recipes/grpc/all/test_package/conanfile.py index 0f6a5af6c45a4..3e5ae9905391e 100644 --- a/recipes/grpc/all/test_package/conanfile.py +++ b/recipes/grpc/all/test_package/conanfile.py @@ -1,50 +1,25 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain -from conan.tools.env import VirtualRunEnv, VirtualBuildEnv -from conan.tools.microsoft import is_msvc +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, run=can_run(self)) - - def build_requirements(self): - if not can_run(self): - # For the grpc-cpp-plugin executable at build time - self.tool_requires(self.tested_reference_str) + self.requires(self.tested_reference_str) def generate(self): - # Set up environment so that we can run grpc-cpp-plugin at build time - VirtualBuildEnv(self).generate() - if can_run(self): - VirtualRunEnv(self).generate(scope="build") - - # Environment so that the compiled test executable can load shared libraries - runenv = VirtualRunEnv(self) - runenv.generate() - tc = CMakeToolchain(self) - tc.cache_variables["TEST_ACTUAL_SERVER"] = not (is_msvc(self) - and str(self.settings.compiler.version) in ("15", "191") - and self.settings.build_type == "Release") - - # Additional logic to override the make program on MacOS if /usr/bin/make is found by CMake - # which otherwise prevents the propagation of DYLD_LIBRARY_PATH as set by the VirtualBuildEnv - project_include = os.path.join(self.source_folder, "macos_make_override.cmake") - tc.cache_variables["CMAKE_PROJECT_test_package_INCLUDE"] = project_include + tc.cache_variables["CHECK_GRPC_CPP_PLUGIN"] = self.dependencies[self.tested_reference_str].options.cpp_plugin tc.generate() - deps = CMakeDeps(self) - deps.generate() - def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/grpc/all/test_package/helloworld.proto b/recipes/grpc/all/test_package/helloworld.proto deleted file mode 100644 index be878ce25fffc..0000000000000 --- a/recipes/grpc/all/test_package/helloworld.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015 gRPC authors. -// -// 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. - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "io.grpc.examples.helloworld"; -option java_outer_classname = "HelloWorldProto"; -option objc_class_prefix = "HLW"; - -package helloworld; - -// The greeting service definition. -service Greeter { - // Sends a greeting - rpc SayHello (HelloRequest) returns (HelloReply) {} -} - -// The request message containing the user's name. -message HelloRequest { - string name = 1; -} - -// The response message containing the greetings -message HelloReply { - string message = 1; -} diff --git a/recipes/grpc/all/test_package/macos_make_override.cmake b/recipes/grpc/all/test_package/macos_make_override.cmake deleted file mode 100644 index e7078c1b51419..0000000000000 --- a/recipes/grpc/all/test_package/macos_make_override.cmake +++ /dev/null @@ -1,13 +0,0 @@ -if (CMAKE_GENERATOR MATCHES "Unix Makefiles" AND CMAKE_HOST_APPLE AND CMAKE_MAKE_PROGRAM MATCHES "/usr/bin/make") - execute_process( - COMMAND xcrun --find make - OUTPUT_VARIABLE xcode_make OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE xcrun_error) - if(xcode_make) - #Override the value of `CMAKE_MAKE_PROGRAM` - set_property(CACHE CMAKE_MAKE_PROGRAM PROPERTY VALUE "${xcode_make}") - else() - message(WARNING "Using /usr/bin/make may prevent execution of Conan tool_requires that require DYLD_LIBRARY_PATH" - " to be set at build time.") - endif() -endif() diff --git a/recipes/grpc/all/test_package/test_package.cpp b/recipes/grpc/all/test_package/test_package.cpp index 18a37cf90692e..53d020094793e 100644 --- a/recipes/grpc/all/test_package/test_package.cpp +++ b/recipes/grpc/all/test_package/test_package.cpp @@ -1,122 +1,9 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * 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 - #include -#include "helloworld.grpc.pb.h" - -using grpc::Channel; -using grpc::ClientContext; -using grpc::Server; -using grpc::ServerBuilder; -using grpc::ServerContext; -using grpc::Status; -using helloworld::HelloRequest; -using helloworld::HelloReply; -using helloworld::Greeter; - -class GreeterClient { - public: - GreeterClient(std::shared_ptr channel) - : stub_(Greeter::NewStub(channel)) {} - - // Assembles the client's payload, sends it and presents the response back - // from the server. - std::string SayHello(const std::string& user) { - // Data we are sending to the server. - HelloRequest request; - request.set_name(user); - - // Container for the data we expect from the server. - HelloReply reply; - - // Context for the client. It could be used to convey extra information to - // the server and/or tweak certain RPC behaviors. - ClientContext context; - // The actual RPC. - Status status = stub_->SayHello(&context, request, &reply); - - // Act upon its status. - if (status.ok()) { - return reply.message(); - } else { - std::cout << status.error_code() << ": " << status.error_message() - << std::endl; - return "RPC failed"; - } - } - - private: - std::unique_ptr stub_; -}; - -// Logic and data behind the server's behavior. -class GreeterServiceImpl final : public Greeter::Service { - Status SayHello(ServerContext* context, const HelloRequest* request, - HelloReply* reply) override { - std::string prefix("Hello "); - reply->set_message(prefix + request->name()); - return Status::OK; - } -}; int main(int argc, char** argv) { - std::string server_address("127.0.0.1:0"); - GreeterServiceImpl service; - - ServerBuilder builder; - int selected_port = 0; - // Listen on the given address without any authentication mechanism. - builder.AddListeningPort(server_address, grpc::InsecureServerCredentials(), &selected_port); - // Register "service" as the instance through which we'll communicate with - // clients. In this case it corresponds to an *synchronous* service. - builder.RegisterService(&service); - - // Finally assemble the server. -#ifdef TEST_ACTUAL_SERVER - std::unique_ptr server(builder.BuildAndStart()); - std::thread serverThread([&](){ - std::cout << "Server listening on 127.0.0.1:" << selected_port << std::endl; - server->Wait(); - std::cout << "Server closed" << std::endl; - }); -#endif - - // Instantiate the client. It requires a channel, out of which the actual RPCs - // are created. This channel models a connection to an endpoint (in this case, - // localhost at the selected port). We indicate that the channel isn't - // authenticated (use of InsecureChannelCredentials()). - std::ostringstream addr; - addr << "localhost:" << selected_port; - GreeterClient greeter(grpc::CreateChannel(addr.str(), grpc::InsecureChannelCredentials())); - std::string user("world"); - std::string reply = greeter.SayHello(user); - std::cout << "Greeter received: " << reply << std::endl; - -#ifdef TEST_ACTUAL_SERVER - server->Shutdown(); - serverThread.join(); -#endif + std::cout << "gPRC version: " << grpc::Version() << "\n"; return 0; } diff --git a/recipes/grpc/all/test_v1_package/CMakeLists.txt b/recipes/grpc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f16bc97992e86..0000000000000 --- a/recipes/grpc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_v1_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/grpc/all/test_v1_package/conanfile.py b/recipes/grpc/all/test_v1_package/conanfile.py deleted file mode 100644 index 5fbf37e412127..0000000000000 --- a/recipes/grpc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,55 +0,0 @@ -from conans import ConanFile, CMake, tools -import contextlib -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(str(self.requires["grpc"])) - - @contextlib.contextmanager - def _buildenv(self): - # TODO: conan v2: replace by VirtualBuildEnv and always add grpc to build requirements - if tools.cross_building(self): - yield - else: - with tools.run_environment(self): - yield - - @property - def macos_grpc_shared(self): - # Due to SIP limitations on newer macOS, `DYLD_LIBRARY_PATH`, which is set - # by `tools.run_environment`, will not be propagated properly, see - # https://stackoverflow.com/questions/35568122/why-isnt-dyld-library-path-being-propagated-here - return self.settings.os == "Macos" and self.options["grpc"].shared - - def build(self): - # TODO: always build in conan v2 - # this is a limitation of conan v1: - # at build time we want to inject PATH/LD_LIBRARY/DYLD_LIBRARY_PATH - # of build requirements so that gprc_cpp_plugin can find its - # shared dependencies (in build context as well) - # should be fixed by using: CMakeToolchain + VirtualBuildEnv - if (tools.cross_building(self) and self.options["grpc"].shared) or self.macos_grpc_shared: - self.output.warning("Skipping build of test_package due to limitation propagating " - "runtime environment when invoking protoc and grpc_cpp_plugin. " - "For a working example, please see the newer Conan 2.0 compatible " - "test package.") - return - with self._buildenv(): - cmake = CMake(self) - # FIXME: This combination of settings randomly fails in CI - cmake.definitions["TEST_ACTUAL_SERVER"] = not (self.settings.compiler == "Visual Studio" - and self.settings.compiler.version == "15" - and self.settings.build_type == "Release") - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self) and not self.macos_grpc_shared: - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/grpc/config.yml b/recipes/grpc/config.yml index 0e75e172635d2..697d8585fa9d6 100644 --- a/recipes/grpc/config.yml +++ b/recipes/grpc/config.yml @@ -1,9 +1,15 @@ versions: + "1.71.0": + folder: "all" + "1.69.0": + folder: "all" + "1.67.1": + folder: "all" + "1.65.0": + folder: "all" "1.54.3": folder: "all" "1.50.1": folder: "all" "1.50.0": folder: "all" - "1.48.4": - folder: "all" diff --git a/recipes/gsl-lite/all/conandata.yml b/recipes/gsl-lite/all/conandata.yml index 48441a1526519..219a6dbb026e5 100644 --- a/recipes/gsl-lite/all/conandata.yml +++ b/recipes/gsl-lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.42.0": + url: "https://github.com/gsl-lite/gsl-lite/archive/v0.42.0.tar.gz" + sha256: "54a1b6f9db72eab5d8dcaf06b36d32d4f5da3471d91dac71aba19fe15291a773" "0.41.0": url: "https://github.com/gsl-lite/gsl-lite/archive/v0.41.0.tar.gz" sha256: "4682d8a60260321b92555760be3b9caab60e2a71f95eddbdfb91e557ee93302a" diff --git a/recipes/gsl-lite/all/conanfile.py b/recipes/gsl-lite/all/conanfile.py index 498e3972927b9..7d9514bf2f40f 100644 --- a/recipes/gsl-lite/all/conanfile.py +++ b/recipes/gsl-lite/all/conanfile.py @@ -8,12 +8,12 @@ class GslLiteConan(ConanFile): name = "gsl-lite" + description = "A single-file header-only version of ISO C++ " \ + "Guideline Support Library (GSL) for C++98, C++11 and later" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinmoene/gsl-lite" - topics = ("GSL",) - description = "A single-file header-only version of ISO C++ " \ - "Guideline Support Library (GSL) for C++98, C++11 and later" + topics = ("GSL", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" # There are three configuration options for this GSL implementation's behavior diff --git a/recipes/gsl-lite/config.yml b/recipes/gsl-lite/config.yml index 587567b5e7b67..928876dabb2a2 100644 --- a/recipes/gsl-lite/config.yml +++ b/recipes/gsl-lite/config.yml @@ -1,4 +1,6 @@ versions: + "0.42.0": + folder: all "0.41.0": folder: all "0.40.0": 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/all/test_package/CMakeLists.txt b/recipes/gsl/all/test_package/CMakeLists.txt index 808366bc0e673..5d56abe612f9a 100644 --- a/recipes/gsl/all/test_package/CMakeLists.txt +++ b/recipes/gsl/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(GSL REQUIRED) diff --git a/recipes/gsl/all/test_v1_package/CMakeLists.txt b/recipes/gsl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/gsl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gsl/all/test_v1_package/conanfile.py b/recipes/gsl/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/gsl/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/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/CMakeLists.txt b/recipes/gsoap/all/CMakeLists.txt index ff37f753a87ae..e0f2b38259aac 100644 --- a/recipes/gsoap/all/CMakeLists.txt +++ b/recipes/gsoap/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.15) project(gSOAP) include(GNUInstallDirs) diff --git a/recipes/gsoap/all/conandata.yml b/recipes/gsoap/all/conandata.yml index c340912f08348..a182b51ca54e4 100644 --- a/recipes/gsoap/all/conandata.yml +++ b/recipes/gsoap/all/conandata.yml @@ -1,18 +1,22 @@ +# The sources for this project get deleted from time to time. +# We use the backup sources from Conan Center as mirrors to let users compile in the future +# When adding new versions, directly add the URL following previous versions schema +# https://c3i.jfrog.io/artifactory/conan-center-backup-sources/ + sha256 of the sources +# The file will be automatically uploaded after the first successful compilation of the new version +# And will be usable as a mirror from then on. +# At some point the Conan client might come pre-configured with this backup remote by default, but don't delete the links then +# some users might still rely on the old revisions/not have it set to point to our CCI backup remote sources: + "2.8.134": + url: + - "https://sourceforge.net/projects/gsoap2/files/gsoap_2.8.134.zip/download" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/63478e555c0ccde0164f055ff605b02805db0abc6712a04bcb14cb617b047218" + sha256: "63478e555c0ccde0164f055ff605b02805db0abc6712a04bcb14cb617b047218" + "2.8.132": + url: + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/d6eb5d0d2c31532746f4dc9fa1ce95d4553414e918059eac23cf081d88c2aeee" + sha256: "d6eb5d0d2c31532746f4dc9fa1ce95d4553414e918059eac23cf081d88c2aeee" "2.8.129": url: - - "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" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/16cb8852ea791a6aec8f0213d619c15eecc8171e0c888f3b0e0c66d3ef78e20a" sha256: "16cb8852ea791a6aec8f0213d619c15eecc8171e0c888f3b0e0c66d3ef78e20a" - "2.8.117": - url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.117.zip" - sha256: "7cadf8808cfd982629948fe09e4fa6cd18e23cafd40df0aaaff1b1f5b695c442" - "2.8.116": - url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.116.zip" - sha256: "2a41e42aaddbcd603b99004af95bb83559dbd4fd2d842920f003d24867599192" - "2.8.115": - url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.115.zip" - sha256: "6f6813b189d201022254a2879cc8ee005bdb1bcf126bc03238710f19ec4e7268" - "2.8.114": - url: "https://c3i.jfrog.io/artifactory/cci-sources-backup/sources/gsoap/gsoap_2.8.114.zip" - sha256: "aa70a999258100c170a3f8750c1f91318a477d440f6a28117f68bc1ded32327f" diff --git a/recipes/gsoap/all/test_package/conanfile.py b/recipes/gsoap/all/test_package/conanfile.py index 60209e04ba8a6..72383b4f0375e 100644 --- a/recipes/gsoap/all/test_package/conanfile.py +++ b/recipes/gsoap/all/test_package/conanfile.py @@ -7,36 +7,28 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str, run=can_run(self)) - - def build_requirements(self): - if not can_run(self): - self.tool_requires(self.tested_reference_str) - - def generate(self): - VirtualRunEnv(self).generate() - if can_run(self): - VirtualRunEnv(self).generate(scope="build") - else: - VirtualBuildEnv(self).generate() + self.requires(self.tested_reference_str, run=True) def build(self): + if not can_run(self): + self.output.warning("Skipping build: the package was cross-built") + return 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}") + self.run(f"wsdl2h -o calc.h {calc_wsdl}", env="conanrun") 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: import_dir = os.path.join(self.dependencies["gsoap"].package_folder, "bin", "import") - self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h") + self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h", env="conanrun") cmake = CMake(self) cmake.configure() diff --git a/recipes/gsoap/all/test_package/test_package.cpp b/recipes/gsoap/all/test_package/test_package.cpp index bf5391ec2d579..a2173524bd23c 100644 --- a/recipes/gsoap/all/test_package/test_package.cpp +++ b/recipes/gsoap/all/test_package/test_package.cpp @@ -6,15 +6,7 @@ int main() { calcProxy calc; - double sum; - if (calc.add(1.23, 4.56, sum) == SOAP_OK) - { - std::cout << "Sum = " << sum << std::endl; - } - else - { - std::cout << "Cannot sum" << std::endl; - calc.soap_stream_fault(std::cerr); - } calc.destroy(); // same as: soap_destroy(calc.soap); soap_end(calc.soap); + std::cout << "gSoap Test package successful\n"; + return 0; } diff --git a/recipes/gsoap/all/test_v1_package/CMakeLists.txt b/recipes/gsoap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/gsoap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/gsoap/all/test_v1_package/conanfile.py b/recipes/gsoap/all/test_v1_package/conanfile.py deleted file mode 100644 index 27d9e27609d72..0000000000000 --- a/recipes/gsoap/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,32 +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" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(self.tested_reference_str) - - def build(self): - with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(self): - calc_wsdl = os.path.join(self.source_folder, os.pardir, "test_package", "calc.wsdl") - self.output.info(f"Generating code from WSDL '{calc_wsdl}'") - self.run(f"wsdl2h -o calc.h {calc_wsdl}") - import_dir = os.path.join(self.deps_cpp_info["gsoap"].rootpath, "bin", "import") - self.run(f"soapcpp2 -j -CL -I{import_dir} calc.h") - - 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/gsoap/config.yml b/recipes/gsoap/config.yml index 22f6a1710f735..89600de4b1c5d 100644 --- a/recipes/gsoap/config.yml +++ b/recipes/gsoap/config.yml @@ -1,11 +1,7 @@ versions: - "2.8.129": - folder: all - "2.8.117": + "2.8.134": folder: all - "2.8.116": + "2.8.132": folder: all - "2.8.115": - folder: all - "2.8.114": + "2.8.129": folder: all diff --git a/recipes/gst-libav/all/test_package/CMakeLists.txt b/recipes/gst-libav/all/test_package/CMakeLists.txt index f22364a6eaec9..e34a27491c05a 100644 --- a/recipes/gst-libav/all/test_package/CMakeLists.txt +++ b/recipes/gst-libav/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/gst-plugins-bad/all/test_package/CMakeLists.txt b/recipes/gst-plugins-bad/all/test_package/CMakeLists.txt index a585dafd3e413..9d5d18c4a38d9 100644 --- a/recipes/gst-plugins-bad/all/test_package/CMakeLists.txt +++ b/recipes/gst-plugins-bad/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/gst-plugins-base/all/test_package/CMakeLists.txt b/recipes/gst-plugins-base/all/test_package/CMakeLists.txt index a872f34009a12..7be703df2dad1 100644 --- a/recipes/gst-plugins-base/all/test_package/CMakeLists.txt +++ b/recipes/gst-plugins-base/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/gst-plugins-good/all/test_package/CMakeLists.txt b/recipes/gst-plugins-good/all/test_package/CMakeLists.txt index 12ca5f526ed07..71d0833bddf35 100644 --- a/recipes/gst-plugins-good/all/test_package/CMakeLists.txt +++ b/recipes/gst-plugins-good/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/gst-plugins-ugly/all/test_package/CMakeLists.txt b/recipes/gst-plugins-ugly/all/test_package/CMakeLists.txt index 86125a5ca6402..d1b5cb71df0d7 100644 --- a/recipes/gst-plugins-ugly/all/test_package/CMakeLists.txt +++ b/recipes/gst-plugins-ugly/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/gstreamer/all/conandata.yml b/recipes/gstreamer/all/conandata.yml index c81d17d89f92b..e9f1bbcb66bfb 100644 --- a/recipes/gstreamer/all/conandata.yml +++ b/recipes/gstreamer/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "1.22.3": - url: "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.22.3.tar.xz" - sha256: "9ffeab95053f9f6995eb3b3da225e88f21c129cd60da002d3f795db70d6d5974" + "1.24.7": + url: "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.24.7.tar.xz" + sha256: "c0e75b124c52bb7a0c3dcdb734b2ad260ea7286a8745cf2ea629d4c849e6a958" + "1.22.6": + url: "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.22.6.tar.xz" + sha256: "f500e6cfddff55908f937711fc26a0840de28a1e9ec49621c0b6f1adbd8f818e" "1.20.6": url: "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.20.6.tar.xz" sha256: "0545b030960680f71a95f9d39c95daae54b4d317d335e8f239d81138773c9b90" @@ -14,12 +17,6 @@ sources: "1.18.4": url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.18.4/gstreamer-1.18.4.tar.gz" sha256: "f0956c2056281f5909d030945a9896810e55084f29b6bcfc401b53e91ddf1c7f" - "1.18.3": - url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.18.3/gstreamer-1.18.3.tar.gz" - sha256: "d7e3917b5d3d9c3bd9bb70b7500314a5725377cff39bcd818df13c1fda0f60ba" - "1.18.0": - sha256: "f072da67b6dad9b4aecf2cb594aaaa66f86c22af9ba80503b90f957d47015ef8" - url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.18.0/gstreamer-1.18.0.tar.bz2" "1.16.2": - sha256: "dac037ab84d557f5d4e6e66e833f6bf8cf4f84671a311e0b2df99f9b30a9d693" url: "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.16.2/gstreamer-1.16.2.tar.bz2" + sha256: "dac037ab84d557f5d4e6e66e833f6bf8cf4f84671a311e0b2df99f9b30a9d693" diff --git a/recipes/gstreamer/all/conanfile.py b/recipes/gstreamer/all/conanfile.py index 7bd590a8dadbf..71de230e0d57a 100644 --- a/recipes/gstreamer/all/conanfile.py +++ b/recipes/gstreamer/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.env import VirtualBuildEnv +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import chdir, copy, get, rename, rm, rmdir from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout @@ -11,7 +12,7 @@ import glob import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.60.0 <2 || >=2.0.5" class GStreamerConan(ConanFile): name = "gstreamer" @@ -33,6 +34,14 @@ class GStreamerConan(ConanFile): "with_introspection": False, } + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") + def config_options(self): if self.settings.os == 'Windows': del self.options.fPIC @@ -47,24 +56,25 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.76.3", transitive_headers=True, transitive_libs=True) + self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) def validate(self): - if not self.dependencies.direct_host["glib"].options.shared and self.info.options.shared: + if not self.dependencies.direct_host["glib"].options.shared and self.options.shared: # https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/133 raise ConanInvalidConfiguration("shared GStreamer cannot link to static GLib") def build_requirements(self): - self.tool_requires("meson/1.1.1") + self.tool_requires("meson/[>=1.2.3 <2]") # 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.3") - if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.3") + if not self._is_legacy_one_profile: + self.tool_requires("glib/") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") if self.options.with_introspection: self.tool_requires("gobject-introspection/1.72.0") - if self.settings.os == 'Windows': - self.tool_requires("winflexbison/2.5.24") + 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") @@ -75,6 +85,8 @@ def source(self): def generate(self): virtual_build_env = VirtualBuildEnv(self) virtual_build_env.generate() + if self._is_legacy_one_profile: + VirtualRunEnv(self).generate(scope="build") pkg_config_deps = PkgConfigDeps(self) pkg_config_deps.generate() tc = MesonToolchain(self) @@ -112,6 +124,7 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "gstreamer-1.0", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) rm(self, "*.pdb", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) def package_info(self): gst_plugin_path = os.path.join(self.package_folder, "lib", "gstreamer-1.0") @@ -139,7 +152,7 @@ def package_info(self): self.cpp_info.components["gstreamer-1.0"].libs = ["gstreamer-1.0"] self.cpp_info.components["gstreamer-1.0"].includedirs = [os.path.join("include", "gstreamer-1.0")] if self.settings.os == "Linux": - self.cpp_info.components["gstreamer-1.0"].system_libs = ["m"] + self.cpp_info.components["gstreamer-1.0"].system_libs = ["m", "dl", "nsl"] self.cpp_info.components["gstreamer-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) self.cpp_info.components["gstreamer-base-1.0"].set_property("pkg_config_name", "gstreamer-base-1.0") @@ -161,6 +174,8 @@ def package_info(self): self.cpp_info.components["gstreamer-net-1.0"].set_property("pkg_config_name", "gstreamer-net-1.0") self.cpp_info.components["gstreamer-net-1.0"].names["pkg_config"] = "gstreamer-net-1.0" self.cpp_info.components["gstreamer-net-1.0"].requires = ["gstreamer-1.0", "glib::gio-2.0"] + if Version(self.version) >= "1.21.1" and self.settings.os != "Windows": + self.cpp_info.components["gstreamer-net-1.0"].requires.append("glib::gio-unix-2.0") self.cpp_info.components["gstreamer-net-1.0"].libs = ["gstnet-1.0"] self.cpp_info.components["gstreamer-net-1.0"].includedirs = [os.path.join("include", "gstreamer-1.0")] self.cpp_info.components["gstreamer-net-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) @@ -174,7 +189,7 @@ def package_info(self): self.cpp_info.components["gstreamer-check-1.0"].system_libs = ["rt", "m"] self.cpp_info.components["gstreamer-check-1.0"].set_property("pkg_config_custom_content", pkgconfig_custom_content) - # gstcoreelements and gstcoretracers are plugins which should be loaded dynamicaly, and not linked to directly + # gstcoreelements and gstcoretracers are plugins which should be loaded dynamically, and not linked to directly if not self.options.shared: self.cpp_info.components["gstcoreelements"].set_property("pkg_config_name", "gstcoreelements") self.cpp_info.components["gstcoreelements"].names["pkg_config"] = "gstcoreelements" diff --git a/recipes/gstreamer/all/test_package/conanfile.py b/recipes/gstreamer/all/test_package/conanfile.py index bdc56ffa1130e..c0da610abd3b1 100644 --- a/recipes/gstreamer/all/test_package/conanfile.py +++ b/recipes/gstreamer/all/test_package/conanfile.py @@ -1,31 +1,26 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain -from conan.tools.env import Environment, VirtualRunEnv -from conan.tools.gnu import PkgConfigDeps +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import Environment import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv" test_type = "explicit" + def layout(self): + cmake_layout(self) + def requirements(self): self.requires(self.tested_reference_str) - def layout(self): - cmake_layout(self) + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.1.0") def generate(self): - pkg_config_deps = PkgConfigDeps(self) - pkg_config_deps.generate() - cmake_deps = CMakeDeps(self) - cmake_deps.generate() - tc = CMakeToolchain(self) - tc.generate() - runenv = VirtualRunEnv(self) - runenv.generate() - # Print debug information from gstreamer at runtime env = Environment() env.define("GST_DEBUG", "7") diff --git a/recipes/gstreamer/all/test_v1_package/CMakeLists.txt b/recipes/gstreamer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 73976ce47fac2..0000000000000 --- a/recipes/gstreamer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(gstreamer REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE - gstreamer::gstreamer-1.0 gstreamer::gstreamer-base-1.0 gstreamer::gstreamer-controller-1.0 - gstreamer::gstreamer-net-1.0 gstreamer::gstreamer-check-1.0) -if (TARGET gstreamer::gstcoreelements) - target_link_libraries(${PROJECT_NAME} PRIVATE gstreamer::gstcoreelements) -endif () diff --git a/recipes/gstreamer/all/test_v1_package/conanfile.py b/recipes/gstreamer/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/gstreamer/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/gstreamer/config.yml b/recipes/gstreamer/config.yml index e4692dfb998b7..99cca4b40e56f 100644 --- a/recipes/gstreamer/config.yml +++ b/recipes/gstreamer/config.yml @@ -1,5 +1,7 @@ versions: - "1.22.3": + "1.24.7": + folder: all + "1.22.6": folder: all "1.20.6": folder: all @@ -9,9 +11,5 @@ versions: folder: all "1.18.4": folder: all - "1.18.3": - folder: all - "1.18.0": - folder: all "1.16.2": folder: all diff --git a/recipes/gtest/all/conandata.yml b/recipes/gtest/all/conandata.yml index b22247dc8573d..45ea8fe08e13a 100644 --- a/recipes/gtest/all/conandata.yml +++ b/recipes/gtest/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.16.0": + url: "https://github.com/google/googletest/archive/v1.16.0.tar.gz" + sha256: "78c676fc63881529bf97bf9d45948d905a66833fbfa5318ea2cd7478cb98f399" + "1.15.0": + url: "https://github.com/google/googletest/releases/download/v1.15.0/googletest-1.15.0.tar.gz" + sha256: "7315acb6bf10e99f332c8a43f00d5fbb1ee6ca48c52f6b936991b216c586aaad" "1.14.0": url: "https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz" sha256: "8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7" diff --git a/recipes/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py index 556a1401b077b..8641a7aeba80a 100644 --- a/recipes/gtest/all/conanfile.py +++ b/recipes/gtest/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class GTestConan(ConanFile): @@ -37,6 +37,10 @@ class GTestConan(ConanFile): "debug_postfix": "d", "disable_pthreads": False, } + # disallow cppstd compatibility, as it affects the ABI in this library + # see https://github.com/conan-io/conan-center-index/issues/23854 + # Requires Conan >=1.53.0 <2 || >=2.1.0 to work + extension_properties = {"compatibility_cppstd": False} @property def _min_cppstd(self): @@ -119,6 +123,7 @@ def generate(self): if Version(self.version) < "1.12.0": # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def _patch_sources(self): @@ -158,7 +163,8 @@ def package_info(self): self.cpp_info.components["libgtest"].libs = [f"gtest{self._postfix}"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libgtest"].system_libs.append("m") - self.cpp_info.components["libgtest"].system_libs.append("pthread") + if not self.options.disable_pthreads: + self.cpp_info.components["libgtest"].system_libs.append("pthread") if self.settings.os == "Neutrino" and self.settings.os.version == "7.1": self.cpp_info.components["libgtest"].system_libs.append("regex") if self.options.shared: @@ -185,9 +191,3 @@ def package_info(self): self.cpp_info.components["gmock_main"].set_property("pkg_config_name", "gmock_main") self.cpp_info.components["gmock_main"].libs = [f"gmock_main{self._postfix}"] self.cpp_info.components["gmock_main"].requires = ["gmock"] - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "GTest" - self.cpp_info.names["cmake_find_package_multi"] = "GTest" - self.cpp_info.components["libgtest"].names["cmake_find_package"] = "gtest" - self.cpp_info.components["libgtest"].names["cmake_find_package_multi"] = "gtest" diff --git a/recipes/gtest/all/test_package/CMakeLists.txt b/recipes/gtest/all/test_package/CMakeLists.txt index 3ca688fabb972..b559d736cd8c7 100644 --- a/recipes/gtest/all/test_package/CMakeLists.txt +++ b/recipes/gtest/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(GTest REQUIRED) diff --git a/recipes/gtest/all/test_v1_package/CMakeLists.txt b/recipes/gtest/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/gtest/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gtest/all/test_v1_package/conanfile.py b/recipes/gtest/all/test_v1_package/conanfile.py deleted file mode 100644 index 1490f15fbb3c6..0000000000000 --- a/recipes/gtest/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +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" - - def build(self): - cmake = CMake(self) - cmake.definitions['WITH_GMOCK'] = self.options['gtest'].build_gmock - cmake.definitions['WITH_MAIN'] = not self.options['gtest'].no_main - 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/gtest/config.yml b/recipes/gtest/config.yml index fa66f2eb7d4d7..6ea51cb63834e 100644 --- a/recipes/gtest/config.yml +++ b/recipes/gtest/config.yml @@ -1,4 +1,8 @@ versions: + "1.16.0": + folder: all + "1.15.0": + folder: all "1.14.0": folder: all "1.13.0": diff --git a/recipes/gtk/all/test_package/CMakeLists.txt b/recipes/gtk/all/test_package/CMakeLists.txt index afa2476357074..7b80ac51436dc 100644 --- a/recipes/gtk/all/test_package/CMakeLists.txt +++ b/recipes/gtk/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) diff --git a/recipes/gtlab-logging/all/conandata.yml b/recipes/gtlab-logging/all/conandata.yml new file mode 100644 index 0000000000000..a3c93f35dda32 --- /dev/null +++ b/recipes/gtlab-logging/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.4.1": + sha256: "3f905b36de130e32a3b2230b78fee8dfc2747775a6171c7a81d3d02843093e72" + url: "https://github.com/dlr-gtlab/gt-logging/archive/refs/tags/4-4-1.tar.gz" diff --git a/recipes/gtlab-logging/all/conanfile.py b/recipes/gtlab-logging/all/conanfile.py new file mode 100644 index 0000000000000..4faba2a85c630 --- /dev/null +++ b/recipes/gtlab-logging/all/conanfile.py @@ -0,0 +1,110 @@ +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools import files +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration +from conan import ConanFile +import os + +required_conan_version = ">=1.59.0" + +class GTLabLoggingConan(ConanFile): + name = "gtlab-logging" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/dlr-gtlab/gt-logging" + topics = ("logging", "qt") + description = "Simple logging interface with qt support" + + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_qt": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_qt": False + } + + def requirements(self): + if self.options.with_qt: + self.requires("qt/[>=5.15 <7]", transitive_headers=True) + + + @property + def _min_cppstd(self): + return "14" + + @property + def _minimum_compilers_version(self): + return { + "14": { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7.3.1", + "clang": "6", + "apple-clang": "14", + }, + }.get(self._min_cppstd, {}) + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + return all(int(p1) < int(p2) for p1, p2 in zip(str(v1).split("."), str(v2).split("."))) + + 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 C++{self._min_cppstd}, which your compiler does not support." + ) + + def generate(self): + CMakeToolchain(self).generate() + CMakeDeps(self).generate() + + 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): + files.get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=self.source_folder) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + + def package(self): + cmake = CMake(self) + cmake.install() + + files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + files.copy(self, os.path.join("LICENSES", "BSD-3-Clause.txt"), dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + + def package_info(self): + self.cpp_info.libs = ["GTlabLogging"] if self.settings.build_type != "Debug" else ["GTlabLogging-d"] + + self.cpp_info.includedirs.append(os.path.join("include", "logging")) + + self.cpp_info.libdirs = [os.path.join("lib", "logging")] + + self.cpp_info.set_property("cmake_file_name", "GTlabLogging") + self.cpp_info.set_property("cmake_target_name", "GTlab::Logging") + + if self.options.with_qt: + self.cpp_info.defines = ['GT_LOG_USE_QT_BINDINGS'] diff --git a/recipes/gtlab-logging/all/test_package/CMakeLists.txt b/recipes/gtlab-logging/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..85a8206f1711f --- /dev/null +++ b/recipes/gtlab-logging/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(GTlabLogging REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example GTlab::Logging) diff --git a/recipes/gtlab-logging/all/test_package/conanfile.py b/recipes/gtlab-logging/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1f279ef73c18b --- /dev/null +++ b/recipes/gtlab-logging/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run +import os + + +class GTlabLoggingTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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], "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/gtlab-logging/all/test_package/example.cpp b/recipes/gtlab-logging/all/test_package/example.cpp new file mode 100644 index 0000000000000..831dda5df891b --- /dev/null +++ b/recipes/gtlab-logging/all/test_package/example.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + gtError() << "Hello World"; + return 0; +} diff --git a/recipes/gtlab-logging/config.yml b/recipes/gtlab-logging/config.yml new file mode 100644 index 0000000000000..e4bb798c7e054 --- /dev/null +++ b/recipes/gtlab-logging/config.yml @@ -0,0 +1,3 @@ +versions: + "4.4.1": + folder: all diff --git a/recipes/gtsam/all/conanfile.py b/recipes/gtsam/all/conanfile.py index bca7930e912c2..b0e2304308da8 100644 --- a/recipes/gtsam/all/conanfile.py +++ b/recipes/gtsam/all/conanfile.py @@ -17,7 +17,8 @@ class GtsamConan(ConanFile): 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", "optimization", "factor-graphs") + topics = ("mapping", "smoothing", "optimization", "factor-graphs", + "state-estimation", "computer-vision", "robotics") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -25,7 +26,6 @@ class GtsamConan(ConanFile): "shared": [True, False], "fPIC": [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], @@ -55,7 +55,6 @@ class GtsamConan(ConanFile): "shared": False, "fPIC": True, "allow_deprecated": True, - "allow_deprecated_since_V4": "deprecated", "build_type_postfixes": True, "build_unstable": True, "build_with_march_native": False, @@ -64,14 +63,14 @@ class GtsamConan(ConanFile): "enable_consistency_checks": False, "install_cppunitlite": True, "install_matlab_toolbox": False, - "pose3_expmap": False, - "rot3_expmap": False, + "pose3_expmap": True, + "rot3_expmap": True, "slow_but_correct_betweenfactor": False, - "support_nested_dissection": False, - "tangent_preintegration": False, + "support_nested_dissection": True, + "tangent_preintegration": True, "throw_cheirality_exception": True, "use_quaternions": False, - "with_TBB": False, + "with_TBB": True, "with_eigen_MKL": False, "with_eigen_MKL_OPENMP": False, @@ -95,7 +94,7 @@ class GtsamConan(ConanFile): "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", + "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. " @@ -130,29 +129,28 @@ def configure(self): 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.83.0", transitive_headers=True) + self.requires("boost/1.84.0", transitive_headers=True) self.requires("eigen/3.4.0", transitive_headers=True) if self.options.with_TBB: - self.requires("onetbb/2021.10.0", transitive_headers=True) + if Version(self.version) >= "4.1": + self.requires("onetbb/2021.10.0", transitive_headers=True, transitive_libs=True) + else: + self.requires("onetbb/2020.3.3", transitive_headers=True, transitive_libs=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) + self.requires("gperftools/2.15") + if self.options.support_nested_dissection: + # Used in a public header here: + # https://github.com/borglab/gtsam/blob/4.2.0/gtsam_unstable/partition/FindSeparator-inl.h#L23-L27 + self.requires("metis/5.2.1", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): - # Based on https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleBoost.cmake#L26 + # Based on https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleBoost.cmake#L26 return [ "chrono", "date_time", @@ -181,10 +179,7 @@ def validate(self): 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}" - ) + raise ConanInvalidConfiguration(f"with_TBB option cannot be used with default_allocator={self.options.default_allocator}") elif self.options.default_allocator == "TBB": raise ConanInvalidConfiguration("default_allocator=TBB requires with_TBB=True") @@ -198,18 +193,15 @@ def validate(self): 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." - ) + if self.options.support_nested_dissection and self.dependencies["metis"].options.with_64bit_types: + raise ConanInvalidConfiguration("GTSAM does not support METIS with 64-bit types") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) 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 + # https://github.com/borglab/gtsam/blob/4.2.0/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 @@ -224,8 +216,6 @@ def generate(self): 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 @@ -234,30 +224,30 @@ def generate(self): 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 - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleAllocators.cmake + # https://github.com/borglab/gtsam/blob/4.2.0/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 + # https://github.com/borglab/gtsam/blob/4.2.0/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 + # https://github.com/borglab/gtsam/blob/4.2.0/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 + # https://github.com/borglab/gtsam/blob/4.2.0/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 + # https://github.com/borglab/gtsam/blob/4.2.0/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 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleEigen.cmake#L3 tc.variables["GTSAM_USE_SYSTEM_EIGEN"] = True - # https://github.com/borglab/gtsam/blob/4.2a9/cmake/HandleMetis.cmake#L11 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/HandleMetis.cmake#L11 tc.variables["GTSAM_USE_SYSTEM_METIS"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/gtsam/3rdparty/CMakeLists.txt#L76 + # https://github.com/borglab/gtsam/blob/4.2.0/gtsam/3rdparty/CMakeLists.txt#L76 tc.variables["GTSAM_INSTALL_GEOGRAPHICLIB"] = False - # https://github.com/borglab/gtsam/blob/4.2a9/matlab/CMakeLists.txt#L14-L15 + # https://github.com/borglab/gtsam/blob/4.2.0/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 + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/GtsamTesting.cmake#L89-L91 tc.variables["GTSAM_BUILD_TESTS"] = False 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 + # https://github.com/borglab/gtsam/blob/4.2.0/doc/CMakeLists.txt tc.variables["GTSAM_BUILD_DOCS"] = False tc.variables["GTSAM_BUILD_DOC_HTML"] = False tc.variables["GTSAM_BUILD_DOC_LATEX"] = False @@ -273,9 +263,15 @@ def generate(self): tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared tc.variables["Boost_NO_SYSTEM_PATHS"] = True + + if Version(self.version) < "4.1": + # Fix "The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated" + tc.preprocessor_definitions["BOOST_BIND_GLOBAL_PLACEHOLDERS"] = "" + tc.generate() deps = CMakeDeps(self) + deps.set_property("metis", "cmake_target_name", "metis-gtsam-if") deps.generate() def _patch_sources(self): @@ -287,22 +283,39 @@ def _patch_sources(self): 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)} ") + # Ensure a newer CMake standard is used for non-cache_variables support and other policies + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "cmake_minimum_required(VERSION 3.0)", + "cmake_minimum_required(VERSION 3.15)") + + # Fix tcmalloc / gperftools handling 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"', - ) + replace_in_file(self, handle_allocators_path, + "if(GOOGLE", + ("find_package(gperftools REQUIRED)\n" + "set(GOOGLE_PERFTOOLS_FOUND TRUE)\n" + "if(GOOGLE")) + replace_in_file(self, handle_allocators_path, + 'GTSAM_ADDITIONAL_LIBRARIES "tcmalloc"', + 'GTSAM_ADDITIONAL_LIBRARIES "gperftools::gperftools"') + + # Fix HandleMetis.cmake incompatibility with METIS from Conan + save(self, os.path.join(self.source_folder, "cmake", "HandleMetis.cmake"), + "find_package(metis REQUIRED CONFIG)\n") + + # Fix TBB handling + handle_tbb_path = os.path.join(self.source_folder, "cmake", "HandleTBB.cmake") + if Version(self.version) < "4.1": + handle_tbb_path = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, handle_tbb_path, "find_package(TBB 4.4 ", "find_package(TBB ") + if Version(self.version) < "4.2.1": + replace_in_file(self, handle_tbb_path, + "list(APPEND GTSAM_ADDITIONAL_LIBRARIES tbb tbbmalloc)", + "list(APPEND GTSAM_ADDITIONAL_LIBRARIES TBB::tbb TBB::tbbmalloc)") + def build(self): self._patch_sources() @@ -345,6 +358,8 @@ def _module_file_rel_path(self): return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): + # GTSAM uses targets without a namespace prefix: + # https://github.com/borglab/gtsam/blob/4.2.0/cmake/example_cmake_find_gtsam/CMakeLists.txt self.cpp_info.set_property("cmake_file_name", "GTSAM") gtsam = self.cpp_info.components["libgtsam"] @@ -356,10 +371,11 @@ def package_info(self): gtsam.requires.append("onetbb::onetbb") if self.options.default_allocator == "tcmalloc": gtsam.requires.append("gperftools::gperftools") - if self.options.support_nested_dissection: - gtsam.requires.append("libmetis-gtsam") if self.settings.os == "Windows": gtsam.system_libs = ["dbghelp"] + if Version(self.version) < "4.1": + # Fix "The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated" + gtsam.defines.append("BOOST_BIND_GLOBAL_PLACEHOLDERS") if self.options.build_unstable: gtsam_unstable = self.cpp_info.components["libgtsam_unstable"] @@ -368,13 +384,7 @@ def package_info(self): gtsam_unstable.requires = ["libgtsam"] if self.options.support_nested_dissection: - 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" + gtsam.requires.append("metis::metis") if self.options.install_cppunitlite: cppunitlite = self.cpp_info.components["gtsam_CppUnitLite"] diff --git a/recipes/gtsam/all/test_package/CMakeLists.txt b/recipes/gtsam/all/test_package/CMakeLists.txt index 3f46187fc1f60..8c7b48eec6d7e 100644 --- a/recipes/gtsam/all/test_package/CMakeLists.txt +++ b/recipes/gtsam/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(GTSAM REQUIRED CONFIG) diff --git a/recipes/guetzli/all/conanfile.py b/recipes/guetzli/all/conanfile.py index 55d0965a2f54b..1ca0fe9e70fdd 100644 --- a/recipes/guetzli/all/conanfile.py +++ b/recipes/guetzli/all/conanfile.py @@ -25,7 +25,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") def package_id(self): del self.info.settings.compiler diff --git a/recipes/guetzli/all/test_v1_package/conanfile.py b/recipes/guetzli/all/test_v1_package/conanfile.py deleted file mode 100644 index c30ef97cb4cf1..0000000000000 --- a/recipes/guetzli/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,12 +0,0 @@ -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/gumbo-parser/all/test_package/CMakeLists.txt b/recipes/gumbo-parser/all/test_package/CMakeLists.txt index 29e92f880421a..3f33a1b9f0ff0 100644 --- a/recipes/gumbo-parser/all/test_package/CMakeLists.txt +++ b/recipes/gumbo-parser/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(gumbo-parser REQUIRED CONFIG) diff --git a/recipes/gumbo-parser/all/test_v1_package/CMakeLists.txt b/recipes/gumbo-parser/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/gumbo-parser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gumbo-parser/all/test_v1_package/conanfile.py b/recipes/gumbo-parser/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/gumbo-parser/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_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/gurkenlaeufer/all/test_package/CMakeLists.txt b/recipes/gurkenlaeufer/all/test_package/CMakeLists.txt index 51bf4a2706c39..bd8f6ef222f7e 100644 --- a/recipes/gurkenlaeufer/all/test_package/CMakeLists.txt +++ b/recipes/gurkenlaeufer/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(gurkenlaeufer REQUIRED) diff --git a/recipes/gurkenlaeufer/all/test_v1_package/CMakeLists.txt b/recipes/gurkenlaeufer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/gurkenlaeufer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gurkenlaeufer/all/test_v1_package/conanfile.py b/recipes/gurkenlaeufer/all/test_v1_package/conanfile.py deleted file mode 100644 index 7d408490e37b7..0000000000000 --- a/recipes/gurkenlaeufer/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - - -class TestGurkenlaeuferV1Conan(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/gzip-hpp/all/test_package/CMakeLists.txt b/recipes/gzip-hpp/all/test_package/CMakeLists.txt index 84ca7198a323c..76b3f5a8f032e 100644 --- a/recipes/gzip-hpp/all/test_package/CMakeLists.txt +++ b/recipes/gzip-hpp/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(gzip-hpp REQUIRED CONFIG) diff --git a/recipes/gzip-hpp/all/test_v1_package/CMakeLists.txt b/recipes/gzip-hpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/gzip-hpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/gzip-hpp/all/test_v1_package/conanfile.py b/recipes/gzip-hpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/gzip-hpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/h3/all/test_package/CMakeLists.txt b/recipes/h3/all/test_package/CMakeLists.txt index f0064105601c7..2d499b674cb7f 100644 --- a/recipes/h3/all/test_package/CMakeLists.txt +++ b/recipes/h3/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(h3 REQUIRED CONFIG) diff --git a/recipes/h3/all/test_v1_package/CMakeLists.txt b/recipes/h3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/h3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/h3/all/test_v1_package/conanfile.py b/recipes/h3/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/h3/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_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/h5pp/all/conandata.yml b/recipes/h5pp/all/conandata.yml index 264046f12084e..8a624a3c51a3b 100644 --- a/recipes/h5pp/all/conandata.yml +++ b/recipes/h5pp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.11.2": + url: "https://github.com/DavidAce/h5pp/archive/v1.11.2.tar.gz" + sha256: "5638bf699a92049910c80a7af3d6c8495f02253dd32ee0000bc35a29a9e61e9c" + "1.11.1": + url: "https://github.com/DavidAce/h5pp/archive/v1.11.1.tar.gz" + sha256: "659d566dcb011e7a0f14f9fec9d6e6c783559eec3fd051de1e5cf44d95fd752b" "1.11.0.1": url: "https://github.com/DavidAce/h5pp/archive/v1.11.0.1.tar.gz" sha256: "73b08273c36220fad2836897138f4e0adbe347ea7d1cc7c22f9783a29b24f967" diff --git a/recipes/h5pp/all/conanfile.py b/recipes/h5pp/all/conanfile.py index 9c9caa28d810e..d86cc080b5e0a 100644 --- a/recipes/h5pp/all/conanfile.py +++ b/recipes/h5pp/all/conanfile.py @@ -25,12 +25,14 @@ class H5ppConan(ConanFile): options = { "with_eigen": [True, False], "with_spdlog": [True, False], - "with_zlib" : [True, False], + "with_zlib" : [True, False], + "with_quadmath": [True, False] } default_options = { "with_eigen": True, "with_spdlog": True, "with_zlib" : True, + "with_quadmath": False } @property @@ -62,15 +64,18 @@ def config_options(self): del self.options.with_zlib else: self.options["hdf5"].with_zlib = self.options.with_zlib + if Version(self.version) < "1.11.1" or self.settings.compiler != "gcc": + # h5pp only supports quadmath with GNU compilers + del self.options.with_quadmath def requirements(self): - self.requires("hdf5/1.14.0", transitive_headers=True, transitive_libs=True) + self.requires("hdf5/1.14.3", transitive_headers=True, transitive_libs=True) if Version(self.version) < "1.10.0" or self.options.get_safe('with_eigen'): self.requires("eigen/3.4.0", transitive_headers=True) 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) + self.requires("spdlog/1.13.0", transitive_headers=True, transitive_libs=True) if Version(self.version) >= "1.10.0" and self.options.with_zlib: - self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) + self.requires("zlib/1.3", transitive_headers=True, transitive_libs=True) def layout(self): basic_layout(self,src_folder="src") @@ -118,20 +123,23 @@ def package_info(self): self.cpp_info.components["h5pp_flags"].bindirs = [] self.cpp_info.components["h5pp_flags"].libdirs = [] - if Version(self.version) >= "1.10.0": - if self.options.with_eigen: + if Version(self.version) < "1.10.0": + self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen") + self.cpp_info.components["h5pp_deps"].requires.append("spdlog::spdlog") + else: + if self.options.get_safe("with_eigen"): self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen") self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_EIGEN3") - if self.options.with_spdlog: + if self.options.get_safe("with_spdlog"): self.cpp_info.components["h5pp_deps"].requires.append("spdlog::spdlog") self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_SPDLOG") self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_FMT") - if self.options.with_zlib: + if self.options.get_safe("with_zlib"): self.cpp_info.components["h5pp_deps"].requires.append("zlib::zlib") - - else: - self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen") - self.cpp_info.components["h5pp_deps"].requires.append("spdlog::spdlog") + if self.options.get_safe("with_quadmath"): + self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_FLOAT128") + self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_QUADMATH") + self.cpp_info.system_libs.append('quadmath') if (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9") or \ (self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") in ["libstdc++", "libstdc++11"]): diff --git a/recipes/h5pp/all/test_package/CMakeLists.txt b/recipes/h5pp/all/test_package/CMakeLists.txt index 523f3a9d98155..683873eaa3765 100644 --- a/recipes/h5pp/all/test_package/CMakeLists.txt +++ b/recipes/h5pp/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) add_executable(test_package test_package.cpp) diff --git a/recipes/h5pp/all/test_package/test_package.cpp b/recipes/h5pp/all/test_package/test_package.cpp index 384a3eda62383..ea55e300f5e70 100644 --- a/recipes/h5pp/all/test_package/test_package.cpp +++ b/recipes/h5pp/all/test_package/test_package.cpp @@ -19,5 +19,12 @@ int main() { // Read dummy data from file auto vectorComplexRead = file.readDataset>("vectorComplex"); + +#if defined(H5PP_USE_FLOAT128) + __float128 f128 = 6.28318530717958623199592693708837032318115234375; + file.writeDataset(f128, "__float128"); + auto f128_read = file.readDataset<__float128>("__float128"); +#endif + return 0; } diff --git a/recipes/h5pp/all/test_v1_package/CMakeLists.txt b/recipes/h5pp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7b0b3d3e25936..0000000000000 --- a/recipes/h5pp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) -target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_17) - -find_package(h5pp REQUIRED CONFIG) -target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE h5pp::h5pp) diff --git a/recipes/h5pp/all/test_v1_package/conanfile.py b/recipes/h5pp/all/test_v1_package/conanfile.py deleted file mode 100644 index ca45a778caa64..0000000000000 --- a/recipes/h5pp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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): - self.run(os.path.join("bin","test_package"), run_environment=True) diff --git a/recipes/h5pp/all/test_v1_package/test_package.cpp b/recipes/h5pp/all/test_v1_package/test_package.cpp deleted file mode 100644 index 384a3eda62383..0000000000000 --- a/recipes/h5pp/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include - -int main() { - using cplx = std::complex; - - static_assert(h5pp::type::sfinae::has_data>() and - "h5pp ompile time type-checker failed. Could not properly detect class member data. Check that you are using a supported compiler!"); - - std::string outputFilename = "test_package.h5"; - size_t logLevel = 1; - h5pp::File file(outputFilename, H5F_ACC_TRUNC | H5F_ACC_RDWR, logLevel); - - // Generate dummy data - std::vector vectorComplexWrite = {{-0.191154, 0.326211}, {0.964728, -0.712335}, {-0.0351791, -0.10264}, {0.177544, 0.99999}}; - - // Write dummy data to file - file.writeDataset(vectorComplexWrite, "vectorComplex"); - - - // Read dummy data from file - auto vectorComplexRead = file.readDataset>("vectorComplex"); - return 0; -} diff --git a/recipes/h5pp/config.yml b/recipes/h5pp/config.yml index 6a5c9d7731601..a489a477b18f9 100644 --- a/recipes/h5pp/config.yml +++ b/recipes/h5pp/config.yml @@ -15,3 +15,7 @@ versions: folder: "all" "1.11.0.1": folder: "all" + "1.11.1": + folder: "all" + "1.11.2": + folder: "all" diff --git a/recipes/half/all/test_package/CMakeLists.txt b/recipes/half/all/test_package/CMakeLists.txt index 8909a3f1339ea..905fb99d17059 100644 --- a/recipes/half/all/test_package/CMakeLists.txt +++ b/recipes/half/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(half REQUIRED CONFIG) diff --git a/recipes/half/all/test_v1_package/CMakeLists.txt b/recipes/half/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/half/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/half/all/test_v1_package/conanfile.py b/recipes/half/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/half/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_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/hana/all/test_package/CMakeLists.txt b/recipes/hana/all/test_package/CMakeLists.txt index 35d91de00798e..89fb87a239929 100644 --- a/recipes/hana/all/test_package/CMakeLists.txt +++ b/recipes/hana/all/test_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/happly/all/test_v1_package/CMakeLists.txt b/recipes/happly/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/happly/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 4b114846091e7..0000000000000 --- a/recipes/happly/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +0,0 @@ -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 0621f68bfe102..6f943e1c07a03 100644 --- a/recipes/harfbuzz/all/conandata.yml +++ b/recipes/harfbuzz/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "10.4.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/10.4.0/harfbuzz-10.4.0.tar.xz" + sha256: "480b6d25014169300669aa1fc39fb356c142d5028324ea52b3a27648b9beaad8" "8.3.0": url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.3.0/harfbuzz-8.3.0.tar.xz" sha256: "109501eaeb8bde3eadb25fab4164e993fbace29c3d775bcaa1c1e58e2f15f847" diff --git a/recipes/harfbuzz/all/conanfile.py b/recipes/harfbuzz/all/conanfile.py index 7904abea985f6..873c8a5081e27 100644 --- a/recipes/harfbuzz/all/conanfile.py +++ b/recipes/harfbuzz/all/conanfile.py @@ -84,7 +84,7 @@ def requirements(self): if self.options.with_icu: self.requires("icu/74.1") if self.options.with_glib: - self.requires("glib/2.78.1") + self.requires("glib/2.78.3") def validate(self): if self.options.shared and self.options.with_glib and not self.dependencies["glib"].options.shared: @@ -100,9 +100,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") if self.options.with_glib: self.tool_requires("glib/") if self.settings.os == "Macos": @@ -141,6 +141,7 @@ def is_vs_2017(): backend, cxxflags = meson_backend_and_flags() tc = MesonToolchain(self, backend=backend) + tc.project_options["auto_features"] = "disabled" tc.project_options.update({ "glib": is_enabled(self.options.with_glib), "icu": is_enabled(self.options.with_icu), diff --git a/recipes/harfbuzz/all/test_package/conanfile.py b/recipes/harfbuzz/all/test_package/conanfile.py index e9a060aba448d..ca918824970c4 100644 --- a/recipes/harfbuzz/all/test_package/conanfile.py +++ b/recipes/harfbuzz/all/test_package/conanfile.py @@ -23,6 +23,5 @@ def build(self): def test(self): if can_run(self): - font = os.path.join(self.source_folder, "example.ttf") bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(f"{bin_path} {font}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/harfbuzz/all/test_package/example.ttf b/recipes/harfbuzz/all/test_package/example.ttf deleted file mode 100644 index 1849f5cc07efa..0000000000000 Binary files a/recipes/harfbuzz/all/test_package/example.ttf and /dev/null differ diff --git a/recipes/harfbuzz/all/test_package/test_package.c b/recipes/harfbuzz/all/test_package/test_package.c index 5f2ac9a8454e4..0bd42e5ab1456 100644 --- a/recipes/harfbuzz/all/test_package/test_package.c +++ b/recipes/harfbuzz/all/test_package/test_package.c @@ -1,141 +1,9 @@ -/* - * Copyright © 2011 Google, Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Google Author(s): Behdad Esfahbod - */ - -#include #include -#include - -#include "harfbuzz/hb.h" -#include "harfbuzz/hb-ot.h" - -#define FONT_SIZE 36 -#define MARGIN (FONT_SIZE * .5) - -/* Use native open type implementation to load font - https://github.com/harfbuzz/harfbuzz/issues/255 */ -hb_font_t* -get_font_ot(const char *filename, int size) -{ - size_t result = 0; - FILE* file = fopen(filename, "rb"); - fseek(file, 0, SEEK_END); - unsigned int length = ftell(file); - fseek(file, 0, SEEK_SET); - - char* data = (char*) malloc(length); - result = fread(data, length, 1, file); - if (result != 1) - { - fputs ("Reading error", stderr); - exit (3); - } - fclose(file); - - hb_blob_t* blob = hb_blob_create(data, length, HB_MEMORY_MODE_WRITABLE, (void*)data, NULL); - hb_face_t* face = hb_face_create(blob, 0); - hb_font_t* font = hb_font_create(face); - - hb_ot_font_set_funcs(font); - hb_font_set_scale(font, size, size); - - return font; -} - -int -main(int argc, char **argv) -{ - if (argc < 2) { - fprintf(stderr, "Usage: %s FONT\n", argv[0]); - return 1; - } - const char *fontfile = argv[1]; - const char *text = "conan-center-index"; - - /* Create hb-ft font. */ - hb_font_t *hb_font; - hb_font = get_font_ot (fontfile, FONT_SIZE*64); - - /* Create hb-buffer and populate. */ - hb_buffer_t *hb_buffer; - hb_buffer = hb_buffer_create (); - hb_buffer_add_utf8 (hb_buffer, text, -1, 0, -1); - hb_buffer_guess_segment_properties (hb_buffer); - - /* Shape it! */ - hb_shape (hb_font, hb_buffer, NULL, 0); - - /* Get glyph information and positions out of the buffer. */ - unsigned int len = hb_buffer_get_length (hb_buffer); - hb_glyph_info_t *info = hb_buffer_get_glyph_infos (hb_buffer, NULL); - hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (hb_buffer, NULL); - - /* Print them out as is. */ - printf ("Raw buffer contents:\n"); - for (unsigned int i = 0; i < len; i++) - { - hb_codepoint_t gid = info[i].codepoint; - unsigned int cluster = info[i].cluster; - double x_advance = pos[i].x_advance / 64.; - double y_advance = pos[i].y_advance / 64.; - double x_offset = pos[i].x_offset / 64.; - double y_offset = pos[i].y_offset / 64.; - - char glyphname[32]; - hb_font_get_glyph_name (hb_font, gid, glyphname, sizeof (glyphname)); - - printf ("glyph='%s' cluster=%d advance=(%g,%g) offset=(%g,%g)\n", - glyphname, cluster, x_advance, y_advance, x_offset, y_offset); - } - - printf ("Converted to absolute positions:\n"); - /* And converted to absolute positions. */ - { - double current_x = 0; - double current_y = 0; - for (unsigned int i = 0; i < len; i++) - { - hb_codepoint_t gid = info[i].codepoint; - unsigned int cluster = info[i].cluster; - double x_position = current_x + pos[i].x_offset / 64.; - double y_position = current_y + pos[i].y_offset / 64.; - - - char glyphname[32]; - hb_font_get_glyph_name (hb_font, gid, glyphname, sizeof (glyphname)); - - printf ("glyph='%s' cluster=%d position=(%g,%g)\n", - glyphname, cluster, x_position, y_position); - - current_x += pos[i].x_advance / 64.; - current_y += pos[i].y_advance / 64.; - } - } - - hb_buffer_destroy (hb_buffer); - hb_font_destroy (hb_font); +#include +#include - return 0; +int main() { + const char *version = hb_version_string(); + printf("harfbuzz version: %s\n", version); + return 0; } diff --git a/recipes/harfbuzz/all/test_v1_package/conanfile.py b/recipes/harfbuzz/all/test_v1_package/conanfile.py index a4aa2f28304a1..994065a757445 100644 --- a/recipes/harfbuzz/all/test_v1_package/conanfile.py +++ b/recipes/harfbuzz/all/test_v1_package/conanfile.py @@ -13,7 +13,6 @@ def build(self): def test(self): if not tools.cross_building(self): - font = os.path.join(self.source_folder, "..", "test_package", "example.ttf") bin_path = os.path.join("bin", "test_package") - self.run(f"{bin_path} {font}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml index d5a1a8bf9dfc4..c2cd59eab99df 100644 --- a/recipes/harfbuzz/config.yml +++ b/recipes/harfbuzz/config.yml @@ -1,4 +1,6 @@ versions: + "10.4.0": + folder: all "8.3.0": folder: all "8.2.2": diff --git a/recipes/hash-library/all/CMakeLists.txt b/recipes/hash-library/all/CMakeLists.txt index 14405c91fb240..f5cc9d8728e62 100644 --- a/recipes/hash-library/all/CMakeLists.txt +++ b/recipes/hash-library/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(hash-library LANGUAGES CXX) add_library(hash-library diff --git a/recipes/hash-library/all/test_package/CMakeLists.txt b/recipes/hash-library/all/test_package/CMakeLists.txt index d020276409c2e..51b5e1f941dd1 100644 --- a/recipes/hash-library/all/test_package/CMakeLists.txt +++ b/recipes/hash-library/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(hash-library CONFIG REQUIRED) diff --git a/recipes/hash-library/all/test_v1_package/CMakeLists.txt b/recipes/hash-library/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/hash-library/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/hash-library/all/test_v1_package/conanfile.py b/recipes/hash-library/all/test_v1_package/conanfile.py deleted file mode 100644 index 4265550ef4aee..0000000000000 --- a/recipes/hash-library/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, tools, CMake - - -class HashLibraryTestConan(ConanFile): - settings = "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/hazelcast-cpp-client/all/conanfile.py b/recipes/hazelcast-cpp-client/all/conanfile.py index a46e46f6fda67..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,7 +43,7 @@ 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 <4]") @@ -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) diff --git a/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt b/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt index 47708a63a3ae9..17ddb30e6b797 100644 --- a/recipes/hazelcast-cpp-client/all/test_package/CMakeLists.txt +++ b/recipes/hazelcast-cpp-client/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(hazelcast-cpp-client REQUIRED CONFIG) 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/all/test_v1_package/CMakeLists.txt b/recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/hazelcast-cpp-client/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/hazelcast-cpp-client/all/test_v1_package/conanfile.py b/recipes/hazelcast-cpp-client/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/hazelcast-cpp-client/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_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/hdf4/all/conandata.yml b/recipes/hdf4/all/conandata.yml index b74cc986517d2..b92568111eedd 100644 --- a/recipes/hdf4/all/conandata.yml +++ b/recipes/hdf4/all/conandata.yml @@ -1,4 +1,9 @@ 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" diff --git a/recipes/hdf4/all/conanfile.py b/recipes/hdf4/all/conanfile.py index 161143820d862..daa7c6c3b6c69 100644 --- a/recipes/hdf4/all/conanfile.py +++ b/recipes/hdf4/all/conanfile.py @@ -3,7 +3,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.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, move_folder_contents +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -64,6 +65,8 @@ def requirements(self): def source(self): 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) diff --git a/recipes/hdf4/all/test_v1_package/CMakeLists.txt b/recipes/hdf4/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/hdf4/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 2d700055b1faf..0000000000000 --- a/recipes/hdf4/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,24 +0,0 @@ -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 c5d710eb6a95b..b3a2eb941b898 100644 --- a/recipes/hdf5/all/conandata.yml +++ b/recipes/hdf5/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.14.5": + url: "https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_1.14.5.tar.gz" + sha256: "c83996dc79080a34e7b5244a1d5ea076abfd642ec12d7c25388e2fdd81d26350" + "1.14.4.3": + url: "https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_1.14.4.3.tar.gz" + sha256: "690c1db7ba0fed4ffac61709236675ffd99d95d191e8920ee79c58d7e7ea3361" "1.14.3": url: "https://github.com/HDFGroup/hdf5/archive/hdf5-1_14_3/hdf5-1_14_3.tar.gz" sha256: "df5ee33c74d5efb59738075ef96f4201588e1f1eeb233f047ac7fd1072dee1f6" diff --git a/recipes/hdf5/all/conanfile.py b/recipes/hdf5/all/conanfile.py index 2f176fad53d61..6ef1845be3cb4 100644 --- a/recipes/hdf5/all/conanfile.py +++ b/recipes/hdf5/all/conanfile.py @@ -4,7 +4,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import can_run, check_min_cppstd, valid_min_cppstd +from conan.tools.build import cross_building, check_min_cppstd, 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.scm import Version @@ -17,7 +17,7 @@ class Hdf5Conan(ConanFile): description = "HDF5 is a data model, library, and file format for storing and managing data." license = "BSD-3-Clause" topics = "hdf", "data" - homepage = "https://portal.hdfgroup.org/display/HDF5/HDF5" + homepage = "https://www.hdfgroup.org/solutions/hdf5/" url = "https://github.com/conan-io/conan-center-index" package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -28,6 +28,7 @@ class Hdf5Conan(ConanFile): "hl": [True, False], "threadsafe": [True, False], "with_zlib": [True, False], + "with_zlibng": [True, False], "szip_support": [None, "with_libaec", "with_szip"], "szip_encoding": [True, False], "parallel": [True, False], @@ -40,6 +41,7 @@ class Hdf5Conan(ConanFile): "hl": True, "threadsafe": False, "with_zlib": True, + "with_zlibng": False, "szip_support": None, "szip_encoding": False, "parallel": False, @@ -77,6 +79,8 @@ def layout(self): def requirements(self): if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_zlibng: + self.requires("zlib-ng/2.2.2") if self.options.szip_support == "with_libaec": self.requires("libaec/1.0.6") elif self.options.szip_support == "with_szip": @@ -85,9 +89,6 @@ def requirements(self): self.requires("openmpi/4.1.0") def validate(self): - if not can_run(self): - # While building it runs some executables like H5detect - raise ConanInvalidConfiguration("Current recipe doesn't support cross-building (yet)") if self.options.parallel and not self.options.enable_unsupported: if self.options.enable_cxx: raise ConanInvalidConfiguration("Parallel and C++ options are mutually exclusive, forcefully allow with enable_unsupported=True") @@ -97,9 +98,18 @@ def validate(self): self.options.szip_encoding and \ not self.dependencies["szip"].options.enable_encoding: raise ConanInvalidConfiguration("encoding must be enabled in szip dependency (szip:enable_encoding=True)") + if self.options.with_zlib and self.options.get_safe("with_zlibng"): + raise ConanInvalidConfiguration("with_zlib and with_zlibng cannot be enabled at the same time") + if self.options.get_safe("with_zlibng") and Version(self.version) < "1.14.5": + raise ConanInvalidConfiguration("with_zlibng=True is incompatible with versions prior to v1.14.5") if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._min_cppstd) + def validate_build(self): + if cross_building(self) and Version(self.version) < "1.14.4.3": + # While building it runs some executables like H5detect + raise ConanInvalidConfiguration("Current recipe doesn't support cross-building (yet)") + def build_requirements(self): if Version(self.version) >= "1.14.0": self.tool_requires("cmake/[>=3.18 <4]") @@ -148,6 +158,7 @@ def generate(self): tc.variables["HDF5_ENABLE_Z_LIB_SUPPORT"] = self.options.with_zlib tc.variables["HDF5_ENABLE_SZIP_SUPPORT"] = bool(self.options.szip_support) tc.variables["HDF5_ENABLE_SZIP_ENCODING"] = self.options.get_safe("szip_encoding", False) + tc.variables["HDF5_USE_ZLIB_NG"] = self.options.get_safe("with_zlibng", False) tc.variables["HDF5_PACKAGE_EXTLIBS"] = False tc.variables["HDF5_ENABLE_THREADSAFE"] = self.options.get_safe("threadsafe", False) tc.variables["HDF5_ENABLE_DEBUG_APIS"] = False # Option? diff --git a/recipes/hdf5/all/test_v1_package/CMakeLists.txt b/recipes/hdf5/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 907e42aba8a37..0000000000000 --- a/recipes/hdf5/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/hdf5/all/test_v1_package/conanfile.py b/recipes/hdf5/all/test_v1_package/conanfile.py deleted file mode 100644 index 57bd58e9f46c2..0000000000000 --- a/recipes/hdf5/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +0,0 @@ -import os - -from conans import CMake, ConanFile, tools - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" - - def build(self): - cmake = CMake(self) - cmake.definitions.update({ - "HDF5_CXX": self.options["hdf5"].enable_cxx, - "HDF5_HL": self.options["hdf5"].hl, - }) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/hdf5/config.yml b/recipes/hdf5/config.yml index 78000beb7c226..ecd8ab4173bf5 100644 --- a/recipes/hdf5/config.yml +++ b/recipes/hdf5/config.yml @@ -1,4 +1,8 @@ versions: + "1.14.5": + folder: all + "1.14.4.3": + folder: all "1.14.3": folder: all "1.14.2": 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/test_package/CMakeLists.txt b/recipes/hdrhistogram-c/all/test_package/CMakeLists.txt index 43cecb9cf0752..1a6d3c3a47b1a 100644 --- a/recipes/hdrhistogram-c/all/test_package/CMakeLists.txt +++ b/recipes/hdrhistogram-c/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(hdr_histogram REQUIRED CONFIG) diff --git a/recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt b/recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/hdrhistogram-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/hdrhistogram-c/all/test_v1_package/conanfile.py b/recipes/hdrhistogram-c/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/hdrhistogram-c/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_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/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/heatshrink/all/test_package/CMakeLists.txt b/recipes/heatshrink/all/test_package/CMakeLists.txt index ac68508859a4c..ab01cd635bd76 100644 --- a/recipes/heatshrink/all/test_package/CMakeLists.txt +++ b/recipes/heatshrink/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(heatshrink REQUIRED CONFIG) diff --git a/recipes/heatshrink/all/test_v1_package/CMakeLists.txt b/recipes/heatshrink/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/heatshrink/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/heatshrink/all/test_v1_package/conanfile.py b/recipes/heatshrink/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/heatshrink/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_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/hedley/all/test_package/CMakeLists.txt b/recipes/hedley/all/test_package/CMakeLists.txt index 6cccdaf4798b6..2e348150abe5c 100644 --- a/recipes/hedley/all/test_package/CMakeLists.txt +++ b/recipes/hedley/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(hedley REQUIRED CONFIG) diff --git a/recipes/hedley/all/test_v1_package/CMakeLists.txt b/recipes/hedley/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/hedley/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/hedley/all/test_v1_package/conanfile.py b/recipes/hedley/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/hedley/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_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/hello-conan/all/CMakeLists.txt b/recipes/hello-conan/all/CMakeLists.txt new file mode 100644 index 0000000000000..4be7c999bbce3 --- /dev/null +++ b/recipes/hello-conan/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(hello-conan LANGUAGES CXX) + +add_library(hello-conan src/hello-conan.cpp) + +target_include_directories(hello-conan PUBLIC include) +set_target_properties(hello-conan PROPERTIES PUBLIC_HEADER "include/hello-conan.h") +install(TARGETS hello-conan) diff --git a/recipes/hello-conan/all/conanfile.py b/recipes/hello-conan/all/conanfile.py new file mode 100644 index 0000000000000..5ce78afb9e98a --- /dev/null +++ b/recipes/hello-conan/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import save + +from pathlib import Path + +required_conan_version = ">=2.8.0" + +class hello_conanRecipe(ConanFile): + name = "hello-conan" + package_type = "library" + + # Optional metadata !_!!!! + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + description = "Dummy recipe for internal testing" + topics = ("conan-testing", "dummy") + + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + # Sources are located in the same place as this recipe, copy them to the recipe + exports_sources = "CMakeLists.txt", "src/*", "include/*" + + implements = ["auto_shared_fpic"] + + def layout(self): + cmake_layout(self) + + 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): + cmake = CMake(self) + cmake.install() + + # save a dummy .la file to trigger hook warning + la_file = Path(self.package_folder) / "lib" / "hello-conan-foobar.la" + save(self, la_file.as_posix(), "foobar") + + def package_info(self): + self.cpp_info.libs = ["hello-conan"] + diff --git a/recipes/hello-conan/all/include/hello-conan.h b/recipes/hello-conan/all/include/hello-conan.h new file mode 100644 index 0000000000000..a7ad36e5ace0c --- /dev/null +++ b/recipes/hello-conan/all/include/hello-conan.h @@ -0,0 +1,14 @@ +#pragma once + +#include +#include + + +#ifdef _WIN32 + #define HELLO_CONAN_EXPORT __declspec(dllexport) +#else + #define HELLO_CONAN_EXPORT +#endif + +HELLO_CONAN_EXPORT void hello_conan(); +HELLO_CONAN_EXPORT void hello_conan_print_vector(const std::vector &strings); diff --git a/recipes/hello-conan/all/src/hello-conan.cpp b/recipes/hello-conan/all/src/hello-conan.cpp new file mode 100644 index 0000000000000..e4ac284e8c482 --- /dev/null +++ b/recipes/hello-conan/all/src/hello-conan.cpp @@ -0,0 +1,120 @@ +#include +#include "hello-conan.h" + + + +void hello_conan(){ + + + #ifdef NDEBUG + std::cout << "hello-conan: Hello World Release!\n"; + #else + std::cout << "hello-conan: Hello World Debug!\n"; + #endif + + // ARCHITECTURES + #ifdef _M_X64 + std::cout << " hello-conan: _M_X64 defined\n"; + #endif + + #ifdef _M_IX86 + std::cout << " hello-conan: _M_IX86 defined\n"; + #endif + + #ifdef _M_ARM64 + std::cout << " hello-conan: _M_ARM64 defined\n"; + #endif + + #if __i386__ + std::cout << " hello-conan: __i386__ defined\n"; + #endif + + #if __x86_64__ + std::cout << " hello-conan: __x86_64__ defined\n"; + #endif + + #if __aarch64__ + std::cout << " hello-conan: __aarch64__ defined\n"; + #endif + + // Libstdc++ + #if defined _GLIBCXX_USE_CXX11_ABI + std::cout << " hello-conan: _GLIBCXX_USE_CXX11_ABI "<< _GLIBCXX_USE_CXX11_ABI << "\n"; + #endif + + // MSVC runtime + #if defined(_DEBUG) + #if defined(_MT) && defined(_DLL) + std::cout << " hello-conan: MSVC runtime: MultiThreadedDebugDLL\n"; + #elif defined(_MT) + std::cout << " hello-conan: MSVC runtime: MultiThreadedDebug\n"; + #endif + #else + #if defined(_MT) && defined(_DLL) + std::cout << " hello-conan: MSVC runtime: MultiThreadedDLL\n"; + #elif defined(_MT) + std::cout << " hello-conan: MSVC runtime: MultiThreaded\n"; + #endif + #endif + + // COMPILER VERSIONS + #if _MSC_VER + std::cout << " hello-conan: _MSC_VER" << _MSC_VER<< "\n"; + #endif + + #if _MSVC_LANG + std::cout << " hello-conan: _MSVC_LANG" << _MSVC_LANG<< "\n"; + #endif + + #if __cplusplus + std::cout << " hello-conan: __cplusplus" << __cplusplus<< "\n"; + #endif + + #if __INTEL_COMPILER + std::cout << " hello-conan: __INTEL_COMPILER" << __INTEL_COMPILER<< "\n"; + #endif + + #if __GNUC__ + std::cout << " hello-conan: __GNUC__" << __GNUC__<< "\n"; + #endif + + #if __GNUC_MINOR__ + std::cout << " hello-conan: __GNUC_MINOR__" << __GNUC_MINOR__<< "\n"; + #endif + + #if __clang_major__ + std::cout << " hello-conan: __clang_major__" << __clang_major__<< "\n"; + #endif + + #if __clang_minor__ + std::cout << " hello-conan: __clang_minor__" << __clang_minor__<< "\n"; + #endif + + #if __apple_build_version__ + std::cout << " hello-conan: __apple_build_version__" << __apple_build_version__<< "\n"; + #endif + + // SUBSYSTEMS + + #if __MSYS__ + std::cout << " hello-conan: __MSYS__" << __MSYS__<< "\n"; + #endif + + #if __MINGW32__ + std::cout << " hello-conan: __MINGW32__" << __MINGW32__<< "\n"; + #endif + + #if __MINGW64__ + std::cout << " hello-conan: __MINGW64__" << __MINGW64__<< "\n"; + #endif + + #if __CYGWIN__ + std::cout << " hello-conan: __CYGWIN__" << __CYGWIN__<< "\n"; + #endif +} + +void hello_conan_print_vector(const std::vector &strings) { + for(std::vector::const_iterator it = strings.begin(); it != strings.end(); ++it) { + std::cout << "hello_conan " << *it << std::endl; + } +} diff --git a/recipes/hello-conan/all/test_package/CMakeLists.txt b/recipes/hello-conan/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5a6e6596a4333 --- /dev/null +++ b/recipes/hello-conan/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(hello-conan CONFIG REQUIRED) + +add_executable(example src/example.cpp) +target_link_libraries(example hello-conan::hello-conan) diff --git a/recipes/hello-conan/all/test_package/conanfile.py b/recipes/hello-conan/all/test_package/conanfile.py new file mode 100644 index 0000000000000..953f2c57d31ae --- /dev/null +++ b/recipes/hello-conan/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 hello_conanTestConan(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 can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "example") + self.run(cmd, env="conanrun") diff --git a/recipes/hello-conan/all/test_package/src/example.cpp b/recipes/hello-conan/all/test_package/src/example.cpp new file mode 100644 index 0000000000000..92b072f19e866 --- /dev/null +++ b/recipes/hello-conan/all/test_package/src/example.cpp @@ -0,0 +1,12 @@ +#include "hello-conan.h" +#include +#include + +int main() { + hello_conan(); + + std::vector vec; + vec.push_back("test_package"); + + hello_conan_print_vector(vec); +} diff --git a/recipes/hello-conan/config.yml b/recipes/hello-conan/config.yml new file mode 100644 index 0000000000000..87dc2c7cd104e --- /dev/null +++ b/recipes/hello-conan/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.1.cci.20241029": + folder: all \ No newline at end of file diff --git a/recipes/hexl/all/test_v1_package/CMakeLists.txt b/recipes/hexl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/hexl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 0a70df7062409..0000000000000 --- a/recipes/hexl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -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/hffix/all/test_v1_package/CMakeLists.txt b/recipes/hffix/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/hffix/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/hffix/all/test_v1_package/conanfile.py b/recipes/hffix/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/hffix/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_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/hfsm2/all/conandata.yml b/recipes/hfsm2/all/conandata.yml new file mode 100644 index 0000000000000..b097c3b541bf6 --- /dev/null +++ b/recipes/hfsm2/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.5.2": + url: "https://github.com/andrew-gresyk/HFSM2/archive/refs/tags/2.5.2.tar.gz" + sha256: "b5a35ce065ea3e32cf9cda48813877e35526a0e377b9344f726d1d80aeaeaa5d" diff --git a/recipes/hfsm2/all/conanfile.py b/recipes/hfsm2/all/conanfile.py new file mode 100644 index 0000000000000..829fea8364966 --- /dev/null +++ b/recipes/hfsm2/all/conanfile.py @@ -0,0 +1,40 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy +from conan.tools.build import check_min_cppstd +from conan.tools.layout import basic_layout +from conan.tools.files import get + +required_conan_version = ">=2.0" + +class Hfsm2Conan(ConanFile): + name = "hfsm2" + description = "High-Performance Hierarchical Finite State Machine Framework" + license = "MIT" + topics = ("embedded", "fsm", "state-machine", "cpp", "modern-cpp", "game-development", + "cpp11", "embedded-systems", "template-metaprogramming", "header-only", + "mit-license", "fsm-library", "hierarchical-state-machine", "game-dev", "hfsm") + homepage = "https://hfsm.dev/" + 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 validate(self): + check_min_cppstd(self, 11) + + 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, "*.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 = [] diff --git a/recipes/hfsm2/all/test_package/CMakeLists.txt b/recipes/hfsm2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..af6a0d5096752 --- /dev/null +++ b/recipes/hfsm2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(hfsm2 REQUIRED CONFIG) + +add_executable(example example.cpp) +target_link_libraries(example PRIVATE hfsm2::hfsm2) diff --git a/recipes/hfsm2/all/test_package/conanfile.py b/recipes/hfsm2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e0f447388fa1b --- /dev/null +++ b/recipes/hfsm2/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): + bin_path = os.path.join(self.cpp.build.bindir, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/hfsm2/all/test_package/example.cpp b/recipes/hfsm2/all/test_package/example.cpp new file mode 100644 index 0000000000000..dd777f4c48413 --- /dev/null +++ b/recipes/hfsm2/all/test_package/example.cpp @@ -0,0 +1,20 @@ +#include +#include +#include + +struct Context{}; + +using Config = hfsm2::Config::ContextT; +using M = hfsm2::MachineT; +using FSM = M::PeerRoot; + +struct State : FSM::State {}; + + +int main(void) { + Context context; + FSM::Instance machine{context}; + machine.update(); + std::cout << "[HFSM2] Test package passed with success." << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/hfsm2/config.yml b/recipes/hfsm2/config.yml new file mode 100644 index 0000000000000..2ac88b6313aec --- /dev/null +++ b/recipes/hfsm2/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.2": + folder: all diff --git a/recipes/hictk/all/conandata.yml b/recipes/hictk/all/conandata.yml index 0a77d0b0f3599..01e351f4fedb2 100644 --- a/recipes/hictk/all/conandata.yml +++ b/recipes/hictk/all/conandata.yml @@ -1,10 +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" + "2.0.2": + url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v2.0.2.tar.gz" + sha256: "349d7635186f91707ab4f55e9427fd966bebd2337542e394ae93f08c0759411d" + "1.0.0": + url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v1.0.0.tar.gz" + sha256: "e337f52658a257eb6265e211dd3cef6b73db40bdc5b5a6433b47ce4faa6006fb" + "0.0.12": + url: "https://github.com/paulsengroup/hictk/archive/refs/tags/v0.0.12.tar.gz" + sha256: "03e8f7c0076ea6209fdfee1580658e871895f6a59b895407c4a25512b9558fb7" diff --git a/recipes/hictk/all/conanfile.py b/recipes/hictk/all/conanfile.py index 7e609444e89da..d625f5dbe8b32 100644 --- a/recipes/hictk/all/conanfile.py +++ b/recipes/hictk/all/conanfile.py @@ -5,6 +5,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, rmdir +from conan.tools.scm import Version required_conan_version = ">=1.50.0" @@ -18,8 +19,14 @@ class HictkConan(ConanFile): topics = "hictk", "bioinformatics", "hic" package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - options = {"with_eigen": [True, False]} - default_options = {"with_eigen": True} + options = { + "with_arrow": [True, False], + "with_eigen": [True, False] + } + default_options = { + "with_arrow": False, + "with_eigen": True + } @property def _min_cppstd(self): @@ -38,20 +45,30 @@ def _compilers_minimum_version(self): def layout(self): cmake_layout(self, src_folder="src") + def config_options(self): + if Version(self.version) < "1.0.0": + del self.options.with_arrow + 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.get_safe("with_arrow"): + self.requires("arrow/16.1.0") + if Version(self.version) < "2.0.0": + self.requires("bshoshany-thread-pool/4.1.0") + else: + self.requires("bshoshany-thread-pool/5.0.0") + self.requires("concurrentqueue/1.0.4") + self.requires("fast_float/6.1.1") 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) + self.requires("eigen/3.4.0") + self.requires("fmt/10.2.1") + self.requires("hdf5/1.14.3") + self.requires("highfive/2.9.0") + self.requires("libdeflate/1.22") + self.requires("parallel-hashmap/1.3.12") # Note: v1.3.12 is more recent than v1.37 + self.requires("readerwriterqueue/1.0.6") + self.requires("span-lite/0.11.0") + self.requires("spdlog/1.14.1") + self.requires("zstd/[>=1.5 <1.6]") def package_id(self): self.info.clear() @@ -60,18 +77,17 @@ 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): + 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.info.options.get_safe("with_arrow"): + arrow = self.dependencies["arrow"] + if not arrow.options.compute: + raise ConanInvalidConfiguration(f"{self.ref} requires the dependency option arrow/*:compute=True") + def build_requirements(self): self.tool_requires("cmake/[>=3.25 <4]") @@ -85,6 +101,8 @@ def generate(self): tc.variables["HICTK_BUILD_TOOLS"] = "OFF" tc.variables["HICTK_ENABLE_GIT_VERSION_TRACKING"] = "OFF" tc.variables["HICTK_ENABLE_TESTING"] = "OFF" + tc.variables["HICTK_ENABLE_FUZZY_TESTING"] = "OFF" + tc.variables["HICTK_WITH_ARROW"] = self.options.get_safe("with_arrow", False) tc.variables["HICTK_WITH_EIGEN"] = self.options.with_eigen tc.generate() @@ -114,3 +132,8 @@ def package_info(self): self.cpp_info.libdirs = [] self.cpp_info.set_property("cmake_file_name", "hictk") self.cpp_info.set_property("cmake_target_name", "hictk::libhictk") + + if self.options.get_safe("with_arrow"): + self.cpp_info.defines.append("HICTK_WITH_ARROW") + if self.options.with_eigen: + self.cpp_info.defines.append("HICTK_WITH_EIGEN") diff --git a/recipes/hictk/all/test_package/CMakeLists.txt b/recipes/hictk/all/test_package/CMakeLists.txt index 969fb76fe7be1..5d4d53dc3a237 100644 --- a/recipes/hictk/all/test_package/CMakeLists.txt +++ b/recipes/hictk/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) diff --git a/recipes/hictk/all/test_package/test_package.cpp b/recipes/hictk/all/test_package/test_package.cpp index bbe13ab6a3219..42d91c268d066 100644 --- a/recipes/hictk/all/test_package/test_package.cpp +++ b/recipes/hictk/all/test_package/test_package.cpp @@ -1,8 +1,28 @@ -#include -#include "hictk/fmt.hpp" -#include "hictk/cooler/utils.hpp" +#include +#include "hictk/balancing/ice.hpp" // test bshoshany-thread-pool +#include "hictk/chromosome.hpp" +#include "hictk/file.hpp" +#include "hictk/fmt.hpp" // test formatting of user-defined types with fmt +#include "hictk/genomic_interval.hpp" -int main(int argc, char** argv) { - fmt::print("{}\n", hictk::cooler::utils::is_cooler(argv[0])); +#if __has_include("hictk/transformers/to_dataframe.hpp") +#include "hictk/transformers/to_dataframe.hpp" // test hictk/*:with_arrow +#endif + +#if __has_include("hictk/transformers/to_dense_matrix.hpp") +#include "hictk/transformers/to_dense_matrix.hpp" // test hictk/*:with_eigen +#endif + +int main(int argc, char **argv) { + const hictk::Chromosome chrom(0, "chr1", 123); + const hictk::GenomicInterval gi(chrom, 10, 20); + SPDLOG_INFO(FMT_STRING("interval: {}"), gi); + + try { + const hictk::File f(argv[0], 10); // This is expected to throw + return 1; + } catch (const std::exception &e) {} + + return 0; } diff --git a/recipes/hictk/config.yml b/recipes/hictk/config.yml index ff35624c14df5..fff971caed5df 100644 --- a/recipes/hictk/config.yml +++ b/recipes/hictk/config.yml @@ -1,7 +1,7 @@ versions: - "0.0.3": + "2.0.2": folder: all - "0.0.2": + "1.0.0": folder: all - "0.0.1": + "0.0.12": folder: all diff --git a/recipes/hidapi/all/test_package/CMakeLists.txt b/recipes/hidapi/all/test_package/CMakeLists.txt index 51fe04d5b6cce..5a55a07489f68 100644 --- a/recipes/hidapi/all/test_package/CMakeLists.txt +++ b/recipes/hidapi/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(hidapi REQUIRED CONFIG) diff --git a/recipes/highfive/all/conandata.yml b/recipes/highfive/all/conandata.yml index edcf1ebb04b99..b506775776cce 100644 --- a/recipes/highfive/all/conandata.yml +++ b/recipes/highfive/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.10.0": + url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.10.0.tar.gz" + sha256: "c29e8e1520e7298fabb26545f804e35bb3af257005c1c2df62e39986458d7c38" + "2.9.0": + url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.9.0.tar.gz" + sha256: "6301def8ceb9f4d7a595988612db288b448a3c0546f6c83417dab38c64994d7e" "2.8.0": url: "https://github.com/BlueBrain/HighFive/archive/refs/tags/v2.8.0.tar.gz" sha256: "cd2502cae61bfb00e32dd18c9dc75289e09ad1db5c2a46d3b0eefd32e0df983b" diff --git a/recipes/highfive/all/conanfile.py b/recipes/highfive/all/conanfile.py index 0d48c634c34c5..4d9f9e5506221 100644 --- a/recipes/highfive/all/conanfile.py +++ b/recipes/highfive/all/conanfile.py @@ -6,16 +6,16 @@ import os import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.54.0" class HighFiveConan(ConanFile): name = "highfive" description = "HighFive is a modern header-only C++11 friendly interface for libhdf5." - license = "Boost Software License 1.0" - topics = ("hdf5", "hdf", "data") - homepage = "https://github.com/BlueBrain/HighFive" + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/BlueBrain/HighFive" + topics = ("hdf5", "hdf", "data", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { @@ -23,14 +23,14 @@ class HighFiveConan(ConanFile): "with_eigen": [True, False], "with_xtensor": [True, False], "with_opencv": [True, False], - "with_static_hdf5": [True, False], + "with_static_hdf5": ["deprecated", True, False], } default_options = { "with_boost": True, "with_eigen": True, "with_xtensor": True, "with_opencv": False, - "with_static_hdf5": False, + "with_static_hdf5": "deprecated", } def layout(self): @@ -42,7 +42,7 @@ def requirements(self): else: self.requires("hdf5/1.14.3") if self.options.with_boost: - self.requires("boost/1.83.0") + self.requires("boost/1.85.0") if self.options.with_eigen: self.requires("eigen/3.4.0") if self.options.with_xtensor: @@ -51,26 +51,28 @@ def requirements(self): self.requires("opencv/4.8.1") def package_id(self): + # INFO: We only set different compiler definitions. The package content is the same. self.info.clear() def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) + if self.options.with_static_hdf5 != "deprecated": + self.output.warning("The option 'with_static_hdf5' is deprecated. Use '-o hdf5/*:shared=True/False' instead.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.variables["USE_BOOST"] = self.options.with_boost - tc.variables["USE_EIGEN"] = self.options.with_eigen - tc.variables["USE_XTENSOR"] = self.options.with_xtensor - tc.variables["USE_OPENCV"] = self.options.with_opencv + tc.cache_variables["USE_BOOST"] = self.options.with_boost + tc.cache_variables["USE_EIGEN"] = self.options.with_eigen + tc.cache_variables["USE_XTENSOR"] = self.options.with_xtensor + tc.cache_variables["USE_OPENCV"] = self.options.with_opencv tc.variables["HIGHFIVE_UNIT_TESTS"] = False 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() @@ -130,12 +132,16 @@ def package_info(self): self.cpp_info.requires = ["hdf5::hdf5"] if self.options.with_boost: self.cpp_info.requires.append("boost::headers") + self.cpp_info.defines.append("H5_USE_BOOST") if self.options.with_eigen: self.cpp_info.requires.append("eigen::eigen") + self.cpp_info.defines.append("H5_USE_EIGEN") if self.options.with_xtensor: self.cpp_info.requires.append("xtensor::xtensor") + self.cpp_info.defines.append("H5_USE_XTENSOR") if self.options.with_opencv: self.cpp_info.requires.append("opencv::opencv") + self.cpp_info.defines.append("H5_USE_OPENCV") # TODO: to remove in conan v2 once legacy generators removed self.cpp_info.names["cmake_find_package"] = "HighFive" diff --git a/recipes/highfive/all/test_package/CMakeLists.txt b/recipes/highfive/all/test_package/CMakeLists.txt index 9094d8eb2cd6d..559758b8864ec 100644 --- a/recipes/highfive/all/test_package/CMakeLists.txt +++ b/recipes/highfive/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(HighFive REQUIRED CONFIG) diff --git a/recipes/highfive/config.yml b/recipes/highfive/config.yml index 28a0e4f7fb1d0..e2719579f8a54 100644 --- a/recipes/highfive/config.yml +++ b/recipes/highfive/config.yml @@ -1,4 +1,8 @@ versions: + "2.10.0": + folder: all + "2.9.0": + folder: all "2.8.0": folder: all "2.7.1": diff --git a/recipes/highs/all/conandata.yml b/recipes/highs/all/conandata.yml index c88418f873ba7..d8bffaa3cde0b 100644 --- a/recipes/highs/all/conandata.yml +++ b/recipes/highs/all/conandata.yml @@ -1,16 +1,14 @@ sources: - "1.6.0": - url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.6.0.tar.gz" - sha256: "71962981566477c72c51b8b722c5df053d857b05b4f0e6869f455f657b3aa193" - "1.5.3": - url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.5.3.tar.gz" - sha256: "ce1a7d2f008e60cc69ab06f8b16831bd0fcd5f6002d3bbebae9d7a3513a1d01d" - "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.10.0": + url: "https://github.com/ERGO-Code/HiGHS/releases/download/v1.10.0/source-archive.tar.gz" + sha256: "166067b014a7403ec04bce91617af9516c7bf3d6d654969a2dd952ba5234a2e5" + "1.9.0": + url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.9.0.tar.gz" + sha256: "dff575df08d88583c109702c7c5c75ff6e51611e6eacca8b5b3fdfba8ecc2cb4" + "1.8.1": + url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.8.1.tar.gz" + sha256: "a0d09371fadb56489497996b28433be1ef91a705e3811fcb1f50a107c7d427d1" + "1.7.2": + url: "https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v1.7.2.tar.gz" + sha256: "5ff96c14ae19592d3568e9ae107624cbaf3409d328fb1a586359f0adf9b34bf7" + diff --git a/recipes/highs/all/conanfile.py b/recipes/highs/all/conanfile.py index bba181cddafd7..31a3a0427b60b 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.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 -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,12 +25,6 @@ class HiGHSConan(ConanFile): "fPIC": True, } - 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 @@ -40,52 +33,46 @@ 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.11 <2]") - 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["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="highs") + 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")) - copy(self, pattern="*.lib", src=self.build_folder, dst=join(self.package_folder, "lib"), keep_path=False) - copy(self, pattern="*.dll", src=self.build_folder, dst=join(self.package_folder, "bin"), keep_path=False) - else: - copy(self, pattern="*.a", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) - if Version(self.version) >= Version("1.5.3"): - # https://github.com/ERGO-Code/HiGHS/commit/2c24b4cb6ecece98ed807dbeff9b27a2fbba8d37 - copy(self, pattern="*.lib", src=self.build_folder, dst=join(self.package_folder, "lib"), keep_path=False) - else: - 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) and Version(self.version) < Version("1.5.3"): - # https://github.com/ERGO-Code/HiGHS/commit/7d784db29ab22003670b8b2eb494ab1a97f1815b - 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_package/CMakeLists.txt b/recipes/highs/all/test_package/CMakeLists.txt index d953c847e1679..c56890cd2b1ef 100644 --- a/recipes/highs/all/test_package/CMakeLists.txt +++ b/recipes/highs/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) -set(CMAKE_CXX_STANDARD 11) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(highs REQUIRED CONFIG) add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE highs::highs) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/highs/config.yml b/recipes/highs/config.yml index ba8bd2230d031..15c258fcf3a82 100644 --- a/recipes/highs/config.yml +++ b/recipes/highs/config.yml @@ -1,7 +1,9 @@ versions: - "1.6.0": + "1.10.0": folder: all - "1.5.3": + "1.9.0": folder: all - "1.4.2": + "1.8.1": + folder: all + "1.7.2": folder: all diff --git a/recipes/highway/all/conandata.yml b/recipes/highway/all/conandata.yml index 710781f517c65..0d5218b55b50f 100644 --- a/recipes/highway/all/conandata.yml +++ b/recipes/highway/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.2.0": + url: "https://github.com/google/highway/archive/1.2.0.tar.gz" + sha256: "7e0be78b8318e8bdbf6fa545d2ecb4c90f947df03f7aadc42c1967f019e63343" + "1.1.0": + url: "https://github.com/google/highway/archive/1.1.0.tar.gz" + sha256: "354a8b4539b588e70b98ec70844273e3f2741302c4c377bcc4e81b3d1866f7c9" "1.0.7": url: "https://github.com/google/highway/archive/1.0.7.tar.gz" sha256: "5434488108186c170a5e2fca5e3c9b6ef59a1caa4d520b008a9b8be6b8abe6c5" @@ -29,3 +35,9 @@ sources: "0.12.2": url: "https://github.com/google/highway/archive/0.12.2.tar.gz" sha256: "e1d47ce510429fdcf31f41697ca74fb0dcd59d933196e531a86d51751a56f4cc" +patches: + "1.2.0": + - patch_file: "patches/1.2.0-0001-fix-dllexport.patch" + patch_description: "fix incorrect DLLEXPORT" + patch_type: "backport" + patch_source: "https://github.com/google/highway/pull/2229" diff --git a/recipes/highway/all/patches/1.2.0-0001-fix-dllexport.patch b/recipes/highway/all/patches/1.2.0-0001-fix-dllexport.patch new file mode 100644 index 0000000000000..30ecee4740bdb --- /dev/null +++ b/recipes/highway/all/patches/1.2.0-0001-fix-dllexport.patch @@ -0,0 +1,91 @@ +diff --git a/hwy/contrib/thread_pool/topology.cc b/hwy/contrib/thread_pool/topology.cc +index 3d24f4f..17f3563 100644 +--- a/hwy/contrib/thread_pool/topology.cc ++++ b/hwy/contrib/thread_pool/topology.cc +@@ -64,7 +64,7 @@ + + namespace hwy { + +-HWY_DLLEXPORT bool HaveThreadingSupport() { ++HWY_CONTRIB_DLLEXPORT bool HaveThreadingSupport() { + #if HWY_ARCH_WASM + return emscripten_has_threading_support() != 0; + #else +@@ -72,7 +72,7 @@ HWY_DLLEXPORT bool HaveThreadingSupport() { + #endif + } + +-HWY_DLLEXPORT size_t TotalLogicalProcessors() { ++HWY_CONTRIB_DLLEXPORT size_t TotalLogicalProcessors() { + size_t lp = 0; + #if HWY_ARCH_WASM + const int num_cores = emscripten_num_logical_cores(); +@@ -111,7 +111,7 @@ HWY_DLLEXPORT size_t TotalLogicalProcessors() { + #include + #endif + +-HWY_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps) { ++HWY_CONTRIB_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps) { + #if HWY_OS_WIN + // Only support the first 64 because WINE does not support processor groups. + const HANDLE hThread = GetCurrentThread(); +@@ -173,7 +173,7 @@ HWY_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps) { + #endif + } + +-HWY_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps) { ++HWY_CONTRIB_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps) { + #if HWY_OS_WIN + const HANDLE hThread = GetCurrentThread(); + const DWORD_PTR prev = SetThreadAffinityMask(hThread, lps.Get64()); +@@ -385,7 +385,7 @@ std::vector DetectPackages(std::vector& lps) { + } // namespace + #endif // HWY_OS_LINUX + +-HWY_DLLEXPORT Topology::Topology() { ++HWY_CONTRIB_DLLEXPORT Topology::Topology() { + #if HWY_OS_LINUX + lps.resize(TotalLogicalProcessors()); + const std::vector& per_package = DetectPackages(lps); +diff --git a/hwy/contrib/thread_pool/topology.h b/hwy/contrib/thread_pool/topology.h +index 95b0835..f80fc47 100644 +--- a/hwy/contrib/thread_pool/topology.h ++++ b/hwy/contrib/thread_pool/topology.h +@@ -28,7 +28,7 @@ + namespace hwy { + + // Returns false if std::thread should not be used. +-HWY_DLLEXPORT bool HaveThreadingSupport(); ++HWY_CONTRIB_DLLEXPORT bool HaveThreadingSupport(); + + // Upper bound on logical processors, including hyperthreads. + static constexpr size_t kMaxLogicalProcessors = 1024; // matches glibc +@@ -38,12 +38,12 @@ using LogicalProcessorSet = BitSet4096; + + // Returns false, or sets `lps` to all logical processors which are online and + // available to the current thread. +-HWY_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps); ++HWY_CONTRIB_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps); + + // Ensures the current thread can only run on the logical processors in `lps`. + // Returns false if not supported (in particular on Apple), or if the + // intersection between `lps` and `GetThreadAffinity` is the empty set. +-HWY_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps); ++HWY_CONTRIB_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps); + + // Returns false, or ensures the current thread will only run on `lp`, which + // must not exceed `TotalLogicalProcessors`. Note that this merely calls +@@ -58,11 +58,11 @@ static inline bool PinThreadToLogicalProcessor(size_t lp) { + // provided by the hardware clamped to `kMaxLogicalProcessors`. + // These processors are not necessarily all usable; you can determine which are + // via GetThreadAffinity(). +-HWY_DLLEXPORT size_t TotalLogicalProcessors(); ++HWY_CONTRIB_DLLEXPORT size_t TotalLogicalProcessors(); + + struct Topology { + // Caller must check packages.empty(); if so, do not use any fields. +- HWY_DLLEXPORT Topology(); ++ HWY_CONTRIB_DLLEXPORT Topology(); + + // Clique of cores with lower latency to each other. On Apple M1 these are + // four cores sharing an L2. On Zen4 these 'CCX' are up to eight cores sharing diff --git a/recipes/highway/all/test_package/CMakeLists.txt b/recipes/highway/all/test_package/CMakeLists.txt index 06e1e8678e6bd..5a50f54ad8995 100644 --- a/recipes/highway/all/test_package/CMakeLists.txt +++ b/recipes/highway/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(highway REQUIRED CONFIG) diff --git a/recipes/highway/all/test_v1_package/CMakeLists.txt b/recipes/highway/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/highway/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/highway/all/test_v1_package/conanfile.py b/recipes/highway/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/highway/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_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/highway/config.yml b/recipes/highway/config.yml index 51114d87501db..a5864ae8e0682 100644 --- a/recipes/highway/config.yml +++ b/recipes/highway/config.yml @@ -1,4 +1,8 @@ versions: + "1.2.0": + folder: all + "1.1.0": + folder: all "1.0.7": folder: all "1.0.6": diff --git a/recipes/hipony-enumerate/all/test_package/CMakeLists.txt b/recipes/hipony-enumerate/all/test_package/CMakeLists.txt index b8ca205c62256..f735ea553c88e 100644 --- a/recipes/hipony-enumerate/all/test_package/CMakeLists.txt +++ b/recipes/hipony-enumerate/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(hipony-enumerate REQUIRED CONFIG) diff --git a/recipes/hipony-enumerate/all/test_v1_package/CMakeLists.txt b/recipes/hipony-enumerate/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/hipony-enumerate/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/hipony-enumerate/all/test_v1_package/conanfile.py b/recipes/hipony-enumerate/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/hipony-enumerate/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_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/hippomocks/all/test_v1_package/CMakeLists.txt b/recipes/hippomocks/all/test_v1_package/CMakeLists.txt deleted file mode 100755 index 91630d79f4abb..0000000000000 --- a/recipes/hippomocks/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100755 index 121b7b9615044..0000000000000 --- a/recipes/hippomocks/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/0.x.x/conandata.yml b/recipes/hiredis/0.x.x/conandata.yml deleted file mode 100644 index 0b74d88eff05f..0000000000000 --- a/recipes/hiredis/0.x.x/conandata.yml +++ /dev/null @@ -1,8 +0,0 @@ -sources: - "0.14.1": - url: "https://github.com/redis/hiredis/archive/v0.14.1.tar.gz" - sha256: "2663b2aed9fd430507e30fc5e63274ee40cdd1a296026e22eafd7d99b01c8913" -patches: - "0.14.1": - - patch_file: "patches/0001-fix-makefile.patch" - base_path: "source_subfolder" diff --git a/recipes/hiredis/0.x.x/conanfile.py b/recipes/hiredis/0.x.x/conanfile.py deleted file mode 100644 index f94cea21a0db9..0000000000000 --- a/recipes/hiredis/0.x.x/conanfile.py +++ /dev/null @@ -1,78 +0,0 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -import os - -required_conan_version = ">=1.36.0" - - -class HiredisConan(ConanFile): - name = "hiredis" - description = "Hiredis is a minimalistic C client library for the Redis database." - license = "BSD-3-Clause" - topics = ("hiredis", "redis", "client", "database") - homepage = "https://github.com/redis/hiredis" - url = "https://github.com/conan-io/conan-center-index" - - 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): - 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 - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - - def validate(self): - if self.settings.os == "Windows": - raise ConanInvalidConfiguration("hiredis {} is not supported on Windows.".format(self.version)) - - 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) - # Do not force PIC if static - if not self.options.shared: - makefile = os.path.join(self._source_subfolder, "Makefile") - tools.replace_in_file(makefile, "-fPIC ", "") - - def build(self): - self._patch_sources() - with tools.chdir(self._source_subfolder): - autoTools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autoTools.make() - - def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - with tools.chdir(self._source_subfolder): - autoTools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autoTools.install(vars={ - "DESTDIR": tools.unix_path(self.package_folder), - "PREFIX": "", - }) - tools.remove_files_by_mask( - os.path.join(self.package_folder, "lib"), - "*.a" if self.options.shared else "*.[so|dylib]*", - ) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "hiredis") - self.cpp_info.libs = ["hiredis"] diff --git a/recipes/hiredis/0.x.x/patches/0001-fix-makefile.patch b/recipes/hiredis/0.x.x/patches/0001-fix-makefile.patch deleted file mode 100644 index 52271f0ac9947..0000000000000 --- a/recipes/hiredis/0.x.x/patches/0001-fix-makefile.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/Makefile_old -+++ b/Makefile -@@ -38,10 +38,8 @@ export REDIS_TEST_CONFIG - # Fallback to gcc when $CC is not in $PATH. - CC:=$(shell sh -c 'type $${CC%% *} >/dev/null 2>/dev/null && echo $(CC) || echo gcc') - CXX:=$(shell sh -c 'type $${CXX%% *} >/dev/null 2>/dev/null && echo $(CXX) || echo g++') --OPTIMIZATION?=-O3 - WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings --DEBUG_FLAGS?= -g -ggdb --REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS) -+REAL_CFLAGS=-fPIC $(CFLAGS) $(WARNINGS) - REAL_LDFLAGS=$(LDFLAGS) - - DYLIBSUFFIX=so -@@ -49,7 +47,7 @@ STLIBSUFFIX=a - DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_SONAME) - DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR) - DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) --DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS) -+DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(CFLAGS) $(LDFLAGS) - STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) - STLIB_MAKE_CMD=ar rcs $(STLIBNAME) - -@@ -57,15 +55,15 @@ STLIB_MAKE_CMD=ar rcs $(STLIBNAME) - uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') - ifeq ($(uname_S),SunOS) - REAL_LDFLAGS+= -ldl -lnsl -lsocket -- DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS) -+ DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(CFLAGS) $(LDFLAGS) - endif - ifeq ($(uname_S),Darwin) - DYLIBSUFFIX=dylib - DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDIS_SONAME).$(DYLIBSUFFIX) -- DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS) -+ DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(CFLAGS) $(LDFLAGS) - endif - --all: $(DYLIBNAME) $(STLIBNAME) hiredis-test $(PKGCONFNAME) -+all: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME) - - # Deps (use make dep to generate this) - alloc.o: alloc.c fmacros.h alloc.h diff --git a/recipes/hiredis/0.x.x/test_package/CMakeLists.txt b/recipes/hiredis/0.x.x/test_package/CMakeLists.txt deleted file mode 100644 index 7b9b613cbb24a..0000000000000 --- a/recipes/hiredis/0.x.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/hiredis/0.x.x/test_package/conanfile.py b/recipes/hiredis/0.x.x/test_package/conanfile.py deleted file mode 100644 index 5c09494bc67c0..0000000000000 --- a/recipes/hiredis/0.x.x/test_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" - - 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/hiredis/0.x.x/test_package/test_package.c b/recipes/hiredis/0.x.x/test_package/test_package.c deleted file mode 100644 index 6df475bd4539a..0000000000000 --- a/recipes/hiredis/0.x.x/test_package/test_package.c +++ /dev/null @@ -1,21 +0,0 @@ -#include - -#include -#include - -int main() -{ - printf("hiredis version: %i.%i.%i\n", HIREDIS_MAJOR, HIREDIS_MINOR, HIREDIS_PATCH); - - const char *hostname = "127.0.0.1"; - int port = 6379; - - redisContext *c = redisConnect(hostname, port); - if (c == NULL) - { - printf("Error: Can't allocate redis context\n"); - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -} diff --git a/recipes/hiredis/all/conanfile.py b/recipes/hiredis/all/conanfile.py index 4973e6b1da136..414f2b69e9a5c 100644 --- a/recipes/hiredis/all/conanfile.py +++ b/recipes/hiredis/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class HiredisConan(ConanFile): @@ -56,9 +56,11 @@ def generate(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 + if Version(self.version) <= "1.2.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.7" # CMake 4 support + tc.cache_variables["ENABLE_SSL"] = self.options.with_ssl + tc.cache_variables["DISABLE_TESTS"] = True + tc.cache_variables["ENABLE_EXAMPLES"] = False tc.generate() deps = CMakeDeps(self) deps.generate() @@ -92,8 +94,6 @@ def package_info(self): # hiredis self.cpp_info.components["hiredislib"].set_property("cmake_target_name", "hiredis::hiredis") self.cpp_info.components["hiredislib"].set_property("pkg_config_name", "hiredis") - self.cpp_info.components["hiredislib"].names["cmake_find_package"] = "hiredis" - self.cpp_info.components["hiredislib"].names["cmake_find_package_multi"] = "hiredis" self.cpp_info.components["hiredislib"].libs = [f"hiredis{suffix}"] if self.settings.os == "Windows": self.cpp_info.components["hiredislib"].system_libs = ["ws2_32"] @@ -101,8 +101,6 @@ def package_info(self): if self.options.with_ssl: self.cpp_info.components["hiredis_ssl"].set_property("cmake_target_name", "hiredis::hiredis_ssl") self.cpp_info.components["hiredis_ssl"].set_property("pkg_config_name", "hiredis_ssl") - self.cpp_info.components["hiredis_ssl"].names["cmake_find_package"] = "hiredis_ssl" - self.cpp_info.components["hiredis_ssl"].names["cmake_find_package_multi"] = "hiredis_ssl" self.cpp_info.components["hiredis_ssl"].libs = [f"hiredis_ssl{suffix}"] self.cpp_info.components["hiredis_ssl"].requires = ["openssl::ssl"] if self.settings.os == "Windows": diff --git a/recipes/hiredis/all/test_package/CMakeLists.txt b/recipes/hiredis/all/test_package/CMakeLists.txt index 49e1f3d74c74e..5b66ef3c27f35 100644 --- a/recipes/hiredis/all/test_package/CMakeLists.txt +++ b/recipes/hiredis/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(hiredis REQUIRED CONFIG) diff --git a/recipes/hiredis/all/test_v1_package/CMakeLists.txt b/recipes/hiredis/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index d1ea1807c4774..0000000000000 --- a/recipes/hiredis/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(hiredis REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE hiredis::hiredis) diff --git a/recipes/hiredis/all/test_v1_package/conanfile.py b/recipes/hiredis/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/hiredis/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_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/hiredis/config.yml b/recipes/hiredis/config.yml index 44921f335f1c8..977ca3a028023 100644 --- a/recipes/hiredis/config.yml +++ b/recipes/hiredis/config.yml @@ -7,5 +7,3 @@ versions: folder: all "1.0.0": folder: all - "0.14.1": - folder: "0.x.x" diff --git a/recipes/hlslpp/all/test_package/CMakeLists.txt b/recipes/hlslpp/all/test_package/CMakeLists.txt index c9f473983b37c..292b24f23879b 100644 --- a/recipes/hlslpp/all/test_package/CMakeLists.txt +++ b/recipes/hlslpp/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(hlslpp REQUIRED CONFIG) diff --git a/recipes/hlslpp/all/test_v1_package/CMakeLists.txt b/recipes/hlslpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/hlslpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/hlslpp/all/test_v1_package/conanfile.py b/recipes/hlslpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/hlslpp/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_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/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/test_package/CMakeLists.txt b/recipes/homog2d/all/test_package/CMakeLists.txt index 5abd7206722e3..cb168914356db 100644 --- a/recipes/homog2d/all/test_package/CMakeLists.txt +++ b/recipes/homog2d/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(homog2d REQUIRED CONFIG) diff --git a/recipes/homog2d/all/test_v1_package/CMakeLists.txt b/recipes/homog2d/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/homog2d/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/homog2d/all/test_v1_package/conanfile.py b/recipes/homog2d/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/homog2d/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/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/http_parser/all/CMakeLists.txt b/recipes/http_parser/all/CMakeLists.txt index d38794fd0cf94..89f89ca2c570c 100644 --- a/recipes/http_parser/all/CMakeLists.txt +++ b/recipes/http_parser/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(http_parser LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/http_parser/all/conanfile.py b/recipes/http_parser/all/conanfile.py index 0223cb4a807aa..8140ddb1a1199 100644 --- a/recipes/http_parser/all/conanfile.py +++ b/recipes/http_parser/all/conanfile.py @@ -1,6 +1,8 @@ from conan import ConanFile +from conan.errors import ConanException 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.53.0" @@ -46,6 +48,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["HTTP_PARSER_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.9.4": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): diff --git a/recipes/http_parser/all/test_package/CMakeLists.txt b/recipes/http_parser/all/test_package/CMakeLists.txt index 901fc9ff7c382..725856db21343 100644 --- a/recipes/http_parser/all/test_package/CMakeLists.txt +++ b/recipes/http_parser/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(http_parser REQUIRED CONFIG) diff --git a/recipes/http_parser/all/test_v1_package/CMakeLists.txt b/recipes/http_parser/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b0c36fbcd127a..0000000000000 --- a/recipes/http_parser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(http_parser REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE http_parser::http_parser) diff --git a/recipes/http_parser/all/test_v1_package/conanfile.py b/recipes/http_parser/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/http_parser/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_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/huffman/all/conandata.yml b/recipes/huffman/all/conandata.yml index 25d1ea6cda398..cb51aa08c2967 100644 --- a/recipes/huffman/all/conandata.yml +++ b/recipes/huffman/all/conandata.yml @@ -3,13 +3,3 @@ sources: # Don't use tar.gz because test data files in tar.gz has invalid paths on Windows. url: "https://github.com/drichardson/huffman/archive/refs/tags/v1.2.7.zip" sha256: "0d382f271daf47623676307710cb05d246839247370989b8ffa6fee82bea375a" - "1.2.2": - url: "https://github.com/drichardson/huffman/archive/refs/tags/v1.2.2.zip" - sha256: "7968728c4a0e2705575e9f03e0252cb5195919756d3a64343255f518548cb533" -patches: - "1.2.7": - - patch_file: "patches/1.2.7-0001-use-_WIN32.patch" - base_path: "source_subfolder" - "1.2.2": - - patch_file: "patches/1.2.2-0001-use-_WIN32.patch" - base_path: "source_subfolder" diff --git a/recipes/huffman/all/conanfile.py b/recipes/huffman/all/conanfile.py index 6cbfd60d77f27..236e549a5af09 100644 --- a/recipes/huffman/all/conanfile.py +++ b/recipes/huffman/all/conanfile.py @@ -1,7 +1,11 @@ -from conans import ConanFile, CMake, tools -import functools +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, replace_in_file + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.33.0" class HuffmanConan(ConanFile): name = "huffman" @@ -9,61 +13,60 @@ class HuffmanConan(ConanFile): license = "Unlicense" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/drichardson/huffman" - topics = ["huffman", "encoder", "decoder", "compression"] - settings = "os", "arch", "compiler","build_type" + topics = ("encoder", "decoder", "compression") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], } default_options = { - 'shared': False, - 'fPIC': True, + "shared": False, + "fPIC": True, } - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - @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": del self.options.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 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) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "huffman.c"), + "#ifdef WIN32", + "#if defined _WIN32 || defined __CYGWIN__") 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.append("huffman") + self.cpp_info.libs = ["huffman"] if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/huffman/all/patches/1.2.2-0001-use-_WIN32.patch b/recipes/huffman/all/patches/1.2.2-0001-use-_WIN32.patch deleted file mode 100644 index f04952ff087f5..0000000000000 --- a/recipes/huffman/all/patches/1.2.2-0001-use-_WIN32.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/a/huffman.c b/b/huffman.c -index 81959cb..ecea371 100644 ---- a/a/huffman.c -+++ b/b/huffman.c -@@ -11,7 +11,7 @@ - #include - #include - --#ifdef WIN32 -+#if defined _WIN32 || defined __CYGWIN__ - #include - #include - #else diff --git a/recipes/huffman/all/patches/1.2.7-0001-use-_WIN32.patch b/recipes/huffman/all/patches/1.2.7-0001-use-_WIN32.patch deleted file mode 100644 index 9c1fe246e8193..0000000000000 --- a/recipes/huffman/all/patches/1.2.7-0001-use-_WIN32.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/a/huffman.c b/b/huffman.c -index 7cae8c1..34f3101 100644 ---- a/a/huffman.c -+++ b/b/huffman.c -@@ -6,7 +6,7 @@ - #include - #include - --#ifdef WIN32 -+#if defined _WIN32 || defined __CYGWIN__ - #include - #include - #else diff --git a/recipes/huffman/all/test_package/CMakeLists.txt b/recipes/huffman/all/test_package/CMakeLists.txt index cca65fc1e8c24..8c882942df773 100644 --- a/recipes/huffman/all/test_package/CMakeLists.txt +++ b/recipes/huffman/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(huffman REQUIRED CONFIG) diff --git a/recipes/huffman/all/test_package/conanfile.py b/recipes/huffman/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/huffman/all/test_package/conanfile.py +++ b/recipes/huffman/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/huffman/config.yml b/recipes/huffman/config.yml index 1bf1c0d4bfeb0..6772821daadb7 100644 --- a/recipes/huffman/config.yml +++ b/recipes/huffman/config.yml @@ -1,5 +1,3 @@ versions: "1.2.7": folder: all - "1.2.2": - folder: all diff --git a/recipes/hunspell/all/test_v1_package/CMakeLists.txt b/recipes/hunspell/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 5d38c542b67a4..0000000000000 --- a/recipes/hunspell/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index a500b98343c74..0000000000000 --- a/recipes/hunspell/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/hwdata/all/conandata.yml b/recipes/hwdata/all/conandata.yml index 8654aa367ec46..4dd2a08c35c6b 100644 --- a/recipes/hwdata/all/conandata.yml +++ b/recipes/hwdata/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.385": + url: "https://github.com/vcrhonek/hwdata/archive/v0.385.tar.gz" + sha256: "577219d44d9686e8177f6291adbff7bacdd785ad4e8a8d0c4b2a14dbf850d6ac" + "0.382": + url: "https://github.com/vcrhonek/hwdata/archive/v0.382.tar.gz" + sha256: "5e25457b562a5227eb77eac21d5e4344bd1183c7d62b41e7d3e780ae33e053c1" + "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" diff --git a/recipes/hwdata/config.yml b/recipes/hwdata/config.yml index daf8b29da7dde..329f229df7ce9 100644 --- a/recipes/hwdata/config.yml +++ b/recipes/hwdata/config.yml @@ -1,4 +1,10 @@ versions: + "0.385": + folder: all + "0.382": + folder: all + "0.378": + folder: all "0.376": folder: all "0.374": diff --git a/recipes/hwloc/all/conandata.yml b/recipes/hwloc/all/conandata.yml index c3a77f045e4ad..98b2b2bec0fbe 100644 --- a/recipes/hwloc/all/conandata.yml +++ b/recipes/hwloc/all/conandata.yml @@ -1,19 +1,10 @@ sources: + "2.11.1": + url: "https://download.open-mpi.org/release/hwloc/v2.11/hwloc-2.11.1.tar.bz2" + sha256: "04cdfbffad225ce15f66184f0f4141327dabf288d10a8b84d13f517acb7870c6" + "2.10.0": + url: "https://download.open-mpi.org/release/hwloc/v2.10/hwloc-2.10.0.tar.bz2" + sha256: "0305dd60c9de2fbe6519fe2a4e8fdc6d3db8de574a0ca7812b92e80c05ae1392" "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 + url: "https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.3.tar.bz2" + sha256: "5c4062ce556f6d3451fc177ffb8673a2120f81df6835dea6a21a90fbdfff0dec" diff --git a/recipes/hwloc/all/conanfile.py b/recipes/hwloc/all/conanfile.py index b3766fb59545e..ff20e76545dae 100644 --- a/recipes/hwloc/all/conanfile.py +++ b/recipes/hwloc/all/conanfile.py @@ -32,7 +32,7 @@ def configure(self): def requirements(self): if self.options.with_libxml2: - self.requires("libxml2/2.11.4") + self.requires("libxml2/[>=2.12.5 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/hwloc/config.yml b/recipes/hwloc/config.yml index d1ef77599f89a..c94edb0b5eb63 100644 --- a/recipes/hwloc/config.yml +++ b/recipes/hwloc/config.yml @@ -1,13 +1,7 @@ versions: - "2.9.3": - folder: all - "2.9.2": - folder: all - "2.9.1": + "2.11.1": folder: all - "2.9.0": + "2.10.0": folder: all - "2.8.0": - folder: all - "2.7.2": + "2.9.3": folder: all diff --git a/recipes/hyperscan/all/test_package/CMakeLists.txt b/recipes/hyperscan/all/test_package/CMakeLists.txt index 8cfec33c7dfff..9ed3dbfbe23aa 100644 --- a/recipes/hyperscan/all/test_package/CMakeLists.txt +++ b/recipes/hyperscan/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(hyperscan COMPONENTS hs REQUIRED) diff --git a/recipes/hyperscan/all/test_v1_package/CMakeLists.txt b/recipes/hyperscan/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/hyperscan/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/hyperscan/all/test_v1_package/conanfile.py b/recipes/hyperscan/all/test_v1_package/conanfile.py deleted file mode 100644 index cb26b3fe15590..0000000000000 --- a/recipes/hyperscan/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,23 +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.definitions["BUILD_CHIMERA"] = self.options["hyperscan"].build_chimera - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "hs_example") - self.run(bin_path, run_environment=True) - - if self.options["hyperscan"].build_chimera: - bin_path = os.path.join("bin", "ch_example") - self.run(bin_path, run_environment=True) diff --git a/recipes/i2c-tools/all/test_v1_package/CMakeLists.txt b/recipes/i2c-tools/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/i2c-tools/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 2780f5433abb4..0000000000000 --- a/recipes/i2c-tools/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,15 +0,0 @@ -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/conandata.yml b/recipes/icecream-cpp/all/conandata.yml index 6c686db1b4509..ad1aad58d3cb3 100644 --- a/recipes/icecream-cpp/all/conandata.yml +++ b/recipes/icecream-cpp/all/conandata.yml @@ -2,3 +2,6 @@ sources: '0.3.1': url: 'https://github.com/renatoGarcia/icecream-cpp/archive/v0.3.1.tar.gz' sha256: '51bebb040c9c7e44f443d6356256ae4d93300d2e1f01824fd219c97d168a438f' + '1.0.0': + url: 'https://github.com/renatoGarcia/icecream-cpp/archive/refs/tags/v1.0.0.tar.gz' + sha256: '35fdbd012a4f7990c404c59b8291e04dc6103232323371ea7a2b18613b1b7900' diff --git a/recipes/icecream-cpp/config.yml b/recipes/icecream-cpp/config.yml index b9005978dcd6c..1ead546ed80dd 100644 --- a/recipes/icecream-cpp/config.yml +++ b/recipes/icecream-cpp/config.yml @@ -1,3 +1,5 @@ versions: "0.3.1": folder: all + "1.0.0": + folder: all diff --git a/recipes/iceoryx/all/conandata.yml b/recipes/iceoryx/all/conandata.yml index 15956d577d86b..22e1451348b38 100644 --- a/recipes/iceoryx/all/conandata.yml +++ b/recipes/iceoryx/all/conandata.yml @@ -1,10 +1,13 @@ sources: + "2.0.6": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.6.tar.gz" + sha256: "a2add8ffee0c3357ef985cc46c7de79ccb754ea2bed02c61f2ff805ab2c869f1" + "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" - "2.0.2": - url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.2.tar.gz" - sha256: "99871BCAA8DA4361D1BAAE9CF1507683058DE8572AC3080EDC41E590FFBA06C0" "1.0.3": url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v1.0.3.tar.gz" sha256: "566b7766fb1fabb48d1ca979f7a31082422d6aa5af014a56c1a6b605c60e33f0" diff --git a/recipes/iceoryx/all/conanfile.py b/recipes/iceoryx/all/conanfile.py index abf2fb7016360..3144cdb2e4a59 100644 --- a/recipes/iceoryx/all/conanfile.py +++ b/recipes/iceoryx/all/conanfile.py @@ -5,7 +5,7 @@ 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.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rmdir, save, rm from conan.tools.microsoft import is_msvc, check_min_vs from conan.tools.scm import Version @@ -107,11 +107,32 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - for cmake_file in self.source_path.rglob("CMakeLists.txt"): - # Honor fPIC option - replace_in_file(self, cmake_file, "POSITION_INDEPENDENT_CODE ON", "", strict=False) - # Use acl::acl target, since acl fails to link - replace_in_file(self, cmake_file, " acl", " acl::acl", strict=False) + 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 + 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() @@ -125,6 +146,7 @@ def package(self): 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")) + rm(self, ".clang-tidy", os.path.join(self.package_folder, "include"), recursive=True) if self.options.toml_config: mkdir(self, os.path.join(self.package_folder, "res")) rename(self, os.path.join(self.package_folder, "etc", "roudi_config_example.toml"), diff --git a/recipes/iceoryx/all/test_v1_package/CMakeLists.txt b/recipes/iceoryx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/iceoryx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 50e21d11f1ebd..0000000000000 --- a/recipes/iceoryx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +0,0 @@ -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 741dce8e70313..4a60749deb79c 100644 --- a/recipes/iceoryx/config.yml +++ b/recipes/iceoryx/config.yml @@ -1,7 +1,9 @@ versions: - "2.0.3": + "2.0.6": + folder: all + "2.0.5": folder: all - "2.0.2": + "2.0.3": folder: all "1.0.3": folder: all diff --git a/recipes/iconfontcppheaders/all/conandata.yml b/recipes/iconfontcppheaders/all/conandata.yml index 9cba4ae5061fd..81e9b251ba0f8 100644 --- a/recipes/iconfontcppheaders/all/conandata.yml +++ b/recipes/iconfontcppheaders/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "cci.20240620": + sha256: 363613c9ea6b4d4b290527bc1fcd626b09accd985a40f14442e86d1df16ec487 + url: https://github.com/juliettef/IconFontCppHeaders/archive/62d27fa93d8f1f881dac18f13881dd97af66fa74/main.zip + "cci.20240128": + sha256: de946a4471dca969426b2e7863d79136a91f2e4e4cc7a766df31bbb8412571f9 + url: https://github.com/juliettef/IconFontCppHeaders/archive/8886c5657bac22b8fee34354871e3ade2a596433/main.zip "cci.20231102": sha256: 7618e844dcbfea2404c209e8b52158a37c2368a79cc77e94087375a8186442c4 url: https://github.com/juliettef/IconFontCppHeaders/archive/41b304750e83c0a89375cc1834f65c1204308b4a/main.zip diff --git a/recipes/iconfontcppheaders/all/conanfile.py b/recipes/iconfontcppheaders/all/conanfile.py index 5541ed9fd754d..278c4d54b8232 100644 --- a/recipes/iconfontcppheaders/all/conanfile.py +++ b/recipes/iconfontcppheaders/all/conanfile.py @@ -9,7 +9,7 @@ class FireHppConan(ConanFile): name = "iconfontcppheaders" - description = "Headers for icon fonts Font Awesome, Fork Awesome, Google Material Design, Pictogrammers Material Design icons, Kenney game icons, Fontaudio, Codicons and Lucide." + description = "Headers for icon fonts Font Awesome, Fork Awesome, Google Material Design Icons, Google Material Design Symbols, Pictogrammers Material Design icons, Kenney game icons, Fontaudio, Codicons and Lucide." license = "Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/juliettef/IconFontCppHeaders" diff --git a/recipes/iconfontcppheaders/config.yml b/recipes/iconfontcppheaders/config.yml index 4c1b72279193a..163b17b48651e 100644 --- a/recipes/iconfontcppheaders/config.yml +++ b/recipes/iconfontcppheaders/config.yml @@ -1,4 +1,8 @@ versions: + "cci.20240620": + folder: all + "cci.20240128": + folder: all "cci.20231102": folder: all "cci.20231026": diff --git a/recipes/icu/all/conandata.yml b/recipes/icu/all/conandata.yml index 3f814d74e3bae..cdfc3aebefeb6 100644 --- a/recipes/icu/all/conandata.yml +++ b/recipes/icu/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "77.1": + url: "https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz" + sha256: "588e431f77327c39031ffbb8843c0e3bc122c211374485fa87dc5f3faff24061" + "76.1": + url: "https://github.com/unicode-org/icu/releases/download/release-76-1/icu4c-76_1-src.tgz" + sha256: "dfacb46bfe4747410472ce3e1144bf28a102feeaa4e3875bac9b4c6cf30f4f3e" + "75.1": + url: "https://github.com/unicode-org/icu/releases/download/release-75-1/icu4c-75_1-src.tgz" + sha256: "cb968df3e4d2e87e8b11c49a5d01c787bd13b9545280fc6642f826527618caef" + "74.2": + url: "https://github.com/unicode-org/icu/releases/download/release-74-2/icu4c-74_2-src.tgz" + sha256: "68db082212a96d6f53e35d60f47d38b962e9f9d207a74cfac78029ae8ff5e08c" "74.1": url: "https://github.com/unicode-org/icu/releases/download/release-74-1/icu4c-74_1-src.tgz" sha256: "86ce8e60681972e60e4dcb2490c697463fcec60dd400a5f9bffba26d0b52b8d0" @@ -8,40 +20,36 @@ sources: "73.1": url: "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz" sha256: "a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45" - "72.1": - url: "https://github.com/unicode-org/icu/releases/download/release-72-1/icu4c-72_1-src.tgz" - sha256: "a2d2d38217092a7ed56635e34467f92f976b370e20182ad325edea6681a71d68" - "71.1": - url: "https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-src.tgz" - sha256: "67a7e6e51f61faf1306b6935333e13b2c48abd8da6d2f46ce6adca24b1e21ebf" - "70.1": - url: "https://github.com/unicode-org/icu/releases/download/release-70-1/icu4c-70_1-src.tgz" - sha256: "8d205428c17bf13bb535300669ed28b338a157b1c01ae66d31d0d3e2d47c3fd5" - "69.1": - url: "https://github.com/unicode-org/icu/releases/download/release-69-1/icu4c-69_1-src.tgz" - sha256: "4cba7b7acd1d3c42c44bb0c14be6637098c7faf2b330ce876bc5f3b915d09745" - "68.2": - url: "https://github.com/unicode-org/icu/releases/download/release-68-2/icu4c-68_2-src.tgz" - sha256: "c79193dee3907a2199b8296a93b52c5cb74332c26f3d167269487680d479d625" patches: - "74.1": - - patch_file: "patches/0001-69.1-fix-mingw.patch" - "73.2": - - patch_file: "patches/0001-69.1-fix-mingw.patch" - "73.1": - - patch_file: "patches/0001-69.1-fix-mingw.patch" - "72.1": + "77.1": + - patch_file: "patches/0001-76.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + "76.1": + - patch_file: "patches/0001-76.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + "75.1": - patch_file: "patches/0001-69.1-fix-mingw.patch" - "71.1": + patch_description: "support mingw" + patch_type: "portability" + "74.2": - patch_file: "patches/0001-69.1-fix-mingw.patch" - - patch_file: "patches/0001-71.1-fix-undef-strict-ansi.patch" - - patch_file: "patches/0001-71.1-fix-emscripten.patch" + patch_description: "support mingw" + patch_type: "portability" + - patch_file: "patches/0002-74.2-fix-emscripten.patch" patch_description: "Add config file for wasm-emscripten platform" patch_type: "portability" patch_source: "https://gerrit.libreoffice.org/c/core/+/111130/9/external/icu/icu4c-emscripten-cross.patch.1" - "70.1": + "74.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + "73.2": - patch_file: "patches/0001-69.1-fix-mingw.patch" - "69.1": + patch_description: "support mingw" + patch_type: "portability" + "73.1": - patch_file: "patches/0001-69.1-fix-mingw.patch" - "68.2": - - patch_file: "patches/0001-67.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" diff --git a/recipes/icu/all/conanfile.py b/recipes/icu/all/conanfile.py index 9e343976b416b..75b503c2c0e07 100644 --- a/recipes/icu/all/conanfile.py +++ b/recipes/icu/all/conanfile.py @@ -6,7 +6,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os -from conan.tools.build import cross_building, stdcpp_library +from conan.tools.build import cross_building, stdcpp_library, check_min_cppstd from conan.tools.env import Environment, VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save from conan.tools.gnu import Autotools, AutotoolsToolchain @@ -46,6 +46,20 @@ class ICUConan(ConanFile): "with_extras": 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", + } + @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -69,11 +83,21 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if Version(self.version) >= "74.1": + self.license = "Unicode-3.0" def validate(self): if self.options.dat_package_file: if not os.path.exists(str(self.options.dat_package_file)): raise ConanInvalidConfiguration("Non-existent dat_package_file specified") + if Version(self.version) >= "75.1": + 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 layout(self): basic_layout(self, src_folder="src") @@ -110,6 +134,8 @@ def generate(self): if check_min_vs(self, "180", raise_invalid=False): tc.extra_cflags.append("-FS") tc.extra_cxxflags.append("-FS") + if Version(self.version) >= "75.1" and not self.settings.compiler.cppstd and is_msvc(self): + tc.extra_cxxflags.append(f"-std:c++{self._min_cppstd}") if not self.options.shared: tc.extra_defines.append("U_STATIC_IMPLEMENTATION") if is_apple_os(self): diff --git a/recipes/icu/all/patches/0001-67.1-fix-mingw.patch b/recipes/icu/all/patches/0001-67.1-fix-mingw.patch deleted file mode 100644 index 93f5bd7f9ab8a..0000000000000 --- a/recipes/icu/all/patches/0001-67.1-fix-mingw.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- source/config/mh-mingw64 -+++ source/config/mh-mingw64 -@@ -94,7 +94,7 @@ - # This is also for backwards compatibility. - DATA_STUBNAME = dt - I18N_STUBNAME = in --LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) -+#LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) - - #SH### copied from Makefile.inc - #SH## for icu-config to test with -@@ -102,10 +102,10 @@ - #SH#ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}" - - #SH#ICULIBS_DATA="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" --ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" --ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" --ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" --ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" -+#ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" -+#ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" -+#ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" -+#ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)" - #SH# - #SH## ICULIBS is the set of libraries your application should link - #SH## with usually. Many applications will want to add ${ICULIBS_I18N} as well. ---- source/data/Makefile.in -+++ source/data/Makefile.in -@@ -207,7 +207,7 @@ - ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) - # For MinGW, do we want the DLL to go in the bin location? - ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) -- $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) -+ $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) - else - $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) - endif diff --git a/recipes/icu/all/patches/0001-71.1-fix-emscripten.patch b/recipes/icu/all/patches/0001-71.1-fix-emscripten.patch deleted file mode 100644 index 5693ab70111d5..0000000000000 --- a/recipes/icu/all/patches/0001-71.1-fix-emscripten.patch +++ /dev/null @@ -1,117 +0,0 @@ -diff --git a/source/acinclude.m4 b/source/acinclude.m4 -index 507f41f..2980ef1 100644 ---- a/source/acinclude.m4 -+++ b/source/acinclude.m4 -@@ -84,6 +84,7 @@ x86_64-*-cygwin) - *-dec-osf*) icu_cv_host_frag=mh-alpha-osf ;; - *-*-nto*) icu_cv_host_frag=mh-qnx ;; - *-ncr-*) icu_cv_host_frag=mh-mpras ;; -+wasm*-*-emscripten*) icu_cv_host_frag=mh-emscripten ;; - *) icu_cv_host_frag=mh-unknown ;; - esac - ] -diff --git a/source/config/mh-emscripten b/source/config/mh-emscripten -new file mode 100644 -index 0000000..ee2b90b ---- /dev/null -+++ b/source/config/mh-emscripten -@@ -0,0 +1,86 @@ -+## Emscripten-specific setup -+## Copyright (c) 1999-2013, International Business Machines Corporation and -+## others. All Rights Reserved. -+## Commands to generate dependency files -+GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) -+GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -+ -+## Flags for position independent code -+SHAREDLIBCFLAGS = -fPIC -+SHAREDLIBCXXFLAGS = -fPIC -+SHAREDLIBCPPFLAGS = -DPIC -+ -+## Additional flags when building libraries and with threads -+THREADSCPPFLAGS = -D_REENTRANT -+LIBCPPFLAGS = -+ -+## Compiler switch to embed a runtime search path -+LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN -+LD_RPATH_PRE = -Wl,-rpath, -+ -+## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH: -+ENABLE_RPATH=YES -+RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN' -+ -+## These are the library specific LDFLAGS -+#LDFLAGSICUDT=-nodefaultlibs -nostdlib -+# Debian change: linking icudata as data only causes too many problems. -+LDFLAGSICUDT= -+ -+## Compiler switch to embed a library name -+# The initial tab in the next line is to prevent icu-config from reading it. -+ LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) -+#SH# # We can't depend on MIDDLE_SO_TARGET being set. -+#SH# LD_SONAME= -+ -+## Shared library options -+LD_SOOPTIONS= -Wl,-Bsymbolic-functions -+ -+## Shared object suffix -+SO = so -+## Non-shared intermediate object suffix -+STATIC_O = o -+ -+## Compilation rules -+# WASM needs -pthread for atomics support -+%.$(STATIC_O): $(srcdir)/%.c -+ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -pthread -o $@ $<) -+ -+%.$(STATIC_O): $(srcdir)/%.cpp -+ $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -pthread -o $@ $<) -+ -+ -+## Dependency rules -+%.d: $(srcdir)/%.c -+ $(call ICU_MSG,(deps)) $< -+ @$(SHELL) -ec '$(GEN_DEPS.c) $< \ -+ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ -+ [ -s $@ ] || rm -f $@' -+ -+%.d: $(srcdir)/%.cpp -+ $(call ICU_MSG,(deps)) $< -+ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ -+ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ -+ [ -s $@ ] || rm -f $@' -+ -+## Versioned libraries rules -+ -+%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) -+ $(RM) $@ && ln -s ${ header unless __STRICT_ANSI__ is defined. --// __GNUC__ is set by both gcc and clang. --#undef __STRICT_ANSI__ --#endif -- - #include "locmap.h" - #include "unicode/ustdio.h" - diff --git a/recipes/icu/all/patches/0001-76.1-fix-mingw.patch b/recipes/icu/all/patches/0001-76.1-fix-mingw.patch new file mode 100644 index 0000000000000..f7169b0989fbc --- /dev/null +++ b/recipes/icu/all/patches/0001-76.1-fix-mingw.patch @@ -0,0 +1,47 @@ +diff --git a/source/config/mh-mingw64 b/source/config/mh-mingw64 +index fb64c56..ff8922c 100644 +--- a/source/config/mh-mingw64 ++++ b/source/config/mh-mingw64 +@@ -94,7 +94,7 @@ LIBPREFIX= + # This is also for backwards compatibility. + DATA_STUBNAME = dt + I18N_STUBNAME = in +-LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) ++#LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + + #SH### copied from Makefile.inc + #SH## for icu-config to test with +@@ -102,13 +102,13 @@ LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + #SH#ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}" + + #SH#ICULIBS_DATA="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" ++#ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" + #SH# + #SH## ICULIBS is the set of libraries your application should link + #SH## with usually. Many applications will want to add ${ICULIBS_I18N} as well. +diff --git a/source/data/Makefile.in b/source/data/Makefile.in +index 266ad7a..8e3be4f 100644 +--- a/source/data/Makefile.in ++++ b/source/data/Makefile.in +@@ -193,7 +193,7 @@ endif + ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) + # For MinGW, do we want the DLL to go in the bin location? + ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) +- $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) ++ $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + else + $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + endif diff --git a/recipes/icu/all/patches/0002-74.2-fix-emscripten.patch b/recipes/icu/all/patches/0002-74.2-fix-emscripten.patch new file mode 100644 index 0000000000000..9c7748fc3e0f1 --- /dev/null +++ b/recipes/icu/all/patches/0002-74.2-fix-emscripten.patch @@ -0,0 +1,109 @@ +--- a/source/acinclude.m4 ++++ b/source/acinclude.m4 +@@ -85,6 +85,7 @@ powerpc*-apple-darwin*) icu_cv_host_frag=mh-darwin-ppc ;; + *-dec-osf*) icu_cv_host_frag=mh-alpha-osf ;; + *-*-nto*) icu_cv_host_frag=mh-qnx ;; + *-ncr-*) icu_cv_host_frag=mh-mpras ;; ++wasm*-*-emscripten*) icu_cv_host_frag=mh-emscripten ;; + *) icu_cv_host_frag=mh-unknown ;; + esac + ] +--- /dev/null ++++ b/source/config/mh-emscripten +@@ -0,0 +1,86 @@ ++## Emscripten-specific setup ++## Copyright (c) 1999-2013, International Business Machines Corporation and ++## others. All Rights Reserved. ++## Commands to generate dependency files ++GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) ++GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) ++ ++## Flags for position independent code ++SHAREDLIBCFLAGS = -fPIC ++SHAREDLIBCXXFLAGS = -fPIC ++SHAREDLIBCPPFLAGS = -DPIC ++ ++## Additional flags when building libraries and with threads ++THREADSCPPFLAGS = -D_REENTRANT ++LIBCPPFLAGS = ++ ++## Compiler switch to embed a runtime search path ++LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN ++LD_RPATH_PRE = -Wl,-rpath, ++ ++## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH: ++ENABLE_RPATH=YES ++RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN' ++ ++## These are the library specific LDFLAGS ++#LDFLAGSICUDT=-nodefaultlibs -nostdlib ++# Debian change: linking icudata as data only causes too many problems. ++LDFLAGSICUDT= ++ ++## Compiler switch to embed a library name ++# The initial tab in the next line is to prevent icu-config from reading it. ++ LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) ++#SH# # We can't depend on MIDDLE_SO_TARGET being set. ++#SH# LD_SONAME= ++ ++## Shared library options ++LD_SOOPTIONS= -Wl,-Bsymbolic-functions ++ ++## Shared object suffix ++SO = so ++## Non-shared intermediate object suffix ++STATIC_O = o ++ ++## Compilation rules ++# WASM needs -pthread for atomics support ++%.$(STATIC_O): $(srcdir)/%.c ++ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -pthread -o $@ $<) ++ ++%.$(STATIC_O): $(srcdir)/%.cpp ++ $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -pthread -o $@ $<) ++ ++ ++## Dependency rules ++%.d: $(srcdir)/%.c ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.c) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++%.d: $(srcdir)/%.cpp ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++## Versioned libraries rules ++ ++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) ++ $(RM) $@ && ln -s ${=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["ADA_IDNA_BENCHMARKS"] = 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() + + def package_info(self): + self.cpp_info.libs = ["ada-idna"] + self.cpp_info.set_property("cmake_file_name", "ada-idna") + self.cpp_info.set_property("cmake_target_name", "ada-idna") diff --git a/recipes/idna/all/test_package/CMakeLists.txt b/recipes/idna/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..889584ca451e0 --- /dev/null +++ b/recipes/idna/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ada-idna REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ada-idna) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/idna/all/test_package/conanfile.py b/recipes/idna/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/idna/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/idna/all/test_package/test_package.cpp b/recipes/idna/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cbb7f6eeb2dec --- /dev/null +++ b/recipes/idna/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include + +#include "idna.h" + +int main(void) { + std::string_view input = reinterpret_cast(u8"meßagefactory.ca"); // non-empty UTF-8 string, must be percent decoded + std::string idna_ascii = ada::idna::to_ascii(input); + if(idna_ascii.empty()) { + // There was an error. + } + std::cout << idna_ascii << std::endl; + // outputs 'xn--meagefactory-m9a.ca' if the input is u8"meßagefactory.ca" +} diff --git a/recipes/idna/config.yml b/recipes/idna/config.yml new file mode 100644 index 0000000000000..34cca17a5b748 --- /dev/null +++ b/recipes/idna/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240228": + folder: all diff --git a/recipes/ignition-cmake/all/conandata.yml b/recipes/ignition-cmake/all/conandata.yml index ccb98d28636f3..7fffddb3eb19f 100644 --- a/recipes/ignition-cmake/all/conandata.yml +++ b/recipes/ignition-cmake/all/conandata.yml @@ -1,13 +1,23 @@ sources: - "2.5.0": - url: "https://github.com/gazebosim/gz-cmake/archive/ignition-cmake2_2.5.0.zip" - sha256: "30945958fbe598f654d30de926a798f9055b1c635f7d85441ecba1ebe0804d2d" + "2.17.1": + url: "https://github.com/gazebosim/gz-cmake/archive/refs/tags/ignition-cmake2_2.17.1.tar.gz" + sha256: "f8dbadac71540324e0c506b607cefa99e99a8aca997f7af8e67cb486eb610cc0" "2.10.0": url: "https://github.com/gazebosim/gz-cmake/archive/refs/tags/ignition-cmake2_2.10.0.tar.gz" sha256: "48a01131731b09c32cfc7d577c4db378fb02e49a071e24c9299624766e1d05a2" - -patches: "2.5.0": - - patch_file: "patches/0001-cmake-fixes.patch" + url: "https://github.com/gazebosim/gz-cmake/archive/refs/tags/ignition-cmake2_2.5.0.tar.gz" + sha256: "d19d0005f0a8dcf79851376a8beff13a0d41b441dd00b3504d218e912dba9d1e" +patches: + "2.17.1": + - patch_file: "patches/2.17.1-0001-fix-cmake.patch" + patch_description: "fix cmake folders" + patch_type: "conan" "2.10.0": - - patch_file: "patches/0002-ignition-cmake-2.10.0-fixes.patch" + - patch_file: "patches/2.10.0-0001-fix-cmake.patch" + patch_description: "fix cmake folders" + patch_type: "conan" + "2.5.0": + - patch_file: "patches/2.5.0-0001-fix-cmake.patch" + patch_description: "fix cmake folders" + patch_type: "conan" diff --git a/recipes/ignition-cmake/all/patches/0002-ignition-cmake-2.10.0-fixes.patch b/recipes/ignition-cmake/all/patches/2.10.0-0001-fix-cmake.patch similarity index 100% rename from recipes/ignition-cmake/all/patches/0002-ignition-cmake-2.10.0-fixes.patch rename to recipes/ignition-cmake/all/patches/2.10.0-0001-fix-cmake.patch diff --git a/recipes/ignition-cmake/all/patches/2.17.1-0001-fix-cmake.patch b/recipes/ignition-cmake/all/patches/2.17.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..efd3c2a4c4a5f --- /dev/null +++ b/recipes/ignition-cmake/all/patches/2.17.1-0001-fix-cmake.patch @@ -0,0 +1,58 @@ +diff --git a/cmake/IgnCMake.cmake b/cmake/IgnCMake.cmake +index b4aa7e3..17ece86 100644 +--- a/cmake/IgnCMake.cmake ++++ b/cmake/IgnCMake.cmake +@@ -37,3 +37,10 @@ include(IgnSanitizers) + #============================================================================ + include(CMakePackageConfigHelpers) + include(CMakeParseArguments) ++ ++set(IGNITION_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}") ++set(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../..") ++set(IGNITION_CMAKE_DOXYGEN_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/doxygen") ++set(IGNITION_CMAKE_CODECHECK_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/codecheck") ++set(IGNITION_CMAKE_BENCHMARK_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/benchmark") ++set(IGNITION_CMAKE_TOOLS_DIR "${PACKAGE_PREFIX_DIR}/lib/ignition/ignition-cmake2/tools") +diff --git a/cmake/IgnSetCompilerFlags.cmake b/cmake/IgnSetCompilerFlags.cmake +index 0a6b5b5..03df75b 100644 +--- a/cmake/IgnSetCompilerFlags.cmake ++++ b/cmake/IgnSetCompilerFlags.cmake +@@ -77,9 +77,9 @@ macro(ign_setup_unix) + exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR) + set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL + "processor type (i386 and x86_64)") +- if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") +- set(IGN_ADD_fPIC_TO_LIBRARIES true) +- endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++ # if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++ # set(IGN_ADD_fPIC_TO_LIBRARIES true) ++ # endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + endif(CMAKE_UNAME) + + endmacro() +@@ -93,8 +93,10 @@ macro(ign_setup_apple) + # 10.x.x = Mac OSX Snow Leopard (10.6) + # 11.x.x = Mac OSX Lion (10.7) + # 12.x.x = Mac OSX Mountain Lion (10.8) +- if(${CMAKE_SYSTEM_VERSION} LESS 10) +- add_definitions(-DMAC_OS_X_VERSION=1050) ++ if(NOT CMAKE_SYSTEM_VERSION) ++ return() ++ elseif(${CMAKE_SYSTEM_VERSION} LESS 10) ++ add_definitions(-DMAC_OS_X_VERSION=1050) + elseif(${CMAKE_SYSTEM_VERSION} GREATER 10 AND ${CMAKE_SYSTEM_VERSION} LESS 11) + add_definitions(-DMAC_OS_X_VERSION=1060) + elseif(${CMAKE_SYSTEM_VERSION} GREATER 11 AND ${CMAKE_SYSTEM_VERSION} LESS 12) +diff --git a/cmake/IgnUtils.cmake b/cmake/IgnUtils.cmake +index 9b94c85..5e525e6 100644 +--- a/cmake/IgnUtils.cmake ++++ b/cmake/IgnUtils.cmake +@@ -1409,7 +1409,7 @@ macro(_ign_add_library_or_component) + # Generate export macro headers + # Note: INTERFACE libraries do not need the export header + set(binary_include_dir +- "${CMAKE_BINARY_DIR}/include/${include_dir}") ++ "${PROJECT_BINARY_DIR}/include/${include_dir}") + + set(implementation_file_name "${binary_include_dir}/detail/Export.hh") + diff --git a/recipes/ignition-cmake/all/patches/0001-cmake-fixes.patch b/recipes/ignition-cmake/all/patches/2.5.0-0001-fix-cmake.patch similarity index 100% rename from recipes/ignition-cmake/all/patches/0001-cmake-fixes.patch rename to recipes/ignition-cmake/all/patches/2.5.0-0001-fix-cmake.patch diff --git a/recipes/ignition-cmake/all/test_v1_package/CMakeLists.txt b/recipes/ignition-cmake/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/ignition-cmake/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 8f851887ec419..0000000000000 --- a/recipes/ignition-cmake/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,23 +0,0 @@ -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/ignition-cmake/config.yml b/recipes/ignition-cmake/config.yml index 90aed98c5dd74..1d34d3bb6f93d 100644 --- a/recipes/ignition-cmake/config.yml +++ b/recipes/ignition-cmake/config.yml @@ -1,5 +1,7 @@ versions: - "2.5.0": + "2.17.1": folder: all "2.10.0": folder: all + "2.5.0": + folder: all diff --git a/recipes/ignition-math/all/conanfile.py b/recipes/ignition-math/all/conanfile.py index 3af2ddca7b420..4e3d073bc2587 100644 --- a/recipes/ignition-math/all/conanfile.py +++ b/recipes/ignition-math/all/conanfile.py @@ -67,7 +67,7 @@ def configure(self): def requirements(self): self.requires("eigen/3.3.9") - self.requires("doxygen/1.8.17") + self.requires("doxygen/[>=1.8 <2]") self.requires("swig/4.0.2") def build_requirements(self): diff --git a/recipes/ignition-math/all/test_package/CMakeLists.txt b/recipes/ignition-math/all/test_package/CMakeLists.txt index afd28de5fd4f9..6572f45628ced 100644 --- a/recipes/ignition-math/all/test_package/CMakeLists.txt +++ b/recipes/ignition-math/all/test_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/ignition-tools/all/test_package/CMakeLists.txt b/recipes/ignition-tools/all/test_package/CMakeLists.txt index 294e2c5ebc47c..1f80f3e5bc167 100644 --- a/recipes/ignition-tools/all/test_package/CMakeLists.txt +++ b/recipes/ignition-tools/all/test_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/ignition-utils/all/conanfile.py b/recipes/ignition-utils/all/conanfile.py index 0086df1bf32b9..40a49d79dc3da 100644 --- a/recipes/ignition-utils/all/conanfile.py +++ b/recipes/ignition-utils/all/conanfile.py @@ -75,7 +75,7 @@ def validate(self): ) def requirements(self): - self.requires("doxygen/1.9.2") + self.requires("doxygen/[>=1.8 <2]") if self.options.ign_utils_vendor_cli11: self.requires("cli11/2.1.2") diff --git a/recipes/iguana/all/conandata.yml b/recipes/iguana/all/conandata.yml new file mode 100644 index 0000000000000..3e9e419a87075 --- /dev/null +++ b/recipes/iguana/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.6": + url: "https://github.com/qicosmos/iguana/archive/refs/tags/1.0.6.tar.gz" + sha256: "cfacf1cce4ebe49b947ec823f93a23c2a7fd220f67f6847e9f449e7c469deb9e" + "1.0.5": + url: "https://github.com/qicosmos/iguana/archive/refs/tags/1.0.5.tar.gz" + sha256: "b7a7385c49574a60f9f6bf887c1addbc08f557a0117bf18cf7eec532ac2536b1" + "1.0.4": + url: "https://github.com/qicosmos/iguana/archive/refs/tags/1.0.4.tar.gz" + sha256: "b584cd26e65902a14a3a349ebc480beb7b4502fd5a5ffa3cb7c6102d857958b1" + "1.0.3": + url: "https://github.com/qicosmos/iguana/archive/refs/tags/v1.0.3.tar.gz" + sha256: "7dcb21a36bd64a63a9ea857f3563ac61e965c49ec60ad7b99a2bfb9192f3e4c3" diff --git a/recipes/iguana/all/conanfile.py b/recipes/iguana/all/conanfile.py new file mode 100644 index 0000000000000..20b73f1969975 --- /dev/null +++ b/recipes/iguana/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class IguanaConan(ConanFile): + name = "iguana" + description = "universal serialization engine" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/qicosmos/iguana" + topics = ("serialization", "json", "xml", "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("frozen/1.1.1", 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) + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + os.path.join(self.source_folder, "iguana"), + os.path.join(self.package_folder, "include", "iguana"), + ) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "iguana"), + os.path.join(self.package_folder, "include", "iguana"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("dl") diff --git a/recipes/iguana/all/test_package/CMakeLists.txt b/recipes/iguana/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b17ea62c13e23 --- /dev/null +++ b/recipes/iguana/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(iguana REQUIRED CONFIG) + +if(iguana_VERSION VERSION_GREATER_EQUAL "1.0.6") + add_executable(${PROJECT_NAME} test_package.cpp) +else() + add_executable(${PROJECT_NAME} test_package_1_0_5.cpp) +endif() +target_link_libraries(${PROJECT_NAME} PRIVATE iguana::iguana) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/iguana/all/test_package/conanfile.py b/recipes/iguana/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/iguana/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/iguana/all/test_package/test_package.cpp b/recipes/iguana/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4e191ae1388a2 --- /dev/null +++ b/recipes/iguana/all/test_package/test_package.cpp @@ -0,0 +1,88 @@ +#include +#include +#include + +namespace client { +struct person { + std::string name; + int64_t age; +}; + +#if __cplusplus < 202002L +YLT_REFL(person, name, age); +#endif +} // namespace client + +struct MyStruct { + uint64_t a; +}; +#if __cplusplus < 202002L +YLT_REFL(MyStruct, a); +#endif + +struct student { + int id; + std::string name; + int age; +}; +#if __cplusplus < 202002L +YLT_REFL(student, id, name, age); +#endif + +void test() { + MyStruct p = {5566777755311}; + iguana::string_stream ss; + iguana::to_json(p, ss); + + MyStruct p2; + iguana::from_json(p2, ss); + std::cout << p2.a << std::endl; +} + +void test_v() { + client::person p1 = {"tom", 20}; + client::person p2 = {"jack", 19}; + client::person p3 = {"mike", 21}; + + std::vector v{p1, p2, p3}; + iguana::string_stream ss; + iguana::to_json(v, ss); + std::cout << ss << std::endl; + + std::vector v1; + iguana::from_json(v1, ss); +} + +void test_disorder() { + student s{1, "tom", 20}; + iguana::string_stream ss; + iguana::to_json(s, ss); + std::cout << ss << std::endl; + + student s1{}; + std::string str = "{\"name\":\"tom\",\"id\":1,\"age\":20}"; + iguana::from_json(s1, str.data(), str.length()); + std::string str1 = "{\"name\":\"tom\",\"age\":20,\"id\":1}"; + iguana::from_json(s1, str1.data(), str1.length()); + + std::string str2 = "{ \"id\":1,\"name\" : \"madoka\",\"age\" : 27 }"; + iguana::from_json(s1, str2.data(), str2.length()); +} + +int main(void) { + test_disorder(); + test_v(); + test(); + client::person p = {"zombie chow", -311}; + iguana::string_stream ss; + iguana::to_json(p, ss); + + std::cout << ss << std::endl; + client::person p2; + + iguana::from_json(p2, ss.data(), ss.length()); + + std::cout << p2.name << " - " << p2.age << std::endl; + + return 0; +} diff --git a/recipes/iguana/all/test_package/test_package_1_0_5.cpp b/recipes/iguana/all/test_package/test_package_1_0_5.cpp new file mode 100644 index 0000000000000..f97e8fb335c14 --- /dev/null +++ b/recipes/iguana/all/test_package/test_package_1_0_5.cpp @@ -0,0 +1,81 @@ +#include +#include + +namespace client { +struct person { + std::string name; + int64_t age; +}; + +REFLECTION(person, name, age); +} // namespace client + +struct MyStruct { + uint64_t a; +}; +REFLECTION(MyStruct, a); + +struct student { + int id; + std::string name; + int age; +}; +REFLECTION(student, id, name, age); + +void test() { + MyStruct p = {5566777755311}; + iguana::string_stream ss; + iguana::to_json(p, ss); + + MyStruct p2; + iguana::from_json(p2, ss); + std::cout << p2.a << std::endl; +} + +void test_v() { + client::person p1 = {"tom", 20}; + client::person p2 = {"jack", 19}; + client::person p3 = {"mike", 21}; + + std::vector v{p1, p2, p3}; + iguana::string_stream ss; + iguana::to_json(v, ss); + std::cout << ss << std::endl; + + std::vector v1; + iguana::from_json(v1, ss); +} + +void test_disorder() { + student s{1, "tom", 20}; + iguana::string_stream ss; + iguana::to_json(s, ss); + std::cout << ss << std::endl; + + student s1{}; + std::string str = "{\"name\":\"tom\",\"id\":1,\"age\":20}"; + iguana::from_json(s1, str.data(), str.length()); + std::string str1 = "{\"name\":\"tom\",\"age\":20,\"id\":1}"; + iguana::from_json(s1, str1.data(), str1.length()); + + std::string str2 = "{ \"id\":1,\"name\" : \"madoka\",\"age\" : 27 }"; + iguana::from_json(s1, str2.data(), str2.length()); +} + +int main(void) { + test_disorder(); + test_v(); + test(); + client::person p = {"zombie chow", -311}; + iguana::string_stream ss; + iguana::to_json(p, ss); + + std::cout << ss << std::endl; + client::person p2; + + iguana::from_json(p2, ss.data(), ss.length()); + + std::cout << p2.name << " - " << p2.age << std::endl; + + return 0; +} diff --git a/recipes/iguana/config.yml b/recipes/iguana/config.yml new file mode 100644 index 0000000000000..c64afb84e8dad --- /dev/null +++ b/recipes/iguana/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.6": + folder: all + "1.0.5": + folder: all + "1.0.4": + folder: all + "1.0.3": + folder: all diff --git a/recipes/iir1/all/conandata.yml b/recipes/iir1/all/conandata.yml index dcf07a8d3050e..f693ec80aa1be 100644 --- a/recipes/iir1/all/conandata.yml +++ b/recipes/iir1/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.9.4": + url: "https://github.com/berndporr/iir1/archive/refs/tags/1.9.4.tar.gz" + sha256: "67d0982356f33fd37522e4711cda12f70a981a9c83de332386f89de3d7601d2b" "1.9.1": url: "https://github.com/berndporr/iir1/archive/refs/tags/1.9.1.tar.gz" sha256: "97b4a7d62fa4859ac0d80283696b0d91c320b61ec2a455cdd3d8cfbb2be3ad9a" @@ -11,10 +14,6 @@ patches: patch_description: "Avoid to define __declspec(dllexport) on windows at consume time & in static lib" patch_type: "portability" sha256: "b29a0a2f4e6f76c57b7a8e4051173a0e82d7d154571377a0fbd75fd73e4fa73c" - - patch_file: "patches/1.9.0-0003-disable-test-demo.patch" - patch_description: "Do not build test & demo" - patch_type: "conan" - sha256: "5b866e0a6d536f12386ecc212c47a993b9e891584879fd507f8b86f596f97cdd" "1.9.0": - patch_file: "patches/1.9.0-0001-no-export-static-win.patch" patch_description: "Avoid to define __declspec(dllexport) on windows at consume time & in static lib" @@ -24,7 +23,3 @@ patches: patch_description: "Install dll to bin folder" patch_type: "portability" sha256: "2f423eb1ee633a03c30d60f58a125f118cf9323402983c908708e7a6478e4bf6" - - patch_file: "patches/1.9.0-0003-disable-test-demo.patch" - patch_description: "Do not build test & demo" - patch_type: "conan" - sha256: "5b866e0a6d536f12386ecc212c47a993b9e891584879fd507f8b86f596f97cdd" diff --git a/recipes/iir1/all/conanfile.py b/recipes/iir1/all/conanfile.py index 26653fa6b385c..dce80cb5e824b 100644 --- a/recipes/iir1/all/conanfile.py +++ b/recipes/iir1/all/conanfile.py @@ -1,11 +1,11 @@ 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, rm, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class Iir1Conan(ConanFile): @@ -64,10 +64,18 @@ def generate(self): tc = CMakeToolchain(self) if self.options.get_safe("noexceptions"): tc.preprocessor_definitions["IIR1_NO_EXCEPTIONS"] = "1" + if Version(self.version) < "1.9.4": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + # Disable test and demo subdirs + save(self, os.path.join(self.source_folder, "test", "CMakeLists.txt"), "") + save(self, os.path.join(self.source_folder, "demo", "CMakeLists.txt"), "") + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -95,10 +103,4 @@ def package_info(self): self.cpp_info.components["iir"].defines.append("IIR1_NO_EXCEPTIONS") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["iir"].system_libs.append("m") - - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "iir" - self.cpp_info.names["cmake_find_package_multi"] = "iir" - self.cpp_info.components["iir"].names["cmake_find_package"] = name - self.cpp_info.components["iir"].names["cmake_find_package_multi"] = name self.cpp_info.components["iir"].set_property("cmake_target_name", f"iir::{name}") diff --git a/recipes/iir1/all/patches/1.9.0-0003-disable-test-demo.patch b/recipes/iir1/all/patches/1.9.0-0003-disable-test-demo.patch deleted file mode 100644 index 18bc682ab4948..0000000000000 --- a/recipes/iir1/all/patches/1.9.0-0003-disable-test-demo.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -12,9 +12,6 @@ cmake_policy(SET CMP0048 NEW) # set VERSION in project() - cmake_policy(SET CMP0042 NEW) # enable MACOSX_RPATH by default - - include(GNUInstallDirs) --add_subdirectory(test) --add_subdirectory(demo) --enable_testing () - - if (MSVC) - add_compile_options(/W4) diff --git a/recipes/iir1/all/test_package/CMakeLists.txt b/recipes/iir1/all/test_package/CMakeLists.txt index bfb108d7d9198..36ce617c16331 100644 --- a/recipes/iir1/all/test_package/CMakeLists.txt +++ b/recipes/iir1/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(iir REQUIRED CONFIG) diff --git a/recipes/iir1/all/test_v1_package/CMakeLists.txt b/recipes/iir1/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/iir1/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/iir1/all/test_v1_package/conanfile.py b/recipes/iir1/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/iir1/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_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/iir1/config.yml b/recipes/iir1/config.yml index 8e492271b1dfd..01169b44873a4 100644 --- a/recipes/iir1/config.yml +++ b/recipes/iir1/config.yml @@ -1,4 +1,6 @@ versions: + "1.9.4": + folder: "all" "1.9.1": folder: "all" "1.9.0": diff --git a/recipes/im95able-rea/all/test_package/CMakeLists.txt b/recipes/im95able-rea/all/test_package/CMakeLists.txt index b670ff5e6af64..e73fcc95eae32 100644 --- a/recipes/im95able-rea/all/test_package/CMakeLists.txt +++ b/recipes/im95able-rea/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(rea REQUIRED CONFIG) diff --git a/recipes/im95able-rea/all/test_v1_package/CMakeLists.txt b/recipes/im95able-rea/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/im95able-rea/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/im95able-rea/all/test_v1_package/conanfile.py b/recipes/im95able-rea/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/im95able-rea/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/imagemagick/all/conanfile.py b/recipes/imagemagick/all/conanfile.py index 4e944b9046b3f..49e0388b61d25 100644 --- a/recipes/imagemagick/all/conanfile.py +++ b/recipes/imagemagick/all/conanfile.py @@ -108,7 +108,7 @@ def requirements(self): if self.options.with_lzma: self.requires("xz_utils/5.2.5") if self.options.with_lcms: - self.requires("lcms/2.11") + self.requires("lcms/2.16") if self.options.with_openexr: self.requires("openexr/2.5.7") if self.options.with_heic: diff --git a/recipes/imagemagick/all/test_package/CMakeLists.txt b/recipes/imagemagick/all/test_package/CMakeLists.txt index 7b9b613cbb24a..79503eeb44d25 100644 --- a/recipes/imagemagick/all/test_package/CMakeLists.txt +++ b/recipes/imagemagick/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/imagl/all/conandata.yml b/recipes/imagl/all/conandata.yml index 338c8a935d27e..83cf32f1dbe98 100644 --- a/recipes/imagl/all/conandata.yml +++ b/recipes/imagl/all/conandata.yml @@ -16,15 +16,27 @@ patches: - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" patch_type: conan + - patch_file: "patches/0002-use-findpackage-0.1.x.patch" + patch_description: "Use find_package: update CMakeLists.txt to use modern find_package compatible with conan 2.0" + patch_type: conan "0.1.1": - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" patch_type: conan + - patch_file: "patches/0002-use-findpackage-0.1.x.patch" + patch_description: "Use find_package: update CMakeLists.txt to use modern find_package compatible with conan 2.0" + patch_type: conan "0.1.2": - patch_file: "patches/0001-no-unmanaged-conan-0.1.x.patch" patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" patch_type: conan + - patch_file: "patches/0002-use-findpackage-0.1.x.patch" + patch_description: "Use find_package: update CMakeLists.txt to use modern find_package compatible with conan 2.0" + patch_type: conan "0.2.1": - patch_file: "patches/0001-no-unmanaged-conan-0.2.1.patch" patch_description: "No unmanaged conan: update CMakeLists.txt remove call to conan" patch_type: conan + - patch_file: "patches/0002-use-findpackage-0.2.1.patch" + patch_description: "Use find_package: update CMakeLists.txt to use modern find_package compatible with conan 2.0" + patch_type: conan diff --git a/recipes/imagl/all/conanfile.py b/recipes/imagl/all/conanfile.py index e756a56a2d548..485f56d442ad3 100644 --- a/recipes/imagl/all/conanfile.py +++ b/recipes/imagl/all/conanfile.py @@ -65,7 +65,7 @@ def layout(self): def requirements(self): if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self._supports_jpeg and self.options.with_jpeg: self.requires("libjpeg/9e") diff --git a/recipes/imagl/all/patches/0002-use-findpackage-0.1.x.patch b/recipes/imagl/all/patches/0002-use-findpackage-0.1.x.patch new file mode 100644 index 0000000000000..8be7d6463c6b8 --- /dev/null +++ b/recipes/imagl/all/patches/0002-use-findpackage-0.1.x.patch @@ -0,0 +1,15 @@ +--- a/imaGL/CMakeLists.txt ++++ b/imaGL/CMakeLists.txt +@@ -12,9 +12,10 @@ set_property(TARGET libImaGL PROPERTY OUTPUT_NAME imaGL) + set_property(TARGET libImaGL PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/public/imaGL/imaGL.h") + target_include_directories(libImaGL INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/public") + +-if(TARGET CONAN_PKG::libpng) ++find_package(PNG) ++if(PNG_FOUND) + add_compile_definitions(_HAS_PNG) +- target_link_libraries (libImaGL CONAN_PKG::libpng) ++ target_link_libraries (libImaGL PNG::PNG) + endif() + + file(GLOB_RECURSE ImaGL_SRC "*.h" "*.cpp") diff --git a/recipes/imagl/all/patches/0002-use-findpackage-0.2.1.patch b/recipes/imagl/all/patches/0002-use-findpackage-0.2.1.patch new file mode 100644 index 0000000000000..0053f809e4461 --- /dev/null +++ b/recipes/imagl/all/patches/0002-use-findpackage-0.2.1.patch @@ -0,0 +1,23 @@ +--- a/imaGL/CMakeLists.txt ++++ b/imaGL/CMakeLists.txt +@@ -12,14 +12,16 @@ set_property(TARGET libImaGL PROPERTY OUTPUT_NAME imaGL) + set_property(TARGET libImaGL PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/public/imaGL/imaGL.h") + target_include_directories(libImaGL INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/public") + +-if(TARGET CONAN_PKG::libpng) ++find_package(PNG) ++if(PNG_FOUND) + add_compile_definitions(_HAS_PNG) +- target_link_libraries (libImaGL CONAN_PKG::libpng) ++ target_link_libraries (libImaGL PNG::PNG) + endif() + +-if(TARGET CONAN_PKG::libjpeg) ++find_package(JPEG) ++if(JPEG_FOUND) + add_compile_definitions(_HAS_JPEG) +- target_link_libraries (libImaGL CONAN_PKG::libjpeg) ++ target_link_libraries (libImaGL JPEG::JPEG) + endif() + + file(GLOB_RECURSE ImaGL_SRC "*.h" "*.cpp") diff --git a/recipes/imagl/all/test_v1_package/CMakeLists.txt b/recipes/imagl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/imagl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 923bd771c14e7..0000000000000 --- a/recipes/imagl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/test_v1_package/Imake.tmpl b/recipes/imake/all/test_v1_package/Imake.tmpl deleted file mode 100644 index 3b7cb31780b8f..0000000000000 --- a/recipes/imake/all/test_v1_package/Imake.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -default: - @echo "IMAKE_TEMPLATE:" IMAKE_TEMPLATE diff --git a/recipes/imake/all/test_v1_package/Imakefile b/recipes/imake/all/test_v1_package/Imakefile deleted file mode 100644 index 8a9b031f63620..0000000000000 --- a/recipes/imake/all/test_v1_package/Imakefile +++ /dev/null @@ -1 +0,0 @@ -# Imakefile diff --git a/recipes/imake/all/test_v1_package/conanfile.py b/recipes/imake/all/test_v1_package/conanfile.py deleted file mode 100644 index 99bf0a8a9c2d8..0000000000000 --- a/recipes/imake/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,44 +0,0 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import contextlib -import os -import shutil - -required_conan_version = ">=1.36.0" - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - exports_sources = "Imakefile", "Imake.tmpl" - - def build_requirements(self): - if not tools.get_env("CONAN_MAKE_PROGRAM"): - self.build_requires("make/4.2.1") - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "cl -nologo", - } - with tools.environment_append(env): - yield - else: - yield - - 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)) - if not tools.cross_building(self): - with self._build_context(): - self.run("imake", run_environment=True) - - def test(self): - if not tools.cross_building(self): - autotools = AutoToolsBuildEnvironment(self) - autotools.make() diff --git a/recipes/imath/all/conandata.yml b/recipes/imath/all/conandata.yml index 184bb3afe6a05..afe9fa4328195 100644 --- a/recipes/imath/all/conandata.yml +++ b/recipes/imath/all/conandata.yml @@ -1,19 +1,22 @@ sources: + "3.1.12": + url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.12.tar.gz" + sha256: "8a1bc258f3149b5729c2f4f8ffd337c0e57f09096e4ba9784329f40c4a9035da" + "3.1.11": + url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.11.tar.gz" + sha256: "9057849585e49b8b85abe7cc1e76e22963b01bfdc3b6d83eac90c499cd760063" + "3.1.10": + url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.10.tar.gz" + sha256: "f2943e86bfb694e216c60b9a169e5356f8a90f18fbd34d7b6e3450be14f60b10" "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" - "3.1.6": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/v3.1.6.tar.gz" - sha256: "ea5592230f5ab917bea3ceab266cf38eb4aa4a523078d46eac0f5a89c52304db" - "3.1.5": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.5.tar.gz" - sha256: "1e9c7c94797cf7b7e61908aed1f80a331088cc7d8873318f70376e4aed5f25fb" - "3.1.4": - url: "https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.4.tar.gz" - sha256: "fcca5fbb37d375a252bacd8a29935569bdc28b888f01ef1d9299ca0c9e87c17a" +patches: + "3.1.10": + - patch_file: "patches/3.1.10-gcc5-backport.patch" + patch_description: "Add std:: prefix for isfinite (Backport from main, two commits on the file fix the issue)" + patch_type: "official" + patch_source: "https://github.com/AcademySoftwareFoundation/Imath/blob/main/src/Imath/ImathFun.cpp" diff --git a/recipes/imath/all/conanfile.py b/recipes/imath/all/conanfile.py index ca052909386af..1493689ab88b1 100644 --- a/recipes/imath/all/conanfile.py +++ b/recipes/imath/all/conanfile.py @@ -1,7 +1,7 @@ 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, rmdir +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc import os @@ -30,6 +30,9 @@ class ImathConan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -53,10 +56,12 @@ def generate(self): if is_msvc(self) and self.settings.compiler.get_safe("cppstd"): # when msvc is working with a C++ standard level higher # than the default, we need the __cplusplus macro to be correct - tc.variables["CMAKE_CXX_FLAGS"] = "/Zc:__cplusplus" + tc.variables["CMAKE_CXX_FLAGS"] = "/Zc:__cplusplus" tc.generate() def build(self): + apply_conandata_patches(self) + cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/imath/all/patches/3.1.10-gcc5-backport.patch b/recipes/imath/all/patches/3.1.10-gcc5-backport.patch new file mode 100644 index 0000000000000..8d27e5461ad48 --- /dev/null +++ b/recipes/imath/all/patches/3.1.10-gcc5-backport.patch @@ -0,0 +1,34 @@ +diff --git src/Imath/ImathFun.cpp src/Imath/ImathFun.cpp +index bfec292..c8c2e7e 100644 +--- src/Imath/ImathFun.cpp ++++ src/Imath/ImathFun.cpp +@@ -10,25 +10,25 @@ IMATH_INTERNAL_NAMESPACE_SOURCE_ENTER + + float succf(float f) IMATH_NOEXCEPT + { +- return isfinite(f) ? ++ return std::isfinite(f) ? + std::nextafter(f, std::numeric_limits::infinity()) : f; + } + + float predf(float f) IMATH_NOEXCEPT + { +- return isfinite(f) ? ++ return std::isfinite(f) ? + std::nextafter(f, -std::numeric_limits::infinity()) : f; + } + + double succd(double d) IMATH_NOEXCEPT + { +- return isfinite(d) ? ++ return std::isfinite(d) ? + std::nextafter(d, std::numeric_limits::infinity()) : d; + } + + double predd(double d) IMATH_NOEXCEPT + { +- return isfinite(d) ? ++ return std::isfinite(d) ? + std::nextafter(d, -std::numeric_limits::infinity()) : d; + } + diff --git a/recipes/imath/all/test_package/CMakeLists.txt b/recipes/imath/all/test_package/CMakeLists.txt index 4c646b7678695..14400c4245a47 100644 --- a/recipes/imath/all/test_package/CMakeLists.txt +++ b/recipes/imath/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(Imath REQUIRED CONFIG) diff --git a/recipes/imath/all/test_v1_package/CMakeLists.txt b/recipes/imath/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/imath/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/imath/all/test_v1_package/conanfile.py b/recipes/imath/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/imath/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_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/imath/config.yml b/recipes/imath/config.yml index e9bdf1c39b31e..299f457f6ad28 100644 --- a/recipes/imath/config.yml +++ b/recipes/imath/config.yml @@ -1,13 +1,11 @@ versions: - "3.1.9": - folder: all - "3.1.8": + "3.1.12": folder: all - "3.1.7": + "3.1.11": folder: all - "3.1.6": + "3.1.10": folder: all - "3.1.5": + "3.1.9": folder: all - "3.1.4": + "3.1.8": folder: all diff --git a/recipes/imgui-sfml/all/conandata.yml b/recipes/imgui-sfml/all/conandata.yml new file mode 100644 index 0000000000000..4235ee6c4c85a --- /dev/null +++ b/recipes/imgui-sfml/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.6.1": + url: "https://github.com/SFML/imgui-sfml/archive/refs/tags/v2.6.1.tar.gz" + sha256: "b250df2ee308b614f0bb061a49a61c3796d0f7224a9539099e6b479fed2d451b" +patches: + "2.6.1": + - patch_file: "patches/0001-2.6-fix-imgui-linking.patch" + patch_description: "Link to imgui, avoid compiling it directly" + patch_type: "conan" diff --git a/recipes/imgui-sfml/all/conanfile.py b/recipes/imgui-sfml/all/conanfile.py new file mode 100644 index 0000000000000..34811e74208c1 --- /dev/null +++ b/recipes/imgui-sfml/all/conanfile.py @@ -0,0 +1,89 @@ +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, apply_conandata_patches, export_conandata_patches +import os + +required_conan_version = ">=2.0.9" + + +class ImGuiSFMLConan(ConanFile): + name = "imgui-sfml" + description = "ImGui-SFML integrates Dear ImGui with SFML, enabling easy creation of GUIs for SFML applications." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/SFML/imgui-sfml" + topics = ("gui", "graphical", "sfml", "imgui") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("sfml/2.6.2", transitive_headers=True) + self.requires("imgui/1.91.8", transitive_headers=True, transitive_libs=True) + self.requires("opengl/system") + + def validate(self): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["IMGUI_SFML_FIND_SFML"] = True + tc.cache_variables["IMGUI_DIR"] = "UNUSED" + tc.cache_variables["IMGUI_SFML_IMGUI_DEMO"] = False + + tc.cache_variables["IMGUI_SFML_BUILD_TESTING"] = False + tc.cache_variables["IMGUI_SFML_BUILD_EXAMPLES"] = False + tc.generate() + + tc = CMakeDeps(self) + tc.set_property("imgui", "cmake_file_name", "ImGui") + tc.set_property("imgui", "cmake_additional_variables_prefixes", ["IMGUI"]) + tc.generate() + + def build(self): + 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", "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): + postfix = "" + if self.options.shared and self.settings.build_type == "Debug": + postfix = "_d" + self.cpp_info.libs = ["ImGui-SFML" + postfix] + + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["imm32"] + + self.cpp_info.set_property("cmake_file_name", "ImGui-SFML") + self.cpp_info.set_property("cmake_target_name", "ImGui-SFML::ImGui-SFML") diff --git a/recipes/imgui-sfml/all/patches/0001-2.6-fix-imgui-linking.patch b/recipes/imgui-sfml/all/patches/0001-2.6-fix-imgui-linking.patch new file mode 100644 index 0000000000000..238420d33c4ca --- /dev/null +++ b/recipes/imgui-sfml/all/patches/0001-2.6-fix-imgui-linking.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 837da48..713521f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,7 @@ target_include_directories(ImGui-SFML PUBLIC + $ + ) + target_compile_features(ImGui-SFML PUBLIC cxx_std_11) +-target_link_libraries(ImGui-SFML PUBLIC sfml-graphics OpenGL::GL) ++target_link_libraries(ImGui-SFML PUBLIC sfml-graphics OpenGL::GL imgui::imgui) + if(WIN32 AND MINGW) + target_link_libraries(ImGui-SFML PUBLIC imm32) + endif() +@@ -119,7 +119,6 @@ target_compile_definitions(ImGui-SFML PUBLIC IMGUI_USER_CONFIG="${IMGUI_SFML_CON + set(IMGUI_SFML_PUBLIC_HEADERS + ${PROJECT_SOURCE_DIR}/imgui-SFML.h + ${PROJECT_SOURCE_DIR}/imgui-SFML_export.h +- ${IMGUI_PUBLIC_HEADERS} + ) + if(IMGUI_SFML_USE_DEFAULT_CONFIG OR (NOT DEFINED "${IMGUI_SFML_CONFIG_INSTALL_DIR}")) + list(APPEND IMGUI_SFML_PUBLIC_HEADERS "${IMGUI_SFML_CONFIG_DIR}/${IMGUI_SFML_CONFIG_NAME}") diff --git a/recipes/imgui-sfml/all/test_package/CMakeLists.txt b/recipes/imgui-sfml/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5c63a445e0c7d --- /dev/null +++ b/recipes/imgui-sfml/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(ImGui-SFML REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ImGui-SFML::ImGui-SFML) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/imgui-sfml/all/test_package/conanfile.py b/recipes/imgui-sfml/all/test_package/conanfile.py new file mode 100644 index 0000000000000..02eb5ce439fb4 --- /dev/null +++ b/recipes/imgui-sfml/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/imgui-sfml/all/test_package/test_package.cpp b/recipes/imgui-sfml/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c6dd93bcf4213 --- /dev/null +++ b/recipes/imgui-sfml/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include "imgui-SFML.h" + +int main() { + ImGui::SFML::Shutdown(); + return 0; +} diff --git a/recipes/imgui-sfml/config.yml b/recipes/imgui-sfml/config.yml new file mode 100644 index 0000000000000..36b28f1209ae7 --- /dev/null +++ b/recipes/imgui-sfml/config.yml @@ -0,0 +1,3 @@ +versions: + "2.6.1": + folder: all diff --git a/recipes/imgui/all/conandata.yml b/recipes/imgui/all/conandata.yml index 5a380f8aab078..914390ddf0f72 100644 --- a/recipes/imgui/all/conandata.yml +++ b/recipes/imgui/all/conandata.yml @@ -1,43 +1,34 @@ 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.91.8": + url: "https://github.com/ocornut/imgui/archive/v1.91.8.tar.gz" + sha256: "db3a2e02bfd6c269adf0968950573053d002f40bdfb9ef2e4a90bce804b0f286" + "1.91.8-docking": + url: "https://github.com/ocornut/imgui/archive/v1.91.8-docking.tar.gz" + sha256: "55f5e65abea635f2a8bfa9a92cd966448a363a262cf6dead7cc662fb0ab37612" + "1.91.5": + url: "https://github.com/ocornut/imgui/archive/v1.91.5.tar.gz" + sha256: "2aa2d169c569368439e5d5667e0796d09ca5cc6432965ce082e516937d7db254" + "1.91.5-docking": + url: "https://github.com/ocornut/imgui/archive/v1.91.5-docking.tar.gz" + sha256: "f66c5d1b28fed044bd8dffa3882b4d1b29b2dbd1167fabe3d9d2219081e81cd8" + "1.90.9": + url: "https://github.com/ocornut/imgui/archive/v1.90.9.tar.gz" + sha256: "04943919721e874ac75a2f45e6eb6c0224395034667bf508923388afda5a50bf" + "1.90.9-docking": + url: "https://github.com/ocornut/imgui/archive/v1.90.9-docking.tar.gz" + sha256: "48e7e4e4f154ad98d0946126a84e2375f849f6a67792129a805817dd60a34330" + "1.90.5": + url: "https://github.com/ocornut/imgui/archive/v1.90.5.tar.gz" + sha256: "e94b48dba7311c85ba8e3e6fe7c734d76a0eed21b2b42c5180fd5706d1562241" + "1.90.5-docking": + url: "https://github.com/ocornut/imgui/archive/v1.90.5-docking.tar.gz" + sha256: "8a5e1e594d6c8552e46e4c1ba8dd9deb51262067f04937904babc04384533ccc" "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" - "1.89.3": - url: "https://github.com/ocornut/imgui/archive/v1.89.3.tar.gz" - sha256: "3b665fadd5580b7ef494d5d8bb1c12b2ec53ee723034caf43332956381f5d631" - "1.89.2": - url: "https://github.com/ocornut/imgui/archive/v1.89.2.tar.gz" - sha256: "e110beffda505e6954feb7b13541d35a7c12a176b9723290c853684713df6a67" - "1.89.1": - url: "https://github.com/ocornut/imgui/archive/v1.89.1.tar.gz" - sha256: "6d02a0079514d869e4b5f8f590f9060259385fcddd93a07ef21298b6a9610cbd" "1.88": url: "https://github.com/ocornut/imgui/archive/v1.88.tar.gz" sha256: "9f14c788aee15b777051e48f868c5d4d959bd679fc5050e3d2a29de80d8fd32e" @@ -50,16 +41,3 @@ sources: "1.85": url: "https://github.com/ocornut/imgui/archive/v1.85.tar.gz" sha256: "7ed49d1f4573004fa725a70642aaddd3e06bb57fcfe1c1a49ac6574a3e895a77" - - # These versions belong to the docking branch in ImGUI repository. This branch is declared stable and production ready, and - # it is synced with `master` regularly. These versions are taken from that branch using the commit where `master` was synced - # after a regular release - "cci.20230105+1.89.2.docking": - url: "https://github.com/ocornut/imgui/archive/d822c65317ba881798bed8fce9ffba267d27dada.zip" - sha256: "0d2c09ae4c450d4c74f62e66667809752c9d11438354fc331ed9da5d5e850071" - "cci.20220621+1.88.docking": - url: "https://github.com/ocornut/imgui/archive/9cd9c2eff99877a3f10a7f9c2a3a5b9c15ea36c6.tar.gz" - sha256: "61fb1ce5d48089bce1b4f92e9320fd234b2ce960f35f965b313c4842b3c8e440" - "cci.20220207+1.87.docking": - url: "https://github.com/ocornut/imgui/archive/1ee252772ae9c0a971d06257bb5c89f628fa696a.tar.gz" - sha256: "c50e263660e1deb6e85b10a0382bf8a6fc861645e44b7012bd32da5460829ae0" diff --git a/recipes/imgui/all/test_package/CMakeLists.txt b/recipes/imgui/all/test_package/CMakeLists.txt index e5abc72962c86..9925dcac52e62 100644 --- a/recipes/imgui/all/test_package/CMakeLists.txt +++ b/recipes/imgui/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(imgui REQUIRED CONFIG) diff --git a/recipes/imgui/config.yml b/recipes/imgui/config.yml index 8714c2dcec41f..f383f2d91c1c9 100644 --- a/recipes/imgui/config.yml +++ b/recipes/imgui/config.yml @@ -1,29 +1,23 @@ versions: - "1.90": + "1.91.8": folder: all - "1.90-docking": + "1.91.8-docking": folder: all - "1.89.9": - folder: all - "1.89.9-docking": - folder: all - "1.89.8": - folder: all - "1.89.8-docking": + "1.91.5": folder: all - "1.89.7": + "1.91.5-docking": folder: all - "1.89.7-docking": + "1.90.9": folder: all - "1.89.5": + "1.90.9-docking": folder: all - "1.89.4": + "1.90.5": folder: all - "1.89.3": + "1.90.5-docking": folder: all - "1.89.2": + "1.89.9": folder: all - "1.89.1": + "1.89.9-docking": folder: all "1.88": folder: all @@ -34,12 +28,3 @@ versions: "1.85": folder: all - # These versions belong to the docking branch in ImGUI repository. This branch is declared stable and production ready, and - # it is synced with `master` regularly. These versions are taken from that branch using the commit where `master` was synced - # after a regular release - "cci.20230105+1.89.2.docking": - folder: all - "cci.20220621+1.88.docking": - folder: all - "cci.20220207+1.87.docking": - folder: all diff --git a/recipes/imguizmo/all/conandata.yml b/recipes/imguizmo/all/conandata.yml index 11e9cb824cab9..ae95ecdea6a27 100644 --- a/recipes/imguizmo/all/conandata.yml +++ b/recipes/imguizmo/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231114": + url: "https://github.com/CedricGuillemet/ImGuizmo/archive/ba662b119d64f9ab700bb2cd7b2781f9044f5565.zip" + sha256: "5a63baebb5bce96d83e5e3d6daa4598844ba8d5d0e3cb1ee385fcc54cf996115" "1.83": url: "https://github.com/CedricGuillemet/ImGuizmo/archive/refs/tags/1.83.tar.gz" sha256: "e6d05c5ebde802df7f6c342a06bc675bd2aa1c754d2d96755399a182187098a8" diff --git a/recipes/imguizmo/all/conanfile.py b/recipes/imguizmo/all/conanfile.py index 57281934555cf..64f8cb9f6dab2 100644 --- a/recipes/imguizmo/all/conanfile.py +++ b/recipes/imguizmo/all/conanfile.py @@ -2,7 +2,8 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get +from conan.tools.files import copy, get, replace_in_file +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -41,21 +42,26 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - # 1.89 is the newest imgui version compatible with imguizmo - self.requires("imgui/1.89.3", transitive_headers=True) + self.requires("imgui/1.90.5", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) + tc.preprocessor_definitions["IMGUI_DEFINE_MATH_OPERATORS"] = "" tc.generate() tc = CMakeDeps(self) tc.generate() def build(self): + if self.version == "1.83" and Version(self.dependencies["imgui"].ref.version) >= "1.89.4": + # Related to a breaking change: https://github.com/ocornut/imgui/blob/master/docs/CHANGELOG.txt#L912 + # Redirection: ImDrawList::AddBezierCurve() -> use ImDrawList::AddBezierCubic() + replace_in_file(self, os.path.join(self.source_folder, "GraphEditor.cpp"), + "AddBezierCurve", "AddBezierCubic") cmake = CMake(self) - cmake.configure(build_script_folder=self.export_sources_folder) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): diff --git a/recipes/imguizmo/all/test_v1_package/CMakeLists.txt b/recipes/imguizmo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/imguizmo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6c9d5dba712c7..0000000000000 --- a/recipes/imguizmo/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/imguizmo/config.yml b/recipes/imguizmo/config.yml index cc1b28a70b3ee..a2886d669a4e7 100644 --- a/recipes/imguizmo/config.yml +++ b/recipes/imguizmo/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20231114": + folder: "all" "1.83": folder: "all" diff --git a/recipes/immer/all/test_v1_package/CMakeLists.txt b/recipes/immer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/immer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 90eb89e3f2f46..0000000000000 --- a/recipes/immer/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/implot/all/CMakeLists.txt b/recipes/implot/all/CMakeLists.txt index 8f2c9651b41e6..317f2805b1b38 100644 --- a/recipes/implot/all/CMakeLists.txt +++ b/recipes/implot/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(implot LANGUAGES CXX) file(GLOB HEADER_FILES ${IMPLOT_SRC_DIR}/*.h) @@ -6,6 +6,9 @@ file(GLOB HEADER_FILES ${IMPLOT_SRC_DIR}/*.h) add_library(${PROJECT_NAME} ${IMPLOT_SRC_DIR}/implot.cpp ${IMPLOT_SRC_DIR}/implot_items.cpp + # implot_demo.cpp is included so that user can use it to display the main documentation of implot. + # Note that these functions are not declared by the public headers. + # https://github.com/conan-io/conan-center-index/pull/20374 ${IMPLOT_SRC_DIR}/implot_demo.cpp ) target_include_directories(${PROJECT_NAME} PRIVATE ${IMPLOT_SRC_DIR}) @@ -14,7 +17,6 @@ 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) diff --git a/recipes/implot/all/conanfile.py b/recipes/implot/all/conanfile.py index 0f83131c24116..ce5a386b006bb 100644 --- a/recipes/implot/all/conanfile.py +++ b/recipes/implot/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 get, copy +from conan.tools.files import get, copy, replace_in_file from conan.tools.scm import Version from conan.tools.microsoft import is_msvc import os @@ -31,17 +31,15 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC # rm_safe not needed + del self.options.fPIC def configure(self): if self.options.shared: self.options.rm_safe("fPIC") def requirements(self): - 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) + if Version(self.version) >= "0.14": + self.requires("imgui/1.90.5", transitive_headers=True) elif Version(self.version) >= "0.13": # imgui 1.89 renamed ImGuiKeyModFlags_* to ImGuiModFlags_* self.requires("imgui/1.88", transitive_headers=True) @@ -61,11 +59,22 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["IMPLOT_SRC_DIR"] = self.source_folder.replace("\\", "/") + if Version(self.version) < "0.16": + # Set in code since v0.16 https://github.com/epezent/implot/commit/33c5a965f55f80057f197257d1d1cdb06523e963 + tc.preprocessor_definitions["IMGUI_DEFINE_MATH_OPERATORS"] = "" tc.generate() deps = CMakeDeps(self) deps.generate() + def _patch_sources(self): + if Version(self.version) == "0.14" and Version(self.dependencies["imgui"].ref.version) >= "1.89.7": + # https://github.com/ocornut/imgui/commit/51f564eea6333bae9242f40c983a3e29d119a9c2 + replace_in_file(self, os.path.join(self.source_folder, "implot.cpp"), + "ImGuiButtonFlags_AllowItemOverlap", + "ImGuiButtonFlags_AllowOverlap") + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() diff --git a/recipes/implot/all/test_package/CMakeLists.txt b/recipes/implot/all/test_package/CMakeLists.txt index e39ff9333e1cc..93f04943cce41 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.4) +cmake_minimum_required(VERSION 3.15) 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 deleted file mode 100644 index 8d8cf1572027f..0000000000000 --- a/recipes/implot/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/implot/all/test_v1_package/conanfile.py b/recipes/implot/all/test_v1_package/conanfile.py deleted file mode 100644 index 4ef0320775f21..0000000000000 --- a/recipes/implot/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,23 +0,0 @@ -import os - -from conans import ConanFile, CMake -from conans.tools import cross_building - - -class ImplotTestConan(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.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/imutils-cpp/all/test_package/CMakeLists.txt b/recipes/imutils-cpp/all/test_package/CMakeLists.txt index 79460b8878562..664487bb3d313 100644 --- a/recipes/imutils-cpp/all/test_package/CMakeLists.txt +++ b/recipes/imutils-cpp/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(imutils_cpp REQUIRED CONFIG) diff --git a/recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt b/recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/imutils-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/imutils-cpp/all/test_v1_package/conanfile.py b/recipes/imutils-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/imutils-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/indicators/all/test_package/CMakeLists.txt b/recipes/indicators/all/test_package/CMakeLists.txt index 886f8f419992a..2745a6f21ae22 100644 --- a/recipes/indicators/all/test_package/CMakeLists.txt +++ b/recipes/indicators/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(indicators REQUIRED CONFIG) diff --git a/recipes/indicators/all/test_v1_package/CMakeLists.txt b/recipes/indicators/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/indicators/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/indicators/all/test_v1_package/conanfile.py b/recipes/indicators/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/indicators/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/indirect_value/all/test_v1_package/CMakeLists.txt b/recipes/indirect_value/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/indirect_value/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 9b63bd176646b..0000000000000 --- a/recipes/indirect_value/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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): - self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/influxdb-cpp/all/conandata.yml b/recipes/influxdb-cpp/all/conandata.yml index 08568ef090742..d9e475ef4f194 100644 --- a/recipes/influxdb-cpp/all/conandata.yml +++ b/recipes/influxdb-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + 'cci.20240102': + url: 'https://github.com/orca-zhang/influxdb-cpp/archive/db18273f09c113d0bd6037463997389afe978ac7.tar.gz' + sha256: '8c019ca700a723d9ed33d93e366cffac44b99a65485192ab70e760bf4229c7c8' 'cci.20201227': url: 'https://github.com/orca-zhang/influxdb-cpp/archive/800e0912552bc1b261c2afc6553a95caf5e9c66d.tar.gz' sha256: '456f0160cd6b12f88a19dcd0106dc0ba1935841f53ec642bf368843fa28def0e' diff --git a/recipes/influxdb-cpp/all/test_v1_package/CMakeLists.txt b/recipes/influxdb-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/influxdb-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49bc2bd787325..0000000000000 --- a/recipes/influxdb-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/influxdb-cpp/config.yml b/recipes/influxdb-cpp/config.yml index a58749d6e9c51..911f00a7a6918 100644 --- a/recipes/influxdb-cpp/config.yml +++ b/recipes/influxdb-cpp/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20240102": + folder: all "cci.20201227": folder: all diff --git a/recipes/influxdb-cxx/all/conandata.yml b/recipes/influxdb-cxx/all/conandata.yml new file mode 100644 index 0000000000000..465f6aea89730 --- /dev/null +++ b/recipes/influxdb-cxx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.2": + url: "https://github.com/offa/influxdb-cxx/archive/refs/tags/v0.7.2.tar.gz" + sha256: "951e067df5731cb23b72f53fcbea8e56920819c6191b6885ea180168eb1950d9" diff --git a/recipes/influxdb-cxx/all/conanfile.py b/recipes/influxdb-cxx/all/conanfile.py new file mode 100644 index 0000000000000..c903fb4c5efc1 --- /dev/null +++ b/recipes/influxdb-cxx/all/conanfile.py @@ -0,0 +1,102 @@ +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.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +required_conan_version = ">=1.53.0" + +class InfluxdbCxxConan(ConanFile): + name = "influxdb-cxx" + description = "InfluxDB C++ client library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/offa/influxdb-cxx" + topics = ("influxdb", "influxdb-client") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "boost": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "boost": 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 requirements(self): + self.requires("cpr/1.10.4") + if self.options.boost: + self.requires("boost/1.82.0") + + 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) + # BUILD_SHARED_LIBS is defined explicitly in CMakeLists.txt + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.cache_variables["INFLUXCXX_TESTING"] = False + tc.cache_variables["INFLUXCXX_WITH_BOOST"] = self.options.boost + if self.options.shared: + # See https://github.com/offa/influxdb-cxx/issues/194 + tc.preprocessor_definitions["InfluxDB_EXPORTS"] = 1 + tc.generate() + deps = CMakeDeps(self) + deps.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")) + + def package_info(self): + self.cpp_info.libs = ["InfluxDB"] + + self.cpp_info.set_property("cmake_file_name", "InfluxDB") + self.cpp_info.set_property("cmake_target_name", "InfluxData::InfluxDB") diff --git a/recipes/influxdb-cxx/all/test_package/CMakeLists.txt b/recipes/influxdb-cxx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f8068d41fdb4 --- /dev/null +++ b/recipes/influxdb-cxx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(InfluxDB REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(test_package PRIVATE InfluxData::InfluxDB) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/influxdb-cxx/all/test_package/conanfile.py b/recipes/influxdb-cxx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/influxdb-cxx/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/influxdb-cxx/all/test_package/test_package.cpp b/recipes/influxdb-cxx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e91f55ee908cc --- /dev/null +++ b/recipes/influxdb-cxx/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include + +int main() +{ + try { + auto influxdb = influxdb::InfluxDBFactory::Get("xyz://foobar"); + } + catch(influxdb::InfluxDBException& e) { + + } + + std::cout << "Influxdb-cxx test package successful\n"; + return 0; +} diff --git a/recipes/influxdb-cxx/config.yml b/recipes/influxdb-cxx/config.yml new file mode 100644 index 0000000000000..eb766ff2f024b --- /dev/null +++ b/recipes/influxdb-cxx/config.yml @@ -0,0 +1,3 @@ +versions: + "0.7.2": + folder: all diff --git a/recipes/inih/all/conandata.yml b/recipes/inih/all/conandata.yml index d0684466616d8..0df8fee5d2fee 100644 --- a/recipes/inih/all/conandata.yml +++ b/recipes/inih/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "58": + url: "https://github.com/benhoyt/inih/archive/r58.tar.gz" + sha256: "e79216260d5dffe809bda840be48ab0eec7737b2bb9f02d2275c1b46344ea7b7" "57": url: "https://github.com/benhoyt/inih/archive/r57.tar.gz" sha256: "f03f98ca35c3adb56b2358573c8d3eda319ccd5287243d691e724b7eafa970b3" diff --git a/recipes/inih/all/test_package/CMakeLists.txt b/recipes/inih/all/test_package/CMakeLists.txt index 6c1fdbf05ad25..9f847a934c023 100644 --- a/recipes/inih/all/test_package/CMakeLists.txt +++ b/recipes/inih/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(inih CONFIG REQUIRED) diff --git a/recipes/inih/all/test_v1_package/CMakeLists.txt b/recipes/inih/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/inih/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/inih/all/test_v1_package/conanfile.py b/recipes/inih/all/test_v1_package/conanfile.py deleted file mode 100644 index 5e82a4d078b63..0000000000000 --- a/recipes/inih/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -from conans import ConanFile, CMake, tools -import os -import textwrap - - -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): - with open("test.ini", "w") as fn: - fn.write(textwrap.dedent("""\ - [protocol] - version = 1337 - [user] - name = conan-center-index - email = info@conan.io - """)) - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/inih/config.yml b/recipes/inih/config.yml index c64487db679f8..b228120159954 100644 --- a/recipes/inih/config.yml +++ b/recipes/inih/config.yml @@ -1,4 +1,6 @@ versions: + "58": + folder: "all" "57": folder: "all" "56": diff --git a/recipes/inipp/all/conandata.yml b/recipes/inipp/all/conandata.yml new file mode 100644 index 0000000000000..64126a2c14163 --- /dev/null +++ b/recipes/inipp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.12": + url: "https://github.com/mcmtroffaes/inipp/archive/refs/tags/1.0.12.tar.gz" + sha256: "e37833ab689c7b38de09b1923635b131f80db42e9b22f37d88ae4d74a7cd3e78" diff --git a/recipes/inipp/all/conanfile.py b/recipes/inipp/all/conanfile.py new file mode 100644 index 0000000000000..8d2aa4480c81c --- /dev/null +++ b/recipes/inipp/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 InippConan(ConanFile): + name = "inipp" + description = "Simple C++ ini parser." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mcmtroffaes/inipp" + topics = ("ini", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + # inipp requires `deduced return type` which is provided in C++14 + return 14 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "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.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", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + os.path.join(self.source_folder, "inipp"), + 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", "inipp") + self.cpp_info.set_property("cmake_target_name", "inipp::inipp") diff --git a/recipes/inipp/all/test_package/CMakeLists.txt b/recipes/inipp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8b6037a46e4cd --- /dev/null +++ b/recipes/inipp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(inipp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE inipp::inipp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/inipp/all/test_package/conanfile.py b/recipes/inipp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/inipp/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/inipp/all/test_package/test_package.cpp b/recipes/inipp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..cb8defcfdd28d --- /dev/null +++ b/recipes/inipp/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include "inipp.h" + +int main() { + inipp::Ini ini; + ini.generate(std::cout); + + ini.default_section(ini.sections["DEFAULT"]); + ini.interpolate(); + ini.generate(std::cout); + + return 0; +} diff --git a/recipes/inipp/config.yml b/recipes/inipp/config.yml new file mode 100644 index 0000000000000..81d603cb239b7 --- /dev/null +++ b/recipes/inipp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.12": + folder: all diff --git a/recipes/inja/all/test_package/CMakeLists.txt b/recipes/inja/all/test_package/CMakeLists.txt index 493c014fdc1c8..e5ed7f21b6715 100644 --- a/recipes/inja/all/test_package/CMakeLists.txt +++ b/recipes/inja/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(inja REQUIRED CONFIG) diff --git a/recipes/inja/all/test_v1_package/CMakeLists.txt b/recipes/inja/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b4b25bff2f0cd..0000000000000 --- a/recipes/inja/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/inja/all/test_v1_package/conanfile.py b/recipes/inja/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/inja/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_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/innoextract/all/conandata.yml b/recipes/innoextract/all/conandata.yml index a280c970476d1..483273e3d6496 100644 --- a/recipes/innoextract/all/conandata.yml +++ b/recipes/innoextract/all/conandata.yml @@ -8,3 +8,7 @@ patches: "1.9.0": - patch_file: "patches/0001-cmake-fix-module.patch" - patch_file: "patches/0002-remove-custom-cmake-find-modules.patch" + - patch_file: "patches/0003-fix-boost-1_85-usage.patch" + patch_description: "Fix Boost 1.85 usage" + patch_type: "backport" + patch_source: "https://github.com/dscharrer/innoextract/pull/169" diff --git a/recipes/innoextract/all/conanfile.py b/recipes/innoextract/all/conanfile.py index c21ccf578684a..e7d45a15758c6 100644 --- a/recipes/innoextract/all/conanfile.py +++ b/recipes/innoextract/all/conanfile.py @@ -1,20 +1,22 @@ +import os + from conan import ConanFile -from conan.tools.files import get, rmdir, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.build import check_max_cppstd from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain from conan.tools.env import VirtualBuildEnv -import os +from conan.tools.files import get, rmdir, copy, apply_conandata_patches, export_conandata_patches, rm - -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.0" class InnoextractConan(ConanFile): name = "innoextract" description = "Extract contents of Inno Setup installers" - license = "LicenseRef-LICENSE" + license = "Zlib" topics = ("inno-setup", "decompression") homepage = "https://constexpr.org/innoextract" url = "https://github.com/conan-io/conan-center-index" + package_type = "application" settings = "os", "arch", "compiler", "build_type" def export_sources(self): @@ -24,17 +26,18 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.80.0") - self.requires("xz_utils/5.2.5") + self.requires("boost/1.85.0") + self.requires("xz_utils/[>=5.4.5 <6]") self.requires("libiconv/1.17") + def validate(self): + check_max_cppstd(self, "14") + def package_id(self): del self.info.settings.compiler - self.info.requires.clear() 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): env = VirtualBuildEnv(self) @@ -51,14 +54,14 @@ def generate(self): def build(self): apply_conandata_patches(self) - os.remove(os.path.join(self.source_folder, 'cmake', 'FindLZMA.cmake')) - os.remove(os.path.join(self.source_folder, 'cmake', 'Findiconv.cmake')) + rm(self, "FindLZMA.cmake", os.path.join(self.source_folder, "cmake")) + rm(self, "Findiconv.cmake", os.path.join(self.source_folder, "cmake")) 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, "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")) @@ -66,6 +69,3 @@ def package(self): def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] - bindir = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bindir}") - self.env_info.PATH.append(bindir) diff --git a/recipes/innoextract/all/patches/0003-fix-boost-1_85-usage.patch b/recipes/innoextract/all/patches/0003-fix-boost-1_85-usage.patch new file mode 100644 index 0000000000000..c975532bd4744 --- /dev/null +++ b/recipes/innoextract/all/patches/0003-fix-boost-1_85-usage.patch @@ -0,0 +1,24 @@ +From 264c2fe6b84f90f6290c670e5f676660ec7b2387 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= +Date: Thu, 28 Mar 2024 15:11:40 +0100 +Subject: [PATCH] Fix build with boost 1.85 + +As of boost 1.85-beta1, boost/filesystem/directory.hpp is no longer +implicitly included by boost/filesystem/operations.hpp. Include it +explicitly. +--- + src/stream/slice.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/stream/slice.cpp b/src/stream/slice.cpp +index 12468a38..f7ebe0e5 100644 +--- a/src/stream/slice.cpp ++++ b/src/stream/slice.cpp +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + + #include "util/console.hpp" \ No newline at end of file diff --git a/recipes/innoextract/all/test_v1_package/conanfile.py b/recipes/innoextract/all/test_v1_package/conanfile.py deleted file mode 100644 index dc77b21f20519..0000000000000 --- a/recipes/innoextract/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -from six import StringIO -from conans import ConanFile, tools - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "build_type", "compiler" - - def test(self): - if not tools.cross_building(self): - output = StringIO() - self.run("innoextract --version", output=output, - run_environment=True) - output_str = str(output.getvalue()) - self.output.info("Installed version: {}".format(output_str)) - require_version = str(self.deps_cpp_info["innoextract"].version) - require_version = ".".join(require_version.split(".")[:2]) - self.output.info("Expected version: {}".format(require_version)) - assert_innoextract_version = "innoextract %s" % require_version - assert(assert_innoextract_version in output_str) diff --git a/recipes/intel-ipsec-mb/all/conandata.yml b/recipes/intel-ipsec-mb/all/conandata.yml new file mode 100644 index 0000000000000..d898ee0ccba2f --- /dev/null +++ b/recipes/intel-ipsec-mb/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.4": + url: "https://github.com/intel/intel-ipsec-mb/archive/refs/tags/v1.4.tar.gz" + sha256: "b441b3ecf0a9fe69ff675f2eb9fe4d1304814558a8f15f5617638ddc99e05873" +patches: + "1.4": + - patch_file: "patches/0001-unix-fpic.patch" + patch_description: "Do not enforce fPIC flag always" + patch_type: "conan" + - patch_file: "patches/0002-install-windows.patch" + patch_description: "Do not enforce Windows folders path when installing" + patch_type: "conan" diff --git a/recipes/intel-ipsec-mb/all/conanfile.py b/recipes/intel-ipsec-mb/all/conanfile.py new file mode 100644 index 0000000000000..4e9e314b05c43 --- /dev/null +++ b/recipes/intel-ipsec-mb/all/conanfile.py @@ -0,0 +1,104 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, Environment +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.53.0" + + +class PackageConan(ConanFile): + name = "intel-ipsec-mb" + description = "Intel(R) Multi-Buffer Crypto for IPSec" + license = "BSD-3-Clause" + homepage = "https://github.com/intel/intel-ipsec-mb" + url = "https://github.com/conan-io/conan-center-index" + topics = ("intel", "ipsec", "crypto", "security") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _cmake_target(self): + return "libIPSec_MB" if is_msvc(self) else "IPSec_MB" + + @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: + 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 ("FreeBSD", "Linux", "Windows"): + raise ConanInvalidConfiguration(f"{self.ref} does not support the O.S. {self.settings.os}.") + + def build_requirements(self): + self.tool_requires("nasm/2.15.05") + self.tool_requires("cmake/[>3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + # INFO: Conan 1.x does not find nasm package automatically due PATH priority. + nasm_bin_folder = os.path.join(self.dependencies.direct_build["nasm"].package_folder, "bin").replace("\\", "/") + nasm_path = os.path.join(nasm_bin_folder, "nasm").replace("\\", "/") + env = Environment() + env.define("AS", nasm_path) + env.prepend("PATH", nasm_bin_folder) + envvars = env.vars(self, scope="build") + envvars.save_script("asm_configuration") + + env = VirtualBuildEnv(self) + env.generate(scope="build") + tc = CMakeToolchain(self) + # INFO: intel-ipsec-mb project forces shared by default. + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + # INFO: When running on Linux, uses /usr/bin/nasm in case no enforced + if self._settings_build.os == "Linux": + tc.cache_variables["CMAKE_ASM_NASM_COMPILER"] = nasm_path + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build(target=self._cmake_target) + + def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "intel-ipsec-mb.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "lib"), keep_path=False) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "man")) + rmdir(self, os.path.join(self.package_folder, "intel-ipsec-mb")) + + def package_info(self): + self.cpp_info.libs = [self._cmake_target] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/intel-ipsec-mb/all/patches/0001-unix-fpic.patch b/recipes/intel-ipsec-mb/all/patches/0001-unix-fpic.patch new file mode 100644 index 0000000000000..b4684f31ccc0b --- /dev/null +++ b/recipes/intel-ipsec-mb/all/patches/0001-unix-fpic.patch @@ -0,0 +1,13 @@ +diff --git a/lib/cmake/unix.cmake b/lib/cmake/unix.cmake +index 78aafae..d94297c 100644 +--- a/lib/cmake/unix.cmake ++++ b/lib/cmake/unix.cmake +@@ -38,7 +38,7 @@ string(APPEND CMAKE_ASM_NASM_FLAGS + + # set C compiler flags + set(CMAKE_C_FLAGS +- "-fPIC -W -Wall -Wextra -Wmissing-declarations \ ++ "-W -Wall -Wextra -Wmissing-declarations \ + -Wpointer-arith -Wcast-qual -Wundef -Wwrite-strings -Wformat \ + -Wformat-security -Wunreachable-code -Wmissing-noreturn \ + -Wsign-compare -Wno-endif-labels -Wstrict-prototypes \ diff --git a/recipes/intel-ipsec-mb/all/patches/0002-install-windows.patch b/recipes/intel-ipsec-mb/all/patches/0002-install-windows.patch new file mode 100644 index 0000000000000..ddaeab8b5f130 --- /dev/null +++ b/recipes/intel-ipsec-mb/all/patches/0002-install-windows.patch @@ -0,0 +1,36 @@ +diff --git a/lib/cmake/windows.cmake b/lib/cmake/windows.cmake +index 02d39a1..0647029 100644 +--- a/lib/cmake/windows.cmake ++++ b/lib/cmake/windows.cmake +@@ -93,27 +93,18 @@ endif() + add_library(${LIB} ${SRC_FILES_ASM} ${SRC_FILES_C} ${SRC_DEF_FILE}) + + # set install rules +-set(CMAKE_INSTALL_PREFIX "c:/Program Files" +- CACHE STRING "Set default installation directory" FORCE) + install(TARGETS ${LIB} +- DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_NAME}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ++ LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) ++ + install(FILES + ${IMB_HDR} + ${SRC_DEF_FILE} + DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_NAME}) +-if(BUILD_SHARED_LIBS) +- install(FILES +- $/${LIB}.exp +- $/${LIB}.pdb +- DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_NAME}) +- install(FILES +- $/${LIB}.dll +- DESTINATION $ENV{WINDIR}/system32) +-endif() + + execute_process( + COMMAND cmd /C ${GEN_DEF_FILE_CMD} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_QUIET + ) +- diff --git a/recipes/intel-ipsec-mb/all/test_package/CMakeLists.txt b/recipes/intel-ipsec-mb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..094c6cf883fd7 --- /dev/null +++ b/recipes/intel-ipsec-mb/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +find_package(intel-ipsec-mb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE intel-ipsec-mb::intel-ipsec-mb) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/intel-ipsec-mb/all/test_package/conanfile.py b/recipes/intel-ipsec-mb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/intel-ipsec-mb/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/intel-ipsec-mb/all/test_package/test_package.c b/recipes/intel-ipsec-mb/all/test_package/test_package.c new file mode 100644 index 0000000000000..231c42793f295 --- /dev/null +++ b/recipes/intel-ipsec-mb/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include "intel-ipsec-mb.h" + +#include +#include + +int main() { + const char * version = NULL; + + version = imb_get_version_str(); + printf("Intel IPSec MB Version: %s\n", version); + + return EXIT_SUCCESS; +} diff --git a/recipes/intel-ipsec-mb/config.yml b/recipes/intel-ipsec-mb/config.yml new file mode 100644 index 0000000000000..49afec8b671eb --- /dev/null +++ b/recipes/intel-ipsec-mb/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4": + folder: all diff --git a/recipes/intel-neon2sse/all/test_package/CMakeLists.txt b/recipes/intel-neon2sse/all/test_package/CMakeLists.txt index 959db15bea23b..68f99bfec5255 100644 --- a/recipes/intel-neon2sse/all/test_package/CMakeLists.txt +++ b/recipes/intel-neon2sse/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(NEON_2_SSE REQUIRED CONFIG) diff --git a/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt b/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/intel-neon2sse/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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/conandata.yml b/recipes/intx/all/conandata.yml index 82ca4023ed3e5..5e7cb7a5f366d 100644 --- a/recipes/intx/all/conandata.yml +++ b/recipes/intx/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.12.0": + url: "https://github.com/chfast/intx/archive/v0.12.0.tar.gz" + sha256: "d68ff5dde9a2f340c73be67888f3f72bb18a2ad30aa16cd663ec3bc611afc9b4" + "0.11.0": + url: "https://github.com/chfast/intx/archive/v0.11.0.tar.gz" + sha256: "bff2a78e3a9a3b9bbabf50500feae65bc0ec50a2364f4a83768277d6eba7a844" "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 index fcbc0174dcfbb..813526a90e8a3 100644 --- a/recipes/intx/all/conanfile.py +++ b/recipes/intx/all/conanfile.py @@ -17,14 +17,12 @@ class IntxConan(ConanFile): topics = ("evm", "biginteger", "arbitrary-precision", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): return 20 - def layout(self): - basic_layout(self, src_folder="src") - @property def _compilers_minimum_version(self): return { @@ -35,13 +33,15 @@ def _compilers_minimum_version(self): "apple-clang": "14.1", } + 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"): + 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( @@ -63,3 +63,6 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "intx") + self.cpp_info.set_property("cmake_target_name", "intx::intx") diff --git a/recipes/intx/all/test_package/CMakeLists.txt b/recipes/intx/all/test_package/CMakeLists.txt index 460d6198ba06f..221c217e60e74 100644 --- a/recipes/intx/all/test_package/CMakeLists.txt +++ b/recipes/intx/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(intx REQUIRED CONFIG) diff --git a/recipes/intx/all/test_v1_package/CMakeLists.txt b/recipes/intx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9652e22fc19d5..0000000000000 --- a/recipes/intx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/intx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/intx/config.yml b/recipes/intx/config.yml index 36cf695df0df6..85ca9aa067b7a 100644 --- a/recipes/intx/config.yml +++ b/recipes/intx/config.yml @@ -1,3 +1,7 @@ versions: + "0.12.0": + folder: all + "0.11.0": + folder: all "0.10.1": folder: all diff --git a/recipes/inversify-cpp/all/test_v1_package/CMakeLists.txt b/recipes/inversify-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/inversify-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/inversify-cpp/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", "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 index 3dc81fcb10588..047330d4f8fd9 100644 --- a/recipes/iowow/all/conandata.yml +++ b/recipes/iowow/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.18": + url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.18.tar.gz" + sha256: "ef4ee56dd77ce326fff25b6f41e7d78303322cca3f11cf5683ce9abfda34faf9" "1.4.17": url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.17.tar.gz" sha256: "13a851026dbc1f31583fba96986e86e94a7554f9e7d38aa12a9ea5dbebdf328b" @@ -6,6 +9,10 @@ sources: url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.16.tar.gz" sha256: "6e3b92b6c342ef6ef4a2731ca2d43368749d66ca876b24b773587364cff01003" patches: + "1.4.18": + - patch_file: "patches/1.4.18-0002-fix-uint64_t-format.patch" + patch_description: "fix uint64_t printf format" + patch_type: "portability" "1.4.17": - patch_file: "patches/1.4.16-0002-fix-uint64_t-format.patch" patch_description: "fix uint64_t printf format" diff --git a/recipes/iowow/all/patches/1.4.18-0002-fix-uint64_t-format.patch b/recipes/iowow/all/patches/1.4.18-0002-fix-uint64_t-format.patch new file mode 100644 index 0000000000000..3253bb3ff1bdd --- /dev/null +++ b/recipes/iowow/all/patches/1.4.18-0002-fix-uint64_t-format.patch @@ -0,0 +1,13 @@ +diff --git a/src/fs/iwfsmfile.c b/src/fs/iwfsmfile.c +index 2d1452a..121e989 100644 +--- a/src/fs/iwfsmfile.c ++++ b/src/fs/iwfsmfile.c +@@ -1339,7 +1339,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/config.yml b/recipes/iowow/config.yml index 764e66b7855a6..c30ae14aca332 100644 --- a/recipes/iowow/config.yml +++ b/recipes/iowow/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.18": + folder: all "1.4.17": folder: all "1.4.16": diff --git a/recipes/ipaddress/all/conandata.yml b/recipes/ipaddress/all/conandata.yml new file mode 100644 index 0000000000000..d240c4e40fdaf --- /dev/null +++ b/recipes/ipaddress/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.2.0": + url: "https://github.com/VladimirShaleev/ipaddress/archive/v1.2.0.tar.gz" + sha256: "c3a52e5297d8f0b152c13b04ea2aead0bb9bc2a963188d740d87c78e770daba1" + "1.1.0": + url: "https://github.com/VladimirShaleev/ipaddress/archive/v1.1.0.tar.gz" + sha256: "e5084d83ebd712210882eb6dac14ed1b9b71584dede523b35c6181e0a06375f1" + "1.0.1": + url: "https://github.com/VladimirShaleev/ipaddress/archive/v1.0.1.tar.gz" + sha256: "49c16294f06fe95ffc66cae828dc08d116efb4a1ede3dddd21dcc182a2eceb03" diff --git a/recipes/ipaddress/all/conanfile.py b/recipes/ipaddress/all/conanfile.py new file mode 100644 index 0000000000000..1bdda098db7d5 --- /dev/null +++ b/recipes/ipaddress/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.52.0" + + +class IpAddressConan(ConanFile): + name = "ipaddress" + description = "A library for working and manipulating IPv4/IPv6 addresses and networks" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/VladimirShaleev/ipaddress" + topics = ("ipv4", "ipv6", "ipaddress", "ip", "network", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + options = { + "exceptions": [True, False], + "overload_std": [True, False], + "ipv6_scope": [True, False], + "ipv6_scope_max_length": ["ANY"], + } + default_options = { + "exceptions": True, + "overload_std": True, + "ipv6_scope": True, + "ipv6_scope_max_length": 16, + } + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "13.0", + "clang": "6.0", + "gcc": "7.5", + "msvc": "192", + "Visual Studio": "16", + } + + 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} doesn't support {self.settings.compiler} < {minimum_version}" + ) + + 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, + "*.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 not self.options.exceptions: + self.cpp_info.defines.append("IPADDRESS_NO_EXCEPTIONS") + if not self.options.overload_std: + self.cpp_info.defines.append("IPADDRESS_NO_OVERLOAD_STD") + if not self.options.ipv6_scope: + self.cpp_info.defines.append("IPADDRESS_NO_IPV6_SCOPE") + else: + self.cpp_info.defines.append(f"IPADDRESS_IPV6_SCOPE_MAX_LENGTH={int(self.options.ipv6_scope_max_length)}") diff --git a/recipes/ipaddress/all/test_package/CMakeLists.txt b/recipes/ipaddress/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f9368cb4ca108 --- /dev/null +++ b/recipes/ipaddress/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ipaddress CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ipaddress::ipaddress) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ipaddress/all/test_package/conanfile.py b/recipes/ipaddress/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/ipaddress/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/ipaddress/all/test_package/test_package.cpp b/recipes/ipaddress/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1e0a4a4597eaf --- /dev/null +++ b/recipes/ipaddress/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include +#include "ipaddress/ipaddress.hpp" + + +int main(void) { + auto ip = ipaddress::ipv6_address::parse("fec0::1ff:fe23:4567:890a%eth2"); + std::cout << "Parsing ipv6: " << ip << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/ipaddress/config.yml b/recipes/ipaddress/config.yml new file mode 100644 index 0000000000000..be97eb7c8428b --- /dev/null +++ b/recipes/ipaddress/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/iphreeqc/all/conandata.yml b/recipes/iphreeqc/all/conandata.yml new file mode 100644 index 0000000000000..a249b379218dd --- /dev/null +++ b/recipes/iphreeqc/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "3.8.1": + url: "https://github.com/usgs-coupled/iphreeqc/releases/download/v3.8.1/iphreeqc-3.8.1-16963.tar.gz" + sha256: "15c47959a25e6c8b5d0c47214ea0c3f3626257dacc24a89d0f9c9635186c375c" +patches: + "3.8.1": + - patch_file: "patches/3.8.1-0001-dont-build-examples-doc-database.patch" + patch_description: "Don't build examples, doc and database" + patch_type: "conan" diff --git a/recipes/iphreeqc/all/conanfile.py b/recipes/iphreeqc/all/conanfile.py new file mode 100644 index 0000000000000..84c2b765e8d90 --- /dev/null +++ b/recipes/iphreeqc/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +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, rmdir +from conan.tools.microsoft import msvc_runtime_flag +import os + +required_conan_version = ">=1.54.0" + + +class IphreeqcConan(ConanFile): + name = "iphreeqc" + description = ( + "Library implementing the geochemical model PHREEQC. It is capable of " + "simulating a wide range of equilibrium reactions between water and " + "minerals, ion exchangers, surface complexes, solid solutions, and gases." + ) + license = "FSFUL" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.usgs.gov/software/phreeqc-version-3" + topics = ("geochemistry", "modeling") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_cl_like(self): + return self.settings.compiler.get_safe("runtime") is not None + + @property + def _is_cl_like_static_runtime(self): + return self._is_cl_like and "MT" in msvc_runtime_flag(self) + + 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 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) + if self._is_cl_like: + tc.variables["IPHREEQC_STATIC_RUNTIME"] = self._is_cl_like_static_runtime + tc.variables["IPHREEQC_ENABLE_MODULE"] = False + tc.variables["IPHREEQC_FORTRAN_TESTING"] = False + tc.variables["BUILD_CLR_LIBS"] = False + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "INSTALL", 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, "src")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "IPhreeqc") + self.cpp_info.set_property("cmake_target_name", "IPhreeqc::IPhreeqc") + postfix = "" + if self.settings.build_type == "Debug": + postfix += "d" + elif self.settings.build_type == "MinSizeRel": + postfix += "msr" + elif self.settings.build_type == "RelWithDebInfo": + postfix += "rwd" + self.cpp_info.libs = [f"IPhreeqc{postfix}"] + self.cpp_info.defines.append("IPHREEQC_NO_FORTRAN_MODULE") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/iphreeqc/all/patches/3.8.1-0001-dont-build-examples-doc-database.patch b/recipes/iphreeqc/all/patches/3.8.1-0001-dont-build-examples-doc-database.patch new file mode 100644 index 0000000000000..3704fa470a6a6 --- /dev/null +++ b/recipes/iphreeqc/all/patches/3.8.1-0001-dont-build-examples-doc-database.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -400,7 +400,7 @@ endif() + + include (CTest) + +-if (STANDALONE_BUILD) ++if (0) + + add_subdirectory(database) + add_subdirectory(doc) diff --git a/recipes/iphreeqc/all/test_package/CMakeLists.txt b/recipes/iphreeqc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..13618cfaf693e --- /dev/null +++ b/recipes/iphreeqc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(IPhreeqc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE IPhreeqc::IPhreeqc) diff --git a/recipes/iphreeqc/all/test_package/conanfile.py b/recipes/iphreeqc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/iphreeqc/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/iphreeqc/all/test_package/test_package.c b/recipes/iphreeqc/all/test_package/test_package.c new file mode 100644 index 0000000000000..f29ed23c37243 --- /dev/null +++ b/recipes/iphreeqc/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +int main() +{ + int id = CreateIPhreeqc(); + DestroyIPhreeqc(id); + return 0; +} diff --git a/recipes/iphreeqc/config.yml b/recipes/iphreeqc/config.yml new file mode 100644 index 0000000000000..f3cf585c380d6 --- /dev/null +++ b/recipes/iphreeqc/config.yml @@ -0,0 +1,3 @@ +versions: + "3.8.1": + folder: all diff --git a/recipes/iqa/all/test_v1_package/CMakeLists.txt b/recipes/iqa/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/iqa/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 54e4743603cf3..0000000000000 --- a/recipes/iqa/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/irrxml/all/CMakeLists.txt b/recipes/irrxml/all/CMakeLists.txt index f6e0593393ea8..3b2dd38e0b02c 100644 --- a/recipes/irrxml/all/CMakeLists.txt +++ b/recipes/irrxml/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(IrrXML LANGUAGES CXX) include(GNUInstallDirs) diff --git a/recipes/irrxml/all/test_package/CMakeLists.txt b/recipes/irrxml/all/test_package/CMakeLists.txt index 6dc6a05d353a3..9f92c200bcabc 100644 --- a/recipes/irrxml/all/test_package/CMakeLists.txt +++ b/recipes/irrxml/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(irrxml REQUIRED CONFIG) diff --git a/recipes/irrxml/all/test_v1_package/CMakeLists.txt b/recipes/irrxml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/irrxml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/irrxml/all/test_v1_package/conanfile.py b/recipes/irrxml/all/test_v1_package/conanfile.py deleted file mode 100644 index 433191cd50991..0000000000000 --- a/recipes/irrxml/all/test_v1_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 = os.path.join("bin", "test_package") - xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "config.xml") - self.run(f"{bin_path} {xml_path}", run_environment=True) diff --git a/recipes/isa-l/all/conanfile.py b/recipes/isa-l/all/conanfile.py index 09af37c4cc900..de6e6376e8a4f 100644 --- a/recipes/isa-l/all/conanfile.py +++ b/recipes/isa-l/all/conanfile.py @@ -2,8 +2,9 @@ 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 chdir, collect_libs, copy, get, replace_in_file +from conan.tools.files import chdir, 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 @@ -29,6 +30,10 @@ class LibisalConan(ConanFile): "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 @@ -45,13 +50,17 @@ def layout(self): 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": + if self.version == "2.30.0" and self._settings_build.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": + if not is_msvc(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], strip_root=True) @@ -102,6 +111,12 @@ def package(self): dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + 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", "libisal") + if is_msvc(self): + suffix = "" if self.options.shared else "_static" + self.cpp_info.libs = [f"isa-l{suffix}"] + else: + self.cpp_info.libs = ["isal"] diff --git a/recipes/isa-l/all/test_v1_package/CMakeLists.txt b/recipes/isa-l/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/isa-l/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 9d2678d8486a0..0000000000000 --- a/recipes/isa-l/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/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/isl/all/conandata.yml b/recipes/isl/all/conandata.yml index cf2c5f3fb54ee..525debaa9344b 100644 --- a/recipes/isl/all/conandata.yml +++ b/recipes/isl/all/conandata.yml @@ -1,10 +1,15 @@ sources: + "0.26": + url: "https://libisl.sourceforge.io/isl-0.26.tar.xz" + sha256: "a0b5cb06d24f9fa9e77b55fabbe9a3c94a336190345c2555f9915bb38e976504" + "0.25": + url: "https://libisl.sourceforge.io/isl-0.25.tar.xz" + sha256: "be7b210647ccadf90a2f0b000fca11a4d40546374a850db67adb32fad4b230d9" "0.24": - url: "https://libisl.sourceforge.io/isl-0.24.tar.gz" - sha256: "26e6e4d60ad59b3fff9948eb36743f0c874e124e410ef5bab930d0f546bc580d" - "0.23": - url: "https://libisl.sourceforge.io/isl-0.23.tar.gz" - sha256: "19e77cb562ab3da5a37f263208d6f902ae3a9d52c756bf6eb1a6b2f8a74b883c" - "0.22": - url: "https://libisl.sourceforge.io/isl-0.22.tar.gz" - sha256: "d0c6714e4427d3eb964388afe526a8e0f69687da7e944f1ad66ffa639923be46" + url: "https://libisl.sourceforge.io/isl-0.24.tar.xz" + sha256: "043105cc544f416b48736fff8caf077fb0663a717d06b1113f16e391ac99ebad" +patches: + "0.24": + - patch_file: "patches/0.24-0001-fix-ac_test_cflags.patch" + patch_description: "Fix ac_test_CFLAGS logic error" + patch_type: "portability" diff --git a/recipes/isl/all/conanfile.py b/recipes/isl/all/conanfile.py index 139d5fc0036f3..892a970bf8f60 100644 --- a/recipes/isl/all/conanfile.py +++ b/recipes/isl/all/conanfile.py @@ -1,9 +1,15 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from contextlib import contextmanager +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.files import copy, get, rm, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, check_min_vs, unix_path, is_msvc_static_runtime +from conan.tools.scm import Version import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.58.0" class IslConan(ConanFile): @@ -13,23 +19,24 @@ class IslConan(ConanFile): license = "MIT" homepage = "https://libisl.sourceforge.io" 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], "with_int": ["gmp", "imath", "imath-32"], + "autogen": [True, False], } default_options = { "shared": False, "fPIC": True, "with_int": "gmp", + "autogen": False, } - _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": @@ -37,97 +44,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.libcxx") + self.settings.rm_safe("compiler.cppstd") def validate(self): if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration("Cannot build shared isl library on Windows (due to libtool refusing to link to static/import libraries)") - if self.settings.os == "Macos" and self.settings.arch == "armv8": - raise ConanInvalidConfiguration("Apple M1 is not yet supported. Contributions are welcome") - if self.options.with_int != "gmp": - # FIXME: missing imath recipe - raise ConanInvalidConfiguration("imath is not (yet) available on cci") - if self.settings.compiler == "Visual Studio" and tools.Version(self.settings.compiler.version) < 16 and self.settings.compiler.runtime == "MDd": + if Version(self.version) < "0.25" and is_apple_os(self) and cross_building(self): + raise ConanInvalidConfiguration("Cross-building with Apple Clang is not supported yet") + if msvc_runtime_flag(self) == "MDd" and not check_min_vs(self, 192, raise_invalid=False): + # isl fails to link with this version of visual studio and MDd runtime: # gmp.lib(bdiv_dbm1c.obj) : fatal error LNK1318: Unexpected PDB error; OK (0) - raise ConanInvalidConfiguration("isl fails to link with this version of visual studio and MDd runtime") + raise ConanInvalidConfiguration("isl cannot be built with MDd runtime with MSVC < 192") def requirements(self): if self.options.with_int == "gmp": - self.requires("gmp/6.2.1") + self.requires("gmp/6.3.0") + elif self.options.with_int == "imath": + self.requires("imath/3.1.9") @property def _settings_build(self): return getattr(self, "settings_build", self.settings) 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.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 self.options.autogen: + self.tool_requires("autoconf/2.71") + self.tool_requires("automake/1.16.5") + self.tool_requires("libtool/2.4.7") + + def package_id(self): + del self.info.options.autogen + + def layout(self): + basic_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - 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), self.settings.compiler.runtime), - "CXX": "{} cl -nologo -{}".format(tools.unix_path(self.deps_user_info["automake"].compile), self.settings.compiler.runtime), - "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 = [] - yes_no = lambda v: "yes" if v else "no" - conf_args = [ - "--with-int={}".format(self.options.with_int), - "--enable-portable-binary", - "--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.append(f'--with-int={self.options.with_int}') + tc.configure_args.append("--enable-portable-binary") if self.options.with_int == "gmp": - conf_args.extend([ - "--with-gmp=system", - "--with-gmp-prefix={}".format(self.deps_cpp_info["gmp"].rootpath.replace("\\", "/")), - ]) - if self.settings.compiler == "Visual Studio": - if tools.Version(self.settings.compiler.version) >= 15: - self._autotools.flags.append("-Zf") - if tools.Version(self.settings.compiler.version) >= 12: - self._autotools.flags.append("-FS") - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + tc.configure_args.append("--with-gmp=system") + tc.configure_args.append(f'--with-gmp-prefix={unix_path(self, self.dependencies["gmp"].package_folder)}') + if is_msvc(self): + if check_min_vs(self, 191, raise_invalid=False): + tc.extra_cflags = ["-Zf"] + if check_min_vs(self, 180, raise_invalid=False): + tc.extra_cflags = ["-FS"] + if is_msvc(self) and self.version == "0.24" and not is_msvc_static_runtime(self): + # Pass BUILD flags to avoid confusion with GCC and mixing of runtime variants + tc.configure_args += ['CC_FOR_BUILD=cl -nologo', f'CFLAGS_FOR_BUILD=-{msvc_runtime_flag(self)}'] + env = tc.environment() + if is_msvc(self): + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + tc.generate(env) def build(self): - with self._build_context(): - autotools = self._configure_autotools() - autotools.make() + if self.options.autogen: + apply_conandata_patches(self) # Currently, the only patch is for the autogen use case + self.run("./autogen.sh", cwd=self.source_folder) + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() - - os.unlink(os.path.join(os.path.join(self.package_folder, "lib", "libisl.la"))) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", os.path.join(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.names["pkg_config"] = "isl" + self.cpp_info.set_property("pkg_config_name", "isl") self.cpp_info.libs = ["isl"] diff --git a/recipes/isl/all/patches/0.24-0001-fix-ac_test_cflags.patch b/recipes/isl/all/patches/0.24-0001-fix-ac_test_cflags.patch new file mode 100644 index 0000000000000..ac347c50759b3 --- /dev/null +++ b/recipes/isl/all/patches/0.24-0001-fix-ac_test_cflags.patch @@ -0,0 +1,11 @@ +--- m4/ax_cc_maxopt.m4 ++++ m4/ax_cc_maxopt.m4 +@@ -65,7 +65,7 @@ + acx_maxopt_portable=$withval, acx_maxopt_portable=no) + + # Try to determine "good" native compiler flags if none specified via CFLAGS +-if test "$ac_test_CFLAGS" != "set"; then ++if test "x$ac_test_CFLAGS" = "x"; then + CFLAGS="" + case $ax_cv_c_compiler_vendor in + dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" diff --git a/recipes/isl/all/test_package/CMakeLists.txt b/recipes/isl/all/test_package/CMakeLists.txt index 3a403dc404b41..c02d0f7c344fd 100644 --- a/recipes/isl/all/test_package/CMakeLists.txt +++ b/recipes/isl/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(isl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE isl::isl) diff --git a/recipes/isl/all/test_package/conanfile.py b/recipes/isl/all/test_package/conanfile.py index bd7165a553cf4..7b760066c7165 100644 --- a/recipes/isl/all/test_package/conanfile.py +++ b/recipes/isl/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 cross_building 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 +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 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/isl/config.yml b/recipes/isl/config.yml index e0fa5e44a1f96..ae426ef703a32 100644 --- a/recipes/isl/config.yml +++ b/recipes/isl/config.yml @@ -1,7 +1,7 @@ versions: - "0.24": + "0.26": folder: "all" - "0.23": + "0.25": folder: "all" - "0.22": + "0.24": folder: "all" diff --git a/recipes/iso8601lib/all/test_package/CMakeLists.txt b/recipes/iso8601lib/all/test_package/CMakeLists.txt index 1b48f1b1d59ba..5cd831b886e5c 100644 --- a/recipes/iso8601lib/all/test_package/CMakeLists.txt +++ b/recipes/iso8601lib/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) diff --git a/recipes/iso8601lib/all/test_v1_package/CMakeLists.txt b/recipes/iso8601lib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/iso8601lib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/iso8601lib/all/test_v1_package/conanfile.py b/recipes/iso8601lib/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/iso8601lib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/itk/all/conandata.yml b/recipes/itk/all/conandata.yml index 9e7f86e6f5246..74a479bc9586a 100644 --- a/recipes/itk/all/conandata.yml +++ b/recipes/itk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.3.0": + url: "https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.3.0/InsightToolkit-5.3.0.tar.gz" + sha256: "57a4471133dc8f76bde3d6eb45285c440bd40d113428884a1487472b7b71e383" "5.1.2": url: "https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.1.2/InsightToolkit-5.1.2.tar.gz" sha256: "f1e5a78e11125348f68f655c6b89b617c3a8b2c09f710081f621054811a70c98" @@ -6,6 +9,10 @@ sources: url: "https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.1.0/InsightToolkit-5.1.0.tar.gz" sha256: "121020a1611508cec8123eb5226215598cec07be627d843a2e6b6da891e61d13" patches: + "5.3.0": + - patch_file: "patches/0002-find-conan-packages.patch" + patch_description: "inject thirdparties from conan" + patch_type: "conan" "5.1.2": - patch_file: "patches/0001-find-conan-packages.patch" patch_description: "inject thirdparties from conan" diff --git a/recipes/itk/all/conanfile.py b/recipes/itk/all/conanfile.py index c9a9ded1e49f4..1714d09cf293b 100644 --- a/recipes/itk/all/conanfile.py +++ b/recipes/itk/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv 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 @@ -24,10 +25,12 @@ class ITKConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_opencv": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_opencv": False, } short_paths = True @@ -64,21 +67,26 @@ def requirements(self): # 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.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("fftw/3.3.10") - self.requires("gdcm/3.0.21") - self.requires("hdf5/1.14.1") + self.requires("gdcm/3.0.23") + self.requires("hdf5/1.14.3") self.requires("libjpeg/9e") - self.requires("libpng/1.6.40") - self.requires("libtiff/4.5.1") - self.requires("openjpeg/2.5.0") + self.requires("libpng/[>=1.6 <2]") + self.requires("libtiff/4.6.0") + self.requires("openjpeg/2.5.2") self.requires("onetbb/2021.9.0") self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_opencv: + self.requires("opencv/4.10.0") + + def build_requirements(self): + if Version(self.version) >= "5.3.0": + self.tool_requires("cmake/[>=3.16.3 <4]") def validate(self): if self.options.shared and not self.dependencies["hdf5"].options.shared: @@ -93,6 +101,9 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) + if Version(self.version) < "5.2" and self.settings.os == "Macos": + raise ConanInvalidConfiguration(f"{self.ref} fails to compile in {self.settings.os}, fixed in 5.2.0") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -104,6 +115,9 @@ def generate(self): tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_TESTING"] = False tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["DO_NOT_BUILD_ITK_TEST_DRIVER"] = True + tc.variables["DO_NOT_INSTALL_ITK_TEST_DRIVER"] = True + tc.variables["DISABLE_MODULE_TESTS"] = True tc.variables["ITK_SKIP_PATH_LENGTH_CHECKS"] = True tc.variables["ITK_USE_SYSTEM_LIBRARIES"] = True @@ -130,7 +144,7 @@ def generate(self): tc.variables["Module_ITKMINC"] = False tc.variables["Module_ITKIOMINC"] = False - tc.variables["Module_ITKVideoBridgeOpenCV"] = False + tc.variables["Module_ITKVideoBridgeOpenCV"] = self.options.with_opencv #todo: enable after fixing dcmtk compatibility with openssl on Windows tc.variables["Module_ITKDCMTK"] = False @@ -235,6 +249,9 @@ def generate(self): tc = CMakeDeps(self) tc.generate() + venv = VirtualBuildEnv(self) + venv.generate() + def _patch_sources(self): apply_conandata_patches(self) #The CMake policy CMP0091 must be NEW, but is '' @@ -258,6 +275,10 @@ def _itk_subdir(self): def _cmake_module_dir(self): return os.path.join("lib", "cmake", self._itk_subdir) + @property + def _module_variables_file_rel_path(self): + return os.path.join(self._cmake_module_dir, f"conan-official-{self.name}-variables.cmake") + @property def _module_file_rel_path(self): return os.path.join(self._cmake_module_dir, f"conan-official-{self.name}-targets.cmake") @@ -269,7 +290,7 @@ def libm(): def libdl(): return ["dl"] if self.settings.os in ["Linux", "FreeBSD"] else [] - return { + components = { "itksys": {"system_libs": libdl()}, "itkvcl": {"system_libs": libm()}, "itkv3p_netlib": {"system_libs": libm()}, @@ -451,6 +472,18 @@ def libdl(): }, "ITKVideoCore": {"requires": ["ITKCommon"]}, } + + if self.options.with_opencv: + components.update({ + "ITKVideoIO": {"requires": ["ITKVideoCore", "ITKIOImageBase"]}, + "ITKVideoBridgeOpenCV": {"requires": ["ITKVideoIO", "opencv::opencv_core"]}, + }) + + return components + + def _create_cmake_module_variables(self): + content = 'set(ITK_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}")' + save(self, os.path.join(self.package_folder, self._module_variables_file_rel_path), content) def _create_cmake_module_alias_targets(self): targets = {target:f"ITK::{target}" for target in self._itk_components.keys()} @@ -464,6 +497,14 @@ def _create_cmake_module_alias_targets(self): """) save(self, os.path.join(self.package_folder, self._module_file_rel_path), content) + @property + def _itk_modules_files(self): + cmake_files = [] + if Version(self.version) >= "5.3": + cmake_files.extend(["ITKFactoryRegistration.cmake", "ITKInitializeCXXStandard.cmake"]) + cmake_files.append("UseITK.cmake") + return cmake_files + def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) @@ -472,18 +513,23 @@ def package(self): 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 + + # Do not remove UseITK.cmake, ITKFactoryRegistration.cmake, ITKInitializeCXXStandard.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": + file_name = os.path.basename(cmake_file) + if file_name not in self._itk_modules_files: os.remove(cmake_file) + + self._create_cmake_module_variables() 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 = Version(self.version) lib_suffix = f"-{itk_version.major}.{itk_version.minor}" + build_modules = [self._module_variables_file_rel_path] + build_modules.extend([os.path.join(self._cmake_module_dir, f) for f in self._itk_modules_files]) + self.cpp_info.set_property("cmake_file_name", "ITK") + self.cpp_info.set_property("cmake_build_modules", build_modules) for name, values in self._itk_components.items(): is_header_only = values.get("header_only", False) @@ -501,8 +547,9 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package* generators removed 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")) + self.cpp_info.components[name].build_modules[generator].extend([self._module_file_rel_path, self._module_variables_file_rel_path]) + self.cpp_info.components[name].build_modules[generator].extend( + [os.path.join(self._cmake_module_dir, f) for f in self._itk_modules_files]) # TODO: to remove in conan v2 once cmake_find_package* generators removed for generator in ["cmake_find_package", "cmake_find_package_multi"]: diff --git a/recipes/itk/all/patches/0002-find-conan-packages.patch b/recipes/itk/all/patches/0002-find-conan-packages.patch new file mode 100644 index 0000000000000..34b81a5788250 --- /dev/null +++ b/recipes/itk/all/patches/0002-find-conan-packages.patch @@ -0,0 +1,189 @@ +--- Modules/ThirdParty/Eigen3/itk-module-init.cmake ++++ Modules/ThirdParty/Eigen3/itk-module-init.cmake +@@ -1,3 +1,3 @@ + if(ITK_USE_SYSTEM_EIGEN) +- find_package(Eigen3 REQUIRED CONFIG) ++ find_package(Eigen3 REQUIRED) + endif() +--- Modules/ThirdParty/DCMTK/itk-module-init.cmake ++++ Modules/ThirdParty/DCMTK/itk-module-init.cmake +@@ -24,7 +24,7 @@ + if(ITK_USE_SYSTEM_DCMTK) + # Use local FindDCMTK.cmake. + list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}/CMake") +- find_package(DCMTK REQUIRED NO_MODULE) ++ find_package(DCMTK REQUIRED) + else(ITK_USE_SYSTEM_DCMTK) + # Copied and mofified from DCMTK/CMake/3rdparty.cmake + if(NOT DEFINED DCMTK_USE_ICU) +--- Modules/ThirdParty/Eigen3/CMakeLists.txt ++++ Modules/ThirdParty/Eigen3/CMakeLists.txt +@@ -52,9 +52,9 @@ + + if(ITK_USE_SYSTEM_EIGEN) + set(_Eigen3_SYSTEM_OR_INTERNAL "Eigen3") +- find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED CONFIG) +- set(Eigen3_DIR_INSTALL ${Eigen3_DIR}) +- set(Eigen3_DIR_BUILD ${Eigen3_DIR}) ++ find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED) ++ set(Eigen3_DIR_INSTALL ${Eigen3_INCLUDE_DIR}) ++ set(Eigen3_DIR_BUILD ${Eigen3_INCLUDE_DIR}) + else() + set(_Eigen3_SYSTEM_OR_INTERNAL "ITKInternalEigen3") + find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED CONFIG) +@@ -66,7 +66,7 @@ + # Eigen3 is header only, but there are compile definitions that we want to provide + # to enforce use of MPL only code, and to disable warnings. + # We only need to add the location of the header itk_eigen.h used internally. +-get_target_property(Eigen_INCLUDE_DIRS ${_eigen_itk_target} INTERFACE_INCLUDE_DIRECTORIES) ++set(Eigen_INCLUDE_DIRS ${Eigen3_INCLUDE_DIRS}) + set(ITKEigen3_INCLUDE_DIRS + ${Eigen_INCLUDE_DIRS} + ${ITKEigen3_BINARY_DIR}/src # For the generated itk_eigen.h +@@ -75,14 +75,10 @@ + # When this module is loaded by an app, load Eigen too. + # Load ITKInternalEigen3 or Eigen3 depending on ITK_USE_SYSTEM_EIGEN + set(ITKEigen3_EXPORT_CODE_INSTALL " +-set(ITK_USE_SYSTEM_EIGEN \"${ITK_USE_SYSTEM_EIGEN}\") +-set(${_Eigen3_SYSTEM_OR_INTERNAL}_DIR \"${Eigen3_DIR_INSTALL}\") +-find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED CONFIG) ++find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED) + ") + set(ITKEigen3_EXPORT_CODE_BUILD " +-set(ITK_USE_SYSTEM_EIGEN \"${ITK_USE_SYSTEM_EIGEN}\") +-set(${_Eigen3_SYSTEM_OR_INTERNAL}_DIR \"${Eigen3_DIR_BUILD}\") +-find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED CONFIG) ++find_package(${_Eigen3_SYSTEM_OR_INTERNAL} ${_Eigen3_min_version} REQUIRED) + ") + + # Eigen3 targets are not installed if ITK_USE_SYSTEM_EIGEN==True +--- Modules/ThirdParty/Eigen3/src/itk_eigen.h.in ++++ Modules/ThirdParty/Eigen3/src/itk_eigen.h.in +@@ -43,10 +43,10 @@ + set(Eigen3_DIR ${ITKInternalEigen3_DIR}) + endif() + message(STATUS "From ITK: Eigen3_DIR: ${Eigen3_DIR}") +-find_package(Eigen3 REQUIRED CONFIG) ++find_package(Eigen3 REQUIRED) + add_executable(main main.cpp) + target_link_libraries(main PUBLIC ${ITK_LIBRARIES}) + target_link_libraries(main PUBLIC Eigen3::Eigen) + \endcode + * + * Then, the user can use Eigen3 as usual: +--- Modules/ThirdParty/JPEG/CMakeLists.txt ++++ Modules/ThirdParty/JPEG/CMakeLists.txt +@@ -6,13 +6,13 @@ + + if(ITK_USE_SYSTEM_JPEG) + find_package(JPEG REQUIRED) + set(ITKJPEG_INCLUDE_DIRS + ${ITKJPEG_BINARY_DIR}/src + ) + set(ITKJPEG_SYSTEM_INCLUDE_DIRS + ${JPEG_INCLUDE_DIR} + ) +- set(ITKJPEG_LIBRARIES "${JPEG_LIBRARIES}") ++ set(ITKJPEG_LIBRARIES JPEG::JPEG) + set(ITKJPEG_NO_SRC 1) + else() + set(ITKJPEG_INCLUDE_DIRS +--- Modules/ThirdParty/DoubleConversion/CMakeLists.txt ++++ Modules/ThirdParty/DoubleConversion/CMakeLists.txt +@@ -8,8 +8,8 @@ + + if(ITK_USE_SYSTEM_DOUBLECONVERSION) + find_package(double-conversion 3.1.6 REQUIRED) +- get_target_property(ITKDoubleConversion_INCLUDE_DIRS double-conversion::double-conversion INTERFACE_INCLUDE_DIRECTORIES) +- get_target_property(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion LOCATION) ++ set(ITKDoubleConversion_INCLUDE_DIRS ${double-conversion_INCLUDE_DIRS}) ++ set(ITKDoubleConversion_LIBRARIES ${double-conversion_LIBRARIES}) + else() + set(ITKDoubleConversion_INCLUDE_DIRS + ${ITKDoubleConversion_SOURCE_DIR}/src +--- Modules/ThirdParty/Expat/CMakeLists.txt ++++ Modules/ThirdParty/Expat/CMakeLists.txt +@@ -6,9 +6,9 @@ + + if(ITK_USE_SYSTEM_EXPAT) + find_package(EXPAT REQUIRED) +- set(ITKExpat_INCLUDE_DIRS ${ITKExpat_BINARY_DIR}/src ) +- set(ITKExpat_SYSTEM_INCLUDE_DIRS "${EXPAT_INCLUDE_DIR}") +- set(ITKExpat_LIBRARIES "${EXPAT_LIBRARY}") ++ set(ITKExpat_INCLUDE_DIRS ${EXPAT_INCLUDE_DIRECTORIES}) ++ set(ITKExpat_SYSTEM_INCLUDE_DIRS ${EXPAT_INCLUDE_DIRECTORIES}) ++ set(ITKExpat_LIBRARIES EXPAT::EXPAT) + set(ITKExpat_NO_SRC 1) + else() + set(ITKExpat_INCLUDE_DIRS +--- Modules/ThirdParty/HDF5/CMakeLists.txt ++++ Modules/ThirdParty/HDF5/CMakeLists.txt +@@ -19,25 +19,9 @@ if(CMAKE_LINKER MATCHES "link.exe$") + endif() + + if(ITK_USE_SYSTEM_HDF5) +- +- if(HDF5_DIR) +- set(_HDF5_DIR_CODE "set(HDF5_DIR \"${HDF5_DIR}\")") +- endif() +- if(HDF5_NO_MODULE) +- set(_HDF5_NO_MODULE_ARG "NO_MODULE") +- endif() +- +- # When ITK's config is loaded, load HDF5 too. +- set(ITKHDF5_EXPORT_CODE_INSTALL " +-${_HDF5_DIR_CODE} +-find_package(HDF5 ${_HDF5_NO_MODULE_ARG} REQUIRED COMPONENTS CXX C HL) +-") +- set(ITKHDF5_EXPORT_CODE_BUILD " +-if(NOT ITK_BINARY_DIR) +- ${_HDF5_DIR_CODE} +- find_package(HDF5 ${_HDF5_NO_MODULE_ARG} REQUIRED COMPONENTS CXX C HL) +-endif() +-") ++ find_package(HDF5 REQUIRED) ++ set(HDF5_C_SHARED_LIBRARY HDF5::HDF5) ++ set(HDF5_C_STATIC_LIBRARY HDF5::HDF5) + + if(BUILD_SHARED_LIBS) + if (TARGET hdf5-shared) +--- Modules/ThirdParty/OpenJPEG/src/CMakeLists.txt ++++ Modules/ThirdParty/OpenJPEG/src/CMakeLists.txt +@@ -4,5 +4,8 @@ + set(ITK3P_INSTALL_RUNTIME_DIR "${ITKOpenJPEG_INSTALL_RUNTIME_DIR}") + set(ITK3P_INSTALL_LIBRARY_DIR "${ITKOpenJPEG_INSTALL_LIBRARY_DIR}") + set(ITK3P_INSTALL_ARCHIVE_DIR "${ITKOpenJPEG_INSTALL_ARCHIVE_DIR}") +-add_subdirectory(openjpeg) +-itk_module_target(itkopenjpeg NO_INSTALL) ++find_package(OpenJPEG REQUIRED) ++add_library(itkopenjpeg INTERFACE) ++set_property(TARGET itkopenjpeg PROPERTY INTERFACE_LINK_LIBRARIES openjp2) ++#target_compile_definitions(itkopenjpeg INTERFACE) ++install(TARGETS itkopenjpeg EXPORT ${ITK3P_INSTALL_EXPORT_NAME}) +--- Modules/ThirdParty/TBB/CMakeLists.txt ++++ Modules/ThirdParty/TBB/CMakeLists.txt +@@ -8,14 +8,14 @@ set(ITKTBB_NO_SRC 1) + # When this module is loaded by an app, load TBB too. + set(ITKTBB_EXPORT_CODE_INSTALL " + set(TBB_DIR \"${TBB_DIR}\") +-find_package(TBB REQUIRED CONFIG) ++find_package(TBB REQUIRED) + ") + + # When this module is configured by an app, configure TBB too. + set(ITKTBB_EXPORT_CODE_BUILD " + if(NOT ITK_BINARY_DIR) + set(TBB_DIR \"${TBB_DIR}\") +- find_package(TBB REQUIRED CONFIG) ++ find_package(TBB REQUIRED) + endif() + ") + +diff --git a/Modules/ThirdParty/TBB/itk-module-init.cmake b/Modules/ThirdParty/TBB/itk-module-init.cmake +index 1b7ee20a..0859ef33 100644 +--- a/Modules/ThirdParty/TBB/itk-module-init.cmake ++++ b/Modules/ThirdParty/TBB/itk-module-init.cmake +@@ -1,2 +1,2 @@ +-find_package(TBB REQUIRED CONFIG) # must have TBBConfig.cmake, provided since version tbb2017_20170604oss ++find_package(TBB REQUIRED) + get_target_property(TBB_INCLUDE_DIRS TBB::tbb INTERFACE_INCLUDE_DIRECTORIES) diff --git a/recipes/itk/config.yml b/recipes/itk/config.yml index 989b5ee90fe13..f362c6f4b0b84 100644 --- a/recipes/itk/config.yml +++ b/recipes/itk/config.yml @@ -1,4 +1,6 @@ versions: + "5.3.0": + folder: "all" "5.1.2": folder: "all" "5.1.0": diff --git a/recipes/itlib/all/conandata.yml b/recipes/itlib/all/conandata.yml index 4f1d604b9b789..19923cd832b58 100644 --- a/recipes/itlib/all/conandata.yml +++ b/recipes/itlib/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.11.4": + url: "https://github.com/iboB/itlib/archive/v1.11.4.tar.gz" + sha256: "09b155afcb9766fe36d0156294f6656956189235612eb7711903ebc22079c37e" + "1.11.3": + url: "https://github.com/iboB/itlib/archive/v1.11.3.tar.gz" + sha256: "38999b3c4c2425ac3700529457fb2683d6fa5853752747c3afb97b2e688255b8" + "1.11.2": + url: "https://github.com/iboB/itlib/archive/v1.11.2.tar.gz" + sha256: "bbf734f6084af77a1e886e54e4efadab491ada242f5858afa561353db6a0a03f" + "1.11.1": + url: "https://github.com/iboB/itlib/archive/v1.11.1.tar.gz" + sha256: "2c60e02660ea63dfb7a39237e29b30a066670cef228d22e8d0908e1fff2fa7f1" "1.10.3": url: "https://github.com/iboB/itlib/archive/v1.10.3.tar.gz" sha256: "e533c44354d48b2251ca57f1502778033b38170d9d6aba6bb2bbad90f2bf9d27" @@ -8,21 +20,3 @@ sources: "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" - "1.9.0": - url: "https://github.com/iboB/itlib/archive/v1.9.0.tar.gz" - sha256: "62b8c01f208a39c22462cde285dd84c60a8141cfbbc94f5fc1d991685a724228" - "1.8.3": - url: "https://github.com/iboB/itlib/archive/v1.8.3.tar.gz" - sha256: "2323e2abf5827651097c563a19d8f82c7fd222a8740ff3421681da967b59277e" - "1.8.2": - url: "https://github.com/iboB/itlib/archive/v1.8.2.tar.gz" - sha256: "2b4d206ed0de31a4e6042fada0aa7cee54c95220d98666381f0402046e95304f" - "1.8.1": - url: "https://github.com/iboB/itlib/archive/v1.8.1.tar.gz" - sha256: "7a8619073d0bbd5a5cea0ee9bb1b3b749348cbab1d12e4e0c234215f26388aef" - "1.8.0": - url: "https://github.com/iboB/itlib/archive/v1.8.0.tar.gz" - sha256: "70b6493b0cc3a720ffd48e98e3f009e8d94003380800bf07e61f167e813a9add" diff --git a/recipes/itlib/all/conanfile.py b/recipes/itlib/all/conanfile.py index e92c4b5b3a2f4..b96a180998454 100644 --- a/recipes/itlib/all/conanfile.py +++ b/recipes/itlib/all/conanfile.py @@ -13,7 +13,7 @@ class ItlibConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/iboB/itlib" - topics = ("template", "flatmatp", "static-vector") + topics = ("template", "flatmatp", "static-vector", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/itlib/all/test_package/CMakeLists.txt b/recipes/itlib/all/test_package/CMakeLists.txt index 11bad027c5a7e..06d5a7da79073 100644 --- a/recipes/itlib/all/test_package/CMakeLists.txt +++ b/recipes/itlib/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) diff --git a/recipes/itlib/all/test_v1_package/CMakeLists.txt b/recipes/itlib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index bc541ea90b512..0000000000000 --- a/recipes/itlib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/itlib/all/test_v1_package/conanfile.py b/recipes/itlib/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/itlib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/itlib/config.yml b/recipes/itlib/config.yml index 09616d2e081cf..5e6bf450f30f7 100644 --- a/recipes/itlib/config.yml +++ b/recipes/itlib/config.yml @@ -1,19 +1,15 @@ versions: - "1.10.3": - folder: all - "1.10.0": - folder: all - "1.9.2": + "1.11.4": folder: all - "1.9.1": + "1.11.3": folder: all - "1.9.0": + "1.11.2": folder: all - "1.8.3": + "1.11.1": folder: all - "1.8.2": + "1.10.3": folder: all - "1.8.1": + "1.10.0": folder: all - "1.8.0": + "1.9.2": folder: all diff --git a/recipes/ittapi/all/conandata.yml b/recipes/ittapi/all/conandata.yml index 425388a0a3b63..1707988b66703 100644 --- a/recipes/ittapi/all/conandata.yml +++ b/recipes/ittapi/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.25.5": + url: "https://github.com/intel/ittapi/archive/v3.25.5.tar.gz" + sha256: "2d19243e7ac8a7de08bfd005429a308c1db52a18e5b7b66d29a6c19f066946e3" + "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..fe2087d4f6528 100644 --- a/recipes/ittapi/all/conanfile.py +++ b/recipes/ittapi/all/conanfile.py @@ -1,9 +1,10 @@ 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" +required_conan_version = ">=2.0" class IttApiConan(ConanFile): @@ -52,15 +53,16 @@ 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() toolchain = CMakeToolchain(self) toolchain.variables["ITT_API_IPT_SUPPORT"] = self.options.ptmark + if Version(self.version) < "3.25.1": + toolchain.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" toolchain.generate() def build(self): @@ -78,6 +80,9 @@ def package(self): copy(self, "GPL-2.0-only.txt", src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) def package_info(self): + # https://github.com/intel/ittapi/blob/03f7260c96d4b437d12dceee7955ebb1e30e85ad/CMakeLists.txt#L176 + self.cpp_info.set_property("cmake_target_name", "ittapi::ittnotify") + self.cpp_info.set_property("cmake_target_aliases", ["ittapi::ittapi"]) # for compatibility with earlier revisions of the recipe if self.settings.os == "Windows": self.cpp_info.libs = ['libittnotify'] else: diff --git a/recipes/ittapi/all/test_package/CMakeLists.txt b/recipes/ittapi/all/test_package/CMakeLists.txt index ac9d09057495e..607821cc2669e 100644 --- a/recipes/ittapi/all/test_package/CMakeLists.txt +++ b/recipes/ittapi/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(ittapi REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE ittapi::ittapi) +target_link_libraries(${PROJECT_NAME} PRIVATE ittapi::ittnotify) diff --git a/recipes/ittapi/all/test_v1_package/CMakeLists.txt b/recipes/ittapi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index bb7640b6417bb..0000000000000 --- a/recipes/ittapi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(ittapi REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE ittapi::ittapi) diff --git a/recipes/ittapi/all/test_v1_package/conanfile.py b/recipes/ittapi/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/ittapi/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/ittapi/config.yml b/recipes/ittapi/config.yml index e8e090e18ce3e..23ab891043b8a 100644 --- a/recipes/ittapi/config.yml +++ b/recipes/ittapi/config.yml @@ -1,4 +1,8 @@ versions: + "3.25.5": + folder: all + "3.24.4": + folder: all "3.24.0": folder: all "3.23.0": diff --git a/recipes/ixwebsocket/all/conandata.yml b/recipes/ixwebsocket/all/conandata.yml index f9b0b0853afce..7ab18405e8412 100644 --- a/recipes/ixwebsocket/all/conandata.yml +++ b/recipes/ixwebsocket/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "11.4.5": + url: "https://github.com/machinezone/IXWebSocket/archive/refs/tags/v11.4.5.tar.gz" + sha256: "c5fc225edec32bf7d583e55347ef2c9c4940d005c13ef5e848354a85602f5fd6" "11.4.3": url: "https://github.com/machinezone/IXWebSocket/archive/refs/tags/v11.4.3.tar.gz" sha256: "aa2d02c9c71339943cc61eb4efeb2ffc3a5a0011128a67027b9251b7d8a6e0ac" diff --git a/recipes/ixwebsocket/all/conanfile.py b/recipes/ixwebsocket/all/conanfile.py index 839ba03a95e16..346a0ba95defd 100644 --- a/recipes/ixwebsocket/all/conanfile.py +++ b/recipes/ixwebsocket/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class IXWebSocketConan(ConanFile): @@ -17,7 +17,7 @@ class IXWebSocketConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/machinezone/IXWebSocket" license = "BSD-3-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -92,6 +92,8 @@ def generate(self): if Version(self.version) >= "10.1.5": tc.variables["USE_ZLIB"] = self.options.with_zlib tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if Version(self.version) < "9.8.5": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) deps.generate() @@ -135,6 +137,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.set_property("cmake_file_name", "ixwebsocket") diff --git a/recipes/ixwebsocket/all/test_v1_package/CMakeLists.txt b/recipes/ixwebsocket/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/ixwebsocket/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ixwebsocket/all/test_v1_package/conanfile.py b/recipes/ixwebsocket/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ixwebsocket/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_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/ixwebsocket/config.yml b/recipes/ixwebsocket/config.yml index c72c054440963..876784ab3f633 100644 --- a/recipes/ixwebsocket/config.yml +++ b/recipes/ixwebsocket/config.yml @@ -1,4 +1,6 @@ versions: + "11.4.5": + folder: all "11.4.3": folder: all "11.2.4": diff --git a/recipes/jansson/all/test_package/CMakeLists.txt b/recipes/jansson/all/test_package/CMakeLists.txt index 3a833e6d5ed4b..0903bd5f42d2b 100644 --- a/recipes/jansson/all/test_package/CMakeLists.txt +++ b/recipes/jansson/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(jansson REQUIRED CONFIG) diff --git a/recipes/jansson/all/test_v1_package/CMakeLists.txt b/recipes/jansson/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/jansson/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/jansson/all/test_v1_package/conanfile.py b/recipes/jansson/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/jansson/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_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/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index 6e9ac4e8ea75b..a0a3b5ff5c970 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -1,55 +1,38 @@ sources: - "4.1.0": - url: "https://github.com/jasper-software/jasper/releases/download/version-4.1.0/jasper-4.1.0.tar.gz" - sha256: "ffe1543d87f7ffc5039d2415afd48c314a7cc0b0c750b4982cd881d6ed4b5743" + "4.2.4": + url: "https://github.com/jasper-software/jasper/releases/download/version-4.2.4/jasper-4.2.4.tar.gz" + sha256: "6a597613d8d84c500b5b83bf0eec06cd3707c23d19957f70354ac2394c9914e7" + "4.2.0": + url: "https://github.com/jasper-software/jasper/releases/download/version-4.2.0/jasper-4.2.0.tar.gz" + sha256: "69f0b08a0cc281a06eaf7feed510736854bbff9af89ab1d01b77382ad57ec957" + "4.1.2": + url: "https://github.com/jasper-software/jasper/releases/download/version-4.1.2/jasper-4.1.2.tar.gz" + sha256: "22392e439b87c79aaf8689ec79a286a7147e811c4bee34edf3d0b239798d672b" "4.0.0": url: "https://github.com/jasper-software/jasper/releases/download/version-4.0.0/jasper-4.0.0.tar.gz" sha256: "39514e1b53a5333fcff817e19565371f016ea536c36fd2d13a9c4d8da8f0be0c" - "3.0.6": - url: "https://github.com/jasper-software/jasper/releases/download/version-3.0.6/jasper-3.0.6.tar.gz" - sha256: "169be004d91f6940c649a4f854ada2755d4f35f62b0555ce9e1219c778cffc09" - "2.0.33": - url: "https://github.com/jasper-software/jasper/releases/download/version-2.0.33/jasper-2.0.33.tar.gz" - sha256: "28d28290cc2eaf70c8756d391ed8bcc8ab809a895b9a67ea6e89da23a611801a" patches: - "4.1.0": - - patch_file: "patches/4.1.0-0001-skip-rpath.patch" - patch_description: "Do not enforce rpath configuration" - patch_source: "https://github.com/jasper-software/jasper/pull/347" - patch_type: "conan" - - patch_file: "patches/4.1.0-0002-find-libjpeg.patch" - patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" - patch_type: "conan" - - patch_file: "patches/4.1.0-0003-deterministic-libname.patch" + "4.2.4": + - patch_file: "patches/4.2.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" + "4.2.0": + - patch_file: "patches/4.2.0-0003-deterministic-libname.patch" patch_description: "No generator dependent libname" patch_type: "conan" - "3.0.6": - - patch_file: "patches/3.0.6-0001-skip-rpath.patch" + "4.1.2": + - 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/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_file: "patches/4.1.1-0003-deterministic-libname.patch" patch_description: "No generator dependent libname" patch_type: "conan" - "2.0.33": - - patch_file: "patches/2.0.33-0001-skip-rpath.patch" + "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/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_file: "patches/4.0.0-0003-deterministic-libname.patch" + patch_description: "No generator dependent libname" patch_type: "conan" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 9a1c9b8badf36..25cff6caab8e5 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -1,6 +1,7 @@ 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.scm import Version import os @@ -11,11 +12,11 @@ class JasperConan(ConanFile): name = "jasper" + description = "JasPer Image Processing/Coding Tool Kit" license = "JasPer-2.0" - homepage = "https://jasper-software.github.io/jasper" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://jasper-software.github.io/jasper" topics = ("toolkit", "coding", "jpeg", "images") - description = "JasPer Image Processing/Coding Tool Kit" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -49,31 +50,36 @@ def requirements(self): if self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.0") + self.requires("libjpeg-turbo/3.0.2") elif self.options.with_libjpeg == "mozjpeg": - self.requires("mozjpeg/4.1.1") + self.requires("mozjpeg/4.1.5") + + 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) + tc.variables["JAS_ENABLE_PIC"] = self.options.get_safe("fPIC", True) tc.variables["JAS_ENABLE_DOC"] = False tc.variables["JAS_ENABLE_LATEX"] = False tc.variables["JAS_ENABLE_PROGRAMS"] = False tc.variables["JAS_ENABLE_SHARED"] = self.options.shared tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" tc.variables["JAS_ENABLE_LIBJPEG"] = bool(self.options.with_libjpeg) - if Version(self.version) >= "3.0.0": - tc.variables["JAS_ENABLE_LIBHEIF"] = False + tc.variables["JAS_HAVE_JPEGLIB_H"] = True + tc.variables["JAS_ENABLE_LIBHEIF"] = False tc.variables["JAS_ENABLE_OPENGL"] = False - if cross_building(self): tc.cache_variables["JAS_CROSSCOMPILING"] = True tc.cache_variables["JAS_STDC_VERSION"] = "199901L" - + if Version(self.version) >= "4.2.0": + tc.variables["JAS_PACKAGING"] = True tc.generate() cmakedeps = CMakeDeps(self) diff --git a/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch b/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch deleted file mode 100644 index eb9d47cbbb014..0000000000000 --- a/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 230d88c..79081c2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -298,19 +298,15 @@ if (JAS_ENABLE_SHARED) - # (but later on when installing) - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -- 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) - - # 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}" STREQUAL "-1") -- set(CMAKE_INSTALL_RPATH -- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") - endif("${isSystemDir}" STREQUAL "-1") - - endif() 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-0001-skip-rpath.patch b/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch deleted file mode 100644 index 959d169bd49ad..0000000000000 --- a/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5cf594c..a0d253d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -740,19 +740,15 @@ if(JAS_ENABLE_SHARED) - # (but later on when installing) - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -- 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) - - # 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}") - endif() - endif() - 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/3.0.6-0003-deterministic-libname.patch b/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch deleted file mode 100644 index 567ff16e021a4..0000000000000 --- a/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -254,7 +254,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) - if(CMAKE_CONFIGURATION_TYPES) - set(CMAKE_DEBUG_POSTFIX d) - endif() 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 deleted file mode 100644 index 9ebb0ac66b98c..0000000000000 --- a/recipes/jasper/all/patches/4.1.0-0001-skip-rpath.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ba6f117..6b79a94 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -804,19 +804,19 @@ if(JAS_ENABLE_SHARED) - # (but later on when installing) - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") -+# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") - - # add the automatically determined parts of the RPATH - # which point to directories outside the build tree to the install RPATH -- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -+# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - - # The RPATH to be used when installing, but only if it's not a - # system directory - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) - if(isSystemDir EQUAL -1) -- set(CMAKE_INSTALL_RPATH -- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") -+# set(CMAKE_INSTALL_RPATH -+# "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") - endif() - endif() - diff --git a/recipes/jasper/all/patches/4.1.0-0002-find-libjpeg.patch b/recipes/jasper/all/patches/4.1.0-0002-find-libjpeg.patch deleted file mode 100644 index 05dd6ce68abe8..0000000000000 --- a/recipes/jasper/all/patches/4.1.0-0002-find-libjpeg.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6b79a94..86eb065 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -742,13 +742,13 @@ if(JAS_ENABLE_LIBJPEG) - # (e.g., stdio.h and stdint.h). So, we cannot reliably use - # check_include_file here. - jas_get_includes_from_targets(CMAKE_REQUIRED_INCLUDES JPEG::JPEG) -- check_c_source_compiles(" -- #include -- #include -- #include -- int main() {} -- " JAS_HAVE_JPEGLIB_H) -- if(JAS_HAVE_JPEGLIB_H) -+ # check_c_source_compiles(" -+ # #include -+ # #include -+ # #include -+ # int main() {} -+ # " JAS_HAVE_JPEGLIB_H) -+ if(1) - set(JAS_HAVE_LIBJPEG 1) - set(JAS_LIBJPEG_TARGET JPEG::JPEG) - list(APPEND JAS_PKGCONFIG_REQUIRES libjpeg) diff --git a/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch b/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch deleted file mode 100644 index 0603e4f665033..0000000000000 --- a/recipes/jasper/all/patches/4.1.0-0003-deterministic-libname.patch +++ /dev/null @@ -1,13 +0,0 @@ -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/all/patches/4.2.0-0003-deterministic-libname.patch b/recipes/jasper/all/patches/4.2.0-0003-deterministic-libname.patch new file mode 100644 index 0000000000000..ed1edf420e3b3 --- /dev/null +++ b/recipes/jasper/all/patches/4.2.0-0003-deterministic-libname.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6925e4..8392edf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -274,7 +274,7 @@ message("JAS_MULTICONFIGURATION_GENERATOR ${JAS_MULTICONFIGURATION_GENERATOR}") + # 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/test_package/CMakeLists.txt b/recipes/jasper/all/test_package/CMakeLists.txt index 7722c78a71d35..27a0fd85fbc29 100644 --- a/recipes/jasper/all/test_package/CMakeLists.txt +++ b/recipes/jasper/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(Jasper REQUIRED) diff --git a/recipes/jasper/all/test_v1_package/CMakeLists.txt b/recipes/jasper/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2f6b1a2f7ec79..0000000000000 --- a/recipes/jasper/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/jasper/all/test_v1_package/conanfile.py b/recipes/jasper/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/jasper/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/jasper/config.yml b/recipes/jasper/config.yml index 70e516cc72ceb..7d70ab2a393a0 100644 --- a/recipes/jasper/config.yml +++ b/recipes/jasper/config.yml @@ -1,9 +1,9 @@ versions: - "4.1.0": + "4.2.4": folder: all - "4.0.0": + "4.2.0": folder: all - "3.0.6": + "4.1.2": folder: all - "2.0.33": + "4.0.0": folder: all diff --git a/recipes/jbig/all/test_package/CMakeLists.txt b/recipes/jbig/all/test_package/CMakeLists.txt index df5582d8098ae..e8733cc9bff3d 100644 --- a/recipes/jbig/all/test_package/CMakeLists.txt +++ b/recipes/jbig/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(jbig REQUIRED CONFIG) diff --git a/recipes/jbig/all/test_v1_package/CMakeLists.txt b/recipes/jbig/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/jbig/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/jbig/all/test_v1_package/conanfile.py b/recipes/jbig/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/jbig/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_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/jeaiii-itoa/all/test_package/CMakeLists.txt b/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt index 09813e133a472..d8614a802d610 100644 --- a/recipes/jeaiii-itoa/all/test_package/CMakeLists.txt +++ b/recipes/jeaiii-itoa/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(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 deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/jeaiii-itoa/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/jeaiii-itoa/all/test_v1_package/conanfile.py b/recipes/jeaiii-itoa/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/jeaiii-itoa/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/jemalloc/all/conandata.yml b/recipes/jemalloc/all/conandata.yml index 01ec764057557..d4bd61a7e3212 100644 --- a/recipes/jemalloc/all/conandata.yml +++ b/recipes/jemalloc/all/conandata.yml @@ -9,3 +9,14 @@ sources: patches: "5.2.1": - patch_file: "patches/0001-clang12-dont-declare-system-functions-as-nothrow.patch" + patch_description: "Remove nothrow from system function declarations on macOS and FreeBSD." + patch_type: "backport" + "5.3.0": + - patch_file: "patches/0002-add-missing-ac-define-description.patch" + patch_description: "Patch configure.ac to add the missing description in AC_DEFINE." + patch_type: "backport" + patch_source: "https://github.com/jemalloc/jemalloc/pull/2396" + - patch_file: "patches/0003-add-missing-cpp-flags-for-windows.patch" + patch_description: "Add the missing compiler flags for MSVC on Windows." + patch_type: "backport" + patch_source: "https://github.com/jemalloc/jemalloc/issues/2283" diff --git a/recipes/jemalloc/all/conanfile.py b/recipes/jemalloc/all/conanfile.py index 03cf37de219b0..6c77bdecc8679 100644 --- a/recipes/jemalloc/all/conanfile.py +++ b/recipes/jemalloc/all/conanfile.py @@ -1,28 +1,30 @@ from conan import ConanFile -from conans import AutoToolsBuildEnvironment, MSBuild from conan.errors import ConanInvalidConfiguration -from conan.tools.scm import Version -from conans import tools as tools_legacy -from conan.tools.files import apply_conandata_patches, get, rename, replace_in_file +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout +from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rename, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os import shutil -import string -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.54.0" + class JemallocConan(ConanFile): name = "jemalloc" description = "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support." url = "https://github.com/conan-io/conan-center-index" license = "BSD-2-Clause" - homepage = "http://jemalloc.net/" - topics = ("conan", "jemalloc", "malloc", "free") + homepage = "https://jemalloc.net/" + topics = ("jemalloc", "malloc", "free") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "prefix": "ANY", + "prefix": ["ANY"], "enable_cxx": [True, False], "enable_fill": [True, False], "enable_xmalloc": [True, False], @@ -49,9 +51,36 @@ class JemallocConan(ConanFile): "enable_libdl": True, "enable_prof": False, } - exports_sources = ["patches/**"] - _autotools = None + @property + def _minimum_compilers_version(self): + return { + "clang": "3.9", + "apple-clang": "8", + # The upstream repository provides solution files for Visual Studio 2015, 2017, 2019 and 2022, + # but the 2015 solution does not work properly due to unresolved external symbols: + # `test_hooks_libc_hook` and `test_hooks_arena_new_hook` + "Visual Studio": "15", + "msvc": "191", + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _library_name(self): + libname = "jemalloc" + if self.settings.os == "Windows": + if not self.options.shared: + libname += "_s" + else: + if not self.options.shared and self.options.fPIC: + libname += "_pic" + return libname + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -59,166 +88,105 @@ 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_cxx: - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - - def validate(self): - if self.options.enable_cxx and \ - self.settings.compiler.get_safe("libcxx") == "libc++" and \ - self.settings.compiler == "clang" and \ - Version(self.settings.compiler.version) < "10": - raise ConanInvalidConfiguration("clang and libc++ version {} (< 10) is missing a mutex implementation".format(self.settings.compiler.version)) - if self.settings.compiler == "Visual Studio" and \ - self.options.shared and \ - "MT" in self.settings.compiler.runtime: - raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") - if self.settings.compiler == "Visual Studio" and self.settings.compiler.version != "15": - # https://github.com/jemalloc/jemalloc/issues/1703 - raise ConanInvalidConfiguration("Only Visual Studio 15 2017 is supported. Please fix this if other versions are supported") - if self.settings.build_type not in ("Release", "Debug", None): - raise ConanInvalidConfiguration("Only Release and Debug build_types are supported") - if self.settings.compiler == "Visual Studio" and self.settings.arch not in ("x86_64", "x86"): - raise ConanInvalidConfiguration("Unsupported arch") - if self.settings.compiler == "clang" and Version(self.settings.compiler.version) <= "3.9": - raise ConanInvalidConfiguration("Unsupported compiler version") - if self.settings.os == "Macos" and self.settings.arch not in ("x86_64", "x86"): - raise ConanInvalidConfiguration("Unsupported arch") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): basic_layout(self, src_folder="src") - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - def build_requirements(self): - if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool): - self.build_requires("msys2/cci.latest") - - def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + 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") - @property - def _autotools_args(self): - conf_args = [ - "--with-jemalloc-prefix={}".format(self.options.prefix), - "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug", - "--enable-cxx" if self.options.enable_cxx else "--disable-cxx", - "--enable-fill" if self.options.enable_fill else "--disable-fill", - "--enable-xmalloc" if self.options.enable_cxx else "--disable-xmalloc", - "--enable-readlinkat" if self.options.enable_readlinkat else "--disable-readlinkat", - "--enable-syscall" if self.options.enable_syscall else "--disable-syscall", - "--enable-lazy-lock" if self.options.enable_lazy_lock else "--disable-lazy-lock", - "--enable-log" if self.options.enable_debug_logging else "--disable-log", - "--enable-initial-exec-tls" if self.options.enable_initial_exec_tls else "--disable-initial-exec-tls", - "--enable-libdl" if self.options.enable_libdl else "--disable-libdl", - ] - if self.options.enable_prof: - conf_args.append("--enable-prof") - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - return conf_args - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools_legacy.os_info.is_windows) - self._autotools.configure(args=self._autotools_args, configure_dir=self.source_folder) - return self._autotools - - @property - def _msvc_build_type(self): - build_type = str(self.settings.build_type) or "Release" - if not self.options.shared: - build_type += "-static" - return build_type - - def _patch_sources(self): - if self.settings.os == "Windows": - makefile_in = os.path.join(self.source_folder, "Makefile.in") - replace_in_file(self, makefile_in, - "DSO_LDFLAGS = @DSO_LDFLAGS@", - "DSO_LDFLAGS = @DSO_LDFLAGS@ -Wl,--out-implib,lib/libjemalloc.a", strict=False) - replace_in_file(self, makefile_in, - "\t$(INSTALL) -d $(LIBDIR)\n" - "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR)", - "\t$(INSTALL) -d $(BINDIR)\n" - "\t$(INSTALL) -d $(LIBDIR)\n" - "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\n" - "\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)", strict=False) - - apply_conandata_patches(self) + def validate(self): + 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 {self.settings.compiler} >= {minimum_version}") + # 1. MSVC specific checks + if is_msvc(self): + # Building the shared library with a static MSVC runtime is not supported + if self.options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Building the shared library with MT runtime is not supported.") + # Only x86-64 and x86 are supported + if self.settings.arch not in ["x86_64", "x86"]: + raise ConanInvalidConfiguration(f"{self.settings.arch} is not supported.") + # 2. Clang specific checks + if self.settings.compiler == "clang": + if self.options.enable_cxx and self.settings.compiler.get_safe("libcxx") == "libc++" and \ + Version(self.settings.compiler.version) < "10": + raise ConanInvalidConfiguration("Clang 9 or earlier with libc++ is not supported due to the missing mutex implementation.") + # 3: Apple Silicon specific checks + if self.settings.os == "Macos" and self.settings.arch == "armv8": + if Version(self.version) < "5.3.0": + raise ConanInvalidConfiguration("Support for Apple Silicon is only available as of 5.3.0.") + 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) + enable_disable = lambda opt, val: f"--enable-{opt}" if val else f"--disable-{opt}" + tc.configure_args.extend([ + f"--with-jemalloc-prefix={self.options.prefix}", + enable_disable("debug", self.settings.build_type == "Debug"), + enable_disable("cxx", self.options.enable_cxx), + enable_disable("fill", self.options.enable_fill), + enable_disable("xmalloc", self.options.enable_cxx), + enable_disable("readlinkat", self.options.enable_readlinkat), + enable_disable("syscall", self.options.enable_syscall), + enable_disable("lazy-lock", self.options.enable_lazy_lock), + enable_disable("log", self.options.enable_debug_logging), + enable_disable("initial-exec-tls", self.options.enable_initial_exec_tls), + enable_disable("libdl", self.options.enable_libdl), + enable_disable("prof", self.options.enable_prof), + ]) + env = tc.environment() + if is_msvc(self): + # Do not check whether the math library exists when compiled by MSVC + # because MSVC treats the function `char log()` as a intrinsic function + # and therefore complains about insufficient arguments passed to the function + tc.configure_args.append("ac_cv_search_log=none required") + env.define("CC", "cl") + env.define("CXX", "cl") + tc.generate(env) def build(self): - self._patch_sources() - if self.settings.compiler == "Visual Studio": - with tools_legacy.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools_legacy.no_op(): - with tools_legacy.environment_append({"CC": "cl", "CXX": "cl"}) if self.settings.compiler == "Visual Studio" else tools_legacy.no_op(): - with tools_legacy.chdir(self.source_folder): - # Do not use AutoToolsBuildEnvironment because we want to run configure as ./configure - self.run("./configure {}".format(" ".join(self._autotools_args)), win_bash=tools_legacy.os_info.is_windows) - msbuild = MSBuild(self) - # Do not use the 2015 solution: unresolved external symbols: test_hooks_libc_hook and test_hooks_arena_new_hook - sln_file = os.path.join(self.source_folder, "msvc", "jemalloc_vc2017.sln") - msbuild.build(sln_file, targets=["jemalloc"], build_type=self._msvc_build_type) - else: - autotools = self._configure_autotools() - autotools.make() - - @property - def _library_name(self): - libname = "jemalloc" - if self.settings.compiler == "Visual Studio": - if self.options.shared: - if self.settings.build_type == "Debug": - libname += "d" - else: - toolset = tools_legacy.msvs_toolset(self.settings) - toolset_number = "".join(c for c in toolset if c in string.digits) - libname += "-vc{}-{}".format(toolset_number, self._msvc_build_type) - else: - if self.settings.os == "Windows": - if not self.options.shared: - libname += "_s" - else: - if not self.options.shared and self.options.fPIC: - libname += "_pic" - return libname + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="COPYING", src=self.source_folder, dst="licenses") - if self.settings.compiler == "Visual Studio": - arch_subdir = { - "x86_64": "x64", - "x86": "x86", - }[str(self.settings.arch)] - self.copy("*.lib", src=os.path.join(self.source_folder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "lib")) - self.copy("*.dll", src=os.path.join(self.source_folder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "bin")) - self.copy("jemalloc.h", src=os.path.join(self.source_folder, "include", "jemalloc"), dst=os.path.join(self.package_folder, "include", "jemalloc"), keep_path=True) + copy(self, pattern="COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install(target="install_lib_shared" if self.options.shared else "install_lib_static") + autotools.install(target="install_include") + if self.settings.os == "Windows" and self.settings.compiler == "gcc": + rename(self, os.path.join(self.package_folder, "lib", f"{self._library_name}.lib"), + os.path.join(self.package_folder, "lib", f"lib{self._library_name}.a")) + if not self.options.shared: + os.unlink(os.path.join(self.package_folder, "lib", "jemalloc.lib")) + if is_msvc(self): shutil.copytree(os.path.join(self.source_folder, "include", "msvc_compat"), os.path.join(self.package_folder, "include", "msvc_compat")) - else: - autotools = self._configure_autotools() - # Use install_lib_XXX and install_include to avoid mixing binaries and dll's - autotools.make(target="install_lib_shared" if self.options.shared else "install_lib_static") - autotools.make(target="install_include") - if self.settings.os == "Windows" and self.settings.compiler == "gcc": - rename(self, os.path.join(self.package_folder, "lib", "{}.lib".format(self._library_name)), - os.path.join(self.package_folder, "lib", "lib{}.a".format(self._library_name))) - if not self.options.shared: - os.unlink(os.path.join(self.package_folder, "lib", "jemalloc.lib")) + if self.options.shared: + rmdir(self, os.path.join(self.package_folder, "lib")) + copy(self, "*.lib", os.path.join(self.build_folder, "lib"), os.path.join(self.package_folder, "lib")) + copy(self, "*.dll", os.path.join(self.build_folder, "lib"), os.path.join(self.package_folder, "bin")) def package_info(self): - self.cpp_info.names["pkg_config"] = "jemalloc" + self.cpp_info.set_property("pkg_config_name", "jemalloc") self.cpp_info.libs = [self._library_name] self.cpp_info.includedirs = [os.path.join(self.package_folder, "include"), os.path.join(self.package_folder, "include", "jemalloc")] - if self.settings.compiler == "Visual Studio": + if is_msvc(self): self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "msvc_compat")) if not self.options.shared: self.cpp_info.defines = ["JEMALLOC_EXPORT="] diff --git a/recipes/jemalloc/all/patches/0002-add-missing-ac-define-description.patch b/recipes/jemalloc/all/patches/0002-add-missing-ac-define-description.patch new file mode 100644 index 0000000000000..7799dfb9e80e3 --- /dev/null +++ b/recipes/jemalloc/all/patches/0002-add-missing-ac-define-description.patch @@ -0,0 +1,13 @@ +diff --git a/configure.ac b/configure.ac +index f6d25f334..3115504e2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1592,7 +1592,7 @@ fi + [enable_uaf_detection="0"] + ) + if test "x$enable_uaf_detection" = "x1" ; then +- AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ]) ++ AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ], ["enable UAF"]) + fi + AC_SUBST([enable_uaf_detection]) + diff --git a/recipes/jemalloc/all/patches/0003-add-missing-cpp-flags-for-windows.patch b/recipes/jemalloc/all/patches/0003-add-missing-cpp-flags-for-windows.patch new file mode 100644 index 0000000000000..6e6e2d1403fb2 --- /dev/null +++ b/recipes/jemalloc/all/patches/0003-add-missing-cpp-flags-for-windows.patch @@ -0,0 +1,12 @@ +diff --git a/configure.ac b/configure.ac +index 3115504e2..ffb504b08 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -749,6 +749,7 @@ case "${host}" in + so="dll" + if test "x$je_cv_msvc" = "xyes" ; then + importlib="lib" ++ JE_APPEND_VS(CPPFLAGS, -DJEMALLOC_NO_PRIVATE_NAMESPACE) + DSO_LDFLAGS="-LD" + EXTRA_LDFLAGS="-link -DEBUG" + CTARGET='-Fo$@' diff --git a/recipes/jemalloc/all/test_package/CMakeLists.txt b/recipes/jemalloc/all/test_package/CMakeLists.txt index 0cc486467b601..718824817866d 100644 --- a/recipes/jemalloc/all/test_package/CMakeLists.txt +++ b/recipes/jemalloc/all/test_package/CMakeLists.txt @@ -1,9 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(jemalloc REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE jemalloc::jemalloc) diff --git a/recipes/jemalloc/all/test_package/conanfile.py b/recipes/jemalloc/all/test_package/conanfile.py index d4128b0450777..d60b533632ddd 100644 --- a/recipes/jemalloc/all/test_package/conanfile.py +++ b/recipes/jemalloc/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 = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + 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/jemalloc/all/test_package/test_package.c b/recipes/jemalloc/all/test_package/test_package.c new file mode 100644 index 0000000000000..cf16dc2c9e11e --- /dev/null +++ b/recipes/jemalloc/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include + +void do_something(size_t i) { + // Leak some memory. + malloc(i * 100); +} + +int main() { + for (size_t i = 0; i < 1000; i++) { + do_something(i); + } + + // Dump allocator statistics to stderr. + malloc_stats_print(NULL, NULL, NULL); + + return 0; +} diff --git a/recipes/jemalloc/all/test_package/test_package.cpp b/recipes/jemalloc/all/test_package/test_package.cpp deleted file mode 100644 index 5d19fec4f824a..0000000000000 --- a/recipes/jemalloc/all/test_package/test_package.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include - -#include - -void -do_something(size_t i) { - // Leak some memory. - malloc(i * 100); -} - -int -main(int argc, char **argv) { - for (size_t i = 0; i < 1000; i++) { - do_something(i); - } - - // Dump allocator statistics to stderr. - malloc_stats_print(NULL, NULL, NULL); - - return 0; -} diff --git a/recipes/jerryscript/all/conanfile.py b/recipes/jerryscript/all/conanfile.py index b262445d3a489..f3c0b457da4f9 100644 --- a/recipes/jerryscript/all/conanfile.py +++ b/recipes/jerryscript/all/conanfile.py @@ -8,7 +8,7 @@ from conan.tools.microsoft import is_msvc from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class JerryScriptStackConan(ConanFile): @@ -132,9 +132,6 @@ def configure(self): if not self.options.debugger: del self.options.keep_line_info - 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") @@ -154,7 +151,7 @@ def validate(self): for check_res, txt in checks: if not check_res: raise ConanInvalidConfiguration(txt) - except ValueError as e: + except ValueError: raise ConanInvalidConfiguration( "jerryscript heap size, gc mark limit, stack limit, " "gc limit should be a positive integer" @@ -170,6 +167,8 @@ def validate(self): 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") + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("jerryscript shared lib is not yet supported under windows") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -212,6 +211,8 @@ def generate(self): 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 + if Version(self.version) < "3.0.0": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() tc = CMakeDeps(self) diff --git a/recipes/jerryscript/all/test_v1_package/CMakeLists.txt b/recipes/jerryscript/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/jerryscript/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index f575dfc3e9c8a..0000000000000 --- a/recipes/jerryscript/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/test_package/CMakeLists.txt b/recipes/jfalcou-eve/all/test_package/CMakeLists.txt index 27bf0e618e9af..5315e76c585c6 100644 --- a/recipes/jfalcou-eve/all/test_package/CMakeLists.txt +++ b/recipes/jfalcou-eve/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(eve REQUIRED CONFIG) diff --git a/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt b/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 999a4a03ed9c9..0000000000000 --- a/recipes/jfalcou-eve/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/jfalcou-eve/all/test_v1_package/conanfile.py b/recipes/jfalcou-eve/all/test_v1_package/conanfile.py deleted file mode 100644 index daab8195118f1..0000000000000 --- a/recipes/jfalcou-eve/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class JfalcouEveConan(ConanFile): - settings = "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/jinja2cpp/all/conandata.yml b/recipes/jinja2cpp/all/conandata.yml index 01898ea7a626a..ef96ec4edd10e 100644 --- a/recipes/jinja2cpp/all/conandata.yml +++ b/recipes/jinja2cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.2": + url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/1.3.2.tar.gz" + sha256: "227afb9d16eb1a47c3f3ca10c2f589dd2791c5d8b4767c73e26a0b8997e4c03e" "1.2.1": url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/1.2.1.tar.gz" sha256: "2e61516fd4fd77452c8dd7a6f958ad47c42990df9b7bdc62cf2deb8aa7819b6c" @@ -6,6 +9,10 @@ sources: url: "https://github.com/jinja2cpp/Jinja2Cpp/archive/1.1.0.tar.gz" sha256: "3d321a144f3774702d3a6252e3a6370cdaff9c96d8761d850bb79cdb45b372c5" patches: + "1.3.2": + - patch_file: "patches/fix-cmake-1.3.2.patch" + patch_description: "use cci package, fix compilation error on MSVC" + patch_type: "conan" "1.2.1": - patch_file: "patches/fix-cmake-1.2.1.patch" patch_description: "use cci package, fix compilation error on MSVC" diff --git a/recipes/jinja2cpp/all/conanfile.py b/recipes/jinja2cpp/all/conanfile.py index 7e812e5ef15e3..a4f69271c3eb5 100644 --- a/recipes/jinja2cpp/all/conanfile.py +++ b/recipes/jinja2cpp/all/conanfile.py @@ -21,10 +21,12 @@ class Jinja2cppConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_regex": ["std", "boost"], } default_options = { "shared": False, "fPIC": True, + "with_regex": "boost", } @property @@ -47,6 +49,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "1.3.2": + del self.options.with_regex def configure(self): if self.options.shared: @@ -66,7 +70,7 @@ def requirements(self): self.requires("fmt/6.2.1") # not compatible with fmt >= 7.0.0 else: self.requires("nlohmann_json/3.11.2") - self.requires("fmt/10.1.1") + self.requires("fmt/10.2.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -76,12 +80,20 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) + if Version(self.version) >= "1.3.1" and self.dependencies["boost"].options.without_json: + raise ConanInvalidConfiguration(f"{self.ref} require Boost::json.") + + def build_requirements(self): + if Version(self.version) >= "1.3.1": + self.tool_requires("cmake/[>=3.23 <4]") 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.3.2": + tc.cache_variables["JINJA2CPP_USE_REGEX"] = self.options.with_regex tc.variables["JINJA2CPP_BUILD_TESTS"] = False tc.variables["JINJA2CPP_STRICT_WARNINGS"] = False tc.variables["JINJA2CPP_BUILD_SHARED"] = self.options.shared @@ -95,6 +107,7 @@ def generate(self): tc.variables["JINJA2CPP_MSVC_RUNTIME_TYPE"] = runtime tc.generate() deps = CMakeDeps(self) + deps.set_property("expected-lite", "cmake_target_name", "expected-lite::expected-lite") deps.generate() def _patch_sources(self): diff --git a/recipes/jinja2cpp/all/patches/fix-cmake-1.3.2.patch b/recipes/jinja2cpp/all/patches/fix-cmake-1.3.2.patch new file mode 100644 index 0000000000000..0484b48da6ca2 --- /dev/null +++ b/recipes/jinja2cpp/all/patches/fix-cmake-1.3.2.patch @@ -0,0 +1,47 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4aabcff..9016742 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -312,7 +312,7 @@ if(JINJA2CPP_INSTALL) + InstallTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + FILE_SET HEADERS + ) + +@@ -353,4 +353,4 @@ if(JINJA2CPP_INSTALL) + DESTINATION + ${JINJA2CPP_INSTALL_CONFIG_DIR} + ) +-endif() +\ No newline at end of file ++endif() +diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt +index 57c8f8e..499f3c7 100644 +--- a/thirdparty/CMakeLists.txt ++++ b/thirdparty/CMakeLists.txt +@@ -70,8 +70,8 @@ endif() + + if (NOT DEFINED JINJA2_PRIVATE_LIBS_INT) + set(JINJA2CPP_PRIVATE_LIBS ${JINJA2CPP_PRIVATE_LIBS} +- Boost::variant Boost::filesystem Boost::algorithm Boost::lexical_cast Boost::json +- Boost::regex Boost::numeric_conversion fmt RapidJson) ++ Boost::headers Boost::filesystem Boost::json ++ Boost::regex 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 e1bc3a4..fd30743 100644 +--- a/thirdparty/thirdparty-conan-build.cmake ++++ b/thirdparty/thirdparty-conan-build.cmake +@@ -10,6 +10,6 @@ find_package(Boost COMPONENTS algorithm filesystem numeric_conversion json optio + find_package(fmt REQUIRED) + find_package(RapidJSON REQUIRED) + +-set(JINJA2_PRIVATE_LIBS_INT Boost::headers Boost::filesystem Boost::numeric_conversion) ++set(JINJA2_PRIVATE_LIBS_INT Boost::headers Boost::filesystem) + set(JINJA2_PUBLIC_LIBS_INT Boost::json fmt::fmt rapidjson Boost::regex + nlohmann_json::nlohmann_json nonstd::expected-lite nonstd::variant-lite nonstd::optional-lite nonstd::string-view-lite) diff --git a/recipes/jinja2cpp/config.yml b/recipes/jinja2cpp/config.yml index 97294286ce46b..6f563b16b51e2 100644 --- a/recipes/jinja2cpp/config.yml +++ b/recipes/jinja2cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.2": + folder: all "1.2.1": folder: all "1.1.0": diff --git a/recipes/jnk0le_ringbuffer/all/conandata.yml b/recipes/jnk0le_ringbuffer/all/conandata.yml new file mode 100644 index 0000000000000..e3e3019c5ae04 --- /dev/null +++ b/recipes/jnk0le_ringbuffer/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240422": + url: "https://github.com/jnk0le/Ring-Buffer/archive/160190e0c985e0181e728a0b9f321f25ac549f20.tar.gz" + sha256: "9984f0f9c9bc453c3e835a9954e0b1914472e3657086accd5d1345a7c7c28e88" diff --git a/recipes/jnk0le_ringbuffer/all/conanfile.py b/recipes/jnk0le_ringbuffer/all/conanfile.py new file mode 100644 index 0000000000000..473c00193624d --- /dev/null +++ b/recipes/jnk0le_ringbuffer/all/conanfile.py @@ -0,0 +1,48 @@ +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 RingBufferConan(ConanFile): + name = "jnk0le_ringbuffer" + description = "simple C++11 ring buffer implementation, allocated and evaluated at compile time" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jnk0le/Ring-Buffer" + topics = ("ring buffer", "compile time", "data-structures", "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="*.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/jnk0le_ringbuffer/all/test_package/CMakeLists.txt b/recipes/jnk0le_ringbuffer/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..75a4d646f54c0 --- /dev/null +++ b/recipes/jnk0le_ringbuffer/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(jnk0le_ringbuffer CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jnk0le_ringbuffer::jnk0le_ringbuffer) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/jnk0le_ringbuffer/all/test_package/conanfile.py b/recipes/jnk0le_ringbuffer/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/jnk0le_ringbuffer/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/jnk0le_ringbuffer/all/test_package/test_package.cpp b/recipes/jnk0le_ringbuffer/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..63ad1c8b9609b --- /dev/null +++ b/recipes/jnk0le_ringbuffer/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +int main() { + // older gcc(4.9, 5.3) has a bug for alignas(0) + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69089 + jnk0le::Ringbuffer message; + + message.insert("Hello world"); + + const char* tmp = nullptr; + message.remove(tmp); + + return 0; +} diff --git a/recipes/jnk0le_ringbuffer/config.yml b/recipes/jnk0le_ringbuffer/config.yml new file mode 100644 index 0000000000000..2dbea38f25622 --- /dev/null +++ b/recipes/jnk0le_ringbuffer/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240422": + folder: all diff --git a/recipes/joltphysics/all/conandata.yml b/recipes/joltphysics/3.x/conandata.yml similarity index 100% rename from recipes/joltphysics/all/conandata.yml rename to recipes/joltphysics/3.x/conandata.yml diff --git a/recipes/joltphysics/all/conanfile.py b/recipes/joltphysics/3.x/conanfile.py similarity index 100% rename from recipes/joltphysics/all/conanfile.py rename to recipes/joltphysics/3.x/conanfile.py diff --git a/recipes/joltphysics/all/patches/2.0.1-0001-fix-cmake.patch b/recipes/joltphysics/3.x/patches/2.0.1-0001-fix-cmake.patch similarity index 100% rename from recipes/joltphysics/all/patches/2.0.1-0001-fix-cmake.patch rename to recipes/joltphysics/3.x/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/3.x/patches/3.0.1-0001-fix-cmake.patch similarity index 100% rename from recipes/joltphysics/all/patches/3.0.1-0001-fix-cmake.patch rename to recipes/joltphysics/3.x/patches/3.0.1-0001-fix-cmake.patch diff --git a/recipes/joltphysics/3.x/test_package/CMakeLists.txt b/recipes/joltphysics/3.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2948371e7a291 --- /dev/null +++ b/recipes/joltphysics/3.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(joltphysics REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE joltphysics::joltphysics) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/joltphysics/3.x/test_package/conanfile.py b/recipes/joltphysics/3.x/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/joltphysics/3.x/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/joltphysics/all/test_package/test_package.cpp b/recipes/joltphysics/3.x/test_package/test_package.cpp similarity index 100% rename from recipes/joltphysics/all/test_package/test_package.cpp rename to recipes/joltphysics/3.x/test_package/test_package.cpp diff --git a/recipes/joltphysics/5.x/conandata.yml b/recipes/joltphysics/5.x/conandata.yml new file mode 100644 index 0000000000000..e5ed48be128c4 --- /dev/null +++ b/recipes/joltphysics/5.x/conandata.yml @@ -0,0 +1,10 @@ +sources: + "5.2.0": + url: "https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v5.2.0.tar.gz" + sha256: "f478afe3050c885e21403748e10ab18e3e8df8b0982c540e75f1e078ef8b2c88" +patches: + "5.2.0": + - patch_file: patches/001-workaround-clang13-macos.patch + patch_type: official + patch_description: "Fix clang error incomplete type 'JPH::Color'" + patch_source: https://github.com/jrouwe/JoltPhysics/pull/1485 diff --git a/recipes/joltphysics/5.x/conanfile.py b/recipes/joltphysics/5.x/conanfile.py new file mode 100644 index 0000000000000..0463e0d2c7a9d --- /dev/null +++ b/recipes/joltphysics/5.x/conanfile.py @@ -0,0 +1,108 @@ +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, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=2.0.9" + + +class JoltPhysicsConan(ConanFile): + name = "joltphysics" + description = ( + "A multi core friendly rigid body physics and collision detection " + "library, written in C++, suitable for games and VR applications." + ) + license = "MIT" + topics = ("physics", "simulation", "physics-engine", "physics-simulation", "rigid-body", "game", "collision") + homepage = "https://github.com/jrouwe/JoltPhysics" + 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, + } + implements = ["auto_shared_fpic"] + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.20 <4]") + + def validate(self): + check_min_cppstd(self, 17) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["TARGET_UNIT_TESTS"] = False + tc.cache_variables["TARGET_HELLO_WORLD"] = False + tc.cache_variables["TARGET_PERFORMANCE_TEST"] = False + tc.cache_variables["TARGET_SAMPLES"] = False + tc.cache_variables["TARGET_VIEWER"] = False + tc.cache_variables["CROSS_PLATFORM_DETERMINISTIC"] = False + tc.cache_variables["INTERPROCEDURAL_OPTIMIZATION"] = False + tc.cache_variables["GENERATE_DEBUG_SYMBOLS"] = False + tc.cache_variables["ENABLE_ALL_WARNINGS"] = False + tc.cache_variables["OVERRIDE_CXX_FLAGS"] = False + tc.cache_variables["DEBUG_RENDERER_IN_DEBUG_AND_RELEASE"] = False + tc.cache_variables["PROFILER_IN_DEBUG_AND_RELEASE"] = False + if is_msvc(self): + tc.cache_variables["USE_STATIC_MSVC_RUNTIME_LIBRARY"] = is_msvc_static_runtime(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "Build")) + 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")) + rm(self, "*.cmake", os.path.join(self.package_folder, "include", "Jolt")) + + def package_info(self): + self.cpp_info.libs = ["Jolt"] + self.cpp_info.set_property("cmake_file_name", "Jolt") + self.cpp_info.set_property("cmake_target_name", "Jolt::Jolt") + # INFO: The CMake option ENABLE_OBJECT_STREAM is enabled by default and defines JPH_OBJECT_STREAM as public + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Build/CMakeLists.txt#L95C8-L95C28 + self.cpp_info.defines = ["JPH_OBJECT_STREAM"] + # INFO: Public defines exposed in include/Jolt/Jolt.cmake + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Build/CMakeLists.txt#L51 + if self.settings.arch in ["x86_64", "x86"]: + self.cpp_info.defines.extend(["JPH_USE_AVX2", "JPH_USE_AVX", "JPH_USE_SSE4_1", + "JPH_USE_SSE4_2", "JPH_USE_LZCNT", "JPH_USE_TZCNT", + "JPH_USE_F16C", "JPH_USE_FMADD"]) + if is_msvc(self): + # INFO: Floating point exceptions are enabled by default + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Build/CMakeLists.txt#L37 + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Jolt/Jolt.cmake#L529 + self.cpp_info.defines.append("JPH_FLOATING_POINT_EXCEPTIONS_ENABLED") + + if self.options.shared: + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Jolt/Jolt.cmake#L495 + self.cpp_info.defines.append("JPH_SHARED_LIBRARY") + + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Build/CMakeLists.txt#L48 + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Jolt/Jolt.cmake#L554 + self.cpp_info.defines.append("JPH_OBJECT_LAYER_BITS=16") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/joltphysics/5.x/patches/001-workaround-clang13-macos.patch b/recipes/joltphysics/5.x/patches/001-workaround-clang13-macos.patch new file mode 100644 index 0000000000000..8907011d013c4 --- /dev/null +++ b/recipes/joltphysics/5.x/patches/001-workaround-clang13-macos.patch @@ -0,0 +1,51 @@ +From 751bb485c0437c176a8ba8f6f98b155a6d53906d Mon Sep 17 00:00:00 2001 +From: Jorrit Rouwe +Date: Wed, 29 Jan 2025 21:18:35 +0100 +Subject: [PATCH] Workaround for compile error in clang 13 on macOS + +Fixes #1482 +--- + Jolt/Core/Color.h | 2 +- + Jolt/Geometry/OrientedBox.h | 2 +- + Jolt/Physics/Body/Body.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Jolt/Core/Color.h b/Jolt/Core/Color.h +index d07390de1..7706ca85b 100644 +--- a/Jolt/Core/Color.h ++++ b/Jolt/Core/Color.h +@@ -12,7 +12,7 @@ class Color; + using ColorArg = Color; + + /// Class that holds an RGBA color with 8-bits per component +-class [[nodiscard]] JPH_EXPORT_GCC_BUG_WORKAROUND Color ++class JPH_EXPORT_GCC_BUG_WORKAROUND [[nodiscard]] Color + { + public: + /// Constructors +diff --git a/Jolt/Geometry/OrientedBox.h b/Jolt/Geometry/OrientedBox.h +index c5c2a0e16..e15126661 100644 +--- a/Jolt/Geometry/OrientedBox.h ++++ b/Jolt/Geometry/OrientedBox.h +@@ -14,7 +14,7 @@ JPH_NAMESPACE_BEGIN + class AABox; + + /// Oriented box +-class [[nodiscard]] JPH_EXPORT_GCC_BUG_WORKAROUND OrientedBox ++class JPH_EXPORT_GCC_BUG_WORKAROUND [[nodiscard]] OrientedBox + { + public: + JPH_OVERRIDE_NEW_DELETE +diff --git a/Jolt/Physics/Body/Body.h b/Jolt/Physics/Body/Body.h +index 63034f909..e8831a309 100644 +--- a/Jolt/Physics/Body/Body.h ++++ b/Jolt/Physics/Body/Body.h +@@ -31,7 +31,7 @@ class SoftBodyCreationSettings; + /// The functions that get/set the position of the body all indicate if they are relative to the center of mass or to the original position in which the shape was created. + /// + /// The linear velocity is also velocity of the center of mass, to correct for this: \f$VelocityCOM = Velocity - AngularVelocity \times ShapeCOM\f$. +-class alignas(JPH_RVECTOR_ALIGNMENT) JPH_EXPORT_GCC_BUG_WORKAROUND Body : public NonCopyable ++class JPH_EXPORT_GCC_BUG_WORKAROUND alignas(JPH_RVECTOR_ALIGNMENT) Body : public NonCopyable + { + public: + JPH_OVERRIDE_NEW_DELETE diff --git a/recipes/joltphysics/5.x/test_package/CMakeLists.txt b/recipes/joltphysics/5.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..080b63d50fff6 --- /dev/null +++ b/recipes/joltphysics/5.x/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Jolt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Jolt::Jolt) diff --git a/recipes/joltphysics/5.x/test_package/conanfile.py b/recipes/joltphysics/5.x/test_package/conanfile.py new file mode 100644 index 0000000000000..87901dd77830a --- /dev/null +++ b/recipes/joltphysics/5.x/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 = "CMakeToolchain", "CMakeDeps" + + 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/joltphysics/5.x/test_package/test_package.cpp b/recipes/joltphysics/5.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..f37b8c6cafa56 --- /dev/null +++ b/recipes/joltphysics/5.x/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include +#include +#include + + +int main() { + JPH::RegisterDefaultAllocator(); + auto factory = JPH::Factory(); + JPH::UnregisterTypes(); + return EXIT_SUCCESS; +} diff --git a/recipes/joltphysics/all/test_package/CMakeLists.txt b/recipes/joltphysics/all/test_package/CMakeLists.txt deleted file mode 100644 index 0b69831ca4aa0..0000000000000 --- a/recipes/joltphysics/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -find_package(joltphysics REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE joltphysics::joltphysics) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/joltphysics/all/test_v1_package/CMakeLists.txt b/recipes/joltphysics/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/joltphysics/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/joltphysics/all/test_v1_package/conanfile.py b/recipes/joltphysics/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/joltphysics/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_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/joltphysics/config.yml b/recipes/joltphysics/config.yml index 41bbdfae2300d..2a48b28a6e4c3 100644 --- a/recipes/joltphysics/config.yml +++ b/recipes/joltphysics/config.yml @@ -1,5 +1,7 @@ versions: + "5.2.0": + folder: 5.x "3.0.1": - folder: all + folder: 3.x "2.0.1": - folder: all + folder: 3.x diff --git a/recipes/jom/all/conandata.yml b/recipes/jom/all/conandata.yml index 0fe464cf0c395..357d5aaf0b208 100644 --- a/recipes/jom/all/conandata.yml +++ b/recipes/jom/all/conandata.yml @@ -1,4 +1,51 @@ sources: + "1.1.4": + x86_64: + url: + - "http://download.qt.io/official_releases/jom/jom_1_1_4.zip" + - "https://qt-mirror.dannhauer.de/official_releases/jom/jom_1_1_4.zip" + - "https://mirror.netcologne.de/qtproject/official_releases/jom/jom_1_1_4.zip" + - "https://ftp.fau.de/qtproject/official_releases/jom/jom_1_1_4.zip" + - "https://ftp.nluug.nl/languages/qt/official_releases/jom/jom_1_1_4.zip" + - "https://mirrors.dotsrc.org/qtproject/official_releases/jom/jom_1_1_4.zip" + - "https://mirrors.20i.com/pub/qt.io/official_releases/jom/jom_1_1_4.zip" + - "https://mirrors.ukfast.co.uk/sites/qt.io/official_releases/jom/jom_1_1_4.zip" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/official_releases/jom/jom_1_1_4.zip" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/official_releases/jom/jom_1_1_4.zip" + - "https://qt.mirror.constant.com/official_releases/jom/jom_1_1_4.zip" + - "https://mirrors.cloud.tencent.com/qt/official_releases/jom/jom_1_1_4.zip" + - "https://mirror.bjtu.edu.cn/qt/official_releases/jom/jom_1_1_4.zip" + - "https://mirrors.ustc.edu.cn/qtproject/official_releases/jom/jom_1_1_4.zip" + - "https://ftp.jaist.ac.jp/pub/qtproject/official_releases/jom/jom_1_1_4.zip" + - "https://mirror.aarnet.edu.au/pub/qtproject/official_releases/jom/jom_1_1_4.zip" + sha256: "d533c1ef49214229681e90196ed2094691e8c4a0a0bef0b2c901debcb562682b" + license: + url: + - "https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v1.1.3" + - "https://raw.githubusercontent.com/qt-labs/jom/refs/tags/v1.1.3/LICENSE.GPL" + sha256: "d3d9052b838761dbe00067168ed9ebc437734d53ebf71dea1c8e9f7532a5333b" "1.1.3": - sha256: "128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8" - url: "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" + x86_64: + url: + - "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" + - "https://qt-mirror.dannhauer.de/official_releases/jom/jom_1_1_3.zip" + - "https://mirror.netcologne.de/qtproject/official_releases/jom/jom_1_1_3.zip" + - "https://ftp.fau.de/qtproject/official_releases/jom/jom_1_1_3.zip" + - "https://ftp.nluug.nl/languages/qt/official_releases/jom/jom_1_1_3.zip" + - "https://mirrors.dotsrc.org/qtproject/official_releases/jom/jom_1_1_3.zip" + - "https://mirrors.20i.com/pub/qt.io/official_releases/jom/jom_1_1_3.zip" + - "https://mirrors.ukfast.co.uk/sites/qt.io/official_releases/jom/jom_1_1_3.zip" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/official_releases/jom/jom_1_1_3.zip" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/official_releases/jom/jom_1_1_3.zip" + - "https://qt.mirror.constant.com/official_releases/jom/jom_1_1_3.zip" + - "https://mirrors.cloud.tencent.com/qt/official_releases/jom/jom_1_1_3.zip" + - "https://mirror.bjtu.edu.cn/qt/official_releases/jom/jom_1_1_3.zip" + - "https://mirrors.ustc.edu.cn/qtproject/official_releases/jom/jom_1_1_3.zip" + - "https://ftp.jaist.ac.jp/pub/qtproject/official_releases/jom/jom_1_1_3.zip" + - "https://mirror.aarnet.edu.au/pub/qtproject/official_releases/jom/jom_1_1_3.zip" + sha256: "128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8" + license: + url: + - "https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v1.1.3" + - "https://raw.githubusercontent.com/qt-labs/jom/refs/tags/v1.1.3/LICENSE.GPL" + sha256: "d3d9052b838761dbe00067168ed9ebc437734d53ebf71dea1c8e9f7532a5333b" diff --git a/recipes/jom/all/conanfile.py b/recipes/jom/all/conanfile.py index 4962bc3e3e42f..6605c75c3ffa3 100644 --- a/recipes/jom/all/conanfile.py +++ b/recipes/jom/all/conanfile.py @@ -30,8 +30,8 @@ def source(self): pass def build(self): - get(self, **self.conan_data["sources"][self.version]) - download(self, f"https://code.qt.io/cgit/qt-labs/jom.git/plain/LICENSE.GPL?h=v{self.version}", filename="LICENSE.GPL") + get(self, **self.conan_data["sources"][self.version]["x86_64"]) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE.GPL") def package(self): copy(self, "LICENSE.GPL", self.build_folder, os.path.join(self.package_folder, "licenses")) diff --git a/recipes/jom/all/test_v1_package/conanfile.py b/recipes/jom/all/test_v1_package/conanfile.py deleted file mode 100644 index 524a49a286047..0000000000000 --- a/recipes/jom/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,13 +0,0 @@ -from conans import ConanFile -from conan.tools.build import can_run - - -class TestPackageV1Conan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def build(self): - pass - - def test(self): - if can_run(self): - self.run("jom /VERSION", run_environment=True) diff --git a/recipes/jom/config.yml b/recipes/jom/config.yml index e1c4f3be24983..7f3d713ab8481 100644 --- a/recipes/jom/config.yml +++ b/recipes/jom/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.4": + folder: all "1.1.3": folder: all diff --git a/recipes/jpcre2/all/test_v1_package/CMakeLists.txt b/recipes/jpcre2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/jpcre2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/jpcre2/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", "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/jpeg-compressor/all/test_package/CMakeLists.txt b/recipes/jpeg-compressor/all/test_package/CMakeLists.txt index 25752a9cef844..9804556182713 100644 --- a/recipes/jpeg-compressor/all/test_package/CMakeLists.txt +++ b/recipes/jpeg-compressor/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(jpeg-compressor REQUIRED CONFIG) diff --git a/recipes/jpeg-compressor/all/test_package/conanfile.py b/recipes/jpeg-compressor/all/test_package/conanfile.py index ea70607af0172..0a6bc68712d90 100644 --- a/recipes/jpeg-compressor/all/test_package/conanfile.py +++ b/recipes/jpeg-compressor/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_path = os.path.join(self.source_folder, "testimg.jpg") - self.run(f"{bin_path} {img_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/jpeg-compressor/all/test_package/test_package.cpp b/recipes/jpeg-compressor/all/test_package/test_package.cpp index ef3f49c1a1fba..956e76e45a8b0 100644 --- a/recipes/jpeg-compressor/all/test_package/test_package.cpp +++ b/recipes/jpeg-compressor/all/test_package/test_package.cpp @@ -5,29 +5,21 @@ int main(int argc, const char* argv[]) { - if (argc < 2) { - std::cerr << "Need at least one argument" << std::endl; - return 1; - } - - const char* pSrc_filename = argv[1]; + const char* pSrc_filename = "non-real-file.jpg"; const int req_comps = 4; int width = 0, height = 0, actual_comps = 0; uint8_t* pImage_data = jpgd::decompress_jpeg_image_from_file(pSrc_filename, &width, &height, &actual_comps, req_comps); if (!pImage_data) { - std::cerr << "Failed loading file " << pSrc_filename << std::endl; - return EXIT_FAILURE; + std::cerr << "Test jpgd function" << std::endl;// Always displayed } int buf_size = width * height * 3; - if (buf_size < 1024) buf_size = 1024; void* pBuf = malloc(buf_size); if (!jpge::compress_image_to_jpeg_file_in_memory(pBuf, buf_size, width, height, req_comps, pImage_data)) { - std::cerr << "Failed creating JPEG data" << std::endl; - return EXIT_FAILURE; + std::cerr << "Test jpge function" << std::endl;// Always displayed } free(pBuf); diff --git a/recipes/jpeg-compressor/all/test_package/testimg.jpg b/recipes/jpeg-compressor/all/test_package/testimg.jpg deleted file mode 100644 index a026e486f57de..0000000000000 Binary files a/recipes/jpeg-compressor/all/test_package/testimg.jpg and /dev/null differ diff --git a/recipes/jpeg-compressor/all/test_v1_package/CMakeLists.txt b/recipes/jpeg-compressor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/jpeg-compressor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/jpeg-compressor/all/test_v1_package/conanfile.py b/recipes/jpeg-compressor/all/test_v1_package/conanfile.py deleted file mode 100644 index ff285a92f9ca9..0000000000000 --- a/recipes/jpeg-compressor/all/test_v1_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 = os.path.join("bin", "test_package") - img_path = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_path}", run_environment=True) diff --git a/recipes/jsbsim/all/conanfile.py b/recipes/jsbsim/all/conanfile.py index 3d180281b5649..048e4a19a18e0 100644 --- a/recipes/jsbsim/all/conanfile.py +++ b/recipes/jsbsim/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/jsbsim/all/test_v1_package/CMakeLists.txt b/recipes/jsbsim/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/jsbsim/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/jsbsim/all/test_v1_package/conanfile.py b/recipes/jsbsim/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/jsbsim/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_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/jsmn/all/test_package/CMakeLists.txt b/recipes/jsmn/all/test_package/CMakeLists.txt index 1b2a676ec01f1..b327cdb615398 100644 --- a/recipes/jsmn/all/test_package/CMakeLists.txt +++ b/recipes/jsmn/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(jsmn REQUIRED CONFIG) diff --git a/recipes/jsmn/all/test_v1_package/CMakeLists.txt b/recipes/jsmn/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/jsmn/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/jsmn/all/test_v1_package/conanfile.py b/recipes/jsmn/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/jsmn/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_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-c/all/conandata.yml b/recipes/json-c/all/conandata.yml index a27364e09b956..71904777ad4e0 100644 --- a/recipes/json-c/all/conandata.yml +++ b/recipes/json-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.18": + url: "https://github.com/json-c/json-c/archive/json-c-0.18-20240915.tar.gz" + sha256: "3112c1f25d39eca661fe3fc663431e130cc6e2f900c081738317fba49d29e298" "0.17": url: "https://github.com/json-c/json-c/archive/json-c-0.17-20230812.tar.gz" sha256: "024d302a3aadcbf9f78735320a6d5aedf8b77876c8ac8bbb95081ca55054c7eb" diff --git a/recipes/json-c/all/conanfile.py b/recipes/json-c/all/conanfile.py index 8963e15ae1e8f..8d858064f9921 100644 --- a/recipes/json-c/all/conanfile.py +++ b/recipes/json-c/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 collect_libs, copy, get, rmdir +from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version import os @@ -9,13 +9,13 @@ class JSONCConan(ConanFile): name = "json-c" - package_type = "library" - description = "JSON-C - A JSON implementation in C" - topics = ("json", "encoding", "decoding", "manipulation") + description = "A JSON implementation in C" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/json-c/json-c" - license = "MIT" + topics = ("json", "encoding", "decoding", "manipulation") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -47,8 +47,13 @@ def generate(self): if Version(self.version) >= "0.15": tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared tc.variables["DISABLE_STATIC_FPIC"] = not self.options.get_safe("fPIC", True) - # To install relocatable shared libs on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["BUILD_TESTING"] = False + if Version(self.version) < "0.17": + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + else: + tc.cache_variables["BUILD_APPS"] = False tc.generate() def build(self): @@ -64,7 +69,12 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): + self.cpp_info.libs = ["json-c"] + self.cpp_info.set_property("cmake_file_name", "json-c") self.cpp_info.set_property("cmake_target_name", "json-c::json-c") self.cpp_info.set_property("pkg_config_name", "json-c") - self.cpp_info.libs = collect_libs(self) + self.cpp_info.includedirs = ["include", os.path.join("include", "json-c")] + + if Version(self.version) >= "0.17" and self.settings.os in ["Linux", "FreeBSD", "Neutrino"]: + self.cpp_info.system_libs.extend(["m",]) diff --git a/recipes/json-c/all/test_package/CMakeLists.txt b/recipes/json-c/all/test_package/CMakeLists.txt index 5e91efdaa1c1c..2e2ed54181e78 100644 --- a/recipes/json-c/all/test_package/CMakeLists.txt +++ b/recipes/json-c/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(json-c REQUIRED CONFIG) diff --git a/recipes/json-c/all/test_v1_package/CMakeLists.txt b/recipes/json-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/json-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/json-c/all/test_v1_package/conanfile.py b/recipes/json-c/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/json-c/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_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-c/config.yml b/recipes/json-c/config.yml index 301a8d09f5b3a..0a8630e20d06f 100644 --- a/recipes/json-c/config.yml +++ b/recipes/json-c/config.yml @@ -1,4 +1,6 @@ versions: + "0.18": + folder: all "0.17": folder: all "0.16": 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 2d269b725c767..312888fba61cb 100644 --- a/recipes/json-schema-validator/all/conanfile.py +++ b/recipes/json-schema-validator/all/conanfile.py @@ -13,10 +13,10 @@ 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" @@ -37,7 +37,6 @@ class JsonSchemaValidatorConan(ConanFile): "fPIC": True, "json_diagnostics": False, } - short_paths = True @property @@ -69,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( @@ -92,6 +95,9 @@ 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": @@ -147,6 +153,8 @@ def package_info(self): 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..00a08c7db6ca3 100644 --- a/recipes/json-schema-validator/all/test_package/CMakeLists.txt +++ b/recipes/json-schema-validator/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) 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/all/test_v1_package/CMakeLists.txt b/recipes/json-schema-validator/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/json-schema-validator/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/json-schema-validator/all/test_v1_package/conanfile.py b/recipes/json-schema-validator/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/json-schema-validator/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_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-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 48460b81acb17..504fe8367f255 100644 --- a/recipes/json_dto/all/conandata.yml +++ b/recipes/json_dto/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.3.4": + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.3.4.tar.gz" + sha256: "1b9595dbd86fa90edf621b72f5f4dac43170339250e9e650ede5269ff6fa3f2e" + "0.3.3": + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.3.3.tar.gz" + sha256: "c52857c074f4e204426a52160e2699694c45bb93e9297ca535e2d5fdf54ae187" + "0.3.2": + url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.3.2.tar.gz" + sha256: "425d31c06c4e7f82d6414969fcdeaccb95ab44063c08296984ea0703de445744" "0.3.1": url: "https://github.com/Stiffstream/json_dto/archive/refs/tags/v.0.3.1.tar.gz" sha256: "515a2d1510d3d8f8b240eb2149f44aeb47a70d26a7071609cca45c0ee198d1d1" @@ -11,12 +20,3 @@ sources: "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 59d836f777070..ce69026f02b64 100644 --- a/recipes/json_dto/all/conanfile.py +++ b/recipes/json_dto/all/conanfile.py @@ -12,13 +12,13 @@ class JsonDtoConan(ConanFile): name = "json_dto" + description = "A small header-only helper for converting data between json representation and c++ structs" 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") + homepage = "https://github.com/Stiffstream/json_dto" + topics = ("json", "dto", "serialization", "header-only") package_type = "header-library" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property @@ -52,6 +52,11 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) + # several gcc doesn't allow "this" in noexcept clauses due to bug. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100752 + if Version(self.version) >= "0.3.2" and \ + self.settings.compiler == "gcc" and \ + (Version(self.settings.compiler.version) < "9.0" or Version(self.settings.compiler.version).major == 11): + raise ConanInvalidConfiguration(f"{self.ref} requires gcc 9, 10 or 12 later") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/json_dto/all/test_v1_package/CMakeLists.txt b/recipes/json_dto/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/json_dto/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/json_dto/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_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 87de86e844c69..78d5c217becaf 100644 --- a/recipes/json_dto/config.yml +++ b/recipes/json_dto/config.yml @@ -1,4 +1,10 @@ versions: + "0.3.4": + folder: all + "0.3.3": + folder: all + "0.3.2": + folder: all "0.3.1": folder: all "0.3.0": @@ -7,9 +13,3 @@ versions: folder: all "0.2.14": folder: all - "0.2.13": - folder: all - "0.2.12": - folder: all - "0.2.11": - folder: all diff --git a/recipes/json_struct/all/conandata.yml b/recipes/json_struct/all/conandata.yml new file mode 100644 index 0000000000000..31102ff6a0fa4 --- /dev/null +++ b/recipes/json_struct/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.2": + url: "https://github.com/jorgen/json_struct/archive/refs/tags/1.0.2.tar.gz" + sha256: "c424ae3e8dbe6846311cb878d2d400c98a297a28eb1556961a985b6ed7b16090" diff --git a/recipes/json_struct/all/conanfile.py b/recipes/json_struct/all/conanfile.py new file mode 100644 index 0000000000000..b269918faa003 --- /dev/null +++ b/recipes/json_struct/all/conanfile.py @@ -0,0 +1,42 @@ +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 JsonStructConan(ConanFile): + name = "json_struct" + description = "json_struct is a single header only C++ library for parsing JSON directly to C++ structs and vice versa" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jorgen/json_struct" + + topics = ("serialization", "deserialization", "reflection", "json") + + settings = "os", "compiler", "build_type", "arch" + package_type = "header-library" + no_copy_source = True + + def validate(self): + check_min_cppstd(self, 14) + + 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): + self.info.clear() + + # Copy all files to the package folder + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), + ) diff --git a/recipes/json_struct/all/test_package/CMakeLists.txt b/recipes/json_struct/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2c8c0eb28ba17 --- /dev/null +++ b/recipes/json_struct/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) + +project(JsonStructTester + DESCRIPTION "Tester package for json_struct" + LANGUAGES C CXX) + +find_package(json_struct REQUIRED) + +add_executable(${PROJECT_NAME} main.cpp) + +target_link_libraries(${PROJECT_NAME} json_struct::json_struct) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) diff --git a/recipes/json_struct/all/test_package/conanfile.py b/recipes/json_struct/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f0d4e6b76d579 --- /dev/null +++ b/recipes/json_struct/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class JsonStructTest(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 can_run(self): + self.output.info("Checking compiled tester...") + cmd = os.path.join(self.cpp.build.bindir, "JsonStructTester") + self.run(cmd, env="conanrun") + diff --git a/recipes/json_struct/all/test_package/main.cpp b/recipes/json_struct/all/test_package/main.cpp new file mode 100644 index 0000000000000..a61797c693d60 --- /dev/null +++ b/recipes/json_struct/all/test_package/main.cpp @@ -0,0 +1,21 @@ +#include "json_struct/json_struct.h" +#include + +struct MyTestStruct +{ + std::string name; + unsigned age; + JS_OBJ(name, age); +}; + +int main() +{ + MyTestStruct person; + person.name="Jonh"; + person.age=23; + + std::string person_json = JS::serializeStruct(person); + std::cout << person_json << std::endl; + + return 0; +} diff --git a/recipes/json_struct/config.yml b/recipes/json_struct/config.yml new file mode 100644 index 0000000000000..8457ca9a4a8cd --- /dev/null +++ b/recipes/json_struct/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.2": + folder: all diff --git a/recipes/jsoncons/all/conandata.yml b/recipes/jsoncons/all/conandata.yml index b5e73a3ea8b91..9302da578ef18 100644 --- a/recipes/jsoncons/all/conandata.yml +++ b/recipes/jsoncons/all/conandata.yml @@ -1,22 +1,19 @@ sources: - "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" + "1.3.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v1.3.0.tar.gz" + sha256: "7a485c2af0ff214b62bb00f5a1487e5a0c4997eadc6ee9155ce3e8c9d05b9d7a" + "1.2.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v1.2.0.tar.gz" + sha256: "3bdc0c8ceba1943b5deb889559911ebe97377971453a11227ed0a51a05e5d5d8" + "1.0.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v1.0.0.tar.gz" + sha256: "5b602e131761a3eb0fc85043a67e8006f04fa0ce2f2012aeca48371cd99ec85f" + "0.178.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.178.0.tar.gz" + sha256: "c531b4288bb08c9c2b36fba53f568bc800e93656830bcffc18a87a3af1f46290" + "0.177.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.177.0.tar.gz" + sha256: "a381d58489f143a3a515484f4ad6e32ae4d977033e1a455fecf8cdc4e2c9a49e" + "0.176.0": + url: "https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.176.0.tar.gz" + sha256: "2eb50b5cbe204265fef96c052511ed6e3b8808935c6e2c8d28e0aba7b08fda33" diff --git a/recipes/jsoncons/all/conanfile.py b/recipes/jsoncons/all/conanfile.py index 54b1abb2a2c3e..024d9ca4f4ac2 100644 --- a/recipes/jsoncons/all/conanfile.py +++ b/recipes/jsoncons/all/conanfile.py @@ -1,12 +1,10 @@ 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" +required_conan_version = ">=2.0" class JsonconsConan(ConanFile): @@ -26,21 +24,6 @@ class JsonconsConan(ConanFile): settings = "os", "arch", "compiler", "build_type" no_copy_source = True - @property - def _min_cppstd(self): - return "11" if Version(self.version) < "0.172.0" else "14" - - @property - def _compilers_minimum_version(self): - return { - "14": { - "gcc": "6", - "clang": "5", - "apple-clang": "10", - "Visual Studio": "15", - "msvc": "191", - }, - }.get(self._min_cppstd, {}) def layout(self): basic_layout(self, src_folder="src") @@ -49,13 +32,7 @@ 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." - ) + check_min_cppstd(self, "14") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -70,7 +47,3 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "jsoncons") self.cpp_info.set_property("cmake_target_name", "jsoncons") - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "jsoncons" - self.cpp_info.names["cmake_find_package_multi"] = "jsoncons" diff --git a/recipes/jsoncons/all/test_package/CMakeLists.txt b/recipes/jsoncons/all/test_package/CMakeLists.txt index 067c8673df55b..17601f6e0145e 100644 --- a/recipes/jsoncons/all/test_package/CMakeLists.txt +++ b/recipes/jsoncons/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(jsoncons CONFIG REQUIRED) diff --git a/recipes/jsoncons/all/test_v1_package/CMakeLists.txt b/recipes/jsoncons/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a5743e33125cd..0000000000000 --- a/recipes/jsoncons/all/test_v1_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(jsoncons CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE jsoncons::jsoncons) -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/conanfile.py b/recipes/jsoncons/all/test_v1_package/conanfile.py deleted file mode 100644 index 8037a9296cc42..0000000000000 --- a/recipes/jsoncons/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -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/jsoncons/config.yml b/recipes/jsoncons/config.yml index e0e954ddc8022..3bbc4313783c6 100644 --- a/recipes/jsoncons/config.yml +++ b/recipes/jsoncons/config.yml @@ -1,15 +1,13 @@ versions: - "0.173.0": + "1.3.0": folder: "all" - "0.172.1": + "1.2.0": folder: "all" - "0.172.0": + "1.0.0": folder: "all" - "0.171.1": + "0.178.0": folder: "all" - "0.171.0": + "0.177.0": folder: "all" - "0.170.2": - folder: "all" - "0.169.0": + "0.176.0": folder: "all" diff --git a/recipes/jsoncpp/all/conandata.yml b/recipes/jsoncpp/all/conandata.yml index b5b4f5372dd99..8973aaac6a3fe 100644 --- a/recipes/jsoncpp/all/conandata.yml +++ b/recipes/jsoncpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.9.6": + url: https://github.com/open-source-parsers/jsoncpp/archive/1.9.6.tar.gz + sha256: f93b6dd7ce796b13d02c108bc9f79812245a82e577581c4c9aabe57075c90ea2 "1.9.5": url: https://github.com/open-source-parsers/jsoncpp/archive/1.9.5.tar.gz sha256: f409856e5920c18d0c2fb85276e24ee607d2a09b5e7d5f0a371368903c275da2 diff --git a/recipes/jsoncpp/all/conanfile.py b/recipes/jsoncpp/all/conanfile.py index 1354ccb9d1943..dc347bac0be0d 100644 --- a/recipes/jsoncpp/all/conanfile.py +++ b/recipes/jsoncpp/all/conanfile.py @@ -11,12 +11,12 @@ class JsoncppConan(ConanFile): name = "jsoncpp" + description = "A C++ library for interacting with JSON." license = "MIT" - homepage = "https://github.com/open-source-parsers/jsoncpp" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/open-source-parsers/jsoncpp" topics = ("json", "parser", "config") - description = "A C++ library for interacting with JSON." - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/jsoncpp/all/test_package/CMakeLists.txt b/recipes/jsoncpp/all/test_package/CMakeLists.txt index 3a610a43f2758..87868561296d8 100644 --- a/recipes/jsoncpp/all/test_package/CMakeLists.txt +++ b/recipes/jsoncpp/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(jsoncpp REQUIRED CONFIG) diff --git a/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt b/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/jsoncpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/jsoncpp/all/test_v1_package/conanfile.py b/recipes/jsoncpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/jsoncpp/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_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/jsoncpp/config.yml b/recipes/jsoncpp/config.yml index e11b41080c02a..f4837dd548b8a 100644 --- a/recipes/jsoncpp/config.yml +++ b/recipes/jsoncpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.9.6": + folder: all "1.9.5": folder: all "1.9.4": diff --git a/recipes/jsonformoderncpp/all/test_package/CMakeLists.txt b/recipes/jsonformoderncpp/all/test_package/CMakeLists.txt index 33ae887aa6aea..d6cd92c156ed4 100644 --- a/recipes/jsonformoderncpp/all/test_package/CMakeLists.txt +++ b/recipes/jsonformoderncpp/all/test_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/jsonifier/all/conandata.yml b/recipes/jsonifier/all/conandata.yml new file mode 100644 index 0000000000000..d326552c7b2a5 --- /dev/null +++ b/recipes/jsonifier/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.9.97": + url: "https://github.com/RealTimeChris/Jsonifier/archive/refs/tags/v0.9.97.tar.gz" + sha256: "68828c982a994862b02bcee562ee4e6d7cc461013ac3d4dcb98c0f1581049924" + "0.9.96": + url: "https://github.com/RealTimeChris/Jsonifier/archive/refs/tags/v0.9.96.tar.gz" + sha256: "9f2658282f53680be0121091adacc8f82b2de5b95c31bc6eadb98802c0aa59f0" + "0.9.95": + url: "https://github.com/RealTimeChris/Jsonifier/archive/refs/tags/v0.9.95.tar.gz" + sha256: "4db5fd2c4ae77bbd13e4f80fcc255edb39835cb5cf00d33468cb957af04d933b" diff --git a/recipes/jsonifier/all/conanfile.py b/recipes/jsonifier/all/conanfile.py new file mode 100644 index 0000000000000..5dcf12ea3c5b0 --- /dev/null +++ b/recipes/jsonifier/all/conanfile.py @@ -0,0 +1,72 @@ +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.scm import Version +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.53.0" + +class JsonifierConan(ConanFile): + name = "jsonifier" + description = "A few classes for parsing and serializing objects from/into JSON - very rapidly." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/RealTimeChris/Jsonifier" + topics = ("serialization", "json", "simd", "parswer", "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", + "clang": "17", + "apple-clang": "14", + "Visual Studio": "17", + "msvc": "193", + } + + 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) + 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.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, "share")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/jsonifier/all/test_package/CMakeLists.txt b/recipes/jsonifier/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..386a7df4b60c0 --- /dev/null +++ b/recipes/jsonifier/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) +find_package(jsonifier REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE jsonifier::jsonifier) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/jsonifier/all/test_package/conanfile.py b/recipes/jsonifier/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/jsonifier/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/jsonifier/all/test_package/test_package.cpp b/recipes/jsonifier/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..21035cf3ed4c1 --- /dev/null +++ b/recipes/jsonifier/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include +#include + +#include "jsonifier/Index.hpp" + +struct MyObject { + std::string name; + int age; +}; + +template<> struct jsonifier::core { + using value_type = MyObject; + static constexpr auto parseValue = createValue("name", &value_type::name, "age", &value_type::age); +}; + +int main() { + MyObject obj("John", 30); + jsonifier::jsonifier_core jsonifier{}; + std::string jsonBuffer{}; + jsonifier.serializeJson(obj, jsonBuffer); + + std::cout << jsonBuffer << std::endl; + + return 0; +} diff --git a/recipes/jsonifier/config.yml b/recipes/jsonifier/config.yml new file mode 100644 index 0000000000000..f8a1d2a6df61b --- /dev/null +++ b/recipes/jsonifier/config.yml @@ -0,0 +1,7 @@ +versions: + "0.9.97": + folder: all + "0.9.96": + folder: all + "0.9.95": + folder: all diff --git a/recipes/jsonnet/all/conanfile.py b/recipes/jsonnet/all/conanfile.py index 0581568a5b5ce..01b0516363b18 100644 --- a/recipes/jsonnet/all/conanfile.py +++ b/recipes/jsonnet/all/conanfile.py @@ -84,7 +84,7 @@ def validate(self): raise ConanInvalidConfiguration(f"shared {self.ref} requires rapidyaml to be built as shared") def requirements(self): - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.3") if Version(self.version) >= "0.18.0": self.requires("rapidyaml/0.5.0") diff --git a/recipes/jsonnet/all/test_package/CMakeLists.txt b/recipes/jsonnet/all/test_package/CMakeLists.txt index ad42d5d0faada..e7769af56edc5 100644 --- a/recipes/jsonnet/all/test_package/CMakeLists.txt +++ b/recipes/jsonnet/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 C CXX) find_package(jsonnet CONFIG REQUIRED) diff --git a/recipes/jsonnet/all/test_v1_package/CMakeLists.txt b/recipes/jsonnet/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/jsonnet/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 25fbcb7a6d066..0000000000000 --- a/recipes/jsonnet/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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): - 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/jtckdint/all/conandata.yml b/recipes/jtckdint/all/conandata.yml new file mode 100644 index 0000000000000..ef319a289e5a9 --- /dev/null +++ b/recipes/jtckdint/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + url: "https://github.com/jart/jtckdint/archive/refs/tags/1.0.tar.gz" + sha256: "a117f12bfe41f17d947c8ccc122d18b162d634c5ae9059391a6d36cee83a000f" diff --git a/recipes/jtckdint/all/conanfile.py b/recipes/jtckdint/all/conanfile.py new file mode 100644 index 0000000000000..450d311ea7aaa --- /dev/null +++ b/recipes/jtckdint/all/conanfile.py @@ -0,0 +1,37 @@ +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 = ">=2.0" + + +class JtckdintConan(ConanFile): + name = "jtckdint" + description = "C23 Checked Arithmetic" + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jart/jtckdint" + topics = ("integer", "checked", "arithmetic", "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.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/jtckdint/all/test_package/CMakeLists.txt b/recipes/jtckdint/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cb001e515a229 --- /dev/null +++ b/recipes/jtckdint/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(jtckdint REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE jtckdint::jtckdint) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/jtckdint/all/test_package/conanfile.py b/recipes/jtckdint/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2e77b4246fa81 --- /dev/null +++ b/recipes/jtckdint/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" + + 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/jtckdint/all/test_package/test_package.c b/recipes/jtckdint/all/test_package/test_package.c new file mode 100644 index 0000000000000..88efcc28eacf9 --- /dev/null +++ b/recipes/jtckdint/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include "jtckdint.h" + +int main(void) { + uint32_t c; + int32_t a = 0x7fffffff; + int32_t b = 2; + ckd_add(&c, a, b); + + return 0; +} diff --git a/recipes/jtckdint/config.yml b/recipes/jtckdint/config.yml new file mode 100644 index 0000000000000..edab1ee152d36 --- /dev/null +++ b/recipes/jtckdint/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all diff --git a/recipes/jthread-lite/all/test_package/CMakeLists.txt b/recipes/jthread-lite/all/test_package/CMakeLists.txt index 4310ed8c6ce1f..0ab277cc3aee2 100644 --- a/recipes/jthread-lite/all/test_package/CMakeLists.txt +++ b/recipes/jthread-lite/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(jthread-lite REQUIRED CONFIG) diff --git a/recipes/jthread-lite/all/test_v1_package/CMakeLists.txt b/recipes/jthread-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/jthread-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/jthread-lite/all/test_v1_package/conanfile.py b/recipes/jthread-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/jthread-lite/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_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/jungle/all/test_v1_package/CMakeLists.txt b/recipes/jungle/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/jungle/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 9ebf26743f34b..0000000000000 --- a/recipes/jungle/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/test_v1_package/conanfile.py b/recipes/jwasm/all/test_v1_package/conanfile.py deleted file mode 100644 index 2f48a81c3461c..0000000000000 --- a/recipes/jwasm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,24 +0,0 @@ -from conans import ConanFile -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - test_type = "explicit" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - - def test(self): - self.run("jwasm -h", ignore_errors=True) - obj_file = os.path.join(self.build_folder, "Lin64_1.o") - asm_file = os.path.join(self.source_folder, os.pardir, "test_package", "Lin64_1.asm") # content from https://www.japheth.de/JWasm/Lin64_1.html - self.run(f"jwasm -elf64 -Fo={obj_file} {asm_file}") - if self._settings_build.os == "Linux" and self._settings_build.arch == "x86_64": - bin_file = os.path.join(self.build_folder, "Lin64_1") - self.run(f"ld {obj_file} -o {bin_file}") - self.run(bin_file, ignore_errors=True) diff --git a/recipes/jwt-cpp/all/conandata.yml b/recipes/jwt-cpp/all/conandata.yml index e8a69c12dceae..270d651cf0ad0 100644 --- a/recipes/jwt-cpp/all/conandata.yml +++ b/recipes/jwt-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.1": + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.7.1.tar.gz" + sha256: "e52f247d5e62fac5da6191170998271a70ce27f747f2ce8fde9b09f96a5375a4" "0.7.0": url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.7.0.tar.gz" sha256: "b9eb270e3ba8221e4b2bc38723c9a1cb4fa6c241a42908b9a334daff31137406" @@ -18,6 +21,10 @@ sources: url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.3.1.tar.gz" sha256: "399345e81883f2959df658cd945de39548ddfefdab2acf7b23ee07b9e9a02938" patches: + "0.7.1": + - patch_file: "patches/0005-fix-picojson-header-location-for-conan.patch" + patch_description: "Remove picojson namespace from its include" + patch_type: "conan" "0.7.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 9d87ec3c326fb..9a7ee532d7797 100644 --- a/recipes/jwt-cpp/all/conanfile.py +++ b/recipes/jwt-cpp/all/conanfile.py @@ -13,12 +13,15 @@ class JwtCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Thalhammer/jwt-cpp" topics = ("json", "jwt", "jws", "jwe", "jwk", "jwks", "jose", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - no_copy_source = True + + options = { "with_picojson": [True, False] } + default_options = { "with_picojson" : False } @property - def _supports_generic_json(self): - return Version(self.version) >= "0.5.0" + def _with_picojson(self): + return Version(self.version) < "0.5.0" or self.options.with_picojson def export_sources(self): export_conandata_patches(self) @@ -28,15 +31,14 @@ def layout(self): def requirements(self): self.requires("openssl/[>=1.1 <4]") - if not self._supports_generic_json: + if self._with_picojson: self.requires("picojson/1.3.0") 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) @@ -49,13 +51,11 @@ def package(self): def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - + self.cpp_info.requires = ["openssl::openssl"] + if self._with_picojson: + self.cpp_info.requires.append("picojson::picojson") + else: + self.cpp_info.defines.append("JWT_DISABLE_PICOJSON") self.cpp_info.set_property("cmake_file_name", "jwt-cpp") self.cpp_info.set_property("cmake_target_name", "jwt-cpp::jwt-cpp") - if self._supports_generic_json: - self.cpp_info.defines.append("JWT_DISABLE_PICOJSON") - - # 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" diff --git a/recipes/jwt-cpp/all/test_package/CMakeLists.txt b/recipes/jwt-cpp/all/test_package/CMakeLists.txt index 123d03753d8a0..ca0c8ac855c3f 100644 --- a/recipes/jwt-cpp/all/test_package/CMakeLists.txt +++ b/recipes/jwt-cpp/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(jwt-cpp REQUIRED CONFIG) diff --git a/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt b/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 84b1906ecf746..0000000000000 --- a/recipes/jwt-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/jwt-cpp/all/test_v1_package/conanfile.py b/recipes/jwt-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 3f782b39bbd4f..0000000000000 --- a/recipes/jwt-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +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 requirements(self): - self.requires("picojson/1.3.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/jwt-cpp/config.yml b/recipes/jwt-cpp/config.yml index ebed14e0108cb..ea79f6d8b432d 100644 --- a/recipes/jwt-cpp/config.yml +++ b/recipes/jwt-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.1": + folder: all "0.7.0": folder: all "0.6.0": diff --git a/recipes/jxrlib/all/CMakeLists.txt b/recipes/jxrlib/all/CMakeLists.txt index f4e654c29be7f..5e0fee91a0fec 100644 --- a/recipes/jxrlib/all/CMakeLists.txt +++ b/recipes/jxrlib/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(jxrlib LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/jxrlib/all/test_package/CMakeLists.txt b/recipes/jxrlib/all/test_package/CMakeLists.txt index e7689f4130d27..bc04bd020a0c8 100644 --- a/recipes/jxrlib/all/test_package/CMakeLists.txt +++ b/recipes/jxrlib/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(jxrlib REQUIRED CONFIG) diff --git a/recipes/jxrlib/all/test_package/conanfile.py b/recipes/jxrlib/all/test_package/conanfile.py index b8d2e695e4b3a..0a6bc68712d90 100644 --- a/recipes/jxrlib/all/test_package/conanfile.py +++ b/recipes/jxrlib/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_path = os.path.join(self.source_folder, "test.jxr") - self.run(f"{bin_path} {img_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/jxrlib/all/test_package/test.jxr b/recipes/jxrlib/all/test_package/test.jxr deleted file mode 100644 index 4f66a2e27671a..0000000000000 Binary files a/recipes/jxrlib/all/test_package/test.jxr and /dev/null differ diff --git a/recipes/jxrlib/all/test_package/test_package.c b/recipes/jxrlib/all/test_package/test_package.c index 122b6c2fd1cc3..03492cea6383f 100644 --- a/recipes/jxrlib/all/test_package/test_package.c +++ b/recipes/jxrlib/all/test_package/test_package.c @@ -4,28 +4,14 @@ int main(int argc, char* argv[]) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - - const char *jxr_path = argv[1]; - - { - ERR err = WMP_errSuccess; - - PKCodecFactory* pCodecFactory = NULL; - PKImageDecode* pDecoder = NULL; - - Call(PKCreateCodecFactory(&pCodecFactory, WMP_SDK_VERSION)); - Call(pCodecFactory->CreateDecoderFromFile(jxr_path, &pDecoder)); + ERR err = WMP_errSuccess; + PKCodecFactory* pCodecFactory = NULL; - PKPixelFormatGUID pix_frmt; - Call(pDecoder->GetPixelFormat(pDecoder, &pix_frmt)); + Call(PKCreateCodecFactory(&pCodecFactory, WMP_SDK_VERSION)); Cleanup: - if(pDecoder) pDecoder->Release(&pDecoder); - if(pCodecFactory) pCodecFactory->Release(&pCodecFactory); + if(pCodecFactory) { + pCodecFactory->Release(&pCodecFactory); } return 0; diff --git a/recipes/jxrlib/all/test_v1_package/CMakeLists.txt b/recipes/jxrlib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index eb386b8f18cc0..0000000000000 --- a/recipes/jxrlib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(JXR REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE JXR::JXR) diff --git a/recipes/jxrlib/all/test_v1_package/conanfile.py b/recipes/jxrlib/all/test_v1_package/conanfile.py deleted file mode 100644 index ffd0b1c74921b..0000000000000 --- a/recipes/jxrlib/all/test_v1_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 = os.path.join("bin", "test_package") - img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.jxr") - self.run(f"{bin_path} {img_path}", run_environment=True) diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/CMakeLists.txt b/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/CMakeLists.txt index 330bfac9e2511..ee9ec8067fc8a 100644 --- a/recipes/kaitai_struct_cpp_stl_runtime/all/test_package/CMakeLists.txt +++ b/recipes/kaitai_struct_cpp_stl_runtime/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(kaitai_struct_cpp_stl_runtime REQUIRED CONFIG) diff --git a/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/CMakeLists.txt b/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/kaitai_struct_cpp_stl_runtime/all/test_v1_package/conanfile.py b/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/kaitai_struct_cpp_stl_runtime/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/kangaru/all/conandata.yml b/recipes/kangaru/all/conandata.yml index 5c977f020a27d..996d16a86895e 100644 --- a/recipes/kangaru/all/conandata.yml +++ b/recipes/kangaru/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.3.2": + url: "https://github.com/gracicot/kangaru/archive/v4.3.2.tar.gz" + sha256: "ed2dec53087fe4c5fbfc7f7ffcb0e963b3e0a7f27699338c4bc5a116193113b8" "4.3.1": url: "https://github.com/gracicot/kangaru/archive/v4.3.1.tar.gz" sha256: "3896ea2a13cc1c220b4d83bf598e27e77004170b4a212af8f14264f8a6fb0e45" @@ -11,3 +14,6 @@ sources: patches: "4.2.4": - patch_file: "patches/fix-cmake.patch" + patch_description: "use CURRENT macros for portability" + patch_type: "portability" + patch_source: "https://github.com/gracicot/kangaru/commit/3908d927c43c1a9c99daaef6eca12d55dd0dcc79" diff --git a/recipes/kangaru/all/conanfile.py b/recipes/kangaru/all/conanfile.py index b9d9319294b90..3e901d2203121 100644 --- a/recipes/kangaru/all/conanfile.py +++ b/recipes/kangaru/all/conanfile.py @@ -12,9 +12,9 @@ class KangaruConan(ConanFile): name = "kangaru" description = "A dependency injection container for C++11, C++14 and later" license = "MIT" - topics = ("DI", "IoC", "inversion of control") - homepage = "https://github.com/gracicot/kangaru/wiki" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/gracicot/kangaru/wiki" + topics = ("DI", "IoC", "inversion of control", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" diff --git a/recipes/kangaru/all/test_package/CMakeLists.txt b/recipes/kangaru/all/test_package/CMakeLists.txt index c2fae203f0d0c..67d28d0edac01 100644 --- a/recipes/kangaru/all/test_package/CMakeLists.txt +++ b/recipes/kangaru/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(kangaru REQUIRED CONFIG) diff --git a/recipes/kangaru/all/test_v1_package/CMakeLists.txt b/recipes/kangaru/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/kangaru/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/kangaru/all/test_v1_package/conanfile.py b/recipes/kangaru/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/kangaru/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_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/kangaru/config.yml b/recipes/kangaru/config.yml index a57d047923a8a..572d8f5785b54 100644 --- a/recipes/kangaru/config.yml +++ b/recipes/kangaru/config.yml @@ -1,4 +1,6 @@ versions: + "4.3.2": + folder: all "4.3.1": folder: all "4.3.0": diff --git a/recipes/kcov/all/CMakeLists.txt b/recipes/kcov/all/CMakeLists.txt deleted file mode 100644 index a69305eb3971f..0000000000000 --- a/recipes/kcov/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/kcov/all/conan_deps.cmake b/recipes/kcov/all/conan_deps.cmake new file mode 100644 index 0000000000000..47c0823a35eb3 --- /dev/null +++ b/recipes/kcov/all/conan_deps.cmake @@ -0,0 +1,34 @@ +# Wrapper for find_package() that also adds upper-case variables and allows only Conan packages +macro(custom_find_package name) + find_package(${name} ${ARGN} CONFIG + # Allow only Conan packages + NO_DEFAULT_PATH + PATHS ${CMAKE_PREFIX_PATH} + ) + string(TOUPPER ${name} name_upper) + set(${name_upper}_FOUND TRUE) + set(${name_upper}_VERSION_STRING ${${name}_VERSION_STRING}) + set(${name_upper}_INCLUDE_DIRS ${${name}_INCLUDE_DIRS}) + set(${name_upper}_INCLUDE_DIR ${${name}_INCLUDE_DIR}) + set(${name_upper}_LIBRARIES ${${name}_LIBRARIES}) + set(${name_upper}_DEFINITIONS ${${name}_DEFINITIONS}) + unset(name_upper) +endmacro() + +custom_find_package(Bfd) +custom_find_package(ZLIB REQUIRED) +custom_find_package(CURL REQUIRED) + +if(APPLE) + custom_find_package(Dwarfutils REQUIRED) + set(dwarfutils_FOUND TRUE) +else() + custom_find_package(ElfUtils REQUIRED) + set(Elfutils_FOUND TRUE) + # ElfUtils also provides LibElf + set(LibElf_FOUND TRUE) + set(LIBELF_FOUND TRUE) + set(LIBELF_INCLUDE_DIRS ${ElfUtils_INCLUDE_DIRS}) + set(LIBELF_LIBRARIES ${ElfUtils_LIBRARIES}) + set(LIBELF_DEFINITIONS ${ElfUtils_DEFINITIONS}) +endif() diff --git a/recipes/kcov/all/conandata.yml b/recipes/kcov/all/conandata.yml index b98fb5f6098f5..972457056a28e 100644 --- a/recipes/kcov/all/conandata.yml +++ b/recipes/kcov/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "42": + url: "https://github.com/SimonKagstrom/kcov/archive/refs/tags/v42.tar.gz" + sha256: "2c47d75397af248bc387f60cdd79180763e1f88f3dd71c94bb52478f8e74a1f8" "40": url: "https://github.com/SimonKagstrom/kcov/archive/refs/tags/v40.tar.gz" sha256: "6b1c11b066d57426d61375a31c3816f1fcd2610b447050c86d9920e22d5200b3" @@ -6,9 +9,14 @@ sources: url: "https://github.com/SimonKagstrom/kcov/archive/38.tar.gz" sha256: "b37af60d81a9b1e3b140f9473bdcb7975af12040feb24cc666f9bb2bb0be68b4" patches: - "40": [] + "42": + - patch_file: "patches/0003-fix-missing-include.patch" + patch_description: "Add a missing includes on macOS" + patch_type: "backport" + patch_source: "https://github.com/SimonKagstrom/kcov/commit/4efe5e4a4ac4e7b6d99fc869d826aa74ff716ebf" + - patch_file: "patches/0004-fix-libdwarf-prefix.patch" + patch_description: "Adjust libdwarf include to match CCI includedirs" + patch_type: "conan" "38": - patch_file: "patches/0001-fix-SOLIB-path.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-fix-missing-libssl-dependency.patch" - base_path: "source_subfolder" diff --git a/recipes/kcov/all/conanfile.py b/recipes/kcov/all/conanfile.py index 563b33b2f010e..44ce1cdce95a4 100644 --- a/recipes/kcov/all/conanfile.py +++ b/recipes/kcov/all/conanfile.py @@ -1,63 +1,96 @@ import os + from conan import ConanFile -from conans import CMake, tools -from conans.errors import ConanInvalidConfiguration +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, rmdir, rm +from conan.tools.scm import Version + +required_conan_version = ">=2.1" + class KcovConan(ConanFile): name = "kcov" + description = ( + "Code coverage tool for compiled programs, Python and Bash which uses " + "debugging information to collect and report data without special compilation options" + ) license = "GPL-2.0" - url = "https://github.com/conan-io/conan-center-index/" + url = "https://github.com/conan-io/conan-center-index" homepage = "http://simonkagstrom.github.io/kcov/index.html" - description = "Code coverage tool for compiled programs, Python and Bash\ - which uses debugging information to collect and report data without\ - special compilation options" topics = ("coverage", "linux", "debug") - settings = "os", "compiler", "build_type", "arch" - exports_sources = "CMakeLists.txt", "patches/**" - requires = ["zlib/1.2.12", - "libiberty/9.1.0", - "libcurl/7.83.1", - "elfutils/0.180"] - generators = "cmake" - _cmake = None - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" - - def configure(self): + + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + self.requires("libcurl/[>=7.78 <9]") + self.requires("openssl/[>=1.1 <4]") + if is_apple_os(self): + self.requires("libdwarf/0.8.0") + else: + self.requires("elfutils/0.190") + + 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( - "kcov can not be built on windows.") + raise ConanInvalidConfiguration("kcov can not be built on windows.") + if is_apple_os(self): + if Version(self.version) < 42: + # MachO support was added in v42 + raise ConanInvalidConfiguration(f"{self.ref} does not support {self.settings.os}.") + if self.settings.arch == "armv8": + # https://github.com/SimonKagstrom/kcov/blob/v42/cmake/TargetArch.cmake + raise ConanInvalidConfiguration(f"{self.ref} does not support {self.settings.arch}.") 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 _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_kcov_INCLUDE"] = "conan_deps.cmake" + if Version(self.version) < "43": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + tc.generate() + deps = CMakeDeps(self) + # Match Find*.cmake module names used by the project + deps.set_property("libbfd", "cmake_file_name", "Bfd") + deps.set_property("libdwarf", "cmake_file_name", "Dwarfutils") + deps.set_property("elfutils", "cmake_file_name", "ElfUtils") + deps.set_property("libcrpcut", "cmake_file_name", "LibCRPCUT") + deps.generate() - def _configure_cmake(self): - if self._cmake is not None: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def _patch_sources(self): + apply_conandata_patches(self) + # Disable project Find*.cmake modules just in case + rm(self, "Find*.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): - 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, "share")) - self.copy("COPYING*", dst="licenses", src=self._source_subfolder) + 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: {}" - .format(bindir)) - self.env_info.PATH.append(bindir) self.cpp_info.includedirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] diff --git a/recipes/kcov/all/patches/0003-fix-missing-include.patch b/recipes/kcov/all/patches/0003-fix-missing-include.patch new file mode 100644 index 0000000000000..49167148ac3b4 --- /dev/null +++ b/recipes/kcov/all/patches/0003-fix-missing-include.patch @@ -0,0 +1,20 @@ +Use updated includes from master to fix a missing and +https://github.com/SimonKagstrom/kcov/blob/1d036f7799f95fed025c5fa0665c19df38632ab4/src/engines/mach-engine.cc + +--- src/engines/mach-engine.cc ++++ src/engines/mach-engine.cc +@@ -26,7 +26,14 @@ + #include + #include + #include ++#include ++// clang-format off ++// sys/ptrace.h needs sys/types.h, so make sure clang-format doesn't change the order ++#include + #include ++// clang-format on ++#include ++#include + #include + #include + #include diff --git a/recipes/kcov/all/patches/0004-fix-libdwarf-prefix.patch b/recipes/kcov/all/patches/0004-fix-libdwarf-prefix.patch new file mode 100644 index 0000000000000..3c5509fce924d --- /dev/null +++ b/recipes/kcov/all/patches/0004-fix-libdwarf-prefix.patch @@ -0,0 +1,18 @@ +FIXME: update libdwarf instead + +--- src/parsers/macho-parser.cc ++++ src/parsers/macho-parser.cc +@@ -6,11 +6,11 @@ + */ + #include + #include +-#include ++#include + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/recipes/kcov/all/test_package/conanfile.py b/recipes/kcov/all/test_package/conanfile.py index ea5ad0c50ed3e..9808e9680a682 100644 --- a/recipes/kcov/all/test_package/conanfile.py +++ b/recipes/kcov/all/test_package/conanfile.py @@ -1,9 +1,19 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.cmake import cmake_layout +from conan.tools.build import can_run -class KcovTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def test(self): - if not tools.cross_building(self.settings): - self.run("kcov --version", run_environment=True) + if can_run(self): + self.run("kcov --version", env="conanrun") diff --git a/recipes/kcov/config.yml b/recipes/kcov/config.yml index b36ca0e497b00..97b2691d28e3b 100644 --- a/recipes/kcov/config.yml +++ b/recipes/kcov/config.yml @@ -1,4 +1,6 @@ versions: + "42": + folder: all "40": folder: all "38": diff --git a/recipes/kcp/all/test_v1_package/CMakeLists.txt b/recipes/kcp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/kcp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index f8eeed898d7bd..0000000000000 --- a/recipes/kcp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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 index fa9ce176c1b03..ee5ec1ceee917 100644 --- a/recipes/kdbindings/all/conandata.yml +++ b/recipes/kdbindings/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.1.0": + url: "https://github.com/KDAB/KDBindings/archive/refs/tags/v1.1.0.tar.gz" + sha256: "0ee07cb3e2ec4f5688b4b2971c42e5a4f4a41c7bf4aa130e6b118bea4b6340ab" + "1.0.5": + url: "https://github.com/KDAB/KDBindings/archive/refs/tags/v1.0.5.tar.gz" + sha256: "4d001419809a719f8c966e9bc73f457180325655deca0a11c07c47ee112447a3" "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 index 9f1cf776a90f2..101357d6a2525 100644 --- a/recipes/kdbindings/all/conanfile.py +++ b/recipes/kdbindings/all/conanfile.py @@ -2,46 +2,52 @@ 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 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" + homepage = "https://github.com/KDAB/KDBindings" + topics = ("c++17", "reactive", "kdab", "header-only") 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 _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): return { "gcc": "9", - "Visual Studio": "15.7", "clang": "7", "apple-clang": "11", + "Visual Studio": "15.7", + "msvc": "191", } + def layout(self): + # src_folder must use the same source folder name than the project + 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 validate(self): if self.settings.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 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) diff --git a/recipes/kdbindings/all/test_package/CMakeLists.txt b/recipes/kdbindings/all/test_package/CMakeLists.txt index cbd352d1e0df7..ed5d0858ae610 100644 --- a/recipes/kdbindings/all/test_package/CMakeLists.txt +++ b/recipes/kdbindings/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(KDBindings REQUIRED CONFIG) diff --git a/recipes/kdbindings/config.yml b/recipes/kdbindings/config.yml index 372dd1cb646bd..39a3c40066d56 100644 --- a/recipes/kdbindings/config.yml +++ b/recipes/kdbindings/config.yml @@ -1,3 +1,7 @@ versions: + "1.1.0": + folder: all + "1.0.5": + folder: all "1.0.3": folder: all diff --git a/recipes/kealib/all/CMakeLists.txt b/recipes/kealib/all/CMakeLists.txt deleted file mode 100644 index fd2f93f3b4298..0000000000000 --- a/recipes/kealib/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/kealib/all/conandata.yml b/recipes/kealib/all/conandata.yml index f812df3cfab60..d999ff7ca194b 100644 --- a/recipes/kealib/all/conandata.yml +++ b/recipes/kealib/all/conandata.yml @@ -1,14 +1,10 @@ sources: + "1.5.2": + url: "https://github.com/ubarsc/kealib/archive/refs/tags/kealib-1.5.2.tar.gz" + sha256: "f16a51007ab7612aa598de6ee2cac0aa4421040894777c8e57cb4a50ea552ab1" + "1.4.15": + url: "https://github.com/ubarsc/kealib/archive/kealib-1.4.15.tar.gz" + sha256: "fc7bd049663985e9528acd894724f0c730c84a3408d5bff3c0c0f01d7c6cd172" "1.4.14": url: "https://github.com/ubarsc/kealib/archive/kealib-1.4.14.tar.gz" sha256: "b3f73104acebe5304ecce5c19c1560def66fd5c448ce251e9486494baeb141bc" - "1.4.13": - url: "https://github.com/ubarsc/kealib/archive/kealib-1.4.13.tar.gz" - sha256: "2a254eb557a4ec20638a5134ed549a16b7f64977f37de3cf3853a206c8d82199" -patches: - "1.4.14": - - patch_file: "patches/fix-cmake-1.4.14.patch" - base_path: "source_subfolder" - "1.4.13": - - patch_file: "patches/fix-export-symbols-and-cmake.patch" - base_path: "source_subfolder" diff --git a/recipes/kealib/all/conanfile.py b/recipes/kealib/all/conanfile.py index 292c817544c7d..fb6eebf5cc31b 100644 --- a/recipes/kealib/all/conanfile.py +++ b/recipes/kealib/all/conanfile.py @@ -1,32 +1,38 @@ -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.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.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class KealibConan(ConanFile): name = "kealib" description = "C++ library providing complete access to the KEA image format." license = "MIT" - topics = ("conan", "kealib", "image", "raster") - homepage = "https://github.com/ubarsc/kealib" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - - _cmake = None + homepage = "https://github.com/ubarsc/kealib" + topics = ("image", "raster") - @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 11 def config_options(self): if self.settings.os == "Windows": @@ -34,41 +40,62 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") self.options["hdf5"].enable_cxx = True self.options["hdf5"].hl = True + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): - self.requires("hdf5/1.12.0") + self.requires("hdf5/1.14.3", transitive_headers=True, transitive_libs=True) def validate(self): - if not (self.options["hdf5"].enable_cxx and self.options["hdf5"].hl): - raise ConanInvalidConfiguration("kealib requires hdf5 with cxx and hl enabled.") + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + hdf5_opts = self.dependencies["hdf5"].options + if not (hdf5_opts.enable_cxx and hdf5_opts.hl): + raise ConanInvalidConfiguration(f"{self.ref} requires dependencies options -o 'hdf5/*:enable_cxx=True' -o 'hdf5/*:hl=True'") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("{0}-{0}-{1}".format(self.name, self.version), self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["HDF5_USE_STATIC_LIBRARIES"] = not self.options["hdf5"].shared - self._cmake.definitions["HDF5_PREFER_PARALLEL"] = False # TODO: rely on self.options["hdf5"].parallel when implemented in hdf5 recipe - self._cmake.definitions["LIBKEA_WITH_GDAL"] = 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["HDF5_USE_STATIC_LIBRARIES"] = not self.dependencies["hdf5"].options.shared + tc.variables["HDF5_PREFER_PARALLEL"] = self.dependencies["hdf5"].options.parallel + tc.variables["HDF5_THREADSAFE"] = self.dependencies["hdf5"].options.get_safe("threadsafe", False) + tc.variables["LIBKEA_WITH_GDAL"] = False + # INFO: kealib uses C++11 but does not configure in cmake: https://github.com/ubarsc/kealib/pull/48 + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + 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() + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + if is_msvc(self): + if not self.options.shared and Version(self.version) <= "1.4.14": + self.cpp_info.libs = ["liblibkea"] + else: + self.cpp_info.libs = ["libkea"] + else: + self.cpp_info.libs = ["kea"] + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("shlwapi") diff --git a/recipes/kealib/all/patches/fix-cmake-1.4.14.patch b/recipes/kealib/all/patches/fix-cmake-1.4.14.patch deleted file mode 100644 index 40e8ed0c1a606..0000000000000 --- a/recipes/kealib/all/patches/fix-cmake-1.4.14.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -30,7 +30,7 @@ source_group("include_kea" FILES ${LIBKEA_H}) - ############################################################################### - # Build, link and install library - add_library(${LIBKEA_LIB_NAME} ${LIBKEA_CPP} ${LIBKEA_H} ) --target_link_libraries(${LIBKEA_LIB_NAME} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}) -+target_link_libraries(${LIBKEA_LIB_NAME} ${CONAN_LIBS}) - - include(GenerateExportHeader) - generate_export_header(${LIBKEA_LIB_NAME} -@@ -63,8 +63,6 @@ target_link_libraries(Kealib INTERFACE "${LIBKEA_LIB_NAME}") - ############################################################################### - # Testing - # exe needs to be in 'src' otherwise it doesn't work --add_executable (test1 ${PROJECT_SOURCE_DIR}/src/tests/test1.cpp) --target_link_libraries (test1 ${LIBKEA_LIB_NAME}) - ############################################################################### - - ############################################################################### diff --git a/recipes/kealib/all/patches/fix-export-symbols-and-cmake.patch b/recipes/kealib/all/patches/fix-export-symbols-and-cmake.patch deleted file mode 100644 index 0107ba1879496..0000000000000 --- a/recipes/kealib/all/patches/fix-export-symbols-and-cmake.patch +++ /dev/null @@ -1,219 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -52,14 +52,7 @@ set (LIBKEA_PACKAGE_BUGREPORT "petebunting@mac.com") - set (LIBKEA_PACKAGE "LibKEA") - set (LIBKEA_COPYRIGHT_YEAR 2013) - --if(MSVC) -- # set Name of C++ library -- # this forces it to be libkea on Windows with VC -- set(LIBKEA_LIB_NAME libkea) --else() -- # set Name of C++ library -- set(LIBKEA_LIB_NAME kea) --endif() -+set(LIBKEA_LIB_NAME kea) - - include(CMakeDependentOption) - # CMake global option valiable -@@ -195,11 +188,11 @@ endif(MSVC) - - ############################################################################### - # Setup configure file --configure_file ( "${PROJECT_HEADER_DIR}/kea-config.h.in" "${CMAKE_BINARY_DIR}/${PROJECT_HEADER_DIR}/libkea/kea-config.h" ) -+configure_file ( "${PROJECT_HEADER_DIR}/kea-config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/libkea/kea-config.h" ) - if(MSVC) -- configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.bat.in" "${CMAKE_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config.bat" ) -+ configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.bat.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config.bat" ) - else() -- configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.in" "${CMAKE_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config" ) -+ configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config" ) - endif(MSVC) - ############################################################################### - -@@ -213,7 +206,7 @@ endif(MSVC) - # Build library - - include_directories ("${PROJECT_HEADER_DIR}") --include_directories ("${CMAKE_BINARY_DIR}/${PROJECT_HEADER_DIR}") -+include_directories ("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_HEADER_DIR}") - include_directories(${HDF5_INCLUDE_DIRS}) - add_subdirectory ("${PROJECT_SOURCE_DIR}") - if (LIBKEA_WITH_GDAL) -@@ -234,7 +227,7 @@ if(MSVC) - else() - install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config" DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - endif(MSVC) --install (FILES "${CMAKE_BINARY_DIR}/${PROJECT_HEADER_DIR}/libkea/kea-config.h" DESTINATION include/libkea) -+install (FILES "${CMAKE_CURRENT_BINARY_DIR}/include/libkea/kea-config.h" DESTINATION include/libkea) - ############################################################################### - - ############################################################################### ---- a/include/libkea/KEAAttributeTable.h -+++ b/include/libkea/KEAAttributeTable.h -@@ -98,7 +98,7 @@ namespace kealib{ - void *p; - } VarLenFieldHDF; - -- class DllExport KEAAttributeTable -+ class KEA_EXPORT KEAAttributeTable - { - public: - KEAAttributeTable(KEAATTType keaAttType); ---- a/include/libkea/KEAAttributeTableFile.h -+++ b/include/libkea/KEAAttributeTableFile.h -@@ -43,7 +43,7 @@ - - namespace kealib{ - -- class DllExport KEAAttributeTableFile : public KEAAttributeTable -+ class KEA_EXPORT KEAAttributeTableFile : public KEAAttributeTable - { - public: - KEAAttributeTableFile(H5::H5File *keaImgIn, const std::string &bandPathBaseIn, size_t numRowsIn, size_t chunkSizeIn, unsigned int deflateIn=KEA_DEFLATE); ---- a/include/libkea/KEAAttributeTableInMem.h -+++ b/include/libkea/KEAAttributeTableInMem.h -@@ -43,7 +43,7 @@ - - namespace kealib{ - -- class DllExport KEAAttributeTableInMem : public KEAAttributeTable -+ class KEA_EXPORT KEAAttributeTableInMem : public KEAAttributeTable - { - public: - KEAAttributeTableInMem(); ---- a/include/libkea/KEACommon.h -+++ b/include/libkea/KEACommon.h -@@ -38,15 +38,7 @@ - - #include "H5Cpp.h" - --// mark all exported classes/functions with DllExport to have --// them exported by Visual Studio --#ifndef DllExport -- #ifdef _MSC_VER -- #define DllExport __declspec( dllexport ) -- #else -- #define DllExport -- #endif --#endif -+#include "libkea/kea_export.h" - - // MSVC 2008 uses different names.... - #ifdef _MSC_VER ---- a/include/libkea/KEAException.h -+++ b/include/libkea/KEAException.h -@@ -37,7 +37,7 @@ - - namespace kealib - { -- class DllExport KEAException : public std::exception -+ class KEA_EXPORT KEAException : public std::exception - { - public: - KEAException() : exception() {msgs = "A KEAException has been created.";}; -@@ -49,7 +49,7 @@ namespace kealib - std::string msgs; - }; - -- class DllExport KEAIOException : public KEAException -+ class KEA_EXPORT KEAIOException : public KEAException - { - public: - KEAIOException() : KEAException("KEAIOException has been created."){}; -@@ -58,7 +58,7 @@ namespace kealib - ~KEAIOException() throw() {}; - }; - -- class DllExport KEAATTException : public KEAException -+ class KEA_EXPORT KEAATTException : public KEAException - { - public: - KEAATTException() : KEAException("KEAATTException has been created."){}; ---- a/include/libkea/KEAImageIO.h -+++ b/include/libkea/KEAImageIO.h -@@ -45,7 +45,7 @@ - - namespace kealib{ - -- class DllExport KEAImageIO -+ class KEA_EXPORT KEAImageIO - { - public: - KEAImageIO(); -@@ -171,7 +171,7 @@ namespace kealib{ - } - - // returns the current KEA version as a double --extern "C" DllExport double get_kealibversion(); -+extern "C" KEA_EXPORT double get_kealibversion(); - - #endif - ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -30,34 +30,37 @@ source_group("include_kea" FILES ${LIBKEA_H}) - ############################################################################### - # Build, link and install library - add_library(${LIBKEA_LIB_NAME} ${LIBKEA_CPP} ${LIBKEA_H} ) --target_link_libraries(${LIBKEA_LIB_NAME} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}) -+target_link_libraries(${LIBKEA_LIB_NAME} ${CONAN_LIBS}) - --if(BUILD_SHARED_LIBS) -- SET_TARGET_PROPERTIES(${LIBKEA_LIB_NAME} -- PROPERTIES -- SOVERSION ${LIBKEA_VERSION_MAJOR}.${LIBKEA_VERSION_MINOR} -- VERSION ${LIBKEA_VERSION} -- CLEAN_DIRECT_OUTPUT 1) --else() -- SET_TARGET_PROPERTIES(${LIBKEA_LIB_NAME} -- PROPERTIES -- OUTPUT_NAME "${LIBKEA_LIB_NAME}" -- PREFIX "lib" -- VERSION ${LIBKEA_VERSION} -- CLEAN_DIRECT_OUTPUT 1) -+include(GenerateExportHeader) -+generate_export_header(${LIBKEA_LIB_NAME} -+ EXPORT_MACRO_NAME KEA_EXPORT -+ EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/include/libkea/kea_export.h -+) -+target_include_directories(${LIBKEA_LIB_NAME} PUBLIC -+ $ -+ $ -+ $ -+) -+set_target_properties(${LIBKEA_LIB_NAME} -+ PROPERTIES -+ CXX_VISIBILITY_PRESET hidden -+ VISIBILITY_INLINES_HIDDEN 1 -+ PREFIX "lib" -+ IMPORT_PREFIX "lib" -+ SOVERSION ${LIBKEA_VERSION_MAJOR}.${LIBKEA_VERSION_MINOR} -+ VERSION ${LIBKEA_VERSION} -+) -+if(MSVC AND NOT BUILD_SHARED_LIBS) -+ set_target_properties(${LIBKEA_LIB_NAME} PROPERTIES OUTPUT_NAME "libkea") - endif() - add_library(Kealib INTERFACE) - target_link_libraries(Kealib INTERFACE "${LIBKEA_LIB_NAME}") --target_include_directories(Kealib INTERFACE -- $ -- $) - ############################################################################### - - ############################################################################### - # Testing - # exe needs to be in 'src' otherwise it doesn't work --add_executable (test1 ${CMAKE_SOURCE_DIR}/src/tests/test1.cpp) --target_link_libraries (test1 ${LIBKEA_LIB_NAME}) - - ############################################################################### - # Set target properties -@@ -76,5 +79,6 @@ install (TARGETS ${LIBKEA_LIB_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) --install (FILES ${LIBKEA_H} DESTINATION include/libkea) -+install (FILES ${LIBKEA_H} ${CMAKE_CURRENT_BINARY_DIR}/include/libkea/kea_export.h -+ DESTINATION include/libkea) - ############################################################################### diff --git a/recipes/kealib/all/test_package/CMakeLists.txt b/recipes/kealib/all/test_package/CMakeLists.txt index 196188113685c..0d6f2bcf3918c 100644 --- a/recipes/kealib/all/test_package/CMakeLists.txt +++ b/recipes/kealib/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(kealib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE kealib::kealib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/kealib/all/test_package/conanfile.py b/recipes/kealib/all/test_package/conanfile.py index ea57a464900be..ef5d7042163ec 100644 --- a/recipes/kealib/all/test_package/conanfile.py +++ b/recipes/kealib/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/kealib/all/test_package/test_package.cpp b/recipes/kealib/all/test_package/test_package.cpp index ed6447aec5e35..4a9b2a79bfb1a 100644 --- a/recipes/kealib/all/test_package/test_package.cpp +++ b/recipes/kealib/all/test_package/test_package.cpp @@ -7,23 +7,23 @@ * * This file is part of LibKEA. * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, - * merge, publish, distribute, sublicense, and/or sell copies of the - * Software, and to permit persons to whom the Software is furnished + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, + * merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished * to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be + * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * - * 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 AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * 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 AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ @@ -42,7 +42,7 @@ int main() try { kealib::KEAImageIO io; - H5::H5File *h5file = kealib::KEAImageIO::createKEAImage("bob.kea", + H5::H5File *h5file = kealib::KEAImageIO::createKEAImage("bob.kea", kealib::kea_8uint, IMG_XSIZE, IMG_YSIZE, 1); io.openKEAImageHeader(h5file); @@ -52,7 +52,7 @@ int main() { pData[i] = rand() % 255; } - io.writeImageBlock2Band(1, pData, 0, 0, IMG_XSIZE, IMG_YSIZE, + io.writeImageBlock2Band(1, pData, 0, 0, IMG_XSIZE, IMG_YSIZE, IMG_XSIZE, IMG_YSIZE, kealib::kea_8uint); free(pData); diff --git a/recipes/kealib/config.yml b/recipes/kealib/config.yml index 46b5f6a142b86..d8de052a2b5a1 100644 --- a/recipes/kealib/config.yml +++ b/recipes/kealib/config.yml @@ -1,5 +1,7 @@ versions: - "1.4.14": + "1.5.2": + folder: all + "1.4.15": folder: all - "1.4.13": + "1.4.14": folder: all diff --git a/recipes/keychain/all/conandata.yml b/recipes/keychain/all/conandata.yml index af35ed376e432..f10687c09e1bc 100644 --- a/recipes/keychain/all/conandata.yml +++ b/recipes/keychain/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "1.2.0": - url: "https://github.com/hrantzsch/keychain/archive/v1.2.0.tar.gz" - sha256: "82cc66a7fa12af43f3e2efeb378bacb0a514056617e369430f252da2392acaae" + "1.3.0": + url: "https://github.com/hrantzsch/keychain/archive/refs/tags/v1.3.0.tar.gz" + sha256: "0e2eb3c6ca2c62253f7d28a478d0cb3eeb4b9656b33d2946e1a294361f72809c" "1.2.1": url: "https://github.com/hrantzsch/keychain/archive/v1.2.1.tar.gz" sha256: "725cc30da0451403713dee648edd06686fdc31b5041e75e3350e6056c78de076" + "1.2.0": + url: "https://github.com/hrantzsch/keychain/archive/v1.2.0.tar.gz" + sha256: "82cc66a7fa12af43f3e2efeb378bacb0a514056617e369430f252da2392acaae" diff --git a/recipes/keychain/all/conanfile.py b/recipes/keychain/all/conanfile.py index 64b3ee8743d71..5a1130d8d16d6 100644 --- a/recipes/keychain/all/conanfile.py +++ b/recipes/keychain/all/conanfile.py @@ -1,53 +1,59 @@ +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 collect_libs, copy, get, replace_in_file from conan.tools.gnu import PkgConfigDeps -import os - class KeychainConan(ConanFile): name = "keychain" + description = ( + "A cross-platform wrapper for the operating system's credential storage" + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/hrantzsch/keychain" - description = "A cross-platform wrapper for the operating system's credential storage" 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" - options = {'shared': [False, True], 'fPIC': [False, True]} + options = {"shared": [False, True], "fPIC": [False, True]} default_options = {"shared": False, "fPIC": True} 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: self.options.rm_safe("fPIC") - def validate(self): - if self.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, 11) + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.settings.os == "Linux": self.requires("libsecret/0.20.5") - self.requires("glib/2.78.1") + self.requires("glib/2.78.3") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def build_requirements(self): if self.settings.os == "Linux": self.tool_requires("pkgconf/2.0.3") - def layout(self): - cmake_layout(self, src_folder="src") - def source(self): 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") + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "TARGETS ${PROJECT_NAME}", + "TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin", + ) def generate(self): tc = CMakeToolchain(self) @@ -64,14 +70,21 @@ 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, + 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 = collect_libs(self) - if self.settings.os == 'Macos': - self.cpp_info.frameworks = ['Security', 'CoreFoundation'] + if self.settings.os == "Macos": + self.cpp_info.frameworks = ["Security", "CoreFoundation"] if self.settings.os == "Windows": - self.cpp_info.system_libs = ['crypt32'] + self.cpp_info.system_libs = ["crypt32"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] diff --git a/recipes/keychain/config.yml b/recipes/keychain/config.yml index 307602a029f0f..21c776e737e77 100644 --- a/recipes/keychain/config.yml +++ b/recipes/keychain/config.yml @@ -1,5 +1,7 @@ versions: - "1.2.0": + "1.3.0": folder: all "1.2.1": folder: all + "1.2.0": + folder: all diff --git a/recipes/keystone/all/conandata.yml b/recipes/keystone/all/conandata.yml new file mode 100644 index 0000000000000..b6cc0f93989ee --- /dev/null +++ b/recipes/keystone/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "0.9.2": + url: "https://github.com/keystone-engine/keystone/archive/refs/tags/0.9.2.tar.gz" + sha256: "c9b3a343ed3e05ee168d29daf89820aff9effb2c74c6803c2d9e21d55b5b7c24" + +patches: + "0.9.2": + - patch_file: "patches/0.9.2-cmake4-support.patch" + patch_type: "portability" + patch_description: "Remove OLD behavior in CMP0051 and use CMake 3.5 minimum" + diff --git a/recipes/keystone/all/conanfile.py b/recipes/keystone/all/conanfile.py new file mode 100644 index 0000000000000..1be1ec12b1a57 --- /dev/null +++ b/recipes/keystone/all/conanfile.py @@ -0,0 +1,97 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +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.build import check_max_cppstd +import os + +required_conan_version = ">=2.1" + + +class KeystoneConan(ConanFile): + name = "keystone" + description = ( + "Keystone assembler framework: Core (Arm, Arm64, Hexagon, " + "Mips, PowerPC, Sparc, SystemZ & X86) + bindings." + ) + license = ( "GPL-2.0-only", "DocumentRef-EXCEPTIONS-CLIENT:LicenseRef-FOSS-License-Exception" ) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.keystone-engine.org" + topics = ( + "security", + "arm", + "framework", + "mips", + "x86-64", + "reverse-engineering", + "assembler", + "x86", + "hexagon", + "arm64", + "sparc", + "powerpc", + "systemz" + ) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def validate(self): + # INFO: include/llvm/ADT/STLExtras.h:54:34: error: no template named 'binary_function' in namespace 'std' + # The std::binary_function was removed in C++17 + check_max_cppstd(self, 14) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_LIBS_ONLY"] = True + tc.cache_variables["KEYSTONE_BUILD_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.generate() + + def build(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"), + ) + copy( + self, + "EXCEPTIONS-CLIENT", + 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() + 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 = ["keystone"] + if is_msvc(self) and self.options.shared: + self.cpp_info.bindirs = ["lib"] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["shell32", "ole32", "uuid"] diff --git a/recipes/keystone/all/patches/0.9.2-cmake4-support.patch b/recipes/keystone/all/patches/0.9.2-cmake4-support.patch new file mode 100644 index 0000000000000..8e66e48387f4c --- /dev/null +++ b/recipes/keystone/all/patches/0.9.2-cmake4-support.patch @@ -0,0 +1,39 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + # Keystone Assembler Engine (www.keystone-engine.org) + # By Nguyen Anh Quynh, 2016 + +-cmake_minimum_required(VERSION 2.8.7) ++cmake_minimum_required(VERSION 3.5) + project(keystone) + + set(KEYSTONE_VERSION_MAJOR 0) +@@ -24,7 +24,7 @@ if (POLICY CMP0051) + # stripped everywhere that access the SOURCES property, so we just + # defer to the OLD behavior of not including generator expressions + # in the output for now. +- cmake_policy(SET CMP0051 OLD) ++ # cmake_policy(SET CMP0051 OLD) + endif() + + if (POLICY CMP0063) +--- a/llvm/CMakeLists.txt ++++ b/llvm/CMakeLists.txt +@@ -1,6 +1,6 @@ + # See docs/CMake.html for instructions about how to build LLVM with CMake. + +-cmake_minimum_required(VERSION 2.8.7) ++cmake_minimum_required(VERSION 3.5) + + set(LLVM_INSTALL_TOOLCHAIN_ONLY ON) + +@@ -19,7 +19,7 @@ if (POLICY CMP0051) + # stripped everywhere that access the SOURCES property, so we just + # defer to the OLD behavior of not including generator expressions + # in the output for now. +- cmake_policy(SET CMP0051 OLD) ++ # cmake_policy(SET CMP0051 OLD) + endif() + + if(CMAKE_VERSION VERSION_LESS 3.1.20141117) diff --git a/recipes/keystone/all/test_package/CMakeLists.txt b/recipes/keystone/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fa5c67fc76107 --- /dev/null +++ b/recipes/keystone/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(keystone REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE keystone::keystone) diff --git a/recipes/keystone/all/test_package/conanfile.py b/recipes/keystone/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/keystone/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/keystone/all/test_package/test_package.cpp b/recipes/keystone/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..979bb61f8423f --- /dev/null +++ b/recipes/keystone/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() +{ + unsigned int major = 0, minor = 0; + ks_version(&major, &minor); + std::cout << "Keystone version: " << major << "." << minor << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/keystone/config.yml b/recipes/keystone/config.yml new file mode 100644 index 0000000000000..6adb5bb604435 --- /dev/null +++ b/recipes/keystone/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.2": + folder: "all" diff --git a/recipes/khrplatform/all/test_package/CMakeLists.txt b/recipes/khrplatform/all/test_package/CMakeLists.txt index 34fae3a337730..17b8643cc0bb0 100644 --- a/recipes/khrplatform/all/test_package/CMakeLists.txt +++ b/recipes/khrplatform/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(khrplatform REQUIRED CONFIG) diff --git a/recipes/khrplatform/all/test_v1_package/CMakeLists.txt b/recipes/khrplatform/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/khrplatform/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/khrplatform/all/test_v1_package/conanfile.py b/recipes/khrplatform/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/khrplatform/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_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/kickcat/all/test_package/CMakeLists.txt b/recipes/kickcat/all/test_package/CMakeLists.txt index 8b77c31d9ca12..7bb4abb7296b7 100644 --- a/recipes/kickcat/all/test_package/CMakeLists.txt +++ b/recipes/kickcat/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) set(CMAKE_CXX_STANDARD 17) diff --git a/recipes/kissfft/all/test_package/CMakeLists.txt b/recipes/kissfft/all/test_package/CMakeLists.txt index 71865c254e395..3ef7eaf019fbb 100644 --- a/recipes/kissfft/all/test_package/CMakeLists.txt +++ b/recipes/kissfft/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(kissfft REQUIRED CONFIG) diff --git a/recipes/kissfft/all/test_v1_package/CMakeLists.txt b/recipes/kissfft/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/kissfft/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/kissfft/all/test_v1_package/conanfile.py b/recipes/kissfft/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/kissfft/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_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/kitten/all/test_v1_package/CMakeLists.txt b/recipes/kitten/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/kitten/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/kitten/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_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/conandata.yml b/recipes/kmod/all/conandata.yml index cc817fbafc1ad..e2d88fd85c718 100644 --- a/recipes/kmod/all/conandata.yml +++ b/recipes/kmod/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "31": + url: "https://kernel.org/pub/linux/utils/kernel/kmod/kmod-31.tar.xz" + sha256: "f5a6949043cc72c001b728d8c218609c5a15f3c33d75614b78c79418fcf00d80" "30": url: "https://kernel.org/pub/linux/utils/kernel/kmod/kmod-30.tar.xz" sha256: "f897dd72698dc6ac1ef03255cd0a5734ad932318e4adbaebc7338ef2f5202f9f" diff --git a/recipes/kmod/all/test_package/CMakeLists.txt b/recipes/kmod/all/test_package/CMakeLists.txt index fb2eee3127d3e..04413e018ca52 100644 --- a/recipes/kmod/all/test_package/CMakeLists.txt +++ b/recipes/kmod/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(kmod REQUIRED CONFIG) diff --git a/recipes/kmod/all/test_v1_package/CMakeLists.txt b/recipes/kmod/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/kmod/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/kmod/all/test_v1_package/conanfile.py b/recipes/kmod/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/kmod/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_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/config.yml b/recipes/kmod/config.yml index 61353908a11fc..6c4bbbc0156bb 100644 --- a/recipes/kmod/config.yml +++ b/recipes/kmod/config.yml @@ -1,4 +1,6 @@ versions: + "31": + folder: all "30": folder: all "29": diff --git a/recipes/kplot/all/CMakeLists.txt b/recipes/kplot/all/CMakeLists.txt index 632b160c48691..d9ac5598dcf53 100644 --- a/recipes/kplot/all/CMakeLists.txt +++ b/recipes/kplot/all/CMakeLists.txt @@ -1,49 +1,45 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(kplot LANGUAGES C) find_package(cairo REQUIRED CONFIG) set(kplot_src - ${KPLOT_SRC_DIR}/colours.c - ${KPLOT_SRC_DIR}/array.c - ${KPLOT_SRC_DIR}/border.c - ${KPLOT_SRC_DIR}/bucket.c - ${KPLOT_SRC_DIR}/buffer.c - ${KPLOT_SRC_DIR}/draw.c - ${KPLOT_SRC_DIR}/grid.c - ${KPLOT_SRC_DIR}/hist.c - ${KPLOT_SRC_DIR}/label.c - ${KPLOT_SRC_DIR}/kdata.c - ${KPLOT_SRC_DIR}/kplot.c - ${KPLOT_SRC_DIR}/margin.c - ${KPLOT_SRC_DIR}/mean.c - ${KPLOT_SRC_DIR}/plotctx.c - ${KPLOT_SRC_DIR}/reallocarray.c - ${KPLOT_SRC_DIR}/stddev.c - ${KPLOT_SRC_DIR}/tic.c - ${KPLOT_SRC_DIR}/vector.c + colours.c + array.c + border.c + bucket.c + buffer.c + draw.c + grid.c + hist.c + label.c + kdata.c + kplot.c + margin.c + mean.c + plotctx.c + reallocarray.c + stddev.c + tic.c + vector.c ) set(kplot_inc - ${KPLOT_SRC_DIR}/compat.h - ${KPLOT_SRC_DIR}/extern.h - ${KPLOT_SRC_DIR}/kplot.h + compat.h + extern.h + kplot.h ) -include_directories(KPLOT_SRC_DIR) - -try_run(HAVE_reallocarray COMPIE_reallocarray ${CMAKE_BINARY_DIR} ${KPLOT_SRC_DIR}/test-reallocarray.c) - -file(READ "${KPLOT_SRC_DIR}/compat.pre.h" COMPAT_CONTENTS) -file(WRITE "${KPLOT_SRC_DIR}/compat.h" "${COMPAT_CONTENTS}") -if (${COMPIE_reallocarray} AND NOT ${HAVE_reallocarray}) - file(APPEND "${KPLOT_SRC_DIR}/compat.h" "#define HAVE_REALLOCARRAY") +try_run(HAVE_reallocarray COMPIE_reallocarray ${CMAKE_BINARY_DIR} "${CMAKE_SOURCE_DIR}/test-reallocarray.c") +file(READ compat.pre.h COMPAT_CONTENTS) +file(WRITE compat.h "${COMPAT_CONTENTS}") +if (COMPIE_reallocarray AND NOT HAVE_reallocarray) + file(APPEND compat.h "#define HAVE_REALLOCARRAY") endif() -file(READ "${KPLOT_SRC_DIR}/compat.post.h" COMPAT_CONTENTS) -file(APPEND "${KPLOT_SRC_DIR}/compat.h" "${COMPAT_CONTENTS}") +file(READ compat.post.h COMPAT_CONTENTS) +file(APPEND compat.h "${COMPAT_CONTENTS}") add_library(kplot ${kplot_src}) - target_compile_features(kplot PRIVATE c_std_99) set_target_properties(kplot PROPERTIES PUBLIC_HEADER "${kplot_inc}" @@ -54,7 +50,6 @@ target_compile_features(kplot PRIVATE c_std_99) target_link_libraries(kplot PRIVATE cairo::cairo) include(GNUInstallDirs) - install( TARGETS kplot RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} diff --git a/recipes/kplot/all/conanfile.py b/recipes/kplot/all/conanfile.py index 47e24a0f5cdf8..e7de72e829781 100644 --- a/recipes/kplot/all/conanfile.py +++ b/recipes/kplot/all/conanfile.py @@ -12,9 +12,10 @@ class KplotConan(ConanFile): description = "open source Cairo plotting library" license = "ISC" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/kristapsdz/kplot/" - topics = ("plot", "cairo", "chart") # no "conan" and project name in topics - settings = "os", "arch", "compiler", "build_type" # even for header only + homepage = "https://github.com/kristapsdz/kplot" + topics = ("plot", "cairo", "chart") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -25,7 +26,7 @@ class KplotConan(ConanFile): } def export_sources(self): - copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -34,7 +35,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") @@ -46,26 +46,24 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} can not be built on Visual Studio and msvc.") def requirements(self): - self.requires("cairo/1.17.4") + self.requires("cairo/1.17.4", 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["KPLOT_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.configure() cmake.build() def package(self): - copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE.md", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() diff --git a/recipes/kplot/all/test_package/CMakeLists.txt b/recipes/kplot/all/test_package/CMakeLists.txt index e61521b15e2af..f0cbb36001457 100644 --- a/recipes/kplot/all/test_package/CMakeLists.txt +++ b/recipes/kplot/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 C) find_package(kplot REQUIRED CONFIG) diff --git a/recipes/kplot/all/test_package/test_package.c b/recipes/kplot/all/test_package/test_package.c index 2bc672875372a..1823d8d11f41d 100644 --- a/recipes/kplot/all/test_package/test_package.c +++ b/recipes/kplot/all/test_package/test_package.c @@ -1,14 +1,11 @@ -#include +// Both are required by kplot.h +#include #include -#include "cairo.h" -#include "kplot.h" +#include int main() { struct kpair points1[50]; struct kdata* d1 = kdata_array_alloc(points1, 50); - kdata_destroy(d1); - - return 0; } diff --git a/recipes/kplot/all/test_v1_package/CMakeLists.txt b/recipes/kplot/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/kplot/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/kplot/all/test_v1_package/conanfile.py b/recipes/kplot/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/kplot/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/krb5/all/conandata.yml b/recipes/krb5/all/conandata.yml new file mode 100644 index 0000000000000..f074e932120e0 --- /dev/null +++ b/recipes/krb5/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.21.2": + url: "https://kerberos.org/dist/krb5/1.21/krb5-1.21.2.tar.gz" + sha256: "9560941a9d843c0243a71b17a7ac6fe31c7cebb5bce3983db79e52ae7e850491" +patches: + "1.21.2": + - patch_file: "patches/0001-no-tests.patch" + patch_type: "conan" + patch_description: "Disable building tests" + - patch_file: "patches/0002-disable_ksu_root.patch" + patch_description: "No ksu install as root user" + patch_type: "conan" + - patch_file: "patches/0003-find-openssl-module.patch" + patch_description: "Use OpenSSL .pc module to find libraries" + patch_source: "https://github.com/krb5/krb5/pull/1351" + patch_type: "portability" diff --git a/recipes/krb5/all/conanfile.py b/recipes/krb5/all/conanfile.py new file mode 100644 index 0000000000000..45d89ebc279af --- /dev/null +++ b/recipes/krb5/all/conanfile.py @@ -0,0 +1,169 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get, rmdir, export_conandata_patches, apply_conandata_patches, chdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.54.0" + +class Krb5Conan(ConanFile): + name = "krb5" + description = "Kerberos is a network authentication protocol. It is designed to provide strong authentication " \ + "for client/server applications by using secret-key cryptography." + homepage = "https://web.mit.edu/kerberos" + topics = ("kerberos", "network", "authentication", "protocol", "client", "server", "cryptography") + license = "LicenseRef-NOTICE" + url = "https://github.com/conan-io/conan-center-index" + package_type = "shared-library" + options = { + "use_thread": [True, False], + "use_dns_realms": [True, False], + "with_tls": [False, "openssl"], + } + default_options = { + "use_thread": True, + "use_dns_realms": False, + "with_tls": "openssl" + } + options_description = { + "use_thread": "Enable thread support", + "use_dns_realms": "Enable DNS for realms", + "with_tls": "Enable TLS support with OpenSSL", + } + settings = "os", "arch", "compiler", "build_type" + + def export_sources(self): + export_conandata_patches(self) + + 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 validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} Conan recipe is not prepared for Windows yet. Contributions are welcome!") + if self.settings.os == "Macos": + raise ConanInvalidConfiguration(f"{self.ref} Conan recipe is not prepared for Macos yet. Contributions are welcome!") + if self.options.with_tls == "openssl" and not self.dependencies["openssl"].options.shared: + # k5tls does not respect linkage order, it passes krb5 and krb5support before openssl to the linker, which causes linking errors + # gcc -shared -fPIC -Wl,-h,k5tls.so.0 -Wl,--no-undefined -o k5tls.so openssl.so notls.so -L../../../lib -lkrb5 -lkrb5support ... + # /usr/bin/ld: /.../lib/libssl.a(libssl-lib-ssl_cert_comp.o): in function `OSSL_COMP_CERT_from_uncompressed_data': + # ssl_cert_comp.c:(.text+0x3d1): undefined reference to `COMP_CTX_free' + raise ConanInvalidConfiguration(f"{self.ref} building with static OpenSSL generates linking errors. Please use '-o openssl/*:shared=True'") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, 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) + yes_no = lambda v: "yes" if v else "no" + tls_impl = {"openssl": "openssl",}.get(str(self.options.get_safe('with_tls'))) + tc.configure_args.extend([ + f"--enable-thread-support={yes_no(self.options.get_safe('use_thread'))}", + f"--enable-dns-for-realm={yes_no(self.options.use_dns_realms)}", + f"--enable-pkinit={yes_no(self.options.get_safe('with_tls'))}", + f"--with-crypto-impl={(tls_impl or 'builtin')}", + f"--with-spake-openssl={yes_no(self.options.get_safe('with_tls') == 'openssl')}", + f"--with-tls-impl={(tls_impl or 'no')}", + "--disable-nls", + "--disable-rpath", + "--without-libedit", + "--without-readline", + "--with-system-verto", + "--enable-dns-for-realm", + f"--with-keyutils={self.package_folder}", + f"--with-tcl={(self.dependencies['tcl'].package_folder if self.options.get_safe('with_tcl') else 'no')}", + ]) + tc.generate() + + pkg = AutotoolsDeps(self) + pkg.generate() + pkg = PkgConfigDeps(self) + pkg.generate() + + def requirements(self): + self.requires("libverto/0.3.2") + if self.options.get_safe("with_tls") == "openssl": + self.requires("openssl/[>=1.1 <4]") + if self.options.get_safe("with_tcl"): + self.requires("tcl/8.6.11") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/1.9.3") + self.build_requires("automake/1.16.5") + self.build_requires("bison/3.8.2") + + def build(self): + apply_conandata_patches(self) + with chdir(self, os.path.join(self.source_folder, "src")): + self.run("autoreconf -vif") + autotools = Autotools(self) + autotools.configure(build_script_folder=os.path.join(self.source_folder, "src")) + autotools.make() + + def package(self): + copy(self, "NOTICE", 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")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "var")) + + def package_info(self): + self.cpp_info.components["mit-krb5"].libs = ["krb5", "k5crypto", "com_err"] + if self.options.get_safe('with_tls') == "openssl": + self.cpp_info.components["mit-krb5"].requires = ["openssl::crypto"] + self.cpp_info.components["mit-krb5"].names["pkg_config"] = "mit-krb5" + if self.settings.os == "Linux": + self.cpp_info.components["mit-krb5"].system_libs = ["resolv"] + + self.cpp_info.components["libkrb5"].libs = [] + self.cpp_info.components["libkrb5"].requires = ["mit-krb5"] + self.cpp_info.components["libkrb5"].names["pkg_config"] = "krb5" + + self.cpp_info.components["mit-krb5-gssapi"].libs = ["gssapi_krb5"] + self.cpp_info.components["mit-krb5-gssapi"].requires = ["mit-krb5"] + self.cpp_info.components["mit-krb5-gssapi"].names["pkg_config"] = "mit-krb5-gssapi" + + self.cpp_info.components["krb5-gssapi"].libs = [] + self.cpp_info.components["krb5-gssapi"].requires = ["mit-krb5-gssapi"] + self.cpp_info.components["krb5-gssapi"].names["pkg_config"] = "krb5-gssapi" + + self.cpp_info.components["gssrpc"].libs = ["gssrpc"] + self.cpp_info.components["gssrpc"].requires = ["mit-krb5-gssapi"] + self.cpp_info.components["gssrpc"].names["pkg_config"] = "gssrpc" + + self.cpp_info.components["kadm-client"].libs = ["kadm5clnt_mit"] + self.cpp_info.components["kadm-client"].requires = ["mit-krb5-gssapi", "gssrpc"] + self.cpp_info.components["kadm-client"].names["pkg_config"] = "kadm-client" + + self.cpp_info.components["kdb"].libs = ["kdb5"] + self.cpp_info.components["kdb"].requires = ["mit-krb5-gssapi", "mit-krb5", "gssrpc"] + self.cpp_info.components["kdb"].names["pkg_config"] = "kdb-client" + + self.cpp_info.components["kadm-server"].libs = ["kadm5srv_mit"] + self.cpp_info.components["kadm-server"].requires = ["kdb", "mit-krb5-gssapi"] + self.cpp_info.components["kadm-server"].names["pkg_config"] = "kadm-server" + + self.cpp_info.components["krad"].libs = ["krad"] + self.cpp_info.components["krad"].requires = ["libkrb5", "libverto::libverto"] + + krb5_config = os.path.join(self.package_folder, "bin", "krb5-config").replace("\\", "/") + self.output.info("Appending KRB5_CONFIG environment variable: {}".format(krb5_config)) + self.runenv_info.define_path("KRB5_CONFIG", krb5_config) diff --git a/recipes/krb5/all/patches/0001-no-tests.patch b/recipes/krb5/all/patches/0001-no-tests.patch new file mode 100644 index 0000000000000..6277a45dd0a98 --- /dev/null +++ b/recipes/krb5/all/patches/0001-no-tests.patch @@ -0,0 +1,13 @@ +diff --git a/src/Makefile.in b/src/Makefile.in +index 8f14e9bf2..dfb6843c9 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -30,7 +30,7 @@ SUBDIRS=util include lib \ + plugins/preauth/spake \ + plugins/preauth/test \ + plugins/tls/k5tls \ +- kdc kadmin kprop clients appl tests \ ++ kdc kadmin kprop clients appl \ + config-files build-tools man doc @po@ + WINSUBDIRS=include util lib ccapi windows clients appl plugins\preauth\spake + BUILDTOP=$(REL). diff --git a/recipes/krb5/all/patches/0002-disable_ksu_root.patch b/recipes/krb5/all/patches/0002-disable_ksu_root.patch new file mode 100644 index 0000000000000..1c0aa45316310 --- /dev/null +++ b/recipes/krb5/all/patches/0002-disable_ksu_root.patch @@ -0,0 +1,13 @@ +diff --git a/src/config/pre.in b/src/config/pre.in +index 3752174..98dbe0f 100644 +--- a/src/config/pre.in ++++ b/src/config/pre.in +@@ -184,7 +184,7 @@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ $(INSTALL_STRIP) + INSTALL_SCRIPT=@INSTALL_PROGRAM@ + INSTALL_DATA=@INSTALL_DATA@ + INSTALL_SHLIB=@INSTALL_SHLIB@ +-INSTALL_SETUID=$(INSTALL) $(INSTALL_STRIP) -m 4755 -o root ++INSTALL_SETUID=$(INSTALL) $(INSTALL_STRIP) -m 755 + ## This is needed because autoconf will sometimes define @exec_prefix@ to be + ## ${prefix}. + prefix=@prefix@ diff --git a/recipes/krb5/all/patches/0003-find-openssl-module.patch b/recipes/krb5/all/patches/0003-find-openssl-module.patch new file mode 100644 index 0000000000000..6c1d8cf5ff6fb --- /dev/null +++ b/recipes/krb5/all/patches/0003-find-openssl-module.patch @@ -0,0 +1,20 @@ +diff --git a/src/configure.ac b/src/configure.ac +index 77be7a2..577da79 100644 +--- a/src/configure.ac ++++ b/src/configure.ac +@@ -295,13 +295,10 @@ AC_ARG_WITH([tls-impl], + [TLS_IMPL=$withval], [TLS_IMPL=auto]) + case "$TLS_IMPL" in + openssl|auto) +- AC_CHECK_LIB(ssl,SSL_CTX_new,[have_lib_ssl=true],[have_lib_ssl=false], +- -lcrypto) +- AC_MSG_CHECKING([for OpenSSL]) ++ PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.1.0], [have_lib_ssl=true], [have_lib_ssl=false]) + if test x$have_lib_ssl = xtrue ; then + AC_DEFINE(TLS_IMPL_OPENSSL,1,[Define if TLS implementation is OpenSSL]) +- AC_MSG_RESULT([yes]) +- TLS_IMPL_LIBS="-lssl -lcrypto" ++ TLS_IMPL_LIBS=$OPENSSL_LIBS + TLS_IMPL=openssl + AC_MSG_NOTICE([TLS module will use OpenSSL]) + else diff --git a/recipes/krb5/all/test_package/CMakeLists.txt b/recipes/krb5/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8bf1b7258ab16 --- /dev/null +++ b/recipes/krb5/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +find_package(krb5 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE krb5::krb5) diff --git a/recipes/krb5/all/test_package/conanfile.py b/recipes/krb5/all/test_package/conanfile.py new file mode 100644 index 0000000000000..23c0291e76c1f --- /dev/null +++ b/recipes/krb5/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, cmake_layout +import os + + +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/krb5/all/test_package/test_package.c b/recipes/krb5/all/test_package/test_package.c new file mode 100644 index 0000000000000..1e241814c8386 --- /dev/null +++ b/recipes/krb5/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include "krb5.h" + +#include + +int +main(int argc, char **argv) +{ + krb5_context context; + int ret = krb5_init_context(&context); + if (ret != 0) { + fprintf(stderr, "krb5_init_context failed\n"); + return 1; + } + krb5_free_context(context); + return 0; +} diff --git a/recipes/krb5/config.yml b/recipes/krb5/config.yml new file mode 100644 index 0000000000000..5522f8acd1f0a --- /dev/null +++ b/recipes/krb5/config.yml @@ -0,0 +1,3 @@ +versions: + "1.21.2": + folder: "all" diff --git a/recipes/ktx/all/conandata.yml b/recipes/ktx/all/conandata.yml index bc8cca1018446..a63666c9c170a 100644 --- a/recipes/ktx/all/conandata.yml +++ b/recipes/ktx/all/conandata.yml @@ -1,10 +1,16 @@ sources: + "4.3.2": + url: "https://github.com/KhronosGroup/KTX-Software/archive/refs/tags/v4.3.2.tar.gz" + sha256: "74a114f465442832152e955a2094274b446c7b2427c77b1964c85c173a52ea1f" "4.0.0": url: "https://github.com/KhronosGroup/KTX-Software/archive/refs/tags/v4.0.0.tar.gz" sha256: "6091f5064d0cfd54c6155bb6c0d2ba7287f312d109010e9b702839ac78529fd3" patches: + "4.3.2": + - patch_file: "patches/4.3.2/0001-objutil-cxx-std.patch" + - patch_file: "patches/4.3.2/0004-unvendor-dependencies.patch" "4.0.0": - - patch_file: "patches/0001-objutil-cxx-std.patch" - - patch_file: "patches/0002-lodepng-no-export-symbols.patch" - - patch_file: "patches/0003-clamp-include-algorithm.patch" - - patch_file: "patches/0004-unvendor-dependencies.patch" + - patch_file: "patches/4.0.0/0001-objutil-cxx-std.patch" + - patch_file: "patches/4.0.0/0002-lodepng-no-export-symbols.patch" + - patch_file: "patches/4.0.0/0003-clamp-include-algorithm.patch" + - patch_file: "patches/4.0.0/0004-unvendor-dependencies.patch" diff --git a/recipes/ktx/all/conanfile.py b/recipes/ktx/all/conanfile.py index 5d9cc3ea68050..a7aab249baf8d 100644 --- a/recipes/ktx/all/conanfile.py +++ b/recipes/ktx/all/conanfile.py @@ -1,7 +1,9 @@ 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, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file, save +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -29,6 +31,25 @@ class KtxConan(ConanFile): "tools": True, } + @property + def _min_cppstd(self): + if Version(self.version) < "4.3.2": + return 11 + return 17 + + @property + def _compilers_minimum_version(self): + if self._min_cppstd == 17: + return { + "gcc": "8", + "clang": "7", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + return {} + + @property def _has_sse_support(self): return self.settings.arch in ["x86", "x86_64"] @@ -53,15 +74,30 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("lodepng/cci.20230410") + if Version(self.version) < "4.2.0": + # Newer versions use modified lodepng + # https://github.com/KhronosGroup/KTX-Software/blob/v4.2.1/tools/imageio/png.imageio/lodepng.h#L26-L32 + self.requires("lodepng/cci.20230410") self.requires("zstd/1.5.5") 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." + ) + if Version(self.version) >= "4.2" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 6: + # astcenc_vecmathlib_sse_4.h:809:41: error: the last argument must be a 4-bit immediate + raise ConanInvalidConfiguration("GCC v6+ is required") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + # Avoid copying of 300 MB of test assets and third-party binaries + rmdir(self, os.path.join(self.source_folder, "tests")) + rmdir(self, os.path.join(self.source_folder, "other_lib")) + save(self, os.path.join(self.source_folder, "tests", "CMakeLists.txt"), "") def generate(self): tc = CMakeToolchain(self) @@ -73,6 +109,7 @@ def generate(self): tc.variables["BASISU_SUPPORT_SSE"] = self.options.get_safe("sse", False) tc.generate() deps = CMakeDeps(self) + deps.set_property("zstd", "cmake_target_name", "zstd::libzstd") deps.generate() def _patch_sources(self): @@ -80,11 +117,16 @@ def _patch_sources(self): # Unvendor several libs (we rely on patch files to link those libs) # It's worth noting that vendored jpeg-compressor can't be replaced by CCI equivalent basisu_dir = os.path.join(self.source_folder, "lib", "basisu") - ## lodepng (the patch file 0002-lodepng-no-export-symbols is important, in order to not try to export lodepng symbols) - os.remove(os.path.join(basisu_dir, "encoder", "lodepng.cpp")) - os.remove(os.path.join(basisu_dir, "encoder", "lodepng.h")) + if Version(self.version) < "4.1.0": + ## lodepng (the patch file 0002-lodepng-no-export-symbols is important, in order to not try to export lodepng symbols) + os.remove(os.path.join(basisu_dir, "encoder", "lodepng.cpp")) + os.remove(os.path.join(basisu_dir, "encoder", "lodepng.h")) ## zstd rmdir(self, os.path.join(basisu_dir, "zstd")) + # disable -Werror + if Version(self.version) >= "4.3.2": + replace_in_file(self, os.path.join(self.source_folder, "lib", "astc-encoder", "Source", "cmake_core.cmake"), + "-Werror", "") def build(self): self._patch_sources() @@ -125,6 +167,8 @@ def package_info(self): self.cpp_info.components["libktx"].names["cmake_find_package"] = "ktx" self.cpp_info.components["libktx"].names["cmake_find_package_multi"] = "ktx" self.cpp_info.components["libktx"].set_property("cmake_target_name", "KTX::ktx") - self.cpp_info.components["libktx"].requires = ["lodepng::lodepng", "zstd::zstd"] + self.cpp_info.components["libktx"].requires = ["zstd::zstd"] + if Version(self.version) < "4.2.0": + self.cpp_info.components["libktx"].requires.append("lodepng::lodepng") if self.options.tools: self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/ktx/all/patches/0004-unvendor-dependencies.patch b/recipes/ktx/all/patches/0004-unvendor-dependencies.patch deleted file mode 100644 index d09e2d811a873..0000000000000 --- a/recipes/ktx/all/patches/0004-unvendor-dependencies.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -121,7 +121,6 @@ set(KTX_MAIN_SRC - lib/basisu/transcoder/basisu_transcoder.cpp - lib/basisu/transcoder/basisu_transcoder.h - lib/basisu/transcoder/basisu.h -- lib/basisu/zstd/zstd.c - lib/checkheader.c - lib/dfdutils/createdfd.c - lib/dfdutils/colourspaces.c -@@ -415,11 +414,13 @@ PRIVATE - lib/basisu/encoder/cppspmd_type_aliases.h - lib/basisu/encoder/jpgd.cpp - lib/basisu/encoder/jpgd.h -- lib/basisu/encoder/lodepng.cpp -- lib/basisu/encoder/lodepng.h - lib/writer1.c - lib/writer2.c - ) -+find_package(lodepng REQUIRED CONFIG) -+find_package(zstd REQUIRED CONFIG) -+target_link_libraries(ktx PRIVATE lodepng::lodepng $,zstd::libzstd_shared,zstd::libzstd_static>) -+target_link_libraries(ktx_read PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) - target_include_directories( - ktx - PRIVATE ---- a/tools/toktx/CMakeLists.txt -+++ b/tools/toktx/CMakeLists.txt -@@ -28,6 +28,8 @@ PRIVATE - target_link_libraries( - toktx - ktx -+ lodepng::lodepng -+ $,zstd::libzstd_shared,zstd::libzstd_static> - ) - - target_compile_definitions( ---- a/tools/toktx/pngimage.cc -+++ b/tools/toktx/pngimage.cc -@@ -21,7 +21,7 @@ - #include - - #include "image.hpp" --#include "encoder/lodepng.h" -+#include - #include - #include "dfd.h" - diff --git a/recipes/ktx/all/patches/0001-objutil-cxx-std.patch b/recipes/ktx/all/patches/4.0.0/0001-objutil-cxx-std.patch similarity index 100% rename from recipes/ktx/all/patches/0001-objutil-cxx-std.patch rename to recipes/ktx/all/patches/4.0.0/0001-objutil-cxx-std.patch diff --git a/recipes/ktx/all/patches/0002-lodepng-no-export-symbols.patch b/recipes/ktx/all/patches/4.0.0/0002-lodepng-no-export-symbols.patch similarity index 100% rename from recipes/ktx/all/patches/0002-lodepng-no-export-symbols.patch rename to recipes/ktx/all/patches/4.0.0/0002-lodepng-no-export-symbols.patch diff --git a/recipes/ktx/all/patches/0003-clamp-include-algorithm.patch b/recipes/ktx/all/patches/4.0.0/0003-clamp-include-algorithm.patch similarity index 100% rename from recipes/ktx/all/patches/0003-clamp-include-algorithm.patch rename to recipes/ktx/all/patches/4.0.0/0003-clamp-include-algorithm.patch diff --git a/recipes/ktx/all/patches/4.0.0/0004-unvendor-dependencies.patch b/recipes/ktx/all/patches/4.0.0/0004-unvendor-dependencies.patch new file mode 100644 index 0000000000000..076b9eecaa908 --- /dev/null +++ b/recipes/ktx/all/patches/4.0.0/0004-unvendor-dependencies.patch @@ -0,0 +1,48 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -121,7 +121,6 @@ set(KTX_MAIN_SRC + lib/basisu/transcoder/basisu_transcoder.cpp + lib/basisu/transcoder/basisu_transcoder.h + lib/basisu/transcoder/basisu.h +- lib/basisu/zstd/zstd.c + lib/checkheader.c + lib/dfdutils/createdfd.c + lib/dfdutils/colourspaces.c +@@ -415,11 +414,13 @@ PRIVATE + lib/basisu/encoder/cppspmd_type_aliases.h + lib/basisu/encoder/jpgd.cpp + lib/basisu/encoder/jpgd.h +- lib/basisu/encoder/lodepng.cpp +- lib/basisu/encoder/lodepng.h + lib/writer1.c + lib/writer2.c + ) ++find_package(lodepng REQUIRED CONFIG) ++find_package(zstd REQUIRED CONFIG) ++target_link_libraries(ktx PRIVATE lodepng::lodepng zstd::libzstd) ++target_link_libraries(ktx_read PRIVATE zstd::libzstd) + target_include_directories( + ktx + PRIVATE +--- a/tools/toktx/CMakeLists.txt ++++ b/tools/toktx/CMakeLists.txt +@@ -28,6 +28,8 @@ PRIVATE + target_link_libraries( + toktx + ktx ++ lodepng::lodepng ++ zstd::libzstd + ) + + target_compile_definitions( +--- a/tools/toktx/pngimage.cc ++++ b/tools/toktx/pngimage.cc +@@ -21,7 +21,7 @@ + #include + + #include "image.hpp" +-#include "encoder/lodepng.h" ++#include + #include + #include "dfd.h" + diff --git a/recipes/ktx/all/patches/4.3.2/0001-objutil-cxx-std.patch b/recipes/ktx/all/patches/4.3.2/0001-objutil-cxx-std.patch new file mode 100644 index 0000000000000..fee67e7e70f54 --- /dev/null +++ b/recipes/ktx/all/patches/4.3.2/0001-objutil-cxx-std.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -972,6 +972,6 @@ + PUBLIC + utils + ) +- ++target_compile_features(objUtil PUBLIC cxx_std_11) + # In C++ apps that use statically linked Libraries all compilatiom units must + # be compiled with matching symbol visibility settings to avoid warnings from diff --git a/recipes/ktx/all/patches/4.3.2/0004-unvendor-dependencies.patch b/recipes/ktx/all/patches/4.3.2/0004-unvendor-dependencies.patch new file mode 100644 index 0000000000000..5fb6ef588fa4e --- /dev/null +++ b/recipes/ktx/all/patches/4.3.2/0004-unvendor-dependencies.patch @@ -0,0 +1,21 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -355,7 +355,6 @@ + lib/basisu/transcoder/basisu_transcoder.cpp + lib/basisu/transcoder/basisu_transcoder.h + lib/basisu/transcoder/basisu.h +- lib/basisu/zstd/zstd.c + lib/checkheader.c + lib/dfdutils/createdfd.c + lib/dfdutils/colourspaces.c +@@ -765,6 +764,10 @@ + BASISD_SUPPORT_KTX2=0 + ) + ++find_package(zstd REQUIRED CONFIG) ++target_link_libraries(ktx PUBLIC zstd::libzstd) ++target_link_libraries(ktx_read PUBLIC zstd::libzstd) ++ + # Turn off these warnings until Rich fixes the occurences. + # It it not clear to me if generator expressions can be used here + # hence the long-winded way. diff --git a/recipes/ktx/all/test_package/CMakeLists.txt b/recipes/ktx/all/test_package/CMakeLists.txt index 0d08193e7ed87..85df2370166e4 100644 --- a/recipes/ktx/all/test_package/CMakeLists.txt +++ b/recipes/ktx/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(Ktx REQUIRED CONFIG) diff --git a/recipes/ktx/all/test_package/conanfile.py b/recipes/ktx/all/test_package/conanfile.py index 5ec8993308c18..98ab55852ad56 100644 --- a/recipes/ktx/all/test_package/conanfile.py +++ b/recipes/ktx/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - ktx_path = os.path.join(self.source_folder, "etc1.ktx") - self.run(f"{bin_path} {ktx_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/ktx/all/test_package/etc1.ktx b/recipes/ktx/all/test_package/etc1.ktx deleted file mode 100644 index ff6f8186fd1db..0000000000000 Binary files a/recipes/ktx/all/test_package/etc1.ktx and /dev/null differ diff --git a/recipes/ktx/all/test_package/test_package.c b/recipes/ktx/all/test_package/test_package.c index f877690cdb0d6..ebd19452339ab 100644 --- a/recipes/ktx/all/test_package/test_package.c +++ b/recipes/ktx/all/test_package/test_package.c @@ -4,16 +4,12 @@ int main(int argc, char **argv) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - ktxTexture* texture; KTX_error_code result; - result = ktxTexture_CreateFromNamedFile(argv[1], + result = ktxTexture_CreateFromNamedFile("fake-file.ktx", KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT, &texture); + printf("Test: %s\n", ktxErrorString(result)); return 0; } diff --git a/recipes/ktx/all/test_v1_package/CMakeLists.txt b/recipes/ktx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/ktx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ktx/all/test_v1_package/conanfile.py b/recipes/ktx/all/test_v1_package/conanfile.py deleted file mode 100644 index d6484909910f3..0000000000000 --- a/recipes/ktx/all/test_v1_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 = os.path.join("bin", "test_package") - ktx_path = os.path.join(self.source_folder, os.pardir, "test_package", "etc1.ktx") - self.run(f"{bin_path} {ktx_path}", run_environment=True) diff --git a/recipes/ktx/config.yml b/recipes/ktx/config.yml index d2be8f453d7c0..6d8c546915dba 100644 --- a/recipes/ktx/config.yml +++ b/recipes/ktx/config.yml @@ -1,3 +1,5 @@ versions: + "4.3.2": + folder: all "4.0.0": folder: all diff --git a/recipes/kuba-zip/all/conandata.yml b/recipes/kuba-zip/all/conandata.yml index a1cc22f7f211a..2c9419a46ca41 100644 --- a/recipes/kuba-zip/all/conandata.yml +++ b/recipes/kuba-zip/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.3.2": + url: "https://github.com/kuba--/zip/archive/v0.3.2.tar.gz" + sha256: "0c33740aec7a3913bca07df360420c19cac5e794e0f602f14f798cb2e6f710e5" + "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" diff --git a/recipes/kuba-zip/all/conanfile.py b/recipes/kuba-zip/all/conanfile.py index 7d777e775d48f..be6ec0335c4ea 100644 --- a/recipes/kuba-zip/all/conanfile.py +++ b/recipes/kuba-zip/all/conanfile.py @@ -1,9 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, 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" +required_conan_version = ">=2.1" class ZipConan(ConanFile): @@ -46,6 +47,8 @@ def generate(self): tc.variables["CMAKE_DISABLE_TESTING"] = True tc.variables["ZIP_STATIC_PIC"] = self.options.get_safe("fPIC", True) tc.variables["ZIP_BUILD_DOCS"] = False + if Version(self.version) < "0.2.3": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def _patch_sources(self): @@ -67,9 +70,6 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "zip") self.cpp_info.set_property("cmake_target_name", "zip::zip") - self.cpp_info.names["cmake_find_package"] = "zip" - self.cpp_info.names["cmake_find_package_multi"] = "zip" - self.cpp_info.libs = ["zip"] if self.options.shared: self.cpp_info.defines.append("ZIP_SHARED") diff --git a/recipes/kuba-zip/all/test_package/CMakeLists.txt b/recipes/kuba-zip/all/test_package/CMakeLists.txt index e346717f7b6ff..2ccba60ae2cbd 100644 --- a/recipes/kuba-zip/all/test_package/CMakeLists.txt +++ b/recipes/kuba-zip/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(zip REQUIRED CONFIG) diff --git a/recipes/kuba-zip/all/test_v1_package/CMakeLists.txt b/recipes/kuba-zip/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/kuba-zip/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/kuba-zip/all/test_v1_package/conanfile.py b/recipes/kuba-zip/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/kuba-zip/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_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/kuba-zip/config.yml b/recipes/kuba-zip/config.yml index 12742f0517b7f..b1201b1eaf043 100644 --- a/recipes/kuba-zip/config.yml +++ b/recipes/kuba-zip/config.yml @@ -1,4 +1,8 @@ versions: + "0.3.2": + folder: "all" + "0.3.1": + folder: "all" "0.3.0": folder: "all" "0.2.6": diff --git a/recipes/kuliya/all/conandata.yml b/recipes/kuliya/all/conandata.yml new file mode 100644 index 0000000000000..06675980fd094 --- /dev/null +++ b/recipes/kuliya/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.0.0": + release: + url: "https://github.com/dzcode-io/kuliya/releases/download/c-v1.0.0/c-release.tar.gz" + sha256: "a0e064d29358e40245dc8b7b35160a6b15e10059e4bd42d9dc4f0af76d031e5f" + # Old versions don't have the license embed in the release tar, download it separatedly for now + # from the commit of the upstream tag + license: + url: "https://raw.githubusercontent.com/dzcode-io/kuliya/c-v1.0.0/LICENSE" + sha256: "70884fb7eff4f91c8d776f8cf7bd93cce0c93213f57153956189b488cfd911be" diff --git a/recipes/kuliya/all/conanfile.py b/recipes/kuliya/all/conanfile.py new file mode 100644 index 0000000000000..ad769bd5235f6 --- /dev/null +++ b/recipes/kuliya/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.files import copy, get, download +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.50.0" + + +class JsmnConan(ConanFile): + name = "kuliya" + description = "Algeria's college hierarchy dataset as a C library." + license = "MIT" + topics = ("dataset", "api", "dz", "header-only") + homepage = "https://github.com/dzcode-io/kuliya" + 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() + + def source(self): + get(self, **self.conan_data["sources"][self.version]["release"], strip_root=True) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "kuliya.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, "data.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 = [] diff --git a/recipes/kuliya/all/test_package/CMakeLists.txt b/recipes/kuliya/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6ca62a693d64a --- /dev/null +++ b/recipes/kuliya/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(kuliya REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE kuliya::kuliya) diff --git a/recipes/kuliya/all/test_package/conanfile.py b/recipes/kuliya/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/kuliya/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/kuliya/all/test_package/test_package.c b/recipes/kuliya/all/test_package/test_package.c new file mode 100644 index 0000000000000..5e3b275cf2747 --- /dev/null +++ b/recipes/kuliya/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#undef NDEBUG + +#include +#include +#include + +int main() +{ + kuliya_init(); + kuliya_schema *res = get_node_by_path("umkb/fst"); + assert(strcmp(res->name.en, "Faculty of Science and Technology") == 0); + kuliya_deinit(); +} diff --git a/recipes/kuliya/config.yml b/recipes/kuliya/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/kuliya/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/laslib/all/conandata.yml b/recipes/laslib/all/conandata.yml new file mode 100644 index 0000000000000..06edf050658b1 --- /dev/null +++ b/recipes/laslib/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.0.2": + url: "https://github.com/LAStools/LAStools/archive/refs/tags/v2.0.2.tar.gz" + sha256: "41200e2b6ad92fe057fc5008132978090890463d5b602bce89ecf8aa84c78a82" +patches: + "2.0.2": + - patch_file: "patches/0001-build-only-laslib.patch" + patch_description: "Build only laslib from LASTools: update multiple CMakeList.txt" + patch_type: "conan" diff --git a/recipes/laslib/all/conanfile.py b/recipes/laslib/all/conanfile.py new file mode 100644 index 0000000000000..b96d3b8c39723 --- /dev/null +++ b/recipes/laslib/all/conanfile.py @@ -0,0 +1,106 @@ +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 stdcpp_library, 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 LASlibConan(ConanFile): + name = "laslib" + description = "Efficient tools for lidar processing" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/LAStools/LAStools/tree/master/LASlib" + topics = ("las", "laz", "lidar", "compression", "decompression") + + 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") + + 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 validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + minimum_compiler = self._compilers_minimum_version.get(str(self.settings.compiler)) + if minimum_compiler and Version(self.settings.compiler.version) < minimum_compiler: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="COPYING.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + # Copy the libraries + if self.options.shared: + copy(self, pattern="*.dll", src=self.package_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + + # some files extensions and folders are not allowed. + 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.libdirs = ["lib/LASlib"] + self.cpp_info.libs = ["LASlib"] + + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/laslib/all/patches/0001-build-only-laslib.patch b/recipes/laslib/all/patches/0001-build-only-laslib.patch new file mode 100644 index 0000000000000..bba3290d34146 --- /dev/null +++ b/recipes/laslib/all/patches/0001-build-only-laslib.patch @@ -0,0 +1,47 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b776cb7..8bbe6a6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.8 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.5 FATAL_ERROR) + set(CMAKE_SUPPRESS_REGENERATION true) + project("LAStools") + +@@ -10,12 +10,5 @@ endif() + + option(BUILD_SHARED_LIBS "Build LASlib as DLL" OFF) + +-if (BUILD_SHARED_LIBS AND UNIX AND NOT APPLE) +- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/LASlib") +-endif() + + add_subdirectory(LASlib/src) +-add_subdirectory(src) +-if (EXISTS src_full) +- add_subdirectory(src_full) +-endif() +diff --git a/LASlib/src/CMakeLists.txt b/LASlib/src/CMakeLists.txt +index 1b170bf..6a114eb 100644 +--- a/LASlib/src/CMakeLists.txt ++++ b/LASlib/src/CMakeLists.txt +@@ -101,15 +101,7 @@ endif() + + install(FILES ${LAS_INCLUDES} DESTINATION include/LASlib) + +-if (MSVC) +- foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} ) +- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../lib/${OUTPUTCONFIG} DESTINATION lib/LASlib) +- endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES ) +-else() +- install(TARGETS LASlib EXPORT laslib-targets +- ARCHIVE DESTINATION lib/LASlib +- LIBRARY DESTINATION lib/LASlib +- RUNTIME DESTINATION lib/LASlib) +- install(EXPORT laslib-targets DESTINATION lib/cmake/LASlib) +- install(FILES ${CMAKE_SOURCE_DIR}/LASlib/src/laslib-config.cmake DESTINATION lib/cmake/LASlib) +-endif(MSVC) ++install(TARGETS LASlib EXPORT laslib-targets ++ ARCHIVE DESTINATION lib/LASlib ++ LIBRARY DESTINATION lib/LASlib ++ RUNTIME DESTINATION lib/LASlib) diff --git a/recipes/laslib/all/test_package/CMakeLists.txt b/recipes/laslib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..37bb2bb665c3c --- /dev/null +++ b/recipes/laslib/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(laslib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE laslib::laslib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/laslib/all/test_package/conanfile.py b/recipes/laslib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0af7e06b95a10 --- /dev/null +++ b/recipes/laslib/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 = "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.bindir, "test_package") + self.run(bin_path, env="conanrun") + diff --git a/recipes/laslib/all/test_package/test_package.cpp b/recipes/laslib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..39f06f0b590d3 --- /dev/null +++ b/recipes/laslib/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include "LASlib/lasreader.hpp" + +int main(void) { + + LASreadOpener readOpener; + readOpener.set_file_name("test_package.cpp"); + + std::cout << "Test: " << readOpener.active() << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/laslib/config.yml b/recipes/laslib/config.yml new file mode 100644 index 0000000000000..766ae143dc2cf --- /dev/null +++ b/recipes/laslib/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "2.0.2": + folder: all diff --git a/recipes/laszip/all/conandata.yml b/recipes/laszip/all/conandata.yml index ec975a7f08b7b..8adc75c9b51ce 100644 --- a/recipes/laszip/all/conandata.yml +++ b/recipes/laszip/all/conandata.yml @@ -2,7 +2,16 @@ sources: "3.4.3": url: "https://github.com/LASzip/LASzip/releases/download/3.4.3/laszip-src-3.4.3.tar.bz2" sha256: "5775eb0b97de1b77514d47534cc65c6cfb5bebdd8aed0e47a23af8e75b7ea887" + "3.4.4": + url: "https://github.com/LASzip/LASzip/archive/refs/tags/3.4.4.tar.gz" + sha256: "6d034bf3a400f81317a5dbad59d1b7ce82d971e887ca22d15813b914f0a5c281" patches: "3.4.3": - patch_file: "patches/0001-no-build-laszip-api.patch" - patch_file: "patches/0002-no-rpath-and-relocatable-macos.patch" + "3.4.4": + - patch_file: "patches/0001-3.4.4-no-build-laszip-api.patch" + - patch_file: "patches/0002-3.4.4-no-rpath-and-relocatable-macos.patch" + - patch_file: "patches/0003-3.4.4-remove-cppstd-hardcode.patch" + patch_type: "conan" + patch_description: "Let Conan set the cppstd, instead of forcing it (In this version it's incorreclty set to C++17 instead of the supported C++14)" diff --git a/recipes/laszip/all/conanfile.py b/recipes/laszip/all/conanfile.py index a88e4d8aa5712..30e72169c7cd5 100644 --- a/recipes/laszip/all/conanfile.py +++ b/recipes/laszip/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import stdcpp_library +from conan.tools.build import stdcpp_library, 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.scm import Version @@ -27,6 +27,10 @@ class LaszipConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 14 + def export_sources(self): export_conandata_patches(self) @@ -35,8 +39,14 @@ def config_options(self): del self.options.fPIC def configure(self): + if Version(self.version) >= "3.4.4": + self.license = "Apache-2.0" if self.options.shared: self.options.rm_safe("fPIC") + + 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") diff --git a/recipes/laszip/all/patches/0001-3.4.4-no-build-laszip-api.patch b/recipes/laszip/all/patches/0001-3.4.4-no-build-laszip-api.patch new file mode 100644 index 0000000000000..8e99797f7ecb7 --- /dev/null +++ b/recipes/laszip/all/patches/0001-3.4.4-no-build-laszip-api.patch @@ -0,0 +1,8 @@ +--- a/dll/CMakeLists.txt ++++ b/dll/CMakeLists.txt +@@ -2,5 +2,4 @@ set(LASZIP_API_SOURCES + laszip_api.c + ) + +-LASZIP_ADD_LIBRARY(${LASZIP_API_LIB_NAME} ${LASZIP_API_SOURCES}) + LASZIP_ADD_INCLUDES("laszip" "${CMAKE_CURRENT_SOURCE_DIR}/laszip_api.h" ${LASZIP_API_VERSION_H}) diff --git a/recipes/laszip/all/patches/0002-3.4.4-no-rpath-and-relocatable-macos.patch b/recipes/laszip/all/patches/0002-3.4.4-no-rpath-and-relocatable-macos.patch new file mode 100644 index 0000000000000..5aa1f83f0fd18 --- /dev/null +++ b/recipes/laszip/all/patches/0002-3.4.4-no-rpath-and-relocatable-macos.patch @@ -0,0 +1,29 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -81,15 +81,11 @@ file(MAKE_DIRECTORY "${LASZIP_OUTPUT_BIN_DIR}") + # per http://www.cmake.org/Wiki/CMake_RPATH_handling + SET(CMAKE_SKIP_BUILD_RPATH FALSE) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + IF (APPLE) + SET(MACOSX_RPATH ON) + endif() + LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/${LASZIP_LIB_INSTALL_DIR}" isSystemDir) +-IF("${isSystemDir}" STREQUAL "-1") +- SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LASZIP_LIB_INSTALL_DIR}") +-ENDIF("${isSystemDir}" STREQUAL "-1") + + # wipe lib/ drectory on clean. It will have plugins that could be out of date + # in the next build +--- a/cmake/macros.cmake ++++ b/cmake/macros.cmake +@@ -71,8 +71,6 @@ macro(LASZIP_ADD_LIBRARY _name) + LIBRARY DESTINATION ${LASZIP_LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LASZIP_LIB_INSTALL_DIR}) + if (APPLE) +- set_target_properties(${_name} PROPERTIES INSTALL_NAME_DIR +- "@executable_path/../lib") + endif() + endmacro(LASZIP_ADD_LIBRARY) + diff --git a/recipes/laszip/all/patches/0003-3.4.4-remove-cppstd-hardcode.patch b/recipes/laszip/all/patches/0003-3.4.4-remove-cppstd-hardcode.patch new file mode 100644 index 0000000000000..1dbe071adbbce --- /dev/null +++ b/recipes/laszip/all/patches/0003-3.4.4-remove-cppstd-hardcode.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4b0a02b..a9cc6b5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,6 @@ + cmake_minimum_required(VERSION 3.10) + + project(LASZIP CXX C) +-set(CMAKE_CXX_STANDARD 17) + string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) + + set(ROOT_DIR "${PROJECT_SOURCE_DIR}") diff --git a/recipes/laszip/all/test_package/CMakeLists.txt b/recipes/laszip/all/test_package/CMakeLists.txt index 2732324131a2f..0358fd4568603 100644 --- a/recipes/laszip/all/test_package/CMakeLists.txt +++ b/recipes/laszip/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(laszip REQUIRED CONFIG) diff --git a/recipes/laszip/all/test_v1_package/CMakeLists.txt b/recipes/laszip/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/laszip/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/laszip/all/test_v1_package/conanfile.py b/recipes/laszip/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/laszip/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_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/laszip/config.yml b/recipes/laszip/config.yml index 0d0a2f21c9983..a2d2267e94e46 100644 --- a/recipes/laszip/config.yml +++ b/recipes/laszip/config.yml @@ -1,3 +1,5 @@ versions: + "3.4.4": + folder: all "3.4.3": 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 bc10e97d6f111..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" @@ -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/all/test_package/CMakeLists.txt b/recipes/lcms/all/test_package/CMakeLists.txt index c0d476f344024..eb5b24406b932 100644 --- a/recipes/lcms/all/test_package/CMakeLists.txt +++ b/recipes/lcms/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(lcms REQUIRED CONFIG) diff --git a/recipes/lcms/all/test_v1_package/CMakeLists.txt b/recipes/lcms/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/lcms/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/lcms/all/test_v1_package/conanfile.py b/recipes/lcms/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/lcms/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_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/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/test_package/CMakeLists.txt b/recipes/ldns/all/test_package/CMakeLists.txt index a7ad4d67ebd49..b6d8ad2493926 100644 --- a/recipes/ldns/all/test_package/CMakeLists.txt +++ b/recipes/ldns/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest C) find_package(PkgConfig) 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/CMakeLists.txt b/recipes/ldns/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3c9553de48e54..0000000000000 --- a/recipes/ldns/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest C) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ldns/all/test_v1_package/conanfile.py b/recipes/ldns/all/test_v1_package/conanfile.py deleted file mode 100644 index 648cf88ac9c76..0000000000000 --- a/recipes/ldns/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conans.tools import cross_building -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "pkg_config" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - example = os.path.join("test_package", "example") - self.run(example, run_environment=True) 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/test_package/CMakeLists.txt b/recipes/lefticus-tools/all/test_package/CMakeLists.txt index d6a06ccd62240..0979f39cda7ba 100644 --- a/recipes/lefticus-tools/all/test_package/CMakeLists.txt +++ b/recipes/lefticus-tools/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(lefticus-tools REQUIRED CONFIG) diff --git a/recipes/lely-core/all/conandata.yml b/recipes/lely-core/all/conandata.yml index cc7e4931e5ec2..a02c4e51288f2 100644 --- a/recipes/lely-core/all/conandata.yml +++ b/recipes/lely-core/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.3.4": + url: "https://gitlab.com/lely_industries/lely-core/-/archive/v2.3.4/lely-core-v2.3.4.tar.gz" + sha256: "6f31b4fd7ea6aafb1a62b9d956a12a900386564859099e97af1c6bd1d10bdaf2" + "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 9ed8f191a0a19..7e88aacc94143 100644 --- a/recipes/lely-core/all/conanfile.py +++ b/recipes/lely-core/all/conanfile.py @@ -12,13 +12,18 @@ class LelyConan(ConanFile): name = "lely-core" + 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." + ) 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." + homepage = "https://gitlab.com/lely_industries/lely-core/" topics = ("canopen",) package_type = "library" - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], diff --git a/recipes/lely-core/all/test_package/CMakeLists.txt b/recipes/lely-core/all/test_package/CMakeLists.txt index c8be0aec2f07e..5118afa11e02a 100644 --- a/recipes/lely-core/all/test_package/CMakeLists.txt +++ b/recipes/lely-core/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.2) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(lely-core REQUIRED) diff --git a/recipes/lely-core/all/test_v1_package/CMakeLists.txt b/recipes/lely-core/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index ce0ee43ce03ba..0000000000000 --- a/recipes/lely-core/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.2) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory("${CMAKE_SOURCE_DIR}/../test_package" "${CMAKE_BINARY_DIR}/test_package") diff --git a/recipes/lely-core/all/test_v1_package/conanfile.py b/recipes/lely-core/all/test_v1_package/conanfile.py deleted file mode 100644 index 0245c9a8028a3..0000000000000 --- a/recipes/lely-core/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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): - self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/lely-core/config.yml b/recipes/lely-core/config.yml index aee8de619ec30..e8d99700ff1a0 100644 --- a/recipes/lely-core/config.yml +++ b/recipes/lely-core/config.yml @@ -1,3 +1,7 @@ versions: + "2.3.4": + folder: all + "2.3.3": + folder: all "2.3.2": folder: all diff --git a/recipes/lemon/all/test_package/CMakeLists.txt b/recipes/lemon/all/test_package/CMakeLists.txt index 939f259b3d4dd..9ecc1d06c78fa 100644 --- a/recipes/lemon/all/test_package/CMakeLists.txt +++ b/recipes/lemon/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) find_program(LEMON_PROGRAM NAMES lemon) diff --git a/recipes/lemon/all/test_v1_package/CMakeLists.txt b/recipes/lemon/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/lemon/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/lemon/all/test_v1_package/conanfile.py b/recipes/lemon/all/test_v1_package/conanfile.py deleted file mode 100644 index 02ecf312299d6..0000000000000 --- a/recipes/lemon/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - test_type = "explicit" - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - - 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/leopard/all/conandata.yml b/recipes/leopard/all/conandata.yml new file mode 100644 index 0000000000000..293257cff4fed --- /dev/null +++ b/recipes/leopard/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.1.0": + url: "https://github.com/hosseinmoein/Leopard/archive/refs/tags/2.1.0.tar.gz" + sha256: "26b57fdea4cd94ddbc34a478e978632637cde2fc263bdf2d6bdfd3e9ddd0b1d5" + "2.0.0": + url: "https://github.com/hosseinmoein/Leopard/archive/refs/tags/2.0.0.tar.gz" + sha256: "c24ac5d2555c4496f26662925061a52ae1b2265ae9fc91b0cce19d1647d62699" diff --git a/recipes/leopard/all/conanfile.py b/recipes/leopard/all/conanfile.py new file mode 100644 index 0000000000000..f2a3c9d555477 --- /dev/null +++ b/recipes/leopard/all/conanfile.py @@ -0,0 +1,80 @@ +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 LeopardConan(ConanFile): + name = "leopard" + description = "C++ light-weight Thread Pool library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hosseinmoein/Leopard" + topics = ("async", "concurrency", "multithreading", "threadpool", "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": "11", + "clang": "12", + "apple-clang": "14", + "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="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + copy( + self, + pattern="*.tcc", + 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", "ThreadPool") + self.cpp_info.set_property("cmake_target_name", "ThreadPool::ThreadPool") + self.cpp_info.set_property("pkg_config_name", "ThreadPool") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "dl", "m"]) diff --git a/recipes/leopard/all/test_package/CMakeLists.txt b/recipes/leopard/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ea0b1b09a817d --- /dev/null +++ b/recipes/leopard/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ThreadPool REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ThreadPool::ThreadPool) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) + +if(ThreadPool_VERSION VERSION_LESS 2.1.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE "THREADPOOL_LESS_2_1_0") +endif() diff --git a/recipes/leopard/all/test_package/conanfile.py b/recipes/leopard/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/leopard/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/leopard/all/test_package/test_package.cpp b/recipes/leopard/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..abf2d43498e45 --- /dev/null +++ b/recipes/leopard/all/test_package/test_package.cpp @@ -0,0 +1,69 @@ +#ifdef THREADPOOL_LESS_2_1_0 +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace hmthrp; + +// ---------------------------------------------------------------------------- + +static constexpr std::size_t THREAD_COUNT = 5; + +// ---------------------------------------------------------------------------- + +static void parallel_accumulate() { + + std::cout << "Running parallel_accumulate() ..." << std::endl; + + constexpr std::size_t n { 10003 }; + constexpr std::size_t the_sum { (n * (n + 1)) / 2 }; + std::vector vec (n); + + std::iota(vec.begin(), vec.end(), 1); + + constexpr std::size_t block_size { n / THREAD_COUNT }; + std::vector> futs; + auto block_start = vec.begin(); + ThreadPool thr_pool { THREAD_COUNT }; + + futs.reserve(THREAD_COUNT - 1); + for (std::size_t i = 0; i < (THREAD_COUNT - 1); ++i) { + const auto block_end { block_start + block_size }; + + futs.push_back( + thr_pool.dispatch( + false, + std::accumulate, + block_start, block_end, 0)); + block_start = block_end; + } + + // Last result + // + std::size_t result { std::accumulate(block_start, vec.end(), 0UL) }; + + for (std::size_t i = 0; i < futs.size(); ++i) + result += futs[i].get(); + + assert(result == the_sum); + return; +} + +// ---------------------------------------------------------------------------- + +int main (int, char *[]) { + + parallel_accumulate(); + + return (EXIT_SUCCESS); +} diff --git a/recipes/leopard/config.yml b/recipes/leopard/config.yml new file mode 100644 index 0000000000000..2d136f3fe768d --- /dev/null +++ b/recipes/leopard/config.yml @@ -0,0 +1,5 @@ +versions: + "2.1.0": + folder: all + "2.0.0": + folder: all diff --git a/recipes/leptonica/all/conandata.yml b/recipes/leptonica/all/conandata.yml index 49782e81d8fcd..0a2cd20eab0b4 100644 --- a/recipes/leptonica/all/conandata.yml +++ b/recipes/leptonica/all/conandata.yml @@ -1,28 +1,13 @@ sources: + "1.85.0": + url: "https://github.com/DanBloomberg/leptonica/archive/1.85.0.tar.gz" + sha256: "c01376bce0379d4ea4bc2ec5d5cbddaa49e2f06f88242619ab8c059e21adf233" "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" "1.82.0": url: "https://github.com/DanBloomberg/leptonica/archive/1.82.0.tar.gz" sha256: "40fa9ac1e815b91e0fa73f0737e60c9eec433a95fa123f95f2573dd3127dd669" "1.81.0": url: "https://github.com/DanBloomberg/leptonica/archive/1.81.0.tar.gz" sha256: "70ebc04ff8b9684205bd1d01843c635a8521255b74813bf7cce9a33368f7952c" - "1.80.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.80.0.tar.gz" - sha256: "3952b974ec057d24267aae48c54bca68ead8275604bf084a73a4b953ff79196e" - "1.79.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.79.0.tar.gz" - sha256: "bf9716f91a4844c2682a07ef21eaf68b6f1077af1f63f27c438394fd66218e17" - "1.78.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.78.0.tar.gz" - sha256: "f8ac4d93cc76b524c2c81d27850bfc342e68b91368aa7a1f7d69e34ce13adbb4" -patches: - "1.78.0": - - patch_file: "patches/fix-find-modules-variables.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "portability" - patch_source: "https://github.com/DanBloomberg/leptonica/pull/456" diff --git a/recipes/leptonica/all/conanfile.py b/recipes/leptonica/all/conanfile.py index 6bcb75d8840d6..f19aa2e7c182f 100644 --- a/recipes/leptonica/all/conanfile.py +++ b/recipes/leptonica/all/conanfile.py @@ -72,15 +72,15 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.1") + self.requires("libjpeg-turbo/3.0.2") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.5") if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_tiff: self.requires("libtiff/4.6.0") if self.options.with_openjpeg: - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.with_webp: self.requires("libwebp/1.3.2") @@ -94,11 +94,17 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - if Version(self.version) < "1.79.0": - tc.variables["STATIC"] = not self.options.shared tc.variables["BUILD_PROG"] = False tc.variables["SW_BUILD"] = False - if Version(self.version) >= "1.83.0": + if Version(self.version) >= "1.85.0": + tc.variables["ENABLE_ZLIB"] = self.options.with_zlib + tc.variables["ENABLE_PNG"] = self.options.with_png + tc.variables["ENABLE_GIF"] = self.options.with_gif + tc.variables["ENABLE_JPEG"] = self.options.with_jpeg + tc.variables["ENABLE_TIFF"] = self.options.with_tiff + tc.variables["ENABLE_WEBP"] = self.options.with_webp + tc.variables["ENABLE_OPENJPEG"] = self.options.with_openjpeg + elif Version(self.version) >= "1.83.0": tc.variables["LIBWEBP_SUPPORT"] = self.options.with_webp tc.variables["OPENJPEG_SUPPORT"] = self.options.with_openjpeg tc.generate() @@ -128,69 +134,56 @@ def _patch_sources(self): replace_in_file(self, cmakelists_src, "${GIF_LIBRARIES}", "GIF::GIF") if not self.options.with_gif: replace_in_file(self, cmakelists_src, "if (GIF_LIBRARIES)", "if(0)") - if Version(self.version) >= "1.83.0": - replace_in_file(self, cmake_configure, "if(GIF_FOUND)", "if(0)") - else: - replace_in_file(self, cmake_configure, "if (GIF_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (GIF_FOUND)", "if(0)") ## libjpeg replace_in_file(self, cmakelists_src, "${JPEG_LIBRARIES}", "JPEG::JPEG") if not self.options.with_jpeg: replace_in_file(self, cmakelists_src, "if (JPEG_LIBRARIES)", "if(0)") - if Version(self.version) >= "1.83.0": - replace_in_file(self, cmake_configure, "if(JPEG_FOUND)", "if(0)") - else: - replace_in_file(self, cmake_configure, "if (JPEG_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (JPEG_FOUND)", "if(0)") ## libpng replace_in_file(self, cmakelists_src, "${PNG_LIBRARIES}", "PNG::PNG") if not self.options.with_png: replace_in_file(self, cmakelists_src, "if (PNG_LIBRARIES)", "if(0)") - if Version(self.version) >= "1.83.0": - replace_in_file(self, cmake_configure, "if(PNG_FOUND)", "if(0)") - else: - replace_in_file(self, cmake_configure, "if (PNG_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (PNG_FOUND)", "if(0)") ## libtiff replace_in_file(self, cmakelists_src, "${TIFF_LIBRARIES}", "TIFF::TIFF") if not self.options.with_tiff: replace_in_file(self, cmakelists_src, "if (TIFF_LIBRARIES)", "if(0)") - if Version(self.version) >= "1.83.0": - replace_in_file(self, cmake_configure, "if(TIFF_FOUND)", "if(0)") - else: - replace_in_file(self, cmake_configure, "if (TIFF_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (TIFF_FOUND)", "if(0)") ## We have to be more aggressive with dependencies found with pkgconfig ## Injection of libdirs is ensured by conan_basic_setup() ## openjpeg - replace_in_file(self, cmakelists_src, "${JP2K_LIBRARIES}", "openjp2") + if Version(self.version) < "1.85.0": + replace_in_file(self, cmakelists_src, "${JP2K_LIBRARIES}", "openjp2") if Version(self.version) < "1.83.0": # pkgconfig is prefered to CMake. Disable pkgconfig so only CMake is used - if Version(self.version) <= "1.78.0": - replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2)", "") - else: - replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)", "") + replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)", "") # versions below 1.83.0 do not have an option toggle replace_in_file(self, cmakelists, "if(NOT JP2K)", "if(0)") if not self.options.with_openjpeg: replace_in_file(self, cmakelists_src, "if (JP2K_FOUND)", "if(0)") replace_in_file(self, cmake_configure, "if (JP2K_FOUND)", "if(0)") - else: + elif Version(self.version) < "1.85.0": replace_in_file(self, cmakelists, "set(JP2K_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIRS})", "set(JP2K_INCLUDE_DIRS ${OpenJPEG_INCLUDE_DIRS})") if not self.options.with_openjpeg: - replace_in_file(self, cmake_configure, "if(JP2K_FOUND)", "if(0)") + replace_in_file(self, cmake_configure, "if (JP2K_FOUND)", "if(0)") ## libwebp if Version(self.version) < "1.83.0": # versions below 1.83.0 do not have an option toggle replace_in_file(self, cmakelists, "if(NOT WEBP)", "if(0)") - if Version(self.version) >= "1.79.0": - replace_in_file(self, cmakelists, "if(NOT WEBPMUX)", "if(0)") + replace_in_file(self, cmakelists, "if(NOT WEBPMUX)", "if(0)") if not self.options.with_webp: replace_in_file(self, cmakelists_src, "if (WEBP_FOUND)", "if(0)") replace_in_file(self, cmake_configure, "if (WEBP_FOUND)", "if(0)") - replace_in_file(self, cmakelists_src, - "if (WEBP_FOUND)", - "if (WEBP_FOUND)\n" - "target_link_directories(leptonica PRIVATE ${WEBP_LIBRARY_DIRS} ${WEBPMUX_LIBRARY_DIRS})\n" - "target_compile_definitions(leptonica PRIVATE ${WEBP_CFLAGS_OTHER} ${WEBPMUX_CFLAGS_OTHER})") - replace_in_file(self, cmakelists_src, "${WEBP_LIBRARIES}", "${WEBP_LIBRARIES} ${WEBPMUX_LIBRARIES}") + if Version(self.version) < "1.85.0": + if Version(self.version) >= "1.83.0" and self.options.with_webp: + replace_in_file(self, cmakelists_src, + "if (WEBP_FOUND)", + "if (WEBP_FOUND)\n" + "target_link_directories(leptonica PRIVATE ${WEBP_LIBRARY_DIRS} ${WEBPMUX_LIBRARY_DIRS})\n" + "target_compile_definitions(leptonica PRIVATE ${WEBP_CFLAGS_OTHER} ${WEBPMUX_CFLAGS_OTHER})") + replace_in_file(self, cmakelists_src, "${WEBP_LIBRARIES}", "${WEBP_LIBRARIES} ${WEBPMUX_LIBRARIES}") # Remove detection of fmemopen() on macOS < 10.13 # CheckFunctionExists will find it in the link library. diff --git a/recipes/leptonica/all/patches/fix-find-modules-variables.patch b/recipes/leptonica/all/patches/fix-find-modules-variables.patch deleted file mode 100644 index 3dc86df7e707e..0000000000000 --- a/recipes/leptonica/all/patches/fix-find-modules-variables.patch +++ /dev/null @@ -1,48 +0,0 @@ -see https://github.com/DanBloomberg/leptonica/pull/456 - ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -31,33 +31,33 @@ if (NOT STATIC) - target_compile_definitions (leptonica PRIVATE -DLIBLEPT_EXPORTS) - endif() - --if (GIF_LIBRARY) -+if (GIF_LIBRARIES) - target_include_directories (leptonica PUBLIC ${GIF_INCLUDE_DIR}) -- target_link_libraries (leptonica ${GIF_LIBRARY}) -+ target_link_libraries (leptonica ${GIF_LIBRARIES}) - endif() --if (JPEG_LIBRARY) -+if (JPEG_LIBRARIES) - target_include_directories (leptonica PUBLIC ${JPEG_INCLUDE_DIR}) -- target_link_libraries (leptonica ${JPEG_LIBRARY}) -+ target_link_libraries (leptonica ${JPEG_LIBRARIES}) - endif() - if (JP2K_FOUND) - target_include_directories (leptonica PUBLIC ${JP2K_INCLUDE_DIRS}) - target_link_libraries (leptonica ${JP2K_LIBRARIES}) - endif() --if (PNG_LIBRARY) -+if (PNG_LIBRARIES) - target_include_directories (leptonica PUBLIC ${PNG_INCLUDE_DIRS}) -- target_link_libraries (leptonica ${PNG_LIBRARY}) -+ target_link_libraries (leptonica ${PNG_LIBRARIES}) - endif() --if (TIFF_LIBRARY) -+if (TIFF_LIBRARIES) - target_include_directories (leptonica PUBLIC ${TIFF_INCLUDE_DIR}) -- target_link_libraries (leptonica ${TIFF_LIBRARY}) -+ target_link_libraries (leptonica ${TIFF_LIBRARIES}) - endif() - if (WEBP_FOUND) - target_include_directories (leptonica PUBLIC ${WEBP_INCLUDE_DIRS}) - target_link_libraries (leptonica ${WEBP_LIBRARIES}) - endif() --if (ZLIB_LIBRARY) -+if (ZLIB_LIBRARIES) - target_include_directories (leptonica PUBLIC ${ZLIB_INCLUDE_DIR}) -- target_link_libraries (leptonica ${ZLIB_LIBRARY}) -+ target_link_libraries (leptonica ${ZLIB_LIBRARIES}) - endif() - - if (UNIX) diff --git a/recipes/leptonica/all/test_package/CMakeLists.txt b/recipes/leptonica/all/test_package/CMakeLists.txt index b498b89f556d8..8e34bff1a3e78 100644 --- a/recipes/leptonica/all/test_package/CMakeLists.txt +++ b/recipes/leptonica/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(Leptonica REQUIRED CONFIG) diff --git a/recipes/leptonica/all/test_v1_package/CMakeLists.txt b/recipes/leptonica/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/leptonica/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/leptonica/all/test_v1_package/conanfile.py b/recipes/leptonica/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/leptonica/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_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/leptonica/config.yml b/recipes/leptonica/config.yml index 7de53a77a3916..73dd82999a627 100644 --- a/recipes/leptonica/config.yml +++ b/recipes/leptonica/config.yml @@ -1,15 +1,9 @@ versions: - "1.83.1": + "1.85.0": folder: all - "1.83.0": + "1.83.1": folder: all "1.82.0": folder: all "1.81.0": folder: all - "1.80.0": - folder: all - "1.79.0": - folder: all - "1.78.0": - folder: all diff --git a/recipes/lerc/all/conandata.yml b/recipes/lerc/all/conandata.yml index 73b69372cf8f4..d53c3de3dfbc3 100644 --- a/recipes/lerc/all/conandata.yml +++ b/recipes/lerc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.0.4": + url: "https://github.com/Esri/lerc/archive/js_v4.0.4.tar.gz" + sha256: "1dc090218387ab8ca615eefd844207be64454e37868b396f3e965ed0dcf83947" "4.0.1": url: "https://github.com/Esri/lerc/archive/js_v4.0.1.tar.gz" sha256: "d771f45b90dd033187d5fad2b99159d0a98d46878d88d3236147c3df297dd544" @@ -12,6 +15,14 @@ sources: url: "https://github.com/Esri/lerc/archive/v2.1.tar.gz" sha256: "7c48de40cd5f09319de4b39c417ff4eec4ad4b6aa5d6144f6ffa9b10d18ec94e" patches: + "4.0.4": + - patch_file: "patches/4.0.0-include-algorithm.patch" + patch_description: "include algorithm header for std::min/max" + patch_type: "portability" + - patch_file: "patches/4.0.4-add-missing-climits-include.patch" + patch_description: "add missing #include " + patch_type: "bugfix" + patch_source: "https://github.com/Esri/lerc/commit/1fc73694263f53cf029c8cac2e632170880f56d4" "4.0.1": - patch_file: "patches/4.0.0-include-algorithm.patch" patch_description: "include algorithm header for std::min/max" diff --git a/recipes/lerc/all/conanfile.py b/recipes/lerc/all/conanfile.py index c64435c5746f7..02e1f24f77f3f 100644 --- a/recipes/lerc/all/conanfile.py +++ b/recipes/lerc/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, stdcpp_library from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, rmdir from conan.tools.scm import Version @@ -73,6 +73,8 @@ def package_info(self): self.cpp_info.libs = ["LercLib" if Version(self.version) < "4.0.0" else "Lerc"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") + if not self.options.shared and stdcpp_library(self): + self.cpp_info.system_libs.append(stdcpp_library(self)) if Version(self.version) >= "3.0": self.cpp_info.set_property("pkg_config_name", "Lerc") diff --git a/recipes/lerc/all/patches/4.0.4-add-missing-climits-include.patch b/recipes/lerc/all/patches/4.0.4-add-missing-climits-include.patch new file mode 100644 index 0000000000000..e65c9a909930e --- /dev/null +++ b/recipes/lerc/all/patches/4.0.4-add-missing-climits-include.patch @@ -0,0 +1,21 @@ +From 1fc73694263f53cf029c8cac2e632170880f56d4 Mon Sep 17 00:00:00 2001 +From: Thomas Maurer +Date: Wed, 8 Nov 2023 12:54:35 -0800 +Subject: [PATCH] add missing include + +--- + src/LercLib/fpl_Compression.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/LercLib/fpl_Compression.cpp b/src/LercLib/fpl_Compression.cpp +index bea9483..22773dd 100644 +--- a/src/LercLib/fpl_Compression.cpp ++++ b/src/LercLib/fpl_Compression.cpp +@@ -27,6 +27,7 @@ Original coding 2021 Yuriy Yakimenko + #include + #include + #include ++#include + + USING_NAMESPACE_LERC + diff --git a/recipes/lerc/all/test_package/CMakeLists.txt b/recipes/lerc/all/test_package/CMakeLists.txt index 50d07b3052d3e..aa9a2340324cc 100644 --- a/recipes/lerc/all/test_package/CMakeLists.txt +++ b/recipes/lerc/all/test_package/CMakeLists.txt @@ -1,12 +1,11 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C CXX) find_package(lerc REQUIRED CONFIG) -add_executable(test_package test_package.cpp) -target_link_libraries(test_package PRIVATE lerc::lerc) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +add_executable(${PROJECT_NAME}_cxx test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cxx PRIVATE lerc::lerc) +target_compile_features(${PROJECT_NAME}_cxx PRIVATE cxx_std_11) -if(lerc_VERSION VERSION_GREATER_EQUAL "3.0") - target_compile_definitions(${PROJECT_NAME} PRIVATE -DLERC_VER3_LATER) -endif() +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE lerc::lerc) diff --git a/recipes/lerc/all/test_package/conanfile.py b/recipes/lerc/all/test_package/conanfile.py index 0a6bc68712d90..f5c4345946223 100644 --- a/recipes/lerc/all/test_package/conanfile.py +++ b/recipes/lerc/all/test_package/conanfile.py @@ -22,5 +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_cxx") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package_c") self.run(bin_path, env="conanrun") diff --git a/recipes/lerc/all/test_package/test_package.c b/recipes/lerc/all/test_package/test_package.c new file mode 100644 index 0000000000000..193917ddd512b --- /dev/null +++ b/recipes/lerc/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include + +#include + +int main() { + const uint32_t numBytesBlob = 275714; + uint8_t pLercBlob[1000000]; + uint32_t infoArr[10]; + double dataRangeArr[3]; + lerc_getBlobInfo(&pLercBlob[0], numBytesBlob, infoArr, dataRangeArr, 10, 3); +} diff --git a/recipes/lerc/all/test_package/test_package.cpp b/recipes/lerc/all/test_package/test_package.cpp index c399abcf8d219..98eb0ea449f54 100644 --- a/recipes/lerc/all/test_package/test_package.cpp +++ b/recipes/lerc/all/test_package/test_package.cpp @@ -1,140 +1,12 @@ #include -#include -#include -#include -#include +#include #include -typedef unsigned char Byte; // convenience -typedef unsigned int uint32; - -enum lerc_DataType { dt_char = 0, dt_uchar, dt_short, dt_ushort, dt_int, dt_uint, dt_float, dt_double }; - -void BlobInfo_Print(const uint32* infoArr) -{ - const uint32* ia = infoArr; - printf("version = %d, dataType = %d, nDim = %d, nCols = %d, nRows = %d, nBands = %d, nValidPixels = %d, blobSize = %d\n", - ia[0], ia[1], ia[2], ia[3], ia[4], ia[5], ia[6], ia[7]); -} - -bool BlobInfo_Equal(const uint32* infoArr, uint32 nDim, uint32 nCols, uint32 nRows, uint32 nBands, uint32 dataType) -{ - const uint32* ia = infoArr; - return ia[1] == dataType && ia[2] == nDim && ia[3] == nCols && ia[4] == nRows && ia[5] == nBands; -} - -// Sample 1: float image, 1 band, with some pixels set to invalid / void, maxZError = 0.1 -void sample1() { - const int h = 512; - const int w = 512; - - std::vector zImg(w * h); - std::vector maskByteImg(w * h); - for (int k = 0, i = 0; i < h; ++i) { - for (int j = 0; j < w; ++j, ++k) { - zImg[k] = std::sqrt(static_cast(i * i + j * j)); // smooth surface - zImg[k] += std::rand() % 20; // add some small amplitude noise - - if (j % 100 == 0 || i % 100 == 0) // set some void points - maskByteImg[k] = 0; - else - maskByteImg[k] = 1; - } - } - - - // compress into byte arr - - double maxZErrorWanted = 0.1; - double eps = 0.0001; // safety margin (optional), to account for finite floating point accuracy - double maxZError = maxZErrorWanted - eps; - - uint32 numBytesNeeded = 0; - uint32 numBytesWritten = 0; - - lerc_status hr = lerc_computeCompressedSize(reinterpret_cast(&zImg[0]), // raw image data, row by row, band by band - static_cast(dt_float), 1, w, h, 1, -#ifdef LERC_VER3_LATER - 1, -#endif - maskByteImg.data(), // can give nullptr if all pixels are valid - maxZError, // max coding error per pixel, or precision - &numBytesNeeded); // size of outgoing Lerc blob - - if (hr) - std::cout << "lerc_computeCompressedSize(...) failed" << std::endl; - - uint32 numBytesBlob = numBytesNeeded; - std::vector pLercBlob(numBytesBlob); - - hr = lerc_encode(reinterpret_cast(&zImg[0]), // raw image data, row by row, band by band - static_cast(dt_float), 1, w, h, 1, -#ifdef LERC_VER3_LATER - 1, -#endif - maskByteImg.data(), // can give nullptr if all pixels are valid - maxZError, // max coding error per pixel, or precision - &pLercBlob[0], // buffer to write to, function will fail if buffer too small - numBytesBlob, // buffer size - &numBytesWritten); // num bytes written to buffer - - if (hr) - std::cout << "lerc_encode(...) failed" << std::endl; - - double ratio = w * h * (0.125 + sizeof(float)) / numBytesBlob; - std::cout << "sample 1 compression ratio = " << ratio << std::endl; - - - // decompress - - uint32 infoArr[10]; - double dataRangeArr[3]; - hr = lerc_getBlobInfo(&pLercBlob[0], numBytesBlob, infoArr, dataRangeArr, 10, 3); - if (hr) - std::cout << "lerc_getBlobInfo(...) failed" << std::endl; - - BlobInfo_Print(infoArr); - - if (!BlobInfo_Equal(infoArr, 1, w, h, 1, static_cast(dt_float))) - std::cout << "got wrong lerc info" << std::endl; - - // new empty data storage - std::vector zImg3(w * h); - - std::vector maskByteImg3(w * h); - -#ifdef LERC_VER3_LATER - hr = lerc_decode(&pLercBlob[0], numBytesBlob, 1, maskByteImg3.data(), 1, w, h, 1, static_cast(dt_float), reinterpret_cast(&zImg3[0])); -#else - hr = lerc_decode(&pLercBlob[0], numBytesBlob, &maskByteImg3[0], 1, w, h, 1, static_cast(dt_float), reinterpret_cast(&zImg3[0])); -#endif - if (hr) - std::cout << "lerc_decode(...) failed" << std::endl; - - // compare to orig - - double maxDelta = 0; - for (int k = 0, i = 0; i < h; i++) - { - for (int j = 0; j < w; j++, k++) - { - if (maskByteImg3[k] != maskByteImg[k]) - std::cout << "Error in main: decoded valid bytes differ from encoded valid bytes" << std::endl; - - if (maskByteImg3[k]) - { - double delta = std::fabs(zImg3[k] - zImg[k]); - if (delta > maxDelta) - maxDelta = delta; - } - } - } - - std::cout << "max z error per pixel = " << maxDelta << std::endl; -} - int main() { - sample1(); - return 0; + uint32_t numBytesBlob = 275714; + std::vector pLercBlob(numBytesBlob); + uint32_t infoArr[10]; + double dataRangeArr[3]; + lerc_getBlobInfo(&pLercBlob[0], numBytesBlob, infoArr, dataRangeArr, 10, 3); } diff --git a/recipes/lerc/all/test_v1_package/CMakeLists.txt b/recipes/lerc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/lerc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/lerc/all/test_v1_package/conanfile.py b/recipes/lerc/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/lerc/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_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/lerc/config.yml b/recipes/lerc/config.yml index a09a8d0001ec6..471b2c25702d4 100644 --- a/recipes/lerc/config.yml +++ b/recipes/lerc/config.yml @@ -1,4 +1,6 @@ versions: + "4.0.4": + folder: all "4.0.1": folder: all "4.0.0": diff --git a/recipes/lest/all/conandata.yml b/recipes/lest/all/conandata.yml index 0c06b134376db..e910aac388249 100644 --- a/recipes/lest/all/conandata.yml +++ b/recipes/lest/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.35.2": + url: "https://github.com/martinmoene/lest/archive/v1.35.2.tar.gz" + sha256: "570031345d703587c4984b1fa918e611693735beeb37a6d889d234599b73c670" "1.35.1": url: "https://github.com/martinmoene/lest/archive/v1.35.1.tar.gz" sha256: "ca715833563f983c81d86623c2d1911d7a2aa04ce00459b0f3794a8e441265e0" diff --git a/recipes/lest/all/test_package/CMakeLists.txt b/recipes/lest/all/test_package/CMakeLists.txt index 5d9ebbc9ca6a1..7c83263783aaf 100644 --- a/recipes/lest/all/test_package/CMakeLists.txt +++ b/recipes/lest/all/test_package/CMakeLists.txt @@ -5,4 +5,3 @@ find_package(lest REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) 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/test_package.cpp b/recipes/lest/all/test_package/test_package.cpp index 7b3f62f3908f8..e161263ae0bc7 100644 --- a/recipes/lest/all/test_package/test_package.cpp +++ b/recipes/lest/all/test_package/test_package.cpp @@ -1,14 +1,16 @@ -#include "lest/lest.hpp" +#include "lest/lest_cpp03.hpp" +#define CASE( name ) lest_CASE( specification, name ) -const lest::test specification[] = +using namespace lest; + +test_specification specification; + +CASE( "Comment converted to bool indicates absence or presence of comment" ) { - CASE( "Empty string has length zero (succeed)" ) - { - EXPECT( 0 == std::string( ).length() ); - EXPECT( 0 == std::string("").length() ); - }, -}; + EXPECT( false == bool( comment( "") ) ); + EXPECT( true == bool( comment("x") ) ); +} int main( int argc, char * argv[] ) { diff --git a/recipes/lest/config.yml b/recipes/lest/config.yml index 1e86bc3f93bdf..d5f65df0bf534 100644 --- a/recipes/lest/config.yml +++ b/recipes/lest/config.yml @@ -1,3 +1,5 @@ versions: + "1.35.2": + folder: all "1.35.1": folder: all diff --git a/recipes/level-zero/all/conandata.yml b/recipes/level-zero/all/conandata.yml new file mode 100644 index 0000000000000..239ec80fcfb55 --- /dev/null +++ b/recipes/level-zero/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.17.39": + url: "https://github.com/oneapi-src/level-zero/archive/refs/tags/v1.17.39.tar.gz" + sha256: "70473c7262eee80dbe7c17974684ba9d3e34efc15ecba919b85e3cea7b1e180e" +patches: + "1.17.39": + - patch_file: "patches/1.17.39/001-patch-remove-qspectre.patch" + patch_description: "Removed /Qspectre" + patch_type: "portability" \ No newline at end of file diff --git a/recipes/level-zero/all/conanfile.py b/recipes/level-zero/all/conanfile.py new file mode 100644 index 0000000000000..191466efdba72 --- /dev/null +++ b/recipes/level-zero/all/conanfile.py @@ -0,0 +1,74 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import get, apply_conandata_patches, copy, export_conandata_patches, rmdir, replace_in_file +from conan.tools.build import check_min_cppstd +import os + + +class LevelZeroConan(ConanFile): + name = "level-zero" + license = "MIT" + homepage = "https://github.com/oneapi-src/level-zero" + url = "https://github.com/conan-io/conan-center-index" + description = "OneAPI Level Zero Specification Headers and Loader" + topics = ("api-headers", "loader", "level-zero", "oneapi") + package_type = "shared-library" + + # Binary configuration + settings = "os", "arch", "compiler", "build_type" + + def requirements(self): + self.requires("spdlog/1.14.1") + + def source(self): + version_data = self.conan_data["sources"][self.version] + get(self, **version_data, strip_root=True) + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "source", "loader","ze_loader.cpp"), + "#ifdef __linux__", "#if defined(__linux__) || defined(__APPLE__)") + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + toolchain = CMakeToolchain(self) + toolchain.generate() + + def validate(self): + if is_apple_os(self): + self.output.warning("Level Zero is not known to support Apple platforms") + if self.settings.os == "Windows" and self.settings.get_safe("subsystem") == "uwp": + raise ConanInvalidConfiguration(f"{self.ref} does not support UWP on Windows.") + + min_cpp_std = "14" + check_min_cppstd(self, min_cpp_std) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + 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")) + + def package_info(self): + self.cpp_info.components["ze-loader"].libs = ["ze_loader"] + self.cpp_info.components["ze-loader"].includedirs = ["include", "include/level_zero"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ze-loader"].system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["ze-loader"].system_libs = ["cfgmgr32"] + self.cpp_info.components["ze-loader"].set_property("pkg_config_name", "libze_loader") + self.cpp_info.components["level-zero"].requires = ["ze-loader"] + self.cpp_info.components["level-zero"].set_property("pkg_config_name", "level-zero") diff --git a/recipes/level-zero/all/patches/1.17.39/001-patch-remove-qspectre.patch b/recipes/level-zero/all/patches/1.17.39/001-patch-remove-qspectre.patch new file mode 100644 index 0000000000000..997ca7a844e96 --- /dev/null +++ b/recipes/level-zero/all/patches/1.17.39/001-patch-remove-qspectre.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ac2ab9f..5282757 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -132,12 +132,6 @@ if(MSVC) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DYNAMICBASE") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf") + # enable Spectre Mitigation, not supported by clang-cl +- if((NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang) AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM)) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qspectre") +- endif() +- if((NOT CMAKE_C_COMPILER_ID STREQUAL Clang) AND NOT (CMAKE_C_COMPILER_ID STREQUAL IntelLLVM)) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Qspectre") +- endif() + endif() + + #CXX compiler support diff --git a/recipes/level-zero/all/test_package/CMakeLists.txt b/recipes/level-zero/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6b92e033f045a --- /dev/null +++ b/recipes/level-zero/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.2.0) +project(test_package LANGUAGES CXX) + +find_package(level-zero CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE level-zero::level-zero) + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) \ No newline at end of file diff --git a/recipes/level-zero/all/test_package/conanfile.py b/recipes/level-zero/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0ac491f64a94f --- /dev/null +++ b/recipes/level-zero/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, CMakeDeps, CMakeToolchain, cmake_layout +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/level-zero/all/test_package/test_package.cpp b/recipes/level-zero/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..50cc7683ea557 --- /dev/null +++ b/recipes/level-zero/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include "ze_api.h" + +int main() { + zeInit(0); + return 0; +} diff --git a/recipes/level-zero/config.yml b/recipes/level-zero/config.yml new file mode 100644 index 0000000000000..6cac94c96d3b8 --- /dev/null +++ b/recipes/level-zero/config.yml @@ -0,0 +1,3 @@ +versions: + "1.17.39": + folder: "all" diff --git a/recipes/leveldb/all/conanfile.py b/recipes/leveldb/all/conanfile.py index 25822de4f07a9..8886ea342497d 100644 --- a/recipes/leveldb/all/conanfile.py +++ b/recipes/leveldb/all/conanfile.py @@ -52,7 +52,7 @@ def requirements(self): # there is no "official" conan package yet; when that is available, we # can add similar with options for those if self.options.with_snappy: - self.requires("snappy/1.1.9") + self.requires("snappy/1.1.10") if self.options.with_crc32c: self.requires("crc32c/1.1.2") diff --git a/recipes/leveldb/all/test_package/CMakeLists.txt b/recipes/leveldb/all/test_package/CMakeLists.txt index c55600d5161fd..8820590563bce 100644 --- a/recipes/leveldb/all/test_package/CMakeLists.txt +++ b/recipes/leveldb/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(leveldb REQUIRED CONFIG) diff --git a/recipes/leveldb/all/test_v1_package/CMakeLists.txt b/recipes/leveldb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/leveldb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/leveldb/all/test_v1_package/conanfile.py b/recipes/leveldb/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/leveldb/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_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/lexbor/all/conandata.yml b/recipes/lexbor/all/conandata.yml index ea023ab0ff4cf..9471d4c69b3ec 100644 --- a/recipes/lexbor/all/conandata.yml +++ b/recipes/lexbor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.0": + url: "https://github.com/lexbor/lexbor/archive/v2.4.0.zip" + sha256: "8cfaf8783f736ce784f5fbdf284a6db8c0943d6589d5a0c10257ba948ae2e7b1" "2.3.0": url: "https://github.com/lexbor/lexbor/archive/v2.3.0.zip" sha256: "5ebdaca76715d737ba5ce5cb782c743caabccdf918854c19c1d5a9a3dd5f19e9" @@ -8,3 +11,6 @@ sources: "2.1.0": url: "https://github.com/lexbor/lexbor/archive/v2.1.0.zip" sha256: "58d684d19cec689e40d8d443b3b953697cfa677a0ca59a2cf1fc14cd37ac2404" +patches: + "2.1.0": + - patch_file: "patches/2.1.0-0000-macos-rpath.patch" diff --git a/recipes/lexbor/all/conanfile.py b/recipes/lexbor/all/conanfile.py index edf0b7a768ab8..3df91b1d41784 100644 --- a/recipes/lexbor/all/conanfile.py +++ b/recipes/lexbor/all/conanfile.py @@ -1,11 +1,12 @@ 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 -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +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 import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LexborConan(ConanFile): name = "lexbor" @@ -35,6 +36,9 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + def export_sources(self): + export_conandata_patches(self) + def configure(self): if self.options.shared: self.options.rm_safe("fPIC") @@ -54,6 +58,7 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) @@ -62,6 +67,10 @@ def generate(self): tc.variables["LEXBOR_TESTS_CPP"] = False tc.variables["LEXBOR_BUILD_SEPARATELY"] = self.options.build_separately tc.variables["LEXBOR_INSTALL_HEADERS"] = True + if Version(self.version) < "2.3.0": + # To install relocatable shared lib on Macos by default + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -76,9 +85,6 @@ def package(self): def package_info(self): target = "lexbor" if self.options.shared else "lexbor_static" - self.cpp_info.names["cmake_find_package"] = "lexbor" - self.cpp_info.names["cmake_find_package_multi"] = "lexbor" - self.cpp_info.components["_lexbor"].set_property("cmake_target_name", f"lexbor::{target}") self.cpp_info.components["_lexbor"].libs = [target] @@ -90,8 +96,5 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_lexbor"].system_libs.append("m") - # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.set_property("cmake_file_name", "lexbor") self.cpp_info.set_property("cmake_target_name", f"lexbor::{target}") - self.cpp_info.components["_lexbor"].names["cmake_find_package"] = target - self.cpp_info.components["_lexbor"].names["cmake_find_package_multi"] = target diff --git a/recipes/lexbor/all/patches/2.1.0-0000-macos-rpath.patch b/recipes/lexbor/all/patches/2.1.0-0000-macos-rpath.patch new file mode 100644 index 0000000000000..aac5f6e576b54 --- /dev/null +++ b/recipes/lexbor/all/patches/2.1.0-0000-macos-rpath.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3f271b0..4b5ba64 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,6 +59,9 @@ IF(NOT LEXBOR_MAKE_DISTRO_NUM) + set(LEXBOR_MAKE_DISTRO_NUM "1") + ENDIF() + ++enable_language(C) ++enable_language(CXX) ++ + ################ + ## Version and path + ######################### +@@ -78,13 +81,13 @@ set(LEXBOR_INSTALL_DLL_EXE_DIR "bin") + ################ + ## RPATH + ######################### +-include(GNUInstallDirs) +- + IF(APPLE) + set(CMAKE_MACOSX_RPATH ON) + + set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR}) +-ENDIF(APPLE) ++ELSEIF(UNIX) ++ include(GNUInstallDirs) ++ENDIF() + + ################ + ## lib param diff --git a/recipes/lexbor/all/test_package/CMakeLists.txt b/recipes/lexbor/all/test_package/CMakeLists.txt index 6ac27dcd72792..b023278622a14 100644 --- a/recipes/lexbor/all/test_package/CMakeLists.txt +++ b/recipes/lexbor/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(lexbor REQUIRED CONFIG) diff --git a/recipes/lexbor/all/test_v1_package/CMakeLists.txt b/recipes/lexbor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/lexbor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/lexbor/all/test_v1_package/conanfile.py b/recipes/lexbor/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/lexbor/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/lexbor/config.yml b/recipes/lexbor/config.yml index 1da7c205b6ff2..35c4f4ddfb50b 100644 --- a/recipes/lexbor/config.yml +++ b/recipes/lexbor/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.0": + folder: "all" "2.3.0": folder: "all" "2.2.0": diff --git a/recipes/libaec/all/conandata.yml b/recipes/libaec/all/conandata.yml index f02aae783d14c..02f7c64ddfad5 100644 --- a/recipes/libaec/all/conandata.yml +++ b/recipes/libaec/all/conandata.yml @@ -1,22 +1,7 @@ sources: + "1.1.2": + url: "https://gitlab.dkrz.de/k202009/libaec/-/archive/v1.1.2/libaec-v1.1.2.tar.bz2" + sha256: "bdad8c7923537c3695327aa85afdcd714fb3d30a5f956a27ba2971ef98c043ac" "1.0.6": - url: "https://gitlab.dkrz.de/k202009/libaec/uploads/45b10e42123edd26ab7b3ad92bcf7be2/libaec-1.0.6.tar.gz" - sha256: "032961877231113bb094ef224085e6d66fd670f85a3e17f53d0f131abf24f2fd" - "1.0.4": - url: "https://gitlab.dkrz.de/k202009/libaec/uploads/ea0b7d197a950b0c110da8dfdecbb71f/libaec-1.0.4.tar.gz" - sha256: "f2b1b232083bd8beaf8a54a024225de3dd72a673a9bcdf8c3ba96c39483f4309" -patches: - "1.0.4": - - patch_file: "patches/1.0.4-0001-Fix-static-library-builds.patch" - patch_type: "conan" - patch_description: "Fix static library builds" - - patch_file: "patches/1.0.4-0002-fix-install-ios.patch" - patch_type: "conan" - patch_description: "Fix install iOS" - "1.0.6": - - patch_file: "patches/1.0.6-0001-fix-library-builds.patch" - patch_type: "conan" - patch_description: "Fix library builds" - - patch_file: "patches/1.0.6-0002-fix-cmake-build-with-ninja.patch" - patch_type: "conan" - patch_description: "Ninja needs 'aec' binary to be put in a separate folder to an imaginary 'aec' object output" + url: "https://gitlab.dkrz.de/k202009/libaec/-/archive/v1.0.6/libaec-v1.0.6.tar.bz2" + sha256: "31fb65b31e835e1a0f3b682d64920957b6e4407ee5bbf42ca49549438795a288" diff --git a/recipes/libaec/all/conanfile.py b/recipes/libaec/all/conanfile.py index e624f9f76f9b5..82b06f8697908 100644 --- a/recipes/libaec/all/conanfile.py +++ b/recipes/libaec/all/conanfile.py @@ -1,12 +1,12 @@ 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, rm, rmdir, replace_in_file -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, rm, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibaecConan(ConanFile): @@ -16,6 +16,8 @@ class LibaecConan(ConanFile): homepage = "https://gitlab.dkrz.de/k202009/libaec" description = "Adaptive Entropy Coding library" topics = "dsp", "encoding", "decoding" + + package_type = "library" settings = "os", "compiler", "build_type", "arch" options = { "shared": [True, False], @@ -27,7 +29,7 @@ class LibaecConan(ConanFile): } def export_sources(self): - export_conandata_patches(self) + copy(self, "set_runtime_output_dir.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -35,72 +37,74 @@ 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 validate(self): - if Version(self.version) >= "1.0.6" and is_msvc(self): - # libaec/1.0.6 uses "restrict" keyword which seems to be supported since Visual Studio 16. - if Version(self.settings.compiler.version) < "16": - raise ConanInvalidConfiguration("{} does not support Visual Studio {}".format(self.name, self.settings.compiler.version)) - # In libaec/1.0.6, fail to build aec_client command with debug and shared settings in Visual Studio. - # Temporary, this recipe doesn't support these settings. - if self.options.shared and self.settings.build_type == "Debug": - raise ConanInvalidConfiguration("{} does not support debug and shared build in Visual Studio(currently)".format(self.name)) + # libaec/1.0.6 uses "restrict" keyword which seems to be supported since Visual Studio 16. + check_min_vs(self, 192) + # libaec/1.0.6 fails to build aec_client command with debug and shared settings in Visual Studio. + # Temporary, this recipe doesn't support these settings. + if is_msvc(self) and self.options.shared and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.name} does not support debug and shared build in Visual Studio (currently)") def source(self): - get(self, **self.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) - # 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.cache_variables["CMAKE_PROJECT_libaec_INCLUDE"] = "set_runtime_output_dir.cmake" + tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared tc.generate() + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "set(CMAKE_C_STANDARD 99)", "set(CMAKE_C_STANDARD 11)") + replace_in_file(self, cmakelists, "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + targets = "aec_shared sz_shared" if self.options.shared else "aec_static sz_static" + aec_client = " aec_client" if Version(self.version) < "1.1" else "" + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + f"install(TARGETS aec_static aec_shared sz_static sz_shared{aec_client})", + f"install(TARGETS {targets}{aec_client} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin)") + def build(self): - apply_conandata_patches(self) - if Version(self.version) < "1.0.6": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "add_subdirectory(tests)", "") + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() def package(self): - if Version(self.version) < "1.0.6": - copy(self, pattern="Copyright.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - else: - copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() + copy(self, "*.h", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + copy(self, "libaec.h", os.path.join(self.build_folder, "include"), os.path.join(self.package_folder, "include")) rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "cmake")) rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libaec") + + # CMake targets are based on + # https://gitlab.dkrz.de/k202009/libaec/-/blob/master/cmake/libaec-config.cmake.in + self.cpp_info.components["aec"].set_property("cmake_target_name", "libaec::aec") aec_name = "aec" - if self.settings.os == "Windows" and Version(self.version) >= "1.0.6" and not self.options.shared: - aec_name = "aec_static" + if self.settings.os == "Windows" and not self.options.shared: + aec_name = "aec-static" + self.cpp_info.components["aec"].libs = [aec_name] + + self.cpp_info.components["sz"].set_property("cmake_target_name", "libaec::sz") szip_name = "sz" if self.settings.os == "Windows": - if Version(self.version) >= "1.0.6": - szip_name = "szip" if self.options.shared else "szip_static" - elif self.options.shared: - szip_name = "szip" - self.cpp_info.libs = [szip_name, aec_name] + szip_name = "szip" if self.options.shared else "szip-static" + self.cpp_info.components["sz"].libs = [szip_name] + + # TODO: Legacy, to be removed on Conan 2.0 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/libaec/all/patches/1.0.4-0001-Fix-static-library-builds.patch b/recipes/libaec/all/patches/1.0.4-0001-Fix-static-library-builds.patch deleted file mode 100644 index ba756f64d8e76..0000000000000 --- a/recipes/libaec/all/patches/1.0.4-0001-Fix-static-library-builds.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 6df13969e6967dbed660271011e872c9c366037a Mon Sep 17 00:00:00 2001 -From: Brennan Ashton -Date: Tue, 28 Jan 2020 03:59:02 -0800 -Subject: [PATCH] Fix static library builds - -Signed-off-by: Brennan Ashton ---- - CMakeLists.txt | 3 --- - src/CMakeLists.txt | 10 +++++++++- - src/libaec.h | 28 ++++++++++------------------ - src/szlib.h | 6 +++--- - 4 files changed, 22 insertions(+), 25 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d71d26c..4f38618 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -43,9 +43,6 @@ option(BUILD_SHARED_LIBS "Build Shared Libraries" ON) - if(BUILD_SHARED_LIBS) - set (LIB_TYPE SHARED) - else(BUILD_SHARED_LIBS) -- if(WIN32) -- message(WARNING "You will have to modify libaec.h for static libs.") -- endif(WIN32) - set(LIB_TYPE STATIC) - endif(BUILD_SHARED_LIBS) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index ed6053e..93a78f2 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -1,5 +1,13 @@ -+include (GenerateExportHeader) - add_library(aec ${LIB_TYPE} ${libaec_SRCS}) - set_target_properties(aec PROPERTIES VERSION 0.0.10 SOVERSION 0) -+generate_export_header(aec -+ BASE_NAME libaec -+ EXPORT_MACRO_NAME libaec_EXPORT -+ EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/libaec_Export.h -+ STATIC_DEFINE libaec_BUILT_AS_STATIC -+) -+ - add_library(sz ${LIB_TYPE} sz_compat.c) - set_target_properties(sz PROPERTIES VERSION 2.0.1 SOVERSION 2) - -@@ -41,7 +49,7 @@ else(WIN32) - DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 COMPONENT doc) - endif(WIN32) - --install(FILES libaec.h szlib.h -+install(FILES libaec.h szlib.h ${PROJECT_BINARY_DIR}/libaec_Export.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT headers) - install(TARGETS aec_client -diff --git a/src/libaec.h b/src/libaec.h -index bb43be9..44505e4 100644 ---- a/src/libaec.h -+++ b/src/libaec.h -@@ -52,20 +52,12 @@ - - #include - -+#include "libaec_Export.h" -+ - #ifdef __cplusplus - extern "C"{ - #endif - --#if BUILDING_LIBAEC && HAVE_VISIBILITY --# define LIBAEC_DLL_EXPORTED __attribute__((__visibility__("default"))) --#elif BUILDING_LIBAEC && defined _MSC_VER --# define LIBAEC_DLL_EXPORTED __declspec(dllexport) --#elif defined _MSC_VER --# define LIBAEC_DLL_EXPORTED __declspec(dllimport) --#else --# define LIBAEC_DLL_EXPORTED --#endif -- - struct internal_state; - - struct aec_stream { -@@ -155,19 +147,19 @@ struct aec_stream { - /*********************************************/ - /* Streaming encoding and decoding functions */ - /*********************************************/ --LIBAEC_DLL_EXPORTED int aec_encode_init(struct aec_stream *strm); --LIBAEC_DLL_EXPORTED int aec_encode(struct aec_stream *strm, int flush); --LIBAEC_DLL_EXPORTED int aec_encode_end(struct aec_stream *strm); -+libaec_EXPORT int aec_encode_init(struct aec_stream *strm); -+libaec_EXPORT int aec_encode(struct aec_stream *strm, int flush); -+libaec_EXPORT int aec_encode_end(struct aec_stream *strm); - --LIBAEC_DLL_EXPORTED int aec_decode_init(struct aec_stream *strm); --LIBAEC_DLL_EXPORTED int aec_decode(struct aec_stream *strm, int flush); --LIBAEC_DLL_EXPORTED int aec_decode_end(struct aec_stream *strm); -+libaec_EXPORT int aec_decode_init(struct aec_stream *strm); -+libaec_EXPORT int aec_decode(struct aec_stream *strm, int flush); -+libaec_EXPORT int aec_decode_end(struct aec_stream *strm); - - /***************************************************************/ - /* Utility functions for encoding or decoding a memory buffer. */ - /***************************************************************/ --LIBAEC_DLL_EXPORTED int aec_buffer_encode(struct aec_stream *strm); --LIBAEC_DLL_EXPORTED int aec_buffer_decode(struct aec_stream *strm); -+libaec_EXPORT int aec_buffer_encode(struct aec_stream *strm); -+libaec_EXPORT int aec_buffer_decode(struct aec_stream *strm); - - #ifdef __cplusplus - } -diff --git a/src/szlib.h b/src/szlib.h -index 1eaa577..18b6a3c 100644 ---- a/src/szlib.h -+++ b/src/szlib.h -@@ -80,15 +80,15 @@ typedef struct SZ_com_t_s - int pixels_per_scanline; - } SZ_com_t; - --LIBAEC_DLL_EXPORTED int SZ_BufftoBuffCompress( -+libaec_EXPORT int SZ_BufftoBuffCompress( - void *dest, size_t *destLen, - const void *source, size_t sourceLen, - SZ_com_t *param); --LIBAEC_DLL_EXPORTED int SZ_BufftoBuffDecompress( -+libaec_EXPORT int SZ_BufftoBuffDecompress( - void *dest, size_t *destLen, - const void *source, size_t sourceLen, - SZ_com_t *param); - --LIBAEC_DLL_EXPORTED int SZ_encoder_enabled(void); -+libaec_EXPORT int SZ_encoder_enabled(void); - - #endif /* SZLIB_H */ --- -2.24.1 - diff --git a/recipes/libaec/all/patches/1.0.4-0002-fix-install-ios.patch b/recipes/libaec/all/patches/1.0.4-0002-fix-install-ios.patch deleted file mode 100644 index 7d7d56d1f60b6..0000000000000 --- a/recipes/libaec/all/patches/1.0.4-0002-fix-install-ios.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -53,7 +53,6 @@ install(FILES libaec.h szlib.h ${PROJECT_BINARY_DIR}/libaec_Export.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT headers) - install(TARGETS aec_client -- RUNTIME - DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT applications) - diff --git a/recipes/libaec/all/patches/1.0.6-0001-fix-library-builds.patch b/recipes/libaec/all/patches/1.0.6-0001-fix-library-builds.patch deleted file mode 100644 index 500c20a889d8c..0000000000000 --- a/recipes/libaec/all/patches/1.0.6-0001-fix-library-builds.patch +++ /dev/null @@ -1,113 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6f75ead..c974cce 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -4,7 +4,7 @@ project(libaec LANGUAGES C VERSION 1.0.6) - # Automatically export symbols for Windows DLLs - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) - --set(CMAKE_C_STANDARD 99) -+set(CMAKE_C_STANDARD 11) - set(CMAKE_C_VISIBILITY_PRESET hidden) - set(CMAKE_POSITION_INDEPENDENT_CODE ON) - include(CTest) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index a26f9b7..3cd8f72 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -10,12 +10,17 @@ target_include_directories(aec - "$" - "$") - --# Create both static and shared aec library. -+if (NOT BUILD_SHARED_LIBS) -+ -+# Create aec library. - add_library(aec_static STATIC "$") - target_link_libraries(aec_static PUBLIC aec) - set_target_properties(aec_static - PROPERTIES -- OUTPUT_NAME $,aec_static,aec>) -+ OUTPUT_NAME $,aec_static,aec> -+ PUBLIC_HEADER ../include/libaec.h) -+ -+else() - - add_library(aec_shared SHARED "$") - target_link_libraries(aec_shared PUBLIC aec) -@@ -26,17 +31,24 @@ set_target_properties(aec_shared - OUTPUT_NAME aec - PUBLIC_HEADER ../include/libaec.h) - -+endif() -+ - # Wrapper for compatibility with szip - add_library(sz OBJECT sz_compat.c) - target_link_libraries(sz PUBLIC aec) - --# Create both static and shared szip library. -+# Create szip library. -+if (NOT BUILD_SHARED_LIBS) -+ - add_library(sz_static STATIC "$" "$") - set_target_properties(sz_static - PROPERTIES -- OUTPUT_NAME $,szip_static,sz>) -+ OUTPUT_NAME $,szip_static,sz> -+ PUBLIC_HEADER ../include/szlib.h) - target_link_libraries(sz_static PUBLIC sz) - -+else() -+ - add_library(sz_shared SHARED "$" "$") - target_link_libraries(sz_shared PUBLIC sz) - set_target_properties(sz_shared -@@ -46,11 +58,16 @@ set_target_properties(sz_shared - OUTPUT_NAME $,szip,sz> - PUBLIC_HEADER ../include/szlib.h) - -+endif() -+ - # Simple client for testing and benchmarking. - # Can also be used stand-alone - add_executable(aec_client aec.c) - set_target_properties(aec_client PROPERTIES OUTPUT_NAME aec) - target_link_libraries(aec_client PUBLIC aec) -+if (MSVC) -+ target_compile_options(aec_client PUBLIC /FS /Z7) -+endif() - - include(GNUInstallDirs) - if(UNIX) -@@ -61,23 +78,14 @@ if(UNIX) - PROPERTIES - COMPILE_DEFINITIONS - "HAVE_VISIBILITY=$;BUILDING_LIBAEC") -- -- # The shell scripts for benchmarking are supported on unix only -- add_executable(utime EXCLUDE_FROM_ALL utime.c) -- target_include_directories(utime PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/..") -- add_custom_target(bench -- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/benc.sh -- ${CMAKE_CURRENT_SOURCE_DIR}/../data/typical.rz -- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bdec.sh -- DEPENDS aec_client utime) - endif() - --if(UNIX OR MINGW) -- # Install manpage -- install( -- FILES aec.1 -- DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 -- COMPONENT doc) --endif() -+if (NOT BUILD_SHARED_LIBS) - --install(TARGETS aec_static aec_shared sz_static sz_shared aec_client) -+install(TARGETS aec_static sz_static aec_client) -+ -+else() -+ -+install(TARGETS aec_shared sz_shared aec_client) -+ -+endif() diff --git a/recipes/libaec/all/patches/1.0.6-0002-fix-cmake-build-with-ninja.patch b/recipes/libaec/all/patches/1.0.6-0002-fix-cmake-build-with-ninja.patch deleted file mode 100644 index b3782f6654ad3..0000000000000 --- a/recipes/libaec/all/patches/1.0.6-0002-fix-cmake-build-with-ninja.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt 2021-09-17 19:28:01.000000000 +0800 -+++ b/CMakeLists.txt 2022-11-04 07:43:58.413439439 +0800 -@@ -12,6 +12,8 @@ - include(TestBigEndian) - test_big_endian(WORDS_BIGENDIAN) - -+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) -+ - # Check for __builtin_clzll for faster decoding - include(CheckCSourceCompiles) - check_c_source_compiles( diff --git a/recipes/libaec/all/set_runtime_output_dir.cmake b/recipes/libaec/all/set_runtime_output_dir.cmake new file mode 100644 index 0000000000000..d154a1133b327 --- /dev/null +++ b/recipes/libaec/all/set_runtime_output_dir.cmake @@ -0,0 +1,2 @@ +# Ninja needs 'aec' binary to be put in a separate folder to an imaginary 'aec' object output +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) diff --git a/recipes/libaec/all/test_package/CMakeLists.txt b/recipes/libaec/all/test_package/CMakeLists.txt index f87e0b5ca8eb9..957285057e22b 100644 --- a/recipes/libaec/all/test_package/CMakeLists.txt +++ b/recipes/libaec/all/test_package/CMakeLists.txt @@ -1,7 +1,8 @@ -cmake_minimum_required(VERSION 3.1.3) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(libaec CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libaec::libaec) +target_link_libraries(${PROJECT_NAME} libaec::aec) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/libaec/all/test_package/conanfile.py b/recipes/libaec/all/test_package/conanfile.py index 75526b1d02b79..0c7c612cdc73e 100644 --- a/recipes/libaec/all/test_package/conanfile.py +++ b/recipes/libaec/all/test_package/conanfile.py @@ -1,8 +1,8 @@ +import os + from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.scm import Version -import os +from conan.tools.cmake import CMake, cmake_layout class TestPackageConan(ConanFile): @@ -16,12 +16,6 @@ def requirements(self): def layout(self): cmake_layout(self) - def generate(self): - tc = CMakeToolchain(self) - if Version(self.dependencies["libaec"].ref.version) >= "1.0.6": - tc.variables["CMAKE_C_STANDARD"] = "11" - tc.generate() - def build(self): cmake = CMake(self) cmake.configure() @@ -29,5 +23,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/libaec/all/test_v1_package/CMakeLists.txt b/recipes/libaec/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 454ad5fbc6eba..0000000000000 --- a/recipes/libaec/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1.3) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libaec CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} libaec::libaec) diff --git a/recipes/libaec/all/test_v1_package/conanfile.py b/recipes/libaec/all/test_v1_package/conanfile.py deleted file mode 100644 index b07f7e5f677ac..0000000000000 --- a/recipes/libaec/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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) - if tools.Version(self.deps_cpp_info["libaec"].version) >= "1.0.6": - cmake.definitions["CMAKE_C_STANDARD"] = "11" - 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/libaec/config.yml b/recipes/libaec/config.yml index a41a7cbb0ffc2..e52184bafc974 100644 --- a/recipes/libaec/config.yml +++ b/recipes/libaec/config.yml @@ -1,5 +1,5 @@ versions: - "1.0.6": + "1.1.2": folder: all - "1.0.4": + "1.0.6": folder: all diff --git a/recipes/libaio/all/test_package/CMakeLists.txt b/recipes/libaio/all/test_package/CMakeLists.txt index 4515d52910142..ed2f2dc4a9dc2 100644 --- a/recipes/libaio/all/test_package/CMakeLists.txt +++ b/recipes/libaio/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(libaio REQUIRED CONFIG) diff --git a/recipes/libaio/all/test_v1_package/CMakeLists.txt b/recipes/libaio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libaio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libaio/all/test_v1_package/conanfile.py b/recipes/libaio/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libaio/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libalsa/all/conandata.yml b/recipes/libalsa/all/conandata.yml index c612ddb389783..aa2c61fa39407 100644 --- a/recipes/libalsa/all/conandata.yml +++ b/recipes/libalsa/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.2.13": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.13.tar.gz" + sha256: "e296a2e8fa165855e2c8f263ff6bc0b0ea21a3bece4404135f3a181d1a03e63a" + "1.2.12": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.12.tar.gz" + sha256: "f067dbba9376e5bbbb417b77751d2a9f2f277c54fb3a2b5c023cc2c7dfb4e3c1" "1.2.10": url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.10.tar.gz" sha256: "f55749847fd98274501f4691a2d847e89280c07d40a43cdac43d6443f69fc939" diff --git a/recipes/libalsa/all/conanfile.py b/recipes/libalsa/all/conanfile.py index 8c3046d892f5a..eff1547ac38a9 100644 --- a/recipes/libalsa/all/conanfile.py +++ b/recipes/libalsa/all/conanfile.py @@ -12,12 +12,12 @@ class LibalsaConan(ConanFile): name = "libalsa" + description = "Library of ALSA: The Advanced Linux Sound Architecture, that provides audio " \ + "and MIDI functionality to the Linux operating system" license = "LGPL-2.1-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/alsa-project/alsa-lib" topics = ("alsa", "sound", "audio", "midi") - description = "Library of ALSA: The Advanced Linux Sound Architecture, that provides audio " \ - "and MIDI functionality to the Linux operating system" package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { diff --git a/recipes/libalsa/all/test_package/CMakeLists.txt b/recipes/libalsa/all/test_package/CMakeLists.txt index ab0ad880535ac..dffc50a59f331 100644 --- a/recipes/libalsa/all/test_package/CMakeLists.txt +++ b/recipes/libalsa/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(ALSA REQUIRED) diff --git a/recipes/libalsa/all/test_v1_package/CMakeLists.txt b/recipes/libalsa/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libalsa/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libalsa/all/test_v1_package/conanfile.py b/recipes/libalsa/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/libalsa/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/libalsa/config.yml b/recipes/libalsa/config.yml index ce651c2f0d63a..11dc7bc660309 100644 --- a/recipes/libalsa/config.yml +++ b/recipes/libalsa/config.yml @@ -1,4 +1,8 @@ versions: + "1.2.13": + folder: all + "1.2.12": + folder: all "1.2.10": folder: all "1.2.7.2": diff --git a/recipes/libaom-av1/all/conandata.yml b/recipes/libaom-av1/all/conandata.yml index bb3a5a205cc9f..a094fca193ea9 100644 --- a/recipes/libaom-av1/all/conandata.yml +++ b/recipes/libaom-av1/all/conandata.yml @@ -1,34 +1,25 @@ sources: + "3.8.0": + url: "https://storage.googleapis.com/aom-releases/libaom-3.8.0.tar.gz" + sha256: "a768d3e54c7f00cd38b01208d1ae52d671be410cfc387ff7881ea71c855f3600" "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" "3.5.0": url: "https://storage.googleapis.com/aom-releases/libaom-3.5.0.tar.gz" sha256: "d37dbee372e2430a7efde813984ae6d78bdf1fc4080ebe32457c9115408b0738" "3.4.0": url: "https://storage.googleapis.com/aom-releases/libaom-3.4.0.tar.gz" sha256: "bd754b58c3fa69f3ffd29da77de591bd9c26970e3b18537951336d6c0252e354" - "3.3.0": - url: "https://storage.googleapis.com/aom-releases/libaom-3.3.0.tar.gz" - sha256: "1dafde32bc2237bf0570294661ae61db30e818840f77dc4e90d1ebf5a6286664" - "3.1.2": - url: "https://storage.googleapis.com/aom-releases/libaom-3.1.2.tar.gz" - sha256: "a295eb3779657fad7d34217091ee4c6257d02580a82012231afef72792330075" - "3.1.1": - url: "https://storage.googleapis.com/aom-releases/libaom-3.1.1.tar.gz" - sha256: "7cd5e8e469268c37241df93fe61557ea0dc46980ca21b37e786e92a3d0729276" "2.0.1": 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" + "3.8.0": + - patch_file: "patches/0001-3.8.0-fix-install.patch" patch_type: conan patch_description: Install just aom library without aom_static. - "3.6.0": + "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. @@ -40,18 +31,6 @@ patches: - patch_file: "patches/0001-3.4.0-fix-install.patch" patch_type: conan patch_description: Install just aom library without aom_static. - "3.3.0": - - patch_file: "patches/0001-3.3.0-fix-install.patch" - patch_type: conan - patch_description: Install just aom library without aom_static. - "3.1.2": - - patch_file: "patches/0001-3.1.1-fix-install.patch" - patch_type: conan - patch_description: Install just aom library without aom_static. - "3.1.1": - - patch_file: "patches/0001-3.1.1-fix-install.patch" - patch_type: conan - patch_description: Install just aom library without aom_static. "2.0.1": - patch_file: "patches/0001-2.0.1-fix-install.patch" patch_type: conan diff --git a/recipes/libaom-av1/all/conanfile.py b/recipes/libaom-av1/all/conanfile.py index 714ea1c7238dd..26d670c71d8c3 100644 --- a/recipes/libaom-av1/all/conanfile.py +++ b/recipes/libaom-av1/all/conanfile.py @@ -52,7 +52,7 @@ def build_requirements(self): if self.options.get_safe("assembly", False): self.tool_requires("nasm/2.15.05") if self._settings_build.os == "Windows": - self.tool_requires("strawberryperl/5.30.0.1") + self.tool_requires("strawberryperl/5.32.1.1") def layout(self): cmake_layout(self, src_folder="src") @@ -94,6 +94,9 @@ def package(self): def package_info(self): self.cpp_info.set_property("pkg_config_name", "aom") - self.cpp_info.libs = ["aom"] + lib = "aom" + if Version(self.version) >= "3.8.0" and self.settings.os == "Windows" and self.options.shared: + lib = "aom_dll" + self.cpp_info.libs = [lib] if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/libaom-av1/all/patches/0001-3.1.1-fix-install.patch b/recipes/libaom-av1/all/patches/0001-3.1.1-fix-install.patch deleted file mode 100644 index af10132d05fe7..0000000000000 --- a/recipes/libaom-av1/all/patches/0001-3.1.1-fix-install.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/build/cmake/aom_install.cmake -+++ b/build/cmake/aom_install.cmake -@@ -26,7 +26,7 @@ endif() - # Note: aom.pc generation uses GNUInstallDirs: - # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html - macro(setup_aom_install_targets) -- if(NOT (MSVC OR XCODE)) -+ if(1) - include("GNUInstallDirs") - set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc") - -@@ -76,7 +76,8 @@ macro(setup_aom_install_targets) - endif() - - if(BUILD_SHARED_LIBS) -- set(AOM_INSTALL_LIBS aom aom_static) -+ set_target_properties(aom_static PROPERTIES OUTPUT_NAME aom_static) -+ set(AOM_INSTALL_LIBS aom) - else() - set(AOM_INSTALL_LIBS aom) - endif() -@@ -88,8 +89,10 @@ macro(setup_aom_install_targets) - install( - FILES "${AOM_PKG_CONFIG_FILE}" - DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig") -- install(TARGETS ${AOM_INSTALL_LIBS} DESTINATION -- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") -+ install(TARGETS ${AOM_INSTALL_LIBS} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - if(ENABLE_EXAMPLES) - install(TARGETS ${AOM_INSTALL_BINS} DESTINATION diff --git a/recipes/libaom-av1/all/patches/0001-3.3.0-fix-install.patch b/recipes/libaom-av1/all/patches/0001-3.3.0-fix-install.patch deleted file mode 100644 index 0dc76d16fc7f5..0000000000000 --- a/recipes/libaom-av1/all/patches/0001-3.3.0-fix-install.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/build/cmake/aom_install.cmake -+++ b/build/cmake/aom_install.cmake -@@ -27,7 +27,7 @@ endif() - # Note: aom.pc generation uses GNUInstallDirs: - # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html - macro(setup_aom_install_targets) -- if(NOT XCODE) -+ if(1) - include("GNUInstallDirs") - set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc") - -@@ -77,7 +77,8 @@ macro(setup_aom_install_targets) - endif() - - if(BUILD_SHARED_LIBS) -- set(AOM_INSTALL_LIBS aom aom_static) -+ set_target_properties(aom_static PROPERTIES OUTPUT_NAME aom_static) -+ set(AOM_INSTALL_LIBS aom) - else() - set(AOM_INSTALL_LIBS aom) - endif() diff --git a/recipes/libaom-av1/all/patches/0001-3.8.0-fix-install.patch b/recipes/libaom-av1/all/patches/0001-3.8.0-fix-install.patch new file mode 100644 index 0000000000000..1bb2cbdc3adb3 --- /dev/null +++ b/recipes/libaom-av1/all/patches/0001-3.8.0-fix-install.patch @@ -0,0 +1,21 @@ +--- build/cmake/aom_install.cmake ++++ build/cmake/aom_install.cmake +@@ -27,7 +27,7 @@ + # Note: aom.pc generation uses GNUInstallDirs: + # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html + macro(setup_aom_install_targets) +- if(NOT XCODE) ++ if(1) + include("GNUInstallDirs") + set(AOM_PKG_CONFIG_FILE "${AOM_CONFIG_DIR}/aom.pc") + +@@ -79,7 +79,8 @@ + endif() + + if(BUILD_SHARED_LIBS) +- set(AOM_INSTALL_LIBS aom aom_static) ++ set_target_properties(aom_static PROPERTIES OUTPUT_NAME aom_static) ++ set(AOM_INSTALL_LIBS aom) + else() + set(AOM_INSTALL_LIBS aom) + endif() diff --git a/recipes/libaom-av1/all/test_package/CMakeLists.txt b/recipes/libaom-av1/all/test_package/CMakeLists.txt index f5305ced8fb6c..3a349707da715 100644 --- a/recipes/libaom-av1/all/test_package/CMakeLists.txt +++ b/recipes/libaom-av1/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(libaom-av1 REQUIRED CONFIG) diff --git a/recipes/libaom-av1/all/test_v1_package/CMakeLists.txt b/recipes/libaom-av1/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libaom-av1/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libaom-av1/all/test_v1_package/conanfile.py b/recipes/libaom-av1/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libaom-av1/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_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/libaom-av1/config.yml b/recipes/libaom-av1/config.yml index 2ac5e2242b2d4..45dfabb3e4ed1 100644 --- a/recipes/libaom-av1/config.yml +++ b/recipes/libaom-av1/config.yml @@ -1,17 +1,11 @@ versions: - "3.6.1": + "3.8.0": folder: all - "3.6.0": + "3.6.1": folder: all "3.5.0": folder: all "3.4.0": folder: all - "3.3.0": - folder: all - "3.1.2": - folder: all - "3.1.1": - folder: all "2.0.1": folder: all diff --git a/recipes/libarchive/all/conandata.yml b/recipes/libarchive/all/conandata.yml index b08c943036aa4..5d5a06587d500 100644 --- a/recipes/libarchive/all/conandata.yml +++ b/recipes/libarchive/all/conandata.yml @@ -1,123 +1,80 @@ sources: + "3.7.9": + url: "https://github.com/libarchive/libarchive/releases/download/v3.7.9/libarchive-3.7.9.tar.xz" + sha256: "ed8b5732e4cd6e30fae909fb945cad8ff9cb7be5c6cdaa3944ec96e4a200c04c" + "3.7.7": + url: "https://github.com/libarchive/libarchive/releases/download/v3.7.7/libarchive-3.7.7.tar.xz" + sha256: "879acd83c3399c7caaee73fe5f7418e06087ab2aaf40af3e99b9e29beb29faee" + "3.7.6": + url: "https://github.com/libarchive/libarchive/releases/download/v3.7.6/libarchive-3.7.6.tar.xz" + sha256: "0a2efdcb185da2eb1e7cd8421434cb9a6119f72417a13335cca378d476fd3ba0" + "3.7.4": + url: "https://github.com/libarchive/libarchive/releases/download/v3.7.4/libarchive-3.7.4.tar.xz" + sha256: "f887755c434a736a609cbd28d87ddbfbe9d6a3bb5b703c22c02f6af80a802735" + "3.7.3": + url: "https://github.com/libarchive/libarchive/releases/download/v3.7.3/libarchive-3.7.3.tar.xz" + sha256: "63e7a7174638fc7d6b79b4c8b0ad954e0f4f45abe7239c1ecb200232aa9a43d2" "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" - "3.6.1": - url: "https://github.com/libarchive/libarchive/releases/download/v3.6.1/libarchive-3.6.1.tar.xz" - sha256: "5a411aceb978f43e626f0c2d1812ddd8807b645ed892453acabd532376c148e6" - "3.6.0": - url: "https://github.com/libarchive/libarchive/releases/download/v3.6.0/libarchive-3.6.0.tar.xz" - sha256: "df283917799cb88659a5b33c0a598f04352d61936abcd8a48fe7b64e74950de7" - "3.5.2": - url: "https://github.com/libarchive/libarchive/releases/download/v3.5.2/libarchive-3.5.2.tar.xz" - sha256: "f0b19ff39c3c9a5898a219497ababbadab99d8178acc980155c7e1271089b5a0" - "3.5.1": - url: "https://github.com/libarchive/libarchive/releases/download/v3.5.1/libarchive-3.5.1.tar.xz" - sha256: "0e17d3a8d0b206018693b27f08029b598f6ef03600c2b5d10c94ce58692e299b" - "3.4.3": - url: "https://github.com/libarchive/libarchive/releases/download/v3.4.3/libarchive-3.4.3.tar.xz" - sha256: "0bfc3fd40491768a88af8d9b86bf04a9e95b6d41a94f9292dbc0ec342288c05f" - "3.4.0": - 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" + "3.7.9": + - patch_file: "patches/0003-3.7.9-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_file: "patches/0005-3.7.9-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_file: "patches/0006-3.7.9-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" + "3.7.7": + - patch_file: "patches/0003-3.7.7-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_file: "patches/0005-3.7.7-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_file: "patches/0006-3.7.7-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" - patch_type: "portability" - - patch_file: "patches/0003-3.6.2-cmake.patch" + "3.7.6": + - patch_file: "patches/0003-3.7.6-cmake.patch" patch_description: "Make CMake build-system compatible with Conan" patch_type: "conan" - - patch_file: "patches/0005-3.6.2-try-compile-cmakedeps.patch" + - patch_file: "patches/0005-3.7.6-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_file: "patches/0006-3.7.6-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" - patch_type: "portability" - - patch_file: "patches/0003-3.6.0-cmake.patch" + "3.7.4": + - patch_file: "patches/0003-3.7.4-cmake.patch" patch_description: "Make CMake build-system compatible with Conan" patch_type: "conan" - - patch_file: "patches/0004-3.6.0-android.patch" - patch_description: "Add missing include directory for Android" - patch_type: "portability" - "3.6.0": - - patch_file: "patches/0001-3.6.0-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0003-3.6.0-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" - - patch_file: "patches/0004-3.6.0-android.patch" - patch_description: "Add missing include directory for Android" - patch_type: "portability" - "3.5.2": - - 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.5.2-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" - "3.5.1": - - 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.5.1-cmake.patch" - patch_description: "Make CMake cooperate with Conan" - patch_type: "conan" - "3.4.3": - - 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_description: "Make CMake cooperate with Conan" - patch_type: "conan" - "3.4.0": - - patch_file: "patches/0001-3.4.0-zlib-winapi.patch" - patch_description: "Remove broken ZLIB WINAPI check" - patch_type: "portability" - - patch_file: "patches/0002-3.4.0-msvc-no-we4061.patch" - patch_description: "Remove MSVC compiler warning e4061" - patch_type: "portability" - - patch_file: "patches/0003-3.4.0-cmake.patch" - patch_description: "Make CMake cooperate with Conan" + - patch_file: "patches/0005-3.7.4-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.4-fix-msvc-build.patch" + patch_description: "Fix MSVC build" + patch_type: "conan" + "3.7.3": + - patch_file: "patches/0003-3.7.3-cmake.patch" + patch_description: "Make CMake build-system compatible with Conan" + patch_type: "conan" + - patch_file: "patches/0005-3.7.3-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.3-fix-msvc-build.patch" + patch_description: "Fix MSVC build" + patch_type: "conan" + "3.7.2": + - patch_file: "patches/0003-3.7.2-cmake.patch" + patch_description: "Make CMake build-system compatible with Conan" + patch_type: "conan" + - patch_file: "patches/0005-3.7.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.7.2-fix-msvc-build.patch" + patch_description: "Fix MSVC build" patch_type: "conan" diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 41ace49a160e2..0a9e76ba8b3f4 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -12,10 +12,10 @@ class LibarchiveConan(ConanFile): name = "libarchive" description = "Multi-format archive and compression library" - topics = "archive", "compression", "tar", "data-compressor", "file-compression" + license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://libarchive.org" - license = "BSD-2-Clause" + topics = ("archive", "compression", "tar", "data-compressor", "file-compression") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -38,6 +38,7 @@ class LibarchiveConan(ConanFile): "with_zstd": [True, False], "with_mbedtls": [True, False], "with_xattr": [True, False], + "with_pcre2": [True, False], } default_options = { "shared": False, @@ -59,6 +60,7 @@ class LibarchiveConan(ConanFile): "with_zstd": False, "with_mbedtls": False, "with_xattr": False, + "with_pcre2": False, } def export_sources(self): @@ -67,8 +69,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if Version(self.version) < "3.4.2": - del self.options.with_mbedtls + if Version(self.version) < "3.7.3": + del self.options.with_pcre2 def configure(self): if self.options.shared: @@ -85,15 +87,15 @@ def requirements(self): if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_libxml2: - self.requires("libxml2/2.12.2") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.with_expat: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if self.options.with_iconv: self.requires("libiconv/1.17") if self.options.with_pcreposix: - self.requires("pcre2/10.42") + self.requires("pcre/8.45") 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 +105,17 @@ def requirements(self): if self.options.with_lzo: self.requires("lzo/2.10") if self.options.with_lzma: - self.requires("xz_utils/5.4.5") + self.requires("xz_utils/[>=5.4.5 <6]") if self.options.with_zstd: - self.requires("zstd/1.5.5") + self.requires("zstd/[>=1.5 <1.6]") if self.options.get_safe("with_mbedtls"): - self.requires("mbedtls/3.5.0") + self.requires("mbedtls/3.6.1") + if self.options.get_safe("with_pcre2"): + self.requires("pcre2/10.43") + + def build_requirements(self): + if Version(self.version) >= "3.7.9": + self.tool_requires("cmake/[>=3.17 <4]") def validate(self): if self.settings.os != "Windows" and self.options.with_cng: @@ -152,8 +160,9 @@ def generate(self): 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_MBEDTLS"] = self.options.with_mbedtls + if Version(self.version) >= "3.7.3": + tc.variables["ENABLE_PCRE2POSIX"] = self.options.with_pcre2 tc.variables["ENABLE_XATTR"] = self.options.with_xattr # TODO: Remove after fixing https://github.com/conan-io/conan/issues/12012 if is_msvc(self): diff --git a/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch deleted file mode 100644 index 5acce6e86c2cd..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.4.0-zlib-winapi.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4fd93d04..922efd15 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -415,14 +415,7 @@ 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.4.3-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch deleted file mode 100644 index b0d70de9dec3b..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.4.3-zlib-winapi.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6b00410c..e0359b51 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -420,14 +420,7 @@ 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.6.0-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch deleted file mode 100644 index dceed2848f701..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.6.0-zlib-winapi.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7a0d300a..646e5ce7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -426,14 +426,7 @@ 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.6.2-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch deleted file mode 100644 index 9e88323972df9..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.6.2-zlib-winapi.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 713e3bc..2315da5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -430,14 +430,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.1-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.7.1-zlib-winapi.patch deleted file mode 100644 index beb5f743fa31f..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.7.1-zlib-winapi.patch +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 9c5a48b11c9e1..0000000000000 --- a/recipes/libarchive/all/patches/0001-3.7.2-zlib-winapi.patch +++ /dev/null @@ -1,35 +0,0 @@ -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/0002-3.4.0-msvc-no-we4061.patch b/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch deleted file mode 100644 index ff6f218ef3e36..0000000000000 --- a/recipes/libarchive/all/patches/0002-3.4.0-msvc-no-we4061.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 922efd15..4ffd0930 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -157,7 +157,6 @@ IF (MSVC) - # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" - # Enable level 4 C4061: The enumerate has no associated handler in a switch - # statement. -- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") - # Enable level 4 C4254: A larger bit field was assigned to a smaller bit - # field. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") diff --git a/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch b/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch deleted file mode 100644 index 7b34085f1a3a2..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.4.0-cmake.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4ffd0930..01e8592c 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() -@@ -412,7 +412,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) -@@ -474,7 +474,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}) -@@ -491,7 +491,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) - - # -@@ -561,7 +561,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) -@@ -757,7 +757,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) -@@ -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 -+++ b/libarchive/CMakeLists.txt -@@ -235,11 +235,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}) -@@ -249,13 +253,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.4.3-cmake.patch b/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch deleted file mode 100644 index 45a9561474f8e..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.4.3-cmake.patch +++ /dev/null @@ -1,150 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6013d9e6..125b1cb3 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) -@@ -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 -+++ 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.1-cmake.patch b/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch deleted file mode 100644 index 181a183093fc3..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.5.1-cmake.patch +++ /dev/null @@ -1,142 +0,0 @@ -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 deleted file mode 100644 index 46955b7f8f7ce..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.5.2-cmake.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e0359b51..3927a742 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) -@@ -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 -+++ b/libarchive/CMakeLists.txt -@@ -238,11 +238,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}) -@@ -252,13 +256,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.6.0-cmake.patch b/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch deleted file mode 100644 index 3c89010df2aba..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.6.0-cmake.patch +++ /dev/null @@ -1,153 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 646e5ce7..9bca273f 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() -@@ -424,7 +424,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) -@@ -486,7 +486,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}) -@@ -503,7 +503,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) - - # -@@ -573,7 +573,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) -@@ -790,7 +790,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) -@@ -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 -+++ b/libarchive/CMakeLists.txt -@@ -5,6 +5,10 @@ - # - ############################################ - -+if (ANDROID) -+ include_directories(${PROJECT_SOURCE_DIR}/contrib/android/include) -+endif() -+ - # Public headers - SET(include_HEADERS - archive.h -@@ -238,11 +242,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}) -@@ -252,13 +260,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.6.2-cmake.patch b/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch deleted file mode 100644 index aca2961950d2d..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.6.2-cmake.patch +++ /dev/null @@ -1,98 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a4a9284a..f5dbccac 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() -@@ -428,7 +428,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) - - -@@ -497,7 +497,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}) -@@ -514,7 +514,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) - - # -@@ -584,7 +584,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) -@@ -806,7 +806,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 ff7ade00..8c867130 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -242,13 +242,13 @@ ELSEIF(ARCHIVE_ACL_SUNOS) - LIST(APPEND libarchive_SOURCES archive_disk_acl_sunos.c) - 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}) - --# archive_static is a static library -+else() - ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) - TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) - 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 -- 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) -+ 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.7.1-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.1-cmake.patch deleted file mode 100644 index 67a75a07b08b2..0000000000000 --- a/recipes/libarchive/all/patches/0003-3.7.1-cmake.patch +++ /dev/null @@ -1,91 +0,0 @@ -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/0003-3.7.2-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.2-cmake.patch new file mode 100644 index 0000000000000..ffd8ff242c656 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.7.2-cmake.patch @@ -0,0 +1,83 @@ +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() + +@@ -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/0003-3.7.3-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.3-cmake.patch new file mode 100644 index 0000000000000..a4c5151bebe08 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.7.3-cmake.patch @@ -0,0 +1,92 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44ca23d..40439ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,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() +@@ -449,7 +449,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) + # + # Test if ZLIB_WINAPI macro is needed to use. +@@ -518,7 +518,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}) +@@ -539,7 +539,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) + + # +@@ -610,7 +610,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) +@@ -834,7 +834,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 b79091c..bd9e980 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_INCLUDE_DIRECTORIES(archive_static PUBLIC .) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +@@ -260,7 +261,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 + IF(BUILD_SHARED_LIBS) +@@ -269,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/0003-3.7.4-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.4-cmake.patch new file mode 100644 index 0000000000000..1cd38344e5586 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.7.4-cmake.patch @@ -0,0 +1,83 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7e87e07..2c9a5f8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,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() +@@ -451,7 +451,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) + # + # Test if ZLIB_WINAPI macro is needed to use. +@@ -541,7 +541,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) + + # +@@ -612,7 +612,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) +@@ -836,7 +836,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 b79091c..bd9e980 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_INCLUDE_DIRECTORIES(archive_static PUBLIC .) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +@@ -260,7 +261,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 + IF(BUILD_SHARED_LIBS) +@@ -269,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/0003-3.7.6-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.6-cmake.patch new file mode 100644 index 0000000000000..98e97aac6cf07 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.7.6-cmake.patch @@ -0,0 +1,84 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 582258c..b59a7e2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,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() +@@ -469,7 +469,7 @@ ENDIF() + 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) + # +@@ -560,7 +560,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) + + # +@@ -631,7 +631,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) +@@ -854,7 +854,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 dd0b280..2a31de6 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -255,6 +255,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_INCLUDE_DIRECTORIES(archive_static PUBLIC .) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +@@ -264,7 +265,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 + IF(BUILD_SHARED_LIBS) +@@ -272,11 +273,12 @@ IF(ENABLE_INSTALL) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- ENDIF(BUILD_SHARED_LIBS) ++ 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.7.7-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.7-cmake.patch new file mode 100644 index 0000000000000..5fe0d10f13f1d --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.7.7-cmake.patch @@ -0,0 +1,92 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bfe68ac..85e6de9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,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() +@@ -470,7 +470,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) + # + # Test if ZLIB_WINAPI macro is needed to use. +@@ -560,7 +560,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) + + # +@@ -631,7 +631,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) +@@ -854,7 +854,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 dd0b280..c8c9988 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -247,7 +247,7 @@ 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 ++ SET_TARGET_PROPERTIES(archive PROPERTIES + VERSION ${SOVERSION_FULL} + SOVERSION ${SOVERSION} + MACHO_COMPATIBILITY_VERSION ${MACHO_COMPATIBILITY_VERSION} +@@ -255,6 +255,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_INCLUDE_DIRECTORIES(archive_static PUBLIC .) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +@@ -264,6 +265,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 +@@ -272,11 +274,12 @@ IF(ENABLE_INSTALL) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- ENDIF(BUILD_SHARED_LIBS) ++ 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.7.9-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.9-cmake.patch new file mode 100644 index 0000000000000..331985063fd26 --- /dev/null +++ b/recipes/libarchive/all/patches/0003-3.7.9-cmake.patch @@ -0,0 +1,92 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c2f7100..42e4ac1b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.17 FATAL_ERROR) + + 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() +@@ -445,7 +445,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) + # + # Test if ZLIB_WINAPI macro is needed to use. +@@ -535,7 +535,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) + + # +@@ -606,7 +606,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) +@@ -829,7 +829,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 dd0b2808..c8c9988b 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -247,7 +247,7 @@ 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 ++ SET_TARGET_PROPERTIES(archive PROPERTIES + VERSION ${SOVERSION_FULL} + SOVERSION ${SOVERSION} + MACHO_COMPATIBILITY_VERSION ${MACHO_COMPATIBILITY_VERSION} +@@ -255,6 +255,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_INCLUDE_DIRECTORIES(archive_static PUBLIC .) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +@@ -264,6 +265,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 +@@ -272,11 +274,12 @@ IF(ENABLE_INSTALL) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- ENDIF(BUILD_SHARED_LIBS) ++ 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/0004-3.6.0-android.patch b/recipes/libarchive/all/patches/0004-3.6.0-android.patch deleted file mode 100644 index c4c91d3ecb18a..0000000000000 --- a/recipes/libarchive/all/patches/0004-3.6.0-android.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt -index 792b26b3..713c6496 100644 ---- a/libarchive/CMakeLists.txt -+++ b/libarchive/CMakeLists.txt -@@ -5,6 +5,10 @@ - # - ############################################ - -+if (ANDROID) -+ include_directories(${PROJECT_SOURCE_DIR}/contrib/android/include) -+endif() -+ - # Public headers - SET(include_HEADERS - archive.h 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 deleted file mode 100644 index 69e42f1f5678b..0000000000000 --- a/recipes/libarchive/all/patches/0005-3.6.2-try-compile-cmakedeps.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f5dbccac..ea7ff16a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -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}) -+ include(CMakePushCheckState) -+ cmake_push_check_state() - IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) - STRING(TOLOWER "${ALGORITHM}" lower_algorithm) - STRING(TOUPPER "${ALGORITHM}" algorithm) -@@ -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}) - ELSEIF("${IMPLEMENTATION}" MATCHES "^MBEDTLS$" AND MBEDTLS_FOUND) - SET(TRY_CRYPTO_REQUIRED_INCLUDES - "${TRY_CRYPTO_REQUIRED_INCLUDES};${MBEDTLS_INCLUDE_DIRS}") -@@ -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}) -+ cmake_pop_check_state() - ENDFOREACH(ALGORITHM ${ALGORITHMS}) - ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) - 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 deleted file mode 100644 index c71291d02944a..0000000000000 --- a/recipes/libarchive/all/patches/0005-3.7.1-try-compile-cmakedeps.patch +++ /dev/null @@ -1,32 +0,0 @@ -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/0005-3.7.2-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.2-try-compile-cmakedeps.patch new file mode 100644 index 0000000000000..53603bc1f64f9 --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.2-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 +@@ -855,14 +855,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) +@@ -882,8 +882,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/0005-3.7.3-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.3-try-compile-cmakedeps.patch new file mode 100644 index 0000000000000..a55e8c8709b68 --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.3-try-compile-cmakedeps.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 40439ca..6845238 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -867,8 +867,10 @@ ENDIF(NOT OPENSSL_FOUND) + # 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) +@@ -901,8 +903,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) +- SET(TRY_CRYPTO_REQUIRED_LIBS +- "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in diff --git a/recipes/libarchive/all/patches/0005-3.7.4-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.4-try-compile-cmakedeps.patch new file mode 100644 index 0000000000000..a6c90a0205df0 --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.4-try-compile-cmakedeps.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c9a5f8..91d0f49 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -869,8 +869,10 @@ ENDIF(NOT OPENSSL_FOUND) + # 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) +@@ -903,8 +905,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) +- SET(TRY_CRYPTO_REQUIRED_LIBS +- "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in diff --git a/recipes/libarchive/all/patches/0005-3.7.6-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.6-try-compile-cmakedeps.patch new file mode 100644 index 0000000000000..7485f8082d921 --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.6-try-compile-cmakedeps.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b59a7e2..dfa6af0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -887,8 +887,10 @@ ENDIF(NOT OPENSSL_FOUND) + # 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) +@@ -921,8 +923,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) +- SET(TRY_CRYPTO_REQUIRED_LIBS +- "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in diff --git a/recipes/libarchive/all/patches/0005-3.7.7-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.7-try-compile-cmakedeps.patch new file mode 100644 index 0000000000000..8420af0340268 --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.7-try-compile-cmakedeps.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bfe68ac..4bbf8fd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -895,8 +895,10 @@ ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku") + # 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) +@@ -929,8 +931,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) +- SET(TRY_CRYPTO_REQUIRED_LIBS +- "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in diff --git a/recipes/libarchive/all/patches/0005-3.7.9-try-compile-cmakedeps.patch b/recipes/libarchive/all/patches/0005-3.7.9-try-compile-cmakedeps.patch new file mode 100644 index 0000000000000..0d6acb4b0a93c --- /dev/null +++ b/recipes/libarchive/all/patches/0005-3.7.9-try-compile-cmakedeps.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c2f7100..b2ec9ed3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -870,8 +870,10 @@ ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku") + # 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) +@@ -904,8 +906,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) +- SET(TRY_CRYPTO_REQUIRED_LIBS +- "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") ++ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in 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 deleted file mode 100644 index c0903cf80cf94..0000000000000 --- a/recipes/libarchive/all/patches/0006-3.6.2-fix-msvc-build.patch +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100644 index 04ec53a2e20ba..0000000000000 --- a/recipes/libarchive/all/patches/0006-3.7.1-fix-msvc-build.patch +++ /dev/null @@ -1,45 +0,0 @@ -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/0006-3.7.2-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.2-fix-msvc-build.patch new file mode 100644 index 0000000000000..4a669d0956310 --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.7.2-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 +@@ -1402,7 +1402,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) +@@ -1435,11 +1435,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) +@@ -1452,10 +1452,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/0006-3.7.3-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.3-fix-msvc-build.patch new file mode 100644 index 0000000000000..d25d36378b560 --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.7.3-fix-msvc-build.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6845238..489936a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1471,7 +1471,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) +@@ -1504,11 +1504,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) +@@ -1521,10 +1521,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/0006-3.7.4-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.4-fix-msvc-build.patch new file mode 100644 index 0000000000000..754faa44c171c --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.7.4-fix-msvc-build.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 91d0f49..4041b9b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1473,7 +1473,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) +@@ -1507,11 +1507,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) +@@ -1524,10 +1524,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/0006-3.7.6-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.6-fix-msvc-build.patch new file mode 100644 index 0000000000000..9652721d7fe5e --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.7.6-fix-msvc-build.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dfa6af0..b2cac97 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1491,7 +1491,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) +@@ -1525,11 +1525,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) +@@ -1542,10 +1542,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/0006-3.7.7-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.7-fix-msvc-build.patch new file mode 100644 index 0000000000000..c2c45fd90b796 --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.7.7-fix-msvc-build.patch @@ -0,0 +1,54 @@ +@@ -24,7 +24,7 @@ index 85e6de9..bf1e4b2 100644 + +SET(HAVE_WCSCMP 1) + +SET(HAVE_WCSCPY 1) + +SET(HAVE_WCSLEN 1) +-+SET(HAVE_WCTOMB 1) +++SET(HAVE_WCTOMB 1)q + 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) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a5de613..259d53c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1499,7 +1499,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) +@@ -1533,11 +1533,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) +@@ -1550,10 +1550,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/0006-3.7.9-fix-msvc-build.patch b/recipes/libarchive/all/patches/0006-3.7.9-fix-msvc-build.patch new file mode 100644 index 0000000000000..afb6f87951fb5 --- /dev/null +++ b/recipes/libarchive/all/patches/0006-3.7.9-fix-msvc-build.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 683b2d75..190c1bf2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1474,7 +1474,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) +@@ -1510,11 +1510,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_symbol_exists(wcscmp wchar.h HAVE_WCSCMP) +-check_symbol_exists(wcscpy wchar.h HAVE_WCSCPY) +-check_symbol_exists(wcslen wchar.h 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) +@@ -1527,10 +1527,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 deleted file mode 100644 index 6db790a6cd811..0000000000000 --- a/recipes/libarchive/all/patches/0007-3.7.1-include-getopt.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- 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/all/test_package/CMakeLists.txt b/recipes/libarchive/all/test_package/CMakeLists.txt index 925a2be0857c5..88158eb4e77ae 100644 --- a/recipes/libarchive/all/test_package/CMakeLists.txt +++ b/recipes/libarchive/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(LibArchive REQUIRED) diff --git a/recipes/libarchive/config.yml b/recipes/libarchive/config.yml index 0331875919146..de1f580093971 100644 --- a/recipes/libarchive/config.yml +++ b/recipes/libarchive/config.yml @@ -1,19 +1,13 @@ versions: - "3.7.2": - folder: all - "3.7.1": - folder: all - "3.6.2": + "3.7.9": folder: all - "3.6.1": + "3.7.7": folder: all - "3.6.0": + "3.7.6": folder: all - "3.5.2": + "3.7.4": folder: all - "3.5.1": + "3.7.3": folder: all - "3.4.3": - folder: all - "3.4.0": + "3.7.2": folder: all diff --git a/recipes/libassert/all/conanfile.py b/recipes/libassert/all/conanfile.py deleted file mode 100644 index c596be696aeb2..0000000000000 --- a/recipes/libassert/all/conanfile.py +++ /dev/null @@ -1,145 +0,0 @@ -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, 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): - name = "libassert" - description = "The most over-engineered and overpowered C++ assertion library." - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/jeremy-rifkin/libassert" - package_type = "library" - - topics = ("assert", "library", "assertions", "stacktrace") - 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": "9" - } - - 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 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") - - 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 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("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) - - 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 = ["assert"] - - 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 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/test_package/CMakeLists.txt b/recipes/libassert/all/test_package/CMakeLists.txt deleted file mode 100644 index 97d2bfbc982a3..0000000000000 --- a/recipes/libassert/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) - -find_package(assert 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 assert::assert) -# In case the target project need a specific C++ standard -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libassert/all/test_v1_package/CMakeLists.txt b/recipes/libassert/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libassert/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libassert/all/test_v1_package/conanfile.py b/recipes/libassert/all/test_v1_package/conanfile.py deleted file mode 100644 index 7e264aad8e8ec..0000000000000 --- a/recipes/libassert/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/libassert/config.yml b/recipes/libassert/config.yml index 8ade508384535..69f9d078121ba 100644 --- a/recipes/libassert/config.yml +++ b/recipes/libassert/config.yml @@ -1,10 +1,23 @@ versions: - # Newer versions at the top + "2.1.4": + folder: v2 + "2.1.2": + folder: v2 + "2.1.1": + folder: v2 + "2.1.0": + folder: v2 + "2.0.2": + folder: v2 + "2.0.1": + folder: v2 + "2.0.0": + folder: v2 "1.2.2": - folder: all + folder: v1 "1.2.1": - folder: all + folder: v1 "1.1": - folder: all + folder: v1 "1.0": - folder: all + folder: v1 diff --git a/recipes/libassert/all/conandata.yml b/recipes/libassert/v1/conandata.yml similarity index 100% rename from recipes/libassert/all/conandata.yml rename to recipes/libassert/v1/conandata.yml diff --git a/recipes/libassert/v1/conanfile.py b/recipes/libassert/v1/conanfile.py new file mode 100644 index 0000000000000..8ccc475577fbc --- /dev/null +++ b/recipes/libassert/v1/conanfile.py @@ -0,0 +1,148 @@ +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.apple import is_apple_os +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, 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): + name = "libassert" + description = "The most over-engineered and overpowered C++ assertion library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jeremy-rifkin/libassert" + package_type = "library" + + topics = ("assert", "library", "assertions", "stacktrace") + 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": "9" + } + + 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 Version(self.version) >= "1.2.2": + self.requires("cpptrace/0.3.1") + elif Version(self.version) >= "1.2.1": + self.requires("cpptrace/0.2.1") + + def validate(self): + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.ref} is not supported on Mac. Please, update to version >=2.0.0") + + 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 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 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) + + 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 = ["assert"] + + 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 in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if Version(self.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.0/0001-add-cstring-include.patch b/recipes/libassert/v1/patches/1.0/0001-add-cstring-include.patch similarity index 100% rename from recipes/libassert/all/patches/1.0/0001-add-cstring-include.patch rename to recipes/libassert/v1/patches/1.0/0001-add-cstring-include.patch diff --git a/recipes/libassert/all/patches/1.0/0002-cmake-backport.patch b/recipes/libassert/v1/patches/1.0/0002-cmake-backport.patch similarity index 100% rename from recipes/libassert/all/patches/1.0/0002-cmake-backport.patch rename to recipes/libassert/v1/patches/1.0/0002-cmake-backport.patch diff --git a/recipes/libassert/all/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch b/recipes/libassert/v1/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch similarity index 100% rename from recipes/libassert/all/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch rename to recipes/libassert/v1/patches/1.0/0003-fix-max_line_number_width-miscalculation.patch diff --git a/recipes/libassert/all/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch b/recipes/libassert/v1/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch similarity index 100% rename from recipes/libassert/all/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch rename to recipes/libassert/v1/patches/1.1/0001-fix-max_line_number_width-miscalculation.patch diff --git a/recipes/libassert/all/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch b/recipes/libassert/v1/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch similarity index 100% rename from recipes/libassert/all/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch rename to recipes/libassert/v1/patches/1.1/0002-binary_diagnostics_descriptor-noexcept.patch diff --git a/recipes/libassert/all/patches/1.1/0003-cmake-windows.patch b/recipes/libassert/v1/patches/1.1/0003-cmake-windows.patch similarity index 100% rename from recipes/libassert/all/patches/1.1/0003-cmake-windows.patch rename to recipes/libassert/v1/patches/1.1/0003-cmake-windows.patch diff --git a/recipes/libassert/all/patches/1.2.1/0001-cpptrace-dll-copy.patch b/recipes/libassert/v1/patches/1.2.1/0001-cpptrace-dll-copy.patch similarity index 100% rename from recipes/libassert/all/patches/1.2.1/0001-cpptrace-dll-copy.patch rename to recipes/libassert/v1/patches/1.2.1/0001-cpptrace-dll-copy.patch diff --git a/recipes/libassert/all/patches/1.2.2/0001-cpptrace-dll-copy.patch b/recipes/libassert/v1/patches/1.2.2/0001-cpptrace-dll-copy.patch similarity index 100% rename from recipes/libassert/all/patches/1.2.2/0001-cpptrace-dll-copy.patch rename to recipes/libassert/v1/patches/1.2.2/0001-cpptrace-dll-copy.patch diff --git a/recipes/libassert/v1/test_package/CMakeLists.txt b/recipes/libassert/v1/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7e6204817489c --- /dev/null +++ b/recipes/libassert/v1/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + + +add_executable(${PROJECT_NAME} test_package.cpp) + +find_package(assert REQUIRED CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE assert::assert) + + +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libassert/v1/test_package/conanfile.py b/recipes/libassert/v1/test_package/conanfile.py new file mode 100644 index 0000000000000..a804618d0f86f --- /dev/null +++ b/recipes/libassert/v1/test_package/conanfile.py @@ -0,0 +1,30 @@ +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) + 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") + self.run(bin_path, env="conanrun") diff --git a/recipes/libassert/all/test_package/test_package.cpp b/recipes/libassert/v1/test_package/test_package.cpp similarity index 100% rename from recipes/libassert/all/test_package/test_package.cpp rename to recipes/libassert/v1/test_package/test_package.cpp diff --git a/recipes/libassert/v2/conandata.yml b/recipes/libassert/v2/conandata.yml new file mode 100644 index 0000000000000..875d0d2430d60 --- /dev/null +++ b/recipes/libassert/v2/conandata.yml @@ -0,0 +1,38 @@ +sources: + "2.1.4": + url: "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.1.4.tar.gz" + sha256: "9fa5f5b69e24d020a72b706f05802bf0028587b93a43b59bc99b5bef305b0c72" + "2.1.2": + url: "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.1.2.tar.gz" + sha256: "a7220ca354270deca08a7a162b93523c738ba3c8037a4df1a46ababfdc664196" + "2.1.1": + url: "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.1.1.tar.gz" + sha256: "2bdf27523f964f41668d266cfdbd7f5f58988af963d976577195969ed44359d1" + "2.1.0": + url: "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.1.0.tar.gz" + sha256: "e42405b49cde017c44c78aacac35c6e03564532838709031e73d10ab71f5363d" + "2.0.2": + url: "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.0.2.tar.gz" + sha256: "4a0b52e6523bdde0116231a67583131ea1a84bb574076fad939fc13fc7490443" + "2.0.1": + url: "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.0.1.tar.gz" + sha256: "405a44c14c5e40de5b81b01538ba12ef9d7c1f57e2c29f81b929e7e179847d4c" + "2.0.0": + url: "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v2.0.0.tar.gz" + sha256: "d4b2da2179a94637b34d18813a814531a1eceb0ddc6dd6db6098050dd638f4a1" +patches: + "2.1.0": + - patch_file: "patches/2.1.0/0001-msvc-ice.patch" + patch_type: "portability" + patch_source: https://github.com/jeremy-rifkin/libassert/commit/aff047da702316b10219a967f78da352f847b8d0 + patch_description: "Handle an ICE in old MSVC" + "2.0.1": + - patch_file: "patches/2.0.1/0001-fix-string_view-detection.patch" + patch_type: "portability" + patch_source: https://github.com/jeremy-rifkin/libassert/commit/1825976ebc7ccb34687d75aaaaf2a961dafc5450 + patch_description: "Update #if checks for string_view support" + "2.0.0": + - patch_file: "patches/2.0.0/0001-fix-export-and-include.patch" + patch_type: "bugfix" + patch_source: https://github.com/jeremy-rifkin/libassert/commit/25c1f3e43737ab18490a0d9430cb1c70f976a662 + patch_description: "Fix export header and an incorrect #include" diff --git a/recipes/libassert/v2/conanfile.py b/recipes/libassert/v2/conanfile.py new file mode 100644 index 0000000000000..7026af82c23fe --- /dev/null +++ b/recipes/libassert/v2/conanfile.py @@ -0,0 +1,137 @@ +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, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +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): + name = "libassert" + description = "The most over-engineered C++ assertion library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jeremy-rifkin/libassert" + topics = ("assert", "library", "assertions", "stacktrace", "diagnostics", "defensive programming", "testing") + 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": "9" + } + + 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 Version(self.version) >= "2.1.2": + self.requires("cpptrace/0.7.2", transitive_headers=True, transitive_libs=True) + else: + self.requires("cpptrace/0.7.1", 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, 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 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) + + tc.variables["LIBASSERT_USE_EXTERNAL_CPPTRACE"] = True + deps = CMakeDeps(self) + deps.generate() + + 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", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["assert"] + + self.cpp_info.set_property("cmake_file_name", "libassert") + self.cpp_info.set_property("cmake_target_name", "libassert::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", "libassert")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "libassert" + self.cpp_info.filenames["cmake_find_package_multi"] = "libassert" + self.cpp_info.names["cmake_find_package"] = "libassert" + self.cpp_info.names["cmake_find_package_multi"] = "libassert" + + self.cpp_info.components["assert"].names["cmake_find_package"] = "assert" + self.cpp_info.components["assert"].names["cmake_find_package_multi"] = "assert" + self.cpp_info.components["assert"].requires = ["cpptrace::cpptrace"] + self.cpp_info.components["assert"].libs = ["assert"] + if not self.options.shared: + self.cpp_info.components["assert"].defines.append("LIBASSERT_STATIC_DEFINE") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.requires = ["cpptrace::cpptrace"] diff --git a/recipes/libassert/v2/patches/2.0.0/0001-fix-export-and-include.patch b/recipes/libassert/v2/patches/2.0.0/0001-fix-export-and-include.patch new file mode 100644 index 0000000000000..199fdd0350b42 --- /dev/null +++ b/recipes/libassert/v2/patches/2.0.0/0001-fix-export-and-include.patch @@ -0,0 +1,13 @@ +diff --git a/include/libassert/assert-gtest.hpp b/include/libassert/assert-gtest.hpp +index 912da40..57dbc91 100644 +--- a/include/libassert/assert-gtest.hpp ++++ b/include/libassert/assert-gtest.hpp +@@ -6,8 +6,6 @@ + #define LIBASSERT_PREFIX_ASSERTIONS + #include + +-#include "tokenizer.hpp" +- + #if defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL != 0 + #error "Libassert integration does not work with MSVC's non-conformant preprocessor. /Zc:preprocessor must be used." + #endif diff --git a/recipes/libassert/v2/patches/2.0.1/0001-fix-string_view-detection.patch b/recipes/libassert/v2/patches/2.0.1/0001-fix-string_view-detection.patch new file mode 100644 index 0000000000000..ca09e305589b6 --- /dev/null +++ b/recipes/libassert/v2/patches/2.0.1/0001-fix-string_view-detection.patch @@ -0,0 +1,58 @@ +diff --git a/src/microfmt.hpp b/src/microfmt.hpp +index 0f750c3..59f5eea 100644 +--- a/src/microfmt.hpp ++++ b/src/microfmt.hpp +@@ -10,7 +10,7 @@ + #include + #include + #include +-#if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #include + #endif + #ifdef _MSC_VER +@@ -118,7 +118,7 @@ namespace microfmt { + int64_value, + uint64_value, + string_value, +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + string_view_value, + #endif + c_string_value, +@@ -128,7 +128,7 @@ namespace microfmt { + std::int64_t int64_value; + std::uint64_t uint64_value; + const std::string* string_value; +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + std::string_view string_view_value; + #endif + const char* c_string_value; +@@ -147,7 +147,7 @@ namespace microfmt { + format_value(unsigned long int_val) : uint64_value(int_val), value(value_type::uint64_value) {} + format_value(unsigned long long int_val) : uint64_value(int_val), value(value_type::uint64_value) {} + format_value(const std::string& string) : string_value(&string), value(value_type::string_value) {} +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + format_value(std::string_view sv) : string_view_value(sv), value(value_type::string_view_value) {} + #endif + format_value(const char* c_string) : c_string_value(c_string), value(value_type::c_string_value) {} +@@ -187,7 +187,7 @@ namespace microfmt { + case value_type::string_value: + do_write(out, string_value->begin(), string_value->end(), options); + break; +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + case value_type::string_view_value: + do_write(out, string_view_value.begin(), string_view_value.end(), options); + break; +@@ -302,7 +302,7 @@ namespace microfmt { + } + } + +- #if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L ++ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + template + std::string format(std::string_view fmt, Args&&... args) { + return detail::format(fmt.begin(), fmt.end(), {detail::format_value(args)...}); diff --git a/recipes/libassert/v2/patches/2.1.0/0001-msvc-ice.patch b/recipes/libassert/v2/patches/2.1.0/0001-msvc-ice.patch new file mode 100644 index 0000000000000..5e0ad013faca0 --- /dev/null +++ b/recipes/libassert/v2/patches/2.1.0/0001-msvc-ice.patch @@ -0,0 +1,32 @@ +diff --git a/src/utils.hpp b/src/utils.hpp +index 80b7ca4..18b90e5 100644 +--- a/src/utils.hpp ++++ b/src/utils.hpp +@@ -97,7 +97,8 @@ namespace libassert::detail { + } + }; + +- // note: the use of U here is mainly to workaround a gcc 8 issue https://godbolt.org/z/bdsWhdGj3 ++ #if LIBASSERT_IS_GCC && LIBASSERT_GCC_VERSION < 900 ++ // note: the use of U here is to workaround a gcc 8 issue https://godbolt.org/z/bdsWhdGj3 + template + constexpr std::array, N> to_array_impl(U(&&a)[N], std::index_sequence) { + return {{std::move(a[I])...}}; +@@ -106,6 +107,17 @@ namespace libassert::detail { + constexpr std::array, N> to_array(U(&&a)[N]) { + return to_array_impl(std::move(a), std::make_index_sequence{}); + } ++ #else ++ // unfortunately the above workaround ICEs MSVC https://godbolt.org/z/bjMEcY9fM ++ template ++ constexpr std::array, N> to_array_impl(T(&&a)[N], std::index_sequence) { ++ return {{std::move(a[I])...}}; ++ } ++ template ++ constexpr std::array, N> to_array(T(&&a)[N]) { ++ return to_array_impl(std::move(a), std::make_index_sequence{}); ++ } ++ #endif + + template + constexpr void constexpr_swap(A& a, B& b) { diff --git a/recipes/libassert/v2/test_package/CMakeLists.txt b/recipes/libassert/v2/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c539de918f22b --- /dev/null +++ b/recipes/libassert/v2/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +add_executable(${PROJECT_NAME} test_package.cpp) + +find_package(libassert REQUIRED CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE libassert::assert) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libassert/v2/test_package/conanfile.py b/recipes/libassert/v2/test_package/conanfile.py new file mode 100644 index 0000000000000..a804618d0f86f --- /dev/null +++ b/recipes/libassert/v2/test_package/conanfile.py @@ -0,0 +1,30 @@ +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) + 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") + self.run(bin_path, env="conanrun") diff --git a/recipes/libassert/v2/test_package/test_package.cpp b/recipes/libassert/v2/test_package/test_package.cpp new file mode 100644 index 0000000000000..2b1f1ea26d9ee --- /dev/null +++ b/recipes/libassert/v2/test_package/test_package.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +int main(void) { + std::cout << "Testing libassert\n"; + + libassert::set_failure_handler([](const libassert::assertion_info& info) { + std::cerr<= 1.3.0 in order to get libsharpyuv") + def build_requirements(self): + self.tool_requires("cmake/[>=3.19 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -75,19 +93,33 @@ 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 + if "with_ycgco_r" in self.options: + tc.variables["AVIF_ENABLE_EXPERIMENTAL_YCGCO_R"] = self.options.with_ycgco_r + if "with_gain_map" in self.options: + tc.variables["AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP"] = self.options.with_gain_map + if "with_metav1" in self.options: + tc.variables["AVIF_ENABLE_EXPERIMENTAL_METAV1"] = self.options.with_metav1 + if "with_sample_transform" in self.options: + tc.variables["AVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM"] = self.options.with_sample_transform tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "1.1.0": + deps.set_property("libyuv", "cmake_target_name", "yuv::yuv") deps.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") + def _patch_sources(self): apply_conandata_patches(self) cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - replace_in_file(self, cmakelists, "find_package(libyuv QUIET)", "find_package(libyuv REQUIRED CONFIG)") - replace_in_file(self, cmakelists, "${LIBYUV_LIBRARY}", "libyuv::libyuv") - replace_in_file(self, cmakelists, "find_package(dav1d REQUIRED)", "find_package(dav1d REQUIRED CONFIG)") - replace_in_file(self, cmakelists, "${DAV1D_LIBRARY}", "dav1d::dav1d") - replace_in_file(self, cmakelists, "find_package(aom REQUIRED)", "find_package(libaom-av1 REQUIRED CONFIG)") - replace_in_file(self, cmakelists, "${AOM_LIBRARIES}", "libaom-av1::libaom-av1") + if Version(self.version) < "1.1.0": + replace_in_file(self, cmakelists, "find_package(libyuv QUIET)", "find_package(libyuv REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${LIBYUV_LIBRARY}", "libyuv::libyuv") + replace_in_file(self, cmakelists, "find_package(dav1d REQUIRED)", "find_package(dav1d REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${DAV1D_LIBRARY}", "dav1d::dav1d") + replace_in_file(self, cmakelists, "find_package(aom REQUIRED)", "find_package(libaom-av1 REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${AOM_LIBRARIES}", "libaom-av1::libaom-av1") def build(self): self._patch_sources() diff --git a/recipes/libavif/all/patches/1.1.0-0001-disable-developer-only-codepaths.patch b/recipes/libavif/all/patches/1.1.0-0001-disable-developer-only-codepaths.patch new file mode 100644 index 0000000000000..205b84f1dcbf0 --- /dev/null +++ b/recipes/libavif/all/patches/1.1.0-0001-disable-developer-only-codepaths.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bc478ae..1b2229d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -137,13 +137,13 @@ if(AVIF_BUILD_APPS + ) + set(AVIF_USE_CXX ON) + endif() +- ++if(0) + if(APPLE) + set(XCRUN xcrun) + else() + set(XCRUN) + endif() +- ++endif() + # This is also needed to get shared libraries (e.g. pixbufloader-avif) to compile against a static libavif. + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + if(BUILD_SHARED_LIBS) +@@ -260,7 +260,7 @@ if(AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP) + check_avif_option(AVIF_LIBXML2 TARGET LibXml2::LibXml2 PKG_NAME LibXml2) + endif() + # --------------------------------------------------------------------------------------- +- ++if(0) + # Enable all warnings + include(CheckCCompilerFlag) + if(CMAKE_C_COMPILER_ID MATCHES "Clang") +@@ -290,7 +290,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC") + else() + message(FATAL_ERROR "libavif: Unknown compiler, bailing out") + endif() +- ++endif() + if(AVIF_ENABLE_WERROR) + # Warnings as errors + if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "GNU") diff --git a/recipes/libavif/all/patches/1.1.1-0001-disable-developer-only-codepaths.patch b/recipes/libavif/all/patches/1.1.1-0001-disable-developer-only-codepaths.patch new file mode 100644 index 0000000000000..00825d66fdb2c --- /dev/null +++ b/recipes/libavif/all/patches/1.1.1-0001-disable-developer-only-codepaths.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index baf5964..dc3704e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -147,13 +147,13 @@ option(AVIF_LOCAL_FUZZTEST + + # Whether the libavif library uses c++ indirectly (e.g. through linking to libyuv). + set(AVIF_LIB_USE_CXX OFF) +- ++if(0) + if(APPLE) + set(XCRUN xcrun) + else() + set(XCRUN) + endif() +- ++endif() + # This is also needed to get shared libraries (e.g. pixbufloader-avif) to compile against a static libavif. + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + if(BUILD_SHARED_LIBS) +@@ -269,7 +269,7 @@ if(AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP) + check_avif_option(AVIF_LIBXML2 TARGET LibXml2::LibXml2 PKG_NAME LibXml2) + endif() + # --------------------------------------------------------------------------------------- +- ++if(0) + # Enable all warnings + include(CheckCCompilerFlag) + if(MSVC) +@@ -310,7 +310,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU") + else() + message(FATAL_ERROR "libavif: Unknown compiler, bailing out") + endif() +- ++endif() + if(AVIF_ENABLE_WERROR) + # Warnings as errors + if(MSVC) diff --git a/recipes/libavif/all/test_package/CMakeLists.txt b/recipes/libavif/all/test_package/CMakeLists.txt index b46c3a250bddb..b89611c80e3cf 100644 --- a/recipes/libavif/all/test_package/CMakeLists.txt +++ b/recipes/libavif/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(libavif REQUIRED CONFIG) diff --git a/recipes/libavif/all/test_v1_package/CMakeLists.txt b/recipes/libavif/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libavif/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libavif/all/test_v1_package/conanfile.py b/recipes/libavif/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libavif/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_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/libavif/config.yml b/recipes/libavif/config.yml index 4c37b1d7a9e9a..d8cfe5a49c15a 100644 --- a/recipes/libavif/config.yml +++ b/recipes/libavif/config.yml @@ -1,4 +1,12 @@ versions: + "1.1.1": + folder: all + "1.1.0": + folder: all + "1.0.4": + folder: all + "1.0.3": + folder: all "1.0.2": folder: all "1.0.1": diff --git a/recipes/libavrocpp/all/conandata.yml b/recipes/libavrocpp/all/conandata.yml index 4db9766f42d9f..4431ba3942fec 100644 --- a/recipes/libavrocpp/all/conandata.yml +++ b/recipes/libavrocpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.11.3": + url: "https://github.com/apache/avro/archive/release-1.11.3.tar.gz" + sha256: "da377ac1cf8b91458bf702cbcfb214eecb5c399b267f0ca9c0aade6cabaf126e" "1.11.1": url: "https://github.com/apache/avro/archive/release-1.11.1.tar.gz" sha256: "599f96bb405f72a35154b2477caa6254d723bb4e3f6a0e54e9ae540664321752" @@ -12,6 +15,22 @@ sources: url: "https://github.com/apache/avro/archive/release-1.10.1.tar.gz" sha256: "8fd1f850ce37e60835e6d8335c0027a959aaa316773da8a9660f7d33a66ac142" patches: + "1.11.3": + - patch_file: "patches/0001-add-iterator-include-1-11-0.patch" + patch_description: "include iterator" + patch_type: "portability" + - patch_file: "patches/0002-disable-tests-1-11-1.patch" + patch_description: "disable tests" + patch_type: "conan" + - patch_file: "patches/0003-allow-static-boost-linkage-1-11-0.patch" + patch_description: "remove boost linkage definitions" + patch_type: "conan" + - patch_file: "patches/0004-fix-windows-shared-installation-1-11-1.patch" + patch_description: "fix runtime installation path" + patch_type: "portability" + - patch_file: "patches/0006-disable-warn-as-error-1-11-3.patch" + patch_description: "disable warn as error for boost c++14 breaking change" + patch_type: "portability" "1.11.1": - patch_file: "patches/0001-add-iterator-include-1-11-0.patch" patch_description: "include iterator" diff --git a/recipes/libavrocpp/all/conanfile.py b/recipes/libavrocpp/all/conanfile.py index d9c7f619040a6..e0658c9cdfa87 100644 --- a/recipes/libavrocpp/all/conanfile.py +++ b/recipes/libavrocpp/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, replace_in_file -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, CMakeDeps, CMakeToolchain, cmake_layout import os @@ -14,6 +14,7 @@ class LibavrocppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://avro.apache.org/" topics = ("serialization", "deserialization","avro") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -42,9 +43,10 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - + def requirements(self): - self.requires("boost/1.81.0") + # boost upper to 1.81.0 requires C++14 minimum + self.requires("boost/1.81.0", transitive_headers=True) self.requires("snappy/1.1.9") def validate(self): @@ -93,7 +95,7 @@ def package(self): rm(self, dll_pattern_to_remove, os.path.join(self.package_folder, "bin")) def package_info(self): - self.cpp_info.libs = ["avrocpp" if self.options.shared else "avrocpp_s"] + self.cpp_info.libs = ["avrocpp"] if self.options.shared else ["avrocpp_s"] if self.options.shared: self.cpp_info.defines.append("AVRO_DYN_LINK") if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/libavrocpp/all/patches/0006-disable-warn-as-error-1-11-3.patch b/recipes/libavrocpp/all/patches/0006-disable-warn-as-error-1-11-3.patch new file mode 100644 index 0000000000000..711abad6d4b00 --- /dev/null +++ b/recipes/libavrocpp/all/patches/0006-disable-warn-as-error-1-11-3.patch @@ -0,0 +1,13 @@ +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 52d6ac8a..26d8d146 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -59,7 +59,7 @@ if (WIN32 AND NOT CYGWIN AND NOT MSYS) + endif() + + if (CMAKE_COMPILER_IS_GNUCXX) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic") + if (AVRO_ADD_PROTECTOR_FLAGS) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fstack-protector-all -D_GLIBCXX_DEBUG") + # Unset _GLIBCXX_DEBUG for avrogencpp.cc because using Boost Program Options diff --git a/recipes/libavrocpp/all/test_package/CMakeLists.txt b/recipes/libavrocpp/all/test_package/CMakeLists.txt index d86e652771773..aa13290730ff7 100644 --- a/recipes/libavrocpp/all/test_package/CMakeLists.txt +++ b/recipes/libavrocpp/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(libavrocpp REQUIRED CONFIG) diff --git a/recipes/libavrocpp/config.yml b/recipes/libavrocpp/config.yml index 9fcb2d236146c..c159828f2eb37 100644 --- a/recipes/libavrocpp/config.yml +++ b/recipes/libavrocpp/config.yml @@ -1,4 +1,6 @@ versions: + 1.11.3: + folder: all 1.11.1: folder: all 1.11.0: diff --git a/recipes/libb2/all/test_v1_package/CMakeLists.txt b/recipes/libb2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libb2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 24ecc57793dc6..0000000000000 --- a/recipes/libb2/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/libbacktrace/all/conandata.yml b/recipes/libbacktrace/all/conandata.yml index 56d79ce7402eb..7aec17549ec3c 100644 --- a/recipes/libbacktrace/all/conandata.yml +++ b/recipes/libbacktrace/all/conandata.yml @@ -1,8 +1,22 @@ sources: + "cci.20240730": + url: "https://github.com/ianlancetaylor/libbacktrace/archive/0dd27b95f9f2c11b4a89db5f185a888af912838e.tar.gz" + sha256: "dfbc52012846c57759eaaa5131c329c43f77695c808b3e1847ec2dacce238c35" "cci.20210118": url: "https://github.com/ianlancetaylor/libbacktrace/archive/dedbe13fda00253fe5d4f2fb812c909729ed5937.tar.gz" sha256: "dc8c167f48f3de5ae318c528b26b72f300edb6e33744e55394674fd4b7cdd21d" patches: + "cci.20240730": + - patch_file: "patches/cci.20240719-0001-pointer-arithmetic.patch" + patch_description: "casting pointer types for pointer arithmetics" + patch_type: "portability" + - patch_file: "patches/0002-msvc-unistd-alternative.patch" + patch_description: "support msvc for codes using unistd.h" + patch_type: "portability" "cci.20210118": - patch_file: "patches/0001-pointer-arithmetic.patch" + patch_description: "casting pointer types for pointer arithmetics" + patch_type: "portability" - patch_file: "patches/0002-msvc-unistd-alternative.patch" + patch_description: "support msvc for codes using unistd.h" + patch_type: "portability" diff --git a/recipes/libbacktrace/all/conanfile.py b/recipes/libbacktrace/all/conanfile.py index 2fa71b8e36228..fd0cc977d3ab2 100644 --- a/recipes/libbacktrace/all/conanfile.py +++ b/recipes/libbacktrace/all/conanfile.py @@ -14,9 +14,9 @@ class LibbacktraceConan(ConanFile): name = "libbacktrace" description = "A C library that may be linked into a C/C++ program to produce symbolic backtraces." + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ianlancetaylor/libbacktrace" - license = "BSD-3-Clause" topics = ("backtrace", "stack-trace") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -52,7 +52,7 @@ def layout(self): def validate(self): check_min_vs(self, "180") if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration("libbacktrace shared is not supported with Visual Studio") + raise ConanInvalidConfiguration(f"{self.ref} shared is not supported with Visual Studio") def build_requirements(self): if self._settings_build.os == "Windows": diff --git a/recipes/libbacktrace/all/patches/cci.20240719-0001-pointer-arithmetic.patch b/recipes/libbacktrace/all/patches/cci.20240719-0001-pointer-arithmetic.patch new file mode 100644 index 0000000000000..dbf4fb3485b67 --- /dev/null +++ b/recipes/libbacktrace/all/patches/cci.20240719-0001-pointer-arithmetic.patch @@ -0,0 +1,31 @@ +diff --git a/pecoff.c b/pecoff.c +index 636e1b1..975e417 100644 +--- a/pecoff.c ++++ b/pecoff.c +@@ -704,7 +704,7 @@ coff_add (struct backtrace_state *state, int descriptor, + magic_ok = memcmp (magic, "PE\0", 4) == 0; + fhdr_off += 4; + +- memcpy (&fhdr, fhdr_view.data + 4, sizeof fhdr); ++ memcpy (&fhdr, (char*)fhdr_view.data + 4, sizeof fhdr); + } + else + { +@@ -738,7 +738,7 @@ coff_add (struct backtrace_state *state, int descriptor, + sects_view_valid = 1; + opt_hdr = (const b_coff_optional_header *) sects_view.data; + sects = (const b_coff_section_header *) +- (sects_view.data + fhdr.size_of_optional_header); ++ ((b_coff_optional_header *)sects_view.data + fhdr.size_of_optional_header); + + is_64 = 0; + memset (&image_base, 0, sizeof image_base); +@@ -781,7 +781,7 @@ coff_add (struct backtrace_state *state, int descriptor, + goto fail; + syms_view_valid = 1; + +- str_size = coff_read4 (syms_view.data + syms_size); ++ str_size = coff_read4 ((const unsigned char *)((char *)syms_view.data + syms_size)); + + str_off = syms_off + syms_size; + diff --git a/recipes/libbacktrace/all/test_package/CMakeLists.txt b/recipes/libbacktrace/all/test_package/CMakeLists.txt index 81b50a3407418..c2f9dfeaed9cc 100644 --- a/recipes/libbacktrace/all/test_package/CMakeLists.txt +++ b/recipes/libbacktrace/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(libbacktrace REQUIRED CONFIG) diff --git a/recipes/libbacktrace/all/test_v1_package/CMakeLists.txt b/recipes/libbacktrace/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libbacktrace/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libbacktrace/all/test_v1_package/conanfile.py b/recipes/libbacktrace/all/test_v1_package/conanfile.py deleted file mode 100644 index e0a85886fc12c..0000000000000 --- a/recipes/libbacktrace/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import CMake, ConanFile, 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/libbacktrace/config.yml b/recipes/libbacktrace/config.yml index bc0e7ddecd921..952bd0433d7d5 100644 --- a/recipes/libbacktrace/config.yml +++ b/recipes/libbacktrace/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20240730": + folder: all "cci.20210118": folder: all diff --git a/recipes/libbigwig/all/conanfile.py b/recipes/libbigwig/all/conanfile.py index e242d7f2f554c..be4c72a8890d2 100644 --- a/recipes/libbigwig/all/conanfile.py +++ b/recipes/libbigwig/all/conanfile.py @@ -47,7 +47,7 @@ def requirements(self): # https://github.com/dpryan79/libBigWig/blob/master/bigWigIO.h#L5 self.requires("libcurl/[>=7.78.0 <9]", transitive_headers=True) if self.options.with_zlibng: - self.requires("zlib-ng/2.1.5") + self.requires("zlib-ng/2.2.0") else: self.requires("zlib/[>=1.2.11 <2]") diff --git a/recipes/libbigwig/all/test_package/CMakeLists.txt b/recipes/libbigwig/all/test_package/CMakeLists.txt index fae2a97e9d90d..9d32fe6c94718 100644 --- a/recipes/libbigwig/all/test_package/CMakeLists.txt +++ b/recipes/libbigwig/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 C) find_package(BigWig REQUIRED CONFIG) diff --git a/recipes/libbigwig/all/test_v1_package/CMakeLists.txt b/recipes/libbigwig/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 70375bb9b607e..0000000000000 --- a/recipes/libbigwig/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -find_package(BigWig REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE BigWig::BigWig) -target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/libbigwig/all/test_v1_package/conanfile.py b/recipes/libbigwig/all/test_v1_package/conanfile.py deleted file mode 100644 index e8dacc213db5b..0000000000000 --- a/recipes/libbigwig/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -import os - -from conan.tools.build import cross_building -from conans import CMake, ConanFile - - -class TestPackageConan(ConanFile): - settings = "arch", "build_type", "compiler", "os" - 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/libboxes/all/conandata.yml b/recipes/libboxes/all/conandata.yml new file mode 100644 index 0000000000000..5ed3e25a8e382 --- /dev/null +++ b/recipes/libboxes/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.1": + url: "https://gitlab.com/twdev_projects/boxes/-/archive/v0.1.1/boxes-v0.1.1.tar.gz" + sha256: "a9943a47abd820b7847e1f7abd15fc733c028379542815f8038192a0e4902cd0" diff --git a/recipes/libboxes/all/conanfile.py b/recipes/libboxes/all/conanfile.py new file mode 100644 index 0000000000000..59e6f45a38714 --- /dev/null +++ b/recipes/libboxes/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, export_conandata_patches, get, rmdir +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.scm import Version +import os + +class libboxesRecipe(ConanFile): + name = "libboxes" + description = "Boxes is a set of frequently used containers built on top of STL" + + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.com/twdev_projects/boxes" + + topics = ("container", "utility") + 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 { + "apple-clang": "13", + "clang": "14", + "gcc": "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("xxhash/0.8.2", transitive_headers=True) + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("libboxes does not support Windows yet") + + 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["BUILD_SHARED_LIBS"] = self.options.shared + tc.cache_variables["BUILD_EXAMPLES"] = "OFF" + tc.generate() + + tc = CMakeDeps(self) + 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.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libboxes") + self.cpp_info.set_property("cmake_target_name", "libboxes::libboxes") + self.cpp_info.set_property("pkg_config_name", "libboxes") + + if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libboxes/all/test_package/CMakeLists.txt b/recipes/libboxes/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2c73e54e37773 --- /dev/null +++ b/recipes/libboxes/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(libboxes CONFIG REQUIRED) + + + +add_executable(example src/example.cpp) +target_link_libraries(example libboxes::libboxes) +target_compile_features(example PRIVATE cxx_std_20) diff --git a/recipes/libboxes/all/test_package/conanfile.py b/recipes/libboxes/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fa3590fe7255a --- /dev/null +++ b/recipes/libboxes/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 libboxesTestConan(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 can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "example") + self.run(cmd, env="conanrun") diff --git a/recipes/libboxes/all/test_package/src/example.cpp b/recipes/libboxes/all/test_package/src/example.cpp new file mode 100644 index 0000000000000..813df03e7c552 --- /dev/null +++ b/recipes/libboxes/all/test_package/src/example.cpp @@ -0,0 +1,16 @@ +#include + +#include + +int main() { + boxes::RingBuffer buf; + buf.push_back(123); + + if (buf.size() == 1 && buf.front() == 123) { + std::cout << "libboxes::RingBuffer works!" << std::endl; + } else { + std::cout << "libboxes::RingBuffer is broken!" << std::endl; + } + + return 0; +} diff --git a/recipes/libboxes/config.yml b/recipes/libboxes/config.yml new file mode 100644 index 0000000000000..b893ff21f7c23 --- /dev/null +++ b/recipes/libboxes/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.1": + folder: all diff --git a/recipes/libbsd/all/conandata.yml b/recipes/libbsd/all/conandata.yml index 5c7d8675d858e..fe3e56bc2a2d1 100644 --- a/recipes/libbsd/all/conandata.yml +++ b/recipes/libbsd/all/conandata.yml @@ -8,3 +8,7 @@ patches: patch_description: "Enables building on MacOS" patch_type: "portability" patch_source: "https://github.com/NixOS/nixpkgs/blob/1016bfcff1df163aff75d908df1e00f897a29b9b/pkgs/development/libraries/libbsd/darwin.patch" + - patch_file: "patches/0002-fix-getentropy-conditional.patch" + patch_description: "Fix check if getentropy needs building" + patch_type: "backport" + patch_source: "https://gitlab.freedesktop.org/libbsd/libbsd/-/commit/5cfa39e5cde6b64ccf3d1335cee4d4744d4ce242.patch" diff --git a/recipes/libbsd/all/patches/0002-fix-getentropy-conditional.patch b/recipes/libbsd/all/patches/0002-fix-getentropy-conditional.patch new file mode 100644 index 0000000000000..4c7cb9a8e5cf7 --- /dev/null +++ b/recipes/libbsd/all/patches/0002-fix-getentropy-conditional.patch @@ -0,0 +1,31 @@ +From 5cfa39e5cde6b64ccf3d1335cee4d4744d4ce242 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 23 Nov 2022 23:42:49 +0100 +Subject: [PATCH] =?UTF-8?q?build:=20Use=20=C2=AByes=C2=BB=20instead=20of?= + =?UTF-8?q?=20=C2=ABtrue=C2=BB=20for=20AC=5FCHECK=5FFUNCS=20cache=20value?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This autoconf macro sets the ac_cv_func_ cached variable to «yes» not +«true» so we were checking for an impossible condition. +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 17d113c..842f5d6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -173,7 +173,7 @@ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \ + getauxval getentropy getexecname getline \ + pstat_getproc sysconf \ + strlcpy strlcat strnstr strmode fpurge]) +-AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"]) ++AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xyes"]) + + AC_CONFIG_FILES([ + Makefile +-- +GitLab + diff --git a/recipes/libbsd/all/test_package/CMakeLists.txt b/recipes/libbsd/all/test_package/CMakeLists.txt index d4aafe28c716a..aea650fe3683f 100644 --- a/recipes/libbsd/all/test_package/CMakeLists.txt +++ b/recipes/libbsd/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(libbsd REQUIRED) diff --git a/recipes/libcap/all/conandata.yml b/recipes/libcap/all/conandata.yml index 16d2439fd2b12..6a68dc18fd15a 100644 --- a/recipes/libcap/all/conandata.yml +++ b/recipes/libcap/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.75": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.75.tar.xz" + sha256: "de4e7e064c9ba451d5234dd46e897d7c71c96a9ebf9a0c445bc04f4742d83632" + "2.73": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.73.tar.xz" + sha256: "6405f6089cf4cdd8c271540cd990654d78dd0b1989b2d9bda20f933a75a795a5" + "2.70": + url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.70.tar.xz" + sha256: "23a6ef8aadaf1e3e875f633bb2d116cfef8952dba7bc7c569b13458e1952b30f" "2.69": url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.69.tar.xz" sha256: "f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb" @@ -33,6 +42,27 @@ sources: url: "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.45.tar.xz" sha256: "d66639f765c0e10557666b00f519caf0bd07a95f867dddaee131cd284fac3286" patches: + "2.75": + - patch_file: "patches/2.73/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.73/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.73": + - patch_file: "patches/2.73/0001-libcap-Remove-hardcoded-fPIC.patch" + patch_description: "allow to configure fPIC option from conan recipe" + patch_type: "conan" + - patch_file: "patches/2.73/0002-Make.Rules-Make-compile-tools-configurable.patch" + patch_description: "allow to override compiler via environment variables" + patch_type: "conan" + "2.70": + - 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.69": - 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/patches/2.73/0001-libcap-Remove-hardcoded-fPIC.patch b/recipes/libcap/all/patches/2.73/0001-libcap-Remove-hardcoded-fPIC.patch new file mode 100644 index 0000000000000..0b246b6dfbaba --- /dev/null +++ b/recipes/libcap/all/patches/2.73/0001-libcap-Remove-hardcoded-fPIC.patch @@ -0,0 +1,26 @@ +From 8b86ac7b057ce529900969ead958a9ca7ae85b3c Mon Sep 17 00:00:00 2001 +From: Sergey Bobrenok +Date: Sun, 22 Dec 2024 20:30:31 +0700 +Subject: [PATCH 1/2] libcap: Remove hardcoded -fPIC + +Signed-off-by: Sergey Bobrenok +--- + libcap/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libcap/Makefile b/libcap/Makefile +index 5f5c601..02be223 100644 +--- a/libcap/Makefile ++++ b/libcap/Makefile +@@ -19,7 +19,7 @@ PSXFILES=../psx/psx ../psx/wrap/psx_wrap + PSXMAGICOBJ=psx_magic.o + + # Always build libcap sources this way: +-CFLAGS += -fPIC -D_LIBPSX_PTHREAD_LINKAGE ++CFLAGS += -D_LIBPSX_PTHREAD_LINKAGE + + # https://bugzilla.kernel.org/show_bug.cgi?id=219168 + OVERRIDE_BSYMBOLIC_FUNCTIONS := -Wl,-Bsymbolic-functions +-- +2.47.1 + diff --git a/recipes/libcap/all/patches/2.73/0002-Make.Rules-Make-compile-tools-configurable.patch b/recipes/libcap/all/patches/2.73/0002-Make.Rules-Make-compile-tools-configurable.patch new file mode 100644 index 0000000000000..1728d27b708b1 --- /dev/null +++ b/recipes/libcap/all/patches/2.73/0002-Make.Rules-Make-compile-tools-configurable.patch @@ -0,0 +1,33 @@ +From 903c526352f0cea70200c3f3231dffce8d1c9621 Mon Sep 17 00:00:00 2001 +From: Sergey Bobrenok +Date: Sun, 22 Dec 2024 20:52:43 +0700 +Subject: [PATCH 2/2] Make.Rules: Make compile tools configurable + +Signed-off-by: Sergey Bobrenok +--- + Make.Rules | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Make.Rules b/Make.Rules +index d349697..7bec1af 100644 +--- a/Make.Rules ++++ b/Make.Rules +@@ -66,11 +66,11 @@ DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + SYSTEM_HEADERS = /usr/include + + SUDO := sudo +-CC := $(CROSS_COMPILE)gcc ++CC ?= $(CROSS_COMPILE)gcc + LD := $(CC) -Wl,-x -shared -Wl,-shared +-AR := $(CROSS_COMPILE)ar +-RANLIB := $(CROSS_COMPILE)ranlib +-OBJCOPY := $(CROSS_COMPILE)objcopy ++AR ?= $(CROSS_COMPILE)ar ++RANLIB ?= $(CROSS_COMPILE)ranlib ++OBJCOPY ?= $(CROSS_COMPILE)objcopy + + # Reference: + # CPPFLAGS used for building .o files from .c & .h files +-- +2.47.1 + diff --git a/recipes/libcap/all/test_package/CMakeLists.txt b/recipes/libcap/all/test_package/CMakeLists.txt index 9cf6b90066410..032f1e3100aa8 100644 --- a/recipes/libcap/all/test_package/CMakeLists.txt +++ b/recipes/libcap/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(PkgConfig REQUIRED) diff --git a/recipes/libcap/all/test_v1_package/CMakeLists.txt b/recipes/libcap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libcap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libcap/all/test_v1_package/conanfile.py b/recipes/libcap/all/test_v1_package/conanfile.py deleted file mode 100644 index a24aa126c9102..0000000000000 --- a/recipes/libcap/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +0,0 @@ -import os - -from conans import ConanFile, tools -from conans import CMake - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - 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/libcap/config.yml b/recipes/libcap/config.yml index 9ca623681ce66..305bdc40ddd83 100644 --- a/recipes/libcap/config.yml +++ b/recipes/libcap/config.yml @@ -1,4 +1,10 @@ versions: + "2.75": + folder: all + "2.73": + folder: all + "2.70": + folder: all "2.69": folder: all "2.68": diff --git a/recipes/libcbor/all/conandata.yml b/recipes/libcbor/all/conandata.yml index e1d0e5f6211c5..c9712282e5c82 100644 --- a/recipes/libcbor/all/conandata.yml +++ b/recipes/libcbor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.11.0": + url: "https://github.com/PJK/libcbor/archive/v0.11.0.tar.gz" + sha256: "89e0a83d16993ce50651a7501355453f5250e8729dfc8d4a251a78ea23bb26d7" "0.10.2": url: "https://github.com/PJK/libcbor/archive/v0.10.2.tar.gz" sha256: "e75f712215d7b7e5c89ef322a09b701f7159f028b8b48978865725f00f79875b" diff --git a/recipes/libcbor/all/conanfile.py b/recipes/libcbor/all/conanfile.py index 2dcedcee9a1fc..e7b8cdd0c66a8 100644 --- a/recipes/libcbor/all/conanfile.py +++ b/recipes/libcbor/all/conanfile.py @@ -71,6 +71,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.set_property("pkg_config_name", "libcbor") diff --git a/recipes/libcbor/all/test_package/CMakeLists.txt b/recipes/libcbor/all/test_package/CMakeLists.txt index 94fca8fa66406..8adba422ded34 100644 --- a/recipes/libcbor/all/test_package/CMakeLists.txt +++ b/recipes/libcbor/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(libcbor REQUIRED CONFIG) diff --git a/recipes/libcbor/all/test_v1_package/CMakeLists.txt b/recipes/libcbor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libcbor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libcbor/all/test_v1_package/conanfile.py b/recipes/libcbor/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libcbor/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_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/libcbor/config.yml b/recipes/libcbor/config.yml index 7eceffdad45cc..fcc17114549de 100644 --- a/recipes/libcbor/config.yml +++ b/recipes/libcbor/config.yml @@ -1,4 +1,6 @@ versions: + "0.11.0": + folder: "all" "0.10.2": folder: "all" "0.10.1": diff --git a/recipes/libccd/all/test_package/CMakeLists.txt b/recipes/libccd/all/test_package/CMakeLists.txt index 776995184ae2f..245e6110dc21a 100644 --- a/recipes/libccd/all/test_package/CMakeLists.txt +++ b/recipes/libccd/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(ccd REQUIRED CONFIG) diff --git a/recipes/libccd/all/test_v1_package/CMakeLists.txt b/recipes/libccd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libccd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libccd/all/test_v1_package/conanfile.py b/recipes/libccd/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libccd/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_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/libcds/all/test_package/CMakeLists.txt b/recipes/libcds/all/test_package/CMakeLists.txt index 481acf254620b..d801f64a49217 100644 --- a/recipes/libcds/all/test_package/CMakeLists.txt +++ b/recipes/libcds/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(LibCDS REQUIRED CONFIG) diff --git a/recipes/libcds/all/test_v1_package/CMakeLists.txt b/recipes/libcds/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libcds/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libcds/all/test_v1_package/conanfile.py b/recipes/libcds/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libcds/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_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/libcoap/all/test_v1_package/CMakeLists.txt b/recipes/libcoap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libcoap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 0e1f34afd83e4..0000000000000 --- a/recipes/libcoap/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -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/libconfig/all/test_package/CMakeLists.txt b/recipes/libconfig/all/test_package/CMakeLists.txt index d094678d52a36..6d1dce8a2594a 100644 --- a/recipes/libconfig/all/test_package/CMakeLists.txt +++ b/recipes/libconfig/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 CXX) find_package(libconfig REQUIRED CONFIG) diff --git a/recipes/libconfig/all/test_v1_package/CMakeLists.txt b/recipes/libconfig/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libconfig/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libconfig/all/test_v1_package/conanfile.py b/recipes/libconfig/all/test_v1_package/conanfile.py deleted file mode 100644 index 8ba7c272305b9..0000000000000 --- a/recipes/libconfig/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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) - bin_path_pp = os.path.join("bin", "test_package++") - self.run(bin_path_pp, run_environment=True) diff --git a/recipes/libconfuse/all/test_package/CMakeLists.txt b/recipes/libconfuse/all/test_package/CMakeLists.txt index c98d1db7c151d..6ce99a9158705 100644 --- a/recipes/libconfuse/all/test_package/CMakeLists.txt +++ b/recipes/libconfuse/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(libconfuse REQUIRED CONFIG) diff --git a/recipes/libconfuse/all/test_v1_package/CMakeLists.txt b/recipes/libconfuse/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libconfuse/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libconfuse/all/test_v1_package/conanfile.py b/recipes/libconfuse/all/test_v1_package/conanfile.py deleted file mode 100644 index 6f8d199faef5a..0000000000000 --- a/recipes/libconfuse/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,23 +0,0 @@ -from conans import ConanFile, CMake, tools -from io import StringIO -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") - config_path = os.path.join(self.source_folder, os.pardir, "test_package", "hello.conf") - output = StringIO() - self.run(f"{bin_path} {config_path}", run_environment=True, output=output) - text = output.getvalue() - print(text) - assert "Neighbour" in text diff --git a/recipes/libcoro/all/conandata.yml b/recipes/libcoro/all/conandata.yml index 08d79c6bc3667..4bcca11cdffc9 100644 --- a/recipes/libcoro/all/conandata.yml +++ b/recipes/libcoro/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "0.14.1": + url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.14.1.tar.gz" + sha256: "0a18058fe17826237a868e3d266960e839db8c7aeeb2beba9b596c84124afe0e" + "0.12.1": + url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.12.1.tar.gz" + sha256: "2cb6f45fc73dad6008cc930d92939785684835e03b12df422b98fcab9e393add" + "0.12": + url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.12.tar.gz" + sha256: "9a89f329e12fda7d6425523fb2cbd1ebaf41e0e1d41e210d93ad4f3a196333a2" + "0.11.1": + url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.11.1.tar.gz" + sha256: "c7eb1bf133519ec0e0bc2e3e018ac4d1447a143e5e7385dab19204277d7c7671" + "0.10": + url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.10.tar.gz" + sha256: "0e952e72012925b75910f80772f3642dac631644578dbbc0db4fee047badc745" "0.9": url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.9.tar.gz" sha256: "680479582023f019bfa58b17bbcd30aa2ef1a8ba2c09d4ea9b296dbc77e93f1f" @@ -9,10 +24,12 @@ sources: url: "https://github.com/jbaldwin/libcoro/archive/refs/tags/v0.7.tar.gz" sha256: "ce1f3f1c4fa21b53d1cd195a29bd5a2313e53aa35637b402db04207d02316e51" patches: + "0.10": + - patch_file: "patches/0.10-0002-disable-git-config.patch" + patch_type: "official" + patch_description: "Comment out invocation of git config command" + patch_source: "https://github.com/jbaldwin/libcoro/pull/234" "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" @@ -21,16 +38,10 @@ patches: 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/0.7-0001-allow-shared-lib.patch" - patch_type: "conan" - patch_description: "Allow to build the library as a shared library" - patch_file: "patches/0.7-0002-disable-git-config.patch" patch_type: "conan" patch_description: "Comment out invocation of git config command" diff --git a/recipes/libcoro/all/conanfile.py b/recipes/libcoro/all/conanfile.py index 1117b3d012d2a..2e5eb967a08a4 100644 --- a/recipes/libcoro/all/conanfile.py +++ b/recipes/libcoro/all/conanfile.py @@ -1,21 +1,22 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd +from conan.tools.microsoft import is_msvc 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" +required_conan_version = ">=2.1" class LibcoroConan(ConanFile): name = "libcoro" description = "C++20 coroutine library" - 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" + topics = ("coroutines", "concurrency", "tasks", "executors", "networking") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -40,8 +41,12 @@ def _min_cppstd(self): @property def _minimum_compilers_version(self): return { - "gcc": "10.2.1", - } + "gcc": "10.2.1", + "clang": "16.0.0", + "apple-clang": "16", + "Visual Studio": "16", + "msvc": "192", + } def export_sources(self): export_conandata_patches(self) @@ -54,10 +59,15 @@ def config_options(self): if Version(self.version) < "0.9": del self.options.with_ssl del self.options.with_threading + if is_msvc(self) or self.settings.os == "Emscripten": + self.options.rm_safe("with_networking") + self.options.rm_safe("with_ssl") def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if Version(self.version) < "0.11": + self.package_type = "static-library" def layout(self): cmake_layout(self, src_folder="src") @@ -65,16 +75,17 @@ def layout(self): def requirements(self): 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("c-ares/1.25.0", transitive_headers=True) self.requires("tl-expected/1.1.0", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: - raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") - if self.settings.compiler != "gcc": - raise ConanInvalidConfiguration("gcc is the only compiler supported by libcoro.") + if Version(self.version) < "0.10": + if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + if self.settings.compiler != "gcc": + raise ConanInvalidConfiguration(f"The Conan recipe {self.ref} only supports GCC for now. Contributions are welcome!") minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) if minimum_version and Version(self.settings.compiler.version) < minimum_version: @@ -82,6 +93,9 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) + if Version(self.version) < "0.11" and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} Only supports shared linking for versions >=0.11") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -91,10 +105,16 @@ def generate(self): 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 + tc.variables["LIBCORO_FEATURE_NETWORKING"] = self.options.get_safe("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.variables["LIBCORO_FEATURE_SSL"] = self.options.get_safe("with_ssl", False) + if Version(self.version) >= "0.11": + tc.variables["LIBCORO_RUN_GITCONFIG"] = False + tc.variables["LIBCORO_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["LIBCORO_FEATURE_TLS"] = self.options.get_safe("with_ssl", False) + if Version(self.version) < "0.10": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) deps.generate() @@ -115,16 +135,16 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "libcoro") self.cpp_info.set_property("cmake_target_name", "libcoro::libcoro") if Version(self.version) >= "0.8": - self.cpp_info.libs = ["coro"] + self.cpp_info.libs = ["libcoro"] if is_msvc(self) else ["coro"] else: self.cpp_info.libs = ["libcoro"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "m"] if Version(self.version) >= "0.9": - if self.options.with_networking: + if self.options.get_safe("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.get_safe("with_ssl"): + self.cpp_info.defines.extend(["LIBCORO_FEATURE_SSL", "LIBCORO_FEATURE_TLS"]) if self.options.with_threading: self.cpp_info.defines.append("LIBCORO_FEATURE_THREADING") diff --git a/recipes/libcoro/all/patches/0.10-0002-disable-git-config.patch b/recipes/libcoro/all/patches/0.10-0002-disable-git-config.patch new file mode 100644 index 0000000000000..c6f4b03da3194 --- /dev/null +++ b/recipes/libcoro/all/patches/0.10-0002-disable-git-config.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b749c11..ce78a2d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,17 +12,20 @@ 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) + option(LIBCORO_BUILD_EXAMPLES "Build the examples, Default=ON." ON) ++option(LIBCORO_RUN_GITCONFIG "Set the githooks directory to auto format and update the readme, Default=ON." OFF) ++ ++# Set the githooks directory to auto format and update the readme. ++if (LIBCORO_RUN_GITCONFIG) ++ 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} ++ ) ++endif() + + cmake_dependent_option(LIBCORO_FEATURE_PLATFORM "Include linux platform features, Default=ON." ON "NOT EMSCRIPTEN; NOT MSVC" OFF) + cmake_dependent_option(LIBCORO_FEATURE_NETWORKING "Include networking features, Default=ON." ON "NOT EMSCRIPTEN; NOT MSVC" OFF) diff --git a/recipes/libcoro/all/patches/0.7-0001-allow-shared-lib.patch b/recipes/libcoro/all/patches/0.7-0001-allow-shared-lib.patch deleted file mode 100644 index 9c3ca8de19231..0000000000000 --- a/recipes/libcoro/all/patches/0.7-0001-allow-shared-lib.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -69,4 +69,4 @@ - ) - --add_library(${PROJECT_NAME} STATIC ${LIBCORO_SOURCE_FILES}) -+add_library(${PROJECT_NAME} ${LIBCORO_SOURCE_FILES}) - set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) 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 deleted file mode 100644 index 0481b258f7f9a..0000000000000 --- a/recipes/libcoro/all/patches/0.8-0001-allow-shared-lib.patch +++ /dev/null @@ -1,13 +0,0 @@ -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.9-0001-allow-shared-lib.patch b/recipes/libcoro/all/patches/0.9-0001-allow-shared-lib.patch deleted file mode 100644 index 4838c6103aa0f..0000000000000 --- a/recipes/libcoro/all/patches/0.9-0001-allow-shared-lib.patch +++ /dev/null @@ -1,13 +0,0 @@ -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/test_package/CMakeLists.txt b/recipes/libcoro/all/test_package/CMakeLists.txt index b5b603835dec1..e4937093df887 100644 --- a/recipes/libcoro/all/test_package/CMakeLists.txt +++ b/recipes/libcoro/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(libcoro REQUIRED CONFIG) diff --git a/recipes/libcoro/all/test_v1_package/CMakeLists.txt b/recipes/libcoro/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libcoro/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libcoro/all/test_v1_package/conanfile.py b/recipes/libcoro/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libcoro/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_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/libcoro/config.yml b/recipes/libcoro/config.yml index 77538762e21e7..7d21448188045 100644 --- a/recipes/libcoro/config.yml +++ b/recipes/libcoro/config.yml @@ -1,4 +1,14 @@ versions: + "0.14.1": + folder: all + "0.12.1": + folder: all + "0.12": + folder: all + "0.11.1": + folder: all + "0.10": + folder: all "0.9": folder: all "0.8": diff --git a/recipes/libcorrect/all/conanfile.py b/recipes/libcorrect/all/conanfile.py index a2cd26c5b3b8e..cbc598d59d046 100644 --- a/recipes/libcorrect/all/conanfile.py +++ b/recipes/libcorrect/all/conanfile.py @@ -1,9 +1,11 @@ from conan import ConanFile +from conan.errors import ConanException 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 +from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class LibcorrectConan(ConanFile): @@ -13,7 +15,7 @@ class LibcorrectConan(ConanFile): homepage = "https://github.com/quiet/libcorrect" description = "C library for Convolutional codes and Reed-Solomon" topics = ("fec", "reed-solomon", "viterbi", "convolutional") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -60,6 +62,9 @@ def generate(self): 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.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "20181010": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def _patch_sources(self): diff --git a/recipes/libcorrect/all/test_package/CMakeLists.txt b/recipes/libcorrect/all/test_package/CMakeLists.txt index 37ccc2fe5dfaa..1e9acb99fbaae 100644 --- a/recipes/libcorrect/all/test_package/CMakeLists.txt +++ b/recipes/libcorrect/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(libcorrect REQUIRED CONFIG) diff --git a/recipes/libcorrect/all/test_v1_package/CMakeLists.txt b/recipes/libcorrect/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 37041d4cb4431..0000000000000 --- a/recipes/libcorrect/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libcorrect REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE libcorrect::libcorrect) diff --git a/recipes/libcorrect/all/test_v1_package/conanfile.py b/recipes/libcorrect/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libcorrect/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_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/libcpuid/all/test_v1_package/CMakeLists.txt b/recipes/libcpuid/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libcpuid/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index a2a865893b40b..0000000000000 --- a/recipes/libcpuid/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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 = 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/libcuckoo/all/test_package/CMakeLists.txt b/recipes/libcuckoo/all/test_package/CMakeLists.txt index bbb37dc967899..b6b949fa63789 100644 --- a/recipes/libcuckoo/all/test_package/CMakeLists.txt +++ b/recipes/libcuckoo/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) set(CMAKE_CXX_STANDARD 11) diff --git a/recipes/libcuckoo/all/test_v1_package/CMakeLists.txt b/recipes/libcuckoo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a4368c23dc75f..0000000000000 --- a/recipes/libcuckoo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 11) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libcuckoo REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE libcuckoo::libcuckoo) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_${CMAKE_CXX_STANDARD}) diff --git a/recipes/libcuckoo/all/test_v1_package/conanfile.py b/recipes/libcuckoo/all/test_v1_package/conanfile.py deleted file mode 100644 index 8a5678ccbf761..0000000000000 --- a/recipes/libcuckoo/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,15 +0,0 @@ -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.settings): - bin_path = os.path.join("bin", "test_package") - self.run("{0}".format(bin_path), run_environment=True) diff --git a/recipes/libcurl/all/conandata.yml b/recipes/libcurl/all/conandata.yml index 3a12a85c5d679..3b5919db9b7b7 100644 --- a/recipes/libcurl/all/conandata.yml +++ b/recipes/libcurl/all/conandata.yml @@ -1,4 +1,39 @@ sources: + "8.12.1": + url: + - "https://curl.se/download/curl-8.12.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_12_1/curl-8.12.1.tar.xz" + sha256: "0341f1ed97a26c811abaebd37d62b833956792b7607ea3f15d001613c76de202" + "8.11.1": + url: + - "https://curl.se/download/curl-8.11.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_11_1/curl-8.11.1.tar.xz" + sha256: "c7ca7db48b0909743eaef34250da02c19bc61d4f1dcedd6603f109409536ab56" + "8.10.1": + url: + - "https://curl.se/download/curl-8.10.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_10_1/curl-8.10.1.tar.xz" + sha256: "73a4b0e99596a09fa5924a4fb7e4b995a85fda0d18a2c02ab9cf134bebce04ee" + "8.10.0": + url: + - "https://curl.se/download/curl-8.10.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_10_0/curl-8.10.0.tar.xz" + sha256: "e6b142f0e85e954759d37e26a3627e2278137595be80e3a860c4353e4335e5a0" + "8.9.1": + url: + - "https://curl.se/download/curl-8.9.1.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_9_1/curl-8.9.1.tar.xz" + sha256: "f292f6cc051d5bbabf725ef85d432dfeacc8711dd717ea97612ae590643801e5" + "8.8.0": + url: + - "https://curl.se/download/curl-8.8.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_8_0/curl-8.8.0.tar.xz" + sha256: "0f58bb95fc330c8a46eeb3df5701b0d90c9d9bfcc42bd1cd08791d12551d4400" + "8.6.0": + url: + - "https://curl.se/download/curl-8.6.0.tar.xz" + - "https://github.com/curl/curl/releases/download/curl-8_6_0/curl-8.6.0.tar.xz" + sha256: "3ccd55d91af9516539df80625f818c734dc6f2ecf9bada33c76765e99121db15" "8.5.0": url: - "https://curl.se/download/curl-8.5.0.tar.xz" @@ -14,21 +49,11 @@ sources: - "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.xz" @@ -39,48 +64,3 @@ sources: - "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.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.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.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.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.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.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.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.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.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 d2f7a3c31bd9a..cf715fe17a999 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import cross_building from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.env import VirtualBuildEnv, VirtualRunEnv -from conan.tools.files import apply_conandata_patches, copy, download, export_conandata_patches, get, load, replace_in_file, rm, rmdir, save +from conan.tools.files import copy, download, get, load, replace_in_file, rm, rmdir, save from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, unix_path @@ -13,7 +13,7 @@ import os import re -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1.0" class LibcurlConan(ConanFile): @@ -30,7 +30,7 @@ class LibcurlConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "with_ssl": [False, "openssl", "wolfssl", "schannel", "darwinssl"], + "with_ssl": [False, "openssl", "wolfssl", "schannel", "darwinssl", "mbedtls"], "with_file": [True, False], "with_ftp": [True, False], "with_http": [True, False], @@ -64,6 +64,7 @@ class LibcurlConan(ConanFile): "with_cookies": [True, False], "with_ipv6": [True, False], "with_docs": [True, False], + "with_misc_docs": [True, False], "with_verbose_debug": [True, False], "with_symbol_hiding": [True, False], "with_unix_sockets": [True, False], @@ -71,6 +72,8 @@ class LibcurlConan(ConanFile): "with_ca_bundle": [False, "auto", "ANY"], "with_ca_path": [False, "auto", "ANY"], "with_ca_fallback": [True, False], + "with_form_api": [True, False], + "with_websockets": [True, False], } default_options = { "shared": False, @@ -109,6 +112,7 @@ class LibcurlConan(ConanFile): "with_cookies": True, "with_ipv6": True, "with_docs": False, + "with_misc_docs": False, "with_verbose_debug": True, "with_symbol_hiding": False, "with_unix_sockets": True, @@ -116,44 +120,37 @@ class LibcurlConan(ConanFile): "with_ca_bundle": "auto", "with_ca_path": "auto", "with_ca_fallback": False, + "with_form_api": True, + "with_websockets": True, } @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - @property def _is_win_x_android(self): - return self.settings.os == "Android" and self._settings_build.os == "Windows" + return self.settings.os == "Android" and self.settings_build.os == "Windows" @property def _is_using_cmake_build(self): return is_msvc(self) or self._is_win_x_android - @property - def _has_with_libpsl_option(self): - return not (self._is_using_cmake_build and Version(self.version) < "7.84.0") - def export_sources(self): copy(self, "lib_Makefile_add.am", 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 not self._has_with_libpsl_option: - del self.options.with_libpsl if self._is_using_cmake_build: del self.options.with_libgsasl - # Before 7.86.0, enabling unix sockets configure option would fail on windows - # It was fixed with this PR: https://github.com/curl/curl/pull/9688 - if self._is_mingw and Version(self.version) < "7.86.0": - del self.options.with_unix_sockets + if Version(self.version) < "8.3.0": + del self.options.with_form_api + if Version(self.version) < "8.7.0": + del self.options.with_misc_docs + if Version(self.version) < "8.11.0": + del self.options.with_websockets # Default options self.options.with_ssl = "darwinssl" if is_apple_os(self) else "openssl" @@ -174,9 +171,11 @@ 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") + self.requires("wolfssl/5.6.6") + elif self.options.with_ssl == "mbedtls": + self.requires("mbedtls/3.5.0") if self.options.with_nghttp2: - self.requires("libnghttp2/1.58.0") + self.requires("libnghttp2/1.59.0") if self.options.with_libssh2: self.requires("libssh2/1.11.0") if self.options.with_zlib: @@ -186,9 +185,12 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.with_c_ares: - self.requires("c-ares/1.22.1") + self.requires("c-ares/[>=1.27 <2]") if self.options.get_safe("with_libpsl"): self.requires("libpsl/0.21.1") + if self.options.with_libidn: + self.requires("libidn2/2.3.0") + def validate(self): if self.options.with_ssl == "schannel" and self.settings.os != "Windows": @@ -198,19 +200,21 @@ def validate(self): if self.options.with_ssl == "openssl": openssl = self.dependencies["openssl"] if self.options.with_ntlm and openssl.options.no_des: - raise ConanInvalidConfiguration("option with_ntlm=True requires openssl:no_des=False") + raise ConanInvalidConfiguration("option with_ntlm=True requires openssl/*:no_des=False") + if self.options.with_ssl == "wolfssl" and not self.dependencies["wolfssl"].options.with_curl: + raise ConanInvalidConfiguration("option with_ssl=wolfssl requires wolfssl/*:with_curl=True") def build_requirements(self): if self._is_using_cmake_build: if self._is_win_x_android: - self.tool_requires("ninja/1.11.1") + self.tool_requires("ninja/[>=1.10.2 <2]") else: self.tool_requires("libtool/2.4.7") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.1.0") + self.tool_requires("pkgconf/[>=2.2 <3]") if self.settings.os in [ "tvOS", "watchOS" ]: self.tool_requires("gnu-config/cci.20210814") - if self._settings_build.os == "Windows": + 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") @@ -256,7 +260,6 @@ def _patch_autoreconf(self): copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) def _patch_sources(self): - apply_conandata_patches(self) self._patch_misc_files() self._patch_autotools() self._patch_cmake() @@ -283,8 +286,14 @@ def _patch_autotools(self): # - link errors if mingw shared or iOS/tvOS/watchOS # - it makes recipe consistent with CMake build where we don't build curl tool top_makefile = os.path.join(self.source_folder, "Makefile.am") - replace_in_file(self, top_makefile, "SUBDIRS = lib src", "SUBDIRS = lib") - replace_in_file(self, top_makefile, "include src/Makefile.inc", "") + if Version(self.version) < "8.8.0": + replace_in_file(self, top_makefile, "SUBDIRS = lib src", "SUBDIRS = lib") + else: + replace_in_file(self, top_makefile, "SUBDIRS = lib docs src scripts", "SUBDIRS = lib") + + # `Makefile.inc` has been removed from 8.12.0 onwards + if Version(self.version) < "8.12.0": + replace_in_file(self, top_makefile, "include src/Makefile.inc", "") # zlib naming is not always very consistent if self.options.with_zlib: @@ -311,7 +320,7 @@ def _patch_autotools(self): "noinst_LTLIBRARIES = libcurl.la") # add directives to build dll # used only for native mingw-make - if not cross_building(self): + if not cross_building(self) or self._is_mingw: # The patch file is located in the base src folder added_content = load(self, os.path.join(self.folders.base_source, "lib_Makefile_add.am")) save(self, lib_makefile, added_content, append=True) @@ -325,11 +334,19 @@ def _patch_cmake(self): replace_in_file(self, cmakelists, "include(CurlSymbolHiding)", "") + if Version(self.version) >= "8.12.0": + cmakemacros = os.path.join(self.source_folder, "CMake", "Macros.cmake") + replace_in_file(self, cmakemacros, "macro(curl_dependency_option _option_name _find_name _desc_name)", "macro(curl_dependency_option _option_name _find_name _desc_name _cmake_args)") + replace_in_file(self, cmakemacros, "find_package(${_find_name} REQUIRED)", "find_package(${_find_name} ${_cmake_args})") + # brotli 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)") + if Version(self.version) < "8.12.0": + replace_in_file(self, cmakelists, "find_package(Brotli REQUIRED)", "find_package(brotli REQUIRED CONFIG)") + else: + replace_in_file(self, cmakelists, 'curl_dependency_option(CURL_BROTLI Brotli "brotli")', 'curl_dependency_option(CURL_BROTLI brotli "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}") @@ -337,49 +354,77 @@ def _patch_cmake(self): # zstd # Use upstream FindZstd.cmake because check_symbol_exists() is called # afterwards and it would fail with zstd_LIBRARIES generated by CMakeDeps - replace_in_file(self, cmakelists, "find_package(Zstd REQUIRED)", "find_package(Zstd REQUIRED MODULE)") - replace_in_file(self, os.path.join(self.source_folder, "CMake", "FindZstd.cmake"), "if(UNIX)", "if(0)") + if Version(self.version) < "8.12.0": + replace_in_file(self, cmakelists, "find_package(Zstd REQUIRED)", "find_package(Zstd REQUIRED MODULE)") + else: + replace_in_file(self, cmakelists, 'curl_dependency_option(CURL_ZSTD Zstd "zstd")', 'curl_dependency_option(CURL_ZSTD Zstd "zstd" "REQUIRED MODULE")') + if Version(self.version) < "8.10.0": + replace_in_file(self, os.path.join(self.source_folder, "CMake", "FindZstd.cmake"), "if(UNIX)", "if(0)") + + # zlib + if Version(self.version) >= "8.12.0": + replace_in_file(self, cmakelists, 'curl_dependency_option(CURL_ZLIB ZLIB "ZLIB")', 'curl_dependency_option(CURL_ZLIB ZLIB "ZLIB" "")') # c-ares - replace_in_file(self, cmakelists, "find_package(CARES REQUIRED)", "find_package(c-ares REQUIRED CONFIG)") - replace_in_file(self, cmakelists, "${CARES_LIBRARY}", "c-ares::cares") + if Version(self.version) < "8.10.0": + replace_in_file(self, cmakelists, "find_package(CARES REQUIRED)", "find_package(c-ares REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${CARES_LIBRARY}", "c-ares::cares") + else: + replace_in_file(self, cmakelists, "find_package(Cares REQUIRED)", "find_package(c-ares REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${CARES_LIBRARIES}", "c-ares::cares") # libpsl - if self._has_with_libpsl_option: + if Version(self.version) < "8.10.0": replace_in_file(self, cmakelists, "find_package(LibPSL)", "find_package(libpsl REQUIRED CONFIG)") - replace_in_file(self, cmakelists, "if(LIBPSL_FOUND)", "if(libpsl_FOUND)") replace_in_file(self, cmakelists, "${LIBPSL_LIBRARY}", "libpsl::libpsl") replace_in_file(self, cmakelists, "${LIBPSL_INCLUDE_DIR}", "${libpsl_INCLUDE_DIRS}") + else: + replace_in_file(self, cmakelists, "${LIBPSL_LIBRARIES}", "libpsl::libpsl") + replace_in_file(self, cmakelists, "${LIBPSL_INCLUDE_DIRS}", "${libpsl_INCLUDE_DIRS}") + if Version(self.version) < "8.12.0": + replace_in_file(self, cmakelists, "if(LIBPSL_FOUND)", "if(libpsl_FOUND)") # libssh2 - replace_in_file(self, cmakelists, "find_package(LibSSH2)", "find_package(Libssh2 REQUIRED CONFIG)") + if Version(self.version) < "8.10.0": + replace_in_file(self, cmakelists, "find_package(LibSSH2)", "find_package(Libssh2 REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "${LIBSSH2_LIBRARY}", "Libssh2::libssh2") + replace_in_file(self, cmakelists, "${LIBSSH2_INCLUDE_DIR}", "${Libssh2_INCLUDE_DIRS}") + else: + replace_in_file(self, cmakelists, "${LIBSSH2_LIBRARIES}", "Libssh2::libssh2") + replace_in_file(self, cmakelists, "${LIBSSH2_INCLUDE_DIRS}", "${Libssh2_INCLUDE_DIRS}") replace_in_file(self, cmakelists, "if(LIBSSH2_FOUND)", "if(Libssh2_FOUND)") - replace_in_file(self, cmakelists, "${LIBSSH2_LIBRARY}", "Libssh2::libssh2") - replace_in_file(self, cmakelists, "${LIBSSH2_INCLUDE_DIR}", "${Libssh2_INCLUDE_DIRS}") # libnghttp2 - replace_in_file(self, cmakelists, "find_package(NGHTTP2 REQUIRED)", "find_package(libnghttp2 REQUIRED CONFIG)") + if Version(self.version) < "8.10.0": + replace_in_file(self, cmakelists, "find_package(NGHTTP2 REQUIRED)", "find_package(libnghttp2 REQUIRED CONFIG)") + else: + replace_in_file(self, cmakelists, "find_package(NGHTTP2)", "find_package(libnghttp2 REQUIRED CONFIG)") + replace_in_file(self, cmakelists, "NGHTTP2_FOUND", "libnghttp2_FOUND") replace_in_file(self, cmakelists, "${NGHTTP2_INCLUDE_DIRS}", "${libnghttp2_INCLUDE_DIRS}") replace_in_file(self, cmakelists, "${NGHTTP2_LIBRARIES}", "libnghttp2::nghttp2") # wolfssl replace_in_file(self, cmakelists, "find_package(WolfSSL REQUIRED)", "find_package(wolfssl REQUIRED CONFIG)") - replace_in_file(self, cmakelists, "${WolfSSL_LIBRARIES}", "${wolfssl_LIBRARIES}") - replace_in_file(self, cmakelists, "${WolfSSL_INCLUDE_DIRS}", "${wolfssl_INCLUDE_DIRS}") + if Version(self.version) < "8.10.0": + replace_in_file(self, cmakelists, "${WolfSSL_LIBRARIES}", "${wolfssl_LIBRARIES}") + replace_in_file(self, cmakelists, "${WolfSSL_INCLUDE_DIRS}", "${wolfssl_INCLUDE_DIRS}") + else: + replace_in_file(self, cmakelists, "${WOLFSSL_LIBRARIES}", "${wolfssl_LIBRARIES}") + replace_in_file(self, cmakelists, "${WOLFSSL_INCLUDE_DIRS}", "${wolfssl_INCLUDE_DIRS}") # INTERFACE_LIBRARY (generated by the cmake_find_package generator) targets doesn't have the LOCATION property. # So skipp the LOCATION check in the CMakeLists.txt - if Version(self.version) >= "7.80.0": - replace_in_file(self, - cmakelists, - 'get_target_property(_lib "${_libname}" LOCATION)', - """get_target_property(_type "${_libname}" TYPE) + replace_in_file( + self, + cmakelists, + 'get_target_property(_lib "${_libname}" LOCATION)', + """get_target_property(_type "${_libname}" TYPE) if(${_type} STREQUAL "INTERFACE_LIBRARY") # Reading the INTERFACE_LIBRARY property on non-imported target will error out. continue() endif() get_target_property(_lib "${_libname}" LOCATION)""", - ) + ) def _yes_no(self, value): return "yes" if value else "no" @@ -442,6 +487,12 @@ def _generate_with_autotools(self): else: tc.configure_args.append("--without-wolfssl") + if self.options.with_ssl == "mbedtls": + path = unix_path(self, self.dependencies["mbedtls"].package_folder) + tc.configure_args.append(f"--with-mbedtls={path}") + else: + tc.configure_args.append("--without-mbedtls") + if self.options.with_libssh2: path = unix_path(self, self.dependencies["libssh2"].package_folder) tc.configure_args.append(f"--with-libssh2={path}") @@ -488,6 +539,28 @@ def _generate_with_autotools(self): tc.configure_args.append(f"--with-ca-fallback={self._yes_no(self.options.with_ca_fallback)}") + if "with_misc_docs" in self.options: + if self.options.with_misc_docs: + tc.configure_args.append("--enable-docs") + else: + tc.configure_args.append("--disable-docs") + if "with_form_api" in self.options: + if self.options.with_form_api: + tc.configure_args.append("--enable-form-api") + else: + tc.configure_args.append("--disable-form-api") + if "with_websockets" in self.options: + if self.options.with_websockets: + tc.configure_args.append("--enable-websockets") + else: + tc.configure_args.append("--disable-websockets") + + if self.options.with_libidn: + path = unix_path(self, self.dependencies["libidn2"].package_folder) + tc.configure_args.append(f"--with-libidn2={path}") + else: + tc.configure_args.append("--without-libidn2") + # Cross building flags if cross_building(self): if self.settings.os == "Linux" and "arm" in self.settings.arch: @@ -513,7 +586,6 @@ def _generate_with_autotools(self): if self.settings.os != "Windows": tc.fpic = self.options.get_safe("fPIC", True) - if cross_building(self) and is_apple_os(self): tc.extra_defines.extend(['HAVE_SOCKET', 'HAVE_FCNTL_O_NONBLOCK']) @@ -553,41 +625,39 @@ def _generate_with_cmake(self): tc.variables["ENABLE_UNICODE"] = True tc.variables["BUILD_TESTING"] = False tc.variables["BUILD_CURL_EXE"] = False + tc.cache_variables["ENABLE_CURL_MANUAL"] = False tc.variables["CURL_DISABLE_LDAP"] = not self.options.with_ldap tc.variables["BUILD_SHARED_LIBS"] = self.options.shared tc.variables["CURL_STATICLIB"] = not self.options.shared tc.variables["CMAKE_DEBUG_POSTFIX"] = "" - if Version(self.version) >= "7.81.0": - tc.variables["CURL_USE_SCHANNEL"] = self.options.with_ssl == "schannel" - else: - tc.variables["CMAKE_USE_SCHANNEL"] = self.options.with_ssl == "schannel" - if Version(self.version) >= "7.81.0": - tc.variables["CURL_USE_OPENSSL"] = self.options.with_ssl == "openssl" - else: - tc.variables["CMAKE_USE_OPENSSL"] = self.options.with_ssl == "openssl" - if Version(self.version) >= "7.81.0": - tc.variables["CURL_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" - else: - tc.variables["CMAKE_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" + tc.variables["CURL_USE_SCHANNEL"] = self.options.with_ssl == "schannel" + tc.variables["CURL_USE_OPENSSL"] = self.options.with_ssl == "openssl" + tc.variables["CURL_USE_WOLFSSL"] = self.options.with_ssl == "wolfssl" + tc.variables["CURL_USE_MBEDTLS"] = self.options.with_ssl == "mbedtls" tc.variables["USE_NGHTTP2"] = self.options.with_nghttp2 tc.variables["CURL_ZLIB"] = self.options.with_zlib tc.variables["CURL_BROTLI"] = self.options.with_brotli tc.variables["CURL_ZSTD"] = self.options.with_zstd - if self._has_with_libpsl_option: - tc.variables["CURL_USE_LIBPSL"] = self.options.with_libpsl - if Version(self.version) >= "7.81.0": - tc.variables["CURL_USE_LIBSSH2"] = self.options.with_libssh2 - else: - tc.variables["CMAKE_USE_LIBSSH2"] = self.options.with_libssh2 + tc.variables["CURL_USE_LIBPSL"] = self.options.with_libpsl + tc.variables["CURL_USE_LIBSSH2"] = self.options.with_libssh2 tc.variables["ENABLE_ARES"] = self.options.with_c_ares if not self.options.with_c_ares: tc.variables["ENABLE_THREADED_RESOLVER"] = self.options.with_threaded_resolver tc.variables["CURL_DISABLE_PROXY"] = not self.options.with_proxy tc.variables["USE_LIBRTMP"] = self.options.with_librtmp tc.variables["USE_LIBIDN2"] = self.options.with_libidn + if self.options.with_libidn: + # Conan won't generate this variable as we're setting prefixes, + # and CMake might not either as it's looking for Libidn2 + # Ensure it's there + tc.cache_variables["LIBIDN2_FOUND"] = True tc.variables["CURL_DISABLE_RTSP"] = not self.options.with_rtsp tc.variables["CURL_DISABLE_CRYPTO_AUTH"] = not self.options.with_crypto_auth tc.variables["CURL_DISABLE_VERBOSE_STRINGS"] = not self.options.with_verbose_strings + if "with_form_api" in self.options: + tc.variables["CURL_DISABLE_FORM_API"] = not self.options.with_form_api + if "with_websockets" in self.options: + tc.variables["CURL_DISABLE_WEBSOCKETS"] = not self.options.with_websockets # Also disables NTLM_WB if set to false if not self.options.with_ntlm: @@ -613,9 +683,18 @@ def _generate_with_cmake(self): tc.variables["HAVE_OPENSSL_SRP"] = True tc.variables["HAVE_SSL_CTX_SET_QUIC_METHOD"] = True + if is_msvc(self): + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.generate() deps = CMakeDeps(self) + deps.set_property("wolfssl", "cmake_additional_variables_prefixes", ["WolfSSL", "WOLFSSL"]) + deps.set_property("wolfssl", "cmake_file_name", "WolfSSL") + + if self.options.with_libidn: + deps.set_property("libidn2", "cmake_file_name", "Libidn2") + deps.set_property("libidn2", "cmake_additional_variables_prefixes", ["LIBIDN2"]) deps.generate() def package(self): @@ -650,8 +729,6 @@ def package_info(self): else: self.cpp_info.components["curl"].libs = ["curl"] if self.settings.os in ["Linux", "FreeBSD"]: - if self.options.with_libidn: - self.cpp_info.components["curl"].libs.append("idn") if self.options.with_librtmp: self.cpp_info.components["curl"].libs.append("rtmp") @@ -659,13 +736,14 @@ def package_info(self): self.cpp_info.components["curl"].system_libs = ["rt", "pthread"] elif self.settings.os == "Windows": # used on Windows for VS build, native and cross mingw build - self.cpp_info.components["curl"].system_libs = ["ws2_32"] + self.cpp_info.components["curl"].system_libs = ["ws2_32", "bcrypt"] if self.options.with_ldap: self.cpp_info.components["curl"].system_libs.append("wldap32") if self.options.with_ssl == "schannel": self.cpp_info.components["curl"].system_libs.append("crypt32") elif is_apple_os(self): self.cpp_info.components["curl"].frameworks.append("CoreFoundation") + self.cpp_info.components["curl"].frameworks.append("CoreServices") self.cpp_info.components["curl"].frameworks.append("SystemConfiguration") if self.options.with_ldap: self.cpp_info.components["curl"].system_libs.append("ldap") @@ -685,6 +763,8 @@ def package_info(self): self.cpp_info.components["curl"].requires.append("openssl::openssl") if self.options.with_ssl == "wolfssl": self.cpp_info.components["curl"].requires.append("wolfssl::wolfssl") + if self.options.with_ssl == "mbedtls": + self.cpp_info.components["curl"].requires.append("mbedtls::mbedtls") if self.options.with_nghttp2: self.cpp_info.components["curl"].requires.append("libnghttp2::libnghttp2") if self.options.with_libssh2: @@ -699,11 +779,8 @@ def package_info(self): self.cpp_info.components["curl"].requires.append("c-ares::c-ares") if self.options.get_safe("with_libpsl"): self.cpp_info.components["curl"].requires.append("libpsl::libpsl") + if self.options.with_libidn: + self.cpp_info.components["curl"].requires.append("libidn2::libidn2") - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "CURL" - self.cpp_info.names["cmake_find_package_multi"] = "CURL" - self.cpp_info.components["curl"].names["cmake_find_package"] = "libcurl" - self.cpp_info.components["curl"].names["cmake_find_package_multi"] = "libcurl" self.cpp_info.components["curl"].set_property("cmake_target_name", "CURL::libcurl") self.cpp_info.components["curl"].set_property("pkg_config_name", "libcurl") diff --git a/recipes/libcurl/all/lib_Makefile_add.am b/recipes/libcurl/all/lib_Makefile_add.am index ab1b697fe638c..234d999c5b24a 100644 --- a/recipes/libcurl/all/lib_Makefile_add.am +++ b/recipes/libcurl/all/lib_Makefile_add.am @@ -6,7 +6,7 @@ LIBCURL_OBJECTS := $(patsubst %.c,%.o,$(strip $(CSOURCES))) RESOURCE = libcurl.res -RC = windres +RC ?= windres all-local: $(libcurl_dll_LIBRARY) @@ -15,7 +15,7 @@ $(libcurl_dll_LIBRARY): $(LIBCURL_OBJECTS) $(RESOURCE) $(libcurl_dll_DEPENDENCIE @$(call DEL, $@) $(CC) $(LDFLAGS) -shared -o $@ \ -Wl,--output-def,$(@:.dll=.def),--out-implib,$(libcurl_dll_a_LIBRARY) \ - $(LIBCURL_OBJECTS) $(RESOURCE) $(LIBCURL_LIBS) + $(LIBCURL_OBJECTS) $(RESOURCE) $(LIBCURL_PC_LIBS_PRIVATE) %.o: %.c $(PROOT)/include/curl/curlbuild.h $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@ diff --git a/recipes/libcurl/all/test_package/CMakeLists.txt b/recipes/libcurl/all/test_package/CMakeLists.txt index cbc46379aedd1..92c1602ee2aed 100644 --- a/recipes/libcurl/all/test_package/CMakeLists.txt +++ b/recipes/libcurl/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(CURL REQUIRED) diff --git a/recipes/libcurl/all/test_package/test_package.c b/recipes/libcurl/all/test_package/test_package.c index 309b36d2e45f9..6736a548e93ab 100644 --- a/recipes/libcurl/all/test_package/test_package.c +++ b/recipes/libcurl/all/test_package/test_package.c @@ -6,6 +6,7 @@ int main(void) CURL *curl; int retval = 0; const char *const *proto; + const char *const *feat; curl_version_info_data* id = curl_version_info(CURLVERSION_NOW); if (!id) return 1; @@ -14,7 +15,12 @@ int main(void) for(proto = id->protocols; *proto; proto++) { printf("%s ", *proto); } - printf("\nversion: %s\nssl version: %s\nfeatures: %d\n", id->version, id->ssl_version, id->features); + printf("\nversion: %s\nssl version: %s\n", id->version, id->ssl_version); + + printf("features: "); + for(feat = id->feature_names; *feat; feat++) { + printf("%s ", *feat); + } curl = curl_easy_init(); if(curl) { diff --git a/recipes/libcurl/all/test_v1_package/CMakeLists.txt b/recipes/libcurl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 448a8a5aaf0d7..0000000000000 --- a/recipes/libcurl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/libcurl/all/test_v1_package/conanfile.py b/recipes/libcurl/all/test_v1_package/conanfile.py deleted file mode 100644 index 7ebb558a2d5e3..0000000000000 --- a/recipes/libcurl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,43 +0,0 @@ -from conans import ConanFile, CMake, tools -import os -import subprocess -import re - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - @property - def _test_executable(self): - return os.path.join("bin", "test_package") - - def test(self): - if not tools.cross_building(self): - self.run(self._test_executable, run_environment=True) - else: - # We will dump information for the generated executable - if self.settings.os in ["Android", "iOS"]: - # FIXME: Check output for these hosts - return - - output = subprocess.check_output(["file", self._test_executable]).decode() - - if self.settings.os == "Macos" and self.settings.arch == "armv8": - assert "Mach-O 64-bit executable arm64" in output, f"Not found in output: {output}" - - elif self.settings.os == "Linux": - if self.settings.arch == "armv8_32": - assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" - elif "armv8" in self.settings.arch: - assert re.search(r"Machine:\s+AArch64", output), f"Not found in output: {output}" - elif "arm" in self.settings.arch: - assert re.search(r"Machine:\s+ARM", output), f"Not found in output: {output}" - - elif self.settings.os == "Windows": # FIXME: It satisfies not only MinGW - assert re.search(r"PE32.*executable.*Windows", output), f"Not found in output: {output}" diff --git a/recipes/libcurl/config.yml b/recipes/libcurl/config.yml index 8e607e7cc2a0e..ea096268ebdac 100644 --- a/recipes/libcurl/config.yml +++ b/recipes/libcurl/config.yml @@ -1,35 +1,27 @@ versions: - "8.5.0": - folder: all - "8.4.0": - folder: all - "8.2.1": - folder: all - "8.2.0": - folder: all - "8.1.2": + "8.12.1": folder: all - "8.1.1": + "8.11.1": folder: all - "8.0.1": + "8.10.1": folder: all - "7.88.1": + "8.10.0": folder: all - "7.87.0": + "8.9.1": folder: all - "7.86.0": + "8.8.0": folder: all - "7.85.0": + "8.6.0": folder: all - "7.84.0": + "8.5.0": folder: all - "7.83.1": + "8.4.0": folder: all - "7.82.0": + "8.2.1": folder: all - "7.80.0": + "8.1.2": folder: all - "7.79.1": + "8.0.1": folder: all - "7.78.0": + "7.88.1": folder: all diff --git a/recipes/libcvd/all/conandata.yml b/recipes/libcvd/all/conandata.yml new file mode 100644 index 0000000000000..8c0de4fe10731 --- /dev/null +++ b/recipes/libcvd/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.5.1": + url: "https://github.com/edrosten/libcvd/archive/refs/tags/RELEASE_2_5_1.tar.gz" + sha256: "c077e426e1bd6e6c7af3b9330ec1496a59789f2d0c529dc18049fc653947dd6e" diff --git a/recipes/libcvd/all/conanfile.py b/recipes/libcvd/all/conanfile.py new file mode 100644 index 0000000000000..da62d0fad1d30 --- /dev/null +++ b/recipes/libcvd/all/conanfile.py @@ -0,0 +1,171 @@ +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, save, rmdir, replace_in_file +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class LibCVDConan(ConanFile): + name = "libcvd" + description = "libCVD - efficient and easy-to-use C++ computer vision library" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/edrosten/libcvd" + topics = ("computer-vision",) + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libjpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], + "with_libpng": [True, False], + "with_libtiff": [True, False], + "with_ffmpeg": [True, False], + "with_libdc1394": [True, False], + "with_opengl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libjpeg": "libjpeg", + "with_libpng": True, + "with_libtiff": True, + # Build without video support by default + "with_ffmpeg": False, + "with_libdc1394": False, + "with_opengl": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "15", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # OpenGL is always used on Windows + del self.options.with_opengl + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/edrosten/libcvd/blob/main/cmake/CVDFindAllDeps.cmake + # Used in a public header https://github.com/edrosten/libcvd/blob/RELEASE_2_5_0/cvd/canny.h#L4 + self.requires("toon/3.2", transitive_headers=True, transitive_libs=True) + if self.options.with_ffmpeg: + # FFMPEG v5.x+ are not supported + self.requires("ffmpeg/4.4.4", transitive_libs=True) + if self.options.with_libdc1394: + # FIXME: libidc1394 seems to be missing raw1394 dependency + # test_package fails with "undefined reference to `raw1394_new_handle'" etc + self.requires("libdc1394/2.2.7") + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/3.0.2") + elif self.options.with_libjpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.with_libjpeg == "mozjpeg": + self.requires("mozjpeg/4.1.5") + if self.options.with_libpng: + self.requires("libpng/[>=1.6 <2]") + if self.options.with_libtiff: + self.requires("libtiff/4.6.0") + if self.options.get_safe("with_opengl", True): + # https://github.com/edrosten/libcvd/blob/RELEASE_2_5_0/cvd/videodisplay.h#L18-L20 + self.requires("opengl/system", transitive_headers=True, transitive_libs=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." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CVD_ENABLE_TESTS"] = False + tc.variables["CVD_ENABLE_PROGS"] = False + tc.variables["CVD_ENABLE_EXAMPLES"] = False + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_ffmpeg"] = not self.options.with_ffmpeg + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_libdc1394"] = not self.options.with_libdc1394 + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_JPEG"] = not self.options.with_libjpeg + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_PNG"] = not self.options.with_libpng + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_TIFF"] = not self.options.with_libtiff + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_OpenGL"] = not self.options.get_safe("with_opengl", True) + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_X11"] = not self.options.get_safe("with_opengl", True) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("ffmpeg", "cmake_file_name", "CVD_FFMPEG") + deps.set_property("libdc1394", "cmake_file_name", "CVD_dc1394v2") + deps.set_property("toon", "cmake_file_name", "CVD_TooN") + deps.generate() + + def _patch_sources(self): + # Use deps from Conan + save(self, os.path.join(self.source_folder, "cmake", "CVDFindFFMPEG.cmake"), + "find_package(CVD_FFMPEG REQUIRED)\n" if self.options.with_ffmpeg else "") + save(self, os.path.join(self.source_folder, "cmake", "CVDFinddc1394v2.cmake"), + "find_package(CVD_dc1394v2 REQUIRED)\n" if self.options.with_libdc1394 else "") + save(self, os.path.join(self.source_folder, "cmake", "CVDFindTooN.cmake"), + "set(CVD_TooN_FOUND FALSE)\n") + + # For debugging + save(self, os.path.join(self.source_folder, "cmake", "CVDFindAllDeps.cmake"), + '\nmessage(INFO "CVD_DEP_LIBS: ${CVD_DEP_LIBS}")\n', append=True) + + # Install DLL + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)", + "install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin)") + + + 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, "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "CVD") + self.cpp_info.set_property("cmake_target_name", "cvd") + self.cpp_info.set_property("cmake_find_mode", "both") + + postfix = "_debug" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["cvd" + postfix] + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libcvd/all/test_package/CMakeLists.txt b/recipes/libcvd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..22605b8561ab7 --- /dev/null +++ b/recipes/libcvd/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(CVD REQUIRED MODULE) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ${CVD_LIBRARIES}) +target_include_directories(${PROJECT_NAME} PRIVATE ${CVD_INCLUDE_DIRS}) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libcvd/all/test_package/conanfile.py b/recipes/libcvd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/libcvd/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/libcvd/all/test_package/test_package.cpp b/recipes/libcvd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4e0988c93bbd2 --- /dev/null +++ b/recipes/libcvd/all/test_package/test_package.cpp @@ -0,0 +1,85 @@ +// https://github.com/edrosten/libcvd/blob/RELEASE_2_5_0/examples/distance_transform.cc + +// Copyright (c) 2005--2013, The Authors +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER 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 AUTHOR OR OTHER 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 +#include + +#include +#include + +using CVD::byte; +using CVD::euclidean_distance_transform_sq; +using CVD::Image; +using CVD::ImageRef; +using CVD::img_save; +using CVD::Rgb; +using std::max_element; +using std::mt19937; +using std::uniform_int_distribution; + +int main() +{ + //Create a blank image. + Image im(ImageRef(128, 128), 0); + + mt19937 engine; + uniform_int_distribution rand_x(0, im.size().x - 1); + uniform_int_distribution rand_y(0, im.size().y - 1); + + //Scatter down 7 points at random. + for(int i = 1; i < 8; i++) + im[rand_y(engine)][rand_x(engine)] = i; + + Image dt(im.size()); + Image inverse_dt(im.size()); + + //Perform the distance transform + euclidean_distance_transform_sq(im, dt, inverse_dt); + + //Create an output which is the distance transfom of the input, + //but coloured according to which pixel is closest. + int largest_distance = *max_element(dt.begin(), dt.end()); + + Image> out(im.size()); + + for(int y = 0; y < im.size().y; y++) + for(int x = 0; x < im.size().x; x++) + { + int c = floor(sqrt(dt[y][x] * 1.0 / largest_distance) * 255 + .5); + + Rgb r(0, 0, 0); + if(im[inverse_dt[y][x]] & 1) + r.red = c; + if(im[inverse_dt[y][x]] & 2) + r.green = c; + if(im[inverse_dt[y][x]] & 4) + r.blue = c; + + out[y][x] = r; + } + + img_save(out, "distance_transform_result.png"); +} diff --git a/recipes/libcvd/config.yml b/recipes/libcvd/config.yml new file mode 100644 index 0000000000000..eab83a303df52 --- /dev/null +++ b/recipes/libcvd/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.1": + folder: all diff --git a/recipes/libdaemon/all/test_package/CMakeLists.txt b/recipes/libdaemon/all/test_package/CMakeLists.txt index 23288e5f6af93..4d710b42620df 100644 --- a/recipes/libdaemon/all/test_package/CMakeLists.txt +++ b/recipes/libdaemon/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(libdaemon REQUIRED CONFIG) diff --git a/recipes/libdaemon/all/test_v1_package/CMakeLists.txt b/recipes/libdaemon/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libdaemon/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libdaemon/all/test_v1_package/conanfile.py b/recipes/libdaemon/all/test_v1_package/conanfile.py deleted file mode 100644 index 93fc246e84e20..0000000000000 --- a/recipes/libdaemon/all/test_v1_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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - self.run(f"{bin_path} -k", run_environment=True) diff --git a/recipes/libdatachannel/all/conandata.yml b/recipes/libdatachannel/all/conandata.yml new file mode 100644 index 0000000000000..f99b7e6b63a31 --- /dev/null +++ b/recipes/libdatachannel/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.22.2": + url: "https://github.com/paullouisageneau/libdatachannel/archive/refs/tags/v0.22.2.tar.gz" + sha256: "8431ba62a3c83fbee05257226fb8bcb256b1a5ce48b449a718e3be5dbe9b2226" diff --git a/recipes/libdatachannel/all/conanfile.py b/recipes/libdatachannel/all/conanfile.py new file mode 100644 index 0000000000000..bbe70c6f825ff --- /dev/null +++ b/recipes/libdatachannel/all/conanfile.py @@ -0,0 +1,142 @@ +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, CMakeDeps +from conan.tools.files import copy, get, rm, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.apple import fix_apple_shared_install_name + +required_conan_version = ">=2.1" + +class libdatachannelConan(ConanFile): + name = "libdatachannel" + description = "C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets." + license = "MPL-2.0" + topics = ("webrtc", "rtc", "datachannel", "websocket") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/paullouisageneau/libdatachannel" + settings = "os", "compiler", "build_type", "arch" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_websocket": [True, False], + "with_nice": [True, False], + "with_ssl": ["openssl", "mbedtls", "gnutls"] + } + default_options = { + "shared": False, + "fPIC": True, + "with_websocket": True, + "with_nice": False, + "with_ssl": "openssl" + } + + implements = ["auto_shared_fpic"] + + def requirements(self): + if self.options.with_ssl == "openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.with_ssl == "mbedtls": + self.requires("mbedtls/3.6.2") + elif self.options.with_ssl == "gnutls": + self.requires("gnutls/3.8.7") + if self.options.with_websocket: + self.requires("nettle/3.9.1") + self.requires("plog/1.1.10") + self.requires("usrsctp/0.9.5.0") + self.requires("libsrtp/2.6.0") + if self.options.with_nice: + self.requires("libnice/0.1.21") + else: + self.requires("libjuice/1.5.7", transitive_headers=True, transitive_libs=True) + + def validate(self): + check_min_cppstd(self, 17) + if self.options.with_ssl == "mbedtls": + # dtlstransport.cpp:414:3: error: use of undeclared identifier 'mbedtls_ssl_conf_dtls_srtp_protection_profiles' + raise ConanInvalidConfiguration("Compilation error with mbedtls. Contributions are welcome.") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + # Let Conan handle fpic + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["PREFER_SYSTEM_LIB"] = True + tc.cache_variables["USE_SYSTEM_SRTP"] = True + tc.cache_variables["USE_SYSTEM_USRSCTP"] = True + tc.cache_variables["USE_SYSTEM_PLOG"] = True + tc.cache_variables["USE_SYSTEM_JSON"] = True + tc.cache_variables["NO_EXAMPLES"] = True + tc.cache_variables["NO_TESTS"] = True + tc.cache_variables["NO_WEBSOCKET"] = not self.options.with_websocket + tc.cache_variables["USE_NICE"] = self.options.with_nice + tc.cache_variables["USE_SYSTEM_JUICE"] = not self.options.with_nice + if self.options.with_ssl == "gnutls": + tc.cache_variables["USE_GNUTLS"] = True + elif self.options.with_ssl == "mbedtls": + tc.cache_variables["USE_MBEDTLS"] = True + tc.generate() + deps = CMakeDeps(self) + deps.set_property("usrsctp", "cmake_target_name", "Usrsctp::Usrsctp") + deps.set_property("libsrtp", "cmake_file_name", "libSRTP") + deps.set_property("libsrtp", "cmake_target_name", "libSRTP::srtp2") + if self.options.with_ssl == "mbedtls": + deps.set_property("mbedtls", "cmake_target_name", "MbedTLS::MbedTLS") + elif self.options.with_ssl == "gnutls" and self.options.with_websocket: + deps.set_property("nettle", "cmake_file_name", "Nettle") + deps.set_property("nettle", "cmake_target_name", "Nettle::Nettle") + if self.options.with_nice: + deps.set_property("libnice", "cmake_file_name", "LibNice") + deps.set_property("libnice", "cmake_target_name", "LibNice::LibNice") + elif not self.options.shared: + # Targetname is LibJuice::LibJuiceStatic for static, but upstream makes no distinction + deps.set_property("libjuice", "cmake_target_name", "LibJuice::LibJuice") + deps.generate() + + def build(self): + 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() + fix_apple_shared_install_name(self) + + 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): + suffix = "" + if is_msvc(self) and self.settings.build_type == "Debug": + suffix = "d" + self.cpp_info.libs = ["datachannel" + suffix] + self.cpp_info.set_property("cmake_file_name", "LibDataChannel") + self.cpp_info.set_property("cmake_target_name", "LibDataChannel::LibDataChannel") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") + + if not self.options.shared: + self.cpp_info.defines.append("RTC_STATIC") + + self.cpp_info.defines.append("RTC_ENABLE_WEBSOCKET=" + ("1" if self.options.with_websocket else "0")) + # This is True by default, and the recipe currently does not model it + self.cpp_info.defines.append("RTC_ENABLE_MEDIA=1") + diff --git a/recipes/libdatachannel/all/test_package/CMakeLists.txt b/recipes/libdatachannel/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..469fbf1ec6698 --- /dev/null +++ b/recipes/libdatachannel/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(LibDataChannel REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE LibDataChannel::LibDataChannel) +#target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libdatachannel/all/test_package/conanfile.py b/recipes/libdatachannel/all/test_package/conanfile.py new file mode 100644 index 0000000000000..02eb5ce439fb4 --- /dev/null +++ b/recipes/libdatachannel/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/libdatachannel/all/test_package/test_package.cpp b/recipes/libdatachannel/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..64fcf199513c5 --- /dev/null +++ b/recipes/libdatachannel/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + + +int main(void) { + rtc::InitLogger(rtc::LogLevel::Debug); + return EXIT_SUCCESS; +} diff --git a/recipes/libdatachannel/config.yml b/recipes/libdatachannel/config.yml new file mode 100644 index 0000000000000..4f5d598c77216 --- /dev/null +++ b/recipes/libdatachannel/config.yml @@ -0,0 +1,3 @@ +versions: + "0.22.2": + folder: all diff --git a/recipes/libdatrie/all/conandata.yml b/recipes/libdatrie/all/conandata.yml new file mode 100644 index 0000000000000..96b260a1cc4e3 --- /dev/null +++ b/recipes/libdatrie/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.2.13": + url: "https://linux.thai.net/pub/ThaiLinux/software/libthai/libdatrie-0.2.13.tar.xz" + sha256: "12231bb2be2581a7f0fb9904092d24b0ed2a271a16835071ed97bed65267f4be" +patches: + "0.2.13": + - patch_file: "patches/fix-exports.patch" + patch_type: "portability" + patch_description: "Fix .def exports for Windows" diff --git a/recipes/libdatrie/all/conanfile.py b/recipes/libdatrie/all/conanfile.py new file mode 100644 index 0000000000000..7ec417808f17c --- /dev/null +++ b/recipes/libdatrie/all/conanfile.py @@ -0,0 +1,138 @@ +import os + +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 Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save, rename +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path + +required_conan_version = ">=1.54.0" + + +class LibdatrieConan(ConanFile): + name = "libdatrie" + description = "Implementation of double-array structure for representing tries" + license = "LGPL-2.1-or-later" + homepage = "https://linux.thai.net/projects/datrie" + url = "https://github.com/conan-io/conan-center-index" + topics = ("trie", "double-array-trie", "datrie") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "tools": False, + } + + @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.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def requirements(self): + self.requires("libiconv/1.17") + + def validate(self): + if is_apple_os(self) and self.options.shared: + # Fails due to build script bugs + raise ConanInvalidConfiguration("shared builds on Apple OS-s are not supported. Contributions are welcome!") + + 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() + + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--disable-doxygen-doc", + ]) + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + iconv_info = self.dependencies["libiconv"].cpp_info + env.append("CPPFLAGS", [f"-I{unix_path(self, iconv_info.includedir)}"] + [f"-D{d}" for d in iconv_info.defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in iconv_info.libs]) + env.append("LDFLAGS", [f"-L{unix_path(self, iconv_info.libdir)}"]) + env.vars(self).save_script("conanautotoolsdeps_cl_workaround") + else: + tc = AutotoolsDeps(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)) + 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("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.vars(self).save_script("conanbuild_msvc") + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + autotools.configure() + if not self.options.tools: + save(self, os.path.join(self.build_folder, "tools", "Makefile"), "all:\n\t\ninstall:\n\t\n") + # Unnecessary and breaks MSVC build + save(self, os.path.join(self.build_folder, "man", "Makefile"), "all:\n\t\ninstall:\n\t\n") + 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")) + rmdir(self, os.path.join(self.package_folder, "share")) + fix_apple_shared_install_name(self) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "datrie.dll.lib"), + os.path.join(self.package_folder, "lib", "datrie.lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "datrie-0.2") + self.cpp_info.libs = ["datrie"] diff --git a/recipes/libdatrie/all/patches/fix-exports.patch b/recipes/libdatrie/all/patches/fix-exports.patch new file mode 100644 index 0000000000000..70886973e7745 --- /dev/null +++ b/recipes/libdatrie/all/patches/fix-exports.patch @@ -0,0 +1,7 @@ +--- datrie/libdatrie.def ++++ datrie/libdatrie.def +@@ -1,3 +1,4 @@ ++EXPORTS + alpha_map_new + alpha_map_clone + alpha_map_free diff --git a/recipes/libdatrie/all/test_package/CMakeLists.txt b/recipes/libdatrie/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..baf1d9bc4e755 --- /dev/null +++ b/recipes/libdatrie/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(libdatrie REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libdatrie::libdatrie) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/libdatrie/all/test_package/conanfile.py b/recipes/libdatrie/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/libdatrie/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/libdatrie/all/test_package/test_package.c b/recipes/libdatrie/all/test_package/test_package.c new file mode 100644 index 0000000000000..683c115b1b56f --- /dev/null +++ b/recipes/libdatrie/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include + +int main(void) { + AlphaMap *en_map = alpha_map_new(); + if (!en_map) + return 1; + if (alpha_map_add_range(en_map, 0x0061, 0x007a) != 0) + return 1; + Trie *test_trie = trie_new(en_map); + if (!test_trie) + return 1; + trie_free(test_trie); + alpha_map_free(en_map); + return 0; +} diff --git a/recipes/libdatrie/config.yml b/recipes/libdatrie/config.yml new file mode 100644 index 0000000000000..58b2f36b9fab3 --- /dev/null +++ b/recipes/libdatrie/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.13": + folder: all diff --git a/recipes/libdb/all/test_v1_package/CMakeLists.txt b/recipes/libdb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b9027a80ab6af..0000000000000 --- a/recipes/libdb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index d919133e5c230..0000000000000 --- a/recipes/libdb/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/test_package/CMakeLists.txt b/recipes/libdc1394/all/test_package/CMakeLists.txt index 97fa5a2906309..8fbe5e278fcfb 100644 --- a/recipes/libdc1394/all/test_package/CMakeLists.txt +++ b/recipes/libdc1394/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(libdc1394 REQUIRED CONFIG) diff --git a/recipes/libdc1394/all/test_v1_package/CMakeLists.txt b/recipes/libdc1394/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libdc1394/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libdc1394/all/test_v1_package/conanfile.py b/recipes/libdc1394/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libdc1394/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_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/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 d9b1262d06c1f..3dd8fd65fd529 100644 --- a/recipes/libde265/all/conandata.yml +++ b/recipes/libde265/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/libde265/all/test_package/CMakeLists.txt b/recipes/libde265/all/test_package/CMakeLists.txt index 51ad6d4f5df34..f95a3a1eadd39 100644 --- a/recipes/libde265/all/test_package/CMakeLists.txt +++ b/recipes/libde265/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(libde265 REQUIRED CONFIG) diff --git a/recipes/libde265/all/test_v1_package/CMakeLists.txt b/recipes/libde265/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libde265/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libde265/all/test_v1_package/conanfile.py b/recipes/libde265/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libde265/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_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/libde265/config.yml b/recipes/libde265/config.yml index 2745db31bb6cd..4323cd76505c9 100644 --- a/recipes/libde265/config.yml +++ b/recipes/libde265/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.15": + folder: all "1.0.12": folder: all "1.0.11": diff --git a/recipes/libdeflate/all/conandata.yml b/recipes/libdeflate/all/conandata.yml index 720157d82ac2b..56d0f07fdf9e0 100644 --- a/recipes/libdeflate/all/conandata.yml +++ b/recipes/libdeflate/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.23": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.23.tar.gz" + sha256: "1ab18349b9fb0ce8a0ca4116bded725be7dcbfa709e19f6f983d99df1fb8b25f" + "1.22": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.22.tar.gz" + sha256: "7f343c7bf2ba46e774d8a632bf073235e1fd27723ef0a12a90f8947b7fe851d6" + "1.21": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.21.tar.gz" + sha256: "50827d312c0413fbd41b0628590cd54d9ad7ebf88360cba7c0e70027942dbd01" + "1.20": + url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.20.tar.gz" + sha256: "ed1454166ced78913ff3809870a4005b7170a6fd30767dc478a09b96847b9c2a" "1.19": url: "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.19.tar.gz" sha256: "27bf62d71cd64728ff43a9feb92f2ac2f2bf748986d856133cc1e51992428c25" diff --git a/recipes/libdeflate/all/test_package/CMakeLists.txt b/recipes/libdeflate/all/test_package/CMakeLists.txt index ba0dfeb9e192f..925319d44bba0 100644 --- a/recipes/libdeflate/all/test_package/CMakeLists.txt +++ b/recipes/libdeflate/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(libdeflate REQUIRED CONFIG) diff --git a/recipes/libdeflate/all/test_v1_package/CMakeLists.txt b/recipes/libdeflate/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libdeflate/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libdeflate/all/test_v1_package/conanfile.py b/recipes/libdeflate/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libdeflate/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_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/libdeflate/config.yml b/recipes/libdeflate/config.yml index fe3db2bc74050..bdaf60b736505 100644 --- a/recipes/libdeflate/config.yml +++ b/recipes/libdeflate/config.yml @@ -1,4 +1,12 @@ versions: + "1.23": + folder: "all" + "1.22": + folder: "all" + "1.21": + folder: "all" + "1.20": + folder: "all" "1.19": folder: "all" "1.18": diff --git a/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt b/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt index 4fdc2b4814ab3..5c3a0da99402d 100644 --- a/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt +++ b/recipes/libdeflate/pre_1.15/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(libdeflate REQUIRED CONFIG) diff --git a/recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt b/recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libdeflate/pre_1.15/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libdeflate/pre_1.15/test_v1_package/conanfile.py b/recipes/libdeflate/pre_1.15/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libdeflate/pre_1.15/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_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/libdisasm/all/test_package/CMakeLists.txt b/recipes/libdisasm/all/test_package/CMakeLists.txt index d243e526c276c..b9e57eceb94a7 100644 --- a/recipes/libdisasm/all/test_package/CMakeLists.txt +++ b/recipes/libdisasm/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(libdisasm REQUIRED CONFIG) diff --git a/recipes/libdisasm/all/test_v1_package/CMakeLists.txt b/recipes/libdisasm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libdisasm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libdisasm/all/test_v1_package/conanfile.py b/recipes/libdisasm/all/test_v1_package/conanfile.py deleted file mode 100644 index 1381fb8880ef2..0000000000000 --- a/recipes/libdisasm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - - if self.settings.os != "Windows": - self.run("x86dis -h", run_environment=True) diff --git a/recipes/libdispatch/all/test_v1_package/CMakeLists.txt b/recipes/libdispatch/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libdispatch/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index b6f313836cc05..0000000000000 --- a/recipes/libdispatch/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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 index 916fa487be227..8019b0f27fc6e 100644 --- a/recipes/libdisplay-info/all/conandata.yml +++ b/recipes/libdisplay-info/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.0": + url: "https://gitlab.freedesktop.org/emersion/libdisplay-info/-/archive/0.2.0/libdisplay-info-0.2.0.tar.bz2" + sha256: "f6cf2ddbba3753ae38de5113d1fcb8fab977dfaf5fb07b38cd68d8482765e208" "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 index 4bb6e6e322b36..45fbfde532ed8 100644 --- a/recipes/libdisplay-info/all/conanfile.py +++ b/recipes/libdisplay-info/all/conanfile.py @@ -9,12 +9,12 @@ import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0.9" class LibdisplayInfoConan(ConanFile): name = "libdisplay-info" - description = "EDID and DisplayID library." + description = "EDID and DisplayID library" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.freedesktop.org/emersion/libdisplay-info" @@ -29,14 +29,7 @@ class LibdisplayInfoConan(ConanFile): "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 + implements = ["auto_shared_fpic"] def configure(self): if self.options.shared: @@ -47,35 +40,31 @@ def configure(self): 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") + self.tool_requires("hwdata/0.376") + self.tool_requires("meson/[>=1.2.3 <2]") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") 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 cross_building(self): + # https://mesonbuild.com/Builtin-options.html#specifying-options-per-machine 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.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')") diff --git a/recipes/libdisplay-info/config.yml b/recipes/libdisplay-info/config.yml index b893ff21f7c23..cc2bbccb73a1b 100644 --- a/recipes/libdisplay-info/config.yml +++ b/recipes/libdisplay-info/config.yml @@ -1,3 +1,5 @@ versions: + "0.2.0": + folder: all "0.1.1": folder: all diff --git a/recipes/libdivide/all/conandata.yml b/recipes/libdivide/all/conandata.yml index 6b1811615bec8..1cbb0260b35e7 100644 --- a/recipes/libdivide/all/conandata.yml +++ b/recipes/libdivide/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.1": + url: "https://github.com/ridiculousfish/libdivide/archive/refs/tags/v5.1.tar.gz" + sha256: "fec2e4141878c58eb92cfcd478accc3b7f34b39491c1e638566f083d378cc7d4" "5.0": url: "https://github.com/ridiculousfish/libdivide/archive/refs/tags/5.0.tar.gz" sha256: "01ffdf90bc475e42170741d381eb9cfb631d9d7ddac7337368bcd80df8c98356" diff --git a/recipes/libdivide/all/test_v1_package/CMakeLists.txt b/recipes/libdivide/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libdivide/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 0eee35d285cde..0000000000000 --- a/recipes/libdivide/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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.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 deleted file mode 100644 index dc8a5151154fd..0000000000000 --- a/recipes/libdivide/all/test_v1_package/test_package.c +++ /dev/null @@ -1,12 +0,0 @@ -#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/libdivide/config.yml b/recipes/libdivide/config.yml index c374cc0645132..042bc67b62f0b 100644 --- a/recipes/libdivide/config.yml +++ b/recipes/libdivide/config.yml @@ -1,4 +1,6 @@ versions: + "5.1": + folder: all "5.0": folder: all "3.0": diff --git a/recipes/libdmtx/all/conandata.yml b/recipes/libdmtx/all/conandata.yml index bf0c94a4bc46b..620ffd08cef2b 100644 --- a/recipes/libdmtx/all/conandata.yml +++ b/recipes/libdmtx/all/conandata.yml @@ -1,12 +1,4 @@ sources: - "0.7.7": - url: "https://github.com/dmtx/libdmtx/archive/refs/tags/v0.7.7.tar.gz" - sha256: "7aa62adcefdd6e24bdabeb82b3ce41a8d35f4a0c95ab0c4438206aecafd6e1a1" -patches: - "0.7.7": - - patch_file: "patches/0001-0.7.7-fix-version.patch" - patch_description: "update version in CMakeLists.txt" - patch_type: "conan" - - patch_file: "patches/0002-0.7.7-add-install.patch" - patch_description: "add install command to CMakeLists.txt" - patch_type: "conan" + "0.7.8": + url: "https://github.com/dmtx/libdmtx/archive/refs/tags/v0.7.8.tar.gz" + sha256: "2394bf1d1d693a5a4ca3cfcc1bb28a4d878bdb831ea9ca8f3d5c995d274bdc39" diff --git a/recipes/libdmtx/all/conanfile.py b/recipes/libdmtx/all/conanfile.py index 3f81f847317dd..77a584c912d34 100644 --- a/recipes/libdmtx/all/conanfile.py +++ b/recipes/libdmtx/all/conanfile.py @@ -1,15 +1,10 @@ from conan import ConanFile -from conan.tools.files import ( - apply_conandata_patches, - export_conandata_patches, - get, - copy, -) +from conan.tools.files import copy, get from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4.0" # for attribute languages class libdmtxConan(ConanFile): @@ -31,19 +26,8 @@ class libdmtxConan(ConanFile): "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") + languages = ["C"] + implements = ["auto_shared_fpic"] def layout(self): cmake_layout(self, src_folder="src") @@ -59,10 +43,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + tc.variables["DMTX_SHARED"] = bool(self.options.shared) + tc.variables["DMTX_STATIC"] = not bool(self.options.shared) tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/libdmtx/all/patches/0001-0.7.7-fix-version.patch b/recipes/libdmtx/all/patches/0001-0.7.7-fix-version.patch deleted file mode 100644 index 1e9681706bf43..0000000000000 --- a/recipes/libdmtx/all/patches/0001-0.7.7-fix-version.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6420a81..a98e68f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,5 +1,5 @@ - cmake_minimum_required(VERSION 3.0) --project(DMTX VERSION 0.7.5 LANGUAGES C) -+project(DMTX VERSION 0.7.7 LANGUAGES C) - - # DMTX library - option(DMTX_SHARED "Build DMTX as shared library" ${BUILD_SHARED_LIBS}) diff --git a/recipes/libdmtx/all/patches/0002-0.7.7-add-install.patch b/recipes/libdmtx/all/patches/0002-0.7.7-add-install.patch deleted file mode 100644 index 3e2bff94dbde1..0000000000000 --- a/recipes/libdmtx/all/patches/0002-0.7.7-add-install.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a98e68f..0531d40 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -19,6 +19,9 @@ else() - target_link_libraries(dmtx PUBLIC -lm) - endif() - -+set_target_properties(dmtx PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/dmtx.h") -+install(TARGETS dmtx LIBRARY ARCHIVE RUNTIME PUBLIC_HEADER) -+ - # Add tests if DMTX is the main project - if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) - include(CTest) diff --git a/recipes/libdmtx/all/test_package/CMakeLists.txt b/recipes/libdmtx/all/test_package/CMakeLists.txt index bfac09c051b74..b83f6dfbfa4a1 100644 --- a/recipes/libdmtx/all/test_package/CMakeLists.txt +++ b/recipes/libdmtx/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) diff --git a/recipes/libdmtx/all/test_v1_package/CMakeLists.txt b/recipes/libdmtx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/libdmtx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libdmtx/all/test_v1_package/conanfile.py b/recipes/libdmtx/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libdmtx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libdmtx/config.yml b/recipes/libdmtx/config.yml index 356debf98276f..e972751d4fb03 100644 --- a/recipes/libdmtx/config.yml +++ b/recipes/libdmtx/config.yml @@ -1,3 +1,3 @@ versions: - "0.7.7": + "0.7.8": folder: all diff --git a/recipes/libdrawille/all/test_package/CMakeLists.txt b/recipes/libdrawille/all/test_package/CMakeLists.txt index c756c82332027..5ad22a9763d93 100644 --- a/recipes/libdrawille/all/test_package/CMakeLists.txt +++ b/recipes/libdrawille/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 C) find_package(libdrawille REQUIRED CONFIG) diff --git a/recipes/libdrawille/all/test_v1_package/CMakeLists.txt b/recipes/libdrawille/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libdrawille/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libdrawille/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libdrm/all/conandata.yml b/recipes/libdrm/all/conandata.yml index c664ae449755d..dda036871e416 100644 --- a/recipes/libdrm/all/conandata.yml +++ b/recipes/libdrm/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.4.124": + url: "https://dri.freedesktop.org/libdrm/libdrm-2.4.124.tar.xz" + sha256: "ac36293f61ca4aafaf4b16a2a7afff312aa4f5c37c9fbd797de9e3c0863ca379" + "2.4.120": + url: "https://dri.freedesktop.org/libdrm/libdrm-2.4.120.tar.xz" + sha256: "3bf55363f76c7250946441ab51d3a6cc0ae518055c0ff017324ab76cdefb327a" + "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 af355e6b5b875..e1ee2c60d2583 100644 --- a/recipes/libdrm/all/conanfile.py +++ b/recipes/libdrm/all/conanfile.py @@ -9,7 +9,7 @@ from conan.tools.meson import MesonToolchain, Meson from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class LibdrmConan(ConanFile): @@ -80,7 +80,7 @@ def layout(self): def requirements(self): if self.options.intel: self.requires("libpciaccess/0.17") - if self.settings.os in ["Linux", "FreeBSD"]: + if self.settings.os == "Linux": self.requires("linux-headers-generic/6.5.9") def validate(self): @@ -88,9 +88,9 @@ def validate(self): raise ConanInvalidConfiguration("libdrm supports only Linux or FreeBSD") def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/[>=1.4.0 <2]") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.1.0") + self.tool_requires("pkgconf/[>=2.2.0 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -116,8 +116,9 @@ def generate(self): else: tc.project_options[o] = "true" if getattr(self.options, o) else "false" - tc.project_options["datadir"] = os.path.join(self.package_folder, "res") - tc.project_options["mandir"] = os.path.join(self.package_folder, "res", "man") + tc.project_options["datadir"] = "res" + tc.project_options["mandir"] = os.path.join("res", "man") + tc.project_options["man-pages"] = "disabled" if Version(self.version) >= "2.4.113" else "false" tc.generate() def build(self): @@ -139,7 +140,7 @@ 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"].set_property("pkg_config_name", "libdrm") - if self.settings.os in ["Linux", "FreeBSD"]: + if self.settings.os == "Linux": self.cpp_info.components["libdrm_libdrm"].requires = ["linux-headers-generic::linux-headers-generic"] if Version(self.version) < "2.4.111": diff --git a/recipes/libdrm/all/test_v1_package/CMakeLists.txt b/recipes/libdrm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libdrm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 994065a757445..0000000000000 --- a/recipes/libdrm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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..c1ab3533da5e2 100644 --- a/recipes/libdrm/config.yml +++ b/recipes/libdrm/config.yml @@ -1,4 +1,10 @@ versions: + "2.4.124": + folder: all + "2.4.120": + folder: all + "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 6abc97da6d65a..354c870c1b86a 100644 --- a/recipes/libdwarf/all/conandata.yml +++ b/recipes/libdwarf/all/conandata.yml @@ -1,36 +1,44 @@ sources: + "0.11.1": + url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.11.1.tar.gz" + sha256: "dfd24db87c354b3ba6fa72d29a481014f81768fea15ddcde96a8a938b1557c17" + "0.11.0": + url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.11.0.tar.gz" + sha256: "5135af38dc202206538a3dcdc90675aa8b320e132156849c6855dea5ea0c0729" + "0.10.1": + url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.10.1.tar.gz" + sha256: "4ab8ae7b4b7aa42453725054b348f4fdb2460d5ba644199a1305311c718ff416" + "0.9.2": + url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.9.2.tar.gz" + sha256: "5371c68248c16a4a9cb071284c87c0cdb8f560d5277e0b86893fdc6576062f95" + "0.9.1": + url: "https://github.com/davea42/libdwarf-code/archive/refs/tags/v0.9.1.tar.gz" + sha256: "6da3f46a9f92b4e284c97c733851879d9b91b16642bede90c7614860a946824e" "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" - "20191104": - 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" + "0.11.1": + - patch_file: "patches/0.9.2-0001-fixes.patch" + patch_description: "fix DW_API definition" + patch_type: "portability" + "0.11.0": + - patch_file: "patches/0.9.2-0001-fixes.patch" + patch_description: "fix DW_API definition" 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" + "0.10.1": + - patch_file: "patches/0.9.2-0001-fixes.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" - patch_type: "conan" - - patch_file: "patches/0.5.0-0001-fix-DW_API.patch" + "0.9.2": + - patch_file: "patches/0.9.2-0001-fixes.patch" patch_description: "fix DW_API definition" patch_type: "portability" - "20191104": - - patch_file: "patches/20191104-0001-patch.patch" - patch_description: "use cci package, remove lib64/bin64 install folders" - patch_type: "conan" + "0.9.1": + - patch_file: "patches/0.9.1-0001-fixes.patch" + patch_description: "fix DW_API definition and cmake" + patch_type: "portability" + "0.8.0": + - patch_file: "patches/0.8.0-0001-fixes.patch" + patch_description: "fix DW_API definition and cmake" + patch_type: "portability" diff --git a/recipes/libdwarf/all/conanfile.py b/recipes/libdwarf/all/conanfile.py index 0149255b7e4f0..300ba2f4465ff 100644 --- a/recipes/libdwarf/all/conanfile.py +++ b/recipes/libdwarf/all/conanfile.py @@ -1,15 +1,17 @@ +import os + from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, rename from conan.tools.build import cross_building from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -import os +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, rename +from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class LibdwarfConan(ConanFile): name = "libdwarf" description = "A library and a set of command-line tools for reading and writing DWARF2" - license = ("LGPL-2.1-only", "BSD-2-Clause-Views") + license = ("LGPL-2.1-only", "BSD-2-Clause-Views", "GPL-2.0-only") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.prevanders.net/dwarf.html" topics = ("debug", "dwarf", "dwarf2", "elf") @@ -20,11 +22,13 @@ class LibdwarfConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_dwarfgen": [True, False], + "with_dwarfdump": [True, False], } default_options = { "shared": False, "fPIC": True, "with_dwarfgen": False, + "with_dwarfdump": False, } def export_sources(self): @@ -41,15 +45,17 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") if not self.options.with_dwarfgen: - self.license = "LGPL-2.1-only" + self.license = (l for l in self.license if l != "BSD-2-Clause-Views") + if not self.options.with_dwarfdump: + self.license = (l for l in self.license if l != "GPL-2.0-only") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if self.options.with_dwarfgen or self.version == "20191104": - self.requires("libelf/0.8.13") self.requires("zlib/[>=1.2.11 <2]") + if Version(self.version) >= Version("0.9.0"): + self.requires("zstd/[~1.5]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -60,49 +66,46 @@ def generate(self): tc.variables["BUILD_NON_SHARED"] = not self.options.shared tc.variables["BUILD_SHARED"] = self.options.shared tc.variables["BUILD_DWARFGEN"] = self.options.with_dwarfgen + tc.variables["BUILD_DWARFDUMP"] = self.options.with_dwarfdump tc.variables["BUILD_DWARFEXAMPLE"] = False if cross_building(self): tc.variables["HAVE_UNUSED_ATTRIBUTE_EXITCODE"] = "0" tc.variables["HAVE_UNUSED_ATTRIBUTE_EXITCODE__TRYRUN_OUTPUT"] = "" + if Version(self.version) < "0.9.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() dpes = CMakeDeps(self) dpes.generate() def build(self): - apply_conandata_patches(self) + # Headers patches only makes sense for Windows, and CMake ones + # were solved since https://github.com/davea42/libdwarf-code/commit/6ffd41d39ba8e5db8651a35ac4f975baf786de4c (v0.9.2) + if Version(self.version) < "0.9.2" or self.settings.os == "Windows": + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() def package(self): - if self.version == "20191104": - copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "libdwarf")) - rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-libdwarf")) - if self.options.with_dwarfgen: - copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "dwarfgen")) - rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-dwarfgen")) - copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - else: - copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "src", "lib", "libdwarf")) - rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-libdwarf")) - if self.options.with_dwarfgen: - copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "src", "bin", "dwarfgen")) - rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-dwarfgen")) - copy(self, pattern="COPYING", 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=os.path.join(self.source_folder, "src", "lib", "libdwarf")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-libdwarf")) + if self.options.with_dwarfgen: + copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "src", "bin", "dwarfgen")) + rename(self, os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "COPYING-dwarfgen")) + if self.options.with_dwarfdump: + copy(self, pattern="GPL.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "src", "bin", "dwarfdump")) + rename(self, os.path.join(self.package_folder, "licenses", "GPL.txt"), os.path.join(self.package_folder, "licenses", "COPYING-dwarfdump")) + 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", "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.libs = ["dwarf"] if self.options.with_dwarfgen: - bindir = os.path.join(self.package_folder, "bin") - self.output.info(f'Appending PATH environment variable: {bindir}') - 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-DW_API.patch b/recipes/libdwarf/all/patches/0.5.0-0001-fix-DW_API.patch deleted file mode 100644 index 09c3ab0c030c1..0000000000000 --- a/recipes/libdwarf/all/patches/0.5.0-0001-fix-DW_API.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/lib/libdwarf/libdwarf.h b/src/lib/libdwarf/libdwarf.h -index 9a59eb1..fa5e68e 100644 ---- a/src/lib/libdwarf/libdwarf.h -+++ b/src/lib/libdwarf/libdwarf.h -@@ -50,7 +50,7 @@ - #undef DW_API - #endif /* DW_API */ - --#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/patches/0.5.0-0001-fix-cmake.patch b/recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch deleted file mode 100644 index cd8664d42f3dc..0000000000000 --- a/recipes/libdwarf/all/patches/0.5.0-0001-fix-cmake.patch +++ /dev/null @@ -1,115 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4f58f43..69e0238 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -129,6 +129,7 @@ check_include_file( "libelf/libelf.h" HAVE_LIBELF_LIBELF_H) - - ### cmake provides no way to guarantee uint32_t present. - ### configure does guarantee that. -+find_package(libelf) - if(HAVE_STDINT_H) - check_c_source_compiles(" - #include -@@ -192,7 +193,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 +218,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 +366,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 +388,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 f6f5376..22c5977 100644 ---- a/src/bin/dwarfdump/CMakeLists.txt -+++ b/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 a/src/bin/dwarfgen/CMakeLists.txt b/src/bin/dwarfgen/CMakeLists.txt -index 5c2c192..fc3428e 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 0b7d578..62b67da 100644 ---- a/src/lib/libdwarf/CMakeLists.txt -+++ b/src/lib/libdwarf/CMakeLists.txt -@@ -67,7 +67,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() -@@ -85,13 +85,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}) - -@@ -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 deleted file mode 100644 index bb0a859d8fd82..0000000000000 --- a/recipes/libdwarf/all/patches/0.7.0-0001-fix-cmake.patch +++ /dev/null @@ -1,128 +0,0 @@ -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.9.1-0001-fixes.patch b/recipes/libdwarf/all/patches/0.9.1-0001-fixes.patch new file mode 100644 index 0000000000000..c7952f7107937 --- /dev/null +++ b/recipes/libdwarf/all/patches/0.9.1-0001-fixes.patch @@ -0,0 +1,86 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 70839abd..972a2b9e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -188,14 +188,20 @@ if (ENABLE_DECOMPRESSION) + find_package(ZLIB) + endif() + if(NOT TARGET ZSTD::ZSTD) +- find_package(ZSTD) ++ find_package(zstd) + endif() +- if (ZLIB_FOUND AND ZSTD_FOUND ) ++ if (ZLIB_FOUND AND zstd_FOUND ) + set(HAVE_ZLIB TRUE) + set(HAVE_ZLIB_H TRUE) + set(HAVE_ZSTD TRUE) + set(HAVE_ZSTD_H TRUE) + endif() ++ find_package(zstd CONFIG REQUIRED) ++ if(TARGET zstd::libzstd_shared) ++ set(ZSTD_LIB zstd::libzstd_shared) ++ else() ++ set(ZSTD_LIB zstd::libzstd_static) ++ endif() + endif () + + message(STATUS "CMAKE_SIZEOF_VOID_P ... " ${CMAKE_SIZEOF_VOID_P} ) +diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt +index 7500c9f4..ce1461fb 100644 +--- a/src/lib/libdwarf/CMakeLists.txt ++++ b/src/lib/libdwarf/CMakeLists.txt +@@ -104,8 +104,8 @@ target_include_directories(dwarf PUBLIC + $ + $ + ) +-if(ZLIB_FOUND AND ZSTD_FOUND) +- target_link_libraries(dwarf PRIVATE ZLIB::ZLIB ZSTD::ZSTD ) ++if(ZLIB_FOUND AND zstd_FOUND) ++ target_link_libraries(dwarf PRIVATE ZLIB::ZLIB ${ZSTD_LIB} ) + endif() + set_target_properties(dwarf PROPERTIES PUBLIC_HEADER "libdwarf.h;dwarf.h") + +@@ -116,7 +116,7 @@ install(TARGETS dwarf + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) + +-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 +@@ -131,4 +131,4 @@ install(EXPORT libdwarfTargets + NAMESPACE libdwarf:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libdwarf") + install(FILES cmake/libdwarf-config.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libdwarf") +-install(FILES "${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") ++# install(FILES "${PROJECT_BINARY_DIR}/src/lib/libdwarf/libdwarf.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +diff --git a/src/lib/libdwarf/libdwarf.h b/src/lib/libdwarf/libdwarf.h +index 380d2ef7..8c62ee7e 100644 +--- a/src/lib/libdwarf/libdwarf.h ++++ b/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/src/lib/libdwarf/libdwarf_private.h b/src/lib/libdwarf/libdwarf_private.h +index b37ae994..7fa89256 100644 +--- a/src/lib/libdwarf/libdwarf_private.h ++++ b/src/lib/libdwarf/libdwarf_private.h +@@ -26,11 +26,7 @@ + #ifdef _MSC_VER /* Macro to select VS compiler */ + #include + typedef SSIZE_T ssize_t; +-#ifdef _WIN64 +-typedef long long off_t; +-#else + typedef long off_t; +-#endif + #endif /* _MSC_VER */ + + #ifndef TRUE diff --git a/recipes/libdwarf/all/patches/0.9.2-0001-fixes.patch b/recipes/libdwarf/all/patches/0.9.2-0001-fixes.patch new file mode 100644 index 0000000000000..0443dbf688864 --- /dev/null +++ b/recipes/libdwarf/all/patches/0.9.2-0001-fixes.patch @@ -0,0 +1,29 @@ +diff --git a/src/lib/libdwarf/libdwarf.h b/src/lib/libdwarf/libdwarf.h +index 380d2ef7..8c62ee7e 100644 +--- a/src/lib/libdwarf/libdwarf.h ++++ b/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/src/lib/libdwarf/libdwarf_private.h b/src/lib/libdwarf/libdwarf_private.h +index b37ae994..7fa89256 100644 +--- a/src/lib/libdwarf/libdwarf_private.h ++++ b/src/lib/libdwarf/libdwarf_private.h +@@ -26,11 +26,7 @@ + #ifdef _MSC_VER /* Macro to select VS compiler */ + #include + typedef SSIZE_T ssize_t; +-#ifdef _WIN64 +-typedef long long off_t; +-#else + typedef long off_t; +-#endif + #endif /* _MSC_VER */ + + #ifndef TRUE diff --git a/recipes/libdwarf/all/patches/20191104-0001-patch.patch b/recipes/libdwarf/all/patches/20191104-0001-patch.patch deleted file mode 100644 index aadcac9dfe8fd..0000000000000 --- a/recipes/libdwarf/all/patches/20191104-0001-patch.patch +++ /dev/null @@ -1,178 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2607e56..3ca4ac5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -73,9 +73,9 @@ check_include_file( "unistd.h" HAVE_UNISTD_H ) - check_include_file( "sgidefs.h" HAVE_SGIDEFS_H ) - check_include_file( "stdafx.h" HAVE_STDAFX_H ) - check_include_file( "Windows.h" HAVE_WINDOWS_H ) --check_include_file( "elf.h" HAVE_ELF_H ) --check_include_file( "libelf.h" HAVE_LIBELF_H ) --check_include_file( "libelf/libelf.h" HAVE_LIBELF_LIBELF_H) -+set(HAVE_ELF_H FALSE) -+set(HAVE_LIBELF_H FALSE) -+set(HAVE_LIBELF_LIBELF_H TRUE) - check_include_file( "alloca.h" HAVE_ALLOCA_H ) - check_include_file( "elfaccess.h" HAVE_ELFACCESS_H) - check_include_file( "sys/elf_386.h" HAVE_SYS_ELF_386_H ) -@@ -128,6 +128,8 @@ endif() - # It's not really setting the location of libelfheader, - # it is really # either elf.h, or if that is missing - # it is assuming elf.h data is in the supplied libelf. -+find_package(libelf REQUIRED CONFIG) -+find_package(ZLIB REQUIRED CONFIG) - - if(HAVE_ELF_H) - set(HAVE_LOCATION_OF_LIBELFHEADER "") -@@ -146,12 +148,13 @@ elseif(HAVE_LIBELF_LIBELF_H) - endif() - - if (HAVE_LIBELF_H OR HAVE_LIBELF_LIBELF_H) -- set (CMAKE_REQUIRED_LIBRARIES elf) -+ 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") - check_symbol_exists( elf64_getshdr ${PLAIN_JUST_LIBELF} HAVE_ELF64_GETSHDR) - set (CMAKE_REQUIRED_LIBRARIES) -+ set (CMAKE_REQUIRED_DEFINITIONS) - endif() - - option(DWARF_WITH_LIBELF "Use libelf (default is YES)" TRUE) -@@ -166,6 +169,9 @@ if (DWARF_WITH_LIBELF) - message(STATUS "checking using HAVE_ELF_H ... ${HAVE_ELF_H}") - message(STATUS "checking using elf header ... ${HAVE_LOCATION_OF_LIBELFHEADER}") - message(STATUS "checking using libelf header ... ${JUST_LIBELF}") -+ -+ set (CMAKE_REQUIRED_DEFINITIONS -D__LIBELF64=1) -+ - check_c_source_compiles(" - #include ${HAVE_LOCATION_OF_LIBELFHEADER} - int main() -@@ -202,7 +208,7 @@ if (DWARF_WITH_LIBELF) - # to set HAVE_LIBELF_OFF64_OK at present. - check_c_source_compiles(" - #define _GNU_SOURCE 1 -- #include ${JUST_LIBELF} -+ #include <${JUST_LIBELF}> - int main() - { - off64_t p; p = 0; -@@ -210,7 +216,7 @@ if (DWARF_WITH_LIBELF) - }" HAVE_LIBELF_OFF64_OK) - - check_c_source_compiles(" -- #include ${JUST_LIBELF} -+ #include <${JUST_LIBELF}> - /* This must be at global scope */ - struct _Elf; - typedef struct _Elf Elf; -@@ -220,6 +226,10 @@ if (DWARF_WITH_LIBELF) - int i = 12; - return 0; - }" HAVE_STRUCT_UNDERSCORE_ELF) -+ -+ set (CMAKE_REQUIRED_LIBRARIES) -+ set (CMAKE_REQUIRED_DEFINITIONS) -+ - endif() - message(STATUS "Assuming struct Elf for the default libdwarf.h") - # Because cmake treats ; in an interesting way attempting -@@ -378,10 +388,9 @@ message(STATUS "Checking producer generates only 32bit... ${HAVE_STRICT_DWARF2_3 - - - # This references cmake/FindLibElf.cmake. See cmake documentation. --find_package(LibElf REQUIRED) - list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBELF_INCLUDE_DIRS}) - --configure_file(config.h.in.cmake config.h) -+configure_file(${CMAKE_SOURCE_DIR}/config.h.in.cmake ${CMAKE_BINARY_DIR}/config.h) - - if(BUILD_NON_SHARED) - set(DWARF_TARGETS dwarf-static) -@@ -395,7 +404,6 @@ if(BUILD_SHARED) - endif() - - add_subdirectory(libdwarf) --add_subdirectory(dwarfdump) - if ( BUILD_DWARFGEN ) - if ( DWARF_WITH_LIBELF ) - add_subdirectory(dwarfgen) -diff --git a/dwarfdump/CMakeLists.txt b/dwarfdump/CMakeLists.txt -index b94f6c8..6bdb57f 100644 ---- a/dwarfdump/CMakeLists.txt -+++ b/dwarfdump/CMakeLists.txt -@@ -31,7 +31,7 @@ set_source_group(CONFIGURATION_FILES "Configuration Files" - ${CMAKE_SOURCE_DIR}/config.h.in.cmake - ${CMAKE_BINARY_DIR}/config.h) - --add_executable(dwarfdump ${SOURCES} ${HEADERS} ${CONFIGURATION_FILES}) -+add_executable(dwarfdump ${SOURCES} ${HEADERS} ${CONFIGURATION_FILES} ${libelf_LIBRARIES}) - - set_folder(dwarfdump dwarfdump) - -diff --git a/dwarfgen/CMakeLists.txt b/dwarfgen/CMakeLists.txt -index 488b820..5bde9eb 100644 ---- a/dwarfgen/CMakeLists.txt -+++ b/dwarfgen/CMakeLists.txt -@@ -20,16 +20,16 @@ set_folder(dwarfgen dwarfgen) - - target_compile_options(dwarfgen PRIVATE ${DW_FWALLXX}) - --target_link_libraries(dwarfgen PRIVATE ${dwarf-target} ${DW_FZLIB}) -+target_link_libraries(dwarfgen PRIVATE ${dwarf-target} ${DW_FZLIB} ${libelf_LIBRARIES}) - - set(SUFFIX $<$:64>) - set(LIBDIR lib${SUFFIX}) - set(BINDIR bin${SUFFIX}) - - install(TARGETS dwarfgen DESTINATION -- RUNTIME DESTINATION ${BINDIR} -- LIBRARY DESTINATION ${LIBDIR} -- ARCHIVE DESTINATION ${LIBDIR}) -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) - - #install(FILES dwarfgen.conf DESTINATION lib) - -diff --git a/libdwarf/CMakeLists.txt b/libdwarf/CMakeLists.txt -index c610522..3a69533 100644 ---- a/libdwarf/CMakeLists.txt -+++ b/libdwarf/CMakeLists.txt -@@ -81,12 +81,9 @@ foreach(i RANGE ${targetCount}) - ${GENNAMES_OUTPUT} ${CONFIGURATION_FILES}) - - set_folder(${target} libdwarf) -- target_include_directories(${target} PUBLIC -- ${LIBELF_INCLUDE_DIRS}) -- target_compile_options(${target} PRIVATE ${DW_FWALL}) - msvc_posix(${target}) - -- target_link_libraries(${target} PUBLIC ${LIBELF_LIBRARIES}) -+ target_link_libraries(${target} PUBLIC ${libelf_LIBRARIES} ${ZLIB_LIBRARIES}) - - set_target_properties(${target} PROPERTIES OUTPUT_NAME dwarf) - -@@ -95,15 +92,14 @@ foreach(i RANGE ${targetCount}) - set(BINDIR bin${SUFFIX}) - - install(TARGETS ${target} -- RUNTIME DESTINATION ${BINDIR} -- LIBRARY DESTINATION ${LIBDIR} -- ARCHIVE DESTINATION ${LIBDIR}) -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib) - endforeach() - --if(UNIX AND BUILD_SHARED) -- target_link_libraries(dwarf-shared PUBLIC z) --endif() -- -+install(FILES ${CMAKE_BINARY_DIR}/libdwarf/libdwarf.h DESTINATION include) -+install(FILES dwarf.h DESTINATION include) -+ - if (DO_TESTING) - set_source_group(TESTLEB "Source Files" dwarf_leb_test.c - dwarf_leb.c pro_encode_nm.c ) diff --git a/recipes/libdwarf/all/test_package/CMakeLists.txt b/recipes/libdwarf/all/test_package/CMakeLists.txt index a2fbbf0a474e1..122359e1002f6 100644 --- a/recipes/libdwarf/all/test_package/CMakeLists.txt +++ b/recipes/libdwarf/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(libdwarf REQUIRED) @@ -6,6 +6,6 @@ find_package(libdwarf REQUIRED) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE libdwarf::libdwarf) -if(NOT libdwarf_VERSION MATCHES "^[0-9]*$") - target_compile_definitions(${PROJECT_NAME} PRIVATE "LIBDWARF_NEW_STRUCTURE") +if(${libdwarf_VERSION} VERSION_LESS "0.9.1") + target_compile_definitions(${PROJECT_NAME} PRIVATE "LIBDWARF_NESTED_INCLUDE") endif() diff --git a/recipes/libdwarf/all/test_package/test_package.c b/recipes/libdwarf/all/test_package/test_package.c index 27d0d196b5a8d..287828193ab29 100644 --- a/recipes/libdwarf/all/test_package/test_package.c +++ b/recipes/libdwarf/all/test_package/test_package.c @@ -3,12 +3,12 @@ #include #include -#ifndef LIBDWARF_NEW_STRUCTURE - #include "dwarf.h" - #include "libdwarf.h" -#else +#ifdef LIBDWARF_NESTED_INCLUDE #include "libdwarf/dwarf.h" #include "libdwarf/libdwarf.h" +#else + #include "dwarf.h" + #include "libdwarf.h" #endif void example1(Dwarf_Die somedie) { diff --git a/recipes/libdwarf/all/test_v1_package/CMakeLists.txt b/recipes/libdwarf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/libdwarf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libdwarf/all/test_v1_package/conanfile.py b/recipes/libdwarf/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libdwarf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libdwarf/config.yml b/recipes/libdwarf/config.yml index 2bad80aa2207b..3d5475f8fbd12 100644 --- a/recipes/libdwarf/config.yml +++ b/recipes/libdwarf/config.yml @@ -1,9 +1,13 @@ versions: - "0.8.0": + "0.11.1": + folder: all + "0.11.0": folder: all - "0.7.0": + "0.10.1": folder: all - "0.5.0": + "0.9.2": folder: all - "20191104": + "0.9.1": + folder: all + "0.8.0": folder: all diff --git a/recipes/libdxfrw/all/test_package/CMakeLists.txt b/recipes/libdxfrw/all/test_package/CMakeLists.txt index 3fefb4e7b7d8a..91e8e500daf44 100644 --- a/recipes/libdxfrw/all/test_package/CMakeLists.txt +++ b/recipes/libdxfrw/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(libdxfrw REQUIRED CONFIG) diff --git a/recipes/libdxfrw/all/test_v1_package/CMakeLists.txt b/recipes/libdxfrw/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libdxfrw/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libdxfrw/all/test_v1_package/conanfile.py b/recipes/libdxfrw/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libdxfrw/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libe57format/all/conandata.yml b/recipes/libe57format/all/conandata.yml index 857bfbb53a2a6..a4f26a4bbf818 100644 --- a/recipes/libe57format/all/conandata.yml +++ b/recipes/libe57format/all/conandata.yml @@ -1,13 +1,13 @@ +patches: + "2.3.0": + - patch_file: patches/0001-Fix-gcc13-compilation.patch sources: - "2.2.0": - sha256: "19df04af07925bf43e1793534b0c77cb1346a2bee7746859d2fe1714a24f1c7d" - url: "https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.2.0.tar.gz" + "3.2.0": + url: "https://github.com/asmaloney/libE57Format/archive/refs/tags/v3.2.0.tar.gz" + sha256: "afe4de960ba486760702127d8f3dc537c9b5921af7cfb2a75177fe2f80956e89" + "3.1.1": + url: "https://github.com/asmaloney/libE57Format/archive/refs/tags/v3.1.1.tar.gz" + sha256: "949e73db3cb90ed7d286c49d12c6925813ead8d92ff9b84e0fba17fa015194d0" "2.3.0": - sha256: "124cc8f7dda84e8686ff2bcffc524ee4677eba3183631ec847a5f4a6ea60b254" url: "https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.3.0.tar.gz" -patches: - "2.2.0": - - patch_file: "patches/0001-fix-pic.patch" - - patch_file: "patches/0002-missing-include.patch" - "2.3.0": - - patch_file: "patches/2.3.0-0001-fix-pic.patch" + sha256: "124cc8f7dda84e8686ff2bcffc524ee4677eba3183631ec847a5f4a6ea60b254" diff --git a/recipes/libe57format/all/conanfile.py b/recipes/libe57format/all/conanfile.py index 479e129d3bbf3..acbf38665ce00 100644 --- a/recipes/libe57format/all/conanfile.py +++ b/recipes/libe57format/all/conanfile.py @@ -1,11 +1,14 @@ +import os +import textwrap + 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, save -import os -import textwrap +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save, replace_in_file +from conan.tools.scm import Version -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibE57FormatConan(ConanFile): @@ -16,6 +19,7 @@ class LibE57FormatConan(ConanFile): description = "Library for reading & writing the E57 file format" topics = ("e57", "io", "point-cloud") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,33 +39,47 @@ 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("xerces-c/3.2.3") + self.requires("xerces-c/3.2.5") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "11") + def build_requirements(self): + self.tool_requires("cmake/[>=3.16.3 <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): + venv = VirtualBuildEnv(self) + venv.generate() tc = CMakeToolchain(self) + tc.variables["E57_BUILD_SHARED"] = self.options.shared + tc.variables["E57_BUILD_TEST"] = False tc.variables["USING_STATIC_XERCES"] = not self.dependencies["xerces-c"].options.shared tc.generate() deps = CMakeDeps(self) deps.generate() + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "POSITION_INDEPENDENT_CODE ON", "") + if Version(self.version) >= "3.0": + # Disable compiler warnings, which cause older versions of GCC to fail due to unrecognized flags + replace_in_file(self, os.path.join(self.source_folder, "cmake", "CompilerWarnings.cmake"), + " -W", " # -W") + # Disable warnings as errors + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set_warning_as_error()", "", strict=False) + def build(self): + self._patch_sources() apply_conandata_patches(self) cmake = CMake(self) cmake.configure() diff --git a/recipes/libe57format/all/patches/0001-Fix-gcc13-compilation.patch b/recipes/libe57format/all/patches/0001-Fix-gcc13-compilation.patch new file mode 100644 index 0000000000000..bb0d1489e44c3 --- /dev/null +++ b/recipes/libe57format/all/patches/0001-Fix-gcc13-compilation.patch @@ -0,0 +1,10 @@ +--- a/include/E57Format.h ++++ b/include/E57Format.h +@@ -32,6 +32,7 @@ + //! @file E57Format.h Header file for the E57 API. + + #include ++#include + #include + #include + diff --git a/recipes/libe57format/all/patches/0001-fix-pic.patch b/recipes/libe57format/all/patches/0001-fix-pic.patch deleted file mode 100644 index 76ed8c2509a69..0000000000000 --- a/recipes/libe57format/all/patches/0001-fix-pic.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -104,7 +104,6 @@ - CXX_STANDARD_REQUIRED YES - CXX_EXTENSIONS NO - DEBUG_POSTFIX "-d" -- POSITION_INDEPENDENT_CODE ON - ) - - # Target definitions diff --git a/recipes/libe57format/all/patches/0002-missing-include.patch b/recipes/libe57format/all/patches/0002-missing-include.patch deleted file mode 100644 index 50253b05d6c2a..0000000000000 --- a/recipes/libe57format/all/patches/0002-missing-include.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/E57XmlParser.cpp -+++ b/src/E57XmlParser.cpp -@@ -42,6 +42,8 @@ - #include "StringNodeImpl.h" - #include "VectorNodeImpl.h" - -+#include -+ - using namespace e57; - using namespace XERCES_CPP_NAMESPACE; - diff --git a/recipes/libe57format/all/patches/2.3.0-0001-fix-pic.patch b/recipes/libe57format/all/patches/2.3.0-0001-fix-pic.patch deleted file mode 100644 index a2ecc0de60e33..0000000000000 --- a/recipes/libe57format/all/patches/2.3.0-0001-fix-pic.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -127,7 +127,6 @@ - CXX_STANDARD_REQUIRED YES - CXX_EXTENSIONS NO - DEBUG_POSTFIX "-d" -- POSITION_INDEPENDENT_CODE ON - ) - - # Target definitions diff --git a/recipes/libe57format/all/test_package/CMakeLists.txt b/recipes/libe57format/all/test_package/CMakeLists.txt index b8de16fa4046c..68d7ef2022bfa 100644 --- a/recipes/libe57format/all/test_package/CMakeLists.txt +++ b/recipes/libe57format/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(e57format REQUIRED CONFIG) diff --git a/recipes/libe57format/all/test_v1_package/CMakeLists.txt b/recipes/libe57format/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2bf6344a5bafd..0000000000000 --- a/recipes/libe57format/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(e57format REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE E57Format) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libe57format/all/test_v1_package/conanfile.py b/recipes/libe57format/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libe57format/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_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/libe57format/config.yml b/recipes/libe57format/config.yml index 137671316c059..4c43ffed13b4b 100644 --- a/recipes/libe57format/config.yml +++ b/recipes/libe57format/config.yml @@ -1,5 +1,7 @@ versions: - "2.2.0": + "3.2.0": + folder: all + "3.1.1": folder: all "2.3.0": folder: all diff --git a/recipes/libelf/all/CMakeLists.txt b/recipes/libelf/all/CMakeLists.txt index 272a6d59618a2..e34432763c9a8 100644 --- a/recipes/libelf/all/CMakeLists.txt +++ b/recipes/libelf/all/CMakeLists.txt @@ -1,9 +1,9 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(elf LANGUAGES C) if(EXISTS "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32") file(RENAME "${LIBELF_SRC_DIR}/lib/sys_elf.h.w32" "${LIBELF_SRC_DIR}/lib/sys_elf.h") - file(RENAME "${LIBELF_SRC_DIR}/lib/config.h.w32" "${LIBELF_SRC_DIR}/config.h") + file(RENAME "${LIBELF_SRC_DIR}/lib/config.h.w32" "${LIBELF_SRC_DIR}/lib/config.h") endif() file(GLOB_RECURSE SOURCES "${LIBELF_SRC_DIR}/lib/*.c") @@ -15,7 +15,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE ) target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${LIBELF_SRC_DIR}/lib") -target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_MEMCMP=1 HAVE_MEMCPY=1 HAVE_MEMMOVE=1) +target_compile_definitions(${PROJECT_NAME} PUBLIC HAVE_MEMCMP=1 HAVE_MEMCPY=1 HAVE_MEMMOVE=1 HAVE_CONFIG_H=1) include(GNUInstallDirs) diff --git a/recipes/libelf/all/conanfile.py b/recipes/libelf/all/conanfile.py index c93a47a212b33..860ba5d73ae5a 100644 --- a/recipes/libelf/all/conanfile.py +++ b/recipes/libelf/all/conanfile.py @@ -28,13 +28,9 @@ class LibelfConan(ConanFile): "shared": False, "fPIC": True, } - + deprecated = "elfutils" exports_sources = "CMakeLists.txt" - @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 @@ -58,7 +54,7 @@ def build_requirements(self): if self.settings.os != "Windows": self.tool_requires("autoconf/2.71") self.tool_requires("gnu-config/cci.20210814") - if self._settings_build.os == "Windows": + 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") diff --git a/recipes/libelf/all/test_v1_package/CMakeLists.txt b/recipes/libelf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libelf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libelf/all/test_v1_package/conanfile.py b/recipes/libelf/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libelf/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_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/libelfin/all/test_package/Makefile b/recipes/libelfin/all/test_package/Makefile deleted file mode 100644 index ccf962b53e8bc..0000000000000 --- a/recipes/libelfin/all/test_package/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# From http://timelessname.com/elfbin/ - -hello: hello.asm - nasm -f elf hello.asm - gcc -m32 -s -o hello hello.o -nostartfiles -nostdlib -nodefaultlibs diff --git a/recipes/libelfin/all/test_package/conanfile.py b/recipes/libelfin/all/test_package/conanfile.py index c2a19b9121acf..d7de1f914ce42 100644 --- a/recipes/libelfin/all/test_package/conanfile.py +++ b/recipes/libelfin/all/test_package/conanfile.py @@ -24,5 +24,4 @@ def build(self): def test(self): 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") + self.run(bin_path, env="conanrun") diff --git a/recipes/libelfin/all/test_package/hello b/recipes/libelfin/all/test_package/hello deleted file mode 100644 index 7202f6f7d512e..0000000000000 Binary files a/recipes/libelfin/all/test_package/hello and /dev/null differ diff --git a/recipes/libelfin/all/test_package/hello.asm b/recipes/libelfin/all/test_package/hello.asm deleted file mode 100644 index 0cc26b9d3a4a8..0000000000000 --- a/recipes/libelfin/all/test_package/hello.asm +++ /dev/null @@ -1,16 +0,0 @@ - SECTION .data -msg: db "Hi World",10 -len: equ $-msg - - SECTION .text - global main -main: - mov edx,len - mov ecx,msg - mov ebx,1 - mov eax,4 - int 0x80 - mov ebx,0 - mov eax,1 - int 0x80 - diff --git a/recipes/libelfin/all/test_package/test_package.cpp b/recipes/libelfin/all/test_package/test_package.cpp index 41843df23299f..4cec1bba9e2d9 100644 --- a/recipes/libelfin/all/test_package/test_package.cpp +++ b/recipes/libelfin/all/test_package/test_package.cpp @@ -1,29 +1,8 @@ -#include +#include #include -#include -#include -#include - -int -main(int argc, char** argv) -{ - using elf::to_string; - - int fd = open(argv[1], O_RDONLY); - elf::elf f(elf::create_mmap_loader(fd)); - - auto& hdr = f.get_hdr(); - std::cout << "ELF Header:\n"; - std::cout << " Magic: " << std::hex; - for (auto c : hdr.ei_magic) - std::cout << ' ' << static_cast(c); - std::cout << '\n'; - std::cout << " Class: " << to_string(hdr.ei_class) << '\n'; - std::cout << " Data: " << to_string(hdr.ei_data) << '\n'; - std::cout << " Version: " << static_cast(hdr.ei_version) << '\n'; - std::cout << " OS/ABI: " << to_string(hdr.ei_osabi) << '\n'; - std::cout << " ABI Version: " << static_cast(hdr.ei_abiversion) << '\n'; - std::cout << " Type: " << to_string(hdr.type) << '\n'; +int main() { + elf::pt pt_obj = elf::pt::load; + std::cout << elf::to_string(pt_obj) << std::endl; return 0; } diff --git a/recipes/libelfin/all/test_v1_package/CMakeLists.txt b/recipes/libelfin/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libelfin/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index fe9ecdf1845cc..0000000000000 --- a/recipes/libelfin/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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 index 6d0d3123e3cdf..81f905ac642ae 100644 --- a/recipes/libenvpp/all/conandata.yml +++ b/recipes/libenvpp/all/conandata.yml @@ -1,9 +1,37 @@ sources: + "1.5.0": + url: "https://github.com/ph3at/libenvpp/archive/refs/tags/v1.5.0.tar.gz" + sha256: "5318c43ea7e8197243c77c62f3a60564b0f8d9c46f547bbd01201ba104b76f6b" + "1.4.3": + url: "https://github.com/ph3at/libenvpp/archive/refs/tags/v1.4.3.tar.gz" + sha256: "affbd735b6f47615a54c9159baef9de206cc85badb5af4f662669f3789a13fa8" + "1.4.1": + url: "https://github.com/ph3at/libenvpp/archive/refs/tags/v1.4.1.tar.gz" + sha256: "1bcd0a1eb4eef32a53cbb410ae38d708ea662e491cc5536cb9b15d54cc8b5707" + "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.5.0": + - patch_file: "patches/1.5.0-0001-use-cci-fmt.patch" + patch_description: "use cci fmt package, remove static flag from add_library" + patch_type: "conan" + "1.4.3": + - patch_file: "patches/1.4.3-0001-use-cci-fmt.patch" + patch_description: "use cci fmt package, remove static flag from add_library" + patch_type: "conan" + "1.4.1": + - patch_file: "patches/1.3.0-0001-use-cci-fmt.patch" + patch_description: "use cci fmt package, remove static flag from add_library" + patch_type: "conan" + "1.4.0": + - patch_file: "patches/1.3.0-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_file: "patches/1.3.0-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 index 06b2bc9d3e325..752e254ee325f 100644 --- a/recipes/libenvpp/all/conanfile.py +++ b/recipes/libenvpp/all/conanfile.py @@ -49,7 +49,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/10.1.1", transitive_headers=True) + self.requires("fmt/10.2.1", transitive_headers=True) def build_requirements(self): self.tool_requires("cmake/[>=3.16 <4]") diff --git a/recipes/libenvpp/all/patches/0001-use-cci-fmt.patch b/recipes/libenvpp/all/patches/1.3.0-0001-use-cci-fmt.patch similarity index 100% rename from recipes/libenvpp/all/patches/0001-use-cci-fmt.patch rename to recipes/libenvpp/all/patches/1.3.0-0001-use-cci-fmt.patch diff --git a/recipes/libenvpp/all/patches/1.4.3-0001-use-cci-fmt.patch b/recipes/libenvpp/all/patches/1.4.3-0001-use-cci-fmt.patch new file mode 100644 index 0000000000000..1f86bff7a146b --- /dev/null +++ b/recipes/libenvpp/all/patches/1.4.3-0001-use-cci-fmt.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8aa4975..231e523 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -55,7 +55,7 @@ endfunction() + + # External dependencies. + include(FetchContent) +- ++if(0) + if(LIBENVPP_INSTALL) + set(FMT_INSTALL ON CACHE BOOL "" FORCE) + endif() +@@ -78,7 +78,8 @@ macro(fetch_content_from_submodule DEPNAME RELPATH) + endmacro() + + fetch_content_from_submodule(fmt external/fmt) +- ++endif() ++find_package(fmt REQUIRED CONFIG) + if(LIBENVPP_TESTS) + fetch_content_from_submodule(Catch2 external/Catch2) + list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) +@@ -144,6 +145,7 @@ 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/patches/1.5.0-0001-use-cci-fmt.patch b/recipes/libenvpp/all/patches/1.5.0-0001-use-cci-fmt.patch new file mode 100644 index 0000000000000..6a1e7e6866da8 --- /dev/null +++ b/recipes/libenvpp/all/patches/1.5.0-0001-use-cci-fmt.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8729676..cc58853 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -55,7 +55,7 @@ endfunction() + + # External dependencies. + include(FetchContent) +- ++if(0) + if(LIBENVPP_INSTALL) + set(FMT_INSTALL ON CACHE BOOL "" FORCE) + endif() +@@ -78,7 +78,8 @@ macro(fetch_content_from_submodule DEPNAME RELPATH) + endmacro() + + fetch_content_from_submodule(fmt external/fmt) +- ++endif() ++find_package(fmt REQUIRED CONFIG) + if(LIBENVPP_TESTS) + fetch_content_from_submodule(Catch2 external/Catch2) + list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) diff --git a/recipes/libenvpp/config.yml b/recipes/libenvpp/config.yml index 426a0e4c79e9b..b7325931475d1 100644 --- a/recipes/libenvpp/config.yml +++ b/recipes/libenvpp/config.yml @@ -1,3 +1,11 @@ versions: + "1.5.0": + folder: all + "1.4.3": + folder: all + "1.4.1": + folder: all + "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 2f9f112de0a99..d5969c6674838 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.2.1") + self.tool_requires("meson/1.3.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libepoxy/all/test_package/CMakeLists.txt b/recipes/libepoxy/all/test_package/CMakeLists.txt index d5f3fa704d559..554e88ba3c20d 100644 --- a/recipes/libepoxy/all/test_package/CMakeLists.txt +++ b/recipes/libepoxy/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(libepoxy REQUIRED CONFIG) diff --git a/recipes/libepoxy/all/test_v1_package/CMakeLists.txt b/recipes/libepoxy/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libepoxy/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libepoxy/all/test_v1_package/conanfile.py b/recipes/libepoxy/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libepoxy/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_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/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/libev/all/test_package/CMakeLists.txt b/recipes/libev/all/test_package/CMakeLists.txt index ace0979b2a703..a569262a9ada2 100644 --- a/recipes/libev/all/test_package/CMakeLists.txt +++ b/recipes/libev/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(libev REQUIRED CONFIG) diff --git a/recipes/libev/all/test_v1_package/CMakeLists.txt b/recipes/libev/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libev/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libev/all/test_v1_package/conanfile.py b/recipes/libev/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libev/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_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/libevent/all/conanfile.py b/recipes/libevent/all/conanfile.py index 2d107e409da17..e56d1d53dc332 100644 --- a/recipes/libevent/all/conanfile.py +++ b/recipes/libevent/all/conanfile.py @@ -1,10 +1,12 @@ 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, copy, export_conandata_patches, get, replace_in_file, 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" +required_conan_version = ">=2.1" class LibeventConan(ConanFile): @@ -67,6 +69,9 @@ def generate(self): # libevent uses static runtime (MT) for static builds by default if is_msvc(self): tc.variables["EVENT__MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.1.12": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) deps.generate() @@ -126,7 +131,3 @@ def package_info(self): self.cpp_info.components["pthreads"].set_property("pkg_config_name", "libevent_pthreads") self.cpp_info.components["pthreads"].libs = ["event_pthreads"] self.cpp_info.components["pthreads"].requires = ["core"] - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "Libevent" - self.cpp_info.filenames["cmake_find_package_multi"] = "Libevent" diff --git a/recipes/libevent/all/test_package/CMakeLists.txt b/recipes/libevent/all/test_package/CMakeLists.txt index dc7570c75d1b5..dfac52f4a342f 100644 --- a/recipes/libevent/all/test_package/CMakeLists.txt +++ b/recipes/libevent/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(Libevent REQUIRED core CONFIG) diff --git a/recipes/libevent/all/test_v1_package/CMakeLists.txt b/recipes/libevent/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libevent/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libevent/all/test_v1_package/conanfile.py b/recipes/libevent/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libevent/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_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/libexif/all/test_package/CMakeLists.txt b/recipes/libexif/all/test_package/CMakeLists.txt index 66acda03b0317..0f2757d025bb1 100644 --- a/recipes/libexif/all/test_package/CMakeLists.txt +++ b/recipes/libexif/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(libexif REQUIRED CONFIG) diff --git a/recipes/libexif/all/test_v1_package/CMakeLists.txt b/recipes/libexif/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libexif/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libexif/all/test_v1_package/conanfile.py b/recipes/libexif/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libexif/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_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/libfabric/all/conandata.yml b/recipes/libfabric/all/conandata.yml index 1eedb4da16c00..1488ae656448e 100644 --- a/recipes/libfabric/all/conandata.yml +++ b/recipes/libfabric/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "1.12.1": - url: https://github.com/ofiwg/libfabric/releases/download/v1.12.1/libfabric-1.12.1.tar.bz2 - sha256: db3c8e0a495e6e9da6a7436adab905468aedfbd4579ee3da5232a5c111ba642c + "1.21.0": + url: "https://github.com/ofiwg/libfabric/releases/download/v1.21.0/libfabric-1.21.0.tar.bz2" + sha256: "0c1b7b830d9147f661e5d7f359250b85b5a9885c330464cd3b5e5d35b86551c7" diff --git a/recipes/libfabric/all/conanfile.py b/recipes/libfabric/all/conanfile.py index 96dbea392e3a6..9d5b8417f1cbd 100644 --- a/recipes/libfabric/all/conanfile.py +++ b/recipes/libfabric/all/conanfile.py @@ -1,99 +1,195 @@ -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 is_apple_os, fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + class LibfabricConan(ConanFile): name = "libfabric" - description = "Open Fabric Interfaces" - topics = ("fabric", "communication", "framework", "service") + description = ("Libfabric, also known as Open Fabrics Interfaces (OFI), " + "defines a communication API for high-performance parallel and distributed applications.") + license = ("BSD-2-Clause", "GPL-2.0-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "http://libfabric.org" - 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', 'psm3', 'rxm', 'sockets', 'tcp', 'udp', 'usnic', 'verbs', 'bgq'] + _providers = [ + "dmabuf_peer_mem", + "efa", + "hook_debug", + "hook_hmem", + "mrail", + "perf", + "profile", + "rxd", + "rxm", + "shm", + "sm2", + "sockets", + "tcp", + "trace", + "ucx", + "udp", + "usnic", + "verbs", + ] options = { - **{ p: "ANY" for p in _providers }, - **{ - "shared": [True, False], - "fPIC": [True, False], - "with_libnl": "ANY", - "with_bgq_progress": [None, "auto", "manual"], - "with_bgq_mr": [None, "basic", "scalable"] - } + "shared": [True, False], + "fPIC": [True, False], + **{ p: [None, "ANY"] for p in _providers }, } default_options = { - **{ p: "auto" for p in _providers }, - **{ - "shared": False, - "fPIC": True, - "with_libnl": None, - "with_bgq_progress": None, - "with_bgq_mr": None - } + "shared": False, + "fPIC": True, + "dmabuf_peer_mem": "yes", + "efa": "yes", + "hook_debug": "yes", + "hook_hmem": "yes", + "mrail": "yes", + "perf": "no", + "profile": "yes", + "rxd": "yes", + "rxm": "yes", + "shm": "yes", + "sm2": "yes", + "sockets": "yes", + "tcp": "yes", + "trace": "yes", + "ucx": "no", + "udp": "yes", + "usnic": "no", + "verbs": "yes" } - @property - def _source_subfolder(self): - return "source_subfolder" - - _autotools = None - def config_options(self): - if self.settings.os == 'Windows': - del self.options.fPIC + if is_apple_os(self): + # Requires libnl, which is not available on macOS + del self.options.usnic + # Require Linux-specific process_vm_readv syscall + del self.options.shm + del self.options.sm2 + # rdma-core is not available on macOS + del self.options.efa + del self.options.verbs 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 _is_enabled(self, opt): + return str(self.options.get_safe(opt)) == "yes" or str(self.options.get_safe(opt)).startswith("dl") + + def requirements(self): + if self._is_enabled("usnic"): + self.requires("libnl/3.8.0") + if self._is_enabled("efa") or self._is_enabled("usnic") or self._is_enabled("verbs"): + self.requires("rdma-core/52.0") + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: - raise ConanInvalidConfiguration("libfabric only builds on Linux, Macos, and FreeBSD.") - for p in self._providers: - if self.options.get_safe(p) not in ["auto", "yes", "no", "dl"] and not os.path.isdir(str(self.options.get_safe(p))): - raise ConanInvalidConfiguration("Option {} can only be one of 'auto', 'yes', 'no', 'dl' or a directory path") - if self.options.get_safe('with_libnl') and not os.path.isdir(str(self.options.with_libnl)): - raise ConanInvalidConfiguration("Value of with_libnl must be an existing directory") + if self.settings.os == "Windows": + # FIXME: libfabric provides msbuild project files. + raise ConanInvalidConfiguration(f"{self.ref} Conan recipes is not supported on Windows. Contributions are welcome.") + + for provider in self._providers: + provider = str(self.options.get_safe(provider)) + if provider.lower() not in ["yes", "no", "dl", "none"] and \ + not os.path.isdir(provider) and \ + (not provider.startswith("dl:") and not os.path.isdir(provider[3:])): + raise ConanInvalidConfiguration(f"{self.ref} provider option '{provider}' is not valid. It must be 'yes', 'no', 'dl', 'dl:' or a directory path.") + + if self._is_enabled("verbs"): + if not self.dependencies["rdma-core"].options.build_librdmacm: + raise ConanInvalidConfiguration(f"{self.ref} '-o rdma-core/*:build_librdmacm=True' is required when '-o &:verbs=True'") + + def build_requirements(self): + # Used in ./configure tests and build + 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) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - args = [] + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) for p in self._providers: - args.append('--enable-{}={}'.format(p, self.options.get_safe(p))) - if self.options.with_libnl: - args.append('--with-libnl={}'.format(self.options.with_libnl)) - if self.options.with_bgq_progress: - args.append('--with-bgq-progress={}'.format(self.options.with_bgq_progress)) - if self.options.with_bgq_mr: - args.append('--with-bgq-mr={}'.format(self.options.with_bgq_mr)) - self._autotools.configure(args=args, configure_dir=self._source_subfolder) - return self._autotools + if p == "verbs" and self.options.get_safe(p, "no") != "no": + path = self.dependencies["rdma-core"].package_folder + if self.options.get_safe("verbs") == "dl": + tc.configure_args.append(f"--enable-verbs=dl:{path}") + else: + tc.configure_args.append(f"--enable-verbs={path}") + else: + tc.configure_args.append(f"--enable-{p}={self.options.get_safe(p, 'no')}") + if self.settings.build_type == "Debug": + tc.configure_args.append("--enable-debug") + tc.configure_args.append(f"--with-bgq-progress=no") + tc.configure_args.append(f"--with-bgq-mr=no") + tc.configure_args.append("--with-cassin-headers=no") + tc.configure_args.append("--with-cuda=no") # TODO + tc.configure_args.append("--with-curl=no") # TODO + tc.configure_args.append("--with-cxi-uapi-headers=no") + tc.configure_args.append("--with-dsa=no") + tc.configure_args.append("--with-gdrcopy=no") + tc.configure_args.append("--with-json-c=no") # TODO + if self._is_enabled("usnic"): + tc.configure_args.append(f"--with-libnl={self.dependencies['libnl'].package_folder}") + else: + tc.configure_args.append("--with-libnl=no") + tc.configure_args.append("--with-lttng=no") + tc.configure_args.append("--with-neuron=no") + tc.configure_args.append(f"--with-numa=no") + tc.configure_args.append("--with-psm2-src=no") + tc.configure_args.append("--with-psm3-rv=no") + tc.configure_args.append("--with-rocr=no") + tc.configure_args.append("--with-synapseai=no") + tc.configure_args.append("--with-uring=no") # TODO + tc.configure_args.append("--with-ze=no") + tc.configure_args.append("-enable-psm=no") + tc.configure_args.append("--enable-psm2=no") + tc.configure_args.append("--enable-psm3=no") + tc.configure_args.append("--enable-xpmem=no") + tc.configure_args.append("--enable-cxi=no") + tc.configure_args.append("--enable-opx=no") + tc.configure_args.append("--enable-bgq=no") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + VirtualBuildEnv(self).generate() + VirtualRunEnv(self).generate(scope="build") def build(self): - 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() - - 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") + 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 = ["fabric"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["pthread", "m"] + self.cpp_info.system_libs = ["pthread", "m", "rt", "dl"] + if self.settings.compiler in ["gcc", "clang"]: + self.cpp_info.system_libs.append("atomic") diff --git a/recipes/libfabric/all/test_package/CMakeLists.txt b/recipes/libfabric/all/test_package/CMakeLists.txt index 196188113685c..09b7943e0c2de 100644 --- a/recipes/libfabric/all/test_package/CMakeLists.txt +++ b/recipes/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 CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libfabric REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libfabric::libfabric) diff --git a/recipes/libfabric/all/test_package/conanfile.py b/recipes/libfabric/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/libfabric/all/test_package/conanfile.py +++ b/recipes/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.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/libfabric/config.yml b/recipes/libfabric/config.yml index daa3a213a56fa..09d8df06c28ff 100644 --- a/recipes/libfabric/config.yml +++ b/recipes/libfabric/config.yml @@ -1,3 +1,3 @@ versions: - "1.12.1": + "1.21.0": 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/all/conanfile.py b/recipes/libfdk_aac/all/conanfile.py index ea032fb6c5ddd..63fd8a8038b15 100644 --- a/recipes/libfdk_aac/all/conanfile.py +++ b/recipes/libfdk_aac/all/conanfile.py @@ -6,7 +6,9 @@ from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, NMakeToolchain +from conan.tools.build import cross_building from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os required_conan_version = ">=1.55.0" @@ -46,6 +48,12 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def validate_build(self): + if cross_building(self) and self.settings.os == "Android": + # https://github.com/mstorsjo/fdk-aac/issues/124#issuecomment-653473956 + # INFO: It's possible to inject a log.h to fix the error, but there is no official support. + raise ConanInvalidConfiguration(f"{self.ref} cross-building for Android is not supported. Please, try native build.") + def layout(self): if self._use_cmake: cmake_layout(self, src_folder="src") diff --git a/recipes/libfdk_aac/all/test_package/CMakeLists.txt b/recipes/libfdk_aac/all/test_package/CMakeLists.txt index 609976265e86c..7bfbd208e41b6 100644 --- a/recipes/libfdk_aac/all/test_package/CMakeLists.txt +++ b/recipes/libfdk_aac/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 C) find_package(fdk-aac REQUIRED CONFIG) diff --git a/recipes/libfdk_aac/all/test_v1_package/CMakeLists.txt b/recipes/libfdk_aac/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libfdk_aac/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libfdk_aac/all/test_v1_package/conanfile.py b/recipes/libfdk_aac/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libfdk_aac/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_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/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/libffi/all/conandata.yml b/recipes/libffi/all/conandata.yml index 5984134b2d8b9..4ae82714f72f8 100644 --- a/recipes/libffi/all/conandata.yml +++ b/recipes/libffi/all/conandata.yml @@ -1,17 +1,19 @@ sources: + "3.4.6": + url: "https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz" + sha256: "b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e" "3.4.4": url: "https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz" sha256: "d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676" - "3.4.3": - url: "https://github.com/libffi/libffi/releases/download/v3.4.3/libffi-3.4.3.tar.gz" - sha256: "4416dd92b6ae8fcb5b10421e711c4d3cb31203d77521a77d85d0102311e6c3b8" - "3.4.2": - url: "https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz" - sha256: "540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620" "3.3": url: "https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz" sha256: "72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056" patches: + "3.4.6": + - patch_file: "patches/0002-3.4.6-fix-libtool-path.patch" + - patch_file: "patches/0004-3.4.6-fix-complex-type-msvc.patch" + - patch_file: "patches/0005-3.4.4-do-not-install-libraries-to-arch-dependent-directories.patch" + - patch_file: "patches/0006-3.4.6-library-no-version-suffix.patch" "3.4.4": - patch_file: "patches/0002-3.4.3-fix-libtool-path.patch" - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" @@ -21,20 +23,6 @@ patches: patch_type: "portability" patch_source: "https://github.com/libffi/libffi/pull/764" patch_description: "Forward declare the open_temp_exec_file function which is required by the C99 standard" - "3.4.3": - - patch_file: "patches/0002-3.4.3-fix-libtool-path.patch" - - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" - - patch_file: "patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch" - - patch_file: "patches/0006-3.4.3-library-no-version-suffix.patch" - - patch_file: "patches/0007-3.4.3-forward-declare-open_temp_exec_file.patch" - patch_type: "portability" - patch_source: "https://github.com/libffi/libffi/pull/764" - patch_description: "Forward declare the open_temp_exec_file function which is required by the C99 standard" - "3.4.2": - - patch_file: "patches/0002-3.4.2-fix-libtool-path.patch" - - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" - - patch_file: "patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch" - - patch_file: "patches/0006-3.4.2-library-no-version-suffix.patch" "3.3": - patch_file: "patches/0002-3.3-fix-libtool-path.patch" - patch_file: "patches/0004-3.3-fix-complex-type-msvc.patch" diff --git a/recipes/libffi/all/conanfile.py b/recipes/libffi/all/conanfile.py index e46a94d1b4462..12cc4ad539c76 100644 --- a/recipes/libffi/all/conanfile.py +++ b/recipes/libffi/all/conanfile.py @@ -1,7 +1,8 @@ from conan import ConanFile -from conan.tools.apple import fix_apple_shared_install_name +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, mkdir, replace_in_file, rm, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, 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, is_msvc_static_runtime, msvc_runtime_flag, unix_path @@ -10,7 +11,7 @@ import os import shutil -required_conan_version = ">=1.57.0" +required_conan_version = ">=2.0" class LibffiConan(ConanFile): @@ -31,17 +32,16 @@ class LibffiConan(ConanFile): "fPIC": True, } - @property - def _settings_build(self): - # TODO: Remove for Conan v2 - 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 validate(self): + if is_apple_os(self) and self.settings.arch == "armv8" and Version(self.version) < "3.4.0": + raise ConanInvalidConfiguration(f"{self.ref} does not support Apple ARM CPUs") def configure(self): if self.options.shared: @@ -53,11 +53,11 @@ def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): - if self._settings_build.os == "Windows": + if self.settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): self.tool_requires("msys2/cci.latest") - if is_msvc(self): + if self.settings_build.os == "Windows" and self.settings.get_safe("compiler.runtime"): self.tool_requires("automake/1.16.5") def source(self): @@ -75,18 +75,21 @@ def generate(self): "--enable-docs=no", ]) - if self._settings_build.compiler == "apple-clang": + if self.settings_build.compiler == "apple-clang": tc.configure_args.append("--disable-multi-os-directory") - tc.extra_defines.append("FFI_BUILDING") if self.options.shared: tc.extra_defines.append("FFI_BUILDING_DLL") + if Version(self.version) < "3.4.6": + tc.extra_defines.append("FFI_BUILDING") + elif not self.options.shared: + tc.extra_defines.append("FFI_STATIC_BUILD") env = tc.environment() - if self._settings_build.os == "Windows" and (is_msvc(self) or self.settings.compiler == "clang"): + if self.settings_build.os == "Windows" and self.settings.get_safe("compiler.runtime"): build = "{}-{}-{}".format( - "x86_64" if self._settings_build.arch == "x86_64" else "i686", - "pc" if self._settings_build.arch == "x86" else "win64", + "x86_64" if self.settings_build.arch == "x86_64" else "i686", + "pc" if self.settings_build.arch == "x86" else "win64", "mingw64") host = "{}-{}-{}".format( "x86_64" if self.settings.arch == "x86_64" else "i686", @@ -134,22 +137,9 @@ def generate(self): env.define("INSTALL", unix_path(self, os.path.join(self.source_folder, "install-sh"))) tc.generate(env=env) - def _patch_source(self): + def build(self): apply_conandata_patches(self) - if Version(self.version) < "3.3": - if self.settings.compiler == "clang" and Version(str(self.settings.compiler.version)) >= 7.0: - # https://android.googlesource.com/platform/external/libffi/+/ca22c3cb49a8cca299828c5ffad6fcfa76fdfa77 - sysv_s_src = os.path.join(self.source_folder, "src", "arm", "sysv.S") - replace_in_file(self, sysv_s_src, "fldmiad", "vldmia") - replace_in_file(self, sysv_s_src, "fstmiad", "vstmia") - replace_in_file(self, sysv_s_src, "fstmfdd\tsp!,", "vpush") - - # https://android.googlesource.com/platform/external/libffi/+/7748bd0e4a8f7d7c67b2867a3afdd92420e95a9f - replace_in_file(self, sysv_s_src, "stmeqia", "stmiaeq") - - def build(self): - self._patch_source() autotools = Autotools(self) autotools.configure() autotools.make() @@ -170,4 +160,5 @@ def package_info(self): self.cpp_info.libs = ["{}ffi".format("lib" if is_msvc(self) else "")] self.cpp_info.set_property("pkg_config_name", "libffi") if not self.options.shared: - self.cpp_info.defines = ["FFI_BUILDING"] + static_define = "FFI_STATIC_BUILD" if Version(self.version) >= "3.4.6" else "FFI_BUILDING" + self.cpp_info.defines = [static_define] diff --git a/recipes/libffi/all/patches/0002-3.4.2-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.4.2-fix-libtool-path.patch deleted file mode 100644 index fad9e64adff17..0000000000000 --- a/recipes/libffi/all/patches/0002-3.4.2-fix-libtool-path.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- configure -+++ configure -@@ -8979,7 +8979,7 @@ - LIBTOOL_DEPS=$ltmain - - # Always use our own libtool. --LIBTOOL='$(SHELL) $(top_builddir)/libtool' -+LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' - - - -@@ -9072,7 +9072,7 @@ - esac - - # Global variables: --ofile=libtool -+ofile=libtool.sh - can_build_shared=yes - - # All known linkers require a '.a' archive for static linking (except MSVC, diff --git a/recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch b/recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch new file mode 100644 index 0000000000000..e557baacf2699 --- /dev/null +++ b/recipes/libffi/all/patches/0002-3.4.6-fix-libtool-path.patch @@ -0,0 +1,20 @@ +--- configure ++++ configure +@@ -9882,7 +9882,7 @@ + LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)/libtool.sh' + + + +@@ -9974,7 +9974,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=libtool.sh + can_build_shared=yes + + # All known linkers require a '.a' archive for static linking (except MSVC and diff --git a/recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch b/recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch new file mode 100644 index 0000000000000..4779afe0a2e85 --- /dev/null +++ b/recipes/libffi/all/patches/0004-3.4.6-fix-complex-type-msvc.patch @@ -0,0 +1,56 @@ +diff --git a/src/types.c b/src/types.c +index c1c27f3..d5d52bb 100644 +--- a/src/types.c ++++ b/src/types.c +@@ -31,6 +31,8 @@ + #include + #include + ++#include ++ + /* Type definitions */ + + #define FFI_TYPEDEF(name, type, id, maybe_const)\ +@@ -45,17 +47,17 @@ maybe_const ffi_type ffi_type_##name = { \ + id, NULL \ + } + +-#define FFI_COMPLEX_TYPEDEF(name, type, maybe_const) \ ++#define FFI_COMPLEX_TYPEDEF(name, complex_type, maybe_const) \ + static ffi_type *ffi_elements_complex_##name [2] = { \ + (ffi_type *)(&ffi_type_##name), NULL \ + }; \ + struct struct_align_complex_##name { \ + char c; \ +- _Complex type x; \ ++ complex_type x; \ + }; \ + FFI_EXTERN \ + maybe_const ffi_type ffi_type_complex_##name = { \ +- sizeof(_Complex type), \ ++ sizeof(complex_type), \ + offsetof(struct struct_align_complex_##name, x), \ + FFI_TYPE_COMPLEX, \ + (ffi_type **)ffi_elements_complex_##name \ +@@ -99,8 +101,18 @@ const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL }; + FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE, FFI_LDBL_CONST); + #endif + ++#ifdef _MSC_VER ++# define FLOAT_COMPLEX _C_float_complex ++# define DOUBLE_COMPLEX _C_double_complex ++# define LDOUBLE_COMPLEX _C_ldouble_complex ++#else ++# define FLOAT_COMPLEX float _Complex ++# define DOUBLE_COMPLEX double _Complex ++# define LDOUBLE_COMPLEX long double _Complex ++#endif ++ + #ifdef FFI_TARGET_HAS_COMPLEX_TYPE +-FFI_COMPLEX_TYPEDEF(float, float, const); +-FFI_COMPLEX_TYPEDEF(double, double, const); +-FFI_COMPLEX_TYPEDEF(longdouble, long double, FFI_LDBL_CONST); ++FFI_COMPLEX_TYPEDEF(float, FLOAT_COMPLEX, const); ++FFI_COMPLEX_TYPEDEF(double, DOUBLE_COMPLEX, const); ++FFI_COMPLEX_TYPEDEF(longdouble, LDOUBLE_COMPLEX, FFI_LDBL_CONST); + #endif diff --git a/recipes/libffi/all/patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch b/recipes/libffi/all/patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch deleted file mode 100644 index 8e14796ab662a..0000000000000 --- a/recipes/libffi/all/patches/0005-3.4.2-do-not-install-libraries-to-arch-dependent-directories.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.in -+++ Makefile.in -@@ -517,7 +517,7 @@ - target_os = @target_os@ - target_vendor = @target_vendor@ - toolexecdir = @toolexecdir@ --toolexeclibdir = @toolexeclibdir@ -+toolexeclibdir = @libdir@ - top_build_prefix = @top_build_prefix@ - top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ diff --git a/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch b/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch deleted file mode 100644 index e82abf24a4fb1..0000000000000 --- a/recipes/libffi/all/patches/0005-3.4.3-do-not-install-libraries-to-arch-dependent-directories.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.in -+++ Makefile.in -@@ -520,7 +520,7 @@ - target_vendor = @target_vendor@ - tmake_file = @tmake_file@ - toolexecdir = @toolexecdir@ --toolexeclibdir = @toolexeclibdir@ -+toolexeclibdir = @libdir@ - top_build_prefix = @top_build_prefix@ - top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ diff --git a/recipes/libffi/all/patches/0006-3.4.2-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.2-library-no-version-suffix.patch deleted file mode 100644 index 80c36df06441e..0000000000000 --- a/recipes/libffi/all/patches/0006-3.4.2-library-no-version-suffix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.in -+++ Makefile.in -@@ -610,7 +610,7 @@ - @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = - @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map - @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun --libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -+libffi_version_info = -avoid-version - libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) - libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) - AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch deleted file mode 100644 index 0ad4d29b1c4ce..0000000000000 --- a/recipes/libffi/all/patches/0006-3.4.3-library-no-version-suffix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.in -+++ Makefile.in -@@ -615,7 +615,7 @@ - @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = - @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map - @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun --libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -+libffi_version_info = -avoid-version - libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) - libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) - AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch b/recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch new file mode 100644 index 0000000000000..726e8c1eb4a47 --- /dev/null +++ b/recipes/libffi/all/patches/0006-3.4.6-library-no-version-suffix.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.in b/Makefile.in +index 450200a..abcee85 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -618,7 +618,7 @@ AM_CFLAGS = $(am__append_3) + @LIBFFI_BUILD_VERSIONED_SHLIB_FALSE@libffi_version_dep = + @LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map + @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@libffi_version_dep = libffi.map-sun +-libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` ++libffi_version_info = -avoid-version + libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) + libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) + AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src diff --git a/recipes/libffi/all/test_package/CMakeLists.txt b/recipes/libffi/all/test_package/CMakeLists.txt index 80fe7087b6f9f..8c90ca4723b89 100644 --- a/recipes/libffi/all/test_package/CMakeLists.txt +++ b/recipes/libffi/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 C) diff --git a/recipes/libffi/config.yml b/recipes/libffi/config.yml index af3a9af92b306..e6382ec734d6d 100644 --- a/recipes/libffi/config.yml +++ b/recipes/libffi/config.yml @@ -1,9 +1,7 @@ versions: - "3.4.4": - folder: "all" - "3.4.3": + "3.4.6": folder: "all" - "3.4.2": + "3.4.4": folder: "all" "3.3": folder: "all" diff --git a/recipes/libfork/all/conandata.yml b/recipes/libfork/all/conandata.yml new file mode 100644 index 0000000000000..26ad554c10e51 --- /dev/null +++ b/recipes/libfork/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.8.0": + url: "https://github.com/conorwilliams/libfork/archive/v3.8.0.tar.gz" + sha256: "53f23f0d27bb0753c0b03132f3c17bf8099617f037a2389a04e85fdd6f2736e8" + "3.7.2": + url: "https://github.com/conorwilliams/libfork/archive/v3.7.2.tar.gz" + sha256: "0c4fbb7a6000c0a93b219b385d9834bd07bc5f19d89aa41ba8e27b5723694b15" diff --git a/recipes/libfork/all/conanfile.py b/recipes/libfork/all/conanfile.py new file mode 100644 index 0000000000000..f2a0617be709d --- /dev/null +++ b/recipes/libfork/all/conanfile.py @@ -0,0 +1,69 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class LibforkConan(ConanFile): + name = "libfork" + description = "A bleeding-edge, lock-free, wait-free, continuation-stealing tasking library." + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ConorWilliams/libfork" + topics = ("multithreading", + "fork-join", + "parallelism", + "framework", + "continuation-stealing", + "lockfree", + "wait-free", + "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): + # https://en.cppreference.com/w/cpp/utility/source_location requires new compilers + return { + "apple-clang": "15", + "clang": "15", + "gcc": "11", + "msvc": "192.10", + "Visual Studio": "16.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"): + 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.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")) + + 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/libfork/all/test_package/CMakeLists.txt b/recipes/libfork/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..01ecf1d73c686 --- /dev/null +++ b/recipes/libfork/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(libfork REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libfork::libfork) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/libfork/all/test_package/conanfile.py b/recipes/libfork/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8a476e09ae305 --- /dev/null +++ b/recipes/libfork/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 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): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/libfork/all/test_package/test_package.cpp b/recipes/libfork/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..70ecda89a8887 --- /dev/null +++ b/recipes/libfork/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include + +#include "libfork.hpp" + +namespace { + constexpr auto hello_async_world = [](auto /* self */) -> lf::task { + std::cout << "Hello, async world!" << std::endl; + co_return 0; + }; +} + +auto main() -> int { + try { + return lf::sync_wait(lf::lazy_pool{}, hello_async_world); + } catch (std::exception const &e) { + std::cerr << "Caught exception: " << e.what() << std::endl; + return EXIT_FAILURE; + } catch (...) { + std::cerr << "Caught unknown exception." << std::endl; + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/recipes/libfork/config.yml b/recipes/libfork/config.yml new file mode 100644 index 0000000000000..ee862d73f6252 --- /dev/null +++ b/recipes/libfork/config.yml @@ -0,0 +1,5 @@ +versions: + "3.8.0": + folder: all + "3.7.2": + folder: all diff --git a/recipes/libfreenect/all/conanfile.py b/recipes/libfreenect/all/conanfile.py index 66b03d96a8717..b3c17f574cff7 100644 --- a/recipes/libfreenect/all/conanfile.py +++ b/recipes/libfreenect/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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LibfreenectConan(ConanFile): @@ -61,6 +62,8 @@ def generate(self): tc.variables["BUILD_OPENNI2_DRIVER"] = False # Relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "0.7.5": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/libfreenect/all/test_package/CMakeLists.txt b/recipes/libfreenect/all/test_package/CMakeLists.txt index 46d01bd2584df..05ec5480f93b0 100644 --- a/recipes/libfreenect/all/test_package/CMakeLists.txt +++ b/recipes/libfreenect/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(libfreenect REQUIRED CONFIG) diff --git a/recipes/libfreenect/all/test_v1_package/CMakeLists.txt b/recipes/libfreenect/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libfreenect/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libfreenect/all/test_v1_package/conanfile.py b/recipes/libfreenect/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libfreenect/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_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/libfreenect2/all/conanfile.py b/recipes/libfreenect2/all/conanfile.py index b9a827fb5ffdb..b7fc037d4704f 100644 --- a/recipes/libfreenect2/all/conanfile.py +++ b/recipes/libfreenect2/all/conanfile.py @@ -1,13 +1,15 @@ import os from conan import ConanFile +from conan.errors import ConanException 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 +from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class Libfreenect2Conan(ConanFile): @@ -93,6 +95,9 @@ def generate(self): 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.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.2.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) @@ -160,7 +165,3 @@ def package_info(self): 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/test_v1_package/CMakeLists.txt b/recipes/libfreenect2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libfreenect2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/libfreenect2/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", "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/test_v1_package/CMakeLists.txt b/recipes/libftdi/0.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libftdi/0.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index a86b3a5dad12e..0000000000000 --- a/recipes/libftdi/0.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/libftdi/1.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 65f19e16d7a62..0000000000000 --- a/recipes/libftdi/1.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - - -include(${CMAKE_BINARY_DIR}/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/1.x/test_v1_package/conanfile.py b/recipes/libftdi/1.x/test_v1_package/conanfile.py deleted file mode 100644 index 90c431a11ee68..0000000000000 --- a/recipes/libftdi/1.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - - -class TestPackageV1Conan(ConanFile): - settings = "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/libftp/all/conandata.yml b/recipes/libftp/all/conandata.yml new file mode 100644 index 0000000000000..1df2b6440cd9a --- /dev/null +++ b/recipes/libftp/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "1.4.0": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v1.4.0.tar.gz" + sha256: "0d8c9f8ea36ef010c4b7be79e3c4ad46830d2f644bcecd608d83f69274a2aa9e" + "1.3.0": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v1.3.0.tar.gz" + sha256: "e4861fccb5c67742db1aa8f1af98ac70888b54212b06a8366d84a040897ca749" + "1.1.0": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v1.1.0.tar.gz" + sha256: "8d9ff413436b17eef225c4b12539965cdea786d02bb2c688b153992d36f88f48" + "0.5.1": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v0.5.1.tar.gz" + sha256: "6cc6e80b50ba425b66175d3b0d22358db4ebeb4941edc33bba47d72442de5645" + "0.5.0": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v0.5.0.tar.gz" + sha256: "566d4d176bf754571e01563c4c0182a9c54b90903cd958a609fa0d6bd4c2141e" + "0.4.1": + url: "https://github.com/deniskovalchuk/libftp/archive/refs/tags/v0.4.1.tar.gz" + sha256: "873dd7647234f72fecfe57150b0a4a60f4c16611d26ad7eb687e0561f54b9eec" diff --git a/recipes/libftp/all/conanfile.py b/recipes/libftp/all/conanfile.py new file mode 100644 index 0000000000000..9ead6038cf850 --- /dev/null +++ b/recipes/libftp/all/conanfile.py @@ -0,0 +1,82 @@ +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, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=2.0" + + +class LibFTPConan(ConanFile): + name = "libftp" + description = "A cross-platform FTP/FTPS client library based on Boost.Asio" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/deniskovalchuk/libftp" + topics = ("ftp", "ftps", "boost", "ssl", "tls", "openssl") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + def configure(self): + if Version(self.version) < "1.4.0" and 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("boost/1.86.0", transitive_headers=True) + if Version(self.version) >= "0.5.0": + self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True) + + def validate(self): + check_min_cppstd(self, 17) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBFTP_BUILD_TEST"] = False + tc.variables["LIBFTP_BUILD_EXAMPLE"] = False + tc.variables["LIBFTP_BUILD_CMDLINE_CLIENT"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + 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, "share")) + + def package_info(self): + self.cpp_info.libs = ["ftp"] + + self.cpp_info.set_property("cmake_file_name", "ftp") + self.cpp_info.set_property("cmake_target_name", "ftp::ftp") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libftp/all/test_package/CMakeLists.txt b/recipes/libftp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d4b87e9e23e3a --- /dev/null +++ b/recipes/libftp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ftp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ftp::ftp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libftp/all/test_package/conanfile.py b/recipes/libftp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/libftp/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/libftp/all/test_package/test_package.cpp b/recipes/libftp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..78760fc11e2a1 --- /dev/null +++ b/recipes/libftp/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include "ftp/client.hpp" + +int main(void) { + try { + ftp::client client; + } + catch (const std::exception & ex) { + std::cerr << ex.what() << std::endl; + } + return 0; +} diff --git a/recipes/libftp/config.yml b/recipes/libftp/config.yml new file mode 100644 index 0000000000000..fc2acdcc60347 --- /dev/null +++ b/recipes/libftp/config.yml @@ -0,0 +1,13 @@ +versions: + "1.4.0": + folder: all + "1.3.0": + folder: all + "1.1.0": + folder: all + "0.5.1": + folder: all + "0.5.0": + folder: all + "0.4.1": + folder: all diff --git a/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt b/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/libfuse/2.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libfuse/2.x.x/test_v1_package/conanfile.py b/recipes/libfuse/2.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libfuse/2.x.x/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_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/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/test_v1_package/CMakeLists.txt b/recipes/libfuse/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/libfuse/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libfuse/all/test_v1_package/conanfile.py b/recipes/libfuse/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libfuse/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_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/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 825994cdd9480..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 @@ -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/all/test_package/CMakeLists.txt b/recipes/libgcrypt/all/test_package/CMakeLists.txt index 1a3fbb3bbed04..3a1f5a0b30e2d 100644 --- a/recipes/libgcrypt/all/test_package/CMakeLists.txt +++ b/recipes/libgcrypt/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(libgcrypt REQUIRED CONFIG) diff --git a/recipes/libgcrypt/all/test_v1_package/CMakeLists.txt b/recipes/libgcrypt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libgcrypt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libgcrypt/all/test_v1_package/conanfile.py b/recipes/libgcrypt/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libgcrypt/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_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/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 f0b126888eb32..1c4db40fa14b0 100644 --- a/recipes/libgd/all/conandata.yml +++ b/recipes/libgd/all/conandata.yml @@ -48,9 +48,6 @@ 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" @@ -61,9 +58,6 @@ 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" @@ -71,6 +65,3 @@ 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 5de7e7911d0ed..ffc0a4e68966c 100644 --- a/recipes/libgd/all/conanfile.py +++ b/recipes/libgd/all/conanfile.py @@ -15,7 +15,7 @@ class LibgdConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://libgd.github.io" topics = ("images", "graphics") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,6 +24,10 @@ class LibgdConan(ConanFile): "with_jpeg": [True, False], "with_tiff": [True, False], "with_freetype": [True, False], + "with_xpm": [True, False], + "with_webp": [True, False], + "with_heif": [True, False], + "with_avif": [True, False], } default_options = { "shared": False, @@ -32,6 +36,10 @@ class LibgdConan(ConanFile): "with_jpeg": False, "with_tiff": False, "with_freetype": False, + "with_xpm": False, + "with_webp": False, + "with_heif": False, + "with_avif": False, } def export_sources(self): @@ -40,6 +48,9 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "2.3.2": + del self.options.with_heif + del self.options.with_avif def configure(self): if self.options.shared: @@ -53,7 +64,7 @@ def layout(self): def requirements(self): self.requires("zlib/[>=1.2.11 <2]") if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if is_msvc(self): self.requires("getopt-for-visual-studio/20200201") if self.options.with_jpeg: @@ -62,6 +73,14 @@ def requirements(self): self.requires("libtiff/4.6.0") if self.options.with_freetype: self.requires("freetype/2.13.2") + if self.options.with_xpm: + self.requires("libxpm/3.5.13") + if self.options.with_webp: + self.requires("libwebp/1.3.2") + if self.options.get_safe("with_heif"): + self.requires("libheif/1.16.2") + if self.options.get_safe("with_avif"): + self.requires("libavif/1.0.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -77,19 +96,23 @@ def generate(self): tc.variables["ENABLE_JPEG"] = self.options.with_jpeg tc.variables["ENABLE_TIFF"] = self.options.with_tiff tc.variables["ENABLE_ICONV"] = False - tc.variables["ENABLE_XPM"] = False + tc.variables["ENABLE_XPM"] = self.options.with_xpm tc.variables["ENABLE_FREETYPE"] = self.options.with_freetype tc.variables["ENABLE_FONTCONFIG"] = False - tc.variables["ENABLE_WEBP"] = False + tc.variables["ENABLE_WEBP"] = self.options.with_webp if Version(self.version) >= "2.3.2": - tc.variables["ENABLE_HEIF"] = False - tc.variables["ENABLE_AVIF"] = False + tc.variables["ENABLE_HEIF"] = self.options.get_safe("with_heif", False) + tc.variables["ENABLE_AVIF"] = self.options.get_safe("with_avif", False) if Version(self.version) >= "2.3.0": tc.variables["ENABLE_RAQM"] = False tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) + deps.set_property("libheif", "cmake_file_name", "HEIF") + deps.set_property("webp", "cmake_file_name", "WEBP") + deps.set_property("libxpm", "cmake_file_name", "XPM") + deps.set_property("freetype", "cmake_file_name", "FREETYPE") deps.generate() def _patch(self): diff --git a/recipes/libgd/all/patches/2.2.5-use-cci.patch b/recipes/libgd/all/patches/2.2.5-use-cci.patch deleted file mode 100644 index 7a3609a12620d..0000000000000 --- a/recipes/libgd/all/patches/2.2.5-use-cci.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index cdb3bfc14381a..0000000000000 --- a/recipes/libgd/all/patches/2.3.0-use-cci.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 index 489c66beb6236..57724df5d1cec 100644 --- a/recipes/libgd/all/patches/2.3.2-use-cci.patch +++ b/recipes/libgd/all/patches/2.3.2-use-cci.patch @@ -1,13 +1,27 @@ -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 +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 57cd95d..f7640c5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -126,7 +126,7 @@ else (USE_EXT_GD) + ENDIF (ENABLE_HEIF) - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} + IF (ENABLE_AVIF) +- FIND_PACKAGE(libavif 0.8.2 REQUIRED CONFIG) ++ FIND_PACKAGE(libavif REQUIRED CONFIG) + SET(HAVE_LIBAVIF 1) + SET(AVIF_LIBRARIES avif) + SET(AVIF_FOUND 1) +@@ -212,11 +212,11 @@ else (USE_EXT_GD) + LIST(APPEND PKG_REQUIRES_PRIVATES xpm) + ENDIF(XPM_FOUND) + +- IF(JPEG_FOUND) ++ IF(ENABLE_JPEG AND JPEG_FOUND) + INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) + SET(HAVE_LIBJPEG 1) + LIST(APPEND PKG_REQUIRES_PRIVATES libjpeg) +- ENDIF(JPEG_FOUND) ++ ENDIF() + + IF(TIFF_FOUND) + INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) diff --git a/recipes/libgd/all/patches/2.3.3-use-cci.patch b/recipes/libgd/all/patches/2.3.3-use-cci.patch index 4a067840ce98f..561c4e9f127a0 100644 --- a/recipes/libgd/all/patches/2.3.3-use-cci.patch +++ b/recipes/libgd/all/patches/2.3.3-use-cci.patch @@ -1,13 +1,27 @@ -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 +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6b3e5b3..2b71c74 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -142,7 +142,7 @@ else (USE_EXT_GD) + ENDIF (ENABLE_HEIF) - SET(LIBGD_DEP_LIBS - ${ZLIB_LIBRARIES} -- ${FREETYPE_LIBRARIES} -+ ${freetype_LIBRARIES} - ${PNG_LIBRARIES} - ${ICONV_LIBRARIES} - ${LIQ_LIBRARIES} + IF (ENABLE_AVIF) +- FIND_PACKAGE(libavif 0.8.2 REQUIRED CONFIG) ++ FIND_PACKAGE(libavif REQUIRED CONFIG) + SET(HAVE_LIBAVIF 1) + SET(AVIF_LIBRARIES avif) + SET(AVIF_FOUND 1) +@@ -228,11 +228,11 @@ else (USE_EXT_GD) + LIST(APPEND PKG_REQUIRES_PRIVATES xpm) + ENDIF(XPM_FOUND) + +- IF(JPEG_FOUND) ++ IF(ENABLE_JPEG AND JPEG_FOUND) + INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) + SET(HAVE_LIBJPEG 1) + LIST(APPEND PKG_REQUIRES_PRIVATES libjpeg) +- ENDIF(JPEG_FOUND) ++ ENDIF() + + IF(TIFF_FOUND) + INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) diff --git a/recipes/libgd/all/test_package/CMakeLists.txt b/recipes/libgd/all/test_package/CMakeLists.txt index bc37e91faebeb..c6815a67b3a70 100644 --- a/recipes/libgd/all/test_package/CMakeLists.txt +++ b/recipes/libgd/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 C) find_package(libgd CONFIG REQUIRED) diff --git a/recipes/libgd/all/test_v1_package/CMakeLists.txt b/recipes/libgd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libgd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libgd/all/test_v1_package/conanfile.py b/recipes/libgd/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libgd/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libgeotiff/all/conanfile.py b/recipes/libgeotiff/all/conanfile.py index 8420d20d07e09..557e23e5c4e53 100644 --- a/recipes/libgeotiff/all/conanfile.py +++ b/recipes/libgeotiff/all/conanfile.py @@ -45,7 +45,7 @@ def layout(self): def requirements(self): # 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.0") + self.requires("proj/9.3.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libgeotiff/all/test_package/CMakeLists.txt b/recipes/libgeotiff/all/test_package/CMakeLists.txt index 6f7f6667348cb..d94b2a5fccee6 100644 --- a/recipes/libgeotiff/all/test_package/CMakeLists.txt +++ b/recipes/libgeotiff/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(geotiff REQUIRED CONFIG) diff --git a/recipes/libgeotiff/all/test_v1_package/CMakeLists.txt b/recipes/libgeotiff/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libgeotiff/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libgeotiff/all/test_v1_package/conanfile.py b/recipes/libgeotiff/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libgeotiff/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_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/libgettext/all/conanfile.py b/recipes/libgettext/all/conanfile.py index a3d65fe027cb3..9532952752a09 100644 --- a/recipes/libgettext/all/conanfile.py +++ b/recipes/libgettext/all/conanfile.py @@ -124,6 +124,15 @@ def generate(self): if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler.version) >= "12") or \ (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler.version) >= "180"): tc.extra_cflags += ["-FS"] + + if self.settings.build_type == "Debug": + # Skip checking for the 'n' printf format directly + # in msvc, as it is known to not be available due to security concerns. + # Skipping it avoids a GUI prompt during ./configure for a debug build + # See https://github.com/conan-io/conan-center-index/issues/23698 + tc.configure_args.extend([ + 'gl_cv_func_printf_directive_n=no' + ]) tc.make_args += ["-C", "intl"] env = tc.environment() if is_msvc(self) or self._is_clang_cl: diff --git a/recipes/libgettext/all/test_package/CMakeLists.txt b/recipes/libgettext/all/test_package/CMakeLists.txt index 1ef1f4a228330..d36dd26179190 100644 --- a/recipes/libgettext/all/test_package/CMakeLists.txt +++ b/recipes/libgettext/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(Intl CONFIG REQUIRED) diff --git a/recipes/libgettext/all/test_package/conanfile.py b/recipes/libgettext/all/test_package/conanfile.py index b9667f823f2c1..50e1b261c1fd4 100644 --- a/recipes/libgettext/all/test_package/conanfile.py +++ b/recipes/libgettext/all/test_package/conanfile.py @@ -1,8 +1,6 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.env import Environment, VirtualRunEnv -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, rename +from conan.tools.cmake import CMake, cmake_layout import os @@ -10,6 +8,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" test_type = "explicit" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" def requirements(self): self.requires(self.tested_reference_str) @@ -17,33 +16,12 @@ def requirements(self): def layout(self): cmake_layout(self) - def generate(self): - CMakeDeps(self).generate() - CMakeToolchain(self).generate() - for locale, lang in [("en", "en_US"), ("ru", "ru_RU"), ("es", "es_ES")]: - env = Environment() - env.define("LANG", lang) - env.vars(self, scope=f"run_{locale}").save_script(f"locale_{locale}") - - VirtualRunEnv(self).generate(scope=f"run_{locale}") - def build(self): cmake = CMake(self) cmake.configure() cmake.build() - for locale in ["en", "ru", "es"]: - directory = os.path.join(self.source_folder, locale, "LC_MESSAGES") - if not os.path.isdir(directory): - os.makedirs(directory) - po_folder = os.path.join(self.source_folder, "po", locale) - dest_folder = os.path.join(self.source_folder, locale, "LC_MESSAGES") - copy(self, "conan.mo.workaround_git_ignore", po_folder, dest_folder) - mo_file = os.path.join(dest_folder, "conan.mo") - if not os.path.exists(mo_file): - rename(self, os.path.join(dest_folder, "conan.mo.workaround_git_ignore"), mo_file) def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - for locale in ["en", "ru", "es"]: - self.run(f"{bin_path} {os.path.abspath(self.source_folder)}", env=f"conanrun_{locale}") + self.run(bin_path, env=f"conanrun") diff --git a/recipes/libgettext/all/test_package/po/en/conan.mo.workaround_git_ignore b/recipes/libgettext/all/test_package/po/en/conan.mo.workaround_git_ignore deleted file mode 100644 index f2f426b3ff66b..0000000000000 Binary files a/recipes/libgettext/all/test_package/po/en/conan.mo.workaround_git_ignore and /dev/null differ diff --git a/recipes/libgettext/all/test_package/po/en/conan.po b/recipes/libgettext/all/test_package/po/en/conan.po deleted file mode 100644 index 082414b2e22f6..0000000000000 --- a/recipes/libgettext/all/test_package/po/en/conan.po +++ /dev/null @@ -1,23 +0,0 @@ -# Conan 1.0. -# Copyright (C) Bincrafters -# This file is distributed under the same license as the Conan package. -# Bincrafters , 2019. -msgid "" -msgstr "" -"Project-Id-Version: conan 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-11 03:48-0700\n" -"PO-Revision-Date: 2019-07-11 03:57-0700\n" -"Last-Translator: U-DESKTOP-HHN0EAP\\sse4 \n" -"Language-Team: English\n" -"Language: en\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. Example of i18n usage -#: hello.c:17 -#, c-format -msgid "hello" -msgstr "hello" diff --git a/recipes/libgettext/all/test_package/po/es/conan.mo.workaround_git_ignore b/recipes/libgettext/all/test_package/po/es/conan.mo.workaround_git_ignore deleted file mode 100644 index 941535abc76d2..0000000000000 Binary files a/recipes/libgettext/all/test_package/po/es/conan.mo.workaround_git_ignore and /dev/null differ diff --git a/recipes/libgettext/all/test_package/po/es/conan.po b/recipes/libgettext/all/test_package/po/es/conan.po deleted file mode 100644 index 29a2b6106de38..0000000000000 --- a/recipes/libgettext/all/test_package/po/es/conan.po +++ /dev/null @@ -1,23 +0,0 @@ -# Conan 1.0. -# Copyright (C) Bincrafters -# This file is distributed under the same license as the Conan package. -# Bincrafters , 2019. -msgid "" -msgstr "" -"Project-Id-Version: conan 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-11 03:48-0700\n" -"PO-Revision-Date: 2019-07-11 03:58-0700\n" -"Last-Translator: U-DESKTOP-HHN0EAP\\sse4 \n" -"Language-Team: Spanish\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. Example of i18n usage -#: hello.c:17 -#, c-format -msgid "hello" -msgstr "holla" diff --git a/recipes/libgettext/all/test_package/po/ru/conan.mo.workaround_git_ignore b/recipes/libgettext/all/test_package/po/ru/conan.mo.workaround_git_ignore deleted file mode 100644 index 8f1f836a04c91..0000000000000 Binary files a/recipes/libgettext/all/test_package/po/ru/conan.mo.workaround_git_ignore and /dev/null differ diff --git a/recipes/libgettext/all/test_package/po/ru/conan.po b/recipes/libgettext/all/test_package/po/ru/conan.po deleted file mode 100644 index 34ecc9f75cf1e..0000000000000 --- a/recipes/libgettext/all/test_package/po/ru/conan.po +++ /dev/null @@ -1,24 +0,0 @@ -# Conan 1.0. -# Copyright (C) Bincrafters -# This file is distributed under the same license as the Conan package. -# Bincrafters , 2019. -msgid "" -msgstr "" -"Project-Id-Version: conan 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-11 03:48-0700\n" -"PO-Revision-Date: 2019-07-11 03:58-0700\n" -"Last-Translator: U-DESKTOP-HHN0EAP\\sse4 \n" -"Language-Team: Russian\n" -"Language: ru\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#. Example of i18n usage -#: hello.c:17 -#, c-format -msgid "hello" -msgstr "privet" diff --git a/recipes/libgettext/all/test_package/test_package.c b/recipes/libgettext/all/test_package/test_package.c index 615e9408bed47..262221a2aba6a 100644 --- a/recipes/libgettext/all/test_package/test_package.c +++ b/recipes/libgettext/all/test_package/test_package.c @@ -1,26 +1,8 @@ #include -#include -#include #include -int main(int argc, char * const argv[]) -{ - if (argc < 2) - return -1; - if(!bindtextdomain("conan", argv[1])) - { - printf("Warning: Could not bind text domain\n"); - } - if(!textdomain("conan")) - { - printf("Warning: Could not set text domain\n"); - } - if(!setlocale(LC_ALL, "")) - { - printf("Warning: could not set locale\n"); - } - const char * lang = getenv("LANG"); - lang = lang ? lang : ""; - printf("hello in %s: %s\n", lang, gettext("hello")); +int main() { + gettext("Hello, world!"); + return 0; } diff --git a/recipes/libgettext/all/test_v1_package/CMakeLists.txt b/recipes/libgettext/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f9bddeec6f96a..0000000000000 --- a/recipes/libgettext/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Intl CONFIG REQUIRED) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libgettext/all/test_v1_package/conanfile.py b/recipes/libgettext/all/test_v1_package/conanfile.py deleted file mode 100644 index 36bfb4bd5c2c9..0000000000000 --- a/recipes/libgettext/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,31 +0,0 @@ -from conans import ConanFile, CMake, tools -from conan.tools.files import copy, rename -import os -import shutil - - -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() - for locale in ["en", "ru", "es"]: - directory = os.path.join(self.source_folder, locale, "LC_MESSAGES") - if not os.path.isdir(directory): - os.makedirs(directory) - po_folder = os.path.join(self.source_folder, "..", "test_package", "po", locale) - dest_folder = os.path.join(self.source_folder, locale, "LC_MESSAGES") - copy(self, "conan.mo.workaround_git_ignore", po_folder, dest_folder) - mo_file = os.path.join(dest_folder, "conan.mo") - if not os.path.exists(mo_file): - rename(self, os.path.join(dest_folder, "conan.mo.workaround_git_ignore"), mo_file) - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - for locale in ["en_US", "ru_RU", "es_ES"]: - with tools.environment_append({"LANG": locale}): - self.run(f"{bin_path} {os.path.abspath(self.source_folder)}", run_environment=True) diff --git a/recipes/libgit2/0.27.x/CMakeLists.txt b/recipes/libgit2/0.27.x/CMakeLists.txt deleted file mode 100644 index c502da172e7b8..0000000000000 --- a/recipes/libgit2/0.27.x/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(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libgit2/0.27.x/conandata.yml b/recipes/libgit2/0.27.x/conandata.yml deleted file mode 100644 index dddcd1d95b8f4..0000000000000 --- a/recipes/libgit2/0.27.x/conandata.yml +++ /dev/null @@ -1,4 +0,0 @@ -sources: - "0.27.10": - url: "https://github.com/libgit2/libgit2/archive/v0.27.10.tar.gz" - sha256: "f6fd26378ff71bd7a4b17b576c82c774a2e9c2d6b74b24718a8fb29551e1c4a5" diff --git a/recipes/libgit2/0.27.x/conanfile.py b/recipes/libgit2/0.27.x/conanfile.py deleted file mode 100644 index 07e2765904500..0000000000000 --- a/recipes/libgit2/0.27.x/conanfile.py +++ /dev/null @@ -1,156 +0,0 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration -import functools -import os - -required_conan_version = ">=1.45.0" - - -class LibGit2Conan(ConanFile): - name = "libgit2" - description = ( - "libgit2 is a portable, pure C implementation of the Git core methods " - "provided as a re-entrant linkable library with a solid API" - ) - topics = ("libgit2", "git", "scm") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://libgit2.org/" - license = "GPL-2.0-linking-exception" - - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - "threadsafe": [True, False], - "with_iconv": [True, False], - "with_libssh2": [True, False], - "with_https": [False, "openssl", "winhttp", "security"], - "with_sha1": ["collisiondetection", "commoncrypto", "openssl", "generic", "win32"], - } - default_options = { - "shared": False, - "fPIC": True, - "threadsafe": True, - "with_iconv": False, - "with_libssh2": True, - "with_https": "openssl", - "with_sha1": "collisiondetection", - } - - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - if not tools.is_apple_os(self.settings.os): - del self.options.with_iconv - - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - - @property - def _need_openssl(self): - return "openssl" in (self.options.with_https, self.options.with_sha1) - - def requirements(self): - self.requires("zlib/1.2.12") - self.requires("http_parser/2.9.4") - if self.options.with_libssh2: - self.requires("libssh2/1.10.0") - if self.settings.os != "Windows": - self.requires("libcurl/7.83.1") - if self._need_openssl: - self.requires("openssl/1.1.1o") - - def validate(self): - if self.options.with_https == "security": - if not tools.is_apple_os(self.settings.os): - raise ConanInvalidConfiguration("security is only valid for Apple products") - elif self.options.with_https == "winhttp": - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("winhttp is only valid on Windows") - - if self.options.with_sha1 == "win32": - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("win32 is only valid on Windows") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - _cmake_https = { - "openssl": "OpenSSL", - "winhttp": "WinHTTP", - "security": "SecureTransport", - False: "OFF", - } - - _cmake_sha1 = { - "collisiondetection": "CollisionDetection", - "commoncrypto": "CommonCrypto", - "openssl": "OpenSSL", - "generic": "Generic", - "win32": "Win32", - } - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["THREADSAFE"] = self.options.threadsafe - cmake.definitions["USE_SSH"] = self.options.with_libssh2 - - cmake.definitions["USE_ICONV"] = self.options.get_safe("with_iconv", False) - - cmake.definitions["USE_HTTPS"] = self._cmake_https[str(self.options.with_https)] - cmake.definitions["SHA1_BACKEND"] = self._cmake_sha1[str(self.options.with_sha1)] - - cmake.definitions["BUILD_CLAR"] = False - cmake.definitions["BUILD_EXAMPLES"] = False - - if is_msvc(self): - cmake.definitions["STATIC_CRT"] = is_msvc_static_runtime(self) - - cmake.configure() - return cmake - - def _patch_sources(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "FIND_PKGLIBRARIES(LIBSSH2 libssh2)", - "FIND_PACKAGE(Libssh2 REQUIRED)\n" - "\tSET(LIBSSH2_FOUND ON)\n" - "\tSET(LIBSSH2_INCLUDE_DIRS ${Libssh2_INCLUDE_DIRS})\n" - "\tSET(LIBSSH2_LIBRARIES ${Libssh2_LIBRARIES})\n" - "\tSET(LIBSSH2_LIBRARY_DIRS ${Libssh2_LIB_DIRS})") - - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "FIND_PKGLIBRARIES(CURL libcurl)", - "FIND_PACKAGE(CURL REQUIRED)\n") - - def build(self): - self._patch_sources() - cmake = self._configure_cmake() - cmake.build() - - def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "libgit2") - self.cpp_info.libs = ["git2"] - if self.settings.os == "Windows": - self.cpp_info.system_libs.extend(["winhttp", "rpcrt4", "crypt32"]) - if self.settings.os in ["Linux", "FreeBSD"] and self.options.threadsafe: - self.cpp_info.system_libs.append("pthread") diff --git a/recipes/libgit2/0.27.x/test_package/CMakeLists.txt b/recipes/libgit2/0.27.x/test_package/CMakeLists.txt deleted file mode 100644 index 912bdc647f324..0000000000000 --- a/recipes/libgit2/0.27.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libgit2 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libgit2::libgit2) diff --git a/recipes/libgit2/0.27.x/test_package/conanfile.py b/recipes/libgit2/0.27.x/test_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libgit2/0.27.x/test_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_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/libgit2/0.27.x/test_package/test_package.c b/recipes/libgit2/0.27.x/test_package/test_package.c deleted file mode 100644 index 1ea125101cdc8..0000000000000 --- a/recipes/libgit2/0.27.x/test_package/test_package.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - -int main() -{ - git_libgit2_init(); - int versionMajor, versionMinor, versionRev; - git_libgit2_version(&versionMajor, &versionMinor, &versionRev); - - printf("libgit2 v%i.%i.%i\n", versionMajor, versionMinor, versionRev); - - printf("Compile Features:\n"); - - int features = git_libgit2_features(); - - if (features & GIT_FEATURE_THREADS) - printf(" - Thread safe\n"); - else - printf(" - Single thread only\n"); - - if (features & GIT_FEATURE_HTTPS) - printf(" - TLS (openssl, winhttp or security)\n"); - else - printf(" - No TLS\n"); - - if (features & GIT_FEATURE_SSH) - printf(" - SSH (libssh2)\n"); - else - printf(" - No SSH support\n"); - - git_libgit2_shutdown(); - return 0; -} diff --git a/recipes/libgit2/0.28.x/CMakeLists.txt b/recipes/libgit2/0.28.x/CMakeLists.txt deleted file mode 100644 index c502da172e7b8..0000000000000 --- a/recipes/libgit2/0.28.x/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(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libgit2/0.28.x/conandata.yml b/recipes/libgit2/0.28.x/conandata.yml deleted file mode 100644 index 25994eed756a3..0000000000000 --- a/recipes/libgit2/0.28.x/conandata.yml +++ /dev/null @@ -1,4 +0,0 @@ -sources: - "0.28.5": - url: "https://github.com/libgit2/libgit2/archive/v0.28.5.tar.gz" - sha256: "2b7b68aee6f123bc84cc502a9c12738435b8054e7d628962e091cd2a25be4f42" diff --git a/recipes/libgit2/0.28.x/conanfile.py b/recipes/libgit2/0.28.x/conanfile.py deleted file mode 100644 index 7e3da960a3cb2..0000000000000 --- a/recipes/libgit2/0.28.x/conanfile.py +++ /dev/null @@ -1,160 +0,0 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration -import functools -import os - -required_conan_version = ">=1.45.0" - - -class LibGit2Conan(ConanFile): - name = "libgit2" - description = ( - "libgit2 is a portable, pure C implementation of the Git core methods " - "provided as a re-entrant linkable library with a solid API" - ) - topics = ("libgit2", "git", "scm") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://libgit2.org/" - license = "GPL-2.0-linking-exception" - - settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - "threadsafe": [True, False], - "with_iconv": [True, False], - "with_libssh2": [True, False], - "with_https": [False, "openssl", "mbedtls", "winhttp", "security"], - "with_sha1": ["collisiondetection", "commoncrypto", "openssl", "mbedtls", "generic", "win32"], - } - default_options = { - "shared": False, - "fPIC": True, - "threadsafe": True, - "with_iconv": False, - "with_libssh2": True, - "with_https": "openssl", - "with_sha1": "collisiondetection", - } - - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - if not tools.is_apple_os(self.settings.os): - del self.options.with_iconv - - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx - - @property - def _need_openssl(self): - return "openssl" in (self.options.with_https, self.options.with_sha1) - - @property - def _need_mbedtls(self): - return "mbedtls" in (self.options.with_https, self.options.with_sha1) - - def requirements(self): - self.requires("zlib/1.2.12") - self.requires("http_parser/2.9.4") - if self.options.with_libssh2: - self.requires("libssh2/1.10.0") - if self._need_openssl: - self.requires("openssl/1.1.1o") - if self._need_mbedtls: - self.requires("mbedtls/3.1.0") - if tools.is_apple_os(self.settings.os) and self.options.with_iconv: - self.requires("libiconv/1.16") - - def validate(self): - if self.options.with_https == "security": - if not tools.is_apple_os(self.settings.os): - raise ConanInvalidConfiguration("security is only valid for Apple products") - elif self.options.with_https == "winhttp": - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("winhttp is only valid on Windows") - - if self.options.with_sha1 == "win32": - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("win32 is only valid on Windows") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - _cmake_https = { - "openssl": "OpenSSL", - "winhttp": "WinHTTP", - "security": "SecureTransport", - "mbedtls": "mbedTLS", - False: "OFF", - } - - _cmake_sha1 = { - "collisiondetection": "CollisionDetection", - "commoncrypto": "CommonCrypto", - "openssl": "OpenSSL", - "mbedtls": "mbedTLS", - "generic": "Generic", - "win32": "Win32", - } - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["THREADSAFE"] = self.options.threadsafe - cmake.definitions["USE_SSH"] = self.options.with_libssh2 - - cmake.definitions["USE_ICONV"] = self.options.get_safe("with_iconv", False) - - cmake.definitions["USE_HTTPS"] = self._cmake_https[str(self.options.with_https)] - cmake.definitions["SHA1_BACKEND"] = self._cmake_sha1[str(self.options.with_sha1)] - - cmake.definitions["BUILD_CLAR"] = False - cmake.definitions["BUILD_EXAMPLES"] = False - - if is_msvc(self): - cmake.definitions["STATIC_CRT"] = is_msvc_static_runtime(self) - - cmake.configure() - return cmake - - def _patch_sources(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "FIND_PKGLIBRARIES(LIBSSH2 libssh2)", - "FIND_PACKAGE(Libssh2 REQUIRED)\n" - "\tSET(LIBSSH2_FOUND ON)\n" - "\tSET(LIBSSH2_INCLUDE_DIRS ${Libssh2_INCLUDE_DIRS})\n" - "\tSET(LIBSSH2_LIBRARIES ${Libssh2_LIBRARIES})\n" - "\tSET(LIBSSH2_LIBRARY_DIRS ${Libssh2_LIB_DIRS})") - - def build(self): - self._patch_sources() - cmake = self._configure_cmake() - cmake.build() - - def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - - def package_info(self): - self.cpp_info.set_property("pkg_config_name", "libgit2") - self.cpp_info.libs = ["git2"] - if self.settings.os == "Windows": - self.cpp_info.system_libs.extend(["winhttp", "rpcrt4", "crypt32"]) - if self.settings.os in ["Linux", "FreeBSD"] and self.options.threadsafe: - self.cpp_info.system_libs.append("pthread") diff --git a/recipes/libgit2/0.28.x/test_package/CMakeLists.txt b/recipes/libgit2/0.28.x/test_package/CMakeLists.txt deleted file mode 100644 index 912bdc647f324..0000000000000 --- a/recipes/libgit2/0.28.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libgit2 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libgit2::libgit2) diff --git a/recipes/libgit2/0.28.x/test_package/conanfile.py b/recipes/libgit2/0.28.x/test_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libgit2/0.28.x/test_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_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/libgit2/0.28.x/test_package/test_package.c b/recipes/libgit2/0.28.x/test_package/test_package.c deleted file mode 100644 index 96e8eda89c73b..0000000000000 --- a/recipes/libgit2/0.28.x/test_package/test_package.c +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - -int main() -{ - git_libgit2_init(); - int versionMajor, versionMinor, versionRev; - git_libgit2_version(&versionMajor, &versionMinor, &versionRev); - - printf("libgit2 v%i.%i.%i\n", versionMajor, versionMinor, versionRev); - - printf("Compile Features:\n"); - - int features = git_libgit2_features(); - - if (features & GIT_FEATURE_THREADS) - printf(" - Thread safe\n"); - else - printf(" - Single thread only\n"); - - if (features & GIT_FEATURE_HTTPS) - printf(" - TLS (openssl, mbedtls, winhttp or security)\n"); - else - printf(" - No TLS\n"); - - if (features & GIT_FEATURE_SSH) - printf(" - SSH (libssh2)\n"); - else - printf(" - No SSH support\n"); - - git_libgit2_shutdown(); - return 0; -} diff --git a/recipes/libgit2/all/CMakeLists.txt b/recipes/libgit2/all/CMakeLists.txt deleted file mode 100644 index c502da172e7b8..0000000000000 --- a/recipes/libgit2/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(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/libgit2/all/conandata.yml b/recipes/libgit2/all/conandata.yml index 7725b775b39de..966e9ed4a24c0 100644 --- a/recipes/libgit2/all/conandata.yml +++ b/recipes/libgit2/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.8.4": + url: "https://github.com/libgit2/libgit2/archive/v1.8.4.tar.gz" + sha256: "49d0fc50ab931816f6bfc1ac68f8d74b760450eebdb5374e803ee36550f26774" + "1.8.3": + url: "https://github.com/libgit2/libgit2/archive/v1.8.3.tar.gz" + sha256: "868810a5508d41dd7033d41bdc55312561f3f916d64f5b7be92bc1ff4dcae02a" + "1.8.2": + url: "https://github.com/libgit2/libgit2/archive/v1.8.2.tar.gz" + sha256: "184699f0d9773f96eeeb5cb245ba2304400f5b74671f313240410f594c566a28" + "1.8.1": + url: "https://github.com/libgit2/libgit2/archive/v1.8.1.tar.gz" + sha256: "8c1eaf0cf07cba0e9021920bfba9502140220786ed5d8a8ec6c7ad9174522f8e" + "1.7.2": + url: "https://github.com/libgit2/libgit2/archive/v1.7.2.tar.gz" + sha256: "de384e29d7efc9330c6cdb126ebf88342b5025d920dcb7c645defad85195ea7f" "1.5.0": url: "https://github.com/libgit2/libgit2/archive/v1.5.0.tar.gz" sha256: "8de872a0f201b33d9522b817c92e14edb4efad18dae95cf156cf240b2efff93e" @@ -18,21 +33,47 @@ sources: url: "https://github.com/libgit2/libgit2/archive/v1.0.1.tar.gz" sha256: "1775427a6098f441ddbaa5bd4e9b8a043c7401e450ed761e69a415530fea81d2" patches: + "1.8.4": + - patch_file: "patches/1.8.1-0001-fix-cmake.patch" + patch_description: "use cci's packages" + patch_type: "conan" + "1.8.3": + - patch_file: "patches/1.8.1-0001-fix-cmake.patch" + patch_description: "use cci's packages" + patch_type: "conan" + "1.8.2": + - patch_file: "patches/1.8.1-0001-fix-cmake.patch" + patch_description: "use cci's packages" + patch_type: "conan" + "1.8.1": + - patch_file: "patches/1.8.1-0001-fix-cmake.patch" + patch_description: "use cci's packages" + patch_type: "conan" + "1.7.2": + - patch_file: "patches/1.7.2-0001-fix-cmake.patch" + patch_description: "use cci's packages" + patch_type: "conan" "1.5.0": - patch_file: "patches/1.4.3-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.4.3": - patch_file: "patches/1.4.3-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.3.0": - patch_file: "patches/1.3.0-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.2.0": - patch_file: "patches/1.2.0-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.1.1": - patch_file: "patches/1.1.1-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" "1.0.1": - patch_file: "patches/1.0.1-0001-fix-cmake.patch" - base_path: "source_subfolder" + patch_description: "use cci's packages" + patch_type: "conan" diff --git a/recipes/libgit2/all/conanfile.py b/recipes/libgit2/all/conanfile.py index c042b13f51df6..ac07d7f6dac70 100644 --- a/recipes/libgit2/all/conanfile.py +++ b/recipes/libgit2/all/conanfile.py @@ -1,10 +1,14 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration -import functools +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.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.45.0" + +required_conan_version = ">=1.53.0" class LibGit2Conan(ConanFile): @@ -13,11 +17,11 @@ class LibGit2Conan(ConanFile): "libgit2 is a portable, pure C implementation of the Git core methods " "provided as a re-entrant linkable library with a solid API" ) - topics = ("libgit2", "git", "scm") + license = "GPL-2.0-linking-exception" url = "https://github.com/conan-io/conan-center-index" homepage = "https://libgit2.org/" - license = "GPL-2.0-linking-exception" - + topics = ("git", "scm") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,6 +33,7 @@ class LibGit2Conan(ConanFile): "with_sha1": ["collisiondetection", "commoncrypto", "openssl", "mbedtls", "generic", "win32"], "with_ntlmclient": [True, False], "with_regex": ["builtin", "pcre", "pcre2", "regcomp_l", "regcomp"], + "with_http_parser": ["http-parser", "llhttp"], } default_options = { "shared": False, @@ -40,23 +45,17 @@ class LibGit2Conan(ConanFile): "with_sha1": "collisiondetection", "with_ntlmclient": True, "with_regex": "builtin", + "with_http_parser": "http-parser", } - 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": del self.options.fPIC - if not tools.is_apple_os(self.settings.os): + if not is_apple_os(self): del self.options.with_iconv if self.settings.os == "Windows": @@ -65,27 +64,38 @@ def config_options(self): if self.settings.os == "Macos": self.options.with_regex = "regcomp_l" + # < 1.8.1 requries http_parser only. + if Version(self.version) < "1.8.1": + del self.options.with_http_parser + 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.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.12") - self.requires("http_parser/2.9.4") + self.requires("zlib/[>=1.2.11 <2]") + if Version(self.version) < "1.8.1" or self.options.get_safe("with_http_parser") == "http-parser": + self.requires("http_parser/2.9.4") + else: + self.requires("llhttp/9.1.3") + if self.options.with_libssh2: - self.requires("libssh2/1.10.0") + self.requires("libssh2/1.11.0") if self._need_openssl: - self.requires("openssl/1.1.1o") + self.requires("openssl/[>=1.1 <4]") if self._need_mbedtls: - self.requires("mbedtls/3.1.0") + self.requires("mbedtls/3.2.1") if self.options.get_safe("with_iconv"): - self.requires("libiconv/1.16") + self.requires("libiconv/1.17") if self.options.with_regex == "pcre": self.requires("pcre/8.45") elif self.options.with_regex == "pcre2": - self.requires("pcre2/10.40") + self.requires("pcre2/10.42") @property def _need_openssl(self): @@ -97,7 +107,7 @@ def _need_mbedtls(self): def validate(self): if self.options.with_https == "security": - if not tools.is_apple_os(self.settings.os): + if not is_apple_os(self): raise ConanInvalidConfiguration("security is only valid for Apple products") elif self.options.with_https == "winhttp": if self.settings.os != "Windows": @@ -108,22 +118,21 @@ def validate(self): raise ConanInvalidConfiguration("win32 is only valid on Windows") if self.options.with_regex == "regcomp" or self.options.with_regex == "regcomp_l": - if self.settings.compiler == "Visual Studio": + if is_msvc(self): raise ConanInvalidConfiguration("{} isn't supported by Visual Studio".format(self.options.with_regex)) if self.settings.os in ["iOS", "tvOS", "watchOS"] and self.options.with_regex == "regcomp_l": raise ConanInvalidConfiguration("regcomp_l isn't supported on {}".format(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_https = { "openssl": "OpenSSL", "winhttp": "WinHTTP", "security": "SecureTransport", "mbedtls": "mbedTLS", - False: "OFF", + "False": "OFF", } _cmake_sha1 = { @@ -133,49 +142,57 @@ def source(self): "mbedtls": "mbedTLS", "generic": "Generic", "win32": "Win32", + "False": "OFF", } - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["THREADSAFE"] = self.options.threadsafe - cmake.definitions["USE_SSH"] = self.options.with_libssh2 - - cmake.definitions["USE_ICONV"] = self.options.get_safe("with_iconv", False) - - cmake.definitions["USE_HTTPS"] = self._cmake_https[str(self.options.with_https)] - cmake.definitions["USE_SHA1"] = self._cmake_sha1[str(self.options.with_sha1)] - - if tools.Version(self.version) >= "1.4.0": - cmake.definitions["BUILD_TESTS"] = False - cmake.definitions["BUILD_CLAR"] = False - cmake.definitions["BUILD_EXAMPLES"] = False - cmake.definitions["USE_HTTP_PARSER"] = "system" - - cmake.definitions["REGEX_BACKEND"] = self.options.with_regex - + def generate(self): + tc = CMakeToolchain(self) + tc.variables["THREADSAFE"] = self.options.threadsafe + if Version(self.version) < "1.8.1": + tc.variables["USE_SSH"] = self.options.with_libssh2 + else: + tc.variables["USE_SSH"] = "libssh2" if self.options.with_libssh2 else False + tc.variables["USE_ICONV"] = self.options.get_safe("with_iconv", False) + tc.variables["USE_HTTPS"] = self._cmake_https[str(self.options.with_https)] + tc.variables["USE_SHA1"] = self._cmake_sha1[str(self.options.with_sha1)] + if Version(self.version) >= "1.4.0": + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_CLAR"] = False + tc.variables["BUILD_CLI"] = False + tc.variables["BUILD_EXAMPLES"] = False + if Version(self.version) < "1.8.1": + tc.variables["USE_HTTP_PARSER"] = "system" + else: + tc.variables["USE_HTTP_PARSER"] = self.options.get_safe("with_http_parser") + tc.variables["REGEX_BACKEND"] = self.options.with_regex if is_msvc(self): - cmake.definitions["STATIC_CRT"] = is_msvc_static_runtime(self) - - cmake.configure() - return cmake + tc.variables["STATIC_CRT"] = is_msvc_static_runtime(self) + # REGEX_BACKEND is SET(), avoid options overriding it + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + if self.options.get_safe("with_http_parser") == "llhttp": + deps.set_property("llhttp", "cmake_file_name", "LLHTTP") + 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("COPYING", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, pattern="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")) def package_info(self): self.cpp_info.set_property("pkg_config_name", "libgit2") self.cpp_info.libs = ["git2"] if self.settings.os == "Windows": self.cpp_info.system_libs.extend(["winhttp", "rpcrt4", "crypt32"]) + if Version(self.version) >= "1.7.0": + self.cpp_info.system_libs.append("secur32") if self.settings.os in ["Linux", "FreeBSD"] and self.options.threadsafe: self.cpp_info.system_libs.append("pthread") diff --git a/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch index 2f0d05b998d5d..3c23186ba4771 100644 --- a/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.0.1-0001-fix-cmake.patch @@ -1,5 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8264158..374a21c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,8 +11,8 @@ + # Install: + # > cmake --build . --target install + +-PROJECT(libgit2 C) + CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1) ++PROJECT(libgit2 C) + CMAKE_POLICY(SET CMP0015 NEW) + IF(POLICY CMP0051) + CMAKE_POLICY(SET CMP0051 NEW) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dff1d94..abd9c45 100644 +index dff1d94..25652b7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -158,11 +158,11 @@ ENDIF() @@ -31,3 +45,15 @@ index dff1d94..abd9c45 100644 ENDIF() IF (LIBSSH2_FOUND) SET(GIT_SSH 1) +@@ -209,10 +213,7 @@ IF (LIBSSH2_FOUND) + LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- SET(GIT_SSH_MEMORY_CREDENTIALS 1) +- ENDIF() ++ SET(GIT_SSH_MEMORY_CREDENTIALS 1) + ELSE() + MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + ENDIF() diff --git a/recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch index 5dc56b1a31b92..3abde1ad5528a 100644 --- a/recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.1.1-0001-fix-cmake.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index d01cc64..0941cbd 100644 +index d01cc64..5691f7e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -167,11 +167,11 @@ ENDIF() @@ -31,3 +31,15 @@ index d01cc64..0941cbd 100644 ENDIF() IF (LIBSSH2_FOUND) SET(GIT_SSH 1) +@@ -218,10 +222,7 @@ IF (LIBSSH2_FOUND) + LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- SET(GIT_SSH_MEMORY_CREDENTIALS 1) +- ENDIF() ++ SET(GIT_SSH_MEMORY_CREDENTIALS 1) + ELSE() + MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + ENDIF() diff --git a/recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch index 0fbbd568d7b10..950bd6ff11e0a 100644 --- a/recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.2.0-0001-fix-cmake.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 45dec27..783c657 100644 +index 45dec27..d7652f7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -178,11 +178,11 @@ ENDIF() @@ -31,3 +31,15 @@ index 45dec27..783c657 100644 ENDIF() IF (LIBSSH2_FOUND) SET(GIT_SSH 1) +@@ -239,10 +243,7 @@ IF (LIBSSH2_FOUND) + LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- SET(GIT_SSH_MEMORY_CREDENTIALS 1) +- ENDIF() ++ SET(GIT_SSH_MEMORY_CREDENTIALS 1) + ELSE() + MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + ENDIF() diff --git a/recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch index 997b6dd7759b0..34d77da78eff1 100644 --- a/recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.3.0-0001-fix-cmake.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index fdb3673..783c657 100644 +index fdb3673..d7652f7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -178,11 +178,11 @@ ENDIF() @@ -38,3 +38,15 @@ index fdb3673..783c657 100644 ENDIF() IF (LIBSSH2_FOUND) SET(GIT_SSH 1) +@@ -246,10 +243,7 @@ IF (LIBSSH2_FOUND) + LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- SET(GIT_SSH_MEMORY_CREDENTIALS 1) +- ENDIF() ++ SET(GIT_SSH_MEMORY_CREDENTIALS 1) + ELSE() + MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + ENDIF() diff --git a/recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch index 459414c1a9584..66a17f3f7e869 100644 --- a/recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch +++ b/recipes/libgit2/all/patches/1.4.3-0001-fix-cmake.patch @@ -18,7 +18,7 @@ index 955aea3..ff94eb8 100644 add_feature_info(http-parser ON "http-parser support (system)") else() diff --git a/cmake/SelectSSH.cmake b/cmake/SelectSSH.cmake -index 23dfc97..a094cc7 100644 +index 23dfc97..386f184 100644 --- a/cmake/SelectSSH.cmake +++ b/cmake/SelectSSH.cmake @@ -1,13 +1,10 @@ @@ -40,3 +40,15 @@ index 23dfc97..a094cc7 100644 if(NOT LIBSSH2_FOUND) message(FATAL_ERROR "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") +@@ -20,10 +17,7 @@ if(LIBSSH2_FOUND) + list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- if(HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- set(GIT_SSH_MEMORY_CREDENTIALS 1) +- endif() ++ set(GIT_SSH_MEMORY_CREDENTIALS 1) + else() + message(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + endif() diff --git a/recipes/libgit2/all/patches/1.7.2-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.7.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..8705249e1247a --- /dev/null +++ b/recipes/libgit2/all/patches/1.7.2-0001-fix-cmake.patch @@ -0,0 +1,70 @@ +diff --git a/cmake/SelectHTTPParser.cmake b/cmake/SelectHTTPParser.cmake +index 955aea3..ff94eb8 100644 +--- a/cmake/SelectHTTPParser.cmake ++++ b/cmake/SelectHTTPParser.cmake +@@ -1,10 +1,10 @@ + # Optional external dependency: http-parser + if(USE_HTTP_PARSER STREQUAL "system") +- find_package(HTTPParser) ++ find_package(http_parser) + +- if(HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2) +- list(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS}) +- list(APPEND LIBGIT2_SYSTEM_LIBS ${HTTP_PARSER_LIBRARIES}) ++ if(http_parser_FOUND) ++ list(APPEND LIBGIT2_SYSTEM_INCLUDES ${http_parser_INCLUDE_DIRS}) ++ list(APPEND LIBGIT2_SYSTEM_LIBS ${http_parser_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") + add_feature_info(http-parser ON "http-parser support (system)") + else() +diff --git a/cmake/SelectHTTPSBackend.cmake b/cmake/SelectHTTPSBackend.cmake +index d149416..33473ee 100644 +--- a/cmake/SelectHTTPSBackend.cmake ++++ b/cmake/SelectHTTPSBackend.cmake +@@ -9,6 +9,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + endif() + + if(USE_HTTPS) ++ if(WIN32) ++ list(APPEND LIBGIT2_SYSTEM_LIBS "secur32") ++ list(APPEND LIBGIT2_PC_LIBS "-lsecur32") ++ endif() ++ + # Auto-select TLS backend + sanitizebool(USE_HTTPS) + if(USE_HTTPS STREQUAL ON) +diff --git a/cmake/SelectSSH.cmake b/cmake/SelectSSH.cmake +index 23dfc97..386f184 100644 +--- a/cmake/SelectSSH.cmake ++++ b/cmake/SelectSSH.cmake +@@ -1,13 +1,10 @@ + # Optional external dependency: libssh2 + if(USE_SSH) +- find_pkglibraries(LIBSSH2 libssh2) +- if(NOT LIBSSH2_FOUND) +- find_package(LibSSH2) +- set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) +- get_filename_component(LIBSSH2_LIBRARY_DIRS "${LIBSSH2_LIBRARY}" DIRECTORY) +- set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY}) +- set(LIBSSH2_LDFLAGS "-lssh2") +- endif() ++ FIND_PACKAGE(Libssh2 REQUIRED) ++ SET(LIBSSH2_FOUND ON) ++ SET(LIBSSH2_INCLUDE_DIRS ${Libssh2_INCLUDE_DIRS}) ++ SET(LIBSSH2_LIBRARIES ${Libssh2_LIBRARIES}) ++ SET(LIBSSH2_LIBRARY_DIRS ${Libssh2_LIB_DIRS}) + + if(NOT LIBSSH2_FOUND) + message(FATAL_ERROR "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") +@@ -20,10 +17,7 @@ if(LIBSSH2_FOUND) + list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- if(HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- set(GIT_SSH_MEMORY_CREDENTIALS 1) +- endif() ++ set(GIT_SSH_MEMORY_CREDENTIALS 1) + else() + message(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") + endif() diff --git a/recipes/libgit2/all/patches/1.8.1-0001-fix-cmake.patch b/recipes/libgit2/all/patches/1.8.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..7515a48158c94 --- /dev/null +++ b/recipes/libgit2/all/patches/1.8.1-0001-fix-cmake.patch @@ -0,0 +1,72 @@ +diff --git a/cmake/SelectHTTPParser.cmake b/cmake/SelectHTTPParser.cmake +index 4fc1f69..1e8d83e 100644 +--- a/cmake/SelectHTTPParser.cmake ++++ b/cmake/SelectHTTPParser.cmake +@@ -1,10 +1,10 @@ + # Optional external dependency: http-parser + if(USE_HTTP_PARSER STREQUAL "http-parser") +- find_package(HTTPParser) ++ find_package(http_parser) + +- if(HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2) +- list(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS}) +- list(APPEND LIBGIT2_SYSTEM_LIBS ${HTTP_PARSER_LIBRARIES}) ++ if(http_parser_FOUND) ++ list(APPEND LIBGIT2_SYSTEM_INCLUDES ${http_parser_INCLUDE_DIRS}) ++ list(APPEND LIBGIT2_SYSTEM_LIBS ${http_parser_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") + set(GIT_HTTPPARSER_HTTPPARSER 1) + add_feature_info(http-parser ON "using http-parser (system)") +diff --git a/cmake/SelectHTTPSBackend.cmake b/cmake/SelectHTTPSBackend.cmake +index d293001..acffba9 100644 +--- a/cmake/SelectHTTPSBackend.cmake ++++ b/cmake/SelectHTTPSBackend.cmake +@@ -9,6 +9,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + endif() + + if(USE_HTTPS) ++ if(WIN32) ++ list(APPEND LIBGIT2_SYSTEM_LIBS "secur32") ++ list(APPEND LIBGIT2_PC_LIBS "-lsecur32") ++ endif() ++ + # Auto-select TLS backend + sanitizebool(USE_HTTPS) + if(USE_HTTPS STREQUAL ON) +diff --git a/cmake/SelectSSH.cmake b/cmake/SelectSSH.cmake +index 079857f..652b310 100644 +--- a/cmake/SelectSSH.cmake ++++ b/cmake/SelectSSH.cmake +@@ -4,15 +4,11 @@ if(USE_SSH STREQUAL "exec") + + add_feature_info(SSH ON "using OpenSSH exec support") + elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2") +- find_pkglibraries(LIBSSH2 libssh2) +- +- if(NOT LIBSSH2_FOUND) +- find_package(LibSSH2) +- set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) +- get_filename_component(LIBSSH2_LIBRARY_DIRS "${LIBSSH2_LIBRARY}" DIRECTORY) +- set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY}) +- set(LIBSSH2_LDFLAGS "-lssh2") +- endif() ++ FIND_PACKAGE(Libssh2 REQUIRED) ++ SET(LIBSSH2_FOUND ON) ++ SET(LIBSSH2_INCLUDE_DIRS ${Libssh2_INCLUDE_DIRS}) ++ SET(LIBSSH2_LIBRARIES ${Libssh2_LIBRARIES}) ++ SET(LIBSSH2_LIBRARY_DIRS ${Libssh2_LIB_DIRS}) + + if(NOT LIBSSH2_FOUND) + message(FATAL_ERROR "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") +@@ -22,10 +18,7 @@ elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2") + list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + +- check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- if(HAVE_LIBSSH2_MEMORY_CREDENTIALS) +- set(GIT_SSH_LIBSSH2_MEMORY_CREDENTIALS 1) +- endif() ++ set(GIT_SSH_MEMORY_CREDENTIALS 1) + + if(WIN32 AND EMBED_SSH_PATH) + file(GLOB SSH_SRC "${EMBED_SSH_PATH}/src/*.c") diff --git a/recipes/libgit2/all/test_package/CMakeLists.txt b/recipes/libgit2/all/test_package/CMakeLists.txt index 912bdc647f324..50fd1685c063b 100644 --- a/recipes/libgit2/all/test_package/CMakeLists.txt +++ b/recipes/libgit2/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(libgit2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libgit2::libgit2) +target_link_libraries(${PROJECT_NAME} PRIVATE libgit2::libgit2) diff --git a/recipes/libgit2/all/test_package/conanfile.py b/recipes/libgit2/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/libgit2/all/test_package/conanfile.py +++ b/recipes/libgit2/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/libgit2/config.yml b/recipes/libgit2/config.yml index c472349adb3cc..1a78cc1abe633 100644 --- a/recipes/libgit2/config.yml +++ b/recipes/libgit2/config.yml @@ -1,4 +1,14 @@ versions: + "1.8.4": + folder: "all" + "1.8.3": + folder: "all" + "1.8.2": + folder: "all" + "1.8.1": + folder: "all" + "1.7.2": + folder: "all" "1.5.0": folder: "all" "1.4.3": @@ -11,7 +21,3 @@ versions: folder: "all" "1.0.1": folder: "all" - "0.28.5": - folder: "0.28.x" - "0.27.10": - folder: "0.27.x" diff --git a/recipes/libglvnd/all/conanfile.py b/recipes/libglvnd/all/conanfile.py index 91471af4e7c75..422acffdcd2c7 100644 --- a/recipes/libglvnd/all/conanfile.py +++ b/recipes/libglvnd/all/conanfile.py @@ -8,7 +8,7 @@ import os import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class LibGlvndConan(ConanFile): name = "libglvnd" @@ -59,9 +59,9 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.name} is only compatible with Linux and FreeBSD") def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.4.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def layout(self): basic_layout(self, src_folder="src") @@ -87,6 +87,10 @@ def generate(self): tc.project_options["headers"] = self.options.headers tc.project_options["entrypoint-patching"] = "enabled" if self.options.entrypoint_patching else "disabled" tc.project_options["libdir"] = "lib" + # Configure the data directory so that it defaults to the correct location for ICD discovery on the local system. + tc.project_options["datadir"] = os.path.join("usr", "share") if self.settings.os == "Linux" else os.path.join("usr", "local", "share") + if self.settings.os == "FreeBSD": + tc.project_options["sysconfdir"] = os.path.join("usr", "local", "etc") tc.generate() def build(self): 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/all/conanfile.py b/recipes/libgpg-error/all/conanfile.py index 630c80e0b9233..2ed23af2c2e5b 100644 --- a/recipes/libgpg-error/all/conanfile.py +++ b/recipes/libgpg-error/all/conanfile.py @@ -57,10 +57,6 @@ def generate(self): ]) if self.options.get_safe("fPIC", True): tc.configure_args.append("--with-pic") - host = None - if self.settings.os == "Linux" and self.settings.arch == "x86": - host = "i686-linux-gnu" - tc.update_configure_args({"--host": host}) tc.generate() def build(self): diff --git a/recipes/libgpg-error/all/test_package/CMakeLists.txt b/recipes/libgpg-error/all/test_package/CMakeLists.txt index 9b783d3fcee67..92696c657ec13 100644 --- a/recipes/libgpg-error/all/test_package/CMakeLists.txt +++ b/recipes/libgpg-error/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(libgpg-error REQUIRED CONFIG) diff --git a/recipes/libgpg-error/all/test_v1_package/CMakeLists.txt b/recipes/libgpg-error/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libgpg-error/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libgpg-error/all/test_v1_package/conanfile.py b/recipes/libgpg-error/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libgpg-error/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_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/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..aa37e732ae2d3 100644 --- a/recipes/libgphoto2/all/conandata.yml +++ b/recipes/libgphoto2/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/libgphoto2/all/conanfile.py b/recipes/libgphoto2/all/conanfile.py index af18cb02458ef..f6d84c552b0a4 100644 --- a/recipes/libgphoto2/all/conanfile.py +++ b/recipes/libgphoto2/all/conanfile.py @@ -57,7 +57,7 @@ def requirements(self): if self.options.with_libcurl: self.requires("libcurl/[>=7.78.0 <9]") if self.options.with_libxml2: - self.requires("libxml2/2.11.5") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.with_libexif: self.requires("libexif/0.6.24") if self.options.with_libjpeg: @@ -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/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <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/libgphoto2/all/test_package/CMakeLists.txt b/recipes/libgphoto2/all/test_package/CMakeLists.txt index 55da1ef125aa5..1a209c377f55b 100644 --- a/recipes/libgphoto2/all/test_package/CMakeLists.txt +++ b/recipes/libgphoto2/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(libgphoto2 REQUIRED CONFIG) diff --git a/recipes/libgphoto2/all/test_v1_package/CMakeLists.txt b/recipes/libgphoto2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libgphoto2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libgphoto2/all/test_v1_package/conanfile.py b/recipes/libgphoto2/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libgphoto2/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_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/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/libgta/all/test_v1_package/CMakeLists.txt b/recipes/libgta/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libgta/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 84ee68733e516..0000000000000 --- a/recipes/libgta/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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 5f30969947a89..c0ad6ccc7db62 100644 --- a/recipes/libhal/all/conandata.yml +++ b/recipes/libhal/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://github.com/libhal/libhal/archive/refs/tags/2.2.0.tar.gz" + sha256: "4a005cb45bd75662ca7d966a1a55f3570d2a0db01432e17eb1e9889ae7c90ee4" "2.0.2": url: "https://github.com/libhal/libhal/archive/refs/tags/2.0.2.tar.gz" sha256: "bb69fffbff58ac9a91f71636422d81a4426fe70c3b47ca9b07c87fb074c989dc" diff --git a/recipes/libhal/all/test_package/CMakeLists.txt b/recipes/libhal/all/test_package/CMakeLists.txt index 1d38a74649aa2..16e3ffdffb9d8 100644 --- a/recipes/libhal/all/test_package/CMakeLists.txt +++ b/recipes/libhal/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(libhal REQUIRED CONFIG) diff --git a/recipes/libhal/all/test_v1_package/CMakeLists.txt b/recipes/libhal/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 390a1bca7ce2f..0000000000000 --- a/recipes/libhal/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 3.12) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libhal REQUIRED CONFIG) - -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/all/test_v1_package/conanfile.py b/recipes/libhal/all/test_v1_package/conanfile.py deleted file mode 100644 index 6adc2a597302e..0000000000000 --- a/recipes/libhal/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - - -class LibhalTestPackageConan(ConanFile): - settings = "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 cross_building(self): - bin_path = os.path.join(self.build_folder, "bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/libhal/config.yml b/recipes/libhal/config.yml index 855e335e2fd53..a5b4b5f8dd9a9 100644 --- a/recipes/libhal/config.yml +++ b/recipes/libhal/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.0": + folder: "all" "2.0.2": folder: "all" "2.0.1": diff --git a/recipes/libharu/all/conanfile.py b/recipes/libharu/all/conanfile.py index c35f205e346da..172d75e65c04a 100644 --- a/recipes/libharu/all/conanfile.py +++ b/recipes/libharu/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): def requirements(self): self.requires("zlib/[>=1.2.11 <2]") - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) diff --git a/recipes/libharu/all/test_package/CMakeLists.txt b/recipes/libharu/all/test_package/CMakeLists.txt index b0aef7cdad89b..4953dc4c2bca2 100644 --- a/recipes/libharu/all/test_package/CMakeLists.txt +++ b/recipes/libharu/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) diff --git a/recipes/libharu/all/test_v1_package/CMakeLists.txt b/recipes/libharu/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libharu/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libharu/all/test_v1_package/conanfile.py b/recipes/libharu/all/test_v1_package/conanfile.py deleted file mode 100644 index 4651d31d881e8..0000000000000 --- a/recipes/libharu/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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", "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) - if not os.path.isfile("test.pdf"): - raise ConanException("test did not create test.pdf") diff --git a/recipes/libheif/all/conandata.yml b/recipes/libheif/all/conandata.yml index e7a2fc9ba8c25..5dc100f24cce6 100644 --- a/recipes/libheif/all/conandata.yml +++ b/recipes/libheif/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.19.5": + url: "https://github.com/strukturag/libheif/releases/download/v1.19.5/libheif-1.19.5.tar.gz" + sha256: "d3cf0a76076115a070f9bc87cf5259b333a1f05806500045338798486d0afbaf" + "1.19.0": + url: "https://github.com/strukturag/libheif/releases/download/v1.19.0/libheif-1.19.0.tar.gz" + sha256: "c0323638557994791c7bf939ee9752e8a0f3f5ce4f07328daefa0159e3530eb4" + "1.18.2": + url: "https://github.com/strukturag/libheif/releases/download/v1.18.2/libheif-1.18.2.tar.gz" + sha256: "c4002a622bec9f519f29d84bfdc6024e33fd67953a5fb4dc2c2f11f67d5e45bf" + "1.18.1": + url: "https://github.com/strukturag/libheif/releases/download/v1.18.1/libheif-1.18.1.tar.gz" + sha256: "8702564b0f288707ea72b260b3bf4ba9bf7abfa7dac01353def3a86acd6bbb76" "1.16.2": url: "https://github.com/strukturag/libheif/releases/download/v1.16.2/libheif-1.16.2.tar.gz" sha256: "7f97e4205c0bd9f9b8560536c8bd2e841d1c9a6d610401eb3eb87ed9cdfe78ea" @@ -15,6 +27,8 @@ sources: url: "https://github.com/strukturag/libheif/releases/download/v1.9.1/libheif-1.9.1.tar.gz" sha256: "5f65ca2bd2510eed4e13bdca123131c64067e9dd809213d7aef4dc5e37948bca" patches: + "1.18.1": + - patch_file: "patches/0001-cmake_1.18.1.patch" "1.16.2": - patch_file: "patches/0001-cmake_1.16.2.patch" - patch_file: "patches/0002-plugins_cmake_1.16.2.patch" diff --git a/recipes/libheif/all/conanfile.py b/recipes/libheif/all/conanfile.py index 912d662dba19e..03ba06e99d6ae 100644 --- a/recipes/libheif/all/conanfile.py +++ b/recipes/libheif/all/conanfile.py @@ -1,20 +1,21 @@ 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, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class LibheifConan(ConanFile): name = "libheif" description = "libheif is an HEIF and AVIF file format decoder and encoder." - topics = ("heif", "codec", "video") + license = ("LGPL-3.0-only", "GPL-3.0-or-later", "MIT") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/strukturag/libheif" - license = ("LGPL-3.0-only", "GPL-3.0-or-later", "MIT") - + topics = ("heif", "codec", "video") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -24,6 +25,10 @@ class LibheifConan(ConanFile): "with_x265": [True, False], "with_libaomav1": [True, False], "with_dav1d": [True, False], + "with_jpeg": [True, False], + "with_openjpeg": [True, False], + "with_openjph": [True, False], + "with_openh264": [True, False], } default_options = { "shared": False, @@ -32,14 +37,29 @@ class LibheifConan(ConanFile): "with_x265": False, "with_libaomav1": False, "with_dav1d": False, + "with_jpeg": False, + "with_openjpeg": False, + "with_openjph": False, + "with_openh264": False, } + @property + def _min_cppstd(self): + return "20" if Version(self.version) >= "1.19.0" else "11" + 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) < "1.17.0": + del self.options.with_jpeg + del self.options.with_openjpeg + if Version(self.version) < "1.18.0": + del self.options.with_openjph + if Version(self.version) < "1.19.0": + del self.options.with_openh264 def configure(self): if self.options.shared: @@ -57,29 +77,58 @@ def requirements(self): self.requires("libaom-av1/3.6.1") if self.options.with_dav1d: self.requires("dav1d/1.2.1") + if self.options.get_safe("with_jpeg"): + self.requires("libjpeg/9f") + if self.options.get_safe("with_openjpeg"): + self.requires("openjpeg/2.5.2") + if self.options.get_safe("with_openjph"): + self.requires("openjph/0.16.0", transitive_headers=False) + if self.options.get_safe("with_openh264"): + self.requires("openh264/2.4.1") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) + + def build_requirements(self): + if Version(self.version) >= "1.18.0": + self.tool_requires("cmake/[>=3.16 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) + tc.variables["WITH_LIBSHARPYUV"] = False tc.variables["WITH_LIBDE265"] = self.options.with_libde265 tc.variables["WITH_X265"] = self.options.with_x265 tc.variables["WITH_AOM"] = self.options.with_libaomav1 + tc.variables["WITH_AOM_DECODER"] = self.options.with_libaomav1 + tc.variables["WITH_AOM_ENCODER"] = self.options.with_libaomav1 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.variables["BUILD_TESTING"] = False + tc.variables["WITH_JPEG_DECODER"] = self.options.get_safe("with_jpeg", False) + tc.variables["WITH_JPEG_ENCODER"] = self.options.get_safe("with_jpeg", False) + tc.variables["WITH_OpenJPEG_DECODER"] = self.options.get_safe("with_openjpeg", False) + tc.variables["WITH_OpenJPEG_ENCODER"] = self.options.get_safe("with_openjpeg", False) + tc.variables["WITH_OPENJPH_ENCODER"] = self.options.get_safe("with_openjph", False) + tc.variables["WITH_OPENH264_DECODER"] = self.options.get_safe("with_openh264", False) + # Disable finding possible Doxygen in system, so no docs are built + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Doxygen"] = True + tc.cache_variables["CMAKE_COMPILE_WARNING_AS_ERROR"] = False tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "1.18.0": + deps.set_property("libde265", "cmake_file_name", "LIBDE265") + deps.set_property("openjph", "cmake_file_name", "OPENJPH") + if Version(self.version) >= "1.19.0": + deps.set_property("openh264", "cmake_file_name", "OpenH264") deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -95,26 +144,32 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "libheif") self.cpp_info.set_property("cmake_target_name", "libheif::heif") self.cpp_info.set_property("pkg_config_name", "libheif") - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["heif"].libs = ["heif"] + self.cpp_info.libs = ["heif"] + if not self.options.shared: - self.cpp_info.components["heif"].defines = ["LIBHEIF_STATIC_BUILD"] + self.cpp_info.defines = ["LIBHEIF_STATIC_BUILD"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["heif"].system_libs.extend(["m", "pthread"]) + self.cpp_info.system_libs.extend(["m", "pthread"]) + if Version(self.version) >= "1.18.0": + self.cpp_info.system_libs.append("dl") if not self.options.shared: libcxx = stdcpp_library(self) if libcxx: - self.cpp_info.components["heif"].system_libs.append(libcxx) + self.cpp_info.system_libs.append(libcxx) - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["heif"].set_property("cmake_target_name", "libheif::heif") - self.cpp_info.components["heif"].set_property("pkg_config_name", "libheif") - self.cpp_info.components["heif"].requires = [] if self.options.with_libde265: - self.cpp_info.components["heif"].requires.append("libde265::libde265") + self.cpp_info.requires.append("libde265::libde265") if self.options.with_x265: - self.cpp_info.components["heif"].requires.append("libx265::libx265") + self.cpp_info.requires.append("libx265::libx265") if self.options.with_libaomav1: - self.cpp_info.components["heif"].requires.append("libaom-av1::libaom-av1") + self.cpp_info.requires.append("libaom-av1::libaom-av1") if self.options.with_dav1d: - self.cpp_info.components["heif"].requires.append("dav1d::dav1d") + self.cpp_info.requires.append("dav1d::dav1d") + if self.options.get_safe("with_jpeg"): + self.cpp_info.requires.append("libjpeg::libjpeg") + if self.options.get_safe("with_openjpeg"): + self.cpp_info.requires.append("openjpeg::openjpeg") + if self.options.get_safe("with_openjph"): + self.cpp_info.requires.append("openjph::openjph") + if self.options.get_safe("with_openh264"): + self.cpp_info.requires.append("openh264::openh264") diff --git a/recipes/libheif/all/patches/0001-cmake_1.18.1.patch b/recipes/libheif/all/patches/0001-cmake_1.18.1.patch new file mode 100644 index 0000000000000..271d7b71513e3 --- /dev/null +++ b/recipes/libheif/all/patches/0001-cmake_1.18.1.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 12c4039..2ea1805 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,7 +47,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) diff --git a/recipes/libheif/all/test_package/CMakeLists.txt b/recipes/libheif/all/test_package/CMakeLists.txt index 13ebf8fab7134..4b961334a4ffd 100644 --- a/recipes/libheif/all/test_package/CMakeLists.txt +++ b/recipes/libheif/all/test_package/CMakeLists.txt @@ -1,8 +1,12 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(libheif REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE libheif::heif) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(libheif_VERSION VERSION_GREATER_EQUAL "1.19.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/libheif/config.yml b/recipes/libheif/config.yml index 887a8fb56ade3..dfd934f80e6b2 100644 --- a/recipes/libheif/config.yml +++ b/recipes/libheif/config.yml @@ -1,4 +1,12 @@ versions: + "1.19.5": + folder: all + "1.19.0": + folder: all + "1.18.2": + folder: all + "1.18.1": + folder: all "1.16.2": folder: all "1.13.0": diff --git a/recipes/libhydrogen/all/test_package/CMakeLists.txt b/recipes/libhydrogen/all/test_package/CMakeLists.txt index 2090c80502872..d17680c94cc30 100644 --- a/recipes/libhydrogen/all/test_package/CMakeLists.txt +++ b/recipes/libhydrogen/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 C) find_package(hydrogen REQUIRED CONFIG) diff --git a/recipes/libhydrogen/all/test_v1_package/CMakeLists.txt b/recipes/libhydrogen/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libhydrogen/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libhydrogen/all/test_v1_package/conanfile.py b/recipes/libhydrogen/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libhydrogen/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_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/libiberty/all/test_package/CMakeLists.txt b/recipes/libiberty/all/test_package/CMakeLists.txt index c618a0e2a663b..82a044ff1f487 100644 --- a/recipes/libiberty/all/test_package/CMakeLists.txt +++ b/recipes/libiberty/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(libiberty REQUIRED CONFIG) diff --git a/recipes/libiberty/all/test_v1_package/CMakeLists.txt b/recipes/libiberty/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libiberty/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libiberty/all/test_v1_package/conanfile.py b/recipes/libiberty/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libiberty/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_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/libiconv/all/conandata.yml b/recipes/libiconv/all/conandata.yml index 445cf39835a93..5428e7af62ee4 100644 --- a/recipes/libiconv/all/conandata.yml +++ b/recipes/libiconv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.18": + url: "https://ftp.gnu.org/gnu/libiconv/libiconv-1.18.tar.gz" + sha256: "3b08f5f4f9b4eb82f151a7040bfd6fe6c6fb922efe4b1659c66ea933276965e8" "1.17": url: "https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz" sha256: "8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313" diff --git a/recipes/libiconv/all/conanfile.py b/recipes/libiconv/all/conanfile.py index 544fb2b4ab962..dc7183e60b8e4 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 @@ -17,7 +18,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class LibiconvConan(ConanFile): @@ -48,10 +49,6 @@ def _is_clang_cl(self): def _msvc_tools(self): return ("clang-cl", "llvm-lib", "lld-link") if self._is_clang_cl else ("cl", "lib", "link") - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - def export_sources(self): export_conandata_patches(self) @@ -73,7 +70,7 @@ def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): - if self._settings_build.os == "Windows": + 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.win_bash = True @@ -86,15 +83,11 @@ def generate(self): env.generate() tc = AutotoolsToolchain(self) - msvc_version = {"Visual Studio": "12", "msvc": "180"} - if is_msvc(self) and Version(self.settings.compiler.version) >= msvc_version[str(self.settings.compiler)]: - # https://github.com/conan-io/conan/issues/6514 - tc.extra_cflags.append("-FS") if cross_building(self) and is_msvc(self): triplet_arch_windows = {"x86_64": "x86_64", "x86": "i686", "armv8": "aarch64"} # ICU doesn't like GNU triplet of conan for msvc (see https://github.com/conan-io/conan/issues/12546) host_arch = triplet_arch_windows.get(str(self.settings.arch)) - build_arch = triplet_arch_windows.get(str(self._settings_build.arch)) + build_arch = triplet_arch_windows.get(str(self.settings_build.arch)) if host_arch and build_arch: host = f"{host_arch}-w64-mingw32" @@ -119,8 +112,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() @@ -142,8 +142,3 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "Iconv") self.cpp_info.set_property("cmake_target_name", "Iconv::Iconv") self.cpp_info.libs = ["iconv", "charset"] - - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "Iconv" - self.cpp_info.names["cmake_find_package_multi"] = "Iconv" - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/libiconv/all/test_package/CMakeLists.txt b/recipes/libiconv/all/test_package/CMakeLists.txt index 64fa90dede848..7f90bc181b814 100644 --- a/recipes/libiconv/all/test_package/CMakeLists.txt +++ b/recipes/libiconv/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(Iconv REQUIRED) diff --git a/recipes/libiconv/all/test_v1_package/CMakeLists.txt b/recipes/libiconv/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libiconv/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libiconv/all/test_v1_package/conanfile.py b/recipes/libiconv/all/test_v1_package/conanfile.py deleted file mode 100644 index a831367c532bc..0000000000000 --- a/recipes/libiconv/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - - 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/libiconv/config.yml b/recipes/libiconv/config.yml index 107f427ec4419..15eab2155ff2c 100644 --- a/recipes/libiconv/config.yml +++ b/recipes/libiconv/config.yml @@ -1,4 +1,6 @@ versions: + "1.18": + folder: all "1.17": folder: all "1.16": diff --git a/recipes/libid3tag/all/conandata.yml b/recipes/libid3tag/all/conandata.yml index e1a2be66778cb..a8183f5791725 100644 --- a/recipes/libid3tag/all/conandata.yml +++ b/recipes/libid3tag/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "0.15.1b": - url: "https://downloads.sourceforge.net/project/mad/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz" - sha256: 63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151 + "0.16.3": + url: "https://codeberg.org/tenacityteam/libid3tag/archive/0.16.3.tar.gz" + sha256: "0561009778513a95d91dac33cee8418d6622f710450a7cb56a74636d53b588cb" diff --git a/recipes/libid3tag/all/conanfile.py b/recipes/libid3tag/all/conanfile.py index ec346961d3ce4..ecd9d02816275 100644 --- a/recipes/libid3tag/all/conanfile.py +++ b/recipes/libid3tag/all/conanfile.py @@ -1,124 +1,68 @@ -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.tools.cmake import CMake, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=2.4" class LibId3TagConan(ConanFile): name = "libid3tag" description = "ID3 tag manipulation library." - topics = ("conan", "mad", "id3", "MPEG", "audio", "decoder") - 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" - - _autotools = None + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://codeberg.org/tenacityteam/libid3tag/" + topics = ("mad", "id3", "mp3", "MPEG", "audio", "decoder") + generators = "CMakeDeps", "CMakeToolchain" - @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": - del self.options.fPIC + languages = ["C"] + implements = ["auto_shared_fpic"] - def configure(self): - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zlib/1.2.11") - - @property - def _is_msvc(self): - return self.settings.compiler == "Visual Studio" or ( - self.settings.compiler == "clang" and self.settings.os == "Windows" - ) - - 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) - - 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") + 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) def build(self): - if self._is_msvc: - self._build_msvc() - 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 + cmake = CMake(self) + cmake.configure() + cmake.build() - @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 package(self): + for license_file in ["COPYRIGHT", "COPYING", "CREDITS"]: + copy(self, license_file, self.source_folder, os.path.join(self.package_folder, "licenses")) - def _install_autotools(self): - autotools = self._configure_autotools() - autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + cmake = CMake(self) + cmake.install() - 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) - else: - self._install_autotools() + 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 = ["libid3tag" if self._is_msvc else "id3tag"] + self.cpp_info.libs = ["id3tag"] + + if Version(self.version) >= "0.16": + # These are the actual upstream target names + # However older versions of the recipe did not reflect these - + # So ensure only newly published versions use these target names, to prevent breakages + # (consumers still have to update when they move to using a new version) + self.cpp_info.set_property("cmake_file_name", "id3tag") + self.cpp_info.set_property("cmake_target_name", "id3tag::id3tag") + self.cpp_info.set_property("pkg_config_name", "id3tag") diff --git a/recipes/libid3tag/all/test_package/CMakeLists.txt b/recipes/libid3tag/all/test_package/CMakeLists.txt index 7b9b613cbb24a..fb1586277b921 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(id3tag REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE id3tag::id3tag) diff --git a/recipes/libid3tag/all/test_package/conanfile.py b/recipes/libid3tag/all/test_package/conanfile.py index d4128b0450777..a804618d0f86f 100644 --- a/recipes/libid3tag/all/test_package/conanfile.py +++ b/recipes/libid3tag/all/test_package/conanfile.py @@ -1,10 +1,23 @@ -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" + 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.generate() def build(self): cmake = CMake(self) @@ -12,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/libid3tag/all/test_package/test_package.c b/recipes/libid3tag/all/test_package/test_package.c index ef86650029180..7e9688dc0c76f 100644 --- a/recipes/libid3tag/all/test_package/test_package.c +++ b/recipes/libid3tag/all/test_package/test_package.c @@ -4,13 +4,9 @@ int main() { - printf("id3tag version: %s\n", id3_version); - printf("id3tag copyright: %s\n", id3_copyright); - printf("id3tag author: %s\n", id3_author); - printf("id3tag build: %s\n", id3_build); - struct id3_tag tag; id3_tag_version(&tag); + printf("id3tag default tag version: %d\n", tag.version); return 0; } diff --git a/recipes/libid3tag/config.yml b/recipes/libid3tag/config.yml index e7028aaa1acf5..aebc28f27ed97 100644 --- a/recipes/libid3tag/config.yml +++ b/recipes/libid3tag/config.yml @@ -1,3 +1,3 @@ versions: - "0.15.1b": + "0.16.3": folder: all diff --git a/recipes/libidn/all/conandata.yml b/recipes/libidn/all/conandata.yml index 8be8baf6f09f3..fcb454914799b 100644 --- a/recipes/libidn/all/conandata.yml +++ b/recipes/libidn/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "1.36": - patch_file: "patches/0001-unconditional-system-stdint-h.patch" - base_path: "source_subfolder" diff --git a/recipes/libidn/all/conanfile.py b/recipes/libidn/all/conanfile.py index 49221670d5e8e..2512e8efab52b 100644 --- a/recipes/libidn/all/conanfile.py +++ b/recipes/libidn/all/conanfile.py @@ -1,13 +1,14 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, rmdir -from conan.tools.scm import Version -from conans import AutoToolsBuildEnvironment, tools -import contextlib -import functools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv, Environment +from conan.tools.files import get, rmdir, export_conandata_patches, apply_conandata_patches, copy, replace_in_file, rm, save +from conan.tools.gnu import AutotoolsToolchain, Autotools, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path, is_msvc + +required_conan_version = ">=1.53.0" class LibIdnConan(ConanFile): @@ -17,6 +18,8 @@ class LibIdnConan(ConanFile): topics = ("libidn", "encode", "decode", "internationalized", "domain", "name") license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,17 +32,12 @@ class LibIdnConan(ConanFile): "threads": True, } - @property - def _source_subfolder(self): - return "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": @@ -47,91 +45,120 @@ 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): self.requires("libiconv/1.17") - def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Shared libraries are not supported on Windows due to libtool limitation") - 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.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): - 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(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".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), - } - with tools.environment_append(env): - yield - else: - yield + 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") - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.libs = [] + tc = AutotoolsToolchain(self) if not self.options.shared: - autotools.defines.append("LIBIDN_STATIC") - if self.settings.compiler == "Visual Studio": - 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) + tc.extra_defines.append("LIBIDN_STATIC") 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)), + tc.configure_args += [ "--enable-threads={}".format(yes_no(self.options.threads)), - "--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)), + "--with-libiconv-prefix={}".format(unix_path(self, self.dependencies["libiconv"].package_folder)), + "--disable-csharp", "--disable-nls", "--disable-rpath", ] - autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return autotools - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if self.settings.compiler == "Visual Studio": + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + dep_info = self.dependencies["libiconv"].cpp_info.aggregated_components() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in dep_info.includedirs] + [f"-D{d}" for d in dep_info.defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in (dep_info.libs + dep_info.system_libs)]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in dep_info.libdirs] + dep_info.sharedlinkflags + dep_info.exelinkflags) + env.append("CFLAGS", dep_info.cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_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)) + # Workaround for iconv.lib not being found due to linker flag order + libiconv_libdir = unix_path(self, self.dependencies["libiconv"].cpp_info.aggregated_components().libdir) + env.define("CC", f"{compile_wrapper} cl -nologo -L{libiconv_libdir}") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f'{ar_wrapper} lib') + env.vars(self).save_script("conanbuild_msvc") + + def _patch_sources(self): + apply_conandata_patches(self) + # Disable examples and tests + for subdir in ["examples", "tests", "fuzz", "gltests", os.path.join("lib", "gltests"), "doc"]: + save(self, os.path.join(self.source_folder, subdir, "Makefile.in"), "all:\ninstall:\n") + + if is_msvc(self): if self.settings.arch in ("x86_64", "armv8", "armv8.3"): ssize = "signed long long int" else: ssize = "signed long int" - tools.replace_in_file(os.path.join(self._source_subfolder, "lib", "stringprep.h"), - "ssize_t", ssize) - with self._build_context(): - autotools = self._configure_autotools() - autotools.make(args=["V=1"]) + replace_in_file(self, os.path.join(self.source_folder, "lib", "stringprep.h"), "ssize_t", ssize) - def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with self._build_context(): - autotools = self._configure_autotools() - autotools.install() + if self.settings.os == "Windows": + # Otherwise tries to create a symlink from GNUmakefile to itself, which fails on Windows + replace_in_file(self, os.path.join(self.source_folder, "configure"), + '"$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;;', "") + replace_in_file(self, os.path.join(self.source_folder, "configure"), + 'ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"', "") + def build(self): + self._patch_sources() + autotools = Autotools(self) + 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() 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") + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + + if is_msvc(self) and self.options.shared: + os.rename(os.path.join(self.package_folder, "lib", "idn.dll.lib"), + os.path.join(self.package_folder, "lib", "idn-12.lib")) def package_info(self): - self.cpp_info.libs = ["idn"] - self.cpp_info.names["pkg_config"] = "libidn" + if is_msvc(self) and self.options.shared: + self.cpp_info.libs = ["idn-12"] + else: + self.cpp_info.libs = ["idn"] + self.cpp_info.set_property("pkg_config_name", "libidn") if self.settings.os in ["Linux", "FreeBSD"]: if self.options.threads: self.cpp_info.system_libs = ["pthread"] @@ -139,7 +166,6 @@ def package_info(self): if not self.options.shared: self.cpp_info.defines = ["LIBIDN_STATIC"] + # 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/libidn/all/test_package/CMakeLists.txt b/recipes/libidn/all/test_package/CMakeLists.txt index 7b9b613cbb24a..3482998466c6b 100644 --- a/recipes/libidn/all/test_package/CMakeLists.txt +++ b/recipes/libidn/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(libidn REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libidn::libidn) diff --git a/recipes/libidn/all/test_package/conanfile.py b/recipes/libidn/all/test_package/conanfile.py index 07c965844de9b..441cef7471a37 100644 --- a/recipes/libidn/all/test_package/conanfile.py +++ b/recipes/libidn/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, run=True) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,8 +22,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run("idn --help", run_environment=True) + if can_run(self): + self.run("idn --help", env="conanrun") - 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") diff --git a/recipes/libidn2/all/conandata.yml b/recipes/libidn2/all/conandata.yml index b710e69645f11..22aeb22c019d0 100644 --- a/recipes/libidn2/all/conandata.yml +++ b/recipes/libidn2/all/conandata.yml @@ -1,8 +1,10 @@ sources: + "2.3.8": + url: "https://ftp.gnu.org/gnu/libidn/libidn2-2.3.8.tar.gz" + sha256: "f557911bf6171621e1f72ff35f5b1825bb35b52ed45325dcdee931e5d3c0787a" "2.3.0": url: "https://ftp.gnu.org/gnu/libidn/libidn2-2.3.0.tar.gz" sha256: "e1cb1db3d2e249a6a3eb6f0946777c2e892d5c5dc7bd91c74394fc3a01cab8b5" patches: "2.3.0": - patch_file: "patches/0001-no-versioning-of-symbols.patch" - base_path: "source_subfolder" diff --git a/recipes/libidn2/all/conanfile.py b/recipes/libidn2/all/conanfile.py index 0a83958ffe3fd..18257e8db29d2 100644 --- a/recipes/libidn2/all/conanfile.py +++ b/recipes/libidn2/all/conanfile.py @@ -1,18 +1,30 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from contextlib import contextmanager 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.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, 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 + +required_conan_version = ">=1.53.0" class LibIdn(ConanFile): name = "libidn2" - description = "GNU Libidn is a fully documented implementation of the Stringprep, Punycode and IDNA 2003 specifications." - homepage = "https://www.gnu.org/software/libidn/" - topics = ("libidn", "encode", "decode", "internationalized", "domain", "name") + description = ( + "GNU Libidn is a fully documented implementation of the Stringprep, Punycode and IDNA 2003" + " specifications." + ) license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/libidn/" + topics = ("libidn", "encode", "decode", "internationalized", "domain", "name") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -21,17 +33,13 @@ class LibIdn(ConanFile): "shared": False, "fPIC": True, } - settings = "os", "arch", "compiler", "build_type" - - _autotools = None @property - def _source_subfolder(self): - return "source_subfolder" + 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": @@ -39,93 +47,104 @@ 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("libiconv/1.16") - - def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("Shared libraries are not supported on Windows due to libtool limitation") + def layout(self): + basic_layout(self, src_folder="src") - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + def requirements(self): + self.requires("libiconv/1.17") 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.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") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - @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".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), - } - with tools.environment_append(env): - yield - else: - yield + 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") - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.libs = [] + tc = AutotoolsToolchain(self) if not self.options.shared: - self._autotools.defines.append("IDN2_STATIC") - if self.settings.compiler == "Visual Studio": - if tools.Version(self.settings.compiler.version) >= "12": - self._autotools.flags.append("-FS") - self._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" - conf_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--with-libiconv-prefix={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)), + tc.extra_defines.append("IDN2_STATIC") + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.configure_args += [ + f"--with-libiconv-prefix={unix_path(self, self.dependencies['libiconv'].package_folder)}", "--disable-nls", "--disable-rpath", ] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) - return self._autotools + tc.generate() + + if is_msvc(self): + env = Environment() + dep_info = self.dependencies["libiconv"].cpp_info.aggregated_components() + env.append("CPPFLAGS", [f"-I{unix_path(self, p)}" for p in dep_info.includedirs] + [f"-D{d}" for d in dep_info.defines]) + env.append("_LINK_", [lib if lib.endswith(".lib") else f"{lib}.lib" for lib in (dep_info.libs + dep_info.system_libs)]) + env.append("LDFLAGS", [f"-L{unix_path(self, p)}" for p in dep_info.libdirs] + dep_info.sharedlinkflags + dep_info.exelinkflags) + env.append("CFLAGS", dep_info.cflags) + env.vars(self).save_script("conanautotoolsdeps_cl_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)) + dumpbin_nm = unix_path(self, os.path.join(self.source_folder, "dumpbin_nm.py")) + 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.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() - autotools.make() + apply_conandata_patches(self) + 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() os.unlink(os.path.join(self.package_folder, "lib", "libidn2.la")) + 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) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + if is_msvc(self) and self.options.shared: + os.rename(os.path.join(self.package_folder, "lib", "idn2.dll.lib"), + os.path.join(self.package_folder, "lib", "idn2-0.lib")) + copy(self, "idn2.exe", + os.path.join(self.build_folder, "src", ".libs"), + os.path.join(self.package_folder, "bin")) def package_info(self): - self.cpp_info.libs = ["idn2"] - self.cpp_info.names["pkg_config"] = "libidn2" + if is_msvc(self) and self.options.shared: + self.cpp_info.libs = ["idn2-0"] + else: + self.cpp_info.libs = ["idn2"] + self.cpp_info.set_property("pkg_config_name", "libidn2") if self.settings.os == "Windows": if not self.options.shared: self.cpp_info.defines = ["IDN2_STATIC"] 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/libidn2/all/test_package/CMakeLists.txt b/recipes/libidn2/all/test_package/CMakeLists.txt index 7b9b613cbb24a..2279e3cb07d2a 100644 --- a/recipes/libidn2/all/test_package/CMakeLists.txt +++ b/recipes/libidn2/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(libidn2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libidn2::libidn2) diff --git a/recipes/libidn2/all/test_package/conanfile.py b/recipes/libidn2/all/test_package/conanfile.py index ae0c2ab3c933c..f56ad0548e3d9 100644 --- a/recipes/libidn2/all/test_package/conanfile.py +++ b/recipes/libidn2/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, run=True) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,9 +21,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run("idn2 --help", run_environment=True) - - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + self.run("idn2 --help", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libidn2/config.yml b/recipes/libidn2/config.yml index 33ababb05e322..1711f7983737e 100644 --- a/recipes/libidn2/config.yml +++ b/recipes/libidn2/config.yml @@ -1,3 +1,5 @@ versions: + "2.3.8": + folder: "all" "2.3.0": folder: "all" diff --git a/recipes/libiec61850/all/conandata.yml b/recipes/libiec61850/all/conandata.yml new file mode 100644 index 0000000000000..9b1ec43758314 --- /dev/null +++ b/recipes/libiec61850/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.6.0": + url: "https://github.com/mz-automation/libiec61850/archive/refs/tags/v1.6.0.tar.gz" + sha256: "0dd0adc7f13215e961d22511bcb1dadfdbdaab969f11a0d975775a6ebdff8099" diff --git a/recipes/libiec61850/all/conanfile.py b/recipes/libiec61850/all/conanfile.py new file mode 100644 index 0000000000000..0503db52a7890 --- /dev/null +++ b/recipes/libiec61850/all/conanfile.py @@ -0,0 +1,77 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy, replace_in_file, rmdir, rm +from conan.tools.scm import Version + +required_conan_version = ">=2.1" + +class Libiec61850Conan(ConanFile): + name = "libiec61850" + description = "An open-source library for the IEC 61850 protocols." + license = "LGPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libiec61850.com/libiec61850" + topics = ("iec61850", "mms", "goose", "sampled values") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + languages = ["C"] + implements = ["auto_shared_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_EXAMPLES"] = False + tc.cache_variables["BUILD_TESTS"] = False + tc.cache_variables["FIND_PACKAGE_DISABLE_Doxygen"] = True + tc.generate() + + def build(self): + target_type = "-shared" if self.options.get_safe("shared") else "" + replace_in_file(self, os.path.join(self.source_folder, "hal", "CMakeLists.txt"), + "install (TARGETS hal hal-shared", f"install (TARGETS hal{target_type}") + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "install (TARGETS iec61850 iec61850-shared", f"install (TARGETS iec61850{target_type}") + cmake = CMake(self) + cmake.configure() + target = "iec61850-shared" if self.options.get_safe("shared") else "iec61850" + cmake.build(target=target) + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + for dll_pattern_to_remove in ["concrt*.dll", "msvcp*.dll", "vcruntime*.dll"]: + rm(self, pattern=dll_pattern_to_remove, folder=os.path.join(self.package_folder, "bin"), + recursive=True) + + if Version(self.version) == "1.6.0": + # https://github.com/mz-automation/libiec61850/commit/a133aa8d573d63555899580869643590db9a7d85 + copy(self, "tls_ciphers.h", os.path.join(self.source_folder, "hal", "inc"), + os.path.join(self.package_folder, "include", "libiec61850")) + + def package_info(self): + self.cpp_info.components["iec61850"].libs = ["iec61850"] + self.cpp_info.components["iec61850"].set_property("cmake_target_name", "iec61850") + self.cpp_info.components["hal"].libs = ["hal-shared"] if self.options.get_safe("shared") else ["hal"] + self.cpp_info.components["iec61850"].requires=["hal"] + self.cpp_info.components["iec61850"].set_property("pkg_config_name", "libiec61850") + if self.settings.os in ["Linux"]: + self.cpp_info.components["iec61850"].system_libs.append("pthread") + self.cpp_info.components["iec61850"].system_libs.append("rt") diff --git a/recipes/libiec61850/all/test_package/CMakeLists.txt b/recipes/libiec61850/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e88f51214b2c9 --- /dev/null +++ b/recipes/libiec61850/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(libiec61850) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} iec61850) diff --git a/recipes/libiec61850/all/test_package/conanfile.py b/recipes/libiec61850/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c37539acafafe --- /dev/null +++ b/recipes/libiec61850/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + + 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/libiec61850/all/test_package/test_package.cpp b/recipes/libiec61850/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0cd36d83e092c --- /dev/null +++ b/recipes/libiec61850/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include + +#include "libiec61850/iec61850_common.h" + +int main(int argc, char **argv) +{ + std::cout << "libiec61850 v" << LibIEC61850_getVersionString() << std::endl; + return 0; +} diff --git a/recipes/libiec61850/config.yml b/recipes/libiec61850/config.yml new file mode 100644 index 0000000000000..225152169dbd8 --- /dev/null +++ b/recipes/libiec61850/config.yml @@ -0,0 +1,3 @@ +versions: + "1.6.0": + folder: all diff --git a/recipes/libigl/2.x.x/CMakeLists.txt b/recipes/libigl/2.x.x/CMakeLists.txt deleted file mode 100644 index 64994fe16fd84..0000000000000 --- a/recipes/libigl/2.x.x/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project(conanlibigl) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -find_package(Eigen3 REQUIRED) - -add_subdirectory(source_subfolder) diff --git a/recipes/libigl/2.x.x/conandata.yml b/recipes/libigl/2.x.x/conandata.yml deleted file mode 100644 index 1ac5bf040c202..0000000000000 --- a/recipes/libigl/2.x.x/conandata.yml +++ /dev/null @@ -1,8 +0,0 @@ -sources: - "2.3.0": - sha256: 5124443c2657023394039fe56fb240d4f7a867723ee4ebba053eaeb881ed7455 - url: https://github.com/libigl/libigl/archive/refs/tags/v2.3.0.zip -patches: - "2.3.0": - - patch_file: "patches/0001-correct-fpic.patch" - base_path: "source_subfolder" diff --git a/recipes/libigl/2.x.x/conanfile.py b/recipes/libigl/2.x.x/conanfile.py deleted file mode 100644 index f5ac50b8841ac..0000000000000 --- a/recipes/libigl/2.x.x/conanfile.py +++ /dev/null @@ -1,140 +0,0 @@ -import os -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration - - -class LibiglConan(ConanFile): - name = "libigl" - description = ("Simple C++ geometry processing library") - topics = ("conan", "libigl", "geometry", "matrices", "algorithms") - url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/**"] - homepage = "https://libigl.github.io/" - license = "MPL-2.0" - settings = "os", "arch", "compiler", "build_type" - options = {"header_only": [True, False], "fPIC": [True, False]} - default_options = {"header_only": True, "fPIC": True} - generators = "cmake", "cmake_find_package" - requires = ("eigen/3.3.9") - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _minimum_cpp_standard(self): - return 14 - - @property - def _minimum_compilers_version(self): - return { - "Visual Studio": "16", - "gcc": "6", - "clang": "3.4", - "apple-clang": "5.1", - } - - 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)) - 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 == "Visual Studio" and "MT" in self.settings.compiler.runtime and not self.options.header_only: - raise ConanInvalidConfiguration("Visual Studio build with MT runtime is not supported") - if "arm" in self.settings.arch or "x86" is self.settings.arch: - raise ConanInvalidConfiguration("Not available for arm. Requested arch: {}".format(self.settings.arch)) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if self.options.header_only: - del self.options.fPIC - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self, parallel=False) - self._cmake.definitions["LIBIGL_EXPORT_TARGETS"] = True - self._cmake.definitions["LIBIGL_USE_STATIC_LIBRARY"] = not self.options.header_only - - # All these dependencies are needed to build the examples or the tests - self._cmake.definitions["LIBIGL_BUILD_TUTORIALS"] = "OFF" - self._cmake.definitions["LIBIGL_BUILD_TESTS"] = "OFF" - self._cmake.definitions["LIBIGL_BUILD_PYTHON"] = "OFF" - - self._cmake.definitions["LIBIGL_WITH_CGAL"] = False - self._cmake.definitions["LIBIGL_WITH_COMISO"] = False - self._cmake.definitions["LIBIGL_WITH_CORK"] = False - self._cmake.definitions["LIBIGL_WITH_EMBREE"] = False - self._cmake.definitions["LIBIGL_WITH_MATLAB"] = False - self._cmake.definitions["LIBIGL_WITH_MOSEK"] = False - self._cmake.definitions["LIBIGL_WITH_OPENGL"] = False - self._cmake.definitions["LIBIGL_WITH_OPENGL_GLFW"] = False - self._cmake.definitions["LIBIGL_WITH_OPENGL_GLFW_IMGUI"] = False - self._cmake.definitions["LIBIGL_WITH_PNG"] = False - self._cmake.definitions["LIBIGL_WITH_TETGEN"] = False - self._cmake.definitions["LIBIGL_WITH_TRIANGLE"] = False - self._cmake.definitions["LIBIGL_WITH_XML"] = False - self._cmake.definitions["LIBIGL_WITH_PYTHON"] = "OFF" - self._cmake.definitions["LIBIGL_WITH_PREDICATES"] = False - return self._cmake - - def build(self): - self._patch_sources() - cmake = self._configure_cmake() - cmake.configure() - cmake.build() - - def package(self): - cmake = self._configure_cmake() - cmake.install() - self.copy("LICENSE.GPL", dst="licenses", src=self._source_subfolder) - self.copy("LICENSE.MPL2", dst="licenses", src=self._source_subfolder) - - tools.rmdir(os.path.join(self.package_folder, "share")) - if not self.options.header_only: - tools.remove_files_by_mask(self.package_folder, "*.c") - tools.remove_files_by_mask(self.package_folder, "*.cpp") - - def package_id(self): - if self.options.header_only: - self.info.header_only() - - def package_info(self): - self.cpp_info.filenames["cmake_find_package"] = "libigl" - self.cpp_info.filenames["cmake_find_package_multi"] = "libigl" - self.cpp_info.names["cmake_find_package"] = "igl" - self.cpp_info.names["cmake_find_package_multi"] = "igl" - - self.cpp_info.components["igl_common"].names["cmake_find_package"] = "common" - self.cpp_info.components["igl_common"].names["cmake_find_package_multi"] = "common" - self.cpp_info.components["igl_common"].libs = [] - self.cpp_info.components["igl_common"].requires = ["eigen::eigen"] - if self.settings.os == "Linux": - self.cpp_info.components["igl_common"].system_libs = ["pthread"] - - self.cpp_info.components["igl_core"].names["cmake_find_package"] = "core" - self.cpp_info.components["igl_core"].names["cmake_find_package_multi"] = "core" - self.cpp_info.components["igl_core"].requires = ["igl_common"] - if not self.options.header_only: - self.cpp_info.components["igl_core"].libs = ["igl"] - self.cpp_info.components["igl_core"].defines.append("IGL_STATIC_LIBRARY") diff --git a/recipes/libigl/2.x.x/patches/0001-correct-fpic.patch b/recipes/libigl/2.x.x/patches/0001-correct-fpic.patch deleted file mode 100644 index 6a5a6c38650c0..0000000000000 --- a/recipes/libigl/2.x.x/patches/0001-correct-fpic.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/cmake/libigl.cmake b/cmake/libigl.cmake -index 6de1b418..0cc75fcd 100644 ---- a/cmake/libigl.cmake -+++ b/cmake/libigl.cmake -@@ -96,11 +96,6 @@ if(BUILD_SHARED_LIBS) - set_target_properties(igl_common PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON) - endif() - --if(UNIX AND NOT HUNTER_ENABLED) -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") --endif() -- - if(HUNTER_ENABLED) - hunter_add_package(Eigen) - find_package(Eigen3 CONFIG REQUIRED) - diff --git a/recipes/libigl/2.x.x/test_package/CMakeLists.txt b/recipes/libigl/2.x.x/test_package/CMakeLists.txt deleted file mode 100644 index 174c1ae49d642..0000000000000 --- a/recipes/libigl/2.x.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libigl REQUIRED CONFIG) - -add_executable(example example.cpp) -target_link_libraries(example igl::core) -target_compile_features(example PUBLIC cxx_std_11) diff --git a/recipes/libigl/2.x.x/test_package/conanfile.py b/recipes/libigl/2.x.x/test_package/conanfile.py deleted file mode 100644 index 321eb52ae4077..0000000000000 --- a/recipes/libigl/2.x.x/test_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -import os - -from conans import ConanFile, CMake, tools - - -class LibiglTestConan(ConanFile): - settings = "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/libigl/all/conan_deps.cmake b/recipes/libigl/all/conan_deps.cmake new file mode 100644 index 0000000000000..4c824341569d9 --- /dev/null +++ b/recipes/libigl/all/conan_deps.cmake @@ -0,0 +1 @@ +find_package(Eigen3 REQUIRED) diff --git a/recipes/libigl/all/conandata.yml b/recipes/libigl/all/conandata.yml new file mode 100644 index 0000000000000..d6842af62c120 --- /dev/null +++ b/recipes/libigl/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.5.0": + url: "https://github.com/libigl/libigl/archive/refs/tags/v2.5.0.zip" + sha256: "84af6a5f9266a4c1ce530f9ef8028c8a3569318563012d72a753622f61ea2f68" + "2.3.0": + url: "https://github.com/libigl/libigl/archive/refs/tags/v2.3.0.zip" + sha256: "5124443c2657023394039fe56fb240d4f7a867723ee4ebba053eaeb881ed7455" +patches: + "2.3.0": + - patch_file: "patches/001-replace-random_shuffle.patch" + patch_type: "portability" + patch_description: "Replace std::random_shuffle that was removed in C++17" + patch_source: "https://github.com/libigl/libigl/commit/3f3d186db7c2f5ce79194c3439134ca5faf2818a" diff --git a/recipes/libigl/all/conanfile.py b/recipes/libigl/all/conanfile.py new file mode 100644 index 0000000000000..232115da3d96e --- /dev/null +++ b/recipes/libigl/all/conanfile.py @@ -0,0 +1,214 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +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, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class LibiglConan(ConanFile): + name = "libigl" + description = "Simple C++ geometry processing library" + # As per https://libigl.github.io/license/, the library itself is MPL-2, components are not + # No issue as we don't build them, but if done so in the future, please update this field! + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libigl.github.io/" + topics = ("geometry", "matrices", "algorithms", "header-only") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "header_only": [True, False], + } + default_options = { + "fPIC": True, + "header_only": False, + } + + @property + def _minimum_cpp_standard(self): + return 14 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "6", + "clang": "3.4", + "apple-clang": "5.1", + } + + def export_sources(self): + export_conandata_patches(self) + copy(self, "conan_deps.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 + + def configure(self): + if self.options.header_only: + self.options.rm_safe("fPIC") + # No automatic detection for non "library" package-types, manually override + self.package_type = "header-library" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) >= "2.5.0": + self.requires("eigen/3.4.0", transitive_headers=True) + else: + # 3.4.0 is not compatible with older versions + self.requires("eigen/3.3.9", transitive_headers=True) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def validate_build(self): + if (os.getenv('CONAN_CENTER_BUILD_SERVICE') is not None and + Version(self.version) == "2.3.0" and self.settings.build_type == "Debug"): + raise ConanInvalidConfiguration("Debug build disabled from building in CCI due to excessive memory use in ConanCenter CI") + + def validate(self): + if Version(self.version) < "2.4.0" and "arm" in self.settings.arch: + raise ConanInvalidConfiguration(f"Old versions of this library do not support {self.settings.arch} architecture") + if self.settings.arch == "x86": + raise ConanInvalidConfiguration(f"Architecture {self.settings.arch} is not supported") + if is_msvc_static_runtime(self) and not self.options.header_only: + raise ConanInvalidConfiguration("Visual Studio build with MT runtime is not supported") + + def loose_lt_semver(v1, v2): + return all(int(p1) < int(p2) for p1, p2 in zip(str(v1).split("."), str(v2).split("."))) + + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if min_version and loose_lt_semver(self.settings.compiler.version, min_version): + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._minimum_cpp_standard} support. The current compiler" + f" {self.settings.compiler} {self.settings.compiler.version} does not support it." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_libigl_INCLUDE"] = "conan_deps.cmake" + tc.variables["LIBIGL_USE_STATIC_LIBRARY"] = not self.options.header_only + tc.variables["LIBIGL_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0048"] = "NEW" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + + # All these dependencies are needed to build the examples or the tests + tc.variables["LIBIGL_BUILD_TUTORIALS"] = False + tc.variables["LIBIGL_BUILD_TESTS"] = False + tc.variables["LIBIGL_BUILD_PYTHON"] = False + + if Version(self.version) >= "2.4.0": + tc.variables["LIBIGL_EMBREE"] = False + tc.variables["LIBIGL_GLFW"] = False + tc.variables["LIBIGL_IMGUI"] = False + tc.variables["LIBIGL_OPENGL"] = False + tc.variables["LIBIGL_STB"] = False + tc.variables["LIBIGL_PREDICATES"] = False + tc.variables["LIBIGL_SPECTRA"] = False + tc.variables["LIBIGL_XML"] = False + tc.variables["LIBIGL_COPYLEFT_CORE"] = False + tc.variables["LIBIGL_COPYLEFT_CGAL"] = False + tc.variables["LIBIGL_COPYLEFT_COMISO"] = False + tc.variables["LIBIGL_COPYLEFT_TETGEN"] = False + tc.variables["LIBIGL_RESTRICTED_MATLAB"] = False + tc.variables["LIBIGL_RESTRICTED_MOSEK"] = False + tc.variables["LIBIGL_RESTRICTED_TRIANGLE"] = False + tc.variables["LIBIGL_GLFW_TESTS"] = False + else: + tc.variables["LIBIGL_EXPORT_TARGETS"] = True + tc.variables["LIBIGL_WITH_EMBREE"] = False + tc.variables["LIBIGL_WITH_OPENGL_GLFW"] = False + tc.variables["LIBIGL_WITH_OPENGL_GLFW_IMGUI"] = False + tc.variables["LIBIGL_WITH_OPENGL"] = False + tc.variables["LIBIGL_WITH_PNG"] = False + tc.variables["LIBIGL_WITH_PREDICATES"] = False + tc.variables["LIBIGL_WITH_XML"] = False + tc.variables["LIBIGL_WITH_CGAL"] = False + tc.variables["LIBIGL_WITH_COMISO"] = False + tc.variables["LIBIGL_WITH_CORK"] = False + tc.variables["LIBIGL_WITH_TETGEN"] = False + tc.variables["LIBIGL_WITH_MATLAB"] = False + tc.variables["LIBIGL_WITH_MOSEK"] = False + tc.variables["LIBIGL_WITH_TRIANGLE"] = False + tc.variables["LIBIGL_WITH_PYTHON"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) < "2.4.0": + libigl_cmake = os.path.join(self.source_folder, "cmake", "libigl.cmake") + replace_in_file(self, libigl_cmake, "-fPIC", "") + replace_in_file(self, libigl_cmake, "INTERFACE_POSITION_INDEPENDENT_CODE ON", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + try: + cmake.build() + except ConanException: + # Workaround for C3I running out of memory during build + self.conf.define("tools.build:jobs", 1) + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + # If components are built and packaged in the future, uncomment this line, their license is different + # copy(self, "LICENSE.GPL", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE.MPL2", 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, "lib", "cmake")) + if not self.options.header_only: + rm(self, "*.c", self.package_folder, recursive=True) + rm(self, "*.cpp", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libigl") + self.cpp_info.set_property("cmake_target_name", "igl::igl") + + self.cpp_info.components["common"].set_property("cmake_target_name", "igl::common") + self.cpp_info.components["common"].requires = ["eigen::eigen"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["common"].system_libs = ["pthread"] + + self.cpp_info.components["core"].set_property("cmake_target_name", "igl::core") + self.cpp_info.components["core"].requires = ["common"] + if not self.options.header_only: + self.cpp_info.components["core"].libs = ["igl"] + self.cpp_info.components["core"].defines.append("IGL_STATIC_LIBRARY") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "libigl" + self.cpp_info.filenames["cmake_find_package_multi"] = "libigl" + self.cpp_info.names["cmake_find_package"] = "igl" + self.cpp_info.names["cmake_find_package_multi"] = "igl" diff --git a/recipes/libigl/all/patches/001-replace-random_shuffle.patch b/recipes/libigl/all/patches/001-replace-random_shuffle.patch new file mode 100644 index 0000000000000..fa53d862ad422 --- /dev/null +++ b/recipes/libigl/all/patches/001-replace-random_shuffle.patch @@ -0,0 +1,31 @@ +From 3f3d186db7c2f5ce79194c3439134ca5faf2818a Mon Sep 17 00:00:00 2001 +From: Jeremie Dumas +Date: Wed, 5 Jan 2022 11:26:47 -0800 +Subject: [PATCH] Fix blue noise random shuffle. + +--- + include/igl/blue_noise.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/include/igl/blue_noise.cpp b/include/igl/blue_noise.cpp +index ac447feb42..10df1ad1ba 100644 +--- a/include/igl/blue_noise.cpp ++++ b/include/igl/blue_noise.cpp +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + namespace igl + { +@@ -209,7 +210,8 @@ namespace igl + } + //printf(" --------\n"); + // randomize order: this might be a little paranoid... +- std::random_shuffle(std::begin(N), std::end(N)); ++ std::mt19937 twister; ++ std::shuffle(std::begin(N), std::end(N), twister); + bool found = false; + for(const BlueNoiseKeyType & nk : N) + { diff --git a/recipes/libigl/all/test_package/CMakeLists.txt b/recipes/libigl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eba5d0a0a901d --- /dev/null +++ b/recipes/libigl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(libigl REQUIRED CONFIG) + +add_executable(example example.cpp) +target_link_libraries(example igl::core) +target_compile_features(example PUBLIC cxx_std_11) diff --git a/recipes/libigl/all/test_package/conanfile.py b/recipes/libigl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8d52b7021efe1 --- /dev/null +++ b/recipes/libigl/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, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/libigl/2.x.x/test_package/example.cpp b/recipes/libigl/all/test_package/example.cpp similarity index 100% rename from recipes/libigl/2.x.x/test_package/example.cpp rename to recipes/libigl/all/test_package/example.cpp diff --git a/recipes/libigl/config.yml b/recipes/libigl/config.yml index 58d1203871eb7..7578fb2ee13b0 100644 --- a/recipes/libigl/config.yml +++ b/recipes/libigl/config.yml @@ -1,3 +1,5 @@ versions: + "2.5.0": + folder: "all" "2.3.0": - folder: "2.x.x" + folder: "all" diff --git a/recipes/libinput/all/conandata.yml b/recipes/libinput/all/conandata.yml new file mode 100644 index 0000000000000..541bad5e261c8 --- /dev/null +++ b/recipes/libinput/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.25.0": + url: "https://gitlab.freedesktop.org/libinput/libinput/-/archive/1.25.0/libinput-1.25.0.tar.bz2" + sha256: "193bd592298bd9e369c0ef3e5d83a6a9d68ddc4cd3dfc84bbe77920a8d0d57df" diff --git a/recipes/libinput/all/conanfile.py b/recipes/libinput/all/conanfile.py new file mode 100644 index 0000000000000..0b86139ccb90d --- /dev/null +++ b/recipes/libinput/all/conanfile.py @@ -0,0 +1,154 @@ +import os +import textwrap + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rmdir, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain + + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" + + +class LibinputConan(ConanFile): + name = "libinput" + description = "libinput is a library that handles input devices for display servers and other applications that need to directly deal with input devices." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.freedesktop.org/wiki/Software/libinput/" + topics = ("device", "display", "event", "input") + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "epoll_dir": [None, "ANY"], + "debug_gui": [True, False], + "with_libudev": ["eudev", "systemd"], + "with_libwacom": [True, False], + "with_wayland": [True, False], + "with_x11": [True, False], + } + default_options = { + "epoll_dir": None, + "debug_gui": False, + "with_libudev": "systemd", + # todo Package libwacom and enable this option by default. + "with_libwacom": False, + "with_wayland": True, + "with_x11": True, + } + + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + if not self.options.debug_gui: + self.options.rm_safe("with_wayland") + self.options.rm_safe("with_x11") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("mtdev/1.1.6") + self.requires("libevdev/1.13.1") + + if self.options.debug_gui: + self.requires("cairo/1.18.0") + self.requires("glib/2.78.3") + self.requires("gtk/system") + if self.options.with_wayland: + self.requires("wayland/1.22.0") + if self.options.with_x11: + self.requires("xorg/system") + + if self.options.with_libudev == "systemd": + self.requires("libudev/system", transitive_libs=True) + elif self.options.with_libudev == "eudev": + self.requires("eudev/3.2.14", transitive_libs=True) + + def validate(self): + if self.settings.os not in ["FreeBSD", "Linux"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") + if self.options.with_libwacom: + raise ConanInvalidConfiguration(f"The with_libwacom option for {self.ref} is not yet supported. Contributions welcome.") + + def build_requirements(self): + self.tool_requires("meson/1.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + if self.options.get_safe("with_wayland"): + if self._has_build_profile: + self.tool_requires("wayland/") + self.tool_requires("wayland-protocols/1.33") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = VirtualBuildEnv(self) + tc.generate() + if self.options.get_safe("with_wayland") and not self._has_build_profile: + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = MesonToolchain(self) + tc.project_options["build.pkg_config_path"] = self.generators_folder + tc.project_options["coverity"] = False + tc.project_options["datadir"] = "res" + tc.project_options["documentation"] = False + tc.project_options["epoll-dir"] = '' if self.options.epoll_dir is None else str(self.options.epoll_dir) + tc.project_options["debug-gui"] = self.options.debug_gui + tc.project_options["install-tests"] = False + # Change libexecdir so that the libinput subdirectory in the bin directory doesn't conflict with the libinput executable. + tc.project_options["libexecdir"] = "libexec" + tc.project_options["libwacom"] = self.options.with_libwacom + tc.project_options["tests"] = False + tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self.options.get_safe("with_wayland"): + 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 + wp_prefix = self.dependencies.build["wayland-protocols"].package_folder + wp_version = self.dependencies.build["wayland-protocols"].ref.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 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() + + copy(self, f"{self.name}-*", os.path.join(self.package_folder, "libexec", self.name), os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "libexec")) + + rmdir(self, 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, "res", "zsh")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["input"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "rt"]) diff --git a/recipes/libinput/all/test_package/conanfile.py b/recipes/libinput/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cdcf9b281723d --- /dev/null +++ b/recipes/libinput/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.3.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + 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/libinput/all/test_package/meson.build b/recipes/libinput/all/test_package/meson.build new file mode 100644 index 0000000000000..2dea5d2c4a326 --- /dev/null +++ b/recipes/libinput/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('libinput') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/libinput/all/test_package/test_package.c b/recipes/libinput/all/test_package/test_package.c new file mode 100644 index 0000000000000..6a8e1e6d99fe9 --- /dev/null +++ b/recipes/libinput/all/test_package/test_package.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include + +#include +#include + +static int +open_restricted(const char *path, int flags, void *user_data) +{ + int fd = open(path, flags); + return fd < 0 ? -1 : fd; +} + +static void +close_restricted(int fd, void *user_data) +{ + close(fd); +} + +static const struct libinput_interface interface = { + .open_restricted = open_restricted, + .close_restricted = close_restricted, +}; + +int main(void) { + bool grab = false; + struct libinput *li; + struct udev *udev = udev_new(); + if (!udev) { + fprintf(stderr, "Failed to initialize udev\n"); + return EXIT_FAILURE; + } + + li = libinput_udev_create_context(&interface, &grab, udev); + if (!li) { + fprintf(stderr, "Failed to initialize libinput context from udev\n"); + udev_unref(udev); + return EXIT_FAILURE; + } + + if (libinput_udev_assign_seat(li, "seat0")) { + fprintf(stderr, "Failed to set seat\n"); + libinput_unref(li); + li = NULL; + udev_unref(udev); + return EXIT_FAILURE; + } + + udev_unref(udev); + return EXIT_SUCCESS; +} diff --git a/recipes/libinput/config.yml b/recipes/libinput/config.yml new file mode 100644 index 0000000000000..3f07e920910b2 --- /dev/null +++ b/recipes/libinput/config.yml @@ -0,0 +1,3 @@ +versions: + "1.25.0": + folder: all diff --git a/recipes/libinterpolate/all/conandata.yml b/recipes/libinterpolate/all/conandata.yml index 7d38fb0462c3a..a64f016c933a3 100644 --- a/recipes/libinterpolate/all/conandata.yml +++ b/recipes/libinterpolate/all/conandata.yml @@ -1,13 +1,17 @@ sources: - "2.6.2": + "2.7": url: - - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.2.tar.gz" - sha256: "42f40c9b77fda6e0c52ed39b522458456e89fb4981d63f812aa158c6f4be8ab0" + - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.7.tar.gz" + sha256: "a502a00d6aee13e9b8ae9af6fafbcb783d5380835e353a0fc85a586ca7e31e43" + "2.6.4": + url: + - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.4.tar.gz" + sha256: "231a39fcc87ffc3e03936f7a21abc78ef309c2f1de79bd3ae72c24d78352d666" "2.6.3": url: - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.3.tar.gz" sha256: "bb2f253c27594b4e56ed9349630086665f529100eac2cd3cba63d198c3a84ff9" - "2.6.4": + "2.6.2": url: - - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.4.tar.gz" - sha256: "231a39fcc87ffc3e03936f7a21abc78ef309c2f1de79bd3ae72c24d78352d666" + - "https://github.com/CD3/libInterpolate/archive/refs/tags/2.6.2.tar.gz" + sha256: "42f40c9b77fda6e0c52ed39b522458456e89fb4981d63f812aa158c6f4be8ab0" diff --git a/recipes/libinterpolate/all/conanfile.py b/recipes/libinterpolate/all/conanfile.py index c6aadd8b682fe..711fe3eaa7335 100644 --- a/recipes/libinterpolate/all/conanfile.py +++ b/recipes/libinterpolate/all/conanfile.py @@ -39,8 +39,8 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.80.0", transitive_headers=True) - self.requires("eigen/3.3.7", transitive_headers=True) + self.requires("boost/1.85.0", transitive_headers=True) + self.requires("eigen/3.4.0", transitive_headers=True) def package_id(self): self.info.clear() @@ -48,7 +48,7 @@ def package_id(self): 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"]: + if Version(self.version) >= "2.6.4" and self.settings.os not in ["Linux", "Windows", "Macos"]: 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) diff --git a/recipes/libinterpolate/all/test_package/CMakeLists.txt b/recipes/libinterpolate/all/test_package/CMakeLists.txt index 05a0c0e049e56..d9339065c1617 100644 --- a/recipes/libinterpolate/all/test_package/CMakeLists.txt +++ b/recipes/libinterpolate/all/test_package/CMakeLists.txt @@ -1,7 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(libInterpolate REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE libInterpolate::Interpolate) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libinterpolate/all/test_package/conanfile.py b/recipes/libinterpolate/all/test_package/conanfile.py index 48499fa0989d9..e845ae751a301 100644 --- a/recipes/libinterpolate/all/test_package/conanfile.py +++ b/recipes/libinterpolate/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/libinterpolate/all/test_v1_package/CMakeLists.txt b/recipes/libinterpolate/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b5b37b01b534c..0000000000000 --- a/recipes/libinterpolate/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/libinterpolate/all/test_v1_package/conanfile.py b/recipes/libinterpolate/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/libinterpolate/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/libinterpolate/config.yml b/recipes/libinterpolate/config.yml index 2f31497672d43..45546f7415b6d 100644 --- a/recipes/libinterpolate/config.yml +++ b/recipes/libinterpolate/config.yml @@ -1,7 +1,9 @@ versions: - "2.6.2": + "2.7": + folder: all + "2.6.4": folder: all "2.6.3": folder: all - "2.6.4": + "2.6.2": folder: all diff --git a/recipes/libipt/all/test_v1_package/CMakeLists.txt b/recipes/libipt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libipt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index a8c92dea63335..0000000000000 --- a/recipes/libipt/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/libjpeg-turbo/all/conandata.yml b/recipes/libjpeg-turbo/all/conandata.yml index 6b84ea73c442f..bdc38b905e52c 100644 --- a/recipes/libjpeg-turbo/all/conandata.yml +++ b/recipes/libjpeg-turbo/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "3.1.0": + url: "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.1.0/libjpeg-turbo-3.1.0.tar.gz" + sha256: "9564c72b1dfd1d6fe6274c5f95a8d989b59854575d4bbee44ade7bc17aa9bc93" + "3.0.4": + url: "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.4/libjpeg-turbo-3.0.4.tar.gz" + sha256: "99130559e7d62e8d695f2c0eaeef912c5828d5b84a0537dcb24c9678c9d5b76b" + "3.0.3": + url: "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.3/libjpeg-turbo-3.0.3.tar.gz" + sha256: "343e789069fc7afbcdfe44dbba7dbbf45afa98a15150e079a38e60e44578865d" + "3.0.2": + url: "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.2/libjpeg-turbo-3.0.2.tar.gz" + sha256: "c2ce515a78d91b09023773ef2770d6b0df77d674e144de80d63e0389b3a15ca6" "3.0.1": url: "https://sourceforge.net/projects/libjpeg-turbo/files/3.0.1/libjpeg-turbo-3.0.1.tar.gz" sha256: "22429507714ae147b3acacd299e82099fce5d9f456882fc28e252e4579ba2a75" diff --git a/recipes/libjpeg-turbo/all/conanfile.py b/recipes/libjpeg-turbo/all/conanfile.py index ebe4c40f12545..04ba6279aa695 100644 --- a/recipes/libjpeg-turbo/all/conanfile.py +++ b/recipes/libjpeg-turbo/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LibjpegTurboConan(ConanFile): @@ -18,6 +18,7 @@ class LibjpegTurboConan(ConanFile): homepage = "https://libjpeg-turbo.org" topics = ("jpeg", "libjpeg", "image", "multimedia", "format", "graphics") provides = "libjpeg" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -119,6 +120,8 @@ def generate(self): tc.variables["WITH_CRT_DLL"] = True # avoid replacing /MD by /MT in compiler flags if Version(self.version) <= "2.1.0": tc.variables["CMAKE_MACOSX_BUNDLE"] = False # avoid configuration error if building for iOS/tvOS/watchOS + if Version(self.version) < "3.0.2": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def _patch_sources(self): @@ -168,12 +171,3 @@ def package_info(self): self.cpp_info.components["turbojpeg"].set_property("cmake_target_name", f"libjpeg-turbo::turbojpeg{cmake_target_suffix}") self.cpp_info.components["turbojpeg"].set_property("pkg_config_name", "libturbojpeg") self.cpp_info.components["turbojpeg"].libs = [f"turbojpeg{lib_suffix}"] - - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "JPEG" - self.cpp_info.names["cmake_find_package_multi"] = "libjpeg-turbo" - self.cpp_info.components["jpeg"].names["cmake_find_package"] = "JPEG" - self.cpp_info.components["jpeg"].names["cmake_find_package_multi"] = f"jpeg{cmake_target_suffix}" - if self.options.get_safe("turbojpeg"): - self.cpp_info.components["turbojpeg"].names["cmake_find_package"] = f"turbojpeg{cmake_target_suffix}" - self.cpp_info.components["turbojpeg"].names["cmake_find_package_multi"] = f"turbojpeg{cmake_target_suffix}" diff --git a/recipes/libjpeg-turbo/all/test_package/CMakeLists.txt b/recipes/libjpeg-turbo/all/test_package/CMakeLists.txt index 8715b08bc7f76..ed2fdaa48d34a 100644 --- a/recipes/libjpeg-turbo/all/test_package/CMakeLists.txt +++ b/recipes/libjpeg-turbo/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 C) find_package(libjpeg-turbo REQUIRED CONFIG) diff --git a/recipes/libjpeg-turbo/all/test_package/conanfile.py b/recipes/libjpeg-turbo/all/test_package/conanfile.py index fb5d85902cc52..0a6bc68712d90 100644 --- a/recipes/libjpeg-turbo/all/test_package/conanfile.py +++ b/recipes/libjpeg-turbo/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/libjpeg-turbo/all/test_package/test_package.c b/recipes/libjpeg-turbo/all/test_package/test_package.c index 2f94478d7ef6f..243a65f0efd44 100644 --- a/recipes/libjpeg-turbo/all/test_package/test_package.c +++ b/recipes/libjpeg-turbo/all/test_package/test_package.c @@ -1,528 +1,9 @@ -/* - * rdjpgcom.c - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 2009 by Bill Allombert, Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a very simple stand-alone application that displays - * the text in COM (comment) markers in a JFIF file. - * This may be useful as an example of the minimum logic needed to parse - * JPEG markers. - */ - #include -#include -#include - -#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ -#include "jpeglib.h" /* get auto-config symbols, */ - -#ifdef HAVE_LOCALE_H -#include /* Bill Allombert: use locale for isprint */ -#endif -#include /* to declare isupper(), tolower() */ -#ifdef USE_SETMODE -#include /* to declare setmode()'s parameter macros */ -/* If you have setmode() but not , just delete this line: */ -#include /* to declare setmode() */ -#endif - -#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ -#ifdef __MWERKS__ -#include /* Metrowerks needs this */ -#include /* ... and this */ -#endif -#ifdef THINK_C -#include /* Think declares it here */ -#endif -#endif - -#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ -#define READ_BINARY "r" -#else -#ifdef VMS /* VMS is very nonstandard */ -#define READ_BINARY "rb", "ctx=stm" -#else /* standard ANSI-compliant case */ -#define READ_BINARY "rb" -#endif -#endif - -#ifndef EXIT_FAILURE /* define exit() codes if not provided */ -#define EXIT_FAILURE 1 -#endif -#ifndef EXIT_SUCCESS -#ifdef VMS -#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ -#else -#define EXIT_SUCCESS 0 -#endif -#endif - -/* - * These macros are used to read the input file. - * To reuse this code in another application, you might need to change these. - */ - -static FILE *infile; /* input JPEG file */ - -/* Return next input byte, or EOF if no more */ -#define NEXTBYTE() getc(infile) - -/* Error exit handler */ -#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) - -/* Read one byte, testing for EOF */ -static int read_1_byte(void) { - int c; - - c = NEXTBYTE(); - if (c == EOF) - ERREXIT("Premature EOF in JPEG file"); - return c; -} - -/* Read 2 bytes, convert to unsigned int */ -/* All 2-byte quantities in JPEG markers are MSB first */ -static unsigned int read_2_bytes(void) { - int c1, c2; - - c1 = NEXTBYTE(); - if (c1 == EOF) - ERREXIT("Premature EOF in JPEG file"); - c2 = NEXTBYTE(); - if (c2 == EOF) - ERREXIT("Premature EOF in JPEG file"); - return (((unsigned int)c1) << 8) + ((unsigned int)c2); -} - -/* - * JPEG markers consist of one or more 0xFF bytes, followed by a marker - * code byte (which is not an FF). Here are the marker codes of interest - * in this program. (See jdmarker.c for a more complete list.) - */ - -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_APP0 0xE0 /* Application-specific marker, type N */ -#define M_APP12 0xEC /* (we don't bother to list all 16 APPn's) */ -#define M_COM 0xFE /* COMment */ - -/* - * Find the next JPEG marker and return its marker code. - * We expect at least one FF byte, possibly more if the compressor used FFs - * to pad the file. - * There could also be non-FF garbage between markers. The treatment of such - * garbage is unspecified; we choose to skip over it but emit a warning msg. - * NB: this routine must not be used after seeing SOS marker, since it will - * not deal correctly with FF/00 sequences in the compressed image data... - */ - -static int next_marker(void) { - int c; - int discarded_bytes = 0; - - /* Find 0xFF byte; count and skip any non-FFs. */ - c = read_1_byte(); - while (c != 0xFF) { - discarded_bytes++; - c = read_1_byte(); - } - /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs - * are legal as pad bytes, so don't count them in discarded_bytes. - */ - do { - c = read_1_byte(); - } while (c == 0xFF); - - if (discarded_bytes != 0) { - fprintf(stderr, "Warning: garbage data found in JPEG file\n"); - } - - return c; -} - -/* - * Read the initial marker, which should be SOI. - * For a JFIF file, the first two bytes of the file should be literally - * 0xFF M_SOI. To be more general, we could use next_marker, but if the - * input file weren't actually JPEG at all, next_marker might read the whole - * file and then return a misleading error message... - */ - -static int first_marker(void) { - int c1, c2; - - c1 = NEXTBYTE(); - c2 = NEXTBYTE(); - if (c1 != 0xFF || c2 != M_SOI) - { - ERREXIT("Not a JPEG file"); - } - return c2; -} - -/* - * Most types of marker are followed by a variable-length parameter segment. - * This routine skips over the parameters for any marker we don't otherwise - * want to process. - * Note that we MUST skip the parameter segment explicitly in order not to - * be fooled by 0xFF bytes that might appear within the parameter segment; - * such bytes do NOT introduce new markers. - */ - -static void skip_variable(void) -/* Skip over an unknown or uninteresting variable-length marker */ -{ - unsigned int length; - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - /* Skip over the remaining bytes */ - while (length > 0) { - (void)read_1_byte(); - length--; - } -} - -/* - * Process a COM marker. - * We want to print out the marker contents as legible text; - * we must guard against non-text junk and varying newline representations. - */ - -static void process_COM(int raw) { - unsigned int length; - int ch; - int lastch = 0; - -/* Bill Allombert: set locale properly for isprint */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, ""); -#endif - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - - while (length > 0) { - ch = read_1_byte(); - if (raw) { - putc(ch, stdout); - /* Emit the character in a readable form. - * Nonprintables are converted to \nnn form, - * while \ is converted to \\. - * Newlines in CR, CR/LF, or LF form will be printed as one newline. - */ - } else if (ch == '\r') { - printf("\n"); - } else if (ch == '\n') { - if (lastch != '\r') - printf("\n"); - } else if (ch == '\\') { - printf("\\\\"); - } else if (isprint(ch)) { - putc(ch, stdout); - } else { - printf("\\%03o", ch); - } - lastch = ch; - length--; - } - printf("\n"); - -/* Bill Allombert: revert to C locale */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, "C"); -#endif -} - -/* - * Process a SOFn marker. - * This code is only needed if you want to know the image dimensions... - */ - -static void process_SOFn(int marker) { - unsigned int length; - unsigned int image_height, image_width; - int data_precision, num_components; - const char *process; - int ci; - - length = read_2_bytes(); /* usual parameter length count */ - - data_precision = read_1_byte(); - image_height = read_2_bytes(); - image_width = read_2_bytes(); - num_components = read_1_byte(); - - switch (marker) { - case M_SOF0: - process = "Baseline"; - break; - case M_SOF1: - process = "Extended sequential"; - break; - case M_SOF2: - process = "Progressive"; - break; - case M_SOF3: - process = "Lossless"; - break; - case M_SOF5: - process = "Differential sequential"; - break; - case M_SOF6: - process = "Differential progressive"; - break; - case M_SOF7: - process = "Differential lossless"; - break; - case M_SOF9: - process = "Extended sequential, arithmetic coding"; - break; - case M_SOF10: - process = "Progressive, arithmetic coding"; - break; - case M_SOF11: - process = "Lossless, arithmetic coding"; - break; - case M_SOF13: - process = "Differential sequential, arithmetic coding"; - break; - case M_SOF14: - process = "Differential progressive, arithmetic coding"; - break; - case M_SOF15: - process = "Differential lossless, arithmetic coding"; - break; - default: - process = "Unknown"; - break; - } - - printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n", - image_width, image_height, num_components, data_precision); - printf("JPEG process: %s\n", process); - - if (length != (unsigned int)(8 + num_components * 3)) - ERREXIT("Bogus SOF marker length"); - - for (ci = 0; ci < num_components; ci++) { - (void)read_1_byte(); /* Component ID code */ - (void)read_1_byte(); /* H, V sampling factors */ - (void)read_1_byte(); /* Quantization table number */ - } -} - -/* - * Parse the marker stream until SOS or EOI is seen; - * display any COM markers. - * While the companion program wrjpgcom will always insert COM markers before - * SOFn, other implementations might not, so we scan to SOS before stopping. - * If we were only interested in the image dimensions, we would stop at SOFn. - * (Conversely, if we only cared about COM markers, there would be no need - * for special code to handle SOFn; we could treat it like other markers.) - */ - -static int scan_JPEG_header(int verbose, int raw) { - int marker; - /* Expect SOI at start of file */ - if (first_marker() != M_SOI) - ERREXIT("Expected SOI marker first"); - - /* Scan miscellaneous markers until we reach SOS. */ - for (;;) { - marker = next_marker(); - switch (marker) { - /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be, - * treated as SOFn. C4 in particular is actually DHT. - */ - case M_SOF0: /* Baseline */ - case M_SOF1: /* Extended sequential, Huffman */ - case M_SOF2: /* Progressive, Huffman */ - case M_SOF3: /* Lossless, Huffman */ - case M_SOF5: /* Differential sequential, Huffman */ - case M_SOF6: /* Differential progressive, Huffman */ - case M_SOF7: /* Differential lossless, Huffman */ - case M_SOF9: /* Extended sequential, arithmetic */ - case M_SOF10: /* Progressive, arithmetic */ - case M_SOF11: /* Lossless, arithmetic */ - case M_SOF13: /* Differential sequential, arithmetic */ - case M_SOF14: /* Differential progressive, arithmetic */ - case M_SOF15: /* Differential lossless, arithmetic */ - if (verbose) - process_SOFn(marker); - else - skip_variable(); - break; - - case M_SOS: /* stop before hitting compressed data */ - return marker; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - return marker; - - case M_COM: - process_COM(raw); - break; - - case M_APP12: - /* Some digital camera makers put useful textual information into - * APP12 markers, so we print those out too when in -verbose mode. - */ - if (verbose) { - printf("APP12 contains:\n"); - process_COM(raw); - } else - skip_variable(); - break; - - default: /* Anything else just gets skipped */ - skip_variable(); /* we assume it has a parameter count... */ - break; - } - } /* end loop */ -} - -/* Command line parsing code */ - -static const char *progname; /* program name for error messages */ - -static void usage(void) -/* complain about bad command line */ -{ - fprintf(stderr, "rdjpgcom displays any textual comments in a JPEG file.\n"); - - fprintf(stderr, "Usage: %s [switches] [inputfile]\n", progname); - - fprintf(stderr, "Switches (names may be abbreviated):\n"); - fprintf( - stderr, - " -raw Display non-printable characters in comments (unsafe)\n"); - fprintf(stderr, " -verbose Also display dimensions of JPEG image\n"); - - exit(EXIT_FAILURE); -} - -static int keymatch(char *arg, const char *keyword, int minchars) -/* Case-insensitive matching of (possibly abbreviated) keyword switches. */ -/* keyword is the constant keyword (must be lower case already), */ -/* minchars is length of minimum legal abbreviation. */ -{ - register int ca, ck; - register int nmatched = 0; - - while ((ca = *arg++) != '\0') { - if ((ck = *keyword++) == '\0') - return 0; /* arg longer than keyword, no good */ - if (isupper(ca)) /* force arg to lcase (assume ck is already) */ - ca = tolower(ca); - if (ca != ck) - return 0; /* no good */ - nmatched++; /* count matched characters */ - } - /* reached end of argument; fail if it's too short for unique abbrev */ - if (nmatched < minchars) - return 0; - return 1; /* A-OK */ -} - -/* - * The main program. - */ - -int main(int argc, char **argv) { - int argn; - char *arg; - int verbose = 1, raw = 0; - -/* On Mac, fetch a command line. */ -#ifdef USE_CCOMMAND - argc = ccommand(&argv); -#endif - - progname = argv[0]; - if (progname == NULL || progname[0] == 0) - progname = "rdjpgcom"; /* in case C library doesn't provide it */ - - /* Parse switches, if any */ - for (argn = 1; argn < argc; argn++) - { - arg = argv[argn]; - if (arg[0] != '-') - break; /* not switch, must be file name */ - arg++; /* advance over '-' */ - if (keymatch(arg, "verbose", 1)) - { - verbose++; - } - else if (keymatch(arg, "raw", 1)) - { - raw = 1; - } - else - usage(); - } - - /* Open the input file. */ - /* Unix style: expect zero or one file name */ - if (argn < argc - 1) - { - fprintf(stderr, "%s: only one input file\n", progname); - usage(); - } - if (argn < argc) - { - if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); - exit(EXIT_FAILURE); - } - } - else if ((infile = fopen("testimg.jpg", READ_BINARY)) == NULL) - { -/* default input file is stdin */ -#ifdef USE_SETMODE /* need to hack file mode? */ - setmode(fileno(stdin), O_BINARY); -#endif -#ifdef USE_FDOPEN /* need to re-open in binary mode? */ - if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open stdin\n", progname); - exit(EXIT_FAILURE); - } -#else - infile = stdin; -#endif - } - - /* Scan the JPEG headers. */ - (void)scan_JPEG_header(verbose, raw); +#include "jpeglib.h" - /* All done. */ - exit(EXIT_SUCCESS); - return 0; /* suppress no-return-value warnings */ +int main() { + struct jpeg_decompress_struct info; + struct jpeg_error_mgr err; + info.err = jpeg_std_error(&err); + jpeg_create_decompress(&info); } diff --git a/recipes/libjpeg-turbo/all/test_package/testimg.jpg b/recipes/libjpeg-turbo/all/test_package/testimg.jpg deleted file mode 100644 index a026e486f57de..0000000000000 Binary files a/recipes/libjpeg-turbo/all/test_package/testimg.jpg and /dev/null differ diff --git a/recipes/libjpeg-turbo/all/test_package_module/conanfile.py b/recipes/libjpeg-turbo/all/test_package_module/conanfile.py index fd19bb1425057..0a6bc68712d90 100644 --- a/recipes/libjpeg-turbo/all/test_package_module/conanfile.py +++ b/recipes/libjpeg-turbo/all/test_package_module/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/libjpeg-turbo/all/test_v1_package/CMakeLists.txt b/recipes/libjpeg-turbo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libjpeg-turbo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libjpeg-turbo/all/test_v1_package/conanfile.py b/recipes/libjpeg-turbo/all/test_v1_package/conanfile.py deleted file mode 100644 index a2b04c499e0ac..0000000000000 --- a/recipes/libjpeg-turbo/all/test_v1_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 = os.path.join("bin", "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) diff --git a/recipes/libjpeg-turbo/all/test_v1_package_module/CMakeLists.txt b/recipes/libjpeg-turbo/all/test_v1_package_module/CMakeLists.txt deleted file mode 100644 index 27f7a57e7a0b3..0000000000000 --- a/recipes/libjpeg-turbo/all/test_v1_package_module/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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_module - ${CMAKE_CURRENT_BINARY_DIR}/test_package_module) diff --git a/recipes/libjpeg-turbo/all/test_v1_package_module/conanfile.py b/recipes/libjpeg-turbo/all/test_v1_package_module/conanfile.py deleted file mode 100644 index b6600e428515c..0000000000000 --- a/recipes/libjpeg-turbo/all/test_v1_package_module/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" - - 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") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) diff --git a/recipes/libjpeg-turbo/config.yml b/recipes/libjpeg-turbo/config.yml index 382a6fb1070c9..0bb57d8708ec5 100644 --- a/recipes/libjpeg-turbo/config.yml +++ b/recipes/libjpeg-turbo/config.yml @@ -1,4 +1,12 @@ versions: + "3.1.0": + folder: all + "3.0.4": + folder: all + "3.0.3": + folder: all + "3.0.2": + folder: all "3.0.1": folder: all "3.0.0": diff --git a/recipes/libjpeg/all/Win32.Mak b/recipes/libjpeg/all/Win32.Mak deleted file mode 100644 index d3345df3a31cf..0000000000000 --- a/recipes/libjpeg/all/Win32.Mak +++ /dev/null @@ -1,671 +0,0 @@ -# Win32.Mak - Win32 application master NMAKE definitions file for the -# Microsoft Windows SDK programming samples -# Copyright (C) Microsoft Corporation -# ------------------------------------------------------------------------- -# This files should be included at the top of all MAKEFILEs as follows: -# !include -# ------------------------------------------------------------------------- -# -# Define APPVER = [ 4.0 | 5.0 | 5.01 | 5.02 | 6.0 | 6.1] prior to including win32.mak to get -# build time checking for version dependencies and to mark the executable -# with version information. -# -# Define TARGETOS = [ WIN95 | WINNT | BOTH ] prior to including win32.mak -# to get some build time checking for platform dependencies. -# -# Define TARGETLANG = [ LANG_JAPANESE | LANG_CHINESE | LANG_KOREAN ] prior -# to including win32.mak to getcompile & link flags for building -# applications to run on Far-East Windows. (This is an optional parameter. -# The system locale is the default.) -# -# Define _WIN32_IE = [ 0x0300 | 0x0400 | 0x0500 | 0x0600 | 0x0700 | 0x0800] prior to including win32.mak to -# get compile and link flags for building applications and components to -# run on Internet Explorer. (This is an optional parameter. IE 4.0 is -# the default.) -# -# ------------------------------------------------------------------------- -# NMAKE Options -# -# Use the table below to determine the additional options for NMAKE to -# generate various application debugging, profiling and performance tuning -# information. -# -# Application Information Type Invoke NMAKE -# ---------------------------- ------------ -# For No Debugging Info nmake nodebug=1 -# For Working Set Tuner Info nmake tune=1 -# For Call Attributed Profiling Info nmake profile=1 -# -# Note: The three options above are mutually exclusive (you may use only -# one to compile/link the application). -# -# Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an -# alternate method to setting these options via the nmake command line. -# -# Note: TUNE and PROFILE do nothing for 64bit compilation -# -# Additional NMAKE Options Invoke NMAKE -# ---------------------------- ------------ -# For No ANSI NULL Compliance nmake no_ansi=1 -# (ANSI NULL is defined as PVOID 0) -# -# ========================================================================= -# Build Rules Quick Start -# -# To build one of the following types of executables, use the specified -# compiler and linker command-line options. -# -# --------------------------------------------------------------------------- -# To build: | Compiler Options | Linker options (pick one -# | | line. con = console, -# | | gui = GUI, ole = GUI OLE) -# --------------------------------------------------------------------------- -# Single threaded | cdebug cflags cvars | ldebug guilflags guilibs -# app with static | | ldebug conlflags conlibs -# CRT | | ldebug guilflags olelibs -# --------------------------------------------------------------------------- -# Multithreaded app | cdebug cflags cvarsmt | ldebug guilflags guilibsmt -# with static CRT | | ldebug conlflags conlibsmt -# | | ldebug guilflags olelibsmt -# --------------------------------------------------------------------------- -# Single or multi- | cdebug cflags cvarsdll | ldebug guilflags guilibsdll -# threaded app with | | ldebug conlflags conlibsdll -# DLL version of CRT | | ldebug guilflags olelibsdll -# (MSVCRT.DLL) | | -# --------------------------------------------------------------------------- -# DLL with static | cdebug cflags cvarsmt | ldebug dlllflags guilibsmt -# CRT* | | ldebug dlllflags conlibsmt -# | | ldebug dlllflags olelibsmt -# --------------------------------------------------------------------------- -# DLL with DLL | cdebug cflags cvarsdll | ldebug dlllflags guilibsdll -# version of CRT | | ldebug dlllflags conlibsdll -# (MSVCRT.DLL) | | ldebug dlllflags olelibsdll -# --------------------------------------------------------------------------- -# -# * Always make DLLs multithreaded because a DLL has no way to know whether -# the calling application has multiple threads, and has no way to prevent -# multithreaded apps from loading it. -# -# To specify an Intel x86 build that defaults to stdcall, add scall to the -# list of compiler options. -# -# ========================================================================= - -!IFNDEF _WIN32_MAK_ -_WIN32_MAK_ = 1 - -# ------------------------------------------------------------------------- -# Get CPU Type - exit if CPU environment variable is not defined -# ------------------------------------------------------------------------- - -# Win95 does not define PROCESSOR_ARCHITECTURE - default to i386 - -!IF "$(PROCESSOR_ARCHITECTURE)" == "" -CPU=i386 -PROCESSOR_ARCHITECTURE=x86 -!endif - -!IF !DEFINED(CPU) || "$(CPU)" == "" -CPU = $(PROCESSOR_ARCHITECTURE) -!ENDIF # CPU - -# if PROCESSOR_ARCHITECTURE was x86 or X86 change CPU to i386 - -!IF ( "$(CPU)" == "X86" ) || ( "$(CPU)" == "x86" ) -CPU = i386 -!ENDIF # CPU == X86 - -!IF "$(CPU)" != "i386" -!IF "$(CPU)" != "IA64" -!IF "$(CPU)" != "AMD64" -!ERROR Must specify CPU environment variable ( CPU=i386, CPU=IA64, CPU=AMD64) -!ENDIF -!ENDIF -!ENDIF - - -# ------------------------------------------------------------------------- -# Get Target Operating System - Default to WINNT -# ------------------------------------------------------------------------- -!IFNDEF TARGETOS -TARGETOS = WINNT -!ENDIF - -!IF "$(TARGETOS)" != "WINNT" -!IF "$(TARGETOS)" != "WIN95" -!IF "$(TARGETOS)" != "BOTH" -!ERROR Must specify TARGETOS environment variable (BOTH, WIN95, WINNT) -!ENDIF -!ENDIF -!ENDIF - -# default to APPVER of 5.0 - -!IFNDEF APPVER -APPVER = 5.0 -!ENDIF - -!IF "$(APPVER)" != "6.1" -!IF "$(APPVER)" != "6.0" -!IF "$(APPVER)" != "5.02" -!IF "$(APPVER)" != "5.01" -!IF "$(APPVER)" != "5.0" -!IF "$(APPVER)" != "4.0" -!ERROR Must specify APPVER environment variable (4.0, 5.0, 5.01, 5.02, 6.0, 6.1) -!ENDIF -!ENDIF -!ENDIF -!ENDIF -!ENDIF -!ENDIF - -!IF "$(APPVER)" =="6.1" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0800 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 6.1 - -!IF "$(APPVER)" =="6.0" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0700 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 6.0 - -!IF "$(APPVER)" =="5.0" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0500 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 5.0 - -!IF "$(APPVER)" =="5.01" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0600 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 5.01 - -!IF "$(APPVER)" =="5.02" -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0600 -!ENDIF # _WIN32_IE -!ENDIF # APPVER == 5.02 - -!IFNDEF _WIN32_IE -_WIN32_IE = 0x0400 -!ENDIF - -# ------------------------------------------------------------------------- -# Build tool declarations common to all platforms -# Check to see if Cole Porter is used, otherwise use C/C++ compiler -# ------------------------------------------------------------------------- - -cc = cl -link = link -implib = lib - -midl = midl -rc = Rc -hc = Start /Wait Hcrtf -mc = Mc - -hcvars = -xn - -# ------------------------------------------------------------------------- -# Platform Dependent Compile Flags - must be specified after $(cc) -# -# Note: Debug switches are on by default for current release -# -# These switches set code generation and debugging options for the compiler. -# They also set macros used for conditional compilation. -# -# The debugging switches allow for source level debugging with WinDebug or -# Microsoft Visual C++. -# -# Common compiler flags: -# -c - compile without linking -# -W3 - Set warning level to level 3 (-W4 for 64-bit compilations) -# -Zi - generate debugging information -# -Od - disable all optimizations -# -Ox - use maximum optimizations -# -Zd - generate only public symbols and line numbers for debugging -# -GS - enable security checks -# -# i386 specific compiler flags: -# -Gz - stdcall (only if scall is added to makefile's compiler build rules) -# -# ------------------------------------------------------------------------- - -# declarations common to all compiler options -ccommon = -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS - -# for compatibility with old source code, map {try, except, leave, finally} -# to their proper names (i.e. prefaced by "__") -!IFDEF SEHMAP -ccommon = $(ccommon) -FIsehmap.h -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_JAPANESE" -ccommon = $(ccommon) -DJAPAN -DDBCS -DFE_IME -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_CHINESE" -ccommon = $(ccommon) -DDBCS -DFE_IME -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_KOREAN" -ccommon = $(ccommon) -DDBCS -DFE_IME -!ENDIF - -!IF "$(CPU)" == "i386" -cflags = $(ccommon) -D_X86_=1 -DWIN32 -D_WIN32 -W3 -scall = -Gz - -!ELSEIF "$(CPU)" == "IA64" -cflags = $(ccommon) -D_IA64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -cflags = $(cflags) -W4 -scall = - -!ELSEIF "$(CPU)" == "AMD64" -cflags = $(ccommon) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -cflags = $(cflags) -W4 -scall = - -!ENDIF - - -!IF "$(APPVER)" == "4.0" -NMAKE_WINVER = 0x0400 -!ELSEIF "$(APPVER)" == "5.0" -NMAKE_WINVER = 0x0500 -!ELSEIF "$(APPVER)" == "5.01" -NMAKE_WINVER = 0x0501 -!ELSEIF "$(APPVER)" == "5.02" -NMAKE_WINVER = 0x0502 -!ELSEIF "$(APPVER)" == "6.0" -NMAKE_WINVER = 0x0600 -!ELSEIF "$(APPVER)" == "6.1" -NMAKE_WINVER = 0x0601 -!ENDIF - -!IF "$(TARGETOS)" == "WINNT" -cflags = $(cflags) -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER) -DNTDDI_VERSION=$(NMAKE_WINVER)0000 -!ENDIF - -!IF "$(TARGETOS)" == "WIN95" -cflags = $(cflags) -D_WIN95 -D_WIN32_WINDOWS=$(NMAKE_WINVER) /D_WIN32_DCOM -!ENDIF - -# regardless of the TARGET OS, define compile time WINVER to match APPVER macro -cflags = $(cflags) -D_WIN32_IE=$(_WIN32_IE) -DWINVER=$(NMAKE_WINVER) - - -# Set debugging options - -!IF "$(CPU)" != "IA64" -!IFDEF NODEBUG -cdebug = -Ox -DNDEBUG -!ELSE IFDEF PROFILE -cdebug = -Gh -Ox -DNDEBUG -!ELSE IFDEF TUNE -cdebug = -Gh -Ox -DNDEBUG -!ELSE -cdebug = -Zi -Od -DDEBUG -Fdlibjpeg.pdb -!ENDIF - -!ELSE - -!IFDEF NODEBUG -cdebug = -Ox -DNDEBUG -!ELSE -cdebug = -Zi -Od -DDEBUG -Fdlibjpeg.pdb -!ENDIF - -!ENDIF - -# ------------------------------------------------------------------------- -# Target Module & Subsystem Dependent Compile Defined Variables - must be -# specified after $(cc) -# -# The following table indicates the various acceptable combinations of -# the C Run-Time libraries LIBC, LIBCMT, and MSVCRT respect to the creation -# of a EXE and/or DLL target object. The appropriate compiler flag macros -# that should be used for each combination are also listed. -# -# Executable Type C Runtime Lib Compiler switch -# ------------------------------------------------------------- -# Single threaded app static CRT CVARS * -# Single-threaded app DLL CRT CVARSDLL -# Multi-threaded app static CRT CVARSMT * -# Multi-threaded app DLL CRT CVARSDLL * -# -# Single threaded DLL static CRT CVARS -# Single-threaded DLL DLL CRT CVARSDLL -# Multi-threaded DLL static CRT CVARSMT * -# Multi-threaded DLL DLL CRT CVARSDLL * -# -# * - Denotes the Recommended Configuration -# -# When building single-threaded applications you can link your executable -# with either LIBC, LIBCMT, or MSVCRT, although LIBC will provide the best -# performance. -# -# When building multi-threaded applications, either LIBCMT or MSVCRT can -# be used as the C-Runtime library, as both are multi-thread safe. -# -# Note: Any executable which accesses a DLL linked with MSVCRT.LIB must -# also link with MSVCRT.LIB instead of LIBC.LIB or LIBCMT.LIB. -# When using DLLs, it is recommended that all of the modules be -# linked with MSVCRT.LIB. -# -# Note: The macros of the form xDLL are used when linking the object with -# the DLL version of the C Run-Time (that is, MSVCRT.LIB). They are -# not used when the target object is itself a DLL. -# -# ------------------------------------------------------------------------- - -!IFDEF NO_ANSI -noansi = -DNULL=0 -!ENDIF - - -# for Windows applications that use the C Run-Time libraries -!IFDEF NODEBUG -cvarsmt = $(noansi) -D_MT -MT -cvars = $(cvarsmt) -cvarsdll = $(noansi) -D_MT -D_DLL -MD -!ELSE -cvarsmt = $(noansi) -D_MT -MTd -cvars = $(cvarsmt) -cvarsdll = $(noansi) -D_MT -D_DLL -MDd -!ENDIF - - -# for compatibility with older-style makefiles -cvarsmtdll = $(cvarsdll) - -# for POSIX applications -psxvars = -D_POSIX_ - -# resource compiler -rcflags = /r -!ifdef NODEBUG -rcvars = -DWIN32 -D_WIN32 -DWINVER=$(NMAKE_WINVER) $(noansi) -!else -rcvars = -DWIN32 -D_WIN32 -DWINVER=$(NMAKE_WINVER) -DDEBUG -D_DEBUG $(noansi) -!endif - - -!IF "$(TARGETLANG)" == "LANG_JAPANESE" -rcflags = $(rcflags) /c932 -rcvars = $(rcvars) -DJAPAN -DDBCS -DFE_IME -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_CHINESE" -rcvars = $(rcvars) -DDBCS -DFE_IME -!ENDIF - -!IF "$(TARGETLANG)" == "LANG_KOREAN" -rcvars = $(rcvars) -DDBCS -DFE_IME -!ENDIF - - -# ------------------------------------------------------------------------- -# Platform Dependent MIDL Flags - must be specified after midl -# -# -# ------------------------------------------------------------------------- -!IF "$(TARGETOS)" == "WIN95" -MIDL_OPTIMIZATION=-target NT40 -!ELSEIF "$(TARGETOS)" == "WINNT" -!IF "$(APPVER)" == "5.0" -MIDL_OPTIMIZATION=-target NT50 -!ELSEIF "$(APPVER)" == "6.0" -MIDL_OPTIMIZATION=-target NT60 -!ELSEIF "$(APPVER)" == "6.1" -MIDL_OPTIMIZATION=-target NT61 -!ELSEIF "$(APPVER)" == "5.01" -MIDL_OPTIMIZATION=-target NT51 -!ELSEIF "$(APPVER)" == "5.02" -MIDL_OPTIMIZATION=-target NT51 -!ELSEIF "$(APPVER)" == "4.0" -MIDL_OPTIMIZATION=-target NT40 -!ENDIF -!ENDIF - -!IF "$(CPU)" == "IA64" -MIDL_OPTIMIZATION = $(MIDL_OPTIMIZATION) /ia64 -!ELSEIF "$(CPU)" == "AMD64" -MIDL_OPTIMIZATION = $(MIDL_OPTIMIZATION) /x64 -!ELSE -MIDL_OPTIMIZATION = $(MIDL_OPTIMIZATION) /win32 -!ENDIF - -!IF ("$(TARGETOS)" == "WINNT" ) && ("$(APPVER)" != "4.0") -MIDL_OPTIMIZATION = $(MIDL_OPTIMIZATION) /robust -!ENDIF - - - -# ------------------------------------------------------------------------- -# Platform Dependent Link Flags - must be specified after $(link) -# -# Note: $(DLLENTRY) should be appended to each -entry: flag on the link -# line. -# -# Note: When creating a DLL that uses C Run-Time functions it is -# recommended to include the entry point function of the name DllMain -# in the DLL's source code. Also, the MAKEFILE should include the -# -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of -# this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn -# calls the DLL defined DllMain entry point.) -# -# ------------------------------------------------------------------------- - -# declarations common to all linker options -lflags = $(lflags) /INCREMENTAL:NO /NOLOGO - -# declarations for use on Intel x86 systems -!IF "$(CPU)" == "i386" -DLLENTRY = @12 -!ENDIF - -# declarations for use on Intel Architecture 64-bit systems -!IF "$(CPU)" == "IA64" -DLLENTRY = -!ENDIF - -# declarations for use on AMD64 systems -!IF "$(CPU)" == "AMD64" -DLLENTRY = -!ENDIF - - -# ------------------------------------------------------------------------- -# Target Module Dependent Link Debug Flags - must be specified after $(link) -# -# These switches allow the inclusion of the necessary symbolic information -# for source level debugging with WinDebug, profiling and/or performance -# tuning. -# -# Note: Debug switches are on by default. -# ------------------------------------------------------------------------- - -!IF "$(CPU)" == "i386" - -!IFDEF NODEBUG -ldebug = /RELEASE -!ELSE -ldebug = /DEBUG /DEBUGTYPE:cv -!ENDIF - -!ELSE - -!IFDEF NODEBUG -ldebug = /RELEASE -!ELSE IFDEF PROFILE -ldebug = /DEBUG:mapped,partial /DEBUGTYPE:coff -!ELSE IFDEF TUNE -ldebug = /DEBUG:mapped,partial /DEBUGTYPE:coff -!ELSE -ldebug = /DEBUG /DEBUGTYPE:cv -!ENDIF - -!ENDIF - -# for compatibility with older-style makefiles -linkdebug = $(ldebug) - - -# ------------------------------------------------------------------------- -# Subsystem Dependent Link Flags - must be specified after $(link) -# -# These switches allow for source level debugging with WinDebug for local -# and global variables. They also provide the standard application type and -# entry point declarations. -# -# Note that on x86 screensavers have a WinMain entrypoint, but on RISC -# platforms it is main. This is a Win95 compatibility issue. -# -# ------------------------------------------------------------------------- - -# Windows 98 needs subsystem version set to 4.10 for version 5.0 features. -!IF ("$(APPVER)" == "5.0") && (("$(TARGETOS)" == "BOTH") || ("$(TARGETOS)" == "WIN95")) -EXEVER = 4.10 -!ELSE -EXEVER = $(APPVER) -!ENDIF - - -# --------------------------------------------- - -# for Windows applications -conlflags = $(lflags) -subsystem:console,$(EXEVER) -guilflags = $(lflags) -subsystem:windows,$(EXEVER) -dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll - -# For screen savers -!IF "$(CPU)" == "i386" -savlflags = $(lflags) -subsystem:windows,$(EXEVER) -entry:WinMainCRTStartup -!ELSE -savlflags = $(lflags) -subsystem:windows,$(EXEVER) -entry:mainCRTStartup -!ENDIF - -# for POSIX applications -psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup - -# for compatibility with older-style makefiles -conflags = $(conlflags) -guiflags = $(guilflags) -psxflags = $(psxlflags) - -# ------------------------------------------------------------------------- -# C Run-Time Target Module Dependent Link Libraries -# -# Note: For POSIX applications, link with $(psxlibs). -# ------------------------------------------------------------------------- - -# for POSIX applications -psxlibs = libcpsx.lib psxdll.lib psxrtl.lib oldnames.lib - - -# optional profiling and tuning libraries -!IF "$(CPU)" != "IA64" - -!IFDEF PROFILE -optlibs = cap.lib -!ELSE IFDEF TUNE -optlibs = wst.lib -!ELSE -optlibs = -!ENDIF - -!ELSE -optlibs = -!ENDIF - -# if building for basic Windows 95, use WinSock1, else use WinSock2 -!IF "$(TARGETOS)" == "WIN95" -!IF "$(APPVER)" == "4.0" -winsocklibs = wsock32.lib -!ELSE -winsocklibs = ws2_32.lib mswsock.lib -!ENDIF -!ELSE -winsocklibs = ws2_32.lib mswsock.lib -!ENDIF - - -# basic subsystem specific libraries, less the C Run-Time -baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib -winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib - -# for Windows applications that use the C Run-Time libraries -conlibs = $(baselibs) -guilibs = $(winlibs) - -# for OLE applications -olelibs = ole32.lib uuid.lib oleaut32.lib $(guilibs) - -#for backwards compatibility -conlibsmt = $(conlibs) -conlibsdll = $(conlibs) -guilibsmt = $(guilibs) -guilibsdll = $(guilibs) -olelibsmt = $(olelibs) -olelibsdll = $(olelibs) - -# for backward compatibility -ole2libs = $(olelibs) -ole2libsmt = $(olelibsmt) -ole2libsdll = $(olelibsdll) - -# Visual Basic -bc = vb6 -bc_exe = /Make -bc_dll = /Makedll - -# Set the Output Directory -!IF ("$(APPVER)" == "6.1") -OUTDIR=WIN7 -!ELSEIF ("$(APPVER)" == "6.0") -OUTDIR=Vista -!ELSEIF "$(APPVER)" == "5.0" -OUTDIR=WIN2000 -!ELSEIF "$(APPVER)" == "5.01" -OUTDIR=XP32 -!ELSEIF "$(APPVER)" == "5.02" -OUTDIR=SRV2003 -!ELSEIF "$(APPVER)" == "4.0" -OUTDIR=NT4 -!ENDIF - -!IF "$(CPU)" == "AMD64" -OUTDIR=$(OUTDIR)_X64 -!ELSEIF "$(CPU)" == "IA64" -OUTDIR=$(OUTDIR)_64 -!ENDIF - -#set Prerelease Out directories -!IF "$(SDKPRERELEASE)" == "1" -OUTDIR=PRE_$(OUTDIR) -!ENDIF - -#Set DEBUG -!IF "$(NODEBUG)" == "" -OUTDIR=$(OUTDIR)_DEBUG -!ELSE -OUTDIR=$(OUTDIR)_RETAIL -!ENDIF - -!IF "$(OS)" == "Windows_NT" -CLEANUP=if exist $(OUTDIR)/$(NULL) rd /s /q $(OUTDIR) -!ELSE -CLEANUP=deltree /y $(OUTDIR) -!ENDIF - -VC6MSG=This sample only compiles with Microsoft Visual C++ 6.0. \ - To compile this run vcvars32.bat for Visual C++ 6.0, and setenv.bat in $(MSSDK). - -WIN64MSG=This sample is currently not supported on the 64 bit platform. - -#ENDIF _WIN32_MAK_ -!ENDIF diff --git a/recipes/libjpeg/all/conandata.yml b/recipes/libjpeg/all/conandata.yml index b147d8fb1dd7d..c16f5b9d9e4d8 100644 --- a/recipes/libjpeg/all/conandata.yml +++ b/recipes/libjpeg/all/conandata.yml @@ -1,14 +1,18 @@ sources: + "9f": + url: "https://ijg.org/files/jpegsrc.v9f.tar.gz" + sha256: "04705c110cb2469caa79fb71fba3d7bf834914706e9641a4589485c1f832565b" "9e": - url: "http://ijg.org/files/jpegsrc.v9e.tar.gz" + url: "https://ijg.org/files/jpegsrc.v9e.tar.gz" sha256: "4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d" "9d": - url: "http://ijg.org/files/jpegsrc.v9d.tar.gz" + url: "https://ijg.org/files/jpegsrc.v9d.tar.gz" sha256: "2303a6acfb6cc533e0e86e8a9d29f7e6079e118b9de3f96e07a71a11c082fa6a" - "9c": - url: "http://ijg.org/files/jpegsrc.v9c.tar.gz" - sha256: "682aee469c3ca857c4c38c37a6edadbfca4b04d42e56613b11590ec6aa4a278d" patches: + "9f": + - patch_file: "patches/0001-9f-libjpeg-add-msvc-dll-support.patch" + patch_description: "Add support to generate DLL on Windows" + patch_type: "portability" "9e": - patch_file: "patches/0001-9e-libjpeg-add-msvc-dll-support.patch" patch_description: "Add support to generate DLL on Windows" @@ -17,7 +21,3 @@ patches: - patch_file: "patches/0001-libjpeg-add-msvc-dll-support.patch" patch_description: "Add support to generate DLL on Windows" patch_type: "portability" - "9c": - - patch_file: "patches/0001-libjpeg-add-msvc-dll-support.patch" - patch_description: "Add support to generate DLL on Windows" - patch_type: "portability" diff --git a/recipes/libjpeg/all/conanfile.py b/recipes/libjpeg/all/conanfile.py index dd93ec3f8004c..e5205d93bc015 100644 --- a/recipes/libjpeg/all/conanfile.py +++ b/recipes/libjpeg/all/conanfile.py @@ -1,13 +1,13 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, load, 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 is_msvc, is_msvc_static_runtime, NMakeToolchain +from conan.tools.microsoft import MSBuild, MSBuildToolchain import os import re -import shutil required_conan_version = ">=1.55.0" @@ -32,15 +32,14 @@ class LibjpegConan(ConanFile): } @property - def _is_clang_cl(self): - return self.settings.os == "Windows" and self.settings.compiler == "clang" + def _is_cl_like(self): + return self.settings.compiler.get_safe("runtime") is not None @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def export_sources(self): - copy(self, "Win32.Mak", src=self.recipe_folder, dst=self.export_sources_folder) export_conandata_patches(self) def config_options(self): @@ -53,11 +52,15 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + def validate(self): + if self.version == "9d" and self.settings.os == "Windows" and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("This version of libjpeg does not support ARM64, please use a newer version") + def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): - if self._settings_build.os == "Windows" and not (is_msvc(self) or self. _is_clang_cl): + if self._settings_build.os == "Windows" and not self._is_cl_like: self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") @@ -66,14 +69,11 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - if is_msvc(self) or self._is_clang_cl: - # clean environment variables that might affect on the build (e.g. if set by Jenkins) - env = Environment() - env.define("PROFILE", None) - env.define("TUNE", None) - env.define("NODEBUG", None) - env.vars(self).save_script("conanbuildenv_nmake_unset_env") - tc = NMakeToolchain(self) + if self._is_cl_like: + tc = MSBuildToolchain(self) + tc.cflags.append("-DLIBJPEG_BUILDING") + if not self.options.shared: + tc.cflags.append(" -DLIBJPEG_STATIC") tc.generate() else: env = VirtualBuildEnv(self) @@ -82,46 +82,65 @@ def generate(self): tc.extra_defines.append("LIBJPEG_BUILDING") tc.generate() - def _build_nmake(self): - copy(self, "Win32.Mak", src=os.path.join(self.source_folder, os.pardir), dst=self.source_folder) - with chdir(self, self.source_folder): - # export symbols if shared - replace_in_file( - self, - "Win32.Mak", - "\nccommon = -c ", - "\nccommon = -c -DLIBJPEG_BUILDING {}".format("" if self.options.shared else "-DLIBJPEG_STATIC "), - ) - shutil.copy("jconfig.vc", "jconfig.h") - make_args = [ - "nodebug=1" if self.settings.build_type != "Debug" else "", - ] - if self._is_clang_cl: - compilers_from_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) - buildenv_vars = VirtualBuildEnv(self).vars() - cl = compilers_from_conf.get("c", buildenv_vars.get("CC", "clang-cl")) - link = buildenv_vars.get("LD", "lld-link") - lib = buildenv_vars.get("AR", "llvm-lib") - rc = compilers_from_conf.get("rc", buildenv_vars.get("RC", "llvm-rc")) - replace_in_file(self, "Win32.Mak", "cc = cl", f"cc = {cl}") - replace_in_file(self, "Win32.Mak", "link = link", f"link = {link}") - replace_in_file(self, "Win32.Mak", "implib = lib", f"implib = {lib}") - replace_in_file(self, "Win32.Mak", "rc = Rc", f"rc = {rc}") - # set flags directly in makefile.vc - # cflags are critical for the library. ldflags and ldlibs are only for binaries - if is_msvc_static_runtime(self): - replace_in_file(self, "makefile.vc", "(cvars)", "(cvarsmt)") - replace_in_file(self, "makefile.vc", "(conlibs)", "(conlibsmt)") - else: - replace_in_file(self, "makefile.vc", "(cvars)", "(cvarsdll)") - replace_in_file(self, "makefile.vc", "(conlibs)", "(conlibsdll)") - target = "{}/libjpeg.lib".format("shared" if self.options.shared else "static") - self.run("nmake -f makefile.vc {} {}".format(" ".join(make_args), target)) - def build(self): apply_conandata_patches(self) - if is_msvc(self) or self._is_clang_cl: - self._build_nmake() + if self._is_cl_like: + with chdir(self, self.source_folder): + self.run("nmake /f makefile.vs setupcopy-v16") + + # Rename target to 'libjpeg.lib' to match legacy behaviour (otherwise we break backwards compatibility) + # static: "libjpeg.lib" + # shared: "libjpeg.lib" (import), "libjpeg-9.dll" (DLL) + jpeg_vcxproj = os.path.join(self.source_folder, "jpeg.vcxproj") + target_name = "libjpeg-9" if self.options.shared else "libjpeg" + replace_in_file(self, jpeg_vcxproj, """""", + f""" {target_name} + """) + if self.options.shared: + replace_in_file(self, jpeg_vcxproj, "", + "$(OutDir)libjpeg.lib") + + # Support static/shared + if self.options.shared: + replace_in_file(self, jpeg_vcxproj, + "StaticLibrary", + "DynamicLibrary" + ) + + # Don't force LTO + replace_in_file(self, jpeg_vcxproj, "true", "") + + # Inject conan-generated .props file + # Note: importing it right before Microsoft.Cpp.props also ensures we correctly + # handle the toolset setting + conantoolchain_props = os.path.join(self.generators_folder, MSBuildToolchain.filename) + replace_in_file( + self, jpeg_vcxproj, + """""", + f"""""", + ) + + # Patch settings for a different build type + if self.settings.build_type is not "Release": + replacements = { + "Release": str(self.settings.build_type) + } + if self.settings.build_type == "Debug": + replacements.update({ + "Full": "Disabled", + "NDEBUG;": "_DEBUG;", + }) + for key, value in replacements.items(): + replace_in_file(self, jpeg_vcxproj, key, value) + + replace_in_file(self, os.path.join(self.source_folder, "jpeg.sln"), "Release", str(self.settings.build_type)) + + msbuild = MSBuild(self) + if self.settings.arch == "x86": + # This .sln uses "Win32" instead of the usual "x86" + # as the solution platform, so need to override this + msbuild.platform = "Win32" + msbuild.build(sln="jpeg.sln") else: autotools = Autotools(self) autotools.configure() @@ -129,7 +148,7 @@ def build(self): def package(self): copy(self, "README", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - if is_msvc(self) or self._is_clang_cl: + if self._is_cl_like: for filename in ["jpeglib.h", "jerror.h", "jconfig.h", "jmorecfg.h"]: copy(self, filename, src=self.source_folder, dst=os.path.join(self.package_folder, "include"), keep_path=False) @@ -164,7 +183,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "JPEG") self.cpp_info.set_property("cmake_target_name", "JPEG::JPEG") self.cpp_info.set_property("pkg_config_name", "libjpeg") - prefix = "lib" if is_msvc(self) or self._is_clang_cl else "" + prefix = "lib" if self._is_cl_like else "" self.cpp_info.libs = [f"{prefix}jpeg"] self.cpp_info.resdirs = ["res"] if not self.options.shared: diff --git a/recipes/libjpeg/all/patches/0001-9f-libjpeg-add-msvc-dll-support.patch b/recipes/libjpeg/all/patches/0001-9f-libjpeg-add-msvc-dll-support.patch new file mode 100644 index 0000000000000..ac2d14df61117 --- /dev/null +++ b/recipes/libjpeg/all/patches/0001-9f-libjpeg-add-msvc-dll-support.patch @@ -0,0 +1,31 @@ +--- jmorecfg.h ++++ jmorecfg.h +@@ -238,14 +238,26 @@ + * or code profilers that require it. + */ + ++#if defined(_MSC_VER) ++#if defined(LIBJPEG_STATIC) ++#define LIBJPEG_EXPORTS ++#elif !defined(LIBJPEG_BUILDING) ++#define LIBJPEG_EXPORTS __declspec(dllimport) ++#else ++#define LIBJPEG_EXPORTS __declspec(dllexport) ++#endif ++#else ++#define LIBJPEG_EXPORTS ++#endif ++ + /* a function called through method pointers: */ + #define METHODDEF(type) static type + /* a function used only in its module: */ + #define LOCAL(type) static type + /* a function referenced thru EXTERNs: */ +-#define GLOBAL(type) type ++#define GLOBAL(type) LIBJPEG_EXPORTS type + /* a reference to a GLOBAL function: */ +-#define EXTERN(type) extern type ++#define EXTERN(type) extern GLOBAL(type) + + + /* This macro is used to declare a "method", that is, a function pointer. diff --git a/recipes/libjpeg/all/test_package/CMakeLists.txt b/recipes/libjpeg/all/test_package/CMakeLists.txt index 7885c9011ac59..d9155acc1751e 100644 --- a/recipes/libjpeg/all/test_package/CMakeLists.txt +++ b/recipes/libjpeg/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 C) find_package(JPEG REQUIRED CONFIG) @@ -10,11 +10,3 @@ if (MSVC) target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS) endif() -if(BUILD_TRANSUPP) - add_executable(test_transupp test_transupp.c ${LIBJPEG_RES_DIR}/transupp.c) - target_link_libraries(test_transupp PRIVATE JPEG::JPEG) - target_compile_features(test_transupp PRIVATE c_std_99) - if (MSVC) - target_compile_definitions(test_transupp PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS) - endif() -endif() diff --git a/recipes/libjpeg/all/test_package/conanfile.py b/recipes/libjpeg/all/test_package/conanfile.py index 0243933ba22dd..4e22017cf1618 100644 --- a/recipes/libjpeg/all/test_package/conanfile.py +++ b/recipes/libjpeg/all/test_package/conanfile.py @@ -1,33 +1,20 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv", "CMakeToolchain" test_type = "explicit" - @property - def _build_transupp(self): - # transupp+libjpeg makes use of stdio of the C library. This cannot be used when using a dll libjpeg, built with a static c library. - return not (self.dependencies["libjpeg"].options.shared and is_msvc(self) and is_msvc_static_runtime(self)) - def layout(self): cmake_layout(self) def requirements(self): self.requires(self.tested_reference_str) - def generate(self): - tc = CMakeToolchain(self) - tc.variables["BUILD_TRANSUPP"] = self._build_transupp - if self._build_transupp: - tc.variables["LIBJPEG_RES_DIR"] = self.dependencies["libjpeg"].cpp_info.resdirs[0].replace("\\", "/") - tc.generate() - def build(self): cmake = CMake(self) cmake.configure() @@ -36,9 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") - test_transupp_path = os.path.join(self.cpp.build.bindirs[0], "test_transupp") - if os.path.exists(test_transupp_path): - out_img = os.path.join(self.build_folder, "outimg.jpg") - self.run(f"{test_transupp_path} {img_name} {out_img}", env="conanrun") + self.run(f"{bin_path}", env="conanrun") diff --git a/recipes/libjpeg/all/test_package/test_package.c b/recipes/libjpeg/all/test_package/test_package.c index 2f94478d7ef6f..d23690dd29b19 100644 --- a/recipes/libjpeg/all/test_package/test_package.c +++ b/recipes/libjpeg/all/test_package/test_package.c @@ -1,528 +1,11 @@ -/* - * rdjpgcom.c - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 2009 by Bill Allombert, Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a very simple stand-alone application that displays - * the text in COM (comment) markers in a JFIF file. - * This may be useful as an example of the minimum logic needed to parse - * JPEG markers. - */ - #include -#include -#include - -#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ -#include "jpeglib.h" /* get auto-config symbols, */ - -#ifdef HAVE_LOCALE_H -#include /* Bill Allombert: use locale for isprint */ -#endif -#include /* to declare isupper(), tolower() */ -#ifdef USE_SETMODE -#include /* to declare setmode()'s parameter macros */ -/* If you have setmode() but not , just delete this line: */ -#include /* to declare setmode() */ -#endif - -#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ -#ifdef __MWERKS__ -#include /* Metrowerks needs this */ -#include /* ... and this */ -#endif -#ifdef THINK_C -#include /* Think declares it here */ -#endif -#endif - -#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ -#define READ_BINARY "r" -#else -#ifdef VMS /* VMS is very nonstandard */ -#define READ_BINARY "rb", "ctx=stm" -#else /* standard ANSI-compliant case */ -#define READ_BINARY "rb" -#endif -#endif - -#ifndef EXIT_FAILURE /* define exit() codes if not provided */ -#define EXIT_FAILURE 1 -#endif -#ifndef EXIT_SUCCESS -#ifdef VMS -#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ -#else -#define EXIT_SUCCESS 0 -#endif -#endif - -/* - * These macros are used to read the input file. - * To reuse this code in another application, you might need to change these. - */ - -static FILE *infile; /* input JPEG file */ - -/* Return next input byte, or EOF if no more */ -#define NEXTBYTE() getc(infile) - -/* Error exit handler */ -#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) - -/* Read one byte, testing for EOF */ -static int read_1_byte(void) { - int c; - - c = NEXTBYTE(); - if (c == EOF) - ERREXIT("Premature EOF in JPEG file"); - return c; -} - -/* Read 2 bytes, convert to unsigned int */ -/* All 2-byte quantities in JPEG markers are MSB first */ -static unsigned int read_2_bytes(void) { - int c1, c2; - - c1 = NEXTBYTE(); - if (c1 == EOF) - ERREXIT("Premature EOF in JPEG file"); - c2 = NEXTBYTE(); - if (c2 == EOF) - ERREXIT("Premature EOF in JPEG file"); - return (((unsigned int)c1) << 8) + ((unsigned int)c2); -} - -/* - * JPEG markers consist of one or more 0xFF bytes, followed by a marker - * code byte (which is not an FF). Here are the marker codes of interest - * in this program. (See jdmarker.c for a more complete list.) - */ - -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_APP0 0xE0 /* Application-specific marker, type N */ -#define M_APP12 0xEC /* (we don't bother to list all 16 APPn's) */ -#define M_COM 0xFE /* COMment */ - -/* - * Find the next JPEG marker and return its marker code. - * We expect at least one FF byte, possibly more if the compressor used FFs - * to pad the file. - * There could also be non-FF garbage between markers. The treatment of such - * garbage is unspecified; we choose to skip over it but emit a warning msg. - * NB: this routine must not be used after seeing SOS marker, since it will - * not deal correctly with FF/00 sequences in the compressed image data... - */ - -static int next_marker(void) { - int c; - int discarded_bytes = 0; - - /* Find 0xFF byte; count and skip any non-FFs. */ - c = read_1_byte(); - while (c != 0xFF) { - discarded_bytes++; - c = read_1_byte(); - } - /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs - * are legal as pad bytes, so don't count them in discarded_bytes. - */ - do { - c = read_1_byte(); - } while (c == 0xFF); - - if (discarded_bytes != 0) { - fprintf(stderr, "Warning: garbage data found in JPEG file\n"); - } - - return c; -} - -/* - * Read the initial marker, which should be SOI. - * For a JFIF file, the first two bytes of the file should be literally - * 0xFF M_SOI. To be more general, we could use next_marker, but if the - * input file weren't actually JPEG at all, next_marker might read the whole - * file and then return a misleading error message... - */ - -static int first_marker(void) { - int c1, c2; - - c1 = NEXTBYTE(); - c2 = NEXTBYTE(); - if (c1 != 0xFF || c2 != M_SOI) - { - ERREXIT("Not a JPEG file"); - } - return c2; -} - -/* - * Most types of marker are followed by a variable-length parameter segment. - * This routine skips over the parameters for any marker we don't otherwise - * want to process. - * Note that we MUST skip the parameter segment explicitly in order not to - * be fooled by 0xFF bytes that might appear within the parameter segment; - * such bytes do NOT introduce new markers. - */ - -static void skip_variable(void) -/* Skip over an unknown or uninteresting variable-length marker */ -{ - unsigned int length; - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - /* Skip over the remaining bytes */ - while (length > 0) { - (void)read_1_byte(); - length--; - } -} - -/* - * Process a COM marker. - * We want to print out the marker contents as legible text; - * we must guard against non-text junk and varying newline representations. - */ - -static void process_COM(int raw) { - unsigned int length; - int ch; - int lastch = 0; - -/* Bill Allombert: set locale properly for isprint */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, ""); -#endif - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - - while (length > 0) { - ch = read_1_byte(); - if (raw) { - putc(ch, stdout); - /* Emit the character in a readable form. - * Nonprintables are converted to \nnn form, - * while \ is converted to \\. - * Newlines in CR, CR/LF, or LF form will be printed as one newline. - */ - } else if (ch == '\r') { - printf("\n"); - } else if (ch == '\n') { - if (lastch != '\r') - printf("\n"); - } else if (ch == '\\') { - printf("\\\\"); - } else if (isprint(ch)) { - putc(ch, stdout); - } else { - printf("\\%03o", ch); - } - lastch = ch; - length--; - } - printf("\n"); - -/* Bill Allombert: revert to C locale */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, "C"); -#endif -} - -/* - * Process a SOFn marker. - * This code is only needed if you want to know the image dimensions... - */ - -static void process_SOFn(int marker) { - unsigned int length; - unsigned int image_height, image_width; - int data_precision, num_components; - const char *process; - int ci; - - length = read_2_bytes(); /* usual parameter length count */ - - data_precision = read_1_byte(); - image_height = read_2_bytes(); - image_width = read_2_bytes(); - num_components = read_1_byte(); - - switch (marker) { - case M_SOF0: - process = "Baseline"; - break; - case M_SOF1: - process = "Extended sequential"; - break; - case M_SOF2: - process = "Progressive"; - break; - case M_SOF3: - process = "Lossless"; - break; - case M_SOF5: - process = "Differential sequential"; - break; - case M_SOF6: - process = "Differential progressive"; - break; - case M_SOF7: - process = "Differential lossless"; - break; - case M_SOF9: - process = "Extended sequential, arithmetic coding"; - break; - case M_SOF10: - process = "Progressive, arithmetic coding"; - break; - case M_SOF11: - process = "Lossless, arithmetic coding"; - break; - case M_SOF13: - process = "Differential sequential, arithmetic coding"; - break; - case M_SOF14: - process = "Differential progressive, arithmetic coding"; - break; - case M_SOF15: - process = "Differential lossless, arithmetic coding"; - break; - default: - process = "Unknown"; - break; - } - - printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n", - image_width, image_height, num_components, data_precision); - printf("JPEG process: %s\n", process); - - if (length != (unsigned int)(8 + num_components * 3)) - ERREXIT("Bogus SOF marker length"); - - for (ci = 0; ci < num_components; ci++) { - (void)read_1_byte(); /* Component ID code */ - (void)read_1_byte(); /* H, V sampling factors */ - (void)read_1_byte(); /* Quantization table number */ - } -} - -/* - * Parse the marker stream until SOS or EOI is seen; - * display any COM markers. - * While the companion program wrjpgcom will always insert COM markers before - * SOFn, other implementations might not, so we scan to SOS before stopping. - * If we were only interested in the image dimensions, we would stop at SOFn. - * (Conversely, if we only cared about COM markers, there would be no need - * for special code to handle SOFn; we could treat it like other markers.) - */ - -static int scan_JPEG_header(int verbose, int raw) { - int marker; - /* Expect SOI at start of file */ - if (first_marker() != M_SOI) - ERREXIT("Expected SOI marker first"); - - /* Scan miscellaneous markers until we reach SOS. */ - for (;;) { - marker = next_marker(); - switch (marker) { - /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be, - * treated as SOFn. C4 in particular is actually DHT. - */ - case M_SOF0: /* Baseline */ - case M_SOF1: /* Extended sequential, Huffman */ - case M_SOF2: /* Progressive, Huffman */ - case M_SOF3: /* Lossless, Huffman */ - case M_SOF5: /* Differential sequential, Huffman */ - case M_SOF6: /* Differential progressive, Huffman */ - case M_SOF7: /* Differential lossless, Huffman */ - case M_SOF9: /* Extended sequential, arithmetic */ - case M_SOF10: /* Progressive, arithmetic */ - case M_SOF11: /* Lossless, arithmetic */ - case M_SOF13: /* Differential sequential, arithmetic */ - case M_SOF14: /* Differential progressive, arithmetic */ - case M_SOF15: /* Differential lossless, arithmetic */ - if (verbose) - process_SOFn(marker); - else - skip_variable(); - break; - - case M_SOS: /* stop before hitting compressed data */ - return marker; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - return marker; - - case M_COM: - process_COM(raw); - break; - - case M_APP12: - /* Some digital camera makers put useful textual information into - * APP12 markers, so we print those out too when in -verbose mode. - */ - if (verbose) { - printf("APP12 contains:\n"); - process_COM(raw); - } else - skip_variable(); - break; - - default: /* Anything else just gets skipped */ - skip_variable(); /* we assume it has a parameter count... */ - break; - } - } /* end loop */ -} - -/* Command line parsing code */ - -static const char *progname; /* program name for error messages */ - -static void usage(void) -/* complain about bad command line */ -{ - fprintf(stderr, "rdjpgcom displays any textual comments in a JPEG file.\n"); - - fprintf(stderr, "Usage: %s [switches] [inputfile]\n", progname); - - fprintf(stderr, "Switches (names may be abbreviated):\n"); - fprintf( - stderr, - " -raw Display non-printable characters in comments (unsafe)\n"); - fprintf(stderr, " -verbose Also display dimensions of JPEG image\n"); - - exit(EXIT_FAILURE); -} - -static int keymatch(char *arg, const char *keyword, int minchars) -/* Case-insensitive matching of (possibly abbreviated) keyword switches. */ -/* keyword is the constant keyword (must be lower case already), */ -/* minchars is length of minimum legal abbreviation. */ -{ - register int ca, ck; - register int nmatched = 0; - - while ((ca = *arg++) != '\0') { - if ((ck = *keyword++) == '\0') - return 0; /* arg longer than keyword, no good */ - if (isupper(ca)) /* force arg to lcase (assume ck is already) */ - ca = tolower(ca); - if (ca != ck) - return 0; /* no good */ - nmatched++; /* count matched characters */ - } - /* reached end of argument; fail if it's too short for unique abbrev */ - if (nmatched < minchars) - return 0; - return 1; /* A-OK */ -} - -/* - * The main program. - */ - -int main(int argc, char **argv) { - int argn; - char *arg; - int verbose = 1, raw = 0; - -/* On Mac, fetch a command line. */ -#ifdef USE_CCOMMAND - argc = ccommand(&argv); -#endif - - progname = argv[0]; - if (progname == NULL || progname[0] == 0) - progname = "rdjpgcom"; /* in case C library doesn't provide it */ - - /* Parse switches, if any */ - for (argn = 1; argn < argc; argn++) - { - arg = argv[argn]; - if (arg[0] != '-') - break; /* not switch, must be file name */ - arg++; /* advance over '-' */ - if (keymatch(arg, "verbose", 1)) - { - verbose++; - } - else if (keymatch(arg, "raw", 1)) - { - raw = 1; - } - else - usage(); - } - - /* Open the input file. */ - /* Unix style: expect zero or one file name */ - if (argn < argc - 1) - { - fprintf(stderr, "%s: only one input file\n", progname); - usage(); - } - if (argn < argc) - { - if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); - exit(EXIT_FAILURE); - } - } - else if ((infile = fopen("testimg.jpg", READ_BINARY)) == NULL) - { -/* default input file is stdin */ -#ifdef USE_SETMODE /* need to hack file mode? */ - setmode(fileno(stdin), O_BINARY); -#endif -#ifdef USE_FDOPEN /* need to re-open in binary mode? */ - if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open stdin\n", progname); - exit(EXIT_FAILURE); - } -#else - infile = stdin; -#endif - } - - /* Scan the JPEG headers. */ - (void)scan_JPEG_header(verbose, raw); - - /* All done. */ - exit(EXIT_SUCCESS); - return 0; /* suppress no-return-value warnings */ +#include "jpeglib.h" +#include "transupp.h" + +int main() { + struct jpeg_decompress_struct info; + struct jpeg_error_mgr err; + info.err = jpeg_std_error(&err); + jpeg_create_decompress(&info); + printf("libjpeg test successful\n"); } diff --git a/recipes/libjpeg/all/test_package/test_transupp.c b/recipes/libjpeg/all/test_package/test_transupp.c deleted file mode 100644 index 188c5655a0762..0000000000000 --- a/recipes/libjpeg/all/test_package/test_transupp.c +++ /dev/null @@ -1,96 +0,0 @@ -#include -#include -#include - -#include "jpeglib.h" -#include "jpegint.h" -#include "transupp.h" - -struct error_data { - struct jpeg_error_mgr pub; - const char *name; -}; - - -static void -my_error_handler(j_common_ptr cinfo) { - struct error_data *data = (struct error_data *) cinfo; - while(1) { - fprintf(stderr, "-"); - } - fprintf(stderr, "%s:\n", data->name); - fflush(stdout); - fflush(stderr); - (*cinfo->err->output_message) (cinfo); - exit(2); -} - -int main(int argc, char *argv[]) { - if (argc < 3) { - fprintf(stderr, "Usage: %s \n", argv[0]); - return 1; - } - - struct error_data err_in; - err_in.name = "input"; - err_in.pub.error_exit = my_error_handler; - - struct error_data err_out; - err_out.name = "output"; - err_out.pub.error_exit = my_error_handler; - - FILE *fin = fopen(argv[1], "rb"); - - struct jpeg_decompress_struct src; - struct jpeg_compress_struct dst; - - src.err = jpeg_std_error(&err_in.pub); - jpeg_create_decompress(&src); - - dst.err = jpeg_std_error(&err_in.pub); - jpeg_create_compress(&dst); - - jpeg_stdio_src(&src, fin); - - jcopy_markers_setup(&src, JCOPYOPT_ALL); - - (void)jpeg_read_header(&src, TRUE); - - jpeg_transform_info transform = { - .transform = JXFORM_ROT_180, - }; - - if ((src.image_width % 2) || (dst.image_height % 2)) { - fprintf(stderr, "The input image is odd-sized. The transform will not be correct.\n"); - } - - if (!jtransform_request_workspace(&src, &transform)) { - fprintf(stderr, "Can only transform odd-size images perfectly.\n"); - return 3; - } - - jvirt_barray_ptr *src_coeffs = jpeg_read_coefficients(&src); - jpeg_copy_critical_parameters(&src, &dst); - - jvirt_barray_ptr *dst_coefs = jtransform_adjust_parameters(&src, &dst, src_coeffs, &transform); - - - FILE *fout = fopen(argv[2], "wb"); - jpeg_stdio_dest(&dst, fout); - - jpeg_write_coefficients(&dst, dst_coefs); - - jcopy_markers_execute(&src, &dst, JCOPYOPT_ALL); - jtransform_execute_transformation(&src, &dst, src_coeffs, &transform); - - jpeg_finish_compress(&dst); - jpeg_destroy_compress(&dst); - fclose(fout); - - jpeg_finish_decompress(&src); - jpeg_destroy_decompress(&src); - fclose(fin); - - printf("Done\n"); - return 0; -} diff --git a/recipes/libjpeg/all/test_package/testimg.jpg b/recipes/libjpeg/all/test_package/testimg.jpg deleted file mode 100644 index a026e486f57de..0000000000000 Binary files a/recipes/libjpeg/all/test_package/testimg.jpg and /dev/null differ diff --git a/recipes/libjpeg/all/test_v1_package/CMakeLists.txt b/recipes/libjpeg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 961b416af6b07..0000000000000 --- a/recipes/libjpeg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -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/libjpeg/all/test_v1_package/conanfile.py b/recipes/libjpeg/all/test_v1_package/conanfile.py deleted file mode 100644 index 803919e9ca672..0000000000000 --- a/recipes/libjpeg/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,31 +0,0 @@ -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - - @property - def _test_transupp(self): - # transupp+libjpeg makes use of stdio of the C library. This cannot be used when using a dll libjpeg, built with a static c library. - return not (self.options["libjpeg"].shared and is_msvc(self) and is_msvc_static_runtime(self)) - - def build(self): - cmake = CMake(self) - cmake.definitions["BUILD_TRANSUPP"] = self._test_transupp - if self._test_transupp: - cmake.definitions["LIBJPEG_RES_DIR"] = os.path.join(self.deps_cpp_info["libjpeg"].rootpath, "res").replace("\\", "/") - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) - if self._test_transupp: - test_transupp_path = os.path.join("bin", "test_transupp") - out_img = os.path.join(self.build_folder, "outimg.jpg") - self.run(f"{test_transupp_path} {img_name} {out_img}", run_environment=True) diff --git a/recipes/libjpeg/config.yml b/recipes/libjpeg/config.yml index 6c44911f307cd..182822cf7c426 100644 --- a/recipes/libjpeg/config.yml +++ b/recipes/libjpeg/config.yml @@ -1,7 +1,7 @@ versions: + "9f": + folder: all "9e": folder: all "9d": folder: all - "9c": - folder: all diff --git a/recipes/libjuice/all/conandata.yml b/recipes/libjuice/all/conandata.yml new file mode 100644 index 0000000000000..709595aa5dc9d --- /dev/null +++ b/recipes/libjuice/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.5.7": + url: "https://github.com/paullouisageneau/libjuice/archive/refs/tags/v1.5.7.tar.gz" + sha256: "6385c574f3c33f766ed25cddf919625b0ae8ca0d76871f70301e5a0cf2c93dc8" diff --git a/recipes/libjuice/all/conanfile.py b/recipes/libjuice/all/conanfile.py new file mode 100644 index 0000000000000..e79736fd826ce --- /dev/null +++ b/recipes/libjuice/all/conanfile.py @@ -0,0 +1,80 @@ +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, rm, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.apple import fix_apple_shared_install_name + +required_conan_version = ">=2.4" + +class libjuiceConan(ConanFile): + name = "libjuice" + description = "JUICE is a UDP Interactive Connectivity Establishment library." + license = "MPL-2.0" + topics = ("webrtc", "ice") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/paullouisageneau/libjuice" + settings = "os", "compiler", "build_type", "arch" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + languages = "C" + implements = ["auto_shared_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.variables["NO_TESTS"] = True + tc.generate() + + def build(self): + 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() + fix_apple_shared_install_name(self) + + 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 = ["juice"] + self.cpp_info.set_property("cmake_file_name", "LibJuice") + if self.options.shared: + self.cpp_info.set_property("cmake_target_name", "LibJuice::LibJuice") + else: + self.cpp_info.set_property("cmake_target_name", "LibJuice::LibJuiceStatic") + self.cpp_info.defines.append("JUICE_STATIC") + + 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.extend(["ws2_32", "bcrypt"]) + + if is_msvc(self): + self.cpp_info.cxxflags.append("/bigobj") diff --git a/recipes/libjuice/all/test_package/CMakeLists.txt b/recipes/libjuice/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..adc79b68b2a92 --- /dev/null +++ b/recipes/libjuice/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(LibJuice REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +if (BUILD_SHARED_LIBS) + target_link_libraries(${PROJECT_NAME} PRIVATE LibJuice::LibJuice) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE LibJuice::LibJuiceStatic) +endif() diff --git a/recipes/libjuice/all/test_package/conanfile.py b/recipes/libjuice/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b4cab38c13121 --- /dev/null +++ b/recipes/libjuice/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["BUILD_SHARED_LIBS"] = self.dependencies[self.tested_reference_str].options.shared + 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") + self.run(bin_path, env="conanrun") diff --git a/recipes/libjuice/all/test_package/test_package.cpp b/recipes/libjuice/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..68cc9df88eee3 --- /dev/null +++ b/recipes/libjuice/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main(void) { + juice_config config; + juice_set_log_level(JUICE_LOG_LEVEL_WARN); + return EXIT_SUCCESS; +} diff --git a/recipes/libjuice/config.yml b/recipes/libjuice/config.yml new file mode 100644 index 0000000000000..63812c2d2c8db --- /dev/null +++ b/recipes/libjuice/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5.7": + folder: all diff --git a/recipes/libjxl/all/CMakeLists.txt b/recipes/libjxl/all/CMakeLists.txt deleted file mode 100644 index c986d294c7547..0000000000000 --- a/recipes/libjxl/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/libjxl/all/conan_deps.cmake b/recipes/libjxl/all/conan_deps.cmake new file mode 100644 index 0000000000000..e62d6fec8071b --- /dev/null +++ b/recipes/libjxl/all/conan_deps.cmake @@ -0,0 +1,24 @@ +find_package(Brotli REQUIRED CONFIG) +find_package(HWY REQUIRED CONFIG) +find_package(LCMS2 REQUIRED CONFIG) + +# Add wrapper targets for the project to link against +add_library(brotlicommon INTERFACE) +target_link_libraries(brotlicommon INTERFACE brotli::brotli) +set_target_properties(brotlicommon PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Brotli_INCLUDE_DIRS}") +set_target_properties(brotlicommon PROPERTIES INCLUDE_DIRECTORIES "${Brotli_INCLUDE_DIRS}") +add_library(brotlidec ALIAS brotlicommon) +add_library(brotlienc ALIAS brotlicommon) +add_library(brotlicommon-static ALIAS brotlicommon) +add_library(brotlidec-static ALIAS brotlicommon) +add_library(brotlienc-static ALIAS brotlicommon) + +add_library(hwy INTERFACE) +target_link_libraries(hwy INTERFACE highway::highway) +set_target_properties(hwy PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${HWY_INCLUDE_DIRS}") +set_target_properties(hwy PROPERTIES INCLUDE_DIRECTORIES "${HWY_INCLUDE_DIRS}") + +add_library(lcms2 INTERFACE) +target_link_libraries(lcms2 INTERFACE lcms::lcms) +set_target_properties(lcms2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIRS}") +set_target_properties(lcms2 PROPERTIES INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIRS}") diff --git a/recipes/libjxl/all/conandata.yml b/recipes/libjxl/all/conandata.yml index 8a3abcae1301c..ad32f0315aa54 100644 --- a/recipes/libjxl/all/conandata.yml +++ b/recipes/libjxl/all/conandata.yml @@ -1,18 +1,13 @@ sources: - "0.5.0": - url: "https://github.com/libjxl/libjxl/archive/v0.5.zip" - sha256: "a208be41542c6f81f10a82c6bb4bc75d3eceb9d4f7ecb6ea0ad2f2d236694c4b" - "0.6.1": - url: "https://github.com/libjxl/libjxl/archive/v0.6.1.zip" - sha256: "3e4877daef07724aa6f490bf80c45ada804f35fe3cce59c27e89c5ae3099535a" -patches: - "0.5.0": - - patch_file: "patches/0001-clean-targets-v0.5.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-fix-dependencies-v0.5.patch" - base_path: "source_subfolder" - "0.6.1": - - patch_file: "patches/0001-clean-targets-v0.6.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-fix-dependencies-v0.6.patch" - base_path: "source_subfolder" + "0.11.1": + url: "https://github.com/libjxl/libjxl/archive/v0.11.1.tar.gz" + sha256: "1492dfef8dd6c3036446ac3b340005d92ab92f7d48ee3271b5dac1d36945d3d9" + "0.10.3": + url: "https://github.com/libjxl/libjxl/archive/v0.10.3.zip" + sha256: "a9e2103f61ab79f5561b506ad03fcba33207263284b1a796eba3ca826ab0a75f" + "0.10.2": + url: "https://github.com/libjxl/libjxl/archive/v0.10.2.zip" + sha256: "910ab4245eebe0fba801a057f5fbc4fe96dad7c9979880bb49ad3e2623a911a2" + "0.8.2": + url: "https://github.com/libjxl/libjxl/archive/v0.8.2.zip" + sha256: "1f2ccc06f07c4f6cf4aa6c7763ba0598f12a7544d597f02beb07f615eb08ccf0" diff --git a/recipes/libjxl/all/conanfile.py b/recipes/libjxl/all/conanfile.py index a8d214a9a78ab..54c37a81e3adb 100644 --- a/recipes/libjxl/all/conanfile.py +++ b/recipes/libjxl/all/conanfile.py @@ -1,9 +1,15 @@ -from conans import ConanFile, CMake, tools import os -import shutil -import glob -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import cross_building, stdcpp_library, 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, rmdir, save, rm, replace_in_file +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=2" class LibjxlConan(ConanFile): @@ -14,114 +20,199 @@ class LibjxlConan(ConanFile): homepage = "https://github.com/libjxl/libjxl" topics = ("image", "jpeg-xl", "jxl", "jpeg") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - - exports_sources = "CMakeLists.txt", "patches/**" - generators = "cmake" - _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], + "avx512": [True, False], + "avx512_spr": [True, False], + "avx512_zen4": [True, False], + "with_tcmalloc": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "avx512": False, + "avx512_spr": False, + "avx512_zen4": False, + "with_tcmalloc": False, + } + + def export_sources(self): + copy(self, "conan_deps.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 + if self.settings.arch not in ["x86", "x86_64"] or Version(self.version) < "0.9": + del self.options.avx512 + del self.options.avx512_spr + del self.options.avx512_zen4 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("brotli/1.0.9") - self.requires("highway/0.12.2") - self.requires("lcms/2.11") + self.requires("brotli/1.1.0") + self.requires("highway/1.1.0") + self.requires("lcms/2.16") + if self.options.with_tcmalloc: + self.requires("gperftools/2.15") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def build_requirements(self): + # Require newer CMake, which allows INCLUDE_DIRECTORIES to be set on INTERFACE targets + # Also, v0.9+ require CMake 3.16 + self.tool_requires("cmake/[>=3.19 <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): + VirtualBuildEnv(self).generate() + + tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_LIBJXL_INCLUDE"] = "conan_deps.cmake" + tc.variables["BUILD_TESTING"] = False + tc.variables["JPEGXL_STATIC"] = False + tc.variables["JPEGXL_BUNDLE_LIBPNG"] = False + tc.variables["JPEGXL_ENABLE_BENCHMARK"] = False + tc.variables["JPEGXL_ENABLE_DOXYGEN"] = False + tc.variables["JPEGXL_ENABLE_EXAMPLES"] = False + tc.variables["JPEGXL_ENABLE_JNI"] = False + tc.variables["JPEGXL_ENABLE_MANPAGES"] = False + tc.variables["JPEGXL_ENABLE_OPENEXR"] = False + tc.variables["JPEGXL_ENABLE_PLUGINS"] = False + tc.variables["JPEGXL_ENABLE_SJPEG"] = False + tc.variables["JPEGXL_ENABLE_SKCMS"] = False + tc.variables["JPEGXL_ENABLE_TCMALLOC"] = self.options.with_tcmalloc + tc.variables["JPEGXL_ENABLE_VIEWERS"] = False + tc.variables["JPEGXL_ENABLE_TOOLS"] = False + tc.variables["JPEGXL_FORCE_SYSTEM_BROTLI"] = True + tc.variables["JPEGXL_FORCE_SYSTEM_GTEST"] = True + tc.variables["JPEGXL_FORCE_SYSTEM_HWY"] = True + tc.variables["JPEGXL_FORCE_SYSTEM_LCMS2"] = True + tc.variables["JPEGXL_WARNINGS_AS_ERRORS"] = False + tc.variables["JPEGXL_FORCE_NEON"] = False + tc.variables["JPEGXL_ENABLE_AVX512"] = self.options.get_safe("avx512", False) + tc.variables["JPEGXL_ENABLE_AVX512_SPR"] = self.options.get_safe("avx512_spr", False) + tc.variables["JPEGXL_ENABLE_AVX512_ZEN4"] = self.options.get_safe("avx512_zen4", False) + if cross_building(self): + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = str(self.settings.arch) + # Allow non-cache_variables to be used + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + # Skip the buggy custom FindAtomic and force the use of atomic library directly for libstdc++ + tc.variables["ATOMICS_LIBRARIES"] = "atomic" if self._atomic_required else "" + if Version(self.version) >= "0.8": + # TODO: add support for the jpegli JPEG encoder library + tc.variables["JPEGXL_ENABLE_JPEGLI"] = False + tc.variables["JPEGXL_ENABLE_JPEGLI_LIBJPEG"] = False + # TODO: can hopefully be removed in newer versions + # https://github.com/libjxl/libjxl/issues/3159 + if Version(self.version) >= "0.9" and self.settings.build_type == "Debug" and is_msvc(self): + tc.preprocessor_definitions["JXL_DEBUG_V_LEVEL"] = 1 + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("brotli", "cmake_file_name", "Brotli") + deps.set_property("highway", "cmake_file_name", "HWY") + deps.set_property("lcms", "cmake_file_name", "LCMS2") + deps.generate() + + # For tcmalloc + deps = PkgConfigDeps(self) + deps.generate() + + @property + def _atomic_required(self): + return self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"] def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["JPEGXL_STATIC"] = not self.options.shared - self._cmake.definitions["JPEGXL_ENABLE_BENCHMARK"] = False - self._cmake.definitions["JPEGXL_ENABLE_EXAMPLES"] = False - self._cmake.definitions["JPEGXL_ENABLE_MANPAGES"] = False - self._cmake.definitions["JPEGXL_ENABLE_SJPEG"] = False - self._cmake.definitions["JPEGXL_ENABLE_OPENEXR"] = False - self._cmake.definitions["JPEGXL_ENABLE_SKCMS"] = False - self._cmake.definitions["JPEGXL_ENABLE_TCMALLOC"] = False - if tools.cross_building(self): - self._cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = \ - str(self.settings.arch) - self._cmake.configure() - return self._cmake + # Disable tools, extras and third_party + save(self, os.path.join(self.source_folder, "tools", "CMakeLists.txt"), "") + save(self, os.path.join(self.source_folder, "third_party", "CMakeLists.txt"), "") + # FindAtomics.cmake values are set by CMakeToolchain instead + save(self, os.path.join(self.source_folder, "cmake", "FindAtomics.cmake"), "") + + # Allow fPIC to be set by Conan + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)", "") + for cmake_file in ["jxl.cmake", "jxl_threads.cmake", "jxl_cms.cmake", "jpegli.cmake"]: + path = os.path.join(self.source_folder, "lib", cmake_file) + if os.path.exists(path): + fpic = "ON" if self.options.get_safe("fPIC", True) else "OFF" + replace_in_file(self, path, "POSITION_INDEPENDENT_CODE ON", f"POSITION_INDEPENDENT_CODE {fpic}") 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", src=self._source_subfolder, dst="licenses") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self.options.shared: - libs_dir = os.path.join(self.package_folder, "lib") - tools.remove_files_by_mask(libs_dir, "*.a") - tools.remove_files_by_mask(libs_dir, "*-static.lib") - - if self.settings.os == "Windows": - self.copy("jxl_dec.dll", src="bin", dst="bin") - self.copy("jxl_dec.lib", src="lib", dst="lib") - for dll_path in glob.glob(os.path.join(libs_dir, "*.dll")): - shutil.move(dll_path, os.path.join(self.package_folder, - "bin", os.path.basename(dll_path))) - else: - self.copy("libjxl_dec.*", src="lib", dst="lib") + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + rm(self, "*-static.lib", os.path.join(self.package_folder, "lib")) def _lib_name(self, name): - if not self.options.shared and self.settings.os == "Windows": + if Version(self.version) < "0.9" and not self.options.shared and self.settings.os == "Windows": return name + "-static" return name def package_info(self): + libcxx = stdcpp_library(self) + # jxl - self.cpp_info.components["jxl"].names["pkg_config"] = "libjxl" + self.cpp_info.components["jxl"].set_property("pkg_config_name", "libjxl") self.cpp_info.components["jxl"].libs = [self._lib_name("jxl")] - self.cpp_info.components["jxl"].requires = ["brotli::brotli", - "highway::highway", - "lcms::lcms"] + self.cpp_info.components["jxl"].requires = ["brotli::brotli", "highway::highway", "lcms::lcms"] + if self.options.with_tcmalloc: + self.cpp_info.components["jxl"].requires.append("gperftools::tcmalloc_minimal") + if self._atomic_required: + self.cpp_info.components["jxl"].system_libs.append("atomic") + if not self.options.shared: + self.cpp_info.components["jxl"].defines.append("JXL_STATIC_DEFINE") + if libcxx: + self.cpp_info.components["jxl"].system_libs.append(libcxx) + + # jxl_cms + if Version(self.version) >= "0.9.0": + self.cpp_info.components["jxl_cms"].set_property("pkg_config_name", "libjxl_cms") + self.cpp_info.components["jxl_cms"].libs = [self._lib_name("jxl_cms")] + self.cpp_info.components["jxl_cms"].requires = ["lcms::lcms", "highway::highway"] + if not self.options.shared: + self.cpp_info.components["jxl"].defines.append("JXL_CMS_STATIC_DEFINE") + if libcxx: + self.cpp_info.components["jxl_cms"].system_libs.append(libcxx) + self.cpp_info.components["jxl"].requires.append("jxl_cms") + # jxl_dec - self.cpp_info.components["jxl_dec"].names["pkg_config"] = "libjxl_dec" - self.cpp_info.components["jxl_dec"].libs = [self._lib_name("jxl_dec")] - self.cpp_info.components["jxl_dec"].requires = ["brotli::brotli", - "highway::highway", - "lcms::lcms"] + if Version(self.version) < "0.9.0": + if not self.options.shared: + self.cpp_info.components["jxl_dec"].set_property("pkg_config_name", "libjxl_dec") + self.cpp_info.components["jxl_dec"].libs = [self._lib_name("jxl_dec")] + self.cpp_info.components["jxl_dec"].requires = ["brotli::brotli", "highway::highway", "lcms::lcms"] + if libcxx: + self.cpp_info.components["jxl_dec"].system_libs.append(libcxx) + # jxl_threads - self.cpp_info.components["jxl_threads"].names["pkg_config"] = \ - "libjxl_threads" - self.cpp_info.components["jxl_threads"].libs = \ - [self._lib_name("jxl_threads")] - if self.settings.os == "Linux": + self.cpp_info.components["jxl_threads"].set_property("pkg_config_name", "libjxl_threads") + self.cpp_info.components["jxl_threads"].libs = [self._lib_name("jxl_threads")] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["jxl_threads"].system_libs = ["pthread"] - - if not self.options.shared and tools.stdcpp_library(self): - self.cpp_info.components["jxl"].system_libs.append( - tools.stdcpp_library(self)) - self.cpp_info.components["jxl_dec"].system_libs.append( - tools.stdcpp_library(self)) - self.cpp_info.components["jxl_threads"].system_libs.append( - tools.stdcpp_library(self)) + if not self.options.shared: + self.cpp_info.components["jxl_threads"].defines.append("JXL_THREADS_STATIC_DEFINE") + if libcxx: + self.cpp_info.components["jxl_threads"].system_libs.append(libcxx) diff --git a/recipes/libjxl/all/patches/0001-clean-targets-v0.5.patch b/recipes/libjxl/all/patches/0001-clean-targets-v0.5.patch deleted file mode 100644 index 1f47c925782ce..0000000000000 --- a/recipes/libjxl/all/patches/0001-clean-targets-v0.5.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -150,8 +150,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - if(JPEGXL_STATIC) - set(CMAKE_FIND_LIBRARY_SUFFIXES .a) - set(BUILD_SHARED_LIBS 0) -- set(CMAKE_EXE_LINKER_FLAGS -- "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++") - if (MINGW) - # In MINGW libstdc++ uses pthreads directly. When building statically a - # program (regardless of whether the source code uses pthread or not) the -@@ -247,8 +245,6 @@ set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_EXTENSIONS OFF) - set(CMAKE_CXX_STANDARD_REQUIRED YES) - --add_subdirectory(third_party) -- - set(THREADS_PREFER_PTHREAD_FLAG YES) - find_package(Threads REQUIRED) - -@@ -331,6 +327,3 @@ endif () - if (${JPEGXL_ENABLE_PLUGINS}) - add_subdirectory(plugins) - endif () -- --# Binary tools --add_subdirectory(tools) - ---- a/lib/CMakeLists.txt -+++ b/lib/CMakeLists.txt -@@ -119,7 +119,6 @@ endif() #!MSVC - include(jxl.cmake) - - # Other libraries outside the core jxl library. --include(jxl_extras.cmake) - include(jxl_threads.cmake) - - # Install all the library headers from the source and the generated ones. There diff --git a/recipes/libjxl/all/patches/0001-clean-targets-v0.6.patch b/recipes/libjxl/all/patches/0001-clean-targets-v0.6.patch deleted file mode 100644 index e59af39610354..0000000000000 --- a/recipes/libjxl/all/patches/0001-clean-targets-v0.6.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -161,6 +161,4 @@ # ourselves; for real use case we don't care about stdlib, as it is "granted", - # so just linking all other libraries is fine. - if (NOT APPLE) -- set(CMAKE_EXE_LINKER_FLAGS -- "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++") - endif() - endif() # JPEGXL_STATIC -@@ -278,8 +277,6 @@ set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_EXTENSIONS OFF) - set(CMAKE_CXX_STANDARD_REQUIRED YES) - --add_subdirectory(third_party) -- - # Copy the JXL license file to the output build directory. - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" - ${PROJECT_BINARY_DIR}/LICENSE.jpeg-xl COPYONLY) -@@ -380,6 +376,3 @@ # Plugins for third-party software - if (${JPEGXL_ENABLE_PLUGINS}) - add_subdirectory(plugins) - endif () -- --# Binary tools --add_subdirectory(tools) - ---- a/lib/CMakeLists.txt -+++ b/lib/CMakeLists.txt -@@ -132,7 +132,6 @@ # The jxl library definition. - include(jxl.cmake) - - # Other libraries outside the core jxl library. --include(jxl_extras.cmake) - include(jxl_threads.cmake) - - # Install all the library headers from the source and the generated ones. There diff --git a/recipes/libjxl/all/patches/0002-fix-dependencies-v0.5.patch b/recipes/libjxl/all/patches/0002-fix-dependencies-v0.5.patch deleted file mode 100644 index 8ec6fc1cb0d9d..0000000000000 --- a/recipes/libjxl/all/patches/0002-fix-dependencies-v0.5.patch +++ /dev/null @@ -1,106 +0,0 @@ ---- a/lib/jxl.cmake -+++ b/lib/jxl.cmake -@@ -328,7 +328,7 @@ if (JPEGXL_ENABLE_SKCMS) - list(APPEND JPEGXL_INTERNAL_FLAGS -DJPEGXL_ENABLE_SKCMS=1) - list(APPEND JPEGXL_INTERNAL_LIBS skcms) - else () -- list(APPEND JPEGXL_INTERNAL_LIBS lcms2) -+ list(APPEND JPEGXL_INTERNAL_LIBS ${CONAN_LIBS_LCMS}) - endif () - - if (NOT JPEGXL_ENABLE_TRANSCODE_JPEG) -@@ -353,8 +353,6 @@ set_property(TARGET jxl_dec-obj PROPERTY POSITION_INDEPENDENT_CODE ON) - target_include_directories(jxl_dec-obj PUBLIC - ${PROJECT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include -- $ -- $ - ) - target_compile_definitions(jxl_dec-obj PUBLIC - ${OBJ_COMPILE_DEFINITIONS} -@@ -371,8 +369,6 @@ set_property(TARGET jxl_enc-obj PROPERTY POSITION_INDEPENDENT_CODE ON) - target_include_directories(jxl_enc-obj PUBLIC - ${PROJECT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include -- $ -- $ - ) - target_compile_definitions(jxl_enc-obj PUBLIC - ${OBJ_COMPILE_DEFINITIONS} -@@ -381,23 +377,6 @@ if (JPEGXL_ENABLE_PROFILER) - target_link_libraries(jxl_enc-obj PUBLIC jxl_profiler) - endif() - --#TODO(lode): don't depend on CMS for the core library --if (JPEGXL_ENABLE_SKCMS) -- target_include_directories(jxl_enc-obj PRIVATE -- $ -- ) -- target_include_directories(jxl_dec-obj PRIVATE -- $ -- ) --else () -- target_include_directories(jxl_enc-obj PRIVATE -- $ -- ) -- target_include_directories(jxl_dec-obj PRIVATE -- $ -- ) --endif () -- - # Headers for exporting/importing public headers - include(GenerateExportHeader) - # TODO(deymo): Add these visibility properties to the static dependencies of -@@ -416,9 +395,6 @@ set_target_properties(jxl_enc-obj PROPERTIES - VISIBILITY_INLINES_HIDDEN 1 - DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD - ) --generate_export_header(jxl_enc-obj -- BASE_NAME JXL -- EXPORT_FILE_NAME include/jxl/jxl_export.h) - target_include_directories(jxl_enc-obj PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/include) - -@@ -496,9 +472,8 @@ if (((NOT DEFINED "${TARGET_SUPPORTS_SHARED_LIBS}") OR - add_library(jxl SHARED - $ - $) --strip_static(JPEGXL_INTERNAL_SHARED_LIBS JPEGXL_INTERNAL_LIBS) - target_link_libraries(jxl PUBLIC ${JPEGXL_COVERAGE_FLAGS}) --target_link_libraries(jxl PRIVATE ${JPEGXL_INTERNAL_SHARED_LIBS}) -+target_link_libraries(jxl PRIVATE ${JPEGXL_INTERNAL_LIBS}) - # Shared library include path contains only the "include/" paths. - target_include_directories(jxl PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/include" -@@ -507,13 +482,13 @@ set_target_properties(jxl PROPERTIES - VERSION ${JPEGXL_LIBRARY_VERSION} - SOVERSION ${JPEGXL_LIBRARY_SOVERSION} - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" -- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") -+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" -+ DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD) - - # Public shared decoder library. - add_library(jxl_dec SHARED $) --strip_static(JPEGXL_DEC_INTERNAL_SHARED_LIBS JPEGXL_DEC_INTERNAL_LIBS) - target_link_libraries(jxl_dec PUBLIC ${JPEGXL_COVERAGE_FLAGS}) --target_link_libraries(jxl_dec PRIVATE ${JPEGXL_DEC_INTERNAL_SHARED_LIBS}) -+target_link_libraries(jxl_dec PRIVATE ${JPEGXL_DEC_INTERNAL_LIBS}) - # Shared library include path contains only the "include/" paths. - target_include_directories(jxl_dec PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/include" -@@ -549,8 +524,14 @@ install(TARGETS jxl - else() - add_library(jxl ALIAS jxl-static) - add_library(jxl_dec ALIAS jxl_dec-static) -+set_target_properties(jxl-static PROPERTIES -+ DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD) - endif() # TARGET_SUPPORTS_SHARED_LIBS AND NOT JPEGXL_STATIC - -+generate_export_header(jxl -+ BASE_NAME JXL -+ EXPORT_FILE_NAME include/jxl/jxl_export.h) -+ - # Add a pkg-config file for libjxl. - set(JPEGXL_LIBRARY_REQUIRES - "libhwy libbrotlicommon libbrotlienc libbrotlidec") diff --git a/recipes/libjxl/all/patches/0002-fix-dependencies-v0.6.patch b/recipes/libjxl/all/patches/0002-fix-dependencies-v0.6.patch deleted file mode 100644 index b4ff403da499f..0000000000000 --- a/recipes/libjxl/all/patches/0002-fix-dependencies-v0.6.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- a/lib/jxl.cmake -+++ b/lib/jxl.cmake -@@ -334,7 +334,7 @@ if (JPEGXL_ENABLE_SKCMS) - list(APPEND JPEGXL_INTERNAL_LIBS skcms) - endif () - else () -- list(APPEND JPEGXL_INTERNAL_LIBS lcms2) -+ list(APPEND JPEGXL_INTERNAL_LIBS ${CONAN_LIBS_LCMS}) - endif () - - if (NOT JPEGXL_ENABLE_TRANSCODE_JPEG) -@@ -359,8 +359,6 @@ set_property(TARGET jxl_dec-obj PROPERTY POSITION_INDEPENDENT_CODE ON) - target_include_directories(jxl_dec-obj PUBLIC - ${PROJECT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include -- $ -- $ - ) - target_compile_definitions(jxl_dec-obj PUBLIC - ${OBJ_COMPILE_DEFINITIONS} -@@ -377,8 +375,6 @@ set_property(TARGET jxl_enc-obj PROPERTY POSITION_INDEPENDENT_CODE ON) - target_include_directories(jxl_enc-obj PUBLIC - ${PROJECT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include -- $ -- $ - ) - target_compile_definitions(jxl_enc-obj PUBLIC - ${OBJ_COMPILE_DEFINITIONS} -@@ -387,17 +383,6 @@ if (JPEGXL_ENABLE_PROFILER) - target_link_libraries(jxl_enc-obj PUBLIC jxl_profiler) - endif() - --#TODO(lode): don't depend on CMS for the core library --if (JPEGXL_ENABLE_SKCMS) -- target_include_directories(jxl_enc-obj PRIVATE -- $ -- ) --else () -- target_include_directories(jxl_enc-obj PRIVATE -- $ -- ) --endif () -- - # Headers for exporting/importing public headers - include(GenerateExportHeader) - set_target_properties(jxl_dec-obj PROPERTIES -@@ -413,9 +398,6 @@ set_target_properties(jxl_enc-obj PROPERTIES - VISIBILITY_INLINES_HIDDEN 1 - DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD - ) --generate_export_header(jxl_enc-obj -- BASE_NAME JXL -- EXPORT_FILE_NAME include/jxl/jxl_export.h) - target_include_directories(jxl_enc-obj PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/include) - -@@ -495,9 +477,8 @@ if (((NOT DEFINED "${TARGET_SUPPORTS_SHARED_LIBS}") OR - - # Public shared library. - add_library(jxl SHARED ${JPEGXL_INTERNAL_OBJECTS}) --strip_static(JPEGXL_INTERNAL_SHARED_LIBS JPEGXL_INTERNAL_LIBS) - target_link_libraries(jxl PUBLIC ${JPEGXL_COVERAGE_FLAGS}) --target_link_libraries(jxl PRIVATE ${JPEGXL_INTERNAL_SHARED_LIBS}) -+target_link_libraries(jxl PRIVATE ${JPEGXL_INTERNAL_LIBS}) - # Shared library include path contains only the "include/" paths. - target_include_directories(jxl PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/include" -@@ -506,13 +487,13 @@ set_target_properties(jxl PROPERTIES - VERSION ${JPEGXL_LIBRARY_VERSION} - SOVERSION ${JPEGXL_LIBRARY_SOVERSION} - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" -- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") -+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" -+ DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD) - - # Public shared decoder library. - add_library(jxl_dec SHARED $) --strip_static(JPEGXL_DEC_INTERNAL_SHARED_LIBS JPEGXL_DEC_INTERNAL_LIBS) - target_link_libraries(jxl_dec PUBLIC ${JPEGXL_COVERAGE_FLAGS}) --target_link_libraries(jxl_dec PRIVATE ${JPEGXL_DEC_INTERNAL_SHARED_LIBS}) -+target_link_libraries(jxl_dec PRIVATE ${JPEGXL_DEC_INTERNAL_LIBS}) - # Shared library include path contains only the "include/" paths. - target_include_directories(jxl_dec PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}/include" -@@ -523,6 +504,12 @@ set_target_properties(jxl_dec PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") - -+set(LINKER_EXCLUDE_LIBS_FLAG "-Wl,--exclude-libs=ALL") -+include(CheckCSourceCompiles) -+list(APPEND CMAKE_EXE_LINKER_FLAGS ${LINKER_EXCLUDE_LIBS_FLAG}) -+check_c_source_compiles("int main(){return 0;}" LINKER_SUPPORT_EXCLUDE_LIBS) -+list(REMOVE_ITEM CMAKE_EXE_LINKER_FLAGS ${LINKER_EXCLUDE_LIBS_FLAG}) -+ - # Add a jxl.version file as a version script to tag symbols with the - # appropriate version number. This script is also used to limit what's exposed - # in the shared library from the static dependencies bundled here. -@@ -541,8 +528,10 @@ foreach(target IN ITEMS jxl jxl_dec) - # This hides the default visibility symbols from static libraries bundled into - # the shared library. In particular this prevents exposing symbols from hwy - # and skcms in the shared library. -- set_property(TARGET ${target} APPEND_STRING PROPERTY -- LINK_FLAGS " -Wl,--exclude-libs=ALL") -+ if(${LINKER_SUPPORT_EXCLUDE_LIBS}) -+ set_property(TARGET ${target} APPEND_STRING PROPERTY -+ LINK_FLAGS " ${LINKER_EXCLUDE_LIBS_FLAG}") -+ endif() - endforeach() - - # Only install libjxl shared library. The libjxl_dec is not installed since it -@@ -553,8 +542,14 @@ install(TARGETS jxl - else() - add_library(jxl ALIAS jxl-static) - add_library(jxl_dec ALIAS jxl_dec-static) -+set_target_properties(jxl-static PROPERTIES -+ DEFINE_SYMBOL JXL_INTERNAL_LIBRARY_BUILD) - endif() # TARGET_SUPPORTS_SHARED_LIBS AND NOT JPEGXL_STATIC - -+generate_export_header(jxl -+ BASE_NAME JXL -+ EXPORT_FILE_NAME include/jxl/jxl_export.h) -+ - # Add a pkg-config file for libjxl. - set(JPEGXL_LIBRARY_REQUIRES - "libhwy libbrotlicommon libbrotlienc libbrotlidec") diff --git a/recipes/libjxl/all/test_package/CMakeLists.txt b/recipes/libjxl/all/test_package/CMakeLists.txt index 7b9b613cbb24a..4cb796f1c09f2 100644 --- a/recipes/libjxl/all/test_package/CMakeLists.txt +++ b/recipes/libjxl/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(libjxl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE libjxl::libjxl) diff --git a/recipes/libjxl/all/test_package/conanfile.py b/recipes/libjxl/all/test_package/conanfile.py index 138d4f5333429..ef5d7042163ec 100644 --- a/recipes/libjxl/all/test_package/conanfile.py +++ b/recipes/libjxl/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") - img_path = os.path.join(self.source_folder, "test.jxl") - self.run(bin_path + " " + img_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libjxl/all/test_package/test.jxl b/recipes/libjxl/all/test_package/test.jxl deleted file mode 100644 index a0f419a98a426..0000000000000 Binary files a/recipes/libjxl/all/test_package/test.jxl and /dev/null differ diff --git a/recipes/libjxl/all/test_package/test_package.c b/recipes/libjxl/all/test_package/test_package.c index 2cb652aa9249a..3b65dffc293ab 100644 --- a/recipes/libjxl/all/test_package/test_package.c +++ b/recipes/libjxl/all/test_package/test_package.c @@ -4,87 +4,15 @@ #include "jxl/decode.h" #include "jxl/thread_parallel_runner.h" -static int ReadFile(const char filename[], uint8_t *data[], size_t *size) +int main() { - FILE *fp = fopen(filename, "rb"); - if (!fp) - return 0; - - if (fseek(fp, 0, SEEK_END) != 0) { - fclose(fp); - return 0; - } - - *size = ftell(fp); - if (fseek(fp, 0, SEEK_SET) != 0) { - fclose(fp); - return 0; - } - - *data = malloc(*size); - if (!*data) { - fclose(fp); - return 0; - } - - if (fread(*data, sizeof(uint8_t), *size, fp) != *size) { - free(*data); - fclose(fp); - return 0; - } - - if (fclose(fp) != 0) { - free(*data); - return 0; - } - - return 1; -} - -int main(int argc, char *argv[]) -{ - int ret = EXIT_FAILURE; - - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return ret; - } - - uint8_t *data; - size_t size; - if (!ReadFile(argv[1], &data, &size)) - return ret; - JxlDecoder *dec = NULL; void *runner = NULL; - dec = JxlDecoderCreate(NULL); - if (JxlDecoderSubscribeEvents(dec, JXL_DEC_BASIC_INFO) != JXL_DEC_SUCCESS) - goto Exit; - - runner = JxlThreadParallelRunnerCreate( - NULL, JxlThreadParallelRunnerDefaultNumWorkerThreads()); - if (JxlDecoderSetParallelRunner(dec, JxlThreadParallelRunner, runner) - != JXL_DEC_SUCCESS) - goto Exit; - if (JxlDecoderSetInput(dec, data, size) != JXL_DEC_SUCCESS) - goto Exit; - - if (JxlDecoderProcessInput(dec) != JXL_DEC_BASIC_INFO) - goto Exit; - - JxlBasicInfo info; - if (JxlDecoderGetBasicInfo(dec, &info) != JXL_DEC_SUCCESS) - goto Exit; - - printf("Image size: %d x %d pixels\n", info.xsize, info.ysize); - - ret = EXIT_SUCCESS; - -Exit: - free(data); - JxlThreadParallelRunnerDestroy(runner); - JxlDecoderDestroy(dec); - return ret; + // Allways True + if (JxlDecoderSubscribeEvents(dec, JXL_DEC_BASIC_INFO) == JXL_DEC_SUCCESS) + { + printf("Test"); + } } diff --git a/recipes/acado/all/test_v1_package/CMakeLists.txt b/recipes/libjxl/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/acado/all/test_v1_package/CMakeLists.txt rename to recipes/libjxl/all/test_v1_package/CMakeLists.txt diff --git a/recipes/aws-c-s3/all/test_v1_package/conanfile.py b/recipes/libjxl/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/aws-c-s3/all/test_v1_package/conanfile.py rename to recipes/libjxl/all/test_v1_package/conanfile.py diff --git a/recipes/libjxl/config.yml b/recipes/libjxl/config.yml index c79a1af3be31f..a55138375a57c 100644 --- a/recipes/libjxl/config.yml +++ b/recipes/libjxl/config.yml @@ -1,5 +1,9 @@ versions: - "0.5.0": + "0.11.1": folder: all - "0.6.1": + "0.10.3": + folder: all + "0.10.2": + folder: all + "0.8.2": folder: all diff --git a/recipes/libkml/all/conandata.yml b/recipes/libkml/all/conandata.yml index deea781fb42fe..018a7586f3180 100644 --- a/recipes/libkml/all/conandata.yml +++ b/recipes/libkml/all/conandata.yml @@ -1,3 +1,5 @@ +# NOTE: if a new version >1.3.0 is added, verify if it is +# compatible with C++17 and above to reflect this in recipe sources: "1.3.0": url: "https://github.com/libkml/libkml/archive/1.3.0.zip" diff --git a/recipes/libkml/all/conanfile.py b/recipes/libkml/all/conanfile.py index 1a9d0a90947d1..7d4ffb3d7e007 100644 --- a/recipes/libkml/all/conanfile.py +++ b/recipes/libkml/all/conanfile.py @@ -1,12 +1,12 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration, ConanException 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.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 textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class LibkmlConan(ConanFile): @@ -43,7 +43,7 @@ def layout(self): def requirements(self): self.requires("boost/1.81.0", transitive_headers=True) - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("minizip/1.2.13") self.requires("uriparser/0.9.7") self.requires("zlib/[>=1.2.11 <2]") @@ -52,14 +52,37 @@ def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration(f"{self.ref} shared with Visual Studio and MT runtime is not supported") + def package_id(self): + cppstd = self.info.settings.get_safe("compiler.cppstd") + if cppstd and cppstd not in ['98', 'gnu98', '11', 'gnu11', '14', 'gnu14']: + prefix = "gnu" if str(cppstd).startswith("gnu") else "" + self.info.settings.compiler.cppstd = f"{prefix}14" + 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 + + # Fallback to C++14 - the implementation uses + # functionality that is not compliant with C++17 + # See https://github.com/conan-io/conan/issues/16148 + cppstd = self.settings.get_safe("compiler.cppstd") + if cppstd and conan_version.major >= 2: + from conan.tools.build import valid_max_cppstd + if not valid_max_cppstd(self, "14"): + self.output.warning(f"Recipe not compatible with C++ {cppstd}, falling back to C++14") + use_gnu_extensions = str(cppstd).startswith("gnu") + tc.blocks.remove("cppstd") + tc.cache_variables["CMAKE_CXX_STANDARD"] = "14" + tc.cache_variables["CMAKE_CXX_EXTENSIONS"] = use_gnu_extensions + # To install relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.3.0": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) deps.generate() @@ -77,40 +100,11 @@ def package(self): 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, "cmake")) - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - { - "kmlbase": "LibKML::kmlbase", - "kmlxsd": "LibKML::kmlxsd", - "kmldom": "LibKML::kmldom", - "kmlengine": "LibKML::kmlengine", - "kmlconvenience": "LibKML::kmlconvenience", - "kmlregionator": "LibKML::kmlregionator", - } - ) - - 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", "LibKML") self.cpp_info.set_property("pkg_config_name", "libkml") - self.cpp_info.names["cmake_find_package"] = "LibKML" - self.cpp_info.names["cmake_find_package_multi"] = "LibKML" - self._register_components({ "kmlbase": { "defines": ["LIBKML_DLL"] if self.settings.os == "Windows" and self.options.shared else [], @@ -142,10 +136,6 @@ def _register_components(self, components): system_libs = values.get("system_libs", []) requires = values.get("requires", []) self.cpp_info.components[comp_cmake_lib_name].set_property("cmake_target_name", comp_cmake_lib_name) - self.cpp_info.components[comp_cmake_lib_name].names["cmake_find_package"] = comp_cmake_lib_name - self.cpp_info.components[comp_cmake_lib_name].names["cmake_find_package_multi"] = comp_cmake_lib_name - self.cpp_info.components[comp_cmake_lib_name].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components[comp_cmake_lib_name].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] self.cpp_info.components[comp_cmake_lib_name].libs = [comp_cmake_lib_name] self.cpp_info.components[comp_cmake_lib_name].defines = defines self.cpp_info.components[comp_cmake_lib_name].system_libs = system_libs diff --git a/recipes/libkml/all/test_package/CMakeLists.txt b/recipes/libkml/all/test_package/CMakeLists.txt index c68b8c6d04753..5da8699fb3a70 100644 --- a/recipes/libkml/all/test_package/CMakeLists.txt +++ b/recipes/libkml/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(LibKML REQUIRED CONFIG) diff --git a/recipes/libkml/all/test_v1_package/CMakeLists.txt b/recipes/libkml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libkml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libkml/all/test_v1_package/conanfile.py b/recipes/libkml/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libkml/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_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/libliftoff/all/conandata.yml b/recipes/libliftoff/all/conandata.yml index 9cc2caed8889e..18f54d8b034f2 100644 --- a/recipes/libliftoff/all/conandata.yml +++ b/recipes/libliftoff/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.0": + url: "https://gitlab.freedesktop.org/emersion/libliftoff/-/archive/v0.5.0/libliftoff-v0.5.0.tar.bz2" + sha256: "2ed21be3c563b129bd8f188195a23256017e15908c195f3edcd3697584caf1c8" "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 index 28626c0146534..792e87c5ed4a9 100644 --- a/recipes/libliftoff/all/conanfile.py +++ b/recipes/libliftoff/all/conanfile.py @@ -16,7 +16,7 @@ class LibliftoffConan(ConanFile): description = "Lightweight KMS plane library." license = "MIT" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/project/package" + homepage = "https://gitlab.freedesktop.org/emersion/libliftoff" topics = ("drm", "KMS", "plane") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -39,16 +39,16 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libdrm/2.4.114") + self.requires("libdrm/2.4.119") 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") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.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/libliftoff/all/test_package/conanfile.py b/recipes/libliftoff/all/test_package/conanfile.py index 5aab0703e7a4e..cdcf9b281723d 100644 --- a/recipes/libliftoff/all/test_package/conanfile.py +++ b/recipes/libliftoff/all/test_package/conanfile.py @@ -17,9 +17,9 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def build(self): meson = Meson(self) diff --git a/recipes/libliftoff/config.yml b/recipes/libliftoff/config.yml index 3a9d5538921fc..bdf259c14aca4 100644 --- a/recipes/libliftoff/config.yml +++ b/recipes/libliftoff/config.yml @@ -1,3 +1,5 @@ versions: + "0.5.0": + folder: all "0.4.1": folder: all diff --git a/recipes/liblqr/all/CMakeLists.txt b/recipes/liblqr/all/CMakeLists.txt new file mode 100644 index 0000000000000..303355e779e6b --- /dev/null +++ b/recipes/liblqr/all/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 3.15) +project(liblqr LANGUAGES C) + +find_package(glib REQUIRED CONFIG) + +set(LQR_SRC_SUBDIR ${LQR_SRC_DIR}/lqr) + +file(GLOB LQR_SRCS_FILES ${LQR_SRC_SUBDIR}/*.c) + +add_library(lqr-1 ${LQR_SRCS_FILES}) +target_include_directories(lqr-1 PUBLIC ${LQR_SRC_DIR} ${LQR_SRC_SUBDIR}) +target_link_libraries(lqr-1 PUBLIC glib::glib-2.0) +if(WIN32) + if(BUILD_SHARED_LIBS) + target_compile_definitions(lqr-1 PRIVATE LQR_EXPORTS) + else() + target_compile_definitions(lqr-1 PUBLIC LQR_DISABLE_DECLSPEC) + endif() +endif() + +install(FILES ${LQR_SRC_SUBDIR}/lqr.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lqr-1) +install( + FILES + ${LQR_SRC_SUBDIR}/lqr_base.h + ${LQR_SRC_SUBDIR}/lqr_carver_bias_pub.h + ${LQR_SRC_SUBDIR}/lqr_carver_list_pub.h + ${LQR_SRC_SUBDIR}/lqr_carver_pub.h + ${LQR_SRC_SUBDIR}/lqr_carver_rigmask_pub.h + ${LQR_SRC_SUBDIR}/lqr_cursor_pub.h + ${LQR_SRC_SUBDIR}/lqr_energy_pub.h + ${LQR_SRC_SUBDIR}/lqr_gradient_pub.h + ${LQR_SRC_SUBDIR}/lqr_progress_pub.h + ${LQR_SRC_SUBDIR}/lqr_rwindow_pub.h + ${LQR_SRC_SUBDIR}/lqr_vmap_list_pub.h + ${LQR_SRC_SUBDIR}/lqr_vmap_pub.h + DESTINATION + ${CMAKE_INSTALL_INCLUDEDIR}/lqr-1/lqr +) +install( + TARGETS lqr-1 + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/recipes/liblqr/all/conandata.yml b/recipes/liblqr/all/conandata.yml new file mode 100644 index 0000000000000..d562db29a3a36 --- /dev/null +++ b/recipes/liblqr/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.4.3": + url: "http://liblqr.wdfiles.com/local--files/en:download-page/liblqr-1-0.4.3.tar.bz2" + sha256: "862fc5cecaa96d38d4d9279c8a6fbfc276393f0548909ee0912e41df59894471" diff --git a/recipes/liblqr/all/conanfile.py b/recipes/liblqr/all/conanfile.py new file mode 100644 index 0000000000000..56681e130e9e4 --- /dev/null +++ b/recipes/liblqr/all/conanfile.py @@ -0,0 +1,130 @@ +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.env import VirtualBuildEnv +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.54.0" + + +class LibLqrConan(ConanFile): + name = "liblqr" + description = ( + "The LiquidRescale (lqr) library provides a C/C++ API for performing " + "non-uniform resizing of images by the seam-carving technique." + ) + license = ("LGPL-3.0-or-later", "GPL-3.0-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://liblqr.wikidot.com" + topics = ("image", "resizing", "seam-carving") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _is_cl_like(self): + return self.settings.compiler.get_safe("runtime") is not None + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + 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.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + if self._is_cl_like: + cmake_layout(self, src_folder="src") + else: + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("glib/2.81.0", transitive_headers=True) + + def build_requirements(self): + if not self._is_cl_like: + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.2 <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], strip_root=True) + + def generate(self): + if self._is_cl_like: + tc = CMakeToolchain(self) + tc.variables["LQR_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + deps = CMakeDeps(self) + deps.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.append("--disable-install-man") + if self.settings.os == "Windows": + # This option in upstream configure.ac must be disabled for static + # windows build, to avoid adding __declspec(dllexport) in front + # of declarations during build. + tc.configure_args.append(f"--enable-declspec={yes_no(self.options.shared)}") + tc.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + if self._is_cl_like: + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.build() + else: + 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")) + if self._is_cl_like: + 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")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "lqr-1") + self.cpp_info.includedirs = [os.path.join("include", "lqr-1")] + self.cpp_info.libs = ["lqr-1"] + self.cpp_info.requires = ["glib::glib-2.0"] + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("LQR_DISABLE_DECLSPEC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/liblqr/all/test_package/CMakeLists.txt b/recipes/liblqr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fe1dadeb5b33a --- /dev/null +++ b/recipes/liblqr/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(liblqr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE liblqr::liblqr) diff --git a/recipes/liblqr/all/test_package/conanfile.py b/recipes/liblqr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/liblqr/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/liblqr/all/test_package/test_package.c b/recipes/liblqr/all/test_package/test_package.c new file mode 100644 index 0000000000000..890b1df50ef9c --- /dev/null +++ b/recipes/liblqr/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include + +#include + +int main() { + gint channels = 3; + gint w = 100; + gint h = 100; + guchar *rgb_buffer = (guchar *) malloc(channels * w * h * sizeof(guchar)); + + LqrCarver *r = lqr_carver_new(rgb_buffer, w, h, channels); + lqr_carver_destroy(r); + + return 0; +} diff --git a/recipes/liblqr/config.yml b/recipes/liblqr/config.yml new file mode 100644 index 0000000000000..9be35d17501c4 --- /dev/null +++ b/recipes/liblqr/config.yml @@ -0,0 +1,3 @@ +versions: + "0.4.3": + folder: all diff --git a/recipes/liblsl/all/CMakeLists.txt b/recipes/liblsl/all/CMakeLists.txt index 79a17945e58b4..04c96c99f25c3 100644 --- a/recipes/liblsl/all/CMakeLists.txt +++ b/recipes/liblsl/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(conanbuildinfo.cmake) diff --git a/recipes/liblsl/all/test_package/CMakeLists.txt b/recipes/liblsl/all/test_package/CMakeLists.txt index 0ebdf94800cf2..3f420ecc58980 100644 --- a/recipes/liblsl/all/test_package/CMakeLists.txt +++ b/recipes/liblsl/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(LSL CONFIG REQUIRED) diff --git a/recipes/liblsl/all/test_v1_package/CMakeLists.txt b/recipes/liblsl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/liblsl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/liblsl/all/test_v1_package/conanfile.py b/recipes/liblsl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/liblsl/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_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/libltc/all/test_package/CMakeLists.txt b/recipes/libltc/all/test_package/CMakeLists.txt index 2e228217c2a41..d439a5fca0453 100644 --- a/recipes/libltc/all/test_package/CMakeLists.txt +++ b/recipes/libltc/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(libltc REQUIRED CONFIG) diff --git a/recipes/libltc/all/test_v1_package/CMakeLists.txt b/recipes/libltc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libltc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libltc/all/test_v1_package/conanfile.py b/recipes/libltc/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libltc/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_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/liblzf/all/CMakeLists.txt b/recipes/liblzf/all/CMakeLists.txt index a501b15938468..c20ae859c1770 100644 --- a/recipes/liblzf/all/CMakeLists.txt +++ b/recipes/liblzf/all/CMakeLists.txt @@ -2,8 +2,9 @@ cmake_minimum_required(VERSION 3.15) project(liblzf LANGUAGES C) add_library(liblzf - src/lzf_c.c - src/lzf_d.c + lzf_c.c + lzf_d.c + liblzf.def ) set_target_properties(liblzf PROPERTIES OUTPUT_NAME lzf) @@ -20,14 +21,10 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") target_compile_options(liblzf PRIVATE "-funroll-all-loops") endif() -set_target_properties(liblzf PROPERTIES - WINDOWS_EXPORT_ALL_SYMBOLS ON - PUBLIC_HEADER src/lzf.h -) - +include(GNUInstallDirs) install(TARGETS liblzf RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) +install(FILES lzf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/liblzf/all/conanfile.py b/recipes/liblzf/all/conanfile.py index 70d2ac9f7171b..0796e45c4ac60 100644 --- a/recipes/liblzf/all/conanfile.py +++ b/recipes/liblzf/all/conanfile.py @@ -29,7 +29,8 @@ class LiblzfConan(ConanFile): } def export_sources(self): - copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + copy(self, "liblzf.def", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) export_conandata_patches(self) def config_options(self): @@ -55,11 +56,11 @@ def generate(self): def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + cmake.configure() 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/recipes/liblzf/all/liblzf.def b/recipes/liblzf/all/liblzf.def new file mode 100644 index 0000000000000..2d8efa48df7f7 --- /dev/null +++ b/recipes/liblzf/all/liblzf.def @@ -0,0 +1,3 @@ +EXPORTS + lzf_compress + lzf_decompress diff --git a/recipes/liblzf/all/test_v1_package/CMakeLists.txt b/recipes/liblzf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/liblzf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/liblzf/all/test_v1_package/conanfile.py b/recipes/liblzf/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/liblzf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/libmad/all/test_package/CMakeLists.txt b/recipes/libmad/all/test_package/CMakeLists.txt index 74d514ce40214..5bbde6b1f8b68 100644 --- a/recipes/libmad/all/test_package/CMakeLists.txt +++ b/recipes/libmad/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(libmad REQUIRED CONFIG) diff --git a/recipes/libmad/all/test_v1_package/CMakeLists.txt b/recipes/libmad/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmad/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libmad/all/test_v1_package/conanfile.py b/recipes/libmad/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmad/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_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/libmagic/all/conanfile.py b/recipes/libmagic/all/conanfile.py index 6d0843dc3f3f3..6faae6cdf6502 100644 --- a/recipes/libmagic/all/conanfile.py +++ b/recipes/libmagic/all/conanfile.py @@ -44,9 +44,9 @@ def layout(self): def requirements(self): self.requires("bzip2/1.0.8") - self.requires("xz_utils/5.4.4") + self.requires("xz_utils/[>=5.4.5 <6]") self.requires("zlib/[>=1.2.11 <2]") - self.requires("zstd/1.5.5") + self.requires("zstd/[^1.5]") # TODO: Add lzlib recipe # self.requires("lzlib/1.13") diff --git a/recipes/libmaxminddb/all/conandata.yml b/recipes/libmaxminddb/all/conandata.yml index f8c6fb1bee557..51e0a1864f4c0 100644 --- a/recipes/libmaxminddb/all/conandata.yml +++ b/recipes/libmaxminddb/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.12.2": + url: "https://github.com/maxmind/libmaxminddb/releases/download/1.12.2/libmaxminddb-1.12.2.tar.gz" + sha256: "1bfbf8efba3ed6462e04e225906ad5ce5fe958aa3d626a1235b2a2253d600743" + "1.10.0": + url: "https://github.com/maxmind/libmaxminddb/releases/download/1.10.0/libmaxminddb-1.10.0.tar.gz" + sha256: "5e6db72df423ae225bfe8897069f6def40faa8931f456b99d79b8b4d664c6671" + "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" diff --git a/recipes/libmaxminddb/all/conanfile.py b/recipes/libmaxminddb/all/conanfile.py index 7afd56f70e087..866a4b5b085e7 100644 --- a/recipes/libmaxminddb/all/conanfile.py +++ b/recipes/libmaxminddb/all/conanfile.py @@ -1,9 +1,10 @@ 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, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class LibmaxminddbConan(ConanFile): name = "libmaxminddb" @@ -13,13 +14,16 @@ class LibmaxminddbConan(ConanFile): homepage = "http://maxmind.github.io/libmaxminddb/" topics = ("maxmind", "geoip") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], + "with_binaries": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_binaries": True, } def export_sources(self): @@ -28,21 +32,14 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "1.10.0": + del self.options.with_binaries 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") @@ -54,6 +51,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False + if "with_binaries" in self.options: + tc.variables["MAXMINDDB_BUILD_BINARIES"] = self.options.with_binaries # 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() @@ -79,9 +78,8 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] - if self.settings.os != "Windows": + if self.settings.os != "Windows" and self.options.get_safe("with_binaries", True): 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 diff --git a/recipes/libmaxminddb/all/test_package/CMakeLists.txt b/recipes/libmaxminddb/all/test_package/CMakeLists.txt index 1d23aba68bcc6..da8c8a2a9b831 100644 --- a/recipes/libmaxminddb/all/test_package/CMakeLists.txt +++ b/recipes/libmaxminddb/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(maxminddb REQUIRED CONFIG) diff --git a/recipes/libmaxminddb/all/test_v1_package/CMakeLists.txt b/recipes/libmaxminddb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f31d3904fb26f..0000000000000 --- a/recipes/libmaxminddb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(maxminddb REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE maxminddb::maxminddb) diff --git a/recipes/libmaxminddb/all/test_v1_package/conanfile.py b/recipes/libmaxminddb/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmaxminddb/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_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/libmaxminddb/config.yml b/recipes/libmaxminddb/config.yml index 376c8bc0f36ac..6cef5d2e1d9d8 100644 --- a/recipes/libmaxminddb/config.yml +++ b/recipes/libmaxminddb/config.yml @@ -1,4 +1,10 @@ versions: + "1.12.2": + folder: all + "1.10.0": + folder: all + "1.9.1": + folder: all "1.8.0": folder: all "1.7.1": diff --git a/recipes/libmbus/all/test_v1_package/CMakeLists.txt b/recipes/libmbus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libmbus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 9de3689208f00..0000000000000 --- a/recipes/libmbus/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/libmd/all/conandata.yml b/recipes/libmd/all/conandata.yml new file mode 100644 index 0000000000000..6433755dc3365 --- /dev/null +++ b/recipes/libmd/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + "1.1.0": + url: + - "https://libbsd.freedesktop.org/releases/libmd-1.1.0.tar.xz" + - "https://archive.hadrons.org/software/libmd/libmd-1.1.0.tar.xz" + sha256: "1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332" diff --git a/recipes/libmd/all/conanfile.py b/recipes/libmd/all/conanfile.py new file mode 100644 index 0000000000000..b7ad5096688cd --- /dev/null +++ b/recipes/libmd/all/conanfile.py @@ -0,0 +1,114 @@ +import os + +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 chdir, rename, 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, unix_path + +required_conan_version = ">=1.53.0" + + +class LibMDConan(ConanFile): + name = "libmd" + description = "Message Digest functions from BSD systems" + license = "BSD-2-Clause AND BSD-3-Clause AND ISC AND Beerware AND DocumentRef-COPYING:LicenseRef-libmd-Public-Domain" + homepage = "https://gitlab.freedesktop.org/libbsd/libmd" + url = "https://github.com/conan-io/conan-center-index" + topics = ("message-digest", "hash", "bsd", + "md2", "md4", "md5", "ripemd", "rmd160", + "sha", "sha1", "sha2", "sha256", "sha512") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + 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.cppstd") + self.settings.rm_safe("compiler.libcxx") + + 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 generate(self): + venv = VirtualBuildEnv(self) + venv.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() + 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 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): + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + if self.settings.os == "Windows" and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "md.dll.lib"), + os.path.join(self.package_folder, "lib", "md-0.lib")) + 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", "libmd") + + if self.settings.os == "Windows" and self.options.shared: + lib = "md-0" + else: + lib = "md" + self.cpp_info.libs = [lib] diff --git a/recipes/libmd/all/test_package/CMakeLists.txt b/recipes/libmd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6bdd5550a5b87 --- /dev/null +++ b/recipes/libmd/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +find_package(libmd REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmd::libmd) diff --git a/recipes/libmd/all/test_package/conanfile.py b/recipes/libmd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0f2d20bbcb70a --- /dev/null +++ b/recipes/libmd/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_layout, CMake + + +class TestPackageConan(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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmd/all/test_package/test_package.c b/recipes/libmd/all/test_package/test_package.c new file mode 100644 index 0000000000000..a7d2d1ef0b245 --- /dev/null +++ b/recipes/libmd/all/test_package/test_package.c @@ -0,0 +1,12 @@ +#include +#include + +int main() { + const char data[] = "12345"; + uint8_t hash[MD5_DIGEST_LENGTH]; + MD5_CTX md5_ctx; + MD5Init(&md5_ctx); + MD5Update(&md5_ctx, (const uint8_t *)data, strlen(data)); + MD5Final(hash, &md5_ctx); + return 0; +} diff --git a/recipes/libmd/config.yml b/recipes/libmd/config.yml new file mode 100644 index 0000000000000..11b7aff3a5ac4 --- /dev/null +++ b/recipes/libmd/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: "all" diff --git a/recipes/libmediainfo/all/conanfile.py b/recipes/libmediainfo/all/conanfile.py index 29fb127a8927a..4bfa8e66abf12 100644 --- a/recipes/libmediainfo/all/conanfile.py +++ b/recipes/libmediainfo/all/conanfile.py @@ -1,21 +1,20 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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 + rm, rmdir ) from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LibmediainfoConan(ConanFile): name = "libmediainfo" - license = ("BSD-2-Clause", "Apache-2.0", "GLPL-2.1+", "GPL-2.0-or-later", "MPL-2.0") + license = ("BSD-2-Clause", "Apache-2.0", "LGPL-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 = ( @@ -68,6 +67,9 @@ def generate(self): if Version(self.version) < "22.03": # Generate a relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "22.03": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) deps.generate() @@ -102,27 +104,6 @@ def package(self): 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( - os.path.join(self.package_folder, self._module_file_rel_path), - {"mediainfo": "MediaInfoLib::MediaInfoLib"} - ) - - 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", "MediaInfoLib") self.cpp_info.set_property("cmake_target_name", "mediainfo") @@ -136,9 +117,3 @@ def package_info(self): self.cpp_info.libs = [f"mediainfo{postfix}"] 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* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "MediaInfoLib" - 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] diff --git a/recipes/libmediainfo/all/test_package/CMakeLists.txt b/recipes/libmediainfo/all/test_package/CMakeLists.txt index c81192f5719cd..73b80fddba542 100644 --- a/recipes/libmediainfo/all/test_package/CMakeLists.txt +++ b/recipes/libmediainfo/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(MediaInfoLib REQUIRED CONFIG) diff --git a/recipes/libmediainfo/all/test_package/conanfile.py b/recipes/libmediainfo/all/test_package/conanfile.py index a518ea1284361..181c93b2a88a0 100644 --- a/recipes/libmediainfo/all/test_package/conanfile.py +++ b/recipes/libmediainfo/all/test_package/conanfile.py @@ -31,5 +31,4 @@ def build(self): def test(self): 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(f"{bin_path} {testsrc}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmediainfo/all/test_package/test_package.cpp b/recipes/libmediainfo/all/test_package/test_package.cpp index d4de9d263a0bc..5aa26cc3025e5 100644 --- a/recipes/libmediainfo/all/test_package/test_package.cpp +++ b/recipes/libmediainfo/all/test_package/test_package.cpp @@ -10,22 +10,18 @@ #include int main(int argc, const char *argv[]) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - return 1; - } MEDIAINFO_NS::MediaInfo mediainfo; #if defined(LIBMEDIAINFO_SHARED) std::cout << "Is MediaInfo ready? " << mediainfo.IsReady() << "\n"; #endif - ZenLib::Ztring videofile(argv[1]); - size_t opened = mediainfo.Open(videofile.To_Unicode()); - if (!opened) { - std::cerr << "Open failed\n"; - return 1; - } + std::string fakeVideoData = "FAKE DATA FOR TESTING\n"; + + mediainfo.Open_Buffer_Init(fakeVideoData.size(), 0); + mediainfo.Open_Buffer_Continue((unsigned char*)fakeVideoData.data(), fakeVideoData.size()); + mediainfo.Open_Buffer_Finalize(); + MEDIAINFO_NS::String info = mediainfo.Inform(); #ifdef UNICODE std::wcout << info; diff --git a/recipes/libmediainfo/all/test_package/testsrc.mp4 b/recipes/libmediainfo/all/test_package/testsrc.mp4 deleted file mode 100644 index 7e12ea126587e..0000000000000 Binary files a/recipes/libmediainfo/all/test_package/testsrc.mp4 and /dev/null differ diff --git a/recipes/libmediainfo/all/test_v1_package/CMakeLists.txt b/recipes/libmediainfo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmediainfo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index f87f616cc28bd..0000000000000 --- a/recipes/libmediainfo/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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.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/test_package/CMakeLists.txt b/recipes/libmemcached/all/test_package/CMakeLists.txt index 453e1be414e2c..0dc1878e4cc06 100644 --- a/recipes/libmemcached/all/test_package/CMakeLists.txt +++ b/recipes/libmemcached/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) set(CMAKE_CXX_STANDARD 11) diff --git a/recipes/libmemcached/all/test_v1_package/CMakeLists.txt b/recipes/libmemcached/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8b0d38c4a2f57..0000000000000 --- a/recipes/libmemcached/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +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/libmemcached/all/test_v1_package/conanfile.py b/recipes/libmemcached/all/test_v1_package/conanfile.py deleted file mode 100644 index 395686390e2f2..0000000000000 --- a/recipes/libmemcached/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -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/libmeshb/all/conandata.yml b/recipes/libmeshb/all/conandata.yml new file mode 100644 index 0000000000000..dd9233505c3f3 --- /dev/null +++ b/recipes/libmeshb/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "7.80": + url: "https://github.com/LoicMarechal/libMeshb/archive/refs/tags/v7.80.tar.gz" + sha256: "3026e84fa7c5c14428b1e0d1484038b0cf24921814e9cd0b6e0f13a34b0f1248" diff --git a/recipes/libmeshb/all/conanfile.py b/recipes/libmeshb/all/conanfile.py new file mode 100644 index 0000000000000..4f0284a48ab3d --- /dev/null +++ b/recipes/libmeshb/all/conanfile.py @@ -0,0 +1,81 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +import os + +required_conan_version = ">=1.53.0" + +class LibmeshbConan(ConanFile): + name = "libmeshb" + description = "A library to handle the *.meshb file format." + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/LoicMarechal/libMeshb" + topics = ("3d", "mesh", "geometry") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_gmf_asio": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_gmf_asio": False + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.with_gmf_asio + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def configure(self): + # Windows shared build doesn't seems supported because code doesn't include dllexport + # See https://www.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/ + 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): + 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["WITH_GMF_AIO"] = self.options.get_safe("with_gmf_asio", False) + tc.generate() + + def _patch_sources(self): + 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, "CMakeLists.txt"), "install (FILES LICENSE.txt copyright.txt DESTINATION share/libMeshb)", "") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "install (DIRECTORY sample_meshes DESTINATION share/libMeshb)", "") + replace_in_file(self, os.path.join(self.source_folder, "sources/CMakeLists.txt"), "install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", 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): + self.cpp_info.set_property("cmake_file_name", "libMeshb") + self.cpp_info.set_property("cmake_target_name", "libMeshb::Meshb.7") + self.cpp_info.libs = ["Meshb.7"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("rt") + self.cpp_info.system_libs.append("m") \ No newline at end of file diff --git a/recipes/libmeshb/all/test_package/CMakeLists.txt b/recipes/libmeshb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5cc1c2f79e98d --- /dev/null +++ b/recipes/libmeshb/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES C) + +find_package(libMeshb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libMeshb::Meshb.7) diff --git a/recipes/libmeshb/all/test_package/conanfile.py b/recipes/libmeshb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f5cf204295e19 --- /dev/null +++ b/recipes/libmeshb/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/libmeshb/all/test_package/test_package.c b/recipes/libmeshb/all/test_package/test_package.c new file mode 100644 index 0000000000000..ab27c830995fa --- /dev/null +++ b/recipes/libmeshb/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main() { + int ver, dim; + int64_t LibIdx = GmfOpenMesh("/dev/null", GmfRead, &ver, &dim); + return 0; +} diff --git a/recipes/libmeshb/config.yml b/recipes/libmeshb/config.yml new file mode 100644 index 0000000000000..d51cd95e8905e --- /dev/null +++ b/recipes/libmeshb/config.yml @@ -0,0 +1,3 @@ +versions: + "7.80": + folder: all diff --git a/recipes/libmetalink/all/conanfile.py b/recipes/libmetalink/all/conanfile.py index a17aa7f18af8a..57b9b280bec17 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.5.0") + self.requires("expat/[>=2.6.2 <3]") elif self.options.xml_backend == "libxml2": - self.requires("libxml2/2.11.4") + self.requires("libxml2/[>=2.12.5 <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/2.0.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/libmetalink/all/test_package/CMakeLists.txt b/recipes/libmetalink/all/test_package/CMakeLists.txt index 3327ee2e69390..ff8e1f762577b 100644 --- a/recipes/libmetalink/all/test_package/CMakeLists.txt +++ b/recipes/libmetalink/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(libmetalink REQUIRED CONFIG) diff --git a/recipes/libmetalink/all/test_v1_package/CMakeLists.txt b/recipes/libmetalink/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmetalink/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libmetalink/all/test_v1_package/conanfile.py b/recipes/libmetalink/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmetalink/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_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/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 c81f9e360d523..93b7eea08cff3 100644 --- a/recipes/libmicrohttpd/all/conanfile.py +++ b/recipes/libmicrohttpd/all/conanfile.py @@ -175,7 +175,7 @@ def package(self): fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.set_property("pkg_config_name", "libmicrohttps") + self.cpp_info.set_property("pkg_config_name", "libmicrohttpd") libname = "microhttpd" if is_msvc(self): libname = "libmicrohttpd" diff --git a/recipes/libmicrohttpd/all/test_package/CMakeLists.txt b/recipes/libmicrohttpd/all/test_package/CMakeLists.txt index 534adba0c584f..e3b8b8d09af84 100644 --- a/recipes/libmicrohttpd/all/test_package/CMakeLists.txt +++ b/recipes/libmicrohttpd/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(libmicrohttpd REQUIRED CONFIG) diff --git a/recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt b/recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmicrohttpd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libmicrohttpd/all/test_v1_package/conanfile.py b/recipes/libmicrohttpd/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmicrohttpd/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_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/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 b2f6c5dadec51..b5d13e336889b 100644 --- a/recipes/libmikmod/all/conanfile.py +++ b/recipes/libmikmod/all/conanfile.py @@ -2,9 +2,10 @@ 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, replace_in_file, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LibmikmodConan(ConanFile): @@ -87,6 +88,8 @@ def generate(self): tc.variables["ENABLE_COREAUDIO"] = self.options.get_safe("with_coreaudio", False) # Relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "3.3.12": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) diff --git a/recipes/libmikmod/all/test_package/CMakeLists.txt b/recipes/libmikmod/all/test_package/CMakeLists.txt index 9da3bc41b4793..f2f8ada38c4d4 100644 --- a/recipes/libmikmod/all/test_package/CMakeLists.txt +++ b/recipes/libmikmod/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(libmikmod REQUIRED CONFIG) diff --git a/recipes/libmikmod/all/test_v1_package/CMakeLists.txt b/recipes/libmikmod/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmikmod/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libmikmod/all/test_v1_package/conanfile.py b/recipes/libmikmod/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmikmod/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_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/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 4542e12fe1d34..aac4ca6f6b431 100644 --- a/recipes/libmnl/all/conanfile.py +++ b/recipes/libmnl/all/conanfile.py @@ -27,17 +27,19 @@ def source(self): 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: 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 validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("libmnl is only supported on Linux") + def build(self): autotools = Autotools(self) autotools.configure() diff --git a/recipes/libmnl/all/test_package/CMakeLists.txt b/recipes/libmnl/all/test_package/CMakeLists.txt index 941d5b3d99ff8..084c8588ba1f0 100644 --- a/recipes/libmnl/all/test_package/CMakeLists.txt +++ b/recipes/libmnl/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) find_package(libmnl REQUIRED) 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/all/test_package/CMakeLists.txt b/recipes/libmodbus/all/test_package/CMakeLists.txt index 589d598cde656..7ac685fbd873c 100644 --- a/recipes/libmodbus/all/test_package/CMakeLists.txt +++ b/recipes/libmodbus/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(libmodbus REQUIRED CONFIG) diff --git a/recipes/libmodbus/all/test_v1_package/CMakeLists.txt b/recipes/libmodbus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmodbus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libmodbus/all/test_v1_package/conanfile.py b/recipes/libmodbus/all/test_v1_package/conanfile.py deleted file mode 100644 index a691174f8ed16..0000000000000 --- a/recipes/libmodbus/all/test_v1_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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - 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/libmodplug/all/conanfile.py b/recipes/libmodplug/all/conanfile.py index 93a23cc96d6aa..4748e9a455203 100644 --- a/recipes/libmodplug/all/conanfile.py +++ b/recipes/libmodplug/all/conanfile.py @@ -1,10 +1,12 @@ from conan import ConanFile +from conan.errors import ConanException 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, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class LibmodplugConan(ConanFile): @@ -48,6 +50,10 @@ def generate(self): tc.preprocessor_definitions["HAVE_SINF"] = 1 # Relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.8.9.0": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") + tc.generate() def build(self): diff --git a/recipes/libmodplug/all/test_package/CMakeLists.txt b/recipes/libmodplug/all/test_package/CMakeLists.txt index 2701aecd76f11..5ccdcbc9c7f71 100644 --- a/recipes/libmodplug/all/test_package/CMakeLists.txt +++ b/recipes/libmodplug/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(libmodplug REQUIRED CONFIG) diff --git a/recipes/libmodplug/all/test_v1_package/CMakeLists.txt b/recipes/libmodplug/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmodplug/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libmodplug/all/test_v1_package/conanfile.py b/recipes/libmodplug/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmodplug/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_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/libmorton/all/test_package/CMakeLists.txt b/recipes/libmorton/all/test_package/CMakeLists.txt index 375f2c7456c98..f702a92353466 100644 --- a/recipes/libmorton/all/test_package/CMakeLists.txt +++ b/recipes/libmorton/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(libmorton REQUIRED CONFIG) diff --git a/recipes/libmorton/all/test_v1_package/CMakeLists.txt b/recipes/libmorton/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmorton/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libmorton/all/test_v1_package/conanfile.py b/recipes/libmorton/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmorton/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_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/libmount/all/conandata.yml b/recipes/libmount/all/conandata.yml index d36ca36c23c13..876a74600fc50 100644 --- a/recipes/libmount/all/conandata.yml +++ b/recipes/libmount/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.40.2": + url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/util-linux-2.40.2.tar.xz" + sha256: "d78b37a66f5922d70edf3bdfb01a6b33d34ed3c3cafd6628203b2a2b67c8e8b3" "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" @@ -11,6 +14,3 @@ sources: "2.36": url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-2.36.tar.xz" sha256: "9e4b1c67eb13b9b67feb32ae1dc0d50e08ce9e5d82e1cccd0ee771ad2fa9e0b1" - "2.33.1": - url: "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.33/util-linux-2.33.1.tar.xz" - sha256: "c14bd9f3b6e1792b90db87696e87ec643f9d63efa0a424f092a5a6b2f2dbef21" diff --git a/recipes/libmount/all/conanfile.py b/recipes/libmount/all/conanfile.py index b9ec541d71963..ea963a9965bfc 100644 --- a/recipes/libmount/all/conanfile.py +++ b/recipes/libmount/all/conanfile.py @@ -72,7 +72,11 @@ def package(self): rm(self, "*.la", os.path.join(self.package_folder, "lib")) def package_info(self): - self.cpp_info.libs = ["mount", "blkid"] - self.cpp_info.system_libs = ["rt"] - self.cpp_info.includedirs.append(os.path.join("include", "libmount")) - self.cpp_info.set_property("pkg_config_name", "mount") + self.cpp_info.components["libblkid"].libs = ["blkid"] + self.cpp_info.components["libblkid"].set_property("pkg_config_name", "blkid") + + self.cpp_info.components["libmount"].libs = ["mount"] + self.cpp_info.components["libmount"].system_libs = ["rt"] + self.cpp_info.components["libmount"].includedirs.append(os.path.join("include", "libmount")) + self.cpp_info.components["libmount"].set_property("pkg_config_name", "mount") + self.cpp_info.components["libmount"].requires = ["libblkid"] diff --git a/recipes/libmount/all/test_package/CMakeLists.txt b/recipes/libmount/all/test_package/CMakeLists.txt index 79b7610d1fb9b..4b97a71d1061a 100644 --- a/recipes/libmount/all/test_package/CMakeLists.txt +++ b/recipes/libmount/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(libmount REQUIRED CONFIG) diff --git a/recipes/libmount/all/test_v1_package/CMakeLists.txt b/recipes/libmount/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmount/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libmount/all/test_v1_package/conanfile.py b/recipes/libmount/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmount/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_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/libmount/config.yml b/recipes/libmount/config.yml index 867141253ca23..d10bf81ca7041 100644 --- a/recipes/libmount/config.yml +++ b/recipes/libmount/config.yml @@ -1,4 +1,6 @@ versions: + "2.40.2": + folder: all "2.39.2": folder: all "2.39": @@ -7,5 +9,3 @@ versions: folder: all "2.36": folder: all - "2.33.1": - folder: all diff --git a/recipes/libmp3lame/all/test_package/CMakeLists.txt b/recipes/libmp3lame/all/test_package/CMakeLists.txt index c1f711f1d8871..428c2ee522173 100644 --- a/recipes/libmp3lame/all/test_package/CMakeLists.txt +++ b/recipes/libmp3lame/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(libmp3lame REQUIRED CONFIG) diff --git a/recipes/libmp3lame/all/test_v1_package/CMakeLists.txt b/recipes/libmp3lame/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmp3lame/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libmp3lame/all/test_v1_package/conanfile.py b/recipes/libmp3lame/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmp3lame/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_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/all/conandata.yml b/recipes/libmpdclient/all/conandata.yml index 254f101651949..45f3be3daf711 100644 --- a/recipes/libmpdclient/all/conandata.yml +++ b/recipes/libmpdclient/all/conandata.yml @@ -1,4 +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 index 6a838ea6cdaa3..7df400a892ea8 100644 --- a/recipes/libmpdclient/all/conanfile.py +++ b/recipes/libmpdclient/all/conanfile.py @@ -6,6 +6,7 @@ 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" @@ -14,7 +15,7 @@ class LibmpdclientConan(ConanFile): name = "libmpdclient" description = "libmpdclient is a C library which implements the Music Player Daemon protocol." - license = "BSD-3-Clause" + 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" @@ -80,7 +81,10 @@ def build(self): meson.build() def package(self): - copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + 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")) diff --git a/recipes/libmpdclient/all/test_package/CMakeLists.txt b/recipes/libmpdclient/all/test_package/CMakeLists.txt index f00d9cb1c388c..dba4048644001 100644 --- a/recipes/libmpdclient/all/test_package/CMakeLists.txt +++ b/recipes/libmpdclient/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(libmpdclient CONFIG REQUIRED) diff --git a/recipes/libmpdclient/all/test_v1_package/CMakeLists.txt b/recipes/libmpdclient/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libmpdclient/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libmpdclient/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_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 index e36906bed874c..76913be25172d 100644 --- a/recipes/libmpdclient/config.yml +++ b/recipes/libmpdclient/config.yml @@ -1,3 +1,5 @@ versions: + "2.22": + folder: "all" "2.20": folder: "all" diff --git a/recipes/libmysqlclient/all/conanfile.py b/recipes/libmysqlclient/all/conanfile.py index 3222c3020d2f0..deb913588e58e 100644 --- a/recipes/libmysqlclient/all/conanfile.py +++ b/recipes/libmysqlclient/all/conanfile.py @@ -271,6 +271,7 @@ def package(self): 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/test_package/CMakeLists.txt b/recipes/libmysqlclient/all/test_package/CMakeLists.txt index 9151a7e370ad9..f909309c65bff 100644 --- a/recipes/libmysqlclient/all/test_package/CMakeLists.txt +++ b/recipes/libmysqlclient/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(libmysqlclient REQUIRED CONFIG) diff --git a/recipes/libnabo/all/conandata.yml b/recipes/libnabo/all/conandata.yml index 86054cc4bd55a..7eb0f0c7c45e1 100644 --- a/recipes/libnabo/all/conandata.yml +++ b/recipes/libnabo/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "1.1.0": + url: "https://github.com/ethz-asl/libnabo/archive/refs/tags/1.1.0.tar.gz" + sha256: "b69aa15cfe6baf77ae20eadd5ada9f71c725895a8983b72afb0439a1308dea5a" "1.0.7": url: "https://github.com/ethz-asl/libnabo/archive/refs/tags/1.0.7.tar.gz" sha256: "817f43ba77668a7fab2834e78f0a9ff80e294d69c9818142084a32040547d10a" patches: + "1.1.0": + - patch_file: "patches/1.1.0-0001-fix-cmake.patch" + patch_description: "use cci's eigen, disable fPIC on static build" + patch_type: "conan" "1.0.7": - patch_file: "patches/1.0.7-0001-fix-cmake.patch" patch_description: "Fix upstream CMakeLists" diff --git a/recipes/libnabo/all/conanfile.py b/recipes/libnabo/all/conanfile.py index 7ea7ce19cee21..fd6030eb858fa 100644 --- a/recipes/libnabo/all/conanfile.py +++ b/recipes/libnabo/all/conanfile.py @@ -1,6 +1,8 @@ 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.build import check_min_cppstd +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -10,9 +12,9 @@ class LibnaboConan(ConanFile): name = "libnabo" description = "A fast K Nearest Neighbor library for low-dimensional spaces" license = "BSD-3-Clause" - topics = ("nearest-neighbor", "kd-tree") - homepage = "https://github.com/ethz-asl/libnabo" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ethz-asl/libnabo" + topics = ("nearest-neighbor", "kd-tree") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -25,6 +27,11 @@ class LibnaboConan(ConanFile): "fPIC": True, "with_openmp": False, } + short_paths = True + + @property + def _min_cppstd(self): + return 11 def export_sources(self): export_conandata_patches(self) @@ -43,6 +50,10 @@ def layout(self): def requirements(self): self.requires("eigen/3.4.0", 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) @@ -51,6 +62,12 @@ def generate(self): tc.cache_variables["USE_OPEN_MP"] = self.options.with_openmp tc.cache_variables["USE_OPEN_CL"] = False tc.cache_variables["SHARED_LIBS"] = self.options.shared + if Version(self.version) >= "1.1.0": + tc.variables["LIBNABO_BUILD_DOXYGEN"] = False + tc.variables["LIBNABO_BUILD_EXAMPLES"] = False + tc.variables["LIBNABO_BUILD_TESTS"] = False + tc.variables["LIBNABO_BUILD_PYTHON"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/libnabo/all/patches/1.1.0-0001-fix-cmake.patch b/recipes/libnabo/all/patches/1.1.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..763b4f0a33bce --- /dev/null +++ b/recipes/libnabo/all/patches/1.1.0-0001-fix-cmake.patch @@ -0,0 +1,51 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7ba5fb7..36ab3a0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -91,17 +91,17 @@ endif () + include(GNUInstallDirs) + + # eigen 2 or 3 +-find_path(EIGEN_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library +- HINTS ENV EIGEN3_INC_DIR +- ENV EIGEN3_DIR +- PATHS Eigen/Core +- /usr/local/include +- /usr/include +- /opt/local/include +- PATH_SUFFIXES include eigen3 eigen2 eigen +- DOC "Directory containing the Eigen3 header files" +-) +- ++# find_path(EIGEN_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library ++# HINTS ENV EIGEN3_INC_DIR ++# ENV EIGEN3_DIR ++# PATHS Eigen/Core ++# /usr/local/include ++# /usr/include ++# /opt/local/include ++# PATH_SUFFIXES include eigen3 eigen2 eigen ++# DOC "Directory containing the Eigen3 header files" ++# ) ++find_package(Eigen3 REQUIRED CONFIG) + # optionally, opencl + # OpenCL disabled as its code is not up-to-date with API + set(USE_OPEN_CL FALSE CACHE BOOL "Set to TRUE to look for OpenCL") +@@ -146,14 +146,14 @@ if (SHARED_LIBS) + else () + add_library(${LIB_NAME} STATIC ${NABO_SRC}) + if (NOT MSVC) +- target_compile_options(${LIB_NAME} PRIVATE -fPIC) ++# target_compile_options(${LIB_NAME} PRIVATE -fPIC) + endif() + install(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib) + endif () + set_target_properties(${LIB_NAME} PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION 1) +- ++target_link_libraries(${LIB_NAME} PUBLIC Eigen3::Eigen) + target_include_directories(${LIB_NAME} PUBLIC +- ${EIGEN_INCLUDE_DIR} ++# ${EIGEN_INCLUDE_DIR} + $ + $ + ) diff --git a/recipes/libnabo/all/test_package/CMakeLists.txt b/recipes/libnabo/all/test_package/CMakeLists.txt index 6398a814018da..ed5a90c5d2040 100644 --- a/recipes/libnabo/all/test_package/CMakeLists.txt +++ b/recipes/libnabo/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(libnabo REQUIRED CONFIG) diff --git a/recipes/libnabo/all/test_v1_package/CMakeLists.txt b/recipes/libnabo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libnabo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libnabo/all/test_v1_package/conanfile.py b/recipes/libnabo/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libnabo/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_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/libnabo/config.yml b/recipes/libnabo/config.yml index 377623d3a93f7..5150f4a01606f 100644 --- a/recipes/libnabo/config.yml +++ b/recipes/libnabo/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.0": + folder: all "1.0.7": folder: all 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/all/test_package/CMakeLists.txt b/recipes/libnet/all/test_package/CMakeLists.txt index 24a3da7a29419..58a217950f481 100644 --- a/recipes/libnet/all/test_package/CMakeLists.txt +++ b/recipes/libnet/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(libnet REQUIRED CONFIG) diff --git a/recipes/libnet/all/test_v1_package/CMakeLists.txt b/recipes/libnet/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libnet/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libnet/all/test_v1_package/conanfile.py b/recipes/libnet/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libnet/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_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/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/test_v1_package/CMakeLists.txt b/recipes/libnetfilter_conntrack/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libnetfilter_conntrack/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index ebd551d13e399..0000000000000 --- a/recipes/libnetfilter_conntrack/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/libnetfilter_queue/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libnetfilter_queue/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 528904ad9f959..0000000000000 --- a/recipes/libnetfilter_queue/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/libnfnetlink/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libnfnetlink/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index c8689f282274d..0000000000000 --- a/recipes/libnfnetlink/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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 b4b4af80e776c..4c419e9bed538 100644 --- a/recipes/libnfs/all/conandata.yml +++ b/recipes/libnfs/all/conandata.yml @@ -1,17 +1,17 @@ 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" + "6.0.2": + url: "https://github.com/sahlberg/libnfs/archive/refs/tags/libnfs-6.0.2.tar.gz" + sha256: "4e5459cc3e0242447879004e9ad28286d4d27daa42cbdcde423248fad911e747" + "5.0.3": + url: "https://github.com/sahlberg/libnfs/archive/refs/tags/libnfs-5.0.3.tar.gz" + sha256: "d945cb4f4c8f82ee1f3640893a168810f794a28e1010bb007ec5add345e9df3e" 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": + "6.0.2": + - patch_file: "patches/6.0.2-0001-fix-dllname.patch" + patch_description: "Fix windows dll name" + patch_type: "backport" + patch_source: "https://github.com/sahlberg/libnfs/commit/87c2b2a3dc605d4c7da932b2f88b002df722642a" + "5.0.3": - patch_file: "patches/5.0.1-0001-remove-exports.patch" patch_description: "Fix installation" patch_type: "conan" diff --git a/recipes/libnfs/all/conanfile.py b/recipes/libnfs/all/conanfile.py index 12b83841bd97e..c69775c847b10 100644 --- a/recipes/libnfs/all/conanfile.py +++ b/recipes/libnfs/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" @@ -18,10 +19,12 @@ class LibnfsConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_multithreading": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_multithreading": False, } def export_sources(self): @@ -30,6 +33,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "6.0.2": + del self.options.with_multithreading def configure(self): if self.options.shared: @@ -40,11 +45,16 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def build_requirements(self): + if Version(self.version) >= "6.0.2": + 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["ENABLE_MULTITHREADING"] = self.options.get_safe("with_multithreading") # 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() @@ -66,6 +76,9 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "libnfs") self.cpp_info.set_property("cmake_target_name", "libnfs::libnfs") self.cpp_info.set_property("pkg_config_name", "libnfs") - self.cpp_info.libs = ["nfs"] + if Version(self.version) >= "6.0.2" and self.settings.os == "Windows": + self.cpp_info.libs = ["libnfs"] + else: + self.cpp_info.libs = ["nfs"] if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/libnfs/all/patches/6.0.2-0001-fix-dllname.patch b/recipes/libnfs/all/patches/6.0.2-0001-fix-dllname.patch new file mode 100644 index 0000000000000..2bedcedd59ba1 --- /dev/null +++ b/recipes/libnfs/all/patches/6.0.2-0001-fix-dllname.patch @@ -0,0 +1,16 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 987b735..efe20cc 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -19,8 +19,9 @@ endif() + add_library(nfs ${SOURCES}) + target_link_libraries(nfs PRIVATE ${CORE_LIBRARIES} PUBLIC ${SYSTEM_LIBRARIES}) + set_target_properties(nfs PROPERTIES +- VERSION ${PROJECT_VERSION} +- SOVERSION ${SOVERSION}) ++ OUTPUT_NAME "libnfs" # Ensures consistent output name (e.g., libnfs.dll on Windows, libnfs.so on Unix) ++ PREFIX "" # Removes the "lib" prefix on Unix-like systems to avoid "liblibnfs.so" ++) + + install(TARGETS nfs EXPORT libnfs + RUNTIME DESTINATION bin diff --git a/recipes/libnfs/all/test_package/test_package.c b/recipes/libnfs/all/test_package/test_package.c index 0a5f34fd8f626..92f30cb16894d 100644 --- a/recipes/libnfs/all/test_package/test_package.c +++ b/recipes/libnfs/all/test_package/test_package.c @@ -4,11 +4,12 @@ #include #endif +#include #include "nfsc/libnfs.h" int main() { struct nfs_context* nfs = nfs_init_context(); - + if (nfs == NULL) { return 0; } diff --git a/recipes/libnfs/all/test_v1_package/CMakeLists.txt b/recipes/libnfs/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libnfs/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libnfs/all/test_v1_package/conanfile.py b/recipes/libnfs/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libnfs/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_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/libnfs/config.yml b/recipes/libnfs/config.yml index 7e49cd33d0bdc..57ea3cf5ae8c2 100644 --- a/recipes/libnfs/config.yml +++ b/recipes/libnfs/config.yml @@ -1,5 +1,5 @@ versions: - "5.0.2": + "6.0.2": folder: "all" - "5.0.1": + "5.0.3": folder: "all" diff --git a/recipes/libnftnl/all/conandata.yml b/recipes/libnftnl/all/conandata.yml new file mode 100644 index 0000000000000..b6711e7349301 --- /dev/null +++ b/recipes/libnftnl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.8": + url: "https://www.netfilter.org/projects/libnftnl/files/libnftnl-1.2.8.tar.xz" + sha256: "37fea5d6b5c9b08de7920d298de3cdc942e7ae64b1a3e8b880b2d390ae67ad95" \ No newline at end of file diff --git a/recipes/libnftnl/all/conanfile.py b/recipes/libnftnl/all/conanfile.py new file mode 100644 index 0000000000000..6d7f864a2ec02 --- /dev/null +++ b/recipes/libnftnl/all/conanfile.py @@ -0,0 +1,61 @@ +import os + +from conan import ConanFile +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.files import copy, get, rmdir, rm +from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=2.4.0" # for attribute languages + +class LibnftnlConan(ConanFile): + name = "libnftnl" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://netfilter.org/projects/libnftnl/index.html" + description = "Library providing a low-level netlink programming interface (API) to the in-kernel nf_tables subsystem" + topics = ("netlink", "nftables") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + package_type = "library" + languages = ["C"] + implements = ["auto_shared_fpic"] + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libmnl/1.0.5") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("libnftnl is only supported on Linux/FreeBSD") + + def generate(self): + tc = AutotoolsToolchain(self) + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + 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() + + 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 = ["nftnl"] + self.cpp_info.set_property("pkg_config_name", "libnftnl") diff --git a/recipes/libnftnl/all/test_package/CMakeLists.txt b/recipes/libnftnl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6203c60cccff6 --- /dev/null +++ b/recipes/libnftnl/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +find_package(libnftnl REQUIRED) + +add_executable(example example.cpp) +target_link_libraries(example libnftnl::libnftnl) \ No newline at end of file diff --git a/recipes/libnftnl/all/test_package/conanfile.py b/recipes/libnftnl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8c0505df31a2f --- /dev/null +++ b/recipes/libnftnl/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + +class LibnftnlTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + 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], "example") + self.run(bin_path, env="conanrun") \ No newline at end of file diff --git a/recipes/libnftnl/all/test_package/example.cpp b/recipes/libnftnl/all/test_package/example.cpp new file mode 100644 index 0000000000000..491b57bd4574c --- /dev/null +++ b/recipes/libnftnl/all/test_package/example.cpp @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() { + struct nftnl_table *nt = nftnl_table_alloc(); + nftnl_table_free(nt); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/recipes/libnftnl/config.yml b/recipes/libnftnl/config.yml new file mode 100644 index 0000000000000..62c6a9cb14471 --- /dev/null +++ b/recipes/libnftnl/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.8": + folder: all \ No newline at end of file diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index a883c4b7d535a..c95a58d3fe33d 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.61.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.61.0/nghttp2-1.61.0.tar.bz2" + sha256: "4e8cf7ec32d4c5a430966242d72035d255cd9470a8766d61eed7a0190dd544fd" + "1.60.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.60.0.tar.gz" + sha256: "3cc9403c64e0a133868f62132ff0884cd5dc567eee5bd7b2d03ac81293695d6b" + "1.59.0": + url: "https://github.com/nghttp2/nghttp2/archive/v1.59.0.tar.gz" + sha256: "0dd5c980f1262ff5f03676fd99f46f250b66c842f7d864fa1ca9f8453e5f8868" "1.58.0": url: "https://github.com/nghttp2/nghttp2/archive/v1.58.0.tar.gz" sha256: "7da19947b33a07ddcf97b9791331bfee8a8545e6b394275a9971f43cae9d636b" diff --git a/recipes/libnghttp2/all/conanfile.py b/recipes/libnghttp2/all/conanfile.py index ac841e13b7b86..8fa456dd4d783 100644 --- a/recipes/libnghttp2/all/conanfile.py +++ b/recipes/libnghttp2/all/conanfile.py @@ -60,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.20.1") + self.requires("c-ares/1.25.0") self.requires("libev/4.33") self.requires("libevent/2.1.12") - self.requires("libxml2/2.11.5") + self.requires("libxml2/2.12.4") 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.83.0") + self.requires("boost/1.84.0") def validate(self): if self.options.get_safe("with_asio") and is_msvc(self): @@ -83,8 +83,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["ENABLE_SHARED_LIB"] = self.options.shared - tc.variables["ENABLE_STATIC_LIB"] = not self.options.shared + if Version(self.version) < "1.60.0": + tc.variables["ENABLE_SHARED_LIB"] = self.options.shared + tc.variables["ENABLE_STATIC_LIB"] = not self.options.shared + else: + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared tc.variables["ENABLE_HPACK_TOOLS"] = self.options.with_hpack tc.variables["ENABLE_APP"] = self.options.with_app tc.variables["ENABLE_EXAMPLES"] = False @@ -96,6 +99,9 @@ def generate(self): tc.variables["WITH_JEMALLOC"] = self.options.get_safe("with_jemalloc", False) if Version(self.version) < "1.52.0": tc.variables["ENABLE_ASIO_LIB"] = self.options.with_asio + # To avoid overwriting dll import lib by static lib + if Version(self.version) >= "1.60.0" and self.options.shared: + tc.variables["STATIC_LIB_SUFFIX"] = "-static" if is_apple_os(self): # workaround for: install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False @@ -107,7 +113,7 @@ def generate(self): tc.generate() def _patch_sources(self): - if not self.options.shared: + if not self.options.shared and Version(self.version) < "1.60.0": # 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"), "target_include_directories(nghttp2_static INTERFACE\n" @@ -135,6 +141,8 @@ def _patch_sources(self): "\n" " target_link_libraries(nghttp2_asio\n" f" {target_libnghttp2}\n") + 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, "CMakeLists.txt"), "add_subdirectory(tests)", "") def build(self): self._patch_sources() @@ -148,6 +156,7 @@ def package(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")) def package_info(self): self.cpp_info.components["nghttp2"].set_property("pkg_config_name", "libnghttp2") diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index 9868faae8fd3c..99922e9441daf 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,4 +1,10 @@ versions: + "1.61.0": + folder: all + "1.60.0": + folder: all + "1.59.0": + folder: all "1.58.0": folder: all "1.57.0": diff --git a/recipes/libnice/all/test_package/CMakeLists.txt b/recipes/libnice/all/test_package/CMakeLists.txt index d61c442b074a4..7e40cf075814a 100644 --- a/recipes/libnice/all/test_package/CMakeLists.txt +++ b/recipes/libnice/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(example LANGUAGES C) find_package(libnice REQUIRED CONFIG) diff --git a/recipes/libnice/all/test_v1_package/CMakeLists.txt b/recipes/libnice/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libnice/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libnice/all/test_v1_package/conanfile.py b/recipes/libnice/all/test_v1_package/conanfile.py deleted file mode 100644 index ecf464197e0a5..0000000000000 --- a/recipes/libnice/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -class LibniceTestConan(ConanFile): - settings = "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/libnl/all/conandata.yml b/recipes/libnl/all/conandata.yml index c4437c5cec3bc..9db76cae21f37 100644 --- a/recipes/libnl/all/conandata.yml +++ b/recipes/libnl/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/libnl/all/conanfile.py b/recipes/libnl/all/conanfile.py index a355e8b21201e..a6e8ec2b93bbb 100644 --- a/recipes/libnl/all/conanfile.py +++ b/recipes/libnl/all/conanfile.py @@ -3,6 +3,8 @@ from conan.tools.layout import basic_layout from conan.tools.gnu import AutotoolsToolchain, Autotools from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -15,6 +17,7 @@ class LibNlConan(ConanFile): homepage = "https://github.com/thom311/libnl" topics = ("netlink") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "fPIC": [True, False], "shared": [True, False], @@ -45,6 +48,8 @@ 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.generate() @@ -66,14 +71,30 @@ def package_info(self): self.cpp_info.components["nl"].libs = ["nl-3"] self.cpp_info.components["nl"].includedirs = [os.path.join('include', 'libnl3')] self.cpp_info.components["nl"].system_libs = ["pthread", "m"] + self.cpp_info.components["nl"].set_property("pkg_config_name", "libnl-3.0") + self.cpp_info.components["nl-route"].libs = ["nl-route-3"] self.cpp_info.components["nl-route"].requires = ["nl"] + self.cpp_info.components["nl-route"].set_property("pkg_config_name", "libnl-route-3.0") + self.cpp_info.components["nl-genl"].libs = ["nl-genl-3"] self.cpp_info.components["nl-genl"].requires = ["nl"] + self.cpp_info.components["nl-genl"].set_property("pkg_config_name", "libnl-genl-3.0") + self.cpp_info.components["nl-nf"].libs = ["nl-nf-3"] self.cpp_info.components["nl-nf"].requires = ["nl-route"] + self.cpp_info.components["nl-nf"].set_property("pkg_config_name", "libnl-nf-3.0") + 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-cli"].set_property("pkg_config_name", "libnl-cli-3.0") + self.cpp_info.components["nl-idiag"].libs = ["nl-idiag-3"] self.cpp_info.components["nl-idiag"].requires = ["nl"] + self.cpp_info.components["nl-idiag"].set_property("pkg_config_name", "libnl-idiag-3.0") + + if Version(self.version) >= "3.3.0": + self.cpp_info.components["nl-xfrm"].libs = ["nl-xfrm-3"] + self.cpp_info.components["nl-xfrm"].requires = ["nl"] + self.cpp_info.components["nl-xfrm"].set_property("pkg_config_name", "libnl-xfrm-3.0") diff --git a/recipes/libnl/all/test_package/CMakeLists.txt b/recipes/libnl/all/test_package/CMakeLists.txt index c5d1b19c7a8f9..f6ba7c21f8d96 100644 --- a/recipes/libnl/all/test_package/CMakeLists.txt +++ b/recipes/libnl/all/test_package/CMakeLists.txt @@ -1,7 +1,18 @@ cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) +include(FindPkgConfig) + find_package(libnl REQUIRED CONFIG) +find_package(PkgConfig REQUIRED) +pkg_check_modules(libnl-3.0 REQUIRED IMPORTED_TARGET libnl-3.0) +pkg_check_modules(libnl-route-3.0 REQUIRED IMPORTED_TARGET libnl-route-3.0) +pkg_check_modules(libnl-genl-3.0 REQUIRED IMPORTED_TARGET libnl-genl-3.0) +pkg_check_modules(libnl-nf-3.0 REQUIRED IMPORTED_TARGET libnl-nf-3.0) +pkg_check_modules(libnl-cli-3.0 REQUIRED IMPORTED_TARGET libnl-cli-3.0) +pkg_check_modules(libnl-idiag-3.0 REQUIRED IMPORTED_TARGET libnl-idiag-3.0) +pkg_check_modules(libnl-xfrm-3.0 QUIET IMPORTED_TARGET libnl-xfrm-3.0) + 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) +target_link_libraries(${PROJECT_NAME} PRIVATE libnl::nl libnl::nl-route libnl::nl-genl libnl::nl-nf libnl::nl-cli libnl::nl-idiag $<$:libnl::nl-xfrm>) diff --git a/recipes/libnl/all/test_package/conanfile.py b/recipes/libnl/all/test_package/conanfile.py index 9b544e8a245c0..813661a00f9e6 100644 --- a/recipes/libnl/all/test_package/conanfile.py +++ b/recipes/libnl/all/test_package/conanfile.py @@ -6,7 +6,7 @@ class NetlinkTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv", "PkgConfigDeps", "VirtualBuildEnv" test_type = "explicit" def layout(self): @@ -15,6 +15,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.2 <3]") + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libnl/config.yml b/recipes/libnl/config.yml index 20abb72c5e1b9..4e17fb9e83226 100644 --- a/recipes/libnl/config.yml +++ b/recipes/libnl/config.yml @@ -1,4 +1,6 @@ versions: + 3.9.0: + folder: all 3.8.0: folder: all 3.7.0: diff --git a/recipes/libnoise/all/CMakeLists.txt b/recipes/libnoise/all/CMakeLists.txt index 5f314cdfee089..db179d85ef837 100644 --- a/recipes/libnoise/all/CMakeLists.txt +++ b/recipes/libnoise/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(noise LANGUAGES CXX) set(NOISE_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/noise/src) diff --git a/recipes/libnoise/all/test_package/CMakeLists.txt b/recipes/libnoise/all/test_package/CMakeLists.txt index e018594465e5d..856fce7c71935 100644 --- a/recipes/libnoise/all/test_package/CMakeLists.txt +++ b/recipes/libnoise/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(libnoise REQUIRED CONFIG) diff --git a/recipes/libnoise/all/test_v1_package/CMakeLists.txt b/recipes/libnoise/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libnoise/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libnoise/all/test_v1_package/conanfile.py b/recipes/libnoise/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libnoise/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_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/libnop/all/test_package/CMakeLists.txt b/recipes/libnop/all/test_package/CMakeLists.txt index eb1e148dab4cf..9f142d973e6d0 100644 --- a/recipes/libnop/all/test_package/CMakeLists.txt +++ b/recipes/libnop/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(libnop REQUIRED CONFIG) diff --git a/recipes/libnop/all/test_v1_package/CMakeLists.txt b/recipes/libnop/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libnop/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libnop/all/test_v1_package/conanfile.py b/recipes/libnop/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libnop/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_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/libnova/all/test_package/CMakeLists.txt b/recipes/libnova/all/test_package/CMakeLists.txt index fea9b303f2a63..c1dd8333732fc 100644 --- a/recipes/libnova/all/test_package/CMakeLists.txt +++ b/recipes/libnova/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(libnova REQUIRED CONFIG) diff --git a/recipes/libnova/all/test_v1_package/CMakeLists.txt b/recipes/libnova/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libnova/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libnova/all/test_v1_package/conanfile.py b/recipes/libnova/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libnova/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_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/libnuma/all/conandata.yml b/recipes/libnuma/all/conandata.yml index 0c573279e69f1..a2f4fdcdf22c7 100644 --- a/recipes/libnuma/all/conandata.yml +++ b/recipes/libnuma/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.0.19": + url: "https://github.com/numactl/numactl/releases/download/v2.0.19/numactl-2.0.19.tar.gz" + sha256: "f2672a0381cb59196e9c246bf8bcc43d5568bc457700a697f1a1df762b9af884" + "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/all/test_package/CMakeLists.txt b/recipes/libnuma/all/test_package/CMakeLists.txt index 4a335520f487b..b1330e7e1ac74 100644 --- a/recipes/libnuma/all/test_package/CMakeLists.txt +++ b/recipes/libnuma/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(libnuma REQUIRED CONFIG) diff --git a/recipes/libnuma/all/test_v1_package/CMakeLists.txt b/recipes/libnuma/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libnuma/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libnuma/all/test_v1_package/conanfile.py b/recipes/libnuma/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libnuma/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_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/libnuma/config.yml b/recipes/libnuma/config.yml index 819ebd6fb8395..96481d820a1e4 100644 --- a/recipes/libnuma/config.yml +++ b/recipes/libnuma/config.yml @@ -1,3 +1,7 @@ versions: + "2.0.19": + folder: all + "2.0.16": + folder: all "2.0.14": folder: all diff --git a/recipes/liboping/all/test_v1_package/CMakeLists.txt b/recipes/liboping/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/liboping/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index b7bbf79eba926..0000000000000 --- a/recipes/liboping/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", "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 776adccb0ef4d..4017142288301 100644 --- a/recipes/libpcap/all/conandata.yml +++ b/recipes/libpcap/all/conandata.yml @@ -1,13 +1,10 @@ sources: + "1.10.5": + url: "https://www.tcpdump.org/release/libpcap-1.10.5.tar.xz" + sha256: "84fa89ac6d303028c1c5b754abff77224f45eca0a94eb1a34ff0aa9ceece3925" "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" - "1.10.0": - url: "https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.10.0.tar.gz" - sha256: "7d8c18f740c0b630f55699ea22191ffbbba483f48ea60506848f9241d3973763" - "1.9.1": - url: "https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.9.1.tar.gz" - sha256: "8ac670de8dd6eff39441580c67f0520f326773422bbf89fdffcd269bd0cfddde" diff --git a/recipes/libpcap/all/conanfile.py b/recipes/libpcap/all/conanfile.py index f8f592dda7427..2aedd44a317e8 100644 --- a/recipes/libpcap/all/conanfile.py +++ b/recipes/libpcap/all/conanfile.py @@ -1,11 +1,10 @@ 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.apple import fix_apple_shared_install_name from conan.tools.build import cross_building from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import chdir, copy, get, rm, rmdir -from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version @@ -28,28 +27,29 @@ class LibPcapConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "enable_dbus": [True, False], + "enable_libnl": [True, False], "enable_libusb": [True, False], + "enable_rdma": [True, False], + "with_snf": [True, False], } default_options = { "shared": False, "fPIC": True, + "enable_dbus": False, + "enable_libnl": False, "enable_libusb": False, + "enable_rdma": False, + "with_snf": False, } - # TODO: Add dbus-glib when available - # TODO: Add libnl-genl when available - # TODO: Add libbluetooth when available - # TODO: Add libibverbs when available - - @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 if self.settings.os != "Linux": del self.options.enable_libusb + del self.options.enable_libnl + del self.options.enable_rdma def configure(self): if self.options.shared: @@ -66,19 +66,17 @@ def layout(self): def requirements(self): if self.options.get_safe("enable_libusb"): self.requires("libusb/1.0.26") - - def validate(self): - if Version(self.version) < "1.10.0" and self.settings.os == "Macos" and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on OSX.") - if hasattr(self, "settings_build") and cross_building(self) and \ - self.options.shared and is_apple_os(self): - raise ConanInvalidConfiguration("cross-build of libpcap shared is broken on Apple") - if Version(self.version) < "1.10.1" and self.settings.os == "Windows" and not self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} can not be built static on Windows") + if self.options.get_safe("enable_libnl"): + self.requires("libnl/3.8.0") + if self.options.get_safe("enable_rdma"): + self.requires("rdma-core/52.0") + if self.options.get_safe("enable_dbus"): + self.requires("dbus/1.15.8") + # TODO: Add libbluetooth when available def build_requirements(self): - if self._settings_build.os == "Windows": - self.tool_requires("winflexbison/2.5.24") + 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") @@ -99,6 +97,11 @@ def generate(self): # Don't force -static-libgcc for MinGW, because conan users expect # to inject this compilation flag themselves tc.variables["USE_STATIC_RT"] = False + tc.cache_variables["DISABLE_DPDK"] = True + + if Version(self.version) >= "1.10.5": + self.output.warning("PCAP on Windows is currently built with package capture capabilities - only support is for reading/writing capture files") + tc.cache_variables["PCAP_TYPE"] = "null" tc.generate() else: if not cross_building(self): @@ -107,22 +110,26 @@ def generate(self): tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" tc.configure_args.extend([ - f"--enable-usb={yes_no(self.options.get_safe('enable_libusb'))}", - "--disable-universal", - "--without-libnl", + "--disable-universal", # don't build universal binaries on macOS + "--enable-usb" if self.options.get_safe("enable_libusb") else "--disable-usb", + "--enable-dbus" if self.options.get_safe("enable_dbus") else "--disable-dbus", + "--enable-rdma" if self.options.get_safe("enable_rdma") else "--disable-rdma", + "--with-libnl" if self.options.get_safe("enable_libnl") else "--without-libnl", "--disable-bluetooth", - "--disable-packet-ring", - "--disable-dbus", - "--disable-rdma", + f"--with-snf={yes_no(self.options.get_safe('with_snf'))}", ]) + tc.configure_args.append("--disable-packet-ring") + tc.configure_args.append("--without-dpdk") if cross_building(self): - target_os = "linux" if self.settings.os == "Linux" else "null" + target_os = "linux" if self.settings.os in ["Linux", "Android"] else "null" tc.configure_args.append(f"--with-pcap={target_os}") elif "arm" in self.settings.arch and self.settings.os == "Linux": tc.configure_args.append("--host=arm-linux") tc.generate() AutotoolsDeps(self).generate() + deps = PkgConfigDeps(self) + deps.generate() def build(self): if self.settings.os == "Windows": @@ -171,3 +178,13 @@ def package_info(self): self.cpp_info.libs = [f"pcap{suffix}"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] + if self.options.get_safe("enable_libusb"): + self.cpp_info.requires.append("libusb::libusb") + if self.options.get_safe("enable_libnl"): + self.cpp_info.requires.append("libnl::nl-genl") + if self.options.get_safe("enable_rdma"): + self.cpp_info.requires.append("rdma-core::libibverbs") + if self.options.get_safe("enable_dbus"): + self.cpp_info.requires.append("dbus::dbus") + if self.options.get_safe("with_snf"): + self.cpp_info.system_libs.append("snf") diff --git a/recipes/libpcap/all/test_package/CMakeLists.txt b/recipes/libpcap/all/test_package/CMakeLists.txt index 647522630d58c..afc7523bc7b90 100644 --- a/recipes/libpcap/all/test_package/CMakeLists.txt +++ b/recipes/libpcap/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(libpcap REQUIRED CONFIG) diff --git a/recipes/libpcap/all/test_package/test_package.c b/recipes/libpcap/all/test_package/test_package.c index 38d5fcdbefaab..1e43e5dda47cb 100644 --- a/recipes/libpcap/all/test_package/test_package.c +++ b/recipes/libpcap/all/test_package/test_package.c @@ -4,22 +4,7 @@ int main(void) { - char errbuf[PCAP_ERRBUF_SIZE] = {0}; - bpf_u_int32 netp = 0; - bpf_u_int32 maskp = 0; - const char* dev = NULL; - - // device lookup - dev = pcap_lookupdev(errbuf); - if (dev != NULL) { - if (pcap_lookupnet(dev, &netp, &maskp, errbuf) == -1) { - fprintf(stderr, "Couldn't get netmask for device %s: %s\n", dev, errbuf); - } else { - fprintf(stdout, "Lookup success on device %s\n", dev); - } - } else { - fprintf(stderr, "Couldn't lookup devices: %s\n", errbuf); - } + printf("libpcap version: %s\n", pcap_lib_version()); return EXIT_SUCCESS; } diff --git a/recipes/libpcap/all/test_v1_package/CMakeLists.txt b/recipes/libpcap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libpcap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libpcap/all/test_v1_package/conanfile.py b/recipes/libpcap/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libpcap/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_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/config.yml b/recipes/libpcap/config.yml index 704c5ae57304e..4c6f2a93550ca 100644 --- a/recipes/libpcap/config.yml +++ b/recipes/libpcap/config.yml @@ -1,9 +1,7 @@ versions: + "1.10.5": + folder: all "1.10.4": folder: all "1.10.1": - folder: all - "1.10.0": - folder: all - "1.9.1": - folder: all + folder: all \ No newline at end of file diff --git a/recipes/libpciaccess/all/test_package/CMakeLists.txt b/recipes/libpciaccess/all/test_package/CMakeLists.txt index e6f3ddc50ab4d..7de3bb2043ba5 100644 --- a/recipes/libpciaccess/all/test_package/CMakeLists.txt +++ b/recipes/libpciaccess/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(libpciaccess REQUIRED CONFIG) diff --git a/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt b/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libpciaccess/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libpciaccess/all/test_v1_package/conanfile.py b/recipes/libpciaccess/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libpciaccess/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_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/libpfm4/all/test_package/CMakeLists.txt b/recipes/libpfm4/all/test_package/CMakeLists.txt index c93d1fbd7ce51..fdadb35720842 100644 --- a/recipes/libpfm4/all/test_package/CMakeLists.txt +++ b/recipes/libpfm4/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(libpfm4 REQUIRED CONFIG) diff --git a/recipes/libpfm4/all/test_v1_package/CMakeLists.txt b/recipes/libpfm4/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 92ff6b140a2cc..0000000000000 --- a/recipes/libpfm4/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libpfm4 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE libpfm4::libpfm4) diff --git a/recipes/libpfm4/all/test_v1_package/conanfile.py b/recipes/libpfm4/all/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/libpfm4/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/libphonenumber/all/conandata.yml b/recipes/libphonenumber/all/conandata.yml new file mode 100644 index 0000000000000..11c4aae27deb2 --- /dev/null +++ b/recipes/libphonenumber/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "8.13.42": + url: "https://github.com/google/libphonenumber/archive/refs/tags/v8.13.42.tar.gz" + sha256: "7fac3a3c5f37607108ea2ca4c334000a6c29fe1cd6b30db31505cba73ab96c7d" diff --git a/recipes/libphonenumber/all/conanfile.py b/recipes/libphonenumber/all/conanfile.py new file mode 100644 index 0000000000000..9a88f82447a58 --- /dev/null +++ b/recipes/libphonenumber/all/conanfile.py @@ -0,0 +1,184 @@ +import os + +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, valid_min_cppstd, can_run +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm, rmdir, replace_in_file +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version + +required_conan_version = ">=1.56.0 <2 || >=2.0.6" + + +class LibphonenumberConan(ConanFile): + name = "libphonenumber" + description = "Google's common C++ library for parsing, formatting, and validating international phone numbers" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/libphonenumber" + topics = ("phone-numbers", "phone") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_geocoder": [True, False], + "use_alternate_formats": [True, False], + "use_boost": [True, False], + "use_icu_regexp": [True, False], + "use_lite_metadata": [True, False], + "use_posix_thread": [True, False], + "use_std_mutex": [True, False], + #re2 is not an option, because using it crashes + } + default_options = { + "shared": False, + "fPIC": True, + "build_geocoder": True, + "use_alternate_formats": True, + "use_boost": False, + "use_icu_regexp": True, + "use_lite_metadata": False, + "use_posix_thread": False, + "use_std_mutex": True, + } + options_description = { + "build_geocoder": "Build the offline phone number geocoder", + "use_alternate_formats": "Use alternate formats for the phone number matcher.", + "use_icu_regexp": "Use ICU regexp engine", + "use_lite_metadata": "Generates smaller metadata that doesn't include example numbers", + "use_posix_thread": "Use Posix thread for multi-threading", + "use_std_mutex": "use C++ 2011 std::mutex for multi-threading", + } + + @property + def _min_cppstd(self): + return 11 if Version(self.dependencies["abseil"].ref.version) < "20230125.0" else 14 + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # TODO: could use pthread4w + del self.options.use_posix_thread + if not can_run(self): + # otherwise fails when trying to build and run generate_geocoding_data + del self.options.build_geocoder + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/google/libphonenumber/blob/v8.13.35/cpp/src/phonenumbers/phonenumberutil.h#L33-L34 + self.requires("abseil/20240116.2", transitive_headers=True) + self.requires("protobuf/5.27.0", transitive_headers=True, transitive_libs=True) + if self.options.use_boost: + # https://github.com/google/libphonenumber/blob/v8.13.35/cpp/src/phonenumbers/base/synchronization/lock_boost.h + self.requires("boost/1.85.0", transitive_headers=True, transitive_libs=True) + if self.options.use_icu_regexp or self.options.get_safe("build_geocoder"): + # https://github.com/google/libphonenumber/blob/v8.13.35/cpp/src/phonenumbers/geocoding/phonenumber_offline_geocoder.h#L23 + self.requires("icu/75.1", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.name} not supported in Windows yet, contributions welcome\n" + "https://github.com/google/libphonenumber/blob/master/FAQ.md#what-about-windows") + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + if not self.options.use_std_mutex and not self.options.use_boost and not self.options.get_safe("use_posix_thread"): + raise ConanInvalidConfiguration("At least one of use_std_mutex, use_boost or use_posix_thread must be enabled") + + if not self.options.use_icu_regexp: + # Fails with 'undefined reference to `vtable for i18n::phonenumbers::ICURegExpFactory'' + raise ConanInvalidConfiguration("use_icu_regexp=False is not supported") + + if conan_version.major == 1: + raise ConanInvalidConfiguration("Conan 1.x is not supported. Contributions are welcome!") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.2.0") + self.tool_requires("protobuf/") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_STATIC_LIB"] = not self.options.shared + tc.variables["BUILD_GEOCODER"] = self.options.get_safe("build_geocoder", False) + tc.variables["USE_ALTERNATE_FORMATS"] = self.options.use_alternate_formats + tc.variables["USE_BOOST"] = self.options.use_boost + tc.variables["USE_ICU_REGEXP"] = self.options.use_icu_regexp + tc.variables["USE_LITE_METADATA"] = self.options.use_lite_metadata + tc.variables["USE_POSIX_THREAD"] = self.options.get_safe("use_posix_thread", False) + tc.variables["USE_PROTOBUF_LITE"] = self.dependencies["protobuf"].options.lite + tc.variables["USE_RE2"] = False # Hardcoded, attempt to use it crashed + tc.variables["USE_STDMUTEX"] = self.options.use_std_mutex + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_TOOLS_ONLY"] = False + tc.variables["REGENERATE_METADATA"] = False # Requires a Java runtime + # Otherwise tries to use , and requires the recipe to export a define accordingly. + # The define can be set based only on a compilation test. + tc.variables["USE_STD_MAP"] = True + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + # (failed) attempt to make it work in windows/msvc, patching some build scripts + # https://github.com/conan-io/conan-center-index/pull/23689/commits/c5e7091d134174fb590218ed066c074f45274a93 + replace_in_file(self, os.path.join(self.source_folder, "cpp", "CMakeLists.txt"), " -Werror", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "cpp")) + 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")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + if self.options.shared: + self.cpp_info.components["phonenumber"].set_property("cmake_target_aliases", ["libphonenumber::phonenumber-shared"]) + self.cpp_info.components["phonenumber"].libs = ["phonenumber"] + if self.settings.os in ["Linux", "FreeBSD"] and self.options.use_posix_thread: + self.cpp_info.components["phonenumber"].system_libs.append("pthread") + elif is_apple_os(self): + self.cpp_info.components["phonenumber"].frameworks.extend(["CoreFoundation", "Foundation"]) + + requires = ["abseil::absl_node_hash_set", "abseil::absl_strings", "abseil::absl_synchronization"] + if self.dependencies["protobuf"].options.lite: + requires.append("protobuf::libprotobuf-lite") + else: + requires.append("protobuf::libprotobuf") + if self.options.use_boost: + requires.extend(["boost::headers", "boost::thread"]) + if self.options.use_icu_regexp: + requires.extend(["icu::icu-uc", "icu::icu-i18n"]) + self.cpp_info.components["phonenumber"].requires = requires + + if self.options.get_safe("build_geocoder"): + if self.options.shared: + self.cpp_info.components["geocoding"].set_property("cmake_target_aliases", ["libphonenumber::geocoding-shared"]) + self.cpp_info.components["geocoding"].libs.append("geocoding") + self.cpp_info.components["geocoding"].requires = ["abseil::absl_synchronization", "icu::icu-uc"] diff --git a/recipes/libphonenumber/all/test_package/CMakeLists.txt b/recipes/libphonenumber/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f3619ef8d61cf --- /dev/null +++ b/recipes/libphonenumber/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(libphonenumber REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libphonenumber::libphonenumber) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libphonenumber/all/test_package/conanfile.py b/recipes/libphonenumber/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/libphonenumber/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/libphonenumber/all/test_package/test_package.cpp b/recipes/libphonenumber/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7bcbdb54c0b0f --- /dev/null +++ b/recipes/libphonenumber/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main() { + using namespace i18n::phonenumbers; + PhoneNumber number; + number.set_country_code(1); + number.set_national_number(uint64{650}); + auto util = PhoneNumberUtil::GetInstance(); + util->GetLengthOfGeographicalAreaCode(number); +} diff --git a/recipes/libphonenumber/config.yml b/recipes/libphonenumber/config.yml new file mode 100644 index 0000000000000..2d7b667f12200 --- /dev/null +++ b/recipes/libphonenumber/config.yml @@ -0,0 +1,3 @@ +versions: + "8.13.42": + folder: all diff --git a/recipes/libplist/all/conandata.yml b/recipes/libplist/all/conandata.yml new file mode 100644 index 0000000000000..848c190b77593 --- /dev/null +++ b/recipes/libplist/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.6.0": + url: "https://github.com/libimobiledevice/libplist/releases/download/2.6.0/libplist-2.6.0.tar.bz2" + sha256: "67be9ee3169366589c92dc7c22809b90f51911dd9de22520c39c9a64fb047c9c" diff --git a/recipes/libplist/all/conanfile.py b/recipes/libplist/all/conanfile.py new file mode 100644 index 0000000000000..2b02e49b20629 --- /dev/null +++ b/recipes/libplist/all/conanfile.py @@ -0,0 +1,95 @@ +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 VirtualRunEnv +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 = ">=2.1" + +class PackageConan(ConanFile): + name = "libplist" + description = "A small portable C library to handle Apple Property List files in binary, XML, JSON, or OpenStep format." + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libimobiledevice/libplist" + topics = ("plist", "apple", "property list", "binary", "xml", "json", "openstep") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + implements = ["auto_shared_fpic"] + languages = ["C", "C++"] + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler == "msvc": + raise ConanInvalidConfiguration("libplist does not support MSVC - use MinGW instead") + + 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], strip_root=True) + + def generate(self): + if not cross_building(self): + VirtualRunEnv(self).generate(scope="build") + tc = AutotoolsToolchain(self) + + tc.configure_args.extend([ + # No need for python bindings + "--without-cython", + ]) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING.LESSER", 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")) + rmdir(self, os.path.join(self.package_folder, "share")) + + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.components["plist"].libs = ["plist-2.0"] + self.cpp_info.components["plist"].set_property("pkg_config_name", "plist-2.0") + self.cpp_info.components["plist"].set_property("cmake_target_name", "libplist::libplist") + + self.cpp_info.components["plist++"].libs = ["plist++-2.0"] + self.cpp_info.components["plist++"].requires = ["plist"] + self.cpp_info.components["plist++"].set_property("pkg_config_name", "plist++-2.0") + self.cpp_info.components["plist++"].set_property("cmake_target_name", "libplist::libplist++") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["plist"].system_libs.extend(["m", "pthread"]) + self.cpp_info.components["plist++"].system_libs.extend(["m", "pthread"]) + + if not self.options.shared: + self.cpp_info.components["plist"].defines.append("LIBPLIST_STATIC") + self.cpp_info.components["plist++"].defines.append("LIBPLIST_STATIC") diff --git a/recipes/libplist/all/test_package/CMakeLists.txt b/recipes/libplist/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3f75fcc0f5158 --- /dev/null +++ b/recipes/libplist/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C CXX) + +find_package(libplist REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libplist::libplist) + +add_executable(${PROJECT_NAME}++ test_package.cpp) +target_link_libraries(${PROJECT_NAME}++ PRIVATE libplist::libplist++) diff --git a/recipes/libplist/all/test_package/conanfile.py b/recipes/libplist/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d36f1e75d8481 --- /dev/null +++ b/recipes/libplist/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 + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + + 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") + + bin_path_cxx = os.path.join(self.cpp.build.bindir, "test_package++") + self.run(bin_path_cxx, env="conanrun") diff --git a/recipes/libplist/all/test_package/test_package.c b/recipes/libplist/all/test_package/test_package.c new file mode 100644 index 0000000000000..0779b29e8d1c4 --- /dev/null +++ b/recipes/libplist/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include +#include + + +int main(void) { + printf("plist version: %s\n", libplist_version()); + + return EXIT_SUCCESS; +} diff --git a/recipes/libplist/all/test_package/test_package.cpp b/recipes/libplist/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..234f532803d69 --- /dev/null +++ b/recipes/libplist/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include +#include + + +int main(void) { + auto node = new PList::Boolean(true); + printf("node value: %d\n", node->GetValue()); + + return EXIT_SUCCESS; +} diff --git a/recipes/libplist/config.yml b/recipes/libplist/config.yml new file mode 100644 index 0000000000000..fd1c6521f3d05 --- /dev/null +++ b/recipes/libplist/config.yml @@ -0,0 +1,3 @@ +versions: + "2.6.0": + folder: all diff --git a/recipes/libpng/all/conandata.yml b/recipes/libpng/all/conandata.yml index bb5cbe33cccce..c0ee6db5809b8 100644 --- a/recipes/libpng/all/conandata.yml +++ b/recipes/libpng/all/conandata.yml @@ -1,4 +1,28 @@ sources: + "1.6.48": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.48/libpng-1.6.48.tar.xz" + sha256: "46fd06ff37db1db64c0dc288d78a3f5efd23ad9ac41561193f983e20937ece03" + "1.6.47": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.47/libpng-1.6.47.tar.xz" + sha256: "b213cb381fbb1175327bd708a77aab708a05adde7b471bc267bd15ac99893631" + "1.6.46": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.46/libpng-1.6.46.tar.xz" + sha256: "f3aa8b7003998ab92a4e9906c18d19853e999f9d3bca9bd1668f54fa81707cb1" + "1.6.45": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.45/libpng-1.6.45.tar.xz" + sha256: "926485350139ffb51ef69760db35f78846c805fef3d59bfdcb2fba704663f370" + "1.6.44": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.44/libpng-1.6.44.tar.xz" + sha256: "60c4da1d5b7f0aa8d158da48e8f8afa9773c1c8baa5d21974df61f1886b8ce8e" + "1.6.43": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.43/libpng-1.6.43.tar.xz" + sha256: "6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c" + "1.6.42": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.42/libpng-1.6.42.tar.xz" + sha256: "c919dbc11f4c03b05aba3f8884d8eb7adfe3572ad228af972bb60057bdb48450" + "1.6.41": + url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.41/libpng-1.6.41.tar.xz" + sha256: "d6a49a7a4abca7e44f72542030e53319c081fea508daccf4ecc7c6d9958d190f" "1.6.40": url: "https://sourceforge.net/projects/libpng/files/libpng16/1.6.40/libpng-1.6.40.tar.xz" sha256: "535b479b2467ff231a3ec6d92a525906fb8ef27978be4f66dbe05d3f3a01b3a1" diff --git a/recipes/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py index f5410a3afa2d7..d41cc8f49d2bb 100644 --- a/recipes/libpng/all/conanfile.py +++ b/recipes/libpng/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 apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +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 @@ -118,7 +118,10 @@ def generate(self): tc.variables["PNG_INTEL_SSE"] = self._neon_msa_sse_vsx_mapping[str(self.options.sse)] if self._has_vsx_support: tc.variables["PNG_POWERPC_VSX"] = self._neon_msa_sse_vsx_mapping[str(self.options.vsx)] - if Version(self.version) >= "1.6.38": + if Version(self.version) >= "1.6.41": + tc.variables["PNG_FRAMEWORK"] = False # changed from False to True by default in PNG 1.6.41 + tc.variables["PNG_TOOLS"] = False + elif Version(self.version) >= "1.6.38": tc.variables["PNG_EXECUTABLES"] = False tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False @@ -146,6 +149,7 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "libpng")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.cmake", os.path.join(self.package_folder, "lib", "cmake", "PNG")) def package_info(self): major_min_version = f"{Version(self.version).major}{Version(self.version).minor}" diff --git a/recipes/libpng/all/test_package/CMakeLists.txt b/recipes/libpng/all/test_package/CMakeLists.txt index 59e144e90a535..171081056d70e 100644 --- a/recipes/libpng/all/test_package/CMakeLists.txt +++ b/recipes/libpng/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(PNG REQUIRED) diff --git a/recipes/libpng/all/test_v1_package/CMakeLists.txt b/recipes/libpng/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libpng/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libpng/all/test_v1_package/conanfile.py b/recipes/libpng/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/libpng/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/libpng/config.yml b/recipes/libpng/config.yml index e93a6a24ec85a..c5ca3155be74c 100644 --- a/recipes/libpng/config.yml +++ b/recipes/libpng/config.yml @@ -1,4 +1,20 @@ versions: + "1.6.48": + folder: all + "1.6.47": + folder: all + "1.6.46": + folder: all + "1.6.45": + folder: all + "1.6.44": + folder: all + "1.6.43": + folder: all + "1.6.42": + folder: all + "1.6.41": + folder: all "1.6.40": folder: all "1.6.39": diff --git a/recipes/libpointmatcher/all/conandata.yml b/recipes/libpointmatcher/all/conandata.yml index 448e7fdb12dff..90e42a2d1fa6b 100644 --- a/recipes/libpointmatcher/all/conandata.yml +++ b/recipes/libpointmatcher/all/conandata.yml @@ -1,9 +1,13 @@ sources: - "1.3.1": - url: "https://github.com/ethz-asl/libpointmatcher/archive/refs/tags/1.3.1.tar.gz" - sha256: "82f93d2e7689efeef8837b8e969919b51c51ad4a1d1fa921c4dd8df4811378ab" + "1.4.3": + url: "https://github.com/ethz-asl/libpointmatcher/archive/refs/tags/1.4.3.tar.gz" + sha256: "7f8f56d4e561206fb5720ece6fecf6d27e9fd214d4dd326d228fddbea8289cda" patches: - "1.3.1": - - patch_file: "patches/1.3.1-0001-fix-cmake.patch" + "1.4.3": + - patch_file: "patches/1.4.3-0001-fix-cmake.patch" patch_description: "Fix upstream CMakeLists" patch_type: "conan" + - patch_file: "patches/1.4.3-0002-fix-const-error.patch" + patch_description: "Fix ScalarType const_cast compile error" + patch_type: "bugfix" + patch_source: "https://github.com/norlab-ulaval/libpointmatcher/pull/580" diff --git a/recipes/libpointmatcher/all/conanfile.py b/recipes/libpointmatcher/all/conanfile.py index b189d68d9c79e..a55b2ee1013f1 100644 --- a/recipes/libpointmatcher/all/conanfile.py +++ b/recipes/libpointmatcher/all/conanfile.py @@ -1,15 +1,21 @@ +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, copy, export_conandata_patches, get, rmdir -import os +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version required_conan_version = ">=1.53.0" class LibpointmatcherConan(ConanFile): name = "libpointmatcher" - description = "An Iterative Closest Point (ICP) library for 2D and 3D mapping in Robotics" + description = ( + "An Iterative Closest Point (ICP) library for 2D and 3D mapping in Robotics" + ) license = "BSD-3-Clause" topics = ("robotics", "lidar", "point-cloud") homepage = "https://github.com/ethz-asl/libpointmatcher" @@ -26,10 +32,22 @@ class LibpointmatcherConan(ConanFile): "fPIC": True, "with_openmp": False, } + short_paths = True @property def _min_cppstd(self): - return "11" + return "17" + + @property + def _compilers_minimum_version(self): + # https://github.com/norlab-ulaval/libpointmatcher/blob/1.4.3/CMakeLists.txt#L240 + return { + "gcc": "9", + "clang": "5", + "apple-clang": "7", + "msvc": "190", + "Visual Studio": "14", + } def export_sources(self): export_conandata_patches(self) @@ -41,19 +59,28 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if is_msvc(self): + # Only static for msvc + del self.options.shared + self.package_type = "static-library" def layout(self): cmake_layout(self, src_folder="src") def requirements(self): self.requires("boost/1.81.0", transitive_headers=True) - # FIXME: eigen 3.4.0 is not compatible yet (see https://github.com/ethz-asl/libpointmatcher/issues/496) - self.requires("eigen/3.3.9", transitive_headers=True) + self.requires("eigen/3.4.0", transitive_headers=True) self.requires("libnabo/1.0.7") + self.requires("yaml-cpp/0.7.0", 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 source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -62,9 +89,12 @@ def generate(self): tc = CMakeToolchain(self) tc.cache_variables["USE_OPEN_MP"] = self.options.with_openmp tc.cache_variables["USE_OPEN_CL"] = False - tc.cache_variables["SHARED_LIBS"] = self.options.shared - # TODO: to unvendor, but libpointmatcher depends on legacy API of yaml-cpp (0.3.x) - tc.variables["USE_SYSTEM_YAML_CPP"] = False + tc.cache_variables["SHARED_LIBS"] = self.options.get_safe("shared") + tc.cache_variables["BUILD_EXAMPLES"] = False + tc.cache_variables["BUILD_EVALUATIONS"] = False + tc.cache_variables["BUILD_TESTS"] = False + if not self.settings.compiler.cppstd: + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd tc.generate() deps = CMakeDeps(self) deps.generate() @@ -76,8 +106,12 @@ def build(self): cmake.build() def package(self): - copy(self, "copyright", src=os.path.join(self.source_folder, "debian"), - dst=os.path.join(self.package_folder, "licenses")) + copy( + self, + "copyright", + src=os.path.join(self.source_folder, "debian"), + dst=os.path.join(self.package_folder, "licenses"), + ) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) @@ -85,4 +119,8 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "libpointmatcher") self.cpp_info.set_property("pkg_config_name", "libpointmatcher") - self.cpp_info.libs = ["pointmatcher"] + sufix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"pointmatcher{sufix}"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m", "rt"] diff --git a/recipes/libpointmatcher/all/patches/1.3.1-0001-fix-cmake.patch b/recipes/libpointmatcher/all/patches/1.3.1-0001-fix-cmake.patch deleted file mode 100644 index bec21dac0c243..0000000000000 --- a/recipes/libpointmatcher/all/patches/1.3.1-0001-fix-cmake.patch +++ /dev/null @@ -1,208 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.11) -+cmake_minimum_required(VERSION 3.15) - - include(CheckSymbolExists) - -@@ -46,6 +46,7 @@ if( BUILD_32 ) - endif( BUILD_32 ) - - # Ensure proper build type -+if(0) - if (NOT CMAKE_BUILD_TYPE) - message("-- No build type specified; defaulting to CMAKE_BUILD_TYPE=Release.") - set(CMAKE_BUILD_TYPE Release CACHE STRING -@@ -65,12 +66,14 @@ endif (NOT CMAKE_BUILD_TYPE) - if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - add_definitions(-O3) - endif(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") -+endif() - - # For Windows - if( MSVC ) - add_definitions( /D _VARIADIC_MAX=10 ) # VS2012 does not support tuples correctly yet - add_definitions( /D _USE_MATH_DEFINES) # defines M_PI for Visual Studio - add_definitions( /D _ENABLE_EXTENDED_ALIGNED_STORAGE) # this variable must be defined with VS2017 to acknowledge alignment changes of aligned_storage -+ add_compile_options(/bigobj) - endif() - - #======================= installation ===================================== -@@ -120,19 +123,16 @@ if (Boost_MINOR_VERSION GREATER 47) - find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono REQUIRED) - endif (Boost_MINOR_VERSION GREATER 47) - include_directories(${Boost_INCLUDE_DIRS}) --set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${Boost_LIBRARIES}) -+set(EXTERNAL_LIBS ${EXTERNAL_LIBS} Boost::headers Boost::thread Boost::filesystem Boost::system Boost::program_options Boost::date_time Boost::chrono) - - - #-------------------- - # DEPENDENCY: eigen 3 - #-------------------- --find_path(EIGEN_INCLUDE_DIR Eigen/Core -- /usr/local/include/eigen3 -- /usr/include/eigen3 --) -+find_package(Eigen3 REQUIRED CONFIG) -+set(EXTERNAL_LIBS ${EXTERNAL_LIBS} Eigen3::Eigen ) - - # Suppress Eigen's warning by adding it to the system's library --include_directories(SYSTEM "${EIGEN_INCLUDE_DIR}") - - #TODO: this should be a more standard way - #find_package(Eigen3 REQUIRED) -@@ -143,10 +143,9 @@ include_directories(SYSTEM "${EIGEN_INCLUDE_DIR}") - #-------------------- - # DEPENDENCY: nabo - #-------------------- --find_package(libnabo REQUIRED PATHS ${LIBNABO_INSTALL_DIR}) -+find_package(libnabo REQUIRED CONFIG) - #include(libnaboConfig) --include_directories(${libnabo_INCLUDE_DIRS}) --set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${libnabo_LIBRARIES}) -+set(EXTERNAL_LIBS ${EXTERNAL_LIBS} libnabo::nabo) - message(STATUS "libnabo found, version ${libnabo_VERSION} (include=${libnabo_INCLUDE_DIRS} libs=${libnabo_LIBRARIES})") - - #-------------------- -@@ -215,8 +214,7 @@ else(USE_SYSTEM_YAML_CPP) - #get_property(yaml-cpp-pm_INCLUDE TARGET yaml-cpp-pm PROPERTY INCLUDE_DIRECTORIES) - #include_directories(${yaml-cpp-pm_INCLUDE}) - -- get_property(yaml-cpp-pm_LIB TARGET yaml-cpp-pm PROPERTY LOCATION) -- set (EXTERNAL_LIBS ${EXTERNAL_LIBS} ${yaml-cpp-pm_LIB} ) -+ set (EXTERNAL_LIBS ${EXTERNAL_LIBS} yaml-cpp-pm ) - set (EXTRA_DEPS ${EXTRA_DEPS} yaml-cpp-pm) - set(yamlcpp_FOUND) - -@@ -241,6 +239,7 @@ endif (POSIX_TIMERS AND NOT APPLE) - #========================== libpointmatcher itself ============================== - - # Check the compiler version as we need full C++11 support. -+if(0) - if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - # using Clang - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.3") -@@ -276,6 +275,7 @@ if (CMAKE_VERSION VERSION_LESS "3.1") - else () - set (CMAKE_CXX_STANDARD 11) - endif () -+endif() - - # SOURCE - -@@ -350,12 +350,12 @@ file(GLOB_RECURSE POINTMATCHER_HEADERS "pointmatcher/*.h") - - # MacOS and Windows deal with shared/dynamic library differently. For - # simplicity, we only authorize static library in those cases. --if(APPLE OR WIN32) -+if(0) - - add_library(pointmatcher ${POINTMATCHER_SRC} ${POINTMATCHER_HEADERS} ) - install(TARGETS pointmatcher ARCHIVE DESTINATION ${INSTALL_LIB_DIR}) - --else(APPLE OR WIN32) -+else() - set(SHARED_LIBS "true" CACHE BOOL "To build shared (true) or static (false) library") - - if (SHARED_LIBS) -@@ -369,14 +369,15 @@ else(APPLE OR WIN32) - add_library(pointmatcher ${POINTMATCHER_SRC} ${POINTMATCHER_HEADERS} ) - install(TARGETS pointmatcher ARCHIVE DESTINATION ${INSTALL_LIB_DIR}) - endif(SHARED_LIBS) --endif(APPLE OR WIN32) -+ set_target_properties(pointmatcher PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) -+ target_compile_features(pointmatcher PUBLIC cxx_std_11) -+endif() - - target_include_directories(pointmatcher PRIVATE ${CMAKE_SOURCE_DIR}/pointmatcher) - target_include_directories(pointmatcher PRIVATE ${CMAKE_SOURCE_DIR}/pointmatcher/DataPointsFilters) - target_include_directories(pointmatcher PRIVATE ${CMAKE_SOURCE_DIR}/pointmatcher/DataPointsFilters/utils) - - # link all libraries to libpointmatcher --add_definitions(-Wall) - #target_link_libraries(pointmatcher ${yaml-cpp_LIBRARIES} ${libnabo_LIBRARIES}) - target_link_libraries(pointmatcher ${EXTERNAL_LIBS}) - -@@ -432,11 +433,8 @@ endif(GENERATE_API_DOC) - #=============== trigger other makefile ====================== - - # Example programs --add_subdirectory(examples) - # Evaluation programs --add_subdirectory(evaluations) - # Unit testing --add_subdirectory(utest) - - - #=================== allow find_package() ========================= -@@ -451,6 +449,7 @@ add_subdirectory(utest) - # 1- local build # - - # Register the local build in case one doesn't use "make install" -+if(0) - export(PACKAGE libpointmatcher) - - # Create variable for the local build tree -@@ -537,3 +536,4 @@ configure_file( - - add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) -+endif() ---- a/contrib/CMakeLists.txt -+++ b/contrib/CMakeLists.txt -@@ -1,8 +1,6 @@ - # External libraries packed with libpointmatcher - - # GTest --include_directories(${CMAKE_CURRENT_SOURCE_DIR}) --add_library(gtest gtest/gtest-all.cc) - - # Wrapped yaml-cpp - if(NOT USE_SYSTEM_YAML_CPP) ---- a/contrib/yaml-cpp-pm/CMakeLists.txt -+++ b/contrib/yaml-cpp-pm/CMakeLists.txt -@@ -19,7 +19,6 @@ set(YAML_CPP_BUILD_CONTRIB OFF) - # --> General - # see http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:BUILD_SHARED_LIBS - # http://www.cmake.org/cmake/help/cmake2.6docs.html#command:add_library --set(BUILD_SHARED_LIBS OFF) - - # --> Apple - option(APPLE_UNIVERSAL_BIN "Apple: Build universal binary" OFF) -@@ -55,7 +54,6 @@ endif() - - if(WIN32) - if(BUILD_SHARED_LIBS) -- add_definitions(-D${PROJECT_NAME}_DLL) # use or build Windows DLL - endif() - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "C:/") -@@ -63,7 +61,7 @@ if(WIN32) - endif() - - # GCC / Clang specialities --if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") -+if(0) - ### General stuff - if(WIN32) - set(CMAKE_SHARED_LIBRARY_PREFIX "") # DLLs do not have a "lib" prefix -@@ -105,7 +103,7 @@ endif() - ### - ### Library - ### --add_library(yaml-cpp-pm -+add_library(yaml-cpp-pm OBJECT - ${sources} - ${public_headers} - ${private_headers} -@@ -113,6 +111,9 @@ add_library(yaml-cpp-pm - ${contrib_public_headers} - ${contrib_private_headers} - ) -+if(BUILD_SHARED_LIBS) -+ set_target_properties(yaml-cpp-pm PROPERTIES POSITION_INDEPENDENT_CODE ON) -+endif() - - set_target_properties(yaml-cpp-pm PROPERTIES - VERSION "${YAML_CPP_VERSION}" diff --git a/recipes/libpointmatcher/all/patches/1.4.3-0001-fix-cmake.patch b/recipes/libpointmatcher/all/patches/1.4.3-0001-fix-cmake.patch new file mode 100644 index 0000000000000..50590958948df --- /dev/null +++ b/recipes/libpointmatcher/all/patches/1.4.3-0001-fix-cmake.patch @@ -0,0 +1,109 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0acebe3..b17f3d5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.10.2) ++cmake_minimum_required(VERSION 3.15) + + include(GNUInstallDirs) # populate CMAKE_INSTALL_{LIB,BIN}DIR + include(CheckSymbolExists) +@@ -9,8 +9,6 @@ include(CMakePackageConfigHelpers) + # Project details / setup + #======================== + +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) # add -fPIC as required +- + # Extract version from header, done first to satisfy CMP0048, + # see `cmake --help-policy CMP0048` for more information. + file( +@@ -51,6 +49,7 @@ if( BUILD_32 ) + endif() + + # Ensure proper build type ++if(0) + if (NOT CMAKE_BUILD_TYPE) + message("-- No build type specified; defaulting to CMAKE_BUILD_TYPE=Release.") + set(CMAKE_BUILD_TYPE Release CACHE STRING +@@ -64,6 +63,7 @@ else () + message("\n=================================================================================") + endif () + endif () ++endif() + + + #================= extra building definitions ============================== +@@ -110,9 +110,6 @@ endforeach() + # initially + set(EXTERNAL_LIBS "") + +-# compile local version of gtest +-add_subdirectory(contrib) +- + #--------------------------- + # DEPENDENCY: POSIX Threads + #--------------------------- +@@ -134,22 +131,10 @@ endif () + #-------------------- + # DEPENDENCY: eigen 3 + #-------------------- +-find_path(EIGEN_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library +- HINTS ENV EIGEN3_INC_DIR +- ENV EIGEN3_DIR +- PATHS Eigen/Core +- /usr/local/include +- /usr/include +- PATH_SUFFIXES include eigen3 eigen +- DOC "Directory containing the Eigen3 header files" +-) + + # Suppress Eigen's warning by adding it to the system's library +-include_directories(SYSTEM "${EIGEN_INCLUDE_DIR}") +- +-#TODO: this should be a more standard way +-#find_package(Eigen3 REQUIRED) +-#message("-- eigen3 , version ${EIGEN_VERSION}") ++find_package(Eigen3 REQUIRED) ++set(EXTERNAL_LIBS ${EXTERNAL_LIBS} Eigen3::Eigen ) + + + +@@ -158,7 +143,7 @@ include_directories(SYSTEM "${EIGEN_INCLUDE_DIR}") + #-------------------- + if (NOT TARGET nabo) + # Find libnabo: +- find_package(libnabo REQUIRED PATHS ${LIBNABO_INSTALL_DIR}) ++ find_package(libnabo REQUIRED PATHS) + if (TARGET libnabo::nabo) + set(libnabo_LIBRARIES libnabo::nabo) + message(STATUS "libnabo found, version ${libnabo_VERSION} (Config mode, libs=${libnabo_LIBRARIES})") +@@ -238,6 +223,7 @@ check_symbol_exists(_POSIX_TIMERS "unistd.h;time.h" POSIX_TIMERS) + #========================== libpointmatcher itself ============================== + + # Check the compiler version as we need full C++17 support. ++if(0) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # using Clang + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5") +@@ -273,6 +259,7 @@ if (CMAKE_VERSION VERSION_LESS "3.8") + else () + set (CMAKE_CXX_STANDARD 17) + endif () ++endif () + + # SOURCE + +@@ -483,7 +470,7 @@ endif() + # include_directories(${libpointmatcher_INCLUDE_DIRS}) + # target_link_libraries(executableName ${libpointmatcher_LIBRARIES}) + # ... +- ++if(0) + # 1- local build # + + # Install cmake config module +@@ -574,3 +561,4 @@ if (NOT TARGET uninstall) + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + endif() ++endif() diff --git a/recipes/libpointmatcher/all/patches/1.4.3-0002-fix-const-error.patch b/recipes/libpointmatcher/all/patches/1.4.3-0002-fix-const-error.patch new file mode 100644 index 0000000000000..1dd09a84875d2 --- /dev/null +++ b/recipes/libpointmatcher/all/patches/1.4.3-0002-fix-const-error.patch @@ -0,0 +1,13 @@ +diff --git a/pointmatcher/PointCloudGenerator.cpp b/pointmatcher/PointCloudGenerator.cpp +index d084dd2..739995b 100644 +--- a/pointmatcher/PointCloudGenerator.cpp ++++ b/pointmatcher/PointCloudGenerator.cpp +@@ -170,7 +170,7 @@ typename PointMatcher::DataPoints PointMatcher::PointCloudGenerator::gener + { + // Sample random values of theta and phi. + const ScalarType phi{ 2.0f * pi * uniformDistribution(randomNumberGenerator) }; +- const ScalarType radiusSample{ radius * sqrt(uniformDistribution(randomNumberGenerator)) }; ++ const ScalarType radiusSample{ static_cast(radius * sqrt(uniformDistribution(randomNumberGenerator))) }; + + // Pre-compute values, such as sine and cosine of phi and theta. + const ScalarType sinPhi{ std::sin(phi) }; diff --git a/recipes/libpointmatcher/all/test_package/CMakeLists.txt b/recipes/libpointmatcher/all/test_package/CMakeLists.txt index b3a37d353b52c..e3981479def23 100644 --- a/recipes/libpointmatcher/all/test_package/CMakeLists.txt +++ b/recipes/libpointmatcher/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(libpointmatcher REQUIRED CONFIG) diff --git a/recipes/libpointmatcher/all/test_v1_package/CMakeLists.txt b/recipes/libpointmatcher/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libpointmatcher/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libpointmatcher/all/test_v1_package/conanfile.py b/recipes/libpointmatcher/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libpointmatcher/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_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/libpointmatcher/config.yml b/recipes/libpointmatcher/config.yml index 59334d5077368..91b545dcd8ee8 100644 --- a/recipes/libpointmatcher/config.yml +++ b/recipes/libpointmatcher/config.yml @@ -1,3 +1,3 @@ versions: - "1.3.1": + "1.4.3": folder: all diff --git a/recipes/libpopcnt/all/conandata.yml b/recipes/libpopcnt/all/conandata.yml new file mode 100644 index 0000000000000..b0127ac4b8ec5 --- /dev/null +++ b/recipes/libpopcnt/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.1": + url: "https://github.com/kimwalisch/libpopcnt/archive/refs/tags/v3.1.tar.gz" + sha256: "b4ea061f4c2e5385dff0dd032ad5a16c60dc0dd050391283afb463c0d62c19bd" diff --git a/recipes/libpopcnt/all/conanfile.py b/recipes/libpopcnt/all/conanfile.py new file mode 100644 index 0000000000000..5f7a42a3c6d34 --- /dev/null +++ b/recipes/libpopcnt/all/conanfile.py @@ -0,0 +1,44 @@ +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.52.0" + +class LibPopcntConan(ConanFile): + name = "libpopcnt" + description = "Fast C/C++ bit population count library" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kimwalisch/libpopcnt" + topics = ("popcnt", "popcount", "neon", "avx2", "avx512", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + 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], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + 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() + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/libpopcnt/all/test_package/CMakeLists.txt b/recipes/libpopcnt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..999d497c63aec --- /dev/null +++ b/recipes/libpopcnt/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(libpopcnt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libpopcnt::libpopcnt) diff --git a/recipes/libpopcnt/all/test_package/conanfile.py b/recipes/libpopcnt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/libpopcnt/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/libpopcnt/all/test_package/test_package.c b/recipes/libpopcnt/all/test_package/test_package.c new file mode 100644 index 0000000000000..6faee9c998607 --- /dev/null +++ b/recipes/libpopcnt/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() { + const char data = 0xff; + uint64_t bits = popcnt(&data, sizeof(char)); + printf("popcnt(0xff) = %" PRIu64 " (expected 8) - Test package successful \n", bits); + return 0; +} diff --git a/recipes/libpopcnt/config.yml b/recipes/libpopcnt/config.yml new file mode 100644 index 0000000000000..992d10eb37c11 --- /dev/null +++ b/recipes/libpopcnt/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1": + folder: all diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml index 862caa7abf541..c10285830948f 100644 --- a/recipes/libpq/all/conandata.yml +++ b/recipes/libpq/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "16.8": + url: "https://ftp.postgresql.org/pub/source/v16.8/postgresql-16.8.tar.bz2" + sha256: "9468083a56ce0ee7d294601b74dad3dd9fc69d87aff61f0a9fb63c813ff7efd8" + "15.12": + url: "https://ftp.postgresql.org/pub/source/v15.12/postgresql-15.12.tar.bz2" + sha256: "3bc8462a38ca0857270cc88b949a3f6659f0d5c44c029c482355835b61a0f6f7" + "15.5": + url: "https://ftp.postgresql.org/pub/source/v15.5/postgresql-15.5.tar.bz2" + sha256: "8f53aa95d78eb8e82536ea46b68187793b42bba3b4f65aa342f540b23c9b10a6" "15.4": url: "https://ftp.postgresql.org/pub/source/v15.4/postgresql-15.4.tar.bz2" sha256: "baec5a4bdc4437336653b6cb5d9ed89be5bd5c0c58b94e0becee0a999e63c8f9" @@ -8,51 +17,37 @@ sources: "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: - "15.4": - - patch_file: "patches/15/001-mingw-build-static-libraries.patch" + "16.8": + - patch_file: "patches/16/001-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." patch_type: "portability" - "15.3": + "15.12": - patch_file: "patches/15/001-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." patch_type: "portability" - "14.9": - - patch_file: "patches/13/002-mingw-build-static-libraries.patch" - patch_description: "port MinGW: Enable building static libraries in MinGW." - patch_type: "portability" - "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.16": - - patch_file: "patches/12/002-mingw-build-static-libraries.patch" + "15.5": + - patch_file: "patches/15/001-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." patch_type: "portability" - "11.21": - - patch_file: "patches/10/002-mingw-build-static-libraries.patch" + - patch_file: "patches/15.5/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch" + patch_description: "Fix libpq w/ openssl >=3.2.x" + patch_type: "backport" + "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" - "10.23": - - patch_file: "patches/10/002-mingw-build-static-libraries.patch" + - patch_file: "patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch" + patch_description: "Fix libpq w/ openssl >=3.2.x" + patch_type: "backport" + "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" - "9.6.24": - - patch_file: "patches/9.6/002-mingw-build-static-libraries.patch" + - patch_file: "patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch" + patch_description: "Fix libpq w/ openssl >=3.2.x" + patch_type: "backport" + "14.9": + - patch_file: "patches/14/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 53f51b549f74e..d444d1b3ac66f 100644 --- a/recipes/libpq/all/conanfile.py +++ b/recipes/libpq/all/conanfile.py @@ -3,7 +3,7 @@ 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, replace_in_file, rm, rmdir -from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, VCVars from conan.tools.scm import Version @@ -16,22 +16,25 @@ class LibpqConan(ConanFile): name = "libpq" description = "The library used by all the standard PostgreSQL tools." - topics = ("libpq", "postgresql", "database", "db") + topics = ("postgresql", "database", "db") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.postgresql.org/docs/current/static/libpq.html" license = "PostgreSQL" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "with_openssl": [True, False], + "with_icu": [True, False], "disable_rpath": [True, False], } default_options = { "shared": False, "fPIC": True, "with_openssl": False, + "with_icu": False, "disable_rpath": False, } @@ -39,7 +42,7 @@ class LibpqConan(ConanFile): def _is_clang8_x86(self): return self.settings.os == "Linux" and \ self.settings.compiler == "clang" and \ - self.settings.compiler.version == "8" and \ + Version(self.settings.compiler.version) == "8" and \ self.settings.arch == "x86" @property @@ -65,10 +68,9 @@ def layout(self): def requirements(self): if self.options.with_openssl: - if Version(self.version) < "13.5": - self.requires("openssl/1.1.1w") - else: - self.requires("openssl/[>=1.1 <4]") + self.requires("openssl/[>=1.1 <4]") + if self.options.with_icu: + self.requires("icu/75.1") def build_requirements(self): if is_msvc(self): @@ -77,6 +79,10 @@ def build_requirements(self): self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") + else: + if self.options.with_openssl or self.options.with_icu: + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -98,6 +104,7 @@ def generate(self): tc = AutotoolsToolchain(self) tc.configure_args.append('--without-readline') tc.configure_args.append('--without-zlib') + tc.configure_args.append('--with-icu' if self.options.get_safe("with_icu") else '--without-icu') tc.configure_args.append('--with-openssl' if self.options.with_openssl else '--without-openssl') if cross_building(self) and not self.options.with_openssl: tc.configure_args.append("--disable-strong-random") @@ -112,6 +119,7 @@ def generate(self): tc.make_args.append("MAKE_DLL={}".format(str(self.options.shared).lower())) tc.generate() AutotoolsDeps(self).generate() + PkgConfigDeps(self).generate() def _patch_sources(self): if is_msvc(self): @@ -127,8 +135,9 @@ def _patch_sources(self): system_libs.extend(dep.cpp_info.aggregated_components().system_libs) linked_system_libs = ", ".join(["'{}.lib'".format(lib) for lib in system_libs]) + libraries_pattern = "libraries => []," if Version(self.version) < '16' else "libraries => []," replace_in_file(self,os.path.join(self.source_folder, "src", "tools", "msvc", "Project.pm"), - "libraries => [],", + libraries_pattern, "libraries => [{}],".format(linked_system_libs)) runtime = { "MT": "MultiThreaded", @@ -155,15 +164,31 @@ def _patch_sources(self): replace_in_file(self,solution_pm, "%s.lib" % crypto, "%s.lib" % openssl.cpp_info.components["crypto"].libs[0]) + openssl_entry = "openssl => undef" if Version(self.version) >= "16.0" else "openssl => undef" replace_in_file(self,config_default_pl, - "openssl => undef", + openssl_entry, "openssl => '%s'" % openssl.package_folder.replace("\\", "/")) + if self.options.with_icu: + libicu = self.dependencies["icu"] + iculibdir = libicu.cpp_info.components["icu"].libdirs[0] + replace_in_file(self, solution_pm, "\\lib64\\icu", f"\\{iculibdir}\\icu") + icu_undef = "icu => undef" if Version(self.version) >= "16.0" else "icu => undef" + replace_in_file(self,config_default_pl, + icu_undef, + "icu => '%s'" % libicu.package_folder.replace("\\", "/")) elif self.settings.os == "Windows": if self.settings.get_safe("compiler.threads") == "posix": # Use MinGW pthread library replace_in_file(self, os.path.join(self.source_folder, "src", "interfaces", "libpq", "Makefile"), "ifeq ($(enable_thread_safety), yes)\nOBJS += pthread-win32.o\nendif", "") + # When linking to static openssl, it comes with static pthread library too, failing with: + # libpq.so.5.15: U pthread_exit@GLIBC_2.2.5: libpq must not be calling any function which invokes exit + # https://www.postgresql.org/message-id/20210703001639.GB2374652%40rfd.leadboat.com + if Version(self.version) >= "15": + replace_in_file(self, os.path.join(self.source_folder, "src", "interfaces", "libpq", "Makefile"), + "-v __cxa_atexit", + "-v __cxa_atexit -e pthread_exit") def build(self): apply_conandata_patches(self) @@ -175,21 +200,22 @@ def build(self): self.run("perl build.pl libpgport") else: autotools = Autotools(self) - with chdir(self, os.path.join(self.source_folder)): + with chdir(self, os.path.join(self.build_folder)): autotools.configure() - with chdir(self, os.path.join(self.source_folder, "src", "backend")): + with chdir(self, os.path.join(self.build_folder, "src", "backend")): autotools.make(target="generated-headers") - with chdir(self, os.path.join(self.source_folder, "src", "common")): + with chdir(self, os.path.join(self.build_folder, "src", "common")): + autotools.make() + with chdir(self, os.path.join(self.build_folder, "src", "include")): autotools.make() - with chdir(self, os.path.join(self.source_folder, "src", "include")): + with chdir(self, os.path.join(self.build_folder, "src", "bin", "pg_config")): autotools.make() - with chdir(self, os.path.join(self.source_folder, "src", "interfaces", "libpq")): + with chdir(self, os.path.join(self.build_folder, "src", "interfaces", "libpq")): autotools.make() if Version(self.version) >= 12: - with chdir(self, os.path.join(self.source_folder, "src", "port")): + with chdir(self, os.path.join(self.build_folder, "src", "port")): autotools.make() - with chdir(self, os.path.join(self.source_folder, "src", "bin", "pg_config")): - autotools.make() + def _remove_unused_libraries_from_package(self): bin_folder = os.path.join(self.package_folder, "bin") @@ -225,25 +251,25 @@ def package(self): copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) else: autotools = Autotools(self) - with chdir(self, os.path.join(self.source_folder, "src", "common")): + with chdir(self, os.path.join(self.build_folder, "src", "common")): autotools.install() - with chdir(self, os.path.join(self.source_folder, "src", "include")): + with chdir(self, os.path.join(self.build_folder, "src", "include")): autotools.install() - with chdir(self, os.path.join(self.source_folder, "src", "interfaces", "libpq")): + with chdir(self, os.path.join(self.build_folder, "src", "interfaces", "libpq")): autotools.install() if Version(self.version) >= 12: - with chdir(self, os.path.join(self.source_folder, "src", "port")): + with chdir(self, os.path.join(self.build_folder, "src", "port")): autotools.install() - with chdir(self, os.path.join(self.source_folder, "src", "bin", "pg_config")): + with chdir(self, os.path.join(self.build_folder, "src", "bin", "pg_config")): autotools.install() - copy(self, "*.h", src=os.path.join(self.build_folder, "src", "include", "catalog"), + copy(self, "*.h", src=os.path.join(self.source_folder, "src", "include", "catalog"), dst=os.path.join(self.package_folder, "include", "catalog")) 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, "include", "postgresql", "server")) self._remove_unused_libraries_from_package() fix_apple_shared_install_name(self) - copy(self, "*.h", src=os.path.join(self.build_folder, "src", "backend", "catalog"), + copy(self, "*.h", src=os.path.join(self.source_folder, "src", "backend", "catalog"), dst=os.path.join(self.package_folder, "include", "catalog")) def package_info(self): @@ -258,26 +284,27 @@ def package_info(self): if self.options.with_openssl: self.cpp_info.components["pq"].requires.append("openssl::openssl") + if self.options.with_icu: + self.cpp_info.components["pq"].requires.append("icu::icu") if not self.options.shared: if is_msvc(self): self.cpp_info.components["pgport"].libs = ["libpgport"] self.cpp_info.components["pq"].requires.append("pgport") - if Version(self.version) >= "12": - self.cpp_info.components["pgcommon"].libs = ["libpgcommon"] - self.cpp_info.components["pq"].requires.append("pgcommon") + self.cpp_info.components["pgcommon"].libs = ["libpgcommon"] + self.cpp_info.components["pq"].requires.append("pgcommon") else: self.cpp_info.components["pgcommon"].libs = ["pgcommon"] self.cpp_info.components["pq"].requires.append("pgcommon") - if Version(self.version) >= "12": - self.cpp_info.components["pgcommon"].libs.append("pgcommon_shlib") - self.cpp_info.components["pgport"].libs = ["pgport", "pgport_shlib"] - if self.settings.os == "Windows": - self.cpp_info.components["pgport"].system_libs = ["ws2_32"] - self.cpp_info.components["pgcommon"].requires.append("pgport") + self.cpp_info.components["pgcommon"].libs.append("pgcommon_shlib") + self.cpp_info.components["pgport"].libs = ["pgport", "pgport_shlib"] + if self.settings.os == "Windows": + self.cpp_info.components["pgport"].system_libs = ["ws2_32"] + self.cpp_info.components["pgcommon"].requires.append("pgport") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["pq"].system_libs = ["pthread"] + self.cpp_info.components["pgcommon"].system_libs = ["m"] elif self.settings.os == "Windows": self.cpp_info.components["pq"].system_libs = ["ws2_32", "secur32", "advapi32", "shell32", "crypt32", "wldap32"] diff --git a/recipes/libpq/all/patches/10/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/10/002-mingw-build-static-libraries.patch deleted file mode 100644 index bfa322133c73c..0000000000000 --- a/recipes/libpq/all/patches/10/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/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/12/002-mingw-build-static-libraries.patch deleted file mode 100644 index ee5dfabdf330e..0000000000000 --- a/recipes/libpq/all/patches/12/002-mingw-build-static-libraries.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -370,7 +370,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 -@@ -383,12 +386,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 -@@ -483,6 +486,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/13/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/14/002-mingw-build-static-libraries.patch similarity index 100% rename from recipes/libpq/all/patches/13/002-mingw-build-static-libraries.patch rename to recipes/libpq/all/patches/14/002-mingw-build-static-libraries.patch diff --git a/recipes/libpq/all/patches/15.5/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch b/recipes/libpq/all/patches/15.5/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch new file mode 100644 index 0000000000000..03514f3a2bc18 --- /dev/null +++ b/recipes/libpq/all/patches/15.5/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch @@ -0,0 +1,193 @@ +From 672103a67aaf0dae5be6c5adcc5ce19e5b6d7676 Mon Sep 17 00:00:00 2001 +From: Tristan Partin +Date: Mon, 27 Nov 2023 11:49:52 -0600 +Subject: [PATCH v1] Use BIO_{get,set}_app_data() instead of + BIO_{get,set}_data() + +Compiling Postgres against OpenSSL 3.2 exposed a regression: + +$ psql "postgresql://$DB?sslmode=require" +psql: error: connection to server at "redacted" (redacted), port 5432 failed: ERROR: Parameter 'user' is missing in startup packet. +double free or corruption (out) +Aborted (core dumped) + +Analyzing the backtrace, openssl was overwriting heap-allocated data in +our PGconn struct because it thought BIO::ptr was a struct bss_sock_st +*. OpenSSL then called a memset() on a member of that struct, and we +zeroed out data in our PGconn struct. + +BIO_get_data(3) says the following: + +> These functions are mainly useful when implementing a custom BIO. +> +> The BIO_set_data() function associates the custom data pointed to by ptr +> with the BIO a. This data can subsequently be retrieved via a call to +> BIO_get_data(). This can be used by custom BIOs for storing +> implementation specific information. + +If you take a look at my_BIO_s_socket(), we create a partially custom +BIO, but for the most part are defaulting to the methods defined by +BIO_s_socket(). We need to set application-specific data and not BIO +private data, so that the BIO implementation we rely on, can properly +assert that its private data is what it expects. + +Rebased against libpq15 + +Co-authored-by: Bo Andreson +--- + src/backend/libpq/be-secure-openssl.c | 11 +++-------- + src/include/pg_config.h.in | 3 --- + src/interfaces/libpq/fe-secure-openssl.c | 20 +++----------------- + src/tools/msvc/Solution.pm | 2 -- + 4 files changed, 6 insertions(+), 30 deletions(-) + +diff --git a/configure b/configure +index d83a402ea1..d55440cd6a 100755 +--- a/configure ++++ b/configure +@@ -13239,7 +13239,7 @@ done + # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it + # doesn't have these OpenSSL 1.1.0 functions. So check for individual + # functions. +- for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free ++ for ac_func in OPENSSL_init_ssl BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +diff --git a/configure.ac b/configure.ac +index 570daced81..2bc752ca1a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1347,7 +1347,7 @@ if test "$with_ssl" = openssl ; then + # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it + # doesn't have these OpenSSL 1.1.0 functions. So check for individual + # functions. +- AC_CHECK_FUNCS([OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free]) ++ AC_CHECK_FUNCS([OPENSSL_init_ssl BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free]) + # OpenSSL versions before 1.1.0 required setting callback functions, for + # thread-safety. In 1.1.0, it's no longer required, and CRYPTO_lock() + # function was removed. +diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c +index f5c5ed210e..aed8a75345 100644 +--- a/src/backend/libpq/be-secure-openssl.c ++++ b/src/backend/libpq/be-secure-openssl.c +@@ -839,11 +839,6 @@ be_tls_write(Port *port, void *ptr, size_t len, int *waitfor) + * to retry; do we need to adopt their logic for that? + */ + +-#ifndef HAVE_BIO_GET_DATA +-#define BIO_get_data(bio) (bio->ptr) +-#define BIO_set_data(bio, data) (bio->ptr = data) +-#endif +- + static BIO_METHOD *my_bio_methods = NULL; + + static int +@@ -853,7 +848,7 @@ my_sock_read(BIO *h, char *buf, int size) + + if (buf != NULL) + { +- res = secure_raw_read(((Port *) BIO_get_data(h)), buf, size); ++ res = secure_raw_read(((Port *) BIO_get_app_data(h)), buf, size); + BIO_clear_retry_flags(h); + if (res <= 0) + { +@@ -873,7 +868,7 @@ my_sock_write(BIO *h, const char *buf, int size) + { + int res = 0; + +- res = secure_raw_write(((Port *) BIO_get_data(h)), buf, size); ++ res = secure_raw_write(((Port *) BIO_get_app_data(h)), buf, size); + BIO_clear_retry_flags(h); + if (res <= 0) + { +@@ -949,7 +944,7 @@ my_SSL_set_fd(Port *port, int fd) + SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); + goto err; + } +- BIO_set_data(bio, port); ++ BIO_set_app_data(bio, port); + + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set_bio(port->ssl, bio, bio); +diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in +index d09e9f9a1c..768e3d719c 100644 +--- a/src/include/pg_config.h.in ++++ b/src/include/pg_config.h.in +@@ -77,9 +77,6 @@ + /* Define to 1 if you have the `backtrace_symbols' function. */ + #undef HAVE_BACKTRACE_SYMBOLS + +-/* Define to 1 if you have the `BIO_get_data' function. */ +-#undef HAVE_BIO_GET_DATA +- + /* Define to 1 if you have the `BIO_meth_new' function. */ + #undef HAVE_BIO_METH_NEW + +diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c +index af59ff49f7..8d68d023e9 100644 +--- a/src/interfaces/libpq/fe-secure-openssl.c ++++ b/src/interfaces/libpq/fe-secure-openssl.c +@@ -1800,11 +1800,6 @@ PQsslAttribute(PGconn *conn, const char *attribute_name) + * to retry; do we need to adopt their logic for that? + */ + +-#ifndef HAVE_BIO_GET_DATA +-#define BIO_get_data(bio) (bio->ptr) +-#define BIO_set_data(bio, data) (bio->ptr = data) +-#endif +- + static BIO_METHOD *my_bio_methods; + + static int +@@ -1812,7 +1807,7 @@ my_sock_read(BIO *h, char *buf, int size) + { + int res; + +- res = pqsecure_raw_read((PGconn *) BIO_get_data(h), buf, size); ++ res = pqsecure_raw_read((PGconn *) BIO_get_app_data(h), buf, size); + BIO_clear_retry_flags(h); + if (res < 0) + { +@@ -1842,7 +1837,7 @@ my_sock_write(BIO *h, const char *buf, int size) + { + int res; + +- res = pqsecure_raw_write((PGconn *) BIO_get_data(h), buf, size); ++ res = pqsecure_raw_write((PGconn *) BIO_get_app_data(h), buf, size); + BIO_clear_retry_flags(h); + if (res < 0) + { +@@ -1933,7 +1928,7 @@ my_SSL_set_fd(PGconn *conn, int fd) + SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); + goto err; + } +- BIO_set_data(bio, conn); ++ BIO_set_app_data(bio, conn); + + SSL_set_bio(conn->ssl, bio, bio); + BIO_set_fd(bio, fd, BIO_NOCLOSE); +diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm +index 790f03b05e..a53239fa28 100644 +--- a/src/tools/msvc/Solution.pm ++++ b/src/tools/msvc/Solution.pm +@@ -226,7 +226,6 @@ sub GenerateFiles + HAVE_ATOMICS => 1, + HAVE_ATOMIC_H => undef, + HAVE_BACKTRACE_SYMBOLS => undef, +- HAVE_BIO_GET_DATA => undef, + HAVE_BIO_METH_NEW => undef, + HAVE_CLOCK_GETTIME => undef, + HAVE_COMPUTED_GOTO => undef, +@@ -566,7 +565,6 @@ sub GenerateFiles + || ($digit1 >= '1' && $digit2 >= '1' && $digit3 >= '0')) + { + $define{HAVE_ASN1_STRING_GET0_DATA} = 1; +- $define{HAVE_BIO_GET_DATA} = 1; + $define{HAVE_BIO_METH_NEW} = 1; + $define{HAVE_HMAC_CTX_FREE} = 1; + $define{HAVE_HMAC_CTX_NEW} = 1; +-- +Tristan Partin +Neon (https://neon.tech) + diff --git a/recipes/libpq/all/patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch b/recipes/libpq/all/patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch new file mode 100644 index 0000000000000..31cf4e85b1aa6 --- /dev/null +++ b/recipes/libpq/all/patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch @@ -0,0 +1,193 @@ +From 672103a67aaf0dae5be6c5adcc5ce19e5b6d7676 Mon Sep 17 00:00:00 2001 +From: Tristan Partin +Date: Mon, 27 Nov 2023 11:49:52 -0600 +Subject: [PATCH v1] Use BIO_{get,set}_app_data() instead of + BIO_{get,set}_data() + +Compiling Postgres against OpenSSL 3.2 exposed a regression: + +$ psql "postgresql://$DB?sslmode=require" +psql: error: connection to server at "redacted" (redacted), port 5432 failed: ERROR: Parameter 'user' is missing in startup packet. +double free or corruption (out) +Aborted (core dumped) + +Analyzing the backtrace, openssl was overwriting heap-allocated data in +our PGconn struct because it thought BIO::ptr was a struct bss_sock_st +*. OpenSSL then called a memset() on a member of that struct, and we +zeroed out data in our PGconn struct. + +BIO_get_data(3) says the following: + +> These functions are mainly useful when implementing a custom BIO. +> +> The BIO_set_data() function associates the custom data pointed to by ptr +> with the BIO a. This data can subsequently be retrieved via a call to +> BIO_get_data(). This can be used by custom BIOs for storing +> implementation specific information. + +If you take a look at my_BIO_s_socket(), we create a partially custom +BIO, but for the most part are defaulting to the methods defined by +BIO_s_socket(). We need to set application-specific data and not BIO +private data, so that the BIO implementation we rely on, can properly +assert that its private data is what it expects. + +Rebased against libpq15 + +Co-authored-by: Bo Andreson +--- + src/backend/libpq/be-secure-openssl.c | 11 +++-------- + src/include/pg_config.h.in | 3 --- + src/interfaces/libpq/fe-secure-openssl.c | 20 +++----------------- + src/tools/msvc/Solution.pm | 2 -- + 4 files changed, 6 insertions(+), 30 deletions(-) + +diff --git a/configure b/configure +index d733a59..c13ad3d 100755 +--- a/configure ++++ b/configure +@@ -13237,7 +13237,7 @@ done + # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it + # doesn't have these OpenSSL 1.1.0 functions. So check for individual + # functions. +- for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free ++ for ac_func in OPENSSL_init_ssl BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +diff --git a/configure.ac b/configure.ac +index 44868ba..77e59a2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1347,7 +1347,7 @@ if test "$with_ssl" = openssl ; then + # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it + # doesn't have these OpenSSL 1.1.0 functions. So check for individual + # functions. +- AC_CHECK_FUNCS([OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free]) ++ AC_CHECK_FUNCS([OPENSSL_init_ssl BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free]) + # OpenSSL versions before 1.1.0 required setting callback functions, for + # thread-safety. In 1.1.0, it's no longer required, and CRYPTO_lock() + # function was removed. +diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c +index 8f9b81c..9abee50 100644 +--- a/src/backend/libpq/be-secure-openssl.c ++++ b/src/backend/libpq/be-secure-openssl.c +@@ -830,11 +830,6 @@ be_tls_write(Port *port, void *ptr, size_t len, int *waitfor) + * to retry; do we need to adopt their logic for that? + */ + +-#ifndef HAVE_BIO_GET_DATA +-#define BIO_get_data(bio) (bio->ptr) +-#define BIO_set_data(bio, data) (bio->ptr = data) +-#endif +- + static BIO_METHOD *my_bio_methods = NULL; + + static int +@@ -844,7 +839,7 @@ my_sock_read(BIO *h, char *buf, int size) + + if (buf != NULL) + { +- res = secure_raw_read(((Port *) BIO_get_data(h)), buf, size); ++ res = secure_raw_read(((Port *) BIO_get_app_data(h)), buf, size); + BIO_clear_retry_flags(h); + if (res <= 0) + { +@@ -864,7 +859,7 @@ my_sock_write(BIO *h, const char *buf, int size) + { + int res = 0; + +- res = secure_raw_write(((Port *) BIO_get_data(h)), buf, size); ++ res = secure_raw_write(((Port *) BIO_get_app_data(h)), buf, size); + BIO_clear_retry_flags(h); + if (res <= 0) + { +@@ -940,7 +935,7 @@ my_SSL_set_fd(Port *port, int fd) + SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); + goto err; + } +- BIO_set_data(bio, port); ++ BIO_set_app_data(bio, port); + + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set_bio(port->ssl, bio, bio); +diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in +index d09e9f9..768e3d7 100644 +--- a/src/include/pg_config.h.in ++++ b/src/include/pg_config.h.in +@@ -77,9 +77,6 @@ + /* Define to 1 if you have the `backtrace_symbols' function. */ + #undef HAVE_BACKTRACE_SYMBOLS + +-/* Define to 1 if you have the `BIO_get_data' function. */ +-#undef HAVE_BIO_GET_DATA +- + /* Define to 1 if you have the `BIO_meth_new' function. */ + #undef HAVE_BIO_METH_NEW + +diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c +index af59ff4..8d68d02 100644 +--- a/src/interfaces/libpq/fe-secure-openssl.c ++++ b/src/interfaces/libpq/fe-secure-openssl.c +@@ -1800,11 +1800,6 @@ PQsslAttribute(PGconn *conn, const char *attribute_name) + * to retry; do we need to adopt their logic for that? + */ + +-#ifndef HAVE_BIO_GET_DATA +-#define BIO_get_data(bio) (bio->ptr) +-#define BIO_set_data(bio, data) (bio->ptr = data) +-#endif +- + static BIO_METHOD *my_bio_methods; + + static int +@@ -1812,7 +1807,7 @@ my_sock_read(BIO *h, char *buf, int size) + { + int res; + +- res = pqsecure_raw_read((PGconn *) BIO_get_data(h), buf, size); ++ res = pqsecure_raw_read((PGconn *) BIO_get_app_data(h), buf, size); + BIO_clear_retry_flags(h); + if (res < 0) + { +@@ -1842,7 +1837,7 @@ my_sock_write(BIO *h, const char *buf, int size) + { + int res; + +- res = pqsecure_raw_write((PGconn *) BIO_get_data(h), buf, size); ++ res = pqsecure_raw_write((PGconn *) BIO_get_app_data(h), buf, size); + BIO_clear_retry_flags(h); + if (res < 0) + { +@@ -1933,7 +1928,7 @@ my_SSL_set_fd(PGconn *conn, int fd) + SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); + goto err; + } +- BIO_set_data(bio, conn); ++ BIO_set_app_data(bio, conn); + + SSL_set_bio(conn->ssl, bio, bio); + BIO_set_fd(bio, fd, BIO_NOCLOSE); +diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm +index 790f03b..a53239f 100644 +--- a/src/tools/msvc/Solution.pm ++++ b/src/tools/msvc/Solution.pm +@@ -226,7 +226,6 @@ sub GenerateFiles + HAVE_ATOMICS => 1, + HAVE_ATOMIC_H => undef, + HAVE_BACKTRACE_SYMBOLS => undef, +- HAVE_BIO_GET_DATA => undef, + HAVE_BIO_METH_NEW => undef, + HAVE_CLOCK_GETTIME => undef, + HAVE_COMPUTED_GOTO => undef, +@@ -566,7 +565,6 @@ sub GenerateFiles + || ($digit1 >= '1' && $digit2 >= '1' && $digit3 >= '0')) + { + $define{HAVE_ASN1_STRING_GET0_DATA} = 1; +- $define{HAVE_BIO_GET_DATA} = 1; + $define{HAVE_BIO_METH_NEW} = 1; + $define{HAVE_HMAC_CTX_FREE} = 1; + $define{HAVE_HMAC_CTX_NEW} = 1; +-- +Tristan Partin +Neon (https://neon.tech) + diff --git a/recipes/libpq/all/patches/16/001-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/16/001-mingw-build-static-libraries.patch new file mode 100644 index 0000000000000..60efd57c37011 --- /dev/null +++ b/recipes/libpq/all/patches/16/001-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -323,7 +323,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 +@@ -336,12 +339,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') + +@@ -418,6 +421,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 \ No newline at end of file diff --git a/recipes/libpq/all/patches/9.6/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/9.6/002-mingw-build-static-libraries.patch deleted file mode 100644 index c81e02bd78f53..0000000000000 --- a/recipes/libpq/all/patches/9.6/002-mingw-build-static-libraries.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -384,7 +384,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 -@@ -397,12 +400,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 -@@ -505,6 +508,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/test_v1_package/CMakeLists.txt b/recipes/libpq/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2f11d9b196ef7..0000000000000 --- a/recipes/libpq/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -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/libpq/all/test_v1_package/conanfile.py b/recipes/libpq/all/test_v1_package/conanfile.py deleted file mode 100644 index 5f9efeb33878b..0000000000000 --- a/recipes/libpq/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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" - - 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/libpq/config.yml b/recipes/libpq/config.yml index e010db029229d..9134fb862acf3 100644 --- a/recipes/libpq/config.yml +++ b/recipes/libpq/config.yml @@ -1,17 +1,13 @@ versions: - "15.4": - folder: all - "15.3": - folder: all - "14.9": + "16.8": folder: all - "13.12": + "15.12": folder: all - "12.16": + "15.5": folder: all - "11.21": + "15.4": folder: all - "10.23": + "15.3": folder: all - "9.6.24": + "14.9": folder: all diff --git a/recipes/libpqxx/all/conandata.yml b/recipes/libpqxx/all/conandata.yml index dcbdf0b15a551..6a8ab2fbd1912 100644 --- a/recipes/libpqxx/all/conandata.yml +++ b/recipes/libpqxx/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "7.10.1": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.10.1.tar.gz" + sha256: "cfbbb1d93a0a3d81319ec71d9a3db80447bb033c4f6cee088554a88862fd77d7" + "7.10.0": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.10.0.tar.gz" + sha256: "d588bca36357eda8bcafd5bc1f95df1afe613fdc70c80e426fc89eecb828fc3e" + "7.9.2": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.9.2.tar.gz" + sha256: "e37d5774c39f6c802e32d7f418e88b8e530404fb54758516e884fc0ebdee6da4" + "7.9.1": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.9.1.tar.gz" + sha256: "4fafd63009b1d6c2b64b8c184c04ae4d1f7aa99d8585154832d28012bae5b0b6" + "7.9.0": + url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.9.0.tar.gz" + sha256: "a1fafd5f6455f6c66241fca1f35f5cb603251580b99f9a0cf1b5d0a586006f16" "7.8.1": url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.8.1.tar.gz" sha256: "0f4c0762de45a415c9fd7357ce508666fa88b9a4a463f5fb76c235bc80dd6a84" @@ -24,6 +39,29 @@ sources: url: "https://github.com/jtv/libpqxx/archive/6.4.8.tar.gz" sha256: "3f7aba951822e01f1b9f9f353702954773323dd9f9dc376ffb57cb6bbd9a7a2f" patches: + "7.10.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/remove-get-target-property-to-get-postgresql_include_dirs.patch" + patch_description: "Fix a bug `get_target_property` to get `PostgreSQL_INCLUDE_DIRS`" + patch_type: "bugfix" + "7.10.0": + - patch_file: "patches/0001-cmake-fix-module.patch" + patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." + patch_type: "conan" + "7.9.2": + - patch_file: "patches/0001-cmake-fix-module.patch" + patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." + patch_type: "conan" + "7.9.1": + - patch_file: "patches/0001-cmake-fix-module.patch" + patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." + patch_type: "conan" + "7.9.0": + - patch_file: "patches/0001-cmake-fix-module.patch" + patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." + patch_type: "conan" "7.8.1": - patch_file: "patches/0001-cmake-fix-module.patch" patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." diff --git a/recipes/libpqxx/all/patches/remove-get-target-property-to-get-postgresql_include_dirs.patch b/recipes/libpqxx/all/patches/remove-get-target-property-to-get-postgresql_include_dirs.patch new file mode 100644 index 0000000000000..9c96ec4cb69ba --- /dev/null +++ b/recipes/libpqxx/all/patches/remove-get-target-property-to-get-postgresql_include_dirs.patch @@ -0,0 +1,13 @@ +Fix a bug get_target_property(PostgreSQL_INCLUDE_DIRS PostgreSQL::PostgreSQL) does not working (https://github.com/jtv/libpqxx/pull/981) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 174f1414..d5f7be08 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -18,7 +18,6 @@ endif() + # happens to contain autoconf-generated config headers, we should still prefer + # the ones in the binary tree. + macro(library_target_setup tgt) +- get_target_property (PostgreSQL_INCLUDE_DIRS PostgreSQL::PostgreSQL INTERFACE_INCLUDE_DIRECTORIES) + target_include_directories(${tgt} + PUBLIC + $ diff --git a/recipes/libpqxx/all/test_package/CMakeLists.txt b/recipes/libpqxx/all/test_package/CMakeLists.txt index e27c585fd702f..dde722c7091e8 100644 --- a/recipes/libpqxx/all/test_package/CMakeLists.txt +++ b/recipes/libpqxx/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) # Set `-mmacosx-version-min` to enable C++17 standard library support. set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version") diff --git a/recipes/libpqxx/all/test_v1_package/CMakeLists.txt b/recipes/libpqxx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libpqxx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libpqxx/all/test_v1_package/conanfile.py b/recipes/libpqxx/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/libpqxx/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/libpqxx/config.yml b/recipes/libpqxx/config.yml index 9d72f7f742ccb..5ffb731fd9619 100644 --- a/recipes/libpqxx/config.yml +++ b/recipes/libpqxx/config.yml @@ -1,4 +1,14 @@ versions: + "7.10.1": + folder: all + "7.10.0": + folder: all + "7.9.2": + folder: all + "7.9.1": + folder: all + "7.9.0": + folder: all "7.8.1": folder: all "7.8.0": diff --git a/recipes/libproperties/all/test_v1_package/CMakeLists.txt b/recipes/libproperties/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libproperties/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 5a71089bfc92a..0000000000000 --- a/recipes/libproperties/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/libprotobuf-mutator/all/CMakeLists.txt b/recipes/libprotobuf-mutator/all/CMakeLists.txt index 694038520f556..54f184da6c63a 100644 --- a/recipes/libprotobuf-mutator/all/CMakeLists.txt +++ b/recipes/libprotobuf-mutator/all/CMakeLists.txt @@ -1,13 +1,9 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper CXX) -include(conanbuildinfo.cmake) -conan_basic_setup() +find_package(Protobuf REQUIRED) +find_package(absl CONFIG REQUIRED) -add_subdirectory(source_subfolder) +add_subdirectory(src) -if(MSVC) - # Should be added because of - # https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initonceexecuteonce - add_definitions(-D_WIN32_WINNT=0x0600) -endif() +target_link_libraries(protobuf-mutator PUBLIC protobuf::libprotobuf absl::strings) diff --git a/recipes/libprotobuf-mutator/all/conandata.yml b/recipes/libprotobuf-mutator/all/conandata.yml index 813688d3f74a5..1152bb8579584 100644 --- a/recipes/libprotobuf-mutator/all/conandata.yml +++ b/recipes/libprotobuf-mutator/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "cci.20210831": - url: "https://github.com/google/libprotobuf-mutator/archive/ffd86a32874e5c08a143019aad1aaf0907294c9f.zip" - sha256: "14f595863452808483776ce1964209db00cdac79e649b31eb4d4b06ca72912d8" + "1.3": + url: "https://github.com/google/libprotobuf-mutator/archive/refs/tags/v1.3.tar.gz" + sha256: "1ee3473a6b0274494fce599539605bb19305c0efadc62b58d645812132c31baa" diff --git a/recipes/libprotobuf-mutator/all/conanfile.py b/recipes/libprotobuf-mutator/all/conanfile.py index f0419a2397845..b03de6dbf5696 100644 --- a/recipes/libprotobuf-mutator/all/conanfile.py +++ b/recipes/libprotobuf-mutator/all/conanfile.py @@ -1,8 +1,14 @@ -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 copy, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.env import VirtualBuildEnv +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.54.0" class LibProtobufMutatorConan(ConanFile): @@ -13,76 +19,117 @@ class LibProtobufMutatorConan(ConanFile): description = "A library to randomly mutate protobuffers." topics = ("test", "fuzzing", "protobuf") settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - exports_sources = ["CMakeLists.txt"] - - _cmake = None + package_type = "library" + 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 14 @property - def _build_subfolder(self): - return "build_subfolder" + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "5", + "msvc": "191", + "Visual Studio": "15", + } + + 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.get_safe("shared"): + self.options.rm_safe("fPIC") + if is_msvc(self): + self.options.rm_safe("shared") + self.package_type = "static-library" + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("protobuf/3.17.1") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + # Protobuf headers are required by public src/binary_format.h and + self.requires("protobuf/4.25.3", transitive_headers=True) + # Abseil headers are required by public src/field_instance.h + self.requires("abseil/20240116.2") def validate(self): - if self.settings.compiler != "clang": - raise ConanInvalidConfiguration("Only clang allowed") - if self.settings.compiler.libcxx != "libstdc++11": - raise ConanInvalidConfiguration("Requires either compiler.libcxx=libstdc++11") if self.settings.compiler.cppstd: - tools.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 build_requirements(self): + self.tool_requires("cmake/[>=3.24 <4]") + + def source(self): + 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, 'CMakeLists.txt'), - """include_directories(${PROTOBUF_INCLUDE_DIRS})""", - """include_directories(${protobuf_INCLUDE_DIRS})""") - tools.replace_in_file( - os.path.join(self._source_subfolder, 'CMakeLists.txt'), - """set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/external)""", - """# (disabled by conan) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/external)""") - tools.replace_in_file( - os.path.join(self._source_subfolder, 'CMakeLists.txt'), - """add_subdirectory(examples EXCLUDE_FROM_ALL)""", - """# (disabled by conan) add_subdirectory(examples EXCLUDE_FROM_ALL)""") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["LIB_PROTO_MUTATOR_TESTING"] = "OFF" - self._cmake.definitions["LIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF"] = "OFF" - self._cmake.definitions["LIB_PROTO_MUTATOR_WITH_ASAN"] = "OFF" - self._cmake.definitions["LIB_PROTO_MUTATOR_FUZZER_LIBRARIES"] = "" - # todo: check option(LIB_PROTO_MUTATOR_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + # Preserves Conan as dependency manager + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/external)", + "", + ) + # Fix libprotobuf-mutator.pc installation origin path + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "${CMAKE_BINARY_DIR}/libprotobuf-mutator.pc", + "${CMAKE_CURRENT_BINARY_DIR}/libprotobuf-mutator.pc", + ) + # Do not include examples when running CMake configure to avoid more dependencies + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_subdirectory(examples EXCLUDE_FROM_ALL)", + "", + ) + + def generate(self): + tc = VirtualBuildEnv(self) + tc.generate() + tc = CMakeToolchain(self) + tc.variables["LIB_PROTO_MUTATOR_TESTING"] = False + tc.variables["LIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF"] = False + tc.variables["LIB_PROTO_MUTATOR_WITH_ASAN"] = False + tc.variables["PKG_CONFIG_PATH"] = "share" + if is_msvc(self): + tc.variables["LIB_PROTO_MUTATOR_MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + 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, 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", 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, "OFF")) - tools.rmdir(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, "lib", "cmake")) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "libprotobuf-mutator" - self.cpp_info.names["cmake_find_package_multi"] = "libprotobuf-mutator" - - self.cpp_info.libs = ['protobuf-mutator-libfuzzer', 'protobuf-mutator'] - self.cpp_info.includedirs.append(os.path.join("include", "libprotobuf-mutator")) + self.cpp_info.components["mutator"].libs = ["protobuf-mutator"] + self.cpp_info.components["mutator"].set_property("cmake_target_name", "libprotobuf-mutator::protobuf-mutator") + self.cpp_info.components["mutator"].includedirs.append("include/libprotobuf-mutator") + self.cpp_info.components["mutator"].requires = ["protobuf::libprotobuf", "abseil::absl_strings"] + + self.cpp_info.components["fuzzer"].libs = ['protobuf-mutator-libfuzzer'] + self.cpp_info.components["fuzzer"].set_property("cmake_target_name", "libprotobuf-mutator::protobuf-mutator-libfuzzer") + self.cpp_info.components["fuzzer"].includedirs.append("include/libprotobuf-mutator") + self.cpp_info.components["fuzzer"].requires = ["mutator", "protobuf::libprotobuf"] diff --git a/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt b/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt index 00520b9489805..70a0e97ac972f 100644 --- a/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt +++ b/recipes/libprotobuf-mutator/all/test_package/CMakeLists.txt @@ -1,19 +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(TARGETS) find_package(libprotobuf-mutator REQUIRED CONFIG) - -protobuf_generate_cpp( - MSG_PROTO_SRCS - MSG_PROTO_HDRS - msg.proto -) - - -add_executable(${PROJECT_NAME} ${MSG_PROTO_SRCS} test_package.cpp) -target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(${PROJECT_NAME} libprotobuf-mutator::libprotobuf-mutator) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libprotobuf-mutator::protobuf-mutator libprotobuf-mutator::protobuf-mutator-libfuzzer) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/libprotobuf-mutator/all/test_package/conanfile.py b/recipes/libprotobuf-mutator/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/libprotobuf-mutator/all/test_package/conanfile.py +++ b/recipes/libprotobuf-mutator/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/libprotobuf-mutator/all/test_package/msg.proto b/recipes/libprotobuf-mutator/all/test_package/msg.proto deleted file mode 100644 index cb25c9d008352..0000000000000 --- a/recipes/libprotobuf-mutator/all/test_package/msg.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto2"; -package libfuzzer_example; - -import "google/protobuf/any.proto"; - -message Msg { - optional float optional_float = 1; - optional uint64 optional_uint64 = 2; - optional string optional_string = 3; - optional google.protobuf.Any any = 4; -} diff --git a/recipes/libprotobuf-mutator/all/test_package/test_package.cpp b/recipes/libprotobuf-mutator/all/test_package/test_package.cpp index c169f66031176..f7273ed21de60 100644 --- a/recipes/libprotobuf-mutator/all/test_package/test_package.cpp +++ b/recipes/libprotobuf-mutator/all/test_package/test_package.cpp @@ -1,23 +1,11 @@ -#include -#include +#include -#include "msg.pb.h" -#include +#include -DEFINE_PROTO_FUZZER(const libfuzzer_example::Msg& message) { - protobuf_mutator::protobuf::FileDescriptorProto file; - - // Emulate a bug. - if (message.optional_uint64() == std::hash{}(message.optional_string()) && - message.optional_string() == "abcdefghijklmnopqrstuvwxyz" && - !std::isnan(message.optional_float()) && - std::fabs(message.optional_float()) > 1000 && - message.any().UnpackTo(&file) && !file.name().empty()) - { - std::cerr << message.DebugString() << "\n"; - } -} int main() { - return 0; + protobuf_mutator::Mutator mutator{}; + const auto seed_value{42}; + mutator.Seed(seed_value); + return EXIT_SUCCESS; } diff --git a/recipes/libprotobuf-mutator/config.yml b/recipes/libprotobuf-mutator/config.yml index 9d5b0e4c50569..d2eb4ed4a511f 100644 --- a/recipes/libprotobuf-mutator/config.yml +++ b/recipes/libprotobuf-mutator/config.yml @@ -1,3 +1,3 @@ versions: - "cci.20210831": + "1.3": folder: all diff --git a/recipes/libpsl/all/conandata.yml b/recipes/libpsl/all/conandata.yml index 0f43ba25d532c..e5c0466a70cd9 100644 --- a/recipes/libpsl/all/conandata.yml +++ b/recipes/libpsl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.21.5": + url: "https://github.com/rockdaboot/libpsl/releases/download/0.21.5/libpsl-0.21.5.tar.gz" + sha256: "1dcc9ceae8b128f3c0b3f654decd0e1e891afc6ff81098f227ef260449dae208" "0.21.1": url: "https://github.com/rockdaboot/libpsl/releases/download/0.21.1/libpsl-0.21.1.tar.gz" sha256: "ac6ce1e1fbd4d0254c4ddb9d37f1fa99dec83619c1253328155206b896210d4c" diff --git a/recipes/libpsl/all/conanfile.py b/recipes/libpsl/all/conanfile.py index 0de3f9766ed38..cb6be159c755e 100644 --- a/recipes/libpsl/all/conanfile.py +++ b/recipes/libpsl/all/conanfile.py @@ -1,13 +1,14 @@ +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 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 +from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class LibPslConan(ConanFile): @@ -48,18 +49,18 @@ def layout(self): def requirements(self): if self.options.with_idna == "icu": - self.requires("icu/73.2") + self.requires("icu/74.1") elif self.options.with_idna == "libidn": self.requires("libidn/1.36") elif self.options.with_idna == "libidn2": self.requires("libidn2/2.3.0") if self.options.with_idna in ("libidn", "libidn2"): - self.requires("libunistring/0.9.10") + self.requires("libunistring/1.1") def build_requirements(self): - self.tool_requires("meson/1.2.1") + self.tool_requires("meson/[>=1.2.3 <2]") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2.0 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -72,11 +73,15 @@ def _idna_option(self): }.get(str(self.options.with_idna), str(self.options.with_idna)) def generate(self): - env = VirtualBuildEnv(self) - env.generate() tc = MesonToolchain(self) tc.project_options["runtime"] = self._idna_option - tc.project_options["builtin"] = self._idna_option + if Version(self.version) >= "0.21.5": + tc.project_options["builtin"] = "true" if self.options.with_idna else "false" + tc.project_options["tests"] = "false" # disable tests and fuzzes + else: + tc.project_options["builtin"] = self._idna_option + if not self.options.shared: + tc.preprocessor_definitions["PSL_STATIC"] = "1" tc.generate() deps = PkgConfigDeps(self) deps.generate() @@ -94,6 +99,7 @@ def package(self): meson.install() rm(self, "*.pdb", 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")) fix_apple_shared_install_name(self) fix_msvc_libname(self) diff --git a/recipes/libpsl/all/test_package/CMakeLists.txt b/recipes/libpsl/all/test_package/CMakeLists.txt index cd12a8bc8d580..5190885e663d2 100644 --- a/recipes/libpsl/all/test_package/CMakeLists.txt +++ b/recipes/libpsl/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(libpsl REQUIRED CONFIG) diff --git a/recipes/libpsl/all/test_v1_package/CMakeLists.txt b/recipes/libpsl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libpsl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libpsl/all/test_v1_package/conanfile.py b/recipes/libpsl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libpsl/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_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/libpsl/config.yml b/recipes/libpsl/config.yml index 079bf2c67f869..00068fd9ad17d 100644 --- a/recipes/libpsl/config.yml +++ b/recipes/libpsl/config.yml @@ -1,3 +1,5 @@ versions: + "0.21.5": + folder: "all" "0.21.1": folder: "all" diff --git a/recipes/libq/all/conandata.yml b/recipes/libq/all/conandata.yml new file mode 100644 index 0000000000000..10ff9b4c84e7a --- /dev/null +++ b/recipes/libq/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.0.0.cci.20180504": + url: "https://github.com/grantila/q/archive/0117848bb3e6f0b130b546bc5851caf5f95f8b7e.zip" + sha256: "f5e51c1abbbec8e6da2155740917d7f1f60628745363ebd4e2aadfd7ef2ff682" +patches: + "0.0.0.cci.20180504": + - patch_file: "patches/0001-cmake-remove-hardcoded-flags.patch" + patch_description: "Remove hardcoded flags from CMakeLists.txt" + patch_type: "conan" diff --git a/recipes/libq/all/conanfile.py b/recipes/libq/all/conanfile.py new file mode 100644 index 0000000000000..b6fe5082c71c6 --- /dev/null +++ b/recipes/libq/all/conanfile.py @@ -0,0 +1,90 @@ +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, rm, rmdir, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc +from conan.tools.apple import fix_apple_shared_install_name + +required_conan_version = ">=2.1" + +class libqConan(ConanFile): + name = "libq" + description = "A platform-independent promise library for C++, implementing asynchronous continuations." + license = "Apache-2.0" + topics = ("async", "promises") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/grantila/q" + settings = "os", "compiler", "build_type", "arch" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + implements = ["auto_shared_fpic"] + + def layout(self): + cmake_layout(self, src_folder="src") + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.settings.os == "Windows": + self.package_type = "static-library" + del self.options.shared + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + + def validate(self): + check_min_cppstd(self, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["q_BUILD_TESTS"] = False + tc.variables["q_BUILD_APPS"] = False + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + fix_apple_shared_install_name(self) + + 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): + suffix = "" + if is_msvc(self) and self.settings.build_type == "Debug": + suffix = "d" + self.cpp_info.libs = ["q" + suffix] + self.cpp_info.set_property("cmake_file_name", "libq") + self.cpp_info.set_property("cmake_target_name", "libq::libq") + + 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 is_msvc(self): + self.cpp_info.cxxflags.append("/bigobj") diff --git a/recipes/libq/all/patches/0001-cmake-remove-hardcoded-flags.patch b/recipes/libq/all/patches/0001-cmake-remove-hardcoded-flags.patch new file mode 100644 index 0000000000000..228613f851cb1 --- /dev/null +++ b/recipes/libq/all/patches/0001-cmake-remove-hardcoded-flags.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/compilersetup.cmake b/cmake/compilersetup.cmake +index e550442..8ee19f7 100644 +--- a/cmake/compilersetup.cmake ++++ b/cmake/compilersetup.cmake +@@ -15,7 +15,6 @@ set( CMAKE_CXX_EXTENSIONS OFF ) + if ( CMAKE_CXX_COMPILER_ID MATCHES "GNU" ) + + if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9 ) +- set( CMAKE_CXX_FLAGS "-std=c++11 -Wall -pipe -pthread" ) + endif ( ) + + if ( NOT CMAKE_CXX_FLAGS ) +@@ -82,9 +81,6 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" ) + set( CMAKE_DEBUG_POSTFIX "d" ) + add_definitions( "/bigobj" ) + +- set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd" ) +- set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT" ) +- + else ( ) + + q_warning( "untested compiler: ${CMAKE_CXX_COMPILER}" ) diff --git a/recipes/libq/all/test_package/CMakeLists.txt b/recipes/libq/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..72178581766a4 --- /dev/null +++ b/recipes/libq/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(libq REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE libq::libq) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/libq/all/test_package/conanfile.py b/recipes/libq/all/test_package/conanfile.py new file mode 100644 index 0000000000000..02eb5ce439fb4 --- /dev/null +++ b/recipes/libq/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/libq/all/test_package/test_package.cpp b/recipes/libq/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..52347690f10f3 --- /dev/null +++ b/recipes/libq/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include +#include + + +int main(void) { + q::initialize(); + std::cout << "q initialized correctly" << std::endl; + q::uninitialize(); + return EXIT_SUCCESS; +} diff --git a/recipes/libq/config.yml b/recipes/libq/config.yml new file mode 100644 index 0000000000000..209de68dc5235 --- /dev/null +++ b/recipes/libq/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.0.cci.20180504": + folder: all diff --git a/recipes/libqasm/all/conandata.yml b/recipes/libqasm/all/conandata.yml new file mode 100644 index 0000000000000..e1c805df26247 --- /dev/null +++ b/recipes/libqasm/all/conandata.yml @@ -0,0 +1,25 @@ +sources: + "1.2.0": + url: "https://github.com/QuTech-Delft/libqasm/releases/download/1.2.0/libqasm-1.2.0.tar.gz" + sha256: "9142085d3782c8b2094f66cf1fc3719040dfadc62f55ab722636fca109e27c20" + "1.1.0": + url: "https://github.com/QuTech-Delft/libqasm/releases/download/1.1.0/libqasm-1.1.0.tar.gz" + sha256: "cf317c465e741360ae147e46346c57294c23882269e3b3dabb3c5d5ac703414a" + "1.0.0": + url: "https://github.com/QuTech-Delft/libqasm/releases/download/1.0.0/libqasm-1.0.0.tar.gz" + sha256: "22968e2892194e69ca3cea9f4655c2f51470aae60d9e7dbd662136eb4088c984" + "0.6.9": + url: "https://github.com/QuTech-Delft/libqasm/releases/download/0.6.9/libqasm-0.6.9.tar.gz" + sha256: "23c5d0e4e506e1974668408f8018034d1b1303e65c6d2d28639eae9499759c4d" + "0.6.8": + url: "https://github.com/QuTech-Delft/libqasm/releases/download/0.6.8/libqasm-0.6.8.tar.gz" + sha256: "b98ff44f0c569a0cc20b3728ba7d4711299aaac07d4dadfe52e638b366b91251" + "0.6.7": + url: "https://github.com/QuTech-Delft/libqasm/releases/download/0.6.7/libqasm-0.6.7.tar.gz" + sha256: "3e85be4f433b178b89e32bc738bd4f69266cd1c4ad0ed12b5367381ac6e44eb2" + "0.6.6": + url: "https://github.com/QuTech-Delft/libqasm/releases/download/0.6.6/libqasm-0.6.6.tar.gz" + sha256: "b3a2d1670f8865ce22bcc62c6a696ee7e0764a7b76901a4f082efa2287e0cbad" + "0.6.5": + url: "https://github.com/QuTech-Delft/libqasm/releases/download/0.6.5/libqasm-0.6.5.tar.gz" + sha256: "0577622a512d1f64892949af02abe3d0b53195ad454045715a0ebf837ecde0d6" diff --git a/recipes/libqasm/all/conanfile.py b/recipes/libqasm/all/conanfile.py new file mode 100644 index 0000000000000..142f8f4210203 --- /dev/null +++ b/recipes/libqasm/all/conanfile.py @@ -0,0 +1,131 @@ +import os + +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 CMakeToolchain, CMakeDeps, CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.60.0 <2 || >=2.0.6" + + +class LibqasmConan(ConanFile): + name = "libqasm" + license = "Apache-2.0" + homepage = "https://github.com/QuTech-Delft/libqasm" + url = "https://github.com/conan-io/conan-center-index" + description = "Library to parse cQASM files" + topics = ("code generation", "parser", "compiler", "quantum compilation", "quantum simulation") + settings = "os", "compiler", "build_type", "arch" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_python": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "build_python": False + } + + @property + def _should_build_test(self): + return not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + "clang": "13", + "apple-clang": "14", + "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") + if self.settings.arch == "wasm": + self.options["antlr4-cppruntime"].shared = self.options.shared + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("tree-gen/") + self.tool_requires("zulu-openjdk/21.0.1") + if self.settings.arch == "wasm": + self.tool_requires("emsdk/3.1.50") + if self._should_build_test: + self.test_requires("gtest/1.15.0") + if self.options.build_python: + self.tool_requires("cpython/3.12.2") + + 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}," + f"which your compiler does not support.") + + if self.settings.arch != "wasm" and self.dependencies["antlr4-cppruntime"].options.shared != self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} requires antlr4-cppruntime to be built with the same shared option value.") + + def requirements(self): + if Version(self.version) < "0.6.7": + self.requires("fmt/10.2.1", transitive_headers=True) + self.requires("tree-gen/1.0.7", transitive_headers=True, transitive_libs=True) + else: + self.requires("fmt/11.0.2", transitive_headers=True) + self.requires("tree-gen/1.0.8", transitive_headers=True, transitive_libs=True) + self.requires("range-v3/0.12.0", transitive_headers=True) + if not self.settings.arch == "wasm": + self.requires("antlr4-cppruntime/4.13.1", transitive_headers=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.variables["LIBQASM_BUILD_PYTHON"] = self.options.build_python + tc.variables["LIBQASM_BUILD_TESTS"] = self._should_build_test + tc.generate() + env = VirtualBuildEnv(self) + env.generate() + + def _patch_sources(self): + werror = "/WX" if is_msvc(self) else "-Werror" + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), werror, "") + replace_in_file(self, os.path.join(self.source_folder, "test", "CMakeLists.txt"), werror, "") + + def build(self): + self._patch_sources() + 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() + fix_apple_shared_install_name(self) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.libs = ["cqasm"] diff --git a/recipes/libqasm/all/test_package/CMakeLists.txt b/recipes/libqasm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..528ff39eb1365 --- /dev/null +++ b/recipes/libqasm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(libqasm REQUIRED CONFIG) + +add_executable(test_package "${CMAKE_CURRENT_SOURCE_DIR}/src/test_package.cpp") +target_compile_features(test_package PRIVATE cxx_std_20) +target_link_libraries(test_package PRIVATE libqasm::libqasm) diff --git a/recipes/libqasm/all/test_package/conanfile.py b/recipes/libqasm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6ad8a48ce8086 --- /dev/null +++ b/recipes/libqasm/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 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 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.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/libqasm/all/test_package/src/test_package.cpp b/recipes/libqasm/all/test_package/src/test_package.cpp new file mode 100644 index 0000000000000..07ad803c4364b --- /dev/null +++ b/recipes/libqasm/all/test_package/src/test_package.cpp @@ -0,0 +1,13 @@ +#if __has_include("cqasm.hpp") +#include "cqasm.hpp" +#else +#include "libqasm/cqasm.hpp" +#endif + +#include + +int main() { + auto analyzer = cqasm::v3x::default_analyzer(); + auto result = analyzer.analyze_string("version 3.0; qubit[2] q; H q[0]; CNOT q[0], q[1]; measure q", ""); + std::cout << result.to_json(); +} diff --git a/recipes/libqasm/config.yml b/recipes/libqasm/config.yml new file mode 100644 index 0000000000000..d160c5ccf363a --- /dev/null +++ b/recipes/libqasm/config.yml @@ -0,0 +1,17 @@ +versions: + "1.2.0": + folder: all + "1.1.0": + folder: all + "1.0.0": + folder: all + "0.6.9": + folder: all + "0.6.8": + folder: all + "0.6.7": + folder: all + "0.6.6": + folder: all + "0.6.5": + folder: all diff --git a/recipes/libqrencode/all/test_package/CMakeLists.txt b/recipes/libqrencode/all/test_package/CMakeLists.txt index dcb9df3c597be..b6084d2a82c23 100644 --- a/recipes/libqrencode/all/test_package/CMakeLists.txt +++ b/recipes/libqrencode/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(libqrencode REQUIRED CONFIG) diff --git a/recipes/libqrencode/all/test_v1_package/CMakeLists.txt b/recipes/libqrencode/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libqrencode/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libqrencode/all/test_v1_package/conanfile.py b/recipes/libqrencode/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libqrencode/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_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/librasterlite/all/conanfile.py b/recipes/librasterlite/all/conanfile.py index f454426605362..faa36df9309f0 100644 --- a/recipes/librasterlite/all/conanfile.py +++ b/recipes/librasterlite/all/conanfile.py @@ -55,16 +55,16 @@ def layout(self): def requirements(self): self.requires("libgeotiff/1.7.1") self.requires("libjpeg/9e") - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") self.requires("libspatialite/5.0.1") - self.requires("libtiff/4.5.1") - self.requires("sqlite3/3.42.0") + self.requires("libtiff/[>=4.5 <5]") + self.requires("sqlite3/[>=3.42 <4]") 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.2 <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/librasterlite/all/test_package/CMakeLists.txt b/recipes/librasterlite/all/test_package/CMakeLists.txt index 5678137a1cf88..b60f34c44f76e 100644 --- a/recipes/librasterlite/all/test_package/CMakeLists.txt +++ b/recipes/librasterlite/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(librasterlite REQUIRED CONFIG) diff --git a/recipes/librasterlite/all/test_package/conanfile.py b/recipes/librasterlite/all/test_package/conanfile.py index 0a6bc68712d90..61ab389c60763 100644 --- a/recipes/librasterlite/all/test_package/conanfile.py +++ b/recipes/librasterlite/all/test_package/conanfile.py @@ -14,6 +14,7 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + self.requires("sqlite3/[*]") #the upstream headers dont include sqlite3.h, so consumer has to def build(self): cmake = CMake(self) diff --git a/recipes/librasterlite/all/test_package/test_package.c b/recipes/librasterlite/all/test_package/test_package.c index 0ec59df2a0ee7..d29dad7b1473e 100644 --- a/recipes/librasterlite/all/test_package/test_package.c +++ b/recipes/librasterlite/all/test_package/test_package.c @@ -1,4 +1,4 @@ -#include +#include // rasterlite.h references things defined in sqlite3.h, but does not include it #include #include diff --git a/recipes/librasterlite/all/test_v1_package/CMakeLists.txt b/recipes/librasterlite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/librasterlite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/librasterlite/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_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 91ae265228d72..ab977b62a3236 100644 --- a/recipes/librasterlite2/all/conanfile.py +++ b/recipes/librasterlite2/all/conanfile.py @@ -78,7 +78,7 @@ def requirements(self): self.requires("libspatialite/5.0.1") self.requires("libtiff/4.5.1") self.requires("libxml2/2.11.4") - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/[>=3.42 <4]") self.requires("zlib/1.2.13") if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") diff --git a/recipes/librasterlite2/all/test_package/CMakeLists.txt b/recipes/librasterlite2/all/test_package/CMakeLists.txt index 8c3dd28e2bff3..e3ffb5abf91b0 100644 --- a/recipes/librasterlite2/all/test_package/CMakeLists.txt +++ b/recipes/librasterlite2/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/libraw/all/CMakeLists.txt b/recipes/libraw/all/CMakeLists.txt index 867dedb15eb72..f6b105c027f9d 100644 --- a/recipes/libraw/all/CMakeLists.txt +++ b/recipes/libraw/all/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.8) project(LibRaw LANGUAGES CXX) +option(LIBRAW_BUILD_THREAD_SAFE "Build raw_r library with -pthread enabled" OFF) option(LIBRAW_WITH_JPEG "Build with libjpeg" ON) option(LIBRAW_WITH_LCMS "Build with LCMS" ON) option(LIBRAW_WITH_JASPER "Build with Jasper" ON) @@ -32,33 +33,47 @@ if(LIBRAW_WITH_JASPER) endif() add_library(raw ${libraw_LIB_SRCS}) -target_compile_features(raw PRIVATE cxx_std_11) +target_compile_features(raw PUBLIC cxx_std_11) target_include_directories(raw PUBLIC "${LIBRAW_SRC_DIR}") if(WIN32) target_link_libraries(raw PUBLIC ws2_32) if(BUILD_SHARED_LIBS) - target_compile_definitions(raw PRIVATE LIBRAW_BUILDLIB) + target_compile_definitions(raw PUBLIC LIBRAW_BUILDLIB) else() target_compile_definitions(raw PUBLIC LIBRAW_NODLL) endif() endif() if(MSVC) - target_compile_options(raw PRIVATE /wd4018 /wd4101 /wd4244 /wd4251 /wd4267 /wd4996) + target_compile_options(raw PUBLIC /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) + target_compile_definitions(raw PUBLIC USE_JPEG USE_JPEG8) + target_link_libraries(raw PUBLIC JPEG::JPEG) endif () if (LIBRAW_WITH_LCMS) - target_compile_definitions(raw PRIVATE USE_LCMS2) - target_link_libraries(raw PRIVATE lcms::lcms) + target_compile_definitions(raw PUBLIC USE_LCMS2) + target_link_libraries(raw PUBLIC lcms::lcms) endif () if (LIBRAW_WITH_JASPER) - target_compile_definitions(raw PRIVATE USE_JASPER) - target_link_libraries(raw PRIVATE Jasper::Jasper) + target_compile_definitions(raw PUBLIC USE_JASPER) + target_link_libraries(raw PUBLIC Jasper::Jasper) endif () include(GNUInstallDirs) +if(LIBRAW_BUILD_THREAD_SAFE) + add_library(raw_r ${libraw_LIB_SRCS}) + target_link_libraries(raw_r INTERFACE raw) + target_compile_options(raw_r PRIVATE -pthread) + target_link_options(raw_r PRIVATE -pthread) + target_include_directories(raw_r PUBLIC "${LIBRAW_SRC_DIR}") + install( + TARGETS raw_r + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +endif() + install(DIRECTORY "${LIBRAW_SRC_DIR}/libraw" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install( TARGETS raw diff --git a/recipes/libraw/all/conandata.yml b/recipes/libraw/all/conandata.yml index de16dc88c770a..1b7daa83fdaae 100644 --- a/recipes/libraw/all/conandata.yml +++ b/recipes/libraw/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.21.3": + url: "https://github.com/LibRaw/LibRaw/archive/0.21.3.tar.gz" + sha256: "dc3d8b54e333d9d5441336049db255d14b27f19bd326a306cf5aea866806780a" + "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" diff --git a/recipes/libraw/all/conanfile.py b/recipes/libraw/all/conanfile.py index 4fda00c094ccf..d77cb1f6c1d38 100644 --- a/recipes/libraw/all/conanfile.py +++ b/recipes/libraw/all/conanfile.py @@ -1,8 +1,10 @@ +import os + from conan import ConanFile -from conan.tools.build import check_min_cppstd +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 -import os +from conan.tools.microsoft import is_msvc required_conan_version = ">=1.53.0" @@ -18,6 +20,7 @@ class LibRawConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "build_thread_safe": [True, False], "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], "with_lcms": [True, False], "with_jasper": [True, False], @@ -25,6 +28,7 @@ class LibRawConan(ConanFile): default_options = { "shared": False, "fPIC": True, + "build_thread_safe": False, "with_jpeg": "libjpeg", "with_lcms": True, "with_jasper": True, @@ -38,6 +42,8 @@ def _min_cppstd(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if is_msvc(self): + del self.options.build_thread_safe def configure(self): if self.options.shared: @@ -56,7 +62,7 @@ def requirements(self): elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.3") if self.options.with_lcms: - self.requires("lcms/2.14") + self.requires("lcms/2.16") if self.options.with_jasper: self.requires("jasper/4.0.0") @@ -71,6 +77,7 @@ 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_BUILD_THREAD_SAFE"] = self.options.get_safe("build_thread_safe", False) 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 @@ -91,20 +98,37 @@ def package(self): cmake.install() def package_info(self): - self.cpp_info.libs = ["raw"] + self.cpp_info.components["libraw_"].set_property("pkg_config_name", "libraw") + self.cpp_info.components["libraw_"].libs = ["raw"] + self.cpp_info.components["libraw_"].includedirs.append(os.path.join("include", "libraw")) if self.settings.os == "Windows": - self.cpp_info.system_libs.append("ws2_32") + self.cpp_info.components["libraw_"].system_libs.append("ws2_32") if not self.options.shared: - self.cpp_info.defines.append("LIBRAW_NODLL") + self.cpp_info.components["libraw_"].defines.append("LIBRAW_NODLL") + requires = [] if self.options.with_jpeg == "libjpeg": - self.cpp_info.requires.append("libjpeg::libjpeg") + requires.append("libjpeg::libjpeg") elif self.options.with_jpeg == "libjpeg-turbo": - self.cpp_info.requires.append("libjpeg-turbo::jpeg") + requires.append("libjpeg-turbo::jpeg") elif self.options.with_jpeg == "mozjpeg": - self.cpp_info.requires.append("mozjpeg::libjpeg") + requires.append("mozjpeg::libjpeg") if self.options.with_lcms: - self.cpp_info.requires.append("lcms::lcms") + requires.append("lcms::lcms") if self.options.with_jasper: - self.cpp_info.requires.append("jasper::jasper") + requires.append("jasper::jasper") + self.cpp_info.components["libraw_"].requires = requires + + if self.options.get_safe("build_thread_safe"): + self.cpp_info.components["libraw_r"].set_property("pkg_config_name", "libraw_r") + self.cpp_info.components["libraw_r"].libs = ["raw_r"] + self.cpp_info.components["libraw_r"].includedirs.append(os.path.join("include", "libraw")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libraw_r"].system_libs.append("pthread") + self.cpp_info.components["libraw_r"].requires = requires + + if not self.options.shared and stdcpp_library(self): + self.cpp_info.components["libraw_"].system_libs.append(stdcpp_library(self)) + if self.options.get_safe("build_thread_safe"): + self.cpp_info.components["libraw_r"].system_libs.append(stdcpp_library(self)) diff --git a/recipes/libraw/all/test_package/CMakeLists.txt b/recipes/libraw/all/test_package/CMakeLists.txt index a201657a76080..031ba2752e3aa 100644 --- a/recipes/libraw/all/test_package/CMakeLists.txt +++ b/recipes/libraw/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(libraw REQUIRED CONFIG) diff --git a/recipes/libraw/all/test_v1_package/CMakeLists.txt b/recipes/libraw/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libraw/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libraw/all/test_v1_package/conanfile.py b/recipes/libraw/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libraw/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libraw/config.yml b/recipes/libraw/config.yml index c99b05f143414..5756010f50007 100644 --- a/recipes/libraw/config.yml +++ b/recipes/libraw/config.yml @@ -1,4 +1,8 @@ versions: + "0.21.3": + folder: all + "0.21.2": + folder: all "0.21.1": folder: all "0.20.2": diff --git a/recipes/librdkafka/all/conandata.yml b/recipes/librdkafka/all/conandata.yml index bf7c468b0c4c1..0b32140286b15 100644 --- a/recipes/librdkafka/all/conandata.yml +++ b/recipes/librdkafka/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "2.8.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.8.0.tar.gz" + sha256: "5bd1c46f63265f31c6bfcedcde78703f77d28238eadf23821c2b43fc30be3e25" + "2.6.1": + url: "https://github.com/edenhill/librdkafka/archive/v2.6.1.tar.gz" + sha256: "0ddf205ad8d36af0bc72a2fec20639ea02e1d583e353163bf7f4683d949e901b" + "2.6.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.6.0.tar.gz" + sha256: "abe0212ecd3e7ed3c4818a4f2baf7bf916e845e902bb15ae48834ca2d36ac745" + "2.5.3": + url: "https://github.com/edenhill/librdkafka/archive/v2.5.3.tar.gz" + sha256: "eaa1213fdddf9c43e28834d9a832d9dd732377d35121e42f875966305f52b8ff" + "2.5.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.5.0.tar.gz" + sha256: "3dc62de731fd516dfb1032861d9a580d4d0b5b0856beb0f185d06df8e6c26259" + "2.4.0": + url: "https://github.com/edenhill/librdkafka/archive/v2.4.0.tar.gz" + sha256: "d645e47d961db47f1ead29652606a502bdd2a880c85c1e060e94eea040f1a19a" "2.3.0": url: "https://github.com/edenhill/librdkafka/archive/v2.3.0.tar.gz" sha256: "2d49c35c77eeb3d42fa61c43757fcbb6a206daa560247154e60642bcdcc14d12" @@ -12,6 +30,52 @@ sources: url: "https://github.com/edenhill/librdkafka/archive/v1.9.2.tar.gz" sha256: "3fba157a9f80a0889c982acdd44608be8a46142270a389008b22d921be1198ad" patches: + "2.8.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-5-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "2.6.1": + - 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-5-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "2.6.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-5-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "2.5.3": + - 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-5-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + "2.5.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-5-0.patch + patch_description: "refer conan package names" + patch_type: "conan" + - patch_file: patches/0003-add-forward-declaration-2-5-0.patch + patch_description: "add forward declarations to fix compilation without ssl" + patch_type: "official" + patch_source: "https://github.com/confluentinc/librdkafka/pull/4794/" + "2.4.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-3-0.patch + patch_description: "refer conan package names" + patch_type: "conan" "2.3.0": - patch_file: patches/0001-Change-library-names-1-9-1.patch patch_description: "find_package conan packages" diff --git a/recipes/librdkafka/all/conanfile.py b/recipes/librdkafka/all/conanfile.py index cd2ea0b4f8630..d7bc2435f6766 100644 --- a/recipes/librdkafka/all/conanfile.py +++ b/recipes/librdkafka/all/conanfile.py @@ -1,10 +1,10 @@ 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, replace_in_file -from conan.tools.microsoft import is_msvc +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.gnu import PkgConfigDeps from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.55.0" @@ -31,6 +31,7 @@ class LibrdkafkaConan(ConanFile): "ssl": [True, False], "sasl": [True, False], "curl": [True, False], + "syslog": [True, False], } default_options = { "shared": False, @@ -41,6 +42,7 @@ class LibrdkafkaConan(ConanFile): "ssl": False, "sasl": False, "curl": False, + "syslog": False, } @property @@ -53,6 +55,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if is_msvc(self): + del self.options.syslog def configure(self): if self.options.shared: @@ -70,13 +74,13 @@ def requirements(self): if self.options.ssl: self.requires("openssl/[>=1.1 <4]") if self._depends_on_cyrus_sasl: - self.requires("cyrus-sasl/2.1.27") + 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/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -99,8 +103,9 @@ 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.variables["WITH_SNAPPY"] = True + tc.preprocessor_definitions["WITH_SYSLOG"] = "1" if self.options.get_safe("syslog") else "0" tc.generate() cd = CMakeDeps(self) @@ -112,12 +117,6 @@ def generate(self): def build(self): apply_conandata_patches(self) - # There are references to libcrypto.lib and libssl.lib in rdkafka_ssl.c for versions >= 1.8.0 - if Version(self.version) >= "1.8.0" and is_msvc(self) and \ - self.settings.build_type == "Debug" and self.options.get_safe("ssl", False): - rdkafka_ssl_path = os.path.join(self.source_folder, "src", "rdkafka_ssl.c") - replace_in_file(self, rdkafka_ssl_path, "libcrypto.lib", "libcryptod.lib") - replace_in_file(self, rdkafka_ssl_path, "libssl.lib", "libssld.lib") cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-5-0.patch b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-5-0.patch new file mode 100644 index 0000000000000..a862544f4da08 --- /dev/null +++ b/recipes/librdkafka/all/patches/0002-Change-library-targets-and-result-variables-2-5-0.patch @@ -0,0 +1,26 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index bbe63cf..44df7d1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -224,9 +224,9 @@ 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>) ++# target_include_directories(rdkafka PRIVATE ${ZSTD_INCLUDE_DIR}) ++# message(STATUS "Found ZSTD: ${ZSTD_LIBRARY}") + endif() + + if(WITH_SSL) +@@ -266,7 +266,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/all/patches/0003-add-forward-declaration-2-5-0.patch b/recipes/librdkafka/all/patches/0003-add-forward-declaration-2-5-0.patch new file mode 100644 index 0000000000000..dbaef7d2d154f --- /dev/null +++ b/recipes/librdkafka/all/patches/0003-add-forward-declaration-2-5-0.patch @@ -0,0 +1,13 @@ +diff --git a/src/rdkafka_op.h b/src/rdkafka_op.h +index d79121e..d410a2b 100644 +--- a/src/rdkafka_op.h ++++ b/src/rdkafka_op.h +@@ -39,7 +39,7 @@ + typedef struct rd_kafka_q_s rd_kafka_q_t; + typedef struct rd_kafka_toppar_s rd_kafka_toppar_t; + typedef struct rd_kafka_op_s rd_kafka_op_t; +- ++typedef struct rd_kafka_broker_s rd_kafka_broker_t; + /* One-off reply queue + reply version. + * All APIs that take a rd_kafka_replyq_t makes a copy of the + * struct as-is and grabs hold of the existing .q refcount. diff --git a/recipes/librdkafka/all/test_package/CMakeLists.txt b/recipes/librdkafka/all/test_package/CMakeLists.txt index 636b897b6b9d6..20b8f9e05bc1e 100644 --- a/recipes/librdkafka/all/test_package/CMakeLists.txt +++ b/recipes/librdkafka/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 CXX) find_package(RdKafka REQUIRED CONFIG) diff --git a/recipes/librdkafka/all/test_v1_package/CMakeLists.txt b/recipes/librdkafka/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/librdkafka/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/librdkafka/all/test_v1_package/conanfile.py b/recipes/librdkafka/all/test_v1_package/conanfile.py deleted file mode 100644 index 2be697c561678..0000000000000 --- a/recipes/librdkafka/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - bin_path = os.path.join("bin", "test_package_cpp") - self.run(bin_path, run_environment=True) diff --git a/recipes/librdkafka/config.yml b/recipes/librdkafka/config.yml index edafdb9b6c2ac..0436cdd9824ac 100644 --- a/recipes/librdkafka/config.yml +++ b/recipes/librdkafka/config.yml @@ -1,4 +1,16 @@ versions: + "2.8.0": + folder: all + "2.6.1": + folder: all + "2.6.0": + folder: all + "2.5.3": + folder: all + "2.5.0": + folder: all + "2.4.0": + folder: all "2.3.0": folder: all "2.2.0": diff --git a/recipes/librealsense/all/conandata.yml b/recipes/librealsense/all/conandata.yml index 1f042ec677a64..1ffd40e2b7d37 100644 --- a/recipes/librealsense/all/conandata.yml +++ b/recipes/librealsense/all/conandata.yml @@ -33,6 +33,7 @@ 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-0004-fix-os-flags-arm64.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" @@ -45,3 +46,4 @@ patches: - patch_file: "patches/2.49.0-0004-fix-GUID_DEVINTERFACE_USB_DEVICE.patch" patch_description: "Fix undefined ref to GUID_DEVINTERFACE_USB_DEVICE on Windows" patch_type: "conan" + - patch_file: "patches/2.49.0-0005-fix-os-flags-arm64.patch" diff --git a/recipes/librealsense/all/conanfile.py b/recipes/librealsense/all/conanfile.py index 3bc7e1c733c5a..681efd2f7dc6b 100644 --- a/recipes/librealsense/all/conanfile.py +++ b/recipes/librealsense/all/conanfile.py @@ -1,12 +1,14 @@ from conan import ConanFile +from conan.errors import ConanException 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, rm, rmdir from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os import urllib -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LibrealsenseConan(ConanFile): @@ -93,6 +95,9 @@ def generate(self): tc.variables["BUILD_CV_KINFU_EXAMPLE"] = False if self.settings.os == "Windows": tc.variables["FORCE_RSUSB_BACKEND"] = self.options.rsusb_backend + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.53.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) @@ -140,7 +145,3 @@ def package_info(self): "winusb", "shlwapi", "mf", "mfplat", "mfreadwrite", "mfuuid" ]) - - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "realsense2" - self.cpp_info.names["cmake_find_package_multi"] = "realsense2" diff --git a/recipes/librealsense/all/patches/2.49.0-0005-fix-os-flags-arm64.patch b/recipes/librealsense/all/patches/2.49.0-0005-fix-os-flags-arm64.patch new file mode 100644 index 0000000000000..bdd19712eab0c --- /dev/null +++ b/recipes/librealsense/all/patches/2.49.0-0005-fix-os-flags-arm64.patch @@ -0,0 +1,20 @@ +--- a/CMake/unix_config.cmake ++++ b/CMake/unix_config.cmake +@@ -7,13 +7,13 @@ macro(os_set_flags) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-multichar -Wsequence-point -Wformat -Wformat-security") + + execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE MACHINE) +- if(${MACHINE} MATCHES "arm-*") ++ if(${MACHINE} MATCHES "aarch64-*|arm64-*") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstrict-align -ftree-vectorize") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstrict-align -ftree-vectorize") ++ elseif(${MACHINE} MATCHES "arm-*") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") + add_definitions(-DRASPBERRY_PI) +- elseif(${MACHINE} MATCHES "aarch64-*") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstrict-align -ftree-vectorize") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstrict-align -ftree-vectorize") + elseif(${MACHINE} MATCHES "powerpc64(le)?-linux-gnu") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize") diff --git a/recipes/librealsense/all/patches/2.53.1-0004-fix-os-flags-arm64.patch b/recipes/librealsense/all/patches/2.53.1-0004-fix-os-flags-arm64.patch new file mode 100644 index 0000000000000..5c9ac524d74d7 --- /dev/null +++ b/recipes/librealsense/all/patches/2.53.1-0004-fix-os-flags-arm64.patch @@ -0,0 +1,21 @@ +diff --git a/CMake/unix_config.cmake b/CMake/unix_config.cmake +index 4ec81bb..ceb96f2 100644 +--- a/CMake/unix_config.cmake ++++ b/CMake/unix_config.cmake +@@ -7,12 +7,12 @@ macro(os_set_flags) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-multichar -Wsequence-point -Wformat -Wformat-security") + + execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE MACHINE) +- if(${MACHINE} MATCHES "arm-*") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") +- elseif(${MACHINE} MATCHES "aarch64-*") ++ if(${MACHINE} MATCHES "aarch64-*|arm64-*") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstrict-align -ftree-vectorize") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstrict-align -ftree-vectorize") ++ elseif(${MACHINE} MATCHES "arm-*") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") + elseif(${MACHINE} MATCHES "powerpc64(le)?-linux-gnu") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize") diff --git a/recipes/librealsense/all/test_package/CMakeLists.txt b/recipes/librealsense/all/test_package/CMakeLists.txt index 9853eeb40e1a1..e54b220dda57a 100644 --- a/recipes/librealsense/all/test_package/CMakeLists.txt +++ b/recipes/librealsense/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(realsense2 REQUIRED CONFIG) diff --git a/recipes/librealsense/all/test_package/test_package.cpp b/recipes/librealsense/all/test_package/test_package.cpp index b30e881e2d57d..74c43e97d2aeb 100644 --- a/recipes/librealsense/all/test_package/test_package.cpp +++ b/recipes/librealsense/all/test_package/test_package.cpp @@ -1,6 +1,10 @@ #include +#include +#include int main() { rs2::context context; + rs2_error* e = nullptr; + std::cout << "librealsense2 api version: " << rs2_get_api_version(&e) << "\n"; return EXIT_SUCCESS; } diff --git a/recipes/librealsense/all/test_v1_package/CMakeLists.txt b/recipes/librealsense/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/librealsense/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/librealsense/all/test_v1_package/conanfile.py b/recipes/librealsense/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/librealsense/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_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/libressl/all/conandata.yml b/recipes/libressl/all/conandata.yml index 8d70158fca32f..c4fc1016c6f77 100644 --- a/recipes/libressl/all/conandata.yml +++ b/recipes/libressl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.9.1": + url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.9.1.tar.gz" + sha256: "6da0b954695f7ee62b03f64200a8a4f02af93717b60cce04ab6c8df262c07a51" "3.5.3": url: "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.3.tar.gz" sha256: "3ab5e5eaef69ce20c6b170ee64d785b42235f48f2e62b095fca5d7b6672b8b28" diff --git a/recipes/libressl/all/conanfile.py b/recipes/libressl/all/conanfile.py index 83b9b2abeb131..01fe7dba222cd 100644 --- a/recipes/libressl/all/conanfile.py +++ b/recipes/libressl/all/conanfile.py @@ -88,6 +88,7 @@ def package(self): cmake.install() rm(self, "*.cmake", os.path.join(self.package_folder, "include")) rmdir(self, os.path.join(self.package_folder, "include", "CMakeFiles")) + 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")) diff --git a/recipes/libressl/all/test_package/CMakeLists.txt b/recipes/libressl/all/test_package/CMakeLists.txt index af51f6d63a4cc..8b0dc2a717b67 100644 --- a/recipes/libressl/all/test_package/CMakeLists.txt +++ b/recipes/libressl/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(LibreSSL REQUIRED) diff --git a/recipes/libressl/all/test_v1_package/CMakeLists.txt b/recipes/libressl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libressl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libressl/all/test_v1_package/conanfile.py b/recipes/libressl/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/libressl/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/libressl/config.yml b/recipes/libressl/config.yml index bfca6d19b58d7..10de737dfb8f5 100644 --- a/recipes/libressl/config.yml +++ b/recipes/libressl/config.yml @@ -1,4 +1,6 @@ versions: + "3.9.1": + folder: all "3.5.3": folder: all "3.5.2": diff --git a/recipes/librhash/all/CMakeLists.txt b/recipes/librhash/all/CMakeLists.txt new file mode 100644 index 0000000000000..5a8989c04fb68 --- /dev/null +++ b/recipes/librhash/all/CMakeLists.txt @@ -0,0 +1,48 @@ +# Based on https://github.com/rhash/RHash/pull/103 +cmake_minimum_required(VERSION 3.15) +project(rhash LANGUAGES C) + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../version.h" versionfile) +string(REGEX MATCH "#define VERSION \"([0-9]*)\.([0-9]*)\.([0-9]*)\"" _ ${versionfile}) +set(RHASH_VERSION_MAJOR ${CMAKE_MATCH_1}) +set(RHASH_VERSION_MINOR ${CMAKE_MATCH_2}) +set(RHASH_VERSION_PATCH ${CMAKE_MATCH_3}) +set(RHASH_VERSION "${RHASH_VERSION_MAJOR}.${RHASH_VERSION_MINOR}.${RHASH_VERSION_PATCH}") + +option(USE_OPENSSL "Enable OpenSSL (optimized hash functions) support" ON) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +# Get the list of source files from the Makefile +# https://github.com/rhash/RHash/blob/v1.4.4/librhash/Makefile#L6 +file(READ Makefile MAKEFILE_CONTENTS) +if("${MAKEFILE_CONTENTS}" MATCHES "SOURCES *= *([^\n]+)") + string(REPLACE " " ";" SOURCE_FILES ${CMAKE_MATCH_1}) +else() + message(FATAL_ERROR "SOURCES line not found in Makefile") +endif() + +add_library(rhash ${SOURCE_FILES}) + +if(USE_OPENSSL) + find_package(OpenSSL REQUIRED) + target_link_libraries(rhash OpenSSL::Crypto) + target_compile_definitions(rhash PUBLIC USE_OPENSSL) +endif() + +if(MSVC) + target_compile_definitions(rhash PRIVATE _CRT_SECURE_NO_DEPRECATE) +endif() + +set_target_properties(rhash PROPERTIES + COMPILE_DEFINITIONS IN_RHASH + DEFINE_SYMBOL RHASH_EXPORTS + VERSION ${RHASH_VERSION} + SOVERSION ${RHASH_VERSION_MAJOR}) + +install(TARGETS rhash + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +install(FILES "rhash.h" "rhash_torrent.h" DESTINATION include) diff --git a/recipes/librhash/all/conandata.yml b/recipes/librhash/all/conandata.yml index 7551a33f27039..86c6f3d9822c3 100644 --- a/recipes/librhash/all/conandata.yml +++ b/recipes/librhash/all/conandata.yml @@ -1,11 +1,10 @@ sources: + "1.4.4": + url: "https://downloads.sourceforge.net/project/rhash/rhash/1.4.4/rhash-1.4.4-src.tar.gz" + sha256: "8e7d1a8ccac0143c8fe9b68ebac67d485df119ea17a613f4038cda52f84ef52a" "1.4.2": url: "https://downloads.sourceforge.net/project/rhash/rhash/1.4.2/rhash-1.4.2-src.tar.gz" sha256: "600d00f5f91ef04194d50903d3c79412099328c42f28ff43a0bdb777b00bec62" "1.3.9": url: "https://downloads.sourceforge.net/project/rhash/rhash/1.3.9/rhash-1.3.9-src.tar.gz" sha256: "42b1006f998adb189b1f316bf1a60e3171da047a85c4aaded2d0d26c1476c9f6" -patches: - "1.4.2": - - patch_file: "patches/0001-1.4.2-fix-compiler-detection.patch" - base_path: "source_subfolder" diff --git a/recipes/librhash/all/conanfile.py b/recipes/librhash/all/conanfile.py index 5528b9c183b00..a7af280fa7f51 100644 --- a/recipes/librhash/all/conanfile.py +++ b/recipes/librhash/all/conanfile.py @@ -1,17 +1,23 @@ -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.tools.cmake import CMakeToolchain, CMakeDeps, CMake +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" class LibRHashConan(ConanFile): name = "librhash" description = "Great utility for computing hash sums" - topics = ("rhash", "hash", "checksum") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "http://rhash.sourceforge.net/" - license = "MIT" + topics = ("rhash", "hash", "checksum") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,98 +30,64 @@ class LibRHashConan(ConanFile): "with_openssl": 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) + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src", "librhash")) + 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 layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_openssl: - self.requires("openssl/1.1.1q") - - 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 self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("Visual Studio is not supported") + self.requires("openssl/[>=1.1 <4]") 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) - if self.settings.compiler in ("apple-clang", ): - if self.settings.arch in ("armv7", ): - self._autotools.link_flags.append("-arch armv7") - elif self.settings.arch in ("armv8", ): - self._autotools.link_flags.append("-arch arm64") - vars = self._autotools.vars - conf_args = [ - # librhash's configure script does not understand `--enable-opt1=yes` - "--enable-openssl" if self.options.with_openssl else "--disable-openssl", - "--disable-gettext", - # librhash's configure script is custom and does not understand "--bindir=${prefix}/bin" arguments - "--prefix={}".format(tools.unix_path(self.package_folder)), - "--bindir={}".format(tools.unix_path(os.path.join(self.package_folder, "bin"))), - "--libdir={}".format(tools.unix_path(os.path.join(self.package_folder, "lib"))), - # the configure script does not use CPPFLAGS, so add it to CFLAGS/CXXFLAGS - "--extra-cflags={}".format("{} {}".format(vars["CFLAGS"], vars["CPPFLAGS"])), - "--extra-ldflags={}".format(vars["LDFLAGS"]), - ] - if self.options.shared: - conf_args.extend(["--enable-lib-shared", "--disable-lib-static"]) - else: - conf_args.extend(["--disable-lib-shared", "--enable-lib-static"]) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - with tools.environment_append({ - "BUILD_TARGET": tools.get_gnu_triplet(str(self.settings.os), str(self.settings.arch), str(self.settings.compiler)), - }): - self._autotools.configure(args=conf_args, use_default_install_dirs=False, build=False, host=False) - return self._autotools + @property + def _xversion(self): + # https://github.com/rhash/RHash/blob/v1.4.4/configure#L339 + version = Version(self.version) + return f"0x{version.major.value:02x}{version.minor.value:02x}{version.patch.value:02x}{0:02x}" + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["USE_OPENSSL"] = self.options.with_openssl + tc.preprocessor_definitions["RHASH_XVERSION"] = self._xversion + tc.generate() + deps = CMakeDeps(self) + deps.generate() 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() - autotools.make() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "librhash")) + cmake.build() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - autotools.install() - autotools.make(target="install-lib-headers") - with tools.chdir("librhash"): - if self.options.shared: - autotools.make(target="install-so-link") - tools.rmdir(os.path.join(self.package_folder, "bin")) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LibRHash") + self.cpp_info.set_property("cmake_target_name", "LibRHash::LibRHash") + self.cpp_info.set_property("pkg_config_name", "librhash") + self.cpp_info.libs = ["rhash"] + self.cpp_info.defines.append(f"RHASH_XVERSION={self._xversion}") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "LibRHash" self.cpp_info.names["cmake_find_package_multi"] = "LibRHash" - self.cpp_info.names["pkg_config"] = "librhash" - self.cpp_info.libs = ["rhash"] diff --git a/recipes/librhash/all/patches/0001-1.4.2-fix-compiler-detection.patch b/recipes/librhash/all/patches/0001-1.4.2-fix-compiler-detection.patch deleted file mode 100644 index f6e51246e4dea..0000000000000 --- a/recipes/librhash/all/patches/0001-1.4.2-fix-compiler-detection.patch +++ /dev/null @@ -1,29 +0,0 @@ -Revert compiler detection to state of 1.3.9 - ---- configure -+++ configure -@@ -513,14 +513,9 @@ - CC_TMP="$CC" - test -n "$OPT_CC" && OTHER_CC= || OTHER_CC="gcc cc" - for CC in "$CC_TMP" $OTHER_CC; do -- cc_name_tmp= - if run_cmd "$CC -v"; then - cc_name_tmp=$($CC -v 2>&1 | tail -n 1 | cut -d ' ' -f 1) -- elif run_cmd "$CC --version"; then -- cc_name_tmp=$($CC --version 2>&1 | head -n 1 | cut -d ' ' -f 1) -- fi -- if test -n "${cc_name_tmp}"; then -- if echo "$cc_name_tmp" | grep -q "gcc"; then -+ if test "$cc_name_tmp" = "gcc"; then - cc_name=$cc_name_tmp - start_check "$CC version" - cc_vendor=gnu -@@ -544,7 +539,7 @@ - finish_check "$cc_name $cc_version" - break - fi -- if echo "$cc_name_tmp" | grep -q "clang"; then -+ if $CC -v 2>&1 | grep -q "clang"; then - start_check "$CC version" - cc_vendor=clang - cc_version=$($CC -dumpversion 2>&1) diff --git a/recipes/librhash/all/test_package/CMakeLists.txt b/recipes/librhash/all/test_package/CMakeLists.txt index 80f208bb6a15a..f1b9a5e0be249 100644 --- a/recipes/librhash/all/test_package/CMakeLists.txt +++ b/recipes/librhash/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(LibRHash CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/librhash/all/test_package/conanfile.py b/recipes/librhash/all/test_package/conanfile.py index 2c7657d70d5d9..ef5d7042163ec 100644 --- a/recipes/librhash/all/test_package/conanfile.py +++ b/recipes/librhash/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 SolaceTestConan(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/librhash/config.yml b/recipes/librhash/config.yml index 24eb5d89c9135..334d34ca8c5c1 100644 --- a/recipes/librhash/config.yml +++ b/recipes/librhash/config.yml @@ -1,4 +1,6 @@ versions: + 1.4.4: + folder: all 1.4.2: folder: all 1.3.9: diff --git a/recipes/librttopo/all/CMakeLists.txt b/recipes/librttopo/all/CMakeLists.txt index 34ff2e19a69a6..10445852fa7b3 100644 --- a/recipes/librttopo/all/CMakeLists.txt +++ b/recipes/librttopo/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(rttopo LANGUAGES C) set(RTTOPO_HDR_DIR ${LIBRTTOPO_SRC_DIR}/headers) diff --git a/recipes/librttopo/all/test_package/CMakeLists.txt b/recipes/librttopo/all/test_package/CMakeLists.txt index 5871be92e3e0b..d5e29abfc6ecf 100644 --- a/recipes/librttopo/all/test_package/CMakeLists.txt +++ b/recipes/librttopo/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(librttopo REQUIRED CONFIG) diff --git a/recipes/librttopo/all/test_v1_package/CMakeLists.txt b/recipes/librttopo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/librttopo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/librttopo/all/test_v1_package/conanfile.py b/recipes/librttopo/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/librttopo/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_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/libsafec/all/conandata.yml b/recipes/libsafec/all/conandata.yml index 469b7183d9644..c07bbf7dca23b 100644 --- a/recipes/libsafec/all/conandata.yml +++ b/recipes/libsafec/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.9.1": + url: "https://github.com/rurban/safeclib/releases/download/v3.9.1/safeclib-3.9.1.tar.gz" + sha256: "167502713a4f1a37017b8b830535b31b5762be4bef512bebe19072f17f436dd4" + "3.7.1": + url: "https://github.com/rurban/safeclib/archive/v3.7.1.tar.gz" + sha256: "baac28b60f8f46ae0f273155f4968b20e84380016629247ed2a4d7e3fbeb4d98" "3.6.0": url: "https://github.com/rurban/safeclib/archive/v3.6.tar.gz" sha256: "bd99d4555030719a83807649b3749bc483143b3548278daaa0a4af0fed5dc4de" diff --git a/recipes/libsafec/all/conanfile.py b/recipes/libsafec/all/conanfile.py index 7086816ccca53..21557c2e81288 100644 --- a/recipes/libsafec/all/conanfile.py +++ b/recipes/libsafec/all/conanfile.py @@ -15,7 +15,7 @@ class LibSafeCConan(ConanFile): name = "libsafec" - description = ("This library implements the secure C11 Annex K[^5] functions" + description = ("This library implements the secure C11 Annex K functions" " on top of most libc implementations, which are missing from them.") license = "MIT" url = "https://github.com/conan-io/conan-center-index" @@ -65,7 +65,7 @@ def layout(self): basic_layout(self, src_folder="src") def validate(self): - if is_apple_os(self) and self.settings.arch == "armv8": + if Version(self.version) < "3.9.1" and 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)" ) @@ -118,10 +118,14 @@ def package(self): fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.includedirs.append(os.path.join("include", "libsafec")) - self.cpp_info.libs = [f"safec-{self.version}"] self.cpp_info.set_property("pkg_config_name", "libsafec") + if Version(self.version) >= "3.7.0": + self.cpp_info.includedirs.append(os.path.join("include", "safeclib")) + self.cpp_info.libs = ["safec"] + else: + self.cpp_info.includedirs.append(os.path.join("include", "libsafec")) + self.cpp_info.libs = [f"safec-{self.version}"] + bin_dir = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bin_dir}") self.env_info.PATH.append(bin_dir) diff --git a/recipes/libsafec/all/test_v1_package/CMakeLists.txt b/recipes/libsafec/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libsafec/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 043b77522562f..0000000000000 --- a/recipes/libsafec/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/libsafec/config.yml b/recipes/libsafec/config.yml index 31ef12415e244..d5c020b64bc92 100644 --- a/recipes/libsafec/config.yml +++ b/recipes/libsafec/config.yml @@ -1,3 +1,7 @@ versions: + "3.9.1": + folder: all + "3.7.1": + folder: all "3.6.0": folder: all diff --git a/recipes/libsamplerate/all/test_package/CMakeLists.txt b/recipes/libsamplerate/all/test_package/CMakeLists.txt index cae81ee05d0e0..f2d601901d6df 100644 --- a/recipes/libsamplerate/all/test_package/CMakeLists.txt +++ b/recipes/libsamplerate/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(SampleRate REQUIRED CONFIG) diff --git a/recipes/libsamplerate/all/test_v1_package/CMakeLists.txt b/recipes/libsamplerate/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libsamplerate/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsamplerate/all/test_v1_package/conanfile.py b/recipes/libsamplerate/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libsamplerate/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_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/test_v1_package/CMakeLists.txt b/recipes/libsass/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libsass/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 814aa7bbb26c7..0000000000000 --- a/recipes/libsass/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/libschrift/all/conanfile.py b/recipes/libschrift/all/conanfile.py index 949296527320a..403894f67a231 100644 --- a/recipes/libschrift/all/conanfile.py +++ b/recipes/libschrift/all/conanfile.py @@ -12,8 +12,8 @@ class LibschriftConan(ConanFile): topics = ("truetype", "suckless", ) url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tomolt/libschrift" - license = "ISC", - + license = ("ISC",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], diff --git a/recipes/libschrift/all/test_package/CMakeLists.txt b/recipes/libschrift/all/test_package/CMakeLists.txt index 36819133561d5..081fa1621f25a 100644 --- a/recipes/libschrift/all/test_package/CMakeLists.txt +++ b/recipes/libschrift/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(libschrift REQUIRED CONFIG) diff --git a/recipes/libschrift/all/test_package/OpenSans-Bold.ttf b/recipes/libschrift/all/test_package/OpenSans-Bold.ttf deleted file mode 100644 index fd79d43bea029..0000000000000 Binary files a/recipes/libschrift/all/test_package/OpenSans-Bold.ttf and /dev/null differ diff --git a/recipes/libschrift/all/test_package/conanfile.py b/recipes/libschrift/all/test_package/conanfile.py index d4c18b77de306..0a6bc68712d90 100644 --- a/recipes/libschrift/all/test_package/conanfile.py +++ b/recipes/libschrift/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - font_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") - self.run(f"{bin_path} {font_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/libschrift/all/test_package/test_package.c b/recipes/libschrift/all/test_package/test_package.c index 154c09dca4013..3217d119826cb 100644 --- a/recipes/libschrift/all/test_package/test_package.c +++ b/recipes/libschrift/all/test_package/test_package.c @@ -1,7 +1,10 @@ +#include +#include + #include "schrift.h" -int main(int argc, char* argv[]) { - sft_loadfile(argv[1]); +int main(void) { + printf("Schrift version: %s\n", sft_version()); - return 0; + return EXIT_SUCCESS; } diff --git a/recipes/libschrift/all/test_v1_package/CMakeLists.txt b/recipes/libschrift/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a36c74cedeb93..0000000000000 --- a/recipes/libschrift/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libschrift REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE libschrift::libschrift) diff --git a/recipes/libschrift/all/test_v1_package/conanfile.py b/recipes/libschrift/all/test_v1_package/conanfile.py deleted file mode 100644 index da2d908b1d4a7..0000000000000 --- a/recipes/libschrift/all/test_v1_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 = os.path.join("bin", "test_package") - font_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") - self.run(f"{bin_path} {font_path}", run_environment=True) diff --git a/recipes/libsecret/all/conandata.yml b/recipes/libsecret/all/conandata.yml index 55e19d25249c5..66c4f8677d553 100644 --- a/recipes/libsecret/all/conandata.yml +++ b/recipes/libsecret/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.21.4": + url: "https://download.gnome.org/sources/libsecret/0.21/libsecret-0.21.4.tar.xz" + sha256: "163d08d783be6d4ab9a979ceb5a4fecbc1d9660d3c34168c581301cd53912b20" "0.20.5": url: "https://download.gnome.org/sources/libsecret/0.20/libsecret-0.20.5.tar.xz" sha256: "3fb3ce340fcd7db54d87c893e69bfc2b1f6e4d4b279065ffe66dac9f0fd12b4d" diff --git a/recipes/libsecret/all/conanfile.py b/recipes/libsecret/all/conanfile.py index db4251a471dac..2090a9010ba96 100644 --- a/recipes/libsecret/all/conanfile.py +++ b/recipes/libsecret/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, rmdir from conan.tools.gnu import PkgConfigDeps 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.60.0 <2.0 || >=2.0.6" @@ -24,57 +25,60 @@ class LibsecretConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "with_libgcrypt": [True, False], + "crypto": [False, "libgcrypt", "gnutls"], + "with_libgcrypt": [True, False, "deprecated"], } default_options = { "shared": False, "fPIC": True, - "with_libgcrypt": True, + "crypto": "libgcrypt", + "with_libgcrypt": "deprecated", } - @property - def _use_gcrypt(self): - return self.options.get_safe("with_libgcrypt", False) - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC if self.settings.os != "Linux": # libgcrypt recipe is currently only available on Linux - del self.options.with_libgcrypt + self.options.crypto = False def configure(self): if self.options.shared: self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if self.options.with_libgcrypt != "deprecated": + self.output.warning(f"The '{self.ref}:with_libgcrypt' option is deprecated. Use '{self.ref}:crypto' instead.") def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.78.1", transitive_headers=True, transitive_libs=True) - if self._use_gcrypt: - self.requires("libgcrypt/1.8.4") + self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("crypto") == "libgcrypt": + self.requires("libgcrypt/1.10.3") + elif self.options.get_safe("crypto") == "gnutls": + self.requires("gnutls/3.8.2") def validate(self): if self.settings.os == "Windows": - raise ConanInvalidConfiguration( - "libsecret recipe is not yet compatible with Windows." - ) + raise ConanInvalidConfiguration(f"{self.ref} recipe is not yet compatible with Windows.") + if self.options.crypto == "gnutls" and Version(self.version) < "0.21.2": + raise ConanInvalidConfiguration(f"{self.ref} does not support GnuTLS before version 0.21.2. Use -o '&:crypto=libgcrypt' instead.") + + def package_id(self): + del self.info.options.with_libgcrypt def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.1") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.2.0") self.tool_requires("glib/") - if self.settings.os == "Macos": + if is_apple_os(self): # 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") + self.tool_requires("gettext/0.22.5") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -86,7 +90,10 @@ def generate(self): tc.project_options["introspection"] = "false" tc.project_options["manpage"] = "false" tc.project_options["gtk_doc"] = "false" - tc.project_options["gcrypt"] = "true" if self._use_gcrypt else "false" + if Version(self.version) >= "0.21.2": + tc.project_options["crypto"] = str(self.options.crypto) if self.options.crypto else "disabled" + else: + tc.project_options["gcrypt"] = "true" if self.options.crypto == "libgcrypt" else "false" tc.generate() deps = PkgConfigDeps(self) deps.generate() @@ -106,8 +113,10 @@ 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", "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")] self.cpp_info.libs = ["secret-1"] + self.cpp_info.requires = ["glib::glib-2.0", "glib::gobject-2.0", "glib::gio-2.0"] + if self.options.get_safe("crypto") == "libgcrypt": + self.cpp_info.requires.append("libgcrypt::libgcrypt") + elif self.options.get_safe("crypto") == "gnutls": + self.cpp_info.requires.append("gnutls::gnutls") diff --git a/recipes/libsecret/all/test_package/CMakeLists.txt b/recipes/libsecret/all/test_package/CMakeLists.txt index 0158ca54705aa..12e42237d500c 100644 --- a/recipes/libsecret/all/test_package/CMakeLists.txt +++ b/recipes/libsecret/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(libsecret REQUIRED CONFIG) diff --git a/recipes/libsecret/all/test_v1_package/CMakeLists.txt b/recipes/libsecret/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libsecret/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsecret/all/test_v1_package/conanfile.py b/recipes/libsecret/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libsecret/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_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/libsecret/config.yml b/recipes/libsecret/config.yml index 470f4b110022f..f624806eaea4d 100644 --- a/recipes/libsecret/config.yml +++ b/recipes/libsecret/config.yml @@ -1,4 +1,6 @@ versions: + "0.21.4": + folder: all "0.20.5": folder: all "0.20.4": diff --git a/recipes/libselinux/all/conandata.yml b/recipes/libselinux/all/conandata.yml index 3db74c02a2ca7..6ec0dbf8b0f22 100644 --- a/recipes/libselinux/all/conandata.yml +++ b/recipes/libselinux/all/conandata.yml @@ -1,4 +1,9 @@ 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" @@ -30,6 +35,23 @@ 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" + - patch_file: patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch + patch_description: "libsepol/src/Makefile: fix reallocarray detection" + patch_source: "https://lore.kernel.org/selinux/20240108210314.339682-1-fontaine.fabrice@gmail.com/" + patch_type: "portability" + base_path: libsepol-3.6 + - patch_file: patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch + patch_description: "libselinux, libsepol: Add CFLAGS and LDFLAGS to Makefile checks" + patch_source: "https://lore.kernel.org/selinux/20240313224806.2859045-1-jwcart2@gmail.com/T/#u" + patch_type: "portability" + "3.3": + - patch_file: patches/0003-fix-link-pcre.patch + base_path: libselinux-3.3 "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 11d688ce34c15..19bf1f194402c 100644 --- a/recipes/libselinux/all/conanfile.py +++ b/recipes/libselinux/all/conanfile.py @@ -2,6 +2,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 apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, replace_in_file, save from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps @@ -62,7 +63,7 @@ def validate(self): 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/2.0.3") + self.tool_requires("pkgconf/2.2.0") def source(self): for download in self.conan_data["sources"][self.version]: @@ -87,7 +88,10 @@ def generate(self): sepol_lib_folder = os.path.join(self._sepol_source_folder, "src") tc.extra_ldflags.append(f"-L{sepol_lib_folder}") tc.make_args.append("USE_PCRE2=y") - tc.generate() + env = tc.environment() + if cross_building(self): + env.append_path("PKG_CONFIG_LIBDIR", self.generators_folder) + tc.generate(env=env) def build(self): apply_conandata_patches(self) diff --git a/recipes/libselinux/all/patches/0003-fix-link-pcre.patch b/recipes/libselinux/all/patches/0003-fix-link-pcre.patch new file mode 100644 index 0000000000000..993246d09e0ea --- /dev/null +++ b/recipes/libselinux/all/patches/0003-fix-link-pcre.patch @@ -0,0 +1,11 @@ +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -43,7 +43,7 @@ endif + + override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) + override LDFLAGS += -L../src +-override LDLIBS += -lselinux $(FTS_LDLIBS) ++override LDLIBS += -lselinux $(FTS_LDLIBS) $(PCRE_LDLIBS) + PCRE_LDLIBS ?= -lpcre + + ifeq ($(ANDROID_HOST),y) 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/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch b/recipes/libselinux/all/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch new file mode 100644 index 0000000000000..c9a5ee550ab55 --- /dev/null +++ b/recipes/libselinux/all/patches/0004-libsepol-src-Makefile-fix-reallocarray-detection.patch @@ -0,0 +1,48 @@ +From a520f972bce9ec267f4e76b729bc3b7c1bdf13e6 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 8 Jan 2024 22:03:14 +0100 +Subject: [PATCH 1/3] libsepol/src/Makefile: fix reallocarray detection + +Pass LDFLAGS when checking for reallocarray to avoid the following +static build failure with musl raised since version 3.4 and +https://github.com/SELinuxProject/selinux/commit/f0a5f6e33084bd83d409bb7c932256139f471e71 +because -static is not passed when checking for reallocarray: + +/home/autobuild/autobuild/instance-9/output-1/host/bin/armeb-buildroot-linux-musleabi-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g0 -static -I. -I../include -D_GNU_SOURCE -I../cil/include -fPIC -c -o assertion.o assertion.c +In file included from assertion.c:28: +private.h:88:21: error: static declaration of 'reallocarray' follows non-static declaration + 88 | static inline void* reallocarray(void *ptr, size_t nmemb, size_t size) { + | ^~~~~~~~~~~~ +In file included from ../include/sepol/policydb/mls_types.h:35, + from ../include/sepol/policydb/context.h:23, + from ../include/sepol/policydb/policydb.h:62, + from assertion.c:24: +/home/autobuild/autobuild/instance-9/output-1/host/armeb-buildroot-linux-musleabi/sysroot/usr/include/stdlib.h:150:7: note: previous declaration of 'reallocarray' with type 'void *(void *, size_t, size_t)' {aka 'void *(void *, unsigned int, unsigned int)'} + 150 | void *reallocarray (void *, size_t, size_t); + | ^~~~~~~~~~~~ + +Fixes: + - http://autobuild.buildroot.org/results/0170032548a38e2c991d62dc5823808458ad03b3 + +Signed-off-by: Fabrice Fontaine +Acked-by: James Carter +--- +src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index d80a941f..16b9bd5e 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -31,7 +31,7 @@ endif + + # check for reallocarray(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include \nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include \nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_REALLOCARRAY + endif + +-- +2.44.0 + diff --git a/recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch b/recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch new file mode 100644 index 0000000000000..bea3664ddd66d --- /dev/null +++ b/recipes/libselinux/all/patches/0005-libselinux-libsepol-Add-CFLAGS-and-LDFLAGS.patch @@ -0,0 +1,61 @@ +[PATCH] libselinux, libsepol: Add CFLAGS and LDFLAGS to Makefile checks +@ 2024-03-13 22:48 James Carter + 0 siblings, 0 replies; only message in thread +From: James Carter @ 2024-03-13 22:48 UTC (permalink / raw) + To: selinux; +Cc: jordan, winfried_mb2, James Carter + +In libselinux there is an availability check for strlcpy() and +in both libselinux and libsepol there are availability checks for +reallocarray() in the src Makfiles. CFLAGS and LDFLAGS are needed +for cross-compiling, but, unfortunately, the default CFLAGS cause +all of these availability checks to fail to compile because of +compilationerrors (rather than just the function not being available). + +Add CFLAGS and LDFLAGS to the availibility checks, update the checks +so that a compilation error will only happen if the function being +checked for is not available, and make checks for the same function +the same in both libselinux and libsepol. + +Suggested-by: Jordan Williams +Suggested-by: Winfried Dobbe +Signed-off-by: James Carter +--- + libselinux/src/Makefile | 4 ++-- + libsepol/src/Makefile | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libselinux-3.6/src/Makefile b/libselinux-3.6/src/Makefile +index d3b981fc..41cfbdca 100644 +--- a/libselinux-3.6/src/Makefile ++++ b/libselinux-3.6/src/Makefile +@@ -104,13 +104,13 @@ override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) + + # check for strlcpy(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}include \nint main(void){char*d,*s;strlcpy(d, s, 0);return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}include \nint main(void){char d[2];const char *s="a";return (size_t)strlcpy(d,s,sizeof(d))>=sizeof(d);}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_STRLCPY + endif + + # check for reallocarray(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}include \nint main(void){reallocarray(NULL, 0, 0);return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}include \nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_REALLOCARRAY + endif + +diff --git a/libsepol-3.6/src/Makefile b/libsepol-3.6/src/Makefile +index 16b9bd5e..7b0e8446 100644 +--- a/libsepol-3.6/src/Makefile ++++ b/libsepol-3.6/src/Makefile +@@ -31,7 +31,7 @@ endif + + # check for reallocarray(3) availability + H := \# +-ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include \nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) ++ifeq (yes,$(shell printf '${H}include \nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes)) + override CFLAGS += -DHAVE_REALLOCARRAY + endif + +-- +2.44.0 diff --git a/recipes/libselinux/all/test_v1_package/CMakeLists.txt b/recipes/libselinux/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libselinux/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libselinux/all/test_v1_package/conanfile.py b/recipes/libselinux/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libselinux/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_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/libselinux/config.yml b/recipes/libselinux/config.yml index 761b7522ae137..901df00682822 100644 --- a/recipes/libselinux/config.yml +++ b/recipes/libselinux/config.yml @@ -1,4 +1,6 @@ versions: + "3.6": + folder: all "3.5": folder: all "3.3": diff --git a/recipes/libserial/all/test_package/CMakeLists.txt b/recipes/libserial/all/test_package/CMakeLists.txt index c896bd464b19d..eafcc6b0b467a 100644 --- a/recipes/libserial/all/test_package/CMakeLists.txt +++ b/recipes/libserial/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) diff --git a/recipes/libserial/all/test_v1_package/CMakeLists.txt b/recipes/libserial/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libserial/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libserial/all/test_v1_package/conanfile.py b/recipes/libserial/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libserial/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libsersi/all/conandata.yml b/recipes/libsersi/all/conandata.yml new file mode 100644 index 0000000000000..f0cef58719a9f --- /dev/null +++ b/recipes/libsersi/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/crhowell3/libsersi/archive/refs/tags/v0.1.0.tar.gz" + sha256: "b3ce8c73a5b69b963e3c5090e2e237fe142f9aff69a1b6b477b52e2a6a55abb4" diff --git a/recipes/libsersi/all/conanfile.py b/recipes/libsersi/all/conanfile.py new file mode 100644 index 0000000000000..6ee3b2ab30071 --- /dev/null +++ b/recipes/libsersi/all/conanfile.py @@ -0,0 +1,97 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=2" + +class LibsersiConan(ConanFile): + name = "libsersi" + homepage = "https://github.com/crhowell3/libsersi" + description = "Modern C++ implementation of IEEE 1278.1a-1998" + topics = ("library", "protocol", "dis") + url = "https://github.com/conan-io/conan-center-index" + 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 + } + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def generate(self): + tc = CMakeToolchain(self) + + # build scripts assume CMAKE_BUILD_TYPE is a cache variable, + # but CMakeToolchain sets it as a regular variable otherwise + tc.cache_variables["CMAKE_BUILD_TYPE"] = str(self.settings.build_type) + tc.cache_variables["BUILD_EXAMPLES"] = False + tc.cache_variables["BUILD_TESTS"] = False + tc.generate() + + def layout(self): + cmake_layout(self, src_folder="src") + + 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 build_requirements(self): + self.tool_requires("cmake/[>=3.22 <4]") + + 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 build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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")) + rmdir(self, os.path.join(self.package_folder, "res")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["sersi"] + self.cpp_info.set_property("cmake_target_name", "libsersi::sersi") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libsersi/all/test_package/CMakeLists.txt b/recipes/libsersi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..31cea858a72f8 --- /dev/null +++ b/recipes/libsersi/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(libsersi CONFIG REQUIRED) + +add_executable(test_package_dis test_package.cpp) +target_link_libraries(test_package_dis PRIVATE libsersi::sersi) +set_target_properties(test_package_dis PROPERTIES CXX_STANDARD 14) diff --git a/recipes/libsersi/all/test_package/conanfile.py b/recipes/libsersi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8e56d28728132 --- /dev/null +++ b/recipes/libsersi/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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 = "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): + self.run(os.path.join(self.cpp.build.bindirs[0], + "test_package_dis"), env="conanrun") diff --git a/recipes/libsersi/all/test_package/test_package.cpp b/recipes/libsersi/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5b979128ad54f --- /dev/null +++ b/recipes/libsersi/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include "libsersi/entity_information/EntityStatePdu.h" + +int main() { + dis::EntityStatePdu pdu1, pdu2; + + dis::DataStream ds(dis::kBig); + pdu1.Marshal(ds); + pdu2.Unmarshal(ds); + + std::cout << "Success\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/libsersi/config.yml b/recipes/libsersi/config.yml new file mode 100644 index 0000000000000..6c11a439d0bc2 --- /dev/null +++ b/recipes/libsersi/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: all diff --git a/recipes/libsgp4/all/test_package/CMakeLists.txt b/recipes/libsgp4/all/test_package/CMakeLists.txt index 97488a3cba806..c991a8fc465b8 100644 --- a/recipes/libsgp4/all/test_package/CMakeLists.txt +++ b/recipes/libsgp4/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(libsgp4 REQUIRED CONFIG) diff --git a/recipes/libsgp4/all/test_v1_package/CMakeLists.txt b/recipes/libsgp4/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libsgp4/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsgp4/all/test_v1_package/conanfile.py b/recipes/libsgp4/all/test_v1_package/conanfile.py deleted file mode 100644 index 2b79c5abc2774..0000000000000 --- a/recipes/libsgp4/all/test_v1_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 = os.path.join("bin", "test_package") - tle_name = os.path.join(self.source_folder, os.pardir, "test_package", "SGP4-VER.TLE") - self.run(f"{bin_path} {tle_name}", run_environment=True) diff --git a/recipes/libsigcpp/2.x.x/conandata.yml b/recipes/libsigcpp/2.x.x/conandata.yml index 604636a369d17..7d37da25c36b9 100644 --- a/recipes/libsigcpp/2.x.x/conandata.yml +++ b/recipes/libsigcpp/2.x.x/conandata.yml @@ -1,4 +1,4 @@ sources: "2.10.8": - url: "https://ftp2.nluug.nl/windowing/gnome/sources/libsigc++/2.10/libsigc++-2.10.8.tar.xz" + url: "https://download.gnome.org/sources/libsigc++/2.10/libsigc%2B%2B-2.10.8.tar.xz" sha256: "235a40bec7346c7b82b6a8caae0456353dc06e71f14bc414bcc858af1838719a" diff --git a/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt b/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt index 0fb07d5ca03ae..d33fcba33373f 100644 --- a/recipes/libsigcpp/2.x.x/test_package/CMakeLists.txt +++ b/recipes/libsigcpp/2.x.x/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(PkgConfig REQUIRED) diff --git a/recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt b/recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt index 3c0d6af8191fb..8e9d06fd44245 100644 --- a/recipes/libsigcpp/3.x.x/test_package/CMakeLists.txt +++ b/recipes/libsigcpp/3.x.x/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(sigc++-3 REQUIRED CONFIG) diff --git a/recipes/libsixel/all/conanfile.py b/recipes/libsixel/all/conanfile.py index 941e12b139215..2dd78a289a478 100644 --- a/recipes/libsixel/all/conanfile.py +++ b/recipes/libsixel/all/conanfile.py @@ -66,7 +66,7 @@ def requirements(self): if self.options.with_jpeg: self.requires("libjpeg/9e") if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") def validate(self): if hasattr(self, "settings_build") and cross_building(self): @@ -75,9 +75,9 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} does not support Visual Studio") def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/[>=1.2.3 <2]") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libsixel/all/test_v1_package/CMakeLists.txt b/recipes/libsixel/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libsixel/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index e556cc050d509..0000000000000 --- a/recipes/libsixel/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/libslz/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libslz/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libslz/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_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/libsmacker/all/test_package/CMakeLists.txt b/recipes/libsmacker/all/test_package/CMakeLists.txt index 27003d64c4b5a..3ab0527c300bd 100644 --- a/recipes/libsmacker/all/test_package/CMakeLists.txt +++ b/recipes/libsmacker/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(libsmacker REQUIRED CONFIG) diff --git a/recipes/libsmacker/all/test_v1_package/CMakeLists.txt b/recipes/libsmacker/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libsmacker/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsmacker/all/test_v1_package/conanfile.py b/recipes/libsmacker/all/test_v1_package/conanfile.py deleted file mode 100644 index 3c3f444e8cad9..0000000000000 --- a/recipes/libsmacker/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,15 +0,0 @@ -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): - # No free .smk file to test. - pass diff --git a/recipes/libsndfile/all/conanfile.py b/recipes/libsndfile/all/conanfile.py index 6ce8582b64685..a79d7e30b142a 100644 --- a/recipes/libsndfile/all/conanfile.py +++ b/recipes/libsndfile/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.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime @@ -28,6 +29,7 @@ class LibsndfileConan(ConanFile): "with_alsa": [True, False], "with_external_libs": [True, False], "with_mpeg": [True, False], + "with_sndio": [True, False], } default_options = { "shared": False, @@ -37,6 +39,7 @@ class LibsndfileConan(ConanFile): "with_alsa": False, "with_external_libs": True, "with_mpeg": True, + "with_sndio": False, } def export_sources(self): @@ -52,19 +55,28 @@ 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") + + def validate(self): + if self.options.with_sndio: + if self.dependencies["libsndio"].options.get_safe("with_alsa") and not self.options.get_safe("with_alsa"): + raise ConanInvalidConfiguration(f"{self.ref} 'with_alsa' option should be True when the libsndio 'with_alsa' one is True") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): + if self.options.with_sndio: + self.requires("libsndio/1.9.0", options={"with_alsa": self.options.get_safe("with_alsa")}) if self.options.get_safe("with_alsa"): - self.requires("libalsa/1.2.10") + self.requires("libalsa/[>=1.2 <1.3]") 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.4") - if self.options.get_safe("with_mpeg", False): + if self.options.get_safe("with_mpeg"): self.requires("mpg123/1.31.2") self.requires("libmp3lame/3.100") @@ -73,8 +85,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Sndio"] = True # FIXME: missing sndio cci recipe (check whether it is really required) - tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Speex"] = True # FIXME: missing sndio cci recipe (check whether it is really required) + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Speex"] = True # FIXME: missing speex cci recipe (check whether it is really required) tc.variables["CMAKE_DISABLE_FIND_PACKAGE_SQLite3"] = True # only used for regtest tc.variables["ENABLE_EXTERNAL_LIBS"] = self.options.with_external_libs if not self.options.with_external_libs: @@ -97,6 +108,8 @@ def generate(self): tc.variables["ENABLE_MPEG"] = self.options.with_mpeg # Fix iOS/tvOS/watchOS tc.variables["CMAKE_MACOSX_BUNDLE"] = False + if Version(self.version) <= "1.2.2": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) deps.generate() @@ -120,27 +133,21 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "SndFile") self.cpp_info.set_property("cmake_target_name", "SndFile::sndfile") self.cpp_info.set_property("pkg_config_name", "sndfile") - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["sndfile"].libs = ["sndfile"] + self.cpp_info.libs = ["sndfile"] + if self.options.with_sndio: + self.cpp_info.requires.append("libsndio::libsndio") if self.options.with_external_libs: - self.cpp_info.components["sndfile"].requires.extend([ + self.cpp_info.requires.extend([ "ogg::ogg", "vorbis::vorbismain", "vorbis::vorbisenc", "flac::flac", "opus::opus", ]) if self.options.get_safe("with_mpeg", False): - self.cpp_info.components["sndfile"].requires.append("mpg123::mpg123") - self.cpp_info.components["sndfile"].requires.append("libmp3lame::libmp3lame") + self.cpp_info.requires.append("mpg123::mpg123") + self.cpp_info.requires.append("libmp3lame::libmp3lame") if self.options.get_safe("with_alsa"): - self.cpp_info.components["sndfile"].requires.append("libalsa::libalsa") + self.cpp_info.requires.append("libalsa::libalsa") if not self.options.shared: if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["sndfile"].system_libs = ["m", "dl", "pthread", "rt"] + self.cpp_info.system_libs = ["m", "dl", "pthread", "rt"] elif self.settings.os == "Windows": - self.cpp_info.components["sndfile"].system_libs.append("winmm") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "SndFile" - self.cpp_info.names["cmake_find_package_multi"] = "SndFile" - self.cpp_info.components["sndfile"].set_property("cmake_target_name", "SndFile::sndfile") - if self.options.programs: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.cpp_info.system_libs.append("winmm") \ No newline at end of file diff --git a/recipes/libsndfile/all/test_package/CMakeLists.txt b/recipes/libsndfile/all/test_package/CMakeLists.txt index 3fb4ef12f8bc8..c79d2f7a39c47 100644 --- a/recipes/libsndfile/all/test_package/CMakeLists.txt +++ b/recipes/libsndfile/all/test_package/CMakeLists.txt @@ -1,7 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C CXX) find_package(SndFile REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE SndFile::sndfile) +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE SndFile::sndfile) + +add_executable(${PROJECT_NAME}_cxx test_package.cpp) +target_link_libraries(${PROJECT_NAME}_cxx PRIVATE SndFile::sndfile) diff --git a/recipes/libsndfile/all/test_package/conanfile.py b/recipes/libsndfile/all/test_package/conanfile.py index 0a6bc68712d90..cc3db8ee5d1af 100644 --- a/recipes/libsndfile/all/test_package/conanfile.py +++ b/recipes/libsndfile/all/test_package/conanfile.py @@ -22,5 +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_c") + self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package_cxx") self.run(bin_path, env="conanrun") diff --git a/recipes/libsndfile/all/test_package/test_package.c b/recipes/libsndfile/all/test_package/test_package.c new file mode 100644 index 0000000000000..ef4f2a16fbf4e --- /dev/null +++ b/recipes/libsndfile/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include "sndfile.h" + +#include + +int main(int argc, char *argv[]) { + if (argc < 2) { + puts("Usage: example \n"); + return 0; + } + SF_INFO sfinfo; + SNDFILE *infile = sf_open (argv[1], SFM_READ, &sfinfo); + printf("Sample rate: %d\n", sfinfo.samplerate); + return 0; +} diff --git a/recipes/libsndfile/all/test_package/test_package.cpp b/recipes/libsndfile/all/test_package/test_package.cpp index 2f577c46055c5..c21e7e86b6c71 100644 --- a/recipes/libsndfile/all/test_package/test_package.cpp +++ b/recipes/libsndfile/all/test_package/test_package.cpp @@ -9,9 +9,9 @@ int main(int argc, char *argv[]) { if (argc < 2) { std::cout << "Usage: example \n"; - } else { - SndfileHandle handle(argv[1]); - std::cout << "Sample rate: " << handle.samplerate() << "\n"; + return 0; } + SndfileHandle handle(argv[1]); + std::cout << "Sample rate: " << handle.samplerate() << "\n"; return 0; } diff --git a/recipes/libsndfile/all/test_v1_package/CMakeLists.txt b/recipes/libsndfile/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libsndfile/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsndfile/all/test_v1_package/conanfile.py b/recipes/libsndfile/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libsndfile/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_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/libsndio/all/conandata.yml b/recipes/libsndio/all/conandata.yml new file mode 100644 index 0000000000000..17fe5ab522e62 --- /dev/null +++ b/recipes/libsndio/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.9.0": + "source": + url: "https://github.com/ratchov/sndio/archive/refs/tags/v1.9.0.tar.gz" + sha256: "4e8d77069b651d7c4bb2a50ba49004bd7fcfdfec1516f88a76457f831c17a546" + "license": + url: "https://raw.githubusercontent.com/ratchov/sndio/e10e4f836b88f8d5ea2864845e3712f560e6bed6/LICENSE" + sha256: "4ae392ab9cfbf2d6ac8522f5f4b025685d60c824979fad783aaf72d55165730f" diff --git a/recipes/libsndio/all/conanfile.py b/recipes/libsndio/all/conanfile.py new file mode 100644 index 0000000000000..8275a8426bd82 --- /dev/null +++ b/recipes/libsndio/all/conanfile.py @@ -0,0 +1,147 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, copy, get, rmdir, replace_in_file, download +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.scm import Version +from conan.tools.build import cross_building +import os + +required_conan_version = ">=1.53.0" + + +class LibsndioConan(ConanFile): + name = "libsndio" + license = "ISC" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sndio.org/" + topics = ("sndio", "sound", "audio", "midi") + description = ("A small audio and MIDI framework that provides a lightweight audio & MIDI server " + "and a user-space API to access either the server or the hardware directly in a uniform way.") + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_alsa": [True, False] + } + default_options = { + "with_alsa": False, + } + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"Unsupported OS for {self.ref}") + + if self.options.with_alsa and not self.dependencies["libalsa"].options.get_safe("shared", False): + raise ConanInvalidConfiguration(f"{self.ref} requires libalsa to be built as a shared library") + + def requirements(self): + if self.options.get_safe("with_alsa"): + self.requires("libalsa/1.2.10", options={"shared": True}) + + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + + def source(self): + get(self, **self.conan_data["sources"][self.version]["source"], strip_root=True) + download(self, **self.conan_data["sources"][self.version]["license"], filename="LICENSE") + + # Remove all targets other than libsndio + lines = [ + "cd sndiod && ${MAKE} install", + "cd sndioctl && ${MAKE} install", + "cd aucat && ${MAKE} install", + "cd midicat && ${MAKE} install", + "cd sndiod && ${MAKE}", + "cd sndioctl && ${MAKE}", + "cd aucat && ${MAKE}", + "cd midicat && ${MAKE}" + ] + for line in lines: + replace_in_file(self, os.path.join(self.source_folder, "Makefile.in"), line, "") + + def generate(self): + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + + # Inject requires env vars in build scope + # It's required in case of native build when there is AutotoolsDeps & at least one dependency which might be shared, because configure tries to run a test executable + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + + # Set expected config + tc.configure_args.append("--datadir=${prefix}/res") + + # Bundled `configure` script does not support these options, so remove + exclusions = ["--enable-shared", "--disable-shared", "--disable-static", "--enable-static", "--sbindir", "--oldincludedir"] + tc.configure_args = [arg for arg in tc.configure_args if not any(exclusion in arg for exclusion in exclusions)] + + # Add alsa support + if self.options.get_safe("with_alsa"): + tc.configure_args.append("--enable-alsa") + else: + tc.configure_args.append("--disable-alsa") + + # The original project source has a hand-written `configure` script that does not expose + # many hooks for specifying additional build flags and library dependencies. Because the script is + # not auto-generated with Autotools, the standard Conan workflow of using AutoolsDeps is not possible. + # The one hook the script does provide is a command line arg: `CC=*|CFLAGS=*|LDFLAGS=*|AR=*)`. + # We use this to inject the various flags, paths, and libraries that the Conan dependency tree specifies. + dep_cflags = [] + dep_ldflags = [] + for dependency in reversed(self.dependencies.host.topological_sort.values()): + deps_cpp_info = dependency.cpp_info.aggregated_components() + + dep_cflags.extend(deps_cpp_info.cflags + deps_cpp_info.defines) + for path in deps_cpp_info.includedirs: + dep_cflags.append(f"-I{path}") + + dep_ldflags.extend(deps_cpp_info.sharedlinkflags + deps_cpp_info.exelinkflags) + for path in deps_cpp_info.libdirs: + dep_ldflags.append(f"-L{path}") + for lib in deps_cpp_info.libs + deps_cpp_info.system_libs: + dep_ldflags.append(f"-l{lib}") + + cflags = ' '.join([flag for flag in dep_cflags]) + ldflags = ' '.join([flag for flag in dep_ldflags]) + tc.configure_args.extend([ + f"CFLAGS={cflags}", + f"LDFLAGS={ldflags}" + ]) + + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + 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, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "sndio") + self.cpp_info.set_property("cmake_target_name", "sndio::sndio") + self.cpp_info.set_property("pkg_config_name", "sndio") + self.cpp_info.libs = ["sndio"] + self.cpp_info.system_libs = ["dl", "m", "rt"] + + # TODO: to remove in conan v2? + self.cpp_info.names["cmake_find_package"] = "sndio" + self.cpp_info.names["cmake_find_package_multi"] = "sndio" + self.cpp_info.names["pkg_config"] = "sndio" diff --git a/recipes/libsndio/all/test_package/CMakeLists.txt b/recipes/libsndio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e8d7a447fb920 --- /dev/null +++ b/recipes/libsndio/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(sndio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE sndio::sndio) diff --git a/recipes/libsndio/all/test_package/conanfile.py b/recipes/libsndio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/libsndio/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/libsndio/all/test_package/test_package.c b/recipes/libsndio/all/test_package/test_package.c new file mode 100644 index 0000000000000..03387869c0a9d --- /dev/null +++ b/recipes/libsndio/all/test_package/test_package.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + int ch; + unsigned mode = SIO_PLAY | SIO_REC; + struct sio_hdl *hdl; + + hdl = sio_open(NULL, mode, 0); + if (hdl == NULL) { + fprintf(stderr, "sio_open() failed, but test is ok\n"); + exit(0); + } else { + printf("sio_open() success" ); + } + sio_close(hdl); + return 0; +} diff --git a/recipes/libsndio/config.yml b/recipes/libsndio/config.yml new file mode 100644 index 0000000000000..95efce85442dd --- /dev/null +++ b/recipes/libsndio/config.yml @@ -0,0 +1,3 @@ +versions: + "1.9.0": + folder: "all" diff --git a/recipes/libsodium/all/conandata.yml b/recipes/libsodium/all/conandata.yml index c399471111c38..011a9515014e0 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.20": + url: "https://github.com/jedisct1/libsodium/archive/1.0.20-RELEASE.tar.gz" + sha256: "8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1" "1.0.19": url: "https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz" sha256: "018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea" diff --git a/recipes/libsodium/all/conanfile.py b/recipes/libsodium/all/conanfile.py index f895ac1f52b3c..5734e0f326eb9 100644 --- a/recipes/libsodium/all/conanfile.py +++ b/recipes/libsodium/all/conanfile.py @@ -18,7 +18,7 @@ class LibsodiumConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://doc.libsodium.org/" topics = "encryption", "signature", "hashing" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -92,9 +92,10 @@ def generate(self): if self._is_mingw: tc.extra_ldflags.append("-lssp") if self.settings.os == "Emscripten": - # FIXME: this is an old comment/test, has not been re-tested with conan2 upgrade - self.output.warn("os=Emscripten is not tested/supported by this recipe") - # FIXME: ./dist-build/emscripten.sh does not respect options of this recipe + tc.configure_args.append("--enable-minimal") + tc.configure_args.append("--without-pthreads") + tc.configure_args.append("--disable-ssp") + tc.configure_args.append("--disable-asm") tc.generate() @property diff --git a/recipes/libsodium/config.yml b/recipes/libsodium/config.yml index 4dfbbb5c3d410..124484cdfba0a 100644 --- a/recipes/libsodium/config.yml +++ b/recipes/libsodium/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.20": + folder: all "1.0.19": folder: all "1.0.18": diff --git a/recipes/libsolace/all/test_v1_package/CMakeLists.txt b/recipes/libsolace/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libsolace/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 890f8e01b2489..0000000000000 --- a/recipes/libsolace/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/libspatialindex/all/test_package/CMakeLists.txt b/recipes/libspatialindex/all/test_package/CMakeLists.txt index 485d6719dfdb8..8727943f99617 100644 --- a/recipes/libspatialindex/all/test_package/CMakeLists.txt +++ b/recipes/libspatialindex/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(libspatialindex REQUIRED CONFIG) diff --git a/recipes/libspatialindex/all/test_v1_package/CMakeLists.txt b/recipes/libspatialindex/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libspatialindex/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libspatialindex/all/test_v1_package/conanfile.py b/recipes/libspatialindex/all/test_v1_package/conanfile.py deleted file mode 100644 index 302285c48aded..0000000000000 --- a/recipes/libspatialindex/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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_c = os.path.join("bin", "test_package_c") - self.run(bin_path_c, run_environment=True) - bin_path_cpp = os.path.join("bin", "test_package_cpp") - self.run(bin_path_cpp, run_environment=True) diff --git a/recipes/libspatialite/all/conandata.yml b/recipes/libspatialite/all/conandata.yml index c9378f957e838..d34eec9877d84 100644 --- a/recipes/libspatialite/all/conandata.yml +++ b/recipes/libspatialite/all/conandata.yml @@ -1,9 +1,14 @@ sources: + "5.1.0": + url: "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-5.1.0.tar.gz" + sha256: "43be2dd349daffe016dd1400c5d11285828c22fea35ca5109f21f3ed50605080" "5.0.1": url: "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-5.0.1.tar.gz" sha256: "eecbc94311c78012d059ebc0fae86ea5ef6eecb13303e6e82b3753c1b3409e98" patches: + "5.1.0": + - patch_file: "patches/5.1.0/0002-nmake-honor-flags.patch" + - patch_file: "patches/5.0.1/0003-msvc-minizip.patch" "5.0.1": - - patch_file: "patches/0001-autotools-no-geos-config.patch" - - patch_file: "patches/0002-nmake-honor-flags.patch" - - patch_file: "patches/0003-msvc-minizip.patch" + - patch_file: "patches/5.0.1/0002-nmake-honor-flags.patch" + - patch_file: "patches/5.0.1/0003-msvc-minizip.patch" diff --git a/recipes/libspatialite/all/conanfile.py b/recipes/libspatialite/all/conanfile.py index 4260480b1b097..fc1bc78006991 100644 --- a/recipes/libspatialite/all/conanfile.py +++ b/recipes/libspatialite/all/conanfile.py @@ -85,20 +85,22 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("sqlite3/3.42.0") - self.requires("zlib/1.2.13") + # Included in public spatialite/sqlite.h + # https://www.gaia-gis.it/fossil/libspatialite/file?name=src/headers/spatialite/sqlite.h&ci=tip + self.requires("sqlite3/[>=3.44 <4]", transitive_headers=True, transitive_libs=True) + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_proj: - self.requires("proj/9.1.1") + self.requires("proj/9.3.1") if self.options.with_iconv: self.requires("libiconv/1.17") if self.options.with_freexl: - self.requires("freexl/1.0.6") + self.requires("freexl/2.0.0") if self.options.with_geos: - self.requires("geos/3.11.1") + self.requires("geos/3.12.0") if self.options.get_safe("with_rttopo"): self.requires("librttopo/1.1.0") if self.options.with_libxml2: - self.requires("libxml2/2.10.3") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.with_minizip: self.requires("minizip/1.2.13") @@ -106,7 +108,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): @@ -118,6 +120,9 @@ def source(self): def generate(self): if is_msvc(self): tc = NMakeToolchain(self) + tc.extra_defines.append("YY_NO_UNISTD_H") + if self.options.shared: + tc.extra_defines.append("DLL_EXPORT") tc.generate() deps = NMakeDeps(self) deps.generate() @@ -154,6 +159,7 @@ def generate(self): "--enable-geosonlyreentrant=no", "--enable-geos370=yes", f"--enable-rttopo={yes_no(self.options.with_rttopo)}", + "--with-geosconfig=true", # Using `true` command for a no-op ]) tc.generate() @@ -192,14 +198,17 @@ def _build_msvc(self): if not self.options.with_minizip: replace_in_file(self, gaiaconfig_msvc, "#define ENABLE_MINIZIP 1", "") + # Workaround for a NMakeDeps define quoting issue: + # https://github.com/conan-io/conan/issues/13603 + replace_in_file(self, os.path.join(self.generators_folder, "conannmakedeps.bat"), + r'/DSQLITE_API#\"__declspec(dllimport)\"', + "/DSQLITE_API#__declspec(dllimport)", strict=False) + target = "spatialite_i.lib" if self.options.shared else "spatialite.lib" - optflags = ["-DYY_NO_UNISTD_H"] - if self.options.shared: - optflags.append("-DDLL_EXPORT") with chdir(self, self.source_folder): - self.run(f"nmake -f makefile.vc {target} OPTFLAGS=\"{' '.join(optflags)}\"") + self.run(f"nmake -f makefile.vc {target}") - def _build_autotools(self): + def _patch_autotools(self): # fix MinGW replace_in_file( self, os.path.join(self.source_folder, "configure.ac"), @@ -208,9 +217,18 @@ def _build_autotools(self): ) # Disable tests replace_in_file(self, os.path.join(self.source_folder, "Makefile.am"), - "SUBDIRS = src test $(EXAMPLES)", - "SUBDIRS = src $(EXAMPLES)") + "SUBDIRS = src test $(EXAMPLES)", + "SUBDIRS = src $(EXAMPLES)") + # We can't use geos-config file in conan because it's a non-relocatable file, + # therefore not packaged by geos recipe of conan-center-index. + # Instead, we rely on AutoToolsBuildEnvironment helper to inject proper flags. + configure_ac = os.path.join(self.source_folder, "configure.ac") + replace_in_file(self, configure_ac, "AC_MSG_ERROR([the user-specified geos-config", "echo # ") + replace_in_file(self, configure_ac, "AC_CHECK_HEADERS([geos_c.h", "# ") + replace_in_file(self, configure_ac, "AC_SEARCH_LIBS(GEOSCoveredBy", "# ") + def _build_autotools(self): + self._patch_autotools() autotools = Autotools(self) autotools.autoreconf() autotools.configure() diff --git a/recipes/libspatialite/all/patches/0001-autotools-no-geos-config.patch b/recipes/libspatialite/all/patches/0001-autotools-no-geos-config.patch deleted file mode 100644 index 0da26fe7f8512..0000000000000 --- a/recipes/libspatialite/all/patches/0001-autotools-no-geos-config.patch +++ /dev/null @@ -1,22 +0,0 @@ -We can't use geos-config file in conan because it's a non-relocatable file, -therefore not packaged by geos recipe of conan-center-index. -Instead we rely on AutoToolsBuildEnvironment helper to inject proper flags. - ---- a/configure.ac -+++ b/configure.ac -@@ -311,6 +311,7 @@ AC_ARG_ENABLE(geos, [AS_HELP_STRING( - [--enable-geos], [enables GEOS inclusion [default=yes]])], - [], [enable_geos=yes]) - if test x"$enable_geos" != "xno"; then -+ if false; then - #----------------------------------------------------------------------- - # --with-geosconfig - # -@@ -352,6 +353,7 @@ if test x"$enable_geos" != "xno"; then - AC_SEARCH_LIBS(GEOSCoveredBy,geos_c,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.3.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig])) - LIBS="$LIBS_SAVE" - LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c" -+ fi - - #----------------------------------------------------------------------- - # --enable-controlpoints diff --git a/recipes/libspatialite/all/patches/0002-nmake-honor-flags.patch b/recipes/libspatialite/all/patches/5.0.1/0002-nmake-honor-flags.patch similarity index 100% rename from recipes/libspatialite/all/patches/0002-nmake-honor-flags.patch rename to recipes/libspatialite/all/patches/5.0.1/0002-nmake-honor-flags.patch diff --git a/recipes/libspatialite/all/patches/0003-msvc-minizip.patch b/recipes/libspatialite/all/patches/5.0.1/0003-msvc-minizip.patch similarity index 100% rename from recipes/libspatialite/all/patches/0003-msvc-minizip.patch rename to recipes/libspatialite/all/patches/5.0.1/0003-msvc-minizip.patch diff --git a/recipes/libspatialite/all/patches/5.1.0/0002-nmake-honor-flags.patch b/recipes/libspatialite/all/patches/5.1.0/0002-nmake-honor-flags.patch new file mode 100644 index 0000000000000..23016b01dd132 --- /dev/null +++ b/recipes/libspatialite/all/patches/5.1.0/0002-nmake-honor-flags.patch @@ -0,0 +1,36 @@ +This patch for msvc build allows to: +* define OPTFLAG ourself from conanfile (allow to honor profile) +* not hardcode this very specific C:\OSGeo4W environment + +--- a/makefile.vc ++++ b/makefile.vc +@@ -2,7 +2,6 @@ + # + # NMAKE Makefile to build libspatialite on Windows + # +-!INCLUDE nmake.opt + + LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \ + src\gaiaexif\gaia_exif.obj src\gaiageo\gg_advanced.obj \ +@@ -96,7 +95,7 @@ + SPATIALITE_DLL = spatialite$(VERSION).dll + + CFLAGS = /nologo -I.\src\headers -I.\src\topology \ +- -I. -IC:\OSGeo4W\include $(OPTFLAGS) ++ -I. $(CFLAGS) $(OPTFLAGS) + + default: all + +@@ -111,11 +110,7 @@ + + spatialite_i.lib: $(LIBOBJ) + link /dll /out:$(SPATIALITE_DLL) \ +- /implib:spatialite_i.lib $(LIBOBJ) \ +- C:\OSGeo4W\lib\proj_i.lib C:\OSGeo4W\lib\geos_c.lib \ +- C:\OSGeo4w\lib\freexl_i.lib C:\OSGeo4w\lib\iconv.lib \ +- C:\OSGeo4W\lib\sqlite3_i.lib C:\OSGeo4W\lib\zlib.lib \ +- C:\OSGeo4W\lib\libxml2.lib C:\OSGeo4W\lib\librttopo.lib ++ /implib:spatialite_i.lib $(LIBOBJ) + if exist $(SPATIALITE_DLL).manifest mt -manifest \ + $(SPATIALITE_DLL).manifest -outputresource:$(SPATIALITE_DLL);2 + diff --git a/recipes/libspatialite/all/test_package/CMakeLists.txt b/recipes/libspatialite/all/test_package/CMakeLists.txt index 9e65e602672c8..6f36448bed7e2 100644 --- a/recipes/libspatialite/all/test_package/CMakeLists.txt +++ b/recipes/libspatialite/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(libspatialite REQUIRED CONFIG) diff --git a/recipes/libspatialite/config.yml b/recipes/libspatialite/config.yml index 5787f28e91cf3..5da3767a58773 100644 --- a/recipes/libspatialite/config.yml +++ b/recipes/libspatialite/config.yml @@ -1,3 +1,5 @@ versions: + "5.1.0": + folder: all "5.0.1": folder: all diff --git a/recipes/libspng/all/test_package/CMakeLists.txt b/recipes/libspng/all/test_package/CMakeLists.txt index 37a57f5a95869..d1e5180207ebe 100644 --- a/recipes/libspng/all/test_package/CMakeLists.txt +++ b/recipes/libspng/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(libspng CONFIG) diff --git a/recipes/libspng/all/test_v1_package/CMakeLists.txt b/recipes/libspng/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libspng/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libspng/all/test_v1_package/conanfile.py b/recipes/libspng/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libspng/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_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/libsquish/all/conanfile.py b/recipes/libsquish/all/conanfile.py index aaefbce93b7c7..7275e4df15734 100644 --- a/recipes/libsquish/all/conanfile.py +++ b/recipes/libsquish/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, collect_libs, copy, export_conandata_patches, get +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get import os required_conan_version = ">=1.53.0" @@ -81,6 +81,6 @@ def package(self): cmake.install() def package_info(self): - self.cpp_info.libs = collect_libs(self) + self.cpp_info.libs = ["squishd" if self.settings.build_type == "Debug" else "squish"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/libsquish/all/test_package/CMakeLists.txt b/recipes/libsquish/all/test_package/CMakeLists.txt index a57d2011ccdd9..10208bc4bf0c4 100644 --- a/recipes/libsquish/all/test_package/CMakeLists.txt +++ b/recipes/libsquish/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(libsquish REQUIRED CONFIG) diff --git a/recipes/libsquish/all/test_v1_package/CMakeLists.txt b/recipes/libsquish/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libsquish/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsquish/all/test_v1_package/conanfile.py b/recipes/libsquish/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libsquish/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_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/libsrtp/all/conandata.yml b/recipes/libsrtp/all/conandata.yml index b0630ee5a7c2f..04f0998b86517 100644 --- a/recipes/libsrtp/all/conandata.yml +++ b/recipes/libsrtp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.6.0": + url: "https://github.com/cisco/libsrtp/archive/v2.6.0.tar.gz" + sha256: "bf641aa654861be10570bfc137d1441283822418e9757dc71ebb69a6cf84ea6b" + "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..38334eef95695 100644 --- a/recipes/libsrtp/all/conanfile.py +++ b/recipes/libsrtp/all/conanfile.py @@ -1,7 +1,8 @@ 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 +from conan.tools.env import VirtualBuildEnv import os required_conan_version = ">=1.53.0" @@ -14,10 +15,10 @@ class LibsrtpRecipe(ConanFile): "Protocol (SRTP), the Universal Security Transform (UST), and a supporting" "cryptographic kernel." ) - topics = ("srtp",) - homepage = "https://github.com/cisco/libsrtp" - 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/cisco/libsrtp" + topics = ("srtp",) package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -48,32 +49,42 @@ def requirements(self): if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") + def build_requirements(self): + if Version(self.version) >= "2.6.0": + self.tool_requires("cmake/[>=3.21 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) tc.variables["ENABLE_OPENSSL"] = self.options.with_openssl - tc.variables["TEST_APPS"] = False + if Version(self.version) < "2.6.0": + tc.variables["TEST_APPS"] = False + else: + tc.variables["LIBSRTP_TEST_APPS"] = False if Version(self.version) < "2.4.0": # Relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if "2.5.0" <= Version(self.version) < "2.6.0": + tc.cache_variables["BUILD_WITH_WARNINGS"] = False + if "2.6.0" <= Version(self.version): + tc.cache_variables["ENABLE_WARNINGS"] = False + tc.cache_variables["ENABLE_WARNINGS_AS_ERRORS"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) deps.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") + + 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 +93,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/all/test_package/CMakeLists.txt b/recipes/libsrtp/all/test_package/CMakeLists.txt index 88bdca8976ea9..66c190b8cdd4a 100644 --- a/recipes/libsrtp/all/test_package/CMakeLists.txt +++ b/recipes/libsrtp/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(libsrtp REQUIRED CONFIG) diff --git a/recipes/libsrtp/all/test_v1_package/CMakeLists.txt b/recipes/libsrtp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libsrtp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsrtp/all/test_v1_package/conanfile.py b/recipes/libsrtp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libsrtp/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_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/libsrtp/config.yml b/recipes/libsrtp/config.yml index d17b791c9f454..8daa9e28d8c53 100644 --- a/recipes/libsrtp/config.yml +++ b/recipes/libsrtp/config.yml @@ -1,4 +1,8 @@ versions: + "2.6.0": + folder: all + "2.5.0": + folder: all "2.4.2": folder: all "2.4.0": diff --git a/recipes/libssh/all/conandata.yml b/recipes/libssh/all/conandata.yml new file mode 100644 index 0000000000000..50d31fb9a74ed --- /dev/null +++ b/recipes/libssh/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "0.11.1": + url: "https://www.libssh.org/files/0.11/libssh-0.11.1.tar.xz" + sha256: "14b7dcc72e91e08151c58b981a7b570ab2663f630e7d2837645d5a9c612c1b79" + "0.10.6": + url: "https://www.libssh.org/files/0.10/libssh-0.10.6.tar.xz" + sha256: "1861d498f5b6f1741b6abc73e608478491edcf9c9d4b6630eef6e74596de9dc1" +patches: + "0.11.1": + - patch_file: patches/0.11.1-0001-fix-cmake.patch + patch_description: "cmake: fix MbedTLS and GCrypt compatibility" + patch_type: "conan" + "0.10.6": + - patch_file: patches/0.10.6-0001-fix-cmake.patch + patch_description: "cmake: fix OpenSSL compatibility checks, fix ZLIB targets" + patch_type: "conan" + - patch_file: patches/0.10.6-0002-fix-cmake.patch + patch_description: "cmake: fix MbedTLS and GCrypt compatibility" + patch_type: "conan" + - patch_file: patches/0.10.6-0003-fix-mbedtls-private-struct.patch + patch_description: "Fix mbedTLS issues caused by v3 API changes" + patch_type: "bugfix" + patch_source: "https://gitlab.com/libssh/libssh-mirror/-/merge_requests/480" diff --git a/recipes/libssh/all/conanfile.py b/recipes/libssh/all/conanfile.py new file mode 100644 index 0000000000000..048a5fb46c2ed --- /dev/null +++ b/recipes/libssh/all/conanfile.py @@ -0,0 +1,125 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +import os + + +required_conan_version = ">=1.54.0" + + +class LibSSHRecipe(ConanFile): + name = "libssh" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libssh.org/" + description = "multiplatform C library implementing the SSHv2 protocol on client and server side" + topics = ("ssh", "shell", "ssh2", "connection") + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_zlib": [True, False], + "crypto_backend": ["openssl", "gcrypt", "mbedtls"], + "with_symbol_versioning": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "crypto_backend": "openssl", + "with_symbol_versioning": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.with_symbol_versioning + + 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 requirements(self): + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.crypto_backend =="openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.crypto_backend == "gcrypt": + self.requires("libgcrypt/1.8.4") + elif self.options.crypto_backend == "mbedtls": + self.requires("mbedtls/3.6.0") + + def validate(self): + if self.options.crypto_backend == "mbedtls" and not self.dependencies["mbedtls"].options.enable_threading: + raise ConanInvalidConfiguration(f"{self.ref} requires '-o mbedtls/*:enable_threading=True' when using '-o libssh/*:crypto_backend=mbedtls'") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CLIENT_TESTING"] = False + tc.variables["SERVER_TESTING"] = False + tc.variables["WITH_EXAMPLES"] = False + tc.variables["WITH_GCRYPT"] = self.options.crypto_backend == "gcrypt" + tc.variables["WITH_GSSAPI"] = False + tc.variables["WITH_MBEDTLS"] = self.options.crypto_backend == "mbedtls" + tc.variables["WITH_NACL"] = False + tc.variables["WITH_SYMBOL_VERSIONING"] = self.options.get_safe("with_symbol_versioning", True) + tc.variables["WITH_ZLIB"] = self.options.with_zlib + 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.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.generate() + deps = CMakeDeps(self) + deps.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, 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", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["ssh"] + if not self.options.shared: + self.cpp_info.defines.append("LIBSSH_STATIC=ON") + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["ws2_32", "iphlpapi"]) + + self.cpp_info.set_property("cmake_file_name", "libssh") + # target and alias names defined at: + # ssh https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n351 + # ssh::ssh https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n371 + # ssh-static https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n413 + # ssh::static https://git.libssh.org/projects/libssh.git/tree/src/CMakeLists.txt?h=libssh-0.10.6#n428 + self.cpp_info.set_property("cmake_target_name", "ssh::ssh") + self.cpp_info.set_property( + "cmake_target_aliases", + ["ssh"] if self.options.shared else ["ssh", "ssh-static", "ssh::static"], + ) + # pkg-config defined at https://git.libssh.org/projects/libssh.git/tree/CMakeLists.txt?h=libssh-0.10.6#n124 + self.cpp_info.set_property("pkg_config_name", "libssh") + diff --git a/recipes/libssh/all/patches/0.10.6-0001-fix-cmake.patch b/recipes/libssh/all/patches/0.10.6-0001-fix-cmake.patch new file mode 100644 index 0000000000000..22ccde99a9073 --- /dev/null +++ b/recipes/libssh/all/patches/0.10.6-0001-fix-cmake.patch @@ -0,0 +1,110 @@ +diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake +index 9de10225..6f881775 100644 +--- a/ConfigureChecks.cmake ++++ b/ConfigureChecks.cmake +@@ -101,41 +101,41 @@ if (OPENSSL_FOUND) + check_include_file(openssl/ecdsa.h HAVE_OPENSSL_ECDSA_H) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_KDF_CTX_new_id HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_KDF_CTX_new HAVE_OPENSSL_EVP_KDF_CTX_NEW) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(FIPS_mode HAVE_OPENSSL_FIPS_MODE) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(RAND_priv_bytes HAVE_OPENSSL_RAND_PRIV_BYTES) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_DigestSign HAVE_OPENSSL_EVP_DIGESTSIGN) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_DigestVerify HAVE_OPENSSL_EVP_DIGESTVERIFY) + + check_function_exists(OPENSSL_ia32cap_loc HAVE_OPENSSL_IA32CAP_LOC) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_symbol_exists(EVP_PKEY_ED25519 "openssl/evp.h" FOUND_OPENSSL_ED25519) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_function_exists(EVP_chacha20 HAVE_OPENSSL_EVP_CHACHA20) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_symbol_exists(EVP_PKEY_POLY1305 "openssl/evp.h" HAVE_OPENSSL_EVP_POLY1305) + + if (HAVE_OPENSSL_EVP_DIGESTSIGN AND HAVE_OPENSSL_EVP_DIGESTVERIFY AND +@@ -144,7 +144,7 @@ if (OPENSSL_FOUND) + endif() + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +- set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES}) ++ set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) + check_symbol_exists(EVP_PKEY_X25519 "openssl/evp.h" HAVE_OPENSSL_X25519) + + unset(CMAKE_REQUIRED_INCLUDES) +@@ -494,7 +494,7 @@ if (WITH_PKCS11_URI) + message(FATAL_ERROR "PKCS #11 is not supported for mbedcrypto") + set(WITH_PKCS11_URI 0) + endif() +- if (HAVE_OPENSSL AND NOT OPENSSL_VERSION VERSION_GREATER_EQUAL "1.1.1") ++ if (HAVE_OPENSSL AND NOT OpenSSL_VERSION VERSION_GREATER_EQUAL "1.1.1") + message(FATAL_ERROR "PKCS #11 requires at least OpenSSL 1.1.1") + set(WITH_PKCS11_URI 0) + endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 807313b5..91f85094 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -17,7 +17,7 @@ if (OPENSSL_CRYPTO_LIBRARIES) + + set(LIBSSH_LINK_LIBRARIES + ${LIBSSH_LINK_LIBRARIES} +- ${OPENSSL_CRYPTO_LIBRARIES} ++ OpenSSL::Crypto + ) + endif (OPENSSL_CRYPTO_LIBRARIES) + +@@ -46,12 +46,12 @@ endif() + if (WITH_ZLIB) + set(LIBSSH_PRIVATE_INCLUDE_DIRS + ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${ZLIB_INCLUDE_DIR} ++ ${ZLIB_INCLUDE_DIRS} + ) + + set(LIBSSH_LINK_LIBRARIES + ${LIBSSH_LINK_LIBRARIES} +- ${ZLIB_LIBRARY} ++ ${ZLIB_LIBRARIES} + ) + endif (WITH_ZLIB) + +@@ -257,7 +257,7 @@ else (WITH_GCRYPT) + chachapoly.c + ) + endif (NOT (HAVE_OPENSSL_EVP_CHACHA20 AND HAVE_OPENSSL_EVP_POLY1305)) +- if(OPENSSL_VERSION VERSION_LESS "1.1.0") ++ if(OpenSSL_VERSION VERSION_LESS "1.1.0") + set(libssh_SRCS ${libssh_SRCS} libcrypto-compat.c) + endif() + endif (WITH_GCRYPT) diff --git a/recipes/libssh/all/patches/0.10.6-0002-fix-cmake.patch b/recipes/libssh/all/patches/0.10.6-0002-fix-cmake.patch new file mode 100644 index 0000000000000..53b9b66c536c7 --- /dev/null +++ b/recipes/libssh/all/patches/0.10.6-0002-fix-cmake.patch @@ -0,0 +1,123 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a64b7708..6647076b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -48,15 +48,15 @@ if (WITH_ZLIB) + endif (WITH_ZLIB) + + if (WITH_GCRYPT) +- find_package(GCrypt 1.5.0 REQUIRED) +- if (NOT GCRYPT_FOUND) ++ find_package(libgcrypt 1.5.0 REQUIRED) ++ if (NOT libgcrypt_FOUND) + message(FATAL_ERROR "Could not find GCrypt") +- endif (NOT GCRYPT_FOUND) ++ endif (NOT libgcrypt_FOUND) + elseif(WITH_MBEDTLS) + find_package(MbedTLS REQUIRED) +- if (NOT MBEDTLS_FOUND) ++ if (NOT MbedTLS_FOUND) + message(FATAL_ERROR "Could not find mbedTLS") +- endif (NOT MBEDTLS_FOUND) ++ endif (NOT MbedTLS_FOUND) + else (WITH_GCRYPT) + find_package(OpenSSL 1.0.1) + if (OPENSSL_FOUND) +@@ -66,13 +66,13 @@ else (WITH_GCRYPT) + set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) + endif (NOT DEFINED OPENSSL_CRYPTO_LIBRARIES) + else (OPENSSL_FOUND) +- find_package(GCrypt) +- if (NOT GCRYPT_FOUND) ++ find_package(libgcrypt) ++ if (NOT libgcrypt_FOUND) + find_package(MbedTLS) +- if (NOT MBEDTLS_FOUND) ++ if (NOT MbedTLS_FOUND) + message(FATAL_ERROR "Could not find OpenSSL, GCrypt or mbedTLS") +- endif (NOT MBEDTLS_FOUND) +- endif (NOT GCRYPT_FOUND) ++ endif (NOT MbedTLS_FOUND) ++ endif (NOT libgcrypt_FOUND) + endif (OPENSSL_FOUND) + endif(WITH_GCRYPT) + +diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake +index 6f881775..12585117 100644 +--- a/ConfigureChecks.cmake ++++ b/ConfigureChecks.cmake +@@ -267,27 +267,27 @@ if (OPENSSL_FOUND) + set(HAVE_LIBCRYPTO 1) + endif (OPENSSL_FOUND) + +-if (GCRYPT_FOUND) ++if (libgcrypt_FOUND) + set(HAVE_LIBGCRYPT 1) +- if (GCRYPT_VERSION VERSION_GREATER "1.4.6") ++ if (libgcrypt_VERSION VERSION_GREATER "1.4.6") + set(HAVE_GCRYPT_ECC 1) + set(HAVE_ECC 1) +- endif (GCRYPT_VERSION VERSION_GREATER "1.4.6") +- if (NOT GCRYPT_VERSION VERSION_LESS "1.7.0") ++ endif (libgcrypt_VERSION VERSION_GREATER "1.4.6") ++ if (NOT libgcrypt_VERSION VERSION_LESS "1.7.0") + set(HAVE_GCRYPT_CHACHA_POLY 1) +- endif (NOT GCRYPT_VERSION VERSION_LESS "1.7.0") +-endif (GCRYPT_FOUND) ++ endif (NOT libgcrypt_VERSION VERSION_LESS "1.7.0") ++endif (libgcrypt_FOUND) + +-if (MBEDTLS_FOUND) ++if (MbedTLS_FOUND) + set(HAVE_LIBMBEDCRYPTO 1) + set(HAVE_ECC 1) + +- set(CMAKE_REQUIRED_INCLUDES "${MBEDTLS_INCLUDE_DIR}/mbedtls") ++ set(CMAKE_REQUIRED_INCLUDES "${MbedTLS_INCLUDE_DIR}/mbedtls") + check_include_file(chacha20.h HAVE_MBEDTLS_CHACHA20_H) + check_include_file(poly1305.h HAVE_MBEDTLS_POLY1305_H) + unset(CMAKE_REQUIRED_INCLUDES) + +-endif (MBEDTLS_FOUND) ++endif (MbedTLS_FOUND) + + if (CMAKE_USE_PTHREADS_INIT) + set(HAVE_PTHREAD 1) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 91f85094..839271ad 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,27 +21,13 @@ if (OPENSSL_CRYPTO_LIBRARIES) + ) + endif (OPENSSL_CRYPTO_LIBRARIES) + +-if (MBEDTLS_CRYPTO_LIBRARY) +- set(LIBSSH_PRIVATE_INCLUDE_DIRS +- ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${MBEDTLS_INCLUDE_DIR} +- ) +- set(LIBSSH_LINK_LIBRARIES +- ${LIBSSH_LINK_LIBRARIES} +- ${MBEDTLS_CRYPTO_LIBRARY} +- ) +-endif (MBEDTLS_CRYPTO_LIBRARY) +- +-if (GCRYPT_LIBRARIES) +- set(LIBSSH_PRIVATE_INCLUDE_DIRS +- ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${GCRYPT_INCLUDE_DIR} +- ) ++if (TARGET MbedTLS::mbedcrypto) ++ list(APPEND LIBSSH_LINK_LIBRARIES MbedTLS::mbedcrypto) ++endif () + +- set(LIBSSH_LINK_LIBRARIES +- ${LIBSSH_LINK_LIBRARIES} +- ${GCRYPT_LIBRARIES}) +-endif() ++if (TARGET libgcrypt::libgcrypt) ++ list(APPEND LIBSSH_LINK_LIBRARIES libgcrypt::libgcrypt) ++endif () + + if (WITH_ZLIB) + set(LIBSSH_PRIVATE_INCLUDE_DIRS diff --git a/recipes/libssh/all/patches/0.10.6-0003-fix-mbedtls-private-struct.patch b/recipes/libssh/all/patches/0.10.6-0003-fix-mbedtls-private-struct.patch new file mode 100644 index 0000000000000..b71b2c3e3e4ee --- /dev/null +++ b/recipes/libssh/all/patches/0.10.6-0003-fix-mbedtls-private-struct.patch @@ -0,0 +1,13 @@ +diff --git a/src/libmbedcrypto.c b/src/libmbedcrypto.c +index caa3b6e9..69910a24 100644 +--- a/src/libmbedcrypto.c ++++ b/src/libmbedcrypto.c +@@ -119,7 +119,7 @@ int hmac_update(HMACCTX c, const void *data, size_t len) + int hmac_final(HMACCTX c, unsigned char *hashmacbuf, size_t *len) + { + int rc; +- *len = (unsigned int)mbedtls_md_get_size(c->md_info); ++ *len = (unsigned int)mbedtls_md_get_size(c->MBEDTLS_PRIVATE(md_info)); + rc = !mbedtls_md_hmac_finish(c, hashmacbuf); + mbedtls_md_free(c); + SAFE_FREE(c); diff --git a/recipes/libssh/all/patches/0.11.1-0001-fix-cmake.patch b/recipes/libssh/all/patches/0.11.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..de689af10daeb --- /dev/null +++ b/recipes/libssh/all/patches/0.11.1-0001-fix-cmake.patch @@ -0,0 +1,95 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 13330ea3..9b86072d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,7 +47,7 @@ if (WITH_ZLIB) + endif (WITH_ZLIB) + + if (WITH_GCRYPT) +- find_package(GCrypt 1.5.0 REQUIRED) ++ find_package(libgcrypt 1.5.0 REQUIRED) + message(WARNING "libgcrypt cryptographic backend is deprecated and will be removed in future releases.") + elseif(WITH_MBEDTLS) + find_package(MbedTLS REQUIRED) +diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake +index 8765dc6e..f454d325 100644 +--- a/ConfigureChecks.cmake ++++ b/ConfigureChecks.cmake +@@ -218,22 +218,22 @@ if (OPENSSL_FOUND) + set(HAVE_LIBCRYPTO 1) + endif (OPENSSL_FOUND) + +-if (GCRYPT_FOUND) ++if (libgcrypt_FOUND) + set(HAVE_LIBGCRYPT 1) +- if (GCRYPT_VERSION VERSION_GREATER "1.4.6") ++ if (libgcrypt_VERSION VERSION_GREATER "1.4.6") + set(HAVE_GCRYPT_ECC 1) + set(HAVE_ECC 1) +- endif (GCRYPT_VERSION VERSION_GREATER "1.4.6") +- if (NOT GCRYPT_VERSION VERSION_LESS "1.7.0") ++ endif (libgcrypt_VERSION VERSION_GREATER "1.4.6") ++ if (NOT libgcrypt_VERSION VERSION_LESS "1.7.0") + set(HAVE_GCRYPT_CHACHA_POLY 1) +- endif (NOT GCRYPT_VERSION VERSION_LESS "1.7.0") +-endif (GCRYPT_FOUND) ++ endif (NOT libgcrypt_VERSION VERSION_LESS "1.7.0") ++endif (libgcrypt_FOUND) + +-if (MBEDTLS_FOUND) ++if (MbedTLS_FOUND) + set(HAVE_LIBMBEDCRYPTO 1) + set(HAVE_ECC 1) + +- set(CMAKE_REQUIRED_INCLUDES "${MBEDTLS_INCLUDE_DIR}/mbedtls") ++ set(CMAKE_REQUIRED_INCLUDES "${MbedTLS_INCLUDE_DIR}/mbedtls") + check_include_file(chacha20.h HAVE_MBEDTLS_CHACHA20_H) + check_include_file(poly1305.h HAVE_MBEDTLS_POLY1305_H) + if (WITH_BLOWFISH_CIPHER) +@@ -242,7 +242,7 @@ if (MBEDTLS_FOUND) + + unset(CMAKE_REQUIRED_INCLUDES) + +-endif (MBEDTLS_FOUND) ++endif (MbedTLS_FOUND) + + if (CMAKE_USE_PTHREADS_INIT) + set(HAVE_PTHREAD 1) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 199acbd9..3e715a96 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -12,27 +12,13 @@ if (TARGET OpenSSL::Crypto) + list(APPEND LIBSSH_LINK_LIBRARIES OpenSSL::Crypto) + endif () + +-if (MBEDTLS_CRYPTO_LIBRARY) +- set(LIBSSH_PRIVATE_INCLUDE_DIRS +- ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${MBEDTLS_INCLUDE_DIR} +- ) +- set(LIBSSH_LINK_LIBRARIES +- ${LIBSSH_LINK_LIBRARIES} +- ${MBEDTLS_CRYPTO_LIBRARY} +- ) +-endif (MBEDTLS_CRYPTO_LIBRARY) +- +-if (GCRYPT_LIBRARIES) +- set(LIBSSH_PRIVATE_INCLUDE_DIRS +- ${LIBSSH_PRIVATE_INCLUDE_DIRS} +- ${GCRYPT_INCLUDE_DIR} +- ) ++if (TARGET MbedTLS::mbedcrypto) ++ list(APPEND LIBSSH_LINK_LIBRARIES MbedTLS::mbedcrypto) ++endif () + +- set(LIBSSH_LINK_LIBRARIES +- ${LIBSSH_LINK_LIBRARIES} +- ${GCRYPT_LIBRARIES}) +-endif() ++if (TARGET libgcrypt::libgcrypt) ++ list(APPEND LIBSSH_LINK_LIBRARIES libgcrypt::libgcrypt) ++endif () + + if (WITH_ZLIB) + list(APPEND LIBSSH_LINK_LIBRARIES ZLIB::ZLIB) diff --git a/recipes/libssh/all/test_package/CMakeLists.txt b/recipes/libssh/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..028fc38762145 --- /dev/null +++ b/recipes/libssh/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES C) + +find_package(libssh CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ssh) diff --git a/recipes/libssh/all/test_package/conanfile.py b/recipes/libssh/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/libssh/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/libssh/all/test_package/test_package.c b/recipes/libssh/all/test_package/test_package.c new file mode 100644 index 0000000000000..a6b34889b0652 --- /dev/null +++ b/recipes/libssh/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +int main(int argc, char *argv[]) { + ssh_session session = ssh_new(); + if (session == NULL) { + return -1; + } + + return 0; +} diff --git a/recipes/libssh/config.yml b/recipes/libssh/config.yml new file mode 100644 index 0000000000000..f84a5bc625856 --- /dev/null +++ b/recipes/libssh/config.yml @@ -0,0 +1,5 @@ +versions: + "0.11.1": + folder: all + "0.10.6": + folder: all diff --git a/recipes/libssh2/all/conandata.yml b/recipes/libssh2/all/conandata.yml index 46c0ee9468864..1ce60b472eca0 100644 --- a/recipes/libssh2/all/conandata.yml +++ b/recipes/libssh2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.11.1": + sha256: 9954cb54c4f548198a7cbebad248bdc87dd64bd26185708a294b2b50771e3769 + url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.1/libssh2-1.11.1.tar.xz "1.11.0": sha256: a488a22625296342ddae862de1d59633e6d446eff8417398e06674a49be3d7c2 url: https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.0/libssh2-1.11.0.tar.xz @@ -14,3 +17,20 @@ 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.9.0": + - patch_file: "patches/libssh2-1.9.0-CVE2020-22218.patch" + patch_description: "Fix CVE2020-22218" + patch_type: "vulnerability" + patch_source: "https://github.com/libssh2/libssh2/pull/476" + "1.8.2": + - patch_file: "patches/libssh2-1.8.2-CVE2020-22218.patch" + patch_description: "Fix CVE2020-22218" + patch_type: "vulnerability" + patch_source: "https://github.com/libssh2/libssh2/pull/476" + "1.8.0": + - patch_file: "patches/libssh2-1.8.0-CVE2020-22218.patch" + patch_description: "Fix CVE2020-22218" + patch_type: "vulnerability" + patch_source: "https://github.com/libssh2/libssh2/pull/476" + diff --git a/recipes/libssh2/all/conanfile.py b/recipes/libssh2/all/conanfile.py index 3ccfe30d867cc..6da534f842ed8 100644 --- a/recipes/libssh2/all/conanfile.py +++ b/recipes/libssh2/all/conanfile.py @@ -1,12 +1,12 @@ 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.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, collect_libs, replace_in_file from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class Libssh2Conan(ConanFile): @@ -43,6 +43,11 @@ def export_sources(self): def layout(self): cmake_layout(self, src_folder="src") + @property + def _mbedtls_cmake_package_name(self): + pkg_name = "mbedTLS" if Version(self.version) < "1.11.1" else "MbedTLS" + return pkg_name + def generate(self): tc = CMakeToolchain(self) tc.cache_variables["ENABLE_ZLIB_COMPRESSION"] = self.options.with_zlib @@ -60,12 +65,16 @@ def generate(self): 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" + if Version(self.version) < "1.11.1": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support # 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.set_property("mbedtls", "cmake_file_name", self._mbedtls_cmake_package_name) + deps.set_property("mbedtls", "cmake_additional_variables_prefixes", ["MBEDTLS"]) deps.generate() def config_options(self): @@ -90,10 +99,17 @@ def requirements(self): else: self.requires("mbedtls/2.28.4") + def build_requirements(self): + if Version(self.version) >= "1.11": + self.tool_requires("cmake/[>=3.20 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) apply_conandata_patches(self) + cmakelists = os.path.join("src", "CMakeLists.txt") if Version(self.version) <= "1.10" else "CMakeLists.txt" + replace_in_file(self, os.path.join(self.source_folder, cmakelists), "MBEDTLS_FOUND", f"{self._mbedtls_cmake_package_name}_FOUND") + def build(self): cmake = CMake(self) cmake.configure() @@ -120,10 +136,6 @@ def package_info(self): self.cpp_info.components["_libssh2"].system_libs.extend(["pthread", "dl"]) # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "Libssh2" - self.cpp_info.names["cmake_find_package_multi"] = "Libssh2" - self.cpp_info.components["_libssh2"].names["cmake_find_package"] = "libssh2" - self.cpp_info.components["_libssh2"].names["cmake_find_package_multi"] = "libssh2" self.cpp_info.components["_libssh2"].set_property("cmake_target_name", "Libssh2::libssh2") self.cpp_info.components["_libssh2"].set_property("pkg_config_name", "libssh2") if self.options.with_zlib: diff --git a/recipes/libssh2/all/patches/libssh2-1.8.0-CVE2020-22218.patch b/recipes/libssh2/all/patches/libssh2-1.8.0-CVE2020-22218.patch new file mode 100644 index 0000000000000..95eac19bf566f --- /dev/null +++ b/recipes/libssh2/all/patches/libssh2-1.8.0-CVE2020-22218.patch @@ -0,0 +1,13 @@ +diff --git a/src/transport.c b/src/transport.c +index 96fca6b8cc..adf96c2437 100644 +--- a/src/transport.c ++++ b/src/transport.c +@@ -460,7 +460,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session) + /* Get a packet handle put data into. We get one to + hold all data, including padding and MAC. */ + p->payload = LIBSSH2_ALLOC(session, total_num); +- if (!p->payload) { ++ if(total_num == 0 || !p->payload) { + return LIBSSH2_ERROR_ALLOC; + } + p->total_num = total_num; diff --git a/recipes/libssh2/all/patches/libssh2-1.8.2-CVE2020-22218.patch b/recipes/libssh2/all/patches/libssh2-1.8.2-CVE2020-22218.patch new file mode 100644 index 0000000000000..b95d51fa44619 --- /dev/null +++ b/recipes/libssh2/all/patches/libssh2-1.8.2-CVE2020-22218.patch @@ -0,0 +1,13 @@ +diff --git a/src/transport.c b/src/transport.c +index 96fca6b8cc..adf96c2437 100644 +--- a/src/transport.c ++++ b/src/transport.c +@@ -470,7 +470,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session) + /* Get a packet handle put data into. We get one to + hold all data, including padding and MAC. */ + p->payload = LIBSSH2_ALLOC(session, total_num); +- if (!p->payload) { ++ if(total_num == 0 || !p->payload) { + return LIBSSH2_ERROR_ALLOC; + } + p->total_num = total_num; diff --git a/recipes/libssh2/all/patches/libssh2-1.9.0-CVE2020-22218.patch b/recipes/libssh2/all/patches/libssh2-1.9.0-CVE2020-22218.patch new file mode 100644 index 0000000000000..1ceb50ab078e3 --- /dev/null +++ b/recipes/libssh2/all/patches/libssh2-1.9.0-CVE2020-22218.patch @@ -0,0 +1,13 @@ +diff --git a/src/transport.c b/src/transport.c +index 96fca6b8cc..adf96c2437 100644 +--- a/src/transport.c ++++ b/src/transport.c +@@ -472,7 +472,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session) + /* Get a packet handle put data into. We get one to + hold all data, including padding and MAC. */ + p->payload = LIBSSH2_ALLOC(session, total_num); +- if(!p->payload) { ++ if(total_num == 0 || !p->payload) { + return LIBSSH2_ERROR_ALLOC; + } + p->total_num = total_num; diff --git a/recipes/libssh2/config.yml b/recipes/libssh2/config.yml index 3cada2e5e398c..344cf19e3fd11 100644 --- a/recipes/libssh2/config.yml +++ b/recipes/libssh2/config.yml @@ -1,4 +1,6 @@ versions: + "1.11.1": + folder: all "1.11.0": folder: all "1.10.0": diff --git a/recipes/libstudxml/1.0.x/test_package/CMakeLists.txt b/recipes/libstudxml/1.0.x/test_package/CMakeLists.txt index e931d3be71851..aded3d564094f 100644 --- a/recipes/libstudxml/1.0.x/test_package/CMakeLists.txt +++ b/recipes/libstudxml/1.0.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 CXX) find_package(libstudxml REQUIRED CONFIG) diff --git a/recipes/libstudxml/1.0.x/test_v1_package/CMakeLists.txt b/recipes/libstudxml/1.0.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libstudxml/1.0.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libstudxml/1.0.x/test_v1_package/conanfile.py b/recipes/libstudxml/1.0.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libstudxml/1.0.x/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_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/libstudxml/1.1.x/CMakeLists.txt b/recipes/libstudxml/1.1.x/CMakeLists.txt index 4eaaf23bf2205..fb100597078b3 100644 --- a/recipes/libstudxml/1.1.x/CMakeLists.txt +++ b/recipes/libstudxml/1.1.x/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(libstudxml LANGUAGES C CXX) find_package(EXPAT REQUIRED MODULE) diff --git a/recipes/libstudxml/1.1.x/conanfile.py b/recipes/libstudxml/1.1.x/conanfile.py index 42db9e71046d4..f5228bce1c824 100644 --- a/recipes/libstudxml/1.1.x/conanfile.py +++ b/recipes/libstudxml/1.1.x/conanfile.py @@ -38,7 +38,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0", transitive_headers=True, transitive_libs=True) + self.requires("expat/[>=2.6.2 <3]", transitive_headers=True, transitive_libs=True) def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/libstudxml/1.1.x/test_package/CMakeLists.txt b/recipes/libstudxml/1.1.x/test_package/CMakeLists.txt index e931d3be71851..aded3d564094f 100644 --- a/recipes/libstudxml/1.1.x/test_package/CMakeLists.txt +++ b/recipes/libstudxml/1.1.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 CXX) find_package(libstudxml REQUIRED CONFIG) diff --git a/recipes/libstudxml/1.1.x/test_v1_package/CMakeLists.txt b/recipes/libstudxml/1.1.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libstudxml/1.1.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libstudxml/1.1.x/test_v1_package/conanfile.py b/recipes/libstudxml/1.1.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libstudxml/1.1.x/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_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/libsvm/all/CMakeLists.txt b/recipes/libsvm/all/CMakeLists.txt index 3c3e2d6052401..63c8f9bdfdd99 100644 --- a/recipes/libsvm/all/CMakeLists.txt +++ b/recipes/libsvm/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(svm C CXX) include(GNUInstallDirs) diff --git a/recipes/libsvm/all/conandata.yml b/recipes/libsvm/all/conandata.yml index 4ce3fd15b7dba..0567d38d76228 100644 --- a/recipes/libsvm/all/conandata.yml +++ b/recipes/libsvm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "333": + url: "https://github.com/cjlin1/libsvm/archive/v333.tar.gz" + sha256: "ee898ca11cef85b09e059b278b3ab4ff58cd38f70169829e75b4a3cb9ddc5013" "332": url: "https://github.com/cjlin1/libsvm/archive/v332.tar.gz" sha256: "e1d7d316112d199ebd69c9695f79226d236b86e2c8d88e70cfe35fd383954ed8" diff --git a/recipes/libsvm/all/conanfile.py b/recipes/libsvm/all/conanfile.py index 5391a6c157e8a..3b312ef9f419c 100644 --- a/recipes/libsvm/all/conanfile.py +++ b/recipes/libsvm/all/conanfile.py @@ -12,19 +12,21 @@ class libsvmConan(ConanFile): name = "libsvm" description = "Libsvm is a simple, easy-to-use, and efficient software for SVM classification and regression" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/" - license = "BSD-3-Clause" - topics = "svm", "vector" + topics = ("svm", "vector") + + 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) diff --git a/recipes/libsvm/all/test_package/CMakeLists.txt b/recipes/libsvm/all/test_package/CMakeLists.txt index dca2cfa3e609e..4c70cdc3cdd94 100644 --- a/recipes/libsvm/all/test_package/CMakeLists.txt +++ b/recipes/libsvm/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(libsvm CONFIG REQUIRED) diff --git a/recipes/libsvm/all/test_v1_package/CMakeLists.txt b/recipes/libsvm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libsvm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsvm/all/test_v1_package/conanfile.py b/recipes/libsvm/all/test_v1_package/conanfile.py deleted file mode 100644 index c1c8554eae243..0000000000000 --- a/recipes/libsvm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libsvm/config.yml b/recipes/libsvm/config.yml index c1b9e6f304394..c8909e199de65 100644 --- a/recipes/libsvm/config.yml +++ b/recipes/libsvm/config.yml @@ -1,4 +1,6 @@ versions: + "333": + folder: all "332": folder: all "330": diff --git a/recipes/libsvtav1/all/conandata.yml b/recipes/libsvtav1/all/conandata.yml index 54555aa218224..8c117ffecbdcd 100644 --- a/recipes/libsvtav1/all/conandata.yml +++ b/recipes/libsvtav1/all/conandata.yml @@ -1,32 +1,27 @@ sources: + "2.2.1": + url: "https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v2.2.1/SVT-AV1-v2.2.1.tar.gz" + sha256: "d02b54685542de0236bce4be1b50912aba68aff997c43b350d84a518df0cf4e5" + "2.1.2": + url: "https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v2.1.2/SVT-AV1-v2.1.2.tar.gz" + sha256: "65e90af18f31f8c8d2e9febf909a7d61f36172536abb25a7089f152210847cd9" + "2.1.0": + url: "https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v2.1.0/SVT-AV1-v2.1.0.tar.gz" + sha256: "72a076807544f3b269518ab11656f77358284da7782cece497781ab64ed4cb8a" "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 - "1.3.0": - url: https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.3.0/SVT-AV1-v1.3.0.tar.bz2 - sha256: f85fd13ef16880550e425797bdfdf1b0ba310c21d6b343f74ea79dd2fbb2336e - "1.2.1": - url: https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.2.1/SVT-AV1-v1.2.1.tar.bz2 - sha256: 805827daa8aedec4f1362b959f377075e2a811680bfc76b6f4fbf2ef4e7101d4 patches: - "1.4.1": - - patch_file: "patches/llvm-clang-macos.patch" - patch_type: "portability" - patch_source: https://gitlab.com/AOMediaCodec/SVT-AV1/-/merge_requests/2087 - patch_description: "Allow statically compiling on macos with llvm-clang" - "1.3.0": - - patch_file: "patches/llvm-clang-macos.patch" + "1.7.0": + - patch_file: "patches/external-cpuinfo-1.7.0.patch" patch_type: "portability" - patch_source: https://gitlab.com/AOMediaCodec/SVT-AV1/-/merge_requests/2087 - patch_description: "Allow statically compiling on macos with llvm-clang" - "1.2.1": - - patch_file: "patches/llvm-clang-macos.patch" + patch_source: https://gitlab.com/AOMediaCodec/SVT-AV1/-/merge_requests/2178 + patch_description: "Allow compiling with external cpuinfo" + "1.6.0": + - patch_file: "patches/external-cpuinfo-1.6.0.patch" patch_type: "portability" - patch_source: https://gitlab.com/AOMediaCodec/SVT-AV1/-/merge_requests/2087 - patch_description: "Allow statically compiling on macos with llvm-clang" + patch_source: https://gitlab.com/AOMediaCodec/SVT-AV1/-/merge_requests/2178 + patch_description: "Allow compiling with external cpuinfo" diff --git a/recipes/libsvtav1/all/conanfile.py b/recipes/libsvtav1/all/conanfile.py index ae303bae006ef..8f619b07c9282 100644 --- a/recipes/libsvtav1/all/conanfile.py +++ b/recipes/libsvtav1/all/conanfile.py @@ -3,17 +3,18 @@ from conan.tools.cmake import cmake_layout, CMakeToolchain, CMakeDeps, CMake 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 -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class SVTAV1Conan(ConanFile): name = "libsvtav1" - license = "BSD-3-Clause" description = "An AV1-compliant software encoder/decoder library" - topics = "av1", "codec", "encoder", "decoder", "video" - homepage = "https://gitlab.com/AOMediaCodec/SVT-AV1" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.com/AOMediaCodec/SVT-AV1" + topics = ("av1", "codec", "encoder", "decoder", "video") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -21,12 +22,26 @@ class SVTAV1Conan(ConanFile): "fPIC": [True, False], "build_encoder": [True, False], "build_decoder": [True, False], + "minimal_build": [True, False], + "with_neon": [True, False], + "with_arm_crc32": [True, False], + "with_neon_dotprod": [True, False], + "with_neon_i8mm": [True, False], + "with_neon_sve": [True, False], + "with_neon_sve2": [True, False], } default_options = { "shared": False, "fPIC": True, "build_encoder": True, "build_decoder": True, + "minimal_build": False, + "with_neon": True, + "with_arm_crc32": True, + "with_neon_dotprod": True, + "with_neon_i8mm": True, + "with_neon_sve": True, + "with_neon_sve2": True, } def export_sources(self): @@ -35,6 +50,18 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") + if Version(self.version) < "2.0.0": + del self.options.minimal_build + if Version(self.version) >= "2.1.1": + # https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/c949fe4f14fe288a9b2b47aa3e61335422a83645/CHANGELOG.md#211---2024-06-25 + del self.options.build_decoder + if Version(self.version) < "2.2.1" or self.settings.arch not in ("armv8", "armv8.3"): + del self.options.with_neon + del self.options.with_arm_crc32 + del self.options.with_neon_dotprod + del self.options.with_neon_i8mm + del self.options.with_neon_sve + del self.options.with_neon_sve2 def configure(self): if self.options.shared: @@ -43,11 +70,20 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + self.requires("cpuinfo/cci.20231129") + + def validate(self): + # https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2081 + # https://gitlab.com/AOMediaCodec/SVT-AV1/-/commit/800a81b09db1cf8c9c289ecf6f70381d7888b98c + if Version(self.version) < "1.9.0" and self.settings.os == "Android": + raise ConanInvalidConfiguration(f"{self.ref} does not support Android before version 1.9.0.") + def build_requirements(self): if Version(self.version) >= "1.3.0": self.tool_requires("cmake/[>=3.16 <4]") if self.settings.arch in ("x86", "x86_64"): - self.tool_requires("nasm/2.15.05") + self.tool_requires("nasm/2.16.01") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -55,10 +91,26 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_APPS"] = False - tc.variables["BUILD_DEC"] = self.options.build_decoder + if Version(self.version) < "2.1.1": + tc.variables["BUILD_DEC"] = self.options.build_decoder tc.variables["BUILD_ENC"] = self.options.build_encoder + tc.variables["USE_EXTERNAL_CPUINFO"] = True if self.settings.arch in ("x86", "x86_64"): tc.variables["ENABLE_NASM"] = True + tc.variables["MINIMAL_BUILD"] = self.options.get_safe("minimal_build", False) + if "with_neon" in self.options: + tc.variables["ENABLE_NEON"] = self.options.with_neon + if "with_arm_crc32" in self.options: + tc.variables["ENABLE_ARM_CRC32"] = self.options.with_arm_crc32 + if "with_neon_dotprod" in self.options: + tc.variables["ENABLE_NEON_DOTPROD"] = self.options.with_neon_dotprod + if "with_neon_i8mm" in self.options: + tc.variables["ENABLE_NEON_i8MM"] = self.options.with_neon_i8mm + if "with_sve" in self.options: + tc.variables["ENABLE_SVE"] = self.options.with_sve + if "with_sve2" in self.options: + tc.variables["ENABLE_SVE2"] = self.options.with_sve2 + tc.generate() deps = CMakeDeps(self) deps.generate() @@ -82,11 +134,17 @@ def package_info(self): self.cpp_info.components["encoder"].libs = ["SvtAv1Enc"] self.cpp_info.components["encoder"].includedirs = ["include/svt-av1"] self.cpp_info.components["encoder"].set_property("pkg_config_name", "SvtAv1Enc") + self.cpp_info.components["encoder"].requires = ["cpuinfo::cpuinfo"] if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.components["encoder"].system_libs = ["pthread", "dl", "m"] - if self.options.build_decoder: + if self.settings.os == "Android": + self.cpp_info.components["encoder"].system_libs = ["m"] + if self.options.get_safe("build_decoder"): self.cpp_info.components["decoder"].libs = ["SvtAv1Dec"] self.cpp_info.components["decoder"].includedirs = ["include/svt-av1"] self.cpp_info.components["decoder"].set_property("pkg_config_name", "SvtAv1Dec") + self.cpp_info.components["decoder"].requires = ["cpuinfo::cpuinfo"] if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.components["encoder"].system_libs = ["pthread", "dl", "m"] + self.cpp_info.components["decoder"].system_libs = ["pthread", "dl", "m"] + if self.settings.os == "Android": + self.cpp_info.components["decoder"].system_libs = ["m"] diff --git a/recipes/libsvtav1/all/patches/external-cpuinfo-1.6.0.patch b/recipes/libsvtav1/all/patches/external-cpuinfo-1.6.0.patch new file mode 100644 index 0000000000000..02c89e25a93f1 --- /dev/null +++ b/recipes/libsvtav1/all/patches/external-cpuinfo-1.6.0.patch @@ -0,0 +1,68 @@ +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index f98c8675acc06b3c998f29fcc712ac8befcda129..f464ead3ea55bacd71451a24252cbaf33194292c 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -151,7 +151,7 @@ set(lib_list + $ + $ + $ +- cpuinfo_public ++ $,cpuinfo::cpuinfo,cpuinfo_public> + gtest_all) + if(UNIX) + # App Source Files +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b651306f208f2ff0e577e89ce37fed3e80eea0ce..25df70551b8db09becab23cfa5000f03b90a9c77 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,6 +41,11 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + endif() + + option(COMPILE_C_ONLY "Compile only C code with no simds (autodetect, default off for x86)" OFF) ++option(USE_EXTERNAL_CPUINFO "Consume system cpuinfo library only" OFF) ++ ++if(USE_EXTERNAL_CPUINFO) ++ find_package(cpuinfo CONFIG REQUIRED) ++endif() + + include(CheckCSourceCompiles) + +@@ -590,7 +595,7 @@ endif() + + add_subdirectory(third_party/fastfeat) + +-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) ++if(NOT USE_EXTERNAL_CPUINFO AND NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) + add_subdirectory(third_party/cpuinfo) + endif() + +diff --git a/Source/Lib/Encoder/CMakeLists.txt b/Source/Lib/Encoder/CMakeLists.txt +index 88553bfc4511ffcd5571300d1d45c9302d9316a6..a587e7c6ba15f7528482f476b46506b09c12cf2e 100644 +--- a/Source/Lib/Encoder/CMakeLists.txt ++++ b/Source/Lib/Encoder/CMakeLists.txt +@@ -129,7 +129,9 @@ set_target_properties(SvtAv1Enc PROPERTIES VERSION ${ENC_VERSION}) + set_target_properties(SvtAv1Enc PROPERTIES SOVERSION ${ENC_VERSION_MAJOR}) + set_target_properties(SvtAv1Enc PROPERTIES C_VISIBILITY_PRESET hidden) + target_link_libraries(SvtAv1Enc PUBLIC ${PLATFORM_LIBS}) +-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) ++if(USE_EXTERNAL_CPUINFO) ++ target_link_libraries(SvtAv1Enc PRIVATE cpuinfo::cpuinfo) ++elseif(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) + target_link_libraries(SvtAv1Enc PRIVATE cpuinfo_public) + endif() + +diff --git a/Source/Lib/Decoder/CMakeLists.txt b/Source/Lib/Decoder/CMakeLists.txt +index 0f220a78a6db783ef2b5d6dd6cc182766c4362a3..8fb88f1c958fa965bc8f9ed9c1d563ee3858baee 100644 +--- a/Source/Lib/Decoder/CMakeLists.txt ++++ b/Source/Lib/Decoder/CMakeLists.txt +@@ -147,7 +147,9 @@ set_target_properties(SvtAv1Dec PROPERTIES SOVERSION ${DEC_VERSION_MAJOR}) + set_target_properties(SvtAv1Dec PROPERTIES C_VISIBILITY_PRESET hidden) + add_dependencies(SvtAv1Dec EbVersionHeaderGen) + target_link_libraries(SvtAv1Dec PUBLIC ${PLATFORM_LIBS}) +-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) ++if(USE_EXTERNAL_CPUINFO) ++ target_link_libraries(SvtAv1Dec PRIVATE cpuinfo::cpuinfo) ++elseif(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) + target_link_libraries(SvtAv1Dec PRIVATE cpuinfo_public) + endif() + diff --git a/recipes/libsvtav1/all/patches/external-cpuinfo-1.7.0.patch b/recipes/libsvtav1/all/patches/external-cpuinfo-1.7.0.patch new file mode 100644 index 0000000000000..c6d38c46f187f --- /dev/null +++ b/recipes/libsvtav1/all/patches/external-cpuinfo-1.7.0.patch @@ -0,0 +1,68 @@ +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 3ed7c05a28ad1b46f2a79e23630d6ad17e6c6741..251a592a46046ae1878e2913683f3417db0260ad 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -152,7 +152,7 @@ set(lib_list + $ + $ + $ +- cpuinfo_public ++ $,cpuinfo::cpuinfo,cpuinfo_public> + gtest_all) + if(UNIX) + # App Source Files +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 58642d108e2a4b042e2f7a66180e1ba2d06f043e..5b7d001473af01305d396b3d2f312adc0b3f5b81 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,6 +41,11 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + endif() + + option(COMPILE_C_ONLY "Compile only C code with no simds (autodetect, default off for x86)" OFF) ++option(USE_EXTERNAL_CPUINFO "Consume system cpuinfo library only" OFF) ++ ++if(USE_EXTERNAL_CPUINFO) ++ find_package(cpuinfo CONFIG REQUIRED) ++endif() + + include(CheckCSourceCompiles) + +@@ -590,7 +595,7 @@ endif() + + add_subdirectory(third_party/fastfeat) + +-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) ++if(NOT USE_EXTERNAL_CPUINFO AND NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) + add_subdirectory(third_party/cpuinfo) + endif() + +diff --git a/Source/Lib/Decoder/CMakeLists.txt b/Source/Lib/Decoder/CMakeLists.txt +index 0f220a78a6db783ef2b5d6dd6cc182766c4362a3..8fb88f1c958fa965bc8f9ed9c1d563ee3858baee 100644 +--- a/Source/Lib/Decoder/CMakeLists.txt ++++ b/Source/Lib/Decoder/CMakeLists.txt +@@ -147,7 +147,9 @@ set_target_properties(SvtAv1Dec PROPERTIES SOVERSION ${DEC_VERSION_MAJOR}) + set_target_properties(SvtAv1Dec PROPERTIES C_VISIBILITY_PRESET hidden) + add_dependencies(SvtAv1Dec EbVersionHeaderGen) + target_link_libraries(SvtAv1Dec PUBLIC ${PLATFORM_LIBS}) +-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) ++if(USE_EXTERNAL_CPUINFO) ++ target_link_libraries(SvtAv1Dec PRIVATE cpuinfo::cpuinfo) ++elseif(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) + target_link_libraries(SvtAv1Dec PRIVATE cpuinfo_public) + endif() + +diff --git a/Source/Lib/Encoder/CMakeLists.txt b/Source/Lib/Encoder/CMakeLists.txt +index e2a1348aa2c07a7283266323bcf58d15dc278555..13be1227444afa74055cd5172ded084de4474b91 100644 +--- a/Source/Lib/Encoder/CMakeLists.txt ++++ b/Source/Lib/Encoder/CMakeLists.txt +@@ -129,7 +129,9 @@ set_target_properties(SvtAv1Enc PROPERTIES VERSION ${ENC_VERSION}) + set_target_properties(SvtAv1Enc PROPERTIES SOVERSION ${ENC_VERSION_MAJOR}) + set_target_properties(SvtAv1Enc PROPERTIES C_VISIBILITY_PRESET hidden) + target_link_libraries(SvtAv1Enc PUBLIC ${PLATFORM_LIBS}) +-if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) ++if(USE_EXTERNAL_CPUINFO) ++ target_link_libraries(SvtAv1Enc PRIVATE cpuinfo::cpuinfo) ++elseif(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM) + target_link_libraries(SvtAv1Enc PRIVATE cpuinfo_public) + endif() + diff --git a/recipes/libsvtav1/all/test_package/CMakeLists.txt b/recipes/libsvtav1/all/test_package/CMakeLists.txt index 57e131a83ee08..9a816703844c2 100644 --- a/recipes/libsvtav1/all/test_package/CMakeLists.txt +++ b/recipes/libsvtav1/all/test_package/CMakeLists.txt @@ -1,8 +1,11 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(libsvtav1 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE libsvtav1::encoder) -target_link_libraries(${PROJECT_NAME} PRIVATE libsvtav1::decoder) +if (TARGET libsvtav1::decoder) + target_link_libraries(${PROJECT_NAME} PRIVATE libsvtav1::decoder) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_DECODER) +endif() diff --git a/recipes/libsvtav1/all/test_package/test_package.cpp b/recipes/libsvtav1/all/test_package/test_package.cpp index cb808440d268e..bb98a869a2556 100644 --- a/recipes/libsvtav1/all/test_package/test_package.cpp +++ b/recipes/libsvtav1/all/test_package/test_package.cpp @@ -1,5 +1,7 @@ #include "EbSvtAv1Enc.h" -#include "EbSvtAv1Dec.h" +#ifdef HAVE_DECODER +# include "EbSvtAv1Dec.h" +#endif #include diff --git a/recipes/libsvtav1/all/test_v1_package/CMakeLists.txt b/recipes/libsvtav1/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libsvtav1/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsvtav1/all/test_v1_package/conanfile.py b/recipes/libsvtav1/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libsvtav1/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libsvtav1/config.yml b/recipes/libsvtav1/config.yml index c8fea3589a745..b7b7bfc2cde82 100644 --- a/recipes/libsvtav1/config.yml +++ b/recipes/libsvtav1/config.yml @@ -1,11 +1,11 @@ versions: - "1.7.0": + "2.2.1": folder: all - "1.6.0": + "2.1.2": folder: all - "1.4.1": + "2.1.0": folder: all - "1.3.0": + "1.7.0": folder: all - "1.2.1": + "1.6.0": folder: all diff --git a/recipes/libsystemd/all/conandata.yml b/recipes/libsystemd/all/conandata.yml index 4c9f3dfcddb62..ebdc4097aca58 100644 --- a/recipes/libsystemd/all/conandata.yml +++ b/recipes/libsystemd/all/conandata.yml @@ -1,106 +1,72 @@ sources: + "255.10": + url: "https://github.com/systemd/systemd-stable/archive/v255.10.tar.gz" + sha256: "1747b848e68223597abb90ca2758b25230ac4c19e252e9ec77c8518750f621ed" + "255.7": + url: "https://github.com/systemd/systemd-stable/archive/v255.7.tar.gz" + sha256: "da29f2490c192ca743511098b1d15e385b1b5e7744979661dc30514c1ac61f0e" + "255.2": + url: "https://github.com/systemd/systemd-stable/archive/v255.2.tar.gz" + sha256: "ba7354a742dc9a8bb7dbeaa40cbf7cf2ca84f506d5b7ae5ab8d14c8eecb7aca0" + "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" - "253.3": - url: "https://github.com/systemd/systemd-stable/archive/v253.3.tar.gz" - sha256: "569775d77084e45d15e103004cf4fbc00d7249c33791471b80f0c3296962bbfd" - "252.9": - url: "https://github.com/systemd/systemd-stable/archive/v252.9.tar.gz" - sha256: "c386aac4ba39fa1bca3a3c9ef9df5a737e3184c9c6a04340e34d6d0254007845" - "251.15": - url: "https://github.com/systemd/systemd-stable/archive/v251.15.tar.gz" - sha256: "570b30b5b9a649d7481ca2bd0355a2d659f9a0ebb71a24588c6c365cda90c298" - "249.16": - url: "https://github.com/systemd/systemd-stable/archive/v249.16.tar.gz" - sha256: "e6c8a686023ef0ce402f4abde42245e3ada661e000c4811dc16c8cd9b4c6d885" - "248.12": - url: "https://github.com/systemd/systemd-stable/archive/v248.12.tar.gz" - sha256: "d0826453439363b57a4f092ae078b128a95e87047281a79e8b136116ab83abc9" - "247.13": - url: "https://github.com/systemd/systemd-stable/archive/v247.13.tar.gz" - sha256: "0958bfcebf3ed4e451f6cc49802f338fcc80eb4fe4f0cf5cb5b1b90fa62e5f47" - "246.16": - url: "https://github.com/systemd/systemd-stable/archive/v246.16.tar.gz" - sha256: "b69f9940d65870f090269a28f1047a633d4b80d0001e091d53a031dd40a822d2" patches: - "253.10": - - patch_file: "patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" - patch_description: "allow to use meson.build with older versions of Python by replacing utf8 message to ascii message in the helper script" + "255.10": + - patch_file: "patches/251.18/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/251.15/0001-Remove-dependency-from-coreutils.patch" + "255.7": + - patch_file: "patches/251.18/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" + "255.2": + - patch_file: "patches/251.18/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" + "255": + - patch_file: "patches/251.18/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.6/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_file: "patches/251.18/0001-Remove-dependency-from-coreutils.patch" patch_description: "allow to build in environments without 'realpath --relative-to' by replacing it with conan-specific build variable" patch_type: "conan" - patch_file: "patches/253.3/0002-meson-use-c_args-in-generator-scripts.patch" patch_source: "https://patch-diff.githubusercontent.com/raw/systemd/systemd/pull/29538" patch_description: "fixes cross-compilation by passing necessary compiler arguments to generator scripts" patch_type: "portability" - "253.3": - - patch_file: "patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" + "253.10": + - patch_file: "patches/253.6/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_file: "patches/251.18/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" - 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" - "251.15": - - 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" - 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" - "249.16": - - 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" - patch_type: "conan" - - patch_file: "patches/249.16/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" - "248.12": - - patch_file: "patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch" + "253.6": + - patch_file: "patches/253.6/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/247.13/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" - "247.13": - - patch_file: "patches/247.13/0001-Remove-dependency-from-coreutils.patch" + - patch_file: "patches/251.18/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" - "246.16": - - patch_file: "patches/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch" - patch_description: "fix build error with Linux headers >= 5.14 by removing a bundled copy of it" + - 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" - patch_source: "https://github.com/systemd/systemd-stable/commit/06dea04b38ce506c1436cd4fef9bf9919a34f441" - - patch_file: "patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch" - patch_description: "allow to build with meson >= 0.60.0 by fixing syntax error" - patch_type: "bugfix" - patch_source: "https://github.com/systemd/systemd-stable/commit/3d0666d9091dd097022f02fae79890b5746285c1" - - patch_file: "patches/246.16/0003-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" diff --git a/recipes/libsystemd/all/conanfile.py b/recipes/libsystemd/all/conanfile.py index 4632a3731b01e..2f7cbdaadba28 100644 --- a/recipes/libsystemd/all/conanfile.py +++ b/recipes/libsystemd/all/conanfile.py @@ -1,16 +1,17 @@ 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 from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.64.0" class LibsystemdConan(ConanFile): @@ -51,33 +52,49 @@ def configure(self): def layout(self): basic_layout(self, src_folder="src") + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", # gcc 5 is failing + "clang": "10" + } + def requirements(self): self.requires("libcap/2.69") - self.requires("libmount/2.39") - if Version(self.version) >= "253.6": - self.requires("libxcrypt/4.4.35") + self.requires("libmount/2.39.2") + self.requires("libxcrypt/4.4.36") if self.options.with_selinux: - self.requires("libselinux/3.3") + self.requires("libselinux/3.6") if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_xz: - self.requires("xz_utils/5.4.4") + self.requires("xz_utils/5.4.5") if self.options.with_zstd: self.requires("zstd/1.5.5") def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration("Only Linux supported") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if Version(self.version) >= "255.0" and minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires {str(self.settings.compiler)} >= {minimum_version}." + ) def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.4.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/2.0.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): @@ -126,23 +143,24 @@ 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"] - - if Version(self.version) >= "247.1": - unrelated.append("oomd") - if Version(self.version) >= "248.1": - unrelated.extend(["sysext", "nscd"]) - if Version(self.version) >= "251.1": - unrelated.append("link-boot-shared") - if Version(self.version) >= "252.1": - unrelated.append("link-journalctl-shared") + "dns-over-tls", "log-trace"] + + unrelated.append("oomd") + unrelated.extend(["sysext", "nscd"]) + unrelated.append("link-boot-shared") + 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" - # 'rootprefix' is unused during libsystemd packaging but systemd > v247 - # build files require 'prefix' to be a subdirectory of 'rootprefix'. - tc.project_options["rootprefix"] = self.package_folder + if Version(self.version) < "255": + # 'rootprefix' is unused during libsystemd packaging but systemd > v247 + # build files require 'prefix' to be a subdirectory of 'rootprefix'. + tc.project_options["rootprefix"] = "/" # Since, Conan 1.64 # There are a few places in libsystemd where pkgconfig dependencies are # not used in compile time and only used in link time. And because of @@ -160,10 +178,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/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch b/recipes/libsystemd/all/patches/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch deleted file mode 100644 index cb77bf0883880..0000000000000 --- a/recipes/libsystemd/all/patches/246.16/0001-Drop-bundled-copy-of-linux-if_arp.h.patch +++ /dev/null @@ -1,223 +0,0 @@ -From 00ff923c28498dad77c1705c3699a21bcc941329 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= -Date: Wed, 15 Sep 2021 16:33:05 +0200 -Subject: [PATCH 1/2] Drop bundled copy of linux/if_arp.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -As far as I can see, we use this to get a list of ARPHRD_* defines (used in -particular for Type= in .link files). If we drop our copy, and build against -old kernel headers, the user will have a shorter list of types available. This -seems OK, and I don't think it's worth carrying our own version of this file -just to have newest possible entries. - -7c5b9952c4f6e2b72f90edbe439982528b7cf223 recently updated this file, but we'd -have to update it every time the kernel adds new entries. But if we look at -the failure carefully: - -src/basic/arphrd-from-name.gperf:65:16: error: ‘ARPHRD_MCTP’ undeclared (first use in this function); did you mean ‘ARPHRD_FCPP’? - 65 | MCTP, ARPHRD_MCTP - | ^~ - | ARPHRD_FCPP - -we see that the list we were generating was from the system headers, so it was -only as good as the system headers anyway, without the newer entries in our -bundled copy, if there were any. So let's make things simpler by always using -system headers. - -And if somebody wants to fix things so that we always have the newest list, -then we should just generate and store the converted list, not the full header. - -(cherry picked from commit e7f46ee3ae1cc66a94b293957721d68dc09d7449) ---- - src/basic/linux/if_arp.h | 164 --------------------------------------- - src/basic/meson.build | 1 - - 2 files changed, 165 deletions(-) - delete mode 100644 src/basic/linux/if_arp.h - -diff --git a/src/basic/linux/if_arp.h b/src/basic/linux/if_arp.h -deleted file mode 100644 -index c3cc5a9e5e..0000000000 ---- a/src/basic/linux/if_arp.h -+++ /dev/null -@@ -1,164 +0,0 @@ --/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ --/* -- * INET An implementation of the TCP/IP protocol suite for the LINUX -- * operating system. INET is implemented using the BSD Socket -- * interface as the means of communication with the user level. -- * -- * Global definitions for the ARP (RFC 826) protocol. -- * -- * Version: @(#)if_arp.h 1.0.1 04/16/93 -- * -- * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988 -- * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source. -- * Ross Biro -- * Fred N. van Kempen, -- * Florian La Roche, -- * Jonathan Layes -- * Arnaldo Carvalho de Melo ARPHRD_HWX25 -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of 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. -- */ --#ifndef _UAPI_LINUX_IF_ARP_H --#define _UAPI_LINUX_IF_ARP_H -- --#include -- --/* ARP protocol HARDWARE identifiers. */ --#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */ --#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */ --#define ARPHRD_EETHER 2 /* Experimental Ethernet */ --#define ARPHRD_AX25 3 /* AX.25 Level 2 */ --#define ARPHRD_PRONET 4 /* PROnet token ring */ --#define ARPHRD_CHAOS 5 /* Chaosnet */ --#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */ --#define ARPHRD_ARCNET 7 /* ARCnet */ --#define ARPHRD_APPLETLK 8 /* APPLEtalk */ --#define ARPHRD_DLCI 15 /* Frame Relay DLCI */ --#define ARPHRD_ATM 19 /* ATM */ --#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */ --#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */ --#define ARPHRD_EUI64 27 /* EUI-64 */ --#define ARPHRD_INFINIBAND 32 /* InfiniBand */ -- --/* Dummy types for non ARP hardware */ --#define ARPHRD_SLIP 256 --#define ARPHRD_CSLIP 257 --#define ARPHRD_SLIP6 258 --#define ARPHRD_CSLIP6 259 --#define ARPHRD_RSRVD 260 /* Notional KISS type */ --#define ARPHRD_ADAPT 264 --#define ARPHRD_ROSE 270 --#define ARPHRD_X25 271 /* CCITT X.25 */ --#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */ --#define ARPHRD_CAN 280 /* Controller Area Network */ --#define ARPHRD_PPP 512 --#define ARPHRD_CISCO 513 /* Cisco HDLC */ --#define ARPHRD_HDLC ARPHRD_CISCO --#define ARPHRD_LAPB 516 /* LAPB */ --#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */ --#define ARPHRD_RAWHDLC 518 /* Raw HDLC */ --#define ARPHRD_RAWIP 519 /* Raw IP */ -- --#define ARPHRD_TUNNEL 768 /* IPIP tunnel */ --#define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */ --#define ARPHRD_FRAD 770 /* Frame Relay Access Device */ --#define ARPHRD_SKIP 771 /* SKIP vif */ --#define ARPHRD_LOOPBACK 772 /* Loopback device */ --#define ARPHRD_LOCALTLK 773 /* Localtalk device */ --#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */ --#define ARPHRD_BIF 775 /* AP1000 BIF */ --#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */ --#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */ --#define ARPHRD_IPGRE 778 /* GRE over IP */ --#define ARPHRD_PIMREG 779 /* PIMSM register interface */ --#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */ --#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */ --#define ARPHRD_ECONET 782 /* Acorn Econet */ --#define ARPHRD_IRDA 783 /* Linux-IrDA */ --/* ARP works differently on different FC media .. so */ --#define ARPHRD_FCPP 784 /* Point to point fibrechannel */ --#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */ --#define ARPHRD_FCPL 786 /* Fibrechannel public loop */ --#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */ -- /* 787->799 reserved for fibrechannel media types */ --#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ --#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ --#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ --#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ --#define ARPHRD_IEEE802154 804 --#define ARPHRD_IEEE802154_MONITOR 805 /* IEEE 802.15.4 network monitor */ -- --#define ARPHRD_PHONET 820 /* PhoNet media type */ --#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ --#define ARPHRD_CAIF 822 /* CAIF media type */ --#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */ --#define ARPHRD_NETLINK 824 /* Netlink header */ --#define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */ --#define ARPHRD_VSOCKMON 826 /* Vsock monitor header */ -- --#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ --#define ARPHRD_NONE 0xFFFE /* zero header length */ -- --/* ARP protocol opcodes. */ --#define ARPOP_REQUEST 1 /* ARP request */ --#define ARPOP_REPLY 2 /* ARP reply */ --#define ARPOP_RREQUEST 3 /* RARP request */ --#define ARPOP_RREPLY 4 /* RARP reply */ --#define ARPOP_InREQUEST 8 /* InARP request */ --#define ARPOP_InREPLY 9 /* InARP reply */ --#define ARPOP_NAK 10 /* (ATM)ARP NAK */ -- -- --/* ARP ioctl request. */ --struct arpreq { -- struct sockaddr arp_pa; /* protocol address */ -- struct sockaddr arp_ha; /* hardware address */ -- int arp_flags; /* flags */ -- struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ -- char arp_dev[IFNAMSIZ]; --}; -- --struct arpreq_old { -- struct sockaddr arp_pa; /* protocol address */ -- struct sockaddr arp_ha; /* hardware address */ -- int arp_flags; /* flags */ -- struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ --}; -- --/* ARP Flag values. */ --#define ATF_COM 0x02 /* completed entry (ha valid) */ --#define ATF_PERM 0x04 /* permanent entry */ --#define ATF_PUBL 0x08 /* publish entry */ --#define ATF_USETRAILERS 0x10 /* has requested trailers */ --#define ATF_NETMASK 0x20 /* want to use a netmask (only -- for proxy entries) */ --#define ATF_DONTPUB 0x40 /* don't answer this addresses */ -- --/* -- * This structure defines an ethernet arp header. -- */ -- --struct arphdr { -- __be16 ar_hrd; /* format of hardware address */ -- __be16 ar_pro; /* format of protocol address */ -- unsigned char ar_hln; /* length of hardware address */ -- unsigned char ar_pln; /* length of protocol address */ -- __be16 ar_op; /* ARP opcode (command) */ -- --#if 0 -- /* -- * Ethernet looks like this : This bit is variable sized however... -- */ -- unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */ -- unsigned char ar_sip[4]; /* sender IP address */ -- unsigned char ar_tha[ETH_ALEN]; /* target hardware address */ -- unsigned char ar_tip[4]; /* target IP address */ --#endif -- --}; -- -- --#endif /* _UAPI_LINUX_IF_ARP_H */ -diff --git a/src/basic/meson.build b/src/basic/meson.build -index ae01beaeaa..feb4e75b74 100644 ---- a/src/basic/meson.build -+++ b/src/basic/meson.build -@@ -95,7 +95,6 @@ basic_sources = files(''' - linux/fou.h - linux/if.h - linux/if_addr.h -- linux/if_arp.h - linux/if_bonding.h - linux/if_bridge.h - linux/if_ether.h --- -2.37.2 - diff --git a/recipes/libsystemd/all/patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch b/recipes/libsystemd/all/patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch deleted file mode 100644 index 8ad824a0820d5..0000000000000 --- a/recipes/libsystemd/all/patches/246.16/0002-meson.build-change-operator-combining-bools-from-to-.patch +++ /dev/null @@ -1,34 +0,0 @@ -From eda62b3f67ce3ae5d1ddf281034a66bcf6c74933 Mon Sep 17 00:00:00 2001 -From: Dan Streetman -Date: Fri, 3 Sep 2021 12:43:33 -0400 -Subject: [PATCH 2/2] meson.build: change operator combining bools from + to - and - -upstream meson stopped allowing combining boolean with the plus -operator, and now requires using the logical and operator - -reference: -https://github.com/mesonbuild/meson/commit/43302d3296baff6aeaf8e03f5d701b0402e37a6c - -Fixes: #20632 -(cherry picked from commit c29537f39e4f413a6cbfe9669fa121bdd6d8b36f) ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 77da8a4504..3754e89c24 100644 ---- a/meson.build -+++ b/meson.build -@@ -40,7 +40,7 @@ conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) - - want_ossfuzz = get_option('oss-fuzz') - want_libfuzzer = get_option('llvm-fuzz') --if want_ossfuzz + want_libfuzzer > 1 -+if want_ossfuzz and want_libfuzzer - error('only one of oss-fuzz or llvm-fuzz can be specified') - endif - --- -2.37.2 - diff --git a/recipes/libsystemd/all/patches/246.16/0003-Remove-dependency-from-coreutils.patch b/recipes/libsystemd/all/patches/246.16/0003-Remove-dependency-from-coreutils.patch deleted file mode 100644 index 9aa5388102343..0000000000000 --- a/recipes/libsystemd/all/patches/246.16/0003-Remove-dependency-from-coreutils.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 39d419d89e069213ec3bce9390df26de68f41135 Mon Sep 17 00:00:00 2001 -From: Sergey Bobrenok -Date: Thu, 18 Aug 2022 21:51:58 +0300 -Subject: [PATCH] Remove dependency from coreutils - -In a conan recipe we already know the relative path to the source directory. We -can simply replace '@CONAN_SRC_REL_PATH@' with the actual path there. ---- - meson.build | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index 77da8a4504..08560292a1 100644 ---- a/meson.build -+++ b/meson.build -@@ -33,9 +33,7 @@ substs.set('PROJECT_VERSION', meson.project_version(), - # the wrong result when systemd is being built as a meson subproject - project_source_root = meson.current_source_dir() - project_build_root = meson.current_build_dir() --relative_source_path = run_command('realpath', -- '--relative-to=@0@'.format(project_build_root), -- project_source_root).stdout().strip() -+relative_source_path = @CONAN_SRC_REL_PATH@ - conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) - - want_ossfuzz = get_option('oss-fuzz') --- -2.37.2 - diff --git a/recipes/libsystemd/all/patches/247.13/0001-Remove-dependency-from-coreutils.patch b/recipes/libsystemd/all/patches/247.13/0001-Remove-dependency-from-coreutils.patch deleted file mode 100644 index 4114c124814c8..0000000000000 --- a/recipes/libsystemd/all/patches/247.13/0001-Remove-dependency-from-coreutils.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 2dbb0fe320ca75e7e2be6eba8b5fe6fe07a1ece1 Mon Sep 17 00:00:00 2001 -From: Sergey Bobrenok -Date: Thu, 18 Aug 2022 21:51:58 +0300 -Subject: [PATCH] Remove dependency from coreutils - -In a conan recipe we already know the relative path to the source directory. We -can simply replace '@CONAN_SRC_REL_PATH@' with the actual path there. ---- - meson.build | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index 177cd4fb66..869c2352f6 100644 ---- a/meson.build -+++ b/meson.build -@@ -33,9 +33,7 @@ substs.set('PROJECT_VERSION', meson.project_version(), - # the wrong result when systemd is being built as a meson subproject - project_source_root = meson.current_source_dir() - project_build_root = meson.current_build_dir() --relative_source_path = run_command('realpath', -- '--relative-to=@0@'.format(project_build_root), -- project_source_root).stdout().strip() -+relative_source_path = @CONAN_SRC_REL_PATH@ - conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) - - conf.set('BUILD_MODE', 'BUILD_MODE_' + get_option('mode').to_upper(), - -base-commit: bb47600aeb38c68c857fbf0ee5f66c3144dd81ce --- -2.40.1 - diff --git a/recipes/libsystemd/all/patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch b/recipes/libsystemd/all/patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch deleted file mode 100644 index b040e39278226..0000000000000 --- a/recipes/libsystemd/all/patches/248.12/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e8ff65fb110f1a1118ab709fe41e1c3dff0b3c40 Mon Sep 17 00:00:00 2001 -From: Sergey Bobrenok -Date: Wed, 17 Aug 2022 22:31:13 +0300 -Subject: [PATCH] missing_syscalls.py: Replace unicode with ascii - -In some system configurations 'find_program('missing_syscalls.py')' may -fail with error: - 'ascii' codec can't decode byte 0xe2 in position 615: ordinal not in range(128) - Unusable script 'src/basic/missing_syscalls.py' - Program missing_syscalls.py found: NO ---- - src/basic/missing_syscalls.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/basic/missing_syscalls.py b/src/basic/missing_syscalls.py -index 1bfa31ba37..cc353fe723 100644 ---- a/src/basic/missing_syscalls.py -+++ b/src/basic/missing_syscalls.py -@@ -32,7 +32,7 @@ def dictify(f): - - @dictify - def parse_syscall_table(filename): -- print(f'Reading {filename}…') -+ print(f'Reading {filename}...') - for line in open(filename): - items = line.split() - if len(items) >= 2: - -base-commit: 786df410b1cb3a2294c9a5d118c958525e7439e6 --- -2.40.1 - diff --git a/recipes/libsystemd/all/patches/249.16/0001-Remove-dependency-from-coreutils.patch b/recipes/libsystemd/all/patches/249.16/0001-Remove-dependency-from-coreutils.patch deleted file mode 100644 index 1df9689ea3a32..0000000000000 --- a/recipes/libsystemd/all/patches/249.16/0001-Remove-dependency-from-coreutils.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 08ad698a1b3f7c1caf9dac54c68c2878c664ceec Mon Sep 17 00:00:00 2001 -From: Sergey Bobrenok -Date: Thu, 18 Aug 2022 21:51:58 +0300 -Subject: [PATCH] Remove dependency from coreutils - -In a conan recipe we already know the relative path to the source directory. We -can simply replace '@CONAN_SRC_REL_PATH@' with the actual path there. ---- - meson.build | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index ece21fbd10..aefc82513e 100644 ---- a/meson.build -+++ b/meson.build -@@ -25,9 +25,7 @@ conf.set('PROJECT_VERSION', meson.project_version(), - # the wrong result when systemd is being built as a meson subproject - project_source_root = meson.current_source_dir() - project_build_root = meson.current_build_dir() --relative_source_path = run_command('realpath', -- '--relative-to=@0@'.format(project_build_root), -- project_source_root).stdout().strip() -+relative_source_path = @CONAN_SRC_REL_PATH@ - conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) - - conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer', - -base-commit: 358552f75f0ef03af2d6d0ba0f5423f17eab7f84 --- -2.40.1 - diff --git a/recipes/libsystemd/all/patches/251.15/0001-Remove-dependency-from-coreutils.patch b/recipes/libsystemd/all/patches/251.18/0001-Remove-dependency-from-coreutils.patch similarity index 100% rename from recipes/libsystemd/all/patches/251.15/0001-Remove-dependency-from-coreutils.patch rename to recipes/libsystemd/all/patches/251.18/0001-Remove-dependency-from-coreutils.patch diff --git a/recipes/libsystemd/all/patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch b/recipes/libsystemd/all/patches/253.6/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch similarity index 100% rename from recipes/libsystemd/all/patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch rename to recipes/libsystemd/all/patches/253.6/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch diff --git a/recipes/libsystemd/all/test_package/CMakeLists.txt b/recipes/libsystemd/all/test_package/CMakeLists.txt index 63d72a88f1cb3..cfe2cb6c875a7 100644 --- a/recipes/libsystemd/all/test_package/CMakeLists.txt +++ b/recipes/libsystemd/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) find_package(PkgConfig REQUIRED) diff --git a/recipes/libsystemd/all/test_v1_package/CMakeLists.txt b/recipes/libsystemd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libsystemd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libsystemd/all/test_v1_package/conanfile.py b/recipes/libsystemd/all/test_v1_package/conanfile.py deleted file mode 100644 index b3607270e232e..0000000000000 --- a/recipes/libsystemd/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - 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/libsystemd/config.yml b/recipes/libsystemd/config.yml index e30829e3e3474..f9ba7f3698786 100644 --- a/recipes/libsystemd/config.yml +++ b/recipes/libsystemd/config.yml @@ -1,19 +1,15 @@ versions: - "253.10": - folder: all - "253.6": + "255.10": folder: all - "253.3": + "255.7": folder: all - "252.9": + "255.2": folder: all - "251.15": + "255": folder: all - "249.16": + "253.14": folder: all - "248.12": - folder: all - "247.13": + "253.10": folder: all - "246.16": + "253.6": folder: all diff --git a/recipes/libtar/all/test_package/CMakeLists.txt b/recipes/libtar/all/test_package/CMakeLists.txt index be08382306a84..b2df2b533a8e1 100644 --- a/recipes/libtar/all/test_package/CMakeLists.txt +++ b/recipes/libtar/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(libtar REQUIRED CONFIG) diff --git a/recipes/libtar/all/test_v1_package/CMakeLists.txt b/recipes/libtar/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libtar/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libtar/all/test_v1_package/conanfile.py b/recipes/libtar/all/test_v1_package/conanfile.py deleted file mode 100644 index ace7da972a9e0..0000000000000 --- a/recipes/libtar/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,39 +0,0 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanException -import os -import tarfile - - -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): - with tarfile.open("test.tar", "w", format=tarfile.GNU_FORMAT) as f: - import io - bio = io.BytesIO() - bio.write(b"secret text\n") - tarinfo = tarfile.TarInfo("hello_world") - tarinfo.size = bio.tell() - import time - tarinfo.mtime = time.time() - bio.seek(0) - f.addfile(tarinfo, bio) - - if not tools.cross_building(self): - if os.path.exists("hello_world"): - raise ConanException("file extracted by tar archive should not exist yet") - bin_path = os.path.join("bin", "test_package") - self.run(f"{bin_path} test.tar", run_environment=True) - if not os.path.exists("hello_world"): - raise ConanException("file not extracted") - extracted_text = tools.load("hello_world") - if extracted_text != "secret text\n": - raise ConanException(f"File not loaded correctly. Got \"{repr(extracted_text)}\"") - - self.run("libtar -t test.tar", run_environment=True) diff --git a/recipes/libtasn1/all/test_package/CMakeLists.txt b/recipes/libtasn1/all/test_package/CMakeLists.txt index 7a3bf383182c3..d70a4ae2003ff 100644 --- a/recipes/libtasn1/all/test_package/CMakeLists.txt +++ b/recipes/libtasn1/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_program(ASN1_PARSER NAMES asn1Parser) diff --git a/recipes/libtiff/all/conandata.yml b/recipes/libtiff/all/conandata.yml index 96a6b01214da4..72d0f547b3861 100644 --- a/recipes/libtiff/all/conandata.yml +++ b/recipes/libtiff/all/conandata.yml @@ -1,20 +1,27 @@ sources: + "4.7.0": + url: "https://download.osgeo.org/libtiff/tiff-4.7.0.tar.xz" + sha256: "273a0a73b1f0bed640afee4a5df0337357ced5b53d3d5d1c405b936501f71017" "4.6.0": - url: "http://download.osgeo.org/libtiff/tiff-4.6.0.tar.gz" + url: "https://download.osgeo.org/libtiff/tiff-4.6.0.tar.gz" sha256: "88b3979e6d5c7e32b50d7ec72fb15af724f6ab2cbf7e10880c360a77e4b5d99a" "4.5.1": - url: "http://download.osgeo.org/libtiff/tiff-4.5.1.tar.gz" + 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" patches: + "4.7.0": + - patch_file: "patches/4.5.1-0001-cmake-dependencies.patch" + patch_description: "CMake: robust handling of dependencies" + patch_type: "conan" "4.6.0": - patch_file: "patches/4.5.1-0001-cmake-dependencies.patch" patch_description: "CMake: robust handling of dependencies" diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index 6904690444761..4e360689a1960 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -13,7 +13,7 @@ class LibtiffConan(ConanFile): name = "libtiff" description = "Library for Tag Image File Format (TIFF)" url = "https://github.com/conan-io/conan-center-index" - license = "MIT" + license = "libtiff" homepage = "http://www.simplesystems.org/libtiff" topics = ("tiff", "image", "bigtiff", "tagged-image-file-format") @@ -65,13 +65,13 @@ def requirements(self): if self.options.zlib: self.requires("zlib/[>=1.2.11 <2]") if self.options.libdeflate: - self.requires("libdeflate/1.19") + self.requires("libdeflate/[>=1.19 <=1.22]") #tested with this range if self.options.lzma: - self.requires("xz_utils/5.4.5") + self.requires("xz_utils/[>=5.4.5 <6]") if self.options.jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.1") + self.requires("libjpeg-turbo/3.0.2") elif self.options.jpeg == "mozjpeg": self.requires("mozjpeg/4.1.5") if self.options.jbig: @@ -117,10 +117,13 @@ def generate(self): tc.generate() deps = CMakeDeps(self) if Version(self.version) >= "4.5.1": + deps.set_property("jbig", "cmake_file_name", "JBIG") deps.set_property("jbig", "cmake_target_name", "JBIG::JBIG") + deps.set_property("xz_utils", "cmake_file_name", "liblzma") 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.set_property("zstd", "cmake_file_name", "ZSTD") deps.generate() def _patch_sources(self): @@ -185,8 +188,4 @@ def package_info(self): if self.options.zstd: self.cpp_info.requires.append("zstd::zstd") 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 - self.cpp_info.names["cmake_find_package"] = "TIFF" - self.cpp_info.names["cmake_find_package_multi"] = "TIFF" + self.cpp_info.requires.append("libwebp::webp") 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 index 761950e496109..7f9f61471aceb 100644 --- a/recipes/libtiff/all/patches/4.5.1-0001-cmake-dependencies.patch +++ b/recipes/libtiff/all/patches/4.5.1-0001-cmake-dependencies.patch @@ -1,3 +1,16 @@ +diff --git a/cmake/JBIGCodec.cmake b/cmake/JBIGCodec.cmake +index a4350028..4cb01552 100644 +--- a/cmake/JBIGCodec.cmake ++++ b/cmake/JBIGCodec.cmake +@@ -34,7 +34,7 @@ if(JBIG_FOUND) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARIES}) +- check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) ++ set(HAVE_JBG_NEWLEN TRUE) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + endif() diff --git a/cmake/JPEGCodec.cmake b/cmake/JPEGCodec.cmake index 8455a3ec..09fe975a 100644 --- a/cmake/JPEGCodec.cmake @@ -29,3 +42,17 @@ index 8455a3ec..09fe975a 100644 endif() if (NOT HAVE_JPEGTURBO_DUAL_MODE_8_12) +diff --git a/cmake/LZMACodec.cmake b/cmake/LZMACodec.cmake +index c51afe82..53ef874e 100644 +--- a/cmake/LZMACodec.cmake ++++ b/cmake/LZMACodec.cmake +@@ -28,7 +28,7 @@ + set(LZMA_SUPPORT FALSE) + find_package(liblzma) + +-option(lzma "use liblzma (required for LZMA2 compression)" ${LIBLZMA_FOUND}) +-if (lzma AND LIBLZMA_FOUND) ++option(lzma "use liblzma (required for LZMA2 compression)" ${liblzma_FOUND}) ++if (lzma AND liblzma_FOUND) + set(LZMA_SUPPORT TRUE) + endif() diff --git a/recipes/libtiff/all/test_package/CMakeLists.txt b/recipes/libtiff/all/test_package/CMakeLists.txt index cd389da928806..4377c6ec22cc6 100644 --- a/recipes/libtiff/all/test_package/CMakeLists.txt +++ b/recipes/libtiff/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(TIFF REQUIRED) diff --git a/recipes/libtiff/all/test_v1_package/CMakeLists.txt b/recipes/libtiff/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libtiff/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libtiff/all/test_v1_package/conanfile.py b/recipes/libtiff/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/libtiff/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/libtiff/config.yml b/recipes/libtiff/config.yml index d9523166c1893..3209eca1a3fa1 100644 --- a/recipes/libtiff/config.yml +++ b/recipes/libtiff/config.yml @@ -1,4 +1,6 @@ versions: + "4.7.0": + folder: all "4.6.0": folder: all "4.5.1": diff --git a/recipes/libtommath/all/test_package/CMakeLists.txt b/recipes/libtommath/all/test_package/CMakeLists.txt index 90762dc612cbd..fa0fac4d67f46 100644 --- a/recipes/libtommath/all/test_package/CMakeLists.txt +++ b/recipes/libtommath/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") diff --git a/recipes/libtool/all/conanfile.py b/recipes/libtool/all/conanfile.py index d832ae4219971..08fb3028157c6 100644 --- a/recipes/libtool/all/conanfile.py +++ b/recipes/libtool/all/conanfile.py @@ -5,13 +5,14 @@ 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 -from conan.tools.microsoft import check_min_vs, is_msvc, unix_path_package_info_legacy +from conan.tools.microsoft import is_msvc import os import re import shutil -required_conan_version = ">=1.57.0" +required_conan_version = ">=2.4" + class LibtoolConan(ConanFile): name = "libtool" @@ -24,6 +25,8 @@ class LibtoolConan(ConanFile): topics = ("configure", "library", "shared", "static") license = ("GPL-2.0-or-later", "GPL-3.0-or-later") settings = "os", "arch", "compiler", "build_type" + languages = ["C"] + implements = ["auto_shared_fpic"] options = { "shared": [True, False], "fPIC": [True, False], @@ -36,37 +39,17 @@ class LibtoolConan(ConanFile): 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): basic_layout(self, src_folder="src") def requirements(self): self.requires("automake/1.16.5") - #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") - - @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") - self.tool_requires("m4/1.4.19") # Needed by configure - + self.tool_requires("automake/1.16.5") + self.tool_requires("m4/1.4.19") # Needed by configure self.tool_requires("gnu-config/cci.20210814") - if self._settings_build.os == "Windows": + 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") @@ -90,10 +73,6 @@ def generate(self): env.vars(self, scope="build").save_script("conanbuild_vcvars_options.bat") tc = AutotoolsToolchain(self) - - if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): - tc.extra_cflags.append("-FS") - tc.configure_args.extend([ "--datarootdir=${prefix}/res", "--enable-shared", @@ -229,8 +208,3 @@ 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: - 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/libtool/all/test_package/conanfile.py b/recipes/libtool/all/test_package/conanfile.py index fa6b79d0ca968..fb395c2413317 100644 --- a/recipes/libtool/all/test_package/conanfile.py +++ b/recipes/libtool/all/test_package/conanfile.py @@ -17,11 +17,6 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" test_type = "explicit" short_paths = True - 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 layout(self): basic_layout(self) @@ -30,12 +25,9 @@ def requirements(self): self.requires(self.tested_reference_str) # Since we are testing libltdl as well def build_requirements(self): - if hasattr(self, "settings_build") and not cross_building(self): - self.tool_requires(self.tested_reference_str) # We are testing libtool/libtoolize - self.tool_requires("autoconf/2.71") self.tool_requires("automake/1.16.5") - if self._settings_build.os == "Windows": + 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") @@ -75,7 +67,7 @@ def generate(self): env = tc.environment() if is_msvc(self): for key, value in msvc_vars.items(): - env.append(key, value) + env.define(key, value) tc.generate(env) # "sis" subfder: project to test building shared library using libtool @@ -87,7 +79,7 @@ def generate(self): env = tc.environment() if is_msvc(self): for key, value in msvc_vars.items(): - env.append(key, value) + env.define(key, value) tc.generate(env) # Note: Using AutotoolsDeps causes errors on Windows when configure tries to determine compiler @@ -111,6 +103,10 @@ def generate(self): env.append_path(var, os.path.join(self.autotools_package_folder, "lib")) env.vars(self, scope="run").save_script("conanrun_libtool_testpackage") + env = Environment() + env.prepend_path("PATH", os.path.join(self.dependencies["libtool"].package_folder, "bin")) + env.vars(self, scope="build").save_script("conanbuild_libtoolize") + runenv = VirtualRunEnv(self) runenv.generate() diff --git a/recipes/libtool/all/test_package/ltdl/CMakeLists.txt b/recipes/libtool/all/test_package/ltdl/CMakeLists.txt index e15a97d31d1b2..187b532fb4cd0 100644 --- a/recipes/libtool/all/test_package/ltdl/CMakeLists.txt +++ b/recipes/libtool/all/test_package/ltdl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(libtool REQUIRED CONFIG) diff --git a/recipes/libtool/all/test_v1_package/autotools/Makefile.am b/recipes/libtool/all/test_v1_package/autotools/Makefile.am deleted file mode 100644 index aae3d3042e762..0000000000000 --- a/recipes/libtool/all/test_v1_package/autotools/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -# @configure_input@ - -bin_PROGRAMS = test_package -lib_LTLIBRARIES = libtestlib.la - -test_package_SOURCES = test_package.c -test_package_LDADD = libtestlib.la - -libtestlib_la_SOURCES = lib.c -libtestlib_la_LDFLAGS = -no-undefined -export-symbols "$(srcdir)/libtestlib.sym" -include_HEADERS = lib.h - -# ACLOCAL_AMFLAGS = -I m4 diff --git a/recipes/libtool/all/test_v1_package/autotools/configure.ac b/recipes/libtool/all/test_v1_package/autotools/configure.ac deleted file mode 100644 index e56278b3ae822..0000000000000 --- a/recipes/libtool/all/test_v1_package/autotools/configure.ac +++ /dev/null @@ -1,41 +0,0 @@ -AC_PREREQ(2.69) -# Must init the autoconf setup -# The first parameter is project name -# second is version number -# third is bug report address -AC_INIT([test_package], [1.0]) - -# Safety checks in case user overwritten --srcdir -AC_CONFIG_SRCDIR([test_package.c]) - -# Store the auxiliary build tools (e.g., install-sh, config.sub, config.guess) -# in this dir (build-aux) -AC_CONFIG_AUX_DIR([build-aux]) -# AC_CONFIG_MACRO_DIRS([m4]) - -# Init automake, and specify this program use relaxed structures. -# i.e. this program doesn't follow the gnu coding standards, and doesn't have -# ChangeLog, COPYING, AUTHORS, INSTALL, README etc. files. -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) - -# Check for CC and CXX compiler -AC_PROG_CC -AC_PROG_CXX - -# Check for archiver -AM_PROG_AR - -LT_PREREQ([2.4.6]) -LT_INIT([win32-dll]) - -AC_SEARCH_LIBS([sqrt], [m]) - -## We can add more checks in this section -# -## Tells automake to create a Makefile -## See https://www.gnu.org/software/automake/manual/html_node/Requirements.html -AC_CONFIG_FILES([Makefile]) - -## Generate the output -AC_CONFIG_HEADERS([config.h]) -AC_OUTPUT diff --git a/recipes/libtool/all/test_v1_package/autotools/lib.c b/recipes/libtool/all/test_v1_package/autotools/lib.c deleted file mode 100644 index a633facec2691..0000000000000 --- a/recipes/libtool/all/test_v1_package/autotools/lib.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "testlib_private.h" - -#include -#include - -double my_function(double val) { - fprintf(stderr, "inside my_function(%e)\n", val); - return sqrt(val); -} - -TESTLIB_API const int libtestlib_value = 42; diff --git a/recipes/libtool/all/test_v1_package/autotools/lib.h b/recipes/libtool/all/test_v1_package/autotools/lib.h deleted file mode 100644 index 170f9676735dc..0000000000000 --- a/recipes/libtool/all/test_v1_package/autotools/lib.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef TESTLIB_LIB_H -#define TESTLIB_LIB_H - -#if defined(_WIN32) -# define TESTLIB_IMPORT_SHARED __declspec(dllimport) -# define TESTLIB_EXPORT_SHARED __declspec(dllexport) -# define TESTLIB_IMPORT_STATIC -# define TESTLIB_EXPORT_STATIC -#else -# define TESTLIB_IMPORT_SHARED -# define TESTLIB_EXPORT_SHARED -# define TESTLIB_IMPORT_STATIC -# define TESTLIB_EXPORT_STATIC -#endif - -#if defined(LIBTEST_BUILDING) -# define TESTLIB_SHARED TESTLIB_EXPORT_SHARED -# define TESTLIB_STATIC TESTLIB_EXPORT_STATIC -#else -# define TESTLIB_SHARED TESTLIB_IMPORT_SHARED -# define TESTLIB_STATIC TESTLIB_IMPORT_STATIC -#endif - -#if defined(LIBHELLO_STATIC) -# define TESTLIB_API TESTLIB_STATIC -#else -# define TESTLIB_API TESTLIB_SHARED -#endif - -double my_function(double); - -extern TESTLIB_API const int libtestlib_value; - -#endif // TESTLIB_LIB_H diff --git a/recipes/libtool/all/test_v1_package/autotools/libtestlib.sym b/recipes/libtool/all/test_v1_package/autotools/libtestlib.sym deleted file mode 100644 index 8464fb190369d..0000000000000 --- a/recipes/libtool/all/test_v1_package/autotools/libtestlib.sym +++ /dev/null @@ -1,2 +0,0 @@ -my_function -libtestlib_value diff --git a/recipes/libtool/all/test_v1_package/autotools/test_package.c b/recipes/libtool/all/test_v1_package/autotools/test_package.c deleted file mode 100644 index 4fd8442a6895e..0000000000000 --- a/recipes/libtool/all/test_v1_package/autotools/test_package.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "lib.h" - -#include - -int main(int argc, char * argv[]) -{ - double res = my_function(1.44); - printf("Result is %e\n", res); - printf("The secret value is %d\n", libtestlib_value); - return 0; -} diff --git a/recipes/libtool/all/test_v1_package/autotools/testlib_private.h b/recipes/libtool/all/test_v1_package/autotools/testlib_private.h deleted file mode 100644 index 81831aee0dc1f..0000000000000 --- a/recipes/libtool/all/test_v1_package/autotools/testlib_private.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TESTLIB_PRIVATE_H -#define TESTLIB_PRIVATE_H - -#define LIBTEST_BUILDING - -#include "lib.h" - -#endif // TESTLIB_PRIVATE_H diff --git a/recipes/libtool/all/test_v1_package/conanfile.py b/recipes/libtool/all/test_v1_package/conanfile.py deleted file mode 100644 index 4b29d6a395ef7..0000000000000 --- a/recipes/libtool/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,159 +0,0 @@ -from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools -from contextlib import contextmanager -import glob -import os -import shutil - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - test_type = "explicit" - short_paths = True - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def requirements(self): - self.requires(self.tested_reference_str) # Needed as a requirement for CMake to see libraries - - def build_requirements(self): - if hasattr(self, "settings_build") and not tools.cross_building(self): - self.build_requires(self.tested_reference_str) - self.build_requires("automake/1.16.5") # Needed for aclocal called by autoreconf - 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.settings): - with tools.environment_append({ - "CC": "cl -nologo", - "CXX": "cl -nologo", - }): - yield - else: - yield - - @property - def _package_folder(self): - return os.path.join(self.build_folder, "package") - - def _build_autotools(self): - """ Test autotools integration """ - # Copy autotools directory to build folder - shutil.copytree(os.path.join(self.source_folder, "autotools"), os.path.join(self.build_folder, "autotools")) - with tools.chdir("autotools"): - self.run("autoreconf --install --verbose -Wall", win_bash=tools.os_info.is_windows) - - tools.mkdir(self._package_folder) - conf_args = [ - "--prefix={}".format(tools.unix_path(self._package_folder)), - "--enable-shared", "--enable-static", - ] - - os.mkdir("bin_autotools") - with tools.chdir("bin_autotools"): - with self._build_context(): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.libs = [] - autotools.configure(args=conf_args, configure_dir=os.path.join(self.build_folder, "autotools")) - autotools.make(args=["V=1"]) - autotools.install() - - def _test_autotools(self): - assert os.path.isdir(os.path.join(self._package_folder, "bin")) - assert os.path.isfile(os.path.join(self._package_folder, "include", "lib.h")) - assert os.path.isdir(os.path.join(self._package_folder, "lib")) - - if not tools.cross_building(self): - self.run(os.path.join(self._package_folder, "bin", "test_package"), run_environment=True) - - def _build_ltdl(self): - """ Build library using ltdl library """ - with self._build_context(): - if self.settings.compiler == "Visual Studio": - cmake = CMake(self, generator="NMake Makefiles") - else: - cmake = CMake(self) - cmake.configure(source_folder="ltdl") - cmake.build() - - def _test_ltdl(self): - """ Test library using ltdl library""" - lib_suffix = { - "Linux": "so", - "FreeBSD": "so", - "Macos": "dylib", - "Windows": "dll", - }[str(self.settings.os)] - - if not tools.cross_building(self): - bin_path = tools.unix_path(os.path.join("bin", "test_package")) - libdir = "bin" if self.settings.os == "Windows" else "lib" - lib_path = tools.unix_path(os.path.join(libdir, "liba.{}".format(lib_suffix))) - self.run("{} {}".format(bin_path, lib_path), run_environment=True, win_bash=tools.os_info.is_windows) - - def _build_static_lib_in_shared(self): - """ Build shared library using libtool (while linking to a static library) """ - - # Copy static-in-shared directory to build folder - autotools_folder = os.path.join(self.build_folder, "sis") - shutil.copytree(os.path.join(self.source_folder, "sis"), autotools_folder) - - install_prefix = os.path.join(autotools_folder, "prefix") - - # Build static library using CMake - with self._build_context(): - if self.settings.compiler == "Visual Studio": - cmake = CMake(self, generator="NMake Makefiles") - else: - cmake = CMake(self) - cmake.definitions["CMAKE_INSTALL_PREFIX"] = install_prefix - cmake.configure(source_folder=autotools_folder, build_folder=os.path.join(autotools_folder, "cmake_build")) - cmake.build() - cmake.install() - - # Copy autotools directory to build folder - with tools.chdir(autotools_folder): - self.run("autoreconf -ifv -Wall", win_bash=tools.os_info.is_windows) - - with tools.chdir(autotools_folder): - conf_args = [ - "--enable-shared", - "--disable-static", - "--prefix={}".format(tools.unix_path(os.path.join(install_prefix))), - ] - with self._build_context(): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.libs = [] - autotools.link_flags.append("-L{}".format(tools.unix_path(os.path.join(install_prefix, "lib")))) - autotools.configure(args=conf_args, configure_dir=autotools_folder) - autotools.make(args=["V=1"]) - autotools.install() - - def _test_static_lib_in_shared(self): - """ Test existence of shared library """ - install_prefix = os.path.join(self.build_folder, "sis", "prefix") - - with tools.chdir(install_prefix): - if self.settings.os == "Windows": - assert len(list(glob.glob(os.path.join("bin", "*.dll")))) > 0 - elif tools.is_apple_os(self.settings.os): - assert len(list(glob.glob(os.path.join("lib", "*.dylib")))) > 0 - else: - assert len(list(glob.glob(os.path.join("lib", "*.so")))) > 0 - - def build(self): - self._build_ltdl() - if not tools.cross_building(self): - self._build_autotools() - self._build_static_lib_in_shared() - - def test(self): - self._test_ltdl() - if not tools.cross_building(self): - self._test_autotools() - self._test_static_lib_in_shared() diff --git a/recipes/libtool/all/test_v1_package/ltdl/CMakeLists.txt b/recipes/libtool/all/test_v1_package/ltdl/CMakeLists.txt deleted file mode 100644 index 7fc6140320af7..0000000000000 --- a/recipes/libtool/all/test_v1_package/ltdl/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -include(GenerateExportHeader) - -add_library(liba SHARED liba.c) -generate_export_header(liba) -target_include_directories(liba - PUBLIC $ -) -set_property(TARGET liba PROPERTY PREFIX "") - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -target_include_directories(test_package - PUBLIC "$" -) diff --git a/recipes/libtool/all/test_v1_package/ltdl/liba.c b/recipes/libtool/all/test_v1_package/ltdl/liba.c deleted file mode 100644 index 790903848f667..0000000000000 --- a/recipes/libtool/all/test_v1_package/ltdl/liba.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "liba_export.h" - -LIBA_EXPORT -int liba_function(int arg) { - return 2 * arg; -} diff --git a/recipes/libtool/all/test_v1_package/ltdl/test_package.c b/recipes/libtool/all/test_v1_package/ltdl/test_package.c deleted file mode 100644 index 51329f415f56f..0000000000000 --- a/recipes/libtool/all/test_v1_package/ltdl/test_package.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "ltdl.h" - -#include -#include - -typedef int (*liba_func_t)(int); - -int main(int argc, char **argv) -{ - if (argc < 2) { - fprintf(stderr, "Need an argument\n"); - return EXIT_FAILURE; - } - const char* libname = argv[1]; - lt_dlinit(); - - fprintf(stderr, "lt_dlopenext(\"%s\")\n", libname); - lt_dlhandle ltdl_liba = lt_dlopenext(libname); - if (!ltdl_liba) { - fprintf(stderr, "lt_dlopenext failed.\n"); - return EXIT_FAILURE; - } - - liba_func_t liba_func = (liba_func_t) lt_dlsym(ltdl_liba, "liba_function"); - int res = liba_func(21); - printf("Result is %d\n", res); - if (res != 42) { - fprintf(stderr, "Result is incorrect\n"); - return EXIT_FAILURE; - } - - lt_dlclose(ltdl_liba); - - lt_dlexit(); - return EXIT_SUCCESS; -} diff --git a/recipes/libtool/all/test_v1_package/sis/CMakeLists.txt b/recipes/libtool/all/test_v1_package/sis/CMakeLists.txt deleted file mode 100644 index dff9ec13a4939..0000000000000 --- a/recipes/libtool/all/test_v1_package/sis/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(static_dependency C) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -add_library(static_lib STATIC - static_lib.c -) -install(TARGETS static_lib - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib -) diff --git a/recipes/libtool/all/test_v1_package/sis/Makefile.am b/recipes/libtool/all/test_v1_package/sis/Makefile.am deleted file mode 100644 index 824106cabe1d8..0000000000000 --- a/recipes/libtool/all/test_v1_package/sis/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -# @configure_input@ - -lib_LTLIBRARIES = libshared.la - -libshared_la_SOURCES = shared_lib.c -libshared_la_LDFLAGS = -no-undefined -lstatic_lib - -# ACLOCAL_AMFLAGS = -I m4 diff --git a/recipes/libtool/all/test_v1_package/sis/configure.ac b/recipes/libtool/all/test_v1_package/sis/configure.ac deleted file mode 100644 index 0272fc8f862a2..0000000000000 --- a/recipes/libtool/all/test_v1_package/sis/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_PREREQ(2.69) -AC_INIT([test_package], [1.0]) -AC_CONFIG_SRCDIR([shared_lib.c]) -AC_CONFIG_AUX_DIR([build-aux]) -# AC_CONFIG_MACRO_DIRS([m4]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -AC_PROG_CC -AM_PROG_AR -LT_PREREQ([2.4]) -LT_INIT([win32-dll]) -AC_CONFIG_FILES([Makefile]) -AC_CONFIG_HEADERS([config.h]) -AC_OUTPUT diff --git a/recipes/libtool/all/test_v1_package/sis/shared.sym b/recipes/libtool/all/test_v1_package/sis/shared.sym deleted file mode 100644 index e05e2d3117c07..0000000000000 --- a/recipes/libtool/all/test_v1_package/sis/shared.sym +++ /dev/null @@ -1 +0,0 @@ -shared_function diff --git a/recipes/libtool/all/test_v1_package/sis/shared_lib.c b/recipes/libtool/all/test_v1_package/sis/shared_lib.c deleted file mode 100644 index b92cbe207afe1..0000000000000 --- a/recipes/libtool/all/test_v1_package/sis/shared_lib.c +++ /dev/null @@ -1,7 +0,0 @@ -int -static_function(int); - -int -shared_function(int arg) { - return static_function(arg) + 1337; -} diff --git a/recipes/libtool/all/test_v1_package/sis/static_lib.c b/recipes/libtool/all/test_v1_package/sis/static_lib.c deleted file mode 100644 index 2ebed9d056844..0000000000000 --- a/recipes/libtool/all/test_v1_package/sis/static_lib.c +++ /dev/null @@ -1,4 +0,0 @@ -int -static_function(int arg) { - return arg + 42; -} diff --git a/recipes/libtorrent/all/conandata.yml b/recipes/libtorrent/all/conandata.yml index c0a04e36275d4..f3e1e6a5c8ef1 100644 --- a/recipes/libtorrent/all/conandata.yml +++ b/recipes/libtorrent/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.0.10": + url: "https://github.com/arvidn/libtorrent/releases/download/v2.0.10/libtorrent-rasterbar-2.0.10.tar.gz" + sha256: "fc935b8c1daca5c0a4d304bff59e64e532be16bb877c012aea4bda73d9ca885d" + "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/all/conanfile.py b/recipes/libtorrent/all/conanfile.py index f21e595615c63..35190c929ad49 100644 --- a/recipes/libtorrent/all/conanfile.py +++ b/recipes/libtorrent/all/conanfile.py @@ -187,9 +187,9 @@ def package_info(self): self.cpp_info.components["libtorrent-rasterbar"].requires.append("libiconv::libiconv") if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["dl", "pthread"] + self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["dl", "pthread", "m"] elif self.settings.os == "Windows": - self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["wsock32", "ws2_32", "iphlpapi", "dbghelp"] + self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["wsock32", "ws2_32", "iphlpapi", "dbghelp", "mswsock"] elif self.settings.os == "Macos": self.cpp_info.components["libtorrent-rasterbar"].frameworks = ["CoreFoundation", "SystemConfiguration"] diff --git a/recipes/libtorrent/all/test_package/CMakeLists.txt b/recipes/libtorrent/all/test_package/CMakeLists.txt index ad88123584e9b..a392560a5482c 100644 --- a/recipes/libtorrent/all/test_package/CMakeLists.txt +++ b/recipes/libtorrent/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) if(WIN32) diff --git a/recipes/libtorrent/all/test_v1_package/CMakeLists.txt b/recipes/libtorrent/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/libtorrent/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libtorrent/all/test_v1_package/conanfile.py b/recipes/libtorrent/all/test_v1_package/conanfile.py deleted file mode 100644 index d96fde1be2e9a..0000000000000 --- a/recipes/libtorrent/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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") - # from https://en.wikipedia.org/wiki/Magnet_URI_scheme - magnet_url = "magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a" - self.run("{} {}".format(bin_path, magnet_url), run_environment=True) diff --git a/recipes/libtorrent/config.yml b/recipes/libtorrent/config.yml index aabaf7330b305..debcafe432f02 100644 --- a/recipes/libtorrent/config.yml +++ b/recipes/libtorrent/config.yml @@ -1,4 +1,8 @@ versions: + "2.0.10": + folder: "all" + "2.0.9": + folder: "all" "2.0.8": folder: "all" "2.0.1": diff --git a/recipes/libucl/all/conandata.yml b/recipes/libucl/all/conandata.yml index 11db4b55879f9..656cf543d7403 100644 --- a/recipes/libucl/all/conandata.yml +++ b/recipes/libucl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.0": + url: "https://github.com/vstakhov/libucl/archive/refs/tags/0.9.0.tar.gz" + sha256: "87b233048bca7d307b14cffb882d3c198dc3fff96b19e0c3515428f027b3ebfe" "0.8.2": url: "https://github.com/vstakhov/libucl/archive/refs/tags/0.8.2.tar.gz" sha256: "d95a0e2151cc167a0f3e51864fea4e8977a0f4c473faa805269a347f7fb4e165" @@ -6,6 +9,17 @@ sources: url: "https://github.com/vstakhov/libucl/archive/refs/tags/0.8.1.tar.gz" sha256: "a6397e179672f0e8171a0f9a2cfc37e01432b357fd748b13f4394436689d24ef" patches: + "0.9.0": + - patch_file: "patches/0001-0.8.1-shared-win32.patch" + patch_description: "fix UCL_EXTERN definition for shared build on win32" + patch_type: "portability" + - patch_file: "patches/0002-0.9.0-cmake-add-install+use-find_package.patch" + patch_description: "improve installation, use cci package" + patch_type: "conan" + - patch_file: "patches/0006-0.9.0-remove-glib-types.patch" + patch_description: "remove glib types, use char and size_t instead." + patch_type: "portability" + patch_source: "https://github.com/vstakhov/libucl/pull/283" "0.8.2": - patch_file: "patches/0001-0.8.1-shared-win32.patch" patch_description: "fix UCL_EXTERN definition for shared build on win32" diff --git a/recipes/libucl/all/conanfile.py b/recipes/libucl/all/conanfile.py index f81b0da544841..30bc268f05071 100644 --- a/recipes/libucl/all/conanfile.py +++ b/recipes/libucl/all/conanfile.py @@ -1,6 +1,7 @@ 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 +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -90,3 +91,6 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["pkg_config"] = "libucl" + + if Version(self.version) >= "0.9.0" and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libucl/all/patches/0002-0.9.0-cmake-add-install+use-find_package.patch b/recipes/libucl/all/patches/0002-0.9.0-cmake-add-install+use-find_package.patch new file mode 100644 index 0000000000000..139c3e606a3ba --- /dev/null +++ b/recipes/libucl/all/patches/0002-0.9.0-cmake-add-install+use-find_package.patch @@ -0,0 +1,119 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1e23994..c67a5b8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,12 +5,15 @@ SET(LIBUCL_VERSION_MAJOR 0) + SET(LIBUCL_VERSION_MINOR 9) + SET(LIBUCL_VERSION_PATCH 0) + +-SET(LIBUCL_VERSION +- "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") ++SET(LIBUCL_VERSION "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") + + INCLUDE(CheckCCompilerFlag) + INCLUDE(CheckCSourceCompiles) +-INCLUDE(FindOpenSSL) ++IF(ENABLE_URL_SIGN) ++ FIND_PACKAGE(OpenSSL REQUIRED) ++ SET(HAVE_OPENSSL 1) ++ ADD_DEFINITIONS(-DHAVE_OPENSSL) ++ENDIF(ENABLE_URL_SIGN) + INCLUDE(GNUInstallDirs) + + OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) +@@ -135,30 +138,10 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + + IF(ENABLE_URL_INCLUDE MATCHES "ON") +- FIND_LIBRARY(LIBFETCH_LIBRARY NAMES fetch PATHS PATH_SUFFIXES lib64 lib +- PATHS +- ~/Library/Frameworks +- /Library/Frameworks +- /usr/local +- /usr +- /sw +- /opt/local +- /opt/csw +- /opt +- DOC "Path where the libfetch library can be found") +- IF(LIBFETCH_LIBRARY) +- FIND_FILE(HAVE_FETCH_H NAMES fetch.h PATHS /usr/include +- /opt/include +- /usr/local/include +- DOC "Path to libfetch header") +- ELSE(LIBFETCH_LIBRARY) +- # Try to find libcurl +- FIND_PACKAGE(CURL) +- IF(NOT CURL_FOUND) +- MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration") +- ENDIF(NOT CURL_FOUND) +- ENDIF(LIBFETCH_LIBRARY) +-ENDIF(ENABLE_URL_INCLUDE MATCHES "ON") ++ FIND_PACKAGE(CURL REQUIRED) ++ ADD_DEFINITIONS(-DCURL_FOUND) ++ SET(CURL_LIBRARIES CURL::libcurl) ++ENDIF() + + set(SYNC_BUILTINS_TEST_SOURCE [====[ + int main() +@@ -249,35 +232,24 @@ TARGET_COMPILE_DEFINITIONS(ucl + ${UCL_COMPILE_DEFS} + ) + +-IF(ENABLE_LUA MATCHES "ON") +- IF(ENABLE_LUAJIT MATCHES "ON") +- FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") +- IF(NOT LUA_FOUND) +- MESSAGE(FATAL_ERROR "Lua not found, lua support is required") +- ELSE(NOT LUA_FOUND) +- INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") +- ENDIF(NOT LUA_FOUND) +- ELSE(ENABLE_LUAJIT MATCHES "ON") +- FindLua(VERSION_MAJOR "5" VERSION_MINOR "2" ROOT "${LUA_ROOT}") +- IF(NOT LUA_FOUND) +- FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") +- ENDIF(NOT LUA_FOUND) +- IF(NOT LUA_FOUND) +- MESSAGE(FATAL_ERROR "Lua not found, lua support is required") +- ELSE(NOT LUA_FOUND) +- INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") +- ENDIF(NOT LUA_FOUND) +- ENDIF(ENABLE_LUAJIT MATCHES "ON") ++IF(ENABLE_LUA OR ENABLE_LUAJIT) + SET(UCL_LUA_SRC lua/lua_ucl.c) + ADD_LIBRARY(lua-ucl ${LIB_TYPE} ${UCL_LUA_SRC}) + ADD_LIBRARY(ucl::lua ALIAS lua-ucl) ++ TARGET_LINK_LIBRARIES(lua-ucl ucl) + IF(ENABLE_LUAJIT MATCHES "ON") +- TARGET_LINK_LIBRARIES(lua-ucl "${LUAJIT_LIBRARY}") ++ TARGET_LINK_LIBRARIES(lua-ucl luajit::luajit) + ELSE(ENABLE_LUAJIT MATCHES "ON") +- TARGET_LINK_LIBRARIES(lua-ucl "${LUA_LIBRARY}") ++ TARGET_LINK_LIBRARIES(lua-ucl lua::lua) + ENDIF(ENABLE_LUAJIT MATCHES "ON") +- TARGET_LINK_LIBRARIES(lua-ucl ucl) + TARGET_INCLUDE_DIRECTORIES(lua-ucl PUBLIC include PRIVATE src uthash) ++ IF(ENABLE_LUA) ++ FIND_PACKAGE(lua REQUIRED CONFIG) ++ TARGET_LINK_LIBRARIES(lua-ucl lua::lua) ++ ELSEIF(ENABLE_LUAJIT) ++ FIND_PACKAGE(luajit REQUIRED CONFIG) ++ TARGET_LINK_LIBRARIES(lua-ucl luajit::luajit) ++ ENDIF() + SET_TARGET_PROPERTIES(lua-ucl PROPERTIES + VERSION ${LIBUCL_VERSION} + SOVERSION ${LIBUCL_VERSION_MAJOR} +@@ -306,8 +278,11 @@ ENDIF(UNIX) + SET_TARGET_PROPERTIES(ucl PROPERTIES + PUBLIC_HEADER "${UCLHDR}") + +-INSTALL(TARGETS ucl EXPORT uclConfig DESTINATION ${CMAKE_INSTALL_LIBDIR} +- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++INSTALL(TARGETS ucl EXPORT uclConfig ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + IF(ENABLE_UTILS MATCHES "ON") + ADD_SUBDIRECTORY(utils) diff --git a/recipes/libucl/all/patches/0006-0.9.0-remove-glib-types.patch b/recipes/libucl/all/patches/0006-0.9.0-remove-glib-types.patch new file mode 100644 index 0000000000000..f63df8c3abd20 --- /dev/null +++ b/recipes/libucl/all/patches/0006-0.9.0-remove-glib-types.patch @@ -0,0 +1,32 @@ +diff --git a/lua/lua_ucl.c b/lua/lua_ucl.c +index c2e39c4..d6be69e 100644 +--- a/lua/lua_ucl.c ++++ b/lua/lua_ucl.c +@@ -406,7 +406,6 @@ ucl_object_lua_fromtable (lua_State *L, int idx, ucl_string_flags_t flags) + + /* Table iterate */ + if (is_array) { +- int i; + + if (!is_implicit) { + top = ucl_object_typed_new (UCL_ARRAY); +@@ -416,7 +415,7 @@ ucl_object_lua_fromtable (lua_State *L, int idx, ucl_string_flags_t flags) + top = NULL; + } + +- for (i = 1; i <= max; i ++) { ++ for (size_t i = 1; i <= max; i ++) { + lua_pushinteger (L, i); + lua_gettable (L, idx); + +@@ -886,8 +885,8 @@ lua_ucl_parser_parse_text (lua_State *L) + t = lua_touserdata (L, 2); + } + else if (lua_type (L, 2) == LUA_TSTRING) { +- const gchar *s; +- gsize len; ++ const char *s; ++ size_t len; + static struct _rspamd_lua_text st_t; + + s = lua_tolstring (L, 2, &len); diff --git a/recipes/libucl/all/test_package/CMakeLists.txt b/recipes/libucl/all/test_package/CMakeLists.txt index 6bc1b43c40b43..45101a8e8f96d 100644 --- a/recipes/libucl/all/test_package/CMakeLists.txt +++ b/recipes/libucl/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(libucl REQUIRED CONFIG) diff --git a/recipes/libucl/all/test_v1_package/CMakeLists.txt b/recipes/libucl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/libucl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libucl/all/test_v1_package/conanfile.py b/recipes/libucl/all/test_v1_package/conanfile.py deleted file mode 100644 index bb7585234f070..0000000000000 --- a/recipes/libucl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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") - sample_conf = os.path.join(self.source_folder, os.pardir, "test_package", "sample.conf") - self.run(f"{bin_path} {sample_conf}", run_environment=True) diff --git a/recipes/libucl/config.yml b/recipes/libucl/config.yml index 7a9cbb2ce8ecb..fa8c302279f91 100644 --- a/recipes/libucl/config.yml +++ b/recipes/libucl/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.0": + folder: all "0.8.2": folder: all "0.8.1": diff --git a/recipes/libudev/all/conanfile.py b/recipes/libudev/all/conanfile.py index 46c164d11074a..0a4056812ce72 100644 --- a/recipes/libudev/all/conanfile.py +++ b/recipes/libudev/all/conanfile.py @@ -48,3 +48,7 @@ def package_info(self): self.cpp_info.libdirs = [] pkg_config = PkgConfig(self, "libudev") pkg_config.fill_cpp_info(self.cpp_info) + self.cpp_info.set_property("system_package_version", str(pkg_config.version)) + + # todo Remove this workaround for Conan v1 + self.cpp_info.set_property("component_version", str(pkg_config.version)) diff --git a/recipes/libudev/all/test_v1_package/CMakeLists.txt b/recipes/libudev/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libudev/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libudev/all/test_v1_package/conanfile.py b/recipes/libudev/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libudev/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libui/all/test_package/CMakeLists.txt b/recipes/libui/all/test_package/CMakeLists.txt index e04a827e1a3a6..cfdafa7d66726 100644 --- a/recipes/libui/all/test_package/CMakeLists.txt +++ b/recipes/libui/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) diff --git a/recipes/libunifex/all/CMakeLists.txt b/recipes/libunifex/all/CMakeLists.txt deleted file mode 100644 index 4beb13671fe5e..0000000000000 --- a/recipes/libunifex/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() - -add_subdirectory("source_subfolder") diff --git a/recipes/libunifex/all/conandata.yml b/recipes/libunifex/all/conandata.yml index 2eaea0e7a17a7..f0f7328af9c2a 100644 --- a/recipes/libunifex/all/conandata.yml +++ b/recipes/libunifex/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "cci.20220430": - url: "https://github.com/facebookexperimental/libunifex/archive/c359fd8e7d97d91359cf4a6c1dbef99b0b1767b6.tar.gz" - sha256: "c306891967fa4cc1a22f3401581d35ceea41eb1dbdac3e6157ecf3defaa4b15d" + "0.4.0": + url: "https://github.com/facebookexperimental/libunifex/archive/refs/tags/v0.4.0.tar.gz" + sha256: "d5ce3b616e166da31e6b4284764a1feeba52aade868bcbffa94cfd86b402716e" diff --git a/recipes/libunifex/all/conanfile.py b/recipes/libunifex/all/conanfile.py index 49d7f959dc539..4bcd35d16f99c 100644 --- a/recipes/libunifex/all/conanfile.py +++ b/recipes/libunifex/all/conanfile.py @@ -1,110 +1,143 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools 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, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, replace_in_file, export_conandata_patches, apply_conandata_patches +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.52.0" class LibunifexConan(ConanFile): name = "libunifex" + description = "A prototype implementation of the C++ sender/receiver async programming model" license = ("Apache-2.0", "LLVM-exception") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/facebookexperimental/libunifex" - description = "A prototype implementation of the C++ sender/receiver async programming model" topics = ("async", "cpp") + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" - - generators = "cmake", "cmake_find_package_multi" - no_copy_source = True - exports_sources = ["CMakeLists.txt"] + options = { + "fPIC": [True, False], + "with_liburing": [True, False], + } + default_options = { + "fPIC": True, + "with_liburing": False, # Enabled by default in the project, but incompatible with the Linux version used in C3I + } @property - def _source_subfolder(self): - return "source_subfolder" + def _minimum_standard(self): + if is_msvc(self): + # Otherwise a forward declaration `extern const _schedule::_fn schedule;` + # conflicts with the implementation `inline constexpr _schedule::_fn schedule {};` + # https://github.com/facebookexperimental/libunifex/issues/591 + return 20 + return 17 @property def _compilers_minimum_version(self): return { "gcc": "9", - "Visual Studio": "16", "clang": "10", "apple-clang": "11", + "Visual Studio": "17", + "msvc": "193", } - @property - def _minimum_standard(self): - return "17" + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if not self.settings.os == "Linux": + del self.options.with_liburing + + def layout(self): + cmake_layout(self, src_folder="src") - # FIXME: Add support for liburing - # def requirements(self): - # TODO: Make an option to opt-out of liburing for old kernel versions - # if self.settings.os == "Linux": - # self.requires("liburing/2.1") + def requirements(self): + if self.options.get_safe("with_liburing"): + self.requires("liburing/2.4", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd( - self, self._minimum_standard) + check_min_cppstd(self, self._minimum_standard) 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( - "{0} {1} requires C++{2}. Your compiler is unknown. Assuming it supports C++{2}." - .format(self.name, self.version, self._minimum_standard)) - elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): + 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( - "{} {} requires C++{}, which your compiler does not support." - .format(self.name, self.version, self._minimum_standard)) + f"{self.ref} requires C++{self._minimum_standard}, 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["BUILD_TESTING"] = False + tc.variables["UNIFEX_BUILD_EXAMPLES"] = False + tc.variables["UNIFEX_NO_LIBURING"] = not self.options.get_safe("with_liburing", False) + if not valid_min_cppstd(self, self._minimum_standard): + tc.variables["CMAKE_CXX_STANDARD"] = self._minimum_standard + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.set_property("liburing", "cmake_file_name", "LIBURING") + deps.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): + self._patch_sources() cmake = CMake(self) - cmake.definitions["BUILD_TESTING"] = "OFF" cmake.configure() - return cmake - - def build(self): - cmake = self._configure_cmake() cmake.build() + def _patch_sources(self): + apply_conandata_patches(self) + # Ensure liburing from the system is not used and that uuper-case variables are generated + required = "REQUIRED" if self.settings.os == "Linux" else "" + replace_in_file(self, os.path.join(self.source_folder, "cmake", "unifex_flags.cmake"), + "find_package(LibUring COMPONENTS)", + f"find_package(LIBURING {required} CONFIG NO_DEFAULT_PATH PATHS ${{CMAKE_PREFIX_PATH}})") + replace_in_file(self, os.path.join(self.source_folder, "cmake", "unifex_env.cmake"), "-Werror", "") + replace_in_file(self, os.path.join(self.source_folder, "cmake", "unifex_env.cmake"), "/WX", "") + # Allow cppstd to be overridden + replace_in_file(self, os.path.join(self.source_folder, "source", "CMakeLists.txt"), + "target_compile_features(unifex PUBLIC cxx_std_17)", "") + 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")) - 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.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "unifex") self.cpp_info.set_property("cmake_target_name", "unifex::unifex") self.cpp_info.set_property("pkg_config_name", "unifex") + self.cpp_info.components["unifex"].libs = ["unifex"] + self.cpp_info.components["unifex"].set_property("cmake_target_name", "unifex::unifex") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["unifex"].system_libs = ["pthread"] + if self.options.get_safe("with_liburing"): + self.cpp_info.components["unifex"].requires.append("liburing::liburing") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "unifex" - self.cpp_info.filenames["cmake_find_package_multi"] = "unifex" self.cpp_info.names["cmake_find_package"] = "unifex" self.cpp_info.names["cmake_find_package_multi"] = "unifex" - self.cpp_info.names["pkg_config"] = "unifex" self.cpp_info.components["unifex"].names["cmake_find_package"] = "unifex" self.cpp_info.components["unifex"].names["cmake_find_package_multi"] = "unifex" - self.cpp_info.components["unifex"].set_property( - "cmake_target_name", "unifex::unifex") - self.cpp_info.components["unifex"].libs = ["unifex"] - - if self.settings.os == "Linux": - self.cpp_info.components["unifex"].system_libs = ["pthread"] - # self.cpp_info.components["unifex"].requires.append( - # "liburing::liburing") diff --git a/recipes/libunifex/all/test_package/CMakeLists.txt b/recipes/libunifex/all/test_package/CMakeLists.txt index a487dfdf2b7ad..7c04e7b0b4280 100644 --- a/recipes/libunifex/all/test_package/CMakeLists.txt +++ b/recipes/libunifex/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(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(unifex REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE unifex::unifex) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +if(MSVC) + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20) +else() + set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +endif() diff --git a/recipes/libunifex/all/test_package/conanfile.py b/recipes/libunifex/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/libunifex/all/test_package/conanfile.py +++ b/recipes/libunifex/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/libunifex/config.yml b/recipes/libunifex/config.yml index 1bf3ed95d8368..af29e78bd9b25 100644 --- a/recipes/libunifex/config.yml +++ b/recipes/libunifex/config.yml @@ -1,3 +1,3 @@ versions: - "cci.20220430": - folder: "all" + "0.4.0": + folder: all 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/all/test_package/CMakeLists.txt b/recipes/libunistring/all/test_package/CMakeLists.txt index 07b5ca4d6ab00..050d3b230059d 100644 --- a/recipes/libunistring/all/test_package/CMakeLists.txt +++ b/recipes/libunistring/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(libunistring REQUIRED CONFIG) diff --git a/recipes/libunistring/all/test_v1_package/CMakeLists.txt b/recipes/libunistring/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libunistring/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libunistring/all/test_v1_package/conanfile.py b/recipes/libunistring/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libunistring/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_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/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 baa8d36f9cd17..efd030d0bf16c 100644 --- a/recipes/libunwind/all/conandata.yml +++ b/recipes/libunwind/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.8.1": + url: "https://github.com/libunwind/libunwind/releases/download/v1.8.1/libunwind-1.8.1.tar.gz" + sha256: "ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157" + "1.8.0": + url: "https://github.com/libunwind/libunwind/releases/download/v1.8.0/libunwind-1.8.0.tar.gz" + sha256: "b6b3df40a0970c8f2865fb39aa2af7b5d6f12ad6c5774e266ccca4d6b8b72268" "1.7.2": url: "https://github.com/libunwind/libunwind/releases/download/v1.7.2/libunwind-1.7.2.tar.gz" sha256: "a18a6a24307443a8ace7a8acc2ce79fbbe6826cd0edf98d6326d0225d6a5d6e6" diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py index 002c9bf613f23..d96b4cec23a07 100644 --- a/recipes/libunwind/all/conanfile.py +++ b/recipes/libunwind/all/conanfile.py @@ -2,7 +2,14 @@ from conan.errors import ConanInvalidConfiguration 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, rmdir +from conan.tools.files import ( + apply_conandata_patches, + copy, + export_conandata_patches, + get, + rm, + rmdir, +) from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps from conan.tools.layout import basic_layout @@ -11,6 +18,7 @@ required_conan_version = ">=1.53.0" + class LiunwindConan(ConanFile): name = "libunwind" description = "Manipulate the preserved state of each call-frame and resume the execution at any point." @@ -59,7 +67,9 @@ def requirements(self): def validate(self): if self.settings.os not in ["Linux", "FreeBSD"]: - raise ConanInvalidConfiguration("libunwind is only supported on Linux and FreeBSD") + raise ConanInvalidConfiguration( + "libunwind is only supported on Linux and FreeBSD" + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -71,15 +81,17 @@ def generate(self): tc = AutotoolsToolchain(self) yes_no = lambda v: "yes" if v else "no" - tc.configure_args.extend([ - f"--enable-coredump={yes_no(self.options.coredump)}", - f"--enable-ptrace={yes_no(self.options.ptrace)}", - f"--enable-setjmp={yes_no(self.options.setjmp)}", - f"--enable-minidebuginfo={yes_no(self.options.minidebuginfo)}", - f"--enable-zlibdebuginfo={yes_no(self.options.zlibdebuginfo)}", - "--disable-tests", - "--disable-documentation", - ]) + tc.configure_args.extend( + [ + f"--enable-coredump={yes_no(self.options.coredump)}", + f"--enable-ptrace={yes_no(self.options.ptrace)}", + f"--enable-setjmp={yes_no(self.options.setjmp)}", + f"--enable-minidebuginfo={yes_no(self.options.minidebuginfo)}", + f"--enable-zlibdebuginfo={yes_no(self.options.zlibdebuginfo)}", + "--disable-tests", + "--disable-documentation", + ] + ) tc.generate() tc = AutotoolsDeps(self) @@ -92,7 +104,12 @@ def build(self): autotools.make() def package(self): - copy(self, pattern="COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy( + self, + pattern="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")) @@ -102,8 +119,10 @@ def package(self): # As this seems to be unnecessary for the conan package. # rename the real file to libunwind_generic, lib_ext = "so" if self.options.shared else "a" - symlink_path = os.path.join(self.package_folder, "lib", f"libunwind-generic.{lib_ext}") - source_path = os.path.realpath(symlink_path) + symlink_path = os.path.join( + self.package_folder, "lib", f"libunwind-generic.{lib_ext}" + ) + source_path = os.path.realpath(symlink_path) rm(self, os.path.basename(symlink_path), os.path.dirname(symlink_path)) shutil.copy(source_path, symlink_path) @@ -116,18 +135,26 @@ def package_info(self): self.cpp_info.components["unwind"].requires.append("zlib::zlib") if self.settings.os == "Linux": self.cpp_info.components["unwind"].system_libs.append("pthread") - self.cpp_info.components["generic"].set_property("pkg_config_name", "libunwind-generic") + self.cpp_info.components["generic"].set_property( + "pkg_config_name", "libunwind-generic" + ) self.cpp_info.components["generic"].libs = ["unwind-generic"] self.cpp_info.components["generic"].requires = ["unwind"] if self.options.ptrace: - self.cpp_info.components["ptrace"].set_property("pkg_config_name", "libunwind-ptrace") + self.cpp_info.components["ptrace"].set_property( + "pkg_config_name", "libunwind-ptrace" + ) self.cpp_info.components["ptrace"].libs = ["unwind-ptrace"] self.cpp_info.components["ptrace"].requires = ["generic", "unwind"] if self.options.setjmp: - self.cpp_info.components["setjmp"].set_property("pkg_config_name", "libunwind-setjmp") + self.cpp_info.components["setjmp"].set_property( + "pkg_config_name", "libunwind-setjmp" + ) self.cpp_info.components["setjmp"].libs = ["unwind-setjmp"] self.cpp_info.components["setjmp"].requires = ["unwind"] if self.options.coredump: - self.cpp_info.components["coredump"].set_property("pkg_config_name", "libunwind-coredump") + self.cpp_info.components["coredump"].set_property( + "pkg_config_name", "libunwind-coredump" + ) self.cpp_info.components["coredump"].libs = ["unwind-coredump"] self.cpp_info.components["coredump"].requires = ["generic", "unwind"] diff --git a/recipes/libunwind/all/test_package/CMakeLists.txt b/recipes/libunwind/all/test_package/CMakeLists.txt index e857c1d9df841..d51b8a84d91e3 100644 --- a/recipes/libunwind/all/test_package/CMakeLists.txt +++ b/recipes/libunwind/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(libunwind REQUIRED CONFIG) diff --git a/recipes/libunwind/all/test_v1_package/CMakeLists.txt b/recipes/libunwind/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/libunwind/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libunwind/all/test_v1_package/conanfile.py b/recipes/libunwind/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/libunwind/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", "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/libunwind/config.yml b/recipes/libunwind/config.yml index ce44762c05da1..2132c142d0b3f 100644 --- a/recipes/libunwind/config.yml +++ b/recipes/libunwind/config.yml @@ -1,4 +1,8 @@ versions: + "1.8.1": + folder: all + "1.8.0": + folder: all "1.7.2": folder: all "1.7.0": diff --git a/recipes/liburing/all/conandata.yml b/recipes/liburing/all/conandata.yml index c886933bedcfe..903fcbb9911ba 100644 --- a/recipes/liburing/all/conandata.yml +++ b/recipes/liburing/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "2.8": + url: "https://github.com/axboe/liburing/archive/liburing-2.8.tar.gz" + sha256: "3ed7891d1b2bbe743ef3fb6d0a4970e630aa02d7c7bd3b0212791fb7be815984" + "2.7": + url: "https://github.com/axboe/liburing/archive/liburing-2.7.tar.gz" + sha256: "56202ad443c50e684dde3692819be3b91bbe003e1c14bf5abfa11973669978c1" + "2.6": + url: "https://github.com/axboe/liburing/archive/liburing-2.6.tar.gz" + sha256: "682f06733e6db6402c1f904cbbe12b94942a49effc872c9e01db3d7b180917cc" + "2.5": + url: "https://github.com/axboe/liburing/archive/liburing-2.5.tar.gz" + sha256: "456f5f882165630f0dc7b75e8fd53bd01a955d5d4720729b4323097e6e9f2a98" "2.4": url: "https://github.com/axboe/liburing/archive/liburing-2.4.tar.gz" sha256: "2398ec82d967a6f903f3ae1fd4541c754472d3a85a584dc78c5da2fabc90706b" @@ -17,7 +29,45 @@ sources: "0.7": url: "https://github.com/axboe/liburing/archive/liburing-0.7.tar.gz" sha256: "8e2842cfe947f3a443af301bdd6d034455536c38a455c7a700d0c1ad165a7543" - patches: + "2.8": + - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" + "2.7": + - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" + "2.6": + - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" + "2.5": + - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" + "2.4": + - patch_file: "patches/liburing-2.4-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" + "2.3": + - patch_file: "patches/liburing-2.2-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" + "2.2": + - patch_file: "patches/liburing-2.2-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" "2.1": - patch_file: "patches/0001-liburing-2.1-memfd-create.patch" + - patch_file: "patches/liburing-2.0-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" + "2.0": + - patch_file: "patches/liburing-2.0-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" + "0.7": + - patch_file: "patches/liburing-0.7-disable_samples_and_tests.patch" + patch_description: "Disable tests and samples as it might not work while cross-compiling" + patch_type: "conan" diff --git a/recipes/liburing/all/conanfile.py b/recipes/liburing/all/conanfile.py index b1e4b79034482..d9633472c289d 100644 --- a/recipes/liburing/all/conanfile.py +++ b/recipes/liburing/all/conanfile.py @@ -11,14 +11,14 @@ class Liburing(ConanFile): name = "liburing" - license = "GPL-2.0-or-later" - homepage = "https://github.com/axboe/liburing" - url = "https://github.com/conan-io/conan-center-index" description = ("helpers to setup and teardown io_uring instances, and also a simplified interface for " "applications that don't need (or want) to deal with the full kernel side implementation.") + license = ("GPL-2.0-or-later", "MIT", "LGPL-2.1-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/axboe/liburing" topics = ("asynchronous-io", "async", "kernel") - settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "fPIC": [True, False], "shared": [True, False], @@ -53,8 +53,7 @@ def validate(self): # FIXME: use kernel version of build/host machine. # kernel version should be encoded in profile if self.settings.os != "Linux": - raise ConanInvalidConfiguration( - "liburing is supported only on linux") + raise ConanInvalidConfiguration(f"{self.ref} is supported only on linux") def layout(self): basic_layout(self, src_folder='src') @@ -64,8 +63,17 @@ def source(self): def generate(self): tc = AutotoolsToolchain(self) + + if Version(self.version) >= "2.5": + if self.options.with_libc: + tc.configure_args.append("--use-libc") + elif Version(self.version) >= "2.2": + if not self.options.with_libc: + tc.configure_args.append("--nolibc") + tc.update_configure_args({ - "--nolibc": None if self.options.get_safe("with_libc", default=True) else "", + "--host": None, + "--build": None, "--enable-shared": None, "--disable-shared": None, "--enable-static": None, diff --git a/recipes/liburing/all/patches/liburing-0.7-disable_samples_and_tests.patch b/recipes/liburing/all/patches/liburing-0.7-disable_samples_and_tests.patch new file mode 100644 index 0000000000000..dc56cd825cb84 --- /dev/null +++ b/recipes/liburing/all/patches/liburing-0.7-disable_samples_and_tests.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 948e004..d4cff97 100644 +--- a/Makefile ++++ b/Makefile +@@ -10,8 +10,6 @@ default: all + + all: + @$(MAKE) -C src +- @$(MAKE) -C test +- @$(MAKE) -C examples + + partcheck: all + @echo "make partcheck => TODO add tests with out kernel support" diff --git a/recipes/liburing/all/patches/liburing-2.0-disable_samples_and_tests.patch b/recipes/liburing/all/patches/liburing-2.0-disable_samples_and_tests.patch new file mode 100644 index 0000000000000..4f4983d0c9070 --- /dev/null +++ b/recipes/liburing/all/patches/liburing-2.0-disable_samples_and_tests.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 5d9c4dc..66ee81e 100644 +--- a/Makefile ++++ b/Makefile +@@ -10,8 +10,6 @@ default: all + + all: + @$(MAKE) -C src +- @$(MAKE) -C test +- @$(MAKE) -C examples + + .PHONY: all install default clean test + .PHONY: FORCE cscope diff --git a/recipes/liburing/all/patches/liburing-2.2-disable_samples_and_tests.patch b/recipes/liburing/all/patches/liburing-2.2-disable_samples_and_tests.patch new file mode 100644 index 0000000000000..7faef951af755 --- /dev/null +++ b/recipes/liburing/all/patches/liburing-2.2-disable_samples_and_tests.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 686be4f..28d0a7f 100644 +--- a/Makefile ++++ b/Makefile +@@ -8,8 +8,6 @@ default: all + + all: + @$(MAKE) -C src +- @$(MAKE) -C test +- @$(MAKE) -C examples + + .PHONY: all install default clean test + .PHONY: FORCE cscope diff --git a/recipes/liburing/all/patches/liburing-2.4-disable_samples_and_tests.patch b/recipes/liburing/all/patches/liburing-2.4-disable_samples_and_tests.patch new file mode 100644 index 0000000000000..beb6f175e2861 --- /dev/null +++ b/recipes/liburing/all/patches/liburing-2.4-disable_samples_and_tests.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile b/Makefile +index 73d021c..74aa8d7 100644 +--- a/Makefile ++++ b/Makefile +@@ -8,6 +8,4 @@ default: all + + all: + @$(MAKE) -C src +- @$(MAKE) -C test +- @$(MAKE) -C examples + + \ No newline at end of file diff --git a/recipes/liburing/all/test_package/CMakeLists.txt b/recipes/liburing/all/test_package/CMakeLists.txt index 7ccf5415cdb07..990625f9bc531 100644 --- a/recipes/liburing/all/test_package/CMakeLists.txt +++ b/recipes/liburing/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(liburing REQUIRED CONFIG) diff --git a/recipes/liburing/all/test_v1_package/CMakeLists.txt b/recipes/liburing/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/liburing/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/liburing/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", "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 264b68e5678d7..a350e9cf0e598 100644 --- a/recipes/liburing/config.yml +++ b/recipes/liburing/config.yml @@ -1,4 +1,12 @@ versions: + "2.8": + folder: all + "2.7": + folder: all + "2.6": + folder: all + "2.5": + folder: all "2.4": folder: all "2.3": diff --git a/recipes/libusb-compat/all/test_v1_package/CMakeLists.txt b/recipes/libusb-compat/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libusb-compat/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 852f062fd4f80..0000000000000 --- a/recipes/libusb-compat/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/libusb/all/test_package/CMakeLists.txt b/recipes/libusb/all/test_package/CMakeLists.txt index 968df07ffe10a..07502fcdf8fea 100644 --- a/recipes/libusb/all/test_package/CMakeLists.txt +++ b/recipes/libusb/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(libusb REQUIRED CONFIG) diff --git a/recipes/libusb/all/test_v1_package/CMakeLists.txt b/recipes/libusb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libusb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libusb/all/test_v1_package/conanfile.py b/recipes/libusb/all/test_v1_package/conanfile.py deleted file mode 100644 index 81f9e01d9be5d..0000000000000 --- a/recipes/libusb/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_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/libuuid/all/test_package/CMakeLists.txt b/recipes/libuuid/all/test_package/CMakeLists.txt index 75c717f769900..c8d7b49af9ba0 100644 --- a/recipes/libuuid/all/test_package/CMakeLists.txt +++ b/recipes/libuuid/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 C) find_package(libuuid REQUIRED CONFIG) diff --git a/recipes/libuuid/all/test_v1_package/CMakeLists.txt b/recipes/libuuid/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libuuid/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libuuid/all/test_v1_package/conanfile.py b/recipes/libuuid/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libuuid/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_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/libuv/all/conandata.yml b/recipes/libuv/all/conandata.yml index de25f5782ee20..d0ee02e78c23d 100644 --- a/recipes/libuv/all/conandata.yml +++ b/recipes/libuv/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.49.2": + url: "https://github.com/libuv/libuv/archive/v1.49.2.tar.gz" + sha256: "388ffcf3370d4cf7c4b3a3205504eea06c4be5f9e80d2ab32d19f8235accc1cf" + "1.49.1": + url: "https://github.com/libuv/libuv/archive/v1.49.1.tar.gz" + sha256: "94312ede44c6cae544ae316557e2651aea65efce5da06f8d44685db08392ec5d" + "1.49.0": + url: "https://github.com/libuv/libuv/archive/v1.49.0.tar.gz" + sha256: "a10656a0865e2cff7a1b523fa47d0f5a9c65be963157301f814d1cc5dbd4dc1d" + "1.48.0": + url: "https://github.com/libuv/libuv/archive/v1.48.0.tar.gz" + sha256: "8c253adb0f800926a6cbd1c6576abae0bc8eb86a4f891049b72f9e5b7dc58f33" "1.47.0": url: "https://github.com/libuv/libuv/archive/v1.47.0.tar.gz" sha256: "d50af7e6d72526db137e66fad812421c8a1cae09d146b0ec2bb9a22c5f23ba93" @@ -11,28 +23,29 @@ sources: "1.44.2": url: "https://github.com/libuv/libuv/archive/v1.44.2.tar.gz" sha256: "e6e2ba8b4c349a4182a33370bb9be5e23c51b32efb9b9e209d0e8556b73a48da" - "1.44.1": - url: "https://github.com/libuv/libuv/archive/v1.44.1.tar.gz" - sha256: "e91614e6dc2dd0bfdd140ceace49438882206b7a6fb00b8750914e67a9ed6d6b" "1.43.0": url: "https://github.com/libuv/libuv/archive/v1.43.0.tar.gz" sha256: "9e27825a55279de69a7c43e42d509fd1337c9bece2547c761e91a1592e91cc4d" "1.42.0": url: "https://github.com/libuv/libuv/archive/v1.42.0.tar.gz" sha256: "371e5419708f6aaeb8656671f89400b92a9bba6443369af1bb70bcd6e4b3c764" - "1.41.1": - url: "https://github.com/libuv/libuv/archive/v1.41.1.tar.gz" - sha256: "62c29d1d76b0478dc8aaed0ed1f874324f6cd2d6ff4cb59a44026c09e818cd53" - "1.41.0": - url: "https://github.com/libuv/libuv/archive/v1.41.0.zip" - sha256: "cb89a8b9f686c5ccf7ed09a9e0ece151a73ebebc17af3813159c335b02181794" - "1.40.0": - url: "https://github.com/libuv/libuv/archive/v1.40.0.zip" - sha256: "61366e30d8484197dc9e4a94dbd98a0ba52fb55cb6c6d991af1f3701b10f322b" - "1.38.1": - url: "https://github.com/libuv/libuv/archive/v1.38.1.zip" - sha256: "0359369492742eb2a36312fffe26f80bcffe4cec981a4fd72d182b061ee14890" patches: + "1.49.2": + - patch_file: "patches/1.49.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + "1.49.1": + - patch_file: "patches/1.49.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + "1.49.0": + - patch_file: "patches/1.49.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" + "1.48.0": + - patch_file: "patches/1.48.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" "1.47.0": - patch_file: "patches/1.47.0/fix-cmake.patch" patch_description: "separate shared and static library build" @@ -49,10 +62,6 @@ patches: - patch_file: "patches/1.44.2/fix-cmake.patch" patch_description: "separate shared and static library build" patch_type: "conan" - "1.44.1": - - patch_file: "patches/1.44.1/fix-cmake.patch" - patch_description: "separate shared and static library build" - patch_type: "conan" "1.43.0": - patch_file: "patches/1.43.0/fix-cmake.patch" patch_description: "separate shared and static library build" @@ -61,26 +70,3 @@ patches: - patch_file: "patches/1.42.0/fix-cmake.patch" patch_description: "separate shared and static library build" patch_type: "conan" - "1.41.1": - - patch_file: "patches/1.41.0/fix-cmake.patch" - patch_description: "separate shared and static library build" - patch_type: "conan" - - patch_file: "patches/1.40.0/fix-ios.patch" - "1.41.0": - - patch_file: "patches/1.41.0/fix-cmake.patch" - patch_description: "separate shared and static library build" - patch_type: "conan" - - patch_file: "patches/1.40.0/fix-ios.patch" - patch_description: "fix dlopen filename" - patch_type: "portability" - "1.40.0": - - patch_file: "patches/1.40.0/fix-cmake.patch" - patch_description: "separate shared and static library build" - patch_type: "conan" - - patch_file: "patches/1.40.0/fix-ios.patch" - patch_description: "fix dlopen filename" - patch_type: "portability" - "1.38.1": - - patch_file: "patches/1.38.1/fix-cmake.patch" - patch_description: "separate shared and static library build" - patch_type: "conan" diff --git a/recipes/libuv/all/patches/1.38.1/fix-cmake.patch b/recipes/libuv/all/patches/1.38.1/fix-cmake.patch deleted file mode 100644 index 752d2ecdc5cea..0000000000000 --- a/recipes/libuv/all/patches/1.38.1/fix-cmake.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2518c747..05b5add1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -297,13 +297,19 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") - list(APPEND uv_test_libraries util) - endif() - --add_library(uv SHARED ${uv_sources}) --target_compile_definitions(uv -- INTERFACE -- USING_UV_SHARED=1 -- PRIVATE -- BUILDING_UV_SHARED=1 -- ${uv_defines}) -+add_library(uv ${uv_sources}) -+get_target_property(target_type uv TYPE) -+if (target_type STREQUAL "SHARED_LIBRARY") -+ target_compile_definitions(uv -+ INTERFACE -+ USING_UV_SHARED=1 -+ PRIVATE -+ BUILDING_UV_SHARED=1 -+ ) -+else() -+ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") -+endif() -+target_compile_definitions(uv PRIVATE ${uv_defines}) - target_compile_options(uv PRIVATE ${uv_cflags}) - target_include_directories(uv - PUBLIC -@@ -313,17 +319,6 @@ target_include_directories(uv - $) - target_link_libraries(uv ${uv_libraries}) - --add_library(uv_a STATIC ${uv_sources}) --target_compile_definitions(uv_a PRIVATE ${uv_defines}) --target_compile_options(uv_a PRIVATE ${uv_cflags}) --target_include_directories(uv_a -- PUBLIC -- $ -- $ -- PRIVATE -- $) --target_link_libraries(uv_a ${uv_libraries}) -- - if(LIBUV_BUILD_TESTS) - # Small hack: use ${uv_test_sources} now to get the runner skeleton, - # before the actual tests are added. -@@ -558,22 +553,20 @@ if(UNIX) - set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) - set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) - set(prefix ${CMAKE_INSTALL_PREFIX}) -- configure_file(libuv.pc.in libuv.pc @ONLY) - - install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -- install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) -- install(FILES ${PROJECT_BINARY_DIR}/libuv.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -- install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) -+ install(TARGETS uv -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - - if(WIN32) - install(DIRECTORY include/ DESTINATION include) -- install(FILES LICENSE DESTINATION .) -- install(TARGETS uv uv_a -- RUNTIME DESTINATION lib/$ -- ARCHIVE DESTINATION lib/$) -+ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) -+ install(TARGETS uv -+ RUNTIME DESTINATION bin -+ ARCHIVE DESTINATION lib) - endif() - - message(STATUS "summary of build options: diff --git a/recipes/libuv/all/patches/1.40.0/fix-cmake.patch b/recipes/libuv/all/patches/1.40.0/fix-cmake.patch deleted file mode 100644 index 194123f2f2d1b..0000000000000 --- a/recipes/libuv/all/patches/1.40.0/fix-cmake.patch +++ /dev/null @@ -1,77 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e648b00..080f403 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -326,13 +326,19 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") - list(APPEND uv_test_libraries util) - endif() - --add_library(uv SHARED ${uv_sources}) --target_compile_definitions(uv -- INTERFACE -- USING_UV_SHARED=1 -- PRIVATE -- BUILDING_UV_SHARED=1 -- ${uv_defines}) -+add_library(uv ${uv_sources}) -+get_target_property(target_type uv TYPE) -+if (target_type STREQUAL "SHARED_LIBRARY") -+ target_compile_definitions(uv -+ INTERFACE -+ USING_UV_SHARED=1 -+ PRIVATE -+ BUILDING_UV_SHARED=1 -+ ) -+else() -+ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") -+endif() -+target_compile_definitions(uv PRIVATE ${uv_defines}) - target_compile_options(uv PRIVATE ${uv_cflags}) - target_include_directories(uv - PUBLIC -@@ -342,17 +348,6 @@ target_include_directories(uv - $) - target_link_libraries(uv ${uv_libraries}) - --add_library(uv_a STATIC ${uv_sources}) --target_compile_definitions(uv_a PRIVATE ${uv_defines}) --target_compile_options(uv_a PRIVATE ${uv_cflags}) --target_include_directories(uv_a -- PUBLIC -- $ -- $ -- PRIVATE -- $) --target_link_libraries(uv_a ${uv_libraries}) -- - if(LIBUV_BUILD_TESTS) - # Small hack: use ${uv_test_sources} now to get the runner skeleton, - # before the actual tests are added. -@@ -595,19 +590,18 @@ if(UNIX OR MINGW) - 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 ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -- install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) -+ install(TARGETS uv -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - - if(MSVC) - install(DIRECTORY include/ DESTINATION include) -- install(FILES LICENSE DESTINATION .) -- install(TARGETS uv uv_a -- RUNTIME DESTINATION lib/$ -- ARCHIVE DESTINATION lib/$) -+ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) -+ install(TARGETS uv -+ RUNTIME DESTINATION bin -+ ARCHIVE DESTINATION lib) - endif() - - message(STATUS "summary of build options: diff --git a/recipes/libuv/all/patches/1.40.0/fix-ios.patch b/recipes/libuv/all/patches/1.40.0/fix-ios.patch deleted file mode 100644 index 616e7c2083eea..0000000000000 --- a/recipes/libuv/all/patches/1.40.0/fix-ios.patch +++ /dev/null @@ -1,28 +0,0 @@ -patch from https://github.com/libuv/libuv/commit/1addf9b88a17bc32d009d377a14d540ccddd06db -fixed in 1.42.0 - ---- a/src/unix/darwin.c -+++ b/src/unix/darwin.c -@@ -33,9 +33,7 @@ - #include - #include /* sysconf */ - --#if !TARGET_OS_IPHONE - #include "darwin-stub.h" --#endif - - static uv_once_t once = UV_ONCE_INIT; - static uint64_t (*time_func)(void); -@@ -223,10 +221,10 @@ static int uv__get_cpu_speed(uint64_t* speed) { - err = UV_ENOENT; - core_foundation_handle = dlopen("/System/Library/Frameworks/" - "CoreFoundation.framework/" -- "Versions/A/CoreFoundation", -+ "CoreFoundation", - RTLD_LAZY | RTLD_LOCAL); - iokit_handle = dlopen("/System/Library/Frameworks/IOKit.framework/" -- "Versions/A/IOKit", -+ "IOKit", - RTLD_LAZY | RTLD_LOCAL); - - if (core_foundation_handle == NULL || iokit_handle == NULL) diff --git a/recipes/libuv/all/patches/1.41.0/fix-cmake.patch b/recipes/libuv/all/patches/1.41.0/fix-cmake.patch deleted file mode 100644 index 08dd6f34be1b3..0000000000000 --- a/recipes/libuv/all/patches/1.41.0/fix-cmake.patch +++ /dev/null @@ -1,77 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c8e881d1..82daa0d2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -335,13 +335,19 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") - list(APPEND uv_test_libraries util) - endif() - --add_library(uv SHARED ${uv_sources}) --target_compile_definitions(uv -- INTERFACE -- USING_UV_SHARED=1 -- PRIVATE -- BUILDING_UV_SHARED=1 -- ${uv_defines}) -+add_library(uv ${uv_sources}) -+get_target_property(target_type uv TYPE) -+if (target_type STREQUAL "SHARED_LIBRARY") -+ target_compile_definitions(uv -+ INTERFACE -+ USING_UV_SHARED=1 -+ PRIVATE -+ BUILDING_UV_SHARED=1 -+ ) -+else() -+ set_property(TARGET uv PROPERTY OUTPUT_NAME "uv_a") -+endif() -+target_compile_definitions(uv PRIVATE ${uv_defines}) - target_compile_options(uv PRIVATE ${uv_cflags}) - target_include_directories(uv - PUBLIC -@@ -351,17 +357,6 @@ target_include_directories(uv - $) - target_link_libraries(uv ${uv_libraries}) - --add_library(uv_a STATIC ${uv_sources}) --target_compile_definitions(uv_a PRIVATE ${uv_defines}) --target_compile_options(uv_a PRIVATE ${uv_cflags}) --target_include_directories(uv_a -- PUBLIC -- $ -- $ -- PRIVATE -- $) --target_link_libraries(uv_a ${uv_libraries}) -- - if(LIBUV_BUILD_TESTS) - # Small hack: use ${uv_test_sources} now to get the runner skeleton, - # before the actual tests are added. -@@ -605,19 +600,18 @@ if(UNIX OR MINGW) - 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 ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -- install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) -+ install(TARGETS uv -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - - if(MSVC) - install(DIRECTORY include/ DESTINATION include) -- install(FILES LICENSE DESTINATION .) -- install(TARGETS uv uv_a -- RUNTIME DESTINATION lib/$ -- ARCHIVE DESTINATION lib/$) -+ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) -+ install(TARGETS uv -+ RUNTIME DESTINATION bin -+ ARCHIVE DESTINATION lib) - endif() - - message(STATUS "summary of build options: diff --git a/recipes/libuv/all/patches/1.48.0/fix-cmake.patch b/recipes/libuv/all/patches/1.48.0/fix-cmake.patch new file mode 100644 index 0000000000000..4fbe54ddf91e7 --- /dev/null +++ b/recipes/libuv/all/patches/1.48.0/fix-cmake.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5e8e016..427bd86 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -465,7 +465,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}) +@@ -485,7 +485,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. +@@ -750,18 +750,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. +@@ -775,6 +775,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.49.0/fix-cmake.patch b/recipes/libuv/all/patches/1.49.0/fix-cmake.patch new file mode 100644 index 0000000000000..6d9a35e21bcd5 --- /dev/null +++ b/recipes/libuv/all/patches/1.49.0/fix-cmake.patch @@ -0,0 +1,67 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 28c6df2..608d0f7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -471,7 +471,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}) +@@ -491,7 +491,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. +@@ -759,18 +759,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. +@@ -784,8 +784,16 @@ 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) + set(CMAKE_DEBUG_POSTFIX d) + get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} DIRECTORY) diff --git a/recipes/libuv/all/test_package/CMakeLists.txt b/recipes/libuv/all/test_package/CMakeLists.txt index 582a892fd9c5b..92df909f2a2eb 100644 --- a/recipes/libuv/all/test_package/CMakeLists.txt +++ b/recipes/libuv/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(libuv REQUIRED CONFIG) diff --git a/recipes/libuv/all/test_v1_package/CMakeLists.txt b/recipes/libuv/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index cc50e3b1333c0..0000000000000 --- a/recipes/libuv/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libuv REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -if(TARGET uv_a) - target_link_libraries(${PROJECT_NAME} PRIVATE uv_a) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE uv) -endif() diff --git a/recipes/libuv/all/test_v1_package/conanfile.py b/recipes/libuv/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libuv/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_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/libuv/config.yml b/recipes/libuv/config.yml index 4c8ae03d813d7..341ae1de60810 100644 --- a/recipes/libuv/config.yml +++ b/recipes/libuv/config.yml @@ -1,4 +1,12 @@ versions: + "1.49.2": + folder: all + "1.49.1": + folder: all + "1.49.0": + folder: all + "1.48.0": + folder: all "1.47.0": folder: all "1.46.0": @@ -7,17 +15,7 @@ versions: folder: all "1.44.2": folder: all - "1.44.1": - folder: all "1.43.0": folder: all "1.42.0": folder: all - "1.41.1": - folder: all - "1.41.0": - folder: all - "1.40.0": - folder: all - "1.38.1": - folder: all diff --git a/recipes/libuvc/all/conanfile.py b/recipes/libuvc/all/conanfile.py index cb9de052b88cd..8a78285d29849 100644 --- a/recipes/libuvc/all/conanfile.py +++ b/recipes/libuvc/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import Environment, VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir @@ -8,7 +8,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LibuvcConan(ConanFile): @@ -24,13 +24,11 @@ class LibuvcConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], - "jpeg_turbo": [True, False, "deprecated"], } default_options = { "shared": False, "fPIC": True, "with_jpeg": "libjpeg", - "jpeg_turbo": "deprecated", } def export_sources(self): @@ -46,12 +44,6 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") - # TODO: to remove once deprecated jpeg_turbo option removed - if self.options.jpeg_turbo != "deprecated": - self.output.warning("jpeg_turbo option is deprecated, please use with_jpeg option instead") - if self.options.jpeg_turbo: - self.options.with_jpeg == "libjpeg-turbo" - def layout(self): cmake_layout(self, src_folder="src") @@ -64,10 +56,6 @@ def requirements(self): elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.3") - def package_id(self): - # TODO: to remove once deprecated jpeg_turbo option removed - del self.info.options.jpeg_turbo - def validate(self): if is_msvc(self): # Upstream issues, e.g.: @@ -93,6 +81,9 @@ def generate(self): # Relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.0.7": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() CMakeDeps(self).generate() @@ -129,13 +120,5 @@ def package_info(self): self.cpp_info.components["_libuvc"].requires.append("libjpeg-turbo::jpeg") elif self.options.with_jpeg == "mozjpeg": self.cpp_info.components["_libuvc"].requires.append("mozjpeg::libjpeg") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "libuvc" - self.cpp_info.filenames["cmake_find_package_multi"] = "libuvc" - self.cpp_info.names["cmake_find_package"] = "LibUVC" - self.cpp_info.names["cmake_find_package_multi"] = "LibUVC" - self.cpp_info.components["_libuvc"].names["cmake_find_package"] = cmake_target - self.cpp_info.components["_libuvc"].names["cmake_find_package_multi"] = cmake_target self.cpp_info.components["_libuvc"].set_property("cmake_target_name", f"LibUVC::{cmake_target}") self.cpp_info.components["_libuvc"].set_property("pkg_config_name", "libuvc") diff --git a/recipes/libuvc/all/test_package/CMakeLists.txt b/recipes/libuvc/all/test_package/CMakeLists.txt index ff4548b24f295..4f0e32a5e428a 100644 --- a/recipes/libuvc/all/test_package/CMakeLists.txt +++ b/recipes/libuvc/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(libuvc REQUIRED CONFIG) diff --git a/recipes/libuvc/all/test_v1_package/CMakeLists.txt b/recipes/libuvc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libuvc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libuvc/all/test_v1_package/conanfile.py b/recipes/libuvc/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libuvc/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_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/libva/all/conandata.yml b/recipes/libva/all/conandata.yml new file mode 100644 index 0000000000000..b9410dc0ab2cf --- /dev/null +++ b/recipes/libva/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.21.0": + url: "https://github.com/intel/libva/archive/refs/tags/2.21.0.tar.gz" + sha256: "f7c3fffef3f04eb146e036dad2587d852bfb70e4926d014bf437244915ef7425" + "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..d92edb9da1d88 --- /dev/null +++ b/recipes/libva/all/conanfile.py @@ -0,0 +1,165 @@ +import os + +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, 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 + + +required_conan_version = ">=1.60.0 <2 || >=2.0.6" + + +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, + } + + @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.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") and self._has_build_profile: + self.tool_requires("wayland/") + self.tool_requires("meson/1.3.2") + 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.project_options["build.pkg_config_path"] = self.generators_folder + tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self.options.get_safe("with_wayland") and self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} + pkg_config_deps.generate() + tc = VirtualBuildEnv(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if self.options.get_safe("with_wayland") and self._has_build_profile: + # Patch the build system to use the pkg-config files generated for the build context. + meson_build_file = os.path.join(self.source_folder, "meson.build") + replace_in_file( + self, + meson_build_file, + "wayland_scanner_dep = dependency('wayland-scanner',", + "wayland_scanner_dep = dependency('wayland-scanner_BUILD',", + ) + + def build(self): + self._patch_sources() + 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..62ed7a3258f1a --- /dev/null +++ b/recipes/libva/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +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..d0b998814a4e8 --- /dev/null +++ b/recipes/libva/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +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" + 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): + 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..d0c85671c9e11 --- /dev/null +++ b/recipes/libva/config.yml @@ -0,0 +1,5 @@ +versions: + "2.21.0": + folder: all + "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..bfc950b624ab9 100644 --- a/recipes/libvault/all/conandata.yml +++ b/recipes/libvault/all/conandata.yml @@ -1,23 +1,4 @@ sources: - "0.52.0": - url: "https://github.com/abedra/libvault/archive/refs/tags/0.52.0.zip" - sha256: 49058ac9a1d3d1d08ac165f5f7b50e3a2a2ab0d3f9b8bb8194fa7a8de36edcf8 - "0.51.0": - url: "https://github.com/abedra/libvault/archive/refs/tags/0.51.0.zip" - sha256: 570ccc6451cf8e93b1c585bbf6ab5212ff9290b3a9b477752cf0651414b3d026 - "0.48.0": - url: "https://github.com/abedra/libvault/archive/0.48.0.zip" - sha256: 0a42be282ff0aff77b68cb7238014aa762df5c6b62e4d3561878874ca3760489 -patches: - "0.52.0": - - patch_file: "patches/fix-cmake-0.51.0.patch" - patch_type: "conan" - patch_description: "use libcurl from conan center" - "0.51.0": - - patch_file: "patches/fix-cmake-0.51.0.patch" - patch_type: "conan" - patch_description: "use libcurl from conan center" - "0.48.0": - - patch_file: "patches/fix-cmake-0.48.0.patch" - patch_type: "conan" - patch_description: "use libcurl from conan center" + "0.59.0": + url: "https://github.com/abedra/libvault/archive/refs/tags/0.59.0.zip" + sha256: 668e71e1689f6142735387989042945e42fd6e0483f223ce3a08121887a335ce diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 659305c5f732b..98c9c4d3f5c6b 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -1,15 +1,15 @@ 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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, 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" +required_conan_version = ">=1.54.0" class LibvaultConan(ConanFile): @@ -19,15 +19,35 @@ 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" + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "7.0", + "apple-clang": "12", + } + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -36,64 +56,59 @@ 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) def validate(self): - compiler = str(self.info.settings.compiler) - compiler_version = Version(self.settings.compiler.version.value) - - minimum_compiler_version = { - "Visual Studio": "19", - "gcc": "8", - "clang": "7.0", - "apple-clang": "12", - } - - minimum_cpp_standard = 17 - - if compiler in minimum_compiler_version and \ - compiler_version < minimum_compiler_version[compiler]: + 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.name} requires a compiler that supports at least C++{minimum_cpp_standard}. " - f"{compiler} {compiler_version} is not supported.") + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) - if compiler == "clang" and self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] and self.settings.compiler.version == "11": + 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") 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.") - if self.settings.compiler.get_safe("cppstd"): - 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["ENABLE_TEST"] = False + tc.variables["ENABLE_INTEGRATION_TEST"] = False + tc.variables["ENABLE_COVERAGE"] = False + tc.variables["LINK_CURL"] = True 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.generate() - tc = VirtualBuildEnv(self) - tc.generate(scope="build") + + def _patch_sources(self): + # INFO: https://github.com/abedra/libvault/pull/123 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "target_link_libraries(vault curl)", + "target_link_libraries(vault CURL::libcurl)") def build(self): - apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) - cmake.configure(build_script_folder=self.build_folder) + cmake.configure() cmake.build() def package(self): @@ -105,12 +120,11 @@ 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/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/libvault/all/test_package/CMakeLists.txt b/recipes/libvault/all/test_package/CMakeLists.txt index 265e54ec6a967..642e3bb2c3815 100644 --- a/recipes/libvault/all/test_package/CMakeLists.txt +++ b/recipes/libvault/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) diff --git a/recipes/libvault/all/test_v1_package/CMakeLists.txt b/recipes/libvault/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libvault/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libvault/all/test_v1_package/conanfile.py b/recipes/libvault/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/libvault/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/libvault/config.yml b/recipes/libvault/config.yml index 327b1962634e5..06bedb729ed91 100644 --- a/recipes/libvault/config.yml +++ b/recipes/libvault/config.yml @@ -1,7 +1,3 @@ versions: - "0.52.0": - folder: "all" - "0.51.0": - folder: "all" - "0.48.0": + "0.59.0": folder: "all" 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..d142b00021b8d --- /dev/null +++ b/recipes/libvdpau/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +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/libversion/all/conandata.yml b/recipes/libversion/all/conandata.yml new file mode 100644 index 0000000000000..7acd1fda14fab --- /dev/null +++ b/recipes/libversion/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.3": + url: "https://github.com/repology/libversion/archive/refs/tags/3.0.3.tar.gz" + sha256: "bb49d745a0c8e692007af6d928046d1ab6b9189f8dbba834cdf3c1d251c94a1d" diff --git a/recipes/libversion/all/conanfile.py b/recipes/libversion/all/conanfile.py new file mode 100644 index 0000000000000..350b19652c4dc --- /dev/null +++ b/recipes/libversion/all/conanfile.py @@ -0,0 +1,91 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.files import copy, get, replace_in_file, rm, rmdir, save +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" + + +class LibversionConan(ConanFile): + name = "libversion" + description = "Advanced version string comparison library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/repology/libversion" + topics = ("versioning", "version") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_tools": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # Requires getopt.h and unistd.h + del self.options.build_tools + + 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 _patch_sources(self): + # Disable tests + save(self, os.path.join(self.source_folder, "tests", "CMakeLists.txt"), "") + # Disable tools + if not self.options.get_safe("build_tools"): + save(self, os.path.join(self.source_folder, "utils", "CMakeLists.txt"), "") + # Install only the appropriate target + target = "libversion" if self.options.shared else "libversion_static" + replace_in_file(self, os.path.join(self.source_folder, "libversion", "CMakeLists.txt"), + "install(TARGETS libversion libversion_static EXPORT libversion)", + f"install(TARGETS {target} EXPORT libversion)") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", 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")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "libversion") + self.cpp_info.set_property("cmake_target_name", "libversion::libversion") + self.cpp_info.set_property("pkg_config_name", "libversion") + + if is_msvc(self) and self.options.shared: + self.cpp_info.libs = ["libversion"] + else: + self.cpp_info.libs = ["version"] + + if not self.options.shared: + self.cpp_info.defines.append("LIBVERSION_STATIC_DEFINE") diff --git a/recipes/libversion/all/test_package/CMakeLists.txt b/recipes/libversion/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..83cab1b5e13a3 --- /dev/null +++ b/recipes/libversion/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(libversion REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libversion::libversion) diff --git a/recipes/libversion/all/test_package/conanfile.py b/recipes/libversion/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/libversion/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/libversion/all/test_package/test_package.c b/recipes/libversion/all/test_package/test_package.c new file mode 100644 index 0000000000000..1fde3fd757058 --- /dev/null +++ b/recipes/libversion/all/test_package/test_package.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017-2019 Dmitry Marakasov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include + +int main() { + /* 0.99 < 1.11 */ + assert(version_compare2("0.99", "1.11") == -1); + + /* 1.0 == 1.0.0 */ + assert(version_compare2("1.0", "1.0.0") == 0); + + /* 1.0alpha1 < 1.0.rc1 */ + assert(version_compare2("1.0alpha1", "1.0.rc1") == -1); + + /* 1.0 > 1.0.rc1 */ + assert(version_compare2("1.0", "1.0-rc1") == 1); + + /* 1.2.3alpha4 is the same as 1.2.3~a4 */ + assert(version_compare2("1.2.3alpha4", "1.2.3~a4") == 0); + + /* by default, `p' is treated as `pre'... */ + assert(version_compare2("1.0p1", "1.0pre1") == 0); + assert(version_compare2("1.0p1", "1.0post1") == -1); + assert(version_compare2("1.0p1", "1.0patch1") == -1); + + /* ...but this is tunable: here it's handled as `patch` */ + assert(version_compare4("1.0p1", "1.0pre1", VERSIONFLAG_P_IS_PATCH, 0) == 1); + assert(version_compare4("1.0p1", "1.0post1", VERSIONFLAG_P_IS_PATCH, 0) == 0); + assert(version_compare4("1.0p1", "1.0patch1", VERSIONFLAG_P_IS_PATCH, 0) == 0); + + /* a way to check that the version belongs to a given release */ + assert( + (version_compare4("1.0alpha1", "1.0", 0, VERSIONFLAG_LOWER_BOUND) == 1) && + (version_compare4("1.0alpha1", "1.0", 0, VERSIONFLAG_UPPER_BOUND) == -1) && + (version_compare4("1.0.1", "1.0", 0, VERSIONFLAG_LOWER_BOUND) == 1) && + (version_compare4("1.0.1", "1.0", 0, VERSIONFLAG_UPPER_BOUND) == -1) + /* 1.0alpha1 and 1.0.1 belong to 1.0 release, e.g. they lie between + (lowest possible version in 1.0) and (highest possible version in 1.0) */ + ); +} diff --git a/recipes/libversion/config.yml b/recipes/libversion/config.yml new file mode 100644 index 0000000000000..9542a01cf889e --- /dev/null +++ b/recipes/libversion/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.3": + folder: all diff --git a/recipes/libverto/all/test_package/CMakeLists.txt b/recipes/libverto/all/test_package/CMakeLists.txt index 78d37a6a36d00..1d9415c70e4a1 100644 --- a/recipes/libverto/all/test_package/CMakeLists.txt +++ b/recipes/libverto/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) enable_testing() diff --git a/recipes/libverto/all/test_v1_package/CMakeLists.txt b/recipes/libverto/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c23ed5cfe6d98..0000000000000 --- a/recipes/libverto/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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/libverto/all/test_v1_package/conanfile.py b/recipes/libverto/all/test_v1_package/conanfile.py deleted file mode 100644 index dba2a86154e1e..0000000000000 --- a/recipes/libverto/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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.definitions["LIBVERTO_WITH_GLIB"] = bool(self.options["libverto"].with_glib) - cmake.definitions["LIBVERTO_WITH_LIBEV"] = bool(self.options["libverto"].with_libev) - cmake.definitions["LIBVERTO_WITH_LIBEVENT"] = bool(self.options["libverto"].with_libevent) - cmake.definitions["LIBVERTO_WITH_TEVENT"] = bool(self.options["libverto"].with_tevent) - 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} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/libvips/all/conandata.yml b/recipes/libvips/all/conandata.yml index 63e4c5485d4ad..f0b90d943a795 100644 --- a/recipes/libvips/all/conandata.yml +++ b/recipes/libvips/all/conandata.yml @@ -1,4 +1,27 @@ sources: + "8.16.0": + url: "https://github.com/libvips/libvips/releases/download/v8.16.0/vips-8.16.0.tar.xz" + sha256: "6eca46c6ba5fac86224fd69007741012b0ea1f9aa1fcb9256b0cbc2faf768563" + "8.15.3": + url: "https://github.com/libvips/libvips/releases/download/v8.15.3/vips-8.15.3.tar.xz" + sha256: "3e27d9f536eafad64013958fe9e8a1964c90b564c731d49db7c1a1c11b1052a0" + "8.15.2": + url: "https://github.com/libvips/libvips/releases/download/v8.15.2/vips-8.15.2.tar.xz" + sha256: "a2ab15946776ca7721d11cae3215f20f1f097b370ff580cd44fc0f19387aee84" + "8.15.1": + url: "https://github.com/libvips/libvips/releases/download/v8.15.1/vips-8.15.1.tar.xz" + sha256: "06811f5aed3e7bc03e63d05537ff4b501de5283108c8ee79396c60601a00830c" "8.14.2": url: "https://github.com/libvips/libvips/releases/download/v8.14.2/vips-8.14.2.tar.xz" sha256: "27dad021f0835a5ab14e541d02abd41e4c3bd012d2196438df5a9e754984f7ce" +patches: + "8.15.3": + - patch_file: "patches/0001-fix-8-15-3-msvc-build.patch" + patch_description: "Fix broken msvc build due to ssize_t" + patch_type: "portability" + patch_source: "https://github.com/libvips/libvips/pull/4153" + "8.16.0": + - patch_file: "patches/0002-fix-8-16-0-msvc-build.patch" + patch_description: "Fix broken msvc build due to division by zero" + patch_type: "portability" + patch_source: "https://github.com/libvips/libvips/pull/4332" diff --git a/recipes/libvips/all/conanfile.py b/recipes/libvips/all/conanfile.py index 4e9baa365d40f..67edec9d6bf34 100644 --- a/recipes/libvips/all/conanfile.py +++ b/recipes/libvips/all/conanfile.py @@ -1,12 +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 check_min_cppstd from conan.tools.env import VirtualBuildEnv -from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.files import copy, get, replace_in_file, rm, rmdir, apply_conandata_patches, export_conandata_patches 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, is_msvc_static_runtime +from conan.tools.scm import Version import os required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" @@ -28,13 +30,14 @@ class LibvipsConan(ConanFile): "cpp": [True, False], "introspection": [True, False], "vapi": [True, False], + "with_archive": [True, False], "with_cfitsio": [True, False], "with_cgif": [True, False], "with_exif": [True, False], "with_fftw": [True, False], "with_fontconfig": [True, False], - "with_gsf": [True, False], "with_heif": [True, False], + "with_highway": [True, False], "with_imagequant": [True, False], "with_jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg", False], "with_jpeg_xl": [True, False], @@ -67,13 +70,14 @@ class LibvipsConan(ConanFile): "cpp": True, "introspection": False, "vapi": False, + "with_archive": False, "with_cfitsio": False, "with_cgif": False, "with_exif": False, "with_fftw": True, "with_fontconfig": False, - "with_gsf": False, "with_heif": False, + "with_highway": False, "with_imagequant": False, "with_jpeg": "libjpeg", "with_jpeg_xl": False, @@ -103,6 +107,13 @@ class LibvipsConan(ConanFile): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "8.15": + del self.options.with_archive + del self.options.with_highway + if is_msvc(self): + # deprecated build fails with + # vips7compat.h(1661): error C2016: C requires that a struct or union have at least one member + self.options.deprecated = False def configure(self): if self.options.shared: @@ -111,12 +122,17 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + def export_sources(self): + export_conandata_patches(self) + def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") - self.requires("glib/2.78.1", transitive_headers=True, transitive_libs=True) + self.requires("expat/[>=2.6.2 <3]") + self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("with_archive"): + self.requires("libarchive/3.7.2") if self.options.with_cfitsio: self.requires("cfitsio/4.3.0") if self.options.with_cgif: @@ -126,33 +142,35 @@ def requirements(self): if self.options.with_fftw: self.requires("fftw/3.3.10") if self.options.with_fontconfig: - self.requires("fontconfig/2.14.2") + self.requires("fontconfig/2.15.0") if self.options.with_heif: self.requires("libheif/1.16.2") + if self.options.get_safe("with_highway"): + self.requires("highway/1.0.7") if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.1") + self.requires("libjpeg-turbo/3.0.2") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.5") if self.options.with_jpeg_xl: - self.requires("libjxl/0.6.1") + self.requires("libjxl/0.11.1") if self.options.with_lcms: - self.requires("lcms/2.14") + self.requires("lcms/2.16") if self.options.with_magick: self.requires("imagemagick/7.0.11-14") if self.options.with_matio: self.requires("matio/1.5.24") if self.options.with_openexr: - self.requires("openexr/3.2.1") + self.requires("openexr/3.2.3") if self.options.with_openjpeg: - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.with_pangocairo: self.requires("pango/1.50.10") if self.options.with_pdfium: self.requires("pdfium/95.0.4629") if self.options.with_png == "libpng": - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") elif self.options.with_png == "libspng": self.requires("libspng/0.7.4") if self.options.with_poppler: @@ -174,6 +192,9 @@ def validate(self): if self.options.with_cgif and not (self.options.with_imagequant or self.options.with_quantizr): raise ConanInvalidConfiguration("with_cgif requires either with_imagequant or with_quantizr") + if Version(self.version) >= "8.15" and self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + # Visual Studio < 2019 doesn't seem to like pointer restrict of pointer restrict in libnsgif check_min_vs(self, "192") @@ -183,8 +204,6 @@ def validate(self): f"{self.ref} static with MT runtime not supported if glib shared due to conancenter CI limitations" ) - if self.options.with_gsf: - raise ConanInvalidConfiguration("libgsf recipe not available in conancenter yet") if self.options.with_imagequant: raise ConanInvalidConfiguration("libimagequant recipe not available in conancenter yet") if self.options.with_nifti: @@ -199,9 +218,9 @@ def validate(self): raise ConanInvalidConfiguration("librsvg recipe not available in conancenter yet") def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/[>=1.2.3 <2]") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") if self.options.introspection: self.tool_requires("gobject-introspection/1.72.0") self.tool_requires("glib/") @@ -211,7 +230,7 @@ def build_requirements(self): # 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") + self.tool_requires("gettext/0.22.5") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -229,17 +248,24 @@ def generate(self): tc.project_options["doxygen"] = "false" tc.project_options["gtk_doc"] = "false" tc.project_options["modules"] = "disabled" - tc.project_options["introspection"] = true_false(self.options.introspection) + tc.project_options["introspection"] = ( + enabled_disabled(self.options.introspection) + if Version(self.version) >= "8.15" else + true_false(self.options.introspection) + ) tc.project_options["vapi"] = true_false(self.options.vapi) # External libraries + if Version(self.version) >= "8.15": + tc.project_options["archive"] = enabled_disabled(self.options.get_safe("with_archive")) tc.project_options["cfitsio"] = enabled_disabled(self.options.with_cfitsio) tc.project_options["cgif"] = enabled_disabled(self.options.with_cgif) tc.project_options["exif"] = enabled_disabled(self.options.with_exif) tc.project_options["fftw"] = enabled_disabled(self.options.with_fftw) tc.project_options["fontconfig"] = enabled_disabled(self.options.with_fontconfig) - tc.project_options["gsf"] = enabled_disabled(self.options.with_gsf) tc.project_options["heif"] = enabled_disabled(self.options.with_heif) tc.project_options["heif-module"] = "disabled" + if Version(self.version) >= "8.15": + tc.project_options["highway"] = enabled_disabled(self.options.with_highway) tc.project_options["imagequant"] = enabled_disabled(self.options.with_imagequant) tc.project_options["jpeg"] = enabled_disabled(bool(self.options.with_jpeg)) tc.project_options["jpeg-xl"] = enabled_disabled(self.options.with_jpeg_xl) @@ -276,6 +302,8 @@ def generate(self): deps.generate() def _patch_sources(self): + apply_conandata_patches(self) + # Disable tests meson_build = os.path.join(self.source_folder, "meson.build") replace_in_file(self, meson_build, "subdir('test')", "") @@ -311,6 +339,8 @@ def package_info(self): self.cpp_info.components["vips"].requires = [ "expat::expat", "glib::glib-2.0", "glib::gio-2.0", "glib::gobject-2.0", ] + if self.options.get_safe("with_archive"): + self.cpp_info.components["vips"].requires.append("libarchive::libarchive") if self.options.with_cfitsio: self.cpp_info.components["vips"].requires.append("cfitsio::cfitsio") if self.options.with_cgif: @@ -323,6 +353,8 @@ def package_info(self): self.cpp_info.components["vips"].requires.append("fontconfig::fontconfig") if self.options.with_heif: self.cpp_info.components["vips"].requires.append("libheif::libheif") + if self.options.get_safe("with_highway"): + self.cpp_info.components["vips"].requires.append("highway::highway") if self.options.with_jpeg == "libjpeg": self.cpp_info.components["vips"].requires.append("libjpeg::libjpeg") elif self.options.with_jpeg == "libjpeg-turbo": diff --git a/recipes/libvips/all/patches/0001-fix-8-15-3-msvc-build.patch b/recipes/libvips/all/patches/0001-fix-8-15-3-msvc-build.patch new file mode 100644 index 0000000000000..fb781f613a9aa --- /dev/null +++ b/recipes/libvips/all/patches/0001-fix-8-15-3-msvc-build.patch @@ -0,0 +1,36 @@ +From a1f3bf3c98d21b09a75f57682cdb12a6e48ebb08 Mon Sep 17 00:00:00 2001 +From: Julianiolo <50519317+Julianiolo@users.noreply.github.com> +Date: Fri, 13 Sep 2024 21:31:02 +0200 +Subject: [PATCH] replace ssize_t with gint64 + +--- + libvips/iofuncs/generate.c | 2 +- + libvips/iofuncs/util.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libvips/iofuncs/generate.c b/libvips/iofuncs/generate.c +index bb3d1b2d7..8941762f7 100644 +--- a/libvips/iofuncs/generate.c ++++ b/libvips/iofuncs/generate.c +@@ -638,7 +638,7 @@ write_vips(VipsRegion *region, VipsRect *area, void *a) + // write() uses int not size_t on windows, so we need to chunk + // ... max 1gb, why not + int chunk_size = VIPS_MIN(1024 * 1024 * 1024, count); +- ssize_t nwritten = write(region->im->fd, buf, chunk_size); ++ gint64 nwritten = write(region->im->fd, buf, chunk_size); + + /* n == 0 isn't strictly an error, but we treat it as + * one to make sure we don't get stuck in this loop. +diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c +index 46976ef42..acf78ade8 100644 +--- a/libvips/iofuncs/util.c ++++ b/libvips/iofuncs/util.c +@@ -541,7 +541,7 @@ vips__write(int fd, const void *buf, size_t count) + // write() uses int not size_t on windows, so we need to chunk + // ... max 1gb, why not + int chunk_size = VIPS_MIN(1024 * 1024 * 1024, count); +- ssize_t nwritten = write(fd, buf, chunk_size); ++ gint64 nwritten = write(fd, buf, chunk_size); + + /* n == 0 isn't strictly an error, but we treat it as + * one to make sure we don't get stuck in this loop. diff --git a/recipes/libvips/all/patches/0002-fix-8-16-0-msvc-build.patch b/recipes/libvips/all/patches/0002-fix-8-16-0-msvc-build.patch new file mode 100644 index 0000000000000..a87911d4a2c97 --- /dev/null +++ b/recipes/libvips/all/patches/0002-fix-8-16-0-msvc-build.patch @@ -0,0 +1,31 @@ +diff --git a/libvips/arithmetic/complex.c b/libvips/arithmetic/complex.c +index 60010d994..fe62ee04f 100644 +--- a/libvips/arithmetic/complex.c ++++ b/libvips/arithmetic/complex.c +@@ -449,12 +449,14 @@ G_DEFINE_TYPE(VipsComplex2, vips_complex2, VIPS_TYPE_BINARY); + #define CROSS(Q, X1, Y1, X2, Y2) \ + { \ + if (((X1) == 0.0 && (Y1) == 0.0) || \ +- ((X2) == 0.0 && (Y2) == 0.0)) { \ ++ ((X2) == 0.0 && (Y2) == 0.0) || \ ++ ((Y1) == 0.0 && (Y2) == 0.0)) { \ + Q[0] = 0.0; \ + Q[1] = 0.0; \ + } \ + else if (ABS(Y1) > ABS(Y2)) { \ +- double a = Y2 / Y1; \ ++ double y1 = Y1; /* this suppress C2142 (division by zero) error on MSVC */ \ ++ double a = Y2 / y1; \ + double b = Y1 + Y2 * a; \ + double re = (X1 + X2 * a) / b; \ + double im = (X2 - X1 * a) / b; \ +@@ -464,7 +466,8 @@ G_DEFINE_TYPE(VipsComplex2, vips_complex2, VIPS_TYPE_BINARY); + Q[1] = im / mod; \ + } \ + else { \ +- double a = Y1 / Y2; \ ++ double y2 = Y2; \ ++ double a = Y1 / y2; \ + double b = Y2 + Y1 * a; \ + double re = (X1 * a + X2) / b; \ + double im = (X2 * a - X1) / b; \ diff --git a/recipes/libvips/config.yml b/recipes/libvips/config.yml index 806cee97d7d96..28725906d05f3 100644 --- a/recipes/libvips/config.yml +++ b/recipes/libvips/config.yml @@ -1,3 +1,11 @@ versions: + "8.16.0": + folder: all + "8.15.3": + folder: all + "8.15.2": + folder: all + "8.15.1": + folder: all "8.14.2": folder: all diff --git a/recipes/libvpx/all/conandata.yml b/recipes/libvpx/all/conandata.yml index 6d2cd13499015..556d9f33bcae4 100644 --- a/recipes/libvpx/all/conandata.yml +++ b/recipes/libvpx/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.14.1": + url: "https://github.com/webmproject/libvpx/archive/refs/tags/v1.14.1.tar.gz" + sha256: "901747254d80a7937c933d03bd7c5d41e8e6c883e0665fadcb172542167c7977" + "1.14.0": + url: "https://github.com/webmproject/libvpx/archive/refs/tags/v1.14.0.tar.gz" + sha256: "5f21d2db27071c8a46f1725928a10227ae45c5cd1cad3727e4aafbe476e321fa" "1.13.1": url: "https://github.com/webmproject/libvpx/archive/refs/tags/v1.13.1.tar.gz" sha256: "00dae80465567272abd077f59355f95ac91d7809a2d3006f9ace2637dd429d14" @@ -8,9 +14,6 @@ sources: "1.10.0": 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/refs/tags/v1.9.0.tar.gz" - sha256: "d279c10e4b9316bf11a570ba16c3d55791e1ad6faa4404c67422eb631782c80a" patches: "1.11.0": - patch_file: "patches/0001-extended-support-1.10.0.patch" @@ -22,12 +25,3 @@ patches: 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 42873e7560c7d..babc16fe80346 100644 --- a/recipes/libvpx/all/conanfile.py +++ b/recipes/libvpx/all/conanfile.py @@ -1,15 +1,17 @@ +import os +import re + 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 stdcpp_library from conan.tools.env import Environment, VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file, rename +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file, \ + rename 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 from conan.tools.scm import Version -import os -import re required_conan_version = ">=1.57.0" @@ -58,6 +60,9 @@ def configure(self): self.package_type = "static-library" if self.options.get_safe("shared"): self.options.rm_safe("fPIC") + if self.settings.os == "Android": + del self.options.shared + self.package_type = "static-library" def layout(self): basic_layout(self, src_folder="src") @@ -67,6 +72,8 @@ def validate(self): 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": raise ConanInvalidConfiguration("M1 only supported since 1.10, please upgrade") + if self.settings.os == "iOS" and (self.settings.os.sdk != "iphonesimulator" and self.settings.arch in ["x86_64", "x86"]): + raise ConanInvalidConfiguration("iOS platform with x86/x86_64 architectures only supports 'iphonesimulator' SDK option") def build_requirements(self): self.tool_requires("yasm/1.3.0") @@ -82,65 +89,39 @@ def source(self): def _install_tmp_folder(self): return "tmp_install" - def generate(self): - env = VirtualBuildEnv(self) - env.generate() - - tc = AutotoolsToolchain(self) - - if is_apple_os(self) and self.settings.get_safe("compiler.libcxx") == "libc++": - # special case, as gcc/g++ is hard-coded in makefile, it implicitly assumes -lstdc++ - tc.extra_ldflags.append("-stdlib=libc++") - - tc.configure_args.extend([ - "--disable-examples", - "--disable-unit-tests", - "--disable-tools", - "--disable-docs", - "--enable-vp9-highbitdepth", - "--as=yasm", - ]) - - # Note for MSVC: release libs are always built, we just avoid keeping the release lib - # Note2: Can't use --enable-debug_libs (to help install on Windows), - # the makefile's install step fails as it wants to install a library that doesn't exist. - # Instead, we will copy the desired library manually in the package step. - if self.settings.build_type == "Debug": - tc.configure_args.extend([ - # "--enable-debug_libs", - "--enable-debug", - ]) - - if is_msvc(self) and is_msvc_static_runtime(self): - tc.configure_args.append("--enable-static-msvcrt") - + @property + def _target_name(self): arch = {'x86': 'x86', 'x86_64': 'x86_64', 'armv7': 'armv7', + 'armv7s': 'armv7s', 'armv8': 'arm64', 'mips': 'mips32', 'mips64': 'mips64', 'sparc': 'sparc'}.get(str(self.settings.arch)) + compiler = str(self.settings.compiler) + os_name = str(self.settings.os) if str(self.settings.compiler) == "Visual Studio": vc_version = self.settings.compiler.version compiler = f"vs{vc_version}" elif is_msvc(self): vc_version = str(self.settings.compiler.version) - vc_version = {"170": "11", "180": "12", "190": "14", "191": "15", "192": "16", "193": "17"}[vc_version] + vc_version = {"170": "11", "180": "12", "190": "14", "191": "15", "192": "16", "193": "17", "194": "17"}[vc_version] compiler = f"vs{vc_version}" elif self.settings.compiler in ["gcc", "clang", "apple-clang"]: compiler = 'gcc' - host_os = str(self.settings.os) if host_os == 'Windows': os_name = 'win32' if self.settings.arch == 'x86' else 'win64' elif is_apple_os(self): if self.settings.arch in ["x86", "x86_64"]: - os_name = 'darwin11' - elif self.settings.arch == "armv8" and self.settings.os == "Macos": - os_name = 'darwin20' + if self.settings.os == "Macos": + os_name = f'darwin11' + else: + os_name = 'iphonesimulator' + elif self.settings.arch == "armv8": + os_name = 'darwin21' else: - # Unrecognized toolchain 'arm64-darwin11-gcc', see list of toolchains in ./configure --help os_name = 'darwin' elif host_os == 'Linux': os_name = 'linux' @@ -148,8 +129,35 @@ def generate(self): os_name = 'solaris' elif host_os == 'Android': os_name = 'android' - target = f"{arch}-{os_name}-{compiler}" - tc.configure_args.append(f"--target={target}") + return f"{arch}-{os_name}-{compiler}" + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + + if is_apple_os(self) and self.settings.get_safe("compiler.libcxx") == "libc++": + # special case, as gcc/g++ is hard-coded in makefile, it implicitly assumes -lstdc++ + tc.extra_ldflags.append("-stdlib=libc++") + + tc.configure_args.extend([ + "--disable-examples", + "--disable-unit-tests", + "--disable-tools", + "--disable-docs", + "--enable-vp9-highbitdepth", + "--as=yasm", + ]) + # Note for MSVC: release libs are always built, we just avoid keeping the release lib + # Note2: Can't use --enable-debug_libs (to help install on Windows), + # the makefile's install step fails as it wants to install a library that doesn't exist. + # Instead, we will copy the desired library manually in the package step. + if self.settings.build_type == "Debug": + tc.configure_args.extend([ + "--enable-debug" + ]) + if is_msvc(self) and is_msvc_static_runtime(self): + tc.configure_args.append("--enable-static-msvcrt") if str(self.settings.arch) in ["x86", "x86_64"]: for name in self._arch_options: if not self.options.get_safe(name): @@ -160,6 +168,8 @@ def generate(self): # must be a subfolder of prefix" libvpx src/build/make/configure.sh:683 "--prefix": f"/{self._install_tmp_folder}", "--libdir": f"/{self._install_tmp_folder}/lib", + # Needed to let libvpx use the correct toolchain for the target platform + "--target": self._target_name, # several options must not be injected as custom configure doesn't like them "--host": None, "--build": None, diff --git a/recipes/libvpx/all/patches/0001-extended-support-1.9.0.patch b/recipes/libvpx/all/patches/0001-extended-support-1.9.0.patch deleted file mode 100644 index 7e10a765c149c..0000000000000 --- a/recipes/libvpx/all/patches/0001-extended-support-1.9.0.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- a/build/make/gen_msvs_sln.sh -+++ b/build/make/gen_msvs_sln.sh -@@ -219,6 +219,7 @@ for opt in "$@"; do - 14) vs_year=2015 ;; - 15) vs_year=2017 ;; - 16) vs_year=2019 ;; -+ 17) vs_year=2022 ;; - *) die Unrecognized Visual Studio Version in $opt ;; - esac - ;; -@@ -232,7 +233,7 @@ done - outfile=${outfile:-/dev/stdout} - mkoutfile=${mkoutfile:-/dev/stdout} - case "${vs_ver}" in -- 1[4-6]) -+ 1[4-7]) - # VS has used Format Version 12.00 continuously since vs11. - sln_vers="12.00" - sln_vers_str="Visual Studio ${vs_year}" ---- a/build/make/gen_msvs_vcxproj.sh -+++ b/build/make/gen_msvs_vcxproj.sh -@@ -168,7 +168,7 @@ for opt in "$@"; do - --ver=*) - vs_ver="$optval" - case "$optval" in -- 1[4-6]) -+ 1[4-7]) - ;; - *) die Unrecognized Visual Studio Version in $opt - ;; -@@ -342,6 +342,9 @@ generate_vcxproj() { - if [ "$vs_ver" = "16" ]; then - tag_content PlatformToolset v142 - fi -+ if [ "$vs_ver" = "17" ]; then -+ tag_content PlatformToolset v143 -+ fi - tag_content CharacterSet Unicode - if [ "$config" = "Release" ]; then - tag_content WholeProgramOptimization true ---- a/configure -+++ b/configure -@@ -138,6 +138,7 @@ all_platforms="${all_platforms} x86-win32-gcc" - all_platforms="${all_platforms} x86-win32-vs14" - all_platforms="${all_platforms} x86-win32-vs15" - all_platforms="${all_platforms} x86-win32-vs16" -+all_platforms="${all_platforms} x86-win32-vs17" - all_platforms="${all_platforms} x86_64-android-gcc" - all_platforms="${all_platforms} x86_64-darwin9-gcc" - all_platforms="${all_platforms} x86_64-darwin10-gcc" -@@ -158,6 +159,7 @@ all_platforms="${all_platforms} x86_64-win64-gcc" - all_platforms="${all_platforms} x86_64-win64-vs14" - all_platforms="${all_platforms} x86_64-win64-vs15" - all_platforms="${all_platforms} x86_64-win64-vs16" -+all_platforms="${all_platforms} x86_64-win64-vs17" - all_platforms="${all_platforms} generic-gnu" - - # all_targets is a list of all targets that can be configured diff --git a/recipes/libvpx/all/patches/0002-msvc_conan_build.patch b/recipes/libvpx/all/patches/0002-msvc_conan_build.patch deleted file mode 100644 index 28885c1c83394..0000000000000 --- a/recipes/libvpx/all/patches/0002-msvc_conan_build.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/build/make/msvs_common.sh b/build/make/msvs_common.sh -index 27ddf7f..da462ec 100644 ---- a/build/make/msvs_common.sh -+++ b/build/make/msvs_common.sh -@@ -9,7 +9,7 @@ - ## be found in the AUTHORS file in the root of the source tree. - ## - --if [ "$(uname -o 2>/dev/null)" = "Cygwin" ] \ -+if [ "$(uname -o 2>/dev/null)" = "Cygwin" ] || [ "$(uname -o 2>/dev/null)" = "Msys" ]\ - && cygpath --help >/dev/null 2>&1; then - FIXPATH='cygpath -m' - else diff --git a/recipes/libvpx/all/test_package/CMakeLists.txt b/recipes/libvpx/all/test_package/CMakeLists.txt index 2cd854f46c254..951b20fa3464e 100644 --- a/recipes/libvpx/all/test_package/CMakeLists.txt +++ b/recipes/libvpx/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(libvpx REQUIRED CONFIG) diff --git a/recipes/libvpx/all/test_v1_package/CMakeLists.txt b/recipes/libvpx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2f6b1a2f7ec79..0000000000000 --- a/recipes/libvpx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/libvpx/all/test_v1_package/conanfile.py b/recipes/libvpx/all/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/libvpx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/libvpx/config.yml b/recipes/libvpx/config.yml index a39af33955838..33ef774be6ba3 100644 --- a/recipes/libvpx/config.yml +++ b/recipes/libvpx/config.yml @@ -1,9 +1,11 @@ versions: + "1.14.1": + folder: all + "1.14.0": + folder: all "1.13.1": folder: all "1.11.0": folder: all "1.10.0": folder: all - "1.9.0": - folder: all diff --git a/recipes/libwebm/all/conandata.yml b/recipes/libwebm/all/conandata.yml index 18c5b099c2c71..db15e75e26a4f 100644 --- a/recipes/libwebm/all/conandata.yml +++ b/recipes/libwebm/all/conandata.yml @@ -1,5 +1,7 @@ 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' + "1.0.0.31": + url: "https://github.com/webmproject/libwebm/archive/refs/tags/libwebm-1.0.0.31.tar.gz" + sha256: "616cfdca1c869222dc60d5a49d112c1464040390e3876afca4d385347c6ce55e" + "1.0.0.30": + url: "https://github.com/webmproject/libwebm/archive/refs/tags/libwebm-1.0.0.30.tar.gz" + sha256: "6c1381fd1a66e86e095b76028ede696724e198ea0e39957c9649af5f0718b96a" diff --git a/recipes/libwebm/all/conanfile.py b/recipes/libwebm/all/conanfile.py index 7d2ceec33ba43..e295fe0e53c02 100644 --- a/recipes/libwebm/all/conanfile.py +++ b/recipes/libwebm/all/conanfile.py @@ -42,7 +42,7 @@ def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version]) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -67,6 +67,7 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "webm::webm") self.cpp_info.set_property("pkg_config_name", "webm") self.cpp_info.libs = ["webm"] + self.cpp_info.includedirs.append("include/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 index 4a896b2300ca0..476aa33240717 100644 --- a/recipes/libwebm/all/test_package/CMakeLists.txt +++ b/recipes/libwebm/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(webm REQUIRED CONFIG) diff --git a/recipes/libwebm/config.yml b/recipes/libwebm/config.yml index 71746ecdc81bd..c6c0e669617aa 100644 --- a/recipes/libwebm/config.yml +++ b/recipes/libwebm/config.yml @@ -1,5 +1,5 @@ versions: - '1.0.0.31': + "1.0.0.31": folder: all - '1.0.0.30': + "1.0.0.30": folder: all diff --git a/recipes/libwebp/all/conandata.yml b/recipes/libwebp/all/conandata.yml index 0aaa6446c5482..68f07a22fd3e7 100644 --- a/recipes/libwebp/all/conandata.yml +++ b/recipes/libwebp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.5.0": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.5.0.tar.gz" + sha256: "7d6fab70cf844bf6769077bd5d7a74893f8ffd4dfb42861745750c63c2a5c92c" + "1.4.0": + url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.4.0.tar.gz" + sha256: "61f873ec69e3be1b99535634340d5bde750b2e4447caa1db9f61be3fd49ab1e5" "1.3.2": url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.2.tar.gz" sha256: "2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562aa09b4" @@ -12,6 +18,14 @@ sources: url: "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.1.0.tar.gz" sha256: "98a052268cc4d5ece27f76572a7f50293f439c17a98e67c4ea0c7ed6f50ef043" patches: + "1.5.0": + - patch_file: "patches/1.5.0-0001-fix-cmake.patch" + patch_description: "disable PIC, disable prefix library name on MSVC" + patch_type: "conan" + "1.4.0": + - patch_file: "patches/1.4.0-0001-fix-cmake.patch" + patch_description: "disable PIC, disable prefix library name on MSVC" + patch_type: "conan" "1.3.2": - patch_file: "patches/1.3.1-0001-fix-cmake.patch" patch_description: "disable PIC, disable prefix library name on MSVC" diff --git a/recipes/libwebp/all/conanfile.py b/recipes/libwebp/all/conanfile.py index 5e7c1354176a4..efb54739a564c 100644 --- a/recipes/libwebp/all/conanfile.py +++ b/recipes/libwebp/all/conanfile.py @@ -101,6 +101,8 @@ def package_info(self): self.cpp_info.components["webpdecoder"].libs = ["webpdecoder"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["webpdecoder"].system_libs = ["m", "pthread"] + if self.settings.os == "Android": + self.cpp_info.components["webpdecoder"].system_libs = ["m"] # webp self.cpp_info.components["webp"].set_property("cmake_target_name", "WebP::webp") @@ -108,6 +110,8 @@ def package_info(self): self.cpp_info.components["webp"].libs = ["webp"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["webp"].system_libs = ["m", "pthread"] + if self.settings.os == "Android": + self.cpp_info.components["webp"].system_libs = ["m"] if Version(self.version) >= "1.3.0": # sharpyuv @@ -116,6 +120,8 @@ def package_info(self): self.cpp_info.components["sharpyuv"].libs = ["sharpyuv"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["sharpyuv"].system_libs = ["m", "pthread"] + if self.settings.os == "Android": + self.cpp_info.components["sharpyuv"].system_libs = ["m"] # note: webp now depends on sharpyuv self.cpp_info.components["webp"].requires = ["sharpyuv"] @@ -130,7 +136,7 @@ def package_info(self): self.cpp_info.components["webpmux"].set_property("pkg_config_name", "libwebpmux") self.cpp_info.components["webpmux"].libs = ["webpmux"] self.cpp_info.components["webpmux"].requires = ["webp"] - if self.settings.os in ["Linux", "FreeBSD"]: + if self.settings.os in ["Linux", "FreeBSD", "Android"]: self.cpp_info.components["webpmux"].system_libs = ["m"] # TODO: to remove in conan v2 once cmake_find_package_* generators removed diff --git a/recipes/libwebp/all/patches/1.4.0-0001-fix-cmake.patch b/recipes/libwebp/all/patches/1.4.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..f819b1e43d235 --- /dev/null +++ b/recipes/libwebp/all/patches/1.4.0-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 +@@ -60,7 +60,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) +@@ -155,7 +154,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.5.0-0001-fix-cmake.patch b/recipes/libwebp/all/patches/1.5.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..eb71cdf04537a --- /dev/null +++ b/recipes/libwebp/all/patches/1.5.0-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 +@@ -61,7 +61,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) +@@ -156,7 +155,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/test_package/CMakeLists.txt b/recipes/libwebp/all/test_package/CMakeLists.txt index 5c4f1c676a652..de73bd623f8b3 100644 --- a/recipes/libwebp/all/test_package/CMakeLists.txt +++ b/recipes/libwebp/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(WebP REQUIRED CONFIG) diff --git a/recipes/libwebp/all/test_v1_package/CMakeLists.txt b/recipes/libwebp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libwebp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libwebp/all/test_v1_package/conanfile.py b/recipes/libwebp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libwebp/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_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/libwebp/config.yml b/recipes/libwebp/config.yml index e184761fe568e..e9abd99b83f39 100644 --- a/recipes/libwebp/config.yml +++ b/recipes/libwebp/config.yml @@ -1,4 +1,8 @@ versions: + "1.5.0": + folder: all + "1.4.0": + folder: all "1.3.2": folder: all "1.3.1": diff --git a/recipes/libwebsockets/all/conandata.yml b/recipes/libwebsockets/all/conandata.yml index 119725ef837be..8032d01c8d8b8 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" @@ -11,12 +14,3 @@ sources: "4.2.0": url: "https://github.com/warmcat/libwebsockets/archive/v4.2.0.tar.gz" sha256: "a57e9a4765dbcd4d880feba8089b43ed69995eaf10d5d61a07981d9ddd975f40" - "4.1.6": - url: "https://github.com/warmcat/libwebsockets/archive/v4.1.6.tar.gz" - sha256: "402e9a8df553c9cd2aff5d7a9758e9e5285bf3070c82539082864633db3deb83" - "4.1.4": - url: "https://github.com/warmcat/libwebsockets/archive/v4.1.4.tar.gz" - sha256: "00da77b4b89db3e0b1a2778f756f08d55d7f6b1632e18d981fc399c412866147" - "4.0.15": - url: "https://github.com/warmcat/libwebsockets/archive/v4.0.15.tar.gz" - sha256: "adce8152c3e802b8fe71b26d7252944944c49954ba6b5ba9fbb7fa5c4aad93dc" diff --git a/recipes/libwebsockets/all/conanfile.py b/recipes/libwebsockets/all/conanfile.py index 0fd0cf66a67ea..d085801e1d1fd 100644 --- a/recipes/libwebsockets/all/conanfile.py +++ b/recipes/libwebsockets/all/conanfile.py @@ -2,12 +2,12 @@ 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.microsoft import check_min_vs, is_msvc from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.56.0" +required_conan_version = ">=2.1" class LibwebsocketsConan(ConanFile): @@ -16,7 +16,7 @@ class LibwebsocketsConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/warmcat/libwebsockets" license = "MIT" - topics = ("websocket") + topics = ("websocket",) package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -30,6 +30,7 @@ class LibwebsocketsConan(ConanFile): "with_sqlite3": [True, False], "with_libmount": [True, False], "with_hubbub": [True, False], + "with_netlink": [True, False], "ssl_client_use_os_ca_certs": [True, False], # SSL support should make use of the OS-installed CA root certs "ssl_server_with_ecdh_cert": [True, False], # Include SSL server use ECDH certificate @@ -114,6 +115,7 @@ class LibwebsocketsConan(ConanFile): "with_sqlite3": False, "with_libmount": False, "with_hubbub": False, + "with_netlink": False, "ssl_client_use_os_ca_certs": True, "ssl_server_with_ecdh_cert": False, @@ -224,8 +226,7 @@ def requirements(self): self.requires("sqlite3/3.44.2") if self.options.with_ssl == "openssl": - # Cannot add the [>=1.1 <4] range, as it seems openssl3 makes it fail - self.requires("openssl/1.1.1w", transitive_headers=True) + self.requires("openssl/[>=1.1.1w <4]", transitive_headers=True) elif self.options.with_ssl == "mbedtls": self.requires("mbedtls/3.5.0") elif self.options.with_ssl == "wolfssl": @@ -235,12 +236,8 @@ def validate(self): 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 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 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)) + check_min_vs(self, "192") if self.options.with_hubbub: raise ConanInvalidConfiguration("Library hubbub not implemented (yet) in CCI") @@ -295,11 +292,16 @@ def generate(self): 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) + tc.variables["LWS_WITH_NETLINK"] = self.options.with_netlink + + # Allow forwarding project targets to try_compile and derivatives + tc.variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = self.settings.build_type if self.options.with_ssl == "openssl": - 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": + # Ensure find_package(OpenSSL) is called early + tc.variables["CMAKE_PROJECT_libwebsockets_INCLUDE"] = os.path.join(self.source_folder, "project_include.cmake").replace('\\','/') + + if self.options.with_ssl == "mbedtls": 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) @@ -417,10 +419,10 @@ def generate(self): 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.variables["LWS_WITH_SYS_SMD"] = self.settings.os != "Windows" + tc.variables["DISABLE_WERROR"] = True + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) deps.generate() @@ -432,16 +434,18 @@ def _patch_sources(self): "SET(CMAKE_INSTALL_NAME_DIR \"${CMAKE_INSTALL_PREFIX}/${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}\")", "", ) - if Version(self.version) == "4.0.15" and self.options.with_ssl: - replace_in_file(self, - 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 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)") + + # Early call to find_package(OpenSSL) because its referenced in different places + if self.options.with_ssl == "openssl": + project_include_file = os.path.join(self.source_folder, "project_include.cmake") + save(self, project_include_file, 'find_package(OpenSSL REQUIRED)\nset(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})') + + # Prevent locating and copying OpenSSL binaries (not needed by the recipe) + replace_in_file(self, + os.path.join(self.source_folder, "cmake", "FindOpenSSLbins.cmake"), + "if(OPENSSL_FOUND)", "if(FALSE)") + + replace_in_file(self, cmakelists, "add_compile_options(/W3 /WX)", "add_compile_options(/W3)") def build(self): self._patch_sources() @@ -495,14 +499,6 @@ def package_info(self): elif self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_libwebsockets"].system_libs.extend(["dl", "m"]) - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "Libwebsockets" - self.cpp_info.names["cmake_find_package_multi"] = "Libwebsockets" - self.cpp_info.names["pkg_config"] = pkgconfig_name - self.cpp_info.components["_libwebsockets"].names["cmake_find_package"] = self._cmake_target - self.cpp_info.components["_libwebsockets"].names["cmake_find_package_multi"] = self._cmake_target - self.cpp_info.components["_libwebsockets"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["_libwebsockets"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] self.cpp_info.components["_libwebsockets"].builddirs.append(os.path.join("lib", "cmake")) self.cpp_info.components["_libwebsockets"].set_property("cmake_target_name", self._cmake_target) self.cpp_info.components["_libwebsockets"].set_property("pkg_config_name", pkgconfig_name) diff --git a/recipes/libwebsockets/all/test_package/CMakeLists.txt b/recipes/libwebsockets/all/test_package/CMakeLists.txt index 6aa87cfd3d013..9d07a1795d3e4 100644 --- a/recipes/libwebsockets/all/test_package/CMakeLists.txt +++ b/recipes/libwebsockets/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(Libwebsockets REQUIRED CONFIG) diff --git a/recipes/libwebsockets/all/test_package/test_package.c b/recipes/libwebsockets/all/test_package/test_package.c index e09bc89a8abe9..a76a8da0d85c5 100644 --- a/recipes/libwebsockets/all/test_package/test_package.c +++ b/recipes/libwebsockets/all/test_package/test_package.c @@ -4,89 +4,8 @@ #include "libwebsockets.h" -static struct lws *web_socket = NULL; - -#define EXAMPLE_RX_BUFFER_BYTES (10) - -static int callback_example( struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len ) -{ - switch( reason ) - { - case LWS_CALLBACK_CLIENT_ESTABLISHED: - lws_callback_on_writable( wsi ); - break; - - case LWS_CALLBACK_CLIENT_RECEIVE: - /* Handle incomming messages here. */ - break; - - case LWS_CALLBACK_CLIENT_WRITEABLE: - { - unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + EXAMPLE_RX_BUFFER_BYTES + LWS_SEND_BUFFER_POST_PADDING]; - unsigned char *p = &buf[LWS_SEND_BUFFER_PRE_PADDING]; - size_t n = sprintf( (char *)p, "%u", rand() ); - lws_write( wsi, p, n, LWS_WRITE_TEXT ); - break; - } - - case LWS_CALLBACK_CLOSED: - case LWS_CALLBACK_CLIENT_CONNECTION_ERROR: - web_socket = NULL; - break; - - default: - break; - } - - return 0; -} - -enum protocols -{ - PROTOCOL_EXAMPLE = 0, - PROTOCOL_COUNT -}; - -static struct lws_protocols protocols[] = -{ - { - "example-protocol", - callback_example, - 0, - EXAMPLE_RX_BUFFER_BYTES, - }, - { NULL, NULL, 0, 0 } /* terminator */ -}; - -int main( int argc, char *argv[] ) -{ - struct lws_context_creation_info info; - memset( &info, 0, sizeof(info) ); - - info.port = CONTEXT_PORT_NO_LISTEN; - info.protocols = protocols; - info.gid = -1; - info.uid = -1; - - struct lws_context *context = lws_create_context( &info ); - - /* Connect if we are not connected to the server. */ - struct lws_client_connect_info ccinfo = {0}; - ccinfo.context = context; - ccinfo.address = "localhost"; - ccinfo.port = 8000; - ccinfo.path = "/"; - ccinfo.host = lws_canonical_hostname( context ); - ccinfo.origin = "origin"; - ccinfo.protocol = protocols[PROTOCOL_EXAMPLE].name; - web_socket = lws_client_connect_via_info(&ccinfo); - - /* Send a random number to the server every second. */ - lws_callback_on_writable( web_socket ); - - lws_service( context, /* timeout_ms = */ 250 ); - - lws_context_destroy( context ); - +int main() { + const char* lws_version = lws_get_library_version(); + printf("libwebsocket version: %s\n", lws_version); return 0; } diff --git a/recipes/libwebsockets/config.yml b/recipes/libwebsockets/config.yml index 76fbd6a7ba025..35cfe962e4082 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": @@ -7,9 +9,3 @@ versions: folder: all "4.2.0": folder: all - "4.1.6": - folder: all - "4.1.4": - folder: all - "4.0.15": - folder: all diff --git a/recipes/libx264/all/conandata.yml b/recipes/libx264/all/conandata.yml index 394a54354a73d..f92af6ff75c03 100644 --- a/recipes/libx264/all/conandata.yml +++ b/recipes/libx264/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20240224": + url: "https://code.videolan.org/videolan/x264/-/archive/7241d020118bb09cc0ad119d7bc9f630a1caad10/x264-7241d020118bb09cc0ad119d7bc9f630a1caad10.tar.bz2" + sha256: "5417c167a69cc19db044c227163f9b9b1dface9fca361a3e83d5417f8e304dd6" "cci.20220602": url: "https://code.videolan.org/videolan/x264/-/archive/baee400fa9ced6f5481a728138fed6e867b0ff7f/x264-baee400fa9ced6f5481a728138fed6e867b0ff7f.tar.bz2" sha256: "ce6623b8b289765daee04a297c2fd1a293cb2565a1749c76d66c8d72c7ddc1ab" diff --git a/recipes/libx264/all/conanfile.py b/recipes/libx264/all/conanfile.py index 3312e7972a7a4..27e1c5a53e9cc 100644 --- a/recipes/libx264/all/conanfile.py +++ b/recipes/libx264/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.files import copy, rename, get, 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.microsoft import is_msvc, unix_path import os required_conan_version = ">=1.57.0" @@ -25,20 +25,18 @@ class LibX264Conan(ConanFile): "shared": [True, False], "fPIC": [True, False], "bit_depth": [8, 10, "all"], + "with_opencl": [True, False], + "with_asm": [True, False] } + # The project by default enables opencl and asm, it can be opted-out default_options = { "shared": False, "fPIC": True, "bit_depth": "all", + "with_opencl": True, + "with_asm": True } - # otherwise build fails with: ln: failed to create symbolic link './Makefile' -> '../../../../../../../../../../../../../j/w/prod/buildsinglereference@2/.conan/data/libx264/cci.20220602/_/_/build/622692a7dbc145becf87f01b017e2a0d93cc644e/src/Makefile': File name too long - short_paths = 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 @@ -59,7 +57,7 @@ def layout(self): def build_requirements(self): if self._with_nasm: self.tool_requires("nasm/2.15.05") - if self._settings_build.os == "Windows": + 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") @@ -68,9 +66,6 @@ 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) extra_asflags = [] @@ -87,6 +82,10 @@ def generate(self): args["--enable-shared"] = "" else: args["--enable-static"] = "" + if not self.options.with_opencl: + args["--disable-opencl"] = "" + if not self.options.with_asm: + args["--disable-asm"] = "" if self.options.get_safe("fPIC", self.settings.os != "Windows"): args["--enable-pic"] = "" if self.settings.build_type == "Debug": @@ -109,37 +108,13 @@ def generate(self): if self._with_nasm: env = Environment() - # 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 - env = Environment() - - compilers_from_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) - buildenv_vars = VirtualBuildEnv(self).vars() - cc = compilers_from_conf.get("c", buildenv_vars.get("CC", "clang-cl")) - env.define("AS", cc) - - ndk_root = self.conf.get("tools.android:ndk_path") - - arch = { - "armv7": "arm", - "armv8": "aarch64", - "x86": "i686", - "x86_64": "x86_64", - }.get(str(self.settings.arch)) - 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"]: @@ -185,6 +160,3 @@ def package_info(self): self.cpp_info.system_libs.extend(["dl", "pthread", "m"]) elif self.settings.os == "Android": self.cpp_info.system_libs.extend(["dl", "m"]) - - # TODO: to remove in conan v2 once pkg_config generator removed - self.cpp_info.names["pkg_config"] = "x264" diff --git a/recipes/libx264/all/test_package/CMakeLists.txt b/recipes/libx264/all/test_package/CMakeLists.txt index 9ef0da2dea968..2aa54d3092be5 100644 --- a/recipes/libx264/all/test_package/CMakeLists.txt +++ b/recipes/libx264/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(libx264 REQUIRED CONFIG) diff --git a/recipes/libx264/all/test_v1_package/CMakeLists.txt b/recipes/libx264/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index dbc8e1774b07c..0000000000000 --- a/recipes/libx264/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libx264 REQUIRED CONFIG) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libx264/all/test_v1_package/conanfile.py b/recipes/libx264/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libx264/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libx264/config.yml b/recipes/libx264/config.yml index be7607c4d1266..cce887c4b4859 100644 --- a/recipes/libx264/config.yml +++ b/recipes/libx264/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20240224": + folder: all "cci.20220602": folder: all "20191217": diff --git a/recipes/libx265/all/conandata.yml b/recipes/libx265/all/conandata.yml index c3b14b8a74194..6709cd25acfcb 100644 --- a/recipes/libx265/all/conandata.yml +++ b/recipes/libx265/all/conandata.yml @@ -8,7 +8,7 @@ sources: patches: "3.4": - patch_file: "patches/3.2.1-0001-remove_register_classifier.patch" - - patch_file: "patches/3.2.1-0002-cmake-min-required.patch" + - patch_file: "patches/3.4-0002-cmake-min-required.patch" - patch_file: "patches/3.4-0001-numa.patch" "3.2.1": - patch_file: "patches/3.2.1-0001-remove_register_classifier.patch" diff --git a/recipes/libx265/all/conanfile.py b/recipes/libx265/all/conanfile.py index 677f51dce82b0..67ff17745d897 100644 --- a/recipes/libx265/all/conanfile.py +++ b/recipes/libx265/all/conanfile.py @@ -1,13 +1,15 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os from conan.tools.build import cross_building, stdcpp_library 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, rename, rm, 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" +required_conan_version = ">=2.1" class Libx265Conan(ConanFile): @@ -49,7 +51,8 @@ def config_options(self): del self.options.with_numa # FIXME: Disable assembly by default if host is arm and compiler apple-clang for the moment. # Indeed, apple-clang is not able to understand some asm instructions of libx265 - if self.settings.compiler == "apple-clang" and "arm" in self.settings.arch: + # FIXME: Disable assembly by default if host is Android for the moment. It fails to build + if (self.settings.compiler == "apple-clang" and "arm" in self.settings.arch) or self.settings.os == "Android": self.options.assembly = False def configure(self): @@ -63,10 +66,27 @@ def requirements(self): if self.options.get_safe("with_numa", False): self.requires("libnuma/2.0.14") + def validate_build(self): + if cross_building(self) and self.settings.os == "Android" and self.options.assembly: + # FIXME: x265 uses custom command to invoke clang to compile assembly files. + # clang++ -fPIC -c src/source/common/aarch64/mc-a.S -o mc-a.S.o + # FAILED: mc-a.S.o libx2f309356bd8526/b/build/Release/mc-a.S.o + # clang++ -fPIC -c src/source/common/aarch64/mc-a.S -o mc-a.S.o + # :11:9: error: unknown directive + # .func x265_pixel_avg_pp_4x4_neon + raise ConanInvalidConfiguration(f"{self.ref} fails to build with '&:assembly=True' for Android. Contributions are welcome.") + def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("shared not supported with static runtime") + if self.settings.compiler == "apple-clang" and "arm" in self.settings.arch and self.options.assembly: + # Undefined symbols for architecture arm64: + # "x265::setupAssemblyPrimitives(x265::EncoderPrimitives&, int)", referenced from: + # x265::x265_setup_primitives(x265_param*) in libx265.a[20](primitives.cpp.o) + # ld: symbol(s) not found for architecture arm64 + raise ConanInvalidConfiguration(f"{self.ref} fails to build for Mac M1. Contributions are welcome.") + def build_requirements(self): if self.options.assembly: if self.settings.arch in ["x86", "x86_64"]: @@ -91,6 +111,7 @@ def generate(self): tc.variables["ENABLE_SVT_HEVC"] = self.options.SVG_HEVC_encoder if is_msvc(self): tc.variables["STATIC_LINK_CRT"] = is_msvc_static_runtime(self) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" if self.settings.os == "Linux": tc.variables["PLATFORM_LIBS"] = "dl" if "arm" in self.settings.arch: @@ -154,7 +175,10 @@ def package_info(self): if not self.options.shared: self.cpp_info.sharedlinkflags = ["-Wl,-Bsymbolic,-znoexecstack"] elif self.settings.os == "Android": - self.cpp_info.libs.extend(["dl", "m"]) - libcxx = stdcpp_library(self) - if libcxx: - self.cpp_info.system_libs.append(libcxx) + self.cpp_info.system_libs.extend(["dl", "m"]) + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + if self.settings.os == "Android" and self.settings.compiler.libcxx == "c++_static": + self.cpp_info.system_libs.append("c++abi") + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/libx265/all/patches/3.2.1-0002-cmake-min-required.patch b/recipes/libx265/all/patches/3.2.1-0002-cmake-min-required.patch index 93f9560bd7156..49c62d595a62f 100644 --- a/recipes/libx265/all/patches/3.2.1-0002-cmake-min-required.patch +++ b/recipes/libx265/all/patches/3.2.1-0002-cmake-min-required.patch @@ -1,6 +1,6 @@ --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt -@@ -1,10 +1,4 @@ +@@ -1,23 +1,7 @@ -# vim: syntax=cmake -if(NOT CMAKE_BUILD_TYPE) - # default to Release build for GCC builds @@ -8,15 +8,29 @@ - "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." - FORCE) -endif() -+cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.5) message(STATUS "cmake version ${CMAKE_VERSION}") - if(POLICY CMP0025) - cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang -@@ -17,7 +11,6 @@ if(POLICY CMP0054) - endif() +-if(POLICY CMP0025) +- cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang +-endif() +-if(POLICY CMP0042) +- cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH +-endif() +-if(POLICY CMP0054) +- cmake_policy(SET CMP0054 OLD) # Only interpret if() arguments as variables or keywords when unquoted +-endif() project (x265) -cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8 include(CheckIncludeFiles) include(CheckFunctionExists) include(CheckSymbolExists) +@@ -130,7 +114,7 @@ if(APPLE) + add_definitions(-DMACOS=1) + endif() + +-if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") ++if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + set(CLANG 1) + endif() + if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") diff --git a/recipes/libx265/all/patches/3.4-0001-numa.patch b/recipes/libx265/all/patches/3.4-0001-numa.patch index 789c574f674fc..29e8151500d78 100644 --- a/recipes/libx265/all/patches/3.4-0001-numa.patch +++ b/recipes/libx265/all/patches/3.4-0001-numa.patch @@ -1,6 +1,6 @@ --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt -@@ -90,20 +90,10 @@ if(UNIX) +@@ -88,20 +88,10 @@ if(UNIX) endif() option(ENABLE_LIBNUMA "Enable libnuma usage (Linux only)" ON) if(ENABLE_LIBNUMA) diff --git a/recipes/libx265/all/patches/3.4-0002-cmake-min-required.patch b/recipes/libx265/all/patches/3.4-0002-cmake-min-required.patch new file mode 100644 index 0000000000000..8dc9671d6d9d0 --- /dev/null +++ b/recipes/libx265/all/patches/3.4-0002-cmake-min-required.patch @@ -0,0 +1,36 @@ +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -1,4 +1,5 @@ + # vim: syntax=cmake ++cmake_minimum_required (VERSION 3.5) # OBJECT libraries require 2.8.8 + if(NOT CMAKE_BUILD_TYPE) + # default to Release build for GCC builds + set(CMAKE_BUILD_TYPE Release CACHE STRING +@@ -6,18 +7,8 @@ if(NOT CMAKE_BUILD_TYPE) + FORCE) + endif() + message(STATUS "cmake version ${CMAKE_VERSION}") +-if(POLICY CMP0025) +- cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang +-endif() +-if(POLICY CMP0042) +- cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH +-endif() +-if(POLICY CMP0054) +- cmake_policy(SET CMP0054 OLD) # Only interpret if() arguments as variables or keywords when unquoted +-endif() + + project (x265) +-cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8 + include(CheckIncludeFiles) + include(CheckFunctionExists) + include(CheckSymbolExists) +@@ -138,7 +129,7 @@ if(APPLE) + add_definitions(-DMACOS=1) + endif() + +-if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") ++if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + set(CLANG 1) + endif() + if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") diff --git a/recipes/libx265/all/test_package/CMakeLists.txt b/recipes/libx265/all/test_package/CMakeLists.txt index b8fa451c9e6c3..17df62185281c 100644 --- a/recipes/libx265/all/test_package/CMakeLists.txt +++ b/recipes/libx265/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(libx265 REQUIRED CONFIG) diff --git a/recipes/libx265/all/test_v1_package/CMakeLists.txt b/recipes/libx265/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libx265/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libx265/all/test_v1_package/conanfile.py b/recipes/libx265/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libx265/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_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/libxcrypt/all/test_package/CMakeLists.txt b/recipes/libxcrypt/all/test_package/CMakeLists.txt index af52be8acede9..e661601ea44c5 100644 --- a/recipes/libxcrypt/all/test_package/CMakeLists.txt +++ b/recipes/libxcrypt/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(libxcrypt REQUIRED CONFIG) diff --git a/recipes/libxcrypt/all/test_v1_package/CMakeLists.txt b/recipes/libxcrypt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libxcrypt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libxcrypt/all/test_v1_package/conanfile.py b/recipes/libxcrypt/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libxcrypt/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_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/all/conanfile.py b/recipes/libxft/all/conanfile.py index fdb9b1a6c8663..1fef477064c1e 100644 --- a/recipes/libxft/all/conanfile.py +++ b/recipes/libxft/all/conanfile.py @@ -46,12 +46,12 @@ def layout(self): def requirements(self): self.requires("xorg/system") self.requires("freetype/2.13.2", transitive_headers=True) - self.requires("fontconfig/2.14.2", transitive_headers=True) + self.requires("fontconfig/2.15.0", 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") - self.tool_requires("xorg-macros/1.19.3") + self.tool_requires("pkgconf/2.1.0") + self.tool_requires("xorg-macros/1.20.0") self.tool_requires("libtool/2.4.7") def source(self): diff --git a/recipes/libxft/all/test_v1_package/CMakeLists.txt b/recipes/libxft/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libxft/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/libxft/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", "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/libxls/all/conandata.yml b/recipes/libxls/all/conandata.yml index 73215812f5900..2b6407f537b5c 100644 --- a/recipes/libxls/all/conandata.yml +++ b/recipes/libxls/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.3": + url: "https://github.com/libxls/libxls/releases/download/v1.6.3/libxls-1.6.3.tar.gz" + sha256: "b2fb836ea0b5253a352fb5ca55742e29f06f94f9421c5b8eeccef2e5d43f622c" "1.6.2": url: "https://github.com/libxls/libxls/releases/download/v1.6.2/libxls-1.6.2.tar.gz" sha256: "5dacc34d94bf2115926c80c6fb69e4e7bd2ed6403d51cff49041a94172f5e371" diff --git a/recipes/libxls/all/test_package/CMakeLists.txt b/recipes/libxls/all/test_package/CMakeLists.txt index a4b50bc78de77..1c4bb35bcf8ac 100644 --- a/recipes/libxls/all/test_package/CMakeLists.txt +++ b/recipes/libxls/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(libxls REQUIRED CONFIG) diff --git a/recipes/libxls/all/test_v1_package/CMakeLists.txt b/recipes/libxls/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libxls/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libxls/all/test_v1_package/conanfile.py b/recipes/libxls/all/test_v1_package/conanfile.py deleted file mode 100644 index a500b98343c74..0000000000000 --- a/recipes/libxls/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/libxls/config.yml b/recipes/libxls/config.yml index 9b1f6cb9f3642..6307cdfa96385 100644 --- a/recipes/libxls/config.yml +++ b/recipes/libxls/config.yml @@ -1,3 +1,5 @@ versions: + "1.6.3": + folder: "all" "1.6.2": folder: "all" diff --git a/recipes/libxlsxwriter/all/conandata.yml b/recipes/libxlsxwriter/all/conandata.yml index 44eb2bad3dada..d07afa674b7a3 100644 --- a/recipes/libxlsxwriter/all/conandata.yml +++ b/recipes/libxlsxwriter/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.2.2": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/v1.2.2.tar.gz" + sha256: "8ab0aced8a6e82f12f567b48d2cb3ca7b925893126607a619666da467e9ac14f" + "1.1.9": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/v1.1.9.tar.gz" + sha256: "03ae330d50f74c8a70be0b06b52bd50868f7cd1251ed040fe3b68d1ad6fd11dc" + "1.1.8": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/v1.1.8.tar.gz" + sha256: "122c98353e5b69284a1cd782be7ae67bdefde2146f8197ef89a1aaf886058e86" + "1.1.7": + url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.7.tar.gz" + sha256: "1f378e25d8bb5be258d3e04d3d24b8c23ff21bf206e6e206661844a96ca25eda" "1.1.5": url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.1.5.tar.gz" sha256: "12843587d591cf679e6ec63ecc629245befec2951736804a837696cdb5d61946" @@ -12,6 +24,22 @@ sources: url: "https://github.com/jmcnamara/libxlsxwriter/archive/RELEASE_1.0.0.tar.gz" sha256: "8b353379333c323d14a9d265cd2491d3a6c0032c8d6ec2141f10b82ab66a087c" patches: + "1.2.2": + - patch_file: "patches/1.2.2-0001-fix-cmake.patch" + patch_description: "Fix CMake: disable pkgconfig & avoid some hardcoded flags" + patch_type: "conan" + "1.1.9": + - patch_file: "patches/1.1.9-0001-fix-cmake.patch" + patch_description: "Fix CMake: disable pkgconfig & avoid some hardcoded flags" + patch_type: "conan" + "1.1.8": + - patch_file: "patches/1.1.7-0001-fix-cmake.patch" + patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" + patch_type: "conan" + "1.1.7": + - patch_file: "patches/1.1.7-0001-fix-cmake.patch" + patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" + patch_type: "conan" "1.1.5": - patch_file: "patches/1.1.5-0001-fix-cmake.patch" patch_description: "Fix CMake: robust dependencies discovery & avoid some hardcoded flags" diff --git a/recipes/libxlsxwriter/all/conanfile.py b/recipes/libxlsxwriter/all/conanfile.py index 1c65ddbb9e247..dbc54de468c48 100644 --- a/recipes/libxlsxwriter/all/conanfile.py +++ b/recipes/libxlsxwriter/all/conanfile.py @@ -11,11 +11,11 @@ class LibxlsxwriterConan(ConanFile): name = "libxlsxwriter" + description = "A C library for creating Excel XLSX files" license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jmcnamara/libxlsxwriter" topics = ("excel", "xlsx") - description = "A C library for creating Excel XLSX files" package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -64,9 +64,12 @@ def validate(self): if Version(self.version) < "1.0.6" and self.info.options.md5 == "openssl": raise ConanInvalidConfiguration(f"{self.name}:md5=openssl is not suppported in {self.ref}") + def build_requirements(self): + if Version(self.version) >= "1.2.1": + 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 generate(self): tc = CMakeToolchain(self) @@ -83,6 +86,8 @@ def generate(self): tc.variables["USE_STATIC_MSVC_RUNTIME"] = is_msvc_static_runtime(self) tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "1.1.9": + deps.set_property("minizip", "cmake_additional_variables_prefixes", ["MINIZIP"]) deps.generate() def build(self): diff --git a/recipes/libxlsxwriter/all/patches/1.1.7-0001-fix-cmake.patch b/recipes/libxlsxwriter/all/patches/1.1.7-0001-fix-cmake.patch new file mode 100644 index 0000000000000..715f102673099 --- /dev/null +++ b/recipes/libxlsxwriter/all/patches/1.1.7-0001-fix-cmake.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0e855c7..f38f37a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -183,9 +183,9 @@ endif() + + if(NOT BUILD_SHARED_LIBS) + if(UNIX) +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + elseif(MINGW OR MSYS) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -static-libgcc -Wno-char-subscripts -Wno-long-long") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-char-subscripts -Wno-long-long") + list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_FILE32API) + elseif(MSVC) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\"") +@@ -224,7 +224,7 @@ enable_language(CXX) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + + # ZLIB +-find_package(ZLIB "1.0" REQUIRED) ++find_package(ZLIB REQUIRED CONFIG) + list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + message("zlib version: " ${ZLIB_VERSION}) + +@@ -294,9 +294,11 @@ target_sources(${PROJECT_NAME} + PRIVATE ${LXW_SOURCES} + PUBLIC ${LXW_HEADERS} + ) +-target_link_libraries(${PROJECT_NAME} LINK_PUBLIC ${ZLIB_LIBRARIES} ${MINIZIP_LIBRARIES} ${LIB_CRYPTO} ${OPENSSL_CRYPTO_LIBRARY}) ++target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB minizip::minizip) ++if(USE_OPENSSL_MD5) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::Crypto) ++endif() + target_compile_definitions(${PROJECT_NAME} PRIVATE ${LXW_PRIVATE_COMPILE_DEFINITIONS}) +- + # /utf-8 needs VS2015 Update 2 or above. + # In CMake 3.7 and above, we can use (MSVC_VERSION GREATER_EQUAL 1900) here. + if(MSVC AND NOT (MSVC_VERSION LESS 1900)) diff --git a/recipes/libxlsxwriter/all/patches/1.1.9-0001-fix-cmake.patch b/recipes/libxlsxwriter/all/patches/1.1.9-0001-fix-cmake.patch new file mode 100644 index 0000000000000..629e8a20aa61d --- /dev/null +++ b/recipes/libxlsxwriter/all/patches/1.1.9-0001-fix-cmake.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e444dcc..44a638d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -183,9 +183,9 @@ endif() + + if(NOT BUILD_SHARED_LIBS) + if(UNIX) +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + elseif(MINGW OR MSYS) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -static-libgcc -Wno-char-subscripts -Wno-long-long") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-char-subscripts -Wno-long-long") + list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_FILE32API) + elseif(MSVC) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\"") +@@ -208,7 +208,7 @@ if(MSVC AND USE_STATIC_MSVC_RUNTIME) + endif() + + # Configure pkg-config +-find_package(PkgConfig) ++# find_package(PkgConfig) + file(READ "include/xlsxwriter.h" ver) + + string(REGEX MATCH "LXW_VERSION \"([^\"]+)\"" _ ${ver}) diff --git a/recipes/libxlsxwriter/all/patches/1.2.2-0001-fix-cmake.patch b/recipes/libxlsxwriter/all/patches/1.2.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..55a49481d1bfa --- /dev/null +++ b/recipes/libxlsxwriter/all/patches/1.2.2-0001-fix-cmake.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c9ceb6c..8789f73 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -238,10 +238,10 @@ endif() + + if(NOT BUILD_SHARED_LIBS) + if(UNIX) +- set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + elseif(MINGW OR MSYS) + set(CMAKE_C_FLAGS +- "${CMAKE_C_FLAGS} -static -static-libgcc -Wno-char-subscripts -Wno-long-long" ++ "${CMAKE_C_FLAGS} -Wno-char-subscripts -Wno-long-long" + ) + list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_FILE32API) + elseif(MSVC) +@@ -309,9 +309,9 @@ list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) + + # Set the minizip includes. + if(USE_SYSTEM_MINIZIP) +- if(MSVC) +- find_package(MINIZIP NAMES unofficial-minizip REQUIRED) +- set(MINIZIP_LIBRARIES unofficial::minizip::minizip) ++ if(1) ++ find_package(minizip REQUIRED) ++ set(MINIZIP_LIBRARIES minizip::minizip) + else() + find_package(PkgConfig REQUIRED) + pkg_check_modules(MINIZIP minizip) diff --git a/recipes/libxlsxwriter/all/test_package/CMakeLists.txt b/recipes/libxlsxwriter/all/test_package/CMakeLists.txt index 267b50e398033..458ebc91dcd98 100644 --- a/recipes/libxlsxwriter/all/test_package/CMakeLists.txt +++ b/recipes/libxlsxwriter/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(libxlsxwriter REQUIRED CONFIG) diff --git a/recipes/libxlsxwriter/all/test_v1_package/CMakeLists.txt b/recipes/libxlsxwriter/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libxlsxwriter/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libxlsxwriter/all/test_v1_package/conanfile.py b/recipes/libxlsxwriter/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libxlsxwriter/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_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/libxlsxwriter/config.yml b/recipes/libxlsxwriter/config.yml index 4690b80fd5fb3..ed6d68f27d29f 100644 --- a/recipes/libxlsxwriter/config.yml +++ b/recipes/libxlsxwriter/config.yml @@ -1,4 +1,12 @@ versions: + "1.2.2": + folder: "all" + "1.1.9": + folder: "all" + "1.1.8": + folder: "all" + "1.1.7": + folder: "all" "1.1.5": folder: "all" "1.1.4": diff --git a/recipes/libxml2/all/conandata.yml b/recipes/libxml2/all/conandata.yml index 37ac179d3514e..e1d930a7e022b 100644 --- a/recipes/libxml2/all/conandata.yml +++ b/recipes/libxml2/all/conandata.yml @@ -1,19 +1,31 @@ sources: - "2.12.2": - url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.2.tar.xz" - sha256: "3f2e6464fa15073eb8f3d18602d54fafc489b7715171064615a40490c6be9f4f" - "2.12.1": - url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.1.tar.xz" - sha256: "8982b9ccdf7f456e30d8f7012d50858c6623e495333b6191def455c7e95427eb" - "2.11.5": - url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.5.tar.xz" - sha256: "3727b078c360ec69fa869de14bd6f75d7ee8d36987b071e6928d4720a28df3a6" + "2.13.8": + url: "https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.8.tar.xz" + sha256: "277294cb33119ab71b2bc81f2f445e9bc9435b893ad15bb2cd2b0e859a0ee84a" + "2.13.6": + url: "https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.6.tar.xz" + sha256: "f453480307524968f7a04ec65e64f2a83a825973bcd260a2e7691be82ae70c96" + "2.13.4": + url: "https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.4.tar.xz" + sha256: "65d042e1c8010243e617efb02afda20b85c2160acdbfbcb5b26b80cec6515650" + "2.12.9": + url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.9.tar.xz" + sha256: "59912db536ab56a3996489ea0299768c7bcffe57169f0235e7f962a91f483590" + "2.12.4": + url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.4.tar.xz" + sha256: "497360e423cf0bd99eacdb7c6215dea92e6d6e89ee940393c2bae0e77cb9b7d0" + "2.12.3": + url: "https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.3.tar.xz" + sha256: "8c8f1092340a89ff32bc44ad5c9693aff9bc8a7a3e161bb239666e5d15ac9aaa" + "2.11.9": + url: "https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.9.tar.xz" + sha256: "780157a1efdb57188ec474dca87acaee67a3a839c2525b2214d318228451809f" + "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,15 +35,9 @@ sources: "2.9.14": url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz" sha256: "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" - "2.9.13": - url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.tar.xz" - sha256: "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e" "2.9.12": url: "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.12.tar.xz" sha256: "28a92f6ab1f311acf5e478564c49088ef0ac77090d9c719bbc5d518f1fe62eb9" "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 3a2832d9da9e7..6ab1df68617ff 100644 --- a/recipes/libxml2/all/conanfile.py +++ b/recipes/libxml2/all/conanfile.py @@ -83,6 +83,8 @@ def config_options(self): del self.options.docbook if Version(self.version) >= "2.11.0": self.options.rm_safe("run-debug") + if Version(self.version) >= "2.13.0": + self.options.rm_safe("mem-debug") def configure(self): if self.options.shared: @@ -97,7 +99,7 @@ def requirements(self): if self.options.zlib: self.requires("zlib/[>=1.2.11 <2]") if self.options.lzma: - self.requires("xz_utils/5.4.4") + 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: @@ -107,7 +109,7 @@ 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/2.0.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): @@ -346,8 +348,8 @@ def _create_cmake_module_variables(self, module_file): set(LIBXML2_INCLUDE_DIR ${{LibXml2_INCLUDE_DIRS}}) set(LIBXML2_INCLUDE_DIRS ${{LibXml2_INCLUDE_DIRS}}) elseif(DEFINED libxml2_INCLUDE_DIRS) - set(LIBXML2_LIBRARIES ${{libxml2_INCLUDE_DIRS}}) - set(LIBXML2_LIBRARY ${{libxml2_INCLUDE_DIRS}}) + set(LIBXML2_INCLUDE_DIR ${{libxml2_INCLUDE_DIRS}}) + set(LIBXML2_INCLUDE_DIRS ${{libxml2_INCLUDE_DIRS}}) endif() if(DEFINED LibXml2_LIBRARIES) set(LIBXML2_LIBRARIES ${{LibXml2_LIBRARIES}}) @@ -398,6 +400,10 @@ def package_info(self): elif self.settings.os == "Windows": if self.options.ftp or self.options.http: self.cpp_info.system_libs.extend(["ws2_32", "wsock32"]) + if Version(self.version) >= "2.13.4": + # https://gitlab.gnome.org/GNOME/libxml2/-/issues/791 + # https://gitlab.gnome.org/GNOME/libxml2/-/blob/2.13/win32/Makefile.msvc?ref_type=heads#L84 + self.cpp_info.system_libs.append("bcrypt") # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.filenames["cmake_find_package"] = "LibXml2" diff --git a/recipes/libxml2/config.yml b/recipes/libxml2/config.yml index cde8f92b31014..6bf8ea003cea5 100644 --- a/recipes/libxml2/config.yml +++ b/recipes/libxml2/config.yml @@ -1,13 +1,21 @@ versions: - "2.12.2": + "2.13.8": folder: all - "2.12.1": + "2.13.6": folder: all - "2.11.5": + "2.13.4": folder: all - "2.11.4": + "2.12.9": + folder: all + "2.12.4": + folder: all + "2.12.3": + folder: all + "2.11.9": folder: all - "2.11.3": + "2.11.6": + folder: all + "2.11.4": folder: all "2.10.4": folder: all @@ -15,11 +23,7 @@ versions: folder: all "2.9.14": folder: all - "2.9.13": - folder: all "2.9.12": folder: all "2.9.10": folder: all - "2.9.9": - folder: all diff --git a/recipes/libxmlpp/all/conandata.yml b/recipes/libxmlpp/all/conandata.yml index 70b3ca66d954f..9676ddd7ccf09 100644 --- a/recipes/libxmlpp/all/conandata.yml +++ b/recipes/libxmlpp/all/conandata.yml @@ -1,14 +1,22 @@ sources: + "5.4.0": + url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.4.0/libxml++-5.4.0.tar.xz" + sha256: "e9a23c436686a94698d2138e6bcbaf849121d63bfa0f50dc34fefbfd79566848" + "5.2.0": + url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.2.0/libxml++-5.2.0.tar.xz" + sha256: "e41b8eae55210511585ae638615f00db7f982c0edea94699865f582daf03b44f" "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.2.0": + - patch_file: "patches/5.2.0-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.3": - patch_file: "patches/5.0.3-0001-enable_static_builds_on_msvc.patch" patch_type: "portability" @@ -19,8 +27,3 @@ patches: 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 index 861652e59145b..8c526bf0e516c 100644 --- a/recipes/libxmlpp/all/conanfile.py +++ b/recipes/libxmlpp/all/conanfile.py @@ -34,9 +34,25 @@ class LibXMLPlusPlus(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return "17" if Version(self.version) >= "5.4.0" else "11" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) + @property def _lib_version(self): - return "2.6" if Version(self.version) <= "2.42.1" else "5.0" + return "5.0" def export_sources(self): export_conandata_patches(self) @@ -53,31 +69,24 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.11.5") - if Version(self.version) <= "2.42.1": - self.requires("glibmm/2.66.4", transitive_headers=True, transitive_libs=True) - else: - self.requires("glibmm/2.75.0") + self.requires("libxml2/[>=2.12.5 <3]") + 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) + 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.3") + self.tool_requires("meson/[>=1.2.3 <2]") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libxmlpp/all/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 deleted file mode 100644 index 32d4ca9bbdc42..0000000000000 --- a/recipes/libxmlpp/all/patches/2.42.1-0001-enable_static_builds_on_msvc.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/libxml++config.h.meson b/libxml++config.h.meson -index fdae143..5d853c2 100755 ---- a/libxml++config.h.meson -+++ b/libxml++config.h.meson -@@ -21,9 +21,16 @@ - /* Micro version number of libxml++. */ - #mesondefine LIBXMLXX_MICRO_VERSION - --#if defined (GLIBMM_DLL) && !defined (LIBXMLXX_STATIC) -+/* Defined if libxml++ is built as a static library. */ -+#mesondefine LIBXMLXX_STATIC -+ -+#if !defined (LIBXMLXX_STATIC) - #ifdef LIBXMLPP_BUILD -- #define LIBXMLPP_API __declspec(dllexport) -+ #ifdef __GNUC__ -+ #define LIBXMLPP_API __attribute__((visibility("default"))) -+ #else -+ #define LIBXMLPP_API __declspec(dllexport) -+ #endif - #elif !defined (__GNUC__) - #define LIBXMLPP_API __declspec(dllimport) - #else /* don't dllimport classes/methods on GCC/MinGW */ -diff --git a/meson.build b/meson.build -index e89f2c6..20d66ed 100644 ---- a/meson.build -+++ b/meson.build -@@ -292,15 +292,13 @@ endif - # Always set for backwards compatibility. - pkg_conf_data.set('LIBXMLCPP_EXCEPTIONS_ENABLED', 1) - -+if get_option('default_library') == 'static' -+ pkg_conf_data.set('LIBXMLXX_STATIC', 1) -+endif -+ - # Static library? - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - configure_file( - input: 'libxml++-2.6.pc.in', - output: '@BASENAME@', diff --git a/recipes/libxmlpp/all/patches/5.2.0-0001-enable_static_builds_on_msvc.patch b/recipes/libxmlpp/all/patches/5.2.0-0001-enable_static_builds_on_msvc.patch new file mode 100644 index 0000000000000..f95ca04ba12f6 --- /dev/null +++ b/recipes/libxmlpp/all/patches/5.2.0-0001-enable_static_builds_on_msvc.patch @@ -0,0 +1,21 @@ +diff --git a/meson.build b/meson.build +index e4b27ed..1e7288c 100644 +--- a/meson.build ++++ b/meson.build +@@ -356,11 +356,11 @@ 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 ++#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', diff --git a/recipes/libxmlpp/all/test_package/CMakeLists.txt b/recipes/libxmlpp/all/test_package/CMakeLists.txt index 082b48301a3b9..9ff4bc4bce235 100644 --- a/recipes/libxmlpp/all/test_package/CMakeLists.txt +++ b/recipes/libxmlpp/all/test_package/CMakeLists.txt @@ -1,8 +1,12 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) 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) +if(libxmlpp_VERSION VERSION_GREATER_EQUAL "5.4.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/libxmlpp/config.yml b/recipes/libxmlpp/config.yml index 884c9a00e9000..f9ffdcfd89507 100644 --- a/recipes/libxmlpp/config.yml +++ b/recipes/libxmlpp/config.yml @@ -1,7 +1,9 @@ versions: + "5.4.0": + folder: all + "5.2.0": + folder: all "5.0.3": folder: all "5.0.1": folder: all - "2.42.1": - folder: all diff --git a/recipes/libxpm/all/CMakeLists.txt b/recipes/libxpm/all/CMakeLists.txt index 681dd5c613eec..94c9cd557b1f0 100644 --- a/recipes/libxpm/all/CMakeLists.txt +++ b/recipes/libxpm/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(libXpm VERSION "${CONAN_libXpm_VERSION}" LANGUAGES C) @@ -16,8 +16,7 @@ endif() # ---- Library ---- -add_library( - Xpm +add_library(Xpm src/Attrib.c src/CrBufFrI.c src/CrDatFrI.c @@ -41,15 +40,15 @@ add_library( src/WrFFrI.c ) -if(WIN32) - target_sources(Xpm PRIVATE windows/libXpm.def) - target_compile_definitions(Xpm PRIVATE FOR_MSW) -else() - target_sources( - Xpm PRIVATE +if(UNIX) + # Pixmap-related functions require X11 and are not available on Windows + target_sources(Xpm PRIVATE src/CrBufFrP.c src/CrDatFrP.c src/CrIFrP.c + src/CrPFrBuf.c + src/CrPFrDat.c + src/CrPFrI.c src/RdFToP.c src/WrFFrP.c ) @@ -57,6 +56,11 @@ else() target_link_libraries(Xpm PRIVATE "${X11_LIBRARY}") endif() +if(WIN32) + set_target_properties(Xpm PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + target_compile_definitions(Xpm PRIVATE FOR_MSW) +endif() + if(MSVC) target_compile_definitions( Xpm PRIVATE @@ -68,6 +72,14 @@ endif() target_include_directories(Xpm PRIVATE include/X11) +if(NOT WIN32) + target_compile_definitions(Xpm PRIVATE + # Build without the --enable-open-zfile option: + # https://gitlab.freedesktop.org/xorg/lib/libxpm/-/blob/libXpm-3.5.17/configure.ac?ref_type=tags#L67-88 + NO_ZPIPE + ) +endif() + set_target_properties( Xpm PROPERTIES VERSION "${PROJECT_VERSION}" diff --git a/recipes/libxpm/all/conandata.yml b/recipes/libxpm/all/conandata.yml index 3db82178c2eeb..0c9046c699ed9 100644 --- a/recipes/libxpm/all/conandata.yml +++ b/recipes/libxpm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.5.17": + url: "https://gitlab.freedesktop.org/xorg/lib/libxpm/-/archive/libXpm-3.5.17/libxpm-libXpm-3.5.17.tar.gz" + sha256: "c63123e2de511edac5df33425a3a3b292e06973198c94470c454a9c973f211f6" "3.5.13": + url: "https://gitlab.freedesktop.org/xorg/lib/libxpm/-/archive/libXpm-3.5.13/libxpm-libXpm-3.5.13.tar.gz" sha256: "516fcb7a3cc5b491ca2b95df29018b1643c40649d72473d3c62379d8fdc472ff" - url: https://gitlab.freedesktop.org/xorg/lib/libxpm/-/archive/libXpm-3.5.13/libxpm-libXpm-3.5.13.tar.gz diff --git a/recipes/libxpm/all/conanfile.py b/recipes/libxpm/all/conanfile.py index 0312deadc10a9..19a22b67425e0 100644 --- a/recipes/libxpm/all/conanfile.py +++ b/recipes/libxpm/all/conanfile.py @@ -26,15 +26,9 @@ class LibXpmConan(ConanFile): "shared": False, "fPIC": True, } - no_copy_source = 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")) + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -62,7 +56,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["CONAN_libXpm_VERSION"] = self.version + tc.cache_variables["CONAN_libXpm_VERSION"] = self.version tc.generate() def build(self): diff --git a/recipes/libxpm/all/test_v1_package/CMakeLists.txt b/recipes/libxpm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libxpm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index a8c92dea63335..0000000000000 --- a/recipes/libxpm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/libxpm/all/windows/libXpm.def b/recipes/libxpm/all/windows/libXpm.def deleted file mode 100644 index 5381386ee75ee..0000000000000 --- a/recipes/libxpm/all/windows/libXpm.def +++ /dev/null @@ -1,29 +0,0 @@ -EXPORTS - -XpmCreateImageFromData -XpmCreateDataFromImage -XpmReadFileToImage -XpmWriteFileFromImage -XpmCreateImageFromBuffer -XpmReadFileToBuffer -XpmWriteFileFromBuffer -XpmReadFileToData -XpmWriteFileFromData -XpmAttributesSize -XpmFreeAttributes -XpmFreeExtensions -XpmFreeXpmImage -XpmFreeXpmInfo -XpmGetErrorString -XpmLibraryVersion - -XpmReadFileToXpmImage -XpmWriteFileFromXpmImage -XpmCreateImageFromXpmImage -XpmCreateXpmImageFromImage -XpmCreateDataFromXpmImage -XpmCreateXpmImageFromData -XpmCreateXpmImageFromBuffer -XpmCreateBufferFromXpmImage - -XpmFree diff --git a/recipes/libxpm/config.yml b/recipes/libxpm/config.yml index 96f25a4bd1d23..9876f21755330 100644 --- a/recipes/libxpm/config.yml +++ b/recipes/libxpm/config.yml @@ -1,3 +1,5 @@ versions: + "3.5.17": + folder: all "3.5.13": folder: all diff --git a/recipes/libxshmfence/all/conandata.yml b/recipes/libxshmfence/all/conandata.yml index 8c16f251fa486..21938ecba1296 100644 --- a/recipes/libxshmfence/all/conandata.yml +++ b/recipes/libxshmfence/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.2": + url: "https://www.x.org/archive/individual/lib/libxshmfence-1.3.2.tar.gz" + sha256: "e93a85099604beb244ee756dcaf70e18b08701c1ca84c4de0126cd71bd6c8181" "1.3": - url: "https://www.x.org/archive//individual/lib/libxshmfence-1.3.tar.gz" + url: "https://www.x.org/archive/individual/lib/libxshmfence-1.3.tar.gz" sha256: "7eb3d46ad91bab444f121d475b11b39273142d090f7e9ac43e6a87f4ff5f902c" diff --git a/recipes/libxshmfence/all/test_v1_package/CMakeLists.txt b/recipes/libxshmfence/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/libxshmfence/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libxshmfence/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_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/config.yml b/recipes/libxshmfence/config.yml index d2eb4ed4a511f..5fbc1fce7e8d6 100644 --- a/recipes/libxshmfence/config.yml +++ b/recipes/libxshmfence/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.2": + folder: all "1.3": folder: all diff --git a/recipes/libxslt/all/conandata.yml b/recipes/libxslt/all/conandata.yml index 535fcb94f934b..837bcffdb64e3 100644 --- a/recipes/libxslt/all/conandata.yml +++ b/recipes/libxslt/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.1.43": + sha256: "5a3d6b383ca5afc235b171118e90f5ff6aa27e9fea3303065231a6d403f0183a" + url: "https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.43.tar.xz" + "1.1.42": + sha256: "85ca62cac0d41fc77d3f6033da9df6fd73d20ea2fc18b0a3609ffb4110e1baeb" + url: "https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.42.tar.xz" + "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" diff --git a/recipes/libxslt/all/conanfile.py b/recipes/libxslt/all/conanfile.py index 6e5032ab98195..75e02e8277e24 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,14 @@ 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.11.5", transitive_headers=True, transitive_libs=True) + if Version(self.version) >= "1.1.42": + self.requires("libxml2/[>=2.12.5 <3]", transitive_headers=True, transitive_libs=True) + elif Version(self.version) >= "1.1.39": + # see https://github.com/conan-io/conan-center-index/pull/16205#discussion_r1149570846 + # Older versions use deprecated functions that were removed in libxml2 2.13 + self.requires("libxml2/[>=2.12.5 <2.13]", 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: @@ -172,7 +179,7 @@ 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, "Copyright", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if is_msvc(self): copy(self, "*.h", src=os.path.join(self.source_folder, "libxslt"), dst=os.path.join(self.package_folder, "include", "libxslt")) @@ -221,6 +228,8 @@ def package_info(self): self.cpp_info.components["exslt"].set_property("pkg_config_name", "libexslt") self.cpp_info.components["exslt"].libs = [f"{prefix}exslt{suffix}"] self.cpp_info.components["exslt"].requires = ["xslt"] + if not self.options.shared: + self.cpp_info.components["exslt"].defines = ["LIBEXSLT_STATIC"] # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.names["cmake_find_package"] = "LibXslt" diff --git a/recipes/libxslt/all/test_package/CMakeLists.txt b/recipes/libxslt/all/test_package/CMakeLists.txt index 8ca93bd0e8116..76de04ff6158e 100644 --- a/recipes/libxslt/all/test_package/CMakeLists.txt +++ b/recipes/libxslt/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(LibXslt REQUIRED) diff --git a/recipes/libxslt/all/test_v1_package/CMakeLists.txt b/recipes/libxslt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libxslt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libxslt/all/test_v1_package/conanfile.py b/recipes/libxslt/all/test_v1_package/conanfile.py deleted file mode 100644 index 1529b5e368db7..0000000000000 --- a/recipes/libxslt/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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") - xsl_path = os.path.join(self.source_folder, os.pardir, "test_package", "example.xsl") - xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "example.xml") - self.run(f"{bin_path} {xsl_path} {xml_path}", run_environment=True) - self.run("xsltproc -V", run_environment=True) diff --git a/recipes/libxslt/config.yml b/recipes/libxslt/config.yml index d53687ed0c186..6f313e4970879 100644 --- a/recipes/libxslt/config.yml +++ b/recipes/libxslt/config.yml @@ -1,4 +1,10 @@ versions: + "1.1.43": + folder: all + "1.1.42": + folder: all + "1.1.39": + folder: all "1.1.37": folder: all "1.1.34": diff --git a/recipes/libyaml/all/test_package/CMakeLists.txt b/recipes/libyaml/all/test_package/CMakeLists.txt index ebfddbde01104..76d967b92edd3 100644 --- a/recipes/libyaml/all/test_package/CMakeLists.txt +++ b/recipes/libyaml/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(yaml REQUIRED CONFIG) diff --git a/recipes/libyaml/all/test_v1_package/CMakeLists.txt b/recipes/libyaml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libyaml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libyaml/all/test_v1_package/conanfile.py b/recipes/libyaml/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libyaml/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_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/libyang/all/conandata.yml b/recipes/libyang/all/conandata.yml new file mode 100644 index 0000000000000..f8459393ddff0 --- /dev/null +++ b/recipes/libyang/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1.148": + url: "https://github.com/CESNET/libyang/archive/refs/tags/v2.1.148.tar.gz" + sha256: "77a0aaaeb3df720aeb70d6896e32e2c2be099d48df73e3cfb52567051af3e44b" diff --git a/recipes/libyang/all/conanfile.py b/recipes/libyang/all/conanfile.py new file mode 100644 index 0000000000000..2567464f94618 --- /dev/null +++ b/recipes/libyang/all/conanfile.py @@ -0,0 +1,82 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.files import get, rmdir, copy +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.53.0" + + +class LibYangConan(ConanFile): + name = "libyang" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + description = "YANG data modeling language library" + homepage = "https://github.com/CESNET/libyang" + topics = ("yang", "bsd", "netconf", "restconf", "yin") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], + "fPIC": [True, False]} + default_options = { + "shared": False, + "fPIC": True + } + + + def validate(self): + # TODO For Windows support: https://github.com/CESNET/libyang?tab=readme-ov-file#windows-build-requirements + # CMake Error at CMakeLists.txt:386 (find_package): + # By not providing "Findpthreads.cmake" in CMAKE_MODULE_PATH this project has + if self.settings.os == "Windows": + raise ConanInvalidConfiguration( + f"{self.ref} Conan recipe is not prepared to work on Windows. Contributions are welcome.") + + def requirements(self): + self.requires("pcre2/10.42", transitive_headers=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): + cmake_layout(self, src_folder="src") + + 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.variables["ENABLE_TESTS"] = False + tc.variables["ENABLE_VALGRIND_TESTS"] = False + tc.variables["ENABLE_STATIC"] = not self.options.shared + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + 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", "pkgconfig")) + # move *.yang files from /share to /res + copy(self, "*.yang", os.path.join(self.package_folder, "share"), + os.path.join(self.package_folder, "res", "share")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "LibYANG") + self.cpp_info.libs = ["yang"] + self.cpp_info.resdirs = ["res"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "dl", "m"]) diff --git a/recipes/libyang/all/test_package/CMakeLists.txt b/recipes/libyang/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2a5a447e67b6b --- /dev/null +++ b/recipes/libyang/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +find_package(LibYANG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libyang::libyang) diff --git a/recipes/libyang/all/test_package/conanfile.py b/recipes/libyang/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ec1844a785913 --- /dev/null +++ b/recipes/libyang/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_layout, CMake + + +class TestPackageConan(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/libyang/all/test_package/test_package.c b/recipes/libyang/all/test_package/test_package.c new file mode 100644 index 0000000000000..b892125a1218e --- /dev/null +++ b/recipes/libyang/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include + +int main() +{ + struct ly_ctx *ctx = NULL; + if ( ly_ctx_new( NULL, 0, &ctx ) ) + { + return 1; + } + return 0; +} diff --git a/recipes/libyang/config.yml b/recipes/libyang/config.yml new file mode 100644 index 0000000000000..78864b67abe0f --- /dev/null +++ b/recipes/libyang/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1.148": + folder: "all" diff --git a/recipes/libyuv/all/conandata.yml b/recipes/libyuv/all/conandata.yml index 3b9b5764537d0..753108fbfb79d 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: + "1892": + url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/4cd90347e78ff76755df2107009e900374aee9cd.tar.gz" "1880": url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/fb6341d326846fbbe669ad5173e520f66b339621.tar.gz" "1854": @@ -12,6 +14,13 @@ sources: "1768": url: "https://chromium.googlesource.com/libyuv/libyuv/+archive/dfaf7534e0e536f7e5ef8ddd7326797bd09b8622.tar.gz" patches: + "1892": + - patch_file: "patches/1892-0001-fix-cmake.patch" + patch_description: "Fix CMake to be more robust & predictable" + patch_type: "conan" + - patch_file: "patches/1892-0002-check-arm-sve.patch" + patch_description: "Check if -march=armv9-a+sve2 is supported" + patch_type: "conan" "1880": - patch_file: "patches/1880-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 4d851737efc1b..900430a0c20d0 100644 --- a/recipes/libyuv/all/conanfile.py +++ b/recipes/libyuv/all/conanfile.py @@ -1,10 +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 +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 import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LibyuvConan(ConanFile): @@ -50,23 +51,26 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.1") + self.requires("libjpeg-turbo/[>=3.0.3 <4]") elif self.options.with_jpeg == "mozjpeg": - self.requires("mozjpeg/4.1.3") + self.requires("mozjpeg/4.1.5") def source(self): get(self, **self.conan_data["sources"][self.version]) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) - tc.variables["TEST"] = False - tc.variables["LIBYUV_WITH_JPEG"] = bool(self.options.with_jpeg) + tc.cache_variables["TEST"] = False + tc.cache_variables["LIBYUV_WITH_JPEG"] = bool(self.options.with_jpeg) + if self.options.get_safe("shared"): + # Force FPIC for shared, Conan does not set it + tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = True tc.generate() deps = CMakeDeps(self) deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -79,6 +83,8 @@ def package(self): def package_info(self): self.cpp_info.libs = ["yuv"] self.cpp_info.requires = [] + if self.settings.compiler == "msvc": + self.cpp_info.defines.append("_CRT_SECURE_NO_WARNINGS") if self.options.with_jpeg == "libjpeg": self.cpp_info.requires.append("libjpeg::libjpeg") elif self.options.with_jpeg == "libjpeg-turbo": @@ -87,6 +93,3 @@ def package_info(self): self.cpp_info.requires.append("mozjpeg::libjpeg") 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/libyuv/all/patches/1892-0001-fix-cmake.patch b/recipes/libyuv/all/patches/1892-0001-fix-cmake.patch new file mode 100644 index 0000000000000..de39c3870ab6c --- /dev/null +++ b/recipes/libyuv/all/patches/1892-0001-fix-cmake.patch @@ -0,0 +1,81 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a021623..e0e25db 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,8 +4,8 @@ + + include(CheckCSourceCompiles) + ++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} ) +@@ -74,8 +74,6 @@ if(MSVC) + ADD_DEFINITIONS ( -D_CRT_SECURE_NO_WARNINGS ) + endif() + +-# Need to set PIC to allow creating shared libraries from object file libraries. +-SET(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # Build the set of objects that do not need to be compiled with flags to enable + # particular architecture features. +@@ -139,15 +137,10 @@ int main(void) { return 0; } + endif() + + # this creates the static library (.a) +-ADD_LIBRARY( ${ly_lib_static} STATIC ${ly_lib_parts}) ++ADD_LIBRARY( ${ly_lib_static} ${ly_lib_parts}) ++target_compile_features(${ly_lib_static} PUBLIC cxx_std_11) + + # this creates the shared library (.so) +-ADD_LIBRARY( ${ly_lib_shared} SHARED ${ly_lib_parts}) +-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 cpuid tool + ADD_EXECUTABLE ( cpuid ${ly_base_dir}/util/cpuid.c ) +@@ -160,12 +153,20 @@ 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_link_libraries(${ly_lib_name}_common_objects JPEG::JPEG ) ++ target_compile_definitions(${ly_lib_static} PRIVATE HAVE_JPEG) ++ target_compile_definitions(yuvconvert PRIVATE HAVE_JPEG) ++ target_compile_definitions(${ly_lib_name}_common_objects PRIVATE HAVE_JPEG) + endif() + + if(UNIT_TEST) +@@ -211,11 +212,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/all/patches/1892-0002-check-arm-sve.patch b/recipes/libyuv/all/patches/1892-0002-check-arm-sve.patch new file mode 100644 index 0000000000000..6a03c04446bcb --- /dev/null +++ b/recipes/libyuv/all/patches/1892-0002-check-arm-sve.patch @@ -0,0 +1,40 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e0e25db..c0d9399 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -105,16 +105,28 @@ if(NOT MSVC) + TARGET_COMPILE_OPTIONS(${ly_lib_name}_neon64 PRIVATE -march=armv8-a+dotprod+i8mm) + LIST(APPEND ly_lib_parts $) + +- # Enable AArch64 SVE kernels. +- ADD_LIBRARY(${ly_lib_name}_sve OBJECT +- ${ly_src_dir}/row_sve.cc) +- TARGET_COMPILE_OPTIONS(${ly_lib_name}_sve PRIVATE -march=armv9-a+sve2) +- LIST(APPEND ly_lib_parts $) +- + set(OLD_CMAKE_REQURED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + set(OLD_CMAKE_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE}) +- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=armv9-a+sme") ++ ++ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=armv9-a+sve2") + set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) ++ # Check whether the compiler can compile SVE functions; this fails ++ # with Clang for macOS. ++ check_c_source_compiles(" ++int main(void) { return 0; } ++ " CAN_COMPILE_SVE) ++ ++ if (CAN_COMPILE_SVE) ++ # Enable AArch64 SVE kernels. ++ ADD_LIBRARY(${ly_lib_name}_sve OBJECT ++ ${ly_src_dir}/row_sve.cc) ++ TARGET_COMPILE_OPTIONS(${ly_lib_name}_sve PRIVATE -march=armv9-a+sve2) ++ LIST(APPEND ly_lib_parts $) ++ else() ++ ADD_DEFINITIONS(-DLIBYUV_DISABLE_SVE) ++ endif() ++ ++ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQURED_FLAGS} -march=armv9-a+sme) + # Check whether the compiler can compile SME functions; this fails + # with Clang for Windows. + check_c_source_compiles(" diff --git a/recipes/libyuv/all/test_package/CMakeLists.txt b/recipes/libyuv/all/test_package/CMakeLists.txt index 639163e3b7c5c..edb97e8c8e00c 100644 --- a/recipes/libyuv/all/test_package/CMakeLists.txt +++ b/recipes/libyuv/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(libyuv REQUIRED CONFIG) diff --git a/recipes/libyuv/all/test_package/conanfile.py b/recipes/libyuv/all/test_package/conanfile.py index 0a6bc68712d90..1a000b9447dd6 100644 --- a/recipes/libyuv/all/test_package/conanfile.py +++ b/recipes/libyuv/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, cmake_layout, 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 +15,11 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + def generate(self): + tc = CMakeToolchain(self) + tc.preprocessor_definitions["HAS_JPEG"] = bool(self.dependencies[self.tested_reference_str].options.with_jpeg) + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/libyuv/all/test_package/test_package.cpp b/recipes/libyuv/all/test_package/test_package.cpp index c8f607bc623dd..0350128ece349 100644 --- a/recipes/libyuv/all/test_package/test_package.cpp +++ b/recipes/libyuv/all/test_package/test_package.cpp @@ -1,9 +1,17 @@ #include "libyuv.h" +#if HAS_JPEG +#include "libyuv/mjpeg_decoder.h" +#endif int main() { uint8_t in[16] = {}; uint8_t out[16] = {}; libyuv::ConvertToARGB(in, 16, out, 0, 0, 0, 1, 1, 0, 0, libyuv::RotationMode::kRotate0, 0); +#if HAS_JPEG + // Test jpeg implementaiton is correctly linked + libyuv::MJpegDecoder decoder; + decoder.LoadFrame(in, 0); +#endif return 0; } diff --git a/recipes/libyuv/all/test_v1_package/CMakeLists.txt b/recipes/libyuv/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libyuv/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libyuv/all/test_v1_package/conanfile.py b/recipes/libyuv/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libyuv/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_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/libyuv/config.yml b/recipes/libyuv/config.yml index fe46d8f150b2c..9b10304af3038 100644 --- a/recipes/libyuv/config.yml +++ b/recipes/libyuv/config.yml @@ -1,4 +1,6 @@ versions: + "1892": + folder: all "1880": folder: all "1854": 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..7b4620e685885 100644 --- a/recipes/libzen/all/conanfile.py +++ b/recipes/libzen/all/conanfile.py @@ -1,11 +1,12 @@ from conan import ConanFile +from conan.errors import ConanException 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, replace_in_file +from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class LibzenConan(ConanFile): @@ -55,10 +56,19 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True # To install relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.4.41": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") 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() @@ -71,27 +81,6 @@ def package(self): 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( - os.path.join(self.package_folder, self._module_file_rel_path), - {"zen": "ZenLib::ZenLib"} - ) - - 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", "ZenLib") self.cpp_info.set_property("cmake_target_name", "zen") @@ -109,9 +98,3 @@ def package_info(self): self.cpp_info.defines.extend(["UNICODE", "_UNICODE"]) if self.options.shared: self.cpp_info.defines.append("LIBZEN_SHARED") - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "ZenLib" - self.cpp_info.names["cmake_find_package_multi"] = "ZenLib" - 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/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/all/test_package/CMakeLists.txt b/recipes/libzen/all/test_package/CMakeLists.txt index 761c4f457a6d2..50320fce28154 100644 --- a/recipes/libzen/all/test_package/CMakeLists.txt +++ b/recipes/libzen/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(ZenLib REQUIRED CONFIG) diff --git a/recipes/libzen/all/test_v1_package/CMakeLists.txt b/recipes/libzen/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libzen/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libzen/all/test_v1_package/conanfile.py b/recipes/libzen/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/libzen/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_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/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 0dcb786c62874..05c2c01d18c18 100644 --- a/recipes/libzip/all/conandata.yml +++ b/recipes/libzip/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.11.3": + url: + - "https://libzip.org/download/libzip-1.11.3.tar.gz" + - "https://github.com/nih-at/libzip/releases/download/v1.11.3/libzip-1.11.3.tar.gz" + sha256: "76653f135dde3036036c500e11861648ffbf9e1fc5b233ff473c60897d9db0ea" + "1.11.2": + url: + - "https://libzip.org/download/libzip-1.11.2.tar.gz" + - "https://github.com/nih-at/libzip/releases/download/v1.11.2/libzip-1.11.2.tar.gz" + sha256: "6b2a43837005e1c23fdfee532b78f806863e412d2089b9c42b49ab08cbcd7665" + "1.11.1": + url: + - "https://libzip.org/download/libzip-1.11.1.tar.gz" + - "https://github.com/nih-at/libzip/releases/download/v1.11.1/libzip-1.11.1.tar.gz" + sha256: "c0e6fa52a62ba11efd30262290dc6970947aef32e0cc294ee50e9005ceac092a" "1.10.1": url: - "https://libzip.org/download/libzip-1.10.1.tar.gz" @@ -20,6 +35,24 @@ sources: - "https://github.com/nih-at/libzip/releases/download/v1.7.3/libzip-1.7.3.tar.gz" sha256: "0e2276c550c5a310d4ebf3a2c3dfc43fb3b4602a072ff625842ad4f3238cb9cc" patches: + "1.11.3": + - patch_file: "patches/1.11.3-0002-remove-rpath.patch" + patch_description: "remove rpath feature" + patch_type: "conan" + "1.11.2": + - 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.11.2-0002-remove-rpath.patch" + patch_description: "remove rpath feature" + patch_type: "conan" + "1.11.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.11.1-0002-remove-rpath.patch" + patch_description: "remove rpath feature" + patch_type: "conan" "1.10.1": - patch_file: "patches/1.7.3-0001-cmake-install-bundle.patch" patch_description: "fix installation path of utilities" diff --git a/recipes/libzip/all/conanfile.py b/recipes/libzip/all/conanfile.py index ef4f7c2c57579..b540de9e292e2 100644 --- a/recipes/libzip/all/conanfile.py +++ b/recipes/libzip/all/conanfile.py @@ -11,9 +11,9 @@ class LibZipConan(ConanFile): name = "libzip" description = "A C library for reading, creating, and modifying zip archives" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nih-at/libzip" - license = "BSD-3-Clause" topics = ("zip", "zip-archives", "zip-editing") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -23,7 +23,7 @@ class LibZipConan(ConanFile): "with_bzip2": [True, False], "with_lzma": [True, False], "with_zstd": [True, False], - "crypto": [False, "win32", "openssl", "mbedtls"], + "crypto": [False, "win32", "openssl", "mbedtls", "gnutls"], "tools": [True, False], } default_options = { @@ -68,15 +68,17 @@ def requirements(self): self.requires("bzip2/1.0.8") if self.options.with_lzma: - self.requires("xz_utils/5.4.5") - - if self.options.get_safe("with_zstd"): - self.requires("zstd/1.5.5") + self.requires("xz_utils/[>=5.4.5 <6]") if self.options.crypto == "openssl": self.requires("openssl/[>=1.1 <4]") elif self.options.crypto == "mbedtls": self.requires("mbedtls/3.5.0") + elif self.options.crypto == "gnutls": + self.requires("gnutls/3.8.2") + + if self.options.get_safe("with_zstd"): + self.requires("zstd/[~1.5]") def validate(self): if self.options.crypto == "win32" and self.settings.os != "Windows": @@ -84,6 +86,7 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) @@ -93,10 +96,17 @@ def generate(self): tc.variables["BUILD_DOC"] = False tc.variables["ENABLE_LZMA"] = self.options.with_lzma tc.variables["ENABLE_BZIP2"] = self.options.with_bzip2 + if (self.settings.compiler == "gcc" + and Version(self.settings.compiler.version) >= "14" + and Version(self.version) < "1.11"): + # See https://github.com/conan-io/conan-center-index/issues/26034 + # It's an error in gcc >= 14 + # Upstream fixed this silencing this error implicitly from 1.11 + tc.extra_cflags.append("-Wno-incompatible-pointer-types") if self._has_zstd_support: tc.variables["ENABLE_ZSTD"] = self.options.with_zstd tc.variables["ENABLE_COMMONCRYPTO"] = False # TODO: We need CommonCrypto package - tc.variables["ENABLE_GNUTLS"] = False # TODO: We need GnuTLS package + tc.variables["ENABLE_GNUTLS"] = self.options.crypto == "gnutls" tc.variables["ENABLE_MBEDTLS"] = self.options.crypto == "mbedtls" tc.variables["ENABLE_OPENSSL"] = self.options.crypto == "openssl" tc.variables["ENABLE_WINDOWS_CRYPTO"] = self.options.crypto == "win32" @@ -106,7 +116,6 @@ def generate(self): deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -130,11 +139,6 @@ def package_info(self): if self.options.crypto == "win32": self.cpp_info.components["_libzip"].system_libs.append("bcrypt") - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "libzip" - self.cpp_info.names["cmake_find_package_multi"] = "libzip" - self.cpp_info.components["_libzip"].names["cmake_find_package"] = "zip" - self.cpp_info.components["_libzip"].names["cmake_find_package_multi"] = "zip" self.cpp_info.components["_libzip"].set_property("cmake_target_name", "libzip::zip") self.cpp_info.components["_libzip"].set_property("pkg_config_name", "libzip") self.cpp_info.components["_libzip"].requires = ["zlib::zlib"] @@ -148,5 +152,5 @@ def package_info(self): self.cpp_info.components["_libzip"].requires.append("openssl::crypto") elif self.options.crypto == "mbedtls": self.cpp_info.components["_libzip"].requires.append("mbedtls::mbedtls") - if self.options.tools: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + elif self.options.crypto == "gnutls": + self.cpp_info.components["_libzip"].requires.append("gnutls::gnutls") diff --git a/recipes/libzip/all/patches/1.11.1-0002-remove-rpath.patch b/recipes/libzip/all/patches/1.11.1-0002-remove-rpath.patch new file mode 100644 index 0000000000000..6ee1d37d42f37 --- /dev/null +++ b/recipes/libzip/all/patches/1.11.1-0002-remove-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d019b9..5cd6a81 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -290,7 +290,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.11.2-0002-remove-rpath.patch b/recipes/libzip/all/patches/1.11.2-0002-remove-rpath.patch new file mode 100644 index 0000000000000..2d5c920bd02c6 --- /dev/null +++ b/recipes/libzip/all/patches/1.11.2-0002-remove-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 23e0f0f..85dec3d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -293,7 +293,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.11.3-0002-remove-rpath.patch b/recipes/libzip/all/patches/1.11.3-0002-remove-rpath.patch new file mode 100644 index 0000000000000..348a4d0295fdc --- /dev/null +++ b/recipes/libzip/all/patches/1.11.3-0002-remove-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 23e0f0f..85dec3d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -290,7 +290,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/test_package/CMakeLists.txt b/recipes/libzip/all/test_package/CMakeLists.txt index c95ee806189e5..d52c640a62c49 100644 --- a/recipes/libzip/all/test_package/CMakeLists.txt +++ b/recipes/libzip/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(libzip REQUIRED CONFIG) diff --git a/recipes/libzip/all/test_v1_package/CMakeLists.txt b/recipes/libzip/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/libzip/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libzip/all/test_v1_package/conanfile.py b/recipes/libzip/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/libzip/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", "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/libzip/config.yml b/recipes/libzip/config.yml index 614d36cf38cf3..a7b743c153241 100644 --- a/recipes/libzip/config.yml +++ b/recipes/libzip/config.yml @@ -1,4 +1,10 @@ versions: + "1.11.3": + folder: all + "1.11.2": + folder: all + "1.11.1": + folder: all "1.10.1": folder: all "1.9.2": diff --git a/recipes/libzippp/all/conandata.yml b/recipes/libzippp/all/conandata.yml index 20f731c93139a..8419667338e92 100644 --- a/recipes/libzippp/all/conandata.yml +++ b/recipes/libzippp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.1-1.10.1": + url: "https://github.com/ctabin/libzippp/archive/libzippp-v7.1-1.10.1.tar.gz" + sha256: "9ded3c4b5641e65d2b3a3dd0cbc4106209ee17c17df70e5187e7171420752546" "7.0-1.10.1": url: "https://github.com/ctabin/libzippp/archive/libzippp-v7.0-1.10.1.tar.gz" sha256: "67d6808406b4fc255016ede52c7b5105e2d0e43899a3331de9ed86da5dea07a1" diff --git a/recipes/libzippp/all/test_package/CMakeLists.txt b/recipes/libzippp/all/test_package/CMakeLists.txt index 5514f16e5d6bb..998eb1bb2b653 100644 --- a/recipes/libzippp/all/test_package/CMakeLists.txt +++ b/recipes/libzippp/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(libzippp REQUIRED CONFIG) diff --git a/recipes/libzippp/all/test_v1_package/CMakeLists.txt b/recipes/libzippp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/libzippp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/libzippp/all/test_v1_package/conanfile.py b/recipes/libzippp/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/libzippp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/libzippp/config.yml b/recipes/libzippp/config.yml index ce3931e22d5f5..eb03fe8bdec4f 100644 --- a/recipes/libzippp/config.yml +++ b/recipes/libzippp/config.yml @@ -1,4 +1,6 @@ versions: + "7.1-1.10.1": + folder: all "7.0-1.10.1": folder: all "6.1-1.9.2": diff --git a/recipes/lief/all/conandata.yml b/recipes/lief/all/conandata.yml index 957438b147a11..d85eff09306cd 100644 --- a/recipes/lief/all/conandata.yml +++ b/recipes/lief/all/conandata.yml @@ -1,60 +1,14 @@ sources: + "0.16.2": + url: "https://github.com/lief-project/LIEF/archive/0.16.2.tar.gz" + sha256: "895ce0321b233a6d610ed89ccbe8dc4aa2cf0bb959919a1db0693ba264f3d29a" "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" - "0.12.2": - url: "https://github.com/lief-project/LIEF/archive/0.12.2.tar.gz" - sha256: "d779c802ba1f80d0e93765e038e0a198fb5ffe4662afe467e33102cb44a06e99" - "0.10.1": - url: "https://github.com/lief-project/LIEF/archive/0.10.1.tar.gz" - sha256: "6f30c98a559f137e08b25bcbb376c0259914b33c307b8b901e01ca952241d00a" patches: + "0.16.2": + - patch_file: "patches/0.16.2-001_cmake_fixes.patch" "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" - patch_type: "conan" - - patch_file: "patches/0.12.2-002_support_older_gcc.patch" - patch_description: "fix name look up issue" - patch_type: "portability" - patch_source: "https://github.com/lief-project/LIEF/pull/815" - "0.12.2": - - patch_file: "patches/0.12.2-001_link_to_conan.patch" - patch_description: "find conan package and link these" - patch_type: "conan" - - patch_file: "patches/0.12.2-002_support_older_gcc.patch" - patch_description: "fix name look up issue" - patch_type: "portability" - patch_source: "https://github.com/lief-project/LIEF/pull/815" - "0.10.1": - - patch_file: "patches/001_link_to_conan.patch" - patch_description: "find conan package and link these" - patch_type: "conan" - - patch_file: "patches/002_fix_resources_manager.patch" - patch_description: "use rang for colorizing" - patch_type: "backport" - - patch_file: "patches/003_fix_json_include_path.patch" - patch_description: "fix include path for conan package" - patch_type: "conan" - - patch_file: "patches/004_fix_elf_parser.patch" - patch_description: "remove LIEF_API" - patch_type: "backport" - - patch_file: "patches/005_fix_compiler_detection.patch" - patch_description: "fix check logic for compiler C++17 support" - patch_type: "backport" - - patch_file: "patches/006_fix_binary_cpp.patch" - patch_description: "include cctype" - patch_type: "backport" diff --git a/recipes/lief/all/conanfile.py b/recipes/lief/all/conanfile.py index 7a69bb5dfa4c4..adf18458fef58 100644 --- a/recipes/lief/all/conanfile.py +++ b/recipes/lief/all/conanfile.py @@ -3,12 +3,12 @@ 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.microsoft import check_min_vs, is_msvc +from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os -required_conan_version = ">=1.57.0" +required_conan_version = ">=2.0" class LiefConan(ConanFile): name = "lief" @@ -48,22 +48,6 @@ class LiefConan(ConanFile): "with_vdex": True, } - @property - def _min_cppstd(self): - 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) @@ -80,33 +64,40 @@ def layout(self): def requirements(self): self.requires("mbedtls/3.2.1") - if Version(self.version) < "0.12.2": - self.requires("rang/3.2") + + if Version(self.version) >= "0.15.1": + self.requires("utfcpp/4.0.5") else: self.requires("utfcpp/3.2.3") - # lief doesn't supprot spdlog/1.11.0 with fmt/9.x yet. - self.requires("spdlog/1.10.0") - self.requires("boost/1.81.0", transitive_headers=True) - self.requires("tcb-span/cci.20220616", transitive_headers=True) + # lief doesn't supprot spdlog/1.11.0 with fmt/9.x yet. + self.requires("spdlog/1.10.0") + self.requires("boost/1.81.0", transitive_headers=True) + self.requires("tcb-span/cci.20220616", transitive_headers=True) if self.options.with_json: self.requires("nlohmann_json/3.11.2") if self.options.with_frozen: self.requires("frozen/1.1.1") + if Version(self.version) >= "0.15.1": + self.requires("tl-expected/1.1.0", 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." - ) - - 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") + skip_ci_reason = self.conf.get("user.conancenter:skip_ci_build", check_type=str) + if skip_ci_reason: + # lief/0.13.1 fails with fmt 8.x and specific versions of msvc 193 + # https://developercommunity.visualstudio.com/t/Internal-compiler-error-compiler-file-m/10376323 + raise ConanInvalidConfiguration(skip_ci_reason) + if Version(self.version) >= "0.15.1": + min_cppstd ="17" + else: + min_cppstd = "14" if self.options.with_frozen else "11" + check_min_cppstd(self, min_cppstd) if self.settings.compiler.get_safe("libcxx") == "libstdc++": - raise ConanInvalidConfiguration(f"{self.ref} does not support libstdc++") + raise ConanInvalidConfiguration("libstdc++ is only supported with the C++11 ABI enabled - try with compiler.cppstd=libstdc++11") + + def build_requirements(self): + if Version(self.version) >= "0.15.1": + self.tool_requires("cmake/[>=3.24 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -128,22 +119,28 @@ def generate(self): tc.variables["LIEF_DOC"] = False tc.variables["LIEF_LOGGING"] = False tc.variables["LIEF_PYTHON_API"] = False - if Version(self.version) >= "0.12.2": - tc.variables["LIEF_USE_CCACHE"] = False - tc.variables["LIEF_OPT_MBEDTLS_EXTERNAL"] = True - tc.variables["LIEF_OPT_NLOHMANN_JSON_EXTERNAL"] = True - tc.variables["LIEF_OPT_FROZEN_EXTERNAL"] = True - tc.variables["LIEF_OPT_UTFCPP_EXTERNAL"] = True - 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.variables["LIEF_USE_CCACHE"] = False + tc.variables["LIEF_OPT_MBEDTLS_EXTERNAL"] = True + tc.variables["LIEF_OPT_NLOHMANN_JSON_EXTERNAL"] = True + tc.variables["LIEF_OPT_FROZEN_EXTERNAL"] = True + tc.variables["LIEF_OPT_UTFCPP_EXTERNAL"] = True + tc.variables["LIEF_EXTERNAL_SPDLOG"] = True + tc.variables["LIEF_OPT_EXTERNAL_LEAF"] = True + tc.variables["LIEF_OPT_EXTERNAL_SPAN"] = True + + 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("\\", "/") + + if Version(self.version) >= "0.15.1": + tc.cache_variables["LIEF_OPT_EXTERNAL_EXPECTED"] = True + tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "0.16.1": + deps.set_property("utfcpp", "cmake_target_name", "utf8cpp::utf8cpp") deps.generate() def build(self): @@ -157,6 +154,7 @@ 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")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): @@ -175,6 +173,3 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: 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"] = "LIEF" - self.cpp_info.names["cmake_find_package_multi"] = "LIEF" diff --git a/recipes/lief/all/patches/0.12.2-001_link_to_conan.patch b/recipes/lief/all/patches/0.12.2-001_link_to_conan.patch deleted file mode 100644 index f5fad544a589a..0000000000000 --- a/recipes/lief/all/patches/0.12.2-001_link_to_conan.patch +++ /dev/null @@ -1,96 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7d59f14..9fdfe43 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -12,7 +12,6 @@ endif() - - - if(WIN32 OR ${IS_WIN_CROSS_COMPILE}) -- include(ChooseMSVCCRT) - endif() - include(CheckCXXCompilerFlag) - include(CheckCCompilerFlag) -@@ -70,7 +69,6 @@ endif() - - # Dependencies - # ============ --set(THIRD_PARTY_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/third-party/") - include(LIEFDependencies) - - # iOS specific config -@@ -376,12 +374,14 @@ endif() - # Leaf - # ======================================= - if(LIEF_EXTERNAL_LEAF) -+ find_package(Boost REQUIRED CONFIG) - message(STATUS "Using external LEAF version") - if(LIEF_EXTERNAL_LEAF_DIR) - message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") - target_include_directories(LIB_LIEF SYSTEM PUBLIC - "$") - endif() -+ target_link_libraries(LIB_LIEF PRIVATE Boost::headers) - else() - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp - COMMAND -@@ -425,6 +425,8 @@ if(LIEF_EXTERNAL_SPAN) - target_include_directories(LIB_LIEF SYSTEM PUBLIC - "$") - endif() -+ find_package(tcb-span REQUIRED CONFIG) -+ target_link_libraries(LIB_LIEF PRIVATE tcb-span::tcb-span) - else() - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/span.hpp - COMMAND -@@ -439,7 +441,6 @@ else() - endif() - - -- - target_link_libraries(LIB_LIEF PRIVATE lief_spdlog) - - # Flags definition -@@ -448,8 +449,7 @@ target_link_libraries(LIB_LIEF PRIVATE lief_spdlog) - # 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) -@@ -667,8 +667,9 @@ endif() - # Installation - # ====================== - -+include(GNUInstallDirs) -+if(0) - if(UNIX) -- include(GNUInstallDirs) - set(CMAKE_INSTALL_LIBDIR "lib") - else() - if(WIN32) -@@ -682,13 +683,14 @@ else() - 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( -@@ -727,6 +729,3 @@ export( - NAMESPACE LIEF:: - FILE LIEFExport-${lib_type}.cmake) - --# Package --# ====================== --add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/package") diff --git a/recipes/lief/all/patches/0.12.2-002_support_older_gcc.patch b/recipes/lief/all/patches/0.12.2-002_support_older_gcc.patch deleted file mode 100644 index 2ab323a4fbd5c..0000000000000 --- a/recipes/lief/all/patches/0.12.2-002_support_older_gcc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/PE/Binary.cpp b/src/PE/Binary.cpp -index 0e032c3..d2eaae9 100644 ---- a/src/PE/Binary.cpp -+++ b/src/PE/Binary.cpp -@@ -1732,7 +1732,7 @@ std::ostream& Binary::print(std::ostream& os) const { - if (has_debug()) { - os << "Debug" << std::endl; - os << "=====" << std::endl; -- for (const Debug& debug : debug()) { -+ for (const Debug& debug : this->debug()) { - os << debug << std::endl; - } - os << std::endl; diff --git a/recipes/lief/all/patches/0.12.3-001_link_to_conan.patch b/recipes/lief/all/patches/0.12.3-001_link_to_conan.patch deleted file mode 100644 index b614ea503a68c..0000000000000 --- a/recipes/lief/all/patches/0.12.3-001_link_to_conan.patch +++ /dev/null @@ -1,89 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index eadac9a..5ad254c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -17,7 +17,6 @@ endif() - - - if(WIN32 OR ${IS_WIN_CROSS_COMPILE}) -- include(ChooseMSVCCRT) - endif() - include(CheckCXXCompilerFlag) - include(CheckCCompilerFlag) -@@ -75,7 +74,6 @@ endif() - - # Dependencies - # ============ --set(THIRD_PARTY_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/third-party/") - include(LIEFDependencies) - - # iOS specific config -@@ -381,12 +379,14 @@ endif() - # Leaf - # ======================================= - if(LIEF_EXTERNAL_LEAF) -+ find_package(Boost REQUIRED CONFIG) - message(STATUS "Using external LEAF version") - if(LIEF_EXTERNAL_LEAF_DIR) - message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") - target_include_directories(LIB_LIEF SYSTEM PUBLIC - "$") - endif() -+ target_link_libraries(LIB_LIEF PRIVATE Boost::headers) - else() - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp - COMMAND -@@ -430,6 +430,8 @@ if(LIEF_EXTERNAL_SPAN) - target_include_directories(LIB_LIEF SYSTEM PUBLIC - "$") - endif() -+ find_package(tcb-span REQUIRED CONFIG) -+ target_link_libraries(LIB_LIEF PRIVATE tcb-span::tcb-span) - else() - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/span.hpp - COMMAND -@@ -453,8 +455,7 @@ target_link_libraries(LIB_LIEF PRIVATE lief_spdlog) - # 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) -@@ -672,8 +673,9 @@ endif() - # Installation - # ====================== - -+include(GNUInstallDirs) -+if(0) - if(UNIX) -- include(GNUInstallDirs) - set(CMAKE_INSTALL_LIBDIR "lib") - else() - if(WIN32) -@@ -687,13 +689,14 @@ else() - 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( -@@ -731,7 +734,3 @@ export( - EXPORT LIEFExport - NAMESPACE LIEF:: - FILE LIEFExport-${lib_type}.cmake) -- --# Package --# ====================== --add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/package") diff --git a/recipes/lief/all/patches/0.16.2-001_cmake_fixes.patch b/recipes/lief/all/patches/0.16.2-001_cmake_fixes.patch new file mode 100644 index 0000000000000..c2e2f6ef33c54 --- /dev/null +++ b/recipes/lief/all/patches/0.16.2-001_cmake_fixes.patch @@ -0,0 +1,60 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b218b696..80253eef 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -327,8 +327,7 @@ endif() + # Flags definition + # ---------------- + set_target_properties(LIB_LIEF +- PROPERTIES POSITION_INDEPENDENT_CODE ON +- CXX_STANDARD 17 ++ PROPERTIES CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + VISIBILITY_INLINES_HIDDEN ON + CXX_VISIBILITY_PRESET hidden +@@ -511,7 +510,7 @@ if(LIEF_INSTALL) + 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( +luisc@luisc-mac LIEF % git diff +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b218b696..80253eef 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -327,8 +327,7 @@ endif() + # Flags definition + # ---------------- + set_target_properties(LIB_LIEF +- PROPERTIES POSITION_INDEPENDENT_CODE ON +- CXX_STANDARD 17 ++ PROPERTIES CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + VISIBILITY_INLINES_HIDDEN ON + CXX_VISIBILITY_PRESET hidden +@@ -511,7 +510,7 @@ if(LIEF_INSTALL) + 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/src/logging.cpp b/src/logging.cpp +index 39936fe8..843f18f6 100644 +--- a/src/logging.cpp ++++ b/src/logging.cpp +@@ -20,7 +20,7 @@ + #include "logging.hpp" + + #include "spdlog/spdlog.h" +-#include "spdlog/fmt/bundled/args.h" ++#include "fmt/args.h" + #include "spdlog/sinks/stdout_color_sinks.h" + #include "spdlog/sinks/basic_file_sink.h" + #include "spdlog/sinks/android_sink.h" diff --git a/recipes/lief/all/patches/001_link_to_conan.patch b/recipes/lief/all/patches/001_link_to_conan.patch deleted file mode 100644 index e999cd3dd9317..0000000000000 --- a/recipes/lief/all/patches/001_link_to_conan.patch +++ /dev/null @@ -1,155 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9b168d9..243bbc2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -5,7 +5,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) - # Modules - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") - if (WIN32) -- include(ChooseMSVCCRT) - endif() - include(CheckCXXCompilerFlag) - include(CheckCCompilerFlag) -@@ -49,14 +48,14 @@ 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() - - # LIEF Source definition - # ====================== --set_source_files_properties(${mbedtls_src_crypto} PROPERTIES GENERATED TRUE) --set_source_files_properties(${mbedtls_src_x509} PROPERTIES GENERATED TRUE) --set_source_files_properties(${mbedtls_src_tls} PROPERTIES GENERATED TRUE) - - if (LIEF_LOGGING) - set_source_files_properties(${ELG_SOURCE_DIR}/easylogging++.cc PROPERTIES GENERATED TRUE) -@@ -73,9 +72,6 @@ set(LIEF_PRIVATE_INCLUDE_FILES) - - set(LIBLIEF_SOURCE_FILES - "${ELG_CC_PATH}" -- "${mbedtls_src_crypto}" -- "${mbedtls_src_x509}" -- "${mbedtls_src_tls}" - "${LIBFUZZER_SRC_FILES}" - "${CMAKE_CURRENT_SOURCE_DIR}/src/logging.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/src/exception.cpp" -@@ -126,13 +122,11 @@ set(LIEF_INCLUDE_FILES - set(LIEF_JSON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/visitors/json.cpp") - set(LIEF_JSON_HDR - "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/json.hpp" -- "${LIBJSON_SOURCE_DIR}/json.hpp" - ) - - if (LIEF_ENABLE_JSON) - list(APPEND LIBLIEF_SOURCE_FILES "${LIEF_JSON_SRC}") - list(APPEND LIEF_INC_FILES "${LIEF_JSON_HDR}") -- list(APPEND LIEF_PUBLIC_INCLUDE_DIR "${LIBJSON_SOURCE_DIR}/") - endif() - - source_group("Header Files" FILES ${LIEF_INC_FILES}) -@@ -224,9 +218,6 @@ endif() - - # Frozen Configuration - # ==================== --if (LIEF_FROZEN_ENABLED) -- list(APPEND LIEF_PRIVATE_INCLUDE_DIR "${FROZEN_INCLUDE_DIR}") --endif() - - # OAT part - # ======== -@@ -292,19 +283,15 @@ list(APPEND LIEF_PUBLIC_INCLUDE_DIR - list(APPEND LIEF_PRIVATE_INCLUDE_DIR - "${LIEF_PUBLIC_INCLUDE_DIR}" - "${LIEF_PUBLIC_INCLUDE_DIR}" -- "${LIBRANG_SOURCE_DIR}/include" - "${CMAKE_CURRENT_SOURCE_DIR}/src" - "${CMAKE_BINARY_DIR}" -+ "${CMAKE_CURRENT_BINARY_DIR}" - "${ELG_SOURCE_DIR}" -- "${MBEDTLS_INCLUDE_DIRS}" - ) - - - # Grouping external projects - # ========================== --source_group("mbedtls\\crypto" FILES ${mbedtls_src_crypto}) --source_group("mbedtls\\x509" FILES ${mbedtls_src_x509}) --source_group("mbedtls\\tls" FILES ${mbedtls_src_tls}) - if (LIEF_LOGGING) - source_group("easylogging" FILES ${ELG_SOURCE_DIR}/easylogging++.cc) - endif() -@@ -316,7 +303,8 @@ target_include_directories(LIB_LIEF - PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") - - if (LIEF_ENABLE_JSON) -- add_dependencies(LIB_LIEF lief_libjson) -+ find_package(nlohmann_json REQUIRED CONFIG) -+ target_link_libraries(LIB_LIEF nlohmann_json::nlohmann_json) - endif() - - if (LIEF_LOGGING) -@@ -324,18 +312,20 @@ if (LIEF_LOGGING) - endif() - - if (LIEF_FROZEN_ENABLED) -- add_dependencies(LIB_LIEF lief_frozen) -+ find_package(frozen REQUIRED CONFIG) -+ target_link_libraries(LIB_LIEF frozen::frozen) - endif() - --add_dependencies(LIB_LIEF lief_rang_cpp_color) -+find_package(rang REQUIRED CONFIG) -+target_link_libraries(LIB_LIEF rang::rang) - --add_dependencies(LIB_LIEF lief_mbed_tls) -+find_package(MbedTLS REQUIRED CONFIG) -+target_link_libraries(LIB_LIEF MbedTLS::mbedtls) - - # Flags definition - # ---------------- - set_property(TARGET LIB_LIEF PROPERTY CXX_STANDARD 11) - set_property(TARGET LIB_LIEF PROPERTY CXX_STANDARD_REQUIRED ON) --set_property(TARGET LIB_LIEF PROPERTY POSITION_INDEPENDENT_CODE ON) - set_property(TARGET LIB_LIEF PROPERTY CXX_VISIBILITY_PRESET hidden) - - target_compile_definitions(LIB_LIEF PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1) -@@ -345,11 +335,6 @@ target_compile_definitions(LIB_LIEF PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1) - # with the SpcSpAgencyInfo Critical Extension, which mbed TLS doesn't - # support, so set MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION to - # have it skip this extension. --add_definitions( -- -DMBEDTLS_MD2_C -- -DMBEDTLS_MD4_C -- -DMBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION --) - - - # ASAN - LSAN - TSAN - USAN -@@ -512,16 +497,16 @@ endif() - - install(TARGETS LIB_LIEF - ARCHIVE -- DESTINATION lib -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY -- DESTINATION lib -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME -- DESTINATION lib -+ DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT libraries) - - install( - DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} -- DESTINATION include -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT headers - FILES_MATCHING REGEX "(.*).(hpp|h|def)$") - diff --git a/recipes/lief/all/patches/002_fix_resources_manager.patch b/recipes/lief/all/patches/002_fix_resources_manager.patch deleted file mode 100644 index e48ad364b747b..0000000000000 --- a/recipes/lief/all/patches/002_fix_resources_manager.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/PE/ResourcesManager.cpp -+++ src/PE/ResourcesManager.cpp -@@ -1174,7 +1174,6 @@ - - std::string ResourcesManager::print(uint32_t depth) const { - std::ostringstream oss; -- oss << rang::control::forceColor; - uint32_t current_depth = 0; - this->print_tree(*this->resources_, oss, current_depth, depth); - return oss.str(); diff --git a/recipes/lief/all/patches/003_fix_json_include_path.patch b/recipes/lief/all/patches/003_fix_json_include_path.patch deleted file mode 100644 index 9cc16bdbe0687..0000000000000 --- a/recipes/lief/all/patches/003_fix_json_include_path.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- include/LIEF/json.hpp -+++ include/LIEF/json.hpp -@@ -19,7 +19,7 @@ - #include - - #ifdef LIEF_JSON_SUPPORT --#include -+#include - - using json = nlohmann::json; - #endif diff --git a/recipes/lief/all/patches/004_fix_elf_parser.patch b/recipes/lief/all/patches/004_fix_elf_parser.patch deleted file mode 100644 index 888201dd7b727..0000000000000 --- a/recipes/lief/all/patches/004_fix_elf_parser.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- include/LIEF/ELF/Parser.hpp -+++ include/LIEF/ELF/Parser.hpp -@@ -73,7 +73,7 @@ - //! @param[in] file Path to the ELF binary - //! @param[in] count_mtd Method used to count dynamic symbols. Default: LIEF::ELF::DYNSYM_COUNT_METHODS::COUNT_AUTO - //! @Return LIEF::ELF::Binary -- LIEF_API static std::unique_ptr parse(const std::string& file, DYNSYM_COUNT_METHODS count_mtd = DYNSYM_COUNT_METHODS::COUNT_AUTO); -+ static std::unique_ptr parse(const std::string& file, DYNSYM_COUNT_METHODS count_mtd = DYNSYM_COUNT_METHODS::COUNT_AUTO); - - //! @brief Parse the given raw data as an ELF binary and return a LIEF::ELF::Binary object - //! -@@ -83,7 +83,7 @@ - //! @param[in] name Binary name (optional) - //! @param[in] count_mtd Method used to count dynamic symbols. Default: LIEF::ELF::DYNSYM_COUNT_METHODS::COUNT_AUTO - //! @Return LIEF::ELF::Binary -- LIEF_API static std::unique_ptr parse(const std::vector& data, const std::string& name = "", DYNSYM_COUNT_METHODS count_mtd = DYNSYM_COUNT_METHODS::COUNT_AUTO); -+ static std::unique_ptr parse(const std::vector& data, const std::string& name = "", DYNSYM_COUNT_METHODS count_mtd = DYNSYM_COUNT_METHODS::COUNT_AUTO); - - Parser& operator=(const Parser& copy) = delete; - Parser(const Parser& copy) = delete; diff --git a/recipes/lief/all/patches/005_fix_compiler_detection.patch b/recipes/lief/all/patches/005_fix_compiler_detection.patch deleted file mode 100644 index ba9d025be00ad..0000000000000 --- a/recipes/lief/all/patches/005_fix_compiler_detection.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- cmake/LIEFCompilerDetection.cmake -+++ cmake/LIEFCompilerDetection.cmake -@@ -12,13 +12,21 @@ - endif() - - if (cxx_std_14 IN_LIST CMAKE_CXX_COMPILE_FEATURES) -- set(LIEF_SUPPORT_CXX14 1) -+ if (${MSVC} AND ${MSVC_TOOLSET_VERSION} GREATER_EQUAL 141) -+ set(LIEF_SUPPORT_CXX14 1) -+ elseif(NOT ${MSVC}) -+ set(LIEF_SUPPORT_CXX14 1) -+ endif() - endif() - - if (cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES) -- set(LIEF_SUPPORT_CXX17 1) -+ if (${MSVC} AND ${MSVC_TOOLSET_VERSION} GREATER_EQUAL 142) -+ set(LIEF_SUPPORT_CXX17 1) -+ elseif(NOT ${MSVC}) -+ set(LIEF_SUPPORT_CXX17 1) -+ endif() - endif() - - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/src/compiler_support.h.in" - "${CMAKE_CURRENT_BINARY_DIR}/compiler_support.h" diff --git a/recipes/lief/all/patches/006_fix_binary_cpp.patch b/recipes/lief/all/patches/006_fix_binary_cpp.patch deleted file mode 100644 index 54bf6ed4544d3..0000000000000 --- a/recipes/lief/all/patches/006_fix_binary_cpp.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/ELF/Binary.cpp -+++ src/ELF/Binary.cpp -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - - #include "LIEF/DWARF/enums.hpp" - diff --git a/recipes/lief/all/test_package/CMakeLists.txt b/recipes/lief/all/test_package/CMakeLists.txt index 21ece2b1f32cb..758b14b71f053 100644 --- a/recipes/lief/all/test_package/CMakeLists.txt +++ b/recipes/lief/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(LIEF REQUIRED CONFIG) diff --git a/recipes/lief/all/test_v1_package/CMakeLists.txt b/recipes/lief/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/lief/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/lief/all/test_v1_package/conanfile.py b/recipes/lief/all/test_v1_package/conanfile.py deleted file mode 100644 index 326a291210aff..0000000000000 --- a/recipes/lief/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - arg_path = bin_path - if self.settings.os == "Windows": - arg_path += ".exe" - self.run(f"{bin_path} {arg_path}", run_environment=True) diff --git a/recipes/lief/config.yml b/recipes/lief/config.yml index 8c2e3de0a3a96..084c9dac9db2e 100644 --- a/recipes/lief/config.yml +++ b/recipes/lief/config.yml @@ -1,11 +1,5 @@ versions: - "0.13.1": - folder: "all" - "0.13.0": - folder: "all" - "0.12.3": + "0.16.2": folder: "all" - "0.12.2": - folder: "all" - "0.10.1": + "0.13.1": folder: "all" diff --git a/recipes/lielab/all/conandata.yml b/recipes/lielab/all/conandata.yml new file mode 100644 index 0000000000000..6803bdea9abab --- /dev/null +++ b/recipes/lielab/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.4.1": + url: "https://github.com/sandialabs/Lielab/archive/refs/tags/v0.4.1.tar.gz" + sha256: "862BEC2114B9E554F77ECB2F7B3D5CEABF7374A9A0E7F80BCB94A868F3D9F51C" + "0.4.0": + url: "https://github.com/sandialabs/Lielab/archive/refs/tags/v0.4.0.tar.gz" + sha256: "5CABF2D31D7D38EEEF525ADEE5D22C0359E9C043884D4AB5FBA219D3CB217A5C" diff --git a/recipes/lielab/all/conanfile.py b/recipes/lielab/all/conanfile.py new file mode 100644 index 0000000000000..ecc16c01755a9 --- /dev/null +++ b/recipes/lielab/all/conanfile.py @@ -0,0 +1,83 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake +from conan.tools.files import copy, get, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.52.0" + +class LielabConan(ConanFile): + name = "lielab" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sandialabs/Lielab" + description = "Lielab is a C++ library for numerical Lie-theory: Lie groups," \ + " Lie algebras, homogeneous manifolds, and various functions and algorithms" \ + " on these spaces." + topics = ("Lie-theory", "Lie-group", "Lie-algebra", "numerical", "header-only") + package_type = "header-library" + license = "MIT" + + settings = "os", "arch", "compiler", "build_type" + + no_copy_source = True + + def requirements(self): + self.requires("eigen/3.4.0") + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "11", + "clang": "12", + "apple-clang": "13.1", + "Visual Studio": "17", + "msvc": "193", + } + + 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 build_requirements(self): + self.tool_requires("cmake/[>=3.23 <4]") + + 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.variables["LIELAB_INSTALL_LIBRARY"] = True + tc.variables["LIELAB_BUILD_TESTS"] = False + tc.variables["LIELAB_BUILD_PYTHON"] = False + tc.generate() + + def package(self): + copy(self, "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, "share")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "Lielab") + self.cpp_info.set_property("cmake_target_name", "Lielab::Lielab") + + self.cpp_info.names["cmake_find_package"] = "Lielab" + self.cpp_info.names["cmake_find_package_multi"] = "Lielab" + + def package_id(self): + self.info.clear() + diff --git a/recipes/lielab/all/test_package/CMakeLists.txt b/recipes/lielab/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c13d8b918525c --- /dev/null +++ b/recipes/lielab/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Lielab REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Lielab::Lielab) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/lielab/all/test_package/conanfile.py b/recipes/lielab/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/lielab/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/lielab/all/test_package/test_package.cpp b/recipes/lielab/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..81a29ab2a8a75 --- /dev/null +++ b/recipes/lielab/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include +#include + + +int main(void) { + std::cout << "Lielab v" << Lielab::VERSION << std::endl; + std::cout << Lielab::AUTHOR << std::endl; + std::cout << Lielab::LOCATION << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/lielab/config.yml b/recipes/lielab/config.yml new file mode 100644 index 0000000000000..bf6438ecd493c --- /dev/null +++ b/recipes/lielab/config.yml @@ -0,0 +1,5 @@ +versions: + "0.4.1": + folder: "all" + "0.4.0": + folder: "all" diff --git a/recipes/lightgbm/all/conandata.yml b/recipes/lightgbm/all/conandata.yml index 5c29f9403b5ce..8355ba2b45e51 100644 --- a/recipes/lightgbm/all/conandata.yml +++ b/recipes/lightgbm/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.3.0": + url: "https://github.com/microsoft/LightGBM/archive/refs/tags/v4.3.0.tar.gz" + sha256: "9e5a88bc231addfe4a0e57aa5ceb157f045103cd69ad8c2f393ef941ef52a9ac" + "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" diff --git a/recipes/lightgbm/all/conanfile.py b/recipes/lightgbm/all/conanfile.py index cae89a9218102..e84bccaa188bb 100644 --- a/recipes/lightgbm/all/conanfile.py +++ b/recipes/lightgbm/all/conanfile.py @@ -6,6 +6,7 @@ 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 +from conan.tools.env import VirtualBuildEnv from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -65,6 +66,10 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) + def build_requirements(self): + if Version(self.version) >= "4.3.0": + self.tool_requires("cmake/[>=3.18 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -78,8 +83,10 @@ def generate(self): tc.cache_variables["APPLE_OUTPUT_DYLIB"] = True tc.variables["_MAJOR_VERSION"] = Version(self.version).major tc.generate() - tc = CMakeDeps(self) - tc.generate() + deps = CMakeDeps(self) + deps.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") def _patch_sources(self): apply_conandata_patches(self) diff --git a/recipes/lightgbm/all/test_v1_package/CMakeLists.txt b/recipes/lightgbm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/lightgbm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 746d011e4501a..0000000000000 --- a/recipes/lightgbm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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 eba2ef0bbf4fd..e59972b46cebb 100644 --- a/recipes/lightgbm/config.yml +++ b/recipes/lightgbm/config.yml @@ -1,4 +1,8 @@ versions: + "4.3.0": + folder: all + "4.2.0": + folder: all "4.1.0": folder: all "3.3.5": diff --git a/recipes/lightpcapng/all/test_v1_package/CMakeLists.txt b/recipes/lightpcapng/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/lightpcapng/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/lightpcapng/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", "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/limereport/all/conandata.yml b/recipes/limereport/all/conandata.yml new file mode 100644 index 0000000000000..a6aa17992b336 --- /dev/null +++ b/recipes/limereport/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.7.4": + url: "https://github.com/fralx/LimeReport/archive/refs/tags/1.7.4.tar.gz" + sha256: 5e16ffa4f1f6c9175ef00be95029d5dda57287236ef8529582e1df1366c8dc30 diff --git a/recipes/limereport/all/conanfile.py b/recipes/limereport/all/conanfile.py new file mode 100644 index 0000000000000..60455f5993eb1 --- /dev/null +++ b/recipes/limereport/all/conanfile.py @@ -0,0 +1,119 @@ +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, get, replace_in_file +from conan.tools.build import check_min_cppstd +from conan import ConanFile +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + + +class LimereportConan(ConanFile): + name = "limereport" + description = "Report generator for Qt Framework" + homepage = "https://limereport.ru" + topics = ("limereport", "pdf", "report","qt") + license = "LGPL-3.0", "GPL-3.0" + 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], + "with_zint": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_zint": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "8", + "apple-clang": "9.1", + } + + @property + def _qt_version_major(self): + return Version(self.dependencies["qt"].ref.version).major + + 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): + # QString included in Irglobal.h and Limereport expects be running Qt on customer side + self.requires("qt/[>=5.15 <7]", transitive_headers=True, transitive_libs=True) + if self.options.with_zint: + self.requires("zint/2.10.0") + + 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 not (self.dependencies["qt"].options.qtdeclarative): + raise ConanInvalidConfiguration(f"{self.ref} requires -o='qt/*:qtdeclarative=True'") + if not (self.dependencies["qt"].options.qtsvg and self.dependencies["qt"].options.qttools): + raise ConanInvalidConfiguration(f"{self.ref} requires -o='qt/*:qtsvg=True' and -o='qt/*:qttools=True'") + if self.options.with_zint and not self.dependencies["zint"].options.with_qt: + raise ConanInvalidConfiguration(f"{self.ref} option with_zint=True requires -o 'zint/*:with_qt=True'") + + 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.cache_variables["LIMEREPORT_STATIC"] = not self.options.shared + if is_msvc(self): + tc.variables["WINDOWS_BUILD"] = True + tc.cache_variables["USE_QT6"] = self._qt_version_major == 6 + tc.cache_variables["ENABLE_ZINT"] = self.options.with_zint + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + # Avoid using vendozied zint + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(3rdparty)", "") + + def build(self): + self._patch_sources() + 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")) + copy(self, "COPYING", 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 = [f"limereport-qt{self._qt_version_major}"] + self.cpp_info.requires = ["qt::qtCore", "qt::qtWidgets", "qt::qtQml", "qt::qtXml", "qt::qtSql", + "qt::qtPrintSupport", "qt::qtSvg", "qt::qtUiTools"] + if self.options.with_zint: + self.cpp_info.requires.append("zint::zint") + if self.options.shared: + self.cpp_info.defines.append("LIMEREPORT_IMPORTS") diff --git a/recipes/limereport/all/test_package/CMakeLists.txt b/recipes/limereport/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..08e6667600f91 --- /dev/null +++ b/recipes/limereport/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(limereport CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} limereport::limereport) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/limereport/all/test_package/conanfile.py b/recipes/limereport/all/test_package/conanfile.py new file mode 100644 index 0000000000000..76ff27872680a --- /dev/null +++ b/recipes/limereport/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain +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.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/limereport/all/test_package/test_package.cpp b/recipes/limereport/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a10ab64ab7245 --- /dev/null +++ b/recipes/limereport/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include + +int main(int argc, char* argv[]) +{ + auto report = new LimeReport::ReportEngine(); + + std::cout << "limereport: " << report->reportName().toStdString() << std::endl; + std::cout << "LIMEREPORT_VERSION_STR: " << LIMEREPORT_VERSION_STR << std::endl; + + delete report; + return EXIT_SUCCESS; +} diff --git a/recipes/limereport/config.yml b/recipes/limereport/config.yml new file mode 100644 index 0000000000000..41f47d462d189 --- /dev/null +++ b/recipes/limereport/config.yml @@ -0,0 +1,3 @@ +versions: + "1.7.4": + folder: "all" diff --git a/recipes/linmath.h/all/test_package/CMakeLists.txt b/recipes/linmath.h/all/test_package/CMakeLists.txt index 5ff54df0112b2..3a6fb99803b72 100644 --- a/recipes/linmath.h/all/test_package/CMakeLists.txt +++ b/recipes/linmath.h/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(linmath.h REQUIRED CONFIG) diff --git a/recipes/linmath.h/all/test_v1_package/CMakeLists.txt b/recipes/linmath.h/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/linmath.h/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/linmath.h/all/test_v1_package/conanfile.py b/recipes/linmath.h/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/linmath.h/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_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/linux-headers-generic/all/conanfile.py b/recipes/linux-headers-generic/all/conanfile.py index 5b72ec11402d0..894f602ae0a26 100644 --- a/recipes/linux-headers-generic/all/conanfile.py +++ b/recipes/linux-headers-generic/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.files import chdir, copy, get from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout +from conan.tools.build import cross_building required_conan_version = ">=1.53.0" @@ -33,6 +34,26 @@ def package_id(self): def _is_legacy_one_profile(self): return not hasattr(self, "settings_build") + @property + def _conan_arch_to_linux_arch(self): + # INFO: Conan architecture to Linux architecture mapping + # https://www.kernel.org/doc/html/latest/arch/index.html + # https://github.com/torvalds/linux/tree/v6.14/arch + arch_mapping = { + "armv8": "arm64", + "armv7": "arm", + "x86": "x86", + "ppc": "powerpc", + "riscv": "riscv", + "mips": "mips", + "sparc": "sparc", + "s390": "s390", + "sh4le": "sh" + } + arch = str(self.settings.arch) + return next((value for prefix, value in arch_mapping.items() + if arch.startswith(prefix)), arch) + def validate(self): 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") @@ -42,6 +63,10 @@ def source(self): def generate(self): tc = AutotoolsToolchain(self) + if cross_building(self): + # INFO: When cross-compiling, the build system needs to know the target architecture + # https://github.com/torvalds/linux/blob/v6.14/Makefile#L394 + tc.make_args.append(f"ARCH={self._conan_arch_to_linux_arch}") tc.generate() def build(self): 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/all/conanfile.py b/recipes/linux-syscall-support/all/conanfile.py index 4f6891e057476..c6c2c6978c04d 100644 --- a/recipes/linux-syscall-support/all/conanfile.py +++ b/recipes/linux-syscall-support/all/conanfile.py @@ -19,9 +19,9 @@ class LinuxSyscallSupportConan(ConanFile): settings = "os" no_copy_source = True - def configure(self): + def validate(self): if self.settings.os != "Linux": - raise ConanInvalidConfiguration("{} supported only on Linux".format(self.name)) + raise ConanInvalidConfiguration("Only Linux is supported") def layout(self): basic_layout(self, src_folder="src") diff --git a/recipes/linux-syscall-support/all/test_package/CMakeLists.txt b/recipes/linux-syscall-support/all/test_package/CMakeLists.txt index d0ccff7dbe735..2b547073a82a5 100644 --- a/recipes/linux-syscall-support/all/test_package/CMakeLists.txt +++ b/recipes/linux-syscall-support/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 C) find_package(linux-syscall-support REQUIRED CONFIG) diff --git a/recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt b/recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 961b416af6b07..0000000000000 --- a/recipes/linux-syscall-support/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -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/linux-syscall-support/all/test_v1_package/conanfile.py b/recipes/linux-syscall-support/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/linux-syscall-support/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/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/liquid-dsp/all/conandata.yml b/recipes/liquid-dsp/all/conandata.yml index 23e1bf444316a..e94d8d3d73cb9 100644 --- a/recipes/liquid-dsp/all/conandata.yml +++ b/recipes/liquid-dsp/all/conandata.yml @@ -1,8 +1,7 @@ sources: + "1.6.0": + url: "https://github.com/jgaeddert/liquid-dsp/archive/v1.6.0.tar.gz" + sha256: "6ee6a5dfb48e047b118cf613c0b9f43e34356a5667a77a72a55371d2c8c53bf5" "1.3.2": url: "https://github.com/jgaeddert/liquid-dsp/archive/refs/tags/v1.3.2.tar.gz" sha256: "85093624EF9CB90EAD64C836D2F42690197EDACE1A86257D6524C4E4DC870483" -patches: - "1.3.2": - - patch_file: "patches/1.3.2/0001-Remove-headers-check.patch" - base_path: "source_subfolder" diff --git a/recipes/liquid-dsp/all/conanfile.py b/recipes/liquid-dsp/all/conanfile.py index 26e149f068f7a..131fb07babeea 100644 --- a/recipes/liquid-dsp/all/conanfile.py +++ b/recipes/liquid-dsp/all/conanfile.py @@ -1,45 +1,42 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from contextlib import contextmanager 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 cross_building +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import chdir, copy, get, rename +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 LiquidDspConan(ConanFile): name = "liquid-dsp" - description = ( - "Digital signal processing library for software-defined radios (and more)" - ) - topics = ("dsp", "sdr", "liquid-dsp") + description = "Digital signal processing library for software-defined radios (and more)" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jgaeddert/liquid-dsp" - license = ("MIT",) - settings = "os", "arch", "build_type", "compiler" - exports_sources = ["generate_link_library.bat"] + topics = ("dsp", "sdr") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], + "fPIC": [True, False], "simdoverride": [True, False], } default_options = { "shared": False, + "fPIC": True, "simdoverride": False, } - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _libname(self): - if self.settings.os == "Windows": - return "libliquid" - return "liquid" - @property def _target_name(self): - if self.settings.os == "Macos": + if is_apple_os(self): if not self.options.shared: return "libliquid.ar" return "libliquid.dylib" @@ -49,138 +46,81 @@ def _target_name(self): @property def _lib_pattern(self): - if self.settings.os == "Macos" and not self.options.shared: + if is_apple_os(self) and not self.options.shared: return "libliquid.a" - if self.settings.os != "Windows": - return self._target_name - return "libliquid.lib" + return self._target_name - def configure(self): - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC - @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") + if self.options.shared: + self.options.rm_safe("fPIC") - 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("mingw-w64/8.1") - self.build_requires("automake/1.16.4") - - def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + def layout(self): + basic_layout(self, src_folder="src") def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self): + if cross_building(self): raise ConanInvalidConfiguration("Cross building is not yet supported. Contributions are welcome") + if is_msvc(self): + raise ConanInvalidConfiguration("MSVC is not supported due to missing 'complex' data type support") + + def build_requirements(self): + # For ./bootstrap.sh + self.tool_requires("autoconf/2.71") + 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, - ) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _patch_sources(self): - if self.settings.os == "Windows": - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - - def _gen_link_library(self): - if self.settings.compiler != "Visual Studio" or (not self.options.shared): - return - self.run("cmd /c generate_link_library.bat") - with tools.chdir(self._source_subfolder): - self.run( - "{} /def:libliquid.def /out:libliquid.lib /machine:{}".format( - os.getenv("AR"), "X86" if self.settings.arch == "x86" else "X64" - ), - win_bash=tools.os_info.is_windows, - ) + def generate(self): + venv = VirtualBuildEnv(self) + venv.generate() - def _rename_libraries(self): - with tools.chdir(self._source_subfolder): - if self.settings.os == "Windows" and self.options.shared: - tools.rename("libliquid.so", "libliquid.dll") - elif self.settings.os == "Windows" and not self.options.shared: - tools.rename("libliquid.a", "libliquid.lib") - elif self.settings.os == "Macos" and not self.options.shared: - tools.rename("libliquid.ar", "libliquid.a") - - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - env = { - "CC": "gcc", - "CXX": "g++", - "LD": "ld", - "AR": "ar", - } - with tools.environment_append(env): - yield - else: - yield - - @contextmanager - def _msvc_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - env = { - "CC": "cl -nologo", - "CXX": "cl -nologo", - "AR": "lib", - "LD": "link", - } - with tools.environment_append(env): - yield + gcc_env = Environment() + if self.settings.build_type == "Debug": + cflags = "-g -O0" else: - yield + cflags = "-s -O2 -DNDEBUG" + gcc_env.append("CFLAGS", cflags) + gcc_env.vars(self, scope="gcc").save_script("conan_gcc_env") - def build(self): - self._patch_sources() - ncpus = tools.cpu_count() - configure_args = [] - cflags = ["-static-libgcc"] + tc = AutotoolsToolchain(self) if self.settings.build_type == "Debug": - configure_args.append("--enable-debug-messages") - cflags.extend(["-g", "-O0"]) - else: - cflags.extend(["-s", "-O2", "-DNDEBUG"]) + tc.configure_args.append("--enable-debug-messages") if self.options.simdoverride: - configure_args.append("--enable-simdoverride") - if self.settings.compiler == "Visual Studio": - configure_args.append("CFLAGS='{}'".format(" ".join(cflags))) - configure_args_str = " ".join(configure_args) - with self._build_context(): - with tools.chdir(self._source_subfolder): - self.run("./bootstrap.sh", win_bash=tools.os_info.is_windows) - self.run( - "./configure {}".format(configure_args_str), - win_bash=tools.os_info.is_windows, - ) - self.run( - "make {} -j{}".format(self._target_name, ncpus), - win_bash=tools.os_info.is_windows, - ) + tc.configure_args.append("--enable-simdoverride") + tc.generate(gcc_env) + + def _rename_libraries(self): + with chdir(self, self.source_folder): + if is_apple_os(self) and not self.options.shared: + rename(self, "libliquid.ar", "libliquid.a") + + def build(self): + with chdir(self, self.source_folder): + self.run("./bootstrap.sh", env=["conanbuild", "gcc"]) + autotools = Autotools(self) + autotools.configure() + autotools.make(self._target_name) self._rename_libraries() - with self._msvc_context(): - self._gen_link_library() def package(self): - self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") - self.copy( - pattern="liquid.h", - dst=os.path.join("include", "liquid"), - src=os.path.join(self._source_subfolder, "include"), - ) - self.copy(pattern="libliquid.dll", dst="bin", src=self._source_subfolder) - self.copy(pattern=self._lib_pattern, dst="lib", src=self._source_subfolder) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "liquid.h", + dst=os.path.join(self.package_folder, "include", "liquid"), + src=os.path.join(self.source_folder, "include")) + copy(self, self._lib_pattern, + dst=os.path.join(self.package_folder, "lib"), + src=self.source_folder) def package_info(self): - self.cpp_info.libs = [self._libname] - if self.settings.os == "Linux": + self.cpp_info.libs = ["liquid"] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/liquid-dsp/all/generate_link_library.bat b/recipes/liquid-dsp/all/generate_link_library.bat deleted file mode 100644 index fb20541a4c46c..0000000000000 --- a/recipes/liquid-dsp/all/generate_link_library.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -echo Generating link library for MSVC... -echo EXPORTS >> source_subfolder\libliquid.def -for /f "skip=19 tokens=4" %%A in ('%LD% /dump /EXPORTS source_subfolder\libliquid.dll') do echo %%A >> source_subfolder\libliquid.def diff --git a/recipes/liquid-dsp/all/patches/1.3.2/0001-Remove-headers-check.patch b/recipes/liquid-dsp/all/patches/1.3.2/0001-Remove-headers-check.patch deleted file mode 100644 index ad10a374ed0d9..0000000000000 --- a/recipes/liquid-dsp/all/patches/1.3.2/0001-Remove-headers-check.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 8a99b1c6853193c1f518bc81b705d7094225e114 Mon Sep 17 00:00:00 2001 -From: Rui Oliveira -Date: Fri, 18 Jun 2021 09:37:46 +0100 -Subject: [PATCH] Remove headers check - ---- - configure.ac | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/configure.ac b/configure.ac -index e6bc297e..5b591c87 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -81,20 +81,12 @@ AC_FUNC_ERROR_AT_LINE - AC_FUNC_MALLOC - AC_FUNC_REALLOC - --# AC_CHECK_LIB (library, function, [action-if-found], [action-if-not-found], [other-libraries]) --AC_CHECK_LIB([c],[main],[],[AC_MSG_ERROR(Could not use standard C library)], []) --AC_CHECK_LIB([m],[main],[],[AC_MSG_ERROR(Could not use standard math library)],[]) -- - # AC_CHECK_FUNC(function, [action-if-found], [action-if-not-found]) - AC_CHECK_FUNCS([malloc realloc free memset memmove],[], - [AC_MSG_ERROR(Could not use memory allocation functions)]) - AC_CHECK_FUNCS([sinf cosf expf cargf cexpf crealf cimagf sqrtf],[], - [AC_MSG_ERROR(Could not use special math functions)],) - --# Check for necessary header files --AC_CHECK_HEADERS([stdio.h stdlib.h complex.h string.h getopt.h sys/resource.h float.h inttypes.h limits.h stdlib.h string.h unistd.h],[], -- [AC_MSG_ERROR(Could not use standard headers)]) -- - # Check for optional header files, libraries, programs - AC_CHECK_HEADERS(fec.h fftw3.h) - AC_CHECK_LIB([fftw3f], [fftwf_plan_dft_1d], [], --- -2.32.0.windows.1 - diff --git a/recipes/liquid-dsp/all/test_package/CMakeLists.txt b/recipes/liquid-dsp/all/test_package/CMakeLists.txt index 2859677acfc5b..a71be24831850 100644 --- a/recipes/liquid-dsp/all/test_package/CMakeLists.txt +++ b/recipes/liquid-dsp/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.0) -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(liquid-dsp REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${CMAKE_PROJECT_NAME} liquid-dsp::liquid-dsp) diff --git a/recipes/liquid-dsp/all/test_package/conanfile.py b/recipes/liquid-dsp/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/liquid-dsp/all/test_package/conanfile.py +++ b/recipes/liquid-dsp/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/liquid-dsp/config.yml b/recipes/liquid-dsp/config.yml index 906e859d7afd8..6d49f977901cf 100644 --- a/recipes/liquid-dsp/config.yml +++ b/recipes/liquid-dsp/config.yml @@ -1,3 +1,5 @@ versions: + "1.6.0": + folder: "all" "1.3.2": folder: "all" diff --git a/recipes/litehtml/all/test_package/CMakeLists.txt b/recipes/litehtml/all/test_package/CMakeLists.txt index 01d00c41e24f2..504f55d878044 100644 --- a/recipes/litehtml/all/test_package/CMakeLists.txt +++ b/recipes/litehtml/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(litehtml REQUIRED CONFIG) diff --git a/recipes/litehtml/all/test_v1_package/CMakeLists.txt b/recipes/litehtml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/litehtml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/litehtml/all/test_v1_package/conanfile.py b/recipes/litehtml/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/litehtml/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_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/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..00f9a40b4e58b --- /dev/null +++ b/recipes/lksctp-tools/all/conanfile.py @@ -0,0 +1,80 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +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 layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} is only available on Linux") + + 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): + VirtualBuildEnv(self).generate() + 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/llama-cpp/all/conandata.yml b/recipes/llama-cpp/all/conandata.yml new file mode 100755 index 0000000000000..f913ddab6686b --- /dev/null +++ b/recipes/llama-cpp/all/conandata.yml @@ -0,0 +1,17 @@ +sources: + "b4570": + url: "https://github.com/ggerganov/llama.cpp/archive/refs/tags/b4570.tar.gz" + sha256: "35bfe07807fd0cf30710023765b9a7ab6c1003f27ef907ce9cea2c5464411430" + "b4079": + url: "https://github.com/ggerganov/llama.cpp/archive/refs/tags/b4079.tar.gz" + sha256: "79093413dcdbd30f83b800aeb958c87369fdfdaf4e5603b094185898ff404a32" + "b3542": + url: "https://github.com/ggerganov/llama.cpp/archive/refs/tags/b3542.tar.gz" + sha256: "6f8b23d930400fce5708d2c85022ef33f1083af8f6ac395abefadacee0942e78" +patches: + "b4570": + - patch_file: "patches/b4570-001-curl-patch-targets.patch" + "b4079": + - patch_file: "patches/b4079-001-curl-patch-targets.patch" + "b3542": + - patch_file: "patches/b3542-001-curl-patch-targets.patch" diff --git a/recipes/llama-cpp/all/conanfile.py b/recipes/llama-cpp/all/conanfile.py new file mode 100755 index 0000000000000..8d7f68df5c867 --- /dev/null +++ b/recipes/llama-cpp/all/conanfile.py @@ -0,0 +1,192 @@ +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, cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import save, copy, get, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.scm import Version + +required_conan_version = ">=2.0.9" + + +class LlamaCppConan(ConanFile): + name = "llama-cpp" + description = "Inference of LLaMA model in pure C/C++" + topics = ("llama", "llm", "ai") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ggerganov/llama.cpp" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_examples": [True, False], + "with_cuda": [True, False], + "with_curl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_examples": False, + "with_cuda": False, + "with_curl": False, + } + + implements = ["auto_shared_fpic"] + + @property + def _is_new_llama(self): + # Structure of llama.cpp libraries was changed after b4079 + return Version(self.version) >= "b4570" + + @property + def _cuda_build_module(self): + # Adding this to the package info is necessary if we want consumers of llama to link correctly when + # they activate the CUDA option. In the future, when we have a CUDA recipe this could be removed. + cuda_target = "ggml-cuda" if self._is_new_llama else "ggml" + return textwrap.dedent(f"""\ + find_dependency(CUDAToolkit REQUIRED) + if (WIN32) + # As of CUDA 12.3.1, Windows does not offer a static cublas library + target_link_libraries({cuda_target} INTERFACE CUDA::cudart_static CUDA::cublas CUDA::cublasLt CUDA::cuda_driver) + else () + target_link_libraries({cuda_target} INTERFACE CUDA::cudart_static CUDA::cublas_static CUDA::cublasLt_static CUDA::cuda_driver) + endif() + """) + + def export_sources(self): + export_conandata_patches(self) + + def validate(self): + check_min_cppstd(self, 17 if self._is_new_llama else 11) + + def validate_build(self): + if self._is_new_llama and self.settings.compiler == "msvc" and "arm" in self.settings.arch: + raise ConanInvalidConfiguration("llama-cpp does not support ARM architecture on msvc, it recommends to use clang instead") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_curl: + self.requires("libcurl/[>=7.78 <9]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + tc = CMakeToolchain(self) + tc.variables["BUILD_SHARED_LIBS"] = bool(self.options.shared) + tc.variables["LLAMA_STANDALONE"] = False + tc.variables["LLAMA_BUILD_TESTS"] = False + tc.variables["LLAMA_BUILD_EXAMPLES"] = self.options.get_safe("with_examples") + tc.variables["LLAMA_CURL"] = self.options.get_safe("with_curl") + if cross_building(self): + tc.variables["LLAMA_NATIVE"] = False + tc.variables["GGML_NATIVE_DEFAULT"] = False + + tc.variables["GGML_BUILD_TESTS"] = False + # Follow with_examples when newer versions can compile examples, + # right now it tries to add_subdirectory to a non-existent folder + tc.variables["GGML_BUILD_EXAMPLES"] = False + tc.variables["GGML_CUDA"] = self.options.get_safe("with_cuda") + 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() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + copy(self, "*", os.path.join(self.source_folder, "models"), os.path.join(self.package_folder, "res", "models")) + copy(self, "*.h*", os.path.join(self.source_folder, "common"), os.path.join(self.package_folder, "include", "common")) + copy(self, "*common*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*common*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*common*.so", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*common*.dylib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*common*.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) + if self.options.with_cuda and not self.options.shared: + save(self, os.path.join(self.package_folder, "lib", "cmake", "llama-cpp-cuda-static.cmake"), self._cuda_build_module) + + def _get_backends(self): + results = ["cpu"] + if is_apple_os(self): + results.append("blas") + results.append("metal") + if self.options.with_cuda: + results.append("cuda") + return results + + def package_info(self): + self.cpp_info.components["ggml"].libs = ["ggml"] + self.cpp_info.components["ggml"].resdirs = ["res"] + self.cpp_info.components["ggml"].set_property("cmake_target_name", "ggml::all") + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["ggml"].system_libs.append("dl") + + self.cpp_info.components["llama"].libs = ["llama"] + self.cpp_info.components["llama"].resdirs = ["res"] + self.cpp_info.components["llama"].requires.append("ggml") + + self.cpp_info.components["common"].includedirs = [os.path.join("include", "common")] + self.cpp_info.components["common"].libs = ["common"] + self.cpp_info.components["common"].requires = ["llama"] + + if self.options.with_curl: + self.cpp_info.components["common"].requires.append("libcurl::libcurl") + self.cpp_info.components["common"].defines.append("LLAMA_USE_CURL") + + if is_apple_os(self): + self.cpp_info.components["common"].frameworks.extend(["Foundation", "Accelerate", "Metal"]) + elif self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["common"].system_libs.extend(["dl", "m", "pthread", "gomp"]) + + if self.options.with_cuda and not self.options.shared: + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + module_path = os.path.join("lib", "cmake", "llama-cpp-cuda-static.cmake") + self.cpp_info.set_property("cmake_build_modules", [module_path]) + + if self._is_new_llama: + self.cpp_info.components["ggml-base"].libs = ["ggml-base"] + self.cpp_info.components["ggml-base"].resdirs = ["res"] + self.cpp_info.components["ggml-base"].set_property("cmake_target_name", "ggml-base") + + self.cpp_info.components["ggml"].requires = ["ggml-base"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.components["ggml-base"].system_libs.extend(["dl", "m", "pthread"]) + + + if self.options.shared: + self.cpp_info.components["llama"].defines.append("LLAMA_SHARED") + self.cpp_info.components["ggml-base"].defines.append("GGML_SHARED") + self.cpp_info.components["ggml"].defines.append("GGML_SHARED") + + backends = self._get_backends() + for backend in backends: + self.cpp_info.components[f"ggml-{backend}"].libs = [f"ggml-{backend}"] + self.cpp_info.components[f"ggml-{backend}"].resdirs = ["res"] + self.cpp_info.components[f"ggml-{backend}"].set_property("cmake_target_name", f"ggml-{backend}") + if self.options.shared: + self.cpp_info.components[f"ggml-{backend}"].defines.append("GGML_BACKEND_SHARED") + self.cpp_info.components["ggml"].defines.append(f"GGML_USE_{backend.upper()}") + self.cpp_info.components["ggml"].requires.append(f"ggml-{backend}") + + if is_apple_os(self): + if "blas" in backends: + self.cpp_info.components["ggml-blas"].frameworks.append("Accelerate") + if "metal" in backends: + self.cpp_info.components["ggml-metal"].frameworks.extend(["Metal", "MetalKit", "Foundation", "CoreFoundation"]) diff --git a/recipes/llama-cpp/all/patches/b3040-001-curl-patch-targets.patch b/recipes/llama-cpp/all/patches/b3040-001-curl-patch-targets.patch new file mode 100755 index 0000000000000..454fe46b32c1f --- /dev/null +++ b/recipes/llama-cpp/all/patches/b3040-001-curl-patch-targets.patch @@ -0,0 +1,15 @@ +diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt +index 0ec8d6d8..647ef30b 100644 +--- a/common/CMakeLists.txt ++++ b/common/CMakeLists.txt +@@ -77,9 +77,7 @@ set(LLAMA_COMMON_EXTRA_LIBS build_info) + if (LLAMA_CURL) + find_package(CURL REQUIRED) + add_definitions(-DLLAMA_USE_CURL) +- include_directories(${CURL_INCLUDE_DIRS}) +- find_library(CURL_LIBRARY curl REQUIRED) +- set(LLAMA_COMMON_EXTRA_LIBS ${LLAMA_COMMON_EXTRA_LIBS} ${CURL_LIBRARY}) ++ list(APPEND LLAMA_COMMON_EXTRA_LIBS CURL::libcurl) + endif () + + target_include_directories(${TARGET} PUBLIC .) diff --git a/recipes/llama-cpp/all/patches/b3542-001-curl-patch-targets.patch b/recipes/llama-cpp/all/patches/b3542-001-curl-patch-targets.patch new file mode 100755 index 0000000000000..dcb0f491566b5 --- /dev/null +++ b/recipes/llama-cpp/all/patches/b3542-001-curl-patch-targets.patch @@ -0,0 +1,26 @@ +diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt +index 761971d6..3afd9759 100644 +--- a/common/CMakeLists.txt ++++ b/common/CMakeLists.txt +@@ -66,7 +66,7 @@ add_library(${TARGET} STATIC + train.cpp + ngram-cache.h + ngram-cache.cpp +- ) ++) + + if (BUILD_SHARED_LIBS) + set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON) +@@ -78,10 +78,8 @@ set(LLAMA_COMMON_EXTRA_LIBS build_info) + if (LLAMA_CURL) + find_package(CURL REQUIRED) + add_definitions(-DLLAMA_USE_CURL) +- include_directories(${CURL_INCLUDE_DIRS}) +- find_library(CURL_LIBRARY curl REQUIRED) +- set(LLAMA_COMMON_EXTRA_LIBS ${LLAMA_COMMON_EXTRA_LIBS} ${CURL_LIBRARY}) +-endif () ++ list(APPEND LLAMA_COMMON_EXTRA_LIBS CURL::libcurl) ++endif() + + target_include_directories(${TARGET} PUBLIC .) + target_compile_features (${TARGET} PUBLIC cxx_std_11) diff --git a/recipes/llama-cpp/all/patches/b4079-001-curl-patch-targets.patch b/recipes/llama-cpp/all/patches/b4079-001-curl-patch-targets.patch new file mode 100644 index 0000000000000..377b18e548420 --- /dev/null +++ b/recipes/llama-cpp/all/patches/b4079-001-curl-patch-targets.patch @@ -0,0 +1,15 @@ +diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt +index 5ab1ffa1..4cd462ee 100644 +--- a/common/CMakeLists.txt ++++ b/common/CMakeLists.txt +@@ -78,9 +78,7 @@ set(LLAMA_COMMON_EXTRA_LIBS build_info) + if (LLAMA_CURL) + find_package(CURL REQUIRED) + add_definitions(-DLLAMA_USE_CURL) +- include_directories(${CURL_INCLUDE_DIRS}) +- find_library(CURL_LIBRARY curl REQUIRED) +- set(LLAMA_COMMON_EXTRA_LIBS ${LLAMA_COMMON_EXTRA_LIBS} ${CURL_LIBRARY}) ++ list(APPEND LLAMA_COMMON_EXTRA_LIBS CURL::libcurl) + endif () + + target_include_directories(${TARGET} PUBLIC .) diff --git a/recipes/llama-cpp/all/patches/b4570-001-curl-patch-targets.patch b/recipes/llama-cpp/all/patches/b4570-001-curl-patch-targets.patch new file mode 100644 index 0000000000000..c3605ceb8cd28 --- /dev/null +++ b/recipes/llama-cpp/all/patches/b4570-001-curl-patch-targets.patch @@ -0,0 +1,15 @@ +diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt +index 24b7f87..e332bec 100644 +--- a/common/CMakeLists.txt ++++ b/common/CMakeLists.txt +@@ -84,9 +84,7 @@ set(LLAMA_COMMON_EXTRA_LIBS build_info) + if (LLAMA_CURL) + find_package(CURL REQUIRED) + target_compile_definitions(${TARGET} PUBLIC LLAMA_USE_CURL) +- include_directories(${CURL_INCLUDE_DIRS}) +- find_library(CURL_LIBRARY curl REQUIRED) +- set(LLAMA_COMMON_EXTRA_LIBS ${LLAMA_COMMON_EXTRA_LIBS} ${CURL_LIBRARY}) ++ list(APPEND LLAMA_COMMON_EXTRA_LIBS CURL::libcurl) + endif () + + target_include_directories(${TARGET} PUBLIC .) diff --git a/recipes/llama-cpp/all/test_package/CMakeLists.txt b/recipes/llama-cpp/all/test_package/CMakeLists.txt new file mode 100755 index 0000000000000..fa2157e90aaa3 --- /dev/null +++ b/recipes/llama-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(llama-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE llama-cpp::llama llama-cpp::common) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/llama-cpp/all/test_package/conanfile.py b/recipes/llama-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6cd089d783d39 --- /dev/null +++ b/recipes/llama-cpp/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 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/llama-cpp/all/test_package/test_package.cpp b/recipes/llama-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1201d51a3f7ee --- /dev/null +++ b/recipes/llama-cpp/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include "llama.h" +#include +int main() { + llama_model_params params = llama_model_default_params(); + std::cout << "Main GPU: " << params.main_gpu << std::endl; + + return 0; +} diff --git a/recipes/llama-cpp/config.yml b/recipes/llama-cpp/config.yml new file mode 100644 index 0000000000000..5bbc9b86997cc --- /dev/null +++ b/recipes/llama-cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "b4570": + folder: "all" + "b4079": + folder: "all" + "b3542": + folder: "all" diff --git a/recipes/llhttp/all/test_package/CMakeLists.txt b/recipes/llhttp/all/test_package/CMakeLists.txt index 100d91bba1f4c..9a2b04b4dac8d 100644 --- a/recipes/llhttp/all/test_package/CMakeLists.txt +++ b/recipes/llhttp/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(llhttp REQUIRED CONFIG) diff --git a/recipes/llhttp/all/test_v1_package/CMakeLists.txt b/recipes/llhttp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/llhttp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/llhttp/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_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/llnl-units/all/conandata.yml b/recipes/llnl-units/all/conandata.yml new file mode 100644 index 0000000000000..61314f6985693 --- /dev/null +++ b/recipes/llnl-units/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.9.1": + url: "https://github.com/LLNL/units/archive/refs/tags/v0.9.1.tar.gz" + sha256: "7edb83613a07cf55873f22d61c0062e46db6f8cb27d137866858811ec2e1ad4f" diff --git a/recipes/llnl-units/all/conanfile.py b/recipes/llnl-units/all/conanfile.py new file mode 100644 index 0000000000000..62478d1b6985f --- /dev/null +++ b/recipes/llnl-units/all/conanfile.py @@ -0,0 +1,103 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.files import copy, rm, rmdir, get + + +class UnitsConan(ConanFile): + name = "llnl-units" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://units.readthedocs.io" + description = ( + "A run-time C++ library for working with units " + "of measurement and conversions between them " + "and with string representations of units " + "and measurements" + ) + topics = ( + "units", + "dimensions", + "quantities", + "physical-units", + "dimensional-analysis", + "run-time", + ) + settings = "os", "compiler", "build_type", "arch" + package_type = "library" + 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 { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + 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.preprocessor_definitions["UNITS_CMAKE_PROJECT_NAME"] = "LLNL-UNITS" + tc.preprocessor_definitions["UNITS_ENABLE_TESTS"] = "OFF" + tc.preprocessor_definitions["UNITS_BUILD_SHARED_LIBRARY"] = self.options.shared + tc.preprocessor_definitions[ + "UNITS_BUILD_STATIC_LIBRARY" + ] = not self.options.shared + tc.generate() + + def build(self): + 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", "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 = ["units"] + namespace = self.conf.get("user.llnl-units:namespace", check_type=str) + base_type = self.conf.get("user.llnl-units:base_type", check_type=str, default="uint32_t") + self.cpp_info.defines = [f"UNITS_BASE_TYPE={base_type}"] + if namespace: + self.cpp_info.defines.append(f"UNITS_NAMESPACE={units_namespace}") + + self.cpp_info.set_property("cmake_file_name", "units") + self.cpp_info.set_property("cmake_target_name", "units::units") diff --git a/recipes/llnl-units/all/test_package/CMakeLists.txt b/recipes/llnl-units/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..32484e5b71ec5 --- /dev/null +++ b/recipes/llnl-units/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(units REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE units::units) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/llnl-units/all/test_package/conanfile.py b/recipes/llnl-units/all/test_package/conanfile.py new file mode 100644 index 0000000000000..02eb5ce439fb4 --- /dev/null +++ b/recipes/llnl-units/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/llnl-units/all/test_package/test_package.cpp b/recipes/llnl-units/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..875f7bb1c1123 --- /dev/null +++ b/recipes/llnl-units/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include +#include "units/units.hpp" +using namespace units; + +int main(void) { + auto new_unit=m/s; + auto another=new_unit*s; + bool test = another == m; + std::cout << test << std::endl; + + measurement length1=45.0*m; + measurement length2=20.0*m; + measurement result=900.0*m*m; + measurement area=length1*length2; + bool test2 = area == result; + std::cout << test2 << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/llnl-units/config.yml b/recipes/llnl-units/config.yml new file mode 100644 index 0000000000000..6895ae8f05494 --- /dev/null +++ b/recipes/llnl-units/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.1": + folder: all diff --git a/recipes/llvm-core/all/CMakeLists.txt b/recipes/llvm-core/all/CMakeLists.txt deleted file mode 100644 index e88dcfa953495..0000000000000 --- a/recipes/llvm-core/all/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.13.4) -project(conanllvm) - -include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -if(LLVM_ENABLE_ZLIB) - find_package(ZLIB QUIET) - - # The FindZLIB find module provided by CMake behaves differently than the FindZLIB.cmake script generated by CONAN. - # So the following two lines fill in the needed properties. - list(GET ZLIB_LIBRARIES 0 ZLIB_LIBRARY) - set_property(TARGET ZLIB::ZLIB PROPERTY LOCATION "${ZLIB_LIBRARY}") - - # Additionally LLVM 11.1.0 requires the zlib lib dir to be in the library path. - # This is not needed for later versions and can be removed once - # LLVM-12 becomes the oldest supported version. - if(UNIX) - set(ENV{LIBRARY_PATH} "${CONAN_LIB_DIRS_ZLIB}:$ENV{LIBRARY_PATH}") - elseif(WIN32) - file(TO_NATIVE_PATH "${CONAN_LIB_DIRS_ZLIB}" WINDOWS_ZLIB_PATH) - string(APPEND CMAKE_EXE_LINKER_FLAGS " /LIBPATH:${WINDOWS_ZLIB_PATH}") - endif() -endif() - -add_subdirectory("source") diff --git a/recipes/llvm-core/all/conandata.yml b/recipes/llvm-core/all/conandata.yml index 331f5f3a1903f..dd26cdba6b0b2 100644 --- a/recipes/llvm-core/all/conandata.yml +++ b/recipes/llvm-core/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "19.1.7": + "llvm": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.7/llvm-19.1.7.src.tar.xz + sha256: 96f833c6ad99a3e8e1d9aca5f439b8fd2c7efdcf83b664e0af1c0712c5315910 + "cmake": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.7/cmake-19.1.7.src.tar.xz + sha256: 11c5a28f90053b0c43d0dec3d0ad579347fc277199c005206b963c19aae514e3 "13.0.0": url: https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/llvm-13.0.0.src.tar.xz sha256: 408d11708643ea826f519ff79761fcdfc12d641a2510229eec459e72f8163020 @@ -10,18 +17,65 @@ sources: sha256: ce8508e318a01a63d4e8b3090ab2ded3c598a50258cc49e2625b9120d4c03ea5 patches: - "11.1.0": - - base_path: "source" - patch_file: "patches/11x/11.1.0-cmake.patch" - - base_path: "source" - patch_file: "patches/11x/11.1.0-native.patch" - "12.0.0": - - base_path: "source" - patch_file: "patches/12x/12.0.0-cmake.patch" - - base_path: "source" - patch_file: "patches/12x/12.0.0-native.patch" + "19.1.7": + - patch_file: patches/19x/0000-cmake-dependencies.patch + patch_description: fix references to third party libs to match conan variables and targets + patch_type: conan + base_path: llvm-main "13.0.0": - - base_path: "source" - patch_file: "patches/13x/13.0.0-cmake.patch" - - base_path: "source" - patch_file: "patches/13x/13.0.0-native.patch" + - patch_file: patches/13x/0000-cmake-dependencies.patch + patch_description: fix references to third party libs to match conan variables and targets + patch_type: conan + - patch_file: patches/13x/0001-calculate-job-pools.patch + patch_description: calculate resource limits for compiling LLVM + patch_type: portability + patch_source: https://github.com/llvm/llvm-project/pull/65274 + - patch_file: patches/13x/0002-missing-includes.patch + patch_description: fix missing header files + patch_type: portability + patch_source: https://github.com/llvm/llvm-project-release-prs/pull/3 + - patch_file: patches/13x/0003-no-build-with-install-rpath.patch + patch_description: do not build shared libs with install rpath + patch_type: conan + - patch_file: patches/13x/0004-remove-lto-exports.patch + patch_description: remove LTO exports causing link error with lld + patch_source: https://github.com/llvm/llvm-project-release-prs/pull/279 + patch_type: portability + "12.0.0": + - patch_file: patches/12x/0000-cmake-dependencies.patch + patch_description: fix references to third party libs to match conan variables and targets + patch_type: conan + - patch_file: patches/12x/0001-calculate-job-pools.patch + patch_description: calculate resource limits for compiling LLVM + patch_type: portability + patch_source: https://github.com/llvm/llvm-project/pull/65274 + - patch_file: patches/12x/0002-missing-includes.patch + patch_description: fix missing header files + patch_type: portability + patch_source: https://github.com/llvm/llvm-project-release-prs/pull/3 + - patch_file: patches/12x/0003-no-build-with-install-rpath.patch + patch_description: do not build shared libs with install rpath + patch_type: conan + - patch_file: patches/12x/0004-remove-lto-exports.patch + patch_description: remove LTO exports causing link error with lld + patch_source: https://github.com/llvm/llvm-project-release-prs/pull/279 + patch_type: portability + "11.1.0": + - patch_file: patches/11x/0000-cmake-dependencies.patch + patch_description: fix references to third party libs to match conan variables and targets + patch_type: conan + - patch_file: "patches/11x/0001-calculate-job-pools.patch" + patch_description: calculate resource limits for compiling LLVM + patch_type: portability + patch_source: https://github.com/llvm/llvm-project/pull/65274 + - patch_file: patches/11x/0002-missing-includes.patch + patch_description: fix missing header files + patch_type: portability + patch_source: https://github.com/llvm/llvm-project-release-prs/pull/3 + - patch_file: patches/11x/0003-no-build-with-install-rpath.patch + patch_description: do not build shared libs with install rpath + patch_type: conan + - patch_file: patches/11x/0004-remove-lto-exports.patch + patch_description: remove LTO exports causing link error with lld + patch_source: https://github.com/llvm/llvm-project-release-prs/pull/279 + patch_type: portability diff --git a/recipes/llvm-core/all/conanfile.py b/recipes/llvm-core/all/conanfile.py index 263cb7360506c..e82900990eeb2 100644 --- a/recipes/llvm-core/all/conanfile.py +++ b/recipes/llvm-core/all/conanfile.py @@ -1,429 +1,549 @@ -from conan.errors import ConanInvalidConfiguration from conan import ConanFile -from conan.tools.build import cross_building -from conan.tools.files import apply_conandata_patches, chdir, collect_libs, get, load, rename, replace_in_file, rm, rmdir, save +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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import ( + apply_conandata_patches, + collect_libs, + get, + rmdir, + load, + save, + copy, + export_conandata_patches, + rm, + rename, + replace_in_file +) +from conan.tools.microsoft import is_msvc, msvc_runtime_flag from conan.tools.scm import Version -from conans import CMake -from collections import defaultdict + import json -import re -import os.path import os +from pathlib import Path, PurePosixPath +import re import textwrap -required_conan_version = ">=1.50.2" # Due to conan.tools.scm.Version + +required_conan_version = ">=1.62.0" + +# LLVM's default config is to enable all targets, but end users can significantly reduce +# build times for the package by specifying only the targets they need as a +# semi-colon delimited string in the value of the 'targets' option +LLVM_TARGETS = { + "AArch64", + "AMDGPU", + "ARM", + "AVR", + "BPF", + "Hexagon", + "Lanai", + "LoongArch", + "Mips", + "MSP430", + "NVPTX", + "PowerPC", + "RISCV", + "Sparc", + "SystemZ", + "VE", + "WebAssembly", + "X86", + "XCore" +} + +def components_from_dotfile(dotfile): + """ + Parse the dotfile generated by the + [cmake --graphviz](https://cmake.org/cmake/help/latest/module/CMakeGraphVizOptions.html) + option to generate the list of available LLVM CMake targets and their inter-component dependencies. + + In future a [CPS](https://cps-org.github.io/cps/index.html) format could be used, or generated directly + by the LLVM build system + """ + def node_labels(dot): + """ + match each node in the dotfile with a label property, and map the label to a conan component + """ + label_replacements = { + "LibXml2::LibXml2": "libxml2::libxml2", + "ZLIB::ZLIB": "zlib::zlib", + "zstd::libzstd_static": "zstd::zstdlib", + "-lpthread": "pthread" + } + for row in dot: + match_label = re.match(r'''^\s*"(node[0-9]+)"\s*\[\s*label\s*=\s*"(.+)".*''', row) + if match_label: + node = match_label.group(1) + label = match_label.group(2) + yield node, label_replacements.get(label, label) + + def node_dependencies(dot): + """ + Using the nodes with labels, extract the component dependencies of each node + """ + ignore_deps = [ + "diaguids.lib" # https://github.com/llvm/llvm-project/issues/86250 + ] + labels = {k: v for k, v in node_labels(dot)} + for row in dot: + match_dep = re.match(r'''^\s*"(node[0-9]+)"\s*->\s*"(node[0-9]+)".*''', row) + if match_dep: + node_label = labels[match_dep.group(1)] + dependency = labels[match_dep.group(2)] + if node_label.startswith("LLVM") and PurePosixPath(dependency).parts[-1] not in ignore_deps: + yield node_label, labels[match_dep.group(2)] + # some components don't have dependencies + for label in labels.values(): + if label.startswith("LLVM"): + yield label, None + + system_libs = { + "ole32", + "delayimp", + "shell32", + "advapi32", + "-delayload:shell32.dll", + "uuid", + "psapi", + "-delayload:ole32.dll", + "ntdll", + "ws2_32", + "rt", + "m", + "dl", + "pthread" + } + components = {} + dotfile_rows = dotfile.split("\n") + for node, dependency in node_dependencies(dotfile_rows): + key = "system_libs" if dependency in system_libs else "requires" + if not node in components: + components[node] = { "system_libs": [], "requires": [] } + if dependency is not None: + components[node][key] = [dependency] + elif dependency is not None: + components[node][key].append(dependency) + + return components class LLVMCoreConan(ConanFile): - name = 'llvm-core' + name = "llvm-core" description = ( - 'A toolkit for the construction of highly optimized compilers,' - 'optimizers, and runtime environments.' + "A toolkit for the construction of highly optimized compilers," + "optimizers, and runtime environments." ) - license = 'Apache-2.0 WITH LLVM-exception' - topics = ('llvm', 'compiler') - homepage = 'https://llvm.org' - url = 'https://github.com/conan-io/conan-center-index' - - settings = ('os', 'arch', 'compiler', 'build_type') + package_type = "library" + license = "Apache-2.0 WITH LLVM-exception" + topics = ("llvm", "compiler") + homepage = "https://llvm.org" + url = "https://github.com/conan-io/conan-center-index" + settings = "os", "arch", "compiler", "build_type" options = { - 'shared': [True, False], - 'fPIC': [True, False], - 'components': 'ANY', - 'targets': 'ANY', - 'exceptions': [True, False], - 'rtti': [True, False], - 'threads': [True, False], - 'lto': ['On', 'Off', 'Full', 'Thin'], - 'static_stdlib': [True, False], - 'unwind_tables': [True, False], - 'expensive_checks': [True, False], - 'use_perf': [True, False], - 'use_sanitizer': [ - 'Address', - 'Memory', - 'MemoryWithOrigins', - 'Undefined', - 'Thread', - 'DataFlow', - 'Address;Undefined', - 'None' + "shared": [True, False], + "fPIC": [True, False], + "components": ["ANY"], + "targets": ["ANY"], + "exceptions": [True, False], + "rtti": [True, False], + "threads": [True, False], + "lto": ["On", "Off", "Full", "Thin"], + "static_stdlib": [True, False], + "unwind_tables": [True, False], + "expensive_checks": [True, False], + "use_perf": [True, False], + "use_sanitizer": [ + "Address", + "Memory", + "MemoryWithOrigins", + "Undefined", + "Thread", + "DataFlow", + "Address;Undefined", + "None" ], - 'with_ffi': [True, False], - 'with_zlib': [True, False], - 'with_xml2': [True, False], - 'use_llvm_cmake_files': [True, False], + "with_ffi": [True, False], + "with_libedit": [True, False], + "with_terminfo": [True, False], + "with_zlib": [True, False], + "with_xml2": [True, False], + "with_z3": [True, False], + "with_zstd": [True, False], } default_options = { - 'shared': False, - 'fPIC': True, - 'components': 'all', - 'targets': 'all', - 'exceptions': True, - 'rtti': True, - 'threads': True, - 'lto': 'Off', - 'static_stdlib': False, - 'unwind_tables': True, - 'expensive_checks': False, - 'use_perf': False, - 'use_sanitizer': 'None', - 'with_ffi': False, - 'with_zlib': True, - 'with_xml2': True, - 'use_llvm_cmake_files': False, + "shared": False, + "fPIC": True, + "components": "all", + "targets": "all", + "exceptions": True, + "rtti": True, + "threads": True, + "lto": "Off", + "static_stdlib": False, + "unwind_tables": True, + "expensive_checks": False, + "use_perf": False, + "use_sanitizer": "None", + "with_libedit": True, + "with_ffi": False, + "with_terminfo": False, # differs from LLVM default + "with_xml2": True, + "with_z3": True, + "with_zlib": True, + "with_zstd": True, } - # Older cmake versions may have issues generating the graphviz output used - # to model the components - build_requires = [ - 'cmake/3.20.5' - ] - - generators = 'cmake', 'cmake_find_package' - no_copy_source = True - short_paths = True - @property - def _source_subfolder(self): - return 'source' - - def _supports_compiler(self): - compiler = self.settings.compiler.value - version = Version(self.settings.compiler.version) - major_rev, minor_rev = version.major, (version.minor or 0) - - unsupported_combinations = [ - [compiler == 'gcc', major_rev == 5, minor_rev < 1], - [compiler == 'gcc', major_rev < 5], - [compiler == 'clang', major_rev < 4], - [compiler == 'apple-clang', major_rev < 9], - [compiler == 'Visual Studio', major_rev < 15] - ] - if any(all(combination) for combination in unsupported_combinations): - message = 'unsupported compiler: "{}", version "{}"' - raise ConanInvalidConfiguration(message.format(compiler, version)) - - def _patch_sources(self): - apply_conandata_patches(self) - - def _patch_build(self): - if os.path.exists('FindIconv.cmake'): - replace_in_file(self, 'FindIconv.cmake', 'iconv charset', 'iconv') - - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions['BUILD_SHARED_LIBS'] = False - cmake.definitions['CMAKE_SKIP_RPATH'] = True - cmake.definitions['CMAKE_POSITION_INDEPENDENT_CODE'] = \ - self.options.get_safe('fPIC', default=False) or self.options.shared - - if not self.options.shared: - cmake.definitions['DISABLE_LLVM_LINK_LLVM_DYLIB'] = True - # cmake.definitions['LLVM_LINK_DYLIB'] = self.options.shared + def _min_cppstd(self): + if Version(self.version) >= 19: + return 17 + return 14 - cmake.definitions['LLVM_TARGET_ARCH'] = 'host' - cmake.definitions['LLVM_TARGETS_TO_BUILD'] = self.options.targets - cmake.definitions['LLVM_BUILD_LLVM_DYLIB'] = self.options.shared - cmake.definitions['LLVM_DYLIB_COMPONENTS'] = self.options.components - cmake.definitions['LLVM_ENABLE_PIC'] = \ - self.options.get_safe('fPIC', default=False) - - if self.settings.compiler == 'Visual Studio': - build_type = str(self.settings.build_type).upper() - cmake.definitions['LLVM_USE_CRT_{}'.format(build_type)] = \ - self.settings.compiler.runtime - - cmake.definitions['LLVM_ABI_BREAKING_CHECKS'] = 'WITH_ASSERTS' - cmake.definitions['LLVM_ENABLE_WARNINGS'] = True - cmake.definitions['LLVM_ENABLE_PEDANTIC'] = True - cmake.definitions['LLVM_ENABLE_WERROR'] = False - - cmake.definitions['LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN'] = True - cmake.definitions['LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO'] = False - cmake.definitions['LLVM_BUILD_INSTRUMENTED_COVERAGE'] = False - cmake.definitions['LLVM_OPTIMIZED_TABLEGEN'] = True - cmake.definitions['LLVM_REVERSE_ITERATION'] = False - cmake.definitions['LLVM_ENABLE_BINDINGS'] = False - cmake.definitions['LLVM_CCACHE_BUILD'] = False - - cmake.definitions['LLVM_INCLUDE_TOOLS'] = self.options.shared - cmake.definitions['LLVM_INCLUDE_EXAMPLES'] = False - cmake.definitions['LLVM_INCLUDE_TESTS'] = False - cmake.definitions['LLVM_INCLUDE_BENCHMARKS'] = False - cmake.definitions['LLVM_APPEND_VC_REV'] = False - cmake.definitions['LLVM_BUILD_DOCS'] = False - cmake.definitions['LLVM_ENABLE_IDE'] = False - cmake.definitions['LLVM_ENABLE_TERMINFO'] = False - - cmake.definitions['LLVM_ENABLE_EH'] = self.options.exceptions - cmake.definitions['LLVM_ENABLE_RTTI'] = self.options.rtti - cmake.definitions['LLVM_ENABLE_THREADS'] = self.options.threads - cmake.definitions['LLVM_ENABLE_LTO'] = self.options.lto - cmake.definitions['LLVM_STATIC_LINK_CXX_STDLIB'] = \ - self.options.static_stdlib - cmake.definitions['LLVM_ENABLE_UNWIND_TABLES'] = \ - self.options.unwind_tables - cmake.definitions['LLVM_ENABLE_EXPENSIVE_CHECKS'] = \ - self.options.expensive_checks - cmake.definitions['LLVM_ENABLE_ASSERTIONS'] = \ - self.settings.build_type == 'Debug' - - cmake.definitions['LLVM_USE_NEWPM'] = False - cmake.definitions['LLVM_USE_OPROFILE'] = False - cmake.definitions['LLVM_USE_PERF'] = self.options.use_perf - if self.options.use_sanitizer == 'None': - cmake.definitions['LLVM_USE_SANITIZER'] = '' - else: - cmake.definitions['LLVM_USE_SANITIZER'] = \ - self.options.use_sanitizer - - cmake.definitions['LLVM_ENABLE_Z3_SOLVER'] = False - cmake.definitions['LLVM_ENABLE_LIBPFM'] = False - cmake.definitions['LLVM_ENABLE_LIBEDIT'] = False - cmake.definitions['LLVM_ENABLE_FFI'] = self.options.with_ffi - cmake.definitions['LLVM_ENABLE_ZLIB'] = "FORCE_ON" if \ - self.options.get_safe('with_zlib', False) else False - cmake.definitions['LLVM_ENABLE_LIBXML2'] = \ - self.options.get_safe('with_xml2', False) - return cmake + @property + def _compilers_minimum_version(self): + return {14: { + "apple-clang": "10", + "clang": "3.4", + "gcc": "5", + "msvc": "191", + "Visual Studio": "15", + }, 17: { + "apple-clang": "10", + "clang": "6", + "gcc": "7", + "msvc": "192", + "Visual Studio": "16", + }, + }.get(self._min_cppstd, {}) 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': + if self.settings.os == "Windows": del self.options.fPIC - del self.options.with_xml2 + del self.options.with_libedit # not supported on windows + if Version(self.version) < 15: + # Added by https://reviews.llvm.org/D128465 + del self.options.with_zstd + if Version(self.version) >= 19: + # removed in https://github.com/llvm/llvm-project/commit/852aaf54071ad072335dcac57f544d4da34c875a + del self.options.with_terminfo + + 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_ffi: - self.requires('libffi/3.3') - if self.options.get_safe('with_zlib', False): - self.requires('zlib/1.2.12') - if self.options.get_safe('with_xml2', False): - self.requires('libxml2/2.9.10') - - def package_id(self): - del self.info.options.use_llvm_cmake_files + self.requires("libffi/3.4.6") + if self.options.get_safe("with_libedit"): + self.requires("editline/3.1") + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_xml2: + self.requires("libxml2/[>=2.12.5 <3]") + if self.options.with_z3: + self.requires("z3/4.13.0") + if self.options.get_safe("with_zstd"): + self.requires("zstd/1.5.6") + + def build_requirements(self): + self.tool_requires("ninja/[>=1.10.2 <2]") + self.tool_requires("cmake/[>=3.20 <4]") # required by LLVM 19 def validate(self): - if self.options.shared: # Shared builds disabled just due to the CI - message = 'Shared builds not currently supported' - raise ConanInvalidConfiguration(message) - # del self.options.fPIC - # if self.settings.os == 'Windows' and self.options.shared: - # message = 'Shared builds not supported on Windows' - # raise ConanInvalidConfiguration(message) + 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.shared: + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Shared builds are currently not supported on Windows") + if is_apple_os(self) and self.options.with_xml2 and bool(self.dependencies["libxml2"].options.iconv): + # FIXME iconv contains duplicate symbols in the libiconv and libcharset libraries (both of which are + # provided by libiconv). This may be an issue with how conan packages libiconv + raise ConanInvalidConfiguration("iconv cannot be linked into the shared LLVM library on macos " + "due to duplicate symbols. Use libxml2/*:iconv=False.") + if self.options.exceptions and not self.options.rtti: - message = 'Cannot enable exceptions without rtti support' - raise ConanInvalidConfiguration(message) - self._supports_compiler() - if cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration('Cross-building not implemented') + raise ConanInvalidConfiguration("Cannot enable exceptions without rtti support") + + if cross_building(self): + # FIXME support cross compilation + # For Cross Building, LLVM builds a "native" toolchain in a subdirectory of the main build directory. + # This subdirectory would need to have the conan cmake configuration files for the build platform + # installed into it for a cross build to be successful. + # see also https://llvm.org/docs/HowToCrossCompileLLVM.html + raise ConanInvalidConfiguration("Cross compilation is not supported. Contributions are welcome!") + + def validate_build(self): + if os.getenv("CONAN_CENTER_BUILD_SERVICE") and self.settings.build_type == "Debug": + if self.settings.os == "Linux": + raise ConanInvalidConfiguration("Debug build is not supported on CCI due to resource limitations") + elif self.options.shared: + raise ConanInvalidConfiguration("Shared Debug build is not supported on CCI due to resource limitations") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True, - destination=self._source_subfolder) - self._patch_sources() + sources = self.conan_data["sources"][self.version] + if Version(self.version) < 15: + get(self, **sources, strip_root=True) + else: + # LLVM >=15 split up several components in its release, including cmake + get(self, **sources["llvm"], destination='llvm-main', strip_root=True) + get(self, **sources["cmake"], destination='cmake', strip_root=True) + + def _apply_resource_limits(self, cmake_definitions): + if os.getenv("CONAN_CENTER_BUILD_SERVICE"): + self.output.info("Applying CCI Resource Limits") + default_ram_per_compile_job = 16384 + default_ram_per_link_job = 2048 + else: + default_ram_per_compile_job = None + default_ram_per_link_job = None + + ram_per_compile_job = self.conf.get("user.llvm-core:ram_per_compile_job", default_ram_per_compile_job) + if ram_per_compile_job: + cmake_definitions["LLVM_RAM_PER_COMPILE_JOB"] = ram_per_compile_job + + ram_per_link_job = self.conf.get("user.llvm-core:ram_per_link_job", default_ram_per_link_job) + if ram_per_link_job: + cmake_definitions["LLVM_RAM_PER_LINK_JOB"] = ram_per_link_job + + @property + def _targets_to_build(self): + return self.options.targets if self.options.targets != "all" else self._all_targets + + @property + def _all_targets(self): + targets = LLVM_TARGETS if Version(self.version) >= 14 else LLVM_TARGETS - {"LoongArch", "VE"} + return ";".join(targets) + + def generate(self): + tc = CMakeToolchain(self, generator="Ninja") + # https://releases.llvm.org/12.0.0/docs/CMake.html + # https://releases.llvm.org/13.0.0/docs/CMake.html + # https://releases.llvm.org/19.1.0/docs/CMake.html + cmake_variables = { + # Enables LLVM to find conan libraries during try_compile + "CMAKE_TRY_COMPILE_CONFIGURATION": str(self.settings.build_type), + # LLVM has two separate concepts of a "shared library build". + # "BUILD_SHARED_LIBS" builds shared versions of all the static components + # "LLVM_BUILD_LLVM_DYLIB" builds a single shared library containing all components. + # It is likely the latter that the user expects by a "shared library" build. + "BUILD_SHARED_LIBS": False, + "LLVM_BUILD_LLVM_DYLIB": self.options.shared, + "LLVM_LINK_LLVM_DYLIB": self.options.shared, + "LLVM_DYLIB_COMPONENTS": self.options.components, + "LLVM_ABI_BREAKING_CHECKS": "WITH_ASSERTS", + "LLVM_INCLUDE_BENCHMARKS": False, + "LLVM_INCLUDE_TOOLS": True, + "LLVM_INCLUDE_EXAMPLES": False, + "LLVM_INCLUDE_TESTS": False, + "LLVM_ENABLE_IDE": False, + "LLVM_ENABLE_EH": self.options.exceptions, + "LLVM_ENABLE_RTTI": self.options.rtti, + "LLVM_ENABLE_THREADS": self.options.threads, + "LLVM_ENABLE_LTO": self.options.lto, + "LLVM_STATIC_LINK_CXX_STDLIB": self.options.static_stdlib, + "LLVM_ENABLE_UNWIND_TABLES": self.options.unwind_tables, + "LLVM_ENABLE_EXPENSIVE_CHECKS": self.options.expensive_checks, + "LLVM_ENABLE_ASSERTIONS": str(self.settings.build_type), + "LLVM_USE_PERF": self.options.use_perf, + "LLVM_ENABLE_LIBEDIT": self.options.get_safe("with_libedit", False), + "LLVM_ENABLE_Z3_SOLVER": self.options.with_z3, + "LLVM_ENABLE_FFI": self.options.with_ffi, + "LLVM_ENABLE_ZLIB": "FORCE_ON" if self.options.with_zlib else False, + "LLVM_ENABLE_LIBXML2": "FORCE_ON" if self.options.with_xml2 else False, + } + if Version(self.version) < 19: + cmake_variables["LLVM_ENABLE_TERMINFO"] = self.options.get_safe("with_terminfo") + else: + cmake_variables["LLVM_ENABLE_ZSTD"] = "FORCE_ON" if self.options.get_safe("with_zstd") else False + + if self.options.targets != "all": + cmake_variables["LLVM_TARGETS_TO_BUILD"] = self.options.targets + + self._apply_resource_limits(cmake_variables) + + if is_msvc(self): + build_type = str(self.settings.build_type).upper() + cmake_variables[f"LLVM_USE_CRT_{build_type}"] = msvc_runtime_flag(self) + + if not self.options.shared: + cmake_variables.update({ + "DISABLE_LLVM_LINK_LLVM_DYLIB": True, + "LLVM_ENABLE_PIC": self.options.get_safe("fPIC", default=True) + }) + + if self.options.use_sanitizer == "None": + cmake_variables["LLVM_USE_SANITIZER"] = "" + else: + cmake_variables["LLVM_USE_SANITIZER"] = self.options.use_sanitizer + + 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.cache_variables.update(cmake_variables) + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + @property + def _graphviz_file(self): + return PurePosixPath(self.build_folder) / "llvm-core.dot" def build(self): - self._patch_build() - cmake = self._configure_cmake() - cmake.configure() + apply_conandata_patches(self) + cmake = CMake(self) + graphviz_args = [f"--graphviz={self._graphviz_file}"] + + # components not exported or not of interest + exclude_patterns = [ + "LLVMTableGenGlobalISel.*", + "CONAN_LIB.*", + "LLVMExegesis.*", + "LLVMCFIVerify.*" + ] + graphviz_options = textwrap.dedent(f""" + set(GRAPHVIZ_EXECUTABLES OFF) + set(GRAPHVIZ_MODULE_LIBS OFF) + set(GRAPHVIZ_OBJECT_LIBS OFF) + set(GRAPHVIZ_IGNORE_TARGETS "{';'.join(exclude_patterns)}") + """) + save(self, PurePosixPath(self.build_folder) / "CMakeGraphVizOptions.cmake", graphviz_options) + if Version(self.version) < 18: + cmake.configure(cli_args=graphviz_args) + else: + cmake.configure(build_script_folder="llvm-main", cli_args=graphviz_args) cmake.build() @property - def _module_subfolder(self): - return os.path.join("lib", "cmake", "llvm") + def _package_folder_path(self): + return PurePosixPath(self.package_folder) @property - def _alias_module_file_rel_path(self): - return os.path.join(self._module_subfolder, "conan-official-{}-targets.cmake".format(self.name)) + def _llvm_source_folder_path(self): + if (Version(self.version) < 18): + return PurePosixPath(self.source_folder) - @property - def _old_alias_module_file_rel_path(self): - return os.path.join(self._module_subfolder, "conan-official-{}-old-targets.cmake".format(self.name)) - - def _create_cmake_module_alias_targets(self, 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)) - save(self, module_file, content) + return PurePosixPath(self.source_folder) / "llvm-main" - def package(self): - self.copy('LICENSE.TXT', dst='licenses', src=self._source_subfolder) - lib_path = os.path.join(self.package_folder, 'lib') + def _llvm_build_info(self): + cmake_config = Path(self._package_folder_path / "lib" / "cmake" / "llvm" / "LLVMConfig.cmake").read_text("utf-8") + components = components_from_dotfile(load(self, self._graphviz_file)) - cmake = self._configure_cmake() - cmake.install() + return { + "components": components, + "native_arch": re.search(r"""^set\(LLVM_NATIVE_ARCH (\S*)\)$""", cmake_config, re.MULTILINE).group(1) + } - if not self.options.shared: - for ext in ['.a', '.lib']: - lib = '**/lib/*LLVMTableGenGlobalISel{}'.format(ext) - self.copy(lib, dst='lib', keep_path=False) - lib = '*LLVMTableGenGlobalISel{}'.format(ext) - self.copy(lib, dst='lib', src='lib') - - CMake(self).configure(args=['--graphviz=graph/llvm.dot'], source_dir='.', build_dir='.') - with chdir(self, 'graph'): - dot_text = load(self, 'llvm.dot').replace('\r\n', '\n') - - dep_regex = re.compile(r'//\s(.+)\s->\s(.+)$', re.MULTILINE) - deps = re.findall(dep_regex, dot_text) - - dummy_targets = defaultdict(list) - for target, dep in deps: - if not target.startswith('LLVM'): - dummy_targets[target].append(dep) - - cmake_targets = { - 'libffi::libffi': 'ffi', - 'ZLIB::ZLIB': 'z', - 'Iconv::Iconv': 'iconv', - 'LibXml2::LibXml2': 'xml2' - } - - components = defaultdict(list) - for lib, dep in deps: - if not lib.startswith('LLVM'): - continue - elif dep.startswith('-delayload:'): - continue - elif dep.startswith('LLVM'): - components[dep] - elif dep in cmake_targets: - dep = cmake_targets[dep] - elif os.path.exists(dep): - dep = os.path.splitext(os.path.basename(dep))[0] - dep = dep.replace('lib', '') - dep = dep.replace('-l', '') - - if dep in dummy_targets.keys(): - components[lib].extend(dummy_targets[dep]) - components[lib] = list(set(components[lib])) - else: - components[lib].append(dep) - - alias_targets = {} - old_alias_targets = {} - for component, _ in components.items(): - alias_targets[component] = "LLVM::{}".format(component) - old_alias_targets["llvm-core::{}".format(component[4:].replace('LLVM', '').lower())] = "LLVM::{}".format(component) - - # 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._alias_module_file_rel_path), - alias_targets - ) + @property + def _cmake_module_path(self): + return PurePosixPath("lib") / "cmake" / "llvm" - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._old_alias_module_file_rel_path), - old_alias_targets - ) + @property + def _build_info_file(self): + return self._package_folder_path / self._cmake_module_path / "conan_llvm_build_info.json" - rmdir(self, os.path.join(self.package_folder, 'share')) + @property + def _build_module_file_rel_path(self): + return self._cmake_module_path / f"conan-official-{self.name}-variables.cmake" + + def _create_cmake_build_module(self, build_info, module_file): + targets_with_jit = ["X86", "PowerPC", "AArch64", "ARM", "Mips", "SystemZ"] + content = textwrap.dedent(f"""\ + set(LLVM_TOOLS_BINARY_DIR "${{CMAKE_CURRENT_LIST_DIR}}/../../../bin") + cmake_path(NORMAL_PATH LLVM_TOOLS_BINARY_DIR) + set(LLVM_PACKAGE_VERSION "{self.version}") + set(LLVM_AVAILABLE_LIBS "{';'.join(build_info['components'].keys())}") + set(LLVM_BUILD_TYPE "{self.settings.build_type}") + set(LLVM_CMAKE_DIR "${{CMAKE_CURRENT_LIST_DIR}}") + list(APPEND CMAKE_MODULE_DIR ${{CMAKE_CURRENT_LIST_DIR}}) + set(LLVM_ALL_TARGETS "{self._all_targets}") + set(LLVM_TARGETS_TO_BUILD "{self._targets_to_build}") + set(LLVM_TARGETS_WITH_JIT "{';'.join(targets_with_jit)}") + set(LLVM_NATIVE_ARCH "{build_info['native_arch']}") + set_property(GLOBAL PROPERTY LLVM_TARGETS_CONFIGURED On) + set_property(GLOBAL PROPERTY LLVM_COMPONENT_LIBS ${{LLVM_AVAILABLE_LIBS}}) + if (NOT TARGET intrinsics_gen) + add_custom_target(intrinsics_gen) + endif() + if (NOT TARGET omp_gen) + add_custom_target(omp_gen) + endif() + if (NOT TARGET acc_gen) + add_custom_target(acc_gen) + endif() + """) + save(self, module_file, content) - rm(self, "LLVMExports*.cmake", self.package_folder, recursive=True) - rename(self, os.path.join(self.package_folder, self._module_subfolder, 'LLVM-Config.cmake'), - os.path.join(self.package_folder, self._module_subfolder, 'LLVM-ConfigInternal.cmake')) - rename(self, os.path.join(self.package_folder, self._module_subfolder, 'LLVMConfig.cmake'), - os.path.join(self.package_folder, self._module_subfolder, 'LLVMConfigInternal.cmake')) + def _write_build_info(self): + build_info = self._llvm_build_info() + with open(self._build_info_file, "w", encoding="utf-8") as fp: + json.dump(build_info, fp, indent=2) - replace_in_file(self, os.path.join(self.package_folder, self._module_subfolder, 'AddLLVM.cmake'), - "include(LLVM-Config)", - "include(LLVM-ConfigInternal)") - replace_in_file(self, os.path.join(self.package_folder, self._module_subfolder, 'LLVMConfigInternal.cmake'), - "LLVM-Config.cmake", - "LLVM-ConfigInternal.cmake") + return build_info - for mask in ["Find*.cmake", "*Config.cmake", "*-config.cmake"]: - rm(self, mask, self.package_folder, recursive=True) + def _read_build_info(self) -> dict: + with open(self._build_info_file, encoding="utf-8") as fp: + return json.load(fp) + + def package(self): + copy(self, "LICENSE.TXT", self._llvm_source_folder_path, self._package_folder_path / "licenses") + cmake = CMake(self) + cmake.install() - for name in os.listdir(lib_path): - fullname = os.path.join(lib_path, name) - if 'LLVM' not in name and os.path.isfile(fullname): - os.remove(fullname) + build_info = self._write_build_info() + + cmake_folder = self._package_folder_path / "lib" / "cmake" / "llvm" + rm(self, "LLVMConfig.cmake", cmake_folder) + rm(self, "LLVMExports*", cmake_folder) + rm(self, "Find*", cmake_folder) + rm(self, "*.pdb", self._package_folder_path / "lib") + rm(self, "*.pdb", self._package_folder_path / "bin") + # need to rename this as Conan will flag it, but it's not actually a Config file and is needed by + # downstream packages + rename(self, cmake_folder / "LLVM-Config.cmake", cmake_folder / "LLVM-ConfigInternal.cmake") + replace_in_file(self, cmake_folder / "AddLLVM.cmake", "LLVM-Config", "LLVM-ConfigInternal") + rmdir(self, self._package_folder_path / "share") + if self.options.shared: + rm(self, "*.a", self._package_folder_path / "lib") - if not self.options.shared: - if self.options.get_safe('with_zlib', False): - if not 'z' in components['LLVMSupport']: - components['LLVMSupport'].append('z') - components_path = \ - os.path.join(self.package_folder, 'lib', 'components.json') - with open(components_path, 'w') as components_file: - json.dump(components, components_file, indent=4) - else: - suffixes = ['.dylib', '.so'] - for name in os.listdir(lib_path): - if not any(suffix in name for suffix in suffixes): - os.remove(os.path.join(lib_path, name)) + self._create_cmake_build_module( + build_info, + self._package_folder_path / self._build_module_file_rel_path + ) def package_info(self): self.cpp_info.set_property("cmake_file_name", "LLVM") + self.cpp_info.set_property("cmake_build_modules", + [self._build_module_file_rel_path, + self._cmake_module_path / "LLVM-ConfigInternal.cmake"] + ) + self.cpp_info.builddirs.append(self._cmake_module_path) - if self.options.shared: + if not self.options.shared: + build_info = self._read_build_info() + components = build_info["components"] + + for component_name, data in components.items(): + self.cpp_info.components[component_name].set_property("cmake_target_name", component_name) + self.cpp_info.components[component_name].libs = [component_name] + self.cpp_info.components[component_name].requires = data["requires"] + self.cpp_info.components[component_name].system_libs = data["system_libs"] + else: + self.cpp_info.set_property("cmake_target_name", "LLVM") self.cpp_info.libs = collect_libs(self) - if self.settings.os == 'Linux': - self.cpp_info.system_libs = ['pthread', 'rt', 'dl', 'm'] - elif self.settings.os == 'Macos': - self.cpp_info.system_libs = ['m'] - return - - components_path = \ - os.path.join(self.package_folder, 'lib', 'components.json') - with open(components_path, 'r') as components_file: - components = json.load(components_file) - - dependencies = ['ffi', 'z', 'iconv', 'xml2'] - targets = { - 'ffi': 'libffi::libffi', - 'z': 'zlib::zlib', - 'xml2': 'libxml2::libxml2' - } - - for component, deps in components.items(): - self.cpp_info.components[component].libs = [component] - self.cpp_info.components[component].requires.extend(dep for dep in deps if dep.startswith('LLVM')) - - for lib, target in targets.items(): - if lib in deps: - self.cpp_info.components[component].requires.append(target) - - self.cpp_info.components[component].system_libs = [ - dep for dep in deps - if not dep.startswith('LLVM') and dep not in dependencies - ] - - self.cpp_info.components[component].set_property("cmake_target_name", component) - self.cpp_info.components[component].builddirs.append(self._module_subfolder) - - 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].build_modules["cmake_find_package"].extend([ - self._alias_module_file_rel_path, - self._old_alias_module_file_rel_path, - ]) - self.cpp_info.components[component].build_modules["cmake_find_package_multi"].extend([ - self._alias_module_file_rel_path, - self._old_alias_module_file_rel_path, - ]) - - if self.options.use_llvm_cmake_files: - self.cpp_info.components[component].build_modules["cmake_find_package"].append( - os.path.join(self._module_subfolder, "LLVMConfigInternal.cmake") - ) - self.cpp_info.components[component].build_modules["cmake_find_package_multi"].append( - os.path.join(self._module_subfolder, "LLVMConfigInternal.cmake") - ) - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "LLVM" - self.cpp_info.names["cmake_find_package_multi"] = "LLVM" diff --git a/recipes/llvm-core/all/patches/11x/0000-cmake-dependencies.patch b/recipes/llvm-core/all/patches/11x/0000-cmake-dependencies.patch new file mode 100644 index 0000000000000..3da6ed6f9b317 --- /dev/null +++ b/recipes/llvm-core/all/patches/11x/0000-cmake-dependencies.patch @@ -0,0 +1,118 @@ +diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake +index 90e5d327c75..c8bcb1afb76 100644 +--- a/cmake/config-ix.cmake ++++ b/cmake/config-ix.cmake +@@ -5,6 +5,7 @@ endif() + + include(CheckIncludeFile) + include(CheckLibraryExists) ++include(CMakePushCheckState) + include(CheckSymbolExists) + include(CheckFunctionExists) + include(CheckStructHasMember) +@@ -56,13 +57,27 @@ check_include_file(sys/types.h HAVE_SYS_TYPES_H) + check_include_file(termios.h HAVE_TERMIOS_H) + check_include_file(unistd.h HAVE_UNISTD_H) + check_include_file(valgrind/valgrind.h HAVE_VALGRIND_VALGRIND_H) +-check_include_file(zlib.h HAVE_ZLIB_H) ++ ++if(LLVM_ENABLE_ZLIB) ++ find_package(ZLIB REQUIRED) ++ cmake_push_check_state() ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) ++ check_include_file(zlib.h HAVE_ZLIB_H) ++ cmake_pop_check_state() ++endif() ++ + check_include_file(fenv.h HAVE_FENV_H) + check_symbol_exists(FE_ALL_EXCEPT "fenv.h" HAVE_DECL_FE_ALL_EXCEPT) + check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT) + + check_include_file(mach/mach.h HAVE_MACH_MACH_H) +-check_include_file(histedit.h HAVE_HISTEDIT_H) ++if(LLVM_ENABLE_LIBEDIT) ++ find_package(editline REQUIRED) ++ cmake_push_check_state() ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${editline_INCLUDE_DIRS}) ++ check_include_file(histedit.h HAVE_HISTEDIT_H) ++ cmake_pop_check_state() ++endif() + check_include_file(CrashReporterClient.h HAVE_CRASHREPORTERCLIENT_H) + if(APPLE) + include(CheckCSourceCompiles) +@@ -118,24 +133,21 @@ endif() + # Don't look for these libraries if we're using MSan, since uninstrumented third + # party code may call MSan interceptors like strlen, leading to false positives. + if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") +- set(HAVE_LIBZ 0) + if(LLVM_ENABLE_ZLIB) +- foreach(library z zlib_static zlib) +- string(TOUPPER ${library} library_suffix) +- check_library_exists(${library} compress2 "" HAVE_LIBZ_${library_suffix}) +- if(HAVE_LIBZ_${library_suffix}) +- set(HAVE_LIBZ 1) +- set(ZLIB_LIBRARIES "${library}") +- break() +- endif() +- endforeach() ++ cmake_push_check_state() ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) ++ check_symbol_exists(compress2 zlib.h HAVE_LIBZ) ++ cmake_pop_check_state() + endif() + +- # Don't look for these libraries on Windows. +- if (NOT PURE_WINDOWS) + # Skip libedit if using ASan as it contains memory leaks. + if (LLVM_ENABLE_LIBEDIT AND HAVE_HISTEDIT_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") ++ cmake_push_check_state() ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${editline_INCLUDE_DIRS}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${editline_LIBRARIES}) + check_library_exists(edit el_init "" HAVE_LIBEDIT) ++ cmake_pop_check_state() + else() + set(HAVE_LIBEDIT 0) + endif() +@@ -157,19 +169,11 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c) + set(LLVM_LIBXML2_ENABLED 0) + set(LIBXML2_FOUND 0) +- if((LLVM_ENABLE_LIBXML2) AND ((CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) OR APPLE)) +- find_package(LibXml2) +- if (LIBXML2_FOUND) ++ if(LLVM_ENABLE_LIBXML2) ++ find_package(LibXml2 REQUIRED) + set(LLVM_LIBXML2_ENABLED 1) +- if ((CMAKE_OSX_SYSROOT) AND (EXISTS ${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR})) +- include_directories(${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR}) +- else() +- include_directories(${LIBXML2_INCLUDE_DIR}) +- endif() +- endif() + endif() + endif() +-endif() + + if (LLVM_ENABLE_LIBXML2 STREQUAL "FORCE_ON" AND NOT LLVM_LIBXML2_ENABLED) + message(FATAL_ERROR "Failed to congifure libxml2") +@@ -517,7 +521,7 @@ else( LLVM_ENABLE_THREADS ) + message(STATUS "Threads disabled.") + endif() + +-if (LLVM_ENABLE_ZLIB ) ++if (LLVM_ENABLE_ZLIB STREQUAL "FORCE_ON") + # Check if zlib is available in the system. + if ( NOT HAVE_ZLIB_H OR NOT HAVE_LIBZ ) + set(LLVM_ENABLE_ZLIB 0) +diff --git a/lib/LineEditor/CMakeLists.txt b/lib/LineEditor/CMakeLists.txt +index 59190379406..3952bf0144f 100644 +--- a/lib/LineEditor/CMakeLists.txt ++++ b/lib/LineEditor/CMakeLists.txt +@@ -1,5 +1,5 @@ + if(HAVE_LIBEDIT) +- set(link_libs edit) ++ set(link_libs editline::editline) + endif() + + add_llvm_component_library(LLVMLineEditor diff --git a/recipes/llvm-core/all/patches/11x/0001-calculate-job-pools.patch b/recipes/llvm-core/all/patches/11x/0001-calculate-job-pools.patch new file mode 100644 index 0000000000000..b00101aa4e526 --- /dev/null +++ b/recipes/llvm-core/all/patches/11x/0001-calculate-job-pools.patch @@ -0,0 +1,42 @@ +diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake +index 5ef22eb493b..3478c7ef6eb 100644 +--- a/cmake/modules/HandleLLVMOptions.cmake ++++ b/cmake/modules/HandleLLVMOptions.cmake +@@ -27,6 +27,19 @@ string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO) + # The following only works with the Ninja generator in CMake >= 3.0. + set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING + "Define the maximum number of concurrent compilation jobs (Ninja only).") ++cmake_host_system_information(RESULT AVAILABLE_PHYSICAL_MEMORY QUERY AVAILABLE_PHYSICAL_MEMORY) ++cmake_host_system_information(RESULT NUMBER_OF_LOGICAL_CORES QUERY NUMBER_OF_LOGICAL_CORES) ++if(LLVM_RAM_PER_COMPILE_JOB) ++ math(EXPR memory_available_jobs "${AVAILABLE_PHYSICAL_MEMORY} / ${LLVM_RAM_PER_COMPILE_JOB}" OUTPUT_FORMAT DECIMAL) ++ if (memory_available_jobs LESS 1) ++ set(memory_available_jobs 1) ++ endif() ++ if (memory_available_jobs LESS NUMBER_OF_LOGICAL_CORES) ++ set(LLVM_PARALLEL_COMPILE_JOBS "${memory_available_jobs}") ++ else() ++ set(LLVM_PARALLEL_COMPILE_JOBS "${NUMBER_OF_LOGICAL_CORES}") ++ endif() ++endif() + if(LLVM_PARALLEL_COMPILE_JOBS) + if(NOT CMAKE_GENERATOR STREQUAL "Ninja") + message(WARNING "Job pooling is only available with Ninja generators.") +@@ -38,6 +51,17 @@ endif() + + set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING + "Define the maximum number of concurrent link jobs (Ninja only).") ++if(LLVM_RAM_PER_LINK_JOB) ++ math(EXPR memory_available_jobs "${AVAILABLE_PHYSICAL_MEMORY} / ${LLVM_RAM_PER_LINK_JOB}" OUTPUT_FORMAT DECIMAL) ++ if (memory_available_jobs LESS 1) ++ set(memory_available_jobs 1) ++ endif() ++ if (memory_available_jobs LESS NUMBER_OF_LOGICAL_CORES) ++ set(LLVM_PARALLEL_LINK_JOBS "${memory_available_jobs}") ++ else() ++ set(LLVM_PARALLEL_LINK_JOBS "${NUMBER_OF_LOGICAL_CORES}") ++ endif() ++endif() + if(CMAKE_GENERATOR STREQUAL "Ninja") + if(NOT LLVM_PARALLEL_LINK_JOBS AND uppercase_LLVM_ENABLE_LTO STREQUAL "THIN") + message(STATUS "ThinLTO provides its own parallel linking - limiting parallel link jobs to 2.") diff --git a/recipes/llvm-core/all/patches/11x/0002-missing-includes.patch b/recipes/llvm-core/all/patches/11x/0002-missing-includes.patch new file mode 100644 index 0000000000000..929a539e77369 --- /dev/null +++ b/recipes/llvm-core/all/patches/11x/0002-missing-includes.patch @@ -0,0 +1,24 @@ +diff --git a/include/llvm/Support/Signals.h b/include/llvm/Support/Signals.h +index e0a18e72f2a..148216b8f87 100644 +--- a/include/llvm/Support/Signals.h ++++ b/include/llvm/Support/Signals.h +@@ -14,6 +14,7 @@ + #ifndef LLVM_SUPPORT_SIGNALS_H + #define LLVM_SUPPORT_SIGNALS_H + ++#include + #include + + namespace llvm { +diff --git a/utils/benchmark/src/benchmark_register.h b/utils/benchmark/src/benchmark_register.h +index 0705e219f2f..4caa5ad4da0 100644 +--- a/utils/benchmark/src/benchmark_register.h ++++ b/utils/benchmark/src/benchmark_register.h +@@ -1,6 +1,7 @@ + #ifndef BENCHMARK_REGISTER_H + #define BENCHMARK_REGISTER_H + ++#include + #include + + #include "check.h" diff --git a/recipes/llvm-core/all/patches/11x/0003-no-build-with-install-rpath.patch b/recipes/llvm-core/all/patches/11x/0003-no-build-with-install-rpath.patch new file mode 100644 index 0000000000000..e56177aab947f --- /dev/null +++ b/recipes/llvm-core/all/patches/11x/0003-no-build-with-install-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index b74adc11ade9..8c70fe15d2a0 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -2081,7 +2081,7 @@ function(llvm_setup_rpath name) + endif() + + set_target_properties(${name} PROPERTIES +- BUILD_WITH_INSTALL_RPATH On ++ BUILD_WITH_INSTALL_RPATH OFF + INSTALL_RPATH "${_install_rpath}" + ${_install_name_dir}) + endfunction() diff --git a/recipes/llvm-core/all/patches/11x/0004-remove-lto-exports.patch b/recipes/llvm-core/all/patches/11x/0004-remove-lto-exports.patch new file mode 100644 index 0000000000000..6dea8a2419a11 --- /dev/null +++ b/recipes/llvm-core/all/patches/11x/0004-remove-lto-exports.patch @@ -0,0 +1,32 @@ +diff --git a/tools/lto/lto.exports b/tools/lto/lto.exports +index 1f0a6b23d3fd..2871abd34e40 100644 +--- a/tools/lto/lto.exports ++++ b/tools/lto/lto.exports +@@ -43,12 +43,6 @@ lto_codegen_optimize + lto_codegen_compile_optimized + lto_codegen_set_should_internalize + lto_codegen_set_should_embed_uselists +-LLVMCreateDisasm +-LLVMCreateDisasmCPU +-LLVMDisasmDispose +-LLVMDisasmInstruction +-LLVMSetDisasmOptions +-LLVMCreateDisasmCPUFeatures + thinlto_create_codegen + thinlto_codegen_dispose + thinlto_codegen_add_module +diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt +index e948496c603a..97bc45e110dc 100644 +--- a/tools/remarks-shlib/CMakeLists.txt ++++ b/tools/remarks-shlib/CMakeLists.txt +@@ -6,7 +6,9 @@ set(SOURCES + libremarks.cpp + ) + +-set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++if (NOT (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB)) ++ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++endif() + + add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES}) + diff --git a/recipes/llvm-core/all/patches/11x/11.1.0-cmake.patch b/recipes/llvm-core/all/patches/11x/11.1.0-cmake.patch deleted file mode 100644 index 6f2c7682aa4e0..0000000000000 --- a/recipes/llvm-core/all/patches/11x/11.1.0-cmake.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- cmake/config-ix.cmake -+++ cmake/config-ix.cmake -@@ -159,6 +159,9 @@ - set(LIBXML2_FOUND 0) - if((LLVM_ENABLE_LIBXML2) AND ((CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) OR APPLE)) - find_package(LibXml2) -+ set(LIBXML2_FOUND 1) -+ list(GET LibXml2_INCLUDE_DIRS -1 LIBXML2_INCLUDE_DIR) -+ set(LIBXML2_LIBRARIES ${LibXml2_LIBRARIES}) - if (LIBXML2_FOUND) - set(LLVM_LIBXML2_ENABLED 1) - if ((CMAKE_OSX_SYSROOT) AND (EXISTS ${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR})) -@@ -321,7 +321,7 @@ - message(FATAL_ERROR "libffi includes are not found.") - endif() - -- find_library(FFI_LIBRARY_PATH ffi PATHS ${FFI_LIBRARY_DIR}) -+ find_library(FFI_LIBRARY_PATH NAMES ffi libffi PATHS ${FFI_LIBRARY_DIR}) - if( NOT FFI_LIBRARY_PATH ) - message(FATAL_ERROR "libffi is not found.") - endif() ---- cmake/modules/TableGen.cmake -+++ cmake/modules/TableGen.cmake -@@ -138,12 +138,7 @@ - macro(add_tablegen target project) - set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS}) - set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen) -- -- # CMake-3.9 doesn't let compilation units depend on their dependent libraries. -- if(NOT (CMAKE_GENERATOR STREQUAL "Ninja" AND NOT CMAKE_VERSION VERSION_LESS 3.9) AND NOT XCODE) -- # FIXME: It leaks to user, callee of add_tablegen. -- set(LLVM_ENABLE_OBJLIB ON) -- endif() -+ set(LLVM_ENABLE_OBJLIB OFF) - - add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN}) - set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS}) ---- lib/WindowsManifest/CMakeLists.txt -+++ lib/WindowsManifest/CMakeLists.txt -@@ -8,16 +8,6 @@ - if(LIBXML2_LIBRARIES) - target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES}) - -- get_filename_component(xml2_library ${LIBXML2_LIBRARIES} NAME) -- if (CMAKE_STATIC_LIBRARY_PREFIX AND -- xml2_library MATCHES "^${CMAKE_STATIC_LIBRARY_PREFIX}.*${CMAKE_STATIC_LIBRARY_SUFFIX}$") -- string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" xml2_library ${xml2_library}) -- string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library}) -- elseif (CMAKE_SHARED_LIBRARY_PREFIX AND -- xml2_library MATCHES "^${CMAKE_SHARED_LIBRARY_PREFIX}.*${CMAKE_SHARED_LIBRARY_SUFFIX}$") -- string(REGEX REPLACE "^${CMAKE_SHARED_LIBRARY_PREFIX}" "" xml2_library ${xml2_library}) -- string(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library}) -- endif() - set_property(TARGET LLVMWindowsManifest PROPERTY -- LLVM_SYSTEM_LIBS ${xml2_library}) -+ LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) - endif() diff --git a/recipes/llvm-core/all/patches/11x/11.1.0-native.patch b/recipes/llvm-core/all/patches/11x/11.1.0-native.patch deleted file mode 100644 index c541a76820341..0000000000000 --- a/recipes/llvm-core/all/patches/11x/11.1.0-native.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -942,10 +942,6 @@ - include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}) - - # when crosscompiling import the executable targets from a file --if(LLVM_USE_HOST_TOOLS) -- include(CrossCompile) -- llvm_create_cross_target(LLVM NATIVE "" Release) --endif(LLVM_USE_HOST_TOOLS) - if(LLVM_TARGET_IS_CROSSCOMPILE_HOST) - # Dummy use to avoid CMake Warning: Manually-specified variables were not used - # (this is a variable that CrossCompile sets on recursive invocations) ---- cmake/modules/TableGen.cmake -+++ cmake/modules/TableGen.cmake -@@ -150,33 +150,6 @@ - set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE) - set(${project}_TABLEGEN_TARGET ${${project}_TABLEGEN} PARENT_SCOPE) - -- if(LLVM_USE_HOST_TOOLS) -- if( ${${project}_TABLEGEN} STREQUAL "${target}" ) -- # The NATIVE tablegen executable *must* depend on the current target one -- # otherwise the native one won't get rebuilt when the tablgen sources -- # change, and we end up with incorrect builds. -- build_native_tool(${target} ${project}_TABLEGEN_EXE DEPENDS ${target}) -- set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE) -- -- add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE}) -- set(${project}_TABLEGEN_TARGET ${project}-tablegen-host PARENT_SCOPE) -- -- # Create an artificial dependency between tablegen projects, because they -- # compile the same dependencies, thus using the same build folders. -- # FIXME: A proper fix requires sequentially chaining tablegens. -- if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host AND -- TARGET LLVM-tablegen-host) -- add_dependencies(${project}-tablegen-host LLVM-tablegen-host) -- endif() -- -- # If we're using the host tablegen, and utils were not requested, we have no -- # need to build this tablegen. -- if ( NOT LLVM_BUILD_UTILS ) -- set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL ON) -- endif() -- endif() -- endif() -- - if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) - set(export_to_llvmexports) - if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR ---- tools/llvm-config/CMakeLists.txt -+++ tools/llvm-config/CMakeLists.txt -@@ -77,11 +77,3 @@ - - # Add the dependency on the generation step. - add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH}) -- --if(CMAKE_CROSSCOMPILING AND NOT LLVM_CONFIG_PATH) -- build_native_tool(llvm-config LLVM_CONFIG_PATH) -- set(LLVM_CONFIG_PATH "${LLVM_CONFIG_PATH}" CACHE STRING "") -- -- add_custom_target(NativeLLVMConfig DEPENDS ${LLVM_CONFIG_PATH}) -- add_dependencies(llvm-config NativeLLVMConfig) --endif() ---- tools/llvm-shlib/CMakeLists.txt -+++ tools/llvm-shlib/CMakeLists.txt -@@ -155,13 +155,8 @@ - - set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports) - if(NOT LLVM_NM) -- if(CMAKE_CROSSCOMPILING) -- build_native_tool(llvm-nm llvm_nm) -- set(llvm_nm_target "${llvm_nm}") -- else() -- set(llvm_nm $) -- set(llvm_nm_target llvm-nm) -- endif() -+ set(llvm_nm $) -+ set(llvm_nm_target llvm-nm) - else() - set(llvm_nm ${LLVM_NM}) - set(llvm_nm_target "") diff --git a/recipes/llvm-core/all/patches/12x/0000-cmake-dependencies.patch b/recipes/llvm-core/all/patches/12x/0000-cmake-dependencies.patch new file mode 100644 index 0000000000000..319d08bc1921c --- /dev/null +++ b/recipes/llvm-core/all/patches/12x/0000-cmake-dependencies.patch @@ -0,0 +1,92 @@ +diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake +index 818fafbce14..8ef381257b6 100644 +--- a/cmake/config-ix.cmake ++++ b/cmake/config-ix.cmake +@@ -63,7 +63,13 @@ check_symbol_exists(FE_ALL_EXCEPT "fenv.h" HAVE_DECL_FE_ALL_EXCEPT) + check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT) + + check_include_file(mach/mach.h HAVE_MACH_MACH_H) +-check_include_file(histedit.h HAVE_HISTEDIT_H) ++if (LLVM_ENABLE_LIBEDIT) ++ find_package(editline REQUIRED) ++ cmake_push_check_state() ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${editline_INCLUDE_DIRS}) ++ check_include_file(histedit.h HAVE_HISTEDIT_H) ++ cmake_pop_check_state() ++endif() + check_include_file(CrashReporterClient.h HAVE_CRASHREPORTERCLIENT_H) + if(APPLE) + include(CheckCSourceCompiles) +@@ -127,7 +133,7 @@ if(LLVM_ENABLE_ZLIB) + # library on a 64-bit system which would result in a link-time failure. + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) +- list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) + check_symbol_exists(compress2 zlib.h HAVE_ZLIB) + cmake_pop_check_state() + if(LLVM_ENABLE_ZLIB STREQUAL FORCE_ON AND NOT HAVE_ZLIB) +@@ -165,7 +171,11 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + if (NOT PURE_WINDOWS) + # Skip libedit if using ASan as it contains memory leaks. + if (LLVM_ENABLE_LIBEDIT AND HAVE_HISTEDIT_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") ++ cmake_push_check_state() ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${editline_INCLUDE_DIRS}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${editline_LIBRARIES}) + check_library_exists(edit el_init "" HAVE_LIBEDIT) ++ cmake_pop_check_state() + else() + set(HAVE_LIBEDIT 0) + endif() +diff --git a/lib/LineEditor/CMakeLists.txt b/lib/LineEditor/CMakeLists.txt +index 61328f76905..b95d073d972 100644 +--- a/lib/LineEditor/CMakeLists.txt ++++ b/lib/LineEditor/CMakeLists.txt +@@ -1,5 +1,5 @@ + if(HAVE_LIBEDIT) +- set(link_libs edit) ++ set(link_libs editline::editline) + endif() + + add_llvm_component_library(LLVMLineEditor +diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt +index cdee11412eb..f32a7b7909d 100644 +--- a/lib/Support/CMakeLists.txt ++++ b/lib/Support/CMakeLists.txt +@@ -236,14 +236,7 @@ set(llvm_system_libs ${system_libs}) + # This block is only needed for llvm-config. When we deprecate llvm-config and + # move to using CMake export, this block can be removed. + if(LLVM_ENABLE_ZLIB) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT zlib_library) +- get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) +- endif() ++ set(zlib_library ${ZLIB_LIBRARIES}) + get_library_name(${zlib_library} zlib_library) + set(llvm_system_libs ${llvm_system_libs} "${zlib_library}") + endif() +diff --git a/lib/WindowsManifest/CMakeLists.txt b/lib/WindowsManifest/CMakeLists.txt +index 8134ac8c815..652062f7fb9 100644 +--- a/lib/WindowsManifest/CMakeLists.txt ++++ b/lib/WindowsManifest/CMakeLists.txt +@@ -21,14 +21,8 @@ add_llvm_component_library(LLVMWindowsManifest + # This block is only needed for llvm-config. When we deprecate llvm-config and + # move to using CMake export, this block can be removed. + if(LLVM_ENABLE_LIBXML2) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT zlib_library) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) +- endif() ++ find_package(libxml2 REQUIRED CONFIG) ++ set(libxml2_library ${libxml2_LIBRARIES}) + get_library_name(${libxml2_library} libxml2_library) + set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library}) + endif() diff --git a/recipes/llvm-core/all/patches/12x/0001-calculate-job-pools.patch b/recipes/llvm-core/all/patches/12x/0001-calculate-job-pools.patch new file mode 100644 index 0000000000000..ab29c3a894ccd --- /dev/null +++ b/recipes/llvm-core/all/patches/12x/0001-calculate-job-pools.patch @@ -0,0 +1,42 @@ +diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake +index 5d4d692a70a..5776a85b747 100644 +--- a/cmake/modules/HandleLLVMOptions.cmake ++++ b/cmake/modules/HandleLLVMOptions.cmake +@@ -27,6 +27,19 @@ string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO) + # The following only works with the Ninja generator in CMake >= 3.0. + set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING + "Define the maximum number of concurrent compilation jobs (Ninja only).") ++cmake_host_system_information(RESULT AVAILABLE_PHYSICAL_MEMORY QUERY AVAILABLE_PHYSICAL_MEMORY) ++cmake_host_system_information(RESULT NUMBER_OF_LOGICAL_CORES QUERY NUMBER_OF_LOGICAL_CORES) ++if(LLVM_RAM_PER_COMPILE_JOB) ++ math(EXPR memory_available_jobs "${AVAILABLE_PHYSICAL_MEMORY} / ${LLVM_RAM_PER_COMPILE_JOB}" OUTPUT_FORMAT DECIMAL) ++ if (memory_available_jobs LESS 1) ++ set(memory_available_jobs 1) ++ endif() ++ if (memory_available_jobs LESS NUMBER_OF_LOGICAL_CORES) ++ set(LLVM_PARALLEL_COMPILE_JOBS "${memory_available_jobs}") ++ else() ++ set(LLVM_PARALLEL_COMPILE_JOBS "${NUMBER_OF_LOGICAL_CORES}") ++ endif() ++endif() + if(LLVM_PARALLEL_COMPILE_JOBS) + if(NOT CMAKE_GENERATOR STREQUAL "Ninja") + message(WARNING "Job pooling is only available with Ninja generators.") +@@ -38,6 +51,17 @@ endif() + + set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING + "Define the maximum number of concurrent link jobs (Ninja only).") ++if(LLVM_RAM_PER_LINK_JOB) ++ math(EXPR memory_available_jobs "${AVAILABLE_PHYSICAL_MEMORY} / ${LLVM_RAM_PER_LINK_JOB}" OUTPUT_FORMAT DECIMAL) ++ if (memory_available_jobs LESS 1) ++ set(memory_available_jobs 1) ++ endif() ++ if (memory_available_jobs LESS NUMBER_OF_LOGICAL_CORES) ++ set(LLVM_PARALLEL_LINK_JOBS "${memory_available_jobs}") ++ else() ++ set(LLVM_PARALLEL_LINK_JOBS "${NUMBER_OF_LOGICAL_CORES}") ++ endif() ++endif() + if(CMAKE_GENERATOR STREQUAL "Ninja") + if(NOT LLVM_PARALLEL_LINK_JOBS AND uppercase_LLVM_ENABLE_LTO STREQUAL "THIN") + message(STATUS "ThinLTO provides its own parallel linking - limiting parallel link jobs to 2.") diff --git a/recipes/llvm-core/all/patches/12x/0002-missing-includes.patch b/recipes/llvm-core/all/patches/12x/0002-missing-includes.patch new file mode 100644 index 0000000000000..c7cfb90318b49 --- /dev/null +++ b/recipes/llvm-core/all/patches/12x/0002-missing-includes.patch @@ -0,0 +1,12 @@ +diff --git a/include/llvm/Support/Signals.h b/include/llvm/Support/Signals.h +index 44f5a750ff5..937e0572d4a 100644 +--- a/include/llvm/Support/Signals.h ++++ b/include/llvm/Support/Signals.h +@@ -14,6 +14,7 @@ + #ifndef LLVM_SUPPORT_SIGNALS_H + #define LLVM_SUPPORT_SIGNALS_H + ++#include + #include + + namespace llvm { diff --git a/recipes/llvm-core/all/patches/12x/0003-no-build-with-install-rpath.patch b/recipes/llvm-core/all/patches/12x/0003-no-build-with-install-rpath.patch new file mode 100644 index 0000000000000..df143f02d6491 --- /dev/null +++ b/recipes/llvm-core/all/patches/12x/0003-no-build-with-install-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index 97c9980c7de3..23fead47c2d7 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -2118,7 +2118,7 @@ function(llvm_setup_rpath name) + + # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. + if("${CMAKE_BUILD_RPATH}" STREQUAL "") +- set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) ++ set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH OFF) + endif() + + set_target_properties(${name} PROPERTIES diff --git a/recipes/llvm-core/all/patches/12x/0004-remove-lto-exports.patch b/recipes/llvm-core/all/patches/12x/0004-remove-lto-exports.patch new file mode 100644 index 0000000000000..60db5a636b646 --- /dev/null +++ b/recipes/llvm-core/all/patches/12x/0004-remove-lto-exports.patch @@ -0,0 +1,32 @@ +diff --git a/tools/lto/lto.exports b/tools/lto/lto.exports +index 1f0a6b23d3fd..2871abd34e40 100644 +--- a/tools/lto/lto.exports ++++ b/tools/lto/lto.exports +@@ -43,12 +43,6 @@ lto_codegen_optimize + lto_codegen_compile_optimized + lto_codegen_set_should_internalize + lto_codegen_set_should_embed_uselists +-LLVMCreateDisasm +-LLVMCreateDisasmCPU +-LLVMDisasmDispose +-LLVMDisasmInstruction +-LLVMSetDisasmOptions +-LLVMCreateDisasmCPUFeatures + thinlto_create_codegen + thinlto_codegen_dispose + thinlto_codegen_add_module +diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt +index 865436247270..aa11669d9a75 100644 +--- a/tools/remarks-shlib/CMakeLists.txt ++++ b/tools/remarks-shlib/CMakeLists.txt +@@ -9,7 +9,9 @@ if(LLVM_ENABLE_PIC) + libremarks.cpp + ) + +- set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++ if (NOT (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB)) ++ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++ endif() + + add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES}) + diff --git a/recipes/llvm-core/all/patches/12x/12.0.0-cmake.patch b/recipes/llvm-core/all/patches/12x/12.0.0-cmake.patch deleted file mode 100644 index 8d3f7dbf7cf98..0000000000000 --- a/recipes/llvm-core/all/patches/12x/12.0.0-cmake.patch +++ /dev/null @@ -1,55 +0,0 @@ ---- cmake/config-ix.cmake -+++ cmake/config-ix.cmake -@@ -143,6 +143,9 @@ - elseif(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") - find_package(LibXml2) - endif() -+ set(LIBXML2_FOUND 1) -+ list(GET LibXml2_INCLUDE_DIRS -1 LIBXML2_INCLUDE_DIR) -+ set(LIBXML2_LIBRARIES ${LibXml2_LIBRARIES}) - if(LibXml2_FOUND) - # Check if libxml2 we found is usable; for example, we may have found a 32-bit - # library on a 64-bit system which would result in a link-time failure. -@@ -335,7 +335,7 @@ - message(FATAL_ERROR "libffi includes are not found.") - endif() - -- find_library(FFI_LIBRARY_PATH ffi PATHS ${FFI_LIBRARY_DIR}) -+ find_library(FFI_LIBRARY_PATH NAMES ffi libffi PATHS ${FFI_LIBRARY_DIR}) - if( NOT FFI_LIBRARY_PATH ) - message(FATAL_ERROR "libffi is not found.") - endif() ---- cmake/modules/TableGen.cmake -+++ cmake/modules/TableGen.cmake -@@ -132,12 +132,7 @@ - macro(add_tablegen target project) - set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS}) - set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen) -- -- # CMake doesn't let compilation units depend on their dependent libraries on some generators. -- if(NOT CMAKE_GENERATOR STREQUAL "Ninja" AND NOT XCODE) -- # FIXME: It leaks to user, callee of add_tablegen. -- set(LLVM_ENABLE_OBJLIB ON) -- endif() -+ set(LLVM_ENABLE_OBJLIB OFF) - - add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN}) - set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS}) ---- lib/WindowsManifest/CMakeLists.txt -+++ lib/WindowsManifest/CMakeLists.txt -@@ -21,14 +21,5 @@ - # This block is only needed for llvm-config. When we deprecate llvm-config and - # move to using CMake export, this block can be removed. - if(LLVM_ENABLE_LIBXML2) -- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. -- if(CMAKE_BUILD_TYPE) -- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) -- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type}) -- endif() -- if(NOT zlib_library) -- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) -- endif() -- get_library_name(${libxml2_library} libxml2_library) -- set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library}) -+ set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) - endif() diff --git a/recipes/llvm-core/all/patches/12x/12.0.0-native.patch b/recipes/llvm-core/all/patches/12x/12.0.0-native.patch deleted file mode 100644 index f5c6d542fab8f..0000000000000 --- a/recipes/llvm-core/all/patches/12x/12.0.0-native.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -891,10 +891,6 @@ - include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}) - - # when crosscompiling import the executable targets from a file --if(LLVM_USE_HOST_TOOLS) -- include(CrossCompile) -- llvm_create_cross_target(LLVM NATIVE "" Release) --endif(LLVM_USE_HOST_TOOLS) - if(LLVM_TARGET_IS_CROSSCOMPILE_HOST) - # Dummy use to avoid CMake Warning: Manually-specified variables were not used - # (this is a variable that CrossCompile sets on recursive invocations) ---- cmake/modules/TableGen.cmake -+++ cmake/modules/TableGen.cmake -@@ -144,33 +144,6 @@ - set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE) - set(${project}_TABLEGEN_TARGET ${${project}_TABLEGEN} PARENT_SCOPE) - -- if(LLVM_USE_HOST_TOOLS) -- if( ${${project}_TABLEGEN} STREQUAL "${target}" ) -- # The NATIVE tablegen executable *must* depend on the current target one -- # otherwise the native one won't get rebuilt when the tablgen sources -- # change, and we end up with incorrect builds. -- build_native_tool(${target} ${project}_TABLEGEN_EXE DEPENDS ${target}) -- set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE) -- -- add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE}) -- set(${project}_TABLEGEN_TARGET ${project}-tablegen-host PARENT_SCOPE) -- -- # Create an artificial dependency between tablegen projects, because they -- # compile the same dependencies, thus using the same build folders. -- # FIXME: A proper fix requires sequentially chaining tablegens. -- if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host AND -- TARGET LLVM-tablegen-host) -- add_dependencies(${project}-tablegen-host LLVM-tablegen-host) -- endif() -- -- # If we're using the host tablegen, and utils were not requested, we have no -- # need to build this tablegen. -- if ( NOT LLVM_BUILD_UTILS ) -- set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL ON) -- endif() -- endif() -- endif() -- - if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) - set(export_to_llvmexports) - if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR ---- tools/llvm-config/CMakeLists.txt -+++ tools/llvm-config/CMakeLists.txt -@@ -75,11 +75,3 @@ - - # Add the dependency on the generation step. - add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH}) -- --if(CMAKE_CROSSCOMPILING AND NOT LLVM_CONFIG_PATH) -- build_native_tool(llvm-config LLVM_CONFIG_PATH) -- set(LLVM_CONFIG_PATH "${LLVM_CONFIG_PATH}" CACHE STRING "") -- -- add_custom_target(NativeLLVMConfig DEPENDS ${LLVM_CONFIG_PATH}) -- add_dependencies(llvm-config NativeLLVMConfig) --endif() ---- tools/llvm-shlib/CMakeLists.txt -+++ tools/llvm-shlib/CMakeLists.txt -@@ -155,13 +155,8 @@ - - set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports) - if(NOT LLVM_NM) -- if(CMAKE_CROSSCOMPILING) -- build_native_tool(llvm-nm llvm_nm) -- set(llvm_nm_target "${llvm_nm}") -- else() -- set(llvm_nm $) -- set(llvm_nm_target llvm-nm) -- endif() -+ set(llvm_nm $) -+ set(llvm_nm_target llvm-nm) - else() - set(llvm_nm ${LLVM_NM}) - set(llvm_nm_target "") diff --git a/recipes/llvm-core/all/patches/13x/0000-cmake-dependencies.patch b/recipes/llvm-core/all/patches/13x/0000-cmake-dependencies.patch new file mode 100644 index 0000000000000..a49abd15efa6c --- /dev/null +++ b/recipes/llvm-core/all/patches/13x/0000-cmake-dependencies.patch @@ -0,0 +1,84 @@ +diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake +index dd0aaadb47c..790a0b27a49 100644 +--- a/cmake/config-ix.cmake ++++ b/cmake/config-ix.cmake +@@ -63,7 +63,13 @@ check_symbol_exists(FE_ALL_EXCEPT "fenv.h" HAVE_DECL_FE_ALL_EXCEPT) + check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT) + + check_include_file(mach/mach.h HAVE_MACH_MACH_H) +-check_include_file(histedit.h HAVE_HISTEDIT_H) ++if(LLVM_ENABLE_LIBEDIT) ++ find_package(editline REQUIRED) ++ cmake_push_check_state() ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${editline_INCLUDE_DIRS}) ++ check_include_file(histedit.h HAVE_HISTEDIT_H) ++ cmake_pop_check_state() ++endif() + check_include_file(CrashReporterClient.h HAVE_CRASHREPORTERCLIENT_H) + if(APPLE) + include(CheckCSourceCompiles) +@@ -127,7 +133,7 @@ if(LLVM_ENABLE_ZLIB) + # library on a 64-bit system which would result in a link-time failure. + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) +- list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) + check_symbol_exists(compress2 zlib.h HAVE_ZLIB) + cmake_pop_check_state() + if(LLVM_ENABLE_ZLIB STREQUAL FORCE_ON AND NOT HAVE_ZLIB) +@@ -166,7 +172,11 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + if (NOT PURE_WINDOWS) + # Skip libedit if using ASan as it contains memory leaks. + if (LLVM_ENABLE_LIBEDIT AND HAVE_HISTEDIT_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") ++ cmake_push_check_state() ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${editline_INCLUDE_DIRS}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${editline_LIBRARIES}) + check_library_exists(edit el_init "" HAVE_LIBEDIT) ++ cmake_pop_check_state() + else() + set(HAVE_LIBEDIT 0) + endif() +diff --git a/lib/LineEditor/CMakeLists.txt b/lib/LineEditor/CMakeLists.txt +index 61328f76905..b95d073d972 100644 +--- a/lib/LineEditor/CMakeLists.txt ++++ b/lib/LineEditor/CMakeLists.txt +@@ -1,5 +1,5 @@ + if(HAVE_LIBEDIT) +- set(link_libs edit) ++ set(link_libs editline::editline) + endif() + + add_llvm_component_library(LLVMLineEditor +diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt +index 014b4a2caf1..486e4f39642 100644 +--- a/lib/Support/CMakeLists.txt ++++ b/lib/Support/CMakeLists.txt +@@ -267,7 +267,7 @@ if(LLVM_ENABLE_ZLIB) + # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. + if(CMAKE_BUILD_TYPE) + string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION_${build_type}) ++ set(zlib_library ${ZLIB_LIBRARIES}) + endif() + if(NOT zlib_library) + get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) +diff --git a/lib/WindowsManifest/CMakeLists.txt b/lib/WindowsManifest/CMakeLists.txt +index 8134ac8c815..ccd772f6176 100644 +--- a/lib/WindowsManifest/CMakeLists.txt ++++ b/lib/WindowsManifest/CMakeLists.txt +@@ -21,12 +21,13 @@ add_llvm_component_library(LLVMWindowsManifest + # This block is only needed for llvm-config. When we deprecate llvm-config and + # move to using CMake export, this block can be removed. + if(LLVM_ENABLE_LIBXML2) ++ find_package(libxml2 REQUIRED CONFIG) + # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. + if(CMAKE_BUILD_TYPE) + string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type}) ++ set(libxml2_library ${libxml2_LIBRARIES}) + endif() +- if(NOT zlib_library) ++ if(NOT libxml2_library) + get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) + endif() + get_library_name(${libxml2_library} libxml2_library) diff --git a/recipes/llvm-core/all/patches/13x/0001-calculate-job-pools.patch b/recipes/llvm-core/all/patches/13x/0001-calculate-job-pools.patch new file mode 100644 index 0000000000000..ec100e4785349 --- /dev/null +++ b/recipes/llvm-core/all/patches/13x/0001-calculate-job-pools.patch @@ -0,0 +1,42 @@ +diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake +index 0c3419390c2..eb234109e88 100644 +--- a/cmake/modules/HandleLLVMOptions.cmake ++++ b/cmake/modules/HandleLLVMOptions.cmake +@@ -33,6 +33,19 @@ string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO) + # The following only works with the Ninja generator in CMake >= 3.0. + set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING + "Define the maximum number of concurrent compilation jobs (Ninja only).") ++cmake_host_system_information(RESULT AVAILABLE_PHYSICAL_MEMORY QUERY AVAILABLE_PHYSICAL_MEMORY) ++cmake_host_system_information(RESULT NUMBER_OF_LOGICAL_CORES QUERY NUMBER_OF_LOGICAL_CORES) ++if(LLVM_RAM_PER_COMPILE_JOB) ++ math(EXPR memory_available_jobs "${AVAILABLE_PHYSICAL_MEMORY} / ${LLVM_RAM_PER_COMPILE_JOB}" OUTPUT_FORMAT DECIMAL) ++ if (memory_available_jobs LESS 1) ++ set(memory_available_jobs 1) ++ endif() ++ if (memory_available_jobs LESS NUMBER_OF_LOGICAL_CORES) ++ set(LLVM_PARALLEL_COMPILE_JOBS "${memory_available_jobs}") ++ else() ++ set(LLVM_PARALLEL_COMPILE_JOBS "${NUMBER_OF_LOGICAL_CORES}") ++ endif() ++endif() + if(LLVM_PARALLEL_COMPILE_JOBS) + if(NOT CMAKE_GENERATOR STREQUAL "Ninja") + message(WARNING "Job pooling is only available with Ninja generators.") +@@ -44,6 +57,17 @@ endif() + + set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING + "Define the maximum number of concurrent link jobs (Ninja only).") ++if(LLVM_RAM_PER_LINK_JOB) ++ math(EXPR memory_available_jobs "${AVAILABLE_PHYSICAL_MEMORY} / ${LLVM_RAM_PER_LINK_JOB}" OUTPUT_FORMAT DECIMAL) ++ if (memory_available_jobs LESS 1) ++ set(memory_available_jobs 1) ++ endif() ++ if (memory_available_jobs LESS NUMBER_OF_LOGICAL_CORES) ++ set(LLVM_PARALLEL_LINK_JOBS "${memory_available_jobs}") ++ else() ++ set(LLVM_PARALLEL_LINK_JOBS "${NUMBER_OF_LOGICAL_CORES}") ++ endif() ++endif() + if(CMAKE_GENERATOR STREQUAL "Ninja") + if(NOT LLVM_PARALLEL_LINK_JOBS AND uppercase_LLVM_ENABLE_LTO STREQUAL "THIN") + message(STATUS "ThinLTO provides its own parallel linking - limiting parallel link jobs to 2.") diff --git a/recipes/llvm-core/all/patches/13x/0002-missing-includes.patch b/recipes/llvm-core/all/patches/13x/0002-missing-includes.patch new file mode 100644 index 0000000000000..c7cfb90318b49 --- /dev/null +++ b/recipes/llvm-core/all/patches/13x/0002-missing-includes.patch @@ -0,0 +1,12 @@ +diff --git a/include/llvm/Support/Signals.h b/include/llvm/Support/Signals.h +index 44f5a750ff5..937e0572d4a 100644 +--- a/include/llvm/Support/Signals.h ++++ b/include/llvm/Support/Signals.h +@@ -14,6 +14,7 @@ + #ifndef LLVM_SUPPORT_SIGNALS_H + #define LLVM_SUPPORT_SIGNALS_H + ++#include + #include + + namespace llvm { diff --git a/recipes/llvm-core/all/patches/13x/0003-no-build-with-install-rpath.patch b/recipes/llvm-core/all/patches/13x/0003-no-build-with-install-rpath.patch new file mode 100644 index 0000000000000..05560e5a0c714 --- /dev/null +++ b/recipes/llvm-core/all/patches/13x/0003-no-build-with-install-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index 29e40f45fef8..bde9a02b3432 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -2143,7 +2143,7 @@ function(llvm_setup_rpath name) + + # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. + if("${CMAKE_BUILD_RPATH}" STREQUAL "") +- set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) ++ set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH OFF) + endif() + + set_target_properties(${name} PROPERTIES diff --git a/recipes/llvm-core/all/patches/13x/0004-remove-lto-exports.patch b/recipes/llvm-core/all/patches/13x/0004-remove-lto-exports.patch new file mode 100644 index 0000000000000..46cb2cbbecf38 --- /dev/null +++ b/recipes/llvm-core/all/patches/13x/0004-remove-lto-exports.patch @@ -0,0 +1,32 @@ +diff --git a/tools/lto/lto.exports b/tools/lto/lto.exports +index 1948bba29b67..8fdbd3522b9b 100644 +--- a/tools/lto/lto.exports ++++ b/tools/lto/lto.exports +@@ -44,12 +44,6 @@ lto_codegen_compile_optimized + lto_codegen_set_should_internalize + lto_codegen_set_should_embed_uselists + lto_set_debug_options +-LLVMCreateDisasm +-LLVMCreateDisasmCPU +-LLVMDisasmDispose +-LLVMDisasmInstruction +-LLVMSetDisasmOptions +-LLVMCreateDisasmCPUFeatures + thinlto_create_codegen + thinlto_codegen_dispose + thinlto_codegen_add_module +diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt +index 865436247270..aa11669d9a75 100644 +--- a/tools/remarks-shlib/CMakeLists.txt ++++ b/tools/remarks-shlib/CMakeLists.txt +@@ -9,7 +9,9 @@ if(LLVM_ENABLE_PIC) + libremarks.cpp + ) + +- set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++ if (NOT (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB)) ++ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++ endif() + + add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES}) + diff --git a/recipes/llvm-core/all/patches/13x/13.0.0-cmake.patch b/recipes/llvm-core/all/patches/13x/13.0.0-cmake.patch deleted file mode 100644 index 981f067a21505..0000000000000 --- a/recipes/llvm-core/all/patches/13x/13.0.0-cmake.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- cmake/config-ix.cmake -+++ cmake/config-ix.cmake -@@ -143,6 +143,9 @@ if(LLVM_ENABLE_LIBXML2) - elseif(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") - find_package(LibXml2) - endif() -+ set(LIBXML2_FOUND 1) -+ list(GET LibXml2_INCLUDE_DIRS -1 LIBXML2_INCLUDE_DIR) -+ set(LIBXML2_LIBRARIES ${LibXml2_LIBRARIES}) - if(LibXml2_FOUND) - # Check if libxml2 we found is usable; for example, we may have found a 32-bit - # library on a 64-bit system which would result in a link-time failure. -@@ -343,7 +346,7 @@ if( LLVM_ENABLE_FFI ) - message(FATAL_ERROR "libffi includes are not found.") - endif() - -- find_library(FFI_LIBRARY_PATH ffi PATHS ${FFI_LIBRARY_DIR}) -+ find_library(FFI_LIBRARY_PATH NAMES ffi libffi PATHS ${FFI_LIBRARY_DIR}) - if( NOT FFI_LIBRARY_PATH ) - message(FATAL_ERROR "libffi is not found.") - endif() ---- cmake/modules/TableGen.cmake -+++ cmake/modules/TableGen.cmake -@@ -135,11 +135,7 @@ macro(add_tablegen target project) - set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS}) - set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen) - -- # CMake doesn't let compilation units depend on their dependent libraries on some generators. -- if(NOT CMAKE_GENERATOR STREQUAL "Ninja" AND NOT XCODE) -- # FIXME: It leaks to user, callee of add_tablegen. -- set(LLVM_ENABLE_OBJLIB ON) -- endif() -+ set(LLVM_ENABLE_OBJLIB OFF) - - add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN}) - set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS}) ---- lib/WindowsManifest/CMakeLists.txt -+++ lib/WindowsManifest/CMakeLists.txt -@@ -21,14 +21,5 @@ add_llvm_component_library(LLVMWindowsManifest - # This block is only needed for llvm-config. When we deprecate llvm-config and - # move to using CMake export, this block can be removed. - if(LLVM_ENABLE_LIBXML2) -- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. -- if(CMAKE_BUILD_TYPE) -- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) -- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type}) -- endif() -- if(NOT zlib_library) -- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) -- endif() -- get_library_name(${libxml2_library} libxml2_library) -- set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library}) -+ set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) - endif() diff --git a/recipes/llvm-core/all/patches/13x/13.0.0-native.patch b/recipes/llvm-core/all/patches/13x/13.0.0-native.patch deleted file mode 100644 index fa8482ce0493b..0000000000000 --- a/recipes/llvm-core/all/patches/13x/13.0.0-native.patch +++ /dev/null @@ -1,78 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -931,10 +931,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) - include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}) - - # when crosscompiling import the executable targets from a file --if(LLVM_USE_HOST_TOOLS) -- include(CrossCompile) -- llvm_create_cross_target(LLVM NATIVE "" Release) --endif(LLVM_USE_HOST_TOOLS) - if(LLVM_TARGET_IS_CROSSCOMPILE_HOST) - # Dummy use to avoid CMake Warning: Manually-specified variables were not used - # (this is a variable that CrossCompile sets on recursive invocations) ---- cmake/modules/TableGen.cmake -+++ cmake/modules/TableGen.cmake -@@ -147,32 +147,6 @@ macro(add_tablegen target project) - set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE) - set(${project}_TABLEGEN_TARGET ${${project}_TABLEGEN} PARENT_SCOPE) - -- if(LLVM_USE_HOST_TOOLS) -- if( ${${project}_TABLEGEN} STREQUAL "${target}" ) -- # The NATIVE tablegen executable *must* depend on the current target one -- # otherwise the native one won't get rebuilt when the tablgen sources -- # change, and we end up with incorrect builds. -- build_native_tool(${target} ${project}_TABLEGEN_EXE DEPENDS ${target}) -- set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE) -- -- add_custom_target(${project}-tablegen-host DEPENDS ${${project}_TABLEGEN_EXE}) -- set(${project}_TABLEGEN_TARGET ${project}-tablegen-host PARENT_SCOPE) -- -- # Create an artificial dependency between tablegen projects, because they -- # compile the same dependencies, thus using the same build folders. -- # FIXME: A proper fix requires sequentially chaining tablegens. -- if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host AND -- TARGET LLVM-tablegen-host) -- add_dependencies(${project}-tablegen-host LLVM-tablegen-host) -- endif() -- -- # If we're using the host tablegen, and utils were not requested, we have no -- # need to build this tablegen. -- if ( NOT LLVM_BUILD_UTILS ) -- set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL ON) -- endif() -- endif() -- endif() - - if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) - set(export_to_llvmexports) ---- tools/llvm-config/CMakeLists.txt -+++ tools/llvm-config/CMakeLists.txt -@@ -75,11 +75,3 @@ endif() - - # Add the dependency on the generation step. - add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH}) -- --if(CMAKE_CROSSCOMPILING AND NOT LLVM_CONFIG_PATH) -- build_native_tool(llvm-config LLVM_CONFIG_PATH) -- set(LLVM_CONFIG_PATH "${LLVM_CONFIG_PATH}" CACHE STRING "") -- -- add_custom_target(NativeLLVMConfig DEPENDS ${LLVM_CONFIG_PATH}) -- add_dependencies(llvm-config NativeLLVMConfig) --endif() ---- tools/llvm-shlib/CMakeLists.txt -+++ tools/llvm-shlib/CMakeLists.txt -@@ -162,13 +162,6 @@ if(LLVM_BUILD_LLVM_C_DYLIB AND MSVC) - - set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports) - if(NOT LLVM_NM) -- if(CMAKE_CROSSCOMPILING) -- build_native_tool(llvm-nm llvm_nm) -- set(llvm_nm_target "${llvm_nm}") -- else() -- set(llvm_nm $) -- set(llvm_nm_target llvm-nm) -- endif() - else() - set(llvm_nm ${LLVM_NM}) - set(llvm_nm_target "") diff --git a/recipes/llvm-core/all/patches/19x/0000-cmake-dependencies.patch b/recipes/llvm-core/all/patches/19x/0000-cmake-dependencies.patch new file mode 100644 index 0000000000000..b7de008c05eec --- /dev/null +++ b/recipes/llvm-core/all/patches/19x/0000-cmake-dependencies.patch @@ -0,0 +1,93 @@ +diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake +index 0aae13e30f2a..c87f22d28dc6 100644 +--- a/cmake/config-ix.cmake ++++ b/cmake/config-ix.cmake +@@ -137,7 +137,7 @@ if(LLVM_ENABLE_ZLIB) + # library on a 64-bit system which would result in a link-time failure. + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) +- list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) + check_symbol_exists(compress2 zlib.h HAVE_ZLIB) + cmake_pop_check_state() + if(LLVM_ENABLE_ZLIB STREQUAL FORCE_ON AND NOT HAVE_ZLIB) +@@ -232,11 +232,11 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + # Skip libedit if using ASan as it contains memory leaks. + if (LLVM_ENABLE_LIBEDIT AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") + if(LLVM_ENABLE_LIBEDIT STREQUAL FORCE_ON) +- find_package(LibEdit REQUIRED) ++ find_package(editline REQUIRED) + else() +- find_package(LibEdit) ++ find_package(editline) + endif() +- set(HAVE_LIBEDIT "${LibEdit_FOUND}") ++ set(HAVE_LIBEDIT "${editline_FOUND}") + else() + set(HAVE_LIBEDIT 0) + endif() +diff --git a/lib/LineEditor/CMakeLists.txt b/lib/LineEditor/CMakeLists.txt +index c4cd91cbb0cd..b95d073d9725 100644 +--- a/lib/LineEditor/CMakeLists.txt ++++ b/lib/LineEditor/CMakeLists.txt +@@ -1,5 +1,5 @@ + if(HAVE_LIBEDIT) +- set(link_libs LibEdit::LibEdit) ++ set(link_libs editline::editline) + endif() + + add_llvm_component_library(LLVMLineEditor +diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt +index f653379e3033..4cb691de3027 100644 +--- a/lib/Support/CMakeLists.txt ++++ b/lib/Support/CMakeLists.txt +@@ -301,27 +301,13 @@ set(llvm_system_libs ${system_libs}) + # This block is only needed for llvm-config. When we deprecate llvm-config and + # move to using CMake export, this block can be removed. + if(LLVM_ENABLE_ZLIB) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT zlib_library) +- get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) +- endif() ++ set(zlib_library ${ZLIB_LIBRARIES}) + get_library_name(${zlib_library} zlib_library) + set(llvm_system_libs ${llvm_system_libs} "${zlib_library}") + endif() + + if(LLVM_ENABLE_ZSTD) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT zstd_library) +- get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION) +- endif() ++ set(zstd_library ${zstd_LIBRARIES}) + if (zstd_target STREQUAL zstd::libzstd_shared) + get_library_name(${zstd_library} zstd_library) + set(llvm_system_libs ${llvm_system_libs} "${zstd_library}") +diff --git a/lib/WindowsManifest/CMakeLists.txt b/lib/WindowsManifest/CMakeLists.txt +index 910132a4c7de..f4d91c9d56da 100644 +--- a/lib/WindowsManifest/CMakeLists.txt ++++ b/lib/WindowsManifest/CMakeLists.txt +@@ -21,14 +21,7 @@ add_llvm_component_library(LLVMWindowsManifest + # This block is only needed for llvm-config. When we deprecate llvm-config and + # move to using CMake export, this block can be removed. + if(LLVM_ENABLE_LIBXML2) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT libxml2_library) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) +- endif() ++ set(libxml2_library ${libxml2_LIBRARIES}) + get_library_name(${libxml2_library} libxml2_library) + set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library}) + endif() diff --git a/recipes/llvm-core/all/test_package/CMakeLists.txt b/recipes/llvm-core/all/test_package/CMakeLists.txt index 726aa5975f221..4de3810296f19 100644 --- a/recipes/llvm-core/all/test_package/CMakeLists.txt +++ b/recipes/llvm-core/all/test_package/CMakeLists.txt @@ -1,20 +1,31 @@ -cmake_minimum_required(VERSION 3.13.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(LLVM REQUIRED) +macro(test_llvm_cmake_variable VARIABLE) + if(NOT DEFINED ${VARIABLE}) + message(FATAL_ERROR "${VARIABLE} is not defined") + endif() + message(STATUS "${VARIABLE}: ${${VARIABLE}}") +endmacro() +set(CMAKE_CXX_STANDARD 17) add_executable(${PROJECT_NAME} test_package.cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -if(TARGET LLVMInterpreter) # static libraries - target_link_libraries(${PROJECT_NAME} PRIVATE - LLVMInterpreter - LLVMIRReader - LLVMX86CodeGen - ) -else() # shared library - target_link_libraries(${PROJECT_NAME} LLVM) +if (LLVM_SHARED) + find_package(LLVM REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE LLVM) +else() + find_package(LLVM REQUIRED) + llvm_map_components_to_libnames(llvm_libs interpreter nativecodegen irreader) + target_link_libraries(${PROJECT_NAME} PRIVATE ${llvm_libs}) endif() + +message(STATUS "Testing LLVM Build Module Variables") +test_llvm_cmake_variable(LLVM_PACKAGE_VERSION) +test_llvm_cmake_variable(LLVM_BUILD_TYPE) +test_llvm_cmake_variable(LLVM_CMAKE_DIR) +test_llvm_cmake_variable(LLVM_TOOLS_BINARY_DIR) +test_llvm_cmake_variable(LLVM_ALL_TARGETS) +test_llvm_cmake_variable(LLVM_TARGETS_TO_BUILD) +test_llvm_cmake_variable(LLVM_TARGETS_WITH_JIT) +test_llvm_cmake_variable(LLVM_NATIVE_ARCH) diff --git a/recipes/llvm-core/all/test_package/conanfile.py b/recipes/llvm-core/all/test_package/conanfile.py index e0ca8f6b664cb..5ae2ff91c80a2 100644 --- a/recipes/llvm-core/all/test_package/conanfile.py +++ b/recipes/llvm-core/all/test_package/conanfile.py @@ -1,39 +1,43 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMakeDeps, CMakeToolchain, CMake +from conan.tools.env import VirtualRunEnv +from conan.tools.build import can_run -import os.path +import os -class LLVMCoreTestPackageConan(ConanFile): - settings = ('os', 'arch', 'compiler', 'build_type') - generators = ('cmake', 'cmake_find_package') +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + # required for cmake_path support + self.tool_requires("cmake/[>=3.20 <4]") + + def generate(self): + deps = CMakeDeps(self) + deps.check_components_exist = True + deps.generate() + + tc = CMakeToolchain(self) + if self.dependencies[self.tested_reference_str].options.shared: + tc.variables["LLVM_SHARED"] = True + tc.generate() + + VirtualRunEnv(self).generate() def build(self): - build_system = CMake(self) - build_system.configure() - build_system.build() + cmake = CMake(self) + cmake.configure() + cmake.build() def test(self): - test_package = not tools.cross_building(self.settings) - if 'x86' not in str(self.settings.arch).lower(): - test_package = False - elif str(self.options['llvm-core'].targets) not in ['all', 'X86']: - test_package = False - elif self.options['llvm-core'].shared: - if self.options['llvm-core'].components != 'all': - requirements = ['interpreter', 'irreader', 'x86codegen'] - targets = str(self.options['llvm-core'].components) - if self.settings.os == 'Windows': - requirements.append('demangle') - if not all([target in components for target in requirements]): - test_package = False - - if test_package: - command = [ - os.path.join('bin', 'test_package'), - os.path.join(os.path.dirname(__file__), 'test_function.ll') - ] - self.run(command, run_environment=True) - - llvm_path = self.deps_cpp_info['llvm-core'].rootpath - license_path = os.path.join(llvm_path, 'licenses', 'LICENSE.TXT') - assert os.path.exists(license_path) + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + args = os.path.join(os.path.dirname(__file__), "test_function.ll") + self.run(f"{cmd} {args}", env="conanrun") diff --git a/recipes/llvm-core/config.yml b/recipes/llvm-core/config.yml index bc979f696a102..ba4acd330c459 100644 --- a/recipes/llvm-core/config.yml +++ b/recipes/llvm-core/config.yml @@ -1,4 +1,6 @@ versions: + "19.1.7": + folder: all "13.0.0": folder: all "12.0.0": diff --git a/recipes/llvm-openmp/all/conandata.yml b/recipes/llvm-openmp/all/conandata.yml index ce869816491ae..cb5f1104f3fc9 100644 --- a/recipes/llvm-openmp/all/conandata.yml +++ b/recipes/llvm-openmp/all/conandata.yml @@ -1,4 +1,11 @@ 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" diff --git a/recipes/llvm-openmp/all/conanfile.py b/recipes/llvm-openmp/all/conanfile.py index 14e375a798b6c..c1412f45efbaa 100644 --- a/recipes/llvm-openmp/all/conanfile.py +++ b/recipes/llvm-openmp/all/conanfile.py @@ -8,6 +8,7 @@ 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" @@ -15,12 +16,9 @@ class LLVMOpenMpConan(ConanFile): name = "llvm-openmp" - description = ("The OpenMP (Open Multi-Processing) specification " - "is a standard for a set of compiler directives, " - "library routines, and environment variables that " - "can be used to specify shared memory parallelism " - "in Fortran and C/C++ programs. This is the LLVM " - "implementation.") + description = ("The OpenMP (Open Multi-Processing) specification is a standard for a set of compiler directives, " + "library routines, and environment variables that can be used to specify shared memory parallelism " + "in Fortran and C/C++ programs. This is the LLVM implementation.") license = "Apache-2.0 WITH LLVM-exception" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/llvm/llvm-project/blob/main/openmp" @@ -45,15 +43,6 @@ class LLVMOpenMpConan(ConanFile): ) } - def _supports_compiler(self): - supported_compilers_by_os = { - "Linux": ["clang", "gcc", "intel-cc"], - "Macos": ["apple-clang", "clang", "gcc", "intel-cc"], - "Windows": ["intel-cc"], - } - the_compiler, the_os = self.settings.compiler.value, self.settings.os.value - return the_compiler in supported_compilers_by_os.get(the_os, []) - @property def _compilers_minimum_version(self): return { @@ -85,9 +74,12 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if not self._supports_compiler(): - raise ConanInvalidConfiguration("llvm-openmp doesn't support compiler: " - f"{self.settings.compiler} on OS: {self.settings.os}.") + 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) diff --git a/recipes/llvm-openmp/config.yml b/recipes/llvm-openmp/config.yml index 99c6f0e0e936a..2f6f02e2e7d3f 100644 --- a/recipes/llvm-openmp/config.yml +++ b/recipes/llvm-openmp/config.yml @@ -1,4 +1,6 @@ versions: + "17.0.6": + folder: all "17.0.4": folder: all "16.0.6": diff --git a/recipes/lmdb/all/CMakeLists.txt b/recipes/lmdb/all/CMakeLists.txt index 888afb35a88e0..6d83d4b94968d 100644 --- a/recipes/lmdb/all/CMakeLists.txt +++ b/recipes/lmdb/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(lmdb LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/lmdb/all/conandata.yml b/recipes/lmdb/all/conandata.yml index 924b591216793..3d8d01ecc53e6 100644 --- a/recipes/lmdb/all/conandata.yml +++ b/recipes/lmdb/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.9.32": + url: "https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.32/openldap-LMDB_0.9.32.tar.gz" + sha256: "c0937223bba3c37c896809883a3c9b43049354578b239d6ed2476236a87f40c9" + "0.9.31": + url: "https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.31/openldap-LMDB_0.9.31.tar.gz" + sha256: "f7aecdd1bcc69fb32bb33d8544cfe50f8e9e916f366d598a268e1f43ee9c7603" "0.9.29": url: "https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.29/openldap-LMDB_0.9.29.tar.gz" - sha256: "d4c668167a2d703ef91db733b4069b8b74dbc374405855be6626b45e2a7e2dd3" + sha256: "e4d9f32dba4e15fcc66e0085a03432ff40a8065848d352ea47b1cb717e7369a4" diff --git a/recipes/lmdb/all/test_package/CMakeLists.txt b/recipes/lmdb/all/test_package/CMakeLists.txt index 3342cb59e0fea..3732830b98348 100644 --- a/recipes/lmdb/all/test_package/CMakeLists.txt +++ b/recipes/lmdb/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(lmdb REQUIRED CONFIG) diff --git a/recipes/lmdb/all/test_v1_package/CMakeLists.txt b/recipes/lmdb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 20645081348a3..0000000000000 --- a/recipes/lmdb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(lmdb REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE lmdb::lmdb) diff --git a/recipes/lmdb/all/test_v1_package/conanfile.py b/recipes/lmdb/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/lmdb/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_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/lmdb/config.yml b/recipes/lmdb/config.yml index 34b7a75931b22..0014799ccef1f 100644 --- a/recipes/lmdb/config.yml +++ b/recipes/lmdb/config.yml @@ -1,3 +1,7 @@ "versions": + "0.9.32": + "folder": "all" + "0.9.31": + "folder": "all" "0.9.29": "folder": "all" diff --git a/recipes/lodepng/all/CMakeLists.txt b/recipes/lodepng/all/CMakeLists.txt index 151ff6e29fe1c..048f8cf8c45af 100644 --- a/recipes/lodepng/all/CMakeLists.txt +++ b/recipes/lodepng/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(lodepng LANGUAGES CXX) add_library(lodepng ${LODEPNG_SRC_DIR}/lodepng.cpp) diff --git a/recipes/lodepng/all/test_package/CMakeLists.txt b/recipes/lodepng/all/test_package/CMakeLists.txt index 3b1ba39df32d9..fa65d496e719e 100644 --- a/recipes/lodepng/all/test_package/CMakeLists.txt +++ b/recipes/lodepng/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(lodepng REQUIRED CONFIG) diff --git a/recipes/lodepng/all/test_package/bees.png b/recipes/lodepng/all/test_package/bees.png deleted file mode 100644 index 11640c7488fb1..0000000000000 Binary files a/recipes/lodepng/all/test_package/bees.png and /dev/null differ diff --git a/recipes/lodepng/all/test_package/conanfile.py b/recipes/lodepng/all/test_package/conanfile.py index f6238eccc60b7..0a6bc68712d90 100644 --- a/recipes/lodepng/all/test_package/conanfile.py +++ b/recipes/lodepng/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - bees = os.path.join(self.source_folder, "bees.png") - self.run(f"{bin_path} {bees}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/lodepng/all/test_package/test_package.cpp b/recipes/lodepng/all/test_package/test_package.cpp index 744f347b97c7b..9f83682fff5cd 100644 --- a/recipes/lodepng/all/test_package/test_package.cpp +++ b/recipes/lodepng/all/test_package/test_package.cpp @@ -1,31 +1,12 @@ #include -#include -#include -#include - #include "lodepng.h" int main(int argc, const char *argv[]) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - } - std::ifstream stream(argv[1], std::ios::in | std::ios::binary); - std::vector data((std::istreambuf_iterator(stream)), std::istreambuf_iterator()); - - std::cout << "file name " << argv[1] << "\n"; - std::cout << "file size " << data.size() << " bytes\n"; - - std::vector decoded; - unsigned width = 0, height = 0; - unsigned error = lodepng::decode(decoded, width, height, data); - if (error != 0) { - std::cerr << "lodepng::decode returned with error code " << error << "\n"; - return 1; - } - std::cout << "image size: " << width << " x " << height << " pixels.\n"; + LodePNGCompressSettings compress_settings; + lodepng_compress_settings_init(&compress_settings); - stream.close(); + printf("compress_settings.btype = %d\n", compress_settings.btype); return 0; } diff --git a/recipes/lodepng/all/test_v1_package/CMakeLists.txt b/recipes/lodepng/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/lodepng/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/lodepng/all/test_v1_package/conanfile.py b/recipes/lodepng/all/test_v1_package/conanfile.py deleted file mode 100644 index 4441530a937ba..0000000000000 --- a/recipes/lodepng/all/test_v1_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 = os.path.join("bin", "test_package") - bees = os.path.join(self.source_folder, os.pardir, "test_package", "bees.png") - self.run(f"{bin_path} {bees}", run_environment=True) diff --git a/recipes/log.c/all/test_package/CMakeLists.txt b/recipes/log.c/all/test_package/CMakeLists.txt index 90cb2b629055b..751e8ad5f1d01 100644 --- a/recipes/log.c/all/test_package/CMakeLists.txt +++ b/recipes/log.c/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(log.c REQUIRED CONFIG) diff --git a/recipes/log.c/all/test_v1_package/CMakeLists.txt b/recipes/log.c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/log.c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/log.c/all/test_v1_package/conanfile.py b/recipes/log.c/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/log.c/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_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/log4cplus/all/conandata.yml b/recipes/log4cplus/all/conandata.yml index a0ac90c32b364..806ae51d2f04e 100644 --- a/recipes/log4cplus/all/conandata.yml +++ b/recipes/log4cplus/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.1.2": + url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_1_2/log4cplus-2.1.2.tar.bz2" + sha256: "2450dfbb4ab35dd2c9e64d8c750c514bf7293b81d8f32af7ab124417f70adfad" + "2.1.1": + url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_1_1/log4cplus-2.1.1.tar.bz2" + sha256: "6597de782775e4e0fba8fdcad938c3709fd839a8084c4b6edfae3cc5046e2688" "2.1.0": url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_1_0/log4cplus-2.1.0.tar.bz2" sha256: "a04945aca5fbc0487503c852befb9cdefbc3ae3fe614b08a905333f6df754387" @@ -8,38 +14,31 @@ sources: "2.0.7": url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_7/log4cplus-2.0.7.tar.bz2" sha256: "8fadbafee2ba4e558a0f78842613c9fb239c775d83f23340d091084c0e1b12ab" - "2.0.6": - url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_6/log4cplus-2.0.6.tar.bz2" - sha256: "1a963afd0f883d62de946b18927d238051fd47936e415eabeffe2b1397f16eca" - "2.0.5": - url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_5/log4cplus-2.0.5.tar.bz2" - sha256: "b38dbfc68ef6d771e4de7de0be3544bc51bd3f7d5b75c5f6500d10e23203eb15" - "2.0.4": - url: "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_4/log4cplus-2.0.4.tar.bz2" - sha256: "0c8a7b4cabff07032385f0c6d1a078d2a79c69b1c43b06991ca774fb85880252" - + "1.2.2": + url: "https://github.com/log4cplus/log4cplus/releases/download/REL_1_2_2/log4cplus-1.2.2.tar.bz2" + sha256: "853efd919f9ca76c518c0944e6b0ced1174523a86b6db046ed4f23fe695167bd" patches: - "2.1.0": - - patch_file: "patches/2.0.6-0001-fix-cmake.patch" - patch_description: "disable fPIC, move cmake_minimum_version to front" + "2.1.2": + - patch_file: "patches/2.1.2-0001-fix-cmake.patch" + patch_description: "disable fPIC" patch_type: "conan" - "2.0.8": + "2.1.1": - patch_file: "patches/2.0.6-0001-fix-cmake.patch" patch_description: "disable fPIC, move cmake_minimum_version to front" patch_type: "conan" - "2.0.7": + "2.1.0": - patch_file: "patches/2.0.6-0001-fix-cmake.patch" patch_description: "disable fPIC, move cmake_minimum_version to front" patch_type: "conan" - "2.0.6": + "2.0.8": - patch_file: "patches/2.0.6-0001-fix-cmake.patch" patch_description: "disable fPIC, move cmake_minimum_version to front" patch_type: "conan" - "2.0.5": - - patch_file: "patches/2.0.4-0001-fix-cmake.patch" + "2.0.7": + - patch_file: "patches/2.0.6-0001-fix-cmake.patch" patch_description: "disable fPIC, move cmake_minimum_version to front" patch_type: "conan" - "2.0.4": - - patch_file: "patches/2.0.4-0001-fix-cmake.patch" - patch_description: "disable fPIC, move cmake_minimum_version to front" + "1.2.2": + - patch_file: "patches/1.2.2-0001-fix-cmake.patch" + patch_description: "move cmake_minimum_version to front" patch_type: "conan" diff --git a/recipes/log4cplus/all/conanfile.py b/recipes/log4cplus/all/conanfile.py index 6d7e6eed30a07..e874b2d20f4c6 100644 --- a/recipes/log4cplus/all/conanfile.py +++ b/recipes/log4cplus/all/conanfile.py @@ -1,8 +1,10 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration 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.build import check_min_cppstd, valid_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.53.0" @@ -10,10 +12,11 @@ class Log4cplusConan(ConanFile): name = "log4cplus" description = "simple to use C++ logging API, modelled after the Java log4j API" - license = ("BSD-2-Clause, Apache-2.0") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/log4cplus/log4cplus" + license = ("BSD-2-Clause, Apache-2.0") topics = ("logging", "log", "logging-library") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -62,6 +65,11 @@ def requirements(self): def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, 11) + if Version(self.version) < 2 and valid_min_cppstd(self, 17): + raise ConanInvalidConfiguration(f"${self.ref} does not support C++17") + if Version(self.version) >= "2.1.2" and \ + is_msvc(self) and Version(self.settings.compiler.version) < 192: + raise ConanInvalidConfiguration(f"${self.ref} requires Visual Studio 2019 or newer") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/log4cplus/all/patches/1.2.2-0001-fix-cmake.patch b/recipes/log4cplus/all/patches/1.2.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..29c239101f640 --- /dev/null +++ b/recipes/log4cplus/all/patches/1.2.2-0001-fix-cmake.patch @@ -0,0 +1,12 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -11,8 +11,8 @@ + # Remove when CMake >= 2.8.4 is required + set (CMAKE_LEGACY_CYGWIN_WIN32 0) + ++cmake_minimum_required (VERSION 3.15) + project (log4cplus) +-cmake_minimum_required (VERSION 2.8.12) + + enable_language (CXX) + include(GNUInstallDirs) diff --git a/recipes/log4cplus/all/patches/2.0.4-0001-fix-cmake.patch b/recipes/log4cplus/all/patches/2.0.4-0001-fix-cmake.patch deleted file mode 100644 index d76b76d7eee51..0000000000000 --- a/recipes/log4cplus/all/patches/2.0.4-0001-fix-cmake.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index abe12e0..73d443f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,3 +1,5 @@ -+cmake_minimum_required (VERSION 3.1) -+ - # This block needs to stay before the project (log4cplus) line so that - # the output files placed into Android's libs directory. - if (CMAKE_TOOLCHAIN_FILE) -@@ -12,10 +14,6 @@ endif () - set (CMAKE_LEGACY_CYGWIN_WIN32 0) - - project (log4cplus) --cmake_minimum_required (VERSION 3.1) -- --# Use "-fPIC" / "-fPIE" for all targets by default, including static libs. --set (CMAKE_POSITION_INDEPENDENT_CODE ON) - - enable_language (CXX) - if (MSVC) diff --git a/recipes/log4cplus/all/patches/2.1.2-0001-fix-cmake.patch b/recipes/log4cplus/all/patches/2.1.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..9bec3910bc1e9 --- /dev/null +++ b/recipes/log4cplus/all/patches/2.1.2-0001-fix-cmake.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9dcbb8a..f80d3b9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,7 +15,7 @@ cmake_minimum_required (VERSION 3.12) + project (log4cplus) + + # Use "-fPIC" / "-fPIE" for all targets by default, including static libs. +-set (CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set (CMAKE_POSITION_INDEPENDENT_CODE ON) + + enable_language (CXX) + if (MSVC) diff --git a/recipes/log4cplus/all/test_package/CMakeLists.txt b/recipes/log4cplus/all/test_package/CMakeLists.txt index d9b0e93737a79..f8237082b0131 100644 --- a/recipes/log4cplus/all/test_package/CMakeLists.txt +++ b/recipes/log4cplus/all/test_package/CMakeLists.txt @@ -1,8 +1,12 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(log4cplus REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) +if(log4cplus_VERSION VERSION_GREATER_EQUAL 2) + add_executable(${PROJECT_NAME} test_package.cpp) +else() + add_executable(${PROJECT_NAME} test_package_v1.cpp) +endif() target_link_libraries(${PROJECT_NAME} PRIVATE log4cplus::log4cplus) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/log4cplus/all/test_package/test_package_v1.cpp b/recipes/log4cplus/all/test_package/test_package_v1.cpp new file mode 100644 index 0000000000000..bd0d86df7ec39 --- /dev/null +++ b/recipes/log4cplus/all/test_package/test_package_v1.cpp @@ -0,0 +1,16 @@ +#include +#include +#include + +int main() +{ + log4cplus::initialize(); + + log4cplus::BasicConfigurator config; + config.configure(); + + log4cplus::Logger logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("main")); + LOG4CPLUS_WARN(logger, LOG4CPLUS_TEXT("Hello, World!")); + + return 0; +} diff --git a/recipes/log4cplus/all/test_v1_package/CMakeLists.txt b/recipes/log4cplus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/log4cplus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/log4cplus/all/test_v1_package/conanfile.py b/recipes/log4cplus/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/log4cplus/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/log4cplus/config.yml b/recipes/log4cplus/config.yml index c48cbc75b8c2f..bd3466aea568e 100644 --- a/recipes/log4cplus/config.yml +++ b/recipes/log4cplus/config.yml @@ -1,13 +1,15 @@ versions: + "2.1.2": + folder: all + # 2.1.1 is the last version for Visual Studio 2017 + "2.1.1": + folder: all "2.1.0": folder: all "2.0.8": folder: all "2.0.7": folder: all - "2.0.6": - folder: all - "2.0.5": - folder: all - "2.0.4": + # v1 is required for the openvdb recipe + "1.2.2": folder: all diff --git a/recipes/log4cpp/all/conandata.yml b/recipes/log4cpp/all/conandata.yml new file mode 100644 index 0000000000000..4dd4005a57c96 --- /dev/null +++ b/recipes/log4cpp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.1.4": + url: "https://sourceforge.net/projects/log4cpp/files/log4cpp-1.1.x%20%28new%29/log4cpp-1.1/log4cpp-1.1.4.tar.gz" + sha256: "696113659e426540625274a8b251052cc04306d8ee5c42a0c7639f39ca90c9d6" +patches: + "1.1.4": + - patch_file: "patches/0001-build-aarch64.patch" + patch_description: "Add aarch64 build support" + patch_source: https://sourceforge.net/p/log4cpp/bugs/157/ + patch_type: "portability" diff --git a/recipes/log4cpp/all/conanfile.py b/recipes/log4cpp/all/conanfile.py new file mode 100644 index 0000000000000..79427d96d4c71 --- /dev/null +++ b/recipes/log4cpp/all/conanfile.py @@ -0,0 +1,80 @@ +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, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=2.0.9" + + +class Log4cppConan(ConanFile): + name = "log4cpp" + description = ( + "A library of C++ classes for flexible logging to files (rolling), syslog, " + "IDSA and other destinations. It is modeled after the Log4j Java library, " + "staying as close to their API as is reasonable." + ) + license = "LGPL-2.1-or-later" + topics = ("logging", "log", "logging-library") + homepage = "https://log4cpp.sourceforge.net/" + 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, + } + implements = ["auto_shared_fpic"] + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration( + f"{self.ref} recipe doesn't support Windows yet, but it could. Contributions are welcomed." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def generate(self): + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + "--enable-debug={}".format(yes_no(self.settings.build_type == "Debug")), + # Always use system snprintf instead of internal one + "ac_cv_func_snprintf=yes", + ]) + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure(build_script_folder=os.path.join(self.source_folder, "log4cpp")) + autotools.make() + + def package(self): + copy(self, "COPYING", src=os.path.join(self.source_folder, "log4cpp"), dst=os.path.join(self.package_folder, "licenses")) + 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")) + 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", "log4cpp") + self.cpp_info.libs = ["log4cpp"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/log4cpp/all/patches/0001-build-aarch64.patch b/recipes/log4cpp/all/patches/0001-build-aarch64.patch new file mode 100644 index 0000000000000..7650d0a1917e9 --- /dev/null +++ b/recipes/log4cpp/all/patches/0001-build-aarch64.patch @@ -0,0 +1,22 @@ +diff --git a/log4cpp/config/config.sub b/log4cpp/config/config.sub +index a06a480..b546de3 100755 +--- a/log4cpp/config/config.sub ++++ b/log4cpp/config/config.sub +@@ -216,7 +216,7 @@ case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ +- | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ ++ | arm | aarch | aarch64 | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ + | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle \ +@@ -260,7 +260,7 @@ case $basic_machine in + # FIXME: clean up the formatting here. + vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ +- | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ ++ | arm-* | armbe-* | armle-* | armv*-* | aarch*-* | strongarm-* | xscale-* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ + | xmp-* | ymp-* \ diff --git a/recipes/log4cpp/all/test_package/CMakeLists.txt b/recipes/log4cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0bf68e18b74dc --- /dev/null +++ b/recipes/log4cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(log4cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cpp::log4cpp) diff --git a/recipes/log4cpp/all/test_package/conanfile.py b/recipes/log4cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..87901dd77830a --- /dev/null +++ b/recipes/log4cpp/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 = "CMakeToolchain", "CMakeDeps" + + 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/log4cpp/all/test_package/test_package.cpp b/recipes/log4cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9296b2a022ca0 --- /dev/null +++ b/recipes/log4cpp/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include "log4cpp/Category.hh" +#include "log4cpp/Appender.hh" +#include "log4cpp/OstreamAppender.hh" + + +int main(void) { + log4cpp::OstreamAppender appender("console", &std::cerr); + log4cpp::Category& root = log4cpp::Category::getRoot(); + root.addAppender(appender); + root.info("Conan test package"); + root.shutdown(); + return EXIT_SUCCESS; +} diff --git a/recipes/log4cpp/config.yml b/recipes/log4cpp/config.yml new file mode 100644 index 0000000000000..f7bc2bb892fbd --- /dev/null +++ b/recipes/log4cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.4": + folder: all diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 6e4b69d1303a5..f5db8f407c77c 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -1,23 +1,10 @@ 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" - "0.12.0": - 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": - - patch_file: "patches/0.12.0-0001-find-apr.patch" - patch_description: "use cci's package name" - patch_type: "conan" - "0.12.0": - - patch_file: "patches/0.12.0-0001-find-apr.patch" - patch_description: "use cci's package name" - patch_type: "conan" + "1.4.0": + url: "https://archive.apache.org/dist/logging/log4cxx/1.4.0/apache-log4cxx-1.4.0.tar.gz" + sha256: "3d2d1f356a546c14562763aaf15fcc3fd59d4ffeb5a2f68fcb0bbd7571ed6f96" + "1.3.1": + url: "https://archive.apache.org/dist/logging/log4cxx/1.3.1/apache-log4cxx-1.3.1.tar.gz" + sha256: "2c4073c0613af7f59a75d8f26365dc6f5b07a22b9636ee5c5f7bfa9771a2c1d0" + "1.2.0": + url: "https://archive.apache.org/dist/logging/log4cxx/1.2.0/apache-log4cxx-1.2.0.tar.gz" + sha256: "09f4748aa5675ef5c0770bedbf5e00488668933c5a935a43ac5b85be2436c48a" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index f7fedd1522a39..daadb009a466a 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -1,12 +1,9 @@ import os -import textwrap 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 +from conan.tools.files import copy, get, rmdir required_conan_version = ">=1.53.0" @@ -24,32 +21,45 @@ class Log4cxxConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "char_type": ["utf-8", "wchar_t", "unichar"], + "char_encoding": ["utf-8", "locale"], + "with_networking": [True, False], + "with_wchar_t": [True, False], + "with_fmt_layout": [True, False], + "with_odbc_appender": [True, False], + "with_multiprocess_rolling_file_appender": [True, False], + "with_smtp_appender": [True, False], + "with_qt": [True, False], + } + options_description = { + "char_type": "The log4cxx internal character type (selects the std::basic_string template parameter used by log4cxx::LogString)", + "char_encoding": "The external character set used when writing to files", + "with_networking": "Include appenders that use network i/o", + "with_wchar_t": "Include wchar_t API methods in class interfaces", + "with_fmt_layout": "Include the log4cxx::FMTLayout class that uses libfmt to layout messages", + "with_odbc_appender": "Include the log4cxx::ODBCAppender that sends log events to a database", + "with_multiprocess_rolling_file_appender": "Include the appender that allows multiple applications to log to the same file", + "with_smtp_appender": "Include the appender that sends an e-mail when a specific logging event occurs", + "with_qt": "Allow QString values in the LOG4CXX_WARN, LOG4CXX_INFO, LOG4CXX_DEBUG etc. macros", } default_options = { "shared": False, "fPIC": True, + "char_type": "utf-8", + "char_encoding": "utf-8", + "with_networking": True, + "with_wchar_t": False, + "with_fmt_layout": False, + "with_odbc_appender": False, + "with_multiprocess_rolling_file_appender": False, + "with_smtp_appender": False, + "with_qt": 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) - def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") + self.options.rm_safe("with_smtp_appender") # *nix only def configure(self): if self.options.shared: @@ -61,39 +71,57 @@ def layout(self): def requirements(self): self.requires("apr/1.7.4") self.requires("apr-util/1.6.1") - self.requires("expat/2.5.0") - if self.settings.os != "Windows": + self.requires("expat/2.6.4") + if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": self.requires("odbc/2.3.11") + if self.options.get_safe("with_smtp_appender"): + self.requires("libesmtp/1.1.0") + if self.options.get_safe("with_fmt_layout"): + self.requires("fmt/10.2.1") + if self.options.get_safe("with_qt"): + self.requires("qt/[~5.15]") def validate(self): - # TODO: if compiler doesn't support C++17, boost can be used instead - 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 a compiler that supports at least C++{self._min_cppstd}") + if self.options.get_safe("with_multiprocess_rolling_file_appender"): + # TODO: if compiler doesn't support C++17, boost can be used instead + self.output.info("multiprocess rolling file appender requires C++17.") + check_min_cppstd(self, "17") def build_requirements(self): if self.settings.os != "Windows": if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") def source(self): - # OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: - # 'src\\test\\resources\\output\\xyz\\:' - pattern = "*[!:]" - get(self, **self.conan_data["sources"][self.version], strip_root=True, pattern=pattern) + get(self, **self.conan_data["sources"][self.version], strip_root=True) 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.variables["BUILD_TESTING"] = False + tc.variables["LOG4CXX_INSTALL_PDB"] = False + tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking + tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender + tc.variables["ENABLE_FMT_LAYOUT"] = self.options.with_fmt_layout + if self.settings.os != "Windows": + tc.variables["LOG4CXX_ENABLE_ESMTP"] = self.options.with_smtp_appender + tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc_appender + tc.variables["LOG4CXX_CHAR"] = self.options.char_type + tc.variables["LOG4CXX_CHARSET"] = self.options.char_encoding + tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t + tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt + tc.variables["APR_STATIC"] = not self.dependencies["apr"].options.shared + tc.variables["APU_STATIC"] = not self.dependencies["apr-util"].options.shared tc.generate() + deps = CMakeDeps(self) + deps.set_property("apr", "cmake_file_name", "APR") + deps.set_property("apr-util", "cmake_file_name", "APR-Util") + deps.set_property("apr-util", "cmake_additional_variables_prefixes", ["APR_UTIL"]) + deps.set_property("expat", "cmake_file_name", "EXPAT") + deps.set_property("expat", "cmake_find_mode", "config") + 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() @@ -107,26 +135,6 @@ def package(self): 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"} - ) - - 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", "conan-official-{}-targets.cmake".format(self.name)) - def package_info(self): self.cpp_info.set_property("cmake_file_name", "log4cxx") self.cpp_info.set_property("cmake_target_name", "log4cxx") @@ -137,7 +145,3 @@ def package_info(self): self.cpp_info.libs = ["log4cxx"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["odbc32"] - - # 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] 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 deleted file mode 100644 index 9b75430996d18..0000000000000 --- a/recipes/log4cxx/all/patches/0.12.0-0001-find-apr.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- 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/0.12.1-0001-logchar-type.patch b/recipes/log4cxx/all/patches/0.12.1-0001-logchar-type.patch new file mode 100644 index 0000000000000..a59e3639553ae --- /dev/null +++ b/recipes/log4cxx/all/patches/0.12.1-0001-logchar-type.patch @@ -0,0 +1,21 @@ +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -22,9 +22,18 @@ endif() + + if(${LOG4CXX_CHAR} STREQUAL "unichar") + set(LOGCHAR_IS_UNICHAR 1) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 0) + elseif(${LOG4CXX_CHAR} STREQUAL "wchar_t") + set(LOGCHAR_IS_WCHAR 1) ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_UTF8 0) ++elseif(${LOG4CXX_CHAR} STREQUAL "utf-8") ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 1) + endif() ++ + option(LOG4CXX_WCHAR_T "Enable wchar_t API methods" ON) + option(LOG4CXX_UNICHAR "Enable UniChar API methods" OFF) + set(INIT_IOS_BASE 0) diff --git a/recipes/log4cxx/all/patches/0.13.0-0001-fix-static-library-compilation.patch b/recipes/log4cxx/all/patches/0.13.0-0001-fix-static-library-compilation.patch new file mode 100644 index 0000000000000..53bcabf38e8da --- /dev/null +++ b/recipes/log4cxx/all/patches/0.13.0-0001-fix-static-library-compilation.patch @@ -0,0 +1,12 @@ +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -16,6 +16,9 @@ + */ + + #include "log4cxx/helpers/threadutility.h" ++#if !defined(LOG4CXX) ++ #define LOG4CXX 1 ++#endif + #include "log4cxx/private/log4cxx_private.h" + #include "log4cxx/helpers/loglog.h" + diff --git a/recipes/log4cxx/all/patches/0.13.0-0001-logchar-type.patch b/recipes/log4cxx/all/patches/0.13.0-0001-logchar-type.patch new file mode 100644 index 0000000000000..cb4669d6873b4 --- /dev/null +++ b/recipes/log4cxx/all/patches/0.13.0-0001-logchar-type.patch @@ -0,0 +1,44 @@ +diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp +index c14c12fd..057ecd86 100644 +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -113,11 +113,13 @@ void ThreadUtility::threadStartedNameThread(LogString threadName, + std::thread::id /*threadId*/, + std::thread::native_handle_type nativeHandle){ + #if LOG4CXX_HAS_PTHREAD_SETNAME +- if( pthread_setname_np( static_cast( nativeHandle ), threadName.c_str() ) < 0 ){ +- LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); ++ LOG4CXX_ENCODE_CHAR(sthreadName, threadName); ++ if (pthread_setname_np(static_cast(nativeHandle), sthreadName.c_str()) < 0) { ++ LOGLOG_ERROR(LOG4CXX_STR("unable to set thread name")); + } + #elif LOG4CXX_HAS_SETTHREADDESCRIPTION +- HRESULT hr = SetThreadDescription(static_cast(nativeHandle), threadName.c_str()); ++ LOG4CXX_ENCODE_WCHAR(wthreadName, threadName); ++ HRESULT hr = SetThreadDescription(static_cast(nativeHandle), wthreadName.c_str()); + if(FAILED(hr)){ + LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); + } +diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt +index e31443fb..32122e41 100644 +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -39,9 +39,18 @@ endif() + + if(${LOG4CXX_CHAR} STREQUAL "unichar") + set(LOGCHAR_IS_UNICHAR 1) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 0) + elseif(${LOG4CXX_CHAR} STREQUAL "wchar_t") + set(LOGCHAR_IS_WCHAR 1) ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_UTF8 0) ++elseif(${LOG4CXX_CHAR} STREQUAL "utf-8") ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 1) + endif() ++ + option(LOG4CXX_WCHAR_T "Enable wchar_t API methods" ON) + option(LOG4CXX_UNICHAR "Enable UniChar API methods" OFF) + set(INIT_IOS_BASE 0) diff --git a/recipes/log4cxx/all/patches/0.13.0-0001-visual-studio-15.patch b/recipes/log4cxx/all/patches/0.13.0-0001-visual-studio-15.patch new file mode 100644 index 0000000000000..0c491ee579c3b --- /dev/null +++ b/recipes/log4cxx/all/patches/0.13.0-0001-visual-studio-15.patch @@ -0,0 +1,52 @@ +diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp +index b57ab66..ef48704 100644 +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -27,7 +27,11 @@ + #include + #endif + +-using log4cxx::helpers::ThreadUtility; ++namespace log4cxx ++{ ++namespace helpers ++{ ++ + + struct ThreadUtility::priv_data{ + priv_data(){ +@@ -36,9 +40,9 @@ struct ThreadUtility::priv_data{ + start_post = nullptr; + } + +- log4cxx::helpers::ThreadStartPre start_pre; +- log4cxx::helpers::ThreadStarted started; +- log4cxx::helpers::ThreadStartPost start_post; ++ ThreadStartPre start_pre; ++ ThreadStarted started; ++ ThreadStartPost start_post; + }; + + #if LOG4CXX_HAS_PTHREAD_SIGMASK +@@ -138,14 +142,18 @@ void ThreadUtility::postThreadUnblockSignals(){ + } + + +-log4cxx::helpers::ThreadStartPre ThreadUtility::preStartFunction(){ ++ThreadStartPre ThreadUtility::preStartFunction(){ + return m_priv->start_pre; + } + +-log4cxx::helpers::ThreadStarted ThreadUtility::threadStartedFunction(){ ++ThreadStarted ThreadUtility::threadStartedFunction(){ + return m_priv->started; + } + +-log4cxx::helpers::ThreadStartPost ThreadUtility::postStartFunction(){ ++ThreadStartPost ThreadUtility::postStartFunction(){ + return m_priv->start_post; + } ++ ++} //namespace helpers ++} //namespace log4cxx ++ 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 deleted file mode 100644 index 5b8a283a6e00a..0000000000000 --- a/recipes/log4cxx/all/patches/1.1.0-0001-find-apr.patch +++ /dev/null @@ -1,44 +0,0 @@ -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 a9ec878c74ebe..57b42a079308e 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package LANGUAGES CXX) find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} log4cxx) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx ) diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py index 382876561a203..ce59568997309 100644 --- a/recipes/log4cxx/all/test_package/conanfile.py +++ b/recipes/log4cxx/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" @@ -23,5 +22,5 @@ def build(self): def test(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") - self.run(f"{bin_path} {config_xml_name}", env="conanrun") + self.run(bin_path, env="conanrun") + diff --git a/recipes/log4cxx/all/test_package/log4cxx_config.xml b/recipes/log4cxx/all/test_package/log4cxx_config.xml deleted file mode 100644 index 4269f78dd989e..0000000000000 --- a/recipes/log4cxx/all/test_package/log4cxx_config.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/recipes/log4cxx/all/test_package/test_package.cpp b/recipes/log4cxx/all/test_package/test_package.cpp index 4e52b04611957..8b9a903132f6d 100644 --- a/recipes/log4cxx/all/test_package/test_package.cpp +++ b/recipes/log4cxx/all/test_package/test_package.cpp @@ -1,20 +1,8 @@ -#include "log4cxx/logger.h" -#include "log4cxx/xml/domconfigurator.h" - +#include "log4cxx/log4cxx.h" #include -using namespace log4cxx; -using namespace log4cxx::xml; - -int main(int argc, const char* argv[]) +int main() { - LoggerPtr logger(Logger::getLogger("TEST")); - if (argc < 2) { - std::cerr << "Expected path to config xml\n"; - return -1; - } - DOMConfigurator::configure(argv[1]); - LOG4CXX_INFO(logger, "App started!"); - LOG4CXX_ERROR(logger, "Some error!"); + std::cout << "log4cxx version: " << log4cxx::libraryVersion() << "\n"; return 0; } diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 0aa45c8d4db18..0000000000000 --- a/recipes/log4cxx/all/test_v1_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): - 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 18729d7b4cdc5..61d63ec4cf6dc 100644 --- a/recipes/log4cxx/config.yml +++ b/recipes/log4cxx/config.yml @@ -1,7 +1,7 @@ versions: - "1.1.0": + "1.4.0": folder: all - "0.12.1": + "1.3.1": folder: all - "0.12.0": + "1.2.0": folder: all diff --git a/recipes/logfault/all/conandata.yml b/recipes/logfault/all/conandata.yml new file mode 100644 index 0000000000000..4ef9e5e9edbe3 --- /dev/null +++ b/recipes/logfault/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + 0.5.2: + url: + - https://github.com/jgaa/logfault/archive/refs/tags/v0.5.2.tar.gz + sha256: b6c7a4faca340bb7e3105c2094acd2afd52ce1bcfbe7e3ed2233c1ec933a904f diff --git a/recipes/logfault/all/conanfile.py b/recipes/logfault/all/conanfile.py new file mode 100644 index 0000000000000..d93b9976fa00f --- /dev/null +++ b/recipes/logfault/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 +from conan.tools.cmake import CMake, CMakeToolchain +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "logfault" + description = "Simple to use, header only C++ library for application-logging on all major platforms." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jgaa/logfault" + topics = ("logging", "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": "8", + "clang": "7", + "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"): + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.h", + 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 = [] + diff --git a/recipes/logfault/all/test_package/CMakeLists.txt b/recipes/logfault/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fcdef5afc6817 --- /dev/null +++ b/recipes/logfault/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(LOGFAULT REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE logfault::logfault) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logfault/all/test_package/conanfile.py b/recipes/logfault/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/logfault/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/logfault/all/test_package/test_package.cpp b/recipes/logfault/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a80ce4ba7c1ff --- /dev/null +++ b/recipes/logfault/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ + +// General tests for manual testing during development + +#include +#include "logfault/logfault.h" + +using namespace std; + +int main( int argc, char *argv[]) { + + logfault::LogManager::Instance().AddHandler(std::make_unique(clog, logfault::LogLevel::DEBUGGING)); + LFLOG_INFO << "Testing" << 1 << 2 << 3; +} diff --git a/recipes/logfault/config.yml b/recipes/logfault/config.yml new file mode 100644 index 0000000000000..ccf525f369b0e --- /dev/null +++ b/recipes/logfault/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.2": + folder: all diff --git a/recipes/logr/0.1.0/conanfile.py b/recipes/logr/0.1.0/conanfile.py index 967c8e88b68f9..81afa6869020b 100644 --- a/recipes/logr/0.1.0/conanfile.py +++ b/recipes/logr/0.1.0/conanfile.py @@ -46,13 +46,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/9.1.0") + self.requires("fmt/10.2.0") if self.options.backend == "spdlog": - self.requires("spdlog/1.11.0") + self.requires("spdlog/1.13.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") + self.requires("log4cplus/2.1.1") def package_id(self): self.info.clear() diff --git a/recipes/logr/all/test_package/CMakeLists.txt b/recipes/logr/all/test_package/CMakeLists.txt index 5e62d2b8b4d92..de1cf3ed2d8fc 100644 --- a/recipes/logr/all/test_package/CMakeLists.txt +++ b/recipes/logr/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(logr REQUIRED) diff --git a/recipes/logr/all/test_v1_package/CMakeLists.txt b/recipes/logr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 77c0a1e824e62..0000000000000 --- a/recipes/logr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -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/test_package.cpp) -target_link_libraries(${PROJECT_NAME} logr::logr) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/logr/all/test_v1_package/conanfile.py b/recipes/logr/all/test_v1_package/conanfile.py deleted file mode 100644 index 923245bfa853d..0000000000000 --- a/recipes/logr/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class LogrTestConan(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/logr/config.yml b/recipes/logr/config.yml index 71c5abd93f78c..afa3309f2914c 100644 --- a/recipes/logr/config.yml +++ b/recipes/logr/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.0": + folder: v0.7 "0.6.0": folder: all "0.5.1": diff --git a/recipes/logr/v0.7/conandata.yml b/recipes/logr/v0.7/conandata.yml new file mode 100644 index 0000000000000..745404ba635bc --- /dev/null +++ b/recipes/logr/v0.7/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.0": + url: "https://github.com/ngrodzitski/logr/archive/v0.7.0.tar.gz" + sha256: "b43b6624a9223bcb0a11c83afb3df69ef4388d42abef9abb1b80fbc85b890287" diff --git a/recipes/logr/v0.7/conanfile.py b/recipes/logr/v0.7/conanfile.py new file mode 100644 index 0000000000000..7eee46ae5d249 --- /dev/null +++ b/recipes/logr/v0.7/conanfile.py @@ -0,0 +1,140 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy, rm +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs +import os + +required_conan_version = ">=1.50.0" + + +class LogrConan(ConanFile): + name = "logr" + 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", "header-only") + settings = "os", "arch", "compiler", "build_type" + package_type = "header-library" + options = { + "with_spdlog": [True, False], + "with_glog": [True, False], + "with_log4cplus": [True, False], + "with_boostlog": [True, False], + } + default_options = { + "with_spdlog": True, + "with_glog": False, + "with_log4cplus": False, + "with_boostlog": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "gcc": "10", + "clang": "11", + "apple-clang": "12", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("fmt/10.2.1") + + if self.options.with_spdlog: + self.requires("spdlog/1.12.0") + + if self.options.with_glog: + self.requires("glog/0.6.0") + + if self.options.with_log4cplus: + self.requires("log4cplus/2.1.0") + + if self.options.with_boostlog: + self.requires("boost/1.83.0") + + def package_id(self): + self.info.settings.clear() + + def validate(self): + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) + + check_min_vs(self, 192) + + 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 minimum {self.settings.compiler} version of {minimum_version}" + ) + + def build(self): + pass + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "*.*pp", src=os.path.join(self.source_folder, "logr", "include"), dst=os.path.join(self.package_folder, "include")) + + include_folder = os.path.join(self.package_folder, "include", "logr") + if not self.options.with_spdlog: + rm(self, "spdlog_backend.hpp", include_folder) + + if not self.options.with_glog: + rm(self, "glog_backend.hpp", include_folder) + + if not self.options.with_log4cplus: + rm(self, "log4cplus_backend.hpp", include_folder) + + if not self.options.with_boostlog: + rm(self, "boostlog_backend.hpp", include_folder) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.components["logr_base"].includedirs = ["include"] + self.cpp_info.components["logr_base"].requires = ["fmt::fmt"] + + if self.options.with_spdlog: + self.cpp_info.components["logr_spdlog"].includedirs = [] + self.cpp_info.components["logr_spdlog"].requires = [ + "logr_base", + "spdlog::spdlog", + ] + + if self.options.with_glog: + self.cpp_info.components["logr_glog"].includedirs = [] + self.cpp_info.components["logr_glog"].requires = [ + "logr_base", + "glog::glog", + ] + + if self.options.with_log4cplus: + self.cpp_info.components["logr_log4cplus"].includedirs = [] + self.cpp_info.components["logr_log4cplus"].requires = [ + "logr_base", + "log4cplus::log4cplus", + ] + + if self.options.with_boostlog: + self.cpp_info.components["logr_boostlog"].includedirs = [] + self.cpp_info.components["logr_boostlog"].requires = [ + "logr_base", + "boost::log", + ] diff --git a/recipes/logr/v0.7/test_package/CMakeLists.txt b/recipes/logr/v0.7/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..de1cf3ed2d8fc --- /dev/null +++ b/recipes/logr/v0.7/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(logr REQUIRED) + +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/v0.7/test_package/conanfile.py b/recipes/logr/v0.7/test_package/conanfile.py new file mode 100644 index 0000000000000..f5cf204295e19 --- /dev/null +++ b/recipes/logr/v0.7/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/logr/v0.7/test_package/test_package.cpp b/recipes/logr/v0.7/test_package/test_package.cpp new file mode 100644 index 0000000000000..27d9ac363797b --- /dev/null +++ b/recipes/logr/v0.7/test_package/test_package.cpp @@ -0,0 +1,46 @@ +// Logger frontend library for C++. +// +// Copyright (c) 2020 - present, Nicolai Grodzitski +// See LICENSE file in the root of the project. + + +#include + +#include +#include + + +int main() { + auto logger = logr::basic_ostream_logger_t<1024u>(std::cout); + + logger.info( "Hello World! [raw message]" ); + logger.info( LOGR_SRC_LOCATION, "Hello World! [raw message]" ); + + logger.info( []() { return "Hello World! [cb]"; } ); + logger.info( LOGR_SRC_LOCATION, []() { return "Hello World! [cb]"; } ); + + logger.info( []( auto out ) { + format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" ); + } ); + + logger.info( LOGR_SRC_LOCATION, []( auto out ) { + format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" ); + } ); + logger.info( LOGR_SRC_LOCATION, []( auto out ) { + format_to( out, + FMT_STRING( "Hello {}! [{}]" ), + "World", + "cb with explicit out and FMT_STRING" ); + } ); + + logger.info( LOGR_SRC_LOCATION, []( auto out ) { + format_to( out, + fmt::runtime( "Hello {}! [{}]" ), + "World", + "cb with explicit out and runtime-string" ); + } ); + + logger.flush(); + + return 0; +} diff --git a/recipes/loguru/all/test_package/CMakeLists.txt b/recipes/loguru/all/test_package/CMakeLists.txt index aba0bad284220..1bca79fe7a794 100644 --- a/recipes/loguru/all/test_package/CMakeLists.txt +++ b/recipes/loguru/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(loguru REQUIRED CONFIG) diff --git a/recipes/loguru/all/test_v1_package/CMakeLists.txt b/recipes/loguru/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/loguru/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/loguru/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/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 ac7d7d333e78b..e0937f2a8bc1f 100644 --- a/recipes/ls-qpack/all/conandata.yml +++ b/recipes/ls-qpack/all/conandata.yml @@ -1,4 +1,7 @@ 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" @@ -6,17 +9,15 @@ sources: url: "https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.1.tar.gz" sha256: "dae1c159afc8541d51c12f5ad78209fe092815d37cb621b5ee46a9db049a283f" patches: - "2.5.3": + "2.5.4": - patch_file: "patches/2.5.1-0001-use-cci-package.patch" patch_description: "use cci packages" patch_type: "conan" - - patch_file: "patches/2.5.3-0002-add-installer.patch" - patch_description: "add installer" + "2.5.3": + - patch_file: "patches/2.5.1-0001-use-cci-package.patch" + patch_description: "use cci packages" patch_type: "conan" "2.5.1": - patch_file: "patches/2.5.1-0001-use-cci-package.patch" patch_description: "use cci packages" patch_type: "conan" - - patch_file: "patches/2.5.1-0002-add-installer.patch" - patch_description: "add installer" - patch_type: "conan" diff --git a/recipes/ls-qpack/all/conanfile.py b/recipes/ls-qpack/all/conanfile.py index 89421636cbe72..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": @@ -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/2.5.1-0001-use-cci-package.patch b/recipes/ls-qpack/all/patches/2.5.1-0001-use-cci-package.patch index 48af51a011e2d..4dd248246392c 100644 --- 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 @@ -1,8 +1,6 @@ -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 "") +--- 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) @@ -10,8 +8,5 @@ index d9d9aa3..826e99b 100644 if(LSQPACK_XXH) + find_package(xxHash REQUIRED CONFIG) - target_sources(ls-qpack PRIVATE deps/xxhash/xxhash.c) -+ # target_sources(ls-qpack PRIVATE deps/xxhash/xxhash.c) + target_link_libraries(ls-qpack PUBLIC xxHash::xxhash) endif() - - if(MSVC) diff --git a/recipes/ls-qpack/all/patches/2.5.1-0002-add-installer.patch b/recipes/ls-qpack/all/patches/2.5.1-0002-add-installer.patch deleted file mode 100644 index 1acf784e4597a..0000000000000 --- a/recipes/ls-qpack/all/patches/2.5.1-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.3-0002-add-installer.patch b/recipes/ls-qpack/all/patches/2.5.3-0002-add-installer.patch deleted file mode 100644 index bc34f0724108a..0000000000000 --- a/recipes/ls-qpack/all/patches/2.5.3-0002-add-installer.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7f7cd40..70e8fa8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -102,3 +102,18 @@ endif() - if(LSQPACK_BIN) - add_subdirectory(bin) - endif() -+ -+include(GNUInstallDirs) -+ -+install( -+ TARGETS ls-qpack -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+) -+ -+install(FILES lsqpack.h DESTINATION include) -+ -+if(WIN32) -+ install(DIRECTORY wincompat DESTINATION include) -+endif() diff --git a/recipes/ls-qpack/all/test_package/CMakeLists.txt b/recipes/ls-qpack/all/test_package/CMakeLists.txt index 20bf4d87148f5..4414c3295915e 100644 --- a/recipes/ls-qpack/all/test_package/CMakeLists.txt +++ b/recipes/ls-qpack/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(ls-qpack REQUIRED CONFIG) diff --git a/recipes/ls-qpack/all/test_v1_package/CMakeLists.txt b/recipes/ls-qpack/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/ls-qpack/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ls-qpack/all/test_v1_package/conanfile.py b/recipes/ls-qpack/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/ls-qpack/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/ls-qpack/config.yml b/recipes/ls-qpack/config.yml index cbd3f0133afbb..7b62b895ae661 100644 --- a/recipes/ls-qpack/config.yml +++ b/recipes/ls-qpack/config.yml @@ -1,4 +1,6 @@ versions: + "2.5.4": + folder: all "2.5.3": folder: all "2.5.1": diff --git a/recipes/lua/all/CMakeLists.txt b/recipes/lua/all/CMakeLists.txt index ed493a41f2982..332bf87f42640 100644 --- a/recipes/lua/all/CMakeLists.txt +++ b/recipes/lua/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.15) project(lua) # The following was originally taken from: https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/lua/CMakeLists.txt @@ -63,46 +63,36 @@ IF (UNIX) ENDIF () ENDIF () +include(GNUInstallDirs) + INSTALL ( TARGETS lua - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin - LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib - ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) -IF (NOT DEFINED SKIP_INSTALL_TOOLS) +IF (NOT SKIP_INSTALL_TOOLS) ADD_EXECUTABLE ( luac ${SRC_LUAC} ${SRC_LIBLUA} ) # compiler uses non-exported APIs, so must include sources directly. ADD_EXECUTABLE ( luai ${SRC_LUAI} ) # interpreter TARGET_LINK_LIBRARIES ( luai lua ) SET_TARGET_PROPERTIES ( luai PROPERTIES OUTPUT_NAME lua PDB_NAME luai ) - IF (UNIX) - IF (CMAKE_SYSTEM_NAME STREQUAL FreeBSD) - SET (_LIB_READLINE_NAME edit) - ELSE () - SET (_LIB_READLINE_NAME readline) - ENDIF () - FIND_LIBRARY (LIB_READLINE NAMES ${_LIB_READLINE_NAME}) - IF (LIB_READLINE) - TARGET_COMPILE_DEFINITIONS (luai PUBLIC -DLUA_USE_READLINE) - TARGET_LINK_LIBRARIES(luai ${LIB_READLINE}) - IF (_LIB_READLINE_NAME STREQUAL edit) - TARGET_INCLUDE_DIRECTORIES (luai PUBLIC /usr/include/edit) - ENDIF () - ENDIF () + IF (WITH_READLINE) + find_package(readline REQUIRED CONFIG) + TARGET_COMPILE_DEFINITIONS (luai PUBLIC -DLUA_USE_READLINE) + TARGET_LINK_LIBRARIES(luai readline::readline) ENDIF () - INSTALL ( TARGETS luai luac RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/tools/lua ) + INSTALL ( TARGETS luai luac RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) ENDIF () -IF (NOT DEFINED SKIP_INSTALL_HEADERS) - INSTALL( - FILES - ${SOURCE_DIR}/src/lualib.h - ${SOURCE_DIR}/src/lua.h - ${SOURCE_DIR}/src/luaconf.h - ${SOURCE_DIR}/src/lauxlib.h - DESTINATION include - ) - # If using C++, don't install extern "C" wrapper. - IF (NOT COMPILE_AS_CPP) - INSTALL(FILES ${SOURCE_DIR}/src/lua.hpp DESTINATION include) - ENDIF () +INSTALL( + FILES + ${SOURCE_DIR}/src/lualib.h + ${SOURCE_DIR}/src/lua.h + ${SOURCE_DIR}/src/luaconf.h + ${SOURCE_DIR}/src/lauxlib.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) +# If using C++, don't install extern "C" wrapper. +IF (NOT COMPILE_AS_CPP) + INSTALL(FILES ${SOURCE_DIR}/src/lua.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ENDIF () diff --git a/recipes/lua/all/conandata.yml b/recipes/lua/all/conandata.yml index 8ec9d4e74c4ed..c45d4283f1442 100644 --- a/recipes/lua/all/conandata.yml +++ b/recipes/lua/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.4.7": + url: "https://www.lua.org/ftp/lua-5.4.7.tar.gz" + sha256: "9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30" "5.4.6": url: "https://www.lua.org/ftp/lua-5.4.6.tar.gz" sha256: "7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88" diff --git a/recipes/lua/all/conanfile.py b/recipes/lua/all/conanfile.py index 72ee3c59253a9..2abdd343786b8 100644 --- a/recipes/lua/all/conanfile.py +++ b/recipes/lua/all/conanfile.py @@ -1,12 +1,13 @@ import os 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.files import get, copy, load, save, export_conandata_patches, apply_conandata_patches, collect_libs from conan.tools.apple import fix_apple_shared_install_name -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LuaConan(ConanFile): @@ -22,11 +23,15 @@ class LuaConan(ConanFile): "shared": [False, True], "fPIC": [True, False], "compile_as_cpp": [True, False], + "with_tools": [True, False], + "with_readline": [True, False], } default_options = { "shared": False, "fPIC": True, "compile_as_cpp": False, + "with_tools": False, + "with_readline": False, } def export_sources(self): @@ -47,15 +52,26 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + if self.options.with_tools and self.options.with_readline: + self.requires("readline/8.2") + + def validate(self): + if not self.options.with_tools and self.options.with_readline: + raise ConanInvalidConfiguration(f"{self.ref} requires readline only with with_tools=True") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) tc.variables["LUA_SRC_DIR"] = self.source_folder.replace("\\", "/") - tc.variables["SKIP_INSTALL_TOOLS"] = True tc.variables["COMPILE_AS_CPP"] = self.options.compile_as_cpp + tc.variables["SKIP_INSTALL_TOOLS"] = not self.options.with_tools + tc.variables["WITH_READLINE"] = self.options.with_readline tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) diff --git a/recipes/lua/all/test_package/CMakeLists.txt b/recipes/lua/all/test_package/CMakeLists.txt index 452e652d03775..7fd19e2f2fb51 100644 --- a/recipes/lua/all/test_package/CMakeLists.txt +++ b/recipes/lua/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(lua REQUIRED CONFIG) diff --git a/recipes/lua/all/test_v1_package/CMakeLists.txt b/recipes/lua/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 1241d9397ce36..0000000000000 --- a/recipes/lua/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -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/lua/all/test_v1_package/conanfile.py b/recipes/lua/all/test_v1_package/conanfile.py deleted file mode 100644 index df7c8083a43c2..0000000000000 --- a/recipes/lua/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -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) - # Only for the test package, so we can choose which #include header to use - cmake.definitions["COMPILE_AS_CPP"] = self.options["lua"].compile_as_cpp - - 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/lua/config.yml b/recipes/lua/config.yml index 2b62e0c775189..00a91f7d773a9 100644 --- a/recipes/lua/config.yml +++ b/recipes/lua/config.yml @@ -1,4 +1,6 @@ versions: + "5.4.7": + folder: all "5.4.6": folder: all "5.4.4": diff --git a/recipes/luajit/all/conandata.yml b/recipes/luajit/all/conandata.yml index 1e7abff8db36b..0617a7db6d602 100644 --- a/recipes/luajit/all/conandata.yml +++ b/recipes/luajit/all/conandata.yml @@ -1,10 +1,11 @@ +# INFO: Upstream moved to rolling releases and removed all tarballs. +# The Github mirror (https://github.com/LuaJIT/LuaJIT) does not match the checksums and have missing header files. +# Conan will consume the backup sources from the Conan Center Artifactory instead, which are the original tarballs (same checksums). +# Read the issue https://github.com/conan-io/conan-center-index/issues/25032 for more information. sources: "2.1.0-beta3": - url: "https://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz" + url: "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3" sha256: "1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3" - "2.0.5": - url: "http://luajit.org/download/LuaJIT-2.0.5.tar.gz" - sha256: "874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979" patches: "2.1.0-beta3": - patch_file: "patches/2.1.0-beta3-0001-remove-mac-deploy.patch" diff --git a/recipes/luajit/all/conanfile.py b/recipes/luajit/all/conanfile.py index 47079e98290b1..1a87a46c223ac 100644 --- a/recipes/luajit/all/conanfile.py +++ b/recipes/luajit/all/conanfile.py @@ -48,7 +48,8 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} is not supported by Mac M1. Please, try any version >=2.1") def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + filename = f"LuaJIT-{self.version}.tar.gz" + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, filename=filename, strip_root=True) def generate(self): if is_msvc(self): diff --git a/recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch b/recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch deleted file mode 100644 index 42e0eca4a7fb6..0000000000000 --- a/recipes/luajit/all/patches/20230104-0001-remove-mac-deploy.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/Makefile b/src/Makefile -index 30d64be..b753ea1 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -316,9 +316,6 @@ ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null -fno-stack-protector - TARGET_XCFLAGS+= -fno-stack-protector - endif - ifeq (Darwin,$(TARGET_SYS)) -- ifeq (,$(MACOSX_DEPLOYMENT_TARGET)) -- $(error missing: export MACOSX_DEPLOYMENT_TARGET=XX.YY) -- endif - TARGET_STRIP+= -x - TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL - TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC diff --git a/recipes/luajit/all/test_v1_package/CMakeLists.txt b/recipes/luajit/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2f6b1a2f7ec79..0000000000000 --- a/recipes/luajit/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/luajit/all/test_v1_package/conanfile.py b/recipes/luajit/all/test_v1_package/conanfile.py deleted file mode 100644 index 9d6b68dd18b5e..0000000000000 --- a/recipes/luajit/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", "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): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/luajit/config.yml b/recipes/luajit/config.yml index f13e8f0f1a9ec..72c6723e528aa 100644 --- a/recipes/luajit/config.yml +++ b/recipes/luajit/config.yml @@ -1,5 +1,3 @@ versions: "2.1.0-beta3": folder: "all" - "2.0.5": - folder: "all" diff --git a/recipes/luau/all/conandata.yml b/recipes/luau/all/conandata.yml index 6f3f5ad765cc1..ec6e9a55b6a4d 100644 --- a/recipes/luau/all/conandata.yml +++ b/recipes/luau/all/conandata.yml @@ -1,40 +1,28 @@ sources: - "0.603": - url: "https://github.com/Roblox/luau/archive/0.603.tar.gz" - sha256: "97687486b0ffe8d7a4917e13648a9776ee015ca9e1c10b6da169caec6ca5b427" - "0.598": - url: "https://github.com/Roblox/luau/archive/0.598.tar.gz" - sha256: "a2bab4b513fe5f2fe174c45de4807846e6ce83420c9ba7a34c81c48b99e01c98" - "0.593": - url: "https://github.com/Roblox/luau/archive/0.593.tar.gz" - sha256: "1cbe4390ef71bb0f2210853978c900974aa02fab73de92b6e18e7bb10dd0e3c1" - "0.589": - url: "https://github.com/Roblox/luau/archive/0.589.tar.gz" - sha256: "dc4489de52dbf29cd3d04d78c1112f812e04a03b68d57585749260ba791e65ed" - "0.582": - url: "https://github.com/Roblox/luau/archive/0.582.tar.gz" - sha256: "ee6da6329e58afc956bcca907ed9c6bc0455cd580990aa73f7cfb285aea22a6d" - "0.577": - url: "https://github.com/Roblox/luau/archive/0.577.tar.gz" - sha256: "4fd3f0d7a3bb6a9f4ed69711d261c4ae6ab6dfe8eb8e444f738c3338c559c7c8" - "0.572": - url: "https://github.com/Roblox/luau/archive/0.572.tar.gz" - sha256: "5cdd13233eefc4b3f27970118272254a24be81fafcccf60e7a29391fbc529151" - "0.568": - url: "https://github.com/Roblox/luau/archive/0.568.tar.gz" - sha256: "8218f1943b53439b9cc076bcb6d6223c089093659cc75dda6e2695ee9b370a8c" - "0.563": - url: "https://github.com/Roblox/luau/archive/0.563.tar.gz" - sha256: "717c1b3e03d20829d75eb484e0699fc824b651b8f394164bc4ab8194482890b2" - "0.558": - url: "https://github.com/Roblox/luau/archive/0.558.tar.gz" - sha256: "3484adddb18872700e033f5917af44d90c266f9e0fff2fac21aec1061f472a06" -patches: - "0.563": - - 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.536-0002-rename-lerp.patch" - patch_description: "rename lerp function to avoid name conflict" - patch_type: "portability" + "0.667": + url: "https://github.com/Roblox/luau/archive/0.667.tar.gz" + sha256: "a8ffc0c8505fb0546f9d0007f3a2c74b08e602f5a6b864381e3a24fd74e936bc" + "0.655": + url: "https://github.com/Roblox/luau/archive/0.655.tar.gz" + sha256: "1c0ff05ce18493d6c83062a17cf6822a71ce254bfa0db41dd086d313b674ca33" + "0.650": + url: "https://github.com/Roblox/luau/archive/0.650.tar.gz" + sha256: "a605ae7a188455844ab131ff0d2df6f38c088142d6bd5eebb87795e619c3d7aa" + "0.645": + url: "https://github.com/Roblox/luau/archive/0.645.tar.gz" + sha256: "28aaa3e57e7adc44debedc6be9802f2625334eef0124ff722c8ab340dc6bbe1c" + "0.640": + url: "https://github.com/Roblox/luau/archive/0.640.tar.gz" + sha256: "63ada3e4c8c17e5aff8964b16951bfd1b567329dd81c11ae1144b6e95f354762" + "0.635": + url: "https://github.com/Roblox/luau/archive/0.635.tar.gz" + sha256: "b2ec66070bb53ab9c26e41608dd75c9672c942cf0738c4b965c5eb956a954910" + "0.630": + url: "https://github.com/Roblox/luau/archive/0.630.tar.gz" + sha256: "601938ebd428d37c2bb10697500bff4fe304f7c0651cf64721b9dc5600a30ed9" + "0.625": + url: "https://github.com/Roblox/luau/archive/0.625.tar.gz" + sha256: "4dd9295a67c2de6536b6e1208ea81cebfc5caefadcdacd7e09341c7a1dbbb9e2" + "0.620": + url: "https://github.com/Roblox/luau/archive/0.620.tar.gz" + sha256: "a6ae1f0396334e72b1241dabb73aa123037613f3276bf2e71d0dc75568b1eb52" diff --git a/recipes/luau/all/conanfile.py b/recipes/luau/all/conanfile.py index 643eab7b93170..dda97f96ca72a 100644 --- a/recipes/luau/all/conanfile.py +++ b/recipes/luau/all/conanfile.py @@ -1,6 +1,6 @@ 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.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 @@ -45,7 +45,6 @@ def _compilers_minimum_version(self): def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) - export_conandata_patches(self) def layout(self): cmake_layout(self, src_folder="src") @@ -73,11 +72,7 @@ def generate(self): tc.variables["LUAU_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.generate() - def _patch_sources(self): - apply_conandata_patches(self) - def build(self): - self._patch_sources() cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() diff --git a/recipes/luau/all/patches/0.536-0002-rename-lerp.patch b/recipes/luau/all/patches/0.536-0002-rename-lerp.patch deleted file mode 100644 index 324b7d737bf16..0000000000000 --- a/recipes/luau/all/patches/0.536-0002-rename-lerp.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/VM/src/lmathlib.cpp b/VM/src/lmathlib.cpp -index a6e7b49..7c3e3c6 100644 ---- a/VM/src/lmathlib.cpp -+++ b/VM/src/lmathlib.cpp -@@ -300,7 +300,7 @@ static float fade(float t) - return t * t * t * (t * (t * 6 - 15) + 10); - } - --static float lerp(float t, float a, float b) -+static float lerp_l(float t, float a, float b) - { - return a + t * (b - a); - } -@@ -342,10 +342,10 @@ static float perlin(float x, float y, float z) - int ba = p[b] + zi; - int bb = p[b + 1] + zi; - -- return lerp(w, -- lerp(v, lerp(u, grad(p[aa], xf, yf, zf), grad(p[ba], xf - 1, yf, zf)), lerp(u, grad(p[ab], xf, yf - 1, zf), grad(p[bb], xf - 1, yf - 1, zf))), -- lerp(v, lerp(u, grad(p[aa + 1], xf, yf, zf - 1), grad(p[ba + 1], xf - 1, yf, zf - 1)), -- lerp(u, grad(p[ab + 1], xf, yf - 1, zf - 1), grad(p[bb + 1], xf - 1, yf - 1, zf - 1)))); -+ return lerp_l(w, -+ lerp_l(v, lerp_l(u, grad(p[aa], xf, yf, zf), grad(p[ba], xf - 1, yf, zf)), lerp_l(u, grad(p[ab], xf, yf - 1, zf), grad(p[bb], xf - 1, yf - 1, zf))), -+ lerp_l(v, lerp_l(u, grad(p[aa + 1], xf, yf, zf - 1), grad(p[ba + 1], xf - 1, yf, zf - 1)), -+ lerp_l(u, grad(p[ab + 1], xf, yf - 1, zf - 1), grad(p[bb + 1], xf - 1, yf - 1, zf - 1)))); - } - - static int math_noise(lua_State* L) diff --git a/recipes/luau/all/test_package/CMakeLists.txt b/recipes/luau/all/test_package/CMakeLists.txt index 6f927f5fc234f..28a1b5e3c24b4 100644 --- a/recipes/luau/all/test_package/CMakeLists.txt +++ b/recipes/luau/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(Luau REQUIRED CONFIG) diff --git a/recipes/luau/all/test_v1_package/CMakeLists.txt b/recipes/luau/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/luau/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/luau/all/test_v1_package/conanfile.py b/recipes/luau/all/test_v1_package/conanfile.py deleted file mode 100644 index 81a08015e01f1..0000000000000 --- a/recipes/luau/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 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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/luau/config.yml b/recipes/luau/config.yml index 80fe8362a792c..a5a9c79fec886 100644 --- a/recipes/luau/config.yml +++ b/recipes/luau/config.yml @@ -1,21 +1,19 @@ versions: - "0.603": + "0.667": folder: all - "0.598": + "0.655": folder: all - "0.593": + "0.650": folder: all - "0.589": + "0.645": folder: all - "0.582": + "0.640": folder: all - "0.577": + "0.635": folder: all - "0.572": + "0.630": folder: all - "0.568": + "0.625": folder: all - "0.563": - folder: all - "0.558": + "0.620": folder: all diff --git a/recipes/lunasvg/all/conandata.yml b/recipes/lunasvg/all/conandata.yml index ae1c5e27df269..01f4784f10bfe 100644 --- a/recipes/lunasvg/all/conandata.yml +++ b/recipes/lunasvg/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "3.0.1": + url: "https://github.com/sammycage/lunasvg/archive/v3.0.1.tar.gz" + sha256: "39e3f47d4e40f7992d7958123ca1993ff1a02887539af2af1c638da2855a603c" + "3.0.0": + url: "https://github.com/sammycage/lunasvg/archive/v3.0.0.tar.gz" + sha256: "075f0a049ff205ce059feb1fe3ac0e826a1ac62d2360cb72463395f68c4c8764" + "2.4.1": + url: "https://github.com/sammycage/lunasvg/archive/v2.4.1.tar.gz" + sha256: "db9d2134c8c2545694e71e62fb0772a7d089fe53e1ace1e08c2279a89e450534" + "2.4.0": + url: "https://github.com/sammycage/lunasvg/archive/v2.4.0.tar.gz" + sha256: "0682c60501c91d75f4261d9c1a5cd44c2c9da8dba76f8402eab628448c9a4591" + "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" @@ -15,6 +30,30 @@ sources: url: "https://github.com/sammycage/lunasvg/archive/refs/tags/v2.3.1.tar.gz" sha256: "6492bf0f51982f5382f83f1a42f247bb1bbcbaef4a15963bbd53073cd4944a25" patches: + "3.0.1": + - patch_file: "patches/3.0.0-0001-use-cci-package.patch" + patch_description: "use cci plutovg" + patch_type: "conan" + "3.0.0": + - patch_file: "patches/3.0.0-0001-use-cci-package.patch" + patch_description: "use cci plutovg" + patch_type: "conan" + "2.4.1": + - patch_file: "patches/2.4.1-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" + "2.4.0": + - patch_file: "patches/2.3.9-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" + "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" diff --git a/recipes/lunasvg/all/conanfile.py b/recipes/lunasvg/all/conanfile.py index f1db22cef3305..64ea141719c2e 100644 --- a/recipes/lunasvg/all/conanfile.py +++ b/recipes/lunasvg/all/conanfile.py @@ -1,14 +1,13 @@ 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 +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" +required_conan_version = ">=2.1" class LunaSVGConan(ConanFile): name = "lunasvg" @@ -31,28 +30,31 @@ class LunaSVGConan(ConanFile): @property 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" + if Version(self.version) >= "3.0.0": + return "17" + return "11" @property def _compilers_minimum_version(self): - if self._min_cppstd == 14: - return { + return { + "14": { "gcc": "5", "clang": "3.5", "apple-clang": "10", "Visual Studio": "15", "msvc": "191", - } - else: - return { + }, + "17": { "gcc": "7.1", "clang": "7", "apple-clang": "12.0", "Visual Studio": "16", "msvc": "192", - } + }, + }.get(self._min_cppstd, {}) def export_sources(self): export_conandata_patches(self) @@ -71,8 +73,10 @@ def layout(self): def requirements(self): if Version(self.version) < "2.3.5": self.requires("plutovg/cci.20220103") - else: + elif Version(self.version) < "3.0.0": self.requires("plutovg/cci.20221030") + else: + self.requires("plutovg/0.0.7") def validate(self): if self.info.settings.compiler.cppstd: @@ -89,11 +93,13 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_SHARED_LIBS"] = self.options.shared - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True - tc.generate() - - tc = CMakeDeps(self) + if Version(self.version) < "2.4.1": + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + tc.variables["LUNASVG_BUILD_EXAMPLES"] = False tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) @@ -106,7 +112,11 @@ def package(self): cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + def package_info(self): self.cpp_info.libs = ["lunasvg"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] + if Version(self.version) >= "2.4.1" and not self.options.shared: + self.cpp_info.defines = ["LUNASVG_BUILD_STATIC"] 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/patches/2.4.1-0001-fix-cmake.patch b/recipes/lunasvg/all/patches/2.4.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..190bb9b65c6b5 --- /dev/null +++ b/recipes/lunasvg/all/patches/2.4.1-0001-fix-cmake.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3565911..e33555e 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) + target_compile_definitions(lunasvg PRIVATE LUNASVG_BUILD) + if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(lunasvg PRIVATE LUNASVG_BUILD_STATIC) +@@ -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/3.0.0-0001-use-cci-package.patch b/recipes/lunasvg/all/patches/3.0.0-0001-use-cci-package.patch new file mode 100644 index 0000000000000..8e3b94580b37c --- /dev/null +++ b/recipes/lunasvg/all/patches/3.0.0-0001-use-cci-package.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0e7ed4b..9c4f8c7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,16 +6,16 @@ set(LUNASVG_VERSION_MICRO 0) + + project(lunasvg LANGUAGES CXX VERSION ${LUNASVG_VERSION_MAJOR}.${LUNASVG_VERSION_MINOR}.${LUNASVG_VERSION_MICRO}) + +-include(FetchContent) +-FetchContent_Declare(plutovg +- GIT_REPOSITORY https://github.com/sammycage/plutovg.git +- GIT_TAG main +- GIT_SHALLOW ON +- FIND_PACKAGE_ARGS 0.0.4 +-) +- +-FetchContent_MakeAvailable(plutovg) +- ++# include(FetchContent) ++# FetchContent_Declare(plutovg ++# GIT_REPOSITORY https://github.com/sammycage/plutovg.git ++# GIT_TAG main ++# GIT_SHALLOW ON ++# FIND_PACKAGE_ARGS 0.0.4 ++# ) ++ ++# FetchContent_MakeAvailable(plutovg) ++find_package(plutovg CONFIG REQUIRED) + set(lunasvg_sources + source/lunasvg.cpp + source/graphics.cpp +diff --git a/source/graphics.h b/source/graphics.h +index 775f53c..5676f01 100644 +--- a/source/graphics.h ++++ b/source/graphics.h +@@ -1,7 +1,7 @@ + #ifndef LUNASVG_GRAPHICS_H + #define LUNASVG_GRAPHICS_H + +-#include ++#include + + #include + #include diff --git a/recipes/lunasvg/all/test_package/CMakeLists.txt b/recipes/lunasvg/all/test_package/CMakeLists.txt index 583dafb520bda..e10571f164d36 100644 --- a/recipes/lunasvg/all/test_package/CMakeLists.txt +++ b/recipes/lunasvg/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(lunasvg REQUIRED CONFIG) @@ -7,6 +7,14 @@ add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE lunasvg::lunasvg) if (lunasvg_VERSION VERSION_LESS_EQUAL "2.3.2") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -else() +elseif (lunasvg_VERSION VERSION_LESS_EQUAL "2.3.8") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +elseif (lunasvg_VERSION VERSION_GREATER_EQUAL "3.0.0") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() + +if (lunasvg_VERSION VERSION_LESS "3.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE LUNASVG_BEFORE_3_0_0) endif() diff --git a/recipes/lunasvg/all/test_package/test_package.cpp b/recipes/lunasvg/all/test_package/test_package.cpp index 1e47dd43f1e9a..9c72aef23c7d4 100644 --- a/recipes/lunasvg/all/test_package/test_package.cpp +++ b/recipes/lunasvg/all/test_package/test_package.cpp @@ -1,4 +1,8 @@ +#ifdef LUNASVG_BEFORE_3_0_0 #include "lunasvg.h" +#else +#include "lunasvg/lunasvg.h" +#endif #include int main() { diff --git a/recipes/lunasvg/all/test_v1_package/CMakeLists.txt b/recipes/lunasvg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 596ce1fb31ebb..0000000000000 --- a/recipes/lunasvg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(lunasvg REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE lunasvg::lunasvg) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/lunasvg/all/test_v1_package/conanfile.py b/recipes/lunasvg/all/test_v1_package/conanfile.py deleted file mode 100644 index 81a08015e01f1..0000000000000 --- a/recipes/lunasvg/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 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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/lunasvg/config.yml b/recipes/lunasvg/config.yml index ff80eb38ff5be..36b14539bcd19 100644 --- a/recipes/lunasvg/config.yml +++ b/recipes/lunasvg/config.yml @@ -1,4 +1,14 @@ versions: + "3.0.1": + folder: all + "3.0.0": + folder: all + "2.4.1": + folder: all + "2.4.0": + folder: all + "2.3.9": + folder: all "2.3.8": folder: all "2.3.5": diff --git a/recipes/luple/all/test_package/CMakeLists.txt b/recipes/luple/all/test_package/CMakeLists.txt index b556daffe2a12..91dad8e3f2c96 100644 --- a/recipes/luple/all/test_package/CMakeLists.txt +++ b/recipes/luple/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(luple REQUIRED CONFIG) diff --git a/recipes/luple/all/test_v1_package/CMakeLists.txt b/recipes/luple/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/luple/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/luple/all/test_v1_package/conanfile.py b/recipes/luple/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/luple/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_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/lurlparser/all/test_package/CMakeLists.txt b/recipes/lurlparser/all/test_package/CMakeLists.txt index 2160e23166fc3..da25fb51499e8 100644 --- a/recipes/lurlparser/all/test_package/CMakeLists.txt +++ b/recipes/lurlparser/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(lurlparser REQUIRED CONFIG) diff --git a/recipes/lurlparser/all/test_v1_package/CMakeLists.txt b/recipes/lurlparser/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 44cd3222ce1e5..0000000000000 --- a/recipes/lurlparser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(lurlparser REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE lurlparser::lurlparser) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/lurlparser/all/test_v1_package/conanfile.py b/recipes/lurlparser/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/lurlparser/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/lz4/all/conandata.yml b/recipes/lz4/all/conandata.yml index fc3f8472653fd..27dd4979a6d6f 100644 --- a/recipes/lz4/all/conandata.yml +++ b/recipes/lz4/all/conandata.yml @@ -1,13 +1,13 @@ sources: + "1.10.0": + url: "https://github.com/lz4/lz4/archive/v1.10.0.tar.gz" + sha256: "537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b" "1.9.4": - sha256: 0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b - url: https://github.com/lz4/lz4/archive/v1.9.4.tar.gz + url: "https://github.com/lz4/lz4/archive/v1.9.4.tar.gz" + sha256: "0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b" "1.9.3": - sha256: 030644df4611007ff7dc962d981f390361e6c97a34e5cbc393ddfbe019ffe2c1 - url: https://github.com/lz4/lz4/archive/v1.9.3.tar.gz - "1.9.2": - sha256: 658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc - url: https://github.com/lz4/lz4/archive/v1.9.2.tar.gz + url: "https://github.com/lz4/lz4/archive/v1.9.3.tar.gz" + sha256: "030644df4611007ff7dc962d981f390361e6c97a34e5cbc393ddfbe019ffe2c1" patches: "1.9.4": - patch_file: "patches/0004-Added-namespace-declaration-for-xxhash-in-CMake.patch" @@ -18,13 +18,3 @@ patches: - patch_file: "patches/0003-cmake-minimum-required-first-1.9.3.patch" patch_description: "Move cmake_minimum_required to the top of CMakeFile.txt" patch_type: conan - "1.9.2": - - patch_file: "patches/0001-cmake-add-shared-DEFINE_SYMBOL.patch" - patch_description: "Add LZ4_DLL_EXPORT to MSVC" - patch_type: portability - - patch_file: "patches/0002-cmake-optional-cli.patch" - patch_description: "Add ability not to compile the CLI" - patch_type: conan - - patch_file: "patches/0003-cmake-minimum-required-first-1.9.2.patch" - patch_description: "Move cmake_minimum_required to the top of CMakeFile.txt" - patch_type: conan diff --git a/recipes/lz4/all/conanfile.py b/recipes/lz4/all/conanfile.py index 00e8eb7116e69..0d5f64e7dccb7 100644 --- a/recipes/lz4/all/conanfile.py +++ b/recipes/lz4/all/conanfile.py @@ -6,7 +6,7 @@ import os import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class LZ4Conan(ConanFile): @@ -16,7 +16,7 @@ class LZ4Conan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lz4/lz4" topics = ("compression") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -50,21 +50,21 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["LZ4_BUILD_CLI"] = False - tc.variables["LZ4_BUILD_LEGACY_LZ4C"] = False + if Version(self.version) < "1.10.0": + tc.variables["LZ4_BUILD_LEGACY_LZ4C"] = False tc.variables["LZ4_BUNDLED_MODE"] = False tc.variables["LZ4_POSITION_INDEPENDENT_LIB"] = self.options.get_safe("fPIC", True) # Generate a relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" # Honor BUILD_SHARED_LIBS (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + if Version(self.version) < "1.10.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() @property def _cmakelists_folder(self): - if Version(self.version) < "1.9.3": - subfolder = os.path.join("contrib", "cmake_unofficial") - else: - subfolder = os.path.join("build", "cmake") + subfolder = os.path.join("build", "cmake") return os.path.join(self.source_folder, subfolder) def build(self): @@ -73,21 +73,6 @@ def build(self): cmake.configure(build_script_folder=self._cmakelists_folder) cmake.build() - 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(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) @@ -97,12 +82,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - # 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._lz4_target: "lz4::lz4"}, - ) - @property def _lz4_target(self): return f"LZ4::{'lz4_shared' if self.options.shared else 'lz4_static'}" @@ -115,8 +94,3 @@ def package_info(self): self.cpp_info.libs = ["lz4"] if is_msvc(self) and self.options.shared: self.cpp_info.defines.append("LZ4_DLL_IMPORT=1") - - # TODO: to remove in conan v2 once legacy 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"] = "liblz4" diff --git a/recipes/lz4/all/patches/0001-cmake-add-shared-DEFINE_SYMBOL.patch b/recipes/lz4/all/patches/0001-cmake-add-shared-DEFINE_SYMBOL.patch deleted file mode 100644 index 5de5fbc440858..0000000000000 --- a/recipes/lz4/all/patches/0001-cmake-add-shared-DEFINE_SYMBOL.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- contrib/cmake_unofficial/CMakeLists.txt -+++ contrib/cmake_unofficial/CMakeLists.txt -@@ -103,9 +103,13 @@ - if(BUILD_SHARED_LIBS) - add_library(lz4_shared SHARED ${LZ4_SOURCES}) - set_target_properties(lz4_shared PROPERTIES - OUTPUT_NAME lz4 - SOVERSION "${LZ4_VERSION_MAJOR}" - VERSION "${LZ4_VERSION_STRING}") - list(APPEND LZ4_LIBRARIES_BUILT lz4_shared) -+ if(MSVC) -+ set_target_properties(lz4_shared PROPERTIES -+ DEFINE_SYMBOL LZ4_DLL_EXPORT=1) -+ endif() - endif() - if(BUILD_STATIC_LIBS) diff --git a/recipes/lz4/all/patches/0002-cmake-optional-cli.patch b/recipes/lz4/all/patches/0002-cmake-optional-cli.patch deleted file mode 100644 index b2fe91a0e8bf9..0000000000000 --- a/recipes/lz4/all/patches/0002-cmake-optional-cli.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/contrib/cmake_unofficial/CMakeLists.txt -+++ b/contrib/cmake_unofficial/CMakeLists.txt -@@ -12,6 +12,7 @@ - - set(LZ4_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") - -+option(LZ4_BUILD_CLI "Build lz4 program" ON) - option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) - - # Parse version information -@@ -128,10 +129,12 @@ else() - endif() - - # lz4 -+if(LZ4_BUILD_CLI) - set(LZ4_PROGRAMS_BUILT lz4cli) - add_executable(lz4cli ${LZ4_CLI_SOURCES}) - set_target_properties(lz4cli PROPERTIES OUTPUT_NAME lz4) - target_link_libraries(lz4cli ${LZ4_LINK_LIBRARY}) -+endif() - - # lz4c - if (LZ4_BUILD_LEGACY_LZ4C) -@@ -193,7 +196,7 @@ if(NOT LZ4_BUNDLED_MODE) - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - - # install lz4cat and unlz4 symlinks on *nix -- if(UNIX) -+ if(UNIX AND LZ4_BUILD_CLI) - install(CODE " - foreach(f lz4cat unlz4) - set(dest \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/\${f}\") -@@ -209,7 +212,7 @@ if(NOT LZ4_BUNDLED_MODE) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${f}.1" - DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") - endforeach() -- endif(UNIX) -+ endif(UNIX AND LZ4_BUILD_CLI) - endif(NOT LZ4_BUNDLED_MODE) - - # pkg-config diff --git a/recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.2.patch b/recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.2.patch deleted file mode 100644 index 2333a27871ed9..0000000000000 --- a/recipes/lz4/all/patches/0003-cmake-minimum-required-first-1.9.2.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/contrib/cmake_unofficial/CMakeLists.txt -+++ b/contrib/cmake_unofficial/CMakeLists.txt -@@ -9,11 +9,10 @@ - # - # LZ4's CMake support is maintained by Evan Nemerson; when filing - # bugs please mention @nemequ to make sure I see it. -+cmake_minimum_required (VERSION 2.8.6) - - set(LZ4_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") - --option(LZ4_BUILD_CLI "Build lz4 program" ON) --option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) - - # Parse version information - file(STRINGS "${LZ4_TOP_SOURCE_DIR}/lib/lz4.h" LZ4_VERSION_MAJOR REGEX "^#define LZ4_VERSION_MAJOR +([0-9]+) +.*$") -@@ -34,7 +33,8 @@ else() - LANGUAGES C) - endif() - --cmake_minimum_required (VERSION 2.8.6) -+option(LZ4_BUILD_CLI "Build lz4 program" ON) -+option(LZ4_BUILD_LEGACY_LZ4C "Build lz4c progam with legacy argument support" ON) - - # If LZ4 is being bundled in another project, we don't want to - # install anything. However, we want to let people override this, so diff --git a/recipes/lz4/all/test_package/CMakeLists.txt b/recipes/lz4/all/test_package/CMakeLists.txt index 14b12b7977c2c..6b404b84dbc9c 100644 --- a/recipes/lz4/all/test_package/CMakeLists.txt +++ b/recipes/lz4/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(lz4 REQUIRED CONFIG) diff --git a/recipes/lz4/all/test_v1_package/CMakeLists.txt b/recipes/lz4/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f9324f7603fe8..0000000000000 --- a/recipes/lz4/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(lz4 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -if(TARGET LZ4::lz4_static) - target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_static) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE LZ4::lz4_shared) -endif() - -option(TEST_SHARED_LIB "Use package in a shared library") -if(TEST_AS_SHARED_LIB) - add_library(${PROJECT_NAME}2 SHARED ../test_package/lib.c) - if(TARGET LZ4::lz4_static) - target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_static) - else() - target_link_libraries(${PROJECT_NAME}2 PRIVATE LZ4::lz4_shared) - endif() -endif() diff --git a/recipes/lz4/all/test_v1_package/conanfile.py b/recipes/lz4/all/test_v1_package/conanfile.py deleted file mode 100644 index 77061a2f84fa0..0000000000000 --- a/recipes/lz4/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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["TEST_SHARED_LIB"] = dict(self.options["lz4"].items()).get("fPIC", True) - 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/lz4/config.yml b/recipes/lz4/config.yml index f96920e268df8..7af8322c88129 100644 --- a/recipes/lz4/config.yml +++ b/recipes/lz4/config.yml @@ -1,7 +1,7 @@ versions: + "1.10.0": + folder: all "1.9.4": folder: all "1.9.3": folder: all - "1.9.2": - folder: all diff --git a/recipes/lzfse/all/conanfile.py b/recipes/lzfse/all/conanfile.py index a6aa023686644..cae4538c83fd7 100644 --- a/recipes/lzfse/all/conanfile.py +++ b/recipes/lzfse/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class LzfseConan(ConanFile): @@ -50,6 +50,7 @@ def generate(self): tc.variables["LZFSE_DISABLE_TESTS"] = False # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -67,6 +68,3 @@ def package_info(self): self.cpp_info.libs = ["lzfse"] if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines.append("LZFSE_DLL") - - # TODO: to remove in conan v2 - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/lzfse/all/test_package/CMakeLists.txt b/recipes/lzfse/all/test_package/CMakeLists.txt index 9e7bf97eca042..a06d9ef020af2 100644 --- a/recipes/lzfse/all/test_package/CMakeLists.txt +++ b/recipes/lzfse/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(lzfse REQUIRED CONFIG) diff --git a/recipes/lzfse/all/test_v1_package/CMakeLists.txt b/recipes/lzfse/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/lzfse/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/lzfse/all/test_v1_package/conanfile.py b/recipes/lzfse/all/test_v1_package/conanfile.py deleted file mode 100644 index 4e6c8eb3b50fd..0000000000000 --- a/recipes/lzfse/all/test_v1_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 = os.path.join("bin", "test_package") - txt_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.txt") - self.run(f"{bin_path} -encode -i {txt_path}", run_environment=True) diff --git a/recipes/lzham/all/conanfile.py b/recipes/lzham/all/conanfile.py index b1b9dc2a684e4..22f97343a706c 100644 --- a/recipes/lzham/all/conanfile.py +++ b/recipes/lzham/all/conanfile.py @@ -1,19 +1,21 @@ 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 ( apply_conandata_patches, copy, export_conandata_patches, get, + replace_in_file, rmdir ) from conan.tools.microsoft import ( MSBuild, MSBuildDeps, MSBuildToolchain, VCVars, is_msvc, vs_layout ) -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" SLN_FILE = "lzham.sln" @@ -51,6 +53,28 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def validate(self): + if self.settings.os == "Windows" and self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration("On Windows, only x86 and x86_64 are supported") + + def _msvc_libs(self, targets=False): + arch = "x86" if self.settings.arch == "x86" else "x64" + suffix = f"{arch}D" if self.settings.build_type == "Debug" else arch + if self.options.shared == True: + if targets: + # Note: this causes its dependencies to be built too + return ['lzhamdll'] + + files = [f"lzham_{suffix}.dll", f"lzham_{suffix}.lib"] + else: + libs = ['lzhamcomp', 'lzhamdecomp', 'lzhamlib'] + if targets: + return libs + + files = [f"{lib}_{suffix}.lib" for lib in libs] + + return files + def layout(self): if is_msvc(self): vs_layout(self) @@ -79,10 +103,22 @@ def generate(self): # Honor BUILD_SHARED_LIBS from conan_toolchain (see # https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + + # Build relocatable shared libraries on Apple OSs + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): apply_conandata_patches(self) + for project in ['lzhamcomp', 'lzhamdecomp', 'lzhamdll', 'lzhamlib']: + filename = 'lzham' if project == 'lzhamdll' else project + vcxproj_file = os.path.join(self.source_folder, project, f"{filename}.vcxproj") + # Avoid errors when the toolset on the consumer side is not exactly the same version + replace_in_file(self, vcxproj_file, "WholeProgramOptimization>true", "WholeProgramOptimization>false") + # Don't override the runtime library set by Conan's MSBuildToolchain + replace_in_file(self, vcxproj_file, "MultiThreaded", "") + replace_in_file(self, vcxproj_file, "MultiThreadedDebug", "") if is_msvc(self): msbuild = MSBuild(self) msbuild.build_type = ( @@ -91,7 +127,7 @@ def build(self): msbuild.platform = ( "Win32" if self.settings.arch == "x86" else msbuild.platform ) - msbuild.build(sln="lzham.sln") + msbuild.build(sln="lzham.sln", targets=self._msvc_libs(targets=True)) else: cmake = CMake(self) cmake.configure() @@ -106,21 +142,21 @@ def package(self): ) if is_msvc(self): - suffix = "x64D" if self.settings.build_type == "Debug" else "x64" - copy( - self, - pattern=f"lzham_{suffix}.lib", - dst=os.path.join(self.package_folder, "lib"), - src=os.path.join(self.build_folder, "lib", "x64"), - keep_path=False - ) - copy( - self, - pattern=f"lzham_{suffix}.dll", - dst=os.path.join(self.package_folder, "bin"), - src=os.path.join(self.build_folder, "bin"), - keep_path=False - ) + arch = "x86" if self.settings.arch == "x86" else "x64" + for target in self._msvc_libs(): + self.output.warning(target) + debug_suffix = "D" if self.settings.build_type == "Debug" and not self.options.shared else "" + arch_folder = f"{arch}{debug_suffix}" + subfolder = "lib" if not target.endswith('dll') else "bin" + subfolder_src = os.path.join("lib", arch_folder) if not target.endswith('dll') else "bin" + self.output.warning(subfolder_src) + copy( + self, + pattern=target, + dst=os.path.join(self.package_folder, subfolder), + src=os.path.join(self.build_folder, subfolder_src), + keep_path=False + ) copy( self, pattern="*.h", @@ -141,18 +177,10 @@ def package_info(self): self.cpp_info.system_libs.extend(["m", "pthread"]) if is_msvc(self): - lib_name = "lzham_x64" - if self.settings.build_type == "Debug": - lib_name += "D" - self.cpp_info.libs = [lib_name] + libs = list(set([filename[:-4] for filename in self._msvc_libs()])) + self.cpp_info.libs = libs else: self.cpp_info.libs = ["lzhamdll", "lzhamcomp", "lzhamdecomp"] self.cpp_info.set_property("cmake_file_name", "lzham") self.cpp_info.set_property("cmake_target_name", "lzham::lzham") self.cpp_info.set_property("pkg_config_name", "lzham") - - # TODO: to remove in conan v2 once cmake_find_package_* generators - # removed - self.cpp_info.names["cmake_find_package"] = "lzham" - self.cpp_info.names["cmake_find_package_multi"] = "lzham" - self.cpp_info.names["pkg_config"] = "lzham" diff --git a/recipes/lzham/all/test_package/CMakeLists.txt b/recipes/lzham/all/test_package/CMakeLists.txt index c4780ae45756c..8cb191e28a090 100644 --- a/recipes/lzham/all/test_package/CMakeLists.txt +++ b/recipes/lzham/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(lzham REQUIRED CONFIG) diff --git a/recipes/lzham/all/test_package/test_package.cpp b/recipes/lzham/all/test_package/test_package.cpp index c588215577f5f..33155f701528a 100644 --- a/recipes/lzham/all/test_package/test_package.cpp +++ b/recipes/lzham/all/test_package/test_package.cpp @@ -1,23 +1,13 @@ -#include -#include +#include +#include -#include +#include int main() { - unsigned char in[] = "Hello Conan Center!"; - unsigned char out[sizeof(in)]; + const std::string version(lzham_z_version()); - lzham_z_stream stream; - std::memset(&stream, 0, sizeof(stream)); - stream.next_in = in; - stream.avail_in = sizeof(in); - stream.next_out = out; - stream.avail_out = sizeof(out); - if (lzham_z_deflateInit(&stream, LZHAM_Z_BEST_COMPRESSION) != LZHAM_Z_OK) - return EXIT_FAILURE; + std::cout << "lzham version: " << version << std::endl; - if (lzham_z_deflate(&stream, LZHAM_Z_FULL_FLUSH) != LZHAM_Z_OK) - return EXIT_FAILURE; return EXIT_SUCCESS; } diff --git a/recipes/lzham/all/test_v1_package/CMakeLists.txt b/recipes/lzham/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 231cec51e4ab9..0000000000000 --- a/recipes/lzham/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(lzham REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PUBLIC lzham::lzham) diff --git a/recipes/lzham/all/test_v1_package/conanfile.py b/recipes/lzham/all/test_v1_package/conanfile.py deleted file mode 100644 index 0f735b51a2642..0000000000000 --- a/recipes/lzham/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -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 tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/lzma_sdk/9.20/test_v1_package/conanfile.py b/recipes/lzma_sdk/9.20/test_v1_package/conanfile.py deleted file mode 100644 index d956ede854042..0000000000000 --- a/recipes/lzma_sdk/9.20/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -from conans import ConanFile, tools - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - if not tools.cross_building(self): - self.run("7zDec", run_environment=True) - self.run("lzma", run_environment=True) diff --git a/recipes/lzo/all/test_package/CMakeLists.txt b/recipes/lzo/all/test_package/CMakeLists.txt index aae70901bbdc7..2941c0042c6b9 100644 --- a/recipes/lzo/all/test_package/CMakeLists.txt +++ b/recipes/lzo/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(lzo REQUIRED CONFIG) diff --git a/recipes/lzo/all/test_v1_package/CMakeLists.txt b/recipes/lzo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/lzo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/lzo/all/test_v1_package/conanfile.py b/recipes/lzo/all/test_v1_package/conanfile.py deleted file mode 100644 index 94c6eef557e71..0000000000000 --- a/recipes/lzo/all/test_v1_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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/lzo/all/test_v1_package/test_package.c b/recipes/lzo/all/test_v1_package/test_package.c deleted file mode 100644 index 82d98c1e92179..0000000000000 --- a/recipes/lzo/all/test_v1_package/test_package.c +++ /dev/null @@ -1,47 +0,0 @@ -#include "lzo1f.h" -#include -#include - -const char *text = "This is a string that lzo should compress to less bytes then before if it is working fine.\n" -"This compression algorithm appears to only compress bigger inputs so put a lot of text here.\n"; - - -int main() -{ - if (lzo_init() != LZO_E_OK) - { - printf("internal error - lzo_init() failed !!!\n"); - printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n"); - return 1; - } - - char compressed[2048]; - size_t compressed_len = sizeof(compressed); - { - char workMemory[LZO1F_MEM_COMPRESS+1]; - int r = lzo1f_1_compress((unsigned char*)text, strlen(text), (unsigned char*)compressed, &compressed_len, workMemory); - if (r != LZO_E_OK) { - printf("internal error - compression failed: %d\n", r); - return 1; - } - } - printf("Size before compression: %zu bytes\n", strlen(text)); - printf("Size after compression: %zu bytes\n", compressed_len); - - - char decompressed[2048]; - size_t decompressed_len = sizeof(decompressed); - { - char workMemory[LZO1F_MEM_DECOMPRESS+1]; - int r = lzo1f_decompress((unsigned char*)compressed, compressed_len, (unsigned char*)decompressed, &decompressed_len, workMemory); - if (r != LZO_E_OK) { - printf("internal error - decompression failed: %d\n", r); - return 1; - } - } - - int ok = (strlen(text) == decompressed_len) && (strncmp(text, decompressed, decompressed_len) == 0); - printf("Decompression: %s\n", ok ? "Success" : "Failure"); - - return ok ? 0 : 1; -} diff --git a/recipes/m4/all/test_package/conanfile.py b/recipes/m4/all/test_package/conanfile.py index 4a294edf870e7..54ca0966a46f1 100644 --- a/recipes/m4/all/test_package/conanfile.py +++ b/recipes/m4/all/test_package/conanfile.py @@ -1,8 +1,4 @@ from conan import ConanFile -from conan.tools.files import save -from io import StringIO -import os -import textwrap class TestPackageConan(ConanFile): @@ -10,28 +6,9 @@ class TestPackageConan(ConanFile): generators = "VirtualBuildEnv" test_type = "explicit" - @property - def _m4_input_path(self): - return os.path.join(self.build_folder, "input.m4") - def build_requirements(self): self.tool_requires(self.tested_reference_str) - def build(self): - save(self, self._m4_input_path, textwrap.dedent("""\ - m4_define(NAME1, `Harry, Jr.') - m4_define(NAME2, `Sally') - m4_define(MET, `$1 met $2') - MET(`NAME1', `NAME2') - """)) - def test(self): 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{extension} -R {self.source_folder}/frozen.m4f {self.source_folder}/test.m4") - - output = StringIO() - 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_package/frozen.m4f b/recipes/m4/all/test_package/frozen.m4f deleted file mode 100644 index 26431a17d4fd6..0000000000000 --- a/recipes/m4/all/test_package/frozen.m4f +++ /dev/null @@ -1,11 +0,0 @@ -# This is a frozen state file generated by GNU M4 1.4.18 -V1 -Q1,1 -[] -T9,27 -say_hello[Hello ]conanize_name([$1]) -T11,203 -all_letters -  !"#*%&'()$+,./0123456789:;<=>?@[\]^_`{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ- -T13,10 -conanize_name[Conan $1] diff --git a/recipes/m4/all/test_package/test.m4 b/recipes/m4/all/test_package/test.m4 deleted file mode 100644 index a04483498966a..0000000000000 --- a/recipes/m4/all/test_package/test.m4 +++ /dev/null @@ -1,2 +0,0 @@ -say_hello([World]) -[All letters: ]all_letters diff --git a/recipes/m4/all/test_v1_package/conanfile.py b/recipes/m4/all/test_v1_package/conanfile.py deleted file mode 100644 index fdefc9766275f..0000000000000 --- a/recipes/m4/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,42 +0,0 @@ -from conans import ConanFile, tools -from conans.errors import ConanException -from io import StringIO -import os -import textwrap - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - @property - def _m4_input_path(self): - return os.path.join(self.build_folder, "input.m4") - - def build(self): - tools.save(self._m4_input_path, textwrap.dedent("""\ - m4_define(NAME1, `Harry, Jr.') - m4_define(NAME2, `Sally') - m4_define(MET, `$1 met $2') - MET(`NAME1', `NAME2') - """)) - - def test(self): - if hasattr(self, "settings_build"): - exe_suffix = ".exe" if self.settings.os == "Windows" else "" - m4_bin = os.path.join(self.deps_cpp_info["m4"].rootpath, "bin", "m4" + exe_suffix) - else: - m4_bin = tools.get_env("M4") - if m4_bin is None or not m4_bin.startswith(self.deps_cpp_info["m4"].rootpath): - raise ConanException("M4 environment variable not set") - - if not tools.cross_building(self, skip_x64_x86=True): - self.run(f"{m4_bin} --version", run_environment=True) - self.run(f"{m4_bin} -P {self._m4_input_path}") - - 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(f"{m4_bin} -P {self._m4_input_path}", output=output) - - assert "Harry, Jr. met Sally" in output.getvalue() diff --git a/recipes/macdylibbundler/all/conandata.yml b/recipes/macdylibbundler/all/conandata.yml new file mode 100644 index 0000000000000..014ef59305c05 --- /dev/null +++ b/recipes/macdylibbundler/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.5": + url: "https://github.com/auriamg/macdylibbundler/archive/refs/tags/1.0.5.tar.gz" + sha256: "13384ebe7ca841ec392ac49dc5e50b1470190466623fa0e5cd30f1c634858530" diff --git a/recipes/macdylibbundler/all/conanfile.py b/recipes/macdylibbundler/all/conanfile.py new file mode 100644 index 0000000000000..774cb3deaaf5d --- /dev/null +++ b/recipes/macdylibbundler/all/conanfile.py @@ -0,0 +1,50 @@ +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.files import copy, get +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=1.53.0" + + +class MacDylibBundlerConan(ConanFile): + name = "macdylibbundler" + package_type = "application" + description = ( + "mac dylib bundler is a tool for use when bundling mac applications" + ) + topics = ("build", "dylib", "installer", "mac") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/auriamg/macdylibbundler" + license = "MIT" + settings = "os", "arch", "build_type" + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if not is_apple_os(self): + raise ConanInvalidConfiguration("This tool is for macOS only") + + 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): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + # The CMakeLists.txt misses the install command, so for simplicity the executable is copied manually + copy(self, "dylibbundler", src=self.build_folder, dst=os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/macdylibbundler/all/test_package/conanfile.py b/recipes/macdylibbundler/all/test_package/conanfile.py new file mode 100644 index 0000000000000..7909754cbfd68 --- /dev/null +++ b/recipes/macdylibbundler/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", "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("dylibbundler -h") diff --git a/recipes/macdylibbundler/config.yml b/recipes/macdylibbundler/config.yml new file mode 100644 index 0000000000000..84f5016ed4a14 --- /dev/null +++ b/recipes/macdylibbundler/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.5": + folder: all diff --git a/recipes/maddy/all/test_v1_package/CMakeLists.txt b/recipes/maddy/all/test_v1_package/CMakeLists.txt deleted file mode 100755 index 91630d79f4abb..0000000000000 --- a/recipes/maddy/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100755 index 38f4483872d47..0000000000000 --- a/recipes/maddy/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_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/magic_enum/all/conandata.yml b/recipes/magic_enum/all/conandata.yml index dd9aed1156ca9..e5f6eb2e8377e 100644 --- a/recipes/magic_enum/all/conandata.yml +++ b/recipes/magic_enum/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.9.7": + url: "https://github.com/Neargye/magic_enum/archive/v0.9.7.tar.gz" + sha256: "b403d3dad4ef542fdc3024fa37d3a6cedb4ad33c72e31b6d9bab89dcaf69edf7" + "0.9.6": + url: "https://github.com/Neargye/magic_enum/archive/v0.9.6.tar.gz" + sha256: "fcda8295256a2084f1f98a63b3d2c66b3d7140eea008e1ef94ea015b2f6d3034" "0.9.5": url: "https://github.com/Neargye/magic_enum/archive/v0.9.5.tar.gz" sha256: "44ad80db5a72f5047e01d90e18315751d9ac90c0ab42cbea7a6f9ec66a4cd679" diff --git a/recipes/magic_enum/all/conanfile.py b/recipes/magic_enum/all/conanfile.py index 5d4edee82bb6d..5a5f4c8dfc750 100644 --- a/recipes/magic_enum/all/conanfile.py +++ b/recipes/magic_enum/all/conanfile.py @@ -1,8 +1,8 @@ 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.files import copy, get, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.scm import Version import os @@ -39,7 +39,7 @@ def _compilers_minimum_version(self): } def layout(self): - basic_layout(self, src_folder="src") + cmake_layout(self, src_folder="src") def package_id(self): self.info.clear() @@ -56,15 +56,29 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["MAGIC_ENUM_OPT_BUILD_EXAMPLES"] = False + tc.cache_variables["MAGIC_ENUM_OPT_BUILD_TESTS"] = False + tc.generate() + def build(self): - pass + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - 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")) + cmake = CMake(self) + cmake.install() + if "0.9.4" <= Version(self.version) <= "0.9.6": + copy(self, "*", os.path.join(self.package_folder, "include"), os.path.join(self.package_folder, "include", "magic_enum")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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.set_property("cmake_file_name", "magic_enum") self.cpp_info.set_property("cmake_target_name", "magic_enum::magic_enum") + self.cpp_info.set_property("pkg_config_name", "magic_enum") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/magic_enum/all/test_package/CMakeLists.txt b/recipes/magic_enum/all/test_package/CMakeLists.txt index f5917740f5800..63a84d7ab557b 100644 --- a/recipes/magic_enum/all/test_package/CMakeLists.txt +++ b/recipes/magic_enum/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(magic_enum REQUIRED CONFIG) @@ -6,7 +6,6 @@ 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) +if(magic_enum_VERSION VERSION_LESS "0.9.7") + target_compile_definitions(${PROJECT_NAME} PRIVATE MAGIC_ENUM_TOP_LEVEL_HEADER) endif() diff --git a/recipes/magic_enum/all/test_package/test_package.cpp b/recipes/magic_enum/all/test_package/test_package.cpp index 208a3dd5fc806..65c32ced2f74c 100644 --- a/recipes/magic_enum/all/test_package/test_package.cpp +++ b/recipes/magic_enum/all/test_package/test_package.cpp @@ -1,7 +1,7 @@ -#ifdef MAGIC_ENUM_INCLUDE_WITH_FOLDER -# include +#ifdef MAGIC_ENUM_TOP_LEVEL_HEADER +#include #else -# include +#include #endif #include #include diff --git a/recipes/magic_enum/all/test_v1_package/CMakeLists.txt b/recipes/magic_enum/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/magic_enum/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/magic_enum/all/test_v1_package/conanfile.py b/recipes/magic_enum/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/magic_enum/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_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/magic_enum/config.yml b/recipes/magic_enum/config.yml index 45e3b1189db90..6d1028c96eda4 100644 --- a/recipes/magic_enum/config.yml +++ b/recipes/magic_enum/config.yml @@ -1,4 +1,8 @@ versions: + "0.9.7": + folder: all + "0.9.6": + folder: all "0.9.5": folder: all "0.9.4": diff --git a/recipes/magnum-extras/all/CMakeLists.txt b/recipes/magnum-extras/all/CMakeLists.txt index 08c7bbc0b05a4..c13f71f507e7f 100644 --- a/recipes/magnum-extras/all/CMakeLists.txt +++ b/recipes/magnum-extras/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(conanbuildinfo.cmake) diff --git a/recipes/magnum-extras/all/test_package/CMakeLists.txt b/recipes/magnum-extras/all/test_package/CMakeLists.txt index 976323cbac9ea..856d4d538b821 100644 --- a/recipes/magnum-extras/all/test_package/CMakeLists.txt +++ b/recipes/magnum-extras/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/magnum-integration/all/CMakeLists.txt b/recipes/magnum-integration/all/CMakeLists.txt index e0949ec4127c9..ada2385ecb875 100644 --- a/recipes/magnum-integration/all/CMakeLists.txt +++ b/recipes/magnum-integration/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(conanbuildinfo.cmake) diff --git a/recipes/magnum-integration/all/test_package/CMakeLists.txt b/recipes/magnum-integration/all/test_package/CMakeLists.txt index 2f483ffbe1392..74a70a9c2d13d 100644 --- a/recipes/magnum-integration/all/test_package/CMakeLists.txt +++ b/recipes/magnum-integration/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/magnum-plugins/all/CMakeLists.txt b/recipes/magnum-plugins/all/CMakeLists.txt index 315c0afaf5005..b3b2d546be9a6 100644 --- a/recipes/magnum-plugins/all/CMakeLists.txt +++ b/recipes/magnum-plugins/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) set(CONAN_CMAKE_SILENT_OUTPUT 1) diff --git a/recipes/magnum-plugins/all/test_package/CMakeLists.txt b/recipes/magnum-plugins/all/test_package/CMakeLists.txt index 3ae91f1bb266f..1dc50b459307a 100644 --- a/recipes/magnum-plugins/all/test_package/CMakeLists.txt +++ b/recipes/magnum-plugins/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) @@ -29,8 +29,8 @@ set_target_properties(${PROJECT_NAME} if(TARGET_EMSCRIPTEN) message("Embed OBJ file") - set_target_properties(${PROJECT_NAME} - PROPERTIES + set_target_properties(${PROJECT_NAME} + PROPERTIES LINK_FLAGS "--embed-file ${CONAN_STL_FILE}@${CONAN_STL_FILE}" ) endif() diff --git a/recipes/magnum/all/CMakeLists.txt b/recipes/magnum/all/CMakeLists.txt index 61f3d3b039e2b..04c96c99f25c3 100644 --- a/recipes/magnum/all/CMakeLists.txt +++ b/recipes/magnum/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(conanbuildinfo.cmake) diff --git a/recipes/magnum/all/test_package/CMakeLists.txt b/recipes/magnum/all/test_package/CMakeLists.txt index 217f5102eb39f..0c18c63c9f2bc 100644 --- a/recipes/magnum/all/test_package/CMakeLists.txt +++ b/recipes/magnum/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/mailio/all/conandata.yml b/recipes/mailio/all/conandata.yml index 38e35d02a9f6f..2dff6b32eec93 100644 --- a/recipes/mailio/all/conandata.yml +++ b/recipes/mailio/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.24.1": + url: "https://github.com/karastojko/mailio/archive/refs/tags/0.24.1.tar.gz" + sha256: "52d5ced35b6a87677d897010fb2e7c2d2ddbd834d59aab991c65c0c6627af40f" "0.23.0": url: "https://github.com/karastojko/mailio/archive/refs/tags/0.23.0.tar.gz" sha256: "9fc3f1f803a85170c2081cbbef2e301473a400683fc1dffefa2d6707598206a5" @@ -12,6 +15,10 @@ sources: url: "https://github.com/karastojko/mailio/archive/refs/tags/0.20.0.tar.gz" sha256: "073d6b1ff891444b54a01c2a3f17074fd612f9e2e14d9ebd61863c70737b1882" patches: + "0.24.1": + - patch_file: "patches/0.24.1-adapt-cmakelists.patch" + patch_description: "fix install path" + patch_type: "conan" "0.23.0": - patch_file: "patches/0.23.0-adapt-cmakelists.patch" patch_description: "fix install path" diff --git a/recipes/mailio/all/conanfile.py b/recipes/mailio/all/conanfile.py index 28d892d6df1a4..62a3f2aa9e52a 100644 --- a/recipes/mailio/all/conanfile.py +++ b/recipes/mailio/all/conanfile.py @@ -1,5 +1,4 @@ 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 @@ -7,7 +6,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0.9" class MailioConan(ConanFile): name = "mailio" @@ -27,61 +26,35 @@ class MailioConan(ConanFile): "shared": False, } short_paths = True - - @property - def _min_cppstd(self): - return "17" - - @property - def _compilers_minimum_version(self): - return { - "gcc": "8.3", - "clang": "6", - "Visual Studio": "15", - "msvc": "191", - "apple-clang": "10", - } + implements = ["auto_shared_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): - 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.82.0", transitive_headers=True, transitive_libs=True) + self.requires("boost/1.86.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"): - 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." - ) + check_min_cppstd(self, 17) def build_requirements(self): self.tool_requires("cmake/[>=3.16.3 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): env = VirtualBuildEnv(self) env.generate() tc = CMakeToolchain(self) - tc.variables["MAILIO_BUILD_SHARED_LIBRARY"] = self.options.shared + if Version(self.version) < "0.24.0": + 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": @@ -92,7 +65,6 @@ def generate(self): deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/mailio/all/patches/0.24.1-adapt-cmakelists.patch b/recipes/mailio/all/patches/0.24.1-adapt-cmakelists.patch new file mode 100644 index 0000000000000..455368841fccc --- /dev/null +++ b/recipes/mailio/all/patches/0.24.1-adapt-cmakelists.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 30d4e0d..747cfab 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -144,7 +144,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/CMakeLists.txt b/recipes/mailio/all/test_package/CMakeLists.txt index efd57b8a24474..6211692b0244d 100644 --- a/recipes/mailio/all/test_package/CMakeLists.txt +++ b/recipes/mailio/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(mailio REQUIRED CONFIG) diff --git a/recipes/mailio/all/test_v1_package/CMakeLists.txt b/recipes/mailio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/mailio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mailio/all/test_v1_package/conanfile.py b/recipes/mailio/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/mailio/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/mailio/config.yml b/recipes/mailio/config.yml index 01caa19ce9c40..b5b8a58f15492 100644 --- a/recipes/mailio/config.yml +++ b/recipes/mailio/config.yml @@ -1,4 +1,6 @@ versions: + "0.24.1": + folder: all "0.23.0": folder: all "0.22.0": diff --git a/recipes/make/all/conandata.yml b/recipes/make/all/conandata.yml index d11432dff7294..e1b821e38a6db 100644 --- a/recipes/make/all/conandata.yml +++ b/recipes/make/all/conandata.yml @@ -1,4 +1,7 @@ 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" @@ -9,6 +12,8 @@ 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": 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/all/test_v1_package/conanfile.py b/recipes/make/all/test_v1_package/conanfile.py deleted file mode 100644 index 2348d97eef993..0000000000000 --- a/recipes/make/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,13 +0,0 @@ -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): - with tools.run_environment(self): - make = self.deps_user_info["make"].make - makefile_dir = os.path.join(self.source_folder, os.pardir, "test_package") - self.run(f"{make} -C {makefile_dir} love") diff --git a/recipes/make/config.yml b/recipes/make/config.yml index 34673d1418b17..6c7e54ea2509c 100644 --- a/recipes/make/config.yml +++ b/recipes/make/config.yml @@ -1,4 +1,6 @@ versions: + "4.4.1": + folder: all "4.4": folder: all "4.3": diff --git a/recipes/makefile-project-workspace-creator/all/conanfile.py b/recipes/makefile-project-workspace-creator/all/conanfile.py index c3268efeaebb0..4a70766451e93 100644 --- a/recipes/makefile-project-workspace-creator/all/conanfile.py +++ b/recipes/makefile-project-workspace-creator/all/conanfile.py @@ -1,37 +1,51 @@ 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 + +required_conan_version = ">=1.53.0" class MPCGeneratorConan(ConanFile): name = "makefile-project-workspace-creator" description = "The Makefile, Project and Workspace Creator" license = "BSD-3-Clause" - homepage = "https://objectcomputing.com/" url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "makefile-project-workspace-creator", "objectcomputing", "installer") - settings = "os" + homepage = "https://github.com/objectcomputing/MPC" + topics = ("objectcomputing", "installer") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "build-scripts" + settings = "os", "arch", "compiler", "build_type" - def requirements(self): - if self.settings.os == "Windows": - self.requires("strawberryperl/5.30.0.1") + def layout(self): + basic_layout(self, src_folder="src") - def build(self): - pass + def package_id(self): + self.info.clear() - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("MPC-MPC_" + self.version.replace(".", "_"), self._source_subfolder) + def build(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="*", src=self._source_subfolder, dst="bin") - self.copy(pattern="LICENSE", src=os.path.join(self._source_subfolder, "docs"), dst="licenses") + copy(self, "*", + src=self.build_folder, + dst=os.path.join(self.package_folder, "bin"), + excludes=["history", "docs", "rpm", "MPC.ico", "PROBLEM-REPORT-FORM", "azure-pipelines.yml", "ChangeLog"]) + copy(self, "LICENSE", + src=os.path.join(self.build_folder, "docs"), + dst=os.path.join(self.package_folder, "licenses")) 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: %s' % bin_path) + # MPC_ROOT: https://github.com/objectcomputing/MPC/blob/5b4c2443871e5e9b6267edef17fed66afc125fa4/docs/USAGE#L243 + self.buildenv_info.define("MPC_ROOT", bin_path) + + # TODO: Remove after dropping Conan 1.x self.env_info.PATH.append(bin_path) self.env_info.MPC_ROOT = bin_path diff --git a/recipes/makefile-project-workspace-creator/all/test_package/conanfile.py b/recipes/makefile-project-workspace-creator/all/test_package/conanfile.py index d02d604b53d44..a57997b529e79 100644 --- a/recipes/makefile-project-workspace-creator/all/test_package/conanfile.py +++ b/recipes/makefile-project-workspace-creator/all/test_package/conanfile.py @@ -1,12 +1,25 @@ -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.layout import basic_layout +from conan.tools.files import save, load +import os -class DefaultNameConan(ConanFile): - settings = "os" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" - def build(self): - pass + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + build_vars = self.dependencies[self.tested_reference_str].buildenv_info.vars(self, scope="build") + mpc_root = build_vars["MPC_ROOT"] + save(self, os.path.join(self.build_folder, "mpc_root.txt"), mpc_root) def test(self): - if not tools.cross_building(self.settings): - self.run("perl -S mpc.pl --version", run_environment=True) + mpc_root = load(self, os.path.join(self.build_folder, "mpc_root.txt")) + assert os.path.exists(os.path.join(mpc_root, 'mpc.pl')) diff --git a/recipes/manif/all/conandata.yml b/recipes/manif/all/conandata.yml new file mode 100644 index 0000000000000..5d0f0b0b2a6f2 --- /dev/null +++ b/recipes/manif/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.5": + url: "https://github.com/artivis/manif/archive/refs/tags/0.0.5.tar.gz" + sha256: "246a781c54a5c57179d48096faca0d108944e120f69d8fd7fb69e3cb4a0a67fb" diff --git a/recipes/manif/all/conanfile.py b/recipes/manif/all/conanfile.py new file mode 100644 index 0000000000000..f0f62f808f152 --- /dev/null +++ b/recipes/manif/all/conanfile.py @@ -0,0 +1,66 @@ +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 PackageConan(ConanFile): + name = "manif" + description = "A small C++11 header-only library for Lie theory" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://artivis.github.io/manif" + topics = ("lie-groups", "state-estimation", "geometry", "robotics", "computer-vision", "header-only") + + 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", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("eigen/3.4.0") + self.requires("tl-optional/1.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 package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "manif") + self.cpp_info.set_property("cmake_target_name", "MANIF::manif") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/manif/all/test_package/CMakeLists.txt b/recipes/manif/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..84ba50bb17606 --- /dev/null +++ b/recipes/manif/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(manif REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE MANIF::manif) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/manif/all/test_package/conanfile.py b/recipes/manif/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/manif/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/manif/all/test_package/test_package.cpp b/recipes/manif/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c82dc520226c0 --- /dev/null +++ b/recipes/manif/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +using namespace manif; + +int main() { + SE3d X = SE3d::Random(); + SE3Tangentd w = SE3Tangentd::Random(); + SE3d::Jacobian J_o_x, J_o_w; + auto X_plus_w = X.plus(w, J_o_x, J_o_w); +} diff --git a/recipes/manif/config.yml b/recipes/manif/config.yml new file mode 100644 index 0000000000000..6506e357707be --- /dev/null +++ b/recipes/manif/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.5": + folder: all diff --git a/recipes/manifold/all/conandata.yml b/recipes/manifold/all/conandata.yml new file mode 100644 index 0000000000000..d8105b02cd075 --- /dev/null +++ b/recipes/manifold/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.1": + url: "https://github.com/elalish/manifold/archive/refs/tags/v3.0.1.tar.gz" + sha256: "5e84fdaab7933a00fb4279a9bbe2885e94db3adfc45a2ef56ae35abfe5e6ea43" diff --git a/recipes/manifold/all/conanfile.py b/recipes/manifold/all/conanfile.py new file mode 100644 index 0000000000000..4a426ad0103b5 --- /dev/null +++ b/recipes/manifold/all/conanfile.py @@ -0,0 +1,80 @@ +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, rmdir +import os + + +required_conan_version = ">=2.0.9" + +class ManifoldConan(ConanFile): + name = "manifold" + description = "Geometry library for topological robustness" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/elalish/manifold" + topics = ("geometry", "topological", "mesh") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_parallel_acceleration": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_parallel_acceleration": False, + } + implements = ["auto_shared_fpic"] + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # For CrossSection for 2D support + self.requires("clipper2/1.4.0") + if self.options.with_parallel_acceleration: + self.requires("onetbb/2022.0.0") + + def validate(self): + check_min_cppstd(self, 17) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.18 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["MANIFOLD_DOWNLOADS"] = False + tc.cache_variables["MANIFOLD_TEST"] = False + tc.cache_variables["MANIFOLD_CBIND"] = False + tc.cache_variables["MANIFOLD_PYBIND"] = False + tc.cache_variables["MANIFOLD_PAR"] = self.options.with_parallel_acceleration + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("clipper2::clipper2", "cmake_target_name", "Clipper2") + deps.generate() + + def build(self): + 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", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["manifold"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/manifold/all/test_package/CMakeLists.txt b/recipes/manifold/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..dc1da9fdbaede --- /dev/null +++ b/recipes/manifold/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(manifold REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE manifold::manifold) diff --git a/recipes/manifold/all/test_package/conanfile.py b/recipes/manifold/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2e77b4246fa81 --- /dev/null +++ b/recipes/manifold/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" + + 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/manifold/all/test_package/test_package.cpp b/recipes/manifold/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..98307ae7079c3 --- /dev/null +++ b/recipes/manifold/all/test_package/test_package.cpp @@ -0,0 +1,17 @@ +#include +#include "manifold/manifold.h" +#include "manifold/polygon.h" + +using namespace manifold; + +int main(void) { + ManifoldParams().intermediateChecks = true; + ManifoldParams().processOverlaps = false; + ManifoldParams().suppressErrors = true; + + Polygons polys; + polys.emplace_back(); + polys.back().emplace_back(1, 1); + + return EXIT_SUCCESS; +} diff --git a/recipes/manifold/config.yml b/recipes/manifold/config.yml new file mode 100644 index 0000000000000..f1eca9cdf76de --- /dev/null +++ b/recipes/manifold/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.1": + folder: all diff --git a/recipes/mapbox-geometry/all/test_package/CMakeLists.txt b/recipes/mapbox-geometry/all/test_package/CMakeLists.txt index 9bad4b5d60471..39ed1f6db1332 100644 --- a/recipes/mapbox-geometry/all/test_package/CMakeLists.txt +++ b/recipes/mapbox-geometry/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(mapbox-geometry REQUIRED CONFIG) diff --git a/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt b/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/mapbox-geometry/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mapbox-geometry/all/test_v1_package/conanfile.py b/recipes/mapbox-geometry/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mapbox-geometry/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_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/mapbox-variant/all/test_package/CMakeLists.txt b/recipes/mapbox-variant/all/test_package/CMakeLists.txt index d72d3227f01d3..820c36cb3477e 100644 --- a/recipes/mapbox-variant/all/test_package/CMakeLists.txt +++ b/recipes/mapbox-variant/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(mapbox-variant REQUIRED CONFIG) diff --git a/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt b/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/mapbox-variant/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mapbox-variant/all/test_v1_package/conanfile.py b/recipes/mapbox-variant/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mapbox-variant/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_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/mapbox-wagyu/all/conandata.yml b/recipes/mapbox-wagyu/all/conandata.yml new file mode 100644 index 0000000000000..b9f6cbffdb795 --- /dev/null +++ b/recipes/mapbox-wagyu/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.5.0": + url: "https://github.com/mapbox/wagyu/archive/refs/tags/0.5.0.tar.gz" + sha256: "88c41eaba03107ebe79052fdbd66e419e903d331a2616a51849018e13648ab83" diff --git a/recipes/mapbox-wagyu/all/conanfile.py b/recipes/mapbox-wagyu/all/conanfile.py new file mode 100644 index 0000000000000..c742efbc4dde0 --- /dev/null +++ b/recipes/mapbox-wagyu/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.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class MapboxWagyuConan(ConanFile): + name = "mapbox-wagyu" + description = "A general library for geometry operations of union, intersections, difference, and xor" + license = "LicenseRef-mapbox-wagyu" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mapbox/wagyu/" + topics = ("geometry", "clipping", "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 { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("mapbox-geometry/2.0.3") + + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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 = [] diff --git a/recipes/mapbox-wagyu/all/test_package/CMakeLists.txt b/recipes/mapbox-wagyu/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..84fec480cbc2c --- /dev/null +++ b/recipes/mapbox-wagyu/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mapbox-wagyu REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mapbox-wagyu::mapbox-wagyu) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/mapbox-wagyu/all/test_package/conanfile.py b/recipes/mapbox-wagyu/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/mapbox-wagyu/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/mapbox-wagyu/all/test_package/test_package.cpp b/recipes/mapbox-wagyu/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0cd92638b261b --- /dev/null +++ b/recipes/mapbox-wagyu/all/test_package/test_package.cpp @@ -0,0 +1,28 @@ +#include + +#include +#include + +int main() { + mapbox::geometry::point< std::int64_t> p1 = { 0, 0 }; + mapbox::geometry::point< std::int64_t> p2 = { 100, 100 }; + mapbox::geometry::box< std::int64_t> bbox(p1, p2); + + mapbox::geometry::linear_ring< std::int64_t> lr; + lr.push_back(mapbox::geometry::point< std::int64_t>(25, 25)); + lr.push_back(mapbox::geometry::point< std::int64_t>(175, 25)); + lr.push_back(mapbox::geometry::point< std::int64_t>(175, 75)); + lr.push_back(mapbox::geometry::point< std::int64_t>(25, 75)); + lr.push_back(mapbox::geometry::point< std::int64_t>(25, 25)); + + auto out = mapbox::geometry::wagyu::quick_clip::quick_lr_clip(lr, bbox); + + mapbox::geometry::linear_ring< std::int64_t> want; + want.push_back(mapbox::geometry::point< std::int64_t>(25, 25)); + want.push_back(mapbox::geometry::point< std::int64_t>(100, 25)); + want.push_back(mapbox::geometry::point< std::int64_t>(100, 75)); + want.push_back(mapbox::geometry::point< std::int64_t>(25, 75)); + want.push_back(mapbox::geometry::point< std::int64_t>(25, 25)); + + assert(out == want); +} diff --git a/recipes/mapbox-wagyu/config.yml b/recipes/mapbox-wagyu/config.yml new file mode 100644 index 0000000000000..ca7b2c3985d5e --- /dev/null +++ b/recipes/mapbox-wagyu/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.0": + folder: all diff --git a/recipes/mariadb-connector-c/all/conandata.yml b/recipes/mariadb-connector-c/all/conandata.yml index df3894df1372a..d4977afccef83 100644 --- a/recipes/mariadb-connector-c/all/conandata.yml +++ b/recipes/mariadb-connector-c/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.4.3": + url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.4.3/mariadb-connector-c-3.4.3-src.tar.gz" + sha256: "a9033833a88ca74789bd6db565965382c982d06aae1c086097fa9c3e7c7d1eaf" + "3.3.8": + url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.3.8/mariadb-connector-c-3.3.8-src.tar.gz" + sha256: "f9f076b4aa9fb22cc94b24f82c80f9ef063805ecd6533a2eb5d5060cf93833e8" "3.3.3": url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.3.3/mariadb-connector-c-3.3.3-src.tar.gz" sha256: "d77630e2376fe08185b5354621c877b0a203a6b186a0694574d37b764aeb2874" @@ -12,15 +18,23 @@ sources: url: "https://downloads.mariadb.com/Connectors/c/connector-c-3.1.11/mariadb-connector-c-3.1.11-src.tar.gz" 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" + "3.4.3": + - patch_file: "patches/3.4.3-0001-fix-install-and-static-or-shared.patch" + patch_description: "fix install path, separate static/shared build" patch_type: "conan" - - patch_file: "patches/3.3.3-0001-fix-install-and-static-or-shared.patch" + - patch_file: "patches/3.4.3-0004-include-mysqld_error-header.patch" + patch_description: "always include mysqld_error.h" + patch_type: "portability" + "3.3.8": + - patch_file: "patches/3.3.8-0001-fix-install-and-static-or-shared.patch" patch_description: "fix install path, separate static/shared build" patch_type: "conan" - - patch_file: "patches/3.1.19-0002-remove-wx-flag.patch" - patch_description: "remove WX flags in MSVC" + - patch_file: "patches/3.1.11-0004-include-mysqld_error-header.patch" + patch_description: "always include mysqld_error.h" + patch_type: "portability" + "3.3.3": + - 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" - patch_file: "patches/3.1.11-0003-include-order-windows-winsock2.patch" patch_description: "fix include order for windows winsock2" @@ -32,9 +46,6 @@ patches: - patch_file: "patches/3.1.19-0001-fix-install-and-static-or-shared.patch" patch_description: "fix install path, separate static/shared build" patch_type: "conan" - - patch_file: "patches/3.1.19-0002-remove-wx-flag.patch" - patch_description: "remove WX flags in MSVC" - patch_type: "conan" - patch_file: "patches/3.1.11-0003-include-order-windows-winsock2.patch" patch_description: "fix include order for windows winsock2" patch_type: "portability" diff --git a/recipes/mariadb-connector-c/all/conanfile.py b/recipes/mariadb-connector-c/all/conanfile.py index 576fa5d4f935e..62e8bd74ef35f 100644 --- a/recipes/mariadb-connector-c/all/conanfile.py +++ b/recipes/mariadb-connector-c/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class MariadbConnectorcConan(ConanFile): @@ -92,8 +92,11 @@ def generate(self): tc.variables["INSTALL_BINDIR"] = "bin" tc.variables["INSTALL_LIBDIR"] = "lib" tc.variables["INSTALL_PLUGINDIR"] = os.path.join("lib", "plugin").replace("\\", "/") + tc.variables["ZLIB_LIBRARY"] = "ZLIB::ZLIB" # To install relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "3.4.4": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) if Version(self.version) >= "3.3": @@ -104,7 +107,6 @@ def _patch_sources(self): apply_conandata_patches(self) root_cmake = os.path.join(self.source_folder, "CMakeLists.txt") - replace_in_file(self, root_cmake, "${ZLIB_LIBRARY}", "${ZLIB_LIBRARIES}") replace_in_file(self, root_cmake, "SET(SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})", @@ -113,6 +115,14 @@ def _patch_sources(self): replace_in_file(self, root_cmake, "${CURL_LIBRARIES}", "CURL::libcurl") plugins_io_cmake = os.path.join(self.source_folder, "plugins", "io", "CMakeLists.txt") replace_in_file(self, plugins_io_cmake, "${CURL_LIBRARIES}", "CURL::libcurl") + if Version(self.version) >= "3.3.6": + replace_in_file(self, root_cmake, "${WARNING_AS_ERROR}", "") + elif Version(self.version) >= "3.1.18": + replace_in_file(self, root_cmake, " -WX", "") + if Version(self.version) >= "3.3": + replace_in_file(self, root_cmake, + "INCLUDE(${CC_SOURCE_DIR}/cmake/FindZStd.cmake)", + "find_package(ZSTD REQUIRED CONFIG)") def build(self): self._patch_sources() @@ -142,6 +152,3 @@ def package_info(self): plugin_dir = os.path.join(self.package_folder, "lib", "plugin").replace("\\", "/") self.runenv_info.prepend_path("MARIADB_PLUGIN_DIR", plugin_dir) - - # TODO: to remove in conan v2 - self.env_info.MARIADB_PLUGIN_DIR.append(plugin_dir) diff --git a/recipes/mariadb-connector-c/all/patches/3.1.19-0002-remove-wx-flag.patch b/recipes/mariadb-connector-c/all/patches/3.1.19-0002-remove-wx-flag.patch deleted file mode 100644 index 4dde44415f18b..0000000000000 --- a/recipes/mariadb-connector-c/all/patches/3.1.19-0002-remove-wx-flag.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f3b6cbd..f3e8993 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -100,7 +100,7 @@ IF(MSVC) - ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN) - IF (MSVC) - # Treat warnings as errors -- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -WX") -+ # SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -WX") - SET(CONFIG_TYPES "DEBUG" "RELEASE" "RELWITHDEBINFO") - FOREACH(BUILD_TYPE ${CONFIG_TYPES}) - FOREACH(COMPILER CXX C) diff --git a/recipes/mariadb-connector-c/all/patches/3.3.3-0001-fix-install-and-static-or-shared.patch b/recipes/mariadb-connector-c/all/patches/3.3.3-0001-fix-install-and-static-or-shared.patch index 8a6f9ad7f1f55..31844dd32529b 100644 --- a/recipes/mariadb-connector-c/all/patches/3.3.3-0001-fix-install-and-static-or-shared.patch +++ b/recipes/mariadb-connector-c/all/patches/3.3.3-0001-fix-install-and-static-or-shared.patch @@ -2,15 +2,6 @@ diff --git a/libmariadb/CMakeLists.txt b/libmariadb/CMakeLists.txt index 070fdc9..77584e6 100644 --- a/libmariadb/CMakeLists.txt +++ b/libmariadb/CMakeLists.txt -@@ -288,7 +288,7 @@ SET(MARIADB_NONBLOCK_SYMBOLS - - # handle static plugins - SET(LIBMARIADB_SOURCES ${LIBMARIADB_SOURCES} ${LIBMARIADB_PLUGIN_SOURCES}) --SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${LIBMARIADB_PLUGIN_LIBS} ${ZSTD_LIBRARY} ${ZLIB_LIBRARY}) -+SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${LIBMARIADB_PLUGIN_LIBS} ${ZSTD_LIBRARY} ZLIB::ZLIB) - MESSAGE(STATUS "SYSTEM_LIBS: ${SYSTEM_LIBS}") - INCLUDE_DIRECTORIES(${LIBMARIADB_PLUGIN_INCLUDES}) - ADD_DEFINITIONS(${LIBMARIADB_PLUGIN_DEFS}) @@ -404,7 +404,7 @@ ELSE() ENDIF() 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 deleted file mode 100644 index 19168ffa68018..0000000000000 --- a/recipes/mariadb-connector-c/all/patches/3.3.3-0002-find-package-zstd.patch +++ /dev/null @@ -1,13 +0,0 @@ -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/mariadb-connector-c/all/patches/3.3.8-0001-fix-install-and-static-or-shared.patch b/recipes/mariadb-connector-c/all/patches/3.3.8-0001-fix-install-and-static-or-shared.patch new file mode 100644 index 0000000000000..0dfadf76c0436 --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.3.8-0001-fix-install-and-static-or-shared.patch @@ -0,0 +1,117 @@ +--- libmariadb/CMakeLists.txt ++++ libmariadb/CMakeLists.txt +@@ -414,7 +414,7 @@ + ENDIF() + + +-IF(CMAKE_VERSION VERSION_GREATER 2.8.7) ++IF(FALSE) + # CREATE OBJECT LIBRARY + ADD_LIBRARY(mariadb_obj OBJECT ${LIBMARIADB_SOURCES}) + IF(UNIX) +@@ -443,21 +443,24 @@ + "FILE_DESCRIPTION:Dynamic lib for client/server communication") + ENDIF() + ++IF(NOT BUILD_SHARED_LIBS) + ADD_LIBRARY(mariadbclient STATIC ${MARIADB_OBJECTS} ${EMPTY_FILE}) + TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS} ${CRYPTO_LIBS}) +- ++ELSE() + IF(UNIX) + ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE}) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}") + ELSE() +- ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} mariadbclient.def) ++ ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE} mariadbclient.def) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINKER_LANGUAGE C) + ENDIF() + + TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE ${SYSTEM_LIBS} ${CRYPTO_LIBS}) + + SIGN_TARGET(libmariadb) +- ++ENDIF() ++ ++IF(BUILD_SHARED_LIBS) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + CMAKE_SYSTEM_NAME MATCHES "kFreeBSD" OR + CMAKE_SYSTEM_NAME MATCHES "GNU") +@@ -466,11 +469,14 @@ + ENDIF() + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINK_FLAGS "${CC_BINARY_DIR}/libmariadb/mariadbclient.def") + ENDIF() +- ++ELSE() + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") ++ENDIF() ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") + + SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "") ++ENDIF() + + # + # Installation +@@ -490,11 +496,15 @@ + ENDIF() + ENDIF() + ++IF(NOT BUILD_SHARED_LIBS) + create_symlink(libmariadb${CMAKE_STATIC_LIBRARY_SUFFIX} mariadbclient ${INSTALL_LIBDIR}) +- ++ENDIF() ++ ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES VERSION + ${CPACK_PACKAGE_VERSION_MAJOR} + SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}) ++ELSE() + + IF(NOT WIN32) + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES OUTPUT_NAME "${LIBMARIADB_STATIC_NAME}") +@@ -502,20 +512,33 @@ + + INSTALL(TARGETS mariadbclient + COMPONENT Development +- DESTINATION ${INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ENDIF() ++ ++IF(BUILD_SHARED_LIBS) + IF(WIN32) + INSTALL(TARGETS libmariadb + COMPONENT SharedLibraries +- DESTINATION ${INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + ELSE() + # in cmake 3.12+ we can use + #INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} + # COMPONENT SharedLibraries NAMELINK_COMPONENT Development) + # but as long as we build on CentOS 7 with its cmake 2.8.12.2 we have to use +-INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} +- COMPONENT SharedLibraries NAMELINK_SKIP) +-INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} +- COMPONENT Development NAMELINK_ONLY) ++INSTALL(TARGETS libmariadb LIBRARY ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ COMPONENT SharedLibraries) ++INSTALL(TARGETS libmariadb LIBRARY ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ COMPONENT Development) + ENDIF() + + IF(MSVC) +@@ -524,3 +547,4 @@ + CONFIGURATIONS Debug RelWithDebInfo + COMPONENT Development) + ENDIF() ++ENDIF() diff --git a/recipes/mariadb-connector-c/all/patches/3.4.3-0001-fix-install-and-static-or-shared.patch b/recipes/mariadb-connector-c/all/patches/3.4.3-0001-fix-install-and-static-or-shared.patch new file mode 100644 index 0000000000000..f8b1fcb016eca --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.4.3-0001-fix-install-and-static-or-shared.patch @@ -0,0 +1,120 @@ +diff --git a/libmariadb/CMakeLists.txt b/libmariadb/CMakeLists.txt +index 1985b44..d54fe46 100644 +--- a/libmariadb/CMakeLists.txt ++++ b/libmariadb/CMakeLists.txt +@@ -420,7 +420,7 @@ ELSE() + ENDIF() + + +-IF(CMAKE_VERSION VERSION_GREATER 2.8.7) ++IF(FALSE) + # CREATE OBJECT LIBRARY + ADD_LIBRARY(mariadb_obj OBJECT ${LIBMARIADB_SOURCES}) + IF(UNIX) +@@ -449,21 +449,26 @@ IF(WIN32) + "FILE_DESCRIPTION:Dynamic lib for client/server communication") + ENDIF() + ++IF(NOT BUILD_SHARED_LIBS) + ADD_LIBRARY(mariadbclient STATIC ${MARIADB_OBJECTS} ${EMPTY_FILE}) + TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS} ${CRYPT_LIBS}) + ++ELSE() ++ + IF(UNIX) + ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE}) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}") + ELSE() +- ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} mariadbclient.def) ++ ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} ${MARIADB_OBJECTS} ${EMPTY_FILE} mariadbclient.def) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINKER_LANGUAGE C) + ENDIF() + + TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE ${SYSTEM_LIBS} ${CRYPT_LIBS}) + + SIGN_TARGET(libmariadb) ++ENDIF() + ++IF(BUILD_SHARED_LIBS) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + CMAKE_SYSTEM_NAME MATCHES "kFreeBSD" OR + CMAKE_SYSTEM_NAME MATCHES "GNU") +@@ -473,10 +478,14 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINK_FLAGS "${CC_BINARY_DIR}/libmariadb/mariadbclient.def") + ENDIF() + ++ELSE() + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") ++ENDIF() ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}") + + SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "") ++ENDIF() + + # + # Installation +@@ -496,32 +505,50 @@ IF(WITH_MYSQLCOMPAT) + ENDIF() + ENDIF() + ++IF(NOT BUILD_SHARED_LIBS) + create_symlink(libmariadb${CMAKE_STATIC_LIBRARY_SUFFIX} mariadbclient ${INSTALL_LIBDIR}) ++ENDIF() + ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libmariadb PROPERTIES VERSION + ${CPACK_PACKAGE_VERSION_MAJOR} + SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}) ++ELSE() + + IF(NOT WIN32) + SET_TARGET_PROPERTIES(mariadbclient PROPERTIES OUTPUT_NAME "${LIBMARIADB_STATIC_NAME}") + ENDIF() + +-INSTALL(TARGETS mariadbclient +- COMPONENT Development +- DESTINATION ${INSTALL_LIBDIR}) ++ INSTALL(TARGETS mariadbclient ++ COMPONENT Development ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ENDIF() ++ ++IF(BUILD_SHARED_LIBS) + IF(WIN32) + INSTALL(TARGETS libmariadb + COMPONENT SharedLibraries +- DESTINATION ${INSTALL_LIBDIR}) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + ELSE() + # in cmake 3.12+ we can use + #INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} + # COMPONENT SharedLibraries NAMELINK_COMPONENT Development) + # but as long as we build on CentOS 7 with its cmake 2.8.12.2 we have to use +-INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} +- COMPONENT SharedLibraries NAMELINK_SKIP) +-INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR} +- COMPONENT Development NAMELINK_ONLY) ++INSTALL(TARGETS libmariadb LIBRARY ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ COMPONENT SharedLibraries) ++INSTALL(TARGETS libmariadb LIBRARY ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ COMPONENT Development) ++ + ENDIF() + + IF(MSVC) +@@ -530,3 +557,4 @@ IF(MSVC) + CONFIGURATIONS Debug RelWithDebInfo + COMPONENT Development) + ENDIF() ++ENDIF() diff --git a/recipes/mariadb-connector-c/all/patches/3.4.3-0004-include-mysqld_error-header.patch b/recipes/mariadb-connector-c/all/patches/3.4.3-0004-include-mysqld_error-header.patch new file mode 100644 index 0000000000000..a04b765ba4ac9 --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.4.3-0004-include-mysqld_error-header.patch @@ -0,0 +1,13 @@ +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index 137cbe9..c06dd41 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -10,7 +10,7 @@ SET(MARIADB_CLIENT_INCLUDES ${CC_SOURCE_DIR}/include/mariadb_com.h + ${CC_SOURCE_DIR}/include/mariadb_ctype.h + ${CC_SOURCE_DIR}/include/mariadb_rpl.h + ) +-IF(NOT IS_SUBPROJECT) ++IF(TRUE) + SET(MARIADB_CLIENT_INCLUDES ${MARIADB_CLIENT_INCLUDES} + ${CC_SOURCE_DIR}/include/mysqld_error.h + ) diff --git a/recipes/mariadb-connector-c/all/test_package/CMakeLists.txt b/recipes/mariadb-connector-c/all/test_package/CMakeLists.txt index d314b6a18b20d..f0c7cc7ba97b3 100644 --- a/recipes/mariadb-connector-c/all/test_package/CMakeLists.txt +++ b/recipes/mariadb-connector-c/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(mariadb-connector-c REQUIRED CONFIG) diff --git a/recipes/mariadb-connector-c/all/test_v1_package/CMakeLists.txt b/recipes/mariadb-connector-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/mariadb-connector-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mariadb-connector-c/all/test_v1_package/conanfile.py b/recipes/mariadb-connector-c/all/test_v1_package/conanfile.py deleted file mode 100644 index f5c483de856db..0000000000000 --- a/recipes/mariadb-connector-c/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +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" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - 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/mariadb-connector-c/config.yml b/recipes/mariadb-connector-c/config.yml index c4757604b999d..f1bb7eb6c3537 100644 --- a/recipes/mariadb-connector-c/config.yml +++ b/recipes/mariadb-connector-c/config.yml @@ -1,4 +1,8 @@ versions: + "3.4.3": + folder: all + "3.3.8": + folder: all "3.3.3": folder: all "3.1.19": diff --git a/recipes/mariadb-connector-cpp/all/conan_cmake_project_include.cmake b/recipes/mariadb-connector-cpp/all/conan_cmake_project_include.cmake new file mode 100644 index 0000000000000..fc4e31d151f37 --- /dev/null +++ b/recipes/mariadb-connector-cpp/all/conan_cmake_project_include.cmake @@ -0,0 +1,2 @@ +find_package(mariadb-connector-c REQUIRED) +set(CCLIB mariadb-connector-c::mariadb-connector-c CACHE STRING "mariadb-connector-c library") \ No newline at end of file diff --git a/recipes/mariadb-connector-cpp/all/conandata.yml b/recipes/mariadb-connector-cpp/all/conandata.yml new file mode 100644 index 0000000000000..2756ddeda7a3d --- /dev/null +++ b/recipes/mariadb-connector-cpp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.1.4": + url: + - "https://github.com/mariadb-corporation/mariadb-connector-cpp/archive/refs/tags/1.1.4.zip" + sha256: "4b6846abff09b9fece8c3766785248b60aa7e11815e5b4590bbf7dff7f2e7b3d" +patches: + "1.1.4": + - patch_file: "patches/0001-1.1.4-cmake-install-logic.patch" + patch_type: "conan" + patch_description: "Compile both static and shared libraries but only install one of them" \ No newline at end of file diff --git a/recipes/mariadb-connector-cpp/all/conanfile.py b/recipes/mariadb-connector-cpp/all/conanfile.py new file mode 100644 index 0000000000000..b50ef0ed000d5 --- /dev/null +++ b/recipes/mariadb-connector-cpp/all/conanfile.py @@ -0,0 +1,135 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=2.0.9" + +class MariadbConnectorCppRecipe (ConanFile): + name = "mariadb-connector-cpp" + description = "MariaDB Connector/C++ is used to connect applications " \ + "developed in C++ to MariaDB and MySQL databases." + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://mariadb.com/docs/server/connect/programming-languages/cpp" + topics = ("mariadb", "mysql", "database") + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "dyncol": [True, False], + "with_curl": [True, False], + "with_ssl": [False, "openssl", "gnutls", "schannel"], + } + default_options = { + "shared": False, + "fPIC": True, + "dyncol": True, + "with_curl": True, + "with_ssl": "openssl", + } + implements = ["auto_shared_fpic"] + + 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": + self.options.rm_safe("fPIC") + self.options.with_ssl = "schannel" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_curl: + self.requires("libcurl/[>=7.78.0 <9]") + + # with_iconv doesn't exists on Windows (Why?) + self.requires ("mariadb-connector-c/3.3.8", options={ + "dyncol": self.options.dyncol, + "with_curl": self.options.with_curl, + "with_ssl": self.options.with_ssl + }) + + def validate(self): + check_min_cppstd(self, 14) + if self.settings.os != "Windows" and self.options.with_ssl == "schannel": + raise ConanInvalidConfiguration("schannel only supported on Windows") + if self.options.with_ssl == "gnutls": + raise ConanInvalidConfiguration("gnutls not yet available in CCI") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.23 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_PROJECT_mariadb_connector_cpp_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") + tc.cache_variables["WITH_UNIT_TESTS"] = False + tc.cache_variables["INSTALL_BINDIR"] = "bin" + tc.cache_variables["INSTALL_LIBDIR"] = "lib" + tc.cache_variables["INSTALL_PLUGINDIR"] = os.path.join("lib", "plugin").replace("\\", "/") + tc.cache_variables["USE_SYSTEM_INSTALLED_LIB"] = True + tc.cache_variables["MARIADB_LINK_DYNAMIC"] = True + + if self.settings.os == "Windows": + tc.cache_variables["CONC_WITH_MSI"] = False + tc.cache_variables["WITH_MSI"] = False + + # To install relocatable shared libs on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install(component="Headers") + if self.options.shared: + cmake.install(component="SharedLibraries") + else: + cmake.install(component="Development") + + copy(self, "COPYING", src=os.path.join(self.source_folder), dst=os.path.join(self.package_folder, "licenses")) + + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "mariadb-connector-cpp") + self.cpp_info.set_property("cmake_target_name", "mariadb-connector-cpp::mariadb-connector-cpp") + self.cpp_info.set_property("pkg_config_name", "libmariadbcpp") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "m", "pthread"] + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "shlwapi"] + if self.options.with_ssl == "schannel": + self.cpp_info.system_libs.append("secur32") + + if self.options.shared: + self.cpp_info.libs = ["mariadbcpp"] + if self.settings.os == "Windows": + self.cpp_info.defines.append("MARIADB_EXPORTED=__declspec(dllimport)") + else: + if self.settings.os == "Windows": + self.cpp_info.libs = ["mariadbcpp-static"] + self.cpp_info.defines.append("MARIADB_STATIC_LINK") + else: + self.cpp_info.libs = ["mariadbcpp"] diff --git a/recipes/mariadb-connector-cpp/all/patches/0001-1.1.4-cmake-install-logic.patch b/recipes/mariadb-connector-cpp/all/patches/0001-1.1.4-cmake-install-logic.patch new file mode 100644 index 0000000000000..cd78aa02b0254 --- /dev/null +++ b/recipes/mariadb-connector-cpp/all/patches/0001-1.1.4-cmake-install-logic.patch @@ -0,0 +1,44 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -692,7 +692,7 @@ ADD_DEPENDENCIES(${LIBRARY_NAME} DEPENDENCIES_FOR_PACKAGE) + ########## Packaging ########## + + # MSI +-IF(WIN32) ++IF(0) + IF(WITH_MSI) + ADD_CUSTOM_COMMAND(TARGET ${LIBRARY_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -DDRIVER_LIB_DIR=$ +@@ -710,8 +710,12 @@ ELSE() + #ADD_SUBDIRECTORY(osxinstall) + ENDIF() + INSTALL(TARGETS ${LIBRARY_NAME} +- LIBRARY DESTINATION ${INSTALL_LIBDIR} +- COMPONENT SharedLibraries) ++ LIBRARY DESTINATION lib ++ COMPONENT SharedLibraries ++ RUNTIME DESTINATION bin ++ COMPONENT SharedLibraries ++ ARCHIVE DESTINATION lib ++ COMPONENT SharedLibraries) + INSTALL(TARGETS + ${STATIC_LIBRARY_NAME} + ARCHIVE DESTINATION ${INSTALL_LIBDIR} + +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -38,11 +38,11 @@ ENDIF() + + INSTALL(FILES ${MARIADBCPP_PUBLIC_API} + DESTINATION ${INSTALL_INCLUDEDIR} +- COMPONENT Development) ++ COMPONENT Headers) + INSTALL(FILES ${MARIADBCPP_PUBLIC_CLASSES} + DESTINATION ${INSTALL_INCLUDEDIR}/conncpp +- COMPONENT Development) ++ COMPONENT Headers) + INSTALL(FILES ${MARIADBCPP_COMPAT_STUBS} + DESTINATION ${INSTALL_INCLUDEDIR}/conncpp/compat +- COMPONENT Development) ++ COMPONENT Headers) + \ No newline at end of file diff --git a/recipes/mariadb-connector-cpp/all/test_package/CMakeLists.txt b/recipes/mariadb-connector-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7f29741deeb0c --- /dev/null +++ b/recipes/mariadb-connector-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +find_package(mariadb-connector-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mariadb-connector-cpp::mariadb-connector-cpp) \ No newline at end of file diff --git a/recipes/mariadb-connector-cpp/all/test_package/conanfile.py b/recipes/mariadb-connector-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/mariadb-connector-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, 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/mariadb-connector-cpp/all/test_package/test_package.cpp b/recipes/mariadb-connector-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..10e12dbe83c78 --- /dev/null +++ b/recipes/mariadb-connector-cpp/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main (int argc, char *argv[]) +{ + sql::Driver* driver = sql::mariadb::get_driver_instance(); + sql::Properties properties({{"user", "test"}, {"password", "test"}}); + + + return 0; +} diff --git a/recipes/mariadb-connector-cpp/config.yml b/recipes/mariadb-connector-cpp/config.yml new file mode 100644 index 0000000000000..432c6eae8fe23 --- /dev/null +++ b/recipes/mariadb-connector-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.4": + folder: all \ No newline at end of file diff --git a/recipes/marisa/all/test_v1_package/CMakeLists.txt b/recipes/marisa/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/marisa/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 251bf8ae3e3dd..0000000000000 --- a/recipes/marisa/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/matchit/all/test_package/CMakeLists.txt b/recipes/matchit/all/test_package/CMakeLists.txt index 8898d12cfc675..26768781f4e0e 100644 --- a/recipes/matchit/all/test_package/CMakeLists.txt +++ b/recipes/matchit/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(matchit REQUIRED CONFIG) diff --git a/recipes/matchit/all/test_v1_package/CMakeLists.txt b/recipes/matchit/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/matchit/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/matchit/all/test_v1_package/conanfile.py b/recipes/matchit/all/test_v1_package/conanfile.py deleted file mode 100644 index 0f735b51a2642..0000000000000 --- a/recipes/matchit/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -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 tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/materialx/all/conandata.yml b/recipes/materialx/all/conandata.yml new file mode 100644 index 0000000000000..f0f8336613f73 --- /dev/null +++ b/recipes/materialx/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.39.1": + url: "https://github.com/AcademySoftwareFoundation/MaterialX/archive/refs/tags/v1.39.1.tar.gz" + sha256: "a392fd0aa372bbea7a6f27d20160829ec9380a801976ff467949a90e6555258d" + "1.38.10": + url: "https://github.com/AcademySoftwareFoundation/MaterialX/archive/refs/tags/v1.38.10.tar.gz" + sha256: "706f44100188bc283a135ad24b348e55b405ac9e70cb64b7457c381383cc2887" diff --git a/recipes/materialx/all/conanfile.py b/recipes/materialx/all/conanfile.py new file mode 100644 index 0000000000000..910d0145067ce --- /dev/null +++ b/recipes/materialx/all/conanfile.py @@ -0,0 +1,203 @@ +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, rm, rmdir, replace_in_file +from conan.tools.apple import is_apple_os +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class MaterialXConan(ConanFile): + name = "materialx" + description = "MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AcademySoftwareFoundation/MaterialX" + topics = ("vfx", "3d", "graphics", "aswf") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openimageio": [True, False], + "build_gen_msl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openimageio": False, + "build_gen_msl": True + } + + short_paths = True + + @property + def _min_cppstd(self): + if Version(self.version) >= "1.39.0": + return 17 + else: + return 14 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "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): + if self.options.with_openimageio: + self.requires("openimageio/2.5.14.0") + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("xorg/system") + self.requires("opengl/system") + + 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) + 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.24 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MATERIALX_BUILD_TESTS"] = False + tc.variables["MATERIALX_TEST_RENDER"] = False + tc.variables["MATERIALX_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["MATERIALX_BUILD_GEN_MSL"] = self.options.build_gen_msl and is_apple_os + # TODO: Remove when Conan 1 support is dropped + if not self.settings.compiler.cppstd: + tc.variables["MATERIALX_BUILD_USE_CCACHE"] = self._min_cppstd + tc.variables["MATERIALX_BUILD_USE_CCACHE"] = False + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD", + "# set(CMAKE_CXX_STANDARD") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE", + "# set(CMAKE_POSITION_INDEPENDENT_CODE") + + def build(self): + + 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, "resources")) + rmdir(self, os.path.join(self.package_folder, "libraries")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "README.md", self.package_folder) + rm(self, "CHANGELOG.md", self.package_folder) + rm(self, "THIRD-PARTY.md", self.package_folder) + rm(self, "LICENSE", self.package_folder) + 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): + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.append("dl") + + self.cpp_info.components["MaterialXCore"].libs = ["MaterialXCore"] + + self.cpp_info.components["MaterialXFormat"].libs = ["MaterialXFormat"] + self.cpp_info.components["MaterialXFormat"].requires = ["MaterialXCore"] + + self.cpp_info.components["MaterialXGenGlsl"].libs = ["MaterialXGenGlsl"] + self.cpp_info.components["MaterialXGenGlsl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + self.cpp_info.components["MaterialXGenMdl"].libs = ["MaterialXGenMdl"] + self.cpp_info.components["MaterialXGenMdl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + self.cpp_info.components["MaterialXGenMsl"].libs = ["MaterialXGenMsl"] + self.cpp_info.components["MaterialXGenMsl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + self.cpp_info.components["MaterialXGenOsl"].libs = ["MaterialXGenOsl"] + self.cpp_info.components["MaterialXGenOsl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + self.cpp_info.components["MaterialXGenShader"].libs = ["MaterialXGenShader"] + self.cpp_info.components["MaterialXGenShader"].requires = ["MaterialXCore", "MaterialXFormat"] + + self.cpp_info.components["MaterialXRender"].libs = ["MaterialXRender"] + self.cpp_info.components["MaterialXRender"].requires = ["MaterialXGenShader"] + if self.options.with_openimageio: + self.cpp_info.components["MaterialXRender"].requires.append("openimageio::openimageio") + + self.cpp_info.components["MaterialXRenderGlsl"].libs = ["MaterialXRenderGlsl"] + self.cpp_info.components["MaterialXRenderGlsl"].requires = ["MaterialXRenderHw", "MaterialXGenGlsl"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["MaterialXRenderGlsl"].requires.append("opengl::opengl") + elif self.settings.os in ["Macos", "iOS"]: + self.cpp_info.frameworks.extend(["Foundation", "Cocoa", "OpenGL"]) + if self.settings.os == "Macos": + self.cpp_info.includedirs.extend(["include/compat/osx"]) + else: + self.cpp_info.includedirs.extend(["include/compat/ios"]) + elif self.settings.os == "Windows": + self.cpp_info.system_libs.append("opengl32") + + self.cpp_info.components["MaterialXRenderHw"].libs = ["MaterialXRenderHw"] + self.cpp_info.components["MaterialXRenderHw"].requires = ["MaterialXRender"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["MaterialXRenderHw"].requires.append("xorg::xorg") + elif self.settings.os in ["Macos", "iOS"]: + self.cpp_info.frameworks.extend(["Foundation", "Cocoa", "AppKit", "Metal"]) + if self.settings.os == "Macos": + self.cpp_info.includedirs.extend(["include/compat/osx"]) + else: + self.cpp_info.includedirs.extend(["include/compat/ios"]) + + self.cpp_info.components["MaterialXRenderOsl"].libs = ["MaterialXRenderOsl"] + self.cpp_info.components["MaterialXRenderOsl"].requires = ["MaterialXRender"] + + if self.options.build_gen_msl: + self.cpp_info.components["MaterialXGenMsl"].libs = ["MaterialXGenMsl"] + self.cpp_info.components["MaterialXGenMsl"].requires = ["MaterialXCore", "MaterialXGenShader"] + + if self.options.build_gen_msl and self.settings.os == "Macos": + self.cpp_info.components["MaterialXRenderMsl"].libs = ["MaterialXRenderMsl"] + self.cpp_info.components["MaterialXRenderMsl"].requires = ["MaterialXRenderHw", "MaterialXGenMsl"] + self.cpp_info.frameworks.extend(["CoreFoundation", "OpenGL", "AppKit", "Metal"]) + if self.settings.os == "Macos": + self.cpp_info.includedirs.extend(["include/compat/osx"]) + else: + self.cpp_info.includedirs.extend(["include/compat/ios"]) diff --git a/recipes/materialx/all/test_package/CMakeLists.txt b/recipes/materialx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..54a09a6c2e591 --- /dev/null +++ b/recipes/materialx/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) # if the project uses c++ + +find_package(materialx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE materialx::MaterialXCore materialx::MaterialXFormat) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/materialx/all/test_package/conanfile.py b/recipes/materialx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..311e7c4a81341 --- /dev/null +++ b/recipes/materialx/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 TestMaterialXConan(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/materialx/all/test_package/test_package.cpp b/recipes/materialx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f7a9e7cefee90 --- /dev/null +++ b/recipes/materialx/all/test_package/test_package.cpp @@ -0,0 +1,42 @@ +#include + +#include +#include +#include +#include +#include + +namespace mx = MaterialX; + +int main(void) { + + mx::DocumentPtr doc = mx::createDocument(); + + // Create a base shader nodedef. + mx::NodeDefPtr simpleSrf = doc->addNodeDef("ND_simpleSrf", mx::SURFACE_SHADER_TYPE_STRING, "simpleSrf"); + simpleSrf->setInputValue("diffColor", mx::Color3(1.0f)); + simpleSrf->setInputValue("specColor", mx::Color3(0.0f)); + simpleSrf->setInputValue("roughness", 0.25f); + simpleSrf->setTokenValue("texId", "01"); + + // Create an inherited shader nodedef. + mx::NodeDefPtr anisoSrf = doc->addNodeDef("ND_anisoSrf", mx::SURFACE_SHADER_TYPE_STRING, "anisoSrf"); + anisoSrf->setInheritsFrom(simpleSrf); + anisoSrf->setInputValue("anisotropy", 0.0f); + + // Instantiate shader and material nodes. + mx::NodePtr shaderNode = doc->addNode(anisoSrf->getNodeString(), "", anisoSrf->getType()); + mx::NodePtr materialNode = doc->addMaterialNode("", shaderNode); + + // Set nodedef and shader node qualifiers. + shaderNode->setVersionString("2.0"); + anisoSrf->setVersionString("2"); + shaderNode->setVersionString("2"); + shaderNode->setType(mx::VOLUME_SHADER_TYPE_STRING); + shaderNode->setType(mx::SURFACE_SHADER_TYPE_STRING); + + // Bind a shader input to a value. + mx::InputPtr instanceSpecColor = shaderNode->setInputValue("specColor", mx::Color3(1.0f)); + + return EXIT_SUCCESS; +} diff --git a/recipes/materialx/config.yml b/recipes/materialx/config.yml new file mode 100644 index 0000000000000..a0bedf2527f55 --- /dev/null +++ b/recipes/materialx/config.yml @@ -0,0 +1,5 @@ +versions: + "1.39.1": + folder: all + "1.38.10": + folder: all diff --git a/recipes/mathfu/all/test_package/CMakeLists.txt b/recipes/mathfu/all/test_package/CMakeLists.txt index 71adac698445b..ee5a895fca2c6 100644 --- a/recipes/mathfu/all/test_package/CMakeLists.txt +++ b/recipes/mathfu/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(mathfu REQUIRED CONFIG) diff --git a/recipes/mathfu/all/test_v1_package/CMakeLists.txt b/recipes/mathfu/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/mathfu/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mathfu/all/test_v1_package/conanfile.py b/recipes/mathfu/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mathfu/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_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/mathter/1.x.x/conandata.yml b/recipes/mathter/1.x.x/conandata.yml new file mode 100644 index 0000000000000..f12b02f2c9224 --- /dev/null +++ b/recipes/mathter/1.x.x/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.1.1": + url: "https://github.com/petiaccja/Mathter/archive/v1.1.1.tar.gz" + sha256: "510e6aa198cd7b207a44d319e4471021f207cba8c4d2d7e40086f1f042fe13ab" + "1.1.0": + url: "https://github.com/petiaccja/Mathter/archive/v1.1.0.tar.gz" + sha256: "a9a82126ecd80112854098a5646d38f72f0af03e9655b28ab8fa38b4c03b0870" + "1.0.1": + url: "https://github.com/petiaccja/Mathter/archive/v1.0.1.tar.gz" + sha256: "ab90736abfa8774103b53fe2b8962981c5f117dc582b01698c18d66cd2398b8c" + "1.0.0": + url: "https://github.com/petiaccja/Mathter/archive/v1.0.0.tar.gz" + sha256: "c75cca8d8aec627935250908f2c0f9f1839561e7596a4199bcf80e12b0e6c53b" diff --git a/recipes/mathter/1.x.x/conanfile.py b/recipes/mathter/1.x.x/conanfile.py new file mode 100644 index 0000000000000..82cdb44fbd38a --- /dev/null +++ b/recipes/mathter/1.x.x/conanfile.py @@ -0,0 +1,84 @@ +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" + topics = ("game-dev", "linear-algebra", "vector-math", "matrix-library", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_xsimd": [True, False] # XSimd is optionally used for hand-rolled vectorization. + } + default_options = { + "with_xsimd": True + } + no_copy_source = True + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": 10, + "clang": 6, + "gcc": 7, + "Visual Studio": 16, + } + + def config_options(self): + if Version(self.version) < "1.1": + del self.options.with_xsimd + + 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.name} 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 requirements(self): + if self.options.get_safe("with_xsimd"): + self.requires("xsimd/11.1.0") + + def package(self): + if self.version == "1.0.0": + copy(self, "LICENCE", self.source_folder, os.path.join(self.package_folder, "licenses")) + include_dir = os.path.join(self.source_folder, "Mathter") + else: + copy(self, "LICENCE.md", self.source_folder, os.path.join(self.package_folder, "licenses")) + include_dir = os.path.join(self.source_folder, "include", "Mathter") + copy(self, "*.hpp", include_dir, os.path.join(self.package_folder, "include", "Mathter")) + copy(self, "*.natvis", include_dir, os.path.join(self.package_folder, "include", "Mathter")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.options.get_safe("with_xsimd"): + self.cpp_info.defines = ["MATHTER_USE_XSIMD=1"] diff --git a/recipes/mathter/1.x.x/test_package/CMakeLists.txt b/recipes/mathter/1.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e6eb2612386c1 --- /dev/null +++ b/recipes/mathter/1.x.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(TestPackage CXX) + +find_package(mathter REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE mathter::mathter) +target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/mathter/1.x.x/test_package/conanfile.py b/recipes/mathter/1.x.x/test_package/conanfile.py new file mode 100644 index 0000000000000..fae501d0afb9e --- /dev/null +++ b/recipes/mathter/1.x.x/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): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mathter/1.x.x/test_package/test_package.cpp b/recipes/mathter/1.x.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..c46788d9d6a1c --- /dev/null +++ b/recipes/mathter/1.x.x/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +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; +#ifdef MATHTER_USE_XSIMD + std::cout << "XSimd enabled." << std::endl; +#else + std::cout << "XSimd disabled." << std::endl; +#endif + return 0; +} diff --git a/recipes/mathter/all/conandata.yml b/recipes/mathter/all/conandata.yml index dc5d0897e2e04..72315af7bccd3 100644 --- a/recipes/mathter/all/conandata.yml +++ b/recipes/mathter/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "1.0.0": - url: "https://github.com/petiaccja/Mathter/archive/v1.0.0.tar.gz" - sha256: "c75cca8d8aec627935250908f2c0f9f1839561e7596a4199bcf80e12b0e6c53b" + "2.0.0": + url: "https://github.com/petiaccja/Mathter/archive/v2.0.0.tar.gz" + sha256: "cec8472d3a56613d4815d1a14e5bf42976884177cc5283c5ad5aba0710cc4bab" \ No newline at end of file diff --git a/recipes/mathter/all/conanfile.py b/recipes/mathter/all/conanfile.py index 3c07c54ec5fb2..ec3643caaab0d 100644 --- a/recipes/mathter/all/conanfile.py +++ b/recipes/mathter/all/conanfile.py @@ -3,8 +3,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.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version required_conan_version = ">=1.52.0" @@ -20,6 +21,12 @@ class MathterConan(ConanFile): package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + options = { + "with_xsimd": [True, False] # XSimd is optionally used for hand-rolled vectorization. + } + default_options = { + "with_xsimd": True + } no_copy_source = True @property @@ -31,12 +38,12 @@ def _compilers_minimum_version(self): return { "apple-clang": 10, "clang": 6, - "gcc": 7, + "gcc": 9, "Visual Studio": 16, } def layout(self): - basic_layout(self, src_folder="src") + cmake_layout(self, src_folder="src") def package_id(self): self.info.clear() @@ -46,28 +53,45 @@ def validate(self): 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}, " - f"which your compiler does not support.") - else: - self.output.warning(f"{self.name} requires C++{self._min_cppstd}. " - f"Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++{self._min_cppstd}, " + "which your compiler does not support.") + + def requirements(self): + if self.options.get_safe("with_xsimd"): + self.requires("xsimd/13.0.0") + + 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["MATHTER_BUILD_TESTS"] = "OFF" + tc.variables["MATHTER_BUILD_BENCHMARKS"] = "OFF" + tc.variables["MATHTER_BUILD_EXAMPLES"] = "OFF" + tc.variables["MATHTER_ENABLE_SIMD"] = "ON" if self.options.get_safe("with_xsimd") else "OFF" + tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + venv = VirtualBuildEnv(self) + venv.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + def package(self): - 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) + cmake = CMake(self) + cmake.install() + copy(self, "LICENCE.md", self.source_folder, os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + if self.options.get_safe("with_xsimd"): + self.cpp_info.defines = ["MATHTER_ENABLE_SIMD=1"] diff --git a/recipes/mathter/all/test_package/test_package.cpp b/recipes/mathter/all/test_package/test_package.cpp index f9de551629038..d451c56acac71 100644 --- a/recipes/mathter/all/test_package/test_package.cpp +++ b/recipes/mathter/all/test_package/test_package.cpp @@ -1,11 +1,32 @@ +#include +#include +#include +#include +#include +#include #include + #include +using namespace mathter; + + 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; + const auto u = Vector(1, 2, 3); + const auto v = Vector(4, 6, 8); + const auto r = u + v; + if (r[0] != 5) { + std::cout << "Mathter installation failing." << std::endl; + return 1; + } + else { + std::cout << "Mathter installation works." << std::endl; + std::cout << "Options:" << std::endl; +#ifdef MATHTER_ENABLE_SIMD + std::cout << " with_xsimd = True" << std::endl; +#else + std::cout << " with_xsimd = False" << std::endl; +#endif + return 0; + } } diff --git a/recipes/mathter/all/test_v1_package/CMakeLists.txt b/recipes/mathter/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/mathter/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7177bb22dc3a9..0000000000000 --- a/recipes/mathter/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/mathter/config.yml b/recipes/mathter/config.yml index 40341aa3db6cd..64c627fda4753 100644 --- a/recipes/mathter/config.yml +++ b/recipes/mathter/config.yml @@ -1,3 +1,11 @@ versions: - "1.0.0": + "2.0.0": folder: all + "1.1.1": + folder: 1.x.x + "1.1.0": + folder: 1.x.x + "1.0.1": + folder: 1.x.x + "1.0.0": + folder: 1.x.x diff --git a/recipes/matio/all/conandata.yml b/recipes/matio/all/conandata.yml index 0850bf3d72ee4..2c7850edc678c 100644 --- a/recipes/matio/all/conandata.yml +++ b/recipes/matio/all/conandata.yml @@ -1,36 +1,26 @@ sources: - "1.5.18": - url: "https://downloads.sourceforge.net/project/matio/matio/1.5.18/matio-1.5.18.tar.gz" - sha256: "5fad71a63a854d821cc6f4e8c84da837149dd5fb57e1e2baeffd85fa0f28fe25" - "1.5.19": - url: "https://downloads.sourceforge.net/project/matio/matio/1.5.19/matio-1.5.19.tar.gz" - sha256: "a4fa4d248b0414fc72f3d6155f710c470d5628d3c31af834f8d5ccf06b60286f" - "1.5.21": - url: "https://downloads.sourceforge.net/project/matio/matio/1.5.21/matio-1.5.21.tar.gz" - sha256: "21809177e55839e7c94dada744ee55c1dea7d757ddaab89605776d50122fb065" "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" + "1.5.26": + url: "https://downloads.sourceforge.net/project/matio/matio/1.5.26/matio-1.5.26.tar.gz" + sha256: "8b47c29f58e468dba7a5555371c6a72ad4c6aa8b15f459b2b0b65a303c063933" + "1.5.27": + url: "https://downloads.sourceforge.net/project/matio/matio/1.5.27/matio-1.5.27.tar.gz" + sha256: "0a6aa00b18c4512b63a8d27906b079c8c6ed41d4b2844f7a4ae598e18d22d3b3" patches: - "1.5.18": + "1.5.23": - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/disable-hdf5-target.patch" - - patch_file: "patches/patch-apple-no-undefined.patch" - patch_file: "patches/cmake-install-bundle.patch" - "1.5.19": + "1.5.24": - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/patch-apple-no-undefined.patch" - patch_file: "patches/cmake-install-bundle.patch" - "1.5.21": + "1.5.26": - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/patch-apple-no-undefined.patch" - patch_file: "patches/cmake-install-bundle.patch" - "1.5.23": + "1.5.27": - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/cmake-install-bundle.patch" - "1.5.24": - - patch_file: "patches/require-cmake-3.10.patch" - - patch_file: "patches/cmake-install-bundle.patch" + - patch_file: "patches/cmake-install-bundle-1.5.27.patch" diff --git a/recipes/matio/all/conanfile.py b/recipes/matio/all/conanfile.py index 199bb98823415..d5369f6dca220 100644 --- a/recipes/matio/all/conanfile.py +++ b/recipes/matio/all/conanfile.py @@ -54,7 +54,7 @@ def layout(self): def requirements(self): if self.options.with_hdf5: - self.requires("hdf5/1.14.1") + self.requires("hdf5/1.14.3") if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") @@ -67,6 +67,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["MATIO_ENABLE_CPPCHECK"] = False 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 diff --git a/recipes/matio/all/patches/cmake-install-bundle-1.5.27.patch b/recipes/matio/all/patches/cmake-install-bundle-1.5.27.patch new file mode 100644 index 0000000000000..9d320dedb44ec --- /dev/null +++ b/recipes/matio/all/patches/cmake-install-bundle-1.5.27.patch @@ -0,0 +1,14 @@ +Fix CMake configuration errors while cross-building to iOS/tvOS/watchOS + +--- a/cmake/tools.cmake ++++ b/cmake/tools.cmake +@@ -8,8 +8,5 @@ if(NOT HAVE_GETOPT) + endif() + + install(TARGETS matdump +- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + ) diff --git a/recipes/matio/all/patches/disable-hdf5-target.patch b/recipes/matio/all/patches/disable-hdf5-target.patch deleted file mode 100644 index 8f9c45cb87de8..0000000000000 --- a/recipes/matio/all/patches/disable-hdf5-target.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/cmake/thirdParties.cmake -+++ b/cmake/thirdParties.cmake -@@ -29,8 +29,8 @@ if(MATIO_WITH_HDF5) - endif() - endif() - --if(HDF5_FOUND) - set(HAVE_HDF5 1) -+if(0) - add_library(HDF5::HDF5 INTERFACE IMPORTED) - if(MATIO_USE_CONAN AND TARGET CONAN_PKG::hdf5) - # target from Conan diff --git a/recipes/matio/all/patches/patch-apple-no-undefined.patch b/recipes/matio/all/patches/patch-apple-no-undefined.patch deleted file mode 100644 index 6dbb97ff53471..0000000000000 --- a/recipes/matio/all/patches/patch-apple-no-undefined.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/cmake/src.cmake -+++ b/cmake/src.cmake -@@ -37,8 +37,12 @@ if(STDINT_MSVC) - endif() - - if(NOT MSVC) -- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") -- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--retain-symbols-file,${PROJECT_SOURCE_DIR}/src/matio.sym") -+ if(APPLE) -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error") -+ else() -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") -+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--retain-symbols-file,${PROJECT_SOURCE_DIR}/src/matio.sym") -+ endif() - endif() - - if(MATIO_SHARED) diff --git a/recipes/matio/all/test_v1_package/CMakeLists.txt b/recipes/matio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/matio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 3053c8502b32d..0000000000000 --- a/recipes/matio/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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 32213bb4d952d..71576cf31a76e 100644 --- a/recipes/matio/config.yml +++ b/recipes/matio/config.yml @@ -1,11 +1,9 @@ versions: - "1.5.18": + "1.5.27": folder: all - "1.5.19": + "1.5.26": folder: all - "1.5.21": + "1.5.24": folder: all "1.5.23": folder: all - "1.5.24": - folder: all diff --git a/recipes/maven/all/conandata.yml b/recipes/maven/all/conandata.yml index a0978eddc0d68..f03488696f01d 100644 --- a/recipes/maven/all/conandata.yml +++ b/recipes/maven/all/conandata.yml @@ -1,4 +1,9 @@ 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" diff --git a/recipes/maven/all/conanfile.py b/recipes/maven/all/conanfile.py index 31d963f2df4c1..4a59f21e6ca9c 100644 --- a/recipes/maven/all/conanfile.py +++ b/recipes/maven/all/conanfile.py @@ -18,7 +18,7 @@ def layout(self): pass def requirements(self): - self.requires("zulu-openjdk/11.0.19") + self.requires("zulu-openjdk/21.0.1") def package_id(self): del self.info.settings.arch diff --git a/recipes/maven/config.yml b/recipes/maven/config.yml index 95a41cd441c27..8e2950a3cb156 100644 --- a/recipes/maven/config.yml +++ b/recipes/maven/config.yml @@ -1,4 +1,6 @@ versions: + "3.9.6": + folder: all "3.9.4": folder: all "3.9.2": diff --git a/recipes/mbedtls/all/conandata.yml b/recipes/mbedtls/all/conandata.yml index 6768571f77c35..fadcef127351e 100644 --- a/recipes/mbedtls/all/conandata.yml +++ b/recipes/mbedtls/all/conandata.yml @@ -1,34 +1,28 @@ sources: - "3.5.1": - url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.5.1.tar.gz" - sha256: "0da345cda55ec6f6d71afa84cfae55632a16ba0b8b4644f4d0e8a32c9d1117b0" + "3.6.2": + url: "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-3.6.2/mbedtls-3.6.2.tar.bz2" + sha256: "8b54fb9bcf4d5a7078028e0520acddefb7900b3e66fec7f7175bb5b7d85ccdca" + "3.6.1": + url: "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-3.6.1/mbedtls-3.6.1.tar.bz2" + sha256: "fc8bef0991b43629b7e5319de6f34f13359011105e08e3e16eed3a9fe6ffd3a3" + "3.6.0": + url: "https://github.com/Mbed-TLS/mbedtls/releases/download/v3.6.0/mbedtls-3.6.0.tar.bz2" + sha256: "3ecf94fcfdaacafb757786a01b7538a61750ebd85c4b024f56ff8ba1490fcd38" + "3.5.2": + url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.5.2.tar.gz" + sha256: "eedecc468b3f8d052ef05a9d42bf63f04c8a1c50d1c5a94c251c681365a2c723" "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/Mbed-TLS/mbedtls/archive/mbedtls-3.2.1.tar.gz" sha256: "5850089672560eeaca03dc36678ee8573bb48ef6e38c94f5ce349af60c16da33" - "3.1.0": - url: "https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.1.0.tar.gz" - sha256: "64d01a3b22b91cf3a25630257f268f11bc7bfa37981ae6d397802dd4ccec4690" - "3.0.0": - 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/Mbed-TLS/mbedtls/archive/mbedtls-2.24.0.tar.gz" - sha256: "b5a779b5f36d5fc4cba55faa410685f89128702423ad07b36c5665441a06a5f3" - "2.23.0": - 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 b5af5483b03f4..a7be6bb56908c 100644 --- a/recipes/mbedtls/all/conanfile.py +++ b/recipes/mbedtls/all/conanfile.py @@ -2,11 +2,11 @@ from conan.errors import ConanInvalidConfiguration 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.microsoft import is_msvc from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class MBedTLSConan(ConanFile): @@ -15,10 +15,10 @@ class MBedTLSConan(ConanFile): "mbed TLS makes it trivially easy for developers to include " "cryptographic and SSL/TLS capabilities in their (embedded) products" ) - topics = ("polarssl", "tls", "security") + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://tls.mbed.org" - license = "Apache-2.0" + topics = ("polarssl", "tls", "security") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -26,11 +26,13 @@ class MBedTLSConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_zlib": [True, False], + "enable_threading": [True, False], } default_options = { "shared": False, "fPIC": True, "with_zlib": True, + "enable_threading": False, } def config_options(self): @@ -54,8 +56,12 @@ def requirements(self): self.requires("zlib/[>=1.2.11 <2]") def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} does not support shared build on Windows") + if self.settings.os == "Windows": + if self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not support shared build on Windows") + if self.options.enable_threading: + # INFO: Planned: https://github.com/Mbed-TLS/mbedtls/issues/8455 + raise ConanInvalidConfiguration(f"{self.ref} does not support the option enable_threading on Windows") if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": # The command line flags set are not supported on older versions of gcc @@ -81,11 +87,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.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if is_msvc(self) and "2.16.12" <= Version(self.version) <= "3.6.0": + tc.preprocessor_definitions["MBEDTLS_PLATFORM_SNPRINTF_MACRO"] = "snprintf" + if self.options.enable_threading: + tc.preprocessor_definitions["MBEDTLS_THREADING_C"] = True + tc.preprocessor_definitions["MBEDTLS_THREADING_PTHREAD"] = True + tc.generate() tc = CMakeDeps(self) tc.generate() @@ -100,6 +108,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")) rmdir(self, os.path.join(self.package_folder, "cmake")) def package_info(self): @@ -108,21 +117,34 @@ def package_info(self): self.cpp_info.components["mbedcrypto"].set_property("cmake_target_name", "MbedTLS::mbedcrypto") self.cpp_info.components["mbedcrypto"].libs = ["mbedcrypto"] + if self.settings.os == "Windows": + self.cpp_info.components["mbedcrypto"].system_libs = ["bcrypt"] + if Version(self.version) >= "3.6.0": + self.cpp_info.components["mbedcrypto"].set_property("pkg_config_name", "mbedcrypto") + if self.options.enable_threading: + self.cpp_info.components["mbedcrypto"].defines.extend(["MBEDTLS_THREADING_C=1", "MBEDTLS_THREADING_PTHREAD=1"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["mbedcrypto"].system_libs.append("pthread") self.cpp_info.components["mbedx509"].set_property("cmake_target_name", "MbedTLS::mbedx509") self.cpp_info.components["mbedx509"].libs = ["mbedx509"] + if self.settings.os == "Windows": + self.cpp_info.components["mbedx509"].system_libs = ["ws2_32"] self.cpp_info.components["mbedx509"].requires = ["mbedcrypto"] + if Version(self.version) >= "3.6.0": + self.cpp_info.components["mbedx509"].set_property("pkg_config_name", "mbedx509") self.cpp_info.components["libembedtls"].set_property("cmake_target_name", "MbedTLS::mbedtls") self.cpp_info.components["libembedtls"].libs = ["mbedtls"] self.cpp_info.components["libembedtls"].requires = ["mbedx509"] + if is_msvc(self) and "2.16.12" <= Version(self.version) <= "3.6.0": + for component in ["mbedcrypto", "libembedtls", "mbedx509"]: + self.cpp_info.components[component].defines.append("MBEDTLS_PLATFORM_SNPRINTF_MACRO=snprintf") + + if Version(self.version) >= "3.6.0": + self.cpp_info.components["libembedtls"].set_property("pkg_config_name", "embedtls") + if self.options.get_safe("with_zlib"): for component in self.cpp_info.components: self.cpp_info.components[component].requires.append("zlib::zlib") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "MbedTLS" - self.cpp_info.names["cmake_find_package_multi"] = "MbedTLS" - self.cpp_info.components["libembedtls"].names["cmake_find_package"] = "mbedtls" - self.cpp_info.components["libembedtls"].names["cmake_find_package_multi"] = "mbedtls" diff --git a/recipes/mbedtls/all/test_v1_package/CMakeLists.txt b/recipes/mbedtls/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/mbedtls/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mbedtls/all/test_v1_package/conanfile.py b/recipes/mbedtls/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mbedtls/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_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/mbedtls/config.yml b/recipes/mbedtls/config.yml index 292e2461de0ef..c59faa366d45d 100644 --- a/recipes/mbedtls/config.yml +++ b/recipes/mbedtls/config.yml @@ -1,23 +1,24 @@ versions: - "3.5.1": + "3.6.2": folder: all - "3.5.0": + "3.6.1": folder: all - "3.4.1": + "3.6.0": folder: all - "3.2.1": + "3.5.2": folder: all - "3.1.0": + # keep 3.5.0 for libcurl, libssh2, libwebsockets, libzip + "3.5.0": folder: all - "3.0.0": + # keep 3.2.1 for libcoap, libgit2, lief + "3.2.1": folder: all + # keep 2.28.4 for libssh2 "2.28.4": folder: all + # keep 2.25.0 for ixwebsocket, nng, open62541, yojimbo, mdnsresponder "2.25.0": folder: all - "2.24.0": - folder: all - "2.23.0": - folder: all + # keep 2.6.12 for cose-c "2.16.12": folder: all diff --git a/recipes/mbits-args/all/test_package/CMakeLists.txt b/recipes/mbits-args/all/test_package/CMakeLists.txt index 6048bc9a7928f..8eb23f195177f 100644 --- a/recipes/mbits-args/all/test_package/CMakeLists.txt +++ b/recipes/mbits-args/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(mbits-args REQUIRED CONFIG) diff --git a/recipes/mbits-args/all/test_v1_package/CMakeLists.txt b/recipes/mbits-args/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/mbits-args/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mbits-args/all/test_v1_package/conanfile.py b/recipes/mbits-args/all/test_v1_package/conanfile.py deleted file mode 100644 index 897d76acb188a..0000000000000 --- a/recipes/mbits-args/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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("{} --sum 1000 700 1".format(bin_path), run_environment=True) diff --git a/recipes/mbits-diags/all/conanfile.py b/recipes/mbits-diags/all/conanfile.py index 204bf4ed9c3fa..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/10.1.0") + self.requires("fmt/10.2.1") self.requires("mbits-semver/0.1.1") def validate(self): diff --git a/recipes/mbits-diags/all/test_package/CMakeLists.txt b/recipes/mbits-diags/all/test_package/CMakeLists.txt index 931abded16bce..a77720f19d623 100644 --- a/recipes/mbits-diags/all/test_package/CMakeLists.txt +++ b/recipes/mbits-diags/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(mbits-diags REQUIRED CONFIG) diff --git a/recipes/mbits-diags/all/test_v1_package/CMakeLists.txt b/recipes/mbits-diags/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/mbits-diags/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mbits-diags/all/test_v1_package/conanfile.py b/recipes/mbits-diags/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/mbits-diags/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/mbits-lngs/all/conanfile.py b/recipes/mbits-lngs/all/conanfile.py index 49f97626d1e47..3558c49245302 100644 --- a/recipes/mbits-lngs/all/conanfile.py +++ b/recipes/mbits-lngs/all/conanfile.py @@ -50,7 +50,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/10.1.0") + self.requires("fmt/10.2.1") self.requires("mbits-utfconv/1.0.3") self.requires("mbits-diags/0.9.6") self.requires("mbits-mstch/1.0.4") diff --git a/recipes/mbits-lngs/all/test_package/CMakeLists.txt b/recipes/mbits-lngs/all/test_package/CMakeLists.txt index de4330a77c2a6..5836b355587df 100644 --- a/recipes/mbits-lngs/all/test_package/CMakeLists.txt +++ b/recipes/mbits-lngs/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(mbits-lngs REQUIRED CONFIG) diff --git a/recipes/mbits-mstch/all/test_package/CMakeLists.txt b/recipes/mbits-mstch/all/test_package/CMakeLists.txt index b7067fa3ea38e..12cc8e8eb5717 100644 --- a/recipes/mbits-mstch/all/test_package/CMakeLists.txt +++ b/recipes/mbits-mstch/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(mbits-mstch REQUIRED CONFIG) diff --git a/recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt b/recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/mbits-mstch/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mbits-mstch/all/test_v1_package/conanfile.py b/recipes/mbits-mstch/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/mbits-mstch/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/mbits-semver/all/test_package/CMakeLists.txt b/recipes/mbits-semver/all/test_package/CMakeLists.txt index 4d8d4734ef155..d3dd2c3bfd89b 100644 --- a/recipes/mbits-semver/all/test_package/CMakeLists.txt +++ b/recipes/mbits-semver/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(mbits-semver REQUIRED CONFIG) diff --git a/recipes/mbits-semver/all/test_v1_package/CMakeLists.txt b/recipes/mbits-semver/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/mbits-semver/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mbits-semver/all/test_v1_package/conanfile.py b/recipes/mbits-semver/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/mbits-semver/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/mbits-utfconv/all/conandata.yml b/recipes/mbits-utfconv/all/conandata.yml index f315fc7cf457d..321d37c79ca7e 100644 --- a/recipes/mbits-utfconv/all/conandata.yml +++ b/recipes/mbits-utfconv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.4": + url: "https://github.com/mbits-libs/utfconv/archive/v1.0.4.tar.gz" + sha256: "cd4b6cbed75d67a02399add312b93c4c1de9ac53cf33a8bf44baece038fabb60" "1.0.3": url: "https://github.com/mbits-libs/utfconv/archive/v1.0.3.tar.gz" sha256: "2077e3dcb999dc76d2bdc06cc141b38e10f15762975c261f72cc1a8c2519a27a" diff --git a/recipes/mbits-utfconv/all/test_package/CMakeLists.txt b/recipes/mbits-utfconv/all/test_package/CMakeLists.txt index 1afdb5a7117b8..b88256eaa67b9 100644 --- a/recipes/mbits-utfconv/all/test_package/CMakeLists.txt +++ b/recipes/mbits-utfconv/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(mbits-utfconv REQUIRED CONFIG) diff --git a/recipes/mbits-utfconv/all/test_v1_package/CMakeLists.txt b/recipes/mbits-utfconv/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/mbits-utfconv/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mbits-utfconv/all/test_v1_package/conanfile.py b/recipes/mbits-utfconv/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/mbits-utfconv/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/mbits-utfconv/config.yml b/recipes/mbits-utfconv/config.yml index 372dd1cb646bd..20b5bf02cf8c7 100644 --- a/recipes/mbits-utfconv/config.yml +++ b/recipes/mbits-utfconv/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.4": + folder: all "1.0.3": folder: all diff --git a/recipes/mcap/all/conandata.yml b/recipes/mcap/all/conandata.yml index 4ede1237bc36c..d6df7ac1df80a 100644 --- a/recipes/mcap/all/conandata.yml +++ b/recipes/mcap/all/conandata.yml @@ -1,37 +1,43 @@ sources: + "1.4.1": + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.4.1.tar.gz" + sha256: "69bcd33e1590201ea180e9e6ba8a22f3e8e7e2283e9ebcbff6a2c7134d8341db" + "1.4.0": + url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.4.0.tar.gz" + sha256: "64ff3e51119f37ffcfaf9deecbd987a7cb4d4d9035d74a3fd3773395a470fda1" "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: + "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: + "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: + "1.0.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v1.0.0/main.tar.gz" sha256: "e36169e46a67a9431f73df335f67488461817bc423f9af63ac0af7f29e0bd696" - 0.9.0: + "0.9.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.9.0/main.tar.gz" sha256: "e17702fcc0259bf72eab0d84d3fa6e02c051256357ab7ba4421462f2c02b434f" - 0.5.0: + "0.5.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.5.0/main.tar.gz" sha256: "408e255a6c6419b16de38a9ecbdd9729d60adc657767b2d52a234d1da1185349" - 0.4.0: + "0.4.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.4.0/main.tar.gz" sha256: "c0ab99e51005fa8b74fe9ca1ed23b205cf532b8b0723eedd243f35a28d7b466b" - 0.3.0: + "0.3.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.3.0/main.tar.gz" sha256: "ef29ea4c09520b8aaa2d78ce5e79cbbcd87511ed14d6abf3c4b249ae67a4153b" - 0.1.2: + "0.1.2": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.2/main.tar.gz" sha256: "0f456d6c53730445c3dbf57afd285493cf748c66a02f77d6e48c075128fd0896" - 0.1.1: + "0.1.1": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.1/main.tar.gz" sha256: "a9ea899315851bfacdb234b7acc917b1a9c67593f0d68e1920321a8f6fa2cfbf" - 0.1.0: + "0.1.0": url: "https://github.com/foxglove/mcap/archive/refs/tags/releases/cpp/v0.1.0/main.tar.gz" sha256: "a936abb1493b0d189d7909a79c45bdc6703b6016801e10b5cd129ba39642d2b2" diff --git a/recipes/mcap/all/test_package/CMakeLists.txt b/recipes/mcap/all/test_package/CMakeLists.txt index fa5c6d575b8ef..edad74a242745 100644 --- a/recipes/mcap/all/test_package/CMakeLists.txt +++ b/recipes/mcap/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(mcap REQUIRED CONFIG) diff --git a/recipes/mcap/all/test_v1_package/CMakeLists.txt b/recipes/mcap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/mcap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mcap/all/test_v1_package/conanfile.py b/recipes/mcap/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/mcap/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/mcap/config.yml b/recipes/mcap/config.yml index fb6aa455469ea..0b63fa5acf0da 100644 --- a/recipes/mcap/config.yml +++ b/recipes/mcap/config.yml @@ -1,25 +1,29 @@ versions: + "1.4.1": + folder: all + "1.4.0": + folder: all "1.3.0": folder: all "1.2.1": folder: all - 1.2.0: + "1.2.0": folder: all - 1.1.0: + "1.1.0": folder: all - 1.0.0: + "1.0.0": folder: all - 0.9.0: + "0.9.0": folder: all - 0.5.0: + "0.5.0": folder: all - 0.4.0: + "0.4.0": folder: all - 0.3.0: + "0.3.0": folder: all - 0.1.2: + "0.1.2": folder: all - 0.1.1: + "0.1.1": folder: all - 0.1.0: + "0.1.0": folder: all diff --git a/recipes/md4c/all/conandata.yml b/recipes/md4c/all/conandata.yml index 013088e384ddf..9b548aabb3a3f 100644 --- a/recipes/md4c/all/conandata.yml +++ b/recipes/md4c/all/conandata.yml @@ -1,8 +1,23 @@ sources: + "0.5.2": + url: "https://github.com/mity/md4c/archive/refs/tags/release-0.5.2.tar.gz" + sha256: "55d0111d48fb11883aaee91465e642b8b640775a4d6993c2d0e7a8092758ef21" + "0.5.1": + url: "https://github.com/mity/md4c/archive/refs/tags/release-0.5.1.tar.gz" + sha256: "2dca17c6175a7f11182943079c2a4f9adb5071433e3d3d05ba801ff794993f34" "0.4.8": url: "https://github.com/mity/md4c/archive/refs/tags/release-0.4.8.tar.gz" sha256: "4a457df853425b6bb6e3457aa1d1a13bccec587a04c38c622b1013a0da41439f" patches: + "0.5.2": + - patch_file: "patches/0.5.2-0001-honor-vc-runtime.patch" + patch_description: "Honor msvc runtime from profile" + patch_type: "conan" + "0.5.1": + - patch_file: "patches/0.5.1-0001-honor-vc-runtime.patch" + patch_description: "Honor msvc runtime from profile" + patch_type: "conan" "0.4.8": - - patch_file: "patches/0001-honor-vc-runtime.patch" + - patch_file: "patches/0.4.8-0001-honor-vc-runtime.patch" patch_description: "Honor msvc runtime from profile" + patch_type: "conan" diff --git a/recipes/md4c/all/conanfile.py b/recipes/md4c/all/conanfile.py index ad333104761a5..bbfb015cae370 100644 --- a/recipes/md4c/all/conanfile.py +++ b/recipes/md4c/all/conanfile.py @@ -1,30 +1,34 @@ 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 apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2" class Md4cConan(ConanFile): name = "md4c" description = "C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification." license = "MIT" - topics = ("markdown-parser", "markdown") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mity/md4c" + topics = ("markdown-parser", "markdown") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "md2html": [True, False], "encoding": ["utf-8", "utf-16", "ascii"], } default_options = { "shared": False, "fPIC": True, + #"md2html": True, # conditional default value in config_options "encoding": "utf-8", } @@ -34,6 +38,14 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) >= "0.5.0": + # Set it to false for iOS, tvOS, watchOS, visionOS + # to prevent cmake from creating a bundle for the md2html executable + is_ios_variant = is_apple_os(self) and not self.settings.os == "Macos" + self.options.md2html = not is_ios_variant + else: + # md2html was introduced in 0.5.0 + del self.options.md2html def configure(self): if self.options.shared: @@ -50,15 +62,19 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._patch_sources() def generate(self): tc = CMakeToolchain(self) + tc.cache_variables["BUILD_MD2HTML_EXECUTABLE"] = self.options.get_safe("md2html", True) if self.options.encoding == "utf-8": tc.preprocessor_definitions["MD4C_USE_UTF8"] = "1" elif self.options.encoding == "utf-16": tc.preprocessor_definitions["MD4C_USE_UTF16"] = "1" elif self.options.encoding == "ascii": tc.preprocessor_definitions["MD4C_USE_ASCII"] = "1" + if Version(self.version) < "0.5.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def _patch_sources(self): @@ -72,7 +88,6 @@ def _patch_sources(self): ) def build(self): - self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -103,10 +118,3 @@ def package_info(self): # to create unofficial target or pkgconfig file self.cpp_info.set_property("cmake_target_name", "md4c::md4c-html") self.cpp_info.set_property("pkg_config_name", "md4c-html") - - # TODO: to remove in conan v2 - self.cpp_info.components["_md4c"].names["cmake_find_package"] = "md4c" - self.cpp_info.components["_md4c"].names["cmake_find_package_multi"] = "md4c" - self.cpp_info.components["md4c_html"].names["cmake_find_package"] = "md4c-html" - self.cpp_info.components["md4c_html"].names["cmake_find_package_multi"] = "md4c-html" - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/md4c/all/patches/0001-honor-vc-runtime.patch b/recipes/md4c/all/patches/0.4.8-0001-honor-vc-runtime.patch similarity index 100% rename from recipes/md4c/all/patches/0001-honor-vc-runtime.patch rename to recipes/md4c/all/patches/0.4.8-0001-honor-vc-runtime.patch diff --git a/recipes/md4c/all/patches/0.5.1-0001-honor-vc-runtime.patch b/recipes/md4c/all/patches/0.5.1-0001-honor-vc-runtime.patch new file mode 100644 index 0000000000000..a6ad62492c9da --- /dev/null +++ b/recipes/md4c/all/patches/0.5.1-0001-honor-vc-runtime.patch @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index be781e5..c60da0a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,15 +46,15 @@ elseif(MSVC) + # Disable warnings about the so-called unsecured functions: + add_definitions(/D_CRT_SECURE_NO_WARNINGS /W3) + +- # Specify proper C runtime library: +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") +- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") +- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") ++# # Specify proper C runtime library: ++# string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") ++# string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") ++# string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") ++# string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") ++# set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") ++# set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") ++# set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") ++# set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") + endif() + + include(GNUInstallDirs) diff --git a/recipes/md4c/all/patches/0.5.2-0001-honor-vc-runtime.patch b/recipes/md4c/all/patches/0.5.2-0001-honor-vc-runtime.patch new file mode 100644 index 0000000000000..5e8fb995033c5 --- /dev/null +++ b/recipes/md4c/all/patches/0.5.2-0001-honor-vc-runtime.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aec8293..f24e654 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,14 +53,14 @@ elseif(MSVC) + add_compile_options(/W3) + + # Specify proper C runtime library: +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") +- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") +- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") ++ # string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") ++ # string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") ++ # string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") ++ # string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") ++ # set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") ++ # set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") ++ # set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") ++ # set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") + endif() + + include(GNUInstallDirs) diff --git a/recipes/md4c/all/test_package/CMakeLists.txt b/recipes/md4c/all/test_package/CMakeLists.txt index afe8788f52c1d..12450e226aaf4 100644 --- a/recipes/md4c/all/test_package/CMakeLists.txt +++ b/recipes/md4c/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(md4c CONFIG REQUIRED) diff --git a/recipes/md4c/all/test_v1_package/CMakeLists.txt b/recipes/md4c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/md4c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/md4c/all/test_v1_package/conanfile.py b/recipes/md4c/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/md4c/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/md4c/config.yml b/recipes/md4c/config.yml index e89d9145fbd26..684aad3078ab7 100644 --- a/recipes/md4c/config.yml +++ b/recipes/md4c/config.yml @@ -1,3 +1,7 @@ versions: + "0.5.2": + folder: all + "0.5.1": + folder: all "0.4.8": folder: all diff --git a/recipes/md4qt/all/conandata.yml b/recipes/md4qt/all/conandata.yml index 8c1a73b11f3c4..df679b51ea162 100644 --- a/recipes/md4qt/all/conandata.yml +++ b/recipes/md4qt/all/conandata.yml @@ -1,88 +1,16 @@ sources: - "2.3.4": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.4.tar.gz" - sha256: "7f356658316da4f4eaf7bde43dd43027a602c49640d297357b12e22a1a842a68" - "2.3.3": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.3.tar.gz" - sha256: "89584d77d7e338d858e2198b20cd091cc713aef74880ef1fccc6c1e9d8b74acd" - "2.3.2": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.2.tar.gz" - sha256: "0a89854d639a3710ab89611333fd1a1047cd5edc87ba767fbefdc37e701ae671" - "2.3.1": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.1.tar.gz" - sha256: "7126ecc34f9808943b76b05106ebd42ef01b7b812416efc2382de68a13804d01" - "2.3.0": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.3.0.tar.gz" - sha256: "e8a37c80f1823bbac9cbfd6bbd662ee14e8ff0ac9e97966aa34cb2d0eed18e72" - "2.2.3": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.2.3.tar.gz" - sha256: "31f6de553700b25e4ed8517bcde24bd43b18c3fda1260f968aa5c393a7491783" - "2.2.2": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.2.2.tar.gz" - sha256: "4d5a0f7ed250cbcb8a3a1f4244f8413ed854e538406c571e83ebccf709cff49e" - "2.2.1": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.2.1.tar.gz" - sha256: "1e774a01d866c2738e1ec897ebb58057bf0eb7d7895aed48904907a77934c459" - "2.2.0": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.2.0.tar.gz" - sha256: "3c9228e658e8a613fbd098daf815d3884c8da404238723ff4d68065e5fedd5d7" - "2.1.1": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.1.1.tar.gz" - sha256: "76f4cb2919cae393ef52788a63853aa52e429f8ff218f5eff9d38f4ebb4b3b1e" - "2.1.0": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.1.0.tar.gz" - sha256: "cfbf515adecd798a3f1a4f2e007021b4b31742dd0b36805c273b3b8316fd820d" - "2.0.18": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.18.tar.gz" - sha256: "4fe70a63eb78cdf0355f6a6b292c40c8cc8ed4a62bcbec17afefa713b19c28b1" - "2.0.16": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.16.tar.gz" - sha256: "9da7cd02883c2f4d4a2371cda4c195ebc02f57bb673ef948b88a256f3db55724" - "2.0.15": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.15.tar.gz" - sha256: "53c4a65bb178afde91ae2360072f65a44ae7572a25912a3fe96aeaa6ac86ef27" - "2.0.14": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.14.tar.gz" - sha256: "b230f1a99a2a5f4f1f32748d52062276294b34d8254d4128193632e3a8ffaa4e" - "2.0.13": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.13.tar.gz" - sha256: "4e6cdcd54c5ce1e1ed9a97bd18ac5aeb7c15bb303193b4261058aef724fe9a41" - "2.0.12": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.12.tar.gz" - sha256: "07c89e37c624da036008acac88115b5aee6440f9e9f326139f256f34022f9a20" - "2.0.11": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.11.tar.gz" - sha256: "990979474bcbb924efb1c046581589e11889d502e5ad24b9779c131c4f3d9941" - "2.0.10": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.10.tar.gz" - sha256: "efcb7c97999ce2d78aba67041a61dda45feb54113e5b21851b0532fdcbc460a8" - "2.0.9": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.9.tar.gz" - sha256: "5b00c997eb33e877ca54468a101345e3a9986ce1b61b0919fa8632efabc51b6d" - "2.0.8": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.8.tar.gz" - sha256: "50a47d407acf1ca6a5b96af0386da74f7cfb66322ec7453cbb543f4f66251683" - "2.0.7": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.7.tar.gz" - sha256: "2852ac88f95051ce0ce112e5d99695307d8748f47553b101edebecce03ee3eae" - "2.0.6": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.6.tar.gz" - sha256: "be6b227f8e0053fa7bf3a1a11f0e15cda72dabbe64cc9e50c9ea0789313a57c2" - "2.0.5": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.5.tar.gz" - sha256: "363cc13d35c66d8d89df25eef9ac49ec2d259781752208231bad32db4df5dd52" - "2.0.4": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.4.tar.gz" - sha256: "2980a0d0b5d3539a5a1402942a1345e97c8ab36acfc8e00d932df157d2e6edc2" - "2.0.3": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.3.tar.gz" - sha256: "374bfc74aa6ebb1ea7d2332b96f8b2f6001118793bbe4e55109a13d0ffe7ce55" - "2.0.2": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.2.tar.gz" - sha256: "721c7e5f8676dba1023931b9e2fd0d22cbc643bc9864c1d1163df3c5615e7e96" - "2.0.1": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.1.tar.gz" - sha256: "879f069cd12db44f2fcc33590ded1f9d778f4c854be14a7ad72fb2ff4acdb3d2" - "2.0.0": - url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.0.0.tar.gz" - sha256: "3c834c4d832208658f042bd85a821c297fafd0f2eedda9d6ddddced7b724f61a" + "4.1.0": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/4.1.0.tar.gz" + sha256: "b6fe728fb2a60a53ee75fa1895b908aea1ba9d430ba5503a95a79749a5e2285b" + "3.0.0": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/3.0.0.tar.gz" + sha256: "757f94ce1818123abe899729bba00aa1d99150d4cbe934ab57a95b308fd536dd" + "2.8.2": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.8.2.tar.gz" + sha256: "4f560d752ead3aba4983bd09d87e9e32a8313770d7fde0374988785d193b386a" + "2.7.4": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.7.4.tar.gz" + sha256: "adef8e96e71f13cb9f4450eee7bb02a43694682dc67519323f8e23f7bf10d0d1" + "2.6.0": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.6.0.tar.gz" + sha256: "8884a3b18fd923dd49994190e0b11c1882e409fce59fb6e5ee8e866dd889b8d0" diff --git a/recipes/md4qt/all/conanfile.py b/recipes/md4qt/all/conanfile.py index 90fcedd907a99..1c9206d118c6c 100644 --- a/recipes/md4qt/all/conanfile.py +++ b/recipes/md4qt/all/conanfile.py @@ -60,8 +60,14 @@ def build(self): pass def package(self): - 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, "md4qt"), dst=os.path.join(self.package_folder, "include", "md4qt")) + if Version(self.version) <= "2.8.1": + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + else: + copy(self, "MIT.txt", src=os.path.join(self.source_folder, "LICENSES"), dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) < "4.0.0": + copy(self, "*.hpp", src=os.path.join(self.source_folder, "md4qt"), dst=os.path.join(self.package_folder, "include", "md4qt")) + else: + copy(self, "*.h", src=os.path.join(self.source_folder, "md4qt"), dst=os.path.join(self.package_folder, "include", "md4qt")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "md4qt") diff --git a/recipes/md4qt/all/test_package/CMakeLists.txt b/recipes/md4qt/all/test_package/CMakeLists.txt index 3c95a973f47fa..307d0b38b2630 100644 --- a/recipes/md4qt/all/test_package/CMakeLists.txt +++ b/recipes/md4qt/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(md4qt REQUIRED CONFIG) @@ -6,3 +6,7 @@ find_package(md4qt REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE md4qt::md4qt) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +if(md4qt_VERSION_STRING VERSION_GREATER_EQUAL "4.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE MD4QT_VERSION_GREATER_EQUAL_4) +endif() diff --git a/recipes/md4qt/all/test_package/test_package.cpp b/recipes/md4qt/all/test_package/test_package.cpp index e1265d68ef6a6..93889643f5127 100644 --- a/recipes/md4qt/all/test_package/test_package.cpp +++ b/recipes/md4qt/all/test_package/test_package.cpp @@ -1,5 +1,9 @@ #define MD4QT_ICU_STL_SUPPORT +#ifdef MD4QT_VERSION_GREATER_EQUAL_4 +#include +#else #include +#endif #include #include diff --git a/recipes/md4qt/all/test_v1_package/CMakeLists.txt b/recipes/md4qt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/md4qt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -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 deleted file mode 100644 index e62a3cb2d7440..0000000000000 --- a/recipes/md4qt/all/test_v1_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 = os.path.join("bin", "test_package") - md_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.md") - self.run(f"{bin_path} \"{md_path}\"", run_environment=True) diff --git a/recipes/md4qt/config.yml b/recipes/md4qt/config.yml index 396ecace7699b..a5731c148346d 100644 --- a/recipes/md4qt/config.yml +++ b/recipes/md4qt/config.yml @@ -1,59 +1,11 @@ versions: - "2.3.4": + "4.1.0": folder: all - "2.3.3": + "3.0.0": folder: all - "2.3.2": + "2.8.2": folder: all - "2.3.1": + "2.7.4": 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": - folder: all - "2.0.6": - folder: all - "2.0.5": - folder: all - "2.0.4": - folder: all - "2.0.3": - folder: all - "2.0.2": - folder: all - "2.0.1": - folder: all - "2.0.0": + "2.6.0": folder: all diff --git a/recipes/mdns/all/test_v1_package/CMakeLists.txt b/recipes/mdns/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/mdns/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6dffe66394a26..0000000000000 --- a/recipes/mdns/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/mdnsresponder/all/test_package/CMakeLists.txt b/recipes/mdnsresponder/all/test_package/CMakeLists.txt index 5814f8fe93b5d..b2bff6902669a 100644 --- a/recipes/mdnsresponder/all/test_package/CMakeLists.txt +++ b/recipes/mdnsresponder/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(DNSSD REQUIRED CONFIG) diff --git a/recipes/mdnsresponder/all/test_v1_package/CMakeLists.txt b/recipes/mdnsresponder/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a4d5a242ce134..0000000000000 --- a/recipes/mdnsresponder/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mdnsresponder/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_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/mdspan/all/test_package/CMakeLists.txt b/recipes/mdspan/all/test_package/CMakeLists.txt index ec6ceb3022ff8..1617aff76934c 100644 --- a/recipes/mdspan/all/test_package/CMakeLists.txt +++ b/recipes/mdspan/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(mdspan REQUIRED CONFIG) diff --git a/recipes/mdspan/all/test_v1_package/CMakeLists.txt b/recipes/mdspan/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/mdspan/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mdspan/all/test_v1_package/conanfile.py b/recipes/mdspan/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/mdspan/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/melon/all/conandata.yml b/recipes/melon/all/conandata.yml new file mode 100644 index 0000000000000..9550cdb9601e7 --- /dev/null +++ b/recipes/melon/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0-alpha.1": + url: "https://github.com/fhamonic/melon/archive/refs/tags/v1.0.0-alpha.1.tar.gz" + sha256: "370f6bb1fddc68f1ab771c8b659fed6d9dc8da51290897ed72fd87589143220c" diff --git a/recipes/melon/all/conanfile.py b/recipes/melon/all/conanfile.py new file mode 100644 index 0000000000000..0d83d36ecc529 --- /dev/null +++ b/recipes/melon/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.52.0" + +class PackageConan(ConanFile): + name = "melon" + description = "A modern and efficient graph library using C++20 ranges and concepts." + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fhamonic/melon" + topics = ("graph", "algorithm", "ranges", "c++20", "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 { + "apple-clang": "14", + "clang": "17", + "gcc": "12", + "msvc": "192", + "Visual Studio": "17", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("range-v3/0.12.0") + self.requires("fmt/10.2.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) + 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, + "*.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.extend(["pthread"]) diff --git a/recipes/melon/all/test_package/CMakeLists.txt b/recipes/melon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..17e2b8206c6aa --- /dev/null +++ b/recipes/melon/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(melon REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE melon::melon) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/melon/all/test_package/conanfile.py b/recipes/melon/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/melon/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/melon/all/test_package/test_package.cpp b/recipes/melon/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f0417c2d7cc52 --- /dev/null +++ b/recipes/melon/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +#include "melon/algorithm/bidirectional_dijkstra.hpp" +#include "melon/utility/static_digraph_builder.hpp" +#include "melon/container/static_digraph.hpp" + +using namespace fhamonic::melon; + +// test_package with bidirectional dijkstra because it condenses range-v3 uses +// shown to overwhelm some compilers + +int main(int argc, char *argv[]) +{ + static_digraph_builder builder(6); + + builder.add_arc(0u, 1u, 7); // 0 + builder.add_arc(0u, 2u, 9); // 1 + builder.add_arc(0u, 5u, 14); // 2 + builder.add_arc(1u, 0u, 7); // 3 + builder.add_arc(1u, 2u, 10); // 4 + builder.add_arc(1u, 3u, 15); // 5 + builder.add_arc(2u, 0u, 9); // 6 + builder.add_arc(2u, 1u, 10); // 7 + builder.add_arc(2u, 3u, 12); // 8 + builder.add_arc(2u, 5u, 2); // 9 + builder.add_arc(3u, 1u, 15); // 10 + builder.add_arc(3u, 2u, 12); // 11 + builder.add_arc(3u, 4u, 6); // 12 + builder.add_arc(4u, 3u, 6); // 13 + builder.add_arc(4u, 5u, 9); // 14 + builder.add_arc(5u, 0u, 14); // 15 + builder.add_arc(5u, 2u, 2); // 16 + builder.add_arc(5u, 4u, 9); // 17 + + auto [graph, length_map] = builder.build(); + + bidirectional_dijkstra alg(graph, length_map, 0u, 3u); + + int dist = alg.run(); + if (dist != 21) return EXIT_FAILURE; + + if (!alg.path_found()) return EXIT_FAILURE; + auto path = alg.path(); + if (std::ranges::distance(path) != 2) return EXIT_FAILURE; + if (std::ranges::find(path, 1u) == path.end()) return EXIT_FAILURE; + if (std::ranges::find(path, 8u) == path.end()) return EXIT_FAILURE; + + return EXIT_SUCCESS; +} diff --git a/recipes/melon/config.yml b/recipes/melon/config.yml new file mode 100644 index 0000000000000..6aee52e82f90c --- /dev/null +++ b/recipes/melon/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0-alpha.1": + folder: all diff --git a/recipes/meshoptimizer/all/conandata.yml b/recipes/meshoptimizer/all/conandata.yml index 1132907df3841..0f3b46fe119ff 100644 --- a/recipes/meshoptimizer/all/conandata.yml +++ b/recipes/meshoptimizer/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "0.23": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.23.tar.gz" + sha256: "ac574107dd7e532ecfbea208fff9cd18fbcd1687f1d540ff8a798624ada453e0" + "0.22": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.22.tar.gz" + sha256: "e296cf0685b6421f84bd8a44d0a3cca82a219500f11c793dfbb6087ec86bb1a3" + "0.21": + url: "https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.21.tar.gz" + sha256: "050A5438E4644833FF69F35110FCF4E37038A89C5FDC8AED45D8CD848ECB3A20" + "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/all/test_package/CMakeLists.txt b/recipes/meshoptimizer/all/test_package/CMakeLists.txt index 034ae19a0ca08..ca75338e96082 100644 --- a/recipes/meshoptimizer/all/test_package/CMakeLists.txt +++ b/recipes/meshoptimizer/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(meshoptimizer REQUIRED CONFIG) diff --git a/recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt b/recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/meshoptimizer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/meshoptimizer/all/test_v1_package/conanfile.py b/recipes/meshoptimizer/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/meshoptimizer/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_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/meshoptimizer/config.yml b/recipes/meshoptimizer/config.yml index 301a8d09f5b3a..8072ed6ee6643 100644 --- a/recipes/meshoptimizer/config.yml +++ b/recipes/meshoptimizer/config.yml @@ -1,4 +1,12 @@ versions: + "0.23": + folder: all + "0.22": + folder: all + "0.21": + folder: all + "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 581541e8b30e4..9be8f4c6b01fa 100644 --- a/recipes/meson/all/conandata.yml +++ b/recipes/meson/all/conandata.yml @@ -1,4 +1,28 @@ sources: + "1.7.2": + url: "https://github.com/mesonbuild/meson/archive/1.7.2.tar.gz" + sha256: "3640ef596523393100df31ba790bc5fe732215e9711a66b673a21c4eb39bc8f1" + "1.6.0": + url: "https://github.com/mesonbuild/meson/archive/1.6.0.tar.gz" + sha256: "342300656bfdafb6cc09325bdd0fd507366ecaa6be25fa4525f50889adf7c606" + "1.5.1": + url: "https://github.com/mesonbuild/meson/archive/1.5.1.tar.gz" + sha256: "55f6acd5bf72c14d4aa5a781993633f84a1d117bdf2c2057735902ced9b81390" + "1.5.0": + url: "https://github.com/mesonbuild/meson/archive/1.5.0.tar.gz" + sha256: "781913826fb6f478eb7d77e1942ab3df39444e4c90e9a3523737e215171db469" + "1.4.1": + url: "https://github.com/mesonbuild/meson/archive/1.4.1.tar.gz" + sha256: "a7efc72ecb873c5a62031ade1921a7177b67cfdcb2e9410a7ab023f9e8192f4b" + "1.4.0": + url: "https://github.com/mesonbuild/meson/archive/1.4.0.tar.gz" + sha256: "61382f295378bddcd9bebb3a9a9065b1cbc671fa41b80964ab02726f9a5f3a88" + "1.3.2": + url: "https://github.com/mesonbuild/meson/archive/1.3.2.tar.gz" + sha256: "683082fb3c5cddf203b21d29bdf4c227e2f7964da5324a15e1a5f7db94322b4b" + "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" @@ -17,60 +41,23 @@ sources: "1.1.1": url: "https://github.com/mesonbuild/meson/releases/download/1.1.1/meson-1.1.1.tar.gz" sha256: "d04b541f97ca439fb82fab7d0d480988be4bd4e62563a5ca35fadb5400727b1c" + # qt requires 1.1.0 "1.1.0": url: "https://github.com/mesonbuild/meson/archive/1.1.0.tar.gz" sha256: "f29a3e14062043d75e82d16f1e41856e6b1ed7a7c016e10c7b13afa7ee6364cc" - "1.0.1": - url: "https://github.com/mesonbuild/meson/archive/1.0.1.tar.gz" - sha256: "4ab3a5c0060dc22bdefb04507efc6c38acb910e91bcd467a38e1fa211e5a6cfe" + # wayland-protocols requires 1.0.0 "1.0.0": url: "https://github.com/mesonbuild/meson/releases/download/1.0.0/meson-1.0.0.tar.gz" sha256: "aa50a4ba4557c25e7d48446abfde857957dcdf58385fffbe670ba0e8efacce05" - "0.64.1": - url: "https://github.com/mesonbuild/meson/archive/0.64.1.tar.gz" - sha256: "1d12a4bc1cf3ab18946d12cf0b6452e5254ada1ad50aacc97f87e2cccd7da315" - "0.64.0": - url: "https://github.com/mesonbuild/meson/archive/0.64.0.tar.gz" - sha256: "6477993d781b6efea93091616a6d6a0766c0e026076dbeb11249bf1c9b49a347" - "0.63.3": - url: "https://github.com/mesonbuild/meson/archive/0.63.3.tar.gz" - sha256: "7c516c2099b762203e8a0a22412aa465b7396e6f9b1ab728bad6e6db44dc2659" - "0.63.2": - url: "https://github.com/mesonbuild/meson/archive/0.63.2.tar.gz" - sha256: "023a3f7c74e68991154c3205a6975705861eedbf8130e013d15faa1df1af216e" - "0.63.1": - url: "https://github.com/mesonbuild/meson/archive/0.63.1.tar.gz" - sha256: "f355829f0e8c714423f03a06604c04c216d4cbe3586f3154cb2181076b19207a" - "0.63.0": - url: "https://github.com/mesonbuild/meson/archive/0.63.0.tar.gz" - sha256: "77808d47fa05875c2553d66cb6c6140c2f687b46256dc537eeb8a63889e0bea2" + # gtk requires 0.62.2 "0.62.2": url: "https://github.com/mesonbuild/meson/archive/0.62.2.tar.gz" sha256: "97108f4d9bb16bc758c44749bd25ec7d42c6a762961efbed8b7589a2a3551ea6" - "0.62.1": - url: "https://github.com/mesonbuild/meson/archive/0.62.1.tar.gz" - sha256: "9fb52e66dbc613479a5f70e46cc2e8faf5aa65e09313f2c71fa63b8afd018107" - "0.62.0": - url: "https://github.com/mesonbuild/meson/archive/0.62.0.tar.gz" - sha256: "72ac3bab701dfd597604de29cc74baaa1cc0ad8ca26ae23d5288de26abfe1c80" + # gst-plugins-base requires 0.61.2 "0.61.2": url: "https://github.com/mesonbuild/meson/archive/0.61.2.tar.gz" sha256: "33cd555314a94d52acfbb3f6f44d4e61c4ad0bfec7acf4301be7e40bb969b3a8" - "0.60.2": - url: "https://github.com/mesonbuild/meson/archive/0.60.2.tar.gz" - sha256: "fc7c2f315b5b63fee0414b0b94b5a7d0e9c71c8c9bb8487314eb5a9a33984b8d" + # gobject-introspection requires 0.59.3 "0.59.3": url: "https://github.com/mesonbuild/meson/archive/0.59.3.tar.gz" sha256: "b2c5bfd5032189a66cf6a32d98ba82d94d7d314577d8efe4d9dc159c4073f282" - "0.58.1": - url: "https://github.com/mesonbuild/meson/archive/0.58.1.tar.gz" - sha256: "78e0f553dd3bc632d5f96ab943b1bbccb599c2c84ff27c5fb7f7fff9c8a3f6b4" - "0.57.2": - url: "https://github.com/mesonbuild/meson/archive/0.57.2.tar.gz" - sha256: "cd3773625253df4fd1c380faf03ffae3d02198d6301e7c8bc7bba6c66af66096" - "0.56.2": - url: "https://github.com/mesonbuild/meson/archive/0.56.2.tar.gz" - sha256: "aaae961c3413033789248ffe6762589e80b6cf487c334d0b808e31a32c48f35f" - "0.55.3": - url: "https://github.com/mesonbuild/meson/archive/0.55.3.tar.gz" - sha256: "2b276df50c5b13ccdbfb14d3333141e9e7985aca31b60400b3f3e0be2ee6897e" diff --git a/recipes/meson/all/conanfile.py b/recipes/meson/all/conanfile.py index e2d65a1b60825..1f193b4c68fed 100644 --- a/recipes/meson/all/conanfile.py +++ b/recipes/meson/all/conanfile.py @@ -2,7 +2,7 @@ import textwrap from conan import ConanFile, conan_version -from conan.tools.files import copy, get, rmdir, save +from conan.tools.files import copy, get, rmdir, save, replace_in_file from conan.tools.layout import basic_layout from conan.tools.scm import Version @@ -11,12 +11,12 @@ class MesonConan(ConanFile): name = "meson" - package_type = "application" - description = "Meson is a project to create the best possible next-generation build system" - topics = ("meson", "mesonbuild", "build-system") + description = "a project to create the best possible next-generation build system" + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mesonbuild/meson" - license = "Apache-2.0" + topics = ("mesonbuild", "build-system") + package_type = "application" no_copy_source = True def layout(self): @@ -24,17 +24,15 @@ def layout(self): def requirements(self): if self.conf.get("tools.meson.mesontoolchain:backend", default="ninja", check_type=str) == "ninja": - self.requires("ninja/1.11.1") + # Meson requires >=1.8.2 as of 1.5 + # https://github.com/mesonbuild/meson/blob/b6b634ad33e5ca9ad4a9d6139dba4244847cc0e8/mesonbuild/backend/ninjabackend.py#L625 + self.requires("ninja/[>=1.10.2 <2]") 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) - - def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) @@ -44,14 +42,26 @@ def package(self): # create wrapper scripts save(self, os.path.join(self.package_folder, "bin", "meson.cmd"), textwrap.dedent("""\ @echo off + set PYTHONDONTWRITEBYTECODE=1 CALL python %~dp0/meson.py %* """)) save(self, os.path.join(self.package_folder, "bin", "meson"), textwrap.dedent("""\ #!/usr/bin/env bash meson_dir=$(dirname "$0") + export PYTHONDONTWRITEBYTECODE=1 exec "$meson_dir/meson.py" "$@" """)) + def finalize(self): + copy(self, "*", src=self.immutable_package_folder, dst=self.package_folder) + replace_in_file(self, os.path.join(self.package_folder, "bin", "meson.cmd"), + "set PYTHONDONTWRITEBYTECODE=1", + "") + + replace_in_file(self, os.path.join(self.package_folder, "bin", "meson"), + "export PYTHONDONTWRITEBYTECODE=1", + "") + @staticmethod def _chmod_plus_x(filename): if os.name == "posix": diff --git a/recipes/meson/all/test_v1_package/conanfile.py b/recipes/meson/all/test_v1_package/conanfile.py deleted file mode 100644 index c8624c6f85f40..0000000000000 --- a/recipes/meson/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +0,0 @@ -from conans import ConanFile, Meson, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - test_type = "explicit" - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - - def build(self): - if not tools.cross_building(self): - meson = Meson(self) - meson.configure(build_folder="build") - meson.build() - - def test(self): - self.run("meson --version") - if not tools.cross_building(self): - bin_path = os.path.join("build", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/meson/all/test_v1_package/meson.build b/recipes/meson/all/test_v1_package/meson.build deleted file mode 100644 index e67dd979af3c4..0000000000000 --- a/recipes/meson/all/test_v1_package/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('test_package', 'cpp') -executable('test_package', '../test_package/test_package.cpp') diff --git a/recipes/meson/config.yml b/recipes/meson/config.yml index 04538c604ee46..d4c4c2a388191 100644 --- a/recipes/meson/config.yml +++ b/recipes/meson/config.yml @@ -1,4 +1,20 @@ versions: + "1.7.2": + folder: all + "1.6.0": + folder: all + "1.5.1": + folder: all + "1.5.0": + folder: all + "1.4.1": + folder: all + "1.4.0": + folder: all + "1.3.2": + folder: all + "1.3.1": + folder: all "1.3.0": folder: all "1.2.3": @@ -13,39 +29,11 @@ versions: folder: all "1.1.0": folder: all - "1.0.1": - folder: all "1.0.0": folder: all - "0.64.1": - folder: all - "0.64.0": - folder: all - "0.63.3": - folder: all - "0.63.2": - folder: all - "0.63.1": - folder: all - "0.63.0": - folder: all "0.62.2": folder: all - "0.62.1": - folder: all - "0.62.0": - folder: all "0.61.2": folder: all - "0.60.2": - folder: all "0.59.3": folder: all - "0.58.1": - folder: all - "0.57.2": - folder: all - "0.56.2": - folder: all - "0.55.3": - folder: all diff --git a/recipes/metal-cpp/all/conandata.yml b/recipes/metal-cpp/all/conandata.yml new file mode 100644 index 0000000000000..45ddf13fce349 --- /dev/null +++ b/recipes/metal-cpp/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "15": + url: "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS15_iOS18.zip" + sha256: "0433df1e0ab13c2b0becbd78665071e3fa28381e9714a3fce28a497892b8a184" + "14.2": + url: "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS14.2_iOS17.2.zip" + sha256: "d800ddbc3fccabce3a513f975eeafd4057e07a29e905ad5aaef8c1f4e12d9ada" + "14": + url: "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS14_iOS17-beta.zip" + sha256: "2009a339ecbd56b36601435fe08c415749f8ad09145755472bb637b319003367" + "13.3": + url: "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS13.3_iOS16.4.zip" + sha256: "0afd87ca851465191ae4e3980aa036c7e9e02fe32e7c760ac1a74244aae6023b" + "13": + url: "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS13_iOS16.zip" + sha256: "6f741894229e9c750add1afc3797274fc008c7507e2ae726370c17c34b7c6a68" +minimum_os_version: + "15": + "Macos": "15" + "iOS": "18" + "tvOS": "18" + "14.2": + "Macos": "14.2" + "iOS": "17.2" + "tvOS": "17.2" + "14": + "Macos": "14" + "iOS": "17" + "tvOS": "17" + "13.3": + "Macos": "13.3" + "iOS": "16.4" + "tvOS": "16.4" + "13": + "Macos": "13" + "iOS": "16" + "tvOS": "16" diff --git a/recipes/metal-cpp/all/conanfile.py b/recipes/metal-cpp/all/conanfile.py new file mode 100644 index 0000000000000..2efbdaef9686f --- /dev/null +++ b/recipes/metal-cpp/all/conanfile.py @@ -0,0 +1,92 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import XCRun +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 +import platform + +required_conan_version = ">=1.53.0" + + +class MetalcppConan(ConanFile): + name = "metal-cpp" + description = ( + "Library for the usage of Apple Metal GPU programming in C++ applications - " + "Header-only library to wrap Metal in C++ classes" + ) + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://developer.apple.com/metal/cpp/" + topics = ("metal", "gpu", "apple", "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 validate(self): + os_name = str(self.settings.os) + if not os_name in ["Macos", "iOS", "tvOS"]: + raise ConanInvalidConfiguration("Metal can only be used on an Macos, iOS or tvOS platform.") + + if self.settings.compiler.get_safe("cppstd"): + min_cppstd = "17" + check_min_cppstd(self, min_cppstd) + + minimum_os_version = self.conan_data["minimum_os_version"][self.version][os_name] + + xcrun = XCRun(self) + os_version = self.settings.get_safe("os.version") + sdk_version = self.settings.get_safe("os.sdk_version") + visible_sdk_version = xcrun.sdk_version if platform.system() == "Darwin" else None + + sdk_version = sdk_version or os_version or visible_sdk_version + + if sdk_version is None: + # Will raise when `os.version` or `os.sdk_version` are not defined + # and we are *NOT* running this on macOS + raise ConanInvalidConfiguration(f"metal-cpp {self.version} requires the os.version or sdk.version settings, but the are not defined") + + if sdk_version < Version(minimum_os_version): + raise ConanInvalidConfiguration(f"metal-cpp {self.version} requires {os_name} SDK version {minimum_os_version} but {sdk_version} is the target.") + + def package(self): + copy( + self, + pattern="LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder) + ) + copy( + self, + pattern="**.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder), + keep_path=True + ) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "metal-cpp") + self.cpp_info.set_property("cmake_target_name", "metal-cpp::metal-cpp") + self.cpp_info.set_property("pkg_config_name", "metal-cpp") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + self.cpp_info.frameworks = ["Foundation", "Metal", "MetalKit", "QuartzCore"] + if self.version >= Version('14'): + self.cpp_info.frameworks.append("MetalFX") diff --git a/recipes/metal-cpp/all/test_package/CMakeLists.txt b/recipes/metal-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6a19106db0eb9 --- /dev/null +++ b/recipes/metal-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(metal-cpp REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE metal-cpp::metal-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/metal-cpp/all/test_package/conanfile.py b/recipes/metal-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e28de31d33b1c --- /dev/null +++ b/recipes/metal-cpp/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def validate(self): + if not is_apple_os(self): + raise ConanInvalidConfiguration("Metal can only be used on an Apple OS.") + + 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/metal-cpp/all/test_package/test_package.cpp b/recipes/metal-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bb32b01f0db92 --- /dev/null +++ b/recipes/metal-cpp/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include + +#define NS_PRIVATE_IMPLEMENTATION +#define MTL_PRIVATE_IMPLEMENTATION + +#include +#include + + +int main() +{ + // Create a metal device to check the library functions + MTL::Device* metalDevice = MTL::CreateSystemDefaultDevice(); + + std::cout << "Metal device detected: " << metalDevice->name()->cString(NS::ASCIIStringEncoding) << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/metal-cpp/config.yml b/recipes/metal-cpp/config.yml new file mode 100644 index 0000000000000..e0067f6f5cf55 --- /dev/null +++ b/recipes/metal-cpp/config.yml @@ -0,0 +1,11 @@ +versions: + "15": + folder: all + "14.2": + folder: all + "14": + folder: all + "13.3": + folder: all + "13": + folder: all diff --git a/recipes/metall/all/conandata.yml b/recipes/metall/all/conandata.yml index 023411b883cb5..72fbcaef70e39 100644 --- a/recipes/metall/all/conandata.yml +++ b/recipes/metall/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.28": + url: "https://github.com/LLNL/metall/archive/refs/tags/v0.28.tar.gz" + sha256: "770dedb7f8220c333688b232a22104ca9d8d5823e7a8a21152b58ef970eb85d0" "0.27": url: "https://github.com/LLNL/metall/archive/refs/tags/v0.27.tar.gz" sha256: "6e6f17a760778f9162def939701f9381a75e5275fd1eb1b2af4b2e89e86e1c58" diff --git a/recipes/metall/all/conanfile.py b/recipes/metall/all/conanfile.py index b13166986c15d..6017c84ad4f89 100644 --- a/recipes/metall/all/conanfile.py +++ b/recipes/metall/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.layout import basic_layout from conan.tools.scm import Version import os +import platform required_conan_version = ">=1.50.0" @@ -36,13 +37,18 @@ def requirements(self): def package_id(self): self.info.clear() + @property + def _is_glibc_older_than_2_27(self): + libver = platform.libc_ver() + return self.settings.os == 'Linux' and libver[0] == 'glibc' and Version(libver[1]) < "2.27" + def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 17) if self.settings.os not in ["Linux", "Macos"]: raise ConanInvalidConfiguration( - "Metall requires some POSIX functionalities like mmap.") + f"{self.ref} requires some POSIX functionalities like mmap.") def lazy_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] @@ -56,6 +62,11 @@ def lazy_lt_semver(v1, v2): raise ConanInvalidConfiguration( "{} {} requires C++17, which your compiler does not support.".format(self.name, self.version)) + def validate_build(self): + if Version(self.version) >= "0.28" and self._is_glibc_older_than_2_27: + raise ConanInvalidConfiguration( + f"{self.ref} requires copy_file_range() which is available since glibc 2.27.") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/metall/config.yml b/recipes/metall/config.yml index 1d869b27d6481..1984e8dcd4850 100644 --- a/recipes/metall/config.yml +++ b/recipes/metall/config.yml @@ -1,4 +1,6 @@ versions: + "0.28": + folder: all "0.27": folder: all "0.26": diff --git a/recipes/metis/all/conanfile.py b/recipes/metis/all/conanfile.py index 7782c2735e124..d935fb4c025d2 100644 --- a/recipes/metis/all/conanfile.py +++ b/recipes/metis/all/conanfile.py @@ -34,7 +34,7 @@ class METISConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "with_64bit_types": True, + "with_64bit_types": False, "enable_gkrand": False, "enable_gkregex": False, "with_openmp": False, @@ -45,12 +45,7 @@ class METISConan(ConanFile): def export_sources(self): 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"), - ) + copy(self, "gkbuild.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -76,11 +71,11 @@ def source(self): 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 + tc.variables["VALGRIND"] = self.options.with_valgrind + tc.variables["OPENMP"] = self.options.with_openmp + tc.variables["PCRE"] = self.options.with_pcre + tc.variables["GKREGEX"] = self.settings.os == "Windows" or self.options.enable_gkregex + tc.variables["GKRAND"] = self.options.enable_gkrand if self.settings.build_type == "Debug": tc.preprocessor_definitions["DEBUG"] = "" else: @@ -104,12 +99,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() rm(self, "*.cmake", self.package_folder, recursive=True) diff --git a/recipes/mfast/all/conanfile.py b/recipes/mfast/all/conanfile.py index dbdf62474df2d..90a8bcb977732 100644 --- a/recipes/mfast/all/conanfile.py +++ b/recipes/mfast/all/conanfile.py @@ -10,7 +10,7 @@ import os import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class mFASTConan(ConanFile): @@ -74,7 +74,7 @@ def requirements(self): self.requires("boost/1.75.0", transitive_headers=True) self.requires("tinyxml2/9.0.0") if self.options.with_sqlite3: - self.requires("sqlite3/3.43.1") + self.requires("sqlite3/[>=3.43 <4]") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -103,8 +103,10 @@ def generate(self): tc.variables["BUILD_SQLITE3"] = self.options.with_sqlite3 if not valid_min_cppstd(self, self._min_cppstd): tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd - # Relocatable shared libs on macOS - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) <= "1.2.2": # pylint: disable=conan-condition-evals-to-constant + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) deps.generate() @@ -272,22 +274,9 @@ def package_info(self): if self.options.shared: self.cpp_info.components[conan_comp].defines = ["MFAST_DYN_LINK"] - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.components[conan_comp].names["cmake_find_package"] = target - self.cpp_info.components[conan_comp].names["cmake_find_package_multi"] = target - self.cpp_info.components[conan_comp].build_modules["cmake"] = [self._fast_type_gen_target_file] - build_modules = [self._lib_targets_module_file, self._fast_type_gen_target_file] - self.cpp_info.components[conan_comp].build_modules["cmake_find_package"] = build_modules - self.cpp_info.components[conan_comp].build_modules["cmake_find_package_multi"] = build_modules if comp != target: conan_comp_alias = conan_comp + "_alias" - self.cpp_info.components[conan_comp_alias].names["cmake_find_package"] = comp - self.cpp_info.components[conan_comp_alias].names["cmake_find_package_multi"] = comp self.cpp_info.components[conan_comp_alias].requires = [conan_comp] self.cpp_info.components[conan_comp_alias].includedirs = [] self.cpp_info.components[conan_comp_alias].libdirs = [] self.cpp_info.components[conan_comp_alias].bindirs = [] - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "mFAST" - self.cpp_info.names["cmake_find_package_multi"] = "mFAST" diff --git a/recipes/mfast/all/patches/0001-fix-cmake-1.2.2.patch b/recipes/mfast/all/patches/0001-fix-cmake-1.2.2.patch index 5a64dc0bef36a..87ae33fba1590 100644 --- a/recipes/mfast/all/patches/0001-fix-cmake-1.2.2.patch +++ b/recipes/mfast/all/patches/0001-fix-cmake-1.2.2.patch @@ -1,5 +1,14 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt +@@ -16,7 +16,7 @@ if(NOT CMAKE_BUILD_TYPE) + endif(NOT CMAKE_BUILD_TYPE) + + if(POLICY CMP0054) +- cmake_policy(SET CMP0054 OLD) ++ # cmake_policy(SET CMP0054 OLD) + endif() + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") @@ -60,9 +60,11 @@ if(BUILD_PACKAGES) endif(BUILD_PACKAGES) diff --git a/recipes/mfast/all/test_package/CMakeLists.txt b/recipes/mfast/all/test_package/CMakeLists.txt index f00b094711581..9e0fbae355ed0 100644 --- a/recipes/mfast/all/test_package/CMakeLists.txt +++ b/recipes/mfast/all/test_package/CMakeLists.txt @@ -1,13 +1,20 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(mFAST REQUIRED mfast_xml_parser CONFIG) -FASTTYPEGEN_TARGET(Test Test.xml) -add_executable(${PROJECT_NAME} ${FASTTYPEGEN_Test_OUTPUTS} message_printer.cpp) +if(NOT TARGET fast_type_gen) + message(FATAL_ERROR "fast_type_gen target should have been defined as part of find_package(mFAST)") +endif() + +if(NOT COMMAND FASTTYPEGEN_TARGET) + message(FATAL_ERROR "FASTTYPEGEN_TARGET should have been defined as part of find_package(mFAST)") +endif() + +add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -if(TARGET mfast_xml_parser_static) - target_link_libraries(${PROJECT_NAME} PRIVATE mfast_xml_parser_static) +if(TARGET mfast_static) + target_link_libraries(${PROJECT_NAME} PRIVATE mfast_coder_static mfast_static) else() - target_link_libraries(${PROJECT_NAME} PRIVATE mfast_xml_parser) + target_link_libraries(${PROJECT_NAME} PRIVATE mfast_coder mfast) endif() diff --git a/recipes/mfast/all/test_package/Test.xml b/recipes/mfast/all/test_package/Test.xml deleted file mode 100644 index dcf8661cc502f..0000000000000 --- a/recipes/mfast/all/test_package/Test.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/recipes/mfast/all/test_package/conanfile.py b/recipes/mfast/all/test_package/conanfile.py index 6f661e72969a0..18a10dbd28990 100644 --- a/recipes/mfast/all/test_package/conanfile.py +++ b/recipes/mfast/all/test_package/conanfile.py @@ -7,7 +7,6 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv" - test_type = "explicit" def layout(self): cmake_layout(self) @@ -15,9 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - def build_requirements(self): - self.tool_requires(self.tested_reference_str) - def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/mfast/all/test_package/message_printer.cpp b/recipes/mfast/all/test_package/message_printer.cpp deleted file mode 100644 index 46af941f34006..0000000000000 --- a/recipes/mfast/all/test_package/message_printer.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include "Test.h" - -int main() -{ - Test::Test message; - Test::Test_mref ref = message.ref(); - std:: cout << ref.get_String().c_str() << "\n"; -} diff --git a/recipes/mfast/all/test_package/test_package.cpp b/recipes/mfast/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0476e78bd0765 --- /dev/null +++ b/recipes/mfast/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include +#include +#include + +#include +#include + +int main() { + mfast::fast_decoder decoder; + const std::string encoded = "FOOBAR"; + + const char* start = encoded.c_str(); + const char* end = start + encoded.length(); + + try { + mfast::message_cref msg = decoder.decode(start, end); + } + catch (boost::exception& e) { + std::cerr << boost::diagnostic_information(e); + } + + std::cout << "Test package successful\n"; + + return 0; +} diff --git a/recipes/mfast/all/test_v1_package/CMakeLists.txt b/recipes/mfast/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/mfast/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mfast/all/test_v1_package/conanfile.py b/recipes/mfast/all/test_v1_package/conanfile.py deleted file mode 100644 index e08462ea1a998..0000000000000 --- a/recipes/mfast/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,26 +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" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(self.tested_reference_str) - - def build(self): - with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(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/mgclient/all/conandata.yml b/recipes/mgclient/all/conandata.yml new file mode 100644 index 0000000000000..d3dddbce027d5 --- /dev/null +++ b/recipes/mgclient/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.4.3": + url: "https://github.com/memgraph/mgclient/archive/refs/tags/v1.4.3.tar.gz" + sha256: "f446b469532cd5154b8fb986ac57ca9880763e34c77e564d2c4c948989b0244e" + "1.4.2": + url: "https://github.com/memgraph/mgclient/archive/refs/tags/v1.4.2.tar.gz" + sha256: "aa89422636b1e25b8f9f34453f331e15d32a5957a9b2381c3598fc3644dbc043" +patches: + "1.4.3": + - patch_file: "patches/1.4.2-0001-static-shared.build.patch" + patch_description: "make static and shared build separated" + patch_type: "conan" + "1.4.2": + - patch_file: "patches/1.4.2-0001-static-shared.build.patch" + patch_description: "make static and shared build separated" + patch_type: "conan" diff --git a/recipes/mgclient/all/conanfile.py b/recipes/mgclient/all/conanfile.py new file mode 100644 index 0000000000000..958881a323221 --- /dev/null +++ b/recipes/mgclient/all/conanfile.py @@ -0,0 +1,100 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +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 +import os + + +required_conan_version = ">=1.53.0" + +class MGClientConan(ConanFile): + name = "mgclient" + description = "C/C++ Memgraph Client" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/memgraph/mgclient" + topics = ("memgraph", "client") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_cpp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_cpp": True, + } + + @property + def _min_cppstd(self): + return 17 + + @property + 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): + 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 requirements(self): + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + if self.options.with_cpp: + 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["BUILD_CPP_BINDINGS"] = self.options.with_cpp + 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 = ["mgclient"] + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/mgclient/all/patches/1.4.2-0001-static-shared.build.patch b/recipes/mgclient/all/patches/1.4.2-0001-static-shared.build.patch new file mode 100644 index 0000000000000..efba4fc8b2bb4 --- /dev/null +++ b/recipes/mgclient/all/patches/1.4.2-0001-static-shared.build.patch @@ -0,0 +1,43 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e905e85..85a6b0a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -50,6 +50,7 @@ else() + find_package(OpenSSL REQUIRED) + include(GenerateExportHeader) + ++ if(NOT BUILD_SHARED_LIBS) + add_library(mgclient-static STATIC ${mgclient_src_files}) + + generate_export_header(mgclient-static +@@ -74,6 +75,7 @@ else() + target_link_libraries(mgclient-static PUBLIC ws2_32) + endif() + ++ else() + add_library(mgclient-shared SHARED ${mgclient_src_files}) + + generate_export_header(mgclient-shared +@@ -102,13 +104,21 @@ else() + generate_export_header(mgclient-shared + BASE_NAME "mgclient" + EXPORT_FILE_NAME "mgclient-export.h") ++ endif() + + include(GNUInstallDirs) + +- install(TARGETS mgclient-static mgclient-shared ++ if(NOT BUILD_SHARED_LIBS) ++ install(TARGETS mgclient-static + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ else() ++ install(TARGETS mgclient-shared ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ endif() + install(DIRECTORY + "${PROJECT_SOURCE_DIR}/include/" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/mgclient/all/test_package/CMakeLists.txt b/recipes/mgclient/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cbe32d3f6014a --- /dev/null +++ b/recipes/mgclient/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(mgclient REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mgclient::mgclient) diff --git a/recipes/mgclient/all/test_package/conanfile.py b/recipes/mgclient/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/mgclient/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/mgclient/all/test_package/test_package.c b/recipes/mgclient/all/test_package/test_package.c new file mode 100644 index 0000000000000..078593ee4c3ab --- /dev/null +++ b/recipes/mgclient/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#include +#include + +#include "mgclient.h" + +int main(int argc, char *argv[]) { + mg_init(); + printf("mgclient version: %s\n", mg_client_version()); + + mg_session_params *params = mg_session_params_make(); + if (!params) { + fprintf(stderr, "failed to allocate session parameters\n"); + exit(1); + } + mg_session_params_set_host(params, "localhsot"); + mg_session_params_set_port(params, 8888); + mg_session_params_set_sslmode(params, MG_SSLMODE_DISABLE); + + mg_finalize(); + + return 0; +} diff --git a/recipes/mgclient/config.yml b/recipes/mgclient/config.yml new file mode 100644 index 0000000000000..af4203f05155e --- /dev/null +++ b/recipes/mgclient/config.yml @@ -0,0 +1,5 @@ +versions: + "1.4.3": + folder: all + "1.4.2": + folder: all diff --git a/recipes/mgs/all/test_package/CMakeLists.txt b/recipes/mgs/all/test_package/CMakeLists.txt index 2f8ba640718db..0a75018513f80 100644 --- a/recipes/mgs/all/test_package/CMakeLists.txt +++ b/recipes/mgs/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(mgs REQUIRED base64 CONFIG) diff --git a/recipes/mgs/all/test_v1_package/CMakeLists.txt b/recipes/mgs/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/mgs/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mgs/all/test_v1_package/conanfile.py b/recipes/mgs/all/test_v1_package/conanfile.py deleted file mode 100644 index 0f735b51a2642..0000000000000 --- a/recipes/mgs/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -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 tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/microprofile/all/CMakeLists.txt b/recipes/microprofile/all/CMakeLists.txt index c54dc9657fda8..c90a18dd03c87 100644 --- a/recipes/microprofile/all/CMakeLists.txt +++ b/recipes/microprofile/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(microprofile) option(MICROPROFILE_USE_CONFIG_FILE "Use user provided configuration in microprofile.config.h file." ON) diff --git a/recipes/microprofile/all/conandata.yml b/recipes/microprofile/all/conandata.yml index 144d6e5120836..8c86f1a660d74 100644 --- a/recipes/microprofile/all/conandata.yml +++ b/recipes/microprofile/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "3.1": - - url: "https://github.com/jonasmr/microprofile/archive/refs/tags/v3.1.tar.gz" - sha256: "300e1d0d21e4c13ad1de72c5309ba02fbdb3bcbbe26e5ad9ff8b798380781527" + "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" + "3.1": + - patch_file: "patches/sources_fix.patch" diff --git a/recipes/microprofile/all/conanfile.py b/recipes/microprofile/all/conanfile.py index 3779e90691c29..b3d0644be3113 100644 --- a/recipes/microprofile/all/conanfile.py +++ b/recipes/microprofile/all/conanfile.py @@ -5,7 +5,10 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, collect_libs, copy, download, export_conandata_patches, get, save, load +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" @@ -91,7 +94,13 @@ def requirements(self): if self.options.enable_timer == "gl": self.requires("opengl/system") if self.options.enable_timer == "vulkan": - self.requires("vulkan-loader/1.3.243.0") + 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 = [ @@ -134,15 +143,23 @@ def validate(self): raise ConanInvalidConfiguration("microprofile:webserver_port must be between 0 and 65535.") def source(self): - get(self, **self.conan_data["sources"][self.version][0], strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + VirtualBuildEnv(self).generate() + 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() - tc = CMakeDeps(self) - tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + deps = PkgConfigDeps(self) + deps.generate() def build(self): self._create_defines_file(os.path.join(self.source_folder, "microprofile.config.h")) @@ -203,6 +220,8 @@ def _create_defines_file(self, filename): def package_info(self): 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 in ["Linux", "FreeBSD"]: 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 deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/microprofile/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 30f8c8cfb0975..0000000000000 --- a/recipes/microprofile/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/test_package/CMakeLists.txt b/recipes/microservice-essentials/all/test_package/CMakeLists.txt index f5945294e9935..42971e9553c75 100644 --- a/recipes/microservice-essentials/all/test_package/CMakeLists.txt +++ b/recipes/microservice-essentials/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) set(CMAKE_CXX_STANDARD 17) diff --git a/recipes/microtar/all/CMakeLists.txt b/recipes/microtar/all/CMakeLists.txt index ab2ce85f21a44..2b3adfeb649e4 100644 --- a/recipes/microtar/all/CMakeLists.txt +++ b/recipes/microtar/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(microtar LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/microtar/all/test_package/CMakeLists.txt b/recipes/microtar/all/test_package/CMakeLists.txt index b1c35c594fadb..ef6628a07f2d0 100644 --- a/recipes/microtar/all/test_package/CMakeLists.txt +++ b/recipes/microtar/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(microtar REQUIRED CONFIG) diff --git a/recipes/microtar/all/test_v1_package/CMakeLists.txt b/recipes/microtar/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/microtar/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/microtar/all/test_v1_package/conanfile.py b/recipes/microtar/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/microtar/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_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/mikelankamp-fpm/all/test_package/CMakeLists.txt b/recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt index 4b78d3f578ec0..4d6b2efdfeb5c 100644 --- a/recipes/mikelankamp-fpm/all/test_package/CMakeLists.txt +++ b/recipes/mikelankamp-fpm/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(fpm REQUIRED CONFIG) diff --git a/recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt b/recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/mikelankamp-fpm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mikelankamp-fpm/all/test_v1_package/conanfile.py b/recipes/mikelankamp-fpm/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/mikelankamp-fpm/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/mikktspace/all/CMakeLists.txt b/recipes/mikktspace/all/CMakeLists.txt index d8848832b7e30..4d45d6e4fb4dd 100644 --- a/recipes/mikktspace/all/CMakeLists.txt +++ b/recipes/mikktspace/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(mikktspace LANGUAGES C) add_library(mikktspace ${MIKKTSPACE_SRC_DIR}/mikktspace.c) diff --git a/recipes/mikktspace/all/test_package/CMakeLists.txt b/recipes/mikktspace/all/test_package/CMakeLists.txt index e098a7e87ec40..b2dcac496a671 100644 --- a/recipes/mikktspace/all/test_package/CMakeLists.txt +++ b/recipes/mikktspace/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(mikktspace REQUIRED CONFIG) diff --git a/recipes/mikktspace/all/test_v1_package/CMakeLists.txt b/recipes/mikktspace/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/mikktspace/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mikktspace/all/test_v1_package/conanfile.py b/recipes/mikktspace/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mikktspace/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_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/mimalloc/all/conandata.yml b/recipes/mimalloc/all/conandata.yml index 4c93c0b6b2850..edcce54e6fe29 100644 --- a/recipes/mimalloc/all/conandata.yml +++ b/recipes/mimalloc/all/conandata.yml @@ -1,44 +1,37 @@ sources: + "2.1.9": + url: "https://github.com/microsoft/mimalloc/archive/v2.1.9.tar.gz" + sha256: "dd8ff701691f19bf4e225d42ef0d3d5e6ca0e03498ee4f044a0402e4697e4a20" + "2.1.7": + url: "https://github.com/microsoft/mimalloc/archive/v2.1.7.tar.gz" + sha256: "0eed39319f139afde8515010ff59baf24de9e47ea316a315398e8027d198202d" "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" - "2.0.7": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.7.tar.gz" - sha256: "f23aac6c73594e417af50cb38f1efed88ef1dc14a490f0eff07c7f7b079810a4" - "2.0.6": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.6.tar.gz" - sha256: "9f05c94cc2b017ed13698834ac2a3567b6339a8bde27640df5a1581d49d05ce5" - "2.0.5": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.5.tar.gz" - sha256: "fb000a017c289ddc0df749f16fef854e033e496276d8426bdd066b59c476f6cf" - "2.0.3": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.3.tar.gz" - sha256: "5af497f360879bf9d07a5146961d275a25f4177fbe21ee6c437db604422acd60" - "2.0.2": - url: "https://github.com/microsoft/mimalloc/archive/v2.0.2.tar.gz" - sha256: "c81a5f443f72373e3105172d6a935e29b0dabd13ba387c080bc444586cbe3021" + "1.8.7": + url: "https://github.com/microsoft/mimalloc/archive/v1.8.7.tar.gz" + sha256: "347793a2c614e525edc4e286ab5cbc4c7a5efc12503e2dafca276d78394c4f07" "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" - "1.7.7": - url: "https://github.com/microsoft/mimalloc/archive/v1.7.7.tar.gz" - sha256: "0f6663be1e1764851bf9563fcf7a6b3330e23b933eb4737dd07e3289b87895fe" "1.7.6": url: "https://github.com/microsoft/mimalloc/archive/v1.7.6.tar.gz" sha256: "d74f86ada2329016068bc5a243268f1f555edd620b6a7d6ce89295e7d6cf18da" - "1.7.5": - url: "https://github.com/microsoft/mimalloc/archive/v1.7.5.tar.gz" - sha256: "4f9ed087fc1804a8a77c4225ffc3337468f18d6c4f060c4d44f3a3eff85bc5b6" - "1.6.7": - url: "https://github.com/microsoft/mimalloc/archive/v1.6.7.tar.gz" - sha256: "111b718b496f297f128d842880e72e90e33953cf00b45ba0ccd2167e7340ed17" patches: + "2.1.9": + - patch_file: "patches/2.1.9-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" + "2.1.7": + - patch_file: "patches/2.1.7-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" + patch_type: "portability" "2.1.2": - patch_file: "patches/2.1.2-0001-change-install-paths.patch" patch_description: "fix install paths" @@ -53,28 +46,9 @@ patches: - patch_file: "patches/2.0.9-0002-support-older-compiler.patch" patch_description: "fix compilation errors on older compilers" patch_type: "portability" - "2.0.7": - - patch_file: "patches/2.0.7-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" - "2.0.6": - - patch_file: "patches/2.0.6-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" - "2.0.5": - - patch_file: "patches/2.0.6-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" - "2.0.3": - - patch_file: "patches/2.0.3-0001-change-install-paths-avoid-symlink.patch" - patch_description: "fix install paths, disable creating symlink" - patch_type: "conan" - "2.0.2": - - patch_file: "patches/2.0.2-0001-change-install-paths-avoid-symlink.patch" - patch_description: "fix install paths, disable creating symlink" - patch_type: "conan" - - patch_file: "patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch" - patch_description: "include stddef" + "1.8.7": + - patch_file: "patches/1.8.7-0002-support-older-compiler.patch" + patch_description: "fix compilation errors on older compilers" patch_type: "portability" "1.8.2": - patch_file: "patches/1.8.2-0001-change-install-paths.patch" @@ -90,22 +64,7 @@ patches: - patch_file: "patches/1.7.9-0002-support-older-compiler.patch" patch_description: "fix compilation errors on older compilers" patch_type: "portability" - "1.7.7": - - patch_file: "patches/1.7.7-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" "1.7.6": - patch_file: "patches/1.7.5-0001-change-install-paths.patch" patch_description: "fix install paths" patch_type: "conan" - "1.7.5": - - patch_file: "patches/1.7.5-0001-change-install-paths.patch" - patch_description: "fix install paths" - patch_type: "conan" - "1.6.7": - - patch_file: "patches/1.6.7-0001-change-install-paths-avoid-symlink.patch" - patch_description: "fix install paths, disable creating symlink" - patch_type: "conan" - - patch_file: "patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch" - patch_description: "include stddef" - patch_type: "portability" diff --git a/recipes/mimalloc/all/conanfile.py b/recipes/mimalloc/all/conanfile.py index eaa8e6193ea4e..ce5dc43337169 100644 --- a/recipes/mimalloc/all/conanfile.py +++ b/recipes/mimalloc/all/conanfile.py @@ -1,22 +1,22 @@ 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, get, copy, rm, rmdir, replace_in_file, save, collect_libs +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file, collect_libs from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, VCVars +from conan.tools.env import VirtualBuildEnv from conan.tools.scm import Version import os import shutil -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2" class MimallocConan(ConanFile): name = "mimalloc" + description = "mimalloc is a compact general purpose allocator with excellent performance." license = "MIT" url = "https://github.com/conan-io/conan-center-index" 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" @@ -27,6 +27,8 @@ class MimallocConan(ConanFile): "override": [True, False], "inject": [True, False], "single_object": [True, False], + "guarded": [True, False], + "win_redirect": [True, False], } default_options = { "shared": False, @@ -35,6 +37,8 @@ class MimallocConan(ConanFile): "override": False, "inject": False, "single_object": False, + "guarded": False, + "win_redirect": False, } def export_sources(self): @@ -43,12 +47,16 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + else: + del self.options.win_redirect # single_object and inject are options # only when overriding on Unix-like platforms: if is_msvc(self): del self.options.single_object del self.options.inject + if Version(self.version) < "2.1.9": + del self.options.guarded def configure(self): if self.options.shared: @@ -68,13 +76,14 @@ def configure(self): self.options.rm_safe("single_object") self.options.rm_safe("inject") + def layout(self): cmake_layout(self, src_folder="src") def validate(self): # Currently, mimalloc some version do not work properly with shared MD builds. # https://github.com/conan-io/conan-center-index/pull/10333#issuecomment-1114110046 - if self.version in ["1.7.6", "1.7.7", "2.0.6", "2.0.7"] and \ + if Version(self.version) == "1.7.6" and \ self.options.shared and \ is_msvc(self) and \ not is_msvc_static_runtime(self): @@ -89,11 +98,22 @@ def validate(self): raise ConanInvalidConfiguration( "Dynamic runtime (MD/MDd) is required when using mimalloc as a shared library for override") + if self.options.get_safe("win_redirect") and not ( + self.options.override and \ + self.options.shared and \ + is_msvc(self) and \ + not is_msvc_static_runtime(self)): + raise ConanInvalidConfiguration( + "Windows redirect requires 'override', 'shared' and building against a dynamic runtime (MD/MDd)") + if self.options.override and \ self.options.get_safe("single_object") and \ self.options.get_safe("inject"): raise ConanInvalidConfiguration("Single object is incompatible with library injection") + def build_requirements(self): + self.tool_requires("cmake/[>=3.18 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -105,9 +125,14 @@ def generate(self): tc.variables["MI_BUILD_OBJECT"] = self.options.get_safe("single_object", False) tc.variables["MI_OVERRIDE"] = "ON" if self.options.override else "OFF" tc.variables["MI_SECURE"] = "ON" if self.options.secure else "OFF" - if Version(self.version) >= "1.7.0": - tc.variables["MI_INSTALL_TOPLEVEL"] = "ON" + tc.variables["MI_WIN_REDIRECT"] = "ON" if self.options.get_safe("win_redirect") else "OFF" + tc.variables["MI_INSTALL_TOPLEVEL"] = "ON" + tc.variables["MI_GUARDED"] = self.options.get_safe("guarded", False) + if Version(self.version) <= "1.7.6": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") if is_msvc(self): vcvars = VCVars(self) @@ -134,8 +159,6 @@ def package(self): if self.options.get_safe("single_object"): rm(self, "*.a", os.path.join(self.package_folder, "lib")) - shutil.move(os.path.join(self.package_folder, self._obj_name + ".o"), - os.path.join(self.package_folder, "lib")) shutil.copy(os.path.join(self.package_folder, "lib", self._obj_name + ".o"), os.path.join(self.package_folder, "lib", self._obj_name)) @@ -151,27 +174,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) - cmake_target = "mimalloc" if self.options.shared else "mimalloc-static" - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {cmake_target: "mimalloc::mimalloc"} - ) - - 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") - @property def _obj_name(self): name = "mimalloc" @@ -197,11 +199,6 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "mimalloc") self.cpp_info.set_property("cmake_target_name", "mimalloc" if self.options.shared else "mimalloc-static") - self.cpp_info.names["cmake_find_package"] = "mimalloc" - self.cpp_info.names["cmake_find_package_multi"] = "mimalloc" - 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.options.get_safe("inject"): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/mimalloc/all/patches/1.6.7-0001-change-install-paths-avoid-symlink.patch b/recipes/mimalloc/all/patches/1.6.7-0001-change-install-paths-avoid-symlink.patch deleted file mode 100644 index 6fa2c822d32ef..0000000000000 --- a/recipes/mimalloc/all/patches/1.6.7-0001-change-install-paths-avoid-symlink.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 35460e8..e5340d5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -206,7 +206,7 @@ endif() - # Install and output names - # ----------------------------------------------------------------------------- - --set(mi_install_dir "${CMAKE_INSTALL_PREFIX}/lib/mimalloc-${mi_version}") -+set(mi_install_dir ".") - if(MI_SECURE MATCHES "ON") - set(mi_basename "mimalloc-secure") - else() -@@ -263,7 +263,7 @@ if(MI_BUILD_SHARED) - COMMENT "Copy mimalloc-redirect.dll to output directory") - endif() - -- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_dir} LIBRARY) -+ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT mimalloc DESTINATION ${mi_install_dir}/cmake) - endif() - -@@ -287,7 +287,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_dir}) -+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - endif() - - # install include files -@@ -297,7 +297,7 @@ install(FILES include/mimalloc-new-delete.h DESTINATION ${mi_install_dir}/includ - install(FILES cmake/mimalloc-config.cmake DESTINATION ${mi_install_dir}/cmake) - install(FILES cmake/mimalloc-config-version.cmake DESTINATION ${mi_install_dir}/cmake) - --if(NOT WIN32 AND MI_BUILD_SHARED) -+if(FALSE) - # install a symlink in the /usr/local/lib to the versioned library - set(mi_symlink "${CMAKE_SHARED_MODULE_PREFIX}${mi_basename}${CMAKE_SHARED_LIBRARY_SUFFIX}") - set(mi_soname "mimalloc-${mi_version}/${mi_symlink}.${mi_version}") diff --git a/recipes/mimalloc/all/patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch b/recipes/mimalloc/all/patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch deleted file mode 100644 index b6a13ceb0fb42..0000000000000 --- a/recipes/mimalloc/all/patches/1.6.7-0002-include-cstddef-to-get-std-size-t.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/mimalloc.h b/include/mimalloc.h -index 254a7d9..3c3142b 100644 ---- a/include/mimalloc.h -+++ b/include/mimalloc.h -@@ -377,6 +377,7 @@ mi_decl_nodiscard mi_decl_export void* mi_new_reallocn(void* p, size_t newcount, - #ifdef __cplusplus - - #include // PTRDIFF_MAX -+#include // std::size_t - #if (__cplusplus >= 201103L) || (_MSC_VER > 1900) // C++11 - #include // std::true_type - #include // std::forward diff --git a/recipes/mimalloc/all/patches/1.7.7-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/1.7.7-0001-change-install-paths.patch deleted file mode 100644 index 108558a1f1922..0000000000000 --- a/recipes/mimalloc/all/patches/1.7.7-0001-change-install-paths.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2bc0f76..f40e272 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -360,7 +360,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() - -@@ -384,7 +384,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.7-0002-support-older-compiler.patch b/recipes/mimalloc/all/patches/1.8.7-0002-support-older-compiler.patch new file mode 100644 index 0000000000000..4b1890b784ff9 --- /dev/null +++ b/recipes/mimalloc/all/patches/1.8.7-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index ae6f99b..773424e 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -511,7 +511,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; +@@ -522,7 +522,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.0.2-0001-change-install-paths-avoid-symlink.patch b/recipes/mimalloc/all/patches/2.0.2-0001-change-install-paths-avoid-symlink.patch deleted file mode 100644 index ffbc799da2d8e..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.2-0001-change-install-paths-avoid-symlink.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt 2021-06-18 00:05:40.000000000 -0300 -+++ b/CMakeLists.txt 2021-07-14 18:02:10.941935678 -0300 -@@ -281,7 +281,7 @@ - COMMENT "Copy mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll to output directory") - 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() - -@@ -305,7 +305,7 @@ - set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename}) - endif() - -- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY) -+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - endif() - - # install include files -@@ -315,7 +315,7 @@ - install(FILES cmake/mimalloc-config.cmake DESTINATION ${mi_install_cmakedir}) - install(FILES cmake/mimalloc-config-version.cmake DESTINATION ${mi_install_cmakedir}) - --if(NOT WIN32 AND MI_BUILD_SHARED AND NOT MI_INSTALL_TOPLEVEL) -+if(FALSE) - # install a symlink in the /usr/local/lib to the versioned library - # note: use delayed prefix expansion as \${CMAKE_INSTALL_PREFIX} - set(mi_symlink "${CMAKE_SHARED_MODULE_PREFIX}${mi_basename}${CMAKE_SHARED_LIBRARY_SUFFIX}") diff --git a/recipes/mimalloc/all/patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch b/recipes/mimalloc/all/patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch deleted file mode 100644 index fc8068130bf11..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/mimalloc.h b/include/mimalloc.h -index 254a7d9..3c3142b 100644 ---- a/include/mimalloc.h -+++ b/include/mimalloc.h -@@ -387,6 +387,7 @@ mi_decl_nodiscard mi_decl_export void* mi_new_reallocn(void* p, size_t newcount, - #ifdef __cplusplus - - #include // PTRDIFF_MAX -+#include // std::size_t - #if (__cplusplus >= 201103L) || (_MSC_VER > 1900) // C++11 - #include // std::true_type - #include // std::forward diff --git a/recipes/mimalloc/all/patches/2.0.3-0001-change-install-paths-avoid-symlink.patch b/recipes/mimalloc/all/patches/2.0.3-0001-change-install-paths-avoid-symlink.patch deleted file mode 100644 index 00b059ccae3db..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.3-0001-change-install-paths-avoid-symlink.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 580e38c..19fce47 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -305,7 +305,7 @@ if(MI_BUILD_SHARED) - COMMENT "Copy mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll to output directory") - 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() - -@@ -329,7 +329,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_libdir} LIBRARY) -+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - endif() - - # install include files -@@ -339,7 +339,7 @@ install(FILES include/mimalloc-new-delete.h DESTINATION ${mi_install_incdir}) - install(FILES cmake/mimalloc-config.cmake DESTINATION ${mi_install_cmakedir}) - install(FILES cmake/mimalloc-config-version.cmake DESTINATION ${mi_install_cmakedir}) - --if(NOT WIN32 AND MI_BUILD_SHARED AND NOT MI_INSTALL_TOPLEVEL) -+if(FALSE) - # install a symlink in the /usr/local/lib to the versioned library - # note: use delayed prefix expansion as \${CMAKE_INSTALL_PREFIX} - set(mi_symlink "${CMAKE_SHARED_MODULE_PREFIX}${mi_basename}${CMAKE_SHARED_LIBRARY_SUFFIX}") diff --git a/recipes/mimalloc/all/patches/2.0.6-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/2.0.6-0001-change-install-paths.patch deleted file mode 100644 index bb266a46ce3f6..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.6-0001-change-install-paths.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8127e09..af459af 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -319,7 +319,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() - -@@ -343,7 +343,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/2.0.7-0001-change-install-paths.patch b/recipes/mimalloc/all/patches/2.0.7-0001-change-install-paths.patch deleted file mode 100644 index adf1e00f9607c..0000000000000 --- a/recipes/mimalloc/all/patches/2.0.7-0001-change-install-paths.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2550f0d..da42112 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -360,7 +360,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() - -@@ -384,7 +384,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/2.1.7-0002-support-older-compiler.patch b/recipes/mimalloc/all/patches/2.1.7-0002-support-older-compiler.patch new file mode 100644 index 0000000000000..34149f1737e9e --- /dev/null +++ b/recipes/mimalloc/all/patches/2.1.7-0002-support-older-compiler.patch @@ -0,0 +1,22 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index c41bcc8..cc4929e 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -512,7 +512,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; +@@ -523,7 +523,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.9-0002-support-older-compiler.patch b/recipes/mimalloc/all/patches/2.1.9-0002-support-older-compiler.patch new file mode 100644 index 0000000000000..4dfb677e994e1 --- /dev/null +++ b/recipes/mimalloc/all/patches/2.1.9-0002-support-older-compiler.patch @@ -0,0 +1,23 @@ +diff --git a/include/mimalloc.h b/include/mimalloc.h +index bd91db4..f6aa1aa 100644 +--- a/include/mimalloc.h ++++ b/include/mimalloc.h +@@ -544,7 +544,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; +@@ -555,7 +555,8 @@ 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/test_package/CMakeLists.txt b/recipes/mimalloc/all/test_package/CMakeLists.txt index cf60e66aa36cb..65c3184e9021a 100644 --- a/recipes/mimalloc/all/test_package/CMakeLists.txt +++ b/recipes/mimalloc/all/test_package/CMakeLists.txt @@ -1,51 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES C CXX) - -enable_testing() - -option(BUILD_NO_CHANGES "Build no_changes sources" ON) -option(BUILD_INCLUDE_OVERRIDE "Build include_override sources" ON) -option(BUILD_MI_API "Build mi_api sources" ON) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(mimalloc REQUIRED CONFIG) -if(TARGET mimalloc-static) - set(MIMALLOC_LIBS mimalloc-static) -else() - set(MIMALLOC_LIBS mimalloc) -endif() - -if(BUILD_NO_CHANGES) - add_executable(no_changes no_changes.c) - target_link_libraries(no_changes PRIVATE ${MIMALLOC_LIBS}) - target_compile_features(no_changes PRIVATE c_std_11) - add_test(NAME no_changes COMMAND no_changes) - - add_executable(no_changes_cpp no_changes.cpp) - target_link_libraries(no_changes_cpp PRIVATE ${MIMALLOC_LIBS}) - target_compile_features(no_changes_cpp PRIVATE cxx_std_17) - add_test(NAME no_changes_cpp COMMAND no_changes_cpp) -endif() - -if(BUILD_INCLUDE_OVERRIDE) - add_executable(include_override include_override.c) - target_link_libraries(include_override PRIVATE ${MIMALLOC_LIBS}) - target_compile_features(include_override PRIVATE c_std_11) - add_test(NAME include_override COMMAND include_override) - - add_executable(include_override_cpp include_override.cpp) - target_link_libraries(include_override_cpp PRIVATE ${MIMALLOC_LIBS}) - target_compile_features(include_override_cpp PRIVATE cxx_std_17) - add_test(NAME include_override_cpp COMMAND include_override_cpp) -endif() - -if(BUILD_MI_API) - add_executable(mi_api mi_api.c) - target_link_libraries(mi_api PRIVATE ${MIMALLOC_LIBS}) - target_compile_features(mi_api PRIVATE c_std_11) - add_test(NAME mi_api COMMAND mi_api) - add_executable(mi_api_cpp mi_api.cpp) - target_link_libraries(mi_api_cpp PRIVATE ${MIMALLOC_LIBS}) - target_compile_features(mi_api_cpp PRIVATE cxx_std_17) - add_test(NAME mi_api_cpp COMMAND mi_api_cpp) -endif() +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE $,mimalloc,mimalloc-static>) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/mimalloc/all/test_package/conanfile.py b/recipes/mimalloc/all/test_package/conanfile.py index 73d57fff7f138..81b2d147a96f2 100644 --- a/recipes/mimalloc/all/test_package/conanfile.py +++ b/recipes/mimalloc/all/test_package/conanfile.py @@ -1,16 +1,12 @@ from conan import ConanFile -from conan.tools.build import build_jobs, can_run -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.env import Environment -from conan.tools.files import chdir +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -import functools class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "VirtualRunEnv" - test_type = "explicit" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" def layout(self): cmake_layout(self) @@ -18,49 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - @functools.lru_cache(1) - def _test_files(self): - # No override: - if not self.dependencies["mimalloc"].options.override: - return ["mi_api"] - # Injected override - elif self.dependencies["mimalloc"].options.get_safe("inject"): - if self.settings.os == "Macos": - # Could not simulate Macos preload, so just ignore it - return [] - return ["no_changes"] - # Non injected override - return ["include_override", "mi_api"] - - @property - def _lib_name(self): - name = "mimalloc" if self.settings.os == "Windows" else "libmimalloc" - if self.settings.os == "Windows" and not self.dependencies["mimalloc"].options.shared: - name += "-static" - if self.dependencies["mimalloc"].options.secure: - name += "-secure" - if self.settings.build_type not in ("Release", "RelWithDebInfo", "MinSizeRel"): - name += f"-{str(self.settings.build_type).lower()}" - return name - - def generate(self): - tc = CMakeToolchain(self) - tc.variables["BUILD_NO_CHANGES"] = "no_changes" in self._test_files() - tc.variables["BUILD_INCLUDE_OVERRIDE"] = "include_override" in self._test_files() - tc.variables["BUILD_MI_API"] = "mi_api" in self._test_files() - tc.generate() - - env = Environment() - env.define("MIMALLOC_VERBOSE", "1") - if self.dependencies["mimalloc"].options.get_safe("inject"): - if self.settings.os == "Linux": - env.define("LD_PRELOAD", f"{self._lib_name}.so") - elif self.settings.os == "Macos": - env.define("DYLD_FORCE_FLAT_NAMESPACE", "1") - insert_library = os.path.join(self.dependencies["mimalloc"].cpp_info.libdirs[0], f"{self._lib_name}.dylib") - env.define("DYLD_INSERT_LIBRARIES", insert_library) - env.vars(self, scope="run").save_script("mimalloc_env_file") - def build(self): cmake = CMake(self) cmake.configure() @@ -68,5 +21,5 @@ def build(self): 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} -j {build_jobs(self)}", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mimalloc/all/test_package/include_override.c b/recipes/mimalloc/all/test_package/include_override.c deleted file mode 100644 index 5e54990b98f79..0000000000000 --- a/recipes/mimalloc/all/test_package/include_override.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "mimalloc-override.h" - -#include - -int main() { - void *data = malloc(1024); - free(data); - - printf("mimalloc version %d\n", mi_version()); - return 0; -} diff --git a/recipes/mimalloc/all/test_package/include_override.cpp b/recipes/mimalloc/all/test_package/include_override.cpp deleted file mode 100644 index edcb49e3434ee..0000000000000 --- a/recipes/mimalloc/all/test_package/include_override.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#ifdef _WIN32 -#include -#else -#include -#endif - -#include -#include - -int main() { - auto *data = new int(1024); - delete data; - - std::cout << "mimalloc version " << mi_version() << "\n"; - return 0; -} diff --git a/recipes/mimalloc/all/test_package/mi_api.c b/recipes/mimalloc/all/test_package/mi_api.c deleted file mode 100644 index 804f582034b95..0000000000000 --- a/recipes/mimalloc/all/test_package/mi_api.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "mimalloc.h" - -#include -#include - -int main() { - void *data = mi_malloc(1024); - - printf("mimalloc version %d\n", mi_version()); - return 0; -} diff --git a/recipes/mimalloc/all/test_package/mi_api.cpp b/recipes/mimalloc/all/test_package/mi_api.cpp deleted file mode 100644 index a361ab757bf42..0000000000000 --- a/recipes/mimalloc/all/test_package/mi_api.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "mimalloc.h" - -#include -#include - -int main() { - std::vector> vec; - vec.push_back(1); - vec.pop_back(); - - std::cout << "mimalloc version " << mi_version() << "\n"; - return 0; -} diff --git a/recipes/mimalloc/all/test_package/no_changes.c b/recipes/mimalloc/all/test_package/no_changes.c deleted file mode 100644 index 51737c1ac50f0..0000000000000 --- a/recipes/mimalloc/all/test_package/no_changes.c +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - -int main() { - void *data = malloc(1024); - - memset(data, '6', 1024); - - free(data); - - return 0; -} diff --git a/recipes/mimalloc/all/test_package/no_changes.cpp b/recipes/mimalloc/all/test_package/no_changes.cpp deleted file mode 100644 index 7a5ad3df0f22c..0000000000000 --- a/recipes/mimalloc/all/test_package/no_changes.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() { - auto *data = new int(1024); - delete data; - - return 0; -} diff --git a/recipes/mimalloc/all/test_package/test_package.c b/recipes/mimalloc/all/test_package/test_package.c new file mode 100644 index 0000000000000..f73b12d64f5d5 --- /dev/null +++ b/recipes/mimalloc/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include "mimalloc.h" + +#include +#include + +int main() { + void *data = mi_malloc(32); + + printf("mimalloc version %d\n", mi_version()); + return EXIT_SUCCESS; +} diff --git a/recipes/mimalloc/all/test_v1_package/CMakeLists.txt b/recipes/mimalloc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3f3fae06afa0a..0000000000000 --- a/recipes/mimalloc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -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/mimalloc/all/test_v1_package/conanfile.py b/recipes/mimalloc/all/test_v1_package/conanfile.py deleted file mode 100644 index 7f8fb52960e7a..0000000000000 --- a/recipes/mimalloc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,70 +0,0 @@ -from conans import ConanFile, CMake, RunEnvironment, tools -from conans.errors import ConanException -import os -import functools - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def _mimalloc_option(self, name, default=None): - try: - return getattr(self.options["mimalloc"], name, default) - except (AttributeError, ConanException): - return default - - @functools.lru_cache(1) - def _test_files(self): - # No override: - if not self.options["mimalloc"].override: - return ["mi_api"] - # Injected override: - elif self._mimalloc_option("inject"): - if self.settings.os == "Macos": - # Could not simulate Macos preload, so just ignore it - return [] - return ["no_changes"] - # Non injected override: - return ["include_override", "mi_api"] - - def build(self): - cmake = CMake(self) - cmake.definitions["BUILD_NO_CHANGES"] = "no_changes" in self._test_files() - cmake.definitions["BUILD_INCLUDE_OVERRIDE"] = "include_override" in self._test_files() - cmake.definitions["BUILD_MI_API"] = "mi_api" in self._test_files() - cmake.configure() - cmake.build() - - @property - def _lib_name(self): - name = "mimalloc" if self.settings.os == "Windows" else "libmimalloc" - if self.settings.os == "Windows" and not self.options["mimalloc"].shared: - name += "-static" - if self.options["mimalloc"].secure: - name += "-secure" - if self.settings.build_type not in ("Release", "RelWithDebInfo", "MinSizeRel"): - name += f"-{str(self.settings.build_type).lower()}" - return name - - @property - def _environment(self): - environment = {"MIMALLOC_VERBOSE": "1"} - - if self._mimalloc_option("inject"): - if self.settings.os == "Linux": - environment["LD_PRELOAD"] = f"{self._lib_name}.so" - elif self.settings.os == "Macos": - env_build = RunEnvironment(self) - insert_library = os.path.join(env_build.vars["DYLD_LIBRARY_PATH"][0], f"{self._lib_name}.dylib") - - environment["DYLD_FORCE_FLAT_NAMESPACE"] = "1" - environment["DYLD_INSERT_LIBRARIES"] = insert_library - - return environment - - def test(self): - if tools.cross_building(self): - return - with tools.environment_append(self._environment): - self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/mimalloc/config.yml b/recipes/mimalloc/config.yml index 2f9902ecefeb6..bc0ad332b92dd 100644 --- a/recipes/mimalloc/config.yml +++ b/recipes/mimalloc/config.yml @@ -1,27 +1,19 @@ versions: - "2.1.2": - folder: all - "2.0.9": + "2.1.9": folder: all - "2.0.7": + "2.1.7": folder: all - "2.0.6": - folder: all - "2.0.5": + # mold requires 2.1.2 + "2.1.2": folder: all - "2.0.3": + "2.0.9": folder: all - "2.0.2": + "1.8.7": folder: all "1.8.2": folder: all "1.7.9": folder: all - "1.7.7": - folder: all + # arrow requires 1.7.6 "1.7.6": folder: all - "1.7.5": - folder: all - "1.6.7": - folder: all diff --git a/recipes/mingw-builds/all/conandata.yml b/recipes/mingw-builds/all/conandata.yml index 6703f0f20681d..64bed6552b8f3 100644 --- a/recipes/mingw-builds/all/conandata.yml +++ b/recipes/mingw-builds/all/conandata.yml @@ -1,4 +1,48 @@ sources: + "14.2.0": + mcf: + seh: + ucrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev0/x86_64-14.2.0-release-mcf-seh-ucrt-rt_v12-rev0.7z" + sha256: "80fa0d1dd58c9eed4ca9d21f6e5a83e3262978aed0a2b4994296a0ee5809503e" + posix: + seh: + ucrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev0/x86_64-14.2.0-release-posix-seh-ucrt-rt_v12-rev0.7z" + sha256: "0f1afc3b48f66dda68fbfb7b8b0f1d22b831396fbe1e3dea776745f32d930b24" + msvcrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev0/x86_64-14.2.0-release-posix-seh-msvcrt-rt_v12-rev0.7z" + sha256: "8afdb7e16253e3d235ea933cb40b2c14d0c9ba334aa668ab9e2eada472a0caef" + win32: + seh: + ucrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev0/x86_64-14.2.0-release-win32-seh-ucrt-rt_v12-rev0.7z" + sha256: "d7270f76483aefe0c88f45284b374e27648dec59fb6f89ee2f5cb62f6a060082" + msvcrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev0/x86_64-14.2.0-release-win32-seh-msvcrt-rt_v12-rev0.7z" + sha256: "32bf3d1337c89f1f0326b42f49fea96fc7eb115af29b765a69bc69be546fd2a1" + "13.2.0": + mcf: + seh: + ucrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-mcf-seh-ucrt-rt_v11-rev1.7z" + sha256: "9ae11d0b00f4deae7246471193191de62d9e0318917d3577b568e0974c3069bc" + posix: + seh: + ucrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev1.7z" + sha256: "475ee72c5ce1bd54a3e3c334bdd3be5e6575334184fd9718013aa362c9819d2f" + msvcrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-posix-seh-msvcrt-rt_v11-rev1.7z" + sha256: "7d3f84b17b235aa233f0fb5df9765bf79dbea950177a69ff99f8ad1d75b0aa6e" + win32: + seh: + ucrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev1.7z" + sha256: "74ca64c55220edd3196681782fbff653c2b9cb4f427f9e532ab6e9a0823dc997" + msvcrt: + url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-win32-seh-msvcrt-rt_v11-rev1.7z" + sha256: "15b914f38f2f2e2d6f7b9b8425ff22b7e406878b01920190b09ce0dd8259c6aa" "12.2.0": posix: seh: diff --git a/recipes/mingw-builds/all/conanfile.py b/recipes/mingw-builds/all/conanfile.py index 8b875ba354b42..913b244a11774 100644 --- a/recipes/mingw-builds/all/conanfile.py +++ b/recipes/mingw-builds/all/conanfile.py @@ -2,6 +2,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.files import copy, download, rmdir +from conan.tools.scm import Version required_conan_version = ">=1.47.0" @@ -14,14 +15,27 @@ class MingwConan(ConanFile): license = "ZPL-2.1", "MIT", "GPL-2.0-or-later" topics = ("gcc", "gnu", "unix", "mingw32", "binutils") settings = "os", "arch" - options = {"threads": ["posix", "win32"], "exception": ["seh", "sjlj"]} - default_options = {"threads": "posix", "exception": "seh"} + options = { + "threads": ["posix", "win32", "mcf"], + "exception": ["seh", "sjlj"], + "runtime": ["msvcrt", "ucrt"] + } + default_options = { + "threads": "posix", + "exception": "seh", + "runtime": "ucrt" + } provides = "mingw-w64" @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def config_options(self): + # Before version 12 (included) the only possible runtime was msvcrt + if Version(self.version) <= Version("12.2.0"): + del self.options.runtime + def validate(self): valid_os = ["Windows"] if str(self.settings.os) not in valid_os: @@ -52,15 +66,20 @@ def validate(self): def build_requirements(self): self.build_requires("7zip/19.00") + def _get_source(self): + if Version(self.version) <= Version("12.2.0"): + return self.conan_data["sources"][self.version][str(self.options.threads)][str(self.options.exception)] + else: + return self.conan_data["sources"][self.version][str(self.options.threads)][str(self.options.exception)][str(self.options.runtime)] + def build(self): # Source should be downloaded in the build step since it depends on specific options - url = self.conan_data["sources"][self.version][str(self.options.threads)][str(self.options.exception)] + url = self._get_source() self.output.info(f"Downloading: {url['url']}") download(self, url["url"], "file.7z", sha256=url["sha256"]) self.run("7z x file.7z") os.remove('file.7z') - def package(self): target = "mingw64" if self.settings.arch == "x86_64" else "mingw32" copy(self, "*", src=target, dst=self.package_folder) diff --git a/recipes/mingw-builds/config.yml b/recipes/mingw-builds/config.yml index 6ceaf5fe4c164..94b0463036209 100644 --- a/recipes/mingw-builds/config.yml +++ b/recipes/mingw-builds/config.yml @@ -1,4 +1,8 @@ versions: + "14.2.0": + folder: "all" + "13.2.0": + folder: "all" "12.2.0": folder: "all" "12.1.0": diff --git a/recipes/mingw-w64/linux/conandata.yml b/recipes/mingw-w64/linux/conandata.yml index 4c165fd2e4f36..e6c1adc158693 100644 --- a/recipes/mingw-w64/linux/conandata.yml +++ b/recipes/mingw-w64/linux/conandata.yml @@ -4,9 +4,15 @@ sources: url: "https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v8.0.2.tar.bz2" sha256: "f00cf50951867a356d3dc0dcc7a9a9b422972302e23d54a33fc05ee7f73eee4d" binutils: - url: "http://ftp.gnu.org/gnu/binutils/binutils-2.35.2.tar.bz2" - sha256: "cfa7644dbecf4591e136eb407c1c1da16578bd2b03f0c2e8acdceba194bb9d61" + url: + - "https://mirrors.dotsrc.org/gnu/binutils/binutils-2.35.2.tar.xz" + - "https://mirror.kumi.systems/gnu/binutils/binutils-2.35.2.tar.xz" + - "https://ftpmirror.gnu.org/binutils/binutils-2.35.2.tar.xz" + sha256: "dcd5b0416e7b0a9b24bed76cd8c6c132526805761863150a26d016415b8bdc7b" gcc: - "10.3.0": - url: "http://ftp.gnu.org/gnu/gcc/gcc-10.3.0/gcc-10.3.0.tar.xz" - sha256: "64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344" + "10.5.0": + url: + - "https://mirrors.dotsrc.org/gnu/gcc/gcc-10.5.0/gcc-10.5.0.tar.xz" + - "https://mirror.kumi.systems/gnu/gcc/gcc-10.5.0/gcc-10.5.0.tar.xz" + - "https://ftpmirror.gnu.org/gcc/gcc-10.5.0/gcc-10.5.0.tar.xz" + sha256: "25109543fdf46f397c347b5d8b7a2c7e5694a5a51cce4b9c6e1ea8a71ca307c1" diff --git a/recipes/mingw-w64/linux/conanfile.py b/recipes/mingw-w64/linux/conanfile.py index 1e781d08b3204..580e45942d0c5 100644 --- a/recipes/mingw-w64/linux/conanfile.py +++ b/recipes/mingw-w64/linux/conanfile.py @@ -1,83 +1,114 @@ import os +from contextlib import contextmanager + from conan import ConanFile -from conan.tools.files import get, mkdir, chdir, rm, rmdir from conan.errors import ConanInvalidConfiguration -from conans import tools, AutoToolsBuildEnvironment - +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import chdir, copy, get, mkdir, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class MingwConan(ConanFile): name = "mingw-w64" - description = "MinGW is a contraction of Minimalist GNU for Windows" + description = ("This package provides a MinGW-w64 environment with a GCC toolchain " + "for cross-compilation of native Windows binaries from Linux.") + license = ("ZPL-2.1", "MIT", "GPL-2.0-or-later") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.mingw-w64.org/" - license = "ZPL-2.1", "MIT", "GPL-2.0-or-later" topics = ("gcc", "gnu", "unix", "mingw32", "binutils") - settings = "os", "arch", "build_type", "compiler" - options = {"threads": ["posix", "win32"], "exception": ["seh", "sjlj"], "gcc": ["10.3.0"]} - default_options = {"threads": "posix", "exception": "seh", "gcc": "10.3.0"} - no_copy_source = True + + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + options = { + "threads": ["posix", "win32"], + "exception": ["seh", "sjlj"], + "gcc": ["10.5.0"], + } + default_options = { + "threads": "posix", + "exception": "seh", + "gcc": "10.5.0", + } + options_description = { + "threads": "Threading model: posix or win32", + "exception": "Exception model: seh (Structured Exception Handling) or sjlj (setjmp/longjmp)", + "gcc": "GCC version provided by MinGW-w64", + } + + short_paths = 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): + del self.info.settings.compiler + del self.info.settings.build_type + def validate(self): - valid_os = ["Linux"] + valid_os = ["Linux", "FreeBSD"] if str(self.settings.os) not in valid_os: - raise ConanInvalidConfiguration("MinGW {} is only supported for the following operating systems: {}" - .format(self.version, valid_os)) + raise ConanInvalidConfiguration( + f"MinGW {self.version} is only supported for the following operating systems: {valid_os}" + ) valid_arch = ["x86_64"] if str(self.settings.arch) not in valid_arch: - raise ConanInvalidConfiguration("MinGW {} is only supported for the following architectures on {}: {}" - .format(self.version, str(self.settings.os), valid_arch)) - - if "gcc" in self.conan_data["sources"][self.version]: - valid_gcc = self.conan_data["sources"][self.version]["gcc"].keys() - if str(self.options.gcc) not in valid_gcc: - raise ConanInvalidConfiguration("gcc version {} is not in the list of valid versions: {}" - .format(str(self.options.gcc), valid_gcc)) + raise ConanInvalidConfiguration( + f"MinGW {self.version} is only supported for the following architectures on {str(self.settings.os)}: {valid_arch}" + ) def build_requirements(self): - self.build_requires("m4/1.4.19") - self.build_requires("gmp/6.2.1") - self.build_requires("mpfr/4.1.0") - self.build_requires("mpc/1.2.0") + self.tool_requires("m4/1.4.19") + self.tool_requires("gmp/6.3.0") + self.tool_requires("mpfr/4.2.0") + self.tool_requires("mpc/1.3.1") - def package_id(self): - del self.info.settings.compiler - del self.info.settings.build_type + def source(self): + # Source is downloaded in the build step since it depends on specific option values + pass - def _download_source(self): - arch_data = self.conan_data["sources"][self.version] + def _download_source(self, package): + self.output.info(f"Downloading {package} ...") + info = self.conan_data["sources"][self.version][package] + if package == "gcc": + info = info[str(self.options.gcc)] + destination = os.path.join(self.source_folder, package) + get(self, **info, strip_root=True, destination=destination) + return destination - for package in arch_data: - if package == "gcc": - continue - self.output.info("Downloading {} from {}".format(package, arch_data[package]['url'])) - get(self, **arch_data[package], strip_root=True, destination=os.path.join(self.build_folder, "sources", package)) - # Download gcc version - gcc_data = arch_data["gcc"][str(self.options.gcc)] - get(self, **gcc_data, strip_root=True, destination=os.path.join(self.build_folder, "sources", "gcc")) + @property + def _build_multilib(self): + # We currently cannot build with multilib and threads=posix. Otherwise we get the gcc compile error: + # checking for ld that supports -Wl,--gc-sections... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. + # Makefile:11275: recipe for target 'configure-target-libstdc++-v3' failed + return False + + @property + def _host_tag(self): + return "x86_64-linux-gnu" @property def _target_tag(self): return "x86_64-w64-mingw32" - def build(self): - # Source should be downloaded in the build step since it depends on specific options - self._download_source() - - target_tag = self._target_tag - host_tag = "x86_64-linux-gnu" + def _get_package_root(self, p): + return self.dependencies.build[p].package_folder.replace("\\", "/") - # We currently cannot build with multilib and threads=posix. Otherwise we get the gcc compile error: - # checking for ld that supports -Wl,--gc-sections... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. - # Makefile:11275: recipe for target 'configure-target-libstdc++-v3' failed - build_multilib = False + @property + def _with_gmp_mpfr_mpc(self): + return [ + f"--with-gmp={self._get_package_root('gmp')}", + f"--with-mpfr={self._get_package_root('mpfr')}", + f"--with-mpc={self._get_package_root('mpc')}", + ] + def generate(self): # Instructions see: # https://sourceforge.net/p/mingw-w64/code/HEAD/tree/trunk/mingw-w64-doc/howto-build/mingw-w64-howto-build.txt # and @@ -85,202 +116,228 @@ def build(self): # also good to see specific commands: # https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/+/lollipop-dev/build-mingw64-toolchain.sh - # add binutils to path. Required for gcc build - env = {"PATH": os.environ["PATH"] + ":" + os.path.join(self.package_folder, "bin")} + # Add binutils to path. Required for gcc build. + env = Environment() + env.prepend_path("PATH", os.path.join(self.package_folder, "bin")) + env.vars(self).save_script("conanbuild_package_bin_path") - with tools.environment_append(env): - with_gmp_mpfc_mpc = [ - "--with-gmp={}".format(self.deps_cpp_info["gmp"].rootpath.replace("\\", "/")), - "--with-mpfr={}".format(self.deps_cpp_info["mpfr"].rootpath.replace("\\", "/")), - "--with-mpc={}".format(self.deps_cpp_info["mpc"].rootpath.replace("\\", "/")) + venv = VirtualBuildEnv(self) + venv.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + self.output.info("Generating for binutils ...") + tc = AutotoolsToolchain(self, namespace="binutils") + tc.configure_args += [ + f"--target={self._target_tag}", + f"--with-sysroot={self.package_folder}", + "--enable-silent-rules", + "--disable-nls", + "--disable-shared", + ] + if self._build_multilib: + tc.configure_args.append("--enable-targets=x86_64-w64-mingw32,i686-w64-mingw32") + tc.configure_args.extend(self._with_gmp_mpfr_mpc) + tc.generate() + + self.output.info("Generating for mingw-w64-tools ...") + tc = AutotoolsToolchain(self, namespace="mingw-w64-tools") + tc.configure_args += [ + f"--target={self._target_tag}" + ] + tc.generate() + + self.output.info("Generating for mingw-w64-headers ...") + tc = AutotoolsToolchain(self, namespace="mingw-w64-headers") + tc.configure_args += [ + f"--host={self._target_tag}", + f"--build={self._host_tag}", + f"--prefix=/{self._target_tag}", + f"--with-widl={os.path.join(self.package_folder, 'bin')}", + "--enable-silent-rules", + "--enable-sdk=all", + ] + tc.generate() + + self.output.info("Generating for core gcc ...") + tc = AutotoolsToolchain(self, namespace="gcc") + tc.configure_args += [ + f"--target={self._target_tag}", + f"--with-sysroot={self.package_folder}", + "--disable-shared", + "--enable-silent-rules", + "--enable-languages=c,c++", + ] + if self._build_multilib: + tc.configure_args.append("--enable-targets=all") + tc.configure_args.append("--enable-multilib") + else: + tc.configure_args.append("--disable-multilib") + tc.configure_args.extend(self._with_gmp_mpfr_mpc) + if self.options.exception == "sjlj": + tc.configure_args.append("--enable-sjlj-exceptions") + if self.options.threads == "posix": + # Some specific options which need to be set for posix thread. Otherwise it fails to compile. + tc.configure_args.extend([ + "--enable-silent-rules", + "--enable-threads=posix", + # Not 100% sure why, but the following options are required, otherwise + # gcc fails to build with posix threads + ]) + tc.libs = [] + tc.generate() + + self.output.info("Generating for mingw-w64-crt ...") + tc = AutotoolsToolchain(self, namespace="mingw-w64-crt") + tc.configure_args += [ + f"--host={self._target_tag}", + f"--prefix=/{self._target_tag}", + f"--with-sysroot={self.package_folder}", + f"CC={self._target_tag}-gcc", + f"CXX={self._target_tag}-g++", + "--enable-silent-rules", + ] + if self._build_multilib: + tc.configure_args.append("--enable-lib32") + tc.generate() + + if self.options.threads == "posix": + self.output.info("Generating for mingw-w64-libraries-winpthreads ...") + tc = AutotoolsToolchain(self, namespace="mingw-w64-libraries-winpthreads") + tc.configure_args += [ + f"--host={self._target_tag}", + f"--prefix=/{self._target_tag}", + f"CC={self._target_tag}-gcc", + f"CXX={self._target_tag}-g++", + "--enable-silent-rules", + "--disable-shared", ] + tc.generate() - self.output.info("Building binutils ...") - mkdir(self, os.path.join(self.build_folder, "binutils")) - with chdir(self, os.path.join(self.build_folder, "binutils")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--with-sysroot={}".format(self.package_folder), - "--disable-nls", - "--disable-shared" - ] - if build_multilib: - conf_args.append("--enable-targets=x86_64-w64-mingw32,i686-w64-mingw32") - conf_args.extend(with_gmp_mpfc_mpc) - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "binutils"), - args=conf_args, target=target_tag, host=False, build=False) - autotools.make() - autotools.install() + @contextmanager + def _build_namespace(self, namespace): + self.output.info(f"Building {namespace} ...") + build_dir = os.path.join(self.build_folder, namespace) + mkdir(self, build_dir) + with chdir(self, build_dir): + yield Autotools(self, namespace=namespace) - self.output.info("Building mingw-w64-tools ...") - mkdir(self, os.path.join(self.build_folder, "mingw-w64-tools")) - with chdir(self, os.path.join(self.build_folder, "mingw-w64-tools")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [] - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mingw-w64", "mingw-w64-tools", "widl"), - args=conf_args, target=target_tag, host=False, build=False) - autotools.make() - autotools.install() + def build(self): + binutils_source = self._download_source("binutils") + with self._build_namespace("binutils") as autotools: + autotools.configure(binutils_source) + autotools.make() + autotools.install() - self.output.info("Building mingw-w64-headers ...") - mkdir(self, os.path.join(self.build_folder, "mingw-w64-headers")) - with chdir(self, os.path.join(self.build_folder, "mingw-w64-headers")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--with-widl={}".format(os.path.join(self.package_folder, "bin")), - "--enable-sdk=all", - "--prefix={}".format(os.path.join(self.package_folder, target_tag)) - ] - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mingw-w64", "mingw-w64-headers"), - args=conf_args, target=False, host=target_tag, build=host_tag) + mingw_w64_source = self._download_source("mingw-w64") + with self._build_namespace("mingw-w64-tools") as autotools: + autotools.configure(os.path.join(mingw_w64_source, "mingw-w64-tools", "widl")) + autotools.make() + autotools.install() + + with self._build_namespace("mingw-w64-headers") as autotools: + autotools.configure(os.path.join(mingw_w64_source, "mingw-w64-headers")) + autotools.make() + autotools.install() + + # Step 3) GCC requires the x86_64-w64-mingw32 directory be mirrored as a + # directory 'mingw' in the same root. So, if using configure default + # /usr/local, type: + # ln -s /usr/local/x86_64-w64-mingw32 /usr/local/mingw + # or, for sysroot, type: + # ln -s /mypath/x86_64-w64-mingw32 /mypath/mingw + with chdir(self, self.package_folder): + os.symlink(self._target_tag, "mingw") + + # Step 5) Symlink x86_64-w64-mingw32/lib directory as x86_64-w64-mingw32/lib64: + # ln -s /usr/local/x86_64-w64-mingw32/lib /usr/local/x86_64-w64-mingw32/lib64 + # or, for sysroot: + # ln -s /mypath/x86_64-w64-mingw32/lib /mypath/x86_64-w64-mingw32/lib64 + with chdir(self, os.path.join(self.package_folder, self._target_tag)): + os.symlink("lib", "lib64") + + gcc_source = self._download_source("gcc") + with self._build_namespace("gcc") as autotools: + autotools.configure(gcc_source) + autotools.make(target="all-gcc") + autotools.install(target="install-gcc") + + with self._build_namespace("mingw-w64-crt") as autotools: + autotools.configure(os.path.join(mingw_w64_source, "mingw-w64-crt")) + autotools.make() + autotools.install() + + if self.options.threads == "posix": + with self._build_namespace("mingw-w64-libraries-winpthreads") as autotools: + autotools.configure(os.path.join(mingw_w64_source, "mingw-w64-libraries", "winpthreads")) autotools.make() autotools.install() - # Step 3) GCC requires the x86_64-w64-mingw32 directory be mirrored as a - # directory 'mingw' in the same root. So, if using configure default - # /usr/local, type: - # ln -s /usr/local/x86_64-w64-mingw32 /usr/local/mingw - # or, for sysroot, type: - # ln -s /mypath/x86_64-w64-mingw32 /mypath/mingw - self.run("ln -s {} {}".format(os.path.join(self.package_folder, target_tag), - os.path.join(self.package_folder, 'mingw'))) - # Step 5) Symlink x86_64-w64-mingw32/lib directory as x86_64-w64-mingw32/lib64: - # ln -s /usr/local/x86_64-w64-mingw32/lib /usr/local/x86_64-w64-mingw32/lib64 - # or, for sysroot: - # ln -s /mypath/x86_64-w64-mingw32/lib /mypath/x86_64-w64-mingw32/lib64 - self.run("ln -s {} {}".format(os.path.join(self.package_folder, target_tag, 'lib'), - os.path.join(self.package_folder, target_tag, 'lib64'))) - - self.output.info("Building core gcc ...") - mkdir(self, os.path.join(self.build_folder, "gcc")) - with chdir(self, os.path.join(self.build_folder, "gcc")): - autotools_gcc = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--enable-languages=c,c++", - "--with-sysroot={}".format(self.package_folder), - "--disable-shared" - ] - if build_multilib: - conf_args.append("--enable-targets=all") - conf_args.append("--enable-multilib") - else: - conf_args.append("--disable-multilib") - conf_args.extend(with_gmp_mpfc_mpc) - if self.options.exception == "sjlj": - conf_args.append("--enable-sjlj-exceptions") - if self.options.threads == "posix": - # Some specific options which need to be set for posix thread. Otherwise it fails compiling. - conf_args.extend([ - "--enable-silent-rules", - "--enable-threads=posix", - # Not 100% sure why, but the following options are required, otherwise - # gcc fails to build with posix threads - ]) - autotools_gcc.libs = [] - autotools_gcc.configure(configure_dir=os.path.join(self.build_folder, "sources", "gcc"), - args=conf_args, target=target_tag, host=False, build=False) - autotools_gcc.make(target="all-gcc") - autotools_gcc.make(target="install-gcc") - - env_compiler = dict(env) - # The CC and CXX compiler must be set to the mingw compiler. Conan already sets CC and CXX, therefore we need to overwrite it. - # If the wrong compiler is used for mingw-w64-crt, then you will get the error - # configure: Please check if the mingw-w64 header set and the build/host option are set properly. - env_compiler["CC"] = target_tag + "-gcc" - env_compiler["CXX"] = target_tag + "-g++" - with tools.environment_append(env_compiler): - self.output.info("Building mingw-w64-crt ...") - mkdir(self, os.path.join(self.build_folder, "mingw-w64-crt")) - with chdir(self, os.path.join(self.build_folder, "mingw-w64-crt")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--prefix={}".format(os.path.join(self.package_folder, target_tag)), - "--with-sysroot={}".format(self.package_folder) - ] - if build_multilib: - conf_args.append("--enable-lib32") - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mingw-w64", "mingw-w64-crt"), - args=conf_args, target=False, host=target_tag, build=False, - use_default_install_dirs=False) - autotools.make() - autotools.install() - - if self.options.threads == "posix": - self.output.info("Building mingw-w64-libraries-winpthreads ...") - mkdir(self, os.path.join(self.build_folder, "mingw-w64-libraries-winpthreads")) - with chdir(self, os.path.join(self.build_folder, "mingw-w64-libraries-winpthreads")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--disable-shared", - "--prefix={}".format(os.path.join(self.package_folder, target_tag)) - ] - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mingw-w64", "mingw-w64-libraries", "winpthreads"), - args=conf_args, target=False, host=target_tag, build=False) - autotools.make() - autotools.install() - - self.output.info("Building libgcc ...") - with chdir(self, os.path.join(self.build_folder, "gcc")): - autotools_gcc.make() - autotools_gcc.install() + + with self._build_namespace("gcc") as autotools: + autotools.make() + autotools.install() self.output.info("Building done!") def package(self): - self.copy("COPYING", src=os.path.join(self.build_folder, "sources", "mingw-w64"), dst="licenses") + copy(self, "COPYING", + src=os.path.join(self.source_folder, "mingw-w64"), + dst=os.path.join(self.package_folder, "licenses")) rm(self, "*.la", self.package_folder, recursive=True) rmdir(self, os.path.join(self.package_folder, "share", "man")) rmdir(self, os.path.join(self.package_folder, "share", "doc")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - # replace with relative symlinks so they'll resolve correctly on consumer's machine - os.unlink(os.path.join(self.package_folder, 'mingw')) - os.unlink(os.path.join(self.package_folder, self._target_tag, 'lib64')) - self.run("ln -s {} {}".format(os.path.join(os.curdir, self._target_tag), - os.path.join(self.package_folder, 'mingw'))) - self.run("ln -s {} {}".format(os.path.join(os.curdir, 'lib'), - os.path.join(self.package_folder, self._target_tag, 'lib64'))) def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + if getattr(self, "settings_target", None): if self.settings_target.compiler != "gcc": - raise ConanInvalidConfiguration("Only GCC is allowed as compiler.") + self.output.warning("Only GCC is allowed as the compiler.") if str(self.settings_target.compiler.threads) != str(self.options.threads): - raise ConanInvalidConfiguration("Build requires 'mingw' provides binaries for gcc " - "with threads={}, your profile:host declares " - "threads={}, please use the same value for both." - .format(self.options.threads, - self.settings_target.compiler.threads)) + self.output.warning( + f"Build requires 'mingw' provides binaries for gcc with threads={self.options.threads}," + f" your profile:host declares 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 " - "with exception={}, your profile:host declares " - "exception={}, please use the same value for both." - .format(self.options.exception, - self.settings_target.compiler.exception)) + self.output.warning( + f"Build requires 'mingw' provides binaries for gcc with exception={self.options.exception}," + f" your profile:host declares exception={self.settings_target.compiler.exception}," + " please use the same value for both." + ) bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var with : {}".format(bin_path)) + prefix = os.path.join(bin_path, self._target_tag + "-") + + self.buildenv_info.prepend_path("PATH", bin_path) self.env_info.PATH.append(bin_path) - self.env_info.MINGW_HOME = str(self.package_folder) - - prefix = os.path.join(self.package_folder, "bin", self._target_tag + "-") - self.env_info.CC = prefix + "gcc" - self.env_info.CXX = prefix + "g++" - self.env_info.CPP = prefix + "cpp" - self.env_info.AR = prefix + "ar" - self.env_info.AS = prefix + "as" - self.env_info.GDB = prefix + "gdb" - self.env_info.LD = prefix + "ld" - self.env_info.NM = prefix + "nm" - self.env_info.OBJCOPY = prefix + "objcopy" - self.env_info.OBJDUMP = prefix + "objdump" - self.env_info.RANLIB = prefix + "ranlib" - self.env_info.SIZE = prefix + "size" - self.env_info.STRINGS = prefix + "strings" - self.env_info.STRIP = prefix + "strip" - self.env_info.GCOV = prefix + "gcov" - self.env_info.RC = prefix + "windres" - self.env_info.DLLTOOL = prefix + "dlltool" + + self.buildenv_info.define_path("MINGW_HOME", self.package_folder) + self.env_info.MINGW_HOME = self.package_folder + + def define_tool_env(var, name): + self.buildenv_info.define_path(var, prefix + name) + setattr(self.env_info, var, prefix + name) + + define_tool_env("CC", "gcc") + define_tool_env("CXX", "g++") + define_tool_env("CPP", "cpp") + define_tool_env("AR", "ar") + define_tool_env("AS", "as") + define_tool_env("GDB", "gdb") + define_tool_env("LD", "ld") + define_tool_env("NM", "nm") + define_tool_env("OBJCOPY", "objcopy") + define_tool_env("OBJDUMP", "objdump") + define_tool_env("RANLIB", "ranlib") + define_tool_env("SIZE", "size") + define_tool_env("STRINGS", "strings") + define_tool_env("STRIP", "strip") + define_tool_env("GCOV", "gcov") + define_tool_env("RC", "windres") + define_tool_env("DLLTOOL", "dlltool") diff --git a/recipes/mingw-w64/linux/test_package/conanfile.py b/recipes/mingw-w64/linux/test_package/conanfile.py index b6ef323de8d96..300783c0da9a5 100644 --- a/recipes/mingw-w64/linux/test_package/conanfile.py +++ b/recipes/mingw-w64/linux/test_package/conanfile.py @@ -1,16 +1,19 @@ import os from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run class MinGWTestConan(ConanFile): - generators = "gcc" settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def build(self): source_file = os.path.join(self.source_folder, "main.cpp") - self.run("x86_64-w64-mingw32-g++ {} @conanbuildinfo.gcc -lstdc++ -o main".format(source_file), run_environment=True) + self.run(f"x86_64-w64-mingw32-g++ {source_file} -lstdc++ -o main", env="conanbuild") def test(self): - if not cross_building(self): - self.run("x86_64-w64-mingw32-g++ --version", run_environment=True) + if can_run(self): + self.run("x86_64-w64-mingw32-g++ --version", env="conanbuild") diff --git a/recipes/mingw-w64/linux/test_v1_package/conanfile.py b/recipes/mingw-w64/linux/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..13c18e19957ac --- /dev/null +++ b/recipes/mingw-w64/linux/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conan import ConanFile +from conan.tools.build import cross_building + + +class MinGWTestConan(ConanFile): + generators = "gcc" + settings = "os", "arch", "compiler", "build_type" + + def build(self): + source_file = os.path.join(self.source_folder, os.pardir, "test_package", "main.cpp") + self.run(f"x86_64-w64-mingw32-g++ {source_file} @conanbuildinfo.gcc -lstdc++ -o main", run_environment=True) + + def test(self): + if not cross_building(self): + self.run("x86_64-w64-mingw32-g++ --version", run_environment=True) diff --git a/recipes/minhook/all/conandata.yml b/recipes/minhook/all/conandata.yml new file mode 100644 index 0000000000000..4f8376eb12078 --- /dev/null +++ b/recipes/minhook/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.3.4": + url: "https://github.com/TsudaKageyu/minhook/archive/refs/tags/v1.3.4.tar.gz" + sha256: "1AEBEAE4CA898330C507860ACC2FCA2EB335FE446A3A2B8444C3BF8B2660A14E" + "1.3.3.cci.20240629": + url: "https://github.com/TsudaKageyu/minhook/archive/91cc9466e383d13a43d7cf33c7c8fdccb27095d3.tar.gz" + sha256: "b84b2ff19afe5fb9430948680146bee2e198392ee6333a71f81e339c36a819f1" diff --git a/recipes/minhook/all/conanfile.py b/recipes/minhook/all/conanfile.py new file mode 100644 index 0000000000000..73c08a93a80d6 --- /dev/null +++ b/recipes/minhook/all/conanfile.py @@ -0,0 +1,69 @@ +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 + +required_conan_version = ">=1.53.0" + + +class PackageConan(ConanFile): + name = "minhook" + description = "The Minimalistic x86/x64 API Hooking Library for Windows" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/TsudaKageyu/minhook" + topics = ("hook", "windows") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + } + default_options = { + "shared": False, + } + + def configure(self): + # minhook is a plain C projects + 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 != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} can only be built on Windows.") + + if self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration(f"{self.ref} can only be built on x86 or x86_64 architectures.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "minhook")) + + def package_info(self): + if self.settings.arch == "x86_64": + postfix = ".x64d" if self.settings.build_type == "Debug" else ".x64" + else: + postfix = ".x32d" if self.settings.build_type == "Debug" else ".x32" + + self.cpp_info.libs = [f"minhook{postfix}"] diff --git a/recipes/minhook/all/test_package/CMakeLists.txt b/recipes/minhook/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a090c65f0323b --- /dev/null +++ b/recipes/minhook/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(minhook REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE minhook::minhook) diff --git a/recipes/minhook/all/test_package/conanfile.py b/recipes/minhook/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d7de1f914ce42 --- /dev/null +++ b/recipes/minhook/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_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) + 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/minhook/all/test_package/test_package.cpp b/recipes/minhook/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..95ccf7f207da6 --- /dev/null +++ b/recipes/minhook/all/test_package/test_package.cpp @@ -0,0 +1,75 @@ +#include + +#include + +#include "MinHook.h" + +typedef int(WINAPI *MESSAGEBOXW)(HWND, LPCWSTR, LPCWSTR, UINT); + +// Pointer for calling original MessageBoxW. +MESSAGEBOXW fpMessageBoxW = NULL; + +// Dummy MessageBox function for testing. +int WINAPI DummyMessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType) +{ + const int box_width = 40; + std::wstring text(lpText); + std::wstring caption(lpCaption); + + // Top border + std::wcout << "+" << std::wstring(box_width - 2, '-') << "+\n"; + + // Caption + std::wcout << "| " << caption << std::wstring(box_width - 3 - caption.size(), ' ') << "|\n"; + std::wcout << "| " << std::wstring(box_width - 4, '=') << " |\n"; + + // Text + std::wcout << "| " << text << std::wstring(box_width - 3 - text.size(), ' ') << "|\n"; + + // Bottom border + std::wcout << "+" << std::wstring(box_width - 2, '-') << "+\n"; + + return IDOK; // The OK button was selected. +} + +// Detour function which overrides MessageBoxW. +int WINAPI DetourMessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType) +{ + return fpMessageBoxW(hWnd, L"Hooked!", lpCaption, uType); +} + +int main() +{ + // Initialize MinHook. + if (MH_Initialize() != MH_OK) { + return 1; + } + + // Create a hook for MessageBoxW, in disabled state. + if (MH_CreateHook(&DummyMessageBoxW, &DetourMessageBoxW, reinterpret_cast(&fpMessageBoxW)) != MH_OK) { + return 1; + } + + // Enable the hook for MessageBoxW. + if (MH_EnableHook(&DummyMessageBoxW) != MH_OK) { + return 1; + } + + // Expected to tell "Hooked!". + DummyMessageBoxW(NULL, L"Not hooked...", L"MinHook Sample", MB_OK); + + // Disable the hook for MessageBoxW. + if (MH_DisableHook(&DummyMessageBoxW) != MH_OK) { + return 1; + } + + // Expected to tell "Not hooked...". + DummyMessageBoxW(NULL, L"Not hooked...", L"MinHook Sample", MB_OK); + + // Uninitialize MinHook. + if (MH_Uninitialize() != MH_OK) { + return 1; + } + + return 0; +} diff --git a/recipes/minhook/config.yml b/recipes/minhook/config.yml new file mode 100644 index 0000000000000..4378f1ec567d7 --- /dev/null +++ b/recipes/minhook/config.yml @@ -0,0 +1,5 @@ +versions: + "1.3.4": + folder: all + "1.3.3.cci.20240629": + folder: all diff --git a/recipes/mini/all/conandata.yml b/recipes/mini/all/conandata.yml new file mode 100644 index 0000000000000..5c54e75793e6e --- /dev/null +++ b/recipes/mini/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "0.9.16": + url: "https://github.com/metayeti/mINI/archive/refs/tags/0.9.16.tar.gz" + sha256: "ce20e12b1e3bcd79d6eaa47bf8d4bb319e843dfa3585e069e73d581bdf0a81ec" + "0.9.15": + url: "https://github.com/metayeti/mINI/archive/refs/tags/0.9.15.tar.gz" + sha256: "241e105ab074827ab8b40582aa7b04c6191f84b244603969965c0874ad4f942c" diff --git a/recipes/mini/all/conanfile.py b/recipes/mini/all/conanfile.py new file mode 100644 index 0000000000000..938a8179ad53f --- /dev/null +++ b/recipes/mini/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 MiniConan(ConanFile): + name = "mini" + description = "INI file reader and writer" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/metayeti/mINI" + topics = ("ini", "writer", "reader", "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, 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"), + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/mini/all/test_package/CMakeLists.txt b/recipes/mini/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b1d6d15b13411 --- /dev/null +++ b/recipes/mini/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mini REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mini::mini) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/mini/all/test_package/conanfile.py b/recipes/mini/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/mini/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/mini/all/test_package/test_package.cpp b/recipes/mini/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ee74c82e08d01 --- /dev/null +++ b/recipes/mini/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include "mini/ini.h" + +int main(void) { + mINI::INIFile file("test_package.ini"); + + std::cout << "mini test successful \n"; + return 0; +} diff --git a/recipes/mini/config.yml b/recipes/mini/config.yml new file mode 100644 index 0000000000000..8e233bb2eb4ca --- /dev/null +++ b/recipes/mini/config.yml @@ -0,0 +1,5 @@ +versions: + "0.9.16": + folder: all + "0.9.15": + folder: all diff --git a/recipes/miniaudio/all/CMakeLists.txt b/recipes/miniaudio/all/CMakeLists.txt index 8e18371d5a460..7651a25211677 100644 --- a/recipes/miniaudio/all/CMakeLists.txt +++ b/recipes/miniaudio/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(miniaudio LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/miniaudio/all/test_package/CMakeLists.txt b/recipes/miniaudio/all/test_package/CMakeLists.txt index a7a69182169b3..baa458bbb8492 100644 --- a/recipes/miniaudio/all/test_package/CMakeLists.txt +++ b/recipes/miniaudio/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(miniaudio REQUIRED CONFIG) diff --git a/recipes/miniaudio/all/test_v1_package/CMakeLists.txt b/recipes/miniaudio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/miniaudio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/miniaudio/all/test_v1_package/conanfile.py b/recipes/miniaudio/all/test_v1_package/conanfile.py deleted file mode 100644 index 0f735b51a2642..0000000000000 --- a/recipes/miniaudio/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -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 tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/minicoro/all/conandata.yml b/recipes/minicoro/all/conandata.yml new file mode 100644 index 0000000000000..26ecba7b50b2a --- /dev/null +++ b/recipes/minicoro/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.3": + url: "https://github.com/edubart/minicoro/archive/refs/tags/v0.1.3.tar.gz" + sha256: "4f9d4c3b5f6473f8141ee45e9947a6e7e7ee6665b4d9a8c373c0602495c5f6c9" diff --git a/recipes/minicoro/all/conanfile.py b/recipes/minicoro/all/conanfile.py new file mode 100644 index 0000000000000..77385609248b9 --- /dev/null +++ b/recipes/minicoro/all/conanfile.py @@ -0,0 +1,40 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "minicoro" + description = "Single header stackful cross-platform coroutine library in pure C" + license = ("Unlicense", "MIT-0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/edubart/minicoro" + topics = ("lua", "coroutine", "fibers", "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 build(self): + pass + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", self.source_folder, os.path.join(self.package_folder, "include", "minicoro")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "minicoro")) diff --git a/recipes/minicoro/all/test_package/CMakeLists.txt b/recipes/minicoro/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2862cc4744006 --- /dev/null +++ b/recipes/minicoro/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(minicoro REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE minicoro::minicoro) diff --git a/recipes/minicoro/all/test_package/conanfile.py b/recipes/minicoro/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/minicoro/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/minicoro/all/test_package/test_package.c b/recipes/minicoro/all/test_package/test_package.c new file mode 100644 index 0000000000000..5c333058e9350 --- /dev/null +++ b/recipes/minicoro/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#define MINICORO_IMPL +#include "minicoro.h" + +#include +#include +#include + +void coro_entry(mco_coro* co) { + printf("coroutine 1\n"); + mco_yield(co); + printf("coroutine 2\n"); +} + +int main(void) { + mco_desc desc = mco_desc_init(coro_entry, 0); + desc.user_data = NULL; + mco_coro* co; + mco_create(&co, &desc); + mco_destroy(co); + + return EXIT_SUCCESS; +} diff --git a/recipes/minicoro/config.yml b/recipes/minicoro/config.yml new file mode 100644 index 0000000000000..b7f57204004e4 --- /dev/null +++ b/recipes/minicoro/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.3": + folder: all diff --git a/recipes/minimp3/all/test_package/CMakeLists.txt b/recipes/minimp3/all/test_package/CMakeLists.txt index 685b8a96689cb..a17cc50ea7dba 100644 --- a/recipes/minimp3/all/test_package/CMakeLists.txt +++ b/recipes/minimp3/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(minimp3 REQUIRED CONFIG) diff --git a/recipes/minimp3/all/test_v1_package/CMakeLists.txt b/recipes/minimp3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 659f9200bc193..0000000000000 --- a/recipes/minimp3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGET) - -find_package(minimp3 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE minimp3::minimp3) diff --git a/recipes/minimp3/all/test_v1_package/conanfile.py b/recipes/minimp3/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/minimp3/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_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/minio-cpp/all/conandata.yml b/recipes/minio-cpp/all/conandata.yml new file mode 100644 index 0000000000000..22b7a6392d759 --- /dev/null +++ b/recipes/minio-cpp/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.3.0": + url: "https://github.com/minio/minio-cpp/archive/refs/tags/v0.3.0.tar.gz" + sha256: "da0f2f54bf169ad9e5e9368cc9143df4db056fc5c05bb55d8c1d9065e7211f7c" +patches: + "0.3.0": + - patch_file: "patches/0.3.0-0001-fix-fpic-cmake.patch" + patch_description: "Honor fPIC option in CMakeLists.txt" + patch_type: "conan" diff --git a/recipes/minio-cpp/all/conanfile.py b/recipes/minio-cpp/all/conanfile.py new file mode 100644 index 0000000000000..4a2fe5179d9aa --- /dev/null +++ b/recipes/minio-cpp/all/conanfile.py @@ -0,0 +1,106 @@ +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 +import os + + +required_conan_version = ">=1.53.0" + + +class MinioCppConan(ConanFile): + name = "minio-cpp" + description = "MinIO C++ Client SDK for Amazon S3 Compatible Cloud Storage" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/minio/minio-cpp" + topics = ("minio", "s3", "storage") + 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 { + "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 layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("curlpp/0.8.1.cci.20240530", transitive_headers=True) + self.requires("inih/58") + self.requires("nlohmann_json/3.11.3", transitive_headers=True) + self.requires("openssl/[>=1.1 <4]") + self.requires("pugixml/1.14") + self.requires("zlib/[>=1.2.11 <2]") + + 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.generate() + deps = CMakeDeps(self) + deps.set_property("curlpp", "cmake_file_name", "unofficial-curlpp") + deps.set_property("curlpp", "cmake_target_name", "unofficial::curlpp::curlpp") + deps.set_property("inih", "cmake_file_name", "unofficial-inih") + deps.set_property("inih", "cmake_target_name", "unofficial::inih::inireader") + deps.set_property("pugixml", "cmake_target_name", "pugixml") + deps.generate() + + def build(self): + apply_conandata_patches(self) + 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["miniocpp"] + + self.cpp_info.set_property("cmake_file_name", "miniocpp") + self.cpp_info.set_property("cmake_target_name", "miniocpp::miniocpp") + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("wsock32") + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/minio-cpp/all/patches/0.3.0-0001-fix-fpic-cmake.patch b/recipes/minio-cpp/all/patches/0.3.0-0001-fix-fpic-cmake.patch new file mode 100644 index 0000000000000..5c39cf7208f2e --- /dev/null +++ b/recipes/minio-cpp/all/patches/0.3.0-0001-fix-fpic-cmake.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c2610db..52bbffa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -124,7 +124,6 @@ target_include_directories(miniocpp PUBLIC + ) + target_link_libraries(miniocpp PUBLIC ${MINIO_CPP_LIBS}) + set_target_properties(miniocpp PROPERTIES VERSION "${MINIO_CPP_VERSION_STRING}") +-set_target_properties(miniocpp PROPERTIES POSITION_INDEPENDENT_CODE ON) + + # Add a cmake alias - this is how users should use minio-cpp in their cmake projects. + add_library(miniocpp::miniocpp ALIAS miniocpp) diff --git a/recipes/minio-cpp/all/test_package/CMakeLists.txt b/recipes/minio-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0c450d7efed7e --- /dev/null +++ b/recipes/minio-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(miniocpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE miniocpp::miniocpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/minio-cpp/all/test_package/conanfile.py b/recipes/minio-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/minio-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/minio-cpp/all/test_package/test_package.cpp b/recipes/minio-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..76e98c39d2ecf --- /dev/null +++ b/recipes/minio-cpp/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +int main(int argc, char* argv[]) { + minio::s3::BaseUrl base_url("example.com"); + + minio::creds::StaticProvider provider("access_key", "secret_key"); + + minio::s3::Client client(base_url, &provider); +} diff --git a/recipes/minio-cpp/config.yml b/recipes/minio-cpp/config.yml new file mode 100644 index 0000000000000..d126790212e0c --- /dev/null +++ b/recipes/minio-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.0": + folder: all diff --git a/recipes/minisat/all/test_package/CMakeLists.txt b/recipes/minisat/all/test_package/CMakeLists.txt index ca1a47d74810a..5c78fd5a9dde5 100644 --- a/recipes/minisat/all/test_package/CMakeLists.txt +++ b/recipes/minisat/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(minisat REQUIRED CONFIG) diff --git a/recipes/minisat/all/test_v1_package/CMakeLists.txt b/recipes/minisat/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/minisat/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/minisat/all/test_v1_package/conanfile.py b/recipes/minisat/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/minisat/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/minitrace/all/test_package/CMakeLists.txt b/recipes/minitrace/all/test_package/CMakeLists.txt index a6a13090703c1..09961594b1b1f 100644 --- a/recipes/minitrace/all/test_package/CMakeLists.txt +++ b/recipes/minitrace/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) diff --git a/recipes/minitrace/all/test_v1_package/CMakeLists.txt b/recipes/minitrace/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/minitrace/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/minitrace/all/test_v1_package/conanfile.py b/recipes/minitrace/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/minitrace/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_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/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/CMakeLists.txt b/recipes/miniupnpc/all/test_package/CMakeLists.txt index 772ac228b58ae..6d403c49f9b93 100644 --- a/recipes/miniupnpc/all/test_package/CMakeLists.txt +++ b/recipes/miniupnpc/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(miniupnpc REQUIRED CONFIG) 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/all/test_v1_package/CMakeLists.txt b/recipes/miniupnpc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/miniupnpc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/miniupnpc/all/test_v1_package/conanfile.py b/recipes/miniupnpc/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/miniupnpc/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_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/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/miniz/all/conanfile.py b/recipes/miniz/all/conanfile.py index a90739b0d0d4e..154f2e7352b2e 100644 --- a/recipes/miniz/all/conanfile.py +++ b/recipes/miniz/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class MinizConan(ConanFile): @@ -16,6 +16,7 @@ class MinizConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/richgel999/miniz" topics = ("zlib", "compression", "lossless") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -56,6 +57,8 @@ def generate(self): tc.variables["INSTALL_PROJECT"] = 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" + if Version(self.version) <= "3.0.2": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): diff --git a/recipes/miniz/all/test_package/CMakeLists.txt b/recipes/miniz/all/test_package/CMakeLists.txt index 90738d68add27..5c3204732c82e 100644 --- a/recipes/miniz/all/test_package/CMakeLists.txt +++ b/recipes/miniz/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(miniz REQUIRED CONFIG) diff --git a/recipes/miniz/all/test_v1_package/CMakeLists.txt b/recipes/miniz/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/miniz/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/miniz/all/test_v1_package/conanfile.py b/recipes/miniz/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/miniz/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_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/minizip-ng/all/conandata.yml b/recipes/minizip-ng/all/conandata.yml index 3d2b61dbae697..1444e30040e96 100644 --- a/recipes/minizip-ng/all/conandata.yml +++ b/recipes/minizip-ng/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "4.0.7": + url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.7.tar.gz" + sha256: "a87f1f734f97095fe1ef0018217c149d53d0f78438bcb77af38adc21dff2dfbc" + "4.0.6": + url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.6.tar.gz" + sha256: "e96ed3866706a67dbed05bf035e26ef6b60f408e1381bf0fe9af17fe2c0abebc" + "4.0.5": + url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.5.tar.gz" + sha256: "9bb636474b8a4269280d32aca7de4501f5c24cc642c9b4225b4ed7b327f4ee73" + "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" @@ -11,6 +23,9 @@ sources: "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" @@ -20,16 +35,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" 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" @@ -46,27 +56,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" diff --git a/recipes/minizip-ng/all/conanfile.py b/recipes/minizip-ng/all/conanfile.py index 01cfddc75128c..11cc0555a2c52 100644 --- a/recipes/minizip-ng/all/conanfile.py +++ b/recipes/minizip-ng/all/conanfile.py @@ -94,7 +94,7 @@ def requirements(self): def build_requirements(self): if self._needs_pkg_config: - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") if Version(self.version) >= "4.0.0": self.tool_requires("cmake/[>=3.19 <4]") @@ -162,8 +162,8 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", "minizip") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - prefix = "lib" if is_msvc(self) or self._is_clang_cl else "" - suffix = "" if Version(self.version) < "3.0.5" or self.options.mz_compatibility else "-ng" + prefix = "lib" if Version(self.version) < "4.0.7" and (is_msvc(self) or self._is_clang_cl) else "" + suffix = "" if self.options.mz_compatibility else "-ng" self.cpp_info.components["minizip"].libs = [f"{prefix}minizip{suffix}"] if self.options.with_lzma: self.cpp_info.components["minizip"].defines.append("HAVE_LZMA") @@ -197,6 +197,8 @@ def package_info(self): self.cpp_info.components["minizip"].requires.append("openssl::openssl") elif is_apple_os(self): self.cpp_info.components["minizip"].frameworks.extend(["CoreFoundation", "Security"]) + elif self.settings.os == "Windows": + self.cpp_info.components["minizip"].system_libs.append("crypt32") 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-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.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/all/test_package/CMakeLists.txt b/recipes/minizip-ng/all/test_package/CMakeLists.txt index db0b9a15e540e..b9d8ee63213b4 100644 --- a/recipes/minizip-ng/all/test_package/CMakeLists.txt +++ b/recipes/minizip-ng/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 C) find_package(minizip REQUIRED CONFIG) diff --git a/recipes/minizip-ng/config.yml b/recipes/minizip-ng/config.yml index 30253cff927d4..9b580772b2d89 100644 --- a/recipes/minizip-ng/config.yml +++ b/recipes/minizip-ng/config.yml @@ -1,4 +1,12 @@ versions: + "4.0.7": + folder: all + "4.0.6": + folder: all + "4.0.5": + folder: all + "4.0.4": + folder: all "4.0.3": folder: all "4.0.2": @@ -7,15 +15,11 @@ versions: folder: all "4.0.0": folder: all + "3.0.10": + folder: all "3.0.9": folder: all "3.0.8": folder: all "3.0.7": folder: all - "3.0.6": - folder: all - "3.0.5": - folder: all - "3.0.4": - folder: all diff --git a/recipes/minizip/all/CMakeLists.txt b/recipes/minizip/all/CMakeLists.txt index c17b5f7dd7466..6153ea1af3dc1 100644 --- a/recipes/minizip/all/CMakeLists.txt +++ b/recipes/minizip/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(minizip LANGUAGES C) option(MINIZIP_ENABLE_BZIP2 "Build minizip with bzip2 support" ON) diff --git a/recipes/minizip/all/conandata.yml b/recipes/minizip/all/conandata.yml index d1d3166de347b..f8773fd58975f 100644 --- a/recipes/minizip/all/conandata.yml +++ b/recipes/minizip/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.1": + url: "https://zlib.net/fossils/zlib-1.3.1.tar.gz" + sha256: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23" "1.2.13": url: "https://zlib.net/fossils/zlib-1.2.13.tar.gz" sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30" @@ -9,6 +12,8 @@ sources: url: "https://zlib.net/fossils/zlib-1.2.11.tar.gz" sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" patches: + "1.3.1": + - patch_file: "patches/minizip.patch" "1.2.13": - patch_file: "patches/minizip.patch" "1.2.12": diff --git a/recipes/minizip/all/test_package/CMakeLists.txt b/recipes/minizip/all/test_package/CMakeLists.txt index b56bb073cf606..e6fa68da9d35e 100644 --- a/recipes/minizip/all/test_package/CMakeLists.txt +++ b/recipes/minizip/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(minizip REQUIRED CONFIG) diff --git a/recipes/minizip/all/test_v1_package/CMakeLists.txt b/recipes/minizip/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/minizip/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/minizip/all/test_v1_package/conanfile.py b/recipes/minizip/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/minizip/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_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/minizip/config.yml b/recipes/minizip/config.yml index 351c06f68201f..bd5341271951d 100644 --- a/recipes/minizip/config.yml +++ b/recipes/minizip/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.1": + folder: all "1.2.13": folder: all "1.2.12": diff --git a/recipes/minmea/all/conandata.yml b/recipes/minmea/all/conandata.yml new file mode 100644 index 0000000000000..f6a2a3a0d5950 --- /dev/null +++ b/recipes/minmea/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "0.3.0.cci.20230620": + url: "https://github.com/kosma/minmea/archive/e368d847d75abd891c651f7d30ce5efb6681adb7.tar.gz" + sha256: "9b845dfc7f4475c17710a0ac0823b11a6946df7b20dfacd02b03921826eeab3a" +patches: + "0.3.0.cci.20230620": + - patch_file: "patches/001-disable-pkgconfig-libcheck.patch" + patch_description: "Do not search for libcheck - Exclusive for testing" + patch_type: "conan" + - patch_file: "patches/002-windows-support.patch" + patch_description: "Manage compat header file for Windows" + patch_type: "portability" diff --git a/recipes/minmea/all/conanfile.py b/recipes/minmea/all/conanfile.py new file mode 100644 index 0000000000000..30eb575863037 --- /dev/null +++ b/recipes/minmea/all/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + +class MinmeaConan(ConanFile): + name = "minmea" + description = "a lightweight GPS NMEA 0183 parser library in pure C" + license = ("WTFPL", "MIT", "LGPL-3.0-or-later") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kosma/minmea" + topics = ("gps", "NMEA", "parser") + 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.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + # INFO: Windows mingw supported: https://github.com/kosma/minmea?tab=readme-ov-file#compatibility + # INFO: MSVC fails with error C2011: 'timespec': 'struct' type redefinition + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} can not be built on Visual Studio and msvc. Use mingw instead or similar.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + if self.settings.os == "Windows": + tc.preprocessor_definitions["MINMEA_INCLUDE_COMPAT"] = "1" + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build(target="minmea") + + 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")) + copy(self, "minmea.h", self.source_folder, os.path.join(self.package_folder, "include")) + copy(self, "libminmea.a", self.build_folder, os.path.join(self.package_folder, "lib")) + copy(self, "libminmea.so", self.build_folder, os.path.join(self.package_folder, "lib")) + copy(self, "libminmea.dylib", self.build_folder, os.path.join(self.package_folder, "lib")) + if self.settings.os == "Windows": + copy(self, "libminmea.dll.a", self.build_folder, os.path.join(self.package_folder, "lib")) + copy(self, "libminmea.dll", self.build_folder, os.path.join(self.package_folder, "bin")) + copy(self, "minmea_compat.h", self.source_folder, os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.libs = ["minmea"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + if self.settings.os == "Windows": + self.cpp_info.defines = ["MINMEA_INCLUDE_COMPAT=1"] diff --git a/recipes/minmea/all/patches/001-disable-pkgconfig-libcheck.patch b/recipes/minmea/all/patches/001-disable-pkgconfig-libcheck.patch new file mode 100644 index 0000000000000..7e3f4636a811b --- /dev/null +++ b/recipes/minmea/all/patches/001-disable-pkgconfig-libcheck.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b96e1d7..4674f49 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,6 @@ project(minmea) + + find_package(Threads REQUIRED) # Workaround for https://github.com/libcheck/check/issues/48#issuecomment-322965461 + find_package(PkgConfig) +-pkg_check_modules(CHECK REQUIRED check) + link_directories(${CHECK_LIBRARY_DIRS}) + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -Wextra -Werror -std=c99") diff --git a/recipes/minmea/all/patches/002-windows-support.patch b/recipes/minmea/all/patches/002-windows-support.patch new file mode 100644 index 0000000000000..8f7360ca6288d --- /dev/null +++ b/recipes/minmea/all/patches/002-windows-support.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4674f49..895b835 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,6 +13,11 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -D_D + + set(minmea_SRCS minmea.c minmea.h) + add_library(minmea ${minmea_SRCS}) ++target_include_directories(minmea PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) ++if (WIN32) ++ configure_file(compat/minmea_compat_windows.h ${CMAKE_CURRENT_SOURCE_DIR}/minmea_compat.h COPYONLY) ++ target_compile_definitions(minmea PRIVATE MINMEA_INCLUDE_COMPAT) ++endif() + + add_executable(example example.c) + target_link_libraries(example minmea) diff --git a/recipes/minmea/all/test_package/CMakeLists.txt b/recipes/minmea/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..62bf6147b6fb5 --- /dev/null +++ b/recipes/minmea/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(minmea REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE minmea::minmea) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/minmea/all/test_package/conanfile.py b/recipes/minmea/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/minmea/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/minmea/all/test_package/test_package.c b/recipes/minmea/all/test_package/test_package.c new file mode 100644 index 0000000000000..9c222e438c9ae --- /dev/null +++ b/recipes/minmea/all/test_package/test_package.c @@ -0,0 +1,16 @@ +#include +#include "minmea.h" + + +int main(void) { + char* nmea_data = "$GPGGA,155246.585,5231.171,N,01321.830,E,1,12,1.0,0.0,M,0.0,M,,*6F"; + + if (minmea_sentence_id(nmea_data, false) == MINMEA_SENTENCE_GGA) { + struct minmea_sentence_gga frame; + if (minmea_parse_gga(&frame, nmea_data)) { + printf("$GGA: fix quality: %d\n", frame.fix_quality); + } + } + + return 0; +} diff --git a/recipes/minmea/config.yml b/recipes/minmea/config.yml new file mode 100644 index 0000000000000..85c5d6a070371 --- /dev/null +++ b/recipes/minmea/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.0.cci.20230620": + folder: all diff --git a/recipes/mio/all/test_package/CMakeLists.txt b/recipes/mio/all/test_package/CMakeLists.txt index dd4a0cd1a355b..d32378d3d12d2 100644 --- a/recipes/mio/all/test_package/CMakeLists.txt +++ b/recipes/mio/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(mio REQUIRED CONFIG) diff --git a/recipes/mio/all/test_v1_package/CMakeLists.txt b/recipes/mio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/mio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mio/all/test_v1_package/conanfile.py b/recipes/mio/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mio/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_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/mlpack/all/conandata.yml b/recipes/mlpack/all/conandata.yml new file mode 100644 index 0000000000000..13e81aa865d9c --- /dev/null +++ b/recipes/mlpack/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "4.4.0": + url: "https://github.com/mlpack/mlpack/archive/refs/tags/4.4.0.tar.gz" + sha256: "61c604026d05af26c244b0e47024698bbf150dfcc9d77b64057941d7d64d6cf6" + "4.3.0": + url: "https://github.com/mlpack/mlpack/archive/refs/tags/4.3.0.tar.gz" + sha256: "08cd54f711fde66fc3b6c9db89dc26776f9abf1a6256c77cfa3556e2a56f1a3d" diff --git a/recipes/mlpack/all/conanfile.py b/recipes/mlpack/all/conanfile.py new file mode 100644 index 0000000000000..a09b0e5a3296c --- /dev/null +++ b/recipes/mlpack/all/conanfile.py @@ -0,0 +1,119 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + + +class MlpackConan(ConanFile): + name = "mlpack" + description = "mlpack: a fast, header-only C++ machine learning library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mlpack/mlpack" + topics = ("machine-learning", "deep-learning", "regression", "nearest-neighbor-search", "scientific-computing", "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) >= "4.4.0": + return 17 + if is_msvc(self): + return 17 + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "5", + "clang": "5", + "apple-clang": "5", + "msvc": "191", + "Visual Studio": "15", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("armadillo/12.6.4") + self.requires("cereal/1.3.2") + self.requires("ensmallen/2.21.0") + self.requires("stb/cci.20230920") + # TODO: MSVC OpenMP is not compatible, enable for MSVC after #22353 + if not is_msvc(self): + self.requires("llvm-openmp/17.0.6") + + 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 not self.dependencies["armadillo"].options.use_blas or not self.dependencies["armadillo"].options.use_lapack: + raise ConanInvalidConfiguration("mlpack requires armadillo to be built with BLAS and LAPACK support.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _configure_headers(self): + # https://github.com/mlpack/mlpack/blob/4.3.0/src/mlpack/config.hpp + config_hpp = os.path.join(self.package_folder, "include", "mlpack", "config.hpp") + replace_in_file(self, config_hpp, "// #define MLPACK_HAS_STB", "#define MLPACK_HAS_STB") + replace_in_file(self, config_hpp, "// #define MLPACK_HAS_NO_STB_DIR", "// #define MLPACK_HAS_NO_STB_DIR") + + def package(self): + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", + os.path.join(self.source_folder, "src"), + os.path.join(self.package_folder, "include"), + excludes=["mlpack/bindings/*", "mlpack/tests/*", "mlpack/CMakeLists.txt"]) + self._configure_headers() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mlpack") + self.cpp_info.set_property("cmake_target_name", "mlpack::mlpack") + self.cpp_info.set_property("pkg_config_name", "mlpack") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + + if self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"]: + self.cpp_info.system_libs.append("atomic") + + # FIXME: Review this flags assignment. LLVM-OpenMP is already defining these ones. + # Do we want to depend on llvm-openmp? Only for apple-clang? + # For more info, see this comment https://github.com/conan-io/conan-center-index/pull/22353#issuecomment-2214593855 + flags = [] + # Based on https://github.com/Kitware/CMake/blob/v3.28.1/Modules/FindOpenMP.cmake#L104-L135 + if self.settings.compiler == "clang": + flags = ["-fopenmp=libomp"] + elif self.settings.compiler == "gcc": + flags = ["-fopenmp"] + if self.settings.os == "Windows": + flags.append("-Wa,-mbig-obj") + elif self.settings.compiler == "sun-cc": + flags = ["-xopenmp"] + elif is_msvc(self): + # https://github.com/mlpack/mlpack/blob/4.3.0/CMakeLists.txt#L164-L175 + flags = ["-openmp:llvm", "/bigobj", "/Zm200", "/Zc:__cplusplus"] + if flags: + self.cpp_info.cflags = flags + self.cpp_info.cxxflags = flags diff --git a/recipes/mlpack/all/test_package/CMakeLists.txt b/recipes/mlpack/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a68462fb67d65 --- /dev/null +++ b/recipes/mlpack/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mlpack REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mlpack::mlpack) +if(MSVC OR mlpack_VERSION VERSION_GREATER_EQUAL 4.4.0) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/mlpack/all/test_package/conanfile.py b/recipes/mlpack/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/mlpack/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/mlpack/all/test_package/test_package.cpp b/recipes/mlpack/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b5b09f906a9df --- /dev/null +++ b/recipes/mlpack/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +using namespace mlpack; + +int main() +{ + const size_t numClasses = 2; + const size_t minimumLeafSize = 5; + const size_t numTrees = 10; + + arma::mat dataset; + arma::Row labels, predictions; + RandomForest rf(dataset, labels, numClasses, numTrees, minimumLeafSize); + rf.Classify(dataset, predictions); +} diff --git a/recipes/mlpack/config.yml b/recipes/mlpack/config.yml new file mode 100644 index 0000000000000..e9bbd51f309ab --- /dev/null +++ b/recipes/mlpack/config.yml @@ -0,0 +1,5 @@ +versions: + "4.4.0": + folder: all + "4.3.0": + folder: all diff --git a/recipes/mocknetworkaccessmanager/all/conandata.yml b/recipes/mocknetworkaccessmanager/all/conandata.yml new file mode 100644 index 0000000000000..74e9cd9518faf --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/conandata.yml @@ -0,0 +1,14 @@ +sources: + "0.12.0": + url: "https://gitlab.com/julrich/MockNetworkAccessManager/-/archive/0.12.0/MockNetworkAccessManager-0.12.0.tar.gz" + sha256: "ac9ffb5e6e5ccdc1b7c76da7a92b5d845ec12eb48a39b0423005da4f6431b09f" +patches: + "0.12.0": + - patch_file: "patches/0.12.0-0001-add-install-step.patch" + patch_description: "Add install step" + patch_type: "conan" + patch_source: "https://gitlab.com/julrich/MockNetworkAccessManager/-/merge_requests/75" + - patch_file: "patches/0.12.0-0002-fix-target-without-location.patch" + patch_description: "Fix target without location" + patch_type: "conan" + patch_source: "https://gitlab.com/julrich/MockNetworkAccessManager/-/merge_requests/75" diff --git a/recipes/mocknetworkaccessmanager/all/conanfile.py b/recipes/mocknetworkaccessmanager/all/conanfile.py new file mode 100644 index 0000000000000..11510320e6ea3 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/conanfile.py @@ -0,0 +1,72 @@ +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 +import os + + +required_conan_version = ">=1.52.0" + + +class MockNetworkAccessManagerConan(ConanFile): + name = "mocknetworkaccessmanager" + description = "Mocking network communication for Qt applications" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.com/julrich/MockNetworkAccessManager" + topics = ("qt", "mock", "network", "QNetworkAccessManager", "unit test", "test") + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + "with_qt": [5, 6], + } + default_options = { + "fPIC": True, + "with_qt": 5, + } + + 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): + if self.options.with_qt == 5: + self.requires("qt/[~5.15]", transitive_headers=True) + else: + self.requires("qt/[>=6.6 <7]", transitive_headers=True) + + 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.variables["BUILD_TESTING"] = False + tc.variables["FORCE_QT5"] = self.options.with_qt == 5 + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["MockNetworkAccessManager"] diff --git a/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0001-add-install-step.patch b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0001-add-install-step.patch new file mode 100644 index 0000000000000..5ab7046d5c273 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0001-add-install-step.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 61ed3ed..6d0de20 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,3 +107,10 @@ add_library( MockNetworkAccessManager STATIC EXCLUDE_FROM_ALL "MockNetworkAccess + target_include_directories( MockNetworkAccessManager PUBLIC "${PROJECT_SOURCE_DIR}" ) + target_link_libraries( MockNetworkAccessManager Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network ) + ++install(TARGETS MockNetworkAccessManager ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ ++install(FILES "${PROJECT_SOURCE_DIR}/MockNetworkAccessManager.hpp" ++ DESTINATION include) ++ diff --git a/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0002-fix-target-without-location.patch b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0002-fix-target-without-location.patch new file mode 100644 index 0000000000000..30e7bf6374a71 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/patches/0.12.0-0002-fix-target-without-location.patch @@ -0,0 +1,20 @@ +commit e28d1f3868db8c7f5ff654a205d80d5d7ed203c4 +Author: Martin Delille +Date: Fri Jan 19 18:06:56 2024 +0100 + + Fix target without LOCATION property + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6d0de20..dbfbed3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,8 +26,7 @@ if( NOT Qt5_FOUND OR NOT Qt6_FOUND ) + find_package( Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network ) + endif() + +-get_target_property( QTCORE_LOCATION Qt${QT_VERSION_MAJOR}::Core LOCATION ) +-get_filename_component( QT_BIN_DIR ${QTCORE_LOCATION} DIRECTORY ) ++get_filename_component(QT_BIN_DIR "$" ABSOLUTE) + set( CMAKE_MSVCIDE_RUN_PATH ${QT_BIN_DIR} ) + set_property( DIRECTORY "." APPEND PROPERTY COMPILE_DEFINITIONS "QT_DEPRECATED_WARNINGS" ) + diff --git a/recipes/mocknetworkaccessmanager/all/test_package/CMakeLists.txt b/recipes/mocknetworkaccessmanager/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..679b5058fe4c8 --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mocknetworkaccessmanager REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mocknetworkaccessmanager::mocknetworkaccessmanager) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/mocknetworkaccessmanager/all/test_package/conanfile.py b/recipes/mocknetworkaccessmanager/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/mocknetworkaccessmanager/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/mocknetworkaccessmanager/all/test_package/test_package.cpp b/recipes/mocknetworkaccessmanager/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..16d39eccc870f --- /dev/null +++ b/recipes/mocknetworkaccessmanager/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include "MockNetworkAccessManager.hpp" + +int main(int argc, char *argv[]) { + QCoreApplication app(argc, argv); + MockNetworkAccess::Manager< QNetworkAccessManager > mnam; + + mnam.whenGet( QUrl( "http://example.com/hello" ) ) + .has( MockNetworkAccess::Predicates::HeaderMatching( QNetworkRequest::UserAgentHeader, + QRegularExpression( ".*MyNetworkClient/.*" ) ) ) + .reply().withBody( QJsonDocument::fromJson( "{\"hello\":\"world\"}" ) ); + + return 0; +} diff --git a/recipes/mocknetworkaccessmanager/config.yml b/recipes/mocknetworkaccessmanager/config.yml new file mode 100644 index 0000000000000..bd3e719c29dbd --- /dev/null +++ b/recipes/mocknetworkaccessmanager/config.yml @@ -0,0 +1,3 @@ +versions: + "0.12.0": + folder: all diff --git a/recipes/modern-cpp-kafka/all/conandata.yml b/recipes/modern-cpp-kafka/all/conandata.yml index 11b37a50dbe81..9477b5d2f991b 100644 --- a/recipes/modern-cpp-kafka/all/conandata.yml +++ b/recipes/modern-cpp-kafka/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2024.07.03": + url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2024.07.03.tar.gz" + sha256: "06b89b5f2757d2107761d65869b98c3ec71e3c8c7e2cb2ab49277f3272044f02" "2023.03.07": url: "https://github.com/morganstanley/modern-cpp-kafka/archive/v2023.03.07.tar.gz" sha256: "4685527a9768d44ed769ec6e502c3edde0b5cf4d341d8f9b476474955c61bba4" diff --git a/recipes/modern-cpp-kafka/config.yml b/recipes/modern-cpp-kafka/config.yml index a01e300c4e30c..0f76703e92e08 100644 --- a/recipes/modern-cpp-kafka/config.yml +++ b/recipes/modern-cpp-kafka/config.yml @@ -1,4 +1,6 @@ versions: + "2024.07.03": + folder: all "2023.03.07": folder: all "2023.01.05": diff --git a/recipes/mold/README.md b/recipes/mold/README.md new file mode 100644 index 0000000000000..8a1ee68e8c4ed --- /dev/null +++ b/recipes/mold/README.md @@ -0,0 +1,22 @@ +# mold: A Modern Linker + +mold is a faster drop-in replacement for existing Unix linkers. It is several +times quicker than the LLVM lld linker, the second-fastest open-source linker. +mold aims to enhance developer productivity by minimizing build time, +particularly in rapid debug-edit-rebuild cycles. + +You can configure Conan to download the latest version of `mold` and use it as the linker +when building your dependencies and projects from source. Currently only supported +when targeting Linux as the platform. + +To use mold automatically as the linker, you can add the following section to your +_host_ profile that targets Linux. When using gcc, please note that the following +flags require gcc 12.1 or greater. + +``` +[tool_requires] +*:mold/[*] +[conf] +tools.build:exelinkflags=['-fuse-ld=mold'] +tools.build:sharedlinkflags=['-fuse-ld=mold'] +``` diff --git a/recipes/mold/all/conandata.yml b/recipes/mold/all/conandata.yml index 3cb117fe8e4d9..9fb71fa0ea221 100644 --- a/recipes/mold/all/conandata.yml +++ b/recipes/mold/all/conandata.yml @@ -1,19 +1,28 @@ sources: + "2.36.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.36.0.tar.gz" + sha256: "3f57fe75535500ecce7a80fa1ba33675830b7d7deb1e5ee9a737e2bc43cdb1c7" + "2.34.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.34.1.tar.gz" + sha256: "a8cf638045b4a4b2697d0bcc77fd96eae93d54d57ad3021bf03b0333a727a59d" + "2.33.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.33.0.tar.gz" + sha256: "37b3aacbd9b6accf581b92ba1a98ca418672ae330b78fe56ae542c2dcb10a155" + "2.32.1": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.32.1.tar.gz" + sha256: "f3c9a527d884c635834fe7d79b3de959b00783bf9446280ea274d996f0335825" + "2.32.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.32.0.tar.gz" + sha256: "4b7e4146ea0f52be9adae8b417399f3676a041e65b55e3f25f088120d30a320b" + "2.31.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.31.0.tar.gz" + sha256: "3dc3af83a5d22a4b29971bfad17261851d426961c665480e2ca294e5c74aa1e5" + "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" - "1.5.1": - url: "https://github.com/rui314/mold/archive/refs/tags/v1.5.1.tar.gz" - sha256: "ec94aa74758f1bc199a732af95c6304ec98292b87f2f4548ce8436a7c5b054a1" - "1.7.1": - url: "https://github.com/rui314/mold/archive/refs/tags/v1.7.1.tar.gz" - sha256: "fa2558664db79a1e20f09162578632fa856b3cde966fbcb23084c352b827dfa9" - "1.8.0": - url: "https://github.com/rui314/mold/archive/refs/tags/v1.8.0.tar.gz" - sha256: "7210225478796c2528aae30320232a5a3b93a640292575a8c55aa2b140041b5c" "1.11.0": url: "https://github.com/rui314/mold/archive/refs/tags/v1.11.0.tar.gz" sha256: "99318eced81b09a77e4c657011076cc8ec3d4b6867bd324b8677974545bc4d6f" diff --git a/recipes/mold/all/conanfile.py b/recipes/mold/all/conanfile.py index a760cce0d4728..5c29306c7a980 100644 --- a/recipes/mold/all/conanfile.py +++ b/recipes/mold/all/conanfile.py @@ -1,12 +1,13 @@ import os from conan import ConanFile +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps from conan.tools.files import copy, get, rmdir from conan.errors import ConanInvalidConfiguration from conan.tools.scm import Version from conan.tools.env import VirtualBuildEnv -required_conan_version = ">=1.47.0" +required_conan_version = ">2.0" class MoldConan(ConanFile): @@ -40,30 +41,36 @@ def layout(self): 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") + if Version(self.version) < "2.2.0": + # Newer versions use vendored-in BLAKE3 + self.requires("openssl/[>=1.1 <4]") 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 - # 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') + def validate_build(self): + # perform these checks in validate_build() - since the compiler is removed from the package_id, + # this lets the compatibility plugin consider the executable built with other compilers + if Version(self.version) >= "2.34.0": + # mold has required C+20 since 1.4.1. However, C++20 features are used for the first time in 2.34.0. + check_min_cppstd(self, 20) 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": + if self.settings.compiler == "msvc": 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 in ('clang', 'apple-clang') and Version(self.settings.compiler.version) < "12": raise ConanInvalidConfiguration("Clang version 12 or higher required") + if Version(self.version) >= "2.34.0" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14": + raise ConanInvalidConfiguration("Apple-Clang version 14 or higher required due to C++20 features") if self.settings.compiler == "apple-clang" and "armv8" == self.settings.arch : raise ConanInvalidConfiguration(f'{self.name} is still not supported by Mac M1.') + if Version(self.version) == "2.33.0" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14": + raise ConanInvalidConfiguration(f'{self.ref} doesn\'t support Apple-Clang < 14.') def build_requirements(self): self.tool_requires("cmake/[>=3.18.0 <4]") @@ -75,7 +82,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["MOLD_USE_MIMALLOC"] = self.options.with_mimalloc tc.variables["MOLD_USE_SYSTEM_MIMALLOC"] = True - tc.variables["MOLD_USE_SYSTEM_TBB"] = True + tc.variables["MOLD_USE_SYSTEM_TBB"] = False # see https://github.com/conan-io/conan-center-index/pull/23575#issuecomment-2059154281 tc.variables["CMAKE_INSTALL_LIBEXECDIR"] = "libexec" tc.generate() @@ -112,8 +119,3 @@ def package_info(self): 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 551d50ce9428a..639ee9ae7461f 100644 --- a/recipes/mold/all/test_package/conanfile.py +++ b/recipes/mold/all/test_package/conanfile.py @@ -4,12 +4,10 @@ class MoldTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "VirtualBuildEnv" - test_type = "explicit" - def build_requirements(self): - self.tool_requires(self.tested_reference_str) + def requirements(self): + self.requires(self.tested_reference_str) def test(self): if can_run(self): - self.run("mold -v") + self.run("mold -v", env="conanrun") diff --git a/recipes/mold/all/test_v1_package/conanfile.py b/recipes/mold/all/test_v1_package/conanfile.py deleted file mode 100644 index ce72e1030b169..0000000000000 --- a/recipes/mold/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -import os -from conans import ConanFile, tools -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/config.yml b/recipes/mold/config.yml index eb4087643c784..009c4c3230052 100644 --- a/recipes/mold/config.yml +++ b/recipes/mold/config.yml @@ -1,13 +1,19 @@ versions: - "2.0.0": + "2.36.0": + folder: all + "2.34.1": + folder: all + "2.33.0": folder: all - "1.4.2": + "2.32.1": folder: all - "1.5.1": + "2.32.0": folder: all - "1.7.1": + "2.31.0": folder: all - "1.8.0": + "2.4.0": + folder: all + "2.0.0": folder: all "1.11.0": folder: all diff --git a/recipes/moltenvk/all/conandata.yml b/recipes/moltenvk/all/conandata.yml index cc7f779fc2f3a..f00f13232e63f 100644 --- a/recipes/moltenvk/all/conandata.yml +++ b/recipes/moltenvk/all/conandata.yml @@ -11,68 +11,30 @@ sources: "1.1.11": url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.11.tar.gz" sha256: "938ea0ba13c6538b0ee505ab391a3020f206ab9d29c869f20dd19318a4ee8997" - "1.1.10": - url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.10.tar.gz" - sha256: "fac11c2501195c9ce042103685c7778e35484562e6c084963a22072dd0a602e0" - "1.1.9": - url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.9.tar.gz" - sha256: "ea455a14decb85ec4bc66ffd2b963492afa7b53297b7064a11ca47ca8d2464ea" - "1.1.8": - url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.8.tar.gz" - sha256: "f316c814d0cb6d60a0e8ad164d8cafa64010dee9dd41748b038b6b67fa40f08a" - "1.1.6": - url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.6.tar.gz" - sha256: "b60df3ac93b943eb14377019445533b5c451fffd6b1df86187b1b9ac7d6dba6b" - "1.1.5": - url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.5.tar.gz" - sha256: "2cdcb8dbf2acdcd8cbe70b109dadc05a901038c84970afbe4863e5e23f33deae" - "1.1.4": - url: "https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/v1.1.4.tar.gz" - sha256: "f9bba6d3bf3648e7685c247cb6d126d62508af614bc549cedd5859a7da64967e" - "1.1.1": - url: "https://github.com/KhronosGroup/MoltenVK/archive/v1.1.1.tar.gz" - sha256: "cd1712c571d4155f4143c435c8551a5cb8cbb311ad7fff03595322ab971682c0" - "1.1.0": - url: "https://github.com/KhronosGroup/MoltenVK/archive/v1.1.0.tar.gz" - sha256: "0538fa1c23ddae495c7f82ccd0db90790a90b7017a258ca7575fbae8021f3058" patches: + "1.2.2": + - patch_file: "patches/1.2.2-0001-MVKSmallVector-Make-iterator-const-correct.patch" + patch_description: "Fix build errors in Xcode 15.3 beta" + patch_type: "portability" + patch_source: "https://github.com/KhronosGroup/MoltenVK/issues/2156" + "1.2.1": + - patch_file: "patches/1.2.2-0001-MVKSmallVector-Make-iterator-const-correct.patch" + patch_description: "Fix build errors in Xcode 15.3 beta" + patch_type: "portability" + patch_source: "https://github.com/KhronosGroup/MoltenVK/issues/2156" "1.2.0": - patch_file: "patches/1.2.0-0001-fix-version-number-icd-json.patch" patch_description: "Fix api_version in MoltenVK_icd.json" patch_type: "portability" patch_source: "https://github.com/KhronosGroup/MoltenVK/pull/1747" + - patch_file: "patches/1.2.2-0001-MVKSmallVector-Make-iterator-const-correct.patch" + patch_description: "Fix build errors in Xcode 15.3 beta" + patch_type: "portability" + patch_source: "https://github.com/KhronosGroup/MoltenVK/issues/2156" "1.1.11": - patch_file: "patches/1.1.11-0001-vulkan-alias-private-extern.patch" patch_description: "Fix vulkan alias symbols when vulkan symbols are hidden" patch_type: "portability" - "1.1.10": - - patch_file: "patches/1.1.8-0002-vulkan-alias-private-extern.patch" - patch_description: "Fix vulkan alias symbols when vulkan symbols are hidden" - patch_type: "portability" - "1.1.9": - - patch_file: "patches/1.1.8-0002-vulkan-alias-private-extern.patch" - patch_description: "Fix vulkan alias symbols when vulkan symbols are hidden" - patch_type: "portability" - "1.1.8": - - patch_file: "patches/1.1.8-0001-allow-c++11-std.patch" - patch_description: "Allow to compile with C++11" - patch_type: "portability" - - patch_file: "patches/1.1.8-0002-vulkan-alias-private-extern.patch" - patch_description: "Fix vulkan alias symbols when vulkan symbols are hidden" - patch_type: "portability" - "1.1.6": - - patch_file: "patches/1.1.6-0001-allow-c++11-std.patch" - patch_description: "Allow to compile with C++11" - patch_type: "portability" - "1.1.5": - - patch_file: "patches/1.1.5-0001-allow-c++11-std.patch" - patch_description: "Allow to compile with C++11" + - patch_file: "patches/1.1.11-fix-MVKSmallVector.patch" + patch_description: "Fix MVKSmallVector build errors for Xcode 15.3" patch_type: "portability" - "1.1.1": - - patch_file: "patches/1.1.0-0001-fix-spirv-cross-includes.patch" - patch_description: "Use spirv-cross include convention" - patch_type: "conan" - "1.1.0": - - patch_file: "patches/1.1.0-0001-fix-spirv-cross-includes.patch" - patch_description: "Use spirv-cross include convention" - patch_type: "conan" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.0.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.0.yml deleted file mode 100644 index d8c73818a1f7e..0000000000000 --- a/recipes/moltenvk/all/dependencies/dependencies-1.1.0.yml +++ /dev/null @@ -1,4 +0,0 @@ -glslang: "8.13.3559" -spirv-cross: "20200917" -spirv-tools: "2020.5" -vulkan-headers: "1.2.154.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.1.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.1.yml deleted file mode 100644 index 3dd4ee92f5875..0000000000000 --- a/recipes/moltenvk/all/dependencies/dependencies-1.1.1.yml +++ /dev/null @@ -1,4 +0,0 @@ -glslang: "8.13.3559" -spirv-cross: "20210115" -spirv-tools: "2020.5" -vulkan-headers: "1.2.162.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.10.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.10.yml deleted file mode 100644 index 056b9e003fb57..0000000000000 --- a/recipes/moltenvk/all/dependencies/dependencies-1.1.10.yml +++ /dev/null @@ -1,4 +0,0 @@ -glslang: "1.3.216.0" -spirv-cross: "1.3.216.0" -spirv-tools: "1.3.216.0" -vulkan-headers: "1.3.216.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.4.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.4.yml deleted file mode 100644 index b1f4555c6b74e..0000000000000 --- a/recipes/moltenvk/all/dependencies/dependencies-1.1.4.yml +++ /dev/null @@ -1,4 +0,0 @@ -glslang: "11.5.0" -spirv-cross: "cci.20210621" -spirv-tools: "2021.2" -vulkan-headers: "1.2.182" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.5.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.5.yml deleted file mode 100644 index f358857867637..0000000000000 --- a/recipes/moltenvk/all/dependencies/dependencies-1.1.5.yml +++ /dev/null @@ -1,4 +0,0 @@ -glslang: "11.6.0" -spirv-cross: "cci.20210823" -spirv-tools: "2021.3" -vulkan-headers: "1.2.189" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.6.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.6.yml deleted file mode 100644 index 50da3fc9cd75d..0000000000000 --- a/recipes/moltenvk/all/dependencies/dependencies-1.1.6.yml +++ /dev/null @@ -1,4 +0,0 @@ -glslang: "11.7.0" -spirv-cross: "cci.20211113" -spirv-tools: "2021.4" -vulkan-headers: "1.2.198.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.8.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.8.yml deleted file mode 100644 index a215ca2513dd4..0000000000000 --- a/recipes/moltenvk/all/dependencies/dependencies-1.1.8.yml +++ /dev/null @@ -1,4 +0,0 @@ -glslang: "1.3.204.0" -spirv-cross: "1.3.204.0" -spirv-tools: "1.3.204.0" -vulkan-headers: "1.3.204.1" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.1.9.yml b/recipes/moltenvk/all/dependencies/dependencies-1.1.9.yml deleted file mode 100644 index d62197eb0b30f..0000000000000 --- a/recipes/moltenvk/all/dependencies/dependencies-1.1.9.yml +++ /dev/null @@ -1,4 +0,0 @@ -glslang: "1.3.211.0" -spirv-cross: "1.3.211.0" -spirv-tools: "1.3.211.0" -vulkan-headers: "1.3.211.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.2.0.yml b/recipes/moltenvk/all/dependencies/dependencies-1.2.0.yml index 33e0cb279be8b..5d099aa6f64ae 100644 --- a/recipes/moltenvk/all/dependencies/dependencies-1.2.0.yml +++ b/recipes/moltenvk/all/dependencies/dependencies-1.2.0.yml @@ -1,4 +1,4 @@ -glslang: "1.3.231.1" -spirv-cross: "1.3.231.1" -spirv-tools: "1.3.231.1" -vulkan-headers: "1.3.231.1" +glslang: "1.3.239.0" +spirv-cross: "1.3.239.0" +spirv-tools: "1.3.239.0" +vulkan-headers: "1.3.239.0" diff --git a/recipes/moltenvk/all/dependencies/dependencies-1.2.1.yml b/recipes/moltenvk/all/dependencies/dependencies-1.2.1.yml index ba333592e0199..5d099aa6f64ae 100644 --- a/recipes/moltenvk/all/dependencies/dependencies-1.2.1.yml +++ b/recipes/moltenvk/all/dependencies/dependencies-1.2.1.yml @@ -1,4 +1,4 @@ -glslang: "1.3.236.0" -spirv-cross: "1.3.236.0" -spirv-tools: "1.3.236.0" -vulkan-headers: "1.3.236.0" +glslang: "1.3.239.0" +spirv-cross: "1.3.239.0" +spirv-tools: "1.3.239.0" +vulkan-headers: "1.3.239.0" diff --git a/recipes/moltenvk/all/patches/1.1.0-0001-fix-spirv-cross-includes.patch b/recipes/moltenvk/all/patches/1.1.0-0001-fix-spirv-cross-includes.patch deleted file mode 100644 index 5280ed8ddc361..0000000000000 --- a/recipes/moltenvk/all/patches/1.1.0-0001-fix-spirv-cross-includes.patch +++ /dev/null @@ -1,54 +0,0 @@ -see https://github.com/KhronosGroup/MoltenVK/pull/1287 - ---- a/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h -+++ b/MoltenVK/MoltenVK/GPUObjects/MVKPixelFormats.h -@@ -22,7 +22,7 @@ - #include "MVKEnvironment.h" - #include "MVKOSExtensions.h" - #include "MVKBaseObject.h" --#include -+#include - #include - - #import ---- a/MoltenVKShaderConverter/Common/SPIRVSupport.cpp -+++ b/MoltenVKShaderConverter/Common/SPIRVSupport.cpp -@@ -18,7 +18,7 @@ - - #include "SPIRVSupport.h" - #include "MVKStrings.h" --#include -+#include - #include - - #import ---- a/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVReflection.h -+++ b/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVReflection.h -@@ -19,10 +19,10 @@ - #ifndef __SPIRVReflection_h_ - #define __SPIRVReflection_h_ 1 - --#include --#include --#include --#include -+#include -+#include -+#include -+#include - #include - #include - ---- a/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVToMSLConverter.h -+++ b/MoltenVKShaderConverter/MoltenVKShaderConverter/SPIRVToMSLConverter.h -@@ -19,8 +19,8 @@ - #ifndef __SPIRVToMSLConverter_h_ - #define __SPIRVToMSLConverter_h_ 1 - --#include --#include -+#include -+#include - #include - #include - #include diff --git a/recipes/moltenvk/all/patches/1.1.11-fix-MVKSmallVector.patch b/recipes/moltenvk/all/patches/1.1.11-fix-MVKSmallVector.patch new file mode 100644 index 0000000000000..6a11e5548351f --- /dev/null +++ b/recipes/moltenvk/all/patches/1.1.11-fix-MVKSmallVector.patch @@ -0,0 +1,48 @@ +diff --git a/MoltenVK/MoltenVK/Utility/MVKSmallVector.h b/MoltenVK/MoltenVK/Utility/MVKSmallVector.h +index ca19169..39a46dc 100755 +--- a/MoltenVK/MoltenVK/Utility/MVKSmallVector.h ++++ b/MoltenVK/MoltenVK/Utility/MVKSmallVector.h +@@ -85,9 +85,9 @@ public: + return *this; + } + +- Type *operator->() { return &vector->alc.ptr[index]; } +- Type &operator*() { return vector->alc.ptr[index]; } +- operator Type*() { return &vector->alc.ptr[index]; } ++ Type *operator->() const { return &vector->alc.ptr[index]; } ++ Type &operator*() const { return vector->alc.ptr[index]; } ++ operator Type*() const { return &vector->alc.ptr[index]; } + + bool operator==( const iterator &it ) const { return vector == it.vector && index == it.index; } + bool operator!=( const iterator &it ) const { return vector != it.vector || index != it.index; } +@@ -97,20 +97,19 @@ public: + iterator& operator--() { --index; return *this; } + iterator operator--( int ) { auto t = *this; --index; return t; } + +- iterator operator+ (const diff_type n) { return iterator( index + n, *vector ); } +- iterator& operator+= (const diff_type n) { index += n; return *this; } +- iterator operator- (const diff_type n) { return iterator( index - n, *vector ); } +- iterator& operator-= (const diff_type n) { index -= n; return *this; } ++ iterator operator+ (const diff_type n) const { return iterator( index + n, *vector ); } ++ iterator& operator+= (const diff_type n) { index += n; return *this; } ++ iterator operator- (const diff_type n) const { return iterator( index - n, *vector ); } ++ iterator& operator-= (const diff_type n) { index -= n; return *this; } + +- diff_type operator- (const iterator& it) { return index - it.index; } ++ diff_type operator- (const iterator& it) const { return index - it.index; } + +- bool operator< (const iterator& it) { return index < it.index; } +- bool operator<= (const iterator& it) { return index <= it.index; } +- bool operator> (const iterator& it) { return index > it.index; } +- bool operator>= (const iterator& it) { return index >= it.index; } ++ bool operator< (const iterator& it) const { return index < it.index; } ++ bool operator<= (const iterator& it) const { return index <= it.index; } ++ bool operator> (const iterator& it) const { return index > it.index; } ++ bool operator>= (const iterator& it) const { return index >= it.index; } + +- const Type &operator[]( const diff_type i ) const { return vector->alc.ptr[index + i]; } +- Type &operator[]( const diff_type i ) { return vector->alc.ptr[index + i]; } ++ Type &operator[]( const diff_type i ) const { return vector->alc.ptr[index + i]; } + + bool is_valid() const { return index < vector->alc.size(); } + size_t get_position() const { return index; } diff --git a/recipes/moltenvk/all/patches/1.1.5-0001-allow-c++11-std.patch b/recipes/moltenvk/all/patches/1.1.5-0001-allow-c++11-std.patch deleted file mode 100644 index 283e7edc667aa..0000000000000 --- a/recipes/moltenvk/all/patches/1.1.5-0001-allow-c++11-std.patch +++ /dev/null @@ -1,16 +0,0 @@ -upstream issue: https://github.com/KhronosGroup/MoltenVK/issues/1474 - ---- a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm -+++ b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm -@@ -769,7 +769,10 @@ void MVKCommandEncoder::markTimestamp(MVKTimestampQueryPool* pQueryPool, uint32_ - if (sampPts) { - for (uint32_t qOfst = 0; qOfst < queryCount; qOfst++) { - if (mvkIsAnyFlagEnabled(sampPts, MVK_COUNTER_SAMPLING_AT_PIPELINE_STAGE)) { -- _timestampStageCounterQueries.push_back({ pQueryPool, query + qOfst }); -+ GPUCounterQuery timestampCounterQuery = {}; -+ timestampCounterQuery.queryPool = pQueryPool; -+ timestampCounterQuery.query = query + qOfst; -+ _timestampStageCounterQueries.push_back(timestampCounterQuery); - } else { - encodeGPUCounterSample(pQueryPool, query + qOfst, sampPts); - } diff --git a/recipes/moltenvk/all/patches/1.1.6-0001-allow-c++11-std.patch b/recipes/moltenvk/all/patches/1.1.6-0001-allow-c++11-std.patch deleted file mode 100644 index 65bfadc2ebffe..0000000000000 --- a/recipes/moltenvk/all/patches/1.1.6-0001-allow-c++11-std.patch +++ /dev/null @@ -1,16 +0,0 @@ -upstream issue: https://github.com/KhronosGroup/MoltenVK/issues/1474 - ---- a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm -+++ b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm -@@ -772,7 +772,10 @@ void MVKCommandEncoder::markTimestamp(MVKTimestampQueryPool* pQueryPool, uint32_ - MVKCounterSamplingFlags sampPts = _device->_pMetalFeatures->counterSamplingPoints; - for (uint32_t qOfst = 0; qOfst < queryCount; qOfst++) { - if (mvkIsAnyFlagEnabled(sampPts, MVK_COUNTER_SAMPLING_AT_PIPELINE_STAGE)) { -- _timestampStageCounterQueries.push_back({ pQueryPool, query + qOfst }); -+ GPUCounterQuery timestampCounterQuery = {}; -+ timestampCounterQuery.queryPool = pQueryPool; -+ timestampCounterQuery.query = query + qOfst; -+ _timestampStageCounterQueries.push_back(timestampCounterQuery); - } else { - encodeGPUCounterSample(pQueryPool, query + qOfst, sampPts); - } diff --git a/recipes/moltenvk/all/patches/1.1.8-0001-allow-c++11-std.patch b/recipes/moltenvk/all/patches/1.1.8-0001-allow-c++11-std.patch deleted file mode 100644 index 420e890ccf5f4..0000000000000 --- a/recipes/moltenvk/all/patches/1.1.8-0001-allow-c++11-std.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm -+++ b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm -@@ -774,7 +774,10 @@ void MVKCommandEncoder::markTimestamp(MVKTimestampQueryPool* pQueryPool, uint32_ - MVKCounterSamplingFlags sampPts = _device->_pMetalFeatures->counterSamplingPoints; - for (uint32_t qOfst = 0; qOfst < queryCount; qOfst++) { - if (mvkIsAnyFlagEnabled(sampPts, MVK_COUNTER_SAMPLING_AT_PIPELINE_STAGE)) { -- _timestampStageCounterQueries.push_back({ pQueryPool, query + qOfst }); -+ GPUCounterQuery timestampCounterQuery = {}; -+ timestampCounterQuery.queryPool = pQueryPool; -+ timestampCounterQuery.query = query + qOfst; -+ _timestampStageCounterQueries.push_back(timestampCounterQuery); - } else { - encodeGPUCounterSample(pQueryPool, query + qOfst, sampPts); - } diff --git a/recipes/moltenvk/all/patches/1.1.8-0002-vulkan-alias-private-extern.patch b/recipes/moltenvk/all/patches/1.1.8-0002-vulkan-alias-private-extern.patch deleted file mode 100644 index e488faca8335a..0000000000000 --- a/recipes/moltenvk/all/patches/1.1.8-0002-vulkan-alias-private-extern.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/Common/MVKCommonEnvironment.h -+++ b/Common/MVKCommonEnvironment.h -@@ -104,6 +104,9 @@ extern "C" { - /** Directive to make a public alias of another symbol. */ - #define MVK_PUBLIC_ALIAS(ALIAS, TARGET) asm(".globl _" #ALIAS "\n\t_" #ALIAS " = _" #TARGET) - -+/** Directive to make a private extern alias of another symbol. */ -+#define MVK_PRIVATE_EXTERN_ALIAS(ALIAS, TARGET) asm(".private_extern _" #ALIAS "\n\t_" #ALIAS " = _" #TARGET) -+ - /** - * Directives to hide public symbols from the Vulkan API, to avoid library linking - * conflicts when bound to a Vulkan Loader that also exports identical symbols. -@@ -113,7 +116,7 @@ extern "C" { - #endif - #if MVK_HIDE_VULKAN_SYMBOLS - # define MVK_PUBLIC_VULKAN_SYMBOL --# define MVK_PUBLIC_VULKAN_ALIAS(ALIAS, TARGET) -+# define MVK_PUBLIC_VULKAN_ALIAS(ALIAS, TARGET) MVK_PRIVATE_EXTERN_ALIAS(ALIAS, TARGET) - #else - # define MVK_PUBLIC_VULKAN_SYMBOL MVK_PUBLIC_SYMBOL - # define MVK_PUBLIC_VULKAN_ALIAS(ALIAS, TARGET) MVK_PUBLIC_ALIAS(ALIAS, TARGET) diff --git a/recipes/moltenvk/all/patches/1.2.2-0001-MVKSmallVector-Make-iterator-const-correct.patch b/recipes/moltenvk/all/patches/1.2.2-0001-MVKSmallVector-Make-iterator-const-correct.patch new file mode 100644 index 0000000000000..77fa33557e448 --- /dev/null +++ b/recipes/moltenvk/all/patches/1.2.2-0001-MVKSmallVector-Make-iterator-const-correct.patch @@ -0,0 +1,51 @@ +see https://github.com/KhronosGroup/MoltenVK/pull/2157 + +diff --git a/MoltenVK/MoltenVK/Utility/MVKSmallVector.h b/MoltenVK/MoltenVK/Utility/MVKSmallVector.h +index 93bcb7fc..9649f2b2 100755 +--- a/MoltenVK/MoltenVK/Utility/MVKSmallVector.h ++++ b/MoltenVK/MoltenVK/Utility/MVKSmallVector.h +@@ -86,9 +86,9 @@ public: + return *this; + } + +- Type *operator->() { return &vector->alc.ptr[index]; } +- Type &operator*() { return vector->alc.ptr[index]; } +- operator Type*() { return &vector->alc.ptr[index]; } ++ Type *operator->() const { return &vector->alc.ptr[index]; } ++ Type &operator*() const { return vector->alc.ptr[index]; } ++ operator Type*() const { return &vector->alc.ptr[index]; } + + bool operator==( const iterator &it ) const { return vector == it.vector && index == it.index; } + bool operator!=( const iterator &it ) const { return vector != it.vector || index != it.index; } +@@ -98,20 +98,19 @@ public: + iterator& operator--() { --index; return *this; } + iterator operator--( int ) { auto t = *this; --index; return t; } + +- iterator operator+ (const diff_type n) { return iterator( index + n, *vector ); } +- iterator& operator+= (const diff_type n) { index += n; return *this; } +- iterator operator- (const diff_type n) { return iterator( index - n, *vector ); } +- iterator& operator-= (const diff_type n) { index -= n; return *this; } ++ iterator operator+ (const diff_type n) const { return iterator( index + n, *vector ); } ++ iterator& operator+= (const diff_type n) { index += n; return *this; } ++ iterator operator- (const diff_type n) const { return iterator( index - n, *vector ); } ++ iterator& operator-= (const diff_type n) { index -= n; return *this; } + +- diff_type operator- (const iterator& it) { return index - it.index; } ++ diff_type operator- (const iterator& it) const { return index - it.index; } + +- bool operator< (const iterator& it) { return index < it.index; } +- bool operator<= (const iterator& it) { return index <= it.index; } +- bool operator> (const iterator& it) { return index > it.index; } +- bool operator>= (const iterator& it) { return index >= it.index; } ++ bool operator< (const iterator& it) const { return index < it.index; } ++ bool operator<= (const iterator& it) const { return index <= it.index; } ++ bool operator> (const iterator& it) const { return index > it.index; } ++ bool operator>= (const iterator& it) const { return index >= it.index; } + +- const Type &operator[]( const diff_type i ) const { return vector->alc.ptr[index + i]; } +- Type &operator[]( const diff_type i ) { return vector->alc.ptr[index + i]; } ++ Type &operator[]( const diff_type i ) const { return vector->alc.ptr[index + i]; } + + bool is_valid() const { return index < vector->alc.size(); } + size_t get_position() const { return index; } +-- diff --git a/recipes/moltenvk/all/test_package/CMakeLists.txt b/recipes/moltenvk/all/test_package/CMakeLists.txt index a5c97f937b4f7..b15d7f65d05d9 100644 --- a/recipes/moltenvk/all/test_package/CMakeLists.txt +++ b/recipes/moltenvk/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(moltenvk REQUIRED CONFIG) diff --git a/recipes/moltenvk/config.yml b/recipes/moltenvk/config.yml index e2b738bf7f2a6..e368ebecaad4f 100644 --- a/recipes/moltenvk/config.yml +++ b/recipes/moltenvk/config.yml @@ -7,19 +7,3 @@ versions: folder: all "1.1.11": folder: all - "1.1.10": - folder: all - "1.1.9": - folder: all - "1.1.8": - folder: all - "1.1.6": - folder: all - "1.1.5": - folder: all - "1.1.4": - folder: all - "1.1.1": - folder: all - "1.1.0": - folder: all diff --git a/recipes/mongo-c-driver/all/conandata.yml b/recipes/mongo-c-driver/all/conandata.yml index 5e5abc368ffce..9fc6994dbb819 100644 --- a/recipes/mongo-c-driver/all/conandata.yml +++ b/recipes/mongo-c-driver/all/conandata.yml @@ -1,28 +1,28 @@ sources: + "1.30.3": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.30.3/mongo-c-driver-1.30.3.tar.gz" + sha256: "9f42eb507e8c591546dc9c584230a6f71127842cb597cc4ab219d1ebe251e7af" + "1.29.2": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.29.2/mongo-c-driver-1.29.2.tar.gz" + sha256: "b5c33912c365e108d1fb1a03586364bbadc90e568e5719b290e15031c6e5ad90" + "1.29.1": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.29.1/mongo-c-driver-1.29.1.tar.gz" + sha256: "64382a775353e67c510450c83d72b72e6747ba18256dd1d313deeef7db073b4f" + "1.29.0": + url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.29.0/mongo-c-driver-1.29.0.tar.gz" + sha256: "e3dbe86e1f40e100344c48a4c0e39d2da360d2b12a54f16031fa8f90ff16fe5e" + "1.28.1": + url: "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.28.1.tar.gz" + sha256: "249fd66d8d12aac2aec7dea1456e1bf24908c87971016c391a1a82a636029a87" + "1.27.6": + url: "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.27.6.tar.gz" + sha256: "7dee166dd106e3074582dd107f62815aa29311520149cda52efb69590b2cae7a" + "1.26.2": + url: "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.26.2.tar.gz" + sha256: "7084c488a758bf226cc0b3d500e7e001f0e2e37391cbeecd341050a9a899857d" "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" - "1.22.2": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.22.2/mongo-c-driver-1.22.2.tar.gz" - sha256: "2e59b9d38d600bd63ccc0b215dd44c6254a66eeb8085a5ac513748cd6220532e" - "1.22.0": - url: "https://github.com/mongodb/mongo-c-driver/releases/download/1.22.0/mongo-c-driver-1.22.0.tar.gz" - sha256: "272067f75e7e57c98f90a6f0c42500ef818b4b085539343676b6ce6831655eaf" - "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" patches: "1.24.3": - patch_file: "patches/1.24.1-0001-disable-shared-when-static.patch" @@ -31,70 +31,3 @@ patches: - 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" - 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.22.2": - - patch_file: "patches/1.22.0-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.22.0": - - patch_file: "patches/1.22.0-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.17.6": - - patch_file: "patches/1.17.6-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 abc21a11a2f2b..d3e733eb6de05 100644 --- a/recipes/mongo-c-driver/all/conanfile.py +++ b/recipes/mongo-c-driver/all/conanfile.py @@ -70,15 +70,15 @@ def requirements(self): elif self.options.with_ssl == "libressl": self.requires("libressl/3.5.3") if self.options.with_sasl == "cyrus": - self.requires("cyrus-sasl/2.1.27") + self.requires("cyrus-sasl/2.1.28") if self.options.with_snappy: self.requires("snappy/1.1.10") if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: - self.requires("zstd/1.5.5") + self.requires("zstd/[^1.5]") if self.options.with_icu: - self.requires("icu/73.2") + self.requires("icu/74.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/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -118,10 +118,11 @@ def generate(self): # therefore it defeats conan_toolchain variables, but it works fine with cache_variables tc.cache_variables["ENABLE_SSL"] = self._ssl_cmake_value tc.cache_variables["ENABLE_SASL"] = self._sasl_cmake_value - tc.cache_variables["ENABLE_STATIC"] = "OFF" if self.options.shared else "ON" + tc.cache_variables["ENABLE_SHARED"] = self.options.shared + tc.cache_variables["ENABLE_STATIC"] = not self.options.shared tc.cache_variables["ENABLE_TESTS"] = "OFF" tc.cache_variables["ENABLE_EXAMPLES"] = "OFF" - tc.cache_variables["ENABLE_SRV"] = "ON" if self.options.srv else "OFF" + tc.cache_variables["ENABLE_SRV"] = self.options.srv tc.cache_variables["ENABLE_MAINTAINER_FLAGS"] = "OFF" tc.cache_variables["ENABLE_AUTOMATIC_INIT_AND_CLEANUP"] = "ON" tc.cache_variables["ENABLE_CRYPTO_SYSTEM_PROFILE"] = "OFF" @@ -130,29 +131,34 @@ def generate(self): tc.cache_variables["ENABLE_SHM_COUNTERS"] = "OFF" tc.cache_variables["ENABLE_MONGOC"] = "ON" tc.cache_variables["ENABLE_BSON"] = "ON" - tc.cache_variables["ENABLE_SNAPPY"] = "ON" if self.options.with_snappy else "OFF" + tc.cache_variables["ENABLE_SNAPPY"] = self.options.with_snappy tc.cache_variables["ENABLE_ZLIB"] = "SYSTEM" if self.options.with_zlib else "OFF" - tc.cache_variables["ENABLE_ZSTD"] = "ON" if self.options.with_zstd else "OFF" + tc.cache_variables["ENABLE_ZSTD"] = self.options.with_zstd tc.cache_variables["ENABLE_MAN_PAGES"] = "OFF" tc.cache_variables["ENABLE_HTML_DOCS"] = "OFF" tc.cache_variables["ENABLE_EXTRA_ALIGNMENT"] = "ON" tc.cache_variables["ENABLE_RDTSCP"] = "OFF" tc.cache_variables["ENABLE_APPLE_FRAMEWORK"] = "OFF" - tc.cache_variables["ENABLE_ICU"] = "ON" if self.options.with_icu else "OFF" + tc.cache_variables["ENABLE_ICU"] = self.options.with_icu tc.cache_variables["ENABLE_UNINSTALL"] = "OFF" tc.cache_variables["ENABLE_CLIENT_SIDE_ENCRYPTION"] = "OFF" # libmongocrypt recipe not yet in CCI tc.cache_variables["ENABLE_MONGODB_AWS_AUTH"] = "AUTO" - tc.cache_variables["ENABLE_PIC"] = "ON" if self.options.get_safe("fPIC", True) else "OFF" + tc.cache_variables["ENABLE_PIC"] = self.options.get_safe("fPIC", True) # Avoid to install vc runtime stuff tc.variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = "TRUE" if self.options.with_ssl == "openssl": tc.variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") - if Version(self.version) >= "1.20.0": - tc.variables["MONGO_USE_CCACHE"] = False + tc.variables["MONGO_USE_CCACHE"] = False if is_msvc(self): # Should be added because of # https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initonceexecuteonce tc.preprocessor_definitions["_WIN32_WINNT"] = "0x0600" + tc.cache_variables["BUILD_VERSION"] = self.version + # Skip some fragile checks + # https://github.com/mongodb/mongo-c-driver/blob/1.25.3/src/libmongoc/CMakeLists.txt#L266-L276 + tc.variables["HAVE_ASN1_STRING_GET0_DATA"] = True # Requires OpenSSL 1.1.0+ + # https://github.com/mongodb/mongo-c-driver/blob/1.25.3/src/libmongoc/CMakeLists.txt#L366-L375 + tc.variables["SASL2_HAVE_SASL_CLIENT_DONE"] = True # Requires Cyrus-SASL 2.1.23+ tc.generate() deps = CMakeDeps(self) @@ -166,18 +172,14 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - to_replace_old_new = [ - # Fix Snappy - {"old": "include (FindSnappy)\nif (SNAPPY_INCLUDE_DIRS)", - "new": "if(ENABLE_SNAPPY MATCHES \"ON\")\n find_package(Snappy REQUIRED)"}, - {"old": "SNAPPY_LIBRARIES", "new": "Snappy_LIBRARIES"}, - {"old": "SNAPPY_INCLUDE_DIRS", "new": "Snappy_INCLUDE_DIRS"}, - # Fix LibreSSL - {"old": "set (SSL_LIBRARIES -ltls -lcrypto)", "new": ""}, - ] - for old_new in to_replace_old_new: - replace_in_file(self, os.path.join(self.source_folder, "src", "libmongoc", "CMakeLists.txt"), - old_new["old"], old_new["new"]) + libmongoc_cmake = os.path.join(self.source_folder, "src", "libmongoc", "CMakeLists.txt") + replace_in_file(self, libmongoc_cmake, + "include (FindSnappy)\nif (SNAPPY_INCLUDE_DIRS)", + 'if(ENABLE_SNAPPY MATCHES "ON")\n find_package(Snappy REQUIRED)') + replace_in_file(self, libmongoc_cmake, "SNAPPY_LIBRARIES", "Snappy_LIBRARIES") + replace_in_file(self, libmongoc_cmake, "SNAPPY_INCLUDE_DIRS", "Snappy_INCLUDE_DIRS") + if Version(self.version) < "1.25": + replace_in_file(self, libmongoc_cmake, "set (SSL_LIBRARIES -ltls -lcrypto)", "") # cleanup rpath replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set (CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)", "") diff --git a/recipes/mongo-c-driver/all/patches/1.17.6-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.17.6-0001-disable-shared-when-static.patch deleted file mode 100644 index dad7659403d2b..0000000000000 --- a/recipes/mongo-c-driver/all/patches/1.17.6-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) -@@ -279,6 +280,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}) -@@ -337,7 +339,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.22.0-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.22.0-0001-disable-shared-when-static.patch deleted file mode 100644 index 23d005b89467b..0000000000000 --- a/recipes/mongo-c-driver/all/patches/1.22.0-0001-disable-shared-when-static.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- a/src/libbson/CMakeLists.txt -+++ b/src/libbson/CMakeLists.txt -@@ -209,6 +209,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 -@@ -275,6 +276,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}) -@@ -349,7 +351,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 -@@ -758,6 +758,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}) -@@ -795,6 +796,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}) -@@ -835,6 +837,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 -@@ -845,9 +848,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") -@@ -1161,7 +1169,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.22.0-0002-fix-uninitialized-warning.patch b/recipes/mongo-c-driver/all/patches/1.22.0-0002-fix-uninitialized-warning.patch deleted file mode 100644 index 3c24ab717c0d5..0000000000000 --- a/recipes/mongo-c-driver/all/patches/1.22.0-0002-fix-uninitialized-warning.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/libbson/src/bson/bson-iter.c b/src/libbson/src/bson/bson-iter.c -index 7b4630f..ee70f12 100644 ---- a/src/libbson/src/bson/bson-iter.c -+++ b/src/libbson/src/bson/bson-iter.c -@@ -2141,7 +2141,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/all/patches/1.22.0-0003-disable-warning-errors.patch b/recipes/mongo-c-driver/all/patches/1.22.0-0003-disable-warning-errors.patch deleted file mode 100644 index 2ade48e877823..0000000000000 --- a/recipes/mongo-c-driver/all/patches/1.22.0-0003-disable-warning-errors.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/build/cmake/MongoC-Warnings.cmake b/build/cmake/MongoC-Warnings.cmake -index 4784c93..99745c3 100644 ---- a/build/cmake/MongoC-Warnings.cmake -+++ b/build/cmake/MongoC-Warnings.cmake -@@ -58,10 +58,6 @@ mongoc_add_platform_compile_options ( - gnu-like:$<${is_c_lang}:-Werror=implicit> msvc:/we4013 msvc:/we4431 - # Missing return types/statements - gnu-like:-Werror=return-type msvc:/we4716 -- # Incompatible pointer types -- gnu-like:$<$:-Werror=incompatible-pointer-types> msvc:/we4113 -- # Integral/pointer conversions -- gnu-like:$<$:-Werror=int-conversion> msvc:/we4047 - # Discarding qualifiers - gnu:$<$:-Werror=discarded-qualifiers> - clang:$<${is_c_lang}:-Werror=ignored-qualifiers> diff --git a/recipes/mongo-c-driver/all/patches/1.23.2-0001-disable-shared-when-static.patch b/recipes/mongo-c-driver/all/patches/1.23.2-0001-disable-shared-when-static.patch deleted file mode 100644 index 1b39914f6b921..0000000000000 --- a/recipes/mongo-c-driver/all/patches/1.23.2-0001-disable-shared-when-static.patch +++ /dev/null @@ -1,82 +0,0 @@ -diff --git a/src/libbson/CMakeLists.txt b/src/libbson/CMakeLists.txt -index d6df66f..dccdfee 100644 ---- a/src/libbson/CMakeLists.txt -+++ b/src/libbson/CMakeLists.txt -@@ -209,6 +209,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 -@@ -275,6 +276,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}) -@@ -349,7 +351,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 39f66ac..3f4eefc 100644 ---- a/src/libmongoc/CMakeLists.txt -+++ b/src/libmongoc/CMakeLists.txt -@@ -758,6 +758,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}) -@@ -795,6 +796,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}) -@@ -835,6 +837,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 -@@ -845,9 +848,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 STREQUAL "ON") -@@ -1128,7 +1137,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/test_package/CMakeLists.txt b/recipes/mongo-c-driver/all/test_package/CMakeLists.txt index 9ed8451d03a20..1c87c52e21703 100644 --- a/recipes/mongo-c-driver/all/test_package/CMakeLists.txt +++ b/recipes/mongo-c-driver/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(mongoc-1.0 REQUIRED CONFIG) diff --git a/recipes/mongo-c-driver/all/test_v1_package/CMakeLists.txt b/recipes/mongo-c-driver/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/mongo-c-driver/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mongo-c-driver/all/test_v1_package/conanfile.py b/recipes/mongo-c-driver/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mongo-c-driver/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_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/mongo-c-driver/config.yml b/recipes/mongo-c-driver/config.yml index c20e8c0d07847..8f7cb23dd4c86 100644 --- a/recipes/mongo-c-driver/config.yml +++ b/recipes/mongo-c-driver/config.yml @@ -1,17 +1,17 @@ versions: - "1.24.3": + "1.30.3": folder: all - "1.24.1": + "1.29.2": folder: all - "1.23.5": + "1.29.1": folder: all - "1.23.4": + "1.29.0": folder: all - "1.23.2": + "1.28.1": folder: all - "1.22.2": + "1.27.6": folder: all - "1.22.0": + "1.26.2": folder: all - "1.17.6": + "1.24.3": folder: all diff --git a/recipes/mongo-cxx-driver/all/conandata.yml b/recipes/mongo-cxx-driver/all/conandata.yml index 58272018f4021..cb586c6f2a1f1 100644 --- a/recipes/mongo-cxx-driver/all/conandata.yml +++ b/recipes/mongo-cxx-driver/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "3.11.0": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.11.0/mongo-cxx-driver-r3.11.0.tar.gz" + sha256: "cb4263229d769ec44aa66563e2dd2d70c6384c85d93840a52fe26b15436c54f1" + "3.10.2": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.10.2/mongo-cxx-driver-r3.10.2.tar.gz" + sha256: "52b99b2866019b5ea25d15c5a39e2a88c70fe1259c40f1091deff8bfae0194be" + "3.10.1": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.10.1/mongo-cxx-driver-r3.10.1.tar.gz" + sha256: "0297d9d1a513f09438cc05254b14baa49edd1fa64a6ce5d7a80a1eb7677cf2be" "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" @@ -14,16 +23,28 @@ sources: "3.6.7": url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.7/mongo-cxx-driver-r3.6.7.tar.gz" sha256: "2c58005d4fe46f1973352fba821f7bb37e818cefc922377ce979a9fd1bff38ac" - "3.6.6": - url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.6/mongo-cxx-driver-r3.6.6.tar.gz" - sha256: "d5906b9e308a8a353a2ef92b699c9b27ae28ec6b34fdda94e15d2981b27e64ca" - "3.6.2": - url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.2/mongo-cxx-driver-r3.6.2.tar.gz" - sha256: "24325dce74723f7632da76d0eeb5f5020828498cc5bc1a624c6d7117efb2b7cf" - "3.6.1": - 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.11.0": + - patch_file: "patches/3.10.2-0001-dirs.patch" + patch_description: "disable documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/3.10.1-0002-remove-abi-suffixes.patch" + patch_description: "remove abi suffixes for MSVC" + patch_type: "conan" + "3.10.2": + - patch_file: "patches/3.10.2-0001-dirs.patch" + patch_description: "disable documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/3.10.1-0002-remove-abi-suffixes.patch" + patch_description: "remove abi suffixes for MSVC" + patch_type: "conan" + "3.10.1": + - patch_file: "patches/3.10.1-0001-dirs.patch" + patch_description: "disable documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/3.10.1-0002-remove-abi-suffixes.patch" + patch_description: "remove abi suffixes for MSVC" + patch_type: "conan" "3.8.1": - patch_file: "patches/3.8.1-0001-dirs.patch" patch_description: "disable documentation features, fix directories" @@ -59,24 +80,3 @@ patches: - patch_file: "patches/poly_use_std_define.patch" patch_description: "use poly macro instead __cplusplus" patch_type: "portability" - "3.6.6": - - patch_file: "patches/3.6.x-dirs_and_tests.patch" - patch_description: "disable test and documentation features, fix directories" - patch_type: "conan" - - patch_file: "patches/poly_use_std_define.patch" - patch_description: "use poly macro instead __cplusplus" - patch_type: "portability" - "3.6.2": - - patch_file: "patches/3.6.x-dirs_and_tests.patch" - patch_description: "disable test and documentation features, fix directories" - patch_type: "conan" - - patch_file: "patches/poly_use_std_define.patch" - patch_description: "use poly macro instead __cplusplus" - patch_type: "portability" - "3.6.1": - - patch_file: "patches/3.6.x-dirs_and_tests.patch" - patch_description: "disable test and documentation features, fix directories" - patch_type: "conan" - - patch_file: "patches/poly_use_std_define.patch" - patch_description: "use poly macro instead __cplusplus" - patch_type: "portability" diff --git a/recipes/mongo-cxx-driver/all/conanfile.py b/recipes/mongo-cxx-driver/all/conanfile.py index 26e997f666df1..92bb53ee8c6ee 100644 --- a/recipes/mongo-cxx-driver/all/conanfile.py +++ b/recipes/mongo-cxx-driver/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get, rm, rmdir from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc import os import shutil @@ -12,10 +13,10 @@ class MongoCxxConan(ConanFile): name = "mongo-cxx-driver" + description = "C++ Driver for MongoDB" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" 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" @@ -47,7 +48,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("mongo-c-driver/1.24.3") + self.requires("mongo-c-driver/1.28.0") if self.options.polyfill == "boost": self.requires("boost/1.82.0", transitive_headers=True) @@ -129,6 +130,8 @@ def generate(self): if not valid_min_cppstd(self, self._minimal_std_version): tc.variables["CMAKE_CXX_STANDARD"] = self._minimal_std_version tc.variables["ENABLE_TESTS"] = False + if Version(self.version) >= "3.10.1" and is_msvc(self): + tc.variables["ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES"] = False tc.generate() deps = CMakeDeps(self) @@ -182,6 +185,8 @@ def package_info(self): if not self.options.shared: self.cpp_info.components["mongocxx"].defines.append("MONGOCXX_STATIC") self.cpp_info.components["mongocxx"].requires = ["mongo-c-driver::mongoc", "bsoncxx"] + if Version(self.version) >= "3.10.1": + self.cpp_info.components["mongocxx"].includedirs.append(os.path.join("include", "mongocxx", "v_noabi")) # bsoncxx bsoncxx_target = "bsoncxx_shared" if self.options.shared else "bsoncxx_static" @@ -197,3 +202,5 @@ def package_info(self): self.cpp_info.components["bsoncxx"].requires = ["mongo-c-driver::bson"] if self.options.polyfill == "boost": self.cpp_info.components["bsoncxx"].requires.append("boost::headers") + if Version(self.version) >= "3.10.1": + self.cpp_info.components["bsoncxx"].includedirs.append(os.path.join("include", "bsoncxx", "v_noabi")) diff --git a/recipes/mongo-cxx-driver/all/patches/3.10.1-0001-dirs.patch b/recipes/mongo-cxx-driver/all/patches/3.10.1-0001-dirs.patch new file mode 100644 index 0000000000000..41a672d93964e --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.10.1-0001-dirs.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2a960f7..f809b6c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -315,7 +315,7 @@ unset(dist_generated_depends CACHE) + set(BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR}) + + include(MakeDistFiles) +- ++if(FALSE) + add_custom_target(hugo_dir + COMMAND ${CMAKE_COMMAND} -E make_directory hugo + ) +@@ -371,7 +371,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) + set(DATA_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data) + +@@ -381,13 +381,13 @@ option(ENABLE_MACRO_GUARD_TESTS "Enable targets for macro guard compile tests." + 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) + +-add_subdirectory(examples EXCLUDE_FROM_ALL) +- +-add_subdirectory(benchmark EXCLUDE_FROM_ALL) +- ++# add_subdirectory(benchmark EXCLUDE_FROM_ALL) ++if(FALSE) + # Implement 'dist' target + # + # CMake does not implement anything like 'dist' from autotools. +@@ -525,3 +525,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 ce53a71..bcd0a61 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -93,8 +93,8 @@ if(TARGET bson_shared OR TARGET bson_static) + set(BSONCXX_PKG_DEP "find_dependency(bson-${LIBBSON_REQUIRED_ABI_VERSION} REQUIRED)") + 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(STATUS "found libbson version ${bson-${LIBBSON_REQUIRED_ABI_VERSION}_VERSION}") + diff --git a/recipes/mongo-cxx-driver/all/patches/3.10.1-0002-remove-abi-suffixes.patch b/recipes/mongo-cxx-driver/all/patches/3.10.1-0002-remove-abi-suffixes.patch new file mode 100644 index 0000000000000..f1fdc639b41ea --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.10.1-0002-remove-abi-suffixes.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/BsoncxxUtil.cmake b/cmake/BsoncxxUtil.cmake +index c72f98e..5f977e1 100644 +--- a/cmake/BsoncxxUtil.cmake ++++ b/cmake/BsoncxxUtil.cmake +@@ -76,7 +76,7 @@ function(bsoncxx_add_library TARGET OUTPUT_NAME LINK_TYPE) + endif() + + # MSVC-specific ABI tag suffixes. +- if(MSVC) ++ if(0) + set(vs_suffix "") + + # Include the target architecture if applicable (Win32, x64, etc.). +diff --git a/cmake/MongocxxUtil.cmake b/cmake/MongocxxUtil.cmake +index de9210c..f9937f4 100644 +--- a/cmake/MongocxxUtil.cmake ++++ b/cmake/MongocxxUtil.cmake +@@ -63,7 +63,7 @@ function(mongocxx_add_library TARGET OUTPUT_NAME LINK_TYPE) + endif() + + # MSVC-specific ABI tag suffixes. Inherit from bsoncxx. +- if(MSVC) ++ if(0) + get_target_property(vs_suffix ${bsoncxx_target} BSONCXX_ABI_TAG_VS_SUFFIX) + set_target_properties(${TARGET} PROPERTIES + BSONCXX_ABI_TAG_VS_SUFFIX ${vs_suffix} diff --git a/recipes/mongo-cxx-driver/all/patches/3.10.2-0001-dirs.patch b/recipes/mongo-cxx-driver/all/patches/3.10.2-0001-dirs.patch new file mode 100644 index 0000000000000..360b25feaf147 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.10.2-0001-dirs.patch @@ -0,0 +1,57 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6d612a4..5b3f872 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -279,7 +279,7 @@ unset(dist_generated_depends CACHE) + set(BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR}) + + include(MakeDistFiles) +- ++if(FALSE) + add_custom_target(hugo_dir + COMMAND ${CMAKE_COMMAND} -E make_directory hugo + ) +@@ -335,7 +335,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) + set(DATA_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data) + +@@ -348,10 +348,10 @@ endif() + + add_subdirectory(src) + +-add_subdirectory(examples EXCLUDE_FROM_ALL) +- +-add_subdirectory(benchmark EXCLUDE_FROM_ALL) ++# add_subdirectory(examples EXCLUDE_FROM_ALL) + ++# add_subdirectory(benchmark EXCLUDE_FROM_ALL) ++if(FALSE) + # Implement 'dist' target + # + # CMake does not implement anything like 'dist' from autotools. +@@ -489,3 +489,4 @@ endif() + if(CMAKE_GENERATOR_TOOLSET) + message(STATUS "\tinstance: ${CMAKE_GENERATOR_TOOLSET}") + endif() ++endif() +\ No newline at end of file +diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt +index ce53a71..90c4fd2 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -93,8 +93,8 @@ if(TARGET bson_shared OR TARGET bson_static) + set(BSONCXX_PKG_DEP "find_dependency(bson-${LIBBSON_REQUIRED_ABI_VERSION} REQUIRED)") + 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(STATUS "found libbson version ${bson-${LIBBSON_REQUIRED_ABI_VERSION}_VERSION}") + diff --git a/recipes/mongo-cxx-driver/config.yml b/recipes/mongo-cxx-driver/config.yml index dfc6d8b54584e..9198272a479a9 100644 --- a/recipes/mongo-cxx-driver/config.yml +++ b/recipes/mongo-cxx-driver/config.yml @@ -1,4 +1,11 @@ versions: + "3.11.0": + folder: all + "3.10.2": + folder: all + "3.10.1": + folder: all + # keep 3.8.1 for gdal "3.8.1": folder: all "3.8.0": @@ -7,11 +14,6 @@ versions: folder: all "3.7.0": folder: all + # keep 3.6.7 for gdal "3.6.7": folder: all - "3.6.6": - folder: all - "3.6.2": - folder: all - "3.6.1": - folder: all diff --git a/recipes/morton-nd/all/conandata.yml b/recipes/morton-nd/all/conandata.yml index 41b2951c67096..da7e41c780c0c 100644 --- a/recipes/morton-nd/all/conandata.yml +++ b/recipes/morton-nd/all/conandata.yml @@ -5,3 +5,10 @@ sources: "3.0.0": url: "https://github.com/kevinhartman/morton-nd/archive/v3.0.0.tar.gz" sha256: "ba57df04a2e1e73709f55fd3fee71082750013c5792de3c6eb84a8c87d40d781" +patches: + "4.0.0": + - patch_file: "patches/0001-v4.0.0-fix-include-cstdint.patch" + patch_type: "portability" + "3.0.0": + - patch_file: "patches/0001-v3.0.0-fix-include-cstdint.patch" + patch_type: "portability" diff --git a/recipes/morton-nd/all/conanfile.py b/recipes/morton-nd/all/conanfile.py index 5e3263ed60dd4..9558cedb497f2 100644 --- a/recipes/morton-nd/all/conanfile.py +++ b/recipes/morton-nd/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.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 @@ -14,9 +14,10 @@ class MortonndConan(ConanFile): description = "A header-only Morton encode/decode library (C++14) capable " \ "of encoding from and decoding to N-dimensional space." license = "MIT" - topics = ("morton-nd", "morton", "encoding", "decoding", "n-dimensional") + topics = ("morton", "encoding", "decoding", "n-dimensional") homepage = "https://github.com/kevinhartman/morton-nd" url = "https://github.com/conan-io/conan-center-index" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -34,6 +35,9 @@ def _compilers_minimum_version(self): "apple-clang": "5.1", } + def layout(self): + basic_layout(self, src_folder="src") + def package_id(self): self.info.clear() @@ -45,13 +49,13 @@ def validate(self): raise ConanInvalidConfiguration( 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 export_sources(self): + export_conandata_patches(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 @@ -64,9 +68,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "morton-nd") self.cpp_info.set_property("cmake_target_name", "morton-nd::MortonND") 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.names["cmake_find_package"] = "morton-nd" @@ -75,6 +77,4 @@ def package_info(self): self.cpp_info.components["mortonnd"].names["cmake_find_package_multi"] = "MortonND" self.cpp_info.components["mortonnd"].set_property("cmake_target_name", "morton-nd::MortonND") self.cpp_info.components["mortonnd"].bindirs = [] - self.cpp_info.components["mortonnd"].frameworkdirs = [] self.cpp_info.components["mortonnd"].libdirs = [] - self.cpp_info.components["mortonnd"].resdirs = [] diff --git a/recipes/morton-nd/all/patches/0001-v3.0.0-fix-include-cstdint.patch b/recipes/morton-nd/all/patches/0001-v3.0.0-fix-include-cstdint.patch new file mode 100644 index 0000000000000..52cd77981fa28 --- /dev/null +++ b/recipes/morton-nd/all/patches/0001-v3.0.0-fix-include-cstdint.patch @@ -0,0 +1,24 @@ +diff --git a/include/morton-nd/mortonND_BMI2.h b/include/morton-nd/mortonND_BMI2.h +index b99d2c0..63d89f2 100644 +--- a/include/morton-nd/mortonND_BMI2.h ++++ b/include/morton-nd/mortonND_BMI2.h +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + namespace mortonnd { + +diff --git a/include/morton-nd/mortonND_LUT_encoder.h b/include/morton-nd/mortonND_LUT_encoder.h +index 5d75cb2..575c898 100644 +--- a/include/morton-nd/mortonND_LUT_encoder.h ++++ b/include/morton-nd/mortonND_LUT_encoder.h +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + namespace mortonnd { + diff --git a/recipes/morton-nd/all/patches/0001-v4.0.0-fix-include-cstdint.patch b/recipes/morton-nd/all/patches/0001-v4.0.0-fix-include-cstdint.patch new file mode 100644 index 0000000000000..0cc25573d036f --- /dev/null +++ b/recipes/morton-nd/all/patches/0001-v4.0.0-fix-include-cstdint.patch @@ -0,0 +1,24 @@ +diff --git a/include/morton-nd/mortonND_BMI2.h b/include/morton-nd/mortonND_BMI2.h +index b99d2c0..63d89f2 100644 +--- a/include/morton-nd/mortonND_BMI2.h ++++ b/include/morton-nd/mortonND_BMI2.h +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + namespace mortonnd { + +diff --git a/include/morton-nd/mortonND_LUT.h b/include/morton-nd/mortonND_LUT.h +index 110ad63..fb3777b 100644 +--- a/include/morton-nd/mortonND_LUT.h ++++ b/include/morton-nd/mortonND_LUT.h +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + namespace mortonnd { + diff --git a/recipes/morton-nd/all/test_package/CMakeLists.txt b/recipes/morton-nd/all/test_package/CMakeLists.txt index 3d6da2fa9a946..17ba5e46dbffe 100644 --- a/recipes/morton-nd/all/test_package/CMakeLists.txt +++ b/recipes/morton-nd/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(morton-nd REQUIRED CONFIG) diff --git a/recipes/morton-nd/all/test_package/conanfile.py b/recipes/morton-nd/all/test_package/conanfile.py index d120a992c06a6..0a6bc68712d90 100644 --- a/recipes/morton-nd/all/test_package/conanfile.py +++ b/recipes/morton-nd/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/morton-nd/all/test_v1_package/CMakeLists.txt b/recipes/morton-nd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 07fa1c30a5235..0000000000000 --- a/recipes/morton-nd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(morton-nd REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE morton-nd::MortonND) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -if(morton-nd_VERSION VERSION_LESS "4.0.0") - target_compile_definitions(${PROJECT_NAME} PRIVATE "MORTONND_LESS_4_0_0") -endif() diff --git a/recipes/morton-nd/all/test_v1_package/conanfile.py b/recipes/morton-nd/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/morton-nd/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_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/mosquitto/1.x/test_v1_package/CMakeLists.txt b/recipes/mosquitto/1.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/mosquitto/1.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mosquitto/1.x/test_v1_package/conanfile.py b/recipes/mosquitto/1.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mosquitto/1.x/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_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/mosquitto/2.x/conandata.yml b/recipes/mosquitto/2.x/conandata.yml index 8200a378ca1b5..712fed2843c7b 100644 --- a/recipes/mosquitto/2.x/conandata.yml +++ b/recipes/mosquitto/2.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.21": + url: "https://github.com/eclipse/mosquitto/archive/v2.0.21.tar.gz" + sha256: "551daff96cd0675faf888f8881536177934424ecc45924fecf94cffe207f6e81" "2.0.18": url: "https://github.com/eclipse/mosquitto/archive/v2.0.18.tar.gz" sha256: "25499231664bc5338f9f05eb1815f4d5878f0c6c97e03afb3463a7b139a7e775" diff --git a/recipes/mosquitto/2.x/conanfile.py b/recipes/mosquitto/2.x/conanfile.py index c221f41ff8ca8..e74f95b9fab5b 100644 --- a/recipes/mosquitto/2.x/conanfile.py +++ b/recipes/mosquitto/2.x/conanfile.py @@ -1,7 +1,7 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir, rm from conan.tools.microsoft import is_msvc from conan.tools.scm import Version @@ -43,7 +43,6 @@ class Mosquitto(ConanFile): "websockets": False, "threading": True, } - generators = "CMakeDeps" def config_options(self): if self.settings.os == "Windows": @@ -70,11 +69,22 @@ def requirements(self): self.requires("cjson/1.7.16") if self.options.get_safe("websockets"): self.requires("libwebsockets/4.3.2") + if self.options.get_safe("threading") and self.settings.os == "Windows" and Version(self.version) >= "2.0.21": + self.requires("pthreads4w/3.0.0") + + def build_requirements(self): + # cmake_minimum_version is 3.18 in CMakeLists.txt for mosquitto >= 2.0.21 + self.tool_requires("cmake/[>=3.18 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + deps = CMakeDeps(self) + if self.options.get_safe("threading") and self.settings.os == "Windows" and Version(self.version) >= "2.0.21": + deps.set_property("pthreads4w", "cmake_target_aliases", ["PThreads4W::PThreads4W"]) + deps.generate() + tc = CMakeToolchain(self) tc.variables["WITH_STATIC_LIBRARIES"] = not self.options.shared tc.variables["WITH_PIC"] = self.options.get_safe("fPIC", True) @@ -88,7 +98,11 @@ def generate(self): tc.variables["WITH_APPS"] = self.options.apps tc.variables["WITH_PLUGINS"] = False tc.variables["WITH_LIB_CPP"] = self.options.build_cpp - tc.variables["WITH_THREADING"] = not is_msvc(self) and self.options.threading + if self.settings.os == "Windows" and Version(self.version) < "2.0.21": + # Threading not supported by recipe before 2.0.21 + tc.variables["WITH_THREADING"] = False + else: + tc.variables["WITH_THREADING"] = self.options.threading tc.variables["WITH_WEBSOCKETS"] = self.options.get_safe("websockets", False) tc.variables["STATIC_WEBSOCKETS"] = self.options.get_safe("websockets", False) and not self.dependencies["libwebsockets"].options.shared tc.variables["DOCUMENTATION"] = False @@ -136,6 +150,8 @@ def package_info(self): self.cpp_info.components["libmosquitto"].system_libs = ["pthread", "m"] elif self.settings.os == "Windows": self.cpp_info.components["libmosquitto"].system_libs = ["ws2_32"] + if self.options.get_safe("threading") and Version(self.version) >= "2.0.21": + self.cpp_info.components["libmosquitto"].requires.append("pthreads4w::pthreads4w") if self.options.build_cpp: self.cpp_info.components["libmosquittopp"].set_property("pkg_config_name", "libmosquittopp") diff --git a/recipes/mosquitto/2.x/test_v1_package/CMakeLists.txt b/recipes/mosquitto/2.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index f113bcd8a8b0e..0000000000000 --- a/recipes/mosquitto/2.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/mosquitto/2.x/test_v1_package/conanfile.py b/recipes/mosquitto/2.x/test_v1_package/conanfile.py deleted file mode 100644 index 9963f7a997273..0000000000000 --- a/recipes/mosquitto/2.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conan 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/mosquitto/config.yml b/recipes/mosquitto/config.yml index 0e19ca6c8d04b..ad0414b3fe667 100644 --- a/recipes/mosquitto/config.yml +++ b/recipes/mosquitto/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.21": + folder: "2.x" "2.0.18": folder: "2.x" "2.0.15": 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/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/test_package/CMakeLists.txt b/recipes/mozjpeg/all/test_package/CMakeLists.txt index 43fbdac6cca73..15008f423e6f9 100644 --- a/recipes/mozjpeg/all/test_package/CMakeLists.txt +++ b/recipes/mozjpeg/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(mozjpeg REQUIRED CONFIG) diff --git a/recipes/mozjpeg/all/test_package/conanfile.py b/recipes/mozjpeg/all/test_package/conanfile.py index 2494f49b77c0d..e845ae751a301 100644 --- a/recipes/mozjpeg/all/test_package/conanfile.py +++ b/recipes/mozjpeg/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/mozjpeg/all/test_package/test_package.c b/recipes/mozjpeg/all/test_package/test_package.c index 2f94478d7ef6f..243a65f0efd44 100644 --- a/recipes/mozjpeg/all/test_package/test_package.c +++ b/recipes/mozjpeg/all/test_package/test_package.c @@ -1,528 +1,9 @@ -/* - * rdjpgcom.c - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 2009 by Bill Allombert, Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a very simple stand-alone application that displays - * the text in COM (comment) markers in a JFIF file. - * This may be useful as an example of the minimum logic needed to parse - * JPEG markers. - */ - #include -#include -#include - -#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ -#include "jpeglib.h" /* get auto-config symbols, */ - -#ifdef HAVE_LOCALE_H -#include /* Bill Allombert: use locale for isprint */ -#endif -#include /* to declare isupper(), tolower() */ -#ifdef USE_SETMODE -#include /* to declare setmode()'s parameter macros */ -/* If you have setmode() but not , just delete this line: */ -#include /* to declare setmode() */ -#endif - -#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ -#ifdef __MWERKS__ -#include /* Metrowerks needs this */ -#include /* ... and this */ -#endif -#ifdef THINK_C -#include /* Think declares it here */ -#endif -#endif - -#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ -#define READ_BINARY "r" -#else -#ifdef VMS /* VMS is very nonstandard */ -#define READ_BINARY "rb", "ctx=stm" -#else /* standard ANSI-compliant case */ -#define READ_BINARY "rb" -#endif -#endif - -#ifndef EXIT_FAILURE /* define exit() codes if not provided */ -#define EXIT_FAILURE 1 -#endif -#ifndef EXIT_SUCCESS -#ifdef VMS -#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ -#else -#define EXIT_SUCCESS 0 -#endif -#endif - -/* - * These macros are used to read the input file. - * To reuse this code in another application, you might need to change these. - */ - -static FILE *infile; /* input JPEG file */ - -/* Return next input byte, or EOF if no more */ -#define NEXTBYTE() getc(infile) - -/* Error exit handler */ -#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) - -/* Read one byte, testing for EOF */ -static int read_1_byte(void) { - int c; - - c = NEXTBYTE(); - if (c == EOF) - ERREXIT("Premature EOF in JPEG file"); - return c; -} - -/* Read 2 bytes, convert to unsigned int */ -/* All 2-byte quantities in JPEG markers are MSB first */ -static unsigned int read_2_bytes(void) { - int c1, c2; - - c1 = NEXTBYTE(); - if (c1 == EOF) - ERREXIT("Premature EOF in JPEG file"); - c2 = NEXTBYTE(); - if (c2 == EOF) - ERREXIT("Premature EOF in JPEG file"); - return (((unsigned int)c1) << 8) + ((unsigned int)c2); -} - -/* - * JPEG markers consist of one or more 0xFF bytes, followed by a marker - * code byte (which is not an FF). Here are the marker codes of interest - * in this program. (See jdmarker.c for a more complete list.) - */ - -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_APP0 0xE0 /* Application-specific marker, type N */ -#define M_APP12 0xEC /* (we don't bother to list all 16 APPn's) */ -#define M_COM 0xFE /* COMment */ - -/* - * Find the next JPEG marker and return its marker code. - * We expect at least one FF byte, possibly more if the compressor used FFs - * to pad the file. - * There could also be non-FF garbage between markers. The treatment of such - * garbage is unspecified; we choose to skip over it but emit a warning msg. - * NB: this routine must not be used after seeing SOS marker, since it will - * not deal correctly with FF/00 sequences in the compressed image data... - */ - -static int next_marker(void) { - int c; - int discarded_bytes = 0; - - /* Find 0xFF byte; count and skip any non-FFs. */ - c = read_1_byte(); - while (c != 0xFF) { - discarded_bytes++; - c = read_1_byte(); - } - /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs - * are legal as pad bytes, so don't count them in discarded_bytes. - */ - do { - c = read_1_byte(); - } while (c == 0xFF); - - if (discarded_bytes != 0) { - fprintf(stderr, "Warning: garbage data found in JPEG file\n"); - } - - return c; -} - -/* - * Read the initial marker, which should be SOI. - * For a JFIF file, the first two bytes of the file should be literally - * 0xFF M_SOI. To be more general, we could use next_marker, but if the - * input file weren't actually JPEG at all, next_marker might read the whole - * file and then return a misleading error message... - */ - -static int first_marker(void) { - int c1, c2; - - c1 = NEXTBYTE(); - c2 = NEXTBYTE(); - if (c1 != 0xFF || c2 != M_SOI) - { - ERREXIT("Not a JPEG file"); - } - return c2; -} - -/* - * Most types of marker are followed by a variable-length parameter segment. - * This routine skips over the parameters for any marker we don't otherwise - * want to process. - * Note that we MUST skip the parameter segment explicitly in order not to - * be fooled by 0xFF bytes that might appear within the parameter segment; - * such bytes do NOT introduce new markers. - */ - -static void skip_variable(void) -/* Skip over an unknown or uninteresting variable-length marker */ -{ - unsigned int length; - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - /* Skip over the remaining bytes */ - while (length > 0) { - (void)read_1_byte(); - length--; - } -} - -/* - * Process a COM marker. - * We want to print out the marker contents as legible text; - * we must guard against non-text junk and varying newline representations. - */ - -static void process_COM(int raw) { - unsigned int length; - int ch; - int lastch = 0; - -/* Bill Allombert: set locale properly for isprint */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, ""); -#endif - - /* Get the marker parameter length count */ - length = read_2_bytes(); - /* Length includes itself, so must be at least 2 */ - if (length < 2) - ERREXIT("Erroneous JPEG marker length"); - length -= 2; - - while (length > 0) { - ch = read_1_byte(); - if (raw) { - putc(ch, stdout); - /* Emit the character in a readable form. - * Nonprintables are converted to \nnn form, - * while \ is converted to \\. - * Newlines in CR, CR/LF, or LF form will be printed as one newline. - */ - } else if (ch == '\r') { - printf("\n"); - } else if (ch == '\n') { - if (lastch != '\r') - printf("\n"); - } else if (ch == '\\') { - printf("\\\\"); - } else if (isprint(ch)) { - putc(ch, stdout); - } else { - printf("\\%03o", ch); - } - lastch = ch; - length--; - } - printf("\n"); - -/* Bill Allombert: revert to C locale */ -#ifdef HAVE_LOCALE_H - setlocale(LC_CTYPE, "C"); -#endif -} - -/* - * Process a SOFn marker. - * This code is only needed if you want to know the image dimensions... - */ - -static void process_SOFn(int marker) { - unsigned int length; - unsigned int image_height, image_width; - int data_precision, num_components; - const char *process; - int ci; - - length = read_2_bytes(); /* usual parameter length count */ - - data_precision = read_1_byte(); - image_height = read_2_bytes(); - image_width = read_2_bytes(); - num_components = read_1_byte(); - - switch (marker) { - case M_SOF0: - process = "Baseline"; - break; - case M_SOF1: - process = "Extended sequential"; - break; - case M_SOF2: - process = "Progressive"; - break; - case M_SOF3: - process = "Lossless"; - break; - case M_SOF5: - process = "Differential sequential"; - break; - case M_SOF6: - process = "Differential progressive"; - break; - case M_SOF7: - process = "Differential lossless"; - break; - case M_SOF9: - process = "Extended sequential, arithmetic coding"; - break; - case M_SOF10: - process = "Progressive, arithmetic coding"; - break; - case M_SOF11: - process = "Lossless, arithmetic coding"; - break; - case M_SOF13: - process = "Differential sequential, arithmetic coding"; - break; - case M_SOF14: - process = "Differential progressive, arithmetic coding"; - break; - case M_SOF15: - process = "Differential lossless, arithmetic coding"; - break; - default: - process = "Unknown"; - break; - } - - printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n", - image_width, image_height, num_components, data_precision); - printf("JPEG process: %s\n", process); - - if (length != (unsigned int)(8 + num_components * 3)) - ERREXIT("Bogus SOF marker length"); - - for (ci = 0; ci < num_components; ci++) { - (void)read_1_byte(); /* Component ID code */ - (void)read_1_byte(); /* H, V sampling factors */ - (void)read_1_byte(); /* Quantization table number */ - } -} - -/* - * Parse the marker stream until SOS or EOI is seen; - * display any COM markers. - * While the companion program wrjpgcom will always insert COM markers before - * SOFn, other implementations might not, so we scan to SOS before stopping. - * If we were only interested in the image dimensions, we would stop at SOFn. - * (Conversely, if we only cared about COM markers, there would be no need - * for special code to handle SOFn; we could treat it like other markers.) - */ - -static int scan_JPEG_header(int verbose, int raw) { - int marker; - /* Expect SOI at start of file */ - if (first_marker() != M_SOI) - ERREXIT("Expected SOI marker first"); - - /* Scan miscellaneous markers until we reach SOS. */ - for (;;) { - marker = next_marker(); - switch (marker) { - /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be, - * treated as SOFn. C4 in particular is actually DHT. - */ - case M_SOF0: /* Baseline */ - case M_SOF1: /* Extended sequential, Huffman */ - case M_SOF2: /* Progressive, Huffman */ - case M_SOF3: /* Lossless, Huffman */ - case M_SOF5: /* Differential sequential, Huffman */ - case M_SOF6: /* Differential progressive, Huffman */ - case M_SOF7: /* Differential lossless, Huffman */ - case M_SOF9: /* Extended sequential, arithmetic */ - case M_SOF10: /* Progressive, arithmetic */ - case M_SOF11: /* Lossless, arithmetic */ - case M_SOF13: /* Differential sequential, arithmetic */ - case M_SOF14: /* Differential progressive, arithmetic */ - case M_SOF15: /* Differential lossless, arithmetic */ - if (verbose) - process_SOFn(marker); - else - skip_variable(); - break; - - case M_SOS: /* stop before hitting compressed data */ - return marker; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - return marker; - - case M_COM: - process_COM(raw); - break; - - case M_APP12: - /* Some digital camera makers put useful textual information into - * APP12 markers, so we print those out too when in -verbose mode. - */ - if (verbose) { - printf("APP12 contains:\n"); - process_COM(raw); - } else - skip_variable(); - break; - - default: /* Anything else just gets skipped */ - skip_variable(); /* we assume it has a parameter count... */ - break; - } - } /* end loop */ -} - -/* Command line parsing code */ - -static const char *progname; /* program name for error messages */ - -static void usage(void) -/* complain about bad command line */ -{ - fprintf(stderr, "rdjpgcom displays any textual comments in a JPEG file.\n"); - - fprintf(stderr, "Usage: %s [switches] [inputfile]\n", progname); - - fprintf(stderr, "Switches (names may be abbreviated):\n"); - fprintf( - stderr, - " -raw Display non-printable characters in comments (unsafe)\n"); - fprintf(stderr, " -verbose Also display dimensions of JPEG image\n"); - - exit(EXIT_FAILURE); -} - -static int keymatch(char *arg, const char *keyword, int minchars) -/* Case-insensitive matching of (possibly abbreviated) keyword switches. */ -/* keyword is the constant keyword (must be lower case already), */ -/* minchars is length of minimum legal abbreviation. */ -{ - register int ca, ck; - register int nmatched = 0; - - while ((ca = *arg++) != '\0') { - if ((ck = *keyword++) == '\0') - return 0; /* arg longer than keyword, no good */ - if (isupper(ca)) /* force arg to lcase (assume ck is already) */ - ca = tolower(ca); - if (ca != ck) - return 0; /* no good */ - nmatched++; /* count matched characters */ - } - /* reached end of argument; fail if it's too short for unique abbrev */ - if (nmatched < minchars) - return 0; - return 1; /* A-OK */ -} - -/* - * The main program. - */ - -int main(int argc, char **argv) { - int argn; - char *arg; - int verbose = 1, raw = 0; - -/* On Mac, fetch a command line. */ -#ifdef USE_CCOMMAND - argc = ccommand(&argv); -#endif - - progname = argv[0]; - if (progname == NULL || progname[0] == 0) - progname = "rdjpgcom"; /* in case C library doesn't provide it */ - - /* Parse switches, if any */ - for (argn = 1; argn < argc; argn++) - { - arg = argv[argn]; - if (arg[0] != '-') - break; /* not switch, must be file name */ - arg++; /* advance over '-' */ - if (keymatch(arg, "verbose", 1)) - { - verbose++; - } - else if (keymatch(arg, "raw", 1)) - { - raw = 1; - } - else - usage(); - } - - /* Open the input file. */ - /* Unix style: expect zero or one file name */ - if (argn < argc - 1) - { - fprintf(stderr, "%s: only one input file\n", progname); - usage(); - } - if (argn < argc) - { - if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); - exit(EXIT_FAILURE); - } - } - else if ((infile = fopen("testimg.jpg", READ_BINARY)) == NULL) - { -/* default input file is stdin */ -#ifdef USE_SETMODE /* need to hack file mode? */ - setmode(fileno(stdin), O_BINARY); -#endif -#ifdef USE_FDOPEN /* need to re-open in binary mode? */ - if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) - { - fprintf(stderr, "%s: can't open stdin\n", progname); - exit(EXIT_FAILURE); - } -#else - infile = stdin; -#endif - } - - /* Scan the JPEG headers. */ - (void)scan_JPEG_header(verbose, raw); +#include "jpeglib.h" - /* All done. */ - exit(EXIT_SUCCESS); - return 0; /* suppress no-return-value warnings */ +int main() { + struct jpeg_decompress_struct info; + struct jpeg_error_mgr err; + info.err = jpeg_std_error(&err); + jpeg_create_decompress(&info); } diff --git a/recipes/mozjpeg/all/test_package/testimg.jpg b/recipes/mozjpeg/all/test_package/testimg.jpg deleted file mode 100644 index a026e486f57de..0000000000000 Binary files a/recipes/mozjpeg/all/test_package/testimg.jpg and /dev/null differ diff --git a/recipes/mozjpeg/all/test_package_module/conanfile.py b/recipes/mozjpeg/all/test_package_module/conanfile.py index fd19bb1425057..0a6bc68712d90 100644 --- a/recipes/mozjpeg/all/test_package_module/conanfile.py +++ b/recipes/mozjpeg/all/test_package_module/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/mozjpeg/all/test_v1_package/conanfile.py b/recipes/mozjpeg/all/test_v1_package/conanfile.py index cf6e3a0371de5..5a05af3c2dfd2 100644 --- a/recipes/mozjpeg/all/test_v1_package/conanfile.py +++ b/recipes/mozjpeg/all/test_v1_package/conanfile.py @@ -15,5 +15,4 @@ def build(self): def test(self): if not cross_building(self): bin_path = os.path.join("bin", "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/mozjpeg/all/test_v1_package_module/conanfile.py b/recipes/mozjpeg/all/test_v1_package_module/conanfile.py index b6600e428515c..19e6a0c06e3d8 100644 --- a/recipes/mozjpeg/all/test_v1_package_module/conanfile.py +++ b/recipes/mozjpeg/all/test_v1_package_module/conanfile.py @@ -14,5 +14,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - img_name = os.path.join(self.source_folder, os.pardir, "test_package", "testimg.jpg") - self.run(f"{bin_path} {img_name}", run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/mp-units/0.8.0/conanfile.py b/recipes/mp-units/0.8.0/conanfile.py index c44e1496f2a03..147e52908bb8c 100644 --- a/recipes/mp-units/0.8.0/conanfile.py +++ b/recipes/mp-units/0.8.0/conanfile.py @@ -59,7 +59,7 @@ def _use_range_v3(self): def requirements(self): self.requires("gsl-lite/0.40.0") if self._use_libfmt: - self.requires("fmt/10.1.0") + self.requires("fmt/10.2.1") if self._use_range_v3: self.requires("range-v3/0.12.0") diff --git a/recipes/mp-units/0.8.0/test_v1_package/conanfile.py b/recipes/mp-units/0.8.0/test_v1_package/conanfile.py deleted file mode 100644 index 048e0f9557d47..0000000000000 --- a/recipes/mp-units/0.8.0/test_v1_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_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/0.8.0/test_v1_package/test_package.cpp b/recipes/mp-units/0.8.0/test_v1_package/test_package.cpp deleted file mode 100644 index cd9ed5c7a0227..0000000000000 --- a/recipes/mp-units/0.8.0/test_v1_package/test_package.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#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 index 79322cc88147b..a3b955f5397c3 100644 --- a/recipes/mp-units/2.0.0/conandata.yml +++ b/recipes/mp-units/2.0.0/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.1.1": + url: https://github.com/mpusz/units/archive/v2.1.1.tar.gz + sha256: 881070fd9a15a8954a4e38d991e398dc9638907bbc13961a530519596c9783f9 + "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 index e7312a805414c..655d918b9aed6 100644 --- a/recipes/mp-units/2.0.0/conanfile.py +++ b/recipes/mp-units/2.0.0/conanfile.py @@ -14,7 +14,7 @@ class MPUnitsConan(ConanFile): name = "mp-units" homepage = "https://github.com/mpusz/mp-units" - description = "A Physical Quantities and Units library for C++" + description = "A Quantities and Units library for C++" topics = ( "units", "dimensions", @@ -42,8 +42,8 @@ def _min_cppstd(self): @property def _minimum_compilers_version(self): - # Note that apple-clang and msvc are disabled for now, their C++ 20 implementations are not up to speed - return {"gcc": "11", "clang": "16"} + # 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): @@ -52,18 +52,10 @@ def _use_libfmt(self): std_support = compiler == "msvc" and version >= 193 and compiler.cppstd == 23 return not std_support - @property - def _use_range_v3(self): - compiler = self.settings.compiler - version = Version(self.settings.compiler.version) - return "clang" in compiler and compiler.libcxx == "libc++" and version < 14 - def requirements(self): self.requires("gsl-lite/0.40.0") if self._use_libfmt: - self.requires("fmt/10.1.0") - if self._use_range_v3: - self.requires("range-v3/0.11.0") + self.requires("fmt/10.2.1") def validate(self): if self.settings.get_safe("compiler.cppstd"): @@ -81,11 +73,12 @@ def loose_lt_semver(v1, v2): raise ConanInvalidConfiguration( f"{self.ref} requires at least {compiler} {min_version} ({compiler.version} in use)" ) - - # Note that apple-clang and msvc are disabled for now, their C++ 20 implementations are not up to speed + # Re-enable once newer versions with better support come out - if is_msvc(self) or compiler == "apple-clang": - raise ConanInvalidConfiguration(f"{self.ref} disabled for {compiler} as their C++20 implementation is not up to speed yet") + 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") @@ -126,8 +119,6 @@ def package_info(self): 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"] 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 deleted file mode 100644 index 07f3e7cd91e8a..0000000000000 --- a/recipes/mp-units/2.0.0/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 048e0f9557d47..0000000000000 --- a/recipes/mp-units/2.0.0/test_v1_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_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 deleted file mode 100644 index f7a82eba1d2de..0000000000000 --- a/recipes/mp-units/2.0.0/test_v1_package/test_package.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#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.2.0/conandata.yml b/recipes/mp-units/2.2.0/conandata.yml new file mode 100644 index 0000000000000..2aee126e2e782 --- /dev/null +++ b/recipes/mp-units/2.2.0/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.2.1": + url: https://github.com/mpusz/units/archive/v2.2.1.tar.gz + sha256: ce5edb27fad9c54b388040341a03d7f2462d61dcedad85b4c983c0e648a91bac diff --git a/recipes/mp-units/2.2.0/conanfile.py b/recipes/mp-units/2.2.0/conanfile.py new file mode 100644 index 0000000000000..89060efea4041 --- /dev/null +++ b/recipes/mp-units/2.2.0/conanfile.py @@ -0,0 +1,274 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import default_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.scm import Version + +required_conan_version = ">=1.59.0" + + +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] + + +class MPUnitsConan(ConanFile): + name = "mp-units" + homepage = "https://github.com/mpusz/mp-units" + description = "The 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" + options = { + "cxx_modules": [True, False], + "std_format": [True, False], + "string_view_ret": [True, False], + "no_crtp": [True, False], + "contracts": ["none", "gsl-lite", "ms-gsl"], + "freestanding": [True, False], + } + default_options = { + # "cxx_modules" default set in config_options() + # "std_format" default set in config_options() + # "string_view_ret" default set in config_options() + # "no_crtp" default set in config_options() + "contracts": "gsl-lite", + "freestanding": False, + } + package_type = "header-library" + no_copy_source = True + + @property + def _feature_compatibility(self): + return { + "minimum_support": { + "min_cppstd": "20", + "compiler": { + "gcc": "12", + "clang": "16", + "apple-clang": "15", + "msvc": "", + "Visual Studio": "", + }, + }, + "std_format": { + "min_cppstd": "20", + "compiler": { + "gcc": "13", + "clang": "17", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + "cxx_modules": { + "min_cppstd": "20", + "compiler": { + "gcc": "", + "clang": "17", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + "static_constexpr_vars_in_constexpr_func": { + "min_cppstd": "23", + "compiler": { + "gcc": "13", + "clang": "17", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + "explicit_this": { + "min_cppstd": "23", + "compiler": { + "gcc": "14", + "clang": "18", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + } + + @property + def _option_feature_map(self): + return { + "std_format": "std_format", + "cxx_modules": "cxx_modules", + "string_view_ret": "static_constexpr_vars_in_constexpr_func", + "no_crtp": "explicit_this", + } + + def _set_default_option(self, name): + compiler = self.settings.compiler + feature_name = self._option_feature_map[name] + feature = self._feature_compatibility[feature_name] + min_version = feature["compiler"].get(str(compiler)) + setattr( + self.options, + name, + bool( + min_version + and Version(compiler.version) >= min_version + and valid_min_cppstd(self, feature["min_cppstd"]) + ), + ) + + def _check_feature_supported(self, name, feature_name=name): + compiler = self.settings.compiler + cppstd = compiler.get_safe("cppstd") + feature = self._feature_compatibility[feature_name] + + # check C++ version + if cppstd and not valid_min_cppstd(self, feature["min_cppstd"]): + raise ConanInvalidConfiguration( + f"'{name}' requires at least cppstd={feature['min_cppstd']} ({cppstd} in use)", + ) + + # check compiler version + min_version = feature["compiler"].get(str(compiler)) + if min_version == None: + # not tested compiler being used - use at your own risk + return + if min_version == "": + raise ConanInvalidConfiguration( + f"'{name}' is not yet supported by any known {compiler} version" + ) + if loose_lt_semver(str(compiler.version), min_version): + raise ConanInvalidConfiguration( + f"'{name}' requires at least {compiler}-{min_version} ({compiler}-{compiler.version} in use)" + ) + + def config_options(self): + for key in self._option_feature_map.keys(): + self._set_default_option(key) + + def configure(self): + if self.options.freestanding: + self.options.rm_safe("std_format") + + def requirements(self): + if not self.options.freestanding: + if self.options.contracts == "gsl-lite": + self.requires("gsl-lite/0.41.0") + elif self.options.contracts == "ms-gsl": + self.requires("ms-gsl/4.0.0") + if not self.options.std_format: + self.requires("fmt/10.2.1") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.29 <4]") + + def validate(self): + self._check_feature_supported("mp-units", "minimum_support") + for key, value in self._option_feature_map.items(): + if self.options.get_safe(key) == True: + self._check_feature_supported(key, value) + if self.options.freestanding and self.options.contracts != "none": + raise ConanInvalidConfiguration( + "'contracts' should be set to 'none' for a freestanding build" + ) + + 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 self.options.cxx_modules: + tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True + tc.cache_variables["MP_UNITS_BUILD_CXX_MODULES"] = self.options.cxx_modules + if self.options.freestanding: + tc.cache_variables["MP_UNITS_API_FREESTANDING"] = True + else: + tc.cache_variables["MP_UNITS_API_STD_FORMAT"] = self.options.std_format + tc.cache_variables["MP_UNITS_API_STRING_VIEW_RET"] = ( + self.options.string_view_ret + ) + tc.cache_variables["MP_UNITS_API_NO_CRTP"] = self.options.no_crtp + tc.cache_variables["MP_UNITS_API_CONTRACTS"] = str( + self.options.contracts + ).upper() + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder="src") + if self.options.cxx_modules: + 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 + + # handle contracts + if self.options.contracts == "none": + self.cpp_info.components["core"].defines.append("MP_UNITS_API_CONTRACTS=0") + elif self.options.contracts == "gsl-lite": + self.cpp_info.components["core"].requires.append("gsl-lite::gsl-lite") + self.cpp_info.components["core"].defines.append("MP_UNITS_API_CONTRACTS=2") + elif self.options.contracts == "ms-gsl": + self.cpp_info.components["core"].requires.append("ms-gsl::ms-gsl") + self.cpp_info.components["core"].defines.append("MP_UNITS_API_CONTRACTS=3") + + # handle API options + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_STRING_VIEW_RET=" + + str(int(self.options.string_view_ret == True)) + ) + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_NO_CRTP=" + str(int(self.options.no_crtp == True)) + ) + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_STD_FORMAT=" + str(int(self.options.std_format == True)) + ) + if not self.options.std_format: + self.cpp_info.components["core"].requires.append("fmt::fmt") + + # handle hosted configuration + if not self.options.freestanding: + self.cpp_info.components["core"].defines.append("MP_UNITS_HOSTED=1") + + if compiler == "msvc": + self.cpp_info.components["core"].cxxflags = ["/utf-8"] + + self.cpp_info.components["systems"].requires = ["core"] diff --git a/recipes/mp-units/0.8.0/test_v1_package/CMakeLists.txt b/recipes/mp-units/2.2.0/test_package/CMakeLists.txt similarity index 100% rename from recipes/mp-units/0.8.0/test_v1_package/CMakeLists.txt rename to recipes/mp-units/2.2.0/test_package/CMakeLists.txt diff --git a/recipes/mp-units/2.2.0/test_package/conanfile.py b/recipes/mp-units/2.2.0/test_package/conanfile.py new file mode 100644 index 0000000000000..e418ee7701960 --- /dev/null +++ b/recipes/mp-units/2.2.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.2.0/test_package/test_package.cpp b/recipes/mp-units/2.2.0/test_package/test_package.cpp new file mode 100644 index 0000000000000..1182e75d816e4 --- /dev/null +++ b/recipes/mp-units/2.2.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.3.0/conandata.yml b/recipes/mp-units/2.3.0/conandata.yml new file mode 100644 index 0000000000000..bde86ac17bc97 --- /dev/null +++ b/recipes/mp-units/2.3.0/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.4.0": + url: https://github.com/mpusz/units/archive/v2.4.0.tar.gz + sha256: 777e53ba8da891161e90a93b90b92fa66951d49aaae1b0203ddf934532bbeb56 + "2.3.0": + url: https://github.com/mpusz/units/archive/v2.3.0.tar.gz + sha256: ce2f167ff788ae769e73ea7676f15302827cd37908da3928dcae048f916898d6 diff --git a/recipes/mp-units/2.3.0/conanfile.py b/recipes/mp-units/2.3.0/conanfile.py new file mode 100644 index 0000000000000..22e718ebd0955 --- /dev/null +++ b/recipes/mp-units/2.3.0/conanfile.py @@ -0,0 +1,325 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import valid_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" + + +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] + + +class MPUnitsConan(ConanFile): + name = "mp-units" + homepage = "https://github.com/mpusz/mp-units" + description = "The 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" + options = { + "cxx_modules": [True, False], + "import_std": [True, False], + "std_format": [True, False], + "string_view_ret": [True, False], + "no_crtp": [True, False], + "contracts": ["none", "gsl-lite", "ms-gsl"], + "freestanding": [True, False], + } + default_options = { + # "cxx_modules" default set in config_options() + # "import_std" default set in config_options() + # "std_format" default set in config_options() + # "string_view_ret" default set in config_options() + # "no_crtp" default set in config_options() + "contracts": "gsl-lite", + "freestanding": False, + } + no_copy_source = True + + @property + def _feature_compatibility(self): + return { + "minimum_support": { + "min_cppstd": "20", + "compiler": { + "gcc": "12", + "clang": "16", + "apple-clang": "15", + "msvc": "194", + "Visual Studio": "17", + }, + }, + "std_format": { + "min_cppstd": "20", + "compiler": { + "gcc": "13", + "clang": "17", + "apple-clang": "", + "msvc": "194", + "Visual Studio": "17", + }, + }, + "cxx_modules": { + "min_cppstd": "20", + "compiler": { + "gcc": "", + "clang": "17", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + "import_std": { + "min_cppstd": "23", + "compiler": {"gcc": "", "clang": "18", "apple-clang": "", "msvc": ""}, + }, + "static_constexpr_vars_in_constexpr_func": { + "min_cppstd": "23", + "compiler": { + "gcc": "13", + "clang": "17", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + "explicit_this": { + "min_cppstd": "23", + "compiler": { + "gcc": "14", + "clang": "18", + "apple-clang": "", + "msvc": "", + "Visual Studio": "", + }, + }, + } + + @property + def _option_feature_map(self): + return { + "std_format": "std_format", + "cxx_modules": "cxx_modules", + "import_std": "import_std", + "string_view_ret": "static_constexpr_vars_in_constexpr_func", + "no_crtp": "explicit_this", + } + + def _set_default_option(self, name): + compiler = self.settings.compiler + feature_name = self._option_feature_map[name] + feature = self._feature_compatibility[feature_name] + min_version = feature["compiler"].get(str(compiler)) + setattr( + self.options, + name, + bool( + min_version + and Version(compiler.version) >= min_version + and valid_min_cppstd(self, feature["min_cppstd"]) + ), + ) + + def _check_feature_supported(self, name, feature_name=name): + compiler = self.settings.compiler + cppstd = compiler.get_safe("cppstd") + feature = self._feature_compatibility[feature_name] + + # check C++ version + if cppstd and not valid_min_cppstd(self, feature["min_cppstd"]): + raise ConanInvalidConfiguration( + f"'{name}' requires at least cppstd={feature['min_cppstd']} ({cppstd} in use)", + ) + + # check compiler version + min_version = feature["compiler"].get(str(compiler)) + if min_version == None: + # not tested compiler being used - use at your own risk + return + if min_version == "": + raise ConanInvalidConfiguration( + f"'{name}' is not yet supported by any known {compiler} version" + ) + if loose_lt_semver(str(compiler.version), min_version): + raise ConanInvalidConfiguration( + f"'{name}' requires at least {compiler}-{min_version} ({compiler}-{compiler.version} in use)" + ) + + def config_options(self): + for key in self._option_feature_map.keys(): + self._set_default_option(key) + # TODO mixing of `import std;` and regular header files includes does not work for now + if self.options.import_std: + self.options.contracts = "none" + + def configure(self): + if self.options.cxx_modules: + self.package_type = "static-library" + else: + self.package_type = "header-library" + if self.options.freestanding: + self.options.rm_safe("std_format") + + def requirements(self): + if not self.options.freestanding: + if self.options.contracts == "gsl-lite": + self.requires("gsl-lite/0.41.0", transitive_headers=True) + elif self.options.contracts == "ms-gsl": + self.requires("ms-gsl/4.0.0", transitive_headers=True) + if not self.options.std_format: + self.requires("fmt/11.0.1", transitive_headers=True) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.30 <4]") + + def validate(self): + self._check_feature_supported("mp-units", "minimum_support") + for key, value in self._option_feature_map.items(): + if self.options.get_safe(key) == True: + self._check_feature_supported(key, value) + if self.options.freestanding and self.options.contracts != "none": + raise ConanInvalidConfiguration( + "'contracts' should be set to 'none' for a freestanding build" + ) + # TODO mixing of `import std;` and regular header files includes does not work for now + if self.options.import_std: + if self.options.contracts != "none": + raise ConanInvalidConfiguration( + "'contracts' should be set to 'none' to use `import std;`" + ) + if not self.options.get_safe("std_format", default=True): + raise ConanInvalidConfiguration( + "'std_format' should be enabled to use `import std;`" + ) + + 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): + opt = self.options + tc = CMakeToolchain(self) + if opt.cxx_modules: + tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True + if opt.import_std: + tc.cache_variables["CMAKE_CXX_MODULE_STD"] = True + # TODO current experimental support according to `Help/dev/experimental.rst` + tc.cache_variables["CMAKE_EXPERIMENTAL_CXX_IMPORT_STD"] = ( + "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" + ) + + # TODO remove the below when Conan will learn to handle C++ modules + if opt.freestanding: + tc.cache_variables["MP_UNITS_API_FREESTANDING"] = True + else: + tc.cache_variables["MP_UNITS_API_STD_FORMAT"] = opt.std_format + tc.cache_variables["MP_UNITS_API_CONTRACTS"] = str(opt.contracts).upper() + + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure(build_script_folder="src") + if self.options.cxx_modules: + cmake.build() + + def package_id(self): + if self.package_type == "header-library": + 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() + # TODO remove the below when Conan will learn to handle C++ modules + if not self.options.cxx_modules: + # We have to preserve those files for C++ modules build as Conan + # can't generate such CMake targets for now + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + compiler = self.settings.compiler + # TODO remove the branch when Conan will learn to handle C++ modules + if self.options.cxx_modules: + # CMakeDeps does not generate C++ modules definitions for now + # Skip the Conan-generated files and use the mp-unitsConfig.cmake bundled with mp-units + self.cpp_info.set_property("cmake_find_mode", "none") + self.cpp_info.builddirs = ["."] + else: + # handle contracts + if self.options.contracts == "none": + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_CONTRACTS=0" + ) + elif self.options.contracts == "gsl-lite": + self.cpp_info.components["core"].requires.append("gsl-lite::gsl-lite") + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_CONTRACTS=2" + ) + elif self.options.contracts == "ms-gsl": + self.cpp_info.components["core"].requires.append("ms-gsl::ms-gsl") + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_CONTRACTS=3" + ) + + # handle API options + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_STRING_VIEW_RET=" + + str(int(self.options.string_view_ret == True)) + ) + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_NO_CRTP=" + str(int(self.options.no_crtp == True)) + ) + self.cpp_info.components["core"].defines.append( + "MP_UNITS_API_STD_FORMAT=" + str(int(self.options.std_format == True)) + ) + if not self.options.std_format: + self.cpp_info.components["core"].requires.append("fmt::fmt") + + # handle hosted configuration + if not self.options.freestanding: + self.cpp_info.components["core"].defines.append("MP_UNITS_HOSTED=1") + + # handle import std + if self.options.import_std: + self.cpp_info.components["core"].defines.append("MP_UNITS_IMPORT_STD") + if compiler == "clang" and Version(compiler.version) < 19: + self.cpp_info.components["core"].cxxflags.append( + "-Wno-deprecated-declarations" + ) + + if compiler == "msvc": + self.cpp_info.components["core"].cxxflags.append("/utf-8") + + self.cpp_info.components["systems"].requires = ["core"] diff --git a/recipes/mp-units/2.3.0/test_package/CMakeLists.txt b/recipes/mp-units/2.3.0/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0938e502d546b --- /dev/null +++ b/recipes/mp-units/2.3.0/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.25) +project(test_package LANGUAGES CXX) + +find_package(mp-units 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.3.0/test_package/conanfile.py b/recipes/mp-units/2.3.0/test_package/conanfile.py new file mode 100644 index 0000000000000..b2ed4344df2cb --- /dev/null +++ b/recipes/mp-units/2.3.0/test_package/conanfile.py @@ -0,0 +1,46 @@ +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 requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + opt = self.dependencies["mp-units"].options + if opt.cxx_modules: + tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True + if opt.import_std: + tc.cache_variables["CMAKE_CXX_MODULE_STD"] = True + # Current experimental support according to `Help/dev/experimental.rst` + tc.cache_variables[ + "CMAKE_EXPERIMENTAL_CXX_IMPORT_STD" + ] = "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" + # TODO remove the below when Conan will learn to handle C++ modules + if opt.freestanding: + tc.cache_variables["MP_UNITS_API_FREESTANDING"] = True + else: + tc.cache_variables["MP_UNITS_API_STD_FORMAT"] = opt.std_format + tc.cache_variables["MP_UNITS_API_CONTRACTS"] = str(opt.contracts).upper() + 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/mp-units/2.3.0/test_package/test_package.cpp b/recipes/mp-units/2.3.0/test_package/test_package.cpp new file mode 100644 index 0000000000000..5cdfe02de428f --- /dev/null +++ b/recipes/mp-units/2.3.0/test_package/test_package.cpp @@ -0,0 +1,30 @@ +#include +#include +#ifdef MP_UNITS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef MP_UNITS_MODULES +import mp_units; +#else +#include +#include +#include +#include +#endif + +using namespace mp_units; + +constexpr QuantityOf auto avg_speed( + QuantityOf auto d, + QuantityOf auto t) +{ + return d / t; +} + +int main() +{ + using namespace mp_units::si::unit_symbols; + std::cout << MP_UNITS_STD_FMT::format("Average speed = {}\n", avg_speed(240 * km, 2 * h)); +} diff --git a/recipes/mp-units/config.yml b/recipes/mp-units/config.yml index 80a7d8dff9ed1..65cd632824585 100644 --- a/recipes/mp-units/config.yml +++ b/recipes/mp-units/config.yml @@ -1,5 +1,15 @@ versions: - "0.8.0": - folder: 0.8.0 + "2.4.0": + folder: 2.3.0 + "2.3.0": + folder: 2.3.0 + "2.2.1": + folder: 2.2.0 + "2.1.1": + folder: 2.0.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/test_package/CMakeLists.txt b/recipes/mpark-variant/all/test_package/CMakeLists.txt index 1d878b6a4c4f5..ab8a7b1d25400 100644 --- a/recipes/mpark-variant/all/test_package/CMakeLists.txt +++ b/recipes/mpark-variant/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(mpark_variant REQUIRED CONFIG) diff --git a/recipes/mpark-variant/all/test_v1_package/CMakeLists.txt b/recipes/mpark-variant/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/mpark-variant/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mpark-variant/all/test_v1_package/conanfile.py b/recipes/mpark-variant/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mpark-variant/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_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/mpc/all/test_package/CMakeLists.txt b/recipes/mpc/all/test_package/CMakeLists.txt index 3a407d4714c49..3f7caef7ec10d 100644 --- a/recipes/mpc/all/test_package/CMakeLists.txt +++ b/recipes/mpc/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(mpc REQUIRED CONFIG) diff --git a/recipes/mpdecimal/2.4.2/conandata.yml b/recipes/mpdecimal/2.4.2/conandata.yml deleted file mode 100644 index 41a874b9a4e1b..0000000000000 --- a/recipes/mpdecimal/2.4.2/conandata.yml +++ /dev/null @@ -1,10 +0,0 @@ -sources: - "2.4.2": - sha256: "83c628b90f009470981cf084c5418329c88b19835d8af3691b930afccb7d79c7" - 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" diff --git a/recipes/mpdecimal/2.4.2/conanfile.py b/recipes/mpdecimal/2.4.2/conanfile.py deleted file mode 100644 index e0edbd2d2f318..0000000000000 --- a/recipes/mpdecimal/2.4.2/conanfile.py +++ /dev/null @@ -1,208 +0,0 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration -import os -import shutil - - -class MpdecimalConan(ConanFile): - name = "mpdecimal" - version = "2.4.2" - 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/**" - 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 _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 config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - _shared_ext_mapping = { - "Linux": ".so", - "Windows": ".dll", - "Macos": ".dylib", - } - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if not self._is_msvc: - """ - Using autotools: - - Build only shared libraries when shared == True - - Build only static libraries when shared == False - ! 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)] - 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@") - 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", - "") - 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)) - 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", - "") - - tools.replace_in_file(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)) - else: - tools.replace_in_file(mpdec_makefile_in, - "libmpdec.so", - "libmpdec{}".format(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) - - 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(self): - self._patch_sources() - if self._is_msvc: - self._build_msvc() - else: - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - 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") - else: - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - - def package_info(self): - if self._is_msvc: - self.cpp_info.libs = ["libmpdec-{}".format(self.version)] - else: - self.cpp_info.libs = ["mpdec"] - if self.options.shared: - if self._is_msvc: - self.cpp_info.defines = ["USE_DLL"] - else: - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["m"] diff --git a/recipes/mpdecimal/2.4.2/patches/0001-msvc-fixes.patch b/recipes/mpdecimal/2.4.2/patches/0001-msvc-fixes.patch deleted file mode 100644 index 6cf24bf3123be..0000000000000 --- a/recipes/mpdecimal/2.4.2/patches/0001-msvc-fixes.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- libmpdec/Makefile.vc -+++ libmpdec/Makefile.vc -@@ -45,25 +45,25 @@ - !if "$(DLL)" == "1" - BFLAGS= /DBUILD_DLL - UFLAGS= /DUSE_DLL --LFLAGS= $(LFLAGS) /DLL /MANIFEST -+LFLAGS= $(LFLAGS) /DLL /MANIFEST $(CONAN_LDFLAGS) - BUILDLIB = $(LIBSHARED) - USELIB = $(LIBIMPORT) - !if "$(DEBUG)" == "1" --OPT = /MDd /Od /Zi -+OPT = /Od /Zi - !else --OPT = /MD /Ox /GS /EHsc -+OPT = /Ox /GS /EHsc - !endif - !else - BUILDLIB = $(LIBSTATIC) - USELIB = $(LIBSTATIC) - !if "$(DEBUG)" == "1" --OPT = /MTd /Od /Zi -+OPT = /Od /Zi - !else --OPT = /MT /Ox /GS /EHsc -+OPT = /Ox /GS /EHsc - !endif - !endif - --CFLAGS = /W3 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT) -+CFLAGS = /W3 /D_CRT_SECURE_NO_WARNINGS /nologo $(CONFIG) $(OPT) $(CONAN_CFLAGS) - - - default: $(BUILDLIB) runtest diff --git a/recipes/mpdecimal/2.4.2/patches/0002-disable-vcstdint-h-vs2015.patch b/recipes/mpdecimal/2.4.2/patches/0002-disable-vcstdint-h-vs2015.patch deleted file mode 100644 index d33b6590eaa16..0000000000000 --- a/recipes/mpdecimal/2.4.2/patches/0002-disable-vcstdint-h-vs2015.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- libmpdec/vcstdint.h -+++ libmpdec/vcstdint.h -@@ -32,7 +32,7 @@ - #ifndef _MSC_VER // [ - #error "Use this header only with Microsoft Visual C++ compilers!" - #endif // _MSC_VER ] -- -+#if _MSC_VER < 1900 // Only enable for Visual Studio <2015 - #ifndef _MSC_STDINT_H_ // [ - #define _MSC_STDINT_H_ - -@@ -230,3 +230,6 @@ - - - #endif // _MSC_STDINT_H_ ] -+#else // Only enable for Visual Studio <2015 -+#include -+#endif // Only enable for Visual Studio <2015 diff --git a/recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt b/recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt deleted file mode 100644 index 3a403dc404b41..0000000000000 --- a/recipes/mpdecimal/2.4.2/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/mpdecimal/2.4.2/test_package/conanfile.py b/recipes/mpdecimal/2.4.2/test_package/conanfile.py deleted file mode 100644 index 97c415cdb0a2a..0000000000000 --- a/recipes/mpdecimal/2.4.2/test_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -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): - self.run("{} 13 100".format(os.path.join("bin", "test_package")), run_environment=True) diff --git a/recipes/mpdecimal/2.4.2/test_package/test_package.c b/recipes/mpdecimal/2.4.2/test_package/test_package.c deleted file mode 100644 index 34918c7c1986c..0000000000000 --- a/recipes/mpdecimal/2.4.2/test_package/test_package.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 - -#include -#include -#include - -int -main(int argc, char **argv) -{ - mpd_context_t ctx; - mpd_t *a, *b; - mpd_t *result; - char *rstring; - char status_str[MPD_MAX_FLAG_STRING]; - clock_t start_clock, end_clock; - - if (argc != 3) { - fprintf(stderr, "pow: usage: ./pow x y\n"); - exit(1); - } - - mpd_init(&ctx, 38); - ctx.traps = 0; - - result = mpd_new(&ctx); - a = mpd_new(&ctx); - b = mpd_new(&ctx); - mpd_set_string(a, argv[1], &ctx); - mpd_set_string(b, argv[2], &ctx); - - start_clock = clock(); - mpd_pow(result, a, b, &ctx); - end_clock = clock(); - fprintf(stderr, "time: %f\n\n", - (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); - - rstring = mpd_to_sci(result, 1); - mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); - printf("%s %s\n", rstring, status_str); - - mpd_del(a); - mpd_del(b); - mpd_del(result); - mpd_free(rstring); - - return 0; -} diff --git a/recipes/mpdecimal/2.5.x/conandata.yml b/recipes/mpdecimal/2.5.x/conandata.yml deleted file mode 100644 index 93278b2f9479e..0000000000000 --- a/recipes/mpdecimal/2.5.x/conandata.yml +++ /dev/null @@ -1,15 +0,0 @@ -sources: - "2.5.1": - sha256: "9f9cd4c041f99b5c49ffb7b59d9f12d95b683d88585608aa56a6307667b2b21f" - url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz" - "2.5.0": - sha256: "15417edc8e12a57d1d9d75fa7e3f22b158a3b98f44db9d694cfd2acde8dfa0ca" - url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.0.tar.gz" -patches: - "2.5.1": - - patch_file: "patches/2.5.1-0001-msvc-fixes.patch" - - patch_file: "patches/2.5.1-0002-add-mingw-to-configure-ac.patch" - - patch_file: "patches/2.5.1-0003-use-MPDECIMAL_DLL.patch" - "2.5.0": - - patch_file: "patches/0001-2.5.0-msvc-fixes.patch" - - patch_file: "patches/0002-add-mingw-to-configure-ac.patch" diff --git a/recipes/mpdecimal/2.5.x/conanfile.py b/recipes/mpdecimal/2.5.x/conanfile.py deleted file mode 100644 index 5d90356bfd228..0000000000000 --- a/recipes/mpdecimal/2.5.x/conanfile.py +++ /dev/null @@ -1,242 +0,0 @@ -from conan import ConanFile -from conan.tools.gnu import AutotoolsToolchain, AutotoolsDeps, Autotools -from conan.tools.files import get, chdir, copy, export_conandata_patches, apply_conandata_patches, mkdir, rename -from conan.tools.layout import basic_layout -from conan.tools.build import cross_building -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv -from conan.tools.microsoft import VCVars, is_msvc, NMakeDeps, NMakeToolchain -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" - - -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") - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://www.bytereef.org/mpdecimal" - settings = "os", "compiler", "build_type", "arch" - options = { - "shared": [True, False], - "fPIC": [True, False], - "cxx": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - "cxx": True, - } - - @property - def _settings_build(self): - return getattr(self, "setings_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: - self.options.rm_safe("fPIC") - if not self.options.cxx: - 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 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") - if self.options.cxx: - if self.options.shared and self.settings.os == "Windows": - raise ConanInvalidConfiguration( - "A shared libmpdec++ is not possible on Windows (due to non-exportable thread local storage)") - - def build_requirements(self): - if is_msvc(self): - self.tool_requires("automake/1.16.4") - else: - # required to suppport 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): - self.tool_requires("msys2/cci.latest") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - - def generate(self): - if is_msvc(self): - vcvars = VCVars(self) - vcvars.generate() - - deps = NMakeDeps(self) - deps.generate() - - tc = NMakeToolchain(self) - if Version(self.version) >= "2.5.1": - if self.options.shared: - tc.extra_cflags.append("-DMPDECIMAL_DLL") - if self.options.cxx: - tc.extra_cxxflags.append("-DLIBMPDECXX_DLL") - tc.generate() - else: - # inject tool_requires env vars in build scope (not needed if there is no tool_requires) - env = VirtualBuildEnv(self) - env.generate() - # inject requires env vars in build scope - # it's required in case of native build when there is AutotoolsDeps & at least one dependency which might be shared, because configure tries to run a test executable - if not cross_building(self): - env = VirtualRunEnv(self) - env.generate(scope="build") - - tc = AutotoolsToolchain(self) - tc.configure_args.append("--enable-cxx" if self.options.cxx else "--disable-cxx") - 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 _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) - - copy(self, "Makefile.vc", libmpdec_folder, build_dir) - rename(self, build_dir / "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") - - builds = [[libmpdec_folder, mpdec_target]] - if self.options.cxx: - builds.append([libmpdecpp_folder, mpdecpp_target]) - - for build_dir, target in builds: - with chdir(self, build_dir): - self.run("""nmake -f Makefile.vc {target} MACHINE={machine} DEBUG={debug} DLL={dll}""".format( - target=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", - )) - - 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) - else: - copy(self, "libmpdec-{}.lib".format(self.version), 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) - - @property - def _shared_suffix(self): - if is_apple_os(self): - return ".dylib" - return { - "Windows": ".dll", - }.get(str(self.settings.os), ".so") - - @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) - - def build(self): - apply_conandata_patches(self) - if is_msvc(self): - self._build_msvc() - else: - autotools = Autotools(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")) - 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++")) - 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) - 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") - 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++" - copy(self, "mpdecimal.h", src=mpdecdir, dst=pkg_dir / "include") - if self.options.cxx: - copy(self, "decimal.hh", src=mpdecppdir, dst=pkg_dir / "include") - builddirs = [mpdecdir] - if self.options.cxx: - builddirs.append(mpdecppdir) - for builddir in builddirs: - copy(self, "*.a", src=builddir, dst=pkg_dir / "lib") - copy(self, "*.so", src=builddir, dst=pkg_dir / "lib") - copy(self, "*.so.*", src=builddir, dst=pkg_dir / "lib") - copy(self, "*.dylib", src=builddir, dst=pkg_dir / "lib") - copy(self, "*.dll", src=builddir, dst=pkg_dir / "bin") - - def package_info(self): - lib_pre_suf = ("", "") - if is_msvc(self): - lib_pre_suf = ("lib", "-{}".format(self.version)) - elif self.settings.os == "Windows": - if self.options.shared: - lib_pre_suf = ("", ".dll") - - self.cpp_info.components["libmpdecimal"].libs = ["{}mpdec{}".format(*lib_pre_suf)] - if self.options.shared and is_msvc(self): - if Version(self.version) >= "2.5.1": - self.cpp_info.components["libmpdecimal"].defines = ["MPDECIMAL_DLL"] - else: - self.cpp_info.components["libmpdecimal"].defines = ["USE_DLL"] - - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["libmpdecimal"].system_libs = ["m"] - - if self.options.cxx: - self.cpp_info.components["libmpdecimal++"].libs = ["{}mpdec++{}".format(*lib_pre_suf)] - self.cpp_info.components["libmpdecimal++"].requires = ["libmpdecimal"] - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["libmpdecimal++"].system_libs = ["pthread"] - if self.options.shared and Version(self.version) >= "2.5.1": - self.cpp_info.components["libmpdecimal"].defines = ["MPDECIMALXX_DLL"] diff --git a/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt b/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt deleted file mode 100644 index f5aa7762f69b0..0000000000000 --- a/recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -enable_testing() - -# This is a non-official mpdecimal module! -find_package(mpdecimal REQUIRED) - -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) - 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++) - add_test(NAME test_package_cpp COMMAND test_package_cpp 10 13) -endif() diff --git a/recipes/mpdecimal/2.5.x/test_package/conanfile.py b/recipes/mpdecimal/2.5.x/test_package/conanfile.py deleted file mode 100644 index 6ee5b409e31d8..0000000000000 --- a/recipes/mpdecimal/2.5.x/test_package/conanfile.py +++ /dev/null @@ -1,29 +0,0 @@ -from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.build import can_run, build_jobs - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "VirtualRunEnv", "CMakeDeps" - 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["MPDECIMAL_CXX"] = self.dependencies["mpdecimal"].options.cxx - tc.generate() - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if can_run(self): - self.run(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt b/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index c23ed5cfe6d98..0000000000000 --- a/recipes/mpdecimal/2.5.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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/mpdecimal/2.5.x/test_v1_package/conanfile.py b/recipes/mpdecimal/2.5.x/test_v1_package/conanfile.py deleted file mode 100644 index 39414f0a3b89d..0000000000000 --- a/recipes/mpdecimal/2.5.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" - - def build(self): - cmake = CMake(self) - cmake.definitions["MPDECIMAL_CXX"] = self.options["mpdecimal"].cxx - 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} -j {tools.cpu_count()}", - run_environment=True) diff --git a/recipes/mpdecimal/all/conandata.yml b/recipes/mpdecimal/all/conandata.yml new file mode 100644 index 0000000000000..687ee85812e98 --- /dev/null +++ b/recipes/mpdecimal/all/conandata.yml @@ -0,0 +1,21 @@ +sources: + "4.0.0": + sha256: "942445c3245b22730fd41a67a7c5c231d11cb1b9936b9c0f76334fb7d0b4468c" + url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-4.0.0.tar.gz" + "2.5.1": + sha256: "9f9cd4c041f99b5c49ffb7b59d9f12d95b683d88585608aa56a6307667b2b21f" + url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz" + "2.5.0": + sha256: "15417edc8e12a57d1d9d75fa7e3f22b158a3b98f44db9d694cfd2acde8dfa0ca" + url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.0.tar.gz" +patches: + "4.0.0": + - patch_file: "patches/4.0.0-0001-msvc-fixes.patch" + - patch_file: "patches/4.0.0-0003-use-MPDECIMAL_DLL.patch" + "2.5.1": + - patch_file: "patches/2.5.1-0001-msvc-fixes.patch" + - patch_file: "patches/2.5.1-0002-add-mingw-to-configure-ac.patch" + - patch_file: "patches/2.5.1-0003-use-MPDECIMAL_DLL.patch" + "2.5.0": + - patch_file: "patches/0001-2.5.0-msvc-fixes.patch" + - patch_file: "patches/0002-add-mingw-to-configure-ac.patch" diff --git a/recipes/mpdecimal/all/conanfile.py b/recipes/mpdecimal/all/conanfile.py new file mode 100644 index 0000000000000..92620feb51411 --- /dev/null +++ b/recipes/mpdecimal/all/conanfile.py @@ -0,0 +1,237 @@ +from conan import ConanFile +from conan.tools.gnu import AutotoolsToolchain, Autotools +from conan.tools.files import get, chdir, copy, export_conandata_patches, apply_conandata_patches, mkdir, rename +from conan.tools.layout import basic_layout +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.microsoft import VCVars, is_msvc, NMakeDeps, NMakeToolchain +from conan.tools.apple import is_apple_os +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.55.0" + + +class MpdecimalConan(ConanFile): + name = "mpdecimal" + description = "mpdecimal is a package for correctly-rounded arbitrary precision decimal floating point arithmetic." + license = "BSD-2-Clause" + topics = ("multiprecision", "library") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.bytereef.org/mpdecimal" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cxx": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "cxx": 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") + if not self.options.cxx: + 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 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") + if self.options.cxx and Version(self.version) < "2.5.1": + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "A shared libmpdec++ is not possible on Windows (due to non-exportable thread local storage)") + + def build_requirements(self): + 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) + + def generate(self): + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + + deps = NMakeDeps(self) + deps.generate() + + tc = NMakeToolchain(self) + if Version(self.version) >= "2.5.1": + if self.options.shared: + tc.extra_cflags.append("-DMPDECIMAL_DLL") + if self.options.cxx: + tc.extra_cxxflags.append("-DLIBMPDECXX_DLL") + tc.generate() + else: + # inject tool_requires env vars in build scope (not needed if there is no tool_requires) + env = VirtualBuildEnv(self) + env.generate() + # inject requires env vars in build scope + # it's required in case of native build when there is AutotoolsDeps & at least one dependency which might be shared, because configure tries to run a test executable + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + tc.configure_args.append("--enable-cxx" if self.options.cxx else "--disable-cxx") + tc_env = tc.environment() + tc_env.append("LDXXFLAGS", ["$LDFLAGS"]) + tc.generate(tc_env) + + @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): + libmpdec_folder = self.source_path / "libmpdec" + libmpdecpp_folder = self.source_path / "libmpdec++" + + 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") + + builds = [[libmpdec_folder, mpdec_target]] + if self.options.cxx: + builds.append([libmpdecpp_folder, mpdecpp_target]) + + for build_dir, target in builds: + with chdir(self, build_dir): + self.run("""nmake -f Makefile.vc {target} MACHINE={machine} DEBUG={debug} DLL={dll}""".format( + target=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, f"libmpdec-{self.version}.dll", libmpdec_folder, dist_folder) + copy(self, f"libmpdec-{self.version}.dll.lib", libmpdec_folder, dist_folder) + else: + copy(self, f"libmpdec-{self.version}.lib", libmpdec_folder, dist_folder) + if self.options.cxx: + if self.options.shared: + copy(self, f"libmpdec++-{self.version}.dll", libmpdecpp_folder, dist_folder) + copy(self, f"libmpdec++-{self.version}.dll.lib", libmpdecpp_folder, dist_folder) + else: + copy(self, f"libmpdec++-{self.version}.lib", libmpdecpp_folder, dist_folder) + copy(self, "decimal.hh", libmpdecpp_folder, dist_folder) + + @property + def _shared_suffix(self): + if is_apple_os(self): + return ".dylib" + return { + "Windows": ".dll", + }.get(str(self.settings.os), ".so") + + @property + def _target_names(self): + libsuffix = self._shared_suffix if self.options.shared else ".a" + 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) + if is_msvc(self): + self._build_msvc() + else: + autotools = Autotools(self) + autotools.configure() + # self.output.info(load(self, pathlib.Path("libmpdec", "Makefile"))) + libmpdec, libmpdecpp = self._target_names + copy(self, "*", self.source_path / "libmpdec", self.build_path / "libmpdec") + with chdir(self, "libmpdec"): + autotools.make(target=libmpdec) + if self.options.cxx: + copy(self, "*", self.source_path / "libmpdec++", self.build_path / "libmpdec++") + with chdir(self, "libmpdec++"): + autotools.make(target=libmpdecpp) + + def package(self): + pkg_dir = self.package_path + copy(self, "LICENSE.txt", src=self.source_folder, dst=pkg_dir / "licenses") + if is_msvc(self): + 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: + 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=self.source_path / "libmpdec++", dst=pkg_dir / "include") + builddirs = [mpdecdir] + if self.options.cxx: + builddirs.append(mpdecppdir) + for builddir in builddirs: + copy(self, "*.a", src=builddir, dst=pkg_dir / "lib") + copy(self, "*.so", src=builddir, dst=pkg_dir / "lib") + copy(self, "*.so.*", src=builddir, dst=pkg_dir / "lib") + copy(self, "*.dylib", src=builddir, dst=pkg_dir / "lib") + copy(self, "*.dll", src=builddir, dst=pkg_dir / "bin") + + def package_info(self): + lib_pre_suf = ("", "") + if is_msvc(self): + if self.options.shared: + lib_pre_suf = ("lib", f"-{self.version}.dll") + else: + lib_pre_suf = ("lib", f"-{self.version}") + elif self.settings.os == "Windows": + if self.options.shared: + lib_pre_suf = ("", ".dll") + + self.cpp_info.components["libmpdecimal"].libs = ["{}mpdec{}".format(*lib_pre_suf)] + if self.options.shared and is_msvc(self): + if Version(self.version) >= "2.5.1": + self.cpp_info.components["libmpdecimal"].defines = ["MPDECIMAL_DLL"] + else: + self.cpp_info.components["libmpdecimal"].defines = ["USE_DLL"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libmpdecimal"].system_libs = ["m"] + + if self.options.cxx: + self.cpp_info.components["libmpdecimal++"].libs = ["{}mpdec++{}".format(*lib_pre_suf)] + self.cpp_info.components["libmpdecimal++"].requires = ["libmpdecimal"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libmpdecimal++"].system_libs = ["pthread"] + if self.options.shared and Version(self.version) >= "2.5.1": + self.cpp_info.components["libmpdecimal++"].defines = ["MPDECIMALXX_DLL"] diff --git a/recipes/mpdecimal/2.5.x/patches/0001-2.5.0-msvc-fixes.patch b/recipes/mpdecimal/all/patches/0001-2.5.0-msvc-fixes.patch similarity index 100% rename from recipes/mpdecimal/2.5.x/patches/0001-2.5.0-msvc-fixes.patch rename to recipes/mpdecimal/all/patches/0001-2.5.0-msvc-fixes.patch diff --git a/recipes/mpdecimal/2.5.x/patches/0002-add-mingw-to-configure-ac.patch b/recipes/mpdecimal/all/patches/0002-add-mingw-to-configure-ac.patch similarity index 100% rename from recipes/mpdecimal/2.5.x/patches/0002-add-mingw-to-configure-ac.patch rename to recipes/mpdecimal/all/patches/0002-add-mingw-to-configure-ac.patch diff --git a/recipes/mpdecimal/2.5.x/patches/2.5.1-0001-msvc-fixes.patch b/recipes/mpdecimal/all/patches/2.5.1-0001-msvc-fixes.patch similarity index 100% rename from recipes/mpdecimal/2.5.x/patches/2.5.1-0001-msvc-fixes.patch rename to recipes/mpdecimal/all/patches/2.5.1-0001-msvc-fixes.patch diff --git a/recipes/mpdecimal/2.5.x/patches/2.5.1-0002-add-mingw-to-configure-ac.patch b/recipes/mpdecimal/all/patches/2.5.1-0002-add-mingw-to-configure-ac.patch similarity index 100% rename from recipes/mpdecimal/2.5.x/patches/2.5.1-0002-add-mingw-to-configure-ac.patch rename to recipes/mpdecimal/all/patches/2.5.1-0002-add-mingw-to-configure-ac.patch diff --git a/recipes/mpdecimal/2.5.x/patches/2.5.1-0003-use-MPDECIMAL_DLL.patch b/recipes/mpdecimal/all/patches/2.5.1-0003-use-MPDECIMAL_DLL.patch similarity index 100% rename from recipes/mpdecimal/2.5.x/patches/2.5.1-0003-use-MPDECIMAL_DLL.patch rename to recipes/mpdecimal/all/patches/2.5.1-0003-use-MPDECIMAL_DLL.patch diff --git a/recipes/mpdecimal/all/patches/4.0.0-0001-msvc-fixes.patch b/recipes/mpdecimal/all/patches/4.0.0-0001-msvc-fixes.patch new file mode 100644 index 0000000000000..aa95ccd087f71 --- /dev/null +++ b/recipes/mpdecimal/all/patches/4.0.0-0001-msvc-fixes.patch @@ -0,0 +1,97 @@ +diff --git a/libmpdec++/Makefile.vc b/libmpdec++/Makefile.vc +index 5985c33..bc2bdac 100644 +--- a/libmpdec++/Makefile.vc ++++ b/libmpdec++/Makefile.vc +@@ -14,11 +14,11 @@ LIBIMPORT_CXX = libmpdec++-4.0.0.dll.lib + LIBSHARED_CXX = libmpdec++-4.0.0.dll + + !if "$(DEBUG)" == "1" +-OPT = /MTd /Od /Zi /EHsc +-OPT_SHARED = /MDd /Od /Zi /EHsc ++OPT = /Od /Zi /EHsc ++OPT_SHARED = /Od /Zi /EHsc + !else +-OPT = /MT /O2 /GS /EHsc /DNDEBUG +-OPT_SHARED = /MD /O2 /GS /EHsc /DNDEBUG ++OPT = /O2 /GS /EHsc /DNDEBUG ++OPT_SHARED = /O2 /GS /EHsc /DNDEBUG + !endif + + !if "$(CC)" == "clang-cl" +@@ -27,9 +27,9 @@ WARN = /W4 -Wno-undefined-inline + WARN = /W4 + !endif + +-MPD_CXXFLAGS = $(WARN) /nologo $(OPT) +-MPD_CXXFLAGS_SHARED = /DBUILD_LIBMPDECXX $(WARN) /nologo $(OPT_SHARED) $(PGOFLAGS) +-MPD_BIN_CXXFLAGS_SHARED = $(WARN) /nologo $(OPT_SHARED) $(PGOFLAGS) ++MPD_CXXFLAGS = $(WARN) /nologo $(OPT) $(CONAN_CXXFLAGS) $(CONAN_CFLAGS) ++MPD_CXXFLAGS_SHARED = /DBUILD_LIBMPDECXX $(WARN) /nologo $(OPT_SHARED) $(PGOFLAGS) $(CONAN_LDFLAGS) ++MPD_BIN_CXXFLAGS_SHARED = $(WARN) /nologo $(OPT_SHARED) $(PGOFLAGS) $(CONAN_LDFLAGS) + + MPD_LDXXFLAGS= /DLL /MANIFEST $(LDXXFLAGS) + +@@ -42,22 +42,22 @@ OBJS = decimal.obj + SHARED_OBJS = .objs\decimal.obj + + +-$(LIBSTATIC_CXX): Makefile $(OBJS) ++$(LIBSTATIC_CXX): Makefile.vc $(OBJS) + -@if exist $@ del $(LIBSTATIC_CXX) + lib /out:$(LIBSTATIC_CXX) $(OBJS) + +-$(LIBSHARED_CXX): Makefile $(SHARED_OBJS) ++$(LIBSHARED_CXX): Makefile.vc $(SHARED_OBJS) + -@if exist $@ del $(LIBSHARED_CXX) + link $(MPD_LDXXFLAGS) /out:$(LIBSHARED_CXX) /implib:$(LIBIMPORT_CXX) /LIBPATH:$(SRCDIR) $(SHARED_OBJS) $(LIBIMPORT) + mt -manifest $(LIBSHARED_CXX).manifest -outputresource:$(LIBSHARED_CXX);2 + + + decimal.obj:\ +-Makefile decimal.cc ..\libmpdec\mpdecimal.h decimal.hh ++Makefile.vc decimal.cc ..\libmpdec\mpdecimal.h decimal.hh + $(CXX) "-I." "-I$(SRCDIR)" $(MPD_CXXFLAGS) -c decimal.cc + + .objs\decimal.obj:\ +-Makefile decimal.cc ..\libmpdec\mpdecimal.h decimal.hh ++Makefile.vc decimal.cc ..\libmpdec\mpdecimal.h decimal.hh + $(CXX) "-I." "-I$(SRCDIR)" $(MPD_CXXFLAGS_SHARED) -c decimal.cc /Fo.objs\decimal.obj + + +diff --git a/libmpdec/Makefile.vc b/libmpdec/Makefile.vc +index 7f72a4b..2ee3ddb 100644 +--- a/libmpdec/Makefile.vc ++++ b/libmpdec/Makefile.vc +@@ -31,11 +31,11 @@ CONFIG = /DCONFIG_32 /DANSI + !endif + + !if "$(DEBUG)" == "1" +-OPT = /MTd /Od /Zi /EHsc +-OPT_SHARED = /MDd /Od /Zi /EHsc ++OPT = /Od /Zi /EHsc ++OPT_SHARED = /Od /Zi /EHsc + !else +-OPT = /MT /O2 /GS /EHsc /DNDEBUG +-OPT_SHARED = /MD /O2 /GS /EHsc /DNDEBUG ++OPT = /O2 /GS /EHsc /DNDEBUG ++OPT_SHARED = /O2 /GS /EHsc /DNDEBUG + !endif + + !if "$(CC)" == "clang-cl" +@@ -44,13 +44,13 @@ WARN = /W4 /wd4200 /wd4204 /wd4221 -Wno-unknown-pragmas -Wno-undefined-inline /D + WARN = /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS + !endif + +-MPD_CFLAGS = $(WARN) /nologo $(CONFIG) $(OPT) +-MPD_CFLAGS_SHARED = /DBUILD_LIBMPDEC $(WARN) /nologo $(CONFIG) $(OPT_SHARED) $(PGOFLAGS) ++MPD_CFLAGS = $(WARN) /nologo $(CONFIG) $(OPT) $(CONAN_CFLAGS) ++MPD_CFLAGS_SHARED = /DBUILD_LIBMPDEC $(WARN) /nologo $(CONFIG) $(OPT_SHARED) $(PGOFLAGS) $(CONAN_CFLAGS) + + MPD_BIN_CFLAGS = $(WARN) /nologo $(OPT) + MPD_BIN_CFLAGS_SHARED = $(WARN) /nologo $(OPT_SHARED) $(PGOFLAGS) + +-MPD_LDFLAGS= /DLL /MANIFEST $(LDFLAGS) ++MPD_LDFLAGS= /DLL /MANIFEST $(LDFLAGS) $(CONAN_LDFLAGS) + + + default: $(LIBSTATIC) $(LIBSHARED) diff --git a/recipes/mpdecimal/all/patches/4.0.0-0003-use-MPDECIMAL_DLL.patch b/recipes/mpdecimal/all/patches/4.0.0-0003-use-MPDECIMAL_DLL.patch new file mode 100644 index 0000000000000..eaef16aab1800 --- /dev/null +++ b/recipes/mpdecimal/all/patches/4.0.0-0003-use-MPDECIMAL_DLL.patch @@ -0,0 +1,39 @@ +diff --git a/libmpdec++/decimal.hh b/libmpdec++/decimal.hh +index 9040290..5e057cb 100644 +--- a/libmpdec++/decimal.hh ++++ b/libmpdec++/decimal.hh +@@ -58,7 +58,7 @@ + #ifdef _MSC_VER + #if defined (BUILD_LIBMPDECXX) + #define IMPORTEXPORT __declspec(dllexport) +- #elif defined(_DLL) ++ #elif defined(MPDECIMAL_DLL) + #define IMPORTEXPORT __declspec(dllimport) + #else + #define IMPORTEXPORT +diff --git a/libmpdec/mpdecimal32vc.h b/libmpdec/mpdecimal32vc.h +index 6a35951..43e5631 100644 +--- a/libmpdec/mpdecimal32vc.h ++++ b/libmpdec/mpdecimal32vc.h +@@ -59,7 +59,7 @@ extern "C" { + #if defined (BUILD_LIBMPDEC) + #undef IMPORTEXPORT + #define IMPORTEXPORT __declspec(dllexport) +-#elif defined(_DLL) ++#elif defined(MPDECIMAL_DLL) + #undef IMPORTEXPORT + #define IMPORTEXPORT __declspec(dllimport) + #endif +diff --git a/libmpdec/mpdecimal64vc.h b/libmpdec/mpdecimal64vc.h +index 9320176..a9944fc 100644 +--- a/libmpdec/mpdecimal64vc.h ++++ b/libmpdec/mpdecimal64vc.h +@@ -59,7 +59,7 @@ extern "C" { + #if defined (BUILD_LIBMPDEC) + #undef IMPORTEXPORT + #define IMPORTEXPORT __declspec(dllexport) +-#elif defined(_DLL) ++#elif defined(MPDECIMAL_DLL) + #undef IMPORTEXPORT + #define IMPORTEXPORT __declspec(dllimport) + #endif diff --git a/recipes/mpdecimal/all/test_package/CMakeLists.txt b/recipes/mpdecimal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fd62443b2dbe5 --- /dev/null +++ b/recipes/mpdecimal/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX C) + +enable_testing() + +# This is a non-official mpdecimal module! +find_package(mpdecimal REQUIRED) + +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(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++) + add_test(NAME test_package_cpp COMMAND test_package_cpp 10 13) +endif() diff --git a/recipes/mpdecimal/all/test_package/conanfile.py b/recipes/mpdecimal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..24cabf72b9327 --- /dev/null +++ b/recipes/mpdecimal/all/test_package/conanfile.py @@ -0,0 +1,24 @@ +from conan import ConanFile +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", "CMakeToolchain", "CMakeDeps" + 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(f"ctest --output-on-failure -C {self.settings.build_type} -j {build_jobs(self)}", env="conanrun") diff --git a/recipes/mpdecimal/2.5.x/test_package/test_package.c b/recipes/mpdecimal/all/test_package/test_package.c similarity index 100% rename from recipes/mpdecimal/2.5.x/test_package/test_package.c rename to recipes/mpdecimal/all/test_package/test_package.c diff --git a/recipes/mpdecimal/2.5.x/test_package/test_package.cpp b/recipes/mpdecimal/all/test_package/test_package.cpp similarity index 100% rename from recipes/mpdecimal/2.5.x/test_package/test_package.cpp rename to recipes/mpdecimal/all/test_package/test_package.cpp diff --git a/recipes/mpdecimal/all/test_v1_package/CMakeLists.txt b/recipes/mpdecimal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4c6b75fcc1914 --- /dev/null +++ b/recipes/mpdecimal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) +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/mpdecimal/all/test_v1_package/conanfile.py b/recipes/mpdecimal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..9f63e99aff76f --- /dev/null +++ b/recipes/mpdecimal/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.definitions["MPDECIMAL_CXX"] = self.options["mpdecimal"].cxx + 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} -j {tools.cpu_count()}", + run_environment=True) diff --git a/recipes/mpdecimal/config.yml b/recipes/mpdecimal/config.yml index 24b096a4ce8a6..4975ba3fc2e05 100644 --- a/recipes/mpdecimal/config.yml +++ b/recipes/mpdecimal/config.yml @@ -1,7 +1,7 @@ versions: + "4.0.0": + folder: "all" "2.5.1": - folder: "2.5.x" + folder: "all" "2.5.0": - folder: "2.5.x" - "2.4.2": - folder: "2.4.2" + folder: "all" diff --git a/recipes/mpfr/all/test_v1_package/CMakeLists.txt b/recipes/mpfr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/mpfr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mpfr/all/test_v1_package/conanfile.py b/recipes/mpfr/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/mpfr/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", "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/mpg123/all/conanfile.py b/recipes/mpg123/all/conanfile.py index a4d19cd12463a..cad85a437b2f8 100644 --- a/recipes/mpg123/all/conanfile.py +++ b/recipes/mpg123/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain from conan.tools.layout import basic_layout from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain -from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches, rmdir, rm +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches, replace_in_file, rmdir, rm from conan.tools.microsoft import is_msvc from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.build import cross_building @@ -52,10 +52,6 @@ class Mpg123Conan(ConanFile): "module": "dummy", } - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - @property def _audio_module(self): return { @@ -99,7 +95,7 @@ def build_requirements(self): 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": + if self.settings_build.os == "Windows" and not is_msvc(self): self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): self.tool_requires("msys2/cci.latest") @@ -107,7 +103,6 @@ def build_requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def generate(self): env = VirtualBuildEnv(self) env.generate() @@ -168,6 +163,12 @@ def build(self): cmake.configure(build_script_folder=os.path.join(self.source_folder, "ports", "cmake")) cmake.build() else: + if self.settings.compiler == "apple-clang" and cross_building(self): + # when testing if the assembler supports avx - propagate cflags (CFLAGS) to the assembler + # (which should contain "-arch x86_64" when crossbuilding with appleclang) + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "$CCAS -c -o conftest.o", + "$CCAS $CFLAGS -c -o conftest.o") autotools = Autotools(self) autotools.configure() autotools.make() @@ -193,23 +194,17 @@ def package_info(self): self.cpp_info.components["libmpg123"].libs = ["mpg123"] self.cpp_info.components["libmpg123"].set_property("pkg_config_name", "libmpg123") self.cpp_info.components["libmpg123"].set_property("cmake_target_name", "MPG123::libmpg123") - self.cpp_info.components["libmpg123"].names["cmake_find_package"] = "libmpg123" - self.cpp_info.components["libmpg123"].names["cmake_find_package_multi"] = "libmpg123" if self.settings.os == "Windows" and self.options.shared: self.cpp_info.components["libmpg123"].defines.append("LINK_MPG123_DLL") self.cpp_info.components["libout123"].libs = ["out123"] self.cpp_info.components["libout123"].set_property("pkg_config_name", "libout123") self.cpp_info.components["libout123"].set_property("cmake_target_name", "MPG123::libout123") - self.cpp_info.components["libout123"].names["cmake_find_package"] = "libout123" - self.cpp_info.components["libout123"].names["cmake_find_package_multi"] = "libout123" self.cpp_info.components["libout123"].requires = ["libmpg123"] self.cpp_info.components["libsyn123"].libs = ["syn123"] self.cpp_info.components["libsyn123"].set_property("pkg_config_name", "libsyn123") self.cpp_info.components["libsyn123"].set_property("cmake_target_name", "MPG123::libsyn123") - self.cpp_info.components["libsyn123"].names["cmake_find_package"] = "libsyn123" - self.cpp_info.components["libsyn123"].names["cmake_find_package_multi"] = "libsyn123" self.cpp_info.components["libsyn123"].requires = ["libmpg123"] if self.settings.os == "Linux": @@ -225,14 +220,3 @@ def package_info(self): self.cpp_info.components["libout123"].requires.append("tinyalsa::tinyalsa") if self.options.module == "win32": self.cpp_info.components["libout123"].system_libs.append("winmm") - - - # TODO: Remove after Conan 2.x becomes the standard - self.cpp_info.filenames["cmake_find_package"] = "mpg123" - self.cpp_info.filenames["cmake_find_package_multi"] = "mpg123" - self.cpp_info.names["cmake_find_package"] = "MPG123" - self.cpp_info.names["cmake_find_package_multi"] = "MPG123" - - 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/mpg123/all/test_v1_package/CMakeLists.txt b/recipes/mpg123/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/mpg123/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mpg123/all/test_v1_package/conanfile.py b/recipes/mpg123/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/mpg123/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/mpg123/all/test_v1_package/test_package.c b/recipes/mpg123/all/test_v1_package/test_package.c deleted file mode 100644 index 9db524c82cb7a..0000000000000 --- a/recipes/mpg123/all/test_v1_package/test_package.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "mpg123.h" -#include - -int main() { - int error; - mpg123_pars *pars; - - pars = mpg123_new_pars(&error); - mpg123_fmt_all(pars); - mpg123_delete_pars(pars); - return 0; -} diff --git a/recipes/mpir/all/conandata.yml b/recipes/mpir/all/conandata.yml index c5a67d7b84dca..815ad473b44e7 100644 --- a/recipes/mpir/all/conandata.yml +++ b/recipes/mpir/all/conandata.yml @@ -1,4 +1,10 @@ sources: "3.0.0": - url: "http://mpir.org/mpir-3.0.0.zip" - sha256: "6277d3cc36ff39c98e4d4cc17b46b5a6ff42a22d30a4130b2d49255f98dd8c1f" + url: "https://github.com/wbhart/mpir/archive/refs/tags/mpir-3.0.0.tar.gz" + sha256: "86a5039badc3e6738219a262873a1db5513405e15ece9527b718fcd0fac09bb2" +patches: + "3.0.0": + - patch_file: "patches/fix_xcode_12_configure.patch" + patch_type: "backport" + patch_source: https://github.com/wbhart/mpir/commit/bbc43ca6ae0bec4f64e69c9cd4c967005d6470eb + patch_description: "Fix warnings (turned to errors) that causes XCode 12+ configure to fail" diff --git a/recipes/mpir/all/conanfile.py b/recipes/mpir/all/conanfile.py index 3c6c16a085f0b..d9ae778b935b2 100644 --- a/recipes/mpir/all/conanfile.py +++ b/recipes/mpir/all/conanfile.py @@ -1,26 +1,28 @@ +import os + from conan import ConanFile -from conan.tools.microsoft import msvc_runtime_flag, is_msvc -from conan.tools.build import cross_building -from conan.tools.files import get, copy, replace_in_file, chdir, rmdir, rm -from conan.tools.scm import Version -from conans import tools, AutoToolsBuildEnvironment, MSBuild from conan.errors import ConanInvalidConfiguration -import contextlib -import os +from conan.tools.apple import XCRun, to_apple_arch +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, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuild, MSBuildToolchain, is_msvc, is_msvc_static_runtime, msvc_runtime_flag + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.50.0" class MpirConan(ConanFile): name = "mpir" - description = "MPIR is a highly optimised library for bignum arithmetic" \ - "forked from the GMP bignum library." - topics = ("mpir", "multiprecision", "math", "mathematics") - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://mpir.org/" + description = ("MPIR is a highly optimised library for bignum arithmetic " + "forked from the GMP bignum library.") license = "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/wbhart/mpir" + topics = ("multiprecision", "math", "mathematics") - provides = [] - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,45 +37,84 @@ class MpirConan(ConanFile): "enable_gmpcompat": 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") if is_msvc(self) and self.options.shared: del self.options.enable_cxx if not self.options.get_safe("enable_cxx", False): - 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.enable_gmpcompat: - self.provides.append("gmp") + self.provides = ["gmp"] + + def layout(self): + basic_layout(self, src_folder="src") def validate(self): if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): raise ConanInvalidConfiguration("Cross-building doesn't work (yet)") def build_requirements(self): + self.tool_requires("libtool/2.4.7") self.tool_requires("yasm/1.3.0") if not is_msvc(self): self.tool_requires("m4/1.4.19") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.tool_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): - get(self, keep_permissions=True, **self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True, keep_permissions=True) + + def _generate_msvc(self): + env = VirtualBuildEnv(self) + env.generate() + tc = MSBuildToolchain(self) + tc.generate() + + def _generate_autotools(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-silent-rules") + tc.configure_args.append("--enable-cxx" if self.options.get_safe("enable_cxx") else "--disable-cxx") + tc.configure_args.append("--enable-gmpcompat" if self.options.enable_gmpcompat else "--disable-gmpcompat") + + # compiler checks are written for C89 but compilers that default to C99 treat implicit functions as error + tc.extra_cxxflags.append("-Wno-implicit-function-declaration") + + if self.settings.compiler == "apple-clang": + if hasattr(self, "settings_build"): + # there is no CFLAGS_FOR_BUILD/CXXFLAGS_FOR_BUILD + sdk_path = XCRun(self).sdk_path + tc.extra_cxxflags += [ + "-Wno-implicit-function-declaration", + "-isysroot", sdk_path, + "-arch", to_apple_arch(self), + ] + # Disable docs + tc.make_args.append("MAKEINFO=true") + tc.generate() + + def generate(self): + if is_msvc(self): + self._generate_msvc() + else: + self._generate_autotools() @property def _platforms(self): @@ -83,75 +124,41 @@ def _platforms(self): def _dll_or_lib(self): return "dll" if self.options.shared else "lib" + @property + def _vs_ide_version(self): + if str(self.settings.compiler) == "Visual Studio": + return self.settings.compiler.version + msvc_to_ide = {"170": "11", "180": "12", "190": "14", "191": "15", "192": "16", "193": "17"} + return msvc_to_ide.get(str(self.settings.compiler.version), "17") + @property def _vcxproj_paths(self): - compiler_version = self.settings.compiler.version if Version(self.settings.compiler.version) <= "17" else "17" - build_subdir = "build.vc{}".format(compiler_version) + build_subdir = f"build.vc{self._vs_ide_version}" vcxproj_paths = [ - os.path.join(self._source_subfolder, build_subdir, - "{}_mpir_gc".format(self._dll_or_lib), - "{}_mpir_gc.vcxproj".format(self._dll_or_lib)) + os.path.join(self.source_folder, build_subdir, f"{self._dll_or_lib}_mpir_gc", f"{self._dll_or_lib}_mpir_gc.vcxproj") ] if self.options.get_safe("enable_cxx"): - vcxproj_paths.append(os.path.join(self._source_subfolder, build_subdir, + vcxproj_paths.append(os.path.join(self.source_folder, build_subdir, "lib_mpir_cxx", "lib_mpir_cxx.vcxproj")) return vcxproj_paths - def _build_visual_studio(self): - if not self.options.shared: # RuntimeLibrary only defined in lib props files + def _build_msvc(self): + if not self.options.shared: # RuntimeLibrary only defined in lib props files build_type = "debug" if self.settings.build_type == "Debug" else "release" - props_path = os.path.join(self._source_subfolder, "build.vc", - "mpir_{}_lib.props".format(build_type)) - old_runtime = "MultiThreaded{}".format( - "Debug" if build_type == "debug" else "", - ) + props_path = os.path.join(self.source_folder, "build.vc", f"mpir_{build_type}_lib.props") + old_runtime = "MultiThreaded{}".format("Debug" if build_type == "debug" else "") new_runtime = "MultiThreaded{}{}".format( "Debug" if "d" in msvc_runtime_flag(self) else "", - "DLL" if "MD" in msvc_runtime_flag(self) else "", + "DLL" if not is_msvc_static_runtime(self) else "", ) replace_in_file(self, props_path, old_runtime, new_runtime) msbuild = MSBuild(self) for vcxproj_path in self._vcxproj_paths: - msbuild.build(vcxproj_path, platforms=self._platforms, upgrade_project=False) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "apple-clang": - env_build = {"CC": tools.XCRun(self.settings).cc, - "CXX": tools.XCRun(self.settings).cxx} - if hasattr(self, "settings_build"): - # there is no CFLAGS_FOR_BUILD/CXXFLAGS_FOR_BUILD - xcrun = tools.XCRun(self.settings_build) - flags = " -Wno-implicit-function-declaration -isysroot {} -arch {}".format(xcrun.sdk_path, tools.to_apple_arch(self.settings_build.arch)) - env_build["CC_FOR_BUILD"] = xcrun.cc + flags - env_build["CXX_FOR_BUILD"] = xcrun.cxx + flags - with tools.environment_append(env_build): - yield - else: - yield - - def _configure_autotools(self): - if not self._autotools: - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - args = [] - if self.options.shared: - args.extend(["--disable-static", "--enable-shared"]) - else: - args.extend(["--disable-shared", "--enable-static"]) - args.append("--with-pic" if self.options.get_safe("fPIC", True) else "--without-pic") - - args.append("--disable-silent-rules") - args.append("--enable-cxx" if self.options.get_safe("enable_cxx") else "--disable-cxx") - args.append("--enable-gmpcompat" if self.options.enable_gmpcompat else "--disable-gmpcompat") - - # compiler checks are written for C89 but compilers that default to C99 treat implicit functions as error - self._autotools.flags.append("-Wno-implicit-function-declaration") - self._autotools.configure(args=args) - return self._autotools + msbuild.build(vcxproj_path) def _patch_new_msvc_version(self, ver, toolset): - new_dir = os.path.join(self._source_subfolder, f'build.vc{ver}') - copy(self, pattern="*", src=os.path.join(self._source_subfolder, 'build.vc15'), dst=new_dir) + new_dir = os.path.join(self.source_folder, f"build.vc{ver}") + copy(self, pattern="*", src=os.path.join(self.source_folder, "build.vc15"), dst=new_dir) for root, _, files in os.walk(new_dir): for file in files: @@ -167,6 +174,7 @@ def _patch_new_msvc_version(self, ver, toolset): replace_in_file(self, full_file, 'check_config $(Platform) $(Configuration) 15', f'check_config $(Platform) $(Configuration) {ver}', strict=False) def _patch_sources(self): + apply_conandata_patches(self) if is_msvc(self): self._patch_new_msvc_version(16, "v142") self._patch_new_msvc_version(17, "v143") @@ -174,20 +182,25 @@ def _patch_sources(self): def build(self): self._patch_sources() if is_msvc(self): - self._build_visual_studio() + self._build_msvc() else: - with chdir(self, self._source_subfolder), self._build_context(): + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() # relocatable shared lib on macOS replace_in_file(self, "configure", "-install_name \\$rpath/", "-install_name @rpath/") - autotools = self._configure_autotools() + autotools.configure() autotools.make() def package(self): - copy(self, "COPYING*", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, self._source_subfolder)) + copy(self, "COPYING*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if is_msvc(self): - lib_folder = os.path.join(self.build_folder, self._source_subfolder, self._dll_or_lib, - self._platforms.get(str(self.settings.arch)), - str(self.settings.build_type)) + lib_folder = os.path.join( + self.source_folder, + self._dll_or_lib, + self._platforms.get(str(self.settings.arch)), + str(self.settings.build_type), + ) include_folder = os.path.join(self.package_folder, "include") copy(self, "mpir.h", dst=include_folder, src=lib_folder, keep_path=True) if self.options.enable_gmpcompat: @@ -196,11 +209,11 @@ def package(self): copy(self, "mpirxx.h", dst=include_folder, src=lib_folder, keep_path=True) if self.options.enable_gmpcompat: copy(self, "gmpxx.h", dst=include_folder, src=lib_folder, keep_path=True) - copy(self, pattern="*.dll*", dst=os.path.join(self.package_folder, "bin"), src=lib_folder, keep_path=False) - copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=lib_folder, keep_path=False) + copy(self, "*.dll*", dst=os.path.join(self.package_folder, "bin"), src=lib_folder, keep_path=False) + copy(self, "*.lib", dst=os.path.join(self.package_folder, "lib"), src=lib_folder, keep_path=False) else: - with chdir(self, self._source_subfolder), self._build_context(): - autotools = self._configure_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install() rmdir(self, os.path.join(self.package_folder, "share")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) diff --git a/recipes/mpir/all/patches/fix_xcode_12_configure.patch b/recipes/mpir/all/patches/fix_xcode_12_configure.patch new file mode 100644 index 0000000000000..13454c5f7d321 --- /dev/null +++ b/recipes/mpir/all/patches/fix_xcode_12_configure.patch @@ -0,0 +1,113 @@ +From bbc43ca6ae0bec4f64e69c9cd4c967005d6470eb Mon Sep 17 00:00:00 2001 +From: Mitchell Blank Jr +Date: Mon, 21 Dec 2020 12:05:19 +0000 +Subject: [PATCH] Fix configure failures with Xcode12 + +Changes are needed becuase Xcode12 includes a default of +-Werror,-Wimplicit-function-declaration which means that +even something like calling "exit(0);" is a compile failure +if you haven't done a "#include " first (as C99 +requires, but most other compilers will just warn about) + +I don't know if the "long long reliability test 2" test which +tries to provoke a crash on a particular gcc 3.3 build still +does what it was originally intended to do with my change. +Of course, I doubt anyone has tried to use that compiler in +years. + +Fixes #290 +--- + acinclude.m4 | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 91c35bc23..620a629ef 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -589,9 +589,9 @@ extern + #endif + __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) + {t1 c,x,r;int i;if(v0){c=1;for(i=1;iconftest.c <conftest.c < + int + main () + { +- exit(0); ++ return 0; + } + double d; + double diff --git a/recipes/mpir/all/test_package/CMakeLists.txt b/recipes/mpir/all/test_package/CMakeLists.txt index d64654ce1f75a..532d088505a3e 100644 --- a/recipes/mpir/all/test_package/CMakeLists.txt +++ b/recipes/mpir/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(mpir CONFIG REQUIRED) +find_package(mpir REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} mpir::mpir) diff --git a/recipes/mpir/all/test_package/conanfile.py b/recipes/mpir/all/test_package/conanfile.py index 2490acfa82ff8..ef5d7042163ec 100644 --- a/recipes/mpir/all/test_package/conanfile.py +++ b/recipes/mpir/all/test_package/conanfile.py @@ -1,11 +1,19 @@ -from conans import ConanFile, CMake -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", "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/mpmcqueue/all/test_package/CMakeLists.txt b/recipes/mpmcqueue/all/test_package/CMakeLists.txt index a914eaad36ece..035551b9023c2 100644 --- a/recipes/mpmcqueue/all/test_package/CMakeLists.txt +++ b/recipes/mpmcqueue/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(MPMCQueue REQUIRED CONFIG) diff --git a/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt b/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/mpmcqueue/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/mpmcqueue/all/test_v1_package/conanfile.py b/recipes/mpmcqueue/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mpmcqueue/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_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/mppp/all/conandata.yml b/recipes/mppp/all/conandata.yml index 9dd5ca329ab04..dadfdd284c7b8 100644 --- a/recipes/mppp/all/conandata.yml +++ b/recipes/mppp/all/conandata.yml @@ -1,31 +1,12 @@ sources: - "1.0.0": - url: "https://github.com/bluescarni/mppp/archive/v1.0.0.tar.gz" - sha256: "e58b1a5fb8bdf095261eeb0861c3f46f96c71c4b043d19700e73ce3e4e639268" - "0.27": - url: "https://github.com/bluescarni/mppp/archive/v0.27.tar.gz" - sha256: "a1e04f6605b3242d4361742159cf5ab273162fd7c105c2743a9bebcf44c846c3" - "0.26": - url: "https://github.com/bluescarni/mppp/archive/v0.26.tar.gz" - sha256: "4dbfa68802d9a1365eda884f085418afc147d01b7a928e8333e4dcc1c3b3ce9e" + "2.0.0": + url: "https://github.com/bluescarni/mppp/archive/v2.0.0.tar.gz" + sha256: "699a882b8506b2e3c555a42300ad473302bfac3d35a931898816a401ed5fc5f3" + "1.0.3": + url: "https://github.com/bluescarni/mppp/archive/v1.0.3.tar.gz" + sha256: "d5beb0002910de4ea96dc15dc0d80d759afeb2c5e68716523d519d66a7dfe423" patches: - "1.0.0": - - patch_file: "patches/1.0.0-0001-disable-warning-error.patch" - patch_description: "disable the flag for treats warning as errors" - patch_type: "portability" - - patch_file: "patches/1.0.0-0002-remove-fmt-version.patch" - # https://github.com/conan-io/conan/issues/14172 - patch_description: "remove fmt version number from find_package" - patch_type: "conan" - "0.27": - - patch_file: "patches/0.27-0001-disable-warning-error.patch" - patch_description: "disable the flag for treats warning as errors" - 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" + "1.0.3": + - patch_file: "patches/1.0.3-0001-disable-warning-error.patch" patch_description: "disable the flag for treats warning as errors" patch_type: "portability" diff --git a/recipes/mppp/all/conanfile.py b/recipes/mppp/all/conanfile.py index 42fab736847a0..871e120dba2bf 100644 --- a/recipes/mppp/all/conanfile.py +++ b/recipes/mppp/all/conanfile.py @@ -24,6 +24,7 @@ class MpppConan(ConanFile): "fPIC": [True, False], "with_mpfr": [True, False], "with_arb": [True, False], + "with_flint": [True, False], "with_mpc": [True, False], "with_quadmath": [True, False], "with_boost": [True, False], @@ -34,6 +35,7 @@ class MpppConan(ConanFile): "fPIC": True, "with_mpfr": False, "with_arb": False, + "with_flint": False, "with_mpc": False, "with_quadmath": False, "with_boost": False, @@ -54,8 +56,10 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - if Version(self.version) < "0.27": - del self.options.with_fmt + if Version(self.version) < "2.0.0": + del self.options.with_flint + else: + del self.options.with_arb def layout(self): cmake_layout(self, src_folder="src") @@ -63,23 +67,27 @@ def layout(self): def requirements(self): self.requires("gmp/6.3.0", transitive_headers=True) if self.options.with_mpfr: - self.requires("mpfr/4.2.0") + self.requires("mpfr/4.2.1", transitive_headers=True) if self.options.with_mpc: self.requires("mpc/1.2.0") if self.options.with_boost: self.requires("boost/1.83.0") if self.options.get_safe("with_fmt"): - self.requires("fmt/10.1.1", transitive_headers=True) + self.requires("fmt/10.2.1", transitive_headers=True) + if self.options.get_safe("with_flint"): + self.requires("flint/3.0.1") def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - if self.options.with_arb: + if self.options.get_safe("with_arb"): raise ConanInvalidConfiguration(f"{self.ref}:with_arb=True is not supported because `fredrik-johansson/arb` is not packaged in CCI. (yet)") if self.options.with_quadmath: raise ConanInvalidConfiguration(f"{self.ref}:with_quadmath=True is not supported because `libquadmath` is not available from CCI. (yet)") if self.options.with_boost and self.dependencies["boost"].options.without_serialization: raise ConanInvalidConfiguration(f"{self.ref}:with_boost=True requires boost:without_serialization=False") + if self.options.get_safe("with_flint") and not self.options.with_mpfr: + raise ConanInvalidConfiguration(f"{self.ref}:with_flint=True requires with_mpfr=True") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -89,16 +97,22 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.variables["MPPP_BUILD_STATIC_LIBRARY"] = not self.options.shared tc.variables["MPPP_WITH_MPFR"] = self.options.with_mpfr - tc.variables["MPPP_WITH_ARB"] = self.options.with_arb + if "with_arb" in self.options: + tc.variables["MPPP_WITH_ARB"] = self.options.with_arb + if "with_flint" in self.options: + tc.variables["MPPP_WITH_FLINT"] = self.options.with_flint tc.variables["MPPP_WITH_MPC"] = self.options.with_mpc tc.variables["MPPP_WITH_QUADMATH"] = self.options.with_quadmath tc.variables["MPPP_WITH_BOOST_S11N"] = self.options.with_boost - if Version(self.version) >= "0.27": - tc.variables["MPPP_WITH_FMT"] = self.options.with_fmt + tc.variables["MPPP_WITH_FMT"] = self.options.with_fmt if not self.options.shared: tc.variables["MPPP_BUILD_STATIC_LIBRARY_WITH_DYNAMIC_MSVC_RUNTIME"] = not is_msvc_static_runtime(self) tc.generate() deps = CMakeDeps(self) + if self.options.get_safe("with_flint"): + deps.set_property("flint", "cmake_file_name", "mp++_FLINT") + deps.set_property("flint", "cmake_target_name", "mp++::FLINT") + deps.set_property("fmt", "cmake_config_version_compat", "AnyNewerVersion") deps.generate() def build(self): diff --git a/recipes/mppp/all/patches/0.26-0001-disable-warning-error.patch b/recipes/mppp/all/patches/0.26-0001-disable-warning-error.patch deleted file mode 100644 index 1f43796c81faa..0000000000000 --- a/recipes/mppp/all/patches/0.26-0001-disable-warning-error.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/cmake/yacma/YACMACompilerLinkerSettings.cmake b/cmake/yacma/YACMACompilerLinkerSettings.cmake -index 7d7aa1b..aaff75f 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) -@@ -180,7 +180,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/0.27-0001-disable-warning-error.patch b/recipes/mppp/all/patches/0.27-0001-disable-warning-error.patch deleted file mode 100644 index 8906bc4799f22..0000000000000 --- a/recipes/mppp/all/patches/0.27-0001-disable-warning-error.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/cmake/yacma/YACMACompilerLinkerSettings.cmake b/cmake/yacma/YACMACompilerLinkerSettings.cmake -index edafe6d..10f40ed 100644 ---- a/cmake/yacma/YACMACompilerLinkerSettings.cmake -+++ b/cmake/yacma/YACMACompilerLinkerSettings.cmake -@@ -91,11 +91,6 @@ if(NOT _YACMACompilerLinkerSettingsRun) - # For now it seems like -Wshadow from clang behaves better than GCC's, just enable it here - # for the time being. - _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wshadow) -- # Clang is better at this flag than GCC. -- # 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") - # 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) -@@ -190,8 +185,6 @@ if(NOT _YACMACompilerLinkerSettingsRun) - if(YACMA_COMPILER_IS_MSVC AND NOT YACMA_COMPILER_IS_CLANGXX) - # Enable higher warning level than usual. - _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4) -- # Treat warnings as errors. -- _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX) - endif() - - # Set the cache variables. 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 deleted file mode 100644 index 28109b89756fd..0000000000000 --- a/recipes/mppp/all/patches/0.27-0002-remove-fmt-version.patch +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 20284714ba410..0000000000000 --- a/recipes/mppp/all/patches/1.0.0-0001-disable-warning-error.patch +++ /dev/null @@ -1,22 +0,0 @@ -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 deleted file mode 100644 index b05a5e6c9a442..0000000000000 --- a/recipes/mppp/all/patches/1.0.0-0002-remove-fmt-version.patch +++ /dev/null @@ -1,13 +0,0 @@ -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/all/patches/1.0.3-0001-disable-warning-error.patch b/recipes/mppp/all/patches/1.0.3-0001-disable-warning-error.patch new file mode 100644 index 0000000000000..2bbd6313a54a7 --- /dev/null +++ b/recipes/mppp/all/patches/1.0.3-0001-disable-warning-error.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/yacma/YACMACompilerLinkerSettings.cmake b/cmake/yacma/YACMACompilerLinkerSettings.cmake +index 3d9cd9d..2b8cf7b 100644 +--- a/cmake/yacma/YACMACompilerLinkerSettings.cmake ++++ b/cmake/yacma/YACMACompilerLinkerSettings.cmake +@@ -96,7 +96,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) +@@ -197,7 +197,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/test_package/CMakeLists.txt b/recipes/mppp/all/test_package/CMakeLists.txt index 320edf00b9406..2aba80c2db018 100644 --- a/recipes/mppp/all/test_package/CMakeLists.txt +++ b/recipes/mppp/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(mp++ REQUIRED CONFIG) diff --git a/recipes/mppp/all/test_v1_package/CMakeLists.txt b/recipes/mppp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/mppp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mppp/all/test_v1_package/conanfile.py b/recipes/mppp/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/mppp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/mppp/config.yml b/recipes/mppp/config.yml index 02775a2352146..e37784b830b89 100644 --- a/recipes/mppp/config.yml +++ b/recipes/mppp/config.yml @@ -1,7 +1,5 @@ versions: - "1.0.0": + "2.0.0": folder: all - "0.27": - folder: all - "0.26": + "1.0.3": folder: all diff --git a/recipes/ms-gsl/all/conandata.yml b/recipes/ms-gsl/all/conandata.yml index 00aab19c60dba..9c0d15454ac4b 100644 --- a/recipes/ms-gsl/all/conandata.yml +++ b/recipes/ms-gsl/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.2.0": + url: "https://github.com/microsoft/GSL/archive/v4.2.0.tar.gz" + sha256: "2c717545a073649126cb99ebd493fa2ae23120077968795d2c69cbab821e4ac6" + "4.1.0": + url: "https://github.com/microsoft/GSL/archive/v4.1.0.tar.gz" + sha256: "0a227fc9c8e0bf25115f401b9a46c2a68cd28f299d24ab195284eb3f1d7794bd" "4.0.0": url: "https://github.com/microsoft/GSL/archive/v4.0.0.tar.gz" sha256: "f0e32cb10654fea91ad56bde89170d78cfbf4363ee0b01d8f097de2ba49f6ce9" diff --git a/recipes/ms-gsl/all/conanfile.py b/recipes/ms-gsl/all/conanfile.py index 22f61968c9ba8..e4e94a29cb26c 100644 --- a/recipes/ms-gsl/all/conanfile.py +++ b/recipes/ms-gsl/all/conanfile.py @@ -13,11 +13,10 @@ class MicrosoftGslConan(ConanFile): name = "ms-gsl" description = "Microsoft's implementation of the Guidelines Support Library" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/microsoft/GSL" - license = "MIT" - topics = ("gsl", "guidelines", "core", "span") - no_copy_source = True + topics = ("gsl", "guidelines", "core", "span", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { @@ -26,6 +25,7 @@ class MicrosoftGslConan(ConanFile): default_options = { "on_contract_violation": "terminate" } + no_copy_source = True @property def _minimum_cpp_standard(self): diff --git a/recipes/ms-gsl/all/test_package/CMakeLists.txt b/recipes/ms-gsl/all/test_package/CMakeLists.txt index 81fc0751a73bb..780a6287185aa 100644 --- a/recipes/ms-gsl/all/test_package/CMakeLists.txt +++ b/recipes/ms-gsl/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(Microsoft.GSL REQUIRED CONFIG) diff --git a/recipes/ms-gsl/all/test_v1_package/CMakeLists.txt b/recipes/ms-gsl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/ms-gsl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ms-gsl/all/test_v1_package/conanfile.py b/recipes/ms-gsl/all/test_v1_package/conanfile.py deleted file mode 100644 index 6314fb1c24e96..0000000000000 --- a/recipes/ms-gsl/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 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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/ms-gsl/config.yml b/recipes/ms-gsl/config.yml index b00b1020b4e16..11ee4a2f77123 100644 --- a/recipes/ms-gsl/config.yml +++ b/recipes/ms-gsl/config.yml @@ -1,4 +1,8 @@ versions: + "4.2.0": + folder: all + "4.1.0": + folder: all "4.0.0": folder: all "3.1.0": diff --git a/recipes/msdf-atlas-gen/all/conandata.yml b/recipes/msdf-atlas-gen/all/conandata.yml index 1c3664b5df564..3ce2299e54ce1 100644 --- a/recipes/msdf-atlas-gen/all/conandata.yml +++ b/recipes/msdf-atlas-gen/all/conandata.yml @@ -1,9 +1,16 @@ sources: + "1.3": + url: "https://github.com/Chlumsky/msdf-atlas-gen/archive/refs/tags/v1.3.tar.gz" + sha256: "5d3d58e8bc92836baf23ce3a80ef79cc4c2d022fb86b7f160b11cc06cd62fe78" "1.2.2": url: "https://github.com/Chlumsky/msdf-atlas-gen/archive/refs/tags/v1.2.2.tar.gz" sha256: "7D2EA46F66E21AB9A205BF7703D520F209B9A035EE13CBB266A3B8322F62FA28" patches: + "1.3": + - patch_file: "patches/1.3.0-0001-fix-cmake.patch" + patch_description: "Fix CMakeLists.txt to get libraries from Conan and install in bin dir" + patch_type: "conan" "1.2.2": - - patch_file: "patches/0001-fix-cmake.patch" + - patch_file: "patches/1.2.2-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 51daed7b1f501..d26eb8ef19f91 100644 --- a/recipes/msdf-atlas-gen/all/conanfile.py +++ b/recipes/msdf-atlas-gen/all/conanfile.py @@ -1,27 +1,27 @@ +import os + from conan import ConanFile -from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches, rmdir from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -import os - +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc required_conan_version = ">=1.53.0" class MsdfAtlasGenConan(ConanFile): name = "msdf-atlas-gen" + description = "MSDF font atlas generator" license = "MIT" - homepage = "https://github.com/Chlumsky/msdf-atlas-gen" url = "https://github.com/conan-io/conan-center-index" - description = "MSDF font atlas generator" + homepage = "https://github.com/Chlumsky/msdf-atlas-gen" topics = ("msdf-atlas-gen", "msdf", "font", "atlas") - settings = "os", "arch", "compiler", "build_type" package_type = "application" + settings = "os", "arch", "compiler", "build_type" - def requirements(self): - self.requires("artery-font-format/1.0") - self.requires("msdfgen/1.9.1") - self.requires("lodepng/cci.20200615") + def export_sources(self): + export_conandata_patches(self) def layout(self): cmake_layout(self, src_folder="src") @@ -30,25 +30,41 @@ def validate_build(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) + def requirements(self): + if Version(self.version) < "1.3": + self.requires("msdfgen/1.9.1") + self.requires("artery-font-format/1.0") + self.requires("lodepng/cci.20200615") + else: + self.requires("msdfgen/1.12") + self.requires("artery-font-format/1.1") + self.requires("libpng/[>=1.6 <2]") + def package_id(self): del self.info.settings.compiler del self.info.settings.build_type - def export_sources(self): - export_conandata_patches(self) - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) - tc.variables["MSDF_ATLAS_GEN_BUILD_STANDALONE"] = True + tc.cache_variables["MSDF_ATLAS_GEN_BUILD_STANDALONE"] = True + tc.cache_variables["MSDF_ATLAS_USE_VCPKG"] = False + tc.cache_variables["MSDF_ATLAS_USE_SKIA"] = False + tc.cache_variables["MSDF_ATLAS_NO_ARTERY_FONT"] = False + tc.cache_variables["MSDF_ATLAS_MSDFGEN_EXTERNAL"] = True + tc.cache_variables["MSDF_ATLAS_INSTALL"] = True + if Version(self.version) >= "1.3": + tc.preprocessor_definitions["MSDFGEN_USE_LIBPNG"] = 1 + if is_msvc(self): + tc.cache_variables["MSDF_ATLAS_DYNAMIC_RUNTIME"] = "dynamic" in str(self.settings.compiler.runtime) or "MD" in str(self.settings.compiler.runtime) tc.generate() tc = CMakeDeps(self) tc.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -57,6 +73,7 @@ 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", "cmake")) def package_info(self): self.cpp_info.frameworkdirs = [] diff --git a/recipes/msdf-atlas-gen/all/patches/0001-fix-cmake.patch b/recipes/msdf-atlas-gen/all/patches/0001-fix-cmake.patch deleted file mode 100644 index 356c6a09fe8be..0000000000000 --- a/recipes/msdf-atlas-gen/all/patches/0001-fix-cmake.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- 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/patches/1.2.2-0001-fix-cmake.patch b/recipes/msdf-atlas-gen/all/patches/1.2.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..f4f985352e174 --- /dev/null +++ b/recipes/msdf-atlas-gen/all/patches/1.2.2-0001-fix-cmake.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b1ec605..6b6277a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,10 +7,11 @@ set(MSDFGEN_BUILD_MSDFGEN_STANDALONE OFF CACHE BOOL "Build the msdfgen standalon + 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) +- ++# add_subdirectory(msdfgen) + find_package(Threads REQUIRED) +- ++find_package(msdfgen REQUIRED) ++find_package(artery-font-format REQUIRED) ++find_package(lodepng REQUIRED CONFIG) + file(GLOB_RECURSE msdf-atlas-gen_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + "msdf-atlas-gen/*.h" + "msdf-atlas-gen/*.hpp" +@@ -24,19 +25,19 @@ file(GLOB_RECURSE msdf-atlas-gen_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + 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 +-) ++# 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 lodepng::lodepng) + + # TODO make these public in msdfgen so that this doesn't have to be repeated here + if(FREETYPE_WITH_PNG) +@@ -58,3 +59,5 @@ if(MSDF_ATLAS_GEN_BUILD_STANDALONE) + 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/patches/1.3.0-0001-fix-cmake.patch b/recipes/msdf-atlas-gen/all/patches/1.3.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..80d3825982383 --- /dev/null +++ b/recipes/msdf-atlas-gen/all/patches/1.3.0-0001-fix-cmake.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5b7f6db..1936ca5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -109,7 +109,8 @@ target_include_directories(msdf-atlas-gen INTERFACE + if(MSDF_ATLAS_NO_ARTERY_FONT) + target_compile_definitions(msdf-atlas-gen PUBLIC MSDF_ATLAS_NO_ARTERY_FONT) + else() +- target_include_directories(msdf-atlas-gen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/artery-font-format) ++ find_package(artery-font-format REQUIRED CONFIG) ++ target_link_libraries(msdf-atlas-gen PRIVATE artery-font-format::artery-font-format) + endif() + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT msdf-atlas-gen) + +@@ -118,7 +119,7 @@ target_link_libraries(msdf-atlas-gen PRIVATE Threads::Threads) + if(NOT MSDFGEN_DISABLE_PNG) + target_link_libraries(msdf-atlas-gen PRIVATE PNG::PNG) + endif() +-target_link_libraries(msdf-atlas-gen PUBLIC msdfgen::msdfgen) ++target_link_libraries(msdf-atlas-gen PUBLIC msdfgen::msdfgen msdfgen::msdfgen-ext) + + if(BUILD_SHARED_LIBS AND WIN32) + target_compile_definitions(msdf-atlas-gen PRIVATE "MSDF_ATLAS_PUBLIC=__declspec(dllexport)") diff --git a/recipes/msdf-atlas-gen/all/test_package/Sacramento-Regular.ttf b/recipes/msdf-atlas-gen/all/test_package/Sacramento-Regular.ttf deleted file mode 100644 index cfd2eabc8699f..0000000000000 Binary files a/recipes/msdf-atlas-gen/all/test_package/Sacramento-Regular.ttf and /dev/null differ diff --git a/recipes/msdf-atlas-gen/all/test_package/conanfile.py b/recipes/msdf-atlas-gen/all/test_package/conanfile.py index f15dfbbe1bd98..ff5302d78bc18 100644 --- a/recipes/msdf-atlas-gen/all/test_package/conanfile.py +++ b/recipes/msdf-atlas-gen/all/test_package/conanfile.py @@ -12,23 +12,6 @@ class TestPackageConan(ConanFile): def requirements(self): self.requires(self.tested_reference_str) - @property - def _atlas_texture_file(self): - return os.path.join(self.build_folder, "atlas_texture.png") - - @property - def _atlas_desc_file(self): - return os.path.join(self.build_folder, "atlas_desc.json") - def test(self): 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), env="conanrun") - - assert ret_code == 0 - assert os.path.isfile(self._atlas_texture_file) - assert os.path.isfile(self._atlas_desc_file) - + self.run("msdf-atlas-gen -help", env="conanrun") diff --git a/recipes/msdf-atlas-gen/all/test_package/uppercase_charset b/recipes/msdf-atlas-gen/all/test_package/uppercase_charset deleted file mode 100644 index c3c76b7e894ab..0000000000000 --- a/recipes/msdf-atlas-gen/all/test_package/uppercase_charset +++ /dev/null @@ -1 +0,0 @@ -['A', 'Z'] diff --git a/recipes/msdf-atlas-gen/config.yml b/recipes/msdf-atlas-gen/config.yml index af40d9653a378..297a337077654 100644 --- a/recipes/msdf-atlas-gen/config.yml +++ b/recipes/msdf-atlas-gen/config.yml @@ -1,3 +1,5 @@ versions: + "1.3": + folder: all "1.2.2": folder: all diff --git a/recipes/msdfgen/all/conandata.yml b/recipes/msdfgen/all/conandata.yml index 2d80e884e7bf9..6943aebeb6690 100644 --- a/recipes/msdfgen/all/conandata.yml +++ b/recipes/msdfgen/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.12": + url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.12.tar.gz" + sha256: "f058117496097217d12e4ea86adbff8467adaf6f12af793925d243b86b0c4f57" + "1.11": + url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.11.tar.gz" + sha256: "fad74e33274f591e72511bc0546189e7aec439f2a512ef1b2fde243554d457cb" "1.10": url: "https://github.com/Chlumsky/msdfgen/archive/refs/tags/v1.10.tar.gz" sha256: "2754d1687bfb80968d9c682e0c4c04c8fcf72df1421d076baf44ea0d87aa3662" @@ -10,8 +16,8 @@ sources: sha256: "909eb88c71268dc00cdda244a1fa40a0feefae45f68a779fbfddd5463559fa40" patches: "1.10": - - patch_file: "patches/1.10-0001-fix-cmake.patch" - patch_description: "move project position to top" + - patch_file: "patches/1.10-0001-honor-msvc-runtime.patch" + patch_description: "Remove hardcoded vc runtime" patch_type: "conan" "1.9.1": - patch_file: "patches/1.9-0001-unvendor-external-libs.patch" diff --git a/recipes/msdfgen/all/conanfile.py b/recipes/msdfgen/all/conanfile.py index 03f96bc253715..2094d2f1bfe2c 100644 --- a/recipes/msdfgen/all/conanfile.py +++ b/recipes/msdfgen/all/conanfile.py @@ -2,22 +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, replace_in_file, rm, 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 MsdfgenConan(ConanFile): name = "msdfgen" description = "Multi-channel signed distance field generator" license = "MIT" - topics = ("msdf", "shape", "glyph", "font") - homepage = "https://github.com/Chlumsky/msdfgen" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://github.com/Chlumsky/msdfgen" + topics = ("msdf", "shape", "glyph", "font") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -49,12 +48,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.12.1") + self.requires("freetype/2.13.2") if Version(self.version) < "1.10": self.requires("lodepng/cci.20200615") else: - self.requires("libpng/1.6.39") - self.requires("tinyxml2/9.0.0") + self.requires("libpng/[>=1.6 <2]") + self.requires("tinyxml2/10.0.0") + def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -65,59 +65,45 @@ def validate(self): raise ConanInvalidConfiguration("skia recipe not available yet in CCI") def source(self): - get(self, **self.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["MSDFGEN_BUILD_MSDFGEN_STANDALONE"] = self.options.utility - tc.variables["MSDFGEN_USE_OPENMP"] = self.options.with_openmp - tc.variables["MSDFGEN_USE_CPP11"] = True - tc.variables["MSDFGEN_USE_SKIA"] = self.options.with_skia - tc.variables["MSDFGEN_INSTALL"] = True + tc.cache_variables["MSDFGEN_BUILD_MSDFGEN_STANDALONE"] = self.options.utility + tc.cache_variables["MSDFGEN_USE_OPENMP"] = self.options.with_openmp + tc.cache_variables["MSDFGEN_USE_CPP11"] = True + tc.cache_variables["MSDFGEN_USE_SKIA"] = self.options.with_skia + tc.cache_variables["MSDFGEN_INSTALL"] = True if Version(self.version) >= "1.10": - tc.variables["MSDFGEN_DYNAMIC_RUNTIME"] = not is_msvc_static_runtime(self) - tc.variables["MSDFGEN_USE_VCPKG"] = False + tc.cache_variables["MSDFGEN_USE_VCPKG"] = False + # Because in upstream CMakeLists, project() is called after some logic based on BUILD_SHARED_LIBS + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + if Version(self.version) >= "1.11": + tc.cache_variables["MSDFGEN_DYNAMIC_RUNTIME"] = not is_msvc_static_runtime(self) + 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) deps.generate() def _patch_sources(self): apply_conandata_patches(self) - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - # workaround against CMAKE_FIND_PACKAGE_PREFER_CONFIG ON in conan toolchain - replace_in_file(self, cmakelists, "find_package(Freetype REQUIRED)", "find_package(Freetype REQUIRED MODULE)") - # remove bundled lodepng & tinyxml2 - rmdir(self, os.path.join(self.source_folder, "lib")) - rmdir(self, os.path.join(self.source_folder, "include")) - # very weird but required for Visual Studio when libs are unvendored (at least for Ninja generator) - if is_msvc(self): - if Version(self.version) < "1.10": + + if Version(self.version) < "1.10": + # remove bundled lodepng & tinyxml2 + rmdir(self, os.path.join(self.source_folder, "lib")) + rmdir(self, os.path.join(self.source_folder, "include")) + + # very weird but required for Visual Studio when libs are unvendored (at least for Ninja generator) + if is_msvc(self): replace_in_file( self, - cmakelists, + os.path.join(self.source_folder, "CMakeLists.txt"), "set_target_properties(msdfgen-standalone PROPERTIES ARCHIVE_OUTPUT_DIRECTORY archive OUTPUT_NAME msdfgen)", "set_target_properties(msdfgen-standalone PROPERTIES OUTPUT_NAME msdfgen IMPORT_PREFIX foo)", ) - else: - replace_in_file( - self, - cmakelists, - 'set_property(TARGET msdfgen-core PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")', - '' - ) - replace_in_file( - self, - cmakelists, - 'set_property(TARGET msdfgen-ext PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")', - '' - ) - replace_in_file( - self, - cmakelists, - 'set_property(TARGET msdfgen PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")', - '' - ) def build(self): self._patch_sources() @@ -130,6 +116,7 @@ def package(self): 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")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "msdfgen") @@ -167,7 +154,6 @@ def package_info(self): if self.options.with_skia: self.cpp_info.components["msdfgen-ext"].defines.append("MSDFGEN_USE_SKIA") + # TODO: to remove once conan v1 support dropped if self.options.utility: - 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.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch b/recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch deleted file mode 100644 index 50b04c4c1e5d9..0000000000000 --- a/recipes/msdfgen/all/patches/1.10-0001-fix-cmake.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6dec916..432f218 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2,6 +2,9 @@ - cmake_minimum_required(VERSION 3.15) - include(cmake/version.cmake) - -+# Version is specified in vcpkg.json -+project(msdfgen VERSION ${MSDFGEN_VERSION} LANGUAGES CXX) -+ - option(MSDFGEN_CORE_ONLY "Only build the core library with no dependencies" OFF) - option(MSDFGEN_BUILD_STANDALONE "Build the msdfgen standalone executable" ON) - option(MSDFGEN_USE_VCPKG "Use vcpkg package manager to link project dependencies" ON) -@@ -67,9 +70,6 @@ if(MSDFGEN_USE_VCPKG) - endif() - endif() - --# Version is specified in vcpkg.json --project(msdfgen VERSION ${MSDFGEN_VERSION} LANGUAGES CXX) -- - file(GLOB_RECURSE MSDFGEN_CORE_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "core/*.h" "core/*.hpp") - file(GLOB_RECURSE MSDFGEN_CORE_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "core/*.cpp") - file(GLOB_RECURSE MSDFGEN_EXT_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ext/*.h" "ext/*.hpp") diff --git a/recipes/msdfgen/all/patches/1.10-0001-honor-msvc-runtime.patch b/recipes/msdfgen/all/patches/1.10-0001-honor-msvc-runtime.patch new file mode 100644 index 0000000000000..c0f9784ad23cf --- /dev/null +++ b/recipes/msdfgen/all/patches/1.10-0001-honor-msvc-runtime.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -79,7 +79,6 @@ file(GLOB_RECURSE MSDFGEN_EXT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ext/ + add_library(msdfgen-core "${CMAKE_CURRENT_SOURCE_DIR}/msdfgen.h" ${MSDFGEN_CORE_HEADERS} ${MSDFGEN_CORE_SOURCES}) + add_library(msdfgen::msdfgen-core ALIAS msdfgen-core) + set_target_properties(msdfgen-core PROPERTIES PUBLIC_HEADER "${MSDFGEN_CORE_HEADERS}") +-set_property(TARGET msdfgen-core PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + target_compile_definitions(msdfgen-core PUBLIC + MSDFGEN_VERSION=${MSDFGEN_VERSION} + MSDFGEN_VERSION_MAJOR=${MSDFGEN_VERSION_MAJOR} +@@ -127,7 +126,6 @@ if(NOT MSDFGEN_CORE_ONLY) + add_library(msdfgen-ext "${CMAKE_CURRENT_SOURCE_DIR}/msdfgen-ext.h" ${MSDFGEN_EXT_HEADERS} ${MSDFGEN_EXT_SOURCES}) + add_library(msdfgen::msdfgen-ext ALIAS msdfgen-ext) + set_target_properties(msdfgen-ext PROPERTIES PUBLIC_HEADER "${MSDFGEN_EXT_HEADERS}") +- set_property(TARGET msdfgen-ext PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + target_compile_definitions(msdfgen-ext PUBLIC MSDFGEN_USE_LIBPNG) + target_link_libraries(msdfgen-ext PRIVATE msdfgen::msdfgen-core Freetype::Freetype tinyxml2::tinyxml2 PNG::PNG) + target_include_directories(msdfgen-ext +@@ -171,7 +169,6 @@ if(MSDFGEN_BUILD_STANDALONE) + add_executable(msdfgen ${MSDFGEN_STANDALONE_SOURCES}) + target_compile_definitions(msdfgen PUBLIC MSDFGEN_STANDALONE) + target_compile_definitions(msdfgen PRIVATE MSDFGEN_VERSION_UNDERLINE=${MSDFGEN_VERSION_UNDERLINE}) +- set_property(TARGET msdfgen PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + target_link_libraries(msdfgen PRIVATE msdfgen::msdfgen) + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT msdfgen) + endif() diff --git a/recipes/msdfgen/all/test_package/CMakeLists.txt b/recipes/msdfgen/all/test_package/CMakeLists.txt index 6016e8cfe3244..7cea750468ca8 100644 --- a/recipes/msdfgen/all/test_package/CMakeLists.txt +++ b/recipes/msdfgen/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(msdfgen REQUIRED CONFIG) diff --git a/recipes/msdfgen/all/test_package/OpenSans-Bold.ttf b/recipes/msdfgen/all/test_package/OpenSans-Bold.ttf deleted file mode 100644 index fd79d43bea029..0000000000000 Binary files a/recipes/msdfgen/all/test_package/OpenSans-Bold.ttf and /dev/null differ diff --git a/recipes/msdfgen/all/test_package/conanfile.py b/recipes/msdfgen/all/test_package/conanfile.py index c4fdfb4dbdc98..0a6bc68712d90 100644 --- a/recipes/msdfgen/all/test_package/conanfile.py +++ b/recipes/msdfgen/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - ttf_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") - self.run(f"{bin_path} {ttf_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/msdfgen/all/test_package/test_package.cpp b/recipes/msdfgen/all/test_package/test_package.cpp index d169064c206c2..fc8e183067d7e 100644 --- a/recipes/msdfgen/all/test_package/test_package.cpp +++ b/recipes/msdfgen/all/test_package/test_package.cpp @@ -4,26 +4,9 @@ #include int main(int argc, char **argv) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - return 1; - } - msdfgen::FreetypeHandle *ft = msdfgen::initializeFreetype(); if (ft) { - msdfgen::FontHandle *font = msdfgen::loadFont(ft, argv[1]); - if (font) { - msdfgen::Shape shape; - if (msdfgen::loadGlyph(shape, font, 'A')) { - shape.normalize(); - msdfgen::edgeColoringSimple(shape, 3.0); - msdfgen::Bitmap msdf(32, 32); - msdfgen::generateMSDF(msdf, shape, 4.0, 1.0, msdfgen::Vector2(4.0, 4.0)); - msdfgen::savePng(msdf, "output.png"); - } - msdfgen::destroyFont(font); - } - msdfgen::deinitializeFreetype(ft); + std::cout << "Test" << std::endl; // This should be printed } return 0; } diff --git a/recipes/msdfgen/all/test_v1_package/CMakeLists.txt b/recipes/msdfgen/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/msdfgen/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/msdfgen/all/test_v1_package/conanfile.py b/recipes/msdfgen/all/test_v1_package/conanfile.py deleted file mode 100644 index 7b775db727c08..0000000000000 --- a/recipes/msdfgen/all/test_v1_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 = os.path.join("bin", "test_package") - ttf_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") - self.run(f"{bin_path} {ttf_path}", run_environment=True) diff --git a/recipes/msdfgen/config.yml b/recipes/msdfgen/config.yml index 9f326bdd6e1a4..aa26d962008db 100644 --- a/recipes/msdfgen/config.yml +++ b/recipes/msdfgen/config.yml @@ -1,4 +1,8 @@ versions: + "1.12": + folder: all + "1.11": + folder: all "1.10": folder: all "1.9.1": diff --git a/recipes/msgpack-c/all/conandata.yml b/recipes/msgpack-c/all/conandata.yml index 0062926e73ac9..9326cc90f6718 100644 --- a/recipes/msgpack-c/all/conandata.yml +++ b/recipes/msgpack-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "6.1.0": + url: "https://github.com/msgpack/msgpack-c/releases/download/c-6.1.0/msgpack-c-6.1.0.tar.gz" + sha256: "674119f1a85b5f2ecc4c7d5c2859edf50c0b05e0c10aa0df85eefa2c8c14b796" "6.0.0": url: "https://github.com/msgpack/msgpack-c/releases/download/c-6.0.0/msgpack-c-6.0.0.tar.gz" sha256: "3654f5e2c652dc52e0a993e270bb57d5702b262703f03771c152bba51602aeba" diff --git a/recipes/msgpack-c/all/test_package/CMakeLists.txt b/recipes/msgpack-c/all/test_package/CMakeLists.txt index 8fda341f88c80..6104dd8285663 100644 --- a/recipes/msgpack-c/all/test_package/CMakeLists.txt +++ b/recipes/msgpack-c/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(msgpack REQUIRED CONFIG) diff --git a/recipes/msgpack-c/all/test_v1_package/CMakeLists.txt b/recipes/msgpack-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 961b416af6b07..0000000000000 --- a/recipes/msgpack-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -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/msgpack-c/all/test_v1_package/conanfile.py b/recipes/msgpack-c/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/msgpack-c/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/msgpack-c/config.yml b/recipes/msgpack-c/config.yml index 08e152a5c47d0..3267291611670 100644 --- a/recipes/msgpack-c/config.yml +++ b/recipes/msgpack-c/config.yml @@ -1,4 +1,6 @@ versions: + "6.1.0": + folder: all "6.0.0": folder: all "5.0.0": diff --git a/recipes/msgpack-cxx/all/conandata.yml b/recipes/msgpack-cxx/all/conandata.yml index 6af577efebddf..3aadf7df1811f 100644 --- a/recipes/msgpack-cxx/all/conandata.yml +++ b/recipes/msgpack-cxx/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "7.0.0": + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-7.0.0/msgpack-cxx-7.0.0.tar.gz" + sha256: "7504b7af7e7b9002ce529d4f941e1b7fb1fb435768780ce7da4abaac79bb156f" + "6.1.1": + url: "https://github.com/msgpack/msgpack-c/releases/download/cpp-6.1.1/msgpack-cxx-6.1.1.tar.gz" + sha256: "5fd555742e37bbd58d166199e669f01f743c7b3c6177191dd7b31fb0c37fa191" "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" diff --git a/recipes/msgpack-cxx/all/conanfile.py b/recipes/msgpack-cxx/all/conanfile.py index 8d22fa5798373..8112274e3a237 100644 --- a/recipes/msgpack-cxx/all/conanfile.py +++ b/recipes/msgpack-cxx/all/conanfile.py @@ -24,8 +24,8 @@ class MsgpackCXXConan(ConanFile): } no_copy_source = True - def configure_options(self): - # No boost was added since 4.1.0 + def config_options(self): + # Boost was not optional until 4.1.0 if Version(self.version) < "4.1.0": del self.options.use_boost @@ -33,6 +33,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): + # Boost was not optional until 4.1.0 if self.options.get_safe("use_boost", True): self.requires("boost/1.83.0") @@ -87,8 +88,12 @@ 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") + if Version(self.version) > "6.1.1": + self.cpp_info.set_property("cmake_file_name", "msgpack-cxx") + else: + # The README is wrong, the correct name is msgpack-cxx, + # but keep it for old published versions not to break the consumers + self.cpp_info.set_property("cmake_file_name", "msgpack") if Version(self.version) >= "6.0.0": self.cpp_info.set_property("cmake_target_name", "msgpack-cxx") @@ -108,7 +113,13 @@ def package_info(self): self.cpp_info.requires.append("boost::headers") # 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" + if Version(self.version) > "6.1.1": + self.cpp_info.filenames["cmake_find_package"] = "msgpack-cxx" + self.cpp_info.filenames["cmake_find_package_multi"] = "msgpack-cxx" + else: + # The README is wrong, the correct name is msgpack-cxx, + # but keep it for old published versions not to break the consumers + self.cpp_info.filenames["cmake_find_package"] = "msgpack" + self.cpp_info.filenames["cmake_find_package_multi"] = "msgpack" 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 d8ac6bce3d809..c74139de33ea0 100644 --- a/recipes/msgpack-cxx/all/test_package/CMakeLists.txt +++ b/recipes/msgpack-cxx/all/test_package/CMakeLists.txt @@ -1,10 +1,15 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -find_package(msgpack REQUIRED CONFIG) +if (MSGPACK_VERSION_LESS_EQ_6_1_1) + find_package(msgpack REQUIRED CONFIG) + set(msgpack-cxx_VERSION ${msgpack_VERSION}) +else() + find_package(msgpack-cxx REQUIRED CONFIG) +endif() add_executable(${PROJECT_NAME} test_package.cpp) -if(msgpack_VERSION VERSION_GREATER_EQUAL "6.0.0") +if(msgpack-cxx_VERSION VERSION_GREATER_EQUAL "6.0.0") target_link_libraries(${PROJECT_NAME} msgpack-cxx) else() target_link_libraries(${PROJECT_NAME} msgpackc-cxx) diff --git a/recipes/msgpack-cxx/all/test_package/conanfile.py b/recipes/msgpack-cxx/all/test_package/conanfile.py index e845ae751a301..4f7740cb3125f 100644 --- a/recipes/msgpack-cxx/all/test_package/conanfile.py +++ b/recipes/msgpack-cxx/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_layout, CMake +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "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["MSGPACK_VERSION_LESS_EQ_6_1_1"] = self.dependencies[self.tested_reference_str].ref.version <= "6.1.1" + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/msgpack-cxx/all/test_v1_package/CMakeLists.txt b/recipes/msgpack-cxx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/msgpack-cxx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/msgpack-cxx/all/test_v1_package/conanfile.py b/recipes/msgpack-cxx/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/msgpack-cxx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/msgpack-cxx/config.yml b/recipes/msgpack-cxx/config.yml index 934a0432a27c7..5aecc7725d45b 100644 --- a/recipes/msgpack-cxx/config.yml +++ b/recipes/msgpack-cxx/config.yml @@ -1,4 +1,8 @@ versions: + "7.0.0": + folder: all + "6.1.1": + folder: all "6.1.0": folder: all "6.0.0": diff --git a/recipes/msgpack/all/CMakeLists.txt b/recipes/msgpack/all/CMakeLists.txt index 11573c481bf89..f52f2456d347d 100644 --- a/recipes/msgpack/all/CMakeLists.txt +++ b/recipes/msgpack/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(conanbuildinfo.cmake) diff --git a/recipes/msgpack/all/test_package/CMakeLists.txt b/recipes/msgpack/all/test_package/CMakeLists.txt index 7b194f0596222..3c96e8233dd5c 100644 --- a/recipes/msgpack/all/test_package/CMakeLists.txt +++ b/recipes/msgpack/all/test_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/msgpack23/all/conandata.yml b/recipes/msgpack23/all/conandata.yml new file mode 100644 index 0000000000000..8eeac02da3158 --- /dev/null +++ b/recipes/msgpack23/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.1": + url: "https://github.com/rwindegger/msgpack23/archive/refs/tags/v2.1.tar.gz" + sha256: "9CE1E294518AA76CAC50F778A359AED17A0DAA0D8DC4C1F94CD4F12438B3606C" diff --git a/recipes/msgpack23/all/conanfile.py b/recipes/msgpack23/all/conanfile.py new file mode 100644 index 0000000000000..feec10ce46c65 --- /dev/null +++ b/recipes/msgpack23/all/conanfile.py @@ -0,0 +1,61 @@ +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, rmdir +import os + + +required_conan_version = ">=2.0.9" + + + +class PackageConan(ConanFile): + name = "msgpack23" + description = "A modern, header-only C++ library for MessagePack serialization and deserialization." + license = "MIT" + url = "https://github.com/rwindegger/msgpack23" + homepage = "https://github.com/rwindegger/msgpack23" + topics = ("msgpack", "serialization", "MessagePack") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + check_min_cppstd(self, 23) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.28 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package_id(self): + self.info.clear() + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.generate() + + def build(self): + 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", "pkgconfig")) + 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.libdirs = [] + self.cpp_info.bindirs = [] + self.cpp_info.set_property("cmake_file_name", "msgpack23") + self.cpp_info.set_property("cmake_target_name", "msgpack23::msgpack23") diff --git a/recipes/msgpack23/all/test_package/CMakeLists.txt b/recipes/msgpack23/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9eb330c8d94e8 --- /dev/null +++ b/recipes/msgpack23/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + + +find_package(msgpack23 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE msgpack23::msgpack23) diff --git a/recipes/msgpack23/all/test_package/conanfile.py b/recipes/msgpack23/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2e77b4246fa81 --- /dev/null +++ b/recipes/msgpack23/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" + + 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/msgpack23/all/test_package/test_package.cpp b/recipes/msgpack23/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ca7ebfb68bc4b --- /dev/null +++ b/recipes/msgpack23/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include + +int main(void) { + + msgpack23::Packer packer {}; + std::uint8_t const expected = 42; + auto data = packer(expected); + msgpack23::Unpacker unpacker {data}; + std::int8_t actual {}; + unpacker(actual); + + return EXIT_SUCCESS; +} diff --git a/recipes/msgpack23/config.yml b/recipes/msgpack23/config.yml new file mode 100644 index 0000000000000..adf6918baab9c --- /dev/null +++ b/recipes/msgpack23/config.yml @@ -0,0 +1,3 @@ +versions: + "2.1": + folder: all diff --git a/recipes/msix/all/CMakeLists.txt b/recipes/msix/all/CMakeLists.txt deleted file mode 100644 index c477e0c1e565e..0000000000000 --- a/recipes/msix/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory("source_subfolder") diff --git a/recipes/msix/all/conandata.yml b/recipes/msix/all/conandata.yml index ef22231170ffe..0de96c69cb0d4 100644 --- a/recipes/msix/all/conandata.yml +++ b/recipes/msix/all/conandata.yml @@ -4,7 +4,8 @@ sources: sha256: "23179d577d0b9d34e93374ae38284ab9f1247ff6cc9175851983fb114ab00087" patches: "1.7": - - base_path: "source_subfolder" - patch_file: "patches/1.7/cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.7/signaturevalidator.patch" + - patch_file: "patches/1.7/cmake.patch" + - patch_file: "patches/1.7/signaturevalidator.patch" + - patch_file: "patches/1.7/001-fix-missing-include.patch" + patch_description: "Fix missing #include " + patch_type: "portability" diff --git a/recipes/msix/all/conanfile.py b/recipes/msix/all/conanfile.py index 0c62a718f8c29..9a1d7b90fe8e0 100644 --- a/recipes/msix/all/conanfile.py +++ b/recipes/msix/all/conanfile.py @@ -1,19 +1,26 @@ -from conans import CMake, ConanFile, 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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get +from conan.tools.scm import Version -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class MsixConan(ConanFile): name = "msix" + description = "An SDK for creating MSIX packages" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/microsoft/msix-packaging" - description = "An SDK for creating MSIX packages" - topics = ("msix", "sdk", "packaging", "conan-recipe") + topics = ("sdk", "packaging", "conan-recipe") - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -22,7 +29,7 @@ class MsixConan(ConanFile): "skip_bundles": [True, False], "use_external_zlib": [True, False], "use_validation_parser": [True, False], - "xml_parser": ["applexml", "javaxml", "msxml6", "xerces"] + "with_xerces": [True, False], } default_options = { "shared": False, @@ -32,126 +39,134 @@ class MsixConan(ConanFile): "skip_bundles": False, "use_external_zlib": True, "use_validation_parser": False, - "xml_parser": "msxml6" + "with_xerces": False, } - generators = "cmake" - exports_sources = "CMakeLists.txt", "patches/**" - - _cmake = None + @property + def _min_cppstd(self): + return 14 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): return { - "Visual Studio": "15" + "apple-clang": "10", + "clang": "7", + "msvc": "191", + "Visual Studio": "15", } - @property - def _source_subfolder(self): - return "source_subfolder" - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - if self.settings.os == "Android": - self._cmake.definitions["AOSP"] = True - if self.settings.os == "Linux": - self._cmake.definitions["LINUX"] = True - if self.settings.os == "Macos": - self._cmake.definitions["MACOS"] = True - self._cmake.definitions["CRYPTO_LIB"] = self.options.crypto_lib - self._cmake.definitions["MSIX_PACK"] = self.options.pack - self._cmake.definitions["MSIX_SAMPLES"] = False - self._cmake.definitions["MSIX_TESTS"] = False - self._cmake.definitions["SKIP_BUNDLES"] = self.options.skip_bundles - self._cmake.definitions["USE_MSIX_SDK_ZLIB"] = self.options.use_external_zlib - self._cmake.definitions["USE_SHARED_ZLIB"] = self.options["zlib"].shared - self._cmake.definitions["USE_VALIDATION_PARSER"] = self.options.use_validation_parser - self._cmake.definitions["XML_PARSER"] = self.options.xml_parser - self._cmake.definitions["CALCULATE_VERSION"] = False - self._cmake.definitions["ENABLE_NUGET_PACKAGING"] = False - self._cmake.configure() - return self._cmake - - def _validate_compiler_settings(self): - compiler = self.settings.compiler - if compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") - - 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)) - elif 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 export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - self.options.crypto_lib = "crypt32" + if self.settings.os != "Windows": + del self.options.crypto_lib + if not is_apple_os(self) and self.settings.os not in ["Windows", "Android"]: + # with_xerces is required + del self.options.with_xerces 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.settings.os == "Linux" and not self.options.skip_bundles: - self.requires("icu/71.1") - if self.options.crypto_lib == "openssl": - self.requires("openssl/1.1.1q") + if self.settings.os in ["Linux", "FreeBSD"] and not self.options.skip_bundles: + self.requires("icu/74.2") + if self.options.get_safe("crypto_lib", "openssl") == "openssl": + self.requires("openssl/[>=1.1 <4]") if self.options.use_external_zlib: - self.requires("zlib/1.2.12") - if self.options.xml_parser == "xerces": - self.requires("xerces-c/3.2.3") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.get_safe("with_xerces", True): + self.requires("xerces-c/3.2.5") + + def _validate_compiler_settings(self): + compiler = self.settings.compiler + if compiler.get_safe("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." + ) def validate(self): - if self.settings.os != "Android" and self.options.xml_parser == "javaxml": - raise ConanInvalidConfiguration("javaxml is supported only for Android") - if self.settings.os == "Linux" and self.settings.compiler != "clang": - raise ConanInvalidConfiguration("Only clang is supported on Linux") - if self.settings.os != "Macos" and self.options.xml_parser == "applexml": - raise ConanInvalidConfiguration("applexml is supported only for MacOS") - if self.settings.os != "Windows" and self.options.crypto_lib == "crypt32": - raise ConanInvalidConfiguration("crypt32 is supported only for Windows") - if self.settings.os != "Windows" and self.options.xml_parser == "msxml6": - raise ConanInvalidConfiguration("msxml6 is supported only for Windows") + if self.settings.os in ["Linux", "FreeBSD"] and self.settings.compiler != "clang": + raise ConanInvalidConfiguration(f"Only clang is supported on {self.settings.os}") + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= "12" and self.version == "1.7": + # AppxPackaging.hpp:706:5: error: templates must have C++ linkage + raise ConanInvalidConfiguration("Clang 12 and newer are not supported") if self.options.pack: - if self.settings.os == "Macos": + if is_apple_os(self): if not self.options.use_external_zlib: raise ConanInvalidConfiguration("Using libCompression APIs and packaging features is not supported") - if self.options.xml_parser != "xerces": + if not self.options.get_safe("with_xerces", True): raise ConanInvalidConfiguration("Xerces is the only supported parser for MacOS pack") if not self.options.use_validation_parser: raise ConanInvalidConfiguration("Packaging requires validation parser") - if (self.options.xml_parser == "xerces" and - self.options["xerces-c"].char_type != "char16_t"): - raise ConanInvalidConfiguration("Only char16_t is supported for xerces-c") - + if self.options.get_safe("with_xerces", True) and self.dependencies["xerces-c"].options.char_type != "char16_t": + raise ConanInvalidConfiguration("Only char16_t is supported for xerces-c") + self._validate_compiler_settings() 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) + if self.settings.os == "Android": + tc.variables["AOSP"] = True + if self.settings.os in ["Linux", "FreeBSD"]: + tc.variables["LINUX"] = True + if is_apple_os(self): + tc.variables["MACOS"] = True + tc.variables["CRYPTO_LIB"] = self.options.get_safe("crypto_lib", "openssl") + tc.variables["MSIX_PACK"] = self.options.pack + tc.variables["MSIX_SAMPLES"] = False + tc.variables["MSIX_TESTS"] = False + tc.variables["SKIP_BUNDLES"] = self.options.skip_bundles + tc.variables["USE_MSIX_SDK_ZLIB"] = self.options.use_external_zlib + tc.variables["USE_VALIDATION_PARSER"] = self.options.use_validation_parser + if self.options.get_safe("with_xerces", True): + tc.variables["XML_PARSER"] = "xerces" + elif self.settings.os == "Android": + tc.variables["XML_PARSER"] = "javaxml" + elif is_apple_os(self): + tc.variables["XML_PARSER"] = "applexml" + elif self.settings.os == "Windows": + tc.variables["XML_PARSER"] = "msxml6" + tc.variables["CALCULATE_VERSION"] = False + tc.variables["ENABLE_NUGET_PACKAGING"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + 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): - 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 == "Windows": - self.cpp_info.system_libs = ["runtimeobject"] - if self.settings.compiler == "Visual Studio": - self.cpp_info.system_libs.append("delayimp") - if self.options.crypto_lib == "crypt32": - self.cpp_info.system_libs.extend(["bcrypt", "crypt32", "wintrust"]) - if self.options.xml_parser == "msxml6": + # https://github.com/microsoft/msix-packaging/blob/v1.7/src/msix/CMakeLists.txt#L271 + self.cpp_info.system_libs.extend(["bcrypt", "crypt32", "wintrust", "runtimeobject", "delayimp"]) + if not self.options.with_xerces: self.cpp_info.system_libs.append("msxml6") + if is_apple_os(self): + # https://github.com/microsoft/msix-packaging/blob/v1.7/src/msix/CMakeLists.txt#L364 + self.cpp_info.frameworks.extend(["CoreFoundation", "Foundation"]) + if not self.options.use_external_zlib: + # https://github.com/microsoft/msix-packaging/blob/v1.7/src/msix/CMakeLists.txt#L285 + self.cpp_info.frameworks.append("Compression") diff --git a/recipes/msix/all/patches/1.7/001-fix-missing-include.patch b/recipes/msix/all/patches/1.7/001-fix-missing-include.patch new file mode 100644 index 0000000000000..60cdf07427a6c --- /dev/null +++ b/recipes/msix/all/patches/1.7/001-fix-missing-include.patch @@ -0,0 +1,11 @@ +Fixes https://github.com/microsoft/msix-packaging/issues/596 +--- src/inc/Encoding.hpp ++++ src/inc/Encoding.hpp +@@ -5,6 +5,7 @@ + #pragma once + ++#include + #include + + namespace MSIX { namespace Encoding { + diff --git a/recipes/msix/all/patches/1.7/cmake.patch b/recipes/msix/all/patches/1.7/cmake.patch index b64f3d1cd79c0..6f72f3b88aaf0 100644 --- a/recipes/msix/all/patches/1.7/cmake.patch +++ b/recipes/msix/all/patches/1.7/cmake.patch @@ -103,31 +103,29 @@ index 92b082e6..ebae9789 100644 +# define installing rules for target files +install(TARGETS ${PROJECT_NAME}) diff --git a/src/msix/CMakeLists.txt b/src/msix/CMakeLists.txt -index 75d3afdf..e1fb2984 100644 --- a/src/msix/CMakeLists.txt +++ b/src/msix/CMakeLists.txt -@@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR) +@@ -5,6 +5,11 @@ + cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR) project(msix) - ++ +# Define the library +add_library(${PROJECT_NAME} + msix.cpp +) -+ + # Handle exports and flags we need to set list(APPEND MSIX_UNPACK_EXPORTS - "UnpackPackage" -@@ -144,7 +149,7 @@ if(NOT SKIP_BUNDLES) - if (WIN32) +@@ -145,6 +150,7 @@ list(APPEND MsixSrc PAL/Applicability/Win32/Applicability.cpp) elseif(LINUX) -- find_package(ICU REQUIRED COMPONENTS uc) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::icu) + find_package(ICU REQUIRED COMPONENTS uc) ++ target_link_libraries(${PROJECT_NAME} PRIVATE ICU::uc) list(APPEND MsixSrc PAL/Applicability/Linux/Applicability.cpp) elseif(AOSP) list(APPEND MsixSrc PAL/Applicability/AOSP/Applicability.cpp) -@@ -195,14 +200,16 @@ if(CRYPTO_LIB MATCHES crypt32) +@@ -195,14 +201,17 @@ PAL/Signature/Win32/SignatureValidator.cpp ) elseif(CRYPTO_LIB MATCHES openssl) @@ -136,22 +134,23 @@ index 75d3afdf..e1fb2984 100644 - PAL/Crypto/OpenSSL/Crypto.cpp - PAL/Signature/OpenSSL/SignatureValidator.cpp - ) ++ find_package(OpenSSL REQUIRED CONFIG) + list(APPEND MsixSrc + PAL/Crypto/OpenSSL/Crypto.cpp + PAL/Signature/OpenSSL/SignatureValidator.cpp + ) + if((IOS) OR (MACOS)) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl -Wl,-dead_strip) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL -Wl,-dead_strip) + elseif(NOT MSVC) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl -Wl,--gc-sections) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL -Wl,--gc-sections) else() - # ... and were done here... :/ - message(FATAL_ERROR "OpenSSL NOT FOUND!") -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::openssl) ++ target_link_libraries(${PROJECT_NAME} PRIVATE OpenSSL::SSL) endif() endif() -@@ -220,14 +227,7 @@ foreach(FILE ${MsixSrc}) +@@ -220,14 +229,7 @@ message(STATUS "\t${FILE}") endforeach() @@ -167,7 +166,7 @@ index 75d3afdf..e1fb2984 100644 # Copy out public headers to /src/unpack configure_file(../inc/MSIXWindows.hpp ${CMAKE_CURRENT_BINARY_DIR}/MSIXWindows.hpp ) -@@ -260,7 +260,7 @@ if(WIN32) +@@ -260,7 +262,7 @@ "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll") string(REPLACE ";" " " DELAYFLAGS "${DELAYFLAGS}") set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS "${DELAYFLAGS} /LTCG") @@ -176,48 +175,44 @@ index 75d3afdf..e1fb2984 100644 if(USE_STATIC_MSVC) if(CMAKE_BUILD_TYPE MATCHES Debug) set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS " /NODEFAULTLIB:MSVCRTD") -@@ -285,29 +285,20 @@ if(((IOS) OR (MACOS)) AND (NOT USE_MSIX_SDK_ZLIB)) - target_link_libraries(${PROJECT_NAME} PRIVATE libcompression.dylib) - elseif((AOSP) AND (NOT USE_MSIX_SDK_ZLIB)) - # for AOSP, use the libz.so from the android ndk. -- find_package(ZLIB REQUIRED) +@@ -288,17 +290,8 @@ + find_package(ZLIB REQUIRED) target_link_libraries(${PROJECT_NAME} PRIVATE -lz) --else() # WIN32 or USE_MSIX_SDK_ZLIB + else() # WIN32 or USE_MSIX_SDK_ZLIB - target_include_directories(${PROJECT_NAME} PRIVATE - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/zlib - ${MSIX_PROJECT_ROOT}/lib/zlib - ) -+else() - if(USE_SHARED_ZLIB) - message(STATUS "MSIX takes a dynamic dependency on zlib") +- if(USE_SHARED_ZLIB) +- message(STATUS "MSIX takes a dynamic dependency on zlib") - target_link_libraries(${PROJECT_NAME} PRIVATE zlib) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::zlib) - else() - message(STATUS "MSIX takes a static dependency on zlib") +- else() +- message(STATUS "MSIX takes a static dependency on zlib") - target_link_libraries(${PROJECT_NAME} PRIVATE zlibstatic) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::zlib) - endif() +- endif() ++ find_package(ZLIB REQUIRED CONFIG) ++ target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) endif() # Parser - if(XML_PARSER MATCHES xerces) -- target_include_directories(${PROJECT_NAME} PRIVATE -- ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/xerces/src -- ${MSIX_PROJECT_ROOT}/lib/xerces/src -- ) +@@ -307,7 +299,8 @@ + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/xerces/src + ${MSIX_PROJECT_ROOT}/lib/xerces/src + ) - target_link_libraries(${PROJECT_NAME} PRIVATE xerces-c) -+ target_link_libraries(${PROJECT_NAME} PRIVATE CONAN_PKG::xerces-c) ++ find_package(XercesC REQUIRED CONFIG) ++ target_link_libraries(${PROJECT_NAME} PRIVATE XercesC::XercesC) endif() if(XML_PARSER MATCHES applexml) -@@ -363,18 +354,6 @@ endif() +@@ -363,18 +356,6 @@ if((IOS) OR (MACOS)) target_link_libraries(${PROJECT_NAME} PRIVATE ${COREFOUNDATION_LIBRARY} ${FOUNDATION_LIBRARY}) endif() -if(LINUX) - target_link_libraries(${PROJECT_NAME} PRIVATE ${ICU_LIBRARIES}) -endif() - +- -if(OpenSSL_FOUND) - # include the libraries needed to use OpenSSL - target_include_directories(${PROJECT_NAME} PRIVATE ${OpenSSL_INCLUDE_PATH}) @@ -229,5 +224,6 @@ index 75d3afdf..e1fb2984 100644 - target_link_libraries(${PROJECT_NAME} PRIVATE crypto) - endif() -endif() ++ +# define installing rules for target files +install(TARGETS ${PROJECT_NAME}) diff --git a/recipes/msix/all/patches/1.7/signaturevalidator.patch b/recipes/msix/all/patches/1.7/signaturevalidator.patch index bc8cdf9e699db..06071e85ee658 100644 --- a/recipes/msix/all/patches/1.7/signaturevalidator.patch +++ b/recipes/msix/all/patches/1.7/signaturevalidator.patch @@ -22,7 +22,7 @@ index 1cc34b20..ccbf68dc 100644 if (!X509V3_EXT_print(extbio.get(), ext, 0, 0)) { - M_ASN1_OCTET_STRING_print(extbio.get(), ext->value); -+ M_ASN1_OCTET_STRING_print(extbio.get(), X509_EXTENSION_get_data(ext)); ++ ASN1_STRING_print(extbio.get(), X509_EXTENSION_get_data(ext)); } // null terminate the string. BIO_write(extbio.get(), "", 1); diff --git a/recipes/msix/all/test_package/CMakeLists.txt b/recipes/msix/all/test_package/CMakeLists.txt index e28b2e2b66dd9..5ad357dd7587a 100644 --- a/recipes/msix/all/test_package/CMakeLists.txt +++ b/recipes/msix/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(msix REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) - -conan_target_link_libraries(${PROJECT_NAME}) +target_link_libraries(${PROJECT_NAME} PRIVATE msix::msix) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/msix/all/test_package/conanfile.py b/recipes/msix/all/test_package/conanfile.py index bee328a3e1aa7..ef5d7042163ec 100644 --- a/recipes/msix/all/test_package/conanfile.py +++ b/recipes/msix/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 MsixTestConan(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", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/msys2/all/conanfile.py b/recipes/msys2/all/conanfile.py index 2606f171ddcec..04fdeafc0e496 100644 --- a/recipes/msys2/all/conanfile.py +++ b/recipes/msys2/all/conanfile.py @@ -142,7 +142,9 @@ def _do_build(self): for package in packages: self.run(f'bash -l -c "pacman -S {package} --noconfirm"') for package in ['pkgconf']: - self.run(f'bash -l -c "pacman -Rs -d -d $(pacman -Qsq {package}) --noconfirm"') + if self.run(f'bash -l -c "pacman -Qq {package}"', ignore_errors=True, quiet=True) == 0: + self.run(f'bash -l -c "pacman -Rs -d -d {package} --noconfirm"') + self.run(f'bash -l -c "pacman -Scc --noconfirm"') self._kill_pacman() @@ -156,8 +158,9 @@ def _do_build(self): os.utime(tmp_name, None) # Prepend the PKG_CONFIG_PATH environment variable with an eventual PKG_CONFIG_PATH environment variable + # Note: this is no longer needed when we exclusively support Conan 2 integrations replace_in_file(self, os.path.join(self._msys_dir, "etc", "profile"), - 'PKG_CONFIG_PATH="', 'PKG_CONFIG_PATH="$PKG_CONFIG_PATH:') + 'PKG_CONFIG_PATH="', 'PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}') def package(self): excludes = None 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/mtfmt/all/conandata.yml b/recipes/mtfmt/all/conandata.yml new file mode 100644 index 0000000000000..479a84d9ef5a9 --- /dev/null +++ b/recipes/mtfmt/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + # Newer versions at the top + "0.1.3": + url: "https://github.com/MtFmT-Lib/mtfmt/archive/refs/tags/v0.1.3.tar.gz" + sha256: "767a9b85b79d915ce7f1e43f0d24dc14942c07af24d6e96f7ff60ee522f1c1ce" +patches: + "0.1.3": + - patch_file: "patches/0.1.3-0001-remove-hardcoded-stds.patch" + patch_description: "Remove hardcoded C/CXX standards" + patch_type: "conan" diff --git a/recipes/mtfmt/all/conanfile.py b/recipes/mtfmt/all/conanfile.py new file mode 100644 index 0000000000000..7f72f34a57527 --- /dev/null +++ b/recipes/mtfmt/all/conanfile.py @@ -0,0 +1,111 @@ +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, rm, rmdir +from conan.tools.microsoft import is_msvc +import os + + +required_conan_version = ">=1.53.0" + + +class MtFmtConan(ConanFile): + name = "mtfmt" + description = "mtfmt (Mini template formatter) is a formatting library designed for embedded systems" + license = "LGPL-3.0-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/MtFmT-Lib/mtfmt" + topics = ("formatting", "embedded") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_div": [True, False], + "use_malloc": [True, False], + "use_stdout": [True, False], + "use_assert": [True, False], + "use_utf8": [True, False], + "use_fp32": [True, False], + "use_fp64": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "use_div": False, + "use_malloc": False, + "use_stdout": False, + "use_assert": False, + "use_utf8": True, + "use_fp32": False, + "use_fp64": False, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + # Windows always builds as release, debug is not supported + if is_msvc(self) and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC debug builds") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["MTFMT_BUILD_SHARED"] = self.options.shared + tc.cache_variables["MTFMT_RT_USE_DIV"] = self.options.use_div + tc.cache_variables["MTFMT_RT_USE_MALLOC"] = self.options.use_malloc + tc.cache_variables["MTFMT_RT_USE_STDOUT"] = self.options.use_stdout + tc.cache_variables["MTFMT_RT_USE_ASSERT"] = self.options.use_assert + tc.cache_variables["MTFMT_RT_USE_UTF8"] = self.options.use_utf8 + tc.cache_variables["MTFMT_RT_USE_FP32"] = self.options.use_fp32 + tc.cache_variables["MTFMT_RT_USE_FP64"] = self.options.use_fp64 + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "mtfmt", "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "mtfmt", "share")) + rm(self, "*.la", os.path.join(self.package_folder, "mtfmt", "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "mtfmt", "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "mtfmt", "bin")) + + def package_info(self): + suffix = "_d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["mtfmt" + suffix] + + libdir = os.path.join("mtfmt", "lib") + + if not self.options.shared or self.settings.os == "Windows": + libdir = os.path.join(libdir, "static") + + self.cpp_info.libdirs = [libdir] + self.cpp_info.includedirs = [os.path.join("mtfmt", "include")] + self.cpp_info.bindirs = [os.path.join("mtfmt", "bin")] diff --git a/recipes/mtfmt/all/patches/0.1.3-0001-remove-hardcoded-stds.patch b/recipes/mtfmt/all/patches/0.1.3-0001-remove-hardcoded-stds.patch new file mode 100644 index 0000000000000..272d9f3d83b9f --- /dev/null +++ b/recipes/mtfmt/all/patches/0.1.3-0001-remove-hardcoded-stds.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2d4ffcd..293cf7e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.10) + + project(mtfmt) + +-set(CMAKE_C_STANDARD 11) +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_C_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + # debug版的åŽç¼€ + set(CMAKE_DEBUG_POSTFIX "_d") +@@ -50,6 +50,11 @@ endif() + # including path + target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc") + ++# Standards ++target_compile_features(${TARGET_NAME} PRIVATE cxx_std_11) ++target_compile_features(${TARGET_NAME} PRIVATE c_std_11) ++ ++ + # debug? + if(NOT MSVC) + if(NOT CMAKE_BUILD_TYPE) diff --git a/recipes/mtfmt/all/test_package/CMakeLists.txt b/recipes/mtfmt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..db0d350d8ebe1 --- /dev/null +++ b/recipes/mtfmt/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES C) + +find_package(mtfmt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE mtfmt::mtfmt) diff --git a/recipes/mtfmt/all/test_package/conanfile.py b/recipes/mtfmt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/mtfmt/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/mtfmt/all/test_package/test_package.c b/recipes/mtfmt/all/test_package/test_package.c new file mode 100644 index 0000000000000..29545fce88b63 --- /dev/null +++ b/recipes/mtfmt/all/test_package/test_package.c @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: LGPL-3.0 +/** + * @file example_build_config.c + * @author å‘阳 (hinata.hoshino@foxmail.com) + * @brief ä¸åŒå¯¹é½æ–¹å¼ä¸‹çš„æ ¼å¼åŒ–çš„ä¾‹å­ + * @version 1.0 + * @date 2023-07-23 + * + * @copyright Copyright (c) å‘阳, all rights reserved. + * + */ +#include "mtfmt.h" +#include +#include + +/** + * @brief 测试1ä¸ªä½æ˜¯å¦è¢«set + * + */ +#define BIT_TEST(v, b) (!!(((v) & (b)) == (b))) + +/** + * @brief 把booleanå˜æˆC字符串 + * + */ +#define BOOL2STR(b) ((b) ? "true" : "false") + +int main(void) +{ + uint32_t cfg = MSTR_CONFIGURE_CFG_VAL(mstr_configure()); + uint32_t compiler = MSTR_CONFIGURE_CC_VAL(cfg); + + puts("+-----------+--------------------------+-------+"); + + const char* compiler_name = "unknown"; + switch (compiler) { + case MSTR_BUILD_CC_MSVC: compiler_name = "msvc"; break; + case MSTR_BUILD_CC_GNUC: compiler_name = "gcc"; break; + case MSTR_BUILD_CC_ARMCC: compiler_name = "armcc"; break; + case MSTR_BUILD_CC_ARMCLANG: compiler_name = "armclang"; break; + case MSTR_BUILD_CC_EMSCRIPTEN: compiler_name = "emscripten"; break; + case MSTR_BUILD_CC_OTHER: compiler_name = "unknown"; break; + } + printf("| Compiler | %-24s | --- |\n", compiler_name); + + puts("+-----------+--------------------------+-------+"); + + printf( + "| Configure | %-24s | %5s |\n", + "_MSTR_USE_MALLOC", + BOOL2STR(BIT_TEST(cfg, MSTRCFG_USE_MALLOC_BIT)) + ); + printf( + "| | %-24s | %5s |\n", + "_MSTR_BUILD_DLL", + BOOL2STR(BIT_TEST(cfg, MSTRCFG_BUILD_DLL_BIT)) + ); + printf( + "| | %-24s | %5s |\n", + "_MSTR_USE_HARDWARE_DIV", + BOOL2STR(BIT_TEST(cfg, MSTRCFG_BUILD_HARDWARE_DIV)) + ); + printf( + "| | %-24s | %5s |\n", + "_MSTR_USE_STD_IO", + BOOL2STR(BIT_TEST(cfg, MSTRCFG_USE_STD_IO)) + ); + printf( + "| | %-24s | %5s |\n", + "_MSTR_USE_UTF_8", + BOOL2STR(BIT_TEST(cfg, MSTRCFG_USE_UTF_8)) + ); + printf( + "| | %-24s | %5s |\n", + "_MSTR_USE_CPP_EXCEPTION", + BOOL2STR(BIT_TEST(cfg, MSTRCFG_USE_CXX_EXCEPTION)) + ); + printf( + "| | %-24s | %5s |\n", + "_MSTR_USE_FP_FLOAT32", + BOOL2STR(BIT_TEST(cfg, MSTRCFG_USE_FLOAT32)) + ); + printf( + "| | %-24s | %5s |\n", + "_MSTR_USE_FP_FLOAT64", + BOOL2STR(BIT_TEST(cfg, MSTRCFG_USE_FLOAT64)) + ); + printf( + "| | %-24s | %5s |\n", + "_MSTR_USE_ALLOC", + BOOL2STR(BIT_TEST(cfg, MSTRCFG_USE_ALLOCATOR)) + ); + + puts("+-----------+--------------------------+-------+"); + + return 0; +} diff --git a/recipes/mtfmt/config.yml b/recipes/mtfmt/config.yml new file mode 100644 index 0000000000000..b7f57204004e4 --- /dev/null +++ b/recipes/mtfmt/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.3": + folder: all diff --git a/recipes/mujs/all/CMakeLists.txt b/recipes/mujs/all/CMakeLists.txt index 8ee1eff93fdb3..a3a96fc8ad04d 100644 --- a/recipes/mujs/all/CMakeLists.txt +++ b/recipes/mujs/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(mujs LANGUAGES C) file(GLOB MUJS_SRC ${MUJS_SRC_DIR}/js*.c ${MUJS_SRC_DIR}/utf*.c ${MUJS_SRC_DIR}/regexp.c) diff --git a/recipes/mujs/all/conandata.yml b/recipes/mujs/all/conandata.yml index 8b8c95eb04cf4..eb2092fbfdd74 100644 --- a/recipes/mujs/all/conandata.yml +++ b/recipes/mujs/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.3.5": + url: "https://mujs.com/downloads/mujs-1.3.5.tar.gz" + sha256: "78a311ae4224400774cb09ef5baa2633c26971513f8b931d3224a0eb85b13e0b" + "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/all/conanfile.py b/recipes/mujs/all/conanfile.py index 4d4b59f453109..9a9dbc2ba3805 100644 --- a/recipes/mujs/all/conanfile.py +++ b/recipes/mujs/all/conanfile.py @@ -11,10 +11,9 @@ class MujsConan(ConanFile): description = "MuJS is a lightweight Javascript interpreter designed for " \ "embedding in other software to extend them with scripting capabilities." license = "ISC" - topics = ("interpreter", "javascript") - homepage = "https://mujs.com" url = "https://github.com/conan-io/conan-center-index" - + homepage = "https://mujs.com" + topics = ("interpreter", "javascript") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { diff --git a/recipes/mujs/all/test_package/CMakeLists.txt b/recipes/mujs/all/test_package/CMakeLists.txt index d5111bdead218..7a366f353edbd 100644 --- a/recipes/mujs/all/test_package/CMakeLists.txt +++ b/recipes/mujs/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(mujs REQUIRED CONFIG) diff --git a/recipes/mujs/all/test_v1_package/CMakeLists.txt b/recipes/mujs/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/mujs/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/mujs/all/test_v1_package/conanfile.py b/recipes/mujs/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/mujs/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_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/mujs/config.yml b/recipes/mujs/config.yml index 8d13aefb6b4fb..233cb2080473e 100644 --- a/recipes/mujs/config.yml +++ b/recipes/mujs/config.yml @@ -1,3 +1,7 @@ versions: + "1.3.5": + folder: all + "1.3.4": + folder: all "1.1.2": folder: all diff --git a/recipes/muparser/all/conandata.yml b/recipes/muparser/all/conandata.yml index cd86d2cd3c232..15ea22a6b7c28 100644 --- a/recipes/muparser/all/conandata.yml +++ b/recipes/muparser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.5": + url: "https://github.com/beltoforion/muparser/archive/refs/tags/v2.3.5.tar.gz" + sha256: "20b43cc68c655665db83711906f01b20c51909368973116dfc8d7b3c4ddb5dd4" "2.3.4": url: "https://github.com/beltoforion/muparser/archive/refs/tags/v2.3.4.tar.gz" sha256: "0c3fa54a3ebf36dda0ed3e7cd5451c964afbb15102bdbcba08aafb359a290121" diff --git a/recipes/muparser/all/test_package/CMakeLists.txt b/recipes/muparser/all/test_package/CMakeLists.txt index 9cc92e84977a5..04fecd9622c8a 100644 --- a/recipes/muparser/all/test_package/CMakeLists.txt +++ b/recipes/muparser/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(muparser CONFIG REQUIRED) diff --git a/recipes/muparser/all/test_v1_package/CMakeLists.txt b/recipes/muparser/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/muparser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/muparser/all/test_v1_package/conanfile.py b/recipes/muparser/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/muparser/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_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/muparser/config.yml b/recipes/muparser/config.yml index d7f66fca815a8..b455d82185de7 100644 --- a/recipes/muparser/config.yml +++ b/recipes/muparser/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.5": + folder: all "2.3.4": folder: all "2.3.2": diff --git a/recipes/muparserx/all/conandata.yml b/recipes/muparserx/all/conandata.yml index 9f14a4951a1b8..10adc43806fcb 100644 --- a/recipes/muparserx/all/conandata.yml +++ b/recipes/muparserx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.0.12": + url: "https://github.com/beltoforion/muparserx/archive/v4.0.12.tar.gz" + sha256: "941c79f9b8b924f2f22406af8587177b4b185da3c968dbe8dc371b9dbe117f6e" "4.0.8": url: "https://github.com/beltoforion/muparserx/archive/v4.0.8.tar.gz" sha256: "5913e0a4ca29a097baad1b78a4674963bc7a06e39ff63df3c73fbad6fadb34e1" diff --git a/recipes/muparserx/all/conanfile.py b/recipes/muparserx/all/conanfile.py index 565601842d1b8..47b396a95e944 100644 --- a/recipes/muparserx/all/conanfile.py +++ b/recipes/muparserx/all/conanfile.py @@ -1,9 +1,11 @@ from conan import ConanFile +from conan.tools.build import check_max_cppstd from conan.tools.cmake import CMake, 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" +required_conan_version = ">=2.1" class MuparserxConan(ConanFile): @@ -11,9 +13,10 @@ class MuparserxConan(ConanFile): description = "A C++ Library for Parsing Expressions with Strings, Complex Numbers, Vectors, Matrices and more" license = "BSD-2-Clause" topics = ("math", "parser") - homepage = "https://beltoforion.de/article.php?a=muparserx" + homepage = "https://beltoforion.de/en/muparserx" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -35,9 +38,13 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + if Version(self.version) < "4.0.12": + # std::binary_function used in previous versions was removed in C++17 + 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) @@ -46,6 +53,8 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True # Relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) <= "4.0.12": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def _patch_sources(self): @@ -62,7 +71,10 @@ def build(self): cmake.build() def package(self): - copy(self, "License.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) < "4.0.10": + copy(self, "License.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + else: + 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", "pkgconfig")) diff --git a/recipes/muparserx/all/test_package/CMakeLists.txt b/recipes/muparserx/all/test_package/CMakeLists.txt index 5e16107e1d831..3319a50bf9bdd 100644 --- a/recipes/muparserx/all/test_package/CMakeLists.txt +++ b/recipes/muparserx/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(muparserx REQUIRED CONFIG) diff --git a/recipes/muparserx/all/test_v1_package/CMakeLists.txt b/recipes/muparserx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/muparserx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/muparserx/all/test_v1_package/conanfile.py b/recipes/muparserx/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/muparserx/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_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/muparserx/config.yml b/recipes/muparserx/config.yml index 5bcadc3524910..fe34cc95b4902 100644 --- a/recipes/muparserx/config.yml +++ b/recipes/muparserx/config.yml @@ -1,3 +1,5 @@ versions: + "4.0.12": + folder: all "4.0.8": folder: all diff --git a/recipes/mysql-connector-c/all/test_package/CMakeLists.txt b/recipes/mysql-connector-c/all/test_package/CMakeLists.txt index af5ced10013a7..9b45bda8ec230 100644 --- a/recipes/mysql-connector-c/all/test_package/CMakeLists.txt +++ b/recipes/mysql-connector-c/all/test_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/mysql-connector-cpp/all/conan_project_include.cmake b/recipes/mysql-connector-cpp/all/conan_project_include.cmake new file mode 100644 index 0000000000000..f4b5bedeef30a --- /dev/null +++ b/recipes/mysql-connector-cpp/all/conan_project_include.cmake @@ -0,0 +1,22 @@ +# Pre-find all dependencies, to prevent having to patch `find_dependency` +# which is included by Conan-generated CMake files, but also re-defined by the project itself + +find_package(ZLIB REQUIRED CONFIG) +find_package(LZ4 REQUIRED CONFIG) +find_package(Zstd REQUIRED CONFIG) + +find_package(RapidJSON REQUIRED CONFIG) +find_package(OpenSSL REQUIRED) + +find_package(Protobuf REQUIRED CONFIG) +add_executable(ext::protoc ALIAS protobuf::protoc) +add_library(ext::protobuf-lite ALIAS protobuf::protobuf) + + +# This project will try combine all static libraries (and external dependencies) +# into a single library - mark all libraries from this project to limit +# the libraries that are combined +set(_CONAN_CMAKE_STATIC_LIBRARY_PREFIX_ORIG "${CMAKE_STATIC_LIBRARY_PREFIX}") +set(CMAKE_STATIC_LIBRARY_PREFIX "${CMAKE_STATIC_LIBRARY_PREFIX}_concpp_internal") + + diff --git a/recipes/mysql-connector-cpp/all/conandata.yml b/recipes/mysql-connector-cpp/all/conandata.yml new file mode 100644 index 0000000000000..2e13fd8dca27a --- /dev/null +++ b/recipes/mysql-connector-cpp/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "9.2.0": + url: "https://github.com/mysql/mysql-connector-cpp/archive/refs/tags/9.2.0.tar.gz" + sha256: "0b811559e57868487cfa7fa04af7f71d9df16cf6f7200bce83c5ddbeeedfb97c" +patches: + "9.2.0": + - patch_file: "patches/9.2.0-01-handle-protobuf-logic.patch" + patch_description: "Handle protobuf logic" + patch_type: "conan" + - patch_file: "patches/9.2.0-02-dont-embed-transitive-deps.patch" + patch_description: "Avoid embedding transitive deps" + patch_type: "conan" diff --git a/recipes/mysql-connector-cpp/all/conanfile.py b/recipes/mysql-connector-cpp/all/conanfile.py new file mode 100644 index 0000000000000..70f5fe4c4876d --- /dev/null +++ b/recipes/mysql-connector-cpp/all/conanfile.py @@ -0,0 +1,134 @@ +import os + +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 get, copy, rm, export_conandata_patches, apply_conandata_patches, replace_in_file +from conan.tools.microsoft import is_msvc_static_runtime + +required_conan_version = ">=2.0.9" + +class MysqlConnectorCppConan(ConanFile): + name = "mysql-connector-cpp" + description = "MySQL database connector for C++ applications" + license = "GPL-2.0-only WITH Universal-FOSS-exception-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://dev.mysql.com/doc/connector-cpp/en/" + topics = ("mysql", "sql", "connector", "database") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + def export_sources(self): + copy(self, "conan_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # None of the dependencies are used transitively + self.requires("protobuf/3.21.12") # v4 and newer are not supported as of v9.0.0 + self.requires("openssl/[>=1.1 <4]") + self.requires("rapidjson/1.1.0") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("lz4/1.9.4") + self.requires("zstd/[~1.5]") + + def validate(self): + check_min_cppstd(self, 17) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.24 <4]") + self.tool_requires("protobuf/") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._patch_sources() + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_PROJECT_MySQL_CONCPP_INCLUDE"] = os.path.join(self.source_folder, "conan_project_include.cmake") + tc.cache_variables["BUNDLE_DEPENDENCIES"] = False + tc.cache_variables["BUILD_STATIC"] = not self.options.shared + tc.cache_variables["STATIC_MSVCRT"] = is_msvc_static_runtime(self) + tc.cache_variables["WITH_TESTS"] = False + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.cache_variables["WITH_SSL"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + tc.cache_variables["CMAKE_PREFIX_PATH"] = self.generators_folder.replace("\\", "/") + tc.cache_variables["IS64BIT"] = True + tc.cache_variables["use_full_protobuf"] = not self.dependencies["protobuf"].options.lite + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("protobuf::libprotobuf", "cmake_target_name", "ext::protobuf") + deps.set_property("protobuf::libprotobuf-lite", "cmake_target_name", "ext::protobuf-lite") + deps.set_property("rapidjson", "cmake_target_name", "RapidJSON::rapidjson") + deps.set_property("zlib", "cmake_target_name", "ext::z") + deps.set_property("lz4", "cmake_target_name", "ext::lz4") + deps.set_property("zstd", "cmake_target_name", "ext::zstd") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Disable boostrap(), which is unnecessary and fragile with variables set by Conan + # https://github.com/mysql/mysql-connector-cpp/blob/9.0.0/CMakeLists.txt#L69-L71 + # https://github.com/mysql/mysql-connector-cpp/blob/9.0.0/cdk/cmake/bootstrap.cmake#L55 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "bootstrap()", "") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "INFO_SRC", self.package_folder) + rm(self, "INFO_BIN", self.package_folder) + rm(self, "*.cmake", self.package_folder) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "mysql-concpp") + self.cpp_info.set_property("cmake_target_name", "mysql::concpp") + + aliases = ["mysql::concpp-xdevapi"] + if not self.options.shared: + aliases.append("mysql::concpp-static") + aliases.append("mysql::concpp-xdevapi-static") + if self.settings.build_type == "Debug": + aliases.append("mysql::concpp-static-debug") + aliases.append("mysql::concpp-xdevapi-static-debug") + aliases.append("mysql::openssl") + self.cpp_info.set_property("cmake_target_aliases", aliases) + + lib = "mysqlcppconnx" + if not self.options.shared: + lib += "-static" + if is_msvc_static_runtime(self): + lib += "-mt" + self.cpp_info.libs = [lib] + + if self.settings.os == "Windows": + self.cpp_info.libdirs = [os.path.join("lib", "vs14")] + self.cpp_info.bindirs = ["lib"] + self.cpp_info.system_libs.extend(["dnsapi", "ws2_32"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) + if self.settings.os == "SunOS": + self.cpp_info.system_libs.append(["socket", "nsl"]) + if self.settings.os not in ["Windows", "FreeBSD"]: + self.cpp_info.system_libs.append("resolv") + + if not self.options.shared: + self.cpp_info.defines = ["MYSQL_STATIC", "STATIC_CONCPP"] diff --git a/recipes/mysql-connector-cpp/all/patches/9.2.0-01-handle-protobuf-logic.patch b/recipes/mysql-connector-cpp/all/patches/9.2.0-01-handle-protobuf-logic.patch new file mode 100644 index 0000000000000..4436da2505304 --- /dev/null +++ b/recipes/mysql-connector-cpp/all/patches/9.2.0-01-handle-protobuf-logic.patch @@ -0,0 +1,25 @@ +diff --git a/cdk/cmake/DepFindProtobuf.cmake b/cdk/cmake/DepFindProtobuf.cmake +index 1fc785e..41d1405 100644 +--- a/cdk/cmake/DepFindProtobuf.cmake ++++ b/cdk/cmake/DepFindProtobuf.cmake +@@ -44,6 +44,7 @@ + # + # + ++if(0) + if(TARGET ext::protobuf) + return() + endif() +@@ -64,6 +65,11 @@ add_ext_targets(protobuf + LIBRARY protobuf pb_libprotobuf + EXECUTABLE protoc pb_protoc + ) ++endif() ++ ++if (COMMAND mysqlx_protobuf_generate_cpp) ++ return() ++endif() + + + # Standard PROTOBUF_GENERATE_CPP modified to our usage + diff --git a/recipes/mysql-connector-cpp/all/patches/9.2.0-02-dont-embed-transitive-deps.patch b/recipes/mysql-connector-cpp/all/patches/9.2.0-02-dont-embed-transitive-deps.patch new file mode 100644 index 0000000000000..d2bea28d9cfa4 --- /dev/null +++ b/recipes/mysql-connector-cpp/all/patches/9.2.0-02-dont-embed-transitive-deps.patch @@ -0,0 +1,41 @@ +diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake +index 848b7cf..cb748e6 100644 +--- a/cmake/libutils.cmake ++++ b/cmake/libutils.cmake +@@ -164,6 +164,9 @@ function(merge_libraries TARGET) + set_property(SOURCE "${LIBUTILS_SCRIPT_DIR}/empty.cc" PROPERTY LANGUAGE CXX) + + add_library(${TARGET} ${TYPE} "${LIBUTILS_SCRIPT_DIR}/empty.cc") ++ if(BUILD_STATIC AND DEFINED _CONAN_CMAKE_STATIC_LIBRARY_PREFIX_ORIG) ++ set_target_properties(${TARGET} PROPERTIES PREFIX "${_CONAN_CMAKE_STATIC_LIBRARY_PREFIX_ORIG}") ++ endif() + target_link_libraries(${TARGET} PRIVATE ${ARGN}) + + # +@@ -278,7 +281,8 @@ function(merge_libraries TARGET) + # + + foreach(lib ${ARGN}) +- if(CLANG) ++ if(1) ++ message("Will link target ${lib} into shared library with /wholearchive option") + target_link_options(${TARGET} PRIVATE /wholearchive:$) + else() + target_link_options(${TARGET} PRIVATE /wholearchive:${lib}) +diff --git a/cmake/libutils/merge_archives.cmake.in b/cmake/libutils/merge_archives.cmake.in +index 33094a6..506705a 100644 +--- a/cmake/libutils/merge_archives.cmake.in ++++ b/cmake/libutils/merge_archives.cmake.in +@@ -570,9 +570,9 @@ function(process_deps) + AND NOT lib MATCHES "${NAME}${libext}$" + AND EXISTS "${libpath}" + ) +- if(lib MATCHES "protobuf|uuid_gen|libssl|libcrypto|mysqlclient") ++ if(0) + list(APPEND LIBS1 "${lib}") +- else() ++ elseif(lib MATCHES concpp_internal) + list(APPEND LIBS "${lib}") + endif() + endif() + diff --git a/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt b/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b46c3cde8da16 --- /dev/null +++ b/recipes/mysql-connector-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(mysql-concpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE mysql::concpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/mysql-connector-cpp/all/test_package/conanfile.py b/recipes/mysql-connector-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..dd09e74d7fe14 --- /dev/null +++ b/recipes/mysql-connector-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, 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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mysql-connector-cpp/all/test_package/test_package.cpp b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b10e6717030e9 --- /dev/null +++ b/recipes/mysql-connector-cpp/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + mysqlx::SessionSettings from_url("mysqlx://user:pwd@127.0.0.1:1234/db?ssl-mode=required"); + return 0; +} diff --git a/recipes/mysql-connector-cpp/config.yml b/recipes/mysql-connector-cpp/config.yml new file mode 100644 index 0000000000000..975ab3a4fabaa --- /dev/null +++ b/recipes/mysql-connector-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "9.2.0": + folder: all diff --git a/recipes/naive-tsearch/all/test_package/CMakeLists.txt b/recipes/naive-tsearch/all/test_package/CMakeLists.txt index 23cf15ed79338..068f6ba92620b 100644 --- a/recipes/naive-tsearch/all/test_package/CMakeLists.txt +++ b/recipes/naive-tsearch/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(naive-tsearch REQUIRED CONFIG) diff --git a/recipes/naive-tsearch/all/test_v1_package/CMakeLists.txt b/recipes/naive-tsearch/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/naive-tsearch/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/naive-tsearch/all/test_v1_package/conanfile.py b/recipes/naive-tsearch/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/naive-tsearch/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/namedtype/all/test_package/CMakeLists.txt b/recipes/namedtype/all/test_package/CMakeLists.txt index c88bbff306fb5..b8dc1b6661459 100644 --- a/recipes/namedtype/all/test_package/CMakeLists.txt +++ b/recipes/namedtype/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(namedtype REQUIRED CONFIG) diff --git a/recipes/namedtype/all/test_v1_package/CMakeLists.txt b/recipes/namedtype/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/namedtype/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/namedtype/all/test_v1_package/conanfile.py b/recipes/namedtype/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/namedtype/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/nameof/all/conandata.yml b/recipes/nameof/all/conandata.yml index a47ecd560d7e3..53cdec57f34dc 100644 --- a/recipes/nameof/all/conandata.yml +++ b/recipes/nameof/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.10.4": + url: "https://github.com/Neargye/nameof/archive/v0.10.4.tar.gz" + sha256: "b67ed2155a32760067eee0d33c727b9badfd8c12393ebbe3b7ab219b4faa0149" "0.10.3": url: "https://github.com/Neargye/nameof/archive/v0.10.3.tar.gz" sha256: "f31dd02841adfbb98949454005a308174645957d2b8d4dc06a7c15e1039e46e6" diff --git a/recipes/nameof/all/test_package/CMakeLists.txt b/recipes/nameof/all/test_package/CMakeLists.txt index 0e0eb7cf71e17..a6db66e0b671a 100644 --- a/recipes/nameof/all/test_package/CMakeLists.txt +++ b/recipes/nameof/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(nameof REQUIRED CONFIG) diff --git a/recipes/nameof/all/test_v1_package/CMakeLists.txt b/recipes/nameof/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/nameof/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nameof/all/test_v1_package/conanfile.py b/recipes/nameof/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/nameof/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/nameof/config.yml b/recipes/nameof/config.yml index 9af7662bde26f..480d6a637aced 100644 --- a/recipes/nameof/config.yml +++ b/recipes/nameof/config.yml @@ -1,4 +1,6 @@ versions: + "0.10.4": + folder: "all" "0.10.3": folder: "all" "0.10.2": diff --git a/recipes/nanobench/all/test_package/CMakeLists.txt b/recipes/nanobench/all/test_package/CMakeLists.txt index 39d04ec4c7104..10e318ac0895b 100644 --- a/recipes/nanobench/all/test_package/CMakeLists.txt +++ b/recipes/nanobench/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(nanobench REQUIRED CONFIG) diff --git a/recipes/nanobench/all/test_v1_package/CMakeLists.txt b/recipes/nanobench/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/nanobench/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nanobench/all/test_v1_package/conanfile.py b/recipes/nanobench/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/nanobench/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/nanoflann/all/conandata.yml b/recipes/nanoflann/all/conandata.yml index f8c576a4749fe..9d51335bc5f52 100644 --- a/recipes/nanoflann/all/conandata.yml +++ b/recipes/nanoflann/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.0": + url: "https://github.com/jlblancoc/nanoflann/archive/v1.6.0.tar.gz" + sha256: "f889026fbcb241e1e9d71bab5dfb9cc35775bf18a6466a283e2cbcd60edb2705" "1.5.2": url: "https://github.com/jlblancoc/nanoflann/archive/v1.5.2.tar.gz" sha256: "2adcea7821445119a7a4f83c27abd56dba963e1e9c05a3f58bdb2273ae1b4698" diff --git a/recipes/nanoflann/all/conanfile.py b/recipes/nanoflann/all/conanfile.py index 47bfe18256ddd..90669ce351aaf 100644 --- a/recipes/nanoflann/all/conanfile.py +++ b/recipes/nanoflann/all/conanfile.py @@ -9,10 +9,9 @@ class NanoflannConan(ConanFile): name = "nanoflann" - description = """nanoflann is a C++11 header-only library for building KD-Trees - of datasets with different topologies: R2, R3 (point clouds), - SO(2) and SO(3) (2D and 3D rotation groups). - """ + description = ("nanoflann is a C++11 header-only library for building KD-Trees" + " of datasets with different topologies: R2, R3 (point clouds)," + " SO(2) and SO(3) (2D and 3D rotation groups).") topics = ("flann", "nearest-neighbor", "kd-trees") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jlblancoc/nanoflann" @@ -48,3 +47,6 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", "nanoflann") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + if self.settings.os in ("Linux", "FreeBSD"): + # If we ever support NANOFLANN_NO_THREADS, there would be no need to add this if set + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/nanoflann/all/test_package/CMakeLists.txt b/recipes/nanoflann/all/test_package/CMakeLists.txt index f45dd0b28e293..23a38ac9bc430 100644 --- a/recipes/nanoflann/all/test_package/CMakeLists.txt +++ b/recipes/nanoflann/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(nanoflann REQUIRED CONFIG) diff --git a/recipes/nanoflann/all/test_v1_package/CMakeLists.txt b/recipes/nanoflann/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8e9967d816e1b..0000000000000 --- a/recipes/nanoflann/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(nanoflann REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nanoflann::nanoflann) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/nanoflann/all/test_v1_package/conanfile.py b/recipes/nanoflann/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/nanoflann/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_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/nanoflann/config.yml b/recipes/nanoflann/config.yml index 42431fc83ed1e..43ca2b954f0dc 100644 --- a/recipes/nanoflann/config.yml +++ b/recipes/nanoflann/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.0": + folder: "all" "1.5.2": folder: "all" "1.5.0": diff --git a/recipes/nanomsg/all/conandata.yml b/recipes/nanomsg/all/conandata.yml index 1d7161c198806..dbc431024b1fd 100644 --- a/recipes/nanomsg/all/conandata.yml +++ b/recipes/nanomsg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.1": + url: "https://github.com/nanomsg/nanomsg/archive/refs/tags/1.2.1.tar.gz" + sha256: "2e6c20dbfcd4882e133c819ac77501e9b323cb17ae5b3376702c4446261fbc23" "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 index 851ab78f2038e..e240874fce997 100644 --- a/recipes/nanomsg/all/conanfile.py +++ b/recipes/nanomsg/all/conanfile.py @@ -1,11 +1,13 @@ from conan import ConanFile +from conan.errors import ConanException 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 +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class NanomsgConan(ConanFile): name = "nanomsg" @@ -55,6 +57,9 @@ def generate(self): tc.variables["NN_ENABLE_DOC"] = False tc.variables["NN_TESTS"] = False tc.variables["NN_TOOLS"] = self.options.enable_tools + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.2.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() tc = CMakeDeps(self) tc.generate() @@ -96,7 +101,3 @@ def package_info(self): 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 index 5ea217a77048d..7f0965cca3d01 100644 --- a/recipes/nanomsg/all/test_package/CMakeLists.txt +++ b/recipes/nanomsg/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) - + find_package(nanomsg REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/nanomsg/config.yml b/recipes/nanomsg/config.yml index a0777b5aa931c..faec73d798c80 100644 --- a/recipes/nanomsg/config.yml +++ b/recipes/nanomsg/config.yml @@ -1,3 +1,5 @@ versions: + "1.2.1": + folder: all "1.2": folder: all diff --git a/recipes/nanorange/all/test_v1_package/CMakeLists.txt b/recipes/nanorange/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index cd41ac7f45757..0000000000000 --- a/recipes/nanorange/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package LANGUAGES CXX) # if the project uses 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/nanorange/all/test_v1_package/conanfile.py b/recipes/nanorange/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/nanorange/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/nanosvg/all/test_package/CMakeLists.txt b/recipes/nanosvg/all/test_package/CMakeLists.txt index 581e05411c02f..afc80415a3cc8 100644 --- a/recipes/nanosvg/all/test_package/CMakeLists.txt +++ b/recipes/nanosvg/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(nanosvg REQUIRED CONFIG) diff --git a/recipes/nanosvg/all/test_v1_package/CMakeLists.txt b/recipes/nanosvg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8f69e251c10a7..0000000000000 --- a/recipes/nanosvg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(nanosvg REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE nanosvg::nanosvg) diff --git a/recipes/nanosvg/all/test_v1_package/conanfile.py b/recipes/nanosvg/all/test_v1_package/conanfile.py deleted file mode 100644 index e5fed27a4959a..0000000000000 --- a/recipes/nanosvg/all/test_v1_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 = os.path.join("bin", "test_package") - svg_name = os.path.join(self.source_folder, os.pardir, "test_package", "nano.svg") - self.run(f"{bin_path} {svg_name}", run_environment=True) diff --git a/recipes/nas/all/test_package/CMakeLists.txt b/recipes/nas/all/test_package/CMakeLists.txt index 12f5de7a8d67c..c69bdce0561c2 100644 --- a/recipes/nas/all/test_package/CMakeLists.txt +++ b/recipes/nas/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(nas REQUIRED CONFIG) diff --git a/recipes/nas/all/test_v1_package/CMakeLists.txt b/recipes/nas/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/nas/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nas/all/test_v1_package/conanfile.py b/recipes/nas/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/nas/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/nasm/all/conandata.yml b/recipes/nasm/all/conandata.yml index c97415979c9f2..0f1c60c55d302 100644 --- a/recipes/nasm/all/conandata.yml +++ b/recipes/nasm/all/conandata.yml @@ -1,16 +1,16 @@ sources: + "2.16.01": + sha256: "c77745f4802375efeee2ec5c0ad6b7f037ea9c87c92b149a9637ff099f162558" + url: + - "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/nasm-2.16.01.tar.xz" + - "https://www.nasm.dev/pub/nasm/releasebuilds/2.16.01/nasm-2.16.01.tar.xz" "2.15.05": sha256: "3caf6729c1073bf96629b57cee31eeb54f4f8129b01902c73428836550b30a3f" - url: "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.xz" - "2.14": - sha256: "97c615dbf02ef80e4e2b6c385f7e28368d51efc214daa98e600ca4572500eec0" - url: "https://www.nasm.us/pub/nasm/releasebuilds/2.14/nasm-2.14.tar.xz" - "2.13.02": - sha256: "8ac3235f49a6838ff7a8d7ef7c19a4430d0deecc0c2d3e3e237b5e9f53291757" - url: "https://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.xz" - "2.13.01": - sha256: "aa0213008f0433ecbe07bb628506a5c4be8079be20fc3532a5031fd639db9a5e" - url: "https://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.xz" + url: + - "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.xz" + - "https://www.nasm.dev/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.xz" patches: + "2.16.01": + - patch_file: "patches/2.16.01-0001-disable-newly-integrated-dependency-tracking.patch" "2.15.05": - patch_file: "patches/2.15.05-0001-disable-newly-integrated-dependency-tracking.patch" diff --git a/recipes/nasm/all/conanfile.py b/recipes/nasm/all/conanfile.py index f570e673ace4d..16c994e86edd0 100644 --- a/recipes/nasm/all/conanfile.py +++ b/recipes/nasm/all/conanfile.py @@ -83,19 +83,20 @@ def build(self): with chdir(self, self.source_folder): self.run(f'nmake /f {os.path.join("Mkfiles", "msvc.mak")}') else: - autotools = Autotools(self) - autotools.configure() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() - # GCC9 - "pure" attribute on function returning "void" - replace_in_file(self, "Makefile", "-Werror=attributes", "") + # GCC9 - "pure" attribute on function returning "void" + replace_in_file(self, "Makefile", "-Werror=attributes", "") - # Need "-arch" flag for the linker when cross-compiling. - # FIXME: Revisit after https://github.com/conan-io/conan/issues/9069, using new Autotools integration - # TODO it is time to revisit, not sure what to do here though... - if str(self.version).startswith("2.13"): - replace_in_file(self, "Makefile", "$(CC) $(LDFLAGS) -o", "$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o") - replace_in_file(self, "Makefile", "$(INSTALLROOT)", "$(DESTDIR)") - autotools.make() + # Need "-arch" flag for the linker when cross-compiling. + # FIXME: Revisit after https://github.com/conan-io/conan/issues/9069, using new Autotools integration + # TODO it is time to revisit, not sure what to do here though... + if str(self.version).startswith("2.13"): + replace_in_file(self, "Makefile", "$(CC) $(LDFLAGS) -o", "$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o") + replace_in_file(self, "Makefile", "$(INSTALLROOT)", "$(DESTDIR)") + autotools.make() def package(self): copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) @@ -105,8 +106,9 @@ def package(self): shutil.copy2("nasm.exe", "nasmw.exe") shutil.copy2("ndisasm.exe", "ndisasmw.exe") else: - autotools = Autotools(self) - autotools.install() + with chdir(self, self.source_folder): + 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) diff --git a/recipes/nasm/all/patches/2.16.01-0001-disable-newly-integrated-dependency-tracking.patch b/recipes/nasm/all/patches/2.16.01-0001-disable-newly-integrated-dependency-tracking.patch new file mode 100644 index 0000000000000..b65e6fbc40d86 --- /dev/null +++ b/recipes/nasm/all/patches/2.16.01-0001-disable-newly-integrated-dependency-tracking.patch @@ -0,0 +1,34 @@ +--- Mkfiles/msvc.mak ++++ Mkfiles/msvc.mak +@@ -226,7 +226,7 @@ + x86\regs.h: x86\regs.dat x86\regs.pl + $(RUNPERL) $(srcdir)\x86\regs.pl h \ + $(srcdir)\x86\regs.dat > x86\regs.h +- ++!IF 0 + # Extract warnings from source code. This is done automatically if any + # C files have changed; the script is fast enough that that is + # reasonable, but doesn't update the time stamp if the files aren't +@@ -262,7 +262,7 @@ + + doc\warnings.src : doc\warnings.src.time + @: Side effect +- ++!ENDIF + # Assembler token hash + asm\tokhash.c: x86\insns.dat x86\insnsn.c asm\tokens.dat asm\tokhash.pl \ + perllib\phash.ph +@@ -402,7 +402,7 @@ + # @exclude: "config/config.h" + # @external: "msvc.dep" + # @selfrule: "1" +-#-- Everything below is generated by mkdep.pl - do not edit --# ++!IF 0 + asm\assemble.$(O): asm\assemble.c asm\assemble.h asm\directiv.h \ + asm\listing.h asm\pptok.h asm\preproc.h asm\srcfile.h asm\tokens.h \ + config\msvc.h config\unconfig.h config\unknown.h config\watcom.h \ +@@ -854,3 +854,4 @@ + x86\regvals.$(O): x86\regvals.c config\msvc.h config\unconfig.h \ + config\unknown.h config\watcom.h include\compiler.h include\nasmint.h \ + include\tables.h x86\insnsi.h ++!ENDIF diff --git a/recipes/nasm/all/test_package/conanfile.py b/recipes/nasm/all/test_package/conanfile.py index 8ec69275ade00..87cdd6462f79f 100644 --- a/recipes/nasm/all/test_package/conanfile.py +++ b/recipes/nasm/all/test_package/conanfile.py @@ -1,6 +1,8 @@ +import os + from conan import ConanFile from conan.tools.build import can_run -import os +from conan.tools.cmake import cmake_layout class TestPackageConan(ConanFile): @@ -11,6 +13,9 @@ class TestPackageConan(ConanFile): def build_requirements(self): self.tool_requires(self.tested_reference_str) + def layout(self): + cmake_layout(self) + def test(self): self.run("nasm --version") asm_file = os.path.join(self.source_folder, "hello_linux.asm") diff --git a/recipes/nasm/config.yml b/recipes/nasm/config.yml index 2034e05cda1be..15911be86b65b 100644 --- a/recipes/nasm/config.yml +++ b/recipes/nasm/config.yml @@ -1,9 +1,5 @@ versions: - "2.15.05": - folder: all - "2.14": + "2.16.01": folder: all - "2.13.02": - folder: all - "2.13.01": + "2.15.05": folder: all diff --git a/recipes/nativefiledialog/all/test_package/CMakeLists.txt b/recipes/nativefiledialog/all/test_package/CMakeLists.txt index 34af13462f44f..d3e60bacccdcf 100644 --- a/recipes/nativefiledialog/all/test_package/CMakeLists.txt +++ b/recipes/nativefiledialog/all/test_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/ncbi-cxx-toolkit-public/26/conanfile.py b/recipes/ncbi-cxx-toolkit-public/26/conanfile.py index 9a181ead24d57..b8e790e06879f 100644 --- a/recipes/ncbi-cxx-toolkit-public/26/conanfile.py +++ b/recipes/ncbi-cxx-toolkit-public/26/conanfile.py @@ -39,7 +39,7 @@ class NcbiCxxToolkit(ConanFile): "NGHTTP2": "libnghttp2/1.46.0", "PCRE": "pcre/8.45", "PNG": "libpng/1.6.37", - "SQLITE3": "sqlite3/3.37.2", + "SQLITE3": "sqlite3/[>=3.37 <4]", "TIFF": "libtiff/4.3.0", "XML": "libxml2/2.9.12", "XSLT": "libxslt/1.1.34", diff --git a/recipes/ncurses/all/conandata.yml b/recipes/ncurses/all/conandata.yml index fc77450ebeca3..6777bbc70de06 100644 --- a/recipes/ncurses/all/conandata.yml +++ b/recipes/ncurses/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "6.5": + url: + - "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz" + - "https://invisible-mirror.net/archives/ncurses/ncurses-6.5.tar.gz" + sha256: "136d91bc269a9a5785e5f9e980bc76ab57428f604ce3e5a5a90cebc767971cc6" "6.4": url: - "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.4.tar.gz" @@ -9,46 +14,3 @@ sources: - "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz" - "https://invisible-mirror.net/archives/ncurses/ncurses-6.3.tar.gz" sha256: "97fc51ac2b085d4cde31ef4d2c3122c21abc217e9090a43a30fc5ec21684e059" - "6.2": - url: - - "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.2.tar.gz" - - "https://invisible-mirror.net/archives/ncurses/ncurses-6.2.tar.gz" - sha256: "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d" -patches: - "6.2": - - patch_file: "patches/6.2.0-0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0002-Optionally-include-sys-time.h.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0003-Do-not-redeclare-exit.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0004-fix-win32con.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0005-api-must-be-placed-next-to-variable-name.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0006-Add-potentially-missing-STDOUT_FILENO.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0007-No-import-export-declaration-on-class-members.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0008-Add-include-file-to-add-export-annotation.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0011-Let-each-sublibrary-do-its-own-import-exporting.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0012-Learn-configure-about-msvc.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0013-Fix-lib_gen.c.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0014-avoid-macro-expansion-in-args-by-defining-NCURSES_NO.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0015-MSVC-access-does-not-support-X_OK.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0016-msvc-has-wchar-support.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0017-msvc-fix-tests.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0018-missing-functions-c-linkage.patch" - patch_type: "portability" - - patch_file: "patches/6.2.0-0019-Run-autoreconf.patch" - patch_type: "portability" diff --git a/recipes/ncurses/all/patches/6.2.0-0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch b/recipes/ncurses/all/patches/6.2.0-0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch deleted file mode 100644 index c9d1dc8e8178a..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch +++ /dev/null @@ -1,59 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 7699b26096801fe462233ecb86484bdc3a2f0beb Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:22:08 +0100 -Subject: [PATCH 01/15] Look for pcre2posix instead of pcre2-posix.h - ---- - aclocal.m4 | 2 +- - form/fty_regex.c | 4 ++-- - include/ncurses_defs | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/aclocal.m4 b/aclocal.m4 -index c27cc368..e6ccc42f 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -8506,7 +8506,7 @@ if test "x$with_pcre2" != xno ; then - esac - - # either way, check for the library header files -- AC_CHECK_HEADERS(pcre2-posix.h pcreposix.h) -+ AC_CHECK_HEADERS(pcre2posix.h pcreposix.h) - fi - ])dnl - dnl --------------------------------------------------------------------------- -diff --git a/form/fty_regex.c b/form/fty_regex.c -index da0ef08c..d1daf714 100644 ---- a/form/fty_regex.c -+++ b/form/fty_regex.c -@@ -39,8 +39,8 @@ MODULE_ID("$Id: fty_regex.c,v 1.28 2020/02/02 23:34:34 tom Exp $") - - #if HAVE_REGEX_H_FUNCS || HAVE_LIB_PCRE2 /* We prefer POSIX regex */ - --#if HAVE_PCRE2_POSIX_H --#include -+#if HAVE_PCRE2POSIX_H -+#include - #elif HAVE_PCREPOSIX_H - #include - #else -diff --git a/include/ncurses_defs b/include/ncurses_defs -index e37fc901..a0339457 100644 ---- a/include/ncurses_defs -+++ b/include/ncurses_defs -@@ -120,7 +120,7 @@ HAVE_NANOSLEEP - HAVE_NC_ALLOC_H - HAVE_NEWPAD 1 - HAVE_PANEL_H --HAVE_PCRE2_POSIX_H -+HAVE_PCRE2POSIX_H - HAVE_PCREPOSIX_H - HAVE_POLL - HAVE_POLL_H --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0002-Optionally-include-sys-time.h.patch b/recipes/ncurses/all/patches/6.2.0-0002-Optionally-include-sys-time.h.patch deleted file mode 100644 index b8cb861a2599a..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0002-Optionally-include-sys-time.h.patch +++ /dev/null @@ -1,51 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 3737faf9325859a33d8288337c312fb9ad5b3e02 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:24:34 +0100 -Subject: [PATCH 02/15] Optionally include sys/time.h - ---- - include/nc_mingw.h | 2 ++ - ncurses/tty/lib_twait.c | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/include/nc_mingw.h b/include/nc_mingw.h -index 68a41849..b47bb2cf 100644 ---- a/include/nc_mingw.h -+++ b/include/nc_mingw.h -@@ -52,10 +52,16 @@ - #undef gettimeofday - #define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz) - -+#if HAVE_SYS_TIME_H - #include /* for struct timeval */ -+#endif - -+#ifdef _MSC_VER -+#include /* for struct timeval */ -+#endif -+ - extern int _nc_gettimeofday(struct timeval *, void *); - - #undef HAVE_GETTIMEOFDAY - #define HAVE_GETTIMEOFDAY 1 - -diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c -index 3ab168dd..74d267c7 100644 ---- a/ncurses/tty/lib_twait.c -+++ b/ncurses/tty/lib_twait.c -@@ -71,7 +71,7 @@ - # include - # endif - #endif --#ifdef _WIN32 -+#if HAVE_SYS_TIME_H - # include - #endif - #undef CUR --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0003-Do-not-redeclare-exit.patch b/recipes/ncurses/all/patches/6.2.0-0003-Do-not-redeclare-exit.patch deleted file mode 100644 index 758bbc562ec77..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0003-Do-not-redeclare-exit.patch +++ /dev/null @@ -1,28 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 8e12095e0af72dd9414fcdb35831f585d5b8d67e Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:25:00 +0100 -Subject: [PATCH 03/15] Do not redeclare exit - ---- - c++/etip.h.in | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/c++/etip.h.in b/c++/etip.h.in -index 9334f9d3..1155c5fd 100644 ---- a/c++/etip.h.in -+++ b/c++/etip.h.in -@@ -341,7 +341,6 @@ using std::endl; - # else - # include - # endif -- extern "C" void exit(int); - #endif - - inline void THROW(const NCursesException *e) { --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0004-fix-win32con.patch b/recipes/ncurses/all/patches/6.2.0-0004-fix-win32con.patch deleted file mode 100644 index 4af53ed568c0d..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0004-fix-win32con.patch +++ /dev/null @@ -1,91 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 5cb87b2244c1e944e13478b7bb98d0984b7dfdf7 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:25:57 +0100 -Subject: [PATCH 04/15] fix win32con ---- - ncurses/win32con/gettimeofday.c | 4 ++++ - ncurses/win32con/win_driver.c | 14 +++++++------- - 2 files changed, 11 insertions(+), 7 deletions(-) - -diff --git a/ncurses/win32con/gettimeofday.c b/ncurses/win32con/gettimeofday.c -index 8fad9a62..319937c6 100644 ---- a/ncurses/win32con/gettimeofday.c -+++ b/ncurses/win32con/gettimeofday.c -@@ -40,6 +40,10 @@ MODULE_ID("$Id: gettimeofday.c,v 1.4 2020/02/02 23:34:34 tom Exp $") - - #define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */ - -+#ifdef _MSC_VER -+#include -+#endif -+ - int - gettimeofday(struct timeval *tv, void *tz GCC_UNUSED) - { -diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c -index 280aa6dc..1bd45bb7 100644 ---- a/ncurses/win32con/win_driver.c -+++ b/ncurses/win32con/win_driver.c -@@ -58,7 +58,7 @@ - MODULE_ID("$Id: win_driver.c,v 1.63 2020/02/02 23:34:34 tom Exp $") - - #ifndef __GNUC__ --# error We need GCC to compile for MinGW -+//# error We need GCC to compile for MinGW - #endif - - #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) -@@ -262,7 +262,7 @@ static BOOL - con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit) - { - int actual = 0; -- CHAR_INFO ci[limit]; -+ CHAR_INFO * ci = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * limit); - COORD loc, siz; - SMALL_RECT rec; - int i; -@@ -311,7 +311,7 @@ con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit) - static BOOL - con_write8(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n) - { -- CHAR_INFO ci[n]; -+ CHAR_INFO * ci = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * n); - COORD loc, siz; - SMALL_RECT rec; - int i; -@@ -510,7 +510,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB) - if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) { - int x; - #if USE_WIDEC_SUPPORT -- cchar_t empty[Width]; -+ cchar_t * empty = (cchar_t*) _alloca(sizeof(cchar_t) * Width); - wchar_t blank[2] = - { - L' ', L'\0' -@@ -519,7 +519,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB) - for (x = 0; x < Width; x++) - setcchar(&empty[x], blank, 0, 0, 0); - #else -- chtype empty[Width]; -+ chtype * empty = (chtype*) _alloca(sizeof(chtype) * Width); - - for (x = 0; x < Width; x++) - empty[x] = ' '; -@@ -675,8 +675,8 @@ wcon_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, - int max_cells = (high * wide); - int i; - -- CHAR_INFO this_screen[max_cells]; -- CHAR_INFO that_screen[max_cells]; -+ CHAR_INFO * this_screen = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * max_cells); -+ CHAR_INFO * that_screen = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * max_cells); - COORD this_size; - SMALL_RECT this_region; - COORD bufferCoord; --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0005-api-must-be-placed-next-to-variable-name.patch b/recipes/ncurses/all/patches/6.2.0-0005-api-must-be-placed-next-to-variable-name.patch deleted file mode 100644 index 9d34795fa33af..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0005-api-must-be-placed-next-to-variable-name.patch +++ /dev/null @@ -1,45 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From c225d0ccd87b45fbaf92a4b048887f8f136cedcd Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:26:55 +0100 -Subject: [PATCH 05/15] api must be placed next to variable name - ---- - include/term_entry.h | 4 ++-- - ncurses/tinfo/comp_parse.c | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/include/term_entry.h b/include/term_entry.h -index df13f53f..c4702012 100644 ---- a/include/term_entry.h -+++ b/include/term_entry.h -@@ -200,8 +200,8 @@ extern NCURSES_EXPORT(bool) _nc_entry_match (char *, char *); - extern NCURSES_EXPORT(int) _nc_resolve_uses (bool); /* obs 20040705 */ - extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool); - extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *); --extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */ --extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE2 *, bool); -+extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */ -+extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2)(TERMTYPE2 *, bool); - - /* trace_xnames.c */ - extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *); -diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c -index ab25d5b1..d320129e 100644 ---- a/ncurses/tinfo/comp_parse.c -+++ b/ncurses/tinfo/comp_parse.c -@@ -51,7 +51,7 @@ - MODULE_ID("$Id: comp_parse.c,v 1.109 2020/02/02 23:34:34 tom Exp $") - - static void sanity_check2(TERMTYPE2 *, bool); --NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; -+NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; - - static void fixup_acsc(TERMTYPE2 *, int); - --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0006-Add-potentially-missing-STDOUT_FILENO.patch b/recipes/ncurses/all/patches/6.2.0-0006-Add-potentially-missing-STDOUT_FILENO.patch deleted file mode 100644 index 60a2039b3f9e1..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0006-Add-potentially-missing-STDOUT_FILENO.patch +++ /dev/null @@ -1,31 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From 536b8ba02682dcf367efba46b9616a9695341797 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:27:22 +0100 -Subject: [PATCH 06/15] Add potentially missing STDOUT_FILENO - ---- - progs/progs.priv.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/progs/progs.priv.h b/progs/progs.priv.h -index da7a5154..4734e740 100644 ---- a/progs/progs.priv.h -+++ b/progs/progs.priv.h -@@ -155,6 +155,10 @@ extern int optind; - #endif /* gcc workarounds */ - - /* usually in */ -+#ifndef STDIN_FILENO -+#define STDIN_FILENO 0 -+#endif -+ - #ifndef STDOUT_FILENO - #define STDOUT_FILENO 1 - #endif --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0007-No-import-export-declaration-on-class-members.patch b/recipes/ncurses/all/patches/6.2.0-0007-No-import-export-declaration-on-class-members.patch deleted file mode 100644 index ef00f1218a927..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0007-No-import-export-declaration-on-class-members.patch +++ /dev/null @@ -1,53 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -From ff6bd063127225360332a938ed8e6babd90d9798 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:28:30 +0100 -Subject: [PATCH 07/15] No import/export declaration on class members - ---- - c++/cursslk.h | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/c++/cursslk.h b/c++/cursslk.h -index 5a7b78c3..10364c1d 100644 ---- a/c++/cursslk.h -+++ b/c++/cursslk.h -@@ -101,10 +101,10 @@ public: - } Label_Layout; - - private: -- static long NCURSES_IMPEXP count; // Number of Key Sets -- static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets -- static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets -- bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized -+ static long count; // Number of Key Sets -+ static Label_Layout format; // Layout of the Key Sets -+ static int num_labels; // Number Of Labels in Key Sets -+ bool b_attrInit; // Are attributes initialized - - Soft_Label_Key *slk_array; // The array of SLK's - -@@ -144,7 +144,7 @@ public: - - // This constructor assumes, that you already constructed a Key Set - // with a layout by the constructor above. This layout will be reused. -- NCURSES_IMPEXP Soft_Label_Key_Set(); -+ Soft_Label_Key_Set(); - - Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs) - { -@@ -165,7 +165,7 @@ public: - virtual ~Soft_Label_Key_Set() THROWS(NCursesException); - - // Get Label# i. Label counting starts with 1! -- NCURSES_IMPEXP Soft_Label_Key& operator[](int i); -+ Soft_Label_Key& operator[](int i); - - // Retrieve number of Labels - inline int labels() const { return num_labels; } --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0008-Add-include-file-to-add-export-annotation.patch b/recipes/ncurses/all/patches/6.2.0-0008-Add-include-file-to-add-export-annotation.patch deleted file mode 100644 index d29108c2fbbb7..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0008-Add-include-file-to-add-export-annotation.patch +++ /dev/null @@ -1,100 +0,0 @@ -Upstreamed in 3e37c7d3fa122563a9d88168926f61286ef30cd3 - -ncurses 6.2 - patch 20200523 - -this patch differs with upstream: -upstream has integrated this fine in ncurses_dll.h.in (instead of creating a new file) -This change is small, so don't care. - -From ffcd8b69aa8346e94aceefdc4593ad74635708f9 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Sat, 14 Mar 2020 12:38:41 +0100 -Subject: [PATCH 08/15] Add include file to add export annotation - ---- - configure.in | 1 + - include/headers | 1 + - include/ncurses_exports.h.in | 47 ++++++++++++++++++++++++++++++++++++ - 3 files changed, 49 insertions(+) - create mode 100644 include/ncurses_exports.h.in - -diff --git a/configure.in b/configure.in -index 2183a978..fc00f9dc 100644 ---- a/configure.in -+++ b/configure.in -@@ -2395,6 +2395,7 @@ AC_OUTPUT( \ - include/MKterm.h.awk \ - include/curses.head:include/curses.h.in \ - include/ncurses_dll.h \ -+ include/ncurses_exports.h \ - include/termcap.h \ - include/unctrl.h \ - $SUB_MAKEFILES \ -diff --git a/include/headers b/include/headers -index dbb134d1..e20798b4 100644 ---- a/include/headers -+++ b/include/headers -@@ -33,6 +33,7 @@ - curses.h - unctrl.h - ncurses_dll.h -+ncurses_exports.h - - # Support for termcap (and tic, etc.), which can be a separate library - @ termlib -diff --git a/include/ncurses_exports.h.in b/include/ncurses_exports.h.in -new file mode 100644 -index 00000000..252f5021 ---- /dev/null -+++ b/include/ncurses_exports.h.in -@@ -0,0 +1,47 @@ -+/**************************************************************************** -+ * Copyright 2020 Thomas E. Dickey * -+ * * -+ * Permission is hereby granted, free of charge, to any person obtaining a * -+ * copy of this software and associated documentation files (the * -+ * "Software"), to deal in the Software without restriction, including * -+ * without limitation the rights to use, copy, modify, merge, publish, * -+ * distribute, distribute with modifications, sublicense, and/or sell * -+ * copies of the Software, and to permit persons to whom the Software is * -+ * furnished to do so, subject to the following conditions: * -+ * * -+ * The above copyright notice and this permission notice shall be included * -+ * in all copies or substantial portions of the Software. * -+ * * -+ * 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 AND NONINFRINGEMENT. * -+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * -+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * -+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * -+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -+ * * -+ * Except as contained in this notice, the name(s) of the above copyright * -+ * holders shall not be used in advertising or otherwise to promote the * -+ * sale, use or other dealings in this Software without prior written * -+ * authorization. * -+ ****************************************************************************/ -+/* $Id: ncurses_exports.h.in,v 1.13 2020/02/29 21:53:14 tom Exp $ */ -+ -+#ifndef NCURSES_EXPORTS_H_incl -+#define NCURSES_EXPORTS_H_incl 1 -+ -+#if defined(__CYGWIN__) || defined(_WIN32) -+# if defined(NCURSES_DLL) -+# define NCURSES_EXPORT __declspec(dllexport) -+# elif !defined(NCURSES_STATIC) -+# define NCURSES_EXPORT __declspec(dllimport) -+# else -+# define NCURSES_EXPORT -+# endif -+#endif -+ -+#if !defined(NCURSES_EXPORT) -+# define NCURSES_EXPORT @NCURSES_EXPORT@ -+#endif -+ -+#endif /* NCURSES_EXPORTS_H_incl */ --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch b/recipes/ncurses/all/patches/6.2.0-0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch deleted file mode 100644 index ffa1320f610fb..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch +++ /dev/null @@ -1,242 +0,0 @@ -Upstreamed in 04d942c3d98cf0a929c6afb17be8c10d4ae39af0 - -ncurses 6.2 - patch 20200704 - -From ed3ad1962ab885b9a9c6e6a3437eb6db274110b5 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Sat, 14 Mar 2020 14:15:41 +0100 -Subject: [PATCH 10/15] Pass BUILDING_XXX compile definition while building - library XXX - ---- - c++/Makefile.in | 6 ++--- - form/Makefile.in | 6 ++--- - include/ncurses_dll.h.in | 49 ++++++------------------------------ - include/ncurses_exports.h.in | 23 +++++++++-------- - menu/Makefile.in | 6 ++--- - ncurses/Makefile.in | 8 +++--- - panel/Makefile.in | 6 ++--- - 7 files changed, 35 insertions(+), 69 deletions(-) - -diff --git a/c++/Makefile.in b/c++/Makefile.in -index 9b22b6ac..17b3e069 100644 ---- a/c++/Makefile.in -+++ b/c++/Makefile.in -@@ -89,7 +89,7 @@ CXXFLAGS = @CXXFLAGS@ @EXTRA_CXXFLAGS@ - CXXLIBS = @CXXLIBS@ - - INCDIR = ../include --CPPFLAGS = -DHAVE_CONFIG_H -I../c++ @CPPFLAGS@ -+CPPFLAGS = -DHAVE_CONFIG_H -DBUILDING_NCURSES_CXX -I../c++ @CPPFLAGS@ - - CTAGS = @CTAGS@ - ETAGS = @ETAGS@ -@@ -97,8 +97,8 @@ ETAGS = @ETAGS@ - CC = ${CXX} - CCFLAGS = $(CPPFLAGS) $(CXXFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ -diff --git a/form/Makefile.in b/form/Makefile.in -index 3e5be8da..34bfd172 100644 ---- a/form/Makefile.in -+++ b/form/Makefile.in -@@ -92,12 +92,12 @@ CC = @CC@ - CPP = @CPP@ - CFLAGS = @CFLAGS@ - --CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -+CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -DBUILDING_FORM - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ -diff --git a/include/ncurses_dll.h.in b/include/ncurses_dll.h.in -index f439d480..568112e2 100644 ---- a/include/ncurses_dll.h.in -+++ b/include/ncurses_dll.h.in -@@ -68,50 +68,15 @@ - #define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name - #define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) - --/* no longer needed on cygwin or mingw, thanks to auto-import */ --/* but this structure may be useful at some point for an MSVC build */ --/* so, for now unconditionally define the important flags */ --/* "the right way" for proper static and dll+auto-import behavior */ --#undef NCURSES_DLL --#define NCURSES_STATIC -+#include "ncurses_exports.h" - --#if defined(__CYGWIN__) || defined(_WIN32) --# if defined(NCURSES_DLL) --# if defined(NCURSES_STATIC) --# undef NCURSES_STATIC --# endif --# endif --# undef NCURSES_IMPEXP --# undef NCURSES_API --# undef NCURSES_EXPORT --# undef NCURSES_EXPORT_VAR --# if defined(NCURSES_DLL) --/* building a DLL */ --# define NCURSES_IMPEXP __declspec(dllexport) --# elif defined(NCURSES_STATIC) --/* building or linking to a static library */ --# define NCURSES_IMPEXP /* nothing */ --# else --/* linking to the DLL */ --# define NCURSES_IMPEXP __declspec(dllimport) --# endif --# define NCURSES_API __cdecl --# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API --# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type -+#if defined(BUILDING_NCURSES) -+# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT - #endif - --/* Take care of non-cygwin platforms */ --#if !defined(NCURSES_IMPEXP) --# define NCURSES_IMPEXP /* nothing */ --#endif --#if !defined(NCURSES_API) --# define NCURSES_API /* nothing */ --#endif --#if !defined(NCURSES_EXPORT) --# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API --#endif --#if !defined(NCURSES_EXPORT_VAR) --# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type --#endif -+#define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API -+#define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type - - #endif /* NCURSES_DLL_H_incl */ -diff --git a/include/ncurses_exports.h.in b/include/ncurses_exports.h.in -index 252f5021..61655f65 100644 ---- a/include/ncurses_exports.h.in -+++ b/include/ncurses_exports.h.in -@@ -31,17 +31,18 @@ - #define NCURSES_EXPORTS_H_incl 1 - - #if defined(__CYGWIN__) || defined(_WIN32) --# if defined(NCURSES_DLL) --# define NCURSES_EXPORT __declspec(dllexport) --# elif !defined(NCURSES_STATIC) --# define NCURSES_EXPORT __declspec(dllimport) --# else --# define NCURSES_EXPORT --# endif --#endif -- --#if !defined(NCURSES_EXPORT) --# define NCURSES_EXPORT @NCURSES_EXPORT@ -+# if defined(NCURSES_STATIC) -+# define NCURSES_EXPORT_GENERAL_IMPORT -+# define NCURSES_EXPORT_GENERAL_EXPORT -+# else -+# define NCURSES_EXPORT_GENERAL_IMPORT __declspec(dllimport) -+# define NCURSES_EXPORT_GENERAL_EXPORT __declspec(dllexport) -+# endif -+# define NCURSES_API __cdecl -+#else -+# define NCURSES_EXPORT_GENERAL_IMPORT -+# define NCURSES_EXPORT_GENERAL_EXPORT -+# define NCURSES_API /* FIXME: __attribute__ ((cdecl)) is only available on x86 */ - #endif - - #endif /* NCURSES_EXPORTS_H_incl */ -diff --git a/menu/Makefile.in b/menu/Makefile.in -index 495651c2..bf153602 100644 ---- a/menu/Makefile.in -+++ b/menu/Makefile.in -@@ -92,12 +92,12 @@ CC = @CC@ - CPP = @CPP@ - CFLAGS = @CFLAGS@ - --CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -+CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -DBUILDING_MENU - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ -diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in -index b2420788..00129d0b 100644 ---- a/ncurses/Makefile.in -+++ b/ncurses/Makefile.in -@@ -102,11 +102,11 @@ CPP = @CPP@ - CFLAGS = @CFLAGS@ - - INCDIR = $(srcdir)/../include --CPPFLAGS = -DHAVE_CONFIG_H -I../ncurses @CPPFLAGS@ -+CPPFLAGS = -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses @CPPFLAGS@ - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --BUILD_CPPFLAGS = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@ -+BUILD_CPPFLAGS = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@ - BUILD_CC = @BUILD_CC@ - BUILD_CCFLAGS = @BUILD_CFLAGS@ - BUILD_LDFLAGS = @BUILD_LDFLAGS@ -@@ -118,8 +118,8 @@ BUILD_LIBS = @BUILD_LIBS@ - BUILD_EXEEXT = @BUILD_EXEEXT@ - x = @EXEEXT@ - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ -diff --git a/panel/Makefile.in b/panel/Makefile.in -index 5f7b5b92..e1f7e705 100644 ---- a/panel/Makefile.in -+++ b/panel/Makefile.in -@@ -94,12 +94,12 @@ CC = @CC@ - CPP = @CPP@ - CFLAGS = @CFLAGS@ - --CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -+CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -DBUILDING_PANEL - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ ---- a/progs/Makefile.in -+++ b/progs/Makefile.in -@@ -97,8 +97,8 @@ - - CCFLAGS = $(CPPFLAGS) $(CFLAGS) - --CFLAGS_LIBTOOL = $(CCFLAGS) --CFLAGS_NORMAL = $(CCFLAGS) -+CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC -+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC - CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE - CFLAGS_PROFILE = $(CCFLAGS) -pg - CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ diff --git a/recipes/ncurses/all/patches/6.2.0-0011-Let-each-sublibrary-do-its-own-import-exporting.patch b/recipes/ncurses/all/patches/6.2.0-0011-Let-each-sublibrary-do-its-own-import-exporting.patch deleted file mode 100644 index 38de8ccbe5b84..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0011-Let-each-sublibrary-do-its-own-import-exporting.patch +++ /dev/null @@ -1,3326 +0,0 @@ -Upstreamed in 04d942c3d98cf0a929c6afb17be8c10d4ae39af0 - -ncurses 6.2 - patch 20200704 - -d61c3c6a ("ncurses 6.2 - patch 20200711", 2020-07-12) - ---- ncurses/win32con/wcwidth.c -+++ ncurses/win32con/wcwidth.c -@@ -36,10 +36,10 @@ MODULE_ID("$Id: wcwidth.c,v 1.3 2020/02/02 23:34:34 tom Exp $") - #define mk_wcwidth_cjk(ucs) _nc_wcwidth_cjk(ucs) - #define mk_wcswidth_cjk(pwcs, n) _nc_wcswidth_cjk(pwcs, n) - --extern int mk_wcwidth(wchar_t); --extern int mk_wcswidth(const wchar_t *, size_t); --extern int mk_wcwidth_cjk(wchar_t); --extern int mk_wcswidth_cjk(const wchar_t *, size_t); -+NCURSES_EXPORT(int) mk_wcwidth(wchar_t); -+NCURSES_EXPORT(int) mk_wcswidth(const wchar_t *, size_t); -+NCURSES_EXPORT(int) mk_wcwidth_cjk(wchar_t); -+NCURSES_EXPORT(int) mk_wcswidth_cjk(const wchar_t *, size_t); - - #include - #else ---- ncurses/wcwidth.h -+++ ncurses/wcwidth.h -@@ -119,7 +119,7 @@ - * in ISO 10646. - */ - --int mk_wcwidth(wchar_t ucs) -+NCURSES_EXPORT(int) mk_wcwidth(wchar_t ucs) - { - /* sorted list of non-overlapping intervals of non-spacing characters */ - /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ -@@ -207,7 +207,7 @@ int mk_wcwidth(wchar_t ucs) - } - - --int mk_wcswidth(const wchar_t *pwcs, size_t n) -+NCURSES_EXPORT(int) mk_wcswidth(const wchar_t *pwcs, size_t n) - { - int w, width = 0; - -@@ -230,7 +230,7 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n) - * the traditional terminal character-width behaviour. It is not - * otherwise recommended for general use. - */ --int mk_wcwidth_cjk(wchar_t ucs) -+NCURSES_EXPORT(int) mk_wcwidth_cjk(wchar_t ucs) - { - /* sorted list of non-overlapping intervals of East Asian Ambiguous - * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ -@@ -298,7 +298,7 @@ int mk_wcwidth_cjk(wchar_t ucs) - } - - --int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) -+NCURSES_EXPORT(int) mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) - { - int w, width = 0; - -diff --git a/c++/cursesapp.h b/c++/cursesapp.h -index a09a3b63..e423089c 100644 ---- a/c++/cursesapp.h -+++ b/c++/cursesapp.h -@@ -39,7 +39,7 @@ - - #include - --class NCURSES_IMPEXP NCursesApplication { -+class NCURSES_CXX_IMPEXP NCursesApplication { - public: - typedef struct _slk_link { // This structure is used to maintain - struct _slk_link* prev; // a stack of SLKs -diff --git a/c++/cursesf.h b/c++/cursesf.h -index 17d4c70e..1e90c360 100644 ---- a/c++/cursesf.h -+++ b/c++/cursesf.h -@@ -51,11 +51,11 @@ extern "C" { - // The abstract base class for builtin and user defined Fieldtypes. - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesFormField; // forward declaration -+class NCURSES_CXX_IMPEXP NCursesFormField; // forward declaration - - // Class to represent builtin field types as well as C++ written new - // fieldtypes (see classes UserDefineFieldType... --class NCURSES_IMPEXP NCursesFieldType -+class NCURSES_CXX_IMPEXP NCursesFieldType - { - friend class NCursesFormField; - -@@ -101,7 +101,7 @@ public: - // The class representing a forms field, wrapping the lowlevel FIELD struct - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesFormField -+class NCURSES_CXX_IMPEXP NCursesFormField - { - friend class NCursesForm; - -@@ -338,7 +338,7 @@ extern "C" { - // The class representing a form, wrapping the lowlevel FORM struct - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesForm : public NCursesPanel -+class NCURSES_CXX_IMPEXP NCursesForm : public NCursesPanel - { - protected: - FORM* form; // the lowlevel structure -@@ -629,7 +629,7 @@ public: - // data belongs to some class T. Use T as template argument - // to create a UserField. - // ------------------------------------------------------------------------- --template class NCURSES_IMPEXP NCursesUserField : public NCursesFormField -+template class NCURSES_CXX_IMPEXP NCursesUserField : public NCursesFormField - { - public: - NCursesUserField (int rows, -@@ -662,7 +662,7 @@ public: - // The same mechanism is used to attach user data to a form - // ------------------------------------------------------------------------- - // --template class NCURSES_IMPEXP NCursesUserForm : public NCursesForm -+template class NCURSES_CXX_IMPEXP NCursesUserForm : public NCursesForm - { - protected: - // 'Internal' constructor, builds an object without association to a -@@ -721,7 +721,7 @@ public: - // Builtin Fieldtypes - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Alpha_Field : public NCursesFieldType - { - private: - int min_field_width; -@@ -737,7 +737,7 @@ public: - } - }; - --class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Alphanumeric_Field : public NCursesFieldType - { - private: - int min_field_width; -@@ -753,7 +753,7 @@ public: - } - }; - --class NCURSES_IMPEXP Integer_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Integer_Field : public NCursesFieldType - { - private: - int precision; -@@ -771,7 +771,7 @@ public: - } - }; - --class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Numeric_Field : public NCursesFieldType - { - private: - int precision; -@@ -789,7 +789,7 @@ public: - } - }; - --class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Regular_Expression_Field : public NCursesFieldType - { - private: - char* regex; -@@ -834,7 +834,7 @@ public: - } - }; - --class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP Enumeration_Field : public NCursesFieldType - { - private: - const char** list; -@@ -873,7 +873,7 @@ public: - } - }; - --class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType -+class NCURSES_CXX_IMPEXP IPV4_Address_Field : public NCursesFieldType - { - private: - void set(NCursesFormField& f) { -@@ -896,7 +896,7 @@ extern "C" { - // Abstract base class for User-Defined Fieldtypes - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType -+class NCURSES_CXX_IMPEXP UserDefinedFieldType : public NCursesFieldType - { - friend class UDF_Init; // Internal helper to set up statics - private: -@@ -939,7 +939,7 @@ extern "C" { - // Abstract base class for User-Defined Fieldtypes with Choice functions - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType -+class NCURSES_CXX_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType - { - friend class UDF_Init; // Internal helper to set up statics - private: -diff --git a/c++/cursesm.h b/c++/cursesm.h -index 413da764..0eab3861 100644 ---- a/c++/cursesm.h -+++ b/c++/cursesm.h -@@ -47,7 +47,7 @@ extern "C" { - // This wraps the ITEM type of - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesMenuItem -+class NCURSES_CXX_IMPEXP NCursesMenuItem - { - friend class NCursesMenu; - -@@ -153,7 +153,7 @@ typedef bool ITEMCALLBACK(NCursesMenuItem&); - // If you don't like to create a child class for individual items to - // overload action(), you may use this class and provide a callback - // function pointer for items. --class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem -+class NCURSES_CXX_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem - { - private: - ITEMCALLBACK* p_fct; -@@ -200,7 +200,7 @@ extern "C" { - // This wraps the MENU type of - // ------------------------------------------------------------------------- - // --class NCURSES_IMPEXP NCursesMenu : public NCursesPanel -+class NCURSES_CXX_IMPEXP NCursesMenu : public NCursesPanel - { - protected: - MENU *menu; -@@ -596,7 +596,7 @@ public: - // to create a UserItem. - // ------------------------------------------------------------------------- - // --template class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem -+template class NCURSES_CXX_IMPEXP NCursesUserItem : public NCursesMenuItem - { - public: - NCursesUserItem (const char* p_name, -@@ -623,7 +623,7 @@ public: - // The same mechanism is used to attach user data to a menu - // ------------------------------------------------------------------------- - // --template class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu -+template class NCURSES_CXX_IMPEXP NCursesUserMenu : public NCursesMenu - { - protected: - NCursesUserMenu( int nlines, -diff --git a/c++/cursesp.h b/c++/cursesp.h -index d1eea968..af97b022 100644 ---- a/c++/cursesmain.cc -+++ b/c++/cursesmain.cc -@@ -60,7 +60,7 @@ MODULE_ID("$Id: cursesmain.cc,v 1.18 2020/04/04 23:25:34 tom Exp $") - * You only have to instantiate a static NCursesApplication object in your - * main application source file and link this module with your application. - */ --int main(int argc, char* argv[]) -+NCURSES_CXX_IMPEXP int main(int argc, char* argv[]) - { - setlocale(LC_ALL, ""); - ---- a/c++/cursesp.h -+++ b/c++/cursesp.h -@@ -43,7 +43,7 @@ extern "C" { - # include - } - --class NCURSES_IMPEXP NCursesPanel -+class NCURSES_CXX_IMPEXP NCursesPanel - : public NCursesWindow - { - protected: -diff --git a/c++/cursesw.h b/c++/cursesw.h -index 10a2da7e..62721495 100644 ---- a/c++/cursesw.h -+++ b/c++/cursesw.h -@@ -38,6 +38,19 @@ extern "C" { - # include - } - -+#include "ncurses_exports.h" -+ -+#if defined(BUILDING_NCURSES_CXX) -+# define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT -+#endif -+ -+#define NCURSES_CXX_WRAPPED_VAR(type,name) extern NCURSES_CXX_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ -+#define NCURSES_CXX_EXPORT(type) NCURSES_CXX_IMPEXP type NCURSES_API -+#define NCURSES_CXX_EXPORT_VAR(type) NCURSES_CXX_IMPEXP type -+ - #include - - /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. -@@ -757,7 +770,7 @@ extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int)); - extern "C" int _nc_xx_ripoff_init(WINDOW *, int); - extern "C" int _nc_has_mouse(void); - --class NCURSES_IMPEXP NCursesWindow -+class NCURSES_CXX_IMPEXP NCursesWindow - { - friend class NCursesMenu; - friend class NCursesForm; -@@ -1371,7 +1384,7 @@ public: - // ------------------------------------------------------------------------- - // We leave this here for compatibility reasons. - // ------------------------------------------------------------------------- --class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow -+class NCURSES_CXX_IMPEXP NCursesColorWindow : public NCursesWindow - { - public: - NCursesColorWindow(WINDOW* &window) // useful only for stdscr -@@ -1417,7 +1430,7 @@ public: - // Pad Support. We allow an association of a pad with a "real" window - // through which the pad may be viewed. - // ------------------------------------------------------------------------- --class NCURSES_IMPEXP NCursesPad : public NCursesWindow -+class NCURSES_CXX_IMPEXP NCursesPad : public NCursesWindow - { - private: - NCursesWindow* viewWin; // the "viewport" window -@@ -1533,7 +1546,7 @@ public: - // A FramedPad is constructed always with a viewport window. This viewport - // will be framed (by a box() command) and the interior of the box is the - // viewport subwindow. On the frame we display scrollbar sliders. --class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad -+class NCURSES_CXX_IMPEXP NCursesFramedPad : public NCursesPad - { - protected: - virtual void OnOperation(int pad_req); -diff --git a/c++/cursslk.h b/c++/cursslk.h -index 10364c1d..d69f27d5 100644 ---- a/c++/cursslk.h -+++ b/c++/cursslk.h -@@ -39,10 +39,10 @@ - - #include - --class NCURSES_IMPEXP Soft_Label_Key_Set { -+class NCURSES_CXX_IMPEXP Soft_Label_Key_Set { - public: - // This inner class represents the attributes of a Soft Label Key (SLK) -- class NCURSES_IMPEXP Soft_Label_Key { -+ class NCURSES_CXX_IMPEXP Soft_Label_Key { - friend class Soft_Label_Key_Set; - public: - typedef enum { Left=0, Center=1, Right=2 } Justification; -diff --git a/c++/demo.cc b/c++/demo.cc -index 2b5451a4..b5480808 100644 ---- a/c++/demo.cc -+++ b/c++/demo.cc -@@ -187,7 +187,7 @@ public: - }; - - template class MyAction; --template class NCURSES_IMPEXP NCursesUserItem; -+template class NCURSES_CXX_IMPEXP NCursesUserItem; - - class QuitItem : public NCursesMenuItem - { -diff --git a/c++/etip.h.in b/c++/etip.h.in -index 1155c5fd..65a5b450 100644 ---- a/c++/etip.h.in -+++ b/c++/etip.h.in -@@ -140,11 +140,11 @@ extern "C" { - #endif - - // Forward Declarations --class NCURSES_IMPEXP NCursesPanel; --class NCURSES_IMPEXP NCursesMenu; --class NCURSES_IMPEXP NCursesForm; -+class NCURSES_CXX_IMPEXP NCursesPanel; -+class NCURSES_CXX_IMPEXP NCursesMenu; -+class NCURSES_CXX_IMPEXP NCursesForm; - --class NCURSES_IMPEXP NCursesException -+class NCURSES_CXX_IMPEXP NCursesException - { - public: - const char *message; -@@ -178,7 +178,7 @@ public: - } - }; - --class NCURSES_IMPEXP NCursesPanelException : public NCursesException -+class NCURSES_CXX_IMPEXP NCursesPanelException : public NCursesException - { - public: - const NCursesPanel* p; -@@ -229,7 +229,7 @@ public: - } - }; - --class NCURSES_IMPEXP NCursesMenuException : public NCursesException -+class NCURSES_CXX_IMPEXP NCursesMenuException : public NCursesException - { - public: - const NCursesMenu* m; -@@ -280,7 +280,7 @@ public: - } - }; - --class NCURSES_IMPEXP NCursesFormException : public NCursesException -+class NCURSES_CXX_IMPEXP NCursesFormException : public NCursesException - { - public: - const NCursesForm* f; -diff --git a/form/f_trace.c b/form/f_trace.c -index d24708ce..6efc5225 100644 ---- a/form/f_trace.c -+++ b/form/f_trace.c -@@ -35,35 +35,35 @@ - - MODULE_ID("$Id: f_trace.c,v 1.5 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(FIELD **) -+FORM_EXPORT(FIELD **) - _nc_retrace_field_ptr(FIELD **code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - _nc_retrace_field(FIELD *code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_retrace_field_type(FIELDTYPE *code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(FORM *) -+FORM_EXPORT(FORM *) - _nc_retrace_form(FORM *code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(Form_Hook) -+FORM_EXPORT(Form_Hook) - _nc_retrace_form_hook(Form_Hook code) - { - TR_FUNC_BFR(1); -diff --git a/form/fld_arg.c b/form/fld_arg.c -index e7555f65..852cd6a8 100644 ---- a/form/fld_arg.c -+++ b/form/fld_arg.c -@@ -61,7 +61,7 @@ MODULE_ID("$Id: fld_arg.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid argument - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_fieldtype_arg(FIELDTYPE *typ, - void *(*const make_arg)(va_list *), - void *(*const copy_arg)(const void *), -@@ -94,7 +94,7 @@ set_fieldtype_arg(FIELDTYPE *typ, - | - | Return Values : Pointer to structure or NULL if none is defined. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+FORM_EXPORT(void *) - field_arg(const FIELD *field) - { - T((T_CALLED("field_arg(%p)"), (const void *)field)); -diff --git a/form/fld_attr.c b/form/fld_attr.c -index 50e2c73d..c974f72d 100644 ---- a/form/fld_attr.c -+++ b/form/fld_attr.c -@@ -40,7 +40,7 @@ MODULE_ID("$Id: fld_attr.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - --------------------------------------------------------------------------*/ - /* "Template" macro to generate a function to set a fields attribute */ - #define GEN_FIELD_ATTR_SET_FCT( name ) \ --NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ -+FORM_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ - {\ - int res = E_BAD_ARGUMENT;\ - T((T_CALLED("set_field_" #name "(%p,%s)"), (void *)field, _traceattr(attr)));\ -@@ -65,7 +65,7 @@ NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ - - /* "Template" macro to generate a function to get a fields attribute */ - #define GEN_FIELD_ATTR_GET_FCT( name ) \ --NCURSES_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\ -+FORM_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\ - {\ - T((T_CALLED("field_" #name "(%p)"), (const void *) field));\ - returnAttr( A_ATTRIBUTES & (Normalize_Field( field ) -> name) );\ -diff --git a/form/fld_current.c b/form/fld_current.c -index 75e68edd..14e80e34 100644 ---- a/form/fld_current.c -+++ b/form/fld_current.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: fld_current.c,v 1.15 2020/02/02 23:34:34 tom Exp $") - | E_INVALID_FIELD - current field can't be left - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_current_field(FORM *form, FIELD *field) - { - int err = E_OK; -@@ -113,7 +113,7 @@ set_current_field(FORM *form, FIELD *field) - | E_BAD_ARGUMENT - invalid form pointer - | E_REQUEST_DENIED - there is no current field to unfocus - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - unfocus_current_field(FORM *const form) - { - T((T_CALLED("unfocus_current_field(%p)"), (const void *)form)); -@@ -137,7 +137,7 @@ unfocus_current_field(FORM *const form) - | - | Return Values : Pointer to the current field. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - current_field(const FORM *form) - { - T((T_CALLED("current_field(%p)"), (const void *)form)); -@@ -154,7 +154,7 @@ current_field(const FORM *form) - | Return Values : >= 0 : field index - | -1 : fieldpointer invalid or field not connected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_index(const FIELD *field) - { - T((T_CALLED("field_index(%p)"), (const void *)field)); -diff --git a/form/fld_def.c b/form/fld_def.c -index e529b3c0..a9d2abf7 100644 ---- a/form/fld_def.c -+++ b/form/fld_def.c -@@ -66,7 +66,7 @@ static FIELD default_field = - NCURSES_FIELD_EXTENSION - }; - --NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; -+FORM_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; - - /*--------------------------------------------------------------------------- - | Facility : libnform -@@ -82,7 +82,7 @@ NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; - | Return Values : Pointer to argument structure. Maybe NULL. - | In case of an error in *err an error counter is increased. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(TypeArgument *) -+FORM_EXPORT(TypeArgument *) - _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) - { - TypeArgument *res = (TypeArgument *)0; -@@ -130,7 +130,7 @@ _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) - | Return Values : Pointer to argument structure. Maybe NULL. - | In case of an error in *err an error counter is increased. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(TypeArgument *) -+FORM_EXPORT(TypeArgument *) - _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err) - { - TypeArgument *res = (TypeArgument *)0; -@@ -179,7 +179,7 @@ _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+FORM_EXPORT(void) - _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp) - { - if (typ != 0 && (typ->status & _HAS_ARGS) != 0) -@@ -212,7 +212,7 @@ _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp) - | Return Values : TRUE - copy worked - | FALSE - error occurred - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - _nc_Copy_Type(FIELD *dst, FIELD const *src) - { - int err = 0; -@@ -247,7 +247,7 @@ _nc_Copy_Type(FIELD *dst, FIELD const *src) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+FORM_EXPORT(void) - _nc_Free_Type(FIELD *field) - { - assert(field != 0); -@@ -274,7 +274,7 @@ _nc_Free_Type(FIELD *field) - | - | Return Values : Pointer to the new field or NULL if failure. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) - { - static const FIELD_CELL blank = BLANK; -@@ -354,7 +354,7 @@ new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) - | E_BAD_ARGUMENT - invalid field pointer - | E_CONNECTED - field is connected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - free_field(FIELD *field) - { - T((T_CALLED("free_field(%p)"), (void *)field)); -diff --git a/form/fld_dup.c b/form/fld_dup.c -index 9859a09f..08356b13 100644 ---- a/form/fld_dup.c -+++ b/form/fld_dup.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: fld_dup.c,v 1.15 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : Pointer to the new field or NULL if failure - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - dup_field(FIELD *field, int frow, int fcol) - { - FIELD *New_Field = (FIELD *)0; -diff --git a/form/fld_ftchoice.c b/form/fld_ftchoice.c -index 5dc5f4a9..4119e76e 100644 ---- a/form/fld_ftchoice.c -+++ b/form/fld_ftchoice.c -@@ -47,7 +47,7 @@ MODULE_ID("$Id: fld_ftchoice.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid arguments - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_fieldtype_choice(FIELDTYPE *typ, - bool (*const next_choice) (FIELD *, const void *), - bool (*const prev_choice) (FIELD *, const void *)) -diff --git a/form/fld_ftlink.c b/form/fld_ftlink.c -index afa488b3..23bf0912 100644 ---- a/form/fld_ftlink.c -+++ b/form/fld_ftlink.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: fld_ftlink.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : Fieldtype pointer or NULL if error occurred. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - link_fieldtype(FIELDTYPE *type1, FIELDTYPE *type2) - { - FIELDTYPE *nftyp = (FIELDTYPE *)0; -diff --git a/form/fld_info.c b/form/fld_info.c -index 9963b5b3..34defdea 100644 ---- a/form/fld_info.c -+++ b/form/fld_info.c -@@ -47,7 +47,7 @@ MODULE_ID("$Id: fld_info.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid field pointer - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_info(const FIELD *field, - int *rows, int *cols, - int *frow, int *fcol, -@@ -89,7 +89,7 @@ field_info(const FIELD *field, - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid argument - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - dynamic_field_info(const FIELD *field, int *drows, int *dcols, int *maxgrow) - { - T((T_CALLED("dynamic_field_info(%p,%p,%p,%p)"), -diff --git a/form/fld_just.c b/form/fld_just.c -index 8097019d..f15cdcaa 100644 ---- a/form/fld_just.c -+++ b/form/fld_just.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: fld_just.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - one of the arguments was incorrect - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_just(FIELD *field, int just) - { - int res = E_BAD_ARGUMENT; -@@ -77,7 +77,7 @@ set_field_just(FIELD *field, int just) - | - | Return Values : The justification type. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_just(const FIELD *field) - { - T((T_CALLED("field_just(%p)"), (const void *)field)); -diff --git a/form/fld_link.c b/form/fld_link.c -index cb67ac07..b6f4ff75 100644 ---- a/form/fld_link.c -+++ b/form/fld_link.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: fld_link.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : Pointer to the new field or NULL if failure - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - link_field(FIELD *field, int frow, int fcol) - { - FIELD *New_Field = (FIELD *)0; -diff --git a/form/fld_max.c b/form/fld_max.c -index 7d0e146d..8fb873b5 100644 ---- a/form/fld_max.c -+++ b/form/fld_max.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: fld_max.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid argument - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_max_field(FIELD *field, int maxgrow) - { - T((T_CALLED("set_max_field(%p,%d)"), (void *)field, maxgrow)); -diff --git a/form/fld_move.c b/form/fld_move.c -index 0d6692f3..245f26c1 100644 ---- a/form/fld_move.c -+++ b/form/fld_move.c -@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_move.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid argument passed - | E_CONNECTED - field is connected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - move_field(FIELD *field, int frow, int fcol) - { - T((T_CALLED("move_field(%p,%d,%d)"), (void *)field, frow, fcol)); -diff --git a/form/fld_newftyp.c b/form/fld_newftyp.c -index 18a7c073..53162f33 100644 ---- a/form/fld_newftyp.c -+++ b/form/fld_newftyp.c -@@ -53,7 +53,7 @@ static FIELDTYPE default_fieldtype = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE *) -+FORM_EXPORT_VAR(FIELDTYPE *) - _nc_Default_FieldType = &default_fieldtype; - - /*--------------------------------------------------------------------------- -@@ -71,7 +71,7 @@ NCURSES_EXPORT_VAR(FIELDTYPE *) - | - | Return Values : Fieldtype pointer or NULL if error occurred - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - new_fieldtype(bool (*const field_check) (FIELD *, const void *), - bool (*const char_check) (int, const void *)) - { -@@ -121,7 +121,7 @@ new_fieldtype(bool (*const field_check) (FIELD *, const void *), - | E_CONNECTED - there are fields referencing the type - | E_BAD_ARGUMENT - invalid fieldtype pointer - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - free_fieldtype(FIELDTYPE *typ) - { - T((T_CALLED("free_fieldtype(%p)"), (void *)typ)); -diff --git a/form/fld_opts.c b/form/fld_opts.c -index fee5804a..17ab8027 100644 ---- a/form/fld_opts.c -+++ b/form/fld_opts.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: fld_opts.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid options - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_opts(FIELD *field, Field_Options opts) - { - int res = E_BAD_ARGUMENT; -@@ -72,7 +72,7 @@ set_field_opts(FIELD *field, Field_Options opts) - | - | Return Values : The options. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(Field_Options) -+FORM_EXPORT(Field_Options) - field_opts(const FIELD *field) - { - T((T_CALLED("field_opts(%p)"), (const void *)field)); -@@ -92,7 +92,7 @@ field_opts(const FIELD *field) - | E_BAD_ARGUMENT - invalid options - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_opts_on(FIELD *field, Field_Options opts) - { - int res = E_BAD_ARGUMENT; -@@ -120,7 +120,7 @@ field_opts_on(FIELD *field, Field_Options opts) - | E_BAD_ARGUMENT - invalid options - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_opts_off(FIELD *field, Field_Options opts) - { - int res = E_BAD_ARGUMENT; -diff --git a/form/fld_pad.c b/form/fld_pad.c -index b6d59e2c..260ec407 100644 ---- a/form/fld_pad.c -+++ b/form/fld_pad.c -@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_pad.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid field pointer or pad character - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_pad(FIELD *field, int ch) - { - int res = E_BAD_ARGUMENT; -@@ -75,7 +75,7 @@ set_field_pad(FIELD *field, int ch) - | - | Return Values : The pad character. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_pad(const FIELD *field) - { - T((T_CALLED("field_pad(%p)"), (const void *)field)); -diff --git a/form/fld_page.c b/form/fld_page.c -index c6fb37c8..7310202c 100644 ---- a/form/fld_page.c -+++ b/form/fld_page.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: fld_page.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_CONNECTED - field is connected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_new_page(FIELD *field, bool new_page_flag) - { - T((T_CALLED("set_new_page(%p,%d)"), (void *)field, new_page_flag)); -@@ -72,7 +72,7 @@ set_new_page(FIELD *field, bool new_page_flag) - | Return Values : TRUE - field starts a new page - | FALSE - field doesn't start a new page - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - new_page(const FIELD *field) - { - T((T_CALLED("new_page(%p)"), (const void *)field)); -diff --git a/form/fld_stat.c b/form/fld_stat.c -index 487a21dc..19000af2 100644 ---- a/form/fld_stat.c -+++ b/form/fld_stat.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: fld_stat.c,v 1.15 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_status(FIELD *field, bool status) - { - T((T_CALLED("set_field_status(%p,%d)"), (void *)field, status)); -@@ -69,7 +69,7 @@ set_field_status(FIELD *field, bool status) - | Return Values : TRUE - buffer has been changed - | FALSE - buffer has not been changed - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - field_status(const FIELD *field) - { - T((T_CALLED("field_status(%p)"), (const void *)field)); -diff --git a/form/fld_type.c b/form/fld_type.c -index a445fa4d..69ebe4ca 100644 ---- a/form/fld_type.c -+++ b/form/fld_type.c -@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_type.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_type(FIELD *field, FIELDTYPE *type,...) - { - va_list ap; -@@ -88,7 +88,7 @@ set_field_type(FIELD *field, FIELDTYPE *type,...) - | - | Return Values : Pointer to fieldtype of NULL if none is defined. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - field_type(const FIELD *field) - { - T((T_CALLED("field_type(%p)"), (const void *)field)); -diff --git a/form/fld_user.c b/form/fld_user.c -index 5cd165c8..2deb68e6 100644 ---- a/form/fld_user.c -+++ b/form/fld_user.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: fld_user.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - on success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_userptr(FIELD *field, void *usrptr) - { - T((T_CALLED("set_field_userptr(%p,%p)"), (void *)field, (void *)usrptr)); -@@ -63,7 +63,7 @@ set_field_userptr(FIELD *field, void *usrptr) - | Return Values : Value of pointer. If no such pointer has been set, - | NULL is returned - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+FORM_EXPORT(void *) - field_userptr(const FIELD *field) - { - T((T_CALLED("field_userptr(%p)"), (const void *)field)); -diff --git a/form/form.h b/form/form.h -index dabe6764..3c584357 100644 ---- a/form/form.h -+++ b/form/form.h -@@ -44,6 +44,19 @@ - extern "C" { - #endif - -+#include "ncurses_exports.h" -+ -+#if defined(BUILDING_FORM) -+# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT -+#endif -+ -+#define FORM_WRAPPED_VAR(type,name) extern FORM_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ -+#define FORM_EXPORT(type) FORM_IMPEXP type NCURSES_API -+#define FORM_EXPORT_VAR(type) FORM_IMPEXP type -+ - #ifndef FORM_PRIV_H - typedef void *FIELD_CELL; - #endif -@@ -309,136 +322,136 @@ typedef void (*Form_Hook)(FORM *); - /************************* - * standard field types * - *************************/ --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; - - /************************************ - * built-in additional field types * - * They are not defined in SVr4 * - ************************************/ --extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ -+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ - - /*********************** - * FIELDTYPE routines * - ***********************/ --extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype ( -+extern FORM_EXPORT(FIELDTYPE *) new_fieldtype ( - bool (* const field_check)(FIELD *,const void *), - bool (* const char_check)(int,const void *)); --extern NCURSES_EXPORT(FIELDTYPE *) link_fieldtype( -+extern FORM_EXPORT(FIELDTYPE *) link_fieldtype( - FIELDTYPE *, FIELDTYPE *); - --extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *); --extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, -+extern FORM_EXPORT(int) free_fieldtype (FIELDTYPE *); -+extern FORM_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, - void * (* const make_arg)(va_list *), - void * (* const copy_arg)(const void *), - void (* const free_arg)(void *)); --extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, -+extern FORM_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, - bool (* const next_choice)(FIELD *,const void *), - bool (* const prev_choice)(FIELD *,const void *)); - - /******************* - * FIELD routines * - *******************/ --extern NCURSES_EXPORT(FIELD *) new_field (int,int,int,int,int,int); --extern NCURSES_EXPORT(FIELD *) dup_field (FIELD *,int,int); --extern NCURSES_EXPORT(FIELD *) link_field (FIELD *,int,int); -- --extern NCURSES_EXPORT(int) free_field (FIELD *); --extern NCURSES_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); --extern NCURSES_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); --extern NCURSES_EXPORT(int) set_max_field ( FIELD *,int); --extern NCURSES_EXPORT(int) move_field (FIELD *,int,int); --extern NCURSES_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); --extern NCURSES_EXPORT(int) set_new_page (FIELD *,bool); --extern NCURSES_EXPORT(int) set_field_just (FIELD *,int); --extern NCURSES_EXPORT(int) field_just (const FIELD *); --extern NCURSES_EXPORT(int) set_field_fore (FIELD *,chtype); --extern NCURSES_EXPORT(int) set_field_back (FIELD *,chtype); --extern NCURSES_EXPORT(int) set_field_pad (FIELD *,int); --extern NCURSES_EXPORT(int) field_pad (const FIELD *); --extern NCURSES_EXPORT(int) set_field_buffer (FIELD *,int,const char *); --extern NCURSES_EXPORT(int) set_field_status (FIELD *,bool); --extern NCURSES_EXPORT(int) set_field_userptr (FIELD *, void *); --extern NCURSES_EXPORT(int) set_field_opts (FIELD *,Field_Options); --extern NCURSES_EXPORT(int) field_opts_on (FIELD *,Field_Options); --extern NCURSES_EXPORT(int) field_opts_off (FIELD *,Field_Options); -- --extern NCURSES_EXPORT(chtype) field_fore (const FIELD *); --extern NCURSES_EXPORT(chtype) field_back (const FIELD *); -- --extern NCURSES_EXPORT(bool) new_page (const FIELD *); --extern NCURSES_EXPORT(bool) field_status (const FIELD *); -- --extern NCURSES_EXPORT(void *) field_arg (const FIELD *); -- --extern NCURSES_EXPORT(void *) field_userptr (const FIELD *); -- --extern NCURSES_EXPORT(FIELDTYPE *) field_type (const FIELD *); -- --extern NCURSES_EXPORT(char *) field_buffer (const FIELD *,int); -- --extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *); -+extern FORM_EXPORT(FIELD *) new_field (int,int,int,int,int,int); -+extern FORM_EXPORT(FIELD *) dup_field (FIELD *,int,int); -+extern FORM_EXPORT(FIELD *) link_field (FIELD *,int,int); -+ -+extern FORM_EXPORT(int) free_field (FIELD *); -+extern FORM_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); -+extern FORM_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); -+extern FORM_EXPORT(int) set_max_field ( FIELD *,int); -+extern FORM_EXPORT(int) move_field (FIELD *,int,int); -+extern FORM_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); -+extern FORM_EXPORT(int) set_new_page (FIELD *,bool); -+extern FORM_EXPORT(int) set_field_just (FIELD *,int); -+extern FORM_EXPORT(int) field_just (const FIELD *); -+extern FORM_EXPORT(int) set_field_fore (FIELD *,chtype); -+extern FORM_EXPORT(int) set_field_back (FIELD *,chtype); -+extern FORM_EXPORT(int) set_field_pad (FIELD *,int); -+extern FORM_EXPORT(int) field_pad (const FIELD *); -+extern FORM_EXPORT(int) set_field_buffer (FIELD *,int,const char *); -+extern FORM_EXPORT(int) set_field_status (FIELD *,bool); -+extern FORM_EXPORT(int) set_field_userptr (FIELD *, void *); -+extern FORM_EXPORT(int) set_field_opts (FIELD *,Field_Options); -+extern FORM_EXPORT(int) field_opts_on (FIELD *,Field_Options); -+extern FORM_EXPORT(int) field_opts_off (FIELD *,Field_Options); -+ -+extern FORM_EXPORT(chtype) field_fore (const FIELD *); -+extern FORM_EXPORT(chtype) field_back (const FIELD *); -+ -+extern FORM_EXPORT(bool) new_page (const FIELD *); -+extern FORM_EXPORT(bool) field_status (const FIELD *); -+ -+extern FORM_EXPORT(void *) field_arg (const FIELD *); -+ -+extern FORM_EXPORT(void *) field_userptr (const FIELD *); -+ -+extern FORM_EXPORT(FIELDTYPE *) field_type (const FIELD *); -+ -+extern FORM_EXPORT(char *) field_buffer (const FIELD *,int); -+ -+extern FORM_EXPORT(Field_Options) field_opts (const FIELD *); - - /****************** - * FORM routines * - ******************/ - --extern NCURSES_EXPORT(FORM *) new_form (FIELD **); -- --extern NCURSES_EXPORT(FIELD **) form_fields (const FORM *); --extern NCURSES_EXPORT(FIELD *) current_field (const FORM *); -- --extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *); --extern NCURSES_EXPORT(WINDOW *) form_sub (const FORM *); -- --extern NCURSES_EXPORT(Form_Hook) form_init (const FORM *); --extern NCURSES_EXPORT(Form_Hook) form_term (const FORM *); --extern NCURSES_EXPORT(Form_Hook) field_init (const FORM *); --extern NCURSES_EXPORT(Form_Hook) field_term (const FORM *); -- --extern NCURSES_EXPORT(int) free_form (FORM *); --extern NCURSES_EXPORT(int) set_form_fields (FORM *,FIELD **); --extern NCURSES_EXPORT(int) field_count (const FORM *); --extern NCURSES_EXPORT(int) set_form_win (FORM *,WINDOW *); --extern NCURSES_EXPORT(int) set_form_sub (FORM *,WINDOW *); --extern NCURSES_EXPORT(int) set_current_field (FORM *,FIELD *); --extern NCURSES_EXPORT(int) unfocus_current_field (FORM *); --extern NCURSES_EXPORT(int) field_index (const FIELD *); --extern NCURSES_EXPORT(int) set_form_page (FORM *,int); --extern NCURSES_EXPORT(int) form_page (const FORM *); --extern NCURSES_EXPORT(int) scale_form (const FORM *,int *,int *); --extern NCURSES_EXPORT(int) set_form_init (FORM *,Form_Hook); --extern NCURSES_EXPORT(int) set_form_term (FORM *,Form_Hook); --extern NCURSES_EXPORT(int) set_field_init (FORM *,Form_Hook); --extern NCURSES_EXPORT(int) set_field_term (FORM *,Form_Hook); --extern NCURSES_EXPORT(int) post_form (FORM *); --extern NCURSES_EXPORT(int) unpost_form (FORM *); --extern NCURSES_EXPORT(int) pos_form_cursor (FORM *); --extern NCURSES_EXPORT(int) form_driver (FORM *,int); -+extern FORM_EXPORT(FORM *) new_form (FIELD **); -+ -+extern FORM_EXPORT(FIELD **) form_fields (const FORM *); -+extern FORM_EXPORT(FIELD *) current_field (const FORM *); -+ -+extern FORM_EXPORT(WINDOW *) form_win (const FORM *); -+extern FORM_EXPORT(WINDOW *) form_sub (const FORM *); -+ -+extern FORM_EXPORT(Form_Hook) form_init (const FORM *); -+extern FORM_EXPORT(Form_Hook) form_term (const FORM *); -+extern FORM_EXPORT(Form_Hook) field_init (const FORM *); -+extern FORM_EXPORT(Form_Hook) field_term (const FORM *); -+ -+extern FORM_EXPORT(int) free_form (FORM *); -+extern FORM_EXPORT(int) set_form_fields (FORM *,FIELD **); -+extern FORM_EXPORT(int) field_count (const FORM *); -+extern FORM_EXPORT(int) set_form_win (FORM *,WINDOW *); -+extern FORM_EXPORT(int) set_form_sub (FORM *,WINDOW *); -+extern FORM_EXPORT(int) set_current_field (FORM *,FIELD *); -+extern FORM_EXPORT(int) unfocus_current_field (FORM *); -+extern FORM_EXPORT(int) field_index (const FIELD *); -+extern FORM_EXPORT(int) set_form_page (FORM *,int); -+extern FORM_EXPORT(int) form_page (const FORM *); -+extern FORM_EXPORT(int) scale_form (const FORM *,int *,int *); -+extern FORM_EXPORT(int) set_form_init (FORM *,Form_Hook); -+extern FORM_EXPORT(int) set_form_term (FORM *,Form_Hook); -+extern FORM_EXPORT(int) set_field_init (FORM *,Form_Hook); -+extern FORM_EXPORT(int) set_field_term (FORM *,Form_Hook); -+extern FORM_EXPORT(int) post_form (FORM *); -+extern FORM_EXPORT(int) unpost_form (FORM *); -+extern FORM_EXPORT(int) pos_form_cursor (FORM *); -+extern FORM_EXPORT(int) form_driver (FORM *,int); - # if NCURSES_WIDECHAR --extern NCURSES_EXPORT(int) form_driver_w (FORM *,int,wchar_t); -+extern FORM_EXPORT(int) form_driver_w (FORM *,int,wchar_t); - # endif --extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *); --extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options); --extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options); --extern NCURSES_EXPORT(int) form_opts_off (FORM *,Form_Options); --extern NCURSES_EXPORT(int) form_request_by_name (const char *); -+extern FORM_EXPORT(int) set_form_userptr (FORM *,void *); -+extern FORM_EXPORT(int) set_form_opts (FORM *,Form_Options); -+extern FORM_EXPORT(int) form_opts_on (FORM *,Form_Options); -+extern FORM_EXPORT(int) form_opts_off (FORM *,Form_Options); -+extern FORM_EXPORT(int) form_request_by_name (const char *); - --extern NCURSES_EXPORT(const char *) form_request_name (int); -+extern FORM_EXPORT(const char *) form_request_name (int); - --extern NCURSES_EXPORT(void *) form_userptr (const FORM *); -+extern FORM_EXPORT(void *) form_userptr (const FORM *); - --extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *); -+extern FORM_EXPORT(Form_Options) form_opts (const FORM *); - --extern NCURSES_EXPORT(bool) data_ahead (const FORM *); --extern NCURSES_EXPORT(bool) data_behind (const FORM *); -+extern FORM_EXPORT(bool) data_ahead (const FORM *); -+extern FORM_EXPORT(bool) data_behind (const FORM *); - - #if NCURSES_SP_FUNCS --extern NCURSES_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **); -+extern FORM_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **); - #endif - - #ifdef __cplusplus -diff --git a/form/form.priv.h b/form/form.priv.h -index 53c717c6..fe60b91a 100644 ---- a/form/form.priv.h -+++ b/form/form.priv.h -@@ -69,9 +69,9 @@ - /*********************** - * Default objects * - ***********************/ --extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form; --extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field; --extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType; -+extern FORM_EXPORT_VAR(FORM *) _nc_Default_Form; -+extern FORM_EXPORT_VAR(FIELD *) _nc_Default_Field; -+extern FORM_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType; - - /* form status values */ - #define _OVLMODE (0x04U) /* Form is in overlay mode */ -@@ -176,32 +176,32 @@ TypeArgument; - - #define C_ZEROS '\0' - --extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*); --extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*); --extern NCURSES_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*); --extern NCURSES_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *); --extern NCURSES_EXPORT(void) _nc_Free_Type (FIELD *); -- --extern NCURSES_EXPORT(int) _nc_Synchronize_Attributes (FIELD*); --extern NCURSES_EXPORT(int) _nc_Synchronize_Options (FIELD*, Field_Options); --extern NCURSES_EXPORT(int) _nc_Set_Form_Page (FORM*, int, FIELD*); --extern NCURSES_EXPORT(int) _nc_Refresh_Current_Field (FORM*); --extern NCURSES_EXPORT(FIELD *) _nc_First_Active_Field (FORM*); --extern NCURSES_EXPORT(bool) _nc_Internal_Validation (FORM*); --extern NCURSES_EXPORT(int) _nc_Set_Current_Field (FORM*, FIELD*); --extern NCURSES_EXPORT(int) _nc_Position_Form_Cursor (FORM*); --extern NCURSES_EXPORT(void) _nc_Unset_Current_Field(FORM *form); -+extern FORM_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*); -+extern FORM_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*); -+extern FORM_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*); -+extern FORM_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *); -+extern FORM_EXPORT(void) _nc_Free_Type (FIELD *); -+ -+extern FORM_EXPORT(int) _nc_Synchronize_Attributes (FIELD*); -+extern FORM_EXPORT(int) _nc_Synchronize_Options (FIELD*, Field_Options); -+extern FORM_EXPORT(int) _nc_Set_Form_Page (FORM*, int, FIELD*); -+extern FORM_EXPORT(int) _nc_Refresh_Current_Field (FORM*); -+extern FORM_EXPORT(FIELD *) _nc_First_Active_Field (FORM*); -+extern FORM_EXPORT(bool) _nc_Internal_Validation (FORM*); -+extern FORM_EXPORT(int) _nc_Set_Current_Field (FORM*, FIELD*); -+extern FORM_EXPORT(int) _nc_Position_Form_Cursor (FORM*); -+extern FORM_EXPORT(void) _nc_Unset_Current_Field(FORM *form); - - #if NCURSES_INTEROP_FUNCS --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALNUM(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALPHA(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ENUM(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_NUMERIC(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void); -- --extern NCURSES_EXPORT(FIELDTYPE *) -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ALNUM(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ALPHA(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ENUM(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_NUMERIC(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void); -+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void); -+ -+extern FORM_EXPORT(FIELDTYPE *) - _nc_generic_fieldtype(bool (*const field_check) (FORM*, - FIELD *, - const void *), -@@ -212,18 +212,18 @@ _nc_generic_fieldtype(bool (*const field_check) (FORM*, - bool (*const next)(FORM*,FIELD*,const void*), - bool (*const prev)(FORM*,FIELD*,const void*), - void (*freecallback)(void*)); --extern NCURSES_EXPORT(int) _nc_set_generic_fieldtype(FIELD*, FIELDTYPE*, int (*)(void**)); --extern NCURSES_EXPORT(WINDOW*) _nc_form_cursor(const FORM* , int* , int* ); -+extern FORM_EXPORT(int) _nc_set_generic_fieldtype(FIELD*, FIELDTYPE*, int (*)(void**)); -+extern FORM_EXPORT(WINDOW*) _nc_form_cursor(const FORM* , int* , int* ); - - #define INIT_FT_FUNC(func) {func} - #else - #define INIT_FT_FUNC(func) func - #endif - --extern NCURSES_EXPORT(void) _nc_get_fieldbuffer(FORM*, FIELD*, FIELD_CELL*); -+extern FORM_EXPORT(void) _nc_get_fieldbuffer(FORM*, FIELD*, FIELD_CELL*); - - #if USE_WIDEC_SUPPORT --extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); -+extern FORM_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); - #endif - - #ifdef TRACE -@@ -234,11 +234,11 @@ extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); - #define returnFieldType(code) TRACE_RETURN1(code,field_type) - #define returnFormHook(code) TRACE_RETURN1(code,form_hook) - --extern NCURSES_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **); --extern NCURSES_EXPORT(FIELD *) _nc_retrace_field (FIELD *); --extern NCURSES_EXPORT(FIELDTYPE *) _nc_retrace_field_type (FIELDTYPE *); --extern NCURSES_EXPORT(FORM *) _nc_retrace_form (FORM *); --extern NCURSES_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook); -+extern FORM_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **); -+extern FORM_EXPORT(FIELD *) _nc_retrace_field (FIELD *); -+extern FORM_EXPORT(FIELDTYPE *) _nc_retrace_field_type (FIELDTYPE *); -+extern FORM_EXPORT(FORM *) _nc_retrace_form (FORM *); -+extern FORM_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook); - - #else /* !TRACE */ - -diff --git a/form/frm_cursor.c b/form/frm_cursor.c -index 8ff42bf8..8ec64f73 100644 ---- a/form/frm_cursor.c -+++ b/form/frm_cursor.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: frm_cursor.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - Invalid form pointer - | E_NOT_POSTED - Form is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - pos_form_cursor(FORM *form) - { - int res; -diff --git a/form/frm_data.c b/form/frm_data.c -index 5c3b2a04..2860fad7 100644 ---- a/form/frm_data.c -+++ b/form/frm_data.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: frm_data.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | Return Values : TRUE - there are off-screen data behind - | FALSE - there are no off-screen data behind - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - data_behind(const FORM *form) - { - bool result = FALSE; -@@ -132,7 +132,7 @@ Only_Padding(WINDOW *w, int len, int pad) - | Return Values : TRUE - there are off-screen data ahead - | FALSE - there are no off-screen data ahead - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - data_ahead(const FORM *form) - { - bool result = FALSE; -diff --git a/form/frm_def.c b/form/frm_def.c -index 0722d517..273d0441 100644 ---- a/form/frm_def.c -+++ b/form/frm_def.c -@@ -62,7 +62,7 @@ static FORM default_form = - NULL /* fieldterm */ - }; - --NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; -+FORM_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; - - /*--------------------------------------------------------------------------- - | Facility : libnform -@@ -295,7 +295,7 @@ Associate_Fields(FORM *form, FIELD **fields) - | E_CONNECTED - a field is already connected - | E_SYSTEM_ERROR - not enough memory - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FORM *) -+FORM_EXPORT(FORM *) - NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields) - { - int err = E_SYSTEM_ERROR; -@@ -344,7 +344,7 @@ NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields) - | E_SYSTEM_ERROR - not enough memory - +--------------------------------------------------------------------------*/ - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(FORM *) -+FORM_EXPORT(FORM *) - new_form(FIELD **fields) - { - return NCURSES_SP_NAME(new_form) (CURRENT_SCREEN, fields); -@@ -361,7 +361,7 @@ new_form(FIELD **fields) - | E_BAD_ARGUMENT - invalid form pointer - | E_POSTED - form is posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - free_form(FORM *form) - { - T((T_CALLED("free_form(%p)"), (void *)form)); -@@ -392,7 +392,7 @@ free_form(FORM *form) - | E_POSTED - form is posted - | E_SYSTEM_ERROR - not enough memory - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_fields(FORM *form, FIELD **fields) - { - FIELD **old; -@@ -423,7 +423,7 @@ set_form_fields(FORM *form, FIELD **fields) - | - | Return Values : Pointer to field array - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD **) -+FORM_EXPORT(FIELD **) - form_fields(const FORM *form) - { - T((T_CALLED("form_field(%p)"), (const void *)form)); -@@ -438,7 +438,7 @@ form_fields(const FORM *form) - | - | Return Values : Number of fields, -1 if none are defined - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - field_count(const FORM *form) - { - T((T_CALLED("field_count(%p)"), (const void *)form)); -diff --git a/form/frm_driver.c b/form/frm_driver.c -index b9f91e12..7b92a2ad 100644 ---- a/form/frm_driver.c -+++ b/form/frm_driver.c -@@ -548,7 +548,7 @@ Buffer_To_Window(const FIELD *field, WINDOW *win) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+FORM_EXPORT(void) - _nc_get_fieldbuffer(FORM *form, FIELD *field, FIELD_CELL *buf) - { - int pad; -@@ -826,7 +826,7 @@ Field_encloses(FIELD *field, int ry, int rx) - | E_SYSTEM_ERROR - form has no current field or - | field-window - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Position_Form_Cursor(FORM *form) - { - FIELD *field; -@@ -868,7 +868,7 @@ _nc_Position_Form_Cursor(FORM *form) - | E_SYSTEM_ERROR - general error - +--------------------------------------------------------------------------*/ - static bool move_after_insert = TRUE; --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Refresh_Current_Field(FORM *form) - { - WINDOW *formwin; -@@ -1271,7 +1271,7 @@ Synchronize_Linked_Fields(FIELD *field) - | E_BAD_ARGUMENT - invalid field pointer - | E_SYSTEM_ERROR - some severe basic error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Synchronize_Attributes(FIELD *field) - { - FORM *form; -@@ -1338,7 +1338,7 @@ _nc_Synchronize_Attributes(FIELD *field) - | E_CURRENT - field is the current one - | E_SYSTEM_ERROR - some severe basic error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Synchronize_Options(FIELD *field, Field_Options newopts) - { - Field_Options oldopts; -@@ -1491,7 +1491,7 @@ _nc_Unset_Current_Field(FORM *form) - | E_SYSTEM_ERROR - some severe basic error - | E_NOT_CONNECTED - no fields are connected to the form - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Set_Current_Field(FORM *form, FIELD *newfield) - { - FIELD *field; -@@ -3225,7 +3225,7 @@ Check_Field(FORM *form, FIELDTYPE *typ, FIELD *field, TypeArgument *argp) - | Return Values : TRUE - field is valid - | FALSE - field is invalid - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+FORM_EXPORT(bool) - _nc_Internal_Validation(FORM *form) - { - FIELD *field; -@@ -3319,7 +3319,7 @@ Next_Field_On_Page(FIELD *field) - | - | Return Values : Pointer to calculated field. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELD *) -+FORM_EXPORT(FIELD *) - _nc_First_Active_Field(FORM *form) - { - FIELD **last_on_page = &form->field[form->page[form->curpage].pmax]; -@@ -3873,7 +3873,7 @@ FN_Down_Field(FORM *form) - | E_BAD_ARGUMENT - invalid field pointer - | E_SYSTEM_ERROR - some severe basic error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_Set_Form_Page(FORM *form, int page, FIELD *field) - { - int res = E_OK; -@@ -4354,7 +4354,7 @@ static const Binding_Info bindings[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] = - | E_NOT_CONNECTED - no fields are connected to the form - | E_UNKNOWN_COMMAND - command not known - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_driver(FORM *form, int c) - { - const Binding_Info *BI = (Binding_Info *) 0; -@@ -4561,7 +4561,7 @@ form_driver(FORM *form, int c) - | E_NOT_CONNECTED - no fields are connected to the form - | E_UNKNOWN_COMMAND - command not known - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_driver_w(FORM *form, int type, wchar_t c) - { - const Binding_Info *BI = (Binding_Info *) 0; -@@ -4743,7 +4743,7 @@ form_driver_w(FORM *form, int type, wchar_t c) - | E_BAD_ARGUMENT - invalid argument - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_field_buffer(FIELD *field, int buffer, const char *value) - { - FIELD_CELL *p; -@@ -4860,7 +4860,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value) - | - | Return Values : Pointer to buffer or NULL if arguments were invalid. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(char *) -+FORM_EXPORT(char *) - field_buffer(const FIELD *field, int buffer) - { - char *result = 0; -@@ -4928,7 +4928,7 @@ field_buffer(const FIELD *field, int buffer) - | Convert a multibyte string to a wide-character string. The result must be - | freed by the caller. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(wchar_t *) -+FORM_EXPORT(wchar_t *) - _nc_Widen_String(char *source, int *lengthp) - { - wchar_t *result = 0; -diff --git a/form/frm_hook.c b/form/frm_hook.c -index 3051cddc..0feb01c2 100644 ---- a/form/frm_hook.c -+++ b/form/frm_hook.c -@@ -37,7 +37,7 @@ MODULE_ID("$Id: frm_hook.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - - /* "Template" macro to generate function to set application specific hook */ - #define GEN_HOOK_SET_FUNCTION( typ, name ) \ --NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ -+FORM_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ - {\ - TR_FUNC_BFR(1); \ - T((T_CALLED("set_" #typ"_"#name"(%p,%s)"), (void *) form, TR_FUNC_ARG(0, func)));\ -@@ -47,7 +47,7 @@ NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook f - - /* "Template" macro to generate function to get application specific hook */ - #define GEN_HOOK_GET_FUNCTION( typ, name ) \ --NCURSES_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\ -+FORM_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\ - {\ - T((T_CALLED(#typ "_" #name "(%p)"), (const void *) form));\ - returnFormHook( Normalize_Form( form ) -> typ ## name );\ -diff --git a/form/frm_opts.c b/form/frm_opts.c -index 18ab2938..c6455466 100644 ---- a/form/frm_opts.c -+++ b/form/frm_opts.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: frm_opts.c,v 1.18 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_opts(FORM *form, Form_Options opts) - { - T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts)); -@@ -68,7 +68,7 @@ set_form_opts(FORM *form, Form_Options opts) - | - | Return Values : The option flags. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(Form_Options) -+FORM_EXPORT(Form_Options) - form_opts(const FORM *form) - { - T((T_CALLED("form_opts(%p)"), (const void *)form)); -@@ -85,7 +85,7 @@ form_opts(const FORM *form) - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_opts_on(FORM *form, Form_Options opts) - { - T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts)); -@@ -110,7 +110,7 @@ form_opts_on(FORM *form, Form_Options opts) - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_opts_off(FORM *form, Form_Options opts) - { - T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts)); -diff --git a/form/frm_page.c b/form/frm_page.c -index c8569eef..e07655b7 100644 ---- a/form/frm_page.c -+++ b/form/frm_page.c -@@ -47,7 +47,7 @@ MODULE_ID("$Id: frm_page.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | E_INVALID_FIELD - current field can't be left - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_page(FORM *form, int page) - { - int err = E_OK; -@@ -96,7 +96,7 @@ set_form_page(FORM *form, int page) - | Return Values : >= 0 : current page number - | -1 : invalid form pointer - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_page(const FORM *form) - { - T((T_CALLED("form_page(%p)"), (const void *)form)); -diff --git a/form/frm_post.c b/form/frm_post.c -index 2f1ad813..894c7c4c 100644 ---- a/form/frm_post.c -+++ b/form/frm_post.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: frm_post.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | E_NO_ROOM - form doesn't fit into subwindow - | E_SYSTEM_ERROR - system error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - post_form(FORM *form) - { - WINDOW *formwin; -@@ -98,7 +98,7 @@ post_form(FORM *form) - | E_NOT_POSTED - form isn't posted - | E_BAD_STATE - called from a hook routine - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - unpost_form(FORM *form) - { - T((T_CALLED("unpost_form(%p)"), (void *)form)); -diff --git a/form/frm_req_name.c b/form/frm_req_name.c -index 1e56c3dc..2f734f18 100644 ---- a/form/frm_req_name.c -+++ b/form/frm_req_name.c -@@ -120,7 +120,7 @@ static const char request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1][13] = - | Return Values : Pointer to name - on success - | NULL - on invalid request code - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+FORM_EXPORT(const char *) - form_request_name(int request) - { - T((T_CALLED("form_request_name(%d)"), request)); -@@ -143,7 +143,7 @@ form_request_name(int request) - | Return Values : Request Id - on success - | E_NO_MATCH - request not found - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - form_request_by_name(const char *str) - { - /* because the table is so small, it doesn't really hurt -diff --git a/form/frm_scale.c b/form/frm_scale.c -index 34c3611d..e0e025aa 100644 ---- a/form/frm_scale.c -+++ b/form/frm_scale.c -@@ -45,7 +45,7 @@ MODULE_ID("$Id: frm_scale.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid form pointer - | E_NOT_CONNECTED - no fields connected to form - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - scale_form(const FORM *form, int *rows, int *cols) - { - T((T_CALLED("scale_form(%p,%p,%p)"), -diff --git a/form/frm_sub.c b/form/frm_sub.c -index 9621e302..ebfcb10d 100644 ---- a/form/frm_sub.c -+++ b/form/frm_sub.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: frm_sub.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_POSTED - form is posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_sub(FORM *form, WINDOW *win) - { - T((T_CALLED("set_form_sub(%p,%p)"), (void *)form, (void *)win)); -@@ -73,7 +73,7 @@ set_form_sub(FORM *form, WINDOW *win) - | - | Return Values : The pointer to the Subwindow. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+FORM_EXPORT(WINDOW *) - form_sub(const FORM *form) - { - const FORM *f; -diff --git a/form/frm_user.c b/form/frm_user.c -index e1210f2d..2a415fbe 100644 ---- a/form/frm_user.c -+++ b/form/frm_user.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: frm_user.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - on success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_userptr(FORM *form, void *usrptr) - { - T((T_CALLED("set_form_userptr(%p,%p)"), (void *)form, (void *)usrptr)); -@@ -63,7 +63,7 @@ set_form_userptr(FORM *form, void *usrptr) - | Return Values : Value of pointer. If no such pointer has been set, - | NULL is returned - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+FORM_EXPORT(void *) - form_userptr(const FORM *form) - { - T((T_CALLED("form_userptr(%p)"), (const void *)form)); -diff --git a/form/frm_win.c b/form/frm_win.c -index b7d1272d..465ceb3c 100644 ---- a/form/frm_win.c -+++ b/form/frm_win.c -@@ -44,7 +44,7 @@ MODULE_ID("$Id: frm_win.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_POSTED - form is posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - set_form_win(FORM *form, WINDOW *win) - { - T((T_CALLED("set_form_win(%p,%p)"), (void *)form, (void *)win)); -@@ -73,7 +73,7 @@ set_form_win(FORM *form, WINDOW *win) - | - | Return Values : The pointer to the Window or stdscr if there is none. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+FORM_EXPORT(WINDOW *) - form_win(const FORM *form) - { - WINDOW *result; -diff --git a/form/fty_alnum.c b/form/fty_alnum.c -index a2ca3514..5504ba98 100644 ---- a/form/fty_alnum.c -+++ b/form/fty_alnum.c -@@ -186,14 +186,14 @@ static FIELDTYPE typeTHIS = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_ALNUM(void) - { - return TYPE_ALNUM; -diff --git a/form/fty_alpha.c b/form/fty_alpha.c -index 7dec23f5..15e27143 100644 ---- a/form/fty_alpha.c -+++ b/form/fty_alpha.c -@@ -186,14 +186,14 @@ static FIELDTYPE typeTHIS = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_ALPHA(void) - { - return TYPE_ALPHA; -diff --git a/form/fty_enum.c b/form/fty_enum.c -index 71978e3a..2633eff4 100644 ---- a/form/fty_enum.c -+++ b/form/fty_enum.c -@@ -425,7 +425,7 @@ static FIELDTYPE typeENUM = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE *) -+FORM_EXPORT_VAR(FIELDTYPE *) - TYPE_ENUM = &typeENUM; - - #if NCURSES_INTEROP_FUNCS -@@ -433,7 +433,7 @@ TYPE_ENUM = &typeENUM; - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_ENUM(void) - { - return TYPE_ENUM; -diff --git a/form/fty_generic.c b/form/fty_generic.c -index 159d3059..f4332f43 100644 ---- a/form/fty_generic.c -+++ b/form/fty_generic.c -@@ -99,7 +99,7 @@ Generic_This_Type(void *arg) - | - | Return Values : Fieldtype pointer or NULL if error occurred - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_generic_fieldtype(bool (*const field_check) (FORM *, FIELD *, const void *), - bool (*const char_check) (int, FORM *, FIELD *, const - void *), -@@ -220,7 +220,7 @@ GenericArgument(const FIELDTYPE *typ, - | Return Values : E_OK if all went well - | E_SYSTEM_ERROR if an error occurred - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+FORM_EXPORT(int) - _nc_set_generic_fieldtype(FIELD *field, - FIELDTYPE *ftyp, - int (*argiterator) (void **)) -@@ -275,7 +275,7 @@ _nc_set_generic_fieldtype(FIELD *field, - | - | Return Values : The fields Window or NULL on error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+FORM_EXPORT(WINDOW *) - _nc_form_cursor(const FORM *form, int *pRow, int *pCol) - { - int code = E_SYSTEM_ERROR; -diff --git a/form/fty_int.c b/form/fty_int.c -index 71056404..5e619462 100644 ---- a/form/fty_int.c -+++ b/form/fty_int.c -@@ -278,14 +278,14 @@ static FIELDTYPE typeTHIS = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_INTEGER(void) - { - return TYPE_INTEGER; -diff --git a/form/fty_ipv4.c b/form/fty_ipv4.c -index 37133770..6d558668 100644 ---- a/form/fty_ipv4.c -+++ b/form/fty_ipv4.c -@@ -104,14 +104,14 @@ static FIELDTYPE typeIPV4 = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_IPV4(void) - { - return TYPE_IPV4; -diff --git a/form/fty_num.c b/form/fty_num.c -index b4dfeb97..8216cd74 100644 ---- a/form/fty_num.c -+++ b/form/fty_num.c -@@ -324,14 +324,14 @@ static FIELDTYPE typeTHIS = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_NUMERIC(void) - { - return TYPE_NUMERIC; -diff --git a/form/fty_regex.c b/form/fty_regex.c -index d1daf714..61378050 100644 ---- a/form/fty_regex.c -+++ b/form/fty_regex.c -@@ -340,14 +340,14 @@ static FIELDTYPE typeREGEXP = - #endif - }; - --NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP; -+FORM_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP; - - #if NCURSES_INTEROP_FUNCS - /* The next routines are to simplify the use of ncurses from - programming languages with restictions on interop with C level - constructs (e.g. variable access or va_list + ellipsis constructs) - */ --NCURSES_EXPORT(FIELDTYPE *) -+FORM_EXPORT(FIELDTYPE *) - _nc_TYPE_REGEXP(void) - { - return TYPE_REGEXP; -diff --git a/include/ncurses_dll.h.in b/include/ncurses_dll.h.in -index 568112e2..ca1f0749 100644 ---- a/include/ncurses_dll.h.in -+++ b/include/ncurses_dll.h.in -@@ -66,7 +66,6 @@ - * using functions to access them. - */ - #define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name --#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) - - #include "ncurses_exports.h" - -@@ -76,6 +75,8 @@ - # define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT - #endif - -+#define NCURSES_WRAPPED_VAR(type,name) extern NCURSES_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ - #define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API - #define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type - ---- include/nc_mingw.h -+++ include/nc_mingw.h -@@ -60,7 +60,9 @@ - #include /* for struct timeval */ - #endif - --extern int _nc_gettimeofday(struct timeval *, void *); -+#include -+ -+NCURSES_EXPORT(int) _nc_gettimeofday(struct timeval *, void *); - - #undef HAVE_GETTIMEOFDAY - #define HAVE_GETTIMEOFDAY 1 -@@ -71,7 +73,7 @@ extern int _nc_gettimeofday(struct timeval *, void *); - - #undef wcwidth - #define wcwidth(ucs) _nc_wcwidth((wchar_t)(ucs)) --extern int _nc_wcwidth(wchar_t); -+NCURSES_EXPORT(int) _nc_wcwidth(wchar_t); - - #endif /* _WIN32 */ - -diff --git a/menu/m_cursor.c b/menu/m_cursor.c -index 3f8e5480..786d9e6c 100644 ---- a/menu/m_cursor.c -+++ b/menu/m_cursor.c -@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_cursor.c,v 1.23 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid menu - | E_NOT_POSTED - Menu is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - _nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX) - { - if (!menu || !pX || !pY) -@@ -80,7 +80,7 @@ _nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX) - | E_BAD_ARGUMENT - invalid menu - | E_NOT_POSTED - Menu is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - pos_menu_cursor(const MENU * menu) - { - WINDOW *win, *sub; -diff --git a/menu/m_driver.c b/menu/m_driver.c -index e592bab4..98d7fdf1 100644 ---- a/menu/m_driver.c -+++ b/menu/m_driver.c -@@ -115,7 +115,7 @@ Is_Sub_String( - | Return Values : E_OK - an item matching the pattern was found - | E_NO_MATCH - nothing found - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - _nc_Match_Next_Character_In_Item_Name - (MENU * menu, int ch, ITEM ** item) - { -@@ -209,7 +209,7 @@ _nc_Match_Next_Character_In_Item_Name - | E_BAD_STATE - menu is in user hook routine - | E_NOT_POSTED - menu is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_driver(MENU * menu, int c) - { - #define NAVIGATE(dir) \ -diff --git a/menu/m_format.c b/menu/m_format.c -index 9738dbf2..96d331e4 100644 ---- a/menu/m_format.c -+++ b/menu/m_format.c -@@ -56,7 +56,7 @@ MODULE_ID("$Id: m_format.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | E_NOT_CONNECTED - there are no items connected - | E_POSTED - the menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_format(MENU * menu, int rows, int cols) - { - int total_rows, total_cols; -@@ -120,7 +120,7 @@ set_menu_format(MENU * menu, int rows, int cols) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - menu_format(const MENU * menu, int *rows, int *cols) - { - if (rows) -diff --git a/menu/m_global.c b/menu/m_global.c -index 489987fe..f2d6c001 100644 ---- a/menu/m_global.c -+++ b/menu/m_global.c -@@ -42,7 +42,7 @@ MODULE_ID("$Id: m_global.c,v 1.30 2020/02/02 23:34:34 tom Exp $") - - static char mark[] = "-"; - /* *INDENT-OFF* */ --NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { -+MENU_EXPORT_VAR(MENU) _nc_Default_Menu = { - 16, /* Nr. of chars high */ - 1, /* Nr. of chars wide */ - 16, /* Nr. of items high */ -@@ -81,7 +81,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { - 0 /* status */ - }; - --NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = { -+MENU_EXPORT_VAR(ITEM) _nc_Default_Item = { - { (char *)0, 0 }, /* name */ - { (char *)0, 0 }, /* description */ - (MENU *)0, /* Pointer to parent menu */ -@@ -171,7 +171,7 @@ ResetConnectionInfo(MENU * menu, ITEM ** items) - | Return Values : TRUE - successful connection - | FALSE - connection failed - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+MENU_EXPORT(bool) - _nc_Connect_Items(MENU * menu, ITEM ** items) - { - ITEM **item; -@@ -233,7 +233,7 @@ _nc_Connect_Items(MENU * menu, ITEM ** items) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Disconnect_Items(MENU * menu) - { - if (menu && menu->items) -@@ -248,7 +248,7 @@ _nc_Disconnect_Items(MENU * menu) - | - | Return Values : the width - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - _nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ ) - { - #if USE_WIDEC_SUPPORT -@@ -337,7 +337,7 @@ calculate_actual_width(MENU * menu, bool name) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Calculate_Item_Length_and_Width(MENU * menu) - { - int l; -@@ -376,7 +376,7 @@ _nc_Calculate_Item_Length_and_Width(MENU * menu) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Link_Items(MENU * menu) - { - if (menu && menu->items && *(menu->items)) -@@ -503,7 +503,7 @@ _nc_Link_Items(MENU * menu) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Show_Menu(const MENU * menu) - { - WINDOW *win; -@@ -543,7 +543,7 @@ _nc_Show_Menu(const MENU * menu) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_New_TopRow_and_CurrentItem( - MENU * menu, - int new_toprow, -diff --git a/menu/m_item_cur.c b/menu/m_item_cur.c -index c09bf311..10435e7a 100644 ---- a/menu/m_item_cur.c -+++ b/menu/m_item_cur.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: m_item_cur.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_current_item(MENU * menu, ITEM * item) - { - T((T_CALLED("set_current_item(%p,%p)"), (void *)menu, (void *)item)); -@@ -89,7 +89,7 @@ set_current_item(MENU * menu, ITEM * item) - | - | Return Values : Item pointer or NULL if failure - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(ITEM *) -+MENU_EXPORT(ITEM *) - current_item(const MENU * menu) - { - T((T_CALLED("current_item(%p)"), (const void *)menu)); -@@ -104,7 +104,7 @@ current_item(const MENU * menu) - | - | Return Values : The index or ERR if this is an invalid item pointer - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - item_index(const ITEM * item) - { - T((T_CALLED("item_index(%p)"), (const void *)item)); -diff --git a/menu/m_item_nam.c b/menu/m_item_nam.c -index aaf54e0a..dc4d66c6 100644 ---- a/menu/m_item_nam.c -+++ b/menu/m_item_nam.c -@@ -48,7 +48,7 @@ MODULE_ID("$Id: m_item_nam.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : See above; returns NULL if item is invalid - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+MENU_EXPORT(const char *) - item_name(const ITEM * item) - { - T((T_CALLED("item_name(%p)"), (const void *)item)); -@@ -63,7 +63,7 @@ item_name(const ITEM * item) - | - | Return Values : See above; Returns NULL if item is invalid - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+MENU_EXPORT(const char *) - item_description(const ITEM * item) - { - T((T_CALLED("item_description(%p)"), (const void *)item)); -diff --git a/menu/m_item_new.c b/menu/m_item_new.c -index 1e7950db..493977ad 100644 ---- a/menu/m_item_new.c -+++ b/menu/m_item_new.c -@@ -107,7 +107,7 @@ Is_Printable_String(const char *s) - | - | Return Values : The item pointer or NULL if creation failed. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(ITEM *) -+MENU_EXPORT(ITEM *) - new_item(const char *name, const char *description) - { - ITEM *item; -@@ -160,7 +160,7 @@ new_item(const char *name, const char *description) - | E_BAD_ARGUMENT - invalid value has been passed - | E_CONNECTED - item is still connected to a menu - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - free_item(ITEM * item) - { - T((T_CALLED("free_item(%p)"), (void *)item)); -@@ -193,7 +193,7 @@ free_item(ITEM * item) - | E_BAD_ARGUMENT - an invalid value has been passed - | E_SYSTEM_ERROR - no memory to store mark - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_mark(MENU * menu, const char *mark) - { - short l; -@@ -265,7 +265,7 @@ set_menu_mark(MENU * menu, const char *mark) - | - | Return Values : The marker string pointer or NULL if no marker defined - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+MENU_EXPORT(const char *) - menu_mark(const MENU * menu) - { - T((T_CALLED("menu_mark(%p)"), (const void *)menu)); -diff --git a/menu/m_item_opt.c b/menu/m_item_opt.c -index f8df2205..b6a5e151 100644 ---- a/menu/m_item_opt.c -+++ b/menu/m_item_opt.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_item_opt.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid item options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_item_opts(ITEM * item, Item_Options opts) - { - T((T_CALLED("set_menu_opts(%p,%d)"), (void *)item, opts)); -@@ -94,7 +94,7 @@ set_item_opts(ITEM * item, Item_Options opts) - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - item_opts_off(ITEM * item, Item_Options opts) - { - ITEM *citem = item; /* use a copy because set_item_opts must detect -@@ -122,7 +122,7 @@ item_opts_off(ITEM * item, Item_Options opts) - | Return Values : E_OK - success - | E_BAD_ARGUMENT - invalid options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - item_opts_on(ITEM * item, Item_Options opts) - { - ITEM *citem = item; /* use a copy because set_item_opts must detect -@@ -150,7 +150,7 @@ item_opts_on(ITEM * item, Item_Options opts) - | - | Return Values : Items options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(Item_Options) -+MENU_EXPORT(Item_Options) - item_opts(const ITEM * item) - { - T((T_CALLED("item_opts(%p)"), (const void *)item)); -diff --git a/menu/m_item_top.c b/menu/m_item_top.c -index 9417e72b..ab60e0f9 100644 ---- a/menu/m_item_top.c -+++ b/menu/m_item_top.c -@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_item_top.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - not a menu pointer or invalid row - | E_NOT_CONNECTED - there are no items for the menu - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_top_row(MENU * menu, int row) - { - ITEM *item; -@@ -92,7 +92,7 @@ set_top_row(MENU * menu, int row) - | - | Return Values : The row number or ERR if there is no row - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - top_row(const MENU * menu) - { - T((T_CALLED("top_row(%p)"), (const void *)menu)); -diff --git a/menu/m_item_use.c b/menu/m_item_use.c -index 30814327..a2e6cfa6 100644 ---- a/menu/m_item_use.c -+++ b/menu/m_item_use.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_item_use.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_item_userptr(ITEM * item, void *userptr) - { - T((T_CALLED("set_item_userptr(%p,%p)"), (void *)item, (void *)userptr)); -@@ -67,7 +67,7 @@ set_item_userptr(ITEM * item, void *userptr) - | Return Values : Value of the pointer. If no such pointer has been set, - | NULL is returned. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+MENU_EXPORT(void *) - item_userptr(const ITEM * item) - { - T((T_CALLED("item_userptr(%p)"), (const void *)item)); -diff --git a/menu/m_item_val.c b/menu/m_item_val.c -index d8d11f21..825c9a2f 100644 ---- a/menu/m_item_val.c -+++ b/menu/m_item_val.c -@@ -53,7 +53,7 @@ MODULE_ID("$Id: m_item_val.c,v 1.16 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_REQUEST_DENIED - not selectable or single valued menu - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_item_value(ITEM * item, bool value) - { - MENU *menu; -@@ -95,7 +95,7 @@ set_item_value(ITEM * item, bool value) - | Return Values : TRUE - if item is selected - | FALSE - if item is not selected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+MENU_EXPORT(bool) - item_value(const ITEM * item) - { - T((T_CALLED("item_value(%p)"), (const void *)item)); -diff --git a/menu/m_item_vis.c b/menu/m_item_vis.c -index 8e993413..5959548a 100644 ---- a/menu/m_item_vis.c -+++ b/menu/m_item_vis.c -@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_item_vis.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | Return Values : TRUE if visible - | FALSE if invisible - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(bool) -+MENU_EXPORT(bool) - item_visible(const ITEM * item) - { - MENU *menu; -diff --git a/menu/m_items.c b/menu/m_items.c -index 9f46c8be..8c6d4bfc 100644 ---- a/menu/m_items.c -+++ b/menu/m_items.c -@@ -53,7 +53,7 @@ MODULE_ID("$Id: m_items.c,v 1.18 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - An incorrect menu or item array was - | passed to the function - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_items(MENU * menu, ITEM ** items) - { - T((T_CALLED("set_menu_items(%p,%p)"), (void *)menu, (void *)items)); -@@ -85,7 +85,7 @@ set_menu_items(MENU * menu, ITEM ** items) - | - | Return Values : NULL on error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(ITEM **) -+MENU_EXPORT(ITEM **) - menu_items(const MENU * menu) - { - T((T_CALLED("menu_items(%p)"), (const void *)menu)); -@@ -101,7 +101,7 @@ menu_items(const MENU * menu) - | - | Return Values : Number of items or -1 to indicate error. - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - item_count(const MENU * menu) - { - T((T_CALLED("item_count(%p)"), (const void *)menu)); -diff --git a/menu/m_new.c b/menu/m_new.c -index cf89196a..f78c702c 100644 ---- a/menu/m_new.c -+++ b/menu/m_new.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_new.c,v 1.22 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : NULL on error - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(MENU *) -+MENU_EXPORT(MENU *) - NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items) - { - int err = E_SYSTEM_ERROR; -@@ -102,7 +102,7 @@ NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items) - | Return Values : NULL on error - +--------------------------------------------------------------------------*/ - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(MENU *) -+MENU_EXPORT(MENU *) - new_menu(ITEM ** items) - { - return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items); -@@ -120,7 +120,7 @@ new_menu(ITEM ** items) - | E_BAD_ARGUMENT - Invalid menu pointer passed - | E_POSTED - Menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - free_menu(MENU * menu) - { - T((T_CALLED("free_menu(%p)"), (void *)menu)); -diff --git a/menu/m_opts.c b/menu/m_opts.c -index 4c29f333..b8dc653d 100644 ---- a/menu/m_opts.c -+++ b/menu/m_opts.c -@@ -53,7 +53,7 @@ MODULE_ID("$Id: m_opts.c,v 1.21 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid menu options - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_opts(MENU * menu, Menu_Options opts) - { - T((T_CALLED("set_menu_opts(%p,%d)"), (void *)menu, opts)); -@@ -113,7 +113,7 @@ set_menu_opts(MENU * menu, Menu_Options opts) - | E_BAD_ARGUMENT - invalid options - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_opts_off(MENU * menu, Menu_Options opts) - { - MENU *cmenu = menu; /* use a copy because set_menu_opts must detect -@@ -146,7 +146,7 @@ menu_opts_off(MENU * menu, Menu_Options opts) - | E_BAD_ARGUMENT - invalid menu options - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_opts_on(MENU * menu, Menu_Options opts) - { - MENU *cmenu = menu; /* use a copy because set_menu_opts must detect -@@ -174,7 +174,7 @@ menu_opts_on(MENU * menu, Menu_Options opts) - | - | Return Values : Menu options - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(Menu_Options) -+MENU_EXPORT(Menu_Options) - menu_opts(const MENU * menu) - { - T((T_CALLED("menu_opts(%p)"), (const void *)menu)); -diff --git a/menu/m_pad.c b/menu/m_pad.c -index 3d5702ae..e56d3748 100644 ---- a/menu/m_pad.c -+++ b/menu/m_pad.c -@@ -59,7 +59,7 @@ MODULE_ID("$Id: m_pad.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_BAD_ARGUMENT - an invalid value has been passed - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_pad(MENU * menu, int pad) - { - bool do_refresh = (menu != (MENU *) 0); -@@ -86,7 +86,7 @@ set_menu_pad(MENU * menu, int pad) - | - | Return Values : The pad character - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_pad(const MENU * menu) - { - T((T_CALLED("menu_pad(%p)"), (const void *)menu)); -diff --git a/menu/m_pattern.c b/menu/m_pattern.c -index 9ff02304..f91f3223 100644 ---- a/menu/m_pattern.c -+++ b/menu/m_pattern.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_pattern.c,v 1.17 2020/02/02 23:34:34 tom Exp $") - | pattern is stored - | PatternString - as expected - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(char *) -+MENU_EXPORT(char *) - menu_pattern(const MENU * menu) - { - static char empty[] = ""; -@@ -73,7 +73,7 @@ menu_pattern(const MENU * menu) - | E_NOT_CONNECTED - no items connected to menu - | E_NO_MATCH - no item matches pattern - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_pattern(MENU * menu, const char *p) - { - ITEM *matchitem; -diff --git a/menu/m_post.c b/menu/m_post.c -index 2cc0ea09..6d81b7c9 100644 ---- a/menu/m_post.c -+++ b/menu/m_post.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_post.c,v 1.32 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Post_Item(const MENU * menu, const ITEM * item) - { - int i; -@@ -197,7 +197,7 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) - | - | Return Values : - - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void) -+MENU_EXPORT(void) - _nc_Draw_Menu(const MENU * menu) - { - ITEM *item = menu->items[0]; -@@ -267,7 +267,7 @@ _nc_Draw_Menu(const MENU * menu) - | E_BAD_STATE - Menu in userexit routine - | E_POSTED - Menu already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - post_menu(MENU * menu) - { - T((T_CALLED("post_menu(%p)"), (void *)menu)); -@@ -339,7 +339,7 @@ post_menu(MENU * menu) - | E_BAD_STATE - menu in userexit routine - | E_NOT_POSTED - menu is not posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - unpost_menu(MENU * menu) - { - WINDOW *win; -diff --git a/menu/m_req_name.c b/menu/m_req_name.c -index d3f04c1d..beeea0f1 100644 ---- a/menu/m_req_name.c -+++ b/menu/m_req_name.c -@@ -74,7 +74,7 @@ static const char request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1][14] = - | Return Values : Pointer to name - on success - | NULL - on invalid request code - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(const char *) -+MENU_EXPORT(const char *) - menu_request_name(int request) - { - T((T_CALLED("menu_request_name(%d)"), request)); -@@ -96,7 +96,7 @@ menu_request_name(int request) - | Return Values : Request Id - on success - | E_NO_MATCH - request not found - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_request_by_name(const char *str) - { - /* because the table is so small, it doesn't really hurt -diff --git a/menu/m_scale.c b/menu/m_scale.c -index e013acd8..ba986955 100644 ---- a/menu/m_scale.c -+++ b/menu/m_scale.c -@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_scale.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - | E_BAD_ARGUMENT - invalid menu pointer - | E_NOT_CONNECTED - no items are connected to menu - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - scale_menu(const MENU * menu, int *rows, int *cols) - { - T((T_CALLED("scale_menu(%p,%p,%p)"), -diff --git a/menu/m_spacing.c b/menu/m_spacing.c -index 9bb746a0..6d68e268 100644 ---- a/menu/m_spacing.c -+++ b/menu/m_spacing.c -@@ -52,7 +52,7 @@ MODULE_ID("$Id: m_spacing.c,v 1.20 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - on success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col) - { - MENU *m; /* split for ATAC workaround */ -@@ -87,7 +87,7 @@ set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col) - | - | Return Values : E_OK - on success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - menu_spacing(const MENU * menu, int *s_desc, int *s_row, int *s_col) - { - const MENU *m; /* split for ATAC workaround */ -diff --git a/menu/m_sub.c b/menu/m_sub.c -index 4658e90e..e69994d5 100644 ---- a/menu/m_sub.c -+++ b/menu/m_sub.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_sub.c,v 1.13 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_sub(MENU * menu, WINDOW *win) - { - T((T_CALLED("set_menu_sub(%p,%p)"), (void *)menu, (void *)win)); -@@ -89,7 +89,7 @@ set_menu_sub(MENU * menu, WINDOW *win) - | - | Return Values : NULL on error, otherwise a pointer to the window - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+MENU_EXPORT(WINDOW *) - menu_sub(const MENU * menu) - { - const MENU *m = Normalize_Menu(menu); -diff --git a/menu/m_trace.c b/menu/m_trace.c -index f5332b18..f4d3373d 100644 ---- a/menu/m_trace.c -+++ b/menu/m_trace.c -@@ -35,35 +35,35 @@ - - MODULE_ID("$Id: m_trace.c,v 1.7 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(ITEM *) -+MENU_EXPORT(ITEM *) - _nc_retrace_item(ITEM * code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(ITEM **) -+MENU_EXPORT(ITEM **) - _nc_retrace_item_ptr(ITEM ** code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(Item_Options) -+MENU_EXPORT(Item_Options) - _nc_retrace_item_opts(Item_Options code) - { - T((T_RETURN("%d"), code)); - return code; - } - --NCURSES_EXPORT(MENU *) -+MENU_EXPORT(MENU *) - _nc_retrace_menu(MENU * code) - { - T((T_RETURN("%p"), (void *)code)); - return code; - } - --NCURSES_EXPORT(Menu_Hook) -+MENU_EXPORT(Menu_Hook) - _nc_retrace_menu_hook(Menu_Hook code) - { - TR_FUNC_BFR(1); -@@ -71,7 +71,7 @@ _nc_retrace_menu_hook(Menu_Hook code) - return code; - } - --NCURSES_EXPORT(Menu_Options) -+MENU_EXPORT(Menu_Options) - _nc_retrace_menu_opts(Menu_Options code) - { - T((T_RETURN("%d"), code)); -diff --git a/menu/m_userptr.c b/menu/m_userptr.c -index df3a45f8..6b1ca551 100644 ---- a/menu/m_userptr.c -+++ b/menu/m_userptr.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_userptr.c,v 1.19 2020/02/02 23:34:34 tom Exp $") - | - | Return Values : E_OK - success - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_userptr(MENU * menu, void *userptr) - { - T((T_CALLED("set_menu_userptr(%p,%p)"), (void *)menu, (void *)userptr)); -@@ -67,7 +67,7 @@ set_menu_userptr(MENU * menu, void *userptr) - | Return Values : Value of the pointer. If no such pointer has been set, - | NULL is returned - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(void *) -+MENU_EXPORT(void *) - menu_userptr(const MENU * menu) - { - T((T_CALLED("menu_userptr(%p)"), (const void *)menu)); -diff --git a/menu/m_win.c b/menu/m_win.c -index f06c5808..e67cc92e 100644 ---- a/menu/m_win.c -+++ b/menu/m_win.c -@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_win.c,v 1.18 2020/02/02 23:34:34 tom Exp $") - | Return Values : E_OK - success - | E_POSTED - menu is already posted - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(int) -+MENU_EXPORT(int) - set_menu_win(MENU * menu, WINDOW *win) - { - T((T_CALLED("set_menu_win(%p,%p)"), (void *)menu, (void *)win)); -@@ -89,7 +89,7 @@ set_menu_win(MENU * menu, WINDOW *win) - | - | Return Values : NULL on error, otherwise pointer to window - +--------------------------------------------------------------------------*/ --NCURSES_EXPORT(WINDOW *) -+MENU_EXPORT(WINDOW *) - menu_win(const MENU * menu) - { - const MENU *m = Normalize_Menu(menu); -diff --git a/menu/menu.h b/menu/menu.h -index b2e845c6..09bc6c0a 100644 ---- a/menu/menu.h -+++ b/menu/menu.h -@@ -47,6 +47,19 @@ - extern "C" { - #endif - -+#include "ncurses_exports.h" -+ -+#if defined(BUILDING_MENU) -+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT -+#endif -+ -+#define MENU_WRAPPED_VAR(type,name) extern MENU_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ -+#define MENU_EXPORT(type) MENU_IMPEXP type NCURSES_API -+#define MENU_EXPORT_VAR(type) MENU_IMPEXP type -+ - typedef int Menu_Options; - typedef int Item_Options; - -@@ -183,85 +196,85 @@ MENU; - - /* --------- prototypes for libmenu functions ----------------------------- */ - --extern NCURSES_EXPORT(ITEM **) menu_items (const MENU *); --extern NCURSES_EXPORT(ITEM *) current_item (const MENU *); --extern NCURSES_EXPORT(ITEM *) new_item (const char *,const char *); -- --extern NCURSES_EXPORT(MENU *) new_menu (ITEM **); -- --extern NCURSES_EXPORT(Item_Options) item_opts (const ITEM *); --extern NCURSES_EXPORT(Menu_Options) menu_opts (const MENU *); -- --extern NCURSES_EXPORT(Menu_Hook) item_init (const MENU *); --extern NCURSES_EXPORT(Menu_Hook) item_term (const MENU *); --extern NCURSES_EXPORT(Menu_Hook) menu_init (const MENU *); --extern NCURSES_EXPORT(Menu_Hook) menu_term (const MENU *); -- --extern NCURSES_EXPORT(WINDOW *) menu_sub (const MENU *); --extern NCURSES_EXPORT(WINDOW *) menu_win (const MENU *); -- --extern NCURSES_EXPORT(const char *) item_description (const ITEM *); --extern NCURSES_EXPORT(const char *) item_name (const ITEM *); --extern NCURSES_EXPORT(const char *) menu_mark (const MENU *); --extern NCURSES_EXPORT(const char *) menu_request_name (int); -- --extern NCURSES_EXPORT(char *) menu_pattern (const MENU *); -- --extern NCURSES_EXPORT(void *) menu_userptr (const MENU *); --extern NCURSES_EXPORT(void *) item_userptr (const ITEM *); -- --extern NCURSES_EXPORT(chtype) menu_back (const MENU *); --extern NCURSES_EXPORT(chtype) menu_fore (const MENU *); --extern NCURSES_EXPORT(chtype) menu_grey (const MENU *); -- --extern NCURSES_EXPORT(int) free_item (ITEM *); --extern NCURSES_EXPORT(int) free_menu (MENU *); --extern NCURSES_EXPORT(int) item_count (const MENU *); --extern NCURSES_EXPORT(int) item_index (const ITEM *); --extern NCURSES_EXPORT(int) item_opts_off (ITEM *,Item_Options); --extern NCURSES_EXPORT(int) item_opts_on (ITEM *,Item_Options); --extern NCURSES_EXPORT(int) menu_driver (MENU *,int); --extern NCURSES_EXPORT(int) menu_opts_off (MENU *,Menu_Options); --extern NCURSES_EXPORT(int) menu_opts_on (MENU *,Menu_Options); --extern NCURSES_EXPORT(int) menu_pad (const MENU *); --extern NCURSES_EXPORT(int) pos_menu_cursor (const MENU *); --extern NCURSES_EXPORT(int) post_menu (MENU *); --extern NCURSES_EXPORT(int) scale_menu (const MENU *,int *,int *); --extern NCURSES_EXPORT(int) set_current_item (MENU *menu,ITEM *item); --extern NCURSES_EXPORT(int) set_item_init (MENU *, Menu_Hook); --extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options); --extern NCURSES_EXPORT(int) set_item_term (MENU *, Menu_Hook); --extern NCURSES_EXPORT(int) set_item_userptr (ITEM *, void *); --extern NCURSES_EXPORT(int) set_item_value (ITEM *,bool); --extern NCURSES_EXPORT(int) set_menu_back (MENU *,chtype); --extern NCURSES_EXPORT(int) set_menu_fore (MENU *,chtype); --extern NCURSES_EXPORT(int) set_menu_format (MENU *,int,int); --extern NCURSES_EXPORT(int) set_menu_grey (MENU *,chtype); --extern NCURSES_EXPORT(int) set_menu_init (MENU *, Menu_Hook); --extern NCURSES_EXPORT(int) set_menu_items (MENU *,ITEM **); --extern NCURSES_EXPORT(int) set_menu_mark (MENU *, const char *); --extern NCURSES_EXPORT(int) set_menu_opts (MENU *,Menu_Options); --extern NCURSES_EXPORT(int) set_menu_pad (MENU *,int); --extern NCURSES_EXPORT(int) set_menu_pattern (MENU *,const char *); --extern NCURSES_EXPORT(int) set_menu_sub (MENU *,WINDOW *); --extern NCURSES_EXPORT(int) set_menu_term (MENU *, Menu_Hook); --extern NCURSES_EXPORT(int) set_menu_userptr (MENU *,void *); --extern NCURSES_EXPORT(int) set_menu_win (MENU *,WINDOW *); --extern NCURSES_EXPORT(int) set_top_row (MENU *,int); --extern NCURSES_EXPORT(int) top_row (const MENU *); --extern NCURSES_EXPORT(int) unpost_menu (MENU *); --extern NCURSES_EXPORT(int) menu_request_by_name (const char *); --extern NCURSES_EXPORT(int) set_menu_spacing (MENU *,int,int,int); --extern NCURSES_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *); -- -- --extern NCURSES_EXPORT(bool) item_value (const ITEM *); --extern NCURSES_EXPORT(bool) item_visible (const ITEM *); -- --extern NCURSES_EXPORT(void) menu_format (const MENU *,int *,int *); -+extern MENU_EXPORT(ITEM **) menu_items (const MENU *); -+extern MENU_EXPORT(ITEM *) current_item (const MENU *); -+extern MENU_EXPORT(ITEM *) new_item (const char *,const char *); -+ -+extern MENU_EXPORT(MENU *) new_menu (ITEM **); -+ -+extern MENU_EXPORT(Item_Options) item_opts (const ITEM *); -+extern MENU_EXPORT(Menu_Options) menu_opts (const MENU *); -+ -+extern MENU_EXPORT(Menu_Hook) item_init (const MENU *); -+extern MENU_EXPORT(Menu_Hook) item_term (const MENU *); -+extern MENU_EXPORT(Menu_Hook) menu_init (const MENU *); -+extern MENU_EXPORT(Menu_Hook) menu_term (const MENU *); -+ -+extern MENU_EXPORT(WINDOW *) menu_sub (const MENU *); -+extern MENU_EXPORT(WINDOW *) menu_win (const MENU *); -+ -+extern MENU_EXPORT(const char *) item_description (const ITEM *); -+extern MENU_EXPORT(const char *) item_name (const ITEM *); -+extern MENU_EXPORT(const char *) menu_mark (const MENU *); -+extern MENU_EXPORT(const char *) menu_request_name (int); -+ -+extern MENU_EXPORT(char *) menu_pattern (const MENU *); -+ -+extern MENU_EXPORT(void *) menu_userptr (const MENU *); -+extern MENU_EXPORT(void *) item_userptr (const ITEM *); -+ -+extern MENU_EXPORT(chtype) menu_back (const MENU *); -+extern MENU_EXPORT(chtype) menu_fore (const MENU *); -+extern MENU_EXPORT(chtype) menu_grey (const MENU *); -+ -+extern MENU_EXPORT(int) free_item (ITEM *); -+extern MENU_EXPORT(int) free_menu (MENU *); -+extern MENU_EXPORT(int) item_count (const MENU *); -+extern MENU_EXPORT(int) item_index (const ITEM *); -+extern MENU_EXPORT(int) item_opts_off (ITEM *,Item_Options); -+extern MENU_EXPORT(int) item_opts_on (ITEM *,Item_Options); -+extern MENU_EXPORT(int) menu_driver (MENU *,int); -+extern MENU_EXPORT(int) menu_opts_off (MENU *,Menu_Options); -+extern MENU_EXPORT(int) menu_opts_on (MENU *,Menu_Options); -+extern MENU_EXPORT(int) menu_pad (const MENU *); -+extern MENU_EXPORT(int) pos_menu_cursor (const MENU *); -+extern MENU_EXPORT(int) post_menu (MENU *); -+extern MENU_EXPORT(int) scale_menu (const MENU *,int *,int *); -+extern MENU_EXPORT(int) set_current_item (MENU *menu,ITEM *item); -+extern MENU_EXPORT(int) set_item_init (MENU *, Menu_Hook); -+extern MENU_EXPORT(int) set_item_opts (ITEM *,Item_Options); -+extern MENU_EXPORT(int) set_item_term (MENU *, Menu_Hook); -+extern MENU_EXPORT(int) set_item_userptr (ITEM *, void *); -+extern MENU_EXPORT(int) set_item_value (ITEM *,bool); -+extern MENU_EXPORT(int) set_menu_back (MENU *,chtype); -+extern MENU_EXPORT(int) set_menu_fore (MENU *,chtype); -+extern MENU_EXPORT(int) set_menu_format (MENU *,int,int); -+extern MENU_EXPORT(int) set_menu_grey (MENU *,chtype); -+extern MENU_EXPORT(int) set_menu_init (MENU *, Menu_Hook); -+extern MENU_EXPORT(int) set_menu_items (MENU *,ITEM **); -+extern MENU_EXPORT(int) set_menu_mark (MENU *, const char *); -+extern MENU_EXPORT(int) set_menu_opts (MENU *,Menu_Options); -+extern MENU_EXPORT(int) set_menu_pad (MENU *,int); -+extern MENU_EXPORT(int) set_menu_pattern (MENU *,const char *); -+extern MENU_EXPORT(int) set_menu_sub (MENU *,WINDOW *); -+extern MENU_EXPORT(int) set_menu_term (MENU *, Menu_Hook); -+extern MENU_EXPORT(int) set_menu_userptr (MENU *,void *); -+extern MENU_EXPORT(int) set_menu_win (MENU *,WINDOW *); -+extern MENU_EXPORT(int) set_top_row (MENU *,int); -+extern MENU_EXPORT(int) top_row (const MENU *); -+extern MENU_EXPORT(int) unpost_menu (MENU *); -+extern MENU_EXPORT(int) menu_request_by_name (const char *); -+extern MENU_EXPORT(int) set_menu_spacing (MENU *,int,int,int); -+extern MENU_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *); -+ -+ -+extern MENU_EXPORT(bool) item_value (const ITEM *); -+extern MENU_EXPORT(bool) item_visible (const ITEM *); -+ -+extern MENU_EXPORT(void) menu_format (const MENU *,int *,int *); - - #if NCURSES_SP_FUNCS --extern NCURSES_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **); -+extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **); - #endif - - #ifdef __cplusplus -diff --git a/menu/menu.priv.h b/menu/menu.priv.h -index d084565a..eb653ba4 100644 ---- a/menu/menu.priv.h -+++ b/menu/menu.priv.h -@@ -52,8 +52,8 @@ - /* Backspace code */ - #define BS (8) - --extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item; --extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; -+extern MENU_EXPORT_VAR(ITEM) _nc_Default_Item; -+extern MENU_EXPORT_VAR(MENU) _nc_Default_Menu; - - /* Normalize item to default if none was given */ - #define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item) -@@ -120,17 +120,17 @@ extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; - #define UChar(c) ((unsigned char)(c)) - - /* Internal functions. */ --extern NCURSES_EXPORT(void) _nc_Draw_Menu (const MENU *); --extern NCURSES_EXPORT(void) _nc_Show_Menu (const MENU *); --extern NCURSES_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *); --extern NCURSES_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *); --extern NCURSES_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *); --extern NCURSES_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **); --extern NCURSES_EXPORT(void) _nc_Disconnect_Items (MENU *); --extern NCURSES_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *); --extern NCURSES_EXPORT(void) _nc_Link_Items (MENU *); --extern NCURSES_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**); --extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item, -+extern MENU_EXPORT(void) _nc_Draw_Menu (const MENU *); -+extern MENU_EXPORT(void) _nc_Show_Menu (const MENU *); -+extern MENU_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *); -+extern MENU_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *); -+extern MENU_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *); -+extern MENU_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **); -+extern MENU_EXPORT(void) _nc_Disconnect_Items (MENU *); -+extern MENU_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *); -+extern MENU_EXPORT(void) _nc_Link_Items (MENU *); -+extern MENU_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**); -+extern MENU_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item, - int* pY, int* pX); - - #ifdef TRACE -@@ -142,12 +142,12 @@ extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* i - #define returnMenuHook(code) TRACE_RETURN1(code,menu_hook) - #define returnMenuOpts(code) TRACE_RETURN1(code,menu_opts) - --extern NCURSES_EXPORT(ITEM *) _nc_retrace_item (ITEM *); --extern NCURSES_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **); --extern NCURSES_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options); --extern NCURSES_EXPORT(MENU *) _nc_retrace_menu (MENU *); --extern NCURSES_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook); --extern NCURSES_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options); -+extern MENU_EXPORT(ITEM *) _nc_retrace_item (ITEM *); -+extern MENU_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **); -+extern MENU_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options); -+extern MENU_EXPORT(MENU *) _nc_retrace_menu (MENU *); -+extern MENU_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook); -+extern MENU_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options); - - #else /* !TRACE */ - -diff --git a/panel/p_above.c b/panel/p_above.c -index 12b5b87b..704863a7 100644 ---- a/panel/p_above.c -+++ b/panel/p_above.c -@@ -40,7 +40,7 @@ - MODULE_ID("$Id: p_above.c,v 1.10 2020/02/02 23:34:34 tom Exp $") - - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - ground_panel(SCREEN * sp) - { - T((T_CALLED("ground_panel(%p)"), (void *)sp)); -@@ -63,7 +63,7 @@ ground_panel(SCREEN * sp) - } - #endif - --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - panel_above(const PANEL * pan) - { - PANEL *result; -diff --git a/panel/p_below.c b/panel/p_below.c -index a8b1ef47..972ec836 100644 ---- a/panel/p_below.c -+++ b/panel/p_below.c -@@ -40,7 +40,7 @@ - MODULE_ID("$Id: p_below.c,v 1.10 2020/02/02 23:34:34 tom Exp $") - - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - ceiling_panel(SCREEN * sp) - { - T((T_CALLED("ceiling_panel(%p)"), (void *)sp)); -@@ -61,7 +61,7 @@ ceiling_panel(SCREEN * sp) - } - #endif - --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - panel_below(const PANEL * pan) - { - PANEL *result; -diff --git a/panel/p_bottom.c b/panel/p_bottom.c -index a69ac9f4..c4a170ad 100644 ---- a/panel/p_bottom.c -+++ b/panel/p_bottom.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_bottom.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - bottom_panel(PANEL * pan) - { - int err = OK; -diff --git a/panel/p_delete.c b/panel/p_delete.c -index 6b122a6c..e58875b1 100644 ---- a/panel/p_delete.c -+++ b/panel/p_delete.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_delete.c,v 1.11 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - del_panel(PANEL * pan) - { - int err = OK; -diff --git a/panel/p_hidden.c b/panel/p_hidden.c -index ddb23b13..a43ea481 100644 ---- a/panel/p_hidden.c -+++ b/panel/p_hidden.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_hidden.c,v 1.10 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - panel_hidden(const PANEL * pan) - { - int rc = ERR; -diff --git a/panel/p_hide.c b/panel/p_hide.c -index fc26f752..35e738e3 100644 ---- a/panel/p_hide.c -+++ b/panel/p_hide.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_hide.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - hide_panel(register PANEL * pan) - { - int err = ERR; -diff --git a/panel/p_move.c b/panel/p_move.c -index 02830bf5..77127be7 100644 ---- a/panel/p_move.c -+++ b/panel/p_move.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_move.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - move_panel(PANEL * pan, int starty, int startx) - { - int rc = ERR; -diff --git a/panel/p_new.c b/panel/p_new.c -index d2f8d036..659bdeb9 100644 ---- a/panel/p_new.c -+++ b/panel/p_new.c -@@ -89,7 +89,7 @@ root_panel(NCURSES_SP_DCL0) - return _nc_stdscr_pseudo_panel; - } - --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - new_panel(WINDOW *win) - { - PANEL *pan = (PANEL *) 0; -diff --git a/panel/p_replace.c b/panel/p_replace.c -index 5acbccf8..362a2ef8 100644 ---- a/panel/p_replace.c -+++ b/panel/p_replace.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_replace.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - replace_panel(PANEL * pan, WINDOW *win) - { - int rc = ERR; -diff --git a/panel/p_show.c b/panel/p_show.c -index 933bf5aa..bfee2cb8 100644 ---- a/panel/p_show.c -+++ b/panel/p_show.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_show.c,v 1.14 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - show_panel(PANEL * pan) - { - int err = ERR; -diff --git a/panel/p_top.c b/panel/p_top.c -index 09e89fcc..438086c1 100644 ---- a/panel/p_top.c -+++ b/panel/p_top.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_top.c,v 1.7 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - top_panel(PANEL * pan) - { - T((T_CALLED("top_panel(%p)"), (void *)pan)); -diff --git a/panel/p_update.c b/panel/p_update.c -index 3fe4770b..ca856795 100644 ---- a/panel/p_update.c -+++ b/panel/p_update.c -@@ -40,7 +40,7 @@ - - MODULE_ID("$Id: p_update.c,v 1.12 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) - { - PANEL *pan; -@@ -71,7 +71,7 @@ NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) - } - - #if NCURSES_SP_FUNCS --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - update_panels(void) - { - NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN); -diff --git a/panel/p_user.c b/panel/p_user.c -index 633431ea..e6122d33 100644 ---- a/panel/p_user.c -+++ b/panel/p_user.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_user.c,v 1.9 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(int) -+PANEL_EXPORT(int) - set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) - { - T((T_CALLED("set_panel_userptr(%p,%p)"), (void *)pan, (NCURSES_CONST void *)uptr)); -@@ -49,7 +49,7 @@ set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) - returnCode(OK); - } - --NCURSES_EXPORT(NCURSES_CONST void *) -+PANEL_EXPORT(NCURSES_CONST void *) - panel_userptr(const PANEL * pan) - { - T((T_CALLED("panel_userptr(%p)"), (const void *)pan)); -diff --git a/panel/p_win.c b/panel/p_win.c -index 023a71c9..0bc838f5 100644 ---- a/panel/p_win.c -+++ b/panel/p_win.c -@@ -39,7 +39,7 @@ - - MODULE_ID("$Id: p_win.c,v 1.7 2020/02/02 23:34:34 tom Exp $") - --NCURSES_EXPORT(WINDOW *) -+PANEL_EXPORT(WINDOW *) - panel_window(const PANEL * pan) - { - T((T_CALLED("panel_window(%p)"), (const void *)pan)); -diff --git a/panel/panel.c b/panel/panel.c -index a0e632d2..5d66476e 100644 ---- a/panel/panel.c -+++ b/panel/panel.c -@@ -43,7 +43,7 @@ MODULE_ID("$Id: panel.c,v 1.27 2020/02/02 23:34:34 tom Exp $") - _nc_retrace_panel (pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(PANEL *) -+PANEL_EXPORT(PANEL *) - _nc_retrace_panel(PANEL * pan) - { - T((T_RETURN("%p"), (void *)pan)); -@@ -56,7 +56,7 @@ _nc_retrace_panel(PANEL * pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE - #ifndef TRACE_TXT --NCURSES_EXPORT(const char *) -+PANEL_EXPORT(const char *) - _nc_my_visbuf(const void *ptr) - { - char temp[32]; -@@ -74,7 +74,7 @@ _nc_my_visbuf(const void *ptr) - dPanel(text,pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_dPanel(const char *text, const PANEL * pan) - { - _tracef("%s id=%s b=%s a=%s y=%d x=%d", -@@ -89,7 +89,7 @@ _nc_dPanel(const char *text, const PANEL * pan) - dStack(fmt,num,pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_dStack(const char *fmt, int num, const PANEL * pan) - { - char s80[80]; -@@ -115,7 +115,7 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan) - Wnoutrefresh(pan) - debugging hook for wnoutrefresh - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_Wnoutrefresh(const PANEL * pan) - { - dPanel("wnoutrefresh", pan); -@@ -127,7 +127,7 @@ _nc_Wnoutrefresh(const PANEL * pan) - Touchpan(pan) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_Touchpan(const PANEL * pan) - { - dPanel("Touchpan", pan); -@@ -139,7 +139,7 @@ _nc_Touchpan(const PANEL * pan) - Touchline(pan,start,count) - --------------------------------------------------------------------------*/ - #ifdef TRACE --NCURSES_EXPORT(void) -+PANEL_EXPORT(void) - _nc_Touchline(const PANEL * pan, int start, int count) - { - char s80[80]; -diff --git a/panel/panel.h b/panel/panel.h -index 2eebe178..042cf5d4 100644 ---- a/panel/panel.h -+++ b/panel/panel.h -@@ -57,27 +57,40 @@ PANEL; - extern "C" { - #endif - --extern NCURSES_EXPORT(WINDOW*) panel_window (const PANEL *); --extern NCURSES_EXPORT(void) update_panels (void); --extern NCURSES_EXPORT(int) hide_panel (PANEL *); --extern NCURSES_EXPORT(int) show_panel (PANEL *); --extern NCURSES_EXPORT(int) del_panel (PANEL *); --extern NCURSES_EXPORT(int) top_panel (PANEL *); --extern NCURSES_EXPORT(int) bottom_panel (PANEL *); --extern NCURSES_EXPORT(PANEL*) new_panel (WINDOW *); --extern NCURSES_EXPORT(PANEL*) panel_above (const PANEL *); --extern NCURSES_EXPORT(PANEL*) panel_below (const PANEL *); --extern NCURSES_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); --extern NCURSES_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); --extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); --extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); --extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); -+#include "ncurses_exports.h" -+ -+#if defined(BUILDING_PANEL) -+# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT -+#else -+# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT -+#endif -+ -+#define PANEL_WRAPPED_VAR(type,name) extern PANEL_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) -+ -+#define PANEL_EXPORT(type) PANEL_IMPEXP type NCURSES_API -+#define PANEL_EXPORT_VAR(type) PANEL_IMPEXP type -+ -+extern PANEL_EXPORT(WINDOW*) panel_window (const PANEL *); -+extern PANEL_EXPORT(void) update_panels (void); -+extern PANEL_EXPORT(int) hide_panel (PANEL *); -+extern PANEL_EXPORT(int) show_panel (PANEL *); -+extern PANEL_EXPORT(int) del_panel (PANEL *); -+extern PANEL_EXPORT(int) top_panel (PANEL *); -+extern PANEL_EXPORT(int) bottom_panel (PANEL *); -+extern PANEL_EXPORT(PANEL*) new_panel (WINDOW *); -+extern PANEL_EXPORT(PANEL*) panel_above (const PANEL *); -+extern PANEL_EXPORT(PANEL*) panel_below (const PANEL *); -+extern PANEL_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); -+extern PANEL_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); -+extern PANEL_EXPORT(int) move_panel (PANEL *, int, int); -+extern PANEL_EXPORT(int) replace_panel (PANEL *,WINDOW *); -+extern PANEL_EXPORT(int) panel_hidden (const PANEL *); - - #if NCURSES_SP_FUNCS --extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); --extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); -+extern PANEL_EXPORT(PANEL *) ground_panel(SCREEN *); -+extern PANEL_EXPORT(PANEL *) ceiling_panel(SCREEN *); - --extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); -+extern PANEL_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); - #endif - - #if defined(__cplusplus) -diff --git a/panel/panel.priv.h b/panel/panel.priv.h -index c8e3ea79..bf9df442 100644 ---- a/panel/panel.priv.h -+++ b/panel/panel.priv.h -@@ -50,7 +50,7 @@ struct screen; /* forward declaration */ - #include "panel.h" - - #ifdef TRACE -- extern NCURSES_EXPORT(const char *) _nc_my_visbuf (const void *); -+ extern PANEL_EXPORT(const char *) _nc_my_visbuf (const void *); - # ifdef TRACE_TXT - # define USER_PTR(ptr) _nc_visbuf((const char *)ptr) - # else -@@ -59,12 +59,12 @@ struct screen; /* forward declaration */ - - # define returnPanel(code) TRACE_RETURN1(code,panel) - -- extern NCURSES_EXPORT(PANEL *) _nc_retrace_panel (PANEL *); -- extern NCURSES_EXPORT(void) _nc_dPanel (const char*, const PANEL*); -- extern NCURSES_EXPORT(void) _nc_dStack (const char*, int, const PANEL*); -- extern NCURSES_EXPORT(void) _nc_Wnoutrefresh (const PANEL*); -- extern NCURSES_EXPORT(void) _nc_Touchpan (const PANEL*); -- extern NCURSES_EXPORT(void) _nc_Touchline (const PANEL*, int, int); -+ extern PANEL_EXPORT(PANEL *) _nc_retrace_panel (PANEL *); -+ extern PANEL_EXPORT(void) _nc_dPanel (const char*, const PANEL*); -+ extern PANEL_EXPORT(void) _nc_dStack (const char*, int, const PANEL*); -+ extern PANEL_EXPORT(void) _nc_Wnoutrefresh (const PANEL*); -+ extern PANEL_EXPORT(void) _nc_Touchpan (const PANEL*); -+ extern PANEL_EXPORT(void) _nc_Touchline (const PANEL*, int, int); - - # define dBug(x) _tracef x - # define dPanel(text,pan) _nc_dPanel(text,pan) -@@ -205,7 +205,7 @@ struct screen; /* forward declaration */ - - #if NCURSES_SP_FUNCS - /* These may become later renamed and part of panel.h and the public API */ --extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); -+extern PANEL_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); - #endif - /* *INDENT-ON* */ - --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0012-Learn-configure-about-msvc.patch b/recipes/ncurses/all/patches/6.2.0-0012-Learn-configure-about-msvc.patch deleted file mode 100644 index 1a723cab0cac4..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0012-Learn-configure-about-msvc.patch +++ /dev/null @@ -1,423 +0,0 @@ -Upstreamed in 18f51bcf99101e5bf4c737239c44064227f34db8 - -ncurses 6.2 - patch 20200229 - -Upstreamed in 3e37c7d3fa122563a9d88168926f61286ef30cd3 - -ncurses 6.2 - patch 20200523 - -Upstreamed in d61c3c6a831d18ef0ed6f797ac97d60fffc2f158 - -ncurses 6.2 - patch 20200711 - -From 4a4d205735df2634a328c03629435f440cb5dd3c Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Tue, 17 Mar 2020 15:38:08 +0100 -Subject: [PATCH 12/15] Learn configure about msvc - ---- - aclocal.m4 | 145 +++++++++++++++++++++++++++++++++++++++++------------ - mk-1st.awk | 25 +++++---- - 2 files changed, 128 insertions(+), 42 deletions(-) - -diff --git a/aclocal.m4 b/aclocal.m4 -index 55c65d1a..3a44d63b 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -453,39 +453,55 @@ AC_DEFUN([CF_AR_FLAGS],[ - AC_REQUIRE([CF_PROG_AR]) - - AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ -- cf_cv_ar_flags=unknown -- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv -- do -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_cv_ar_flags='' -+ cat >mk_static_lib.sh <<-EOF -+ #!$SHELL -+ MSVC_BIN="[$]AR" -+ out="\[$]1" -+ shift -+ exec \[$]MSVC_BIN -out:"\[$]out" \[$]@ -+ EOF -+ chmod +x mk_static_lib.sh -+ AR=`pwd`/mk_static_lib.sh -+ ;; -+ (*) -+ cf_cv_ar_flags=unknown -+ for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv -+ do - -- # check if $ARFLAGS already contains this choice -- if test "x$ARFLAGS" != "x" ; then -- cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` -- if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then -- cf_cv_ar_flags= -- break -+ # check if $ARFLAGS already contains this choice -+ if test "x$ARFLAGS" != "x" ; then -+ cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` -+ if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then -+ cf_cv_ar_flags= -+ break -+ fi - fi -- fi -- -- rm -f conftest.$ac_cv_objext -- rm -f conftest.a - -- cat >conftest.$ac_ext <&AC_FD_CC -- $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null -- if test -f conftest.a ; then -- cf_cv_ar_flags=$cf_ar_flags -+ rm -f conftest.$ac_cv_objext -+ rm -f conftest.a -+ -+ cat >conftest.$ac_ext <<-EOF -+ #line __oline__ "configure" -+ int testdata[[3]] = { 123, 456, 789 }; -+ EOF -+ if AC_TRY_EVAL(ac_compile) ; then -+ echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC -+ $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null -+ if test -f conftest.a ; then -+ cf_cv_ar_flags=$cf_ar_flags -+ break -+ fi -+ else -+ CF_VERBOSE(cannot compile test-program) - break - fi -- else -- CF_VERBOSE(cannot compile test-program) -- break -- fi -- done -- rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext -+ done -+ rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext -+ ;; -+ esac - ]) - - if test -n "$ARFLAGS" ; then -@@ -4008,6 +4024,9 @@ define([CF_LIB_PREFIX], - LIB_PREFIX='' - fi - ;; -+ (*-msvc*) -+ LIB_PREFIX='' -+ ;; - (*) LIB_PREFIX='lib' - ;; - esac -@@ -4036,7 +4055,7 @@ cf_prefix=$LIB_PREFIX - AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) - - case $cf_cv_shlib_version in --(cygdll|msysdll|mingw) -+(cygdll|msysdll|mingw|msvcdll) - TINFO_NAME=$TINFO_ARG_SUFFIX - TINFO_SUFFIX=.dll - ;; -@@ -4159,6 +4178,10 @@ CF_EOF - cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` - cf_add_lib="../lib/lib${cf_libname}${cf_cygsuf}" - ;; -+ (msvcdll) -+ cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` -+ cf_add_lib="../lib/${cf_libname}${cf_cygsuf}" -+ ;; - (*) - cf_add_lib= - ;; -@@ -4254,7 +4277,7 @@ CF_EOF - CXX_MODEL=$cf_ITEM - if test "$CXX_MODEL" = SHARED; then - case $cf_cv_shlib_version in -- (cygdll|msysdll|mingw) -+ (cygdll|msysdll|mingw|msvcdll) - test "x$with_shared_cxx" = xno && CF_VERBOSE(overriding CXX_MODEL to SHARED) - with_shared_cxx=yes - ;; -@@ -4649,11 +4672,25 @@ AC_DEFUN([CF_LIB_SUFFIX], - $3=[$]$2 - ;; - (Xdebug) -- $2='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ $2='_g.lib' -+ ;; -+ (*) -+ $2='_g.a' -+ ;; -+ esac - $3=[$]$2 - ;; - (Xprofile) -- $2='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ $2='_p.lib' -+ ;; -+ (*) -+ $2='_p.a' -+ ;; -+ esac - $3=[$]$2 - ;; - (Xshared) -@@ -4662,6 +4699,10 @@ AC_DEFUN([CF_LIB_SUFFIX], - $2='.so' - $3=[$]$2 - ;; -+ (*-msvc*) -+ $2='.dll' -+ $3='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - $2='.dll' - $3='.dll.a' -@@ -4689,7 +4730,14 @@ AC_DEFUN([CF_LIB_SUFFIX], - esac - ;; - (*) -- $2='.a' -+ case $target in -+ (*-msvc*) -+ $2='.lib' -+ ;; -+ (*) -+ $2='.a' -+ ;; -+ esac - $3=[$]$2 - ;; - esac -@@ -6759,6 +6807,110 @@ CF_EOF - CF_SHARED_SONAME - MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' - ;; -+ (mingw*msvc*) -+ LDFLAGS="$LDFLAGS user32.lib" -+ export LDFLAGS -+ cf_cv_shlib_version=msvcdll -+ cf_cv_shlib_version_infix=msvcdll -+ shlibdir=$bindir -+ MAKE_DLLS= -+ if test "$DFT_LWR_MODEL" = "shared" ; then -+ LOCAL_LDFLAGS="-link -dll" -+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" -+ EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS" -+ fi -+ CC_SHARED_OPTS= -+ MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ ${LD} [$]{CFLAGS}' -+ RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib" -+ cat >mk_shared_lib.sh <<-CF_EOF -+ #!$SHELL -+ SHARED_LIB=\[$]1 -+ IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.lib/'\` -+ shift -+ my_ld=\[$]1 -+ shift -+ cat <<-EOF -+ Linking shared library -+ ** SHARED LIB \$SHARED_LIB -+ ** IMPORT_LIB \$IMPORT_LIB -+EOF -+ args=\$(echo \[$]* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g") -+ exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args -+ mv "\${IMPORT_LIB}" "\${IMPORT_LIB}" -+CF_EOF -+ chmod +x mk_shared_lib.sh -+ cat >mk_prog.sh <<-CF_EOF -+ #!$SHELL -+ shift -+ # Ignore first argument (compiler) and use LD (link.exe) unconditionally -+ LD="[$]LD" -+ clopts=() -+ ldopts=("/subsystem:console") -+ libs=() -+ isdll=0 -+ while test \[$]# -gt 0; do -+ case "\[$]1" in -+ -link | -MT | -MD | -MTd | -MDd) -+ # ignore -link argument -+ ;; -+ -dll) -+ isdll=1 -+ ;; -+ -W* | -w*) -+ # ignore warnings -+ ;; -+ -D*) -+ clopts+=("\[$]1") -+ ;; -+ -I*) -+ clopts+=("\[$]1") -+ ;; -+ -l*) -+ libs+=("\`echo \"\[$]1\" | sed \"s/^-l//\"\`") -+ ;; -+ -L*) -+ ldopts+=("\`echo \"\[$]1\" | sed \"s/^-L/-LIBPATH:/\"\`") -+ ;; -+ *.obj | *.o) -+ ldopts+=("\[$]1") -+ ;; -+ -Wl,*) -+ for linkarg in \`echo '\[$]1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do -+ ldopts+=("\[$]{linkarg}") -+ done -+ ;; -+ *.lib) -+ ldopts+=("\[$]1") -+ ;; -+ -o) -+ shift -+ ldopts+=("-out:\[$]1") -+ ;; -+ *) -+ clopts+=("\[$]1") -+ ldopts+=("\[$]1") -+ ;; -+ esac -+ shift -+ done -+ if [[ "\$isdll" -ne 0 ]]; then -+ for lib in \[$]{libs[[*]]}; do -+ ldopts+=("\[$]lib.dll.lib") -+ done -+ else -+ for lib in \[$]{libs[[*]]}; do -+ ldopts+=("\[$]lib.lib") -+ done -+ fi -+ cat <<-EOF -+ Creating program -+ ** ld options: "\[$]{ldopts[[@]]}" -+EOF -+ exec \[$]LD \[$]{ldopts[[@]]} -+CF_EOF -+ chmod +x mk_prog.sh -+ LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh" -+ ;; - (mingw*) - cf_cv_shlib_version=mingw - cf_cv_shlib_version_infix=mingw ---- configure.in -+++ configure.in -@@ -2181,6 +2181,17 @@ fi - fi - WITH_OVERWRITE=$with_overwrite - -+### At least on MinGW a shared library build without libtool -+### requires adding the additional libs to the link list. -+case $cf_cv_system_name in -+(*mingw32*|*mingw64*) -+ if test "$DFT_LWR_MODEL" != "libtool"; then -+ SHLIB_LIST="$SHLIB_LIST ${LIBS}" -+ fi -+ ;; -+*) ;; -+esac -+ - AC_SUBST(WITH_OVERWRITE) - AC_SUBST(TICS_LIST) - AC_SUBST(TINFO_LIST) -diff --git a/mk-1st.awk b/mk-1st.awk -index 480baad6..b6b7b06d 100644 ---- a/mk-1st.awk -+++ b/mk-1st.awk -@@ -75,7 +75,9 @@ function lib_name_of(a_name) { - function imp_name_of(a_name) { - if (ShlibVerInfix == "cygdll" || ShlibVerInfix == "msysdll" || ShlibVerInfix == "mingw") { - result = sprintf("%s%s%s.a", prefix, a_name, suffix); -- } else { -+ } else if (ShlibVerInfix == "msvcdll") { -+ result = sprintf("%s%s%s.lib", prefix, a_name, suffix); -+ } else{ - result = ""; - } - return result; -@@ -86,7 +88,7 @@ function abi_name_of(a_name) { - result = sprintf("%s%s$(ABI_VERSION)%s", "cyg", a_name, suffix); - } else if (ShlibVerInfix == "msysdll") { - result = sprintf("%s%s$(ABI_VERSION)%s", "msys-", a_name, suffix); -- } else if (ShlibVerInfix == "mingw") { -+ } else if (ShlibVerInfix == "mingw" || ShlibVerInfix == "msvcdll") { - result = sprintf("%s%s$(ABI_VERSION)%s", prefix, a_name, suffix); - } else if (ShlibVerInfix == "yes") { - result = sprintf("%s%s.$(ABI_VERSION)%s", prefix, a_name, suffix); -@@ -101,7 +103,7 @@ function rel_name_of(a_name) { - result = sprintf("%s%s$(REL_VERSION)%s", "cyg", a_name, suffix); - } else if (ShlibVerInfix == "msysdll") { - result = sprintf("%s%s$(ABI_VERSION)%s", "msys-", a_name, suffix); -- } else if (ShlibVerInfix == "mingw") { -+ } else if (ShlibVerInfix == "mingw" || ShlibVerInfix == "msvcdll") { - result = sprintf("%s%s$(REL_VERSION)%s", prefix, a_name, suffix); - } else if (ShlibVerInfix == "yes") { - result = sprintf("%s%s.$(REL_VERSION)%s", prefix, a_name, suffix); -@@ -119,7 +121,7 @@ function end_name_of(a_name) { - } else { - if ( ShlibVer == "rel" ) { - result = rel_name_of(a_name); -- } else if ( ShlibVer == "abi" || ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" ) { -+ } else if ( ShlibVer == "abi" || ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll" ) { - result = abi_name_of(a_name); - } else { - result = lib_name_of(a_name); -@@ -175,7 +177,7 @@ function make_shlib(objs, shlib_list) { - printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(%s)\n", objs, shlib_list - } - function sharedlinks(directory) { -- if ( ShlibVer != "auto" && ShlibVer != "cygdll" && ShlibVer != "msysdll" && ShlibVer != "mingw" ) { -+ if ( ShlibVer != "auto" && ShlibVer != "cygdll" && ShlibVer != "msysdll" && ShlibVer != "mingw" && ShlibVer != "msvcdll" ) { - printf "\tcd %s && (", directory - if ( DoLinks == "reverse" ) { - if ( ShlibVer == "rel" ) { -@@ -375,7 +377,7 @@ END { - print "install \\" - print "install.libs \\" - -- if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw") { -+ if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll") { - - dst_dirs = "$(DESTDIR)$(bindir) $(DESTDIR)$(libdir)"; - printf "install.%s :: %s $(LIBRARIES)\n", name, dst_dirs -@@ -396,8 +398,13 @@ END { - - if ( overwrite == "yes" && name == "ncurses" ) - { -- if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw") { -- ovr_name = sprintf("libcurses%s.a", suffix) -+ if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || SlibVer == "msvcdll") { -+ if (ShlibVer == "msvcdll") { -+ curses_prefix = "" -+ } else { -+ curses_prefix = "lib" -+ } -+ ovr_name = sprintf("%scurses%s.a", curses_prefix, suffix) - printf "\t@echo linking %s to %s\n", imp_name, ovr_name - printf "\tcd $(DESTDIR)$(libdir) && (" - symlink(imp_name, ovr_name) -@@ -417,7 +424,7 @@ END { - print "uninstall \\" - print "uninstall.libs \\" - printf "uninstall.%s ::\n", name -- if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw") { -+ if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll") { - - printf "\t@echo uninstalling $(DESTDIR)$(bindir)/%s\n", end_name - printf "\t-@rm -f $(DESTDIR)$(bindir)/%s\n", end_name --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0013-Fix-lib_gen.c.patch b/recipes/ncurses/all/patches/6.2.0-0013-Fix-lib_gen.c.patch deleted file mode 100644 index 591da3292bdf0..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0013-Fix-lib_gen.c.patch +++ /dev/null @@ -1,45 +0,0 @@ -Upstreamed in 3e37c7d3fa122563a9d88168926f61286ef30cd3 - -ncurses 6.2 - patch 20200523 - -From 2735f43727f8cef9edb406dc361a51014807788c Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Wed, 26 Feb 2020 19:24:16 +0100 -Subject: [PATCH 13/15] Fix lib_gen.c - -Fixes these kind of errors on MSVC -../ncurses/lib_gen.c(23): error C2059: syntax error: '(' - -(required for static build) - -../ncurses/lib_gen.c(30): error C2059: syntax error: '(' -../ncurses/lib_gen.c(37): error C2059: syntax error: '(' -../ncurses/lib_gen.c(44): error C2059: syntax error: '(' -../ncurses/lib_gen.c(51): error C2059: syntax error: '(' -../ncurses/lib_gen.c(58): error C2059: syntax error: '(' -../ncurses/lib_gen.c(65): error C2059: syntax error: '(' -../ncurses/lib_gen.c(72): error C2059: syntax error: '(' -../ncurses/lib_gen.c(79): error C2059: syntax error: '(' -../ncurses/lib_gen.c(86): error C2059: syntax error: '(' -(and more) - ---- - ncurses/base/MKlib_gen.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh -index 5a3770e5..5e646e66 100755 ---- a/ncurses/base/MKlib_gen.sh -+++ b/ncurses/base/MKlib_gen.sh -@@ -178,7 +178,7 @@ EOF3 - - if test "$USE" = generated ; then - cat >$ED4 < -Date: Mon, 16 Mar 2020 11:01:28 +0100 -Subject: [PATCH 14/15] avoid macro expansion in args by defining - NCURSES_NOMACROS in ncurses/lib_gen.c - -Macro expansion from macros in curses.h(.in) will lead to: - -spec(dllexport) int __cdecl -waddchnstr(stdscr,(const chtype * z),-1) -{ - ; - return waddchnstr(stdscr,(z),-1); -} - -__declspec(dllexport) int __cdecl -waddnstr(stdscr,(const char * a1),(int z)) -{ - ; - return waddnstr(stdscr,(a1),(z)); -} - -__declspec(dllexport) int __cdecl -waddnstr(stdscr,(const char * z),-1) -{ - ; - return waddnstr(stdscr,(z),-1); -} - ---- - ncurses/base/MKlib_gen.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh -index 5e646e66..f57cd55f 100755 ---- a/ncurses/base/MKlib_gen.sh -+++ b/ncurses/base/MKlib_gen.sh -@@ -432,7 +432,7 @@ BEGIN { - print "#define NCURSES_ATTR_T int" - print "#include " - print "" -- print "#undef NCURSES_NOMACROS /* _this_ file uses macros */" -+ print "#define NCURSES_NOMACROS 1" - print "" - print "#include " - print "" --- -2.21.1 - diff --git a/recipes/ncurses/all/patches/6.2.0-0015-MSVC-access-does-not-support-X_OK.patch b/recipes/ncurses/all/patches/6.2.0-0015-MSVC-access-does-not-support-X_OK.patch deleted file mode 100644 index 76f47d3a9f588..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0015-MSVC-access-does-not-support-X_OK.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- ncurses/tinfo/access.c -+++ ncurses/tinfo/access.c -@@ -41,6 +41,13 @@ - - #define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c)) - -+#ifdef _MSC_VER -+# define ACCESS(FN, MODE) access((FN), (MODE)&(R_OK|W_OK)) -+#else -+# define ACCESS access -+#endif -+ -+ - NCURSES_EXPORT(char *) - _nc_rootname(char *path) - { -@@ -112,7 +119,7 @@ - - if (path == 0) { - result = -1; -- } else if (access(path, mode) < 0) { -+ } else if (ACCESS(path, mode) < 0) { - if ((mode & W_OK) != 0 - && errno == ENOENT - && strlen(path) < PATH_MAX) { -@@ -127,7 +134,7 @@ _nc_access(const char *path, int mode) - if (head == leaf) - _nc_STRCPY(head, ".", sizeof(head)); - -- result = access(head, R_OK | W_OK | X_OK); -+ result = ACCESS(head, R_OK | W_OK | X_OK); - } else { - result = -1; - } diff --git a/recipes/ncurses/all/patches/6.2.0-0016-msvc-has-wchar-support.patch b/recipes/ncurses/all/patches/6.2.0-0016-msvc-has-wchar-support.patch deleted file mode 100644 index 919d4eb50dbff..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0016-msvc-has-wchar-support.patch +++ /dev/null @@ -1,34 +0,0 @@ -d61c3c6a ("ncurses 6.2 - patch 20200711", 2020-07-12) - ---- a/ncurses/curses.priv.h -+++ b/ncurses/curses.priv.h -@@ -2343,7 +2343,7 @@ extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *); - */ - #if USE_WIDEC_SUPPORT - --#if defined(_WIN32) -+#if defined(_WIN32) && !defined(_MSC_VER) - /* - * MinGW has wide-character functions, but they do not work correctly. - */ ---- a/ncurses/widechar/lib_cchar.c -+++ b/ncurses/widechar/lib_cchar.c -@@ -35,6 +35,7 @@ - */ - - #include -+#include - - MODULE_ID("$Id: lib_cchar.c,v 1.33 2020/02/02 23:34:34 tom Exp $") - ---- a/ncurses/widechar/widechars.c -+++ b/ncurses/widechar/widechars.c -@@ -33,7 +33,7 @@ - - MODULE_ID("$Id: widechars.c,v 1.7 2020/02/02 23:34:34 tom Exp $") - --#if defined(_WIN32) -+#if defined(_WIN32) && !defined(_MSC_VER) - /* - * MinGW has wide-character functions, but they do not work correctly. - */ diff --git a/recipes/ncurses/all/patches/6.2.0-0017-msvc-fix-tests.patch b/recipes/ncurses/all/patches/6.2.0-0017-msvc-fix-tests.patch deleted file mode 100644 index f5276b3ee5fda..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0017-msvc-fix-tests.patch +++ /dev/null @@ -1,50 +0,0 @@ -d61c3c6a ("ncurses 6.2 - patch 20200711", 2020-07-12) - ---- test/picsmap.c -+++ test/picsmap.c -@@ -955,6 +955,20 @@ parse_rgb(char **data) - return result; - } - -+#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c)) -+ -+static int -+CaselessCmp(const char *a, const char *b) -+{ /* strcasecmp isn't portable */ -+ while (*a && *b) { -+ int cmp = LOWERCASE(*a) - LOWERCASE(*b); -+ if (cmp != 0) -+ break; -+ a++, b++; -+ } -+ return LOWERCASE(*a) - LOWERCASE(*b); -+} -+ - static RGB_NAME * - lookup_rgb(const char *name) - { -@@ -962,7 +976,7 @@ lookup_rgb(const char *name) - if (rgb_table != 0) { - int n; - for (n = 0; rgb_table[n].name != 0; ++n) { -- if (!strcasecmp(name, rgb_table[n].name)) { -+ if (!CaselessCmp(name, rgb_table[n].name)) { - result = &rgb_table[n]; - break; - } ---- test/test.priv.h -+++ test/test.priv.h -@@ -437,6 +437,13 @@ extern int optind; - #include - #include - -+#if defined(_MSC_VER) -+#undef popen -+#define popen(s,n) _popen(s,n) -+#undef pclose -+#define pclose(s) _pclose(s) -+#endif -+ - #ifndef GCC_NORETURN - #define GCC_NORETURN /* nothing */ - #endif diff --git a/recipes/ncurses/all/patches/6.2.0-0018-missing-functions-c-linkage.patch b/recipes/ncurses/all/patches/6.2.0-0018-missing-functions-c-linkage.patch deleted file mode 100644 index a47d3777212a3..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0018-missing-functions-c-linkage.patch +++ /dev/null @@ -1,25 +0,0 @@ - ---- include/nc_mingw.h -+++ include/nc_mingw.h -@@ -62,6 +62,10 @@ - - #include - -+#ifdef __cplusplus -+extern "C" { -+#endif -+ - NCURSES_EXPORT(int) _nc_gettimeofday(struct timeval *, void *); - - #undef HAVE_GETTIMEOFDAY -@@ -75,6 +79,10 @@ - #define wcwidth(ucs) _nc_wcwidth((wchar_t)(ucs)) - NCURSES_EXPORT(int) _nc_wcwidth(wchar_t); - -+#ifdef __cplusplus -+} -+#endif -+ - #endif /* _WIN32 */ - - #endif /* NC_MINGW_H */ diff --git a/recipes/ncurses/all/patches/6.2.0-0019-Run-autoreconf.patch b/recipes/ncurses/all/patches/6.2.0-0019-Run-autoreconf.patch deleted file mode 100644 index ec7887edfac48..0000000000000 --- a/recipes/ncurses/all/patches/6.2.0-0019-Run-autoreconf.patch +++ /dev/null @@ -1,565 +0,0 @@ ---- configure -+++ configure -@@ -4750,49 +4750,65 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - -- cf_cv_ar_flags=unknown -- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv -- do -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_cv_ar_flags='' -+ cat >mk_static_lib.sh <<-EOF -+ #!$SHELL -+ MSVC_BIN="$AR" -+ out="\$1" -+ shift -+ exec \$MSVC_BIN -out:"\$out" \$@ -+ EOF -+ chmod +x mk_static_lib.sh -+ AR=`pwd`/mk_static_lib.sh -+ ;; -+ (*) -+ cf_cv_ar_flags=unknown -+ for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv -+ do - -- # check if $ARFLAGS already contains this choice -- if test "x$ARFLAGS" != "x" ; then -- cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` -- if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then -- cf_cv_ar_flags= -- break -+ # check if $ARFLAGS already contains this choice -+ if test "x$ARFLAGS" != "x" ; then -+ cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` -+ if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then -+ cf_cv_ar_flags= -+ break -+ fi - fi -- fi - -- rm -f conftest.$ac_cv_objext -- rm -f conftest.a -+ rm -f conftest.$ac_cv_objext -+ rm -f conftest.a - -- cat >conftest.$ac_ext <&5 -+ cat >conftest.$ac_ext <<-EOF -+ #line 4784 "configure" -+ int testdata[3] = { 123, 456, 789 }; -+ EOF -+ if { (eval echo "$as_me:4787: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? -- echo "$as_me:4776: \$? = $ac_status" >&5 -+ echo "$as_me:4790: \$? = $ac_status" >&5 - (exit $ac_status); } ; then -- echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 -- $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null -- if test -f conftest.a ; then -- cf_cv_ar_flags=$cf_ar_flags -- break -- fi -- else -- test -n "$verbose" && echo " cannot compile test-program" 1>&6 -+ echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 -+ $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null -+ if test -f conftest.a ; then -+ cf_cv_ar_flags=$cf_ar_flags -+ break -+ fi -+ else -+ test -n "$verbose" && echo " cannot compile test-program" 1>&6 - --echo "${as_me:-configure}:4787: testing cannot compile test-program ..." 1>&5 -+echo "${as_me:-configure}:4801: testing cannot compile test-program ..." 1>&5 - -- break -- fi -- done -- rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext -+ break -+ fi -+ done -+ rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext -+ ;; -+ esac - - fi --echo "$as_me:4795: result: $cf_cv_ar_flags" >&5 -+echo "$as_me:4811: result: $cf_cv_ar_flags" >&5 - echo "${ECHO_T}$cf_cv_ar_flags" >&6 - - if test -n "$ARFLAGS" ; then -@@ -5474,6 +5490,9 @@ - LIB_PREFIX='' - fi - ;; -+ (*-msvc*) -+ LIB_PREFIX='' -+ ;; - (*) LIB_PREFIX='lib' - ;; - esac -@@ -5961,6 +5980,110 @@ - - MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' - ;; -+ (mingw*msvc*) -+ LDFLAGS="$LDFLAGS user32.lib" -+ export LDFLAGS -+ cf_cv_shlib_version=msvcdll -+ cf_cv_shlib_version_infix=msvcdll -+ shlibdir=$bindir -+ MAKE_DLLS= -+ if test "$DFT_LWR_MODEL" = "shared" ; then -+ LOCAL_LDFLAGS="-link -dll" -+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" -+ EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS" -+ fi -+ CC_SHARED_OPTS= -+ MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}' -+ RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib" -+ cat >mk_shared_lib.sh <<-CF_EOF -+ #!$SHELL -+ SHARED_LIB=\$1 -+ IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\` -+ shift -+ my_ld=\$1 -+ shift -+ cat <<-EOF -+ Linking shared library -+ ** SHARED LIB \$SHARED_LIB -+ ** IMPORT_LIB \$IMPORT_LIB -+EOF -+ args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g") -+ exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args -+ mv "\${IMPORT_LIB}" "\${IMPORT_LIB}" -+CF_EOF -+ chmod +x mk_shared_lib.sh -+ cat >mk_prog.sh <<-CF_EOF -+ #!$SHELL -+ shift -+ # Ignore first argument (compiler) and use LD (link.exe) unconditionally -+ LD="$LD" -+ clopts=() -+ ldopts=("/subsystem:console") -+ libs=() -+ isdll=0 -+ while test \$# -gt 0; do -+ case "\$1" in -+ -link | -MT | -MD | -MTd | -MDd) -+ # ignore -link argument -+ ;; -+ -dll) -+ isdll=1 -+ ;; -+ -W* | -w*) -+ # ignore warnings -+ ;; -+ -D*) -+ clopts+=("\$1") -+ ;; -+ -I*) -+ clopts+=("\$1") -+ ;; -+ -l*) -+ libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`") -+ ;; -+ -L*) -+ ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`") -+ ;; -+ *.obj | *.o) -+ ldopts+=("\$1") -+ ;; -+ -Wl,*) -+ for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do -+ ldopts+=("\${linkarg}") -+ done -+ ;; -+ *.lib) -+ ldopts+=("\$1") -+ ;; -+ -o) -+ shift -+ ldopts+=("-out:\$1") -+ ;; -+ *) -+ clopts+=("\$1") -+ ldopts+=("\$1") -+ ;; -+ esac -+ shift -+ done -+ if [ "\$isdll" -ne 0 ]; then -+ for lib in \${libs[*]}; do -+ ldopts+=("\$lib.dll.lib") -+ done -+ else -+ for lib in \${libs[*]}; do -+ ldopts+=("\$lib.lib") -+ done -+ fi -+ cat <<-EOF -+ Creating program -+ ** ld options: "\${ldopts[@]}" -+EOF -+ exec \$LD \${ldopts[@]} -+CF_EOF -+ chmod +x mk_prog.sh -+ LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh" -+ ;; - (mingw*) - cf_cv_shlib_version=mingw - cf_cv_shlib_version_infix=mingw -@@ -7516,26 +7639,26 @@ - - # either way, check for the library header files - --for ac_header in pcre2-posix.h pcreposix.h -+for ac_header in pcre2posix.h pcreposix.h - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --echo "$as_me:7522: checking for $ac_header" >&5 -+echo "$as_me:7643: checking for $ac_header" >&5 - echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 - if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF --#line 7528 "configure" -+#line 7649 "configure" - #include "confdefs.h" - #include <$ac_header> - _ACEOF --if { (eval echo "$as_me:7532: \"$ac_cpp conftest.$ac_ext\"") >&5 -+if { (eval echo "$as_me:7653: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 -- echo "$as_me:7538: \$? = $ac_status" >&5 -+ echo "$as_me:7659: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag -@@ -9897,7 +10018,7 @@ - rm -f conftest.$ac_objext conftest.$ac_ext - fi - --echo "${as_me:-configure}:9900: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 -+echo "${as_me:-configure}:10021: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 - - CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS" -@@ -25163,11 +25286,25 @@ - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; - (Xdebug) -- DFT_LIB_SUFFIX='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ DFT_LIB_SUFFIX='_g.lib' -+ ;; -+ (*) -+ DFT_LIB_SUFFIX='_g.a' -+ ;; -+ esac - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; - (Xprofile) -- DFT_LIB_SUFFIX='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ DFT_LIB_SUFFIX='_p.lib' -+ ;; -+ (*) -+ DFT_LIB_SUFFIX='_p.a' -+ ;; -+ esac - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; - (Xshared) -@@ -25176,6 +25313,10 @@ - DFT_LIB_SUFFIX='.so' - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; -+ (*-msvc*) -+ DFT_LIB_SUFFIX='.dll' -+ DFT_DEP_SUFFIX='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - DFT_LIB_SUFFIX='.dll' - DFT_DEP_SUFFIX='.dll.a' -@@ -25203,7 +25344,14 @@ - esac - ;; - (*) -- DFT_LIB_SUFFIX='.a' -+ case $target in -+ (*-msvc*) -+ DFT_LIB_SUFFIX='.lib' -+ ;; -+ (*) -+ DFT_LIB_SUFFIX='.a' -+ ;; -+ esac - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; - esac -@@ -25252,11 +25400,25 @@ - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; - (Xdebug) -- CXX_LIB_SUFFIX='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ CXX_LIB_SUFFIX='_g.lib' -+ ;; -+ (*) -+ CXX_LIB_SUFFIX='_g.a' -+ ;; -+ esac - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; - (Xprofile) -- CXX_LIB_SUFFIX='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ CXX_LIB_SUFFIX='_p.lib' -+ ;; -+ (*) -+ CXX_LIB_SUFFIX='_p.a' -+ ;; -+ esac - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; - (Xshared) -@@ -25265,6 +25427,10 @@ - CXX_LIB_SUFFIX='.so' - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; -+ (*-msvc*) -+ CXX_LIB_SUFFIX='.dll' -+ CXX_DEP_SUFFIX='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - CXX_LIB_SUFFIX='.dll' - CXX_DEP_SUFFIX='.dll.a' -@@ -25292,7 +25458,14 @@ - esac - ;; - (*) -- CXX_LIB_SUFFIX='.a' -+ case $target in -+ (*-msvc*) -+ CXX_LIB_SUFFIX='.lib' -+ ;; -+ (*) -+ CXX_LIB_SUFFIX='.a' -+ ;; -+ esac - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; - esac -@@ -25586,12 +25759,23 @@ - if test "$with_overwrite" != no ; then - if test "$NCURSES_LIBUTF8" = 1 ; then - NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' -- { echo "$as_me:25589: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 -+ { echo "$as_me:25760: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 - echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;} - fi - fi - WITH_OVERWRITE=$with_overwrite - -+### At least on MinGW a shared library build without libtool -+### requires adding the additional libs to the link list. -+case $cf_cv_system_name in -+(*mingw32*|*mingw64*) -+ if test "$DFT_LWR_MODEL" != "libtool"; then -+ SHLIB_LIST="$SHLIB_LIST ${LIBS}" -+ fi -+ ;; -+*) ;; -+esac -+ - # used to separate tack out of the tree - NCURSES_TREE= - -@@ -26124,7 +26308,7 @@ - #define HAVE_CURSES_DATA_BOOLNAMES 1 - EOF - --ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" -+ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/ncurses_exports.h include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" - ac_config_commands="$ac_config_commands default" - cat >confcache <<\_ACEOF - # This file is a shell script that caches the results of configure -@@ -26513,13 +26697,14 @@ - "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;; - "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;; - "include/ncurses_dll.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_dll.h" ;; -+ "include/ncurses_exports.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_exports.h" ;; - "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; - "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; - "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; -- *) { { echo "$as_me:26522: error: invalid argument: $ac_config_target" >&5 -+ *) { { echo "$as_me:26705: error: invalid argument: $ac_config_target" >&5 - echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -@@ -27317,7 +27502,7 @@ - cf_prefix=$LIB_PREFIX - - case $cf_cv_shlib_version in --(cygdll|msysdll|mingw) -+(cygdll|msysdll|mingw|msvcdll) - TINFO_NAME=$TINFO_ARG_SUFFIX - TINFO_SUFFIX=.dll - ;; -@@ -27390,11 +27575,25 @@ - cf_depsuf=$cf_suffix - ;; - (Xdebug) -- cf_suffix='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_suffix='_g.lib' -+ ;; -+ (*) -+ cf_suffix='_g.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - (Xprofile) -- cf_suffix='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_suffix='_p.lib' -+ ;; -+ (*) -+ cf_suffix='_p.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - (Xshared) -@@ -27403,6 +27602,10 @@ - cf_suffix='.so' - cf_depsuf=$cf_suffix - ;; -+ (*-msvc*) -+ cf_suffix='.dll' -+ cf_depsuf='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - cf_suffix='.dll' - cf_depsuf='.dll.a' -@@ -27430,7 +27633,14 @@ - esac - ;; - (*) -- cf_suffix='.a' -+ case $target in -+ (*-msvc*) -+ cf_suffix='.lib' -+ ;; -+ (*) -+ cf_suffix='.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - esac -@@ -27496,6 +27706,10 @@ - cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` - cf_add_lib="../lib/lib${cf_libname}${cf_cygsuf}" - ;; -+ (msvcdll) -+ cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` -+ cf_add_lib="../lib/${cf_libname}${cf_cygsuf}" -+ ;; - (*) - cf_add_lib= - ;; -@@ -27592,10 +27806,10 @@ - CXX_MODEL=$cf_ITEM - if test "$CXX_MODEL" = SHARED; then - case $cf_cv_shlib_version in -- (cygdll|msysdll|mingw) -+ (cygdll|msysdll|mingw|msvcdll) - test "x$with_shared_cxx" = xno && test -n "$verbose" && echo " overriding CXX_MODEL to SHARED" 1>&6 - --echo "${as_me:-configure}:27598: testing overriding CXX_MODEL to SHARED ..." 1>&5 -+echo "${as_me:-configure}:27810: testing overriding CXX_MODEL to SHARED ..." 1>&5 - - with_shared_cxx=yes - ;; -@@ -27611,11 +27825,25 @@ - cf_depsuf=$cf_suffix - ;; - (Xdebug) -- cf_suffix='_g.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_suffix='_g.lib' -+ ;; -+ (*) -+ cf_suffix='_g.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - (Xprofile) -- cf_suffix='_p.a' -+ case $cf_cv_system_name in -+ (*-msvc*) -+ cf_suffix='_p.lib' -+ ;; -+ (*) -+ cf_suffix='_p.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - (Xshared) -@@ -27624,6 +27852,10 @@ - cf_suffix='.so' - cf_depsuf=$cf_suffix - ;; -+ (*-msvc*) -+ cf_suffix='.dll' -+ cf_depsuf='.dll.lib' -+ ;; - (cygwin*|msys*|mingw*) - cf_suffix='.dll' - cf_depsuf='.dll.a' -@@ -27651,7 +27883,14 @@ - esac - ;; - (*) -- cf_suffix='.a' -+ case $target in -+ (*-msvc*) -+ cf_suffix='.lib' -+ ;; -+ (*) -+ cf_suffix='.a' -+ ;; -+ esac - cf_depsuf=$cf_suffix - ;; - esac diff --git a/recipes/ncurses/config.yml b/recipes/ncurses/config.yml index 1c6db8931421d..8ccaa404ee598 100644 --- a/recipes/ncurses/config.yml +++ b/recipes/ncurses/config.yml @@ -1,7 +1,7 @@ versions: + "6.5": + folder: all "6.4": folder: all "6.3": folder: all - "6.2": - folder: all diff --git a/recipes/neargye-semver/all/conandata.yml b/recipes/neargye-semver/all/conandata.yml index 98327d51fc307..6859f75eb1461 100644 --- a/recipes/neargye-semver/all/conandata.yml +++ b/recipes/neargye-semver/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.3.1": + url: "https://github.com/Neargye/semver/archive/refs/tags/v0.3.1.tar.gz" + sha256: "422b5882460a685a455fda9da53b85aa1824dcb9ba9dfbd0460ce50393f71061" "0.3.0": url: "https://github.com/Neargye/semver/archive/refs/tags/v0.3.0.tar.gz" sha256: "f88697a059e7a850ca65315828682e14c34958fb585c3b8555b9d89f5c76e3cc" diff --git a/recipes/neargye-semver/all/test_v1_package/CMakeLists.txt b/recipes/neargye-semver/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/neargye-semver/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/neargye-semver/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", "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/neargye-semver/config.yml b/recipes/neargye-semver/config.yml index d126790212e0c..f9de643fda854 100644 --- a/recipes/neargye-semver/config.yml +++ b/recipes/neargye-semver/config.yml @@ -1,3 +1,5 @@ versions: + "0.3.1": + folder: all "0.3.0": folder: all diff --git a/recipes/net-snmp/all/conandata.yml b/recipes/net-snmp/all/conandata.yml index 269a227ecf9b0..9ad5ce20f2145 100644 --- a/recipes/net-snmp/all/conandata.yml +++ b/recipes/net-snmp/all/conandata.yml @@ -1,14 +1,13 @@ sources: - "5.9.1": - sha256: "75b59d67e871aaaa31c8cef89ba7d06972782b97736b7e8c3399f36b50a8816f" - url: https://sourceforge.net/projects/net-snmp/files/net-snmp/5.9.1/net-snmp-5.9.1.zip/download + "5.9.4": + url: "https://sourceforge.net/projects/net-snmp/files/net-snmp/5.9.4/net-snmp-5.9.4.zip/download" + sha256: "ceea0c876f23b87731de2073e6a3a683ea610c66a5a67b5cabf4986b7813c22b" patches: - "5.9.1": + "5.9.4": - patch_file: patches/0001-fix-openssl-linking-msvc.patch - base_path: "" + patch_description: "Use Conan OpenSSL when linking on Windows" + patch_source: "https://github.com/net-snmp/net-snmp/commit/99332c80b68248cb60023d12297135dc9c6c8abf" - patch_file: patches/0002-install-only-libnetsnmp.patch - base_path: "" + patch_description: "Avoid install extra helper libraries" - patch_file: patches/0003-fix-perl-scripts-msvc.patch - base_path: "" - - patch_file: patches/0004-fix-apple-arm64-build.patch - base_path: "" + patch_description: "Avoid injecting extra flags when running perl" diff --git a/recipes/net-snmp/all/conanfile.py b/recipes/net-snmp/all/conanfile.py index cf81f5bab247a..68f4965c95152 100644 --- a/recipes/net-snmp/all/conanfile.py +++ b/recipes/net-snmp/all/conanfile.py @@ -1,11 +1,17 @@ -import functools import os import stat -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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, replace_in_file, rm, rmdir, chdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, NMakeToolchain +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class NetSnmpConan(ConanFile): @@ -15,10 +21,12 @@ class NetSnmpConan(ConanFile): "for monitoring the health and welfare of network equipment " "(eg. routers), computer equipment and even devices like UPSs." ) + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.net-snmp.org/" topics = "snmp" - license = "BSD-3-Clause" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,21 +38,9 @@ class NetSnmpConan(ConanFile): "fPIC": True, "with_ipv6": True, } - requires = "openssl/1.1.1m" - exports_sources = "patches/*" - @property - def _is_msvc(self): - return self.settings.compiler in ("Visual Studio", "msvc") - - def validate(self): - if self.settings.os == "Windows" and not self._is_msvc: - raise ConanInvalidConfiguration( - "net-snmp is setup to build only with MSVC on Windows" - ) - - def source(self): - tools.get(**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": @@ -52,145 +48,174 @@ 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): + self.requires("openssl/[>=1.1 <4]") + self.requires("pcre/8.45") + self.requires("zlib/[>=1.2.11 <2]") + + def validate(self): + if is_msvc(self) and self.options.shared: + # FIXME: Linker errors against third-party dependencies: + # snmp_openssl.obj : error LNK2019: unresolved external symbol CRYPTO_free referenced in function _extract_oname + raise ConanInvalidConfiguration(f"{self.ref} fails when building as shared library, use -o '&:shared=False'. Contributions are welcome!") def build_requirements(self): - if self._is_msvc: - self.build_requires("strawberryperl/5.30.0.1") + if is_msvc(self): + self.tool_requires("strawberryperl/5.32.1.1") + else: + self.tool_requires("gnu-config/cci.20210814") + self.tool_requires("autoconf/2.71") + self.tool_requires("automake/1.16.5") + 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.2.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) @property def _is_debug(self): return self.settings.build_type == "Debug" + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + # Workaround for "unresolved external symbol" errors during shared build + env = VirtualRunEnv(self) + env.generate(scope="build") + else: + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + debug_flag = "enable" if self._is_debug else "disable" + ipv6_flag = "enable" if self.options.with_ipv6 else "disable" + openssl_path = self.dependencies["openssl"].package_folder + zlib_path = self.dependencies["zlib"].package_folder + tc.configure_args += [ + f"--with-openssl={openssl_path}", + f"--with-zlib={zlib_path}", + f"--{debug_flag}-debugging", + f"--{ipv6_flag}-ipv6", + "--with-defaults", + "--without-rpm", + "--without-pcre", + "--disable-agent", + "--disable-applications", + "--disable-manuals", + "--disable-scripts", + "--disable-mibs", + "--disable-embedded-perl", + ] + if self.settings.os in ["Linux"]: + tc.extra_ldflags.append("-ldl") + tc.extra_ldflags.append("-lpthread") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + deps = PkgConfigDeps(self) + deps.generate() + def _patch_msvc(self): - ssl_info = self.deps_cpp_info["openssl"] - openssl_root = ssl_info.rootpath.replace("\\", "/") + ssl_info = self.dependencies["openssl"] + openssl_root = ssl_info.package_folder.replace("\\", "/") search_replace = [ - ( - r'$default_openssldir . "\\include"', - f"'{openssl_root}/include'" - ), + (r'$default_openssldir . "\\include"', f"'{openssl_root}/include'"), (r'$default_openssldir . "\\lib\\VC"', f"'{openssl_root}/lib'"), - ("$openssl = false", "$openssl = true") + ("$openssl = false", "$openssl = true"), ] if self._is_debug: search_replace.append(("$debug = false", "$debug = true")) if self.options.shared: - search_replace.append(( - "$link_dynamic = false", - "$link_dynamic = true" - )) + search_replace.append(("$link_dynamic = false", "$link_dynamic = true")) if self.options.with_ipv6: search_replace.append(("$b_ipv6 = false", "$b_ipv6 = true")) for search, replace in search_replace: - tools.replace_in_file("win32\\build.pl", search, replace) - runtime = self.settings.compiler.runtime - tools.replace_in_file("win32\\Configure", '"/runtime', f'"/{runtime}') + replace_in_file(self, "build.pl", search, replace) + replace_in_file(self, "Configure", '"/runtime', f'"/{msvc_runtime_flag(self)}') link_lines = "\n".join( f'# pragma comment(lib, "{lib}.lib")' - for lib in ssl_info.libs + ssl_info.system_libs + for lib in ssl_info.cpp_info.libs + ssl_info.cpp_info.system_libs ) - config = r"win32\net-snmp\net-snmp-config.h.in" - tools.replace_in_file(config, "/* Conan: system_libs */", link_lines) - - def _build_msvc(self): - if self.should_configure: - self._patch_msvc() - self.run("perl build.pl", cwd="win32") - if self.should_build: - with tools.vcvars(self): - self.run("nmake /nologo libsnmp", cwd="win32") - - @functools.lru_cache(1) - def _configure_autotools(self): - disabled_link_type = "static" if self.options.shared else "shared" - debug_flag = "enable" if self._is_debug else "disable" - ipv6_flag = "enable" if self.options.with_ipv6 else "disable" - ssl_path = self.deps_cpp_info["openssl"].rootpath - args = [ - "--with-defaults", - "--without-rpm", - "--without-pcre", - "--disable-agent", - "--disable-applications", - "--disable-manuals", - "--disable-scripts", - "--disable-mibs", - "--disable-embedded-perl", - f"--disable-{disabled_link_type}", - f"--{debug_flag}-debugging", - f"--{ipv6_flag}-ipv6", - f"--with-openssl={ssl_path}", - ] - autotools = AutoToolsBuildEnvironment(self) - autotools.libs = [] - autotools.configure(args=args) - return autotools + config = r"net-snmp\net-snmp-config.h.in" + replace_in_file(self, config, "/* Conan: system_libs */", link_lines) def _patch_unix(self): - tools.replace_in_file( - "configure", - "-install_name \\$rpath/", - "-install_name @rpath/" - ) - crypto_libs = self.deps_cpp_info["openssl"].system_libs + 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) + configure_path = os.path.join(self.source_folder, "configure") + replace_in_file(self, configure_path, + "-install_name \\$rpath/", + "-install_name @rpath/") + crypto_libs = self.dependencies["openssl"].cpp_info.system_libs if len(crypto_libs) != 0: crypto_link_flags = " -l".join(crypto_libs) - tools.replace_in_file( - "configure", + replace_in_file(self, configure_path, 'LIBCRYPTO="-l${CRYPTO}"', - 'LIBCRYPTO="-l${CRYPTO} -l%s"' % (crypto_link_flags,) - ) - tools.replace_in_file( - "configure", - 'LIBS="-lcrypto $LIBS"', - f'LIBS="-lcrypto -l{crypto_link_flags} $LIBS"' - ) + 'LIBCRYPTO="-l${CRYPTO} -l%s"' % (crypto_link_flags,)) + replace_in_file(self, configure_path, + 'LIBS="-lcrypto $LIBS"', + f'LIBS="-lcrypto -l{crypto_link_flags} $LIBS"') def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - if self._is_msvc: - self._build_msvc() + apply_conandata_patches(self) + if is_msvc(self): + with chdir(self, os.path.join(self.source_folder, "win32")): + self._patch_msvc() + self.run("perl build.pl") + self.run("nmake /nologo libsnmp") else: self._patch_unix() - os.chmod("configure", os.stat("configure").st_mode | stat.S_IEXEC) - self._configure_autotools()\ - .make(target="snmplib", args=["NOAUTODEPS=1"]) - - def _package_msvc(self): - cfg = "debug" if self._is_debug else "release" - self.copy("netsnmp.dll", "bin", fr"win32\bin\{cfg}") - self.copy("netsnmp.lib", "lib", fr"win32\lib\{cfg}") - self.copy("include/net-snmp/*.h") - for directory in ["", "agent/", "library/"]: - self.copy(f"net-snmp/{directory}*.h", "include", "win32") - self.copy("COPYING", "licenses") - - def _remove(self, path): - if os.path.isdir(path): - tools.rmdir(path) - else: - os.remove(path) - - def _package_unix(self): - self._configure_autotools().install(args=["NOAUTODEPS=1"]) - tools.remove_files_by_mask(self.package_folder, "README") - tools.rmdir(os.path.join(self.package_folder, "bin")) - lib_dir = os.path.join(self.package_folder, "lib") - for entry in os.listdir(lib_dir): - if not entry.startswith("libnetsnmp.") or entry.endswith(".la"): - self._remove(os.path.join(lib_dir, entry)) - self.copy("COPYING", "licenses") + configure_path = os.path.join(self.source_folder, "configure") + os.chmod(configure_path, os.stat(configure_path).st_mode | stat.S_IEXEC) + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make(target="snmplib", args=["NOAUTODEPS=1"]) def package(self): - if self._is_msvc: - self._package_msvc() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + if is_msvc(self): + cfg = "debug" if self._is_debug else "release" + copy(self, "netsnmp.lib", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.source_folder, rf"win32\lib\{cfg}")) + copy(self, "include/net-snmp/*.h", + dst=self.package_folder, + src=self.source_folder) + for directory in ["", "agent/", "library/"]: + copy(self, f"net-snmp/{directory}*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "win32")) else: - self._package_unix() + autotools = Autotools(self) + #only install with -j1 as parallel install will break dependencies. Probably a bug in the dependencies + #install specific targets instead of just everything as it will try to do perl stuff on you host machine + autotools.install(args=["-j1"], target="installsubdirs installlibs installprogs installheaders") + rm(self, "README", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "bin")) + rm(self, "*.la", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["netsnmp"] - self.cpp_info.requires = ["openssl::openssl"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["rt", "pthread", "m"]) + if is_apple_os(self): + self.cpp_info.frameworks.extend(["CoreFoundation", "DiskArbitration", "IOKit"]) diff --git a/recipes/net-snmp/all/patches/0003-fix-perl-scripts-msvc.patch b/recipes/net-snmp/all/patches/0003-fix-perl-scripts-msvc.patch index 992914c1a489c..5d1776394ec89 100644 --- a/recipes/net-snmp/all/patches/0003-fix-perl-scripts-msvc.patch +++ b/recipes/net-snmp/all/patches/0003-fix-perl-scripts-msvc.patch @@ -9,24 +9,25 @@ my $debug = false; my $configOpts; my $link_dynamic = false; -@@ -44,15 +44,7 @@ +@@ -44,7 +44,7 @@ # Path of this script (source tree path + "win32"). my $current_pwd = dirname(abs_path($0)); -if (!defined($ENV{MSVCDir}) && !defined($ENV{VCINSTALLDIR}) && -- !defined($ENV{TARGET_CPU})) { -- print "\nPlease run VCVARS32.BAT first to set up the Visual Studio build\n" . -- "environment.\n\n"; -- system("pause"); -- exit; --} -- ++if (0 && + !defined($ENV{TARGET_CPU})) { + print "\nPlease run VCVARS32.BAT first to set up the Visual Studio build\n" . + "environment.\n\n"; +@@ -52,7 +52,7 @@ + exit; + } + -while (1) { +while (0) { print "\n\nNet-SNMP build and install options\n"; print "==================================\n\n"; print "1. OpenSSL support: " . ($openssl ? "enabled" : "disabled"). "\n"; -@@ -192,6 +184,8 @@ +@@ -188,6 +188,8 @@ print "Running Configure...\n"; system("perl Configure $configOpts --linktype=$linktype --prefix=\"$install_base\"" . ($logging ? " > configure.out 2>&1" : "")) == 0 || die ($logging ? "Build error (see configure.out)" : "Build error (see above)"); @@ -35,6 +36,7 @@ print "Cleaning...\n"; system("nmake /nologo clean" . ($logging ? " > clean.out 2>&1" : "")) == 0 || die ($logging ? "Build error (see clean.out)" : "Build error (see above)"); + --- win32/Configure +++ win32/Configure @@ -6,7 +6,6 @@ @@ -45,16 +47,16 @@ use Getopt::Long; my $version = "unknown"; -@@ -190,8 +189,6 @@ +@@ -190,7 +189,6 @@ my $perl_inc = $opensslincdir ? "/I $opensslincdir" : ""; -my $perl_cflags = ExtUtils::Embed::ccopts(); -- - my %makefile_subs = ( - "app" => [ "^APPS=", "APPS=" . join(" ", @apps) ], - "apc" => [ "^APPS_CLEAN=", "APPS_CLEAN=" . join(" ", @apps_clean)], -@@ -205,29 +202,23 @@ + # Do not use $perl_cflags if these come from a Perl executable built with gcc. +-$perl_cflags = "" if $perl_cflags =~ / -pipe/; ++ + +@@ -207,29 +205,24 @@ "sdk" => [ "^SDK=", $sdk == 1 ? "SDK=true" : "SDK=false" ], "pin" => [ "^PERL_DEFINE=","PERL_DEFINE=$perl_define" ], "pdf" => [ "^PERL_INC=", "PERL_INC=$perl_inc" ], @@ -62,7 +64,7 @@ + "pcf" => [ "^PERL_CFLAGS=","PERL_CFLAGS=" ], "cfl" => [ "^CFLAGS=", "CFLAGS=$perl_define " . "/D WIN32_LEAN_AND_MEAN " . -- "/EHsc " . + "/EHsc " . - "/FD " . - "/FR\$(INTDIR)\\ " . "/Fd\$(INTDIR)\\\$(PROGNAME).pdb " . @@ -89,7 +91,7 @@ ], "rsc" => [ "^RSCFLAGS=", "RSCFLAGS=/l 0x409 " . ($config eq "release" ? "/d NDEBUG" : -@@ -308,9 +299,3 @@ +@@ -310,9 +303,3 @@ print " Blumenthal AES: " . ($blumenthal_aes ? "enabled" : "disabled") . "\n"; print " IPv6 transport: " . ($b_ipv6 == 1 ? "enabled" : "disabled") . "\n"; print " winExtDLL agent: " . ($b_winextdll == 1 ? "enabled" : "disabled") . "\n"; diff --git a/recipes/net-snmp/all/patches/0004-fix-apple-arm64-build.patch b/recipes/net-snmp/all/patches/0004-fix-apple-arm64-build.patch deleted file mode 100644 index 018c49021fc87..0000000000000 --- a/recipes/net-snmp/all/patches/0004-fix-apple-arm64-build.patch +++ /dev/null @@ -1,17 +0,0 @@ -Upstream suggests the just hardcode this value: -https://github.com/net-snmp/net-snmp/issues/295#issuecomment-1002631231 - ---- config.sub -+++ config.sub -@@ -120,6 +120,11 @@ - exit 1;; - esac - -+if [ "$1" = aarch64-apple-darwin ]; then -+ echo arm-apple-darwin -+ exit 0 -+fi -+ - # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` diff --git a/recipes/net-snmp/all/test_package/CMakeLists.txt b/recipes/net-snmp/all/test_package/CMakeLists.txt index bed2bf477f616..21569fa32fd1f 100644 --- a/recipes/net-snmp/all/test_package/CMakeLists.txt +++ b/recipes/net-snmp/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(net-snmp REQUIRED CONFIG) add_executable(test_package test_package.c) diff --git a/recipes/net-snmp/all/test_package/conanfile.py b/recipes/net-snmp/all/test_package/conanfile.py index 56657365795bd..ef5d7042163ec 100644 --- a/recipes/net-snmp/all/test_package/conanfile.py +++ b/recipes/net-snmp/all/test_package/conanfile.py @@ -1,19 +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 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) @@ -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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/net-snmp/all/test_package/test_package.c b/recipes/net-snmp/all/test_package/test_package.c index db6d49e73a2f8..dbe79814204fe 100644 --- a/recipes/net-snmp/all/test_package/test_package.c +++ b/recipes/net-snmp/all/test_package/test_package.c @@ -2,12 +2,8 @@ #include #include -int main(int argc, char const* argv[]) +int main() { - (void)argc; - (void)argv; - netsnmp_free(NULL); - return 0; } diff --git a/recipes/net-snmp/config.yml b/recipes/net-snmp/config.yml index f15097f7b11ab..be87e4ef2a874 100644 --- a/recipes/net-snmp/config.yml +++ b/recipes/net-snmp/config.yml @@ -1,3 +1,3 @@ versions: - "5.9.1": + "5.9.4": folder: all diff --git a/recipes/netcdf/all/conandata.yml b/recipes/netcdf/all/conandata.yml index c96fc1ea18103..e6119be629931 100644 --- a/recipes/netcdf/all/conandata.yml +++ b/recipes/netcdf/all/conandata.yml @@ -10,7 +10,13 @@ patches: - patch_file: "patches/4.7.4-0001-fix-cmake.patch" patch_description: "fixes for cmake target_link_libraries and using deps" patch_type: "conan" + - patch_file: "patches/4.7.4-0002-fix-cross-compile.patch" + patch_description: "fixes 'Unable to find the math library' when cross compiling" + patch_type: "conan" "4.8.1": - patch_file: "patches/4.8.1-0001-fix-cmake.patch" patch_description: "fixes for cmake target_link_libraries and using deps" patch_type: "conan" + - patch_file: "patches/4.8.1-0002-fix-cross-compile.patch" + patch_description: "fixes 'Unable to find the math library' when cross compiling" + patch_type: "conan" diff --git a/recipes/netcdf/all/conanfile.py b/recipes/netcdf/all/conanfile.py index 44608e3405cb8..748b4bb9a8744 100644 --- a/recipes/netcdf/all/conanfile.py +++ b/recipes/netcdf/all/conanfile.py @@ -75,6 +75,7 @@ def requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) @@ -95,7 +96,6 @@ def generate(self): tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/netcdf/all/patches/4.7.4-0002-fix-cross-compile.patch b/recipes/netcdf/all/patches/4.7.4-0002-fix-cross-compile.patch new file mode 100644 index 0000000000000..6c157604fa80f --- /dev/null +++ b/recipes/netcdf/all/patches/4.7.4-0002-fix-cross-compile.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 80a986f..7e398ba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -864,7 +864,11 @@ ENDIF() + + # Check for the math library so it can be explicitly linked. + IF(NOT WIN32) +- FIND_LIBRARY(HAVE_LIBM NAMES math m libm) ++ INCLUDE(CheckLibraryExists) ++ CHECK_LIBRARY_EXISTS(m log "" CAN_LINK_LIBM) ++ IF(CAN_LINK_LIBM) ++ SET(HAVE_LIBM m) ++ ENDIF() + MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + IF(NOT HAVE_LIBM) + MESSAGE(FATAL_ERROR "Unable to find the math library.") diff --git a/recipes/netcdf/all/patches/4.8.1-0002-fix-cross-compile.patch b/recipes/netcdf/all/patches/4.8.1-0002-fix-cross-compile.patch new file mode 100644 index 0000000000000..1b07967b34210 --- /dev/null +++ b/recipes/netcdf/all/patches/4.8.1-0002-fix-cross-compile.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fd6713d..c6312b2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -938,7 +938,11 @@ OPTION(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." OFF) + + # Check for the math library so it can be explicitly linked. + IF(NOT WIN32) +- FIND_LIBRARY(HAVE_LIBM NAMES math m libm) ++ INCLUDE(CheckLibraryExists) ++ CHECK_LIBRARY_EXISTS(m log "" CAN_LINK_LIBM) ++ IF(CAN_LINK_LIBM) ++ SET(HAVE_LIBM m) ++ ENDIF() + MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + IF(NOT HAVE_LIBM) + MESSAGE(FATAL_ERROR "Unable to find the math library.") diff --git a/recipes/netcdf/all/test_package/CMakeLists.txt b/recipes/netcdf/all/test_package/CMakeLists.txt index 2d1df83efe1db..232ad982f5048 100644 --- a/recipes/netcdf/all/test_package/CMakeLists.txt +++ b/recipes/netcdf/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) 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/test_package/CMakeLists.txt b/recipes/nettle/all/test_package/CMakeLists.txt index 5392db1d1ea64..7eb698494a490 100644 --- a/recipes/nettle/all/test_package/CMakeLists.txt +++ b/recipes/nettle/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(nettle REQUIRED CONFIG) diff --git a/recipes/nettle/all/test_v1_package/CMakeLists.txt b/recipes/nettle/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/nettle/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nettle/all/test_v1_package/conanfile.py b/recipes/nettle/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/nettle/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", "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/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 index 768502b8f6a7f..61398f0462096 100644 --- a/recipes/newmat/all/CMakeLists.txt +++ b/recipes/newmat/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.15) project( "newmat" @@ -15,7 +15,7 @@ if (SETUP_C_SUBSCRIPTS) add_compile_definitions(SETUP_C_SUBSCRIPTS) endif() message("Build with C style element access ${SETUP_C_SUBSCRIPTS}") - + # ------------- # target # ------------- @@ -80,7 +80,7 @@ install( ${include_dir}/newmatrm.h ${include_dir}/precisio.h ${include_dir}/solution.h - DESTINATION + DESTINATION include/newmat ) install( diff --git a/recipes/newmat/all/test_package/CMakeLists.txt b/recipes/newmat/all/test_package/CMakeLists.txt index b7da1c805dfbd..a504305602611 100644 --- a/recipes/newmat/all/test_package/CMakeLists.txt +++ b/recipes/newmat/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(newmat REQUIRED) diff --git a/recipes/nfrechette-acl/all/conandata.yml b/recipes/nfrechette-acl/all/conandata.yml index dca5b638ad1dc..191bbde1ad6d6 100644 --- a/recipes/nfrechette-acl/all/conandata.yml +++ b/recipes/nfrechette-acl/all/conandata.yml @@ -8,3 +8,6 @@ sources: "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 4a590b12eb34e..9486ab8fa1d5e 100644 --- a/recipes/nfrechette-acl/all/conanfile.py +++ b/recipes/nfrechette-acl/all/conanfile.py @@ -38,7 +38,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("rtm/2.1.5") + self.requires("rtm/2.2.0") def package_id(self): self.info.clear() diff --git a/recipes/nfrechette-acl/all/test_v1_package/CMakeLists.txt b/recipes/nfrechette-acl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/nfrechette-acl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49ba777923b40..0000000000000 --- a/recipes/nfrechette-acl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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 00fcf38029071..1a65a1cc6cec7 100644 --- a/recipes/nfrechette-acl/config.yml +++ b/recipes/nfrechette-acl/config.yml @@ -5,3 +5,5 @@ versions: 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 index 3d19ff221c51b..9fdcd6c92b130 100644 --- a/recipes/nghttp3/all/conandata.yml +++ b/recipes/nghttp3/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.6.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.6.0/nghttp3-1.6.0.tar.bz2" + sha256: "e49806e1008fe823961616dc61dab7df0f20d3e1f43bc76faecf3e10e541a4b8" + "1.5.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.5.0/nghttp3-1.5.0.tar.bz2" + sha256: "4d89a3b84dbe2c6e0fe1367a2082f23b3c6e3279536e2436aed1a3785f6716c5" + "1.4.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.4.0/nghttp3-1.4.0.tar.bz2" + sha256: "bf8fbb4242cff0feb10b3e0d02545a8ad9a71d932f877a57a592bfde62a26019" + "1.3.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.3.0/nghttp3-1.3.0.tar.bz2" + sha256: "1f6bda74a888bfeb110a660a04b2ea25b756e0774d48143e34374af83d25e4a8" + "1.2.0": + url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.2.0/nghttp3-1.2.0.tar.bz2" + sha256: "da1bc26af1fd8756b59883c256153d2f41064294750454ee4c970fe087a70056" "1.1.0": url: "https://github.com/ngtcp2/nghttp3/releases/download/v1.1.0/nghttp3-1.1.0.tar.bz2" sha256: "5a203bf6e3129a9c23b06207c0fa3b05b26066ea28c037a62c9fea8cffecd85f" @@ -8,3 +23,8 @@ sources: "0.15.0": url: "https://github.com/ngtcp2/nghttp3/releases/download/v0.15.0/nghttp3-0.15.0.tar.gz" sha256: "3c56d9fa6f1b58b37bd7b1b53eaf16cd71118bc2d5cadbc904f09d6f6466b42f" +patches: + "1.2.0": + - patch_file: "patches/1.2.0-0001-disable-always-static-build.patch" + patch_description: "disable always static build to avoid overwrite lib file on windows" + patch_type: "conan" diff --git a/recipes/nghttp3/all/conanfile.py b/recipes/nghttp3/all/conanfile.py index 618ddcb3adf32..9fbb63e061dc5 100644 --- a/recipes/nghttp3/all/conanfile.py +++ b/recipes/nghttp3/all/conanfile.py @@ -2,7 +2,7 @@ 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.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc import os @@ -28,6 +28,9 @@ class Nghttp3Conan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -53,11 +56,13 @@ def generate(self): 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.variables["BUILD_TESTING"] = False tc.generate() tc = VirtualBuildEnv(self) tc.generate(scope="build") def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -68,6 +73,7 @@ def package(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")) def package_info(self): self.cpp_info.libs = ["nghttp3"] diff --git a/recipes/nghttp3/all/patches/1.2.0-0001-disable-always-static-build.patch b/recipes/nghttp3/all/patches/1.2.0-0001-disable-always-static-build.patch new file mode 100644 index 0000000000000..3f7e1ccd58d6f --- /dev/null +++ b/recipes/nghttp3/all/patches/1.2.0-0001-disable-always-static-build.patch @@ -0,0 +1,20 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 3928fb3..18bcb04 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -78,6 +78,7 @@ if(ENABLE_SHARED_LIB) + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + endif() + ++if(ENABLE_STATIC_LIB) + # Static library (for unittests because of symbol visibility) + add_library(nghttp3_static STATIC ${nghttp3_SOURCES}) + set_target_properties(nghttp3_static PROPERTIES +@@ -86,7 +87,6 @@ set_target_properties(nghttp3_static PROPERTIES + ARCHIVE_OUTPUT_NAME nghttp3${STATIC_LIB_SUFFIX} + ) + target_compile_definitions(nghttp3_static PUBLIC "-DNGHTTP3_STATICLIB") +-if(ENABLE_STATIC_LIB) + install(TARGETS nghttp3_static + DESTINATION "${CMAKE_INSTALL_LIBDIR}") + endif() diff --git a/recipes/nghttp3/all/test_package/CMakeLists.txt b/recipes/nghttp3/all/test_package/CMakeLists.txt index c52d61a995b33..f4527201cd0cb 100644 --- a/recipes/nghttp3/all/test_package/CMakeLists.txt +++ b/recipes/nghttp3/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 C) find_package(nghttp3 REQUIRED CONFIG) diff --git a/recipes/nghttp3/config.yml b/recipes/nghttp3/config.yml index f581e0802958e..882e07adca5bd 100644 --- a/recipes/nghttp3/config.yml +++ b/recipes/nghttp3/config.yml @@ -1,4 +1,14 @@ versions: + "1.6.0": + folder: all + "1.5.0": + folder: all + "1.4.0": + folder: all + "1.3.0": + folder: all + "1.2.0": + folder: all "1.1.0": folder: all "1.0.0": diff --git a/recipes/nifti_clib/all/conandata.yml b/recipes/nifti_clib/all/conandata.yml new file mode 100644 index 0000000000000..1821fa5866772 --- /dev/null +++ b/recipes/nifti_clib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.0": + url: "https://github.com/NIFTI-Imaging/nifti_clib/archive/refs/tags/v3.0.0.tar.gz" + sha256: "fe6cb1076974df01844f3f4dab1aa844953b3bc1d679126c652975158573d03d" diff --git a/recipes/nifti_clib/all/conanfile.py b/recipes/nifti_clib/all/conanfile.py new file mode 100644 index 0000000000000..bc815d11f7a2b --- /dev/null +++ b/recipes/nifti_clib/all/conanfile.py @@ -0,0 +1,142 @@ +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, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + + +required_conan_version = ">=2.4" + + +class NiftiClibConan(ConanFile): + name = "nifti_clib" + description = "C libraries for NIFTI support" + license = "LicenseRef-LICENSE" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/NIFTI-Imaging/nifti_clib" + topics = ("image") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_nifti2": [True, False], + "use_cifti": [True, False], + "use_fslio": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "use_nifti2": True, + "use_cifti": False, # seems to be beta? + "use_fslio": False # Note in CMakeLists.txt: "If OFF, The copyright of this code is questionable for inclusion with nifti." + } + implements = ["auto_shared_fpic"] + languages = ["C"] + + def validate(self): + if is_msvc(self) and self.options.shared: + # not supported due to not having dllexport definitions + raise ConanInvalidConfiguration(f"{self.ref} does not support -o {self.ref}:shared=True with MSVC compiler.") + if not self.options.use_nifti2 and self.options.use_cifti: + raise ConanInvalidConfiguration(f"{self.ref} -o '&:use_cifti=True' requires -o '&:use_nifti2=True'") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + if self.options.use_cifti: + self.requires("expat/[>=2.6.2 <3]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["NIFTI_INSTALL_NO_DOCS"] = True + tc.variables["USE_NIFTI2_CODE"] = self.options.use_nifti2 + tc.variables["USE_CIFTI_CODE"] = self.options.use_cifti + tc.variables["USE_FSL_CODE"] = self.options.use_fslio + tc.variables["NIFTI_BUILD_TESTING"] = False # disable building tests + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.preprocessor_definitions["_CRT_SECURE_NO_WARNINGS"] = 1 + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + 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", "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.set_property("cmake_file_name", "nifti") + self.cpp_info.set_property("cmake_target_name", "NIFTI::NIFTI") + self.cpp_info.set_property("pkg_config_name", "nifti") + self.cpp_info.includedirs += [ os.path.join("include", "nifti") ] + + sys_libs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + sys_libs += ["m"] + + self.cpp_info.components["znz"].libs = ["znz"] + self.cpp_info.components["znz"].set_property("pkg_config_name", "znz") + self.cpp_info.components["znz"].set_property("cmake_target_name", "NIFTI::znz") + self.cpp_info.components["znz"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["znz"].system_libs += sys_libs + self.cpp_info.components["znz"].requires = ["zlib::zlib"] + self.cpp_info.components["znz"].defines = ["HAVE_ZLIB"] + + # inside the niftilib folder + self.cpp_info.components["niftiio"].libs = ["niftiio"] + self.cpp_info.components["niftiio"].requires = ["znz"] + self.cpp_info.components["niftiio"].set_property("pkg_config_name", "niftiio") + self.cpp_info.components["niftiio"].set_property("cmake_target_name", "NIFTI::niftiio") + self.cpp_info.components["niftiio"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["niftiio"].system_libs += sys_libs + + self.cpp_info.components["nifticdf"].libs = ["nifticdf"] + self.cpp_info.components["nifticdf"].requires = ["niftiio"] + self.cpp_info.components["nifticdf"].set_property("pkg_config_name", "nifticdf") + self.cpp_info.components["nifticdf"].set_property("cmake_target_name", "NIFTI::nifticdf") + self.cpp_info.components["nifticdf"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["nifticdf"].system_libs += sys_libs + + if self.options.use_nifti2: + self.cpp_info.components["nifti2"].libs = ["nifti2"] + self.cpp_info.components["nifti2"].requires = ["znz"] + self.cpp_info.components["nifti2"].set_property("pkg_config_name", "nifti2") + self.cpp_info.components["nifti2"].set_property("cmake_target_name", "NIFTI::nifti2") + self.cpp_info.components["nifti2"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["nifti2"].system_libs += sys_libs + + if self.options.use_cifti: + self.cpp_info.components["cifti"].libs = ["cifti"] + self.cpp_info.components["cifti"].requires = ["nifti2", "expat::expat"] + self.cpp_info.components["cifti"].set_property("pkg_config_name", "cifti") + self.cpp_info.components["cifti"].set_property("cmake_target_name", "NIFTI::cifti") + self.cpp_info.components["cifti"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["cifti"].system_libs += sys_libs + + if self.options.use_fslio: + self.cpp_info.components["fslio"].libs = ["fslio"] + self.cpp_info.components["fslio"].requires = ["niftiio"] + self.cpp_info.components["fslio"].set_property("pkg_config_name", "fslio") + self.cpp_info.components["fslio"].set_property("cmake_target_name", "NIFTI::fslio") + self.cpp_info.components["fslio"].includedirs += [os.path.join("include", "nifti")] + self.cpp_info.components["fslio"].system_libs += sys_libs diff --git a/recipes/nifti_clib/all/test_package/CMakeLists.txt b/recipes/nifti_clib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a63a2b6d3fe16 --- /dev/null +++ b/recipes/nifti_clib/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES C) + +find_package(NIFTI 3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) + +target_link_libraries(${PROJECT_NAME} PRIVATE NIFTI::nifticdf) diff --git a/recipes/nifti_clib/all/test_package/conanfile.py b/recipes/nifti_clib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/nifti_clib/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/nifti_clib/all/test_package/test_package.c b/recipes/nifti_clib/all/test_package/test_package.c new file mode 100644 index 0000000000000..c1c849f8faf18 --- /dev/null +++ b/recipes/nifti_clib/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include "nifticdf.h" + +// taken from nifti_clib/real_easy/minimal_example_of_downstream_usage +int main(void) { + double input= 7.0; + const double output = alnrel(&input); + + return (output > 0.0) ? EXIT_SUCCESS: EXIT_FAILURE ; +} diff --git a/recipes/nifti_clib/config.yml b/recipes/nifti_clib/config.yml new file mode 100644 index 0000000000000..3a44950f9d81d --- /dev/null +++ b/recipes/nifti_clib/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "3.0.0": + folder: all diff --git a/recipes/ninja/all/conandata.yml b/recipes/ninja/all/conandata.yml index 02891869efb97..36f42c6c69771 100644 --- a/recipes/ninja/all/conandata.yml +++ b/recipes/ninja/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.12.1": + url: "https://github.com/ninja-build/ninja/archive/v1.12.1.tar.gz" + sha256: "821bdff48a3f683bc4bb3b6f0b5fe7b2d647cf65d52aeb63328c91a6c6df285a" + "1.12.0": + url: "https://github.com/ninja-build/ninja/archive/v1.12.0.tar.gz" + sha256: "8b2c86cd483dc7fcb7975c5ec7329135d210099a89bc7db0590a07b0bbfe49a5" "1.11.1": url: "https://github.com/ninja-build/ninja/archive/v1.11.1.tar.gz" sha256: "31747ae633213f1eda3842686f83c2aa1412e0f5691d1c14dbbcc67fe7400cea" diff --git a/recipes/ninja/all/conanfile.py b/recipes/ninja/all/conanfile.py index 6fede8df5ba1b..5e97a00b8feff 100644 --- a/recipes/ninja/all/conanfile.py +++ b/recipes/ninja/all/conanfile.py @@ -1,6 +1,6 @@ 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.files import copy, get, replace_in_file from conan.tools.scm import Version import os @@ -25,6 +25,10 @@ def package_id(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + + #prevent re2c (which is optional and not needed) from being used + replace_in_file(self, cmakelists, "if(RE2C)", "if(FALSE)") def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/ninja/all/test_v1_package/conanfile.py b/recipes/ninja/all/test_v1_package/conanfile.py deleted file mode 100644 index f520548c1be19..0000000000000 --- a/recipes/ninja/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,12 +0,0 @@ -from conans import ConanFile - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - test_type = "explicit" - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - - def test(self): - self.run("ninja --version", run_environment=True) diff --git a/recipes/ninja/config.yml b/recipes/ninja/config.yml index 0a0061dfb232d..8d14bc8f88871 100644 --- a/recipes/ninja/config.yml +++ b/recipes/ninja/config.yml @@ -1,4 +1,8 @@ versions: + "1.12.1": + folder: all + "1.12.0": + folder: all "1.11.1": folder: all "1.11.0": diff --git a/recipes/nlohmann_json/all/conandata.yml b/recipes/nlohmann_json/all/conandata.yml index 971d0191590f9..ba690a98d2cc3 100644 --- a/recipes/nlohmann_json/all/conandata.yml +++ b/recipes/nlohmann_json/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.12.0": + url: "https://github.com/nlohmann/json/archive/v3.12.0.tar.gz" + sha256: "4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187" "3.11.3": url: "https://github.com/nlohmann/json/archive/v3.11.3.tar.gz" sha256: "0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406" diff --git a/recipes/nlohmann_json/all/test_package/CMakeLists.txt b/recipes/nlohmann_json/all/test_package/CMakeLists.txt index 8976512b85ce6..a3fddaf7e2559 100644 --- a/recipes/nlohmann_json/all/test_package/CMakeLists.txt +++ b/recipes/nlohmann_json/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(nlohmann_json REQUIRED CONFIG) diff --git a/recipes/nlohmann_json/all/test_v1_package/CMakeLists.txt b/recipes/nlohmann_json/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/nlohmann_json/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nlohmann_json/all/test_v1_package/conanfile.py b/recipes/nlohmann_json/all/test_v1_package/conanfile.py deleted file mode 100644 index 37ada808989d9..0000000000000 --- a/recipes/nlohmann_json/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", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/nlohmann_json/config.yml b/recipes/nlohmann_json/config.yml index ad526c439b84b..d93679bea30bd 100644 --- a/recipes/nlohmann_json/config.yml +++ b/recipes/nlohmann_json/config.yml @@ -1,4 +1,6 @@ versions: + "3.12.0": + folder: all "3.11.3": folder: all "3.11.2": diff --git a/recipes/nlopt/all/conandata.yml b/recipes/nlopt/all/conandata.yml index 02a06934e9769..a3497e2ea9b53 100644 --- a/recipes/nlopt/all/conandata.yml +++ b/recipes/nlopt/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.9.1": + url: "https://github.com/stevengj/nlopt/archive/refs/tags/v2.9.1.tar.gz" + sha256: "1e6c33f8cbdc4138d525f3326c231f14ed50d99345561e85285638c49b64ee93" "2.7.1": url: "https://github.com/stevengj/nlopt/archive/refs/tags/v2.7.1.tar.gz" sha256: "db88232fa5cef0ff6e39943fc63ab6074208831dc0031cf1545f6ecd31ae2a1a" diff --git a/recipes/nlopt/all/conanfile.py b/recipes/nlopt/all/conanfile.py index 8d8fd8b762dc4..640581c8709e9 100644 --- a/recipes/nlopt/all/conanfile.py +++ b/recipes/nlopt/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 copy, get, replace_in_file, rm, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.54.0" @@ -62,9 +63,10 @@ def generate(self): def _patch_sources(self): # don't force PIC - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - replace_in_file(self, cmakelists, "set (CMAKE_C_FLAGS \"-fPIC ${CMAKE_C_FLAGS}\")", "") - replace_in_file(self, cmakelists, "set (CMAKE_CXX_FLAGS \"-fPIC ${CMAKE_CXX_FLAGS}\")", "") + if Version(self.version) < Version("2.8.0"): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "set (CMAKE_C_FLAGS \"-fPIC ${CMAKE_C_FLAGS}\")", "") + replace_in_file(self, cmakelists, "set (CMAKE_CXX_FLAGS \"-fPIC ${CMAKE_CXX_FLAGS}\")", "") def build(self): self._patch_sources() diff --git a/recipes/nlopt/all/test_v1_package/CMakeLists.txt b/recipes/nlopt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/nlopt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nlopt/all/test_v1_package/conanfile.py b/recipes/nlopt/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/nlopt/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_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/nlopt/config.yml b/recipes/nlopt/config.yml index 0f16077cd3403..48a00d067b213 100644 --- a/recipes/nlopt/config.yml +++ b/recipes/nlopt/config.yml @@ -1,4 +1,6 @@ versions: + "2.9.1": + folder: all "2.7.1": folder: all "2.7.0": diff --git a/recipes/nmos-cpp/all/conandata.yml b/recipes/nmos-cpp/all/conandata.yml index 94817c0d8466a..48f839443ae06 100644 --- a/recipes/nmos-cpp/all/conandata.yml +++ b/recipes/nmos-cpp/all/conandata.yml @@ -1,5 +1,8 @@ sources: # see https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#what-version-should-packages-use-for-libraries-without-official-releases + "cci.20240223": + url: "https://github.com/sony/nmos-cpp/archive/27dff31919e06a132651291648293ff7b6b38b38.tar.gz" + sha256: "25c5fec843c9ced8061231b44f00942886766008ddbb171b351bf5616c07eccc" "cci.20221203": url: "https://github.com/sony/nmos-cpp/archive/0fb6b51737f737ae011cbcc39cdfb2c5236ec59f.tar.gz" sha256: "9e811b2707afe084c4470fcaa5664f57468fd03e86b1eebd03ec9216cf31cac1" diff --git a/recipes/nmos-cpp/all/conanfile.py b/recipes/nmos-cpp/all/conanfile.py index 67cbae93e0a0b..82bc34f86af52 100644 --- a/recipes/nmos-cpp/all/conanfile.py +++ b/recipes/nmos-cpp/all/conanfile.py @@ -2,6 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools import build, files from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.scm import Version import json import os import re @@ -51,12 +52,13 @@ def requirements(self): # 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("cpprestsdk/2.10.19", transitive_headers=True) self.requires("websocketpp/0.8.2") 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.11 <2]") + self.requires("json-schema-validator/2.3.0") + self.requires("nlohmann_json/3.11.3") + if Version(self.version) >= "cci.20240222": + self.requires("jwt-cpp/0.7.0") if self.options.get_safe("with_dnssd") == "mdnsresponder": self.requires("mdnsresponder/878.200.35") @@ -124,7 +126,7 @@ def _create_components_file_from_cmake_target_file(self, target_file_path): target_content = files.load(self, target_file_path) - cmake_functions = re.findall(r"(?Padd_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P[^)]*)\)", target_content) + cmake_functions = re.findall(r"(?Padd_executable|add_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P[^)]*)\)", 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) @@ -137,7 +139,9 @@ def _create_components_file_from_cmake_target_file(self, target_file_path): components.setdefault(component_name, {"cmake_target": cmake_target_nonamespace}) - if cmake_function_name == "add_library": + if cmake_function_name == "add_executable": + components[component_name]["exe"] = True + elif cmake_function_name == "add_library": cmake_imported_target_type = cmake_function_args[1] if cmake_imported_target_type in ["STATIC", "SHARED"]: # library filenames are based on the target name by default @@ -208,6 +212,11 @@ def _create_components_file_from_cmake_target_file(self, target_file_path): else: self.output.warn(f"{self.name} recipe does not handle {property_type} (yet)") + # until https://github.com/sony/nmos-cpp/commit/9489d84098ddc8cc514b7e4d5afe740dee4518ee + # direct dependency on nlohmann_json was missing + if Version(self.version) < "cci.20221203": + components["json_schema_validator"].setdefault("requires", []).append("nlohmann_json::nlohmann_json") + # Save components informations in json file with open(self._components_helper_filepath, "w", encoding="utf-8") as json_file: json.dump(components, json_file, indent=4) @@ -226,7 +235,6 @@ 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) @@ -235,6 +243,7 @@ def _register_components(): cmake_target = values["cmake_target"] self.cpp_info.components[component_name].names["cmake_find_package"] = cmake_target self.cpp_info.components[component_name].names["cmake_find_package_multi"] = cmake_target + self.cpp_info.components[component_name].bindirs = [bindir] if values.get("exe") else [] self.cpp_info.components[component_name].libs = values.get("libs", []) self.cpp_info.components[component_name].libdirs = [libdir] self.cpp_info.components[component_name].defines = values.get("defines", []) diff --git a/recipes/nmos-cpp/all/test_package/CMakeLists.txt b/recipes/nmos-cpp/all/test_package/CMakeLists.txt index fd5f713e08b82..e4edbdcf69b52 100644 --- a/recipes/nmos-cpp/all/test_package/CMakeLists.txt +++ b/recipes/nmos-cpp/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) diff --git a/recipes/nmos-cpp/all/test_v1_package/CMakeLists.txt b/recipes/nmos-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/nmos-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nmos-cpp/all/test_v1_package/conanfile.py b/recipes/nmos-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 2df20034f628d..0000000000000 --- a/recipes/nmos-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -class NmosCppTestPackageConan(ConanFile): - settings = "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/nmos-cpp/config.yml b/recipes/nmos-cpp/config.yml index 1ebebe8a73c09..9cc517e0f52ae 100644 --- a/recipes/nmos-cpp/config.yml +++ b/recipes/nmos-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20240223": + folder: all "cci.20221203": folder: all "cci.20220620": diff --git a/recipes/nmslib/all/conandata.yml b/recipes/nmslib/all/conandata.yml index a76e6327ac2f8..2c6c1c207427a 100644 --- a/recipes/nmslib/all/conandata.yml +++ b/recipes/nmslib/all/conandata.yml @@ -8,3 +8,5 @@ patches: - patch_file: patches/0002-cmake-fix-install.patch - patch_file: patches/0003-cmake-fix-flags.patch - patch_file: patches/0004-missing-utils-header.patch + - patch_file: patches/0005-cmake4-compatible.patch + patch_description: "CMP0025 (Compiler id for Apple Clang is now AppleClang instead of Clang). CMake 4 forces CMP0025 to NEW. Thus a patch is needed to MATCH Clang or AppleClang" diff --git a/recipes/nmslib/all/conanfile.py b/recipes/nmslib/all/conanfile.py index 339645c679763..536bc067b7cd2 100644 --- a/recipes/nmslib/all/conanfile.py +++ b/recipes/nmslib/all/conanfile.py @@ -1,12 +1,13 @@ import os from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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 +from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class Nmslib(ConanFile): @@ -75,6 +76,9 @@ def generate(self): tc.variables["WITHOUT_TESTS"] = True # Relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.1.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/nmslib/all/patches/0005-cmake4-compatible.patch b/recipes/nmslib/all/patches/0005-cmake4-compatible.patch new file mode 100644 index 0000000000000..3b51228d73465 --- /dev/null +++ b/recipes/nmslib/all/patches/0005-cmake4-compatible.patch @@ -0,0 +1,11 @@ +--- similarity_search/CMakeLists.txt ++++ similarity_search/CMakeLists.txt +@@ -55,7 +55,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") + endif() + set (CMAKE_CXX_FLAGS_RELEASE "-Wall -Wunreachable-code -Ofast -DNDEBUG -std=c++11 -DHAVE_CXX0X -pthread") + set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wunreachable-code -ggdb -DNDEBUG -std=c++11 -DHAVE_CXX0X -pthread") +-elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") ++elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + if (CMAKE_SYSTEM_NAME MATCHES Darwin) + # MACOSX + set (CMAKE_CXX_FLAGS_RELEASE "${WARN_FLAGS} -O3 -DNDEBUG -std=c++11 -DHAVE_CXX0X -pthread") diff --git a/recipes/nmslib/all/test_v1_package/CMakeLists.txt b/recipes/nmslib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/nmslib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index abcaeed3f89b6..0000000000000 --- a/recipes/nmslib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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 821ab71934ba1..2232f4892fec8 100644 --- a/recipes/nng/all/conandata.yml +++ b/recipes/nng/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "1.9.0": + url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.9.0.tar.gz" + sha256: "ff882bda0a854abd184a7c1eb33329e526928ef98e80ef0457dd9a708bb5b0b1" + "1.8.0": + url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.8.0.tar.gz" + sha256: "cfacfdfa35c1618a28bb940e71f774a513dcb91292999696b4346ad8bfb5baff" + "1.7.3": + url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.7.3.tar.gz" + sha256: "035f2c3cad4e45fc0d978c54a338c197d1937527ae6feb82180d428a96b83474" + "1.7.2": + url: "https://github.com/nanomsg/nng/archive/refs/tags/v1.7.2.tar.gz" + sha256: "40e6af7bdd5d02ee98ba8fe5fd5c149ce3e5a555f202cdc837e3ead2d7cc7534" + "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" @@ -11,12 +29,6 @@ sources: "1.3.2": url: "https://github.com/nanomsg/nng/archive/v1.3.2.tar.gz" sha256: "0f8f2ede7f5ea2018c7fa615c76f48662eb06d39c71c3339f8ff38da44470855" - "1.3.1": - url: "https://github.com/nanomsg/nng/archive/v1.3.1.tar.gz" - sha256: "3f258514b6aed931485ce1a6e5745e07416d32e6c4315ae771ff358e9fd18e55" - "1.3.0": - url: "https://github.com/nanomsg/nng/archive/v1.3.0.tar.gz" - sha256: "e8fe50d0f79ec3243733f8b4c25099c88b2597ed1bb0d94a27c4385a2a24ecac" patches: "1.5.1": - patch_file: patches/0001-fix-ios-tvos-watchos-1.5.1.patch @@ -28,13 +40,3 @@ patches: 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 184a8d520a4c2..2f960488b2d41 100644 --- a/recipes/nng/all/conanfile.py +++ b/recipes/nng/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration 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, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os @@ -25,6 +25,10 @@ class NngConan(ConanFile): "tls": [True, False], "max_taskq_threads": ["ANY"], "max_expire_threads": ["ANY"], + "max_poller_threads": ["ANY"], + "compat": [True, False], + "with_ipv6": [True, False], + "tls_engine": ["mbed", "wolf"], } default_options = { "shared": False, @@ -34,6 +38,10 @@ class NngConan(ConanFile): "tls": False, "max_taskq_threads": "16", "max_expire_threads": "8", + "max_poller_threads": "8", + "compat": True, + "with_ipv6": True, + "tls_engine": "mbed", } def export_sources(self): @@ -44,6 +52,14 @@ def config_options(self): 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 + if Version(self.version) < "1.7.2": + del self.options.compat + if Version(self.version) < "1.7.3": + del self.options.with_ipv6 + if Version(self.version) < "1.9.0": + del self.options.tls_engine def configure(self): if self.options.shared: @@ -56,10 +72,14 @@ def layout(self): def requirements(self): if self.options.tls: - if Version(self.version) < "1.5.2": - self.requires("mbedtls/2.25.0") - else: - self.requires("mbedtls/3.5.0") + tls_engine = self.options.get_safe("tls_engine", "mbed") + if tls_engine == "mbed": + if Version(self.version) < "1.5.2": + self.requires("mbedtls/2.25.0") + else: + self.requires("mbedtls/3.5.2") + elif tls_engine == "wolf": + self.requires("wolfssl/5.7.2") def validate(self): compiler_minimum_version = { @@ -75,6 +95,8 @@ def validate(self): 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) @@ -88,7 +110,16 @@ def generate(self): 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 + if "compat" in self.options: + tc.variables["NNG_ENABLE_COMPAT"] = self.options.compat + if "with_ipv6" in self.options: + tc.variables["NNG_ENABLE_IPV6"] = self.options.with_ipv6 + tc.variables["NNG_TLS_ENGINE"] = self.options.get_safe("tls_engine", "mbed") tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) @@ -110,7 +141,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/patches/0001-fix-ios-tvos-watchos-1.3.0.patch b/recipes/nng/all/patches/0001-fix-ios-tvos-watchos-1.3.0.patch deleted file mode 100644 index 3b71e923ae407..0000000000000 --- a/recipes/nng/all/patches/0001-fix-ios-tvos-watchos-1.3.0.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -214,7 +214,7 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Android") - add_definitions(-DNNG_USE_EVENTFD) - set(NNG_PLATFORM_POSIX ON) - --elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") -+elseif (APPLE) - add_definitions(-DNNG_PLATFORM_POSIX) - add_definitions(-DNNG_PLATFORM_DARWIN) - set(NNG_PLATFORM_POSIX ON) diff --git a/recipes/nng/all/test_package/CMakeLists.txt b/recipes/nng/all/test_package/CMakeLists.txt index 7a60c8282db34..716abd8978b63 100644 --- a/recipes/nng/all/test_package/CMakeLists.txt +++ b/recipes/nng/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 C) find_package(nng REQUIRED CONFIG) diff --git a/recipes/nng/all/test_v1_package/CMakeLists.txt b/recipes/nng/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/nng/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nng/all/test_v1_package/conanfile.py b/recipes/nng/all/test_v1_package/conanfile.py deleted file mode 100644 index d4a99c7cba3ed..0000000000000 --- a/recipes/nng/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,22 +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): - cache = os.path.join(self.build_folder, "CMakeCache.txt") - if os.path.exists(cache): - self.output.info(f"Removing {cache}") - os.remove(cache) - 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/nng/config.yml b/recipes/nng/config.yml index 07341cd03187d..a216ebf04278c 100644 --- a/recipes/nng/config.yml +++ b/recipes/nng/config.yml @@ -1,4 +1,16 @@ versions: + "1.9.0": + folder: all + "1.8.0": + folder: all + "1.7.3": + folder: all + "1.7.2": + folder: all + "1.7.1": + folder: all + "1.7.0": + folder: all "1.6.0": folder: all "1.5.2": @@ -7,7 +19,3 @@ versions: folder: all "1.3.2": folder: all - "1.3.1": - folder: all - "1.3.0": - folder: all diff --git a/recipes/nodeeditor/all/conan_cmake_project_include.cmake b/recipes/nodeeditor/all/conan_cmake_project_include.cmake new file mode 100644 index 0000000000000..937a387ba6edd --- /dev/null +++ b/recipes/nodeeditor/all/conan_cmake_project_include.cmake @@ -0,0 +1,21 @@ +# INFO: The project Nodeeditor uses CMake Qt macros qt_add_resources and qt_wrap_cpp +# in order to manage resources and not CMake AUTOMOC target property. +# These macros do not use CMAKE_AUTOMOC_EXECUTABLE, but are imported executables. +# We need to reconfigure their paths to the ones from Conan package in order to avoid +# runtime errors related to missing dynamic libraries in DYLD_LIBRARY_PATH. + +cmake_minimum_required(VERSION 3.15) + +find_package(QT NAMES Qt6 REQUIRED) + +if(TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::moc) + set_target_properties(${QT_CMAKE_EXPORT_NAMESPACE}::moc PROPERTIES + IMPORTED_LOCATION "${CMAKE_AUTOMOC_EXECUTABLE}" + ) +endif() + +if(TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::rcc) + set_target_properties(${QT_CMAKE_EXPORT_NAMESPACE}::rcc PROPERTIES + IMPORTED_LOCATION "${CMAKE_AUTORCC_EXECUTABLE}" + ) +endif() diff --git a/recipes/nodeeditor/all/conandata.yml b/recipes/nodeeditor/all/conandata.yml new file mode 100644 index 0000000000000..cd0d45f4429b9 --- /dev/null +++ b/recipes/nodeeditor/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.0.11": + url: "https://github.com/paceholder/nodeeditor/archive/refs/tags/3.0.11.tar.gz" + sha256: "9810137d576d8d1049df29c0a8869a0dce4ae10636e3b042a841f5696f26187d" diff --git a/recipes/nodeeditor/all/conanfile.py b/recipes/nodeeditor/all/conanfile.py new file mode 100644 index 0000000000000..eb1404ed398e2 --- /dev/null +++ b/recipes/nodeeditor/all/conanfile.py @@ -0,0 +1,86 @@ +import os +from conan import ConanFile +from conan.tools.files import get, copy, rmdir +from conan.tools.cmake import cmake_layout, CMake, CMakeDeps, CMakeToolchain +from conan.tools.build import check_min_cppstd + +required_conan_version = ">=2.0.9" + +class NodeEditorConan(ConanFile): + name = "nodeeditor" + license = "BSD-3-Clause" + description = "Dataflow programming framework and UI for Qt" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/paceholder/nodeeditor" + topics = ("qt", "ui", "dataflow") + settings = "os", "compiler", "arch", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + package_type = "library" + implements = ["auto_shared_fpic"] + + @property + def _qt_version_major(self): + return str(self.dependencies["qt"].ref.version.major) + + def export_sources(self): + copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def requirements(self): + # INFO: Qt headers are exposed largely in public headers. e.g QtCore/QObject consumed by NodaData.hpp + self.requires("qt/[>=6.7 <7]", transitive_headers=True) + + def build_requirements(self): + # INFO: Uses Qt rcc tool to generate resources.cpp file via resources.qrc + self.tool_requires("qt/") + # INFO: To be able to use CMAKE_AUTOMOC_EXECUTABLE + self.tool_requires("cmake/[>=3.27 <4]") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_DOCS"] = False + tc.cache_variables["BUILD_EXAMPLES"] = False + tc.cache_variables["BUILD_TESTING"] = False + # INFO: replcate requires could be used to replace the Qt version by 5.x + tc.cache_variables["USE_QT6"] = self._qt_version_major == "6" + # INFO: In order to execute the moc tool and avoid failing to find its dependencies + qt_tools_rootdir = self.conf.get("user.qt:tools_directory", None) + tc.cache_variables["CMAKE_PROJECT_QtNodesLibrary_INCLUDE"] = os.path.join(self.source_folder, "conan_cmake_project_include.cmake") + tc.cache_variables["CMAKE_AUTOMOC_EXECUTABLE"] = os.path.join(qt_tools_rootdir, "moc.exe" if self.settings_build.os == "Windows" else "moc") + tc.cache_variables["CMAKE_AUTORCC_EXECUTABLE"] = os.path.join(qt_tools_rootdir, "rcc.exe" if self.settings_build.os == "Windows" else "rcc") + tc.generate() + + def validate(self): + required_cppstd = "17" if self._qt_version_major == "6" else "14" + check_min_cppstd(self, required_cppstd) + + def build(self): + cm = CMake(self) + cm.configure() + cm.build() + + def package(self): + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cm = CMake(self) + cm.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["QtNodes"] + self.cpp_info.requires.extend(["qt::qtCore", "qt::qtGui", + "qt::qtWidgets", "qt::qtOpenGL"]) + self.cpp_info.set_property("cmake_file_name", "QtNodes") + self.cpp_info.set_property("cmake_target_name", "QtNodes::QtNodes") + if self.options.shared: + self.cpp_info.defines = ["NODE_EDITOR_SHARED"] + else: + self.cpp_info.defines = ["NODE_EDITOR_STATIC"] diff --git a/recipes/nodeeditor/all/test_package/CMakeLists.txt b/recipes/nodeeditor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3b2f6093ed4d1 --- /dev/null +++ b/recipes/nodeeditor/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(QtNodes CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE QtNodes::QtNodes) diff --git a/recipes/nodeeditor/all/test_package/conanfile.py b/recipes/nodeeditor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f7a865568ce9a --- /dev/null +++ b/recipes/nodeeditor/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, cmake_layout + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("qt/[*]") + + def build(self): + cm = CMake(self) + cm.configure() + cm.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/nodeeditor/all/test_package/main.cpp b/recipes/nodeeditor/all/test_package/main.cpp new file mode 100644 index 0000000000000..77f74894d6d1c --- /dev/null +++ b/recipes/nodeeditor/all/test_package/main.cpp @@ -0,0 +1,12 @@ +#include +#include +#include +#include + + +int main(int argc, char** argv) +{ + auto reg = std::make_shared(); + QtNodes::DataFlowGraphModel mod(reg); + return EXIT_SUCCESS; +} diff --git a/recipes/nodeeditor/config.yml b/recipes/nodeeditor/config.yml new file mode 100644 index 0000000000000..fa58c1d681dc4 --- /dev/null +++ b/recipes/nodeeditor/config.yml @@ -0,0 +1,4 @@ +versions: + "3.0.11": + folder: "all" + diff --git a/recipes/nodejs/all/conandata.yml b/recipes/nodejs/all/conandata.yml index 56a1be535ef41..da170c70c328b 100644 --- a/recipes/nodejs/all/conandata.yml +++ b/recipes/nodejs/all/conandata.yml @@ -1,52 +1,51 @@ sources: - "12.14.1": - Windows: - "x86_64": - url: "https://nodejs.org/dist/v12.14.1/node-v12.14.1-win-x64.zip" - sha256: "1f96ccce3ba045ecea3f458e189500adb90b8bc1a34de5d82fc10a5bf66ce7e3" - Linux: - "x86_64": - url: "https://nodejs.org/dist/v12.14.1/node-v12.14.1-linux-x64.tar.xz" - sha256: "07cfcaa0aa9d0fcb6e99725408d9e0b07be03b844701588e3ab5dbc395b98e1b" - Macos: - "x86_64": - url: "https://nodejs.org/dist/v12.14.1/node-v12.14.1-darwin-x64.tar.gz" - sha256: "0be10a28737527a1e5e3784d3ad844d742fe8b0718acd701fd48f718fd3af78f" - "13.6.0": + "20.16.0": Windows: "x86_64": - url: "https://nodejs.org/dist/v13.6.0/node-v13.6.0-win-x64.zip" - sha256: "7fe37b34a4673a071bea52fcaf913ec422cf6fd79fd025bfb22de42ccc77f386" + url: "https://nodejs.org/dist/v20.16.0/node-v20.16.0-win-x64.zip" + sha256: "4e88373ac5ae859ad4d50cc3c5fa86eb3178d089b72e64c4dbe6eeac5d7b5979" + "armv8": + url: "https://nodejs.org/dist/v20.16.0/node-v20.16.0-win-arm64.zip" + sha256: "af5a85ea299fcebd34c3c726a47a926e73171f9b657a6eaa796c011597241bf8" Linux: "x86_64": - url: "https://nodejs.org/dist/v13.6.0/node-v13.6.0-linux-x64.tar.xz" - sha256: "00f01315a867da16d1638f7a02966c608e344ac6c5b7d04d1fdae3138fa9d798" + url: "https://nodejs.org/dist/v20.16.0/node-v20.16.0-linux-x64.tar.xz" + sha256: "c30af7dfea46de7d8b9b370fa33b8b15440bc93f0a686af8601bbb48b82f16c0" + "armv7": + url: "https://nodejs.org/dist/v20.16.0/node-v20.16.0-linux-armv7l.tar.xz" + sha256: "a23a49029e8c7788c701eb3ace553260b7676a5a2ea9965ba92e4817008fbefe" + "armv8": + url: "https://nodejs.org/dist/v20.16.0/node-v20.16.0-linux-arm64.tar.xz" + sha256: "1d9929e72f692179f884cd676b2dfabd879cb77defa7869dc8cfc802619277fb" Macos: "x86_64": - url: "https://nodejs.org/dist/v13.6.0/node-v13.6.0-darwin-x64.tar.gz" - sha256: "da13adb864777b322dda7af20410a9b0c63aa69de4b5574008d1e6910768bf69" - "16.3.0": + url: "https://nodejs.org/dist/v20.16.0/node-v20.16.0-darwin-x64.tar.gz" + sha256: "e18942cd706e4d69a4845ddacee2f1c17a72e853a229e3d2623d2edeb7efde72" + "armv8": + url: "https://nodejs.org/dist/v20.16.0/node-v20.16.0-darwin-arm64.tar.gz" + sha256: "fc7355e778b181575153b7dea4879e8021776eeb376c43c50f65893d2ea70aa3" + "18.15.0": Windows: "x86_64": - url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-win-x64.zip" - sha256: "3352e58d3603cf58964409d07f39f3816285317d638ddb0a0bf3af5deb2ff364" + url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-win-x64.zip" + sha256: "118fbcae58bc8c53cbe97a10c019734ed90685da8dda98aa0b0f4aeead42a647" Linux: "x86_64": - url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-linux-x64.tar.xz" - sha256: "5347ece975747e4d9768d4ed3f8b2220c955ac01f8a695347cd7f71ff5efa318" + url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-linux-x64.tar.xz" + sha256: "c8c5fa53ce0c0f248e45983e86368e0b1daf84b77e88b310f769c3cfc12682ef" "armv7": - url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-linux-armv7l.tar.xz" - sha256: "c8817e30fb910476ec1f223de7eedd31f3d157ddf2003a3083d7f5662180e4de" + url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-linux-armv7l.tar.xz" + sha256: "baad3cdf1365f46bf837635554b10bc3e320799e69ac26e07df1fcde0c1738c7" "armv8": - url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-linux-arm64.tar.xz" - sha256: "67dd97e41aad1bc11736e99cba119525b4f3472b132c46730ba8cf03f7076e23" + url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-linux-arm64.tar.xz" + sha256: "98ea6ed0a1ae55334ab2c03c34d5e52c6dc3dee8f236c0afc08ab1c964506633" Macos: "x86_64": - url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-darwin-x64.tar.gz" - sha256: "3e075bcfb6130dda84bfd04633cb228ec71e72d9a844c57efb7cfff130b4be89" + url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-darwin-x64.tar.gz" + sha256: "76add174d2d3f98da08907412e82add7352b8cb6f639324d352a65c084b99c7e" "armv8": - url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-darwin-arm64.tar.gz" - sha256: "aeac294dbe54a4dfd222eedfbae704b185c40702254810e2c5917f6dbc80e017" + url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-darwin-arm64.tar.gz" + sha256: "bd302a689c3c34e2b61d86b97de66d26a335881a17af09b6a0a4bb1019df56e4" "16.20.2": Windows: "x86_64": @@ -69,25 +68,51 @@ sources: "armv8": url: "https://nodejs.org/dist/v16.20.2/node-v16.20.2-darwin-arm64.tar.gz" sha256: "6a5c4108475871362d742b988566f3fe307f6a67ce14634eb3fbceb4f9eea88c" - "18.15.0": + "16.3.0": Windows: "x86_64": - url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-win-x64.zip" - sha256: "118fbcae58bc8c53cbe97a10c019734ed90685da8dda98aa0b0f4aeead42a647" + url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-win-x64.zip" + sha256: "3352e58d3603cf58964409d07f39f3816285317d638ddb0a0bf3af5deb2ff364" Linux: "x86_64": - url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-linux-x64.tar.xz" - sha256: "c8c5fa53ce0c0f248e45983e86368e0b1daf84b77e88b310f769c3cfc12682ef" + url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-linux-x64.tar.xz" + sha256: "5347ece975747e4d9768d4ed3f8b2220c955ac01f8a695347cd7f71ff5efa318" "armv7": - url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-linux-armv7l.tar.xz" - sha256: "baad3cdf1365f46bf837635554b10bc3e320799e69ac26e07df1fcde0c1738c7" + url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-linux-armv7l.tar.xz" + sha256: "c8817e30fb910476ec1f223de7eedd31f3d157ddf2003a3083d7f5662180e4de" "armv8": - url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-linux-arm64.tar.xz" - sha256: "98ea6ed0a1ae55334ab2c03c34d5e52c6dc3dee8f236c0afc08ab1c964506633" + url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-linux-arm64.tar.xz" + sha256: "67dd97e41aad1bc11736e99cba119525b4f3472b132c46730ba8cf03f7076e23" Macos: "x86_64": - url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-darwin-x64.tar.gz" - sha256: "76add174d2d3f98da08907412e82add7352b8cb6f639324d352a65c084b99c7e" + url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-darwin-x64.tar.gz" + sha256: "3e075bcfb6130dda84bfd04633cb228ec71e72d9a844c57efb7cfff130b4be89" "armv8": - url: "https://nodejs.org/dist/v18.15.0/node-v18.15.0-darwin-arm64.tar.gz" - sha256: "bd302a689c3c34e2b61d86b97de66d26a335881a17af09b6a0a4bb1019df56e4" + url: "https://nodejs.org/dist/v16.3.0/node-v16.3.0-darwin-arm64.tar.gz" + sha256: "aeac294dbe54a4dfd222eedfbae704b185c40702254810e2c5917f6dbc80e017" + "13.6.0": + Windows: + "x86_64": + url: "https://nodejs.org/dist/v13.6.0/node-v13.6.0-win-x64.zip" + sha256: "7fe37b34a4673a071bea52fcaf913ec422cf6fd79fd025bfb22de42ccc77f386" + Linux: + "x86_64": + url: "https://nodejs.org/dist/v13.6.0/node-v13.6.0-linux-x64.tar.xz" + sha256: "00f01315a867da16d1638f7a02966c608e344ac6c5b7d04d1fdae3138fa9d798" + Macos: + "x86_64": + url: "https://nodejs.org/dist/v13.6.0/node-v13.6.0-darwin-x64.tar.gz" + sha256: "da13adb864777b322dda7af20410a9b0c63aa69de4b5574008d1e6910768bf69" + "12.14.1": + Windows: + "x86_64": + url: "https://nodejs.org/dist/v12.14.1/node-v12.14.1-win-x64.zip" + sha256: "1f96ccce3ba045ecea3f458e189500adb90b8bc1a34de5d82fc10a5bf66ce7e3" + Linux: + "x86_64": + url: "https://nodejs.org/dist/v12.14.1/node-v12.14.1-linux-x64.tar.xz" + sha256: "07cfcaa0aa9d0fcb6e99725408d9e0b07be03b844701588e3ab5dbc395b98e1b" + Macos: + "x86_64": + url: "https://nodejs.org/dist/v12.14.1/node-v12.14.1-darwin-x64.tar.gz" + sha256: "0be10a28737527a1e5e3784d3ad844d742fe8b0718acd701fd48f718fd3af78f" diff --git a/recipes/nodejs/all/conanfile.py b/recipes/nodejs/all/conanfile.py index c098d4eea4705..077b1d4fb6d5e 100644 --- a/recipes/nodejs/all/conanfile.py +++ b/recipes/nodejs/all/conanfile.py @@ -1,33 +1,35 @@ import os -import re -from six import StringIO -from conan import ConanFile, conan_version -from conan.tools.scm import Version -from conan.tools.files import copy, get + +from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get required_conan_version = ">=1.59.0" class NodejsConan(ConanFile): name = "nodejs" - description = "nodejs binaries for use in recipes" - topics = ("node", "javascript", "runtime") + description = "Node.js is an open-source, cross-platform JavaScript runtime environment." + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://nodejs.org" - license = "MIT" + topics = ("node", "javascript", "runtime", "pre-built") + package_type = "application" - settings = "os", "arch", "compiler" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True short_paths = True - @property - def _source_subfolder(self): - return os.path.join(self.source_folder, "source_subfolder") + def layout(self): + pass + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type @property def _nodejs_arch(self): - if str(self.settings.os) == "Linux": + if str(self.settings.os) in ["Linux", "FreeBSD"]: if str(self.settings.arch).startswith("armv7"): return "armv7" if str(self.settings.arch).startswith("armv8") and "32" not in str(self.settings.arch): @@ -35,40 +37,30 @@ def _nodejs_arch(self): return str(self.settings.arch) @property - def _glibc_version(self): - cmd = ['ldd', '--version'] if conan_version.major == "1" else ['ldd --version'] - buff = StringIO() - 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 _dl_info(self): + return self.conan_data["sources"].get(self.version, {}).get(str(self.settings.os), {}).get(self._nodejs_arch) 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 \ - not self._nodejs_arch in self.conan_data["sources"][self.version][str(self.settings.os)]: + if not self._dl_info: raise ConanInvalidConfiguration("Binaries for this combination of architecture/version/os not available") - if Version(self.version) >= "18.0.0": - if str(self.settings.os) == "Linux": - if Version(self._glibc_version) < '2.27': - raise ConanInvalidConfiguration("Binaries for this combination of architecture/version/os not available") - def build(self): - get(self, **self.conan_data["sources"][self.version][str(self.settings.os)][self._nodejs_arch], - destination=self._source_subfolder, strip_root=True) + get(self, **self._dl_info, strip_root=True) def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self._source_subfolder) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self._source_subfolder, "bin")) - copy(self, pattern="*", dst=os.path.join(self.package_folder, "lib"), src=os.path.join(self._source_subfolder, "lib")) - copy(self, pattern="node.exe", dst=os.path.join(self.package_folder, "bin"), src=self._source_subfolder) - copy(self, pattern="npm", dst=os.path.join(self.package_folder, "bin"), src=self._source_subfolder) - copy(self, pattern="npx", dst=os.path.join(self.package_folder, "bin"), src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.build_folder) + copy(self, "*", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.build_folder, "bin")) + copy(self, "*", dst=os.path.join(self.package_folder, "lib"), src=os.path.join(self.build_folder, "lib")) + copy(self, "node.exe", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder) + copy(self, "npm", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder) + copy(self, "npx", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder) def package_info(self): 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 bin_dir = os.path.join(self.package_folder, "bin") - self.output.info('Appending PATH environment variable: {}'.format(bin_dir)) self.env_info.PATH.append(bin_dir) diff --git a/recipes/nodejs/all/test_package/conanfile.py b/recipes/nodejs/all/test_package/conanfile.py index 26c1600e272f4..01953a2dc0788 100644 --- a/recipes/nodejs/all/test_package/conanfile.py +++ b/recipes/nodejs/all/test_package/conanfile.py @@ -1,16 +1,27 @@ +import platform + from conan import ConanFile from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout +from conan.tools.scm import Version class TestPackageConan(ConanFile): - - settings = "os", "arch" + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualRunEnv" test_type = "explicit" + def layout(self): + cmake_layout(self) + def build_requirements(self): self.tool_requires(self.tested_reference_str) def test(self): if can_run(self): - self.output.info("Node version:") + if self.settings.os in ["Linux", "FreeBSD"]: + libc_version = Version(platform.libc_ver()[1]) + if libc_version < "2.29": + self.output.warning(f"System libc version {libc_version} < 2.29, skipping test_package") + return self.run("node --version") diff --git a/recipes/nodejs/all/test_v1_package/conanfile.py b/recipes/nodejs/all/test_v1_package/conanfile.py deleted file mode 100644 index 70012946fb840..0000000000000 --- a/recipes/nodejs/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -from conan import ConanFile -from conan.tools.build import cross_building - - -class TestPackageConan(ConanFile): - - settings = "os", "arch" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def test(self): - if not cross_building(self): - self.output.info("Node version:") - self.run("node --version") diff --git a/recipes/nodejs/config.yml b/recipes/nodejs/config.yml index 78cc638a90e4d..7f37f049d8acc 100644 --- a/recipes/nodejs/config.yml +++ b/recipes/nodejs/config.yml @@ -1,11 +1,13 @@ versions: - "12.14.1": + "20.16.0": folder: all - "13.6.0": + "18.15.0": + folder: all + "16.20.2": folder: all "16.3.0": folder: all - "16.20.2": + "13.6.0": folder: all - "18.15.0": + "12.14.1": folder: all diff --git a/recipes/nodesoup/all/test_package/CMakeLists.txt b/recipes/nodesoup/all/test_package/CMakeLists.txt index 881aec891e1d0..03fd32fe1896e 100644 --- a/recipes/nodesoup/all/test_package/CMakeLists.txt +++ b/recipes/nodesoup/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(nodesoup REQUIRED CONFIG) diff --git a/recipes/norm/all/conandata.yml b/recipes/norm/all/conandata.yml index 7e6037b74502b..6616a1fad98f4 100644 --- a/recipes/norm/all/conandata.yml +++ b/recipes/norm/all/conandata.yml @@ -9,3 +9,6 @@ patches: - patch_file: "patches/0003-cpp20-compat.patch" patch_description: "C++20 compatibility: Fix ambiguous overloaded operator ==" patch_type: "portability" + - patch_file: "patches/0004-cmake4-support.patch" + patch_description: "Increase cmake_minimum_required on protolib submodule to 3.5, minimum version supporting CMake 4" + patch_type: "portability" diff --git a/recipes/norm/all/conanfile.py b/recipes/norm/all/conanfile.py index d900ba9bfd4b9..606323902bf96 100644 --- a/recipes/norm/all/conanfile.py +++ b/recipes/norm/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.53.0" +required_conan_version = ">=2.1" class NormConan(ConanFile): @@ -39,7 +39,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.11.4") # dependency of protolib actually + self.requires("libxml2/[>=2.12.5 <3]") # dependency of protolib actually def source(self): get(self, **self.conan_data["sources"][self.version]) diff --git a/recipes/norm/all/patches/0004-cmake4-support.patch b/recipes/norm/all/patches/0004-cmake4-support.patch new file mode 100644 index 0000000000000..e7f2d28d13351 --- /dev/null +++ b/recipes/norm/all/patches/0004-cmake4-support.patch @@ -0,0 +1,8 @@ +--- a/protolib/CMakeLists.txt ++++ b/protolib/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.5) + cmake_policy(SET CMP0077 NEW) + + # set the project name diff --git a/recipes/norm/all/test_package/CMakeLists.txt b/recipes/norm/all/test_package/CMakeLists.txt index 25295e1f60e18..a4315dc3c0609 100644 --- a/recipes/norm/all/test_package/CMakeLists.txt +++ b/recipes/norm/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(norm REQUIRED CONFIG) diff --git a/recipes/norm/all/test_v1_package/CMakeLists.txt b/recipes/norm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/norm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/norm/all/test_v1_package/conanfile.py b/recipes/norm/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/norm/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_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/npcap/all/test_package/CMakeLists.txt b/recipes/npcap/all/test_package/CMakeLists.txt index 873f1064773ee..a47a9b70ac819 100644 --- a/recipes/npcap/all/test_package/CMakeLists.txt +++ b/recipes/npcap/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) diff --git a/recipes/npcap/all/test_v1_package/CMakeLists.txt b/recipes/npcap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 90f019f9f9a28..0000000000000 --- a/recipes/npcap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(npcap REQUIRED CONFIG) - -# Re-use the same source file from test_package folder -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -# don't link to ${CONAN_LIBS} or CONAN_PKG::package -target_link_libraries(${PROJECT_NAME} PRIVATE npcap::npcap) diff --git a/recipes/npcap/all/test_v1_package/conanfile.py b/recipes/npcap/all/test_v1_package/conanfile.py deleted file mode 100644 index 1b88417f558b4..0000000000000 --- a/recipes/npcap/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,41 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -from conan.tools import files -from io import StringIO -import os - - -# legacy validation with Conan 1.x -class TestPackageV1Conan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def requirements(self): - self.requires(self.tested_reference_str) - if not cross_building(self): - self.requires("libpcap/1.10.1") - - def configure(self): - if not cross_building(self): - self.options["libpcap"].shared = True - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - # 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", "bin") - files.copy(self, "pcap.dll", src=self.deps_cpp_info['libpcap'].bin_paths[0], dst="bin") - files.rename(self, os.path.join("bin", "pcap.dll"), os.path.join("bin", "wpcap.dll")) - - bin_path = os.path.join("bin", "test_package") - output = StringIO() - self.run(bin_path, run_environment=True, output=output) - test_output = output.getvalue() - print(test_output) - assert "libpcap version 1.10.1" in test_output diff --git a/recipes/nsimd/2.x/test_package/CMakeLists.txt b/recipes/nsimd/2.x/test_package/CMakeLists.txt index 6f3111e50d3ef..249a3c205ebd2 100644 --- a/recipes/nsimd/2.x/test_package/CMakeLists.txt +++ b/recipes/nsimd/2.x/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(nsimd CONFIG REQUIRED) diff --git a/recipes/nsimd/2.x/test_v1_package/CMakeLists.txt b/recipes/nsimd/2.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index ed8a6b4ca24f6..0000000000000 --- a/recipes/nsimd/2.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 0937dd58a343b..0000000000000 --- a/recipes/nsimd/2.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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 fe56b4bbdf4f7..c0a54b94256e9 100644 --- a/recipes/nspr/all/conanfile.py +++ b/recipes/nspr/all/conanfile.py @@ -105,10 +105,6 @@ def generate(self): ] elif self.settings.os == "Windows": 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): diff --git a/recipes/nspr/all/test_package/conanfile.py b/recipes/nspr/all/test_package/conanfile.py index d6a48b7c16ccf..f42142315949c 100644 --- a/recipes/nspr/all/test_package/conanfile.py +++ b/recipes/nspr/all/test_package/conanfile.py @@ -13,15 +13,6 @@ class TestPackageConan(ConanFile): def requirements(self): self.requires(self.tested_reference_str) - 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.tool_requires("cmake/3.22.0") - def layout(self): cmake_layout(self) diff --git a/recipes/nspr/all/test_v1_package/CMakeLists.txt b/recipes/nspr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/nspr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 9f6cd40d88fed..0000000000000 --- a/recipes/nspr/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +0,0 @@ -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/conanfile.py b/recipes/nss/all/conanfile.py index 6c0ff3efc96a7..b7934a3d5f1b1 100644 --- a/recipes/nss/all/conanfile.py +++ b/recipes/nss/all/conanfile.py @@ -1,14 +1,18 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import msvc_runtime_flag +from conan.tools.microsoft import msvc_runtime_flag, VCVars, is_msvc from conan.tools.scm import Version -from conan.tools.files import apply_conandata_patches, get, chdir, rename, rm +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import get, chdir, rename, rm, copy, replace_in_file from conan.tools.build import cross_building -from conans import tools +from conan.tools.layout import basic_layout +from conan.tools.apple import fix_apple_shared_install_name import os import glob -required_conan_version = ">=1.51.3" + +required_conan_version = ">=2.0.9" + class NSSConan(ConanFile): name = "nss" @@ -16,64 +20,55 @@ class NSSConan(ConanFile): homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS" url = "https://github.com/conan-io/conan-center-index" description = "Network Security Services" + package_type = "library" topics = ("network", "security", "crypto", "ssl") settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": True, "fPIC": True} - + default_options = {"shared": False, "fPIC": True} + implements = ["auto_shared_fpic"] @property - def _source_subfolder(self): - return "source_subfolder" + def _make(self): + return self.conf.get("tools.gnu:make_program", check_type=str, default="make") - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + def layout(self): + basic_layout(self, src_folder="src") def build_requirements(self): - if self.settings.compiler == "Visual Studio" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + if is_msvc(self) and not self.conf.get("tools.microsoft.bash:path"): + self.tool_requires("msys2/cci.latest") if self.settings.os == "Windows": - self.build_requires("mozilla-build/3.3") - if hasattr(self, "settings_build"): - self.build_requires("sqlite3/3.41.2") - - def configure(self): - self.options["nspr"].shared = True - self.options["sqlite3"].shared = True - - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.tool_requires("mozilla-build/3.3") + self.tool_requires("sqlite3/") + self.tool_requires("nspr/") def requirements(self): - self.requires("nspr/4.35") - self.requires("sqlite3/3.41.2") - self.requires("zlib/1.2.13") + # INFO: Public header consumed by seccomon.h:17 #include "prtypes.h" + self.requires("nspr/4.35", transitive_headers=True) + self.requires("sqlite3/[>=3.41 <4]") + self.requires("zlib/[>=1.2.13 <2]") def validate(self): if not self.options.shared: raise ConanInvalidConfiguration("NSS recipe cannot yet build static library. Contributions are welcome.") - if not self.options["nspr"].shared: - raise ConanInvalidConfiguration("NSS cannot link to static NSPR. Please use option nspr:shared=True") + if not self.dependencies["nspr"].options.shared: + raise ConanInvalidConfiguration("NSS cannot link to static NSPR. Please use option nspr/*:shared=True") + if msvc_runtime_flag(self) == "MTd": raise ConanInvalidConfiguration("NSS recipes does not support MTd runtime. Contributions are welcome.") - if not self.options["sqlite3"].shared: - raise ConanInvalidConfiguration("NSS cannot link to static sqlite. Please use option sqlite3:shared=True") - if self.settings.arch in ["armv8", "armv8.3"] and self.settings.os in ["Macos"]: - raise ConanInvalidConfiguration("Macos ARM64 builds not yet supported. Contributions are welcome.") + if Version(self.version) < "3.74": if self.settings.compiler == "clang" and Version(self.settings.compiler.version) >= 13: raise ConanInvalidConfiguration("nss < 3.74 requires clang < 13 .") - 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) @property def _make_args(self): args = [] + # INFO: NSS has a dedicated Makefile for each target platform. + # Darwin/Makfile.mk differs from others how to handle compiler flags if self.settings.arch in ["x86_64"]: args.append("USE_64=1") if self.settings.os == "Macos": @@ -85,8 +80,9 @@ def _make_args(self): args.append("CPU_ARCH=aarch64") if self.settings.compiler == "gcc": args.append("XCFLAGS=-Wno-array-parameter") - args.append("NSPR_INCLUDE_DIR=%s" % self.deps_cpp_info["nspr"].include_paths[1]) - args.append("NSPR_LIB_DIR=%s" % self.deps_cpp_info["nspr"].lib_paths[0]) + + args.append("NSPR_INCLUDE_DIR=%s" % self.dependencies["nspr"].cpp_info.aggregated_components().includedirs[1]) + args.append("NSPR_LIB_DIR=%s" % self.dependencies["nspr"].cpp_info.aggregated_components().libdirs[0]) os_map = { "Linux": "Linux", @@ -99,43 +95,34 @@ def _make_args(self): args.append("OS_ARCH=%s" % os_map.get(str(self.settings.os), "UNSUPPORTED_OS")) if self.settings.build_type != "Debug": args.append("BUILD_OPT=1") - if self.settings.compiler == "Visual Studio": + if is_msvc(self): args.append("NSPR31_LIB_PREFIX=$(NULL)") args.append("USE_SYSTEM_ZLIB=1") - args.append("ZLIB_INCLUDE_DIR=%s" % self.deps_cpp_info["zlib"].include_paths[0]) + args.append("ZLIB_INCLUDE_DIR=%s" % self.dependencies["zlib"].cpp_info.aggregated_components().includedirs[0]) - - def adjust_path(path, settings): + def adjust_path(path): """ adjusts path to be safely passed to the compiler command line for Windows bash, ensures path is in format according to the subsystem for path with spaces, places double quotes around it converts slashes to backslashes, or vice versa """ - compiler = _base_compiler(settings) - if str(compiler) == 'Visual Studio': + if is_msvc(self): path = path.replace('/', '\\') else: path = path.replace('\\', '/') return '"%s"' % path if ' ' in path else path - def _base_compiler(settings): - return settings.get_safe("compiler.base") or settings.get_safe("compiler") - - def _format_library_paths(library_paths, settings): - compiler = _base_compiler(settings) - pattern = "-LIBPATH:%s" if str(compiler) == 'Visual Studio' else "-L%s" - return [pattern % adjust_path(library_path, settings) + def _format_library_paths(library_paths): + pattern = "-LIBPATH:%s" if is_msvc(self) else "-L%s" + return [pattern % adjust_path(library_path) for library_path in library_paths if library_path] - - def _format_libraries(libraries, settings): + def _format_libraries(libraries): result = [] - compiler = settings.get_safe("compiler") - compiler_base = settings.get_safe("compiler.base") for library in libraries: - if str(compiler) == 'Visual Studio' or str(compiler_base) == 'Visual Studio': + if is_msvc(self): if not library.endswith(".lib"): library += ".lib" result.append(library) @@ -143,56 +130,83 @@ def _format_libraries(libraries, settings): result.append(f"-l{library}") return result - args.append("\"ZLIB_LIBS=%s\"" % " ".join( - _format_libraries(self.deps_cpp_info["zlib"].libs, self.settings) + - _format_library_paths(self.deps_cpp_info["zlib"].lib_paths, self.settings))) + _format_libraries(self.dependencies["zlib"].cpp_info.aggregated_components().libs) + + _format_library_paths(self.dependencies["zlib"].cpp_info.aggregated_components().libdirs))) args.append("NSS_DISABLE_GTESTS=1") args.append("NSS_USE_SYSTEM_SQLITE=1") - args.append("SQLITE_INCLUDE_DIR=%s" % self.deps_cpp_info["sqlite3"].include_paths[0]) - args.append("SQLITE_LIB_DIR=%s" % self.deps_cpp_info["sqlite3"].lib_paths[0]) + args.append("SQLITE_INCLUDE_DIR=%s" % self.dependencies["sqlite3"].cpp_info.aggregated_components().includedirs[0]) + args.append("SQLITE_LIB_DIR=%s" % self.dependencies["sqlite3"].cpp_info.aggregated_components().libdirs[0]) args.append("NSDISTMODE=copy") + args.append("NSS_ENABLE_WERROR=0") if cross_building(self): args.append("CROSS_COMPILE=1") - return args - + # FIXME: Disable shlibsign on Mac M1 until fixed: + # shlibsign -v -i dist/lib/libsoftokn3.dylib + # loading softokn3 failedmake[4]: *** [dist/lib/libsoftokn3.chk] Error 1 + elif self.settings.os == "Macos" and self.settings.arch == "armv8": + args.append("CROSS_COMPILE=1") + if self.conf.get("tools.compilation:verbosity", check_type=str, default="quiet") == "verbose": + args.append("V=1") + if self.settings.arch != "x86_64": + args.append("NSS_DISABLE_AVX2=1") + for folder in ["DIST", "SOURCE_PREFIX", "SOURCE_MD_DIR"]: + args.append(f"{folder}={self.build_folder}/dist") + + return " ".join(args) + + def generate(self): + ms = VCVars(self) + ms.generate() + vbe = VirtualBuildEnv(self) + vbe.generate() + if not cross_building(self): + vre = VirtualRunEnv(self) + vre.generate(scope="build") + + def _patch_sources(self): + # INFO: The Darwin.mk has no configuration for ARM arch, and anything different from x86_64 or arm is considered as PowerPC + # Using arm as CPU_ARCH will require ARM neon support, resulting in build errors due missing __ARM_FEATURE_CRYPTO feature support in Clang + # See https://bugzilla.mozilla.org/show_bug.cgi?id=1952518 + replace_in_file(self, os.path.join(self.source_folder, "nss", "coreconf", "Darwin.mk"), "ifeq (arm,$(CPU_ARCH))", "ifeq (aarch64, $(CPU_ARCH))") def build(self): - apply_conandata_patches(self) - with chdir(self, os.path.join(self._source_subfolder, "nss")): - with tools.vcvars(self) if self.settings.compiler == "Visual Studio" else tools.no_op(): - self.run("make %s" % " ".join(self._make_args), run_environment=True) + self._patch_sources() + with chdir(self, os.path.join(self.source_folder, "nss")): + self.run(f"{self._make} {self._make_args}") def package(self): - self.copy("COPYING", src = os.path.join(self._source_subfolder, "nss"), dst = "licenses") - with chdir(self, os.path.join(self._source_subfolder, "nss")): - self.run("make install %s" % " ".join(self._make_args)) - self.copy("*", - src=os.path.join(self._source_subfolder, "dist", "public", "nss"), - dst="include") - for d in os.listdir(os.path.join(self._source_subfolder, "dist")): - if d in ["private","public"]: + copy(self, "COPYING", src=os.path.join(self.source_folder, "nss"), dst=os.path.join(self.package_folder, "licenses")) + + with chdir(self, os.path.join(self.source_folder, "nss")): + self.run(f"{self._make} install {self._make_args}") + + copy(self, "*", src=os.path.join(self.build_folder, "dist", "public", "nss"), dst=os.path.join(self.package_folder, "include")) + for d in os.listdir(os.path.join(self.build_folder, "dist")): + if d in ["private", "public"]: continue - f = os.path.join(self._source_subfolder, "dist", d) + f = os.path.join(self.build_folder, "dist", d) if not os.path.isdir(f): continue - self.copy("*", src = f) + copy(self, "*", src=f, dst=os.path.join(self.package_folder, os.path.basename(f))) - for dll_file in glob.glob(os.path.join(self.package_folder, "lib", "*.dll")): + for dll_file in glob.glob(os.path.join(self.build_folder, "dist", "lib", "*.dll")): rename(self, dll_file, os.path.join(self.package_folder, "bin", os.path.basename(dll_file))) + # INFO: NSS builds both shared and static libraries at same time if self.options.shared: rm(self, "*.a", os.path.join(self.package_folder, "lib")) + rm(self, "*.dll", os.path.join(self.package_folder, "lib")) else: rm(self, "*.so", os.path.join(self.package_folder, "lib")) rm(self, "*.dll", os.path.join(self.package_folder, "bin")) - + fix_apple_shared_install_name(self) def package_info(self): - def _library_name(lib,vers): return f"{lib}{vers}" if self.options.shared else lib + self.cpp_info.components["libnss"].libs.append(_library_name("nss", 3)) self.cpp_info.components["libnss"].requires = ["nssutil", "nspr::nspr"] diff --git a/recipes/nss/all/test_package/CMakeLists.txt b/recipes/nss/all/test_package/CMakeLists.txt index ae0d9b4b934f7..641ca014f8db4 100644 --- a/recipes/nss/all/test_package/CMakeLists.txt +++ b/recipes/nss/all/test_package/CMakeLists.txt @@ -1,9 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(nss REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} CONAN_PKG::nss) - +target_link_libraries(${PROJECT_NAME} PRIVATE nss::nss) diff --git a/recipes/nss/all/test_package/conanfile.py b/recipes/nss/all/test_package/conanfile.py index 6a9b925c476c6..2e77b4246fa81 100644 --- a/recipes/nss/all/test_package/conanfile.py +++ b/recipes/nss/all/test_package/conanfile.py @@ -1,18 +1,25 @@ -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" + + 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 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/nsync/all/conandata.yml b/recipes/nsync/all/conandata.yml index b694103d49b84..2612b48d1ed17 100644 --- a/recipes/nsync/all/conandata.yml +++ b/recipes/nsync/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.29.2": + url: "https://github.com/google/nsync/archive/1.29.2.tar.gz" + sha256: "1d63e967973733d2c97e841e3c05fac4d3fa299f01d14c86f2695594c7a4a2ec" + "1.29.1": + url: "https://github.com/google/nsync/archive/1.29.1.tar.gz" + sha256: "3045a8922171430426b695edf794053182d245f6a382ddcc59ef4a6190848e98" + "1.28.0": + url: "https://github.com/google/nsync/archive/1.28.0.tar.gz" + sha256: "1e6a7193bd85d480faaf992cef204c5cf09f9da72766c9987e25b4f88508eed1" + "1.27.0": + url: "https://github.com/google/nsync/archive/1.27.0.tar.gz" + sha256: "e8e552a358f4a28e844207a7c5cb51767e4aeb0b29e22d23ac2a09924130f761" "1.26.0": url: "https://github.com/google/nsync/archive/1.26.0.tar.gz" sha256: "80fc1e605bb3cf5f272811ece39c4fb6761ffcb9b30563301845cc9ff381eb8b" @@ -12,6 +24,14 @@ sources: sha256: "b7e75b17957c62bd02dd73890bde22da3a564903fcaad651b395453d41d3325b" url: "https://github.com/google/nsync/archive/refs/tags/1.23.0.tar.gz" patches: + "1.29.2": + - patch_file: "patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" + "1.29.1": + - patch_file: "patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" + "1.28.0": + - patch_file: "patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" + "1.27.0": + - patch_file: "patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" "1.26.0": - patch_file: "patches/0001-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch" "1.25.0": diff --git a/recipes/nsync/all/conanfile.py b/recipes/nsync/all/conanfile.py index fd5515ae38c38..4617489c0bb8f 100644 --- a/recipes/nsync/all/conanfile.py +++ b/recipes/nsync/all/conanfile.py @@ -1,10 +1,12 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file +from conan.errors import ConanException +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, replace_in_file, rmdir from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class NsyncConan(ConanFile): @@ -50,6 +52,9 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True # Relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.29.2": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def _patch_sources(self): @@ -84,6 +89,7 @@ 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.components["nsync_c"].libs = ["nsync"] diff --git a/recipes/nsync/all/patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch b/recipes/nsync/all/patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch new file mode 100644 index 0000000000000..1f3fd75999335 --- /dev/null +++ b/recipes/nsync/all/patches/0001-1.27.0-darwin-exclude_semaphore_mutex_c_from_nsync_cpp_lib.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,7 +125,6 @@ + ${NSYNC_OS_CPP_SRC} + "platform/c++11/src/nsync_semaphore_mutex.cc" + "platform/posix/src/clock_gettime.c" +- "platform/posix/src/nsync_semaphore_mutex.c" + ) + elseif ("${CMAKE_SYSTEM_NAME}X" STREQUAL "LinuxX") + set (NSYNC_POSIX ON) diff --git a/recipes/nsync/all/test_package/CMakeLists.txt b/recipes/nsync/all/test_package/CMakeLists.txt index d5e1f549f9dd0..d60f6920a4ac5 100644 --- a/recipes/nsync/all/test_package/CMakeLists.txt +++ b/recipes/nsync/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C CXX) find_package(nsync REQUIRED CONFIG) diff --git a/recipes/nsync/all/test_v1_package/CMakeLists.txt b/recipes/nsync/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/nsync/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nsync/all/test_v1_package/conanfile.py b/recipes/nsync/all/test_v1_package/conanfile.py deleted file mode 100644 index e1fbce68b1417..0000000000000 --- a/recipes/nsync/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +0,0 @@ -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): - test_package_c = os.path.join("bin", "test_package") - test_package_cpp = os.path.join("bin", "test_package_cpp") - self.run(test_package_c, run_environment=True) - self.run(test_package_cpp, run_environment=True) diff --git a/recipes/nsync/config.yml b/recipes/nsync/config.yml index 960f98574a708..b839a601be83a 100644 --- a/recipes/nsync/config.yml +++ b/recipes/nsync/config.yml @@ -1,4 +1,12 @@ versions: + "1.29.2": + folder: "all" + "1.29.1": + folder: "all" + "1.28.0": + folder: "all" + "1.27.0": + folder: "all" "1.26.0": folder: "all" "1.25.0": diff --git a/recipes/ntv2/all/test_package/CMakeLists.txt b/recipes/ntv2/all/test_package/CMakeLists.txt index 1fbef6631f228..95ac0d93ee529 100644 --- a/recipes/ntv2/all/test_package/CMakeLists.txt +++ b/recipes/ntv2/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(ntv2 CONFIG REQUIRED) diff --git a/recipes/ntv2/all/test_v1_package/CMakeLists.txt b/recipes/ntv2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/ntv2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ntv2/all/test_v1_package/conanfile.py b/recipes/ntv2/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ntv2/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_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/nudb/all/conandata.yml b/recipes/nudb/all/conandata.yml index 0593d2a4336ca..4c3dd7124cbb3 100644 --- a/recipes/nudb/all/conandata.yml +++ b/recipes/nudb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.9": + url: "https://github.com/CPPAlliance/NuDB/archive/2.0.9.tar.gz" + sha256: "a088dac72931f7b51b4def1f1b505e4e6c4d1c8c8b41fa3c5f70b989ddcaeba9" "2.0.8": url: "https://github.com/CPPAlliance/NuDB/archive/2.0.8.tar.gz" sha256: "9b71903d8ba111cd893ab064b9a8b6ac4124ed8bd6b4f67250205bc43c7f13a8" diff --git a/recipes/nudb/all/conanfile.py b/recipes/nudb/all/conanfile.py index bd9db41da603f..7b03f03a6026b 100644 --- a/recipes/nudb/all/conanfile.py +++ b/recipes/nudb/all/conanfile.py @@ -54,7 +54,7 @@ def package_info(self): 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.set_property("cmake_find_mode", "both") self.cpp_info.components["core"].set_property("cmake_target_name", "nudb") self.cpp_info.components["core"].names["cmake_find_package"] = "nudb" diff --git a/recipes/nudb/all/test_v1_package/CMakeLists.txt b/recipes/nudb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/nudb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 573376a19a476..0000000000000 --- a/recipes/nudb/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/nudb/config.yml b/recipes/nudb/config.yml index 992ee531df27f..e5a3e6ed860de 100644 --- a/recipes/nudb/config.yml +++ b/recipes/nudb/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.9": + folder: "all" "2.0.8": folder: "all" diff --git a/recipes/nuklear/all/conandata.yml b/recipes/nuklear/all/conandata.yml index d11d172a2e7ff..f0b7ee2207d6b 100644 --- a/recipes/nuklear/all/conandata.yml +++ b/recipes/nuklear/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.12.0": + url: "https://github.com/Immediate-Mode-UI/Nuklear/archive/4.12.0.tar.gz" + sha256: "4cb80084d20d20561548a2941b6d1eb7c30e6f0b9405e0d5df84bae3c1d7bbaf" "4.10.6": url: "https://github.com/Immediate-Mode-UI/Nuklear/archive/4.10.6.tar.gz" sha256: "1baa1c9603ef20e6410a931de65d3fe07def5266fa7a61cdf1ffd241b3109a99" diff --git a/recipes/nuklear/all/test_package/CMakeLists.txt b/recipes/nuklear/all/test_package/CMakeLists.txt index 1ad54fbb12c80..3f6a76b806061 100644 --- a/recipes/nuklear/all/test_package/CMakeLists.txt +++ b/recipes/nuklear/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(nuklear REQUIRED CONFIG) diff --git a/recipes/nuklear/all/test_v1_package/CMakeLists.txt b/recipes/nuklear/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/nuklear/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/nuklear/all/test_v1_package/conanfile.py b/recipes/nuklear/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/nuklear/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_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/config.yml b/recipes/nuklear/config.yml index 96278eaa477be..bb8a95e082cf9 100644 --- a/recipes/nuklear/config.yml +++ b/recipes/nuklear/config.yml @@ -1,4 +1,6 @@ versions: + "4.12.0": + folder: all "4.10.6": folder: all "4.10.1": diff --git a/recipes/numcpp/all/conandata.yml b/recipes/numcpp/all/conandata.yml index bc13c5f8f97d8..bd4ac3eb72ffe 100644 --- a/recipes/numcpp/all/conandata.yml +++ b/recipes/numcpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.14.0": + url: "https://github.com/dpilger26/NumCpp/archive/Version_2.14.0.tar.gz" + sha256: "f7d3a11d12f3209c95c098d0566e6aee072cfc493f1e9376796c91520958686f" "2.12.1": url: "https://github.com/dpilger26/NumCpp/archive/Version_2.12.1.tar.gz" sha256: "f462ecd27126e6057b31fa38f1f72cef2c4223c9d848515412970714a5bb6d16" diff --git a/recipes/numcpp/all/test_v1_package/CMakeLists.txt b/recipes/numcpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/numcpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/numcpp/all/test_v1_package/conanfile.py b/recipes/numcpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/numcpp/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_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/numcpp/config.yml b/recipes/numcpp/config.yml index a222baacafc0a..c7baf747b7bf9 100644 --- a/recipes/numcpp/config.yml +++ b/recipes/numcpp/config.yml @@ -1,4 +1,6 @@ versions: + "2.14.0": + folder: "all" "2.12.1": folder: "all" "2.12.0": diff --git a/recipes/nuraft/all/conanfile.py b/recipes/nuraft/all/conanfile.py index 9ec70bcec889d..d1f0175ecb6cf 100644 --- a/recipes/nuraft/all/conanfile.py +++ b/recipes/nuraft/all/conanfile.py @@ -10,7 +10,7 @@ class NuRaftConan(ConanFile): name = "nuraft" - homepage = "https://github.corp.ebay.com/sds/NuRaft" + homepage = "https://github.com/eBay/NuRaft" description = """Cornerstone based RAFT library.""" topics = ("raft",) url = "https://github.com/conan-io/conan-center-index" diff --git a/recipes/nuraft/all/test_package/CMakeLists.txt b/recipes/nuraft/all/test_package/CMakeLists.txt index a85fdad5cb296..84cd0341f9803 100644 --- a/recipes/nuraft/all/test_package/CMakeLists.txt +++ b/recipes/nuraft/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(nuraft CONFIG REQUIRED) diff --git a/recipes/nuraft/all/test_v1_package/CMakeLists.txt b/recipes/nuraft/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/nuraft/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nuraft/all/test_v1_package/conanfile.py b/recipes/nuraft/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/nuraft/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_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/nv-codec-headers/all/conandata.yml b/recipes/nv-codec-headers/all/conandata.yml index df731f0997f31..482c89e58c766 100644 --- a/recipes/nv-codec-headers/all/conandata.yml +++ b/recipes/nv-codec-headers/all/conandata.yml @@ -1,4 +1,7 @@ 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" @@ -6,5 +9,5 @@ sources: 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 b85d4da96e184..f21dc25aa7ca9 100644 --- a/recipes/nv-codec-headers/all/conanfile.py +++ b/recipes/nv-codec-headers/all/conanfile.py @@ -33,7 +33,7 @@ def package_id(self): 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") + self.build_requires("make/4.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/nv-codec-headers/config.yml b/recipes/nv-codec-headers/config.yml index 018eb4087b892..21a0b445119b1 100644 --- a/recipes/nv-codec-headers/config.yml +++ b/recipes/nv-codec-headers/config.yml @@ -1,4 +1,6 @@ versions: + "12.1.14.0": + folder: all "12.0.16.0": folder: all "11.1.5.1": diff --git a/recipes/nvcloth/1.1.6/CMakeLists.txt b/recipes/nvcloth/1.1.6/CMakeLists.txt index a236130272a84..4cd8eda7866f8 100644 --- a/recipes/nvcloth/1.1.6/CMakeLists.txt +++ b/recipes/nvcloth/1.1.6/CMakeLists.txt @@ -1,7 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) +# Using a CMake wrapper because the project's CMakeLists.txt does not set project() +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper CXX) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder/NvCloth/compiler/cmake/${TARGET_BUILD_PLATFORM}") +add_subdirectory("src/NvCloth/compiler/cmake/${TARGET_BUILD_PLATFORM}") diff --git a/recipes/nvcloth/1.1.6/conandata.yml b/recipes/nvcloth/1.1.6/conandata.yml index c37596cc7f7b6..657fa6c95ca38 100644 --- a/recipes/nvcloth/1.1.6/conandata.yml +++ b/recipes/nvcloth/1.1.6/conandata.yml @@ -5,8 +5,5 @@ sources: patches: "1.1.6": - patch_file: "patches/0001-PsAllocator-include-typeinfo.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-CallbackFix.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-PsAllocator.patch" - base_path: "source_subfolder" diff --git a/recipes/nvcloth/1.1.6/conanfile.py b/recipes/nvcloth/1.1.6/conanfile.py index c303576ad28c2..abfae884a66d8 100644 --- a/recipes/nvcloth/1.1.6/conanfile.py +++ b/recipes/nvcloth/1.1.6/conanfile.py @@ -1,175 +1,152 @@ import os import shutil -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from conan.tools.microsoft import msvc_runtime_flag, is_msvc_static_runtime, is_msvc +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.env import Environment +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_static_runtime + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.35.0" class NvclothConan(ConanFile): name = "nvcloth" + description = "NvCloth is a library that provides low level access to a cloth solver designed for realtime interactive applications." license = "Nvidia Source Code License (1-Way Commercial)" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/NVIDIAGameWorks/NvCloth" - description = "NvCloth is a library that provides low level access to a cloth solver designed for realtime interactive applications." topics = ("physics", "physics-engine", "physics-simulation", "game-development", "cuda") - # Binary configuration - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "use_cuda": [True, False], - "use_dx11": [True, False] + "use_dx11": [True, False], } default_options = { "shared": False, "fPIC": True, "use_cuda": False, - "use_dx11": False + "use_dx11": False, } - generators = "cmake" + def export_sources(self): + export_conandata_patches(self) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) - @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 source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + 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 validate(self): - if self.settings.os not in ["Windows", "Linux", "Macos", "Android", "iOS"]: - raise ConanInvalidConfiguration("Current os is not supported") + if self.settings.os not in ["Windows", "Linux", "FreeBSD", "Macos", "Android", "iOS"]: + raise ConanInvalidConfiguration(f"{self.settings.os} is not supported") - build_type = self.settings.build_type - if build_type not in ["Debug", "RelWithDebInfo", "Release"]: - raise ConanInvalidConfiguration("Current build_type is not supported") + if self.settings.os in ["Windows", "Macos"] and not self.options.shared: + raise ConanInvalidConfiguration(f"Static builds are not supported on {self.settings.os}") + if self.settings.os in ["iOS", "Android"] and self.options.shared: + raise ConanInvalidConfiguration(f"Shared builds are not supported on {self.settings.os}") - if is_msvc(self) and tools.Version(self.settings.compiler.version) < 9: - raise ConanInvalidConfiguration("Visual Studio versions < 9 are not supported") + if self.settings.build_type not in ["Debug", "RelWithDebInfo", "Release"]: + raise ConanInvalidConfiguration(f"{self.settings.build_type} build_type is not supported") - def _configure_cmake(self): - cmake = CMake(self) - if not self.options.shared: - cmake.definitions["PX_STATIC_LIBRARIES"] = 1 - cmake.definitions["STATIC_WINCRT"] = is_msvc_static_runtime(self) + check_min_vs(self, 150) + check_min_cppstd(self, 11) - cmake.definitions["NV_CLOTH_ENABLE_CUDA"] = self.options.use_cuda - cmake.definitions["NV_CLOTH_ENABLE_DX11"] = self.options.use_dx11 + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - cmake.definitions["TARGET_BUILD_PLATFORM"] = self._get_target_build_platform() + @property + def _target_build_platform(self): + return { + "Windows": "windows", + "Linux": "linux", + "Macos": "mac", + "Android": "android", + "iOS": "ios", + }.get(str(self.settings.os)) + + def generate(self): + tc = CMakeToolchain(self) + if not self.options.shared: + tc.variables["PX_STATIC_LIBRARIES"] = 1 + tc.variables["STATIC_WINCRT"] = is_msvc_static_runtime(self) + tc.variables["NV_CLOTH_ENABLE_CUDA"] = self.options.use_cuda + tc.variables["NV_CLOTH_ENABLE_DX11"] = self.options.use_dx11 + tc.variables["TARGET_BUILD_PLATFORM"] = self._target_build_platform + tc.generate() + + env = Environment() + env.define_path("GW_DEPS_ROOT", self.source_folder) + env.vars(self).save_script("conan_build_vars") - cmake.configure( - build_folder=os.path.join(self.build_folder, self._build_subfolder) - ) - return cmake - def _remove_samples(self): - tools.rmdir(os.path.join(self._source_subfolder, "NvCloth", "samples")) + rmdir(self, os.path.join(self.source_folder, "NvCloth", "samples")) def _patch_sources(self): # There is no reason to force consumer of PhysX public headers to use one of # NDEBUG or _DEBUG, since none of them relies on NDEBUG or _DEBUG - tools.replace_in_file(os.path.join(self.build_folder, self._source_subfolder, "PxShared", "include", "foundation", "PxPreprocessor.h"), - "#error Exactly one of NDEBUG and _DEBUG needs to be defined!", - "// #error Exactly one of NDEBUG and _DEBUG needs to be defined!") - shutil.copy( - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h"), - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.origin") - ) - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - - if self.settings.build_type == "Debug": - shutil.copy( - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h"), - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.patched") - ) - shutil.copy( - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.origin"), - os.path.join(self.build_folder, self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h") - ) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + replace_in_file(self, os.path.join(self.source_folder, "PxShared", "include", "foundation", "PxPreprocessor.h"), + "#error Exactly one of NDEBUG and _DEBUG needs to be defined!", + "// #error Exactly one of NDEBUG and _DEBUG needs to be defined!") + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.origin")) + apply_conandata_patches(self) - def configure(self): - if self.options.shared: - del self.options.fPIC + if self.settings.build_type == "Debug": + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.patched")) + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.origin"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h")) def build(self): - with tools.environment_append({"GW_DEPS_ROOT": os.path.abspath(self._source_subfolder)}): - self._patch_sources() - self._remove_samples() - cmake = self._configure_cmake() - cmake.build() - - def _get_build_type(self): - if self.settings.build_type == "Debug": - return "debug" - elif self.settings.build_type == "RelWithDebInfo": - return "checked" - elif self.settings.build_type == "Release": - return "release" - - def _get_target_build_platform(self): - return { - "Windows" : "windows", - "Linux" : "linux", - "Macos" : "mac", - "Android" : "android", - "iOS" : "ios" - }.get(str(self.settings.os)) + self._patch_sources() + self._remove_samples() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) + cmake.build() def package(self): if self.settings.build_type == "Debug": - shutil.copy( - os.path.join(self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h.patched"), - os.path.join(self._source_subfolder, "NvCloth/include/NvCloth/Callbacks.h") - ) - nvcloth_source_subfolder = os.path.join(self.build_folder, self._source_subfolder) - nvcloth_build_subfolder = os.path.join(self.build_folder, self._build_subfolder) - - self.copy(pattern="NvCloth/license.txt", dst="licenses", src=nvcloth_source_subfolder, keep_path=False) - self.copy("*.h", dst="include", src=os.path.join(nvcloth_source_subfolder, "NvCloth", "include")) - self.copy("*.h", dst="include", src=os.path.join(nvcloth_source_subfolder, "NvCloth", "extensions", "include")) - self.copy("*.h", dst="include", src=os.path.join(nvcloth_source_subfolder, "PxShared", "include")) - self.copy("*.a", dst="lib", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.lib", dst="lib", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.dylib*", dst="lib", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.dll", dst="bin", src=nvcloth_build_subfolder, keep_path=False) - self.copy("*.so", dst="lib", src=nvcloth_build_subfolder, keep_path=False) + shutil.copy(os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h.patched"), + os.path.join(self.source_folder, "NvCloth", "include", "NvCloth", "Callbacks.h")) + copy(self, "NvCloth/license.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder, keep_path=False) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "NvCloth", "include")) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "NvCloth", "extensions", "include")) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "PxShared", "include")) + copy(self, "*.a", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + copy(self, "*.dylib*", 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, "*.so", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "nvcloth" - self.cpp_info.names["cmake_find_package_multi"] = "nvcloth" + self.cpp_info.set_property("cmake_file_name", "nvcloth") + self.cpp_info.set_property("cmake_target_name", "nvcloth::nvcloth") if self.settings.build_type == "Debug": debug_suffix = "DEBUG" else: debug_suffix = "" - if self.settings.os == "Windows": - if self.settings.arch == "x86_64": - arch_suffix = "x64" - else: - arch_suffix = "" - self.cpp_info.libs = ["NvCloth{}_{}".format(debug_suffix, arch_suffix)] + if self.settings.os == "Windows" and self.settings.arch == "x86_64": + arch_suffix = "_x64" else: - self.cpp_info.libs = ["NvCloth{}".format(debug_suffix)] + arch_suffix = "" - if not self.options.shared: - if self.settings.os in ("FreeBSD", "Linux"): - self.cpp_info.system_libs.append("m") + self.cpp_info.libs = [f"NvCloth{debug_suffix}{arch_suffix}"] + + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs.append("m") diff --git a/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt b/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt index e0165aeedb7a2..d8a9e2773d7d6 100644 --- a/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt +++ b/recipes/nvcloth/1.1.6/test_package/CMakeLists.txt @@ -1,10 +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(TARGETS) +find_package(nvcloth REQUIRED CONFIG) find_package(nvcloth REQUIRED nvcloth CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} nvcloth::nvcloth) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/nvcloth/1.1.6/test_package/conanfile.py b/recipes/nvcloth/1.1.6/test_package/conanfile.py index e290e81a631fa..ef5d7042163ec 100644 --- a/recipes/nvcloth/1.1.6/test_package/conanfile.py +++ b/recipes/nvcloth/1.1.6/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 NvClothTestConan(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/nvtx/all/test_package/CMakeLists.txt b/recipes/nvtx/all/test_package/CMakeLists.txt index eae79b2f4aa39..f9d18121209d9 100644 --- a/recipes/nvtx/all/test_package/CMakeLists.txt +++ b/recipes/nvtx/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 C) find_package(nvtx REQUIRED CONFIG) diff --git a/recipes/nvtx/all/test_v1_package/CMakeLists.txt b/recipes/nvtx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/nvtx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/nvtx/all/test_v1_package/conanfile.py b/recipes/nvtx/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/nvtx/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_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/oatpp-libressl/all/conanfile.py b/recipes/oatpp-libressl/all/conanfile.py index 6eec475cde13d..02cb36cfa573c 100644 --- a/recipes/oatpp-libressl/all/conanfile.py +++ b/recipes/oatpp-libressl/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.54" class OatppLibresslConan(ConanFile): @@ -18,6 +18,7 @@ class OatppLibresslConan(ConanFile): description = "oat++ libressl library" topics = ("oat++", "oatpp", "libressl") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,21 +35,24 @@ 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("libressl/3.5.3") + # There's a 1 to 1 match between versions of oatpp and oatpp-libressl + # oatpp-libressl/oatpp-libressl/Config.hpp:28 and 30 contain includes to these libraries + self.requires(f"oatpp/{self.version}", transitive_headers=True) + self.requires("libressl/3.5.3", transitive_headers=True) + + @property + def _min_cppstd(self): + return 11 def validate(self): if self.info.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) if is_msvc(self) and self.info.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared library with msvc") @@ -64,8 +68,6 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["OATPP_BUILD_TESTS"] = False tc.variables["OATPP_MODULES_LOCATION"] = "INSTALLED" - # 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() @@ -84,6 +86,10 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "oatpp-libressl") self.cpp_info.set_property("cmake_target_name", "oatpp::oatpp-libressl") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["_oatpp-libressl"].includedirs = [ os.path.join("include", f"oatpp-{self.version}", "oatpp-libressl") diff --git a/recipes/oatpp-libressl/all/test_package/CMakeLists.txt b/recipes/oatpp-libressl/all/test_package/CMakeLists.txt index 3cc329996c9b0..a01243f8e57f6 100644 --- a/recipes/oatpp-libressl/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-libressl/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(oatpp-libressl REQUIRED CONFIG) diff --git a/recipes/oatpp-libressl/all/test_v1_package/CMakeLists.txt b/recipes/oatpp-libressl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 07afded94f59c..0000000000000 --- a/recipes/oatpp-libressl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(oatpp-libressl REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-libressl) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-libressl/all/test_v1_package/conanfile.py b/recipes/oatpp-libressl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/oatpp-libressl/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_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/oatpp-openssl/all/conanfile.py b/recipes/oatpp-openssl/all/conanfile.py index b17d50cd83efc..771c7d111c06d 100644 --- a/recipes/oatpp-openssl/all/conanfile.py +++ b/recipes/oatpp-openssl/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=2.1" class OatppOpenSSLConan(ConanFile): @@ -18,6 +18,7 @@ class OatppOpenSSLConan(ConanFile): description = "Oat++ OpenSSL library" topics = ("oat++", "oatpp", "openssl") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -28,27 +29,19 @@ class OatppOpenSSLConan(ConanFile): "fPIC": True, } - 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 + implements = ["auto_shared_fpic"] def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires(f"oatpp/{self.version}") - self.requires("openssl/[>=1.1 <4]") + # Used in oatpp-openssl/oatpp-openssl/Config.hpp public header + self.requires(f"oatpp/{self.version}", transitive_headers=True) + # Used SSL* and SSL_CTX* used in public headers + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) def validate(self): - if self.info.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, 11) if is_msvc(self) and self.info.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared library with msvc") @@ -57,13 +50,12 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=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) - tc.variables["OATPP_BUILD_TESTS"] = False - tc.variables["OATPP_MODULES_LOCATION"] = "INSTALLED" + tc.cache_variables["OATPP_BUILD_TESTS"] = False + tc.cache_variables["OATPP_MODULES_LOCATION"] = "INSTALLED" # 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() @@ -76,7 +68,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")) @@ -84,6 +76,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "oatpp-openssl") self.cpp_info.set_property("cmake_target_name", "oatpp::oatpp-openssl") + # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["_oatpp-openssl"].includedirs = [ os.path.join("include", f"oatpp-{self.version}", "oatpp-openssl") @@ -97,12 +90,5 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_oatpp-openssl"].system_libs = ["pthread"] - # TODO: to remove in conan v2 once legacy generators removed - self.cpp_info.filenames["cmake_find_package"] = "oatpp-openssl" - self.cpp_info.filenames["cmake_find_package_multi"] = "oatpp-openssl" - self.cpp_info.names["cmake_find_package"] = "oatpp" - self.cpp_info.names["cmake_find_package_multi"] = "oatpp" - self.cpp_info.components["_oatpp-openssl"].names["cmake_find_package"] = "oatpp-openssl" - self.cpp_info.components["_oatpp-openssl"].names["cmake_find_package_multi"] = "oatpp-openssl" self.cpp_info.components["_oatpp-openssl"].set_property("cmake_target_name", "oatpp::oatpp-openssl") self.cpp_info.components["_oatpp-openssl"].requires = ["oatpp::oatpp", "openssl::openssl"] diff --git a/recipes/oatpp-openssl/all/test_package/CMakeLists.txt b/recipes/oatpp-openssl/all/test_package/CMakeLists.txt index 716aedd7390f1..5aaf8115d1dba 100644 --- a/recipes/oatpp-openssl/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-openssl/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(oatpp-openssl REQUIRED CONFIG) diff --git a/recipes/oatpp-openssl/all/test_package/test_package.cpp b/recipes/oatpp-openssl/all/test_package/test_package.cpp index 5b43d477e581e..a3e8d635fe6aa 100644 --- a/recipes/oatpp-openssl/all/test_package/test_package.cpp +++ b/recipes/oatpp-openssl/all/test_package/test_package.cpp @@ -2,8 +2,7 @@ #include "oatpp-openssl/Config.hpp" int main() { - - oatpp::openssl::Config config; - + std::shared_ptr config = oatpp::openssl::Config::createShared(); + std::cout << "Test package successful\n"; return 0; } diff --git a/recipes/oatpp-openssl/all/test_v1_package/CMakeLists.txt b/recipes/oatpp-openssl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 07d783bdbcaec..0000000000000 --- a/recipes/oatpp-openssl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(oatpp-openssl REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-openssl) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-openssl/all/test_v1_package/conanfile.py b/recipes/oatpp-openssl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/oatpp-openssl/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_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/oatpp-postgresql/all/test_package/CMakeLists.txt b/recipes/oatpp-postgresql/all/test_package/CMakeLists.txt index 3e6651b60950e..a09eb0636b6bc 100644 --- a/recipes/oatpp-postgresql/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-postgresql/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(oatpp-postgresql REQUIRED) diff --git a/recipes/oatpp-postgresql/all/test_v1_package/CMakeLists.txt b/recipes/oatpp-postgresql/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 5d0c80f735ffb..0000000000000 --- a/recipes/oatpp-postgresql/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(oatpp-postgresql REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp-postgresql) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp-postgresql/all/test_v1_package/conanfile.py b/recipes/oatpp-postgresql/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/oatpp-postgresql/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_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/oatpp-sqlite/all/conanfile.py b/recipes/oatpp-sqlite/all/conanfile.py index 75896ed5f3e71..5d2b46351ef5e 100644 --- a/recipes/oatpp-sqlite/all/conanfile.py +++ b/recipes/oatpp-sqlite/all/conanfile.py @@ -7,17 +7,17 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.53.0" class OatppsqliteConan(ConanFile): name = "oatpp-sqlite" + description = "SQLite adapter for oatpp ORM." license = "Apache-2.0" - homepage = "https://github.com/oatpp/oatpp-sqlite" url = "https://github.com/conan-io/conan-center-index" - description = "oat++ SQLite library" + homepage = "https://github.com/oatpp/oatpp-sqlite" topics = ("oat++", "oatpp", "sqlite") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,17 +34,14 @@ 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("sqlite3/3.39.4") + self.requires(f"oatpp/{self.version}", transitive_headers=True) + self.requires("sqlite3/3.45.0") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): @@ -57,8 +54,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires GCC >=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/oatpp-sqlite/all/test_package/CMakeLists.txt b/recipes/oatpp-sqlite/all/test_package/CMakeLists.txt index ca51c6a39660d..43bd00c6bc5ad 100644 --- a/recipes/oatpp-sqlite/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-sqlite/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(oatpp-sqlite REQUIRED CONFIG) diff --git a/recipes/oatpp-swagger/all/test_package/CMakeLists.txt b/recipes/oatpp-swagger/all/test_package/CMakeLists.txt index bc689c85dba9b..9db94d40b0a15 100644 --- a/recipes/oatpp-swagger/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-swagger/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(oatpp-swagger REQUIRED CONFIG) diff --git a/recipes/oatpp-websocket/all/test_package/CMakeLists.txt b/recipes/oatpp-websocket/all/test_package/CMakeLists.txt index 7ec180083e3d0..932c5b8c86527 100644 --- a/recipes/oatpp-websocket/all/test_package/CMakeLists.txt +++ b/recipes/oatpp-websocket/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(oatpp-websocket REQUIRED CONFIG) diff --git a/recipes/oatpp/all/conandata.yml b/recipes/oatpp/all/conandata.yml index d78e0b1d715f8..afae435ea8dae 100644 --- a/recipes/oatpp/all/conandata.yml +++ b/recipes/oatpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.0.latest": + url: "https://github.com/oatpp/oatpp/archive/1.3.0-latest.tar.gz" + sha256: "adc3b88076532838cd0fb8155872d6a9467ac0cb5df319735a2396ce6945d064" "1.3.0": url: "https://github.com/oatpp/oatpp/archive/1.3.0.tar.gz" sha256: "e1f80fa8fd7a74da6737e7fee1a4db68b4d7085a3f40e7d550752d6ff5714583" diff --git a/recipes/oatpp/all/conanfile.py b/recipes/oatpp/all/conanfile.py index cae12177c9d72..ac27a054d2bc3 100644 --- a/recipes/oatpp/all/conanfile.py +++ b/recipes/oatpp/all/conanfile.py @@ -5,6 +5,7 @@ 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 +from conan.tools.env import VirtualBuildEnv import os required_conan_version = ">=1.54.0" @@ -23,12 +24,21 @@ class OatppConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_test_library": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_test_library": False, } + @property + def _version(self): + version = str(self.version) + if version.endswith(".latest"): + version = version[:-len(".latest")] + return version + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -49,6 +59,10 @@ def validate(self): if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration("oatpp requires GCC >=5") + def build_requirements(self): + if Version(self._version) >= "1.3.0": + self.tool_requires("cmake/[>=3.20 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -58,7 +72,10 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True if is_msvc(self) and Version(self.version) >= "1.3.0": tc.variables["OATPP_MSVC_LINK_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.variables["OATPP_LINK_TEST_LIBRARY"] = self.options.with_test_library tc.generate() + venv = VirtualBuildEnv(self) + venv.generate(scope="build") def build(self): cmake = CMake(self) @@ -74,8 +91,8 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "oatpp") - include_dir = os.path.join("include", f"oatpp-{self.version}", "oatpp") - lib_dir = os.path.join("lib", f"oatpp-{self.version}") + include_dir = os.path.join("include", f"oatpp-{self._version}", "oatpp") + lib_dir = os.path.join("lib", f"oatpp-{self._version}") # oatpp self.cpp_info.components["_oatpp"].names["cmake_find_package"] = "oatpp" @@ -85,18 +102,19 @@ def package_info(self): self.cpp_info.components["_oatpp"].libdirs = [lib_dir] self.cpp_info.components["_oatpp"].libs = ["oatpp"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["_oatpp"].system_libs = ["pthread"] + self.cpp_info.components["_oatpp"].system_libs = ["pthread", "m"] elif self.settings.os == "Windows": self.cpp_info.components["_oatpp"].system_libs = ["ws2_32", "wsock32"] # oatpp-test - self.cpp_info.components["oatpp-test"].names["cmake_find_package"] = "oatpp-test" - self.cpp_info.components["oatpp-test"].names["cmake_find_package_multi"] = "oatpp-test" - self.cpp_info.components["oatpp-test"].set_property("cmake_target_name", "oatpp-test::oatpp-test") - self.cpp_info.components["oatpp-test"].includedirs = [include_dir] - self.cpp_info.components["oatpp-test"].libdirs = [lib_dir] - self.cpp_info.components["oatpp-test"].libs = ["oatpp-test"] - self.cpp_info.components["oatpp-test"].requires = ["_oatpp"] + if self.options.with_test_library: + self.cpp_info.components["oatpp-test"].names["cmake_find_package"] = "oatpp-test" + self.cpp_info.components["oatpp-test"].names["cmake_find_package_multi"] = "oatpp-test" + self.cpp_info.components["oatpp-test"].set_property("cmake_target_name", "oatpp-test::oatpp-test") + self.cpp_info.components["oatpp-test"].includedirs = [include_dir] + self.cpp_info.components["oatpp-test"].libdirs = [lib_dir] + self.cpp_info.components["oatpp-test"].libs = ["oatpp-test"] + self.cpp_info.components["oatpp-test"].requires = ["_oatpp"] # workaround to have all components in the global target self.cpp_info.set_property("cmake_target_name", "oatpp::oatpp-test") diff --git a/recipes/oatpp/all/test_package/CMakeLists.txt b/recipes/oatpp/all/test_package/CMakeLists.txt index cffae2f965d2e..121b3b9f25c6a 100644 --- a/recipes/oatpp/all/test_package/CMakeLists.txt +++ b/recipes/oatpp/all/test_package/CMakeLists.txt @@ -1,14 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(oatpp REQUIRED CONFIG) -if ("${oatpp_VERSION}" VERSION_GREATER_EQUAL "1.3.0") - add_executable(${PROJECT_NAME} test_package.cpp DeserializerTest_1_3_0.cpp) -elseif("${oatpp_VERSION}" VERSION_GREATER_EQUAL "1.1.0") - add_executable(${PROJECT_NAME} test_package.cpp DeserializerTest_1_1_0.cpp) -else() - add_executable(${PROJECT_NAME} test_package.cpp DeserializerTest_1_0_0.cpp) -endif() -target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp oatpp::oatpp-test) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE oatpp::oatpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/oatpp/all/test_package/DeserializerTest.hpp b/recipes/oatpp/all/test_package/DeserializerTest.hpp deleted file mode 100644 index 6c1c0ec06209e..0000000000000 --- a/recipes/oatpp/all/test_package/DeserializerTest.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef oatpp_test_parser_json_mapping_DeserializerTest_hpp -#define oatpp_test_parser_json_mapping_DeserializerTest_hpp - -#include "oatpp-test/UnitTest.hpp" - -namespace oatpp { namespace test { namespace parser { namespace json { namespace mapping { - -class DeserializerTest : public UnitTest{ -public: - - DeserializerTest():UnitTest("TEST[parser::json::mapping::DeserializerTest]"){} - void onRun() override; - -}; - -}}}}} - -#endif /* oatpp_test_parser_json_mapping_DeserializerTest_hpp */ diff --git a/recipes/oatpp/all/test_package/DeserializerTest_1_0_0.cpp b/recipes/oatpp/all/test_package/DeserializerTest_1_0_0.cpp deleted file mode 100644 index e4cd44ea34920..0000000000000 --- a/recipes/oatpp/all/test_package/DeserializerTest_1_0_0.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "DeserializerTest.hpp" - -#include "oatpp/parser/json/mapping/ObjectMapper.hpp" -#include "oatpp/core/macro/codegen.hpp" - -namespace oatpp { namespace test { namespace parser { namespace json { namespace mapping { - -namespace { - -#include OATPP_CODEGEN_BEGIN(DTO) - -typedef oatpp::data::mapping::type::Object DTO; - -class EmptyDto : public DTO { - - DTO_INIT(EmptyDto, DTO) - -}; - -class SampleDto : public DTO { - - DTO_INIT(SampleDto, DTO); - - DTO_FIELD(String, strF); - DTO_FIELD(Int32, int32F); - DTO_FIELD(Float32, float32F); - DTO_FIELD(EmptyDto::ObjectWrapper, object); - DTO_FIELD(List::ObjectWrapper, list); - -}; - -#include OATPP_CODEGEN_END(DTO) - -} - -void DeserializerTest::onRun(){ - - auto mapper = oatpp::parser::json::mapping::ObjectMapper::createShared(); - - auto obj = mapper->readFromString("{ \"strF\": \"value1\", \"int32F\": 30, \"float32F\": 32.4, \"object\": {}\"list\": [] }"); - - OATPP_ASSERT(obj); - OATPP_ASSERT(obj->strF->equals("value1")); - OATPP_ASSERT(obj->int32F->getValue() == 30); - OATPP_ASSERT(obj->float32F); - OATPP_ASSERT(obj->object); - OATPP_ASSERT(obj->list->count() == 0); - -} - -}}}}} diff --git a/recipes/oatpp/all/test_package/DeserializerTest_1_1_0.cpp b/recipes/oatpp/all/test_package/DeserializerTest_1_1_0.cpp deleted file mode 100644 index 93aedbe56f4c3..0000000000000 --- a/recipes/oatpp/all/test_package/DeserializerTest_1_1_0.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "DeserializerTest.hpp" - -#include "oatpp/parser/json/mapping/ObjectMapper.hpp" -#include "oatpp/core/macro/codegen.hpp" - -namespace oatpp { namespace test { namespace parser { namespace json { namespace mapping { - -namespace { - -#include OATPP_CODEGEN_BEGIN(DTO) - -class EmptyDto : public oatpp::DTO { - - DTO_INIT(EmptyDto, DTO) - -}; - -class SampleDto : public DTO { - - DTO_INIT(SampleDto, DTO); - - DTO_FIELD(String, strF); - DTO_FIELD(Int32, int32F); - DTO_FIELD(Float32, float32F); - DTO_FIELD(Object, object); - DTO_FIELD(List>, list); - -}; - -#include OATPP_CODEGEN_END(DTO) - -} - -void DeserializerTest::onRun(){ - - auto mapper = oatpp::parser::json::mapping::ObjectMapper::createShared(); - - auto obj = mapper->readFromString>("{ \"strF\": \"value1\", \"int32F\": 30, \"float32F\": 32.4, \"object\": {}\"list\": [] }"); - - OATPP_ASSERT(obj); - OATPP_ASSERT(obj->strF->equals("value1")); - OATPP_ASSERT(obj->int32F == 30); - OATPP_ASSERT(obj->float32F); - OATPP_ASSERT(obj->object); - OATPP_ASSERT(obj->list->size() == 0); - -} - -}}}}} diff --git a/recipes/oatpp/all/test_package/DeserializerTest_1_3_0.cpp b/recipes/oatpp/all/test_package/DeserializerTest_1_3_0.cpp deleted file mode 100644 index 331bb2d27749f..0000000000000 --- a/recipes/oatpp/all/test_package/DeserializerTest_1_3_0.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "DeserializerTest.hpp" - -#include "oatpp/parser/json/mapping/ObjectMapper.hpp" -#include "oatpp/core/macro/codegen.hpp" - -namespace oatpp { namespace test { namespace parser { namespace json { namespace mapping { - -namespace { - -#include OATPP_CODEGEN_BEGIN(DTO) - -class EmptyDto : public oatpp::DTO { - - DTO_INIT(EmptyDto, DTO) - -}; - -class SampleDto : public DTO { - - DTO_INIT(SampleDto, DTO); - - DTO_FIELD(String, strF); - DTO_FIELD(Int32, int32F); - DTO_FIELD(Float32, float32F); - DTO_FIELD(Object, object); - DTO_FIELD(List>, list); - -}; - -#include OATPP_CODEGEN_END(DTO) - -} - -void DeserializerTest::onRun(){ - - auto mapper = oatpp::parser::json::mapping::ObjectMapper::createShared(); - - auto obj = mapper->readFromString>("{ \"strF\": \"value1\", \"int32F\": 30, \"float32F\": 32.4, \"object\": {}\"list\": [] }"); - - OATPP_ASSERT(obj); - OATPP_ASSERT(*(obj->strF) == "value1"); - OATPP_ASSERT(obj->int32F == 30); - OATPP_ASSERT(obj->float32F); - OATPP_ASSERT(obj->object); - OATPP_ASSERT(obj->list->size() == 0); - -} - -}}}}} diff --git a/recipes/oatpp/all/test_package/test_package.cpp b/recipes/oatpp/all/test_package/test_package.cpp index b0d824cdfda32..c3c071f43b8a4 100644 --- a/recipes/oatpp/all/test_package/test_package.cpp +++ b/recipes/oatpp/all/test_package/test_package.cpp @@ -1,31 +1,20 @@ -#include "DeserializerTest.hpp" +#include #include "oatpp/core/concurrency/SpinLock.hpp" #include "oatpp/core/base/Environment.hpp" -#include -#include - - -void runTests() { - OATPP_RUN_TEST(oatpp::test::parser::json::mapping::DeserializerTest); -} - int main() { oatpp::base::Environment::init(); - - runTests(); - + /* Print how much objects were created during app running, and what have left-probably leaked */ /* Disable object counting for release builds using '-D OATPP_DISABLE_ENV_OBJECT_COUNTERS' flag for better performance */ std::cout << "\nEnvironment:\n"; std::cout << "objectsCount = " << oatpp::base::Environment::getObjectsCount() << "\n"; std::cout << "objectsCreated = " << oatpp::base::Environment::getObjectsCreated() << "\n\n"; - + OATPP_ASSERT(oatpp::base::Environment::getObjectsCount() == 0); - - oatpp::base::Environment::destroy(); + oatpp::base::Environment::destroy(); return 0; } diff --git a/recipes/oatpp/all/test_v1_package/CMakeLists.txt b/recipes/oatpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/oatpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/oatpp/all/test_v1_package/conanfile.py b/recipes/oatpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/oatpp/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_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/oatpp/config.yml b/recipes/oatpp/config.yml index 4fdf83fae05c2..64022fc52f7b5 100644 --- a/recipes/oatpp/config.yml +++ b/recipes/oatpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.0.latest": + folder: all "1.3.0": folder: all "1.2.5": diff --git a/recipes/objectbox-generator/all/test_v1_package/conanfile.py b/recipes/objectbox-generator/all/test_v1_package/conanfile.py deleted file mode 100644 index c605339e388af..0000000000000 --- a/recipes/objectbox-generator/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index b4ebf9918d7ba..0000000000000 --- a/recipes/objectbox/all/conandata.yml +++ /dev/null @@ -1,39 +0,0 @@ -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" - "0.18.0": - url: "https://github.com/objectbox/objectbox-c/archive/v0.18.0.tar.gz" - sha256: "e86e921d59c6c36a4a0c0ddc5a2b641789bfa012e0824506c285feb4e9285ae7" - "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" - patch_type: "conan" - "0.18.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.17.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" diff --git a/recipes/objectbox/all/conanfile.py b/recipes/objectbox/all/conanfile.py deleted file mode 100644 index ffcc6e09fb17f..0000000000000 --- a/recipes/objectbox/all/conanfile.py +++ /dev/null @@ -1,64 +0,0 @@ -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 -import os - -required_conan_version = ">=1.53.0" - -class ObjectboxCConan(ConanFile): - name = "objectbox" - description = "ObjectBox C and C++: super-fast database for objects and structs" - license = "Apache-2.0" - url = "https://github.com/conan-io/conan-center-index" - 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) - - 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) - - 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) - tc.variables["OBJECTBOX_WITH_SYNC"] = self.options.with_sync - tc.generate() - - def build(self): - apply_conandata_patches(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() - - def package_info(self): - self.cpp_info.libs = ["objectbox"] - - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.extend(["m", "pthread"]) - if Version(self.version) >= "0.18.0": - self.cpp_info.system_libs.append("dl") diff --git a/recipes/objectbox/all/patches/0001-fix-cmake.patch b/recipes/objectbox/all/patches/0001-fix-cmake.patch deleted file mode 100644 index d22926b57e6c9..0000000000000 --- a/recipes/objectbox/all/patches/0001-fix-cmake.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e32c84b..c2c535f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -9,10 +9,17 @@ if (${CMAKE_VERSION} VERSION_LESS "3.11.0") - endif () - link_directories("${CMAKE_CURRENT_SOURCE_DIR}/lib") - else () -+ include(GNUInstallDirs) -+ - function(defineObjectBoxLibForURL VARIANT DL_URL) - include(FetchContent) - project(objectbox${VARIANT}-download) -- FetchContent_Declare(${PROJECT_NAME} URL ${DL_URL}) -+ FetchContent_Declare(${PROJECT_NAME} -+ URL ${DL_URL} -+ # workaround for max path length in Windows (260byte) -+ SUBBUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sub -+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tmp -+ ) - - FetchContent_Populate(${PROJECT_NAME}) - set(DL_DIR "${${PROJECT_NAME}_SOURCE_DIR}") -@@ -27,6 +34,25 @@ else () - IMPORTED_IMPLIB ${DL_DIR}/lib/${CMAKE_IMPORT_LIBRARY_PREFIX}objectbox${CMAKE_IMPORT_LIBRARY_SUFFIX} - INTERFACE_INCLUDE_DIRECTORIES "${objectbox_include_dirs}" - ) -+ -+ if(EXISTS "${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_SHARED_LIBRARY_SUFFIX}") -+ install( -+ FILES ${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_SHARED_LIBRARY_SUFFIX} -+ DESTINATION $,${CMAKE_INSTALL_BINDIR},${CMAKE_INSTALL_LIBDIR}> -+ ) -+ endif() -+ if(EXISTS "${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_IMPORT_LIBRARY_SUFFIX}") -+ install( -+ FILES ${DL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_IMPORT_LIBRARY_SUFFIX} -+ DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ) -+ endif() -+ -+ install( -+ DIRECTORY ${DL_DIR}/include/ -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -+ ) -+ - endfunction() - - function(defineObjectBoxLib VARIANT) -@@ -72,10 +98,15 @@ else () - defineObjectBoxLibForURL("" "${DL_URL}") - else () - defineObjectBoxLib("") -- defineObjectBoxLib("-sync") -+ if(OBJECTBOX_WITH_SYNC) -+ defineObjectBoxLib("-sync") -+ endif() - endif () - endif () - -+if(0) - add_subdirectory(src-test) - add_subdirectory(src-test-gen) - add_subdirectory(examples) -+endif() -+ diff --git a/recipes/objectbox/all/test_package/CMakeLists.txt b/recipes/objectbox/all/test_package/CMakeLists.txt deleted file mode 100644 index daba6910bb48a..0000000000000 --- a/recipes/objectbox/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -find_package(objectbox REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE objectbox::objectbox) diff --git a/recipes/objectbox/all/test_package/test_package.c b/recipes/objectbox/all/test_package/test_package.c deleted file mode 100644 index f03f0d6b965c7..0000000000000 --- a/recipes/objectbox/all/test_package/test_package.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -#include "objectbox.h" - -int main() { - printf("ObjectBox version %s\n", obx_version_string()); - - return 0; -} - diff --git a/recipes/objectbox/all/test_v1_package/CMakeLists.txt b/recipes/objectbox/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/objectbox/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/objectbox/all/test_v1_package/conanfile.py b/recipes/objectbox/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/objectbox/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/objectbox/config.yml b/recipes/objectbox/config.yml deleted file mode 100644 index 2fdec99a504b8..0000000000000 --- a/recipes/objectbox/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -versions: - "0.20.0": - folder: all - "0.19.0": - folder: all - "0.18.1": - folder: all - "0.18.0": - folder: all - "0.17.0": - folder: all diff --git a/recipes/oboe/all/conandata.yml b/recipes/oboe/all/conandata.yml index 93bb5ba9ec089..c83ffd5703892 100644 --- a/recipes/oboe/all/conandata.yml +++ b/recipes/oboe/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "1.8.0": + url: "https://github.com/google/oboe/archive/refs/tags/1.8.0.tar.gz" + sha256: "1ab24ff129af6396b8a5741c12b44b922814337d1b40958ac7ada8e270eb4880" "1.7.0": url: "https://github.com/google/oboe/archive/refs/tags/1.7.0.tar.gz" sha256: "b01896f9180f725a38806cfef73a29b36b2ea37f91389ed4e69d664ce83b79b6" patches: + "1.8.0": + - patch_file: "patches/1.8.0-0001-fix-cmake.patch" + patch_description: "Fix CMakeLists" + patch_type: "conan" "1.7.0": - patch_file: "patches/1.7.0-0001-fix-cmake.patch" patch_description: "Fix CMakeLists" diff --git a/recipes/oboe/all/conanfile.py b/recipes/oboe/all/conanfile.py index ee8b970e7d9a3..a662f73c76364 100644 --- a/recipes/oboe/all/conanfile.py +++ b/recipes/oboe/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -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 import os @@ -26,6 +26,10 @@ class OboeConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 17 + def export_sources(self): export_conandata_patches(self) @@ -40,13 +44,16 @@ 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) + 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) + if not valid_min_cppstd(self, self._min_cppstd): + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def build(self): diff --git a/recipes/oboe/all/patches/1.7.0-0001-fix-cmake.patch b/recipes/oboe/all/patches/1.7.0-0001-fix-cmake.patch index 452cd94a1c2bb..1059375d2b0c8 100644 --- a/recipes/oboe/all/patches/1.7.0-0001-fix-cmake.patch +++ b/recipes/oboe/all/patches/1.7.0-0001-fix-cmake.patch @@ -12,7 +12,7 @@ -Ofast - "$<$:-Werror>") +) -+target_compile_features(oboe PUBLIC cxx_std_17) ++ # Enable logging of D,V for debug builds target_compile_definitions(oboe PUBLIC $<$:OBOE_ENABLE_LOGGING=1>) diff --git a/recipes/oboe/all/patches/1.8.0-0001-fix-cmake.patch b/recipes/oboe/all/patches/1.8.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..46b4a6a56b9f9 --- /dev/null +++ b/recipes/oboe/all/patches/1.8.0-0001-fix-cmake.patch @@ -0,0 +1,30 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -81,14 +81,14 @@ + # Enable -Ofast + target_compile_options(oboe + PRIVATE +- -std=c++17 + -Wall + -Wextra-semi + -Wshadow + -Wshadow-field + "$<$:-Ofast>" + "$<$:-O3>" +- "$<$:-Werror>") ++) ++ + + # Enable logging of D,V for debug builds + target_compile_definitions(oboe PUBLIC $<$:OBOE_ENABLE_LOGGING=1>) +@@ -97,8 +97,8 @@ + + # When installing oboe put the libraries in the lib/ folder e.g. lib/arm64-v8a + install(TARGETS oboe +- LIBRARY DESTINATION lib/${ANDROID_ABI} +- ARCHIVE DESTINATION lib/${ANDROID_ABI}) ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + + # Also install the headers + install(DIRECTORY include/oboe DESTINATION include) diff --git a/recipes/oboe/all/test_package/CMakeLists.txt b/recipes/oboe/all/test_package/CMakeLists.txt index 9f44285ca4f5d..c189cd7872f76 100644 --- a/recipes/oboe/all/test_package/CMakeLists.txt +++ b/recipes/oboe/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(oboe REQUIRED CONFIG) diff --git a/recipes/oboe/all/test_v1_package/CMakeLists.txt b/recipes/oboe/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/oboe/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/oboe/all/test_v1_package/conanfile.py b/recipes/oboe/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/oboe/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_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/oboe/config.yml b/recipes/oboe/config.yml index 0f57b11de8fb0..651b6092ebbf2 100644 --- a/recipes/oboe/config.yml +++ b/recipes/oboe/config.yml @@ -1,3 +1,5 @@ versions: + "1.8.0": + folder: all "1.7.0": folder: all diff --git a/recipes/observer-ptr-lite/all/test_package/CMakeLists.txt b/recipes/observer-ptr-lite/all/test_package/CMakeLists.txt index 8872373830524..1e3742ac0f06c 100644 --- a/recipes/observer-ptr-lite/all/test_package/CMakeLists.txt +++ b/recipes/observer-ptr-lite/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(observer-ptr-lite REQUIRED CONFIG) diff --git a/recipes/observer-ptr-lite/all/test_v1_package/CMakeLists.txt b/recipes/observer-ptr-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/observer-ptr-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/observer-ptr-lite/all/test_v1_package/conanfile.py b/recipes/observer-ptr-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/observer-ptr-lite/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_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/ocilib/all/conandata.yml b/recipes/ocilib/all/conandata.yml new file mode 100644 index 0000000000000..2f5cc065e7d14 --- /dev/null +++ b/recipes/ocilib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.7.6": + url: "https://github.com/vrogier/ocilib/releases/download/v4.7.6/ocilib-4.7.6-gnu.tar.gz" + sha256: "35657c00b3cfbcff09a398a6566b95b23067b0d15c1155a17615da7780715a85" diff --git a/recipes/ocilib/all/conanfile.py b/recipes/ocilib/all/conanfile.py new file mode 100644 index 0000000000000..6af72058d349a --- /dev/null +++ b/recipes/ocilib/all/conanfile.py @@ -0,0 +1,81 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get, rm, rmdir, chdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.54.0" + +class OCILIBConan(ConanFile): + name = "ocilib" + description = "An open source and cross platform Oracle Driver that delivers efficient access to Oracle databases." + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/vrogier/ocilib" + topics = ("database", "db", "sql", "oracle") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_oracle_charset": ["ansi", "wide"], + "with_oracle_import": ["runtime", "linkage"], + } + default_options = { + "shared": False, + "fPIC": True, + "with_oracle_charset": "ansi", + "with_oracle_import": "runtime", + } + + @property + def _min_cppstd(self): + return 11 + + 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} recipe only supports Linux for now. Pull requests to add new configurtations are welcomed.") + # TODO: Check support for other platforms + + 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 = AutotoolsToolchain(self) + tc.configure_args.extend([ + f"--with-oracle-charset={self.options.with_oracle_charset}", + f"--with-oracle-import={self.options.with_oracle_import}", + ]) + tc.generate() + + def build(self): + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + autotools.install() + + 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")) + copy(self, "*", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + copy(self, "*.lib", self.source_folder, os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.a", self.source_folder, os.path.join(self.package_folder, "lib"), keep_path=False) + 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.libs = ["ocilib"] + self.cpp_info.set_property("pkg_config_name", "ocilib") + self.cpp_info.system_libs.append("dl") diff --git a/recipes/ocilib/all/test_package/CMakeLists.txt b/recipes/ocilib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0d33ea642b397 --- /dev/null +++ b/recipes/ocilib/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + + +find_package(ocilib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE ocilib::ocilib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/ocilib/all/test_package/conanfile.py b/recipes/ocilib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/ocilib/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/ocilib/all/test_package/test_package.cpp b/recipes/ocilib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e71599957563d --- /dev/null +++ b/recipes/ocilib/all/test_package/test_package.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include "ocilib.hpp" + +using namespace ocilib; + +int main(void) +{ + try + { + std::cout << "OCILIB Version: "; + std::cout << OCILIB_MAJOR_VERSION << "."; + std::cout << OCILIB_MINOR_VERSION << "."; + std::cout << OCILIB_REVISION_VERSION << std::endl; + + Environment::Initialize(); + } + catch (...) + { + } + + Environment::Cleanup(); + + return EXIT_SUCCESS; +} diff --git a/recipes/ocilib/config.yml b/recipes/ocilib/config.yml new file mode 100644 index 0000000000000..947442bf2969b --- /dev/null +++ b/recipes/ocilib/config.yml @@ -0,0 +1,3 @@ +versions: + "4.7.6": + folder: all diff --git a/recipes/octo-keygen-cpp/all/conanfile.py b/recipes/octo-keygen-cpp/all/conanfile.py index b9e37112cb2f5..50c1d18d84986 100644 --- a/recipes/octo-keygen-cpp/all/conanfile.py +++ b/recipes/octo-keygen-cpp/all/conanfile.py @@ -40,7 +40,7 @@ def layout(self): 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("fmt/10.2.1") self.requires("openssl/[>=1.1 <4]") def validate(self): diff --git a/recipes/octo-keygen-cpp/all/test_v1_package/CMakeLists.txt b/recipes/octo-keygen-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index bf7511416a6f8..0000000000000 --- a/recipes/octo-keygen-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(octo-keygen-cpp CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE octo-keygen-cpp::octo-keygen-cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/octo-keygen-cpp/all/test_v1_package/conanfile.py b/recipes/octo-keygen-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/octo-keygen-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/octo-logger-cpp/all/conandata.yml b/recipes/octo-logger-cpp/all/conandata.yml index 92395bec9bd21..5b5d4e7697075 100644 --- a/recipes/octo-logger-cpp/all/conandata.yml +++ b/recipes/octo-logger-cpp/all/conandata.yml @@ -1,4 +1,25 @@ sources: + "2.1.2": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v2.1.2.tar.gz" + sha256: "d653dc91d17f33f2e7659126ba408b40f8f421def8190ec2b6991713c6a2accf" + "2.0.2": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v2.0.2.tar.gz" + sha256: "6aa8ee80a7f7b84df55fa215f22cdf66cbeece8cc60b2097828795194a1e6a40" + "2.0.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v2.0.0.tar.gz" + sha256: "2edad6d1cba27019f1f26e562d9d8ff8395fc9ada1e8fb0c226c603ec5e0ed15" + "1.12.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.12.0.tar.gz" + sha256: "77f351ae4cad973ad7836dae7498419692590f2419b5b569c1f00fc6130d8bbb" + "1.11.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.11.0.tar.gz" + sha256: "73c35ca2a2e0c4be2cd85c5ba1f4061bbc22637fe79570107f1123eff30936db" + "1.9.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.9.0.tar.gz" + sha256: "95187b6e9ae5d405b53ecb12ff7cbde847a9824a340ca88922eecd712ce9a138" + "1.6.1": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.6.1.tar.gz" + sha256: "02c1d5303d8c129cb2527a92d49677229230a5feaec002791f96d47de3bccb5a" "1.5.0": url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.5.0.tar.gz" sha256: "e62e4a54700f7c235111fd2b75c51d96f0b4deaf2c24ce7bc9ef1751ce31ea20" diff --git a/recipes/octo-logger-cpp/all/conanfile.py b/recipes/octo-logger-cpp/all/conanfile.py index d8b77698e6f0d..27de74bad7ee2 100644 --- a/recipes/octo-logger-cpp/all/conanfile.py +++ b/recipes/octo-logger-cpp/all/conanfile.py @@ -52,10 +52,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("fmt/10.1.1", transitive_headers=True) + self.requires("fmt/10.2.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") + self.requires("nlohmann_json/3.11.3") + if Version(self.version) >= "2.0.0": + self.requires("aws-sdk-cpp/1.11.352") + else: + self.requires("aws-sdk-cpp/1.9.234") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/octo-logger-cpp/config.yml b/recipes/octo-logger-cpp/config.yml index 76947dd2891c2..70f417f829406 100644 --- a/recipes/octo-logger-cpp/config.yml +++ b/recipes/octo-logger-cpp/config.yml @@ -1,4 +1,18 @@ versions: + "2.1.2": + folder: "all" + "2.0.2": + folder: "all" + "2.0.0": + folder: "all" + "1.12.0": + folder: "all" + "1.11.0": + folder: "all" + "1.9.0": + folder: "all" + "1.6.1": + folder: "all" "1.5.0": folder: "all" "1.4.0": diff --git a/recipes/octo-wildcardmatching-cpp/all/test_package/CMakeLists.txt b/recipes/octo-wildcardmatching-cpp/all/test_package/CMakeLists.txt index 10219d5afbaa2..56e6a3aea25e6 100644 --- a/recipes/octo-wildcardmatching-cpp/all/test_package/CMakeLists.txt +++ b/recipes/octo-wildcardmatching-cpp/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(octo-wildcardmatching-cpp REQUIRED CONFIG) diff --git a/recipes/octomap/all/conandata.yml b/recipes/octomap/all/conandata.yml index 4699a071746f8..24483c3d1fc42 100644 --- a/recipes/octomap/all/conandata.yml +++ b/recipes/octomap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.10.0": + url: "https://github.com/OctoMap/octomap/archive/v1.10.0.tar.gz" + sha256: "8da2576ec6a0993e8900db7f91083be8682d8397a7be0752c85d1b7dd1b8e992" "1.9.8": url: "https://github.com/OctoMap/octomap/archive/v1.9.8.tar.gz" sha256: "417af6da4e855e9a83b93458aa98b01a2c88f880088baad2b59d323ce162586e" @@ -15,6 +18,10 @@ sources: url: "https://github.com/OctoMap/octomap/archive/v1.9.3.tar.gz" sha256: "8488de97ed2c8f4757bfbaf3225e82a9e36783dce1f573b3bde1cf968aa89696" patches: + "1.10.0": + - patch_file: "patches/1.10.0-0001-separate-static-shared-build.patch" + patch_description: "CMake: build either shared or static" + patch_type: "conan" "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" diff --git a/recipes/octomap/all/conanfile.py b/recipes/octomap/all/conanfile.py index 52d010aca9b55..071f058739781 100644 --- a/recipes/octomap/all/conanfile.py +++ b/recipes/octomap/all/conanfile.py @@ -1,14 +1,13 @@ 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, replace_in_file, rmdir, save +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd import os -import textwrap - -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class OctomapConan(ConanFile): name = "octomap" @@ -31,6 +30,10 @@ class OctomapConan(ConanFile): "openmp": False, } + @property + def _min_cppstd(self): + return 11 + def export_sources(self): export_conandata_patches(self) @@ -49,6 +52,9 @@ def validate(self): if self.options.shared and is_msvc(self) and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("shared octomap doesn't support MT runtime") + if Version(self.version) >= "1.10.0" and 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) @@ -58,6 +64,10 @@ def generate(self): tc.variables["BUILD_TESTING"] = False if is_msvc(self) and self.options.shared: tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if Version(self.version) >= "1.10.0": + tc.variables["CMAKE_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", "11").replace("gnu", "") + else: + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def _patch_sources(self): @@ -90,30 +100,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - # TODO: to remove in conan v2 once cmake_find_package_* generators are removed - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - { - self._octomath_target: f"octomap::{self._octomath_target}", - self._octomap_target: f"octomap::{self._octomap_target}", - } - ) - - 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") - @property def _octomath_target(self): return "octomath" if self.options.shared else "octomath-static" @@ -135,13 +121,3 @@ def package_info(self): self.cpp_info.components["octomaplib"].set_property("cmake_target_name", self._octomap_target) self.cpp_info.components["octomaplib"].libs = ["octomap"] self.cpp_info.components["octomaplib"].requires = ["octomath"] - - # TODO: to remove in conan v2 once cmake_find_package_* generators are removed - self.cpp_info.components["octomath"].names["cmake_find_package"] = self._octomath_target - self.cpp_info.components["octomath"].names["cmake_find_package_multi"] = self._octomath_target - self.cpp_info.components["octomath"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["octomath"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - self.cpp_info.components["octomaplib"].names["cmake_find_package"] = self._octomap_target - self.cpp_info.components["octomaplib"].names["cmake_find_package_multi"] = self._octomap_target - self.cpp_info.components["octomaplib"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["octomaplib"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/octomap/all/patches/1.10.0-0001-separate-static-shared-build.patch b/recipes/octomap/all/patches/1.10.0-0001-separate-static-shared-build.patch new file mode 100644 index 0000000000000..bf38e33037d86 --- /dev/null +++ b/recipes/octomap/all/patches/1.10.0-0001-separate-static-shared-build.patch @@ -0,0 +1,120 @@ +diff --git a/octomap/src/CMakeLists.txt b/octomap/src/CMakeLists.txt +index 45b384f..e870608 100644 +--- a/octomap/src/CMakeLists.txt ++++ b/octomap/src/CMakeLists.txt +@@ -11,24 +11,32 @@ SET (octomap_SRCS + ) + + # dynamic and static libs, see CMake FAQ: ++if(BUILD_SHARED_LIBS) + ADD_LIBRARY( octomap SHARED ${octomap_SRCS}) + set_target_properties( octomap PROPERTIES + VERSION ${OCTOMAP_VERSION} + SOVERSION ${OCTOMAP_SOVERSION} + ) ++TARGET_LINK_LIBRARIES(octomap octomath) ++else() + ADD_LIBRARY( octomap-static STATIC ${octomap_SRCS}) + SET_TARGET_PROPERTIES(octomap-static PROPERTIES OUTPUT_NAME "octomap") + add_dependencies(octomap-static octomath-static) +- +-TARGET_LINK_LIBRARIES(octomap octomath) ++TARGET_LINK_LIBRARIES(octomap-static octomath-static) ++endif() + + if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + endif() + +-export(TARGETS octomap octomap-static ++if(BUILD_SHARED_LIBS) ++export(TARGETS octomap + APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") +- ++else() ++export(TARGETS octomap-static ++ APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") ++endif() ++if(0) + ADD_SUBDIRECTORY( testing ) + + ADD_EXECUTABLE(graph2tree graph2tree.cpp) +@@ -66,14 +74,22 @@ TARGET_LINK_LIBRARIES(intersection_example octomap) + + ADD_EXECUTABLE(octree2pointcloud octree2pointcloud.cpp) + TARGET_LINK_LIBRARIES(octree2pointcloud octomap) +- +-install(TARGETS octomap octomap-static ++endif() ++if(BUILD_SHARED_LIBS) ++install(TARGETS octomap + EXPORT octomap-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ${INSTALL_TARGETS_DEFAULT_ARGS} + ) ++else() ++install(TARGETS octomap-static ++ EXPORT octomap-targets ++ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++ ${INSTALL_TARGETS_DEFAULT_ARGS} ++) ++endif() + install(EXPORT octomap-targets DESTINATION "${CMAKE_INSTALL_DATADIR}/octomap") +- ++if(0) + install(TARGETS + graph2tree + log2graph +@@ -85,4 +101,4 @@ install(TARGETS + compare_octrees + ${INSTALL_TARGETS_DEFAULT_ARGS} + ) +- ++endif() +diff --git a/octomap/src/math/CMakeLists.txt b/octomap/src/math/CMakeLists.txt +index 3b47ec4..596f7d8 100644 +--- a/octomap/src/math/CMakeLists.txt ++++ b/octomap/src/math/CMakeLists.txt +@@ -4,26 +4,37 @@ SET (octomath_SRCS + Pose6D.cpp + ) + +- ++if(BUILD_SHARED_LIBS) + ADD_LIBRARY( octomath SHARED ${octomath_SRCS}) + + SET_TARGET_PROPERTIES( octomath PROPERTIES + VERSION ${OCTOMAP_VERSION} + SOVERSION ${OCTOMAP_SOVERSION} + ) +- ++else() + ADD_LIBRARY( octomath-static STATIC ${octomath_SRCS}) + SET_TARGET_PROPERTIES(octomath-static PROPERTIES OUTPUT_NAME "octomath") +- ++endif() + if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + endif() + +-export(TARGETS octomath octomath-static ++if(BUILD_SHARED_LIBS) ++export(TARGETS octomath + APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") + +-install(TARGETS octomath octomath-static ++install(TARGETS octomath + EXPORT octomap-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ${INSTALL_TARGETS_DEFAULT_ARGS} + ) ++else() ++export(TARGETS octomath-static ++ APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") ++ ++install(TARGETS octomath-static ++ EXPORT octomap-targets ++ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++ ${INSTALL_TARGETS_DEFAULT_ARGS} ++) ++endif() diff --git a/recipes/octomap/all/test_package/CMakeLists.txt b/recipes/octomap/all/test_package/CMakeLists.txt index bb595de7484c4..4236bbb7d28a8 100644 --- a/recipes/octomap/all/test_package/CMakeLists.txt +++ b/recipes/octomap/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(octomap REQUIRED CONFIG) @@ -9,3 +9,7 @@ if(TARGET octomap-static) else() target_link_libraries(${PROJECT_NAME} PRIVATE octomap octomath) endif() + +if(octomap_VERSION VERSION_GREATER_EQUAL "1.10.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/octomap/all/test_v1_package/CMakeLists.txt b/recipes/octomap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/octomap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/octomap/all/test_v1_package/conanfile.py b/recipes/octomap/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/octomap/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_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/octomap/config.yml b/recipes/octomap/config.yml index 7b6ae3353a6fd..83dd314d86186 100644 --- a/recipes/octomap/config.yml +++ b/recipes/octomap/config.yml @@ -1,4 +1,6 @@ versions: + "1.10.0": + folder: all "1.9.8": folder: all "1.9.7": diff --git a/recipes/odbc/all/test_package/CMakeLists.txt b/recipes/odbc/all/test_package/CMakeLists.txt index 7079befc5a173..c742ff1ef48f1 100644 --- a/recipes/odbc/all/test_package/CMakeLists.txt +++ b/recipes/odbc/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(ODBC REQUIRED) diff --git a/recipes/odbc/all/test_v1_package/CMakeLists.txt b/recipes/odbc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/odbc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/odbc/all/test_v1_package/conanfile.py b/recipes/odbc/all/test_v1_package/conanfile.py deleted file mode 100644 index dfa9a73cae43c..0000000000000 --- a/recipes/odbc/all/test_v1_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" - - 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("odbcinst --version", run_environment=True) 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..6777c88f1f102 100644 --- a/recipes/ode/all/conanfile.py +++ b/recipes/ode/all/conanfile.py @@ -1,11 +1,12 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException from conan.tools.build import 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, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class OdeConan(ConanFile): @@ -79,9 +80,13 @@ def generate(self): tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" # Avoid a warning tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0075"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.16.4": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) + deps.set_property("libccd", "cmake_target_name", "ccd::ccd") deps.generate() def build(self): @@ -118,9 +123,3 @@ def package_info(self): libcxx = stdcpp_library(self) if libcxx: self.cpp_info.system_libs.append(libcxx) - - # TODO: to remove in conan v2 once legacy generators removed - self.cpp_info.filenames["cmake_find_package"] = "ode" - self.cpp_info.filenames["cmake_find_package_multi"] = "ode" - self.cpp_info.names["cmake_find_package"] = "ODE" - self.cpp_info.names["cmake_find_package_multi"] = "ODE" 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/all/test_package/CMakeLists.txt b/recipes/ode/all/test_package/CMakeLists.txt index 98cf5d519a1d1..feb31632d8057 100644 --- a/recipes/ode/all/test_package/CMakeLists.txt +++ b/recipes/ode/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(ode REQUIRED CONFIG) diff --git a/recipes/ode/all/test_v1_package/CMakeLists.txt b/recipes/ode/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/ode/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ode/all/test_v1_package/conanfile.py b/recipes/ode/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ode/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_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/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/ofeli/all/conandata.yml b/recipes/ofeli/4.x/conandata.yml similarity index 100% rename from recipes/ofeli/all/conandata.yml rename to recipes/ofeli/4.x/conandata.yml diff --git a/recipes/ofeli/4.x/conanfile.py b/recipes/ofeli/4.x/conanfile.py new file mode 100644 index 0000000000000..1bdb7a7fb9c25 --- /dev/null +++ b/recipes/ofeli/4.x/conanfile.py @@ -0,0 +1,82 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +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 OfeliConan(ConanFile): + name = "ofeli" + description = "An Object Finite Element Library" + license = "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://ofeli.org/index.html" + topics = ("finite-element", "finite-element-library", "finite-element-analysis", "finite-element-solver") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def layout(self): + basic_layout(self, src_folder="src") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("Ofeli only supports Linux") + if self.settings.compiler != "gcc": + raise ConanInvalidConfiguration("Ofeli only supports GCC") + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if self.settings.compiler.libcxx != "libstdc++11": + raise ConanInvalidConfiguration("Ofeli only supports libstdc++'s new ABI") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + config = 'release' if self.settings.build_type == 'Release' else 'debug' + tc.configure_args.append(f"--enable-{config}") + tc.generate() + + def build(self): + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "*libofeli.a", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(self.source_folder, "src")) + copy(self, "*.md", + dst=os.path.join(self.package_folder, "res"), + src=os.path.join(self.source_folder, "material")) + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=os.path.join(self.source_folder, "doc")) + + def package_info(self): + self.cpp_info.libs = ["ofeli"] + res_path = os.path.join(self.package_folder, "res") + self.runenv_info.define("OFELI_PATH_MATERIAL", res_path) + + # TODO: Legacy, to be removed on Conan 2.0 + self.env_info.OFELI_PATH_MATERIAL.append(res_path) diff --git a/recipes/ofeli/4.x/test_package/CMakeLists.txt b/recipes/ofeli/4.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1e5e727abc890 --- /dev/null +++ b/recipes/ofeli/4.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ofeli REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ofeli::ofeli) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/ofeli/4.x/test_package/conanfile.py b/recipes/ofeli/4.x/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/ofeli/4.x/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/ofeli/4.x/test_package/test_package.cpp b/recipes/ofeli/4.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..618f3ee674c68 --- /dev/null +++ b/recipes/ofeli/4.x/test_package/test_package.cpp @@ -0,0 +1,76 @@ +/*============================================================================== + + O F E L I + + Object Finite Element Library + + ============================================================================== + + Copyright (C) 1998 - 2015 Rachid Touzani + + This file is part of OFELI. + + OFELI 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 3 of the License, or + (at your option) any later version. + + OFELI 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 OFELI. If not, see . + + ============================================================================== + + An example of a Finite Element Code using OFELI + + Solution of a 1-D Elliptic problem using P1 Finite elements + + ==============================================================================*/ + +#include "OFELI.h" +using namespace OFELI; + +int main(int argc, char *argv[]) +{ + double L=1; + int N=10; + +/// Read and output mesh data + banner(); + if (argc>1) + N = atoi(argv[1]); + Mesh ms(L,N); + int NbN = N+1; + +// Declare problem data (matrix, rhs, boundary conditions, body forces) + TrMatrix A(NbN); + Vect b(ms); + b.set("16*pi*pi*sin(4*pi*x)"); + +// Build matrix and R.H.S. + double h = L/double(N); + b *= h; + for (int i=2; i sol(ms); + sol.set("sin(4*pi*x)"); + cout << "Error = " << (b-sol).getNormMax() << endl; + return 0; +} diff --git a/recipes/ofeli/5.x/conandata.yml b/recipes/ofeli/5.x/conandata.yml new file mode 100644 index 0000000000000..113211f34c5ac --- /dev/null +++ b/recipes/ofeli/5.x/conandata.yml @@ -0,0 +1,4 @@ +sources: + "5.1.0": + url: "https://github.com/rtouzani/ofeli/archive/0e66d0e5a38b209ee79eab0daf7686562b753536.tar.gz" + sha256: "a2e4e62d912d05e55001a9be7c5c4741a7b8773a399acbbe558bdca0d60d430b" diff --git a/recipes/ofeli/5.x/conanfile.py b/recipes/ofeli/5.x/conanfile.py new file mode 100644 index 0000000000000..ee690068f3c61 --- /dev/null +++ b/recipes/ofeli/5.x/conanfile.py @@ -0,0 +1,88 @@ +import os + +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.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir, replace_in_file, rename +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" + + +class OfeliConan(ConanFile): + name = "ofeli" + description = "An Object Finite Element Library" + license = "LGPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://ofeli.org/index.html" + topics = ("finite-element", "finite-element-library", "finite-element-analysis", "finite-element-solver") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + 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, 11) + if self.settings.compiler in ["clang", "apple-clang"] or is_msvc(self): + # Clang fails with + # include/linear_algebra/LocalVect_impl.h:251:42: error: cannot initialize return object of type 'OFELI::Element *' with an lvalue of type 'const OFELI::Element *' + # MSVC fails with a lot of errors + # https://c3i.jfrog.io/c3i/misc/summary.html?json=https://c3i.jfrog.io/c3i/misc/logs/pr/18952/12-windows-visual_studio/ofeli/5.1.0/summary.json + raise ConanInvalidConfiguration(f"{self.settings.compiler} is not supported due to compilation errors") + + 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): + env = VirtualBuildEnv(self) + env.generate() + tc = CMakeToolchain(self) + tc.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "add_subdirectory (demos)", "") + replace_in_file(self, cmakelists, "add_subdirectory (util)", "") + # Fix incorrect use of add_definitions() for build flags + replace_in_file(self, cmakelists, "add_definitions", "add_compile_options") + # Fix -fPIC support + replace_in_file(self, cmakelists, " -fPIE", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rename(self, os.path.join(self.package_folder, "share", "ofeli", "material"), + os.path.join(self.package_folder, "res")) + rmdir(self, os.path.join(self.package_folder, "share")) + + + def package_info(self): + self.cpp_info.libs = ["ofeli"] + self.cpp_info.includedirs = [os.path.join("include", "ofeli")] + res_path = os.path.join(self.package_folder, "res") + self.runenv_info.define_path("OFELI_PATH_MATERIAL", res_path) diff --git a/recipes/ofeli/5.x/test_package/CMakeLists.txt b/recipes/ofeli/5.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1e5e727abc890 --- /dev/null +++ b/recipes/ofeli/5.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(ofeli REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ofeli::ofeli) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/ofeli/5.x/test_package/conanfile.py b/recipes/ofeli/5.x/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/ofeli/5.x/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/ofeli/5.x/test_package/test_package.cpp b/recipes/ofeli/5.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..618f3ee674c68 --- /dev/null +++ b/recipes/ofeli/5.x/test_package/test_package.cpp @@ -0,0 +1,76 @@ +/*============================================================================== + + O F E L I + + Object Finite Element Library + + ============================================================================== + + Copyright (C) 1998 - 2015 Rachid Touzani + + This file is part of OFELI. + + OFELI 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 3 of the License, or + (at your option) any later version. + + OFELI 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 OFELI. If not, see . + + ============================================================================== + + An example of a Finite Element Code using OFELI + + Solution of a 1-D Elliptic problem using P1 Finite elements + + ==============================================================================*/ + +#include "OFELI.h" +using namespace OFELI; + +int main(int argc, char *argv[]) +{ + double L=1; + int N=10; + +/// Read and output mesh data + banner(); + if (argc>1) + N = atoi(argv[1]); + Mesh ms(L,N); + int NbN = N+1; + +// Declare problem data (matrix, rhs, boundary conditions, body forces) + TrMatrix A(NbN); + Vect b(ms); + b.set("16*pi*pi*sin(4*pi*x)"); + +// Build matrix and R.H.S. + double h = L/double(N); + b *= h; + for (int i=2; i sol(ms); + sol.set("sin(4*pi*x)"); + cout << "Error = " << (b-sol).getNormMax() << endl; + return 0; +} diff --git a/recipes/ofeli/all/CMakeLists.txt b/recipes/ofeli/all/CMakeLists.txt deleted file mode 100644 index c921d02a0d877..0000000000000 --- a/recipes/ofeli/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/ofeli/all/conanfile.py b/recipes/ofeli/all/conanfile.py deleted file mode 100644 index 0696eaa92f3e6..0000000000000 --- a/recipes/ofeli/all/conanfile.py +++ /dev/null @@ -1,73 +0,0 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -import os -from conans.errors import ConanInvalidConfiguration - -required_conan_version = ">=1.40.0" - - -class OfeliConan(ConanFile): - name = "ofeli" - description = "An Object Finite Element Library" - topics = ("finite-element", "finite-element-library", - "finite-element-analysis", "finite-element-solver") - license = "LGPL-3.0-or-later" - homepage = "http://ofeli.org/index.html" - url = "https://github.com/conan-io/conan-center-index" - settings = "os", "arch", "compiler", "build_type" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _doc_folder(self): - return os.path.join( - self._source_subfolder, - "doc" - ) - - def validate(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration( - "Ofeli is just supported for Linux") - if self.settings.compiler != "gcc": - raise ConanInvalidConfiguration( - "Ofeli is just supported for GCC") - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) - if self.settings.compiler.libcxx != "libstdc++11": - raise ConanInvalidConfiguration( - "Ofeli supports only libstdc++'s new ABI") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - self._autotools.configure(args=["--enable-%s" % ("release" - if self.settings.build_type == "Release" - else "debug")]) - return self._autotools - - def build(self): - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - autotools.make() - - def package(self): - self.copy("*.h", dst="include", - src=os.path.join(self._source_subfolder, "include")) - self.copy("*libofeli.a", dst="lib", - src=os.path.join(self._source_subfolder, "src")) - self.copy("*.md", dst="res", - src=os.path.join(self._source_subfolder, "material")) - self.copy("COPYING", dst="licenses", src=self._doc_folder) - - def package_info(self): - self.cpp_info.libs = ["ofeli"] - self.env_info.OFELI_PATH_MATERIAL.append( - os.path.join(self.package_folder, "res")) diff --git a/recipes/ofeli/all/test_package/CMakeLists.txt b/recipes/ofeli/all/test_package/CMakeLists.txt deleted file mode 100644 index 14b7550d3c44c..0000000000000 --- a/recipes/ofeli/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(ofeli CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ofeli::ofeli) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/ofeli/all/test_package/conanfile.py b/recipes/ofeli/all/test_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/ofeli/all/test_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/ofeli/all/test_package/test_package.cpp b/recipes/ofeli/all/test_package/test_package.cpp deleted file mode 100644 index 8d7d1aa2db165..0000000000000 --- a/recipes/ofeli/all/test_package/test_package.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/*============================================================================== - - O F E L I - - Object Finite Element Library - - ============================================================================== - - Copyright (C) 1998 - 2015 Rachid Touzani - - This file is part of OFELI. - - OFELI 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 3 of the License, or - (at your option) any later version. - - OFELI 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 OFELI. If not, see . - - ============================================================================== - - An example of a Finite Element Code using OFELI - - Solution of a 1-D Elliptic problem using P1 Finite elements - - ==============================================================================*/ - -#include "OFELI.h" -using namespace OFELI; - -int main(int argc, char *argv[]) -{ - double L=1; - int N=10; - -/// Read and output mesh data - banner(); - if (argc>1) - N = atoi(argv[1]); - Mesh ms(L,N); - int NbN = N+1; - -// Declare problem data (matrix, rhs, boundary conditions, body forces) - TrMatrix A(NbN); - Vect b(ms); - b.set("16*pi*pi*sin(4*pi*x)"); - -// Build matrix and R.H.S. - double h = L/double(N); - b *= h; - for (int i=2; i sol(ms); - sol.set("sin(4*pi*x)"); - cout << "Error = " << (b-sol).getNormMax() << endl; - return 0; -} diff --git a/recipes/ofeli/config.yml b/recipes/ofeli/config.yml index 33a6df35b4e32..ed520cd12092e 100644 --- a/recipes/ofeli/config.yml +++ b/recipes/ofeli/config.yml @@ -1,3 +1,5 @@ versions: + "5.1.0": + folder: 5.x "4.1.2": - folder: all + folder: 4.x diff --git a/recipes/ogdf/all/test_package/CMakeLists.txt b/recipes/ogdf/all/test_package/CMakeLists.txt index f9d34fb86421b..46c18164ae4cb 100644 --- a/recipes/ogdf/all/test_package/CMakeLists.txt +++ b/recipes/ogdf/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) set(CMAKE_CXX_STANDARD 11) diff --git a/recipes/ogdf/all/test_v1_package/CMakeLists.txt b/recipes/ogdf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 36b48f96d1078..0000000000000 --- a/recipes/ogdf/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/ogdf/all/test_v1_package/conanfile.py b/recipes/ogdf/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/ogdf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/ogg/all/conanfile.py b/recipes/ogg/all/conanfile.py index 9d7da300191e0..0d204db3addd3 100644 --- a/recipes/ogg/all/conanfile.py +++ b/recipes/ogg/all/conanfile.py @@ -1,9 +1,11 @@ from conan import ConanFile +from conan.errors import ConanException 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" +required_conan_version = ">=2.1" class OggConan(ConanFile): @@ -14,6 +16,7 @@ class OggConan(ConanFile): homepage = "https://github.com/xiph/ogg" license = "BSD-2-Clause" + package_type = "library" settings = "os", "arch", "build_type", "compiler" options = { "shared": [True, False], @@ -51,6 +54,9 @@ def generate(self): 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.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.3.5": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): @@ -73,11 +79,5 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", "ogg") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed self.cpp_info.components["ogglib"].libs = ["ogg"] - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "Ogg" - self.cpp_info.names["cmake_find_package_multi"] = "Ogg" - self.cpp_info.components["ogglib"].names["cmake_find_package"] = "ogg" - self.cpp_info.components["ogglib"].names["cmake_find_package_multi"] = "ogg" self.cpp_info.components["ogglib"].set_property("cmake_target_name", "Ogg::ogg") self.cpp_info.components["ogglib"].set_property("pkg_config_name", "ogg") diff --git a/recipes/ogg/all/test_package/CMakeLists.txt b/recipes/ogg/all/test_package/CMakeLists.txt index 3bc3fe8dbfc25..8e442973f62eb 100644 --- a/recipes/ogg/all/test_package/CMakeLists.txt +++ b/recipes/ogg/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(Ogg REQUIRED CONFIG) diff --git a/recipes/ogg/all/test_v1_package/CMakeLists.txt b/recipes/ogg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 37f60244ccda5..0000000000000 --- a/recipes/ogg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Ogg REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Ogg::ogg) diff --git a/recipes/ogg/all/test_v1_package/conanfile.py b/recipes/ogg/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ogg/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_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/ogre/1.x/test_package/CMakeLists.txt b/recipes/ogre/1.x/test_package/CMakeLists.txt index b3d9f056daa16..874ddef552d2b 100644 --- a/recipes/ogre/1.x/test_package/CMakeLists.txt +++ b/recipes/ogre/1.x/test_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/ohnet/all/conandata.yml b/recipes/ohnet/all/conandata.yml index 7e45066c8f010..974392dab738f 100644 --- a/recipes/ohnet/all/conandata.yml +++ b/recipes/ohnet/all/conandata.yml @@ -1,8 +1,25 @@ sources: + "1.37.5454": + url: "https://github.com/openhome/ohNet/archive/refs/tags/ohNet_1.37.5454.tar.gz" + sha256: "343c0f6b015e04195f5e7d937fa5e010a4d5a54782387d1c79259d3bb4ead0f0" + "1.36.5344": + url: "https://github.com/openhome/ohNet/archive/refs/tags/ohNet_1.36.5344.tar.gz" + sha256: "4873504f8f98c5fdbd72537392d6e5d97ed0747d3ef0b9c2b7fe77f1a02aaeb6" "1.36.5182": url: "https://github.com/openhome/ohNet/archive/refs/tags/ohNet_1.36.5182.tar.gz" sha256: "1489407b9bae13affa8f933a81fb5a43f16b29f5bf8048b68ea645afc0e53ced" patches: + "1.37.5454": + - patch_file: "patches/0001-makefile-1.37.5454.patch" + patch_description: "Reduce gcc-centricity in Makefile" + patch_type: "conan" + - patch_file: "patches/0001-common.mak-1.37.5454.patch" + patch_description: "Use proper flags for C++ file" + patch_type: "conan" + "1.36.5344": + - patch_file: "patches/0001-makefile-1.36.5344.patch" + patch_description: "Reduce gcc-centricity in Makefile" + patch_type: "conan" "1.36.5182": - patch_file: "patches/0001-makefile-universal.patch" patch_description: "Reduce gcc-centricity in Makefile" diff --git a/recipes/ohnet/all/conanfile.py b/recipes/ohnet/all/conanfile.py index ad2031f5acf6b..e76982e6ef25b 100755 --- a/recipes/ohnet/all/conanfile.py +++ b/recipes/ohnet/all/conanfile.py @@ -29,7 +29,7 @@ class OhNetConan(ConanFile): } short_paths = True - def _get_openhome_architecture(self, args): + def _fill_openhome_architecture(self, args): if is_apple_os(self): if str(self.settings.arch).startswith("armv8"): openhome_architecture = "arm64" @@ -66,43 +66,48 @@ def generate(self): tc.make_args.append("-j1") tc.generate() + def _fill_ohnet_args(self, args): + if self.settings.build_type == "Debug": + args.append("debug=1") + + installlibdir = os.path.join(self.package_folder, "lib") + installincludedir = os.path.join(self.package_folder, "include") + + args.extend([f"prefix={self.package_folder}",f"installdir={self.package_folder}", f"installlibdir={installlibdir}", f"installincludedir={installincludedir}"]) + + if not is_msvc(self): + args = self._fill_openhome_architecture(args) + args.append("rsync=no") + if str(self.settings.compiler.libcxx) == "libc++": + args.extend(["CPPFLAGS=-stdlib=libc++", "LDFLAGS=-stdlib=libc++"]) + return args + def build(self): apply_conandata_patches(self) targets = "ohNetDll TestsNative proxies devices" - additional_options="" + args = [] + self._fill_ohnet_args(args) 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}") + self.run(f"nmake /f OhNet.mak {targets} {' '.join(args)}") 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")) + args = [] + self._fill_ohnet_args(args) + 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}") + self.run(f"nmake /f OhNet.mak install {' '.join(args)}") 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): @@ -143,6 +148,7 @@ def package_info(self): 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 diff --git a/recipes/ohnet/all/patches/0001-common.mak-1.37.5454.patch b/recipes/ohnet/all/patches/0001-common.mak-1.37.5454.patch new file mode 100644 index 0000000000000..9b99e3972d230 --- /dev/null +++ b/recipes/ohnet/all/patches/0001-common.mak-1.37.5454.patch @@ -0,0 +1,27 @@ +diff --git a/Common.mak b/Common.mak +index a25489c2..7189c9dc 100644 +--- a/Common.mak ++++ b/Common.mak +@@ -385,21 +385,21 @@ $(objdir)nsec.$(objext) : $(mDNSdir)/nsec.c $(headers) + $(compiler)nsec.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/nsec.c + $(objdir)nsec3.$(objext) : $(mDNSdir)/nsec3.c $(headers) + $(compiler)nsec3.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/nsec3.c + $(objdir)uDNS.$(objext) : $(mDNSdir)/uDNS.c $(headers) + $(compiler)uDNS.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/uDNS.c + $(objdir)dnssd_clientshim.$(objext) : $(mDNSdir)/dnssd_clientshim.c $(headers) + $(compiler)dnssd_clientshim.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/dnssd_clientshim.c + $(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 $(cflags_third_party) $(cppflags) $(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) + $(compiler)Md5.$(objext) -c $(cflags_third_party) $(includes) OpenHome/md5.c + $(objdir)NetworkAdapterList.$(objext) : OpenHome/NetworkAdapterList.cpp $(headers) + $(compiler)NetworkAdapterList.$(objext) -c $(cppflags) $(includes) OpenHome/NetworkAdapterList.cpp + $(objdir)DnsChangeNotifier.$(objext) : OpenHome/DnsChangeNotifier.cpp $(headers) + $(compiler)DnsChangeNotifier.$(objext) -c $(cppflags) $(includes) OpenHome/DnsChangeNotifier.cpp + $(objdir)Network.$(objext) : OpenHome/Network.cpp $(headers) + $(compiler)Network.$(objext) -c $(cppflags) $(includes) OpenHome/Network.cpp diff --git a/recipes/ohnet/all/patches/0001-makefile-1.36.5344.patch b/recipes/ohnet/all/patches/0001-makefile-1.36.5344.patch new file mode 100644 index 0000000000000..4422447f1344d --- /dev/null +++ b/recipes/ohnet/all/patches/0001-makefile-1.36.5344.patch @@ -0,0 +1,363 @@ +diff --git a/Common.mak b/Common.mak +index baae7b17..2f058f51 100644 +--- a/Common.mak ++++ b/Common.mak +@@ -381,21 +381,21 @@ $(objdir)nsec.$(objext) : $(mDNSdir)/nsec.c $(headers) + $(compiler)nsec.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/nsec.c + $(objdir)nsec3.$(objext) : $(mDNSdir)/nsec3.c $(headers) + $(compiler)nsec3.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/nsec3.c + $(objdir)uDNS.$(objext) : $(mDNSdir)/uDNS.c $(headers) + $(compiler)uDNS.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/uDNS.c + $(objdir)dnssd_clientshim.$(objext) : $(mDNSdir)/dnssd_clientshim.c $(headers) + $(compiler)dnssd_clientshim.$(objext) -c $(cflags_third_party) $(includes) $(mDNSdir)/dnssd_clientshim.c + $(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) + $(compiler)Md5.$(objext) -c $(cflags_third_party) $(includes) OpenHome/md5.c + $(objdir)NetworkAdapterList.$(objext) : OpenHome/NetworkAdapterList.cpp $(headers) + $(compiler)NetworkAdapterList.$(objext) -c $(cppflags) $(includes) OpenHome/NetworkAdapterList.cpp + $(objdir)DnsChangeNotifier.$(objext) : OpenHome/DnsChangeNotifier.cpp $(headers) + $(compiler)DnsChangeNotifier.$(objext) -c $(cppflags) $(includes) OpenHome/DnsChangeNotifier.cpp + $(objdir)Network.$(objext) : OpenHome/Network.cpp $(headers) + $(compiler)Network.$(objext) -c $(cppflags) $(includes) OpenHome/Network.cpp +diff --git a/Makefile b/Makefile +index 2f0cb07c..372a6765 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,44 +1,44 @@ + #Makefile for linux + # Could be extended to support Mac in future + + rsync ?= yes + + ifeq ($(rsync),yes) + cp = rsync -u + else +-cp = cp -u ++cp = cp + endif + + ifeq ($(debug),1) + debug_specific_cflags = -g -O0 + debug_csharp = /define:DEBUG /debug+ + build_dir = Debug + openhome_configuration = Debug + android_ndk_debug = 1 + else + debug_specific_cflags = -g -O2 + debug_csharp = /optimize+ /debug:pdbonly + build_dir = Release + openhome_configuration = Release + android_ndk_debug=0 + 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}) + + ifeq ($(MACHINE),Darwin) + ifeq ($(iOs-arm64),1) + platform = iOS + detected_openhome_system = iOs + detected_openhome_architecture = arm64 + else ifeq ($(iOs-x64),1) + platform = iOS +@@ -50,88 +50,88 @@ ifeq ($(MACHINE),Darwin) + detected_openhome_architecture = rpi + else + platform = Mac + detected_openhome_system = Mac + ifeq ($(Mac-arm64),1) + detected_openhome_architecture = arm64 + else + 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 + else ifeq ($(Android-anycpu), 1) + platform = Android + detected_openhome_system = Android + detected_openhome_architecture = anycpu + 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 + CFLAGS = -m32 + LDFLAGS = -m32 + endif + else + # At present, platform == Vanilla is used for Kirkwood, x86 and x64 Posix builds. + 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 + 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 + + detected_openhome_system ?= Unknown + detected_openhome_architecture ?= Unknown + + ifneq (${openhome_system},) + ifneq (${openhome_system},${detected_openhome_system}) + $(warning Detected compiler is for system ${detected_openhome_system} but expected ${openhome_system}. Build will probably fail.) +@@ -208,83 +208,89 @@ ifeq ($(platform),Mac) + openhome_architecture = x64 + else + # building for arm64 + platform_cflags = -DPLATFORM_MACOSX_GNU -arch arm64 -mmacosx-version-min=11 + platform_linkflags = -arch arm64 -framework CoreFoundation -framework SystemConfiguration -framework IOKit + osbuilddir = Mac-arm64 + openhome_architecture = arm64 + 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 + + dotnetRuntime = osx-x64 + endif + + ifeq ($(platform), Core-ppc32) + # platform == Core1 + openhome_system = Core + openhome_architecture = ppc32 + endian = BIG + platform_cflags = -mcpu=405 + platform_linkflags = -mcpu=405 ${CROSS_LINKFLAGS} + linkopts_ohNet = + osdir = Core + 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 + + ifeq ($(platform), Core-armv6) + # platform == Core2 + openhome_system = Core + openhome_architecture = armv6 + endian = LITTLE + platform_cflags = -mcpu=arm926ej-s -Wno-psabi + platform_linkflags = -mcpu=arm926ej-s ${CROSS_LINKFLAGS} + linkopts_ohNet = + osdir = Core + 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 + + ifneq (,$(findstring $(platform),Vanilla Qnap-x86 Qnap-x19 Linux-ppc32)) + ifeq ($(gcc4_1), yes) + version_specific_cflags = ${CROSS_COMPILE_CFLAGS} + 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 = + endif + + version_specific_linkflags = ${CROSS_COMPILE_LINKFLAGS} + version_specific_library_path = ${CROSS_COMPILE_LIBRARY_PATH} + version_specific_includes = ${CROSS_COMPILE_INCLUDES} + + # 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 + + ifeq ($(platform), FreeBSD) + platform_cflags = $(version_specific_cflags) -fPIC -DPLATFORM_FREEBSD + platform_linkflags = $(version_specific_linkflags) -pthread + linkopts_ohNet = -Wl,-soname,libohNet.so + osbuilddir = Posix + objdir = Build/Obj/$(osbuilddir)/$(build_dir)/ + osdir = Posix +@@ -351,25 +357,25 @@ $(info Building for system ${openhome_system} and architecture ${openhome_archit + + + # Macros used by Common.mak + native_only ?= no + managed_only ?= no + no_shared_objects ?= no + 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 + includes = -IBuild/Include/ $(version_specific_includes) + bundle_build = Build/Bundles + mDNSdir = Build/mDNS + osdir ?= Posix + objext = o + libprefix = lib + libext = a +@@ -383,21 +389,21 @@ else + endif + exeext = elf + linkoutput = -o + dllprefix = lib + ifeq ($(platform), iOS) + link_dll = $(toolroot)/clang++ -pthread -shared -stdlib=libc++ $(platform_linkflags) + 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) + + csharpdefines ?= + publicjavadir = OpenHome/Net/Bindings/Java/ + + ifeq ($(platform), Mac) + platform_java_cflags = -Wno-self-assign + # arm64 builds need JAVA_HOME to be set because the Mac SDK for arm64 doesn't contain Java includes or dylibs +@@ -409,24 +415,24 @@ ifeq ($(platform), Mac) + link_jvm = ${MACOSX_SDK}/System/Library/Frameworks/JavaVM.framework/JavaVM + endif + javac = /usr/bin/javac + jar = /usr/bin/jar + else + platform_java_cflags = + includes_jni = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux + 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 + endif + endif + endif + link_jvm = $(libjvm_dir)/libjvm.so + javac = $(JAVA_HOME)/bin/javac + jar = $(JAVA_HOME)/bin/jar + endif diff --git a/recipes/ohnet/all/patches/0001-makefile-1.37.5454.patch b/recipes/ohnet/all/patches/0001-makefile-1.37.5454.patch new file mode 100644 index 0000000000000..b180a57e2d452 --- /dev/null +++ b/recipes/ohnet/all/patches/0001-makefile-1.37.5454.patch @@ -0,0 +1,336 @@ +diff --git a/Makefile b/Makefile +index 2f0cb07c..372a6765 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,44 +1,44 @@ + #Makefile for linux + # Could be extended to support Mac in future + + rsync ?= yes + + ifeq ($(rsync),yes) + cp = rsync -u + else +-cp = cp -u ++cp = cp + endif + + ifeq ($(debug),1) + debug_specific_cflags = -g -O0 + debug_csharp = /define:DEBUG /debug+ + build_dir = Debug + openhome_configuration = Debug + android_ndk_debug = 1 + else + debug_specific_cflags = -g -O2 + debug_csharp = /optimize+ /debug:pdbonly + build_dir = Release + openhome_configuration = Release + android_ndk_debug=0 + 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}) + + ifeq ($(MACHINE),Darwin) + ifeq ($(iOs-arm64),1) + platform = iOS + detected_openhome_system = iOs + detected_openhome_architecture = arm64 + else ifeq ($(iOs-x64),1) + platform = iOS +@@ -50,88 +50,88 @@ ifeq ($(MACHINE),Darwin) + detected_openhome_architecture = rpi + else + platform = Mac + detected_openhome_system = Mac + ifeq ($(Mac-arm64),1) + detected_openhome_architecture = arm64 + else + 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 + else ifeq ($(Android-anycpu), 1) + platform = Android + detected_openhome_system = Android + detected_openhome_architecture = anycpu + 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 + CFLAGS = -m32 + LDFLAGS = -m32 + endif + else + # At present, platform == Vanilla is used for Kirkwood, x86 and x64 Posix builds. + 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 + 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 + + detected_openhome_system ?= Unknown + detected_openhome_architecture ?= Unknown + + ifneq (${openhome_system},) + ifneq (${openhome_system},${detected_openhome_system}) + $(warning Detected compiler is for system ${detected_openhome_system} but expected ${openhome_system}. Build will probably fail.) +@@ -208,83 +208,89 @@ ifeq ($(platform),Mac) + openhome_architecture = x64 + else + # building for arm64 + platform_cflags = -DPLATFORM_MACOSX_GNU -arch arm64 -mmacosx-version-min=11 + platform_linkflags = -arch arm64 -framework CoreFoundation -framework SystemConfiguration -framework IOKit + osbuilddir = Mac-arm64 + openhome_architecture = arm64 + 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 + + dotnetRuntime = osx-x64 + endif + + ifeq ($(platform), Core-ppc32) + # platform == Core1 + openhome_system = Core + openhome_architecture = ppc32 + endian = BIG + platform_cflags = -mcpu=405 + platform_linkflags = -mcpu=405 ${CROSS_LINKFLAGS} + linkopts_ohNet = + osdir = Core + 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 + + ifeq ($(platform), Core-armv6) + # platform == Core2 + openhome_system = Core + openhome_architecture = armv6 + endian = LITTLE + platform_cflags = -mcpu=arm926ej-s -Wno-psabi + platform_linkflags = -mcpu=arm926ej-s ${CROSS_LINKFLAGS} + linkopts_ohNet = + osdir = Core + 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 + + ifneq (,$(findstring $(platform),Vanilla Qnap-x86 Qnap-x19 Linux-ppc32)) + ifeq ($(gcc4_1), yes) + version_specific_cflags = ${CROSS_COMPILE_CFLAGS} + 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 = + endif + + version_specific_linkflags = ${CROSS_COMPILE_LINKFLAGS} + version_specific_library_path = ${CROSS_COMPILE_LIBRARY_PATH} + version_specific_includes = ${CROSS_COMPILE_INCLUDES} + + # 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 + + ifeq ($(platform), FreeBSD) + platform_cflags = $(version_specific_cflags) -fPIC -DPLATFORM_FREEBSD + platform_linkflags = $(version_specific_linkflags) -pthread + linkopts_ohNet = -Wl,-soname,libohNet.so + osbuilddir = Posix + objdir = Build/Obj/$(osbuilddir)/$(build_dir)/ + osdir = Posix +@@ -351,25 +357,25 @@ $(info Building for system ${openhome_system} and architecture ${openhome_archit + + + # Macros used by Common.mak + native_only ?= no + managed_only ?= no + no_shared_objects ?= no + 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 + includes = -IBuild/Include/ $(version_specific_includes) + bundle_build = Build/Bundles + mDNSdir = Build/mDNS + osdir ?= Posix + objext = o + libprefix = lib + libext = a +@@ -383,21 +389,21 @@ else + endif + exeext = elf + linkoutput = -o + dllprefix = lib + ifeq ($(platform), iOS) + link_dll = $(toolroot)/clang++ -pthread -shared -stdlib=libc++ $(platform_linkflags) + 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) + + csharpdefines ?= + publicjavadir = OpenHome/Net/Bindings/Java/ + + ifeq ($(platform), Mac) + platform_java_cflags = -Wno-self-assign + # arm64 builds need JAVA_HOME to be set because the Mac SDK for arm64 doesn't contain Java includes or dylibs +@@ -409,24 +415,24 @@ ifeq ($(platform), Mac) + link_jvm = ${MACOSX_SDK}/System/Library/Frameworks/JavaVM.framework/JavaVM + endif + javac = /usr/bin/javac + jar = /usr/bin/jar + else + platform_java_cflags = + includes_jni = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux + 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 + endif + endif + endif + link_jvm = $(libjvm_dir)/libjvm.so + javac = $(JAVA_HOME)/bin/javac + jar = $(JAVA_HOME)/bin/jar + endif diff --git a/recipes/ohnet/all/test_package/conanfile.py b/recipes/ohnet/all/test_package/conanfile.py index a9fb96656f203..08478d9835129 100644 --- a/recipes/ohnet/all/test_package/conanfile.py +++ b/recipes/ohnet/all/test_package/conanfile.py @@ -9,6 +9,9 @@ class TestPackageConan(ConanFile): generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" + def build_requirements(self): + self.tool_requires("cmake/[>3.23 <4]") + def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/ohnet/config.yml b/recipes/ohnet/config.yml index f52e484dea6d6..89da0e2089324 100644 --- a/recipes/ohnet/config.yml +++ b/recipes/ohnet/config.yml @@ -1,3 +1,7 @@ versions: + "1.36.5344": + folder: all "1.36.5182": folder: all + "1.37.5454": + folder: all diff --git a/recipes/ohpipeline/all/conandata.yml b/recipes/ohpipeline/all/conandata.yml new file mode 100644 index 0000000000000..a9fa8d1a7bd8f --- /dev/null +++ b/recipes/ohpipeline/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "1.139.1000": + source: + url: "https://github.com/openhome/ohPipeline/archive/refs/tags/ohMediaPlayer_1.139.1000.tar.gz" + sha256: "070eac6d974bbe520d0b292df1ca4a72160a2b607a60dabdaa0971c3ef96e5e4" + cmake: + url: "https://raw.githubusercontent.com/merakiacoustic/ohPipeline/ohMediaPlayer_1.139.1000_meraki3/CMakeLists.txt" + sha256: "4ebe83cf0419802f42d9d9c7ff36c666bd1094415eb29c77927273753019a202" + "1.155.1133": + source: + url: "https://github.com/openhome/ohPipeline/archive/refs/tags/ohMediaPlayer_1.155.1133.tar.gz" + sha256: "507bdf70fc6b9bf8e4605546a5c7ae99abbe537cce4b74b3e091764323939fae" + cmake: + url: "https://raw.githubusercontent.com/merakiacoustic/ohPipeline/ohMediaPlayer_1.155.1133_meraki2/CMakeLists.txt" + sha256: "0f8701552c2b3331edeedde4c3a1b8120dc419d493f6a2e05b21c9045729d6ff" +patches: + "1.139.1000": + - patch_file: "patches/0001-missing-include.patch" + patch_type: "portability" + patch_description: "Add a missing stdlib include" diff --git a/recipes/ohpipeline/all/conanfile.py b/recipes/ohpipeline/all/conanfile.py new file mode 100755 index 0000000000000..d2314dfa54789 --- /dev/null +++ b/recipes/ohpipeline/all/conanfile.py @@ -0,0 +1,129 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, download, export_conandata_patches, apply_conandata_patches +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class OhPipelineConan(ConanFile): + name = "ohpipeline" + description = "OpenHome audio pipeline" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/openhome/ohPipeline" + topics = ("openhome", "ohnet", "ohpipeline", "upnp") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 11 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def export_sources(self): + export_conandata_patches(self) + + def build_requirements(self): + self.tool_requires("cmake/[>3.23 <4]") + + def requirements(self): + self.requires("ohnet/1.37.5454", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]") + self.requires("libmad/0.15.1b") + self.requires("alac/cci.20121212") + self.requires("libfdk_aac/2.0.3") + self.requires("faac/1.30") + self.requires("flac/1.4.3") + self.requires("ogg/1.3.5") + self.requires("vorbis/1.3.7") + + 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 generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + tc = CMakeToolchain(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def source(self): + get(self, **self.conan_data["sources"][self.version]["source"], strip_root=True) + download(self, **self.conan_data["sources"][self.version]["cmake"], filename="CMakeLists.txt") + + def build(self): + apply_conandata_patches(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() + + def package_info(self): + self.cpp_info.libs = [ + "ohPipeline", + "ohMediaPlayer", + "Odp", + "SourcePlaylist", + "SourceRadio", + "SourceSongcast", + "SourceScd", + "SourceRaop", + "SourceUpnpAv", + "Podcast", + "ScdSender", + "CodecWav", + "CodecPcm", + "CodecDsdDsf", + "CodecDsdDff", + "CodecDsdRaw", + "CodecAiffBase", + "CodecAifc", + "CodecAiff", + "CodecFlac", + "CodecAlacAppleBase", + "CodecAlacApple", + "CodecAacFdkBase", + "CodecAacFdkMp4", + "CodecAacFdkAdts", + "CodecMp3", + "CodecVorbis", + "WebAppFramework", + "WebAppFrameworkTestUtils", + "ConfigUi", + "ConfigUiTestUtils", + ] diff --git a/recipes/ohpipeline/all/patches/0001-missing-include.patch b/recipes/ohpipeline/all/patches/0001-missing-include.patch new file mode 100644 index 0000000000000..a6ff36f81a9fe --- /dev/null +++ b/recipes/ohpipeline/all/patches/0001-missing-include.patch @@ -0,0 +1,10 @@ +--- a/OpenHome/Media/Protocol/ProtocolHls.cpp ++++ b/OpenHome/Media/Protocol/ProtocolHls.cpp +@@ -18,6 +18,7 @@ + #include + + #include ++#include + + namespace OpenHome { + namespace Media { diff --git a/recipes/ohpipeline/all/test_package/CMakeLists.txt b/recipes/ohpipeline/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bd868ecdf5a63 --- /dev/null +++ b/recipes/ohpipeline/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(ohpipeline REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PUBLIC ohpipeline::ohpipeline) diff --git a/recipes/ohpipeline/all/test_package/conanfile.py b/recipes/ohpipeline/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/ohpipeline/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/ohpipeline/all/test_package/test_package.cpp b/recipes/ohpipeline/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dce35f7c92826 --- /dev/null +++ b/recipes/ohpipeline/all/test_package/test_package.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +using namespace OpenHome; +using namespace OpenHome::Av; + +class RamStore : public IStaticDataSource +{ +public: + RamStore(const Brx& aImageFileName); + virtual ~RamStore(); +private: // from IStaticDataSource + void LoadStaticData(IStoreLoaderStatic& aLoader) override; +private: + Brhz iImageFileName; +}; + +RamStore::RamStore(const Brx& aImageFileName) + : iImageFileName(aImageFileName) +{ +} + +RamStore::~RamStore() {} + +void RamStore::LoadStaticData(IStoreLoaderStatic& aLoader) +{ + aLoader.AddStaticItem(StaticDataKey::kBufManufacturerName, "OpenHome"); + aLoader.AddStaticItem(StaticDataKey::kBufManufacturerInfo, "insert oh info here..."); + aLoader.AddStaticItem(StaticDataKey::kBufManufacturerUrl, "http://www.openhome.org"); + aLoader.AddStaticItem(StaticDataKey::kBufManufacturerImageUrl, "http://wiki.openhome.org/mediawiki/skins/openhome/images/logo.png"); + aLoader.AddStaticItem(StaticDataKey::kBufModelName, "OpenHome Media Player (test)"); + aLoader.AddStaticItem(StaticDataKey::kBufModelInfo, "Test implementation of ohMediaPlayer"); + aLoader.AddStaticItem(StaticDataKey::kBufModelUrl, "http://wiki.openhome.org/wiki/OhMedia"); + aLoader.AddStaticItem(StaticDataKey::kBufModelImageUrl, iImageFileName.CString()); +} + +int main() +{ + RamStore* ramStore = new RamStore(Brx::Empty()); + + delete ramStore; +} diff --git a/recipes/ohpipeline/config.yml b/recipes/ohpipeline/config.yml new file mode 100644 index 0000000000000..12fa634205705 --- /dev/null +++ b/recipes/ohpipeline/config.yml @@ -0,0 +1,5 @@ +versions: + "1.139.1000": + folder: all + "1.155.1133": + folder: all diff --git a/recipes/onedpl/all/conandata.yml b/recipes/onedpl/all/conandata.yml index 991993ba67d6e..9e43f2c338c1b 100644 --- a/recipes/onedpl/all/conandata.yml +++ b/recipes/onedpl/all/conandata.yml @@ -1,10 +1,10 @@ sources: + "2022.3.0": + url: "https://github.com/oneapi-src/oneDPL/archive/refs/tags/oneDPL-2022.3.0-rc1.tar.gz" + sha256: "8ada85fc95255d08024ea3fda778a138a3b2efdbeb52468a4bdd08eb04254aa6" "2021.7.0": url: "https://github.com/oneapi-src/oneDPL/archive/refs/tags/oneDPL-2021.7.0-release.tar.gz" sha256: "5484c6de482790206d877a4947dcef6e0a1e082dbfa5c6a5362e18072c4a3de3" "2021.6.1": url: "https://github.com/oneapi-src/oneDPL/archive/refs/tags/oneDPL-2021.6.1-release.tar.gz" sha256: "4995fe2ed2724b89cdb52c4b6c9af22e146b48d2561abdafdaaa06262dbd67c4" - "20200330": - url: "https://github.com/oneapi-src/oneDPL/archive/20200330.tar.gz" - sha256: "3e040f6afdb200229dd58be2cf2a5f1613872f254231b18de2942aaf7e39ae2d" diff --git a/recipes/onedpl/all/conanfile.py b/recipes/onedpl/all/conanfile.py index 26d62f2265887..519736b1d8a3c 100644 --- a/recipes/onedpl/all/conanfile.py +++ b/recipes/onedpl/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.microsoft import is_msvc from conan.tools.scm import Version import os @@ -18,6 +20,8 @@ class OneDplConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/oneapi-src/oneDPL" topics = ("stl", "parallelism") + + package_type = "header-library" settings = "os", "arch", "build_type", "compiler" options = { "backend": ["tbb", "serial"], @@ -27,42 +31,64 @@ class OneDplConan(ConanFile): } no_copy_source = True + @property + def _min_cppstd(self): + if Version(self.version) < "2021.7.0": + return 11 + return 17 + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "2021.7.0": + return {} + return { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): if self.options.backend == "tbb": - self.requires("onetbb/2020.3") + self.requires("onetbb/2021.10.0") def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler.get_safe("cppstd"): - if Version(self.version) >= "2021.7.0": - check_min_cppstd(self, 17) - else: - check_min_cppstd(self, 11) + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) - def layout(self): - basic_layout(self, src_folder="src") + 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.get_safe("compiler.libcxx") == "libstdc++": + # https://stackoverflow.com/a/67924408/2997179 + raise ConanInvalidConfiguration("libstdc++ is not supported") + + if "2021.7" <= Version(self.version) < "2022" and is_msvc(self): + raise ConanInvalidConfiguration(f"MSVC is not supported for {self.version} due to " + "std::unary_function and std::binary_function being used") 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 package(self): - version_major = int(str(Version(self.version).major)[0:4]) copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) - if version_major < 2021: - copy(self, "*", src=os.path.join(self.source_folder, "stdlib"), dst=os.path.join(self.package_folder, "include")) - copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - else: - copy(self, "LICENSE.txt", src=os.path.join(self.source_folder, "licensing"), dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE.txt", src=os.path.join(self.source_folder, "licensing"), dst=os.path.join(self.package_folder, "licenses")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "ParallelSTL") self.cpp_info.set_property("cmake_target_name", "pstl::ParallelSTL") 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"] = "ParallelSTL" @@ -72,5 +98,7 @@ def package_info(self): self.cpp_info.components["_onedpl"].names["cmake_find_package"] = "ParallelSTL" self.cpp_info.components["_onedpl"].names["cmake_find_package_multi"] = "ParallelSTL" self.cpp_info.components["_onedpl"].set_property("cmake_target_name", "pstl::ParallelSTL") + self.cpp_info.components["_onedpl"].bindirs = [] + self.cpp_info.components["_onedpl"].libdirs = [] if self.options.backend == "tbb": self.cpp_info.components["_onedpl"].requires = ["onetbb::onetbb"] diff --git a/recipes/onedpl/all/test_package/CMakeLists.txt b/recipes/onedpl/all/test_package/CMakeLists.txt index ae285797ed88a..cad3204918869 100644 --- a/recipes/onedpl/all/test_package/CMakeLists.txt +++ b/recipes/onedpl/all/test_package/CMakeLists.txt @@ -1,9 +1,12 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(ParallelSTL REQUIRED CONFIG) -message(STATUS "OneDPL test version: ${ONEDPL_VERSION_MAJOR}") -add_executable(${PROJECT_NAME} test_package.${ONEDPL_VERSION_MAJOR}.cpp) +add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE pstl::ParallelSTL) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if (ParallelSTL_VERSION VERSION_GREATER_EQUAL "2021.7") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/onedpl/all/test_package/conanfile.py b/recipes/onedpl/all/test_package/conanfile.py index 5d2f30da145a9..db11bba8a6d83 100644 --- a/recipes/onedpl/all/test_package/conanfile.py +++ b/recipes/onedpl/all/test_package/conanfile.py @@ -1,24 +1,19 @@ -from conan import ConanFile -from conan.tools.build import cross_building -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.scm import Version 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", "VirtualRunEnv" - - def requirements(self): - self.requires(self.tested_reference_str) + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" def layout(self): cmake_layout(self) - def generate(self): - tc = CMakeToolchain(self) - tc.variables["ONEDPL_VERSION_MAJOR"] = str(Version(self.dependencies["onedpl"].ref.version).major)[0:4] - tc.generate() + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -26,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/onedpl/all/test_package/test_package.2020.cpp b/recipes/onedpl/all/test_package/test_package.2020.cpp deleted file mode 100644 index 3af6b2f8d8648..0000000000000 --- a/recipes/onedpl/all/test_package/test_package.2020.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include -#include - -int main() -{ - std::vector data(10000000); - std::fill_n(pstl::execution::par_unseq, data.begin(), data.size(), -1); - - return 0; -} diff --git a/recipes/onedpl/all/test_package/test_package.2021.cpp b/recipes/onedpl/all/test_package/test_package.cpp similarity index 100% rename from recipes/onedpl/all/test_package/test_package.2021.cpp rename to recipes/onedpl/all/test_package/test_package.cpp diff --git a/recipes/onedpl/all/test_v1_package/CMakeLists.txt b/recipes/onedpl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b8bcdb29cc801..0000000000000 --- a/recipes/onedpl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(ParallelSTL REQUIRED CONFIG) - -message(STATUS "OneDPL test version: ${ONEDPL_VERSION_MAJOR}") -add_executable(${PROJECT_NAME} ../test_package/test_package.${ONEDPL_VERSION_MAJOR}.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE pstl::ParallelSTL) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/onedpl/all/test_v1_package/conanfile.py b/recipes/onedpl/all/test_v1_package/conanfile.py deleted file mode 100644 index 7982514ebc4f8..0000000000000 --- a/recipes/onedpl/all/test_v1_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.definitions["ONEDPL_VERSION_MAJOR"] = tools.Version(self.deps_cpp_info["onedpl"].version).major[0:4] - 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/onedpl/config.yml b/recipes/onedpl/config.yml index 24b37db7f2bf3..3d474c4d1d440 100644 --- a/recipes/onedpl/config.yml +++ b/recipes/onedpl/config.yml @@ -1,7 +1,7 @@ versions: - "20200330": - folder: all - "2021.6.1": + "2022.3.0": folder: all "2021.7.0": folder: all + "2021.6.1": + folder: all diff --git a/recipes/onetbb/all/conandata.yml b/recipes/onetbb/all/conandata.yml index 4839476518f75..1e380a9b6f3a0 100644 --- a/recipes/onetbb/all/conandata.yml +++ b/recipes/onetbb/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2022.0.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2022.0.0.tar.gz" + sha256: "e8e89c9c345415b17b30a2db3095ba9d47647611662073f7fbf54ad48b7f3c2a" + "2021.13.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.13.0.tar.gz" + sha256: "3ad5dd08954b39d113dc5b3f8a8dc6dc1fd5250032b7c491eb07aed5c94133e1" + "2021.12.0": + url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.12.0.tar.gz" + sha256: "c7bb7aa69c254d91b8f0041a71c5bcc3936acb64408a1719aec0b2b7639dd84f" "2021.10.0": url: "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.10.0.tar.gz" sha256: "487023a955e5a3cc6d3a0d5f89179f9b6c0ae7222613a7185b0227ba0c83700b" @@ -18,6 +27,11 @@ sources: url: "https://github.com/oneapi-src/oneTBB/archive/v2021.3.0.tar.gz" sha256: "8f616561603695bbb83871875d2c6051ea28f8187dbe59299961369904d1d49e" patches: + "2022.0.0": + - patch_description: "Fix flow_graph tests build when compiling with GCC 13.3 or older" + patch_type: "official" + patch_source: "https://github.com/uxlfoundation/oneTBB/commit/9c9ace26863cf50853f39b2d0b78146d20a981a6" + patch_file: "patches/onetbb-wait-namespace.patch" "2021.8.0": - patch_description: "fix building for android with NDK >= 25" patch_type: "portability" diff --git a/recipes/onetbb/all/conanfile.py b/recipes/onetbb/all/conanfile.py index 1651c9800e6fd..4fa6841dc4bf2 100644 --- a/recipes/onetbb/all/conanfile.py +++ b/recipes/onetbb/all/conanfile.py @@ -1,9 +1,10 @@ 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.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.files import apply_conandata_patches, export_conandata_patches, copy, get, load, rmdir, rm from conan.tools.gnu import PkgConfigDeps from conan.tools.scm import Version import os @@ -29,12 +30,14 @@ class OneTBBConan(ConanFile): "tbbproxy": [True, False], "tbbbind": [True, False], "interprocedural_optimization": [True, False], + "build_apple_frameworks": [True, False], } default_options = { "tbbmalloc": True, "tbbproxy": True, "tbbbind": True, "interprocedural_optimization": True, + "build_apple_frameworks": False, } @property @@ -52,7 +55,16 @@ def _tbbbind_hwloc_version(self): @property def _tbbbind_supported(self): - return Version(self.version) >= "2021.1.1" and not self.settings.os == "Macos" + if is_apple_os(self): + return self.settings.os == "Macos" and Version(self.version) >= "2021.11.0" + return True + + @property + def _tbb_apple_frameworks_supported(self): + if is_apple_os(self): + # if the version is 2021.13.0 or later, the build_apple_frameworks option is supported on macOS + return Version(self.version) >= "2021.13.0" + return False @property def _tbbbind_build(self): @@ -76,12 +88,12 @@ def config_options(self): del self.options.tbbbind if Version(self.version) < "2021.6.0" or self.settings.os == "Android": del self.options.interprocedural_optimization + if not self._tbb_apple_frameworks_supported: + del self.options.build_apple_frameworks def configure(self): 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") @@ -101,7 +113,7 @@ def validate(self): def build_requirements(self): if self._tbbbind_build and not self._tbbbind_explicit_hwloc: if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -115,14 +127,16 @@ def generate(self): toolchain.variables["TBB_STRICT"] = False if Version(self.version) >= "2021.5.0": toolchain.variables["TBBMALLOC_BUILD"] = self.options.tbbmalloc - if self.options.get_safe("interprocedural_optimization"): + if self.options.get_safe("interprocedural_optimization") is not None: 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_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" + hwloc_lib_name = ("hwloc.lib" if self.settings.os == "Windows" else + "libhwloc.dylib" if self.settings.os == "Macos" 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"] = \ @@ -130,6 +144,11 @@ def generate(self): 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("\\", "/") + if self.options.get_safe("build_apple_frameworks"): + toolchain.variables["TBB_BUILD_APPLE_FRAMEWORKS"] = True + if Version(self.version) <= "2021.10.0": + toolchain.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + toolchain.generate() if self._tbbbind_build and not self._tbbbind_explicit_hwloc: @@ -149,6 +168,7 @@ def package(self): 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")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "TBB") @@ -164,7 +184,11 @@ def lib_name(name): tbb = self.cpp_info.components["libtbb"] tbb.set_property("cmake_target_name", "TBB::tbb") - tbb.libs = [lib_name("tbb")] + if self.options.get_safe("build_apple_frameworks"): + tbb.frameworkdirs.append(os.path.join(self.package_folder, "lib")) + tbb.frameworks.append("tbb") + else: + tbb.libs = [lib_name("tbb")] if self.settings.os == "Windows": version_info = load(self, os.path.join(self.package_folder, "include", "oneapi", "tbb", @@ -185,7 +209,13 @@ def lib_name(name): tbbmalloc = self.cpp_info.components["tbbmalloc"] tbbmalloc.set_property("cmake_target_name", "TBB::tbbmalloc") - tbbmalloc.libs = [lib_name("tbbmalloc")] + + if self.options.get_safe("build_apple_frameworks"): + tbbmalloc.frameworkdirs.append(os.path.join(self.package_folder, "lib")) + tbbmalloc.frameworks.append("tbbmalloc") + else: + tbbmalloc.libs = [lib_name("tbbmalloc")] + if self.settings.os in ["Linux", "FreeBSD"]: tbbmalloc.system_libs = ["dl", "pthread"] @@ -194,7 +224,13 @@ def lib_name(name): tbbproxy = self.cpp_info.components["tbbmalloc_proxy"] tbbproxy.set_property("cmake_target_name", "TBB::tbbmalloc_proxy") - tbbproxy.libs = [lib_name("tbbmalloc_proxy")] + + if self.options.get_safe("build_apple_frameworks"): + tbbproxy.frameworkdirs.append(os.path.join(self.package_folder, "lib")) + tbbproxy.frameworks.append("tbbmalloc_proxy") + else: + tbbproxy.libs = [lib_name("tbbmalloc_proxy")] + tbbproxy.requires = ["tbbmalloc"] if self.settings.os in ["Linux", "FreeBSD"]: tbbproxy.system_libs = ["m", "dl", "pthread"] diff --git a/recipes/onetbb/all/patches/onetbb-wait-namespace.patch b/recipes/onetbb/all/patches/onetbb-wait-namespace.patch new file mode 100644 index 0000000000000..5a6ed8f6a5d19 --- /dev/null +++ b/recipes/onetbb/all/patches/onetbb-wait-namespace.patch @@ -0,0 +1,38 @@ +From 9c9ace26863cf50853f39b2d0b78146d20a981a6 Mon Sep 17 00:00:00 2001 +From: Ilya Isaev +Date: Fri, 1 Nov 2024 10:52:18 +0100 +Subject: [PATCH] Fix flow_graph tests build when compiling with GCC 13.3 + (#1543) + +Signed-off-by: Isaev, Ilya +--- + include/oneapi/tbb/detail/_flow_graph_impl.h | 2 +- + include/oneapi/tbb/flow_graph.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/oneapi/tbb/detail/_flow_graph_impl.h b/include/oneapi/tbb/detail/_flow_graph_impl.h +index 19e00a8ef1..55063b93e1 100644 +--- a/include/oneapi/tbb/detail/_flow_graph_impl.h ++++ b/include/oneapi/tbb/detail/_flow_graph_impl.h +@@ -347,7 +347,7 @@ class graph : no_copy, public graph_proxy { + caught_exception = false; + try_call([this] { + my_task_arena->execute([this] { +- wait(my_wait_context_vertex.get_context(), *my_context); ++ d1::wait(my_wait_context_vertex.get_context(), *my_context); + }); + cancelled = my_context->is_group_execution_cancelled(); + }).on_exception([this] { +diff --git a/include/oneapi/tbb/flow_graph.h b/include/oneapi/tbb/flow_graph.h +index 20916fa7c2..5b438faabf 100644 +--- a/include/oneapi/tbb/flow_graph.h ++++ b/include/oneapi/tbb/flow_graph.h +@@ -305,7 +305,7 @@ class receiver { + bool res = internal_try_put(t, message_metainfo{message_metainfo::waiters_type{&msg_wait_vertex}}); + if (res) { + __TBB_ASSERT(graph_reference().my_context != nullptr, "No wait_context associated with the Flow Graph"); +- wait(msg_wait_vertex.get_context(), *graph_reference().my_context); ++ d1::wait(msg_wait_vertex.get_context(), *graph_reference().my_context); + } + return res; + } diff --git a/recipes/onetbb/all/test_package/test_package.cpp b/recipes/onetbb/all/test_package/test_package.cpp index e507d17dc5756..922ff57134a12 100644 --- a/recipes/onetbb/all/test_package/test_package.cpp +++ b/recipes/onetbb/all/test_package/test_package.cpp @@ -1,39 +1,8 @@ -#include "tbb/task_group.h" -#include "tbb/flow_graph.h" +#include #include -using namespace tbb; -using namespace tbb::flow; - -int Fib(int n) { - if( n<2 ) { - return n; - } else { - int x, y; - task_group g; - g.run([&]{x=Fib(n-1);}); // spawn a task - g.run([&]{y=Fib(n-2);}); // spawn another task - g.wait(); // wait for both tasks to complete - return x+y; - } -} - int main(){ - std::cout<<"Fib 6="< hello( g, - []( const continue_msg &) { - std::cout << "Hello"; - } - ); - continue_node< continue_msg> world( g, - []( const continue_msg &) { - std::cout << " World\n"; - } - ); - make_edge(hello, world); - hello.try_put(continue_msg()); - g.wait_for_all(); + std::cout << "tbb runtime version: " << TBB_runtime_version() << "\n"; + std::cout << "tbb runtime interface version: " << TBB_runtime_interface_version() << "\n"; return 0; } diff --git a/recipes/onetbb/all/test_v1_package/CMakeLists.txt b/recipes/onetbb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/onetbb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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/all/test_v1_package/conanfile.py b/recipes/onetbb/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/onetbb/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_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/config.yml b/recipes/onetbb/config.yml index 39b3726474302..d29014948fa46 100644 --- a/recipes/onetbb/config.yml +++ b/recipes/onetbb/config.yml @@ -1,4 +1,10 @@ versions: + "2022.0.0": + folder: all + "2021.13.0": + folder: all + "2021.12.0": + folder: all "2021.10.0": folder: all "2021.9.0": diff --git a/recipes/oniguruma/all/test_package/CMakeLists.txt b/recipes/oniguruma/all/test_package/CMakeLists.txt index f092881c2b7b3..69984aea043e3 100644 --- a/recipes/oniguruma/all/test_package/CMakeLists.txt +++ b/recipes/oniguruma/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(oniguruma REQUIRED CONFIG) diff --git a/recipes/oniguruma/all/test_v1_package/CMakeLists.txt b/recipes/oniguruma/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/oniguruma/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/oniguruma/all/test_v1_package/conanfile.py b/recipes/oniguruma/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/oniguruma/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_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/onnx/all/conandata.yml b/recipes/onnx/all/conandata.yml index ccb0c203d7239..337aa98f505f5 100644 --- a/recipes/onnx/all/conandata.yml +++ b/recipes/onnx/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.17.0": + url: "https://github.com/onnx/onnx/archive/v1.17.0.tar.gz" + sha256: "8d5e983c36037003615e5a02d36b18fc286541bf52de1a78f6cf9f32005a820e" + "1.16.2": + url: "https://github.com/onnx/onnx/archive/v1.16.2.tar.gz" + sha256: "84fc1c3d6133417f8a13af6643ed50983c91dacde5ffba16cc8bb39b22c2acbb" + "1.16.1": + url: "https://github.com/onnx/onnx/archive/v1.16.1.tar.gz" + sha256: "0e6aa2c0a59bb2d90858ad0040ea1807117cc2f05b97702170f18e6cd6b66fb3" + "1.16.0": + url: "https://github.com/onnx/onnx/archive/v1.16.0.tar.gz" + sha256: "0ce153e26ce2c00afca01c331a447d86fbf21b166b640551fe04258b4acfc6a4" "1.15.0": url: "https://github.com/onnx/onnx/archive/v1.15.0.tar.gz" sha256: "c757132e018dd0dd171499ef74fca88b74c5430a20781ec53da19eb7f937ef68" @@ -11,9 +23,3 @@ sources: "1.13.1": url: "https://github.com/onnx/onnx/archive/refs/tags/v1.13.1.tar.gz" sha256: "090d3e10ec662a98a2a72f1bf053f793efc645824f0d4b779e0ce47468a0890e" - "1.12.0": - url: "https://github.com/onnx/onnx/archive/refs/tags/v1.12.0.tar.gz" - sha256: "052ad3d5dad358a33606e0fc89483f8150bb0655c99b12a43aa58b5b7f0cc507" -patches: - "1.12.0": - - patch_file: "patches/0001-fix-concurrent-proto3-remove-1.12.0.patch" diff --git a/recipes/onnx/all/conanfile.py b/recipes/onnx/all/conanfile.py index 4c5cfb0ecfc0d..ccffd47b97dce 100644 --- a/recipes/onnx/all/conanfile.py +++ b/recipes/onnx/all/conanfile.py @@ -32,7 +32,7 @@ class OnnxConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "disable_static_registration": False, + "disable_static_registration": True, } @property @@ -49,10 +49,19 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): + if Version(self.version) < "1.16.0": + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "5", + "apple-clang": "10", + } + # 1.16.0+ requires header available with gcc8+ return { "Visual Studio": "15", "msvc": "191", - "gcc": "7", + "gcc": "8", "clang": "5", "apple-clang": "10", } @@ -104,7 +113,6 @@ def generate(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 tc.variables["ONNX_GEN_PB_TYPE_STUBS"] = False @@ -113,9 +121,6 @@ def generate(self): tc.variables["ONNX_BUILD_TESTS"] = 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 - tc.variables["ONNXIFI_DUMMY_BACKEND"] = False 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) @@ -174,28 +179,6 @@ def _onnx_components(self): "requires": ["protobuf::libprotobuf"] } } - if Version(self.version) < "1.13.0": - components.update( - { - "onnxifi": { - "target": "onnxifi", - "system_libs": [(self.settings.os in ["Linux", "FreeBSD"], ["dl"])], - }, - "onnxifi_dummy": { - "target": "onnxifi_dummy", - "libs": ["onnxifi_dummy"], - "requires": ["onnxifi"] - }, - "onnxifi_loader": { - "target": "onnxifi_loader", - "libs": ["onnxifi_loader"], - "requires": ["onnxifi"] - }, - "onnxifi_wrapper": { - "target": "onnxifi_wrapper" - } - } - ) components["libonnx"]["defines"].append("__STDC_FORMAT_MACROS") return components diff --git a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch b/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch deleted file mode 100644 index 1ce9c915aa488..0000000000000 --- a/recipes/onnx/all/patches/0001-fix-concurrent-proto3-remove-1.12.0.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/onnx/gen_proto.py -+++ b/onnx/gen_proto.py -@@ -159,7 +159,7 @@ def convert(stem: str, package_name: str, output: str, do_onnx_ml: bool = False, - 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(f"Removing {pb3_file}") - os.remove(pb3_file) diff --git a/recipes/onnx/config.yml b/recipes/onnx/config.yml index 669807aa7c0eb..32a3b9ac351e1 100644 --- a/recipes/onnx/config.yml +++ b/recipes/onnx/config.yml @@ -1,4 +1,12 @@ versions: + "1.17.0": + folder: all + "1.16.2": + folder: all + "1.16.1": + folder: all + "1.16.0": + folder: all "1.15.0": folder: all "1.14.1": @@ -7,5 +15,3 @@ versions: folder: all "1.13.1": folder: all - "1.12.0": - folder: all diff --git a/recipes/onnxruntime/all/cmake/onnxruntime_external_deps.cmake b/recipes/onnxruntime/all/cmake/onnxruntime_external_deps.cmake new file mode 100644 index 0000000000000..e6253b3fc2988 --- /dev/null +++ b/recipes/onnxruntime/all/cmake/onnxruntime_external_deps.cmake @@ -0,0 +1,113 @@ +# Replacement for https://github.com/microsoft/onnxruntime/blob/v1.16.1/cmake/external/onnxruntime_external_deps.cmake + +if(NOT onnxruntime_DISABLE_ABSEIL) + find_package(absl REQUIRED CONFIG) + list(APPEND onnxruntime_EXTERNAL_LIBRARIES abseil::abseil) + include_directories(${absl_INCLUDE_DIRS}) + set(ABSEIL_LIBS abseil::abseil) +endif() + +find_package(re2 REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES re2::re2) + +#flatbuffers 1.11.0 does not have flatbuffers::IsOutRange, therefore we require 1.12.0+ +find_package(Flatbuffers REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES flatbuffers::flatbuffers) + +find_package(Protobuf REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES protobuf::libprotobuf) +set(ONNX_CUSTOM_PROTOC_EXECUTABLE protoc) +set(PROTOC_EXECUTABLE protoc) + +find_package(date REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES date::date) +include_directories(${date_INCLUDE_DIRS}) +add_library(date_interface INTERFACE) + +find_package(Boost REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES Boost::mp11) + +find_package(nlohmann_json REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES nlohmann_json::nlohmann_json) + +find_package(cpuinfo REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo) +if (TARGET cpuinfo::clog) + list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::clog) +endif() +set(CPUINFO_SUPPORTED ${cpuinfo_FOUND}) +# Add a dummy targets for onnxruntime CMakelists.txt to depend on +add_library(clog INTERFACE) +add_library(cpuinfo INTERFACE) + +if (NOT WIN32) + find_package(nsync REQUIRED CONFIG) + list(APPEND onnxruntime_EXTERNAL_LIBRARIES nsync::nsync_cpp) + include_directories(${nsync_INCLUDE_DIRS}) + add_library(nsync_cpp INTERFACE) +endif() + +find_package(Microsoft.GSL 4.0 REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES Microsoft.GSL::GSL) +include_directories(${Microsoft.GSL_INCLUDE_DIRS}) + +find_package(safeint REQUIRED CONFIG) +include_directories(${safeint_INCLUDE_DIRS}) +add_library(safeint_interface INTERFACE) + +find_package(ONNX REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES onnx onnx_proto) + +find_package(Eigen3 REQUIRED CONFIG) +list(APPEND onnxruntime_EXTERNAL_LIBRARIES Eigen3::Eigen) +set(eigen_INCLUDE_DIRS ${Eigen3_INCLUDE_DIRS}) + +if(WIN32) + find_package(wil REQUIRED CONFIG) + list(APPEND onnxruntime_EXTERNAL_LIBRARIES WIL::WIL) + include_directories(${wil_INCLUDE_DIRS}) +endif() + +# XNNPACK EP +if (onnxruntime_USE_XNNPACK) + if (onnxruntime_DISABLE_CONTRIB_OPS) + message(FATAL_ERROR "XNNPACK EP requires the internal NHWC contrib ops to be available " + "but onnxruntime_DISABLE_CONTRIB_OPS is ON") + endif() + find_package(xnnpack REQUIRED CONFIG) + list(APPEND onnxruntime_EXTERNAL_LIBRARIES xnnpack::xnnpack) + add_library(XNNPACK INTERFACE) +endif() + +if (onnxruntime_USE_MIMALLOC) + find_package(mimalloc REQUIRED CONFIG) + add_definitions(-DUSE_MIMALLOC) +endif() + +# The source code of onnx_proto is generated, we must build this lib first before starting to compile the other source code that uses ONNX protobuf types. +# 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 +) + +if (onnxruntime_RUN_ONNX_TESTS) + add_definitions(-DORT_RUN_EXTERNAL_ONNX_TESTS) +endif() + +if(onnxruntime_ENABLE_ATEN) + message("Aten fallback is enabled.") + find_package(dlpack REQUIRED CONFIG) +endif() + +if(onnxruntime_ENABLE_TRAINING OR (onnxruntime_ENABLE_TRAINING_APIS AND onnxruntime_BUILD_UNIT_TESTS)) + find_package(cxxopts REQUIRED CONFIG) +endif() + +if(onnxruntime_USE_SNPE) + include(external/find_snpe.cmake) + list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${SNPE_NN_LIBS}) +endif() + +file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} ORT_BINARY_DIR) +file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} ORT_SOURCE_DIR) diff --git a/recipes/onnxruntime/all/conandata.yml b/recipes/onnxruntime/all/conandata.yml index b051b06768621..5ad665fd49f79 100644 --- a/recipes/onnxruntime/all/conandata.yml +++ b/recipes/onnxruntime/all/conandata.yml @@ -1,16 +1,13 @@ sources: + "1.18.1": + url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.18.1.tar.gz" + sha256: "480ff5d2450ff18d02db48908c9c0c6a602993942cb47866b8effe32d0469a2c" + "1.17.3": + url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.17.3.tar.gz" + sha256: "4112f6552c17216311be013b9a2621a3c1a17ed9e1268a1142599b6a494517c2" "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" @@ -18,49 +15,46 @@ sources: url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.14.1.tar.gz" sha256: "f998352b131bb89fa7dd1f1d87ddbafe647dfaddd11929b6b5168b3f4ef857de" patches: - "1.16.3": - - patch_file: "patches/1.16.0-0001-cmake-dependencies.patch" - patch_description: "CMake: ensure conan dependencies are used" - patch_type: "conan" - - patch_file: "patches/1.14.1-0004-abseil-no-string-view.patch" - patch_description: "allow to build with abseil built without c++17 support" + "1.18.1": + - patch_file: "patches/1.17.3-0002-missing-include.patch" + patch_description: "add missing '' include when abseil is 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_file: "patches/1.18.0-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.18.1-0005-fix-cutlass-cuda-provider.patch" + patch_description: "use cutlass from Conan" + patch_type: "portability" + "1.17.3": + - patch_file: "patches/1.17.3-0001-patch-macos-cpp20-date-compat.patch" + patch_description: "allow to build with macos c++20 support" + patch_type: "portability" + patch_source: "https://github.com/microsoft/onnxruntime/commit/7303a90f4916dcf6f66236d40b8917344c27420a.patch" + - patch_file: "patches/1.17.3-0002-missing-include.patch" + patch_description: "add missing '' include when abseil is built without c++17 support" + patch_type: "portability" - 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.17.3-0003-fix-cutlass-cuda-provider.patch" + patch_description: "use cutlass from Conan" + patch_type: "portability" + "1.16.3": - 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" + - patch_file: "patches/1.15.1-0002-fix-attention-15983.patch" + patch_description: "Fix attention.cc" + patch_source: "https://github.com/microsoft/onnxruntime/pull/15983" + patch_type: "backport" "1.14.1": - patch_file: "patches/1.14.1-0001-cmake-dependencies.patch" patch_description: "CMake: ensure conan dependencies are used (upstreamed future versions)" patch_type: "conan" - patch_source: "https://github.com/microsoft/onnxruntime/pull/15323" - - patch_file: "patches/1.14.1-0002-cmake-dependencies.patch" - patch_description: "CMake: ensure conan dependencies are used" - patch_type: "conan" - patch_file: "patches/1.14.1-0003-amx-gas-version.patch" patch_description: "Check GNU AS supports AMX before enabling it" patch_type: "portability" @@ -72,3 +66,12 @@ patches: 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" + +# ONNX versions are based on the minor version used at +# https://github.com/microsoft/onnxruntime/tree/main/cmake/external +onnx_version_map: + "1.18.1": "1.16.2" + "1.17.3": "1.15.0" + "1.16.3": "1.14.1" + "1.15.1": "1.14.1" + "1.14.1": "1.13.1" diff --git a/recipes/onnxruntime/all/conanfile.py b/recipes/onnxruntime/all/conanfile.py index 8861b22e93f76..ce3b31cb93581 100644 --- a/recipes/onnxruntime/all/conanfile.py +++ b/recipes/onnxruntime/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, 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, replace_in_file from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.env import VirtualBuildEnv @@ -27,16 +27,20 @@ class OnnxRuntimeConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_xnnpack": [True, False], + "with_cuda": [True, False], } default_options = { "shared": False, "fPIC": True, "with_xnnpack": False, + "with_cuda": False, } short_paths = True @property def _min_cppstd(self): + if is_apple_os(self) and Version(self.version) >= "1.17.0": + return 20 # https://github.com/microsoft/onnxruntime/blob/8f5c79cb63f09ef1302e85081093a3fe4da1bc7d/cmake/CMakeLists.txt#L43-L47 return 17 @property @@ -59,6 +63,7 @@ def _compilers_minimum_version(self): 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": @@ -67,38 +72,46 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + # onnxruntime forces this to be True + # https://github.com/microsoft/onnxruntime/blob/be76e1e1b8e2914e448d12a0cc683c00014c0490/cmake/external/onnxruntime_external_deps.cmake#L542 + self.options["onnx"].disable_static_registration = True 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/20230802.1") + required_onnx_version = self.conan_data["onnx_version_map"][self.version] + self.requires(f"onnx/{required_onnx_version}") + self.requires("abseil/20240116.1") self.requires("protobuf/3.21.12") self.requires("date/3.0.1") - self.requires("re2/20230901") - self.requires(f"onnx/{self._onnx_version}") - self.requires("flatbuffers/1.12.0") - 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("re2/20231101") + if Version(self.version) >= "1.18": + self.requires("flatbuffers/23.5.26") + else: + # v1.* is required, newer versions are not compatible + self.requires("flatbuffers/1.12.0") + # using 1.84.0+ fails on CCI as it prevents the cpp 17 version to be picked up when building with cpp 20 + self.requires("boost/1.83.0", headers=True, libs=False) # for mp11, header only, no need for libraries self.requires("safeint/3.0.28") self.requires("nlohmann_json/3.11.3") self.requires("eigen/3.4.0") self.requires("ms-gsl/4.0.0") - self.requires("cpuinfo/cci.20220618") + if Version(self.version) >= "1.17.0": + self.requires("cpuinfo/cci.20231129") + else: + self.requires("cpuinfo/cci.20220618") # Newer versions are not compatible if self.settings.os != "Windows": self.requires("nsync/1.26.0") else: - self.requires("wil/1.0.231028.1") + self.requires("wil/1.0.240803.1") if self.options.with_xnnpack: - self.requires("xnnpack/cci.20220801") + if Version(self.version) >= "1.17.0": + self.requires("xnnpack/cci.20230715") + else: + self.requires("xnnpack/cci.20220801") + if self.options.with_cuda: + self.requires("cutlass/3.5.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -108,17 +121,23 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.ref} requires minimum compiler version {minimum_version}." ) + if not self.dependencies["onnx"].options.disable_static_registration: + raise ConanInvalidConfiguration( + f"{self.ref} requires onnx compiled with `-o onnx:disable_static_registration=True`." + ) 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." + f"{self.ref} requires Python 3.8+ to be built as shared." ) + if self.settings.os == "Windows" and self.dependencies["abseil"].options.shared: + raise ConanInvalidConfiguration("Using abseil shared on Windows leads to link errors.") def build_requirements(self): - # Required by upstream https://github.com/microsoft/onnxruntime/blob/v1.14.1/cmake/CMakeLists.txt#L5 - self.tool_requires("cmake/[>=3.24 <4]") + # Required by upstream https://github.com/microsoft/onnxruntime/blob/v1.16.1/cmake/CMakeLists.txt#L5 + self.tool_requires("cmake/[>=3.26 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -128,102 +147,60 @@ def generate(self): # disable downloading dependencies to ensure conan ones are used tc.variables["FETCHCONTENT_FULLY_DISCONNECTED"] = True if self.version >= Version("1.15.0") and self.options.shared: - # Need to replace windows path seperators with linux path seperators to keep CMake from crashing + # Need to replace windows path separators with linux path separators 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 tc.variables["onnxruntime_USE_XNNPACK"] = self.options.with_xnnpack + tc.variables["onnxruntime_USE_CUDA"] = self.options.with_cuda tc.variables["onnxruntime_BUILD_UNIT_TESTS"] = False - tc.variables["onnxruntime_RUN_ONNX_TESTS"] = False - tc.variables["onnxruntime_GENERATE_TEST_REPORTS"] = False - tc.variables["onnxruntime_USE_MIMALLOC"] = False - tc.variables["onnxruntime_ENABLE_PYTHON"] = False - tc.variables["onnxruntime_BUILD_CSHARP"] = False - tc.variables["onnxruntime_BUILD_JAVA"] = False - tc.variables["onnxruntime_BUILD_NODEJS"] = False - tc.variables["onnxruntime_BUILD_OBJC"] = False - tc.variables["onnxruntime_BUILD_APPLE_FRAMEWORK"] = False - tc.variables["onnxruntime_USE_DNNL"] = False - tc.variables["onnxruntime_USE_NNAPI_BUILTIN"] = False - tc.variables["onnxruntime_USE_RKNPU"] = False - tc.variables["onnxruntime_USE_LLVM"] = False - tc.variables["onnxruntime_ENABLE_MICROSOFT_INTERNAL"] = False - tc.variables["onnxruntime_USE_VITISAI"] = False - tc.variables["onnxruntime_USE_TENSORRT"] = False - tc.variables["onnxruntime_SKIP_AND_PERFORM_FILTERED_TENSORRT_TESTS"] = True - tc.variables["onnxruntime_USE_TENSORRT_BUILTIN_PARSER"] = False - tc.variables["onnxruntime_TENSORRT_PLACEHOLDER_BUILDER"] = False - tc.variables["onnxruntime_USE_TVM"] = False - tc.variables["onnxruntime_TVM_CUDA_RUNTIME"] = False - tc.variables["onnxruntime_TVM_USE_HASH"] = False - tc.variables["onnxruntime_CROSS_COMPILING"] = False tc.variables["onnxruntime_DISABLE_CONTRIB_OPS"] = False - tc.variables["onnxruntime_DISABLE_ML_OPS"] = False + tc.variables["onnxruntime_USE_FLASH_ATTENTION"] = False tc.variables["onnxruntime_DISABLE_RTTI"] = False tc.variables["onnxruntime_DISABLE_EXCEPTIONS"] = False - tc.variables["onnxruntime_MINIMAL_BUILD"] = False - tc.variables["onnxruntime_EXTENDED_MINIMAL_BUILD"] = False - tc.variables["onnxruntime_MINIMAL_BUILD_CUSTOM_OPS"] = False - tc.variables["onnxruntime_REDUCED_OPS_BUILD"] = False - tc.variables["onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS"] = False - tc.variables["onnxruntime_USE_DML"] = False - tc.variables["onnxruntime_USE_WINML"] = False - tc.variables["onnxruntime_BUILD_MS_EXPERIMENTAL_OPS"] = False - tc.variables["onnxruntime_USE_TELEMETRY"] = False - tc.variables["onnxruntime_ENABLE_LTO"] = False - tc.variables["onnxruntime_USE_ACL"] = False - tc.variables["onnxruntime_USE_ACL_1902"] = False - tc.variables["onnxruntime_USE_ACL_1905"] = False - tc.variables["onnxruntime_USE_ACL_1908"] = False - tc.variables["onnxruntime_USE_ACL_2002"] = False - tc.variables["onnxruntime_USE_ARMNN"] = False + tc.variables["onnxruntime_ARMNN_RELU_USE_CPU"] = False tc.variables["onnxruntime_ARMNN_BN_USE_CPU"] = False - tc.variables["onnxruntime_ENABLE_NVTX_PROFILE"] = False - tc.variables["onnxruntime_ENABLE_TRAINING"] = False - tc.variables["onnxruntime_ENABLE_TRAINING_OPS"] = False - tc.variables["onnxruntime_ENABLE_TRAINING_APIS"] = False tc.variables["onnxruntime_ENABLE_CPU_FP16_OPS"] = False - tc.variables["onnxruntime_USE_NCCL"] = False - tc.variables["onnxruntime_BUILD_BENCHMARKS"] = False - tc.variables["onnxruntime_USE_ROCM"] = False - tc.variables["onnxruntime_GCOV_COVERAGE"] = False - tc.variables["onnxruntime_USE_MPI"] = False - tc.variables["onnxruntime_ENABLE_MEMORY_PROFILE"] = False - tc.variables["onnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO"] = False - tc.variables["onnxruntime_BUILD_WEBASSEMBLY"] = False - tc.variables["onnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB"] = False - tc.variables["onnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING"] = False - tc.variables["onnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING"] = False - tc.variables["onnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING"] = False - tc.variables["onnxruntime_ENABLE_WEBASSEMBLY_THREADS"] = False - tc.variables["onnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO"] = False - tc.variables["onnxruntime_ENABLE_WEBASSEMBLY_PROFILING"] = False tc.variables["onnxruntime_ENABLE_EAGER_MODE"] = False tc.variables["onnxruntime_ENABLE_LAZY_TENSOR"] = False - tc.variables["onnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS"] = False - tc.variables["onnxruntime_ENABLE_CUDA_PROFILING"] = False - tc.variables["onnxruntime_ENABLE_ROCM_PROFILING"] = False - 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") + if Version(self.version) >= "1.17": + tc.variables["onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS"] = False + tc.variables["onnxruntime_USE_NEURAL_SPEED"] = False + tc.variables["onnxruntime_USE_MEMORY_EFFICIENT_ATTENTION"] = False - 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") + # Disable a warning that gets converted to an error + tc.preprocessor_definitions["_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS"] = "1" + tc.generate() + deps = CMakeDeps(self) + deps.set_property("boost::headers", "cmake_target_name", "Boost::mp11") + deps.set_property("flatbuffers", "cmake_target_name", "flatbuffers::flatbuffers") deps.generate() + vbe = VirtualBuildEnv(self) vbe.generate(scope="build") - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + copy(self, "onnxruntime_external_deps.cmake", + src=os.path.join(self.export_sources_folder, "cmake"), + dst=os.path.join(self.source_folder, "cmake", "external")) + # Avoid parsing of git commit info + if Version(self.version) >= "15.0": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "CMakeLists.txt"), + "if (Git_FOUND)", "if (FALSE)") + if Version(self.version) >= "1.17": + # https://github.com/microsoft/onnxruntime/commit/5bfca1dc576720627f3af8f65e25af408271079b + replace_in_file(self, os.path.join(self.source_folder, "cmake", "onnxruntime_providers_cuda.cmake"), + 'option(onnxruntime_NVCC_THREADS "Number of threads that NVCC can use for compilation." 1)', + 'set(onnxruntime_NVCC_THREADS "1" CACHE STRING "Number of threads that NVCC can use for compilation.")') + + def build(self): + self._patch_sources() cmake = CMake(self) # https://github.com/microsoft/onnxruntime/blob/v1.14.1/cmake/CMakeLists.txt#L792 # onnxruntime is builds its targets with COMPILE_WARNING_AS_ERROR ON @@ -265,6 +242,7 @@ def package_info(self): if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: self.cpp_info.system_libs.append("m") + if self.settings.os in ["Linux", "FreeBSD", "SunOS", "AIX"]: self.cpp_info.system_libs.append("pthread") if is_apple_os(self): self.cpp_info.frameworks.append("Foundation") @@ -292,6 +270,8 @@ def package_info(self): self.cpp_info.requires.append("wil::wil") if self.options.with_xnnpack: self.cpp_info.requires.append("xnnpack::xnnpack") + if self.options.with_cuda: + self.cpp_info.requires.append("cutlass::cutlass") # https://github.com/microsoft/onnxruntime/blob/v1.16.0/cmake/CMakeLists.txt#L1759-L1763 self.cpp_info.set_property("cmake_file_name", "onnxruntime") diff --git a/recipes/onnxruntime/all/patches/1.14.1-0001-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.14.1-0001-cmake-dependencies.patch index 4af8aa88fe662..f2d83eacd7844 100644 --- a/recipes/onnxruntime/all/patches/1.14.1-0001-cmake-dependencies.patch +++ b/recipes/onnxruntime/all/patches/1.14.1-0001-cmake-dependencies.patch @@ -1,72 +1,3 @@ ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -753,7 +753,7 @@ endif() - - function(onnxruntime_set_compile_flags target_name) - if (CPUINFO_SUPPORTED) -- onnxruntime_add_include_to_target(${target_name} cpuinfo) -+ onnxruntime_add_include_to_target(${target_name} cpuinfo::cpuinfo) - endif() - if(onnxruntime_ENABLE_EAGER_MODE) - target_compile_definitions(${target_name} PRIVATE ENABLE_EAGER_MODE) -@@ -837,7 +837,7 @@ function(onnxruntime_set_compile_flags target_name) - target_compile_options(${target_name} PRIVATE "-Wno-unused-parameter") - endif() - target_compile_definitions(${target_name} PUBLIC -DNSYNC_ATOMIC_CPP11) -- target_include_directories(${target_name} PRIVATE "${google_nsync_SOURCE_DIR}/public") -+ onnxruntime_add_include_to_target(${target_name} nsync::nsync_cpp) - endif() - foreach(ORT_FLAG ${ORT_PROVIDER_FLAGS}) - target_compile_definitions(${target_name} PRIVATE ${ORT_FLAG}) -@@ -1461,7 +1461,7 @@ if (WIN32) - list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${SYS_PATH_LIB}) - list(APPEND onnxruntime_EXTERNAL_LIBRARIES debug Dbghelp) - else() -- list(APPEND onnxruntime_EXTERNAL_LIBRARIES nsync_cpp) -+ list(APPEND onnxruntime_EXTERNAL_LIBRARIES nsync::nsync_cpp) - list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${CMAKE_DL_LIBS} Threads::Threads) - endif() - ---- a/cmake/external/onnxruntime_external_deps.cmake -+++ b/cmake/external/onnxruntime_external_deps.cmake -@@ -237,7 +237,10 @@ if (NOT WIN32) - #nsync tests failed on Mac Build - set(NSYNC_ENABLE_TESTS OFF CACHE BOOL "" FORCE) - onnxruntime_fetchcontent_makeavailable(google_nsync) -- set(nsync_SOURCE_DIR ${google_nsync_SOURCE_DIR}) -+ if(google_nsync_SOURCE_DIR) -+ add_library(nsync::nsync_cpp ALIAS nsync_cpp) -+ target_include_directories(nsync_cpp PUBLIC ${google_nsync_SOURCE_DIR}/public) -+ endif() - endif() - - if(onnxruntime_USE_CUDA) -@@ -361,6 +364,12 @@ FetchContent_Declare( - - if (CPUINFO_SUPPORTED) - onnxruntime_fetchcontent_makeavailable(pytorch_cpuinfo) -+ if(pytorch_cpuinfo_SOURCE_DIR) -+ # shouldn't need to define these aliases after we use a version of cpuinfo with this commit: -+ # https://github.com/pytorch/cpuinfo/commit/082deffc80ce517f81dc2f3aebe6ba671fcd09c9 -+ add_library(cpuinfo::cpuinfo ALIAS cpuinfo) -+ add_library(cpuinfo::clog ALIAS clog) -+ endif() - endif() - - ---- a/cmake/onnxruntime_common.cmake -+++ b/cmake/onnxruntime_common.cmake -@@ -194,8 +194,8 @@ if (ARM64 OR ARM OR X86 OR X64 OR X86_64) - # Using it mainly in ARM with Android. - # 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) -- list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo clog) -+ onnxruntime_add_include_to_target(onnxruntime_common cpuinfo::cpuinfo) -+ list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo cpuinfo::clog) - endif() - endif() - endif() --- a/cmake/onnxruntime_flatbuffers.cmake +++ b/cmake/onnxruntime_flatbuffers.cmake @@ -9,7 +9,7 @@ file(GLOB onnxruntime_flatbuffers_srcs CONFIGURE_DEPENDS @@ -78,170 +9,3 @@ if(onnxruntime_ENABLE_INSTRUMENT) target_compile_definitions(onnxruntime_flatbuffers PUBLIC ONNXRUNTIME_ENABLE_INSTRUMENT) endif() ---- a/cmake/onnxruntime_providers.cmake -+++ b/cmake/onnxruntime_providers.cmake -@@ -539,10 +539,10 @@ if (onnxruntime_USE_CUDA) - - if(APPLE) - set_property(TARGET onnxruntime_providers_cuda APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker -exported_symbols_list ${ONNXRUNTIME_ROOT}/core/providers/cuda/exported_symbols.lst") -- target_link_libraries(onnxruntime_providers_cuda PRIVATE nsync_cpp) -+ target_link_libraries(onnxruntime_providers_cuda PRIVATE nsync::nsync_cpp) - elseif(UNIX) - set_property(TARGET onnxruntime_providers_cuda APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker --version-script=${ONNXRUNTIME_ROOT}/core/providers/cuda/version_script.lds -Xlinker --gc-sections") -- target_link_libraries(onnxruntime_providers_cuda PRIVATE nsync_cpp) -+ target_link_libraries(onnxruntime_providers_cuda PRIVATE nsync::nsync_cpp) - elseif(WIN32) - set_property(TARGET onnxruntime_providers_cuda APPEND_STRING PROPERTY LINK_FLAGS "-DEF:${ONNXRUNTIME_ROOT}/core/providers/cuda/symbols.def") - else() -@@ -595,10 +595,10 @@ if (onnxruntime_USE_DNNL) - INSTALL_RPATH "@loader_path" - BUILD_WITH_INSTALL_RPATH TRUE - INSTALL_RPATH_USE_LINK_PATH FALSE) -- target_link_libraries(onnxruntime_providers_dnnl PRIVATE nsync_cpp) -+ target_link_libraries(onnxruntime_providers_dnnl PRIVATE nsync::nsync_cpp) - elseif(UNIX) - set_property(TARGET onnxruntime_providers_dnnl APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker --version-script=${ONNXRUNTIME_ROOT}/core/providers/dnnl/version_script.lds -Xlinker --gc-sections -Xlinker -rpath=\$ORIGIN") -- target_link_libraries(onnxruntime_providers_dnnl PRIVATE nsync_cpp) -+ target_link_libraries(onnxruntime_providers_dnnl PRIVATE nsync::nsync_cpp) - elseif(WIN32) - set_property(TARGET onnxruntime_providers_dnnl APPEND_STRING PROPERTY LINK_FLAGS "-DEF:${ONNXRUNTIME_ROOT}/core/providers/dnnl/symbols.def") - else() -@@ -728,11 +728,11 @@ if (onnxruntime_USE_TENSORRT) - - if(APPLE) - set_property(TARGET onnxruntime_providers_tensorrt APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker -exported_symbols_list ${ONNXRUNTIME_ROOT}/core/providers/tensorrt/exported_symbols.lst") -- target_link_libraries(onnxruntime_providers_tensorrt PRIVATE nsync_cpp) -+ target_link_libraries(onnxruntime_providers_tensorrt PRIVATE nsync::nsync_cpp) - elseif(UNIX) - set_property(TARGET onnxruntime_providers_tensorrt APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations") - set_property(TARGET onnxruntime_providers_tensorrt APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker --version-script=${ONNXRUNTIME_ROOT}/core/providers/tensorrt/version_script.lds -Xlinker --gc-sections") -- target_link_libraries(onnxruntime_providers_tensorrt PRIVATE nsync_cpp stdc++fs) -+ target_link_libraries(onnxruntime_providers_tensorrt PRIVATE nsync::nsync_cpp stdc++fs) - elseif(WIN32) - set_property(TARGET onnxruntime_providers_tensorrt APPEND_STRING PROPERTY LINK_FLAGS "-DEF:${ONNXRUNTIME_ROOT}/core/providers/tensorrt/symbols.def") - else() -@@ -1224,7 +1224,7 @@ if (onnxruntime_USE_MIGRAPHX) - target_compile_options(onnxruntime_providers_migraphx PRIVATE -Wno-error=sign-compare) - set_property(TARGET onnxruntime_providers_migraphx APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations") - set_property(TARGET onnxruntime_providers_migraphx APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker --version-script=${ONNXRUNTIME_ROOT}/core/providers/migraphx/version_script.lds -Xlinker --gc-sections") -- target_link_libraries(onnxruntime_providers_migraphx PRIVATE nsync_cpp stdc++fs) -+ target_link_libraries(onnxruntime_providers_migraphx PRIVATE nsync::nsync_cpp stdc++fs) - - include(CheckLibraryExists) - check_library_exists(migraphx::c "migraphx_program_run_async" "/opt/rocm/migraphx/lib" HAS_STREAM_SYNC) -@@ -1461,7 +1461,7 @@ if (onnxruntime_USE_ROCM) - - if(UNIX) - set_property(TARGET onnxruntime_providers_rocm APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker --version-script=${ONNXRUNTIME_ROOT}/core/providers/rocm/version_script.lds -Xlinker --gc-sections") -- target_link_libraries(onnxruntime_providers_rocm PRIVATE nsync_cpp) -+ target_link_libraries(onnxruntime_providers_rocm PRIVATE nsync::nsync_cpp) - else() - message(FATAL_ERROR "onnxruntime_providers_rocm unknown platform, need to specify shared library exports for it") - endif() -@@ -1597,7 +1597,7 @@ if (onnxruntime_USE_CANN) - onnxruntime_add_include_to_target(onnxruntime_providers_cann onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 safeint_interface) - - add_dependencies(onnxruntime_providers_cann onnxruntime_providers_shared ${onnxruntime_EXTERNAL_DEPENDENCIES}) -- target_link_libraries(onnxruntime_providers_cann PRIVATE ascendcl acl_op_compiler fmk_onnx_parser nsync_cpp ${ABSEIL_LIBS} ${ONNXRUNTIME_PROVIDERS_SHARED}) -+ target_link_libraries(onnxruntime_providers_cann PRIVATE ascendcl acl_op_compiler fmk_onnx_parser nsync::nsync_cpp ${ABSEIL_LIBS} ${ONNXRUNTIME_PROVIDERS_SHARED}) - target_link_directories(onnxruntime_providers_cann PRIVATE ${onnxruntime_CANN_HOME}/lib64) - target_include_directories(onnxruntime_providers_cann PRIVATE ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR} ${eigen_INCLUDE_DIRS} ${onnxruntime_CANN_HOME} ${onnxruntime_CANN_HOME}/include) - -@@ -1619,7 +1619,7 @@ if (onnxruntime_USE_AZURE) - source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_azure_src}) - onnxruntime_add_static_library(onnxruntime_providers_azure ${onnxruntime_providers_azure_src}) - add_dependencies(onnxruntime_providers_azure ${onnxruntime_EXTERNAL_DEPENDENCIES}) -- onnxruntime_add_include_to_target(onnxruntime_providers_azure onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers Boost::mp11) -+ onnxruntime_add_include_to_target(onnxruntime_providers_azure onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11) - target_link_libraries(onnxruntime_providers_azure PRIVATE onnx onnxruntime_common onnxruntime_framework) - set_target_properties(onnxruntime_providers_azure PROPERTIES FOLDER "ONNXRuntime") - set_target_properties(onnxruntime_providers_azure PROPERTIES LINKER_LANGUAGE CXX) ---- a/cmake/onnxruntime_unittests.cmake -+++ b/cmake/onnxruntime_unittests.cmake -@@ -631,8 +631,8 @@ if(MSVC) - "$<$>:/wd6326>") - else() - target_compile_definitions(onnxruntime_test_utils PUBLIC -DNSYNC_ATOMIC_CPP11) -- target_include_directories(onnxruntime_test_utils PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT} -- ${nsync_SOURCE_DIR}/public) -+ target_include_directories(onnxruntime_test_utils PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT}) -+ onnxruntime_add_include_to_target(onnxruntime_test_utils nsync::nsync_cpp) - endif() - if (onnxruntime_USE_NCCL) - target_include_directories(onnxruntime_test_utils PRIVATE ${NCCL_INCLUDE_DIRS}) -@@ -665,8 +665,8 @@ if(MSVC) - "$<$>:/utf-8>") - else() - target_compile_definitions(onnx_test_runner_common PUBLIC -DNSYNC_ATOMIC_CPP11) -- target_include_directories(onnx_test_runner_common PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT} -- ${nsync_SOURCE_DIR}/public) -+ target_include_directories(onnx_test_runner_common PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT}) -+ onnxruntime_add_include_to_target(onnx_test_runner_common nsync::nsync_cpp) - endif() - if (MSVC AND NOT CMAKE_SIZEOF_VOID_P EQUAL 8) - #TODO: fix the warnings, they are dangerous -@@ -995,7 +995,7 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP) - # "Global initializer calls a non-constexpr function." BENCHMARK_CAPTURE macro needs this. - target_compile_options(onnxruntime_mlas_benchmark PRIVATE /wd26426) - else() -- target_link_libraries(onnxruntime_mlas_benchmark PRIVATE nsync_cpp ${CMAKE_DL_LIBS}) -+ target_link_libraries(onnxruntime_mlas_benchmark PRIVATE nsync::nsync_cpp ${CMAKE_DL_LIBS}) - endif() - if (CPUINFO_SUPPORTED AND NOT onnxruntime_BUILD_WEBASSEMBLY) - target_link_libraries(onnxruntime_mlas_benchmark PRIVATE cpuinfo) -@@ -1053,7 +1053,7 @@ if(onnxruntime_ENABLE_EAGER_MODE) - list(APPEND onnxruntime_eager_mode_libs onnxruntime_training tensorboard) - endif() - IF(NOT WIN32) -- list(APPEND onnxruntime_eager_mode_libs nsync_cpp) -+ list(APPEND onnxruntime_eager_mode_libs nsync::nsync_cpp) - endif() - target_link_libraries(onnxruntime_eager_mode_test PRIVATE ${onnxruntime_eager_mode_libs} Threads::Threads ${onnxruntime_EXTERNAL_LIBRARIES}) - if (onnxruntime_ENABLE_TRAINING_TORCH_INTEROP) -@@ -1113,7 +1113,7 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP) - ${onnxruntime_EXTERNAL_LIBRARIES} - ${GETOPT_LIB_WIDE} ${SYS_PATH_LIB} ${CMAKE_DL_LIBS}) - if(NOT WIN32) -- list(APPEND onnxruntime_perf_test_libs nsync_cpp) -+ list(APPEND onnxruntime_perf_test_libs nsync::nsync_cpp) - if(onnxruntime_USE_SNPE) - list(APPEND onnxruntime_perf_test_libs onnxruntime_providers_snpe) - endif() -@@ -1157,7 +1157,7 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP) - # test inference using shared lib - set(onnxruntime_shared_lib_test_LIBS onnxruntime_mocked_allocator onnxruntime_test_utils onnxruntime_common onnx_proto) - if(NOT WIN32) -- list(APPEND onnxruntime_shared_lib_test_LIBS nsync_cpp) -+ list(APPEND onnxruntime_shared_lib_test_LIBS nsync::nsync_cpp) - if(onnxruntime_USE_SNPE) - list(APPEND onnxruntime_shared_lib_test_LIBS onnxruntime_providers_snpe) - endif() -@@ -1279,7 +1279,7 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP) - target_link_libraries(onnxruntime_mlas_test PRIVATE cpuinfo) - endif() - if(NOT WIN32) -- target_link_libraries(onnxruntime_mlas_test PRIVATE nsync_cpp ${CMAKE_DL_LIBS}) -+ target_link_libraries(onnxruntime_mlas_test PRIVATE nsync::nsync_cpp ${CMAKE_DL_LIBS}) - endif() - if (CMAKE_SYSTEM_NAME STREQUAL "Android") - target_link_libraries(onnxruntime_mlas_test PRIVATE ${android_shared_libs}) ---- a/cmake/onnxruntime_webassembly.cmake -+++ b/cmake/onnxruntime_webassembly.cmake -@@ -97,7 +97,7 @@ target_compile_options(onnx PRIVATE -Wno-unused-parameter -Wno-unused-variable) - - if (onnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB) - bundle_static_library(onnxruntime_webassembly -- nsync_cpp -+ nsync::nsync_cpp - ${PROTOBUF_LIB} - onnx - onnx_proto -@@ -172,7 +172,7 @@ else() - endif() - - target_link_libraries(onnxruntime_webassembly PRIVATE -- nsync_cpp -+ nsync::nsync_cpp - ${PROTOBUF_LIB} - onnx - onnx_proto 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 deleted file mode 100644 index 6dbbfc4af9df4..0000000000000 --- a/recipes/onnxruntime/all/patches/1.14.1-0002-cmake-dependencies.patch +++ /dev/null @@ -1,166 +0,0 @@ -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..3c7cb77891 100644 ---- a/cmake/external/eigen.cmake -+++ b/cmake/external/eigen.cmake -@@ -14,8 +14,11 @@ 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}") -+ # 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 f85336e8bb..b051ff0be1 100644 ---- a/cmake/external/onnxruntime_external_deps.cmake -+++ b/cmake/external/onnxruntime_external_deps.cmake -@@ -97,7 +97,7 @@ FetchContent_Declare( - flatbuffers - URL ${DEP_URL_flatbuffers} - URL_HASH SHA1=${DEP_SHA1_flatbuffers} -- FIND_PACKAGE_ARGS 1.12.0...<2.0.0 NAMES Flatbuffers -+ FIND_PACKAGE_ARGS NAMES flatbuffers - ) - - #Here we support two build mode: -@@ -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) - -@@ -145,6 +146,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 "") -@@ -263,6 +265,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 -@@ -359,6 +362,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 - ) - - -@@ -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}) - - # XNNPACK EP - if (onnxruntime_USE_XNNPACK) -@@ -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) - --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..8b181871f9 100644 ---- a/cmake/external/wil.cmake -+++ b/cmake/external/wil.cmake -@@ -11,12 +11,18 @@ FetchContent_Declare( - ) - #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) -+#FetchContent_Populate(microsoft_wil) -+#if(NOT wil_FOUND) -+# add_library(WIL INTERFACE) -+# add_library(WIL::WIL ALIAS WIL) -+# -+# # The interface's include directory. -+# target_include_directories(WIL INTERFACE -+# $) -+#endif() -+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 7a99bac233..bbf1955494 100644 ---- a/cmake/onnxruntime_providers.cmake -+++ b/cmake/onnxruntime_providers.cmake -@@ -1561,10 +1561,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.15.1-0001-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch deleted file mode 100644 index 4ebc87b3a4ddc..0000000000000 --- a/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch +++ /dev/null @@ -1,150 +0,0 @@ -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.15.1-0002-fix-attention-15983.patch b/recipes/onnxruntime/all/patches/1.15.1-0002-fix-attention-15983.patch new file mode 100644 index 0000000000000..512fe43577ad8 --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.15.1-0002-fix-attention-15983.patch @@ -0,0 +1,11 @@ +--- a/onnxruntime/contrib_ops/cuda/bert/attention.cc ++++ b/onnxruntime/contrib_ops/cuda/bert/attention.cc +@@ -164,7 +164,7 @@ + has_memory_efficient_attention(sm, sizeof(T) == 2); + #else + constexpr bool use_memory_efficient_attention = false; +- ORT_UNUSED_VARIABLE(is_mask_1d_key_seq_len_start); ++ ORT_UNUSED_PARAMETER(is_mask_1d_key_seq_len_start); + #endif + + cublasHandle_t cublas = GetCublasHandle(context); 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 deleted file mode 100644 index dacb2b9b27a86..0000000000000 --- a/recipes/onnxruntime/all/patches/1.16.0-0001-cmake-dependencies.patch +++ /dev/null @@ -1,129 +0,0 @@ -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/all/patches/1.17.3-0001-patch-macos-cpp20-date-compat.patch b/recipes/onnxruntime/all/patches/1.17.3-0001-patch-macos-cpp20-date-compat.patch new file mode 100644 index 0000000000000..4f206c34e7538 --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.17.3-0001-patch-macos-cpp20-date-compat.patch @@ -0,0 +1,142 @@ +From 7303a90f4916dcf6f66236d40b8917344c27420a Mon Sep 17 00:00:00 2001 +From: Andrew Fantino <15876180+afantino951@users.noreply.github.com> +Date: Tue, 2 Apr 2024 22:10:25 -0700 +Subject: [PATCH] Fix build errors from date/date.h C++20 compatibility + (#20139) + +### Description +For C++ standards >= 20, use `std::chrono::operator<<` in place of +`date::operator<<` to fix ambiguous operator compile error. + +### Motivation and Context +The external dependency HowardHinnant/date has a conflict with +std::chrono for >=C++20. +Solves #20137 +--- + cmake/onnxruntime_common.cmake | 2 +- + include/onnxruntime/core/common/logging/logging.h | 11 +++++++++++ + onnxruntime/core/common/logging/sinks/ostream_sink.cc | 3 +-- + .../core/platform/apple/logging/apple_log_sink.mm | 2 +- + onnxruntime/test/common/logging/helpers.h | 3 +-- + onnxruntime/test/util/include/test/capturing_sink.h | 4 +--- + 6 files changed, 16 insertions(+), 9 deletions(-) + +diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake +index fb56e3f3445d..69d8f5fa138c 100644 +--- a/cmake/onnxruntime_common.cmake ++++ b/cmake/onnxruntime_common.cmake +@@ -129,7 +129,7 @@ target_include_directories(onnxruntime_common + ${OPTIONAL_LITE_INCLUDE_DIR}) + + +-target_link_libraries(onnxruntime_common PUBLIC safeint_interface ${GSL_TARGET} ${ABSEIL_LIBS}) ++target_link_libraries(onnxruntime_common PUBLIC safeint_interface ${GSL_TARGET} ${ABSEIL_LIBS} date::date) + + add_dependencies(onnxruntime_common ${onnxruntime_EXTERNAL_DEPENDENCIES}) + +diff --git a/include/onnxruntime/core/common/logging/logging.h b/include/onnxruntime/core/common/logging/logging.h +index 2b9912ea7738..f62053a5e44a 100644 +--- a/include/onnxruntime/core/common/logging/logging.h ++++ b/include/onnxruntime/core/common/logging/logging.h +@@ -18,6 +18,8 @@ + + #include "core/common/logging/macros.h" + ++#include "date/date.h" ++ + /* + + Logging overview and expected usage: +@@ -56,6 +58,15 @@ namespace logging { + + using Timestamp = std::chrono::time_point; + ++// TODO: When other compilers support std::chrono::operator<<, update this. ++// TODO: Check support for other compilers' version before enable C++20 for other compilers. ++// Xcode added support for C++20's std::chrono::operator<< in SDK version 14.4. ++#if __cplusplus >= 202002L && __MAC_OS_X_VERSION_MAX_ALLOWED >= 140400L ++namespace timestamp_ns = std::chrono; ++#else ++namespace timestamp_ns = ::date; ++#endif ++ + #ifndef NDEBUG + ORT_ATTRIBUTE_UNUSED static bool vlog_enabled = true; // Set directly based on your needs. + #else +diff --git a/onnxruntime/core/common/logging/sinks/ostream_sink.cc b/onnxruntime/core/common/logging/sinks/ostream_sink.cc +index 0db3d8709d48..a120138d1d15 100644 +--- a/onnxruntime/core/common/logging/sinks/ostream_sink.cc ++++ b/onnxruntime/core/common/logging/sinks/ostream_sink.cc +@@ -2,7 +2,6 @@ + // Licensed under the MIT License. + + #include "core/common/logging/sinks/ostream_sink.h" +-#include "date/date.h" + + namespace onnxruntime { + namespace logging { +@@ -24,7 +23,7 @@ struct Color { + + void OStreamSink::SendImpl(const Timestamp& timestamp, const std::string& logger_id, const Capture& message) { + // operator for formatting of timestamp in ISO8601 format including microseconds +- using date::operator<<; ++ using timestamp_ns::operator<<; + + // Two options as there may be multiple calls attempting to write to the same sink at once: + // 1) Use mutex to synchronize access to the stream. +diff --git a/onnxruntime/core/platform/apple/logging/apple_log_sink.mm b/onnxruntime/core/platform/apple/logging/apple_log_sink.mm +index 8dbd8eecd0e7..78614ffd2819 100644 +--- a/onnxruntime/core/platform/apple/logging/apple_log_sink.mm ++++ b/onnxruntime/core/platform/apple/logging/apple_log_sink.mm +@@ -13,7 +13,7 @@ + namespace logging { + + void AppleLogSink::SendImpl(const Timestamp& timestamp, const std::string& logger_id, const Capture& message) { +- using date::operator<<; ++ using timestamp_ns::operator<<; + std::ostringstream msg; + msg << timestamp << " [" << message.SeverityPrefix() << ":" << message.Category() << ":" << logger_id << ", " + << message.Location().ToString() << "] " << message.Message(); +diff --git a/onnxruntime/test/common/logging/helpers.h b/onnxruntime/test/common/logging/helpers.h +index c8d027022850..7fd03b72e53a 100644 +--- a/onnxruntime/test/common/logging/helpers.h ++++ b/onnxruntime/test/common/logging/helpers.h +@@ -5,7 +5,6 @@ + + #include + +-#include "date/date.h" + #include "gmock/gmock.h" + #include "gtest/gtest.h" + +@@ -30,7 +29,7 @@ class MockSink : public ::onnxruntime::logging::ISink { + #endif + + ACTION(PrintArgs) { +- using date::operator<<; ++ using onnxruntime::logging::timestamp_ns::operator<<; + + // const Timestamp ×tamp, const std::string &logger_id, const Message &message + // arg0 arg1 arg2 +diff --git a/onnxruntime/test/util/include/test/capturing_sink.h b/onnxruntime/test/util/include/test/capturing_sink.h +index 39788947602d..7d978d1bd1e5 100644 +--- a/onnxruntime/test/util/include/test/capturing_sink.h ++++ b/onnxruntime/test/util/include/test/capturing_sink.h +@@ -6,8 +6,6 @@ + #include "core/common/logging/logging.h" + #include "core/common/logging/isink.h" + +-#include "date/date.h" +- + namespace onnxruntime { + namespace test { + +@@ -17,7 +15,7 @@ class CapturingSink : public logging::ISink { + public: + void SendImpl(const Timestamp& timestamp, const std::string& logger_id, const Capture& message) override { + // operator for formatting of timestamp in ISO8601 format including microseconds +- using date::operator<<; ++ using timestamp_ns::operator<<; + std::ostringstream msg; + + msg << timestamp << " [" << message.SeverityPrefix() << ":" << message.Category() << ":" << logger_id << ", " diff --git a/recipes/onnxruntime/all/patches/1.17.3-0002-missing-include.patch b/recipes/onnxruntime/all/patches/1.17.3-0002-missing-include.patch new file mode 100644 index 0000000000000..d3555681e4af9 --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.17.3-0002-missing-include.patch @@ -0,0 +1,12 @@ +diff --git a/include/onnxruntime/core/graph/graph.h b/include/onnxruntime/core/graph/graph.h +index 22827d43b2..f9e5fd56d3 100644 +--- a/include/onnxruntime/core/graph/graph.h ++++ b/include/onnxruntime/core/graph/graph.h +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/recipes/onnxruntime/all/patches/1.17.3-0003-fix-cutlass-cuda-provider.patch b/recipes/onnxruntime/all/patches/1.17.3-0003-fix-cutlass-cuda-provider.patch new file mode 100644 index 0000000000000..8ea3d51071e51 --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.17.3-0003-fix-cutlass-cuda-provider.patch @@ -0,0 +1,15 @@ +diff --git a/cmake/onnxruntime_providers_cuda.cmake b/cmake/onnxruntime_providers_cuda.cmake +index b5c3100865..129c4f19f6 100644 +--- a/cmake/onnxruntime_providers_cuda.cmake ++++ b/cmake/onnxruntime_providers_cuda.cmake +@@ -180,8 +180,8 @@ + target_link_libraries(${target} PRIVATE CUDA::cuda_driver) + endif() + +- include(cutlass) +- target_include_directories(${target} PRIVATE ${cutlass_SOURCE_DIR}/include ${cutlass_SOURCE_DIR}/examples) ++ find_package(NvidiaCutlass) ++ target_link_libraries(${target} PRIVATE nvidia::cutlass::cutlass) + + target_include_directories(${target} PRIVATE ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR} ${eigen_INCLUDE_DIRS} ${TVM_INCLUDES} + PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) diff --git a/recipes/onnxruntime/all/patches/1.18.0-0004-abseil-no-string-view.patch b/recipes/onnxruntime/all/patches/1.18.0-0004-abseil-no-string-view.patch new file mode 100644 index 0000000000000..329024e7245ef --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.18.0-0004-abseil-no-string-view.patch @@ -0,0 +1,22 @@ +--- a/onnxruntime/core/framework/kernel_type_str_resolver.cc ++++ b/onnxruntime/core/framework/kernel_type_str_resolver.cc +@@ -46,7 +46,7 @@ + ORT_RETURN_IF(op_it == op_kernel_type_str_map_.end(), "Failed to find op_id: ", op_id); + const auto& type_str_map = op_it->second; + +-#ifdef DISABLE_ABSEIL ++#ifndef ABSL_USES_STD_STRING_VIEW + // TODO(edgchen1) maybe we can use transparent hash/eq to enable lookup with string_view + const auto type_str_it = type_str_map.find(std::string(kernel_type_str)); + #else +--- a/onnxruntime/core/framework/ort_value_name_idx_map.h ++++ b/onnxruntime/core/framework/ort_value_name_idx_map.h +@@ -33,7 +33,7 @@ class OrtValueNameIdxMap { + common::Status GetIdx(std::string_view name, int& idx) const { + idx = -1; + +-#ifdef DISABLE_ABSEIL ++#ifndef ABSL_USES_STD_STRING_VIEW + auto it = map_.find(std::string(name)); + #else + auto it = map_.find(name); diff --git a/recipes/onnxruntime/all/patches/1.18.1-0005-fix-cutlass-cuda-provider.patch b/recipes/onnxruntime/all/patches/1.18.1-0005-fix-cutlass-cuda-provider.patch new file mode 100644 index 0000000000000..3024bfb1f7bb6 --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.18.1-0005-fix-cutlass-cuda-provider.patch @@ -0,0 +1,15 @@ +diff --git a/cmake/onnxruntime_providers_cuda.cmake b/cmake/onnxruntime_providers_cuda.cmake +index 1346a9ce96..f40661d4bd 100644 +--- a/cmake/onnxruntime_providers_cuda.cmake ++++ b/cmake/onnxruntime_providers_cuda.cmake +@@ -211,8 +211,8 @@ + target_link_libraries(${target} PRIVATE CUDA::cuda_driver) + endif() + +- include(cutlass) +- target_include_directories(${target} PRIVATE ${cutlass_SOURCE_DIR}/include ${cutlass_SOURCE_DIR}/examples ${cutlass_SOURCE_DIR}/tools/util/include) ++ find_package(NvidiaCutlass) ++ target_link_libraries(${target} PRIVATE nvidia::cutlass::cutlass) + + target_include_directories(${target} PRIVATE ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR} ${eigen_INCLUDE_DIRS} ${TVM_INCLUDES} + PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) diff --git a/recipes/onnxruntime/all/test_package/CMakeLists.txt b/recipes/onnxruntime/all/test_package/CMakeLists.txt index b5d8ccbfcd52c..483ebf5ead1ee 100644 --- a/recipes/onnxruntime/all/test_package/CMakeLists.txt +++ b/recipes/onnxruntime/all/test_package/CMakeLists.txt @@ -5,5 +5,8 @@ project(test_package CXX) find_package(onnxruntime REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) +if(WITH_CUDA) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_CUDA) +endif() target_link_libraries(${PROJECT_NAME} PRIVATE onnxruntime::onnxruntime) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/onnxruntime/all/test_package/conanfile.py b/recipes/onnxruntime/all/test_package/conanfile.py index 18016812d8c7e..17284808fb050 100644 --- a/recipes/onnxruntime/all/test_package/conanfile.py +++ b/recipes/onnxruntime/all/test_package/conanfile.py @@ -1,13 +1,14 @@ 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 +from conan.tools.files import copy import os # 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): @@ -15,6 +16,15 @@ def requirements(self): def layout(self): cmake_layout(self, src_folder=".") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["WITH_CUDA"] = self.dependencies["onnxruntime"].options.with_cuda + tc.generate() + if self.settings.os == "Windows": + # on windows the system dll C:\WINDOWS\system32\onnxruntime.dll may be loaded instead even if the conan lib is first in the PATH, see https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order + for bindir in self.dependencies[self.tested_reference_str].cpp_info.bindirs: + copy(self, "*.dll", bindir, os.path.join(self.build_folder, str(self.settings.build_type))) def build(self): cmake = CMake(self) @@ -23,5 +33,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/onnxruntime/all/test_package/test_package.cpp b/recipes/onnxruntime/all/test_package/test_package.cpp index a9cc6b11cef74..09281241c4ad8 100644 --- a/recipes/onnxruntime/all/test_package/test_package.cpp +++ b/recipes/onnxruntime/all/test_package/test_package.cpp @@ -2,8 +2,22 @@ #include #include +#ifdef WITH_CUDA +#include +#endif + int main() { const auto& api = Ort::GetApi(); - std::cout << OrtGetApiBase()->GetVersionString() << std::endl; + std::cout << "Version: " << OrtGetApiBase()->GetVersionString() << std::endl; + std::cout << "Providers: " << std::endl; + for(const auto& provider: Ort::GetAvailableProviders()) + std::cout << provider << ", " << std::endl; + +#ifdef WITH_CUDA + Ort::SessionOptions session_options; + OrtSessionOptionsAppendExecutionProvider_CUDA(session_options, 1); + std::cout << "with cuda!" << std::endl; +#endif + return 0; } diff --git a/recipes/onnxruntime/all/test_v1_package/CMakeLists.txt b/recipes/onnxruntime/all/test_v1_package/CMakeLists.txt index 0d20897301b68..691d35acd08dc 100644 --- a/recipes/onnxruntime/all/test_v1_package/CMakeLists.txt +++ b/recipes/onnxruntime/all/test_v1_package/CMakeLists.txt @@ -4,5 +4,19 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) +find_package(onnxruntime REQUIRED CONFIG) +add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/../test_package/test_package.cpp) +if(WITH_CUDA) + target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_CUDA) +endif() + +target_link_libraries(${PROJECT_NAME} PRIVATE onnxruntime::onnxruntime) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +if(WIN32 AND DEFINED CONAN_BIN_DIRS_ONNXRUNTIME AND EXISTS ${CONAN_BIN_DIRS_ONNXRUNTIME}) + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CONAN_BIN_DIRS_ONNXRUNTIME} + $ + ) +endif() diff --git a/recipes/onnxruntime/config.yml b/recipes/onnxruntime/config.yml index 7dfea6fd99cd4..497cb76cea1d7 100644 --- a/recipes/onnxruntime/config.yml +++ b/recipes/onnxruntime/config.yml @@ -1,11 +1,9 @@ versions: - "1.16.3": - folder: all - "1.16.2": + "1.18.1": folder: all - "1.16.1": + "1.17.3": folder: all - "1.16.0": + "1.16.3": folder: all "1.15.1": folder: all diff --git a/recipes/open-dis-cpp/all/conandata.yml b/recipes/open-dis-cpp/all/conandata.yml index 02787c5993558..10ba5e5143140 100644 --- a/recipes/open-dis-cpp/all/conandata.yml +++ b/recipes/open-dis-cpp/all/conandata.yml @@ -2,3 +2,6 @@ sources: "1.0.1": url: "https://github.com/open-dis/open-dis-cpp/archive/refs/tags/v1.0.1.tar.gz" sha256: "c8c899aa3553da898f586c31e1b34512a448921a77bd15fc2611c0b1a7ce49b2" + "1.1.0": + url: "https://github.com/open-dis/open-dis-cpp/archive/refs/tags/v1.1.0.tar.gz" + sha256: "1c33220152ff6c303b8f84da4f80b28cde86f2df4303651183d3fa6dfcb74fc9" \ No newline at end of file diff --git a/recipes/open-dis-cpp/all/conanfile.py b/recipes/open-dis-cpp/all/conanfile.py index b00b3d36a279f..f5ceb66b8a99f 100644 --- a/recipes/open-dis-cpp/all/conanfile.py +++ b/recipes/open-dis-cpp/all/conanfile.py @@ -1,13 +1,13 @@ import os from conan import ConanFile +from conan.errors import ConanException 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.layout import basic_layout +from conan.tools.files import copy, get, rmdir from conan.tools.build import check_min_cppstd from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class OpenDisConan(ConanFile): @@ -17,6 +17,7 @@ class OpenDisConan(ConanFile): topics = ("library","protocol","simulation-framework","dis") url = "https://github.com/conan-io/conan-center-index" license = "BSD-2-Clause" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -27,13 +28,13 @@ class OpenDisConan(ConanFile): "fPIC": True } - def export_sources(self): - export_conandata_patches(self) - def generate(self): tc = CMakeToolchain(self) tc.cache_variables["BUILD_EXAMPLES"] = "FALSE" tc.cache_variables["BUILD_TESTS"] = "FALSE" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.1.0": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def layout(self): @@ -56,7 +57,6 @@ def source(self): destination=self.source_folder, strip_root=True) def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -79,16 +79,7 @@ def package_info(self): self.cpp_info.components["OpenDIS6"].libs = ["OpenDIS6"] self.cpp_info.components["OpenDIS7"].libs = ["OpenDIS7"] - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "OpenDIS" - self.cpp_info.filenames["cmake_find_package_multi"] = "OpenDIS" - self.cpp_info.names["cmake_find_package"] = "OpenDIS" - self.cpp_info.names["cmake_find_package_multi"] = "OpenDIS" - self.cpp_info.components["OpenDIS6"].names["cmake_find_package"] = "OpenDIS6" - self.cpp_info.components["OpenDIS6"].names["cmake_find_package_multi"] = "OpenDIS6" self.cpp_info.components["OpenDIS6"].set_property("cmake_target_name", "OpenDIS::OpenDIS6") self.cpp_info.components["OpenDIS6"].set_property("cmake_target_aliases", ["OpenDIS::DIS6","OpenDIS6"]) - self.cpp_info.components["OpenDIS7"].names["cmake_find_package"] = "OpenDIS7" - self.cpp_info.components["OpenDIS7"].names["cmake_find_package_multi"] = "OpenDIS7" self.cpp_info.components["OpenDIS7"].set_property("cmake_target_name", "OpenDIS::OpenDIS7") self.cpp_info.components["OpenDIS7"].set_property("cmake_target_aliases", ["OpenDIS::DIS7","OpenDIS7"]) diff --git a/recipes/open-dis-cpp/all/test_package/conanfile.py b/recipes/open-dis-cpp/all/test_package/conanfile.py index eb28dfa80ed5b..859d1a94cc7ef 100644 --- a/recipes/open-dis-cpp/all/test_package/conanfile.py +++ b/recipes/open-dis-cpp/all/test_package/conanfile.py @@ -1,6 +1,6 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.cmake import CMake from conan.tools.build import can_run from conan.tools.cmake import cmake_layout diff --git a/recipes/open-dis-cpp/all/test_v1_package/CMakeLists.txt b/recipes/open-dis-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/open-dis-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/open-dis-cpp/all/test_v1_package/conanfile.py b/recipes/open-dis-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 8651492935b32..0000000000000 --- a/recipes/open-dis-cpp/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_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_dis6"), run_environment=True) - self.run(os.path.join("bin", "test_package_dis7"), run_environment=True) diff --git a/recipes/open-dis-cpp/config.yml b/recipes/open-dis-cpp/config.yml index 715e55357a17b..cf5a26eafcd7d 100644 --- a/recipes/open-dis-cpp/config.yml +++ b/recipes/open-dis-cpp/config.yml @@ -1,3 +1,5 @@ versions: "1.0.1": folder: all + "1.1.0": + folder: all diff --git a/recipes/open-simulation-interface/all/test_v1_package/CMakeLists.txt b/recipes/open-simulation-interface/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/open-simulation-interface/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/open-simulation-interface/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", "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 41d18d560523a..eb6be5e0921c2 100644 --- a/recipes/open62541/all/conandata.yml +++ b/recipes/open62541/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.4.6": + url: "https://github.com/open62541/open62541/archive/v1.4.6.tar.gz" + sha256: "bc4ad185fec5c257e15fcb813b7fef9607b7aaa5d355de7b665e1f210556d38e" + "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" @@ -12,6 +18,20 @@ sources: url: "https://github.com/open62541/open62541/archive/v1.0.6.tar.gz" sha256: "299940025c14929533064abe0044d5805ea50d52b32d05ad9bc0e6996569c2a6" patches: + "1.4.6": + - patch_file: "patches/0001-disable-sanitizers-1_4_x.patch" + patch_description: "Disable static code analysis" + patch_type: "conan" + - patch_file: "patches/1.4.6-0001-use-external-mdnsd.patch" + patch_description: "Consume mdnsd as external dependency provided by Conan" + patch_type: "conan" + - patch_file: "patches/0004-include-iphlpapi.patch" + patch_description: "Include iphlpapi.h for SecureZeroMemory" + patch_type: "conan" + "1.3.9": + - patch_file: "patches/0001-disable-sanitizers-1_3_x.patch" + patch_description: "Disable static code analysis" + patch_type: "conan" "1.3.8": - patch_file: "patches/0001-disable-sanitizers-1_3_x.patch" patch_description: "Disable static code analysis" diff --git a/recipes/open62541/all/conanfile.py b/recipes/open62541/all/conanfile.py index 2321b74998973..456510bc92860 100644 --- a/recipes/open62541/all/conanfile.py +++ b/recipes/open62541/all/conanfile.py @@ -12,9 +12,6 @@ class Open62541Conan(ConanFile): name = "open62541" - 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 " \ "(OPC Unified Architecture) written in the common subset of the " \ "C99 and C++98 languages. The library is usable with all major " \ @@ -23,6 +20,9 @@ class Open62541Conan(ConanFile): "into existing applications. open62541 library is platform independent. " \ "All platform-specific functionality is implemented via exchangeable " \ "plugins. Plugin implementations are provided for the major operating systems." + license = ("MPL-2.0", "CC0-1.0") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://open62541.org/" topics = ( "opc ua", "sdk", "server/client", "c", "iec-62541", "industrial automation", "tsn", "time sensitive networks", "publish-subscirbe", "pubsub" @@ -161,11 +161,6 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") - # Due to https://github.com/open62541/open62541/issues/4687 we cannot build with 1.2.2 + Windows + shared - if Version(self.version) >= "1.2.2" and self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration( - f"{self.ref} doesn't properly support shared lib on Windows") - if self.options.subscription == "With Events": # Deprecated in 1.2.2 self.output.warning( @@ -229,17 +224,20 @@ def validate(self): raise ConanInvalidConfiguration( "PubSub over Ethernet is not supported for your OS!") + # Due to https://github.com/open62541/open62541/issues/4687 we cannot build with 1.2.2 + Windows + shared + if Version(self.version) >= "1.2.2" and self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} doesn't properly support shared lib on Windows") + if self.options.web_socket: if self.options["libwebsockets"].with_ssl != self.options.encryption: raise ConanInvalidConfiguration( "When web_socket is enabled, libwebsockets:with_ssl must have the value of open62541:encryption") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - submodule_filename = os.path.join( - self.recipe_folder, 'submoduledata.yml') + submodule_filename = os.path.join(self.recipe_folder, 'submoduledata.yml') 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(): @@ -327,6 +325,7 @@ def generate(self): tc.variables["UA_ENABLE_ENCRYPTION_OPENSSL"] = True tc.variables["UA_ENABLE_JSON_ENCODING"] = self.options.json_support + tc.variables["UA_ENABLE_PUBSUB_INFORMATIONMODEL"] = self.options.pub_sub != False tc.variables["UA_ENABLE_PUBSUB"] = self.options.pub_sub != False tc.variables["UA_ENABLE_PUBSUB_ENCRYPTION"] = self.options.pub_sub_encryption != False @@ -359,6 +358,7 @@ def generate(self): tc.generate() tc = CMakeDeps(self) + tc.set_property("mbedtls", "cmake_additional_variables_prefixes", ["MBEDTLS"]) tc.generate() def _patch_sources(self): @@ -431,15 +431,18 @@ def package_info(self): else: self.cpp_info.includedirs.append( 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 Version(self.version) < "1.4.0": + 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") + if Version(self.version) >= "1.4.6": + self.cpp_info.system_libs.append("iphlpapi") elif self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs.extend(["pthread", "m", "rt"]) @@ -451,4 +454,3 @@ 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_4_x.patch b/recipes/open62541/all/patches/0001-disable-sanitizers-1_4_x.patch new file mode 100644 index 0000000000000..841418b28bf86 --- /dev/null +++ b/recipes/open62541/all/patches/0001-disable-sanitizers-1_4_x.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c18a457..951efe4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -666,18 +666,18 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") + set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # cmake sets -rdynamic by default + + # Debug +- if(UA_ENABLE_DEBUG_SANITIZER AND BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX AND NOT UA_BUILD_OSS_FUZZ AND +- CMAKE_C_COMPILER_ID STREQUAL "Clang" 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 AND 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(UA_ENABLE_DEBUG_SANITIZER AND BUILD_TYPE_LOWER_CASE STREQUAL "debug" AND UNIX AND NOT UA_BUILD_OSS_FUZZ AND ++ # CMAKE_C_COMPILER_ID STREQUAL "Clang" 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 AND 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/0004-include-iphlpapi.patch b/recipes/open62541/all/patches/0004-include-iphlpapi.patch new file mode 100644 index 0000000000000..4af83a9e4709b --- /dev/null +++ b/recipes/open62541/all/patches/0004-include-iphlpapi.patch @@ -0,0 +1,15 @@ +diff --git a/src/ua_util.c b/src/ua_util.c +index 13eb0fb..d832f0a 100644 +--- a/src/ua_util.c ++++ b/src/ua_util.c +@@ -11,6 +11,10 @@ + * unit for the generated code from UA_INLINABLE definitions. */ + #define UA_INLINABLE_IMPL 1 + ++#if defined(_WIN32) ++# include ++# include ++#endif + #include + #include + diff --git a/recipes/open62541/all/patches/1.4.6-0001-use-external-mdnsd.patch b/recipes/open62541/all/patches/1.4.6-0001-use-external-mdnsd.patch new file mode 100644 index 0000000000000..5362a442a3edf --- /dev/null +++ b/recipes/open62541/all/patches/1.4.6-0001-use-external-mdnsd.patch @@ -0,0 +1,94 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c18a457aa..f35558821 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -749,23 +735,7 @@ file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated") + configure_file(include/open62541/config.h.in ${PROJECT_BINARY_DIR}/src_generated/open62541/config.h) + + 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 +- if (APPLE) +- add_library(libmdnsd INTERFACE ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h) +- else() +- add_library(libmdnsd ${PROJECT_SOURCE_DIR}/deps/mdnsd/libmdnsd/mdnsd.h) +- endif() +- +- set_property(TARGET libmdnsd PROPERTY LINKER_LANGUAGE C) +- 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 REQUIRED) + endif() + + # Exported headers +@@ -942,19 +912,8 @@ 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 +- list(APPEND lib_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) +- list(APPEND lib_sources +- ${PROJECT_SOURCE_DIR}/src/server/ua_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) ++ set(lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_discovery_mdns.c ++ ${lib_sources}) + endif() + + if(UA_BUILD_FUZZING OR UA_BUILD_OSS_FUZZ) +@@ -1361,6 +1320,14 @@ else() + + add_library(open62541 $ $) + ++ if(UA_ENABLE_DISCOVERY_MULTICAST) ++ target_include_directories(open62541-object PUBLIC ${mdnsd_INCLUDE_DIRS}) ++ endif() ++ ++ if(UA_ENABLE_DISCOVERY_MULTICAST) ++ list(APPEND open62541_LIBRARIES mdnsd::mdnsd) ++ endif() ++ + if(UA_ENABLE_ENCRYPTION_LIBRESSL) + # Prevent Wincrypt override warning. + target_compile_definitions(open62541-plugins PUBLIC NOCRYPT=1) +diff --git a/src/server/ua_discovery.h b/src/server/ua_discovery.h +index b0031c732..154ba32cd 100644 +--- a/src/server/ua_discovery.h ++++ b/src/server/ua_discovery.h +@@ -44,7 +44,7 @@ typedef struct { + + #ifdef UA_ENABLE_DISCOVERY_MULTICAST + +-#include "mdnsd/libmdnsd/mdnsd.h" ++#include "libmdnsd/mdnsd.h" + #define UA_MAXMDNSRECVSOCKETS 8 + + /** +diff --git a/src/server/ua_discovery_mdns.c b/src/server/ua_discovery_mdns.c +index c53abd4d3..33cb34c85 100644 +--- a/src/server/ua_discovery_mdns.c ++++ b/src/server/ua_discovery_mdns.c +@@ -13,8 +13,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 + + #include "../deps/mp_printf.h" \ No newline at end of file diff --git a/recipes/open62541/all/submoduledata.yml b/recipes/open62541/all/submoduledata.yml index 1de1304b65b1e..ec323bcad9aa0 100644 --- a/recipes/open62541/all/submoduledata.yml +++ b/recipes/open62541/all/submoduledata.yml @@ -1,21 +1,31 @@ submodules: - "1.0.6": + "1.4.6": deps/ua-nodeset: - sha256: c9c0228ce640bf4eead31b9c0b5b7190bc197a2d393a8e90328d14cb45805637 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/UA-1.04.8-2020-11-20.zip + url: "https://github.com/OPCFoundation/UA-Nodeset/archive/Machinery-1.03.0-2023-08-01.zip" + sha256: "b1677e7114004f44103159ae7a2fb220958e6f645177c9d140f6acfe469b8eb8" archive_pattern: "UA-Nodeset-{version}" - "1.1.6": + "1.3.9": + deps/ua-nodeset: + url: "https://github.com/OPCFoundation/UA-Nodeset/archive/Glass=1.0.0-2022-01-01.zip" + sha256: "032c93e3f7c335bbb2d2d699804a804c9cdce2a2ecc3fe7cde552f2130982c26" + archive_pattern: "UA-Nodeset-{version}" + "1.3.8": deps/ua-nodeset: - sha256: a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip + url: "https://github.com/OPCFoundation/UA-Nodeset/archive/Glass=1.0.0-2022-01-01.zip" + sha256: "032c93e3f7c335bbb2d2d699804a804c9cdce2a2ecc3fe7cde552f2130982c26" 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 + url: "https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip" + sha256: "a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562" archive_pattern: "UA-Nodeset-{version}" - "1.3.8": + "1.1.6": + deps/ua-nodeset: + url: "https://github.com/OPCFoundation/UA-Nodeset/archive/Errata-1.04.5.zip" + sha256: "a2bcc1cda0154091ecbed25b8c40436c5b75d11bb38df28b35a2ceedb331d562" + archive_pattern: "UA-Nodeset-{version}" + "1.0.6": deps/ua-nodeset: - sha256: 032c93e3f7c335bbb2d2d699804a804c9cdce2a2ecc3fe7cde552f2130982c26 - url: https://github.com/OPCFoundation/UA-Nodeset/archive/Glass=1.0.0-2022-01-01.zip + url: "https://github.com/OPCFoundation/UA-Nodeset/archive/UA-1.04.8-2020-11-20.zip" + sha256: "c9c0228ce640bf4eead31b9c0b5b7190bc197a2d393a8e90328d14cb45805637" archive_pattern: "UA-Nodeset-{version}" diff --git a/recipes/open62541/all/test_package/CMakeLists.txt b/recipes/open62541/all/test_package/CMakeLists.txt index 099ba922c1149..09acbbf05256d 100644 --- a/recipes/open62541/all/test_package/CMakeLists.txt +++ b/recipes/open62541/all/test_package/CMakeLists.txt @@ -1,34 +1,7 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) find_package(open62541 REQUIRED CONFIG) -find_package(Threads REQUIRED) -find_package(Python3 REQUIRED) -set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) - -# Output directory for Nodeset Compiler -set(GENERATE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/src_generated/") -file(MAKE_DIRECTORY "${GENERATE_OUTPUT_DIR}") -include_directories("${GENERATE_OUTPUT_DIR}") -ua_generate_nodeset_and_datatypes( - NAME "foo_flt" - TARGET_PREFIX "${PROJECT_NAME}" - FILE_CSV "${PROJECT_SOURCE_DIR}/FooFltModel.csv" - FILE_BSD "${PROJECT_SOURCE_DIR}/FooFlt.Types.bsd" - OUTPUT_DIR "${GENERATE_OUTPUT_DIR}" - NAMESPACE_IDX 2 # This namespace index must match the order in which you are adding the nodeset in the source code - NAMESPACE_MAP "2:https://new.foo.com/zebra-compression/flattening-and-subspacefolding/UA/" - FILE_NS "${PROJECT_SOURCE_DIR}/FooFlt.NodeSet2.xml" - INTERNAL -) -# Previous macro automatically sets some variables which hold the generated source code files using the provided NAME -add_executable(${PROJECT_NAME} - ${UA_NODESET_FOO_FLT_SOURCES} - ${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) +add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE open62541::open62541) diff --git a/recipes/open62541/all/test_package/FooFlt.NodeSet2.xml b/recipes/open62541/all/test_package/FooFlt.NodeSet2.xml deleted file mode 100644 index a1c445aebf528..0000000000000 --- a/recipes/open62541/all/test_package/FooFlt.NodeSet2.xml +++ /dev/null @@ -1,282 +0,0 @@ - - - - https://new.foo.com/zebra-compression/flattening-and-subspacefolding/UA/ - - - - - - - - i=1 - i=2 - i=3 - i=4 - i=5 - i=6 - i=7 - i=8 - i=9 - i=10 - i=11 - i=13 - i=12 - i=15 - i=14 - i=16 - i=17 - i=18 - i=20 - i=21 - i=19 - i=22 - i=26 - i=27 - i=28 - i=47 - i=46 - i=35 - i=36 - i=48 - i=45 - i=40 - i=37 - i=38 - i=39 - - - ApeType - The Automatic Surface Tabulator. It represents a single hardware unit. - - ns=1;i=2 - ns=1;i=3 - ns=1;i=4 - i=58 - - - - Name - - i=68 - i=78 - ns=1;i=1 - - - - Number - - i=68 - i=78 - ns=1;i=1 - - - - MyVariable - - ns=1;i=8 - i=2368 - i=78 - ns=1;i=1 - - - - EURange - - i=68 - i=78 - ns=1;i=4 - - - - FooAnalogItemType - - i=2368 - - - - TestDataType - - i=22 - - - - - - - Ape - Instance of the APE. - - ns=1;i=18 - ns=1;i=19 - ns=1;i=20 - i=85 - ns=1;i=1 - - - - Name - - i=68 - ns=1;i=17 - - - - Number - - i=68 - ns=1;i=17 - - - - MyVariable - - ns=1;i=24 - i=2368 - ns=1;i=17 - - - - EURange - - i=68 - ns=1;i=20 - - - - Default Binary - - ns=1;i=16 - ns=1;i=31 - i=76 - - - - FooFlt - - ns=1;i=29 - ns=1;i=30 - ns=1;i=31 - i=93 - i=72 - - - PG9wYzpUeXBlRGljdGlvbmFyeQ0KICB4bWxuczpvcGM9Imh0dHA6Ly9vcGNmb3VuZGF0aW9uLm9y -Zy9CaW5hcnlTY2hlbWEvIg0KICB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1M -U2NoZW1hLWluc3RhbmNlIg0KICB4bWxuczp1YT0iaHR0cDovL29wY2ZvdW5kYXRpb24ub3JnL1VB -LyINCiAgeG1sbnM6dG5zPSJodHRwczovL25ldy5mb28uY29tL3plYnJhLWNvbXByZXNzaW9uL2Zs -YXR0ZW5pbmctYW5kLXN1YnNwYWNlZm9sZGluZy9VQS8iDQogIERlZmF1bHRCeXRlT3JkZXI9Ikxp -dHRsZUVuZGlhbiINCiAgVGFyZ2V0TmFtZXNwYWNlPSJodHRwczovL25ldy5mb28uY29tL3plYnJh -LWNvbXByZXNzaW9uL2ZsYXR0ZW5pbmctYW5kLXN1YnNwYWNlZm9sZGluZy9VQS8iDQo+DQogIDxv -cGM6SW1wb3J0IE5hbWVzcGFjZT0iaHR0cDovL29wY2ZvdW5kYXRpb24ub3JnL1VBLyIgTG9jYXRp -b249Ii5CaW5hcnlTY2hlbWEuYnNkIi8+DQoNCiAgPG9wYzpTdHJ1Y3R1cmVkVHlwZSBOYW1lPSJU -ZXN0RGF0YVR5cGUiIEJhc2VUeXBlPSJ1YTpFeHRlbnNpb25PYmplY3QiPg0KICAgIDxvcGM6Rmll -bGQgTmFtZT0idGVzdEludCIgVHlwZU5hbWU9Im9wYzpJbnQzMiIgLz4NCiAgPC9vcGM6U3RydWN0 -dXJlZFR5cGU+DQoNCjwvb3BjOlR5cGVEaWN0aW9uYXJ5Pg== - - - - NamespaceUri - - i=68 - ns=1;i=27 - - - https://new.foo.com/zebra-compression/flattening-and-subspacefolding/UA/ - - - - Deprecated - - i=68 - ns=1;i=27 - - - true - - - - TestDataType - - i=69 - ns=1;i=27 - - - TestDataType - - - - Default XML - - ns=1;i=16 - ns=1;i=39 - i=76 - - - - FooFlt - - ns=1;i=37 - ns=1;i=38 - ns=1;i=39 - i=92 - i=72 - - - PHhzOnNjaGVtYQ0KICB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEi -DQogIHhtbG5zOnVhPSJodHRwOi8vb3BjZm91bmRhdGlvbi5vcmcvVUEvMjAwOC8wMi9UeXBlcy54 -c2QiDQogIHhtbG5zOnRucz0iaHR0cHM6Ly9uZXcuZm9vLmNvbS96ZWJyYS1jb21wcmVzc2lvbi9m -bGF0dGVuaW5nLWFuZC1zdWJzcGFjZWZvbGRpbmcvVUEvIg0KICB0YXJnZXROYW1lc3BhY2U9Imh0 -dHBzOi8vbmV3LmZvby5jb20vemVicmEtY29tcHJlc3Npb24vZmxhdHRlbmluZy1hbmQtc3Vic3Bh -Y2Vmb2xkaW5nL1VBLyINCiAgZWxlbWVudEZvcm1EZWZhdWx0PSJxdWFsaWZpZWQiDQo+DQogIDx4 -czppbXBvcnQgbmFtZXNwYWNlPSJodHRwOi8vb3BjZm91bmRhdGlvbi5vcmcvVUEvIiAvPg0KDQog -IDx4czpjb21wbGV4VHlwZSBuYW1lPSJUZXN0RGF0YVR5cGUiPg0KICAgIDx4czpzZXF1ZW5jZT4N -CiAgICAgIDx4czplbGVtZW50IG5hbWU9InRlc3RJbnQiIHR5cGU9InhzOmludCIgbWluT2NjdXJz -PSIwIiAvPg0KICAgIDwveHM6c2VxdWVuY2U+DQogIDwveHM6Y29tcGxleFR5cGU+DQogIDx4czpl -bGVtZW50IG5hbWU9IlRlc3REYXRhVHlwZSIgdHlwZT0idG5zOlRlc3REYXRhVHlwZSIgLz4NCg0K -ICA8eHM6Y29tcGxleFR5cGUgbmFtZT0iTGlzdE9mVGVzdERhdGFUeXBlIj4NCiAgICA8eHM6c2Vx -dWVuY2U+DQogICAgICA8eHM6ZWxlbWVudCBuYW1lPSJUZXN0RGF0YVR5cGUiIHR5cGU9InRuczpU -ZXN0RGF0YVR5cGUiIG1pbk9jY3Vycz0iMCIgbWF4T2NjdXJzPSJ1bmJvdW5kZWQiIG5pbGxhYmxl -PSJ0cnVlIiAvPg0KICAgIDwveHM6c2VxdWVuY2U+DQogIDwveHM6Y29tcGxleFR5cGU+DQogIDx4 -czplbGVtZW50IG5hbWU9Ikxpc3RPZlRlc3REYXRhVHlwZSIgdHlwZT0idG5zOkxpc3RPZlRlc3RE -YXRhVHlwZSIgbmlsbGFibGU9InRydWUiPjwveHM6ZWxlbWVudD4NCg0KPC94czpzY2hlbWE+ - - - - NamespaceUri - - i=68 - ns=1;i=35 - - - https://new.foo.com/zebra-compression/flattening-and-subspacefolding/UA/ - - - - Deprecated - - i=68 - ns=1;i=35 - - - true - - - - TestDataType - - i=69 - ns=1;i=35 - - - //xs:element[@name='TestDataType'] - - - - Default JSON - - ns=1;i=16 - i=76 - - - diff --git a/recipes/open62541/all/test_package/FooFlt.Types.bsd b/recipes/open62541/all/test_package/FooFlt.Types.bsd deleted file mode 100644 index 8965184b8d8e2..0000000000000 --- a/recipes/open62541/all/test_package/FooFlt.Types.bsd +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - diff --git a/recipes/open62541/all/test_package/FooFltModel.csv b/recipes/open62541/all/test_package/FooFltModel.csv deleted file mode 100644 index e39f643bedac4..0000000000000 --- a/recipes/open62541/all/test_package/FooFltModel.csv +++ /dev/null @@ -1,42 +0,0 @@ -ApeType,1,ObjectType -ApeType_Name,2,Variable -ApeType_Number,3,Variable -ApeType_MyVariable,4,Variable -ApeType_MyVariable_Definition,5,Variable -ApeType_MyVariable_ValuePrecision,6,Variable -ApeType_MyVariable_InstrumentRange,7,Variable -ApeType_MyVariable_EURange,8,Variable -ApeType_MyVariable_EngineeringUnits,9,Variable -FooAnalogItemType,10,VariableType -FooAnalogItemType_Definition,11,Variable -FooAnalogItemType_ValuePrecision,12,Variable -FooAnalogItemType_InstrumentRange,13,Variable -FooAnalogItemType_EURange,14,Variable -FooAnalogItemType_EngineeringUnits,15,Variable -TestDataType,16,DataType -Ape,17,Object -Ape_Name,18,Variable -Ape_Number,19,Variable -Ape_MyVariable,20,Variable -Ape_MyVariable_Definition,21,Variable -Ape_MyVariable_ValuePrecision,22,Variable -Ape_MyVariable_InstrumentRange,23,Variable -Ape_MyVariable_EURange,24,Variable -Ape_MyVariable_EngineeringUnits,25,Variable -TestDataType_Encoding_DefaultBinary,26,Object -FooZbrFlt_BinarySchema,27,Variable -FooZbrFlt_BinarySchema_DataTypeVersion,28,Variable -FooZbrFlt_BinarySchema_NamespaceUri,29,Variable -FooZbrFlt_BinarySchema_Deprecated,30,Variable -FooZbrFlt_BinarySchema_TestDataType,31,Variable -FooZbrFlt_BinarySchema_TestDataType_DataTypeVersion,32,Variable -FooZbrFlt_BinarySchema_TestDataType_DictionaryFragment,33,Variable -TestDataType_Encoding_DefaultXml,34,Object -FooZbrFlt_XmlSchema,35,Variable -FooZbrFlt_XmlSchema_DataTypeVersion,36,Variable -FooZbrFlt_XmlSchema_NamespaceUri,37,Variable -FooZbrFlt_XmlSchema_Deprecated,38,Variable -FooZbrFlt_XmlSchema_TestDataType,39,Variable -FooZbrFlt_XmlSchema_TestDataType_DataTypeVersion,40,Variable -FooZbrFlt_XmlSchema_TestDataType_DictionaryFragment,41,Variable -TestDataType_Encoding_DefaultJson,42,Object diff --git a/recipes/open62541/all/test_package/conanfile.py b/recipes/open62541/all/test_package/conanfile.py index c1fe645c77cc3..85d0878ec465b 100644 --- a/recipes/open62541/all/test_package/conanfile.py +++ b/recipes/open62541/all/test_package/conanfile.py @@ -23,6 +23,7 @@ def generate(self): "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.variables["UA_SCHEMA_DIR"] = os.path.join(self.dependencies["ua-nodeset"].conf_info.get("user.ua-nodeset:nodeset_dir"), "Schema").replace("\\", "/") tc.generate() def build(self): diff --git a/recipes/open62541/all/test_package/test_package.c b/recipes/open62541/all/test_package/test_package.c index 31232fcb703bd..f99c1656d4f26 100644 --- a/recipes/open62541/all/test_package/test_package.c +++ b/recipes/open62541/all/test_package/test_package.c @@ -1,75 +1,12 @@ #ifdef UA_ENABLE_AMALGAMATION #include #else -#include #include #include -#include #endif -/* Files namespace_foo_flt_generated.h and namespace_foo_flt_generated.c are created from FooFlt.NodeSet2.xml in the - * /src_generated directory by CMake */ -#include "foo_flt_nodeids.h" -#include "namespace_foo_flt_generated.h" -#include -#include -#include - -UA_Boolean running = false; - -static void server_stop_callback(UA_Server *server, void *data) { - UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "stopping server due to timer"); - running = false; -} - int main(void) { UA_Server *server = UA_Server_new(); - running = true; - UA_StatusCode return_code; - UA_UInt16 portNumber = 4840; - UA_ServerConfig_setMinimal(UA_Server_getConfig(server), portNumber, NULL); - UA_Server_addRepeatedCallback(server, server_stop_callback, NULL, 500., NULL); - - /* create nodes from nodeset */ - if(namespace_foo_flt_generated(server) != UA_STATUSCODE_GOOD) - { - UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Could not add the Foo FLT nodeset. " - "Check previous output for any error."); - return_code = UA_STATUSCODE_BADUNEXPECTEDERROR; - } - else - { - // Do some additional stuff with the nodes - // this will just get the namespace index, since it is already added to the server - UA_UInt16 nsIdx = UA_Server_addNamespace(server, "https://new.foo.com/zebra-compression/flattening-and-subspacefolding/UA/"); - UA_NodeId testInstanceId = UA_NODEID_NUMERIC(nsIdx, UA_FOO_FLTID_APE); - UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "The Ape has ns=%d;id=%d", - testInstanceId.namespaceIndex, testInstanceId.identifier.numeric); - - return_code = UA_Server_run(server, &running); - - while(return_code == UA_STATUSCODE_BADCOMMUNICATIONERROR) - { - running = false; - portNumber = portNumber + 1; - UA_Server_getConfig(server)->networkLayersSize = 0; - UA_ServerConfig_addNetworkLayerTCP(UA_Server_getConfig(server), portNumber, 0, 0); - running = true; - return_code = UA_Server_run(server, &running); - - if(return_code == UA_STATUSCODE_GOOD) - { - printf("free port found"); - break; - } - else if(portNumber>4850) - { - printf("ports from 4840 to 4850 are not avilable"); - break; - } - } - } - running = false; UA_Server_delete(server); - return return_code == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE; + return 0; } diff --git a/recipes/open62541/all/test_v1_package/CMakeLists.txt b/recipes/open62541/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8113fa1875eb6..0000000000000 --- a/recipes/open62541/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -cmake_minimum_required(VERSION 3.12) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(open62541 REQUIRED CONFIG) -find_package(Threads REQUIRED) - -find_package(Python3 REQUIRED) -set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) - -# Output directory for Nodeset Compiler -set(GENERATE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/src_generated/") -file(MAKE_DIRECTORY "${GENERATE_OUTPUT_DIR}") -include_directories("${GENERATE_OUTPUT_DIR}") -ua_generate_nodeset_and_datatypes( - NAME "foo_flt" - TARGET_PREFIX "${PROJECT_NAME}" - FILE_CSV "${PROJECT_SOURCE_DIR}/../test_package/FooFltModel.csv" - FILE_BSD "${PROJECT_SOURCE_DIR}/../test_package/FooFlt.Types.bsd" - OUTPUT_DIR "${GENERATE_OUTPUT_DIR}" - NAMESPACE_IDX 2 # This namespace index must match the order in which you are adding the nodeset in the source code - NAMESPACE_MAP "2:https://new.foo.com/zebra-compression/flattening-and-subspacefolding/UA/" - FILE_NS "${PROJECT_SOURCE_DIR}/../test_package/FooFlt.NodeSet2.xml" - INTERNAL -) -# Previous macro automatically sets some variables which hold the generated source code files using the provided NAME -add_executable(${PROJECT_NAME} - ${UA_NODESET_FOO_FLT_SOURCES} - ${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/all/test_v1_package/conanfile.py b/recipes/open62541/all/test_v1_package/conanfile.py deleted file mode 100644 index 95cab84f3695f..0000000000000 --- a/recipes/open62541/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,24 +0,0 @@ -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", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" - - def requirements(self): - self.requires("ua-nodeset/padim-1.02-2021-07-21") - - def build(self): - cmake = CMake(self) - cmake.definitions["open62541_NODESET_DIR"] = self.deps_user_info["ua-nodeset"].nodeset_dir - cmake.definitions["open62541_TOOLS_DIR"] = self.deps_user_info["open62541"].tools_dir - 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/open62541/config.yml b/recipes/open62541/config.yml index 6a69381fdd40f..9dae87e5721a3 100644 --- a/recipes/open62541/config.yml +++ b/recipes/open62541/config.yml @@ -1,4 +1,8 @@ versions: + "1.4.6": + folder: all + "1.3.9": + folder: all "1.3.8": folder: all "1.2.6": diff --git a/recipes/open62541pp/all/conandata.yml b/recipes/open62541pp/all/conandata.yml new file mode 100644 index 0000000000000..c4b2a907a2d8d --- /dev/null +++ b/recipes/open62541pp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.17.0": + url: "https://github.com/open62541pp/open62541pp/archive/refs/tags/v0.17.0.tar.gz" + sha256: "79d83fcf9673a75870f12d7f54e2d21d245931699b916e6c925df25444ce0189" diff --git a/recipes/open62541pp/all/conanfile.py b/recipes/open62541pp/all/conanfile.py new file mode 100644 index 0000000000000..6d01099020294 --- /dev/null +++ b/recipes/open62541pp/all/conanfile.py @@ -0,0 +1,82 @@ +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, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc + +required_conan_version = ">=2.1" + + +class Open62541ppConan(ConanFile): + name = "open62541pp" + description = "open62541++ is a C++ wrapper built on top of the amazing open62541 OPC UA (OPC Unified Architecture) library" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/open62541pp/open62541pp" + topics = ("opcua", "open62541") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "ipo": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "ipo": False, + } + + implements = ["auto_shared_fpic"] + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("open62541/1.4.6", transitive_headers=True, transitive_libs=True) + + def validate(self): + check_min_cppstd(self, 17) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._patch_sources() + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["UAPP_INTERNAL_OPEN62541"] = False + tc.variables["UAPP_BUILD_DOCUMENTATION"] = False + if is_msvc(self): + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.variables["open62541_ipo"] = self.options.ipo + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + # Otherwise fails with + # INTERFACE_LIBRARY targets may only have whitelisted properties. The + # property "INTERPROCEDURAL_OPTIMIZATION" is not allowed. + # Set this in CMakeToolchain instead + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "get_target_property(open62541_ipo open62541::open62541 INTERPROCEDURAL_OPTIMIZATION)", "") + + def build(self): + 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", "cmake")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.libs = ["open62541pp"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/open62541pp/all/test_package/CMakeLists.txt b/recipes/open62541pp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..986c0b840b524 --- /dev/null +++ b/recipes/open62541pp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(open62541pp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE open62541pp::open62541pp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/open62541pp/all/test_package/conanfile.py b/recipes/open62541pp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/open62541pp/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/open62541pp/all/test_package/test_package.cpp b/recipes/open62541pp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9f02d70ed916c --- /dev/null +++ b/recipes/open62541pp/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + opcua::Server server; + opcua::Node parentNode(server, opcua::ObjectId::ObjectsFolder); +} diff --git a/recipes/open62541pp/config.yml b/recipes/open62541pp/config.yml new file mode 100644 index 0000000000000..60a00f1b4d579 --- /dev/null +++ b/recipes/open62541pp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.17.0": + folder: all diff --git a/recipes/openal-soft/all/conandata.yml b/recipes/openal-soft/all/conandata.yml index 39085eaa09938..23bf0e0ad9976 100644 --- a/recipes/openal-soft/all/conandata.yml +++ b/recipes/openal-soft/all/conandata.yml @@ -1,37 +1,16 @@ sources: + "1.23.1": + url: + - "https://github.com/kcat/openal-soft/releases/download/1.23.1/openal-soft-1.23.1.tar.bz2" + - "https://openal-soft.org/openal-releases/openal-soft-1.23.1.tar.bz2" + sha256: "796f4b89134c4e57270b7f0d755f0fa3435b90da437b745160a49bd41c845b21" "1.22.2": - url: "https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2" + url: + - "https://github.com/kcat/openal-soft/releases/download/1.22.2/openal-soft-1.22.2.tar.bz2" + - "https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2" sha256: "ae94cc95cda76b7cc6e92e38c2531af82148e76d3d88ce996e2928a1ea7c3d20" - "1.21.1": - url: "https://openal-soft.org/openal-releases/openal-soft-1.21.1.tar.bz2" - sha256: "c8ad767e9a3230df66756a21cc8ebf218a9d47288f2514014832204e666af5d8" - "1.21.0": - url: "https://openal-soft.org/openal-releases/openal-soft-1.21.0.tar.bz2" - sha256: "2916b4fc24e23b0271ce0b3468832ad8b6d8441b1830215b28cc4fee6cc89297" - "1.20.1": - url: "https://openal-soft.org/openal-releases/openal-soft-1.20.1.tar.bz2" - sha256: "b6ceb051325732c23f5c8b6d37dbd89534517e6439a87e970882b447c3025d6d" - "1.19.1": - url: "https://openal-soft.org/openal-releases/openal-soft-1.19.1.tar.bz2" - sha256: "5c2f87ff5188b95e0dc4769719a9d89ce435b8322b4478b95dd4b427fe84b2e9" patches: "1.22.2": - patch_file: "patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch" - "1.21.0": - - patch_file: "patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch" - - patch_file: "patches/1.21.0-0002-fix-windows-sdk.patch" - patch_description: "Avoid explicitly searching for the WindowsSDK" - patch_type: "portability" - patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" - "1.20.1": - - patch_file: "patches/1.20.1-0001-fix-windows-sdk.patch" - patch_description: "Avoid explicitly searching for the WindowsSDK" - patch_type: "portability" - patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" - "1.19.1": - - patch_file: "patches/1.19.1-0001-aligned-alloc.patch" - - patch_file: "patches/1.19.1-0002-gcc-10-fnocommon.patch" - - patch_file: "patches/1.19.1-0003-fix-windows-sdk.patch" - patch_description: "Avoid explicitly searching for the WindowsSDK" - patch_type: "portability" - patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" + patch_source: "https://github.com/kcat/openal-soft/commit/650a6d49e9a511d005171940761f6dd6b440ee66" + - patch_file: "patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch" diff --git a/recipes/openal-soft/all/conanfile.py b/recipes/openal-soft/all/conanfile.py index 83f92f752bca9..0a46e1e6e124c 100644 --- a/recipes/openal-soft/all/conanfile.py +++ b/recipes/openal-soft/all/conanfile.py @@ -8,7 +8,7 @@ import os import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class OpenALSoftConan(ConanFile): @@ -29,20 +29,16 @@ class OpenALSoftConan(ConanFile): "fPIC": True, } - @property - def _openal_cxx_backend(self): - return Version(self.version) >= "1.20" - @property def _min_cppstd(self): - return "11" if Version(self.version) < "1.21" else "14" + return 14 @property def _minimum_compilers_version(self): return { - "Visual Studio": "13" if Version(self.version) < "1.21" else "15", - "msvc": "180" if Version(self.version) < "1.21" else "191", - "gcc": "5", + "Visual Studio": "15", + "msvc": "191", + "gcc": "6", "clang": "5", } @@ -59,8 +55,6 @@ def configure(self): # OpenAL's API is pure C, thus the c++ standard does not matter # Because the backend is C++, the C++ STL matters self.settings.rm_safe("compiler.cppstd") - if not self._openal_cxx_backend: - self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") @@ -70,23 +64,22 @@ def requirements(self): self.requires("libalsa/1.2.10") def validate(self): - if self._openal_cxx_backend: - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_cppstd) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - compiler = self.settings.compiler + compiler = self.settings.compiler - minimum_version = self._minimum_compilers_version.get(str(compiler), False) - if minimum_version and Version(compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", - ) + minimum_version = self._minimum_compilers_version.get(str(compiler), False) + if minimum_version and Version(compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) - if compiler == "clang" and Version(compiler.version) < "9" and \ - compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"): - raise ConanInvalidConfiguration( - f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime", - ) + if compiler == "clang" and Version(compiler.version) < "9" and \ + compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"): + raise ConanInvalidConfiguration( + f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime", + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -98,6 +91,8 @@ def generate(self): tc.variables["ALSOFT_EXAMPLES"] = False tc.variables["ALSOFT_TESTS"] = False tc.variables["CMAKE_DISABLE_FIND_PACKAGE_SoundIO"] = True + if Version(self.version) < "1.24.0": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -141,10 +136,6 @@ def package_info(self): self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) self.cpp_info.set_property("pkg_config_name", "openal") - self.cpp_info.names["cmake_find_package"] = "OpenAL" - self.cpp_info.names["cmake_find_package_multi"] = "OpenAL" - self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.libs = collect_libs(self) self.cpp_info.includedirs.append(os.path.join("include", "AL")) if self.settings.os in ["Linux", "FreeBSD"]: @@ -155,9 +146,11 @@ def package_info(self): self.cpp_info.frameworks.append("ApplicationServices") elif self.settings.os == "Windows": self.cpp_info.system_libs.extend(["winmm", "ole32", "shell32", "user32"]) - if self._openal_cxx_backend and not self.options.shared: + if not self.options.shared: libcxx = stdcpp_library(self) if libcxx: self.cpp_info.system_libs.append(libcxx) if not self.options.shared: self.cpp_info.defines.append("AL_LIBTYPE_STATIC") + if self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"]: + self.cpp_info.system_libs.append("atomic") diff --git a/recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch b/recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch deleted file mode 100644 index f734aeb89945e..0000000000000 --- a/recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -546,7 +546,7 @@ IF(HAVE_INTRIN_H) - ENDIF() - - CHECK_SYMBOL_EXISTS(sysconf unistd.h HAVE_SYSCONF) --CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC) -+#CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC) - CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) - CHECK_SYMBOL_EXISTS(_aligned_malloc malloc.h HAVE__ALIGNED_MALLOC) - CHECK_SYMBOL_EXISTS(proc_pidpath libproc.h HAVE_PROC_PIDPATH) diff --git a/recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch b/recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch deleted file mode 100644 index 1283ee70f8fe7..0000000000000 --- a/recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/Alc/bformatdec.h 2018-10-11 18:05:31.000000000 -0400 -+++ b/Alc/bformatdec.h 2020-10-10 21:01:08.842986977 -0400 -@@ -24,9 +24,9 @@ - /* NOTE: These are scale factors as applied to Ambisonics content. Decoder - * coefficients should be divided by these values to get proper N3D scalings. - */ --const ALfloat N3D2N3DScale[MAX_AMBI_COEFFS]; --const ALfloat SN3D2N3DScale[MAX_AMBI_COEFFS]; --const ALfloat FuMa2N3DScale[MAX_AMBI_COEFFS]; -+extern const ALfloat N3D2N3DScale[MAX_AMBI_COEFFS]; -+extern const ALfloat SN3D2N3DScale[MAX_AMBI_COEFFS]; -+extern const ALfloat FuMa2N3DScale[MAX_AMBI_COEFFS]; - - - struct AmbDecConf; diff --git a/recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch b/recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch deleted file mode 100644 index 922c2a2f1c321..0000000000000 --- a/recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1092,17 +1092,24 @@ IF(HAVE_WINDOWS_H) - ENDIF() - - # Check DSound backend -- FIND_PACKAGE(DSound) -- IF(DSOUND_FOUND) -- OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -- IF(ALSOFT_BACKEND_DSOUND) -- SET(HAVE_DSOUND 1) -- SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") -- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c) -- ADD_BACKEND_LIBS(${DSOUND_LIBRARIES}) -- SET(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) -- ENDIF() -- ENDIF() -+ check_include_file(dsound.h HAVE_DSOUND_H) -+ if(DXSDK_DIR) -+ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" -+ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include -+ DOC "The DirectSound include directory") -+ endif() -+ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) -+ option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -+ if(ALSOFT_BACKEND_DSOUND) -+ set(HAVE_DSOUND 1) -+ set(BACKENDS "${BACKENDS} DirectSound,") -+ set(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c) -+ -+ if(NOT HAVE_DSOUND_H) -+ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) -+ endif() -+ endif() -+ endif() - - # Check for WASAPI backend - CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H) diff --git a/recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch b/recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch deleted file mode 100644 index 61ba2e012e0da..0000000000000 --- a/recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -854,44 +854,38 @@ OPTION(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF) - OPTION(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF) - OPTION(ALSOFT_REQUIRE_WASAPI "Require WASAPI backend" OFF) - IF(WIN32) -- SET(WINSDK_LIB_DIRS ) -- SET(WINSDK_INCLUDE_DIRS ) -- FIND_PACKAGE(WindowsSDK) -- IF(WINDOWSSDK_FOUND) -- get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) -- get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS) -- ENDIF() -- -- SET(OLD_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}) -- SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_WIN32_WINNT=0x0502) -- - # Check MMSystem backend -- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) -- FIND_LIBRARY(WINMM_LIBRARY NAMES winmm -- PATHS ${WINSDK_LIB_DIRS} -- PATH_SUFFIXES lib lib/x86 lib/x64) -- IF(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) -- OPTION(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -- IF(ALSOFT_BACKEND_WINMM) -- SET(HAVE_WINMM 1) -- SET(BACKENDS "${BACKENDS} WinMM,") -- SET(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -- SET(EXTRA_LIBS ${WINMM_LIBRARY} ${EXTRA_LIBS}) -- ENDIF() -- ENDIF() -+ option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -+ if(ALSOFT_BACKEND_WINMM) -+ set(HAVE_WINMM 1) -+ set(BACKENDS "${BACKENDS} WinMM,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -+ # There doesn't seem to be good way to search for winmm.lib for MSVC. -+ # find_library doesn't find it without being told to look in a specific -+ # place in the WindowsSDK, but it links anyway. If there ends up being -+ # Windows targets without this, another means to detect it is needed. -+ set(EXTRA_LIBS winmm ${EXTRA_LIBS}) -+ endif() - - # Check DSound backend -- FIND_PACKAGE(DSound) -- IF(DSOUND_FOUND) -- OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -- IF(ALSOFT_BACKEND_DSOUND) -- SET(HAVE_DSOUND 1) -- SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") -- SET(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) -- ADD_BACKEND_LIBS(${DSOUND_LIBRARIES}) -- SET(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) -- ENDIF() -- ENDIF() -+ check_include_file(dsound.h HAVE_DSOUND_H) -+ if(DXSDK_DIR) -+ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" -+ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include -+ DOC "The DirectSound include directory") -+ endif() -+ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) -+ option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) -+ if(ALSOFT_BACKEND_DSOUND) -+ set(HAVE_DSOUND 1) -+ set(BACKENDS "${BACKENDS} DirectSound,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) -+ -+ if(NOT HAVE_DSOUND_H) -+ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) -+ endif() -+ endif() -+ endif() - - # Check for WASAPI backend - CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H) diff --git a/recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch b/recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch deleted file mode 100644 index 11b0c43304b4a..0000000000000 --- a/recipes/openal-soft/all/patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch +++ /dev/null @@ -1,16 +0,0 @@ -gcc-11 triggers an error. std::aligned_alloc needs c++17. -This patch ports openal 1.21.1 behavior back to 1.21.0. ---- common/almalloc.cpp -+++ common/almalloc.cpp -@@ -21,4 +21,4 @@ --#if defined(HAVE_STD_ALIGNED_ALLOC) -- size = (size+(alignment-1))&~(alignment-1); -- return std::aligned_alloc(alignment, size); -+//#if defined(HAVE_STD_ALIGNED_ALLOC) -+// size = (size+(alignment-1))&~(alignment-1); -+// return std::aligned_alloc(alignment, size); --#elif defined(HAVE_POSIX_MEMALIGN) -+#if defined(HAVE_POSIX_MEMALIGN) -@@ -56,1 +56,1 @@ --#if defined(HAVE_STD_ALIGNED_ALLOC) || defined(HAVE_POSIX_MEMALIGN) -+#if defined(HAVE_POSIX_MEMALIGN) diff --git a/recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch b/recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch deleted file mode 100644 index 3a6c7afb5a414..0000000000000 --- a/recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -880,49 +880,36 @@ option(ALSOFT_REQUIRE_WINMM "Require Windows Multimedia backend" OFF) - option(ALSOFT_REQUIRE_DSOUND "Require DirectSound backend" OFF) - option(ALSOFT_REQUIRE_WASAPI "Require WASAPI backend" OFF) - if(WIN32) -- set(WINSDK_LIB_DIRS ) -- set(WINSDK_INCLUDE_DIRS ) -- find_package(WindowsSDK) -- if(WINDOWSSDK_FOUND) -- get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) -- get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS) -- endif() -- - # Check MMSystem backend -- check_include_files("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) -- find_library(WINMM_LIBRARY NAMES winmm -- PATHS ${WINSDK_LIB_DIRS}) -- if(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) -- option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -- if(ALSOFT_BACKEND_WINMM) -- set(HAVE_WINMM 1) -- set(BACKENDS "${BACKENDS} WinMM,") -- set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -- set(EXTRA_LIBS ${WINMM_LIBRARY} ${EXTRA_LIBS}) -- endif() -+ option(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) -+ if(ALSOFT_BACKEND_WINMM) -+ set(HAVE_WINMM 1) -+ set(BACKENDS "${BACKENDS} WinMM,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/winmm.cpp alc/backends/winmm.h) -+ # There doesn't seem to be good way to search for winmm.lib for MSVC. -+ # find_library doesn't find it without being told to look in a specific -+ # place in the WindowsSDK, but it links anyway. If there ends up being -+ # Windows targets without this, another means to detect it is needed. -+ set(EXTRA_LIBS winmm ${EXTRA_LIBS}) - endif() - - # Check DSound backend -- find_package(DSound) -- if(DSOUND_FOUND) -+ check_include_file(dsound.h HAVE_DSOUND_H) -+ if(DXSDK_DIR) -+ find_path(DSOUND_INCLUDE_DIR NAMES "dsound.h" -+ PATHS "${DXSDK_DIR}" PATH_SUFFIXES include -+ DOC "The DirectSound include directory") -+ endif() -+ if(HAVE_DSOUND_H OR DSOUND_INCLUDE_DIR) - option(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON) - if(ALSOFT_BACKEND_DSOUND) - set(HAVE_DSOUND 1) -- set(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},") -- set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) -- add_backend_libs(${DSOUND_LIBRARIES}) -- set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIRS}) -- endif() -- endif() -+ set(BACKENDS "${BACKENDS} DirectSound,") -+ set(ALC_OBJS ${ALC_OBJS} alc/backends/dsound.cpp alc/backends/dsound.h) - -- # Check for WASAPI backend -- check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H) -- if(HAVE_MMDEVICEAPI_H) -- option(ALSOFT_BACKEND_WASAPI "Enable WASAPI backend" ON) -- if(ALSOFT_BACKEND_WASAPI) -- set(HAVE_WASAPI 1) -- set(BACKENDS "${BACKENDS} WASAPI,") -- set(ALC_OBJS ${ALC_OBJS} alc/backends/wasapi.cpp alc/backends/wasapi.h) -+ if(NOT HAVE_DSOUND_H) -+ set(INC_PATHS ${INC_PATHS} ${DSOUND_INCLUDE_DIR}) -+ endif() - endif() - endif() - endif() diff --git a/recipes/openal-soft/all/patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch b/recipes/openal-soft/all/patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch new file mode 100644 index 0000000000000..ff97aae372563 --- /dev/null +++ b/recipes/openal-soft/all/patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1984ac9..75e904d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1051,8 +1051,8 @@ if(PULSEAUDIO_FOUND) + set(HAVE_PULSEAUDIO 1) + set(BACKENDS "${BACKENDS} PulseAudio${IS_LINKED},") + set(ALC_OBJS ${ALC_OBJS} alc/backends/pulseaudio.cpp alc/backends/pulseaudio.h) +- add_backend_libs(${PULSEAUDIO_LIBRARIES}) +- set(INC_PATHS ${INC_PATHS} ${PULSEAUDIO_INCLUDE_DIRS}) ++ add_backend_libs(${PULSEAUDIO_LIBRARY}) ++ set(INC_PATHS ${INC_PATHS} ${PULSEAUDIO_INCLUDE_DIR}) + endif() + endif() + if(ALSOFT_REQUIRE_PULSEAUDIO AND NOT HAVE_PULSEAUDIO) diff --git a/recipes/openal-soft/all/test_package/CMakeLists.txt b/recipes/openal-soft/all/test_package/CMakeLists.txt index 6822e9962142c..f304fd0816659 100644 --- a/recipes/openal-soft/all/test_package/CMakeLists.txt +++ b/recipes/openal-soft/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(OpenAL REQUIRED) diff --git a/recipes/openal-soft/all/test_v1_package/CMakeLists.txt b/recipes/openal-soft/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/openal-soft/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/openal-soft/all/test_v1_package/conanfile.py b/recipes/openal-soft/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/openal-soft/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/openal-soft/config.yml b/recipes/openal-soft/config.yml index e4eea213adbce..a3a476fc04f3a 100644 --- a/recipes/openal-soft/config.yml +++ b/recipes/openal-soft/config.yml @@ -1,11 +1,5 @@ versions: - "1.22.2": - folder: all - "1.21.1": - folder: all - "1.21.0": + "1.23.1": folder: all - "1.20.1": - folder: all - "1.19.1": + "1.22.2": folder: all diff --git a/recipes/openal/all/conanfile.py b/recipes/openal/all/conanfile.py index 4de9550fc2a4b..8565c6b70867d 100644 --- a/recipes/openal/all/conanfile.py +++ b/recipes/openal/all/conanfile.py @@ -8,7 +8,7 @@ import os import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class OpenALConan(ConanFile): @@ -20,7 +20,7 @@ class OpenALConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://openal-soft.org/" license = "LGPL-2.0-or-later" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -100,6 +100,8 @@ def generate(self): tc.variables["ALSOFT_EXAMPLES"] = False tc.variables["ALSOFT_TESTS"] = False tc.variables["CMAKE_DISABLE_FIND_PACKAGE_SoundIO"] = True + # Version 1.24.0 already support CMake 4 but this recipe is deprecated in favor to openal-soft + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -145,10 +147,6 @@ def package_info(self): self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) self.cpp_info.set_property("pkg_config_name", "openal") - self.cpp_info.names["cmake_find_package"] = "OpenAL" - self.cpp_info.names["cmake_find_package_multi"] = "OpenAL" - self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.libs = collect_libs(self) self.cpp_info.includedirs.append(os.path.join("include", "AL")) if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/openal/all/test_package/CMakeLists.txt b/recipes/openal/all/test_package/CMakeLists.txt index f25fa5a765b27..ad69508a403b2 100644 --- a/recipes/openal/all/test_package/CMakeLists.txt +++ b/recipes/openal/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(OpenAL REQUIRED) diff --git a/recipes/openal/all/test_v1_package/CMakeLists.txt b/recipes/openal/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/openal/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/openal/all/test_v1_package/conanfile.py b/recipes/openal/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/openal/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/openapi-generator/all/conandata.yml b/recipes/openapi-generator/all/conandata.yml index 9624e0bf21d4b..e33f7ced5e6b7 100644 --- a/recipes/openapi-generator/all/conandata.yml +++ b/recipes/openapi-generator/all/conandata.yml @@ -1,13 +1,19 @@ sources: - "7.0.0": - url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar" - sha256: "80e8e9d71bdbdf513b8c65cf7d3fc2fe3d88aaeb4e39a2c6e20831f00032c775" + "7.12.0": + url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.12.0/openapi-generator-cli-7.12.0.jar" + sha256: "33e7dfa7a1f04d58405ee12ae19e2c6fc2a91497cf2e56fa68f1875a95cbf220" + "7.11.0": + url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.11.0/openapi-generator-cli-7.11.0.jar" + sha256: "113c25df5a781d5a1fc2b883f12fe8f263db285ab12e15854d5b15306e1bf7fc" + "7.8.0": + url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar" + sha256: "d1879cf42da31f8cf61cf68798b8ef2418af0c6bd93a5c1870e1ff543fbb9365" + "7.5.0": + url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.5.0/openapi-generator-cli-7.5.0.jar" + sha256: "47ebbd1beddaf7dfbee523e7b87623c6ec1b1d42960fbe15f6cad2f6426c69bf" + "7.4.0": + url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar" + sha256: "e42769a98fef5634bee0f921e4b90786a6b3292aa11fe8d2f84c045ac435ab29" "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" - "6.5.0": - url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.5.0/openapi-generator-cli-6.5.0.jar" - sha256: "f18d771e98f2c5bb169d1d1961de4f94866d2901abc1e16177dd7e9299834721" - "6.4.0": - url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.4.0/openapi-generator-cli-6.4.0.jar" - sha256: "35aead300e0c9469fbd9d30cf46f4153897dcb282912091ca4ec9212dce9d151" diff --git a/recipes/openapi-generator/all/conanfile.py b/recipes/openapi-generator/all/conanfile.py index 369f8d2a3dd64..907abc8f087d1 100644 --- a/recipes/openapi-generator/all/conanfile.py +++ b/recipes/openapi-generator/all/conanfile.py @@ -20,7 +20,7 @@ def layout(self): pass def requirements(self): - self.requires("openjdk/19.0.2") + self.requires("openjdk/21.0.1") def package_id(self): del self.info.settings.arch diff --git a/recipes/openapi-generator/all/test_v1_package/conanfile.py b/recipes/openapi-generator/all/test_v1_package/conanfile.py deleted file mode 100644 index a481f4b62ad17..0000000000000 --- a/recipes/openapi-generator/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -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("openapi-generator --version", run_environment=True) diff --git a/recipes/openapi-generator/config.yml b/recipes/openapi-generator/config.yml index fc03893757ba9..4272bd04decdb 100644 --- a/recipes/openapi-generator/config.yml +++ b/recipes/openapi-generator/config.yml @@ -1,9 +1,13 @@ versions: - "7.0.0": + "7.12.0": folder: all - "6.6.0": + "7.11.0": + folder: all + "7.8.0": folder: all - "6.5.0": + "7.5.0": folder: all - "6.4.0": + "7.4.0": + folder: all + "6.6.0": folder: all diff --git a/recipes/openblas/all/conandata.yml b/recipes/openblas/all/conandata.yml index 31efef8e95737..85e4fee5631f1 100644 --- a/recipes/openblas/all/conandata.yml +++ b/recipes/openblas/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.3.27": + url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.27.tar.gz" + sha256: "aa2d68b1564fe2b13bc292672608e9cdeeeb6dc34995512e65c3b10f4599e897" + "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" diff --git a/recipes/openblas/all/conanfile.py b/recipes/openblas/all/conanfile.py index d3f3b247af16a..76bf46d4053e3 100644 --- a/recipes/openblas/all/conanfile.py +++ b/recipes/openblas/all/conanfile.py @@ -1,14 +1,62 @@ 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.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import cross_building +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_static_runtime, is_msvc 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 +import textwrap + +required_conan_version = ">=2.1" + +# Maps Conan's settings.arch to the corresponding OpenBLAS TARGET: +conan_arch_to_openblas_target = { + "x86": "SANDYBRIDGE", # Sandy bridge was discontinued in September of 2013, + "x86_64": "SANDYBRIDGE", # supporting older CPUs is a performance trade-off + "ppc32be": None, # TODO: OpenBLAS has POWER4, POWER5, POWER6, POWER7, + "ppc32": None, # POWER8, POWER9, POWER10, PPCG4, PPC970, PPC970MP, + "ppc64le": None, # PPC440, PPC440FP2, CELL + "ppc64": None, + "armv4": None, # Not supported by OpenBLAS + "armv4i": None, # Not supported by OpenBLAS + "armv5el": "ARMV5", + "armv5hf": "ARMV5", + "armv6": "ARMV6", + "armv7": "ARMV7", + "armv7hf": "ARMV7", + "armv7s": "ARMV7", + "armv7k": "ARMV7", + "armv8": "ARMV8", + "armv8_32": "ARMV7", # No 32-bit ARMv8 TARGET in OpenBLAS + "armv8.3": "ARMV8", + "arm64ec": "ARMV8", + "sparc": None, # TODO: OpenBLAS has SPARC, SPARCV7 + "sparcv9": None, + "mips": None, # TODO: OpenBLAS has P5600, MIPS1004K and MIPS24K + "mips64": "MIPS64_GENERIC", + "avr": None, # Not supported by OpenBLAS + "s390": None, # Not supported by OpenBLAS + "s390x": None, # Not supported by OpenBLAS + "asm.js": "GENERIC", # TODO: ? + "wasm": "GENERIC", # TODO: ? + "sh4le": None, # Not supported by OpenBLAS + "e2k-v2": "E2K", + "e2k-v3": "E2K", + "e2k-v4": "E2K", + "e2k-v5": "E2K", + "e2k-v6": "E2K", + "e2k-v7": "E2K", + "riscv64": "RISCV64_GENERIC", + "riscv32": None, # Not supported by OpenBLAS + "xtensalx6": None, # Not supported by OpenBLAS + "xtensalx106": None, # Not supported by OpenBLAS + "xtensalx7": None, # Not supported by OpenBLAS +} -required_conan_version = ">=1.53.0" +# Taken from OpenBLAS TargetList.txt +available_openblas_targets = ["P2", "KATMAI", "COPPERMINE", "NORTHWOOD", "PRESCOTT", "BANIAS", "YONAH", "CORE2", "PENRYN", "DUNNINGTON", "NEHALEM", "SANDYBRIDGE", "HASWELL", "SKYLAKEX", "ATOM", "COOPERLAKE", "SAPPHIRERAPIDS", "ATHLON", "OPTERON", "OPTERON_SSE3", "BARCELONA", "SHANGHAI", "ISTANBUL", "BOBCAT", "BULLDOZER", "PILEDRIVER", "STEAMROLLER", "EXCAVATOR", "ZEN", "SSE_GENERIC", "VIAC3", "NANO", "POWER4", "POWER5", "POWER6", "POWER7", "POWER8", "POWER9", "POWER10", "PPCG4", "PPC970", "PPC970MP", "PPC440", "PPC440FP2", "CELL", "P5600", "MIPS1004K", "MIPS24K", "MIPS64_GENERIC", "SICORTEX", "LOONGSON3A", "LOONGSON3B", "I6400", "P6600", "I6500", "ITANIUM2", "SPARC", "SPARCV7", "CORTEXA15", "CORTEXA9", "ARMV7", "ARMV6", "ARMV5", "ARMV8", "CORTEXA53", "CORTEXA57", "CORTEXA72", "CORTEXA73", "CORTEXA76", "CORTEXA510", "CORTEXA710", "CORTEXX1", "CORTEXX2", "NEOVERSEN1", "NEOVERSEV1", "NEOVERSEN2", "CORTEXA55", "EMAG8180", "FALKOR", "THUNDERX", "THUNDERX2T99", "TSV110", "THUNDERX3T110", "VORTEX", "A64FX", "ARMV8SVE", "FT2000", "ZARCH_GENERIC", "Z13", "Z14", "RISCV64_GENERIC", "RISCV64_ZVL128B", "C910V", "x280", "RISCV64_ZVL256B", "LOONGSONGENERIC", "LOONGSON3R5", "LOONGSON2K1000", "E2K", "EV4", "EV5", "EV6", "CSKY", "CK860FV"] class OpenblasConan(ConanFile): @@ -18,137 +66,191 @@ class OpenblasConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.openblas.net" topics = ("blas", "lapack") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "build_lapack": [True, False], + "build_relapack": [True, False], "use_thread": [True, False], + "use_locking": [True, False], "dynamic_arch": [True, False], + "target": [None] + available_openblas_targets } default_options = { "shared": False, "fPIC": True, - "build_lapack": False, + "build_lapack": True, + "build_relapack": False, "use_thread": True, + "use_locking": True, "dynamic_arch": False, + "target": None, + } + options_description = { + "build_lapack": "Build LAPACK and LAPACKE", + "build_relapack": "Build with ReLAPACK (recursive implementation of several LAPACK functions on top of standard LAPACK)", + "use_thread": "Enable threads support", + "use_locking": "Use locks even in single-threaded builds to make them callable from multiple threads", + "dynamic_arch": "Include support for multiple CPU targets, with automatic selection at runtime (x86/x86_64, aarch64 or ppc only)", + "target": "OpenBLAS TARGET variable (see TargetList.txt)", } short_paths = True - package_type = "library" @property def _fortran_compiler(self): comp_exe = self.conf.get("tools.build:compiler_executables") - if comp_exe and 'fortran' in comp_exe: + 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 + # When no Fortran compiler is available, OpenBLAS builds LAPACK from an f2c-converted copy of LAPACK unless the NO_LAPACK option is specified. + # This is not available before v0.3.21. + if Version(self.version) < "0.3.21": + self.options.build_lapack = False + self.options.build_relapack = False def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + # When cross-compiling, OpenBLAS requires explicitly setting TARGET + if cross_building(self, skip_x64_x86=True) and not self.options.target: + # Try inferring the target from settings.arch + target = conan_arch_to_openblas_target.get(str(self.settings.arch)) + if target: + self.output.warning(f'Setting OpenBLAS TARGET={target} based on settings.arch. This may result in suboptimal performance. Set the "{self.name}/*:target=XXX" option to silence this warning.') + self.options.target = target + def validate(self): - if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): - raise ConanInvalidConfiguration("Cross-building not implemented") + 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.") - def source(self): - get(self, - **self.conan_data["sources"][self.version], - strip_root=True, - destination=self.source_folder - ) + if self.options.build_relapack: + if not self.options.build_lapack: + raise ConanInvalidConfiguration(f'"{self.name}/*:build_relapack=True" option requires "{self.name}/*:build_lapack=True"') + if self.settings.compiler not in ["gcc", "clang"]: + # ld: unknown option: --allow-multiple-definition on apple-clang + raise ConanInvalidConfiguration(f'"{self.name}/*:build_relapack=True" option is only supported for GCC and Clang') - 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 validate_build(self): + if Version(self.version) < "0.3.22" and cross_building(self, skip_x64_x86=True): + # OpenBLAS CMake builds did not support some of the cross-compilation targets in 0.3.20/21 and earlier. + # This was fixed in https://github.com/OpenMathLib/OpenBLAS/pull/3714 and https://github.com/OpenMathLib/OpenBLAS/pull/3958 + raise ConanInvalidConfiguration(f"Cross-building is not supported for {self.name}/0.3.21 and earlier.") + + # If we're cross-compiling, and the user didn't provide the target, and + # we couldn't infer the target from settings.arch, fail + if cross_building(self, skip_x64_x86=True) and not self.options.target: + raise ConanInvalidConfiguration(f'Could not determine OpenBLAS TARGET. Please set the "{self.name}/*:target=XXX" option.') + + 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["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["BUILD_TESTING"] = False - tc.cache_variables["NOFORTRAN"] = not self.options.build_lapack + tc.variables["NOFORTRAN"] = not self.options.build_lapack # This checks explicit user-specified fortran compiler - if self.options.build_lapack: - if not self._fortran_compiler: - if Version(self.version) < "0.3.24": - self.output.warning( - "Building with LAPACK support requires a Fortran compiler.") - else: - tc.cache_variables["C_LAPACK"] = True - tc.cache_variables["NOFORTRAN"] = True - self.output.info( - "Building LAPACK without Fortran compiler") - - tc.cache_variables["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack - tc.cache_variables["DYNAMIC_ARCH"] = self.options.dynamic_arch - tc.cache_variables["USE_THREAD"] = self.options.use_thread - - # Required for safe concurrent calls to OpenBLAS routines - tc.cache_variables["USE_LOCKING"] = not self.options.use_thread - - # don't, may lie to consumer, /MD or /MT is managed by conan - tc.cache_variables["MSVC_STATIC_CRT"] = False + if self.options.build_lapack and not self._fortran_compiler: + if Version(self.version) < "0.3.21": + self.output.warning("Building with LAPACK support requires a Fortran compiler.") + else: + tc.variables["C_LAPACK"] = True + tc.variables["NOFORTRAN"] = True + self.output.info("Building LAPACK without a Fortran compiler") + + tc.variables["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack + tc.variables["BUILD_RELAPACK"] = self.options.build_relapack + + tc.variables["DYNAMIC_ARCH"] = self.options.dynamic_arch + tc.variables["USE_THREAD"] = self.options.use_thread + tc.variables["USE_LOCKING"] = self.options.use_locking + + tc.variables["MSVC_STATIC_CRT"] = is_msvc_static_runtime(self) # This is a workaround to add the libm dependency on linux, # which is required to successfully compile on older gcc versions. - tc.cache_variables["ANDROID"] = self.settings.os in ["Linux", "Android"] + tc.variables["ANDROID"] = self.settings.os in ["Linux", "Android"] + + if self.options.target: + tc.cache_variables["TARGET"] = self.options.target + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + if Version(self.version) < "0.3.29": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() - def build(self): + def _patch_sources(self): + 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})", textwrap.dedent("""\ + set(obj_defines ${defines_in}) + + list(FIND obj_defines "RC" def_idx) + if (${def_idx} GREATER -1) + list(REMOVE_ITEM obj_defines "RC") + list(APPEND obj_defines "RC=RC") + endif () + list(FIND obj_defines "CR" def_idx) + if (${def_idx} GREATER -1) + list(REMOVE_ITEM obj_defines "CR") + list(APPEND obj_defines "CR=CR") + endif ()""")) if Version(self.version) < "0.3.21": + f_check_cmake = os.path.join(self.source_folder, "cmake", "f_check.cmake") 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.")""" - ) + replace_in_file(self, f_check_cmake, + 'message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")', + '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) -else() - message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") - set (NOFORTRAN 1) - set (NO_LAPACK 1) -endif()""" - - replace_in_file( - self, - os.path.join(self.source_folder, self.source_folder, "cmake", "f_check.cmake"), - search, - replace, - ) - cmake = self._configure_cmake() + replace_in_file(self, f_check_cmake, + "enable_language(Fortran)", + textwrap.dedent("""\ + include(CheckLanguage) + check_language(Fortran) + if(CMAKE_Fortran_COMPILER) + enable_language(Fortran) + else() + message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.") + set (NOFORTRAN 1) + set (NO_LAPACK 1) + endif()""")) + + 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 = self._configure_cmake() + 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")) fix_apple_shared_install_name(self) + @property + def _lib_name(self): + if self.options.shared and self.settings.build_type == "Debug" and not is_msvc(self): + return "openblas_d" + return "openblas" + def package_info(self): # CMake config file: # - OpenBLAS always has one and only one of these components: openmp, pthread or serial. @@ -157,28 +259,18 @@ 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") + # 'pthread' causes issues without namespace 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("cmake_target_name", f"OpenBLAS::{cmake_component_name}") 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 = collect_libs(self) + self.cpp_info.components["openblas_component"].includedirs.append(os.path.join("include", "openblas")) + self.cpp_info.components["openblas_component"].libs = [self._lib_name] 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( - "Setting OpenBLAS_HOME environment variable: {}".format(self.package_folder) - ) - self.env_info.OpenBLAS_HOME = self.package_folder - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "OpenBLAS" - self.cpp_info.names["cmake_find_package_multi"] = "OpenBLAS" - self.cpp_info.components["openblas_component"].names["cmake_find_package"] = cmake_component_name - self.cpp_info.components["openblas_component"].names["cmake_find_package_multi"] = cmake_component_name + self.buildenv_info.define_path("OpenBLAS_HOME", self.package_folder) + self.runenv_info.define_path("OpenBLAS_HOME", self.package_folder) diff --git a/recipes/openblas/all/test_package/CMakeLists.txt b/recipes/openblas/all/test_package/CMakeLists.txt index eaf07820c3b1c..fed4c938681b1 100644 --- a/recipes/openblas/all/test_package/CMakeLists.txt +++ b/recipes/openblas/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(OpenBLAS REQUIRED CONFIG) diff --git a/recipes/openblas/config.yml b/recipes/openblas/config.yml index d12fbd6e7daea..e0f3014a9fdda 100644 --- a/recipes/openblas/config.yml +++ b/recipes/openblas/config.yml @@ -1,4 +1,10 @@ versions: + "0.3.27": + folder: all + "0.3.26": + folder: all + "0.3.25": + folder: all "0.3.24": folder: all "0.3.20": diff --git a/recipes/opencascade/all/conanfile.py b/recipes/opencascade/all/conanfile.py index 055db5ab3dbd9..9ccc94bbbb746 100644 --- a/recipes/opencascade/all/conanfile.py +++ b/recipes/opencascade/all/conanfile.py @@ -14,7 +14,7 @@ from conan.tools.microsoft import is_msvc from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class OpenCascadeConan(ConanFile): @@ -102,7 +102,7 @@ def requirements(self): self.requires("tcl/8.6.10") if self._link_tk: self.requires("tk/8.6.10") - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") if self._link_opengl: self.requires("opengl/system") if self._is_linux: @@ -180,7 +180,8 @@ def generate(self): # Relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - + if Version(self.version) < "7.9.0": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) @@ -464,27 +465,6 @@ def package(self): occt_modules = self._get_modules_from_source_code() self._create_modules_json_file(occt_modules) - # 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: f"opencascade::{target}" for module in occt_modules.values() for target in module}, - ) - - 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 _cmake_module_file_rel_path(self): - return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") - def _get_modules_from_source_code(self): csf_to_conan_dependencies = { # Mandatory dependencies @@ -589,22 +569,6 @@ def _register_components(modules_dict): self.cpp_info.components[conan_component_module_name].requires.append(conan_component_target_name) - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.components[conan_component_target_name].names["cmake_find_package"] = target_lib - self.cpp_info.components[conan_component_target_name].names["cmake_find_package_multi"] = target_lib - self.cpp_info.components[conan_component_target_name].build_modules["cmake_find_package"] = [self._cmake_module_file_rel_path] - self.cpp_info.components[conan_component_target_name].build_modules["cmake_find_package_multi"] = [self._cmake_module_file_rel_path] - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - 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 = load(self, self._modules_helper_filepath) occt_modules = json.loads(occt_modules_json_content) _register_components(occt_modules) - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - 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/test_v1_package/CMakeLists.txt b/recipes/opencascade/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opencascade/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 13290d598bb5f..0000000000000 --- a/recipes/opencascade/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - bin_path_global = os.path.join("bin", "test_package_global") - self.run(bin_path_global, run_environment=True) diff --git a/recipes/opencl-clhpp-headers/all/conandata.yml b/recipes/opencl-clhpp-headers/all/conandata.yml index 8181b741f827c..dccc1bdf6f829 100644 --- a/recipes/opencl-clhpp-headers/all/conandata.yml +++ b/recipes/opencl-clhpp-headers/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/opencl-clhpp-headers/all/test_package/CMakeLists.txt b/recipes/opencl-clhpp-headers/all/test_package/CMakeLists.txt index 733d421e88716..a5dd1751330bf 100644 --- a/recipes/opencl-clhpp-headers/all/test_package/CMakeLists.txt +++ b/recipes/opencl-clhpp-headers/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) set(CMAKE_CXX_STANDARD 11) diff --git a/recipes/opencl-clhpp-headers/all/test_v1_package/CMakeLists.txt b/recipes/opencl-clhpp-headers/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opencl-clhpp-headers/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 92704204c75e6..0000000000000 --- a/recipes/opencl-clhpp-headers/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,15 +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): - pass diff --git a/recipes/opencl-clhpp-headers/config.yml b/recipes/opencl-clhpp-headers/config.yml index 2bf575fcc9451..33facd761b66c 100644 --- a/recipes/opencl-clhpp-headers/config.yml +++ b/recipes/opencl-clhpp-headers/config.yml @@ -1,4 +1,6 @@ versions: + "2023.12.14": + folder: all "2023.04.17": folder: all "2023.02.06": diff --git a/recipes/opencl-headers/all/conandata.yml b/recipes/opencl-headers/all/conandata.yml index d57be7c7026e9..c12029431ef1b 100644 --- a/recipes/opencl-headers/all/conandata.yml +++ b/recipes/opencl-headers/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/opencl-headers/all/test_package/CMakeLists.txt b/recipes/opencl-headers/all/test_package/CMakeLists.txt index bba1d5677babd..3378ac5aa294e 100644 --- a/recipes/opencl-headers/all/test_package/CMakeLists.txt +++ b/recipes/opencl-headers/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(OpenCLHeaders REQUIRED CONFIG) diff --git a/recipes/opencl-headers/all/test_v1_package/CMakeLists.txt b/recipes/opencl-headers/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opencl-headers/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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-headers/all/test_v1_package/conanfile.py b/recipes/opencl-headers/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/opencl-headers/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_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/opencl-headers/config.yml b/recipes/opencl-headers/config.yml index 2bf575fcc9451..33facd761b66c 100644 --- a/recipes/opencl-headers/config.yml +++ b/recipes/opencl-headers/config.yml @@ -1,4 +1,6 @@ versions: + "2023.12.14": + folder: all "2023.04.17": folder: all "2023.02.06": diff --git a/recipes/opencl-icd-loader/all/conandata.yml b/recipes/opencl-icd-loader/all/conandata.yml index 5deceedd582f2..41da7d924af19 100644 --- a/recipes/opencl-icd-loader/all/conandata.yml +++ b/recipes/opencl-icd-loader/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/opencl-icd-loader/all/conanfile.py b/recipes/opencl-icd-loader/all/conanfile.py index ae7aae3d17794..628589a59fc37 100644 --- a/recipes/opencl-icd-loader/all/conanfile.py +++ b/recipes/opencl-icd-loader/all/conanfile.py @@ -3,9 +3,10 @@ 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 +from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class OpenclIcdLoaderConan(ConanFile): @@ -63,6 +64,8 @@ def generate(self): tc.variables["OPENCL_ICD_LOADER_BUILD_TESTING"] = False if self.settings.os == "Windows": tc.variables["OPENCL_ICD_LOADER_DISABLE_OPENCLON12"] = self.options.disable_openclon12 + if Version(self.version) < "2024.10.24": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -92,9 +95,3 @@ def package_info(self): self.cpp_info.system_libs = ["dl", "pthread"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["cfgmgr32", "runtimeobject"] - - # TODO: to remove in conan v2 - self.cpp_info.filenames["cmake_find_package"] = "OpenCL" - self.cpp_info.filenames["cmake_find_package_multi"] = "OpenCLICDLoader" - self.cpp_info.names["cmake_find_package"] = "OpenCL" - self.cpp_info.names["cmake_find_package_multi"] = "OpenCL" diff --git a/recipes/opencl-icd-loader/all/test_package/CMakeLists.txt b/recipes/opencl-icd-loader/all/test_package/CMakeLists.txt index d33ec86059870..6fe6f9504662a 100644 --- a/recipes/opencl-icd-loader/all/test_package/CMakeLists.txt +++ b/recipes/opencl-icd-loader/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(OpenCLICDLoader REQUIRED CONFIG) diff --git a/recipes/opencl-icd-loader/all/test_v1_package/CMakeLists.txt b/recipes/opencl-icd-loader/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opencl-icd-loader/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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-icd-loader/all/test_v1_package/conanfile.py b/recipes/opencl-icd-loader/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/opencl-icd-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_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/opencl-icd-loader/config.yml b/recipes/opencl-icd-loader/config.yml index 48faee001ea5a..59d020bde1e4e 100644 --- a/recipes/opencl-icd-loader/config.yml +++ b/recipes/opencl-icd-loader/config.yml @@ -1,4 +1,6 @@ versions: + "2023.12.14": + folder: all "2023.04.17": folder: all "2023.02.06": diff --git a/recipes/opencolorio/all/conandata.yml b/recipes/opencolorio/all/conandata.yml index a48a93147f585..44d80be07476f 100644 --- a/recipes/opencolorio/all/conandata.yml +++ b/recipes/opencolorio/all/conandata.yml @@ -1,28 +1,32 @@ sources: - "2.3.0": - url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.3.0.tar.gz" - sha256: "32b7be676c110d849a77886d8a409159f0367309b2b2f5dae5aa0c38f42b445a" + "2.4.2": + url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.4.2.tar.gz" + sha256: "2d8f2c47c40476d6e8cea9d878f6601d04f6d5642b47018eaafa9e9f833f3690" + "2.4.1": + url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.4.1.tar.gz" + sha256: "d4eb15408b33dffd6ba0bba9a53328085b40bdd9319fa3d0d7348d06a8cbe842" + "2.3.2": + url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.3.2.tar.gz" + sha256: "6bbf4e7fa4ea2f743a238cb22aff44890425771a2f57f62cece1574e46ceec2f" "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" "1.1.1": 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" + "2.4.2": + - patch_file: "patches/2.4.2-0001-fix-cmake-source-dir-and-targets.patch" + patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" + patch_type: "conan" + "2.4.1": + - patch_file: "patches/2.4.0-0001-fix-cmake-source-dir-and-targets.patch" + patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" + patch_type: "conan" + "2.3.2": + - patch_file: "patches/2.3.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.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" @@ -33,20 +37,6 @@ patches: - 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/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-fix-cmake.patch" patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" diff --git a/recipes/opencolorio/all/conanfile.py b/recipes/opencolorio/all/conanfile.py index 13719aad33361..8f62ec7601b7c 100644 --- a/recipes/opencolorio/all/conanfile.py +++ b/recipes/opencolorio/all/conanfile.py @@ -18,6 +18,7 @@ class OpenColorIOConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" topics = ("colors", "visual", "effects", "animation") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -46,11 +47,11 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") if Version(self.version) < "2.2.0": self.requires("openexr/2.5.7") else: - self.requires("openexr/3.2.1") + self.requires("openexr/3.3.2") self.requires("imath/3.1.9") if Version(self.version) < "2.0.0": @@ -66,12 +67,11 @@ def requirements(self): self.requires("minizip-ng/3.0.9") # for tools only - self.requires("lcms/2.14") + self.requires("lcms/2.16") # TODO: add GLUT (needed for ociodisplay tool) def validate(self): - if self.settings.compiler.get_safe("cppstd"): - 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": @@ -90,12 +90,10 @@ def validate(self): # 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.") + raise ConanInvalidConfiguration(f"{self.ref} requires minizip-ng with with_zlib = True. On Apple platforms with_libcomp = False is also needed to enable the with_zlib option.") 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": @@ -199,12 +197,3 @@ def package_info(self): if is_msvc(self) and not self.options.shared: self.cpp_info.defines.append("OpenColorIO_SKIP_IMPORTS") - - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var with: {}".format(bin_path)) - self.env_info.PATH.append(bin_path) - - # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "OpenColorIO" - self.cpp_info.names["cmake_find_package_multi"] = "OpenColorIO" - self.cpp_info.names["pkg_config"] = "OpenColorIO" diff --git a/recipes/opencolorio/all/patches/1.1.1.patch b/recipes/opencolorio/all/patches/1.1.1.patch deleted file mode 100644 index 579e529242a44..0000000000000 --- a/recipes/opencolorio/all/patches/1.1.1.patch +++ /dev/null @@ -1,283 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e4f31196..b73396b4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -4,11 +4,13 @@ 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::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 b9fb2393..b1a206e7 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 d31b4e34..4aa1efb2 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 4955f4db..14b5017f 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 8b05debc..a7d6031f 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 1eb691b6..a2f099ab 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 68fcef60..a1c1c1d8 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 deleted file mode 100644 index 5de7b145077d6..0000000000000 --- a/recipes/opencolorio/all/patches/2.1.0-0001-fix-cmake-source-dir-and-targets.patch +++ /dev/null @@ -1,61 +0,0 @@ -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 deleted file mode 100644 index 38f15d7e20889..0000000000000 --- a/recipes/opencolorio/all/patches/2.1.0-0002-fix-pystring.patch +++ /dev/null @@ -1,117 +0,0 @@ -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 deleted file mode 100644 index b90bcdfcf5d57..0000000000000 --- a/recipes/opencolorio/all/patches/2.1.0-0003-strlen.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 50d9ce38deeed..0000000000000 --- a/recipes/opencolorio/all/patches/2.1.0-0004-fix-cpp-version-check.patch +++ /dev/null @@ -1,18 +0,0 @@ -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 index b4e6f3c13f990..115857775079d 100644 --- a/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch +++ b/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch @@ -73,7 +73,7 @@ index 1c4d774..da70227 100755 "$" yaml-cpp - MINIZIP::minizip-ng -+ MINIZIP::minizip ++ PUBLIC MINIZIP::minizip ) if(APPLE) 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 deleted file mode 100644 index 30c7ddf4a390d..0000000000000 --- a/recipes/opencolorio/all/patches/2.3.0-0001-fix-cmake-source-dir-and-targets.patch +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100644 index 020aa7dccfebc..0000000000000 --- a/recipes/opencolorio/all/patches/2.3.0-0002-fix-pystring.patch +++ /dev/null @@ -1,195 +0,0 @@ -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/patches/2.3.1-0001-fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/2.3.1-0001-fix-cmake-source-dir-and-targets.patch new file mode 100644 index 0000000000000..8b057e40e2eb1 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.3.1-0001-fix-cmake-source-dir-and-targets.patch @@ -0,0 +1,101 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 7b62a993..5ea33694 100755 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -511,7 +511,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 share/cmake/modules/FindExtPackages.cmake share/cmake/modules/FindExtPackages.cmake +index 2625242c..dcb41cf2 100644 +--- share/cmake/modules/FindExtPackages.cmake ++++ 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 share/cmake/utils/CppVersion.cmake share/cmake/utils/CppVersion.cmake +index 175d89c2..ac93b87a 100644 +--- share/cmake/utils/CppVersion.cmake ++++ share/cmake/utils/CppVersion.cmake +@@ -16,7 +16,7 @@ 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}") ++# set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") + + include(CheckCXXCompilerFlag) + +diff --git src/OpenColorIO/CMakeLists.txt src/OpenColorIO/CMakeLists.txt +index 26b4bb4c..d54cff3d 100755 +--- src/OpenColorIO/CMakeLists.txt ++++ src/OpenColorIO/CMakeLists.txt +@@ -309,8 +309,8 @@ target_link_libraries(OpenColorIO + "$" + "$" + "$" +- ${YAML_CPP_LIBRARIES} +- MINIZIP::minizip-ng ++ PUBLIC yaml-cpp ++ MINIZIP::minizip + ) + + if(OCIO_USE_SIMD AND OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_SSE_WITH_SSE2NEON) +diff --git src/apps/ocioarchive/CMakeLists.txt src/apps/ocioarchive/CMakeLists.txt +index 599d706f..efe6cd5a 100644 +--- src/apps/ocioarchive/CMakeLists.txt ++++ 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 src/apps/ociobakelut/CMakeLists.txt src/apps/ociobakelut/CMakeLists.txt +index 3d6e586b..f7069a1f 100755 +--- src/apps/ociobakelut/CMakeLists.txt ++++ 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.4.0-0001-fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/2.4.0-0001-fix-cmake-source-dir-and-targets.patch new file mode 100644 index 0000000000000..35a7af01ea95d --- /dev/null +++ b/recipes/opencolorio/all/patches/2.4.0-0001-fix-cmake-source-dir-and-targets.patch @@ -0,0 +1,101 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 0eaec4be..e711295c 100755 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -511,7 +511,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 share/cmake/modules/FindExtPackages.cmake share/cmake/modules/FindExtPackages.cmake +index accdecec..945c5edc 100644 +--- share/cmake/modules/FindExtPackages.cmake ++++ 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 share/cmake/utils/CppVersion.cmake share/cmake/utils/CppVersion.cmake +index 175d89c2..ac93b87a 100644 +--- share/cmake/utils/CppVersion.cmake ++++ share/cmake/utils/CppVersion.cmake +@@ -16,7 +16,7 @@ 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}") ++# set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") + + include(CheckCXXCompilerFlag) + +diff --git src/OpenColorIO/CMakeLists.txt src/OpenColorIO/CMakeLists.txt +index 7d2894da..1e6570b4 100755 +--- src/OpenColorIO/CMakeLists.txt ++++ src/OpenColorIO/CMakeLists.txt +@@ -315,8 +315,8 @@ target_link_libraries(OpenColorIO + "$" + "$" + "$" +- ${YAML_CPP_LIBRARIES} +- MINIZIP::minizip-ng ++ PUBLIC yaml-cpp ++ MINIZIP::minizip + ) + + if(OCIO_USE_SIMD AND OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_SSE_WITH_SSE2NEON) +diff --git src/apps/ocioarchive/CMakeLists.txt src/apps/ocioarchive/CMakeLists.txt +index 599d706f..efe6cd5a 100644 +--- src/apps/ocioarchive/CMakeLists.txt ++++ 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 src/apps/ociobakelut/CMakeLists.txt src/apps/ociobakelut/CMakeLists.txt +index 3d6e586b..f7069a1f 100755 +--- src/apps/ociobakelut/CMakeLists.txt ++++ 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.4.2-0001-fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/2.4.2-0001-fix-cmake-source-dir-and-targets.patch new file mode 100644 index 0000000000000..b626b72127d97 --- /dev/null +++ b/recipes/opencolorio/all/patches/2.4.2-0001-fix-cmake-source-dir-and-targets.patch @@ -0,0 +1,101 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 3feba7ee..b4c2d473 100755 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -518,7 +518,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 share/cmake/modules/FindExtPackages.cmake share/cmake/modules/FindExtPackages.cmake +index aa2550ac..04b51b25 100644 +--- share/cmake/modules/FindExtPackages.cmake ++++ 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 share/cmake/utils/CppVersion.cmake share/cmake/utils/CppVersion.cmake +index 175d89c2..ac93b87a 100644 +--- share/cmake/utils/CppVersion.cmake ++++ share/cmake/utils/CppVersion.cmake +@@ -16,7 +16,7 @@ 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}") ++# set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") + + include(CheckCXXCompilerFlag) + +diff --git src/OpenColorIO/CMakeLists.txt src/OpenColorIO/CMakeLists.txt +index 7d2894da..33540a11 100755 +--- src/OpenColorIO/CMakeLists.txt ++++ src/OpenColorIO/CMakeLists.txt +@@ -315,8 +315,8 @@ target_link_libraries(OpenColorIO + "$" + "$" + "$" +- ${YAML_CPP_LIBRARIES} +- MINIZIP::minizip-ng ++ PUBLIC yaml-cpp ++ MINIZIP::minizip + ) + + if(OCIO_USE_SIMD AND OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_SSE_WITH_SSE2NEON) +diff --git src/apps/ocioarchive/CMakeLists.txt src/apps/ocioarchive/CMakeLists.txt +index 599d706f..efe6cd5a 100644 +--- src/apps/ocioarchive/CMakeLists.txt ++++ 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 src/apps/ociobakelut/CMakeLists.txt src/apps/ociobakelut/CMakeLists.txt +index 3d6e586b..f7069a1f 100755 +--- src/apps/ociobakelut/CMakeLists.txt ++++ 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/fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/fix-cmake-source-dir-and-targets.patch deleted file mode 100644 index c9f1055c82e2c..0000000000000 --- a/recipes/opencolorio/all/patches/fix-cmake-source-dir-and-targets.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b0840ac2..e4875ab6 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 86a02258..a8fed622 100644 ---- a/share/cmake/modules/FindExtPackages.cmake -+++ b/share/cmake/modules/FindExtPackages.cmake -@@ -26,7 +26,7 @@ set(CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY ON CACHE BOOL - - # expat - # https://github.com/libexpat/libexpat --find_package(expat 2.2.8 REQUIRED) -+find_package(EXPAT 2.2.8 REQUIRED) - - # yaml-cpp - # https://github.com/jbeder/yaml-cpp -@@ -50,9 +50,9 @@ 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_HALF_LIB OpenEXR::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) - endif() - -@@ -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/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt -index be50b7b6..8423a099 100755 ---- a/src/OpenColorIO/CMakeLists.txt -+++ b/src/OpenColorIO/CMakeLists.txt -@@ -211,7 +211,7 @@ target_link_libraries(OpenColorIO - PUBLIC - OpenColorIOHeaders - PRIVATE -- expat::expat -+ EXPAT::EXPAT - ${OCIO_HALF_LIB} - pystring::pystring - sampleicc::sampleicc -diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt -index 7eb1cd8a..de136073 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/pstring.patch b/recipes/opencolorio/all/patches/pstring.patch deleted file mode 100644 index 38f15d7e20889..0000000000000 --- a/recipes/opencolorio/all/patches/pstring.patch +++ /dev/null @@ -1,117 +0,0 @@ -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/strlen.patch b/recipes/opencolorio/all/patches/strlen.patch deleted file mode 100644 index b90bcdfcf5d57..0000000000000 --- a/recipes/opencolorio/all/patches/strlen.patch +++ /dev/null @@ -1,12 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/opencolorio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/opencolorio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/opencolorio/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/opencolorio/config.yml b/recipes/opencolorio/config.yml index 89be14d13a1d0..3fa83eef519bb 100644 --- a/recipes/opencolorio/config.yml +++ b/recipes/opencolorio/config.yml @@ -1,9 +1,11 @@ versions: - "2.3.0": + "2.4.2": folder: "all" - "2.2.1": + "2.4.1": + folder: "all" + "2.3.2": folder: "all" - "2.1.0": + "2.2.1": folder: "all" "1.1.1": folder: "all" diff --git a/recipes/opencore-amr/all/test_v1_package/CMakeLists.txt b/recipes/opencore-amr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opencore-amr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index e16563695d6b4..0000000000000 --- a/recipes/opencore-amr/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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 a256803f12717..7f1808f99222b 100644 --- a/recipes/opencv/2.x/conanfile.py +++ b/recipes/opencv/2.x/conanfile.py @@ -10,7 +10,7 @@ import os import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" OPENCV_MAIN_MODULES_OPTIONS = ( @@ -364,13 +364,13 @@ def requirements(self): 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/3.0.0") + self.requires("libjpeg-turbo/[>=3.0.3 <4]") elif self.options.get_safe("with_jpeg") == "mozjpeg": - self.requires("mozjpeg/4.1.3") + self.requires("mozjpeg/[^4.1.5]") if self.options.get_safe("with_png"): - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.get_safe("with_jasper"): - self.requires("jasper/4.0.0") + self.requires("jasper/4.2.0") if self.options.get_safe("with_openexr"): # opencv 2.x doesn't support openexr >= 3 self.requires("openexr/2.5.7") @@ -515,6 +515,7 @@ def generate(self): tc.variables["ENABLE_CCACHE"] = False if is_msvc(self): tc.variables["BUILD_WITH_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() CMakeDeps(self).generate() @@ -536,15 +537,6 @@ def package(self): 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_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. @@ -567,25 +559,10 @@ def _create_cmake_module_variables(self, module_file): """) save(self, module_file, content) - 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_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 def _cmake_target(module): return f"opencv_{module}" @@ -638,15 +615,8 @@ def add_components(components): 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_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 - 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 = [] @@ -657,15 +627,7 @@ def add_components(components): 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] - 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) - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "OpenCV" - self.cpp_info.filenames["cmake_find_package_multi"] = "OpenCV" diff --git a/recipes/opencv/2.x/test_package/CMakeLists.txt b/recipes/opencv/2.x/test_package/CMakeLists.txt index d43070a4b5daf..6bcb4be20a3e1 100644 --- a/recipes/opencv/2.x/test_package/CMakeLists.txt +++ b/recipes/opencv/2.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 CXX) find_package(OpenCV REQUIRED core CONFIG) diff --git a/recipes/opencv/2.x/test_v1_package/CMakeLists.txt b/recipes/opencv/2.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opencv/2.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/opencv/2.x/test_v1_package/conanfile.py b/recipes/opencv/2.x/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/opencv/2.x/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_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/opencv/3.x/conandata.yml b/recipes/opencv/3.x/conandata.yml index fb7fa44fa31ae..d101d4fb7d2ce 100644 --- a/recipes/opencv/3.x/conandata.yml +++ b/recipes/opencv/3.x/conandata.yml @@ -1,11 +1,26 @@ 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" patches: + "3.4.20": + - patch_file: "patches/3.4.17-0001-find-openexr.patch" + patch_description: "Robust discovery & injection of OpenEXR" + patch_type: "conan" + - patch_file: "patches/3.4.17-0002-cmake4-support.patch" + patch_description: "Upgrade minimum cmake version on OpenCVGenPkgconfig" + patch_type: "portability" "3.4.17": - patch_file: "patches/3.4.17-0001-find-openexr.patch" patch_description: "Robust discovery & injection of OpenEXR" patch_type: "conan" + - patch_file: "patches/3.4.17-0002-cmake4-support.patch" + patch_description: "Upgrade minimum cmake version on OpenCVGenPkgconfig" + patch_type: "portability" diff --git a/recipes/opencv/3.x/conanfile.py b/recipes/opencv/3.x/conanfile.py index 94f59dc50fb8e..3f9a11fa30548 100644 --- a/recipes/opencv/3.x/conanfile.py +++ b/recipes/opencv/3.x/conanfile.py @@ -7,7 +7,7 @@ import os import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class OpenCVConan(ConanFile): @@ -100,7 +100,7 @@ def requirements(self): if self.options.with_webp: self.requires("libwebp/1.3.2") if self.options.contrib: - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") self.requires("harfbuzz/8.2.2") self.requires("gflags/2.2.2") self.requires("glog/0.6.0") @@ -253,6 +253,7 @@ def generate(self): tc.variables["BUILD_WITH_STATIC_CRT"] = is_msvc_static_runtime(self) tc.variables["ENABLE_PIC"] = self.options.get_safe("fPIC", True) tc.variables["ENABLE_CCACHE"] = False + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() CMakeDeps(self).generate() @@ -275,12 +276,6 @@ def package(self): 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_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. @@ -303,25 +298,10 @@ def _create_cmake_module_variables(self, module_file): """) save(self, module_file, content) - 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_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 def _opencv_components(self): def imageformats_deps(): @@ -442,15 +422,8 @@ def add_components(components): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components[conan_component].system_libs = ["dl", "m", "pthread", "rt"] - # 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_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 - self.cpp_info.components[conan_component_alias].names["cmake_find_package_multi"] = cmake_component 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 = [] @@ -465,7 +438,3 @@ def add_components(components): self.cpp_info.components["opencv_imgcodecs"].system_libs = ["comctl32", "gdi32", "ole32", "setupapi", "ws2_32", "vfw32"] elif self.settings.os == "Macos": self.cpp_info.components["opencv_imgcodecs"].frameworks = ["OpenCL", "Accelerate", "CoreMedia", "CoreVideo", "CoreGraphics", "AVFoundation", "QuartzCore", "Cocoa"] - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "OpenCV" - self.cpp_info.filenames["cmake_find_package_multi"] = "OpenCV" diff --git a/recipes/opencv/3.x/patches/3.4.17-0002-cmake4-support.patch b/recipes/opencv/3.x/patches/3.4.17-0002-cmake4-support.patch new file mode 100644 index 0000000000000..7a998e2db2b18 --- /dev/null +++ b/recipes/opencv/3.x/patches/3.4.17-0002-cmake4-support.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake +index 425c0fa..9642a4b 100644 +--- a/cmake/OpenCVGenPkgconfig.cmake ++++ b/cmake/OpenCVGenPkgconfig.cmake +@@ -110,7 +110,7 @@ endif() + # ============================================================================= + else() # DEFINED CMAKE_HELPER_SCRIPT + +-cmake_minimum_required(VERSION 2.8.12.2) ++cmake_minimum_required(VERSION 3.5) + cmake_policy(SET CMP0012 NEW) + include("${CMAKE_HELPER_SCRIPT}") + include("${OpenCV_SOURCE_DIR}/cmake/OpenCVUtils.cmake") diff --git a/recipes/opencv/3.x/test_package/CMakeLists.txt b/recipes/opencv/3.x/test_package/CMakeLists.txt index 779574ba19f62..4d6af9f159231 100644 --- a/recipes/opencv/3.x/test_package/CMakeLists.txt +++ b/recipes/opencv/3.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 CXX) option(built_contrib "Enabled if opencv is built contrib sfm" OFF) diff --git a/recipes/opencv/3.x/test_v1_package/CMakeLists.txt b/recipes/opencv/3.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opencv/3.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/opencv/3.x/test_v1_package/conanfile.py b/recipes/opencv/3.x/test_v1_package/conanfile.py deleted file mode 100644 index 3f79fd5e038ff..0000000000000 --- a/recipes/opencv/3.x/test_v1_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.definitions["built_contrib"] = self.options["opencv"].contrib - 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/4.x/conandata.yml b/recipes/opencv/4.x/conandata.yml index 867bde99de61c..118e2cbdd36c4 100644 --- a/recipes/opencv/4.x/conandata.yml +++ b/recipes/opencv/4.x/conandata.yml @@ -1,4 +1,19 @@ sources: + "4.11.0": + - url: "https://github.com/opencv/opencv/archive/refs/tags/4.11.0.tar.gz" + sha256: "9a7c11f924eff5f8d8070e297b322ee68b9227e003fd600d4b8122198091665f" + - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.11.0.tar.gz" + sha256: "2dfc5957201de2aa785064711125af6abb2e80a64e2dc246aca4119b19687041" + "4.10.0": + - url: "https://github.com/opencv/opencv/archive/refs/tags/4.10.0.tar.gz" + sha256: "b2171af5be6b26f7a06b1229948bbb2bdaa74fcf5cd097e0af6378fce50a6eb9" + - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.10.0.tar.gz" + sha256: "65597f8fb8dc2b876c1b45b928bbcc5f772ddbaf97539bf1b737623d0604cba1" + "4.9.0": + - url: "https://github.com/opencv/opencv/archive/refs/tags/4.9.0.tar.gz" + sha256: "ddf76f9dffd322c7c3cb1f721d0887f62d747b82059342213138dc190f28bc6c" + - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.9.0.tar.gz" + sha256: "8952c45a73b75676c522dd574229f563e43c271ae1d5bbbd26f8e2b6bc1a4dae" "4.8.1": - url: "https://github.com/opencv/opencv/archive/refs/tags/4.8.1.tar.gz" sha256: "62f650467a60a38794d681ae7e66e3e8cfba38f445e0bf87867e2f2cdc8be9d5" @@ -20,6 +35,78 @@ sources: - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.1.2.tar.gz" sha256: "0f6c3d30baa39e3e7611afb481ee86dea45dafb182cac87d570c95dccd83eb8b" patches: + "4.11.0": + - 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.11.0-0001-fix-zlib-static-android.patch" + patch_description: "Fix discovery of zlib static if Android" + patch_type: "conan" + - patch_file: "patches/4.10.0-0002-include-exception-header.patch" + patch_description: "Include required standard header" + 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" + "4.10.0": + - 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.10.0-0001-fix-zlib-static-android.patch" + patch_description: "Fix discovery of zlib static if Android" + patch_type: "conan" + - patch_file: "patches/4.10.0-0002-include-exception-header.patch" + patch_description: "Include required standard header" + 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" + "4.9.0": + - 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" "4.8.1": - patch_file: "patches/4.5.5-0001-find-openexr.patch" patch_description: "Robust discovery & injection of OpenEXR" @@ -27,6 +114,9 @@ patches: - 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-0004-link-qt-targets.patch" + patch_description: "Link to Qt through CMake targets" + patch_type: "conan" - patch_file: "patches/4.8.1-0001-find-ade.patch" patch_description: "Robust discovery & injection of ade" patch_type: "conan" diff --git a/recipes/opencv/4.x/conanfile.py b/recipes/opencv/4.x/conanfile.py index 31a4382eaa728..2659f7bfd366e 100644 --- a/recipes/opencv/4.x/conanfile.py +++ b/recipes/opencv/4.x/conanfile.py @@ -6,7 +6,7 @@ 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.microsoft import msvc_runtime_flag from conan.tools.scm import Version import os import re @@ -122,6 +122,7 @@ class OpenCVConan(ConanFile): "with_flatbuffers": [True, False], "with_protobuf": [True, False], "with_vulkan": [True, False], + "with_openvino": [True, False], "dnn_cuda": [True, False], # highgui module options "with_gtk": [True, False], @@ -181,6 +182,7 @@ class OpenCVConan(ConanFile): "with_flatbuffers": True, "with_protobuf": True, "with_vulkan": False, + "with_openvino": False, "dnn_cuda": False, # highgui module options "with_gtk": False, @@ -191,15 +193,15 @@ class OpenCVConan(ConanFile): "with_jpeg": "libjpeg", "with_png": True, "with_tiff": True, - "with_jpeg2000": "jasper", + "with_jpeg2000": "openjpeg", "with_openexr": True, "with_webp": True, "with_gdal": False, "with_gdcm": False, - "with_imgcodec_hdr": False, - "with_imgcodec_pfm": False, - "with_imgcodec_pxm": False, - "with_imgcodec_sunraster": False, + "with_imgcodec_hdr": True, + "with_imgcodec_pfm": True, + "with_imgcodec_pxm": True, + "with_imgcodec_sunraster": True, "with_msmf": True, "with_msmf_dxva": True, # objdetect module options @@ -220,6 +222,14 @@ class OpenCVConan(ConanFile): short_paths = True + @property + def _is_cl_like(self): + return self.settings.compiler.get_safe("runtime") is not None + + @property + def _is_cl_like_static_runtime(self): + return self._is_cl_like and "MT" in msvc_runtime_flag(self) + @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" @@ -276,6 +286,10 @@ def _has_wechat_qrcode_option(self): def _has_barcode_option(self): return Version(self.version) >= "4.5.3" and Version(self.version) < "4.8.0" + @property + def _has_openvino_option(self): + return Version(self.version) >= "4.10.0" + @property def _has_with_wayland_option(self): return Version(self.version) >= "4.7.0" and self.settings.os in ["Linux", "FreeBSD"] @@ -311,10 +325,13 @@ def config_options(self): else: del self.options.with_ffmpeg - if "arm" not in self.settings.arch: - del self.options.neon if not self._has_with_jpeg2000_option: del self.options.with_jpeg2000 + elif Version(self.version) < "4.3.0": + self.options.with_jpeg2000 = "jasper" + + if "arm" not in self.settings.arch or Version(self.version) >= "4.11.0": + del self.options.neon if not self._has_with_tiff_option: del self.options.with_tiff if not self._has_superres_option: @@ -422,6 +439,9 @@ def wayland(): def xkbcommon(): return ["xkbcommon::libxkbcommon"] if self.options.get_safe("with_wayland") else [] + def openvino(): + return ["openvino::Runtime"] if self.options.get_safe("with_openvino") else [] + def opencv_calib3d(): return ["opencv_calib3d"] if self.options.calib3d else [] @@ -496,7 +516,7 @@ def opencv_xfeatures2d(): "dnn": { "is_built": self.options.dnn, "mandatory_options": ["imgproc"], - "requires": ["opencv_core", "opencv_imgproc"] + protobuf() + vulkan() + ipp(), + "requires": ["opencv_core", "opencv_imgproc"] + protobuf() + vulkan() + ipp() + openvino(), }, "features2d": { "is_built": self.options.features2d, @@ -510,7 +530,7 @@ def opencv_xfeatures2d(): "gapi": { "is_built": self.options.gapi, "mandatory_options": ["imgproc"], - "requires": ["opencv_imgproc", "ade::ade"], + "requires": ["opencv_imgproc", "ade::ade"] + openvino(), "system_libs": [ (self.settings.os == "Windows", ["ws2_32", "wsock32"]), ], @@ -654,7 +674,7 @@ def opencv_xfeatures2d(): "cudaoptflow": { "is_built": self.options.cudaoptflow, "mandatory_options": ["with_cuda", "video", "cudaarithm", "cudaimgproc", "cudawarping", "optflow"], - "requires": ["opencv_video", "opencv_cudaarithm", "cudaimgproc", "opencv_cudawarping", + "requires": ["opencv_video", "opencv_cudaarithm", "opencv_cudaimgproc", "opencv_cudawarping", "opencv_optflow"] + opencv_cudalegacy() + ipp(), }, "cudastereo": { @@ -1030,6 +1050,9 @@ def configure(self): # Call this first before any further manipulation of options based on other options self._solve_internal_dependency_graph(self._opencv_modules) + if not (self._has_openvino_option and (self.options.gapi or self.options.dnn)): + self.options.rm_safe("with_openvino") + if not self.options.dnn: self.options.rm_safe("dnn_cuda") self.options.rm_safe("with_flatbuffers") @@ -1094,6 +1117,8 @@ def requirements(self): self.requires("protobuf/3.21.12", transitive_libs=True) if self.options.get_safe("with_vulkan"): self.requires("vulkan-headers/1.3.268.0") + if self.options.get_safe("with_openvino"): + self.requires("openvino/[>=2024.5.0 <=2025.0.0]") # gapi module dependencies if self.options.gapi: self.requires("ade/0.1.2d") @@ -1101,35 +1126,35 @@ def requirements(self): if self.options.get_safe("with_gtk"): self.requires("gtk/system") if self.options.get_safe("with_qt"): - self.requires("qt/5.15.11") + self.requires("qt/5.15.12") 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") + self.requires("libavif/1.0.4") 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/3.0.0") + self.requires("libjpeg-turbo/3.0.2") elif self.options.get_safe("with_jpeg") == "mozjpeg": - self.requires("mozjpeg/4.1.3") + self.requires("mozjpeg/4.1.5") if self.options.get_safe("with_jpeg2000") == "jasper": - self.requires("jasper/4.0.0") + self.requires("jasper/4.2.0") elif self.options.get_safe("with_jpeg2000") == "openjpeg": - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.get_safe("with_png"): - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.2.1") + self.requires("openexr/3.2.3") if self.options.get_safe("with_tiff"): 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") + self.requires("gdal/3.8.3") if self.options.get_safe("with_gdcm"): - self.requires("gdcm/3.0.21") + self.requires("gdcm/3.0.23") # objdetect module dependencies if self.options.get_safe("with_quirc"): self.requires("quirc/1.2") @@ -1139,21 +1164,21 @@ def requirements(self): 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") + self.requires("freetype/2.13.2") + self.requires("harfbuzz/8.3.0") # hdf module dependencies if self.options.hdf: - self.requires("hdf5/1.14.2") + self.requires("hdf5/1.14.3") # 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") + self.requires("glog/0.7.0") # text module dependencies if self.options.get_safe("with_tesseract"): - self.requires("tesseract/5.3.0") + self.requires("tesseract/5.3.3") def package_id(self): # deprecated options @@ -1190,8 +1215,8 @@ 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.options.shared and self._is_cl_like and self._is_cl_like_static_runtime: + raise ConanInvalidConfiguration("MSVC or clang-cl with static runtime are 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.get_safe("dnn_cuda") and \ @@ -1204,17 +1229,20 @@ def validate(self): raise ConanInvalidConfiguration( "viz module can't be enabled yet. It requires VTK which is not available in conan-center." ) + if self.options.get_safe("with_jpeg2000") == "openjpeg" and Version(self.version) < "4.3.0": + raise ConanInvalidConfiguration("openjpeg is not available for OpenCV before 4.3.0") + def build_requirements(self): 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") + self.tool_requires("wayland-protocols/1.33") 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") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version][0], strip_root=True) @@ -1238,6 +1266,10 @@ def _patch_sources(self): 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)") + ## Upstream CMakeLists vendors quirc in CMakeLists of 3rdparty/quirc. + ## Instead we rely on find-quirc.patch in order to link external quirc. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(3rdparty/quirc)", "") + ## 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") @@ -1272,28 +1304,9 @@ def _patch_sources(self): "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: - 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}\")", "") @@ -1430,10 +1443,11 @@ def generate(self): tc.variables["WITH_OPENNI"] = False tc.variables["WITH_OPENNI2"] = False tc.variables["WITH_OPENVX"] = False + tc.variables["WITH_CAROTENE"] = False tc.variables["WITH_PLAIDML"] = False tc.variables["WITH_PVAPI"] = False tc.variables["WITH_QT"] = self.options.get_safe("with_qt", False) - tc.variables["WITH_QUIRC"] = False + tc.variables["WITH_QUIRC"] = self.options.get_safe("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 @@ -1459,7 +1473,7 @@ def generate(self): 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["WITH_DSHOW"] = is_msvc(self) + tc.variables["WITH_DSHOW"] = self._is_cl_like tc.variables["WITH_MSMF"] = self.options.get_safe("with_msmf", False) tc.variables["WITH_MSMF_DXVA"] = self.options.get_safe("with_msmf_dxva", False) tc.variables["OPENCV_MODULES_PUBLIC"] = "opencv" @@ -1471,12 +1485,10 @@ def generate(self): if self.options.cpu_dispatch or self.options.cpu_dispatch == "": tc.variables["CPU_DISPATCH"] = self.options.cpu_dispatch - tc.variables["ENABLE_NEON"] = self.options.get_safe("neon", False) - tc.variables["OPENCV_DNN_CUDA"] = self.options.get_safe("dnn_cuda", False) if Version(self.version) >= "4.6.0": - tc.variables["WITH_OPENVINO"] = False + tc.variables["WITH_OPENVINO"] = self.options.get_safe("with_openvino", False) tc.variables["WITH_TIMVX"] = False else: tc.variables["WITH_INF_ENGINE"] = False @@ -1492,6 +1504,20 @@ def generate(self): tc.variables["WITH_AVIF"] = self.options.get_safe("with_avif", False) tc.variables["WITH_FLATBUFFERS"] = self.options.get_safe("with_flatbuffers", False) + if Version(self.version) >= "4.10.0": + tc.variables["WITH_KLEIDICV"] = False + tc.variables["WITH_NDSRVP"] = False + tc.variables["OBSENSOR_USE_ORBBEC_SDK"] = False + if is_apple_os(self): + # default behavior for 4.9.0 + tc.variables["WITH_OBSENSOR"] = False + tc.variables["WITH_ZLIB_NG"] = False + + if Version(self.version) >= "4.11.0": + tc.variables["WITH_HAL_RVV"] = False + else: + tc.variables["ENABLE_NEON"] = self.options.get_safe("neon", False) + # Special world option merging all enabled modules into one big library file tc.variables["BUILD_opencv_world"] = self.options.world @@ -1503,8 +1529,6 @@ def generate(self): 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: @@ -1538,8 +1562,8 @@ def generate(self): tc.variables["ENABLE_PIC"] = self.options.get_safe("fPIC", True) tc.variables["ENABLE_CCACHE"] = False - if is_msvc(self): - tc.variables["BUILD_WITH_STATIC_CRT"] = is_msvc_static_runtime(self) + if self._is_cl_like: + tc.variables["BUILD_WITH_STATIC_CRT"] = self._is_cl_like_static_runtime if self.settings.os == "Android": tc.variables["BUILD_ANDROID_EXAMPLES"] = False @@ -1550,7 +1574,21 @@ def generate(self): if self.options.get_safe("with_wayland"): deps = PkgConfigDeps(self) - if not self._is_legacy_one_profile: + if self._is_legacy_one_profile: + # Manually generate pkgconfig file of wayland-protocols since + # PkgConfigDeps.build_context_activated can't work with legacy 1 profile + wp_prefix = self.dependencies.build["wayland-protocols"].package_folder + wp_version = self.dependencies.build["wayland-protocols"].ref.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) + else: deps.build_context_activated = ["wayland-protocols"] deps.generate() diff --git a/recipes/opencv/4.x/patches/4.10.0-0001-fix-zlib-static-android.patch b/recipes/opencv/4.x/patches/4.10.0-0001-fix-zlib-static-android.patch new file mode 100644 index 0000000000000..aae16f037e565 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.10.0-0001-fix-zlib-static-android.patch @@ -0,0 +1,17 @@ +--- a/cmake/OpenCVFindLibsGrfmt.cmake ++++ b/cmake/OpenCVFindLibsGrfmt.cmake +@@ -20,12 +20,12 @@ if(BUILD_ZLIB) + ocv_clear_vars(ZLIB_FOUND) + else() + ocv_clear_internal_cache_vars(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) +- if(ANDROID) ++ if(0) + set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + set(CMAKE_FIND_LIBRARY_SUFFIXES .so) + endif() + find_package(ZLIB "${MIN_VER_ZLIB}") +- if(ANDROID) ++ if(0) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) + unset(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) + endif() diff --git a/recipes/opencv/4.x/patches/4.10.0-0002-include-exception-header.patch b/recipes/opencv/4.x/patches/4.10.0-0002-include-exception-header.patch new file mode 100644 index 0000000000000..ed3a5afb29bbb --- /dev/null +++ b/recipes/opencv/4.x/patches/4.10.0-0002-include-exception-header.patch @@ -0,0 +1,48 @@ +From 76ac8864f189e600814015cf419afc162e2ef0e1 Mon Sep 17 00:00:00 2001 +From: Mal +Date: Thu, 6 Feb 2025 09:02:14 +0100 +Subject: [PATCH 1/2] Add missing include in gislandmodel.hpp + +--- + modules/gapi/src/compiler/gislandmodel.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules/gapi/src/compiler/gislandmodel.hpp b/modules/gapi/src/compiler/gislandmodel.hpp +index ade13a6f3338..c2efb3eba7aa 100644 +--- a/modules/gapi/src/compiler/gislandmodel.hpp ++++ b/modules/gapi/src/compiler/gislandmodel.hpp +@@ -10,6 +10,7 @@ + + #include + #include // shared_ptr ++#include // exception_ptr + + #include + #include + +From 86c327a90a37ef01a4bc820b76199f4e0d095ff0 Mon Sep 17 00:00:00 2001 +From: Mal +Date: Thu, 6 Feb 2025 09:05:09 +0100 +Subject: [PATCH 2/2] Add two more missing includes + +--- + modules/gapi/src/compiler/gislandmodel.hpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/modules/gapi/src/compiler/gislandmodel.hpp b/modules/gapi/src/compiler/gislandmodel.hpp +index c2efb3eba7aa..ebc6a68753b3 100644 +--- a/modules/gapi/src/compiler/gislandmodel.hpp ++++ b/modules/gapi/src/compiler/gislandmodel.hpp +@@ -8,9 +8,11 @@ + #ifndef OPENCV_GAPI_GISLANDMODEL_HPP + #define OPENCV_GAPI_GISLANDMODEL_HPP + +-#include ++#include // unordered_map + #include // shared_ptr + #include // exception_ptr ++#include // string ++#include // size_t + + #include + #include diff --git a/recipes/opencv/4.x/patches/4.11.0-0001-fix-zlib-static-android.patch b/recipes/opencv/4.x/patches/4.11.0-0001-fix-zlib-static-android.patch new file mode 100644 index 0000000000000..f9e0b62f0a592 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.11.0-0001-fix-zlib-static-android.patch @@ -0,0 +1,23 @@ +--- a/cmake/OpenCVFindLibsGrfmt.cmake ++++ b/cmake/OpenCVFindLibsGrfmt.cmake +@@ -20,18 +20,18 @@ if(BUILD_ZLIB) + ocv_clear_vars(ZLIB_FOUND) + else() + ocv_clear_internal_cache_vars(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) +- if(ANDROID) ++ if(0) + set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + set(CMAKE_FIND_LIBRARY_SUFFIXES .so) + endif() + if(QNX) + set(ZLIB_FOUND TRUE) + set(ZLIB_LIBRARY z) + set(ZLIB_LIBRARIES z) + else() + find_package(ZLIB "${MIN_VER_ZLIB}") + endif() +- if(ANDROID) ++ if(0) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) + unset(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) + endif() diff --git a/recipes/opencv/4.x/patches/4.8.1-0004-link-qt-targets.patch b/recipes/opencv/4.x/patches/4.8.1-0004-link-qt-targets.patch new file mode 100644 index 0000000000000..d4ceb77155293 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.8.1-0004-link-qt-targets.patch @@ -0,0 +1,22 @@ +--- a/contrib/modules/cvv/CMakeLists.txt ++++ b/contrib/modules/cvv/CMakeLists.txt +@@ -18,7 +18,7 @@ + set(CMAKE_AUTOMOC ON) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + foreach(module ${CVV_QT_MODULES}) +- list(APPEND CVV_LIBRARIES ${Qt${QT_VERSION_MAJOR}${module}_LIBRARIES}) ++ list(APPEND CVV_LIBRARIES Qt${QT_VERSION_MAJOR}::${module}) + endforeach() + + ocv_glob_module_sources() +--- a/modules/highgui/CMakeLists.txt ++++ b/modules/highgui/CMakeLists.txt +@@ -116,7 +116,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/test_package/CMakeLists.txt b/recipes/opencv/4.x/test_package/CMakeLists.txt index 5404f6ff23915..de8715f301069 100644 --- a/recipes/opencv/4.x/test_package/CMakeLists.txt +++ b/recipes/opencv/4.x/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) enable_testing() diff --git a/recipes/opencv/4.x/test_v1_package/CMakeLists.txt b/recipes/opencv/4.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index c23ed5cfe6d98..0000000000000 --- a/recipes/opencv/4.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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/opencv/4.x/test_v1_package/conanfile.py b/recipes/opencv/4.x/test_v1_package/conanfile.py deleted file mode 100644 index 9aa234fbd88b8..0000000000000 --- a/recipes/opencv/4.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,47 +0,0 @@ -from conans import ConanFile, CMake, tools -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) - 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): - 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 4ca870469c580..4234ac8307be3 100644 --- a/recipes/opencv/config.yml +++ b/recipes/opencv/config.yml @@ -1,4 +1,10 @@ versions: + "4.11.0": + folder: "4.x" + "4.10.0": + folder: "4.x" + "4.9.0": + folder: "4.x" "4.8.1": folder: "4.x" "4.5.5": @@ -7,6 +13,8 @@ versions: folder: "4.x" "4.1.2": folder: "4.x" + "3.4.20": + folder: "3.x" "3.4.17": folder: "3.x" "2.4.13.7": diff --git a/recipes/openddl-parser/all/test_package/CMakeLists.txt b/recipes/openddl-parser/all/test_package/CMakeLists.txt index 39acff46ad958..21bb7fdeefd92 100644 --- a/recipes/openddl-parser/all/test_package/CMakeLists.txt +++ b/recipes/openddl-parser/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(openddlparser REQUIRED CONFIG) diff --git a/recipes/openddl-parser/all/test_v1_package/CMakeLists.txt b/recipes/openddl-parser/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/openddl-parser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/openddl-parser/all/test_v1_package/conanfile.py b/recipes/openddl-parser/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/openddl-parser/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_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/opendis6/all/conandata.yml b/recipes/opendis6/all/conandata.yml new file mode 100644 index 0000000000000..7824537ac8c80 --- /dev/null +++ b/recipes/opendis6/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.0": + url: "https://github.com/crhowell3/opendis6/archive/refs/tags/0.1.0.tar.gz" + sha256: "7acfd6ecdcea03c75f93834c4e8ad532aee03eb0fdd2736c9095e2d548214125" diff --git a/recipes/opendis6/all/conanfile.py b/recipes/opendis6/all/conanfile.py new file mode 100644 index 0000000000000..fafcb727673f2 --- /dev/null +++ b/recipes/opendis6/all/conanfile.py @@ -0,0 +1,98 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.53.0" + +class OpenDis6Conan(ConanFile): + name = "opendis6" + homepage = "https://github.com/crhowell3/opendis6" + description = "Modern C++ implementation of IEEE 1278.1a-1998" + topics = ("library", "protocol", "dis") + url = "https://github.com/conan-io/conan-center-index" + 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 + } + + provides = "libsersi" + deprecated = "libsersi" + + @property + def _min_cppstd(self): + return "14" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_EXAMPLES"] = False + tc.cache_variables["BUILD_TESTS"] = False + tc.generate() + + def layout(self): + cmake_layout(self, src_folder="src") + + 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 build_requirements(self): + self.tool_requires("cmake/[>=3.22 <4]") + + 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 build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="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")) + rmdir(self, os.path.join(self.package_folder, "res")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["OpenDIS6"] + self.cpp_info.set_property("cmake_file_name", "OpenDIS") + self.cpp_info.set_property("cmake_target_name", "OpenDIS::OpenDIS6") + self.cpp_info.set_property("cmake_target_aliases", ["OpenDIS::DIS6","OpenDIS6"]) + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/opendis6/all/test_package/CMakeLists.txt b/recipes/opendis6/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..84b0c539e5ca0 --- /dev/null +++ b/recipes/opendis6/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(OpenDIS CONFIG REQUIRED) + +add_executable(test_package_dis test_package.cpp) +target_link_libraries(test_package_dis PRIVATE OpenDIS::OpenDIS6) +set_target_properties(test_package_dis PROPERTIES CXX_STANDARD 14) diff --git a/recipes/opendis6/all/test_package/conanfile.py b/recipes/opendis6/all/test_package/conanfile.py new file mode 100644 index 0000000000000..8e56d28728132 --- /dev/null +++ b/recipes/opendis6/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +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 = "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): + self.run(os.path.join(self.cpp.build.bindirs[0], + "test_package_dis"), env="conanrun") diff --git a/recipes/opendis6/all/test_package/test_package.cpp b/recipes/opendis6/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8d0bb6749255c --- /dev/null +++ b/recipes/opendis6/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include "dis6/entity_information/EntityStatePdu.h" + +int main() { + dis::EntityStatePdu pdu1, pdu2; + + dis::DataStream ds(dis::kBig); + pdu1.Marshal(ds); + pdu2.Unmarshal(ds); + + std::cout << "Success\n"; + return EXIT_SUCCESS; +} diff --git a/recipes/opendis6/config.yml b/recipes/opendis6/config.yml new file mode 100644 index 0000000000000..6c11a439d0bc2 --- /dev/null +++ b/recipes/opendis6/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.0": + folder: all diff --git a/recipes/opene57/all/conandata.yml b/recipes/opene57/all/conandata.yml index 901bec5f90435..01fe8da487209 100644 --- a/recipes/opene57/all/conandata.yml +++ b/recipes/opene57/all/conandata.yml @@ -1,10 +1,10 @@ sources: + "1.6.5": + url: "https://github.com/openE57/openE57/archive/1.6.5.tar.gz" + sha256: "23f3c159550a70b6a1c2330f0f03ed816cbc27ff5656410bfee527bae31eb186" "1.6.4": url: "https://github.com/openE57/openE57/archive/1.6.4.tar.gz" sha256: "97accc32ae294113a97b8d3f0ecf0d608057a6f0fcdfee17db0c5db4ab28ce69" "1.6.3": 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 f3bcaea5080c3..d02fc5ff273d6 100644 --- a/recipes/opene57/all/conanfile.py +++ b/recipes/opene57/all/conanfile.py @@ -8,7 +8,7 @@ from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class Opene57Conan(ConanFile): @@ -25,11 +25,13 @@ class Opene57Conan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_tools": [True, False], + "with_docs": [True, False] } default_options = { "shared": False, "fPIC": True, "with_tools": False, + "with_docs": False } @property @@ -64,9 +66,14 @@ def layout(self): def requirements(self): if self.options.with_tools: - self.requires("boost/1.83.0") + self.requires("boost/1.84.0") + + if self.options.with_docs: + self.requires("doxygen/[>=1.8 <2]") + if self.settings.os != "Windows": - self.requires("icu/73.2") + self.requires("icu/74.1") + self.requires("xerces-c/3.2.4") def validate(self): @@ -88,6 +95,8 @@ def generate(self): tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_TOOLS"] = self.options.with_tools tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_DOCS"] = self.options.with_docs + if is_msvc(self): tc.variables["BUILD_WITH_MT"] = is_msvc_static_runtime(self) tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared @@ -127,6 +136,8 @@ def package_info(self): self.cpp_info.defines.append(f"E57_REFIMPL_REVISION_ID={self.name}-{self.version}") self.cpp_info.defines.append("XERCES_STATIC_LIBRARY") + self.cpp_info.defines.append("CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS") + self.cpp_info.defines.append("CRCPP_USE_CPP11") # TODO: to remove in conan v2 if self.options.with_tools: diff --git a/recipes/opene57/all/test_v1_package/CMakeLists.txt b/recipes/opene57/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/opene57/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index b295f3f19d774..0000000000000 --- a/recipes/opene57/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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 ad9f3c8967822..0cbc2473d6c2f 100644 --- a/recipes/opene57/config.yml +++ b/recipes/opene57/config.yml @@ -1,7 +1,7 @@ versions: + "1.6.5": + folder: all "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 6cbbea809703f..f8c71644e1c30 100644 --- a/recipes/openexr/2.x/conandata.yml +++ b/recipes/openexr/2.x/conandata.yml @@ -5,49 +5,10 @@ sources: "2.5.7": url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.7.tar.gz" sha256: "36ecb2290cba6fc92b2ec9357f8dc0e364b4f9a90d727bf9a57c84760695272d" - "2.5.5": - url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.tar.gz" - sha256: "59e98361cb31456a9634378d0f653a2b9554b8900f233450f2396ff495ea76b3" - "2.5.4": - url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.4.tar.gz" - sha256: "dba19e9c6720c6f64fbc8b9d1867eaa75da6438109b941eefdc75ed141b6576d" - "2.5.3": - url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.3.tar.gz" - sha256: "6a6525e6e3907715c6a55887716d7e42d09b54d2457323fcee35a0376960bebf" - "2.5.2": - url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.2.tar.gz" - sha256: "5da8dff448d0c4a529e52c97daf238a461d01cd233944f75095668d6d7528761" - "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 564b19b00cd64..8cf1e63318981 100644 --- a/recipes/openexr/2.x/conanfile.py +++ b/recipes/openexr/2.x/conanfile.py @@ -141,6 +141,9 @@ def package_info(self): # waiting an implementation of https://github.com/conan-io/conan/issues/9000 self.cpp_info.set_property("cmake_file_name", "OpenEXR") + # Avoid conflict in PkgConfigDeps with OpenEXR.pc file coming from openexr_ilmimf component + self.cpp_info.set_property("pkg_config_name", "openexr_conan_full_package") + lib_suffix = "" if not self.options.shared or self.settings.os == "Windows": openexr_version = Version(self.version) 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 deleted file mode 100644 index a30277a2740a5..0000000000000 --- a/recipes/openexr/2.x/patches/2.5.4-0001-cstdint-include.patch +++ /dev/null @@ -1,37 +0,0 @@ -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/test_package/CMakeLists.txt b/recipes/openexr/2.x/test_package/CMakeLists.txt index 53f85b0326eed..f45a8d848c2a2 100644 --- a/recipes/openexr/2.x/test_package/CMakeLists.txt +++ b/recipes/openexr/2.x/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(OpenEXR REQUIRED CONFIG) diff --git a/recipes/openexr/2.x/test_package/comp_short_decode_piz.exr b/recipes/openexr/2.x/test_package/comp_short_decode_piz.exr deleted file mode 100644 index 3a16d594b3028..0000000000000 Binary files a/recipes/openexr/2.x/test_package/comp_short_decode_piz.exr and /dev/null differ diff --git a/recipes/openexr/2.x/test_package/conanfile.py b/recipes/openexr/2.x/test_package/conanfile.py index f3a059b562841..3a8c6c5442b33 100644 --- a/recipes/openexr/2.x/test_package/conanfile.py +++ b/recipes/openexr/2.x/test_package/conanfile.py @@ -22,5 +22,4 @@ def build(self): def test(self): if not cross_building(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - imgfile = os.path.join(self.source_folder, "comp_short_decode_piz.exr") - self.run(f"{bin_path} {imgfile}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/openexr/2.x/test_package/test_package.cpp b/recipes/openexr/2.x/test_package/test_package.cpp index f5c9cab11b69e..d0aa6adf400d6 100644 --- a/recipes/openexr/2.x/test_package/test_package.cpp +++ b/recipes/openexr/2.x/test_package/test_package.cpp @@ -1,18 +1,11 @@ #include #include -#include -#include -#include +#include int main (int argc, char *argv[]) { - if (argc < 2) - return EXIT_FAILURE; - Imf::RgbaInputFile input_file(argv[1]); - const Imf::Header& header = input_file.header(); - size_t width = header.dataWindow().max.x - header.dataWindow().min.x + 1; - size_t height = header.dataWindow().max.y - header.dataWindow().min.y + 1; - std::cout << "OpenEXR images size is " << width << "x" << height << std::endl; + Imf::Header header; + std::cout << "Test: " << header.screenWindowWidth() << std::endl; return EXIT_SUCCESS; } diff --git a/recipes/openexr/2.x/test_v1_package/CMakeLists.txt b/recipes/openexr/2.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 885df78c7a21c..0000000000000 --- a/recipes/openexr/2.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(OpenEXR REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE OpenEXR::IlmImf) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/openexr/2.x/test_v1_package/conanfile.py b/recipes/openexr/2.x/test_v1_package/conanfile.py deleted file mode 100644 index eb76680dc0215..0000000000000 --- a/recipes/openexr/2.x/test_v1_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 = os.path.join("bin", "test_package") - imgfile = os.path.join(self.source_folder, os.pardir, "test_package", "comp_short_decode_piz.exr") - self.run(f"{bin_path} {imgfile}", run_environment=True) diff --git a/recipes/openexr/3.x/conandata.yml b/recipes/openexr/3.x/conandata.yml index 2a41f1e247f6e..8647b82f6feaf 100644 --- a/recipes/openexr/3.x/conandata.yml +++ b/recipes/openexr/3.x/conandata.yml @@ -1,34 +1,16 @@ 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.3.3": + url: "https://github.com/AcademySoftwareFoundation/openexr/releases/download/v3.3.3/openexr-3.3.3.tar.gz" + sha256: "d819b9f76cbe63cc6b7476267659900f00aab79b636a83f0ecac2be669ca97b5" + "3.3.2": + url: "https://github.com/AcademySoftwareFoundation/openexr/releases/download/v3.3.2/openexr-3.3.2.tar.gz" + sha256: "4fb4c643b39f04b67e8f4138e4d5a7804b62fdc15b8f6bcdd32ccc8ecd515683" + "3.2.4": + url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.2.4.tar.gz" + sha256: "81e6518f2c4656fdeaf18a018f135e96a96e7f66dbe1c1f05860dd94772176cc" patches: - "3.2.1": + "3.2.4": - 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/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/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 71838c85f0a04..673a89941ef01 100644 --- a/recipes/openexr/3.x/conanfile.py +++ b/recipes/openexr/3.x/conanfile.py @@ -1,7 +1,8 @@ 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, 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 @@ -29,8 +30,22 @@ class OpenEXRConan(ConanFile): @property def _min_cppstd(self): + if Version(self.version) >= "3.3": + return 17 return 11 + @property + def _minimum_compiler_version(self): + return { + "17": { + "gcc": "9" + } + }.get(str(self._min_cppstd), {}) + + @property + def _with_libdeflate(self): + return Version(self.version) >= "3.2" + def export_sources(self): export_conandata_patches(self) @@ -49,11 +64,17 @@ def requirements(self): self.requires("zlib/[>=1.2.11 <2]") # Note: OpenEXR and Imath are versioned independently. self.requires("imath/3.1.9", transitive_headers=True) + if self._with_libdeflate: + self.requires("libdeflate/[>=1.19 <=1.22]") def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) + minimum_version = self._minimum_compiler_version.get(str(self.settings.compiler)) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires {self.settings.compiler} >= {minimum_version}") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -61,13 +82,23 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["OPENEXR_INSTALL_EXAMPLES"] = False tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_WEBSITE"] = False tc.variables["DOCS"] = False tc.generate() cd = CMakeDeps(self) cd.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + + if Version(self.version) >= "3.2": + # Even with BUILD_WEBSITE, Website target is compiled in 3.2 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_subdirectory(website/src)", + "# add_subdirectory(website/src)") + + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -138,6 +169,8 @@ def package_info(self): OpenEXRCore = self._add_component("OpenEXRCore") OpenEXRCore.libs = [f"OpenEXRCore{lib_suffix}"] OpenEXRCore.requires = [self._conan_comp("OpenEXRConfig"), "zlib::zlib"] + if self._with_libdeflate: + OpenEXRCore.requires.append("libdeflate::libdeflate") if self.settings.os in ["Linux", "FreeBSD"]: OpenEXRCore.system_libs = ["m"] diff --git a/recipes/openexr/3.x/patches/3.2.1-find-libdeflate.patch b/recipes/openexr/3.x/patches/3.2.1-find-libdeflate.patch new file mode 100644 index 0000000000000..713d06bd8b4c9 --- /dev/null +++ b/recipes/openexr/3.x/patches/3.2.1-find-libdeflate.patch @@ -0,0 +1,82 @@ +diff --git a/cmake/OpenEXR.pc.in b/cmake/OpenEXR.pc.in +index bce35c2..88ddc9a 100644 +--- a/cmake/OpenEXR.pc.in ++++ b/cmake/OpenEXR.pc.in +@@ -14,7 +14,7 @@ Name: OpenEXR + Description: OpenEXR image library + Version: @OPENEXR_VERSION@ + +-Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix} @EXR_DEFLATE_LDFLAGS@ ++Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix} + Cflags: -I${includedir} -I${OpenEXR_includedir} @exr_pthread_cflags@ + Requires: Imath +- ++Requires.private: @EXR_DEFLATE_PKGCONFIG_REQUIRES@ +diff --git a/cmake/OpenEXRSetup.cmake b/cmake/OpenEXRSetup.cmake +index ef5c6c0..0a7dabc 100644 +--- a/cmake/OpenEXRSetup.cmake ++++ b/cmake/OpenEXRSetup.cmake +@@ -160,15 +160,40 @@ set(OPENEXR_DEFLATE_TAG "v1.18" CACHE STRING "Tag to use for libdeflate source r + if(NOT OPENEXR_FORCE_INTERNAL_DEFLATE) + #TODO: ^^ Release should not clone from main, this is a place holder + set(CMAKE_IGNORE_PATH "${CMAKE_CURRENT_BINARY_DIR}/_deps/deflate-src/config;${CMAKE_CURRENT_BINARY_DIR}/_deps/deflate-build/config") +- include(FindPkgConfig) +- pkg_check_modules(deflate IMPORTED_TARGET GLOBAL libdeflate) +- set(CMAKE_IGNORE_PATH) +- if (deflate_FOUND) +- message(STATUS "Using libdeflate from ${deflate_LINK_LIBRARIES}") ++ # First try cmake config ++ find_package(libdeflate CONFIG QUIET) ++ if(libdeflate_FOUND) ++ if(TARGET libdeflate::libdeflate_shared) ++ set(EXR_DEFLATE_LIB libdeflate::libdeflate_shared) ++ else() ++ set(EXR_DEFLATE_LIB libdeflate::libdeflate_static) ++ endif() ++ set(EXR_DEFLATE_VERSION ${libdeflate_VERSION}) ++ message(STATUS "Using libdeflate from ${libdeflate_DIR}") ++ else() ++ # If not found, try pkgconfig ++ find_package(PkgConfig) ++ if(PKG_CONFIG_FOUND) ++ include(FindPkgConfig) ++ pkg_check_modules(deflate IMPORTED_TARGET GLOBAL libdeflate) ++ if(deflate_FOUND) ++ set(EXR_DEFLATE_LIB PkgConfig::deflate) ++ set(EXR_DEFLATE_VERSION ${deflate_VERSION}) ++ message(STATUS "Using libdeflate from ${deflate_LINK_LIBRARIES}") ++ endif() ++ endif() + endif() ++ set(CMAKE_IGNORE_PATH) + endif() + +-if(NOT TARGET PkgConfig::deflate AND NOT deflate_FOUND) ++if(EXR_DEFLATE_LIB) ++ # Using external library ++ set(EXR_DEFLATE_SOURCES) ++ set(EXR_DEFLATE_INCLUDE_DIR) ++ # For OpenEXR.pc.in for static build ++ set(EXR_DEFLATE_PKGCONFIG_REQUIRES "libdeflate >= ${EXR_DEFLATE_VERSION}") ++else() ++ # Using internal deflate + if(OPENEXR_FORCE_INTERNAL_DEFLATE) + message(STATUS "libdeflate forced internal, installing from ${OPENEXR_DEFLATE_REPO} (${OPENEXR_DEFLATE_TAG})") + else() +@@ -213,16 +238,6 @@ if(NOT TARGET PkgConfig::deflate AND NOT deflate_FOUND) + list(TRANSFORM EXR_DEFLATE_SOURCES PREPEND ${deflate_SOURCE_DIR}/) + set(EXR_DEFLATE_INCLUDE_DIR ${deflate_SOURCE_DIR}) + set(EXR_DEFLATE_LIB) +-else() +- set(EXR_DEFLATE_INCLUDE_DIR) +- set(EXR_DEFLATE_LIB ${deflate_LIBRARIES}) +- # set EXR_DEFATE_LDFLAGS for OpenEXR.pc.in for static build +- if (BUILD_SHARED_LIBS) +- set(EXR_DEFLATE_LDFLAGS "") +- else() +- set(EXR_DEFLATE_LDFLAGS "-l${deflate_LIBRARIES}") +- endif() +- set(EXR_DEFLATE_SOURCES) + endif() + + ####################################### diff --git a/recipes/openexr/3.x/test_package/CMakeLists.txt b/recipes/openexr/3.x/test_package/CMakeLists.txt index 8d0b5e6da6e9a..d43f24410720f 100644 --- a/recipes/openexr/3.x/test_package/CMakeLists.txt +++ b/recipes/openexr/3.x/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(OpenEXR REQUIRED CONFIG) diff --git a/recipes/openexr/3.x/test_package/comp_short_decode_piz.exr b/recipes/openexr/3.x/test_package/comp_short_decode_piz.exr deleted file mode 100644 index 3a16d594b3028..0000000000000 Binary files a/recipes/openexr/3.x/test_package/comp_short_decode_piz.exr and /dev/null differ diff --git a/recipes/openexr/3.x/test_package/conanfile.py b/recipes/openexr/3.x/test_package/conanfile.py index 96999743e2fb9..8a5bb47f50c4c 100644 --- a/recipes/openexr/3.x/test_package/conanfile.py +++ b/recipes/openexr/3.x/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - imgfile = os.path.join(self.source_folder, "comp_short_decode_piz.exr") - self.run(f"{bin_path} {imgfile}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/openexr/3.x/test_package/test_package.cpp b/recipes/openexr/3.x/test_package/test_package.cpp index f5c9cab11b69e..d0aa6adf400d6 100644 --- a/recipes/openexr/3.x/test_package/test_package.cpp +++ b/recipes/openexr/3.x/test_package/test_package.cpp @@ -1,18 +1,11 @@ #include #include -#include -#include -#include +#include int main (int argc, char *argv[]) { - if (argc < 2) - return EXIT_FAILURE; - Imf::RgbaInputFile input_file(argv[1]); - const Imf::Header& header = input_file.header(); - size_t width = header.dataWindow().max.x - header.dataWindow().min.x + 1; - size_t height = header.dataWindow().max.y - header.dataWindow().min.y + 1; - std::cout << "OpenEXR images size is " << width << "x" << height << std::endl; + Imf::Header header; + std::cout << "Test: " << header.screenWindowWidth() << std::endl; return EXIT_SUCCESS; } diff --git a/recipes/openexr/3.x/test_v1_package/CMakeLists.txt b/recipes/openexr/3.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 64e4cfec070f4..0000000000000 --- a/recipes/openexr/3.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(OpenEXR REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE OpenEXR::OpenEXR) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/openexr/3.x/test_v1_package/conanfile.py b/recipes/openexr/3.x/test_v1_package/conanfile.py deleted file mode 100644 index eb76680dc0215..0000000000000 --- a/recipes/openexr/3.x/test_v1_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 = os.path.join("bin", "test_package") - imgfile = os.path.join(self.source_folder, os.pardir, "test_package", "comp_short_decode_piz.exr") - self.run(f"{bin_path} {imgfile}", run_environment=True) diff --git a/recipes/openexr/config.yml b/recipes/openexr/config.yml index c5e2b53e89f02..3b5633a860c50 100644 --- a/recipes/openexr/config.yml +++ b/recipes/openexr/config.yml @@ -1,23 +1,11 @@ versions: - "3.2.1": + "3.3.3": folder: "3.x" - "3.1.9": + "3.3.2": folder: "3.x" - "3.1.7": - folder: "3.x" - "3.1.5": + "3.2.4": folder: "3.x" "2.5.9": folder: "2.x" "2.5.7": folder: "2.x" - "2.5.5": - folder: "2.x" - "2.5.4": - folder: "2.x" - "2.5.3": - folder: "2.x" - "2.5.2": - folder: "2.x" - "2.4.0": - folder: "2.x" diff --git a/recipes/openfbx/all/test_package/CMakeLists.txt b/recipes/openfbx/all/test_package/CMakeLists.txt index d08ab62734d1f..834f2725a0e5e 100644 --- a/recipes/openfbx/all/test_package/CMakeLists.txt +++ b/recipes/openfbx/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(openfbx REQUIRED CONFIG) diff --git a/recipes/openfbx/all/test_package/conanfile.py b/recipes/openfbx/all/test_package/conanfile.py index 7635e9e283758..0a6bc68712d90 100644 --- a/recipes/openfbx/all/test_package/conanfile.py +++ b/recipes/openfbx/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - fbx_path = os.path.join(self.source_folder, "d.fbx") - self.run(f"{bin_path} {fbx_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/openfbx/all/test_package/d.fbx b/recipes/openfbx/all/test_package/d.fbx deleted file mode 100644 index 147ec354d2be2..0000000000000 Binary files a/recipes/openfbx/all/test_package/d.fbx and /dev/null differ diff --git a/recipes/openfbx/all/test_package/test_package.cpp b/recipes/openfbx/all/test_package/test_package.cpp index be802370b1f87..a45770bbd5562 100644 --- a/recipes/openfbx/all/test_package/test_package.cpp +++ b/recipes/openfbx/all/test_package/test_package.cpp @@ -5,17 +5,11 @@ #include int main(int argc, char **argv) { - if (argc < 2) { - std::cerr << "Need at least one argument" << std::endl; - return -1; - } - std::ifstream in_file(argv[1], std::ios::binary); - in_file.seekg(0, std::ios::end); - int file_size = static_cast(in_file.tellg()); - std::vector content(file_size); + std::vector content(13); + ofbx::IScene *g_scene = ofbx::load(&content[0], 13, static_cast(ofbx::LoadFlags::TRIANGULATE)); - ofbx::IScene *g_scene = ofbx::load(&content[0], file_size, static_cast(ofbx::LoadFlags::TRIANGULATE)); + std::cout << "Test: " << g_scene << std::endl; return 0; } diff --git a/recipes/openfbx/all/test_v1_package/CMakeLists.txt b/recipes/openfbx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/openfbx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/openfbx/all/test_v1_package/conanfile.py b/recipes/openfbx/all/test_v1_package/conanfile.py deleted file mode 100644 index fad029416492d..0000000000000 --- a/recipes/openfbx/all/test_v1_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 = os.path.join("bin", "test_package") - fbx_path = os.path.join(self.source_folder, os.pardir, "test_package", "d.fbx") - self.run(f"{bin_path} {fbx_path}", run_environment=True) diff --git a/recipes/openfst/all/conandata.yml b/recipes/openfst/all/conandata.yml index aed678082ff26..615742284b853 100644 --- a/recipes/openfst/all/conandata.yml +++ b/recipes/openfst/all/conandata.yml @@ -1,7 +1,7 @@ sources: "1.8.2": - sha256: de987bf3624721c5d5ba321af95751898e4f4bb41c8a36e2d64f0627656d8b42 - url: https://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.8.2.tar.gz + url: "https://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.8.2.tar.gz" + sha256: "de987bf3624721c5d5ba321af95751898e4f4bb41c8a36e2d64f0627656d8b42" patches: "1.8.2": - patch_file: "patches/1.8.2-allocate-hint.patch" diff --git a/recipes/openfst/all/conanfile.py b/recipes/openfst/all/conanfile.py index 350f5171a2fd1..b384f42052cf7 100644 --- a/recipes/openfst/all/conanfile.py +++ b/recipes/openfst/all/conanfile.py @@ -1,15 +1,14 @@ 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.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd, cross_building 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.53.0" +required_conan_version = ">=2.0.9" class OpenFstConan(ConanFile): @@ -54,47 +53,26 @@ class OpenFstConan(ConanFile): "enable_pdt": False, "enable_special": False, } - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + implements = ["auto_shared_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): - if self.options.shared: - self.options.rm_safe("fPIC") - def layout(self): basic_layout(self, src_folder="src") + def validate_build(self): + # Cross building is not supported. `configure` fails due to the existing AC_RUN_IFELSE autotools macro + # in the configure script which does not have a fallback in case of cross building + # There is neither a way of disabling the check nor a way of providing a fallback as `cross_compiling` + # variable is assigned on the fly in the configuration script + if cross_building(self): + raise ConanInvalidConfiguration(f"{self.ref} recipe doesn't support cross-built") + def validate(self): - if self.settings.os not in ["Linux", "FreeBSD"]: - raise ConanInvalidConfiguration("OpenFst is only supported on linux") - - compilers = { - "gcc": "8", - "clang": "7", - } - - if self.settings.compiler.cppstd: - check_min_cppstd(self, 17) - minimum_compiler = compilers.get(str(self.settings.compiler)) - if minimum_compiler: - 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.warning( - f"{self.name} requires c++17, but this compiler is unknown to this recipe." - f" Assuming your compiler supports c++17." - ) + if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration(f"OpenFst is only supported on Linux, FreeBSD, and Macos (got: {self.settings.os})") + check_min_cppstd(self, 17) # Check stdlib ABI compatibility if self.settings.compiler == "gcc" and self.settings.compiler.libcxx != "libstdc++11": @@ -108,6 +86,7 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = AutotoolsToolchain(self) @@ -130,11 +109,7 @@ def generate(self): tc.extra_cxxflags.append("-pthread") tc.generate() - def _patch_sources(self): - apply_conandata_patches(self) - def build(self): - self._patch_sources() autotools = Autotools(self) autotools.configure() autotools.make() @@ -146,6 +121,7 @@ def package(self): autotools = Autotools(self) autotools.install() + fix_apple_shared_install_name(self) lib_dir = os.path.join(self.package_folder, "lib") lib_subdir = os.path.join(self.package_folder, "lib", "fst") @@ -159,25 +135,10 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) rm(self, "*.la", lib_dir, recursive=True) - @property - def _get_const_fsts_libs(self): - return [f"const{n}-fst" for n in [8, 16, 64]] - - @property - def _get_compact_fsts_libs(self): - 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") self.cpp_info.set_property("cmake_target_name", "OpenFst::OpenFst") self.cpp_info.set_property("cmake_find_mode", "both") - self.cpp_info.names["cmake_find_package"] = "OpenFst" - self.cpp_info.names["cmake_find_package_multi"] = "OpenFst" - self.cpp_info.libs = ["fst"] if self.options.enable_compact_fsts: @@ -197,10 +158,6 @@ def package_info(self): self.cpp_info.libs.append("fstscript") if self.options.enable_compress: self.cpp_info.libs.append("fstcompressscript") - if self.options.enable_compact_fsts: - self.cpp_info.libs.extend(self._get_compact_fsts_libs) - if self.options.enable_const_fsts: - self.cpp_info.libs.extend(self._get_const_fsts_libs) if self.options.enable_far or self.options.enable_grm: self.cpp_info.libs.append("fstfarscript") if self.options.enable_linear_fsts: @@ -211,8 +168,3 @@ def package_info(self): self.cpp_info.libs.append("fstpdtscript") 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_v1_package/CMakeLists.txt b/recipes/openfst/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/openfst/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 90eb89e3f2f46..0000000000000 --- a/recipes/openfst/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/conanfile.py b/recipes/openfx/all/conanfile.py index 935c3113a9393..2fa66bbb90d2a 100644 --- a/recipes/openfx/all/conanfile.py +++ b/recipes/openfx/all/conanfile.py @@ -50,7 +50,7 @@ def layout(self): def requirements(self): self.requires("opengl/system") - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/openfx/all/test_v1_package/CMakeLists.txt b/recipes/openfx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/openfx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 884a3017a3bd6..0000000000000 --- a/recipes/openfx/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_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/conandata.yml b/recipes/opengl-registry/all/conandata.yml index 1fa4f5c98ec9a..fad17557e62be 100644 --- a/recipes/opengl-registry/all/conandata.yml +++ b/recipes/opengl-registry/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20240721": + url: "https://github.com/KhronosGroup/OpenGL-Registry/archive/d2fe2072a3aecf3e9ef1568976e805531b50d959.tar.gz" + sha256: "0c8295a95e137b0dabd5ad138ad41d96b40e85bcca848b62a3e13378e425a08a" "cci.20220929": url: "https://github.com/KhronosGroup/OpenGL-Registry/archive/5bae8738b23d06968e7c3a41308568120943ae77.tar.gz" sha256: "e69eb5738a517737d91717c4f9bb8da1e1fac7a04afe0fc24532ca92df1da53d" diff --git a/recipes/opengl-registry/all/test_package/CMakeLists.txt b/recipes/opengl-registry/all/test_package/CMakeLists.txt index c42d75e86ff9e..bdfd605607096 100644 --- a/recipes/opengl-registry/all/test_package/CMakeLists.txt +++ b/recipes/opengl-registry/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(opengl-registry REQUIRED CONFIG) diff --git a/recipes/opengl-registry/all/test_package/test_package.c b/recipes/opengl-registry/all/test_package/test_package.c index a9cb3640b85e1..947465a4a0c1c 100644 --- a/recipes/opengl-registry/all/test_package/test_package.c +++ b/recipes/opengl-registry/all/test_package/test_package.c @@ -4,6 +4,7 @@ #include int main() { + printf("GL_GLEXT_VERSION: %d\n", GL_GLEXT_VERSION); GLenum value = GL_UNSIGNED_BYTE_3_3_2; printf("GL_UNSIGNED_BYTE_3_3_2: %x\n", value); return EXIT_SUCCESS; diff --git a/recipes/opengl-registry/all/test_v1_package/CMakeLists.txt b/recipes/opengl-registry/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/opengl-registry/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/opengl-registry/all/test_v1_package/conanfile.py b/recipes/opengl-registry/all/test_v1_package/conanfile.py deleted file mode 100644 index 90f7a062ba0d0..0000000000000 --- a/recipes/opengl-registry/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake -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/opengl-registry/config.yml b/recipes/opengl-registry/config.yml index 0168ee0addf88..07c28129c1bb5 100644 --- a/recipes/opengl-registry/config.yml +++ b/recipes/opengl-registry/config.yml @@ -1,3 +1,5 @@ versions: + "20240721": + folder: all "cci.20220929": folder: all diff --git a/recipes/opengl/all/conanfile.py b/recipes/opengl/all/conanfile.py index 5ccf58c206f4b..ca99bbad2e12f 100644 --- a/recipes/opengl/all/conanfile.py +++ b/recipes/opengl/all/conanfile.py @@ -23,6 +23,9 @@ def package_id(self): self.info.clear() def system_requirements(self): + if self.settings.os not in ["Linux", "FreeBSD", "SunOS"]: + return + dnf = package_manager.Dnf(self) dnf.install_substitutes(["libglvnd-devel"], ["mesa-libGL-devel"], update=True, check=True) @@ -36,11 +39,15 @@ def system_requirements(self): pacman.install(["libglvnd"], update=True, check=True) zypper = package_manager.Zypper(self) - zypper.install(["Mesa-libGL-devel", "glproto-devel"], update=True, check=True) + zypper.install_substitutes(["Mesa-libGL-devel", "glproto-devel"], + ["Mesa-libGL-devel", "xorgproto-devel"], update=True, check=True) pkg = package_manager.Pkg(self) pkg.install(["libglvnd"], update=True, check=True) + pkg_util = package_manager.PkgUtil(self) + pkg_util.install(["mesalibs"], update=True, check=True) + def package_info(self): # TODO: Workaround for #2311 until a better solution can be found self.cpp_info.filenames["cmake_find_package"] = "opengl_system" @@ -56,6 +63,6 @@ def package_info(self): self.cpp_info.frameworks.append("OpenGL") elif self.settings.os == "Windows": self.cpp_info.system_libs = ["opengl32"] - elif self.settings.os in ["Linux", "FreeBSD"]: + elif self.settings.os in ["Linux", "FreeBSD", "SunOS"]: pkg_config = PkgConfig(self, 'gl') pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD") diff --git a/recipes/opengl/all/test_package/CMakeLists.txt b/recipes/opengl/all/test_package/CMakeLists.txt index cedabff6c4ea6..16167b00f30e1 100644 --- a/recipes/opengl/all/test_package/CMakeLists.txt +++ b/recipes/opengl/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(opengl_system REQUIRED CONFIG) diff --git a/recipes/opengrm/all/test_package/CMakeLists.txt b/recipes/opengrm/all/test_package/CMakeLists.txt index 9f0abc98d4226..e189355fa8aab 100644 --- a/recipes/opengrm/all/test_package/CMakeLists.txt +++ b/recipes/opengrm/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(opengrm REQUIRED CONFIG) diff --git a/recipes/opengv/all/test_package/CMakeLists.txt b/recipes/opengv/all/test_package/CMakeLists.txt index de51eacadb93f..1ebb3bff1b7e4 100644 --- a/recipes/opengv/all/test_package/CMakeLists.txt +++ b/recipes/opengv/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(opengv REQUIRED CONFIG) diff --git a/recipes/opengv/all/test_v1_package/CMakeLists.txt b/recipes/opengv/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opengv/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/opengv/all/test_v1_package/conanfile.py b/recipes/opengv/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/opengv/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/openh264/all/conandata.yml b/recipes/openh264/all/conandata.yml index 679b1b0e3b70d..4d8902d954f8b 100644 --- a/recipes/openh264/all/conandata.yml +++ b/recipes/openh264/all/conandata.yml @@ -1,38 +1,13 @@ sources: + "2.5.0": + url: "https://github.com/cisco/openh264/archive/refs/tags/v2.5.0.tar.gz" + sha256: "94c8ca364db990047ec4ec3481b04ce0d791e62561ef5601443011bdc00825e3" + "2.4.1": + url: "https://github.com/cisco/openh264/archive/refs/tags/v2.4.1.tar.gz" + sha256: "8ffbe944e74043d0d3fb53d4a2a14c94de71f58dbea6a06d0dc92369542958ea" "2.3.1": url: "https://github.com/cisco/openh264/archive/refs/tags/v2.3.1.tar.gz" sha256: "453afa66dacb560bc5fd0468aabee90c483741571bca820a39a1c07f0362dc32" "2.1.1": url: "https://github.com/cisco/openh264/archive/v2.1.1.tar.gz" sha256: "af173e90fce65f80722fa894e1af0d6b07572292e76de7b65273df4c0a8be678" - "1.7.0": - url: "https://github.com/cisco/openh264/archive/v1.7.0.tar.gz" - sha256: "9c07c38d7de00046c9c52b12c76a2af7648b70d05bd5460c8b67f6895738653f" -patches: - "2.3.1": - - patch_file: "patches/2.3.1-0001-platform-android.mk.patch" - patch_type: "portability" - patch_description: "Android Fix" - - patch_file: "patches/2.3.1-0002-macos-relocatable-shared.patch" - patch_type: "portability" - patch_description: "Macos relocatable shared fix" - "2.1.1": - - patch_file: "patches/2.1.1-0001-platform-android.mk.patch" - patch_type: "portability" - patch_description: "Android Fix" - - patch_file: "patches/2.1.1-0002-macos-relocatable-shared.patch" - patch_type: "portability" - patch_description: "Macos relocatable shared fix" - - patch_file: "patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch" - patch_type: "portability" - patch_description: "Mingw Override CC CXX AR from env Fix" - "1.7.0": - - patch_file: "patches/1.7.0-0001-platform-android.mk.patch" - patch_type: "portability" - patch_description: "Android Fix" - - patch_file: "patches/1.7.0-0002-macos-relocatable-shared.patch" - patch_type: "portability" - patch_description: "Macos relocatable shared fix" - - patch_file: "patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch" - patch_type: "portability" - patch_description: "Mingw Override CC CXX AR from env Fix" diff --git a/recipes/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index 00cb4e7604b28..cfdd6104e9efb 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -1,26 +1,28 @@ from conan import ConanFile from conan.tools.build import stdcpp_library from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file, chdir -from conan.tools.gnu import Autotools, AutotoolsToolchain -from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.files import copy, get, rmdir, rm, rename, replace_in_file from conan.tools.layout import basic_layout -from conan.tools.microsoft import check_min_vs, is_msvc, unix_path, msvc_runtime_flag +from conan.tools.microsoft import is_msvc +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.scm import Version +from conan.tools.meson import Meson, MesonToolchain +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.57.0" +required_conan_version = ">=2.0.9" class OpenH264Conan(ConanFile): name = "openh264" + description = "Open Source H.264 Codec" + license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.openh264.org/" - description = "Open Source H.264 Codec" topics = ("h264", "codec", "video", "compression", ) - license = "BSD-2-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,161 +32,95 @@ class OpenH264Conan(ConanFile): "shared": False, "fPIC": True, } - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + implements = ["auto_shared_fpic"] @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: - self.options.rm_safe("fPIC") + @property + def _preserve_dll_name(self): + return (is_msvc(self) or self._is_clang_cl) and Version(self.version) <= "2.4.1" and self.options.shared def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): - if self.settings.arch in ("x86", "x86_64"): - self.tool_requires("nasm/2.15.05") - if self._settings_build.os == "Windows": - self.win_bash = True - if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=str): - self.tool_requires("msys2/cci.latest") - if is_msvc(self): - self.tool_requires("automake/1.16.5") + self.tool_requires("meson/1.4.1") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + if self.settings.arch in ["x86", "x86_64"]: + self.tool_requires("nasm/2.16.01") + + def validate(self): + if Version(self.version) <= "2.1.1" and self.settings.os in ["Android", "Macos"]: + # INFO: ../src/meson.build:86:2: ERROR: Problem encountered: FIXME: Unhandled system android + # INFO: ../src/meson.build:86:2: ERROR: Problem encountered: FIXME: Unhandled system darwin + raise ConanInvalidConfiguration(f"{self.ref} does not support {self.settings.os}. Try a newer version.") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def _patch_sources(self): - if is_msvc(self): - replace_in_file(self, os.path.join(self.source_folder, "build", "platform-msvc.mk"), - "CFLAGS_OPT += -MT", - f"CFLAGS_OPT += -{msvc_runtime_flag(self)}") - replace_in_file(self, os.path.join(self.source_folder, "build", "platform-msvc.mk"), - "CFLAGS_DEBUG += -MTd -Gm", - f"CFLAGS_DEBUG += -{msvc_runtime_flag(self)} -Gm") - if self.settings.os == "Android": - replace_in_file(self, os.path.join(self.source_folder, "codec", "build", "android", "dec", "jni", "Application.mk"), - "APP_STL := stlport_shared", - f"APP_STL := {self.settings.compiler.libcxx}") - replace_in_file(self, os.path.join(self.source_folder, "codec", "build", "android", "dec", "jni", "Application.mk"), - "APP_PLATFORM := android-12", - f"APP_PLATFORM := {self._android_target}") - - @property - def _library_filename(self): - prefix = "" if (is_msvc(self) or self._is_clang_cl) else "lib" - if self.options.shared: - if is_apple_os(self): - suffix = ".dylib" - elif self.settings.os == "Windows": - suffix = ".dll" - else: - suffix = ".so" - else: - if is_msvc(self) or self._is_clang_cl: - suffix = ".lib" - else: - suffix = ".a" - return prefix + "openh264" + suffix - - @property - def _make_arch(self): - return { - "armv7": "arm", - "armv8": "arm64", - "x86": "i386", - }.get(str(self.settings.arch), str(self.settings.arch)) - - @property - def _android_target(self): - return f"android-{self.settings.os.api_level}" - - @property - def _make_args(self): - prefix = unix_path(self, os.path.abspath(self.package_folder)) - args = [ - f"ARCH={self._make_arch}", - f"PREFIX={prefix}" - ] - - if is_msvc(self) or self._is_clang_cl: - args.append("OS=msvc") - else: - if self.settings.os == "Windows": - args.append("OS=mingw_nt") - if self.settings.os == "Android": - 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 = self.conf.get("tools.android:ndk_path") - args.extend([ - f"NDKLEVEL={self.settings.os.api_level}", - f"STL_LIB={stl_lib}", - "OS=android", - f"NDKROOT={ndk_home}", # not NDK_ROOT here - f"TARGET={self._android_target}", - "CCASFLAGS=$(CFLAGS) -fno-integrated-as", - ]) - - return args - def generate(self): env = VirtualBuildEnv(self) env.generate() - tc = AutotoolsToolchain(self) - tc.make_args.extend(self._make_args) - - if is_msvc(self): - tc.extra_cxxflags.append("-nologo") - if check_min_vs(self, "180", raise_invalid=False): - # https://github.com/conan-io/conan/issues/6514 - tc.extra_cxxflags.append("-FS") - # not needed during and after 2.3.1 - elif self.settings.compiler in ("apple-clang",): - if self.settings.arch in ("armv8",): - tc.extra_ldflags.append("-arch arm64") + tc = MesonToolchain(self) + tc.project_options["tests"] = "disabled" tc.generate() + def _patch_sources(self): + if self._preserve_dll_name: + # INFO: When generating with Meson, the library name is openh264-7.dll. This change preserves the old name openh264.dll + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "soversion: major_version,", "soversion: '',") + def build(self): - apply_conandata_patches(self) self._patch_sources() - autotools = Autotools(self) - with chdir(self, self.source_folder): - autotools.make(target=self._library_filename) + 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) - autotools = Autotools(self) - with chdir(self, self.source_folder): - autotools.make( - target=f'install-{"shared" if self.options.shared else "static-lib"}') + copy(self, pattern="LICENSE", 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", "pkgconfig")) + # INFO: Version 2.1.1 installs both static and shared libraries using same target name + if Version(self.version) <= "2.1.1": + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.so*", os.path.join(self.package_folder, "lib")) + rm(self, "*.dylib*", os.path.join(self.package_folder, "lib")) + rm(self, "*.dll", os.path.join(self.package_folder, "bin")) + rm(self, "openh264.lib", os.path.join(self.package_folder, "lib")) + + if is_msvc(self) or self._is_clang_cl: + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + if Version(self.version) <= "2.4.1": + if self.options.shared: + # INFO: Preserve same old library name as when building with Make on Windows but using Meson + rename(self, os.path.join(self.package_folder, "lib", "openh264.lib"), + os.path.join(self.package_folder, "lib", "openh264_dll.lib")) + if not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), + os.path.join(self.package_folder, "lib", "openh264.lib")) fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.set_property("pkg_config_name", "openh264") - suffix = "_dll" if ( - is_msvc(self) or self._is_clang_cl) and self.options.shared else "" + suffix = "_dll" if self._preserve_dll_name else "" self.cpp_info.libs = [f"openh264{suffix}"] if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs.extend(["m", "pthread"]) if self.settings.os == "Android": self.cpp_info.system_libs.append("m") - libcxx = stdcpp_library(self) - if libcxx: - self.cpp_info.system_libs.append(libcxx) + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + if self.settings.os == "Android" and libcxx == "c++_static": + # INFO: When builing for Android, need to link against c++abi too. Otherwise will get linkage errors: + # ld.lld: error: undefined symbol: operator new(unsigned long) + # >>> referenced by welsEncoderExt.cpp + self.cpp_info.system_libs.append("c++abi") + self.cpp_info.system_libs.append(libcxx) diff --git a/recipes/openh264/all/patches/1.7.0-0001-platform-android.mk.patch b/recipes/openh264/all/patches/1.7.0-0001-platform-android.mk.patch deleted file mode 100644 index 512d9a7cdfe3f..0000000000000 --- a/recipes/openh264/all/patches/1.7.0-0001-platform-android.mk.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- build/platform-android.mk -+++ build/platform-android.mk -@@ -38,23 +38,12 @@ - - TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=$(SRC_PATH)/codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=$(APP_ABI)) - --SYSROOT = $(NDKROOT)/platforms/android-$(NDKLEVEL)/arch-$(ARCH) --CXX = $(TOOLCHAINPREFIX)g++ --CC = $(TOOLCHAINPREFIX)gcc --AR = $(TOOLCHAINPREFIX)ar --CFLAGS += -DANDROID_NDK -fpic --sysroot=$(SYSROOT) -MMD -MP -+CFLAGS += -DANDROID_NDK -fpic -MMD -MP - CXXFLAGS += -fno-rtti -fno-exceptions --LDFLAGS += --sysroot=$(SYSROOT) - SHLDFLAGS = -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -Wl,-soname,lib$(PROJECT_NAME).so - --ifneq ($(CXX),$(wildcard $(CXX))) --ifneq ($(CXX).exe,$(wildcard $(CXX).exe)) --$(error Compiler not found, bad NDKROOT or ARCH?) --endif --endif -- - STL_INCLUDES = \ -- -I$(NDKROOT)/sources/cxx-stl/stlport/stlport -+ -I$(NDKROOT)/sources/cxx-stl/llvm-libc++/include - STL_LIB = \ - $(NDKROOT)/sources/cxx-stl/stlport/libs/$(APP_ABI)/libstlport_static.a - diff --git a/recipes/openh264/all/patches/1.7.0-0002-macos-relocatable-shared.patch b/recipes/openh264/all/patches/1.7.0-0002-macos-relocatable-shared.patch deleted file mode 100644 index dc10d42f2255e..0000000000000 --- a/recipes/openh264/all/patches/1.7.0-0002-macos-relocatable-shared.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/build/platform-darwin.mk -+++ b/build/platform-darwin.mk -@@ -7,7 +7,7 @@ CURRENT_VERSION := 1.7.0 - COMPATIBILITY_VERSION := 1.7.0 - SHLDFLAGS = -dynamiclib -twolevel_namespace -undefined dynamic_lookup \ - -fno-common -headerpad_max_install_names -install_name \ -- $(SHAREDLIB_DIR)/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER) -+ @rpath/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER) - SHARED = -dynamiclib - SHARED += -current_version $(CURRENT_VERSION) -compatibility_version $(COMPATIBILITY_VERSION) - CFLAGS += -Wall -fPIC -MMD -MP diff --git a/recipes/openh264/all/patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch b/recipes/openh264/all/patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch deleted file mode 100644 index fd092924362ea..0000000000000 --- a/recipes/openh264/all/patches/1.7.0-0004-mingw-override-CC-CXX-AR-from-env.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- build/platform-mingw_nt.mk -+++ build/platform-mingw_nt.mk -@@ -13,3 +13,3 @@ --CC = x86_64-w64-mingw32-gcc --CXX = x86_64-w64-mingw32-g++ --AR = x86_64-w64-mingw32-ar -+CC ?= x86_64-w64-mingw32-gcc -+CXX ?= x86_64-w64-mingw32-g++ -+AR ?= x86_64-w64-mingw32-ar diff --git a/recipes/openh264/all/patches/2.1.1-0001-platform-android.mk.patch b/recipes/openh264/all/patches/2.1.1-0001-platform-android.mk.patch deleted file mode 100644 index 2fbaccb65a3c9..0000000000000 --- a/recipes/openh264/all/patches/2.1.1-0001-platform-android.mk.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- build/platform-android.mk -+++ build/platform-android.mk -@@ -40,14 +40,9 @@ - TOOLCHAIN_NAME = $(shell NDK_TOOLCHAIN_VERSION= NDK_PROJECT_PATH=$(SRC_PATH)/codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_NAME APP_ABI=$(APP_ABI)) - GCC_TOOLCHAIN_PATH = $(shell dirname $(TOOLCHAINPREFIX) | xargs dirname ) - --SYSROOT = $(NDKROOT)/platforms/android-$(NDKLEVEL)/arch-$(ARCH) --CXX = $(TOOLCHAINPREFIX)g++ --CC = $(TOOLCHAINPREFIX)gcc --AR = $(TOOLCHAINPREFIX)ar --CFLAGS += -DANDROID_NDK -fpic --sysroot=$(SYSROOT) -MMD -MP -fstack-protector-all -+CFLAGS += -DANDROID_NDK -fpic -MMD -MP -fstack-protector-all - CFLAGS += -isystem $(NDKROOT)/sysroot/usr/include -isystem $(NDKROOT)/sysroot/usr/include/$(TOOLCHAIN_NAME) -D__ANDROID_API__=$(NDKLEVEL) - CXXFLAGS += -fno-rtti -fno-exceptions --LDFLAGS += --sysroot=$(SYSROOT) - SHLDFLAGS = -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -Wl,-soname,lib$(PROJECT_NAME).so - UTSHLDFLAGS = -Wl,-soname,libut.so - diff --git a/recipes/openh264/all/patches/2.1.1-0002-macos-relocatable-shared.patch b/recipes/openh264/all/patches/2.1.1-0002-macos-relocatable-shared.patch deleted file mode 100644 index ae1867902a4ea..0000000000000 --- a/recipes/openh264/all/patches/2.1.1-0002-macos-relocatable-shared.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/build/platform-darwin.mk -+++ b/build/platform-darwin.mk -@@ -7,7 +7,7 @@ CURRENT_VERSION := 2.1.1 - COMPATIBILITY_VERSION := 2.1.0 - SHLDFLAGS = -dynamiclib -twolevel_namespace -undefined dynamic_lookup \ - -fno-common -headerpad_max_install_names -install_name \ -- $(SHAREDLIB_DIR)/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER) -+ @rpath/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER) - SHARED = -dynamiclib - SHARED += -current_version $(CURRENT_VERSION) -compatibility_version $(COMPATIBILITY_VERSION) - CFLAGS += -Wall -fPIC -MMD -MP -fstack-protector-all diff --git a/recipes/openh264/all/patches/2.3.1-0001-platform-android.mk.patch b/recipes/openh264/all/patches/2.3.1-0001-platform-android.mk.patch deleted file mode 100644 index 7b4564ae8dded..0000000000000 --- a/recipes/openh264/all/patches/2.3.1-0001-platform-android.mk.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- build/platform-android.mk -+++ build/platform-android.mk -@@ -40,14 +40,9 @@ - TOOLCHAIN_NAME = $(shell NDK_TOOLCHAIN_VERSION= NDK_PROJECT_PATH=$(SRC_PATH)/codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_NAME APP_ABI=$(APP_ABI)) - GCC_TOOLCHAIN_PATH = $(shell dirname $(TOOLCHAINPREFIX) | xargs dirname ) - --SYSROOT = $(NDKROOT)/platforms/android-$(NDKLEVEL)/arch-$(ARCH) --CXX = $(TOOLCHAINPREFIX)g++ --CC = $(TOOLCHAINPREFIX)gcc --AR = $(TOOLCHAINPREFIX)ar --CFLAGS += -DANDROID_NDK -fpic --sysroot=$(SYSROOT) -MMD -MP -+CFLAGS += -DANDROID_NDK -fpic -MMD -MP - ifeq ($(USE_STACK_PROTECTOR), Yes) - CFLAGS += -fstack-protector-all - endif - CFLAGS += -isystem $(NDKROOT)/sysroot/usr/include -isystem $(NDKROOT)/sysroot/usr/include/$(TOOLCHAIN_NAME) -D__ANDROID_API__=$(NDKLEVEL) - CXXFLAGS += -fno-rtti -fno-exceptions --LDFLAGS += --sysroot=$(SYSROOT) - SHLDFLAGS = -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -Wl,-soname,lib$(PROJECT_NAME).so - UTSHLDFLAGS = -Wl,-soname,libut.so - diff --git a/recipes/openh264/all/patches/2.3.1-0002-macos-relocatable-shared.patch b/recipes/openh264/all/patches/2.3.1-0002-macos-relocatable-shared.patch deleted file mode 100644 index 7b9b27ea4570a..0000000000000 --- a/recipes/openh264/all/patches/2.3.1-0002-macos-relocatable-shared.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/build/platform-darwin.mk -+++ b/build/platform-darwin.mk -@@ -7,7 +7,7 @@ CURRENT_VERSION := 2.3.1 - COMPATIBILITY_VERSION := 2.3.1 - SHLDFLAGS = -dynamiclib -twolevel_namespace -undefined dynamic_lookup \ - -fno-common -headerpad_max_install_names -install_name \ -- $(SHAREDLIB_DIR)/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER) -+ @rpath/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER) - SHARED = -dynamiclib - SHARED += -current_version $(CURRENT_VERSION) -compatibility_version $(COMPATIBILITY_VERSION) - CFLAGS += -Wall -fPIC -MMD -MP -stdlib=libc++ diff --git a/recipes/openh264/all/test_package/CMakeLists.txt b/recipes/openh264/all/test_package/CMakeLists.txt index e48438bdd6d7b..48ed752786cf6 100644 --- a/recipes/openh264/all/test_package/CMakeLists.txt +++ b/recipes/openh264/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(openh264 REQUIRED CONFIG) diff --git a/recipes/openh264/all/test_package/conanfile.py b/recipes/openh264/all/test_package/conanfile.py index 1a1d9c4ff58f1..e845ae751a301 100644 --- a/recipes/openh264/all/test_package/conanfile.py +++ b/recipes/openh264/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_layout, CMake import os @@ -21,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self, skip_x64_x86=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/openh264/all/test_v1_package/CMakeLists.txt b/recipes/openh264/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2f6b1a2f7ec79..0000000000000 --- a/recipes/openh264/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/openh264/all/test_v1_package/conanfile.py b/recipes/openh264/all/test_v1_package/conanfile.py deleted file mode 100644 index f4b0754b85efb..0000000000000 --- a/recipes/openh264/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_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_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/openh264/config.yml b/recipes/openh264/config.yml index 783b155e8bb7a..9d2abec6a5e96 100644 --- a/recipes/openh264/config.yml +++ b/recipes/openh264/config.yml @@ -1,7 +1,9 @@ versions: + "2.5.0": + folder: all + "2.4.1": + folder: all "2.3.1": folder: all "2.1.1": folder: all - "1.7.0": - folder: all diff --git a/recipes/openimageio/all/CMakeLists.txt b/recipes/openimageio/all/CMakeLists.txt deleted file mode 100644 index 62d9f71f06583..0000000000000 --- a/recipes/openimageio/all/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include("conanbuildinfo.cmake") -conan_basic_setup(KEEP_RPATHS) - -include_directories( - BEFORE - # OIIO uses CMAKE_BINARY_DIR, we need to set include dirs - # in order to be able to use add_subdirectory - "${CMAKE_BINARY_DIR}/source_subfolder/src/include" - "${CMAKE_BINARY_DIR}/source_subfolder/include" - # Same as above but for CMAKE_SOURCE_DIR - "${CMAKE_SOURCE_DIR}/source_subfolder/src/include" -) - -set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP YES) - -add_subdirectory(source_subfolder) diff --git a/recipes/openimageio/all/conandata.yml b/recipes/openimageio/all/conandata.yml index f652a05c49a38..5223ea641249e 100644 --- a/recipes/openimageio/all/conandata.yml +++ b/recipes/openimageio/all/conandata.yml @@ -1,32 +1,54 @@ sources: - "2.2.7.0": - url: "https://github.com/OpenImageIO/oiio/archive/Release-2.2.7.0.tar.gz" - sha256: "857ac83798d6d2bda5d4d11a90618ff19486da2e5a4c4ff022c5976b5746fe8c" - "2.2.18.0": - url: "https://github.com/OpenImageIO/oiio/archive/refs/tags/v2.2.18.0.tar.gz" - sha256: "72597619f09b60cc2afc18f378b40fbec62701112957f43cff162dd9a52a26ce" - "2.3.7.2": - url: "https://github.com/OpenImageIO/oiio/archive/refs/tags/v2.3.7.2.tar.gz" - sha256: "829c05d17610f1156c2a777310f4709b81f3a302fd11e3999ea4a865a5b4a5d3" "2.4.7.1": - url: "https://github.com/OpenImageIO/oiio/archive/refs/tags/v2.4.7.1.tar.gz" - sha256: "fd298f71e44c6776863db4b37c4a1388dba0d2eb37378afea95ab07a7cd6ecd4" + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.4.7.1.tar.gz" + sha256: "a3dc6fdb3693eb5f1e22191e41c05800a4944f3c76daffe90bd203f956180126" + "2.4.17.0": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.4.17.0.tar.gz" + sha256: "7fe81d8e5bce30cc4a212f020ac3cc4344e6b7c1c0842475e3a048515099c65c" + "2.5.14.0": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.14.0.tar.gz" + sha256: "0e74372c658f083820872311d126867f10d59b526a856672746de7b2c772034d" + "2.5.15.0": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.15.0.tar.gz" + sha256: "7779ef2c3d03c5ed95e13ff292de85c3f8cee301cd46baad0d2dc83c93bfe85c" + "2.5.16.0": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.16.0.tar.gz" + sha256: "e5438e28d34a5b0a09428ed77ec310edd47c141db1b259364859110847e161e7" + "2.5.17.0": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.17.0.tar.gz" + sha256: "9cf1b98762ce5aa5f3f7cd34672549034f5716da1eba26eb5173c18aa21e6583" + "2.5.18.0": + url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.18.0.tar.gz" + sha256: "f57481435cec18633d3eba9b2e8c483fc1df6f0a01c5c9f98cbae6d1c52928e5" patches: - "2.2.7.0": - - patch_file: "patches/2.2.7.0-cmake-targets.patch" - base_path: "source_subfolder" - "2.2.18.0": - - patch_file: "patches/2.2.18.0-cmake-targets.patch" - base_path: "source_subfolder" - "2.3.7.2": - - patch_file: "patches/2.3.7.2-cmake-targets.patch" - base_path: "source_subfolder" "2.4.7.1": - patch_file: "patches/2.4.7.1-cmake-targets.patch" - base_path: "source_subfolder" patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" patch_type: "conan" - patch_file: "patches/2.4.7.1-fix-msvc2017.patch" - base_path: "source_subfolder" patch_description: "Fix compile error with MSVC 2017" patch_type: "official" + "2.4.17.0": + - patch_file: "patches/2.4.17.0-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "2.5.14.0": + - patch_file: "patches/2.5.14.0-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "2.5.15.0": + - patch_file: "patches/2.5.14.0-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "2.5.16.0": + - patch_file: "patches/2.5.14.0-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "2.5.17.0": + - patch_file: "patches/2.5.17.0-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "2.5.18.0": + - patch_file: "patches/2.5.18.0-cmake-targets.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" diff --git a/recipes/openimageio/all/conanfile.py b/recipes/openimageio/all/conanfile.py index f741a725420ff..77024f25cf6bb 100644 --- a/recipes/openimageio/all/conanfile.py +++ b/recipes/openimageio/all/conanfile.py @@ -1,10 +1,10 @@ +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, export_conandata_patches, copy, get, rm, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime -from conan import ConanFile, Version -from conan.tools import files +from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -from conans import CMake -import functools import os required_conan_version = ">=1.53.0" @@ -19,7 +19,7 @@ class OpenImageIOConan(ConanFile): "professional, large-scale animation and visual effects work for film." ) topics = ("vfx", "image", "picture") - license = "BSD-3-Clause" + license = "Apache-2.0", "BSD-3-Clause" homepage = "http://www.openimageio.org/" url = "https://github.com/conan-io/conan-center-index" @@ -65,21 +65,8 @@ class OpenImageIOConan(ConanFile): "with_libwebp": True, } - short_paths = 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": @@ -87,236 +74,235 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): # Required libraries - self.requires("zlib/1.2.13") - self.requires("boost/1.78.0") - self.requires("libtiff/4.5.1") - self.requires("openexr/2.5.7") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("boost/1.84.0") + self.requires("libtiff/4.6.0") + self.requires("imath/3.1.9", transitive_headers=True) + self.requires("openexr/3.2.3") 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("pugixml/1.12.1") + self.requires("libjpeg-turbo/3.0.2") + self.requires("pugixml/1.14") self.requires("libsquish/1.15") - self.requires("tsl-robin-map/1.0.1") - self.requires("fmt/8.1.1") + self.requires("tsl-robin-map/1.2.1") + if Version(self.version) >= "2.4.17.0": + self.requires("fmt/10.2.1", transitive_headers=True) + else: + self.requires("fmt/9.1.0", transitive_headers=True) # Optional libraries if self.options.with_libpng: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_freetype: - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") if self.options.with_hdf5: - self.requires("hdf5/1.12.1") + self.requires("hdf5/1.14.3") if self.options.with_opencolorio: - if Version(self.version) < "2.3.7.2": - self.requires("opencolorio/1.1.1") - else: - self.requires("opencolorio/2.1.0") + self.requires("opencolorio/2.3.1") if self.options.with_opencv: - self.requires("opencv/4.5.5") + self.requires("opencv/4.8.1") if self.options.with_tbb: - self.requires("onetbb/2020.3") + self.requires("onetbb/2021.10.0") if self.options.with_dicom: - self.requires("dcmtk/3.6.6") + self.requires("dcmtk/3.6.7") if self.options.with_ffmpeg: - self.requires("ffmpeg/4.4") + self.requires("ffmpeg/6.1") # TODO: Field3D dependency if self.options.with_giflib: self.requires("giflib/5.2.1") if self.options.with_libheif: - self.requires("libheif/1.12.0") + self.requires("libheif/1.16.2") if self.options.with_raw: - self.requires("libraw/0.20.2") + self.requires("libraw/0.21.2") if self.options.with_openjpeg: - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.with_openvdb: self.requires("openvdb/8.0.1") if self.options.with_ptex: - self.requires("ptex/2.4.0") + self.requires("ptex/2.4.2") if self.options.with_libwebp: - self.requires("libwebp/1.3.1") + self.requires("libwebp/1.3.2") # TODO: R3DSDK dependency # TODO: Nuke dependency def validate(self): - if self.settings.compiler.get_safe("cppstd"): - if Version(self.version) >= "2.3.0.0" or self.options.with_openvdb: - check_min_cppstd(self, 14) - else: - check_min_cppstd(self, 11) + if self.settings.compiler.cppstd: + check_min_cppstd(self, 14) if is_msvc(self) and is_msvc_static_runtime(self) and self.options.shared: raise ConanInvalidConfiguration( "Building shared library with static runtime is not supported!" ) - def source(self): - files.get( - self, - **self.conan_data["sources"][self.version], - strip_root=True, - destination=self._source_subfolder - ) + def layout(self): + cmake_layout(self, src_folder="src") - def _patch_sources(self): - files.apply_conandata_patches(self) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) + def generate(self): + tc = CMakeToolchain(self) # CMake options - cmake.definitions["CMAKE_DEBUG_POSTFIX"] = "" # Needed for 2.3.x.x+ versions - cmake.definitions["OIIO_BUILD_TOOLS"] = True - cmake.definitions["OIIO_BUILD_TESTS"] = False - cmake.definitions["BUILD_DOCS"] = False - cmake.definitions["INSTALL_DOCS"] = False - cmake.definitions["INSTALL_FONTS"] = False - cmake.definitions["INSTALL_CMAKE_HELPER"] = False - cmake.definitions["EMBEDPLUGINS"] = True - cmake.definitions["USE_PYTHON"] = False - cmake.definitions["USE_EXTERNAL_PUGIXML"] = True + tc.variables["CMAKE_DEBUG_POSTFIX"] = "" # Needed for 2.3.x.x+ versions + tc.variables["OIIO_BUILD_TOOLS"] = True + tc.variables["OIIO_BUILD_TESTS"] = False + tc.variables["BUILD_DOCS"] = False + tc.variables["INSTALL_DOCS"] = False + tc.variables["INSTALL_FONTS"] = False + tc.variables["INSTALL_CMAKE_HELPER"] = False + tc.variables["EMBEDPLUGINS"] = True + tc.variables["USE_PYTHON"] = False + tc.variables["USE_EXTERNAL_PUGIXML"] = True + tc.variables["BUILD_MISSING_FMT"] = False + + # Conan is normally not used for testing, so fixing this option to not build the tests + tc.variables["BUILD_TESTING"] = False # OIIO CMake files are patched to check USE_* flags to require or not use dependencies - cmake.definitions["USE_JPEGTURBO"] = ( + tc.variables["USE_JPEGTURBO"] = ( self.options.with_libjpeg == "libjpeg-turbo" ) - cmake.definitions[ + tc.variables[ "USE_JPEG" ] = True # Needed for jpeg.imageio plugin, libjpeg/libjpeg-turbo selection still works - cmake.definitions["USE_HDF5"] = self.options.with_hdf5 - cmake.definitions["USE_OPENCOLORIO"] = self.options.with_opencolorio - cmake.definitions["USE_OPENCV"] = self.options.with_opencv - cmake.definitions["USE_TBB"] = self.options.with_tbb - cmake.definitions["USE_DCMTK"] = self.options.with_dicom - cmake.definitions["USE_FFMPEG"] = self.options.with_ffmpeg - cmake.definitions["USE_FIELD3D"] = False - cmake.definitions["USE_GIF"] = self.options.with_giflib - cmake.definitions["USE_LIBHEIF"] = self.options.with_libheif - cmake.definitions["USE_LIBRAW"] = self.options.with_raw - cmake.definitions["USE_OPENVDB"] = self.options.with_openvdb - cmake.definitions["USE_PTEX"] = self.options.with_ptex - cmake.definitions["USE_R3DSDK"] = False - cmake.definitions["USE_NUKE"] = False - cmake.definitions["USE_OPENGL"] = False - cmake.definitions["USE_QT"] = False - cmake.definitions["USE_LIBPNG"] = self.options.with_libpng - cmake.definitions["USE_FREETYPE"] = self.options.with_freetype - cmake.definitions["USE_LIBWEBP"] = self.options.with_libwebp - cmake.definitions["USE_OPENJPEG"] = self.options.with_openjpeg - - if self.options.with_openvdb: - cmake.definitions["CMAKE_CXX_STANDARD"] = 14 + tc.variables["USE_HDF5"] = self.options.with_hdf5 + tc.variables["USE_OPENCOLORIO"] = self.options.with_opencolorio + tc.variables["USE_OPENCV"] = self.options.with_opencv + tc.variables["USE_TBB"] = self.options.with_tbb + tc.variables["USE_DCMTK"] = self.options.with_dicom + tc.variables["USE_FFMPEG"] = self.options.with_ffmpeg + tc.variables["USE_FIELD3D"] = False + tc.variables["USE_GIF"] = self.options.with_giflib + tc.variables["USE_LIBHEIF"] = self.options.with_libheif + tc.variables["USE_LIBRAW"] = self.options.with_raw + tc.variables["USE_OPENVDB"] = self.options.with_openvdb + tc.variables["USE_PTEX"] = self.options.with_ptex + tc.variables["USE_R3DSDK"] = False + tc.variables["USE_NUKE"] = False + tc.variables["USE_OPENGL"] = False + tc.variables["USE_QT"] = False + tc.variables["USE_LIBPNG"] = self.options.with_libpng + tc.variables["USE_FREETYPE"] = self.options.with_freetype + tc.variables["USE_LIBWEBP"] = self.options.with_libwebp + tc.variables["USE_OPENJPEG"] = self.options.with_openjpeg - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.generate() + cd = CMakeDeps(self) + cd.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): - 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() + rmdir(self, os.path.join(self.package_folder, "share")) + if self.settings.os == "Windows": + for vc_file in ("concrt", "msvcp", "vcruntime"): + rm(self, f"{vc_file}*.dll", 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", "cmake")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - files.rmdir(self, os.path.join(self.package_folder, "share")) + @staticmethod + def _conan_comp(name): + return f"openimageio_{name.lower()}" - self.copy("LICENSE.md", src=self._source_subfolder, dst="licenses") + def _add_component(self, name): + component = self.cpp_info.components[self._conan_comp(name)] + component.set_property("cmake_target_name", f"OpenImageIO::{name}") + component.names["cmake_find_package"] = name + component.names["cmake_find_package_multi"] = name + return component def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenImageIO") - self.cpp_info.set_property("cmake_target_name", "OpenImageIO::OpenImageIO") self.cpp_info.set_property("pkg_config_name", "OpenImageIO") - self.cpp_info.components["openimageio_util"].set_property( - "cmake_target_name", "OpenImageIO::OpenImageIO_Util" - ) - self.cpp_info.components["openimageio_util"].libs = ["OpenImageIO_Util"] - self.cpp_info.components["openimageio_util"].requires = [ + self.cpp_info.names["cmake_find_package"] = "OpenImageIO" + self.cpp_info.names["cmake_find_package_multi"] = "OpenImageIO" + + # OpenImageIO::OpenImageIO_Util + open_image_io_util = self._add_component("OpenImageIO_Util") + open_image_io_util.libs = ["OpenImageIO_Util"] + open_image_io_util.requires = [ "boost::filesystem", "boost::thread", "boost::system", "boost::regex", + "imath::imath", "openexr::openexr", ] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["openimageio_util"].system_libs.extend( + open_image_io_util.system_libs.extend( ["dl", "m", "pthread"] ) + if self.options.with_tbb: + open_image_io_util.requires.append("onetbb::onetbb") - self.cpp_info.components["main"].set_property( - "cmake_target_name", "OpenImageIO::OpenImageIO" - ) - self.cpp_info.components["main"].set_property("pkg_config_name", "OpenImageIO") - self.cpp_info.components["main"].libs = ["OpenImageIO"] - self.cpp_info.components["main"].requires = [ - "openimageio_util", + # OpenImageIO::OpenImageIO + open_image_io = self._add_component("OpenImageIO") + open_image_io.libs = ["OpenImageIO"] + open_image_io.requires = [ + "openimageio_openimageio_util", "zlib::zlib", "boost::thread", "boost::system", "boost::container", "boost::regex", "libtiff::libtiff", - "openexr::openexr", "pugixml::pugixml", "tsl-robin-map::tsl-robin-map", "libsquish::libsquish", "fmt::fmt", + "imath::imath", + "openexr::openexr", ] + if self.options.with_libjpeg == "libjpeg": - self.cpp_info.components["main"].requires.append("libjpeg::libjpeg") + open_image_io.requires.append("libjpeg::libjpeg") elif self.options.with_libjpeg == "libjpeg-turbo": - self.cpp_info.components["main"].requires.append( + open_image_io.requires.append( "libjpeg-turbo::libjpeg-turbo" ) if self.options.with_libpng: - self.cpp_info.components["main"].requires.append("libpng::libpng") + open_image_io.requires.append("libpng::libpng") if self.options.with_freetype: - self.cpp_info.components["main"].requires.append("freetype::freetype") + open_image_io.requires.append("freetype::freetype") if self.options.with_hdf5: - self.cpp_info.components["main"].requires.append("hdf5::hdf5") + open_image_io.requires.append("hdf5::hdf5") if self.options.with_opencolorio: - self.cpp_info.components["main"].requires.append("opencolorio::opencolorio") + open_image_io.requires.append("opencolorio::opencolorio") if self.options.with_opencv: - self.cpp_info.components["main"].requires.append("opencv::opencv") - if self.options.with_tbb: - self.cpp_info.components["openimageio_util"].requires.append("onetbb::onetbb") + open_image_io.requires.append("opencv::opencv") if self.options.with_dicom: - self.cpp_info.components["main"].requires.append("dcmtk::dcmtk") + open_image_io.requires.append("dcmtk::dcmtk") if self.options.with_ffmpeg: - self.cpp_info.components["main"].requires.append("ffmpeg::ffmpeg") + open_image_io.requires.append("ffmpeg::ffmpeg") if self.options.with_giflib: - self.cpp_info.components["main"].requires.append("giflib::giflib") + open_image_io.requires.append("giflib::giflib") if self.options.with_libheif: - self.cpp_info.components["main"].requires.append("libheif::libheif") + open_image_io.requires.append("libheif::libheif") if self.options.with_raw: - self.cpp_info.components["main"].requires.append("libraw::libraw") + open_image_io.requires.append("libraw::libraw") if self.options.with_openjpeg: - self.cpp_info.components["main"].requires.append("openjpeg::openjpeg") + open_image_io.requires.append("openjpeg::openjpeg") if self.options.with_openvdb: - self.cpp_info.components["main"].requires.append("openvdb::openvdb") + open_image_io.requires.append("openvdb::openvdb") if self.options.with_ptex: - self.cpp_info.components["main"].requires.append("ptex::ptex") + open_image_io.requires.append("ptex::ptex") if self.options.with_libwebp: - self.cpp_info.components["main"].requires.append("libwebp::libwebp") + open_image_io.requires.append("libwebp::libwebp") if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["main"].system_libs.extend(["dl", "m", "pthread"]) + open_image_io.system_libs.extend(["dl", "m", "pthread"]) if not self.options.shared: - self.cpp_info.components["main"].defines.append("OIIO_STATIC_DEFINE") - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "OpenImageIO" - self.cpp_info.names["cmake_find_package_multi"] = "OpenImageIO" - self.cpp_info.names["pkg_config"] = "OpenImageIO" - self.cpp_info.components["openimageio_util"].names[ - "cmake_find_package" - ] = "OpenImageIO_Util" - self.cpp_info.components["main"].names["cmake_find_package"] = "OpenImageIO" + open_image_io.defines.append("OIIO_STATIC_DEFINE") diff --git a/recipes/openimageio/all/patches/2.2.18.0-cmake-targets.patch b/recipes/openimageio/all/patches/2.2.18.0-cmake-targets.patch deleted file mode 100644 index 395bff8a6bd10..0000000000000 --- a/recipes/openimageio/all/patches/2.2.18.0-cmake-targets.patch +++ /dev/null @@ -1,711 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ccda926b..24b26b8f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -99,7 +99,7 @@ message(STATUS "Setting Namespace to: ${PROJ_NAMESPACE_V}") - - - list (APPEND CMAKE_MODULE_PATH -- "${PROJECT_SOURCE_DIR}/src/cmake/modules" -+ # "${PROJECT_SOURCE_DIR}/src/cmake/modules" - "${PROJECT_SOURCE_DIR}/src/cmake") - - include (GNUInstallDirs) -@@ -179,7 +179,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) - add_subdirectory (src/iinfo) - add_subdirectory (src/maketx) - add_subdirectory (src/oiiotool) -- add_subdirectory (src/testtex) -+ # add_subdirectory (src/testtex) - add_subdirectory (src/iv) - endif () - -diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake -index 8747f506..503e2a55 100644 ---- a/src/cmake/compiler.cmake -+++ b/src/cmake/compiler.cmake -@@ -92,7 +92,7 @@ if (NOT MSVC) - add_compile_options ("-Wextra") - endif () - if (STOP_ON_WARNING OR DEFINED ENV{CI}) -- add_compile_options ("-Werror") -+ # add_compile_options ("-Werror") - # N.B. Force CI builds to use -Werror, even if STOP_ON_WARNING has - # been switched off by default, which we may do in release - # branches. -diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake -index 21e18b53..605d247a 100644 ---- a/src/cmake/externalpackages.cmake -+++ b/src/cmake/externalpackages.cmake -@@ -46,7 +46,7 @@ endif () - if (MSVC) - # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: - if (NOT Boost_USE_STATIC_LIBS) -- add_definitions (-DBOOST_ALL_DYN_LINK=1) -+ # add_definitions (-DBOOST_ALL_DYN_LINK=1) - endif () - endif () - -@@ -55,7 +55,7 @@ if (BOOST_CUSTOM) - # N.B. For a custom version, the caller had better set up the variables - # Boost_VERSION, Boost_INCLUDE_DIRS, Boost_LIBRARY_DIRS, Boost_LIBRARIES. - else () -- set (Boost_COMPONENTS filesystem system thread) -+ set (Boost_COMPONENTS filesystem system thread container) - if (NOT USE_STD_REGEX) - list (APPEND Boost_COMPONENTS regex) - endif () -@@ -106,16 +106,16 @@ checked_find_package (OpenEXR REQUIRED - # library. This shoudn't be necessary, except for the common case of people - # building against Imath/OpenEXR 3.x when there is still a system-level - # install version of 2.x. --include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) --if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3) -+# include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) -+if (CMAKE_COMPILER_IS_CLANG AND OpenEXR_VERSION VERSION_LESS 2.3) - # clang C++ >= 11 doesn't like 'register' keyword in old exr headers - add_compile_options (-Wno-deprecated-register) - endif () - if (MSVC AND NOT LINKSTATIC) -- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? -+ # add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? - endif () - --if (OPENEXR_VERSION VERSION_GREATER_EQUAL 2.5.99) -+if (OpenEXR_VERSION VERSION_GREATER_EQUAL 2.5.99) - set (OIIO_USING_IMATH 3) - else () - set (OIIO_USING_IMATH 2) -@@ -123,12 +123,15 @@ endif () - - - # JPEG -- prefer Turbo-JPEG to regular libjpeg --checked_find_package (JPEGTurbo -+if (USE_JPEGTURBO) -+ checked_find_package (libjpeg-turbo REQUIRED - DEFINITIONS -DUSE_JPEG_TURBO=1 -- PRINT JPEG_INCLUDES JPEG_INCLUDE_DIRS -- JPEG_LIBRARIES) --if (NOT JPEG_FOUND) # Try to find the non-turbo version -+ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) -+ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) -+elseif (USE_JPEG) # Try to find the non-turbo version - checked_find_package (JPEG REQUIRED) -+else () -+ message(FATAL_ERROR "JPEG library was not found!") - endif () - - # Pugixml setup. Normally we just use the version bundled with oiio, but -@@ -144,60 +147,83 @@ else () - endif() - - # From pythonutils.cmake --find_python() -+# find_python() - - - ########################################################################### - # Dependencies for optional formats and features. If these are not found, - # we will continue building, but the related functionality will be disabled. - --checked_find_package (PNG) -- --checked_find_package (BZip2) # Used by ffmpeg and freetype --if (NOT BZIP2_FOUND) -- set (BZIP2_LIBRARIES "") # TODO: why does it break without this? -+if (USE_LIBPNG) -+ checked_find_package (PNG REQUIRED) - endif () - --checked_find_package (Freetype -+# checked_find_package (BZip2) # Used by ffmpeg and freetype -+# if (NOT BZIP2_FOUND) -+# set (BZIP2_LIBRARIES "") # TODO: why does it break without this? -+# endif () -+ -+if (USE_FREETYPE) -+ checked_find_package (Freetype REQUIRED - DEFINITIONS -DUSE_FREETYPE=1 ) -+endif () - --checked_find_package (HDF5 -+if (USE_HDF5) -+ checked_find_package (HDF5 REQUIRED - ISDEPOF Field3D) --checked_find_package (OpenColorIO -+endif () -+if (USE_OPENCOLORIO) -+ checked_find_package (OpenColorIO REQUIRED - DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1) --checked_find_package (OpenCV -+endif () -+if (USE_OPENCV) -+ checked_find_package (OpenCV REQUIRED - DEFINITIONS -DUSE_OPENCV=1) -+endif () - - # Intel TBB - set (TBB_USE_DEBUG_BUILD OFF) --checked_find_package (TBB 2017 -+if (USE_TBB) -+ checked_find_package (TBB 2017 REQUIRED - DEFINITIONS -DUSE_TBB=1 - PREFER_CONFIG) -+endif () - --checked_find_package (DCMTK VERSION_MIN 3.6.1) # For DICOM images --checked_find_package (FFmpeg VERSION_MIN 2.6) --checked_find_package (Field3D -+if (USE_DCMTK) -+ checked_find_package (DCMTK REQUIRED VERSION_MIN 3.6.1) # For DICOM images -+endif () -+if (USE_FFMPEG) -+ checked_find_package (ffmpeg REQUIRED VERSION_MIN 2.6) -+endif () -+if (USE_FIELD3D) -+ checked_find_package (Field3D REQUIRED - DEPS HDF5 - DEFINITIONS -DUSE_FIELD3D=1) --checked_find_package (GIF -+endif () -+if (USE_GIF) -+ checked_find_package (GIF REQUIRED - VERSION_MIN 4 - RECOMMEND_MIN 5.0 - RECOMMEND_MIN_REASON "for stability and thread safety") -+endif () - - # For HEIF/HEIC/AVIF formats --checked_find_package (Libheif VERSION_MIN 1.3 -+if (USE_LIBHEIF) -+ checked_find_package (libheif REQUIRED VERSION_MIN 1.3 - RECOMMEND_MIN 1.7 - RECOMMEND_MIN_REASON "for AVIF support") --if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) -+endif () -+if (0) - message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") - set (Libheif_FOUND 0) - endif () - --checked_find_package (LibRaw -+if (USE_LIBRAW) -+ checked_find_package (libraw REQUIRED - RECOMMEND_MIN 0.18 -- RECOMMEND_MIN_REASON "for ACES support and better camera metadata" -- PRINT LibRaw_r_LIBRARIES) --if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) -+ RECOMMEND_MIN_REASON "for ACES support and better camera metadata") -+endif () -+if (0) - message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") - # Currently, we issue the above warning and let them take their chances. - # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, -@@ -206,12 +232,15 @@ if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VER - # set (LIBRAW_FOUND 0) - endif () - --checked_find_package (OpenJPEG VERSION_MIN 2.0) -- --checked_find_package (OpenVDB -+if (USE_OPENJPEG) -+ checked_find_package (OpenJPEG REQUIRED VERSION_MIN 2.0) -+endif () -+if (USE_OPENVDB) -+ checked_find_package (OpenVDB REQUIRED - VERSION_MIN 5.0 - DEPS TBB - DEFINITIONS -DUSE_OPENVDB=1) -+endif () - if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 8.0 - AND CMAKE_CXX_STANDARD VERSION_LESS 14) - set (OpenVDB_FOUND OFF) -@@ -225,23 +254,32 @@ if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 8.0 - message (STATUS "${ColorRed}Not using OpenVDB -- OpenVDB ${OpenVDB_VERSION} requires C++14 or later. ${ColorReset}") - endif () - --checked_find_package (Ptex PREFER_CONFIG) --if (NOT Ptex_FOUND OR NOT Ptex_VERSION) -+if (USE_PTEX) -+ checked_find_package (ptex REQUIRED PREFER_CONFIG) -+endif () -+if (0) - # Fallback for inadequate Ptex exported configs. This will eventually - # disappear when we can 100% trust Ptex's exports. - unset (Ptex_FOUND) - checked_find_package (Ptex) - endif () -- --checked_find_package (WebP) -+if (USE_LIBWEBP) -+ checked_find_package (WebP REQUIRED) -+endif () - - option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) --checked_find_package (R3DSDK) # RED camera -+if (USE_R3DSDK) -+ checked_find_package (R3DSDK REQUIRED) # RED camera -+endif () - - set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") --checked_find_package (Nuke) -+if (USE_NUKE) -+ checked_find_package (Nuke REQUIRED) -+endif () - --checked_find_package (OpenGL) # used for iv -+if (USE_OPENGL) -+ checked_find_package (OpenGL REQUIRED) # used for iv -+endif () - - # Qt -- used for iv - set (qt5_modules Core Gui Widgets) -@@ -249,7 +287,9 @@ if (OPENGL_FOUND) - list (APPEND qt5_modules OpenGL) - endif () - option (USE_QT "Use Qt if found" ON) --checked_find_package (Qt5 COMPONENTS ${qt5_modules}) -+if (USE_QT) -+ checked_find_package (Qt5 REQUIRED COMPONENTS ${qt5_modules}) -+endif () - if (USE_QT AND NOT Qt5_FOUND AND APPLE) - message (STATUS " If you think you installed qt5 with Homebrew and it still doesn't work,") - message (STATUS " try: export PATH=/usr/local/opt/qt5/bin:$PATH") -@@ -270,13 +310,13 @@ macro (find_or_download_robin_map) - # for an installed version. Still prefer a copy that seems to be - # locally installed in this tree. - if (NOT BUILD_ROBINMAP_FORCE) -- find_package (Robinmap QUIET) -+ find_package (tsl-robin-map REQUIRED) - endif () - # If an external copy wasn't found and we requested that missing - # packages be built, or we we are forcing a local copy to be built, then - # download and build it. - # Download the headers from github -- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) -+ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) - message (STATUS "Downloading local Tessil/robin-map") - set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") - set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") -@@ -294,7 +334,7 @@ macro (find_or_download_robin_map) - endif () - set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") - endif () -- checked_find_package (Robinmap REQUIRED) -+ checked_find_package (tsl-robin-map REQUIRED) - endmacro() - - -@@ -304,7 +344,7 @@ endmacro() - option (USE_EMBEDDED_LIBSQUISH - "Force use of embedded Libsquish, even if external is found" OFF) - if (NOT USE_EMBEDDED_LIBSQUISH) -- checked_find_package (Libsquish) -+ checked_find_package (libsquish) - endif () - - -@@ -325,7 +365,7 @@ macro (find_or_download_fmt) - # If an external copy wasn't found and we requested that missing - # packages be built, or we we are forcing a local copy to be built, then - # download and build it. -- if ((BUILD_MISSING_FMT AND NOT FMT_FOUND) OR BUILD_FMT_FORCE) -+ if ((BUILD_MISSING_FMT AND NOT fmt_FOUND) OR BUILD_FMT_FORCE) - message (STATUS "Downloading local fmtlib/fmt") - set (FMT_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/fmt") - set (FMT_GIT_REPOSITORY "https://github.com/fmtlib/fmt") -diff --git a/src/dds.imageio/CMakeLists.txt b/src/dds.imageio/CMakeLists.txt -index d693453a..7ff6e9ce 100644 ---- a/src/dds.imageio/CMakeLists.txt -+++ b/src/dds.imageio/CMakeLists.txt -@@ -2,10 +2,10 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (Libsquish_FOUND) -+if (libsquish_FOUND) - # External libsquish was found -- use it - add_oiio_plugin (ddsinput.cpp -- LINK_LIBRARIES Libsquish::Libsquish -+ LINK_LIBRARIES libsquish::libsquish - ) - else () - # No external libsquish was found -- use the embedded version. -diff --git a/src/dicom.imageio/CMakeLists.txt b/src/dicom.imageio/CMakeLists.txt -index ddd72044..3603eaa3 100644 ---- a/src/dicom.imageio/CMakeLists.txt -+++ b/src/dicom.imageio/CMakeLists.txt -@@ -4,8 +4,8 @@ - - if (DCMTK_FOUND) - add_oiio_plugin (dicominput.cpp -- INCLUDE_DIRS ${DCMTK_INCLUDE_DIR} -- LINK_LIBRARIES ${DCMTK_LIBRARIES} -+ # INCLUDE_DIRS ${DCMTK_INCLUDE_DIR} -+ LINK_LIBRARIES DCMTK::DCMTK - DEFINITIONS "-DUSE_DCMTK=1") - else () - message (WARNING "DICOM plugin will not be built, no DCMTK") -diff --git a/src/ffmpeg.imageio/CMakeLists.txt b/src/ffmpeg.imageio/CMakeLists.txt -index 614b8843..0df87825 100644 ---- a/src/ffmpeg.imageio/CMakeLists.txt -+++ b/src/ffmpeg.imageio/CMakeLists.txt -@@ -2,13 +2,13 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (FFmpeg_FOUND) -+if (ffmpeg_FOUND) - add_oiio_plugin (ffmpeginput.cpp -- INCLUDE_DIRS ${FFMPEG_INCLUDES} -- LINK_LIBRARIES ${FFMPEG_LIBRARIES} -- ${BZIP2_LIBRARIES} -+ # INCLUDE_DIRS ${FFMPEG_INCLUDES} -+ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale -+ # ${BZIP2_LIBRARIES} - DEFINITIONS "-DUSE_FFMPEG" -- "-DOIIO_FFMPEG_VERSION=\"${FFMPEG_VERSION}\"") -+ "-DOIIO_FFMPEG_VERSION=\"${ffmpeg_VERSION}\"") - else() - message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") - endif() -diff --git a/src/gif.imageio/CMakeLists.txt b/src/gif.imageio/CMakeLists.txt -index c9e7392c..eda8b482 100644 ---- a/src/gif.imageio/CMakeLists.txt -+++ b/src/gif.imageio/CMakeLists.txt -@@ -4,8 +4,8 @@ - - if (GIF_FOUND) - add_oiio_plugin (gifinput.cpp gifoutput.cpp -- INCLUDE_DIRS ${GIF_INCLUDE_DIRS} -- LINK_LIBRARIES ${GIF_LIBRARIES} -+ # INCLUDE_DIRS ${GIF_INCLUDE_DIRS} -+ LINK_LIBRARIES GIF::GIF - DEFINITIONS "-DUSE_GIF") - else() - message (WARNING "GIF plugin will not be built") -diff --git a/src/heif.imageio/CMakeLists.txt b/src/heif.imageio/CMakeLists.txt -index fed80015..2593f585 100644 ---- a/src/heif.imageio/CMakeLists.txt -+++ b/src/heif.imageio/CMakeLists.txt -@@ -2,9 +2,9 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (Libheif_FOUND) -+if (libheif_FOUND) - add_oiio_plugin (heifinput.cpp heifoutput.cpp -- LINK_LIBRARIES Libheif::Libheif -+ LINK_LIBRARIES libheif::libheif - DEFINITIONS "-DUSE_HEIF=1") - else () - message (WARNING "heif plugin will not be built") -diff --git a/src/igrep/CMakeLists.txt b/src/igrep/CMakeLists.txt -index 3fde566a..adaac8bd 100644 ---- a/src/igrep/CMakeLists.txt -+++ b/src/igrep/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - fancy_add_executable (LINK_LIBRARIES OpenImageIO -- ${Boost_LIBRARIES} # because regex -+ Boost::regex # because regex - ) -diff --git a/src/iinfo/CMakeLists.txt b/src/iinfo/CMakeLists.txt -index 3fde566a..adaac8bd 100644 ---- a/src/iinfo/CMakeLists.txt -+++ b/src/iinfo/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - fancy_add_executable (LINK_LIBRARIES OpenImageIO -- ${Boost_LIBRARIES} # because regex -+ Boost::regex # because regex - ) -diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt -index 1ea81b64..248e8a25 100644 ---- a/src/include/CMakeLists.txt -+++ b/src/include/CMakeLists.txt -@@ -56,17 +56,20 @@ install (FILES ${detail_headers} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail - COMPONENT developer) - -+set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") - set (fmt_headers - ${FMT_INCLUDES}/fmt/core.h - ${FMT_INCLUDES}/fmt/format-inl.h - ${FMT_INCLUDES}/fmt/format.h - ${FMT_INCLUDES}/fmt/ostream.h - ${FMT_INCLUDES}/fmt/printf.h ) -+if (0) - file (COPY ${fmt_headers} - DESTINATION ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt) - install (FILES ${fmt_headers} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail/fmt - COMPONENT developer) -+endif () - - if (NOT USE_EXTERNAL_PUGIXML) - set (pugixml_headers -diff --git a/src/include/OpenImageIO/strutil.h b/src/include/OpenImageIO/strutil.h -index ed68af14..34b83220 100644 ---- a/src/include/OpenImageIO/strutil.h -+++ b/src/include/OpenImageIO/strutil.h -@@ -41,9 +41,9 @@ - #ifndef FMT_USE_GRISU - # define FMT_USE_GRISU 1 - #endif --#include "detail/fmt/ostream.h" --#include "detail/fmt/format.h" --#include "detail/fmt/printf.h" -+#include -+#include -+#include - #if OIIO_GNUC_VERSION >= 70000 - # pragma GCC diagnostic pop - #endif -diff --git a/src/jpeg.imageio/CMakeLists.txt b/src/jpeg.imageio/CMakeLists.txt -index 15d50cad..83830cd2 100644 ---- a/src/jpeg.imageio/CMakeLists.txt -+++ b/src/jpeg.imageio/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (jpeginput.cpp jpegoutput.cpp -- INCLUDE_DIRS ${JPEG_INCLUDE_DIRS} -- LINK_LIBRARIES ${JPEG_LIBRARIES}) -+ # INCLUDE_DIRS ${JPEG_INCLUDE_DIRS} -+ LINK_LIBRARIES JPEG::JPEG) -diff --git a/src/jpeg2000.imageio/CMakeLists.txt b/src/jpeg2000.imageio/CMakeLists.txt -index 575ed0b7..5644bcf3 100644 ---- a/src/jpeg2000.imageio/CMakeLists.txt -+++ b/src/jpeg2000.imageio/CMakeLists.txt -@@ -2,10 +2,10 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (OPENJPEG_FOUND) -+if (OpenJPEG_FOUND) - add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp -- INCLUDE_DIRS ${OPENJPEG_INCLUDES} -- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} -+ # INCLUDE_DIRS ${OPENJPEG_INCLUDES} -+ LINK_LIBRARIES OpenJPEG::OpenJPEG - DEFINITIONS "-DUSE_OPENJPEG") - else() - message (WARNING "Jpeg-2000 plugin will not be built") -diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.txt -index 29923b60..77035aa7 100644 ---- a/src/libOpenImageIO/CMakeLists.txt -+++ b/src/libOpenImageIO/CMakeLists.txt -@@ -136,37 +136,42 @@ endif () - target_link_libraries (OpenImageIO - PUBLIC - # For OpenEXR/Imath 3.x: -- $<$:Imath::Imath> -- $<$:Imath::Half> -+ # $<$:Imath::Imath> -+ # $<$:Imath::Half> - # For OpenEXR >= 2.4/2.5 with reliable exported targets -- $<$:IlmBase::Imath> -- $<$:IlmBase::Half> -+ # $<$:IlmBase::Imath> -+ # $<$:IlmBase::Half> - # For OpenEXR <= 2.3: -- ${ILMBASE_LIBRARIES} -+ OpenEXR::OpenEXR - ${GCC_ATOMIC_LIBRARIES} - PRIVATE - # For OpenEXR/Imath 3.x: -- $<$:OpenEXR::OpenEXR> -+ # $<$:OpenEXR::OpenEXR> - # For OpenEXR >= 2.4/2.5 with reliable exported targets -- $<$:OpenEXR::IlmImf> -- $<$:IlmBase::IlmThread> -- $<$:IlmBase::Iex> -+ # $<$:OpenEXR::IlmImf> -+ # $<$:IlmBase::IlmThread> -+ # $<$:IlmBase::Iex> - # For OpenEXR <= 2.3: -- ${OPENEXR_LIBRARIES} -- ${OpenCV_LIBRARIES} -+ # ${OPENEXR_LIBRARIES} -+ # ${OpenCV_LIBRARIES} - ${SANITIZE_LIBRARIES} - ${format_plugin_libs} # Add all the target link libraries from the plugins -+ tsl::robin_map - $<$:OpenColorIO::OpenColorIO> -- $<$:OpenColorIO::OpenColorIOHeaders> -+ # $<$:OpenColorIO::OpenColorIOHeaders> - $<$:pugixml::pugixml> -- ${BZIP2_LIBRARIES} -+ # ${BZIP2_LIBRARIES} - ZLIB::ZLIB -- ${Boost_LIBRARIES} -+ Boost::filesystem Boost::thread Boost::system Boost::container - ${CMAKE_DL_LIBS} - ) - --if (FREETYPE_FOUND) -- target_link_libraries (OpenImageIO PRIVATE ${FREETYPE_LIBRARIES}) -+if (OpenCV_FOUND) -+ target_link_libraries (OpenImageIO PUBLIC opencv::opencv_core opencv::opencv_imgproc opencv::opencv_videoio) -+endif () -+ -+if (Freetype_FOUND) -+ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) - endif() - - if (WIN32) -diff --git a/src/libutil/CMakeLists.txt b/src/libutil/CMakeLists.txt -index 25d76e5c..c1950e81 100644 ---- a/src/libutil/CMakeLists.txt -+++ b/src/libutil/CMakeLists.txt -@@ -14,19 +14,19 @@ target_include_directories (OpenImageIO_Util - target_link_libraries (OpenImageIO_Util - PUBLIC - # For OpenEXR/Imath 3.x: -- $<$:Imath::Imath> -- $<$:Imath::Half> -+ # $<$:Imath::Imath> -+ # $<$:Imath::Half> - # For OpenEXR >= 2.4/2.5 with reliable exported targets -- $<$:IlmBase::Imath> -- $<$:IlmBase::Half> -- $<$:IlmBase::IlmThread> -- $<$:IlmBase::Iex> -+ # $<$:IlmBase::Imath> -+ # $<$:IlmBase::Half> -+ # $<$:IlmBase::IlmThread> -+ # $<$:IlmBase::Iex> - # For OpenEXR <= 2.3: -- ${ILMBASE_LIBRARIES} -+ OpenEXR::OpenEXR - ${GCC_ATOMIC_LIBRARIES} - PRIVATE - ${SANITIZE_LIBRARIES} -- ${Boost_LIBRARIES} -+ Boost::filesystem Boost::thread Boost::system Boost::regex - ${CMAKE_DL_LIBS} - ) - -diff --git a/src/oiiotool/CMakeLists.txt b/src/oiiotool/CMakeLists.txt -index e281d3f8..0fb1b425 100644 ---- a/src/oiiotool/CMakeLists.txt -+++ b/src/oiiotool/CMakeLists.txt -@@ -4,8 +4,8 @@ - - fancy_add_executable (LINK_LIBRARIES - OpenImageIO -- ${Boost_LIBRARIES} # because regex -- $<$:OpenEXR::OpenEXR> -- $<$:OpenEXR::IlmImf> -- ${OPENEXR_LIBRARIES} -+ Boost::regex # because regex -+ # $<$:OpenEXR::OpenEXR> -+ # $<$:OpenEXR::IlmImf> -+ OpenEXR::OpenEXR - ) -diff --git a/src/openexr.imageio/CMakeLists.txt b/src/openexr.imageio/CMakeLists.txt -index 30758836..1a4d2077 100644 ---- a/src/openexr.imageio/CMakeLists.txt -+++ b/src/openexr.imageio/CMakeLists.txt -@@ -3,6 +3,6 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (exrinput.cpp exroutput.cpp -- INCLUDE_DIRS ${OPENEXR_INCLUDES} ${IMATH_INCLUDE_DIR}/OpenEXR -- LINK_LIBRARIES ${OPENEXR_LIBRARIES}) -+ # INCLUDE_DIRS ${OPENEXR_INCLUDES} ${IMATH_INCLUDE_DIR}/OpenEXR -+ LINK_LIBRARIES OpenEXR::OpenEXR) - -diff --git a/src/openvdb.imageio/CMakeLists.txt b/src/openvdb.imageio/CMakeLists.txt -index 57a0f625..34866390 100644 ---- a/src/openvdb.imageio/CMakeLists.txt -+++ b/src/openvdb.imageio/CMakeLists.txt -@@ -2,8 +2,8 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (OpenVDB_FOUND) -+if (OpenVDB_FOUND AND TBB_FOUND) - add_oiio_plugin (openvdbinput.cpp -- INCLUDE_DIRS ${TBB_INCLUDE_DIRS} -- LINK_LIBRARIES OpenVDB::OpenVDB ${TBB_tbb_LIBRARY} ${BOOST_LIBRARIES}) -+ # INCLUDE_DIRS ${TBB_INCLUDE_DIRS} -+ LINK_LIBRARIES OpenVDB::OpenVDB TBB::TBB) - endif() -diff --git a/src/psd.imageio/CMakeLists.txt b/src/psd.imageio/CMakeLists.txt -index 48bf24fb..7e1d9257 100644 ---- a/src/psd.imageio/CMakeLists.txt -+++ b/src/psd.imageio/CMakeLists.txt -@@ -3,6 +3,6 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (psdinput.cpp jpeg_memory_src.cpp -- INCLUDE_DIRS ${JPEG_INCLUDE_DIR} -- LINK_LIBRARIES ${JPEG_LIBRARIES}) -+ # INCLUDE_DIRS ${JPEG_INCLUDE_DIR} -+ LINK_LIBRARIES JPEG::JPEG) - -diff --git a/src/ptex.imageio/CMakeLists.txt b/src/ptex.imageio/CMakeLists.txt -index 2f47527a..1c3c9800 100644 ---- a/src/ptex.imageio/CMakeLists.txt -+++ b/src/ptex.imageio/CMakeLists.txt -@@ -2,8 +2,8 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (Ptex_FOUND) -+if (PTex_FOUND) - add_oiio_plugin (ptexinput.cpp -- LINK_LIBRARIES Ptex::Ptex_dynamic ZLIB::ZLIB -+ LINK_LIBRARIES PTex::PTex ZLIB::ZLIB - DEFINITIONS "-DUSE_PTEX") - endif () -diff --git a/src/raw.imageio/CMakeLists.txt b/src/raw.imageio/CMakeLists.txt -index d235fd9d..ae229e31 100644 ---- a/src/raw.imageio/CMakeLists.txt -+++ b/src/raw.imageio/CMakeLists.txt -@@ -2,11 +2,11 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (LIBRAW_FOUND) -+if (libraw_FOUND) - add_oiio_plugin (rawinput.cpp -- INCLUDE_DIRS ${LibRaw_INCLUDE_DIR} -- LINK_LIBRARIES ${LibRaw_r_LIBRARIES} -- DEFINITIONS "-DUSE_LIBRAW=1" ${LibRaw_r_DEFINITIONS}) -+ # INCLUDE_DIRS ${LibRaw_INCLUDE_DIR} -+ LINK_LIBRARIES libraw::libraw -+ DEFINITIONS "-DUSE_LIBRAW=1") - else () - message (WARNING "Raw plugin will not be built") - endif () -diff --git a/src/tiff.imageio/CMakeLists.txt b/src/tiff.imageio/CMakeLists.txt -index ab94d56d..05820e8f 100644 ---- a/src/tiff.imageio/CMakeLists.txt -+++ b/src/tiff.imageio/CMakeLists.txt -@@ -3,6 +3,6 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (tiffinput.cpp tiffoutput.cpp -- INCLUDE_DIRS ${TIFF_INCLUDE_DIR} -- LINK_LIBRARIES ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} -+ # INCLUDE_DIRS ${TIFF_INCLUDE_DIR} -+ LINK_LIBRARIES TIFF::TIFF JPEG::JPEG - ZLIB::ZLIB) -diff --git a/src/webp.imageio/CMakeLists.txt b/src/webp.imageio/CMakeLists.txt -index 44462c49..78fe1a58 100644 ---- a/src/webp.imageio/CMakeLists.txt -+++ b/src/webp.imageio/CMakeLists.txt -@@ -4,7 +4,7 @@ - - if (WebP_FOUND) - add_oiio_plugin (webpinput.cpp webpoutput.cpp -- LINK_LIBRARIES WebP::WebP WebP::WebPDemux -+ LINK_LIBRARIES WebP::WebP - DEFINITIONS "-DUSE_WEBP=1") - else () - message (STATUS "WebP plugin will not be built") diff --git a/recipes/openimageio/all/patches/2.2.7.0-cmake-targets.patch b/recipes/openimageio/all/patches/2.2.7.0-cmake-targets.patch deleted file mode 100644 index 7e2a6e4da94b3..0000000000000 --- a/recipes/openimageio/all/patches/2.2.7.0-cmake-targets.patch +++ /dev/null @@ -1,673 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 447c6170..702fb50b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -99,7 +99,7 @@ message(STATUS "Setting Namespace to: ${PROJ_NAMESPACE_V}") - - - list (APPEND CMAKE_MODULE_PATH -- "${PROJECT_SOURCE_DIR}/src/cmake/modules" -+ # "${PROJECT_SOURCE_DIR}/src/cmake/modules" - "${PROJECT_SOURCE_DIR}/src/cmake") - - include (GNUInstallDirs) -@@ -172,7 +172,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) - add_subdirectory (src/iinfo) - add_subdirectory (src/maketx) - add_subdirectory (src/oiiotool) -- add_subdirectory (src/testtex) -+ #add_subdirectory (src/testtex) - add_subdirectory (src/iv) - endif () - -diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake -index 12a8e819..46c1d0f8 100644 ---- a/src/cmake/compiler.cmake -+++ b/src/cmake/compiler.cmake -@@ -88,7 +88,7 @@ if (NOT MSVC) - add_compile_options ("-Wextra") - endif () - if (STOP_ON_WARNING OR DEFINED ENV{CI}) -- add_compile_options ("-Werror") -+ # add_compile_options ("-Werror") - # N.B. Force CI builds (Travis defines $CI) to use -Werror, even if - # STOP_ON_WARNING has been switched off by default, which we may do - # in release branches. -diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake -index 03d521dc..9fe73388 100644 ---- a/src/cmake/externalpackages.cmake -+++ b/src/cmake/externalpackages.cmake -@@ -39,7 +39,7 @@ if (LINKSTATIC) - endif () - else () - if (MSVC) -- add_definitions (-DBOOST_ALL_DYN_LINK=1) -+ # add_definitions (-DBOOST_ALL_DYN_LINK=1) - endif () - endif () - if (BOOST_CUSTOM) -@@ -89,23 +89,27 @@ checked_find_package (OpenEXR 2.0 REQUIRED - RECOMMEND_MIN 2.2 - RECOMMEND_MIN_REASON "for DWA compression") - # We use Imath so commonly, may as well include it everywhere. --include_directories ("${OPENEXR_INCLUDES}" "${ILMBASE_INCLUDES}" -- "${ILMBASE_INCLUDES}/OpenEXR") --if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3) -+# include_directories ("${OPENEXR_INCLUDES}" "${ILMBASE_INCLUDES}" -+# "${ILMBASE_INCLUDES}/OpenEXR") -+if (CMAKE_COMPILER_IS_CLANG AND OpenEXR_VERSION VERSION_LESS 2.3) - # clang C++ >= 11 doesn't like 'register' keyword in old exr headers - add_compile_options (-Wno-deprecated-register) - endif () - if (MSVC AND NOT LINKSTATIC) -- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? -+ # add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? - endif () - - - # JPEG -- prefer Turbo-JPEG to regular libjpeg --checked_find_package (JPEGTurbo -+if (USE_JPEGTURBO) -+ checked_find_package (libjpeg-turbo REQUIRED - DEFINITIONS -DUSE_JPEG_TURBO=1 -- PRINT JPEG_INCLUDES JPEG_LIBRARIES) --if (NOT JPEG_FOUND) # Try to find the non-turbo version -+ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) -+ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) -+elseif (USE_JPEG) # Try to find the non-turbo version - checked_find_package (JPEG REQUIRED) -+else () -+ message(FATAL_ERROR "JPEG library was not found!") - endif () - - # Pugixml setup. Normally we just use the version bundled with oiio, but -@@ -123,56 +127,93 @@ endif() - # Dependencies for optional formats and features. If these are not found, - # we will continue building, but the related functionality will be disabled. - --checked_find_package (PNG) -- --checked_find_package (BZip2) # Used by ffmpeg and freetype --if (NOT BZIP2_FOUND) -- set (BZIP2_LIBRARIES "") # TODO: why does it break without this? -+if (USE_LIBPNG) -+ checked_find_package (PNG REQUIRED) - endif () - --checked_find_package (Freetype -+# checked_find_package (BZip2) # Used by ffmpeg and freetype -+# if (NOT BZIP2_FOUND) -+# set (BZIP2_LIBRARIES "") # TODO: why does it break without this? -+# endif () -+ -+if (USE_FREETYPE) -+ checked_find_package (Freetype REQUIRED - DEFINITIONS -DUSE_FREETYPE=1 ) -+endif () - --checked_find_package (HDF5 -+if (USE_HDF5) -+ checked_find_package (HDF5 REQUIRED - ISDEPOF Field3D) --checked_find_package (OpenColorIO -+endif () -+if (USE_OPENCOLORIO) -+ checked_find_package (OpenColorIO REQUIRED - DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1) --checked_find_package (OpenCV -+endif () -+if (USE_OPENCV) -+ checked_find_package (OpenCV REQUIRED - DEFINITIONS -DUSE_OPENCV=1) -+endif () - - # Intel TBB - set (TBB_USE_DEBUG_BUILD OFF) --checked_find_package (TBB 2017 -+if (USE_TBB) -+ checked_find_package (TBB 2017 REQUIRED - DEFINITIONS -DUSE_TBB=1 - ISDEPOF OpenVDB) -+endif () - --checked_find_package (DCMTK 3.6.1) # For DICOM images --checked_find_package (FFmpeg 2.6) --checked_find_package (Field3D -+if (USE_DCMTK) -+ checked_find_package (DCMTK 3.6.1 REQUIRED) # For DICOM images -+endif () -+if (USE_FFMPEG) -+ checked_find_package (ffmpeg 2.6 REQUIRED) -+endif () -+if (USE_FIELD3D) -+ checked_find_package (Field3D REQUIRED - DEPS HDF5 - DEFINITIONS -DUSE_FIELD3D=1) --checked_find_package (GIF 4 -+endif () -+if (USE_GIF) -+ checked_find_package (GIF 4 REQUIRED - RECOMMEND_MIN 5.0 - RECOMMEND_MIN_REASON "for stability and thread safety") --checked_find_package (Libheif 1.3) # For HEIF/HEIC format --checked_find_package (LibRaw -- PRINT LibRaw_r_LIBRARIES -+endif () -+if (USE_LIBHEIF) -+ checked_find_package (libheif 1.3 REQUIRED) # For HEIF/HEIC format -+endif () -+if (USE_LIBRAW) -+ checked_find_package (libraw REQUIRED - RECOMMEND_MIN 0.18 - RECOMMEND_MIN_REASON "for ACES support") --checked_find_package (OpenJpeg 2.0) --checked_find_package (OpenVDB 5.0 -+endif () -+if (USE_OPENJPEG) -+ checked_find_package (OpenJPEG 2.0 REQUIRED) -+endif () -+if (USE_OPENVDB) -+ checked_find_package (OpenVDB 5.0 REQUIRED - DEPS TBB - DEFINITIONS -DUSE_OPENVDB=1) --checked_find_package (PTex) --checked_find_package (Webp) -+endif () -+if (USE_PTEX) -+ checked_find_package (ptex REQUIRED) -+endif () -+if (USE_LIBWEBP) -+ checked_find_package (WebP REQUIRED) -+endif () - - option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) --checked_find_package (R3DSDK) # RED camera -+if (USE_R3DSDK) -+ checked_find_package (R3DSDK REQUIRED) # RED camera -+endif () - - set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") --checked_find_package (Nuke) -+if (USE_NUKE) -+ checked_find_package (Nuke REQUIRED) -+endif () - --checked_find_package (OpenGL) # used for iv -+if (USE_OPENGL) -+ checked_find_package (OpenGL REQUIRED) # used for iv -+endif () - - # Qt -- used for iv - set (qt5_modules Core Gui Widgets) -@@ -180,7 +221,9 @@ if (OPENGL_FOUND) - list (APPEND qt5_modules OpenGL) - endif () - option (USE_QT "Use Qt if found" ON) --checked_find_package (Qt5 COMPONENTS ${qt5_modules}) -+if (USE_QT) -+ checked_find_package (Qt5 REQUIRED COMPONENTS ${qt5_modules}) -+endif () - if (USE_QT AND NOT Qt5_FOUND AND APPLE) - message (STATUS " If you think you installed qt5 with Homebrew and it still doesn't work,") - message (STATUS " try: export PATH=/usr/local/opt/qt5/bin:$PATH") -@@ -201,13 +244,13 @@ macro (find_or_download_robin_map) - # for an installed version. Still prefer a copy that seems to be - # locally installed in this tree. - if (NOT BUILD_ROBINMAP_FORCE) -- find_package (Robinmap QUIET) -+ find_package (tsl-robin-map REQUIRED) - endif () - # If an external copy wasn't found and we requested that missing - # packages be built, or we we are forcing a local copy to be built, then - # download and build it. - # Download the headers from github -- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) -+ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) - message (STATUS "Downloading local Tessil/robin-map") - set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") - set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") -@@ -225,7 +268,7 @@ macro (find_or_download_robin_map) - endif () - set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") - endif () -- checked_find_package (Robinmap REQUIRED) -+ checked_find_package (tsl-robin-map REQUIRED) - endmacro() - - -@@ -235,7 +278,7 @@ endmacro() - option (USE_EMBEDDED_LIBSQUISH - "Force use of embedded Libsquish, even if external is found" OFF) - if (NOT USE_EMBEDDED_LIBSQUISH) -- checked_find_package (Libsquish) -+ checked_find_package (libsquish REQUIRED) - endif () - - -@@ -251,12 +294,12 @@ macro (find_or_download_fmt) - # for an installed version. Still prefer a copy that seems to be - # locally installed in this tree. - if (NOT BUILD_FMT_FORCE) -- find_package (fmt QUIET) -+ find_package (fmt REQUIRED) - endif () - # If an external copy wasn't found and we requested that missing - # packages be built, or we we are forcing a local copy to be built, then - # download and build it. -- if ((BUILD_MISSING_FMT AND NOT FMT_FOUND) OR BUILD_FMT_FORCE) -+ if ((BUILD_MISSING_FMT AND NOT fmt_FOUND) OR BUILD_FMT_FORCE) - message (STATUS "Downloading local fmtlib/fmt") - set (FMT_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/fmt") - set (FMT_GIT_REPOSITORY "https://github.com/fmtlib/fmt") -diff --git a/src/dds.imageio/CMakeLists.txt b/src/dds.imageio/CMakeLists.txt -index d693453a..7ff6e9ce 100644 ---- a/src/dds.imageio/CMakeLists.txt -+++ b/src/dds.imageio/CMakeLists.txt -@@ -2,10 +2,10 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (Libsquish_FOUND) -+if (libsquish_FOUND) - # External libsquish was found -- use it - add_oiio_plugin (ddsinput.cpp -- LINK_LIBRARIES Libsquish::Libsquish -+ LINK_LIBRARIES libsquish::libsquish - ) - else () - # No external libsquish was found -- use the embedded version. -diff --git a/src/dicom.imageio/CMakeLists.txt b/src/dicom.imageio/CMakeLists.txt -index ddd72044..3603eaa3 100644 ---- a/src/dicom.imageio/CMakeLists.txt -+++ b/src/dicom.imageio/CMakeLists.txt -@@ -4,8 +4,8 @@ - - if (DCMTK_FOUND) - add_oiio_plugin (dicominput.cpp -- INCLUDE_DIRS ${DCMTK_INCLUDE_DIR} -- LINK_LIBRARIES ${DCMTK_LIBRARIES} -+ # INCLUDE_DIRS ${DCMTK_INCLUDE_DIR} -+ LINK_LIBRARIES DCMTK::DCMTK - DEFINITIONS "-DUSE_DCMTK=1") - else () - message (WARNING "DICOM plugin will not be built, no DCMTK") -diff --git a/src/dpx.imageio/CMakeLists.txt b/src/dpx.imageio/CMakeLists.txt -index 858beb9d..dd169af4 100644 ---- a/src/dpx.imageio/CMakeLists.txt -+++ b/src/dpx.imageio/CMakeLists.txt -@@ -6,4 +6,4 @@ add_oiio_plugin (dpxinput.cpp dpxoutput.cpp - libdpx/DPX.cpp libdpx/OutStream.cpp libdpx/RunLengthEncoding.cpp - libdpx/Codec.cpp libdpx/Reader.cpp libdpx/Writer.cpp libdpx/DPXHeader.cpp - libdpx/ElementReadStream.cpp libdpx/InStream.cpp libdpx/DPXColorConverter.cpp -- LINK_LIBRARIES ${OPENEXR_LIBRARIES}) -+ LINK_LIBRARIES OpenEXR::OpenEXR) -diff --git a/src/ffmpeg.imageio/CMakeLists.txt b/src/ffmpeg.imageio/CMakeLists.txt -index 6cf07636..d3bb5f61 100644 ---- a/src/ffmpeg.imageio/CMakeLists.txt -+++ b/src/ffmpeg.imageio/CMakeLists.txt -@@ -11,11 +11,11 @@ if (NOT MSVC) - PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations") - endif() - --if (FFmpeg_FOUND) -+if (ffmpeg_FOUND) - add_oiio_plugin (ffmpeginput.cpp -- INCLUDE_DIRS ${FFMPEG_INCLUDES} -- LINK_LIBRARIES ${FFMPEG_LIBRARIES} -- ${BZIP2_LIBRARIES} -+ # INCLUDE_DIRS ${FFMPEG_INCLUDES} -+ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale -+ # ${BZIP2_LIBRARIES} - DEFINITIONS "-DUSE_FFMPEG") - else() - message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") -diff --git a/src/gif.imageio/CMakeLists.txt b/src/gif.imageio/CMakeLists.txt -index c9e7392c..eda8b482 100644 ---- a/src/gif.imageio/CMakeLists.txt -+++ b/src/gif.imageio/CMakeLists.txt -@@ -4,8 +4,8 @@ - - if (GIF_FOUND) - add_oiio_plugin (gifinput.cpp gifoutput.cpp -- INCLUDE_DIRS ${GIF_INCLUDE_DIRS} -- LINK_LIBRARIES ${GIF_LIBRARIES} -+ # INCLUDE_DIRS ${GIF_INCLUDE_DIRS} -+ LINK_LIBRARIES GIF::GIF - DEFINITIONS "-DUSE_GIF") - else() - message (WARNING "GIF plugin will not be built") -diff --git a/src/heif.imageio/CMakeLists.txt b/src/heif.imageio/CMakeLists.txt -index fed80015..2593f585 100644 ---- a/src/heif.imageio/CMakeLists.txt -+++ b/src/heif.imageio/CMakeLists.txt -@@ -2,9 +2,9 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (Libheif_FOUND) -+if (libheif_FOUND) - add_oiio_plugin (heifinput.cpp heifoutput.cpp -- LINK_LIBRARIES Libheif::Libheif -+ LINK_LIBRARIES libheif::libheif - DEFINITIONS "-DUSE_HEIF=1") - else () - message (WARNING "heif plugin will not be built") -diff --git a/src/ico.imageio/CMakeLists.txt b/src/ico.imageio/CMakeLists.txt -index 5a46174d..a8919f63 100644 ---- a/src/ico.imageio/CMakeLists.txt -+++ b/src/ico.imageio/CMakeLists.txt -@@ -4,8 +4,8 @@ - - if (PNG_FOUND) - add_oiio_plugin (icoinput.cpp icooutput.cpp -- INCLUDE_DIRS ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} -- LINK_LIBRARIES ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) -+ # INCLUDE_DIRS ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} -+ LINK_LIBRARIES PNG::PNG ZLIB::ZLIB) - else () - message (WARNING "libpng not found, so ICO support will not work") - set (format_plugin_definitions ${format_plugin_definitions} DISABLE_ICO=1 PARENT_SCOPE) -diff --git a/src/igrep/CMakeLists.txt b/src/igrep/CMakeLists.txt -index 3fde566a..adaac8bd 100644 ---- a/src/igrep/CMakeLists.txt -+++ b/src/igrep/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - fancy_add_executable (LINK_LIBRARIES OpenImageIO -- ${Boost_LIBRARIES} # because regex -+ Boost::regex # because regex - ) -diff --git a/src/iinfo/CMakeLists.txt b/src/iinfo/CMakeLists.txt -index 3fde566a..adaac8bd 100644 ---- a/src/iinfo/CMakeLists.txt -+++ b/src/iinfo/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - fancy_add_executable (LINK_LIBRARIES OpenImageIO -- ${Boost_LIBRARIES} # because regex -+ Boost::regex # because regex - ) -diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt -index a60b3b21..050911c8 100644 ---- a/src/include/CMakeLists.txt -+++ b/src/include/CMakeLists.txt -@@ -44,17 +44,20 @@ install (FILES ${public_headers} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} - COMPONENT developer) - -+set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") - set (fmt_headers - ${FMT_INCLUDES}/fmt/core.h - ${FMT_INCLUDES}/fmt/format-inl.h - ${FMT_INCLUDES}/fmt/format.h - ${FMT_INCLUDES}/fmt/ostream.h - ${FMT_INCLUDES}/fmt/printf.h ) -+if (0) - file (COPY ${fmt_headers} - DESTINATION ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt) - install (FILES ${fmt_headers} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail/fmt - COMPONENT developer) -+endif () - - if (NOT USE_EXTERNAL_PUGIXML) - set (pugixml_headers -diff --git a/src/include/OpenImageIO/strutil.h b/src/include/OpenImageIO/strutil.h -index db356f03..003df7f8 100644 ---- a/src/include/OpenImageIO/strutil.h -+++ b/src/include/OpenImageIO/strutil.h -@@ -39,9 +39,9 @@ - #ifndef FMT_USE_GRISU - # define FMT_USE_GRISU 1 - #endif --#include "detail/fmt/ostream.h" --#include "detail/fmt/format.h" --#include "detail/fmt/printf.h" -+#include -+#include -+#include - #if OIIO_GNUC_VERSION >= 70000 - # pragma GCC diagnostic pop - #endif -diff --git a/src/jpeg.imageio/CMakeLists.txt b/src/jpeg.imageio/CMakeLists.txt -index 548faeb7..95e4feb5 100644 ---- a/src/jpeg.imageio/CMakeLists.txt -+++ b/src/jpeg.imageio/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (jpeginput.cpp jpegoutput.cpp -- INCLUDE_DIRS ${JPEG_INCLUDE_DIR} -- LINK_LIBRARIES ${JPEG_LIBRARIES}) -+ # INCLUDE_DIRS ${JPEG_INCLUDE_DIR} -+ LINK_LIBRARIES JPEG::JPEG) -diff --git a/src/jpeg2000.imageio/CMakeLists.txt b/src/jpeg2000.imageio/CMakeLists.txt -index 575ed0b7..5644bcf3 100644 ---- a/src/jpeg2000.imageio/CMakeLists.txt -+++ b/src/jpeg2000.imageio/CMakeLists.txt -@@ -2,10 +2,10 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (OPENJPEG_FOUND) -+if (OpenJPEG_FOUND) - add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp -- INCLUDE_DIRS ${OPENJPEG_INCLUDES} -- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} -+ # INCLUDE_DIRS ${OPENJPEG_INCLUDES} -+ LINK_LIBRARIES OpenJPEG::OpenJPEG - DEFINITIONS "-DUSE_OPENJPEG") - else() - message (WARNING "Jpeg-2000 plugin will not be built") -diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.txt -index fe39cdd4..b877cc4d 100644 ---- a/src/libOpenImageIO/CMakeLists.txt -+++ b/src/libOpenImageIO/CMakeLists.txt -@@ -135,31 +135,33 @@ endif () - - target_link_libraries (OpenImageIO - PUBLIC -- ${ILMBASE_LIBRARIES} -- ${OPENEXR_LIBRARIES} -- ${OpenCV_LIBRARIES} -+ OpenEXR::OpenEXR -+ $<$:OpenColorIO::OpenColorIO> - ${GCC_ATOMIC_LIBRARIES} - PRIVATE - ${SANITIZE_LIBRARIES} - ${format_plugin_libs} # Add all the target link libraries from the plugins -- $<$:OpenColorIO::OpenColorIO> -- ${BZIP2_LIBRARIES} -- ${ZLIB_LIBRARIES} -- ${Boost_LIBRARIES} -+ tsl::robin_map -+ ZLIB::ZLIB -+ Boost::Boost - ${CMAKE_DL_LIBS} - ) - -+if (OpenCV_FOUND) -+ target_link_libraries (OpenImageIO PUBLIC opencv::opencv_core opencv::opencv_imgproc opencv::opencv_videoio) -+endif () -+ - if (USE_EXTERNAL_PUGIXML) -- if(TARGET pugixml) -- target_link_libraries (OpenImageIO PRIVATE pugixml) -+ if(pugixml_FOUND) -+ target_link_libraries (OpenImageIO PRIVATE pugixml::pugixml) - else() - target_include_directories (OpenImageIO PRIVATE ${PUGIXML_INCLUDES}) - target_link_libraries (OpenImageIO PRIVATE ${PUGIXML_LIBRARIES}) - endif() - endif() - --if (FREETYPE_FOUND) -- target_link_libraries (OpenImageIO PRIVATE ${FREETYPE_LIBRARIES}) -+if (Freetype_FOUND) -+ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) - endif() - - if (WIN32) -diff --git a/src/libutil/CMakeLists.txt b/src/libutil/CMakeLists.txt -index 083b077c..4cdd4e6b 100644 ---- a/src/libutil/CMakeLists.txt -+++ b/src/libutil/CMakeLists.txt -@@ -13,11 +13,11 @@ target_include_directories (OpenImageIO_Util - ) - target_link_libraries (OpenImageIO_Util - PUBLIC -- ${ILMBASE_LIBRARIES} -+ OpenEXR::OpenEXR - ${GCC_ATOMIC_LIBRARIES} - PRIVATE - ${SANITIZE_LIBRARIES} -- ${Boost_LIBRARIES} -+ Boost::Boost - ${CMAKE_DL_LIBS} - ) - -diff --git a/src/oiiotool/CMakeLists.txt b/src/oiiotool/CMakeLists.txt -index 3fde566a..adaac8bd 100644 ---- a/src/oiiotool/CMakeLists.txt -+++ b/src/oiiotool/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - fancy_add_executable (LINK_LIBRARIES OpenImageIO -- ${Boost_LIBRARIES} # because regex -+ Boost::regex # because regex - ) -diff --git a/src/openexr.imageio/CMakeLists.txt b/src/openexr.imageio/CMakeLists.txt -index 3226eb13..bf8e0358 100644 ---- a/src/openexr.imageio/CMakeLists.txt -+++ b/src/openexr.imageio/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (exrinput.cpp exroutput.cpp -- LINK_LIBRARIES ${OPENEXR_LIBRARIES}) -+ LINK_LIBRARIES OpenEXR::OpenEXR) - -diff --git a/src/openvdb.imageio/CMakeLists.txt b/src/openvdb.imageio/CMakeLists.txt -index 57a0f625..61dc2459 100644 ---- a/src/openvdb.imageio/CMakeLists.txt -+++ b/src/openvdb.imageio/CMakeLists.txt -@@ -2,8 +2,8 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (OpenVDB_FOUND) -+if (OpenVDB_FOUND AND TBB_FOUND) - add_oiio_plugin (openvdbinput.cpp -- INCLUDE_DIRS ${TBB_INCLUDE_DIRS} -- LINK_LIBRARIES OpenVDB::OpenVDB ${TBB_tbb_LIBRARY} ${BOOST_LIBRARIES}) -+ # INCLUDE_DIRS ${TBB_INCLUDE_DIRS} -+ LINK_LIBRARIES OpenVDB::OpenVDB TBB::TBB Boost::Boost) - endif() -diff --git a/src/png.imageio/CMakeLists.txt b/src/png.imageio/CMakeLists.txt -index be2724f2..ac16da21 100644 ---- a/src/png.imageio/CMakeLists.txt -+++ b/src/png.imageio/CMakeLists.txt -@@ -4,8 +4,8 @@ - - if (PNG_FOUND) - add_oiio_plugin (pnginput.cpp pngoutput.cpp -- INCLUDE_DIRS ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} -- LINK_LIBRARIES ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) -+ # INCLUDE_DIRS ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} -+ LINK_LIBRARIES PNG::PNG ZLIB::ZLIB) - else () - message (WARNING "libpng not found, so PNG support will not work") - set (format_plugin_definitions ${format_plugin_definitions} DISABLE_PNG=1 PARENT_SCOPE) -diff --git a/src/psd.imageio/CMakeLists.txt b/src/psd.imageio/CMakeLists.txt -index 48bf24fb..7e1d9257 100644 ---- a/src/psd.imageio/CMakeLists.txt -+++ b/src/psd.imageio/CMakeLists.txt -@@ -3,6 +3,6 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (psdinput.cpp jpeg_memory_src.cpp -- INCLUDE_DIRS ${JPEG_INCLUDE_DIR} -- LINK_LIBRARIES ${JPEG_LIBRARIES}) -+ # INCLUDE_DIRS ${JPEG_INCLUDE_DIR} -+ LINK_LIBRARIES JPEG::JPEG) - -diff --git a/src/ptex.imageio/CMakeLists.txt b/src/ptex.imageio/CMakeLists.txt -index 912081b1..6039fc58 100644 ---- a/src/ptex.imageio/CMakeLists.txt -+++ b/src/ptex.imageio/CMakeLists.txt -@@ -2,9 +2,9 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (PTEX_FOUND) -+if (PTex_FOUND) - add_oiio_plugin (ptexinput.cpp -- INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${PTEX_INCLUDE_DIR} -- LINK_LIBRARIES ${PTEX_LIBRARIES} ${ZLIB_LIBRARIES} -+ # INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${PTEX_INCLUDE_DIR} -+ LINK_LIBRARIES PTex::PTex ZLIB::ZLIB - DEFINITIONS "-DUSE_PTEX") - endif () -diff --git a/src/raw.imageio/CMakeLists.txt b/src/raw.imageio/CMakeLists.txt -index 81a0ff54..ae229e31 100644 ---- a/src/raw.imageio/CMakeLists.txt -+++ b/src/raw.imageio/CMakeLists.txt -@@ -2,10 +2,10 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (LIBRAW_FOUND) -+if (libraw_FOUND) - add_oiio_plugin (rawinput.cpp -- INCLUDE_DIRS ${LibRaw_INCLUDE_DIR} -- LINK_LIBRARIES ${LibRaw_r_LIBRARIES} -+ # INCLUDE_DIRS ${LibRaw_INCLUDE_DIR} -+ LINK_LIBRARIES libraw::libraw - DEFINITIONS "-DUSE_LIBRAW=1") - else () - message (WARNING "Raw plugin will not be built") -diff --git a/src/tiff.imageio/CMakeLists.txt b/src/tiff.imageio/CMakeLists.txt -index f6d648c8..385607c9 100644 ---- a/src/tiff.imageio/CMakeLists.txt -+++ b/src/tiff.imageio/CMakeLists.txt -@@ -3,6 +3,6 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (tiffinput.cpp tiffoutput.cpp -- INCLUDE_DIRS ${TIFF_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS} -- LINK_LIBRARIES ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} -- ${ZLIB_LIBRARIES}) -+ # INCLUDE_DIRS ${TIFF_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS} -+ LINK_LIBRARIES TIFF::TIFF JPEG::JPEG -+ ZLIB::ZLIB) -diff --git a/src/webp.imageio/CMakeLists.txt b/src/webp.imageio/CMakeLists.txt -index 9e01bd7f..78fe1a58 100644 ---- a/src/webp.imageio/CMakeLists.txt -+++ b/src/webp.imageio/CMakeLists.txt -@@ -2,9 +2,9 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (Webp_FOUND) -+if (WebP_FOUND) - add_oiio_plugin (webpinput.cpp webpoutput.cpp -- LINK_LIBRARIES Webp::Webp -+ LINK_LIBRARIES WebP::WebP - DEFINITIONS "-DUSE_WEBP=1") - else () - message (STATUS "WebP plugin will not be built") -diff --git a/src/zfile.imageio/CMakeLists.txt b/src/zfile.imageio/CMakeLists.txt -index 36a7ad99..c8fd99d3 100644 ---- a/src/zfile.imageio/CMakeLists.txt -+++ b/src/zfile.imageio/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (zfile.cpp -- INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} -- LINK_LIBRARIES ${ZLIB_LIBRARIES}) -+ # INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} -+ LINK_LIBRARIES ZLIB::ZLIB) diff --git a/recipes/openimageio/all/patches/2.3.7.2-cmake-targets.patch b/recipes/openimageio/all/patches/2.3.7.2-cmake-targets.patch deleted file mode 100644 index ba213765c8530..0000000000000 --- a/recipes/openimageio/all/patches/2.3.7.2-cmake-targets.patch +++ /dev/null @@ -1,710 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 54fe7d9c..97a1b8e4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -111,7 +111,7 @@ message(STATUS "Setting Namespace to: ${PROJ_NAMESPACE_V}") - - - list (APPEND CMAKE_MODULE_PATH -- "${PROJECT_SOURCE_DIR}/src/cmake/modules" -+ # "${PROJECT_SOURCE_DIR}/src/cmake/modules" - "${PROJECT_SOURCE_DIR}/src/cmake") - - include (GNUInstallDirs) -@@ -191,7 +191,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) - add_subdirectory (src/iinfo) - add_subdirectory (src/maketx) - add_subdirectory (src/oiiotool) -- add_subdirectory (src/testtex) -+ #add_subdirectory (src/testtex) - add_subdirectory (src/iv) - endif () - -diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake -index 2a513f58..13568140 100644 ---- a/src/cmake/compiler.cmake -+++ b/src/cmake/compiler.cmake -@@ -92,7 +92,7 @@ if (NOT MSVC) - add_compile_options ("-Wextra") - endif () - if (STOP_ON_WARNING OR DEFINED ENV{CI}) -- add_compile_options ("-Werror") -+ #add_compile_options ("-Werror") - # N.B. Force CI builds to use -Werror, even if STOP_ON_WARNING has - # been switched off by default, which we may do in release - # branches. -diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake -index 957abe34..885becbf 100644 ---- a/src/cmake/externalpackages.cmake -+++ b/src/cmake/externalpackages.cmake -@@ -46,7 +46,7 @@ endif () - if (MSVC) - # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: - if (NOT Boost_USE_STATIC_LIBS) -- add_definitions (-DBOOST_ALL_DYN_LINK=1) -+ # add_definitions (-DBOOST_ALL_DYN_LINK=1) - endif () - endif () - -@@ -55,7 +55,7 @@ if (BOOST_CUSTOM) - # N.B. For a custom version, the caller had better set up the variables - # Boost_VERSION, Boost_INCLUDE_DIRS, Boost_LIBRARY_DIRS, Boost_LIBRARIES. - else () -- set (Boost_COMPONENTS filesystem system thread) -+ set (Boost_COMPONENTS filesystem system thread container) - # The FindBoost.cmake interface is broken if it uses boost's installed - # cmake output (e.g. boost 1.70.0, cmake <= 3.14). Specifically it fails - # to set the expected variables printed below. So until that's fixed -@@ -103,16 +103,16 @@ checked_find_package (OpenEXR REQUIRED - # library. This shoudn't be necessary, except for the common case of people - # building against Imath/OpenEXR 3.x when there is still a system-level - # install version of 2.x. --include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) --if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3) -+# include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) -+if (CMAKE_COMPILER_IS_CLANG AND OpenEXR_VERSION VERSION_LESS 2.3) - # clang C++ >= 11 doesn't like 'register' keyword in old exr headers - add_compile_options (-Wno-deprecated-register) - endif () - if (MSVC AND NOT LINKSTATIC) -- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? -+ # add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? - endif () - --if (OPENEXR_VERSION VERSION_GREATER_EQUAL 2.5.99) -+if (OpenEXR_VERSION VERSION_GREATER_EQUAL 2.5.99) - set (OIIO_USING_IMATH 3) - else () - set (OIIO_USING_IMATH 2) -@@ -120,12 +120,15 @@ endif () - - - # JPEG -- prefer Turbo-JPEG to regular libjpeg --checked_find_package (JPEGTurbo -+if (USE_JPEGTURBO) -+ checked_find_package (libjpeg-turbo REQUIRED - DEFINITIONS -DUSE_JPEG_TURBO=1 -- PRINT JPEG_INCLUDES JPEG_INCLUDE_DIRS -- JPEG_LIBRARIES) --if (NOT JPEG_FOUND) # Try to find the non-turbo version -+ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) -+ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) -+elseif (USE_JPEG) # Try to find the non-turbo version - checked_find_package (JPEG REQUIRED) -+else () -+ message(FATAL_ERROR "JPEG library was not found!") - endif () - - # Pugixml setup. Normally we just use the version bundled with oiio, but -@@ -141,62 +144,85 @@ else () - endif() - - # From pythonutils.cmake --find_python() -+# find_python() - - - ########################################################################### - # Dependencies for optional formats and features. If these are not found, - # we will continue building, but the related functionality will be disabled. - --checked_find_package (PNG) -- --checked_find_package (BZip2) # Used by ffmpeg and freetype --if (NOT BZIP2_FOUND) -- set (BZIP2_LIBRARIES "") # TODO: why does it break without this? -+if (USE_LIBPNG) -+ checked_find_package (PNG REQUIRED) - endif () - --checked_find_package (Freetype -+# checked_find_package (BZip2) # Used by ffmpeg and freetype -+# if (NOT BZIP2_FOUND) -+# set (BZIP2_LIBRARIES "") # TODO: why does it break without this? -+# endif () -+ -+if (USE_FREETYPE) -+ checked_find_package (Freetype REQUIRED - DEFINITIONS -DUSE_FREETYPE=1 ) -+endif () - --checked_find_package (HDF5 -+if (USE_HDF5) -+ checked_find_package (HDF5 REQUIRED - ISDEPOF Field3D) --checked_find_package (OpenColorIO -+endif () -+if (USE_OPENCOLORIO) -+ checked_find_package (OpenColorIO REQUIRED - DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 - # PREFER_CONFIG - ) --checked_find_package (OpenCV 3.0 -+endif () -+if (USE_OPENCV) -+ checked_find_package (OpenCV 3.0 REQUIRED - DEFINITIONS -DUSE_OPENCV=1) -+endif () - - # Intel TBB - set (TBB_USE_DEBUG_BUILD OFF) --checked_find_package (TBB 2017 -+if (USE_TBB) -+ checked_find_package (TBB 2017 REQUIRED - DEFINITIONS -DUSE_TBB=1 - PREFER_CONFIG) -+endif () - --checked_find_package (DCMTK VERSION_MIN 3.6.1) # For DICOM images --checked_find_package (FFmpeg VERSION_MIN 3.0) --checked_find_package (Field3D -+if (USE_DCMTK) -+ checked_find_package (DCMTK REQUIRED VERSION_MIN 3.6.1) # For DICOM images -+endif () -+if (USE_FFMPEG) -+ checked_find_package (ffmpeg REQUIRED VERSION_MIN 3.0) -+endif () -+if (USE_FIELD3D) -+ checked_find_package (Field3D REQUIRED - DEPS HDF5 - DEFINITIONS -DUSE_FIELD3D=1) --checked_find_package (GIF -+endif () -+if (USE_GIF) -+ checked_find_package (GIF REQUIRED - VERSION_MIN 4 - RECOMMEND_MIN 5.0 - RECOMMEND_MIN_REASON "for stability and thread safety") -+endif () - - # For HEIF/HEIC/AVIF formats --checked_find_package (Libheif VERSION_MIN 1.3 -+if (USE_LIBHEIF) -+ checked_find_package (libheif REQUIRED VERSION_MIN 1.3 - RECOMMEND_MIN 1.7 - RECOMMEND_MIN_REASON "for AVIF support") --if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) -+endif () -+if (0) - message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") - set (Libheif_FOUND 0) - endif () - --checked_find_package (LibRaw -+if (USE_LIBRAW) -+ checked_find_package (libraw REQUIRED - RECOMMEND_MIN 0.18 -- RECOMMEND_MIN_REASON "for ACES support and better camera metadata" -- PRINT LibRaw_r_LIBRARIES) --if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) -+ RECOMMEND_MIN_REASON "for ACES support and better camera metadata") -+endif () -+if (0) - message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") - # Currently, we issue the above warning and let them take their chances. - # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, -@@ -205,30 +231,43 @@ if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VER - # set (LIBRAW_FOUND 0) - endif () - --checked_find_package (OpenJPEG VERSION_MIN 2.0) -- --checked_find_package (OpenVDB -+if (USE_OPENJPEG) -+ checked_find_package (OpenJPEG REQUIRED VERSION_MIN 2.0) -+endif () -+if (USE_OPENVDB) -+ checked_find_package (OpenVDB REQUIRED - VERSION_MIN 5.0 - DEPS TBB - DEFINITIONS -DUSE_OPENVDB=1) -+endif () - --checked_find_package (Ptex PREFER_CONFIG) --if (NOT Ptex_FOUND OR NOT Ptex_VERSION) -+if (USE_PTEX) -+ checked_find_package (ptex REQUIRED PREFER_CONFIG) -+endif () -+if (0) - # Fallback for inadequate Ptex exported configs. This will eventually - # disappear when we can 100% trust Ptex's exports. - unset (Ptex_FOUND) - checked_find_package (Ptex) - endif () - --checked_find_package (WebP) -+if (USE_LIBWEBP) -+ checked_find_package (WebP REQUIRED) -+endif () - - option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) --checked_find_package (R3DSDK) # RED camera -+if (USE_R3DSDK) -+ checked_find_package (R3DSDK REQUIRED) # RED camera -+endif () - - set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") --checked_find_package (Nuke) -+if (USE_NUKE) -+ checked_find_package (Nuke REQUIRED) -+endif () - --checked_find_package (OpenGL) # used for iv -+if (USE_OPENGL) -+ checked_find_package (OpenGL REQUIRED) # used for iv -+endif () - - # Qt -- used for iv - set (qt5_modules Core Gui Widgets) -@@ -236,7 +275,9 @@ if (OPENGL_FOUND) - list (APPEND qt5_modules OpenGL) - endif () - option (USE_QT "Use Qt if found" ON) --checked_find_package (Qt5 COMPONENTS ${qt5_modules}) -+if (USE_QT) -+ checked_find_package (Qt5 REQUIRED COMPONENTS ${qt5_modules}) -+endif () - if (USE_QT AND NOT Qt5_FOUND AND APPLE) - message (STATUS " If you think you installed qt5 with Homebrew and it still doesn't work,") - message (STATUS " try: export PATH=/usr/local/opt/qt5/bin:$PATH") -@@ -257,13 +298,13 @@ macro (find_or_download_robin_map) - # for an installed version. Still prefer a copy that seems to be - # locally installed in this tree. - if (NOT BUILD_ROBINMAP_FORCE) -- find_package (Robinmap QUIET) -+ find_package (tsl-robin-map REQUIRED) - endif () - # If an external copy wasn't found and we requested that missing - # packages be built, or we we are forcing a local copy to be built, then - # download and build it. - # Download the headers from github -- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) -+ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) - message (STATUS "Downloading local Tessil/robin-map") - set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") - set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") -@@ -281,7 +322,7 @@ macro (find_or_download_robin_map) - endif () - set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") - endif () -- checked_find_package (Robinmap REQUIRED) -+ checked_find_package (tsl-robin-map REQUIRED) - endmacro() - - -@@ -291,7 +332,7 @@ endmacro() - option (USE_EMBEDDED_LIBSQUISH - "Force use of embedded Libsquish, even if external is found" OFF) - if (NOT USE_EMBEDDED_LIBSQUISH) -- checked_find_package (Libsquish) -+ checked_find_package (libsquish REQUIRED) - endif () - - -@@ -307,12 +348,12 @@ macro (find_or_download_fmt) - # for an installed version. Still prefer a copy that seems to be - # locally installed in this tree. - if (NOT BUILD_FMT_FORCE) -- find_package (fmt QUIET) -+ find_package (fmt REQUIRED) - endif () - # If an external copy wasn't found and we requested that missing - # packages be built, or we we are forcing a local copy to be built, then - # download and build it. -- if ((BUILD_MISSING_FMT AND NOT FMT_FOUND) OR BUILD_FMT_FORCE) -+ if ((BUILD_MISSING_FMT AND NOT fmt_FOUND) OR BUILD_FMT_FORCE) - message (STATUS "Downloading local fmtlib/fmt") - set (FMT_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/fmt") - set (FMT_GIT_REPOSITORY "https://github.com/fmtlib/fmt") -diff --git a/src/dds.imageio/CMakeLists.txt b/src/dds.imageio/CMakeLists.txt -index d693453a..7ff6e9ce 100644 ---- a/src/dds.imageio/CMakeLists.txt -+++ b/src/dds.imageio/CMakeLists.txt -@@ -2,10 +2,10 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (Libsquish_FOUND) -+if (libsquish_FOUND) - # External libsquish was found -- use it - add_oiio_plugin (ddsinput.cpp -- LINK_LIBRARIES Libsquish::Libsquish -+ LINK_LIBRARIES libsquish::libsquish - ) - else () - # No external libsquish was found -- use the embedded version. -diff --git a/src/dicom.imageio/CMakeLists.txt b/src/dicom.imageio/CMakeLists.txt -index ddd72044..3603eaa3 100644 ---- a/src/dicom.imageio/CMakeLists.txt -+++ b/src/dicom.imageio/CMakeLists.txt -@@ -4,8 +4,8 @@ - - if (DCMTK_FOUND) - add_oiio_plugin (dicominput.cpp -- INCLUDE_DIRS ${DCMTK_INCLUDE_DIR} -- LINK_LIBRARIES ${DCMTK_LIBRARIES} -+ # INCLUDE_DIRS ${DCMTK_INCLUDE_DIR} -+ LINK_LIBRARIES DCMTK::DCMTK - DEFINITIONS "-DUSE_DCMTK=1") - else () - message (WARNING "DICOM plugin will not be built, no DCMTK") -diff --git a/src/ffmpeg.imageio/CMakeLists.txt b/src/ffmpeg.imageio/CMakeLists.txt -index 614b8843..0df87825 100644 ---- a/src/ffmpeg.imageio/CMakeLists.txt -+++ b/src/ffmpeg.imageio/CMakeLists.txt -@@ -2,13 +2,13 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (FFmpeg_FOUND) -+if (ffmpeg_FOUND) - add_oiio_plugin (ffmpeginput.cpp -- INCLUDE_DIRS ${FFMPEG_INCLUDES} -- LINK_LIBRARIES ${FFMPEG_LIBRARIES} -- ${BZIP2_LIBRARIES} -+ # INCLUDE_DIRS ${FFMPEG_INCLUDES} -+ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale -+ # ${BZIP2_LIBRARIES} - DEFINITIONS "-DUSE_FFMPEG" -- "-DOIIO_FFMPEG_VERSION=\"${FFMPEG_VERSION}\"") -+ "-DOIIO_FFMPEG_VERSION=\"${ffmpeg_VERSION}\"") - else() - message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") - endif() -diff --git a/src/gif.imageio/CMakeLists.txt b/src/gif.imageio/CMakeLists.txt -index c9e7392c..eda8b482 100644 ---- a/src/gif.imageio/CMakeLists.txt -+++ b/src/gif.imageio/CMakeLists.txt -@@ -4,8 +4,8 @@ - - if (GIF_FOUND) - add_oiio_plugin (gifinput.cpp gifoutput.cpp -- INCLUDE_DIRS ${GIF_INCLUDE_DIRS} -- LINK_LIBRARIES ${GIF_LIBRARIES} -+ # INCLUDE_DIRS ${GIF_INCLUDE_DIRS} -+ LINK_LIBRARIES GIF::GIF - DEFINITIONS "-DUSE_GIF") - else() - message (WARNING "GIF plugin will not be built") -diff --git a/src/heif.imageio/CMakeLists.txt b/src/heif.imageio/CMakeLists.txt -index fed80015..2593f585 100644 ---- a/src/heif.imageio/CMakeLists.txt -+++ b/src/heif.imageio/CMakeLists.txt -@@ -2,9 +2,9 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (Libheif_FOUND) -+if (libheif_FOUND) - add_oiio_plugin (heifinput.cpp heifoutput.cpp -- LINK_LIBRARIES Libheif::Libheif -+ LINK_LIBRARIES libheif::libheif - DEFINITIONS "-DUSE_HEIF=1") - else () - message (WARNING "heif plugin will not be built") -diff --git a/src/igrep/CMakeLists.txt b/src/igrep/CMakeLists.txt -index 3fde566a..49f063a8 100644 ---- a/src/igrep/CMakeLists.txt -+++ b/src/igrep/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - fancy_add_executable (LINK_LIBRARIES OpenImageIO -- ${Boost_LIBRARIES} # because regex -+ #${Boost_LIBRARIES} # because regex - ) -diff --git a/src/iinfo/CMakeLists.txt b/src/iinfo/CMakeLists.txt -index 3fde566a..49f063a8 100644 ---- a/src/iinfo/CMakeLists.txt -+++ b/src/iinfo/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - fancy_add_executable (LINK_LIBRARIES OpenImageIO -- ${Boost_LIBRARIES} # because regex -+ #${Boost_LIBRARIES} # because regex - ) -diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt -index 1ea81b64..248e8a25 100644 ---- a/src/include/CMakeLists.txt -+++ b/src/include/CMakeLists.txt -@@ -56,17 +56,20 @@ install (FILES ${detail_headers} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail - COMPONENT developer) - -+set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") - set (fmt_headers - ${FMT_INCLUDES}/fmt/core.h - ${FMT_INCLUDES}/fmt/format-inl.h - ${FMT_INCLUDES}/fmt/format.h - ${FMT_INCLUDES}/fmt/ostream.h - ${FMT_INCLUDES}/fmt/printf.h ) -+if (0) - file (COPY ${fmt_headers} - DESTINATION ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt) - install (FILES ${fmt_headers} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail/fmt - COMPONENT developer) -+endif () - - if (NOT USE_EXTERNAL_PUGIXML) - set (pugixml_headers -diff --git a/src/include/OpenImageIO/strutil.h b/src/include/OpenImageIO/strutil.h -index 030d80a9..d6e768a3 100644 ---- a/src/include/OpenImageIO/strutil.h -+++ b/src/include/OpenImageIO/strutil.h -@@ -41,9 +41,9 @@ - #ifndef FMT_USE_GRISU - # define FMT_USE_GRISU 1 - #endif --#include "detail/fmt/ostream.h" --#include "detail/fmt/format.h" --#include "detail/fmt/printf.h" -+#include -+#include -+#include - #if OIIO_GNUC_VERSION >= 70000 - # pragma GCC diagnostic pop - #endif -diff --git a/src/jpeg.imageio/CMakeLists.txt b/src/jpeg.imageio/CMakeLists.txt -index 15d50cad..83830cd2 100644 ---- a/src/jpeg.imageio/CMakeLists.txt -+++ b/src/jpeg.imageio/CMakeLists.txt -@@ -3,5 +3,5 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (jpeginput.cpp jpegoutput.cpp -- INCLUDE_DIRS ${JPEG_INCLUDE_DIRS} -- LINK_LIBRARIES ${JPEG_LIBRARIES}) -+ # INCLUDE_DIRS ${JPEG_INCLUDE_DIRS} -+ LINK_LIBRARIES JPEG::JPEG) -diff --git a/src/jpeg2000.imageio/CMakeLists.txt b/src/jpeg2000.imageio/CMakeLists.txt -index 575ed0b7..5644bcf3 100644 ---- a/src/jpeg2000.imageio/CMakeLists.txt -+++ b/src/jpeg2000.imageio/CMakeLists.txt -@@ -2,10 +2,10 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (OPENJPEG_FOUND) -+if (OpenJPEG_FOUND) - add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp -- INCLUDE_DIRS ${OPENJPEG_INCLUDES} -- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} -+ # INCLUDE_DIRS ${OPENJPEG_INCLUDES} -+ LINK_LIBRARIES OpenJPEG::OpenJPEG - DEFINITIONS "-DUSE_OPENJPEG") - else() - message (WARNING "Jpeg-2000 plugin will not be built") -diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.txt -index 1e34593d..103c89de 100644 ---- a/src/libOpenImageIO/CMakeLists.txt -+++ b/src/libOpenImageIO/CMakeLists.txt -@@ -123,37 +123,42 @@ target_link_libraries (OpenImageIO - PUBLIC - OpenImageIO_Util - # For OpenEXR/Imath 3.x: -- $<$:Imath::Imath> -- $<$:Imath::Half> -+ # $<$:Imath::Imath> -+ # $<$:Imath::Half> - # For OpenEXR >= 2.4/2.5 with reliable exported targets -- $<$:IlmBase::Imath> -- $<$:IlmBase::Half> -+ # $<$:IlmBase::Imath> -+ # $<$:IlmBase::Half> - # For OpenEXR <= 2.3: -- ${ILMBASE_LIBRARIES} -+ OpenEXR::OpenEXR - ${GCC_ATOMIC_LIBRARIES} - PRIVATE - # For OpenEXR/Imath 3.x: -- $<$:OpenEXR::OpenEXR> -+ # $<$:OpenEXR::OpenEXR> - # For OpenEXR >= 2.4/2.5 with reliable exported targets -- $<$:OpenEXR::IlmImf> -- $<$:IlmBase::IlmThread> -- $<$:IlmBase::Iex> -+ # $<$:OpenEXR::IlmImf> -+ # $<$:IlmBase::IlmThread> -+ # $<$:IlmBase::Iex> - # For OpenEXR <= 2.3: -- ${OPENEXR_LIBRARIES} -- ${OpenCV_LIBRARIES} -+ # ${OPENEXR_LIBRARIES} -+ # ${OpenCV_LIBRARIES} - ${SANITIZE_LIBRARIES} - ${format_plugin_libs} # Add all the target link libraries from the plugins -+ tsl::robin_map - $<$:OpenColorIO::OpenColorIO> -- $<$:OpenColorIO::OpenColorIOHeaders> -+ # $<$:OpenColorIO::OpenColorIOHeaders> - $<$:pugixml::pugixml> -- ${BZIP2_LIBRARIES} -+ # ${BZIP2_LIBRARIES} - ZLIB::ZLIB -- ${Boost_LIBRARIES} -+ Boost::filesystem Boost::thread Boost::system Boost::container - ${CMAKE_DL_LIBS} - ) - --if (FREETYPE_FOUND) -- target_link_libraries (OpenImageIO PRIVATE ${FREETYPE_LIBRARIES}) -+if (OpenCV_FOUND) -+ target_link_libraries (OpenImageIO PUBLIC opencv::opencv_core opencv::opencv_imgproc opencv::opencv_videoio) -+endif () -+ -+if (Freetype_FOUND) -+ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) - endif() - - if (WIN32) -diff --git a/src/libutil/CMakeLists.txt b/src/libutil/CMakeLists.txt -index 7de38836..3e1609ad 100644 ---- a/src/libutil/CMakeLists.txt -+++ b/src/libutil/CMakeLists.txt -@@ -14,19 +14,19 @@ target_include_directories (OpenImageIO_Util - target_link_libraries (OpenImageIO_Util - PUBLIC - # For OpenEXR/Imath 3.x: -- $<$:Imath::Imath> -- $<$:Imath::Half> -+ # $<$:Imath::Imath> -+ # $<$:Imath::Half> - # For OpenEXR >= 2.4/2.5 with reliable exported targets -- $<$:IlmBase::Imath> -- $<$:IlmBase::Half> -- $<$:IlmBase::IlmThread> -- $<$:IlmBase::Iex> -+ # $<$:IlmBase::Imath> -+ # $<$:IlmBase::Half> -+ # $<$:IlmBase::IlmThread> -+ # $<$:IlmBase::Iex> - # For OpenEXR <= 2.3: -- ${ILMBASE_LIBRARIES} -+ OpenEXR::OpenEXR - ${GCC_ATOMIC_LIBRARIES} - PRIVATE - ${SANITIZE_LIBRARIES} -- ${Boost_LIBRARIES} -+ Boost::filesystem Boost::thread Boost::system - ${CMAKE_DL_LIBS} - ) - -diff --git a/src/oiiotool/CMakeLists.txt b/src/oiiotool/CMakeLists.txt -index e281d3f8..4ee92aad 100644 ---- a/src/oiiotool/CMakeLists.txt -+++ b/src/oiiotool/CMakeLists.txt -@@ -4,8 +4,8 @@ - - fancy_add_executable (LINK_LIBRARIES - OpenImageIO -- ${Boost_LIBRARIES} # because regex -- $<$:OpenEXR::OpenEXR> -- $<$:OpenEXR::IlmImf> -- ${OPENEXR_LIBRARIES} -+ Boost::container -+ # $<$:OpenEXR::OpenEXR> -+ # $<$:OpenEXR::IlmImf> -+ OpenEXR::OpenEXR - ) -diff --git a/src/openexr.imageio/CMakeLists.txt b/src/openexr.imageio/CMakeLists.txt -index d4772880..9f5f8998 100644 ---- a/src/openexr.imageio/CMakeLists.txt -+++ b/src/openexr.imageio/CMakeLists.txt -@@ -12,7 +12,7 @@ if (OIIO_USE_EXR_C_API) - LINK_LIBRARIES OpenEXR::OpenEXRCore) - else() - add_oiio_plugin (exrinput.cpp exroutput.cpp -- INCLUDE_DIRS ${OPENEXR_INCLUDES} ${IMATH_INCLUDE_DIR}/OpenEXR -- LINK_LIBRARIES ${OPENEXR_LIBRARIES}) -+ #INCLUDE_DIRS ${OPENEXR_INCLUDES} ${IMATH_INCLUDE_DIR}/OpenEXR -+ LINK_LIBRARIES OpenEXR::OpenEXR) - endif() - -diff --git a/src/openvdb.imageio/CMakeLists.txt b/src/openvdb.imageio/CMakeLists.txt -index 57a0f625..986f9c21 100644 ---- a/src/openvdb.imageio/CMakeLists.txt -+++ b/src/openvdb.imageio/CMakeLists.txt -@@ -2,8 +2,8 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (OpenVDB_FOUND) -+if (OpenVDB_FOUND AND TBB_FOUND) - add_oiio_plugin (openvdbinput.cpp - INCLUDE_DIRS ${TBB_INCLUDE_DIRS} -- LINK_LIBRARIES OpenVDB::OpenVDB ${TBB_tbb_LIBRARY} ${BOOST_LIBRARIES}) -+ LINK_LIBRARIES OpenVDB::OpenVDB TBB::TBB) - endif() -diff --git a/src/psd.imageio/CMakeLists.txt b/src/psd.imageio/CMakeLists.txt -index 48bf24fb..a5acecfd 100644 ---- a/src/psd.imageio/CMakeLists.txt -+++ b/src/psd.imageio/CMakeLists.txt -@@ -3,6 +3,6 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (psdinput.cpp jpeg_memory_src.cpp -- INCLUDE_DIRS ${JPEG_INCLUDE_DIR} -- LINK_LIBRARIES ${JPEG_LIBRARIES}) -+ #INCLUDE_DIRS ${JPEG_INCLUDE_DIR} -+ LINK_LIBRARIES JPEG::JPEG) - -diff --git a/src/ptex.imageio/CMakeLists.txt b/src/ptex.imageio/CMakeLists.txt -index 2f47527a..1c3c9800 100644 ---- a/src/ptex.imageio/CMakeLists.txt -+++ b/src/ptex.imageio/CMakeLists.txt -@@ -2,8 +2,8 @@ - # SPDX-License-Identifier: BSD-3-Clause - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - --if (Ptex_FOUND) -+if (PTex_FOUND) - add_oiio_plugin (ptexinput.cpp -- LINK_LIBRARIES Ptex::Ptex_dynamic ZLIB::ZLIB -+ LINK_LIBRARIES PTex::PTex ZLIB::ZLIB - DEFINITIONS "-DUSE_PTEX") - endif () -diff --git a/src/raw.imageio/CMakeLists.txt b/src/raw.imageio/CMakeLists.txt -index d235fd9d..6661a2a8 100644 ---- a/src/raw.imageio/CMakeLists.txt -+++ b/src/raw.imageio/CMakeLists.txt -@@ -4,9 +4,9 @@ - - if (LIBRAW_FOUND) - add_oiio_plugin (rawinput.cpp -- INCLUDE_DIRS ${LibRaw_INCLUDE_DIR} -- LINK_LIBRARIES ${LibRaw_r_LIBRARIES} -- DEFINITIONS "-DUSE_LIBRAW=1" ${LibRaw_r_DEFINITIONS}) -+ #INCLUDE_DIRS ${LibRaw_INCLUDE_DIR} -+ LINK_LIBRARIES libraw::libraw -+ DEFINITIONS "-DUSE_LIBRAW=1") - else () - message (WARNING "Raw plugin will not be built") - endif () -diff --git a/src/tiff.imageio/CMakeLists.txt b/src/tiff.imageio/CMakeLists.txt -index ab94d56d..99ee19ae 100644 ---- a/src/tiff.imageio/CMakeLists.txt -+++ b/src/tiff.imageio/CMakeLists.txt -@@ -3,6 +3,6 @@ - # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md - - add_oiio_plugin (tiffinput.cpp tiffoutput.cpp -- INCLUDE_DIRS ${TIFF_INCLUDE_DIR} -- LINK_LIBRARIES ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} -+ #INCLUDE_DIRS ${TIFF_INCLUDE_DIR} -+ LINK_LIBRARIES TIFF::TIFF JPEG::JPEG - ZLIB::ZLIB) -diff --git a/src/webp.imageio/CMakeLists.txt b/src/webp.imageio/CMakeLists.txt -index 44462c49..78fe1a58 100644 ---- a/src/webp.imageio/CMakeLists.txt -+++ b/src/webp.imageio/CMakeLists.txt -@@ -4,7 +4,7 @@ - - if (WebP_FOUND) - add_oiio_plugin (webpinput.cpp webpoutput.cpp -- LINK_LIBRARIES WebP::WebP WebP::WebPDemux -+ LINK_LIBRARIES WebP::WebP - DEFINITIONS "-DUSE_WEBP=1") - else () - message (STATUS "WebP plugin will not be built") diff --git a/recipes/openimageio/all/patches/2.4.17.0-cmake-targets.patch b/recipes/openimageio/all/patches/2.4.17.0-cmake-targets.patch new file mode 100644 index 0000000000000..5ed8bf12ec780 --- /dev/null +++ b/recipes/openimageio/all/patches/2.4.17.0-cmake-targets.patch @@ -0,0 +1,456 @@ +diff --git CMakeLists.txt CMakeLists.txt +index a5a6de1c5..f1801af5a 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -144,7 +144,7 @@ message(STATUS "Setting Namespace to: ${PROJ_NAMESPACE_V}") + add_definitions (-DOIIO_INTERNAL=1) + + list (APPEND CMAKE_MODULE_PATH +- "${PROJECT_SOURCE_DIR}/src/cmake/modules" ++ #"${PROJECT_SOURCE_DIR}/src/cmake/modules" + "${PROJECT_SOURCE_DIR}/src/cmake") + + include (GNUInstallDirs) +@@ -224,7 +224,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) + add_subdirectory (src/iinfo) + add_subdirectory (src/maketx) + add_subdirectory (src/oiiotool) +- add_subdirectory (src/testtex) ++ #add_subdirectory (src/testtex) + add_subdirectory (src/iv) + endif () + +diff --git src/cmake/externalpackages.cmake src/cmake/externalpackages.cmake +index a4f895c07..f55da37cb 100644 +--- src/cmake/externalpackages.cmake ++++ src/cmake/externalpackages.cmake +@@ -45,14 +45,14 @@ if (NOT DEFINED Boost_USE_STATIC_LIBS) + set (Boost_USE_STATIC_LIBS "${LINKSTATIC}") + endif () + +-if (MSVC) +- # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: +- if (NOT Boost_USE_STATIC_LIBS) +- add_definitions (-DBOOST_ALL_DYN_LINK=1) +- endif () +-endif () +- +-set (Boost_COMPONENTS thread) ++# if (MSVC) ++# # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: ++# if (NOT Boost_USE_STATIC_LIBS) ++# add_definitions (-DBOOST_ALL_DYN_LINK=1) ++# endif () ++# endif () ++ ++set (Boost_COMPONENTS filesystem system thread container) + if (NOT USE_STD_FILESYSTEM) + list (APPEND Boost_COMPONENTS filesystem) + endif () +@@ -108,9 +108,9 @@ checked_find_package (OpenEXR REQUIRED + # building against Imath/OpenEXR 3.x when there is still a system-level + # install version of 2.x. + include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) +-if (MSVC AND NOT LINKSTATIC) +- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? +-endif () ++# if (MSVC AND NOT LINKSTATIC) ++# add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? ++# endif () + if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.0) + set (OIIO_USING_IMATH 3) + else () +@@ -141,12 +141,15 @@ set (OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH OFF CACHE BOOL + "Exclude find_dependency(Imath) from the exported OpenImageIOConfig.cmake") + + # JPEG -- prefer Turbo-JPEG to regular libjpeg +-checked_find_package (JPEGTurbo +- DEFINITIONS -DUSE_JPEG_TURBO=1 +- PRINT JPEG_INCLUDES JPEG_INCLUDE_DIRS +- JPEG_LIBRARIES JPEG_VERSION) +-if (NOT JPEG_FOUND) # Try to find the non-turbo version ++if (USE_JPEGTURBO) ++ checked_find_package (libjpeg-turbo REQUIRED ++ DEFINITIONS -DUSE_JPEG_TURBO=1 ++ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) ++ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) ++elseif (USE_JPEG) # Try to find the non-turbo version + checked_find_package (JPEG REQUIRED) ++else () ++ message(FATAL_ERROR "JPEG library was not found!") + endif () + + # Pugixml setup. Normally we just use the version bundled with oiio, but +@@ -162,106 +165,110 @@ else () + endif() + + # From pythonutils.cmake +-find_python() ++#find_python() + + + ########################################################################### + # Dependencies for optional formats and features. If these are not found, + # we will continue building, but the related functionality will be disabled. + +-checked_find_package (PNG) +- +-checked_find_package (BZip2) # Used by ffmpeg and freetype +-if (NOT BZIP2_FOUND) +- set (BZIP2_LIBRARIES "") # TODO: why does it break without this? +-endif () ++if (USE_LIBPNG) ++ checked_find_package (PNG) ++endif() + +-checked_find_package (Freetype +- DEFINITIONS -DUSE_FREETYPE=1 ) ++if (USE_FREETYPE) ++ checked_find_package (Freetype ++ DEFINITIONS -DUSE_FREETYPE=1 ) ++endif() + +-checked_find_package (OpenColorIO +- DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 +- # PREFER_CONFIG +- ) +-if (NOT OpenColorIO_FOUND) +- set (OpenColorIO_FOUND 0) +-endif () +-checked_find_package (OpenCV 3.0 +- DEFINITIONS -DUSE_OPENCV=1) ++if (USE_OPENCOLORIO) ++ checked_find_package (OpenColorIO ++ DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 ++ # PREFER_CONFIG ++ ) ++ if (NOT OpenColorIO_FOUND) ++ set (OpenColorIO_FOUND 0) ++ endif () ++endif() ++if (USE_OPENCV) ++ checked_find_package (OpenCV 3.0 ++ DEFINITIONS -DUSE_OPENCV=1) ++endif() + + # Intel TBB +-set (TBB_USE_DEBUG_BUILD OFF) +-checked_find_package (TBB 2017 +- SETVARIABLES OIIO_TBB +- PREFER_CONFIG) +- +-checked_find_package (DCMTK VERSION_MIN 3.6.1) # For DICOM images +-checked_find_package (FFmpeg VERSION_MIN 3.0) +-checked_find_package (GIF +- VERSION_MIN 4 +- RECOMMEND_MIN 5.0 +- RECOMMEND_MIN_REASON "for stability and thread safety") +- ++if (USE_TBB)# Intel TBB ++ set (TBB_USE_DEBUG_BUILD OFF) ++ checked_find_package (TBB 2017 ++ SETVARIABLES OIIO_TBB ++ PREFER_CONFIG) ++endif() ++if (USE_DCMTK) ++ checked_find_package (DCMTK VERSION_MIN 3.6.1) # For DICOM images ++endif() ++if (USE_FFMPEG) ++ checked_find_package (ffmpeg VERSION_MIN 3.0) ++endif() ++if (USE_GIF) ++ checked_find_package (GIF ++ VERSION_MIN 4 ++ RECOMMEND_MIN 5.0 ++ RECOMMEND_MIN_REASON "for stability and thread safety") ++endif() ++ + # For HEIF/HEIC/AVIF formats +-checked_find_package (Libheif VERSION_MIN 1.3 +- RECOMMEND_MIN 1.7 +- RECOMMEND_MIN_REASON "for AVIF support") +-if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) +- message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") +- set (Libheif_FOUND 0) +-endif () +- +-checked_find_package (LibRaw +- RECOMMEND_MIN 0.18 +- RECOMMEND_MIN_REASON "for ACES support and better camera metadata" +- PRINT LibRaw_r_LIBRARIES) +-if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) +- message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") +- # Currently, we issue the above warning and let them take their chances. +- # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, +- # just uncomment the following two lines. +- # set (LibRaw_FOUND 0) +- # set (LIBRAW_FOUND 0) +-endif () ++if (USE_LIBHEIF) ++ checked_find_package (libheif REQUIRED VERSION_MIN 1.3 ++ RECOMMEND_MIN 1.7 ++ RECOMMEND_MIN_REASON "for AVIF support") ++endif() + +-checked_find_package (OpenJPEG VERSION_MIN 2.0 +- RECOMMEND_MIN 2.2 +- RECOMMEND_MIN_REASON "for multithreading support") +-# Note: Recent OpenJPEG versions have exported cmake configs, but we don't +-# find them reliable at all, so we stick to our FindOpenJPEG.cmake module. +- +-checked_find_package (OpenVDB +- VERSION_MIN 5.0 +- DEPS TBB +- DEFINITIONS -DUSE_OPENVDB=1) +-if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) +- message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") +- set (OpeVDB_FOUND 0) +-endif () ++if (USE_LIBRAW) ++ checked_find_package (LibRaw ++ RECOMMEND_MIN 0.18 ++ RECOMMEND_MIN_REASON "for ACES support and better camera metadata" ++ PRINT LibRaw_r_LIBRARIES) ++endif() + +-checked_find_package (Ptex PREFER_CONFIG) +-if (NOT Ptex_FOUND OR NOT Ptex_VERSION) +- # Fallback for inadequate Ptex exported configs. This will eventually +- # disappear when we can 100% trust Ptex's exports. +- unset (Ptex_FOUND) +- checked_find_package (Ptex) +-endif () ++if (USE_OPENJPEG) ++ checked_find_package (OpenJPEG REQUIRED ++ VERSION_MIN 2.0 ++ RECOMMEND_MIN 2.2 ++ RECOMMEND_MIN_REASON "for multithreading support") ++ # Note: Recent OpenJPEG versions have exported cmake configs, but we don't ++ # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. ++endif() ++if (USE_OPENVDB) ++ checked_find_package (OpenVDB REQUIRED ++ VERSION_MIN 5.0 ++ DEPS TBB ++ DEFINITIONS -DUSE_OPENVDB=1) ++endif() + +-checked_find_package (WebP) ++if (USE_PTEX) ++ checked_find_package (ptex PREFER_CONFIG) ++endif() + ++if (USE_LIBWEBP) ++ checked_find_package (WebP REQUIRED) ++endif() ++ + option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) +-checked_find_package (R3DSDK) # RED camera +- ++if (USE_R3DSDK) ++ checked_find_package (R3DSDK REQUIRED) # RED camera ++endif () ++ + set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") +-checked_find_package (Nuke) ++if (USE_NUKE) ++ checked_find_package (Nuke REQUIRED) ++endif () + + + # Qt -- used for iv + option (USE_QT "Use Qt if found" ON) +-if (USE_QT) +- checked_find_package (OpenGL) # used for iv ++if (USE_OPENGL) ++ checked_find_package (OpenGL REQUIRED) # used for iv + endif () +-if (USE_QT AND OPENGL_FOUND) ++if (USE_QT AND USE_OPENGL) + checked_find_package (Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets) + if (NOT Qt6_FOUND) + checked_find_package (Qt5 COMPONENTS Core Gui Widgets OpenGL) +@@ -285,13 +291,13 @@ macro (find_or_download_robin_map) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_ROBINMAP_FORCE) +- find_package (Robinmap QUIET) ++ find_package (tsl-robin-map REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then + # download and build it. + # Download the headers from github +- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) ++ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) + message (STATUS "Downloading local Tessil/robin-map") + set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") + set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") +@@ -309,7 +315,7 @@ macro (find_or_download_robin_map) + endif () + set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") + endif () +- checked_find_package (Robinmap REQUIRED) ++ checked_find_package (tsl-robin-map REQUIRED) + endmacro() + + +@@ -331,7 +337,7 @@ macro (find_or_download_fmt) + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then + # download and build it. +- if ((BUILD_MISSING_FMT AND NOT FMT_FOUND) OR BUILD_FMT_FORCE) ++ if ((BUILD_MISSING_FMT AND NOT fmt_FOUND) OR BUILD_FMT_FORCE) + message (STATUS "Downloading local fmtlib/fmt") + set (FMT_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/fmt") + set (FMT_GIT_REPOSITORY "https://github.com/fmtlib/fmt") +diff --git src/ffmpeg.imageio/CMakeLists.txt src/ffmpeg.imageio/CMakeLists.txt +index 100d4d773..ec7e01884 100644 +--- src/ffmpeg.imageio/CMakeLists.txt ++++ src/ffmpeg.imageio/CMakeLists.txt +@@ -2,13 +2,11 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (FFmpeg_FOUND) ++if (USE_FFMPEG) + add_oiio_plugin (ffmpeginput.cpp +- INCLUDE_DIRS ${FFMPEG_INCLUDES} +- LINK_LIBRARIES ${FFMPEG_LIBRARIES} +- ${BZIP2_LIBRARIES} ++ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale + DEFINITIONS "-DUSE_FFMPEG" +- "-DOIIO_FFMPEG_VERSION=\"${FFMPEG_VERSION}\"") ++ "-DOIIO_FFMPEG_VERSION=\"${ffmpeg_VERSION}\"") + else() + message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") + endif() +diff --git src/heif.imageio/CMakeLists.txt src/heif.imageio/CMakeLists.txt +index eed740900..72aaaff86 100644 +--- src/heif.imageio/CMakeLists.txt ++++ src/heif.imageio/CMakeLists.txt +@@ -2,10 +2,10 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Libheif_FOUND) ++if (USE_LIBHEIF) + add_oiio_plugin (heifinput.cpp heifoutput.cpp +- INCLUDE_DIRS ${LIBHEIF_INCLUDES} +- LINK_LIBRARIES ${LIBHEIF_LIBRARIES} ++ #INCLUDE_DIRS ${LIBHEIF_INCLUDES} ++ LINK_LIBRARIES libheif::heif + DEFINITIONS "-DUSE_HEIF=1") + else () + message (WARNING "heif plugin will not be built") +diff --git src/include/CMakeLists.txt src/include/CMakeLists.txt +index 006cb65a7..2e2c2c2ea 100644 +--- src/include/CMakeLists.txt ++++ src/include/CMakeLists.txt +@@ -65,6 +65,7 @@ install (FILES ${detail_headers} + COMPONENT developer) + + if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) ++ set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") + set (fmt_headers + ${FMT_INCLUDES}/fmt/core.h + ${FMT_INCLUDES}/fmt/format-inl.h +@@ -74,8 +75,8 @@ if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) + if (fmt_VERSION VERSION_GREATER_EQUAL 90000) + list (APPEND fmt_headers ${FMT_INCLUDES}/fmt/std.h) + endif () +- file (COPY ${fmt_headers} +- DESTINATION ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt) ++ # file (COPY ${fmt_headers} ++ # DESTINATION ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt) + else () + set (fmt_headers + ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt/format.h +diff --git src/include/OpenImageIO/detail/fmt.h src/include/OpenImageIO/detail/fmt.h +index 31a986d31..9a7e5ce54 100644 +--- src/include/OpenImageIO/detail/fmt.h ++++ src/include/OpenImageIO/detail/fmt.h +@@ -55,9 +55,9 @@ OIIO_PRAGMA_WARNING_PUSH + # pragma GCC diagnostic ignored "-Wtautological-constant-compare" + #endif + +-#include +-#include +-#include ++#include ++#include ++#include + + OIIO_PRAGMA_WARNING_POP + +diff --git src/jpeg2000.imageio/CMakeLists.txt src/jpeg2000.imageio/CMakeLists.txt +index 560e8d486..94b5cd2dc 100644 +--- src/jpeg2000.imageio/CMakeLists.txt ++++ src/jpeg2000.imageio/CMakeLists.txt +@@ -4,8 +4,7 @@ + + if (OPENJPEG_FOUND) + add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp +- INCLUDE_DIRS ${OPENJPEG_INCLUDES} +- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} ++ LINK_LIBRARIES openjp2 + DEFINITIONS "-DUSE_OPENJPEG") + else() + message (WARNING "Jpeg-2000 plugin will not be built") +diff --git src/libOpenImageIO/CMakeLists.txt src/libOpenImageIO/CMakeLists.txt +index 772b39ff2..898fb2be6 100644 +--- src/libOpenImageIO/CMakeLists.txt ++++ src/libOpenImageIO/CMakeLists.txt +@@ -141,12 +141,17 @@ target_link_libraries (OpenImageIO + $ + ${BZIP2_LIBRARIES} + ZLIB::ZLIB +- $ ++ tsl::robin_map ++ Boost::filesystem Boost::thread Boost::system Boost::container + ${CMAKE_DL_LIBS} + ) + ++if (USE_OPENCV) ++ target_link_libraries (OpenImageIO PUBLIC opencv::opencv_core opencv::opencv_imgproc opencv::opencv_videoio) ++endif () ++ +-if (FREETYPE_FOUND) +- target_link_libraries (OpenImageIO PRIVATE ${FREETYPE_LIBRARIES}) ++if (USE_FREETYPE) ++ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) + endif() + + if (WIN32) +diff --git src/libutil/CMakeLists.txt src/libutil/CMakeLists.txt +index 8933bfe5b..3970eb0c3 100644 +--- src/libutil/CMakeLists.txt ++++ src/libutil/CMakeLists.txt +@@ -20,8 +20,8 @@ target_link_libraries (OpenImageIO_Util + ${GCC_ATOMIC_LIBRARIES} + ${OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY} + ${OPENIMAGEIO_IMATH_TARGETS} ++ fmt::fmt + PRIVATE +- $ +- $ ++ Boost::filesystem Boost::thread Boost::system + $ + ${CMAKE_DL_LIBS} + ) +diff --git src/ptex.imageio/CMakeLists.txt src/ptex.imageio/CMakeLists.txt +index ed42f1c94..82d2b9770 100644 +--- src/ptex.imageio/CMakeLists.txt ++++ src/ptex.imageio/CMakeLists.txt +@@ -2,8 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Ptex_FOUND) ++if (USE_PTEX) + add_oiio_plugin (ptexinput.cpp +- LINK_LIBRARIES Ptex::Ptex_dynamic ZLIB::ZLIB ++ LINK_LIBRARIES ${ptex_LIBRARIES} ZLIB::ZLIB ++ INCLUDE_DIRS ${ptex_INCLUDE_DIRS} + DEFINITIONS "-DUSE_PTEX") + endif () diff --git a/recipes/openimageio/all/patches/2.4.7.1-cmake-targets.patch b/recipes/openimageio/all/patches/2.4.7.1-cmake-targets.patch index c909b13a27c9e..0d61414f30ef2 100644 --- a/recipes/openimageio/all/patches/2.4.7.1-cmake-targets.patch +++ b/recipes/openimageio/all/patches/2.4.7.1-cmake-targets.patch @@ -60,7 +60,7 @@ index 48e871418..21f709b1d 100644 - JPEG_LIBRARIES JPEG_VERSION) -if (NOT JPEG_FOUND) # Try to find the non-turbo version +if (USE_JPEGTURBO) -+ checked_find_package (JPEGTurbo ++ checked_find_package (libjpeg-turbo REQUIRED + DEFINITIONS -DUSE_JPEG_TURBO=1 + PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) + add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) @@ -155,7 +155,7 @@ index 48e871418..21f709b1d 100644 # For HEIF/HEIC/AVIF formats -checked_find_package (Libheif VERSION_MIN 1.3 +if (USE_LIBHEIF) -+checked_find_package (libheif VERSION_MIN 1.3 ++checked_find_package (libheif REQUIRED VERSION_MIN 1.3 RECOMMEND_MIN 1.7 RECOMMEND_MIN_REASON "for AVIF support") -if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) @@ -299,6 +299,24 @@ index 58402060e..5dea82369 100644 else() message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") endif() +diff --git src/heif.imageio/CMakeLists.txt src/heif.imageio/CMakeLists.txt +index ece763a27..83abdea66 100644 +--- src/heif.imageio/CMakeLists.txt ++++ src/heif.imageio/CMakeLists.txt +@@ -2,10 +2,10 @@ + # SPDX-License-Identifier: BSD-3-Clause + # https://github.com/OpenImageIO/oiio + +-if (Libheif_FOUND) ++if (USE_LIBHEIF) + add_oiio_plugin (heifinput.cpp heifoutput.cpp +- INCLUDE_DIRS ${LIBHEIF_INCLUDES} +- LINK_LIBRARIES ${LIBHEIF_LIBRARIES} ++ #INCLUDE_DIRS ${LIBHEIF_INCLUDES} ++ LINK_LIBRARIES libheif::heif + DEFINITIONS "-DUSE_HEIF=1") + else () + message (WARNING "heif plugin will not be built") diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt index 52b0936a6..611eadb4e 100644 --- a/src/include/CMakeLists.txt @@ -348,7 +366,7 @@ index 1f47269bf..85b90d66a 100644 add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp - INCLUDE_DIRS ${OPENJPEG_INCLUDES} - LINK_LIBRARIES ${OPENJPEG_LIBRARIES} -+ LINK_LIBRARIES OpenJPEG::OpenJPEG ++ LINK_LIBRARIES openjp2 DEFINITIONS "-DUSE_OPENJPEG") else() message (WARNING "Jpeg-2000 plugin will not be built") @@ -356,11 +374,12 @@ diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.t index 456aab81a..eb5bb00fc 100644 --- a/src/libOpenImageIO/CMakeLists.txt +++ b/src/libOpenImageIO/CMakeLists.txt -@@ -141,10 +141,14 @@ target_link_libraries (OpenImageIO +@@ -141,12 +141,17 @@ target_link_libraries (OpenImageIO $ ${BZIP2_LIBRARIES} ZLIB::ZLIB - $ ++ tsl::robin_map + Boost::filesystem Boost::thread Boost::system Boost::container ${CMAKE_DL_LIBS} ) @@ -370,15 +389,21 @@ index 456aab81a..eb5bb00fc 100644 +endif () + if (FREETYPE_FOUND) - target_link_libraries (OpenImageIO PRIVATE ${FREETYPE_LIBRARIES}) +- target_link_libraries (OpenImageIO PRIVATE ${FREETYPE_LIBRARIES}) ++ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) endif() + + if (WIN32) diff --git a/src/libutil/CMakeLists.txt b/src/libutil/CMakeLists.txt index 09b9139d0..a2d39982e 100644 --- a/src/libutil/CMakeLists.txt +++ b/src/libutil/CMakeLists.txt -@@ -17,8 +17,7 @@ target_link_libraries (OpenImageIO_Util +@@ -15,8 +15,8 @@ target_link_libraries (OpenImageIO_Util + $ + ${GCC_ATOMIC_LIBRARIES} ${OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY} ${OPENIMAGEIO_IMATH_TARGETS} ++ fmt::fmt PRIVATE - $ - $ @@ -390,7 +415,7 @@ diff --git a/src/ptex.imageio/CMakeLists.txt b/src/ptex.imageio/CMakeLists.txt index d7f0a9582..7cfce4a35 100644 --- a/src/ptex.imageio/CMakeLists.txt +++ b/src/ptex.imageio/CMakeLists.txt -@@ -2,8 +2,8 @@ +@@ -2,8 +2,9 @@ # SPDX-License-Identifier: BSD-3-Clause # https://github.com/OpenImageIO/oiio @@ -398,6 +423,7 @@ index d7f0a9582..7cfce4a35 100644 +if (ptex_FOUND) add_oiio_plugin (ptexinput.cpp - LINK_LIBRARIES Ptex::Ptex_dynamic ZLIB::ZLIB -+ LINK_LIBRARIES Ptex::Ptex ZLIB::ZLIB ++ LINK_LIBRARIES ${ptex_LIBRARIES} ZLIB::ZLIB ++ INCLUDE_DIRS ${ptex_INCLUDE_DIRS} DEFINITIONS "-DUSE_PTEX") endif () diff --git a/recipes/openimageio/all/patches/2.5.14.0-cmake-targets.patch b/recipes/openimageio/all/patches/2.5.14.0-cmake-targets.patch new file mode 100644 index 0000000000000..859c8562899a5 --- /dev/null +++ b/recipes/openimageio/all/patches/2.5.14.0-cmake-targets.patch @@ -0,0 +1,521 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 3ff009229..d38941db0 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -154,7 +154,7 @@ endif () + add_definitions (-DOIIO_INTERNAL=1) + + list (APPEND CMAKE_MODULE_PATH +- "${PROJECT_SOURCE_DIR}/src/cmake/modules" ++ #"${PROJECT_SOURCE_DIR}/src/cmake/modules" + "${PROJECT_SOURCE_DIR}/src/cmake") + + include (GNUInstallDirs) +@@ -233,7 +233,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) + add_subdirectory (src/iinfo) + add_subdirectory (src/maketx) + add_subdirectory (src/oiiotool) +- add_subdirectory (src/testtex) ++ #add_subdirectory (src/testtex) + add_subdirectory (src/iv) + endif () + +diff --git src/cmake/externalpackages.cmake src/cmake/externalpackages.cmake +index fe581e723..ab2fbb7f5 100644 +--- src/cmake/externalpackages.cmake ++++ src/cmake/externalpackages.cmake +@@ -48,14 +48,14 @@ if (NOT DEFINED Boost_USE_STATIC_LIBS) + set (Boost_USE_STATIC_LIBS "${LINKSTATIC}") + endif () + +-if (MSVC) +- # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: +- if (NOT Boost_USE_STATIC_LIBS) +- add_definitions (-DBOOST_ALL_DYN_LINK=1) +- endif () +-endif () +- +-set (Boost_COMPONENTS thread) ++#if (MSVC) ++# # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: ++# if (NOT Boost_USE_STATIC_LIBS) ++# add_definitions (-DBOOST_ALL_DYN_LINK=1) ++# endif () ++#endif () ++ ++set (Boost_COMPONENTS filesystem system thread container) + if (NOT USE_STD_FILESYSTEM) + list (APPEND Boost_COMPONENTS filesystem) + endif () +@@ -111,9 +111,9 @@ checked_find_package (OpenEXR REQUIRED + # building against Imath/OpenEXR 3.x when there is still a system-level + # install version of 2.x. + include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) +-if (MSVC AND NOT LINKSTATIC) +- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? +-endif () ++#if (MSVC AND NOT LINKSTATIC) ++# add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? ++#endif () + if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.0) + set (OIIO_USING_IMATH 3) + else () +@@ -140,11 +140,15 @@ set (OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH OFF CACHE BOOL + "Exclude find_dependency(Imath) from the exported OpenImageIOConfig.cmake") + + # JPEG -- prefer JPEG-Turbo to regular libjpeg +-checked_find_package (libjpeg-turbo +- VERSION_MIN 2.1 +- DEFINITIONS -DUSE_JPEG_TURBO=1) +-if (NOT TARGET libjpeg-turbo::jpeg) # Try to find the non-turbo version ++if (USE_JPEGTURBO) ++ checked_find_package (libjpeg-turbo REQUIRED ++ DEFINITIONS -DUSE_JPEG_TURBO=1 ++ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) ++ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) ++elseif (USE_JPEG) # Try to find the non-turbo version + checked_find_package (JPEG REQUIRED) ++else () ++ message(FATAL_ERROR "JPEG library was not found!") + endif () + + # Pugixml setup. Normally we just use the version bundled with oiio, but +@@ -160,7 +164,7 @@ else () + endif() + + # From pythonutils.cmake +-find_python() ++#find_python() + if (USE_PYTHON) + checked_find_package (pybind11 REQUIRED VERSION_MIN 2.4.2) + endif () +@@ -170,111 +174,107 @@ endif () + # Dependencies for optional formats and features. If these are not found, + # we will continue building, but the related functionality will be disabled. + +-checked_find_package (PNG) ++if (USE_LIBPNG) ++ checked_find_package (PNG REQUIRED) ++endif() + +-checked_find_package (BZip2) # Used by ffmpeg and freetype +-if (NOT BZIP2_FOUND) +- set (BZIP2_LIBRARIES "") # TODO: why does it break without this? +-endif () ++if (USE_FREETYPE) ++ checked_find_package (Freetype REQUIRED ++ DEFINITIONS -DUSE_FREETYPE=1 ) ++endif() + +-checked_find_package (Freetype +- DEFINITIONS -DUSE_FREETYPE=1 ) +- +-checked_find_package (OpenColorIO +- DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 +- # PREFER_CONFIG +- ) +-if (OpenColorIO_FOUND) +- option (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS +- "For deveoper debugging/testing ONLY! Disable OCIO 2.2 builtin configs." OFF) +- if (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS OR "$ENV{OIIO_DISABLE_BUILTIN_OCIO_CONFIGS}") +- add_compile_definitions(OIIO_DISABLE_BUILTIN_OCIO_CONFIGS) +- endif () +-else () +- set (OpenColorIO_FOUND 0) ++if (USE_OPENCOLORIO) ++ checked_find_package (OpenColorIO REQUIRED ++ DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 ++ # PREFER_CONFIG ++ ) + endif () + +-checked_find_package (OpenCV 3.0 +- DEFINITIONS -DUSE_OPENCV=1) ++if (USE_OPENCV) ++ checked_find_package (OpenCV REQUIRED 3.0 ++ DEFINITIONS -DUSE_OPENCV=1) ++endif() + + # Intel TBB +-set (TBB_USE_DEBUG_BUILD OFF) +-checked_find_package (TBB 2017 +- SETVARIABLES OIIO_TBB +- PREFER_CONFIG) ++if (USE_TBB)# Intel TBB ++ set (TBB_USE_DEBUG_BUILD OFF) ++ checked_find_package (TBB 2017 REQUIRED ++ SETVARIABLES OIIO_TBB ++ PREFER_CONFIG) ++endif() + + # DCMTK is used to read DICOM images +-checked_find_package (DCMTK VERSION_MIN 3.6.1 +- PREFER_CONFIG) ++if (USE_DCMTK) ++ checked_find_package (DCMTK REQUIRED VERSION_MIN 3.6.1) # For DICOM images ++endif() + +-checked_find_package (FFmpeg VERSION_MIN 3.0) +-checked_find_package (GIF +- VERSION_MIN 4 +- RECOMMEND_MIN 5.0 +- RECOMMEND_MIN_REASON "for stability and thread safety") ++if (USE_FFMPEG) ++ checked_find_package (ffmpeg REQUIRED VERSION_MIN 3.0) ++endif() ++if (USE_GIF) ++ checked_find_package (GIF REQUIRED ++ VERSION_MIN 4 ++ RECOMMEND_MIN 5.0 ++ RECOMMEND_MIN_REASON "for stability and thread safety") ++endif() + + # For HEIF/HEIC/AVIF formats +-checked_find_package (Libheif VERSION_MIN 1.3 +- RECOMMEND_MIN 1.16 +- RECOMMEND_MIN_REASON "for orientation support") +-if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) +- message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") +- set (Libheif_FOUND 0) +-endif () ++if (USE_LIBHEIF) ++ checked_find_package (libheif REQUIRED VERSION_MIN 1.3 ++ RECOMMEND_MIN 1.7 ++ RECOMMEND_MIN_REASON "for AVIF support") ++endif() + +-checked_find_package (LibRaw +- VERSION_MIN 0.18 +- PRINT LibRaw_r_LIBRARIES) +-if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) +- message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") +- # Currently, we issue the above warning and let them take their chances. +- # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, +- # just uncomment the following two lines. +- # set (LibRaw_FOUND 0) +- # set (LIBRAW_FOUND 0) +-endif () ++if (USE_LIBRAW) ++ checked_find_package (LibRaw REQUIRED ++ RECOMMEND_MIN 0.18 ++ RECOMMEND_MIN_REASON "for ACES support and better camera metadata" ++ PRINT LibRaw_r_LIBRARIES) ++endif() + +-checked_find_package (OpenJPEG VERSION_MIN 2.0 +- RECOMMEND_MIN 2.2 +- RECOMMEND_MIN_REASON "for multithreading support") +-# Note: Recent OpenJPEG versions have exported cmake configs, but we don't +-# find them reliable at all, so we stick to our FindOpenJPEG.cmake module. +- +-checked_find_package (OpenVDB +- VERSION_MIN 5.0 +- DEPS TBB +- DEFINITIONS -DUSE_OPENVDB=1) +-if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) +- message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") +- set (OpenVDB_FOUND 0) +- add_compile_definitions(DISABLE_OPENVDB=1) +-endif () ++if (USE_OPENJPEG) ++ checked_find_package (OpenJPEG REQUIRED ++ VERSION_MIN 2.0 ++ RECOMMEND_MIN 2.2 ++ RECOMMEND_MIN_REASON "for multithreading support") ++ # Note: Recent OpenJPEG versions have exported cmake configs, but we don't ++ # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. ++endif() + +-checked_find_package (Ptex PREFER_CONFIG) +-if (NOT Ptex_FOUND OR NOT Ptex_VERSION) +- # Fallback for inadequate Ptex exported configs. This will eventually +- # disappear when we can 100% trust Ptex's exports. +- unset (Ptex_FOUND) +- checked_find_package (Ptex) +-endif () ++if (USE_OPENVDB) ++ checked_find_package (OpenVDB REQUIRED ++ VERSION_MIN 5.0 ++ DEPS TBB ++ DEFINITIONS -DUSE_OPENVDB=1) ++ # Upstream contains a version check to ensure that CXX 17 or newer is used with ++ # OpenVDB >= 10.1. This is ensured by the conanfile for openvdb ++endif() + +-checked_find_package (WebP) +-# Note: When WebP 1.1 (released late 2019) is our minimum, we can use their +-# exported configs and remove our FindWebP.cmake module. ++if (USE_PTEX) ++ checked_find_package (ptex REQUIRED PREFER_CONFIG) ++endif() ++ ++if (USE_LIBWEBP) ++ checked_find_package (WebP REQUIRED) ++endif() + + option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) +-checked_find_package (R3DSDK NO_RECORD_NOTFOUND) # RED camera ++if (USE_R3DSDK) ++ checked_find_package (R3DSDK REQUIRED) # RED camera ++endif () + + set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") +-checked_find_package (Nuke NO_RECORD_NOTFOUND) ++if (USE_NUKE) ++ checked_find_package (Nuke REQUIRED) ++endif () + + + # Qt -- used for iv + option (USE_QT "Use Qt if found" ON) +-if (USE_QT) +- checked_find_package (OpenGL) # used for iv ++if (USE_OPENGL) ++ checked_find_package (OpenGL REQUIRED) # used for iv + endif () +-if (USE_QT AND OPENGL_FOUND) ++if (USE_QT AND USE_OPENGL) + checked_find_package (Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets) + if (NOT Qt6_FOUND) + checked_find_package (Qt5 COMPONENTS Core Gui Widgets OpenGL) +@@ -298,13 +298,13 @@ macro (find_or_download_robin_map) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_ROBINMAP_FORCE) +- find_package (Robinmap QUIET) ++ find_package (tsl-robin-map REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then + # download and build it. + # Download the headers from github +- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) ++ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) + message (STATUS "Downloading local Tessil/robin-map") + set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") + set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") +@@ -322,7 +322,7 @@ macro (find_or_download_robin_map) + endif () + set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") + endif () +- checked_find_package (Robinmap REQUIRED) ++ checked_find_package (tsl-robin-map REQUIRED) + endmacro() + + find_or_download_robin_map () +@@ -341,7 +341,7 @@ macro (find_or_download_fmt) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_FMT_FORCE) +- find_package (fmt QUIET) ++ find_package (fmt REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then +@@ -376,7 +376,7 @@ macro (find_or_download_fmt) + set (fmt_VERSION "${FMT_VERSION_MAJOR}.${FMT_VERSION_MINOR}.${FMT_VERSION_PATCH}") + list (APPEND CFP_ALL_BUILD_DEPS_FOUND "${pkgname} ${${pkgname}_VERSION}") + else () +- get_target_property(FMT_INCLUDE_DIR fmt::fmt-header-only INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(FMT_INCLUDE_DIR fmt::fmt INTERFACE_INCLUDE_DIRECTORIES) + set (OIIO_USING_FMT_LOCAL FALSE) + checked_find_package (fmt REQUIRED + VERSION_MIN 7.0) +diff --git src/ffmpeg.imageio/CMakeLists.txt src/ffmpeg.imageio/CMakeLists.txt +index 8e47a8443..900d23101 100644 +--- src/ffmpeg.imageio/CMakeLists.txt ++++ src/ffmpeg.imageio/CMakeLists.txt +@@ -2,7 +2,7 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (FFmpeg_FOUND) ++if (USE_FFMPEG) + if (LINKSTATIC) + set (_static_suffixes .lib .a) + set (_static_libraries_found 0) +@@ -26,11 +26,9 @@ if (FFmpeg_FOUND) + endif() + + add_oiio_plugin (ffmpeginput.cpp +- INCLUDE_DIRS ${FFMPEG_INCLUDES} +- LINK_LIBRARIES ${FFMPEG_LIBRARIES} +- ${BZIP2_LIBRARIES} ++ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale + DEFINITIONS "-DUSE_FFMPEG" +- "-DOIIO_FFMPEG_VERSION=\"${FFMPEG_VERSION}\"") ++ "-DOIIO_FFMPEG_VERSION=\"${ffmpeg_VERSION}\"") + else() + message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") + endif() +diff --git src/heif.imageio/CMakeLists.txt src/heif.imageio/CMakeLists.txt +index 5b6c30a85..e5bc55ef1 100644 +--- src/heif.imageio/CMakeLists.txt ++++ src/heif.imageio/CMakeLists.txt +@@ -2,32 +2,31 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Libheif_FOUND) +- if (LINKSTATIC) +- set (_static_suffixes .lib .a) +- set (_static_libraries_found 0) ++if (USE_LIBHEIF) ++ # if (LINKSTATIC) ++ # set (_static_suffixes .lib .a) ++ # set (_static_libraries_found 0) + +- foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) +- get_filename_component (_ext ${_libeheif_library} LAST_EXT) +- list (FIND _static_suffixes ${_ext} _index) +- if (${_index} GREATER -1) +- MATH (EXPR _static_libraries_found "${static_libraries_found}+1") +- endif() +- endforeach() ++ # foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) ++ # get_filename_component (_ext ${_libeheif_library} LAST_EXT) ++ # list (FIND _static_suffixes ${_ext} _index) ++ # if (${_index} GREATER -1) ++ # MATH (EXPR _static_libraries_found "${static_libraries_found}+1") ++ # endif() ++ # endforeach() + +- if (${_static_libraries_found} GREATER 0) +- message (STATUS "${ColorYellow}") +- message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") +- message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") +- message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") +- message (STATUS "dynamically-linked libheif.") +- message ("${ColorReset}") +- endif() +- endif() ++ # if (${_static_libraries_found} GREATER 0) ++ # message (STATUS "${ColorYellow}") ++ # message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") ++ # message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") ++ # message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") ++ # message (STATUS "dynamically-linked libheif.") ++ # message ("${ColorReset}") ++ # endif() ++ # endif() + + add_oiio_plugin (heifinput.cpp heifoutput.cpp +- INCLUDE_DIRS ${LIBHEIF_INCLUDES} +- LINK_LIBRARIES ${LIBHEIF_LIBRARIES} ++ LINK_LIBRARIES libheif::heif + DEFINITIONS "-DUSE_HEIF=1") + else () + message (WARNING "heif plugin will not be built") +diff --git src/include/CMakeLists.txt src/include/CMakeLists.txt +index 18b7632a3..c558c4780 100644 +--- src/include/CMakeLists.txt ++++ src/include/CMakeLists.txt +@@ -64,7 +64,8 @@ install (FILES ${detail_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail + COMPONENT developer) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) ++if (0) # Don't try to copy fmt libraries to target install folder ++ set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") + set (fmt_headers_base_names) + foreach (header_name core.h format-inl.h format.h ostream.h printf.h + std.h base.h chrono.h) +diff --git src/jpeg2000.imageio/CMakeLists.txt src/jpeg2000.imageio/CMakeLists.txt +index 560e8d486..24348fe66 100644 +--- src/jpeg2000.imageio/CMakeLists.txt ++++ src/jpeg2000.imageio/CMakeLists.txt +@@ -2,10 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (OPENJPEG_FOUND) ++if (USE_OPENJPEG) + add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp +- INCLUDE_DIRS ${OPENJPEG_INCLUDES} +- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} ++ LINK_LIBRARIES openjp2 + DEFINITIONS "-DUSE_OPENJPEG") + else() + message (WARNING "Jpeg-2000 plugin will not be built") +diff --git src/libOpenImageIO/CMakeLists.txt src/libOpenImageIO/CMakeLists.txt +index aeb7b7f93..9a32e4cf2 100644 +--- src/libOpenImageIO/CMakeLists.txt ++++ src/libOpenImageIO/CMakeLists.txt +@@ -154,19 +154,27 @@ target_link_libraries (OpenImageIO + ${OPENIMAGEIO_IMATH_TARGETS} + PRIVATE + ${OPENIMAGEIO_OPENEXR_TARGETS} +- ${OpenCV_LIBRARIES} + ${format_plugin_libs} # Add all the target link libraries from the plugins + $ + $ + $ + $ +- $ + ${BZIP2_LIBRARIES} + ZLIB::ZLIB +- $ ++ tsl::robin_map ++ Boost::filesystem Boost::thread Boost::system Boost::container + ${CMAKE_DL_LIBS} + ) + ++if (USE_OPENCV) ++ target_link_libraries (OpenImageIO PRIVATE opencv::opencv_core ++ opencv::opencv_imgproc ++ opencv::opencv_videoio) ++endif () ++if (USE_FREETYPE) ++ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) ++endif() ++ + if (WIN32) + target_link_libraries (OpenImageIO PRIVATE psapi) + endif() +diff --git src/libutil/CMakeLists.txt src/libutil/CMakeLists.txt +index f873b3eed..cf5d4e74c 100644 +--- src/libutil/CMakeLists.txt ++++ src/libutil/CMakeLists.txt +@@ -20,20 +20,13 @@ target_link_libraries (OpenImageIO_Util + ${GCC_ATOMIC_LIBRARIES} + ${OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY} + ${OPENIMAGEIO_IMATH_TARGETS} ++ fmt::fmt + PRIVATE +- $ +- $ ++ Boost::filesystem Boost::thread Boost::system + $ + ${CMAKE_DL_LIBS} + ) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) +- add_dependencies(OpenImageIO_Util fmt_internal_target) +-else () +- target_link_libraries (OpenImageIO_Util +- PUBLIC fmt::fmt-header-only) +-endif () +- + if (WIN32) + add_definitions(-DWIN32_LEAN_AND_MEAN -DNOMINMAX -DNOGDI -DVC_EXTRALEAN) + target_link_libraries (OpenImageIO_Util PRIVATE psapi) +diff --git src/ptex.imageio/CMakeLists.txt src/ptex.imageio/CMakeLists.txt +index 16634fedb..82060ac29 100644 +--- src/ptex.imageio/CMakeLists.txt ++++ src/ptex.imageio/CMakeLists.txt +@@ -2,12 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Ptex_FOUND) +- set(ptex_target Ptex::Ptex_dynamic) +- if (TARGET Ptex::Ptex_static AND (NOT TARGET Ptex::Ptex_dynamic OR LINKSTATIC)) +- set(ptex_target Ptex::Ptex_static) +- endif() ++if (USE_PTEX) + add_oiio_plugin (ptexinput.cpp +- LINK_LIBRARIES ${ptex_target} ZLIB::ZLIB ++ LINK_LIBRARIES ${ptex_LIBRARIES} ZLIB::ZLIB ++ INCLUDE_DIRS ${ptex_INCLUDE_DIRS} + DEFINITIONS "-DUSE_PTEX") + endif () diff --git a/recipes/openimageio/all/patches/2.5.17.0-cmake-targets.patch b/recipes/openimageio/all/patches/2.5.17.0-cmake-targets.patch new file mode 100644 index 0000000000000..4b94fb40e8398 --- /dev/null +++ b/recipes/openimageio/all/patches/2.5.17.0-cmake-targets.patch @@ -0,0 +1,540 @@ +diff --git CMakeLists.txt CMakeLists.txt +index d99dd79ac..bfda2778a 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -156,7 +156,7 @@ endif () + add_definitions (-DOIIO_INTERNAL=1) + + list (APPEND CMAKE_MODULE_PATH +- "${PROJECT_SOURCE_DIR}/src/cmake/modules" ++ #"${PROJECT_SOURCE_DIR}/src/cmake/modules" + "${PROJECT_SOURCE_DIR}/src/cmake") + + include (GNUInstallDirs) +@@ -235,7 +235,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) + add_subdirectory (src/iinfo) + add_subdirectory (src/maketx) + add_subdirectory (src/oiiotool) +- add_subdirectory (src/testtex) ++ #add_subdirectory (src/testtex) + add_subdirectory (src/iv) + endif () + +diff --git src/cmake/externalpackages.cmake src/cmake/externalpackages.cmake +index 6556cd2eb..b9c4cd958 100644 +--- src/cmake/externalpackages.cmake ++++ src/cmake/externalpackages.cmake +@@ -48,14 +48,15 @@ if (NOT DEFINED Boost_USE_STATIC_LIBS) + set (Boost_USE_STATIC_LIBS "${LINKSTATIC}") + endif () + +-if (MSVC) +- # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: +- if (NOT Boost_USE_STATIC_LIBS) +- add_definitions (-DBOOST_ALL_DYN_LINK=1) +- endif () +-endif () ++# if (MSVC) ++# # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: ++# if (NOT Boost_USE_STATIC_LIBS) ++# add_definitions (-DBOOST_ALL_DYN_LINK=1) ++# endif () ++# endif () + + set (Boost_COMPONENTS thread) ++# set (Boost_COMPONENTS filesystem system thread container) + if (NOT USE_STD_FILESYSTEM) + list (APPEND Boost_COMPONENTS filesystem) + endif () +@@ -111,9 +112,9 @@ checked_find_package (OpenEXR REQUIRED + # building against Imath/OpenEXR 3.x when there is still a system-level + # install version of 2.x. + include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) +-if (MSVC AND NOT LINKSTATIC) +- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? +-endif () ++# if (MSVC AND NOT LINKSTATIC) ++# add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? ++# endif () + if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.0) + set (OIIO_USING_IMATH 3) + else () +@@ -140,17 +141,21 @@ set (OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH OFF CACHE BOOL + "Exclude find_dependency(Imath) from the exported OpenImageIOConfig.cmake") + + # JPEG -- prefer JPEG-Turbo to regular libjpeg +-checked_find_package (libjpeg-turbo +- VERSION_MIN 2.1 +- DEFINITIONS -DUSE_JPEG_TURBO=1) +-if (NOT TARGET libjpeg-turbo::jpeg) # Try to find the non-turbo version ++if (USE_JPEGTURBO) ++ checked_find_package (libjpeg-turbo REQUIRED ++ DEFINITIONS -DUSE_JPEG_TURBO=1 ++ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) ++ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) ++elseif (USE_JPEG) # Try to find the non-turbo version + checked_find_package (JPEG REQUIRED) ++else () ++ message(FATAL_ERROR "JPEG library was not found!") + endif () + + # Pugixml setup. Normally we just use the version bundled with oiio, but + # some linux distros are quite particular about having separate packages so we + # allow this to be overridden to use the distro-provided package if desired. +-option (USE_EXTERNAL_PUGIXML "Use an externally built shared library version of the pugixml library" OFF) ++option (USE_EXTERNAL_PUGIXML "Use an externally built shared library version of the pugixml library" ON) + if (USE_EXTERNAL_PUGIXML) + checked_find_package (pugixml REQUIRED + VERSION_MIN 1.8 +@@ -160,7 +165,7 @@ else () + endif() + + # From pythonutils.cmake +-find_python() ++#find_python() + if (USE_PYTHON) + checked_find_package (pybind11 REQUIRED VERSION_MIN 2.4.2) + endif () +@@ -170,15 +175,21 @@ endif () + # Dependencies for optional formats and features. If these are not found, + # we will continue building, but the related functionality will be disabled. + +-checked_find_package (PNG) ++if (USE_LIBPNG) ++ checked_find_package (PNG REQUIRED) ++endif() + +-checked_find_package (Freetype +- DEFINITIONS -DUSE_FREETYPE=1 ) ++if (USE_FREETYPE) ++ checked_find_package (Freetype REQUIRED ++ DEFINITIONS -DUSE_FREETYPE=1 ) ++endif() + +-checked_find_package (OpenColorIO +- DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 +- # PREFER_CONFIG +- ) ++if (USE_OPENCOLORIO) ++ checked_find_package (OpenColorIO REQUIRED ++ DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 ++ # PREFER_CONFIG ++ ) ++endif() + if (OpenColorIO_FOUND) + option (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS + "For deveoper debugging/testing ONLY! Disable OCIO 2.2 builtin configs." OFF) +@@ -189,79 +200,104 @@ else () + set (OpenColorIO_FOUND 0) + endif () + +-checked_find_package (OpenCV 3.0 +- DEFINITIONS -DUSE_OPENCV=1) ++if (USE_OPENCV) ++ checked_find_package (OpenCV REQUIRED 3.0 ++ DEFINITIONS -DUSE_OPENCV=1) ++endif() + + # Intel TBB +-set (TBB_USE_DEBUG_BUILD OFF) +-checked_find_package (TBB 2017 +- SETVARIABLES OIIO_TBB +- PREFER_CONFIG) ++if (USE_TBB) ++ set (TBB_USE_DEBUG_BUILD OFF) ++ checked_find_package (TBB 2017 REQUIRED ++ SETVARIABLES OIIO_TBB ++ PREFER_CONFIG) ++endif() + + # DCMTK is used to read DICOM images +-checked_find_package (DCMTK VERSION_MIN 3.6.1 +- PREFER_CONFIG) ++if (USE_DCMTK) ++ checked_find_package (DCMTK REQUIRED VERSION_MIN 3.6.1 ++ PREFER_CONFIG) ++endif() + +-checked_find_package (FFmpeg VERSION_MIN 3.0) +-checked_find_package (GIF +- VERSION_MIN 4 +- RECOMMEND_MIN 5.0 +- RECOMMEND_MIN_REASON "for stability and thread safety") ++if (USE_FFMPEG) ++ checked_find_package (ffmpeg REQUIRED VERSION_MIN 3.0) ++endif() ++if (USE_GIF) ++ checked_find_package (GIF REQUIRED ++ VERSION_MIN 4 ++ RECOMMEND_MIN 5.0 ++ RECOMMEND_MIN_REASON "for stability and thread safety") ++endif() + + # For HEIF/HEIC/AVIF formats +-checked_find_package (Libheif VERSION_MIN 1.3 +- RECOMMEND_MIN 1.16 +- RECOMMEND_MIN_REASON "for orientation support") +-if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) +- message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") +- set (Libheif_FOUND 0) ++if (USE_LIBHEIF) ++ checked_find_package (libheif REQUIRED VERSION_MIN 1.3 ++ RECOMMEND_MIN 1.16 ++ RECOMMEND_MIN_REASON "for orientation support") ++ #if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) ++ # message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") ++ # set (Libheif_FOUND 0) + endif () + +-checked_find_package (LibRaw +- VERSION_MIN 0.18 +- PRINT LibRaw_r_LIBRARIES) +-if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) +- message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") +- # Currently, we issue the above warning and let them take their chances. +- # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, +- # just uncomment the following two lines. +- # set (LibRaw_FOUND 0) +- # set (LIBRAW_FOUND 0) +-endif () ++if (USE_LIBRAW) ++ checked_find_package (LibRaw REQUIRED ++ VERSION_MIN 0.18 ++ PRINT LibRaw_r_LIBRARIES) ++endif() ++#if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) ++# message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") ++# # Currently, we issue the above warning and let them take their chances. ++# # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, ++# # just uncomment the following two lines. ++# # set (LibRaw_FOUND 0) ++# # set (LIBRAW_FOUND 0) ++#endif () ++ ++if (USE_OPENJPEG) ++ checked_find_package (OpenJPEG REQUIRED VERSION_MIN 2.0 ++ RECOMMEND_MIN 2.2 ++ RECOMMEND_MIN_REASON "for multithreading support") ++ # Note: Recent OpenJPEG versions have exported cmake configs, but we don't ++ # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. ++endif() + +-checked_find_package (OpenJPEG VERSION_MIN 2.0 +- RECOMMEND_MIN 2.2 +- RECOMMEND_MIN_REASON "for multithreading support") +-# Note: Recent OpenJPEG versions have exported cmake configs, but we don't +-# find them reliable at all, so we stick to our FindOpenJPEG.cmake module. +- +-checked_find_package (OpenVDB +- VERSION_MIN 5.0 +- DEPS TBB +- DEFINITIONS -DUSE_OPENVDB=1) +-if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) +- message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") +- set (OpenVDB_FOUND 0) +- add_compile_definitions(DISABLE_OPENVDB=1) +-endif () ++if (USE_OPENVDB) ++ checked_find_package (OpenVDB REQUIRED ++ VERSION_MIN 5.0 ++ DEPS TBB ++ DEFINITIONS -DUSE_OPENVDB=1) ++ #if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) ++ # message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") ++ # set (OpenVDB_FOUND 0) ++ # add_compile_definitions(DISABLE_OPENVDB=1) ++ #endif () ++endif() + +-checked_find_package (Ptex PREFER_CONFIG) +-if (NOT Ptex_FOUND OR NOT Ptex_VERSION) +- # Fallback for inadequate Ptex exported configs. This will eventually +- # disappear when we can 100% trust Ptex's exports. +- unset (Ptex_FOUND) +- checked_find_package (Ptex) +-endif () ++if (USE_PTEX) ++ checked_find_package (ptex REQUIRED PREFER_CONFIG) ++ # if (NOT Ptex_FOUND OR NOT Ptex_VERSION) ++ # # Fallback for inadequate Ptex exported configs. This will eventually ++ # # disappear when we can 100% trust Ptex's exports. ++ # unset (Ptex_FOUND) ++ # checked_find_package (Ptex) ++ # endif () ++endif() + +-checked_find_package (WebP) +-# Note: When WebP 1.1 (released late 2019) is our minimum, we can use their +-# exported configs and remove our FindWebP.cmake module. ++if (USE_LIBWEBP) ++ checked_find_package (WebP REQUIRED) ++ # Note: When WebP 1.1 (released late 2019) is our minimum, we can use their ++ # exported configs and remove our FindWebP.cmake module. ++endif() + + option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) +-checked_find_package (R3DSDK NO_RECORD_NOTFOUND) # RED camera ++if (USE_R3DSDK) ++ checked_find_package (R3DSDK NO_RECORD_NOTFOUND) # RED camera ++endif() + + set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") +-checked_find_package (Nuke NO_RECORD_NOTFOUND) ++if (USE_NUKE) ++ checked_find_package (Nuke NO_RECORD_NOTFOUND) ++endif() + + if (FFmpeg_FOUND OR FREETYPE_FOUND) + checked_find_package (BZip2) # Used by ffmpeg and freetype +@@ -273,8 +309,8 @@ endif() + + # Qt -- used for iv + option (USE_QT "Use Qt if found" ON) +-if (USE_QT) +- checked_find_package (OpenGL) # used for iv ++if (USE_OPENGL) ++ checked_find_package (OpenGL REQUIRED) # used for iv + endif () + if (USE_QT AND OPENGL_FOUND) + checked_find_package (Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets) +@@ -300,13 +336,13 @@ macro (find_or_download_robin_map) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_ROBINMAP_FORCE) +- find_package (Robinmap QUIET) ++ find_package (tsl-robin-map REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then + # download and build it. + # Download the headers from github +- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) ++ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) + message (STATUS "Downloading local Tessil/robin-map") + set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") + set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") +@@ -324,7 +360,7 @@ macro (find_or_download_robin_map) + endif () + set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") + endif () +- checked_find_package (Robinmap REQUIRED) ++ checked_find_package (tsl-robin-map REQUIRED) + endmacro() + + find_or_download_robin_map () +@@ -343,7 +379,7 @@ macro (find_or_download_fmt) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_FMT_FORCE) +- find_package (fmt QUIET) ++ find_package (fmt REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then +@@ -378,7 +414,7 @@ macro (find_or_download_fmt) + set (fmt_VERSION "${FMT_VERSION_MAJOR}.${FMT_VERSION_MINOR}.${FMT_VERSION_PATCH}") + list (APPEND CFP_ALL_BUILD_DEPS_FOUND "${pkgname} ${${pkgname}_VERSION}") + else () +- get_target_property(FMT_INCLUDE_DIR fmt::fmt-header-only INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(FMT_INCLUDE_DIR fmt::fmt INTERFACE_INCLUDE_DIRECTORIES) + set (OIIO_USING_FMT_LOCAL FALSE) + checked_find_package (fmt REQUIRED + VERSION_MIN 7.0) +diff --git src/ffmpeg.imageio/CMakeLists.txt src/ffmpeg.imageio/CMakeLists.txt +index 8e47a8443..900d23101 100644 +--- src/ffmpeg.imageio/CMakeLists.txt ++++ src/ffmpeg.imageio/CMakeLists.txt +@@ -2,7 +2,7 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (FFmpeg_FOUND) ++if (USE_FFMPEG) + if (LINKSTATIC) + set (_static_suffixes .lib .a) + set (_static_libraries_found 0) +@@ -26,11 +26,9 @@ if (FFmpeg_FOUND) + endif() + + add_oiio_plugin (ffmpeginput.cpp +- INCLUDE_DIRS ${FFMPEG_INCLUDES} +- LINK_LIBRARIES ${FFMPEG_LIBRARIES} +- ${BZIP2_LIBRARIES} ++ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale + DEFINITIONS "-DUSE_FFMPEG" +- "-DOIIO_FFMPEG_VERSION=\"${FFMPEG_VERSION}\"") ++ "-DOIIO_FFMPEG_VERSION=\"${ffmpeg_VERSION}\"") + else() + message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") + endif() +diff --git src/heif.imageio/CMakeLists.txt src/heif.imageio/CMakeLists.txt +index 5b6c30a85..e5bc55ef1 100644 +--- src/heif.imageio/CMakeLists.txt ++++ src/heif.imageio/CMakeLists.txt +@@ -2,32 +2,31 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Libheif_FOUND) +- if (LINKSTATIC) +- set (_static_suffixes .lib .a) +- set (_static_libraries_found 0) ++if (USE_LIBHEIF) ++ # if (LINKSTATIC) ++ # set (_static_suffixes .lib .a) ++ # set (_static_libraries_found 0) + +- foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) +- get_filename_component (_ext ${_libeheif_library} LAST_EXT) +- list (FIND _static_suffixes ${_ext} _index) +- if (${_index} GREATER -1) +- MATH (EXPR _static_libraries_found "${static_libraries_found}+1") +- endif() +- endforeach() ++ # foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) ++ # get_filename_component (_ext ${_libeheif_library} LAST_EXT) ++ # list (FIND _static_suffixes ${_ext} _index) ++ # if (${_index} GREATER -1) ++ # MATH (EXPR _static_libraries_found "${static_libraries_found}+1") ++ # endif() ++ # endforeach() + +- if (${_static_libraries_found} GREATER 0) +- message (STATUS "${ColorYellow}") +- message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") +- message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") +- message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") +- message (STATUS "dynamically-linked libheif.") +- message ("${ColorReset}") +- endif() +- endif() ++ # if (${_static_libraries_found} GREATER 0) ++ # message (STATUS "${ColorYellow}") ++ # message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") ++ # message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") ++ # message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") ++ # message (STATUS "dynamically-linked libheif.") ++ # message ("${ColorReset}") ++ # endif() ++ # endif() + + add_oiio_plugin (heifinput.cpp heifoutput.cpp +- INCLUDE_DIRS ${LIBHEIF_INCLUDES} +- LINK_LIBRARIES ${LIBHEIF_LIBRARIES} ++ LINK_LIBRARIES libheif::heif + DEFINITIONS "-DUSE_HEIF=1") + else () + message (WARNING "heif plugin will not be built") +diff --git src/include/CMakeLists.txt src/include/CMakeLists.txt +index 18b7632a3..c558c4780 100644 +--- src/include/CMakeLists.txt ++++ src/include/CMakeLists.txt +@@ -64,7 +64,8 @@ install (FILES ${detail_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail + COMPONENT developer) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) ++if (0) # Don't try to copy fmt libraries to target install folder ++ set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") + set (fmt_headers_base_names) + foreach (header_name core.h format-inl.h format.h ostream.h printf.h + std.h base.h chrono.h) +diff --git src/jpeg2000.imageio/CMakeLists.txt src/jpeg2000.imageio/CMakeLists.txt +index 560e8d486..24348fe66 100644 +--- src/jpeg2000.imageio/CMakeLists.txt ++++ src/jpeg2000.imageio/CMakeLists.txt +@@ -2,10 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (OPENJPEG_FOUND) ++if (USE_OPENJPEG) + add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp +- INCLUDE_DIRS ${OPENJPEG_INCLUDES} +- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} ++ LINK_LIBRARIES openjp2 + DEFINITIONS "-DUSE_OPENJPEG") + else() + message (WARNING "Jpeg-2000 plugin will not be built") +diff --git src/libOpenImageIO/CMakeLists.txt src/libOpenImageIO/CMakeLists.txt +index aeb7b7f93..9a32e4cf2 100644 +--- src/libOpenImageIO/CMakeLists.txt ++++ src/libOpenImageIO/CMakeLists.txt +@@ -154,19 +154,27 @@ target_link_libraries (OpenImageIO + ${OPENIMAGEIO_IMATH_TARGETS} + PRIVATE + ${OPENIMAGEIO_OPENEXR_TARGETS} +- ${OpenCV_LIBRARIES} + ${format_plugin_libs} # Add all the target link libraries from the plugins + $ + $ + $ + $ +- $ + ${BZIP2_LIBRARIES} + ZLIB::ZLIB +- $ ++ tsl::robin_map ++ Boost::filesystem Boost::thread Boost::system Boost::container + ${CMAKE_DL_LIBS} + ) + ++if (USE_OPENCV) ++ target_link_libraries (OpenImageIO PRIVATE opencv::opencv_core ++ opencv::opencv_imgproc ++ opencv::opencv_videoio) ++endif () ++if (USE_FREETYPE) ++ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) ++endif() ++ + if (WIN32) + target_link_libraries (OpenImageIO PRIVATE psapi) + endif() +diff --git src/libutil/CMakeLists.txt src/libutil/CMakeLists.txt +index f873b3eed..cf5d4e74c 100644 +--- src/libutil/CMakeLists.txt ++++ src/libutil/CMakeLists.txt +@@ -20,20 +20,13 @@ target_link_libraries (OpenImageIO_Util + ${GCC_ATOMIC_LIBRARIES} + ${OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY} + ${OPENIMAGEIO_IMATH_TARGETS} ++ fmt::fmt + PRIVATE +- $ +- $ ++ Boost::filesystem Boost::thread Boost::system + $ + ${CMAKE_DL_LIBS} + ) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) +- add_dependencies(OpenImageIO_Util fmt_internal_target) +-else () +- target_link_libraries (OpenImageIO_Util +- PUBLIC fmt::fmt-header-only) +-endif () +- + if (WIN32) + add_definitions(-DWIN32_LEAN_AND_MEAN -DNOMINMAX -DNOGDI -DVC_EXTRALEAN) + target_link_libraries (OpenImageIO_Util PRIVATE psapi) +diff --git src/ptex.imageio/CMakeLists.txt src/ptex.imageio/CMakeLists.txt +index 16634fedb..82060ac29 100644 +--- src/ptex.imageio/CMakeLists.txt ++++ src/ptex.imageio/CMakeLists.txt +@@ -2,12 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Ptex_FOUND) +- set(ptex_target Ptex::Ptex_dynamic) +- if (TARGET Ptex::Ptex_static AND (NOT TARGET Ptex::Ptex_dynamic OR LINKSTATIC)) +- set(ptex_target Ptex::Ptex_static) +- endif() ++if (USE_PTEX) + add_oiio_plugin (ptexinput.cpp +- LINK_LIBRARIES ${ptex_target} ZLIB::ZLIB ++ LINK_LIBRARIES ${ptex_LIBRARIES} ZLIB::ZLIB ++ INCLUDE_DIRS ${ptex_INCLUDE_DIRS} + DEFINITIONS "-DUSE_PTEX") + endif () diff --git a/recipes/openimageio/all/patches/2.5.18.0-cmake-targets.patch b/recipes/openimageio/all/patches/2.5.18.0-cmake-targets.patch new file mode 100644 index 0000000000000..a18a519321d7c --- /dev/null +++ b/recipes/openimageio/all/patches/2.5.18.0-cmake-targets.patch @@ -0,0 +1,540 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 68b553df5..b44c36b45 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -156,7 +156,7 @@ endif () + add_definitions (-DOIIO_INTERNAL=1) + + list (APPEND CMAKE_MODULE_PATH +- "${PROJECT_SOURCE_DIR}/src/cmake/modules" ++ #"${PROJECT_SOURCE_DIR}/src/cmake/modules" + "${PROJECT_SOURCE_DIR}/src/cmake") + + include (GNUInstallDirs) +@@ -235,7 +235,7 @@ if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY) + add_subdirectory (src/iinfo) + add_subdirectory (src/maketx) + add_subdirectory (src/oiiotool) +- add_subdirectory (src/testtex) ++ #add_subdirectory (src/testtex) + add_subdirectory (src/iv) + endif () + +diff --git src/cmake/externalpackages.cmake src/cmake/externalpackages.cmake +index 6556cd2eb..b9c4cd958 100644 +--- src/cmake/externalpackages.cmake ++++ src/cmake/externalpackages.cmake +@@ -48,14 +48,15 @@ if (NOT DEFINED Boost_USE_STATIC_LIBS) + set (Boost_USE_STATIC_LIBS "${LINKSTATIC}") + endif () + +-if (MSVC) +- # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: +- if (NOT Boost_USE_STATIC_LIBS) +- add_definitions (-DBOOST_ALL_DYN_LINK=1) +- endif () +-endif () ++# if (MSVC) ++# # Not linking Boost as static libraries: either an explicit setting or LINKSTATIC is FALSE: ++# if (NOT Boost_USE_STATIC_LIBS) ++# add_definitions (-DBOOST_ALL_DYN_LINK=1) ++# endif () ++# endif () + + set (Boost_COMPONENTS thread) ++# set (Boost_COMPONENTS filesystem system thread container) + if (NOT USE_STD_FILESYSTEM) + list (APPEND Boost_COMPONENTS filesystem) + endif () +@@ -111,9 +112,9 @@ checked_find_package (OpenEXR REQUIRED + # building against Imath/OpenEXR 3.x when there is still a system-level + # install version of 2.x. + include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) +-if (MSVC AND NOT LINKSTATIC) +- add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? +-endif () ++# if (MSVC AND NOT LINKSTATIC) ++# add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? ++# endif () + if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.0) + set (OIIO_USING_IMATH 3) + else () +@@ -140,17 +141,21 @@ set (OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH OFF CACHE BOOL + "Exclude find_dependency(Imath) from the exported OpenImageIOConfig.cmake") + + # JPEG -- prefer JPEG-Turbo to regular libjpeg +-checked_find_package (libjpeg-turbo +- VERSION_MIN 2.1 +- DEFINITIONS -DUSE_JPEG_TURBO=1) +-if (NOT TARGET libjpeg-turbo::jpeg) # Try to find the non-turbo version ++if (USE_JPEGTURBO) ++ checked_find_package (libjpeg-turbo REQUIRED ++ DEFINITIONS -DUSE_JPEG_TURBO=1 ++ PRINT libjpeg-turbo_INCLUDES libjpeg-turbo_LIBRARIES) ++ add_library(JPEG::JPEG ALIAS libjpeg-turbo::libjpeg-turbo) ++elseif (USE_JPEG) # Try to find the non-turbo version + checked_find_package (JPEG REQUIRED) ++else () ++ message(FATAL_ERROR "JPEG library was not found!") + endif () + + # Pugixml setup. Normally we just use the version bundled with oiio, but + # some linux distros are quite particular about having separate packages so we + # allow this to be overridden to use the distro-provided package if desired. +-option (USE_EXTERNAL_PUGIXML "Use an externally built shared library version of the pugixml library" OFF) ++option (USE_EXTERNAL_PUGIXML "Use an externally built shared library version of the pugixml library" ON) + if (USE_EXTERNAL_PUGIXML) + checked_find_package (pugixml REQUIRED + VERSION_MIN 1.8 +@@ -160,7 +165,7 @@ else () + endif() + + # From pythonutils.cmake +-find_python() ++#find_python() + if (USE_PYTHON) + checked_find_package (pybind11 REQUIRED VERSION_MIN 2.4.2) + endif () +@@ -170,15 +175,21 @@ endif () + # Dependencies for optional formats and features. If these are not found, + # we will continue building, but the related functionality will be disabled. + +-checked_find_package (PNG) ++if (USE_LIBPNG) ++ checked_find_package (PNG REQUIRED) ++endif() + +-checked_find_package (Freetype +- DEFINITIONS -DUSE_FREETYPE=1 ) ++if (USE_FREETYPE) ++ checked_find_package (Freetype REQUIRED ++ DEFINITIONS -DUSE_FREETYPE=1 ) ++endif() + +-checked_find_package (OpenColorIO +- DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 +- # PREFER_CONFIG +- ) ++if (USE_OPENCOLORIO) ++ checked_find_package (OpenColorIO REQUIRED ++ DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 ++ # PREFER_CONFIG ++ ) ++endif() + if (OpenColorIO_FOUND) + option (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS + "For deveoper debugging/testing ONLY! Disable OCIO 2.2 builtin configs." OFF) +@@ -189,79 +200,104 @@ else () + set (OpenColorIO_FOUND 0) + endif () + +-checked_find_package (OpenCV 3.0 +- DEFINITIONS -DUSE_OPENCV=1) ++if (USE_OPENCV) ++ checked_find_package (OpenCV REQUIRED 3.0 ++ DEFINITIONS -DUSE_OPENCV=1) ++endif() + + # Intel TBB +-set (TBB_USE_DEBUG_BUILD OFF) +-checked_find_package (TBB 2017 +- SETVARIABLES OIIO_TBB +- PREFER_CONFIG) ++if (USE_TBB) ++ set (TBB_USE_DEBUG_BUILD OFF) ++ checked_find_package (TBB 2017 REQUIRED ++ SETVARIABLES OIIO_TBB ++ PREFER_CONFIG) ++endif() + + # DCMTK is used to read DICOM images +-checked_find_package (DCMTK VERSION_MIN 3.6.1 +- PREFER_CONFIG) ++if (USE_DCMTK) ++ checked_find_package (DCMTK REQUIRED VERSION_MIN 3.6.1 ++ PREFER_CONFIG) ++endif() + +-checked_find_package (FFmpeg VERSION_MIN 3.0) +-checked_find_package (GIF +- VERSION_MIN 4 +- RECOMMEND_MIN 5.0 +- RECOMMEND_MIN_REASON "for stability and thread safety") ++if (USE_FFMPEG) ++ checked_find_package (ffmpeg REQUIRED VERSION_MIN 3.0) ++endif() ++if (USE_GIF) ++ checked_find_package (GIF REQUIRED ++ VERSION_MIN 4 ++ RECOMMEND_MIN 5.0 ++ RECOMMEND_MIN_REASON "for stability and thread safety") ++endif() + + # For HEIF/HEIC/AVIF formats +-checked_find_package (Libheif VERSION_MIN 1.3 +- RECOMMEND_MIN 1.16 +- RECOMMEND_MIN_REASON "for orientation support") +-if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) +- message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") +- set (Libheif_FOUND 0) ++if (USE_LIBHEIF) ++ checked_find_package (libheif REQUIRED VERSION_MIN 1.3 ++ RECOMMEND_MIN 1.16 ++ RECOMMEND_MIN_REASON "for orientation support") ++ #if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) ++ # message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support") ++ # set (Libheif_FOUND 0) + endif () + +-checked_find_package (LibRaw +- VERSION_MIN 0.18 +- PRINT LibRaw_r_LIBRARIES) +-if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) +- message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") +- # Currently, we issue the above warning and let them take their chances. +- # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, +- # just uncomment the following two lines. +- # set (LibRaw_FOUND 0) +- # set (LIBRAW_FOUND 0) +-endif () ++if (USE_LIBRAW) ++ checked_find_package (LibRaw REQUIRED ++ VERSION_MIN 0.18 ++ PRINT LibRaw_r_LIBRARIES) ++endif() ++#if (LibRaw_FOUND AND LibRaw_VERSION VERSION_LESS 0.20 AND CMAKE_CXX_STANDARD VERSION_GREATER_EQUAL 17) ++# message (STATUS "${ColorYellow}WARNING When building for C++17, LibRaw should be 0.20 or higher (found ${LibRaw_VERSION}). You may get errors, depending on the compiler.${ColorReset}") ++# # Currently, we issue the above warning and let them take their chances. ++# # If we wish to disable the LibRaw<0.20/C++17 combination that may fail, ++# # just uncomment the following two lines. ++# # set (LibRaw_FOUND 0) ++# # set (LIBRAW_FOUND 0) ++#endif () ++ ++if (USE_OPENJPEG) ++ checked_find_package (OpenJPEG REQUIRED VERSION_MIN 2.0 ++ RECOMMEND_MIN 2.2 ++ RECOMMEND_MIN_REASON "for multithreading support") ++ # Note: Recent OpenJPEG versions have exported cmake configs, but we don't ++ # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. ++endif() + +-checked_find_package (OpenJPEG VERSION_MIN 2.0 +- RECOMMEND_MIN 2.2 +- RECOMMEND_MIN_REASON "for multithreading support") +-# Note: Recent OpenJPEG versions have exported cmake configs, but we don't +-# find them reliable at all, so we stick to our FindOpenJPEG.cmake module. +- +-checked_find_package (OpenVDB +- VERSION_MIN 5.0 +- DEPS TBB +- DEFINITIONS -DUSE_OPENVDB=1) +-if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) +- message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") +- set (OpenVDB_FOUND 0) +- add_compile_definitions(DISABLE_OPENVDB=1) +-endif () ++if (USE_OPENVDB) ++ checked_find_package (OpenVDB REQUIRED ++ VERSION_MIN 5.0 ++ DEPS TBB ++ DEFINITIONS -DUSE_OPENVDB=1) ++ #if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) ++ # message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") ++ # set (OpenVDB_FOUND 0) ++ # add_compile_definitions(DISABLE_OPENVDB=1) ++ #endif () ++endif() + +-checked_find_package (Ptex PREFER_CONFIG) +-if (NOT Ptex_FOUND OR NOT Ptex_VERSION) +- # Fallback for inadequate Ptex exported configs. This will eventually +- # disappear when we can 100% trust Ptex's exports. +- unset (Ptex_FOUND) +- checked_find_package (Ptex) +-endif () ++if (USE_PTEX) ++ checked_find_package (ptex REQUIRED PREFER_CONFIG) ++ # if (NOT Ptex_FOUND OR NOT Ptex_VERSION) ++ # # Fallback for inadequate Ptex exported configs. This will eventually ++ # # disappear when we can 100% trust Ptex's exports. ++ # unset (Ptex_FOUND) ++ # checked_find_package (Ptex) ++ # endif () ++endif() + +-checked_find_package (WebP) +-# Note: When WebP 1.1 (released late 2019) is our minimum, we can use their +-# exported configs and remove our FindWebP.cmake module. ++if (USE_LIBWEBP) ++ checked_find_package (WebP REQUIRED) ++ # Note: When WebP 1.1 (released late 2019) is our minimum, we can use their ++ # exported configs and remove our FindWebP.cmake module. ++endif() + + option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) +-checked_find_package (R3DSDK NO_RECORD_NOTFOUND) # RED camera ++if (USE_R3DSDK) ++ checked_find_package (R3DSDK NO_RECORD_NOTFOUND) # RED camera ++endif() + + set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target") +-checked_find_package (Nuke NO_RECORD_NOTFOUND) ++if (USE_NUKE) ++ checked_find_package (Nuke NO_RECORD_NOTFOUND) ++endif() + + if (FFmpeg_FOUND OR FREETYPE_FOUND) + checked_find_package (BZip2) # Used by ffmpeg and freetype +@@ -273,8 +309,8 @@ endif() + + # Qt -- used for iv + option (USE_QT "Use Qt if found" ON) +-if (USE_QT) +- checked_find_package (OpenGL) # used for iv ++if (USE_OPENGL) ++ checked_find_package (OpenGL REQUIRED) # used for iv + endif () + if (USE_QT AND OPENGL_FOUND) + checked_find_package (Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets) +@@ -300,13 +336,13 @@ macro (find_or_download_robin_map) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_ROBINMAP_FORCE) +- find_package (Robinmap QUIET) ++ find_package (tsl-robin-map REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then + # download and build it. + # Download the headers from github +- if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE) ++ if ((BUILD_MISSING_ROBINMAP AND NOT tsl-robin-map_FOUND) OR BUILD_ROBINMAP_FORCE) + message (STATUS "Downloading local Tessil/robin-map") + set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map") + set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map") +@@ -324,7 +360,7 @@ macro (find_or_download_robin_map) + endif () + set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include") + endif () +- checked_find_package (Robinmap REQUIRED) ++ checked_find_package (tsl-robin-map REQUIRED) + endmacro() + + find_or_download_robin_map () +@@ -343,7 +379,7 @@ macro (find_or_download_fmt) + # for an installed version. Still prefer a copy that seems to be + # locally installed in this tree. + if (NOT BUILD_FMT_FORCE) +- find_package (fmt QUIET) ++ find_package (fmt REQUIRED) + endif () + # If an external copy wasn't found and we requested that missing + # packages be built, or we we are forcing a local copy to be built, then +@@ -378,7 +414,7 @@ macro (find_or_download_fmt) + set (fmt_VERSION "${FMT_VERSION_MAJOR}.${FMT_VERSION_MINOR}.${FMT_VERSION_PATCH}") + list (APPEND CFP_ALL_BUILD_DEPS_FOUND "${pkgname} ${${pkgname}_VERSION}") + else () +- get_target_property(FMT_INCLUDE_DIR fmt::fmt-header-only INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(FMT_INCLUDE_DIR fmt::fmt INTERFACE_INCLUDE_DIRECTORIES) + set (OIIO_USING_FMT_LOCAL FALSE) + checked_find_package (fmt REQUIRED + VERSION_MIN 7.0) +diff --git src/ffmpeg.imageio/CMakeLists.txt src/ffmpeg.imageio/CMakeLists.txt +index 8e47a8443..900d23101 100644 +--- src/ffmpeg.imageio/CMakeLists.txt ++++ src/ffmpeg.imageio/CMakeLists.txt +@@ -2,7 +2,7 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (FFmpeg_FOUND) ++if (USE_FFMPEG) + if (LINKSTATIC) + set (_static_suffixes .lib .a) + set (_static_libraries_found 0) +@@ -26,11 +26,9 @@ if (FFmpeg_FOUND) + endif() + + add_oiio_plugin (ffmpeginput.cpp +- INCLUDE_DIRS ${FFMPEG_INCLUDES} +- LINK_LIBRARIES ${FFMPEG_LIBRARIES} +- ${BZIP2_LIBRARIES} ++ LINK_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::swscale + DEFINITIONS "-DUSE_FFMPEG" +- "-DOIIO_FFMPEG_VERSION=\"${FFMPEG_VERSION}\"") ++ "-DOIIO_FFMPEG_VERSION=\"${ffmpeg_VERSION}\"") + else() + message (STATUS "FFmpeg not found: ffmpeg plugin will not be built") + endif() +diff --git src/heif.imageio/CMakeLists.txt src/heif.imageio/CMakeLists.txt +index 5b6c30a85..e5bc55ef1 100644 +--- src/heif.imageio/CMakeLists.txt ++++ src/heif.imageio/CMakeLists.txt +@@ -2,32 +2,31 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Libheif_FOUND) +- if (LINKSTATIC) +- set (_static_suffixes .lib .a) +- set (_static_libraries_found 0) ++if (USE_LIBHEIF) ++ # if (LINKSTATIC) ++ # set (_static_suffixes .lib .a) ++ # set (_static_libraries_found 0) + +- foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) +- get_filename_component (_ext ${_libeheif_library} LAST_EXT) +- list (FIND _static_suffixes ${_ext} _index) +- if (${_index} GREATER -1) +- MATH (EXPR _static_libraries_found "${static_libraries_found}+1") +- endif() +- endforeach() ++ # foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) ++ # get_filename_component (_ext ${_libeheif_library} LAST_EXT) ++ # list (FIND _static_suffixes ${_ext} _index) ++ # if (${_index} GREATER -1) ++ # MATH (EXPR _static_libraries_found "${static_libraries_found}+1") ++ # endif() ++ # endforeach() + +- if (${_static_libraries_found} GREATER 0) +- message (STATUS "${ColorYellow}") +- message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") +- message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") +- message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") +- message (STATUS "dynamically-linked libheif.") +- message ("${ColorReset}") +- endif() +- endif() ++ # if (${_static_libraries_found} GREATER 0) ++ # message (STATUS "${ColorYellow}") ++ # message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") ++ # message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") ++ # message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") ++ # message (STATUS "dynamically-linked libheif.") ++ # message ("${ColorReset}") ++ # endif() ++ # endif() + + add_oiio_plugin (heifinput.cpp heifoutput.cpp +- INCLUDE_DIRS ${LIBHEIF_INCLUDES} +- LINK_LIBRARIES ${LIBHEIF_LIBRARIES} ++ LINK_LIBRARIES libheif::heif + DEFINITIONS "-DUSE_HEIF=1") + else () + message (WARNING "heif plugin will not be built") +diff --git src/include/CMakeLists.txt src/include/CMakeLists.txt +index 18b7632a3..c558c4780 100644 +--- src/include/CMakeLists.txt ++++ src/include/CMakeLists.txt +@@ -64,7 +64,8 @@ install (FILES ${detail_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail + COMPONENT developer) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) ++if (0) # Don't try to copy fmt libraries to target install folder ++ set(FMT_INCLUDES "${fmt_INCLUDE_DIR}") + set (fmt_headers_base_names) + foreach (header_name core.h format-inl.h format.h ostream.h printf.h + std.h base.h chrono.h) +diff --git src/jpeg2000.imageio/CMakeLists.txt src/jpeg2000.imageio/CMakeLists.txt +index 560e8d486..24348fe66 100644 +--- src/jpeg2000.imageio/CMakeLists.txt ++++ src/jpeg2000.imageio/CMakeLists.txt +@@ -2,10 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (OPENJPEG_FOUND) ++if (USE_OPENJPEG) + add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp +- INCLUDE_DIRS ${OPENJPEG_INCLUDES} +- LINK_LIBRARIES ${OPENJPEG_LIBRARIES} ++ LINK_LIBRARIES openjp2 + DEFINITIONS "-DUSE_OPENJPEG") + else() + message (WARNING "Jpeg-2000 plugin will not be built") +diff --git src/libOpenImageIO/CMakeLists.txt src/libOpenImageIO/CMakeLists.txt +index 49e76e2d7..b03b49cf5 100644 +--- src/libOpenImageIO/CMakeLists.txt ++++ src/libOpenImageIO/CMakeLists.txt +@@ -156,19 +156,27 @@ target_link_libraries (OpenImageIO + ${OPENIMAGEIO_IMATH_TARGETS} + PRIVATE + ${OPENIMAGEIO_OPENEXR_TARGETS} +- ${OpenCV_LIBRARIES} + ${format_plugin_libs} # Add all the target link libraries from the plugins + $ + $ + $ + $ +- $ + ${BZIP2_LIBRARIES} + ZLIB::ZLIB +- $ ++ tsl::robin_map ++ Boost::filesystem Boost::thread Boost::system Boost::container + ${CMAKE_DL_LIBS} + ) + ++if (USE_OPENCV) ++ target_link_libraries (OpenImageIO PRIVATE opencv::opencv_core ++ opencv::opencv_imgproc ++ opencv::opencv_videoio) ++endif () ++if (USE_FREETYPE) ++ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype) ++endif() ++ + if (WIN32) + target_link_libraries (OpenImageIO PRIVATE psapi) + endif() +diff --git src/libutil/CMakeLists.txt src/libutil/CMakeLists.txt +index f873b3eed..cf5d4e74c 100644 +--- src/libutil/CMakeLists.txt ++++ src/libutil/CMakeLists.txt +@@ -20,20 +20,13 @@ target_link_libraries (OpenImageIO_Util + ${GCC_ATOMIC_LIBRARIES} + ${OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY} + ${OPENIMAGEIO_IMATH_TARGETS} ++ fmt::fmt + PRIVATE +- $ +- $ ++ Boost::filesystem Boost::thread Boost::system + $ + ${CMAKE_DL_LIBS} + ) + +-if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) +- add_dependencies(OpenImageIO_Util fmt_internal_target) +-else () +- target_link_libraries (OpenImageIO_Util +- PUBLIC fmt::fmt-header-only) +-endif () +- + if (WIN32) + add_definitions(-DWIN32_LEAN_AND_MEAN -DNOMINMAX -DNOGDI -DVC_EXTRALEAN) + target_link_libraries (OpenImageIO_Util PRIVATE psapi) +diff --git src/ptex.imageio/CMakeLists.txt src/ptex.imageio/CMakeLists.txt +index 16634fedb..82060ac29 100644 +--- src/ptex.imageio/CMakeLists.txt ++++ src/ptex.imageio/CMakeLists.txt +@@ -2,12 +2,9 @@ + # SPDX-License-Identifier: Apache-2.0 + # https://github.com/AcademySoftwareFoundation/OpenImageIO + +-if (Ptex_FOUND) +- set(ptex_target Ptex::Ptex_dynamic) +- if (TARGET Ptex::Ptex_static AND (NOT TARGET Ptex::Ptex_dynamic OR LINKSTATIC)) +- set(ptex_target Ptex::Ptex_static) +- endif() ++if (USE_PTEX) + add_oiio_plugin (ptexinput.cpp +- LINK_LIBRARIES ${ptex_target} ZLIB::ZLIB ++ LINK_LIBRARIES ${ptex_LIBRARIES} ZLIB::ZLIB ++ INCLUDE_DIRS ${ptex_INCLUDE_DIRS} + DEFINITIONS "-DUSE_PTEX") + endif () diff --git a/recipes/openimageio/all/test_package/CMakeLists.txt b/recipes/openimageio/all/test_package/CMakeLists.txt index 1644784331f87..2b80f5af75658 100644 --- a/recipes/openimageio/all/test_package/CMakeLists.txt +++ b/recipes/openimageio/all/test_package/CMakeLists.txt @@ -1,10 +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(OpenImageIO REQUIRED CONFIG) +find_package(fmt REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} OpenImageIO::OpenImageIO) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenImageIO::OpenImageIO + OpenImageIO::OpenImageIO_Util + fmt::fmt) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/openimageio/all/test_package/conanfile.py b/recipes/openimageio/all/test_package/conanfile.py index d51573f42b4f7..0e93e4a287b11 100644 --- a/recipes/openimageio/all/test_package/conanfile.py +++ b/recipes/openimageio/all/test_package/conanfile.py @@ -1,18 +1,25 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +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 layout(self): + cmake_layout(self) def build(self): - version = tools.Version(self.deps_cpp_info["openimageio"].version) cmake = CMake(self) - cmake.definitions["CMAKE_CXX_STANDARD"] = 14 if version >= "2.3.0.0" else 11 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/openimageio/all/test_v1_package/CMakeLists.txt b/recipes/openimageio/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4f7b705df9ba0 --- /dev/null +++ b/recipes/openimageio/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(OpenImageIO REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} OpenImageIO::OpenImageIO) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/intel-neon2sse/all/test_v1_package/conanfile.py b/recipes/openimageio/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/intel-neon2sse/all/test_v1_package/conanfile.py rename to recipes/openimageio/all/test_v1_package/conanfile.py diff --git a/recipes/openimageio/all/test_v1_package/test_package.cpp b/recipes/openimageio/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..e1594d38c661d --- /dev/null +++ b/recipes/openimageio/all/test_v1_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + std::cout << "OpenImageIO " << OIIO_VERSION_STRING << "\n"; + + std::string formats = OIIO::get_string_attribute("format_list"); + std::cout << "Supported formats:\n" << formats << "\n"; +} diff --git a/recipes/openimageio/config.yml b/recipes/openimageio/config.yml index 3937cac349aec..b9a61eb4e9fb8 100644 --- a/recipes/openimageio/config.yml +++ b/recipes/openimageio/config.yml @@ -1,9 +1,16 @@ versions: - "2.2.7.0": + "2.4.7.1": folder: all - "2.2.18.0": + "2.4.17.0": folder: all - "2.3.7.2": + "2.5.14.0": folder: all - "2.4.7.1": + "2.5.15.0": + folder: all + "2.5.16.0": + folder: all + "2.5.17.0": + folder: all + "2.5.18.0": folder: all + diff --git a/recipes/openjdk/all/conandata.yml b/recipes/openjdk/all/conandata.yml index bb0f8bea50c9b..41ac854b16462 100644 --- a/recipes/openjdk/all/conandata.yml +++ b/recipes/openjdk/all/conandata.yml @@ -1,4 +1,20 @@ sources: + "21.0.2": + Windows: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_windows-x64_bin.zip" + sha256: "b6c17e747ae78cdd6de4d7532b3164b277daee97c007d3eaa2b39cca99882664" + Linux_x86_64: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_linux-x64_bin.tar.gz" + sha256: "960a708e76bffa0864e3e756e03314d56aa9dfb253b0803ae8a35eef2188f475" + Linux_armv8: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_linux-aarch64_bin.tar.gz" + sha256: "0fcd2bdd32de146288635e05a362a24217baf669a3fa8e145ed09c6ad96a8c38" + Macos_x86_64: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_macos-x64_bin.tar.gz" + sha256: "2830aa583a7f1e6ea2673ead18c12a2b1f85e9d5b8d69b116666014b14b81656" + Macos_armv8: + url: "https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/12/GPL/openjdk-21.0.2_macos-aarch64_bin.tar.gz" + sha256: "997e0797f304a423149fd72284e9bcf7782c4a969fcb49ef05dfa7e5e6b6fbd6" "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" diff --git a/recipes/openjdk/all/conanfile.py b/recipes/openjdk/all/conanfile.py index becd2ce7c641c..6e6220a975840 100644 --- a/recipes/openjdk/all/conanfile.py +++ b/recipes/openjdk/all/conanfile.py @@ -16,12 +16,16 @@ class OpenJDK(ConanFile): 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 + upload_policy = "skip" + build_policy = "missing" def package_id(self): del self.info.settings.compiler del self.info.settings.build_type + def configure(self): + self.settings.rm_safe("os.version") + def validate(self): if Version(self.version) < "19.0.2" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Unsupported Architecture. This package currently only supports x86_64.") @@ -33,42 +37,42 @@ def build(self): 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) + destination=self.build_folder, strip_root=True) def package(self): if self.settings.os == "Macos": - source_folder = os.path.join(self.source_folder, f"jdk-{self.version}.jdk", "Contents", "Home") + build_folder = os.path.join(self.build_folder, f"jdk-{self.version}.jdk", "Contents", "Home") else: - source_folder = self.source_folder - symlinks.remove_broken_symlinks(self, source_folder) + build_folder = self.build_folder + symlinks.remove_broken_symlinks(self, build_folder) copy(self, pattern="*", - src=os.path.join(source_folder, "bin"), + src=os.path.join(build_folder, "bin"), dst=os.path.join(self.package_folder, "bin"), excludes=("msvcp140.dll", "vcruntime140.dll", "vcruntime140_1.dll")) copy(self, pattern="*", - src=os.path.join(source_folder, "include"), + src=os.path.join(build_folder, "include"), dst=os.path.join(self.package_folder, "include")) copy(self, pattern="*", - src=os.path.join(source_folder, "lib"), + src=os.path.join(build_folder, "lib"), dst=os.path.join(self.package_folder, "lib")) copy(self, pattern="*", - src=os.path.join(source_folder, "jmods"), + src=os.path.join(build_folder, "jmods"), dst=os.path.join(self.package_folder, "lib", "jmods")) copy(self, pattern="*", - src=os.path.join(source_folder, "legal"), + src=os.path.join(build_folder, "legal"), dst=os.path.join(self.package_folder, "licenses")) # 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="*", - src=os.path.join(source_folder, "conf"), + src=os.path.join(build_folder, "conf"), dst=os.path.join(self.package_folder, "conf")) def package_info(self): self.output.info(f"Creating JAVA_HOME environment variable with : {self.package_folder}") - self.runenv_info.append("JAVA_HOME", self.package_folder) - self.buildenv_info.append("JAVA_HOME", self.package_folder) + self.runenv_info.define_path("JAVA_HOME", self.package_folder) + self.buildenv_info.define_path("JAVA_HOME", self.package_folder) # TODO: remove `env_info` once the recipe is only compatible with Conan >= 2.0 self.env_info.JAVA_HOME = self.package_folder diff --git a/recipes/openjdk/all/test_v1_package/conanfile.py b/recipes/openjdk/all/test_v1_package/conanfile.py deleted file mode 100644 index e79724dff669e..0000000000000 --- a/recipes/openjdk/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,23 +0,0 @@ -from conans import ConanFile, tools -from conans.errors import ConanException -from io import StringIO - - - -class TestPackage(ConanFile): - test_type = "explicit" - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - - def build(self): - pass # nothing to build, but tests should not warn - - def test(self): - if not tools.cross_building(self): - output = StringIO() - self.run("java --version", output=output, run_environment=True) - print(output.getvalue) - version_info = output.getvalue() - if "openjdk" not in version_info: - raise ConanException("java call seems not use the openjdk bin") diff --git a/recipes/openjdk/config.yml b/recipes/openjdk/config.yml index 1e9a2a92440d2..c2d6c3ae88d91 100644 --- a/recipes/openjdk/config.yml +++ b/recipes/openjdk/config.yml @@ -1,4 +1,6 @@ versions: + "21.0.2": + folder: all "21.0.1": folder: all "19.0.2": diff --git a/recipes/openjpeg/all/conandata.yml b/recipes/openjpeg/all/conandata.yml index 1770aef0faecd..22b5d0386cb72 100644 --- a/recipes/openjpeg/all/conandata.yml +++ b/recipes/openjpeg/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.5.3": + url: "https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.3.tar.gz" + sha256: "368fe0468228e767433c9ebdea82ad9d801a3ad1e4234421f352c8b06e7aa707" + "2.5.2": + url: "https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.2.tar.gz" + sha256: "90e3896fed910c376aaf79cdd98bdfdaf98c6472efd8e1debf0a854938cbda6a" + "2.5.1": + url: "https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.1.tar.gz" + sha256: "c0b92dadd65e33b1cf94f39dd9157d5469846744c2e0afb8ca10961f51f61da6" "2.5.0": url: "https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.0.tar.gz" sha256: "0333806d6adecc6f7a91243b2b839ff4d2053823634d4f6ed7a59bc87409122a" diff --git a/recipes/openjpeg/all/conanfile.py b/recipes/openjpeg/all/conanfile.py index 5b1cc6a995945..74542890fef4f 100644 --- a/recipes/openjpeg/all/conanfile.py +++ b/recipes/openjpeg/all/conanfile.py @@ -10,12 +10,11 @@ class OpenjpegConan(ConanFile): name = "openjpeg" - url = "https://github.com/conan-io/conan-center-index" 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" - + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/uclouvain/openjpeg" + topics = ("jpeg2000", "jp2", "openjpeg", "image", "multimedia", "format", "graphics") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -89,6 +88,8 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", self._openjpeg_subdir)) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", self._openjpeg_subdir)) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) self._create_cmake_module_variables( os.path.join(self.package_folder, self._module_vars_rel_path) ) diff --git a/recipes/openjpeg/all/test_package/CMakeLists.txt b/recipes/openjpeg/all/test_package/CMakeLists.txt index 08c910c90a70d..9b22bc4eae287 100644 --- a/recipes/openjpeg/all/test_package/CMakeLists.txt +++ b/recipes/openjpeg/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(OpenJPEG REQUIRED CONFIG) diff --git a/recipes/openjpeg/config.yml b/recipes/openjpeg/config.yml index 2f39469175da4..ec48c90c24a01 100644 --- a/recipes/openjpeg/config.yml +++ b/recipes/openjpeg/config.yml @@ -1,4 +1,10 @@ versions: + "2.5.3": + folder: all + "2.5.2": + folder: all + "2.5.1": + folder: all "2.5.0": folder: all "2.4.0": diff --git a/recipes/openjph/all/conandata.yml b/recipes/openjph/all/conandata.yml new file mode 100644 index 0000000000000..bc55101179008 --- /dev/null +++ b/recipes/openjph/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "0.21.2": + url: "https://github.com/aous72/OpenJPH/archive/0.21.2.tar.gz" + sha256: "5c25f5fe820ccb4fee3b7a0d3246bf836508e313708f0b57f3654dbe8b0c4a01" + "0.18.0": + url: "https://github.com/aous72/OpenJPH/archive/0.18.0.tar.gz" + sha256: "2484908bf5a171cda957643d9bc85c39d58ef939016e2d1a00122b1cefbbd4f8" + "0.16.0": + url: "https://github.com/aous72/OpenJPH/archive/0.16.0.tar.gz" + sha256: "94bea4d7057f7a5dcb3f8eee3f854955ce153d98dad99602dd0ba50a560d7cf6" +patches: + "0.21.2": + - patch_file: "patches/0.21.2_cmake-cxx-standard.patch" + patch_description: "Remove setting of CXX standard to a fixed value overriding the toolchain provided by Conan" + patch_type: "conan" + "0.18.0": + - patch_file: "patches/0.15.0_cmake-cxx-standard.patch" + patch_description: "Remove setting of CXX standard to a fixed value overriding the toolchain provided by Conan" + patch_type: "conan" + "0.16.0": + - patch_file: "patches/0.15.0_cmake-cxx-standard.patch" + patch_description: "Remove setting of CXX standard to a fixed value overriding the toolchain provided by Conan" + patch_type: "conan" diff --git a/recipes/openjph/all/conanfile.py b/recipes/openjph/all/conanfile.py new file mode 100644 index 0000000000000..c7de97d7ce8f6 --- /dev/null +++ b/recipes/openjph/all/conanfile.py @@ -0,0 +1,126 @@ +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, rm, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +import os + +required_conan_version = ">=1.53.0" + +class OpenJPH(ConanFile): + name = "openjph" + description = "Open-source implementation of JPEG2000 Part-15 (or JPH or HTJ2K)" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/aous72/OpenJPH" + topics = ("ht-j2k", "jpeg2000", "jp2", "openjph", "image", "multimedia", "format", "graphics") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_executables": [True, False], + "with_tiff": [True, False], + "with_stream_expand_tool": [True, False], + "disable_simd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_executables": True, + "with_tiff": True, + "with_stream_expand_tool": False, + "disable_simd": 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_executables and self.options.with_tiff: + self.requires("libtiff/4.6.0") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + required_cpp_version = 11 + if self.options.with_stream_expand_tool: + required_conan_version = 14 + check_min_cppstd(self, required_cpp_version) + + if self.settings.compiler == "gcc" and \ + Version(self.settings.compiler.version) < "6.0": + raise ConanInvalidConfiguration(f"{self.ref} requires gcc >= 6.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["OJPH_BUILD_EXECUTABLES"] = self.options.with_executables + tc.variables["OJPH_ENABLE_TIFF_SUPPORT"] = self.options.with_tiff + tc.variables["OJPH_BUILD_STREAM_EXPAND"] = self.options.with_stream_expand_tool + tc.variables["OJPH_DISABLE_SIMD"] = self.options.disable_simd + + # Workaround for Conan 1 where the CXX standard version isn't set to a fallback to gnu98 happens + if not self.settings.get_safe("compiler.cppstd"): + tc.cache_variables["CMAKE_CXX_STANDARD"] = 14 if self.options.with_stream_expand_tool else 11 + + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + def build(self): + self._patch_sources() + + cm = CMake(self) + cm.configure() + cm.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + cm = CMake(self) + cm.install() + + if Version(self.version) >= "0.21.2": + # Introduced with version 0.21.*, there is now cmake exports added upstream. + rm(self, "*.cmake", os.path.join(self.package_folder, "lib", "cmake"), recursive=True) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", "openjph")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + # Cleanup package own pkgconfig + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "openjph") + self.cpp_info.set_property("cmake_target_name", "openjph::openjph") + self.cpp_info.set_property("pkg_config_name", "openjph") + + version_suffix = "" + if is_msvc(self): + v = Version(self.version) + version_suffix = f".{v.major}.{v.minor}" + self.cpp_info.libs = ["openjph" + version_suffix] + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.names["cmake_find_package"] = "openjph" + self.cpp_info.names["cmake_find_package_multi"] = "openjph" + self.cpp_info.names["pkg_config"] = "openjph" diff --git a/recipes/openjph/all/patches/0.15.0_cmake-cxx-standard.patch b/recipes/openjph/all/patches/0.15.0_cmake-cxx-standard.patch new file mode 100644 index 0000000000000..336b23fc9542c --- /dev/null +++ b/recipes/openjph/all/patches/0.15.0_cmake-cxx-standard.patch @@ -0,0 +1,26 @@ +diff --git CMakeLists.txt CMakeLists.txt +index cfa70ea..7e761db 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -93,7 +93,7 @@ message(STATUS "Building ${CMAKE_BUILD_TYPE}") + + ## C++ version and flags + # C++14 is needed for gtest, otherwise, C++11 is sufficient for the library +-set(CMAKE_CXX_STANDARD 14) ++#set(CMAKE_CXX_STANDARD 14) + if (MSVC) + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) + endif() +diff --git src/apps/ojph_stream_expand/CMakeLists.txt src/apps/ojph_stream_expand/CMakeLists.txt +index 5aea342..e21bdd9 100644 +--- src/apps/ojph_stream_expand/CMakeLists.txt ++++ src/apps/ojph_stream_expand/CMakeLists.txt +@@ -5,7 +5,7 @@ if (OJPH_BUILD_STREAM_EXPAND) + + include_directories(../common) + include_directories(../../core/common) +- set(CMAKE_CXX_STANDARD 14) ++ #set(CMAKE_CXX_STANDARD 14) + + file(GLOB OJPH_STREAM_EXPAND "*.cpp" "*.h") + file(GLOB OJPH_SOCKETS "../others/ojph_sockets.cpp") diff --git a/recipes/openjph/all/patches/0.21.2_cmake-cxx-standard.patch b/recipes/openjph/all/patches/0.21.2_cmake-cxx-standard.patch new file mode 100644 index 0000000000000..7d4f3465fe9a2 --- /dev/null +++ b/recipes/openjph/all/patches/0.21.2_cmake-cxx-standard.patch @@ -0,0 +1,26 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 716d5ad..9949c27 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -103,7 +103,7 @@ message(STATUS "Building ${CMAKE_BUILD_TYPE}") + + ## C++ version and flags + # C++14 is needed for gtest, otherwise, C++11 is sufficient for the library +-set(CMAKE_CXX_STANDARD 14) ++#set(CMAKE_CXX_STANDARD 14) + if (MSVC) + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) + endif() +diff --git src/apps/ojph_stream_expand/CMakeLists.txt src/apps/ojph_stream_expand/CMakeLists.txt +index 24bc2d1..9b0d4c0 100644 +--- src/apps/ojph_stream_expand/CMakeLists.txt ++++ src/apps/ojph_stream_expand/CMakeLists.txt +@@ -1,7 +1,7 @@ + ## building ojph_stream_expand + ############################## + +-set(CMAKE_CXX_STANDARD 14) ++#set(CMAKE_CXX_STANDARD 14) + + file(GLOB OJPH_STREAM_EXPAND "*.cpp" "*.h") + file(GLOB OJPH_SOCKETS "../others/ojph_sockets.cpp") diff --git a/recipes/openjph/all/test_package/CMakeLists.txt b/recipes/openjph/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f0b6210c6ae20 --- /dev/null +++ b/recipes/openjph/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.11) +project(test_package LANGUAGES CXX) + +find_package(openjph REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE openjph::openjph) diff --git a/recipes/openjph/all/test_package/conanfile.py b/recipes/openjph/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a6bc68712d90 --- /dev/null +++ b/recipes/openjph/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/openjph/all/test_package/test_package.cpp b/recipes/openjph/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..8ea54e19b7552 --- /dev/null +++ b/recipes/openjph/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + +#include + + +int main() { + // Print the version number but also do an API call to check the library + std::cout << "OpenJPH Version: " << OPENJPH_VERSION_MAJOR << '.' << OPENJPH_VERSION_MINOR << '.' << OPENJPH_VERSION_PATCH << std::endl; + std::cout << "CPU Extension level: " << ojph::get_cpu_ext_level() << std::endl; + + return EXIT_SUCCESS; +} diff --git a/recipes/openjph/config.yml b/recipes/openjph/config.yml new file mode 100644 index 0000000000000..7647992368e77 --- /dev/null +++ b/recipes/openjph/config.yml @@ -0,0 +1,7 @@ +versions: + "0.21.2": + folder: all + "0.18.0": + folder: all + "0.16.0": + folder: all diff --git a/recipes/openldap/all/conandata.yml b/recipes/openldap/all/conandata.yml index 9fc035f4ad145..0b8d44649e6e8 100644 --- a/recipes/openldap/all/conandata.yml +++ b/recipes/openldap/all/conandata.yml @@ -1,8 +1,7 @@ sources: + "2.6.7": + url: "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.7.tgz" + sha256: "cd775f625c944ed78a3da18a03b03b08eea73c8aabc97b41bb336e9a10954930" "2.6.1": - url: https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.1.tgz - sha256: 9d576ea6962d7db8a2e2808574e8c257c15aef55f403a1fb5a0faf35de70e6f3 -patches: - "2.6.1": - - base_path: source_subfolder - patch_file: patches/configure-2.6.1.patch + url: "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.1.tgz" + sha256: "9d576ea6962d7db8a2e2808574e8c257c15aef55f403a1fb5a0faf35de70e6f3" diff --git a/recipes/openldap/all/conanfile.py b/recipes/openldap/all/conanfile.py index 49a19895302e6..4992bb0b0e23f 100644 --- a/recipes/openldap/all/conanfile.py +++ b/recipes/openldap/all/conanfile.py @@ -1,110 +1,126 @@ import os -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration -required_conan_version = ">=1.43.0" +import shutil + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.files import chdir, copy, get, rm, rmdir, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.apple import is_apple_os, fix_apple_shared_install_name +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class OpenldapConan(ConanFile): name = "openldap" - description = "OpenLDAP C++ library" + description = "OpenLDAP C library" + license = "OLDAP-2.8" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.openldap.org/" - license = "OLDAP-2.8" topics = ("ldap", "load-balancer", "directory-access") - exports_sources = ["patches/*"] - settings = settings = "os", "compiler", "build_type", "arch" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "with_cyrus_sasl": [True, False] + "with_cyrus_sasl": [True, False], } default_options = { "shared": False, "fPIC": True, - "with_cyrus_sasl": True - + "with_cyrus_sasl": True, } - _autotools = None - _configure_vars = None - - @property - def _source_subfolder(self): - return "source_subfolder" def configure(self): if self.options.shared: - del self.options.fPIC + 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], - strip_root=True, destination=self._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]") if self.options.with_cyrus_sasl: - self.requires("cyrus-sasl/2.1.27") + self.requires("cyrus-sasl/2.1.28") def validate(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration( - f"{self.name} is only supported on Linux") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - - def yes_no(v): return "yes" if v else "no" - self._autotools = AutoToolsBuildEnvironment(self) - configure_args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), + if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: + raise ConanInvalidConfiguration(f"{self.name} is only supported on Unix platforms") + + 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") + + def yes_no(v): + return "yes" if v else "no" + + tc = AutotoolsToolchain(self) + tc.configure_args += [ "--with-cyrus_sasl={}".format(yes_no(self.options.with_cyrus_sasl)), - "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))), "--without-fetch", "--with-tls=openssl", - "--enable-auditlog"] - self._configure_vars = self._autotools.vars - self._configure_vars["systemdsystemunitdir"] = os.path.join( - self.package_folder, "res") - - # Need to link to -pthread instead of -lpthread for gcc 8 shared=True - # on CI job. Otherwise, linking fails. - self._autotools.libs.remove("pthread") - self._configure_vars["LIBS"] = self._configure_vars["LIBS"].replace( - "-lpthread", "-pthread") - - self._autotools.configure( - args=configure_args, - configure_dir=self._source_subfolder, - vars=self._configure_vars) - return self._autotools + "--enable-auditlog", + "--libexecdir=${prefix}/bin", + f"systemdsystemunitdir={os.path.join(self.package_folder, 'res')}", + ] + if cross_building(self): + # When cross-building, yielding_select should be explicit: + # https://git.openldap.org/openldap/openldap/-/blob/OPENLDAP_REL_ENG_2_5/configure.ac#L1636 + tc.configure_args.append("--with-yielding_select=yes") + # Workaround: https://bugs.openldap.org/show_bug.cgi?id=9228 + tc.configure_args.append("ac_cv_func_memcmp_working=yes") + if is_apple_os(self): + # macOS Ventura does not have soelim, but mandoc_soelim + tc.make_args.append("SOELIM=soelim" if shutil.which("soelim") else "SOELIM=mandoc_soelim") + tc.generate() + tc = AutotoolsDeps(self) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "WITH_SYSTEMD=no\nsystemdsystemunitdir=", "WITH_SYSTEMD=no") def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - autotools = self._configure_autotools() - - autotools.make(vars=self._configure_vars) + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - autotools = self._configure_autotools() - autotools.install(vars=self._configure_vars) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - self.copy("COPYRIGHT", dst="licenses", src=self._source_subfolder) - for folder in ["var", "share", "etc", "lib/pkgconfig", "res"]: - tools.rmdir(os.path.join(self.package_folder, folder)) - tools.remove_files_by_mask( - os.path.join( - self.package_folder, - "lib"), - "*.la") + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + copy(self, "LICENSE", 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) + rm(self, "*.la", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) + for folder in ["var", "share", "etc", os.path.join("lib", "pkgconfig"), "home", "Users"]: + rmdir(self, os.path.join(self.package_folder, folder)) def package_info(self): - bin_path = os.path.join(self.package_folder, "bin") - self.env_info.PATH.append(bin_path) - self.output.info( - "Appending PATH environment variable: {}".format(bin_path)) + self.cpp_info.components["ldap"].set_property("pkg_config_name", "ldap") + self.cpp_info.components["ldap"].libs = ["ldap"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["ldap"].system_libs = ["pthread", "resolv"] + self.cpp_info.components["ldap"].requires = ["lber", "openssl::ssl", "openssl::crypto"] + if self.options.with_cyrus_sasl: + self.cpp_info.components["ldap"].requires.append("cyrus-sasl::cyrus-sasl") - self.cpp_info.libs = ["ldap", "lber"] + self.cpp_info.components["lber"].set_property("pkg_config_name", "lber") + self.cpp_info.components["lber"].libs = ["lber"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["pthread"] + self.cpp_info.components["lber"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) diff --git a/recipes/openldap/all/patches/configure-2.6.1.patch b/recipes/openldap/all/patches/configure-2.6.1.patch deleted file mode 100644 index 9fb405dfefc10..0000000000000 --- a/recipes/openldap/all/patches/configure-2.6.1.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/configure b/configure -index 8521174..8ea6133 100755 ---- a/configure -+++ b/configure -@@ -22337,7 +22337,6 @@ $as_echo "$as_me: WARNING: Strong authentication not supported!" >&2;} - fi - - WITH_SYSTEMD=no --systemdsystemunitdir= - ol_link_systemd=no - if test $ol_enable_slapd == no && test $ol_enable_balancer != yes ; then - if test $ol_with_systemd != no ; then diff --git a/recipes/openldap/all/test_package/CMakeLists.txt b/recipes/openldap/all/test_package/CMakeLists.txt index fb813fde0a56b..c77039fd606a9 100644 --- a/recipes/openldap/all/test_package/CMakeLists.txt +++ b/recipes/openldap/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(TARGETS) -find_package(openldap CONFIG REQUIRED) -add_executable(${PROJECT_NAME} test_package.cpp) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(openldap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} openldap::openldap) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/openldap/all/test_package/conanfile.py b/recipes/openldap/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/openldap/all/test_package/conanfile.py +++ b/recipes/openldap/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/openldap/all/test_package/test_package.c b/recipes/openldap/all/test_package/test_package.c new file mode 100644 index 0000000000000..ca578bf88f1df --- /dev/null +++ b/recipes/openldap/all/test_package/test_package.c @@ -0,0 +1,84 @@ +/* ldapurl -- a tool for generating LDAP URLs */ +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 2008-2021 The OpenLDAP Foundation. + * Portions Copyright 2008 Pierangelo Masarati, SysNet + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* Portions Copyright (c) 1992-1996 Regents of the University of Michigan. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of Michigan at Ann Arbor. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. This + * software is provided ``as is'' without express or implied warranty. + */ +/* ACKNOWLEDGEMENTS: + * This work was originally developed by Pierangelo Masarati + * for inclusion in OpenLDAP software. + */ + +#include "openldap.h" + +#include +#include + +static int do_uri_create(LDAPURLDesc *lud) { + char *uri; + + if (lud->lud_scheme == NULL) { + lud->lud_scheme = "ldap"; + } + + if (lud->lud_port == -1) { + if (strcasecmp(lud->lud_scheme, "ldap") == 0) { + lud->lud_port = LDAP_PORT; + + } else if (strcasecmp(lud->lud_scheme, "ldaps") == 0) { + lud->lud_port = LDAPS_PORT; + + } else if (strcasecmp(lud->lud_scheme, "ldapi") == 0) { + lud->lud_port = 0; + + } else { + /* forgiving... */ + lud->lud_port = 0; + } + } + + if (lud->lud_scope == -1) { + lud->lud_scope = LDAP_SCOPE_DEFAULT; + } + + uri = ldap_url_desc2str(lud); + + if (uri == NULL) { + fprintf(stderr, "unable to generate URI\n"); + exit(EXIT_FAILURE); + } + + printf("%s\n", uri); + free(uri); + + return 0; +} + +int main() { + LDAPURLDesc lud = {0}; + + lud.lud_port = -1; + lud.lud_scope = -1; + + return do_uri_create(&lud); +} diff --git a/recipes/openldap/all/test_package/test_package.cpp b/recipes/openldap/all/test_package/test_package.cpp deleted file mode 100644 index ab1267d80b23a..0000000000000 --- a/recipes/openldap/all/test_package/test_package.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* ldapurl -- a tool for generating LDAP URLs */ -/* $OpenLDAP$ */ -/* This work is part of OpenLDAP Software . - * - * Copyright 2008-2021 The OpenLDAP Foundation. - * Portions Copyright 2008 Pierangelo Masarati, SysNet - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted only as authorized by the OpenLDAP - * Public License. - * - * A copy of this license is available in the file LICENSE in the - * top-level directory of the distribution or, alternatively, at - * . - */ -/* Portions Copyright (c) 1992-1996 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. This - * software is provided ``as is'' without express or implied warranty. - */ -/* ACKNOWLEDGEMENTS: - * This work was originally developed by Pierangelo Masarati - * for inclusion in OpenLDAP software. - */ - -#include -#include -#include "openldap.h" - -static int do_uri_create(LDAPURLDesc *lud) { - char *uri; - - if (lud->lud_scheme == NULL) { - lud->lud_scheme = "ldap"; - } - - if (lud->lud_port == -1) { - if (strcasecmp(lud->lud_scheme, "ldap") == 0) { - lud->lud_port = LDAP_PORT; - - } else if (strcasecmp(lud->lud_scheme, "ldaps") == 0) { - lud->lud_port = LDAPS_PORT; - - } else if (strcasecmp(lud->lud_scheme, "ldapi") == 0) { - lud->lud_port = 0; - - } else { - /* forgiving... */ - lud->lud_port = 0; - } - } - - if (lud->lud_scope == -1) { - lud->lud_scope = LDAP_SCOPE_DEFAULT; - } - - uri = ldap_url_desc2str(lud); - - if (uri == NULL) { - fprintf(stderr, "unable to generate URI\n"); - exit(EXIT_FAILURE); - } - - printf("%s\n", uri); - free(uri); - - return 0; -} - -int main() { - LDAPURLDesc lud = {0}; - - lud.lud_port = -1; - lud.lud_scope = -1; - - return do_uri_create(&lud); -} diff --git a/recipes/openldap/config.yml b/recipes/openldap/config.yml index 36b28f1209ae7..7177bd469e00d 100644 --- a/recipes/openldap/config.yml +++ b/recipes/openldap/config.yml @@ -1,3 +1,5 @@ versions: + "2.6.7": + folder: all "2.6.1": folder: all diff --git a/recipes/openmesh/all/conandata.yml b/recipes/openmesh/all/conandata.yml index da3df78a47023..118a4fc6160df 100644 --- a/recipes/openmesh/all/conandata.yml +++ b/recipes/openmesh/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "11.0": + url: "https://www.graphics.rwth-aachen.de/media/openmesh_static/Releases/11.0/OpenMesh-11.0.0.tar.bz2" + sha256: "9d22e65bdd6a125ac2043350a019ec4346ea83922cafdf47e125a03c16f6fa07" + "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 +12,13 @@ sources: url: "https://www.graphics.rwth-aachen.de/media/openmesh_static/Releases/8.1/OpenMesh-8.1.tar.gz" sha256: "0953777f483d47ea9fa00c329838443a7a09dde8be77bf7de188001cb9e768a7" patches: + "11.0": + - patch_file: "patches/cmake-install_9.0.patch" + "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/all/test_package/CMakeLists.txt b/recipes/openmesh/all/test_package/CMakeLists.txt index 2585cd6853d3d..1ed98983b76b0 100644 --- a/recipes/openmesh/all/test_package/CMakeLists.txt +++ b/recipes/openmesh/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(OpenMesh REQUIRED CONFIG) diff --git a/recipes/openmesh/all/test_v1_package/CMakeLists.txt b/recipes/openmesh/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/openmesh/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/openmesh/all/test_v1_package/conanfile.py b/recipes/openmesh/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/openmesh/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_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/openmesh/config.yml b/recipes/openmesh/config.yml index 6b3545daffc92..bc3b698019ee1 100644 --- a/recipes/openmesh/config.yml +++ b/recipes/openmesh/config.yml @@ -1,4 +1,8 @@ versions: + "11.0": + folder: all + "10.0": + folder: all "9.0": folder: all "8.1": diff --git a/recipes/openmpi/all/conandata.yml b/recipes/openmpi/all/conandata.yml index 4580e17ba76a3..7211bc311a719 100644 --- a/recipes/openmpi/all/conandata.yml +++ b/recipes/openmpi/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.1.6": + url: "https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.6.tar.bz2" + sha256: "f740994485516deb63b5311af122c265179f5328a0d857a567b85db00b11e415" "4.1.0": - sha256: 73866fb77090819b6a8c85cb8539638d37d6877455825b74e289d647a39fd5b5 - url: https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.0.tar.bz2 + url: "https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.0.tar.bz2" + sha256: "73866fb77090819b6a8c85cb8539638d37d6877455825b74e289d647a39fd5b5" diff --git a/recipes/openmpi/all/conanfile.py b/recipes/openmpi/all/conanfile.py index 26cc0e027159c..785217bcba3dc 100644 --- a/recipes/openmpi/all/conanfile.py +++ b/recipes/openmpi/all/conanfile.py @@ -1,97 +1,259 @@ -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.29.1" +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.env import VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir, save, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import unix_path + +required_conan_version = ">=1.53.0" class OpenMPIConan(ConanFile): name = "openmpi" - homepage = "https://www.open-mpi.org" - url = "https://github.com/conan-io/conan-center-index" - topics = ("conan", "mpi", "openmpi") description = "A High Performance Message Passing Library" license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.open-mpi.org" + topics = ("mpi", "openmpi") + provides = "mpi" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "fortran": ["yes", "mpifh", "usempi", "usempi80", "no"] + "fortran": ["yes", "mpifh", "usempi", "usempi80", "no"], + "enable_cxx": [True, False], + "enable_cxx_exceptions": [True, False], + "with_verbs": [True, False], } default_options = { "shared": False, "fPIC": True, - "fortran": "no" + "fortran": "no", + "enable_cxx": False, + "enable_cxx_exceptions": False, + "with_verbs": False, } - _autotools = 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 - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + if not self.options.enable_cxx: + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + del self.options.enable_cxx_exceptions + if is_apple_os(self): + # Unavailable due to dependency on libnl + del self.options.with_verbs + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + # OpenMPI public headers don't include anything besides stddef.h. + # transitive_headers=True is not needed for any dependencies. + self.requires("hwloc/2.10.0") + self.requires("zlib/[>=1.2.11 <2]") + if self.settings.os == "Linux": + self.requires("libnl/3.8.0") + if self.options.get_safe("with_verbs"): + self.requires("rdma-core/52.0") + + def validate(self): if self.settings.os == "Windows": + # Requires Cygwin or WSL raise ConanInvalidConfiguration("OpenMPI doesn't support Windows") - def requirements(self): - # FIXME : self.requires("libevent/2.1.12") - try to use libevent from conan - self.requires("zlib/1.2.11") + if self.version == "4.1.0" and is_apple_os(self) and self.settings.arch == "armv8": + # INFO: https://github.com/open-mpi/ompi/issues/8410 + raise ConanInvalidConfiguration(f"{self.ref} is not supported in Mac M1. Use a newer version.") 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_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - args = ["--disable-wrapper-rpath", "--disable-wrapper-runpath"] - if self.settings.build_type == "Debug": - args.append("--enable-debug") - if self.options.shared: - args.extend(["--enable-shared", "--disable-static"]) - else: - args.extend(["--enable-static", "--disable-shared"]) - args.append("--with-pic" if self.options.get_safe("fPIC", True) else "--without-pic") - args.append("--enable-mpi-fortran={}".format(str(self.options.fortran))) - args.append("--with-zlib={}".format(self.deps_cpp_info["zlib"].rootpath)) - args.append("--with-zlib-libdir={}".format(self.deps_cpp_info["zlib"].lib_paths[0])) - args.append("--datarootdir=${prefix}/res") - self._autotools.configure(args=args) - return self._autotools + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + def root(pkg): + return unix_path(self, self.dependencies[pkg].package_folder) + + def yes_no(v): + return "yes" if v else "no" + + tc = AutotoolsToolchain(self) + tc.configure_args += [ + f"--enable-mpi-fortran={self.options.fortran}", + f"--enable-mpi-cxx={yes_no(self.options.enable_cxx)}", + f"--enable-cxx-exceptions={yes_no(self.options.get_safe('enable_cxx_exceptions'))}", + f"--with-hwloc={root('hwloc')}", + f"--with-libnl={root('libnl') if not is_apple_os(self) else 'no'}", + f"--with-verbs={root('rdma-core') if self.options.get_safe('with_verbs') else 'no'}", + f"--with-zlib={root('zlib')}", + "--with-pic" if self.options.get_safe("fPIC", True) else "--without-pic", + "--disable-wrapper-rpath", + "--disable-wrapper-runpath", + "--exec-prefix=/", + "--datarootdir=${prefix}/res", + # Disable other external libraries explicitly + "--with-alps=no", # ALPS + "--with-cuda=no", # CUDA + "--with-fca=no", # FCA + "--with-gpfs=no", # Gpfs + "--with-hcoll=no", # hcoll + "--with-ime=no", # IME + "--with-lsf=no", # LSF + "--with-lustre=no", # Lustre + "--with-memkind=no", # memkind + "--with-moab=no", # Moab + "--with-mxm=no", # Mellanox MXM + "--with-ofi=no", # libfabric, TODO: enable once libfabric is available + "--with-pmi=no", # PMI + "--with-pmix=internal", # PMIx + "--with-portals4=no", # Portals4 + "--with-psm2=no", # PSM2 + "--with-psm=no", # PSM + "--with-pvfs2=no", # Pvfs2 + "--with-treematch=no", # TreeMatch + "--with-ucx=no", # UCX + "--with-valgrind=no", # Valgrind + "--with-x=no", # X11 + "--with-xpmem=no", # XPMEM + ] + if is_apple_os(self): + if self.settings.arch == "armv8": + tc.configure_args.append("--host=aarch64-apple-darwin") + tc.extra_ldflags.append("-arch arm64") + # macOS has no libnl + tc.configure_args.append("--enable-mca-no-build=reachable-netlink") + # libtool's libltdl is not really needed, OpenMPI provides its own equivalent. + # Not adding it as it fails to be detected by ./configure in some cases. + # https://github.com/open-mpi/ompi/blob/v4.1.6/opal/mca/dl/dl.h#L20-L25 + tc.configure_args.append("--with-libltdl=no") + tc.generate() + + deps = AutotoolsDeps(self) + deps.generate() + + # Needed for ./configure to find libhwloc.so and libibnetdisc.so + VirtualRunEnv(self).generate(scope="build") + + # TODO: might want to enable reproducible builds by setting + # $SOURCE_DATE_EPOCH, $USER and $HOSTNAME + + def _patch_sources(self): + # Not needed and fails with v5.0 due to additional Python dependencies + save(self, os.path.join(self.source_folder, "docs", "Makefile.in"), "all:\ninstall:\n") + # Workaround for trying to include VERSION from source dir due to a case-insensitive filesystem on macOS + # Based on https://github.com/macports/macports-ports/blob/22dded99ae76a287f04a9685bbc820ecaa397fea/science/openmpi/files/patch-configure.diff + replace_in_file(self, os.path.join(self.source_folder, "configure"), + "-I$(top_srcdir) ", "-idirafter$(top_srcdir) ") def build(self): - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - autotools.make() + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") - with tools.chdir(self._source_subfolder): - 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")) - tools.rmdir(os.path.join(self.package_folder, "etc")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + 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, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "res", "man")) + rm(self, "*.la", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.libs = ['mpi', 'open-rte', 'open-pal'] + # Based on https://cmake.org/cmake/help/latest/module/FindMPI.html#variables-for-using-mpi + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "MPI") + # TODO: Use None when available as Conan feature. + self.cpp_info.set_property("pkg_config_name", "_ompi-do-not-use") + # TODO: export a .cmake module to correctly set all variables set by CMake's FindMPI.cmake + + requires = [ + "hwloc::hwloc", + "zlib::zlib", + ] if self.settings.os == "Linux": - self.cpp_info.system_libs = ["dl", "pthread", "rt", "util"] + requires.append("libnl::libnl") + if self.options.get_safe("with_verbs"): + requires.extend(["rdma-core::libibverbs", "rdma-core::librdmacm"]) + + # The components are modelled based on OpenMPI's pkg-config files - self.output.info("Creating MPI_HOME environment variable: {}".format(self.package_folder)) + # Run-time environment library + self.cpp_info.components["orte"].set_property("pkg_config_name", "orte") + self.cpp_info.components["orte"].libs = ["open-rte", "open-pal"] + self.cpp_info.components["orte"].includedirs.append(os.path.join("include", "openmpi")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["orte"].system_libs = ["dl", "pthread", "rt", "util"] + self.cpp_info.components["orte"].cflags = ["-pthread"] + if self.options.get_safe("enable_cxx_exceptions"): + self.cpp_info.components["orte"].cflags.append("-fexceptions") + self.cpp_info.components["orte"].requires = requires + + self.cpp_info.components["ompi"].set_property("pkg_config_name", "ompi") + self.cpp_info.components["ompi"].libs = ["mpi"] + self.cpp_info.components["ompi"].requires = ["orte"] + + self.cpp_info.components["ompi-c"].set_property("pkg_config_name", "ompi-c") + self.cpp_info.components["ompi-c"].set_property("cmake_target_name", "MPI::MPI_C") + self.cpp_info.components["ompi-c"].requires = ["ompi"] + + self.cpp_info.components["ompitrace"].set_property("pkg_config_name", "ompitrace") + self.cpp_info.components["ompitrace"].libs = ["ompitrace"] + self.cpp_info.components["ompitrace"].requires = ["ompi"] + + if self.options.enable_cxx: + self.cpp_info.components["ompi-cxx"].set_property("pkg_config_name", "ompi-cxx") + self.cpp_info.components["ompi-cxx"].set_property("cmake_target_name", "MPI::MPI_CXX") + self.cpp_info.components["ompi-cxx"].libs = ["mpi_cxx"] + self.cpp_info.components["ompi-cxx"].requires = ["ompi"] + + if self.options.fortran != "no": + self.cpp_info.components["ompi-fort"].set_property("pkg_config_name", "ompi-fort") + self.cpp_info.components["ompi-fort"].set_property("cmake_target_name", "MPI::MPI_Fortran") + self.cpp_info.components["ompi-fort"].libs = ["mpi_mpifh"] + self.cpp_info.components["ompi-fort"].requires = ["ompi"] + # Aliases + self.cpp_info.components["ompi-f77"].set_property("pkg_config_name", "ompi-f77") + self.cpp_info.components["ompi-f77"].requires = ["ompi-fort"] + self.cpp_info.components["ompi-f90"].set_property("pkg_config_name", "ompi-f90") + self.cpp_info.components["ompi-f90"].requires = ["ompi-fort"] + + bin_folder = os.path.join(self.package_folder, "bin") + # Prepend to PATH to avoid a conflict with system MPI + self.runenv_info.prepend_path("PATH", bin_folder) + self.runenv_info.define_path("MPI_BIN", bin_folder) + self.runenv_info.define_path("MPI_HOME", self.package_folder) + self.runenv_info.define_path("OPAL_PREFIX", self.package_folder) + self.runenv_info.define_path("OPAL_EXEC_PREFIX", self.package_folder) + self.runenv_info.define_path("OPAL_LIBDIR", os.path.join(self.package_folder, "lib")) + self.runenv_info.define_path("OPAL_DATADIR", os.path.join(self.package_folder, "res")) + self.runenv_info.define_path("OPAL_DATAROOTDIR", os.path.join(self.package_folder, "res")) + + # TODO: Legacy, to be removed on Conan 2.0 + self.env_info.PATH.append(bin_folder) + self.env_info.MPI_BIN = bin_folder self.env_info.MPI_HOME = self.package_folder - self.output.info("Creating OPAL_PREFIX environment variable: {}".format(self.package_folder)) self.env_info.OPAL_PREFIX = self.package_folder - mpi_bin = os.path.join(self.package_folder, 'bin') - self.output.info("Creating MPI_BIN environment variable: {}".format(mpi_bin)) - self.env_info.MPI_BIN = mpi_bin - self.output.info("Appending PATH environment variable: {}".format(mpi_bin)) - self.env_info.PATH.append(mpi_bin) + self.env_info.OPAL_EXEC_PREFIX = self.package_folder + self.env_info.OPAL_LIBDIR = os.path.join(self.package_folder, "lib") + self.env_info.OPAL_DATADIR = os.path.join(self.package_folder, "res") + self.env_info.OPAL_DATAROOTDIR = os.path.join(self.package_folder, "res") + + self.cpp_info.names["cmake_find_package"] = "MPI" + self.cpp_info.names["cmake_find_package_multi"] = "MPI" + self.cpp_info.components["ompi-c"].names["cmake_find_package"] = "MPI_C" + if self.options.enable_cxx: + self.cpp_info.components["ompi-cxx"].names["cmake_find_package"] = "MPI_CXX" + if self.options.fortran != "no": + self.cpp_info.components["ompi-fort"].names["cmake_find_package"] = "MPI_Fortran" diff --git a/recipes/openmpi/all/test_package/CMakeLists.txt b/recipes/openmpi/all/test_package/CMakeLists.txt index d61f3c4bef33a..a166065f8b662 100644 --- a/recipes/openmpi/all/test_package/CMakeLists.txt +++ b/recipes/openmpi/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() +find_package(MPI REQUIRED CONFIG) -find_package(MPI REQUIRED) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE MPI::MPI_C) diff --git a/recipes/openmpi/all/test_package/conanfile.py b/recipes/openmpi/all/test_package/conanfile.py index c63b947b1cb95..09ff6fcc3cc71 100644 --- a/recipes/openmpi/all/test_package/conanfile.py +++ b/recipes/openmpi/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,7 +22,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - mpiexec = os.path.join(os.environ['MPI_BIN'], 'mpiexec') - command = '%s -mca plm_rsh_agent yes -np 2 %s' % (mpiexec, os.path.join("bin", "test_package")) - self.run(command, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + command = f"mpiexec -mca plm_rsh_agent yes {bin_path}" + self.run(command, env="conanrun") diff --git a/recipes/openmpi/all/test_package/test_package.c b/recipes/openmpi/all/test_package/test_package.c new file mode 100644 index 0000000000000..540ba2f9beacc --- /dev/null +++ b/recipes/openmpi/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include +#include + +#include + +int main(int argc, char* argv[]) +{ + char version[MPI_MAX_LIBRARY_VERSION_STRING] = {0}; + int len = 0; + MPI_Get_library_version(version, &len); + printf("MPI version: %s\n", version); + return EXIT_SUCCESS; +} diff --git a/recipes/openmpi/all/test_package/test_package.cpp b/recipes/openmpi/all/test_package/test_package.cpp deleted file mode 100644 index d6fa9065fdf2a..0000000000000 --- a/recipes/openmpi/all/test_package/test_package.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include - -int main(int argc, char* argv[]) -{ - MPI_Init(&argc, &argv); - - int rank; - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - if (rank == 0) { - int value = 17; - int result = MPI_Send(&value, 1, MPI_INT, 1, 0, MPI_COMM_WORLD); - if (result == MPI_SUCCESS) - std::cout << "Rank 0 OK!" << std::endl; - } else if (rank == 1) { - int value; - int result = MPI_Recv(&value, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - if (result == MPI_SUCCESS && value == 17) - std::cout << "Rank 1 OK!" << std::endl; - } - MPI_Finalize(); - return 0; -} diff --git a/recipes/openmpi/config.yml b/recipes/openmpi/config.yml index 702888c159594..b6ed9888d0176 100644 --- a/recipes/openmpi/config.yml +++ b/recipes/openmpi/config.yml @@ -1,3 +1,5 @@ versions: + "4.1.6": + folder: all "4.1.0": folder: all diff --git a/recipes/openmvg/all/conanfile.py b/recipes/openmvg/all/conanfile.py index 6774e8b893191..c39d66d87e5c2 100644 --- a/recipes/openmvg/all/conanfile.py +++ b/recipes/openmvg/all/conanfile.py @@ -65,17 +65,17 @@ def requirements(self): self.requires("coin-clp/1.17.7") self.requires("coin-lemon/1.3.1") self.requires("coin-osi/0.108.7") - self.requires("coin-utils/2.11.6") + self.requires("coin-utils/2.11.9") self.requires("eigen/3.4.0", transitive_headers=True) self.requires("flann/1.9.2", transitive_headers=True, transitive_libs=True) if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.0") + self.requires("libjpeg-turbo/[>=3.0 <3.1]") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") - self.requires("libpng/1.6.40") - self.requires("libtiff/4.5.1") + self.requires("libpng/[>=1.6 <2]") + self.requires("libtiff/4.6.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -120,7 +120,7 @@ def generate(self): # 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) @@ -166,6 +166,7 @@ def jpeg(): "target": "openMVG_features", "libs": ["openMVG_features"], "requires": ["openmvg_fast", "openmvg_stlplus", "eigen::eigen", "cereal::cereal"], + "add_library_name_prefix_to_include_dirs": True, }, "openmvg_geodesy": { "target": "openMVG_geodesy", @@ -200,6 +201,7 @@ def jpeg(): "libs": ["openMVG_matching"], "requires": ["openmvg_features", "openmvg_stlplus", "cereal::cereal", "flann::flann"], "system_libs": [(self.settings.os in ["Linux", "FreeBSD"], ["pthread"])], + "add_library_name_prefix_to_include_dirs": True, }, "openmvg_kvld": { "target": "openMVG_kvld", @@ -210,6 +212,7 @@ def jpeg(): "target": "openMVG_matching_image_collection", "libs": ["openMVG_matching_image_collection"], "requires": ["openmvg_matching", "openmvg_multiview"], + "add_library_name_prefix_to_include_dirs": True, }, "openmvg_multiview": { "target": "openMVG_multiview", @@ -226,6 +229,7 @@ def jpeg(): "target": "openMVG_robust_estimation", "libs": ["openMVG_robust_estimation"], "requires": ["openmvg_numeric"], + "add_library_name_prefix_to_include_dirs": True, }, "openmvg_sfm": { "target": "openMVG_sfm", @@ -235,6 +239,7 @@ def jpeg(): "openmvg_multiview", "openmvg_image", "openmvg_linftycomputervision", "openmvg_system", "openmvg_stlplus", "cereal::cereal", "ceres-solver::ceres-solver", ], + "add_library_name_prefix_to_include_dirs": True, }, "openmvg_system": { "target": "openMVG_system", @@ -283,12 +288,5 @@ def package_info(self): self.cpp_info.components[component].system_libs = system_libs self.cpp_info.components[component].resdirs = ["res"] - # TODO: to remove in conan v2 - self.cpp_info.components[component].names["cmake_find_package"] = target - self.cpp_info.components[component].names["cmake_find_package_multi"] = target - - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "OpenMVG" - self.cpp_info.names["cmake_find_package_multi"] = "OpenMVG" - if self.options.programs: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + if values.get("add_library_name_prefix_to_include_dirs", False): + self.cpp_info.components[component].includedirs.append(os.path.join("include", "openMVG")) diff --git a/recipes/openmvg/all/test_package/CMakeLists.txt b/recipes/openmvg/all/test_package/CMakeLists.txt index 7ecd1fedb6052..f40d154dfeff8 100644 --- a/recipes/openmvg/all/test_package/CMakeLists.txt +++ b/recipes/openmvg/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(OpenMVG REQUIRED CONFIG) diff --git a/recipes/openmvg/all/test_v1_package/CMakeLists.txt b/recipes/openmvg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/openmvg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/openmvg/all/test_v1_package/conanfile.py b/recipes/openmvg/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/openmvg/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_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/openpam/all/conandata.yml b/recipes/openpam/all/conandata.yml index 06219b641cc81..632d89ce6cb2b 100644 --- a/recipes/openpam/all/conandata.yml +++ b/recipes/openpam/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "20230627": + url: + - "https://www.openpam.org/downloads/openpam-20230627.tar.gz" + - "https://sourceforge.net/projects/openpam/files/openpam/Ximenia/openpam-20230627.tar.gz" + sha256: "0d9ac8f5b55a6241f5073f13eff1e95461422c45ac1a30445d7e1068e91db4fd" "20190224": - url: "https://sourceforge.net/projects/openpam/files/openpam/Tabebuia/openpam-20190224.tar.gz" + url: + - "https://www.openpam.org/downloads/openpam-20190224.tar.gz" + - "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 index b8d2328964b48..fb8da0b58aff1 100644 --- a/recipes/openpam/all/conanfile.py +++ b/recipes/openpam/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.files import copy, get, rmdir, rm from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout @@ -11,11 +10,11 @@ class PackageConan(ConanFile): name = "openpam" - description = "OpenPAM library" + description = "OpenPAM: an open source PAM library that focuses on simplicity, correctness, and cleanliness" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://openpam.org/" - topics = ("pam") + topics = ("pam", "pluggable-authentication-module", "authentication", "security") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -35,7 +34,6 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") @@ -43,14 +41,11 @@ 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") + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = AutotoolsToolchain(self) @@ -64,7 +59,7 @@ def build(self): 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) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) rmdir(self, os.path.join(self.package_folder, "share")) rm(self, "*.la", os.path.join(self.package_folder, "lib")) diff --git a/recipes/openpam/config.yml b/recipes/openpam/config.yml index 1dd1dcdfcdd6f..23de255ba07ec 100644 --- a/recipes/openpam/config.yml +++ b/recipes/openpam/config.yml @@ -1,3 +1,5 @@ versions: + "20230627": + folder: all "20190224": folder: all diff --git a/recipes/openscenegraph/all/CMakeLists.txt b/recipes/openscenegraph/all/CMakeLists.txt index a0749127966c0..5acc346654c57 100644 --- a/recipes/openscenegraph/all/CMakeLists.txt +++ b/recipes/openscenegraph/all/CMakeLists.txt @@ -1,23 +1,44 @@ -cmake_minimum_required(VERSION 3.1.2) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) -include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(NO_OUTPUT_DIRS) +macro(custom_find_package name variable) + string(TOUPPER ${name} name_upper) + if(${variable}) + find_package(${name} ${ARGN} REQUIRED CONFIG + # Allow only Conan packages + NO_DEFAULT_PATH + PATHS ${CMAKE_PREFIX_PATH} + ) + set(${name_upper}_FOUND TRUE) + set(${name_upper}_VERSION_STRING ${${name}_VERSION_STRING}) + set(${name_upper}_INCLUDE_DIRS ${${name}_INCLUDE_DIRS}) + set(${name_upper}_INCLUDE_DIR ${${name}_INCLUDE_DIR}) + set(${name_upper}_LIBRARIES ${${name}_LIBRARIES}) + set(${name_upper}_DEFINITIONS ${${name}_DEFINITIONS}) + unset(name_upper) + else() + set(${name}_FOUND FALSE) + set(${name_upper}_FOUND FALSE) + endif() +endmacro() -# Hack to insure that conan's copy of these are used, rather than CMake's -# If this isn't here, find_package(X11) will pull in CMake's copy -find_package(Freetype QUIET) -find_package(Fontconfig QUIET) +custom_find_package(Boost OSG_WITH_ASIO) +custom_find_package(Asio OSG_WITH_ASIO) +custom_find_package(CURL OSG_WITH_CURL) +custom_find_package(Fontconfig OSG_TEXT_USE_FONTCONFIG) +custom_find_package(Freetype OSG_WITH_FREETYPE) +custom_find_package(GDAL OSG_WITH_GDAL) +custom_find_package(GIFLIB OSG_WITH_GIFLIB) +custom_find_package(GTA OSG_WITH_GTA) +custom_find_package(JPEG OSG_WITH_JPEG) +custom_find_package(Jasper OSG_WITH_JASPER) +custom_find_package(OpenEXR OSG_WITH_OPENEXR) +custom_find_package(PNG OSG_WITH_PNG) +custom_find_package(TIFF OSG_WITH_TIFF) +custom_find_package(ZLIB OSG_WITH_ZLIB) +custom_find_package(DCMTK OSG_WITH_DCMTK) +# custom_find_package(Poppler) +# custom_find_package(RSVG) +# custom_find_package(SDL2) -# Workaround limitations of the cmake_find_package generator -set(FREETYPE_FOUND ${Freetype_FOUND}) -if(FREETYPE_FOUND) - set(FREETYPE_LIBRARIES ${Freetype_LIBRARIES}) - set(FREETYPE_INCLUDE_DIRS ${Freetype_INCLUDE_DIRS}) -endif() - -if(APPLE) - add_compile_definitions("GL_SILENCE_DEPRECATION") -endif() - -add_subdirectory("source_subfolder") +add_subdirectory(src) diff --git a/recipes/openscenegraph/all/conan-official-osg-variables.cmake b/recipes/openscenegraph/all/conan-official-osg-variables.cmake new file mode 100644 index 0000000000000..636f54b308c40 --- /dev/null +++ b/recipes/openscenegraph/all/conan-official-osg-variables.cmake @@ -0,0 +1,23 @@ +# Reproduce https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/cmake/OpenSceneGraphConfig.cmake.in +# Component-specific variables are not created. Use the component targets instead. + +# Only export these for the OpenSceneGraph config file, not FindOSG.cmake +if(NOT DEFINED OSG_LIBRARIES) + set(OPENSCENEGRAPH_FOUND TRUE) + set(OPENSCENEGRAPH_LIBRARIES ${OpenSceneGraph_LIBRARIES}) + set(OPENSCENEGRAPH_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) + set(OPENSCENEGRAPH_INCLUDE_DIRS ${OpenSceneGraph_INCLUDE_DIRS}) + + set(OPENSCENEGRAPH_VERSION ${OpenSceneGraph_VERSION}) + set(OPENSCENEGRAPH_VERSION_STRING ${OpenSceneGraph_VERSION_STRING}) + + set(OSG_LIBRARY ${OpenSceneGraph_LIBRARIES}) + set(OSG_LIBRARIES ${OpenSceneGraph_LIBRARIES}) + set(OSG_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) + set(OSG_INCLUDE_DIRS ${OpenSceneGraph_INCLUDE_DIRS}) +endif() + +# Reproduce https://github.com/openscenegraph/OpenSceneGraph/blob/master/CMakeModules/FindOpenThreads.cmake +set(OPENTHREADS_FOUND TRUE) +set(OPENTHREADS_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) +set(OPENTHREADS_LIBRARY OpenThreads::OpenThreads) diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index 0f1b6a2cc4790..094e9853e6fca 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -1,18 +1,38 @@ sources: 3.6.5: - sha256: aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12 - url: https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.5.tar.gz + url: "https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.5.tar.gz" + sha256: "aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12" patches: 3.6.5: - patch_file: patches/0001-fix-to_cmake_path-usage.patch - base_path: source_subfolder - - patch_file: patches/0002-Use-standard-CMake-name-for-gif.patch - base_path: source_subfolder - - patch_file: patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch - base_path: source_subfolder - - patch_file: patches/0004-Allow-explicit-control-of-plugins.patch - base_path: source_subfolder + patch_description: Fix cmake paths + patch_type: portability - patch_file: patches/0005-use-JPEG-target-for-plugin.patch - base_path: source_subfolder + patch_description: This fixes building against a static libjpeg on windows + patch_type: portability - patch_file: patches/0006-Declare-result-as-LONG-for-Mingw-build.patch - base_path: source_subfolder + patch_description: Win32's ChangeDisplaySettingsEx() API function is documented as returning `LONG`, which evidently is not always the same as `unsigned int` (Mingw64.) This cause a compile error on Mingw with clang10. + patch_type: official + patch_source: https://github.com/openscenegraph/OpenSceneGraph/commit/67468cce344dd5e503aaa1063845f34720563f79 + - patch_file: patches/0007-fix-msvc-with-std-c++17.patch + patch_description: Fix to be able to build with c++17 on MSVC + patch_type: official + patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1055 + - patch_file: patches/0008-replace-mem-fun-ref.patch + patch_description: Replaced std::mem_fun_ref usage to avoid compatiblity with modern compilers + patch_type: official + patch_source: https://github.com/openscenegraph/OpenSceneGraph/commit/8a0114a46a4bad9041297950fe3bfbb2aea6e1da + - patch_file: patches/0009-replace-auto-ptr-in-plugins.patch + patch_description: auto_ptr is removed in C++17. + patch_type: portability + patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 + - patch_file: patches/0010-replace-ptr-fun-in-obj-plugin.patch + patch_description: ptr_fun is removed in C++17 + patch_type: portability + patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 + - patch_file: patches/0011-remove-deprecated-register.patch + patch_description: The "register" keyword is deprecated as of C++17 + patch_type: bugfix + patch_source: + - https://github.com/openscenegraph/OpenSceneGraph/pull/1296 + - https://github.com/openscenegraph/OpenSceneGraph/pull/951 diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 5d6b6d3a14882..6a6779eb6f02b 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -1,25 +1,27 @@ +import os +import re +from pathlib import Path + from conan import ConanFile -from conan.tools.files import get, rmdir, rm, apply_conandata_patches +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os 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, rm, rmdir, replace_in_file from conan.tools.scm import Version -from conan.tools.apple import is_apple_os -from conan.errors import ConanInvalidConfiguration -from conans import CMake -import os -import functools - -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class OpenSceneGraphConanFile(ConanFile): name = "openscenegraph" description = "OpenSceneGraph is an open source high performance 3D graphics toolkit" - topics = ("openscenegraph", "graphics") + license = ("LGPL-2.1-only", "WxWindows-exception-3.1") url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.openscenegraph.org" - license = "LGPL-2.1-only", "WxWindows-exception-3.1" + topics = ("graphics",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -42,11 +44,12 @@ class OpenSceneGraphConanFile(ConanFile): "with_gif": [True, False], "with_gta": [True, False], "with_jasper": [True, False], - "with_jpeg": [True, False], + "with_jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg", False], "with_openexr": [True, False], "with_png": [True, False], "with_tiff": [True, False], "with_zlib": [True, False], + "with_avfoundation": [True, False], "opengl_profile": ["gl1", "gl2", "gl3", "glCore", "gles1", "gles2", "gles3", "gles2+gles3"], } default_options = { @@ -70,21 +73,20 @@ class OpenSceneGraphConanFile(ConanFile): "with_gif": True, "with_gta": False, "with_jasper": False, - "with_jpeg": True, + "with_jpeg": "libjpeg", "with_openexr": False, "with_png": True, "with_tiff": True, "with_zlib": True, "opengl_profile": "gl2", + "with_avfoundation": True, } - short_paths = True - exports_sources = "CMakeLists.txt", "patches/*.patch" - generators = "cmake", "cmake_find_package" - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + copy(self, "conan-official-osg-variables.cmake", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -102,163 +104,258 @@ def config_options(self): # imageio supports tiff files so the tiff plugin isn't needed on Apple platforms self.options.with_tiff = False + else: + del self.options.with_avfoundation def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.with_zlib: # These require zlib support - del self.options.with_openexr - del self.options.with_png - del self.options.with_dcmtk + self.options.rm_safe("with_openexr") + self.options.rm_safe("with_png") + self.options.rm_safe("with_dcmtk") - def validate(self): - if self.options.get_safe("with_asio", False): - raise ConanInvalidConfiguration("ASIO support in OSG is broken, see https://github.com/openscenegraph/OpenSceneGraph/issues/921") - if hasattr(self, "settings_build") and cross_building(self): - raise ConanInvalidConfiguration("openscenegraph recipe cannot be cross-built yet. Contributions are welcome.") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - if self.options.enable_windowing_system and self.settings.os == "Linux": + if self.options.enable_windowing_system and self.settings.os in ["Linux", "FreeBSD"]: self.requires("xorg/system") self.requires("opengl/system") if self.options.use_fontconfig: self.requires("fontconfig/2.14.2") - if self.options.get_safe("with_asio", False): + if self.options.get_safe("with_asio"): # Should these be private requires? - self.requires("asio/1.22.1") - self.requires("boost/1.81.0") + self.requires("asio/1.28.1") + self.requires("boost/1.83.0") if self.options.with_curl: - self.requires("libcurl/8.0.1") + self.requires("libcurl/[>=7.78 <9]") if self.options.get_safe("with_dcmtk"): - self.requires("dcmtk/3.6.6") + self.requires("dcmtk/3.6.7") if self.options.with_freetype: - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") if self.options.with_gdal: - self.requires("gdal/3.4.3") + self.requires("gdal/3.8.3") if self.options.get_safe("with_gif"): self.requires("giflib/5.2.1") if self.options.with_gta: self.requires("libgta/1.2.1") if self.options.with_jasper: - self.requires("jasper/2.0.33") - if self.options.get_safe("with_jpeg"): + self.requires("jasper/4.2.0") + 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/3.0.2") + elif self.options.get_safe("with_jpeg") == "mozjpeg": + self.requires("mozjpeg/4.1.5") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.1.7") + self.requires("openexr/3.2.3") if self.options.get_safe("with_png"): self.requires("libpng/1.6.40") if self.options.with_tiff: - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") if self.options.with_zlib: - self.requires("zlib/1.2.13") - - def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + self.requires("zlib/[>=1.2.11 <2]") - def _patch_sources(self): - apply_conandata_patches(self) - - for package in ("Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"): - # Prefer conan's find package scripts over osg's - os.unlink(os.path.join(self._source_subfolder, "CMakeModules", "Find{}.cmake".format(package))) + def validate(self): + if self.options.get_safe("with_asio"): + raise ConanInvalidConfiguration( + "ASIO support in OSG is broken, " + "see https://github.com/openscenegraph/OpenSceneGraph/issues/921" + ) + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration( + "openscenegraph recipe cannot be cross-built yet. " + "Contributions are welcome." + ) - @functools.lru_cache(1) - def _configured_cmake(self): - cmake = CMake(self) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - cmake.definitions["USE_3RDPARTY_BIN"] = False + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_3RDPARTY_BIN"] = False - cmake.definitions["DYNAMIC_OPENSCENEGRAPH"] = self.options.shared - cmake.definitions["DYNAMIC_OPENTHREADS"] = self.options.shared + tc.variables["DYNAMIC_OPENSCENEGRAPH"] = self.options.shared + tc.variables["DYNAMIC_OPENTHREADS"] = self.options.shared - cmake.definitions["BUILD_OSG_APPLICATIONS"] = self.options.build_applications - cmake.definitions["BUILD_OSG_EXAMPLES"] = False + tc.variables["BUILD_OSG_APPLICATIONS"] = self.options.build_applications + tc.variables["BUILD_OSG_EXAMPLES"] = False - cmake.definitions["OSG_NOTIFY_DISABLED"] = not self.options.enable_notify - cmake.definitions["OSG_USE_DEPRECATED_API"] = self.options.enable_deprecated_api - cmake.definitions["OSG_PROVIDE_READFILE"] = self.options.enable_readfile - cmake.definitions["OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION"] = self.options.enable_ref_ptr_implicit_output_conversion - cmake.definitions["OSG_USE_REF_PTR_SAFE_DEREFERENCE"] = self.options.enable_ref_ptr_safe_dereference - cmake.definitions["OSG_ENVVAR_SUPPORTED"] = self.options.enable_envvar_support + tc.variables["OSG_NOTIFY_DISABLED"] = not self.options.enable_notify + tc.variables["OSG_USE_DEPRECATED_API"] = self.options.enable_deprecated_api + tc.variables["OSG_PROVIDE_READFILE"] = self.options.enable_readfile + tc.variables["OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION"] = self.options.enable_ref_ptr_implicit_output_conversion + tc.variables["OSG_USE_REF_PTR_SAFE_DEREFERENCE"] = self.options.enable_ref_ptr_safe_dereference + tc.variables["OSG_ENVVAR_SUPPORTED"] = self.options.enable_envvar_support if not self.options.enable_windowing_system: - cmake.definitions["OSG_WINDOWING_SYSTEM"] = None + tc.variables["OSG_WINDOWING_SYSTEM"] = None - cmake.definitions["BUILD_OSG_DEPRECATED_SERIALIZERS"] = self.options.enable_deprecated_serializers + tc.variables["BUILD_OSG_DEPRECATED_SERIALIZERS"] = self.options.enable_deprecated_serializers - cmake.definitions["OSG_TEXT_USE_FONTCONFIG"] = self.options.use_fontconfig + tc.variables["OSG_TEXT_USE_FONTCONFIG"] = self.options.use_fontconfig - cmake.definitions["OPENGL_PROFILE"] = str(self.options.opengl_profile).upper() + tc.variables["OPENGL_PROFILE"] = str(self.options.opengl_profile).upper() # Disable option dependencies unless we have a package for them - cmake.definitions["OSG_WITH_FREETYPE"] = self.options.with_freetype - cmake.definitions["OSG_WITH_OPENEXR"] = self.options.get_safe("with_openexr", False) - cmake.definitions["OSG_WITH_INVENTOR"] = False - cmake.definitions["OSG_WITH_JASPER"] = self.options.with_jasper - cmake.definitions["OSG_WITH_OPENCASCADE"] = False - cmake.definitions["OSG_WITH_FBX"] = False - cmake.definitions["OSG_WITH_ZLIB"] = self.options.with_zlib - cmake.definitions["OSG_WITH_GDAL"] = self.options.with_gdal - cmake.definitions["OSG_WITH_GTA"] = self.options.with_gta - cmake.definitions["OSG_WITH_CURL"] = self.options.with_curl - cmake.definitions["OSG_WITH_LIBVNCSERVER"] = False - cmake.definitions["OSG_WITH_DCMTK"] = self.options.get_safe("with_dcmtk", False) - cmake.definitions["OSG_WITH_FFMPEG"] = False - cmake.definitions["OSG_WITH_DIRECTSHOW"] = False - cmake.definitions["OSG_WITH_SDL"] = False - cmake.definitions["OSG_WITH_POPPLER"] = False - cmake.definitions["OSG_WITH_RSVG"] = False - cmake.definitions["OSG_WITH_NVTT"] = False - cmake.definitions["OSG_WITH_ASIO"] = self.options.get_safe("with_asio", False) - cmake.definitions["OSG_WITH_ZEROCONF"] = False - cmake.definitions["OSG_WITH_LIBLAS"] = False - cmake.definitions["OSG_WITH_GIF"] = self.options.get_safe("with_gif", False) - cmake.definitions["OSG_WITH_JPEG"] = self.options.get_safe("with_jpeg", False) - cmake.definitions["OSG_WITH_PNG"] = self.options.get_safe("with_png", False) - cmake.definitions["OSG_WITH_TIFF"] = self.options.with_tiff + tc.variables["OSG_WITH_FREETYPE"] = self.options.with_freetype + tc.variables["OSG_WITH_OPENEXR"] = self.options.get_safe("with_openexr", False) + tc.variables["OSG_WITH_INVENTOR"] = False + tc.variables["OSG_WITH_JASPER"] = self.options.with_jasper + tc.variables["OSG_WITH_OPENCASCADE"] = False + tc.variables["OSG_WITH_FBX"] = False + tc.variables["OSG_WITH_ZLIB"] = self.options.with_zlib + tc.variables["OSG_WITH_GDAL"] = self.options.with_gdal + tc.variables["OSG_WITH_GTA"] = self.options.with_gta + tc.variables["OSG_WITH_CURL"] = self.options.with_curl + tc.variables["OSG_WITH_LIBVNCSERVER"] = False + tc.variables["OSG_WITH_DCMTK"] = self.options.get_safe("with_dcmtk", False) + tc.variables["OSG_WITH_FFMPEG"] = False + tc.variables["OSG_WITH_DIRECTSHOW"] = False + tc.variables["OSG_WITH_SDL"] = False + tc.variables["OSG_WITH_POPPLER"] = False + tc.variables["OSG_WITH_RSVG"] = False + tc.variables["OSG_WITH_NVTT"] = False + tc.variables["OSG_WITH_ASIO"] = self.options.get_safe("with_asio", False) + tc.variables["OSG_WITH_ZEROCONF"] = False + tc.variables["OSG_WITH_LIBLAS"] = False + tc.variables["OSG_WITH_GIFLIB"] = self.options.get_safe("with_gif", False) + tc.variables["OSG_WITH_JPEG"] = self.options.get_safe("with_jpeg", False) + tc.variables["OSG_WITH_PNG"] = self.options.get_safe("with_png", False) + tc.variables["OSG_WITH_TIFF"] = self.options.with_tiff + + if (self.options.get_safe("with_avfoundation")): + tc.variables["OSG_WITH_AV_FOUNDATION"] = True if self.settings.os == "Windows": # osg has optional quicktime support on Windows - cmake.definitions["CMAKE_DISABLE_FIND_PACKAGE_QuickTime"] = True + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_QuickTime"] = True + + tc.variables["OSG_MSVC_VERSIONED_DLL"] = False - cmake.definitions["OSG_MSVC_VERSIONED_DLL"] = False + if is_apple_os(self): + tc.preprocessor_definitions["GL_SILENCE_DEPRECATION"] = "1" - cmake.configure() + tc.generate() - return cmake + deps = CMakeDeps(self) + deps.set_property("freetype", "cmake_module_file_name", "Freetype") + deps.set_property("giflib", "cmake_file_name", "GIFLIB") + deps.set_property("libjpeg-turbo", "cmake_file_name", "JPEG") + deps.set_property("libjpeg-turbo::jpeg", "cmake_target_name", "JPEG::JPEG") + deps.set_property("mozjpeg", "cmake_file_name", "JPEG") + deps.set_property("mozjpeg::libjpeg", "cmake_target_name", "JPEG::JPEG") + deps.generate() + + def _patch_sources(self): + for package in ["Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"]: + # Prefer conan's find package scripts over osg's + os.unlink(os.path.join(self.source_folder, "CMakeModules", f"Find{package}.cmake")) + plugins_root = Path(self.source_path.joinpath("src", "osgPlugins")) + for path in plugins_root.rglob("CMakeLists.txt"): + if path.parent == plugins_root: + # Don't replace in the root dir + continue + content = path.read_text() + # Correct usage of *_LIBRARY variables to *_LIBRARIES + content = content.replace("_LIBRARY", "_LIBRARIES") + # Allow explicit control of plugins via OSG_WITH_* variables + # e.g. replace IF(FFMPEG_FOUND) with IF(OSG_WITH_FFMPEG) + content = re.sub(r"\b([A-Z]+)_FOUND\b", r"OSG_WITH_\1", content) + path.write_text(content) + for path in self.source_path.joinpath(self.source_folder, "CMakeModules").rglob("*.cmake"): + content = path.read_text(encoding='utf-8', errors='ignore') + lib_match = re.search(r'FIND_LIBRARY\(([^ ]+)_LIBRARY', content) + if lib_match: + library_name = lib_match.group(1) + new_content = re.sub(rf'\b{library_name}_LIBRARY\b', rf'{library_name}_LIBRARIES', content) + path.write_text(new_content) + + apply_conandata_patches(self) + + # Not sure why, but CMake fails to find the EXPAT::EXPAT target created by Conan when Fontconfig is found as a module. + replace_in_file(self, os.path.join(self.source_folder, "src", "osgText", "CMakeLists.txt"), + "find_package(Fontconfig MODULE)", "find_package(Fontconfig CONFIG REQUIRED)") + replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "freetype", "CMakeLists.txt"), + "SET(TARGET_EXTERNAL_LIBRARIES ${FREETYPE_LIBRARIES} )", "SET(TARGET_EXTERNAL_LIBRARIES Freetype::Freetype)") + + # osg uses imageio on Apple platforms. PNG_FOUND will be set by `FIND_PACKAGE(Freetype)` + # in the OSG cmake code and without this patch the png plugin will be included even though it shouldn't. + replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "CMakeLists.txt"), + "PNG_FOUND", "PNG_FOUND AND OSG_WITH_PNG") + + # Only add curl plugin if actually requested. + replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "CMakeLists.txt"), + "CURL_FOUND", "CURL_FOUND AND OSG_WITH_CURL") def build(self): self._patch_sources() - - self._configured_cmake().build() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) + cmake.build() def package(self): - self._configured_cmake().install() + cmake = CMake(self) + cmake.install() - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "conan-official-osg-variables.cmake", + dst=os.path.join(self.package_folder, "lib", "cmake"), + src=os.path.join(self.source_folder, os.pardir)) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.pdb", self.package_folder, True) def package_info(self): - # FindOpenSceneGraph.cmake is shipped with cmake and is a traditional cmake script - # It doesn't setup targets and only provides a few variables: - # - OPENSCENEGRAPH_FOUND - # - OPENSCENEGRAPH_VERSION - # - OPENSCENEGRAPH_INCLUDE_DIRS - # - OPENSCENEGRAPH_LIBRARIES - # Unfortunately, the cmake_find_package generators don't currently allow directly setting variables, - # but it will set the last three of these if the name of the package is OPENSCENEGRAPH (it uses - # the filename for the first, so OpenSceneGraph_FOUND gets set, not OPENSCENEGRAPH_FOUND) - # TODO: set OPENSCENEGRAPH_FOUND in cmake_find_package and cmake_find_package_multi - self.cpp_info.filenames["cmake_find_package"] = "OpenSceneGraph" - self.cpp_info.filenames["cmake_find_package_multi"] = "OpenSceneGraph" - self.cpp_info.names["cmake_find_package"] = "OPENSCENEGRAPH" - self.cpp_info.names["cmake_find_package_multi"] = "OPENSCENEGRAPH" + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/cmake/OpenSceneGraphConfig.cmake.in + self.cpp_info.set_property("cmake_file_name", "OpenSceneGraph") + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/CMakeModules/FindOSG.cmake + self.cpp_info.set_property("cmake_module_file_name", "OSG") + # Disable the automatically created targets, use the "openscenegraph" component instead + self.cpp_info.set_property("pkg_config_name", None) + self.cpp_info.set_property("cmake_target_name", None) + + # Export CMake variables set by the project + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + cmake_vars_module = os.path.join("lib", "cmake", "conan-official-osg-variables.cmake") + self.cpp_info.set_property("cmake_build_modules", [cmake_vars_module]) + + # The main component that depends on all non-plugin components + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/pkgconfig/openscenegraph.pc.in + openscenegraph = self.cpp_info.components["openscenegraph"] + openscenegraph.set_property("pkg_config_name", "openscenegraph") + # Unofficial CMake target + openscenegraph.set_property("cmake_target_name", "OpenSceneGraph::OpenSceneGraph") + openscenegraph.requires = [ + "osg", + "osgDB", + "osgFX", + "osgGA", + "osgParticle", + "osgSim", + "osgText", + "osgUtil", + "osgTerrain", + "osgManipulator", + "osgViewer", + "osgWidget", + "osgShadow", + "osgAnimation", + "osgVolume", + ] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "OpenSceneGraph" + self.cpp_info.names["cmake_find_package_multi"] = "OpenSceneGraph" + openscenegraph.names["cmake_find_package"] = "OpenSceneGraph" + openscenegraph.names["cmake_find_package_multi"] = "OpenSceneGraph" + self.cpp_info.build_modules["cmake_find_package"].append(cmake_vars_module) + self.cpp_info.build_modules["cmake_find_package_multi"].append(cmake_vars_module) if self.settings.build_type == "Debug": postfix = "d" @@ -275,49 +372,52 @@ def setup_plugin(plugin): plugin_library.libs = [] if self.options.shared else [lib + postfix] plugin_library.requires = ["OpenThreads", "osg", "osgDB", "osgUtil"] if not self.options.shared: - plugin_library.libdirs = [os.path.join("lib", "osgPlugins-{}".format(self.version))] + plugin_library.libdirs = [os.path.join("lib", f"osgPlugins-{self.version}")] return plugin_library def setup_serializers(lib): plugins = [] if lib not in ("osgDB", "osgWidget", "osgPresentation"): - plugins.append("serializers_{}".format(lib.lower())) + plugins.append(f"serializers_{lib.lower()}") if self.options.enable_deprecated_serializers: if lib not in ("osgUtil", "osgDB", "osgGA", "osgManipulator", "osgUI", "osgPresentation"): - plugins.append("deprecated_{}".format(lib.lower())) + plugins.append(f"deprecated_{lib.lower()}") for plugin in plugins: setup_plugin(plugin).requires.append(lib) def setup_library(lib): library = self.cpp_info.components[lib] library.libs = [lib + postfix] - library.names["pkg_config"] = "openscenegraph-{}".format(lib) + library.set_property("pkg_config_name", f"openscenegraph-{lib}") setup_serializers(lib) return library # Core libraries # requires obtained from osg's source code - # TODO: FindOpenThreads.cmake is shipped with CMake, so we should generate separate - # files for it with cmake_find_package and cmake_find_package_multi + # The project installs FindOpenThreads.cmake as a separate module. + # Conan cannot recreate that, but let's export it as a component instead. + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/CMakeModules/FindOpenThreads.cmake + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/pkgconfig/openthreads.pc.in library = self.cpp_info.components["OpenThreads"] library.libs = ["OpenThreads" + postfix] - library.names["pkg_config"] = "openthreads" - if self.settings.os == "Linux": + library.set_property("pkg_config_name", "openthreads") + library.set_property("cmake_target_name", "OpenThreads::OpenThreads") + if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["pthread"] library = setup_library("osg") library.requires = ["OpenThreads", "opengl::opengl"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["m", "rt", "dl"] if not self.options.shared: library.defines.append("OSG_LIBRARY_STATIC") library = setup_library("osgDB") library.requires = ["osg", "osgUtil", "OpenThreads"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["dl"] - elif self.settings.os == "Macos": + elif is_apple_os(self): library.frameworks = ["Carbon", "Cocoa"] if self.options.with_zlib: library.requires.append("zlib::zlib") @@ -333,7 +433,7 @@ def setup_library(lib): library = setup_library("osgViewer") library.requires = ["osgGA", "osgText", "osgDB", "osgUtil", "osg"] if self.options.enable_windowing_system: - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: library.requires.append("xorg::xorg") elif is_apple_os(self): library.frameworks = ["Cocoa"] @@ -350,7 +450,8 @@ def setup_library(lib): setup_library("osgSim").requires = ["osgText", "osgUtil", "osgDB", "osg", "OpenThreads"] setup_library("osgTerrain").requires = ["osgUtil", "osgDB", "osg", "OpenThreads"] setup_library("osgWidget").requires = ["osgText", "osgViewer", "osgDB", "osg", "OpenThreads"] - setup_library("osgPresentation").requires = ["osgViewer", "osgUI", "osgWidget", "osgManipulator", "osgVolume", "osgFX", "osgText", "osgGA", "osgUtil", "osgDB", "osg", "OpenThreads"] + setup_library("osgPresentation").requires = ["osgViewer", "osgUI", "osgWidget", "osgManipulator", "osgVolume", + "osgFX", "osgText", "osgGA", "osgUtil", "osgDB", "osg", "OpenThreads"] # Start of plugins @@ -369,7 +470,7 @@ def setup_library(lib): setup_plugin("osg") plugin = setup_plugin("ive") - plugin.requires.extend(("osgSim", "osgFX", "osgText", "osgTerrain", "osgVolume")) + plugin.requires.extend(["osgSim", "osgFX", "osgText", "osgTerrain", "osgVolume"]) if self.options.with_zlib: plugin.requires.append("zlib::zlib") @@ -390,8 +491,12 @@ def setup_library(lib): setup_plugin("vtf") setup_plugin("ktx") - if self.options.get_safe("with_jpeg"): + if self.options.get_safe("with_jpeg") == "libjpeg": setup_plugin("jpeg").requires.append("libjpeg::libjpeg") + elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": + setup_plugin("jpeg").requires.append("libjpeg-turbo::jpeg") + elif self.options.get_safe("with_jpeg") == "mozjpeg": + setup_plugin("jpeg").requires.append("mozjpeg::libjpeg") if self.options.with_jasper: setup_plugin("jp2").requires.append("jasper::jasper") @@ -403,13 +508,13 @@ def setup_library(lib): setup_plugin("gif").requires.append("giflib::giflib") if self.options.get_safe("with_png"): - setup_plugin("png").requires.extend(("libpng::libpng", "zlib::zlib")) + setup_plugin("png").requires.extend(["libpng::libpng", "zlib::zlib"]) if self.options.with_tiff: setup_plugin("tiff").requires.append("libtiff::libtiff") if self.options.with_gdal: - setup_plugin("gdal").requires.extend(("osgTerrain", "gdal::gdal")) + setup_plugin("gdal").requires.extend(["osgTerrain", "gdal::gdal"]) setup_plugin("ogr").requires.append("gdal::gdal") if self.options.with_gta: @@ -418,13 +523,13 @@ def setup_library(lib): # 3D Image plugins if self.options.get_safe("with_dcmtk"): plugin = setup_plugin("dicom") - plugin.requires.extend(("osgVolume", "dcmtk::dcmtk")) + plugin.requires.extend(["osgVolume", "dcmtk::dcmtk"]) if self.settings.os == "Windows": plugin.system_libs = ["wsock32", "ws2_32"] # 3rd party 3d plugins setup_plugin("3dc") - setup_plugin("p3d").requires.extend(("osgGA", "osgText", "osgVolume", "osgFX", "osgViewer", "osgPresentation")) + setup_plugin("p3d").requires.extend(["osgGA", "osgText", "osgVolume", "osgFX", "osgViewer", "osgPresentation"]) if self.options.with_curl: plugin = setup_plugin("curl") @@ -462,15 +567,15 @@ def setup_library(lib): setup_plugin("md2") setup_plugin("osgtgz") setup_plugin("tgz") - setup_plugin("shp").requires.extend(("osgSim", "osgTerrain")) + setup_plugin("shp").requires.extend(["osgSim", "osgTerrain"]) setup_plugin("txf").requires.append("osgText") setup_plugin("bsp") setup_plugin("mdl") - setup_plugin("gles").requires.extend(("osgUtil", "osgAnimation")) - setup_plugin("osgjs").requires.extend(("osgAnimation", "osgSim")) + setup_plugin("gles").requires.extend(["osgUtil", "osgAnimation"]) + setup_plugin("osgjs").requires.extend(["osgAnimation", "osgSim"]) setup_plugin("lwo").requires.append("osgFX") setup_plugin("ply") - setup_plugin("txp").requires.extend(("osgSim", "osgText")) + setup_plugin("txp").requires.extend(["osgSim", "osgText"]) # with_ffmpeg # setup_plugin("ffmpeg") @@ -484,16 +589,20 @@ def setup_library(lib): if is_apple_os(self): setup_plugin("imageio").frameworks = ["Accelerate"] - if ((self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) >= "10.8") - or (self.settings.os == "iOS" and Version(self.settings.os.version) >= "6.0")): + if (self.options.get_safe("with_avfoundation")): plugin = setup_plugin("avfoundation") plugin.requires.append("osgViewer") plugin.frameworks = ["AVFoundation", "Cocoa", "CoreVideo", "CoreMedia", "QuartzCore"] - if self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) <= "10.6" and self.settings.arch == "x86": + if ( + is_apple_os(self) + and self.settings.os.version + and Version(self.settings.os.version) <= "10.6" + and self.settings.arch == "x86" + ): setup_plugin("qt").frameworks = ["QuickTime"] - if self.settings.os == "Macos" and self.settings.arch == "x86": + if is_apple_os(self) and self.settings.arch == "x86": plugin = setup_plugin("QTKit") plugin.requires.append("osgViewer") plugin.frameworks = ["QTKit", "Cocoa", "QuickTime", "CoreVideo"] @@ -502,7 +611,7 @@ def setup_library(lib): # setup_plugin("nvtt") if self.options.with_freetype: - setup_plugin("freetype").requires.extend(("osgText", "freetype::freetype")) + setup_plugin("freetype").requires.extend(["osgText", "freetype::freetype"]) if self.options.with_zlib: setup_plugin("zip") @@ -535,7 +644,7 @@ def setup_library(lib): # setup_plugin("sdl") if self.options.get_safe("with_asio", False): - setup_plugin("resthttp").requires.extend(("osgPresentation", "asio::asio", "boost::boost")) + setup_plugin("resthttp").requires.extend(["osgPresentation", "asio::asio", "boost::boost"]) # with_zeroconf # setup_plugin("zeroconf") diff --git a/recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch b/recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch deleted file mode 100644 index 7a75a5c326228..0000000000000 --- a/recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 17ad9caac56282e89d0e6a62c9564b99e2736225 Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Thu, 17 Sep 2020 16:51:45 -0700 -Subject: [PATCH 2/5] Use standard CMake name for gif - ---- - CMakeLists.txt | 2 +- - src/osgPlugins/CMakeLists.txt | 2 +- - src/osgPlugins/gif/CMakeLists.txt | 4 ++-- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0ef2edd33..5e0c8f349 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -813,7 +813,7 @@ ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID) - # can use Quicktime. - IF(NOT ANDROID) - IF(NOT APPLE) -- FIND_PACKAGE(GIFLIB) -+ FIND_PACKAGE(GIF) - FIND_PACKAGE(JPEG) - FIND_PACKAGE(PNG) - FIND_PACKAGE(TIFF) -diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt -index 812550412..2a88684b5 100644 ---- a/src/osgPlugins/CMakeLists.txt -+++ b/src/osgPlugins/CMakeLists.txt -@@ -108,7 +108,7 @@ ENDIF() - IF(OPENEXR_FOUND AND ZLIB_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) - ADD_PLUGIN_DIRECTORY(exr) - ENDIF() --IF(GIFLIB_FOUND) -+IF(GIF_FOUND) - ADD_PLUGIN_DIRECTORY(gif) - ENDIF() - IF(PNG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -diff --git a/src/osgPlugins/gif/CMakeLists.txt b/src/osgPlugins/gif/CMakeLists.txt -index 642339af1..0db0296cc 100644 ---- a/src/osgPlugins/gif/CMakeLists.txt -+++ b/src/osgPlugins/gif/CMakeLists.txt -@@ -1,7 +1,7 @@ --INCLUDE_DIRECTORIES( ${GIFLIB_INCLUDE_DIR} ) -+INCLUDE_DIRECTORIES( ${GIF_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterGIF.cpp ) --SET(TARGET_LIBRARIES_VARS GIFLIB_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GIF_LIBRARY ) - #### end var setup ### - SETUP_PLUGIN(gif) - --- -2.21.0.windows.1 - diff --git a/recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch b/recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch deleted file mode 100644 index b3965bd4897eb..0000000000000 --- a/recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 4925ff028681f79b8c0cb1d8e0772ca026c6e63e Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Thu, 17 Sep 2020 17:06:49 -0700 -Subject: [PATCH 3/5] Correct usage of *_LIBRARY to *_LIBRARIES - ---- - src/osgPlugins/curl/CMakeLists.txt | 4 ++-- - src/osgPlugins/gdal/CMakeLists.txt | 2 +- - src/osgPlugins/gif/CMakeLists.txt | 2 +- - src/osgPlugins/gta/CMakeLists.txt | 2 +- - src/osgPlugins/jp2/CMakeLists.txt | 2 +- - src/osgPlugins/jpeg/CMakeLists.txt | 2 +- - src/osgPlugins/ogr/CMakeLists.txt | 2 +- - src/osgPlugins/png/CMakeLists.txt | 2 +- - src/osgPlugins/tiff/CMakeLists.txt | 2 +- - src/osgPlugins/vnc/CMakeLists.txt | 2 +- - 10 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/src/osgPlugins/curl/CMakeLists.txt b/src/osgPlugins/curl/CMakeLists.txt -index 667631f07..4afb738c7 100644 ---- a/src/osgPlugins/curl/CMakeLists.txt -+++ b/src/osgPlugins/curl/CMakeLists.txt -@@ -23,11 +23,11 @@ SET(TARGET_H - - IF(ZLIB_FOUND) - SET(TARGET_LIBRARIES_VARS -- CURL_LIBRARY -+ CURL_LIBRARIES - ZLIB_LIBRARIES) - ELSE() - SET(TARGET_LIBRARIES_VARS -- CURL_LIBRARY) -+ CURL_LIBRARIES) - ENDIF() - - IF(WIN32 OR MINGW) -diff --git a/src/osgPlugins/gdal/CMakeLists.txt b/src/osgPlugins/gdal/CMakeLists.txt -index f1b670701..353bc9fc6 100644 ---- a/src/osgPlugins/gdal/CMakeLists.txt -+++ b/src/osgPlugins/gdal/CMakeLists.txt -@@ -9,7 +9,7 @@ SET(TARGET_H - DataSetLayer.h - ) - --SET(TARGET_LIBRARIES_VARS GDAL_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GDAL_LIBRARIES ) - SET(TARGET_ADDED_LIBRARIES osgTerrain ) - - IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -diff --git a/src/osgPlugins/gif/CMakeLists.txt b/src/osgPlugins/gif/CMakeLists.txt -index 0db0296cc..99d1e26dc 100644 ---- a/src/osgPlugins/gif/CMakeLists.txt -+++ b/src/osgPlugins/gif/CMakeLists.txt -@@ -1,7 +1,7 @@ - INCLUDE_DIRECTORIES( ${GIF_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterGIF.cpp ) --SET(TARGET_LIBRARIES_VARS GIF_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GIF_LIBRARIES ) - #### end var setup ### - SETUP_PLUGIN(gif) - -diff --git a/src/osgPlugins/gta/CMakeLists.txt b/src/osgPlugins/gta/CMakeLists.txt -index 2b910a628..16466fefc 100644 ---- a/src/osgPlugins/gta/CMakeLists.txt -+++ b/src/osgPlugins/gta/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${GTA_INCLUDE_DIRS} ) - - SET(TARGET_SRC ReaderWriterGTA.cpp ) - --SET(TARGET_LIBRARIES_VARS GTA_LIBRARY) -+SET(TARGET_LIBRARIES_VARS GTA_LIBRARIES) - - #### end var setup ### - SETUP_PLUGIN(gta) -diff --git a/src/osgPlugins/jp2/CMakeLists.txt b/src/osgPlugins/jp2/CMakeLists.txt -index b95537680..adcd84f64 100644 ---- a/src/osgPlugins/jp2/CMakeLists.txt -+++ b/src/osgPlugins/jp2/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${JASPER_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterJP2.cpp ) - --SET(TARGET_LIBRARIES_VARS JASPER_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS JASPER_LIBRARIES ) - - IF(WIN32) - ADD_DEFINITIONS(-DJAS_WIN_MSVC_BUILD) -diff --git a/src/osgPlugins/jpeg/CMakeLists.txt b/src/osgPlugins/jpeg/CMakeLists.txt -index 7117713a0..2d290a29d 100644 ---- a/src/osgPlugins/jpeg/CMakeLists.txt -+++ b/src/osgPlugins/jpeg/CMakeLists.txt -@@ -5,6 +5,6 @@ SET(TARGET_SRC - ReaderWriterJPEG.cpp - ) - --SET(TARGET_LIBRARIES_VARS JPEG_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS JPEG_LIBRARIES ) - #### end var setup ### - SETUP_PLUGIN(jpeg) -diff --git a/src/osgPlugins/ogr/CMakeLists.txt b/src/osgPlugins/ogr/CMakeLists.txt -index 01b71e360..ea8b9706a 100644 ---- a/src/osgPlugins/ogr/CMakeLists.txt -+++ b/src/osgPlugins/ogr/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${GDAL_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterOGR.cpp) - --SET(TARGET_LIBRARIES_VARS GDAL_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GDAL_LIBRARIES ) - - IF(CMAKE_COMPILER_IS_GNUCXX) - # Remove -Wshadow flag as it barfs on ffmoeg headers -diff --git a/src/osgPlugins/png/CMakeLists.txt b/src/osgPlugins/png/CMakeLists.txt -index 33df903d2..c4a6a2acc 100644 ---- a/src/osgPlugins/png/CMakeLists.txt -+++ b/src/osgPlugins/png/CMakeLists.txt -@@ -5,7 +5,7 @@ IF(OSG_CPP_EXCEPTIONS_AVAILABLE) - ENDIF() - - SET(TARGET_SRC ReaderWriterPNG.cpp ) --SET(TARGET_LIBRARIES_VARS PNG_LIBRARY ZLIB_LIBRARIES ) -+SET(TARGET_LIBRARIES_VARS PNG_LIBRARIES ZLIB_LIBRARIES ) - - - #### end var setup ### -diff --git a/src/osgPlugins/tiff/CMakeLists.txt b/src/osgPlugins/tiff/CMakeLists.txt -index fc945d68e..6b856eab2 100644 ---- a/src/osgPlugins/tiff/CMakeLists.txt -+++ b/src/osgPlugins/tiff/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${TIFF_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterTIFF.cpp ) - --SET(TARGET_LIBRARIES_VARS TIFF_LIBRARY) -+SET(TARGET_LIBRARIES_VARS TIFF_LIBRARIES) - - #### end var setup ### - SETUP_PLUGIN(tiff) -diff --git a/src/osgPlugins/vnc/CMakeLists.txt b/src/osgPlugins/vnc/CMakeLists.txt -index 9a54b2bf2..49bb2dce4 100644 ---- a/src/osgPlugins/vnc/CMakeLists.txt -+++ b/src/osgPlugins/vnc/CMakeLists.txt -@@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${LIBVNCSERVER_INCLUDE_DIR}) - SET(TARGET_EXTERNAL_LIBRARIES - ${LIBVNCCLIENT_LIBRARY} - ${ZLIB_LIBRARIES} -- ${JPEG_LIBRARY} ) -+ ${JPEG_LIBRARIES} ) - - SET(TARGET_ADDED_LIBRARIES osgWidget ) - --- -2.21.0.windows.1 - diff --git a/recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch b/recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch deleted file mode 100644 index 19caf4dfed537..0000000000000 --- a/recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch +++ /dev/null @@ -1,259 +0,0 @@ -From 04859156034c6762338411d5f2c07d02d0a7b814 Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Thu, 17 Sep 2020 17:25:12 -0700 -Subject: [PATCH 4/5] Allow explicit control of plugins - ---- - src/osgDB/CMakeLists.txt | 8 ++-- - src/osgPlugins/CMakeLists.txt | 58 ++++++++++++++--------------- - src/osgPlugins/curl/CMakeLists.txt | 4 +- - src/osgPlugins/dicom/CMakeLists.txt | 2 +- - src/osgPlugins/ive/CMakeLists.txt | 2 +- - 5 files changed, 37 insertions(+), 37 deletions(-) - -diff --git a/src/osgDB/CMakeLists.txt b/src/osgDB/CMakeLists.txt -index 340aae095..59b8b3a0d 100644 ---- a/src/osgDB/CMakeLists.txt -+++ b/src/osgDB/CMakeLists.txt -@@ -147,19 +147,19 @@ IF(AV_FOUNDATION_FOUND) - ADD_DEFINITIONS(-DUSE_AV_FOUNDATION) - ENDIF() - --IF(FFMPEG_FOUND) -+IF(OSG_WITH_FFMPEG) - ADD_DEFINITIONS(-DUSE_FFMPEG) - ENDIF() - --IF(INVENTOR_FOUND) -+IF(OSG_WITH_INVENTOR) - ADD_DEFINITIONS(-DUSE_INVENTOR) - ENDIF() - --IF(OPENVRML_FOUND) -+IF(OSG_WITH_OPENVRML) - ADD_DEFINITIONS(-DUSE_VRML) - ENDIF() - --IF( ZLIB_FOUND ) -+IF(OSG_WITH_ZLIB) - ADD_DEFINITIONS( -DUSE_ZLIB ) - INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR} ) - SET(COMPRESSION_LIBRARIES ZLIB_LIBRARIES) -diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt -index 2a88684b5..24dc68667 100644 ---- a/src/osgPlugins/CMakeLists.txt -+++ b/src/osgPlugins/CMakeLists.txt -@@ -99,29 +99,29 @@ ADD_PLUGIN_DIRECTORY(dot) - ADD_PLUGIN_DIRECTORY(vtf) - ADD_PLUGIN_DIRECTORY(ktx) - --IF(JPEG_FOUND) -+IF(OSG_WITH_JPEG) - ADD_PLUGIN_DIRECTORY(jpeg) - ENDIF() --IF(JASPER_FOUND) -+IF(OSG_WITH_JASPER) - ADD_PLUGIN_DIRECTORY(jp2) - ENDIF() --IF(OPENEXR_FOUND AND ZLIB_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_OPENEXR) - ADD_PLUGIN_DIRECTORY(exr) - ENDIF() --IF(GIF_FOUND) -+IF(OSG_WITH_GIF) - ADD_PLUGIN_DIRECTORY(gif) - ENDIF() --IF(PNG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_PNG) - ADD_PLUGIN_DIRECTORY(png) - ENDIF() --IF(TIFF_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_TIFF) - ADD_PLUGIN_DIRECTORY(tiff) - ENDIF() --IF(GDAL_FOUND) -+IF(OSG_WITH_GDAL) - ADD_PLUGIN_DIRECTORY(gdal) - ADD_PLUGIN_DIRECTORY(ogr) - ENDIF() --IF(GTA_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_GTA) - ADD_PLUGIN_DIRECTORY(gta) - ENDIF() - -@@ -130,9 +130,9 @@ ENDIF() - # - # 3D Image plugins - # --IF(DCMTK_FOUND AND ZLIB_FOUND) -+IF(OSG_WITH_DCMTK) - ADD_PLUGIN_DIRECTORY(dicom) --ELSE() -+ELSEIF(FALSE) - IF(ITK_FOUND) - ADD_PLUGIN_DIRECTORY(dicom) - ENDIF() -@@ -147,29 +147,29 @@ ADD_PLUGIN_DIRECTORY(3dc) - - ADD_PLUGIN_DIRECTORY(p3d) - --IF(CURL_FOUND) -+IF(OSG_WITH_CURL) - ADD_PLUGIN_DIRECTORY(curl) - ENDIF() - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_PLUGIN_DIRECTORY(gz) - ENDIF() - - IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE) -- IF(INVENTOR_FOUND) -+ IF(OSG_WITH_INVENTOR) - ADD_PLUGIN_DIRECTORY(Inventor) - ENDIF() - ENDIF() - --IF(COLLADA_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_COLLADA) - ADD_PLUGIN_DIRECTORY(dae) - ENDIF() - --IF(FBX_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_FBX) - ADD_PLUGIN_DIRECTORY(fbx) - ENDIF() - --IF(OPENCASCADE_FOUND) -+IF(OSG_WITH_OPENCASCADE) - ADD_PLUGIN_DIRECTORY(OpenCASCADE) - ENDIF() - -@@ -209,15 +209,15 @@ IF(OSG_CPP_EXCEPTIONS_AVAILABLE) - ADD_PLUGIN_DIRECTORY(txp) - ENDIF() - --IF(FFMPEG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_FFMPEG) - ADD_PLUGIN_DIRECTORY(ffmpeg) - ENDIF() - --IF(GSTREAMER_FOUND AND GLIB_FOUND) -+IF(OSG_WITH_GSTREAMER) - ADD_PLUGIN_DIRECTORY(gstreamer) - ENDIF() - --IF(DIRECTSHOW_FOUND) -+IF(OSG_WITH_DIRECTSHOW) - ADD_PLUGIN_DIRECTORY(directshow) - ENDIF() - -@@ -241,28 +241,28 @@ IF(QTKIT_FOUND) - ADD_PLUGIN_DIRECTORY(QTKit) - ENDIF() - --IF(NVTT_FOUND) -+IF(OSG_WITH_NVTT) - ADD_PLUGIN_DIRECTORY(nvtt) - ENDIF() - - --IF(FREETYPE_FOUND) -+IF(OSG_WITH_FREETYPE) - ADD_PLUGIN_DIRECTORY(freetype) - ENDIF() - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_PLUGIN_DIRECTORY(zip) - ENDIF() - --IF(RSVG_FOUND) -+IF(OSG_WITH_RSVG) - ADD_PLUGIN_DIRECTORY(svg) - ENDIF() - --IF(POPPLER_FOUND) -+IF(OSG_WITH_POPPLER) - ADD_PLUGIN_DIRECTORY(pdf) - ENDIF() - --IF(LIBVNCSERVER_FOUND) -+IF(OSG_WITH_LIBVNCSERVER) - ADD_PLUGIN_DIRECTORY(vnc) - ENDIF() - -@@ -272,7 +272,7 @@ ADD_PLUGIN_DIRECTORY(osc) - ADD_PLUGIN_DIRECTORY(trk) - ADD_PLUGIN_DIRECTORY(tf) - --IF(LIBLAS_FOUND) -+IF(OSG_WITH_LIBLAS) - ADD_PLUGIN_DIRECTORY(las) - ENDIF() - -@@ -299,16 +299,16 @@ ENDIF() - # - # Device integration plugins - # --IF (SDL_FOUND) -+IF(OSG_WITH_SDL) - ADD_PLUGIN_DIRECTORY(sdl) - ENDIF(SDL_FOUND) - --IF(ASIO_FOUND) -+IF(OSG_WITH_ASIO) - ADD_PLUGIN_DIRECTORY(RestHttpDevice) - ENDIF(ASIO_FOUND) - - --IF(ZEROCONF_FOUND) -+IF(OSG_WITH_ZEROCONF) - ADD_PLUGIN_DIRECTORY(ZeroConfDevice) - ENDIF() - -diff --git a/src/osgPlugins/curl/CMakeLists.txt b/src/osgPlugins/curl/CMakeLists.txt -index 4afb738c7..fb5b98498 100644 ---- a/src/osgPlugins/curl/CMakeLists.txt -+++ b/src/osgPlugins/curl/CMakeLists.txt -@@ -5,7 +5,7 @@ IF(WIN32) - SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRT") - ENDIF() - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_DEFINITIONS(-DUSE_ZLIB) - INCLUDE_DIRECTORIES( ${CURL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - ELSE() -@@ -21,7 +21,7 @@ SET(TARGET_H - ReaderWriterCURL.h - ) - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - SET(TARGET_LIBRARIES_VARS - CURL_LIBRARIES - ZLIB_LIBRARIES) -diff --git a/src/osgPlugins/dicom/CMakeLists.txt b/src/osgPlugins/dicom/CMakeLists.txt -index 3f159a9c5..06ccd17ed 100644 ---- a/src/osgPlugins/dicom/CMakeLists.txt -+++ b/src/osgPlugins/dicom/CMakeLists.txt -@@ -1,4 +1,4 @@ --IF (DCMTK_FOUND) -+IF (TRUE) - - # note, we have to include a '/' in front of the directory string to prevent a CMake bug from ignoring the directory - INCLUDE_DIRECTORIES(${DCMTK_INCLUDE_DIRS}) -diff --git a/src/osgPlugins/ive/CMakeLists.txt b/src/osgPlugins/ive/CMakeLists.txt -index 784a79c7e..40030b27d 100644 ---- a/src/osgPlugins/ive/CMakeLists.txt -+++ b/src/osgPlugins/ive/CMakeLists.txt -@@ -1,4 +1,4 @@ --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_DEFINITIONS(-DUSE_ZLIB) - INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR}) - ENDIF() --- -2.21.0.windows.1 - diff --git a/recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch b/recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch new file mode 100644 index 0000000000000..39046ed3994aa --- /dev/null +++ b/recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch @@ -0,0 +1,50 @@ +diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp +index 5c699c8b0..5c097cf66 100644 +--- a/src/osg/DisplaySettings.cpp ++++ b/src/osg/DisplaySettings.cpp +@@ -22,9 +22,6 @@ + #include + #include + +-using namespace osg; +-using namespace std; +- + #if defined(WIN32) && !defined(__CYGWIN__) + #include + extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } +@@ -32,6 +29,9 @@ extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } + extern "C" { int NvOptimusEnablement=0x00000001; } + #endif + ++using namespace osg; ++using namespace std; ++ + void DisplaySettings::setNvOptimusEnablement(int value) + { + NvOptimusEnablement = value; +diff --git a/src/osgPlugins/cfg/ConfigParser.cpp b/src/osgPlugins/cfg/ConfigParser.cpp +index 263c82896..4247cc2af 100644 +--- a/src/osgPlugins/cfg/ConfigParser.cpp ++++ b/src/osgPlugins/cfg/ConfigParser.cpp +@@ -235,7 +235,7 @@ + #include "CameraConfig.h" + + +-using namespace std; ++ + using namespace osgProducer; + + static void ConfigParser_error( const char * ); +diff --git a/src/osgPlugins/cfg/ConfigParser.y b/src/osgPlugins/cfg/ConfigParser.y +index cf9adf507..5221be184 100644 +--- a/src/osgPlugins/cfg/ConfigParser.y ++++ b/src/osgPlugins/cfg/ConfigParser.y +@@ -34,7 +34,7 @@ + #include + + +-using namespace std; ++ + using namespace Producer; + + static void ConfigParser_error( const char * ); diff --git a/recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch b/recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch new file mode 100644 index 0000000000000..5f86f332a80cf --- /dev/null +++ b/recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch @@ -0,0 +1,13 @@ +diff --git a/src/osgUtil/tristripper/include/detail/graph_array.h b/src/osgUtil/tristripper/include/detail/graph_array.h +index dc1f38027..ce7000cc8 100644 +--- a/src/osgUtil/tristripper/include/detail/graph_array.h ++++ b/src/osgUtil/tristripper/include/detail/graph_array.h +@@ -446,7 +446,7 @@ inline void graph_array::swap(graph_type & Right) + template + inline void unmark_nodes(graph_array & G) + { +- std::for_each(G.begin(), G.end(), std::mem_fun_ref(&graph_array::node::unmark)); ++ for(typename graph_array::node_iterator itr = G.begin(); itr != G.end(); ++itr) itr->unmark(); + } + + diff --git a/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch b/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch new file mode 100644 index 0000000000000..de0f3ee7139ef --- /dev/null +++ b/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch @@ -0,0 +1,75 @@ +diff --git a/src/osgPlugins/dae/ReaderWriterDAE.cpp b/src/osgPlugins/dae/ReaderWriterDAE.cpp +index fc1a448d4..3b883f19a 100644 +--- a/src/osgPlugins/dae/ReaderWriterDAE.cpp ++++ b/src/osgPlugins/dae/ReaderWriterDAE.cpp +@@ -32,7 +32,7 @@ + + #define SERIALIZER() OpenThreads::ScopedLock lock(_serializerMutex) + +-#if __cplusplus > 199711L ++#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) + #define smart_ptr std::unique_ptr + #else + #define smart_ptr std::auto_ptr +diff --git a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp +index 69826c456..9bba5532a 100644 +--- a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp ++++ b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp +@@ -10,6 +10,11 @@ + + #define STREAM_TIMEOUT_IN_SECONDS_TO_CONSIDER_IT_DEAD 10 + ++#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) ++ template using smart_ptr = std::unique_ptr; ++#else ++ #define smart_ptr std::auto_ptr ++#endif + + namespace osgFFmpeg { + +@@ -23,8 +28,8 @@ FFmpegImageStream::FFmpegImageStream() : + { + setOrigin(osg::Image::TOP_LEFT); + +- std::auto_ptr decoder(new FFmpegDecoder); +- std::auto_ptr commands(new CommandQueue); ++ smart_ptr decoder(new FFmpegDecoder); ++ smart_ptr commands(new CommandQueue); + + m_decoder = decoder.release(); + m_commands = commands.release(); +diff --git a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp +index 298e02fcc..113c9c45f 100644 +--- a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp ++++ b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp +@@ -34,6 +34,12 @@ + + #define SERIALIZER() OpenThreads::ScopedLock lock(_serializerMutex) + ++#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) ++ #define smart_ptr std::unique_ptr ++#else ++ #define smart_ptr std::auto_ptr ++#endif ++ + // From easyrgb.com + float Hue_2_RGB( float v1, float v2, float vH ) + { +@@ -123,7 +129,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter + + initGDAL(); + +- std::auto_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); ++ smart_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); + if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED; + + int dataWidth = dataset->GetRasterXSize(); +@@ -577,7 +583,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter + + initGDAL(); + +- std::auto_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); ++ smart_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); + if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED; + + int dataWidth = dataset->GetRasterXSize(); diff --git a/recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch b/recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch new file mode 100644 index 0000000000000..139031361bc28 --- /dev/null +++ b/recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch @@ -0,0 +1,24 @@ +diff --git a/src/osgPlugins/obj/obj.cpp b/src/osgPlugins/obj/obj.cpp +index 859add652..3580e5181 100644 +--- a/src/osgPlugins/obj/obj.cpp ++++ b/src/osgPlugins/obj/obj.cpp +@@ -37,10 +37,15 @@ using namespace obj; + + static std::string strip( const std::string& ss ) + { +- std::string result; +- result.assign( std::find_if( ss.begin(), ss.end(), std::not1( std::ptr_fun< int, int >( isspace ) ) ), +- std::find_if( ss.rbegin(), ss.rend(), std::not1( std::ptr_fun< int, int >( isspace ) ) ).base() ); +- return( result ); ++ std::string::const_iterator it = ss.begin(); ++ while (it != ss.end() && isspace(*it)) ++ it++; ++ ++ std::string::const_reverse_iterator rit = ss.rbegin(); ++ while (rit.base() != it && isspace(*rit)) ++ rit++; ++ ++ return std::string(it, rit.base()); + } + + /* diff --git a/recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch b/recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch new file mode 100644 index 0000000000000..9a1ea80d16a65 --- /dev/null +++ b/recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch @@ -0,0 +1,187 @@ +From b9f32bf6df5af101624bb065175097d8d96067c2 Mon Sep 17 00:00:00 2001 +From: czoido +Date: Thu, 25 Jan 2024 09:32:10 +0100 +Subject: [PATCH] remove deprecated register + +--- + src/osgPlugins/cfg/ConfigLexer.cpp | 40 ++++++++++++++--------------- + src/osgPlugins/cfg/ConfigParser.cpp | 16 ++++++------ + 2 files changed, 28 insertions(+), 28 deletions(-) + +diff --git a/src/osgPlugins/cfg/ConfigLexer.cpp b/src/osgPlugins/cfg/ConfigLexer.cpp +index 4e169efe4..cba6d6f9e 100644 +--- a/src/osgPlugins/cfg/ConfigLexer.cpp ++++ b/src/osgPlugins/cfg/ConfigLexer.cpp +@@ -832,9 +832,9 @@ YY_MALLOC_DECL + + YY_DECL + { +- register yy_state_type yy_current_state; +- register char *yy_cp, *yy_bp; +- register int yy_act; ++ yy_state_type yy_current_state; ++ char *yy_cp, *yy_bp; ++ int yy_act; + + #line 35 ".././ConfigLexer.l" + +@@ -881,7 +881,7 @@ YY_DECL + yy_match: + do + { +- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; ++ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; +@@ -1598,9 +1598,9 @@ void yyFlexLexer::LexerOutput( const char* buf, int size ) + + int yyFlexLexer::yy_get_next_buffer() + { +- register char *dest = yy_current_buffer->yy_ch_buf; +- register char *source = yytext_ptr; +- register int number_to_move, i; ++ char *dest = yy_current_buffer->yy_ch_buf; ++ char *source = yytext_ptr; ++ int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) +@@ -1730,14 +1730,14 @@ int yyFlexLexer::yy_get_next_buffer() + + yy_state_type yyFlexLexer::yy_get_previous_state() + { +- register yy_state_type yy_current_state; +- register char *yy_cp; ++ yy_state_type yy_current_state; ++ char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { +- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); ++ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; +@@ -1764,10 +1764,10 @@ yy_state_type yyFlexLexer::yy_get_previous_state() + + yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + { +- register int yy_is_jam; +- register char *yy_cp = yy_c_buf_p; ++ int yy_is_jam; ++ char *yy_cp = yy_c_buf_p; + +- register YY_CHAR yy_c = 1; ++ YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; +@@ -1786,9 +1786,9 @@ yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + } + + +-void yyFlexLexer::yyunput( int c, register char* yy_bp ) ++void yyFlexLexer::yyunput( int c, char* yy_bp ) + { +- register char *yy_cp = yy_c_buf_p; ++ char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; +@@ -1796,10 +1796,10 @@ void yyFlexLexer::yyunput( int c, register char* yy_bp ) + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ +- register int number_to_move = yy_n_chars + 2; +- register char *dest = &yy_current_buffer->yy_ch_buf[ ++ int number_to_move = yy_n_chars + 2; ++ char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; +- register char *source = ++ char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) +@@ -2119,7 +2119,7 @@ yyconst char *s2; + int n; + #endif + { +- register int i; ++ int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +@@ -2133,7 +2133,7 @@ static int yy_flex_strlen( s ) + yyconst char *s; + #endif + { +- register int n; ++ int n; + for ( n = 0; s[n]; ++n ) + ; + +diff --git a/src/osgPlugins/cfg/ConfigParser.cpp b/src/osgPlugins/cfg/ConfigParser.cpp +index 263c82896..62d30c3f5 100644 +--- a/src/osgPlugins/cfg/ConfigParser.cpp ++++ b/src/osgPlugins/cfg/ConfigParser.cpp +@@ -351,7 +351,7 @@ union yyalloc + # define YYCOPY(To, From, Count) \ + do \ + { \ +- register YYSIZE_T yyi; \ ++ YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ +@@ -1025,7 +1025,7 @@ yystrlen (yystr) + const char *yystr; + # endif + { +- register const char *yys = yystr; ++ const char *yys = yystr; + + while (*yys++ != '\0') + continue; +@@ -1050,8 +1050,8 @@ yystpcpy (yydest, yysrc) + const char *yysrc; + # endif + { +- register char *yyd = yydest; +- register const char *yys = yysrc; ++ char *yyd = yydest; ++ const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; +@@ -1175,8 +1175,8 @@ yyparse () + #endif + { + +- register int yystate; +- register int yyn; ++ int yystate; ++ int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; +@@ -1194,12 +1194,12 @@ yyparse () + /* The state stack. */ + short yyssa[YYINITDEPTH]; + short *yyss = yyssa; +- register short *yyssp; ++ short *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; +- register YYSTYPE *yyvsp; ++ YYSTYPE *yyvsp; + + + +-- +2.39.3 (Apple Git-145) + diff --git a/recipes/openscenegraph/all/test_package/CMakeLists.txt b/recipes/openscenegraph/all/test_package/CMakeLists.txt index c2aca0be1b70a..fcd48ccf6e39d 100644 --- a/recipes/openscenegraph/all/test_package/CMakeLists.txt +++ b/recipes/openscenegraph/all/test_package/CMakeLists.txt @@ -1,21 +1,58 @@ -cmake_minimum_required(VERSION 3.1.2) -project(test_package) - -include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(OpenSceneGraph REQUIRED) - -include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) -link_libraries(${OPENSCENEGRAPH_LIBRARIES}) -add_compile_definitions(${OPENSCENEGRAPH_COMPILE_DEFINITIONS}) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) +find_package(OpenSceneGraph REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} OpenSceneGraph::OpenSceneGraph) -get_property(cache_variables DIRECTORY PROPERTY CACHE_VARIABLES) -foreach(cache_variable ${cache_variables}) - if("${cache_variable}" MATCHES "^OSG_HAS_(WITH_.+)$") - add_compile_definitions("${CMAKE_MATCH_1}=${${cache_variable}}") - endif() +get_directory_property(compile_definitions DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS) +foreach(compile_definition ${compile_definitions}) + if("${compile_definition}" MATCHES "(WITH_.+)=(1)$") + string(REPLACE "=" ";" definition_list ${compile_definition}) + list(GET definition_list 0 definition_key) + list(GET definition_list 1 definition_value) + message("Defined: ${definition_key}=${definition_value}") + if("${definition_key}" STREQUAL "WITH_BMP") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_bmp) + endif() + if("${definition_key}" STREQUAL "WITH_JPEG") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_jpeg) + endif() + if("${definition_key}" STREQUAL "WITH_JASPER") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_jp2) + endif() + if("${definition_key}" STREQUAL "WITH_OPENEXR") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_exr) + endif() + if("${definition_key}" STREQUAL "WITH_GIF") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gif) + endif() + if("${definition_key}" STREQUAL "WITH_PNG") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_png) + endif() + if("${definition_key}" STREQUAL "WITH_TIFF") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_tiff) + endif() + if("${definition_key}" STREQUAL "WITH_GDAL") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gdal) + endif() + if("${definition_key}" STREQUAL "WITH_GTA") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gta) + endif() + if("${definition_key}" STREQUAL "WITH_DCMTK") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_dicom) + endif() + if("${definition_key}" STREQUAL "WITH_CURL") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_curl) + endif() + if("${definition_key}" STREQUAL "WITH_ZLIB") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gz) + endif() + if("${definition_key}" STREQUAL "WITH_FREETYPE") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_freetype) + endif() + if("${definition_key}" STREQUAL "WITH_IMAGEIO") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_imageio) + endif() + endif() endforeach() - -add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/openscenegraph/all/test_package/conanfile.py b/recipes/openscenegraph/all/test_package/conanfile.py index 0e02c2d008408..b27efd09cb3f1 100644 --- a/recipes/openscenegraph/all/test_package/conanfile.py +++ b/recipes/openscenegraph/all/test_package/conanfile.py @@ -1,25 +1,43 @@ -from conans import CMake, ConanFile, 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, 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 build(self): - cmake = CMake(self) - for key, value in self.options["openscenegraph"].items(): + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + for key, value in self.dependencies["openscenegraph"].options.items(): if key.startswith("with_"): - cmake.definitions["OSG_HAS_" + key.upper()] = 1 if value else 0 - if self.settings.os == "Macos": - cmake.definitions["OSG_HAS_WITH_GIF"] = 0 - cmake.definitions["OSG_HAS_WITH_JPEG"] = 0 - cmake.definitions["OSG_HAS_WITH_PNG"] = 0 + tc.preprocessor_definitions[key.upper()] = 1 if str(value) != "False" else 0 + #OSG always builds the bmp plugin + tc.preprocessor_definitions["WITH_BMP"] = 1 + if is_apple_os(self): + tc.preprocessor_definitions["WITH_GIF"] = 0 + tc.preprocessor_definitions["WITH_JPEG"] = 0 + tc.preprocessor_definitions["WITH_PNG"] = 0 + # OSG builds the imageio plugin on apple platforms + tc.preprocessor_definitions["WITH_IMAGEIO"] = 1 + tc.generate() + + 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) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/openscenegraph/all/test_package/test_package.cpp b/recipes/openscenegraph/all/test_package/test_package.cpp index d165af7b34733..c833eb8e3caee 100644 --- a/recipes/openscenegraph/all/test_package/test_package.cpp +++ b/recipes/openscenegraph/all/test_package/test_package.cpp @@ -4,14 +4,8 @@ #include #include -// OSG always builds the bmp plugin -#define WITH_BMP 1 - -// OSG builds the imageio plugin on apple platforms -#ifdef __APPLE__ -# define WITH_IMAGEIO 1 -#else -# define WITH_IMAGEIO 0 +#ifndef WITH_IMAGEIO +#define WITH_IMAGEIO 0 #endif #ifdef OSG_LIBRARY_STATIC diff --git a/recipes/openslide/all/conandata.yml b/recipes/openslide/all/conandata.yml new file mode 100644 index 0000000000000..ca29cdf478653 --- /dev/null +++ b/recipes/openslide/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.0.0": + url: "https://github.com/openslide/openslide/releases/download/v4.0.0/openslide-4.0.0.tar.xz" + sha256: "cc227c44316abb65fb28f1c967706eb7254f91dbfab31e9ae6a48db6cf4ae562" +patches: + "4.0.0": + - patch_file: "patches/0001-no-openslide-poison.patch" + patch_description: "Fix 'error__use__openslide_fclose_instead' compilation error" + patch_type: "backport" + patch_source: "https://github.com/openslide/openslide/commit/048865a3b61e9bc2b61219168d434b61e784d355" diff --git a/recipes/openslide/all/conanfile.py b/recipes/openslide/all/conanfile.py new file mode 100644 index 0000000000000..0557d9913ef70 --- /dev/null +++ b/recipes/openslide/all/conanfile.py @@ -0,0 +1,138 @@ +import os + +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, export_conandata_patches, apply_conandata_patches +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 + +required_conan_version = ">=1.53.0" + + +class OpenSlideConan(ConanFile): + name = "openslide" + description = "OpenSlide is a C library for reading whole slide image files (also known as virtual slides)" + license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://openslide.org/" + topics = ("image", "pathology", "whole-slide-imaging", "slide-image", + # supported formats + "bif", "dicom", "dcm", "mrxs", "ndpi", "scn", "svs", "svslide", "tiff", "vms", "vmu") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg"], + } + default_options = { + "shared": False, + "fPIC": True, + "jpeg": "libjpeg", + } + + 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.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("cairo/1.18.0") + self.requires("gdk-pixbuf/2.42.10") + self.requires("glib/2.78.3") + self.requires("libdicom/1.0.5") + self.requires("libpng/[>=1.6 <2]") + self.requires("libtiff/4.6.0") + self.requires("libxml2/[>=2.12.5 <3]") + self.requires("openjpeg/2.5.2") + self.requires("sqlite3/3.45.3") + self.requires("zlib/[>=1.2.11 <2]") + if self.options.jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/3.0.2") + elif self.options.jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.5") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("OpenSlide requires GNU C extensions support and is not compatible with MSVC") + + def build_requirements(self): + self.tool_requires("meson/[>=1.2.3 <2]") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + self.tool_requires("glib/") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + tc = MesonToolchain(self) + tc.project_options["test"] = "disabled" + tc.project_options["doc"] = "disabled" + tc.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING.LESSER", 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 = ["openslide"] + self.cpp_info.includedirs.append(os.path.join("include", "openslide")) + + if self.settings.os == "Macos": + self.cpp_info.frameworks = ["CoreText"] + + self.cpp_info.requires = [ + "cairo::cairo_", + "gdk-pixbuf::gdk-pixbuf", + "glib::gio-2.0", + "glib::glib-2.0", + "glib::gobject-2.0", + "libdicom::libdicom", + "libpng::libpng", + "libtiff::libtiff", + "libxml2::libxml2", + "openjpeg::openjpeg", + "sqlite3::sqlite3", + "zlib::zlib", + ] + if self.options.jpeg == "libjpeg": + self.cpp_info.requires.append("libjpeg::libjpeg") + elif self.options.jpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + elif self.options.jpeg == "mozjpeg": + self.cpp_info.requires.append("mozjpeg::libjpeg") diff --git a/recipes/openslide/all/patches/0001-no-openslide-poison.patch b/recipes/openslide/all/patches/0001-no-openslide-poison.patch new file mode 100644 index 0000000000000..00a38642d6421 --- /dev/null +++ b/recipes/openslide/all/patches/0001-no-openslide-poison.patch @@ -0,0 +1,308 @@ +From 048865a3b61e9bc2b61219168d434b61e784d355 Mon Sep 17 00:00:00 2001 +From: Benjamin Gilbert +Date: Mon, 12 Feb 2024 20:44:45 +0900 +Subject: [PATCH] Replace _OPENSLIDE_POISON() with pre-commit check + +Preprocessor macros are somewhat clunky as a way to prevent use of +forbidden functions. Now that we have pre-commit checks, use those +instead. Allow forbidden function calls in wrapper implementations by +ignoring call sites with "ci-allow" in a comment on the same line. + +Signed-off-by: Benjamin Gilbert +--- + .pre-commit-config.yaml | 29 +++++++++++++++++++++++++++++ + src/openslide-decode-sqlite.c | 10 +++------- + src/openslide-decode-tiff.c | 8 ++------ + src/openslide-file.c | 20 +++++++------------- + src/openslide-jdatasrc.c | 2 +- + src/openslide-private.h | 27 --------------------------- + src/openslide-util.c | 4 +--- + src/openslide-vendor-synthetic.c | 7 +++---- + 8 files changed, 46 insertions(+), 61 deletions(-) + +diff --git a/src/openslide-decode-sqlite.c b/src/openslide-decode-sqlite.c +index f75083df5..119b71b5a 100644 +--- a/src/openslide-decode-sqlite.c ++++ b/src/openslide-decode-sqlite.c +@@ -44,7 +44,6 @@ static int profile_callback(unsigned trace_type G_GNUC_UNUSED, + return 0; + } + +-#undef sqlite3_open_v2 + static sqlite3 *do_open(const char *filename, int flags, GError **err) { + sqlite3 *db; + +@@ -55,7 +54,7 @@ static sqlite3 *do_open(const char *filename, int flags, GError **err) { + return NULL; + } + +- ret = sqlite3_open_v2(filename, &db, flags, NULL); ++ ret = sqlite3_open_v2(filename, &db, flags, NULL); // ci-allow + + if (ret) { + if (db) { +@@ -76,7 +75,6 @@ static sqlite3 *do_open(const char *filename, int flags, GError **err) { + + return db; + } +-#define sqlite3_open_v2 _OPENSLIDE_POISON(_openslide_sqlite_open) + + sqlite3 *_openslide_sqlite_open(const char *filename, GError **err) { + // ":" filename prefix is reserved. +@@ -131,12 +129,10 @@ void _openslide_sqlite_propagate_stmt_error(sqlite3_stmt *stmt, GError **err) { + _openslide_sqlite_propagate_error(sqlite3_db_handle(stmt), err); + } + +-#undef sqlite3_close + void _openslide_sqlite_close(sqlite3 *db) { +- // sqlite3_close() failures indicate a leaked resource, probably a ++ // sqlite3_close failures indicate a leaked resource, probably a + // prepared statement. +- if (sqlite3_close(db)) { ++ if (sqlite3_close(db)) { // ci-allow + g_warning("SQLite error: %s", sqlite3_errmsg(db)); + } + } +-#define sqlite3_close _OPENSLIDE_POISON(_openslide_sqlite_close) +diff --git a/src/openslide-decode-tiff.c b/src/openslide-decode-tiff.c +index 0af196479..ed294f18f 100644 +--- a/src/openslide-decode-tiff.c ++++ b/src/openslide-decode-tiff.c +@@ -74,7 +74,6 @@ struct associated_image { + result = tmp; \ + } while (0) + +-#undef TIFFSetDirectory + bool _openslide_tiff_set_dir(TIFF *tiff, + tdir_t dir, + GError **err) { +@@ -82,14 +81,13 @@ bool _openslide_tiff_set_dir(TIFF *tiff, + // avoid libtiff unnecessarily rereading directory contents + return true; + } +- if (!TIFFSetDirectory(tiff, dir)) { ++ if (!TIFFSetDirectory(tiff, dir)) { // ci-allow + g_set_error(err, OPENSLIDE_ERROR, OPENSLIDE_ERROR_FAILED, + "Cannot set TIFF directory %d", dir); + return false; + } + return true; + } +-#define TIFFSetDirectory _OPENSLIDE_POISON(_openslide_tiff_set_dir) + + bool _openslide_tiff_level_init(TIFF *tiff, + tdir_t dir, +@@ -587,7 +585,6 @@ static toff_t tiff_do_size(thandle_t th) { + return hdl->size; + } + +-#undef TIFFClientOpen + static TIFF *tiff_open(struct _openslide_tiffcache *tc, GError **err) { + // open + g_autoptr(_openslide_file) f = _openslide_fopen(tc->filename, err); +@@ -646,7 +643,7 @@ static TIFF *tiff_open(struct _openslide_tiffcache *tc, GError **err) { + + // TIFFOpen + // mode: m disables mmap to avoid sigbus and other mmap fragility +- TIFF *tiff = TIFFClientOpen(tc->filename, "rm", hdl, ++ TIFF *tiff = TIFFClientOpen(tc->filename, "rm", hdl, // ci-allow + tiff_do_read, tiff_do_write, tiff_do_seek, + tiff_do_close, tiff_do_size, NULL, NULL); + if (tiff == NULL) { +@@ -656,7 +653,6 @@ static TIFF *tiff_open(struct _openslide_tiffcache *tc, GError **err) { + } + return tiff; + } +-#define TIFFClientOpen _OPENSLIDE_POISON(_openslide_tiffcache_get) + + struct _openslide_tiffcache *_openslide_tiffcache_create(const char *filename) { + struct _openslide_tiffcache *tc = g_new0(struct _openslide_tiffcache, 1); +diff --git a/src/openslide-file.c b/src/openslide-file.c +index 2763f3807..9eb9b1039 100644 +--- a/src/openslide-file.c ++++ b/src/openslide-file.c +@@ -22,7 +22,6 @@ + + #include + +-#define NO_POISON_FSEEKO + #include "openslide-private.h" + + #include +@@ -44,13 +43,8 @@ struct _openslide_dir { + GDir *dir; + }; + +-#undef fopen +-#undef fread +-#undef fclose +-#undef g_file_test +- + static void wrap_fclose(FILE *fp) { +- fclose(fp); ++ fclose(fp); // ci-allow + } + G_DEFINE_AUTOPTR_CLEANUP_FUNC(FILE, wrap_fclose) + +@@ -87,7 +81,7 @@ static FILE *do_fopen(const char *path, const char *mode, GError **err) { + io_error(err, "Couldn't open %s", path); + } + #else +- f = fopen(path, mode); ++ f = fopen(path, mode); // ci-allow + if (f == NULL) { + io_error(err, "Couldn't open %s", path); + } +@@ -132,7 +126,7 @@ size_t _openslide_fread(struct _openslide_file *file, void *buf, size_t size) { + char *bufp = buf; + size_t total = 0; + while (total < size) { +- size_t count = fread(bufp + total, 1, size - total, file->fp); ++ size_t count = fread(bufp + total, 1, size - total, file->fp); // ci-allow + if (count == 0) { + return total; + } +@@ -143,7 +137,7 @@ size_t _openslide_fread(struct _openslide_file *file, void *buf, size_t size) { + + bool _openslide_fseek(struct _openslide_file *file, off_t offset, int whence, + GError **err) { +- if (fseeko(file->fp, offset, whence)) { ++ if (fseeko(file->fp, offset, whence)) { // ci-allow + g_set_error(err, G_FILE_ERROR, g_file_error_from_errno(errno), + "%s", g_strerror(errno)); + return false; +@@ -152,7 +146,7 @@ bool _openslide_fseek(struct _openslide_file *file, off_t offset, int whence, + } + + off_t _openslide_ftell(struct _openslide_file *file, GError **err) { +- off_t ret = ftello(file->fp); ++ off_t ret = ftello(file->fp); // ci-allow + if (ret == -1) { + g_set_error(err, G_FILE_ERROR, g_file_error_from_errno(errno), + "%s", g_strerror(errno)); +@@ -179,12 +173,12 @@ off_t _openslide_fsize(struct _openslide_file *file, GError **err) { + } + + void _openslide_fclose(struct _openslide_file *file) { +- fclose(file->fp); ++ fclose(file->fp); // ci-allow + g_free(file); + } + + bool _openslide_fexists(const char *path, GError **err G_GNUC_UNUSED) { +- return g_file_test(path, G_FILE_TEST_EXISTS); ++ return g_file_test(path, G_FILE_TEST_EXISTS); // ci-allow + } + + struct _openslide_dir *_openslide_dir_open(const char *dirname, GError **err) { +diff --git a/src/openslide-jdatasrc.c b/src/openslide-jdatasrc.c +index 2ad068818..4de54eddf 100644 +--- a/src/openslide-jdatasrc.c ++++ b/src/openslide-jdatasrc.c +@@ -158,7 +158,7 @@ static void skip_input_data (j_decompress_ptr cinfo, long num_bytes) + { + struct jpeg_source_mgr * src = cinfo->src; + +- /* Just a dumb implementation for now. Could use fseek() except ++ /* Just a dumb implementation for now. Could use fseek except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ +diff --git a/src/openslide-private.h b/src/openslide-private.h +index 5ae36939b..ed08f5ed7 100644 +--- a/src/openslide-private.h ++++ b/src/openslide-private.h +@@ -383,33 +383,6 @@ extern const int32_t _openslide_G_Cb[256]; + extern const int32_t _openslide_G_Cr[256]; + extern const int16_t _openslide_B_Cb[256]; + +-/* Prevent use of dangerous functions and functions with mandatory wrappers. +- Every @p replacement must be unique to avoid conflicting-type errors. */ +-#define _OPENSLIDE_POISON(replacement) error__use_ ## replacement ## _instead +-#define fopen _OPENSLIDE_POISON(_openslide_fopen) +-#define fread _OPENSLIDE_POISON(_openslide_fread) +-#define fseek _OPENSLIDE_POISON(_openslide_fseek) +-#define ftell _OPENSLIDE_POISON(_openslide_ftell) +-#define fclose _OPENSLIDE_POISON(_openslide_fclose) +-#define g_file_test _OPENSLIDE_POISON(_openslide_fexists) +-#define strtod _OPENSLIDE_POISON(_openslide_parse_double) +-#define g_ascii_strtod _OPENSLIDE_POISON(_openslide_parse_double_) +-#define sqlite3_open _OPENSLIDE_POISON(_openslide_sqlite_open) +-#define sqlite3_open_v2 _OPENSLIDE_POISON(_openslide_sqlite_open_) +-#define sqlite3_close _OPENSLIDE_POISON(_openslide_sqlite_close) +-#define TIFFClientOpen _OPENSLIDE_POISON(_openslide_tiffcache_get) +-#define TIFFFdOpen _OPENSLIDE_POISON(_openslide_tiffcache_get_) +-#define TIFFOpen _OPENSLIDE_POISON(_openslide_tiffcache_get__) +-#define TIFFSetDirectory _OPENSLIDE_POISON(_openslide_tiff_set_dir) +- +-#ifndef NO_POISON_FSEEKO +-// openslide-file.c needs the original macros +-#undef fseeko +-#undef ftello +-#define fseeko _OPENSLIDE_POISON(_openslide_fseek_) +-#define ftello _OPENSLIDE_POISON(_openslide_ftell_) +-#endif +- + #ifdef _WIN32 + // Prevent windows.h from defining the IN/OUT macro + #define _NO_W32_PSEUDO_MODIFIERS +diff --git a/src/openslide-util.c b/src/openslide-util.c +index 719953274..b85f9afa3 100644 +--- a/src/openslide-util.c ++++ b/src/openslide-util.c +@@ -170,7 +170,6 @@ void *_openslide_inflate_buffer(const void *src, int64_t src_len, + return g_steal_pointer(&dst); + } + +-#undef g_ascii_strtod + double _openslide_parse_double(const char *value) { + // Canonicalize comma to decimal point, since the locale of the + // originating system sometimes leaks into slide files. +@@ -180,14 +179,13 @@ double _openslide_parse_double(const char *value) { + + char *endptr; + errno = 0; +- double result = g_ascii_strtod(canonical, &endptr); ++ double result = g_ascii_strtod(canonical, &endptr); // ci-allow + // fail on overflow/underflow + if (canonical[0] == 0 || endptr[0] != 0 || errno == ERANGE) { + return NAN; + } + return result; + } +-#define g_ascii_strtod _OPENSLIDE_POISON(_openslide_parse_double) + + char *_openslide_format_double(double d) { + char buf[G_ASCII_DTOSTR_BUF_SIZE]; +diff --git a/src/openslide-vendor-synthetic.c b/src/openslide-vendor-synthetic.c +index e3a440569..79938a597 100644 +--- a/src/openslide-vendor-synthetic.c ++++ b/src/openslide-vendor-synthetic.c +@@ -204,7 +204,6 @@ static toff_t mem_tiff_size(thandle_t th) { + return mem->size; + } + +-#undef TIFFClientOpen + static bool decode_tiff(const void *data, uint32_t len, + uint32_t *dest, GError **err) { + // there's no reason for OpenSlide as a whole to support reading entire +@@ -216,8 +215,9 @@ static bool decode_tiff(const void *data, uint32_t len, + }; + // mode: m disables mmap to avoid sigbus and other mmap fragility + g_autoptr(TIFF) tiff = +- TIFFClientOpen("tiff", "rm", &mem, mem_tiff_read, mem_tiff_write, +- mem_tiff_seek, mem_tiff_close, mem_tiff_size, NULL, NULL); ++ TIFFClientOpen("tiff", "rm", &mem, mem_tiff_read, // ci-allow ++ mem_tiff_write, mem_tiff_seek, mem_tiff_close, ++ mem_tiff_size, NULL, NULL); + if (tiff == NULL) { + g_set_error(err, OPENSLIDE_ERROR, OPENSLIDE_ERROR_FAILED, + "Couldn't open TIFF"); +@@ -238,7 +238,6 @@ static bool decode_tiff(const void *data, uint32_t len, + + return _openslide_tiff_read_tile(&tiffl, tiff, dest, 0, 0, err); + } +-#define TIFFClientOpen _OPENSLIDE_POISON(_openslide_tiffcache_get) + + static bool decode_xml(const void *data, uint32_t len, + uint32_t *dest, GError **err) { diff --git a/recipes/openslide/all/test_package/conanfile.py b/recipes/openslide/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2e3df45816e5a --- /dev/null +++ b/recipes/openslide/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/openslide/all/test_package/meson.build b/recipes/openslide/all/test_package/meson.build new file mode 100644 index 0000000000000..b22a34bfa7460 --- /dev/null +++ b/recipes/openslide/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('openslide') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/openslide/all/test_package/test_package.c b/recipes/openslide/all/test_package/test_package.c new file mode 100644 index 0000000000000..ea806b718030d --- /dev/null +++ b/recipes/openslide/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("OpenSlide version: %s\n", openslide_get_version()); + return 0; +} diff --git a/recipes/openslide/config.yml b/recipes/openslide/config.yml new file mode 100644 index 0000000000000..d2be8f453d7c0 --- /dev/null +++ b/recipes/openslide/config.yml @@ -0,0 +1,3 @@ +versions: + "4.0.0": + folder: all diff --git a/recipes/openssh/all/conandata.yml b/recipes/openssh/all/conandata.yml new file mode 100644 index 0000000000000..a3e0ea1fc2e6b --- /dev/null +++ b/recipes/openssh/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "9.9p1": + url: "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p1.tar.gz" + sha256: "b343fbcdbff87f15b1986e6e15d6d4fc9a7d36066be6b7fb507087ba8f966c02" + "9.6p1": + url: "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.6p1.tar.gz" + sha256: "910211c07255a8c5ad654391b40ee59800710dd8119dd5362de09385aa7a777c" + "9.1p1": + url: "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz" + sha256: "19f85009c7e3e23787f0236fbb1578392ab4d4bf9f8ec5fe6bc1cd7e8bfdd288" diff --git a/recipes/openssh/all/conanfile.py b/recipes/openssh/all/conanfile.py new file mode 100644 index 0000000000000..193d5c2993c51 --- /dev/null +++ b/recipes/openssh/all/conanfile.py @@ -0,0 +1,141 @@ +from os.path import join + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, replace_in_file, rmdir, export_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.54.0" + + +class PackageConan(ConanFile): + name = "openssh" + description = "The OpenSSH (portable) suite of secure connectivity tools" + license = "SSH-OpenSSH" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.openssh.com/portable.html" + topics = ("security", "cryptography", "login", "keychain", "file-sharing", "ssh") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_libcrypto": [False, "libressl", "openssl"], + "with_pam": [False, "openpam"], # linux-pam and Solaris PAM are also supported + "with_selinux": [True, False], + "with_libedit": [True, False], + "with_strip": [True, False], + "with_sandbox": [False, "auto", "capsicum", "darwin", "rlimit", "seccomp_filter", "systrace", "pledge"] + } + default_options = { + "with_libcrypto": "openssl", + "with_pam": False, + "with_selinux": False, + "with_libedit": False, + "with_strip": True, + "with_sandbox": "auto" + } + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type + + def export_sources(self): + export_conandata_patches(self) + + 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("zlib/[>=1.2.11 <2]") + if self.options.with_libcrypto == "openssl": + self.requires("openssl/[>=1.1 <4]") + elif self.options.with_libcrypto == "libressl": + self.requires("libressl/3.9.1") + if self.options.with_pam == "openpam": + self.requires("openpam/20190224") + if self.options.with_libedit: + self.requires("editline/3.1") + + def validate(self): + if self.settings.os in ["baremetal", "Windows"]: + 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) + if self.version in ["9.1p1", "9.6p1"]: + # Backport configure script fix to accept OpenSSL versions in the 3.x series + # See https://github.com/openssh/openssh-portable/commit/2eded551ba96e66bc3afbbcc883812c2eac02bd7 + replace_in_file(self, join(self.source_folder, "configure"), "300*", "30*") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + ad = AutotoolsDeps(self) + ad.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.append("--without-zlib-version-check") + + if not self.options.with_strip: + tc.configure_args.append("--disable-strip") + + if self.options.with_selinux: + tc.configure_args.append("--with-selinux") + + if self.options.with_pam: + tc.configure_args.append("--with-pam") + + if self.options.with_libedit: + editline = self.dependencies["editline"] + tc.configure_args.append("--with-libedit={}".format(editline.package_folder)) + + if self.options.with_libcrypto == "openssl": + openssl = self.dependencies["openssl"] + tc.configure_args.append("--with-ssl-dir={}".format(openssl.package_folder)) + # It needs libcrypto.so in build time context + if openssl.options.shared: + env = VirtualRunEnv(self) + env.generate(scope="build") + elif self.options.with_libcrypto == "libressl": + libressl = self.dependencies["libressl"] + tc.configure_args.append("--with-ssl-dir={}".format(libressl.package_folder)) + else: + tc.configure_args.append("--without-openssl") + + if self.options.with_sandbox != 'auto': + tc.configure_args.append("--with-sandbox={}".format(self.options.with_sandbox or "no")) + + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + autotools = Autotools(self) + + install_target = 'install-nokeys' if cross_building(self) else 'install' + autotools.install(target=install_target) + + copy(self, "LICENCE", src=self.source_folder, dst=join(self.package_folder, "licenses"), ignore_case=True) + copy(self, "*", src=join(self.package_folder, "libexec"), dst=join(self.package_folder, "bin"), ignore_case=True) + + rmdir(self, join(self.package_folder, "etc")) + rmdir(self, join(self.package_folder, "var")) + rmdir(self, join(self.package_folder, "share")) + rmdir(self, join(self.package_folder, "libexec")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + bindir = join(self.package_folder, "bin") + self.runenv_info.prepend_path("PATH", bindir) diff --git a/recipes/openssh/all/test_package/conanfile.py b/recipes/openssh/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6198df68dc282 --- /dev/null +++ b/recipes/openssh/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +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 build(self): + pass + + def test(self): + if can_run(self): + self.run("ssh -Q help", env="conanrun") diff --git a/recipes/openssh/config.yml b/recipes/openssh/config.yml new file mode 100644 index 0000000000000..4bf3079108d3e --- /dev/null +++ b/recipes/openssh/config.yml @@ -0,0 +1,7 @@ +versions: + "9.9p1": + folder: all + "9.6p1": + folder: all + "9.1p1": + folder: all diff --git a/recipes/openssl/1.x.x/conandata.yml b/recipes/openssl/1.x.x/conandata.yml index 22aae5e08d56c..26bc447884d03 100644 --- a/recipes/openssl/1.x.x/conandata.yml +++ b/recipes/openssl/1.x.x/conandata.yml @@ -1,10 +1,7 @@ sources: 1.1.1w: sha256: cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 - url: - - "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" + url: "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz" patches: 1.1.1w: - patch_file: patches/1.1.1-tvos-watchos.patch diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index 073a01dcd3cdc..424f65ac487e9 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.env import Environment, VirtualBuildEnv from conan.tools.files import ( apply_conandata_patches, chdir, copy, export_conandata_patches, - get, load, rename, replace_in_file, rm, rmdir, save + get, load, replace_in_file, rm, rmdir, save ) from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps from conan.tools.layout import basic_layout @@ -144,7 +144,7 @@ def validate(self): def build_requirements(self): if self._settings_build.os == "Windows": if not self.options.no_asm: - self.tool_requires("nasm/2.15.05") + self.tool_requires("nasm/2.16.01") if self._use_nmake: self.tool_requires("strawberryperl/5.32.1.1") else: @@ -539,10 +539,6 @@ def package(self): with chdir(self, self.source_folder): 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": - 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) with chdir(self, self.source_folder): @@ -619,9 +615,8 @@ def package_info(self): self.cpp_info.components["ssl"].set_property("cmake_target_name", "OpenSSL::SSL") self.cpp_info.components["ssl"].set_property("pkg_config_name", "libssl") if self._use_nmake: - libsuffix = "d" if self.settings.build_type == "Debug" else "" - self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix] - self.cpp_info.components["crypto"].libs = ["libcrypto" + libsuffix] + self.cpp_info.components["ssl"].libs = ["libssl"] + self.cpp_info.components["crypto"].libs = ["libcrypto"] else: self.cpp_info.components["ssl"].libs = ["ssl"] self.cpp_info.components["crypto"].libs = ["crypto"] diff --git a/recipes/openssl/3.x.x/conandata.yml b/recipes/openssl/3.x.x/conandata.yml index ca3f66a360ac3..0597465b44325 100644 --- a/recipes/openssl/3.x.x/conandata.yml +++ b/recipes/openssl/3.x.x/conandata.yml @@ -1,42 +1,25 @@ +# Versions to keep: +# - The last patch version of the supported releases, as per https://openssl-library.org/source/ +# - The last patch version of the current LTS release +# - The most recent FIPS validated version +# Note: please do not maintain multiple patch versions of the same minor, +# unless required by the above. sources: - 3.2.0: - url: - - "https://www.openssl.org/source/openssl-3.2.0.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.2.0/openssl-3.2.0.tar.gz" - sha256: 14c826f07c7e433706fb5c69fa9e25dab95684844b4c962a2cf1bf183eb4690e - 3.1.4: - url: - - "https://www.openssl.org/source/openssl-3.1.4.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.1.4/openssl-3.1.4.tar.gz" - sha256: 840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3 - 3.1.3: - url: - - "https://www.openssl.org/source/openssl-3.1.3.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.1.3/openssl-3.1.3.tar.gz" - sha256: f0316a2ebd89e7f2352976445458689f80302093788c466692fb2a188b2eacf6 - 3.1.2: - url: - - "https://www.openssl.org/source/openssl-3.1.2.tar.gz" - - "https://github.com/openssl/openssl/releases/download/openssl-3.1.2/openssl-3.1.2.tar.gz" + 3.4.1: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz" + sha256: 002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3 + 3.3.3: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.3.3/openssl-3.3.3.tar.gz" + sha256: 712590fd20aaa60ec75d778fe5b810d6b829ca7fb1e530577917a131f9105539 + 3.2.4: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.2.4/openssl-3.2.4.tar.gz" + sha256: b23ad7fd9f73e43ad1767e636040e88ba7c9e5775bfa5618436a0dd2c17c3716 + 3.1.8: + url: "https://github.com/openssl/openssl/releases/download/openssl-3.1.8/openssl-3.1.8.tar.gz" + sha256: d319da6aecde3aa6f426b44bbf997406d95275c5c59ab6f6ef53caaa079f456f + 3.1.2: # Most recent FIPS validated as of 2025-03-14 + url: "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" + 3.0.16: # LTS: keep the most recent 3.0.x until a new LTS is designated + url: "https://github.com/openssl/openssl/releases/download/openssl-3.0.16/openssl-3.0.16.tar.gz" + sha256: 57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86 diff --git a/recipes/openssl/3.x.x/conanfile.py b/recipes/openssl/3.x.x/conanfile.py index 0aebce72e25fa..7b44463fccaa4 100644 --- a/recipes/openssl/3.x.x/conanfile.py +++ b/recipes/openssl/3.x.x/conanfile.py @@ -2,10 +2,11 @@ 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 apply_conandata_patches, chdir, copy, export_conandata_patches, get, rename, replace_in_file, rmdir, save +from conan.tools.files import chdir, copy, get, replace_in_file, rm, 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 +from conan.tools.scm import Version import fnmatch import os @@ -30,7 +31,9 @@ class OpenSSLConan(ConanFile): "386": [True, False], "capieng_dialog": [True, False], "enable_capieng": [True, False], + "enable_trace": [True, False], "no_aria": [True, False], + "no_apps": [True, False], "no_autoload_config": [True, False], "no_asm": [True, False], "no_async": [True, False], @@ -85,11 +88,13 @@ class OpenSSLConan(ConanFile): "no_whirlpool": [True, False], "no_zlib": [True, False], "openssldir": [None, "ANY"], + "tls_security_level": [None, 0, 1, 2, 3, 4, 5], } default_options = {key: False for key in options.keys()} default_options["fPIC"] = True default_options["no_md2"] = True default_options["openssldir"] = None + default_options["tls_security_level"] = None @property def _is_clang_cl(self): @@ -104,10 +109,6 @@ def _is_mingw(self): 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) - def config_options(self): if self.settings.os != "Windows": self.options.rm_safe("capieng_dialog") @@ -115,20 +116,12 @@ def config_options(self): else: self.options.rm_safe("fPIC") - if self.settings.os == "Emscripten": - self.options.no_asm = True - self.options.no_threads = True - self.options.no_stdio = 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 export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") @@ -137,17 +130,15 @@ def requirements(self): self.requires("zlib/[>=1.2.11 <2]") def validate(self): - if self.settings.os == "Emscripten": - if not all((self.options.no_asm, self.options.no_threads, self.options.no_stdio)): - raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_threads,no_stdio}=True") - if self.settings.os == "iOS" and self.options.shared: raise ConanInvalidConfiguration("OpenSSL 3 does not support building shared libraries for iOS") def build_requirements(self): - if self._settings_build.os == "Windows": - if not self.options.no_asm: - self.tool_requires("nasm/2.15.05") + if self.settings_build.os == "Windows": + if self.conf.get("user.openssl:windows_use_jom", False): + self.tool_requires("jom/[*]") + if not self.options.no_asm and self.settings.arch in ["x86", "x86_64"]: + self.tool_requires("nasm/2.16.01") if self._use_nmake: self.tool_requires("strawberryperl/5.32.1.1") else: @@ -280,7 +271,7 @@ def _targets(self): "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-armv8-Visual Studio": "VC-WIN64-CLANGASM-ARM", "Windows-*-Visual Studio": "VC-noCE-common", "Windows-ia64-clang": "VC-WIN64I", # Itanium "Windows-x86-clang": "VC-WIN32", @@ -353,22 +344,20 @@ 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), + f'"{self._target}"', "shared" if self.options.shared else "no-shared", + "--debug" if self.settings.build_type == "Debug" else "--release", "--prefix=/", "--libdir=lib", - "--openssldir=\"%s\"" % openssldir, - "no-unit-test", + f"--openssldir=\"{openssldir}\"", "no-threads" if self.options.no_threads else "threads", - "PERL=%s" % self._perl, + f"PERL={self._perl}", + "no-unit-test", "no-tests", - "--debug" if self.settings.build_type == "Debug" else "--release", ] if self.settings.os == "Android": - args.append(" -D__ANDROID_API__=%s" % str(self.settings.os.api_level)) # see NOTES.ANDROID - if self.settings.os == "Emscripten": - args.append("-D__STDC_NO_ATOMICS__=1") + args.append(f" -D__ANDROID_API__={str(self.settings.os.api_level)}") # see NOTES.ANDROID if self.settings.os == "Windows": if self.options.enable_capieng: args.append("enable-capieng") @@ -379,6 +368,11 @@ def _configure_args(self): args.append("no-fips" if self.options.get_safe("no_fips", True) else "enable-fips") args.append("no-md2" if self.options.get_safe("no_md2", True) else "enable-md2") + if str(self.options.tls_security_level) != "None": + args.append(f"-DOPENSSL_TLS_SECURITY_LEVEL={self.options.tls_security_level}") + + if self.options.get_safe("enable_trace"): + args.append("enable-trace") if self.settings.os == "Neutrino": args.append("no-asm -lsocket -latomic") @@ -386,24 +380,33 @@ def _configure_args(self): if not self.options.no_zlib: zlib_cpp_info = self.dependencies["zlib"].cpp_info.aggregated_components() include_path = self._adjust_path(zlib_cpp_info.includedirs[0]) + is_shared_zlib = self.dependencies["zlib"].options.shared + + + # the --with-zlib-lib flag takes a different value depending on platform and if ZLIB is shared + # From https://github.com/openssl/openssl/blob/openssl-3.4.1/INSTALL.md#with-zlib-lib + # On Unix: the directory where the zlib library is (for -L flag) + # On Windows with static zlib: the path to the static library to link (assumed) + # On Windows with shared zlib: the leaf name of the dll (its loaded with LoadLibrary) if self._use_nmake: + # notes: consider where this should be "if on windows" + # zlib1 is assumed to be the name of the zlib1.dll for all windows configurations lib_path = self._adjust_path(os.path.join(zlib_cpp_info.libdirs[0], f"{zlib_cpp_info.libs[0]}.lib")) + zlib_lib_flag = "zlib1" if is_shared_zlib else lib_path else: # Just path, GNU like compilers will find the right file - lib_path = self._adjust_path(zlib_cpp_info.libdirs[0]) + zlib_lib_flag = self._adjust_path(zlib_cpp_info.libdirs[0]) - if self.dependencies["zlib"].options.shared: - args.append("zlib-dynamic") - else: - args.append("zlib") + zlib_configure_arg = "zlib-dynamic" if is_shared_zlib else "zlib" + args.append(zlib_configure_arg) args.extend([ f'--with-zlib-include="{include_path}"', - f'--with-zlib-lib="{lib_path}"', + f'--with-zlib-lib="{zlib_lib_flag}"', ]) for option_name in self.default_options.keys(): - if self.options.get_safe(option_name, False) and option_name not in ("shared", "fPIC", "openssldir", "capieng_dialog", "enable_capieng", "zlib", "no_fips", "no_md2"): + if self.options.get_safe(option_name, False) and option_name not in ("shared", "fPIC", "openssldir", "tls_security_level", "capieng_dialog", "enable_capieng", "zlib", "no_fips", "no_md2"): self.output.info(f"Activated option: {option_name}") args.append(option_name.replace("_", "-")) return args @@ -439,22 +442,22 @@ def _create_targets(self, cflags, cxxflags, defines, ldflags): perlasm_scheme = "" if self._perlasm_scheme: - perlasm_scheme = 'perlasm_scheme => "%s",' % self._perlasm_scheme + perlasm_scheme = f'perlasm_scheme => "{self._perlasm_scheme}",' - defines = " ".join(defines) + defines = '", "'.join(defines) defines = 'defines => add("%s"),' % defines if defines else "" targets = "my %targets" if self._asm_target: - ancestor = '[ "%s", asm("%s") ]' % (self._ancestor_target, self._asm_target) + ancestor = f'[ "{self._ancestor_target}", asm("{self._asm_target}") ]' else: - ancestor = '[ "%s" ]' % self._ancestor_target + ancestor = f'[ "{self._ancestor_target}" ]' shared_cflag = "" shared_extension = "" shared_target = "" if self.settings.os == "Neutrino": if self.options.shared: - shared_extension = 'shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",' + shared_extension = r'shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",' shared_target = 'shared_target => "gnu-shared",' if self.options.get_safe("fPIC", True): shared_cflag = 'shared_cflag => "-fPIC",' @@ -476,7 +479,7 @@ def _create_targets(self, cflags, cxxflags, defines, ldflags): shared_cflag=shared_cflag, lflags=" ".join(ldflags) ) - self.output.info("using target: %s -> %s" % (self._target, self._ancestor_target)) + self.output.info(f"using target: {self._target} -> {self._ancestor_target}") self.output.info(config) save(self, os.path.join(self.source_folder, "Configurations", "20-conan.conf"), config) @@ -487,8 +490,8 @@ def _run_make(self, targets=None, parallel=True, install=False): command.append(f"DESTDIR={self._adjust_path(self.package_folder)}") if targets: command.extend(targets) - if not self._use_nmake: - command.append(("-j%s" % build_jobs(self)) if parallel else "-j1") + if self._make_program in ["make", "jom"]: + command.append(f"-j{build_jobs(self)}" if parallel else "-j1") self.run(" ".join(command), env="conanbuild") @property @@ -499,19 +502,24 @@ def _perl(self): def _make(self): with chdir(self, self.source_folder): - # workaround for clang-cl not producing .pdb files - if self._is_clang_cl: - save(self, "ossl_static.pdb", "") args = " ".join(self._configure_args) if self._use_nmake: self._replace_runtime_in_file(os.path.join("Configurations", "10-main.conf")) - self.run("{perl} ./Configure {args}".format(perl=self._perl, args=args), env="conanbuild") + self.run(f"{self._perl} ./Configure {args}", env="conanbuild") if self._use_nmake: # When `--prefix=/`, the scripts derive `\` without escaping, which # causes issues on Windows replace_in_file(self, "Makefile", "INSTALLTOP_dir=\\", "INSTALLTOP_dir=\\\\") + if Version(self.version) >= "3.3.0": + # replace backslashes in paths with forward slashes + mkinstallvars_pl = os.path.join(self.source_folder, "util", "mkinstallvars.pl") + if Version(self.version) >= "3.3.2": + replace_in_file(self, mkinstallvars_pl, "push @{$values{$k}}, $v;", """$v =~ s|\\\\|/|g; push @{$values{$k}}, $v;""") + replace_in_file(self, mkinstallvars_pl, "$values{$k} = $v;", """$v->[0] =~ s|\\\\|/|g; $values{$k} = $v;""") + else: + replace_in_file(self, mkinstallvars_pl, "$ENV{$k} = $v;", """$v =~ s|\\\\|/|g; $ENV{$k} = $v;""") self._run_make() def _make_install(self): @@ -519,14 +527,17 @@ def _make_install(self): self._run_make(targets=["install_sw"], parallel=False, install=True) def build(self): - apply_conandata_patches(self) self._make() 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): - return "nmake" if self._use_nmake else "make" + use_jom = self._use_nmake and self.conf.get("user.openssl:windows_use_jom", False) + if self._use_nmake: + return "jom" if use_jom else "nmake" + else: + return "make" def _replace_runtime_in_file(self, filename): runtime = msvc_runtime_flag(self) @@ -540,16 +551,7 @@ def package(self): if is_apple_os(self): fix_apple_shared_install_name(self) - for root, _, files in os.walk(self.package_folder): - for filename in files: - if fnmatch.fnmatch(filename, "*.pdb"): - os.unlink(os.path.join(self.package_folder, root, filename)) - if self._use_nmake: - 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") - + rm(self, "*.pdb", self.package_folder, "lib") if self.options.shared: libdir = os.path.join(self.package_folder, "lib") for file in os.listdir(libdir): @@ -569,6 +571,7 @@ def package(self): copy(self, "fips.so", src=provdir, dst=modules_dir) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) self._create_cmake_module_variables( os.path.join(self.package_folder, self._module_file_rel_path) @@ -622,26 +625,21 @@ def _module_subfolder(self): @property def _module_file_rel_path(self): return os.path.join(self._module_subfolder, - "conan-official-{}-variables.cmake".format(self.name)) + f"conan-official-{self.name}-variables.cmake") def package_info(self): self.cpp_info.set_property("cmake_file_name", "OpenSSL") self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("pkg_config_name", "openssl") self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) - self.cpp_info.names["cmake_find_package"] = "OpenSSL" - self.cpp_info.names["cmake_find_package_multi"] = "OpenSSL" self.cpp_info.components["ssl"].builddirs.append(self._module_subfolder) - self.cpp_info.components["ssl"].build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.components["ssl"].set_property("cmake_build_modules", [self._module_file_rel_path]) self.cpp_info.components["crypto"].builddirs.append(self._module_subfolder) - self.cpp_info.components["crypto"].build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.components["crypto"].set_property("cmake_build_modules", [self._module_file_rel_path]) if self._use_nmake: - libsuffix = "d" if self.settings.build_type == "Debug" else "" - self.cpp_info.components["ssl"].libs = ["libssl" + libsuffix] - self.cpp_info.components["crypto"].libs = ["libcrypto" + libsuffix] + self.cpp_info.components["ssl"].libs = ["libssl"] + self.cpp_info.components["crypto"].libs = ["libcrypto"] else: self.cpp_info.components["ssl"].libs = ["ssl"] self.cpp_info.components["crypto"].libs = ["crypto"] @@ -669,13 +667,6 @@ def package_info(self): self.cpp_info.components["crypto"].set_property("pkg_config_name", "libcrypto") self.cpp_info.components["ssl"].set_property("cmake_target_name", "OpenSSL::SSL") self.cpp_info.components["ssl"].set_property("pkg_config_name", "libssl") - self.cpp_info.components["crypto"].names["cmake_find_package"] = "Crypto" - self.cpp_info.components["crypto"].names["cmake_find_package_multi"] = "Crypto" - self.cpp_info.components["ssl"].names["cmake_find_package"] = "SSL" - self.cpp_info.components["ssl"].names["cmake_find_package_multi"] = "SSL" openssl_modules_dir = os.path.join(self.package_folder, "lib", "ossl-modules") self.runenv_info.define_path("OPENSSL_MODULES", openssl_modules_dir) - - # 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 deleted file mode 100644 index 6e91678b02dd7..0000000000000 --- a/recipes/openssl/3.x.x/patches/3.2.0-fix-winsock2.patch +++ /dev/null @@ -1,36 +0,0 @@ -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/3.x.x/test_v1_package/CMakeLists.txt b/recipes/openssl/3.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index d52c980c930cf..0000000000000 --- a/recipes/openssl/3.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -option(OPENSSL_WITH_ZLIB "OpenSSL with zlib support" ON) -option(OPENSSL_WITH_LEGACY "OpenSSL with support for the legacy provider" ON) -option(OPENSSL_WITH_MD4 "OpenSSL with MD4 support (needs legacy provider)" ON) -option(OPENSSL_WITH_RIPEMD160 "OpenSSL with RIPEMD16 support (needs legacy provider)" ON) - -set(OpenSSL_DEBUG 1) -find_package(OpenSSL REQUIRED) - -message("OPENSSL_FOUND: ${OPENSSL_FOUND}") -message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}") -message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}") -message("OPENSSL_CRYPTO_LIBRARIES: ${OPENSSL_CRYPTO_LIBRARIES}") -message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}") -message("OPENSSL_SSL_LIBRARIES: ${OPENSSL_SSL_LIBRARIES}") -message("OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}") -message("OPENSSL_VERSION: ${OPENSSL_VERSION}") - -add_executable(digest digest.c) -if(OPENSSL_WITH_ZLIB) - target_compile_definitions(digest PRIVATE WITH_ZLIB) -endif() -target_link_libraries(digest OpenSSL::Crypto) - -if(OPENSSL_WITH_LEGACY) - add_executable(digest_legacy digest_legacy.c) - # do now show deperecation warnings - target_compile_definitions(digest_legacy PRIVATE OPENSSL_SUPPRESS_DEPRECATED) - if(OPENSSL_WITH_MD4) - target_compile_definitions(digest_legacy PRIVATE OPENSSL_WITH_MD4) - endif() - if(OPENSSL_WITH_RIPEMD160) - target_compile_definitions(digest_legacy PRIVATE OPENSSL_WITH_RIPEMD160) - endif() - if(OPENSSL_WITH_ZLIB) - target_compile_definitions(digest_legacy PRIVATE WITH_ZLIB) - endif() - target_link_libraries(digest_legacy OpenSSL::Crypto) -endif() diff --git a/recipes/openssl/3.x.x/test_v1_package/conanfile.py b/recipes/openssl/3.x.x/test_v1_package/conanfile.py deleted file mode 100644 index ad509932a9c76..0000000000000 --- a/recipes/openssl/3.x.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,40 +0,0 @@ -from conans import CMake, tools, ConanFile -from conan.tools.build import cross_building -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - generators = "cmake", "cmake_find_package", "pkg_config" - - def _with_legacy(self): - return (not self.options["openssl"].no_legacy and - ((not self.options["openssl"].no_md4) or - (not self.options["openssl"].no_rmd160))) - - def build(self): - cmake = CMake(self) - cmake.definitions["OPENSSL_WITH_ZLIB"] = not self.options["openssl"].no_zlib - cmake.definitions["OPENSSL_WITH_LEGACY"] = self._with_legacy() - cmake.definitions["OPENSSL_WITH_MD4"] = not self.options["openssl"].no_md4 - cmake.definitions["OPENSSL_WITH_RIPEMD160"] = not self.options["openssl"].no_rmd160 - if self.settings.os == "Android": - cmake.definitions["CONAN_LIBCXX"] = "" - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "digest") - self.run(bin_path, run_environment=True) - - if not self.options["openssl"].no_legacy: - bin_legacy_path = os.path.join("bin", "digest_legacy") - self.run(bin_legacy_path, run_environment=True) - - if not self.options["openssl"].no_stdio: - self.run("openssl version", run_environment=True) - assert os.path.exists(os.path.join(self.deps_cpp_info["openssl"].rootpath, "licenses", "LICENSE.txt")) - - for fn in ("libcrypto.pc", "libssl.pc", "openssl.pc",): - assert os.path.isfile(os.path.join(self.build_folder, fn)) diff --git a/recipes/openssl/3.x.x/test_v1_package/digest.c b/recipes/openssl/3.x.x/test_v1_package/digest.c deleted file mode 100644 index 0693be609aa18..0000000000000 --- a/recipes/openssl/3.x.x/test_v1_package/digest.c +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include -#include -#include -#if defined(WITH_ZLIB) -#include -#endif - -#include -#include -#include - -#if defined(_MSC_VER) && _MSC_VER < 1900 -#define snprintf _snprintf -#endif - -void SHA3_hash(const EVP_MD *type, const unsigned char *message, size_t message_len, unsigned char *digest, unsigned int *digest_len) { - EVP_MD_CTX *mdctx; - - if((mdctx = EVP_MD_CTX_create()) == NULL) - printf("EVP_MD_CTX_create error!\n"); - - if(EVP_DigestInit_ex(mdctx, type, NULL) != 1) - printf("EVP_DigestInit_ex error!\n"); - - if(EVP_DigestUpdate(mdctx, message, message_len) != 1) - printf("EVP_DigestUpdate error!\n"); - - if(EVP_DigestFinal_ex(mdctx, digest, digest_len) != 1) - printf("EVP_DigestFinal_ex error!\n"); - - EVP_MD_CTX_destroy(mdctx); -} - -int main() -{ - unsigned int digest_len; - unsigned char sha256_digest[SHA256_DIGEST_LENGTH], - sha512_digest[SHA512_DIGEST_LENGTH], - sha3_256_digest[SHA256_DIGEST_LENGTH], - sha3_512_digest[SHA512_DIGEST_LENGTH]; - char sha256_string[SHA256_DIGEST_LENGTH*2+1] = {0}, - sha512_string[SHA512_DIGEST_LENGTH*2+1] = {0}, - sha3_256_string[SHA256_DIGEST_LENGTH*2+1] = {0}, - sha3_512_string[SHA512_DIGEST_LENGTH*2+1] = {0}; - char string[] = "happy"; - - SHA256((unsigned char*)&string, strlen(string), (unsigned char*)&sha256_digest); - SHA512((unsigned char*)&string, strlen(string), (unsigned char*)&sha512_digest); - SHA3_hash(EVP_sha3_256(), (unsigned char*)&string, strlen(string), (unsigned char*)&sha3_256_digest, &digest_len); - SHA3_hash(EVP_sha3_512(), (unsigned char*)&string, strlen(string), (unsigned char*)&sha3_512_digest, &digest_len); - - for(int i = 0; i < SHA256_DIGEST_LENGTH; i++) { - snprintf(&sha256_string[i*2], sizeof(sha256_string)-i*2, "%02x", (unsigned int)sha256_digest[i]); - snprintf(&sha3_256_string[i*2], sizeof(sha3_256_string)-i*2, "%02x", (unsigned int)sha3_256_digest[i]); - } - - for(int i = 0; i < SHA512_DIGEST_LENGTH; i++) { - snprintf(&sha512_string[i*2], sizeof(sha512_string)-i*2, "%02x", (unsigned int)sha512_digest[i]); - snprintf(&sha3_512_string[i*2], sizeof(sha3_512_string)-i*2, "%02x", (unsigned int)sha3_512_digest[i]); - } - - printf("sha256 digest: %s\n", sha256_string); - printf("sha512 digest: %s\n", sha512_string); - printf("sha3 256 digest: %s\n", sha3_256_string); - printf("sha3 512 digest: %s\n", sha3_512_string); - printf("OpenSSL version: %s\n", OpenSSL_version(OPENSSL_VERSION)); -#if defined(WITH_ZLIB) - printf("ZLIB version: %s\n", ZLIB_VERSION); -#endif - - return 0; -} diff --git a/recipes/openssl/3.x.x/test_v1_package/digest_legacy.c b/recipes/openssl/3.x.x/test_v1_package/digest_legacy.c deleted file mode 100644 index 740f0d2c20914..0000000000000 --- a/recipes/openssl/3.x.x/test_v1_package/digest_legacy.c +++ /dev/null @@ -1,148 +0,0 @@ -#include -#if OPENSSL_WITH_MD4 -#include // MD4 needs legacy provider -#endif -#if OPENSSL_WITH_RIPEMD160 -#include // RIPEMD160 needs legacy provider -#endif -#include -#include -#include -#include -#include -#if defined(WITH_ZLIB) -#include -#endif - -#include -#include -#include - -#if defined(_MSC_VER) && _MSC_VER < 1900 -#define snprintf _snprintf -#endif - -int MDx_hash(const EVP_MD *type, const unsigned char *message, size_t message_len, unsigned char *digest, unsigned int *digest_len) { - EVP_MD_CTX *mdctx; - - if((mdctx = EVP_MD_CTX_create()) == NULL) - { - printf("EVP_MD_CTX_create error!\n"); - return 1; - } - - if(EVP_DigestInit_ex(mdctx, type, NULL) != 1) - { - printf("EVP_DigestInit_ex error!\n"); - return 1; - } - - if(EVP_DigestUpdate(mdctx, message, message_len) != 1) - { - printf("EVP_DigestUpdate error!\n"); - return 1; - } - - if(EVP_DigestFinal_ex(mdctx, digest, digest_len) != 1) - { - printf("EVP_DigestFinal_ex error!\n"); - return 1; - } - - EVP_MD_CTX_destroy(mdctx); - return 0; -} - -int main() -{ - unsigned int digest_len; - unsigned char md5_digest[MD5_DIGEST_LENGTH]; - unsigned char md5_digest2[MD5_DIGEST_LENGTH]; - char md5_string[MD5_DIGEST_LENGTH*2+1] = {0}; - char md5_string2[MD5_DIGEST_LENGTH*2+1] = {0}; - char string[] = "happy"; - - MD5((unsigned char*)&string, strlen(string), (unsigned char*)&md5_digest); - if (MDx_hash(EVP_md5(), (unsigned char*)&string, strlen(string), (unsigned char*)&md5_digest2, &digest_len)) - return 1; - - for(int i = 0; i < MD5_DIGEST_LENGTH; i++) { - snprintf(&md5_string[i*2], sizeof(md5_string)-i*2, "%02x", (unsigned int)md5_digest[i]); - snprintf(&md5_string2[i*2], sizeof(md5_string2)-i*2, "%02x", (unsigned int)md5_digest2[i]); - } - - // MD4 needs the legacy provider - OSSL_LIB_CTX* context = OSSL_LIB_CTX_new(); - // From https://wiki.openssl.org/index.php/OpenSSL_3.0 - /* Load Multiple providers into the default (nullptr) library context */ - OSSL_PROVIDER* legacy = OSSL_PROVIDER_load(context, "legacy"); - if (0 == legacy) { - const char* error_string = ERR_error_string(ERR_get_error(), 0); - fprintf(stderr, "Loading legacy provider failed with this error:\n"); - fprintf(stderr, "\t%s\n", error_string); - return 1; - } - OSSL_LIB_CTX* oldcontex = OSSL_LIB_CTX_set0_default(context); - printf("Legacy provider successfully loaded.\n"); - -#if OPENSSL_WITH_MD4 - unsigned char md4_digest[MD4_DIGEST_LENGTH]; - unsigned char md4_digest2[MD4_DIGEST_LENGTH]; - char md4_string[MD4_DIGEST_LENGTH*2+1] = {0}; - char md4_string2[MD4_DIGEST_LENGTH*2+1] = {0}; - - MD4((unsigned char*)&string, strlen(string), (unsigned char*)&md4_digest); - if (MDx_hash(EVP_md4(), (unsigned char*)&string, strlen(string), (unsigned char*)&md4_digest2, &digest_len)) { - const char* error_string = ERR_error_string(ERR_get_error(), 0); - fprintf(stderr, "MD4 calculation failed with this error:\n"); - fprintf(stderr, "\t%s\n", error_string); - return 1; - } - - for(int i = 0; i < MD4_DIGEST_LENGTH; i++) { - snprintf(&md4_string[i*2], sizeof(md4_string)-i*2, "%02x", (unsigned int)md4_digest[i]); - snprintf(&md4_string2[i*2], sizeof(md4_string2)-i*2, "%02x", (unsigned int)md4_digest2[i]); - } -#endif - -#if OPENSSL_WITH_RIPEMD160 - unsigned char ripemd160_digest[RIPEMD160_DIGEST_LENGTH]; - unsigned char ripemd160_digest2[RIPEMD160_DIGEST_LENGTH]; - char ripemd160_string[RIPEMD160_DIGEST_LENGTH*2+1] = {0}; - char ripemd160_string2[RIPEMD160_DIGEST_LENGTH*2+1] = {0}; - - RIPEMD160((unsigned char*)&string, strlen(string), (unsigned char*)&ripemd160_digest); - if (MDx_hash(EVP_ripemd160(), (unsigned char*)&string, strlen(string), (unsigned char*)&ripemd160_digest2, &digest_len)) { - const char* error_string = ERR_error_string(ERR_get_error(), 0); - fprintf(stderr, "RIPEMD160 calculation failed with this error:\n"); - fprintf(stderr, "\t%s\n", error_string); - return 1; - } - - for(int i = 0; i < RIPEMD160_DIGEST_LENGTH; i++) { - snprintf(&ripemd160_string[i*2], sizeof(ripemd160_string)-i*2, "%02x", (unsigned int)ripemd160_digest[i]); - snprintf(&ripemd160_string2[i*2], sizeof(ripemd160_string2)-i*2, "%02x", (unsigned int)ripemd160_digest2[i]); - } -#endif - - OSSL_LIB_CTX_set0_default(oldcontex); - OSSL_PROVIDER_unload(legacy); - OSSL_LIB_CTX_free(context); - - printf("MD5 digest: %s\n", md5_string); - printf("MD5 digest (variant 2): %s\n", md5_string2); -#if OPENSSL_WITH_MD4 - printf("MD4 digest: %s\n", md4_string); - printf("MD4 digest (variant 2): %s\n", md4_string2); -#endif -#if OPENSSL_WITH_RIPEMD160 - printf("RIPEMD160 digest: %s\n", ripemd160_string); - printf("RIPEMD160 digest (variant 2): %s\n", ripemd160_string2); -#endif - printf("OpenSSL version: %s\n", OpenSSL_version(OPENSSL_VERSION)); -#if defined(WITH_ZLIB) - printf("ZLIB version: %s\n", ZLIB_VERSION); -#endif - - return 0; -} diff --git a/recipes/openssl/config.yml b/recipes/openssl/config.yml index 816020f3de15e..a9f869f137c0e 100644 --- a/recipes/openssl/config.yml +++ b/recipes/openssl/config.yml @@ -1,21 +1,15 @@ versions: - # 3.2.x releases - 3.2.0: + "3.4.1": folder: "3.x.x" - # 3.1.x releases - 3.1.4: + "3.3.3": folder: "3.x.x" - 3.1.3: + "3.2.4": folder: "3.x.x" - 3.1.2: + "3.1.8": folder: "3.x.x" - 3.1.1: + "3.1.2": folder: "3.x.x" - # 3.0.x releases - 3.0.12: + "3.0.16": folder: "3.x.x" - 3.0.11: - folder: "3.x.x" - # 1.1.1x releases - 1.1.1w: + "1.1.1w": folder: "1.x.x" diff --git a/recipes/opensubdiv/all/conanfile.py b/recipes/opensubdiv/all/conanfile.py index 6f46f7d0625fe..e7d8499cb62d4 100644 --- a/recipes/opensubdiv/all/conanfile.py +++ b/recipes/opensubdiv/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd, valid_min_cppstd -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +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 from conan.tools.scm import Version import os @@ -34,13 +34,13 @@ class OpenSubdivConan(ConanFile): "shared": False, "fPIC": True, "with_tbb": False, - "with_opengl": False, + "with_opengl": True, "with_omp": False, "with_cuda": False, "with_clew": False, "with_opencl": False, "with_dx": False, - "with_metal": False, + "with_metal": True } short_paths = True @@ -86,7 +86,12 @@ def requirements(self): 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) + self.requires("onetbb/2021.12.0", transitive_headers=True) + if self.options.with_opengl: + self.requires("opengl/system") + self.requires("glfw/3.4") + if self.options.get_safe("with_metal"): + self.requires("metal-cpp/14.2") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -138,6 +143,9 @@ def generate(self): tc.variables["NO_MACOS_FRAMEWORK"] = True tc.generate() + tc = CMakeDeps(self) + tc.generate() + def _patch_sources(self): apply_conandata_patches(self) if self.settings.os == "Macos" and not self._osd_gpu_enabled: @@ -172,6 +180,11 @@ def package_info(self): if self._osd_gpu_enabled: self.cpp_info.components["osdgpu"].set_property("cmake_target_name", f"OpenSubdiv::osdgpu{target_suffix}") self.cpp_info.components["osdgpu"].libs = ["osdGPU"] + self.cpp_info.components["osdgpu"].requires = ["osdcpu"] + if self.options.with_opengl: + self.cpp_info.components["osdgpu"].requires.extend(["opengl::opengl", "glfw::glfw"]) + if self.options.get_safe("with_metal"): + self.cpp_info.components["osdgpu"].requires.append("metal-cpp::metal-cpp") dl_required = self.options.with_opengl or self.options.with_opencl if self.settings.os in ["Linux", "FreeBSD"] and dl_required: self.cpp_info.components["osdgpu"].system_libs = ["dl"] diff --git a/recipes/opensubdiv/all/test_package/CMakeLists.txt b/recipes/opensubdiv/all/test_package/CMakeLists.txt index eae6cba922206..7c865934a3a0f 100644 --- a/recipes/opensubdiv/all/test_package/CMakeLists.txt +++ b/recipes/opensubdiv/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(OpenSubdiv REQUIRED CONFIG) diff --git a/recipes/opentdf-client/all/conanfile.py b/recipes/opentdf-client/all/conanfile.py index 8d420a25df14f..1709d84e6a285 100644 --- a/recipes/opentdf-client/all/conanfile.py +++ b/recipes/opentdf-client/all/conanfile.py @@ -4,7 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, replace_in_file, get, copy +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version @@ -41,8 +41,8 @@ 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", + "Visual Studio": "15", + "msvc": "191", "gcc": "7.5", "clang": "12", "apple-clang": "12", @@ -69,11 +69,11 @@ def requirements(self): if Version(self.version) >= "1.4.0": self.requires("magic_enum/0.8.2") self.requires("ms-gsl/2.1.0") - self.requires("nlohmann_json/3.11.2") + self.requires("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.4") + self.requires("libxml2/2.11.6") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -155,8 +155,6 @@ def package_info(self): ] if Version(self.version) >= "1.4.0": self.cpp_info.components["libopentdf"].requires.append("magic_enum::magic_enum") - if Version(self.version) < "1.1.0": - self.cpp_info.components["libopentdf"].requires.append("libarchive::libarchive") if Version(self.version) >= "1.4.0": self.cpp_info.components["libopentdf"].requires.append("magic_enum::magic_enum") diff --git a/recipes/opentelemetry-cpp/all/conandata.yml b/recipes/opentelemetry-cpp/all/conandata.yml index 2342d2e0da093..08a20f89f3e5e 100644 --- a/recipes/opentelemetry-cpp/all/conandata.yml +++ b/recipes/opentelemetry-cpp/all/conandata.yml @@ -1,66 +1,22 @@ sources: + "1.18.0": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.18.0.tar.gz" + sha256: "b149109d5983cf8290d614654a878899a68b0c8902b64c934d06f47cd50ffe2e" + "1.17.0": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.17.0.tar.gz" + sha256: "13542725463f1ea106edaef078c2276065cf3da998cb1d3dcf92630daa3f64d4" + "1.16.1": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.16.1.tar.gz" + sha256: "b8a78bb2a3a78133dbb08bcd04342f4b1e03cb4a19079b8416d408d905fffc37" + "1.14.2": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.14.2.tar.gz" + sha256: "c7e7801c9f6228751cdb9dd4724d0f04777ed53f524c8828e73bf4c9f894e0bd" + "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.1": - url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.1.tar.gz" - sha256: "3d640201594b07f08dade9cd1017bd0b59674daca26223b560b9bb6bf56264c2" - "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.9.1": - - patch_file: "patches/1.9.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.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" + "1.8.3": + url: "https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.8.3.tar.gz" + sha256: "b23d3c80d2e0012734ea343d2be69b2a7139ec5545453c503b13e629eb8fbe05" diff --git a/recipes/opentelemetry-cpp/all/conanfile.py b/recipes/opentelemetry-cpp/all/conanfile.py index 7d1799e99839a..b167d30b9f5d9 100644 --- a/recipes/opentelemetry-cpp/all/conanfile.py +++ b/recipes/opentelemetry-cpp/all/conanfile.py @@ -1,16 +1,16 @@ -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.apple import is_apple_os +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 Environment +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" @@ -28,9 +28,10 @@ class OpenTelemetryCppConan(ConanFile): "with_stl": [True, False], "with_gsl": [True, False], "with_abseil": [True, False], - "with_otlp": [True, False], "with_otlp_grpc": [True, False], "with_otlp_http": [True, False], + "with_otlp_http_compression": [True, False], + "with_otlp_file": [True, False], "with_zipkin": [True, False], "with_prometheus": [True, False], "with_elasticsearch": [True, False], @@ -47,12 +48,15 @@ class OpenTelemetryCppConan(ConanFile): "shared": False, "with_no_deprecated_code": False, + # Enabling this causes stack overflow in the test_package "with_stl": False, "with_gsl": False, "with_abseil": True, - "with_otlp": True, - "with_otlp_grpc": True, + "with_otlp_grpc": False, + # True because dependencies usually need this, and it would generate missing binaries for those "with_otlp_http": True, + "with_otlp_http_compression": False, + "with_otlp_file": False, "with_zipkin": True, "with_prometheus": False, "with_elasticsearch": False, @@ -67,86 +71,132 @@ 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") + del self.options.with_etw + if Version(self.version) >= "1.10": + del self.options.with_jaeger + if Version(self.version) >= "1.11": + del self.options.with_logs_preview + if Version(self.version) < "1.16.0": + del self.options.with_otlp_file + del self.options.with_otlp_http_compression 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") - def layout(self): cmake_layout(self, src_folder="src") + def _supports_new_proto_grpc_abseil(self): + """Old versions do not support the new proto grpc abseil combo + (Usage of old imports etc) + This is technically only for protobuf, but we take care to + keep abseil range in line, and grpc dependencies in sync so no + conflicts arise if using any of the 3 elsewhere + """ + return Version(self.version) >= "1.12.0" + + @property + def _needs_proto(self): + return self.options.with_otlp_grpc or self.options.with_otlp_http or self.options.get_safe("with_otlp_file") + + @property + def _otlp_http_needs_zlib(self): + # Bug before 1.17.X meant that zib was needed even with compression off + return (Version(self.version) >= "1.16.0" + # Check if new version released with this fix + # It was fixed in https://github.com/open-telemetry/opentelemetry-cpp/pull/3120 + and (Version(self.version) < "1.17.1" + or self.options.with_otlp_http_compression)) + def requirements(self): if self.options.with_gsl: self.requires("ms-gsl/4.0.0") if self.options.with_abseil: - self.requires("abseil/20220623.0", transitive_headers=True) + if self._supports_new_proto_grpc_abseil(): + self.requires("abseil/[>=20240116.1 <20240117.0]", transitive_headers=True) + else: + self.requires("abseil/[>=20230125.3 <=20230802.1]", transitive_headers=True) - if self.options.with_otlp: - self.requires("protobuf/3.21.9") - if Version(self.version) <= "1.4.1": - self.requires("opentelemetry-proto/0.11.0") + if self._needs_proto: + if self._supports_new_proto_grpc_abseil(): + self.requires("protobuf/5.27.0", transitive_headers=True, transitive_libs=True) else: - self.requires("opentelemetry-proto/0.20.0") + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) - if self.options.get_safe("with_otlp_grpc"): - self.requires("grpc/1.50.1") + if self.options.with_otlp_grpc: + if self._supports_new_proto_grpc_abseil(): + self.requires("grpc/1.67.1", transitive_headers=True, transitive_libs=True) + else: + 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_etw + self.options.with_otlp_http or + self.options.get_safe("with_etw") or + self.options.get_safe("with_otlp_file") ): - self.requires("nlohmann_json/3.11.2") - self.requires("openssl/[>=1.1 <4]") + self.requires("nlohmann_json/3.11.3") + 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/8.1.1") + self.requires("libcurl/[>=7.78.0 <9]") + + if self.options.with_otlp_http and self._otlp_http_needs_zlib: + self.requires("zlib/[>=1.2.11 <2]") 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.82.0") + self.requires("boost/1.85.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 self.options.get_safe("with_otlp_grpc"): + 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") @@ -159,11 +209,21 @@ 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): - if self.options.with_otlp: - self.tool_requires("protobuf/3.21.9") - if self.options.get_safe("with_otlp_grpc"): - self.tool_requires("grpc/1.50.1") + if self._needs_proto: + if Version(self.version) >= "1.18.0": + self.tool_requires("opentelemetry-proto/1.4.0") + else: + self.tool_requires("opentelemetry-proto/1.3.2") + self.tool_requires("protobuf/") + + if self.options.with_otlp_grpc: + self.tool_requires("grpc/") def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ @@ -179,69 +239,79 @@ def _create_cmake_module_variables(self, module_file): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + @property + def _stl_value(self): + # From 1.12.0 onwards, the STL can have various values + if Version(self.version) < "1.12.1": + return self.options.with_stl + if self.options.with_stl: + if self.settings.compiler.cppstd: + return "CXX" + str(self.settings.compiler.cppstd).replace("gnu", "") + else: + # ON for autodetection in upstream CML + return True + else: + return False + def generate(self): - tc = CMakeToolchain(self) + VirtualBuildEnv(self).generate(scope="build") + VirtualRunEnv(self).generate(scope="build") - tc.variables["BUILD_TESTING"] = False - tc.variables["BUILD_BENCHMARK"] = False - - tc.variables["WITH_EXAMPLES"] = 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 + 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._stl_value + 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 + if Version(self.version) >= "1.16.0": + tc.cache_variables["WITH_OTLP_HTTP_COMPRESSION"] = self.options.with_otlp_http_compression + if self.options.get_safe("with_otlp_file"): + tc.cache_variables["WITH_OTLP_FILE"] = True + if self._needs_proto: + tc.cache_variables["OTELCPP_PROTO_PATH"] = self.dependencies.build["opentelemetry-proto"].conf_info.get("user.opentelemetry-proto:proto_root").replace("\\", "/") + 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 + if self.options.get_safe("with_etw"): + # CMakeLists checks for definition, not value + tc.cache_variables["WITH_ETW"] = True + if Version(self.version) < "1.11": + 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) - if self.settings.os == "Linux": - env = Environment() - if self.dependencies["grpc"].options.shared: - env.append_path("LD_LIBRARY_PATH", os.path.join(self.dependencies["grpc"].package_folder, "lib")) - if self.dependencies["protobuf"].options.shared: - env.append_path("LD_LIBRARY_PATH", os.path.join(self.dependencies["protobuf"].package_folder, "lib")) - env.vars(self).save_script("conanbuild_loadpath") + deps.generate() def _patch_sources(self): - protos_path = self.dependencies["opentelemetry-proto"].conf_info.get("user.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)") - if Version(self.version) < "1.9.0": - 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._needs_proto: + 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)") + 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) rmdir(self, os.path.join(self.source_folder, "api", "include", "opentelemetry", "nostd", "absl")) - apply_conandata_patches(self) - def build(self): self._patch_sources() cmake = CMake(self) @@ -253,6 +323,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) ) @@ -272,12 +343,11 @@ 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): libraries = [ - self._http_client_name, "opentelemetry_common", "opentelemetry_exporter_in_memory", "opentelemetry_exporter_ostream_span", @@ -286,63 +356,50 @@ def _otel_libraries(self): "opentelemetry_version", ] - if self.options.with_otlp: + if self.options.with_otlp_http or self.options.with_elasticsearch or self.options.get_safe("with_jaeger") or self.options.with_zipkin: + # https://github.com/open-telemetry/opentelemetry-cpp/blob/v1.12.0/CMakeLists.txt#L452-L460 + libraries.append(self._http_client_name) + if self._needs_proto: 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") - - 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_metrics") + libraries.append("opentelemetry_exporter_otlp_grpc_client") + if Version(self.version) >= "1.9.1": + libraries.append("opentelemetry_proto_grpc") + if Version(self.version) >= "1.11" or 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") - - if self.options.with_logs_preview: + libraries.append("opentelemetry_exporter_otlp_http_client") + libraries.append("opentelemetry_exporter_otlp_http_metric") + if Version(self.version) >= "1.11" or self.options.with_logs_preview: libraries.append("opentelemetry_exporter_otlp_http_log") - + if self.options.get_safe("with_otlp_file"): + libraries.append("opentelemetry_exporter_otlp_file") + libraries.append("opentelemetry_exporter_otlp_file_client") + libraries.append("opentelemetry_exporter_otlp_file_metric") + libraries.append("opentelemetry_exporter_otlp_file_log") if self.options.with_prometheus: libraries.append("opentelemetry_exporter_prometheus") - - if self.options.with_elasticsearch and self.options.with_logs_preview: + if self.options.with_elasticsearch and (Version(self.version) >= "1.11" or 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") - - if self.options.with_logs_preview: + libraries.append("opentelemetry_metrics") + libraries.append("opentelemetry_exporter_ostream_metrics") + if Version(self.version) >= "1.11" or self.options.with_logs_preview: libraries.extend([ "opentelemetry_logs", "opentelemetry_exporter_ostream_logs", ]) - - if self.settings.os == "Windows" and self.options.with_etw: + if self.options.get_safe("with_etw"): libraries.append("opentelemetry_exporter_etw") - return libraries def package_info(self): @@ -367,7 +424,7 @@ def package_info(self): self.cpp_info.components["opentelemetry_exporter_in_memory"].libs = [] - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: self.cpp_info.components["opentelemetry_logs"].requires.extend([ "opentelemetry_resources", "opentelemetry_common", @@ -380,7 +437,12 @@ def package_info(self): if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.components["opentelemetry_common"].system_libs.extend(["pthread"]) - if self.options.with_stl: + if Version(self.version) >= "1.16.0" and is_apple_os(self): + self.cpp_info.components["opentelemetry_common"].frameworks.extend(["CoreFoundation"]) + + if self.options.get_safe("with_otlp_http_compression"): + self.cpp_info.components["opentelemetry_common"].defines.append("ENABLE_OTLP_COMPRESSION_PREVIEW") + if self._stl_value: self.cpp_info.components["opentelemetry_common"].defines.append("HAVE_CPP_STDLIB") if self.options.with_gsl: @@ -391,84 +453,103 @@ 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": - self.cpp_info.components["opentelemetry_exporter_otlp_grpc_metrics"].requires.extend([ - "grpc::grpc++", - "opentelemetry_otlp_recordable", + if Version(self.version) >= "1.11": + self.cpp_info.components["opentelemetry_otlp_recordable"].requires.extend([ + "opentelemetry_logs", ]) - if Version(self.version) <= "1.7.0": - self.cpp_info.components["opentelemetry_exporter_otlp_grpc"].requires.extend([ - "grpc::grpc++", - "opentelemetry_otlp_recordable", - ]) + if self.options.with_otlp_grpc: + self.cpp_info.components["opentelemetry_exporter_otlp_grpc_client"].requires.extend([ + "grpc::grpc++", + "opentelemetry_proto", + ]) - if Version(self.version) >= "1.7.0": - self.cpp_info.components["opentelemetry_exporter_otlp_grpc_client"].requires.extend([ - "grpc::grpc++", - "opentelemetry_proto", - ]) + if Version(self.version) >= "1.9.1": + self.cpp_info.components["opentelemetry_exporter_otlp_grpc_client"].requires.append("opentelemetry_proto_grpc") - self.cpp_info.components["opentelemetry_exporter_otlp_grpc"].requires.extend([ - "opentelemetry_otlp_recordable", - "opentelemetry_exporter_otlp_grpc_client" - ]) + self.cpp_info.components["opentelemetry_exporter_otlp_grpc"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_grpc_client" + ]) - self.cpp_info.components["opentelemetry_exporter_otlp_grpc_metrics"].requires.extend([ - "opentelemetry_otlp_recordable", - "opentelemetry_exporter_otlp_grpc_client" - ]) + self.cpp_info.components["opentelemetry_exporter_otlp_grpc_metrics"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_grpc_client" + ]) - if self.options.with_logs_preview: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: self.cpp_info.components["opentelemetry_exporter_otlp_grpc_log"].requires.extend([ "opentelemetry_otlp_recordable", "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", "opentelemetry_proto", ]) + if self._otlp_http_needs_zlib: + # This version requires zlib for the http client even if not used, as it includes zconf.h + # regardless of WITH_OTLP_HTTP_COMPRESSION + self.cpp_info.components["opentelemetry_exporter_otlp_http_client"].requires.append("zlib::zlib") + self.cpp_info.components["opentelemetry_exporter_otlp_http"].requires.extend([ "opentelemetry_otlp_recordable", "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: + if Version(self.version) >= "1.11" or self.options.with_logs_preview: self.cpp_info.components["opentelemetry_exporter_otlp_http_log"].requires.extend([ "opentelemetry_otlp_recordable", "opentelemetry_exporter_otlp_http_client", ]) + if self.options.get_safe("with_otlp_file"): + self.cpp_info.components["opentelemetry_exporter_otlp_file_client"].requires.extend([ + "nlohmann_json::nlohmann_json", + "opentelemetry_proto", + "opentelemetry_common" + ]) + if self.options.with_abseil: + self.cpp_info.components["opentelemetry_exporter_otlp_file_client"].requires.append("abseil::absl_strings") + + self.cpp_info.components["opentelemetry_exporter_otlp_file"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_file_client", + ]) + + self.cpp_info.components["opentelemetry_exporter_otlp_file_log"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_file_client", + ]) + + self.cpp_info.components["opentelemetry_exporter_otlp_file_metric"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_file_client", + ]) + if self.options.with_zipkin: self.cpp_info.components["opentelemetry_exporter_zipkin_trace"].requires.extend([ self._http_client_name, @@ -476,7 +557,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", @@ -484,12 +565,17 @@ 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.options.with_prometheus: + self.cpp_info.components["opentelemetry_exporter_prometheus"].requires.extend([ + "prometheus-cpp::prometheus-cpp", + "opentelemetry_trace", + ]) - if self.settings.os == "Windows" and self.options.with_etw: + if self.options.get_safe("with_etw"): self.cpp_info.components["opentelemetry_exporter_etw"].libs = [] self.cpp_info.components["opentelemetry_exporter_etw"].requires.append( "nlohmann_json::nlohmann_json", 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/all/patches/1.9.1-0001-fix-cmake.patch b/recipes/opentelemetry-cpp/all/patches/1.9.1-0001-fix-cmake.patch deleted file mode 100644 index 6deba6e434af5..0000000000000 --- a/recipes/opentelemetry-cpp/all/patches/1.9.1-0001-fix-cmake.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index dbfb6a2..83c92cc 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -299,7 +299,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 34b33d3..19e67e9 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -311,6 +311,10 @@ if(WITH_OTLP_GRPC) - endif() - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - foreach(proto_target ${OPENTELEMETRY_PROTO_TARGETS}) - set_property(TARGET ${proto_target} PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/recipes/opentelemetry-cpp/all/test_package/CMakeLists.txt b/recipes/opentelemetry-cpp/all/test_package/CMakeLists.txt index 53dd5c5a1c6f7..0898e9106c8e0 100644 --- a/recipes/opentelemetry-cpp/all/test_package/CMakeLists.txt +++ b/recipes/opentelemetry-cpp/all/test_package/CMakeLists.txt @@ -6,4 +6,4 @@ find_package(opentelemetry-cpp REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE opentelemetry-cpp::opentelemetry-cpp) -target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_11) +target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt b/recipes/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 432e5d7c64ed4..0000000000000 --- a/recipes/opentelemetry-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(opentelemetry-cpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE opentelemetry-cpp::opentelemetry-cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/opentelemetry-cpp/all/test_v1_package/conanfile.py b/recipes/opentelemetry-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/opentelemetry-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/opentelemetry-cpp/config.yml b/recipes/opentelemetry-cpp/config.yml index 8429e67e0bca0..8403792905fa2 100644 --- a/recipes/opentelemetry-cpp/config.yml +++ b/recipes/opentelemetry-cpp/config.yml @@ -1,19 +1,15 @@ versions: - "1.9.1": - folder: all - "1.8.1": + "1.18.0": folder: all - "1.7.0": + "1.17.0": folder: all - "1.6.1": + "1.16.1": folder: all - "1.4.1": + "1.14.2": folder: all - "1.4.0": + "1.12.0": folder: all - "1.3.0": - folder: all - "1.2.0": + "1.9.1": folder: all - "1.0.1": + "1.8.3": folder: all diff --git a/recipes/opentelemetry-proto/all/conandata.yml b/recipes/opentelemetry-proto/all/conandata.yml index 94ffeec1c7831..b686158ffdef9 100644 --- a/recipes/opentelemetry-proto/all/conandata.yml +++ b/recipes/opentelemetry-proto/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "1.4.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.4.0.tar.gz" + sha256: "53cd32cedb27762ea2060a9c8d83e4b822de13d73b5d5d37a2db3cf55018d694" + "1.3.2": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.2.tar.gz" + sha256: "c069c0d96137cf005d34411fa67dd3b6f1f8c64af1e7fb2fe0089a41c425acd7" + "1.3.1": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.1.tar.gz" + sha256: "bed250ceec8e4a83aa5604d7d5595a61945059dc662edd058a9da082283f7a00" + "1.3.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.0.tar.gz" + sha256: "73a678b0ff7a29b581381566a2230fe2a00b864608786c99c050a4492e2bbafc" + "1.2.0": + url: "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.2.0.tar.gz" + sha256: "516dc94685dbaa14fb792788f31d2ef2b0c3ad08dfa8a9a8164e3cf60c1ab6f7" + "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" diff --git a/recipes/opentelemetry-proto/all/test_v1_package/conanfile.py b/recipes/opentelemetry-proto/all/test_v1_package/conanfile.py deleted file mode 100644 index c5940f5104d54..0000000000000 --- a/recipes/opentelemetry-proto/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,7 +0,0 @@ -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 64c1fc73aecec..276ede418684f 100644 --- a/recipes/opentelemetry-proto/config.yml +++ b/recipes/opentelemetry-proto/config.yml @@ -1,4 +1,16 @@ versions: + "1.4.0": + folder: all + "1.3.2": + folder: all + "1.3.1": + folder: all + "1.3.0": + folder: all + "1.2.0": + folder: all + "1.1.0": + folder: all "1.0.0": folder: all "0.20.0": diff --git a/recipes/opentracing-cpp/all/test_v1_package/CMakeLists.txt b/recipes/opentracing-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/opentracing-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index abcaeed3f89b6..0000000000000 --- a/recipes/opentracing-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/opentrackio-cpp/all/conandata.yml b/recipes/opentrackio-cpp/all/conandata.yml new file mode 100644 index 0000000000000..9bca6ac28c80e --- /dev/null +++ b/recipes/opentrackio-cpp/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "1.0.1": + url: + - "https://github.com/mosys/opentrackio-cpp/archive/refs/tags/1.0.1.tar.gz" + sha256: "079b3998e9e1e12e5b7a3c72f2f177bbc48f7da5220cd0f6dfd556056ba5663f" diff --git a/recipes/opentrackio-cpp/all/conanfile.py b/recipes/opentrackio-cpp/all/conanfile.py new file mode 100644 index 0000000000000..415312fd127dd --- /dev/null +++ b/recipes/opentrackio-cpp/all/conanfile.py @@ -0,0 +1,105 @@ +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 +import os + +required_conan_version = ">=1.53.0" + +class PackageConan(ConanFile): + name = "opentrackio-cpp" + description = "A Cpp helper library for usage with the OpenTrackIO protocol." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mosys/opentrackio-cpp" + topics = ("opentrackio", "smpte") + 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 { + "apple-clang": "15", + "clang": "14", + "gcc": "13", + "msvc": "193", + "Visual Studio": "20", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + # TODO: This goes back to config_options after Conan 1 freeze + if self.settings.os == "Windows": + # Nothing is exported from the library, so we can't use it as a shared library + 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("nlohmann_json/3.11.3", transitive_headers=True) + + def build_requirements(self): + # Min required is 3.15 in the file, but 3.20 in the README. + # Be conservative and require the higher version + self.build_requires("cmake/[>=3.20 <4]") + + 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): + 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, "LICENCE", 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")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + suffix = "" + if self.settings.build_type == "Debug": + suffix = "d" + self.cpp_info.libs = [f"opentrackio-cpp{suffix}"] diff --git a/recipes/opentrackio-cpp/all/test_package/CMakeLists.txt b/recipes/opentrackio-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d8f36103d746f --- /dev/null +++ b/recipes/opentrackio-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + + project(test_package LANGUAGES CXX) + +find_package(opentrackio-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE opentrackio-cpp::opentrackio-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/opentrackio-cpp/all/test_package/conanfile.py b/recipes/opentrackio-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/opentrackio-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/opentrackio-cpp/all/test_package/test_package.cpp b/recipes/opentrackio-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a34769eb689b0 --- /dev/null +++ b/recipes/opentrackio-cpp/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include +#include +#include +#include + + +int main(void) { + std::string example = R"({ + "protocol": { + "name": "OpenTrackIO", + "version": "1.0.0" + }, + "tracker": { + "notes": "Example generated sample.", + "recording": false, + "slate": "A101_A_4", + "status": "Optical Good" + } + })"; + + opentrackio::OpenTrackIOSample sample{}; + bool sample_success = sample.initialise(std::string_view{example}); + std::cout << "Sample init successful: " << (sample_success ? "True" : "False") << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/opentrackio-cpp/config.yml b/recipes/opentrackio-cpp/config.yml new file mode 100644 index 0000000000000..d8a13868268e6 --- /dev/null +++ b/recipes/opentrackio-cpp/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "1.0.1": + folder: all diff --git a/recipes/openvdb/all/CMakeLists.txt b/recipes/openvdb/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/openvdb/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/openvdb/all/conandata.yml b/recipes/openvdb/all/conandata.yml index 902318df1e3ae..35817586160ea 100644 --- a/recipes/openvdb/all/conandata.yml +++ b/recipes/openvdb/all/conandata.yml @@ -1,8 +1,10 @@ sources: - "8.0.1": - url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v8.0.1.tar.gz" - sha256: "a6845da7c604d2c72e4141c898930ac8a2375521e535f696c2cd92bebbe43c4f" -patches: - "8.0.1": - - patch_file: "patches/0001-Find-packages-fixes.patch" - base_path: "source_subfolder" + "11.0.0": + url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v11.0.0.tar.gz" + sha256: "6314ff1db057ea90050763e7b7d7ed86d8224fcd42a82cdbb9c515e001b96c74" + "10.1.0": + url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v10.1.0.tar.gz" + sha256: "2746236e29659a0d35ab90d832f7c7987dd2537587a1a2f9237d9c98afcd5817" + "9.1.0": + url: "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v9.1.0.tar.gz" + sha256: "914ee417b4607c75c95b53bc73a0599de4157c7d6a32e849e80f24e40fb64181" diff --git a/recipes/openvdb/all/conanfile.py b/recipes/openvdb/all/conanfile.py index 10e73dc4150e4..5f385526168c2 100644 --- a/recipes/openvdb/all/conanfile.py +++ b/recipes/openvdb/all/conanfile.py @@ -1,11 +1,16 @@ -from conan.tools.microsoft import is_msvc -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools import os +import re + +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, replace_in_file +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version - -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.53.0" class OpenVDBConan(ConanFile): @@ -16,232 +21,281 @@ class OpenVDBConan(ConanFile): "manipulation of sparse volumetric data discretized on three-dimensional grids." ) license = "MPL-2.0" - topics = ("voxel", "voxelizer", "volume-rendering", "fx") - homepage = "https://github.com/AcademySoftwareFoundation/openvdb" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AcademySoftwareFoundation/openvdb" + topics = ("voxel", "voxelizer", "volume-rendering", "fx", "vdb") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "build_ax": [True, False], + "simd": [None, "SSE42", "AVX"], + "use_colored_output": [True, False], + "use_delayed_loading": [True, False], + "use_explicit_instantiation": [True, False], + "use_imath_half": [True, False], "with_blosc": [True, False], - "with_zlib": [True, False], + # Deprecated because EXR is only used when building executables, which the recipe does not support + "with_exr": ["deprecated", True, False], "with_log4cplus": [True, False], - "with_exr": [True, False], - "simd": [None, "SSE42", "AVX"], + "with_zlib": [True, False], } default_options = { "shared": False, "fPIC": True, + "build_ax": False, + "simd": None, + "use_colored_output": False, + "use_delayed_loading": False, + "use_explicit_instantiation": False, + "use_imath_half": True, "with_blosc": True, + "with_exr": "deprecated", + "with_log4cplus": False, # Disabled by default because it is not compatible with C++17 "with_zlib": True, - "with_log4cplus": False, - "with_exr": False, - "simd": None, } - - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" + options_description = { + "build_ax": "Build the OpenVDB AX library.", + "simd": ( + "Choose whether to enable SIMD compiler flags or not. " + "Although not required, it is strongly recommended to enable SIMD. AVX implies SSE42." + ), + "use_colored_output": "Always produce ANSI-colored output (GNU/Clang only).", + "use_delayed_loading": "Build the core OpenVDB library with delayed-loading.", + "use_explicit_instantiation": ( + "Use explicit instantiation for all supported classes and methods against a pre-defined " + "list of OpenVDB trees. This makes the core library larger and slower to compile, but speeds up " + "the compilation of all dependent code by bypassing the expensive template instantiation. " + "Disabled by default in ConanCenter to avoid excessive memory usage during compilation." + ), + "use_imath_half": ( + "Use the definition of half-precision floating point types from the Imath library. " + "If False, the embedded definition provided by OpenVDB is used. " + "You may set this to on to force Imath half to be used if you know it to be required." + ), + "with_blosc": "Use Blosc for improved disk compression. Recommended.", + "with_log4cplus": "Use log4cplus for improved OpenVDB Logging.", + "with_zlib": "Use ZLib for disk serialization compression. ZLib can only be disabled if Blosc is also disabled.", + } @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return 17 if Version(self.version) >= "10.0.0" else 14 @property def _compilers_min_version(self): - return { - "msvc": "191", - "Visual Studio": "15", # Should we check toolset? - "gcc": "6.3.1", - "clang": "3.8", - "apple-clang": "3.8", - "intel": "17", - } - - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + if Version(self.version) >= "10.0.0": + # https://github.com/AcademySoftwareFoundation/openvdb/blob/v10.0.1/doc/dependencies.txt#L56-L84 + return { + "msvc": "192.8", + "Visual Studio": "16", + "gcc": "9.3.1", + "clang": "5.0", + "apple-clang": "12.0", + "intel-cc": "19", + } + else: + # https://github.com/AcademySoftwareFoundation/openvdb/blob/v9.1.0/doc/dependencies.txt#L56-L84 + return { + "msvc": "191.0", + "Visual Studio": "15", + "gcc": "6.3.1", + "clang": "3.8", + "apple-clang": "10.0", + "intel-cc": "17", + } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if is_msvc(self): + # Supported by GCC and Clang only + del self.options.use_colored_output + if Version(self.version) < "10.0.0": + del self.options.use_explicit_instantiation + del self.options.use_delayed_loading 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 package_id(self): + # with_exr is deprecated and has no effect + del self.info.options.with_exr def requirements(self): - self.requires("boost/1.79.0") - self.requires("onetbb/2020.3") - self.requires("openexr/2.5.7") # required for IlmBase::Half + # https://github.com/AcademySoftwareFoundation/openvdb/blob/v10.0.1/doc/dependencies.txt#L36-L84 + self.requires("boost/1.84.0", transitive_headers=True) + self.requires("onetbb/2021.10.0", transitive_headers=True, transitive_libs=True) + if self.options.use_imath_half: + self.requires("imath/3.1.9", transitive_headers=True, transitive_libs=True) if self.options.with_zlib: 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") if self.options.with_blosc: - self.requires("c-blosc/1.21.1") + self.requires("c-blosc/1.21.5") if self.options.with_log4cplus: - self.requires("log4cplus/2.0.7") + # log4cplus 2.x is not supported + self.requires("log4cplus/1.2.2", transitive_headers=True) - def _check_compilier_version(self): + def _check_compiler_version(self): compiler = str(self.settings.compiler) - version = tools.Version(self.settings.compiler.version) minimum_version = self._compilers_min_version.get(compiler, False) - if minimum_version and version < minimum_version: - raise ConanInvalidConfiguration(f"{self.name} requires a {compiler} version greater than {minimum_version}") + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.name} requires a {compiler} version greater than {minimum_version}" + ) def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, self._min_cppstd) if self.settings.arch not in ("x86", "x86_64"): if self.options.simd: raise ConanInvalidConfiguration("Only intel architectures support SSE4 or AVX.") - self._check_compilier_version() + self._check_compiler_version() + if self.options.with_exr != "deprecated": + self.output.warning("with_exr option is deprecated, do not use anymore.") + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if Version(self.version) >= "10.0.0": + self.tool_requires("cmake/[>=3.18 <4]") + if self.options.build_ax: + 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") 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() + + tc = CMakeToolchain(self) + tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.shared + tc.variables["OPENVDB_BUILD_AX"] = self.options.build_ax + tc.variables["OPENVDB_BUILD_BINARIES"] = False + tc.variables["OPENVDB_BUILD_CORE"] = True + tc.variables["OPENVDB_BUILD_DOCS"] = False + tc.variables["OPENVDB_BUILD_HOUDINI_ABITESTS"] = False + tc.variables["OPENVDB_BUILD_HOUDINI_PLUGIN"] = False + tc.variables["OPENVDB_BUILD_MAYA_PLUGIN"] = False + tc.variables["OPENVDB_BUILD_NANOVDB"] = False # nanovdb should be packaged separately in CCI + tc.variables["OPENVDB_BUILD_PYTHON_MODULE"] = False + tc.variables["OPENVDB_CORE_SHARED"] = self.options.shared + tc.variables["OPENVDB_CORE_STATIC"] = not self.options.shared + tc.variables["OPENVDB_CXX_STRICT"] = False + tc.variables["OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING"] = True + tc.variables["OPENVDB_ENABLE_RPATH"] = True + tc.variables["OPENVDB_ENABLE_UNINSTALL"] = False + tc.variables["OPENVDB_FUTURE_DEPRECATION"] = True + tc.variables["OPENVDB_INSTALL_CMAKE_MODULES"] = False + tc.variables["OPENVDB_SIMD"] = self.options.simd + tc.variables["OPENVDB_USE_DELAYED_LOADING"] = self.options.get_safe("use_delayed_loading", False) + tc.variables["USE_AX"] = False # used only by Python bindings and the Houdini plugin + tc.variables["USE_BLOSC"] = self.options.with_blosc + tc.variables["USE_COLORED_OUTPUT"] = self.options.get_safe("use_colored_output", False) + tc.variables["USE_EXPLICIT_INSTANTIATION"] = self.options.get_safe("use_explicit_instantiation", False) + tc.variables["USE_EXR"] = False + tc.variables["USE_HOUDINI"] = False + tc.variables["USE_IMATH_HALF"] = self.options.get_safe("use_imath_half", False) + tc.variables["USE_LOG4CPLUS"] = self.options.with_log4cplus + tc.variables["USE_MAYA"] = False + tc.variables["USE_NANOVDB"] = False + tc.variables["USE_PKGCONFIG"] = False + tc.variables["USE_PNG"] = False + tc.variables["USE_STATIC_DEPENDENCIES"] = False + tc.variables["USE_TBB"] = True # Only affects the nanovdb component + tc.variables["USE_ZLIB"] = self.options.with_zlib + tc.generate() + + tc = CMakeDeps(self) + tc.set_property("c-blosc", "cmake_file_name", "Blosc") + tc.set_property("c-blosc", "cmake_target_name", "Blosc::blosc") + tc.set_property("openexr", "cmake_file_name", "IlmBase") + tc.set_property("openexr::ilmbase_half", "cmake_target_name", "IlmBase::Half") + tc.set_property("log4cplus", "cmake_target_name", "Log4cplus::log4cplus") + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) # Remove FindXXX files from OpenVDB. Let Conan do the job - tools.remove_files_by_mask(os.path.join(self._source_subfolder, "cmake"), "Find*") - with open("FindBlosc.cmake", "w") as f: - f.write( - """find_package(c-blosc) -if(c-blosc_FOUND) - add_library(blosc INTERFACE) - target_link_libraries(blosc INTERFACE c-blosc::c-blosc) - add_library(Blosc::blosc ALIAS blosc) -endif() -""" - ) - with open("FindIlmBase.cmake", "w") as f: - f.write( - """find_package(OpenEXR) -if(OpenEXR_FOUND) - add_library(Half INTERFACE) - add_library(IlmThread INTERFACE) - add_library(Iex INTERFACE) - add_library(Imath INTERFACE) - add_library(IlmImf INTERFACE) - target_link_libraries(Half INTERFACE OpenEXR::OpenEXR) - target_link_libraries(IlmThread INTERFACE OpenEXR::OpenEXR) - target_link_libraries(Iex INTERFACE OpenEXR::OpenEXR) - target_link_libraries(Imath INTERFACE OpenEXR::OpenEXR) - target_link_libraries(IlmImf INTERFACE OpenEXR::OpenEXR) - add_library(IlmBase::Half ALIAS Half) - add_library(IlmBase::IlmThread ALIAS IlmThread) - add_library(IlmBase::Iex ALIAS Iex) - add_library(IlmBase::Imath ALIAS Imath) - add_library(OpenEXR::IlmImf ALIAS IlmImf) - endif() - """ - ) + rm(self, "Find*.cmake", os.path.join(self.source_folder, "cmake"), recursive=True) + # Relax version checks in find_package(), + # since the config/module files produced by CMakeDeps do not support gt major version checks + cmakelists = self.source_path.joinpath("openvdb", "openvdb", "CMakeLists.txt") + cmakelists.write_text(re.sub(r"\$\{MINIMUM_\S+_VERSION}", "", cmakelists.read_text())) + replace_in_file(self, os.path.join(self.source_folder, "openvdb", "openvdb", "CMakeLists.txt"), + "OPENVDB_FUTURE_DEPRECATION", "FALSE") def build(self): self._patch_sources() - cmake = self._configure_cmake() - cmake.build() - - @functools.lru_cache(1) - def _configure_cmake(self): cmake = CMake(self) - # exposed options - cmake.definitions["USE_BLOSC"] = self.options.with_blosc - cmake.definitions["USE_ZLIB"] = self.options.with_zlib - cmake.definitions["USE_LOG4CPLUS"] = self.options.with_log4cplus - cmake.definitions["USE_EXR"] = self.options.with_exr - cmake.definitions["OPENVDB_SIMD"] = self.options.simd - - cmake.definitions["OPENVDB_CORE_SHARED"] = self.options.shared - cmake.definitions["OPENVDB_CORE_STATIC"] = not self.options.shared - - # All available options but not exposed yet. Set to default values - cmake.definitions["OPENVDB_BUILD_CORE"] = True - cmake.definitions["OPENVDB_BUILD_BINARIES"] = False - cmake.definitions["OPENVDB_BUILD_PYTHON_MODULE"] = False - cmake.definitions["OPENVDB_BUILD_UNITTESTS"] = False - cmake.definitions["OPENVDB_BUILD_DOCS"] = False - cmake.definitions["OPENVDB_BUILD_HOUDINI_PLUGIN"] = False - cmake.definitions["OPENVDB_BUILD_HOUDINI_ABITESTS"] = False - - cmake.definitions["OPENVDB_BUILD_AX"] = False - cmake.definitions["OPENVDB_BUILD_AX_BINARIES"] = False - cmake.definitions["OPENVDB_BUILD_AX_UNITTESTS"] = False - - cmake.definitions["OPENVDB_BUILD_MAYA_PLUGIN"] = False - cmake.definitions["OPENVDB_ENABLE_RPATH"] = False - cmake.definitions["OPENVDB_CXX_STRICT"] = False - cmake.definitions["USE_HOUDINI"] = False - cmake.definitions["USE_MAYA"] = False - cmake.definitions["USE_STATIC_DEPENDENCIES"] = False - cmake.definitions["USE_PKGCONFIG"] = False - cmake.definitions["OPENVDB_INSTALL_CMAKE_MODULES"] = False - - cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared - cmake.definitions["OPENEXR_USE_STATIC_LIBS"] = not self.options["openexr"].shared - - cmake.definitions["OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING"] = True - - cmake.configure(build_folder=self._build_subfolder) - return cmake + 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() + @property + def _public_defines(self): + defines = [] + if self.options.shared: + defines.append("OPENVDB_DLL") + else: + defines.append("OPENVDB_STATICLIB") + if self.settings.os == "Windows": + defines.append("_WIN32") + defines.append("NOMINMAX") + if self.options.with_log4cplus: + defines.append("OPENVDB_USE_LOG4CPLUS") + return defines + def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "OpenVDB") self.cpp_info.set_property("cmake_target_name", "OpenVDB::openvdb") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + main_component = self.cpp_info.components["openvdb-core"] lib_prefix = "lib" if is_msvc(self) and not self.options.shared else "" - self.cpp_info.components["openvdb-core"].libs = [lib_prefix + "openvdb"] - - lib_define = "OPENVDB_DLL" if self.options.shared else "OPENVDB_STATICLIB" - self.cpp_info.components["openvdb-core"].defines.append(lib_define) - - if self.settings.os == "Windows": - self.cpp_info.components["openvdb-core"].defines.append("_WIN32") - self.cpp_info.components["openvdb-core"].defines.append("NOMINMAX") - - if not self.options["openexr"].shared: - self.cpp_info.components["openvdb-core"].defines.append("OPENVDB_OPENEXR_STATICLIB") - if self.options.with_exr: - self.cpp_info.components["openvdb-core"].defines.append("OPENVDB_TOOLS_RAYTRACER_USE_EXR") - if self.options.with_log4cplus: - self.cpp_info.components["openvdb-core"].defines.append("OPENVDB_USE_LOG4CPLUS") + main_component.libs = [lib_prefix + "openvdb"] + main_component.defines = self._public_defines + if self.settings.os in ("Linux", "FreeBSD"): + main_component.system_libs = ["pthread"] - self.cpp_info.components["openvdb-core"].requires = [ + main_component.requires = [ "boost::iostreams", "boost::system", "onetbb::onetbb", - "openexr::openexr", # should be "openexr::Half", ] if self.settings.os == "Windows": - self.cpp_info.components["openvdb-core"].requires.append("boost::disable_autolinking") - + main_component.requires.append("boost::disable_autolinking") if self.options.with_zlib: - self.cpp_info.components["openvdb-core"].requires.append("zlib::zlib") + main_component.requires.append("zlib::zlib") if self.options.with_blosc: - self.cpp_info.components["openvdb-core"].requires.append("c-blosc::c-blosc") + main_component.requires.append("c-blosc::c-blosc") if self.options.with_log4cplus: - self.cpp_info.components["openvdb-core"].requires.append("log4cplus::log4cplus") - - if self.settings.os in ("Linux", "FreeBSD"): - self.cpp_info.components["openvdb-core"].system_libs = ["pthread"] + main_component.requires.append("log4cplus::log4cplus") + if self.options.use_imath_half: + main_component.requires.append("imath::imath") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "OpenVDB" self.cpp_info.names["cmake_find_package_multi"] = "OpenVDB" - self.cpp_info.components["openvdb-core"].names["cmake_find_package"] = "openvdb" - self.cpp_info.components["openvdb-core"].names["cmake_find_package_multi"] = "openvdb" - self.cpp_info.components["openvdb-core"].set_property("cmake_target_name", "OpenVDB::openvdb") + main_component.names["cmake_find_package"] = "openvdb" + main_component.names["cmake_find_package_multi"] = "openvdb" + main_component.set_property("cmake_target_name", "OpenVDB::openvdb") diff --git a/recipes/openvdb/all/patches/0001-Find-packages-fixes.patch b/recipes/openvdb/all/patches/0001-Find-packages-fixes.patch deleted file mode 100644 index 65027361b1c53..0000000000000 --- a/recipes/openvdb/all/patches/0001-Find-packages-fixes.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ---- openvdb/openvdb/CMakeLists.txt -+++ openvdb/openvdb/CMakeLists.txt -@@ -413,8 +413,7 @@ if(WIN32) - # @note OPENVDB_OPENEXR_STATICLIB is old functionality from the makefiles - # used in PlatformConfig.h to configure EXR exports. Once this file - # is completely removed, this define can be too -- get_target_property(ILMBASE_LIB_TYPE IlmBase::Half TYPE) -- if(OPENEXR_USE_STATIC_LIBS OR (${ILMBASE_LIB_TYPE} STREQUAL STATIC_LIBRARY)) -+ if(OPENEXR_USE_STATIC_LIBS) - list(APPEND OPENVDB_CORE_PUBLIC_DEFINES -DOPENVDB_OPENEXR_STATICLIB) - endif() - list(APPEND OPENVDB_CORE_PUBLIC_DEFINES -D_WIN32 -DNOMINMAX) - diff --git a/recipes/openvdb/all/test_package/CMakeLists.txt b/recipes/openvdb/all/test_package/CMakeLists.txt index 1016f9a6ff31e..5665948f27dfd 100644 --- a/recipes/openvdb/all/test_package/CMakeLists.txt +++ b/recipes/openvdb/all/test_package/CMakeLists.txt @@ -1,11 +1,12 @@ -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(OpenVDB REQUIRED) +find_package(OpenVDB REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE OpenVDB::openvdb) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +if (OpenVDB_VERSION VERSION_GREATER_EQUAL "10.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/openvdb/all/test_package/conanfile.py b/recipes/openvdb/all/test_package/conanfile.py index 19e6a0c06e3d8..ef5d7042163ec 100644 --- a/recipes/openvdb/all/test_package/conanfile.py +++ b/recipes/openvdb/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/openvdb/config.yml b/recipes/openvdb/config.yml index d603f0308422b..203a6bdcd5a75 100644 --- a/recipes/openvdb/config.yml +++ b/recipes/openvdb/config.yml @@ -1,3 +1,7 @@ versions: - "8.0.1": + "11.0.0": + folder: all + "10.1.0": + folder: all + "9.1.0": folder: all diff --git a/recipes/openvino/all/conandata.yml b/recipes/openvino/all/conandata.yml index c1fa2ac395507..c58cef7057ca4 100644 --- a/recipes/openvino/all/conandata.yml +++ b/recipes/openvino/all/conandata.yml @@ -1,76 +1,55 @@ sources: - "2023.2.0": + "2025.1.0": "openvino": - url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2023.2.0.tar.gz" - sha256: "419b3137a1a549fc5054edbba5b71da76cbde730e8a271769126e021477ad47b" + url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2025.1.0.tar.gz" + sha256: "246c68e1799d035c85f773c986e4eb08f867d821c287abc638b9828e94852457" "arm_compute": - url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.08.tar.gz" - sha256: "62f514a555409d4401e5250b290cdf8cf1676e4eb775e5bd61ea6a740a8ce24f" + url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v24.09.tar.gz" + sha256: "49b8620f21cbbe49e825a131d9eacd548532646289b50e070b83860bd88087fe" + "arm_kleidiai": + url: "https://github.com/ARM-software/kleidiai/archive/eaf63a6ae9a903fb4fa8a4d004a974995011f444.tar.gz" + sha256: "756fa3040ff23f78a4c3f4c1984a3814d78d302b0b5dc3f0b255322368aefc58" "onednn_cpu": - url: "https://github.com/openvinotoolkit/oneDNN/archive/2ead5d4fe5993a797d9a7a4b8b5557b96f6ec90e.tar.gz" - sha256: "3c51d577f9e7e4cbd94ad08d267502953ec64513241dda6595b2608fafc8314c" + url: "https://github.com/openvinotoolkit/oneDNN/archive/5baba714e16e11309774a62783f363cad30e97c7.tar.gz" + sha256: "4430875c1690abecc57d9cc8464be690430e217a0453c69e030c667e5801e749" "mlas": - url: "https://github.com/openvinotoolkit/mlas/archive/f6425b1394334822390fcd9da12788c9cd0d11da.tar.gz" - sha256: "707a6634d62ea5563042a67161472b4be3ffe73c9783719519abdd583b0295f4" + url: "https://github.com/openvinotoolkit/mlas/archive/d1bc25ec4660cddd87804fcf03b2411b5dfb2e94.tar.gz" + sha256: "0a44fbfd4b13e8609d66ddac4b11a27c90c1074cde5244c91ad197901666004c" "onednn_gpu": - url: "https://github.com/oneapi-src/oneDNN/archive/284ad4574939fa784e4ddaa1f4aa577b8eb7a017.tar.gz" - sha256: "16f36078339cd08b949efea1d863344cb0b742d9f5898937d07a591b0c4da517" - "2023.1.0": + url: "https://github.com/oneapi-src/oneDNN/archive/fb61a91dd068f9f5abfe2629edbd7cdf53712c7a.tar.gz" + sha256: "be0d72d566386d237cd19523c5885aad7e91a74bd55eba326dca67c14395da22" + "2024.6.0": "openvino": - url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2023.1.0.tar.gz" - sha256: "ff88596b342440185874ddbe22874b47ad7b923f14671921af760b15c98aacd6" + url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2024.6.0.tar.gz" + sha256: "93f417409f3bf12445cb0d72b2af13d849d2b5125d5330d832f1bae55283e5b7" "arm_compute": - url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.02.1.tar.gz" - sha256: "c3a443e26539f866969242e690cf0651ef629149741ee18732f954c734da6763" + url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v24.09.tar.gz" + sha256: "49b8620f21cbbe49e825a131d9eacd548532646289b50e070b83860bd88087fe" + "onednn_cpu": + url: "https://github.com/openvinotoolkit/oneDNN/archive/c60a9946aa2386890e5c9f5587974facb7624227.tar.gz" + sha256: "37cea8af9772053fd6d178817f64d59e3aa7de9fd8f1aa21873075bb0664240f" + "mlas": + url: "https://github.com/openvinotoolkit/mlas/archive/d1bc25ec4660cddd87804fcf03b2411b5dfb2e94.tar.gz" + sha256: "0a44fbfd4b13e8609d66ddac4b11a27c90c1074cde5244c91ad197901666004c" + "onednn_gpu": + url: "https://github.com/oneapi-src/oneDNN/archive/0f269193c7466313888d3338209d0d06a22cc6fa.tar.gz" + sha256: "abad1ff4ac138c593b7a927ef2099b01447af1f7364848392a950ba17b32bcd8" + "2023.3.0": + "openvino": + url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2023.3.0.tar.gz" + sha256: "27cff20ac0662f5495d2c2eec47cbe5469ab2f225aa091d223f8bfc9d32f4fc3" + "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/ae825539bd850d1ad5c83d4bb0d56c65d46d5842.tar.gz" - sha256: "1204df17785c8603f9dfa1f4f91e91e5ffd4391bf7680d2b256de2513490ebee" + url: "https://github.com/openvinotoolkit/oneDNN/archive/cb3060bbf4694e46a1359a3d4dfe70500818f72d.tar.gz" + sha256: "9dea3da8dab8511677db3db68ff4d9cdbfd31d8614bf04fd79a7610892bb991c" "mlas": - url: "https://github.com/openvinotoolkit/mlas/archive/c7c8a631315000f17c650af34431009d2f22129c.tar.gz" - sha256: "7b790dfeef8e1dd612f920c85186c52ad3a3e2245e2a2afd6cc91ce4b1dc64a9" + url: "https://github.com/openvinotoolkit/mlas/archive/7a35e48a723944972088627be1a8b60841e8f6a5.tar.gz" + sha256: "b7fdd19523a88373d19fd8d5380f64c2834040fa50a6f0774acf08f3fa858daa" "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" + url: "https://github.com/oneapi-src/oneDNN/archive/cb77937ffcf5e83b5d1cf2940c94e8b508d8f7b4.tar.gz" + sha256: "2ca304c033786aa5c3ec1ec6f8fc3936ae5c6874d5964b586311da11bec2ec4a" +"patches": + "2025.1.0": + - patch_file: "patches/2025.1.0/include_paths.patch" diff --git a/recipes/openvino/all/conanfile.py b/recipes/openvino/all/conanfile.py index b1cfc1fd2fe86..d2fd4b15fa2a2 100644 --- a/recipes/openvino/all/conanfile.py +++ b/recipes/openvino/all/conanfile.py @@ -1,8 +1,9 @@ from conan import ConanFile from conan.errors import ConanException, ConanInvalidConfiguration -from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir import functools import os @@ -10,10 +11,10 @@ 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" @@ -99,6 +100,10 @@ def _target_x86_64(self): 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 _npu_option_available(self): + return self.settings.os in ["Linux", "Windows"] and self._target_x86_64 and Version(self.version) >= "2024.1.0" + @property def _gpu_option_available(self): return self.settings.os != "Macos" and self._target_x86_64 @@ -108,14 +113,8 @@ 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 _is_legacy_one_profile(self): + return not hasattr(self, "settings_build") def source(self): get(self, **self.conan_data["sources"][self.version]["openvino"], strip_root=True) @@ -127,6 +126,9 @@ def source(self): 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") + if Version(self.version) >= "2025.1.0": + get(self, **self.conan_data["sources"][self.version]["arm_kleidiai"], strip_root=True, + destination=f"{self.source_folder}/src/plugins/intel_cpu/thirdparty/kleidiai") rmdir(self, f"{self.source_folder}/src/plugins/intel_gpu/thirdparty/rapidjson") apply_conandata_patches(self) @@ -152,7 +154,7 @@ def configure(self): def build_requirements(self): if self._target_arm: self.tool_requires("scons/4.3.0") - if cross_building(self): + if not self._is_legacy_one_profile: if self._protobuf_required: self.tool_requires("protobuf/") if self.options.enable_tf_lite_frontend: @@ -163,6 +165,8 @@ def build_requirements(self): def requirements(self): self.requires("onetbb/2021.10.0") self.requires("pugixml/1.14") + if Version(self.version) >= "2025.1.0": + self.requires("nlohmann_json/3.11.3") if self._target_x86_64: self.requires("xbyak/6.73") if self.options.get_safe("enable_gpu"): @@ -183,6 +187,12 @@ def layout(self): cmake_layout(self, src_folder="src") def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if self._is_legacy_one_profile: + env = VirtualRunEnv(self) + env.generate(scope="build") + deps = CMakeDeps(self) deps.generate() @@ -191,9 +201,15 @@ def generate(self): 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 + toolchain.cache_variables["ENABLE_ONEDNN_FOR_GPU"] = ( + Version(self.version) >= "2024.4.0" and self.options.enable_gpu + or not self.options.enable_cpu + or self.options.shared + ) if self._gna_option_available: toolchain.cache_variables["ENABLE_INTEL_GNA"] = False + if self._npu_option_available: + toolchain.cache_variables["ENABLE_INTEL_NPU"] = False # SW plugins toolchain.cache_variables["ENABLE_AUTO"] = self.options.enable_auto toolchain.cache_variables["ENABLE_MULTI"] = self.options.enable_auto @@ -206,6 +222,8 @@ def generate(self): 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 + if Version(self.version) >= "2024.3.0": + toolchain.cache_variables["ENABLE_OV_JAX_FRONTEND"] = False # Dependencies toolchain.cache_variables["ENABLE_SYSTEM_TBB"] = True toolchain.cache_variables["ENABLE_TBBBIND_2_5"] = False @@ -234,15 +252,8 @@ def generate(self): 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}.", - ) + min_cppstd = "17" if Version(self.version) >= "2025.0.0" else "11" + check_min_cppstd(self, min_cppstd) # OpenVINO has unresolved symbols, when clang is used with libc++ if self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": @@ -254,13 +265,13 @@ def validate_build(self): 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") + # Failing on Conan Center CI due to memory usage + if os.getenv("CONAN_CENTER_BUILD_SERVICE") and self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.ref} does not support Debug build type on Conan Center CI") def validate(self): - if self.options.get_safe("enable_gpu") and not self.options.shared and self.options.enable_cpu: + if (self.options.get_safe("enable_gpu") and self.options.enable_cpu + and Version(self.version) < "2024.4.0" and not self.options.shared): # 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. " @@ -288,6 +299,8 @@ def package_info(self): openvino_runtime = self.cpp_info.components["Runtime"] openvino_runtime.set_property("cmake_target_name", "openvino::runtime") openvino_runtime.requires = ["onetbb::libtbb", "pugixml::pugixml"] + if Version(self.version) >= "2025.1.0": + openvino_runtime.requires.append("nlohmann_json::nlohmann_json") openvino_runtime.libs = ["openvino"] if self._preprocessing_available: openvino_runtime.requires.append("ade::ade") @@ -299,6 +312,8 @@ def package_info(self): openvino_runtime.system_libs.append("shlwapi") if self._preprocessing_available: openvino_runtime.system_libs.extend(["wsock32", "ws2_32"]) + if Version(self.version) < "2024.0.0": + openvino_runtime.includedirs.append(os.path.join("include", "ie")) # Have to expose all internal libraries for static libraries case if not self.options.shared: @@ -309,10 +324,12 @@ def package_info(self): openvino_runtime.libs.extend(["openvino_onednn_cpu", "openvino_snippets", "mlas"]) if self._target_arm: openvino_runtime.libs.append("arm_compute-static") + if Version(self.version) >= "2025.1.0": + openvino_runtime.libs.append("kleidiai") 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: + if not self.options.enable_cpu or Version(self.version) >= "2024.4.0": openvino_runtime.libs.append("openvino_onednn_gpu") # SW plugins if self.options.enable_auto: @@ -331,21 +348,26 @@ def package_info(self): 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.libs.extend(["openvino_tensorflow_frontend"]) 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.libs.extend(["openvino_tensorflow_lite_frontend"]) openvino_runtime.requires.extend(["flatbuffers::flatbuffers"]) + if self.options.enable_tf_frontend or self.options.enable_tf_lite_frontend: + openvino_runtime.libs.extend(["openvino_tensorflow_common"]) 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", + if Version(self.version) < "2024.0.0": + openvino_runtime.libs.append("openvino_builders") + openvino_runtime.libs.extend(["openvino_reference", "openvino_shape_inference", "openvino_itt", # utils goes last since all others depend on it "openvino_util"]) + if Version(self.version) >= "2025.1.0": + openvino_runtime.libs.append("openvino_common_translators") # 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 \ @@ -393,3 +415,4 @@ def package_info(self): 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 deleted file mode 100644 index fd126ded2ddee..0000000000000 --- a/recipes/openvino/all/dependencies/dependencies-2023.1.0.yml +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index aaa60d5c30197..0000000000000 --- a/recipes/openvino/all/dependencies/dependencies-2023.2.0.yml +++ /dev/null @@ -1,2 +0,0 @@ -onnx: "1.14.1" -ade: "0.1.2d" diff --git a/recipes/openvino/all/dependencies/dependencies-2023.3.0.yml b/recipes/openvino/all/dependencies/dependencies-2023.3.0.yml new file mode 100644 index 0000000000000..d2b07af77f816 --- /dev/null +++ b/recipes/openvino/all/dependencies/dependencies-2023.3.0.yml @@ -0,0 +1,2 @@ +onnx: "1.15.0" +ade: "0.1.2d" diff --git a/recipes/openvino/all/dependencies/dependencies-2024.6.0.yml b/recipes/openvino/all/dependencies/dependencies-2024.6.0.yml new file mode 100644 index 0000000000000..8885f88a6f2fb --- /dev/null +++ b/recipes/openvino/all/dependencies/dependencies-2024.6.0.yml @@ -0,0 +1 @@ +onnx: "1.16.2" \ No newline at end of file diff --git a/recipes/openvino/all/dependencies/dependencies-2025.1.0.yml b/recipes/openvino/all/dependencies/dependencies-2025.1.0.yml new file mode 100644 index 0000000000000..dc720e970ca8f --- /dev/null +++ b/recipes/openvino/all/dependencies/dependencies-2025.1.0.yml @@ -0,0 +1 @@ +onnx: "1.17.0" 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 deleted file mode 100644 index da6548b7c9115..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0001-cpu-plugin-compilation-c++17.patch +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 2df86d8ed0ec6..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0002-core-compilation-c++17.patch +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100644 index e5791b37c7a7a..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0003-fixed-gpu-with-onednn-build.patch +++ /dev/null @@ -1,684 +0,0 @@ -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 deleted file mode 100644 index 7659f10e22501..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0004-fixed-gpu-plugin-with-clang.patch +++ /dev/null @@ -1,2836 +0,0 @@ -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 deleted file mode 100644 index 50b087b4268b4..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0005-dynamic-protobuf.patch +++ /dev/null @@ -1,218 +0,0 @@ -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 deleted file mode 100644 index 4184c1832cef3..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0006-macos-14.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 552078a68bae7..0000000000000 --- a/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100644 index 36844097643e0..0000000000000 --- a/recipes/openvino/all/patches/2023.2.0/0001-git-version.patch +++ /dev/null @@ -1,31 +0,0 @@ -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/patches/2025.1.0/include_paths.patch b/recipes/openvino/all/patches/2025.1.0/include_paths.patch new file mode 100644 index 0000000000000..e7f12ee9f232a --- /dev/null +++ b/recipes/openvino/all/patches/2025.1.0/include_paths.patch @@ -0,0 +1,25 @@ +diff --git a/cmake/developer_package/compile_flags/functions.cmake b/cmake/developer_package/compile_flags/functions.cmake +index 2ec16e6424..072ddcd796 100644 +--- a/cmake/developer_package/compile_flags/functions.cmake ++++ b/cmake/developer_package/compile_flags/functions.cmake +@@ -458,12 +458,18 @@ function(ov_target_link_libraries_as_system TARGET_NAME LINK_TYPE) + if(TARGET ${library}) + get_target_property(include_directories ${library} INTERFACE_INCLUDE_DIRECTORIES) + if(include_directories) ++ if ("${include_directories}" MATCHES "^\\$$") ++ string(REGEX REPLACE "^\\$$" "" include_directories "${include_directories}") ++ endif() + foreach(include_directory IN LISTS include_directories) + # cannot include /usr/include headers as SYSTEM + if(NOT "${include_directory}" MATCHES ".*/usr/include.*$") + # Note, some include dirs can be wrapper with $ and we need to clean it +- string(REGEX REPLACE "^\\$$" "" include_directory "${include_directory}") ++ if ("${include_directory}" MATCHES "^\\$$") ++ string(REGEX REPLACE "^\\$$" "" include_directory "${include_directory}") ++ endif() + target_include_directories(${TARGET_NAME} SYSTEM ${LINK_TYPE} $) + else() + set(_system_library ON) diff --git a/recipes/openvino/all/test_package/test_package.c b/recipes/openvino/all/test_package/test_package.c index 1cea5771a2dbf..efe358d0b6ecb 100644 --- a/recipes/openvino/all/test_package/test_package.c +++ b/recipes/openvino/all/test_package/test_package.c @@ -23,21 +23,21 @@ int test_available_devices() { 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)); + OV_SUCCESS(ov_core_get_property(core, "AUTO", "SUPPORTED_PROPERTIES", &ret)); + OV_SUCCESS(ov_core_get_property(core, "MULTI", "SUPPORTED_PROPERTIES", &ret)); #else - OV_FAIL(ov_core_get_property(core, "AUTO", "SUPPORTED_METRICS", &ret)); - OV_FAIL(ov_core_get_property(core, "MULTI", "SUPPORTED_METRICS", &ret)); + OV_FAIL(ov_core_get_property(core, "AUTO", "SUPPORTED_PROPERTIES", &ret)); + OV_FAIL(ov_core_get_property(core, "MULTI", "SUPPORTED_PROPERTIES", &ret)); #endif #ifdef ENABLE_HETERO - OV_SUCCESS(ov_core_get_property(core, "HETERO", "SUPPORTED_METRICS", &ret)); + OV_SUCCESS(ov_core_get_property(core, "HETERO", "SUPPORTED_PROPERTIES", &ret)); #else - OV_FAIL(ov_core_get_property(core, "HETERO", "SUPPORTED_METRICS", &ret)); + OV_FAIL(ov_core_get_property(core, "HETERO", "SUPPORTED_PROPERTIES", &ret)); #endif #ifdef ENABLE_AUTO_BATCH - OV_SUCCESS(ov_core_get_property(core, "BATCH", "SUPPORTED_METRICS", &ret)); + OV_SUCCESS(ov_core_get_property(core, "BATCH", "SUPPORTED_PROPERTIES", &ret)); #else - OV_FAIL(ov_core_get_property(core, "BATCH", "SUPPORTED_METRICS", &ret)); + OV_FAIL(ov_core_get_property(core, "BATCH", "SUPPORTED_PROPERTIES", &ret)); #endif ov_core_free(core); return 0; diff --git a/recipes/openvino/config.yml b/recipes/openvino/config.yml index 60f706469b185..690fcfb67462e 100644 --- a/recipes/openvino/config.yml +++ b/recipes/openvino/config.yml @@ -1,5 +1,8 @@ versions: - "2023.2.0": + "2025.1.0": folder: "all" - "2023.1.0": + "2024.6.0": folder: "all" + "2023.3.0": + folder: "all" + diff --git a/recipes/openvr/all/CMakeLists.txt b/recipes/openvr/all/CMakeLists.txt deleted file mode 100644 index c4553e469fbbd..0000000000000 --- a/recipes/openvr/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -link_libraries(CONAN_PKG::jsoncpp) - -add_subdirectory(source_subfolder) diff --git a/recipes/openvr/all/conandata.yml b/recipes/openvr/all/conandata.yml index 8306fe238fc2a..8a94700e08a51 100644 --- a/recipes/openvr/all/conandata.yml +++ b/recipes/openvr/all/conandata.yml @@ -11,4 +11,3 @@ sources: patches: "1.16.8": - patch_file: "patches/fix-includes-and-assert-1.16.8.patch" - base_path: "source_subfolder" diff --git a/recipes/openvr/all/conanfile.py b/recipes/openvr/all/conanfile.py index 35ae1e9ea460d..78385d5356489 100644 --- a/recipes/openvr/all/conanfile.py +++ b/recipes/openvr/all/conanfile.py @@ -1,16 +1,30 @@ import os -from conans import ConanFile, tools, CMake -from conans.errors import ConanInvalidConfiguration + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration, ConanException +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, replace_in_file, rmdir, \ + save, mkdir +from conan.tools.scm import Version + +required_conan_version = ">=2.1" + class OpenvrConan(ConanFile): name = "openvr" - description = "API and runtime that allows access to VR hardware from applications have specific knowledge of the hardware they are targeting." - topics = ("conan", "openvr", "vr", ) + description = ( + "API and runtime that allows access to VR hardware from applications " + "have specific knowledge of the hardware they are targeting." + ) + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/ValveSoftware/openvr" - license = "BSD-3-Clause" + topics = ("vr", "virtual reality") - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -20,13 +34,8 @@ class OpenvrConan(ConanFile): "fPIC": True, } - exports_sources = ["CMakeLists.txt", "patches/**"] - 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": @@ -34,69 +43,86 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + self.options.rm_safe("fPIC") - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("OpenVR can't be compiled by {0} {1}".format(self.settings.compiler, - self.settings.compiler.version)) + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("jsoncpp/1.9.4") + self.requires("jsoncpp/1.9.5", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration( + f"OpenVR can't be compiled by {self.settings.compiler} {self.settings.compiler.version}" + ) 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_SHARED"] = self.options.shared + tc.cache_variables["BUILD_UNIVERSAL"] = False + # Let Conan handle the stdlib setting, even if we are using libc++ + tc.cache_variables["USE_LIBCXX"] = False + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.16.8": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") + 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) + apply_conandata_patches(self) # Honor fPIC=False - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "-fPIC", "") - # Unvendor jsoncpp (we rely on our CMake wrapper for jsoncpp injection) - tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "jsoncpp.cpp", "") - tools.rmdir(os.path.join(self._source_subfolder, "src", "json")) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_SHARED"] = self.options.shared - self._cmake.definitions["BUILD_UNIVERSAL"] = False - self._cmake.definitions["USE_LIBCXX"] = False - self._cmake.configure() - - return self._cmake + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "-fPIC", "") + # Unvendor jsoncpp + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "jsoncpp.cpp", "") + rmdir(self, os.path.join(self.source_folder, "src", "json")) + # Add jsoncpp dependency from Conan + save(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "find_package(jsoncpp REQUIRED CONFIG)\n" + "target_link_libraries(${LIBNAME} JsonCpp::JsonCpp)", + append=True) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() + @property + def _lib_name(self): + if self.settings.os == "Windows" and self.settings.arch == "x86_64": + return "openvr_api64" + return "openvr_api" + 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() - self.copy(pattern="openvr_api*.dll", dst="bin", src="bin", keep_path=False) - tools.rmdir(os.path.join(self.package_folder, "share")) + if self.settings.os == "Windows" and self.options.shared: + mkdir(self, os.path.join(self.package_folder, "bin")) + os.rename(os.path.join(self.package_folder, "lib", f"{self._lib_name}.dll"), + os.path.join(self.package_folder, "bin", f"{self._lib_name}.dll")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.names["pkg_config"] = "openvr" - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.set_property("pkg_config_name", "openvr") + self.cpp_info.libs = [self._lib_name] self.cpp_info.includedirs.append(os.path.join("include", "openvr")) if not self.options.shared: self.cpp_info.defines.append("OPENVR_BUILD_STATIC") - libcxx = tools.stdcpp_library(self) + libcxx = stdcpp_library(self) if libcxx: self.cpp_info.system_libs.append(libcxx) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("dl") - if tools.is_apple_os(self.settings.os): - self.cpp_info.frameworks.append("Foundation") + if is_apple_os(self): + self.cpp_info.frameworks.extend(["Foundation", "CoreFoundation"]) diff --git a/recipes/openvr/all/test_package/CMakeLists.txt b/recipes/openvr/all/test_package/CMakeLists.txt index aede60e3b1e4a..8759620a94936 100644 --- a/recipes/openvr/all/test_package/CMakeLists.txt +++ b/recipes/openvr/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(openvr 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 openvr::openvr) set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/openvr/all/test_package/conanfile.py b/recipes/openvr/all/test_package/conanfile.py index 4903f1a7e8fa0..ef5d7042163ec 100644 --- a/recipes/openvr/all/test_package/conanfile.py +++ b/recipes/openvr/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/openxlsx/all/test_package/CMakeLists.txt b/recipes/openxlsx/all/test_package/CMakeLists.txt index 63dbcb0eff0ef..854604ca5e613 100644 --- a/recipes/openxlsx/all/test_package/CMakeLists.txt +++ b/recipes/openxlsx/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) diff --git a/recipes/openxlsx/all/test_v1_package/CMakeLists.txt b/recipes/openxlsx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/openxlsx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/openxlsx/all/test_v1_package/conanfile.py b/recipes/openxlsx/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/openxlsx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/optimlib/all/CMakeLists.txt b/recipes/optimlib/all/CMakeLists.txt new file mode 100644 index 0000000000000..969c489f5660e --- /dev/null +++ b/recipes/optimlib/all/CMakeLists.txt @@ -0,0 +1,49 @@ +# Based on https://github.com/kthohr/optim/blob/5453f48aca695e6fef123677f35cb4d22e356e73/configure +cmake_minimum_required(VERSION 3.15) +project(OptimLib LANGUAGES CXX) + +set(OPTIM_LINEAR_ALG_LIB "eigen" CACHE STRING "Choice of linear algebra library") +set(OPTIM_FPN_TYPE "double" CACHE STRING "Floating-point number type") +option(OPTIM_PARALLEL "Enable OpenMP parallelization features" ON) + +file(GLOB_RECURSE SOURCES src/*.cpp) + +add_library(optim ${SOURCES}) +target_include_directories(optim PUBLIC include) +target_compile_features(optim PUBLIC cxx_std_11) + +target_compile_options(optim PRIVATE -Wall) +if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + target_compile_options(optim PRIVATE -O3 -ffp-contract=fast) + target_compile_definitions(optim PRIVATE -DARMA_NO_DEBUG) +endif() + +if(OPTIM_LINEAR_ALG_LIB STREQUAL "eigen") + find_package(Eigen3 REQUIRED) + target_link_libraries(optim PUBLIC Eigen3::Eigen) + target_compile_definitions(optim PRIVATE -DOPTIM_ENABLE_EIGEN_WRAPPERS) +elseif(OPTIM_LINEAR_ALG_LIB STREQUAL "arma") + find_package(Armadillo REQUIRED) + target_link_libraries(optim PUBLIC Armadillo::Armadillo) + target_compile_definitions(optim PRIVATE -DOPTIM_ENABLE_ARMA_WRAPPERS) +else() + message(FATAL_ERROR "OPTIM_LINEAR_ALG_LIB must be either 'eigen' or 'arma'. Got: ${OPTIM_LINEAR_ALG_LIB}") +endif() + +target_compile_definitions(optim PRIVATE -DOPTIM_FPN_TYPE=${OPTIM_FPN_TYPE}) + +if(OPTIM_PARALLEL) + find_package(OpenMP REQUIRED) + target_link_libraries(optim PUBLIC OpenMP::OpenMP_CXX) +endif() + +include(GNUInstallDirs) +install(TARGETS optim + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) +install(DIRECTORY include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.hpp" PATTERN "*.ipp" +) diff --git a/recipes/optimlib/all/conandata.yml b/recipes/optimlib/all/conandata.yml new file mode 100644 index 0000000000000..0d0a307dd5d0c --- /dev/null +++ b/recipes/optimlib/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + # The version is defined at https://github.com/kthohr/optim/blob/master/include/misc/optim_options.hpp#L30-L40 + "3.1.3": + source: + url: "https://github.com/kthohr/optim/archive/f9d9357169ce4b497a677faa9ce85e901e77275d.tar.gz" + sha256: "3809f753fc75c007c55ee995264c72487415a22dacc0846ba8ac0c1d1c24b91a" + base_matrix_ops: + url: "https://github.com/kthohr/BaseMatrixOps/archive/9e5beec15d803f0429dadae5e9218ef907271383.zip" + sha256: "f47de48e3814317d3cfa38f986bf847d816fa74dd13d8ccb9bac3ab51a49efd4" diff --git a/recipes/optimlib/all/conanfile.py b/recipes/optimlib/all/conanfile.py new file mode 100644 index 0000000000000..058265aa8ed45 --- /dev/null +++ b/recipes/optimlib/all/conanfile.py @@ -0,0 +1,129 @@ +import os + +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 copy, get + +required_conan_version = ">=1.54.0" + + +class OptimLibConan(ConanFile): + name = "optimlib" + description = "OptimLib: a lightweight C++ library of numerical optimization methods for nonlinear functions" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kthohr/optim" + topics = ("numerical-optimization", "optimization", "automatic-differentiation", "evolutionary-algorithms") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + "linear_alg_lib": ["arma", "eigen"], + "floating_point_type": ["float", "double"], + "with_openmp": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + "linear_alg_lib": "eigen", + "floating_point_type": "double", + "with_openmp": False, + } + + @property + def _min_cppstd(self): + return 11 + + 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": + del self.options.fPIC + + def configure(self): + if self.options.header_only: + self.package_type = "header-library" + self.options.rm_safe("shared") + self.options.rm_safe("fPIC") + elif self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.linear_alg_lib == "arma": + self.requires("armadillo/12.6.4", transitive_headers=True, transitive_libs=True) + elif self.options.linear_alg_lib == "eigen": + self.requires("eigen/3.4.0", transitive_headers=True, transitive_libs=True) + if self.options.with_openmp: + # '#pragma omp' is used in public headers + self.requires("openmp/system", transitive_headers=True, transitive_libs=True) + + def package_id(self): + if self.info.options.header_only: + self.info.clear() + + def validate(self): + if self.settings.os == "Windows": + # "Use of this library with Windows-based systems, with or without MSVC, is not supported." + raise ConanInvalidConfiguration("Windows is not supported") + + 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]["source"], strip_root=True) + get(self, **self.conan_data["sources"][self.version]["base_matrix_ops"], strip_root=True, + destination=os.path.join(self.source_folder, "include", "BaseMatrixOps")) + + def generate(self): + if not self.options.header_only: + tc = CMakeToolchain(self) + tc.variables["OPTIM_LINEAR_ALG_LIB"] = str(self.options.linear_alg_lib) + tc.variables["OPTIM_PARALLEL"] = self.options.with_openmp + tc.variables["OPTIM_FPN_TYPE"] = str(self.options.floating_point_type) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + if not self.options.header_only: + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "NOTICE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + if self.options.header_only: + self.run(f"./configure --header-only-version", cwd=self.source_folder) + include_dir = os.path.join(self.source_folder, "header_only_version") + copy(self, "*.hpp", include_dir, os.path.join(self.package_folder, "include")) + copy(self, "*.ipp", include_dir, os.path.join(self.package_folder, "include")) + else: + cmake = CMake(self) + cmake.install() + + def package_info(self): + # Unofficial CMake file and target + self.cpp_info.set_property("cmake_file_name", "OptimLib") + self.cpp_info.set_property("cmake_target_name", "OptimLib::OptimLib") + + if not self.options.header_only: + self.cpp_info.libs = ["optim"] + + if self.options.linear_alg_lib == "arma": + self.cpp_info.defines.append("OPTIM_ENABLE_ARMA_WRAPPERS") + if self.settings.build_type not in ["Debug", "RelWithDebInfo"]: + self.cpp_info.defines.append("ARMA_NO_DEBUG") + elif self.options.linear_alg_lib == "eigen": + self.cpp_info.defines.append("OPTIM_ENABLE_EIGEN_WRAPPERS") + self.cpp_info.defines.append(f"OPTIM_FPN_TYPE={self.options.floating_point_type}") diff --git a/recipes/optimlib/all/test_package/CMakeLists.txt b/recipes/optimlib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..897ebb983164b --- /dev/null +++ b/recipes/optimlib/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(OptimLib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE OptimLib::OptimLib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/optimlib/all/test_package/conanfile.py b/recipes/optimlib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/optimlib/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/optimlib/all/test_package/test_package.cpp b/recipes/optimlib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c2c8b66e698d0 --- /dev/null +++ b/recipes/optimlib/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include + +struct ll_data_t +{ + optim::ColVec_t Y; + optim::Mat_t X; +}; + +double ll_fn(const optim::ColVec_t& vals_inp, optim::ColVec_t* grad_out, void* opt_data) +{ + return 0.0; +} + +int main() +{ + int n_dim = 5; + int n_samp = 40; + ll_data_t opt_data; + opt_data.Y = optim::ColVec_t(n_samp); + opt_data.X = optim::Mat_t(n_samp, n_dim); + optim::ColVec_t x(n_samp); + optim::algo_settings_t settings; + bool success = optim::gd(x, ll_fn, &opt_data, settings); +} diff --git a/recipes/optimlib/config.yml b/recipes/optimlib/config.yml new file mode 100644 index 0000000000000..71660a79817c5 --- /dev/null +++ b/recipes/optimlib/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.3": + folder: all diff --git a/recipes/optional-lite/all/conandata.yml b/recipes/optional-lite/all/conandata.yml index 39ffa178f7dc7..91b29bae3c40f 100644 --- a/recipes/optional-lite/all/conandata.yml +++ b/recipes/optional-lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.6.0": + url: "https://github.com/martinmoene/optional-lite/archive/v3.6.0.tar.gz" + sha256: "2be17fcfc764809612282c3e728cabc42afe703b9dc333cc87c48d882fcfc2c2" "3.5.0": url: "https://github.com/martinmoene/optional-lite/archive/v3.5.0.tar.gz" sha256: "6077cee87e2812afd05a273645051e0b55397a25c220295ddc1d6f49d0cf5cc8" diff --git a/recipes/optional-lite/all/conanfile.py b/recipes/optional-lite/all/conanfile.py index cc778fb643aac..c0ba7980dc0da 100644 --- a/recipes/optional-lite/all/conanfile.py +++ b/recipes/optional-lite/all/conanfile.py @@ -8,11 +8,11 @@ class OptionalLiteConan(ConanFile): name = "optional-lite" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/martinmoene/optional-lite" description = "A single-file header-only version of a C++17-like optional, a nullable object for C++98, C++11 and later" - topics = ("cpp98", "cpp17", "optional", "optional-implementations") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/optional-lite" + topics = ("cpp98", "cpp17", "optional", "optional-implementations", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -26,9 +26,6 @@ def package_id(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - 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")) diff --git a/recipes/optional-lite/all/test_package/CMakeLists.txt b/recipes/optional-lite/all/test_package/CMakeLists.txt index cc0865d43e169..7955d7f2b973e 100644 --- a/recipes/optional-lite/all/test_package/CMakeLists.txt +++ b/recipes/optional-lite/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(optional-lite REQUIRED CONFIG) diff --git a/recipes/optional-lite/all/test_v1_package/CMakeLists.txt b/recipes/optional-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 381a5d41cbb1b..0000000000000 --- a/recipes/optional-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(optional-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::optional-lite) diff --git a/recipes/optional-lite/all/test_v1_package/conanfile.py b/recipes/optional-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/optional-lite/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_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/optional-lite/config.yml b/recipes/optional-lite/config.yml index 14d2da2b590c7..07884c2e355df 100644 --- a/recipes/optional-lite/config.yml +++ b/recipes/optional-lite/config.yml @@ -1,4 +1,6 @@ versions: + "3.6.0": + folder: all "3.5.0": folder: all "3.4.0": diff --git a/recipes/opus/all/conandata.yml b/recipes/opus/all/conandata.yml index 5ac1b419900e1..a7288d00d394f 100644 --- a/recipes/opus/all/conandata.yml +++ b/recipes/opus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.2": + url: "https://gitlab.xiph.org/xiph/opus/-/archive/v1.5.2/opus-v1.5.2.tar.gz" + sha256: "5cf92b5b577d8ed203424f1e0f618f30bc6b6e42a26eae88bdb649ea63961cc9" "1.4": url: "https://github.com/xiph/opus/releases/download/v1.4/opus-1.4.tar.gz" sha256: "c9b32b4253be5ae63d1ff16eea06b94b5f0f2951b7a02aceef58e3a3ce49c51f" @@ -8,3 +11,5 @@ sources: patches: "1.3.1": - patch_file: "patches/1.3.1-add-opus_buildtype-cmake.patch" + patch_description: "Set a default build type if none was specified" + patch_type: "portability" diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index 2dfefae5f4332..986864e371233 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -1,10 +1,13 @@ 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 -from conan.tools.microsoft import check_min_vs +from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime +from conan.tools.env import VirtualBuildEnv +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2" class OpusConan(ConanFile): @@ -14,7 +17,7 @@ class OpusConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://opus-codec.org" license = "BSD-3-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,6 +32,10 @@ class OpusConan(ConanFile): "stack_protector": True, } + def build_requirements(self): + if Version(self.version) >= "1.5.2": + self.tool_requires("cmake/[>=3.16 <4]") + def export_sources(self): export_conandata_patches(self) @@ -47,6 +54,8 @@ def layout(self): def validate(self): check_min_vs(self, 190) + if Version(self.version) >= "1.5.2" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": + raise ConanInvalidConfiguration(f"{self.ref} GCC-{self.settings.compiler.version} not supported due to lack of AVX2 support. Use GCC >=8.") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -54,8 +63,13 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["OPUS_FIXED_POINT"] = self.options.fixed_point - tc.variables["OPUS_STACK_PROTECTOR"] = self.options.stack_protector + tc.cache_variables["OPUS_BUILD_SHARED_LIBRARY"] = self.options.shared + tc.cache_variables["OPUS_FIXED_POINT"] = self.options.fixed_point + tc.cache_variables["OPUS_STACK_PROTECTOR"] = self.options.stack_protector + if Version(self.version) >= "1.5.2" and is_msvc(self): + tc.cache_variables["OPUS_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + if Version(self.version) < "1.5": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -84,9 +98,5 @@ def package_info(self): self.cpp_info.components["libopus"].system_libs.append("ssp") # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "Opus" - self.cpp_info.names["cmake_find_package_multi"] = "Opus" - self.cpp_info.components["libopus"].names["cmake_find_package"] = "opus" - self.cpp_info.components["libopus"].names["cmake_find_package_multi"] = "opus" self.cpp_info.components["libopus"].set_property("cmake_target_name", "Opus::opus") self.cpp_info.components["libopus"].set_property("pkg_config_name", "opus") diff --git a/recipes/opus/all/test_package/CMakeLists.txt b/recipes/opus/all/test_package/CMakeLists.txt index 8688c331423ac..b8210ffa9c27e 100644 --- a/recipes/opus/all/test_package/CMakeLists.txt +++ b/recipes/opus/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(Opus REQUIRED CONFIG) diff --git a/recipes/opus/all/test_package/conanfile.py b/recipes/opus/all/test_package/conanfile.py index 642aa7eed877c..0a6bc68712d90 100644 --- a/recipes/opus/all/test_package/conanfile.py +++ b/recipes/opus/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - pcm_path = os.path.join(self.source_folder, "test.pcm") - self.run(f"{bin_path} {pcm_path} out.pcm", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/opus/all/test_package/test.pcm b/recipes/opus/all/test_package/test.pcm deleted file mode 100644 index f4d71f2770637..0000000000000 Binary files a/recipes/opus/all/test_package/test.pcm and /dev/null differ diff --git a/recipes/opus/all/test_package/test_package.c b/recipes/opus/all/test_package/test_package.c index a39ea4aacd883..3da6fd100efb6 100644 --- a/recipes/opus/all/test_package/test_package.c +++ b/recipes/opus/all/test_package/test_package.c @@ -1,159 +1,13 @@ -/* Copyright (c) 2013 Jean-Marc Valin */ -/* - 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. - - 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. -*/ - -/* This is meant to be a simple example of encoding and decoding audio - using Opus. It should make it easy to understand how the Opus API - works. For more information, see the full API documentation at: - https://www.opus-codec.org/docs/ */ - -#include -#include -#include -#include #include +#include -/*The frame size is hardcoded for this sample code but it doesn't have to be*/ -#define FRAME_SIZE 960 -#define SAMPLE_RATE 48000 -#define CHANNELS 2 -#define APPLICATION OPUS_APPLICATION_AUDIO -#define BITRATE 64000 - -#define MAX_FRAME_SIZE 6*960 -#define MAX_PACKET_SIZE (3*1276) - -int main(int argc, char **argv) -{ - char *inFile; - FILE *fin; - char *outFile; - FILE *fout; - opus_int16 in[FRAME_SIZE*CHANNELS]; - opus_int16 out[MAX_FRAME_SIZE*CHANNELS]; - unsigned char cbits[MAX_PACKET_SIZE]; - int nbBytes; - /*Holds the state of the encoder and decoder */ - OpusEncoder *encoder; - OpusDecoder *decoder; - int err; - - if (argc != 3) - { - fprintf(stderr, "usage: trivial_example input.pcm output.pcm\n"); - fprintf(stderr, "input and output are 16-bit little-endian raw files\n"); - return EXIT_FAILURE; - } - - /*Create a new encoder state */ - encoder = opus_encoder_create(SAMPLE_RATE, CHANNELS, APPLICATION, &err); - if (err<0) - { - fprintf(stderr, "failed to create an encoder: %s\n", opus_strerror(err)); - return EXIT_FAILURE; - } - /* Set the desired bit-rate. You can also set other parameters if needed. - The Opus library is designed to have good defaults, so only set - parameters you know you need. Doing otherwise is likely to result - in worse quality, but better. */ - err = opus_encoder_ctl(encoder, OPUS_SET_BITRATE(BITRATE)); - if (err<0) - { - fprintf(stderr, "failed to set bitrate: %s\n", opus_strerror(err)); - return EXIT_FAILURE; - } - inFile = argv[1]; - fin = fopen(inFile, "r"); - if (fin==NULL) - { - fprintf(stderr, "failed to open input file: %s\n", strerror(errno)); - return EXIT_FAILURE; - } - - - /* Create a new decoder state. */ - decoder = opus_decoder_create(SAMPLE_RATE, CHANNELS, &err); - if (err<0) - { - fprintf(stderr, "failed to create decoder: %s\n", opus_strerror(err)); - return EXIT_FAILURE; - } - outFile = argv[2]; - fout = fopen(outFile, "w"); - if (fout==NULL) - { - fprintf(stderr, "failed to open output file: %s\n", strerror(errno)); - return EXIT_FAILURE; - } - - while (!feof(fin)) - { - int i; - unsigned char pcm_bytes[MAX_FRAME_SIZE*CHANNELS*2]; - int frame_size; - - /* Read a 16 bits/sample audio frame. */ - fread(pcm_bytes, sizeof(short)*CHANNELS, FRAME_SIZE, fin); - - /* Convert from little-endian ordering. */ - for (i=0;i>8)&0xFF; - } - /* Write the decoded audio to file. */ - fwrite(pcm_bytes, sizeof(short), frame_size*CHANNELS, fout); - } - /*Destroy the encoder state*/ - opus_encoder_destroy(encoder); - opus_decoder_destroy(decoder); - fclose(fin); - fclose(fout); - return EXIT_SUCCESS; + encoder = opus_encoder_create(rate, channels, application, &err); + opus_encoder_destroy(encoder); } diff --git a/recipes/opus/all/test_v1_package/CMakeLists.txt b/recipes/opus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/opus/all/test_v1_package/conanfile.py b/recipes/opus/all/test_v1_package/conanfile.py deleted file mode 100644 index 9534054c99e3c..0000000000000 --- a/recipes/opus/all/test_v1_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 = os.path.join("bin", "test_package") - pcm_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.pcm") - self.run(f"{bin_path} {pcm_path} out.pcm", run_environment=True) diff --git a/recipes/opus/config.yml b/recipes/opus/config.yml index 3360afdd0ecab..e9cd861cf2166 100644 --- a/recipes/opus/config.yml +++ b/recipes/opus/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.2": + folder: all "1.4": folder: all "1.3.1": diff --git a/recipes/opusfile/all/test_v1_package/CMakeLists.txt b/recipes/opusfile/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/opusfile/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/opusfile/all/test_v1_package/conanfile.py b/recipes/opusfile/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/opusfile/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_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/orc/all/ConanThirdpartyToolchain.cmake b/recipes/orc/all/ConanThirdpartyToolchain.cmake new file mode 100644 index 0000000000000..7c6f64861a7cd --- /dev/null +++ b/recipes/orc/all/ConanThirdpartyToolchain.cmake @@ -0,0 +1,50 @@ +# ---------------------------------------------------------------------- +# Snappy + +find_package (Snappy REQUIRED) + +add_library (orc_snappy INTERFACE) +add_library (orc::snappy ALIAS orc_snappy) +target_link_libraries(orc_snappy INTERFACE Snappy::snappy) + +# ---------------------------------------------------------------------- +# ZLIB + +find_package (ZLIB REQUIRED) + +add_library (orc_zlib INTERFACE) +add_library (orc::zlib ALIAS orc_zlib) +target_link_libraries (orc_zlib INTERFACE ZLIB::ZLIB) + +# ---------------------------------------------------------------------- +# Zstd + +find_package (ZSTD REQUIRED) + +add_library (orc_zstd INTERFACE) +add_library (orc::zstd ALIAS orc_zstd) +target_link_libraries (orc_zstd INTERFACE + $ + $ +) + +# ---------------------------------------------------------------------- +# LZ4 + +find_package (LZ4 REQUIRED) + +add_library (orc_lz4 INTERFACE) +add_library (orc::lz4 ALIAS orc_lz4) +target_link_libraries (orc_lz4 INTERFACE + $ + $ +) + +# ---------------------------------------------------------------------- +# Protobuf + +find_package (Protobuf REQUIRED) + +add_library (orc_protobuf INTERFACE) +add_library (orc::protobuf ALIAS orc_protobuf) +target_link_libraries (orc_protobuf INTERFACE protobuf::protobuf) diff --git a/recipes/orc/all/conandata.yml b/recipes/orc/all/conandata.yml new file mode 100644 index 0000000000000..93e159be33f25 --- /dev/null +++ b/recipes/orc/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "2.1.1": + url: "https://archive.apache.org/dist/orc/orc-2.1.1/orc-2.1.1.tar.gz" + sha256: "15af8baeee322bab0298559a14a09cf8c14cf2008e35d8a78d3cc8a4c98d1e59" + "2.0.3": + url: "https://archive.apache.org/dist/orc/orc-2.0.3/orc-2.0.3.tar.gz" + sha256: "082cba862b5a8a0d14c225404d0b51cd8d1b64ca81b8f1e500322ce8922cb86d" + "2.0.0": + url: "https://archive.apache.org/dist/orc/orc-2.0.0/orc-2.0.0.tar.gz" + sha256: "9107730919c29eb39efaff1b9e36166634d1d4d9477e5fee76bfd6a8fec317df" + "1.9.5": + url: "https://archive.apache.org/dist/orc/orc-1.9.5/orc-1.9.5.tar.gz" + sha256: "6900b4e8a2e4e49275f4067bd0f838ad68330204305fd3f13a5ec519e9d71547" diff --git a/recipes/orc/all/conanfile.py b/recipes/orc/all/conanfile.py new file mode 100644 index 0000000000000..4487f567272e7 --- /dev/null +++ b/recipes/orc/all/conanfile.py @@ -0,0 +1,129 @@ +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.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rmdir, replace_in_file, mkdir +from conan.tools.scm import Version + +required_conan_version = ">=2.1" + +class OrcRecipe(ConanFile): + name = "orc" + description = "ORC is a self-describing type-aware columnar file format designed for Hadoop workloads" + license = "Apache-2.0" + homepage = "https://orc.apache.org/" + url = "https://github.com/conan-io/conan-center-index" + topics = ("orc", "columnar", "file-format", "hadoop") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_tools": [True, False], + "build_avx512": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_tools": False, + "build_avx512": True, + } + + @property + def _should_patch_thirdparty_toolchain(self): + return Version(self.version) < "2.0.0" + + def export_sources(self): + if self._should_patch_thirdparty_toolchain: + copy(self, "ConanThirdpartyToolchain.cmake", + self.recipe_folder, os.path.join(self.export_sources_folder, "src", "cmake_modules")) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.compiler == "apple-clang": + # AVX support is not enabled by default, might need to add -mavx512f to CXXFLAGS + del self.options.build_avx512 + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src", build_folder="build") + + def requirements(self): + self.requires("protobuf/3.21.12") + self.requires("lz4/1.9.4") + self.requires("snappy/1.1.9") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("zstd/[~1.5]") + + def validate(self): + check_min_cppstd(self, 17) + + def build_requirements(self): + self.tool_requires("protobuf/") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + self._patch_sources() + + def generate(self): + VirtualBuildEnv(self).generate() + VirtualRunEnv(self).generate(scope="build") + + tc = CMakeToolchain(self) + tc.variables["ORC_PACKAGE_KIND"] = "conan" + tc.variables["BUILD_JAVA"] = False + tc.variables["BUILD_CPP_TESTS"] = False + tc.variables["BUILD_TOOLS"] = self.options.build_tools + tc.variables["BUILD_LIBHDFSPP"] = False + tc.variables["BUILD_POSITION_INDEPENDENT_LIB"] = bool(self.options.get_safe("fPIC", True)) + tc.variables["INSTALL_VENDORED_LIBS"] = False + # AVX512 support is determined by ORC_USER_SIMD_LEVEL env var at runtime, defaults to off + tc.variables["BUILD_ENABLE_AVX512"] = self.options.get_safe("build_avx512", False) + tc.variables["STOP_BUILD_ON_WARNING"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + + protoc_path = os.path.join(self.dependencies["protobuf"].cpp_info.bindir, "protoc") + tc.variables["PROTOBUF_EXECUTABLE"] = protoc_path.replace("\\", "/") + tc.variables["HAS_POST_2038"] = self.settings.os != "Windows" + tc.variables["HAS_PRE_1970"] = self.settings.os != "Windows" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + if self._should_patch_thirdparty_toolchain: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "ThirdpartyToolchain", "ConanThirdpartyToolchain") + # Allow shared builds + replace_in_file(self, os.path.join(self.source_folder, "c++", "src", "CMakeLists.txt"), + "add_library (orc STATIC ${SOURCE_FILES})", "add_library (orc ${SOURCE_FILES})") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "NOTICE", self.source_folder, 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")) + if self.settings.os == "Windows" and self.options.shared and Version(self.version) < "2.1.1": + mkdir(self, os.path.join(self.package_folder, "bin")) + os.rename(os.path.join(self.package_folder, "lib", "orc.dll"), + os.path.join(self.package_folder, "bin", "orc.dll")) + + def package_info(self): + self.cpp_info.libs = ["orc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/orc/all/test_package/CMakeLists.txt b/recipes/orc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..620d40236f2e4 --- /dev/null +++ b/recipes/orc/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(orc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE orc::orc) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/orc/all/test_package/conanfile.py b/recipes/orc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..594384bd24a75 --- /dev/null +++ b/recipes/orc/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 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): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/orc/all/test_package/test_package.cpp b/recipes/orc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ba9153b830bac --- /dev/null +++ b/recipes/orc/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() { + auto orcType = orc::Type::buildTypeFromString("struct"); + std::cout << orcType->toString() << std::endl; + return 0; +} diff --git a/recipes/orc/config.yml b/recipes/orc/config.yml new file mode 100644 index 0000000000000..71fe108edc803 --- /dev/null +++ b/recipes/orc/config.yml @@ -0,0 +1,9 @@ +versions: + "2.1.1": + folder: all + "2.0.3": + folder: all + "2.0.0": + folder: all + "1.9.5": + folder: all diff --git a/recipes/orcania/all/conandata.yml b/recipes/orcania/all/conandata.yml index a6c92d3317bea..b3d67d34849da 100644 --- a/recipes/orcania/all/conandata.yml +++ b/recipes/orcania/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "2.3.3": + url: "https://github.com/babelouest/orcania/archive/refs/tags/v2.3.3.tar.gz" + sha256: "e26947f7622acf3660b71fb8018ee791c97376530ab6c4a00e4aa2775e052626" "2.3.1": url: "https://github.com/babelouest/orcania/archive/refs/tags/v2.3.1.tar.gz" sha256: "bbf08d563528b8ab88dd4b0e67aeb4e7c4fc9f19dcd1a0346b773cf492f7612b" patches: + "2.3.3": + - patch_file: "patches//2.3.3-0001-getopt-for-msvc.patch" + patch_description: "fubd_package getopt-for-visual-studio for MSVC" + patch_type: "portability" "2.3.1": - patch_file: "patches/2.3.1-0001-mingw-fix-Werror=stringop-truncation.patch" patch_description: "Fixes -Werror=stringop-truncation error when building with MinGW@Linux" diff --git a/recipes/orcania/all/patches/2.3.3-0001-getopt-for-msvc.patch b/recipes/orcania/all/patches/2.3.3-0001-getopt-for-msvc.patch new file mode 100644 index 0000000000000..eea0c3aaeeacf --- /dev/null +++ b/recipes/orcania/all/patches/2.3.3-0001-getopt-for-msvc.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44c7299..7421f49 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -202,6 +202,10 @@ if (BUILD_BASE64URL) + target_link_libraries(base64url PRIVATE ${orcania_lib}) + install(TARGETS base64url RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES ${BASE64URL_DIR}/base64url.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT runtime) ++ if(MSVC) ++ find_package(getopt-for-visual-studio REQUIRED) ++ target_link_libraries(base64url PRIVATE getopt-for-visual-studio::getopt-for-visual-studio) ++ endif() + endif () + + # tests diff --git a/recipes/orcania/all/test_package/CMakeLists.txt b/recipes/orcania/all/test_package/CMakeLists.txt index 3fa9c9d5af35f..3d40f863128e4 100644 --- a/recipes/orcania/all/test_package/CMakeLists.txt +++ b/recipes/orcania/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(Orcania REQUIRED CONFIG) diff --git a/recipes/orcania/all/test_v1_package/CMakeLists.txt b/recipes/orcania/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 08501e6ccb845..0000000000000 --- a/recipes/orcania/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -find_package(Orcania REQUIRED CONFIG) - -option(ORCANIA_SHARED "Orcania is built as a shared library") - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -if(ORCANIA_SHARED) - target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE Orcania::Orcania-static) -endif() diff --git a/recipes/orcania/all/test_v1_package/conanfile.py b/recipes/orcania/all/test_v1_package/conanfile.py deleted file mode 100644 index 79db5a07b9c06..0000000000000 --- a/recipes/orcania/all/test_v1_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.definitions["ORCANIA_SHARED"] = self.options["orcania"].shared - 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/orcania/config.yml b/recipes/orcania/config.yml index 215bc57fe4993..12ddc838534be 100644 --- a/recipes/orcania/config.yml +++ b/recipes/orcania/config.yml @@ -1,3 +1,5 @@ versions: + "2.3.3": + folder: all "2.3.1": folder: all diff --git a/recipes/osgearth/all/CMakeLists.txt b/recipes/osgearth/all/CMakeLists.txt index 1dc2e9e4778f3..22ab1aa73df02 100644 --- a/recipes/osgearth/all/CMakeLists.txt +++ b/recipes/osgearth/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(conanbuildinfo.cmake) diff --git a/recipes/osgearth/all/conanfile.py b/recipes/osgearth/all/conanfile.py index e916db567410d..5e33196797fee 100644 --- a/recipes/osgearth/all/conanfile.py +++ b/recipes/osgearth/all/conanfile.py @@ -120,13 +120,13 @@ def requirements(self): if self.options.build_leveldb_cache: self.requires("leveldb/1.22") if self.options.build_rocksdb_cache: - self.requires("rocksdb/6.20.3") + self.requires("rocksdb/6.29.5") if self.options.build_zip_plugin: self.requires("zstd/1.5.5") # override if self.options.with_geos: self.requires("geos/3.11.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/[>=3.42 <4]") if self.options.with_draco: self.requires("draco/1.4.3") # if self.options.with_basisu: diff --git a/recipes/osgearth/all/test_package/CMakeLists.txt b/recipes/osgearth/all/test_package/CMakeLists.txt index 3737cad073075..571c9107da374 100644 --- a/recipes/osgearth/all/test_package/CMakeLists.txt +++ b/recipes/osgearth/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) set(CMAKE_CXX_STANDARD 11) diff --git a/recipes/osmanip/all/CMakeLists.txt b/recipes/osmanip/all/CMakeLists.txt index ae515532d7df7..a8dff1c7823ce 100644 --- a/recipes/osmanip/all/CMakeLists.txt +++ b/recipes/osmanip/all/CMakeLists.txt @@ -1,33 +1,39 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.15) project(osmanip LANGUAGES CXX) find_package(arsenalgear REQUIRED CONFIG) add_library(osmanip) target_sources(osmanip PRIVATE - ${OSMANIP_SRC_DIR}/src/graphics/canvas.cpp - ${OSMANIP_SRC_DIR}/src/graphics/plot_2D.cpp + src/graphics/canvas.cpp + src/graphics/plot_2D.cpp + $<$: + src/utility/iostream.cpp + src/utility/output_redirector.cpp + src/utility/sstream.cpp + src/utility/strings.cpp + > $<$: - ${OSMANIP_SRC_DIR}/src/manipulators/colsty.cpp - ${OSMANIP_SRC_DIR}/src/manipulators/common.cpp - ${OSMANIP_SRC_DIR}/src/manipulators/cursor.cpp - ${OSMANIP_SRC_DIR}/src/manipulators/decorator.cpp + src/manipulators/colsty.cpp + src/manipulators/common.cpp + src/manipulators/cursor.cpp + src/manipulators/decorator.cpp > $<$,$>: - ${OSMANIP_SRC_DIR}/src/manipulators/colsty.cpp - ${OSMANIP_SRC_DIR}/src/manipulators/common.cpp - ${OSMANIP_SRC_DIR}/src/manipulators/cursor.cpp - ${OSMANIP_SRC_DIR}/src/manipulators/printer.cpp + src/manipulators/colsty.cpp + src/manipulators/common.cpp + src/manipulators/cursor.cpp + src/manipulators/printer.cpp > $<$: - ${OSMANIP_SRC_DIR}/src/manipulators/csmanip.cpp + src/manipulators/csmanip.cpp > $<$: - ${OSMANIP_SRC_DIR}/src/progressbar/progress_bar.cpp + src/progressbar/progress_bar.cpp > - ${OSMANIP_SRC_DIR}/src/utility/windows.cpp + src/utility/windows.cpp ) -target_include_directories(osmanip PUBLIC ${OSMANIP_SRC_DIR}/include/) +target_include_directories(osmanip PUBLIC include/) target_compile_features(osmanip PUBLIC cxx_std_17) set_target_properties(osmanip PROPERTIES PUBLIC_HEADER "${osmanip_inc}" @@ -49,6 +55,6 @@ install( ) install( - DIRECTORY ${OSMANIP_SRC_DIR}/include/ + DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/osmanip ) diff --git a/recipes/osmanip/all/conandata.yml b/recipes/osmanip/all/conandata.yml index 02c907a3fa56b..fd06c3edca398 100644 --- a/recipes/osmanip/all/conandata.yml +++ b/recipes/osmanip/all/conandata.yml @@ -1,25 +1,13 @@ sources: + "4.6.1": + url: "https://github.com/JustWhit3/osmanip/archive/v4.6.1.tar.gz" + sha256: "5454cb0caced1fb9af90666001f2874786a33e6830024cb41c99a5b4ab966f1c" "4.4.0": - url: "https://github.com/JustWhit3/osmanip/archive/v4.3.0.tar.gz" - sha256: "e0d982d19792c3e438e3be99f789434b66788f9a7114f217b3c5f28d0121af7f" + url: "https://github.com/JustWhit3/osmanip/archive/v4.4.0.tar.gz" + sha256: "61c08255afe4fa8694771ed139d9d8a4d5edfba56ffbd25997019a41f6923314" "4.3.0": url: "https://github.com/JustWhit3/osmanip/archive/v4.3.0.tar.gz" sha256: "e0d982d19792c3e438e3be99f789434b66788f9a7114f217b3c5f28d0121af7f" "4.2.2": url: "https://github.com/JustWhit3/osmanip/archive/v4.2.2.tar.gz" sha256: "841b76bb4f44b66d714858e62661cee75c4fef553300b6da2a6720509421a5fe" - "4.2.1": - url: "https://github.com/JustWhit3/osmanip/archive/refs/tags/v4.2.1.tar.gz" - sha256: "1d1ba3fac66edc7a7e4c480a0c080493d19193f9b63b70d417e2683f8741bf1c" - "4.1.0": - url: "https://github.com/JustWhit3/osmanip/archive/refs/tags/v4.1.0.tar.gz" - sha256: "9830316fea29300aeebadb0cd6cddd6f291a8fa04c397bca9666d045815d1d53" - "4.0.0": - url: "https://github.com/JustWhit3/osmanip/archive/refs/tags/v4.0.0.tar.gz" - sha256: "c6848e1d9b15eb409af88efeee7cd1ce87374ea7ac87424f5d2cf30104f098a0" - -patches: - "4.0.0": - - patch_file: "patches/0001-replace-runtime_error_func.patch" - patch_description: "following function renaming on arsenalgear/1.2.2" - patch_type: "conan" diff --git a/recipes/osmanip/all/conanfile.py b/recipes/osmanip/all/conanfile.py index ccea62899d710..dfd876744d966 100644 --- a/recipes/osmanip/all/conanfile.py +++ b/recipes/osmanip/all/conanfile.py @@ -1,9 +1,10 @@ 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.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, replace_in_file, save +from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc import os @@ -11,11 +12,15 @@ class OsmanipConan(ConanFile): name = "osmanip" - description = "Library with useful output stream tools like: color and style manipulators, progress bars and terminal graphics." + description = ( + "Library with useful output stream tools like: color and style " + "manipulators, progress bars and terminal graphics." + ) license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/JustWhit3/osmanip" topics = ("manipulator", "iostream", "output-stream", "iomanip") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -27,8 +32,8 @@ class OsmanipConan(ConanFile): } def export_sources(self): - copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) - export_conandata_patches(self) + if Version(self.version) < "4.5.0": + copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -38,64 +43,83 @@ 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.81.0") - if Version(self.version) < "4.2.0": - self.requires("arsenalgear/1.2.2") - else: - self.requires("arsenalgear/2.0.1") + # https://github.com/JustWhit3/osmanip/commit/43c8bd8d018fcb3bce6443f7388e042d5457d4fb + if Version(self.version) < "4.6.0": + # osmanip/progressbar/progress_bar.hpp includes arsenalgear/constants.hpp + self.requires("arsenalgear/2.1.1", transitive_headers=True) @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 17 @property def _compiler_required_cpp17(self): return { - "Visual Studio": "16", + "Visual Studio": "15", "msvc": "191", "gcc": "8", "clang": "7", - "apple-clang": "12.0", + "apple-clang": "12", } def validate(self): - if self.info.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) + if self.settings.get_safe("compiler.cppstd"): + check_min_cppstd(self, self._min_cppstd) - minimum_version = self._compiler_required_cpp17.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._minimum_cpp_standard}, which your compiler does not 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._compiler_required_cpp17.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): - cmake_layout(self, src_folder="src") + if Version(self.version) >= "4.4.0" and self.settings.get_safe("compiler.libcxx") == "libstdc++": + # test_package segfaults with libstdc++ for some reason + raise ConanInvalidConfiguration("osmanip >= 4.4.0 doesn't support libstdc++") + + if is_msvc(self): + raise ConanInvalidConfiguration("MSVC is not yet supported by osmanip recipe. Contributions are welcome.") def source(self): - get(self, **self.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["OSMANIP_VERSION"] = str(self.version) - tc.variables["OSMANIP_SRC_DIR"] = self.source_folder.replace("\\", "/") + if Version(self.version) < "4.5.0": + tc.variables["OSMANIP_VERSION"] = str(self.version) + else: + tc.variables["OSMANIP_TESTS"] = False + tc.variables["FORMAT"] = False + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() deps = CMakeDeps(self) deps.generate() + def _patch_sources(self): + if Version(self.version) >= "4.5.0": + 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"), + " DESTINATION lib\n", + " RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib\n") + save(self, os.path.join(self.source_folder, "examples", "CMakeLists.txt"), "") + save(self, os.path.join(self.source_folder, "deps", "doctest", "CMakeLists.txt"), "") + def build(self): - apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) - cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + 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 = ["osmanip"] diff --git a/recipes/osmanip/all/patches/0001-replace-runtime_error_func.patch b/recipes/osmanip/all/patches/0001-replace-runtime_error_func.patch deleted file mode 100644 index 8b8b155a0e865..0000000000000 --- a/recipes/osmanip/all/patches/0001-replace-runtime_error_func.patch +++ /dev/null @@ -1,102 +0,0 @@ -diff --git a/src/manipulators/csmanip.cpp b/src/manipulators/csmanip.cpp -index 064c7ba..6363226 100644 ---- a/src/manipulators/csmanip.cpp -+++ b/src/manipulators/csmanip.cpp -@@ -208,7 +208,7 @@ namespace osm - { - if( generic_map.find( feat_string ) == generic_map.end() ) - { -- throw agr::runtime_error_func( generic_map.at( "error" ), feat_string, "is not supported!" ); -+ throw agr::except_error_func( generic_map.at( "error" ), feat_string, "is not supported!" ); - } - return generic_map.at( feat_string ); - } -@@ -228,7 +228,7 @@ namespace osm - { - if( generic_map.find( feat_string ) == generic_map.end() ) - { -- throw agr::runtime_error_func( generic_map.at( "error" ).first, feat_string, "is not supported!" ); -+ throw agr::except_error_func( generic_map.at( "error" ).first, feat_string, "is not supported!" ); - } - else - { -@@ -255,7 +255,7 @@ namespace osm - { - if( rst.find( reset_string ) == rst.end() ) - { -- throw agr::runtime_error_func( rst.at( "error" ), reset_string, "is not supported!" ); -+ throw agr::except_error_func( rst.at( "error" ), reset_string, "is not supported!" ); - } - return rst.at( reset_string ); - } -@@ -295,4 +295,4 @@ namespace osm - std::to_string( g ) + ";"s + - std::to_string( b ) + "m"s; - } -- } -\ No newline at end of file -+ } -diff --git a/src/progressbar/progress_bar.cpp b/src/progressbar/progress_bar.cpp -index 485009f..b12aee4 100644 ---- a/src/progressbar/progress_bar.cpp -+++ b/src/progressbar/progress_bar.cpp -@@ -163,16 +163,16 @@ namespace osm - } - else if( styles_map_.at( type ).find( style ) == styles_map_.at( type ).end() ) - { -- throw agr::runtime_error_func( "Inserted ProgressBar style", style, "is not supported for this type!" ); -+ throw agr::except_error_func( "Inserted ProgressBar style", style, "is not supported for this type!" ); - } - else - { -- throw agr::runtime_error_func( "Inserted ProgressBar type", type, "is not supported!" ); -+ throw agr::except_error_func( "Inserted ProgressBar type", type, "is not supported!" ); - } - } - catch ( std::out_of_range const& exception ) - { -- throw agr::runtime_error_func( "Inserted ProgressBar type", type, "is not supported!" ); -+ throw agr::except_error_func( "Inserted ProgressBar type", type, "is not supported!" ); - } - } - -@@ -201,15 +201,15 @@ namespace osm - } - else if( styles_map_.at( "indicator" ).find( style_p ) == styles_map_.at( "indicator" ).end() ) - { -- throw agr::runtime_error_func( "Inserted indicator style", style_p, "is not supported for this type!" ); -+ throw agr::except_error_func( "Inserted indicator style", style_p, "is not supported for this type!" ); - } - else if( styles_map_.at( "loader" ).find( style_l ) == styles_map_.at( "loader" ).end() ) - { -- throw agr::runtime_error_func( "Inserted loader style", style_l, "is not supported for this type!" ); -+ throw agr::except_error_func( "Inserted loader style", style_l, "is not supported for this type!" ); - } - else - { -- throw agr::runtime_error_func( "Inserted ProgressBar type", type, "is not supported!" ); -+ throw agr::except_error_func( "Inserted ProgressBar type", type, "is not supported!" ); - } - } - -@@ -834,11 +834,11 @@ namespace osm - } - else if( styles_map_.at( type ).find( style ) != styles_map_.at( type ).end() ) - { -- throw agr::runtime_error_func( "Inserted ProgressBar style", style, "is already available!" ); -+ throw agr::except_error_func( "Inserted ProgressBar style", style, "is already available!" ); - } - else - { -- throw agr::runtime_error_func( "Inserted ProgressBar type", type, "is already available!" ); -+ throw agr::except_error_func( "Inserted ProgressBar type", type, "is already available!" ); - } - } - -@@ -869,4 +869,4 @@ namespace osm - * - */ - BOOST_PP_SEQ_FOR_EACH( PROGRESSBAR, _, ARGS( int, long, long long, double, long double, float ) ); -- } -\ No newline at end of file -+ } diff --git a/recipes/osmanip/all/test_package/CMakeLists.txt b/recipes/osmanip/all/test_package/CMakeLists.txt index 02a74d2349c2e..b4f7ae24e65ef 100644 --- a/recipes/osmanip/all/test_package/CMakeLists.txt +++ b/recipes/osmanip/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) diff --git a/recipes/osmanip/all/test_package/test_package.cpp b/recipes/osmanip/all/test_package/test_package.cpp index 40b8aeea9e04b..fd39db19a8533 100644 --- a/recipes/osmanip/all/test_package/test_package.cpp +++ b/recipes/osmanip/all/test_package/test_package.cpp @@ -2,7 +2,6 @@ // https://github.com/JustWhit3/osmanip/blob/v4.0.0/examples/progressbar.cpp // My headers -#include "osmanip/progressbar/multi_progress_bar.hpp" #include "osmanip/progressbar/progress_bar.hpp" #ifdef _WIN32 #include "osmanip/utility/windows.hpp" @@ -14,9 +13,7 @@ #endif // STD headers -#include #include -#include //==================================================== // Percentage bar @@ -40,56 +37,10 @@ perc_bars() { std::cout << "This is a normal percentage bar: " << "\n"; for (int i = percentage_bar.getMin(); i < percentage_bar.getMax(); i++) { - std::this_thread::sleep_for(std::chrono::milliseconds(1)); percentage_bar.update(i); // Do some operations... } std::cout << "\n\n"; - - // Percentage bar with message and different style: - osm::ProgressBar percentage_bar_2(1.2f, 4.4f); - percentage_bar_2.setMessage("processing..."); - percentage_bar_2.setStyle("indicator", "/100"); - - std::cout << "This is a percentage bar with message and the /100 style: " - << "\n"; - for (float i = percentage_bar_2.getMin(); i < percentage_bar_2.getMax(); i += 0.1f) { - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - percentage_bar_2.update(i); - // Do some operations... - } - std::cout << "\n\n"; - - // Percentage bar with time consuming info: - percentage_bar.resetMessage(); - percentage_bar.setStyle("indicator", "%"); - - std::cout << "This is a percentage bar with time consuming info: " - << "\n"; - for (int i = percentage_bar.getMin(); i < percentage_bar.getMax(); i++) { - percentage_bar.setBegin(); - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - percentage_bar.update(i); - // Do some operations... - percentage_bar.setEnd(); - } - std::cout << "\n" - << "Time needed to complete the previous loop: " << percentage_bar.getTime() << " ms." - << "\n\n"; - - // Percentage bar with estimated time left: - percentage_bar.setMin(2); - percentage_bar.setMax(121); - percentage_bar.setRemainingTimeFlag("on"); - percentage_bar.resetRemainingTime(); - - std::cout << "This is a percentage bar with time-remaining info: " - << "\n"; - for (int i = percentage_bar.getMin(); i < percentage_bar.getMax(); i++) { - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - percentage_bar.update(i); - // Do some operations... - } std::cout << "\n\n"; } diff --git a/recipes/osmanip/all/test_v1_package/CMakeLists.txt b/recipes/osmanip/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 426dbc1aa18df..0000000000000 --- a/recipes/osmanip/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -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/osmanip/all/test_v1_package/conanfile.py b/recipes/osmanip/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/osmanip/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/osmanip/config.yml b/recipes/osmanip/config.yml index 50f7633ad31f3..2b2e483c60d7b 100644 --- a/recipes/osmanip/config.yml +++ b/recipes/osmanip/config.yml @@ -1,13 +1,9 @@ versions: + "4.6.1": + folder: all "4.4.0": folder: all "4.3.0": folder: all "4.2.2": folder: all - "4.2.1": - folder: all - "4.1.0": - folder: all - "4.0.0": - folder: all diff --git a/recipes/osqp/all/conandata.yml b/recipes/osqp/all/conandata.yml index 905d89304cb35..fa2a0f2f4400c 100644 --- a/recipes/osqp/all/conandata.yml +++ b/recipes/osqp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6.3": + url: "https://github.com/osqp/osqp/releases/download/v0.6.3/osqp-v0.6.3-src.tar.gz" + sha256: "285b2a60f68d113a1090767ec8a9c81a65b3af2d258f8c78a31cc3f98ba58456" "0.6.2": url: "https://github.com/osqp/osqp/releases/download/v0.6.2/complete_sources.tar.gz" sha256: "0a7ade2fa19f13e13bc12f6ea0046ef764049023efb4997a4e72a76534f623ec" diff --git a/recipes/osqp/all/conanfile.py b/recipes/osqp/all/conanfile.py index 19c7954ec0859..2aff16badac04 100644 --- a/recipes/osqp/all/conanfile.py +++ b/recipes/osqp/all/conanfile.py @@ -19,7 +19,7 @@ class OsqpConan(ConanFile): "shared": [True, False], "fPIC": [True, False], } - default_options = { + default_options = { "shared": False, "fPIC": True, } @@ -38,7 +38,8 @@ def layout(self): cmake_layout(self, src_folder="src") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + strip_root = self.version == "0.6.2" + get(self, **self.conan_data["sources"][self.version], strip_root=strip_root) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/osqp/config.yml b/recipes/osqp/config.yml index a09c617182ab2..5adc30b2f3c24 100644 --- a/recipes/osqp/config.yml +++ b/recipes/osqp/config.yml @@ -1,3 +1,5 @@ versions: + "0.6.3": + folder: all "0.6.2": folder: all diff --git a/recipes/ouster_sdk/all/conandata.yml b/recipes/ouster_sdk/all/conandata.yml new file mode 100644 index 0000000000000..47f1fc2c3a180 --- /dev/null +++ b/recipes/ouster_sdk/all/conandata.yml @@ -0,0 +1,24 @@ +sources: + "0.13.0": + url: "https://github.com/ouster-lidar/ouster-sdk/archive/refs/tags/release-0.13.0.tar.gz" + sha256: "baf65fbf547375fe73fdaee89c6c1246fdf9f0cabe4f4bd16391d3a06d0117a1" + "0.12.0": + url: "https://github.com/ouster-lidar/ouster-sdk/archive/refs/tags/20240703.tar.gz" + sha256: "7edff33451e99fe094aeafc4c10081d77bfe02d2f2ab16da93a44a5e61473af7" + "0.11.0": + url: "https://github.com/ouster-lidar/ouster-sdk/archive/refs/tags/20240425.tar.gz" + sha256: "8141abf4caef8a175a48c35c47bd841b34f8a7d758cb3ad66cf948a7042adbf9" + "0.10.0": + url: "https://github.com/ouster-lidar/ouster-sdk/archive/refs/tags/20231031.tar.gz" + sha256: "c45dfd42ff11e171b605ffd0a98d8094ec88ecbbccb923d396e1e73cba7737f3" +patches: + "0.11.0": + - patch_file: "patches/001-579-fix-cpp20-string-error.patch" + patch_type: "portability" + patch_description: "Fix non-const string issue with C++20" + patch_source: "https://github.com/ouster-lidar/ouster-sdk/pull/579" + "0.10.0": + - patch_file: "patches/001-579-fix-cpp20-string-error.patch" + patch_type: "portability" + patch_description: "Fix non-const string issue with C++20" + patch_source: "https://github.com/ouster-lidar/ouster-sdk/pull/579" diff --git a/recipes/ouster_sdk/all/conanfile.py b/recipes/ouster_sdk/all/conanfile.py new file mode 100644 index 0000000000000..7362559ac775c --- /dev/null +++ b/recipes/ouster_sdk/all/conanfile.py @@ -0,0 +1,219 @@ +import os + +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, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import get, copy, rmdir, rm, save, replace_in_file, export_conandata_patches, apply_conandata_patches +from conan.tools.scm import Version + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.6" + +class OusterSdkConan(ConanFile): + name = "ouster_sdk" + description = "Ouster SDK - tools for working with Ouster Lidars" + license = "BSD 3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ouster-lidar/ouster-sdk" + topics = ("ouster", "lidar", "driver", "hardware", "point cloud", "3d", "robotics", "automotive") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_osf": [True, False], + "build_pcap": [True, False], + "build_viz": [True, False], + "eigen_max_align_bytes": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "build_osf": True, + "build_pcap": True, + "build_viz": False, + "eigen_max_align_bytes": False, + } + options_description = { + "build_osf": "Build Ouster OSF library.", + "build_pcap": "Build pcap utils.", + "build_viz": "Build Ouster visualizer.", + "eigen_max_align_bytes": "Force maximum alignment of Eigen data to 32 bytes.", + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "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 + if conan_version.major == 1: + # Turning off by default due to perpetually missing libtins binaries on CCI + self.options.build_pcap = False + self.options.build_osf = False + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # Used in ouster/types.h + self.requires("eigen/3.4.0", transitive_headers=True) + # Used in ouster/sensor_http.h + self.requires("jsoncpp/1.9.5", transitive_headers=True, transitive_libs=True) + self.requires("spdlog/1.13.0") + self.requires("fmt/10.2.1") + self.requires("libcurl/[>=7.78 <9]") + # Replaces vendored optional-lite + self.requires("optional-lite/3.6.0", transitive_headers=True) + + if self.options.build_pcap: + self.requires("libtins/4.5") + + if self.options.build_osf: + # Used in fb_generated/*.h + self.requires("flatbuffers/24.3.7", transitive_headers=True) + self.requires("libpng/[>=1.6 <2]") + self.requires("zlib/[>=1.2.11 <2]", transitive_libs=True) + + if self.options.build_viz: + self.requires("glad/0.1.36") + self.requires("glfw/3.4") + + def validate(self): + if conan_version.major < 2 and self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows builds require Conan >= 2.0") + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + 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." + ) + + if self.options.build_osf and not self.options.build_pcap: + raise ConanInvalidConfiguration("build_osf=True requires build_pcap=True") + + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration("Shared builds are not supported on Windows") + + def build_requirements(self): + if self.options.build_osf: + self.tool_requires("flatbuffers/") + + 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["BUILD_VIZ"] = self.options.build_viz + tc.variables["BUILD_PCAP"] = self.options.build_pcap + tc.variables["BUILD_OSF"] = self.options.build_osf + tc.variables["OUSTER_USE_EIGEN_MAX_ALIGN_BYTES_32"] = self.options.eigen_max_align_bytes + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.set_property("flatbuffers", "cmake_target_name", "flatbuffers::flatbuffers") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + # Unvendor optional-lite + rmdir(self, os.path.join(self.source_folder, "ouster_client", "include", "optional-lite")) + replace_in_file(self, os.path.join(self.source_folder, "ouster_client", "CMakeLists.txt"), + " include/optional-lite", "") + save(self, os.path.join(self.source_folder, "ouster_client", "CMakeLists.txt"), + "find_package(optional-lite REQUIRED)\n" + "target_link_libraries(ouster_client PUBLIC nonstd::optional-lite)\n", + append=True) + + # Allow non-static ouster_osf for consistency with other components + replace_in_file(self, os.path.join(self.source_folder, "ouster_osf", "CMakeLists.txt"), + "add_library(ouster_osf STATIC", "add_library(ouster_osf") + + def build(self): + self._patch_sources() + 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", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "OusterSDK") + self.cpp_info.set_property("cmake_target_name", "OusterSDK::OusterSDK") + + self.cpp_info.components["ouster_client"].set_property("cmake_target_name", "OusterSDK::ouster_client") + self.cpp_info.components["ouster_client"].libs = ["ouster_client"] + self.cpp_info.components["ouster_client"].requires = [ + "eigen::eigen", + "jsoncpp::jsoncpp", + "spdlog::spdlog", + "fmt::fmt", + "libcurl::libcurl", + "optional-lite::optional-lite", + ] + + if self.options.build_osf: + self.cpp_info.components["ouster_osf"].set_property("cmake_target_name", "OusterSDK::ouster_osf") + self.cpp_info.components["ouster_osf"].libs = ["ouster_osf"] + self.cpp_info.components["ouster_osf"].includedirs.append(os.path.join("include", "fb_generated")) + self.cpp_info.components["ouster_osf"].requires = [ + "ouster_client", + "ouster_pcap", + "flatbuffers::flatbuffers", + "libpng::libpng", + "zlib::zlib", + ] + + if self.options.build_pcap: + self.cpp_info.components["ouster_pcap"].set_property("cmake_target_name", "OusterSDK::ouster_pcap") + self.cpp_info.components["ouster_pcap"].libs = ["ouster_pcap"] + self.cpp_info.components["ouster_pcap"].requires = [ + "ouster_client", + "libtins::libtins", + ] + + if self.options.build_viz: + self.cpp_info.components["ouster_viz"].set_property("cmake_target_name", "OusterSDK::ouster_viz") + self.cpp_info.components["ouster_viz"].libs = ["ouster_viz"] + self.cpp_info.components["ouster_viz"].requires = [ + "ouster_client", + "glad::glad", + "glfw::glfw", + ] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.filenames["cmake_find_package"] = "OusterSDK" + self.cpp_info.filenames["cmake_find_package_multi"] = "OusterSDK" + self.cpp_info.names["cmake_find_package"] = "OusterSDK" + self.cpp_info.names["cmake_find_package_multi"] = "OusterSDK" + diff --git a/recipes/ouster_sdk/all/patches/001-579-fix-cpp20-string-error.patch b/recipes/ouster_sdk/all/patches/001-579-fix-cpp20-string-error.patch new file mode 100644 index 0000000000000..aa80f65d67d9c --- /dev/null +++ b/recipes/ouster_sdk/all/patches/001-579-fix-cpp20-string-error.patch @@ -0,0 +1,25 @@ +From b2896dee6f43733c832c3a60f09f362abe2c5e79 Mon Sep 17 00:00:00 2001 +From: Kevin Greene +Date: Fri, 23 Feb 2024 10:22:02 -0800 +Subject: [PATCH] Fix non-const string issue with C++20 + +--- + ouster_client/src/curl_client.h | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/ouster_client/src/curl_client.h b/ouster_client/src/curl_client.h +index ce3fb31d..62bcabc0 100644 +--- a/ouster_client/src/curl_client.h ++++ b/ouster_client/src/curl_client.h +@@ -89,9 +89,8 @@ class CurlClient : public ouster::util::HttpClient { + // HTTP 5XX means a server error, so we should re-attempt. + // log a warning and sleep before re-attempting + ouster::sensor::logger().warn( +- std::string("Re-attempting CurlClient::execute_get after " +- "failure for url: ") + +- "[{}] with the code: [{}] - and return: {}", ++ "Re-attempting CurlClient::execute_get after failure for " ++ "url: [{}] with the code: [{}] - and return: {}", + url, http_code, buffer); + std::this_thread::sleep_for( + std::chrono::milliseconds(retry_delay_ms)); diff --git a/recipes/ouster_sdk/all/test_package/CMakeLists.txt b/recipes/ouster_sdk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..498c697a4f010 --- /dev/null +++ b/recipes/ouster_sdk/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) + project(test_package CXX) + +find_package(OusterSDK REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE OusterSDK::OusterSDK) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/ouster_sdk/all/test_package/conanfile.py b/recipes/ouster_sdk/all/test_package/conanfile.py new file mode 100644 index 0000000000000..57c251706a8d6 --- /dev/null +++ b/recipes/ouster_sdk/all/test_package/conanfile.py @@ -0,0 +1,36 @@ +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 self.dependencies["ouster_sdk"].options.build_osf: + tc.preprocessor_definitions["WITH_OSF"] = "1" + if self.dependencies["ouster_sdk"].options.build_pcap: + tc.preprocessor_definitions["WITH_PCAP"] = "1" + if self.dependencies["ouster_sdk"].options.build_viz: + tc.preprocessor_definitions["WITH_VIZ"] = "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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ouster_sdk/all/test_package/test_package.cpp b/recipes/ouster_sdk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3190406572ca4 --- /dev/null +++ b/recipes/ouster_sdk/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include "ouster/lidar_scan.h" + +#ifdef WITH_OSF +#include "ouster/osf/writer.h" +#endif +#ifdef WITH_PCAP +#include "ouster/os_pcap.h" +#endif +#ifdef WITH_VIZ +#include "ouster/point_viz.h" +#endif + +#include + +int main() { + size_t w = 100; + size_t h = 100; + using namespace ouster::sensor; + ouster::LidarScan scan(w, h, UDPProfileLidar::PROFILE_RNG19_RFL8_SIG16_NIR16_DUAL); + std::cout << "Successfully created a sensor::LidarScan object" << std::endl; + +#ifdef WITH_OSF + ouster::osf::Writer writer("tmp.osf"); + std::cout << "Successfully created a osf::Writer object" << std::endl; +#endif + +#ifdef WITH_PCAP + try { + ouster::sensor_utils::PcapReader pcap_reader("tmp.pcap"); + } catch (...) { } + std::cout << "Successfully created a sensor_utils::PcapReader object" << std::endl; +#endif + +#ifdef WITH_VIZ + ouster::viz::PointViz viz("Viz example"); + std::cout << "Successfully created a viz::PointViz object" << std::endl; +#endif +} diff --git a/recipes/ouster_sdk/config.yml b/recipes/ouster_sdk/config.yml new file mode 100644 index 0000000000000..4f1ab3799faec --- /dev/null +++ b/recipes/ouster_sdk/config.yml @@ -0,0 +1,9 @@ +versions: + "0.13.0": + folder: all + "0.12.0": + folder: all + "0.11.0": + folder: all + "0.10.0": + folder: all diff --git a/recipes/out_ptr/all/test_package/CMakeLists.txt b/recipes/out_ptr/all/test_package/CMakeLists.txt index 5198790e5ad46..a184cdbc06627 100644 --- a/recipes/out_ptr/all/test_package/CMakeLists.txt +++ b/recipes/out_ptr/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(out_ptr CONFIG REQUIRED) diff --git a/recipes/out_ptr/all/test_v1_package/CMakeLists.txt b/recipes/out_ptr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/out_ptr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/out_ptr/all/test_v1_package/conanfile.py b/recipes/out_ptr/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/out_ptr/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_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/outcome/all/conandata.yml b/recipes/outcome/all/conandata.yml index 68135018bb900..0b6baa08be3b1 100644 --- a/recipes/outcome/all/conandata.yml +++ b/recipes/outcome/all/conandata.yml @@ -1,28 +1,16 @@ sources: + "2.2.9": + url: "https://github.com/ned14/outcome/archive/v2.2.9.tar.gz" + sha256: "2840e403b1d7a0d3a75ecc4df574ab0674284bb21d76ac5f817695f2b56905f2" + "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.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.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/all/conanfile.py b/recipes/outcome/all/conanfile.py index 910063cd4cd17..f1c9aa2601b2d 100644 --- a/recipes/outcome/all/conanfile.py +++ b/recipes/outcome/all/conanfile.py @@ -12,11 +12,11 @@ class OutcomeConan(ConanFile): name = "outcome" - homepage = "https://github.com/ned14/outcome" description = "Provides very lightweight outcome and result" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" - topics = ("result",) + homepage = "https://github.com/ned14/outcome" + topics = ("result", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/outcome/config.yml b/recipes/outcome/config.yml index 08abb1cf7e40b..df84211e55ceb 100644 --- a/recipes/outcome/config.yml +++ b/recipes/outcome/config.yml @@ -1,19 +1,11 @@ versions: - "2.2.7": - folder: all - "2.2.4": - folder: all - "2.2.3": + "2.2.9": folder: all - "2.2.2": + "2.2.8": folder: all - "2.2.1": + "2.2.7": 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/test_package/CMakeLists.txt b/recipes/ozz-animation/all/test_package/CMakeLists.txt index 0c1c8ada3a5be..91fb140718df9 100644 --- a/recipes/ozz-animation/all/test_package/CMakeLists.txt +++ b/recipes/ozz-animation/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(ozz-animation REQUIRED CONFIG) diff --git a/recipes/p-ranav-glob/all/test_v1_package/CMakeLists.txt b/recipes/p-ranav-glob/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/p-ranav-glob/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6c9d5dba712c7..0000000000000 --- a/recipes/p-ranav-glob/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/p7zip/all/conanfile.py b/recipes/p7zip/all/conanfile.py index 0923c8b9413a3..c92b9abd32ef7 100644 --- a/recipes/p7zip/all/conanfile.py +++ b/recipes/p7zip/all/conanfile.py @@ -18,6 +18,7 @@ class PSevenZipConan(ConanFile): homepage = "https://sourceforge.net/projects/p7zip/" topics = ("7zip", "zip", "compression", "decompression") settings = "os", "arch", "compiler", "build_type" + package_type = "application" def export_sources(self): export_conandata_patches(self) diff --git a/recipes/p7zip/all/test_package/conanfile.py b/recipes/p7zip/all/test_package/conanfile.py index 45e5a32aba828..439215ce47919 100644 --- a/recipes/p7zip/all/test_package/conanfile.py +++ b/recipes/p7zip/all/test_package/conanfile.py @@ -1,15 +1,16 @@ +import os.path + 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 build_requirements(self): - self.tool_requires(self.tested_reference_str) + def requirements(self): + self.requires(self.tested_reference_str) def test(self): + assert os.path.exists(os.path.join(self.dependencies[self.tested_reference_str].cpp_info.bindir, "7za")) if can_run(self): self.run("7za", env="conanrun") diff --git a/recipes/p7zip/all/test_v1_package/conanfile.py b/recipes/p7zip/all/test_v1_package/conanfile.py deleted file mode 100644 index 58d9c6f21e0ce..0000000000000 --- a/recipes/p7zip/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,9 +0,0 @@ -from conans import ConanFile, tools - - -class TestPackageV1Conan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - if not tools.cross_building(self): - self.run("7za", run_environment=True) diff --git a/recipes/packio/all/conandata.yml b/recipes/packio/all/conandata.yml index 883472bb39dd2..bee8e441d4f05 100644 --- a/recipes/packio/all/conandata.yml +++ b/recipes/packio/all/conandata.yml @@ -1,46 +1,10 @@ sources: - 1.0.1: - sha256: 873ebd2ce8c8dbf8a4e7b777b1aa735fe4da3863131a5d6c938e339ee7e0a4d1 - url: https://github.com/qchateau/packio/archive/1.0.1.tar.gz - 1.0.2: - sha256: 040389f2de4a6da5df1cc323cdd80bc21bfc6a7f9bb9e56090d1ea0b1260226d - url: https://github.com/qchateau/packio/archive/1.0.2.tar.gz - 1.1.0: - sha256: fb8baeeb903335b71b4241433faaff895e42e671da1c15b100e24b060f1d3784 - url: https://github.com/qchateau/packio/archive/1.1.0.tar.gz - 1.1.1: - sha256: 5f77bcbb843cc7dd7731c37db586e9e4f3997ebf04a8d1eccb9eae21841c7e55 - url: https://github.com/qchateau/packio/archive/1.1.1.tar.gz - 1.2.0: - sha256: b459c50a2ae7b90b45cd99a727dcd133e48602634571378491533148e642c511 - url: https://github.com/qchateau/packio/archive/1.2.0.tar.gz - 1.2.1: - sha256: 1b3f1654e8321148dd58172fcc6807451382dff30bb803967449a318b33101c5 - url: https://github.com/qchateau/packio/archive/1.2.1.tar.gz - 1.3.0: - sha256: adb723ef14b4a3ec41e9a7c17c48c8ee58712604b678b24f44e6a8aa471f18e5 - url: https://github.com/qchateau/packio/archive/1.3.0.tar.gz - 2.0.0: - sha256: b647b3088830c127a1d5d475a95476cc00c81675244cf7d17c9ca1f12e88740e - url: https://github.com/qchateau/packio/archive/2.0.0.tar.gz - 2.0.1: - sha256: 081d378be922262c39218e115eabdf77f257e4773928011dff95795b8146b520 - url: https://github.com/qchateau/packio/archive/2.0.1.tar.gz - 2.1.0: - sha256: d13be083cd5a133b02fdd1da0d89fb75988c16109ccdcd631d53f9ca2457ad42 - url: https://github.com/qchateau/packio/archive/2.1.0.tar.gz - "2.2.0": - url: "https://github.com/qchateau/packio/archive/2.2.0.tar.gz" - sha256: "ac9f33d5e8dd92bd3cdec106e10453424060bae9c4cd97281aa5d20fb20476f7" - "2.3.0": - url: "https://github.com/qchateau/packio/archive/2.3.0.tar.gz" - sha256: "4ef3bc76934855cc1a17eb00311bb42f5f14f616c75d4d1cc35151efcc988358" - "2.4.0": - url: "https://github.com/qchateau/packio/archive/2.4.0.tar.gz" - sha256: "2815d7772ef8d2360c5e15de7738ec7267e1e54a7afb817bf42a18a9f100ff52" - "2.4.1": - url: "https://github.com/qchateau/packio/archive/2.4.1.tar.gz" - sha256: "c115548146d6da432048265037b30f77ba6ad7a39350693c4fb36fd896bc7a4b" + "2.6.0": + url: "https://github.com/qchateau/packio/archive/2.6.0.tar.gz" + sha256: "7cfbb51f2be0fbade2552ee32069d3a717ce6f5868d978a53532d0437679a375" "2.5.0": url: "https://github.com/qchateau/packio/archive/2.5.0.tar.gz" sha256: "5aa29313ac37be2fb66ff01af9413d9f9931cd4566f1400b00fac107552558ae" + "2.4.1": + url: "https://github.com/qchateau/packio/archive/2.4.1.tar.gz" + sha256: "c115548146d6da432048265037b30f77ba6ad7a39350693c4fb36fd896bc7a4b" diff --git a/recipes/packio/all/conanfile.py b/recipes/packio/all/conanfile.py index 1b6fc91c9312b..6a04e7e653b02 100644 --- a/recipes/packio/all/conanfile.py +++ b/recipes/packio/all/conanfile.py @@ -1,8 +1,7 @@ import os from conan import ConanFile -from conan.tools import files, scm, build -from conan.errors import ConanInvalidConfiguration - +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get class PackioConan(ConanFile): name = "packio" @@ -12,96 +11,54 @@ class PackioConan(ConanFile): description = "An asynchronous msgpack-RPC and JSON-RPC library built on top of Boost.Asio." topics = ("rpc", "msgpack", "json", "asio", "async", "cpp17", "cpp20", "coroutines") settings = "compiler" + package_type = "header-library" no_copy_source = True options = { "standalone_asio": [True, False], "msgpack": [True, False], "nlohmann_json": [True, False], - "boost_json": [True, False, "default"], + "boost_json": [True, False], } default_options = { "standalone_asio": False, "msgpack": True, "nlohmann_json": True, - "boost_json": "default", + # boost_json no default value for boost_json, if not defined, derive from standalone_asio } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _compilers_minimum_version(self): - if scm.Version(self.version) < "2.4.0": - return { - "apple-clang": 10, - "clang": 6, - "gcc": 7, - "Visual Studio": 16, - } - return { - "apple-clang": 13, - "clang": 11, - "gcc": 9, - "Visual Studio": 16, - } - - def config_options(self): - if scm.Version(self.version) < "1.2.0": - del self.options.standalone_asio - if scm.Version(self.version) < "2.0.0": - del self.options.msgpack - del self.options.nlohmann_json - if scm.Version(self.version) < "2.1.0": - del self.options.boost_json + def configure(self): + # defaults to True if using boost.asio, False if using asio + if self.options.get_safe("boost_json") is None: + self.options.boost_json = not self.options.get_safe("standalone_asio", False) def requirements(self): - if self.options.get_safe("msgpack") or scm.Version(self.version) < "2.0.0": - self.requires("msgpack/3.2.1") + if self.options.get_safe("msgpack"): + self.requires("msgpack-cxx/7.0.0") if self.options.get_safe("nlohmann_json"): self.requires("nlohmann_json/3.9.1") - # defaults to True if using boost.asio, False if using asio - if self.options.get_safe("boost_json") == "default": - self.options.boost_json = not self.options.standalone_asio - if self.options.get_safe("boost_json") or not self.options.get_safe("standalone_asio"): - self.requires("boost/1.75.0") + self.requires("boost/1.83.0") if self.options.get_safe("standalone_asio"): self.requires("asio/1.18.1") def source(self): - files.get(conanfile=self, **self.conan_data["sources"][self.version]) - extracted_dir = "packio-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def configure(self): - if self.settings.compiler.cppstd: - build.check_min_cppstd(self, "17") + get(self, **self.conan_data["sources"][self.version], strip_root=True) - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version: - if scm.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("packio requires C++17, which your compiler does not support.") - else: - self.output.warn("packio requires C++17. Your compiler is unknown. Assuming it supports C++17.") + def validate(self): + check_min_cppstd(self, "17") def package(self): - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE.md", 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")) def package_id(self): - self.info.header_only() + self.info.clear() def package_info(self): - if scm.Version(self.version) < "2.1.0": - if self.options.get_safe("standalone_asio"): - self.cpp_info.defines.append("PACKIO_STANDALONE_ASIO") - else: - # Starting from 2.1.0, preprocessor defines can be defined to 0 to force-disable - self.cpp_info.defines.append(f"PACKIO_STANDALONE_ASIO={1 if self.options.get_safe('standalone_asio') else 0}") - self.cpp_info.defines.append(f"PACKIO_HAS_MSGPACK={1 if self.options.get_safe('msgpack') else 0}") - self.cpp_info.defines.append(f"PACKIO_HAS_NLOHMANN_JSON={1 if self.options.get_safe('nlohmann_json') else 0}") - self.cpp_info.defines.append(f"PACKIO_HAS_BOOST_JSON={1 if self.options.get_safe('boost_json') else 0}") + self.cpp_info.defines.append(f"PACKIO_STANDALONE_ASIO={1 if self.options.get_safe('standalone_asio') else 0}") + self.cpp_info.defines.append(f"PACKIO_HAS_MSGPACK={1 if self.options.get_safe('msgpack') else 0}") + self.cpp_info.defines.append(f"PACKIO_HAS_NLOHMANN_JSON={1 if self.options.get_safe('nlohmann_json') else 0}") + self.cpp_info.defines.append(f"PACKIO_HAS_BOOST_JSON={1 if self.options.get_safe('boost_json') else 0}") diff --git a/recipes/packio/all/test_package/1.0.x-1.1.x.cpp b/recipes/packio/all/test_package/1.0.x-1.1.x.cpp deleted file mode 100644 index f4ef879ba2126..0000000000000 --- a/recipes/packio/all/test_package/1.0.x-1.1.x.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include // missing include in recent versions of MSVC - -#include - -namespace ip = boost::asio::ip; - -int main(int, char **) { - boost::asio::io_context io; - - ip::tcp::endpoint bind_ep{ip::make_address("127.0.0.1"), 0}; - auto server = - std::make_shared>(ip::tcp::acceptor{io, bind_ep}); - auto client = std::make_shared>(ip::tcp::socket{io}); - - return 0; -} diff --git a/recipes/packio/all/test_package/1.2.x.cpp b/recipes/packio/all/test_package/1.2.x.cpp deleted file mode 100644 index 4d1bd032ed004..0000000000000 --- a/recipes/packio/all/test_package/1.2.x.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include // missing include in recent versions of MSVC - -#include - -#if defined(PACKIO_STANDALONE_ASIO) -namespace net = ::asio; -#else // defined(PACKIO_STANDALONE_ASIO) -namespace net = ::boost::asio; -#endif // defined(PACKIO_STANDALONE_ASIO) - -int main(int, char **) { - net::io_context io; - - net::ip::tcp::endpoint bind_ep{net::ip::make_address("127.0.0.1"), 0}; - auto server = packio::make_server(net::ip::tcp::acceptor{io, bind_ep}); - auto client = packio::make_client(net::ip::tcp::socket{io}); - - return 0; -} diff --git a/recipes/packio/all/test_package/CMakeLists.txt b/recipes/packio/all/test_package/CMakeLists.txt index f7a1923821168..96538c8253e21 100644 --- a/recipes/packio/all/test_package/CMakeLists.txt +++ b/recipes/packio/all/test_package/CMakeLists.txt @@ -1,16 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(TestPackage CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(packio REQUIRED) -if (PACKIO_VERSION VERSION_LESS "1.2.0") - add_executable(main 1.0.x-1.1.x.cpp) -elseif (PACKIO_VERSION VERSION_LESS "2.0.0") - add_executable(main 1.2.x.cpp) -else () - add_executable(main latest.cpp) -endif () +add_executable(test_package test_package.cpp) -target_link_libraries(main ${CONAN_LIBS}) -set_property(TARGET main PROPERTY CXX_STANDARD 17) +target_link_libraries(test_package PRIVATE packio::packio) diff --git a/recipes/packio/all/test_package/conanfile.py b/recipes/packio/all/test_package/conanfile.py index aef41dfda73a3..ef5d7042163ec 100644 --- a/recipes/packio/all/test_package/conanfile.py +++ b/recipes/packio/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", "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): - packio_version = self.deps_cpp_info["packio"].version cmake = CMake(self) - cmake.configure(defs={"PACKIO_VERSION": packio_version}) + cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "main"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/packio/all/test_package/latest.cpp b/recipes/packio/all/test_package/latest.cpp deleted file mode 100644 index 381f2263eed02..0000000000000 --- a/recipes/packio/all/test_package/latest.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include // missing include in recent versions of MSVC - -#include - -namespace net = packio::net; - -int main(int, char **) { - net::io_context io; - - net::ip::tcp::endpoint bind_ep{net::ip::make_address("127.0.0.1"), 0}; - auto msgpack_server = - packio::msgpack_rpc::make_server(net::ip::tcp::acceptor{io, bind_ep}); - auto msgpack_client = - packio::msgpack_rpc::make_client(net::ip::tcp::socket{io}); - auto json_server = - packio::nl_json_rpc::make_server(net::ip::tcp::acceptor{io, bind_ep}); - auto json_client = packio::nl_json_rpc::make_client(net::ip::tcp::socket{io}); - - return 0; -} diff --git a/recipes/packio/all/test_package/test_package.cpp b/recipes/packio/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2ef379387d27c --- /dev/null +++ b/recipes/packio/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +#include + +int main(int, char **) { + auto io = packio::net::io_context(); + std::cout << "Test package successful\n"; + return 0; +} diff --git a/recipes/packio/config.yml b/recipes/packio/config.yml index 4e4071772582c..1a175264bfdcc 100644 --- a/recipes/packio/config.yml +++ b/recipes/packio/config.yml @@ -1,31 +1,7 @@ versions: - 1.0.1: + "2.6.0": folder: all - 1.0.2: - folder: all - 1.1.0: - folder: all - 1.1.1: - folder: all - 1.2.0: - folder: all - 1.2.1: - folder: all - 1.3.0: - folder: all - 2.0.0: - folder: all - 2.0.1: - folder: all - 2.1.0: - folder: all - "2.2.0": - folder: all - "2.3.0": - folder: all - "2.4.0": + "2.5.0": folder: all "2.4.1": folder: all - "2.5.0": - folder: all diff --git a/recipes/pagmo2/all/CMakeLists.txt b/recipes/pagmo2/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/pagmo2/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/pagmo2/all/conandata.yml b/recipes/pagmo2/all/conandata.yml index a610a9ffc5a7b..26d2bd85a3ccc 100644 --- a/recipes/pagmo2/all/conandata.yml +++ b/recipes/pagmo2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.19.0": + url: "https://github.com/esa/pagmo2/archive/refs/tags/v2.19.0.tar.gz" + sha256: "701ada528de7d454201e92a5d88903dd1c22ea64f43861d9694195ddfef82a70" "2.17.0": url: "https://github.com/esa/pagmo2/archive/refs/tags/v2.17.0.tar.gz" sha256: "1b95b036f75e6fa0b21082ab228dbd63cd18ca10d9622ac53629245e0f95c35c" diff --git a/recipes/pagmo2/all/conanfile.py b/recipes/pagmo2/all/conanfile.py index 08b268962bb1c..b0c859b99c54f 100644 --- a/recipes/pagmo2/all/conanfile.py +++ b/recipes/pagmo2/all/conanfile.py @@ -1,19 +1,25 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -import functools 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.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class Pagmo2Conan(ConanFile): name = "pagmo2" description = "pagmo is a C++ scientific library for massively parallel optimization." license = ("LGPL-3.0-or-later", "GPL-3.0-or-later") - topics = ("pagmo", "optimization", "parallel-computing", "genetic-algorithm", "metaheuristics") - homepage = "https://esa.github.io/pagmo2" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://esa.github.io/pagmo2" + topics = ("pagmo", "optimization", "parallel-computing", "genetic-algorithm", "metaheuristics") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -30,12 +36,15 @@ class Pagmo2Conan(ConanFile): "with_ipopt": False, } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "Visual Studio": "15.7", + "msvc": "191", + "gcc": "7", + "clang": "5.0", + "apple-clang": "9", + } def config_options(self): if self.settings.os == "Windows": @@ -43,24 +52,18 @@ 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("onetbb/2020.3") + self.requires("boost/1.85.0", transitive_headers=True) + self.requires("onetbb/2021.12.0") if self.options.with_eigen: - self.requires("eigen/3.4.0") + self.requires("eigen/3.4.0", transitive_headers=True) if self.options.with_nlopt: - self.requires("nlopt/2.7.1") - - @property - def _compilers_minimum_version(self): - return { - "Visual Studio": "15.7", - "gcc": "7", - "clang": "5.0", - "apple-clang": "9.1" - } + self.requires("nlopt/2.7.1", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): @@ -68,86 +71,95 @@ def _required_boost_components(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) - - 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, 17) 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)) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.name} {self.version} requires C++17, which your compiler does not support." + ) # TODO: add ipopt support if self.options.with_ipopt: raise ConanInvalidConfiguration("ipopt recipe not available yet in CCI") - 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))) + 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( + "{0} requires non header-only boost with these components: {1}".format( + self.name, ", ".join(self._required_boost_components) + ) + ) + + if is_msvc(self) and self.options.shared: + # test_package.obj : error LNK2019: unresolved external symbol "public: __cdecl boost::archive::codecvt_null::codecvt_null(unsigned __int64)" + # https://github.com/boostorg/serialization/issues/232 + # https://github.com/conda-forge/scipoptsuite-feedstock/pull/44 + raise ConanInvalidConfiguration("Shared builds are currently broken on 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) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PAGMO_BUILD_TESTS"] = False + tc.variables["PAGMO_BUILD_BENCHMARKS"] = False + tc.variables["PAGMO_BUILD_TUTORIALS"] = False + tc.variables["PAGMO_WITH_EIGEN3"] = self.options.with_eigen + tc.variables["PAGMO_WITH_NLOPT"] = self.options.with_nlopt + tc.variables["PAGMO_WITH_IPOPT"] = self.options.with_ipopt + tc.variables["PAGMO_ENABLE_IPO"] = False + tc.variables["PAGMO_BUILD_STATIC_LIBRARY"] = not self.options.shared + tc.generate() + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): # do not force MT runtime for static lib - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "if(YACMA_COMPILER_IS_MSVC AND PAGMO_BUILD_STATIC_LIBRARY)", - "if(0)") + if Version(self.version) < "2.18": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "if(YACMA_COMPILER_IS_MSVC AND PAGMO_BUILD_STATIC_LIBRARY)", "if(0)") # No warnings as errors - yacma_cmake = os.path.join(self._source_subfolder, "cmake_modules", "yacma", "YACMACompilerLinkerSettings.cmake") - tools.replace_in_file(yacma_cmake, "list(APPEND _YACMA_CXX_FLAGS_DEBUG \"-Werror\")", "") - tools.replace_in_file(yacma_cmake, "_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4)", "") - tools.replace_in_file(yacma_cmake, "_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX)", "") - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["PAGMO_BUILD_TESTS"] = False - cmake.definitions["PAGMO_BUILD_BENCHMARKS"] = False - cmake.definitions["PAGMO_BUILD_TUTORIALS"] = False - cmake.definitions["PAGMO_WITH_EIGEN3"] = self.options.with_eigen - cmake.definitions["PAGMO_WITH_NLOPT"] = self.options.with_nlopt - cmake.definitions["PAGMO_WITH_IPOPT"] = self.options.with_ipopt - cmake.definitions["PAGMO_ENABLE_IPO"] = False - cmake.definitions["PAGMO_BUILD_STATIC_LIBRARY"] = not self.options.shared - cmake.configure() - return cmake + yacma_cmake = os.path.join(self.source_folder, "cmake_modules", "yacma", "YACMACompilerLinkerSettings.cmake") + replace_in_file(self, yacma_cmake, 'list(APPEND _YACMA_CXX_FLAGS_DEBUG "-Werror")', "") + replace_in_file(self, yacma_cmake, "_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/W4)", "") + replace_in_file(self, yacma_cmake, "_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(/WX)", "") def build(self): self._patch_sources() - cmake = self._configure_cmake() + 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(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", "pagmo") + # https://esa.github.io/pagmo2/quickstart.html#using-pagmo-with-cmake + self.cpp_info.set_property("cmake_file_name", "Pagmo") self.cpp_info.set_property("cmake_target_name", "Pagmo::pagmo") - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["_pagmo"].libs = ["pagmo"] - self.cpp_info.components["_pagmo"].requires = ["boost::headers", "boost::serialization", "onetbb::onetbb"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_pagmo"].system_libs.append("pthread") + + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["_pagmo"].requires = ["boost::boost", "onetbb::onetbb"] if self.options.with_eigen: self.cpp_info.components["_pagmo"].requires.append("eigen::eigen") if self.options.with_nlopt: self.cpp_info.components["_pagmo"].requires.append("nlopt::nlopt") - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["_pagmo"].system_libs.append("pthread") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "pagmo" self.cpp_info.filenames["cmake_find_package_multi"] = "pagmo" self.cpp_info.names["cmake_find_package"] = "Pagmo" self.cpp_info.names["cmake_find_package_multi"] = "Pagmo" self.cpp_info.components["_pagmo"].names["cmake_find_package"] = "pagmo" self.cpp_info.components["_pagmo"].names["cmake_find_package_multi"] = "pagmo" - self.cpp_info.components["_pagmo"].set_property("cmake_target_name", "Pagmo::pagmo") diff --git a/recipes/pagmo2/all/test_package/CMakeLists.txt b/recipes/pagmo2/all/test_package/CMakeLists.txt index e512e2207b158..73aa85822f44b 100644 --- a/recipes/pagmo2/all/test_package/CMakeLists.txt +++ b/recipes/pagmo2/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -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(TARGETS) - -find_package(pagmo REQUIRED CONFIG) +find_package(Pagmo REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} Pagmo::pagmo) diff --git a/recipes/pagmo2/all/test_package/conanfile.py b/recipes/pagmo2/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/pagmo2/all/test_package/conanfile.py +++ b/recipes/pagmo2/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/pagmo2/config.yml b/recipes/pagmo2/config.yml index 0daf1d812658e..4d9124762cc74 100644 --- a/recipes/pagmo2/config.yml +++ b/recipes/pagmo2/config.yml @@ -1,4 +1,6 @@ versions: + "2.19.0": + folder: all "2.17.0": folder: all "2.10": diff --git a/recipes/pagmo2/pre_2.11/CMakeLists.txt b/recipes/pagmo2/pre_2.11/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9..0000000000000 --- a/recipes/pagmo2/pre_2.11/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/pagmo2/pre_2.11/conandata.yml b/recipes/pagmo2/pre_2.11/conandata.yml index fb48c3245b653..9bb70cc4e5a27 100644 --- a/recipes/pagmo2/pre_2.11/conandata.yml +++ b/recipes/pagmo2/pre_2.11/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "2.10": - patch_file: "patches/0001-fix-cmake-module-path-2-10.patch" - base_path: "source_subfolder" diff --git a/recipes/pagmo2/pre_2.11/conanfile.py b/recipes/pagmo2/pre_2.11/conanfile.py index eeacc0b3752d5..485b29614940a 100644 --- a/recipes/pagmo2/pre_2.11/conanfile.py +++ b/recipes/pagmo2/pre_2.11/conanfile.py @@ -1,18 +1,23 @@ -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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir + +required_conan_version = ">=1.53.0" class Pagmo2Conan(ConanFile): name = "pagmo2" description = "pagmo is a C++ scientific library for massively parallel optimization." license = ("LGPL-3.0-or-later", "GPL-3.0-or-later") - topics = ("pagmo", "optimization", "parallel-computing", "genetic-algorithm", "metaheuristics") - homepage = "https://esa.github.io/pagmo2" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://esa.github.io/pagmo2" + topics = ("pagmo", "optimization", "parallel-computing", "genetic-algorithm", "metaheuristics", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_eigen": [True, False], @@ -25,25 +30,22 @@ class Pagmo2Conan(ConanFile): "with_ipopt": False, } - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - _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) + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.78.0") - self.requires("onetbb/2020.3") + self.requires("boost/1.83.0", transitive_headers=True) + self.requires("onetbb/2021.10.0") if self.options.with_eigen: - self.requires("eigen/3.4.0") + self.requires("eigen/3.4.0", transitive_headers=True) if self.options.with_nlopt: - self.requires("nlopt/2.7.1") + self.requires("nlopt/2.7.1", transitive_headers=True, transitive_libs=True) + + def package_id(self): + self.info.settings.clear() @property def _required_boost_components(self): @@ -51,61 +53,69 @@ def _required_boost_components(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) # TODO: add ipopt support if self.options.with_ipopt: raise ConanInvalidConfiguration("ipopt recipe not available yet in CCI") - 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))) - - def package_id(self): - self.info.settings.clear() + 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( + "{0} requires non header-only boost with these components: {1}".format( + self.name, ", ".join(self._required_boost_components) + ) + ) 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["PAGMO_BUILD_TESTS"] = False - self._cmake.definitions["PAGMO_BUILD_TUTORIALS"] = False - self._cmake.definitions["PAGMO_WITH_EIGEN3"] = self.options.with_eigen - self._cmake.definitions["PAGMO_WITH_NLOPT"] = self.options.with_nlopt - self._cmake.definitions["PAGMO_WITH_IPOPT"] = self.options.with_ipopt - 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["PAGMO_BUILD_TESTS"] = False + tc.variables["PAGMO_BUILD_TUTORIALS"] = False + tc.variables["PAGMO_WITH_EIGEN3"] = self.options.with_eigen + tc.variables["PAGMO_WITH_NLOPT"] = self.options.with_nlopt + tc.variables["PAGMO_WITH_IPOPT"] = self.options.with_ipopt + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + 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, + pattern="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")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "pagmo") self.cpp_info.set_property("cmake_target_name", "Pagmo::pagmo") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_pagmo"].system_libs.append("pthread") + # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["_pagmo"].requires = ["boost::headers", "boost::serialization", "onetbb::onetbb"] + self.cpp_info.components["_pagmo"].requires = ["boost::boost", "onetbb::onetbb"] if self.options.with_eigen: self.cpp_info.components["_pagmo"].requires.append("eigen::eigen") if self.options.with_nlopt: self.cpp_info.components["_pagmo"].requires.append("nlopt::nlopt") - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["_pagmo"].system_libs.append("pthread") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "pagmo" self.cpp_info.filenames["cmake_find_package_multi"] = "pagmo" self.cpp_info.names["cmake_find_package"] = "Pagmo" self.cpp_info.names["cmake_find_package_multi"] = "Pagmo" self.cpp_info.components["_pagmo"].names["cmake_find_package"] = "pagmo" self.cpp_info.components["_pagmo"].names["cmake_find_package_multi"] = "pagmo" - self.cpp_info.components["_pagmo"].set_property("cmake_target_name", "Pagmo::pagmo") diff --git a/recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt b/recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt index 7439694a33876..de018735ec0b2 100644 --- a/recipes/pagmo2/pre_2.11/test_package/CMakeLists.txt +++ b/recipes/pagmo2/pre_2.11/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(pagmo REQUIRED CONFIG) diff --git a/recipes/pagmo2/pre_2.11/test_package/conanfile.py b/recipes/pagmo2/pre_2.11/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/pagmo2/pre_2.11/test_package/conanfile.py +++ b/recipes/pagmo2/pre_2.11/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/paho-mqtt-c/all/conanfile.py b/recipes/paho-mqtt-c/all/conanfile.py index 7af37a8f2229f..c9d828d145432 100644 --- a/recipes/paho-mqtt-c/all/conanfile.py +++ b/recipes/paho-mqtt-c/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 apply_conandata_patches, export_conandata_patches, get, copy, rm, replace_in_file +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class PahoMqttcConan(ConanFile): @@ -70,6 +71,8 @@ def generate(self): tc.cache_variables["OPENSSL_ROOT_DIR"] = self.dependencies["openssl"].package_folder.replace("\\", "/") tc.variables["PAHO_HIGH_PERFORMANCE"] = self.options.high_performance tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "1.3.14": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) @@ -128,12 +131,6 @@ def package_info(self): if self.options.ssl: self.cpp_info.components["_paho-mqtt-c"].requires = ["openssl::openssl"] - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "eclipse-paho-mqtt-c" - self.cpp_info.names["cmake_find_package_multi"] = "eclipse-paho-mqtt-c" - self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package"] = self._cmake_target - self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package_multi"] = self._cmake_target self.cpp_info.components["_paho-mqtt-c"].set_property("cmake_target_name", f"eclipse-paho-mqtt-c::{self._cmake_target}") @property diff --git a/recipes/paho-mqtt-c/all/test_package/CMakeLists.txt b/recipes/paho-mqtt-c/all/test_package/CMakeLists.txt index d1e82b16d05ff..8eb7812eecf1b 100644 --- a/recipes/paho-mqtt-c/all/test_package/CMakeLists.txt +++ b/recipes/paho-mqtt-c/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(eclipse-paho-mqtt-c REQUIRED CONFIG) diff --git a/recipes/paho-mqtt-c/all/test_v1_package/CMakeLists.txt b/recipes/paho-mqtt-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/paho-mqtt-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/paho-mqtt-c/all/test_v1_package/conanfile.py b/recipes/paho-mqtt-c/all/test_v1_package/conanfile.py deleted file mode 100644 index d8c4480cdc666..0000000000000 --- a/recipes/paho-mqtt-c/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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.definitions["PAHO_MQTT_C_ASYNC"] = self.options["paho-mqtt-c"].asynchronous - cmake.definitions["PAHO_MQTT_C_WITH_SSL"] = self.options["paho-mqtt-c"].ssl - 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/paho-mqtt-cpp/all/conandata.yml b/recipes/paho-mqtt-cpp/all/conandata.yml index 82fdb49cadc6c..e14c99ec20579 100644 --- a/recipes/paho-mqtt-cpp/all/conandata.yml +++ b/recipes/paho-mqtt-cpp/all/conandata.yml @@ -1,24 +1,30 @@ sources: + "1.4.1": + url: "https://github.com/eclipse/paho.mqtt.cpp/archive/v1.4.1.tar.gz" + sha256: "48e7ba6e1032aa73e4d985a7387e02a77cc5807a8420d16790b84b941d86374e" + "1.4.0": + url: "https://github.com/eclipse/paho.mqtt.cpp/archive/v1.4.0.tar.gz" + sha256: "758c504b585402fbeb47822e52897239bbd53b4236ac3908cc040e09d2a8d8e1" + "1.3.2": + url: "https://github.com/eclipse/paho.mqtt.cpp/archive/v1.3.2.tar.gz" + sha256: "c271d521287f417102b447b3d1e8d17be0e0f6a3b0b653334ebcd2ccd20d1e46" "1.2.0": - sha256: 435e97e4d5b1da13daa26cadd3e83fe9d154930abaa78b8ff1b8c854b5345d8b - url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.2.0.tar.gz - "1.1": - sha256: cb0343349ed91ef51d0e76ae860d19435a730d3d355e57886bb090014cb70bbe - url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.1.tar.gz - "1.0.1": - sha256: e97386d159b811e534b98d21e3f6881ab2b43678ec026da7525d5c21ebc292ff - url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.0.1.tar.gz + url: "https://github.com/eclipse/paho.mqtt.cpp/archive/v1.2.0.tar.gz" + sha256: "435e97e4d5b1da13daa26cadd3e83fe9d154930abaa78b8ff1b8c854b5345d8b" patches: - "1.2.0": - - patch_file: "patches/1.2.0-0001-fix-cmake.patch" - patch_description: "CMake: Honor fPIC option and properly link paho-mqtt-c to object target" + "1.4.1": + - patch_file: "patches/1.4.1-0001-fix-cmake.patch" + patch_description: "CMake: Honor fPIC option" + patch_type: "conan" + "1.4.0": + - patch_file: "patches/1.4.0-0001-fix-cmake.patch" + patch_description: "CMake: Honor fPIC option" patch_type: "conan" - "1.1": - - patch_file: "patches/1.1-0001-fix-cmake.patch" + "1.3.2": + - patch_file: "patches/1.3.2-0001-fix-cmake.patch" patch_description: "CMake: Honor fPIC option and properly link paho-mqtt-c to object target" patch_type: "conan" - - patch_file: "patches/1.1-0002-deadlock_and_remlog-for-1-1.patch" - "1.0.1": - - patch_file: "patches/1.0.1-0001-fix-cmake.patch" - patch_description: "CMake: properly link paho-mqtt-c to object target" + "1.2.0": + - patch_file: "patches/1.2.0-0001-fix-cmake.patch" + patch_description: "CMake: Honor fPIC option and properly link paho-mqtt-c to object target" patch_type: "conan" diff --git a/recipes/paho-mqtt-cpp/all/conanfile.py b/recipes/paho-mqtt-cpp/all/conanfile.py index a2003509d5dc7..29c655cc42b87 100644 --- a/recipes/paho-mqtt-cpp/all/conanfile.py +++ b/recipes/paho-mqtt-cpp/all/conanfile.py @@ -21,12 +21,10 @@ class PahoMqttCppConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "ssl": [True, False, "deprecated"], # TODO: deprecated option, to remove in few months } default_options = { "shared": False, "fPIC": True, - "ssl": "deprecated", } @property @@ -47,25 +45,13 @@ def configure(self): suffix = "" if Version(conan_version).major < "2" else "/*" self.options[f"paho-mqtt-c{suffix}"].shared = self.options.shared - # TODO: deprecated option, to remove in few months - if self.options.ssl != "deprecated": - self.output.warning("ssl option is deprecated, do not use anymore") - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) >= "1.2.0": - # Headers are exposed https://github.com/conan-io/conan-center-index/pull/16760#issuecomment-1502420549 - # Symbols are exposed "_MQTTProperties_free", referenced from: mqtt::connect_options::~connect_options() in test_package.cpp.o - self.requires("paho-mqtt-c/1.3.9", transitive_headers=True, transitive_libs=True) - else: - # This is the "official tested" version https://github.com/eclipse/paho.mqtt.cpp/releases/tag/v1.1 - self.requires("paho-mqtt-c/1.3.1", transitive_headers=True, transitive_libs=True) - - def package_id(self): - # TODO: deprecated option, to remove in few months - del self.info.options.ssl + # Headers are exposed https://github.com/conan-io/conan-center-index/pull/16760#issuecomment-1502420549 + # Symbols are exposed "_MQTTProperties_free", referenced from: mqtt::connect_options::~connect_options() in test_package.cpp.o + self.requires("paho-mqtt-c/1.3.13", transitive_headers=True, transitive_libs=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -73,8 +59,6 @@ def validate(self): if self.dependencies["paho-mqtt-c"].options.shared != self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} requires paho-mqtt-c to have a matching 'shared' option.") - if Version(self.version) < "1.2.0" and Version(self.dependencies["paho-mqtt-c"].ref.version) >= "1.3.2": - raise ConanInvalidConfiguration(f"{self.ref} requires paho-mqtt-c =< 1.3.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -88,8 +72,9 @@ def generate(self): tc.variables["PAHO_WITH_SSL"] = self.dependencies["paho-mqtt-c"].options.ssl tc.generate() deps = CMakeDeps(self) - deps.set_property("paho-mqtt-c", "cmake_file_name", "PahoMqttC") - deps.set_property("paho-mqtt-c", "cmake_target_name", "PahoMqttC::PahoMqttC") + if Version(self.version) < "1.4.0": + deps.set_property("paho-mqtt-c", "cmake_file_name", "PahoMqttC") + deps.set_property("paho-mqtt-c", "cmake_target_name", "PahoMqttC::PahoMqttC") deps.generate() def build(self): diff --git a/recipes/paho-mqtt-cpp/all/patches/1.0.1-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.0.1-0001-fix-cmake.patch deleted file mode 100644 index e22c0033d4b91..0000000000000 --- a/recipes/paho-mqtt-cpp/all/patches/1.0.1-0001-fix-cmake.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -74,9 +74,9 @@ target_include_directories(paho-cpp-objs - $ - $ - PRIVATE -- ${PAHO_MQTT_C_INCLUDE_DIRS} - src - ) -+target_link_libraries(paho-cpp-objs PUBLIC PahoMqttC::PahoMqttC) - - - ## --- Build the shared library, if requested --- diff --git a/recipes/paho-mqtt-cpp/all/patches/1.1-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.1-0001-fix-cmake.patch deleted file mode 100644 index dbcbfa21fd7ce..0000000000000 --- a/recipes/paho-mqtt-cpp/all/patches/1.1-0001-fix-cmake.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -56,7 +56,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) - - # Generate position-independent code (-fPIC on UNIX) --set(CMAKE_POSITION_INDEPENDENT_CODE ON) - - # --- System Libraries --- - ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -72,9 +72,12 @@ target_include_directories(paho-cpp-objs - $ - $ - PRIVATE -- ${PAHO_MQTT_C_INCLUDE_DIRS} - src - ) -+target_link_libraries(paho-cpp-objs PUBLIC PahoMqttC::PahoMqttC) -+if(PAHO_BUILD_SHARED) -+ set_target_properties(paho-cpp-objs PROPERTIES POSITION_INDEPENDENT_CODE ON) -+endif() - - - ## --- Build the shared library, if requested --- diff --git a/recipes/paho-mqtt-cpp/all/patches/1.1-0002-deadlock_and_remlog-for-1-1.patch b/recipes/paho-mqtt-cpp/all/patches/1.1-0002-deadlock_and_remlog-for-1-1.patch deleted file mode 100644 index 4aec911f54ce3..0000000000000 --- a/recipes/paho-mqtt-cpp/all/patches/1.1-0002-deadlock_and_remlog-for-1-1.patch +++ /dev/null @@ -1,360 +0,0 @@ -diff --git a/src/async_client.cpp b/src/async_client.cpp -index c536b77..1a89662 100644 ---- a/src/async_client.cpp -+++ b/src/async_client.cpp -@@ -34,27 +34,6 @@ - #define MQTTAsync_createOptions_initializer5 { {'M', 'Q', 'C', 'O'}, 0, 0, 100, MQTTVERSION_5 } - #endif - --///////////////////////////////////////////////////////////////////////////// --// Paho C logger -- --enum LOG_LEVELS { -- INVALID_LEVEL = -1, -- TRACE_MAX = 1, -- TRACE_MED, -- TRACE_MIN, -- TRACE_PROTOCOL, -- LOG_PROTOCOL = TRACE_PROTOCOL, -- LOG_ERROR, -- LOG_SEVERE, -- LOG_FATAL, --}; -- --extern "C" { -- void Log(enum LOG_LEVELS, int, const char *, ...); --} -- --///////////////////////////////////////////////////////////////////////////// -- - namespace mqtt { - - ///////////////////////////////////////////////////////////////////////////// -@@ -150,8 +129,6 @@ async_client::~async_client() - // is notified of success on a normal connect with callbacks. - void async_client::on_connected(void* context, char* cause) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_connected"); -- - if (context) { - async_client* cli = static_cast(context); - callback* cb = cli->userCallback_; -@@ -172,8 +149,6 @@ void async_client::on_connected(void* context, char* cause) - // MQTTAsync_setCallbacks(). - void async_client::on_connection_lost(void *context, char *cause) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_connection lost"); -- - if (context) { - async_client* cli = static_cast(context); - callback* cb = cli->userCallback_; -@@ -193,6 +168,22 @@ void async_client::on_connection_lost(void *context, char *cause) - } - } - -+// Callback from the C lib for when a disconnect packet is received from -+// the server. -+void async_client::on_disconnected(void* context, MQTTProperties* cprops, -+ MQTTReasonCodes reasonCode) -+{ -+ if (context) { -+ async_client* cli = static_cast(context); -+ auto& disconnectedHandler = cli->disconnectedHandler_; -+ -+ if (disconnectedHandler) { -+ properties props(*cprops); -+ disconnectedHandler(props, ReasonCode(reasonCode)); -+ } -+ } -+} -+ - // Callback for when a subscribed message arrives. - // This is called from the MQTTAsync_messageArrived registered via - // MQTTAsync_setCallbacks(). -@@ -365,6 +356,13 @@ void async_client::set_connection_lost_handler(connection_handler cb) - &async_client::on_connection_lost)); - } - -+void async_client::set_disconnected_handler(disconnected_handler cb) -+{ -+ disconnectedHandler_ = cb; -+ check_ret(::MQTTAsync_setDisconnected(cli_, this, -+ &async_client::on_disconnected)); -+} -+ - void async_client::set_message_callback(message_handler cb) - { - msgHandler_ = cb; -diff --git a/src/mqtt/async_client.h b/src/mqtt/async_client.h -index 4323071..4bbd95c 100644 ---- a/src/mqtt/async_client.h -+++ b/src/mqtt/async_client.h -@@ -32,6 +32,7 @@ - #include "mqtt/delivery_token.h" - #include "mqtt/iclient_persistence.h" - #include "mqtt/iaction_listener.h" -+#include "mqtt/properties.h" - #include "mqtt/exception.h" - #include "mqtt/message.h" - #include "mqtt/callback.h" -@@ -84,6 +85,8 @@ public: - using message_handler = std::function; - /** Handler type for when a connecion is made or lost */ - using connection_handler = std::function; -+ /** Handler type for when a disconnect packet is received */ -+ using disconnected_handler = std::function; - - private: - /** Lock guard type for this class */ -@@ -105,10 +108,12 @@ private: - std::unique_ptr persist_; - /** Callback supplied by the user (if any) */ - callback* userCallback_; -- /** Connection handler */ -+ /** Connection handler */ - connection_handler connHandler_; -- /** Connection lost handler */ -+ /** Connection lost handler */ - connection_handler connLostHandler_; -+ /** Disconnected handler */ -+ disconnected_handler disconnectedHandler_; - /** Message handler (if any) */ - message_handler msgHandler_; - /** Copy of connect token (for re-connects) */ -@@ -120,9 +125,11 @@ private: - /** A queue of messages for consumer API */ - consumer_queue_type que_; - -- /** Callbacks from the C library */ -+ /** Callbacks from the C library */ - static void on_connected(void* context, char* cause); - static void on_connection_lost(void *context, char *cause); -+ static void on_disconnected(void* context, MQTTProperties* cprops, -+ MQTTReasonCodes reasonCode); - static int on_message_arrived(void* context, char* topicName, int topicLen, - MQTTAsync_message* msg); - static void on_delivery_complete(void* context, MQTTAsync_token tok); -@@ -234,6 +241,11 @@ public: - * @param cb Callback functor for when the connection is lost. - */ - void set_connection_lost_handler(connection_handler cb) /*override*/; -+ /** -+ * Callback for when a disconnect packet is received from the server. -+ * @param cb Callback for when the disconnect packet is received. -+ */ -+ void set_disconnected_handler(disconnected_handler cb) /*override*/; - /** - * Sets the callback for when a message arrives from the broker. - * Note that the application can only have one message handler which can -diff --git a/src/mqtt/thread_queue.h b/src/mqtt/thread_queue.h -index 94c3fea..5dafe6e 100644 ---- a/src/mqtt/thread_queue.h -+++ b/src/mqtt/thread_queue.h -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - - namespace mqtt { - -@@ -102,9 +103,9 @@ public: - /** - * Constructs a queue with the specified capacity. - * @param cap The maximum number of items that can be placed in the -- * queue. -+ * queue. The minimum capacity is 1. - */ -- explicit thread_queue(size_t cap) : cap_(cap) {} -+ explicit thread_queue(size_t cap) : cap_(std::max(cap, 1)) {} - /** - * Determine if the queue is empty. - * @return @em true if there are no elements in the queue, @em false if -@@ -148,11 +149,11 @@ public: - */ - void put(value_type val) { - unique_guard g(lock_); -- size_type n = que_.size(); -- if (n >= cap_) -+ if (que_.size() >= cap_) - notFullCond_.wait(g, [=]{return que_.size() < cap_;}); -+ bool wasEmpty = que_.empty(); - que_.emplace(std::move(val)); -- if (n == 0) { -+ if (wasEmpty) { - g.unlock(); - notEmptyCond_.notify_one(); - } -@@ -187,11 +188,11 @@ public: - template - bool try_put_for(value_type* val, const std::chrono::duration& relTime) { - unique_guard g(lock_); -- size_type n = que_.size(); -- if (n >= cap_ && !notFullCond_.wait_for(g, relTime, [=]{return que_.size() < cap_;})) -+ if (que_.size() >= cap_ && !notFullCond_.wait_for(g, relTime, [=]{return que_.size() < cap_;})) - return false; -+ bool wasEmpty = que_.empty(); - que_.emplace(std::move(val)); -- if (n == 0) { -+ if (wasEmpty) { - g.unlock(); - notEmptyCond_.notify_one(); - } -@@ -210,11 +211,11 @@ public: - template - bool try_put_until(value_type* val, const std::chrono::time_point& absTime) { - unique_guard g(lock_); -- size_type n = que_.size(); -- if (n >= cap_ && !notFullCond_.wait_until(g, absTime, [=]{return que_.size() < cap_;})) -+ if (que_.size() >= cap_ && !notFullCond_.wait_until(g, absTime, [=]{return que_.size() < cap_;})) - return false; -+ bool wasEmpty = que_.empty(); - que_.emplace(std::move(val)); -- if (n == 0) { -+ if (wasEmpty) { - g.unlock(); - notEmptyCond_.notify_one(); - } -@@ -228,12 +229,11 @@ public: - */ - void get(value_type* val) { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0) -+ if (que_.empty()) - notEmptyCond_.wait(g, [=]{return !que_.empty();}); - *val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -@@ -246,12 +246,11 @@ public: - */ - value_type get() { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0) -+ if (que_.empty()) - notEmptyCond_.wait(g, [=]{return !que_.empty();}); - value_type val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -@@ -267,12 +266,11 @@ public: - */ - bool try_get(value_type* val) { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0) -+ if (que_.empty()) - return false; - *val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -@@ -291,12 +289,11 @@ public: - template - bool try_get_for(value_type* val, const std::chrono::duration& relTime) { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0 && !notEmptyCond_.wait_for(g, relTime, [=]{return !que_.empty();})) -+ if (que_.empty() && !notEmptyCond_.wait_for(g, relTime, [=]{return !que_.empty();})) - return false; - *val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -@@ -315,12 +312,11 @@ public: - template - bool try_get_until(value_type* val, const std::chrono::time_point& absTime) { - unique_guard g(lock_); -- auto n = que_.size(); -- if (n == 0 && !notEmptyCond_.wait_until(g, absTime, [=]{return !que_.empty();})) -+ if (que_.empty() && !notEmptyCond_.wait_until(g, absTime, [=]{return !que_.empty();})) - return false; - *val = std::move(que_.front()); - que_.pop(); -- if (n == cap_) { -+ if (que_.size() == cap_-1) { - g.unlock(); - notFullCond_.notify_one(); - } -diff --git a/src/token.cpp b/src/token.cpp -index ffbf816..3853cf2 100644 ---- a/src/token.cpp -+++ b/src/token.cpp -@@ -23,27 +23,6 @@ - - #include - --///////////////////////////////////////////////////////////////////////////// --// Paho C logger -- --enum LOG_LEVELS { -- INVALID_LEVEL = -1, -- TRACE_MAX = 1, -- TRACE_MED, -- TRACE_MIN, -- TRACE_PROTOCOL, -- LOG_PROTOCOL = TRACE_PROTOCOL, -- LOG_ERROR, -- LOG_SEVERE, -- LOG_FATAL, --}; -- --extern "C" { -- void Log(enum LOG_LEVELS, int, const char *, ...); --} -- --///////////////////////////////////////////////////////////////////////////// -- - namespace mqtt { - - // -------------------------------------------------------------------------- -@@ -110,8 +89,6 @@ void token::on_failure5(void* context, MQTTAsync_failureData5* rsp) - // - void token::on_success(MQTTAsync_successData* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_success"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - -@@ -154,8 +131,6 @@ void token::on_success(MQTTAsync_successData* rsp) - // - void token::on_success5(MQTTAsync_successData5* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_success5"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - if (rsp) { -@@ -197,8 +172,6 @@ void token::on_success5(MQTTAsync_successData5* rsp) - // - void token::on_failure(MQTTAsync_failureData* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_failure"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - if (rsp) { -@@ -230,8 +203,6 @@ void token::on_failure(MQTTAsync_failureData* rsp) - // - void token::on_failure5(MQTTAsync_failureData5* rsp) - { -- ::Log(TRACE_MIN, -1, "[cpp] on_failure5"); -- - unique_lock g(lock_); - iaction_listener* listener = listener_; - if (rsp) { diff --git a/recipes/paho-mqtt-cpp/all/patches/1.3.2-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.3.2-0001-fix-cmake.patch new file mode 100644 index 0000000000000..f2fe425491b50 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.3.2-0001-fix-cmake.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + + # Generate position-independent code (-fPIC on UNIX) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # --- System Libraries --- + +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -82,9 +82,12 @@ target_include_directories(paho-cpp-objs + $ + $ + PRIVATE +- ${PAHO_MQTT_C_INCLUDE_DIRS} + src + ) ++target_link_libraries(paho-cpp-objs PUBLIC PahoMqttC::PahoMqttC) ++if(PAHO_BUILD_SHARED) ++ set_target_properties(paho-cpp-objs PROPERTIES POSITION_INDEPENDENT_CODE ON) ++endif() + + target_compile_definitions(paho-cpp-objs PRIVATE PAHO_MQTTPP_EXPORTS) + diff --git a/recipes/paho-mqtt-cpp/all/patches/1.4.0-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.4.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..3a9eac127ef96 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.4.0-0001-fix-cmake.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1155844..ace2e61 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,7 +107,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + + # Generate position-independent code (-fPIC on UNIX) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # --- System Details --- + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index c8b213d..2898972 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -68,6 +68,7 @@ if(PAHO_BUILD_SHARED) + set_target_properties(paho-mqttpp3 PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} ++ POSITION_INDEPENDENT_CODE ON + ) + endif() + diff --git a/recipes/paho-mqtt-cpp/all/patches/1.4.1-0001-fix-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.4.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..2a2ea837355aa --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.4.1-0001-fix-cmake.patch @@ -0,0 +1,21 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,7 +107,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + + # Generate position-independent code (-fPIC on UNIX) +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + # --- System Details --- + +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -68,6 +68,7 @@ if(PAHO_BUILD_SHARED) + set_target_properties(paho-mqttpp3 PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} ++ POSITION_INDEPENDENT_CODE ON + ) + endif() + diff --git a/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt b/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt index 110f1d17cc392..ff0d0d7fdb39c 100644 --- a/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt +++ b/recipes/paho-mqtt-cpp/all/test_package/CMakeLists.txt @@ -1,18 +1,11 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) -project(test_package C CXX) +project(test_package LANGUAGES CXX) find_package(PahoMqttCpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) - -if(TEST_SSL_OPTION) - target_compile_definitions(${PROJECT_NAME} PRIVATE TEST_SSL_OPTION) -endif() - -if(PAHO_MQTT_CPP_SHARED) - target_link_libraries(${PROJECT_NAME} PahoMqttCpp::paho-mqttpp3) -else() - target_link_libraries(${PROJECT_NAME} PahoMqttCpp::paho-mqttpp3-static) -endif() +target_link_libraries(${PROJECT_NAME} PRIVATE + $<$:PahoMqttCpp::paho-mqttpp3> + $<$>:PahoMqttCpp::paho-mqttpp3-static>) diff --git a/recipes/paho-mqtt-cpp/all/test_package/conanfile.py b/recipes/paho-mqtt-cpp/all/test_package/conanfile.py index 6b882c937645a..a3dc3d0a3dd9f 100644 --- a/recipes/paho-mqtt-cpp/all/test_package/conanfile.py +++ b/recipes/paho-mqtt-cpp/all/test_package/conanfile.py @@ -16,8 +16,6 @@ def layout(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["TEST_SSL_OPTION"] = self.dependencies[self.tested_reference_str].options.ssl - tc.variables["PAHO_MQTT_CPP_SHARED"] = self.dependencies[self.tested_reference_str].options.shared tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp b/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp index 79865e445a31c..59652bb6459ca 100644 --- a/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp +++ b/recipes/paho-mqtt-cpp/all/test_package/test_package.cpp @@ -1,26 +1,10 @@ -#include -#include "mqtt/async_client.h" -#include "mqtt/client.h" +#include +#include "mqtt/message.h" -const std::string SERVER_ADDRESS { "tcp://localhost:1883" }; -const std::string CLIENT_ID { "consume" }; - -int main(int argc, char* argv[]) -{ - mqtt::connect_options connOpts; - connOpts.set_keep_alive_interval(20); - connOpts.set_clean_session(true); - - mqtt::async_client cli_async(SERVER_ADDRESS, CLIENT_ID); - mqtt::client cli(SERVER_ADDRESS, CLIENT_ID); - -#ifdef TEST_SSL_OPTION - // Build the connect options, including SSL and a LWT message. - // auto sslopts = mqtt::ssl_options_builder(); // This was added in v1.2.0 - auto sslopts = mqtt::ssl_options(); -#endif +int main() { + mqtt::message msg("hello", "Hello there", 11, 1, true); + std::cout << "MQTT topic: " << msg.get_topic() << std::endl; return 0; } - diff --git a/recipes/paho-mqtt-cpp/all/test_v1_package/CMakeLists.txt b/recipes/paho-mqtt-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/paho-mqtt-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/paho-mqtt-cpp/all/test_v1_package/conanfile.py b/recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index df31aee370d9b..0000000000000 --- a/recipes/paho-mqtt-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +0,0 @@ -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.definitions["PAHO_MQTT_CPP_SHARED"] = self.options["paho-mqtt-cpp"].shared - cmake.definitions["TEST_SSL_OPTION"] = self.options["paho-mqtt-cpp"].ssl - 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/paho-mqtt-cpp/config.yml b/recipes/paho-mqtt-cpp/config.yml index e1306dc2a1d9a..cc08f3a574b59 100644 --- a/recipes/paho-mqtt-cpp/config.yml +++ b/recipes/paho-mqtt-cpp/config.yml @@ -1,7 +1,9 @@ versions: - "1.2.0": + "1.4.1": + folder: "all" + "1.4.0": folder: "all" - "1.1": + "1.3.2": folder: "all" - "1.0.1": + "1.2.0": folder: "all" diff --git a/recipes/pango/all/conandata.yml b/recipes/pango/all/conandata.yml index 1d8c33548e913..c6a58de488d3e 100644 --- a/recipes/pango/all/conandata.yml +++ b/recipes/pango/all/conandata.yml @@ -1,16 +1,25 @@ sources: - "1.48.9": - url: "https://github.com/GNOME/pango/archive/1.48.9.tar.gz" - sha256: "6c78162507debd3389dab9f045cfa0b03cb44c432fb21979d4acf45db1b93781" - "1.49.3": - url: "https://github.com/GNOME/pango/archive/1.49.3.tar.gz" - sha256: "2bba081ba680b900a1285d7c9699c0058bf93c3c6b25acaa77214708fb7cb19b" - "1.50.7": - url: "https://github.com/GNOME/pango/archive/1.50.7.tar.gz" - sha256: "4964dc5f1a17464de3c1b91c16a0153429e2f73e81cfdea3229a6370b9ab8e5a" - "1.50.8": - url: "https://download.gnome.org/sources/pango/1.50/pango-1.50.8.tar.xz" - sha256: "cf626f59dd146c023174c4034920e9667f1d25ac2c1569516d63136c311255fa" + "1.54.0": + url: "https://download.gnome.org/sources/pango/1.54/pango-1.54.0.tar.xz" + sha256: "8a9eed75021ee734d7fc0fdf3a65c3bba51dfefe4ae51a9b414a60c70b2d1ed8" + "1.51.0": + url: "https://download.gnome.org/sources/pango/1.51/pango-1.51.0.tar.xz" + sha256: "74efc109ae6f903bbe6af77eaa2ac6094b8ee245a2e23f132a7a8f0862d1a9f5" + "1.50.14": + url: "https://download.gnome.org/sources/pango/1.50/pango-1.50.14.tar.xz" + sha256: "1d67f205bfc318c27a29cfdfb6828568df566795df0cb51d2189cde7f2d581e8" "1.50.10": url: "https://download.gnome.org/sources/pango/1.50/pango-1.50.10.tar.xz" sha256: "7e5d2f1e40854d24a9a2c4d093bafe75dcdbeccdf1de43e4437332eabed64966" + "1.50.8": + url: "https://download.gnome.org/sources/pango/1.50/pango-1.50.8.tar.xz" + sha256: "cf626f59dd146c023174c4034920e9667f1d25ac2c1569516d63136c311255fa" + "1.50.7": + url: "https://github.com/GNOME/pango/archive/1.50.7.tar.gz" + sha256: "4964dc5f1a17464de3c1b91c16a0153429e2f73e81cfdea3229a6370b9ab8e5a" + "1.49.3": + url: "https://github.com/GNOME/pango/archive/1.49.3.tar.gz" + sha256: "2bba081ba680b900a1285d7c9699c0058bf93c3c6b25acaa77214708fb7cb19b" + "1.48.9": + url: "https://github.com/GNOME/pango/archive/1.48.9.tar.gz" + sha256: "6c78162507debd3389dab9f045cfa0b03cb44c432fb21979d4acf45db1b93781" diff --git a/recipes/pango/all/conanfile.py b/recipes/pango/all/conanfile.py index 7c23b65c48a80..a831c975f3959 100644 --- a/recipes/pango/all/conanfile.py +++ b/recipes/pango/all/conanfile.py @@ -1,207 +1,293 @@ import os import glob -from conans import tools, Meson, VisualStudioBuildEnvironment from conan import ConanFile -from conan.tools.scm import Version -from conan.tools.files import get, replace_in_file, chdir, rmdir, rm, rename from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc +from conan.tools.apple import is_apple_os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, 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 Meson, MesonToolchain +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + +required_conan_version = ">=1.60.0 <2 || >=2.0.5" -required_conan_version = ">=1.51.3" class PangoConan(ConanFile): name = "pango" - license = "LGPL-2.0-and-later" + license = "LGPL-2.0-or-later" url = "https://github.com/conan-io/conan-center-index" description = "Internationalized text layout and rendering library" homepage = "https://www.pango.org/" - topics = ("conan", "fontconfig", "fonts", "freedesktop") + topics = ("fontconfig", "fonts", "freedesktop") + package_type = "library" settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False], "with_libthai": [True, False], "with_cairo": [True, False], "with_xft": [True, False, "auto"], "with_freetype": [True, False, "auto"], "with_fontconfig": [True, False, "auto"]} - default_options = {"shared": False, "fPIC": True, "with_libthai": False, "with_cairo": True, "with_xft": "auto", "with_freetype": "auto", "with_fontconfig": "auto"} - generators = "pkg_config" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def validate(self): - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("this recipe does not support GCC before version 5. contributions are welcome") - if self.options.with_xft and not self.settings.os in ["Linux", "FreeBSD"]: - raise ConanInvalidConfiguration("Xft can only be used on Linux and FreeBSD") - - if self.options.with_xft and (not self.options.with_freetype or not self.options.with_fontconfig): - raise ConanInvalidConfiguration("Xft requires freetype and fontconfig") - - if self.options.shared and (not self.options["glib"].shared - or not self.options["harfbuzz"].shared or - (self.options.with_cairo - and not self.options["cairo"].shared)): - raise ConanInvalidConfiguration( - "Linking a shared library against static glib can cause unexpected behaviour." - ) - + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libthai": [True, False], + "with_cairo": [True, False], + "with_xft": [True, False], + "with_freetype": [True, False], + "with_fontconfig": [True, False], + "with_introspection": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libthai": False, + "with_cairo": True, + "with_xft": True, + # TODO: Currently can't actually disable this in Macos at least, + # it always shows up as detected in meson + "with_freetype": True, + "with_fontconfig": True, + "with_introspection": False, + } def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.os not in ["FreeBSD", "Linux"]: + del self.options.with_xft - def configure(self): - if self.options.shared: - del self.options.fPIC - - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + # Optional in Windows/Macos but false by default + # https://gitlab.gnome.org/GNOME/pango/-/blob/1.54.0/meson.build#L242 + if self.settings.os in ["Macos", "Windows"]: + self.options.with_fontconfig = False + self.options.with_freetype = False - if self.options.with_xft == "auto": - self.options.with_xft = self.settings.os in ["Linux", "FreeBSD"] - if self.options.with_freetype == "auto": - self.options.with_freetype = not self.settings.os in ["Windows", "Macos"] - if self.options.with_fontconfig == "auto": - self.options.with_fontconfig = not self.settings.os in ["Windows", "Macos"] + def configure(self): if self.options.shared: - self.options["glib"].shared = True - self.options["harfbuzz"].shared = True - if self.options.with_cairo: - self.options["cairo"].shared = True + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - def build_requirements(self): - self.build_requires("pkgconf/1.7.4") - self.build_requires("meson/0.63.2") + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_freetype: - self.requires("freetype/2.12.1") - + self.requires("freetype/2.13.2") if self.options.with_fontconfig: - self.requires("fontconfig/2.13.93") - if self.options.with_xft: - self.requires("libxft/2.3.4") - if self.options.with_xft and self.options.with_fontconfig and self.options.with_freetype: - self.requires("xorg/system") # for xorg::xrender + self.requires("fontconfig/2.15.0") + if self.options.get_safe("with_xft"): + self.requires("libxft/2.3.8") + self.requires("xorg/system") # for xorg::xrender if self.options.with_cairo: - self.requires("cairo/1.17.4") - self.requires("harfbuzz/5.1.0") - self.requires("glib/2.73.3") - self.requires("fribidi/1.0.12") + # "pango/pangocairo.h" includes "cairo.h" + self.requires("cairo/1.18.0", transitive_headers=True) + self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) + self.requires("fribidi/1.0.13") + # "pango/pango-coverage.h" includes "hb.h" + self.requires("harfbuzz/8.3.0", transitive_headers=True) - def source(self): - get(self, **self.conan_data["sources"][self.version], - strip_root=True, destination=self._source_subfolder) + def validate(self): + if ( + self.settings.compiler == "gcc" + and Version(self.settings.compiler.version) < "5" + ): + raise ConanInvalidConfiguration(f"{self.name} does not support GCC before version 5. Contributions are welcome.") + + if self.options.get_safe("with_xft"): + if not self.options.with_freetype or not self.options.with_fontconfig: + raise ConanInvalidConfiguration(f"-o=&:with_xft=True requires -o=&:with_freetype=True and -o=&:with_fontconfig=True") + + if self.dependencies["glib"].options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration( + "Linking shared glib with the MSVC static runtime is not supported" + ) - def _configure_meson(self): - defs = {} - defs["introspection"] = "disabled" + # Can't be turned off outside Macos/Windows + # https://gitlab.gnome.org/GNOME/pango/-/blob/1.54.0/meson.build#L240 + if self.settings.os not in ["Macos", "Windows"] and not self.options.with_fontconfig: + raise ConanInvalidConfiguration(f"{self.ref} requires -o=&:with_fontconfig=True for {self.settings.os}") - defs["libthai"] = "enabled" if self.options.with_libthai else "disabled" - defs["cairo"] = "enabled" if self.options.with_cairo else "disabled" - defs["xft"] = "enabled" if self.options.with_xft else "disabled" - defs["fontconfig"] = "enabled" if self.options.with_fontconfig else "disabled" - defs["freetype"] = "enabled" if self.options.with_freetype else "disabled" + if (self.options.with_fontconfig and self.options.with_freetype + and self.options.with_cairo and not self.dependencies["cairo"].options.with_fontconfig): + raise ConanInvalidConfiguration(f"{self.ref} with -o=&:with_fontconfig=True and -o=&:with_freetype=True requires -o=cairo/*:with_fontconfig=True") - meson = Meson(self) - meson.configure(build_folder=self._build_subfolder, source_folder=self._source_subfolder, defs=defs, args=['--wrap-mode=nofallback']) - return meson + if self.options.shared: + if not self.dependencies["glib"].options.shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static glib can cause unexpected behaviour." + ) + if not self.dependencies["harfbuzz"].options.shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static harfbuzz can cause unexpected behaviour." + ) + if self.options.with_cairo and not self.dependencies["cairo"].options.shared: + raise ConanInvalidConfiguration( + "Linking a shared library against static cairo can cause unexpected behaviour." + ) - def build(self): - meson_build = os.path.join(self._source_subfolder, "meson.build") + def build_requirements(self): + self.tool_requires("glib/") + self.tool_requires("meson/[>=1.2.3 <2]") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + if self.options.with_introspection: + self.tool_requires("gobject-introspection/1.78.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + + deps = PkgConfigDeps(self) + if self.options.with_introspection: + # gnome.generate_gir() in Meson looks for gobject-introspection-1.0.pc + deps.build_context_activated = ["gobject-introspection"] + deps.generate() + + enabled_disabled = lambda opt: "enabled" if opt else "disabled" + tc = MesonToolchain(self) + tc.project_options["introspection"] = enabled_disabled(self.options.with_introspection) + tc.project_options["libthai"] = enabled_disabled(self.options.with_libthai) + tc.project_options["cairo"] = enabled_disabled(self.options.with_cairo) + tc.project_options["xft"] = enabled_disabled(self.options.get_safe("with_xft")) + tc.project_options["fontconfig"] = enabled_disabled(self.options.with_fontconfig) + tc.project_options["freetype"] = enabled_disabled(self.options.with_freetype) + tc.generate() + + def _patch_sources(self): + meson_build = os.path.join(self.source_folder, "meson.build") replace_in_file(self, meson_build, "subdir('tests')", "") replace_in_file(self, meson_build, "subdir('tools')", "") replace_in_file(self, meson_build, "subdir('utils')", "") replace_in_file(self, meson_build, "subdir('examples')", "") - with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if is_msvc(self) else tools.no_op(): - meson = self._configure_meson() - meson.build() - def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - with tools.environment_append(VisualStudioBuildEnvironment(self).vars) if is_msvc(self) else tools.no_op(): - meson = self._configure_meson() - meson.install() + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def _fix_library_names(self, path): if is_msvc(self): - with chdir(self, os.path.join(self.package_folder, "lib")): + with chdir(self, path): for filename_old in glob.glob("*.a"): filename_new = filename_old[3:-2] + ".lib" self.output.info(f"rename {filename_old} into {filename_new}") rename(self, filename_old, filename_new) + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + self._fix_library_names(os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.pdb", self.package_folder, recursive=True) + if self.options.with_introspection: + os.rename(os.path.join(self.package_folder, "share"), + os.path.join(self.package_folder, "res")) def package_info(self): - self.cpp_info.components['pango_'].libs = ['pango-1.0'] - self.cpp_info.components['pango_'].names['pkg_config'] = 'pango' - if self.settings.os in ["Linux","FreeBSD"]: - self.cpp_info.components['pango_'].system_libs.append("m") - self.cpp_info.components['pango_'].requires.append('glib::glib-2.0') - self.cpp_info.components['pango_'].requires.append('glib::gobject-2.0') - self.cpp_info.components['pango_'].requires.append('glib::gio-2.0') - self.cpp_info.components['pango_'].requires.append('fribidi::fribidi') - self.cpp_info.components['pango_'].requires.append('harfbuzz::harfbuzz') + self.cpp_info.components["pango_"].libs = ["pango-1.0"] + self.cpp_info.components["pango_"].set_property("pkg_config_name", "pango") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["pango_"].system_libs.append("m") + self.cpp_info.components["pango_"].requires.append("glib::glib-2.0") + self.cpp_info.components["pango_"].requires.append("glib::gobject-2.0") + self.cpp_info.components["pango_"].requires.append("glib::gio-2.0") + self.cpp_info.components["pango_"].requires.append("fribidi::fribidi") + self.cpp_info.components["pango_"].requires.append("harfbuzz::harfbuzz") if self.options.with_fontconfig: - self.cpp_info.components['pango_'].requires.append('fontconfig::fontconfig') - + self.cpp_info.components["pango_"].requires.append("fontconfig::fontconfig") - if self.options.with_xft: - self.cpp_info.components['pango_'].requires.append('libxft::libxft') - # Pango only uses xrender when Xft, fontconfig and freetype are enabled - if self.options.with_fontconfig and self.options.with_freetype: - self.cpp_info.components['pango_'].requires.append('xorg::xrender') + if self.options.get_safe("with_xft"): + # Pango only uses xrender when Xft, fontconfig and freetype are enabled, which if with_xft is true, + # means that the other options are true because they are checked in the validate() method + self.cpp_info.components["pango_"].requires.extend(["libxft::libxft", "xorg::xrender"]) if self.options.with_cairo: - self.cpp_info.components['pango_'].requires.append('cairo::cairo_') - self.cpp_info.components['pango_'].includedirs = [os.path.join(self.package_folder, "include", "pango-1.0")] - - if self.options.with_freetype: - self.cpp_info.components['pangoft2'].libs = ['pangoft2-1.0'] - self.cpp_info.components['pangoft2'].names['pkg_config'] = 'pangoft2' - self.cpp_info.components['pangoft2'].requires = ['pango_', 'freetype::freetype'] - self.cpp_info.components['pangoft2'].includedirs = [os.path.join(self.package_folder, "include", "pango-1.0")] + self.cpp_info.components["pango_"].requires.append("cairo::cairo_") + self.cpp_info.components["pango_"].includedirs = [ + os.path.join(self.package_folder, "include", "pango-1.0") + ] + + if self.options.with_introspection: + self.cpp_info.components["pango_"].resdirs = ["res"] + self.buildenv_info.append_path("GI_GIR_PATH", os.path.join(self.package_folder, "res", "gir-1.0")) + self.buildenv_info.append_path("GI_TYPELIB_PATH", os.path.join(self.package_folder, "lib", "girepository-1.0")) + self.env_info.GI_GIR_PATH.append(os.path.join(self.package_folder, "res", "gir-1.0")) + self.env_info.GI_TYPELIB_PATH.append(os.path.join(self.package_folder, "lib", "girepository-1.0")) + + # From meson.build: "To build pangoft2, we need HarfBuzz, FontConfig and FreeType" + if self.options.with_freetype and self.options.with_fontconfig: + self.cpp_info.components["pangoft2"].libs = ["pangoft2-1.0"] + self.cpp_info.components["pangoft2"].set_property("pkg_config_name", "pangoft2") + self.cpp_info.components["pangoft2"].requires = [ + "pango_", + "freetype::freetype", + "fontconfig::fontconfig", + ] + self.cpp_info.components["pangoft2"].includedirs = [ + os.path.join(self.package_folder, "include", "pango-1.0") + ] + + # https://gitlab.gnome.org/GNOME/pango/-/blob/1.54.0/meson.build#L320 + self.cpp_info.components["pango_"].requires.append("freetype::freetype") if self.options.with_fontconfig: - self.cpp_info.components['pangofc'].names['pkg_config'] = 'pangofc' + self.cpp_info.components["pangofc"].set_property("pkg_config_name", "pangofc") if self.options.with_freetype: - self.cpp_info.components['pangofc'].requires = ['pangoft2'] + # pangoft2 is always built if pango has fontconfig and freetype support + self.cpp_info.components["pangofc"].requires = ["freetype::freetype", "harfbuzz::harfbuzz", "pangoft2"] + elif self.options.with_freetype: + self.cpp_info.components["pango_"].requires.append("freetype::freetype") if self.settings.os != "Windows": - self.cpp_info.components['pangoroot'].names['pkg_config'] = 'pangoroot' + self.cpp_info.components["pangoroot"].set_property("pkg_config_name", "pangoroot") if self.options.with_freetype: - self.cpp_info.components['pangoroot'].requires = ['pangoft2'] - - if self.options.with_xft: - self.cpp_info.components['pangoxft'].libs = ['pangoxft-1.0'] - self.cpp_info.components['pangoxft'].names['pkg_config'] = 'pangoxft' - self.cpp_info.components['pangoxft'].requires = ['pango_', 'pangoft2'] - self.cpp_info.components['pangoxft'].includedirs = [os.path.join(self.package_folder, "include", "pango-1.0")] + self.cpp_info.components["pangoroot"].requires = ["pangoft2"] + + if self.options.get_safe("with_xft"): + self.cpp_info.components["pangoxft"].libs = ["pangoxft-1.0"] + self.cpp_info.components["pangoxft"].set_property("pkg_config_name", "pangoxft") + # pangoft2 is always built if pango has fontconfig and freetype support, + # which is always true if pango has xft support enabled + self.cpp_info.components["pangoxft"].requires = ["pango_", "pangoft2"] + self.cpp_info.components["pangoxft"].includedirs = [ + os.path.join(self.package_folder, "include", "pango-1.0") + ] if self.settings.os == "Windows": - self.cpp_info.components['pangowin32'].libs = ['pangowin32-1.0'] - self.cpp_info.components['pangowin32'].names['pkg_config'] = 'pangowin32' - self.cpp_info.components['pangowin32'].requires = ['pango_'] - self.cpp_info.components['pangowin32'].system_libs.append('gdi32') + self.cpp_info.components["pangowin32"].libs = ["pangowin32-1.0"] + self.cpp_info.components["pangowin32"].set_property("pkg_config_name", "pangowin32") + self.cpp_info.components["pangowin32"].requires = ["pango_"] + self.cpp_info.components["pangowin32"].system_libs.append("gdi32") + if Version(self.version) >= "1.50.12": + self.cpp_info.components["pangowin32"].system_libs.append("dwrite") + + if is_apple_os(self): + # https://gitlab.gnome.org/GNOME/pango/-/blob/1.54.0/meson.build#L333-346 + self.cpp_info.components["pango_"].frameworks.extend(["CoreText", "CoreFoundation", "ApplicationServices"]) if self.options.with_cairo: - self.cpp_info.components['pangocairo'].libs = ['pangocairo-1.0'] - self.cpp_info.components['pangocairo'].names['pkg_config'] = 'pangocairo' - self.cpp_info.components['pangocairo'].requires = ['pango_'] - if self.options.with_freetype: - self.cpp_info.components['pangocairo'].requires.append('pangoft2') + self.cpp_info.components["pangocairo"].libs = ["pangocairo-1.0"] + self.cpp_info.components["pangocairo"].set_property("pkg_config_name", "pangocairo") + self.cpp_info.components["pangocairo"].requires = ["pango_", "cairo::cairo_"] + if self.options.with_freetype and self.options.with_fontconfig: + # https://gitlab.gnome.org/GNOME/pango/-/blob/1.54.0/meson.build#L506 + self.cpp_info.components["pangocairo"].requires.append("pangoft2") if self.settings.os == "Windows": - self.cpp_info.components['pangocairo'].requires.append('pangowin32') - self.cpp_info.components['pangocairo'].system_libs.append('gdi32') - self.cpp_info.components['pangocairo'].includedirs = [os.path.join(self.package_folder, "include", "pango-1.0")] - - self.env_info.PATH.append(os.path.join(self.package_folder, 'bin')) - - def package_id(self): - if not self.options["glib"].shared: - self.info.requires["glib"].full_package_mode() - if not self.options["harfbuzz"].shared: - self.info.requires["harfbuzz"].full_package_mode() - if self.options.with_cairo and not self.options["cairo"].shared: - self.info.requires["cairo"].full_package_mode() + self.cpp_info.components["pangocairo"].requires.append("pangowin32") + self.cpp_info.components["pangocairo"].system_libs.append("gdi32") + self.cpp_info.components["pangocairo"].includedirs = [ + os.path.join(self.package_folder, "include", "pango-1.0") + ] + + self.runenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) + + # TODO: remove the following when only Conan 2.0 is supported + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.cpp_info.components["pango_"].names["pkg_config"] = "pango" + self.cpp_info.components["pangoft2"].names["pkg_config"] = "pangoft2" + self.cpp_info.components["pangofc"].names["pkg_config"] = "pangofc" + self.cpp_info.components["pangoroot"].names["pkg_config"] = "pangoroot" + self.cpp_info.components["pangoxft"].names["pkg_config"] = "pangoxft" + self.cpp_info.components["pangowin32"].names["pkg_config"] = "pangowin32" + self.cpp_info.components["pangocairo"].names["pkg_config"] = "pangocairo" diff --git a/recipes/pango/all/test_package/CMakeLists.txt b/recipes/pango/all/test_package/CMakeLists.txt index 6b2859c25bddd..c990922a0544d 100644 --- a/recipes/pango/all/test_package/CMakeLists.txt +++ b/recipes/pango/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) -find_package(pango) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(pango REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} pango::pango) +target_link_libraries(${PROJECT_NAME} PRIVATE pango::pango) diff --git a/recipes/pango/all/test_package/conanfile.py b/recipes/pango/all/test_package/conanfile.py index baecd8fdba2aa..ef5d7042163ec 100644 --- a/recipes/pango/all/test_package/conanfile.py +++ b/recipes/pango/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", "pkg_config", "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/pango/all/test_package/test_package.cpp b/recipes/pango/all/test_package/test_package.cpp index 17022445e9087..20094deaf7d4c 100644 --- a/recipes/pango/all/test_package/test_package.cpp +++ b/recipes/pango/all/test_package/test_package.cpp @@ -3,6 +3,6 @@ int main() { - std::cout << "pango version: " << pango_version_string() << std::endl; + std::cout << "pango version: " << pango_version_string() << "\n"; return 0; } diff --git a/recipes/pango/config.yml b/recipes/pango/config.yml index 40891312baffc..2d198a63c6b11 100644 --- a/recipes/pango/config.yml +++ b/recipes/pango/config.yml @@ -1,11 +1,17 @@ versions: - "1.48.9": + "1.54.0": folder: all - "1.49.3": + "1.51.0": folder: all - "1.50.7": + "1.50.14": + folder: all + "1.50.10": folder: all "1.50.8": folder: all - "1.50.10": + "1.50.7": + folder: all + "1.49.3": + folder: all + "1.48.9": folder: all diff --git a/recipes/pangomm/all/test_package/CMakeLists.txt b/recipes/pangomm/all/test_package/CMakeLists.txt index 52162944c94e0..82b457522ee69 100644 --- a/recipes/pangomm/all/test_package/CMakeLists.txt +++ b/recipes/pangomm/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/panzi-portable-endian/all/test_v1_package/CMakeLists.txt b/recipes/panzi-portable-endian/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/panzi-portable-endian/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index abcaeed3f89b6..0000000000000 --- a/recipes/panzi-portable-endian/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/parallel-hashmap/all/conandata.yml b/recipes/parallel-hashmap/all/conandata.yml index 3e06bdb26e652..c5ea963d51bb4 100644 --- a/recipes/parallel-hashmap/all/conandata.yml +++ b/recipes/parallel-hashmap/all/conandata.yml @@ -1,18 +1,30 @@ sources: + "2.0.0": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v2.0.0.tar.gz" + sha256: "4f462f51a3468166ea4cf87c80e001dc1999093264cf55cbda3492ca39a7730b" + "1.4.1": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.4.1.tar.gz" + sha256: "949874f4207b8735422438b23b884fb1f4b926689bb5eebff38cc4d357d09cd2" + "1.4.0": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.4.0.tar.gz" + sha256: "766e05d19c27d9c09e6f9a627868daf451f4fbdd1b617f1bb875fb9402bfb78b" + "1.3.12": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.3.12.tar.gz" + sha256: "0cc203144321924cfbfcc401f42d8204c0dd24e2760c7a1c091baa16d9777c08" "1.3.11": url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.3.11.tar.gz" sha256: "0515a681bfb24207013786a7737e9d8561302e656689d8a65ea480bbabab460f" "1.3.8": - url: "https://github.com/greg7mdp/parallel-hashmap/archive/v1.3.8.tar.gz" + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v1.3.8.tar.gz" sha256: "c4562ea360dc1dcaddd96a0494c753400364a52c7aa9750de49d8e6a222d28d3" "1.37": - url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.37.tar.gz" + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/1.37.tar.gz" sha256: "2ac652be0552fcb53a1163c08c1f28f29f0756594fcc587eebb4d8b363153709" "1.36": url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/1.36.tar.gz" sha256: "33acf44158a9661a9d630d13f9250a2aa27a770cb3771df77b1ba1a661c0b766" "1.35": - url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.35.tar.gz" + url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/1.35.tar.gz" sha256: "308ab6f92e4c6f49304562e352890cf7140de85ce723c097e74fbdec88e0e1ce" "1.34": url: "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/1.34.tar.gz" diff --git a/recipes/parallel-hashmap/all/conanfile.py b/recipes/parallel-hashmap/all/conanfile.py index 5f3e3f51ac110..2714a6823c9e0 100644 --- a/recipes/parallel-hashmap/all/conanfile.py +++ b/recipes/parallel-hashmap/all/conanfile.py @@ -12,9 +12,9 @@ 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", "btree") - homepage = "https://github.com/greg7mdp/parallel-hashmap" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/greg7mdp/parallel-hashmap" + topics = ("parallel", "hashmap", "btree", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -32,9 +32,6 @@ def validate(self): 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, "*.h", src=os.path.join(self.source_folder, "parallel_hashmap"), diff --git a/recipes/parallel-hashmap/all/test_package/CMakeLists.txt b/recipes/parallel-hashmap/all/test_package/CMakeLists.txt index a67b28e572c3c..2f33182c5ab73 100644 --- a/recipes/parallel-hashmap/all/test_package/CMakeLists.txt +++ b/recipes/parallel-hashmap/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(phmap REQUIRED CONFIG) diff --git a/recipes/parallel-hashmap/all/test_v1_package/CMakeLists.txt b/recipes/parallel-hashmap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 35b992baf41ca..0000000000000 --- a/recipes/parallel-hashmap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(phmap REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE phmap) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/parallel-hashmap/all/test_v1_package/conanfile.py b/recipes/parallel-hashmap/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/parallel-hashmap/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_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/parallel-hashmap/config.yml b/recipes/parallel-hashmap/config.yml index a1c1439981d11..4753ecdf585c5 100644 --- a/recipes/parallel-hashmap/config.yml +++ b/recipes/parallel-hashmap/config.yml @@ -1,4 +1,12 @@ versions: + "2.0.0": + folder: all + "1.4.1": + folder: all + "1.4.0": + folder: all + "1.3.12": + folder: all "1.3.11": folder: all "1.3.8": diff --git a/recipes/parg/all/test_v1_package/CMakeLists.txt b/recipes/parg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/parg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 86f0279553123..0000000000000 --- a/recipes/parg/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", "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/parlayhash/all/conandata.yml b/recipes/parlayhash/all/conandata.yml new file mode 100644 index 0000000000000..de08f5cd6b860 --- /dev/null +++ b/recipes/parlayhash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1": + url: "https://github.com/cmuparlay/parlayhash/archive/refs/tags/v0.1.tar.gz" + sha256: "63dd2680de0291c8c4440fc3364490de0ee3cdea94b02b7449900bac18d66f2f" diff --git a/recipes/parlayhash/all/conanfile.py b/recipes/parlayhash/all/conanfile.py new file mode 100644 index 0000000000000..31571ac9475f2 --- /dev/null +++ b/recipes/parlayhash/all/conanfile.py @@ -0,0 +1,60 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import get, copy +from conan.tools.build import check_min_cppstd, check_max_cppstd +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=2.1" + + +class ParlayHashConan(ConanFile): + name = "parlayhash" + description = "A Header-Only Scalable Concurrent Hash Map." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/cmuparlay/parlayhash" + topics = ("unordered_map", "hashmap", "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): + check_min_cppstd(self, 17) + if self.settings.compiler in ["apple-clang", "clang"]: + if Version(self.settings.compiler.version) < "15": + # error: reference to local binding 'tag' declared in enclosing function 'parlay::parlay_hash::Find' + raise ConanInvalidConfiguration(f"Can't be used with {self.settings.compiler} < 15, lacks proper C++17 support") + else: + # error: no type named 'result_of' in namespace 'std' + check_max_cppstd(self, 17) + if self.settings.compiler == "msvc": + # error C3861: '__builtin_prefetch': identifier not found + raise ConanInvalidConfiguration("Can't be used with msvc") + + 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="*.h", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"), excludes=[".#hash_table.h"]) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + # This one is a best-effort guess, as the library is header-only it does not mention a target explicitly + self.cpp_info.set_property("cmake_file_name", "parlayhash") + self.cpp_info.set_property("cmake_target_name", "parlay") diff --git a/recipes/parlayhash/all/test_package/CMakeLists.txt b/recipes/parlayhash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f80a2014b8d8 --- /dev/null +++ b/recipes/parlayhash/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(parlayhash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE parlay) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/parlayhash/all/test_package/conanfile.py b/recipes/parlayhash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/parlayhash/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/parlayhash/all/test_package/test_package.cpp b/recipes/parlayhash/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ef0535573eaaf --- /dev/null +++ b/recipes/parlayhash/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include "parlay_hash/unordered_map.h" + +using K = std::string; +using V = unsigned long; +using map_type = parlay::parlay_unordered_map; + +int main() { + map_type my_map(100); + my_map.Insert("sue", 1); + my_map.Insert("sam", 5); + + std::cout << "value before increment: " << *my_map.Find("sue") << std::endl; + auto increment = [] (std::optional v) -> V {return v.has_value() ? 1 + *v : 1;}; + my_map.Upsert("sue", increment); + std::cout << "value after increment: " << *my_map.Find("sue") << std::endl; + + std::cout << "size before remove: " << my_map.size() << std::endl; + my_map.Remove("sue"); + std::cout << "size after remove: " << my_map.size() << std::endl; + return 0; +} diff --git a/recipes/parlayhash/config.yml b/recipes/parlayhash/config.yml new file mode 100644 index 0000000000000..7a80eeb3e9b32 --- /dev/null +++ b/recipes/parlayhash/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1": + folder: all diff --git a/recipes/parson/all/test_package/CMakeLists.txt b/recipes/parson/all/test_package/CMakeLists.txt index b79634dc14200..6d4752ea40d15 100644 --- a/recipes/parson/all/test_package/CMakeLists.txt +++ b/recipes/parson/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(parson REQUIRED CONFIG) diff --git a/recipes/parson/all/test_v1_package/CMakeLists.txt b/recipes/parson/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/parson/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/parson/all/test_v1_package/conanfile.py b/recipes/parson/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/parson/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_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/patchelf/all/test_v1_package/conanfile.py b/recipes/patchelf/all/test_v1_package/conanfile.py deleted file mode 100644 index 7effccfd4383a..0000000000000 --- a/recipes/patchelf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,9 +0,0 @@ -from conans import ConanFile, CMake, tools - - -class TestPackageV1Conan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - - def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - self.run("patchelf --version", run_environment=True) diff --git a/recipes/pathie-cpp/all/conandata.yml b/recipes/pathie-cpp/all/conandata.yml new file mode 100644 index 0000000000000..4046bc50f2738 --- /dev/null +++ b/recipes/pathie-cpp/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "0.1.1": + url: "https://github.com/Quintus/pathie-cpp/archive/refs/tags/v0.1.1.tar.gz" + sha256: "7c2cca0c52ad80792bf6dbeb74213c1791fe9e599058765f5b81fd00f53eb2d3" +patches: + "0.1.1": + - patch_file: "patches/0.1.1-0001-fix-cmake.patch" + patch_description: "separate shtatic and shared build" + patch_type: "conan" + - patch_file: "patches/0.1.1-0002-fix-install-path.patch" + patch_description: "fix install path for windows shared build" + patch_type: "conan" diff --git a/recipes/pathie-cpp/all/conanfile.py b/recipes/pathie-cpp/all/conanfile.py new file mode 100644 index 0000000000000..95acb35802514 --- /dev/null +++ b/recipes/pathie-cpp/all/conanfile.py @@ -0,0 +1,85 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +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 PathieCppConan(ConanFile): + name = "pathie-cpp" + description = "Small C++ library for crossplatform Unicode path management" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Quintus/pathie-cpp" + topics = ("path", "unicode",) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_stream_replacement": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_stream_replacement": 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") + + 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["CMAKE_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["PATHIE_BUILD_STREAM_REPLACEMENTS"] = self.options.with_stream_replacement + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = 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): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.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, "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 = ["pathie"] + + self.cpp_info.set_property("cmake_file_name", "Pathie") + self.cpp_info.set_property("cmake_target_name", "Pathie::Pathie") + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("shlwapi") + + if is_apple_os(self): + self.cpp_info.system_libs.append("iconv") diff --git a/recipes/pathie-cpp/all/patches/0.1.1-0001-fix-cmake.patch b/recipes/pathie-cpp/all/patches/0.1.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..50f3218d3b0f1 --- /dev/null +++ b/recipes/pathie-cpp/all/patches/0.1.1-0001-fix-cmake.patch @@ -0,0 +1,47 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d765179..e31b54b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -116,12 +116,14 @@ file(GLOB_RECURSE test_sources + # Targets + + # Libraries ++if (NOT BUILD_SHARED_LIBS) + add_library(pathie STATIC ${pathie_sources}) + if(APPLE) + target_link_libraries(pathie iconv) + endif() ++endif() + +-if (CMAKE_BUILD_SHARED_LIBS) ++if (BUILD_SHARED_LIBS) + add_library(pathie-dynamic SHARED ${pathie_sources}) + set_target_properties(pathie-dynamic PROPERTIES OUTPUT_NAME pathie) + if(APPLE) +@@ -130,9 +132,10 @@ if (CMAKE_BUILD_SHARED_LIBS) + endif() + + if(WIN32) ++ if (NOT BUILD_SHARED_LIBS) + target_link_libraries(pathie shlwapi) +- +- if (CMAKE_BUILD_SHARED_LIBS) ++ endif() ++ if (BUILD_SHARED_LIBS) + target_link_libraries(pathie-dynamic shlwapi) + endif() + endif() +@@ -152,10 +155,12 @@ endif() + ######################################## + # Installation information + ++if (NOT BUILD_SHARED_LIBS) + install(TARGETS pathie + DESTINATION lib) ++endif() + +-if (CMAKE_BUILD_SHARED_LIBS) ++if (BUILD_SHARED_LIBS) + install(TARGETS pathie-dynamic + DESTINATION lib) + endif() diff --git a/recipes/pathie-cpp/all/patches/0.1.1-0002-fix-install-path.patch b/recipes/pathie-cpp/all/patches/0.1.1-0002-fix-install-path.patch new file mode 100644 index 0000000000000..fba8edf003ed6 --- /dev/null +++ b/recipes/pathie-cpp/all/patches/0.1.1-0002-fix-install-path.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e31b54b..bdf279e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -154,15 +154,19 @@ endif() + + ######################################## + # Installation information +- ++include(GNUInstallDirs) + if (NOT BUILD_SHARED_LIBS) + install(TARGETS pathie +- DESTINATION lib) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + if (BUILD_SHARED_LIBS) + install(TARGETS pathie-dynamic +- DESTINATION lib) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + install(FILES diff --git a/recipes/pathie-cpp/all/test_package/CMakeLists.txt b/recipes/pathie-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..00bc659fd0252 --- /dev/null +++ b/recipes/pathie-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Pathie REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Pathie::Pathie) diff --git a/recipes/pathie-cpp/all/test_package/conanfile.py b/recipes/pathie-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/pathie-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/pathie-cpp/all/test_package/test_package.cpp b/recipes/pathie-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..62d62074adb6a --- /dev/null +++ b/recipes/pathie-cpp/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +static bool callback(const Pathie::Path& entry) +{ + std::cout << entry << std::endl; + return true; +} + +int main() +{ + Pathie::Path dir("."); + dir.find(callback); + + return 0; +} diff --git a/recipes/pathie-cpp/config.yml b/recipes/pathie-cpp/config.yml new file mode 100644 index 0000000000000..b893ff21f7c23 --- /dev/null +++ b/recipes/pathie-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.1": + folder: all diff --git a/recipes/pbc/all/conandata.yml b/recipes/pbc/all/conandata.yml index af6c41c5d370b..3a82e91b4ea31 100644 --- a/recipes/pbc/all/conandata.yml +++ b/recipes/pbc/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "0.5.14": - patch_file: "patches/0.5.14-0001-fix-config-sub-ios.patch" - base_path: "" diff --git a/recipes/pbc/all/conanfile.py b/recipes/pbc/all/conanfile.py index cef849369307b..2de63fee00601 100644 --- a/recipes/pbc/all/conanfile.py +++ b/recipes/pbc/all/conanfile.py @@ -1,22 +1,40 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import XCRun, to_apple_arch, 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, copy, export_conandata_patches, get, rm, rmdir, chdir +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 PbcConan(ConanFile): name = "pbc" - topics = ("pbc", "crypto", "cryptography", "security", "pairings", "cryptographic") + description = ("The PBC (Pairing-Based Crypto) library is a C library providing " + "low-level routines for pairing-based cryptosystems.") + license = "LGPL-3.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://crypto.stanford.edu/pbc/" - license = "LGPL-3.0" - description = "The PBC (Pairing-Based Crypto) library is a C library providing low-level routines for pairing-based cryptosystems." + topics = ("crypto", "cryptography", "security", "pairings", "cryptographic") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - _autotools = None - exports_sources = "patches/**" + 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": @@ -24,75 +42,68 @@ 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): - self.requires("gmp/6.2.1") + self.requires("gmp/6.3.0", transitive_headers=True, transitive_libs=True) - def build_requirements(self): - self.build_requires("bison/3.7.6") - self.build_requires("flex/2.6.4") + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration("pbc is not compatible with MSVC due to use of GNU extensions") - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + def build_requirements(self): + 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) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment( - self, win_bash=tools.os_info.is_windows - ) - # Need to override environment or configure will fail despite that flex - # is actually available. - args = ["LEX=flex"] - if self.options.shared: - args.extend(["--disable-static", "--enable-shared"]) - else: - args.extend(["--disable-shared", "--enable-static"]) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - # No idea why this is necessary, but if you don't set CC this way, then - # configure complains that it can't find gmp. - if ( - tools.cross_building(self.settings) - and self.settings.compiler == "apple-clang" - ): + def generate(self): + env = VirtualBuildEnv(self) + env.generate() - xcr = tools.XCRun(self.settings) - target = tools.to_apple_arch(self.settings.arch) + "-apple-darwin" + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.configure_args.append("LEX=flex") + # No idea why this is necessary, but if you don't set CC this way, then + # configure complains that it can't find gmp. + if cross_building(self) and self.settings.compiler == "apple-clang": + xcr = XCRun(self) + target = to_apple_arch(self) + "-apple-darwin" min_ios = "" if self.settings.os == "iOS": - min_ios = "-miphoneos-version-min={}".format(self.settings.os.version) - - args.append( - "CC={} -isysroot {} -target {} {}".format( - xcr.cc, xcr.sdk_path, target, min_ios - ) - ) + min_ios = f"-miphoneos-version-min={self.settings.os.version}" + tc.configure_args.append(f"CC={xcr.cc} -isysroot {xcr.sdk_path} -target {target} {min_ios}") + tc.generate() - self._autotools.configure(args=args) - return self._autotools + deps = AutotoolsDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + autotools.make() def package(self): - self.copy(pattern="COPYING", dst="licenses") - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") + copy(self, "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")) + rm(self, "*.la", self.package_folder, recursive=True) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["pbc"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] diff --git a/recipes/pbc/all/test_package/CMakeLists.txt b/recipes/pbc/all/test_package/CMakeLists.txt index c67cb318985e8..a724a29a8da1f 100644 --- a/recipes/pbc/all/test_package/CMakeLists.txt +++ b/recipes/pbc/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(pbc CONFIG REQUIRED) +find_package(pbc REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} pbc::pbc) diff --git a/recipes/pbc/all/test_package/conanfile.py b/recipes/pbc/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/pbc/all/test_package/conanfile.py +++ b/recipes/pbc/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/pbtools/all/conanfile.py b/recipes/pbtools/all/conanfile.py index 8ae53d392140a..f47231b2af175 100644 --- a/recipes/pbtools/all/conanfile.py +++ b/recipes/pbtools/all/conanfile.py @@ -1,12 +1,13 @@ import os from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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 = ">=2.1" class PbtoolsConan(ConanFile): @@ -47,6 +48,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.47.0": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): diff --git a/recipes/pbtools/all/test_v1_package/CMakeLists.txt b/recipes/pbtools/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/pbtools/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 1ed584307b354..0000000000000 --- a/recipes/pbtools/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,25 +0,0 @@ -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/pcapplusplus/all/conanfile.py b/recipes/pcapplusplus/all/conanfile.py index 398650c106206..f71da3f7d3ac9 100644 --- a/recipes/pcapplusplus/all/conanfile.py +++ b/recipes/pcapplusplus/all/conanfile.py @@ -7,6 +7,7 @@ from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, unix_path, MSBuild, MSBuildToolchain +from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration required_conan_version = ">=1.57.0" @@ -43,7 +44,7 @@ def layout(self): def requirements(self): if self.settings.os == "Windows": self.requires("npcap/1.70") - if self.version < "22.11": + if Version(self.version) < "22.11": self.requires("pthreads4w/3.0.0") else: self.requires("libpcap/1.10.1") @@ -85,6 +86,7 @@ def _patch_sources(self): # so that we have precedence over PlatformToolset version replace_in_file(self, template_file, '', f'\n') + replace_in_file(self, template_file, "true", "false") def generate(self): if self.settings.os == "Windows": @@ -122,7 +124,7 @@ def _build_windows(self): "--pcap-sdk", self.dependencies["npcap"].package_folder, "--vs-version", "vs2015", # this will be later overridden by the props file generated by MSBuildToolchain ] - if self.version < "22.11": + if Version(self.version) < "22.11": config_args += ["--pthreads-home", self.dependencies["pthreads4w"].package_folder] self.run(" ".join(config_args), env="conanbuild") msbuild = MSBuild(self) @@ -137,9 +139,9 @@ def package(self): def package_info(self): self.cpp_info.libs = ["Pcap++", "Packet++", "Common++"] - if self.version < "22.11" and self.settings.os in ("FreeBSD", "Linux"): + if Version(self.version) < "22.11" and self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs.append("pthread") if self.settings.os == "Macos": self.cpp_info.frameworks.extend(["CoreFoundation", "Security", "SystemConfiguration"]) if self.settings.os == "Windows": - self.cpp_info.system_libs = ["ws2_32"] + self.cpp_info.system_libs = ["ws2_32", "iphlpapi"] diff --git a/recipes/pcapplusplus/all/patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch b/recipes/pcapplusplus/all/patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch index 9f23a37847f60..507cb1098ab2f 100644 --- a/recipes/pcapplusplus/all/patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch +++ b/recipes/pcapplusplus/all/patches/0001-Pass-CXXFLAGS-CPPFLAGS-when-compiling-3rd-party-sour.patch @@ -5,7 +5,7 @@ Obj/%.o: LightPcapNg/src/%.c @echo Building file: $< - @$(CC) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<" -+ @$(CC) $(CPPFLAGS) $(CLFAGS) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<" ++ @$(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<" CUR_TARGET := $(notdir $(shell pwd)) diff --git a/recipes/pcapplusplus/all/test_package/CMakeLists.txt b/recipes/pcapplusplus/all/test_package/CMakeLists.txt index 8c5f8b3c73c1f..22f84c5d25a42 100644 --- a/recipes/pcapplusplus/all/test_package/CMakeLists.txt +++ b/recipes/pcapplusplus/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(pcapplusplus REQUIRED CONFIG) diff --git a/recipes/pcapplusplus/all/test_v1_package/CMakeLists.txt b/recipes/pcapplusplus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/pcapplusplus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pcapplusplus/all/test_v1_package/conanfile.py b/recipes/pcapplusplus/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/pcapplusplus/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/pcapplusplus/cmake/conandata.yml b/recipes/pcapplusplus/cmake/conandata.yml index 26ff7631cb671..ea13a0a560ea1 100644 --- a/recipes/pcapplusplus/cmake/conandata.yml +++ b/recipes/pcapplusplus/cmake/conandata.yml @@ -2,3 +2,6 @@ sources: "23.09": url: "https://github.com/seladb/PcapPlusPlus/archive/v23.09.tar.gz" sha256: "608292f7d2a2e1b7af26adf89347597a6131547eea4e513194bc4f584a40fe74" + "24.09": + url: "https://github.com/seladb/PcapPlusPlus/archive/v24.09.tar.gz" + sha256: "b14998ecf5718c2bfb6f709060e53f7ef67639b98bf2222a3cd23d820d70acdc" diff --git a/recipes/pcapplusplus/cmake/conanfile.py b/recipes/pcapplusplus/cmake/conanfile.py index e1a985494deda..cea459f86eeb8 100644 --- a/recipes/pcapplusplus/cmake/conanfile.py +++ b/recipes/pcapplusplus/cmake/conanfile.py @@ -1,30 +1,39 @@ import os from conan import ConanFile +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout -from conan.tools.files import copy, get, rmdir +from conan.tools.files import copy, get, rmdir, replace_in_file +from conan.tools.scm import Version 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" + package_type = "library" options = { - "immediate_mode": [True, False], "fPIC": [True, False], + "shared": [True, False], + "immediate_mode": [True, False], } default_options = { - "immediate_mode": False, "fPIC": True, + "shared": False, + "immediate_mode": False, } + @property + def _min_cppstd(self): + return 11 + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -34,11 +43,26 @@ def requirements(self): self.requires("npcap/1.70") else: self.requires("libpcap/1.10.1") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") def validate(self): + if Version(self.version) <= "24.09" and self.options.shared and self.settings.os == "Windows": + # https://github.com/seladb/PcapPlusPlus/issues/1396 + raise ConanInvalidConfiguration(f"{self.ref} does not support Windows shared builds for now") + if self.settings.compiler.cppstd: + # popen()/pclose() usage + check_min_cppstd(self, self._min_cppstd) if self.settings.os not in ("FreeBSD", "Linux", "Macos", "Windows"): raise ConanInvalidConfiguration(f"{self.settings.os} is not supported") + def validate_build(self): + compiler_version = Version(self.settings.compiler.version) + if self.settings.compiler == "gcc" and compiler_version < "5.1": + raise ConanInvalidConfiguration("PcapPlusPlus requires GCC >= 5.1") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -46,12 +70,25 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["PCAPPP_BUILD_TESTS"] = False tc.variables["PCAPPP_BUILD_EXAMPLES"] = False + tc.variables["BUILD_SHARED_LIBS"] = self.options.shared + if not self.settings.compiler.cppstd: + tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd tc.generate() def layout(self): cmake_layout(self, src_folder="src") + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD 11)", + "") + if Version(self.version) >= "24.09": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", + "") + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -69,5 +106,7 @@ def package_info(self): self.cpp_info.frameworks = ["CoreFoundation", "SystemConfiguration"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32", "iphlpapi"] + elif self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs = ["pthread"] 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 index d30ed5e5eaa78..e3f8b5da8c8b8 100644 --- a/recipes/pcapplusplus/cmake/test_package/CMakeLists.txt +++ b/recipes/pcapplusplus/cmake/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(PcapPlusPlus REQUIRED CONFIG) diff --git a/recipes/pcapplusplus/config.yml b/recipes/pcapplusplus/config.yml index d89c980a8be55..7a6e7c1c1ffa6 100644 --- a/recipes/pcapplusplus/config.yml +++ b/recipes/pcapplusplus/config.yml @@ -9,3 +9,5 @@ versions: folder: all "23.09": folder: cmake + "24.09": + folder: cmake diff --git a/recipes/pcg-cpp/all/test_package/CMakeLists.txt b/recipes/pcg-cpp/all/test_package/CMakeLists.txt index 55749779d0824..02c4ade84cb62 100644 --- a/recipes/pcg-cpp/all/test_package/CMakeLists.txt +++ b/recipes/pcg-cpp/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(pcg-cpp REQUIRED CONFIG) diff --git a/recipes/pcg-cpp/all/test_v1_package/CMakeLists.txt b/recipes/pcg-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index d1cca9abb1563..0000000000000 --- a/recipes/pcg-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(pcg-cpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE pcg-cpp::pcg-cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/pcg-cpp/all/test_v1_package/conanfile.py b/recipes/pcg-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/pcg-cpp/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_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/pciutils/all/conandata.yml b/recipes/pciutils/all/conandata.yml index 01d5f5a0e9de5..8cdf113d7ef73 100644 --- a/recipes/pciutils/all/conandata.yml +++ b/recipes/pciutils/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.12.0": + url: "https://github.com/pciutils/pciutils/archive/v3.12.0.tar.gz" + sha256: "3a76ca02581fed03d0470ba822e72ee06e492442a990062f9638dec90018505f" + "3.10.0": + url: "https://github.com/pciutils/pciutils/archive/v3.10.0.tar.gz" + sha256: "e579d87f1afe2196db7db648857023f80adb500e8194c4488c8b47f9a238c1c6" "3.7.0": - sha256: ea768aa0187ba349391c6c157445ecc2b42e7d671fc1ce8c53ff5ef513f1e2ab - url: https://github.com/pciutils/pciutils/archive/v3.7.0.tar.gz + url: "https://github.com/pciutils/pciutils/archive/v3.7.0.tar.gz" + sha256: "ea768aa0187ba349391c6c157445ecc2b42e7d671fc1ce8c53ff5ef513f1e2ab" diff --git a/recipes/pciutils/all/conanfile.py b/recipes/pciutils/all/conanfile.py index 7de2b56523367..9e375262e618e 100644 --- a/recipes/pciutils/all/conanfile.py +++ b/recipes/pciutils/all/conanfile.py @@ -1,76 +1,128 @@ import os -from conans import ConanFile, tools, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration +import shutil + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import XCRun +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, copy, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class PciUtilsConan(ConanFile): name = "pciutils" - license = "BSD-3-Clause" description = "The PCI Utilities package contains a library for portable access to PCI bus" - topics = ("pci", "pci-bus", "hardware", "local-bus") - homepage = "https://github.com/pciutils/pciutils" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False], "with_zlib": [True, False], "with_udev": [True, False]} - default_options = {"shared": False, "fPIC": True, "with_zlib": True, "with_udev": False} + homepage = "https://github.com/pciutils/pciutils" + topics = ("pci", "pci-bus", "hardware", "local-bus") - @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_zlib": [True, False], + "with_udev": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_zlib": True, + "with_udev": True, + } - def configure(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration("Platform {} is currently not supported by this recipe".format(self.settings.os)) + 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 requirements(self): if self.options.with_zlib: - self.requires("zlib/1.2.11") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_udev: - # TODO: Enable libudev option when available - raise ConanInvalidConfiguration("libudev requires conan-io/conan-center-index#2468") - self.requires("systemd/system") + self.requires("libudev/system") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration( + f"Platform {self.settings.os} is currently not supported by this recipe" + ) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - tools.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _cc(self): + compilers_by_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict) + cxx = compilers_by_conf.get("c") or VirtualBuildEnv(self).vars().get("CC") + if cxx: + return cxx + if self.settings.compiler == "apple-clang": + return XCRun(self).cxx + compiler_version = str(self.settings.compiler.version) + major = compiler_version.split(".", 1)[0] + if self.settings.compiler == "gcc": + return shutil.which(f"gcc-{compiler_version}") or shutil.which(f"gcc-{major}") or shutil.which("gcc") or "" + if self.settings.compiler == "clang": + return shutil.which(f"clang-{compiler_version}") or shutil.which(f"clang-{major}") or shutil.which("clang") or "" + return "" - def _make(self, targets): + def generate(self): yes_no = lambda v: "yes" if v else "no" - autotools = AutoToolsBuildEnvironment(self) - autotools.make(args=["SHARED={}".format(yes_no(self.options.shared)), - "ZLIB={}".format(yes_no(self.options.with_zlib)), - "HWDB={}".format(yes_no(self.options.with_udev)), - "PREFIX={}".format(self.package_folder), - "OPT={}".format("{} {}".format( - autotools.vars["CPPFLAGS"], autotools.vars["CFLAGS"])), - "DNS=no"], - target=" ".join(targets)) + tc = AutotoolsToolchain(self) + tc.make_args = [ + f"SHARED={yes_no(self.options.shared)}", + f"ZLIB={yes_no(self.options.with_zlib)}", + f"HWDB={yes_no(self.options.with_udev)}", + f"DESTDIR={self.package_folder}", + "PREFIX=/", + "DNS=no", + f"CC={self._cc}", + ] + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() def build(self): - with tools.chdir(self._source_subfolder): - self._make(["all"]) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make(target="all") def package(self): - with tools.chdir(self._source_subfolder): - self._make(["install", "install-pcilib"]) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make(target="install") + autotools.make(target="install-pcilib") - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - self.copy("*.h", src=self._source_subfolder, dst="include", keep_path=True) + copy(self, "COPYING", + 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"), + keep_path=True) if self.options.shared: - tools.rename(src=os.path.join(self._source_subfolder, "lib", "libpci.so.3.7.0"), - dst=os.path.join(self.package_folder, "lib", "libpci.so")) + # libpci.so.3 -> libpci.so + with chdir(self, os.path.join(self.package_folder, "lib")): + os.symlink("libpci.so.3", "libpci.so") - tools.rmdir(os.path.join(self.package_folder, "sbin")) - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "man")) + 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, "man")) def package_info(self): - self.cpp_info.names["pkg_config"] = "libpci" + self.cpp_info.set_property("pkg_config_name", "libpci") self.cpp_info.libs = ["pci"] diff --git a/recipes/pciutils/all/test_package/CMakeLists.txt b/recipes/pciutils/all/test_package/CMakeLists.txt index 48b855b8a30aa..3d69747b2d1ec 100644 --- a/recipes/pciutils/all/test_package/CMakeLists.txt +++ b/recipes/pciutils/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(pciutils REQUIRED CONFIG) add_executable(example example.c) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example pciutils::pciutils) diff --git a/recipes/pciutils/all/test_package/conanfile.py b/recipes/pciutils/all/test_package/conanfile.py index 9f2b070b59136..8d52b7021efe1 100644 --- a/recipes/pciutils/all/test_package/conanfile.py +++ b/recipes/pciutils/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/pciutils/config.yml b/recipes/pciutils/config.yml index 20ddf579e6d44..358eb13a104b8 100644 --- a/recipes/pciutils/config.yml +++ b/recipes/pciutils/config.yml @@ -1,3 +1,7 @@ versions: + "3.12.0": + folder: all + "3.10.0": + folder: all "3.7.0": folder: all diff --git a/recipes/pcl/all/conandata.yml b/recipes/pcl/all/conandata.yml index 6eea92ef4a761..5adcb89e09fe0 100644 --- a/recipes/pcl/all/conandata.yml +++ b/recipes/pcl/all/conandata.yml @@ -4,16 +4,24 @@ sources: sha256: 8ab98a9db371d822de0859084a375a74bdc7f31c96d674147710cf4101b79621 patches: "1.13.1": - - patch_file: "patches/0001-cmake_use_conan_targets.patch" + - patch_file: "patches/1.13.1-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_file: "patches/1.13.1-0002-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_file: "patches/1.13.1-0003-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_file: "patches/1.13.1-0004-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" + - patch_file: "patches/1.13.1-0005-ply_parser-include-functional.patch" + patch_description: "Fix missing functional include in ply_parser.h" + patch_source: "https://github.com/PointCloudLibrary/pcl/pull/5964" + patch_type: "portability" + - patch_file: "patches/1.13.1-0006-Compatibility-with-clang-19.patch" + patch_description: "Compatibility with clang-19" + patch_source: "https://github.com/PointCloudLibrary/pcl/pull/6113" + patch_type: "portability" diff --git a/recipes/pcl/all/conanfile.py b/recipes/pcl/all/conanfile.py index 3d3a9f2fd7b3e..f22cfe52d2e6c 100644 --- a/recipes/pcl/all/conanfile.py +++ b/recipes/pcl/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.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 @@ -90,6 +91,7 @@ class PclConan(ConanFile): "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], + "use_sse": [True, False], } default_options = { "shared": False, @@ -150,6 +152,7 @@ class PclConan(ConanFile): # Enabled to avoid excessive memory usage during compilation in CCI "precompile_only_core_point_types": True, "add_build_type_postfix": False, + "use_sse": True, } short_paths = True @@ -212,7 +215,7 @@ def _ext_dep_to_conan_target(self, dep): "libusb": ["libusb::libusb"], "metslib": [], "opencv": ["opencv::opencv"], - "opengl": ["opengl::opengl", "freeglut::freeglut", "glew::glew", "glu::glu"], + "opengl": ["opengl::opengl", "freeglut::freeglut", "glew::glew", "glu::glu" if is_apple_os(self) or self.settings.os == "Windows" else "mesa-glu::mesa-glu"], "openni": [], "openni2": [], "pcap": ["libpcap::libpcap"], @@ -332,6 +335,8 @@ 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.use_sse def configure(self): if self.options.shared: @@ -366,7 +371,7 @@ def requirements(self): 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") + self.requires("libpng/[>=1.6 <2]") if self._is_enabled("qhull"): self.requires("qhull/8.0.1", transitive_headers=True) if self._is_enabled("qt"): @@ -380,7 +385,10 @@ def requirements(self): 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 is_apple_os(self) or self.settings.os == "Windows": + self.requires("glu/system", transitive_headers=True) + else: + self.requires("mesa-glu/9.0.3", transitive_headers=True) if self._is_enabled("opencv"): self.requires("opencv/4.8.1", transitive_headers=True) if self._is_enabled("zlib"): @@ -473,6 +481,8 @@ def generate(self): for comp in disabled: tc.cache_variables[f"BUILD_{comp}"] = False + tc.cache_variables["PCL_ENABLE_SSE"] = self.options.get_safe("use_sse", False) + tc.generate() deps = CMakeDeps(self) diff --git a/recipes/pcl/all/patches/0001-cmake_use_conan_targets.patch b/recipes/pcl/all/patches/1.13.1-0001-cmake_use_conan_targets.patch similarity index 100% rename from recipes/pcl/all/patches/0001-cmake_use_conan_targets.patch rename to recipes/pcl/all/patches/1.13.1-0001-cmake_use_conan_targets.patch diff --git a/recipes/pcl/all/patches/0001-fix-FindOpenNI-bug.patch b/recipes/pcl/all/patches/1.13.1-0002-fix-FindOpenNI-bug.patch similarity index 100% rename from recipes/pcl/all/patches/0001-fix-FindOpenNI-bug.patch rename to recipes/pcl/all/patches/1.13.1-0002-fix-FindOpenNI-bug.patch diff --git a/recipes/pcl/all/patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch b/recipes/pcl/all/patches/1.13.1-0003-Add-Eigen3-Eigen-target-in-pcl_common-target.patch similarity index 100% rename from recipes/pcl/all/patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch rename to recipes/pcl/all/patches/1.13.1-0003-Add-Eigen3-Eigen-target-in-pcl_common-target.patch diff --git a/recipes/pcl/all/patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch b/recipes/pcl/all/patches/1.13.1-0004-ReportFixAboutMemoryConsumptionDuringBuild.patch similarity index 100% rename from recipes/pcl/all/patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch rename to recipes/pcl/all/patches/1.13.1-0004-ReportFixAboutMemoryConsumptionDuringBuild.patch diff --git a/recipes/pcl/all/patches/1.13.1-0005-ply_parser-include-functional.patch b/recipes/pcl/all/patches/1.13.1-0005-ply_parser-include-functional.patch new file mode 100644 index 0000000000000..14a4a99db8a78 --- /dev/null +++ b/recipes/pcl/all/patches/1.13.1-0005-ply_parser-include-functional.patch @@ -0,0 +1,21 @@ +From 61b2e8e5336d7d8b0e1ae7c1168035faa083310b Mon Sep 17 00:00:00 2001 +From: Transporter +Date: Sun, 18 Feb 2024 10:38:12 +0100 +Subject: [PATCH] Fix missing include (#5962) + +--- + io/include/pcl/io/ply/ply_parser.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/io/include/pcl/io/ply/ply_parser.h b/io/include/pcl/io/ply/ply_parser.h +index 3023d566607..244f3719506 100644 +--- a/io/include/pcl/io/ply/ply_parser.h ++++ b/io/include/pcl/io/ply/ply_parser.h +@@ -49,6 +49,7 @@ + #include + #include + #include ++#include + #include // for lexical_cast + #include // for fold + #include // for inherit diff --git a/recipes/pcl/all/patches/1.13.1-0006-Compatibility-with-clang-19.patch b/recipes/pcl/all/patches/1.13.1-0006-Compatibility-with-clang-19.patch new file mode 100644 index 0000000000000..08291a0b2bf8f --- /dev/null +++ b/recipes/pcl/all/patches/1.13.1-0006-Compatibility-with-clang-19.patch @@ -0,0 +1,105 @@ +From 6f1105a4c30416a55196db048ef9759e22cdd04e Mon Sep 17 00:00:00 2001 +From: Markus Vieth +Date: Thu, 22 Aug 2024 20:48:19 +0200 +Subject: [PATCH 1/1] Compatibility with clang-19 + +--- + .../registration/correspondence_rejection_features.h | 6 +++--- + .../pcl/surface/3rdparty/poisson4/octree_poisson.hpp | 11 +++++++---- + .../pcl/surface/3rdparty/poisson4/sparse_matrix.hpp | 10 +++++++--- + 3 files changed, 17 insertions(+), 10 deletions(-) + +diff --git a/registration/include/pcl/registration/correspondence_rejection_features.h b/registration/include/pcl/registration/correspondence_rejection_features.h +index 44835c379..f3bab8fef 100644 +--- a/registration/include/pcl/registration/correspondence_rejection_features.h ++++ b/registration/include/pcl/registration/correspondence_rejection_features.h +@@ -269,9 +269,9 @@ protected: + // Check if the representations are valid + if (!feature_representation_->isValid(feat_src) || + !feature_representation_->isValid(feat_tgt)) { +- PCL_ERROR("[pcl::registration::%s::getCorrespondenceScore] Invalid feature " +- "representation given!\n", +- this->getClassName().c_str()); ++ PCL_ERROR( ++ "[pcl::registration::CorrespondenceRejectorFeatures::FeatureContainer::" ++ "getCorrespondenceScore] Invalid feature representation given!\n"); + return (std::numeric_limits::max()); + } + +diff --git a/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp b/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp +index 7ed8aaf9d..e7f45b650 100644 +--- a/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp ++++ b/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp +@@ -746,7 +746,10 @@ namespace pcl + Real temp,dist2; + if(!children){return this;} + for(int i=0;i child_center; ++ Real child_width; ++ children[i].centerAndWidth(child_center, child_width); ++ temp=SquareDistance(child_center,p); + if(!i || tempoffset[i] = node.offset[i];} ++ for(i=0;ioff[i] = node.off[i];} + if(node.children){ + initChildren(); + for(i=0;i + int OctNode::CompareForwardDepths(const void* v1,const void* v2){ +- return ((const OctNode*)v1)->depth-((const OctNode*)v2)->depth; ++ return ((const OctNode*)v1)->depth()-((const OctNode*)v2)->depth(); + } + + template< class NodeData , class Real > +@@ -874,7 +877,7 @@ namespace pcl + + template + int OctNode::CompareBackwardDepths(const void* v1,const void* v2){ +- return ((const OctNode*)v2)->depth-((const OctNode*)v1)->depth; ++ return ((const OctNode*)v2)->depth()-((const OctNode*)v1)->depth(); + } + + template +diff --git a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp +index 24f0a5402..5e54ac786 100644 +--- a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp ++++ b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp +@@ -228,14 +228,18 @@ namespace pcl + template + void SparseMatrix::SetZero() + { +- Resize(this->m_N, this->m_M); ++ // copied from operator *= ++ for (int i=0; i + void SparseMatrix::SetIdentity() + { + SetZero(); +- for(int ij=0; ij < Min( this->Rows(), this->Columns() ); ij++) ++ for(int ij=0; ij < std::min( rows, _maxEntriesPerRow ); ij++) + (*this)(ij,ij) = T(1); + } + +@@ -388,7 +392,7 @@ namespace pcl + T alpha,beta,rDotR; + int i; + +- solution.Resize(M.Columns()); ++ solution.Resize(bb.Dimensions()); + solution.SetZero(); + + d=r=bb; diff --git a/recipes/pcre/all/conandata.yml b/recipes/pcre/all/conandata.yml index 3ef6900fa4374..1eb2ff2373770 100644 --- a/recipes/pcre/all/conandata.yml +++ b/recipes/pcre/all/conandata.yml @@ -2,16 +2,6 @@ sources: "8.45": url: "https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.bz2" sha256: "4dae6fdcd2bb0bb6c37b5f97c33c2be954da743985369cddac3546e3218bffb8" - "8.44": - url: "https://sourceforge.net/projects/pcre/files/pcre/8.44/pcre-8.44.tar.bz2" - sha256: "19108658b23b3ec5058edc9f66ac545ea19f9537234be1ec62b714c84399366d" - "8.41": - url: "https://sourceforge.net/projects/pcre/files/pcre/8.41/pcre-8.41.tar.bz2" - sha256: "e62c7eac5ae7c0e7286db61ff82912e1c0b7a0c13706616e94a7dd729321b530" patches: "8.45": - patch_file: "patches/0001-fix-cmake-8.45.patch" - "8.44": - - patch_file: "patches/0001-fix-cmake-8.41.patch" - "8.41": - - patch_file: "patches/0001-fix-cmake-8.41.patch" diff --git a/recipes/pcre/all/conanfile.py b/recipes/pcre/all/conanfile.py index ca51bc38829c6..ef9e5d6af5798 100644 --- a/recipes/pcre/all/conanfile.py +++ b/recipes/pcre/all/conanfile.py @@ -106,8 +106,6 @@ def generate(self): tc.variables["PCRE_NO_RECURSE"] = not self.options.with_stack_for_recursion if is_msvc(self): tc.variables["PCRE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) - # Relocatable shared lib on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" # Honor BUILD_SHARED_LIBS since upstream CMakeLists overrides it as a CACHE variable. # Issue quite similar to https://github.com/conan-io/conan/issues/11840 tc.cache_variables["BUILD_SHARED_LIBS"] = "ON" if self.options.shared else "OFF" @@ -179,15 +177,9 @@ def package_info(self): self.cpp_info.components["libpcre32"].defines.append("PCRE_STATIC=1") if self.options.build_pcregrep: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) # FIXME: This is a workaround to avoid ConanException. zlib and bzip2 # are optional requirements of pcregrep executable, not of any pcre lib. if self.options.with_bzip2: self.cpp_info.components["libpcre"].requires.append("bzip2::bzip2") if self.options.with_zlib: self.cpp_info.components["libpcre"].requires.append("zlib::zlib") - - # TODO: to remove in conan v2 once legacy generators removed - # DO NOT port this name to cmake_file_name/cmake_target_name properties, it was a mistake - self.cpp_info.names["cmake_find_package"] = "PCRE" - self.cpp_info.names["cmake_find_package_multi"] = "PCRE" diff --git a/recipes/pcre/all/patches/0001-fix-cmake-8.45.patch b/recipes/pcre/all/patches/0001-fix-cmake-8.45.patch index 2d4e61286f2d9..7c7d151ff260d 100644 --- a/recipes/pcre/all/patches/0001-fix-cmake-8.45.patch +++ b/recipes/pcre/all/patches/0001-fix-cmake-8.45.patch @@ -1,17 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 16d89ff..ae10d1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -71,13 +71,13 @@ +@@ -71,13 +71,14 @@ # 2021-06-14 PH applied Wolfgang Stöggl's patch for generating pcre-config and # libpcre*.pc files (Bugzilla #2583) -PROJECT(PCRE C CXX) ++ # Increased minimum to 2.8.5 to support GNUInstallDirs. Set policy # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5) - CMAKE_POLICY(SET CMP0026 OLD) +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5) +-CMAKE_POLICY(SET CMP0026 OLD) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.5) +PROJECT(PCRE C CXX) ++#CMAKE_POLICY(SET CMP0026 OLD) # For FindReadline.cmake. This was changed to allow setting CMAKE_MODULE_PATH # on the command line. +@@ -485,12 +486,12 @@ OPTION(PCRE_REBUILD_CHARTABLES "Rebuild char tables" OFF) + IF(PCRE_REBUILD_CHARTABLES) + ADD_EXECUTABLE(dftables dftables.c) + +- GET_TARGET_PROPERTY(DFTABLES_EXE dftables LOCATION) ++ #GET_TARGET_PROPERTY(DFTABLES_EXE dftables LOCATION) + + ADD_CUSTOM_COMMAND( + COMMENT "Generating character tables (pcre_chartables.c) for current locale" + DEPENDS dftables +- COMMAND ${DFTABLES_EXE} ++ COMMAND $ + ARGS ${PROJECT_BINARY_DIR}/pcre_chartables.c + OUTPUT ${PROJECT_BINARY_DIR}/pcre_chartables.c + ) diff --git a/recipes/pcre/all/test_package/CMakeLists.txt b/recipes/pcre/all/test_package/CMakeLists.txt index 13c466091c9ad..db8f25cf6b8b6 100644 --- a/recipes/pcre/all/test_package/CMakeLists.txt +++ b/recipes/pcre/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(pcre REQUIRED CONFIG) diff --git a/recipes/pcre/all/test_v1_package/CMakeLists.txt b/recipes/pcre/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 35d9bf22ada5f..0000000000000 --- a/recipes/pcre/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(PCRE REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE PCRE::PCRE) diff --git a/recipes/pcre/all/test_v1_package/conanfile.py b/recipes/pcre/all/test_v1_package/conanfile.py deleted file mode 100644 index 5ffb0c5afa8b0..0000000000000 --- a/recipes/pcre/all/test_v1_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 = os.path.join("bin", "test_package") - arguments = "{}w+ conan-center-index".format("\\" if self.settings.os == "Windows" else "\\\\") - self.run(f"{bin_path} {arguments}", run_environment=True) diff --git a/recipes/pcre/config.yml b/recipes/pcre/config.yml index 32df8d6a2f636..7c7d53acafd2b 100644 --- a/recipes/pcre/config.yml +++ b/recipes/pcre/config.yml @@ -1,7 +1,3 @@ versions: "8.45": folder: all - "8.44": - folder: all - "8.41": - folder: all diff --git a/recipes/pcre2/all/conandata.yml b/recipes/pcre2/all/conandata.yml index 344830544b429..59b83648d1bd4 100644 --- a/recipes/pcre2/all/conandata.yml +++ b/recipes/pcre2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "10.44": + url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.tar.bz2" + sha256: "d34f02e113cf7193a1ebf2770d3ac527088d485d4e047ed10e5d217c6ef5de96" + "10.43": + url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.43/pcre2-10.43.tar.bz2" + sha256: "e2a53984ff0b07dfdb5ae4486bbb9b21cca8e7df2434096cc9bf1b728c350bcb" "10.42": url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2" sha256: "8d36cd8cb6ea2a4c2bb358ff6411b0c788633a2a45dabbf1aeb4b701d1b5e840" @@ -28,17 +34,21 @@ sources: - "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.33/pcre2-10.33.tar.bz2" - "https://sourceforge.net/projects/pcre/files/pcre2/10.33/pcre2-10.33.tar.bz2" sha256: "35514dff0ccdf02b55bd2e9fa586a1b9d01f62332c3356e379eabb75f789d8aa" - "10.32": - url: - - "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.32/pcre2-10.32.tar.bz2" - - "https://sourceforge.net/projects/pcre/files/pcre2/10.32/pcre2-10.32.tar.bz2" - sha256: "f29e89cc5de813f45786580101aaee3984a65818631d4ddbda7b32f699b87c2e" patches: + "10.42": + - patch_file: "patches/0002-fix-cmake-c-std.patch" + patch_description: "make the C99 requirement explicit" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/193" "10.40": - patch_file: "patches/0001-fix-cmake-1.39.patch" patch_description: "correct the order of cmake_minimum_required() and project()" patch_type: "conan" patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" + - patch_file: "patches/0002-fix-cmake-c-std.patch" + patch_description: "make the C99 requirement explicit" + patch_type: "conan" + patch_source: "https://github.com/PCRE2Project/pcre2/pull/193" "10.39": - patch_file: "patches/0001-fix-cmake-1.39.patch" patch_description: "correct the order of cmake_minimum_required() and project()" @@ -64,8 +74,3 @@ patches: patch_description: "correct the order of cmake_minimum_required() and project()" patch_type: "conan" patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" - "10.32": - - patch_file: "patches/0001-fix-cmake-1.32.patch" - patch_description: "correct the order of cmake_minimum_required() and project()" - patch_type: "conan" - patch_source: "https://github.com/PCRE2Project/pcre2/pull/142" diff --git a/recipes/pcre2/all/conanfile.py b/recipes/pcre2/all/conanfile.py index 14600c9abe85c..d4c58a525711f 100644 --- a/recipes/pcre2/all/conanfile.py +++ b/recipes/pcre2/all/conanfile.py @@ -29,6 +29,7 @@ class PCRE2Conan(ConanFile): "with_bzip2": [True, False], "support_jit": [True, False], "grep_support_callout_fork": [True, False], + "link_size": [2, 3, 4], } default_options = { "shared": False, @@ -41,6 +42,7 @@ class PCRE2Conan(ConanFile): "with_bzip2": True, "support_jit": False, "grep_support_callout_fork": True, + "link_size": 2, } def export_sources(self): @@ -96,10 +98,13 @@ def generate(self): tc.variables["PCRE2_BUILD_PCRE2_16"] = self.options.build_pcre2_16 tc.variables["PCRE2_BUILD_PCRE2_32"] = self.options.build_pcre2_32 tc.variables["PCRE2_SUPPORT_JIT"] = self.options.support_jit + tc.variables["PCRE2_LINK_SIZE"] = self.options.link_size tc.variables["PCRE2GREP_SUPPORT_CALLOUT_FORK"] = self.options.get_safe("grep_support_callout_fork", False) if Version(self.version) < "10.38": # relocatable shared libs on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "10.43": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() cd = CMakeDeps(self) @@ -118,6 +123,18 @@ def _patch_sources(self): replace_in_file(self, cmakelists, "RUNTIME DESTINATION bin", "RUNTIME DESTINATION bin BUNDLE DESTINATION bin") + # pcre2-config does not correctly include '-static' in static library names + if is_msvc(self): + replace = None + if Version(self.version) > "10.42": + replace = "configure_file(pcre2-config.in" + elif Version(self.version) >= "10.38": + replace = "CONFIGURE_FILE(pcre2-config.in" + postfix = "-static" if not self.options.shared else "" + if replace: + if self.settings.build_type == "Debug": + postfix += "d" + replace_in_file(self, cmakelists, replace, f'set(LIB_POSTFIX "{postfix}")\n{replace}') def build(self): self._patch_sources() @@ -149,6 +166,9 @@ def package_info(self): self.cpp_info.components["pcre2-posix"].set_property("pkg_config_name", "libpcre2-posix") self.cpp_info.components["pcre2-posix"].libs = [self._lib_name("pcre2-posix")] self.cpp_info.components["pcre2-posix"].requires = ["pcre2-8"] + if Version(self.version) >= "10.43" and is_msvc(self) and self.options.shared: + self.cpp_info.components["pcre2-posix"].defines.append("PCRE2POSIX_SHARED=1") + # pcre2-16 if self.options.build_pcre2_16: self.cpp_info.components["pcre2-16"].set_property("cmake_target_name", "PCRE2::16BIT") @@ -165,9 +185,6 @@ def package_info(self): self.cpp_info.components["pcre2-32"].defines.append("PCRE2_STATIC") if self.options.build_pcre2grep: - 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) # FIXME: This is a workaround to avoid ConanException. zlib and bzip2 # are optional requirements of pcre2grep executable, not of any pcre2 lib. if self.options.with_zlib: @@ -175,22 +192,6 @@ def package_info(self): if self.options.with_bzip2: self.cpp_info.components["pcre2-8"].requires.append("bzip2::bzip2") - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generator removed - self.cpp_info.names["cmake_find_package"] = "PCRE2" - self.cpp_info.names["cmake_find_package_multi"] = "PCRE2" - self.cpp_info.names["pkg_config"] = "libpcre2" - if self.options.build_pcre2_8: - self.cpp_info.components["pcre2-8"].names["cmake_find_package"] = "8BIT" - self.cpp_info.components["pcre2-8"].names["cmake_find_package_multi"] = "8BIT" - self.cpp_info.components["pcre2-posix"].names["cmake_find_package"] = "POSIX" - self.cpp_info.components["pcre2-posix"].names["cmake_find_package_multi"] = "POSIX" - if self.options.build_pcre2_16: - self.cpp_info.components["pcre2-16"].names["cmake_find_package"] = "16BIT" - self.cpp_info.components["pcre2-16"].names["cmake_find_package_multi"] = "16BIT" - if self.options.build_pcre2_32: - self.cpp_info.components["pcre2-32"].names["cmake_find_package"] = "32BIT" - self.cpp_info.components["pcre2-32"].names["cmake_find_package_multi"] = "32BIT" - def _lib_name(self, name): libname = name if Version(self.version) >= "10.38" and is_msvc(self) and not self.options.shared: diff --git a/recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch b/recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch deleted file mode 100644 index c4932b9175ed2..0000000000000 --- a/recipes/pcre2/all/patches/0001-fix-cmake-1.32.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -83,13 +83,13 @@ - # 2018-06-19 PH added checks for stdint.h and inttypes.h - # 2018-06-27 PH added Daniel's patch to increase the stack for MSVC - --PROJECT(PCRE2 C) - - # Increased minimum to 2.8.0 to support newer add_test features. Set policy - # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. - - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) - CMAKE_POLICY(SET CMP0026 OLD) -+PROJECT(PCRE2 C) - - SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake - diff --git a/recipes/pcre2/all/patches/0002-fix-cmake-c-std.patch b/recipes/pcre2/all/patches/0002-fix-cmake-c-std.patch new file mode 100644 index 0000000000000..e75faef54f312 --- /dev/null +++ b/recipes/pcre2/all/patches/0002-fix-cmake-c-std.patch @@ -0,0 +1,52 @@ +From 12b0e40ee4556318e5a0da3155f28bdfd7c5bc35 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= +Date: Sun, 15 Jan 2023 14:38:44 -0800 +Subject: [PATCH] build: make the C99 requirement explicit + +Recent code uses C99 syntax (as reported in #163, and therefore it +will fail to build unless C99 (or higher) support is required by the +compiler (gcc >= 5 does it by default). + +For those unfortunate to need an older compiler that does require a +flag to enable that, make sure that both autoconf and cmake make it +explicit. + +While testing the change with the ancient autoconf version listed as +a prerequisite, noticed that the LT_INIT syntax introduced with 91485e5 +(Update configure.ac for latest version of autoconf., 2021-02-02), was +not supported, so update the autoconf minimum as well. +--- + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cec7dfb4..a8147575 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,1 +107,3 @@ + PROJECT(PCRE2 C) ++set(CMAKE_C_STANDARD 99) ++set(CMAKE_C_STANDARD_REQUIRED TRUE) + + # Set policy CMP0026 to avoid warnings for the use of LOCATION in + # GET_TARGET_PROPERTY. This should no longer be required. +diff --git a/configure.ac b/configure.ac +index ce5bda3c..67b2fdce 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -22,7 +22,7 @@ m4_define(libpcre2_posix_version, [3:4:0]) + # NOTE: The CMakeLists.txt file searches for the above variables in the first + # 50 lines of this file. Please update that if the variables above are moved. + +-AC_PREREQ([2.60]) ++AC_PREREQ([2.62]) + AC_INIT([PCRE2],pcre2_major.pcre2_minor[]pcre2_prerelease,[],[pcre2]) + AC_CONFIG_SRCDIR([src/pcre2.h.in]) + AM_INIT_AUTOMAKE([dist-bzip2 dist-zip]) +@@ -42,7 +42,7 @@ AC_CONFIG_MACRO_DIR([m4]) + + remember_set_CFLAGS="$CFLAGS" + +-AC_PROG_CC ++m4_version_prereq(2.70, [AC_PROG_CC], [AC_PROG_CC_C99]) + AM_PROG_CC_C_O + AC_USE_SYSTEM_EXTENSIONS + diff --git a/recipes/pcre2/all/test_package/CMakeLists.txt b/recipes/pcre2/all/test_package/CMakeLists.txt index 016db5b530e0c..4cb6bec73f935 100644 --- a/recipes/pcre2/all/test_package/CMakeLists.txt +++ b/recipes/pcre2/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(PCRE2 REQUIRED 8BIT CONFIG) diff --git a/recipes/pcre2/all/test_package/conanfile.py b/recipes/pcre2/all/test_package/conanfile.py index 0a6bc68712d90..fafba71d30d56 100644 --- a/recipes/pcre2/all/test_package/conanfile.py +++ b/recipes/pcre2/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/pcre2/all/test_v1_package/CMakeLists.txt b/recipes/pcre2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/pcre2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pcre2/all/test_v1_package/conanfile.py b/recipes/pcre2/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/pcre2/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_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/pcre2/config.yml b/recipes/pcre2/config.yml index f488a0ecff8cb..ca3407fb22830 100644 --- a/recipes/pcre2/config.yml +++ b/recipes/pcre2/config.yml @@ -1,4 +1,8 @@ versions: + "10.44": + folder: all + "10.43": + folder: all "10.42": folder: all "10.40": @@ -13,5 +17,3 @@ versions: folder: all "10.33": folder: all - "10.32": - folder: all diff --git a/recipes/pdal/all/CMakeLists.txt b/recipes/pdal/all/CMakeLists.txt index 974652d0aae1b..0a0fc6af2a8bd 100644 --- a/recipes/pdal/all/CMakeLists.txt +++ b/recipes/pdal/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/pdal/all/test_package/CMakeLists.txt b/recipes/pdal/all/test_package/CMakeLists.txt index b38ffb363410b..10eecc87388ef 100644 --- a/recipes/pdal/all/test_package/CMakeLists.txt +++ b/recipes/pdal/all/test_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/pdcurses/all/conanfile.py b/recipes/pdcurses/all/conanfile.py index 3a01de34987fe..b50701ab1011d 100644 --- a/recipes/pdcurses/all/conanfile.py +++ b/recipes/pdcurses/all/conanfile.py @@ -59,7 +59,7 @@ def layout(self): def requirements(self): if self.options.with_sdl: - self.requires("sdl/2.28.3", transitive_libs=True) + self.requires("sdl/2.28.5", transitive_libs=True) if self.options.get_safe("with_x11"): self.requires("xorg/system") @@ -77,7 +77,7 @@ def validate(self): def build_requirements(self): if not is_msvc(self): if not self.conf.get("tools.gnu:make_program", check_type=str): - self.tool_requires("make/4.4") + self.tool_requires("make/4.4.1") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/pdcurses/all/test_v1_package/CMakeLists.txt b/recipes/pdcurses/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/pdcurses/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 3f4a9f50f389e..0000000000000 --- a/recipes/pdcurses/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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 index 396c829a1f253..0d800cc7a7750 100644 --- a/recipes/pdf-writer/all/conandata.yml +++ b/recipes/pdf-writer/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "4.6.7": + url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.6.7.tar.gz" + sha256: "735c65d4685c5156f0876635f3bc1565700d0f648fbb1f384e46d186796c8bae" + "4.6.6": + url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.6.6.tar.gz" + sha256: "8343820313e553052df68c75fe2bf35353da2719106e81eb2a8b026ff96c7d7c" + "4.6.4": + url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.6.4.tar.gz" + sha256: "93b5f1dc88fd67fdebde409e927e828dfbae02efa44936e89728622411c6a047" + "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" @@ -6,6 +21,26 @@ sources: url: "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v4.5.12.tar.gz" sha256: "40fcbaa66fc46fcb588ceda119ba8839ff6d2c886191ac5e68ed702475c7336e" patches: + "4.6.7": + - patch_file: "patches/4.6.6-0001-fix-cmake.patch" + patch_description: "disable cpack" + patch_type: "conan" + "4.6.6": + - patch_file: "patches/4.6.6-0001-fix-cmake.patch" + patch_description: "disable cpack" + patch_type: "conan" + "4.6.4": + - patch_file: "patches/4.6.2-0001-fix-cmake.patch" + patch_description: "disable cpack" + patch_type: "conan" + "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" diff --git a/recipes/pdf-writer/all/conanfile.py b/recipes/pdf-writer/all/conanfile.py index 976af4f35f825..75728352cf105 100644 --- a/recipes/pdf-writer/all/conanfile.py +++ b/recipes/pdf-writer/all/conanfile.py @@ -50,13 +50,13 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") 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") + self.requires("libpng/[>=1.6 <2]") if self.options.with_tiff: self.requires("libtiff/4.6.0") 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/patches/4.6.6-0001-fix-cmake.patch b/recipes/pdf-writer/all/patches/4.6.6-0001-fix-cmake.patch new file mode 100644 index 0000000000000..0f818e64d81ab --- /dev/null +++ b/recipes/pdf-writer/all/patches/4.6.6-0001-fix-cmake.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 956c730..a7d809b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -165,13 +165,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 +@@ -200,4 +200,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/config.yml b/recipes/pdf-writer/config.yml index a4aeb1f1b89b4..36e4d583c87ad 100644 --- a/recipes/pdf-writer/config.yml +++ b/recipes/pdf-writer/config.yml @@ -1,4 +1,14 @@ versions: + "4.6.7": + folder: all + "4.6.6": + folder: all + "4.6.4": + folder: all + "4.6.3": + folder: all + "4.6.2": + folder: all "4.6.1": folder: all "4.5.12": diff --git a/recipes/pdfgen/all/test_package/CMakeLists.txt b/recipes/pdfgen/all/test_package/CMakeLists.txt index 5e3c8b32c96da..48547897f45df 100644 --- a/recipes/pdfgen/all/test_package/CMakeLists.txt +++ b/recipes/pdfgen/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 C) find_package(pdfgen REQUIRED CONFIG) diff --git a/recipes/pdfgen/all/test_v1_package/CMakeLists.txt b/recipes/pdfgen/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/pdfgen/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pdfgen/all/test_v1_package/conanfile.py b/recipes/pdfgen/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/pdfgen/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/pdfium/all/conandata.yml b/recipes/pdfium/all/conandata.yml index 914f93df79f0d..77888f52bfe69 100644 --- a/recipes/pdfium/all/conandata.yml +++ b/recipes/pdfium/all/conandata.yml @@ -2,8 +2,8 @@ sources: "95.0.4629": pdfium-cmake: # FIXME: create release - url: "https://github.com/madebr/pdfium-cmake/archive/9611e37f688e9881b50aef7e7775accdda6cd98f.zip" - sha256: "9085c22bd9d21acede4f5f26be0b6a0f82346e2ea53cc8bcddd785a4190d7a84" + url: "https://github.com/madebr/pdfium-cmake/archive/e02962c2ebf6d1a2edc7b05bb4fc8cb73cac5b18.zip" + sha256: "e8454d098af887bc989fbbc955b32566b109b4f03350fb6c08cc7f2e359a909f" pdfium: url: "https://pdfium.googlesource.com/pdfium/+archive/refs/heads/chromium/4629.tar.gz" # sha256 is volatile on googlesource, no up-to-date github fork diff --git a/recipes/pdfium/all/conanfile.py b/recipes/pdfium/all/conanfile.py index 7a5488384bc9e..4e4268e4ab4a3 100644 --- a/recipes/pdfium/all/conanfile.py +++ b/recipes/pdfium/all/conanfile.py @@ -47,7 +47,7 @@ def layout(self): def requirements(self): self.requires("freetype/2.13.2") self.requires("icu/74.1") - self.requires("lcms/2.14") + self.requires("lcms/2.16") self.requires("openjpeg/2.5.0") self.requires("zlib/[>=1.2.11 <2]") if self.options.with_libjpeg == "libjpeg": diff --git a/recipes/pdfium/all/test_v1_package/CMakeLists.txt b/recipes/pdfium/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/pdfium/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 4c2f046547705..0000000000000 --- a/recipes/pdfium/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/pdqsort/all/test_package/CMakeLists.txt b/recipes/pdqsort/all/test_package/CMakeLists.txt index f5cfbb3202e0a..a57bf6da97d3a 100644 --- a/recipes/pdqsort/all/test_package/CMakeLists.txt +++ b/recipes/pdqsort/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(pdqsort REQUIRED CONFIG) diff --git a/recipes/pdqsort/all/test_v1_package/CMakeLists.txt b/recipes/pdqsort/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b21cc49efde95..0000000000000 --- a/recipes/pdqsort/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/pdqsort/all/test_v1_package/conanfile.py b/recipes/pdqsort/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/pdqsort/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_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/perf/all/test_v1_package/conanfile.py b/recipes/perf/all/test_v1_package/conanfile.py deleted file mode 100644 index 4001f8991b676..0000000000000 --- a/recipes/perf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,9 +0,0 @@ -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 d490b5c402d8e..c8178a3bde6b9 100644 --- a/recipes/perfetto/all/conandata.yml +++ b/recipes/perfetto/all/conandata.yml @@ -1,44 +1,25 @@ sources: + "48.1": + url: "https://github.com/google/perfetto/archive/refs/tags/v48.1.tar.gz" + sha256: "8d1c6bf44f1bdb098ab70cd60da3ce6b6e731e4eb21dd52b2527cbdcf85d984d" + "47.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v47.0.tar.gz" + sha256: "9bbd38a0f074038bde6ccbcf5f2ff32587eb60faec254932268ecb6f17f18186" + "45.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v45.0.tar.gz" + sha256: "dcb815fb54370fa20a657552288016cb66e7a98237c1a1d47e7645a4325ac75e" + "44.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v44.0.tar.gz" + sha256: "db4162ee6495b1fcc13ba7aca77d67f9fd1766d184743137a04af8b1e3906b9d" + "43.1": + url: "https://github.com/google/perfetto/archive/refs/tags/v43.1.tar.gz" + sha256: "0f23ba39520c9ec629c48dc36a3a4bb92ed9653ac6694445be22985205a3f4ce" + "42.0": + url: "https://github.com/google/perfetto/archive/refs/tags/v42.0.tar.gz" + sha256: "1c474a0f16cc2f9da826fd3f9e44ffd77785c433e997cdaf0ee390ae3d64b53e" + "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" - "32.1": - url: "https://github.com/google/perfetto/archive/refs/tags/v32.1.tar.gz" - sha256: "0d1088b4758b3d5f3813178c6de22386329d42407d23aa1479f20dce96e49d78" - "31.0": - url: "https://github.com/google/perfetto/archive/refs/tags/v31.0.tar.gz" - sha256: "544c68293590f53391ea4267d5a9b1a4594e1c8216fc5f5ce9d0f1227797922e" - "30.0": - url: "https://github.com/google/perfetto/archive/refs/tags/v30.0.tar.gz" - sha256: "d1883793a2adb2a4105fc083478bf781badd566d72da45caa99095b61f938a2e" - "27.1": - url: "https://github.com/google/perfetto/archive/refs/tags/v27.1.tar.gz" - sha256: "9edbafd6e2d9feaced4c0153e2f48dbb1da38429c5b1b17dfee70a91fd3101b2" - "27.0": - url: "https://github.com/google/perfetto/archive/refs/tags/v27.0.tar.gz" - sha256: "c22750dd21419cf58132d55d634b88d9947bd0c7244dd98854b0248c7637a98c" - "26.1": - url: "https://github.com/google/perfetto/archive/refs/tags/v26.1.tar.gz" - sha256: "cce387e82e2a137fce2eba927f80f20407764b77637a1a92b9b24065a500ce6d" -patches: - "31.0": - - patch_file: "patches/v31.0/0001-tracing-fix-compile-on-MSVC.patch" - patch_description: "Fix compilation on MSVC" - patch_type: "backport" - patch_source: "https://android-review.googlesource.com/c/platform/external/perfetto/+/2355222" - sha256: "ad253a9bba3941bd8d1f206422d60eb1c06cb6d75d60eff5b5b8ae0f2ec7e15c" diff --git a/recipes/perfetto/all/conanfile.py b/recipes/perfetto/all/conanfile.py index 6c9cecd7c62ef..d311c92822b0a 100644 --- a/recipes/perfetto/all/conanfile.py +++ b/recipes/perfetto/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.files import copy, get from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -33,21 +33,20 @@ class PerfettoConan(ConanFile): @property def _minimum_cpp_standard(self): - return 11 if Version(self.version) < "31.0" else 17 + return 17 @property def _minimum_compilers_version(self): return { - "Visual Studio": "15" if Version(self.version) < "31.0" else "16", + "Visual Studio": "16" if Version(self.version) < "48.0" else "17", "msvc": "190", "gcc": "7", - "clang": "3.3" if Version(self.version) < "31.0" else "5", - "apple-clang": "5.0" if Version(self.version) < "31.0" else "9.1", + "clang": "5", + "apple-clang": "9.1", } 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": @@ -88,7 +87,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() @@ -101,7 +99,7 @@ def package(self): def package_info(self): self.cpp_info.libs = ["perfetto"] 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") if is_msvc(self): diff --git a/recipes/perfetto/all/test_package/CMakeLists.txt b/recipes/perfetto/all/test_package/CMakeLists.txt index ad42eab5529ea..2ee7fde658d5c 100644 --- a/recipes/perfetto/all/test_package/CMakeLists.txt +++ b/recipes/perfetto/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(perfetto REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -if(perfetto_VERSION VERSION_LESS "31.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -else() - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) target_link_libraries(${PROJECT_NAME} PRIVATE perfetto::perfetto) diff --git a/recipes/perfetto/all/test_v1_package/CMakeLists.txt b/recipes/perfetto/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/perfetto/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/perfetto/all/test_v1_package/conanfile.py b/recipes/perfetto/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/perfetto/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_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/perfetto/config.yml b/recipes/perfetto/config.yml index 52841e460eedc..f5d0172738aad 100644 --- a/recipes/perfetto/config.yml +++ b/recipes/perfetto/config.yml @@ -1,25 +1,17 @@ versions: - "40.0": - folder: all - "39.0": - folder: all - "38.0": + "48.1": folder: all - "37.0": + "47.0": folder: all - "35.0": + "45.0": folder: all - "34.0": + "44.0": folder: all - "32.1": + "43.1": folder: all - "31.0": + "42.0": folder: all - "30.0": + "41.0": folder: all - "27.1": - folder: all - "27.0": - folder: all - "26.1": + "40.0": folder: all diff --git a/recipes/perlinnoise/all/test_package/CMakeLists.txt b/recipes/perlinnoise/all/test_package/CMakeLists.txt index 18878f56fc9d5..f7d0f880cefe5 100644 --- a/recipes/perlinnoise/all/test_package/CMakeLists.txt +++ b/recipes/perlinnoise/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(PerlinNoise REQUIRED CONFIG) diff --git a/recipes/perlinnoise/all/test_v1_package/CMakeLists.txt b/recipes/perlinnoise/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/perlinnoise/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/perlinnoise/all/test_v1_package/conanfile.py b/recipes/perlinnoise/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/perlinnoise/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/pexports/all/test_v1_package/CMakeLists.txt b/recipes/pexports/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/pexports/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index ecb888f16f156..0000000000000 --- a/recipes/pexports/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,26 +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", "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/pffft/all/CMakeLists.txt b/recipes/pffft/all/CMakeLists.txt index d32357140dd71..5d149cbfd9a41 100644 --- a/recipes/pffft/all/CMakeLists.txt +++ b/recipes/pffft/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(pffft LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/pffft/all/test_package/CMakeLists.txt b/recipes/pffft/all/test_package/CMakeLists.txt index de2c147a71f2b..5466bb8a30301 100644 --- a/recipes/pffft/all/test_package/CMakeLists.txt +++ b/recipes/pffft/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(pffft REQUIRED CONFIG) diff --git a/recipes/pffft/all/test_v1_package/CMakeLists.txt b/recipes/pffft/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/pffft/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pffft/all/test_v1_package/conanfile.py b/recipes/pffft/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/pffft/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_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/pfr/all/test_package/CMakeLists.txt b/recipes/pfr/all/test_package/CMakeLists.txt index d786461ba037e..3176cc102862a 100644 --- a/recipes/pfr/all/test_package/CMakeLists.txt +++ b/recipes/pfr/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(pfr REQUIRED CONFIG) diff --git a/recipes/pfr/all/test_v1_package/CMakeLists.txt b/recipes/pfr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 700251d5bc8f3..0000000000000 --- a/recipes/pfr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1.0) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pfr/all/test_v1_package/conanfile.py b/recipes/pfr/all/test_v1_package/conanfile.py deleted file mode 100644 index c3a9c315455ca..0000000000000 --- a/recipes/pfr/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.definitions["PfrMajorVersion"] = Version( - self.deps_cpp_info["pfr"].version).major - 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/pgm-index/all/test_package/CMakeLists.txt b/recipes/pgm-index/all/test_package/CMakeLists.txt index 3edd6e9dffe4c..f7df8c9c37537 100644 --- a/recipes/pgm-index/all/test_package/CMakeLists.txt +++ b/recipes/pgm-index/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(pgm-index REQUIRED CONFIG) diff --git a/recipes/pgm-index/all/test_v1_package/CMakeLists.txt b/recipes/pgm-index/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/pgm-index/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pgm-index/all/test_v1_package/conanfile.py b/recipes/pgm-index/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/pgm-index/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_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/physfs/all/conandata.yml b/recipes/physfs/all/conandata.yml index 5504750a8f897..a392b6a19517f 100644 --- a/recipes/physfs/all/conandata.yml +++ b/recipes/physfs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.0": + url: "https://github.com/icculus/physfs/archive/refs/tags/release-3.2.0.tar.gz" + sha256: "1991500eaeb8d5325e3a8361847ff3bf8e03ec89252b7915e1f25b3f8ab5d560" "3.0.2": url: "https://icculus.org/physfs/downloads/physfs-3.0.2.tar.bz2" sha256: "304df76206d633df5360e738b138c94e82ccf086e50ba84f456d3f8432f9f863" diff --git a/recipes/physfs/all/conanfile.py b/recipes/physfs/all/conanfile.py index 995258a27fa05..7f695f2305b04 100644 --- a/recipes/physfs/all/conanfile.py +++ b/recipes/physfs/all/conanfile.py @@ -99,6 +99,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", "PhysFS")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( diff --git a/recipes/physfs/all/test_package/CMakeLists.txt b/recipes/physfs/all/test_package/CMakeLists.txt index 6832af4367fda..34a7c20efe48a 100644 --- a/recipes/physfs/all/test_package/CMakeLists.txt +++ b/recipes/physfs/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(PhysFS REQUIRED CONFIG) diff --git a/recipes/physfs/all/test_v1_package/CMakeLists.txt b/recipes/physfs/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/physfs/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/physfs/all/test_v1_package/conanfile.py b/recipes/physfs/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/physfs/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_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/physfs/config.yml b/recipes/physfs/config.yml index 12c582e98f963..1531809cbbd7b 100644 --- a/recipes/physfs/config.yml +++ b/recipes/physfs/config.yml @@ -1,3 +1,5 @@ versions: + "3.2.0": + folder: all "3.0.2": folder: all diff --git a/recipes/physx/4.x.x/conandata.yml b/recipes/physx/4.x.x/conandata.yml index 6ce5c7aca0b19..3407713e50946 100644 --- a/recipes/physx/4.x.x/conandata.yml +++ b/recipes/physx/4.x.x/conandata.yml @@ -1,8 +1,21 @@ sources: + "4.1.2": + url: "https://github.com/NVIDIAGameWorks/PhysX/archive/a2c0428acab643e60618c681b501e86f7fd558cc.zip" + sha256: "d9c1939490a990277f8c773f288294cecb10e6fad8c820acad90fd4168b8ace3" "4.1.1": url: "https://github.com/NVIDIAGameWorks/PhysX/archive/ae80dede0546d652040ae6260a810e53e20a06fa.zip" sha256: "dd7db4c7879659658753029de57d04b18047ec04687b60f70335cde148a48d68" patches: + "4.1.2": + - patch_file: "patches/0003-PsWindowsInlineAoS-msvc142-bug-workaround.patch" + patch_description: "Workaround for a MSVC 142 bug on V3LoadA" + patch_type: "portability" + - patch_file: "patches/0004-Conan-PhysXGpu-name-workaround.patch" + patch_description: "Fix PhysXGpu library name" + patch_type: "conan" + - patch_file: "patches/0005-CMake-macos-ios-android-install-targets.patch" + patch_description: "Add installation targets for iOS, MacOS, Android" + patch_type: "portability" "4.1.1": - patch_file: "patches/0001-PsAllocator-include-typeinfo.patch" patch_description: "Fixed typeinfo inclusion for some VS versions" diff --git a/recipes/physx/4.x.x/conanfile.py b/recipes/physx/4.x.x/conanfile.py index 502ac7ccfc798..35264535f45b5 100644 --- a/recipes/physx/4.x.x/conanfile.py +++ b/recipes/physx/4.x.x/conanfile.py @@ -18,6 +18,7 @@ class PhysXConan(ConanFile): homepage = "https://github.com/NVIDIAGameWorks/PhysX" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "compiler", "arch", "build_type" options = { "shared": [True, False], @@ -35,8 +36,7 @@ class PhysXConan(ConanFile): } short_paths = True - - generators = "CMakeDeps" + no_copy_source = True def export_sources(self): export_conandata_patches(self) @@ -64,30 +64,28 @@ def validate(self): if self.settings.os == "Macos": if self.settings.arch not in ["x86", "x86_64"]: - raise ConanInvalidConfiguration("{} only supports x86 and x86_64 on macOS".format(self.name)) - + raise ConanInvalidConfiguration(f"{self.name} only supports x86 and x86_64 on macOS") + if valid_min_cppstd(self, 17): - raise ConanInvalidConfiguration("{} is not supported with C++ 17. Contributions are welcome.".format(self.name)) + raise ConanInvalidConfiguration(f"{self.name} is not supported with C++ 17. Contributions are welcome.") build_type = self.settings.build_type if build_type not in ["Debug", "RelWithDebInfo", "Release"]: raise ConanInvalidConfiguration("Current build_type is not supported") if self.settings.os == "Windows" and not is_msvc(self): - raise ConanInvalidConfiguration("{} only supports Visual Studio on Windows".format(self.name)) + raise ConanInvalidConfiguration(f"{self.name} only supports Visual Studio on Windows") if is_msvc(self): allowed_runtimes = ["MDd", "MTd"] if build_type == "Debug" else ["MD", "MT"] if msvc_runtime_flag(self) not in allowed_runtimes: raise ConanInvalidConfiguration( - "Visual Studio runtime {0} is required for {1} build type".format( - " or ".join(allowed_runtimes), - build_type, - ) + f"Visual Studio runtime {' or '.join(allowed_runtimes)} is required for {build_type} build type" ) def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + self._patch_sources() def generate(self): tc = CMakeToolchain(self) @@ -141,8 +139,6 @@ def generate(self): tc.generate() def build(self): - self._patch_sources() - cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, "physx/compiler/public")) cmake.build(build_type=self._get_physx_build_type()) @@ -185,8 +181,7 @@ def _patch_sources(self): ): target, _ = os.path.splitext(os.path.basename(cmake_file)) replace_in_file(self, os.path.join(physx_source_cmake_dir, cmake_file), - "SET_TARGET_PROPERTIES({} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)".format(target), - "") + f"SET_TARGET_PROPERTIES({target} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)", "") # No error for compiler warnings replace_in_file(self, os.path.join(physx_source_cmake_dir, "windows", "CMakeLists.txt"), @@ -263,7 +258,7 @@ def _copy_external_bin(self): "pattern": "PhysXDevice*.dll", "vc_ver": {"180": "vc120", "190": "vc140", "191": "vc141"}.get(str(compiler_version), "vc142") }] - + package_dst_bin_dir = os.path.join(self.package_folder, "bin") for dll_info in dll_info_list: diff --git a/recipes/physx/4.x.x/test_package/CMakeLists.txt b/recipes/physx/4.x.x/test_package/CMakeLists.txt index b7cd3b4aec9e9..d5be3cf8e76bc 100644 --- a/recipes/physx/4.x.x/test_package/CMakeLists.txt +++ b/recipes/physx/4.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) find_package(PhysX REQUIRED PhysX PhysXExtensions CONFIG) diff --git a/recipes/physx/4.x.x/test_package/conanfile.py b/recipes/physx/4.x.x/test_package/conanfile.py index 3bc1fe0a67f9f..ff6d00f1438e2 100644 --- a/recipes/physx/4.x.x/test_package/conanfile.py +++ b/recipes/physx/4.x.x/test_package/conanfile.py @@ -6,6 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) @@ -15,7 +16,7 @@ def layout(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["TEST_SHARED_LIBRARY"] = True if "fPIC" not in self.options["physx"].fields else self.options["physx"].fPIC + tc.variables["TEST_SHARED_LIBRARY"] = self.dependencies["physx"].options.get_safe("fPIC", True) tc.generate() def build(self): @@ -25,5 +26,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/physx/4.x.x/test_v1_package/CMakeLists.txt b/recipes/physx/4.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index e6ab5b97e050a..0000000000000 --- a/recipes/physx/4.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(PhysX REQUIRED PhysX PhysXExtensions CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PhysX::PhysX PhysX::PhysXExtensions) - -option(TEST_SHARED_LIBRARY "Build a test shared library") -if(TEST_SHARED_LIBRARY) - find_package(PhysX REQUIRED PhysXFoundation) - add_library(${PROJECT_NAME}_lib SHARED test_library.cpp) - target_link_libraries(${PROJECT_NAME}_lib PhysX::PhysXFoundation PhysX::PhysXExtensions) -endif() diff --git a/recipes/physx/4.x.x/test_v1_package/conanfile.py b/recipes/physx/4.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 4cdfb6a5e4042..0000000000000 --- a/recipes/physx/4.x.x/test_v1_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.definitions["TEST_SHARED_LIBRARY"] = True if "fPIC" not in self.options["physx"].fields else self.options["physx"].fPIC - 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/physx/4.x.x/test_v1_package/test_library.cpp b/recipes/physx/4.x.x/test_v1_package/test_library.cpp deleted file mode 100644 index dbd8a536f547c..0000000000000 --- a/recipes/physx/4.x.x/test_v1_package/test_library.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "PxConfig.h" -#include "PxPhysicsAPI.h" - -using namespace physx; - -#if defined(_WINDOWS) -#include - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - return TRUE; -} - -#define EXPORTS __declspec(dllexport) -#else -#define EXPORTS -#endif - -PxDefaultAllocator gAllocator; -PxDefaultErrorCallback gErrorCallback; - -EXPORTS -void some_func(void) { - PxFoundation *gFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gAllocator, gErrorCallback); - gFoundation->release(); -} diff --git a/recipes/physx/4.x.x/test_v1_package/test_package.cpp b/recipes/physx/4.x.x/test_v1_package/test_package.cpp deleted file mode 100644 index 984f48894974c..0000000000000 --- a/recipes/physx/4.x.x/test_v1_package/test_package.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include - -#include "PxConfig.h" -#include "PxPhysicsAPI.h" - -#define PVD_HOST "127.0.0.1" -#define PX_RELEASE(x) if (x) {x->release(); x = NULL;} - -using namespace physx; - -PxDefaultAllocator gAllocator; -PxDefaultErrorCallback gErrorCallback; - -PxFoundation *gFoundation = NULL; -PxPhysics *gPhysics = NULL; - -PxDefaultCpuDispatcher *gDispatcher = NULL; -PxScene *gScene = NULL; - -PxMaterial *gMaterial = NULL; - -PxPvd *gPvd = NULL; - -#if PX_SUPPORT_GPU_PHYSX -PxCudaContextManager *gCudaContextManager = NULL; -#endif - -PxReal stackZ = 10.0f; - -PxRigidDynamic *createDynamic(const PxTransform &t, const PxGeometry &geometry, const PxVec3 &velocity = PxVec3(0)) { - PxRigidDynamic *dynamic = PxCreateDynamic(*gPhysics, t, geometry, *gMaterial, 10.0f); - dynamic->setAngularDamping(0.5f); - dynamic->setLinearVelocity(velocity); - gScene->addActor(*dynamic); - return dynamic; -} - -void createStack(const PxTransform &t, PxU32 size, PxReal halfExtent) { - PxShape *shape = gPhysics->createShape(PxBoxGeometry(halfExtent, halfExtent, halfExtent), *gMaterial); - for (PxU32 i = 0; i < size; ++i) { - for (PxU32 j = 0;j < size - i; ++j) { - PxTransform localTm(PxVec3(PxReal(j * 2) - PxReal(size - i), PxReal(i * 2 + 1), 0) * halfExtent); - PxRigidDynamic *body = gPhysics->createRigidDynamic(t.transform(localTm)); - body->attachShape(*shape); - PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); - gScene->addActor(*body); - } - } - shape->release(); -} - -void initPhysics() { - gFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gAllocator, gErrorCallback); - - gPvd = PxCreatePvd(*gFoundation); - PxPvdTransport *transport = PxDefaultPvdSocketTransportCreate(PVD_HOST, 5425, 10); - gPvd->connect(*transport, PxPvdInstrumentationFlag::ePROFILE); - - gPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *gFoundation, PxTolerancesScale(), true, gPvd); - - PxSceneDesc sceneDesc(gPhysics->getTolerancesScale()); - sceneDesc.gravity = PxVec3(0.0f, -9.81f, 0.0f); - gDispatcher = PxDefaultCpuDispatcherCreate(4); - sceneDesc.cpuDispatcher = gDispatcher; - sceneDesc.filterShader = PxDefaultSimulationFilterShader; - -#if PX_SUPPORT_GPU_PHYSX - PxCudaContextManagerDesc cudaContextManagerDesc; - cudaContextManagerDesc.interopMode = PxCudaInteropMode::NO_INTEROP; - gCudaContextManager = PxCreateCudaContextManager(*gFoundation, cudaContextManagerDesc, PxGetProfilerCallback()); //Create the CUDA context manager, required for GRB to dispatch CUDA kernels. - if (gCudaContextManager) { - if (!gCudaContextManager->contextIsValid()) { - gCudaContextManager->release(); - gCudaContextManager = NULL; - } - } - sceneDesc.cudaContextManager = gCudaContextManager; //Set the CUDA context manager, used by GRB. - - sceneDesc.flags |= PxSceneFlag::eENABLE_GPU_DYNAMICS; //Enable GPU dynamics - without this enabled, simulation (contact gen and solver) will run on the CPU. - sceneDesc.flags |= PxSceneFlag::eENABLE_PCM; //Enable PCM. PCM NP is supported on GPU. Legacy contact gen will fall back to CPU - sceneDesc.flags |= PxSceneFlag::eENABLE_STABILIZATION; //Improve solver stability by enabling post-stabilization. - sceneDesc.broadPhaseType = PxBroadPhaseType::eGPU; //Enable GPU broad phase. Without this set, broad phase will run on the CPU. - sceneDesc.gpuMaxNumPartitions = 8; //Defines the maximum number of partitions used by the solver. Only power-of-2 values are valid. - //A value of 8 generally gives best balance between performance and stability. -#endif - - gScene = gPhysics->createScene(sceneDesc); - - PxPvdSceneClient *pvdClient = gScene->getScenePvdClient(); - if (pvdClient) { - pvdClient->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_CONSTRAINTS, true); - pvdClient->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_CONTACTS, true); - pvdClient->setScenePvdFlag(PxPvdSceneFlag::eTRANSMIT_SCENEQUERIES, true); - } - gMaterial = gPhysics->createMaterial(0.5f, 0.5f, 0.6f); - - PxRigidStatic *groundPlane = PxCreatePlane(*gPhysics, PxPlane(0,1,0,0), *gMaterial); - gScene->addActor(*groundPlane); - - for (PxU32 i = 0; i < 40; ++i) { - createStack(PxTransform(PxVec3(0, 0, stackZ -= 10.0f)), 20, 1.0f); - } - - PxRigidDynamic *ball = createDynamic(PxTransform(PxVec3(0,20,100)), PxSphereGeometry(5), PxVec3(0,-25,-100)); - PxRigidBodyExt::updateMassAndInertia(*ball, 1000.f); -} - -void stepPhysics() { - gScene->simulate(1.0f / 60.0f); - gScene->fetchResults(true); -} - -void cleanupPhysics() { - PX_RELEASE(gScene); - PX_RELEASE(gDispatcher); - PX_RELEASE(gPhysics); - if (gPvd) { - PxPvdTransport *transport = gPvd->getTransport(); - gPvd->release(); - gPvd = NULL; - PX_RELEASE(transport); - } -#if PX_SUPPORT_GPU_PHYSX - PX_RELEASE(gCudaContextManager); -#endif - PX_RELEASE(gFoundation); -} - -int main(int, char **) { - static const PxU32 frameCount = 100; - initPhysics(); - for (PxU32 i = 0; i < frameCount; ++i) { - stepPhysics(); - } - cleanupPhysics(); - - std::cout << "Test of PhysX " - << PX_PHYSICS_VERSION_MAJOR << "." << PX_PHYSICS_VERSION_MINOR << "." << PX_PHYSICS_VERSION_BUGFIX - << " done.\n" - << std::endl; - - return 0; -} diff --git a/recipes/physx/config.yml b/recipes/physx/config.yml index ff5afb6866457..f46b35cc99652 100644 --- a/recipes/physx/config.yml +++ b/recipes/physx/config.yml @@ -1,3 +1,5 @@ versions: + "4.1.2": + folder: "4.x.x" "4.1.1": folder: "4.x.x" diff --git a/recipes/picobench/all/conanfile.py b/recipes/picobench/all/conanfile.py index 62918f33d6e78..e91e1db235b6c 100644 --- a/recipes/picobench/all/conanfile.py +++ b/recipes/picobench/all/conanfile.py @@ -2,9 +2,10 @@ from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class PicobenchConan(ConanFile): @@ -46,6 +47,8 @@ def generate(self): tc.variables["PICOBENCH_BUILD_TOOLS"] = self.options.with_cli tc.variables["PICOBENCH_BUILD_TESTS"] = False tc.variables["PICOBENCH_BUILD_EXAMPLES"] = False + if Version(self.version) < "2.06": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -61,12 +64,6 @@ def package(self): cmake.install() def package_info(self): - if self.options.with_cli: - # TODO: Legacy, to be removed on Conan 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) - else: + if not self.options.with_cli: self.cpp_info.bindirs = [] - self.cpp_info.libdirs = [] diff --git a/recipes/picobench/all/test_package/CMakeLists.txt b/recipes/picobench/all/test_package/CMakeLists.txt index 9a9856af9c67e..da99eba60ddbe 100644 --- a/recipes/picobench/all/test_package/CMakeLists.txt +++ b/recipes/picobench/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(picobench REQUIRED CONFIG) diff --git a/recipes/picobench/all/test_v1_package/CMakeLists.txt b/recipes/picobench/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/picobench/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/picobench/all/test_v1_package/conanfile.py b/recipes/picobench/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/picobench/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_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/picojson/all/test_package/CMakeLists.txt b/recipes/picojson/all/test_package/CMakeLists.txt index 26a59553dbe52..b4ff507e9ff8a 100644 --- a/recipes/picojson/all/test_package/CMakeLists.txt +++ b/recipes/picojson/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(picojson REQUIRED CONFIG) diff --git a/recipes/picojson/all/test_v1_package/CMakeLists.txt b/recipes/picojson/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 76b4af39af45d..0000000000000 --- a/recipes/picojson/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(picojson REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE picojson::picojson) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/picojson/all/test_v1_package/conanfile.py b/recipes/picojson/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/picojson/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_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/picosha2/all/test_package/CMakeLists.txt b/recipes/picosha2/all/test_package/CMakeLists.txt index 9a40eed23da8b..9a235a913bdd3 100644 --- a/recipes/picosha2/all/test_package/CMakeLists.txt +++ b/recipes/picosha2/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(picosha2 REQUIRED CONFIG) diff --git a/recipes/picosha2/all/test_v1_package/CMakeLists.txt b/recipes/picosha2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 145dcc03e0f3d..0000000000000 --- a/recipes/picosha2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/picosha2/all/test_v1_package/conanfile.py b/recipes/picosha2/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/picosha2/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/pipes/all/conanfile.py b/recipes/pipes/all/conanfile.py index c2e8937d21d4a..879b25bfc8b32 100644 --- a/recipes/pipes/all/conanfile.py +++ b/recipes/pipes/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.layout import basic_layout from conan.tools.scm import Version -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.50.0" class PipesConan(ConanFile): @@ -23,37 +23,35 @@ class PipesConan(ConanFile): no_copy_source = True @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 14 @property def _minimum_compilers_version(self): return { "Visual Studio": "15", + "msvc": "191", "gcc": "5", "clang": "3.4", "apple-clang": "5.1", } - def configure(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if not min_version: - self.output.warning(f"{self.name} recipe lacks information about the {self.settings.compiler} compiler support.") - 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 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) + + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if min_version and Version(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) diff --git a/recipes/pipes/all/test_package/CMakeLists.txt b/recipes/pipes/all/test_package/CMakeLists.txt index 39ba4f454e712..f31e3a93080d6 100644 --- a/recipes/pipes/all/test_package/CMakeLists.txt +++ b/recipes/pipes/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(pipes REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} pipes::pipes) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +target_link_libraries(${PROJECT_NAME} PRIVATE pipes::pipes) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/pipes/all/test_package/test_package.cpp b/recipes/pipes/all/test_package/test_package.cpp index 2050756e502b3..16c22b768a986 100644 --- a/recipes/pipes/all/test_package/test_package.cpp +++ b/recipes/pipes/all/test_package/test_package.cpp @@ -1,9 +1,14 @@ // Workaround for pipes not finding size_t #include +#include +#include +// FIXME: https://github.com/joboccara/pipes/pull/73 +#if __cplusplus >= 201703L +#include +#endif #include -#include int main() { auto source = std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; @@ -13,8 +18,5 @@ int main() { >>= pipes::transform([](int i){ return i * 2; }) >>= pipes::push_back(destination); - auto expected = std::vector{0, 4, 8, 12, 16}; - bool success = destination == expected; - - return success ? 0 : 1; + return EXIT_SUCCESS; } diff --git a/recipes/pistache/all/conandata.yml b/recipes/pistache/all/conandata.yml index 4badc3fded984..7d45092404e53 100644 --- a/recipes/pistache/all/conandata.yml +++ b/recipes/pistache/all/conandata.yml @@ -2,14 +2,27 @@ sources: "0.0.5": url: "https://github.com/pistacheio/pistache/archive/refs/tags/0.0.5.tar.gz" sha256: "e2da87ebc01367e33bd8d7800cb2bf5c23e9fb4e6f49dce2cab5f8756df8dca0" + "cci.20240107": + url: "https://github.com/pistacheio/pistache/archive/1c733a145b01a4737cf5c7dd3709bd85be404886.tar.gz" + sha256: "156d2a4503be3d6c0726009c83e6d2e6e2e6378e6136436fc2d82d13597b6b0b" "cci.20201127": url: "https://github.com/pistacheio/pistache/archive/a3c5c68e0f08e19331d53d12846079ad761fe974.tar.gz" sha256: "f1abb9e43ff847ebff8edb72623c9942162df134bccfb571af9c7817d3261fae" patches: + "0.0.5": + - patch_file: "patches/0.0.5-0001-include-cstdint.patch" + patch_description: "include " + patch_type: "portability" + patch_source: "https://github.com/pistacheio/pistache/pull/1142" "cci.20201127": - - patch_file: "patches/0001-remove-fpic.patch" + - patch_file: "patches/cci.20201127-0001-remove-fpic.patch" patch_description: "disable fPIC" patch_type: "conan" - - patch_file: "patches/0002-include-stddef.patch" + - patch_file: "patches/cci.20201127-0002-include-stddef.patch" + patch_description: "include " + patch_type: "portability" + patch_source: "https://github.com/pistacheio/pistache/pull/965" + - patch_file: "patches/cci.20201127-0003-include-cstdint.patch" patch_description: "include " patch_type: "portability" + patch_source: "https://github.com/pistacheio/pistache/pull/1142" diff --git a/recipes/pistache/all/conanfile.py b/recipes/pistache/all/conanfile.py index f80811935c92f..3577526d2b30c 100644 --- a/recipes/pistache/all/conanfile.py +++ b/recipes/pistache/all/conanfile.py @@ -16,12 +16,12 @@ class PistacheConan(ConanFile): name = "pistache" + description = "Pistache is a modern and elegant HTTP and REST framework for C++" license = "Apache-2.0" - homepage = "https://github.com/pistacheio/pistache" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/pistacheio/pistache" topics = ("http", "rest", "framework", "networking") - description = "Pistache is a modern and elegant HTTP and REST framework for C++" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -34,6 +34,17 @@ class PistacheConan(ConanFile): "with_ssl": False, } + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "6", + } + def export_sources(self): export_conandata_patches(self) @@ -52,37 +63,32 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("rapidjson/cci.20220822") + self.requires("rapidjson/cci.20230929") if self.options.with_ssl: - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") if self.version != "cci.20201127": self.requires("date/3.0.1") def validate(self): - compilers = { - "gcc": "7", - "clang": "6", - } if self.settings.os != "Linux": raise ConanInvalidConfiguration(f"{self.ref} is only support on Linux.") - if self.settings.compiler == "clang": - raise ConanInvalidConfiguration("Clang support is broken. See pistacheio/pistache#835.") + if self.settings.compiler == "clang" and self.version in ["cci.20201127", "0.0.5"]: + raise ConanInvalidConfiguration(f"{self.ref}'s clang support is broken. See pistacheio/pistache#835.") if self.settings.compiler.cppstd: - check_min_cppstd(self, 17) - minimum_compiler = compilers.get(str(self.settings.compiler)) - if minimum_compiler: - if Version(self.settings.compiler.version) < minimum_compiler: - raise ConanInvalidConfiguration(f"{self.ref} requires c++17, which your compiler does not support.") - else: - self.output.warn(f"{self.ref} requires c++17, but this compiler is unknown to this recipe. Assuming your compiler supports c++17.") + 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): if self.version != "cci.20201127": - self.tool_requires("meson/1.0.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/1.9.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -116,8 +122,8 @@ def build(self): apply_conandata_patches(self) if self.version != "cci.20201127": replace_in_file(self, os.path.join(self.source_folder, "meson.build"), - "dependency('RapidJSON', fallback: ['rapidjson', 'rapidjson_dep']),", - "dependency('rapidjson', fallback: ['rapidjson', 'rapidjson_dep']),") + "dependency('RapidJSON', fallback: ['rapidjson', 'rapidjson_dep'])", + "dependency('rapidjson', fallback: ['rapidjson', 'rapidjson_dep'])") if self.version == "cci.20201127": cmake = CMake(self) @@ -152,11 +158,15 @@ def package_info(self): self.cpp_info.components["libpistache"].libs = collect_libs(self) self.cpp_info.components["libpistache"].requires = ["rapidjson::rapidjson"] + if self.version != "cci.20201127": + self.cpp_info.components["libpistache"].requires.append("date::date") if self.options.with_ssl: self.cpp_info.components["libpistache"].requires.append("openssl::openssl") self.cpp_info.components["libpistache"].defines = ["PISTACHE_USE_SSL=1"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libpistache"].system_libs = ["pthread"] + if self.version != "cci.20201127": + self.cpp_info.components["libpistache"].system_libs.append("m") # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "Pistache" diff --git a/recipes/pistache/all/patches/0.0.5-0001-include-cstdint.patch b/recipes/pistache/all/patches/0.0.5-0001-include-cstdint.patch new file mode 100644 index 0000000000000..459b71e89e5e7 --- /dev/null +++ b/recipes/pistache/all/patches/0.0.5-0001-include-cstdint.patch @@ -0,0 +1,13 @@ +diff --git a/include/pistache/flags.h b/include/pistache/flags.h +index 9be2b32..ed37150 100644 +--- a/include/pistache/flags.h ++++ b/include/pistache/flags.h +@@ -11,7 +11,7 @@ + */ + + #pragma once +- ++#include + #include + #include + #include diff --git a/recipes/pistache/all/patches/0001-remove-fpic.patch b/recipes/pistache/all/patches/cci.20201127-0001-remove-fpic.patch similarity index 100% rename from recipes/pistache/all/patches/0001-remove-fpic.patch rename to recipes/pistache/all/patches/cci.20201127-0001-remove-fpic.patch diff --git a/recipes/pistache/all/patches/0002-include-stddef.patch b/recipes/pistache/all/patches/cci.20201127-0002-include-stddef.patch similarity index 100% rename from recipes/pistache/all/patches/0002-include-stddef.patch rename to recipes/pistache/all/patches/cci.20201127-0002-include-stddef.patch diff --git a/recipes/pistache/all/patches/cci.20201127-0003-include-cstdint.patch b/recipes/pistache/all/patches/cci.20201127-0003-include-cstdint.patch new file mode 100644 index 0000000000000..93b9a3569853b --- /dev/null +++ b/recipes/pistache/all/patches/cci.20201127-0003-include-cstdint.patch @@ -0,0 +1,13 @@ +diff --git a/include/pistache/flags.h b/include/pistache/flags.h +index 2538773..fcd0252 100644 +--- a/include/pistache/flags.h ++++ b/include/pistache/flags.h +@@ -5,7 +5,7 @@ + */ + + #pragma once +- ++#include + #include + #include + #include diff --git a/recipes/pistache/all/test_package/CMakeLists.txt b/recipes/pistache/all/test_package/CMakeLists.txt index 879baa5c03bf1..fd8a15bd81880 100644 --- a/recipes/pistache/all/test_package/CMakeLists.txt +++ b/recipes/pistache/all/test_package/CMakeLists.txt @@ -4,7 +4,7 @@ project(test_package LANGUAGES CXX) find_package(Pistache REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} Pistache::Pistache) +target_link_libraries(${PROJECT_NAME} PRIVATE Pistache::Pistache) if(Pistache_VERSION EQUAL "cci.20201127") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) else() diff --git a/recipes/pistache/all/test_v1_package/CMakeLists.txt b/recipes/pistache/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/pistache/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pistache/all/test_v1_package/conanfile.py b/recipes/pistache/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/pistache/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/pistache/config.yml b/recipes/pistache/config.yml index 7515a206bd537..3f8e40dcd1442 100644 --- a/recipes/pistache/config.yml +++ b/recipes/pistache/config.yml @@ -1,5 +1,7 @@ versions: "0.0.5": folder: all + "cci.20240107": + folder: all "cci.20201127": folder: all diff --git a/recipes/pixman/all/conandata.yml b/recipes/pixman/all/conandata.yml index 4a6a13bbe99c7..dc1f3f424ea14 100644 --- a/recipes/pixman/all/conandata.yml +++ b/recipes/pixman/all/conandata.yml @@ -1,26 +1,22 @@ sources: + "0.43.4": + url: + - "https://www.cairographics.org/releases/pixman-0.43.4.tar.gz" + - "https://www.x.org/releases/individual/lib/pixman-0.43.4.tar.gz" + sha256: "a0624db90180c7ddb79fc7a9151093dc37c646d8c38d3f232f767cf64b85a226" + "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" + 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" - sha256: "6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc" - "0.38.4": - url: "https://www.cairographics.org/releases/pixman-0.38.4.tar.gz" - sha256: "da66d6fd6e40aee70f7bd02e4f8f76fc3f006ec879d346bae6a723025cfbdde7" patches: "0.42.2": - patch_file: "patches/0.42.2-0001-pixman-arma64-Adjustments-to-build-with-llvm-integra.patch" patch_description: "Adjustments to build for arm64 with LLVM's assembler" patch_type: "portability" patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/71" - "0.40.0": - - patch_file: "patches/0001-incompatible-pointer-types.patch" - patch_description: "backport fix for clang build" - patch_type: "portability" - patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/48" - "0.38.4": - - patch_file: "patches/0002-meson-build.patch" - patch_description: "backport meson build files from 0.40.0 to fix windows build" - patch_type: "portability" - patch_source: "https://gitlab.freedesktop.org/pixman/pixman/-/tree/pixman-0.40.0" diff --git a/recipes/pixman/all/conanfile.py b/recipes/pixman/all/conanfile.py index aca2fe9a7ec26..d2d66d83f8c74 100644 --- a/recipes/pixman/all/conanfile.py +++ b/recipes/pixman/all/conanfile.py @@ -1,7 +1,6 @@ import os 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 ( @@ -21,7 +20,7 @@ class PixmanConan(ConanFile): topics = ("graphics", "compositing", "rasterization") url = "https://github.com/conan-io/conan-center-index" homepage = "https://gitlab.freedesktop.org/pixman/pixman" - license = ("LGPL-2.1-only", "MPL-1.1") + license = ("MIT") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -49,12 +48,8 @@ def configure(self): def layout(self): basic_layout(self, src_folder="src") - def validate(self): - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("pixman can only be built as a static library on Windows") - def build_requirements(self): - self.tool_requires("meson/1.2.3") + self.tool_requires("meson/1.4.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -67,6 +62,13 @@ def generate(self): "libpng": "disabled", "gtk": "disabled" }) + + # Android armv7 build of Pixman makes use of cpu-features functionality, provided in the NDK + if self.settings.os == "Android": + android_ndk_home = self.conf.get("tools.android:ndk_path").replace("\\", "/") + cpu_features_path = os.path.join(android_ndk_home, "sources", "android", "cpufeatures") + tc.project_options.update({'cpu-features-path' : cpu_features_path}) + tc.generate() def _patch_sources(self): @@ -84,16 +86,17 @@ 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")) lib_folder = os.path.join(self.package_folder, "lib") rmdir(self, os.path.join(lib_folder, "pkgconfig")) rm(self, "*.la", lib_folder) fix_apple_shared_install_name(self) - if is_msvc(self): + if is_msvc(self) and not self.options.shared: prefix = "libpixman-1" 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 = ['libpixman-1'] if self.settings.os == "Windows" else ['pixman-1'] + self.cpp_info.libs = ['libpixman-1'] if self.settings.os == "Windows" and not self.options.shared 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/0001-incompatible-pointer-types.patch b/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch deleted file mode 100644 index ee95a8b091433..0000000000000 --- a/recipes/pixman/all/patches/0001-incompatible-pointer-types.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c -index 4cfabe3..3832e2b 100644 ---- a/pixman/pixman-bits-image.c -+++ b/pixman/pixman-bits-image.c -@@ -1051,14 +1051,14 @@ dest_write_back_narrow (pixman_iter_t *iter) - iter->y++; - } - --static const float -+static float - dither_factor_blue_noise_64 (int x, int y) - { - float m = dither_blue_noise_64x64[((y & 0x3f) << 6) | (x & 0x3f)]; - return m * (1. / 4096.f) + (1. / 8192.f); - } - --static const float -+static float - dither_factor_bayer_8 (int x, int y) - { - uint32_t m; diff --git a/recipes/pixman/all/patches/0002-meson-build.patch b/recipes/pixman/all/patches/0002-meson-build.patch deleted file mode 100644 index 6063b377301a8..0000000000000 --- a/recipes/pixman/all/patches/0002-meson-build.patch +++ /dev/null @@ -1,253 +0,0 @@ -diff --git a/meson.build b/meson.build -index fad22ee..519441b 100644 ---- a/meson.build -+++ b/meson.build -@@ -23,7 +23,7 @@ project( - ['c'], - version : '0.38.4', - license : 'MIT', -- meson_version : '>= 0.47.2', -+ meson_version : '>= 0.50.0', - default_options : ['buildtype=debugoptimized'], - ) - -@@ -36,6 +36,7 @@ add_project_arguments( - '-Wdeclaration-after-statement', - '-fno-strict-aliasing', - '-fvisibility=hidden', -+ '-Wundef', - ]), - language : ['c'] - ) -@@ -50,7 +51,7 @@ endforeach - - use_loongson_mmi = get_option('loongson-mmi') - have_loongson_mmi = false --loongson_mmi_flags = ['-march=loongson2f'] -+loongson_mmi_flags = ['-mloongson-mmi'] - if not use_loongson_mmi.disabled() - if host_machine.cpu_family() == 'mips64' and cc.compiles(''' - #ifndef __mips_loongson_vector_rev -@@ -84,9 +85,17 @@ endif - - use_mmx = get_option('mmx') - have_mmx = false --mmx_flags = ['-mmmx', '-Winline'] -+mmx_flags = [] -+ -+if cc.get_id() == 'msvc' -+ mmx_flags = ['/w14710', '/w14714', '/wd4244'] -+elif cc.get_id() == 'sun' -+ mmx_flags = ['-xarch=sse'] -+else -+ mmx_flags = ['-mmmx', '-Winline'] -+endif - if not use_mmx.disabled() -- if host_machine.cpu_family() == 'x86_64' -+ if host_machine.cpu_family() == 'x86_64' or cc.get_id() == 'msvc' - have_mmx = true - elif host_machine.cpu_family() == 'x86' and cc.compiles(''' - #include -@@ -127,14 +136,23 @@ if not use_mmx.disabled() - endif - - if have_mmx -- config.set10('USE_X86_MMX', true) -+ # Inline assembly do not work on X64 MSVC, so we use -+ # compatibility intrinsics there -+ if cc.get_id() != 'msvc' or host_machine.cpu_family() != 'x86_64' -+ config.set10('USE_X86_MMX', true) -+ endif - elif use_mmx.enabled() - error('MMX Support unavailable, but required') - endif - - use_sse2 = get_option('sse2') - have_sse2 = false --sse2_flags = ['-msse2', '-Winline'] -+sse2_flags = [] -+if cc.get_id() == 'sun' -+ sse2_flags = ['-xarch=sse2'] -+elif cc.get_id() != 'msvc' -+ sse2_flags = ['-msse2', '-Winline'] -+endif - if not use_sse2.disabled() - if host_machine.cpu_family() == 'x86' - if cc.compiles(''' -@@ -169,8 +187,13 @@ endif - - use_ssse3 = get_option('ssse3') - have_ssse3 = false --ssse3_flags =['-mssse3', '-Winline'] --if not use_ssse3.disabled() -+ssse3_flags = [] -+if cc.get_id() != 'msvc' -+ ssse3_flags = ['-mssse3', '-Winline'] -+endif -+ -+# x64 pre-2010 MSVC compilers crashes when building the ssse3 code -+if not use_ssse3.disabled() and not (cc.get_id() == 'msvc' and cc.version().version_compare('<16') and host_machine.cpu_family() == 'x86_64') - if host_machine.cpu_family().startswith('x86') - if cc.compiles(''' - #include -@@ -349,14 +372,21 @@ if get_option('gnuplot') - config.set('PIXMAN_GNUPLOT', 1) - endif - --dep_openmp = dependency('openmp', required : get_option('openmp')) --if dep_openmp.found() -- config.set10('USE_OPENMP', true) --elif meson.version().version_compare('<0.51.0') --# In versions of meson before 0.51 the openmp dependency can still --# inject arguments in the the auto case when it is not found, the --# detection does work correctly in that case however, so we just --# replace dep_openmp with null_dep to work around this. -+if cc.get_id() != 'msvc' -+ dep_openmp = dependency('openmp', required : get_option('openmp')) -+ if dep_openmp.found() -+ config.set10('USE_OPENMP', true) -+ elif meson.version().version_compare('<0.51.0') -+ # In versions of meson before 0.51 the openmp dependency can still -+ # inject arguments in the the auto case when it is not found, the -+ # detection does work correctly in that case however, so we just -+ # replace dep_openmp with null_dep to work around this. -+ dep_openmp = null_dep -+ endif -+else -+ # the MSVC implementation of openmp is not compliant enough for our -+ # uses here, so we disable it here. -+ # Please see: https://stackoverflow.com/questions/12560243/using-threadprivate-directive-in-visual-studio - dep_openmp = null_dep - endif - -@@ -364,17 +394,56 @@ dep_gtk = dependency('gtk+-2.0', version : '>= 2.16', required : get_option('gtk - dep_glib = dependency('glib-2.0', required : get_option('gtk')) - dep_pixman = dependency('pixman-1', required : get_option('gtk'), - version : '>= ' + meson.project_version()) --dep_png = dependency('libpng', required : get_option('libpng')) -+ -+dep_png = null_dep -+if not get_option('libpng').disabled() -+ dep_png = dependency('libpng', required : false) -+ -+ # We need to look for the right library to link to for libpng, -+ # when looking for libpng manually -+ foreach png_ver : [ '16', '15', '14', '13', '12', '10' ] -+ if not dep_png.found() -+ dep_png = cc.find_library('libpng@0@'.format(png_ver), has_headers : ['png.h'], required : false) -+ endif -+ endforeach -+ -+ if get_option('libpng').enabled() and not dep_png.found() -+ error('libpng support requested but libpng library not found') -+ endif -+endif -+ - if dep_png.found() - config.set('HAVE_LIBPNG', 1) - endif - dep_m = cc.find_library('m', required : false) - dep_threads = dependency('threads') --if dep_threads.found() -+ -+# MSVC-style compilers do not come with pthreads, so we must link -+# to it explicitly, currently pthreads-win32 is supported -+pthreads_found = false -+ -+if dep_threads.found() and cc.has_header('pthread.h') -+ if cc.get_argument_syntax() == 'msvc' -+ pthread_lib = null_dep -+ foreach pthread_type : ['VC3', 'VSE3', 'VCE3', 'VC2', 'VSE2', 'VCE2'] -+ if not pthread_lib.found() -+ pthread_lib = cc.find_library('pthread@0@'.format(pthread_type), required : false) -+ endif -+ endforeach -+ if pthread_lib.found() -+ pthreads_found = true -+ dep_threads = pthread_lib -+ endif -+ else -+ pthreads_found = true -+ endif -+endif -+ -+if pthreads_found - config.set('HAVE_PTHREADS', 1) - endif - --funcs = ['sigaction', 'alarm', 'mprotect', 'getpagesize', 'mmap'] -+funcs = ['sigaction', 'alarm', 'mprotect', 'getpagesize', 'mmap', 'getisax', 'gettimeofday'] - # mingw claimes to have posix_memalign, but it doesn't - if host_machine.system() != 'windows' - funcs += 'posix_memalign' -@@ -386,10 +455,6 @@ foreach f : funcs - endif - endforeach - --if cc.has_function('gettimeofday') -- config.set('HAVE_GETTIMEOFDAY', 1) --endif -- - # This is only used in one test, that defines _GNU_SOURCE - if cc.has_function('feenableexcept', - prefix : '#define _GNU_SOURCE\n#include ', -@@ -407,8 +472,12 @@ foreach h : ['sys/mman.h', 'fenv.h', 'unistd.h'] - endif - endforeach - -+# gcc on Windows only warns that __declspec(thread) isn't supported, -+# passing -Werror=attributes makes it fail. - if (host_machine.system() == 'windows' and -- cc.compiles('int __declspec(thread) foo;', name : 'TLS via __declspec(thread)')) -+ cc.compiles('int __declspec(thread) foo;', -+ args : cc.get_supported_arguments(['-Werror=attributes']), -+ name : 'TLS via __declspec(thread)')) - config.set('TLS', '__declspec(thread)') - elif cc.compiles('int __thread foo;', name : 'TLS via __thread') - config.set('TLS', '__thread') -@@ -445,6 +514,8 @@ if host_machine.endian() == 'big' - config.set('WORDS_BIGENDIAN', 1) - endif - -+config.set('SIZEOF_LONG', cc.sizeof('long')) -+ - # Required to make pixman-private.h - config.set('PACKAGE', 'foo') - -diff --git a/pixman/meson.build b/pixman/meson.build -index 6ce87e7..f48357f 100644 ---- a/pixman/meson.build -+++ b/pixman/meson.build -@@ -30,6 +30,11 @@ version_h = configure_file( - install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'pixman-1') - ) - -+libpixman_extra_cargs = [] -+if cc.has_function_attribute('dllexport') -+ libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)'] -+endif -+ - pixman_simd_libs = [] - simds = [ - # the mmx library can be compiled with mmx on x86/x86_64, iwmmxt on -@@ -97,10 +102,18 @@ pixman_files = files( - 'pixman-utils.c', - ) - --libpixman = shared_library( -+# We cannot use 'link_with' or 'link_whole' because meson wont do the right -+# thing for static archives. -+_obs = [] -+foreach l : pixman_simd_libs -+ _obs += l.extract_all_objects() -+endforeach -+ -+libpixman = library( - 'pixman-1', - [pixman_files, config_h, version_h], -- link_with : [pixman_simd_libs], -+ objects : _obs, -+ c_args : libpixman_extra_cargs, - dependencies : [dep_m, dep_threads], - version : meson.project_version(), - install : true, diff --git a/recipes/pixman/all/test_package/CMakeLists.txt b/recipes/pixman/all/test_package/CMakeLists.txt index f938457c94703..37b602ee44bd6 100644 --- a/recipes/pixman/all/test_package/CMakeLists.txt +++ b/recipes/pixman/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(pixman CONFIG REQUIRED) diff --git a/recipes/pixman/all/test_v1_package/CMakeLists.txt b/recipes/pixman/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/pixman/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pixman/all/test_v1_package/conanfile.py b/recipes/pixman/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/pixman/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", "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/pixman/config.yml b/recipes/pixman/config.yml index 6f0c577480090..c3e710db89855 100644 --- a/recipes/pixman/config.yml +++ b/recipes/pixman/config.yml @@ -1,7 +1,7 @@ versions: - "0.42.2": + "0.43.4": folder: "all" - "0.40.0": + "0.43.0": folder: "all" - "0.38.4": + "0.42.2": folder: "all" diff --git a/recipes/pkgconf/all/conandata.yml b/recipes/pkgconf/all/conandata.yml index 413c62bff29ba..33c2bc45652a3 100644 --- a/recipes/pkgconf/all/conandata.yml +++ b/recipes/pkgconf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.xz" + sha256: "b06ff63a83536aa8c2f6422fa80ad45e4833f590266feb14eaddfe1d4c853c69" "2.1.0": url: "https://distfiles.ariadne.space/pkgconf/pkgconf-2.1.0.tar.xz" sha256: "266d5861ee51c52bc710293a1d36622ae16d048d71ec56034a02eb9cf9677761" @@ -21,6 +24,8 @@ sources: url: "https://distfiles.ariadne.space/pkgconf/pkgconf-1.7.3.tar.xz" sha256: "b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0" patches: + "2.2.0": + - patch_file: "patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" "2.1.0": - patch_file: "patches/2.1.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch" "2.0.3": diff --git a/recipes/pkgconf/all/patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch b/recipes/pkgconf/all/patches/2.2.0-0001-PKG_CONF_PATH-allow-colon+semicolon-separator.patch new file mode 100644 index 0000000000000..344efd99da6e2 --- /dev/null +++ b/recipes/pkgconf/all/patches/2.2.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/all/test_package/conanfile.py b/recipes/pkgconf/all/test_package/conanfile.py index bf269283d5b1b..b2de624f38ef9 100644 --- a/recipes/pkgconf/all/test_package/conanfile.py +++ b/recipes/pkgconf/all/test_package/conanfile.py @@ -15,38 +15,24 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" test_type = "explicit" - win_bash = True @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def requirements(self): - self.requires(self.tested_reference_str) # for the library - - def build_requirements(self): - self.tool_requires(self.tested_reference_str) # for the executable - self.tool_requires("automake/1.16.5") - if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): - self.tool_requires("msys2/cci.latest") + self.requires(self.tested_reference_str, run=True) def layout(self): cmake_layout(self, src_folder="src") def generate(self): - # Autotools project to test integration pkgconfig works - # during an Autotools configure run - at = AutotoolsToolchain(self) - at.generate() # Expose `PKG_CONFIG_PATH` to be able to find libexample1.pc env = Environment() - self.output.warning(f"Source folder: {self.source_folder}") + self.output.info(f"Source folder: {self.source_folder}") env.prepend_path("PKG_CONFIG_PATH", self.source_folder) - env.vars(self, scope="build").save_script("pkgconf-config-path") - - buildenv = VirtualBuildEnv(self) - buildenv.generate() + env.vars(self, scope="run").save_script("pkgconf-config-path") # CMake project to test that we can link against the library, # when the library is built @@ -56,6 +42,14 @@ def generate(self): deps = CMakeDeps(self) deps.generate() + # Check build environment postconditions + buildenv = VirtualBuildEnv(self) + env = buildenv.vars(scope='build') + assert 'PKG_CONFIG' in env.keys() + assert 'ACLOCAL_PATH' in env.keys() + assert 'AUTOMAKE_CONAN_INCLUDES' in env.keys() + buildenv.generate() + @property def _testing_library(self): # Workaround, in Conan >=2.0 we should be able to remove this in favour of: @@ -64,12 +58,6 @@ def _testing_library(self): return has_toolchain def build(self): - # Test that configure doesn't fail, we are not building the - # autotools project - autotools = Autotools(self) - autotools.autoreconf() - autotools.configure() - if self._testing_library: cmake = CMake(self) cmake.configure() @@ -78,14 +66,17 @@ def build(self): def test(self): # Check that we can find pkgconf in build environment # and that it is the expected version - output = StringIO() - self.run("pkgconf --about", output, env="conanbuild") - # TODO: When recipe is Conan 2+ only, this can be simplified - # to: self.dependencies['pkgconf'].ref.version - tokens = re.split('[@#]', self.tested_reference_str) - pkgconf_expected_version = tokens[0].split("/", 1)[1] - assert f"pkgconf {pkgconf_expected_version}" in output.getvalue() - + if can_run(self): + output = StringIO() + self.run("pkgconf --about", output, env="conanrun") + # TODO: When recipe is Conan 2+ only, this can be simplified + # to: self.dependencies['pkgconf'].ref.version + tokens = re.split('[@#]', self.tested_reference_str) + pkgconf_expected_version = tokens[0].split("/", 1)[1] + assert f"pkgconf {pkgconf_expected_version}" in output.getvalue() + + self.run("pkgconf libexample1 -cflags", env="conanrun") + # Test that executable linked against library runs as expected if can_run(self) and self._testing_library: test_executable = unix_path(self, os.path.join(self.cpp.build.bindirs[0], "test_package")) diff --git a/recipes/pkgconf/all/test_package/src/configure.ac b/recipes/pkgconf/all/test_package/src/configure.ac deleted file mode 100644 index 9b58503d96f4d..0000000000000 --- a/recipes/pkgconf/all/test_package/src/configure.ac +++ /dev/null @@ -1,9 +0,0 @@ -AC_INIT([test_package_pkgconf],[1.0]) -AC_PREREQ([2.69]) - -PKG_PREREQ([0.29]) -PKG_PROG_PKG_CONFIG -[echo pkg-config executable found at $PKG_CONFIG!] -PKG_CHECK_EXISTS([libexample1], - [echo "found libexample1 :D"], - [echo "libexample1 not found :("]) diff --git a/recipes/pkgconf/all/test_v1_package/CMakeLists.txt b/recipes/pkgconf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f8b971e2db377..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -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/pkgconf/all/test_v1_package/conanfile.py b/recipes/pkgconf/all/test_v1_package/conanfile.py deleted file mode 100644 index b2a27f28edf88..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,56 +0,0 @@ -from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools, RunEnvironment -from conans.errors import ConanException -import os -import shutil - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - test_type = "explicit" - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - 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 build(self): - # Test pkg.m4 integration into automake - shutil.copy(os.path.join(self.source_folder, "configure.ac"), - os.path.join(self.build_folder, "configure.ac")) - 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) - with tools.environment_append(RunEnvironment(self).vars): - autotools.configure() - - if self.options["pkgconf"].enable_lib: - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - if self.options["pkgconf"].enable_lib: - self.run(os.path.join("bin", "test_package"), run_environment=True) - - pkg_config = tools.get_env("PKG_CONFIG") - self.output.info("Read environment variable PKG_CONFIG='{}'".format(pkg_config)) - if not pkg_config or not pkg_config.startswith(self.deps_cpp_info["pkgconf"].rootpath.replace("\\", "/")): - raise ConanException("PKG_CONFIG variable incorrect") - - pkgconf_path = tools.which("pkgconf").replace("\\", "/") - self.output.info("Found pkgconf at '{}'".format(pkgconf_path)) - if not pkgconf_path or not pkgconf_path.startswith(self.deps_cpp_info["pkgconf"].rootpath.replace("\\", "/")): - raise ConanException("pkgconf executable not found") - - with tools.environment_append({"PKG_CONFIG_PATH": self.source_folder}): - self.run("{} libexample1 --libs".format(os.environ["PKG_CONFIG"]), run_environment=True) - self.run("{} libexample1 --cflags".format(os.environ["PKG_CONFIG"]), run_environment=True) diff --git a/recipes/pkgconf/all/test_v1_package/configure.ac b/recipes/pkgconf/all/test_v1_package/configure.ac deleted file mode 100644 index f9bf1936b8123..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/configure.ac +++ /dev/null @@ -1,9 +0,0 @@ -AC_INIT([test_package_pkgconf],[1.0]) -AC_PREREQ([2.69]) - -PKG_PREREQ([0.29]) -PKG_PROG_PKG_CONFIG -[echo pkg-config executable found at $PKG_CONFIG!] -PKG_CHECK_EXISTS([sdl2], - [echo "found SDL2 :D"], - [echo "SDL2 not found :("]) diff --git a/recipes/pkgconf/all/test_v1_package/libexample1.pc b/recipes/pkgconf/all/test_v1_package/libexample1.pc deleted file mode 100644 index 5fc1beac53aac..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/libexample1.pc +++ /dev/null @@ -1,6 +0,0 @@ -Name: libexample1 -Description: This is a description of libexample1. -Requires: -Version: 0.42 -Libs: -L/usr/lib -lexample1 -Cflags: -I/usr/include/libexample1 -I/usr/include -DEXAMPLE1_STATIC diff --git a/recipes/pkgconf/all/test_v1_package/test_package.c b/recipes/pkgconf/all/test_v1_package/test_package.c deleted file mode 100644 index f8fd8ee550059..0000000000000 --- a/recipes/pkgconf/all/test_v1_package/test_package.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "libpkgconf/libpkgconf.h" - -#include -#include -#include - -bool error_callback(const char *msg, const pkgconf_client_t *client, const void *data) { - printf("error callback: %s\n", msg); - fflush(stdout); - return 1; // 1/true means message handled -} - -int main() { - pkgconf_client_t client; - memset(&client, 0, sizeof(client)); - - pkgconf_client_init(&client, error_callback, NULL, pkgconf_cross_personality_default()); - - pkgconf_error(&client, "%s:%d %s: %s", __FILE__, __LINE__, __FUNCTION__, "test error"); - - pkgconf_client_deinit(&client); - - return 0; -} diff --git a/recipes/pkgconf/config.yml b/recipes/pkgconf/config.yml index f64bc13961492..369e560764ca3 100644 --- a/recipes/pkgconf/config.yml +++ b/recipes/pkgconf/config.yml @@ -1,4 +1,6 @@ versions: + "2.2.0": + folder: "all" "2.1.0": folder: "all" "2.0.3": diff --git a/recipes/platform.converters/all/test_v1_package/CMakeLists.txt b/recipes/platform.converters/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/platform.converters/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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.converters/all/test_v1_package/conanfile.py b/recipes/platform.converters/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/platform.converters/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", "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.delegates/all/test_package/CMakeLists.txt b/recipes/platform.delegates/all/test_package/CMakeLists.txt index 96e9a79f01ce8..6ae8a7e83053a 100644 --- a/recipes/platform.delegates/all/test_package/CMakeLists.txt +++ b/recipes/platform.delegates/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(platform.delegates REQUIRED CONFIG) diff --git a/recipes/platform.equality/all/test_v1_package/CMakeLists.txt b/recipes/platform.equality/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/platform.equality/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/platform.equality/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", "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/test_v1_package/CMakeLists.txt b/recipes/platform.exceptions/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/platform.exceptions/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/platform.exceptions/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", "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.interfaces/all/test_package/CMakeLists.txt b/recipes/platform.interfaces/all/test_package/CMakeLists.txt index b54dd14513b95..2c8f12fd55df7 100644 --- a/recipes/platform.interfaces/all/test_package/CMakeLists.txt +++ b/recipes/platform.interfaces/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(Platform.Interfaces REQUIRED CONFIG) diff --git a/recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt b/recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/platform.interfaces/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/platform.interfaces/all/test_v1_package/conanfile.py b/recipes/platform.interfaces/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/platform.interfaces/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/platformfolders/all/conandata.yml b/recipes/platformfolders/all/conandata.yml new file mode 100644 index 0000000000000..be79160f2c84f --- /dev/null +++ b/recipes/platformfolders/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.2.0": + url: "https://github.com/sago007/PlatformFolders/archive/refs/tags/4.2.0.tar.gz" + sha256: "31bb0f64a27315aec8994f226332aaafe9888d00bb69a2ff2dff9912e2f4ccf4" diff --git a/recipes/platformfolders/all/conanfile.py b/recipes/platformfolders/all/conanfile.py new file mode 100644 index 0000000000000..e9a661cbf1d78 --- /dev/null +++ b/recipes/platformfolders/all/conanfile.py @@ -0,0 +1,82 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.53.0" + + +class PlatformFoldersConan(ConanFile): + name = "platformfolders" + license = "MIT" + homepage = "https://github.com/sago007/PlatformFolders" + url = "https://github.com/conan-io/conan-center-index" + description = "A C++ library to look for special directories like My Documents and APPDATA so that you do not need to write Linux, Windows or Mac OS X specific code" + topics = ("multi-platform", "xdg", "standardpaths", "special-folders") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _minimum_cpp_standard(self): + return 11 + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + 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 is_msvc(self): + self.package_type = "static-library" + del self.options.shared + + 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["PLATFORMFOLDERS_BUILD_TESTING"] = False + tc.variables["PLATFORMFOLDERS_BUILD_SHARED_LIBS"] = self.options.get_safe("shared", default=False) + tc.variables["PLATFORMFOLDERS_ENABLE_INSTALL"] = True + 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, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["platform_folders"] + self.cpp_info.set_property("cmake_file_name", "platform_folders") + self.cpp_info.set_property("cmake_target_name", "sago::platform_folders") + self.cpp_info.set_property("cmake_target_aliases", ["platform_folders"]) + + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.append("m") diff --git a/recipes/platformfolders/all/test_package/CMakeLists.txt b/recipes/platformfolders/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c75dde66e6a67 --- /dev/null +++ b/recipes/platformfolders/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(platform_folders REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sago::platform_folders) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/platformfolders/all/test_package/conanfile.py b/recipes/platformfolders/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b8c7713c1ed31 --- /dev/null +++ b/recipes/platformfolders/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/platformfolders/all/test_package/test_package.cpp b/recipes/platformfolders/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4570e8f5de608 --- /dev/null +++ b/recipes/platformfolders/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include + +#include + +int main() { + std::cout << "Config: " << sago::getConfigHome() << "\n"; + std::cout << "Data: " << sago::getDataHome() << "\n"; + std::cout << "State: " << sago::getStateDir() << "\n"; + std::cout << "Cache: " << sago::getCacheDir() << "\n"; + std::cout << "Documents: " << sago::getDocumentsFolder() << "\n"; + std::cout << "Desktop: " << sago::getDesktopFolder() << "\n"; + std::cout << "Pictures: " << sago::getPicturesFolder() << "\n"; + std::cout << "Music: " << sago::getMusicFolder() << "\n"; + std::cout << "Video: " << sago::getVideoFolder() << "\n"; + std::cout << "Download: " << sago::getDownloadFolder() << "\n"; + std::cout << "Save Games 1: " << sago::getSaveGamesFolder1() << "\n"; + std::cout << "Save Games 2: " << sago::getSaveGamesFolder2() << "\n"; + return 0; +} diff --git a/recipes/platformfolders/config.yml b/recipes/platformfolders/config.yml new file mode 100644 index 0000000000000..1b309b8e878d8 --- /dev/null +++ b/recipes/platformfolders/config.yml @@ -0,0 +1,3 @@ +versions: + "4.2.0": + folder: "all" diff --git a/recipes/playrho/all/conandata.yml b/recipes/playrho/all/conandata.yml index df36531f2762c..93527003a275f 100644 --- a/recipes/playrho/all/conandata.yml +++ b/recipes/playrho/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.2": + url: "https://github.com/louis-langholtz/PlayRho/archive/refs/tags/v1.1.2.tar.gz" + sha256: "b8e61eace48607c545a495c742479fb58e7ea34b8dfe7f874a14b8414135cccc" "1.1.0": url: "https://github.com/louis-langholtz/PlayRho/archive/refs/tags/v1.1.0.tar.gz" sha256: "45c0337440387a85a97a4b7907b79f780233bf2062635471b71a32245b0c0158" diff --git a/recipes/playrho/all/conanfile.py b/recipes/playrho/all/conanfile.py index 619e24882a463..57ba703a4b37c 100644 --- a/recipes/playrho/all/conanfile.py +++ b/recipes/playrho/all/conanfile.py @@ -4,6 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, rename from conan.tools.scm import Version @@ -67,10 +68,15 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) + def build_requirements(self): + self.tool_requires("cmake/[>=3.16.3 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + VirtualBuildEnv(self).generate() + tc = CMakeToolchain(self) tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.variables["PLAYRHO_BUILD_SHARED"] = self.options.shared diff --git a/recipes/playrho/all/test_v1_package/CMakeLists.txt b/recipes/playrho/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/playrho/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 61ac8b9318290..0000000000000 --- a/recipes/playrho/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/playrho/config.yml b/recipes/playrho/config.yml index 11b7aff3a5ac4..0108ac3e087d5 100644 --- a/recipes/playrho/config.yml +++ b/recipes/playrho/config.yml @@ -1,3 +1,5 @@ versions: + "1.1.2": + folder: "all" "1.1.0": folder: "all" diff --git a/recipes/plf_colony/all/test_package/CMakeLists.txt b/recipes/plf_colony/all/test_package/CMakeLists.txt index 34e86e5b98356..c6406177570a1 100644 --- a/recipes/plf_colony/all/test_package/CMakeLists.txt +++ b/recipes/plf_colony/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(plf_colony REQUIRED CONFIG) diff --git a/recipes/plf_colony/all/test_v1_package/CMakeLists.txt b/recipes/plf_colony/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/plf_colony/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/plf_colony/all/test_v1_package/conanfile.py b/recipes/plf_colony/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/plf_colony/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_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/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/all/test_package/CMakeLists.txt b/recipes/plf_indiesort/all/test_package/CMakeLists.txt index 16762d24eeb1e..3fdd8aeeaa404 100644 --- a/recipes/plf_indiesort/all/test_package/CMakeLists.txt +++ b/recipes/plf_indiesort/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(plf_indiesort REQUIRED CONFIG) diff --git a/recipes/plf_indiesort/all/test_v1_package/CMakeLists.txt b/recipes/plf_indiesort/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/plf_indiesort/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/plf_indiesort/all/test_v1_package/conanfile.py b/recipes/plf_indiesort/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/plf_indiesort/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_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/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..283048f0e586c 100644 --- a/recipes/plf_list/all/test_package/CMakeLists.txt +++ b/recipes/plf_list/all/test_package/CMakeLists.txt @@ -1,7 +1,10 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) 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_nanotimer/all/test_package/CMakeLists.txt b/recipes/plf_nanotimer/all/test_package/CMakeLists.txt index 0cbc43c2bace1..a2b01ed25f14e 100644 --- a/recipes/plf_nanotimer/all/test_package/CMakeLists.txt +++ b/recipes/plf_nanotimer/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(plf_nanotimer REQUIRED CONFIG) diff --git a/recipes/plf_nanotimer/all/test_v1_package/CMakeLists.txt b/recipes/plf_nanotimer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 6121431de33af..0000000000000 --- a/recipes/plf_nanotimer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(plf_nanotimer REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE plf_nanotimer::plf_nanotimer) diff --git a/recipes/plf_nanotimer/all/test_v1_package/conanfile.py b/recipes/plf_nanotimer/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/plf_nanotimer/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_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/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/all/test_package/CMakeLists.txt b/recipes/plf_queue/all/test_package/CMakeLists.txt index 2a3b7c5dfd549..d49dc3964ae7f 100644 --- a/recipes/plf_queue/all/test_package/CMakeLists.txt +++ b/recipes/plf_queue/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(plf_queue REQUIRED CONFIG) diff --git a/recipes/plf_queue/all/test_v1_package/CMakeLists.txt b/recipes/plf_queue/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/plf_queue/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/plf_queue/all/test_v1_package/conanfile.py b/recipes/plf_queue/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/plf_queue/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_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/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/all/test_package/CMakeLists.txt b/recipes/plf_stack/all/test_package/CMakeLists.txt index a8cd4817de983..431813340f2e9 100644 --- a/recipes/plf_stack/all/test_package/CMakeLists.txt +++ b/recipes/plf_stack/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(plf_stack REQUIRED CONFIG) diff --git a/recipes/plf_stack/all/test_v1_package/CMakeLists.txt b/recipes/plf_stack/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/plf_stack/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/plf_stack/all/test_v1_package/conanfile.py b/recipes/plf_stack/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/plf_stack/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_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/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/test_package/CMakeLists.txt b/recipes/plog/all/test_package/CMakeLists.txt index 690cbc43fe694..541350124c8a8 100644 --- a/recipes/plog/all/test_package/CMakeLists.txt +++ b/recipes/plog/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(plog REQUIRED CONFIG) diff --git a/recipes/plog/all/test_v1_package/CMakeLists.txt b/recipes/plog/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/plog/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/plog/all/test_v1_package/conanfile.py b/recipes/plog/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/plog/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/plusaes/all/test_v1_package/CMakeLists.txt b/recipes/plusaes/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/plusaes/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index a500b98343c74..0000000000000 --- a/recipes/plusaes/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/plutovg/all/conandata.yml b/recipes/plutovg/all/conandata.yml index caee6f61d4f89..87263a12e87cb 100644 --- a/recipes/plutovg/all/conandata.yml +++ b/recipes/plutovg/all/conandata.yml @@ -1,10 +1,27 @@ 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" - "cci.20220103": - url: "https://github.com/sammycage/plutovg/archive/51f1a79e04fbb42ec9e93499a18869eea06f3054.tar.gz" - sha256: "c2ce39b8085e0a8795263666f62af15239c36964330865fd54b9db25c67e063b" + "1.0.0": + url: "https://github.com/sammycage/plutovg/archive/refs/tags/v1.0.0.tar.gz" + sha256: "d4a8015aee9eefc29b01e6dabfd3d4b371ae12f9d5e9be09798deb77a528a794" + "0.0.8": + url: "https://github.com/sammycage/plutovg/archive/refs/tags/v0.0.8.tar.gz" + sha256: "090dd5d38e04e0900bf6843b2b38ce7108cab815c1b5496c934af65c51965618" + "0.0.7": + url: "https://github.com/sammycage/plutovg/archive/refs/tags/v0.0.7.tar.gz" + sha256: "31e264b6f451a0d18335d1596817c2b7f58e2fc6efeb63aac0ff9a7fbfc07c00" + "0.0.6": + url: "https://github.com/sammycage/plutovg/archive/refs/tags/v0.0.6.tar.gz" + sha256: "3be0e0d94ade3e739f60ac075c88c2e40d84a0ac05fc3ff8c7c97d0749e9a82b" + "0.0.5": + url: "https://github.com/sammycage/plutovg/archive/refs/tags/v0.0.5.tar.gz" + sha256: "bcc4301f1591d8b4172b7ca086fb9a2b250727848f5f30af4c625f043512ce10" + "0.0.4": + url: "https://github.com/sammycage/plutovg/archive/refs/tags/v0.0.4.tar.gz" + sha256: "6d7c6ad1ef3cf0085e0a375b770590a8cea79d4754b732e892635639c5546076" + "0.0.1": + url: "https://github.com/sammycage/plutovg/archive/refs/tags/v0.0.1.tar.gz" + sha256: "593653d226dd54dc322bc0874c19bd0a80314b5471ae4da6b9cd9e12211e3261" +patches: + "0.0.1": + - patch_file: "patches/0.0.1-0001-include-stdint.patch" + patch_description: "include stdint.h" + patch_type: "portability" diff --git a/recipes/plutovg/all/conanfile.py b/recipes/plutovg/all/conanfile.py index ac581e3e79204..be43bdb8956f4 100644 --- a/recipes/plutovg/all/conanfile.py +++ b/recipes/plutovg/all/conanfile.py @@ -1,7 +1,11 @@ from conan import ConanFile -from conan.tools.files import get, copy, replace_in_file -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout - +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, rename +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 import os required_conan_version = ">=1.53.0" @@ -24,6 +28,9 @@ class PlutoVGConan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -31,39 +38,55 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): - cmake_layout(self, src_folder="src") + basic_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("meson/[>=1.2.3 <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 = CMakeToolchain(self) - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc = MesonToolchain(self) + tc.project_options["examples"] = "disabled" + tc.project_options["tests"] = "disabled" + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) tc.generate() def build(self): - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "add_library(plutovg STATIC)", "add_library(plutovg)") - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "add_subdirectory(example)", "") - cmake = CMake(self) - cmake.configure() - cmake.build() + apply_conandata_patches(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="*.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.build_folder, keep_path=False) - copy(self, pattern="*.so", 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="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.build_folder, keep_path=False) - copy(self, pattern="*.dylib", dst=os.path.join(self.package_folder, "lib"), src=self.build_folder, keep_path=False) + 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")) + + fix_apple_shared_install_name(self) + + if is_msvc(self) and not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libplutovg.a"), os.path.join(self.package_folder, "lib", "plutovg.lib")) def package_info(self): self.cpp_info.libs = ["plutovg"] if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["m"] + if is_msvc(self) and not self.options.shared: + self.cpp_info.defines.append("PLUTOVG_BUILD_STATIC") diff --git a/recipes/plutovg/all/patches/0.0.1-0001-include-stdint.patch b/recipes/plutovg/all/patches/0.0.1-0001-include-stdint.patch new file mode 100644 index 0000000000000..38089ef589d9a --- /dev/null +++ b/recipes/plutovg/all/patches/0.0.1-0001-include-stdint.patch @@ -0,0 +1,12 @@ +diff --git a/source/plutovg-surface.c b/source/plutovg-surface.c +index f81a51b..70be9e2 100644 +--- a/source/plutovg-surface.c ++++ b/source/plutovg-surface.c +@@ -1,5 +1,7 @@ + #include "plutovg-private.h" + ++#include ++ + #define STB_IMAGE_IMPLEMENTATION + #define STB_IMAGE_WRITE_IMPLEMENTATION + diff --git a/recipes/plutovg/all/test_package/CMakeLists.txt b/recipes/plutovg/all/test_package/CMakeLists.txt deleted file mode 100644 index 05f05dd40b2ba..0000000000000 --- a/recipes/plutovg/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -find_package(plutovg REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE plutovg::plutovg) diff --git a/recipes/plutovg/all/test_package/conanfile.py b/recipes/plutovg/all/test_package/conanfile.py index a9fbb7f543162..7433710099642 100644 --- a/recipes/plutovg/all/test_package/conanfile.py +++ b/recipes/plutovg/all/test_package/conanfile.py @@ -1,25 +1,31 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake +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 = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" test_type = "explicit" + def layout(self): + basic_layout(self) + def requirements(self): self.requires(self.tested_reference_str) - def layout(self): - cmake_layout(self) + 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): - cmake = CMake(self) - cmake.configure() - cmake.build() + meson = Meson(self) + meson.configure() + meson.build() 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/plutovg/all/test_package/meson.build b/recipes/plutovg/all/test_package/meson.build new file mode 100644 index 0000000000000..af5cd82ec83dc --- /dev/null +++ b/recipes/plutovg/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('plutovg') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/plutovg/all/test_package/test_package.c b/recipes/plutovg/all/test_package/test_package.c index 528e8031367ec..e73c320347491 100644 --- a/recipes/plutovg/all/test_package/test_package.c +++ b/recipes/plutovg/all/test_package/test_package.c @@ -1,14 +1,14 @@ -#include "plutovg.h" +#include -int main(void) { +int main(void) { const int width = 150; const int height = 150; plutovg_surface_t* surface = plutovg_surface_create(width, height); - plutovg_t* pluto = plutovg_create(surface); + plutovg_canvas_t* canvas = plutovg_canvas_create(surface); plutovg_surface_destroy(surface); - plutovg_destroy(pluto); + plutovg_canvas_destroy(canvas); return 0; } diff --git a/recipes/plutovg/all/test_v1_package/CMakeLists.txt b/recipes/plutovg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de3b75d9538de..0000000000000 --- a/recipes/plutovg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/plutovg/all/test_v1_package/conanfile.py b/recipes/plutovg/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/plutovg/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/plutovg/config.yml b/recipes/plutovg/config.yml index 2d50305e8506d..6b303ea994468 100644 --- a/recipes/plutovg/config.yml +++ b/recipes/plutovg/config.yml @@ -1,7 +1,15 @@ versions: - "cci.20230205": + "1.0.0": folder: all - "cci.20221030": + "0.0.8": folder: all - "cci.20220103": + "0.0.7": + folder: all + "0.0.6": + folder: all + "0.0.5": + folder: all + "0.0.4": + folder: all + "0.0.1": folder: all diff --git a/recipes/pngpp/all/conanfile.py b/recipes/pngpp/all/conanfile.py index 57559867af002..105bf9fe8f655 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.40") + self.requires("libpng/[>=1.6 <2]") def package_id(self): self.info.clear() diff --git a/recipes/pngpp/all/test_package/CMakeLists.txt b/recipes/pngpp/all/test_package/CMakeLists.txt index f5ee715eea307..c213b31e878a0 100644 --- a/recipes/pngpp/all/test_package/CMakeLists.txt +++ b/recipes/pngpp/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(pngpp REQUIRED CONFIG) diff --git a/recipes/pngpp/all/test_v1_package/CMakeLists.txt b/recipes/pngpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index abf75b3c1f51a..0000000000000 --- a/recipes/pngpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(pngpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE pngpp::pngpp) diff --git a/recipes/pngpp/all/test_v1_package/conanfile.py b/recipes/pngpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/pngpp/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_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/pocketfft/all/conandata.yml b/recipes/pocketfft/all/conandata.yml new file mode 100644 index 0000000000000..afc3604e9585d --- /dev/null +++ b/recipes/pocketfft/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.0.cci.20240801": + url: "https://github.com/mreineck/pocketfft/archive/bb87ca50df0478415a12d9011dc374eeed4e9d93.tar.gz" + sha256: "434d6cfd38613fb17db2c006cd64991947bdf88fb3f750cf6bfbaa86083c5bbd" diff --git a/recipes/pocketfft/all/conanfile.py b/recipes/pocketfft/all/conanfile.py new file mode 100644 index 0000000000000..75e19754616a6 --- /dev/null +++ b/recipes/pocketfft/all/conanfile.py @@ -0,0 +1,82 @@ +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 + +required_conan_version = ">=1.52.0" + + +class PocketfftConan(ConanFile): + name = "pocketfft" + description = "PocketFFT: a heavily modified implementation of FFTPack" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mreineck/pocketfft" + topics = ("fft", "fast-fourier-transform", "fftpack", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + options = { + "cache_size": ["ANY"], + "multithreading": [True, False], + "pthread": [True, False], + "vectorization": [True, False], + } + default_options = { + "cache_size": 0, + "multithreading": True, + "pthread": False, + "vectorization": True, + } + + def configure(self): + if not self.options.multithreading: + del self.options.pthread + + def requirements(self): + if self.options.get_safe("pthread") and self.settings.os == "Windows": + self.requires("pthreads4w/3.0.0") + + 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) + + if not str(self.options.cache_size).isdigit() or int(str(self.options.cache_size)) < 0: + raise ConanInvalidConfiguration("cache_size option must be greater or equal to 0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE.md", 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 = [] + + self.cpp_info.defines.append(f"POCKETFFT_CACHE_SIZE={self.options.cache_size}") + if not self.options.multithreading: + self.cpp_info.defines.append("POCKETFFT_NO_MULTITHREADING") + if self.options.get_safe("pthread"): + self.cpp_info.defines.append("POCKETFFT_PTHREADS") + if not self.options.vectorization: + self.cpp_info.defines.append("POCKETFFT_NO_VECTORS") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + if self.options.multithreading: + self.cpp_info.system_libs.append("pthread") + + if self.options.get_safe("pthread") and self.settings.os == "Windows": + self.cpp_info.system_libs.append("pthreads4w::pthreads4w") diff --git a/recipes/pocketfft/all/test_package/CMakeLists.txt b/recipes/pocketfft/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5d277cd110bf2 --- /dev/null +++ b/recipes/pocketfft/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(pocketfft REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE pocketfft::pocketfft) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/pocketfft/all/test_package/conanfile.py b/recipes/pocketfft/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/pocketfft/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/pocketfft/all/test_package/test_package.cpp b/recipes/pocketfft/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..04d8a1970ebf2 --- /dev/null +++ b/recipes/pocketfft/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include +#include + +using namespace pocketfft; + +int main() { + const int len = 16; + shape_t shape{len}; + stride_t stride{sizeof(std::complex)}; + shape_t axes = {0}; + std::vector> data(len), res(len); + c2c(shape, stride, stride, axes, FORWARD, data.data(), res.data(), 1.f); +} diff --git a/recipes/pocketfft/config.yml b/recipes/pocketfft/config.yml new file mode 100644 index 0000000000000..cecbc61c9639e --- /dev/null +++ b/recipes/pocketfft/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.0.cci.20240801": + folder: all diff --git a/recipes/poco/all/conandata.yml b/recipes/poco/all/conandata.yml index 44d50ff4a064f..2edb678fab224 100644 --- a/recipes/poco/all/conandata.yml +++ b/recipes/poco/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.13.3": + url: "https://github.com/pocoproject/poco/archive/poco-1.13.3-release.tar.gz" + sha256: "9f074d230daf30f550c5bde5528037bdab6aa83b2a06c81a25e89dd3bcb7e419" + "1.13.2": + url: "https://github.com/pocoproject/poco/archive/poco-1.13.2-release.tar.gz" + sha256: "c01221870aa9bccedf1de39890279699207848fe61a0cfb6aeec7c5942c4627f" + "1.13.1": + url: "https://github.com/pocoproject/poco/archive/poco-1.13.1-release.tar.gz" + sha256: "8accf6c6ebb9ae686e7c8e2390a35beaab08d0ca1abda537cc2d0b7ab9296be5" + "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" @@ -24,6 +36,46 @@ sources: url: "https://github.com/pocoproject/poco/archive/poco-1.11.3-release.tar.gz" sha256: "fb5e8e70c7dbc8f3b59ec8560140a267b4eaf06ee519dc21f312d0eb195cba37" patches: + "1.13.3": + - 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" + - patch_file: patches/1.13.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" + "1.13.2": + - 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" + - patch_file: patches/1.13.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" + "1.13.1": + - 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" + - patch_file: patches/1.13.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" + "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" + - patch_file: patches/1.13.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + 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" @@ -31,6 +83,9 @@ patches: - patch_file: patches/1.12.5-0002-mysql-include.patch patch_description: "include mysql.h instead of mysql/mysql.h" patch_type: "portability" + - patch_file: patches/1.12.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + 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" @@ -38,6 +93,9 @@ patches: - patch_file: patches/1.12.5-0002-mysql-include.patch patch_description: "include mysql.h instead of mysql/mysql.h" patch_type: "portability" + - patch_file: patches/1.12.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" "1.12.4": - patch_file: patches/1.12.3.patch patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" @@ -45,6 +103,9 @@ patches: - patch_file: patches/1.11.0-0002-mysql-include.patch patch_description: "include mysql.h instead of mysql/mysql.h" patch_type: "portability" + - patch_file: patches/1.12.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" "1.12.3": - patch_file: patches/1.12.3.patch patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" @@ -52,6 +113,9 @@ patches: - patch_file: patches/1.11.0-0002-mysql-include.patch patch_description: "include mysql.h instead of mysql/mysql.h" patch_type: "portability" + - patch_file: patches/1.12.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" "1.12.2": - patch_file: patches/1.12.0.patch patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" @@ -59,6 +123,9 @@ patches: - patch_file: patches/1.11.0-0002-mysql-include.patch patch_description: "include mysql.h instead of mysql/mysql.h" patch_type: "portability" + - patch_file: patches/1.12.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" "1.12.1": - patch_file: patches/1.12.0.patch patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" @@ -66,6 +133,9 @@ patches: - patch_file: patches/1.11.0-0002-mysql-include.patch patch_description: "include mysql.h instead of mysql/mysql.h" patch_type: "portability" + - patch_file: patches/1.12.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" "1.12.0": - patch_file: patches/1.12.0.patch patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" @@ -73,6 +143,9 @@ patches: - patch_file: patches/1.11.0-0002-mysql-include.patch patch_description: "include mysql.h instead of mysql/mysql.h" patch_type: "portability" + - patch_file: patches/1.12.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" "1.11.3": - patch_file: "patches/1.11.1.patch" patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" @@ -80,3 +153,6 @@ patches: - patch_file: "patches/1.11.0-0002-mysql-include.patch" patch_description: "include mysql.h instead of mysql/mysql.h" patch_type: "portability" + - patch_file: patches/1.12.0-0003-pocomsg-resource.patch + patch_description: "include pocomsg.rc in dll" + patch_type: "portability" diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py index 6ede924a2f329..c8a2a44237f59 100644 --- a/recipes/poco/all/conanfile.py +++ b/recipes/poco/all/conanfile.py @@ -29,12 +29,18 @@ class PocoConan(ConanFile): "fPIC": [True, False], "enable_fork": [True, False], "enable_active_record": [True, False, "deprecated"], + "log_debug": [True, False], + "with_sql_parser": [True, False], + "comp_foundation_sharedlibrary_debug_suffix": [True, False], } default_options = { "shared": False, "fPIC": True, "enable_fork": True, "enable_active_record": "deprecated", + "log_debug": False, + "with_sql_parser": True, + "comp_foundation_sharedlibrary_debug_suffix": True, } _PocoComponent = namedtuple("_PocoComponent", ("option", "default_option", "dependencies", "external_dependencies", "is_lib")) @@ -83,7 +89,13 @@ def _min_cppstd(self): # https://github.com/pocoproject/poco/releases/tag/poco-1.10.0-release # But poco uses C++11 features only until 1.12.5 # https://github.com/pocoproject/poco/commit/886b76f4faa2007cc0c09dad81f8dcdee6fcb4ac - return "11" if Version(self.version) < "1.12.5" else "14" + 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): @@ -95,8 +107,19 @@ def _compilers_minimum_version(self): "Visual Studio": "15", "msvc": "191", }, + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, }.get(self._min_cppstd, {}) + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + def export_sources(self): export_conandata_patches(self) @@ -108,6 +131,10 @@ 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 + if self.settings.build_type != "Debug": + del self.options.comp_foundation_sharedlibrary_debug_suffix def configure(self): if self.options.enable_active_record != "deprecated": @@ -132,11 +159,11 @@ def requirements(self): self.requires("pcre/8.45") else: self.requires("pcre2/10.42") - self.requires("zlib/[>=1.2.11 <2]") + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True) if self.options.enable_xml: - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]", transitive_headers=True) if self.options.enable_data_sqlite: - self.requires("sqlite3/3.44.2") + self.requires("sqlite3/[>=3.45.0 <4]") if self.options.enable_apacheconnector: self.requires("apr/1.7.4") self.requires("apr-util/1.6.1") @@ -152,6 +179,7 @@ def requirements(self): def package_id(self): del self.info.options.enable_active_record + del self.info.options.log_debug def validate(self): if self.settings.compiler.cppstd: @@ -224,10 +252,15 @@ 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 tc.preprocessor_definitions["XML_DTD"] = "1" + # Disable SharedLibrary::suffix() including "d" as part of the platform-specific filename suffix + if not self.options.get_safe("comp_foundation_sharedlibrary_debug_suffix", True): + tc.preprocessor_definitions["POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX"] = "1" tc.generate() deps = CMakeDeps(self) @@ -293,6 +326,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") @@ -322,12 +363,18 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["poco_foundation"].system_libs.extend(["pthread", "dl", "rt"]) + if self.options.log_debug: + self.cpp_info.components["poco_foundation"].defines.append("POCO_LOG_DEBUG") + if is_msvc(self): self.cpp_info.components["poco_foundation"].defines.append("POCO_NO_AUTOMATIC_LIBS") if not self.options.shared: self.cpp_info.components["poco_foundation"].defines.append("POCO_STATIC=ON") if self.settings.os == "Windows": self.cpp_info.components["poco_foundation"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) + if self.options.enable_net: + if not self.options.shared and self._is_mingw and Version(self.version) >= "1.13.0": + self.cpp_info.components["poco_net"].system_libs.extend(["mswsock"]) if self.options.enable_data_odbc: if self.settings.os == "Windows": self.cpp_info.components["poco_dataodbc"].system_libs.extend(["odbc32", "odbccp32"]) diff --git a/recipes/poco/all/patches/1.12.0-0003-pocomsg-resource.patch b/recipes/poco/all/patches/1.12.0-0003-pocomsg-resource.patch new file mode 100644 index 0000000000000..5032647dde068 --- /dev/null +++ b/recipes/poco/all/patches/1.12.0-0003-pocomsg-resource.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake +index 0ef354e9e..f8a95de40 100644 +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -168,8 +168,10 @@ macro(POCO_MESSAGES out name) + get_filename_component(msg_path ${msg} ABSOLUTE) + string(REPLACE ".mc" ".h" hdr ${msg_name}) + set_source_files_properties(${hdr} PROPERTIES GENERATED TRUE) ++ string(REPLACE ".mc" ".rc" rc ${msg_name}) ++ set_source_files_properties(${rc} PROPERTIES GENERATED TRUE) + add_custom_command( +- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${hdr} ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${hdr} ${CMAKE_CURRENT_BINARY_DIR}/${rc} + DEPENDS ${msg} + COMMAND ${CMAKE_MC_COMPILER} + ARGS +@@ -185,6 +187,9 @@ macro(POCO_MESSAGES out name) + # Add the generated headers to POCO_HEADERS of the component + POCO_HEADERS( ${out} ${name} ${CMAKE_CURRENT_BINARY_DIR}/${hdr}) + ++ # Add the generated .rc ++ source_group("${name}\\Resource Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/${rc}) ++ list(APPEND ${out} ${CMAKE_CURRENT_BINARY_DIR}/${rc}) + endforeach() + + set_source_files_properties(${ARGN} PROPERTIES HEADER_FILE_ONLY TRUE) 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-0003-pocomsg-resource.patch b/recipes/poco/all/patches/1.13.0-0003-pocomsg-resource.patch new file mode 100644 index 0000000000000..ee1b6221d213a --- /dev/null +++ b/recipes/poco/all/patches/1.13.0-0003-pocomsg-resource.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake +index 2ef58c5a4..9d9855251 100644 +--- a/cmake/PocoMacros.cmake ++++ b/cmake/PocoMacros.cmake +@@ -168,8 +168,10 @@ macro(POCO_MESSAGES out name) + get_filename_component(msg_path ${msg} ABSOLUTE) + string(REPLACE ".mc" ".h" hdr ${msg_name}) + set_source_files_properties(${hdr} PROPERTIES GENERATED TRUE) ++ string(REPLACE ".mc" ".rc" rc ${msg_name}) ++ set_source_files_properties(${rc} PROPERTIES GENERATED TRUE) + add_custom_command( +- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${hdr} ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${hdr} ${CMAKE_CURRENT_BINARY_DIR}/${rc} + DEPENDS ${msg} + COMMAND ${CMAKE_MC_COMPILER} + ARGS +@@ -185,6 +187,9 @@ macro(POCO_MESSAGES out name) + # Add the generated headers to POCO_HEADERS of the component + POCO_HEADERS( ${out} ${name} ${CMAKE_CURRENT_BINARY_DIR}/${hdr}) + ++ # Add the generated .rc ++ source_group("${name}\\Resource Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/${rc}) ++ list(APPEND ${out} ${CMAKE_CURRENT_BINARY_DIR}/${rc}) + endforeach() + + set_source_files_properties(${ARGN} PROPERTIES HEADER_FILE_ONLY TRUE) 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/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 c50a32bedbc58..a477d906ba0c3 100644 --- a/recipes/poco/config.yml +++ b/recipes/poco/config.yml @@ -1,4 +1,12 @@ versions: + "1.13.3": + folder: all + "1.13.2": + folder: all + "1.13.1": + folder: all + "1.13.0": + folder: all "1.12.5p2": folder: all "1.12.5p1": diff --git a/recipes/podofo/all/conandata.yml b/recipes/podofo/all/conandata.yml index 2735fdd5d425b..016e63cd90df6 100644 --- a/recipes/podofo/all/conandata.yml +++ b/recipes/podofo/all/conandata.yml @@ -2,15 +2,8 @@ sources: "0.9.7": url: "https://netcologne.dl.sourceforge.net/project/podofo/podofo/0.9.7/podofo-0.9.7.tar.gz" sha256: "7cf2e716daaef89647c54ffcd08940492fd40c385ef040ce7529396bfadc1eb8" - "0.9.6": - url: "https://netcologne.dl.sourceforge.net/project/podofo/podofo/0.9.6/podofo-0.9.6.tar.gz" - sha256: "e9163650955ab8e4b9532e7aa43b841bac45701f7b0f9b793a98c8ca3ef14072" patches: "0.9.7": - patch_file: "patches/0001-fix-cmake-0.9.7.patch" patch_description: "Link to conan libs and allow to build the tools without the tests and the examples" patch_type: "conan" - "0.9.6": - - patch_file: "patches/0001-fix-cmake-0.9.6.patch" - patch_description: "Link to conan libs and allow to build the tools without the tests and the examples" - patch_type: "conan" diff --git a/recipes/podofo/all/conanfile.py b/recipes/podofo/all/conanfile.py index 87fbb60fe26b7..0fe812412118b 100644 --- a/recipes/podofo/all/conanfile.py +++ b/recipes/podofo/all/conanfile.py @@ -1,12 +1,12 @@ from conan import ConanFile -from conan.tools.build import check_min_cppstd, valid_min_cppstd +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.microsoft import is_msvc from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class PodofoConan(ConanFile): @@ -15,8 +15,8 @@ class PodofoConan(ConanFile): homepage = "http://podofo.sourceforge.net" url = "https://github.com/conan-io/conan-center-index" description = "PoDoFo is a library to work with the PDF file format." - topics = ("pdf") - + topics = ("pdf",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -62,26 +62,25 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") self.requires("zlib/[>=1.2.11 <2]") if self.settings.os != "Windows": - self.requires("fontconfig/2.14.2") + self.requires("fontconfig/2.15.0") if self.options.with_openssl: - self.requires("openssl/1.1.1u") + self.requires("openssl/[>=1.1 <4]") 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.5.1") + self.requires("libtiff/4.6.0") if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_unistring: self.requires("libunistring/0.9.10") def validate(self): - if self.info.settings.compiler.get_safe("cppstd") and Version(self.version) >= "0.9.7": - check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def source(self): get(self, **self.conan_data["sources"][self.version], @@ -94,8 +93,6 @@ def generate(self): tc.variables["PODOFO_BUILD_STATIC"] = not self.options.shared if not self.options.threadsafe: tc.variables["PODOFO_NO_MULTITHREAD"] = True - if Version(self.version) >= "0.9.7" and not valid_min_cppstd(self, 11): - tc.cache_variables["CMAKE_CXX_STANDARD"] = 11 # To install relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" @@ -110,6 +107,8 @@ def generate(self): tc.variables["PODOFO_HAVE_OPENSSL_1_1"] = Version(self.dependencies["openssl"].ref.version) >= "1.1" if self.options.with_openssl and ("no_rc4" in self.dependencies["openssl"].options): tc.variables["PODOFO_HAVE_OPENSSL_NO_RC4"] = self.dependencies["openssl"].options.no_rc4 + if Version(self.version) < "0.10.0": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) diff --git a/recipes/podofo/all/patches/0001-fix-cmake-0.9.6.patch b/recipes/podofo/all/patches/0001-fix-cmake-0.9.6.patch deleted file mode 100644 index 5667931589e54..0000000000000 --- a/recipes/podofo/all/patches/0001-fix-cmake-0.9.6.patch +++ /dev/null @@ -1,183 +0,0 @@ ---- a/CMakeLists.txt 2018-07-08 12:33:27.000000000 +0200 -+++ b/CMakeLists.txt 2022-09-02 09:21:58.513547800 +0200 -@@ -37,7 +37,7 @@ - endif() - - # Load modules from our source tree too --SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") -+LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") - - - # Builds must use this CMakeLists.txt, not the one in src/ or somewhere else. -@@ -313,73 +313,55 @@ - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - - FIND_PACKAGE(ZLIB REQUIRED) -+LINK_LIBRARIES(ZLIB::ZLIB) - MESSAGE("Found zlib headers in ${ZLIB_INCLUDE_DIR}, library at ${ZLIB_LIBRARIES}") - --FIND_PACKAGE(LIBCRYPTO) -- --IF(LIBCRYPTO_FOUND) -+if(PODOFO_WITH_OPENSSL) -+ FIND_PACKAGE(OpenSSL REQUIRED) - SET(PODOFO_HAVE_OPENSSL TRUE) -- INCLUDE_DIRECTORIES(${LIBCRYPTO_INCLUDE_DIR}) -- MESSAGE("Found OpenSSL's libCrypto headers in ${LIBCRYPTO_INCLUDE_DIR}, library at ${LIBCRYPTO_LIBRARIES}") --ELSE(LIBCRYPTO_FOUND) -- MESSAGE("OpenSSL's libCrypto not found. Encryption support will be disabled") --ENDIF(LIBCRYPTO_FOUND) -- --FIND_PACKAGE(LIBIDN) -- --IF(LIBIDN_FOUND) -- MESSAGE("Found libidn headers in ${LIBIDN_INCLUDE_DIR}, library at ${LIBIDN_LIBRARIES}") --ENDIF(LIBIDN_FOUND) -+ LINK_LIBRARIES(OpenSSL::SSL OpenSSL::Crypto) -+ INCLUDE(CheckCSourceCompiles) -+ -+ SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) -+ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) - --IF(LIBIDN_FOUND) -+ UNSET(CMAKE_REQUIRED_INCLUDES) -+ UNSET(CMAKE_REQUIRED_LIBRARIES) -+ENDIF() -+ -+if(PODOFO_WITH_LIBIDN) -+ FIND_PACKAGE(LIBIDN) - SET(PODOFO_HAVE_LIBIDN TRUE) -- INCLUDE_DIRECTORIES(${LIBIDN_INCLUDE_DIR}) -- MESSAGE("Libidn found. AES-256 Encryption support will be enabled") --ELSE(LIBIDN_FOUND) -- MESSAGE("Libidn not found. AES-256 Encryption support will be disabled") --ENDIF(LIBIDN_FOUND) -+ LINK_LIBRARIES(libidn::libidn) -+ENDIF() - --FIND_PACKAGE(LIBJPEG) - --IF(LIBJPEG_FOUND) -- MESSAGE("Found libjpeg headers in ${LIBJPEG_INCLUDE_DIR}, library at ${LIBJPEG_LIBRARIES}") -+IF(PODOFO_WITH_LIBJPEG) -+ FIND_PACKAGE(JPEG REQUIRED) - SET(PODOFO_HAVE_JPEG_LIB TRUE) -- INCLUDE_DIRECTORIES(${LIBJPEG_INCLUDE_DIR}) --ELSE(LIBJPEG_FOUND) -- MESSAGE("Libjpeg not found. JPEG support will be disabled") --ENDIF(LIBJPEG_FOUND) -+ LINK_LIBRARIES(JPEG::JPEG) -+ENDIF() - --FIND_PACKAGE(TIFF) - --IF(TIFF_FOUND) -- MESSAGE("Found libtiff headers in ${TIFF_INCLUDE_DIR}, library at ${TIFF_LIBRARIES}") -+IF(PODOFO_WITH_TIFF) -+ FIND_PACKAGE(TIFF REQUIRED) - SET(PODOFO_HAVE_TIFF_LIB TRUE) -- INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) --ELSE(TIFF_FOUND) -- MESSAGE("Libtiff not found. TIFF support will be disabled") --ENDIF(TIFF_FOUND) -+ LINK_LIBRARIES(TIFF::TIFF) -+ENDIF() - --FIND_PACKAGE(PNG) - --IF(PNG_FOUND) -- MESSAGE("Found LibPng headers in ${PNG_INCLUDE_DIR}, library at ${PNG_LIBRARIES}") -+IF(PODOFO_WITH_PNG) -+ FIND_PACKAGE(PNG REQUIRED) - SET(PODOFO_HAVE_PNG_LIB TRUE) -- INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR}) --ELSE(PNG_FOUND) -- MESSAGE("LibPng not found. PNG support will be disabled") -- SET(PNG_LIBRARIES "") --ENDIF(PNG_FOUND) -+ LINK_LIBRARIES(PNG::PNG) -+ENDIF() - --FIND_PACKAGE(UNISTRING) - --IF(UNISTRING_FOUND) -- MESSAGE("Found LibUnistring headers in ${UNISTRING_INCLUDE_DIR}, library at ${UNISTRING_LIBRARY}") -+IF(PODOFO_WITH_UNISTRING) - SET(PODOFO_HAVE_UNISTRING_LIB TRUE) -- INCLUDE_DIRECTORIES(${UNISTRING_INCLUDE_DIR}) --ELSE(UNISTRING_FOUND) -- MESSAGE("LibUnistring not found. Unistring support will be disabled") -- SET(UNISTRING_LIBRARY "") --ENDIF(UNISTRING_FOUND) -+ FIND_PACKAGE(libunistring REQUIRED) -+ LINK_LIBRARIES(libunistring::libunistring) -+ENDIF() - - - IF(NOT PODOFO_BUILD_LIB_ONLY) -@@ -396,11 +378,11 @@ - - ENDIF(NOT PODOFO_BUILD_LIB_ONLY) - --FIND_PACKAGE(OpenSSL) - --FIND_PACKAGE(FREETYPE REQUIRED) --MESSAGE("Found freetype library at ${FREETYPE_LIBRARIES}, headers ${FREETYPE_INCLUDE_DIR}") -+FIND_PACKAGE(Freetype REQUIRED MODULE) -+LINK_LIBRARIES(Freetype::Freetype) - -+if(0) - FIND_PACKAGE(LIBSTLPORT) - SET(stlport_libraries_if_use_stlport) - IF(USE_STLPORT) -@@ -415,16 +397,13 @@ - MESSAGE(FATAL_ERROR "STLPort use requested, but STLPort not found.") - ENDIF(LIBSTLPORT_FOUND) - ENDIF(USE_STLPORT) -+endif() - - IF(WANT_FONTCONFIG) -- FIND_PACKAGE(FONTCONFIG REQUIRED) -+ FIND_PACKAGE(Fontconfig REQUIRED) - SET(PODOFO_HAVE_FONTCONFIG TRUE) -+ LINK_LIBRARIES(Fontconfig::Fontconfig) - SET(PODOFO_LIB_FONTCONFIG:STRING fontconfig) -- IF(FONTCONFIG_FOUND) -- MESSAGE("Found fontconfig headers in ${FONTCONFIG_INCLUDE_DIR}, library at ${FONTCONFIG_LIBRARIES}") -- ELSE(FONTCONFIG_FOUND) -- MESSAGE("Could not find fontconfig.") -- ENDIF(FONTCONFIG_FOUND) - ELSE(WANT_FONTCONFIG) - # Might as well look for it anyway. This also sets the appropriate - # variables to empty values. -@@ -516,6 +495,7 @@ - INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIR}) - ENDIF(FONTCONFIG_FOUND AND WANT_FONTCONFIG) - -+LINK_DIRECTORIES(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) - IF(WIN32 OR PODOFO_BUILD_STATIC) - SET(PODOFO_LIB - podofo -@@ -546,10 +526,18 @@ - - ADD_SUBDIRECTORY(src) - IF(NOT PODOFO_BUILD_LIB_ONLY) --ADD_SUBDIRECTORY(test) --ADD_SUBDIRECTORY(tools) --ADD_SUBDIRECTORY(examples) --ADD_SUBDIRECTORY(man) -+IF(PODOFO_BUILD_TEST) -+ ADD_SUBDIRECTORY(test) -+ENDIF(PODOFO_BUILD_TEST) -+IF(PODOFO_BUILD_TOOLS) -+ ADD_SUBDIRECTORY(tools) -+ENDIF(PODOFO_BUILD_TOOLS) -+IF(PODOFO_BUILD_EXAMPLES) -+ ADD_SUBDIRECTORY(examples) -+ENDIF(PODOFO_BUILD_EXAMPLES) -+IF(PODOFO_BUILD_MAN) -+ ADD_SUBDIRECTORY(man) -+ENDIF(PODOFO_BUILD_MAN) - ENDIF(NOT PODOFO_BUILD_LIB_ONLY) - - # Generate our configure file diff --git a/recipes/podofo/all/test_package/CMakeLists.txt b/recipes/podofo/all/test_package/CMakeLists.txt index 447fbc933a4fb..c87b5f58fb4fd 100644 --- a/recipes/podofo/all/test_package/CMakeLists.txt +++ b/recipes/podofo/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(podofo REQUIRED CONFIG) diff --git a/recipes/podofo/all/test_v1_package/CMakeLists.txt b/recipes/podofo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/podofo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/podofo/all/test_v1_package/conanfile.py b/recipes/podofo/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/podofo/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_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/podofo/config.yml b/recipes/podofo/config.yml index ca2128b57488a..a6cc81e2fb933 100644 --- a/recipes/podofo/config.yml +++ b/recipes/podofo/config.yml @@ -1,5 +1,3 @@ versions: "0.9.7": folder: all - "0.9.6": - folder: all diff --git a/recipes/poly2tri/all/CMakeLists.txt b/recipes/poly2tri/all/CMakeLists.txt index f72581637fe53..80c2594a22db6 100644 --- a/recipes/poly2tri/all/CMakeLists.txt +++ b/recipes/poly2tri/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(poly2tri LANGUAGES CXX) include(GNUInstallDirs) diff --git a/recipes/poly2tri/all/test_package/CMakeLists.txt b/recipes/poly2tri/all/test_package/CMakeLists.txt index 091cd7218487c..42cee8792db4b 100644 --- a/recipes/poly2tri/all/test_package/CMakeLists.txt +++ b/recipes/poly2tri/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(poly2tri REQUIRED CONFIG) diff --git a/recipes/poly2tri/all/test_v1_package/CMakeLists.txt b/recipes/poly2tri/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/poly2tri/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/poly2tri/all/test_v1_package/conanfile.py b/recipes/poly2tri/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/poly2tri/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_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/polylabel/all/conandata.yml b/recipes/polylabel/all/conandata.yml index efb6a522362e3..0857fe72ca3c7 100644 --- a/recipes/polylabel/all/conandata.yml +++ b/recipes/polylabel/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.0": + url: "https://github.com/mapbox/polylabel/archive/refs/tags/v2.0.0.tar.gz" + sha256: "9aba4320c6cb5a8e9a8d44feb0d68b79b3127bdcb759a26aca92ac637668d7b9" "1.1.0": url: "https://github.com/mapbox/polylabel/archive/refs/tags/v1.1.0.tar.gz" sha256: "3694a3127954fab760686c825e2e585684934c768b5f9d542b8701e54147f1a8" diff --git a/recipes/polylabel/all/conanfile.py b/recipes/polylabel/all/conanfile.py index 402d5fbafc219..2e5e1eaff3562 100644 --- a/recipes/polylabel/all/conanfile.py +++ b/recipes/polylabel/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.52.0" @@ -10,13 +12,28 @@ class PolylabelConan(ConanFile): name = "polylabel" description = "A fast algorithm for finding the pole of inaccessibility of a polygon." - topics = ("polygon", "pole-of-inaccessibility") license = "ISC" - homepage = "https://github.com/mapbox/polylabel" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mapbox/polylabel" + topics = ("polygon", "pole-of-inaccessibility", "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 { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + def layout(self): basic_layout(self, src_folder="src") @@ -28,14 +45,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", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) diff --git a/recipes/polylabel/all/test_package/CMakeLists.txt b/recipes/polylabel/all/test_package/CMakeLists.txt index 90669593bc3f0..340abb8324850 100644 --- a/recipes/polylabel/all/test_package/CMakeLists.txt +++ b/recipes/polylabel/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(polylabel REQUIRED CONFIG) diff --git a/recipes/polylabel/all/test_v1_package/CMakeLists.txt b/recipes/polylabel/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0c0d215f97b42..0000000000000 --- a/recipes/polylabel/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(polylabel REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE polylabel::polylabel) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/polylabel/all/test_v1_package/conanfile.py b/recipes/polylabel/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/polylabel/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_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/polylabel/config.yml b/recipes/polylabel/config.yml index b5c0d3cb2d409..2973f3b50e9e6 100644 --- a/recipes/polylabel/config.yml +++ b/recipes/polylabel/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.0": + folder: all "1.1.0": folder: all diff --git a/recipes/polylineencoder/all/test_package/CMakeLists.txt b/recipes/polylineencoder/all/test_package/CMakeLists.txt index 55b8c21b9d7cb..c9b92e37ed22f 100644 --- a/recipes/polylineencoder/all/test_package/CMakeLists.txt +++ b/recipes/polylineencoder/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(polylineencoder REQUIRED CONFIG) diff --git a/recipes/polylineencoder/all/test_v1_package/CMakeLists.txt b/recipes/polylineencoder/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/polylineencoder/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/polylineencoder/all/test_v1_package/conanfile.py b/recipes/polylineencoder/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/polylineencoder/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_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/polymorphic_value/all/test_package/CMakeLists.txt b/recipes/polymorphic_value/all/test_package/CMakeLists.txt index e6cc8838b8f43..b152bc48fd0a3 100644 --- a/recipes/polymorphic_value/all/test_package/CMakeLists.txt +++ b/recipes/polymorphic_value/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(polymorphic_value REQUIRED CONFIG) diff --git a/recipes/polymorphic_value/all/test_v1_package/CMakeLists.txt b/recipes/polymorphic_value/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8e2bfa718d864..0000000000000 --- a/recipes/polymorphic_value/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.12) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(polymorphic_value REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE polymorphic_value::polymorphic_value) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) diff --git a/recipes/polymorphic_value/all/test_v1_package/conanfile.py b/recipes/polymorphic_value/all/test_v1_package/conanfile.py deleted file mode 100644 index fa6afacf5620e..0000000000000 --- a/recipes/polymorphic_value/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -import os - -from conan.tools.build import cross_building -from conans import CMake, ConanFile - - -# 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/popl/all/conandata.yml b/recipes/popl/all/conandata.yml new file mode 100644 index 0000000000000..ecb4877cc3587 --- /dev/null +++ b/recipes/popl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.0": + url: "https://github.com/badaix/popl/archive/refs/tags/v1.3.0.tar.gz" + sha256: "7c59554371da3c6c093bd79c2f403f921c1938bd523f1a48682352e0d92883a6" diff --git a/recipes/popl/all/conanfile.py b/recipes/popl/all/conanfile.py new file mode 100644 index 0000000000000..2d3d23c30b405 --- /dev/null +++ b/recipes/popl/all/conanfile.py @@ -0,0 +1,41 @@ +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 PoplConan(ConanFile): + name = "popl" + description = "Header-only C++ command line arguments parser that supports the same set of options as GNU's getopt." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/badaix/popl" + topics = ("cli", "command-line-arguments", "getopt", "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): + 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 package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "popl.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 = [] diff --git a/recipes/popl/all/test_package/CMakeLists.txt b/recipes/popl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7fec26ab44c8e --- /dev/null +++ b/recipes/popl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(popl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE popl::popl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/popl/all/test_package/conanfile.py b/recipes/popl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/popl/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/popl/all/test_package/test_package.cpp b/recipes/popl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3e0ed006d49d2 --- /dev/null +++ b/recipes/popl/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include + +using namespace popl; + +int main(int argc, char **argv) { + OptionParser op("Allowed options"); + auto help_option = op.add("h", "help", "produce help message"); + op.parse(argc, argv); + std::cout << op << "\n"; +} diff --git a/recipes/popl/config.yml b/recipes/popl/config.yml new file mode 100644 index 0000000000000..426a0e4c79e9b --- /dev/null +++ b/recipes/popl/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.0": + folder: all diff --git a/recipes/poppler-data/all/test_v1_package/conanfile.py b/recipes/poppler-data/all/test_v1_package/conanfile.py deleted file mode 100644 index 8a2bb2447ea7b..0000000000000 --- a/recipes/poppler-data/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -from conans import ConanFile -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - if not os.path.isdir(self.deps_user_info["poppler-data"].datadir): - raise AssertionError("datadir is not a directory") diff --git a/recipes/poppler/all/conanfile.py b/recipes/poppler/all/conanfile.py index b7d61c3e69e7e..c798993e27cdd 100644 --- a/recipes/poppler/all/conanfile.py +++ b/recipes/poppler/all/conanfile.py @@ -107,7 +107,7 @@ def requirements(self): if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_lcms: - self.requires("lcms/2.13.1") + self.requires("lcms/2.16") if self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9d") if self.options.with_png: diff --git a/recipes/poppler/all/test_package/CMakeLists.txt b/recipes/poppler/all/test_package/CMakeLists.txt index 33ae887aa6aea..d6cd92c156ed4 100644 --- a/recipes/poppler/all/test_package/CMakeLists.txt +++ b/recipes/poppler/all/test_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/popt/all/conandata.yml b/recipes/popt/1.16/conandata.yml similarity index 100% rename from recipes/popt/all/conandata.yml rename to recipes/popt/1.16/conandata.yml diff --git a/recipes/popt/1.16/conanfile.py b/recipes/popt/1.16/conanfile.py new file mode 100644 index 0000000000000..441401f46468c --- /dev/null +++ b/recipes/popt/1.16/conanfile.py @@ -0,0 +1,135 @@ +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.env import Environment, VirtualBuildEnv +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, unix_path +import os + + +required_conan_version = ">=1.54.0" + +class PoptConan(ConanFile): + name = "popt" + description = "Library for parsing command line parameters" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rpm-software-management/popt" + topics = ("command line", "options", "parsing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + 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 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): + basic_layout(self, src_folder="src") + + 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 requirements(self): + if self.settings.os == "Neutrino": + self.requires("libiconv/[>=1.15]") + + def build_requirements(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") + 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) + if is_msvc(self): + tc.extra_cflags.append("-FS") + tc.configure_args.extend([ + "--disable-dependency-tracking", + "--disable-nls", + ]) + 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 _patch_sources(self): + 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) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="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")) + 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.libs = ["libpopt"] if self.settings.os == "Windows" else ["popt"] + + self.cpp_info.set_property("pkg_config_name", "popt") + + if is_apple_os(self): + self.cpp_info.system_libs = ["iconv"] diff --git a/recipes/popt/all/patches/0004-vcpkg-fixmsvc.patch b/recipes/popt/1.16/patches/0004-vcpkg-fixmsvc.patch similarity index 100% rename from recipes/popt/all/patches/0004-vcpkg-fixmsvc.patch rename to recipes/popt/1.16/patches/0004-vcpkg-fixmsvc.patch diff --git a/recipes/popt/1.16/test_package/CMakeLists.txt b/recipes/popt/1.16/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3321b0a753dcf --- /dev/null +++ b/recipes/popt/1.16/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(popt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE popt::popt) diff --git a/recipes/popt/1.16/test_package/conanfile.py b/recipes/popt/1.16/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/popt/1.16/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/popt/all/test_package/test_package.c b/recipes/popt/1.16/test_package/test_package.c similarity index 100% rename from recipes/popt/all/test_package/test_package.c rename to recipes/popt/1.16/test_package/test_package.c diff --git a/recipes/popt/1.19/conandata.yml b/recipes/popt/1.19/conandata.yml new file mode 100755 index 0000000000000..9154d03ec87c9 --- /dev/null +++ b/recipes/popt/1.19/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.19": + url: "http://ftp.rpm.org/popt/releases/popt-1.x/popt-1.19.tar.gz" + sha256: "c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9" diff --git a/recipes/popt/1.19/conanfile.py b/recipes/popt/1.19/conanfile.py new file mode 100755 index 0000000000000..77c06c30fce86 --- /dev/null +++ b/recipes/popt/1.19/conanfile.py @@ -0,0 +1,88 @@ +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.env import Environment, VirtualBuildEnv +from conan.tools.files import collect_libs, copy, get, rmdir, rm +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc +import os + + +required_conan_version = ">=1.54.0" + +class PoptConan(ConanFile): + name = "popt" + description = "Library for parsing command line parameters" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/rpm-software-management/popt" + topics = ("command line", "options", "parsing") + 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 requirements(self): + if self.settings.os == "Neutrino": + self.requires("libiconv/1.17") + + 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 is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} can not be built with shared on Visual Studio and msvc, use mingw.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + ad = AutotoolsDeps(self) + ad.generate() + + tc = AutotoolsToolchain(self) + tc.ldflags.append("-lintl") + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, pattern="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")) + 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.libs = collect_libs(self) + + if is_apple_os(self): + self.cpp_info.system_libs = ["iconv"] + + if self.settings.os == "Neutrino": + self.cpp_info.system_libs = ["intl"] diff --git a/recipes/popt/1.19/test_package/CMakeLists.txt b/recipes/popt/1.19/test_package/CMakeLists.txt new file mode 100755 index 0000000000000..3321b0a753dcf --- /dev/null +++ b/recipes/popt/1.19/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(popt REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE popt::popt) diff --git a/recipes/popt/1.19/test_package/conanfile.py b/recipes/popt/1.19/test_package/conanfile.py new file mode 100755 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/popt/1.19/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/popt/1.19/test_package/test_package.c b/recipes/popt/1.19/test_package/test_package.c new file mode 100755 index 0000000000000..1ba85997582a9 --- /dev/null +++ b/recipes/popt/1.19/test_package/test_package.c @@ -0,0 +1,17 @@ +#include +#include +#include "popt.h" + + +int main(int argc, const char* argv[]) { + struct poptOption table[] = { + POPT_AUTOHELP + POPT_TABLEEND + }; + + poptContext context = poptGetContext(NULL, argc, argv, table, 0); + poptGetNextOpt(context); + poptFreeContext(context); + + return EXIT_SUCCESS; +} diff --git a/recipes/popt/all/conanfile.py b/recipes/popt/all/conanfile.py deleted file mode 100644 index ce3a9a4e859ec..0000000000000 --- a/recipes/popt/all/conanfile.py +++ /dev/null @@ -1,131 +0,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.env import Environment, VirtualBuildEnv -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, unix_path -import os - - -required_conan_version = ">=1.54.0" - -class PoptConan(ConanFile): - name = "popt" - description = "Library for parsing command line parameters" - license = "MIT" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/rpm-software-management/popt" - topics = ("command line", "options", "parsing") - package_type = "library" - settings = "os", "arch", "compiler", "build_type" - 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 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): - basic_layout(self, src_folder="src") - - 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 build_requirements(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") - 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) - if is_msvc(self): - tc.extra_cflags.append("-FS") - tc.configure_args.extend([ - "--disable-dependency-tracking", - "--disable-nls", - ]) - 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 _patch_sources(self): - 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) - - def build(self): - self._patch_sources() - autotools = Autotools(self) - autotools.configure() - autotools.make() - - def package(self): - copy(self, pattern="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")) - 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.libs = ["libpopt"] if self.settings.os == "Windows" else ["popt"] - - self.cpp_info.set_property("pkg_config_name", "popt") - - if is_apple_os(self): - self.cpp_info.system_libs = ["iconv"] diff --git a/recipes/popt/all/test_package/CMakeLists.txt b/recipes/popt/all/test_package/CMakeLists.txt deleted file mode 100644 index 22ec2254e31d1..0000000000000 --- a/recipes/popt/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -find_package(popt REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE popt::popt) diff --git a/recipes/popt/all/test_v1_package/CMakeLists.txt b/recipes/popt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index cbe79d4195d31..0000000000000 --- a/recipes/popt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(popt REQUIRED CONFIG) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/popt/all/test_v1_package/conanfile.py b/recipes/popt/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/popt/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/popt/config.yml b/recipes/popt/config.yml old mode 100644 new mode 100755 index b41d4f764c9b5..5701e758adc33 --- a/recipes/popt/config.yml +++ b/recipes/popt/config.yml @@ -1,3 +1,5 @@ versions: + "1.19": + folder: "1.19" "1.16": - folder: all + folder: "1.16" diff --git a/recipes/poselib/all/conandata.yml b/recipes/poselib/all/conandata.yml new file mode 100644 index 0000000000000..32b5efa0b3081 --- /dev/null +++ b/recipes/poselib/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.0.4": + url: "https://github.com/PoseLib/PoseLib/archive/refs/tags/v2.0.4.tar.gz" + sha256: "caa0c1c9b882f6e36b5ced6f781406ed97d4c1f0f61aa31345ebe54633d67c16" + "2.0.3": + url: "https://github.com/PoseLib/PoseLib/archive/refs/tags/v2.0.3.tar.gz" + sha256: "ec52fe738a803e53c4cedc27f393a38b2dced63da6c73148e98965b338ca0efc" diff --git a/recipes/poselib/all/conanfile.py b/recipes/poselib/all/conanfile.py new file mode 100644 index 0000000000000..0282ec6f8bfdb --- /dev/null +++ b/recipes/poselib/all/conanfile.py @@ -0,0 +1,110 @@ +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, replace_in_file, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class PoselibConan(ConanFile): + name = "poselib" + description = "PoseLib: minimal solvers for calibrated camera pose estimation" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/PoseLib/PoseLib" + topics = ("pose", "camera", "estimation", "solver") + + 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": "6", + "apple-clang": "10", + "msvc": "192", + "Visual Studio": "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 layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("eigen/3.4.0", transitive_headers=True, transitive_libs=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 self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration( + f"{self.ref} does not export symbols on Windows for a shared library build." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["MARCH_NATIVE"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "-march=native -Wall -Werror -fPIC", "") + + 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", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "PoseLib") + self.cpp_info.set_property("cmake_target_name", "PoseLib::PoseLib") + + suffix = "d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = ["PoseLib" + suffix] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/poselib/all/test_package/CMakeLists.txt b/recipes/poselib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ea7248e1ec70c --- /dev/null +++ b/recipes/poselib/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(PoseLib REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PoseLib::PoseLib) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/poselib/all/test_package/conanfile.py b/recipes/poselib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/poselib/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/poselib/all/test_package/test_package.cpp b/recipes/poselib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..613b02cd52fa4 --- /dev/null +++ b/recipes/poselib/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include + +int main() { + std::vector x1(10, Eigen::Vector3d{}); + std::vector x2(10, Eigen::Vector3d{}); + Eigen::Matrix3d h; + int res = poselib::homography_4pt(x1, x2, &h); +} diff --git a/recipes/poselib/config.yml b/recipes/poselib/config.yml new file mode 100644 index 0000000000000..7776ab2d30335 --- /dev/null +++ b/recipes/poselib/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.4": + folder: all + "2.0.3": + folder: all diff --git a/recipes/poshlib/all/test_v1_package/CMakeLists.txt b/recipes/poshlib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/poshlib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 90eb89e3f2f46..0000000000000 --- a/recipes/poshlib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/pprint/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/pprint/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/pprint/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", "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/test_v1_package/CMakeLists.txt b/recipes/pranav-csv2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/pranav-csv2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 0197f07f63c5d..0000000000000 --- a/recipes/pranav-csv2/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/conanfile.py b/recipes/premake/5.x/conanfile.py index d4fa461153f3c..0a761c061731a 100644 --- a/recipes/premake/5.x/conanfile.py +++ b/recipes/premake/5.x/conanfile.py @@ -3,7 +3,7 @@ import re import shutil -from conan import ConanFile, conan_version +from conan import ConanFile 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 @@ -55,10 +55,6 @@ def requirements(self): def validate(self): 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) diff --git a/recipes/premake/5.x/test_package/conanfile.py b/recipes/premake/5.x/test_package/conanfile.py index d2d508976967c..0cbf9e48678a6 100644 --- a/recipes/premake/5.x/test_package/conanfile.py +++ b/recipes/premake/5.x/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.cmake import cmake_layout +from conan.tools.build import can_run class TestPackageConan(ConanFile): @@ -10,8 +10,6 @@ class TestPackageConan(ConanFile): def build_requirements(self): self.tool_requires(self.tested_reference_str) - def layout(self): - cmake_layout(self) - def test(self): - self.run("premake5 --version") + if can_run(self): + self.run("premake5 --version") diff --git a/recipes/pretty-name/all/test_v1_package/CMakeLists.txt b/recipes/pretty-name/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/pretty-name/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index cbe0be23191a2..0000000000000 --- a/recipes/pretty-name/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 8c761f54ec31c..0000000000000 --- a/recipes/pretty-name/all/test_v1_package/src/test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#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/primesieve/all/conandata.yml b/recipes/primesieve/all/conandata.yml new file mode 100644 index 0000000000000..c600acb0c9606 --- /dev/null +++ b/recipes/primesieve/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "12.1": + url: "https://github.com/kimwalisch/primesieve/archive/refs/tags/v12.1.tar.gz" + sha256: "64e7f5d3ce680262b865c7aec1381ffb13d13f75dd985b964ce33806e1bbf386" + "11.2": + url: "https://github.com/kimwalisch/primesieve/archive/refs/tags/v11.2.tar.gz" + sha256: "86c31bae9c378340b19669eafef8c5e45849adf7b9c92af1d212a2a2bfa0a5db" diff --git a/recipes/primesieve/all/conanfile.py b/recipes/primesieve/all/conanfile.py new file mode 100644 index 0000000000000..b2629bd8f8081 --- /dev/null +++ b/recipes/primesieve/all/conanfile.py @@ -0,0 +1,97 @@ +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 get, copy, rename, rm, rmdir +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + +class PrimesieveConan(ConanFile): + name = "primesieve" + description = "Fast prime number generator" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kimwalisch/primesieve" + topics = ("math", "prime-numbers", "sieve-of-eratosthenes") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_multiarch": [True, False], + "with_msvc_crt_static": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_multiarch": True, + "with_msvc_crt_static": 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 layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support GCC<=5 currently. Contributions with fixes are welcome.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_PRIMESIEVE"] = False + tc.variables["BUILD_DOC"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["WITH_MULTIARCH"] = self.options.with_multiarch + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + if is_msvc(self): + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" + tc.variables["WITH_MSVC_CRT_STATIC"] = self.options.with_msvc_crt_static + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.generate() + + 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")) + if is_msvc(self) and self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "primesieve.dll.lib"), os.path.join(self.package_folder, "lib", "primesieve.lib")) + + def package_info(self): + self.cpp_info.libs = ["primesieve"] + self.cpp_info.set_property("cmake_file_name", "primesieve") + self.cpp_info.set_property("cmake_target_name", "primesieve::primesieve") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/primesieve/all/test_package/CMakeLists.txt b/recipes/primesieve/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a239474541c86 --- /dev/null +++ b/recipes/primesieve/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(primesieve REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE primesieve::primesieve) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/primesieve/all/test_package/conanfile.py b/recipes/primesieve/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/primesieve/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/primesieve/all/test_package/test_package.cpp b/recipes/primesieve/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a8281d9952969 --- /dev/null +++ b/recipes/primesieve/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include +#include +#include + +int main() { + std::vector primes; + primesieve::generate_n_primes(5, &primes); + std::cout << "First 5 primes: "; + for (const auto prime : primes) { + std::cout << prime << ' '; + } + std::cout << '\n'; +} diff --git a/recipes/primesieve/config.yml b/recipes/primesieve/config.yml new file mode 100644 index 0000000000000..c488150c0dff2 --- /dev/null +++ b/recipes/primesieve/config.yml @@ -0,0 +1,5 @@ +versions: + "12.1": + folder: all + "11.2": + folder: all diff --git a/recipes/pro-mdnsd/all/CMakeLists.txt b/recipes/pro-mdnsd/all/CMakeLists.txt deleted file mode 100644 index 361b35d4c17d9..0000000000000 --- a/recipes/pro-mdnsd/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/pro-mdnsd/all/conandata.yml b/recipes/pro-mdnsd/all/conandata.yml index f4bf0e41133c5..3ab03deb075b4 100644 --- a/recipes/pro-mdnsd/all/conandata.yml +++ b/recipes/pro-mdnsd/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "0.8.4": - patch_file: "patches/0001-cmake-install-bundle.patch" - base_path: "source_subfolder" diff --git a/recipes/pro-mdnsd/all/conanfile.py b/recipes/pro-mdnsd/all/conanfile.py index 8d1745ad0e35c..a4f294f26fda4 100644 --- a/recipes/pro-mdnsd/all/conanfile.py +++ b/recipes/pro-mdnsd/all/conanfile.py @@ -1,41 +1,37 @@ -from conans import ConanFile, CMake, tools import os -import textwrap +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, 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.43.0" +required_conan_version = ">=2.1" class mdnsdConan(ConanFile): name = "pro-mdnsd" + description = "Improved version of Jeremie Miller's MDNS-SD implementation" license = "BSD-3-Clause" - homepage = "https://github.com/Pro/mdnsd" url = "https://github.com/conan-io/conan-center-index" - description = "Improved version of Jeremie Miller's MDNS-SD implementation" + homepage = "https://github.com/Pro/mdnsd" topics = ("dns", "daemon", "multicast", "embedded", "c") - 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], "compile_as_cpp": [True, False], } default_options = { - "fPIC": True, "shared": False, + "fPIC": True, "compile_as_cpp": False, } - generators = "cmake" - _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) def config_options(self): if self.settings.os == "Windows": @@ -43,68 +39,47 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.compile_as_cpp: - 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): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["MDNSD_ENABLE_SANITIZERS"] = False + tc.variables["MDNSD_COMPILE_AS_CXX"] = self.options.compile_as_cpp + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.8.4": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["MDNSD_ENABLE_SANITIZERS"] = False - self._cmake.definitions["MDNSD_COMPILE_AS_CXX"] = self.options.compile_as_cpp - self._cmake.configure() - return self._cmake + 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() + 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, "share")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - - # 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), - {"libmdnsd": "mdnsd::mdnsd"} - ) - - @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", "cmake")) + 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", "mdnsd") - self.cpp_info.set_property("cmake_target_name", "libmdnsd") + self.cpp_info.set_property("cmake_target_name", "libmdnsd") + self.cpp_info.set_property("cmake_target_aliases", ["mdnsd::mdnsd"]) self.cpp_info.libs = ["mdnsd"] if self.settings.os == "Windows": - self.cpp_info.system_libs.append("ws2_32") - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "mdnsd" - self.cpp_info.names["cmake_find_package_multi"] = "mdnsd" - 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.system_libs = ["ws2_32", "wsock32"] diff --git a/recipes/pro-mdnsd/all/test_package/CMakeLists.txt b/recipes/pro-mdnsd/all/test_package/CMakeLists.txt index ff7f7e8ca3d71..5a773c9696280 100644 --- a/recipes/pro-mdnsd/all/test_package/CMakeLists.txt +++ b/recipes/pro-mdnsd/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(mdnsd REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} libmdnsd) +target_link_libraries(${PROJECT_NAME} mdnsd::mdnsd) diff --git a/recipes/pro-mdnsd/all/test_package/conanfile.py b/recipes/pro-mdnsd/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/pro-mdnsd/all/test_package/conanfile.py +++ b/recipes/pro-mdnsd/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/procxx-boost-ext-simd/all/test_v1_package/CMakeLists.txt b/recipes/procxx-boost-ext-simd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/procxx-boost-ext-simd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 70611dabf01ae..0000000000000 --- a/recipes/procxx-boost-ext-simd/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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 865b4bba90467..c05b215341622 100644 --- a/recipes/proj/all/conandata.yml +++ b/recipes/proj/all/conandata.yml @@ -1,69 +1,15 @@ sources: - "9.3.0": - url: "https://github.com/OSGeo/PROJ/archive/9.3.0.tar.gz" - sha256: "f48c334eaf56c38d681bcfa37f188f422a562f45a66e6e646a79b4249641ecdb" - "9.2.1": - url: "https://github.com/OSGeo/PROJ/releases/download/9.2.1/proj-9.2.1.tar.gz" - sha256: "15ebf4afa8744b9e6fccb5d571fc9f338dc3adcf99907d9e62d1af815d4971a1" - "9.1.1": - url: "https://github.com/OSGeo/PROJ/releases/download/9.1.1/proj-9.1.1.tar.gz" - sha256: "003cd4010e52bb5eb8f7de1c143753aa830c8902b6ed01209f294846e40e6d39" - "9.1.0": - url: "https://github.com/OSGeo/PROJ/releases/download/9.1.0/proj-9.1.0.tar.gz" - sha256: "81b2239b94cad0886222cde4f53cb49d34905aad2a1317244a0c30a553db2315" - "9.0.1": - url: "https://github.com/OSGeo/PROJ/releases/download/9.0.1/proj-9.0.1.tar.gz" - sha256: "737eaacbe7906d0d6ff43f0d9ebedc5c734cccc9e6b8d7beefdec3ab22d9a6a3" - "9.0.0": - url: "https://github.com/OSGeo/PROJ/releases/download/9.0.0/proj-9.0.0.tar.gz" - sha256: "0620aa01b812de00b54d6c23e7c5cc843ae2cd129b24fabe411800302172b989" - "8.2.1": - url: "https://github.com/OSGeo/PROJ/releases/download/8.2.1/proj-8.2.1.tar.gz" - sha256: "76ed3d0c3a348a6693dfae535e5658bbfd47f71cb7ff7eb96d9f12f7e068b1cf" - "7.2.1": - url: "https://github.com/OSGeo/PROJ/releases/download/7.2.1/proj-7.2.1.tar.gz" - sha256: "b384f42e5fb9c6d01fe5fa4d31da2e91329668863a684f97be5d4760dbbf0a14" - "6.3.1": - url: "https://github.com/OSGeo/PROJ/releases/download/6.3.1/proj-6.3.1.tar.gz" - sha256: "6de0112778438dcae30fcc6942dee472ce31399b9e5a2b67e8642529868c86f8" + "9.5.0": + url: "https://github.com/OSGeo/PROJ/releases/download/9.5.0/proj-9.5.0.tar.gz" + sha256: "659af0d558f7c5618c322fde2d3392910806faee8684687959339021fa207d99" + "9.4.1": + url: "https://github.com/OSGeo/PROJ/releases/download/9.4.1/proj-9.4.1.tar.gz" + sha256: "ffe20170ee2b952207adf8a195e2141eab12cda181e49fdeb54425d98c7171d7" + "9.3.1": + url: "https://github.com/OSGeo/PROJ/releases/download/9.3.1/proj-9.3.1.tar.gz" + sha256: "b0f919cb9e1f42f803a3e616c2b63a78e4d81ecfaed80978d570d3a5e29d10bc" patches: - "9.3.0": + "9.3.1": - 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" - patch_description: "Use cmake targets" - "9.1.0": - - patch_file: "patches/0001-use-cmake-targets-9.1.0.patch" - patch_type: "conan" - patch_description: "Use cmake targets" - "9.0.1": - - patch_file: "patches/0001-use-cmake-targets-9.0.1.patch" - patch_type: "conan" - patch_description: "Use cmake targets" - "9.0.0": - - patch_file: "patches/0001-use-cmake-targets-9.0.0.patch" - patch_type: "conan" - patch_description: "Use cmake targets" - - patch_file: "patches/0002-cmake-configure-proj-pc.patch" - patch_type: "portability" - patch_description: "cmake configure proj pc" - patch_source: "https://github.com/OSGeo/PROJ/pull/3087" - "8.2.1": - - patch_file: "patches/0001-use-cmake-targets-8.2.0.patch" - patch_type: "conan" - patch_description: "Use cmake targets" - "7.2.1": - - patch_file: "patches/0001-use-cmake-targets-7.2.1.patch" - patch_type: "conan" - patch_description: "Use cmake targets" - "6.3.1": - - patch_file: "patches/0001-use-cmake-targets-6.x.x.patch" - patch_type: "conan" - patch_description: "Use cmake targets" diff --git a/recipes/proj/all/conanfile.py b/recipes/proj/all/conanfile.py index cc5091962196d..413febb22d7ff 100644 --- a/recipes/proj/all/conanfile.py +++ b/recipes/proj/all/conanfile.py @@ -2,13 +2,12 @@ from conan.tools.apple import is_apple_os 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.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, collect_libs, rm, rename from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os - required_conan_version = ">=1.60.0 <2 || >=2.0.5" @@ -16,9 +15,9 @@ class ProjConan(ConanFile): name = "proj" description = "Cartographic Projections and Coordinate Transformations Library." license = "MIT" - topics = "dsp", "proj", "proj4", "projections", "gis", "geospatial" - homepage = "https://proj.org" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://proj.org" + topics = ("dsp", "proj", "proj4", "projections", "gis", "geospatial") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -38,10 +37,6 @@ 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) @@ -61,15 +56,17 @@ def layout(self): def requirements(self): self.requires("nlohmann_json/3.11.3") - self.requires("sqlite3/3.44.2") + self.requires("sqlite3/[>=3.44 <4]") if self.options.get_safe("with_tiff"): self.requires("libtiff/4.6.0") if self.options.get_safe("with_curl"): self.requires("libcurl/[>=7.78.0 <9]") def build_requirements(self): - if not self._is_legacy_one_profile: - self.tool_requires("sqlite3/") + if Version(self.version) >= "9.4.0": + self.tool_requires("cmake/[>=3.16 <4]") + + self.tool_requires("sqlite3/") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -77,9 +74,6 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if self._is_legacy_one_profile: - env = VirtualRunEnv(self) - env.generate(scope="build") tc = CMakeToolchain(self) tc.variables["USE_THREAD"] = self.options.threadsafe @@ -109,6 +103,7 @@ def generate(self): # 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.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) @@ -118,19 +113,19 @@ def _patch_sources(self): apply_conandata_patches(self) cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "/W4", "") # Fix up usage of SQLite3 finder outputs - rm(self, "FindSqlite3.cmake", os.path.join(self.source_folder, "cmake")) - replace_in_file(self, cmakelists, "SQLITE3_FOUND", "SQLite3_FOUND") - replace_in_file(self, cmakelists, "SQLITE3_VERSION", "SQLite3_VERSION") - replace_in_file(self, cmakelists, "find_package(Sqlite3 REQUIRED)", "find_package(SQLite3 REQUIRED)") + if Version(self.version) < "9.4.0": + rm(self, "FindSqlite3.cmake", os.path.join(self.source_folder, "cmake")) + replace_in_file(self, cmakelists, "SQLITE3_FOUND", "SQLite3_FOUND") + replace_in_file(self, cmakelists, "SQLITE3_VERSION", "SQLite3_VERSION") + replace_in_file(self, cmakelists, "find_package(Sqlite3 REQUIRED)", "find_package(SQLite3 REQUIRED)") # Let CMake install shared lib with a clean rpath ! - if Version(self.version) >= "7.1.0" and Version(self.version) < "9.0.0": - replace_in_file(self, cmakelists, - "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", - "") + if "7.1.0" <= Version(self.version) < "9.0.0": + replace_in_file(self, cmakelists, "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", "") # Aggressive workaround against SIP on macOS, to handle sqlite3 executable # linked to shared sqlite3 lib @@ -141,10 +136,8 @@ def _patch_sources(self): else: cmake_sqlite_call = "generate_proj_db.cmake" pattern = "\"${EXE_SQLITE3}\"" - if self._is_legacy_one_profile: - lib_paths = self.dependencies["sqlite3"].cpp_info.libdirs - else: - lib_paths = self.dependencies.build["sqlite3"].cpp_info.libdirs + + lib_paths = self.dependencies.build["sqlite3"].cpp_info.libdirs replace_in_file(self, os.path.join(self.source_folder, "data", cmake_sqlite_call), f"COMMAND {pattern}", @@ -155,6 +148,11 @@ def _patch_sources(self): if Version(self.version) < "8.1.0": rmdir(self, os.path.join(self.source_folder, "include", "proj", "internal", "nlohmann")) + # Remove warning flags that are unfamiliar to GCC 5 + if Version(self.version) >= "9.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8.0": + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "${PROJ_C_WARN_FLAGS}", "") + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "${PROJ_CXX_WARN_FLAGS}", "") + def build(self): self._patch_sources() cmake = CMake(self) @@ -174,7 +172,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - def package_info(self): proj_version = Version(self.version) cmake_config_filename = "proj" if proj_version >= "7.0.0" else "proj4" @@ -218,16 +215,3 @@ def package_info(self): if self.options.build_executables: self.buildenv_info.prepend_path(proj_data_env_var_name, res_path) - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = cmake_config_filename - self.cpp_info.filenames["cmake_find_package_multi"] = cmake_config_filename - self.cpp_info.names["cmake_find_package"] = cmake_namespace - self.cpp_info.names["cmake_find_package_multi"] = cmake_namespace - self.cpp_info.components["projlib"].names["cmake_find_package"] = "proj" - self.cpp_info.components["projlib"].names["cmake_find_package_multi"] = "proj" - if Version(self.version) < "9.1.0": - self.env_info.PROJ_LIB.append(res_path) - else: - self.env_info.PROJ_DATA.append(res_path) - if self.options.build_executables: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch b/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch deleted file mode 100644 index 6bec96d49f9b3..0000000000000 --- a/recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -ru a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt 2020-02-10 17:29:51.000000000 +0800 -+++ b/CMakeLists.txt 2022-12-14 21:05:09.821289235 +0800 -@@ -114,6 +114,8 @@ - include(ProjMac) - include(policies) - -+find_package(nlohmann_json REQUIRED) -+ - ################################################################################ - # Check for sqlite3 - ################################################################################ -diff -ru a/src/lib_proj.cmake b/src/lib_proj.cmake ---- a/src/lib_proj.cmake 2019-12-29 06:23:06.000000000 +0800 -+++ b/src/lib_proj.cmake 2022-12-14 20:58:56.856752193 +0800 -@@ -311,7 +311,7 @@ - source_group("Source Files\\ISO19111" - FILES ${SRC_LIBPROJ_ISO19111}) - --include_directories(${CMAKE_SOURCE_DIR}/include) -+include_directories(${PROJ4_SOURCE_DIR}/include) - - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - source_group("CMake Files" FILES CMakeLists.txt) -@@ -440,8 +440,7 @@ - target_link_libraries(${PROJ_CORE_TARGET} ${CMAKE_THREAD_LIBS_INIT}) - endif() - --include_directories(${SQLITE3_INCLUDE_DIR}) --target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY}) -+target_link_libraries(${PROJ_CORE_TARGET} nlohmann_json::nlohmann_json SQLite::SQLite3) - - if(MSVC AND BUILD_LIBPROJ_SHARED) - target_compile_definitions(${PROJ_CORE_TARGET} diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch b/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch deleted file mode 100644 index 6ee348ac9ddd0..0000000000000 --- a/recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -ru a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt 2020-12-27 02:57:21.000000000 +0800 -+++ b/CMakeLists.txt 2022-12-14 21:21:31.516729458 +0800 -@@ -121,6 +121,8 @@ - include(ProjMac) - include(policies) - -+find_package(nlohmann_json REQUIRED) -+ - ################################################################################ - # Check for sqlite3 - ################################################################################ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -414,19 +414,16 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) - target_link_libraries(${PROJ_CORE_TARGET} ${CMAKE_THREAD_LIBS_INIT}) - endif() - --target_include_directories(${PROJ_CORE_TARGET} PRIVATE ${SQLITE3_INCLUDE_DIR}) --target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY}) -+target_link_libraries(${PROJ_CORE_TARGET} nlohmann_json::nlohmann_json SQLite::SQLite3) - - if(TIFF_ENABLED) - target_compile_definitions(${PROJ_CORE_TARGET} PRIVATE -DTIFF_ENABLED) -- target_include_directories(${PROJ_CORE_TARGET} PRIVATE ${TIFF_INCLUDE_DIR}) -- target_link_libraries(${PROJ_CORE_TARGET} ${TIFF_LIBRARY}) -+ target_link_libraries(${PROJ_CORE_TARGET} TIFF::TIFF) - endif() - - if(CURL_ENABLED) - target_compile_definitions(${PROJ_CORE_TARGET} PRIVATE -DCURL_ENABLED) -- target_include_directories(${PROJ_CORE_TARGET} PRIVATE ${CURL_INCLUDE_DIR}) -- target_link_libraries(${PROJ_CORE_TARGET} ${CURL_LIBRARY}) -+ target_link_libraries(${PROJ_CORE_TARGET} CURL::libcurl) - endif() - - if(MSVC AND BUILD_SHARED_LIBS) diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch deleted file mode 100644 index 8ce7c1895ee22..0000000000000 --- a/recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -453,8 +453,7 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) - 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) -@@ -464,16 +463,14 @@ endif() - - if(TIFF_ENABLED) - target_compile_definitions(proj PRIVATE -DTIFF_ENABLED) -- target_include_directories(proj PRIVATE ${TIFF_INCLUDE_DIR}) -- target_link_libraries(proj PRIVATE ${TIFF_LIBRARY}) -+ target_link_libraries(proj PRIVATE TIFF::TIFF) - endif() - - if(CURL_ENABLED) - target_compile_definitions(proj PRIVATE -DCURL_ENABLED) -- target_include_directories(proj PRIVATE ${CURL_INCLUDE_DIR}) - target_link_libraries(proj - PRIVATE -- ${CURL_LIBRARY} -+ CURL::libcurl - $<$:ws2_32> - $<$:wldap32> - $<$:advapi32> diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch deleted file mode 100644 index c7cf8eab51037..0000000000000 --- a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -444,8 +444,7 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) - 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) -@@ -455,16 +454,14 @@ endif() - - if(TIFF_ENABLED) - target_compile_definitions(proj PRIVATE -DTIFF_ENABLED) -- target_include_directories(proj PRIVATE ${TIFF_INCLUDE_DIR}) -- target_link_libraries(proj PRIVATE ${TIFF_LIBRARY}) -+ target_link_libraries(proj PRIVATE TIFF::TIFF) - endif() - - if(CURL_ENABLED) - target_compile_definitions(proj PRIVATE -DCURL_ENABLED) -- target_include_directories(proj PRIVATE ${CURL_INCLUDE_DIR}) - target_link_libraries(proj - PRIVATE -- ${CURL_LIBRARY} -+ CURL::libcurl - $<$:ws2_32> - $<$:wldap32> - $<$:advapi32> diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch deleted file mode 100644 index 6920410551838..0000000000000 --- a/recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -444,8 +444,7 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) - 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) -@@ -455,16 +454,14 @@ endif() - - if(TIFF_ENABLED) - target_compile_definitions(proj PRIVATE -DTIFF_ENABLED) -- target_include_directories(proj PRIVATE ${TIFF_INCLUDE_DIR}) -- target_link_libraries(proj PRIVATE ${TIFF_LIBRARY}) -+ target_link_libraries(proj PRIVATE TIFF::TIFF) - endif() - - if(CURL_ENABLED) - target_compile_definitions(proj PRIVATE -DCURL_ENABLED) -- target_include_directories(proj PRIVATE ${CURL_INCLUDE_DIRS}) - target_link_libraries(proj - PRIVATE -- ${CURL_LIBRARIES} -+ CURL::libcurl - $<$:ws2_32> - $<$:wldap32> - $<$:advapi32> diff --git a/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch b/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch deleted file mode 100644 index ddd144b4ef122..0000000000000 --- a/recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/src/lib_proj.cmake -+++ b/src/lib_proj.cmake -@@ -447,8 +447,7 @@ if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT) - 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) -@@ -458,16 +457,14 @@ endif() - - if(TIFF_ENABLED) - target_compile_definitions(proj PRIVATE -DTIFF_ENABLED) -- target_include_directories(proj PRIVATE ${TIFF_INCLUDE_DIR}) -- target_link_libraries(proj PRIVATE ${TIFF_LIBRARY}) -+ target_link_libraries(proj PRIVATE TIFF::TIFF) - endif() - - if(CURL_ENABLED) - target_compile_definitions(proj PRIVATE -DCURL_ENABLED) -- target_include_directories(proj PRIVATE ${CURL_INCLUDE_DIRS}) - target_link_libraries(proj - PRIVATE -- ${CURL_LIBRARIES} -+ CURL::libcurl - $<$:ws2_32> - $<$:wldap32> - $<$:advapi32> diff --git a/recipes/proj/all/patches/0002-cmake-configure-proj-pc.patch b/recipes/proj/all/patches/0002-cmake-configure-proj-pc.patch deleted file mode 100644 index e39909dc403a9..0000000000000 --- a/recipes/proj/all/patches/0002-cmake-configure-proj-pc.patch +++ /dev/null @@ -1,13 +0,0 @@ -fixed by https://github.com/OSGeo/PROJ/pull/3087 - ---- a/cmake/ProjUtilities.cmake -+++ b/cmake/ProjUtilities.cmake -@@ -98,7 +98,7 @@ function(configure_proj_pc) - list(APPEND EXTRA_LIBS -lole32 -lshell32) - else() - set(cxx_libs "${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}") -- list(REMOVE_ITEM cxx_libs ${CMAKE_C_IMPLICIT_LINK_LIBRARIES}) -+ list(REMOVE_ITEM cxx_libs ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} CMake_3.19_quirk) - foreach(lib IN LISTS cxx_libs) - list(APPEND EXTRA_LIBS "-l${lib}") - endforeach() diff --git a/recipes/proj/all/test_package/CMakeLists.txt b/recipes/proj/all/test_package/CMakeLists.txt index 68d47d66efc39..aa2b11c8077e9 100644 --- a/recipes/proj/all/test_package/CMakeLists.txt +++ b/recipes/proj/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) add_executable(test_package test_package.c) if(PROJ_VERSION_GE_7) diff --git a/recipes/proj/all/test_v1_package/CMakeLists.txt b/recipes/proj/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/proj/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/proj/all/test_v1_package/conanfile.py b/recipes/proj/all/test_v1_package/conanfile.py deleted file mode 100644 index 0a0d55e2ef660..0000000000000 --- a/recipes/proj/all/test_v1_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.definitions["PROJ_VERSION_GE_7"] = tools.Version(self.deps_cpp_info["proj"].version) >= "7.0.0" - 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/proj/config.yml b/recipes/proj/config.yml index 57e61ab70191e..a5a2a896ea9e0 100644 --- a/recipes/proj/config.yml +++ b/recipes/proj/config.yml @@ -1,19 +1,7 @@ versions: - "9.3.0": + "9.5.0": folder: "all" - "9.2.1": + "9.4.1": folder: "all" - "9.1.1": - folder: "all" - "9.1.0": - folder: "all" - "9.0.1": - folder: "all" - "9.0.0": - folder: "all" - "8.2.1": - folder: "all" - "7.2.1": - folder: "all" - "6.3.1": + "9.3.1": folder: "all" diff --git a/recipes/prometheus-cpp/all/conandata.yml b/recipes/prometheus-cpp/all/conandata.yml index a1e0c249c424c..f087398f73aad 100644 --- a/recipes/prometheus-cpp/all/conandata.yml +++ b/recipes/prometheus-cpp/all/conandata.yml @@ -1,22 +1,13 @@ sources: + "1.3.0": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.3.0.tar.gz" + sha256: "ac6e958405a29fbbea9db70b00fa3c420e16ad32e1baf941ab233ba031dd72ee" + "1.2.4": + url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.2.4.tar.gz" + sha256: "48dbad454d314b836cc667ec4def93ec4a6e4255fc8387c20cacb3b8b6faee30" "1.1.0": url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.1.0.tar.gz" sha256: "397544fe91e183029120b4eebcfab24ed9ec833d15850aae78fd5db19062d13a" "1.0.1": url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.0.1.tar.gz" sha256: "593e028d401d3298eada804d252bc38d8cab3ea1c9e88bcd72095281f85e6d16" - "1.0.0": - url: "https://github.com/jupp0r/prometheus-cpp/archive/v1.0.0.tar.gz" - sha256: "07018db604ea3e61f5078583e87c80932ea10c300d979061490ee1b7dc8e3a41" - "0.12.3": - url: "https://github.com/jupp0r/prometheus-cpp/archive/v0.12.3.tar.gz" - sha256: "e021e76e8e933672f1af0d223307282004f585a054354f8d894db39debddff8e" - "0.12.1": - url: "https://github.com/jupp0r/prometheus-cpp/archive/v0.12.1.tar.gz" - sha256: "2102609457f812dbeaaafd55736461fd0538fc7e7568174b1cdec43399dbded4" - "0.11.0": - url: "https://github.com/jupp0r/prometheus-cpp/archive/v0.11.0.tar.gz" - sha256: "aab4ef8342319f631969e01b8c41e355704847cbe76131cb1dd5ea1862000bda" -patches: - "0.11.0": - - patch_file: "patches/0001-include-limits.patch" diff --git a/recipes/prometheus-cpp/all/conanfile.py b/recipes/prometheus-cpp/all/conanfile.py index 10a8edf3a1e5e..06f45f304071f 100644 --- a/recipes/prometheus-cpp/all/conanfile.py +++ b/recipes/prometheus-cpp/all/conanfile.py @@ -1,14 +1,13 @@ 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.files import get, copy, rmdir from conan.tools.build import check_min_cppstd, valid_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.scm import Version -from conan.tools.microsoft import is_msvc, check_min_vs import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class PrometheusCppConan(ConanFile): name = "prometheus-cpp" @@ -36,18 +35,7 @@ class PrometheusCppConan(ConanFile): @property def _min_cppstd(self): - return 11 if Version(self.version) < "1.1.0" else 14 - - @property - def _compilers_minimum_version(self): - return { - "gcc": "7", - "clang": "7", - "apple-clang": "10", - } - - def export_sources(self): - export_conandata_patches(self) + return "14" if Version(self.version) == "1.1.0" else "11" def config_options(self): if self.settings.os == "Windows": @@ -66,25 +54,16 @@ def requirements(self): if self.options.with_pull: self.requires("civetweb/1.16") if self.options.with_push: - self.requires("libcurl/[>=7.78.0 <9]") + self.requires("libcurl/[>=7.78.0 <9]", transitive_headers=True) if self.options.get_safe("with_compression"): self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.info.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) - if Version(self.version) < "1.1.0": - return - 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._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) @@ -102,7 +81,6 @@ def generate(self): deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/prometheus-cpp/all/test_package/CMakeLists.txt b/recipes/prometheus-cpp/all/test_package/CMakeLists.txt index 0df7da5ba0a1f..9f1774c2706fa 100644 --- a/recipes/prometheus-cpp/all/test_package/CMakeLists.txt +++ b/recipes/prometheus-cpp/all/test_package/CMakeLists.txt @@ -1,12 +1,12 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(prometheus-cpp CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE prometheus-cpp::push prometheus-cpp::pull) -if(${prometheus-cpp_VERSION} VERSION_LESS "1.1.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -else() +if(${prometheus-cpp_VERSION} VERSION_EQUAL "1.1.0") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) endif() diff --git a/recipes/prometheus-cpp/all/test_v1_package/CMakeLists.txt b/recipes/prometheus-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/prometheus-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/prometheus-cpp/all/test_v1_package/conanfile.py b/recipes/prometheus-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/prometheus-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/prometheus-cpp/config.yml b/recipes/prometheus-cpp/config.yml index 3bfa3902dafa5..50ed34cd33932 100644 --- a/recipes/prometheus-cpp/config.yml +++ b/recipes/prometheus-cpp/config.yml @@ -1,13 +1,9 @@ versions: - "1.1.0": - folder: all - "1.0.1": + "1.3.0": folder: all - "1.0.0": + "1.2.4": folder: all - "0.12.3": - folder: all - "0.12.1": + "1.1.0": folder: all - "0.11.0": + "1.0.1": folder: all diff --git a/recipes/proposal/all/conandata.yml b/recipes/proposal/all/conandata.yml index 413be0b0859fb..6fbf698e7992a 100644 --- a/recipes/proposal/all/conandata.yml +++ b/recipes/proposal/all/conandata.yml @@ -2,51 +2,9 @@ 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" - "7.5.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.5.0.tar.gz" - sha256: "ba31bd0a2337f3717a1ad88a3b3f7fefa3f1e4dae4fc922e72144cfecffe5e94" "7.4.2": url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.2.tar.gz" sha256: "f0db44c96a80a6ce3dda02c598574f5f0209376bd2c6c176797710da8eb3e108" - "7.4.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.1.tar.gz" - sha256: "e6ff9749f402dd77f320a2a28b77a45636cbe186f926d9b5a7b54ea6ee631ada" - "7.4.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.0.tar.gz" - sha256: "34865a84052c670fbc4554361acef716655906f65f5bba88e3fd73dff92989de" - "7.3.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.1.tar.gz" - sha256: "260426f71226c888832a6da47c55c05dab31b8240dbbc67b4b2466af24d962d3" - "7.3.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.0.tar.gz" - sha256: "fa3763fee656164e5f3a7d6a11f08771dd70700adb93de9db4625ad981e0defb" - "7.2.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.2.1.tar.gz" - sha256: "279c1b897c8ae426a493ca77e01c8cfd47e8cd313f3e35ed3ddf098dcccdeeda" - "7.1.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.1.tar.gz" - sha256: "090e885d6f241b87a98234571cc1bd2ff935933365717e327602ea37f4d3548a" - "7.1.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.0.tar.gz" - sha256: "98faba7cd9d743dae2a8bec70b1c4a382339b9fa40b71fda2936c9d7054d7a85" - "7.0.7": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.7.tar.gz" - sha256: "e366e9280fbe99e68bc5b31a74f51610e27ca8a646dff28e883573893572ab75" - "7.0.5": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.5.tar.gz" - sha256: "232f84e410f439e6bc1b721fc65280906e9f6ad5b39490561870d42a1ee1af17" - "7.0.4": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.4.tar.gz" - sha256: "1442b9f5d8824e7794e97a2eca3f5f109e33c423a37714ada9ad98435b4d4b01" - "7.0.2": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.2.tar.gz" - sha256: "8166ffca150abce77cc4254343bb89d3476e17910e96fa4936b87dafcc72d592" diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index 99caccadb2b21..8f555fa886660 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -61,9 +61,9 @@ def requirements(self): # from implementation in headers (templates) self.requires("cubicinterpolation/0.1.5", transitive_headers=True, transitive_libs=True) # spdlog: requires transitive_libs due to direct calls to functionality from headers - self.requires("spdlog/1.11.0", transitive_headers=True, transitive_libs=True) + self.requires("spdlog/[>=1.11 <2]", transitive_headers=True, transitive_libs=True) # nlohmann_json: public headers include json.hpp and json_fwd.hpp - self.requires("nlohmann_json/3.11.2", transitive_headers=True) + self.requires("nlohmann_json/[~3.11]", transitive_headers=True) if self.options.with_python: self.requires("pybind11/2.10.1") diff --git a/recipes/proposal/all/test_package/CMakeLists.txt b/recipes/proposal/all/test_package/CMakeLists.txt index 7263fd9e7da18..c2c0d746e29a4 100644 --- a/recipes/proposal/all/test_package/CMakeLists.txt +++ b/recipes/proposal/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(PROPOSAL REQUIRED CONFIG) diff --git a/recipes/proposal/all/test_v1_package/CMakeLists.txt b/recipes/proposal/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7ea0378c83fe1..0000000000000 --- a/recipes/proposal/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/proposal/all/test_v1_package/conanfile.py b/recipes/proposal/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/proposal/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_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/proposal/config.yml b/recipes/proposal/config.yml index 52f45a4a6325f..eeec1942674b6 100644 --- a/recipes/proposal/config.yml +++ b/recipes/proposal/config.yml @@ -1,35 +1,7 @@ versions: "7.6.2": folder: all - "7.6.1": - folder: all - "7.6.0": - folder: all "7.5.1": folder: all - "7.5.0": - folder: all "7.4.2": folder: all - "7.4.1": - folder: all - "7.4.0": - folder: all - "7.3.1": - folder: all - "7.3.0": - folder: all - "7.2.1": - folder: all - "7.1.1": - folder: all - "7.1.0": - folder: all - "7.0.7": - folder: all - "7.0.5": - folder: all - "7.0.4": - folder: all - "7.0.2": - folder: all diff --git a/recipes/protobuf/all/conandata.yml b/recipes/protobuf/all/conandata.yml index 0417c4d805f42..7c9879f82cdfb 100644 --- a/recipes/protobuf/all/conandata.yml +++ b/recipes/protobuf/all/conandata.yml @@ -1,62 +1,225 @@ sources: + "6.30.1": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v6.30.1.tar.gz" + sha256: "c97cc064278ef2b8c4da66c1f85613642ecbd5a0c4217c0defdf7ad1b3de9fa5" + "5.29.3": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v5.29.3.tar.gz" + sha256: "fe35f190d7a63533b06558915d6ee469cbee143de70891e1dd54d197b05f362a" + "5.28.3": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v5.28.3.tar.gz" + sha256: "7fce939b9b7181bd0bd157360e0cc88a8cabf01ac4efe4662494f56dd955d4c1" + "5.27.0": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v5.27.0.tar.gz" + sha256: "1611a03e550c27c526bde1da544c94f7aa65c10687bbc8e570537dfa94069e1a" + "4.25.3": + url: "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v4.25.3.tar.gz" + sha256: "1d6b8d9114cb5b33ce8711729893097a107d4fefff5423528eb1decb5451856c" "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.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.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.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" - "3.20.0": - - 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" - "3.19.6": - - 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.6-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.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" - patch_source: "https://github.com/protocolbuffers/protobuf/pull/10103" - "3.17.1": - - patch_file: "patches/protobuf-3.17.1-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" +absl_deps: + # reference: https://github.com/protocolbuffers/protobuf/blob/main/cmake/abseil-cpp.cmake + "6.30.1": + - absl_absl_check + - absl_absl_log + - absl_algorithm + - absl_base + - absl_bind_front + - absl_bits + - absl_btree + - absl_cleanup + - absl_cord + - absl_core_headers + - absl_debugging + - absl_die_if_null + - absl_dynamic_annotations + - absl_flags + - absl_flat_hash_map + - absl_flat_hash_set + - absl_function_ref + - absl_hash + - absl_layout + - absl_log_initialize + - absl_log_globals + - absl_log_severity + - absl_memory + - absl_node_hash_map + - absl_node_hash_set + - absl_optional + - absl_random_distributions + - absl_random_random + - absl_span + - absl_status + - absl_statusor + - absl_strings + - absl_synchronization + - absl_time + - absl_type_traits + - absl_utility + - absl_variant + "5.29.3": + - absl_absl_check + - absl_absl_log + - absl_algorithm + - absl_base + - absl_bind_front + - absl_bits + - absl_btree + - absl_cleanup + - absl_cord + - absl_core_headers + - absl_debugging + - absl_die_if_null + - absl_dynamic_annotations + - absl_flags + - absl_flat_hash_map + - absl_flat_hash_set + - absl_function_ref + - absl_hash + - absl_if_constexpr + - absl_layout + - absl_log_initialize + - absl_log_globals + - absl_log_severity + - absl_memory + - absl_node_hash_map + - absl_node_hash_set + - absl_optional + - absl_random_distributions + - absl_random_random + - absl_span + - absl_status + - absl_statusor + - absl_strings + - absl_synchronization + - absl_time + - absl_type_traits + - absl_utility + - absl_variant + "5.28.3": + - absl_absl_check + - absl_absl_log + - absl_algorithm + - absl_base + - absl_bind_front + - absl_bits + - absl_btree + - absl_cleanup + - absl_cord + - absl_core_headers + - absl_debugging + - absl_die_if_null + - absl_dynamic_annotations + - absl_flags + - absl_flat_hash_map + - absl_flat_hash_set + - absl_function_ref + - absl_hash + - absl_if_constexpr + - absl_layout + - absl_log_initialize + - absl_log_globals + - absl_log_severity + - absl_memory + - absl_node_hash_map + - absl_node_hash_set + - absl_optional + - absl_random_distributions + - absl_random_random + - absl_span + - absl_status + - absl_statusor + - absl_strings + - absl_synchronization + - absl_time + - absl_type_traits + - absl_utility + - absl_variant + "5.27.0": + - absl_absl_check + - absl_absl_log + - absl_algorithm + - absl_base + - absl_bind_front + - absl_bits + - absl_btree + - absl_cleanup + - absl_cord + - absl_core_headers + - absl_debugging + - absl_die_if_null + - absl_dynamic_annotations + - absl_flags + - absl_flat_hash_map + - absl_flat_hash_set + - absl_function_ref + - absl_hash + - absl_if_constexpr + - absl_layout + - absl_log_initialize + - absl_log_globals + - absl_log_severity + - absl_memory + - absl_node_hash_map + - absl_node_hash_set + - absl_optional + - absl_random_distributions + - absl_random_random + - absl_span + - absl_status + - absl_statusor + - absl_strings + - absl_synchronization + - absl_time + - absl_type_traits + - absl_utility + - absl_variant + "4.25.3": + - absl_absl_check + - absl_absl_log + - absl_algorithm + - absl_base + - absl_bind_front + - absl_bits + - absl_btree + - absl_cleanup + - absl_cord + - absl_core_headers + - absl_debugging + - absl_die_if_null + - absl_dynamic_annotations + - absl_flags + - absl_flat_hash_map + - absl_flat_hash_set + - absl_function_ref + - absl_hash + - absl_layout + - absl_log_initialize + - absl_log_severity + - absl_memory + - absl_node_hash_map + - absl_node_hash_set + - absl_optional + - absl_span + - absl_status + - absl_statusor + - absl_strings + - absl_synchronization + - absl_time + - absl_type_traits + - absl_utility + - absl_variant diff --git a/recipes/protobuf/all/conanfile.py b/recipes/protobuf/all/conanfile.py index f696a27880684..1f296cac7ef62 100644 --- a/recipes/protobuf/all/conanfile.py +++ b/recipes/protobuf/all/conanfile.py @@ -1,13 +1,13 @@ 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, rename, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir, rm +from conan.tools.files import copy, rename, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir, rm, save from conan.tools.microsoft import check_min_vs, msvc_runtime_flag, is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os -import textwrap required_conan_version = ">=1.53" @@ -27,6 +27,7 @@ class ProtobufConan(ConanFile): "with_zlib": [True, False], "with_rtti": [True, False], "lite": [True, False], + "upb": [True, False], "debug_suffix": [True, False], } default_options = { @@ -35,6 +36,7 @@ class ProtobufConan(ConanFile): "with_zlib": True, "with_rtti": True, "lite": False, + "upb": False, "debug_suffix": True, } @@ -48,8 +50,14 @@ def _is_clang_cl(self): def _is_clang_x86(self): return self.settings.compiler == "clang" and self.settings.arch == "x86" + @property + def _protobuf_release(self): + current_ver = Version(self.version) + return Version(f"{current_ver.minor}.{current_ver.patch}") + def export_sources(self): export_conandata_patches(self) + copy(self, "protobuf-conan-protoc-target.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -59,6 +67,9 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if self._protobuf_release < "27.0": + self.options.rm_safe("upb") + def layout(self): cmake_layout(self, src_folder="src") @@ -66,10 +77,40 @@ def requirements(self): if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") + if self._protobuf_release >= "22.0": + self.requires("abseil/[>=20230802.1 <=20250127.0]", transitive_headers=True) + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + def validate(self): if self.options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Protobuf can't be built with shared + MT(d) runtimes") + if is_msvc(self) and self._protobuf_release >= "22" and self.options.shared and \ + not self.dependencies["abseil"].options.shared: + raise ConanInvalidConfiguration("When building protobuf as a shared library on Windows, " + "abseil needs to be a shared library too") + if self._protobuf_release >= "30.1": + check_min_cppstd(self, 17) + elif self._protobuf_release >= "22.0": + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + else: + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), None) + compiler_version = Version(self.settings.compiler.version) + if minimum_version and compiler_version < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++14, which your compiler does not support.", + ) + check_min_vs(self, "190") if self.settings.compiler == "clang": @@ -79,12 +120,18 @@ def validate(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def build_requirements(self): + if self._protobuf_release >= "30.1": + self.tool_requires("cmake/[>=3.16 <4]") + @property def _cmake_install_base_path(self): return os.path.join("lib", "cmake", "protobuf") def generate(self): tc = CMakeToolchain(self) + if self._protobuf_release >= "30.1": + tc.cache_variables["protobuf_LOCAL_DEPENDENCIES_ONLY"] = True tc.cache_variables["CMAKE_INSTALL_CMAKEDIR"] = self._cmake_install_base_path.replace("\\", "/") tc.cache_variables["protobuf_WITH_ZLIB"] = self.options.with_zlib tc.cache_variables["protobuf_BUILD_TESTS"] = False @@ -93,14 +140,31 @@ def generate(self): tc.cache_variables["protobuf_DEBUG_POSTFIX"] = "" tc.cache_variables["protobuf_BUILD_LIBPROTOC"] = self.settings.os != "tvOS" tc.cache_variables["protobuf_DISABLE_RTTI"] = not self.options.with_rtti + tc.cache_variables["protobuf_BUILD_LIBUPB"] = self.options.get_safe("upb") + if self._protobuf_release >= "22.0": + tc.cache_variables["protobuf_ABSL_PROVIDER"] = "package" + if not self.settings.compiler.get_safe("cppstd") and self._protobuf_release >= "22.0": + tc.variables["CMAKE_CXX_STANDARD"] = 14 if is_msvc(self) or self._is_clang_cl: - runtime = msvc_runtime_flag(self) - if not runtime: - runtime = self.settings.get_safe("compiler.runtime") - tc.cache_variables["protobuf_MSVC_STATIC_RUNTIME"] = "MT" in runtime + runtime = self.settings.get_safe("compiler.runtime") + if runtime: + tc.cache_variables["protobuf_MSVC_STATIC_RUNTIME"] = runtime == "static" if is_apple_os(self) and self.options.shared: # Workaround against SIP on macOS for consumers while invoking protoc when protobuf lib is shared tc.variables["CMAKE_INSTALL_RPATH"] = "@loader_path/../lib" + + if self.settings.os == "Linux": + # Use RPATH instead of RUNPATH to help with specific case + # in the grpc recipe when grpc_cpp_plugin is run with protoc + # in the same build. RPATH ensures that the rpath in the binary + # is respected for transitive dependencies too + project_include = os.path.join(self.generators_folder, "protobuf_project_include.cmake") + save(self, project_include, "add_link_options(-Wl,--disable-new-dtags)") + tc.variables["CMAKE_PROJECT_INCLUDE"] = project_include + # Note: conan2 only could be: + # tc.extra_exelinkflags.append("-Wl,--disable-new-dtags") + # tc.extra_sharedlinkflags.append("-Wl,--disable-new-dtags") + tc.generate() deps = CMakeDeps(self) @@ -109,53 +173,14 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - # Provide relocatable protobuf::protoc target and Protobuf_PROTOC_EXECUTABLE cache variable - # TODO: some of the following logic might be disabled when conan will - # allow to create executable imported targets in package_info() - protobuf_config_cmake = os.path.join(self.source_folder, "cmake", "protobuf-config.cmake.in") - - replace_in_file(self, - protobuf_config_cmake, - "@_protobuf_FIND_ZLIB@", - "# BEGIN CONAN PATCH\n#_protobuf_FIND_ZLIB@\n# END CONAN PATCH" - ) - - exe_ext = ".exe" if self.settings.os == "Windows" else "" - 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(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 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() - """) - replace_in_file(self, - protobuf_config_cmake, - "include(\"${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake\")", - protoc_target - ) + if self._protobuf_release < "22.0": + # In older versions of protobuf, this file defines the `protobuf_generate` function + protobuf_config_cmake = os.path.join(self.source_folder, "cmake", "protobuf-config.cmake.in") + replace_in_file(self, protobuf_config_cmake, "@_protobuf_FIND_ZLIB@", "") + replace_in_file(self, protobuf_config_cmake, + "include(\"${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake\")", + "" + ) # Disable a potential warning in protobuf-module.cmake.in # TODO: remove this patch? Is it really useful? @@ -171,13 +196,6 @@ def _patch_sources(self): "endif()", ) - # https://github.com/protocolbuffers/protobuf/issues/9916 - # it will be solved in protobuf 3.21.0 - if Version(self.version) == "3.20.0": - replace_in_file(self, os.path.join(self.source_folder, "src", "google", "protobuf", "port_def.inc"), - "#elif PROTOBUF_GNUC_MIN(12, 0)", - "#elif PROTOBUF_GNUC_MIN(12, 2)") - def build(self): self._patch_sources() cmake = CMake(self) @@ -190,11 +208,15 @@ def package(self): cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - os.unlink(os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config-version.cmake")) - os.unlink(os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-targets.cmake")) - os.unlink(os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-targets-{}.cmake".format(str(self.settings.build_type).lower()))) - rename(self, os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config.cmake"), - os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-generate.cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", "utf8_range")) + if self._protobuf_release < "22.0": + rename(self, os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config.cmake"), + os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-generate.cmake")) + + cmake_config_folder = os.path.join(self.package_folder, self._cmake_install_base_path) + rm(self, "protobuf-config*.cmake", folder=cmake_config_folder) + rm(self, "protobuf-targets*.cmake", folder=cmake_config_folder) + copy(self, "protobuf-conan-protoc-target.cmake", src=self.source_folder, dst=cmake_config_folder) if not self.options.lite: rm(self, "libprotobuf-lite*", os.path.join(self.package_folder, "lib")) @@ -210,12 +232,37 @@ def package_info(self): os.path.join(self._cmake_install_base_path, "protobuf-generate.cmake"), os.path.join(self._cmake_install_base_path, "protobuf-module.cmake"), os.path.join(self._cmake_install_base_path, "protobuf-options.cmake"), + os.path.join(self._cmake_install_base_path, "protobuf-conan-protoc-target.cmake"), ] self.cpp_info.set_property("cmake_build_modules", build_modules) lib_prefix = "lib" if (is_msvc(self) or self._is_clang_cl) else "" lib_suffix = "d" if self.settings.build_type == "Debug" and self.options.debug_suffix else "" + if self._protobuf_release >= "22.0": + absl_deps = [f"abseil::{c}" for c in self.conan_data["absl_deps"][self.version]] + + if self._protobuf_release >= "22.0" and (not self.options.shared or self.options.get_safe("upb")): + # utf8 libraries + # it's a private dependency and unconditionally built as a static library, should only + # be exposed when protobuf itself is static (or if upb is being built) + self.cpp_info.components["utf8_range"].set_property("cmake_target_name", "utf8_range::utf8_range") + self.cpp_info.components["utf8_validity"].set_property("cmake_target_name", "utf8_range::utf8_validity") + # https://github.com/protocolbuffers/protobuf/blob/0d815c5b74281f081c1ee4b431a4d5bbb1615c97/third_party/utf8_range/CMakeLists.txt#L24 + if self._protobuf_release >= "30.1" and self.settings.os == "Windows": + self.cpp_info.components["utf8_range"].libs = ["libutf8_range"] + self.cpp_info.components["utf8_validity"].libs = ["libutf8_validity"] + else: + self.cpp_info.components["utf8_range"].libs = ["utf8_range"] + self.cpp_info.components["utf8_validity"].libs = ["utf8_validity"] + self.cpp_info.components["utf8_validity"].requires = ["abseil::absl_strings"] + + if self.options.get_safe("upb"): + # upb libraries: note that these are unconditionally static + self.cpp_info.components["upb"].set_property("cmake_target_name", "protobuf::libupb") + self.cpp_info.components["upb"].libs = [lib_prefix + "upb" + lib_suffix] + self.cpp_info.components["upb"].requires = ["utf8_range"] + # libprotobuf self.cpp_info.components["libprotobuf"].set_property("cmake_target_name", "protobuf::libprotobuf") self.cpp_info.components["libprotobuf"].set_property("pkg_config_name", "protobuf") @@ -223,6 +270,11 @@ def package_info(self): self.cpp_info.components["libprotobuf"].libs = [lib_prefix + "protobuf" + lib_suffix] if self.options.with_zlib: self.cpp_info.components["libprotobuf"].requires = ["zlib::zlib"] + if self._protobuf_release >= "22.0": + self.cpp_info.components["libprotobuf"].requires.extend(absl_deps) + if not self.options.shared: + self.cpp_info.components["libprotobuf"].requires.extend(["utf8_validity"]) + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libprotobuf"].system_libs.extend(["m", "pthread"]) if self._is_clang_x86 or "arm" in str(self.settings.arch): @@ -238,6 +290,8 @@ def package_info(self): self.cpp_info.components["libprotoc"].set_property("cmake_target_name", "protobuf::libprotoc") self.cpp_info.components["libprotoc"].libs = [lib_prefix + "protoc" + lib_suffix] self.cpp_info.components["libprotoc"].requires = ["libprotobuf"] + if self._protobuf_release >= "22.0": + self.cpp_info.components["libprotoc"].requires.extend(absl_deps) # libprotobuf-lite if self.options.lite: @@ -254,6 +308,10 @@ def package_info(self): self.cpp_info.components["libprotobuf-lite"].defines = ["PROTOBUF_USE_DLLS"] if self.settings.os == "Android": self.cpp_info.components["libprotobuf-lite"].system_libs.append("log") + if self._protobuf_release >= "22.0": + self.cpp_info.components["libprotobuf-lite"].requires.extend(absl_deps) + if not self.options.shared: + self.cpp_info.components["libprotobuf-lite"].requires.extend(["utf8_validity"]) # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed self.cpp_info.filenames["cmake_find_package"] = "Protobuf" diff --git a/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.17.1-upstream-macos-macros.patch deleted file mode 100644 index d8f8f14a25361..0000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.17.1-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 61f0859..d673519 100644 ---- a/src/google/protobuf/port_def.inc -+++ b/src/google/protobuf/port_def.inc -@@ -616,6 +616,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 82fe794..dfbbf5b 100644 ---- a/src/google/protobuf/port_undef.inc -+++ b/src/google/protobuf/port_undef.inc -@@ -112,6 +112,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.18.1-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.18.1-upstream-macos-macros.patch deleted file mode 100644 index 4825966e01d9d..0000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.18.1-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 01384c8..8f8a44d 100644 ---- a/src/google/protobuf/port_def.inc -+++ b/src/google/protobuf/port_def.inc -@@ -736,6 +736,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 5fef6e4..9efd5d6 100644 ---- a/src/google/protobuf/port_undef.inc -+++ b/src/google/protobuf/port_undef.inc -@@ -128,6 +128,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.19.6-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.19.6-upstream-macos-macros.patch deleted file mode 100644 index 5aadd2a257043..0000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.19.6-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 30af1cf..4ddf5dc 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.9-upstream-macos-macros.patch b/recipes/protobuf/all/patches/protobuf-3.21.9-upstream-macos-macros.patch deleted file mode 100644 index 3a152f62bca69..0000000000000 --- a/recipes/protobuf/all/patches/protobuf-3.21.9-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 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/upstream-pr-9437-msvc-runtime.patch b/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch deleted file mode 100644 index 06cb0a97681d1..0000000000000 --- a/recipes/protobuf/all/patches/upstream-pr-9437-msvc-runtime.patch +++ /dev/null @@ -1,17 +0,0 @@ -Fix from Protobuf PR: https://github.com/protocolbuffers/protobuf/pull/9437 - ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -182,7 +182,11 @@ 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>) -+ else() -+ set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>DLL) -+ 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/protobuf-conan-protoc-target.cmake b/recipes/protobuf/all/protobuf-conan-protoc-target.cmake new file mode 100644 index 0000000000000..6165d8f1b731b --- /dev/null +++ b/recipes/protobuf/all/protobuf-conan-protoc-target.cmake @@ -0,0 +1,25 @@ +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 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}/../../../bin/protoc${CMAKE_EXECUTABLE_SUFFIX}") + 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() diff --git a/recipes/protobuf/all/test_package/CMakeLists.txt b/recipes/protobuf/all/test_package/CMakeLists.txt index a5240f3215abb..e8254a31a1247 100644 --- a/recipes/protobuf/all/test_package/CMakeLists.txt +++ b/recipes/protobuf/all/test_package/CMakeLists.txt @@ -4,18 +4,25 @@ project(test_package LANGUAGES CXX) find_package(protobuf CONFIG REQUIRED) -add_executable(${PROJECT_NAME} test_package.cpp addressbook.proto) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") +add_executable(${PROJECT_NAME} test_package.cpp) + +if(CONAN_TEST_USE_CXXSTD_14) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() + if (protobuf_LITE) target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf-lite) + target_compile_definitions(${PROJECT_NAME} PRIVATE CONANTEST_PROTOBUF_LITE=1) else() target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf) endif() -if(TARGET protobuf::libprotoc) - target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotoc) +if(NOT TARGET protobuf::protoc) + message(FATAL_ERROR "protoc executable should have been defined as part of find_package(protobuf)") endif() -protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS TARGET ${PROJECT_NAME}) -protobuf_generate(LANGUAGE cpp TARGET ${PROJECT_NAME} PROTOS addressbook.proto) +if(NOT COMMAND protobuf_generate) + message(FATAL_ERROR "protobuf_generate should have been defined as part of find_package(protobuf)") +endif() diff --git a/recipes/protobuf/all/test_package/conanfile.py b/recipes/protobuf/all/test_package/conanfile.py index 81404c86104a8..880d1f9d7d72e 100644 --- a/recipes/protobuf/all/test_package/conanfile.py +++ b/recipes/protobuf/all/test_package/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.scm import Version import os @@ -13,14 +14,14 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - self.tool_requires(self.tested_reference_str) + # note `run=True` so that the runenv can find protoc + self.requires(self.tested_reference_str, run=True) def generate(self): tc = CMakeToolchain(self) tc.cache_variables["protobuf_LITE"] = self.dependencies[self.tested_reference_str].options.lite + protobuf_version = Version(self.dependencies[self.tested_reference_str].ref.version) + tc.cache_variables["CONAN_TEST_USE_CXXSTD_14"] = protobuf_version >= "3.22" tc.generate() def build(self): @@ -32,3 +33,8 @@ 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") + + # Invoke protoc in the same way CMake would + self.run(f"protoc --proto_path={self.source_folder} --cpp_out={self.build_folder} {self.source_folder}/addressbook.proto", env="conanrun") + assert os.path.exists(os.path.join(self.build_folder,"addressbook.pb.cc")) + assert os.path.exists(os.path.join(self.build_folder,"addressbook.pb.h")) diff --git a/recipes/protobuf/all/test_package/test_package.cpp b/recipes/protobuf/all/test_package/test_package.cpp index aee0c47205eed..292260cccf5c4 100644 --- a/recipes/protobuf/all/test_package/test_package.cpp +++ b/recipes/protobuf/all/test_package/test_package.cpp @@ -1,17 +1,23 @@ #include #include -#include "addressbook.pb.h" +#if !defined(CONANTEST_PROTOBUF_LITE) +#include +#include +#else +#include +#endif int main() { - std::cout << "Bincrafters\n"; - tutorial::Person p; - p.set_id(21); - p.set_name("conan-center-index"); - p.set_email("info@conan.io"); - - std::cout << p.SerializeAsString() << "\n"; +#if !defined(CONANTEST_PROTOBUF_LITE) + google::protobuf::Timestamp ts; + google::protobuf::util::TimeUtil::FromString("1972-01-01T10:00:20.021Z", &ts); + const auto nanoseconds = ts.nanos(); + std::cout << "1972-01-01T10:00:20.021Z in nanoseconds: " << nanoseconds << "\n"; +#else + google::protobuf::ShutdownProtobufLibrary(); +#endif return EXIT_SUCCESS; } diff --git a/recipes/protobuf/all/test_v1_package/CMakeLists.txt b/recipes/protobuf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f16bc97992e86..0000000000000 --- a/recipes/protobuf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_v1_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/protobuf/all/test_v1_package/conanfile.py b/recipes/protobuf/all/test_v1_package/conanfile.py deleted file mode 100644 index f31e33d3b0ff4..0000000000000 --- a/recipes/protobuf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +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" - test_type = "explicit" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(self.tested_reference_str) - - def build(self): - with tools.no_op() if hasattr(self, "settings_build") else tools.run_environment(self): - cmake = CMake(self) - cmake.definitions["protobuf_LITE"] = self.options["protobuf"].lite - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - self.run("protoc --version", run_environment=True) - self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/protobuf/config.yml b/recipes/protobuf/config.yml index 89750d93410cc..efb4278c97df2 100644 --- a/recipes/protobuf/config.yml +++ b/recipes/protobuf/config.yml @@ -1,15 +1,15 @@ versions: - "3.21.12": + "6.30.1": folder: all - "3.21.9": + "5.29.3": folder: all - "3.20.3": + "5.28.3": folder: all - "3.20.0": + "5.27.0": folder: all - "3.19.6": + "4.25.3": folder: all - "3.18.3": + "3.21.12": folder: all - "3.17.1": + "3.20.3": folder: all diff --git a/recipes/protopuf/all/conandata.yml b/recipes/protopuf/all/conandata.yml index e3a4a402d6c55..70e206483f82b 100644 --- a/recipes/protopuf/all/conandata.yml +++ b/recipes/protopuf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.0": + url: "https://github.com/PragmaTwice/protopuf/archive/v3.0.0.tar.gz" + sha256: "62f89b78989eb054bc52e80cc1517274f5621e32eda4758f123c66c7a3521ee3" "2.2.1": url: "https://github.com/PragmaTwice/protopuf/archive/v2.2.1.tar.gz" sha256: "8d4940206d8e8664f75ae1cdfff8c14fa9a196c03967d520725284429744c19c" diff --git a/recipes/protopuf/all/test_package/CMakeLists.txt b/recipes/protopuf/all/test_package/CMakeLists.txt index c049a9a330ddf..be25eae554eb8 100644 --- a/recipes/protopuf/all/test_package/CMakeLists.txt +++ b/recipes/protopuf/all/test_package/CMakeLists.txt @@ -1,9 +1,11 @@ -cmake_minimum_required(VERSION 3.12) - -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(protopuf REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE protopuf::protopuf) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +if(protopuf_VERSION VERSION_LESS 3.0.0) + target_compile_definitions(${PROJECT_NAME} PRIVATE PROTOPUF_V2) +endif() diff --git a/recipes/protopuf/all/test_package/test_package.cpp b/recipes/protopuf/all/test_package/test_package.cpp index 4204c6dc97e2a..e97fde64ca1d2 100644 --- a/recipes/protopuf/all/test_package/test_package.cpp +++ b/recipes/protopuf/all/test_package/test_package.cpp @@ -6,12 +6,12 @@ using namespace pp; using namespace std; using Student = message< - uint32_field<"id", 1>, + uint32_field<"id", 1>, string_field<"name", 3> >; using Class = message< - string_field<"name", 8>, + string_field<"name", 8>, message_field<"students", 3, Student, repeated> >; @@ -25,8 +25,12 @@ int main() { auto bufferEnd = message_coder::encode(myClass, buffer); // deserialization +#ifdef PROTOPUF_V2 auto [yourClass, bufferEnd2] = message_coder::decode(buffer); - +#else + auto result = message_coder::decode(buffer); + auto [yourClass, bufferEnd2] = *result; +#endif return 0; } diff --git a/recipes/protopuf/all/test_v1_package/CMakeLists.txt b/recipes/protopuf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 4bda6274e3037..0000000000000 --- a/recipes/protopuf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.12) - -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(protopuf REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE protopuf::protopuf) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/protopuf/all/test_v1_package/conanfile.py b/recipes/protopuf/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/protopuf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/protopuf/config.yml b/recipes/protopuf/config.yml index 346088b2bbe5f..3a574582d8d34 100644 --- a/recipes/protopuf/config.yml +++ b/recipes/protopuf/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.0": + folder: all "2.2.1": folder: all "2.2.0": diff --git a/recipes/protozero/all/test_package/CMakeLists.txt b/recipes/protozero/all/test_package/CMakeLists.txt index 8a60635cc715c..245ef07c27a3b 100644 --- a/recipes/protozero/all/test_package/CMakeLists.txt +++ b/recipes/protozero/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(protozero REQUIRED CONFIG) diff --git a/recipes/protozero/all/test_v1_package/CMakeLists.txt b/recipes/protozero/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c2f5bc742311b..0000000000000 --- a/recipes/protozero/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(protozero REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE protozero::protozero) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/protozero/all/test_v1_package/conanfile.py b/recipes/protozero/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/protozero/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_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/proxy/all/conandata.yml b/recipes/proxy/all/conandata.yml new file mode 100644 index 0000000000000..049331d97fed2 --- /dev/null +++ b/recipes/proxy/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "3.3.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/3.3.0.tar.gz" + sha256: "9a5e89e70082cbdd937e80f5113f4ceb47bf6361cf7b88cb52782906a1b655cc" + "3.2.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/3.2.0.tar.gz" + sha256: "a828432a43a1e05c65176e58b48a6d6270669862adb437a069693f346275b5f0" + "3.1.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/3.1.0.tar.gz" + sha256: "c86ed7767ed3e90250632f2b5269c83225b0ae986314c58596d421b245f26cd1" + "3.0.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/3.0.0.tar.gz" + sha256: "7e073e217e5572bc4c17ed5893273c80ea34c87e1406c853beeb9ca9bdda9733" + "2.4.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.4.0.tar.gz" + sha256: "7eed973655938d681a90dcc0c200e6cc1330ea8611a9c1a9e1b30439514443cb" + "2.3.2": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.3.2.tar.gz" + sha256: "d592f70b82a452dc9834ac3a953039d4b0136eefc023503d37879aba5ced369f" + "2.3.1": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.3.1.tar.gz" + sha256: "bfec45ada9cd3dc576df34bbe877c5d03a81906a00759970c0197c3fa041c5c7" + "2.3.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.3.0.tar.gz" + sha256: "ff6f17c5360895776d29ce2b1235de7b42912468b52729810506431e352a78d0" + "2.2.1": + url: "https://github.com/microsoft/proxy/archive/refs/tags/2.2.1.tar.gz" + sha256: "096f0b2d793dffc54d41def2bca0ced594b6b8efe35ac5ae27db35802e742b96" diff --git a/recipes/proxy/all/conanfile.py b/recipes/proxy/all/conanfile.py new file mode 100644 index 0000000000000..27bd44c911dd0 --- /dev/null +++ b/recipes/proxy/all/conanfile.py @@ -0,0 +1,62 @@ +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 = ">=2.1" + + +class ProxyConan(ConanFile): + name = "proxy" + description = "Proxy: Next Generation Polymorphism in C++" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/microsoft/proxy" + topics = ("runtime-polymorphism", "polymorphism", "duck-typing", "metaprogramming", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _compilers_minimum_version(self): + """ Actual compiler support based on upstream's README.md """ + return { + # proxy/2.3.0 has an internal compilation error on gcc 11. + "gcc": "11" if Version(self.version) < "2.3.0" else "12", + "clang": "15", + "apple-clang": "14", + "msvc": "193", + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def validate(self): + check_min_cppstd(self, 20) + 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 at least {self.settings.compiler} {minimum_version}" + ) + + 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, "proxy.h", self.source_folder, os.path.join(self.package_folder, "include", "proxy")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "proxy") + self.cpp_info.set_property("cmake_target_name", "msft_proxy") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/proxy/all/test_package/CMakeLists.txt b/recipes/proxy/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6ed6216423b01 --- /dev/null +++ b/recipes/proxy/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(proxy REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE msft_proxy) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +if(proxy_VERSION VERSION_GREATER_EQUAL "3.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE PROXY_VERSION_3_LATER) +endif() diff --git a/recipes/proxy/all/test_package/conanfile.py b/recipes/proxy/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/proxy/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/proxy/all/test_package/test_package.cpp b/recipes/proxy/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..4700fd6cd057e --- /dev/null +++ b/recipes/proxy/all/test_package/test_package.cpp @@ -0,0 +1,71 @@ +// https://github.com/microsoft/proxy/blob/2.1.0/samples/resource_dictionary/main.cpp +// Copyright (c) Microsoft Corporation. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE + +#include + +#include +#include +#include +#include + +#ifdef PROXY_VERSION_3_LATER + +PRO_DEF_MEM_DISPATCH(MemAt, at); + +struct Dictionary : pro::facade_builder + ::add_convention + ::build {}; + +// This is a function, rather than a function template +void demo_print(pro::proxy dictionary) { + std::cout << dictionary->at(1) << "\n"; +} + +int main() { + static std::map container1{{1, "hello"}}; + auto container2 = std::make_shared>(); + container2->push_back("hello"); + container2->push_back("world"); + demo_print(&container1); // Prints: "hello" + demo_print(container2); // Prints: "world" +} + +#else + +namespace poly { + +PRO_DEF_MEMBER_DISPATCH(at, std::string(int)); +PRO_DEF_FACADE(Dictionary, at); + +} // namespace poly + +void demo_print(pro::proxy dictionary) { + std::cout << dictionary(1) << std::endl; +} + +int main() { + std::map container1{{1, "hello"}}; + std::vector container2{"hello", "world"}; + demo_print(&container1); // print: hello\n + demo_print(&container2); // print: world\n + return 0; +} +#endif diff --git a/recipes/proxy/config.yml b/recipes/proxy/config.yml new file mode 100644 index 0000000000000..1b4357a4360f8 --- /dev/null +++ b/recipes/proxy/config.yml @@ -0,0 +1,19 @@ +versions: + "3.3.0": + folder: all + "3.2.0": + folder: all + "3.1.0": + folder: all + "3.0.0": + folder: all + "2.4.0": + folder: all + "2.3.2": + folder: all + "2.3.1": + folder: all + "2.3.0": + folder: all + "2.2.1": + folder: all diff --git a/recipes/psimd/all/test_package/CMakeLists.txt b/recipes/psimd/all/test_package/CMakeLists.txt index 05b88bb3a3986..746d6a747e936 100644 --- a/recipes/psimd/all/test_package/CMakeLists.txt +++ b/recipes/psimd/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(psimd REQUIRED CONFIG) diff --git a/recipes/psimd/all/test_v1_package/CMakeLists.txt b/recipes/psimd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index e8cb47d9d69b7..0000000000000 --- a/recipes/psimd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(psimd REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE psimd::psimd) diff --git a/recipes/psimd/all/test_v1_package/conanfile.py b/recipes/psimd/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/psimd/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_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/psyinf-gmtl/all/test_package/CMakeLists.txt b/recipes/psyinf-gmtl/all/test_package/CMakeLists.txt index 5bb1ba95fb7cc..352ff51a61654 100644 --- a/recipes/psyinf-gmtl/all/test_package/CMakeLists.txt +++ b/recipes/psyinf-gmtl/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) diff --git a/recipes/psyinf-gmtl/all/test_v1_package/CMakeLists.txt b/recipes/psyinf-gmtl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index de05e55dc1517..0000000000000 --- a/recipes/psyinf-gmtl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(gmtl REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE gmtl::gmtl) diff --git a/recipes/psyinf-gmtl/all/test_v1_package/conanfile.py b/recipes/psyinf-gmtl/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/psyinf-gmtl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/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 48fcf6593c820..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" @@ -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/all/test_package/CMakeLists.txt b/recipes/ptex/all/test_package/CMakeLists.txt index 9028e1867020b..b821337811511 100644 --- a/recipes/ptex/all/test_package/CMakeLists.txt +++ b/recipes/ptex/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(ptex REQUIRED CONFIG) diff --git a/recipes/ptex/all/test_v1_package/CMakeLists.txt b/recipes/ptex/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/ptex/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/ptex/all/test_v1_package/conanfile.py b/recipes/ptex/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ptex/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_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/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/pthreadpool/all/CMakeLists.txt b/recipes/pthreadpool/all/CMakeLists.txt index 4a9151537d740..b3d5952bedba8 100644 --- a/recipes/pthreadpool/all/CMakeLists.txt +++ b/recipes/pthreadpool/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) find_package(fxdiv REQUIRED CONFIG) diff --git a/recipes/pthreadpool/all/conandata.yml b/recipes/pthreadpool/all/conandata.yml index 4a1b5d58d8c57..5b276e0fd5b93 100644 --- a/recipes/pthreadpool/all/conandata.yml +++ b/recipes/pthreadpool/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231129": + url: "https://github.com/Maratyszcza/pthreadpool/archive/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip" + sha256: "a4cf06de57bfdf8d7b537c61f1c3071bce74e57524fe053e0bbd2332feca7f95" "cci.20210218": url: "https://github.com/Maratyszcza/pthreadpool/archive/b4589998be9a0f794236cf46f1b5b232b2b15ca3.zip" sha256: "b09f79d1b609239861bce5ed4ba4fbcf04f36e2c31471276158c44e5e15fde95" diff --git a/recipes/pthreadpool/all/test_package/CMakeLists.txt b/recipes/pthreadpool/all/test_package/CMakeLists.txt index 722ec454f1c79..869efaaad0848 100644 --- a/recipes/pthreadpool/all/test_package/CMakeLists.txt +++ b/recipes/pthreadpool/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 C) find_package(pthreadpool REQUIRED CONFIG) diff --git a/recipes/pthreadpool/all/test_v1_package/CMakeLists.txt b/recipes/pthreadpool/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/pthreadpool/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pthreadpool/all/test_v1_package/conanfile.py b/recipes/pthreadpool/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/pthreadpool/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_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/pthreadpool/config.yml b/recipes/pthreadpool/config.yml index 888d588d579dc..cb37cf1973096 100644 --- a/recipes/pthreadpool/config.yml +++ b/recipes/pthreadpool/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20231129": + folder: all "cci.20210218": folder: all diff --git a/recipes/pthreads4w/all/test_v1_package/CMakeLists.txt b/recipes/pthreads4w/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 993b1d536d435..0000000000000 --- a/recipes/pthreads4w/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/pthreads4w/all/test_v1_package/conanfile.py b/recipes/pthreads4w/all/test_v1_package/conanfile.py deleted file mode 100644 index d4128b0450777..0000000000000 --- a/recipes/pthreads4w/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", "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): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/pugixml/all/conandata.yml b/recipes/pugixml/all/conandata.yml index cfdd629e0abb2..4d5349c29b0dc 100644 --- a/recipes/pugixml/all/conandata.yml +++ b/recipes/pugixml/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.15": + url: "https://github.com/zeux/pugixml/releases/download/v1.15/pugixml-1.15.tar.gz" + sha256: "655ade57fa703fb421c2eb9a0113b5064bddb145d415dd1f88c79353d90d511a" "1.14": url: "https://github.com/zeux/pugixml/releases/download/v1.14/pugixml-1.14.tar.gz" sha256: "2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015" diff --git a/recipes/pugixml/all/test_v1_package/CMakeLists.txt b/recipes/pugixml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/pugixml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pugixml/all/test_v1_package/conanfile.py b/recipes/pugixml/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/pugixml/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_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/pugixml/config.yml b/recipes/pugixml/config.yml index 384412d36091f..b3c3da49fe4fc 100644 --- a/recipes/pugixml/config.yml +++ b/recipes/pugixml/config.yml @@ -1,4 +1,6 @@ versions: + "1.15": + folder: "all" "1.14": folder: "all" "1.13": diff --git a/recipes/pulseaudio/all/conanfile.py b/recipes/pulseaudio/all/conanfile.py index 1a469fa5694df..002d47cbedf08 100644 --- a/recipes/pulseaudio/all/conanfile.py +++ b/recipes/pulseaudio/all/conanfile.py @@ -1,3 +1,5 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building @@ -5,7 +7,6 @@ from conan.tools.files import copy, get, rm, rmdir from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout -import os required_conan_version = ">=1.53.0" @@ -64,7 +65,7 @@ def requirements(self): if self.options.with_alsa: self.requires("libalsa/1.2.10") if self.options.with_glib: - self.requires("glib/2.78.1") + self.requires("glib/2.78.3") if self.options.get_safe("with_fftw"): self.requires("fftw/3.3.10") if self.options.with_x11: @@ -89,7 +90,7 @@ 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/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -111,6 +112,10 @@ def generate(self): "--with-udev-rules-dir=${prefix}/bin/udev/rules.d", f"--with-systemduserunitdir={os.path.join(self.build_folder, 'ignore')}", ]) + # Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268250 + # clang-15 works, but we need to skip the gnu11 flag check + if self.settings.compiler == "clang" and self.settings.compiler.version == 15: + tc.configure_args.append("ax_cv_check_cflags__pedantic__Werror__std_gnu11=yes") for lib in ["alsa", "x11", "openssl", "dbus"]: tc.configure_args.append(f"--enable-{lib}={yes_no(getattr(self.options, f'with_{lib}'))}") # TODO: to remove when automatically handled by AutotoolsToolchain @@ -146,7 +151,7 @@ def package_info(self): if self.options.get_safe("with_fftw"): self.cpp_info.components["pulse"].requires.append("fftw::fftw") if self.options.with_x11: - self.cpp_info.components["pulse"].requires.append("xorg::xorg") + self.cpp_info.components["pulse"].requires.extend(["xorg::x11", "xorg::x11-xcb"]) if self.options.with_openssl: self.cpp_info.components["pulse"].requires.append("openssl::openssl") if self.options.with_dbus: diff --git a/recipes/pulseaudio/all/test_package/CMakeLists.txt b/recipes/pulseaudio/all/test_package/CMakeLists.txt index a9b88d597549a..aad7a66743674 100644 --- a/recipes/pulseaudio/all/test_package/CMakeLists.txt +++ b/recipes/pulseaudio/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(pulseaudio REQUIRED CONFIG) diff --git a/recipes/pulseaudio/all/test_v1_package/CMakeLists.txt b/recipes/pulseaudio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/pulseaudio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pulseaudio/all/test_v1_package/conanfile.py b/recipes/pulseaudio/all/test_v1_package/conanfile.py deleted file mode 100644 index a691174f8ed16..0000000000000 --- a/recipes/pulseaudio/all/test_v1_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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - diff --git a/recipes/pulseaudio/config.yml b/recipes/pulseaudio/config.yml index 4aaa9c6cc7082..6c0f518e5ed25 100644 --- a/recipes/pulseaudio/config.yml +++ b/recipes/pulseaudio/config.yml @@ -1,4 +1,6 @@ versions: + "17.0": + folder: meson "14.2": folder: all "14.0": diff --git a/recipes/pulseaudio/meson/conandata.yml b/recipes/pulseaudio/meson/conandata.yml new file mode 100644 index 0000000000000..3380326dc7539 --- /dev/null +++ b/recipes/pulseaudio/meson/conandata.yml @@ -0,0 +1,4 @@ +sources: + "17.0": + url: "https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-17.0.tar.xz" + sha256: "053794d6671a3e397d849e478a80b82a63cb9d8ca296bd35b73317bb5ceb87b5" diff --git a/recipes/pulseaudio/meson/conanfile.py b/recipes/pulseaudio/meson/conanfile.py new file mode 100644 index 0000000000000..470080481b438 --- /dev/null +++ b/recipes/pulseaudio/meson/conanfile.py @@ -0,0 +1,148 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class PulseAudioConan(ConanFile): + name = "pulseaudio" + description = "PulseAudio is a sound system for POSIX OSes, meaning that it is a proxy for sound applications." + topics = ("sound", "audio", "sound-server") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://pulseaudio.org/" + license = "LGPL-2.1" + + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "with_glib": [True, False], + "with_fftw": [True, False], + "with_x11": [True, False], + "with_openssl": [True, False], + "with_dbus": [True, False], + } + default_options = { + "with_glib": False, + "with_fftw": False, + "with_x11": True, + "with_openssl": True, + "with_dbus": False, + } + + def config_options(self): + if self.settings.os not in ['Linux', 'FreeBSD']: + del self.options.with_x11 + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if not self.options.with_dbus: + del self.options.with_fftw + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("libgettext/0.22") + self.requires("libiconv/1.17") + self.requires("libsndfile/1.2.2") + if self.options.with_glib: + self.requires("glib/2.78.1") + if self.options.get_safe("with_fftw"): + self.requires("fftw/3.3.10") + if self.options.get_safe("with_x11"): + self.requires("xorg/system") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_dbus: + self.requires("dbus/1.15.8") + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration(f"{self.ref} recipe is only compatible with Linux right now. Contributions are welcome.") + + if self.options.get_safe("with_fftw"): + if not self.dependencies["fftw"].options.precision_single: + raise ConanInvalidConfiguration( + "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("m4/1.4.19") + self.tool_requires("meson/1.3.2") + 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() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = MesonToolchain(self) + tc.project_options['udevrulesdir']="${prefix}/bin/udev/rules.d" + tc.project_options['systemduserunitdir'] = os.path.join(self.build_folder, 'ignore') + for lib in ["x11", "openssl", "dbus", "glib", "fftw"]: + tc.project_options[lib] = "enabled" if self.options.get_safe(f"with_{lib}") else "disabled" + tc.project_options['database'] = 'simple' + tc.project_options['tests'] = False + tc.project_options['man'] = False + tc.project_options['doxygen'] = False + tc.project_options["daemon"] = False + tc.generate() + pkg = PkgConfigDeps(self) + pkg.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "etc")) + 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")) + rm(self, "*.la", os.path.join(self.package_folder, "lib"), recursive=True) + + def package_info(self): + self.cpp_info.components["pulse"].set_property("pkg_config_name", "libpulse") + self.cpp_info.components["pulse"].libs = ["pulse", f"pulsecommon-{self.version}"] + self.cpp_info.components["pulse"].libdirs.append(os.path.join("lib", "pulseaudio")) + self.cpp_info.components["pulse"].requires = ["libiconv::libiconv", "libsndfile::libsndfile", "libgettext::libgettext"] + if self.options.get_safe("with_fftw"): + self.cpp_info.components["pulse"].requires.append("fftw::fftw") + if self.options.get_safe("with_x11"): + self.cpp_info.components["pulse"].requires.append("xorg::xorg") + if self.options.with_openssl: + self.cpp_info.components["pulse"].requires.append("openssl::openssl") + if self.options.with_dbus: + self.cpp_info.components["pulse"].requires.append("dbus::dbus") + + self.cpp_info.components["pulse-simple"].set_property("pkg_config_name", "libpulse-simple") + self.cpp_info.components["pulse-simple"].libs = ["pulse-simple"] + self.cpp_info.components["pulse-simple"].defines.append("_REENTRANT") + self.cpp_info.components["pulse-simple"].requires = ["pulse"] + + if self.options.with_glib: + self.cpp_info.components["pulse-mainloop-glib"].set_property("pkg_config_name", "libpulse-mainloop-glib") + self.cpp_info.components["pulse-mainloop-glib"].libs = ["pulse-mainloop-glib"] + self.cpp_info.components["pulse-mainloop-glib"].defines.append("_REENTRANT") + self.cpp_info.components["pulse-mainloop-glib"].requires = ["pulse", "glib::glib-2.0"] + + # FIXME: add cmake generators when conan can generate PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY vars diff --git a/recipes/pulseaudio/meson/test_package/CMakeLists.txt b/recipes/pulseaudio/meson/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..aad7a66743674 --- /dev/null +++ b/recipes/pulseaudio/meson/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(pulseaudio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE pulseaudio::pulseaudio) diff --git a/recipes/pulseaudio/meson/test_package/conanfile.py b/recipes/pulseaudio/meson/test_package/conanfile.py new file mode 100644 index 0000000000000..8a5bb47f50c4c --- /dev/null +++ b/recipes/pulseaudio/meson/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/pulseaudio/meson/test_package/test_package.c b/recipes/pulseaudio/meson/test_package/test_package.c new file mode 100644 index 0000000000000..bb944137b6045 --- /dev/null +++ b/recipes/pulseaudio/meson/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + printf("pulse audio verions %s\n", pa_get_library_version()); + return 0; +} diff --git a/recipes/pupnp/all/test_v1_package/CMakeLists.txt b/recipes/pupnp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/pupnp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index b1255b47b830e..0000000000000 --- a/recipes/pupnp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/pybind11/all/conandata.yml b/recipes/pybind11/all/conandata.yml index 62adb5a253c62..5901aae7c96f6 100644 --- a/recipes/pybind11/all/conandata.yml +++ b/recipes/pybind11/all/conandata.yml @@ -1,25 +1,43 @@ sources: - 2.7.1: - url: "https://github.com/pybind/pybind11/archive/v2.7.1.tar.gz" - sha256: "616d1c42e4cf14fa27b2a4ff759d7d7b33006fdc5ad8fd603bb2c22622f27020" - 2.8.1: - url: "https://github.com/pybind/pybind11/archive/v2.8.1.tar.gz" - sha256: "f1bcc07caa568eb312411dde5308b1e250bd0e1bc020fae855bf9f43209940cc" - 2.9.1: - url: "https://github.com/pybind/pybind11/archive/v2.9.1.tar.gz" - sha256: "c6160321dc98e6e1184cc791fbeadd2907bb4a0ce0e447f2ea4ff8ab56550913" - 2.9.2: - url: "https://github.com/pybind/pybind11/archive/v2.9.2.tar.gz" - sha256: "6bd528c4dbe2276635dc787b6b1f2e5316cf6b49ee3e150264e455a0d68d19c1" + "2.13.6": + url: "https://github.com/pybind/pybind11/archive/v2.13.6.tar.gz" + sha256: "e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20" + "2.13.5": + url: "https://github.com/pybind/pybind11/archive/v2.13.5.tar.gz" + sha256: "b1e209c42b3a9ed74da3e0b25a4f4cd478d89d5efbb48f04b277df427faf6252" + "2.13.4": + url: "https://github.com/pybind/pybind11/archive/v2.13.4.tar.gz" + sha256: "efc901aa0aab439a3fea6efeaf930b5a349fb06394bf845c64ce15a9cf8f0240" + "2.13.2": + url: "https://github.com/pybind/pybind11/archive/v2.13.2.tar.gz" + sha256: "50eebef369d28f07ce1fe1797f38149e5928817be8e539239f2aadfd95b227f3" + "2.13.1": + url: "https://github.com/pybind/pybind11/archive/v2.13.1.tar.gz" + sha256: "51631e88960a8856f9c497027f55c9f2f9115cafb08c0005439838a05ba17bfc" + "2.12.0": + url: "https://github.com/pybind/pybind11/archive/v2.12.0.tar.gz" + sha256: "bf8f242abd1abcd375d516a7067490fb71abd79519a282d22b6e4d19282185a7" + "2.11.1": + url: "https://github.com/pybind/pybind11/archive/v2.11.1.tar.gz" + sha256: "d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c" + "2.10.4": + url: "https://github.com/pybind/pybind11/archive/v2.10.4.tar.gz" + sha256: "832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970" + "2.10.1": + url: "https://github.com/pybind/pybind11/archive/v2.10.1.tar.gz" + sha256: "111014b516b625083bef701df7880f78c2243835abdb263065b6b59b960b6bad" "2.10.0": url: "https://github.com/pybind/pybind11/archive/v2.10.0.tar.gz" sha256: "eacf582fa8f696227988d08cfc46121770823839fe9e301a20fbce67e7cd70ec" - 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" + "2.9.2": + url: "https://github.com/pybind/pybind11/archive/v2.9.2.tar.gz" + sha256: "6bd528c4dbe2276635dc787b6b1f2e5316cf6b49ee3e150264e455a0d68d19c1" + "2.9.1": + url: "https://github.com/pybind/pybind11/archive/v2.9.1.tar.gz" + sha256: "c6160321dc98e6e1184cc791fbeadd2907bb4a0ce0e447f2ea4ff8ab56550913" + "2.8.1": + url: "https://github.com/pybind/pybind11/archive/v2.8.1.tar.gz" + sha256: "f1bcc07caa568eb312411dde5308b1e250bd0e1bc020fae855bf9f43209940cc" + "2.7.1": + url: "https://github.com/pybind/pybind11/archive/v2.7.1.tar.gz" + sha256: "616d1c42e4cf14fa27b2a4ff759d7d7b33006fdc5ad8fd603bb2c22622f27020" diff --git a/recipes/pybind11/all/conanfile.py b/recipes/pybind11/all/conanfile.py index aa098ee90ec20..3000aac013c02 100644 --- a/recipes/pybind11/all/conanfile.py +++ b/recipes/pybind11/all/conanfile.py @@ -6,30 +6,36 @@ import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class PyBind11Conan(ConanFile): name = "pybind11" description = "Seamless operability between C++11 and Python" - topics = "pybind11", "python", "binding" - homepage = "https://github.com/pybind/pybind11" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/pybind/pybind11" + topics = ("pybind11", "python", "binding", "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], 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["PYBIND11_INSTALL"] = True tc.variables["PYBIND11_TEST"] = False tc.variables["PYBIND11_CMAKECONFIG_INSTALL_DIR"] = "lib/cmake/pybind11" + if Version(self.version) < "2.11.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -54,22 +60,16 @@ def package(self): "add_library(", "# add_library(") - def package_id(self): - self.info.clear() - def package_info(self): cmake_base_path = os.path.join("lib", "cmake", "pybind11") self.cpp_info.set_property("cmake_target_name", "pybind11_all_do_not_use") self.cpp_info.components["headers"].includedirs = ["include"] self.cpp_info.components["pybind11_"].set_property("cmake_target_name", "pybind11::pybind11") self.cpp_info.components["pybind11_"].set_property("cmake_module_file_name", "pybind11") - self.cpp_info.components["pybind11_"].names["cmake_find_package"] = "pybind11" self.cpp_info.components["pybind11_"].builddirs = [cmake_base_path] self.cpp_info.components["pybind11_"].requires = ["headers"] cmake_file = os.path.join(cmake_base_path, "pybind11Common.cmake") self.cpp_info.set_property("cmake_build_modules", [cmake_file]) - for generator in ["cmake_find_package", "cmake_find_package_multi"]: - self.cpp_info.components["pybind11_"].build_modules[generator].append(cmake_file) self.cpp_info.components["embed"].requires = ["pybind11_"] self.cpp_info.components["module"].requires = ["pybind11_"] self.cpp_info.components["python_link_helper"].requires = ["pybind11_"] diff --git a/recipes/pybind11/all/test_package/CMakeLists.txt b/recipes/pybind11/all/test_package/CMakeLists.txt index e8d17d781285f..a0ddd8851c031 100644 --- a/recipes/pybind11/all/test_package/CMakeLists.txt +++ b/recipes/pybind11/all/test_package/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +project(test_package LANGUAGES CXX) + find_package(pybind11 REQUIRED CONFIG) + pybind11_add_module(test_package MODULE test_package.cpp) set_property(TARGET test_package PROPERTY CXX_STANDARD 11) diff --git a/recipes/pybind11/config.yml b/recipes/pybind11/config.yml index 0637bb6f5067e..cb2960aa24b66 100644 --- a/recipes/pybind11/config.yml +++ b/recipes/pybind11/config.yml @@ -1,17 +1,29 @@ versions: - "2.7.1": + "2.13.6": folder: all - "2.8.1": + "2.13.5": folder: all - "2.9.1": + "2.13.4": folder: all - "2.9.2": + "2.13.2": folder: all - "2.10.0": + "2.13.1": folder: all - "2.10.1": + "2.12.0": + folder: all + "2.11.1": folder: all "2.10.4": folder: all - "2.11.1": + "2.10.1": + folder: all + "2.10.0": + folder: all + "2.9.2": + folder: all + "2.9.1": + folder: all + "2.8.1": + folder: all + "2.7.1": folder: all diff --git a/recipes/pystring/all/CMakeLists.txt b/recipes/pystring/all/CMakeLists.txt index cde5a5799d904..03342157006f2 100644 --- a/recipes/pystring/all/CMakeLists.txt +++ b/recipes/pystring/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(pystring LANGUAGES CXX) include(GNUInstallDirs) diff --git a/recipes/pystring/all/test_package/CMakeLists.txt b/recipes/pystring/all/test_package/CMakeLists.txt index 56a7416627067..d11b2d227940e 100644 --- a/recipes/pystring/all/test_package/CMakeLists.txt +++ b/recipes/pystring/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(pystring REQUIRED CONFIG) diff --git a/recipes/pystring/all/test_v1_package/CMakeLists.txt b/recipes/pystring/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/pystring/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/pystring/all/test_v1_package/conanfile.py b/recipes/pystring/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/pystring/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_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/qarchive/all/conanfile.py b/recipes/qarchive/all/conanfile.py index 320e0e4349c52..e44b758e45244 100644 --- a/recipes/qarchive/all/conanfile.py +++ b/recipes/qarchive/all/conanfile.py @@ -48,8 +48,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libarchive/3.6.2") - self.requires("qt/5.15.10", transitive_headers=True, transitive_libs=True) + self.requires("libarchive/3.7.4") + self.requires("qt/[~5.15]", transitive_headers=True, transitive_libs=True) def build_requirements(self): self.tool_requires("cmake/[>=3.17 <4]") diff --git a/recipes/qarchive/all/test_package/CMakeLists.txt b/recipes/qarchive/all/test_package/CMakeLists.txt index eb399371778cf..a6a0b51e55141 100644 --- a/recipes/qarchive/all/test_package/CMakeLists.txt +++ b/recipes/qarchive/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) project(test_package CXX) find_package(QArchive REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} QArchive) -# Must compile with "-fPIC" since Qt was built with -reduce-relocations. -target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + +target_link_libraries(${PROJECT_NAME} PRIVATE QArchive) diff --git a/recipes/qarchive/all/test_package/conanfile.py b/recipes/qarchive/all/test_package/conanfile.py index 8e6ae76816f4e..9f97ee00e897e 100644 --- a/recipes/qarchive/all/test_package/conanfile.py +++ b/recipes/qarchive/all/test_package/conanfile.py @@ -12,6 +12,9 @@ class TestPackageConan(ConanFile): def requirements(self): self.requires(self.tested_reference_str) + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + def layout(self): cmake_layout(self) diff --git a/recipes/qarchive/all/test_v1_package/CMakeLists.txt b/recipes/qarchive/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/qarchive/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/qarchive/all/test_v1_package/conanfile.py b/recipes/qarchive/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/qarchive/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/qcbor/all/conandata.yml b/recipes/qcbor/all/conandata.yml index 5b5b4f359cdd2..073ab369d8103 100644 --- a/recipes/qcbor/all/conandata.yml +++ b/recipes/qcbor/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.5": + url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.5.tar.gz" + sha256: "fd71c2aa985575ea5e7df1540da54261f04af872fe4c4e76bfe56affc14dcd2a" + "1.4.1": + url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.4.1.tar.gz" + sha256: "c7ef031b60b23bf8ede47c66c9713982bba2608668b144280a65665bfcc94470" + "1.3": + url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.3.tar.gz" + sha256: "5acd3f3e7b19aad074813736a8776e71859d57c4dec9bfb85cd1dc6c219c8033" "1.2": url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.2.tar.gz" sha256: "0f706ad90ada600bd1ddbdf8dc6f2f5910e11de355bb4454b9b4123f0e4ff525" @@ -9,6 +18,18 @@ sources: url: "https://github.com/laurencelundblade/QCBOR/archive/refs/tags/v1.0.tar.gz" sha256: "961a46eb5a599cc040bfce4f4fade4427e046f1748f37ba4ebbc097fb9cdf1d3" patches: + "1.5": + - patch_file: "patches/1.5-0001-fix-cmake.patch" + patch_description: "disable fix fPIC and add installation" + patch_type: "conan" + "1.4.1": + - patch_file: "patches/1.4.1-0001-fix-cmake.patch" + patch_description: "disable fix fPIC and add installation" + patch_type: "conan" + "1.3": + - patch_file: "patches/1.2-0001-fix-cmake.patch" + patch_description: "disable fix fPIC and add installation" + patch_type: "conan" "1.2": - patch_file: "patches/1.2-0001-fix-cmake.patch" patch_description: "disable fix fPIC and add installation" diff --git a/recipes/qcbor/all/conanfile.py b/recipes/qcbor/all/conanfile.py index 7d87de4445169..68b5a4f311351 100644 --- a/recipes/qcbor/all/conanfile.py +++ b/recipes/qcbor/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, load, save +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, load, save, copy from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.scm import Version @@ -15,6 +15,7 @@ class QCBORConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/laurencelundblade/QCBOR" topics = ("serialization", "cbor", "rfc-7049", "rfc-8949") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -38,20 +39,23 @@ def config_options(self): del self.options.disable_float def configure(self): - if self.options.shared: + if self.settings.os == "Windows": + self.package_type = "static-library" + del self.options.shared + if self.options.get_safe("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], 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_QCBOR_TEST"] = False if Version(self.version) >= "1.2": tc.variables["QCBOR_OPT_DISABLE_FLOAT_HW_USE"] = self.options.disable_float in ["HW_USE", "PREFERRED", "ALL"] tc.variables["QCBOR_OPT_DISABLE_FLOAT_PREFERRED"] = self.options.disable_float in ["PREFERRED", "ALL"] @@ -70,10 +74,13 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - # Extract the License/s from README.md to a file - tmp = load(self, os.path.join(self.source_folder, "inc", "qcbor", "qcbor.h")) - license_contents = re.search("( Copyright.*) =====", tmp, re.DOTALL)[1] - save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) + if Version(self.version) >= "1.5": + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + else: + # Extract the License/s from README.md to a file + tmp = load(self, os.path.join(self.source_folder, "inc", "qcbor", "qcbor.h")) + license_contents = re.search("( Copyright.*) =====", tmp, re.DOTALL)[1] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_contents) def package_info(self): self.cpp_info.libs = ["qcbor"] diff --git a/recipes/qcbor/all/patches/1.0-0001-fix-cmake.patch b/recipes/qcbor/all/patches/1.0-0001-fix-cmake.patch index d5f6fcb7e4dba..87fc6cae3601f 100644 --- a/recipes/qcbor/all/patches/1.0-0001-fix-cmake.patch +++ b/recipes/qcbor/all/patches/1.0-0001-fix-cmake.patch @@ -2,14 +2,10 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a5bcd0..744662e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -17,3 +17,18 @@ set(SOURCE +@@ -17,3 +17,14 @@ set(SOURCE ) add_library(qcbor ${SOURCE}) -+set_target_properties(qcbor PROPERTIES -+ WINDOWS_EXPORT_ALL_SYMBOLS ON -+) -+ +find_library(LIBM m) +target_link_libraries(qcbor PRIVATE $<$:${LIBM}>) + diff --git a/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch b/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch index e5969488c2420..ca95e01302dce 100644 --- a/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch +++ b/recipes/qcbor/all/patches/1.1-0001-fix-cmake.patch @@ -2,15 +2,10 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index f0b67b9..4b00b8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -17,3 +17,19 @@ set(SOURCE +@@ -17,3 +17,14 @@ set(SOURCE add_library(qcbor ${SOURCE}) target_include_directories(qcbor PUBLIC inc) -+ -+set_target_properties(qcbor PROPERTIES -+ WINDOWS_EXPORT_ALL_SYMBOLS ON -+) -+ +find_library(LIBM m) +target_link_libraries(qcbor PRIVATE $<$:${LIBM}>) + diff --git a/recipes/qcbor/all/patches/1.2-0001-fix-cmake.patch b/recipes/qcbor/all/patches/1.2-0001-fix-cmake.patch index 8b659e24ca0a3..f50844b0bec9a 100644 --- a/recipes/qcbor/all/patches/1.2-0001-fix-cmake.patch +++ b/recipes/qcbor/all/patches/1.2-0001-fix-cmake.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 486946c..4234a59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -58,10 +58,14 @@ target_compile_definitions(qcbor +@@ -58,10 +58,10 @@ target_compile_definitions(qcbor $<$:USEFULBUF_DISABLE_ALL_FLOAT> ) @@ -11,14 +11,10 @@ index 486946c..4234a59 100644 target_compile_options(qcbor PRIVATE -Os -fPIC) endif() -+set_target_properties(qcbor PROPERTIES -+ WINDOWS_EXPORT_ALL_SYMBOLS ON -+) -+ # The math library is needed for floating-point support. # To avoid need for it #define QCBOR_DISABLE_FLOAT_HW_USE if (CMAKE_C_COMPILER_ID STREQUAL "GNU") -@@ -75,3 +79,12 @@ endif() +@@ -75,3 +75,12 @@ endif() if (NOT BUILD_QCBOR_TEST STREQUAL "OFF") add_subdirectory(test) endif() diff --git a/recipes/qcbor/all/patches/1.4.1-0001-fix-cmake.patch b/recipes/qcbor/all/patches/1.4.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..81b3950d82ca7 --- /dev/null +++ b/recipes/qcbor/all/patches/1.4.1-0001-fix-cmake.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4aa83f..4878a31 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,10 +58,10 @@ target_compile_definitions(qcbor + $<$:USEFULBUF_DISABLE_ALL_FLOAT> + ) + +-if (BUILD_SHARED_LIBS) ++if (0) + target_compile_options(qcbor PRIVATE -Os -fPIC) + endif() + + # The math library is needed for floating-point support. + # To avoid need for it #define QCBOR_DISABLE_FLOAT_HW_USE + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") +@@ -88,6 +88,9 @@ set_target_properties( + include(GNUInstallDirs) + install( + TARGETS qcbor ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/qcbor" + ) + diff --git a/recipes/qcbor/all/patches/1.5-0001-fix-cmake.patch b/recipes/qcbor/all/patches/1.5-0001-fix-cmake.patch new file mode 100644 index 0000000000000..e9e96ba504660 --- /dev/null +++ b/recipes/qcbor/all/patches/1.5-0001-fix-cmake.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c7e081..6f4ea4e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,7 @@ target_compile_definitions(qcbor + $<$:USEFULBUF_DISABLE_ALL_FLOAT> + ) + +-if (BUILD_SHARED_LIBS) ++if (0) + target_compile_options(qcbor PRIVATE -Os -fPIC) + endif() + +@@ -90,6 +90,9 @@ set_target_properties( + include(GNUInstallDirs) + install( + TARGETS qcbor ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/qcbor" + ) + diff --git a/recipes/qcbor/all/test_package/CMakeLists.txt b/recipes/qcbor/all/test_package/CMakeLists.txt index bc1e8dfcced62..62326a9eb8f8f 100644 --- a/recipes/qcbor/all/test_package/CMakeLists.txt +++ b/recipes/qcbor/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(qcbor REQUIRED CONFIG) diff --git a/recipes/qcbor/all/test_v1_package/CMakeLists.txt b/recipes/qcbor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 46fc5f986a893..0000000000000 --- a/recipes/qcbor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_packages) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/qcbor/all/test_v1_package/conanfile.py b/recipes/qcbor/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/qcbor/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/qcbor/config.yml b/recipes/qcbor/config.yml index db25e2b16686a..9feea3cfb2036 100644 --- a/recipes/qcbor/config.yml +++ b/recipes/qcbor/config.yml @@ -1,4 +1,10 @@ versions: + "1.5": + folder: all + "1.4.1": + folder: all + "1.3": + folder: all "1.2": folder: all "1.1": diff --git a/recipes/qcoro/all/CMakeLists.txt b/recipes/qcoro/all/CMakeLists.txt index 434aea21733de..9343390854586 100644 --- a/recipes/qcoro/all/CMakeLists.txt +++ b/recipes/qcoro/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include("conanbuildinfo.cmake") diff --git a/recipes/qcoro/all/test_package/CMakeLists.txt b/recipes/qcoro/all/test_package/CMakeLists.txt index 07490bf8a1415..e31ec20f74b0d 100644 --- a/recipes/qcoro/all/test_package/CMakeLists.txt +++ b/recipes/qcoro/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/qdbm/all/test_v1_package/CMakeLists.txt b/recipes/qdbm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/qdbm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index ec80e0c5cc134..0000000000000 --- a/recipes/qdbm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/qhull/all/conandata.yml b/recipes/qhull/all/conandata.yml index d9b28c7eb65e2..1331abde1b8bd 100644 --- a/recipes/qhull/all/conandata.yml +++ b/recipes/qhull/all/conandata.yml @@ -11,13 +11,13 @@ sources: patches: "8.0.1": - patch_file: "patches/0002-fix-cmake-minimum-required-location-8.0.1.patch" - patch_description: "Fix cmake_minimum_required() position" + patch_description: "Fix cmake_minimum_required() position and CMake 4 support" patch_type: "backport" patch_source: "https://github.com/qhull/qhull/pull/120" - patch_file: "patches/0003-fix-cmake-8.0.x.patch" "8.0.0": - patch_file: "patches/0002-fix-cmake-minimum-required-location-8.0.0.patch" - patch_description: "Fix cmake_minimum_required() position" + patch_description: "Fix cmake_minimum_required() position and CMake 4 support" patch_type: "backport" patch_source: "https://github.com/qhull/qhull/pull/120" - patch_file: "patches/0003-fix-cmake-8.0.x.patch" @@ -28,7 +28,7 @@ patches: patch_type: "backport" patch_source: "https://github.com/qhull/qhull/pull/49" - patch_file: "patches/0002-fix-cmake-minimum-required-location-7.3.2.patch" - patch_description: "Fix cmake_minimum_required() position" + patch_description: "Fix cmake_minimum_required() position and CMake 4 support" patch_type: "backport" patch_source: "https://github.com/qhull/qhull/pull/120" - patch_file: "patches/0003-fix-cmake-7.3.2.patch" diff --git a/recipes/qhull/all/conanfile.py b/recipes/qhull/all/conanfile.py index 79132e14aac7c..dc46fa276c761 100644 --- a/recipes/qhull/all/conanfile.py +++ b/recipes/qhull/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class QhullConan(ConanFile): @@ -85,16 +85,8 @@ def package_info(self): if is_msvc(self) and self.options.shared: self.cpp_info.components["libqhull"].defines.extend(["qh_dllimport"]) - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "Qhull" - self.cpp_info.names["cmake_find_package_multi"] = "Qhull" - self.cpp_info.names["pkg_config"] = self._qhull_pkgconfig_name - self.cpp_info.components["libqhull"].names["cmake_find_package"] = self._qhull_cmake_name - self.cpp_info.components["libqhull"].names["cmake_find_package_multi"] = self._qhull_cmake_name - self.cpp_info.components["libqhull"].names["pkg_config"] = self._qhull_pkgconfig_name self.cpp_info.components["libqhull"].set_property("cmake_target_name", f"Qhull::{self._qhull_cmake_name}") self.cpp_info.components["libqhull"].set_property("pkg_config_name", self._qhull_pkgconfig_name) - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) @property def _qhull_cmake_name(self): diff --git a/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-7.3.2.patch b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-7.3.2.patch index a371b31b3073b..135eaddd41c6d 100644 --- a/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-7.3.2.patch +++ b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-7.3.2.patch @@ -4,9 +4,9 @@ # $Id: //main/2019/qhull/CMakeLists.txt#5 $$Change: 2711 $ # $DateTime: 2019/06/27 22:34:56 $$Author: bbarber $ --project(qhull) - cmake_minimum_required(VERSION 3.0) -+project(qhull) ++cmake_minimum_required(VERSION 3.5) + project(qhull) +-cmake_minimum_required(VERSION 3.0) # Define qhull_VERSION in README.txt, Announce.txt, qh-get.htm, CMakeLists.txt, # Makefile, qhull-exports.def, qhull_p-exports.def, qhull_r-exports.def, qhull-warn.pri diff --git a/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.0.patch b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.0.patch index 7acfbbddeb621..8af4fe28bbe4b 100644 --- a/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.0.patch +++ b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.0.patch @@ -4,9 +4,9 @@ # $Id: //main/2019/qhull/CMakeLists.txt#12 $$Change: 2961 $ # $DateTime: 2020/06/01 22:17:03 $$Author: bbarber $ --project(qhull) - cmake_minimum_required(VERSION 3.0) -+project(qhull) ++cmake_minimum_required(VERSION 3.5) + project(qhull) +-cmake_minimum_required(VERSION 3.0) # Define qhull_VERSION in README.txt, Announce.txt, qh-get.htm, CMakeLists.txt # qhull-zip.sh (twice), qhull-wiki.md, qhull-news.htm, File_id.diz, index.htm diff --git a/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.1.patch b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.1.patch index ed6a2832b5ba8..71388de1adc80 100644 --- a/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.1.patch +++ b/recipes/qhull/all/patches/0002-fix-cmake-minimum-required-location-8.0.1.patch @@ -4,9 +4,9 @@ # $Id: //main/2019/qhull/CMakeLists.txt#16 $$Change: 3008 $ # $DateTime: 2020/07/30 13:54:27 $$Author: bbarber $ --project(qhull) - cmake_minimum_required(VERSION 3.0) -+project(qhull) ++cmake_minimum_required(VERSION 3.5) + project(qhull) +-cmake_minimum_required(VERSION 3.0) # Define qhull_VERSION in README.txt, Announce.txt, qh-get.htm, CMakeLists.txt # qhull-zip.sh (twice), qhull-wiki.md, qhull-news.htm, File_id.diz, index.htm diff --git a/recipes/qhull/all/test_package/CMakeLists.txt b/recipes/qhull/all/test_package/CMakeLists.txt index 014682f4bed09..26c55678001eb 100644 --- a/recipes/qhull/all/test_package/CMakeLists.txt +++ b/recipes/qhull/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(Qhull REQUIRED CONFIG) diff --git a/recipes/qhull/all/test_v1_package/CMakeLists.txt b/recipes/qhull/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/qhull/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/qhull/all/test_v1_package/conanfile.py b/recipes/qhull/all/test_v1_package/conanfile.py deleted file mode 100644 index b2da31bf488a2..0000000000000 --- a/recipes/qhull/all/test_v1_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.definitions["QHULL_REENTRANT"] = self.options["qhull"].reentrant - 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/qoi/all/conandata.yml b/recipes/qoi/all/conandata.yml new file mode 100644 index 0000000000000..85f3317442208 --- /dev/null +++ b/recipes/qoi/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + # Newer versions at the top + "0.0.0.cci.20240906": + url: "https://github.com/phoboslab/qoi/archive/019020993ce33bdf56c876004e8b27139a0d011f.zip" + sha256: "b4785ed15a5a9d1084cc1ad72829e7bb16b9a7b597ac8aa8160f2788748614f3" diff --git a/recipes/qoi/all/conanfile.py b/recipes/qoi/all/conanfile.py new file mode 100644 index 0000000000000..8eb9a1ee17305 --- /dev/null +++ b/recipes/qoi/all/conanfile.py @@ -0,0 +1,46 @@ +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.52.0" + + +class QoiConan(ConanFile): + name = "qoi" + description = "The “Quite OK Image Format†for fast, lossless image compression" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://qoiformat.org/" + topics = ("image", "compression", "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") + + # same package ID for any package + def package_id(self): + self.info.clear() + + 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, + "*.h", + self.source_folder, + 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/qoi/all/test_package/CMakeLists.txt b/recipes/qoi/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f16d6221266fc --- /dev/null +++ b/recipes/qoi/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) # if the project is pure C + +find_package(qoi REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +# don't link to ${CONAN_LIBS} or CONAN_PKG::package +target_link_libraries(${PROJECT_NAME} PRIVATE qoi::qoi) diff --git a/recipes/qoi/all/test_package/conanfile.py b/recipes/qoi/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/qoi/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/qoi/all/test_package/test_package.c b/recipes/qoi/all/test_package/test_package.c new file mode 100644 index 0000000000000..aca3fa09d9bc1 --- /dev/null +++ b/recipes/qoi/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include + +#define QOI_IMPLEMENTATION +#include "qoi.h" + +int main(void) { + printf("qoi_desc size: %d\n", sizeof(qoi_desc)); + + return EXIT_SUCCESS; +} diff --git a/recipes/qoi/config.yml b/recipes/qoi/config.yml new file mode 100644 index 0000000000000..97d1baf6d5919 --- /dev/null +++ b/recipes/qoi/config.yml @@ -0,0 +1,4 @@ +versions: + # Newer versions at the top + "0.0.0.cci.20240906": + folder: all diff --git a/recipes/qoixx/all/conandata.yml b/recipes/qoixx/all/conandata.yml new file mode 100644 index 0000000000000..17e77ab24163d --- /dev/null +++ b/recipes/qoixx/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.7": + url: "https://github.com/wx257osn2/qoixx/archive/refs/tags/v0.1.7.tar.gz" + sha256: "9da53e0fc035f4b75f872a196a76cd870b63568612254035dadc84e46f47d779" diff --git a/recipes/qoixx/all/conanfile.py b/recipes/qoixx/all/conanfile.py new file mode 100644 index 0000000000000..b18ef696aab67 --- /dev/null +++ b/recipes/qoixx/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class QoixxConan(ConanFile): + name = "qoixx" + description = "Single Header Quite Fast QOI(Quite OK Image Format) Implementation written in C++20" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/wx257osn2/qoixx" + topics = ("qoi", "simd", "image", "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": "11", + "clang": "12", + "apple-clang": "14", + "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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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 = [] diff --git a/recipes/qoixx/all/test_package/CMakeLists.txt b/recipes/qoixx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..23c2933ab08bc --- /dev/null +++ b/recipes/qoixx/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(qoixx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE qoixx::qoixx) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/qoixx/all/test_package/conanfile.py b/recipes/qoixx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/qoixx/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/qoixx/all/test_package/test_package.cpp b/recipes/qoixx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7d626bc32b672 --- /dev/null +++ b/recipes/qoixx/all/test_package/test_package.cpp @@ -0,0 +1,25 @@ +#include +#include +#include "qoixx.hpp" + +int main(void) { + constexpr qoixx::qoi::desc desc{ + .width = 8, + .height = 4, + .channels = 3, + .colorspace = qoixx::qoi::colorspace::srgb, + }; + + const std::vector original = { + 130, 0, 212, 124, 204, 88, 79, 26, 210, 104, 117, 4, 137, 191, 80, 204, + 65, 175, 38, 160, 207, 182, 174, 59, 83, 18, 227, 4, 234, 150, 97, 131, + 62, 95, 167, 236, 132, 143, 78, 175, 86, 172, 237, 113, 195, 87, 227, 242, + 13, 189, 125, 33, 16, 79, 165, 247, 216, 193, 192, 113, 254, 176, 172, 227, + 94, 105, 146, 232, 150, 39, 148, 238, 105, 65, 23, 4, 33, 252, 243, 111, + 120, 32, 150, 144, 96, 66, 9, 102, 226, 245, 145, 153, 240, 183, 60, 132 + }; + + const auto encoded = qoixx::qoi::encode>(original, desc); + const auto [decoded, decoded_desc] = qoixx::qoi::decode>(encoded); + return 0; +} diff --git a/recipes/qoixx/config.yml b/recipes/qoixx/config.yml new file mode 100644 index 0000000000000..e6830418cc45c --- /dev/null +++ b/recipes/qoixx/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.7": + folder: all diff --git a/recipes/qpdf/all/test_package/CMakeLists.txt b/recipes/qpdf/all/test_package/CMakeLists.txt index 2892d11ff1f83..4bdfd703c7e2e 100644 --- a/recipes/qpdf/all/test_package/CMakeLists.txt +++ b/recipes/qpdf/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) diff --git a/recipes/qpdf/all/test_v1_package/CMakeLists.txt b/recipes/qpdf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/qpdf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/qpdf/all/test_v1_package/conanfile.py b/recipes/qpdf/all/test_v1_package/conanfile.py deleted file mode 100644 index 0f735b51a2642..0000000000000 --- a/recipes/qpdf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -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 tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/qpoases/all/test_package/CMakeLists.txt b/recipes/qpoases/all/test_package/CMakeLists.txt index 0b4cf698456e7..93fc86bb67d39 100644 --- a/recipes/qpoases/all/test_package/CMakeLists.txt +++ b/recipes/qpoases/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(qpoases REQUIRED CONFIG) diff --git a/recipes/qpoases/all/test_v1_package/CMakeLists.txt b/recipes/qpoases/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/qpoases/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/qpoases/all/test_v1_package/conanfile.py b/recipes/qpoases/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/qpoases/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_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/qr-code-generator/all/CMakeLists.txt b/recipes/qr-code-generator/all/CMakeLists.txt index 60ddaa9f6b380..7629857f9b79e 100644 --- a/recipes/qr-code-generator/all/CMakeLists.txt +++ b/recipes/qr-code-generator/all/CMakeLists.txt @@ -1,9 +1,16 @@ cmake_minimum_required(VERSION 3.15) project(QR-Code-Generator) -include(src/files.cmake) -add_library(${LIBRARY_NAME} ${SRC}) +set(SRC_C ${CMAKE_SOURCE_DIR}/src/c/qrcodegen.c) +set(LIBRARY_NAME_C qrcodegenc) +set(HEADERS_C ${CMAKE_SOURCE_DIR}/src/c/qrcodegen.h) + +add_library(${LIBRARY_NAME_C} ${SRC_C}) +set_target_properties(${LIBRARY_NAME_C} PROPERTIES PUBLIC_HEADER "${HEADERS_C}") +install(TARGETS ${LIBRARY_NAME_C} RUNTIME LIBRARY ARCHIVE PUBLIC_HEADER DESTINATION include/qrcodegenc) +include(src/files.cmake) +add_library(${LIBRARY_NAME} ${SRC}) set_target_properties(${LIBRARY_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}") install(TARGETS ${LIBRARY_NAME} RUNTIME LIBRARY ARCHIVE PUBLIC_HEADER DESTINATION include/qrcodegen) diff --git a/recipes/qr-code-generator/all/conanfile.py b/recipes/qr-code-generator/all/conanfile.py index 84430d69ae1d0..656603b7ba557 100644 --- a/recipes/qr-code-generator/all/conanfile.py +++ b/recipes/qr-code-generator/all/conanfile.py @@ -101,8 +101,9 @@ def package(self): cmake.install() def package_info(self): - self.cpp_info.libs = [ - "qrcodegen" if Version(self.version) < "1.7.0" else "qrcodegencpp" - ] + self.cpp_info.components["qrcodegencpp"].set_property("cmake_target_name", "qr-code-generator::qrcodegencpp") + self.cpp_info.components["qrcodegencpp"].libs = ["qrcodegen" if Version(self.version) < "1.7.0" else "qrcodegencpp"] + self.cpp_info.components["qrcodegenc"].set_property("cmake_target_name", "qr-code-generator::qrcodegenc") + self.cpp_info.components["qrcodegenc"].libs = ["qrcodegenc"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/qr-code-generator/all/test_package/CMakeLists.txt b/recipes/qr-code-generator/all/test_package/CMakeLists.txt index f7fc3218bd3f1..6ae79f83526db 100644 --- a/recipes/qr-code-generator/all/test_package/CMakeLists.txt +++ b/recipes/qr-code-generator/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) diff --git a/recipes/qr-code-generator/all/test_v1_package/CMakeLists.txt b/recipes/qr-code-generator/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/qr-code-generator/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/qr-code-generator/all/test_v1_package/conanfile.py b/recipes/qr-code-generator/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/qr-code-generator/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/qt-advanced-docking-system/all/CMakeLists.txt b/recipes/qt-advanced-docking-system/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2b..0000000000000 --- a/recipes/qt-advanced-docking-system/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/qt-advanced-docking-system/all/conandata.yml b/recipes/qt-advanced-docking-system/all/conandata.yml index 4dc01c8789b06..369a142fdbb77 100644 --- a/recipes/qt-advanced-docking-system/all/conandata.yml +++ b/recipes/qt-advanced-docking-system/all/conandata.yml @@ -1,11 +1,4 @@ sources: - "3.8.3": - url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/3.8.3.tar.gz" - sha256: "bd5a9469b755bedf33baefd0b3dda6d167b7917a2888e2794eed5abee7d78f74" - "3.8.2": - url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/3.8.2.tar.gz" - sha256: "e56811228fb4d5f5703c31cd83cb39ab2d5a849f581719d383db72f9322ec7f2" -patches: - "3.8.2": - - patch_file: "patches/fix-cmake-license-install.patch" - base_path: "source_subfolder" + "4.3.1": + url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/4.3.1.tar.gz" + sha256: "d7c244d9accaa78766e90124c0ce6054327b78625dae8ba2cfe22fc29dfba37d" diff --git a/recipes/qt-advanced-docking-system/all/conanfile.py b/recipes/qt-advanced-docking-system/all/conanfile.py index 332361aaf6862..4d638f310840a 100644 --- a/recipes/qt-advanced-docking-system/all/conanfile.py +++ b/recipes/qt-advanced-docking-system/all/conanfile.py @@ -1,23 +1,29 @@ -from conan import ConanFile -from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir -from conans import CMake import os -required_conan_version = ">=1.52.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, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=2.0.9" + class QtADS(ConanFile): name = "qt-advanced-docking-system" - license = "LGPL-2.1" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System" - topics = ("qt", "gui") description = ( "Qt Advanced Docking System lets you create customizable layouts " "using a full featured window docking system similar to what is found " "in many popular integrated development environments (IDEs) such as " "Visual Studio." ) - settings = "os", "compiler", "build_type", "arch" + license = "LGPL-2.1-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System" + topics = ("qt", "gui") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -26,70 +32,78 @@ class QtADS(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - - _cmake = None - _qt_version = "5.15.6" + implements = ["auto_shared_fpic"] @property - def _source_subfolder(self): - return "source_subfolder" + def _qt_major(self): + return Version(self.dependencies["qt"].ref.version).major - 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 + @property + def _min_cppstd(self): + if self._qt_major >= 6: + return 17 + else: + return 14 - def configure(self): - if self.options.shared: - del self.options.fPIC + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires(f"qt/{self._qt_version}") - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True, - destination=self._source_subfolder) + self.requires("qt/[>=5.15 <7]", transitive_headers=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake + def build_requirements(self): + self.tool_requires("qt/") + self.tool_requires("cmake/[>=3.27 <4]") # to be able to use CMAKE_AUTOMOC_EXECUTABLE - self._cmake = CMake(self) - self._cmake.definitions["ADS_VERSION"] = self.version - self._cmake.definitions["BUILD_EXAMPLES"] = "OFF" - self._cmake.definitions["BUILD_STATIC"] = not self.options.shared + def validate(self): + check_min_cppstd(self, self._min_cppstd) - self._cmake.configure() - return self._cmake - - def _patch_sources(self): - apply_conandata_patches(self) - - replace_in_file(self, - f"{self.source_folder}/{self._source_subfolder}/src/ads_globals.cpp", - "#include ", - f"#include <{self._qt_version}/QtGui/qpa/qplatformnativeinterface.h>" - ) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["ADS_VERSION"] = self.version + tc.cache_variables["BUILD_EXAMPLES"] = "OFF" + tc.cache_variables["BUILD_STATIC"] = not self.options.shared + # https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/a16d17a8bf375127847ac8f40af1ebcdb841b13c/src/CMakeLists.txt#L12 + # TODO: the upstream Qt recipe should expose this variable + qt_version = str(self.dependencies["qt"].ref.version) + qt_include_root = self.dependencies["qt"].cpp_info.includedirs[0] + tc.cache_variables[f"Qt{self._qt_major}Gui_PRIVATE_INCLUDE_DIRS"] = os.path.join(qt_include_root, "QtGui", qt_version, "QtGui") + qt_tools_rootdir = self.conf.get("user.qt:tools_directory", None) + tc.cache_variables["CMAKE_AUTOMOC_EXECUTABLE"] = os.path.join(qt_tools_rootdir, "moc.exe" if self.settings_build.os == "Windows" else "moc") + tc.cache_variables["CMAKE_AUTORCC_EXECUTABLE"] = os.path.join(qt_tools_rootdir, "rcc.exe" if self.settings_build.os == "Windows" else "rcc") + tc.generate() + deps = CMakeDeps(self) + deps.generate() 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "gnu-lgpl-v2.1.md", self.source_folder, os.path.join(self.package_folder, "licenses")) rmdir(self, os.path.join(self.package_folder, "license")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): + if Version(self.version) >= 4: + name = f"qt{self._qt_major}advanceddocking" + self.cpp_info.includedirs.append(os.path.join("include", name)) + lib_name = f"{name}d" if self.settings.build_type == "Debug" else name + else: + lib_name = "qtadvanceddocking" + + self.cpp_info.set_property("cmake_file_name", lib_name) + self.cpp_info.set_property("cmake_target_name", f"ads::{lib_name}") + if self.options.shared: - self.cpp_info.libs = ["qtadvanceddocking"] + self.cpp_info.libs = [lib_name] else: self.cpp_info.defines.append("ADS_STATIC") - self.cpp_info.libs = ["qtadvanceddocking_static"] + self.cpp_info.libs = [f"{lib_name}_static"] diff --git a/recipes/qt-advanced-docking-system/all/patches/fix-cmake-license-install.patch b/recipes/qt-advanced-docking-system/all/patches/fix-cmake-license-install.patch deleted file mode 100644 index 737536558a9ac..0000000000000 --- a/recipes/qt-advanced-docking-system/all/patches/fix-cmake-license-install.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 49cd799..d601aaa 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -87,8 +87,8 @@ install(FILES ${ads_HEADERS} - COMPONENT headers - ) - install(FILES -- "${CMAKE_SOURCE_DIR}/LICENSE" -- "${CMAKE_SOURCE_DIR}/gnu-lgpl-v2.1.md" -+ "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE" -+ "${CMAKE_CURRENT_SOURCE_DIR}/../gnu-lgpl-v2.1.md" - DESTINATION license - COMPONENT license - ) diff --git a/recipes/qt-advanced-docking-system/all/test_package/CMakeLists.txt b/recipes/qt-advanced-docking-system/all/test_package/CMakeLists.txt index 0451993feb016..cb9d03ab54a96 100644 --- a/recipes/qt-advanced-docking-system/all/test_package/CMakeLists.txt +++ b/recipes/qt-advanced-docking-system/all/test_package/CMakeLists.txt @@ -1,12 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(PackageTest CXX) -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(qt-advanced-docking-system CONFIG REQUIRED) +project(test_package CXX) +find_package(qt6advanceddocking REQUIRED CONFIG) +find_package(Qt6 REQUIRED) add_executable(example example.cpp) -target_link_libraries(example qt-advanced-docking-system::qt-advanced-docking-system) +target_link_libraries(example ads::qt6advanceddocking Qt6::Core) diff --git a/recipes/qt-advanced-docking-system/all/test_package/conanfile.py b/recipes/qt-advanced-docking-system/all/test_package/conanfile.py index fd42f214c6b30..a99106c7aa8d6 100644 --- a/recipes/qt-advanced-docking-system/all/test_package/conanfile.py +++ b/recipes/qt-advanced-docking-system/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 AdsTestConan(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" + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("qt/[*]") + + 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, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/qt-advanced-docking-system/config.yml b/recipes/qt-advanced-docking-system/config.yml index 63dc53b34436f..e94365bbd5cfc 100644 --- a/recipes/qt-advanced-docking-system/config.yml +++ b/recipes/qt-advanced-docking-system/config.yml @@ -1,5 +1,3 @@ versions: - "3.8.3": - folder: "all" - "3.8.2": + "4.3.1": folder: "all" diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml index db92ab6d5dace..8ea113f2b1a0b 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -1,250 +1,50 @@ sources: - "5.15.11": + "5.15.16": 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" - - "https://download.qt.io/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp1.nluug.nl/languages/qt/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp2.nluug.nl/languages/qt/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://master.qt.io/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz" - sha256: "26d5f36134db03abe4a6db794c7570d729c92a3fc1b0bf9b1c8f86d0573cd02f" - "5.15.8": - url: - - "https://download.qt.io/archive/qt/5.15/5.15.8/single/qt-everywhere-opensource-src-5.15.8.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.8/single/qt-everywhere-opensource-src-5.15.8.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.8/single/qt-everywhere-opensource-src-5.15.8.tar.xz" - - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.8/single/qt-everywhere-opensource-src-5.15.8.tar.xz" - sha256: "776a9302c336671f9406a53bd30b8e36f825742b2ec44a57c08217bff0fa86b9" - "5.15.7": - url: - - "https://download.qt.io/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" - - "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" + - "https://download.qt.io/official_releases/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://download.qt.io/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://mirrors.cloud.tencent.com/qt/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://mirror.bjtu.edu.cn/qt/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + - "https://mirror.aarnet.edu.au/pub/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + sha256: "efa99827027782974356aceff8a52bd3d2a8a93a54dd0db4cca41b5e35f1041c" patches: - "5.15.11": + "5.15.16": - "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" + "patch_description": "qtwebengine don't use rpath-link on macOS" + "patch_file": "patches/5.15.14-macos-qtwebengine-rpath-link.patch" + - "base_path": "qt5/qtlocation" + "patch_description": "qtlocation missing utility header" + "patch_file": "patches/5.15.14-macos-qtlocation-utility-header.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" + "patch_description": "qtwebengine fix missing headers" + "patch_file": "patches/5.15.14-qtwebengine-missing-deps.patch" - "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" + "patch_description": "macos fix chromium build in newer macos SDKs" + "patch_file": "patches/5.15.14-macos-chromium-newer-sdks.patch" - "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 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" - - patch_file: "patches/c72097e.diff" - base_path: "qt5/qtwebengine" - - patch_file: "patches/fix-macdeployqt.diff" - base_path: "qt5/qttools" - - 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/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" - base_path: "qt5/qtbase" - - patch_file: "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch" - base_path: "qt5/qtbase" - patch_description: "Fix build with apple-clang 15" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" - - patch_file: "patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch" - base_path: "qt5/qtbase" - patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" - "5.15.7": - - patch_file: "patches/337f28c9ab.patch" - base_path: "qt5/qtbase" - - 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" - base_path: "qt5/qtbase" - - patch_file: "patches/android-new-ndk.diff" - base_path: "qt5/qtbase" - - patch_file: "patches/5.15.7-fix-qmake-default-libdirs-apple-clang-15.patch" - base_path: "qt5/qtbase" - patch_description: "Fix build with apple-clang 15" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" - - patch_file: "patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch" - base_path: "qt5/qtbase" - patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" - patch_type: "portability" - patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" + "patch_description": "Fix build error with binutils >= 2.41" + "patch_file": "patches/ffmpeg-x86-optimization.patch" + "patch_source": "https://packages.ubuntu.com/source/focal-updates/qtwebengine-opensource-src" + "patch_type": "portability" diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index a4c631120b356..82ce87b3594a4 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -1,7 +1,7 @@ -from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan import ConanFile, conan_version +from conan.errors import ConanException, ConanInvalidConfiguration from conan.tools.android import android_abi -from conan.tools.apple import is_apple_os +from conan.tools.apple import is_apple_os, to_apple_arch from conan.tools.build import build_jobs, check_min_cppstd, cross_building 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 @@ -10,6 +10,7 @@ from conan.tools.scm import Version import configparser import glob +from io import StringIO import itertools import os import textwrap @@ -27,6 +28,8 @@ class QtConan(ConanFile): "qtspeech", "qtnetworkauth", "qtremoteobjects", "qtwebglplugin", "qtlottie", "qtquicktimeline", "qtquick3d", "qtknx", "qtmqtt", "qtcoap", "qtopcua"] + _module_statuses = ["essential", "addon", "deprecated", "preview"] + name = "qt" description = "Qt is a cross-platform framework for graphical user interfaces." topics = ("ui", "framework") @@ -53,7 +56,7 @@ class QtConan(ConanFile): "with_libjpeg": ["libjpeg", "libjpeg-turbo", False], "with_libpng": [True, False], "with_sqlite3": [True, False], - "with_mysql": [True, False], + "with_mysql": ["mysql", "mariadb", False], "with_pq": [True, False], "with_odbc": [True, False], "with_libalsa": [True, False], @@ -78,6 +81,7 @@ class QtConan(ConanFile): "multiconfiguration": [True, False] } options.update({module: [True, False] for module in _submodules}) + options.update({f"{status}_modules": [True, False] for status in _module_statuses}) default_options = { "shared": False, @@ -96,7 +100,7 @@ class QtConan(ConanFile): "with_libjpeg": "libjpeg", "with_libpng": True, "with_sqlite3": True, - "with_mysql": True, + "with_mysql": "mysql", "with_pq": True, "with_odbc": True, "with_libalsa": False, @@ -118,8 +122,11 @@ class QtConan(ConanFile): "cross_compile": None, "sysroot": None, "config": None, - "multiconfiguration": False + "multiconfiguration": False, } + # essential_modules, addon_modules, deprecated_modules, preview_modules: + # these are only provided for convenience, set to False by default + default_options.update({f"{status}_modules": False for status in _module_statuses}) no_copy_source = True short_paths = True @@ -149,20 +156,17 @@ def validate_build(self): 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, mybuf) - verstr = mybuf.getvalue().strip().split("Python ")[1] - if verstr.endswith("+"): - verstr = verstr[:-1] + command_output = StringIO() + cmd_v = f"\"{python_exe}\" -c \"import platform;print(platform.python_version())\"" + self.run(cmd_v, command_output) + verstr = command_output.getvalue().strip() version = Version(verstr) # >= 2.7.5 & < 3 v_min = "2.7.5" v_max = "3.0.0" if (version >= v_min) and (version < v_max): msg = ("Found valid Python 2 required for QtWebengine:" - f" version={mybuf.getvalue()}, path={python_exe}") + f" version={verstr}, path={python_exe}") self.output.success(msg) else: msg = (f"Found Python 2 in path, but with invalid version {verstr}" @@ -187,7 +191,6 @@ def config_options(self): if self.settings.compiler in ["gcc", "clang"] and Version(self.settings.compiler.version) < "5.3": del self.options.with_mysql if self.settings.os == "Windows": - self.options.with_mysql = False self.options.opengl = "dynamic" del self.options.with_gssapi if self.settings.os != "Linux": @@ -204,33 +207,27 @@ def config_options(self): if self.settings.os != "Android": del self.options.android_sdk + def _debug_output(self, message): + if Version(conan_version) >= "2": + self.output.debug(message) + def configure(self): # if self.settings.os != "Linux": # self.options.with_libiconv = False # QTBUG-84708 if not self.options.gui: - del self.options.opengl - del self.options.with_vulkan - del self.options.with_freetype - del self.options.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("opengl") + self.options.rm_safe("with_vulkan") + self.options.rm_safe("with_freetype") + self.options.rm_safe("with_fontconfig") + self.options.rm_safe("with_harfbuzz") + self.options.rm_safe("with_libjpeg") + self.options.rm_safe("with_libpng") + self.options.rm_safe("with_md4c") + self.options.rm_safe("with_x11") if not self.options.with_dbus: - del self.options.with_atspi - - if not self.options.qtmultimedia: - self.options.rm_safe("with_libalsa") - del self.options.with_openal - del self.options.with_gstreamer - del self.options.with_pulseaudio - - if self.settings.os in ("FreeBSD", "Linux"): - if self.options.qtwebengine: - self.options.with_fontconfig = True + self.options.rm_safe("with_atspi") if self.options.multiconfiguration: del self.settings.build_type @@ -246,6 +243,8 @@ def configure(self): modulename = section[section.find('"') + 1: section.rfind('"')] status = str(config.get(section, "status")) if status not in ("obsolete", "ignore"): + if status not in self._module_statuses: + raise ConanException(f"module {modulename} has status {status} which is not in self._module_statuses {self._module_statuses}") submodules_tree[modulename] = {"status": status, "path": str(config.get(section, "path")), "depends": []} if config.has_option(section, "depends"): @@ -254,24 +253,75 @@ def configure(self): for m in submodules_tree: assert m in ["qtbase", "qtqa", "qtrepotools"] or m in self._submodules, "module %s is not present in recipe options : (%s)" % (m, ",".join(self._submodules)) - for m in self._submodules: - if m not in submodules_tree: - delattr(self.options, m) + for module in self._submodules: + if module not in submodules_tree: + self._debug_output(f"qt5: removing {module} from options as it is not an option for this version, or it is ignored or obsolete") + self.options.rm_safe(module) + + # Requested modules: + # - any module for non-removed options that have 'True' value + # - any enabled via `xxx_modules` that does not have a 'False' value + # Note that at this point, the submodule options dont have a value unless one is given externally + # to the recipe (e.g. via the command line, a profile, or a consumer) + requested_modules = set([module for module in self._submodules if self.options.get_safe(module)]) + for module in [m for m in self._submodules if m in submodules_tree]: + status = submodules_tree[module]['status'] + is_disabled = self.options.get_safe(module) == False + if self.options.get_safe(f"{status}_modules"): + if not is_disabled: + requested_modules.add(module) + else: + self.output.warning(f"qt5: {module} requested because {status}_modules=True" + f" but it has been explicitly disabled with {module}=False") + + self.output.info(f"qt5: requested modules {list(requested_modules)}") - def _enablemodule(mod): - if mod != "qtbase": - setattr(self.options, mod, True) - for req in submodules_tree[mod]["depends"]: - _enablemodule(req) + required_modules = {} + for module in requested_modules: + deps = submodules_tree[module]["depends"] + for dep in deps: + required_modules.setdefault(dep,[]).append(module) - for module in self._submodules: - if self.options.get_safe(module): - _enablemodule(module) + required_but_disabled = [m for m in required_modules.keys() if self.options.get_safe(m) == False] + if required_modules: + self._debug_output(f"qt5: required_modules modules {list(required_modules.keys())}") + if required_but_disabled: + required_by = set() + for m in required_but_disabled: + required_by.update(required_modules[m]) + raise ConanInvalidConfiguration(f"Modules {required_but_disabled} are explicitly disabled, " + f"but are required by {list(required_by)}, enabled by other options") + + enabled_modules = requested_modules.union(set(required_modules.keys())) + enabled_modules.discard("qtbase") + + for module in list(enabled_modules): + setattr(self.options, module, True) for module in self._submodules: if module in self.options and not self.options.get_safe(module): setattr(self.options, module, False) + if not self.options.qtmultimedia: + self.options.rm_safe("with_libalsa") + del self.options.with_openal + del self.options.with_gstreamer + del self.options.with_pulseaudio + + if self.settings.os in ("FreeBSD", "Linux"): + if self.options.qtwebengine: + self.options.with_fontconfig = True + + for status in self._module_statuses: + # These are convenience only, should not affect package_id + option_name = f"{status}_modules" + self._debug_output(f"qt5 removing convenience option: {option_name}," + f" see individual module options") + self.options.rm_safe(option_name) + + for option in self.options.items(): + self._debug_output(f"qt5 option {option[0]}={option[1]}") + def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "11") @@ -345,11 +395,11 @@ def requirements(self): 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.78.0") + 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: @@ -357,22 +407,24 @@ def requirements(self): if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: self.requires("freetype/2.13.2") if self.options.get_safe("with_fontconfig", False): - self.requires("fontconfig/2.14.2") + self.requires("fontconfig/2.15.0") if self.options.get_safe("with_icu", False): - self.requires("icu/73.2") + self.requires("icu/74.2") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: 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/3.0.0") + self.requires("libjpeg-turbo/[>=3.0 <3.1]") else: self.requires("libjpeg/9e") if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.44.2") - if self.options.get_safe("with_mysql", False): + self.requires("sqlite3/[>=3.45.0 <4]") + if self.options.get_safe("with_mysql", False) == "mysql": self.requires("libmysqlclient/8.1.0") + if self.options.get_safe("with_mysql", False) == "mariadb": + self.requires("mariadb-connector-c/3.3.3") if self.options.with_pq: self.requires("libpq/15.4") if self.options.with_odbc: @@ -391,13 +443,13 @@ def requirements(self): 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("expat/[>=2.6.2 <3]") 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.93") - self.requires("libdrm/2.4.114") + self.requires("libdrm/2.4.119") self.requires("egl/system") if self.options.get_safe("with_gstreamer", False): self.requires("gst-plugins-base/1.19.2") @@ -410,7 +462,7 @@ def requirements(self): 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.50.0") + self.requires("at-spi2-core/2.51.0") if self.options.get_safe("with_md4c", False): self.requires("md4c/0.4.8") @@ -430,9 +482,9 @@ def package_id(self): def build_requirements(self): if self._settings_build.os == "Windows" and is_msvc(self): - self.tool_requires("jom/1.1.3") + self.tool_requires("jom/[>=1.1 <2]") if self.options.qtwebengine: - self.tool_requires("ninja/1.11.1") + self.tool_requires("ninja/[>=1.12 <2]") self.tool_requires("nodejs/18.15.0") self.tool_requires("gperf/3.1") # gperf, bison, flex, python >= 2.7.5 & < 3 @@ -444,6 +496,10 @@ def build_requirements(self): if self.options.qtwayland: self.tool_requires("wayland/") + @property + def angle_path(self): + return os.path.join(self.source_folder, "angle") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True, destination="qt5") @@ -460,6 +516,10 @@ def source(self): ) save(self, os.path.join(self.source_folder, "qt5", "qtbase", "mkspecs", "features", "uikit", "bitcode.prf"), "") + # shorten the path to ANGLE to avoid the following error: + # C:\J2\w\prod-v2\bsr@4\104220\ebfcf\p\qtde01f793a6074\s\qt5\qtbase\src\3rdparty\angle\src\libANGLE\renderer\d3d\d3d11\texture_format_table_autogen.cpp : fatal error C1083: Cannot open compiler generated file: '': Invalid argument + copy(self, "*", os.path.join(self.source_folder, "qt5", "qtbase", "src", "3rdparty", "angle"), self.angle_path) + def generate(self): pc = PkgConfigDeps(self) pc.generate() @@ -472,6 +532,7 @@ def generate(self): vre.generate(scope="build") env = Environment() env.define("MAKEFLAGS", f"j{build_jobs(self)}") + env.define("ANGLE_DIR", self.angle_path) 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")) @@ -589,9 +650,6 @@ def build(self): if cross_building(self): args.append(f"-extprefix {self.package_folder}") args.append("-v") - args.append("-archdatadir %s" % os.path.join(self.package_folder, "bin", "archdatadir")) - args.append("-datadir %s" % os.path.join(self.package_folder, "bin", "datadir")) - args.append("-sysconfdir %s" % os.path.join(self.package_folder, "bin", "sysconfdir")) if self.options.commercial: args.append("-commercial") else: @@ -703,6 +761,7 @@ def build(self): ("libjpeg-turbo", "LIBJPEG"), ("libpng", "LIBPNG"), ("sqlite3", "SQLITE"), + ("mariadb-connector-c", "MYSQL"), ("libmysqlclient", "MYSQL"), ("libpq", "PSQL"), ("odbc", "ODBC"), @@ -730,12 +789,14 @@ def build(self): if "libmysqlclient" in [d.ref.name for d in self.dependencies.direct_host.values()]: args.append("-mysql_config \"%s\"" % os.path.join(self.dependencies["libmysqlclient"].package_folder, "bin", "mysql_config")) + if "mariadb-connector-c" in [d.ref.name for d in self.dependencies.direct_host.values()]: + args.append("-mysql_config \"%s\"" % os.path.join(self.dependencies["mariadb-connector-c"].package_folder, "bin", "mysql_config")) if "libpq" in [d.ref.name for d in self.dependencies.direct_host.values()]: args.append("-psql_config \"%s\"" % os.path.join(self.dependencies["libpq"].package_folder, "bin", "pg_config")) if self.settings.os == "Macos": args += ["-no-framework"] - if self.settings.arch == "armv8": - args.append('QMAKE_APPLE_DEVICE_ARCHS="arm64"') + if cross_building(self): + args.append(f"QMAKE_APPLE_DEVICE_ARCHS={to_apple_arch(self)}") elif self.settings.os == "Android": args += [f"-android-ndk-platform android-{self.settings.os.api_level}"] args += [f"-android-abis {android_abi(self)}"] @@ -802,6 +863,13 @@ def _getenvpath(var): # see https://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-rpathdir args += [f"QMAKE_RPATHDIR+=\"{libpath}\""] + if self.settings.compiler == "apple-clang" and self.options.qtmultimedia: + # XCode 14.3 finally removes std::unary_function, so compilation fails + # when using newer SDKs when using C++17 or higher. + # This macro re-enables them. Should be safe to pass this macro even + # in earlier versions, as it would have no effect. + args += ['QMAKE_CXXFLAGS+="-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION=1"'] + if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]: args += ["-qt-webengine-ffmpeg", "-system-webengine-opus", @@ -830,18 +898,7 @@ def package(self): with chdir(self, "build_folder"): self.run(f"{self._make_program()} install") save(self, os.path.join(self.package_folder, "bin", "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""") +Prefix = ..""") 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: @@ -853,6 +910,7 @@ def package(self): rm(self, "*.la*", os.path.join(self.package_folder, "lib"), recursive=True) rm(self, "*.pdb*", os.path.join(self.package_folder, "lib"), recursive=True) rm(self, "*.pdb", os.path.join(self.package_folder, "bin"), recursive=True) + rm(self, "*.pdb", os.path.join(self.package_folder, "plugins"), recursive=True) # "Qt5Bootstrap" is internal Qt library - removing it to avoid linking error, since it contains # symbols that are also in "Qt5Core.lib". It looks like there is no "Qt5Bootstrap.dll". for fl in glob.glob(os.path.join(self.package_folder, "lib", "*Qt5Bootstrap*")): @@ -953,6 +1011,11 @@ def _create_private_module(module, dependencies=[]): if self.options.qtdeclarative: _create_private_module("Qml", ["CorePrivate", "Qml"]) + if self.options.gui: + _create_private_module("Quick", ["CorePrivate", "GuiPrivate", "QmlPrivate", "Quick"]) + + if self.options.qtscxml: + _create_private_module("Scxml", ["Scxml", "Qml"]) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Qt5") @@ -1025,7 +1088,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname if not self.options.shared: self.cpp_info.components[componentname].libs = [libname + libsuffix] - self.cpp_info.components[componentname].libdirs = [os.path.join("bin", "archdatadir", "plugins", plugintype)] + self.cpp_info.components[componentname].libdirs = [os.path.join("plugins", plugintype)] self.cpp_info.components[componentname].includedirs = [] if "Core" not in requires: requires.append("Core") @@ -1050,6 +1113,9 @@ def _create_plugin(pluginname, libname, plugintype, requires): ] self.cpp_info.components["qtCore"].set_property("pkg_config_custom_content", "\n".join(pkg_config_vars)) + if self.settings.build_type != "Debug": + self.cpp_info.components['qtCore'].defines.append('QT_NO_DEBUG') + if self.settings.os == "Windows": module = "WinMain" componentname = f"qt{module}" @@ -1192,8 +1258,10 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) if self.options.with_pq: _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) - if self.options.get_safe("with_mysql", False): + if self.options.get_safe("with_mysql", False) == "mysql": _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldrivers", ["libmysqlclient::libmysqlclient"]) + if self.options.get_safe("with_mysql", False) == "mariadb": + _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldrivers", ["mariadb-connector-c::mariadb-connector-c"]) if self.options.with_odbc: if self.settings.os != "Windows": _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", ["odbc::odbc"]) @@ -1222,6 +1290,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"]) if self.options.gui: _create_module("Quick", ["Gui", "Qml", "QmlModels"]) + _add_build_module("qtQuick", self._cmake_qt5_private_file("Quick")) if self.options.widgets: _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) @@ -1310,6 +1379,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.qtscxml: _create_module("Scxml", ["Qml"]) + _add_build_module("qtScxml", self._cmake_qt5_private_file("Scxml")) if self.options.qtpurchasing: _create_module("Purchasing") @@ -1338,7 +1408,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_plugin("Scene2DPlugin", "scene2d", "renderplugins", []) _create_module("3DAnimation", ["3DRender", "3DCore", "Gui"]) - _create_module("3DInput", ["3DCore", "Gamepad", "Gui"]) + _create_module("3DInput", ["3DCore", "Gui"] + (["Gamepad"] if self.options.qtgamepad else [])) _create_module("3DLogic", ["3DCore", "Gui"]) _create_module("3DExtras", ["3DRender", "3DInput", "3DLogic", "3DCore", "Gui"]) _create_module("3DQuick", ["3DCore", "Quick", "Gui", "Qml"]) @@ -1367,8 +1437,10 @@ def _create_plugin(pluginname, libname, plugintype, requires): _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.options.with_gstreamer: + _create_plugin("CameraBinServicePlugin", "gstcamerabin", "mediaservice", []) + if self.options.get_safe("with_libalsa", False): + _create_plugin("QAlsaPlugin", "qtaudio_alsa", "audio", []) if self.settings.os == "Windows": _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) _create_plugin("DSServicePlugin", "dsengine", "mediaservice", []) @@ -1467,7 +1539,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): 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["qtCore"].builddirs.append(os.path.join("bin","archdatadir","bin")) + self.cpp_info.components["qtCore"].builddirs.append(os.path.join("bin")) _add_build_module("qtCore", self._cmake_core_extras_file) _add_build_module("qtCore", self._cmake_qt5_private_file("Core")) @@ -1482,8 +1554,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): os.path.join("lib", "cmake", "Qt5Core", "Qt5CoreConfigExtrasMkspecDir.cmake")) mkspecs_dir_begin = qt5core_config_extras_mkspec_dir_cmake.find("mkspecs/") mkspecs_dir_end = qt5core_config_extras_mkspec_dir_cmake.find("\"", mkspecs_dir_begin) - mkspecs_dir = qt5core_config_extras_mkspec_dir_cmake[mkspecs_dir_begin:mkspecs_dir_end].split('/') - mkspecs_path = os.path.join("bin", "archdatadir", *mkspecs_dir) + mkspecs_path = qt5core_config_extras_mkspec_dir_cmake[mkspecs_dir_begin:mkspecs_dir_end] assert os.path.exists(mkspecs_path) self.cpp_info.components["qtCore"].includedirs.append(mkspecs_path) diff --git a/recipes/qt/5.x.x/patches/107ed30ec5.patch b/recipes/qt/5.x.x/patches/107ed30ec5.patch deleted file mode 100644 index 3dd48a20a04ce..0000000000000 --- a/recipes/qt/5.x.x/patches/107ed30ec5.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 107ed30ec505f20f166cf7df3b99c5c73a680796 Mon Sep 17 00:00:00 2001 -From: Peter Varga -Date: Fri, 4 Mar 2022 10:42:25 +0100 -Subject: [PATCH] [Backport] Fix for non-constant SIGSTKSZ - -On glibc > 2.33, `SIGSTKSZ` might not be constant (in which case -it expands to a call to `sysconf` which returns a `long int`); see -https://sourceware.org/pipermail/libc-alpha/2020-October/118513.html - -Pass unsigned explicitly to std::max, to avoid relying on template -argument deduction. This works both with the old-style constant -`SIGSTKSZ` and the new configurable one. - -Initially based on https://chromium-review.googlesource.com/c/2776379 - -Change-Id: I2279e8423aa70987ce4537674c7291216d23062f -Review-URL: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3340721 -Reviewed-by: Allan Sandfeld Jensen ---- - .../breakpad/src/client/linux/handler/exception_handler.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc -index ca353c40997..4c73053c513 100644 ---- a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc -+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc -@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() { - // 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/qt/5.x.x/patches/337f28c9ab.patch b/recipes/qt/5.x.x/patches/337f28c9ab.patch deleted file mode 100644 index 6784be15b8cfe..0000000000000 --- a/recipes/qt/5.x.x/patches/337f28c9ab.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 -@@ -3067,7 +3067,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.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.14-macos-chromium-newer-sdks.patch b/recipes/qt/5.x.x/patches/5.15.14-macos-chromium-newer-sdks.patch new file mode 100644 index 0000000000000..cb5ec1fca2189 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.14-macos-chromium-newer-sdks.patch @@ -0,0 +1,13 @@ +diff --git a/chromium/base/strings/utf_string_conversions.cc b/chromium/base/strings/utf_string_conversions.cc +index 12ed1f3e0..004ac6855 100644 +--- a/chromium/base/strings/utf_string_conversions.cc ++++ b/chromium/base/strings/utf_string_conversions.cc +@@ -15,7 +15,7 @@ + #include "base/third_party/icu/icu_utf.h" + #include "build/build_config.h" + +-#if defined(OS_MAC) ++#if defined(OS_MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 120300 + namespace std { + inline namespace __1 { + template class basic_string; diff --git a/recipes/qt/5.x.x/patches/5.15.14-macos-qtlocation-utility-header.patch b/recipes/qt/5.x.x/patches/5.15.14-macos-qtlocation-utility-header.patch new file mode 100644 index 0000000000000..000965fda4346 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.14-macos-qtlocation-utility-header.patch @@ -0,0 +1,13 @@ +diff --git a/src/3rdparty/mapbox-gl-native/include/mbgl/util/unique_any.hpp b/src/3rdparty/mapbox-gl-native/include/mbgl/util/unique_any.hpp +index c7dc8b38e..d9e3709b1 100644 +--- a/src/3rdparty/mapbox-gl-native/include/mbgl/util/unique_any.hpp ++++ b/src/3rdparty/mapbox-gl-native/include/mbgl/util/unique_any.hpp +@@ -3,6 +3,8 @@ + #include + #include + #include ++#include ++ + namespace mbgl { + namespace util { + \ No newline at end of file diff --git a/recipes/qt/5.x.x/patches/5.15.14-macos-qtwebengine-rpath-link.patch b/recipes/qt/5.x.x/patches/5.15.14-macos-qtwebengine-rpath-link.patch new file mode 100644 index 0000000000000..2fb28c93ca411 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.14-macos-qtwebengine-rpath-link.patch @@ -0,0 +1,13 @@ +diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf +index 306e58db1..a42059e82 100644 +--- a/mkspecs/features/gn_generator.prf ++++ b/mkspecs/features/gn_generator.prf +@@ -166,7 +166,7 @@ for (flag, GN_FLAGS): GN_CONTENTS += " \"$$flag\"," + unix:!macos: GN_CONTENTS += " \"-Wl,-rpath=$${rpath}\"," + } + } +-!isEmpty(QMAKE_RPATHLINKDIR): GN_CONTENTS += " \"-Wl,-rpath-link=$${QMAKE_RPATHLINKDIR}\"," ++!isEmpty(QMAKE_LFLAGS_RPATHLINK):!isEmpty(QMAKE_RPATHLINKDIR): GN_CONTENTS += " \"-Wl,-rpath-link=$${QMAKE_RPATHLINKDIR}\"," + GN_CONTENTS += " ]" + + GN_CONTENTS += " lib_dirs = [" diff --git a/recipes/qt/5.x.x/patches/5.15.14-qtwebengine-missing-deps.patch b/recipes/qt/5.x.x/patches/5.15.14-qtwebengine-missing-deps.patch new file mode 100644 index 0000000000000..fafd46513f4b8 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.14-qtwebengine-missing-deps.patch @@ -0,0 +1,12 @@ +diff --git a/chromium/content/public/browser/BUILD.gn b/chromium/content/public/browser/BUILD.gn +index 7cf82a4..0e0dda2 100644 +--- a/chromium/content/public/browser/BUILD.gn ++++ b/chromium/content/public/browser/BUILD.gn +@@ -469,6 +469,7 @@ jumbo_source_set("browser_sources") { + "//build:chromeos_buildflags", + "//cc", + "//components/viz/host", ++ "//components/spellcheck:buildflags", + "//content/browser", # Must not be public_deps! + "//device/fido", + "//gpu", 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 deleted file mode 100644 index 1f9f0f90f6e5b..0000000000000 --- a/recipes/qt/5.x.x/patches/5.15.7-fix-qmake-default-libdirs-apple-clang-15.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- 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/Fix-errors-and-warnings-for-perfetto.patch b/recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch new file mode 100644 index 0000000000000..abd82e1674e40 --- /dev/null +++ b/recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch @@ -0,0 +1,101 @@ +From 851cd7c7a079fa5da63770c49724036e8338e813 Mon Sep 17 00:00:00 2001 +From: Michal Klocek +Date: Wed, 20 Sep 2023 07:45:29 +0200 +Subject: [PATCH] Fix errors and warnings for perfetto +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf8 +Content-Transfer-Encoding: 8bit + +It seems newest msvc compiler does not like perfetto circualar queue +const iterator, which ends in issues with std::swap of std::sort. +Make sure it is non const. + +Fix warnings. + +Deals with: "error C2672: 'swap': no matching overloaded function +found." + +Fixes: QTBUG-117073 +Change-Id: I02901e61a1bb8863d72ca02a0ccd841e54309d6e +Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/505412 +Reviewed-by: Martin Negyokru +Reviewed-by: Michael Brüning +--- + .../perfetto/include/perfetto/ext/base/circular_queue.h | 9 ++------- + .../third_party/perfetto/src/trace_processor/storage/metadata.h | 2 ++ + .../third_party/perfetto/src/trace_processor/storage/stats.h | 2 ++ + .../perfetto/src/trace_processor/tables/macros_internal.h | 2 ++ + 4 files changed, 8 insertions(+), 7 deletions(-) + +diff --git a/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h b/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h +index 18ca7702614..ec46e69f817 100644 +--- a/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h ++++ b/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h +@@ -67,19 +67,14 @@ class CircularQueue { + ignore_result(generation); + } + +- T* operator->() { ++ T* operator->() const { + #if PERFETTO_DCHECK_IS_ON() + PERFETTO_DCHECK(generation_ == queue_->generation()); + #endif + return queue_->Get(pos_); + } + +- const T* operator->() const { +- return const_cast::Iterator*>(this)->operator->(); +- } +- +- T& operator*() { return *(operator->()); } +- const T& operator*() const { return *(operator->()); } ++ T& operator*() const { return *(operator->()); } + + value_type& operator[](difference_type i) { return *(*this + i); } + +diff --git a/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h b/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h +index 4796ae4edcd..30e534b216b 100644 +--- a/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h ++++ b/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h +@@ -59,8 +59,10 @@ namespace metadata { + F(kMulti, "multi") + // clang-format + ++#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) + // Ignore GCC warning about a missing argument for a variadic macro parameter. + #pragma GCC system_header ++#endif + + #define PERFETTO_TP_META_TYPE_ENUM(varname, ...) varname + enum class KeyType : size_t { +diff --git a/chromium/third_party/perfetto/src/trace_processor/storage/stats.h b/chromium/third_party/perfetto/src/trace_processor/storage/stats.h +index 7f14803244e..30b56c62544 100644 +--- a/chromium/third_party/perfetto/src/trace_processor/storage/stats.h ++++ b/chromium/third_party/perfetto/src/trace_processor/storage/stats.h +@@ -189,7 +189,9 @@ enum Source { + }; + + // Ignore GCC warning about a missing argument for a variadic macro parameter. ++#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) + #pragma GCC system_header ++#endif + + // Declares an enum of literals (one for each stat). The enum values of each + // literal corresponds to the string index in the arrays below. +diff --git a/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h b/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h +index 875efd62e0d..1ca5068cc32 100644 +--- a/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h ++++ b/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h +@@ -140,7 +140,9 @@ class MacroTable : public Table { + } // namespace macros_internal + + // Ignore GCC warning about a missing argument for a variadic macro parameter. ++#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) + #pragma GCC system_header ++#endif + + // Basic helper macros. + #define PERFETTO_TP_NOOP(...) +-- +2.16.3 + diff --git a/recipes/qt/5.x.x/patches/QTBUG-98813.patch b/recipes/qt/5.x.x/patches/QTBUG-98813.patch deleted file mode 100644 index c7d6fe522ebcf..0000000000000 --- a/recipes/qt/5.x.x/patches/QTBUG-98813.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 7ff159da128c4f249b468f3ff972f864d243c742 Mon Sep 17 00:00:00 2001 -From: Allan Sandfeld Jensen -Date: Tue, 7 Dec 2021 10:44:51 +0100 -Subject: [PATCH] Try to fix build on Apple Monterey -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -std::basic_string::shrink_to_fit appears to not be inline - -Change-Id: I5bca251bdde433e917879947f97659973c430f54 -Fixes: QTBUG-98813 -Reviewed-by: Peter Varga -Reviewed-by: Allan Sandfeld Jensen -Reviewed-by: Michael Brüning ---- - chromium/base/strings/utf_string_conversions.cc | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/chromium/base/strings/utf_string_conversions.cc b/chromium/base/strings/utf_string_conversions.cc -index 0b55cd9e59d..12ed1f3e010 100644 ---- a/chromium/base/strings/utf_string_conversions.cc -+++ b/chromium/base/strings/utf_string_conversions.cc -@@ -15,6 +15,14 @@ - #include "base/third_party/icu/icu_utf.h" - #include "build/build_config.h" - -+#if defined(OS_MAC) -+namespace std { -+inline namespace __1 { -+template class basic_string; -+} // namespace __1 -+} // namespace std -+#endif // defined(OS_MAC) -+ - namespace base { - - namespace { diff --git a/recipes/qt/5.x.x/patches/d3396fb6fc.patch b/recipes/qt/5.x.x/patches/d3396fb6fc.patch deleted file mode 100644 index 5f832ae4c3873..0000000000000 --- a/recipes/qt/5.x.x/patches/d3396fb6fc.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d3396fb6fcf9e1846de3091ada99284e10e9ee54 Mon Sep 17 00:00:00 2001 -From: Peter Varga -Date: Fri, 10 Dec 2021 14:40:20 +0100 -Subject: [PATCH] [Backport] abseil-cpp: Fixes build with latest glibc - -Fixes https://github.com/abseil/abseil-cpp/issues/952 - -This fix is extracted from: -https://github.com/abseil/abseil-cpp/commit/a9831f1cbf93fb18dd951453635f488037454ce9 - -Change-Id: I337c8c900ef569853046bb9adc3807a3ed12b13b -Reviewed-by: Allan Sandfeld Jensen ---- - .../abseil-cpp/absl/debugging/failure_signal_handler.cc | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc b/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc -index 5d13bdbbbd1..2ed137b58f1 100644 ---- a/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc -+++ b/chromium/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc -@@ -135,7 +135,8 @@ static bool SetupAlternateStackOnce() { - #else - const size_t page_mask = sysconf(_SC_PAGESIZE) - 1; - #endif -- size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask; -+ size_t stack_size = -+ (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask; - #if defined(ABSL_HAVE_ADDRESS_SANITIZER) || \ - defined(ABSL_HAVE_MEMORY_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER) - // Account for sanitizer instrumentation requiring additional stack space. diff --git a/recipes/qt/5.x.x/patches/dece6f5.diff b/recipes/qt/5.x.x/patches/dece6f5.diff deleted file mode 100644 index cd70c3d8f67ab..0000000000000 --- a/recipes/qt/5.x.x/patches/dece6f5.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h -index e070ba977d..35a62f59e3 100644 ---- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h -+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h -@@ -43,6 +43,9 @@ - #include - #include - -+ -+#include -+ - QT_BEGIN_NAMESPACE - - class QIOSurfaceGraphicsBuffer : public QPlatformGraphicsBuffer diff --git a/recipes/qt/5.x.x/patches/ffmpeg-x86-optimization.patch b/recipes/qt/5.x.x/patches/ffmpeg-x86-optimization.patch new file mode 100644 index 0000000000000..cff8df9a43395 --- /dev/null +++ b/recipes/qt/5.x.x/patches/ffmpeg-x86-optimization.patch @@ -0,0 +1,64 @@ +Description: avcodec/x86/mathops: clip constants used with shift instructions within inline assembly + Fixes assembling with gas from binutils >= 2.41. +Origin: upstream, https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/effadce6c756247e +Bug: https://bugs.debian.org/1038132 +Last-Update: 2023-07-21 + +--- a/src/3rdparty/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h ++++ b/src/3rdparty/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h +@@ -35,12 +35,20 @@ + static av_always_inline av_const int MULL(int a, int b, unsigned shift) + { + int rt, dummy; ++ if (__builtin_constant_p(shift)) + __asm__ ( + "imull %3 \n\t" + "shrdl %4, %%edx, %%eax \n\t" + :"=a"(rt), "=d"(dummy) +- :"a"(a), "rm"(b), "ci"((uint8_t)shift) ++ :"a"(a), "rm"(b), "i"(shift & 0x1F) + ); ++ else ++ __asm__ ( ++ "imull %3 \n\t" ++ "shrdl %4, %%edx, %%eax \n\t" ++ :"=a"(rt), "=d"(dummy) ++ :"a"(a), "rm"(b), "c"((uint8_t)shift) ++ ); + return rt; + } + +@@ -113,19 +121,31 @@ __asm__ volatile(\ + // avoid +32 for shift optimization (gcc should do that ...) + #define NEG_SSR32 NEG_SSR32 + static inline int32_t NEG_SSR32( int32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("sarl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("sarl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + + #define NEG_USR32 NEG_USR32 + static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("shrl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("shrl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + diff --git a/recipes/qt/5.x.x/qtmodules5.15.7.conf b/recipes/qt/5.x.x/qtmodules5.15.12.conf similarity index 100% rename from recipes/qt/5.x.x/qtmodules5.15.7.conf rename to recipes/qt/5.x.x/qtmodules5.15.12.conf diff --git a/recipes/qt/5.x.x/qtmodules5.15.8.conf b/recipes/qt/5.x.x/qtmodules5.15.13.conf similarity index 100% rename from recipes/qt/5.x.x/qtmodules5.15.8.conf rename to recipes/qt/5.x.x/qtmodules5.15.13.conf diff --git a/recipes/qt/5.x.x/qtmodules5.15.14.conf b/recipes/qt/5.x.x/qtmodules5.15.14.conf new file mode 100644 index 0000000000000..452233655f279 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.14.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/qtmodules5.15.16.conf b/recipes/qt/5.x.x/qtmodules5.15.16.conf new file mode 100644 index 0000000000000..452233655f279 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.16.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_package/CMakeLists.txt b/recipes/qt/5.x.x/test_package/CMakeLists.txt index 0d11db68fc293..6c9a4ef2b991c 100644 --- a/recipes/qt/5.x.x/test_package/CMakeLists.txt +++ b/recipes/qt/5.x.x/test_package/CMakeLists.txt @@ -3,7 +3,7 @@ project(test_package LANGUAGES CXX) find_package(Qt5 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) -add_executable(${PROJECT_NAME} WIN32 test_package.cpp greeter.h example.qrc) +add_executable(${PROJECT_NAME} test_package.cpp greeter.h example.qrc) target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Sql Qt5::Concurrent Qt5::Xml) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC ON AUTORCC ON) diff --git a/recipes/qt/5.x.x/test_package/conanfile.py b/recipes/qt/5.x.x/test_package/conanfile.py index 5a7b088d4aa41..9146ff6c3fbe3 100644 --- a/recipes/qt/5.x.x/test_package/conanfile.py +++ b/recipes/qt/5.x.x/test_package/conanfile.py @@ -28,17 +28,6 @@ def generate(self): qt_conf = textwrap.dedent(f"""\ [Paths] Prefix = {qt_install_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 """) save(self, "qt.conf", qt_conf) diff --git a/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt b/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt index d5866335fec6a..a56d8c5c4fe51 100644 --- a/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt +++ b/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt @@ -18,6 +18,6 @@ set(CMAKE_AUTORCC ON) set(SOURCES ../test_package/test_package.cpp ../test_package/greeter.h ../test_package/example.qrc) -add_executable(${PROJECT_NAME} WIN32 ${SOURCES}) +add_executable(${PROJECT_NAME} ${SOURCES}) target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Network Qt5::Sql Qt5::Concurrent Qt5::Xml) 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 5cb2041d25d7d..45d17b452e41f 100644 --- a/recipes/qt/5.x.x/test_v1_package/conanfile.py +++ b/recipes/qt/5.x.x/test_v1_package/conanfile.py @@ -25,18 +25,7 @@ def build_requirements(self): 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('\\', '/'))) +Prefix = {}""".format(self.dependencies["qt"].package_folder.replace('\\', '/'))) def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" diff --git a/recipes/qt/6.x.x/conandata.yml b/recipes/qt/6.x.x/conandata.yml index cb7797f109eaf..13ed2f886559f 100644 --- a/recipes/qt/6.x.x/conandata.yml +++ b/recipes/qt/6.x.x/conandata.yml @@ -1,31 +1,49 @@ sources: - "6.6.1": + "6.7.3": url: - - "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": + - "https://download.qt.io/official_releases/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://download.qt.io/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.sau.edu.cn/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.cloud.tencent.com/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirror.bjtu.edu.cn/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + sha256: "a3f1d257cbb14c6536585ffccf7c203ce7017418e1a0c2ed7c316c20c729c801" + "6.6.3": 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" + - "https://download.qt.io/official_releases/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://download.qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.sau.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + sha256: "69d0348fef415da98aa890a34651e9cfb232f1bffcee289b7b4e21386bf36104" "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" @@ -46,56 +64,32 @@ sources: - "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" - - "https://qt-mirror.dannhauer.de/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.4/6.4.2/single/qt-everywhere-src-6.4.2.tar.xz" - - "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.3.2": - url: - - "https://download.qt.io/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" - - "https://qt-mirror.dannhauer.de/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" - - "https://www.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.3/6.3.2/single/qt-everywhere-src-6.3.2.tar.xz" - - "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" patches: - "6.6.1": + "6.7.3": - "base_path": "qtwebengine" "patch_description": "Workaround for too long .rps file name" "patch_file": "patches/c72097e_6.6.0.diff" - "6.6.0": + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + "patch_type": "bugfix" + "6.6.3": - "base_path": "qtwebengine" "patch_description": "Workaround for too long .rps file name" "patch_file": "patches/c72097e_6.6.0.diff" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + "patch_type": "bugfix" "6.5.3": - "base_path": "qtwebengine" "patch_description": "Workaround for too long .rps file name" "patch_file": "patches/c72097e.diff" - "6.4.2": - - base_path: "qtbase/cmake" - patch_description: "Fix pri helpers" - 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.3.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_source: "https://codereview.qt-project.org/c/qt/qtbase/+/445885" - patch_type: "bugfix" + "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" + - "base_path": "qtbase" + "patch_description": "Use absolute path in the generated header files to avoid relative path longer than 250 characters (not supported on by msvc compiler)" + "patch_file": "patches/fix-long-path-on-windows_6.5.3.patch" + "patch_type": "bugfix" + "patch_source": "https://code.qt.io/cgit/qt/qtbase.git/commit/?id=b4246a5c28472de3c4b6a85a3daf4a1d578894ab" diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 6113ac9cd6f54..383399d2c7bf3 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -1,25 +1,25 @@ import configparser import glob import os +import platform import textwrap 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, default_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout 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 - -required_conan_version = ">=1.55.0" +from conan.errors import ConanException, ConanInvalidConfiguration +required_conan_version = ">=2.0" class QtConan(ConanFile): _submodules = ["qtsvg", "qtdeclarative", "qttools", "qttranslations", "qtdoc", - "qtwayland","qtquickcontrols2", "qtquicktimeline", "qtquick3d", "qtshadertools", "qt5compat", + "qtwayland", "qtquickcontrols2", "qtquicktimeline", "qtquick3d", "qtshadertools", "qt5compat", "qtactiveqt", "qtcharts", "qtdatavis3d", "qtlottie", "qtscxml", "qtvirtualkeyboard", "qt3d", "qtimageformats", "qtnetworkauth", "qtcoap", "qtmqtt", "qtopcua", "qtmultimedia", "qtlocation", "qtsensors", "qtconnectivity", "qtserialbus", @@ -28,6 +28,8 @@ class QtConan(ConanFile): "qtspeech", "qthttpserver", "qtquick3dphysics", "qtgrpc", "qtquickeffectmaker"] _submodules += ["qtgraphs"] # new modules for qt 6.6.0 + _module_statuses = ["essential", "addon", "deprecated", "preview"] + name = "qt" description = "Qt is a cross-platform framework for graphical user interfaces." topics = ("framework", "ui") @@ -64,6 +66,7 @@ class QtConan(ConanFile): "with_gssapi": [True, False], "with_md4c": [True, False], "with_x11": [True, False], + "with_egl": [True, False], "gui": [True, False], "widgets": [True, False], @@ -75,6 +78,7 @@ class QtConan(ConanFile): "disabled_features": [None, "ANY"], } options.update({module: [True, False] for module in _submodules}) + options.update({f"{status}_modules": [True, False] for status in _module_statuses}) # this significantly speeds up windows builds no_copy_source = True @@ -107,6 +111,7 @@ class QtConan(ConanFile): "with_gssapi": False, "with_md4c": True, "with_x11": True, + "with_egl": False, "gui": True, "widgets": True, @@ -117,15 +122,14 @@ class QtConan(ConanFile): "multiconfiguration": False, "disabled_features": "", } + # essential_modules, addon_modules, deprecated_modules, preview_modules: + # these are only provided for convenience, set to False by default + default_options.update({f"{status}_modules": False for status in _module_statuses}) 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: @@ -143,13 +147,14 @@ def _get_module_tree(self): continue status = str(config.get(section, "status")) if status not in ["obsolete", "ignore", "additionalLibrary"]: + if status not in self._module_statuses: + raise ConanException(f"module {modulename} has status {status} which is not in self._module_statuses {self._module_statuses}") 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()] - return self._submodules_tree def export_sources(self): @@ -165,6 +170,7 @@ def config_options(self): self.options.with_glib = False del self.options.with_libalsa del self.options.with_x11 + del self.options.with_egl if self.settings.os == "Windows": self.options.opengl = "dynamic" @@ -172,20 +178,10 @@ def config_options(self): if self.settings.os != "Linux": self.options.qtwayland = False - for m in self._submodules: - if m not in self._get_module_tree: - delattr(self.options, m) - - @property - 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" - } + for submodule in self._submodules: + if submodule not in self._get_module_tree: + self.output.debug(f"Qt6: Removing {submodule} option as it is not in the module tree for this version, or is marked as obsolete or ignore") + self.options.rm_safe(submodule) def configure(self): if not self.options.gui: @@ -198,6 +194,54 @@ def configure(self): del self.options.with_libpng del self.options.with_md4c self.options.rm_safe("with_x11") + self.options.rm_safe("with_egl") + + if self.options.multiconfiguration: + del self.settings.build_type + + # Requested modules: + # - any module for non-removed options that have 'True' value + # - any enabled via `xxx_modules` that does not have a 'False' value + # Note that at this point, the submodule options dont have a value unless one is given externally + # to the recipe (e.g. via the command line, a profile, or a consumer) + requested_modules = set([module for module in self._submodules if self.options.get_safe(module)]) + for module in [m for m in self._submodules if m in self._get_module_tree]: + status = self._get_module_tree[module]['status'] + is_disabled = self.options.get_safe(module) == False + if self.options.get_safe(f"{status}_modules"): + if not is_disabled: + requested_modules.add(module) + else: + self.output.warning(f"qt6: {module} requested because {status}_modules=True" + f" but it has been explicitly disabled with {module}=False") + + self.output.debug(f"qt6: requested modules {list(requested_modules)}") + + required_modules = {} + for module in requested_modules: + deps = self._get_module_tree[module]["depends"] + for dep in deps: + required_modules.setdefault(dep,[]).append(module) + + required_but_disabled = [m for m in required_modules.keys() if self.options.get_safe(m) == False] + if required_modules: + self.output.debug(f"qt6: required_modules modules {list(required_modules.keys())}") + if required_but_disabled: + required_by = set() + for m in required_but_disabled: + required_by.update(required_modules[m]) + raise ConanInvalidConfiguration(f"Modules {required_but_disabled} are explicitly disabled, " + f"but are required by {list(required_by)}, enabled by other options") + + enabled_modules = requested_modules.union(set(required_modules.keys())) + enabled_modules.discard("qtbase") + + for module in list(enabled_modules): + setattr(self.options, module, True) + + for module in self._submodules: + if module in self.options and not self.options.get_safe(module): + setattr(self.options, module, False) if not self.options.get_safe("qtmultimedia"): self.options.rm_safe("with_libalsa") @@ -209,59 +253,37 @@ def configure(self): if self.options.get_safe("qtwebengine"): self.options.with_fontconfig = True - if self.options.multiconfiguration: - del self.settings.build_type + for status in self._module_statuses: + # These are convenience only, should not affect package_id + option_name = f"{status}_modules" + self.output.debug(f"qt6 removing convenience option: {option_name}," + f" see individual module options") + self.options.rm_safe(option_name) - def _enablemodule(mod): - if mod != "qtbase": - setattr(self.options, mod, True) - for req in self._get_module_tree[mod]["depends"]: - _enablemodule(req) + for option in self.options.items(): + self.output.debug(f"qt6 option: {option}") - # enable all modules which are - # - required by a module explicitely enabled by the consumer - for module in self._get_module_tree: - 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_build(self): + check_min_cppstd(self, 17) 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 \ - self.info.settings.compiler == "clang" and Version(self.info.settings.compiler.version) >= "12": - raise ConanInvalidConfiguration("qt is not supported on gcc11 and clang >= 12 on C3I until conan-io/conan-center-index#13472 is fixed\n"\ - "If your distro is modern enough (xcb >= 1.12), set environment variable NOT_ON_C3I=1") - - # C++ minimum standard required - if self.settings.compiler.get_safe("cppstd"): + skip_ci_reason = self.conf.get("user.conancenter:skip_ci_build", check_type=str) + if skip_ci_reason: + # Currently failing on CI for gcc11, see conan-io/conan-center-index#13472 + raise ConanInvalidConfiguration(skip_ci_reason) + + if self.settings_target is None: + # Raise when consumed in the host context, but allow comaptible when + # in the build context check_min_cppstd(self, 17) - minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) - if not minimum_version: - 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": + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "12": raise ConanInvalidConfiguration("apple-clang >= 12 required by qt >= 6.4.0") - if Version(self.version) >= "6.6.1" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "13.1": + if Version(self.version) >= "6.6.1" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "13": + # note: assuming that by now, any xcode 13 is updated to the latest 13.4.1 raise ConanInvalidConfiguration("apple-clang >= 13.1 is required by qt >= 6.6.1 cf QTBUG-119490") - if self.settings.compiler == "clang" and "libstdc++" in str(self.settings.compiler.libcxx): - raise ConanInvalidConfiguration("Qt needs recent libstdc++, with charconv. please switch to gcc, or to libc++") - - if self.settings.os == "Macos" and self.dependencies["double-conversion"].options.shared: - raise ConanInvalidConfiguration("Test recipe fails because of Macos' SIP. Contributions are welcome.") - if self.options.get_safe("qtwebengine"): if not self.options.shared: raise ConanInvalidConfiguration("Static builds of Qt WebEngine are not supported") @@ -302,9 +324,6 @@ def validate(self): if self.options.get_safe("qtwayland", False) and not self.dependencies.direct_host["xkbcommon"].options.with_wayland: raise ConanInvalidConfiguration("The 'with_wayland' option for the 'xkbcommon' package must be enabled when the 'qtwayland' option is enabled") - 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") @@ -321,30 +340,35 @@ def requirements(self): if self.options.with_pcre2: self.requires("pcre2/10.42") if self.options.get_safe("with_vulkan"): + # Note: the versions of vulkan-loader and moltenvk + # must be exactly part of the same Vulkan SDK version + # do not update either without checking both + # require exactly the same version of vulkan-headers self.requires("vulkan-loader/1.3.239.0") + self.requires("vulkan-headers/1.3.239.0", transitive_headers=True) if is_apple_os(self): self.requires("moltenvk/1.2.2") if self.options.with_glib: - self.requires("glib/2.78.1") + self.requires("glib/2.78.3") if self.options.with_doubleconversion and not self.options.multiconfiguration: self.requires("double-conversion/3.3.0") if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: self.requires("freetype/2.13.2") if self.options.get_safe("with_fontconfig", False): - self.requires("fontconfig/2.14.2") + self.requires("fontconfig/2.15.0") if self.options.get_safe("with_icu", False): - self.requires("icu/74.1") + self.requires("icu/74.2") if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: 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/3.0.1") + self.requires("libjpeg-turbo/[>=3.0 <3.1]") else: self.requires("libjpeg/9e") if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_sqlite3 and not self.options.multiconfiguration: - self.requires("sqlite3/3.44.2") + self.requires("sqlite3/[>=3.45.0 <4]") if self.options.get_safe("with_mysql", False): self.requires("libmysqlclient/8.1.0") if self.options.with_pq: @@ -360,6 +384,8 @@ def requirements(self): self.requires("xkbcommon/1.5.0") if self.options.get_safe("with_x11", False): self.requires("xorg/system") + if self.options.get_safe("with_egl"): + self.requires("egl/system") if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": self.requires("opengl/system") if self.options.with_zstd: @@ -369,18 +395,19 @@ def requirements(self): if self.options.with_brotli: 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("expat/[>=2.6.2 <3]") self.requires("opus/1.4") self.requires("xorg-proto/2022.2") self.requires("libxshmfence/1.3") self.requires("nss/3.93") - self.requires("libdrm/2.4.114") + self.requires("libdrm/2.4.119") if self.options.get_safe("with_gstreamer", False): + self.requires("gstreamer/1.19.2") 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.6") + 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): @@ -388,17 +415,15 @@ def requirements(self): def build_requirements(self): self.tool_requires("cmake/[>=3.21.1 <4]") - self.tool_requires("ninja/1.11.1") + self.tool_requires("ninja/[>=1.12 <2]") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") - if self.settings.os == "Windows": - self.tool_requires('strawberryperl/5.32.1.1') + self.tool_requires("pkgconf/[>=2.2 <3]") if self.options.get_safe("qtwebengine"): self.tool_requires("nodejs/18.15.0") self.tool_requires("gperf/3.1") # gperf, bison, flex, python >= 2.7.5 & < 3 - if self._settings_build.os == "Windows": + if self.settings_build.os == "Windows": self.tool_requires("winflexbison/2.5.25") else: self.tool_requires("bison/3.8.2") @@ -421,6 +446,16 @@ def generate(self): tc.set_property("wayland::wayland-server", "cmake_target_name", "Wayland::Server") tc.set_property("wayland::wayland-cursor", "cmake_target_name", "Wayland::Cursor") tc.set_property("wayland::wayland-egl", "cmake_target_name", "Wayland::Egl") + + # override https://github.com/qt/qtbase/blob/dev/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake + tc.set_property("egl", "cmake_file_name", "EGL") + tc.set_property("egl", "cmake_find_mode", "module") + tc.set_property("egl::egl", "cmake_target_name", "EGL::EGL") + + # don't override https://github.com/qt/qtmultimedia/blob/dev/cmake/FindGStreamer.cmake + tc.set_property("gstreamer", "cmake_file_name", "gstreamer_conan") + tc.set_property("gstreamer", "cmake_find_mode", "module") + tc.generate() for f in glob.glob("*.cmake"): @@ -441,7 +476,7 @@ def generate(self): 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": + 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") @@ -456,12 +491,7 @@ def generate(self): tc = CMakeToolchain(self, generator="Ninja") - package_folder = self.package_folder.replace('\\', '/') - tc.variables["INSTALL_MKSPECSDIR"] = f"{package_folder}/res/archdatadir/mkspecs" - tc.variables["INSTALL_ARCHDATADIR"] = f"{package_folder}/res/archdatadir" - tc.variables["INSTALL_LIBEXECDIR"] = f"{package_folder}/bin" - tc.variables["INSTALL_DATADIR"] = f"{package_folder}/res/datadir" - tc.variables["INSTALL_SYSCONFDIR"] = f"{package_folder}/res/sysconfdir" + tc.absolute_paths = True tc.variables["QT_BUILD_TESTS"] = "OFF" tc.variables["QT_BUILD_EXAMPLES"] = "OFF" @@ -495,8 +525,8 @@ def generate(self): tc.variables["QT_FEATURE_openssl_linked"] = "ON" # 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) + # Required for qt_config_compile_test() calls against CMakeDeps targets to work correctly. + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) if self.options.with_dbus: tc.variables["INPUT_dbus"] = "linked" @@ -504,6 +534,16 @@ def generate(self): tc.variables["FEATURE_dbus"] = "OFF" tc.variables["CMAKE_FIND_DEBUG_MODE"] = "FALSE" + if not self.options.with_zstd: + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_WrapZSTD"] = "ON" + + if not self.options.get_safe("with_vulkan"): + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_WrapVulkanHeaders"] = "ON" + + # Prevent finding LibClang from the system + # this is needed by the QDoc tool inside Qt Tools + # See: https://github.com/conan-io/conan-center-index/issues/24729#issuecomment-2255291495 + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_WrapLibClang"] = "ON" for opt, conf_arg in [("with_glib", "glib"), ("with_icu", "icu"), @@ -516,7 +556,9 @@ def generate(self): ("with_zstd", "zstd"), ("with_vulkan", "vulkan"), ("with_brotli", "brotli"), - ("with_gssapi", "gssapi")]: + ("with_gssapi", "gssapi"), + ("with_egl", "egl"), + ("with_gstreamer", "gstreamer")]: tc.variables[f"FEATURE_{conf_arg}"] = ("ON" if self.options.get_safe(opt, False) else "OFF") @@ -560,7 +602,7 @@ def generate(self): tc.variables["FEATURE_framework"] = "OFF" elif self.settings.os == "Android": tc.variables["CMAKE_ANDROID_NATIVE_API_LEVEL"] = self.settings.os.api_level - tc.variables["ANDROID_ABI"] = {"armv7": "armeabi-v7a", + tc.variables["ANDROID_ABI"] = {"armv7": "armeabi-v7a", "armv8": "arm64-v8a", "x86": "x86", "x86_64": "x86_64"}.get(str(self.settings.arch)) @@ -579,14 +621,17 @@ def generate(self): 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 + # Mainly to locate Qt6HostInfoConfig.cmake + tc.cache_variables["QT_HOST_PATH"] = self.dependencies.direct_build["qt"].package_folder + # Stand-in for Qt6CoreTools - which is loaded for the executable targets + tc.cache_variables["CMAKE_PROJECT_Qt_INCLUDE"] = os.path.join(self.dependencies.direct_build["qt"].package_folder, self._cmake_executables_file) + # Ensure tools for host are always built + tc.cache_variables["QT_FORCE_BUILD_TOOLS"] = True 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 + tc.variables["BUILD_WITH_PCH"] = "OFF" # disabling PCH to save disk space - if self.settings.os == "Windows": - 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" @@ -597,12 +642,11 @@ def generate(self): 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" - - for std,feature in cpp_std_map.items(): + 20: "FEATURE_cxx20", + 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["QT_USE_VCPKG"] = False @@ -621,19 +665,16 @@ def package_id(self): 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.info.settings.os == "Windows": + if platform.system() == "Windows": # Don't use os.path.join, or it removes the \\?\ prefix, which enables long paths 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) 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"), @@ -641,9 +682,6 @@ def source(self): " if (enable_precompiled_headers) {\n if (false) {" ) - replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "QtInternalTargets.cmake"), - "-Zc:wchar_t", - "-Zc:wchar_t -Zc:twoPhase-") for f in ["FindPostgreSQL.cmake"]: file = os.path.join(self.source_folder, "qtbase", "cmake", f) if os.path.isfile(file): @@ -654,11 +692,18 @@ def source(self): 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()") + replace_in_file(self, + os.path.join(self.source_folder, "qtbase", "cmake", "QtAutoDetect.cmake" if Version(self.version) < "6.6.2" else "QtAutoDetectHelpers.cmake"), + "qt_auto_detect_vcpkg()", + "# qt_auto_detect_vcpkg()") + + # Handle locating moltenvk headers when vulkan is enabled on macOS + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "FindWrapVulkanHeaders.cmake"), + "if(APPLE)", "if(APPLE)\n" + " find_package(moltenvk REQUIRED QUIET)\n" + " target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE ${moltenvk_INCLUDE_DIR})" + ) def _xplatform(self): if self.settings.os == "Linux": @@ -760,8 +805,8 @@ def _xplatform(self): def build(self): if self.settings.os == "Macos": - save(self, ".qmake.stash" , "") - save(self, ".qmake.super" , "") + save(self, ".qmake.stash", "") + save(self, ".qmake.super", "") cmake = CMake(self) cmake.configure() cmake.build() @@ -779,8 +824,8 @@ def _cmake_qt6_private_file(self, module): def package(self): if self.settings.os == "Macos": - save(self, ".qmake.stash" , "") - save(self, ".qmake.super" , "") + 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"), @@ -790,16 +835,22 @@ def package(self): 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"]: - rm(self, mask, self.package_folder, recursive=True) + rm(self, mask, self.package_folder, recursive=True, excludes="Qt6HostInfoConfig.cmake") rm(self, "*.la*", os.path.join(self.package_folder, "lib"), recursive=True) rm(self, "*.pdb*", self.package_folder, recursive=True) rm(self, "ensure_pro_file.cmake", self.package_folder, recursive=True) - os.remove(os.path.join(self.package_folder, "bin", "qt-cmake-private-install.cmake")) + os.remove(os.path.join(self.package_folder, "libexec" if self.settings.os != "Windows" else "bin", "qt-cmake-private-install.cmake")) for m in os.listdir(os.path.join(self.package_folder, "lib", "cmake")): - module = os.path.join(self.package_folder, "lib", "cmake", m, f"{m}Macros.cmake") - helper_modules = glob.glob(os.path.join(self.package_folder, "lib", "cmake", m, "QtPublic*Helpers.cmake")) - if not os.path.isfile(module) and not helper_modules: + if os.path.isfile(os.path.join(self.package_folder, "lib", "cmake", m, f"{m}Macros.cmake")): + continue + if glob.glob(os.path.join(self.package_folder, "lib", "cmake", m, "QtPublic*Helpers.cmake")): + continue + if m.endswith("Tools"): + if os.path.isfile(os.path.join(self.package_folder, "lib", "cmake", m, f"{m[:-5]}Macros.cmake")): + continue + + if m != "Qt6HostInfo": rmdir(self, os.path.join(self.package_folder, "lib", "cmake", m)) extension = "" @@ -810,14 +861,16 @@ def package(self): filecontents += f"set(QT_VERSION_MAJOR {ver.major})\n" filecontents += f"set(QT_VERSION_MINOR {ver.minor})\n" filecontents += f"set(QT_VERSION_PATCH {ver.patch})\n" - targets = ["moc", "rcc", "tracegen", "cmake_automoc_parser", "qlalr", "qmake"] + if self.settings.os == "Macos": + filecontents += 'set(__qt_internal_cmake_apple_support_files_path "${CMAKE_CURRENT_LIST_DIR}/../../../lib/cmake/Qt6/macos")\n' + targets = ["moc", "qlalr", "rcc", "tracegen", "cmake_automoc_parser", "qmake", "qtpaths", "syncqt", "tracepointgen"] if self.options.with_dbus: targets.extend(["qdbuscpp2xml", "qdbusxml2cpp"]) if self.options.gui: targets.append("qvkgen") if self.options.widgets: targets.append("uic") - if self._settings_build.os == "Macos" and self.settings.os != "iOS": + if self.settings_build.os == "Macos" and self.settings.os != "iOS": targets.extend(["macdeployqt"]) if self.settings.os == "Windows": targets.extend(["windeployqt"]) @@ -828,7 +881,8 @@ def package(self): targets.append("qsb") if self.options.qtdeclarative: targets.extend(["qmltyperegistrar", "qmlcachegen", "qmllint", "qmlimportscanner"]) - targets.extend(["qmlformat", "qml", "qmlprofiler", "qmlpreview", "qmltestrunner"]) + targets.extend(["qmlformat", "qml", "qmlprofiler", "qmlpreview"]) + # Note: consider "qmltestrunner", see https://github.com/conan-io/conan-center-index/issues/24276 if self.options.get_safe("qtremoteobjects"): targets.append("repc") if self.options.get_safe("qtscxml"): @@ -836,10 +890,13 @@ def package(self): for target in targets: exe_path = None for path_ in [f"bin/{target}{extension}", - f"lib/{target}{extension}"]: + f"lib/{target}{extension}", + f"libexec/{target}{extension}"]: if os.path.isfile(os.path.join(self.package_folder, path_)): exe_path = path_ break + else: + assert False, f"Could not find executable {target}{extension} in {self.package_folder}" if not exe_path: self.output.warning(f"Could not find path to {target}{extension}") filecontents += textwrap.dedent(f"""\ @@ -890,6 +947,8 @@ def _create_private_module(module, dependencies): 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.options.gui and self.options.qtshadertools: + _create_private_module("Quick", ["CorePrivate", "GuiPrivate", "QmlPrivate", "Quick"]) if self.settings.os in ["Windows", "iOS"]: contents = textwrap.dedent("""\ @@ -910,12 +969,9 @@ 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" - # consumers will need the QT_PLUGIN_PATH defined in runenv - self.runenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "res", "archdatadir", "plugins")) - self.buildenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "res", "archdatadir", "plugins")) + self.runenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "plugins")) + self.buildenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "plugins")) self.buildenv_info.define("QT_HOST_PATH", self.package_folder) @@ -924,8 +980,6 @@ def _add_build_module(component, module): if component not in build_modules: build_modules[component] = [] build_modules[component].append(module) - self.cpp_info.components[component].build_modules["cmake_find_package"].append(module) - self.cpp_info.components[component].build_modules["cmake_find_package_multi"].append(module) libsuffix = "" if self.settings.build_type == "Debug": @@ -950,8 +1004,6 @@ def _create_module(module, requires, has_include_dir=True): 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"): libname = module[:-7] else: @@ -968,11 +1020,9 @@ def _create_plugin(pluginname, libname, plugintype, requires): componentname = f"qt{pluginname}" assert componentname not in self.cpp_info.components, f"Plugin {pluginname} already present in self.cpp_info.components" self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt6::{pluginname}") - self.cpp_info.components[componentname].names["cmake_find_package"] = pluginname - self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname if not self.options.shared: self.cpp_info.components[componentname].libs = [libname + libsuffix] - self.cpp_info.components[componentname].libdirs = [os.path.join("res", "archdatadir", "plugins", plugintype)] + self.cpp_info.components[componentname].libdirs = [os.path.join("plugins", plugintype)] self.cpp_info.components[componentname].includedirs = [] if "Core" not in requires: requires.append("Core") @@ -995,11 +1045,13 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_module("Core", core_reqs) pkg_config_vars = [ "bindir=${prefix}/bin", - "libexecdir=${prefix}/bin", + "libexecdir=${prefix}/libexec", "exec_prefix=${prefix}", ] self.cpp_info.components["qtCore"].set_property("pkg_config_custom_content", "\n".join(pkg_config_vars)) + if self.settings.build_type != "Debug": + self.cpp_info.components['qtCore'].defines.append('QT_NO_DEBUG') if self.settings.os == "Windows": self.cpp_info.components["qtCore"].system_libs.append("authz") if is_msvc(self): @@ -1008,11 +1060,15 @@ def _create_plugin(pluginname, libname, plugintype, requires): 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())] + self.cpp_info.components["qtPlatform"].includedirs = [os.path.join("mkspecs", self._xplatform())] if self.options.with_dbus: _create_module("DBus", ["dbus::dbus"]) + if self.settings.os == "Windows": + # https://github.com/qt/qtbase/blob/v6.6.1/src/dbus/CMakeLists.txt#L71-L77 + self.cpp_info.components["qtDBus"].system_libs.append("advapi32") + self.cpp_info.components["qtDBus"].system_libs.append("netapi32") + self.cpp_info.components["qtDBus"].system_libs.append("user32") + self.cpp_info.components["qtDBus"].system_libs.append("ws2_32") if self.options.gui: gui_reqs = [] if self.options.with_dbus: @@ -1028,10 +1084,13 @@ def _create_plugin(pluginname, libname, plugintype, requires): gui_reqs.append("xkbcommon::xkbcommon") if self.options.get_safe("with_x11", False): gui_reqs.append("xorg::xorg") + if self.options.get_safe("with_egl"): + gui_reqs.append("egl::egl") if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": gui_reqs.append("opengl::opengl") if self.options.get_safe("with_vulkan", False): gui_reqs.append("vulkan-loader::vulkan-loader") + gui_reqs.append("vulkan-headers::vulkan-headers") if is_apple_os(self): gui_reqs.append("moltenvk::moltenvk") if self.options.with_harfbuzz: @@ -1045,27 +1104,76 @@ def _create_plugin(pluginname, libname, plugintype, requires): _add_build_module("qtGui", self._cmake_qt6_private_file("Gui")) if self.settings.os == "Windows": - self.cpp_info.components["qtGui"].system_libs = ["advapi32", "gdi32", "ole32", "shell32", "user32", "d3d11", - "dxgi", "dxguid", "d2d1", "dwrite", "d3d9", "setupapi", "SHCore"] + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L419-L429 + self.cpp_info.components["qtGui"].system_libs += [ + "advapi32", "gdi32", "ole32", "shell32", "user32", "d3d11", "dxgi", "dxguid" + ] + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L729 + self.cpp_info.components["qtGui"].system_libs.append("d2d1") + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L732-L742 + self.cpp_info.components["qtGui"].system_libs.append("dwrite") if self.settings.compiler == "gcc": + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L746 self.cpp_info.components["qtGui"].system_libs.append("uuid") + if Version(self.version) >= "6.6.0": + # https://github.com/qt/qtbase/blob/v6.6.0/src/gui/CMakeLists.txt#L428 + self.cpp_info.components["qtGui"].system_libs.append("d3d12") + if Version(self.version) >= "6.7.0": + # https://github.com/qt/qtbase/blob/v6.7.0-beta1/src/gui/CMakeLists.txt#L430 + self.cpp_info.components["qtGui"].system_libs.append("uxtheme") + if self.settings.compiler == "gcc": + self.cpp_info.components["qtGui"].system_libs.append("uuid") + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/direct2d/CMakeLists.txt#L60-L82 + self.cpp_info.components["qtGui"].system_libs += [ + "advapi32", "d2d1", "d3d11", "dwmapi", "dwrite", "dxgi", "dxguid", "gdi32", "imm32", "ole32", + "oleaut32", "setupapi", "shell32", "shlwapi", "user32", "version", "winmm", "winspool", + "wtsapi32", "shcore", "comdlg32", "d3d9", "runtimeobject" + ] _create_plugin("QWindowsIntegrationPlugin", "qwindows", "platforms", ["Core", "Gui"]) - _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", ["Core", "Gui"]) - self.cpp_info.components["qtQWindowsIntegrationPlugin"].system_libs = ["advapi32", "dwmapi", "gdi32", "imm32", - "ole32", "oleaut32", "shell32", "shlwapi", "user32", "winmm", "winspool", "wtsapi32"] + # https://github.com/qt/qtbase/commit/65d58e6c41e3c549c89ea4f05a8e467466e79ca3 + if Version(self.version) >= "6.7.0": + _create_plugin("QModernWindowsStylePlugin", "qmodernwindowsstyle", "styles", ["Core", "Gui"]) + else: + _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", ["Core", "Gui"]) + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/windows/CMakeLists.txt#L53-L69 + self.cpp_info.components["qtQWindowsIntegrationPlugin"].system_libs += [ + "advapi32", "dwmapi", "gdi32", "imm32", "ole32", "oleaut32", "setupapi", "shell32", "shlwapi", + "user32", "winmm", "winspool", "wtsapi32", "shcore", "comdlg32", "d3d9", "runtimeobject" + ] elif self.settings.os == "Android": _create_plugin("QAndroidIntegrationPlugin", "qtforandroid", "platforms", ["Core", "Gui"]) + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/android/CMakeLists.txt#L68-L70 self.cpp_info.components["qtQAndroidIntegrationPlugin"].system_libs = ["android", "jnigraphics"] - elif self.settings.os == "Macos": - _create_plugin("QCocoaIntegrationPlugin", "qcocoa", "platforms", ["Core", "Gui"]) - self.cpp_info.components["QCocoaIntegrationPlugin"].frameworks = ["AppKit", "Carbon", "CoreServices", "CoreVideo", - "IOKit", "IOSurface", "Metal", "QuartzCore"] - elif self.settings.os in ["iOS", "tvOS"]: - _create_plugin("QIOSIntegrationPlugin", "qios", "platforms", []) - self.cpp_info.components["QIOSIntegrationPlugin"].frameworks = ["AudioToolbox", "Foundation", "Metal", - "QuartzCore", "UIKit"] - elif self.settings.os == "watchOS": - _create_plugin("QMinimalIntegrationPlugin", "qminimal", "platforms", []) + elif is_apple_os(self): + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L388-L394 + self.cpp_info.components["qtGui"].frameworks = ["CoreFoundation", "CoreGraphics", "CoreText", "Foundation", "ImageIO"] + if self.options.get_safe("opengl", "no") != "no": + # https://github.com/qt/qtbase/commit/2ed63e587eefb246dba9e69aa01fdb2abb2def13 + self.cpp_info.components["qtGui"].frameworks.append("AGL") + if self.settings.os == "Macos": + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L362-L370 + self.cpp_info.components["qtGui"].frameworks += ["AppKit", "Carbon"] + _create_plugin("QCocoaIntegrationPlugin", "qcocoa", "platforms", ["Core", "Gui"]) + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/cocoa/CMakeLists.txt#L51-L58 + self.cpp_info.components["QCocoaIntegrationPlugin"].frameworks = [ + "AppKit", "Carbon", "CoreServices", "CoreVideo", "IOKit", "IOSurface", "Metal", "QuartzCore" + ] + if self.settings.os in ["Macos", "iOS"]: + # https://github.com/qt/qtbase/blob/v6.5.3/src/gui/CMakeLists.txt#L963 + self.cpp_info.components["qtGui"].frameworks.append("Metal") + if self.settings.os in ["iOS", "tvOS"]: + _create_plugin("QIOSIntegrationPlugin", "qios", "platforms", []) + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/ios/CMakeLists.txt#L32-L37 + self.cpp_info.components["QIOSIntegrationPlugin"].frameworks = [ + "AudioToolbox", "Foundation", "Metal", "QuartzCore", "UIKit", "CoreGraphics" + ] + if self.settings.os != "tvOS": + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/ios/CMakeLists.txt#L66-L68 + self.cpp_info.components["QIOSIntegrationPlugin"].frameworks += [ + "AssetsLibrary", "UniformTypeIdentifiers", "Photos", + ] + elif self.settings.os == "watchOS": + _create_plugin("QMinimalIntegrationPlugin", "qminimal", "platforms", []) elif self.settings.os == "Emscripten": _create_plugin("QWasmIntegrationPlugin", "qwasm", "platforms", ["Core", "Gui"]) elif self.options.get_safe("with_x11", False): @@ -1087,8 +1195,11 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.with_pq: _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) if self.options.with_odbc: + _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", []) if self.settings.os != "Windows": - _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", ["odbc::odbc"]) + self.cpp_info.components["QODBCDriverPlugin"].requires.append("odbc::odbc") + else: + self.cpp_info.components["QODBCDriverPlugin"].system_libs.append("odbc32") networkReqs = [] if self.options.openssl: networkReqs.append("openssl::openssl") @@ -1102,6 +1213,11 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.widgets: _create_module("Widgets", ["Gui"]) _add_build_module("qtWidgets", self._cmake_qt6_private_file("Widgets")) + if self.settings.os == "Windows": + # https://github.com/qt/qtbase/blob/v6.6.1/src/widgets/CMakeLists.txt#L316-L321 + self.cpp_info.components["qtWidgets"].system_libs += [ + "dwmapi", "shell32", "uxtheme", + ] if self.options.gui and self.options.widgets: _create_module("PrintSupport", ["Gui", "Widgets"]) if self.options.get_safe("opengl", "no") != "no" and self.options.gui: @@ -1122,11 +1238,10 @@ def _create_plugin(pluginname, libname, plugintype, requires): _add_build_module("qtQml", self._cmake_qt6_private_file("Qml")) _create_module("QmlModels", ["Qml"]) self.cpp_info.components["qtQmlImportScanner"].set_property("cmake_target_name", "Qt6::QmlImportScanner") - self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package"] = "QmlImportScanner" # this is an alias for Qml and there to integrate with existing consumers - self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package_multi"] = "QmlImportScanner" self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"]) if qt_quick_enabled: _create_module("Quick", ["Gui", "Qml", "QmlModels"]) + _add_build_module("qtQuick", self._cmake_qt6_private_file("Quick")) if self.options.widgets: _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) @@ -1135,8 +1250,6 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.qttools and self.options.gui and self.options.widgets: self.cpp_info.components["qtLinguistTools"].set_property("cmake_target_name", "Qt6::LinguistTools") - self.cpp_info.components["qtLinguistTools"].names["cmake_find_package"] = "LinguistTools" - self.cpp_info.components["qtLinguistTools"].names["cmake_find_package_multi"] = "LinguistTools" _create_module("UiPlugin", ["Gui", "Widgets"]) self.cpp_info.components["qtUiPlugin"].libs = [] # this is a collection of abstract classes, so this is header-only self.cpp_info.components["qtUiPlugin"].libdirs = [] @@ -1153,7 +1266,7 @@ 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 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"]) @@ -1242,7 +1355,9 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.qtdeclarative and qt_quick_enabled: _create_module("MultimediaQuick", ["Multimedia", "Quick"]) if self.options.with_gstreamer: - _create_plugin("QGstreamerMediaPlugin", "gstreamermediaplugin", "multimedia", ["gst-plugins-base::gst-plugins-base"]) + _create_plugin("QGstreamerMediaPlugin", "gstreamermediaplugin", "multimedia", [ + "gstreamer::gstreamer", + "gst-plugins-base::gst-plugins-base"]) if self.options.get_safe("qtpositioning"): _create_module("Positioning", []) @@ -1312,21 +1427,15 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.settings.os in ["Windows", "iOS"]: if self.settings.os == "Windows": self.cpp_info.components["qtEntryPointImplementation"].set_property("cmake_target_name", "Qt6::EntryPointImplementation") - self.cpp_info.components["qtEntryPointImplementation"].names["cmake_find_package"] = "EntryPointImplementation" - self.cpp_info.components["qtEntryPointImplementation"].names["cmake_find_package_multi"] = "EntryPointImplementation" self.cpp_info.components["qtEntryPointImplementation"].libs = [f"Qt6EntryPoint{libsuffix}"] self.cpp_info.components["qtEntryPointImplementation"].system_libs = ["shell32"] if self.settings.compiler == "gcc": self.cpp_info.components["qtEntryPointMinGW32"].set_property("cmake_target_name", "Qt6::EntryPointMinGW32") - self.cpp_info.components["qtEntryPointMinGW32"].names["cmake_find_package"] = "EntryPointMinGW32" - self.cpp_info.components["qtEntryPointMinGW32"].names["cmake_find_package_multi"] = "EntryPointMinGW32" self.cpp_info.components["qtEntryPointMinGW32"].system_libs = ["mingw32"] self.cpp_info.components["qtEntryPointMinGW32"].requires = ["qtEntryPointImplementation"] self.cpp_info.components["qtEntryPointPrivate"].set_property("cmake_target_name", "Qt6::EntryPointPrivate") - self.cpp_info.components["qtEntryPointPrivate"].names["cmake_find_package"] = "EntryPointPrivate" - self.cpp_info.components["qtEntryPointPrivate"].names["cmake_find_package_multi"] = "EntryPointPrivate" if self.settings.os == "Windows": if self.settings.compiler == "gcc": self.cpp_info.components["qtEntryPointPrivate"].defines.append("QT_NEEDS_QMAIN") @@ -1341,28 +1450,72 @@ def _create_plugin(pluginname, libname, plugintype, requires): if not self.options.shared: if self.settings.os == "Windows": - self.cpp_info.components["qtCore"].system_libs.append("version") # qtcore requires "GetFileVersionInfoW" and "VerQueryValueW" which are in "Version.lib" library - self.cpp_info.components["qtCore"].system_libs.append("winmm") # qtcore requires "__imp_timeSetEvent" which is in "Winmm.lib" library - self.cpp_info.components["qtCore"].system_libs.append("netapi32") # qtcore requires "NetApiBufferFree" which is in "Netapi32.lib" library - self.cpp_info.components["qtCore"].system_libs.append("userenv") # qtcore requires "__imp_GetUserProfileDirectoryW " which is in "UserEnv.Lib" library - self.cpp_info.components["qtCore"].system_libs.append("ws2_32") # qtcore requires "WSAStartup " which is in "Ws2_32.Lib" library - self.cpp_info.components["qtNetwork"].system_libs.append("dnsapi") # qtnetwork from qtbase requires "DnsFree" which is in "Dnsapi.lib" library + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L527-L541 + self.cpp_info.components["qtCore"].system_libs.append("advapi32") + self.cpp_info.components["qtCore"].system_libs.append("authz") + self.cpp_info.components["qtCore"].system_libs.append("kernel32") + self.cpp_info.components["qtCore"].system_libs.append("netapi32") + self.cpp_info.components["qtCore"].system_libs.append("ole32") + self.cpp_info.components["qtCore"].system_libs.append("shell32") + self.cpp_info.components["qtCore"].system_libs.append("user32") + self.cpp_info.components["qtCore"].system_libs.append("uuid") + self.cpp_info.components["qtCore"].system_libs.append("version") + self.cpp_info.components["qtCore"].system_libs.append("winmm") + self.cpp_info.components["qtCore"].system_libs.append("ws2_32") + self.cpp_info.components["qtCore"].system_libs.append("mpr") + self.cpp_info.components["qtCore"].system_libs.append("userenv") + # https://github.com/qt/qtbase/blob/v6.6.1/src/network/CMakeLists.txt#L196-L200 + self.cpp_info.components["qtNetwork"].system_libs.append("advapi32") + self.cpp_info.components["qtNetwork"].system_libs.append("dnsapi") self.cpp_info.components["qtNetwork"].system_libs.append("iphlpapi") - self.cpp_info.components["qtNetwork"].system_libs.extend(["winhttp", "secur32"]) - + self.cpp_info.components["qtNetwork"].system_libs.append("secur32") + self.cpp_info.components["qtNetwork"].system_libs.append("winhttp") + # https://github.com/qt/qtbase/blob/v6.6.1/src/printsupport/CMakeLists.txt#L70-L75 + self.cpp_info.components["qtPrintSupport"].system_libs.append("gdi32") + self.cpp_info.components["qtPrintSupport"].system_libs.append("user32") + self.cpp_info.components["qtPrintSupport"].system_libs.append("comdlg32") + self.cpp_info.components["qtPrintSupport"].system_libs.append("winspool") - if self.settings.os == "Macos": - 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 + if is_apple_os(self): + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L580-L584 + self.cpp_info.components["qtCore"].frameworks.append("CoreFoundation") + self.cpp_info.components["qtCore"].frameworks.append("Foundation") + self.cpp_info.components["qtCore"].frameworks.append("IOKit") + # https://github.com/qt/qtbase/blob/v6.6.1/src/network/CMakeLists.txt#L205-L214 + self.cpp_info.components["qtNetwork"].frameworks.append("CFNetwork") + # https://github.com/qt/qtbase/blob/v6.6.1/src/network/CMakeLists.txt#L216-L221 + # qtcore requires "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework + self.cpp_info.components["qtCore"].frameworks.append("Cocoa") self.cpp_info.components["qtNetwork"].system_libs.append("resolv") - self.cpp_info.components["qtNetwork"].frameworks.append("SystemConfiguration") if self.options.with_gssapi: + # https://github.com/qt/qtbase/blob/v6.6.1/src/network/CMakeLists.txt#L250C56-L253 self.cpp_info.components["qtNetwork"].frameworks.append("GSS") if self.options.gui and self.options.widgets: + # https://github.com/qt/qtbase/blob/v6.6.1/src/printsupport/CMakeLists.txt#L52-L63 self.cpp_info.components["qtPrintSupport"].system_libs.append("cups") + self.cpp_info.components["qtPrintSupport"].frameworks.append("ApplicationServices") + if self.settings.os == "Macos": + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L598-L606 + self.cpp_info.components["qtCore"].frameworks.append("AppKit") + self.cpp_info.components["qtCore"].frameworks.append("ApplicationServices") + self.cpp_info.components["qtCore"].frameworks.append("CoreServices") + self.cpp_info.components["qtCore"].frameworks.append("CoreServices") + self.cpp_info.components["qtCore"].frameworks.append("Security") + self.cpp_info.components["qtCore"].frameworks.append("DiskArbitration") + else: + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L969-L972 + self.cpp_info.components["qtCore"].frameworks.append("MobileCoreServices") + if self.settings.os not in ["iOS", "tvOS"]: + self.cpp_info.components["qtNetwork"].frameworks.append("CoreServices") + self.cpp_info.components["qtNetwork"].frameworks.append("SystemConfiguration") + else: + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L1074-L1077 + self.cpp_info.components["qtCore"].frameworks.append("UIKit") + if self.settings.os == "watchOS": + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L1079-L1082 + self.cpp_info.components["qtCore"].frameworks.append("WatchKit") - self.cpp_info.components["qtCore"].builddirs.append(os.path.join("res","archdatadir","bin")) + self.cpp_info.components["qtCore"].builddirs.append(os.path.join("bin")) _add_build_module("qtCore", self._cmake_executables_file) _add_build_module("qtCore", self._cmake_qt6_private_file("Core")) if self.settings.os in ["Windows", "iOS"]: @@ -1373,17 +1526,24 @@ def _create_plugin(pluginname, libname, plugintype, requires): 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) + if component_name in self.cpp_info.components: + 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) - module = os.path.join("lib", "cmake", m, f"{m}ConfigExtras.cmake") - if os.path.isfile(module): - _add_build_module(component_name, module) + for helper_modules in glob.glob(os.path.join(self.package_folder, "lib", "cmake", m, "QtPublic*Helpers.cmake")): + _add_build_module(component_name, helper_modules) + self.cpp_info.components[component_name].builddirs.append(os.path.join("lib", "cmake", m)) - for helper_modules in glob.glob(os.path.join(self.package_folder, "lib", "cmake", m, "QtPublic*Helpers.cmake")): - _add_build_module(component_name, helper_modules) - self.cpp_info.components[component_name].builddirs.append(os.path.join("lib", "cmake", m)) + elif component_name.endswith("Tools") and component_name[:-5] in self.cpp_info.components: + module = os.path.join("lib", "cmake", f"{m}", f"{m[:-5]}Macros.cmake") + if os.path.isfile(module): + _add_build_module(component_name[:-5], module) + self.cpp_info.components[component_name[:-5]].builddirs.append(os.path.join("lib", "cmake", m)) objects_dirs = glob.glob(os.path.join(self.package_folder, "lib", "objects-*/")) for object_dir in objects_dirs: @@ -1391,10 +1551,8 @@ def _create_plugin(pluginname, libname, plugintype, requires): component = "qt" + m[:m.find("_")] if component not in self.cpp_info.components: continue - submodules_dir = os.path.join(object_dir, m) - for sub_dir in os.listdir(submodules_dir): - submodule_dir = os.path.join(submodules_dir, sub_dir) - obj_files = [os.path.join(submodule_dir, file) for file in os.listdir(submodule_dir)] + for root, _, files in os.walk(os.path.join(object_dir, m)): + obj_files = [os.path.join(root, file) for file in files] self.cpp_info.components[component].exelinkflags.extend(obj_files) self.cpp_info.components[component].sharedlinkflags.extend(obj_files) @@ -1414,3 +1572,5 @@ def _add_build_modules_for_component(component): _add_build_modules_for_component(c) self.cpp_info.set_property("cmake_build_modules", build_modules_list) + + self.conf_info.define("user.qt:tools_directory", os.path.join(self.package_folder, "bin" if self.settings.os == "Windows" else "libexec")) 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/fix-long-path-on-windows_6.5.3.patch b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.5.3.patch new file mode 100644 index 0000000000000..2b9a861e60903 --- /dev/null +++ b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.5.3.patch @@ -0,0 +1,16 @@ +--- a/src/tools/syncqt/main.cpp ++++ b/src/tools/syncqt/main.cpp +@@ -851,12 +851,7 @@ + + bool headerFileExists = std::filesystem::exists(headerFile); + +- std::filesystem::path headerFileRootName = +- std::filesystem::weakly_canonical(headerFile, ec).root_name(); +- std::string aliasedFilepath = !ec && headerFileRootName == m_outputRootName +- ? std::filesystem::relative(headerFile, outputDir).generic_string() +- : headerFile.generic_string(); +- ec.clear(); ++ std::string aliasedFilepath = headerFile.generic_string(); + + std::string aliasPath = outputDir + '/' + m_currentFilename; + diff --git a/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.0.patch b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.0.patch new file mode 100644 index 0000000000000..2dd2a1e5feed3 --- /dev/null +++ b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.0.patch @@ -0,0 +1,16 @@ +--- a/src/tools/syncqt/main.cpp ++++ b/src/tools/syncqt/main.cpp +@@ -875,12 +875,7 @@ + + bool headerFileExists = std::filesystem::exists(headerFile); + +- std::filesystem::path headerFileRootName = +- std::filesystem::weakly_canonical(headerFile, ec).root_name(); +- std::string aliasedFilepath = !ec && headerFileRootName == m_outputRootName +- ? std::filesystem::relative(headerFile, outputDir).generic_string() +- : headerFile.generic_string(); +- ec.clear(); ++ std::string aliasedFilepath = headerFile.generic_string(); + + std::string aliasPath = outputDir + '/' + m_currentFilename; + diff --git a/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.1.patch b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.1.patch new file mode 100644 index 0000000000000..67967d9240077 --- /dev/null +++ b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.1.patch @@ -0,0 +1,16 @@ +--- a/src/tools/syncqt/main.cpp ++++ b/src/tools/syncqt/main.cpp +@@ -866,12 +866,7 @@ + + bool headerFileExists = std::filesystem::exists(headerFile); + +- std::filesystem::path headerFileRootName = +- std::filesystem::weakly_canonical(headerFile, ec).root_name(); +- std::string aliasedFilepath = !ec && headerFileRootName == m_outputRootName +- ? std::filesystem::relative(headerFile, outputDir).generic_string() +- : headerFile.generic_string(); +- ec.clear(); ++ std::string aliasedFilepath = headerFile.generic_string(); + + std::string aliasPath = outputDir + '/' + m_currentFilename; + diff --git a/recipes/qt/6.x.x/patches/fix_cmake3.28.patch b/recipes/qt/6.x.x/patches/fix_cmake3.28.patch new file mode 100644 index 0000000000000..c89a9544ff61f --- /dev/null +++ b/recipes/qt/6.x.x/patches/fix_cmake3.28.patch @@ -0,0 +1,45 @@ +From 0efea8020c1d221635aaa0a71529edb392cfe3cc Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Mon, 11 Sep 2023 14:48:32 +0200 +Subject: [PATCH] CMake: Fix build with CMake 3.28 on macOS + +FindWrapOpenGL.cmake assumed that IMPORTED_LOCATION is the absolute path +of the library within the framework. That's not the case with CMake 3.28 +anymore. There, IMPORTED_LOCATION is the absolute path of the framework +directory. + +The relevant upstream CMake change is +6b01a27f901b5eb392955fea322cde44a1b782a3. + +Pick-to: 6.2 6.5 6.6 +Change-Id: I6b702a28318e0978c56dec83c398965aa77ef020 +Reviewed-by: Alexandru Croitor +--- + cmake/FindWrapOpenGL.cmake | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/cmake/FindWrapOpenGL.cmake b/cmake/FindWrapOpenGL.cmake +index 3e6abaf4dda..7295a159caf 100644 +--- a/cmake/FindWrapOpenGL.cmake ++++ b/cmake/FindWrapOpenGL.cmake +@@ -14,14 +14,18 @@ + + add_library(WrapOpenGL::WrapOpenGL INTERFACE IMPORTED) + if(APPLE) ++ # CMake 3.27 and older: + # On Darwin platforms FindOpenGL sets IMPORTED_LOCATION to the absolute path of the library + # within the framework. This ends up as an absolute path link flag, which we don't want, + # because that makes our .prl files un-relocatable. + # Extract the framework path instead, and use that in INTERFACE_LINK_LIBRARIES, +- # which CMake ends up transforming into a reloctable -framework flag. ++ # which CMake ends up transforming into a relocatable -framework flag. + # See https://gitlab.kitware.com/cmake/cmake/-/issues/20871 for details. ++ # ++ # CMake 3.28 and above: ++ # IMPORTED_LOCATION is the absolute path the the OpenGL.framework folder. + get_target_property(__opengl_fw_lib_path OpenGL::GL IMPORTED_LOCATION) +- if(__opengl_fw_lib_path) ++ if(__opengl_fw_lib_path AND NOT __opengl_fw_lib_path MATCHES "/([^/]+)\\.framework$") + get_filename_component(__opengl_fw_path "${__opengl_fw_lib_path}" DIRECTORY) + endif() + diff --git a/recipes/qt/6.x.x/qtmodules6.3.2.conf b/recipes/qt/6.x.x/qtmodules6.3.2.conf deleted file mode 100644 index b0e0878e68e97..0000000000000 --- a/recipes/qt/6.x.x/qtmodules6.3.2.conf +++ /dev/null @@ -1,305 +0,0 @@ -[submodule "qtbase"] - path = qtbase - url = ../qtbase.git - branch = 6.3.2 - status = essential -[submodule "qtsvg"] - depends = qtbase - path = qtsvg - url = ../qtsvg.git - branch = 6.3.2 - status = addon -[submodule "qtdeclarative"] - depends = qtbase - recommends = qtimageformats qtshadertools qtsvg qtlanguageserver - path = qtdeclarative - url = ../qtdeclarative.git - branch = 6.3.2 - status = essential -[submodule "qtactiveqt"] - depends = qtbase - path = qtactiveqt - url = ../qtactiveqt.git - branch = 6.3.2 - status = addon -[submodule "qtmultimedia"] - depends = qtbase qtshadertools - recommends = qtdeclarative - path = qtmultimedia - url = ../qtmultimedia.git - branch = 6.3.2 - status = addon -[submodule "qttools"] - depends = qtbase - recommends = qtdeclarative qtactiveqt - path = qttools - url = ../qttools.git - branch = 6.3.2 - status = essential -[submodule "qtxmlpatterns"] - depends = qtbase - recommends = qtdeclarative - path = qtxmlpatterns - url = ../qtxmlpatterns.git - branch = 6.3 - status = ignore -[submodule "qttranslations"] - depends = qttools - path = qttranslations - url = ../qttranslations.git - branch = 6.3.2 - status = essential - priority = 30 -[submodule "qtdoc"] - depends = qtdeclarative qttools - recommends = qtmultimedia - path = qtdoc - url = ../qtdoc.git - branch = 6.3.2 - 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.3 - status = ignore -[submodule "qtpositioning"] - depends = qtbase - recommends = qtdeclarative qtserialport - path = qtpositioning - url = ../qtpositioning.git - branch = 6.3.2 - status = addon -[submodule "qtsensors"] - depends = qtbase - recommends = qtdeclarative - path = qtsensors - url = ../qtsensors.git - branch = 6.3.2 - 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.3.2 - status = addon -[submodule "qtwayland"] - depends = qtbase - recommends = qtdeclarative - path = qtwayland - url = ../qtwayland.git - branch = 6.3.2 - status = addon -[submodule "qt3d"] - depends = qtbase - recommends = qtdeclarative qtshadertools - path = qt3d - url = ../qt3d.git - branch = 6.3.2 - status = addon -[submodule "qtimageformats"] - depends = qtbase - path = qtimageformats - url = ../qtimageformats.git - branch = 6.3.2 - status = addon -[submodule "qtserialbus"] - depends = qtbase - recommends = qtserialport - path = qtserialbus - url = ../qtserialbus.git - branch = 6.3.2 - status = addon -[submodule "qtserialport"] - depends = qtbase - path = qtserialport - url = ../qtserialport.git - branch = 6.3.2 - status = addon -[submodule "qtwebsockets"] - depends = qtbase - recommends = qtdeclarative - path = qtwebsockets - url = ../qtwebsockets.git - branch = 6.3.2 - status = addon -[submodule "qtwebchannel"] - depends = qtbase - recommends = qtdeclarative qtwebsockets - path = qtwebchannel - url = ../qtwebchannel.git - branch = 6.3.2 - status = addon -[submodule "qtwebengine"] - depends = qtdeclarative - recommends = qtwebchannel qttools qtpositioning - path = qtwebengine - url = ../qtwebengine.git - branch = 6.3.2 - status = addon - priority = 10 -[submodule "qtcanvas3d"] - depends = qtdeclarative - path = qtcanvas3d - url = ../qtcanvas3d.git - branch = 6.3 - status = ignore -[submodule "qtwebview"] - depends = qtdeclarative - recommends = qtwebengine - path = qtwebview - url = ../qtwebview.git - branch = 6.3.2 - status = addon -[submodule "qtcharts"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtcharts - url = ../qtcharts.git - branch = 6.3.2 - status = addon -[submodule "qtdatavis3d"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtdatavis3d - url = ../qtdatavis3d.git - branch = 6.3.2 - status = addon -[submodule "qtvirtualkeyboard"] - depends = qtbase qtdeclarative qtsvg - recommends = qtmultimedia - path = qtvirtualkeyboard - url = ../qtvirtualkeyboard.git - branch = 6.3.2 - status = addon -[submodule "qtgamepad"] - depends = qtbase - recommends = qtdeclarative - path = qtgamepad - url = ../qtgamepad.git - branch = 6.3 - status = ignore -[submodule "qtscxml"] - depends = qtbase qtdeclarative - path = qtscxml - url = ../qtscxml.git - branch = 6.3.2 - status = addon -[submodule "qtspeech"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtspeech - url = ../qtspeech.git - branch = 6.3.2 - status = ignore -[submodule "qtnetworkauth"] - depends = qtbase - path = qtnetworkauth - url = ../qtnetworkauth.git - branch = 6.3.2 - status = addon -[submodule "qtremoteobjects"] - depends = qtbase - recommends = qtdeclarative - path = qtremoteobjects - url = ../qtremoteobjects.git - branch = 6.3.2 - status = addon -[submodule "qtwebglplugin"] - depends = qtbase qtwebsockets - recommends = qtdeclarative - path = qtwebglplugin - url = ../qtwebglplugin.git - branch = 6.3 - status = ignore -[submodule "qtlottie"] - depends = qtbase qtdeclarative - path = qtlottie - url = ../qtlottie.git - branch = 6.3.2 - status = addon -[submodule "qtquicktimeline"] - depends = qtbase qtdeclarative - path = qtquicktimeline - url = ../qtquicktimeline - branch = 6.3.2 - status = addon -[submodule "qtquick3d"] - depends = qtbase qtdeclarative qtshadertools - recommends = qtquicktimeline - path = qtquick3d - url = ../qtquick3d.git - branch = 6.3.2 - status = addon -[submodule "qtshadertools"] - depends = qtbase - path = qtshadertools - url = ../qtshadertools.git - branch = 6.3.2 - status = addon -[submodule "qt5compat"] - depends = qtbase qtdeclarative - path = qt5compat - url = ../qt5compat.git - branch = 6.3.2 - status = deprecated -[submodule "qtcoap"] - depends = qtbase - path = qtcoap - url = ../qtcoap.git - branch = 6.3.2 - status = addon -[submodule "qtmqtt"] - depends = qtbase qtdeclarative - path = qtmqtt - url = ../qtmqtt.git - branch = 6.3.2 - status = addon -[submodule "qtopcua"] - depends = qtbase qtdeclarative - path = qtopcua - url = ../qtopcua.git - branch = 6.3.2 - status = addon -[submodule "qtlanguageserver"] - depends = qtbase - path = qtlanguageserver - url = ../qtlanguageserver.git - branch = 6.3.2 - status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.4.2.conf b/recipes/qt/6.x.x/qtmodules6.4.2.conf deleted file mode 100644 index 10324ecab234b..0000000000000 --- a/recipes/qt/6.x.x/qtmodules6.4.2.conf +++ /dev/null @@ -1,318 +0,0 @@ -[submodule "qtbase"] - path = qtbase - url = ../qtbase.git - branch = 6.4.2 - status = essential -[submodule "qtsvg"] - depends = qtbase - path = qtsvg - url = ../qtsvg.git - branch = 6.4.2 - status = addon -[submodule "qtdeclarative"] - depends = qtbase - recommends = qtimageformats qtshadertools qtsvg qtlanguageserver - path = qtdeclarative - url = ../qtdeclarative.git - branch = 6.4.2 - status = essential -[submodule "qtactiveqt"] - depends = qtbase - path = qtactiveqt - url = ../qtactiveqt.git - branch = 6.4.2 - status = addon -[submodule "qtmultimedia"] - depends = qtbase qtshadertools - recommends = qtdeclarative qtquick3d - path = qtmultimedia - url = ../qtmultimedia.git - branch = 6.4.2 - status = addon -[submodule "qttools"] - depends = qtbase - recommends = qtdeclarative qtactiveqt - path = qttools - url = ../qttools.git - branch = 6.4.2 - 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.2 - status = essential - priority = 30 -[submodule "qtdoc"] - depends = qtdeclarative qttools - recommends = qtmultimedia - path = qtdoc - url = ../qtdoc.git - branch = 6.4.2 - 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.2 - status = addon -[submodule "qtsensors"] - depends = qtbase - recommends = qtdeclarative - path = qtsensors - url = ../qtsensors.git - branch = 6.4.2 - 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.2 - status = addon -[submodule "qtwayland"] - depends = qtbase - recommends = qtdeclarative - path = qtwayland - url = ../qtwayland.git - branch = 6.4.2 - status = addon -[submodule "qt3d"] - depends = qtbase - recommends = qtdeclarative qtshadertools - path = qt3d - url = ../qt3d.git - branch = 6.4.2 - status = addon -[submodule "qtimageformats"] - depends = qtbase - path = qtimageformats - url = ../qtimageformats.git - branch = 6.4.2 - status = addon -[submodule "qtserialbus"] - depends = qtbase - recommends = qtserialport - path = qtserialbus - url = ../qtserialbus.git - branch = 6.4.2 - status = addon -[submodule "qtserialport"] - depends = qtbase - path = qtserialport - url = ../qtserialport.git - branch = 6.4.2 - status = addon -[submodule "qtwebsockets"] - depends = qtbase - recommends = qtdeclarative - path = qtwebsockets - url = ../qtwebsockets.git - branch = 6.4.2 - status = addon -[submodule "qtwebchannel"] - depends = qtbase - recommends = qtdeclarative qtwebsockets - path = qtwebchannel - url = ../qtwebchannel.git - branch = 6.4.2 - status = addon -[submodule "qtwebengine"] - depends = qtdeclarative - recommends = qtwebchannel qttools qtpositioning - path = qtwebengine - url = ../qtwebengine.git - branch = 6.4.2 - 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.2 - status = addon -[submodule "qtcharts"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtcharts - url = ../qtcharts.git - branch = 6.4.2 - status = addon -[submodule "qtdatavis3d"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtdatavis3d - url = ../qtdatavis3d.git - branch = 6.4.2 - status = addon -[submodule "qtvirtualkeyboard"] - depends = qtbase qtdeclarative qtsvg - recommends = qtmultimedia - path = qtvirtualkeyboard - url = ../qtvirtualkeyboard.git - branch = 6.4.2 - 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.2 - status = addon -[submodule "qtspeech"] - depends = qtbase - recommends = qtdeclarative qtmultimedia - path = qtspeech - url = ../qtspeech.git - branch = 6.4.2 - status = addon -[submodule "qtnetworkauth"] - depends = qtbase - path = qtnetworkauth - url = ../qtnetworkauth.git - branch = 6.4.2 - status = addon -[submodule "qtremoteobjects"] - depends = qtbase - recommends = qtdeclarative - path = qtremoteobjects - url = ../qtremoteobjects.git - branch = 6.4.2 - 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.2 - status = addon -[submodule "qtquicktimeline"] - depends = qtbase qtdeclarative - path = qtquicktimeline - url = ../qtquicktimeline - branch = 6.4.2 - status = addon -[submodule "qtquick3d"] - depends = qtbase qtdeclarative qtshadertools - recommends = qtquicktimeline - path = qtquick3d - url = ../qtquick3d.git - branch = 6.4.2 - status = addon -[submodule "qtshadertools"] - depends = qtbase - path = qtshadertools - url = ../qtshadertools.git - branch = 6.4.2 - status = addon -[submodule "qt5compat"] - depends = qtbase qtdeclarative - path = qt5compat - url = ../qt5compat.git - branch = 6.4.2 - status = deprecated -[submodule "qtcoap"] - depends = qtbase - path = qtcoap - url = ../qtcoap.git - branch = 6.4.2 - status = addon -[submodule "qtmqtt"] - depends = qtbase qtdeclarative - path = qtmqtt - url = ../qtmqtt.git - branch = 6.4.2 - status = addon -[submodule "qtopcua"] - depends = qtbase qtdeclarative - path = qtopcua - url = ../qtopcua.git - branch = 6.4.2 - status = addon -[submodule "qtlanguageserver"] - depends = qtbase - path = qtlanguageserver - url = ../qtlanguageserver.git - branch = 6.4.2 - status = preview -[submodule "qthttpserver"] - depends = qtbase - recommends = qtwebsockets - path = qthttpserver - url = ../qthttpserver.git - branch = 6.4.2 - status = preview -[submodule "qtquick3dphysics"] - depends = qtbase qtdeclarative qtquick3d qtshadertools - path = qtquick3dphysics - url = ../qtquick3dphysics.git - branch = 6.4.2 - status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.6.0.conf b/recipes/qt/6.x.x/qtmodules6.6.0.conf deleted file mode 100644 index e3853727b0712..0000000000000 --- a/recipes/qt/6.x.x/qtmodules6.6.0.conf +++ /dev/null @@ -1,338 +0,0 @@ -[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 deleted file mode 100644 index 3d1fa112d7390..0000000000000 --- a/recipes/qt/6.x.x/qtmodules6.6.1.conf +++ /dev/null @@ -1,338 +0,0 @@ -[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/qtmodules6.6.3.conf b/recipes/qt/6.x.x/qtmodules6.6.3.conf new file mode 100644 index 0000000000000..9ab358b10e06c --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.6.3.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.6.3 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.6.3 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.6.3 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.6.3 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.6.3 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.6.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.6.3 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.6.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.6.3 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.6.3 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.6.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.6.3 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.6.3 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.6.3 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.6.3 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.6.3 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.6.3 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.6.3 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.6.3 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.6.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.6.3 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.6.3 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.6.3 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.6.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.6.3 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.6.3 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.6.3 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.6.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.6.3 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.6.3 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.6.3 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.6.3 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.6.3 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.6.3 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.6.3 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.6.3 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.6.3 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.6.3 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.6.3 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.6.3 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.6.3 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.6.3 + status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.7.3.conf b/recipes/qt/6.x.x/qtmodules6.7.3.conf new file mode 100644 index 0000000000000..416cfaa7ace55 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.7.3.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.7.3 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.7.3 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.7.3 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.7.3 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.7.3 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.7.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.7.3 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.7.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.7.3 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.7.3 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.7.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.7.3 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.7.3 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.7.3 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.7.3 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.7.3 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.7.3 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.7.3 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.7.3 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.7.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.7.3 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.7.3 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.7.3 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.7.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.7.3 + status = addon +[submodule "qtspeech"] + depends = qtbase qtmultimedia + recommends = qtdeclarative + path = qtspeech + url = ../qtspeech.git + branch = 6.7.3 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.7.3 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.7.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.7.3 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.7.3 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.7.3 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.7.3 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.7.3 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.7.3 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.7.3 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.7.3 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.7.3 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.7.3 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.7.3 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.7.3 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.7.3 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.7.3 + 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 337604f1af6ee..45e4bb9ec9ab7 100644 --- a/recipes/qt/6.x.x/test_package/CMakeLists.txt +++ b/recipes/qt/6.x.x/test_package/CMakeLists.txt @@ -3,7 +3,16 @@ project(test_package LANGUAGES CXX) find_package(Qt6 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) -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) +add_executable(${PROJECT_NAME} test_package.cpp greeter.h example.qrc) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml Qt6::Widgets) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC ON AUTORCC ON) + +# Only running this Qt macros in macOS +if (APPLE) + # Related to https://github.com/conan-io/conan-center-index/issues/20574 + qt_standard_project_setup() + qt_add_executable(test_macos_bundle MACOSX_BUNDLE test_macos_bundle.cpp) + target_link_libraries(test_macos_bundle PRIVATE Qt6::Core) + target_compile_features(test_macos_bundle PRIVATE cxx_std_17) +endif() diff --git a/recipes/qt/6.x.x/test_package/conanfile.py b/recipes/qt/6.x.x/test_package/conanfile.py index 1153f37c5a877..aab19cd7d3a56 100644 --- a/recipes/qt/6.x.x/test_package/conanfile.py +++ b/recipes/qt/6.x.x/test_package/conanfile.py @@ -2,14 +2,14 @@ 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.env import VirtualRunEnv from conan.tools.files import copy, save class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv" + generators = "CMakeDeps", "VirtualBuildEnv" test_type = "explicit" def layout(self): @@ -21,25 +21,19 @@ def requirements(self): def build_requirements(self): if not can_run(self): self.tool_requires(self.tested_reference_str) + self.tool_requires("cmake/[>=3.27 <4]") 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""") +Prefix = {path}""") + + tc = CMakeToolchain(self) + if 'qt' in self.dependencies.build: + qt_tools_rootdir = self.conf.get("user.qt:tools_directory", None) + for tool in ["moc", "rcc", "uic"]: + tc.cache_variables[f"CMAKE_AUTO{tool.upper()}_EXECUTABLE"] = os.path.join(qt_tools_rootdir, f"{tool}.exe" if self.settings_build.os == "Windows" else tool) + tc.generate() VirtualRunEnv(self).generate() if can_run(self): @@ -55,3 +49,13 @@ def test(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") + # Related to https://github.com/conan-io/conan-center-index/issues/20574 + if self.settings.os == "Macos": + bin_macos_path = os.path.join(self.cpp.build.bindirs[0], "test_macos_bundle.app", "Contents", "MacOS", "test_macos_bundle") + self.run(bin_macos_path, env="conanrun") + + # Check that the directory exposed in the configuration exists and includes moc + qt_tools_dir = self.dependencies.host["qt"].conf_info.get("user.qt:tools_directory") + assert os.path.isdir(qt_tools_dir) + moc = os.path.join(qt_tools_dir, "moc.exe" if self.settings.os == "Windows" else "moc") + assert os.path.exists(moc) diff --git a/recipes/qt/6.x.x/test_package/test_macos_bundle.cpp b/recipes/qt/6.x.x/test_package/test_macos_bundle.cpp new file mode 100644 index 0000000000000..fb10bbf49cdff --- /dev/null +++ b/recipes/qt/6.x.x/test_package/test_macos_bundle.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + return 0; + } diff --git a/recipes/qt/6.x.x/test_v1_package/CMakeLists.txt b/recipes/qt/6.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 60524d0bb25e1..0000000000000 --- a/recipes/qt/6.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index 85db60ab1408b..0000000000000 --- a/recipes/qt/6.x.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,145 +0,0 @@ -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_v1_package/meson.build b/recipes/qt/6.x.x/test_v1_package/meson.build deleted file mode 100644 index 684dfec65a30e..0000000000000 --- a/recipes/qt/6.x.x/test_v1_package/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -project('test_package', 'cpp') -qt6 = import('qt6') -qt6_dep = dependency('qt6', modules: ['Core', 'Network', 'Sql', 'Concurrent', 'Xml']) -moc_files = qt6.preprocess(moc_headers : 'greeter.h', qresources : 'example.qrc') -executable('test_package', 'test_package.cpp', moc_files, - dependencies : qt6_dep) 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 deleted file mode 100644 index 3b3ce9cba0343..0000000000000 --- a/recipes/qt/6.x.x/test_v1_package/test_package.pro +++ /dev/null @@ -1,14 +0,0 @@ -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 a8db7bd315aab..3628ca48ce3b8 100644 --- a/recipes/qt/config.yml +++ b/recipes/qt/config.yml @@ -1,21 +1,9 @@ versions: - "6.6.1": + "6.7.3": folder: 6.x.x - "6.6.0": + "6.6.3": folder: 6.x.x "6.5.3": folder: 6.x.x - "6.4.2": - folder: 6.x.x - "6.3.2": - folder: 6.x.x - "5.15.11": - folder: 5.x.x - "5.15.10": - folder: 5.x.x - "5.15.9": - folder: 5.x.x - "5.15.8": - folder: 5.x.x - "5.15.7": + "5.15.16": folder: 5.x.x diff --git a/recipes/qtxlsxwriter/all/conanfile.py b/recipes/qtxlsxwriter/all/conanfile.py index a67db1337017f..e8b849d77cbf6 100644 --- a/recipes/qtxlsxwriter/all/conanfile.py +++ b/recipes/qtxlsxwriter/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.63.0" class QtXlsxWriterConan(ConanFile): @@ -19,6 +19,7 @@ class QtXlsxWriterConan(ConanFile): topics = ("excel", "xlsx") settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -44,7 +45,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/5.15.7") + self.requires("qt/[~5.15]", transitive_headers=True, transitive_libs=True) def validate(self): if not self.dependencies["qt"].options.gui: @@ -55,7 +56,7 @@ def validate(self): def build_requirements(self): if hasattr(self, "settings_build") and cross_building(self): - self.tool_requires("qt/5.15.7") + self.tool_requires("qt/") def source(self): get(self, **self.conan_data["sources"][self.version]["source"], diff --git a/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt b/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt index e2353a278197b..5681d8a2b8e05 100644 --- a/recipes/qtxlsxwriter/all/test_package/CMakeLists.txt +++ b/recipes/qtxlsxwriter/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(qtxlsxwriter REQUIRED CONFIG) diff --git a/recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt b/recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/qtxlsxwriter/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/qtxlsxwriter/all/test_v1_package/conanfile.py b/recipes/qtxlsxwriter/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/qtxlsxwriter/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_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/quantlib/all/conanfile.py b/recipes/quantlib/all/conanfile.py index 117151188f5e9..18e4b9adf7ede 100644 --- a/recipes/quantlib/all/conanfile.py +++ b/recipes/quantlib/all/conanfile.py @@ -47,10 +47,10 @@ def requirements(self): def validate(self): if self.info.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 14 if self.version >= "1.24" else 11) + check_min_cppstd(self, 14 if Version(self.version) >= "1.24" else 11) if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5": raise ConanInvalidConfiguration("gcc < 5 not supported") - if self.version >= "1.24" and is_msvc(self) and self.options.shared: + if Version(self.version) >= "1.24" and is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration("MSVC DLL build is not supported by upstream") def source(self): @@ -61,7 +61,7 @@ def generate(self): tc = CMakeToolchain(self) # 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.version >= "1.24": + if Version(self.version) >= "1.24": tc.cache_variables["QL_BUILD_BENCHMARK"] = False tc.cache_variables["QL_BUILD_EXAMPLES"] = False tc.cache_variables["QL_BUILD_TEST_SUITE"] = False diff --git a/recipes/quantlib/all/test_package/CMakeLists.txt b/recipes/quantlib/all/test_package/CMakeLists.txt index 365925ecff2bd..bc76dd2d2defd 100644 --- a/recipes/quantlib/all/test_package/CMakeLists.txt +++ b/recipes/quantlib/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(QuantLib REQUIRED CONFIG) diff --git a/recipes/quantlib/all/test_v1_package/CMakeLists.txt b/recipes/quantlib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/quantlib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/quantlib/all/test_v1_package/conanfile.py b/recipes/quantlib/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/quantlib/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_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/quaternions/all/test_v1_package/CMakeLists.txt b/recipes/quaternions/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/quaternions/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 84ee68733e516..0000000000000 --- a/recipes/quaternions/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/conandata.yml b/recipes/quazip/all/conandata.yml index e1e86960ccb10..9ffb2b7d9ce95 100644 --- a/recipes/quazip/all/conandata.yml +++ b/recipes/quazip/all/conandata.yml @@ -8,9 +8,6 @@ sources: "1.2": url: "https://github.com/stachenov/quazip/archive/v1.2.tar.gz" sha256: "2dfb911d6b27545de0b98798d967c40430312377e6ade57096d6ec80c720cb61" - "1.1": - url: "https://github.com/stachenov/quazip/archive/v1.1.tar.gz" - sha256: "54edce9c11371762bd4f0003c2937b5d8806a2752dd9c0fd9085e90792612ad0" patches: "1.3": - patch_file: "patches/1.3-0001-use-cpp17-for-qt6.patch" diff --git a/recipes/quazip/all/conanfile.py b/recipes/quazip/all/conanfile.py index 6e40033d8025b..0d9d896af6cc1 100644 --- a/recipes/quazip/all/conanfile.py +++ b/recipes/quazip/all/conanfile.py @@ -48,7 +48,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/5.15.9", transitive_headers=True, transitive_libs=True) + self.requires("qt/[~5.15]", 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/quazip/all/test_package/CMakeLists.txt b/recipes/quazip/all/test_package/CMakeLists.txt index 8479196b3ebe4..ca7e0987a5640 100644 --- a/recipes/quazip/all/test_package/CMakeLists.txt +++ b/recipes/quazip/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(QuaZip-Qt5 REQUIRED CONFIG) diff --git a/recipes/quazip/all/test_v1_package/CMakeLists.txt b/recipes/quazip/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/quazip/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/quazip/all/test_v1_package/conanfile.py b/recipes/quazip/all/test_v1_package/conanfile.py deleted file mode 100644 index 97418087b1f8d..0000000000000 --- a/recipes/quazip/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -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): - zipFile_path = os.path.join(self.source_folder, "zipFile.zip") - bin_path = os.path.join("bin", "test_package") - self.run(bin_path + " " + zipFile_path, run_environment=True) diff --git a/recipes/quazip/config.yml b/recipes/quazip/config.yml index 889c86eb7e377..f55a2df2807c5 100644 --- a/recipes/quazip/config.yml +++ b/recipes/quazip/config.yml @@ -5,5 +5,3 @@ versions: folder: all "1.2": folder: all - "1.1": - folder: all diff --git a/recipes/quickcpplib/all/conandata.yml b/recipes/quickcpplib/all/conandata.yml new file mode 100644 index 0000000000000..c89f6afe4befd --- /dev/null +++ b/recipes/quickcpplib/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20231208": + url: "https://github.com/ned14/quickcpplib/archive/72277c70f925829935a2af846731ab36063ec16f.tar.gz" + sha256: "bb9da86efa2f262e6a292453775fa9b999b422700eb1c1ac390b7cbe5f0ec92f" diff --git a/recipes/quickcpplib/all/conanfile.py b/recipes/quickcpplib/all/conanfile.py new file mode 100644 index 0000000000000..be93e0eb71c55 --- /dev/null +++ b/recipes/quickcpplib/all/conanfile.py @@ -0,0 +1,105 @@ +import os +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, rm +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.54.0" + + +class QuickcpplibCodeConan(ConanFile): + name = "quickcpplib" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ned14/quickcpplib" + description = "Eliminate all the tedious hassle when making state-of-the-art C++ 17 - 23 libraries!" + topics = ("header-only", "common") + package_type = "header-library" + settings = "os", "compiler", "build_type", "arch" + + @property + def _compiler_required_version(self): + return { + "gcc": "9", + "clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + @property + def _needs_span_lite(self): + # TODO: Conan 1 only has check_min_cppstd, move to `valid_max_cppstd` when only Conan 2 is required + try: + check_min_cppstd(self, "20") + return False + except ConanInvalidConfiguration: + return True + + @property + def _min_cppstd(self): + return "17" + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self._needs_span_lite: + self.requires("span-lite/0.10.3") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + # To simplify library integration to CCI + # we require C++17 to be dependency free. + check_min_cppstd(self, self._min_cppstd) + + min_version = self._compiler_required_version.get(str(self.settings.compiler)) + if min_version: + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"This package requires c++ {self._min_cppstd} support. The current compiler does not support it.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + 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, "*.ipp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + rmdir(self, os.path.join(self.package_folder, "include", "quickcpplib", "byte")) + rmdir(self, os.path.join(self.package_folder, "include", "quickcpplib", "boost")) + rmdir(self, os.path.join(self.package_folder, "include", "quickcpplib", "optional")) + rmdir(self, os.path.join(self.package_folder, "include", "quickcpplib", "span-lite")) + rm(self, "allocator_testing.hpp", os.path.join(self.package_folder, "include", "quickcpplib")) + copy(self, "Licence.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", "quickcpplib") + self.cpp_info.set_property("cmake_target_name", "quickcpplib::hl") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + if self._needs_span_lite: + self.cpp_info.requires = ["span-lite::span-lite"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["dl", "pthread", "rt"] + + self.cpp_info.defines.append("QUICKCPPLIB_DISABLE_ABI_PERMUTATION") + + if self._needs_span_lite: + self.cpp_info.defines.append("QUICKCPPLIB_USE_SYSTEM_SPAN_LITE=1") + else: + self.cpp_info.defines.append("QUICKCPPLIB_USE_STD_SPAN=1") + + self.cpp_info.defines.append("QUICKCPPLIB_USE_STD_BYTE=1") + self.cpp_info.defines.append("QUICKCPPLIB_USE_STD_OPTIONAL=1") diff --git a/recipes/quickcpplib/all/test_package/CMakeLists.txt b/recipes/quickcpplib/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fc0e3e545987e --- /dev/null +++ b/recipes/quickcpplib/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(quickcpplib REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package quickcpplib::hl) + +if (TARGET nonstd::span-lite) +target_compile_features(test_package PRIVATE cxx_std_17) +else () +target_compile_features(test_package PRIVATE cxx_std_20) +endif() diff --git a/recipes/quickcpplib/all/test_package/conanfile.py b/recipes/quickcpplib/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e845ae751a301 --- /dev/null +++ b/recipes/quickcpplib/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/quickcpplib/all/test_package/test_package.cpp b/recipes/quickcpplib/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..54a5243de2818 --- /dev/null +++ b/recipes/quickcpplib/all/test_package/test_package.cpp @@ -0,0 +1,53 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ql = ::quickcpplib; + +int main() { + std::uint64_t x = 20230904ULL; + std::uint64_t y = 42ULL; + if( ql::algorithm::hash::fast_hash::hash(reinterpret_cast(&x), sizeof(x)) + == ql::algorithm::hash::fast_hash::hash(reinterpret_cast(&y), sizeof(y)) ) + { + return -1; + } + + return 0; +} diff --git a/recipes/quickcpplib/config.yml b/recipes/quickcpplib/config.yml new file mode 100644 index 0000000000000..1f4ea336bc936 --- /dev/null +++ b/recipes/quickcpplib/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20231208": + folder: all diff --git a/recipes/quickfast/all/CMakeLists.txt b/recipes/quickfast/all/CMakeLists.txt index 99facf34f7dda..69448bef01a75 100644 --- a/recipes/quickfast/all/CMakeLists.txt +++ b/recipes/quickfast/all/CMakeLists.txt @@ -1,75 +1,58 @@ -# based on: https://github.com/microsoft/vcpkg/blob/master/ports/quickfast/CMakeLists.txt - -# Copyright (c) Microsoft Corporation - -# All rights reserved. - -# MIT License - -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -# of the Software, and to permit persons to whom the Software is furnished to do -# so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.15) project(quickfast CXX) -include(${PROJECT_BINARY_DIR}/../conanbuildinfo.cmake) -conan_basic_setup() +find_package(Boost REQUIRED CONFIG) +find_package(XercesC REQUIRED CONFIG) file(GLOB SOURCES - source_subfolder/src/Application/*.cpp - source_subfolder/src/Common/*.cpp - source_subfolder/src/Codecs/*.cpp - source_subfolder/src/Communication/*.cpp - source_subfolder/src/Messages/*.cpp + src/Application/*.cpp + src/Common/*.cpp + src/Codecs/*.cpp + src/Communication/*.cpp + src/Messages/*.cpp ) -file(GLOB HEADERS RELATIVE ${PROJECT_SOURCE_DIR} - source_subfolder/src/Application/*.h - source_subfolder/src/Common/*.h - source_subfolder/src/Codecs/*.h - source_subfolder/src/Communication/*.h - source_subfolder/src/Messages/*.h +file(GLOB HEADERS + src/Application/*.h + src/Common/*.h + src/Codecs/*.h + src/Communication/*.h + src/Messages/*.h ) add_library(quickfast ${HEADERS} ${SOURCES}) +# Needed to keep support for deprecated placeholders in boost::bind +target_compile_definitions(quickfast PRIVATE -DBOOST_BIND_GLOBAL_PLACEHOLDERS) + if(BUILD_SHARED_LIBS) - target_compile_definitions(quickfast PRIVATE -DQUICKFAST_BUILD_DLL) + target_compile_definitions(quickfast PUBLIC QUICKFAST_BUILD_DLL) else() - target_compile_definitions(quickfast PUBLIC -DQUICKFAST_HAS_DLL=0) + target_compile_definitions(quickfast PUBLIC QUICKFAST_HAS_DLL=0) endif() target_compile_features(quickfast PUBLIC cxx_std_11) - -target_include_directories(quickfast PUBLIC - source_subfolder/src +target_include_directories(quickfast PRIVATE src) +target_link_libraries(${PROJECT_NAME} + Boost::boost + Boost::thread + Boost::system + Boost::filesystem + XercesC::XercesC +) +set_target_properties(quickfast PROPERTIES + PUBLIC_HEADER "${HEADERS}" ) - -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) install(TARGETS quickfast - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ) foreach (HEADER ${HEADERS}) - file(RELATIVE_PATH HEADER_REL ${PROJECT_SOURCE_DIR}/source_subfolder/src ${PROJECT_SOURCE_DIR}/${HEADER}) - get_filename_component(HEADER_DIR ${HEADER_REL} DIRECTORY) - install(FILES ${HEADER} DESTINATION include/quickfast/${HEADER_DIR}) + file(RELATIVE_PATH HEADER_REL ${PROJECT_SOURCE_DIR}/src ${HEADER}) + get_filename_component(HEADER_DIR ${HEADER_REL} DIRECTORY) + install(FILES ${HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${HEADER_DIR}) endforeach() diff --git a/recipes/quickfast/all/conandata.yml b/recipes/quickfast/all/conandata.yml index f9690b9e48e93..be365a50cf527 100644 --- a/recipes/quickfast/all/conandata.yml +++ b/recipes/quickfast/all/conandata.yml @@ -1,14 +1,16 @@ sources: - "1.5": - url: "https://github.com/objectcomputing/quickfast/archive/V1_5.tar.gz" - sha256: "7ae22d28cc13967a2815c09bec027ce01f2f3e30b6ed752bea00649581e728df" "cci.20170314": url: "https://github.com/objectcomputing/quickfast/archive/f9403cfb20ae5383a04772112728d233502e31c0.tar.gz" sha256: "29f40fa383643bfa381315148c6c985fe41159342706f0d0a274fcf45cf36f49" -patches: "1.5": - - patch_file: "patches/00001-fix-boost-asio.patch" - base_path: "source_subfolder" + url: "https://github.com/objectcomputing/quickfast/archive/V1_5.tar.gz" + sha256: "7ae22d28cc13967a2815c09bec027ce01f2f3e30b6ed752bea00649581e728df" +patches: "cci.20170314": - - patch_file: "patches/00002-fix-boost-asio.patch" - base_path: "source_subfolder" + - patch_file: "patches/0001-cci.20170314-fix-boost-asio.patch" + patch_type: "portability" + patch_description: "Fix compilation issues with newer Boost.Asio" + "1.5": + - patch_file: "patches/0001-1.5-fix-boost-asio.patch" + patch_type: "portability" + patch_description: "Fix compilation issues with newer Boost.Asio" diff --git a/recipes/quickfast/all/conanfile.py b/recipes/quickfast/all/conanfile.py index c5aa454e68422..29ce60d7e04be 100644 --- a/recipes/quickfast/all/conanfile.py +++ b/recipes/quickfast/all/conanfile.py @@ -1,70 +1,83 @@ -from conans import ConanFile, CMake, tools import os -import shutil -import glob + +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 +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class QuickfastConan(ConanFile): name = "quickfast" + description = "QuickFAST is an Open Source native C++ implementation of the FAST Protocol" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://objectcomputing.com/" - description = "QuickFAST is an Open Source native C++ implementation of the FAST Protocol" - topics = ("conan", "QuickFAST", "FAST", "FIX", "Fix Adapted for STreaming", "Financial Information Exchange", - "libraries", "cpp") - settings = "os", "compiler", "build_type", "arch" - options = {"fPIC": [True, False], - "shared": [True, False]} - default_options = {"fPIC": True, - "shared": False} - requires = ["boost/1.75.0", "xerces-c/3.2.3"] - 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 _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + homepage = "https://github.com/objectcomputing/quickfast" + topics = ("fast-protocol", "fast", "fix-adapted-for-streaming", "fpl", "fix-protocol-limited") - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob.glob("quickfast-*")[0] - os.rename(extracted_dir, 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 export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, 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") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # Uses Boost.Asio transitively + self.requires("boost/1.85.0", transitive_headers=True, transitive_libs=True) + self.requires("xerces-c/3.2.5") + + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, 11) - def build(self): - patches = self.conan_data["patches"][self.version] - for patch in patches: - tools.patch(**patch) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - cmake = self._configure_cmake() - cmake.build(target="quickfast") + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - cmake = self._configure_cmake() + copy(self, "license.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - self.copy("license.txt", dst="licenses", src=self._source_subfolder) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = ["quickfast"] self.cpp_info.includedirs.append(os.path.join("include", "quickfast")) - if not self.options.shared: + # Needed to keep support for deprecated placeholders in boost::bind + self.cpp_info.defines.append("BOOST_BIND_GLOBAL_PLACEHOLDERS") + + if is_msvc(self) and not self.options.shared: self.cpp_info.defines.append("QUICKFAST_HAS_DLL=0") diff --git a/recipes/quickfast/all/patches/00001-fix-boost-asio.patch b/recipes/quickfast/all/patches/00001-fix-boost-asio.patch deleted file mode 100644 index 02dcc3611cf5c..0000000000000 --- a/recipes/quickfast/all/patches/00001-fix-boost-asio.patch +++ /dev/null @@ -1,42 +0,0 @@ -Patch taken from: -https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/quickfast/00001-fix-boost-asio.patch - -diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h -index 3574df8..c4ef4e1 100644 ---- a/src/Common/QuickFASTPch.h -+++ b/src/Common/QuickFASTPch.h -@@ -32,7 +32,7 @@ - #include - - // If building for .NET, must link boost threads dynamically --#define BOOST_THREAD_USE_DLL -+// #define BOOST_THREAD_USE_DLL - // This reports at compile time which boost libraries will be used - // #define BOOST_LIB_DIAGNOSTIC - -diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h -index 4f61915..96f2198 100644 ---- a/src/Communication/AsioService.h -+++ b/src/Communication/AsioService.h -@@ -99,6 +99,7 @@ namespace QuickFAST - { - return ioService_; - } -+ boost::asio::io_service::executor_type get_executor() BOOST_ASIO_NOEXCEPT { return ioService_.get_executor();} - - ///@brief Post a completion handler for later processing (usually in a different thread) - /// @param handler is the handler to be posted -diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h -index dc2f235..6ad5e68 100644 ---- a/src/Communication/AsioService_fwd.h -+++ b/src/Communication/AsioService_fwd.h -@@ -17,7 +17,8 @@ namespace boost - { - namespace asio - { -- class io_service; -+ class io_context; -+ typedef io_context io_service; - } - } - diff --git a/recipes/quickfast/all/patches/00002-fix-boost-asio.patch b/recipes/quickfast/all/patches/00002-fix-boost-asio.patch deleted file mode 100644 index 62dc10d507afe..0000000000000 --- a/recipes/quickfast/all/patches/00002-fix-boost-asio.patch +++ /dev/null @@ -1,42 +0,0 @@ -Patch adapted from: -https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/quickfast/00001-fix-boost-asio.patch - -diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h -index 381f846..e6f6b13 100644 ---- a/src/Common/QuickFASTPch.h -+++ b/src/Common/QuickFASTPch.h -@@ -36,7 +36,7 @@ - #include - - // If building for .NET, must link boost threads dynamically --#define BOOST_THREAD_USE_DLL -+// #define BOOST_THREAD_USE_DLL - // This reports at compile time which boost libraries will be used - // #define BOOST_LIB_DIAGNOSTIC - -diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h -index 4f61915..54f92ed 100644 ---- a/src/Communication/AsioService.h -+++ b/src/Communication/AsioService.h -@@ -58,6 +58,7 @@ namespace QuickFAST - { - return ioService_.poll(); - } -+ boost::asio::io_service::executor_type get_executor() BOOST_ASIO_NOEXCEPT { return ioService_.get_executor();} - - /// @brief execute at most one ready event handler than return. - size_t poll_one() -diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h -index dc2f235..6ad5e68 100644 ---- a/src/Communication/AsioService_fwd.h -+++ b/src/Communication/AsioService_fwd.h -@@ -17,7 +17,8 @@ namespace boost - { - namespace asio - { -- class io_service; -+ class io_context; -+ typedef io_context io_service; - } - } - diff --git a/recipes/quickfast/all/patches/0001-1.5-fix-boost-asio.patch b/recipes/quickfast/all/patches/0001-1.5-fix-boost-asio.patch new file mode 100644 index 0000000000000..379f2376249fb --- /dev/null +++ b/recipes/quickfast/all/patches/0001-1.5-fix-boost-asio.patch @@ -0,0 +1,44 @@ +diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h +index 3574df8..5e21e89 100644 +--- a/src/Common/QuickFASTPch.h ++++ b/src/Common/QuickFASTPch.h +@@ -32,7 +32,6 @@ + #include + + // If building for .NET, must link boost threads dynamically +-#define BOOST_THREAD_USE_DLL + // This reports at compile time which boost libraries will be used + // #define BOOST_LIB_DIAGNOSTIC + +diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h +index 4f61915..b5fa821 100644 +--- a/src/Communication/AsioService.h ++++ b/src/Communication/AsioService.h +@@ -24,7 +24,7 @@ namespace QuickFAST + /// Normal case is for all classes derived from AsioService to share + /// the same boost::io_service. The alternate constructor gives the + /// application more control if it is needed. +- class QuickFAST_Export AsioService ++ class QuickFAST_Export AsioService : public boost::asio::io_service + { + public: + /// @brief Construct using the internal, common io service +diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h +index dc2f235..8d9be19 100644 +--- a/src/Communication/AsioService_fwd.h ++++ b/src/Communication/AsioService_fwd.h +@@ -13,13 +13,7 @@ + + // forward declare io_service without including + // boost header +-namespace boost +-{ +- namespace asio +- { +- class io_service; +- } +-} ++#include + + namespace QuickFAST + { diff --git a/recipes/quickfast/all/patches/0001-cci.20170314-fix-boost-asio.patch b/recipes/quickfast/all/patches/0001-cci.20170314-fix-boost-asio.patch new file mode 100644 index 0000000000000..c18362970703c --- /dev/null +++ b/recipes/quickfast/all/patches/0001-cci.20170314-fix-boost-asio.patch @@ -0,0 +1,44 @@ +diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h +index 381f846..d3016bd 100644 +--- a/src/Common/QuickFASTPch.h ++++ b/src/Common/QuickFASTPch.h +@@ -36,7 +36,6 @@ + #include + + // If building for .NET, must link boost threads dynamically +-#define BOOST_THREAD_USE_DLL + // This reports at compile time which boost libraries will be used + // #define BOOST_LIB_DIAGNOSTIC + +diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h +index 4f61915..b5fa821 100644 +--- a/src/Communication/AsioService.h ++++ b/src/Communication/AsioService.h +@@ -24,7 +24,7 @@ namespace QuickFAST + /// Normal case is for all classes derived from AsioService to share + /// the same boost::io_service. The alternate constructor gives the + /// application more control if it is needed. +- class QuickFAST_Export AsioService ++ class QuickFAST_Export AsioService : public boost::asio::io_service + { + public: + /// @brief Construct using the internal, common io service +diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h +index dc2f235..8d9be19 100644 +--- a/src/Communication/AsioService_fwd.h ++++ b/src/Communication/AsioService_fwd.h +@@ -13,13 +13,7 @@ + + // forward declare io_service without including + // boost header +-namespace boost +-{ +- namespace asio +- { +- class io_service; +- } +-} ++#include + + namespace QuickFAST + { diff --git a/recipes/quickfast/all/test_package/CMakeLists.txt b/recipes/quickfast/all/test_package/CMakeLists.txt index 05ee1b02f3e86..de906d5745a41 100644 --- a/recipes/quickfast/all/test_package/CMakeLists.txt +++ b/recipes/quickfast/all/test_package/CMakeLists.txt @@ -1,11 +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(quickfast REQUIRED CONFIG) add_executable(test ${PROJECT_SOURCE_DIR}/main.cpp) - -target_link_libraries(test ${CONAN_LIBS}) - -set_property(TARGET test PROPERTY CXX_STANDARD 11) +target_link_libraries(test PRIVATE quickfast::quickfast) +target_compile_features(test PRIVATE cxx_std_11) diff --git a/recipes/quickfast/all/test_package/conanfile.py b/recipes/quickfast/all/test_package/conanfile.py index 9f2cb9b06805b..ab9a844efa050 100644 --- a/recipes/quickfast/all/test_package/conanfile.py +++ b/recipes/quickfast/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 QuickfastTestConan(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") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test") + self.run(bin_path, env="conanrun") diff --git a/recipes/quickfast/all/test_package/main.cpp b/recipes/quickfast/all/test_package/main.cpp index 5adcb1b48cd8f..035eaf9d16cd3 100644 --- a/recipes/quickfast/all/test_package/main.cpp +++ b/recipes/quickfast/all/test_package/main.cpp @@ -1,37 +1,12 @@ -#include "Application/QuickFAST.h" -#include "Codecs/MessageConsumer.h" -#include "Codecs/GenericMessageBuilder.h" +#include +#include -using namespace QuickFAST; +#include +#include -class MessageInterpreter : public Codecs::MessageConsumer -{ -public: - MessageInterpreter(std::ostream & out, bool silent = false){ }; - virtual ~MessageInterpreter(){ }; - void setLogLevel(Common::Logger::LogLevel level){ }; - virtual bool consumeMessage(Messages::Message & message){return true;} - virtual bool wantLog(unsigned short level){return true;} - virtual bool logMessage(unsigned short level, const std::string & logMessage){return true;} - virtual bool reportDecodingError(const std::string & errorMessage){return true;} - virtual bool reportCommunicationError(const std::string & errorMessage){return true;} - virtual void decodingStarted(){ } - virtual void decodingStopped(){ } -}; +int main() { + const auto field = QuickFAST::Messages::FieldAscii::create("Hello, World!"); + std::cout << field->toAscii() << std::endl; -int main(int argc, char* argv[]) -{ - Application::DecoderConfiguration configuration_; - Application::DecoderConnection connection_; - - try - { - MessageInterpreter handler(std::cout); - Codecs::GenericMessageBuilder builder(handler); - connection_.configure(builder, configuration_); - connection_.run(); - } - catch (std::exception &) - { - } + return EXIT_SUCCESS; } diff --git a/recipes/quickfast/config.yml b/recipes/quickfast/config.yml index 4aad8295800a6..aafc5449a0ecd 100644 --- a/recipes/quickfast/config.yml +++ b/recipes/quickfast/config.yml @@ -1,5 +1,5 @@ versions: - "1.5": - folder: all "cci.20170314": folder: all + "1.5": + folder: all diff --git a/recipes/quickfix/all/test_v1_package/CMakeLists.txt b/recipes/quickfix/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/quickfix/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 3148dc9605e6c..0000000000000 --- a/recipes/quickfix/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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..2d8f20f6c78c6 100644 --- a/recipes/quickjs/all/CMakeLists.txt +++ b/recipes/quickjs/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(quickjs C) option(USE_BIGNUM "Use bignum" ON) @@ -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..ab82a3e06acc3 100644 --- a/recipes/quickjs/all/conandata.yml +++ b/recipes/quickjs/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2024-01-13": + url: "https://bellard.org/quickjs/quickjs-2024-01-13.tar.xz" + sha256: "3c4bf8f895bfa54beb486c8d1218112771ecfc5ac3be1036851ef41568212e03" + "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..938f04d5b02f0 100644 --- a/recipes/quickjs/all/conanfile.py +++ b/recipes/quickjs/all/conanfile.py @@ -2,11 +2,12 @@ from conan.tools.files import get, copy from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class QuickJSConan(ConanFile): name = "quickjs" @@ -35,21 +36,14 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(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 +54,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 +76,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..8a924859ac88f 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) +cmake_minimum_required(VERSION 3.15) +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 deleted file mode 100644 index 4c0436c623e76..0000000000000 --- a/recipes/quickjs/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(test_package C) - -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) diff --git a/recipes/quickjs/all/test_v1_package/conanfile.py b/recipes/quickjs/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/quickjs/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/quickjs/config.yml b/recipes/quickjs/config.yml index 4110c6ceb7c0f..3e2d478571404 100644 --- a/recipes/quickjs/config.yml +++ b/recipes/quickjs/config.yml @@ -1,3 +1,7 @@ versions: + "2024-01-13": + folder: "all" + "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 b6e754cda2c2e..3f0e136fcf3f4 100644 --- a/recipes/quill/all/conandata.yml +++ b/recipes/quill/all/conandata.yml @@ -1,49 +1,40 @@ 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" - "2.8.0": - url: "https://github.com/odygrd/quill/archive/v2.8.0.tar.gz" - sha256: "0461a6c314e3d882f3b9ada487ef1bf558925272509ee41a9fd25f7776db6075" - "2.7.0": - url: "https://github.com/odygrd/quill/archive/v2.7.0.tar.gz" - sha256: "10b8912e4c463a3a86b809076b95bec49aa08393d9ae6b92196cd46314236b87" - "2.6.0": - url: "https://github.com/odygrd/quill/archive/v2.6.0.tar.gz" - sha256: "d72fd5a01bf8d3e59ed93a789a8f103bc31efe0fb3c09182c74036a2e3a8451b" - "1.7.3": - url: "https://github.com/odygrd/quill/archive/v1.7.3.tar.gz" - sha256: "3fff0c5ffb19bbde5429369079741f84a6acce3a781b504cec5e677b05461208" + "9.0.2": + url: "https://github.com/odygrd/quill/releases/download/v9.0.2/quill-9.0.2.zip" + sha256: "86ae2f9ba67ebe0b8c3e01a053340424420e18da1bc0cc040d27f99b13e5ce92" + "8.2.0": + url: "https://github.com/odygrd/quill/releases/download/v8.2.0/quill-8.2.0.zip" + sha256: "846a2ace10e4d5482215e4c2461eb9b157a1b4d7f485700233b06d393cab97c4" + "8.1.0": + url: "https://github.com/odygrd/quill/releases/download/v8.1.0/quill-8.1.0.zip" + sha256: "11cf2cfb96e2a0ef28ce4b3ba6795cab5d8d1a04fea84805310bbb2d57f0a657" + "7.5.0": + url: "https://github.com/odygrd/quill/releases/download/v7.5.0/quill-7.5.0.zip" + sha256: "cb0b7d43e54af7cb7ea912d2079eb439d185ddc5fe684f8297d28bb25015d503" + "7.4.0": + url: "https://github.com/odygrd/quill/releases/download/v7.4.0/quill-7.4.0.zip" + sha256: "298820c6e18e87070e01d0d11cb35de2d5007718e2a81f9ec9533b75d6233eac" + "7.3.0": + url: "https://github.com/odygrd/quill/releases/download/v7.3.0/quill-7.3.0.zip" + sha256: "ec58fadeecae50a331018ac0893d9d5d4dec7726cc213f9a343e12bb3fd4e50a" + "7.2.2": + url: "https://github.com/odygrd/quill/releases/download/v7.2.2/quill-7.2.2.zip" + sha256: "3b908f498e1a04b5bf2098108461ff2fab9c3350fccae62c96e54c0f868c00be" + "7.2.1": + url: "https://github.com/odygrd/quill/releases/download/v7.2.1/quill-7.2.1.zip" + sha256: "5ca27bbb8866489a9c2fb1da628d9ddfed423cbba1dd1d07c793d7a8237cfaab" + "7.1.0": + url: "https://github.com/odygrd/quill/releases/download/v7.1.0/quill-7.1.0.zip" + sha256: "3edd1e142ae1a5b6d548c8af5bcf4339bf5889e49ade0806a4269c9587b954ae" + "6.1.0": + url: "https://github.com/odygrd/quill/releases/download/v6.1.0/quill-6.1.0.zip" + sha256: "114bea9d3e4f1ef06a3c48c4e5554a1a3cba182731495e229f2d28f8aef04467" + "6.0.0": + url: "https://github.com/odygrd/quill/releases/download/v6.0.0/quill-6.0.0.zip" + sha256: "912de8486ce781d06e3f03c4267d112a0c7f20f93f0470f6ac66a52774c08283" + "4.5.0": + url: "https://github.com/odygrd/quill/releases/download/v4.5.0/quill-4.5.0.zip" + sha256: "cfd579e58c71f884835079287fb0212278de56c0fbbb1484a8e8b26a5e73642e" + "4.4.1": + url: "https://github.com/odygrd/quill/releases/download/v4.4.1/quill-v4.4.1.zip" + sha256: "56587af304f152445bc3594c328521666e04e580200f7a4bbc5e842fc0d7868f" diff --git a/recipes/quill/all/conanfile.py b/recipes/quill/all/conanfile.py index 311710c99f8c5..beadc3d51e802 100644 --- a/recipes/quill/all/conanfile.py +++ b/recipes/quill/all/conanfile.py @@ -1,10 +1,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, copy, rmdir, replace_in_file +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.microsoft import is_msvc +from conan.tools.layout import basic_layout import os @@ -16,60 +15,28 @@ class QuillConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/odygrd/quill/" - topics = ("logging", "log", "async") - package_type = "static-library" + topics = ("logging", "log", "async", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" - options = { - "fPIC": [True, False], - "with_bounded_queue": [True, False], - "with_no_exceptions": [True, False], - "with_x86_arch": [True, False], - "with_bounded_blocking_queue": [True, False], - } - default_options = { - "fPIC": True, - "with_bounded_queue": False, - "with_no_exceptions": False, - "with_x86_arch": False, - "with_bounded_blocking_queue": False, - } @property def _min_cppstd(self): - return "17" if Version(self.version) >= "2.0.0" else "14" + return "17" @property def _compilers_minimum_versions(self): return { - "14": - { - "gcc": "5", - "Visual Studio": "15", - "clang": "5", - "apple-clang": "10", - }, - "17": - { - "gcc": "8", - "Visual Studio": "16", - "clang": "7", - "apple-clang": "12", - }, + "gcc": "8", + "Visual Studio": "16", + "clang": "7", + "apple-clang": "12", } - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if Version(self.version) < "2.8.0": - del self.options.with_bounded_blocking_queue - def layout(self): - cmake_layout(self, src_folder="src") + basic_layout(self, src_folder="src") - def requirements(self): - self.requires("fmt/10.1.1", transitive_headers=True) + def package_id(self): + self.info.clear() def validate(self): supported_archs = ["x86", "x86_64", "armv6", "armv7", "armv7hf", "armv8"] @@ -80,95 +47,49 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - compilers_minimum_version = self._compilers_minimum_versions[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 Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") - else: - self.output.warning(f"{self.ref} requires C++{self._min_cppstd}. Your compiler is unknown. Assuming it supports C++{self._min_cppstd}.") - if Version(self.version) >= "2.0.0" and \ - self.settings.compiler== "clang" and Version(self.settings.compiler.version).major == "11" and \ + if self.settings.compiler== "clang" and Version(self.settings.compiler.version).major == "11" and \ self.settings.compiler.libcxx == "libstdc++": raise ConanInvalidConfiguration(f"{self.ref} requires C++ filesystem library, which your compiler doesn't support.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - def is_quilll_x86_arch(self): - if not self.options.with_x86_arch: - return False - if Version(self.version) < "2.7.0": - return False - if self.settings.arch not in ("x86", "x86_64"): - return False - if self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": - return False - if is_msvc(self): - return False - return True - - 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(): - if Version(self.version) < "2.8.0": - tc.variables["QUILL_X86ARCH"] = True - else: - tc.preprocessor_definitions["QUILL_X86ARCH"] = 1 - 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) - deps.generate() - def _patch_sources(self): # remove bundled fmt 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 "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")""" - ) def build(self): self._patch_sources() - 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, "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + if Version(self.version) < "7.0.0": + copy( + self, + "*.h", + os.path.join(self.source_folder, "quill", "include"), + os.path.join(self.package_folder, "include"), + ) + else: + 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 = ["quill"] - self.cpp_info.defines.append("QUILL_FMT_EXTERNAL") - if self.is_quilll_x86_arch(): - self.cpp_info.defines.append("QUILL_X86ARCH") - self.cpp_info.cxxflags.append("-mclflushopt") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") - if Version(self.version) >= "2.0.0" and \ - self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": + self.cpp_info.system_libs.append("rt") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.system_libs.append("stdc++fs") diff --git a/recipes/quill/all/test_package/CMakeLists.txt b/recipes/quill/all/test_package/CMakeLists.txt index b6b657d776df5..b030c8ca966de 100644 --- a/recipes/quill/all/test_package/CMakeLists.txt +++ b/recipes/quill/all/test_package/CMakeLists.txt @@ -1,16 +1,9 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(quill REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE quill::quill) -if(quill_VERSION VERSION_GREATER_EQUAL "2.0.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -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() +target_link_libraries(${PROJECT_NAME} PRIVATE quill::quill) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/quill/all/test_package/test_package.cpp b/recipes/quill/all/test_package/test_package.cpp index b02a6dd344b06..f3e9e28471bde 100644 --- a/recipes/quill/all/test_package/test_package.cpp +++ b/recipes/quill/all/test_package/test_package.cpp @@ -1,19 +1,45 @@ -#include "quill/Quill.h" +#include "quill/Backend.h" +#include "quill/Frontend.h" +#include "quill/LogMacros.h" +#include "quill/Logger.h" +#include "quill/sinks/ConsoleSink.h" + +#include +#include + +/** + * Trivial logging example to console + */ 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"); - LOG_CRITICAL(my_logger, "This is a conan example {}", 1234); + // Start the backend thread + quill::BackendOptions backend_options; + quill::Backend::start(backend_options); + + // Frontend + auto console_sink = quill::Frontend::create_or_get_sink("sink_id_1"); + quill::Logger* logger = quill::Frontend::create_or_get_logger("root", std::move(console_sink)); + + // Change the LogLevel to print everything + logger->set_log_level(quill::LogLevel::TraceL3); + + LOG_TRACE_L3(logger, "This is a log trace l3 example {}", 1); + LOG_TRACE_L2(logger, "This is a log trace l2 example {} {}", 2, 2.3); + LOG_TRACE_L1(logger, "This is a log trace l1 {} example", "string"); + LOG_DEBUG(logger, "This is a log debug example {}", 4); + LOG_INFO(logger, "This is a log info example {}", sizeof(std::string)); + LOG_WARNING(logger, "This is a log warning example {}", sizeof(std::string)); + LOG_ERROR(logger, "This is a log error example {}", sizeof(std::string)); + LOG_CRITICAL(logger, "This is a log critical example {}", sizeof(std::string)); + + // libfmt format specification mini language is supported + // note: named arguments are not supported + LOG_INFO(logger, "Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}", 42); + LOG_INFO(logger, "Easy padding in numbers like {:08d}", 12); + LOG_INFO(logger, "{:>30}", "right aligned"); + LOG_INFO(logger, "Positional arguments {1} {2} {0} ", "too", "are", "supported"); + LOG_INFO(logger, "Support for precision {:.4f}", 1.23456); + + return 0; } diff --git a/recipes/quill/all/test_v1_package/CMakeLists.txt b/recipes/quill/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/quill/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/quill/all/test_v1_package/conanfile.py b/recipes/quill/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/quill/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/quill/config.yml b/recipes/quill/config.yml index 3aa843c1a29c6..ffa3edf0cc032 100644 --- a/recipes/quill/config.yml +++ b/recipes/quill/config.yml @@ -1,33 +1,27 @@ versions: - "3.6.0": + "9.0.2": folder: "all" - "3.5.1": + "8.2.0": folder: "all" - "3.5.0": + "8.1.0": folder: "all" - "3.4.1": + "7.5.0": folder: "all" - "3.4.0": + "7.4.0": folder: "all" - "3.3.1": + "7.3.0": folder: "all" - "3.2.0": + "7.2.2": folder: "all" - "3.1.0": + "7.2.1": folder: "all" - "3.0.2": + "7.1.0": folder: "all" - "2.9.2": + "6.1.0": folder: "all" - "2.9.1": + "6.0.0": folder: "all" - "2.9.0": + "4.5.0": folder: "all" - "2.8.0": - folder: "all" - "2.7.0": - folder: "all" - "2.6.0": - folder: "all" - "1.7.3": + "4.4.1": folder: "all" diff --git a/recipes/quirc/all/CMakeLists.txt b/recipes/quirc/all/CMakeLists.txt index 5fed0b8bc7102..6f9d00d1f44c6 100644 --- a/recipes/quirc/all/CMakeLists.txt +++ b/recipes/quirc/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4.3) +cmake_minimum_required(VERSION 3.15) project(quirc LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/quirc/all/test_package/CMakeLists.txt b/recipes/quirc/all/test_package/CMakeLists.txt index 9a9aef36b5807..10a183157ab27 100644 --- a/recipes/quirc/all/test_package/CMakeLists.txt +++ b/recipes/quirc/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(quirc REQUIRED CONFIG) diff --git a/recipes/quirc/all/test_v1_package/CMakeLists.txt b/recipes/quirc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/quirc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/quirc/all/test_v1_package/conanfile.py b/recipes/quirc/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/quirc/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_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/qwt/all/conandata.yml b/recipes/qwt/all/conandata.yml index 31f56157576c0..7a05962ab45f3 100644 --- a/recipes/qwt/all/conandata.yml +++ b/recipes/qwt/all/conandata.yml @@ -4,6 +4,8 @@ sources: sha256: "3e9632a9be6a883db5c496e42ce74cbbf8da02cc3328faa89e2c43e434a2eb76" patches: "6.2.0": - - patch_file: "patches/cmake-support.patch" + - patch_file: "patches/0001-cmake-support.patch" patch_source: "https://github.com/MehdiChinoune/qwt/blob/cmake/CMakeLists.txt" - - patch_file: "patches/cmake-support-patch.patch" + - patch_file: "patches/0002-cmake-support-patch.patch" + - patch_file: "patches/0003-Fix-Build-error-with-Qt6-which-requires-CPP-17.patch" + patch_source: "https://github.com/ashley-b/qwt/commit/75aa20749186a263fd6942a764731826d5bac137" diff --git a/recipes/qwt/all/conanfile.py b/recipes/qwt/all/conanfile.py index 8cc76b47a4e49..41e8e99f827f4 100644 --- a/recipes/qwt/all/conanfile.py +++ b/recipes/qwt/all/conanfile.py @@ -1,18 +1,17 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import cross_building +from conan.tools.build import check_min_cppstd, cross_building from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.env import VirtualBuildEnv, VirtualRunEnv 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.60.0 <2.0 || >=2.0.5" +required_conan_version = ">=2.0.5" class QwtConan(ConanFile): name = "qwt" - license = "LGPL-2.1-or-later" + license = "LGPL-2.1+ WITH Qwt-exception-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://qwt.sourceforge.io/" topics = ("chart", "data-visualization", "graph", "plot", "qt") @@ -44,10 +43,6 @@ 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) @@ -63,11 +58,20 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/5.15.11", transitive_headers=True, transitive_libs=True) + self.requires("qt/[>=5.15 <7]", transitive_headers=True, transitive_libs=True) + self.tool_requires("cmake/[>=3.27 <4]") #For CMAKE_AUTOMOC_EXECUTABLE def validate(self): - if hasattr(self, "settings_build") and cross_building(self): - raise ConanInvalidConfiguration("Qwt recipe does not support cross-compilation yet") + qt_version = Version(self.dependencies["qt"].ref.version) + + if qt_version.major == 5: + check_min_cppstd(self, 11) + elif qt_version.major == 6: + check_min_cppstd(self, 17) + + if cross_building(self) and qt_version.major == 5: + raise ConanInvalidConfiguration("Cross-building with Qt5 is not supported") + qt_options = self.dependencies["qt"].options if self.options.widgets and not qt_options.widgets: raise ConanInvalidConfiguration("qwt:widgets=True requires qt:widgets=True") @@ -79,21 +83,15 @@ def validate(self): raise ConanInvalidConfiguration("qwt:designer=True requires qt:qttools=True, qt::gui=True and qt::widgets=True") def build_requirements(self): - if not self._is_legacy_one_profile: - self.tool_requires("qt/") + self.tool_requires("qt/") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - if self._is_legacy_one_profile: - env = VirtualRunEnv(self) - env.generate(scope="build") - else: - env = VirtualBuildEnv(self) - env.generate() - tc = CMakeToolchain(self) + qt_version = Version(self.dependencies["qt"].ref.version) + tc.variables["QWT_QT_VERSION_MAJOR"] = qt_version.major tc.variables["QWT_DLL"] = self.options.shared tc.variables["QWT_STATIC"] = not self.options.shared tc.variables["QWT_PLOT"] = self.options.plot @@ -107,6 +105,11 @@ def generate(self): tc.variables["QWT_BUILD_TESTS"] = False tc.variables["QWT_FRAMEWORK"] = False tc.variables["CMAKE_INSTALL_DATADIR"] = "res" + + if qt_version >= "6.0.0": + qt_tools_rootdir = self.conf.get("user.qt:tools_directory", None) + tc.cache_variables["CMAKE_AUTOMOC_EXECUTABLE"] = os.path.join(qt_tools_rootdir, "moc.exe" if self.settings_build.os == "Windows" else "moc") + tc.cache_variables["CMAKE_AUTORCC_EXECUTABLE"] = os.path.join(qt_tools_rootdir, "rcc.exe" if self.settings_build.os == "Windows" else "rcc") tc.generate() deps = CMakeDeps(self) @@ -155,6 +158,3 @@ def package_info(self): f"qt{Version(self.dependencies['qt'].ref.version).major}", "plugins", ) self.runenv_info.prepend_path("QT_PLUGIN_PATH", qt_plugin_path) - - # TODO: to remove in conan v2 - self.env_info.QT_PLUGIN_PATH.append(qt_plugin_path) diff --git a/recipes/qwt/all/patches/cmake-support.patch b/recipes/qwt/all/patches/0001-cmake-support.patch similarity index 100% rename from recipes/qwt/all/patches/cmake-support.patch rename to recipes/qwt/all/patches/0001-cmake-support.patch diff --git a/recipes/qwt/all/patches/cmake-support-patch.patch b/recipes/qwt/all/patches/0002-cmake-support-patch.patch similarity index 100% rename from recipes/qwt/all/patches/cmake-support-patch.patch rename to recipes/qwt/all/patches/0002-cmake-support-patch.patch diff --git a/recipes/qwt/all/patches/0003-Fix-Build-error-with-Qt6-which-requires-CPP-17.patch b/recipes/qwt/all/patches/0003-Fix-Build-error-with-Qt6-which-requires-CPP-17.patch new file mode 100644 index 0000000000000..9ab336dd938e7 --- /dev/null +++ b/recipes/qwt/all/patches/0003-Fix-Build-error-with-Qt6-which-requires-CPP-17.patch @@ -0,0 +1,64 @@ +From fc8e1ba33ca4db5a9b07072734025dcd9ad53d58 Mon Sep 17 00:00:00 2001 +From: Ashley Brighthope +Date: Mon, 6 Mar 2023 19:19:40 +1100 +Subject: [PATCH] Fix: Build error with Qt6, which requires C++17 + +Removed enforced C++ version of 11 to be a minimum version of C++ 11 +--- + CMakeLists.txt | 4 ---- + designer/CMakeLists.txt | 6 ++++++ + src/CMakeLists.txt | 6 ++++++ + 3 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b42d510..469fa28 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,10 +7,6 @@ project(Qwt + LANGUAGES CXX + ) + +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +-set(CMAKE_CXX_EXTENSIONS OFF) +- + if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /permissive-") + else() +diff --git a/designer/CMakeLists.txt b/designer/CMakeLists.txt +index aa81efd..98db4b3 100644 +--- a/designer/CMakeLists.txt ++++ b/designer/CMakeLists.txt +@@ -18,6 +18,12 @@ else() + target_link_libraries(qwt_designer_plugin PRIVATE qwt) + endif() + ++if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) ++ target_compile_features(qwt_designer_plugin PUBLIC cxx_std_17) ++else() ++ target_compile_features(qwt_designer_plugin PUBLIC cxx_std_11) ++endif() ++ + target_link_libraries(qwt_designer_plugin PUBLIC Qt${QT_VERSION_MAJOR}::Designer) + + set_target_properties(qwt_designer_plugin PROPERTIES +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d25655a..2714b4f 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -285,6 +285,12 @@ endif() + + add_library(qwt_objects OBJECT ${SOURCES} ${HEADERS}) + ++if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) ++ target_compile_features(qwt_objects PUBLIC cxx_std_17) ++else() ++ target_compile_features(qwt_objects PUBLIC cxx_std_11) ++endif() ++ + target_include_directories(qwt_objects INTERFACE + $ + $ +-- +2.43.0 + diff --git a/recipes/qwt/all/test_package/CMakeLists.txt b/recipes/qwt/all/test_package/CMakeLists.txt index 162eed68d6d65..e82329678a78f 100644 --- a/recipes/qwt/all/test_package/CMakeLists.txt +++ b/recipes/qwt/all/test_package/CMakeLists.txt @@ -1,12 +1,24 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(qwt REQUIRED CONFIG) -find_package(Qt5 REQUIRED Core CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE qwt::qwt Qt5::Core) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(QT_VERSION VERSION_GREATER_EQUAL "6.0.0") + find_package(Qt6 REQUIRED COMPONENTS Core CONFIG) + target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +elseif(QT_VERSION VERSION_GREATER_EQUAL "5.0.0") + find_package(Qt5 COMPONENTS Core REQUIRED CONFIG) + target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +else() + message(FATAL_ERROR "Qt < 5 is not supported by this recipe") +endif() + +target_link_libraries(${PROJECT_NAME} PRIVATE qwt::qwt) + if(NOT WIN32) # Must compile with "-fPIC" since Qt was built with -reduce-relocations. target_compile_options(${PROJECT_NAME} PRIVATE -fPIC) diff --git a/recipes/qwt/all/test_package/conanfile.py b/recipes/qwt/all/test_package/conanfile.py index 0a6bc68712d90..b6d943f1299fb 100644 --- a/recipes/qwt/all/test_package/conanfile.py +++ b/recipes/qwt/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["QT_VERSION"] = self.dependencies["qt"].ref.version + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/qwt/all/test_v1_package/CMakeLists.txt b/recipes/qwt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/qwt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/qwt/all/test_v1_package/conanfile.py b/recipes/qwt/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/qwt/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_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/qxlsx/all/conandata.yml b/recipes/qxlsx/all/conandata.yml index 68d91ea6c0831..6fe82782f6bed 100644 --- a/recipes/qxlsx/all/conandata.yml +++ b/recipes/qxlsx/all/conandata.yml @@ -1,18 +1,18 @@ sources: + "1.4.9": + url: "https://github.com/QtExcel/QXlsx/archive/refs/tags/v1.4.9.zip" + sha256: "2582c8929163c267658ed65b5b1d3e2edff34c2dd53a6e34ea5f4d3e3f7359cd" "1.4.5": url: "https://github.com/QtExcel/QXlsx/archive/refs/tags/v1.4.5.zip" sha256: "eadcad2718335673f86fe20fd91e822e6c1e3624483be9d79cf79254e5426067" - "1.4.4": - url: "https://github.com/QtExcel/QXlsx/archive/refs/tags/v1.4.4.zip" - sha256: "3efbd6f63a1ffd521c535dce7b5a5a7e9ebd23db51e6ae8e3e2eb89796e57675" - "1.4.3": - url: "https://github.com/QtExcel/QXlsx/archive/refs/tags/v1.4.3.zip" - sha256: "d2f7c6aff71f2f30ade8d8020682e36a3d63f422a5d2f1c5831b55573241bd4a" patches: - "1.4.3": - - patch_file: "patches/1.4.3/0001-allow-shared.patch" - patch_type: "conan" - patch_source: "https://github.com/QtExcel/QXlsx/pull/197" - - patch_file: "patches/1.4.3/0002-add-install-target.patch" - patch_type: "conan" - patch_source: "https://github.com/QtExcel/QXlsx/pull/197" + "1.4.5": + - patch_file: "patches/1.4.5-0001-fix-qt6-version.patch" + patch_description: "Fix Qt find package version" + patch_type: "portability" + patch_source: "https://github.com/QtExcel/QXlsx/commit/08c8128e9b533de15127a5cfd0fc69122a2d82d9" + "1.4.9": + - patch_file: "patches/1.4.9-0001-fix-qstring-error.patch" + patch_description: "Fix a QString compilation error" + patch_type: "backport" + patch_source: "https://github.com/QtExcel/QXlsx/commit/11bafef83286e79a95f17773926b62253ba53cab" diff --git a/recipes/qxlsx/all/conanfile.py b/recipes/qxlsx/all/conanfile.py index 28fac77f7f2b5..c4f0d548df54a 100644 --- a/recipes/qxlsx/all/conanfile.py +++ b/recipes/qxlsx/all/conanfile.py @@ -1,16 +1,19 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, 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 export_conandata_patches, apply_conandata_patches, copy, get, rmdir from conan.tools.scm import Version +from conan.tools.env import VirtualRunEnv +from conan.tools.microsoft import is_msvc +from conan.tools.build import check_min_cppstd +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0.9" class QXlsxConan(ConanFile): name = "qxlsx" - description = "Excel file(*.xlsx) reader/writer library using Qt 5 or 6." + description = "Excel file (*.xlsx) reader/writer library using Qt 5 or 6." license = "MIT" topics = ("excel", "xlsx") homepage = "https://github.com/QtExcel/QXlsx" @@ -25,40 +28,46 @@ class QXlsxConan(ConanFile): "shared": False, "fPIC": True, } + implements = ["auto_shared_fpic"] @property def _qt_version(self): - return Version(self.dependencies["qt"].ref.version).major + return str(Version(self.dependencies["qt"].ref.version).major) def export_sources(self): export_conandata_patches(self) - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("qt/5.15.9") + # INFO: QXlsx/xlsxdocument.h includes QtGlobal + # INFO: transitive libs: undefined reference to symbol '_ZN10QArrayData10deallocateEPS_mm@@Qt_5' + self.requires("qt/[>=6.7 <7]", transitive_headers=True, transitive_libs=True) + + def validate(self): + check_min_cppstd(self, 11) + if not self.dependencies["qt"].options.gui: + raise ConanInvalidConfiguration(f"{self.ref} requires Qt with gui component. Use '-o qt/*:gui=True'") def build_requirements(self): - if Version(self.version) >= "1.4.4": - self.tool_requires("cmake/[>=3.16 <4]") + self.tool_requires("cmake/[>=3.16 <4]") + # INFO: QXlsx use Qt automoc: https://github.com/QtExcel/QXlsx/blob/v1.4.9/QXlsx/CMakeLists.txt#L12 + self.tool_requires("qt/") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - tc = VirtualBuildEnv(self) - tc.generate() + # INFO: In order to find Qt moc application + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = CMakeToolchain(self) - tc.variables["QT_VERSION_MAJOR"] = self._qt_version + tc.cache_variables["QT_VERSION_MAJOR"] = self._qt_version + # INFO: QXlsx use cached CMAKE_CXX_STANDARD value: + # https://github.com/QtExcel/QXlsx/blob/v1.4.9/QXlsx/CMakeLists.txt#L23 + tc.cache_variables["CMAKE_CXX_STANDARD"] = self.settings.get_safe("compiler.cppstd").replace("gnu", "") tc.generate() tc = CMakeDeps(self) tc.generate() @@ -66,30 +75,23 @@ def generate(self): def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure(build_script_folder="QXlsx") + cmake.configure(build_script_folder=os.path.join(self.source_folder, "QXlsx")) 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.configure(build_script_folder="QXlsx") cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "QXlsx") - self.cpp_info.set_property("cmake_target_name", "QXlsx::Core") - # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - if Version(self.version) <= "1.4.4": - self.cpp_info.components["qxlsx_core"].libs = ["QXlsx"] - else: - self.cpp_info.components["qxlsx_core"].libs = [f"QXlsxQt{self._qt_version}"] - self.cpp_info.components["qxlsx_core"].includedirs = [os.path.join("include", "QXlsx")] - self.cpp_info.components["qxlsx_core"].requires = ["qt::qtCore", "qt::qtGui"] - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "QXlsx" - self.cpp_info.names["cmake_find_package_multi"] = "QXlsx" - self.cpp_info.components["qxlsx_core"].names["cmake_find_package"] = "Core" - self.cpp_info.components["qxlsx_core"].names["cmake_find_package_multi"] = "Core" - self.cpp_info.components["qxlsx_core"].set_property("cmake_target_name", "QXlsx::Core") + cmake_name = f"QXlsxQt{self._qt_version}" + self.cpp_info.set_property("cmake_file_name", cmake_name) + self.cpp_info.set_property("cmake_target_name", "QXlsx::QXlsx") + self.cpp_info.set_property("cmake_target_aliases", ["QXlsx"]) + self.cpp_info.libs = [cmake_name] + includedir = f"QXlsxQt{self._qt_version}" if Version(self.version) >= "1.4.6" else "QXlsx" + self.cpp_info.includedirs = ["include", os.path.join("include", includedir)] + self.cpp_info.requires = ["qt::qtCore", "qt::qtGui"] + if is_msvc(self) and self.options.shared: + self.cpp_info.defines = ["QXlsx_SHAREDLIB"] diff --git a/recipes/qxlsx/all/patches/1.4.3/0001-allow-shared.patch b/recipes/qxlsx/all/patches/1.4.3/0001-allow-shared.patch deleted file mode 100644 index b640cac70894b..0000000000000 --- a/recipes/qxlsx/all/patches/1.4.3/0001-allow-shared.patch +++ /dev/null @@ -1,218 +0,0 @@ ---- a/QXlsx/CMakeLists.txt -+++ b/QXlsx/CMakeLists.txt -@@ -39,7 +39,7 @@ file(GLOB QXLSX_H "${QXLSX_HEADERPATH}/*.h") - set(SRC_FILES ${QXLSX_CPP}) - list(APPEND SRC_FILES ${QXLSX_H}) - --add_library(QXlsx STATIC -+add_library(QXlsx - ${SRC_FILES} ) - - target_include_directories(QXlsx PRIVATE ${QXLSX_HEADERPATH}) -@@ -50,3 +50,6 @@ target_link_libraries(${PROJECT_NAME} - ) - - target_compile_definitions(QXlsx PRIVATE QXLSX_LIBRARY) -+if (BUILD_SHARED_LIBS) -+ target_compile_definitions(QXlsx PRIVATE QXLSX_SHARED) -+endif() ---- a/QXlsx/header/xlsxabstractooxmlfile.h -+++ b/QXlsx/header/xlsxabstractooxmlfile.h -@@ -10,7 +10,7 @@ QT_BEGIN_NAMESPACE_XLSX - class Relationships; - class AbstractOOXmlFilePrivate; - --class AbstractOOXmlFile -+class QXLSX_EXPORT AbstractOOXmlFile - { - Q_DECLARE_PRIVATE(AbstractOOXmlFile) - ---- a/QXlsx/header/xlsxabstractsheet.h -+++ b/QXlsx/header/xlsxabstractsheet.h -@@ -12,7 +12,7 @@ class Workbook; - class Drawing; - class AbstractSheetPrivate; - --class AbstractSheet : public AbstractOOXmlFile -+class QXLSX_EXPORT AbstractSheet : public AbstractOOXmlFile - { - Q_DECLARE_PRIVATE(AbstractSheet) - ---- a/QXlsx/header/xlsxcell.h -+++ b/QXlsx/header/xlsxcell.h -@@ -24,7 +24,7 @@ class CellFormula; - class CellPrivate; - class WorksheetPrivate; - --class Cell -+class QXLSX_EXPORT Cell - { - Q_DECLARE_PRIVATE(Cell) - ---- a/QXlsx/header/xlsxcellformula.h -+++ b/QXlsx/header/xlsxcellformula.h -@@ -17,7 +17,7 @@ class CellRange; - class Worksheet; - class WorksheetPrivate; - --class CellFormula -+class QXLSX_EXPORT CellFormula - { - public: - enum FormulaType { NormalType, ArrayType, DataTableType, SharedType }; ---- a/QXlsx/header/xlsxcelllocation.h -+++ b/QXlsx/header/xlsxcelllocation.h -@@ -17,7 +17,7 @@ QT_BEGIN_NAMESPACE_XLSX - - class Cell; - --class CellLocation -+class QXLSX_EXPORT CellLocation - { - public: - CellLocation(); ---- a/QXlsx/header/xlsxcellrange.h -+++ b/QXlsx/header/xlsxcellrange.h -@@ -12,7 +12,7 @@ - QT_BEGIN_NAMESPACE_XLSX - - // dev57 --class CellRange -+class QXLSX_EXPORT CellRange - { - public: - CellRange(); ---- a/QXlsx/header/xlsxcellreference.h -+++ b/QXlsx/header/xlsxcellreference.h -@@ -9,7 +9,7 @@ - - QT_BEGIN_NAMESPACE_XLSX - --class CellReference -+class QXLSX_EXPORT CellReference - { - public: - CellReference(); ---- a/QXlsx/header/xlsxchart.h -+++ b/QXlsx/header/xlsxchart.h -@@ -18,7 +18,7 @@ class ChartPrivate; - class CellRange; - class DrawingAnchor; - --class Chart : public AbstractOOXmlFile -+class QXLSX_EXPORT Chart : public AbstractOOXmlFile - { - Q_DECLARE_PRIVATE(Chart) - public: ---- a/QXlsx/header/xlsxchartsheet.h -+++ b/QXlsx/header/xlsxchartsheet.h -@@ -16,7 +16,7 @@ class DocumentPrivate; - class ChartsheetPrivate; - class Chart; - --class Chartsheet : public AbstractSheet -+class QXLSX_EXPORT Chartsheet : public AbstractSheet - { - Q_DECLARE_PRIVATE(Chartsheet) - ---- a/QXlsx/header/xlsxconditionalformatting.h -+++ b/QXlsx/header/xlsxconditionalformatting.h -@@ -24,7 +24,7 @@ class Worksheet; - class Styles; - class ConditionalFormattingPrivate; - --class ConditionalFormatting -+class QXLSX_EXPORT ConditionalFormatting - { - public: - enum HighlightRuleType { ---- a/QXlsx/header/xlsxdatavalidation.h -+++ b/QXlsx/header/xlsxdatavalidation.h -@@ -22,7 +22,7 @@ class CellRange; - class CellReference; - - class DataValidationPrivate; --class DataValidation -+class QXLSX_EXPORT DataValidation - { - public: - enum ValidationType ---- a/QXlsx/header/xlsxdatetype.h -+++ b/QXlsx/header/xlsxdatetype.h -@@ -15,7 +15,7 @@ - - QT_BEGIN_NAMESPACE_XLSX - --class DateType -+class QXLSX_EXPORT DateType - { - public: - DateType(); ---- a/QXlsx/header/xlsxdocument.h -+++ b/QXlsx/header/xlsxdocument.h -@@ -24,7 +24,7 @@ class Chart; - class CellReference; - class DocumentPrivate; - --class Document : public QObject -+class QXLSX_EXPORT Document : public QObject - { - Q_OBJECT - Q_DECLARE_PRIVATE(Document) // D-Pointer. Qt classes have a Q_DECLARE_PRIVATE ---- a/QXlsx/header/xlsxformat.h -+++ b/QXlsx/header/xlsxformat.h -@@ -24,7 +24,7 @@ class SharedStrings; - - class FormatPrivate; - --class Format -+class QXLSX_EXPORT Format - { - public: - enum FontScript ---- a/QXlsx/header/xlsxglobal.h -+++ b/QXlsx/header/xlsxglobal.h -@@ -30,4 +30,10 @@ - #define Q_DECL_NOTHROW - #endif - -+#ifdef QXLSX_SHARED -+#define QXLSX_EXPORT Q_DECL_EXPORT -+#else -+#define QXLSX_EXPORT -+#endif -+ - #endif // XLSXGLOBAL_H ---- a/QXlsx/header/xlsxrichstring.h -+++ b/QXlsx/header/xlsxrichstring.h -@@ -37,7 +37,7 @@ class RichString; - // qHash is a friend, but we can't use default arguments for friends (§8.3.6.4) - uint qHash(const RichString &rs, uint seed = 0) Q_DECL_NOTHROW; - --class RichString -+class QXLSX_EXPORT RichString - { - public: - RichString(); ---- a/QXlsx/header/xlsxworkbook.h -+++ b/QXlsx/header/xlsxworkbook.h -@@ -28,7 +28,7 @@ class Chartsheet; - class Worksheet; - class WorkbookPrivate; - --class Workbook : public AbstractOOXmlFile -+class QXLSX_EXPORT Workbook : public AbstractOOXmlFile - { - Q_DECLARE_PRIVATE(Workbook) - public: ---- a/QXlsx/header/xlsxworksheet.h -+++ b/QXlsx/header/xlsxworksheet.h -@@ -37,7 +37,7 @@ class Relationships; - class Chart; - - class WorksheetPrivate; --class Worksheet : public AbstractSheet -+class QXLSX_EXPORT Worksheet : public AbstractSheet - { - Q_DECLARE_PRIVATE(Worksheet) - diff --git a/recipes/qxlsx/all/patches/1.4.3/0002-add-install-target.patch b/recipes/qxlsx/all/patches/1.4.3/0002-add-install-target.patch deleted file mode 100644 index 48125aa4d3f43..0000000000000 --- a/recipes/qxlsx/all/patches/1.4.3/0002-add-install-target.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/QXlsx/CMakeLists.txt -+++ b/QXlsx/CMakeLists.txt -@@ -53,3 +53,34 @@ target_compile_definitions(QXlsx PRIVATE QXLSX_LIBRARY) - if (BUILD_SHARED_LIBS) - target_compile_definitions(QXlsx PRIVATE QXLSX_SHARED) - endif() -+ -+set(QXLSX_PUBLIC_HEADERS -+ header/xlsxdocument.h -+ header/xlsxabstractooxmlfile.h -+ header/xlsxabstractsheet.h -+ header/xlsxabstractsheet_p.h -+ header/xlsxcellformula.h -+ header/xlsxcell.h -+ header/xlsxcelllocation.h -+ header/xlsxcellrange.h -+ header/xlsxcellreference.h -+ header/xlsxchart.h -+ header/xlsxchartsheet.h -+ header/xlsxconditionalformatting.h -+ header/xlsxdatavalidation.h -+ header/xlsxdatetype.h -+ header/xlsxdocument.h -+ header/xlsxformat.h -+ header/xlsxglobal.h -+ header/xlsxrichstring.h -+ header/xlsxworkbook.h -+ header/xlsxworksheet.h -+) -+set_property(TARGET QXlsx PROPERTY PUBLIC_HEADER ${QXLSX_PUBLIC_HEADERS}) -+include(GNUInstallDirs) -+install(TARGETS QXlsx -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/QXlsx -+) diff --git a/recipes/qxlsx/all/patches/1.4.5-0001-fix-qt6-version.patch b/recipes/qxlsx/all/patches/1.4.5-0001-fix-qt6-version.patch new file mode 100644 index 0000000000000..74dd1e56db069 --- /dev/null +++ b/recipes/qxlsx/all/patches/1.4.5-0001-fix-qt6-version.patch @@ -0,0 +1,13 @@ +diff --git a/QXlsx/CMakeLists.txt b/QXlsx/CMakeLists.txt +index 7207f94..5cbb2dd 100644 +--- a/QXlsx/CMakeLists.txt ++++ b/QXlsx/CMakeLists.txt +@@ -16,7 +16,7 @@ include(GNUInstallDirs) + if(NOT DEFINED QT_VERSION_MAJOR) + find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui REQUIRED) + endif() +-find_package(Qt${QT_VERSION_MAJOR} 5.9 COMPONENTS Core Gui REQUIRED) ++find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui REQUIRED) + set(EXPORT_NAME QXlsxQt${QT_VERSION_MAJOR}) + + if (QT_VERSION_MAJOR EQUAL 6) diff --git a/recipes/qxlsx/all/patches/1.4.9-0001-fix-qstring-error.patch b/recipes/qxlsx/all/patches/1.4.9-0001-fix-qstring-error.patch new file mode 100644 index 0000000000000..2371f39b2580a --- /dev/null +++ b/recipes/qxlsx/all/patches/1.4.9-0001-fix-qstring-error.patch @@ -0,0 +1,22 @@ +A fix for https://github.com/QtExcel/QXlsx/issues/349 based on +https://github.com/QtExcel/QXlsx/commit/11bafef83286e79a95f17773926b62253ba53cab +--- a/QXlsx/source/xlsxworkbook.cpp ++++ b/QXlsx/source/xlsxworkbook.cpp +@@ -607,7 +607,7 @@ + + AbstractSheet *sheet = addSheet(name, sheetId, type); + sheet->setSheetState(state); +- if (relationship.target.startsWith("/")) { ++ if (relationship.target.startsWith(u'/')) { + QString fullPath = QDir::cleanPath(relationship.target.mid(1)); + + sheet->setFilePath(fullPath); +@@ -618,7 +618,7 @@ + // QLatin1String("/") + relationship.target); + const auto parts = splitPath(strFilePath); + QString fullPath = +- QDir::cleanPath(parts.first() + QLatin1String("/") + relationship.target); ++ QDir::cleanPath(parts.first() + u'/' + relationship.target); + + sheet->setFilePath(fullPath); + } diff --git a/recipes/qxlsx/all/test_package/CMakeLists.txt b/recipes/qxlsx/all/test_package/CMakeLists.txt index d57016937dd42..a923ec44aef44 100644 --- a/recipes/qxlsx/all/test_package/CMakeLists.txt +++ b/recipes/qxlsx/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(QXlsx REQUIRED CONFIG) +find_package(QXlsxQt5 QUIET CONFIG) +find_package(QXlsxQt6 QUIET CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE QXlsx::Core) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) +target_link_libraries(${PROJECT_NAME} PRIVATE QXlsx::QXlsx) diff --git a/recipes/qxlsx/all/test_package/conanfile.py b/recipes/qxlsx/all/test_package/conanfile.py index 6d529581ba2f5..d551a686af756 100644 --- a/recipes/qxlsx/all/test_package/conanfile.py +++ b/recipes/qxlsx/all/test_package/conanfile.py @@ -1,23 +1,18 @@ 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 = "CMakeToolchain", "CMakeDeps" 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() @@ -25,5 +20,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/qxlsx/all/test_package/test_package.cpp b/recipes/qxlsx/all/test_package/test_package.cpp index ec71d1106e960..14f8874944818 100644 --- a/recipes/qxlsx/all/test_package/test_package.cpp +++ b/recipes/qxlsx/all/test_package/test_package.cpp @@ -1,15 +1,9 @@ -#include -#include #include int main() { - QBuffer device; - device.open(QIODevice::WriteOnly); - - QXlsx::Document xlsx1; - xlsx1.write("A1", true); - xlsx1.write("A2", false); - xlsx1.saveAs(&device); + // INFO: Document does not exist. Only for test package purposes. + QXlsx::Document xlsxR("Test.xlsx"); + xlsxR.load(); return 0; } diff --git a/recipes/qxlsx/all/test_v1_package/CMakeLists.txt b/recipes/qxlsx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/qxlsx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/qxlsx/all/test_v1_package/conanfile.py b/recipes/qxlsx/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/qxlsx/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_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/qxlsx/config.yml b/recipes/qxlsx/config.yml index c1105e1540729..37a3a269ffdb9 100644 --- a/recipes/qxlsx/config.yml +++ b/recipes/qxlsx/config.yml @@ -1,7 +1,5 @@ versions: - "1.4.5": - folder: "all" - "1.4.4": + "1.4.9": folder: "all" - "1.4.3": + "1.4.5": folder: "all" diff --git a/recipes/qxmpp/all/CMakeLists.txt b/recipes/qxmpp/all/CMakeLists.txt deleted file mode 100644 index 59052ada070a2..0000000000000 --- a/recipes/qxmpp/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) - -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - -add_subdirectory(source_subfolder) diff --git a/recipes/qxmpp/all/conandata.yml b/recipes/qxmpp/all/conandata.yml index 57b44e43f1da6..d54578ee2ca20 100644 --- a/recipes/qxmpp/all/conandata.yml +++ b/recipes/qxmpp/all/conandata.yml @@ -4,7 +4,9 @@ sources: sha256: "2148162138eaf4b431a6ee94104f87877b85a589da803dff9433c698b4cf4f19" patches: "1.4.0": - - patch_file: "patches/001-add_conan_1.4.0.patch" - base_path: "source_subfolder" - - patch_file: "patches/002-add_gstreamer_1.4.0.patch" - base_path: "source_subfolder" + - patch_file: "patches/001-skip-module-path.patch" + patch_description: "Do not use module path provided by the upstream" + patch_type: "conan" + - patch_file: "patches/002-use-conan-gstreamer.patch" + patch_description: "Adapt to consume gstreamer from Conan" + patch_type: "conan" diff --git a/recipes/qxmpp/all/conanfile.py b/recipes/qxmpp/all/conanfile.py index b89c7627065d2..e57f163a543f8 100644 --- a/recipes/qxmpp/all/conanfile.py +++ b/recipes/qxmpp/all/conanfile.py @@ -1,20 +1,27 @@ -from conan import ConanFile -from conan.tools import files -from conans import CMake -import functools 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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir, rename, mkdir +from conan.tools.microsoft import is_msvc +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.scm import Version + +required_conan_version = ">=1.60.0 <2 || >=2.0.5" class QxmppConan(ConanFile): name = "qxmpp" + description = ("Cross-platform C++ XMPP client and server library. " + "It is written in C++ and uses Qt framework.") license = "LGPL-2.1" - homepage = "https://github.com/qxmpp-project/qxmpp" url = "https://github.com/conan-io/conan-center-index" - description = "Cross-platform C++ XMPP client and server library. It is written in C++ and uses Qt framework." - topics = "qt", "qt6", "xmpp", "xmpp-library", "xmpp-server", "xmpp-client" + homepage = "https://github.com/qxmpp-project/qxmpp" + topics = ("qt", "qt6", "xmpp", "xmpp-library", "xmpp-server", "xmpp-client") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -27,62 +34,84 @@ class QxmppConan(ConanFile): "with_gstreamer": False, } - generators = "cmake", "cmake_find_package_multi" + @property + def _min_cppstd(self): + return 17 @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "10", + "Visual Studio": "17", + "msvc": "192", + "clang": "8", + "apple-clang": "13", + } 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 configure(self): - if self.options.shared: - del self.options.fPIC + 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("qt/6.2.4") + self.requires("qt/[>=5.15 <7]", transitive_headers=True, transitive_libs=True) if self.options.with_gstreamer: - self.requires("gstreamer/1.19.2") - self.requires("glib/2.70.1") + self.requires("gstreamer/1.22.6") + self.requires("glib/2.78.3") + + 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 build_requirements(self): + self.tool_requires("qt/") def source(self): - 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 generate(self): + venv = VirtualBuildEnv(self) + venv.generate() + venv = VirtualRunEnv(self) + venv.generate(scope="build") + tc = CMakeToolchain(self) + tc.variables["BUILD_DOCUMENTATION"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["WITH_GSTREAMER"] = self.options.with_gstreamer + tc.variables["BUILD_SHARED"] = self.options.get_safe("shared") + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + tc = CMakeDeps(self) + tc.generate() - @functools.lru_cache(1) - def _configure_cmake(self): + def build(self): + apply_conandata_patches(self) cmake = CMake(self) - cmake.definitions["BUILD_DOCUMENTATION"] = "OFF" - cmake.definitions["BUILD_TESTS"] = "OFF" - cmake.definitions["BUILD_EXAMPLES"] = "OFF" - cmake.definitions["WITH_GSTREAMER"] = self.options.with_gstreamer - cmake.definitions["BUILD_SHARED"] = self.options.shared cmake.configure() - return cmake - - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - files.patch(self, **patch) - cmake = self._configure_cmake() cmake.build() def package(self): - self.copy("LICENSE.LGPL", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.LGPL", 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", "pkgconfig")) - - if self.options.shared and self.settings.os == "Windows": - files.mkdir(self, os.path.join(self.package_folder, "bin")) - files.rename(self, os.path.join(self.package_folder, "lib", "qxmpp.dll"), - os.path.join(self.package_folder, "bin", "qxmpp.dll")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + if is_msvc(self) and self.options.shared: + mkdir(self, os.path.join(self.package_folder, "bin")) + rename(self, os.path.join(self.package_folder, "lib", "qxmpp.dll"), os.path.join(self.package_folder, "bin", "qxmpp.dll")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "QXmpp") @@ -91,7 +120,5 @@ def package_info(self): self.cpp_info.libs = ["qxmpp"] self.cpp_info.includedirs.append(os.path.join("include", "qxmpp")) self.cpp_info.requires = ["qt::qtCore", "qt::qtNetwork", "qt::qtXml"] - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "QXmpp" - self.cpp_info.names["cmake_find_package_multi"] = "QXmpp" + if self.options.with_gstreamer: + self.cpp_info.requires.extend(["gstreamer::gstreamer", "glib::glib"]) diff --git a/recipes/qxmpp/all/patches/001-add_conan_1.4.0.patch b/recipes/qxmpp/all/patches/001-add_conan_1.4.0.patch deleted file mode 100644 index da7431faa740a..0000000000000 --- a/recipes/qxmpp/all/patches/001-add_conan_1.4.0.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 550ea39a..9ed4d825 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -8,10 +8,12 @@ set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) - --set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/modules") - --find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Xml) --find_package(Qt${QT_VERSION_MAJOR} 5.7.0 REQUIRED COMPONENTS Core Network Xml) -+list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) -+list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) -+ -+find_package(Qt6 COMPONENTS Core Network Xml REQUIRED) -+set(QT_VERSION_MAJOR 6) - - set(CMAKE_AUTOMOC ON) - set(CMAKE_AUTORCC ON) diff --git a/recipes/qxmpp/all/patches/001-skip-module-path.patch b/recipes/qxmpp/all/patches/001-skip-module-path.patch new file mode 100644 index 0000000000000..d499e412b3ef3 --- /dev/null +++ b/recipes/qxmpp/all/patches/001-skip-module-path.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 550ea39..e550959 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,10 +8,8 @@ set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + +-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/modules") + + find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Xml) +-find_package(Qt${QT_VERSION_MAJOR} 5.7.0 REQUIRED COMPONENTS Core Network Xml) + + set(CMAKE_AUTOMOC ON) + set(CMAKE_AUTORCC ON) diff --git a/recipes/qxmpp/all/patches/002-add_gstreamer_1.4.0.patch b/recipes/qxmpp/all/patches/002-use-conan-gstreamer.patch similarity index 100% rename from recipes/qxmpp/all/patches/002-add_gstreamer_1.4.0.patch rename to recipes/qxmpp/all/patches/002-use-conan-gstreamer.patch diff --git a/recipes/qxmpp/all/test_package/CMakeLists.txt b/recipes/qxmpp/all/test_package/CMakeLists.txt index 4398033dd2797..d6ea9ec68f7ad 100644 --- a/recipes/qxmpp/all/test_package/CMakeLists.txt +++ b/recipes/qxmpp/all/test_package/CMakeLists.txt @@ -1,12 +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(QXmpp REQUIRED CONFIG) -set(CMAKE_CXX_STANDARD 17) - add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} QXmpp::QXmpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/qxmpp/all/test_package/conanfile.py b/recipes/qxmpp/all/test_package/conanfile.py index 1bf1c7e26255d..ef5d7042163ec 100644 --- a/recipes/qxmpp/all/test_package/conanfile.py +++ b/recipes/qxmpp/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): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/qxmpp/all/test_package/test_package.cpp b/recipes/qxmpp/all/test_package/test_package.cpp index dabb1c214e126..213a59473e7a4 100644 --- a/recipes/qxmpp/all/test_package/test_package.cpp +++ b/recipes/qxmpp/all/test_package/test_package.cpp @@ -1,7 +1,9 @@ +#include #include #include int main() { QXmppClient client; client.logger()->setLoggingType(QXmppLogger::StdoutLogging); + return EXIT_SUCCESS; } diff --git a/recipes/r8brain-free-src/all/CMakeLists.txt b/recipes/r8brain-free-src/all/CMakeLists.txt index 1956775589e86..c66495d20c979 100644 --- a/recipes/r8brain-free-src/all/CMakeLists.txt +++ b/recipes/r8brain-free-src/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(r8brain-free-src LANGUAGES C CXX) add_library(r8brain) @@ -30,18 +30,18 @@ install( file(GLOB PUBLIC_HEADERS ${R8BRAIN_SRC_DIR}/*.h ${R8BRAIN_SRC_DIR}/*.inc) install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) if(R8BRAIN_WITH_PFFFT_DOUBLE) - list(APPEND PFFFT_DOUBLE_HEADERS + list(APPEND PFFFT_DOUBLE_HEADERS ${R8BRAIN_SRC_DIR}/pffft_double/pffft_double.h ) install(FILES ${PFFFT_DOUBLE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pffft_double) - list(APPEND PFFFT_DOUBLE_SIMD_HEADERS + list(APPEND PFFFT_DOUBLE_SIMD_HEADERS ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_avx_double.h ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_double.h ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_neon_double.h ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_neon_double_from_avx.h ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_scalar_double.h - ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_sse2_double.h + ${R8BRAIN_SRC_DIR}/pffft_double/simd/pf_sse2_double.h ) install(FILES ${PFFFT_DOUBLE_SIMD_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pffft_double/simd) endif() diff --git a/recipes/r8brain-free-src/all/test_package/CMakeLists.txt b/recipes/r8brain-free-src/all/test_package/CMakeLists.txt index ce5f00cec2e35..1e9532a4f5bf1 100644 --- a/recipes/r8brain-free-src/all/test_package/CMakeLists.txt +++ b/recipes/r8brain-free-src/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(r8brain-free-src REQUIRED CONFIG) diff --git a/recipes/r8brain-free-src/all/test_v1_package/CMakeLists.txt b/recipes/r8brain-free-src/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/r8brain-free-src/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/r8brain-free-src/all/test_v1_package/conanfile.py b/recipes/r8brain-free-src/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/r8brain-free-src/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/rabbitmq-c/all/conandata.yml b/recipes/rabbitmq-c/all/conandata.yml index 4a93aef8c8422..2457475388964 100755 --- a/recipes/rabbitmq-c/all/conandata.yml +++ b/recipes/rabbitmq-c/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.15.0": + url: "https://github.com/alanxz/rabbitmq-c/archive/v0.15.0.tar.gz" + sha256: "7b652df52c0de4d19ca36c798ed81378cba7a03a0f0c5d498881ae2d79b241c2" + "0.14.0": + url: "https://github.com/alanxz/rabbitmq-c/archive/v0.14.0.tar.gz" + sha256: "839b28eae20075ac58f45925fe991d16a3138cbde015db0ee11df1acb1c493df" "0.13.0": url: "https://github.com/alanxz/rabbitmq-c/archive/v0.13.0.tar.gz" sha256: "8b224e41bba504fc52b02f918d8df7e4bf5359d493cbbff36c06078655c676e6" diff --git a/recipes/rabbitmq-c/all/conanfile.py b/recipes/rabbitmq-c/all/conanfile.py index a192092e12ead..278092bcc50b8 100755 --- a/recipes/rabbitmq-c/all/conanfile.py +++ b/recipes/rabbitmq-c/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version +from conan.tools.env import VirtualBuildEnv import os required_conan_version = ">=1.53.0" @@ -9,10 +10,10 @@ class RabbitmqcConan(ConanFile): name = "rabbitmq-c" + description = "This is a C-language AMQP client library for use with v2.0+ of the RabbitMQ broker." license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/alanxz/rabbitmq-c" - description = "This is a C-language AMQP client library for use with v2.0+ of the RabbitMQ broker." topics = ("rabbitmq", "message queue") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -41,6 +42,10 @@ def requirements(self): if self.options.ssl: self.requires("openssl/[>=1.1 <4]") + def build_requirements(self): + if Version(self.version) >= "0.14.0": + self.tool_requires("cmake/[>=3.22 <4]") + def layout(self): cmake_layout(self, src_folder="src") @@ -68,6 +73,10 @@ def generate(self): deps = CMakeDeps(self) deps.generate() + if Version(self.version) >= "0.14.0": + venv = VirtualBuildEnv(self) + venv.generate(scope="build") + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/rabbitmq-c/all/test_package/CMakeLists.txt b/recipes/rabbitmq-c/all/test_package/CMakeLists.txt index 2033457172e80..e6aed17fa76e9 100644 --- a/recipes/rabbitmq-c/all/test_package/CMakeLists.txt +++ b/recipes/rabbitmq-c/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 C) find_package(rabbitmq-c REQUIRED CONFIG) diff --git a/recipes/rabbitmq-c/all/test_v1_package/CMakeLists.txt b/recipes/rabbitmq-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/rabbitmq-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/rabbitmq-c/all/test_v1_package/conanfile.py b/recipes/rabbitmq-c/all/test_v1_package/conanfile.py deleted file mode 100644 index 4d163cccc8134..0000000000000 --- a/recipes/rabbitmq-c/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -from conans import CMake, ConanFile, 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["RABBITMQ_SHARED"] = self.options["rabbitmq-c"].shared - cmake.definitions["WITH_SSL"] = self.options["rabbitmq-c"].ssl - 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/rabbitmq-c/config.yml b/recipes/rabbitmq-c/config.yml index 5d590dc0b2c3b..b74d07f4b3c76 100644 --- a/recipes/rabbitmq-c/config.yml +++ b/recipes/rabbitmq-c/config.yml @@ -1,4 +1,8 @@ versions: + "0.15.0": + folder: all + "0.14.0": + folder: all "0.13.0": folder: all "0.11.0": diff --git a/recipes/ragel/all/CMakeLists.txt b/recipes/ragel/all/CMakeLists.txt index 1d3d3c24617fe..4973226ba80ab 100644 --- a/recipes/ragel/all/CMakeLists.txt +++ b/recipes/ragel/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.15) project(ragel LANGUAGES CXX) file(GLOB HEADERS diff --git a/recipes/ragel/all/test_v1_package/conanfile.py b/recipes/ragel/all/test_v1_package/conanfile.py deleted file mode 100644 index 0299aedde34df..0000000000000 --- a/recipes/ragel/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -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/rang/all/test_package/CMakeLists.txt b/recipes/rang/all/test_package/CMakeLists.txt index ad056deea8682..be62a696889a5 100644 --- a/recipes/rang/all/test_package/CMakeLists.txt +++ b/recipes/rang/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(rang REQUIRED CONFIG) diff --git a/recipes/rang/all/test_v1_package/CMakeLists.txt b/recipes/rang/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/rang/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/rang/all/test_v1_package/conanfile.py b/recipes/rang/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/rang/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_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/range-v3/all/conandata.yml b/recipes/range-v3/all/conandata.yml index 1e7ea8c024212..0b45a37f14d0e 100644 --- a/recipes/range-v3/all/conandata.yml +++ b/recipes/range-v3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20240905": + url: https://github.com/ericniebler/range-v3/archive/a33616bfdb642744acaa937a3f258fba384b7fd4.tar.gz + sha256: d5cc3bf42825097c55c1c6a1f0158eb8fbceb0653935f2f7d2b5286c827dd834 "0.12.0": url: https://github.com/ericniebler/range-v3/archive/refs/tags/0.12.0.tar.gz sha256: 015adb2300a98edfceaf0725beec3337f542af4915cec4d0b89fa0886f4ba9cb diff --git a/recipes/range-v3/all/test_package/CMakeLists.txt b/recipes/range-v3/all/test_package/CMakeLists.txt index bee80f9c757e8..e481a61a31a40 100644 --- a/recipes/range-v3/all/test_package/CMakeLists.txt +++ b/recipes/range-v3/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(range-v3 REQUIRED CONFIG) diff --git a/recipes/range-v3/all/test_v1_package/CMakeLists.txt b/recipes/range-v3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/range-v3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/range-v3/all/test_v1_package/conanfile.py b/recipes/range-v3/all/test_v1_package/conanfile.py deleted file mode 100644 index 647a78dd80032..0000000000000 --- a/recipes/range-v3/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageV1Conan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.definitions["VERSION"] = self.deps_cpp_info["range-v3"].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/range-v3/config.yml b/recipes/range-v3/config.yml index 5ed235c09031b..8df94b876518b 100644 --- a/recipes/range-v3/config.yml +++ b/recipes/range-v3/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20240905": + folder: all "0.12.0": folder: all "0.11.0": diff --git a/recipes/rangeless/all/test_v1_package/CMakeLists.txt b/recipes/rangeless/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/rangeless/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6c9d5dba712c7..0000000000000 --- a/recipes/rangeless/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/rangesnext/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/rangesnext/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6c9d5dba712c7..0000000000000 --- a/recipes/rangesnext/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/all/test_package/CMakeLists.txt b/recipes/rapidcheck/all/test_package/CMakeLists.txt index dd2ba2ff70ddf..54deb1b3e7add 100644 --- a/recipes/rapidcheck/all/test_package/CMakeLists.txt +++ b/recipes/rapidcheck/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) diff --git a/recipes/rapidcheck/all/test_v1_package/CMakeLists.txt b/recipes/rapidcheck/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/rapidcheck/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/rapidcheck/all/test_v1_package/conanfile.py b/recipes/rapidcheck/all/test_v1_package/conanfile.py deleted file mode 100644 index 8037a9296cc42..0000000000000 --- a/recipes/rapidcheck/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -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/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 22f73545deb36..12ca9bb815fc4 100644 --- a/recipes/rapidcsv/all/conandata.yml +++ b/recipes/rapidcsv/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "8.84": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.84.tar.gz" + sha256: "213699f46a2a29fc2f45c2f9f66ccbe5383aebe6061445d91ac196e3cf7029c8" + "8.83": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.83.tar.gz" + sha256: "9342eeb0ce37e30b778c4c030129d03e99f44a66d4710ac19627187bee774097" + "8.82": + url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.82.tar.gz" + sha256: "4f1f57ca9db0f5447416acbef4e059cbd7cb03f6eb39fec1301732bbedaac927" "8.80": url: "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.80.tar.gz" sha256: "4c9e01cb2554cc76acac61532ef33b59e5b1f822160d2eb7efee2c128ea7f4c5" diff --git a/recipes/rapidcsv/all/test_package/CMakeLists.txt b/recipes/rapidcsv/all/test_package/CMakeLists.txt index 30d340fa95be7..1726ae6326653 100644 --- a/recipes/rapidcsv/all/test_package/CMakeLists.txt +++ b/recipes/rapidcsv/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(rapidcsv REQUIRED CONFIG) diff --git a/recipes/rapidcsv/all/test_v1_package/CMakeLists.txt b/recipes/rapidcsv/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/rapidcsv/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/rapidcsv/all/test_v1_package/conanfile.py b/recipes/rapidcsv/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/rapidcsv/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/rapidcsv/config.yml b/recipes/rapidcsv/config.yml index 643c892898926..0085f337a09cb 100644 --- a/recipes/rapidcsv/config.yml +++ b/recipes/rapidcsv/config.yml @@ -1,4 +1,10 @@ versions: + "8.84": + folder: "all" + "8.83": + folder: "all" + "8.82": + folder: "all" "8.80": folder: "all" "8.77": diff --git a/recipes/rapidfuzz/all/conandata.yml b/recipes/rapidfuzz/all/conandata.yml index f9ef7412f8274..ad858e9a9155c 100644 --- a/recipes/rapidfuzz/all/conandata.yml +++ b/recipes/rapidfuzz/all/conandata.yml @@ -1,19 +1,28 @@ sources: + "3.1.1": + url: "https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/v3.1.1.tar.gz" + sha256: "5a72811a9f5a890c69cb479551c19517426fb793a10780f136eb482c426ec3c8" + "3.0.4": + url: "https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/v3.0.4.tar.gz" + sha256: "18d1c41575ceddd6308587da8befc98c85d3b5bc2179d418daffed6d46b8cb0a" + "3.0.2": + url: "https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/v3.0.2.tar.gz" + sha256: "4fddce5c0368e78bd604c6b820e6be248d669754715e39b4a8a281bda4c06de1" + "3.0.0": + url: "https://github.com/rapidfuzz/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" + url: "https://github.com/rapidfuzz/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" + url: "https://github.com/rapidfuzz/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" + url: "https://github.com/rapidfuzz/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" + url: "https://github.com/rapidfuzz/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" + url: "https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/v1.10.4.tar.gz" sha256: "84a1ea8759aaa5bc8587c26504421d6fd34ad2a8dc74bf469b0cc3cc6758e17a" - "cci.20210513": - url: "https://github.com/maxbachmann/rapidfuzz-cpp/archive/d1e82379395cafc6d439c1c1e2cbe7512eaf2518.tar.gz" - sha256: "e5c306aae2fb4b34a381fbffaa97399114f20de14d83914ac2c9013b0226ce57" diff --git a/recipes/rapidfuzz/all/conanfile.py b/recipes/rapidfuzz/all/conanfile.py index 7ffe16027b312..16f3766c7f789 100644 --- a/recipes/rapidfuzz/all/conanfile.py +++ b/recipes/rapidfuzz/all/conanfile.py @@ -15,7 +15,7 @@ class PackageConan(ConanFile): description = "Rapid fuzzy string matching in C++ using the Levenshtein Distance" license = "MIT" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/maxbachmann/rapidfuzz-cpp" + homepage = "https://github.com/rapidfuzz/rapidfuzz-cpp" topics = ("levenshtein", "string-matching", "string-similarity", "string-comparison", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @@ -23,8 +23,6 @@ class PackageConan(ConanFile): @property def _min_cppstd(self): - if self.version == "cci.20210513": - return 98 return 17 @property @@ -34,7 +32,7 @@ def _compilers_minimum_version(self): "msvc": "192", "gcc": "6", "clang": "6", - "apple-clang": "12", + "apple-clang": "12", } def layout(self): diff --git a/recipes/rapidfuzz/all/test_package/CMakeLists.txt b/recipes/rapidfuzz/all/test_package/CMakeLists.txt index 91a5e1677ee9b..81f0b8e4f5d8d 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.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(rapidfuzz REQUIRED CONFIG) diff --git a/recipes/rapidfuzz/all/test_v1_package/CMakeLists.txt b/recipes/rapidfuzz/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/rapidfuzz/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/rapidfuzz/all/test_v1_package/conanfile.py b/recipes/rapidfuzz/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/rapidfuzz/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/rapidfuzz/config.yml b/recipes/rapidfuzz/config.yml index 71b60f681064b..a9e82dc805840 100644 --- a/recipes/rapidfuzz/config.yml +++ b/recipes/rapidfuzz/config.yml @@ -1,4 +1,12 @@ versions: + "3.1.1": + folder: "all" + "3.0.4": + folder: "all" + "3.0.2": + folder: "all" + "3.0.0": + folder: "all" "2.2.3": folder: "all" "2.2.0": @@ -9,5 +17,3 @@ versions: folder: "all" "1.10.4": folder: "all" - "cci.20210513": - folder: "all" diff --git a/recipes/rapidhash/all/conandata.yml b/recipes/rapidhash/all/conandata.yml new file mode 100644 index 0000000000000..88a70b679bdb8 --- /dev/null +++ b/recipes/rapidhash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + url: "https://github.com/Nicoshev/rapidhash/archive/refs/tags/rapidhash_v1.0.tar.gz" + sha256: "d295e66eec6745cc0e0c8c65fb8b5edf08ab3af83b0a503c54c6705144b53848" diff --git a/recipes/rapidhash/all/conanfile.py b/recipes/rapidhash/all/conanfile.py new file mode 100644 index 0000000000000..1678dff3fea60 --- /dev/null +++ b/recipes/rapidhash/all/conanfile.py @@ -0,0 +1,49 @@ +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 RapidHashConan(ConanFile): + name = "rapidhash" + description = "Very fast, high quality, platform-independent hashing algorithm" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Nicoshev/rapidhash" + topics = ("hash", "wyhash", "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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "rapidhash.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/rapidhash/all/test_package/CMakeLists.txt b/recipes/rapidhash/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e07f48f4eb8f3 --- /dev/null +++ b/recipes/rapidhash/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(rapidhash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rapidhash::rapidhash) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rapidhash/all/test_package/conanfile.py b/recipes/rapidhash/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/rapidhash/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/rapidhash/all/test_package/test_package.cpp b/recipes/rapidhash/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5bbba469ee0d5 --- /dev/null +++ b/recipes/rapidhash/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +#include "rapidhash.h" + +int main() { + std::string text = "Hello, rapidhash."; + + std::cout << rapidhash(text.data(), text.size()) << '\n'; + + return 0; +} diff --git a/recipes/rapidhash/config.yml b/recipes/rapidhash/config.yml new file mode 100644 index 0000000000000..edab1ee152d36 --- /dev/null +++ b/recipes/rapidhash/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all diff --git a/recipes/rapidjson/all/conanfile.py b/recipes/rapidjson/all/conanfile.py index 01002651291b6..c1c772ac9d842 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_mode" 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/all/test_package/CMakeLists.txt b/recipes/rapidjson/all/test_package/CMakeLists.txt index 30b669a758f42..a5e568304ad86 100644 --- a/recipes/rapidjson/all/test_package/CMakeLists.txt +++ b/recipes/rapidjson/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(RapidJSON CONFIG REQUIRED) diff --git a/recipes/rapidjson/all/test_v1_package/CMakeLists.txt b/recipes/rapidjson/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a694a0d382f57..0000000000000 --- a/recipes/rapidjson/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(RapidJSON CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE RapidJSON::RapidJSON) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rapidjson/all/test_v1_package/conanfile.py b/recipes/rapidjson/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/rapidjson/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", "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/rapidxml/all/test_package/CMakeLists.txt b/recipes/rapidxml/all/test_package/CMakeLists.txt index c90ae86e829dd..4174ccad641a8 100644 --- a/recipes/rapidxml/all/test_package/CMakeLists.txt +++ b/recipes/rapidxml/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(rapidxml REQUIRED CONFIG) diff --git a/recipes/rapidxml/all/test_v1_package/CMakeLists.txt b/recipes/rapidxml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3eff1dc88bc30..0000000000000 --- a/recipes/rapidxml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(rapidxml REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE rapidxml::rapidxml) diff --git a/recipes/rapidxml/all/test_v1_package/conanfile.py b/recipes/rapidxml/all/test_v1_package/conanfile.py deleted file mode 100644 index af166909110f7..0000000000000 --- a/recipes/rapidxml/all/test_v1_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 = os.path.join("bin", "test_package") - xml_name = os.path.join(self.source_folder, os.pardir, "test_package", "beer_journal.xml") - self.run(f"{bin_path} {xml_name}", run_environment=True) diff --git a/recipes/rapidyaml/all/conandata.yml b/recipes/rapidyaml/all/conandata.yml index dd5074af2a9b9..2e191a37ba6e6 100644 --- a/recipes/rapidyaml/all/conandata.yml +++ b/recipes/rapidyaml/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.8.0": + url: "https://github.com/biojppm/rapidyaml/releases/download/v0.8.0/rapidyaml-0.8.0-src.tgz" + sha256: "232476329f0937f16488fc0425070bf0176e686ed638f8b03fd96201ea08dac5" + "0.7.1": + url: "https://github.com/biojppm/rapidyaml/releases/download/v0.7.1/rapidyaml-0.7.1-src.tgz" + sha256: "9f7c0df2117c09ea409afef38f27605f79f4455dd73b6b9d6afaed099a627c8a" + "0.7.0": + url: "https://github.com/biojppm/rapidyaml/releases/download/v0.7.0/rapidyaml-0.7.0-src.tgz" + sha256: "ef9f89b68de711c561720f1e70d1594e953356a07d297d36b8ccd3ded0589715" "0.5.0": url: "https://github.com/biojppm/rapidyaml/releases/download/v0.5.0/rapidyaml-0.5.0-src.tgz" sha256: "6493557778791a3a2375510ce6c0ecd70163fc8ce4f8ed683acc36e3e55ee881" @@ -12,6 +21,18 @@ sources: url: "https://github.com/biojppm/rapidyaml/releases/download/v0.3.0/rapidyaml-0.3.0-src.tgz" sha256: "38854b8359eaf42cc27352f4b7321f509f6775445a3e2746cc8cd1e468a52aa9" patches: + "0.8.0": + - patch_file: "patches/0.8.0-001-remove-internal-c4core.patch" + patch_description: "disable using internal c4core" + patch_type: "conan" + "0.7.1": + - patch_file: "patches/0.7.1-001-remove-internal-c4core.patch" + patch_description: "disable using internal c4core" + patch_type: "conan" + "0.7.0": + - patch_file: "patches/0.7.0-001-remove-internal-c4core.patch" + patch_description: "disable using internal c4core" + patch_type: "conan" "0.5.0": - patch_file: "patches/0.5.0-001-remove-internal-c4core.patch" patch_description: "disable using internal c4core" diff --git a/recipes/rapidyaml/all/conanfile.py b/recipes/rapidyaml/all/conanfile.py index 5e12ce14eb4bb..01c81be0b90ae 100644 --- a/recipes/rapidyaml/all/conanfile.py +++ b/recipes/rapidyaml/all/conanfile.py @@ -21,12 +21,16 @@ class RapidYAMLConan(ConanFile): "fPIC": [True, False], "with_default_callbacks": [True, False], "with_tab_tokens": [True, False], + "with_default_callback_uses_exceptions": [True, False], + "with_assert": [True, False], } default_options = { "shared": False, "fPIC": True, "with_default_callbacks": True, "with_tab_tokens": False, + "with_default_callback_uses_exceptions": False, + "with_assert": False, } @property @@ -41,16 +45,25 @@ def config_options(self): del self.options.fPIC if Version(self.version) < "0.4.0": del self.options.with_tab_tokens + if Version(self.version) < "0.6.0": + del self.options.with_default_callback_uses_exceptions + del self.options.with_assert def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + # with_default_callback_uses_exceptions should only be valid if with_default_callbacks is true + if not self.options.with_default_callbacks: + self.options.rm_safe("with_default_callback_uses_exceptions") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("c4core/0.1.11", transitive_headers=True) + if Version(self.version) < "0.6.0": + self.requires("c4core/0.1.11", transitive_headers=True) + else: + self.requires("c4core/0.2.0", transitive_headers=True) def validate(self): if self.info.settings.compiler.cppstd: @@ -65,6 +78,9 @@ def generate(self): tc.variables["RYML_DEFAULT_CALLBACKS"] = self.options.with_default_callbacks if Version(self.version) >= "0.4.0": tc.variables["RYML_WITH_TAB_TOKENS"] = self.options.with_tab_tokens + if Version(self.version) >= "0.6.0": + tc.variables["RYML_DEFAULT_CALLBACK_USES_EXCEPTIONS"] = self.options.with_default_callback_uses_exceptions + tc.variables["RYML_USE_ASSERT"] = self.options.with_assert tc.generate() deps = CMakeDeps(self) diff --git a/recipes/rapidyaml/all/patches/0.7.0-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.7.0-001-remove-internal-c4core.patch new file mode 100644 index 0000000000000..00f7a998b45ee --- /dev/null +++ b/recipes/rapidyaml/all/patches/0.7.0-001-remove-internal-c4core.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 762bb97..d1bc8a7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ project(ryml + LANGUAGES CXX) + include(./compat.cmake) + +-c4_project(VERSION 0.7.0 STANDALONE ++c4_project(VERSION 0.7.0 + AUTHOR "Joao Paulo Magalhaes ") + + +@@ -27,11 +27,11 @@ option(RYML_INSTALL "Enable install target" ON) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core +- OVERRIDE C4CORE_INSTALL ${RYML_INSTALL} +-) +- ++# c4_require_subproject(c4core INCORPORATE ++# SUBDIRECTORY ${RYML_EXT_DIR}/c4core ++# OVERRIDE C4CORE_INSTALL ${RYML_INSTALL} ++# ) ++find_package(c4core REQUIRED CONFIG) + c4_add_library(ryml + SOURCES + ryml.hpp +@@ -77,10 +77,10 @@ c4_add_library(ryml + INC_DIRS + $ + $ +- LIBS c4core +- INCORPORATE c4core ++ # LIBS c4core ++ LIBS c4core::c4core ++ # INCORPORATE c4core + ) +- + if(RYML_WITH_TAB_TOKENS) + target_compile_definitions(ryml PUBLIC RYML_WITH_TAB_TOKENS) + endif() +@@ -113,7 +113,7 @@ endif() + + if(RYML_INSTALL) + c4_install_target(ryml) +- c4_install_exports(DEPENDENCIES c4core) ++# c4_install_exports(DEPENDENCIES c4core) + c4_pack_project() + endif() + diff --git a/recipes/rapidyaml/all/patches/0.7.1-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.7.1-001-remove-internal-c4core.patch new file mode 100644 index 0000000000000..e110ab49f9654 --- /dev/null +++ b/recipes/rapidyaml/all/patches/0.7.1-001-remove-internal-c4core.patch @@ -0,0 +1,50 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c3841a2..affaa56 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ project(ryml + LANGUAGES CXX) + include(./compat.cmake) + +-c4_project(VERSION 0.7.1 STANDALONE ++c4_project(VERSION 0.7.1 + AUTHOR "Joao Paulo Magalhaes ") + + +@@ -27,11 +27,11 @@ option(RYML_INSTALL "Enable install target" ON) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core +- OVERRIDE C4CORE_INSTALL ${RYML_INSTALL} +-) +- ++# c4_require_subproject(c4core INCORPORATE ++# SUBDIRECTORY ${RYML_EXT_DIR}/c4core ++# OVERRIDE C4CORE_INSTALL ${RYML_INSTALL} ++# ) ++find_package(c4core REQUIRED CONFIG) + c4_add_library(ryml + SOURCES + ryml.hpp +@@ -77,8 +77,8 @@ c4_add_library(ryml + INC_DIRS + $ + $ +- LIBS c4core +- INCORPORATE c4core ++ LIBS c4core::c4core ++# INCORPORATE c4core + ) + + if(RYML_WITH_TAB_TOKENS) +@@ -113,7 +113,7 @@ endif() + + if(RYML_INSTALL) + c4_install_target(ryml) +- c4_install_exports(DEPENDENCIES c4core) ++# c4_install_exports(DEPENDENCIES c4core) + c4_pack_project() + endif() + diff --git a/recipes/rapidyaml/all/patches/0.8.0-001-remove-internal-c4core.patch b/recipes/rapidyaml/all/patches/0.8.0-001-remove-internal-c4core.patch new file mode 100644 index 0000000000000..34dd42a7ce51e --- /dev/null +++ b/recipes/rapidyaml/all/patches/0.8.0-001-remove-internal-c4core.patch @@ -0,0 +1,50 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3707ae5..1572a39 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,7 +6,7 @@ project(ryml + LANGUAGES CXX) + include(./compat.cmake) + +-c4_project(VERSION 0.8.0 STANDALONE ++c4_project(VERSION 0.8.0 + AUTHOR "Joao Paulo Magalhaes ") + + +@@ -27,11 +27,11 @@ option(RYML_INSTALL "Enable install target" ON) + + #------------------------------------------------------- + +-c4_require_subproject(c4core INCORPORATE +- SUBDIRECTORY ${RYML_EXT_DIR}/c4core +- OVERRIDE C4CORE_INSTALL ${RYML_INSTALL} +-) +- ++#c4_require_subproject(c4core INCORPORATE ++# SUBDIRECTORY ${RYML_EXT_DIR}/c4core ++# OVERRIDE C4CORE_INSTALL ${RYML_INSTALL} ++#) ++find_package(c4core REQUIRED CONFIG) + c4_add_library(ryml + SOURCES + ryml.hpp +@@ -79,8 +79,8 @@ c4_add_library(ryml + INC_DIRS + $ + $ +- LIBS c4core +- INCORPORATE c4core ++ LIBS c4core::c4core ++# INCORPORATE c4core + ) + + if(RYML_WITH_TAB_TOKENS) +@@ -115,7 +115,7 @@ endif() + + if(RYML_INSTALL) + c4_install_target(ryml) +- c4_install_exports(DEPENDENCIES c4core) ++# c4_install_exports(DEPENDENCIES c4core) + c4_pack_project() + endif() + diff --git a/recipes/rapidyaml/all/test_package/CMakeLists.txt b/recipes/rapidyaml/all/test_package/CMakeLists.txt index bc844b7829375..8ccfff910d26e 100644 --- a/recipes/rapidyaml/all/test_package/CMakeLists.txt +++ b/recipes/rapidyaml/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(ryml REQUIRED CONFIG) diff --git a/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt b/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index bc541ea90b512..0000000000000 --- a/recipes/rapidyaml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/rapidyaml/all/test_v1_package/conanfile.py b/recipes/rapidyaml/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/rapidyaml/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/rapidyaml/config.yml b/recipes/rapidyaml/config.yml index a10a27debb1f0..fd2baab26972c 100644 --- a/recipes/rapidyaml/config.yml +++ b/recipes/rapidyaml/config.yml @@ -1,4 +1,10 @@ versions: + "0.8.0": + folder: all + "0.7.1": + folder: all + "0.7.0": + folder: all "0.5.0": folder: all "0.4.1": diff --git a/recipes/raylib/all/conandata.yml b/recipes/raylib/all/conandata.yml index 03de4ecb0f5c2..ee35279981eed 100644 --- a/recipes/raylib/all/conandata.yml +++ b/recipes/raylib/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "5.5": + url: "https://github.com/raysan5/raylib/archive/refs/tags/5.5.tar.gz" + sha256: "aea98ecf5bc5c5e0b789a76de0083a21a70457050ea4cc2aec7566935f5e258e" + "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/refs/tags/4.0.0.tar.gz" sha256: "11f6087dc7bedf9efb3f69c0c872f637e421d914e5ecea99bbe7781f173dc38c" diff --git a/recipes/raylib/all/conanfile.py b/recipes/raylib/all/conanfile.py index b00589d9af8ba..55bd54cf54ec2 100644 --- a/recipes/raylib/all/conanfile.py +++ b/recipes/raylib/all/conanfile.py @@ -22,13 +22,41 @@ class RaylibConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "opengl_version": [None, "4.3", "3.3", "2.1", "1.1", "ES-2.0"], + + "customize_build": [True, False], + "module_raudio": [True, False], + "camera_system": [True, False], + "gestures_system": [True, False], + "rprand_generator": [True, False], + "events_waiting": [True, False], + "custom_frame_control": [True, False] } default_options = { "shared": False, "fPIC": True, "opengl_version": None, + + "customize_build": False, + "module_raudio": True, + "camera_system": True, + "gestures_system": True, + "rprand_generator": True, + "events_waiting": False, + "custom_frame_control": False } + @property + def _support_custom_modules(self): + return Version(self.version) >= "4.2.0" + + @property + def _support_rprand_generator(self): + return Version(self.version) >= "5.0" + + @property + def _support_frame_control(self): + return Version(self.version) >= "4.6" + def export_sources(self): export_conandata_patches(self) @@ -37,6 +65,12 @@ def config_options(self): del self.options.fPIC if self.settings.os == "Android": del self.options.opengl_version + if not self._support_custom_modules: + del self.options.module_raudio + if not self._support_rprand_generator: + del self.options.rprand_generator + if not self._support_frame_control: + del self.options.custom_frame_control def configure(self): if self.options.shared: @@ -44,22 +78,33 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if not self.options.customize_build: + self.options.rm_safe("module_raudio") + del self.options.camera_system + del self.options.gestures_system + self.options.rm_safe("rprand_generator") + del self.options.events_waiting + self.options.rm_safe("custom_frame_control") + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if self.settings.os != "Android": - self.requires("glfw/3.3.8") + if self.settings.os not in ["Android", "Emscripten"]: + self.requires("glfw/3.4") self.requires("opengl/system") - if self.settings.os == "Linux": - self.requires("xorg/system") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_EXAMPLES"] = False + if self.settings.os == "Emscripten": + tc.variables["PLATFORM"] = "Web" + tc.variables["USE_EXTERNAL_GLFW"] = "ON" + tc.variables["OPENGL_VERSION"] = "ES 2.0" if self.settings.os == "Android": tc.variables["PLATFORM"] = "Android" tc.variables["USE_EXTERNAL_GLFW"] = "OFF" @@ -68,8 +113,24 @@ def generate(self): 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) + + tc.variables["CUSTOMIZE_BUILD"] = self.options.customize_build + if self.options.customize_build: + if self._support_custom_modules: + tc.variables["SUPPORT_MODULE_RAUDIO"] = self.options.module_raudio + tc.variables["SUPPORT_EVENTS_WAITING"] = self.options.events_waiting + if self._support_frame_control: + tc.variables["SUPPORT_CUSTOM_FRAME_CONTROL"] = self.options.custom_frame_control + + # this makes it include the headers rcamera.h, rgesture.h and rprand.h + tc.variables["SUPPORT_CAMERA_SYSTEM"] = self.options.camera_system + tc.variables["SUPPORT_GESTURES_SYSTEM"] = self.options.gestures_system + if self._support_rprand_generator: + tc.variables["SUPPORT_RPRAND_GENERATOR"] = self.options.rprand_generator + # 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.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" tc.generate() deps = CMakeDeps(self) deps.generate() @@ -93,6 +154,15 @@ def package(self): {"raylib": "raylib::raylib"} ) + # INFO: Custom modules are enabled by default but need to copy the headers manually + include_path = os.path.join(self.package_folder, "include") + if self.options.get_safe("camera_system", True): + copy(self, pattern="*camera.h", dst=include_path, src=os.path.join(self.source_folder, "src")) + if self.options.get_safe("gestures_system", True): + copy(self, pattern="*gestures.h", dst=include_path, src=os.path.join(self.source_folder, "src")) + if self._support_rprand_generator and self.options.get_safe("rprand_generator", True): + copy(self, pattern="rprand.h", dst=include_path, src=os.path.join(self.source_folder, "src", "external")) + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): diff --git a/recipes/raylib/all/test_package/CMakeLists.txt b/recipes/raylib/all/test_package/CMakeLists.txt index b4df9cc28b40d..005f27dc483b5 100644 --- a/recipes/raylib/all/test_package/CMakeLists.txt +++ b/recipes/raylib/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(raylib REQUIRED CONFIG) diff --git a/recipes/raylib/all/test_package/test_package.c b/recipes/raylib/all/test_package/test_package.c index 97c33c55b19d9..30f0b1d640db4 100644 --- a/recipes/raylib/all/test_package/test_package.c +++ b/recipes/raylib/all/test_package/test_package.c @@ -8,5 +8,6 @@ int main(void) { if (CheckCollisionSpheres(center, r, center, r)) { printf("unit sphere collides with itself!\n"); } + return 0; } diff --git a/recipes/raylib/all/test_v1_package/CMakeLists.txt b/recipes/raylib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/raylib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/raylib/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_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 b0be0ea520564..47a9490c7f44f 100644 --- a/recipes/raylib/config.yml +++ b/recipes/raylib/config.yml @@ -1,4 +1,8 @@ versions: + "5.5": + folder: "all" + "5.0": + folder: "all" "4.0.0": folder: "all" "3.5.0": diff --git a/recipes/rc_ptr/all/conandata.yml b/recipes/rc_ptr/all/conandata.yml new file mode 100644 index 0000000000000..64179a15ea35b --- /dev/null +++ b/recipes/rc_ptr/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.0.2": + url: "https://github.com/Chylynsky/rc_ptr/archive/refs/tags/v0.0.2.tar.gz" + sha256: "4682e0235b6def843b52e9327c7f1f87c98998b58c1b39a27cbf13dae27f7977" diff --git a/recipes/rc_ptr/all/conanfile.py b/recipes/rc_ptr/all/conanfile.py new file mode 100644 index 0000000000000..4325cec38cda1 --- /dev/null +++ b/recipes/rc_ptr/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class RcPtrConan(ConanFile): + name = "rc_ptr" + description = "Reference counted smart pointer for single-threaded environments" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Chylynsky/rc_ptr" + topics = ("memory", "smart-pointer", "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, "LICENSE_1_0.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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 = [] diff --git a/recipes/rc_ptr/all/test_package/CMakeLists.txt b/recipes/rc_ptr/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..06ceb32987cf9 --- /dev/null +++ b/recipes/rc_ptr/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(rc_ptr REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rc_ptr::rc_ptr) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/rc_ptr/all/test_package/conanfile.py b/recipes/rc_ptr/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/rc_ptr/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/rc_ptr/all/test_package/test_package.cpp b/recipes/rc_ptr/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1ecc4ab4aea91 --- /dev/null +++ b/recipes/rc_ptr/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include "rc_ptr/rc_ptr.hpp" + +int main() { + auto first = memory::rc_ptr{new int{24}}; + auto second = first; +} diff --git a/recipes/rc_ptr/config.yml b/recipes/rc_ptr/config.yml new file mode 100644 index 0000000000000..8c82b1d025a67 --- /dev/null +++ b/recipes/rc_ptr/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.2": + folder: all diff --git a/recipes/rdma-core/all/conandata.yml b/recipes/rdma-core/all/conandata.yml new file mode 100644 index 0000000000000..2871466545995 --- /dev/null +++ b/recipes/rdma-core/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "52.0": + url: "https://github.com/linux-rdma/rdma-core/releases/download/v52.0/rdma-core-52.0.tar.gz" + sha256: "1f0ce5f2462c982b20d21156707076278807a7adf4d10e9142f3be4bec1b2b83" + "51.0": + url: "https://github.com/linux-rdma/rdma-core/releases/download/v51.0/rdma-core-51.0.tar.gz" + sha256: "0a4a55b1351356c2750f26ec9010e8c7370402a13c95799cb8b447cf0134dd61" + "49.0": + url: "https://github.com/linux-rdma/rdma-core/releases/download/v49.0/rdma-core-49.0.tar.gz" + sha256: "953546ad2b179f9ce68dc21eb1eb26003098ea1bf0f87a4baed45bcea134b2b4" diff --git a/recipes/rdma-core/all/conanfile.py b/recipes/rdma-core/all/conanfile.py new file mode 100644 index 0000000000000..b7c0f7ab5ef82 --- /dev/null +++ b/recipes/rdma-core/all/conanfile.py @@ -0,0 +1,137 @@ +import os +import re + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import get, copy, rmdir, load, save, replace_in_file +from conan.tools.gnu import PkgConfigDeps + +required_conan_version = ">=1.53.0" + +class PackageConan(ConanFile): + name = "rdma-core" + description = ("RDMA core userspace libraries and daemons. " + "Provides userspace components for the Linux Kernel's drivers/infiniband subsystem.") + license = ("GPL-2.0", "Linux-OpenIB", "BSD-2-Clause") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/linux-rdma/rdma-core" + topics = ("linux-kernel", "rdma", "infiniband", "iwarp", "roce", "kernel-rdma-drivers", + "libefa", "libibmad", "libibnetdisc", "libibumad", "libibverbs", "libmana", + "libmlx4", "libmlx5", "librdmacm") + + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "build_libefa": [True, False], + "build_libibnetdisc": [True, False], + "build_libmana": [True, False], + "build_libmlx4": [True, False], + "build_libmlx5": [True, False], + "build_librdmacm": [True, False], + } + default_options = { + "build_libefa": True, + "build_libibnetdisc": True, + "build_libmana": True, + "build_libmlx4": True, + "build_libmlx5": True, + "build_librdmacm": True, + } + + 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("libnl/3.8.0") + self.requires("libudev/system") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + # libnl is only available on Linux + raise ConanInvalidConfiguration("rdma-core is only supported on Linux") + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.2.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = VirtualBuildEnv(self) + tc.generate() + tc = CMakeToolchain(self) + # Shared libraries are built by default and even if ENABLE_STATIC is turned on, + # the static libraries still have dependencies on the shared libraries. + # tc.variables["ENABLE_STATIC"] = not self.options.shared + tc.variables["NO_PYVERBS"] = True + tc.variables["NO_MAN_PAGES"] = True + # Otherwise get set to ${install_prefix}/car/run and the paths in + # https://github.com/linux-rdma/rdma-core/blob/v52.0/buildlib/config.h.in + # can exceed the 108-character limit for socket paths on Linux + if "CMAKE_INSTALL_RUNDIR" not in self.conf.get("tools.cmake.cmaketoolchain:extra_variables", check_type=dict, default={}): + tc.variables["CMAKE_INSTALL_RUNDIR"] = "/var/run" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + # Build only the libraries and disable everything else + allowed_subdirs = ["ccan", "kernel-boot", "kernel-headers", "libibmad", "libibnetdisc", "libibumad", "libibverbs", + "librdmacm", "providers/efa", "providers/mana", "providers/mlx4", "providers/mlx5", "util"] + allowed_subdirs = [ + subdir for subdir in allowed_subdirs + if self.options.get_safe(f"build_{subdir.replace('providers/', 'lib')}", True) + ] + cmakelists_path = os.path.join(self.source_folder, "CMakeLists.txt") + cmakelists_content = load(self, cmakelists_path) + patched_content = re.sub(r"add_subdirectory\((?!({})\)).+\)".format("|".join(allowed_subdirs)), r"", cmakelists_content) + save(self, cmakelists_path, patched_content) + # Adjust the pkg-config target for libnl + replace_in_file(self, cmakelists_path, "libnl-3.0 libnl-route-3.0", "libnl") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING.*", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "etc")) + + def package_info(self): + def _add_component(name, requires, pthread=False): + if not self.options.get_safe(f"build_{name}", True): + return + component = self.cpp_info.components[name] + component.set_property("pkg_config_name", name) + component.libs = [name.replace("lib", "")] + component.requires = requires + ["libudev::libudev"] + if pthread and self.settings.os in ["Linux", "FreeBSD"]: + component.system_libs = ["pthread"] + + _add_component("libefa", ["libibverbs"], pthread=True) + _add_component("libibmad", ["libibumad"]) + _add_component("libibnetdisc", ["libibmad", "libibumad"]) + _add_component("libibumad", []) + _add_component("libibverbs", ["libnl::nl", "libnl::nl-route"], pthread=True) + _add_component("libmana", ["libibverbs"], pthread=True) + _add_component("libmlx4", ["libibverbs"], pthread=True) + _add_component("libmlx5", ["libibverbs"], pthread=True) + _add_component("librdmacm", ["libibverbs", "libnl::nl", "libnl::nl-route"], pthread=True) + diff --git a/recipes/rdma-core/all/test_package/CMakeLists.txt b/recipes/rdma-core/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..232275e72fa44 --- /dev/null +++ b/recipes/rdma-core/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(rdma-core REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rdma-core::libibverbs) diff --git a/recipes/rdma-core/all/test_package/conanfile.py b/recipes/rdma-core/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/rdma-core/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/rdma-core/all/test_package/test_package.cpp b/recipes/rdma-core/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..abeb298aef336 --- /dev/null +++ b/recipes/rdma-core/all/test_package/test_package.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2004 Topspin Communications. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * 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. + * + * 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 AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include + +#include + +#include + +int main(int argc, char *argv[]) +{ + struct ibv_device **dev_list; + int num_devices, i; + + dev_list = ibv_get_device_list(&num_devices); + if (!dev_list) { + perror("Failed to get IB devices list"); + return 0; + } + + printf(" %-16s\t node GUID\n", "device"); + printf(" %-16s\t----------------\n", "------"); + + for (i = 0; i < num_devices; ++i) { + printf(" %-16s\t%016llx\n", + ibv_get_device_name(dev_list[i]), + (unsigned long long) be64toh(ibv_get_device_guid(dev_list[i]))); + } + + ibv_free_device_list(dev_list); + + return 0; +} diff --git a/recipes/rdma-core/config.yml b/recipes/rdma-core/config.yml new file mode 100644 index 0000000000000..4e3149e77dd3c --- /dev/null +++ b/recipes/rdma-core/config.yml @@ -0,0 +1,7 @@ +versions: + "52.0": + folder: all + "51.0": + folder: all + "49.0": + folder: all diff --git a/recipes/re2/all/conandata.yml b/recipes/re2/all/conandata.yml index c28d8dfdd5d72..718ca942e6960 100644 --- a/recipes/re2/all/conandata.yml +++ b/recipes/re2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "20240702": + url: "https://github.com/google/re2/releases/download/2024-07-02/re2-2024-07-02.tar.gz" + sha256: "eb2df807c781601c14a260a507a5bb4509be1ee626024cb45acbd57cb9d4032b" + "20240301": + url: "https://github.com/google/re2/releases/download/2024-03-01/re2-2024-03-01.tar.gz" + sha256: "7b2b3aa8241eac25f674e5b5b2e23d4ac4f0a8891418a2661869f736f03f57f4" "20231101": url: "https://github.com/google/re2/releases/download/2023-11-01/re2-2023-11-01.tar.gz" sha256: "4e6593ac3c71de1c0f322735bc8b0492a72f66ffccfad76e259fa21c41d27d8a" diff --git a/recipes/re2/all/conanfile.py b/recipes/re2/all/conanfile.py index 8d2e83b161ad9..caa9278099d00 100644 --- a/recipes/re2/all/conanfile.py +++ b/recipes/re2/all/conanfile.py @@ -62,7 +62,7 @@ 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) + self.requires("abseil/20240116.1", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/re2/all/test_package/CMakeLists.txt b/recipes/re2/all/test_package/CMakeLists.txt index f2cb6370aee9f..a3ba950c272a4 100644 --- a/recipes/re2/all/test_package/CMakeLists.txt +++ b/recipes/re2/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(re2 REQUIRED CONFIG) diff --git a/recipes/re2/config.yml b/recipes/re2/config.yml index 56ae3dda8367b..bfce54f7e636d 100644 --- a/recipes/re2/config.yml +++ b/recipes/re2/config.yml @@ -1,4 +1,8 @@ versions: + "20240702": + folder: all + "20240301": + folder: all "20231101": folder: all "20230901": diff --git a/recipes/re2c/all/conandata.yml b/recipes/re2c/all/conandata.yml index e8f43a925d5ec..c7133538f0cbd 100644 --- a/recipes/re2c/all/conandata.yml +++ b/recipes/re2c/all/conandata.yml @@ -1,22 +1,10 @@ sources: + "4.0.2": + url: "https://github.com/skvadrik/re2c/releases/download/4.0.2/re2c-4.0.2.tar.xz" + sha256: "5e52ce0e26326115e41bc45d34dc2d5e10f2e44ed3a413fa2a826aa3500c8d56" "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" "2.2": url: "https://github.com/skvadrik/re2c/releases/download/2.2/re2c-2.2.tar.xz" sha256: "0fc45e4130a8a555d68e230d1795de0216dfe99096b61b28e67c86dfd7d86bda" - "2.1.1": - url: "https://github.com/skvadrik/re2c/releases/download/2.1.1/re2c-2.1.1.tar.xz" - sha256: "036ee264fafd5423141ebd628890775aa9447a4c4068a6307385d7366fe711f8" - "2.0.3": - url: "https://github.com/skvadrik/re2c/releases/download/2.0.3/re2c-2.0.3.tar.xz" - sha256: "b2bc1eb8aaaa21ff2fcd26507b7e6e72c5e3d887e58aa515c2155fb17d744278" - "1.3": - url: "https://github.com/skvadrik/re2c/releases/download/1.3/re2c-1.3.tar.xz" - sha256: "f37f25ff760e90088e7d03d1232002c2c2672646d5844fdf8e0d51a5cd75a503" -patches: - "2.0.3": - - patch_file: "patches/2.0.3-0001-add-missing-include.patch" diff --git a/recipes/re2c/all/conanfile.py b/recipes/re2c/all/conanfile.py index dcc666816d3e4..efdda39660357 100644 --- a/recipes/re2c/all/conanfile.py +++ b/recipes/re2c/all/conanfile.py @@ -1,13 +1,12 @@ import os 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.cmake import CMakeToolchain, CMake, cmake_layout from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class Re2CConan(ConanFile): @@ -21,10 +20,6 @@ class Re2CConan(ConanFile): 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) @@ -33,54 +28,24 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") def layout(self): - basic_layout(self, src_folder="src") + cmake_layout(self, src_folder="src") 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") - 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) + tc = CMakeToolchain(self) + tc.cache_variables["RE2C_REBUILD_DOCS"] = False + tc.cache_variables["RE2C_BUILD_BENCHMARKS"] = False + tc.generate() def build(self): - self._patch_sources() - with chdir(self, self.source_folder): - autotools = Autotools(self) - autotools.configure() - autotools.make(args=["V=1"]) + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): copy(self, "LICENSE", @@ -91,9 +56,13 @@ def package(self): src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), keep_path=False) - with chdir(self, self.source_folder): - autotools = Autotools(self) - autotools.install() + copy(self, "*.re", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include"), + keep_path=False) + + cmake = CMake(self) + cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): @@ -102,6 +71,5 @@ def package_info(self): self.cpp_info.resdirs = [] 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) + include_dir = os.path.join(self.package_folder, "include") + self.buildenv_info.define("RE2C_STDLIB_DIR", include_dir) diff --git a/recipes/re2c/all/test_package/CMakeLists.txt b/recipes/re2c/all/test_package/CMakeLists.txt deleted file mode 100644 index db2c3e52befc0..0000000000000 --- a/recipes/re2c/all/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package C) - -add_custom_command(OUTPUT test_package.c - COMMAND re2c -W "${CMAKE_CURRENT_LIST_DIR}/syntax.re" -o test_package.c -) - -add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/re2c/all/test_package/conanfile.py b/recipes/re2c/all/test_package/conanfile.py index 91315a6314ef7..222ca0931e8d9 100644 --- a/recipes/re2c/all/test_package/conanfile.py +++ b/recipes/re2c/all/test_package/conanfile.py @@ -1,27 +1,16 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout, CMake -import os - +from conan.tools.cmake import cmake_layout class TestPackageConan(ConanFile): 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 requirements(self): + self.requires(self.tested_reference_str) def layout(self): cmake_layout(self) - def build(self): - if can_run(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") + self.run("re2c --version", env="conanrun") diff --git a/recipes/re2c/all/test_package/syntax.re b/recipes/re2c/all/test_package/syntax.re deleted file mode 100644 index b1b909b54562f..0000000000000 --- a/recipes/re2c/all/test_package/syntax.re +++ /dev/null @@ -1,31 +0,0 @@ -#include - -/*!max:re2c*/ -/*!re2c - digit = [0-9]; - number = digit+; -*/ - -static int lex(const char *YYCURSOR) -{ - const char *YYMARKER; - /*!re2c - re2c:define:YYCTYPE = char; - re2c:yyfill:enable = 0; - - * { return 1; } - - number { - printf("number\n"); - return 0; - } - - */ -} - -int main() -{ - lex("1024"); - lex(";]"); - return 0; -} diff --git a/recipes/re2c/config.yml b/recipes/re2c/config.yml index fd91d5170215c..5bf704363ae6d 100644 --- a/recipes/re2c/config.yml +++ b/recipes/re2c/config.yml @@ -1,13 +1,7 @@ versions: - "3.1": + "4.0.2": folder: "all" - "3.0": + "3.1": folder: "all" "2.2": folder: "all" - "2.1.1": - folder: "all" - "2.0.3": - folder: "all" - "1.3": - folder: "all" diff --git a/recipes/reactiveplusplus/all/conandata.yml b/recipes/reactiveplusplus/all/conandata.yml index 9e638abe5d43a..fc0d0114cf28b 100644 --- a/recipes/reactiveplusplus/all/conandata.yml +++ b/recipes/reactiveplusplus/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "2.2.1": + url: "https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/v2.2.1.tar.gz" + sha256: "4d44da273a8f7401b8ebf6973ae06246505e204e9c491b435f0e1b223d6841fe" + "2.2.0": + url: "https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/v2.2.0.tar.gz" + sha256: "10b3969956ff05fa4ebd62245b616731d9c12fb5b57c4cecb2c4ee418303dbea" + "2.1.1": + url: "https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/v2.1.1.tar.gz" + sha256: "0b962478d7c973a1f74062ce7f8d24c2fdcd2733031b1f014e65d252d59ebe6a" + "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" diff --git a/recipes/reactiveplusplus/all/conanfile.py b/recipes/reactiveplusplus/all/conanfile.py index d8d1eb5567b3d..10cc3f19849e6 100644 --- a/recipes/reactiveplusplus/all/conanfile.py +++ b/recipes/reactiveplusplus/all/conanfile.py @@ -3,9 +3,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.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=2.0" class ReactivePlusPlusConan(ConanFile): @@ -16,25 +17,32 @@ class ReactivePlusPlusConan(ConanFile): "declarative form." ) license = "BSL-1.0" - topics = ("reactivex", "asynchronous", "event", "observable", "values-distributed-in-time") - homepage = "https://github.com/victimsnino/ReactivePlusPlus" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/victimsnino/ReactivePlusPlus" + topics = ("reactivex", "asynchronous", "event", "observable", "values-distributed-in-time") + 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 { - "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") @@ -43,24 +51,16 @@ 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 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] - + required_cppstd = "20" + check_min_cppstd(self, required_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._min_cppstd}, which your compiler does not support.", + f"{self.name} {self.version} requires C++{required_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 @@ -70,6 +70,11 @@ def package(self): copy(self, "*", src=os.path.join(self.source_folder, "src", "rpp", "rpp"), dst=os.path.join(self.package_folder, "include", "rpp")) + # Copy extensions (available since v2.2.0) + for extension in ["rppasio", "rppgrpc", "rppqt"]: + copy(self, "*", + src=os.path.join(self.source_folder, "src", "extensions", extension, extension), + dst=os.path.join(self.package_folder, "include", extension)) def package_info(self): self.cpp_info.set_property("cmake_file_name", "RPP") @@ -77,11 +82,6 @@ def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - # TODO: to remove in conan v2 once legacy generators removed - self.cpp_info.names["cmake_find_package"] = "RPP" - self.cpp_info.names["cmake_find_package_multi"] = "RPP" - self.cpp_info.components["_reactiveplusplus"].names["cmake_find_package"] = "rpp" - self.cpp_info.components["_reactiveplusplus"].names["cmake_find_package_multi"] = "rpp" self.cpp_info.components["_reactiveplusplus"].set_property("cmake_target_name", "RPP::rpp") self.cpp_info.components["_reactiveplusplus"].bindirs = [] self.cpp_info.components["_reactiveplusplus"].libdirs = [] diff --git a/recipes/reactiveplusplus/all/test_package/CMakeLists.txt b/recipes/reactiveplusplus/all/test_package/CMakeLists.txt index 96e89147f81a9..133f10feefaa9 100644 --- a/recipes/reactiveplusplus/all/test_package/CMakeLists.txt +++ b/recipes/reactiveplusplus/all/test_package/CMakeLists.txt @@ -1,8 +1,12 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) 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/all/test_v1_package/CMakeLists.txt b/recipes/reactiveplusplus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/reactiveplusplus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/reactiveplusplus/all/test_v1_package/conanfile.py b/recipes/reactiveplusplus/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/reactiveplusplus/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_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/reactiveplusplus/config.yml b/recipes/reactiveplusplus/config.yml index 34b32de1aab11..44a35cf248ea6 100644 --- a/recipes/reactiveplusplus/config.yml +++ b/recipes/reactiveplusplus/config.yml @@ -1,4 +1,12 @@ versions: + "2.2.1": + folder: all + "2.2.0": + folder: all + "2.1.1": + folder: all + "2.0.0": + folder: all "0.2.3": folder: all "0.2.1": diff --git a/recipes/read-excel/all/test_package/CMakeLists.txt b/recipes/read-excel/all/test_package/CMakeLists.txt index a5298e30eba45..c2839b0b165dc 100644 --- a/recipes/read-excel/all/test_package/CMakeLists.txt +++ b/recipes/read-excel/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(read-excel REQUIRED CONFIG) diff --git a/recipes/read-excel/all/test_package/conanfile.py b/recipes/read-excel/all/test_package/conanfile.py index bddb5e263d5d6..8a5bb47f50c4c 100644 --- a/recipes/read-excel/all/test_package/conanfile.py +++ b/recipes/read-excel/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - xls_path = os.path.join(self.source_folder, "sample.xls") - self.run("{} \"{}\"".format(bin_path, xls_path), env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/read-excel/all/test_package/sample.xls b/recipes/read-excel/all/test_package/sample.xls deleted file mode 100644 index ecf08ebffbbb9..0000000000000 Binary files a/recipes/read-excel/all/test_package/sample.xls and /dev/null differ diff --git a/recipes/read-excel/all/test_package/test_package.cpp b/recipes/read-excel/all/test_package/test_package.cpp index 847cfd34b125e..f8edcee4eecf3 100644 --- a/recipes/read-excel/all/test_package/test_package.cpp +++ b/recipes/read-excel/all/test_package/test_package.cpp @@ -6,31 +6,11 @@ int main(int argc, char ** argv) { - if (argc < 2) { - std::cerr << "Need an argument\n"; - return 1; - } - try { - Excel::Book book( argv[1] ); - - Excel::Sheet * sheet = book.sheet( 0 ); - - if(sheet->cell( 0, 0 ).getString() == L"This is a string.") - return 0; - - return 1; + Excel::Book book( "non-real-file.xls" ); } catch(const Excel::Exception &) { - return 1; - } - catch(const CompoundFile::Exception &) - { - return 1; - } - catch(const std::exception &) - { - return 1; + printf("Test\n"); } } diff --git a/recipes/read-excel/all/test_v1_package/CMakeLists.txt b/recipes/read-excel/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8af52c8273805..0000000000000 --- a/recipes/read-excel/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -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/read-excel/all/test_v1_package/conanfile.py b/recipes/read-excel/all/test_v1_package/conanfile.py deleted file mode 100644 index 3524db189d6f0..0000000000000 --- a/recipes/read-excel/all/test_v1_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 = os.path.join("bin", "test_package") - xls_path = os.path.join(self.source_folder, os.pardir, "test_package", "sample.xls") - self.run("{} \"{}\"".format(bin_path, xls_path), run_environment=True) diff --git a/recipes/readerwriterqueue/all/test_package/CMakeLists.txt b/recipes/readerwriterqueue/all/test_package/CMakeLists.txt index eceb6e660004e..34ccdfb3658af 100644 --- a/recipes/readerwriterqueue/all/test_package/CMakeLists.txt +++ b/recipes/readerwriterqueue/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(readerwriterqueue REQUIRED CONFIG) diff --git a/recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt b/recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/readerwriterqueue/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/readerwriterqueue/all/test_v1_package/conanfile.py b/recipes/readerwriterqueue/all/test_v1_package/conanfile.py deleted file mode 100644 index b340bdd7fabce..0000000000000 --- a/recipes/readerwriterqueue/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,15 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - -class ConcurrentqueueTestConan(ConanFile): - settings = "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/readline/all/conanfile.py b/recipes/readline/all/conanfile.py index 0c46be5b31c24..d5b233744c63a 100644 --- a/recipes/readline/all/conanfile.py +++ b/recipes/readline/all/conanfile.py @@ -11,6 +11,7 @@ required_conan_version = ">=1.53.0" + class ReadLineConan(ConanFile): name = "readline" description = "A set of functions for use by applications that allow users to edit command lines as they are typed in" @@ -18,6 +19,8 @@ class ReadLineConan(ConanFile): license = "GPL-3.0-only" homepage = "https://tiswww.case.edu/php/chet/readline/rltop.html" url = "https://github.com/conan-io/conan-center-index" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -69,6 +72,9 @@ def generate(self): ]) if cross_building(self): tc.configure_args.append("bash_cv_wcwidth_broken=yes") + + tc.configure_args.append("--disable-install-examples") + tc.generate() deps = AutotoolsDeps(self) deps.generate() diff --git a/recipes/readline/all/test_package/CMakeLists.txt b/recipes/readline/all/test_package/CMakeLists.txt index 0ba8423464ca0..a7a5d1cf9eed0 100644 --- a/recipes/readline/all/test_package/CMakeLists.txt +++ b/recipes/readline/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(readline CONFIG REQUIRED) diff --git a/recipes/readline/all/test_v1_package/CMakeLists.txt b/recipes/readline/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/readline/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/readline/all/test_v1_package/conanfile.py b/recipes/readline/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/readline/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", "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/readosm/all/conanfile.py b/recipes/readosm/all/conanfile.py index b9c849a552887..8a9b5054afef4 100644 --- a/recipes/readosm/all/conanfile.py +++ b/recipes/readosm/all/conanfile.py @@ -54,7 +54,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") self.requires("zlib/[>=1.2.11 <2]") def build_requirements(self): diff --git a/recipes/readosm/all/test_package/CMakeLists.txt b/recipes/readosm/all/test_package/CMakeLists.txt index 8ea28640523dd..b54f78f03e44d 100644 --- a/recipes/readosm/all/test_package/CMakeLists.txt +++ b/recipes/readosm/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(readosm REQUIRED CONFIG) diff --git a/recipes/readosm/all/test_v1_package/CMakeLists.txt b/recipes/readosm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/readosm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/readosm/all/test_v1_package/conanfile.py b/recipes/readosm/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/readosm/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_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/rebound/all/conandata.yml b/recipes/rebound/all/conandata.yml new file mode 100644 index 0000000000000..9c806c1b5b5a5 --- /dev/null +++ b/recipes/rebound/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "4.4.1": + url: "https://github.com/hannorein/rebound/archive/refs/tags/4.4.1.tar.gz" + sha256: "0ae7bdf20750cd0a83c4905a66c3cde211f09ac732ffb4cba9887e68aba5273b" +patches: + "4.4.1": + - patch_file: "patches/0001-4.4.1-stdio-legacy-fix.patch" + patch_description: "Link to legacy_stdio only when MSVC" + patch_type: "backport" + patch_source: "https://github.com/hannorein/rebound/pull/777" diff --git a/recipes/rebound/all/conanfile.py b/recipes/rebound/all/conanfile.py new file mode 100644 index 0000000000000..eb8767e10950a --- /dev/null +++ b/recipes/rebound/all/conanfile.py @@ -0,0 +1,78 @@ +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 chdir, copy, get, rm, rmdir, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=1.54.0" + + +class ReboundConan(ConanFile): + name = "rebound" + description = "REBOUND is an N-body integrator, i.e. a software package that can integrate the motion of particles under the influence of gravity." + license = "GPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/hannorein/rebound" + topics = ("physics", "simulation", "n-body", "gravity", "integrator") + package_type = "shared-library" + # Scripts always compile with optimizations enabled + settings = "os", "arch", "compiler" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + 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 validate(self): + if self.settings.os in ["Windows", "Macos"]: + raise ConanInvalidConfiguration(f"{self.ref} recipe does not support {self.settings.os}, contributions welcomed!") + + def validate_build(self): + if cross_building(self): + raise ConanInvalidConfiguration(f"{self.ref} cross-building is not supported yet, contributions welcomed!") + + 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): + apply_conandata_patches(self) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make(target="librebound") + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "librebound.so", os.path.join(self.source_folder, "src"), os.path.join(self.package_folder, "lib")) + + copy(self, "*.h", os.path.join(self.source_folder, "src"), os.path.join(self.package_folder, "include")) + + # 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 = ["rebound"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/rebound/all/patches/0001-4.4.1-stdio-legacy-fix.patch b/recipes/rebound/all/patches/0001-4.4.1-stdio-legacy-fix.patch new file mode 100644 index 0000000000000..9fe5511878c30 --- /dev/null +++ b/recipes/rebound/all/patches/0001-4.4.1-stdio-legacy-fix.patch @@ -0,0 +1,24 @@ +From e775c5c070093facb17a732c3b509bfe0ca8ade7 Mon Sep 17 00:00:00 2001 +From: Uilian Ries +Date: Tue, 18 Jun 2024 11:39:22 +0200 +Subject: [PATCH] Link to legacy_stdio only when MSVC + +Signed-off-by: Uilian Ries +--- + src/rebound.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/rebound.c b/src/rebound.c +index 18267206b..40afe76f4 100644 +--- a/src/rebound.c ++++ b/src/rebound.c +@@ -23,7 +23,9 @@ + * + */ + #define _NO_CRT_STDIO_INLINE // WIN32 to use _vsprintf_s ++#if defined(_WIN32) && defined(_MSC_VER) + #pragma comment(lib, "legacy_stdio_definitions.lib") ++#endif + #include + #include + #include // for offsetof() diff --git a/recipes/rebound/all/test_package/CMakeLists.txt b/recipes/rebound/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f16f7cf26d671 --- /dev/null +++ b/recipes/rebound/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(rebound REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE rebound::rebound) diff --git a/recipes/rebound/all/test_package/conanfile.py b/recipes/rebound/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/rebound/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/rebound/all/test_package/test_package.c b/recipes/rebound/all/test_package/test_package.c new file mode 100644 index 0000000000000..1cf6ab75b9e69 --- /dev/null +++ b/recipes/rebound/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include "rebound.h" +#include +#include + + +// Simplified from the simplest.c example in the REBOUND source code. +int main(int argc, char* argv[]) { + struct reb_simulation* r = reb_simulation_create(); + + reb_simulation_add_fmt(r, "m", 1.); // Central object + reb_simulation_add_fmt(r, "m a e", 1e-3, 1., 0.1); // Jupiter mass planet + reb_simulation_add_fmt(r, "a e", 1.4, 0.1); // Massless test particle + + // First integrate for 1 time units. + reb_simulation_integrate(r, 1.); + + // Then output some coordinates and orbital elements. + for (int i=0; iN; i++){ + struct reb_particle p = r->particles[i]; + printf("%f %f %f\n", p.x, p.y, p.z); + } + struct reb_particle primary = r->particles[0]; + for (int i=1; iN; i++){ + struct reb_particle p = r->particles[i]; + struct reb_orbit o = reb_orbit_from_particle(r->G, p, primary); + printf("%f %f %f\n", o.a, o.e, o.f); + } + + // Cleanup + reb_simulation_free(r); +} diff --git a/recipes/rebound/config.yml b/recipes/rebound/config.yml new file mode 100644 index 0000000000000..695144f0acbc9 --- /dev/null +++ b/recipes/rebound/config.yml @@ -0,0 +1,3 @@ +versions: + "4.4.1": + folder: "all" diff --git a/recipes/recastnavigation/all/conandata.yml b/recipes/recastnavigation/all/conandata.yml index eeea285038775..e686b4b075c59 100644 --- a/recipes/recastnavigation/all/conandata.yml +++ b/recipes/recastnavigation/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.0": + url: "https://github.com/recastnavigation/recastnavigation/archive/refs/tags/v1.6.0.tar.gz" + sha256: "d48ca0121962fa0639502c0f56c4e3ae72f98e55d88727225444f500775c0074" "cci.20200511": url: "https://github.com/recastnavigation/recastnavigation/archive/df27e4eb1a4ade9912f8b7d75c25769a3193dbd0.tar.gz" sha256: "299fdcfe14749a26041f54b4a018b8c4918e0dd0283f77823b96247bc97c9400" diff --git a/recipes/recastnavigation/all/conanfile.py b/recipes/recastnavigation/all/conanfile.py index cc3eb12118665..b65376a3de248 100644 --- a/recipes/recastnavigation/all/conanfile.py +++ b/recipes/recastnavigation/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 +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, move_folder_contents, rmdir, rm import os required_conan_version = ">=1.52.0" @@ -35,23 +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 source(self): - get(self, **self.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["RECASTNAVIGATION_DEMO"] = False - tc.variables["RECASTNAVIGATION_TESTS"] = False - tc.variables["RECASTNAVIGATION_EXAMPLES"] = False + tc.cache_variables["RECASTNAVIGATION_DEMO"] = False + tc.cache_variables["RECASTNAVIGATION_TESTS"] = False + tc.cache_variables["RECASTNAVIGATION_EXAMPLES"] = False + tc.cache_variables["RECASTNAVIGATION_STATIC"] = not self.options.shared + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared tc.generate() def build(self): @@ -64,29 +62,45 @@ 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", self.package_folder, recursive=True) + if self.version == "cci.20200511": + # Move the includes under recastnavigation/ prefix for future compatibility + mkdir(self, os.path.join(self.package_folder, "include", "recastnavigation")) + move_folder_contents(self, os.path.join(self.package_folder, "include"), + os.path.join(self.package_folder, "include", "recastnavigation")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "recastnavigation") self.cpp_info.set_property("pkg_config_name", "recastnavigation") + suffix = "" + if self.settings.build_type == "Debug" and self.version != "cci.20200511": + suffix = "-d" + self.cpp_info.components["Recast"].set_property("cmake_target_name", "RecastNavigation::Recast") - self.cpp_info.components["Recast"].libs = ["Recast"] + self.cpp_info.components["Recast"].libs = ["Recast" + suffix] self.cpp_info.components["Detour"].set_property("cmake_target_name", "RecastNavigation::Detour") - self.cpp_info.components["Detour"].libs = ["Detour"] + self.cpp_info.components["Detour"].libs = ["Detour" + suffix] self.cpp_info.components["DetourCrowd"].set_property("cmake_target_name", "RecastNavigation::DetourCrowd") - self.cpp_info.components["DetourCrowd"].libs = ["DetourCrowd"] + self.cpp_info.components["DetourCrowd"].libs = ["DetourCrowd" + suffix] self.cpp_info.components["DetourCrowd"].requires = ["Detour"] self.cpp_info.components["DetourTileCache"].set_property("cmake_target_name", "RecastNavigation::DetourTileCache") - self.cpp_info.components["DetourTileCache"].libs = ["DetourTileCache"] + self.cpp_info.components["DetourTileCache"].libs = ["DetourTileCache" + suffix] self.cpp_info.components["DetourTileCache"].requires = ["Detour"] self.cpp_info.components["DebugUtils"].set_property("cmake_target_name", "RecastNavigation::DebugUtils") - self.cpp_info.components["DebugUtils"].libs = ["DebugUtils"] + self.cpp_info.components["DebugUtils"].libs = ["DebugUtils" + suffix] self.cpp_info.components["DebugUtils"].requires = ["Recast", "Detour", "DetourTileCache"] + if self.version == "cci.20200511": + for component in self.cpp_info.components.values(): + component.includedirs.append(os.path.join("include", "recastnavigation")) + # TODO: to remove in conan v2 self.cpp_info.filenames["cmake_find_package"] = "recastnavigation" self.cpp_info.filenames["cmake_find_package_multi"] = "recastnavigation" diff --git a/recipes/recastnavigation/all/patches/001_fix_shared_option.patch b/recipes/recastnavigation/all/patches/001_fix_shared_option.patch index bacfaff6244ab..3d9c7f9ec982f 100644 --- a/recipes/recastnavigation/all/patches/001_fix_shared_option.patch +++ b/recipes/recastnavigation/all/patches/001_fix_shared_option.patch @@ -1,129 +1,50 @@ ---- CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 -+++ CMakeLists.txt 2020-08-07 12:39:31.306787200 -0400 -@@ -9,7 +9,10 @@ - option(RECASTNAVIGATION_DEMO "Build demo" ON) - option(RECASTNAVIGATION_TESTS "Build tests" ON) - option(RECASTNAVIGATION_EXAMPLES "Build examples" ON) --option(RECASTNAVIGATION_STATIC "Build static libraries" ON) -+ -+if(MSVC AND BUILD_SHARED_LIBS) -+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -+endif() - - add_subdirectory(DebugUtils) - add_subdirectory(Detour) -@@ -25,3 +28,4 @@ - enable_testing() - add_subdirectory(Tests) - endif () -+ --- DebugUtils/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 +++ DebugUtils/CMakeLists.txt 2020-08-07 12:40:03.921473100 -0400 -@@ -1,10 +1,6 @@ - file(GLOB SOURCES Source/*.cpp) - --if (RECASTNAVIGATION_STATIC) -- add_library(DebugUtils STATIC ${SOURCES}) --else() -- add_library(DebugUtils SHARED ${SOURCES}) --endif() -+add_library(DebugUtils ${SOURCES}) - - add_library(RecastNavigation::DebugUtils ALIAS DebugUtils) - -@@ -26,6 +22,7 @@ +@@ -26,6 +26,7 @@ ) install(TARGETS DebugUtils -+ RUNTIME DESTINATION bin ++ RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT library --- Detour/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 +++ Detour/CMakeLists.txt 2020-08-07 12:40:36.783319300 -0400 -@@ -1,10 +1,6 @@ - file(GLOB SOURCES Source/*.cpp) - --if(RECASTNAVIGATION_STATIC) -- add_library(Detour STATIC ${SOURCES}) --else() -- add_library(Detour SHARED ${SOURCES}) --endif() -+add_library(Detour ${SOURCES}) - - add_library(RecastNavigation::Detour ALIAS Detour) - -@@ -20,6 +16,7 @@ +@@ -20,6 +10,7 @@ ) install(TARGETS Detour -+ RUNTIME DESTINATION bin ++ RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT library --- DetourCrowd/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 +++ DetourCrowd/CMakeLists.txt 2020-08-07 12:41:02.664066800 -0400 -@@ -1,10 +1,6 @@ - file(GLOB SOURCES Source/*.cpp) - --if (RECASTNAVIGATION_STATIC) -- add_library(DetourCrowd STATIC ${SOURCES}) --else () -- add_library(DetourCrowd SHARED ${SOURCES}) --endif () -+add_library(DetourCrowd ${SOURCES}) - - add_library(RecastNavigation::DetourCrowd ALIAS DetourCrowd) - -@@ -24,6 +20,7 @@ +@@ -24,6 +24,7 @@ ) install(TARGETS DetourCrowd -+ RUNTIME DESTINATION bin ++ RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT library --- DetourTileCache/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 +++ DetourTileCache/CMakeLists.txt 2020-08-07 12:41:30.253060000 -0400 -@@ -1,10 +1,6 @@ - file(GLOB SOURCES Source/*.cpp) - --if (RECASTNAVIGATION_STATIC) -- add_library(DetourTileCache STATIC ${SOURCES}) --else () -- add_library(DetourTileCache SHARED ${SOURCES}) --endif () -+add_library(DetourTileCache ${SOURCES}) - - add_library(RecastNavigation::DetourTileCache ALIAS DetourTileCache) - -@@ -25,6 +21,7 @@ +@@ -25,6 +25,7 @@ install(TARGETS DetourTileCache -+ RUNTIME DESTINATION bin ++ RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT library --- Recast/CMakeLists.txt 2020-05-11 12:26:17.000000000 -0400 +++ Recast/CMakeLists.txt 2020-08-07 12:41:53.370875500 -0400 -@@ -1,10 +1,6 @@ - file(GLOB SOURCES Source/*.cpp) - --if (RECASTNAVIGATION_STATIC) -- add_library(Recast STATIC ${SOURCES}) --else () -- add_library(Recast SHARED ${SOURCES}) --endif () -+add_library(Recast ${SOURCES}) - - add_library(RecastNavigation::Recast ALIAS Recast) - -@@ -20,6 +16,7 @@ +@@ -20,6 +20,7 @@ ) install(TARGETS Recast -+ RUNTIME DESTINATION bin ++ RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT library diff --git a/recipes/recastnavigation/all/test_package/CMakeLists.txt b/recipes/recastnavigation/all/test_package/CMakeLists.txt index e3ac85f3e748b..18a39f8632ff8 100644 --- a/recipes/recastnavigation/all/test_package/CMakeLists.txt +++ b/recipes/recastnavigation/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(recastnavigation REQUIRED CONFIG) diff --git a/recipes/recastnavigation/all/test_package/test_package.cpp b/recipes/recastnavigation/all/test_package/test_package.cpp index d2e829330dc17..3d78635409b1f 100644 --- a/recipes/recastnavigation/all/test_package/test_package.cpp +++ b/recipes/recastnavigation/all/test_package/test_package.cpp @@ -1,4 +1,4 @@ -#include "Recast.h" +#include "recastnavigation/Recast.h" int main() { rcSqrt(2); diff --git a/recipes/recastnavigation/all/test_v1_package/CMakeLists.txt b/recipes/recastnavigation/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/recastnavigation/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/recastnavigation/all/test_v1_package/conanfile.py b/recipes/recastnavigation/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/recastnavigation/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_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/recastnavigation/config.yml b/recipes/recastnavigation/config.yml index 1a308ccfdedcc..a9e154d1a98c6 100644 --- a/recipes/recastnavigation/config.yml +++ b/recipes/recastnavigation/config.yml @@ -1,3 +1,5 @@ versions: + "1.6.0": + folder: all "cci.20200511": - folder: "all" + folder: all diff --git a/recipes/reckless/all/test_package/CMakeLists.txt b/recipes/reckless/all/test_package/CMakeLists.txt index 7923780072c36..f457a84a36ad5 100644 --- a/recipes/reckless/all/test_package/CMakeLists.txt +++ b/recipes/reckless/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(reckless REQUIRED CONFIG) diff --git a/recipes/reckless/all/test_v1_package/CMakeLists.txt b/recipes/reckless/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/reckless/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/reckless/all/test_v1_package/conanfile.py b/recipes/reckless/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/reckless/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_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/rectanglebinpack/all/conandata.yml b/recipes/rectanglebinpack/all/conandata.yml index e93b6ba1b6012..d50cf8d87d51a 100644 --- a/recipes/rectanglebinpack/all/conandata.yml +++ b/recipes/rectanglebinpack/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20230923": + - url: "https://github.com/juj/RectangleBinPack/archive/83e7e1132d93777e3732dfaae26b0f3703be2036.zip" + sha256: "ec8f20227fc79467cf7c5b5656e3e520712ee446fb9e449d42e1e5b4565f6bdc" "cci.20210901": - url: "https://github.com/juj/RectangleBinPack/archive/a40fcaf3871da57b0f6a080655b3387374840877.zip" sha256: "88cec105ca8d90d09e9e81f9862caa0cc1cdb851560fb701555eb58b29515748" diff --git a/recipes/rectanglebinpack/all/test_v1_package/CMakeLists.txt b/recipes/rectanglebinpack/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/rectanglebinpack/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 90eb89e3f2f46..0000000000000 --- a/recipes/rectanglebinpack/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/rectanglebinpack/config.yml b/recipes/rectanglebinpack/config.yml index 610b8f5b3b81f..b499d3b7e32dc 100644 --- a/recipes/rectanglebinpack/config.yml +++ b/recipes/rectanglebinpack/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20230923": + folder: "all" "cci.20210901": folder: "all" diff --git a/recipes/rectpack2d/all/test_package/CMakeLists.txt b/recipes/rectpack2d/all/test_package/CMakeLists.txt index 5676b880e88bb..b03a07d5b0ef3 100644 --- a/recipes/rectpack2d/all/test_package/CMakeLists.txt +++ b/recipes/rectpack2d/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(rectpack2d REQUIRED CONFIG) diff --git a/recipes/rectpack2d/all/test_v1_package/CMakeLists.txt b/recipes/rectpack2d/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/rectpack2d/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/rectpack2d/all/test_v1_package/conanfile.py b/recipes/rectpack2d/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/rectpack2d/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_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/test_v1_package/CMakeLists.txt b/recipes/redboltz-mqtt_cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/redboltz-mqtt_cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/redboltz-mqtt_cpp/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_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/redis-plus-plus/all/conandata.yml b/recipes/redis-plus-plus/all/conandata.yml index fb21e925b3beb..87ed20e99676e 100644 --- a/recipes/redis-plus-plus/all/conandata.yml +++ b/recipes/redis-plus-plus/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.3.13": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.13.tar.gz" + sha256: "678a61898ed72f0c692102c7ce103a1bcae1e6ff85a4ad03e6002c1ba8fe1e08" + "1.3.12": + url: "https://github.com/sewenew/redis-plus-plus/archive/1.3.12.tar.gz" + sha256: "26c1e45cdbafe1af4d2cf756957b2268baab6f802b53bcdd435864620e2c03c7" + "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" @@ -18,6 +27,18 @@ sources: url: "https://github.com/sewenew/redis-plus-plus/archive/1.2.3.tar.gz" sha256: "1a3336752133019c963e06c28667b96690d6395b804e5e326671777ff88982ea" patches: + "1.3.13": + - patch_file: "patches/1.3.13-0001-fix-dependencies-injection.patch" + patch_description: "Robust discovery & injection of dependencies, and handle missing hiredis_ssl-config.cmake" + patch_type: "conan" + "1.3.12": + - 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.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" diff --git a/recipes/redis-plus-plus/all/conanfile.py b/recipes/redis-plus-plus/all/conanfile.py index d7fbaf589b20b..43386129bd05b 100644 --- a/recipes/redis-plus-plus/all/conanfile.py +++ b/recipes/redis-plus-plus/all/conanfile.py @@ -1,12 +1,12 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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" +required_conan_version = ">=2.1" class RedisPlusPlusConan(ConanFile): @@ -33,7 +33,7 @@ class RedisPlusPlusConan(ConanFile): @property def _min_cppstd(self): - return "11" if Version(self.version) < "1.3.0" else "17" + return "11" @property def _compilers_minimum_version(self): @@ -86,11 +86,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - if self.settings.compiler.get_safe("cppstd"): - cppstd = str(self.settings.compiler.cppstd) - if cppstd.startswith("gnu"): - cppstd = cppstd[3:] - tc.cache_variables["REDIS_PLUS_PLUS_CXX_STANDARD"] = cppstd + cppstd = str(self.settings.get_safe("compiler.cppstd", 11)).replace("gnu", "") + tc.cache_variables["REDIS_PLUS_PLUS_CXX_STANDARD"] = cppstd tc.variables["REDIS_PLUS_PLUS_USE_TLS"] = self.options.with_tls if self.options.get_safe("build_async"): tc.cache_variables["REDIS_PLUS_PLUS_BUILD_ASYNC"] = "libuv" @@ -98,6 +95,9 @@ def generate(self): tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC"] = not self.options.shared tc.variables["REDIS_PLUS_PLUS_BUILD_SHARED"] = self.options.shared tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC_WITH_PIC"] = self.options.shared + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.3.13": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) deps.generate() @@ -135,10 +135,5 @@ def package_info(self): self.cpp_info.components["redis++lib"].system_libs.append("pthread") self.cpp_info.components["redis++lib"].system_libs.append("m") - # TODO: to remove in conan v2 - self.cpp_info.names["cmake_find_package"] = "redis++" - self.cpp_info.names["cmake_find_package_multi"] = "redis++" - self.cpp_info.components["redis++lib"].names["cmake_find_package"] = f"redis++{target_suffix}" - self.cpp_info.components["redis++lib"].names["cmake_find_package_multi"] = f"redis++{target_suffix}" self.cpp_info.components["redis++lib"].set_property("cmake_target_name", f"redis++::redis++{target_suffix}") self.cpp_info.components["redis++lib"].set_property("pkg_config_name", "redis++") diff --git a/recipes/redis-plus-plus/all/patches/1.3.13-0001-fix-dependencies-injection.patch b/recipes/redis-plus-plus/all/patches/1.3.13-0001-fix-dependencies-injection.patch new file mode 100644 index 0000000000000..ab8824faf6a00 --- /dev/null +++ b/recipes/redis-plus-plus/all/patches/1.3.13-0001-fix-dependencies-injection.patch @@ -0,0 +1,59 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ae2507e..8ef058b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,8 +45,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() +@@ -144,7 +143,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}) +@@ -174,17 +172,12 @@ 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) + + set(REDIS_PLUS_PLUS_GENERATED_HEADER_DIR ${CMAKE_CURRENT_BINARY_DIR}/${REDIS_PLUS_PLUS_HEADER_DIR}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hiredis_features.h.in ${CMAKE_CURRENT_BINARY_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}") +@@ -228,7 +221,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() +@@ -283,8 +276,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_v1_package/CMakeLists.txt b/recipes/redis-plus-plus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/redis-plus-plus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/redis-plus-plus/all/test_v1_package/conanfile.py b/recipes/redis-plus-plus/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/redis-plus-plus/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_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/redis-plus-plus/config.yml b/recipes/redis-plus-plus/config.yml index 38a930c3be65e..e058f2167283c 100644 --- a/recipes/redis-plus-plus/config.yml +++ b/recipes/redis-plus-plus/config.yml @@ -1,4 +1,10 @@ versions: + "1.3.13": + folder: all + "1.3.12": + folder: all + "1.3.11": + folder: all "1.3.10": folder: all "1.3.8": diff --git a/recipes/redradist-icc/all/CMakeLists.txt b/recipes/redradist-icc/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb9..0000000000000 --- a/recipes/redradist-icc/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/redradist-icc/all/conanfile.py b/recipes/redradist-icc/all/conanfile.py index 926df39193116..1c501628eb1da 100644 --- a/recipes/redradist-icc/all/conanfile.py +++ b/recipes/redradist-icc/all/conanfile.py @@ -1,33 +1,35 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration, ConanException -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 export_conandata_patches, get + +required_conan_version = ">=1.53.0" class ICCConan(ConanFile): - name = 'redradist-icc' - homepage = 'https://github.com/redradist/Inter-Component-Communication' - license = 'MIT' - url = 'https://github.com/conan-io/conan-center-index' - description = "I.C.C. - Inter Component Communication, This is a library created to simplify communication between " \ - "components inside of single application. It is thread safe and could be used for creating " \ - "components that works in different threads. " + name = "redradist-icc" + description = ( + "I.C.C. - Inter Component Communication, This is a library created to simplify communication between " + "components inside of single application. It is thread safe and could be used for creating " + "components that works in different threads. " + ) + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/redradist/Inter-Component-Communication" topics = ("thread-safe", "active-object", "communication") - 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, + "shared": False, + "fPIC": True, } - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" @property def _minimum_cpp_standard(self): @@ -37,79 +39,75 @@ def _minimum_cpp_standard(self): def _minimum_compilers_version(self): return { "Visual Studio": "15", + "msvc": "191", "apple-clang": "9.4", "clang": "3.3", - "gcc": "4.9.4" + "gcc": "4.9.4", } - def _configure_cmake(self): - if self._cmake: - return self._cmake - cmake = CMake(self) - cmake.definitions['ICC_BUILD_SHARED'] = self.options.shared - cmake.configure() - self._cmake = cmake - return self._cmake - - def validate(self): - if self.settings.get_safe("compiler.cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) - - os = self.settings.os - if os not in ("Windows", "Linux"): - msg = ( - "OS {} is not supported !!" - ).format(os) - raise ConanInvalidConfiguration(msg) - - compiler = self.settings.compiler - try: - min_version = self._minimum_compilers_version[str(compiler)] - if tools.Version(compiler.version) < min_version: - msg = ( - "{} requires C++{} features which are not supported by compiler {} {} !!" - ).format(self.name, self._minimum_cpp_standard, compiler, compiler.version) - raise ConanInvalidConfiguration(msg) - except KeyError: - msg = ( - "{} recipe lacks information about the {} compiler, " - "support for the required C++{} features is assumed" - ).format(self.name, compiler, self._minimum_cpp_standard) - self.output.warn(msg) + 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 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 validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + if is_apple_os(self): + raise ConanInvalidConfiguration(f"OS {self.settings.os} is not supported") + + def lazy_lt_semver(v1, v2): + # To allow version "9" >= "9.4" for apple-clang + return all(int(p1) < int(p2) for p1, p2 in zip(str(v1).split("."), str(v2).split("."))) + + compiler = self.settings.compiler + min_version = self._minimum_compilers_version.get(str(compiler)) + if min_version and lazy_lt_semver(compiler.version, min_version): + raise ConanInvalidConfiguration( + f"{self.name} requires C++{self._minimum_cpp_standard} features " + f"which are not supported by compiler {compiler} {compiler.version}") 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["ICC_BUILD_SHARED"] = self.options.shared + tc.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() def package_info(self): - self.cpp_info.names["cmake_find_package"] = "icc" - self.cpp_info.names["cmake_find_package_multi"] = "icc" + self.cpp_info.set_property("cmake_file_name", "icc") + self.cpp_info.set_property("cmake_target_name", "icc::icc") + if self.options.shared: self.cpp_info.libs = ["ICC"] else: self.cpp_info.libs = ["ICC_static"] - if self.settings.os == 'Windows': - self.cpp_info.system_libs = ['ws2_32', 'wsock32'] - if self.settings.os == 'Linux': - self.cpp_info.system_libs = ['pthread'] + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "wsock32"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "icc" + self.cpp_info.names["cmake_find_package_multi"] = "icc" diff --git a/recipes/redradist-icc/all/test_package/CMakeLists.txt b/recipes/redradist-icc/all/test_package/CMakeLists.txt index de507b485e0da..1e80ea5e97b76 100644 --- a/recipes/redradist-icc/all/test_package/CMakeLists.txt +++ b/recipes/redradist-icc/all/test_package/CMakeLists.txt @@ -1,12 +1,9 @@ -cmake_minimum_required(VERSION 3.1) -project(PackageTest) +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(icc REQUIRED) +find_package(icc REQUIRED CONFIG) add_executable(example example.cpp) target_link_libraries(example PRIVATE icc::icc) diff --git a/recipes/redradist-icc/all/test_package/conanfile.py b/recipes/redradist-icc/all/test_package/conanfile.py index b80e4a18de9ec..8d52b7021efe1 100644 --- a/recipes/redradist-icc/all/test_package/conanfile.py +++ b/recipes/redradist-icc/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 ICCTestConan(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): - 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/redradist-icc/all/test_package/example.cpp b/recipes/redradist-icc/all/test_package/example.cpp index cbf15d36a28cd..2a8c9ea6d9adf 100644 --- a/recipes/redradist-icc/all/test_package/example.cpp +++ b/recipes/redradist-icc/all/test_package/example.cpp @@ -1,14 +1,15 @@ #include #include #include -#include #include +#include + int main() { auto timer = icc::os::Timer::createTimer(); - timer->setInterval(std::chrono::seconds(10)); + timer->setInterval(std::chrono::milliseconds(100)); timer->enableContinuous(); timer->start(); - std::this_thread::sleep_for(std::chrono::seconds(25)); + std::this_thread::sleep_for(std::chrono::seconds(1)); return 0; } diff --git a/recipes/refl-cpp/all/test_package/CMakeLists.txt b/recipes/refl-cpp/all/test_package/CMakeLists.txt index f30f3345a4439..927d5fd0ed49d 100644 --- a/recipes/refl-cpp/all/test_package/CMakeLists.txt +++ b/recipes/refl-cpp/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(refl-cpp REQUIRED CONFIG) diff --git a/recipes/refl-cpp/all/test_v1_package/CMakeLists.txt b/recipes/refl-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/refl-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/refl-cpp/all/test_v1_package/conanfile.py b/recipes/refl-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/refl-cpp/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/reflect-cpp/all/conandata.yml b/recipes/reflect-cpp/all/conandata.yml new file mode 100644 index 0000000000000..419d596a0a5a0 --- /dev/null +++ b/recipes/reflect-cpp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.16.0": + url: "https://github.com/getml/reflect-cpp/archive/refs/tags/v0.16.0.tar.gz" + sha256: "a84d94dbd353d788926d6e54507b44c046863f7bc4ecb35afe0338374a68a77d" + "0.17.0": + url: "https://github.com/getml/reflect-cpp/archive/refs/tags/v0.17.0.tar.gz" + sha256: "08b6406cbe4c6c14ff1a619fe93a94f92f6d9eb22213d93529ad975993945e45" + "0.18.0": + url: "https://github.com/getml/reflect-cpp/archive/refs/tags/v0.18.0.tar.gz" + sha256: "c8df46550d787105ce695ea8f99425dc47475f5377c5253d412dd63f622dc7c7" diff --git a/recipes/reflect-cpp/all/conanfile.py b/recipes/reflect-cpp/all/conanfile.py new file mode 100644 index 0000000000000..faa31d1c31474 --- /dev/null +++ b/recipes/reflect-cpp/all/conanfile.py @@ -0,0 +1,165 @@ +from conan import ConanFile +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.env import VirtualBuildEnv +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +import os + +required_conan_version = ">=2.0.9" + + +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", + "Cap'n Proto", + "cbor", + "flatbuffers", + "json", + "msgpack", + "toml", + "xml", + "yaml", + ) + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + + @property + def _compilers_minimum_version(self): + # TODO: MSVC 19.38 is required, but ConanCenterIndex CI has update 6 installed. + # Update msvc to 193 when having the CI updated to the latest update. + return { + "msvc": "194", + "gcc": "11", + "clang": "13", + "apple-clang": "15", + } + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_capnproto": [True, False], + "with_cbor": [True, False], + "with_flatbuffers": [True, False], + "with_msgpack": [True, False], + "with_toml": [True, False], + "with_ubjson": [True, False], + "with_xml": [True, False], + "with_yaml": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_capnproto": False, + "with_cbor": False, + "with_flatbuffers": False, + "with_msgpack": False, + "with_toml": False, + "with_ubjson": False, + "with_xml": False, + "with_yaml": False, + } + implements = ["auto_shared_fpic"] + + def config_options(self): + if self.settings.get_safe("os") == "Windows": + self.options.rm_safe("fPIC") + if Version(self.version) < "0.17.0": + del self.options.with_capnproto + + def requirements(self): + self.requires("ctre/3.9.0", transitive_headers=True) + # INFO: include/rfl/json/Writer.hpp includes yyjson.h + # INFO: Transitive lib needed to avoid undefined reference to symbol 'yyjson_mut_doc_new' + self.requires("yyjson/0.10.0", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("with_capnproto"): + self.requires("capnproto/1.1.0", transitive_headers=True) + if self.options.with_cbor: + if Version(self.version) >= Version("0.17.0"): + self.requires("jsoncons/0.176.0", transitive_headers=True) + else: + self.requires("tinycbor/0.6.0", transitive_headers=True) + if self.options.with_flatbuffers: + self.requires("flatbuffers/24.3.25", transitive_headers=True) + if self.options.with_msgpack: + self.requires("msgpack-c/6.0.0", transitive_headers=True) + if self.options.with_toml: + if Version(self.version) >= Version("0.18.0"): + self.requires("toml11/4.4.0", transitive_headers=True) + else: + self.requires("tomlplusplus/3.4.0", transitive_headers=True) + if self.options.with_ubjson: + self.requires("jsoncons/0.176.0", transitive_headers=True) + if self.options.with_xml: + self.requires("pugixml/1.14", transitive_headers=True) + if self.options.with_yaml: + self.requires("yaml-cpp/0.8.0", transitive_headers=True) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.23 <4]") + + def validate(self): + check_min_cppstd(self, 20) + 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++20 features, which your compiler does not fully support.") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + # INFO: Let Conan handle the C++ standard used via settings.compiler.cppstd + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_CXX_STANDARD 20)", "") + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + deps = CMakeDeps(self) + if self.options.with_flatbuffers: + deps.set_property("flatbuffers", "cmake_target_name", "flatbuffers::flatbuffers") + deps.generate() + tc = CMakeToolchain(self) + tc.cache_variables["REFLECTCPP_BUILD_SHARED"] = self.options.shared + tc.cache_variables["REFLECTCPP_USE_BUNDLED_DEPENDENCIES"] = False + tc.cache_variables["REFLECTCPP_USE_VCPKG"] = False + if self.options.get_safe("with_capnproto") is not None: + tc.cache_variables["REFLECTCPP_CAPNPROTO"] = self.options.get_safe("with_capnproto") + tc.cache_variables["REFLECTCPP_CBOR"] = self.options.with_cbor + tc.cache_variables["REFLECTCPP_FLEXBUFFERS"] = self.options.with_flatbuffers + tc.cache_variables["REFLECTCPP_MSGPACK"] = self.options.with_msgpack + tc.cache_variables["REFLECTCPP_TOML"] = self.options.with_toml + tc.cache_variables["REFLECTCPP_UBJSON"] = self.options.with_ubjson + tc.cache_variables["REFLECTCPP_XML"] = self.options.with_xml + tc.cache_variables["REFLECTCPP_YAML"] = self.options.with_yaml + 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")) + + def package_info(self): + self.cpp_info.libs = ["reflectcpp"] + self.cpp_info.set_property("cmake_target_name", "reflectcpp::reflectcpp") + self.cpp_info.set_property("cmake_file_name", "reflectcpp") 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..74f3b52f1538e --- /dev/null +++ b/recipes/reflect-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(reflectcpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} reflectcpp::reflectcpp) +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..a66d61a9b1e97 --- /dev/null +++ b/recipes/reflect-cpp/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +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) + 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/reflect-cpp/all/test_package/test_package.cpp b/recipes/reflect-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1c46040d570e8 --- /dev/null +++ b/recipes/reflect-cpp/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include +#include +#include + +#include "rfl.hpp" +#include "rfl/Generic.hpp" +#include "rfl/json.hpp" + +int main(void) { + auto person = rfl::Generic::Object(); + person["first_name"] = "John"; + person["last_name"] = "Doe"; + rfl::json::write(person, std::cout) << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/reflect-cpp/config.yml b/recipes/reflect-cpp/config.yml new file mode 100644 index 0000000000000..7394400217fcb --- /dev/null +++ b/recipes/reflect-cpp/config.yml @@ -0,0 +1,7 @@ +versions: + "0.16.0": + folder: all + "0.17.0": + folder: all + "0.18.0": + folder: all diff --git a/recipes/replxx/all/test_package/CMakeLists.txt b/recipes/replxx/all/test_package/CMakeLists.txt index 8b0f16b38a428..4dd704f119c06 100644 --- a/recipes/replxx/all/test_package/CMakeLists.txt +++ b/recipes/replxx/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(replxx REQUIRED CONFIG) diff --git a/recipes/replxx/all/test_v1_package/CMakeLists.txt b/recipes/replxx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/replxx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/replxx/all/test_v1_package/conanfile.py b/recipes/replxx/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/replxx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/reproc/all/conandata.yml b/recipes/reproc/all/conandata.yml new file mode 100644 index 0000000000000..a3605662cc0ab --- /dev/null +++ b/recipes/reproc/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "14.2.5": + url: "https://github.com/DaanDeMeyer/reproc/archive/refs/tags/v14.2.5.tar.gz" + sha256: "69467be0cfc80734b821c54ada263c8f1439f964314063f76b7cf256c3dc7ee8" diff --git a/recipes/reproc/all/conanfile.py b/recipes/reproc/all/conanfile.py new file mode 100644 index 0000000000000..9097df0dcfa45 --- /dev/null +++ b/recipes/reproc/all/conanfile.py @@ -0,0 +1,98 @@ +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, rm, rmdir +from conan.tools.scm import Version + + +class PackageConan(ConanFile): + name = "reproc" + description = "A cross-platform C99 process library" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/DaanDeMeyer/reproc" + topics = ("process-management", "process", "cross-platform") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cxx": [True, False], + "multithreaded": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "cxx": True, + "multithreaded": 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") + if not self.options.cxx: + 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.options.cxx: + check_min_cppstd(self, 11) + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": + # drain.hpp:55:43: error: ‘stream’ is not a class, namespace, or enumeration + raise ConanInvalidConfiguration("GCC < 6 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["REPROC++"] = self.options.cxx + tc.variables["REPROC_MULTITHREADED"] = self.options.multithreaded + tc.variables["REPROC_TEST"] = False + tc.variables["REPROC_EXAMPLES"] = False + tc.generate() + + + def build(self): + 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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + cmake_config_name = "reproc++" if self.options.cxx else "reproc" + self.cpp_info.set_property("cmake_file_name", cmake_config_name) + + self.cpp_info.components["reproc_c"].set_property("pkg_config_name", "reproc") + self.cpp_info.components["reproc_c"].set_property("cmake_target_name", "reproc") + self.cpp_info.components["reproc_c"].libs = ["reproc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["reproc_c"].system_libs.append("rt") + if self.options.multithreaded: + self.cpp_info.components["reproc_c"].system_libs.append("pthread") + elif self.settings.os == "Windows": + self.cpp_info.components["reproc_c"].system_libs.append("Ws2_32") + + if self.options.cxx: + self.cpp_info.components["reproc_cxx"].set_property("pkg_config_name", "reproc++") + self.cpp_info.components["reproc_cxx"].set_property("cmake_target_name", "reproc++") + self.cpp_info.components["reproc_cxx"].libs = ["reproc++"] + self.cpp_info.components["reproc_cxx"].requires = ["reproc_c"] diff --git a/recipes/reproc/all/test_package/CMakeLists.txt b/recipes/reproc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c9164d8e481d9 --- /dev/null +++ b/recipes/reproc/all/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C CXX) + +if(WITH_CXX) + find_package(reproc++ REQUIRED CONFIG) +else() + find_package(reproc REQUIRED CONFIG) +endif() + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE reproc) +target_compile_features(${PROJECT_NAME}_c PRIVATE c_std_99) + +if(WITH_CXX) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE reproc++) + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11) +endif() diff --git a/recipes/reproc/all/test_package/conanfile.py b/recipes/reproc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..564792987ded2 --- /dev/null +++ b/recipes/reproc/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) + tc.variables["WITH_CXX"] = self.dependencies["reproc"].options.get_safe("cxx") + 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_c") + self.run(bin_path, env="conanrun") + if (self.dependencies["reproc"].options.get_safe("cxx")): + bin_path = os.path.join(self.cpp.build.bindir, "test_package_cpp") + self.run(bin_path, env="conanrun") diff --git a/recipes/reproc/all/test_package/test_package.c b/recipes/reproc/all/test_package/test_package.c new file mode 100644 index 0000000000000..8faa1f59953e3 --- /dev/null +++ b/recipes/reproc/all/test_package/test_package.c @@ -0,0 +1,14 @@ +#include +#include + +int main() +{ + reproc_t *process = reproc_new(); + if (!process) { + fprintf(stderr, "Failed to create reproc process.\n"); + return 1; + } + printf("reproc setup successful. Process object created.\n"); + reproc_destroy(process); + return 0; +} diff --git a/recipes/reproc/all/test_package/test_package.cpp b/recipes/reproc/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e21d308880ab5 --- /dev/null +++ b/recipes/reproc/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +int main() +{ + try { + reproc::process process; + reproc::options options; + options.redirect.parent = true; + std::cout << "reproc++ setup successful. Process object created.\n"; + } catch (const std::exception &e) { + std::cerr << "Error: " << e.what() << '\n'; + return 1; + } + return 0; +} diff --git a/recipes/reproc/config.yml b/recipes/reproc/config.yml new file mode 100644 index 0000000000000..b315d53552983 --- /dev/null +++ b/recipes/reproc/config.yml @@ -0,0 +1,3 @@ +versions: + "14.2.5": + folder: all diff --git a/recipes/resiprocate/all/conandata.yml b/recipes/resiprocate/all/conandata.yml index 30a690c6f981a..3c5856f5a74a9 100644 --- a/recipes/resiprocate/all/conandata.yml +++ b/recipes/resiprocate/all/conandata.yml @@ -1,4 +1,4 @@ sources: "1.12.0": - url: https://www.resiprocate.org/files/pub/reSIProcate/releases/resiprocate-1.12.0.tar.gz - sha256: 046826503d3c8682ae0e42101b28f903c5f988235f1ff4a98dbfb9066d0d3d49 + url: "https://github.com/resiprocate/resiprocate/archive/refs/tags/resiprocate-1.12.0.tar.gz" + sha256: "aa8906082e4221bffbfab3210df68a6ba1f57ba1532d89ea4572b4fa9877914f" diff --git a/recipes/resiprocate/all/conanfile.py b/recipes/resiprocate/all/conanfile.py index 54400194c9ba3..65f010b869c78 100644 --- a/recipes/resiprocate/all/conanfile.py +++ b/recipes/resiprocate/all/conanfile.py @@ -1,94 +1,106 @@ import os -from conans import ConanFile, AutoToolsBuildEnvironment, 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 cross_building +from conan.tools.env import VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir, chdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.29.1" class ResiprocateConan(ConanFile): name = "resiprocate" - description = "The project is dedicated to maintaining a complete, correct, and commercially usable implementation of SIP and a few related protocols. " - topics = ("sip", "voip", "communication", "signaling") - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://www.resiprocate.org" + description = ( + "The project is dedicated to maintaining a complete, correct, " + "and commercially usable implementation of SIP and a few related protocols." + ) license = "VSL-1.0" - settings = "os", "compiler", "build_type", "arch" - options = {"fPIC": [True, False], - "shared": [True, False], - "with_ssl": [True, False], - "with_postgresql": [True, False], - "with_mysql": [True, False]} - default_options = {"fPIC": True, - "shared": False, - "with_ssl": True, - "with_postgresql": True, - "with_mysql": True} - _autotools = None + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/resiprocate/resiprocate/wiki/" + topics = ("sip", "voip", "communication", "signaling") - @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_ssl": [True, False], + "with_postgresql": [True, False], + "with_mysql": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_ssl": True, + "with_postgresql": True, + "with_mysql": False, + } def config_options(self): - if self.settings.os == 'Windows': + if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.settings.os in ("Windows", "Macos"): - # FIXME: Visual Studio project & Mac support seems available in resiprocate - raise ConanInvalidConfiguration("reSIProcate recipe does not currently support {}.".format(self.settings.os)) + if self.settings.os == "Windows" or is_apple_os(self): + # FIXME: unreleased versions of resiprocate use CMake and should support Windows and macOS + raise ConanInvalidConfiguration(f"reSIProcate recipe does not currently support {self.settings.os}.") 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.with_ssl: - self.requires("openssl/1.1.1q") + self.requires("openssl/1.1.1w") # OpenSSL 3.x is not supported if self.options.with_postgresql: - self.requires("libpq/14.2") + self.requires("libpq/15.4") if self.options.with_mysql: - self.requires("libmysqlclient/8.0.29") + self.requires("libmysqlclient/8.1.0") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - 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)), - "--with-pic={}".format(yes_no(self.options.get_safe("fPIC", True))) - ] + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + if not cross_building(self): + venv = VirtualRunEnv(self) + venv.generate(scope="build") + tc = AutotoolsToolchain(self) # These options do not support yes/no if self.options.with_ssl: - configure_args.append("--with-ssl") + tc.configure_args.append("--with-ssl") if self.options.with_mysql: - configure_args.append("--with-mysql") + tc.configure_args.append("--with-mysql") if self.options.with_postgresql: - configure_args.append("--with-postgresql") - - self._autotools.configure(configure_dir=self._source_subfolder, args=configure_args) - return self._autotools + tc.configure_args.append("--with-postgresql") + tc.generate() + deps = AutotoolsDeps(self) + deps.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("COPYING", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() - autotools.install() - tools.rmdir(os.path.join(os.path.join(self.package_folder, "share"))) - tools.remove_files_by_mask(os.path.join(self.package_folder), "*.la") + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(os.path.join(self.package_folder, "share"))) + rm(self, "*.la", os.path.join(self.package_folder), recursive=True) def package_info(self): self.cpp_info.libs = ["resip", "rutil", "dum", "resipares"] if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs = ["pthread"] + + # TODO: Legacy, to be removed on Conan 2.0 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.PATH.append(bin_path) diff --git a/recipes/resiprocate/all/test_package/CMakeLists.txt b/recipes/resiprocate/all/test_package/CMakeLists.txt index 33ae887aa6aea..9a3b67fc7fe91 100644 --- a/recipes/resiprocate/all/test_package/CMakeLists.txt +++ b/recipes/resiprocate/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(resiprocate REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE resiprocate::resiprocate) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/resiprocate/all/test_package/conanfile.py b/recipes/resiprocate/all/test_package/conanfile.py index ea57a464900be..ef5d7042163ec 100644 --- a/recipes/resiprocate/all/test_package/conanfile.py +++ b/recipes/resiprocate/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/accellera-uvm-systemc/all/test_v1_package/CMakeLists.txt b/recipes/resiprocate/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/accellera-uvm-systemc/all/test_v1_package/CMakeLists.txt rename to recipes/resiprocate/all/test_v1_package/CMakeLists.txt diff --git a/recipes/cgltf/all/test_v1_package/conanfile.py b/recipes/resiprocate/all/test_v1_package/conanfile.py similarity index 100% rename from recipes/cgltf/all/test_v1_package/conanfile.py rename to recipes/resiprocate/all/test_v1_package/conanfile.py diff --git a/recipes/resiprocate/cmake/conandata.yml b/recipes/resiprocate/cmake/conandata.yml new file mode 100644 index 0000000000000..dfe994229bb96 --- /dev/null +++ b/recipes/resiprocate/cmake/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.13.2": + url: "https://github.com/resiprocate/resiprocate/archive/refs/tags/resiprocate-1.13.2.tar.gz" + sha256: "059fda8f63c456fd61130d468a67655cfeafb5ba8ff5c1d0a55dc383f83e4fba" + "1.13.1": + url: "https://github.com/resiprocate/resiprocate/archive/refs/tags/resiprocate-1.13.1.tar.gz" + sha256: "df8d0cbf17793077d59c2863b23a6da8e9c77aba88327d1a494accaded1ef605" diff --git a/recipes/resiprocate/cmake/conanfile.py b/recipes/resiprocate/cmake/conanfile.py new file mode 100644 index 0000000000000..ca7fb5319fb43 --- /dev/null +++ b/recipes/resiprocate/cmake/conanfile.py @@ -0,0 +1,151 @@ +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, cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=2.0.9" + + +class ResiprocateConan(ConanFile): + name = "resiprocate" + description = ( + "The project is dedicated to maintaining a complete, correct, " + "and commercially usable implementation of SIP and a few related protocols." + ) + license = "VSL-1.0", "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/resiprocate/resiprocate/wiki/" + topics = ("sip", "voip", "communication", "signaling") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_cares": [True, False], + "with_ssl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_cares": True, + "with_ssl": True, + } + implements = ["auto_shared_fpic"] + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_cares: + self.requires("c-ares/[>=1.27 <2]") + if self.options.with_ssl: + self.requires("openssl/[>=1.1 <4]") + + def validate(self): + check_min_cppstd(self, 11) + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on msvc, it does not export required symbols.") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.21 <4]") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_DSO_PLUGINS"] = False + tc.variables["BUILD_QPID_PROTON"] = False + tc.variables["BUILD_RECON"] = False + tc.variables["BUILD_REFLOW"] = False + tc.variables["BUILD_REND"] = False + tc.variables["BUILD_REPRO"] = False + tc.variables["BUILD_RETURN"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["BUILD_TFM"] = False + tc.variables["ENABLE_LOG_REPOSITORY_DETAILS"] = False + tc.variables["REGENERATE_MEDIA_SAMPLES"] = False + tc.variables["RESIP_ASSERT_SYSLOG"] = False + tc.variables["USE_CONTRIB"] = False + tc.variables["USE_DTLS"] = self.options.with_ssl + tc.variables["USE_KURENTO"] = False + tc.variables["USE_MAXMIND_GEOIP"] = False + tc.variables["USE_NUGET"] = False + tc.variables["USE_POPT"] = False + tc.variables["VERSIONED_SONAME"] = False + tc.variables["WITH_C_ARES"] = self.options.with_cares + tc.variables["WITH_SSL"] = self.options.with_ssl + if self.settings.os in ["Linux"]: + tc.preprocessor_definitions["RESIP_RANDOM_THREAD_LOCAL"] = True + if cross_building(self): + tc.cache_variables["HAVE_CLOCK_GETTIME_MONOTONIC"] = not self.settings.os in ["Windows"] + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = CMakeDeps(self) + tc.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, "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): + resiprocate_lib = "resiprocate" if self.settings.os == "Windows" else "resip" + + self.cpp_info.components["resip"].libs = [resiprocate_lib] + self.cpp_info.components["resip"].requires = ["rutil"] + if is_apple_os(self): + self.cpp_info.components["resip"].frameworks.extend(["CoreFoundation", "CoreServices", "Security"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["resip"].system_libs.append("m") + elif self.settings.os == "Windows" and self.options.with_ssl: + self.cpp_info.components["resip"].system_libs.extend(["crypt32", "ncrypt"]) + + if not self.options.with_cares: + self.cpp_info.components["resipares"].libs = ["resipares"] + if is_apple_os(self): + self.cpp_info.components["resipares"].frameworks.extend(["CoreFoundation", "SystemConfiguration"]) + elif self.settings.os == "Windows": + self.cpp_info.components["resipares"].system_libs.append("ws2_32") + + self.cpp_info.components["rutil"].libs = ["rutil"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["rutil"].system_libs.extend(["resolv", "rt", "pthread"]) + elif self.settings.os == "Macos": + self.cpp_info.components["rutil"].system_libs.append("resolv") + elif self.settings.os == "Windows": + self.cpp_info.components["rutil"].system_libs.append("winmm") + if self.options.with_ssl: + self.cpp_info.components["rutil"].requires.extend(["openssl::ssl", "openssl::crypto"]) + if self.options.with_cares: + self.cpp_info.components["rutil"].requires.append("c-ares::c-ares") + else: + self.cpp_info.components["rutil"].requires.append("resipares") + + self.cpp_info.components["dum"].libs = ["dum"] + self.cpp_info.components["dum"].requires = ["resip"] + + if self.options.with_ssl: + self.cpp_info.components["sipdial"].libs = ["sipdial"] + self.cpp_info.components["sipdial"].requires = ["dum"] diff --git a/recipes/resiprocate/cmake/test_package/CMakeLists.txt b/recipes/resiprocate/cmake/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9a3b67fc7fe91 --- /dev/null +++ b/recipes/resiprocate/cmake/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(resiprocate REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE resiprocate::resiprocate) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/resiprocate/cmake/test_package/conanfile.py b/recipes/resiprocate/cmake/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/resiprocate/cmake/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/resiprocate/cmake/test_package/test_package.cpp b/recipes/resiprocate/cmake/test_package/test_package.cpp new file mode 100644 index 0000000000000..a562356e7fd9f --- /dev/null +++ b/recipes/resiprocate/cmake/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include +#include +#include +#include + +#define RESIPROCATE_SUBSYSTEM Subsystem::TEST + +using namespace resip; + +int main(int argc, char* argv[]) +{ + Log::initialize(Log::Cout, Log::Warning, argv[0]); + + const std::string sipRawData("foobar"); + + SipMessage* msg = SipMessage::make(sipRawData.data(), true); + if (!msg) { + return 0; + } + + return 0; +} + diff --git a/recipes/resiprocate/config.yml b/recipes/resiprocate/config.yml index 38422764207cf..7713701209dab 100644 --- a/recipes/resiprocate/config.yml +++ b/recipes/resiprocate/config.yml @@ -1,3 +1,7 @@ versions: + "1.13.2": + folder: cmake + "1.13.1": + folder: cmake "1.12.0": folder: all diff --git a/recipes/resource_pool/all/test_v1_package/CMakeLists.txt b/recipes/resource_pool/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/resource_pool/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index fdaba4642f464..0000000000000 --- a/recipes/resource_pool/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/restbed/all/test_package/CMakeLists.txt b/recipes/restbed/all/test_package/CMakeLists.txt index 3bad6b5f5053d..45ffd98ae5449 100644 --- a/recipes/restbed/all/test_package/CMakeLists.txt +++ b/recipes/restbed/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(restbed REQUIRED CONFIG) diff --git a/recipes/restbed/all/test_v1_package/CMakeLists.txt b/recipes/restbed/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/restbed/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/restbed/all/test_v1_package/conanfile.py b/recipes/restbed/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/restbed/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_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/restinio/config.yml b/recipes/restinio/config.yml index 224a43066392f..385096b41a86b 100644 --- a/recipes/restinio/config.yml +++ b/recipes/restinio/config.yml @@ -1,4 +1,8 @@ versions: + "0.7.2": + folder: "v0.7" + "0.7.1": + folder: "v0.7" "0.7.0": folder: "v0.7" "0.6.19": diff --git a/recipes/restinio/v0.7/conandata.yml b/recipes/restinio/v0.7/conandata.yml index 1b3707b68b5bb..7eae58a5c9bb2 100644 --- a/recipes/restinio/v0.7/conandata.yml +++ b/recipes/restinio/v0.7/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.7.2": + url: "https://github.com/Stiffstream/restinio/archive/v.0.7.2.tar.gz" + sha256: "8d48dcf0e01a30562d7357f95048f43fa7c08db69eabef00540d60a3278523cb" + "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 index 962616c9f35c2..b9976dbf00f14 100644 --- a/recipes/restinio/v0.7/conanfile.py +++ b/recipes/restinio/v0.7/conanfile.py @@ -36,13 +36,13 @@ def layout(self): def requirements(self): self.requires("llhttp/9.1.3") - self.requires("fmt/10.1.1") + self.requires("fmt/10.2.1") self.requires("expected-lite/0.6.3") if self.options.asio == "standalone": - self.requires("asio/1.28.2") + self.requires("asio/1.29.0") else: - self.requires("boost/1.83.0") + self.requires("boost/1.84.0") if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") @@ -67,7 +67,7 @@ def validate(self): "gcc": "9", "clang": "10", "apple-clang": "11", - "Visual Studio": "17", + "Visual Studio": "15", "msvc": "191" } diff --git a/recipes/rg-etc1/all/CMakeLists.txt b/recipes/rg-etc1/all/CMakeLists.txt index 5d4d0f4829476..6cf5ec1c482dd 100644 --- a/recipes/rg-etc1/all/CMakeLists.txt +++ b/recipes/rg-etc1/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) if(WIN32 AND BUILD_SHARED_LIBS) diff --git a/recipes/rg-etc1/all/test_v1_package/CMakeLists.txt b/recipes/rg-etc1/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/rg-etc1/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/rg-etc1/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", "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/test_v1_package/CMakeLists.txt b/recipes/rgbcx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/rgbcx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index f96c48347ffda..0000000000000 --- a/recipes/rgbcx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/conandata.yml b/recipes/ring-span-lite/all/conandata.yml index ecb24a4b876e4..4919bacb7f2d0 100644 --- a/recipes/ring-span-lite/all/conandata.yml +++ b/recipes/ring-span-lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.7.0": + url: "https://github.com/martinmoene/ring-span-lite/archive/v0.7.0.tar.gz" + sha256: "7650bb1bcf76cb0f7ac75240c5346203cbe7eb7027c0843c60253f6db08a93c1" "0.6.0": url: "https://github.com/martinmoene/ring-span-lite/archive/v0.6.0.tar.gz" sha256: "3248ee40a3147e6ba3cee051a838f727770654ade0c9852b1640f0f40d2e0573" diff --git a/recipes/ring-span-lite/all/conanfile.py b/recipes/ring-span-lite/all/conanfile.py index 91e2240703f2a..fa9939f4bd005 100644 --- a/recipes/ring-span-lite/all/conanfile.py +++ b/recipes/ring-span-lite/all/conanfile.py @@ -8,12 +8,13 @@ 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 ") - topics = ("cpp98", "cpp11", "cpp14", "cpp17", "ring-span") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/ring-span-lite" + topics = ("cpp98", "cpp11", "cpp14", "cpp17", "ring-span", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -24,11 +25,7 @@ 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) - - def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), diff --git a/recipes/ring-span-lite/all/test_package/CMakeLists.txt b/recipes/ring-span-lite/all/test_package/CMakeLists.txt index 2205b3fc45fb6..5e292da8f31f8 100644 --- a/recipes/ring-span-lite/all/test_package/CMakeLists.txt +++ b/recipes/ring-span-lite/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(ring-span-lite REQUIRED CONFIG) diff --git a/recipes/ring-span-lite/all/test_package/conanfile.py b/recipes/ring-span-lite/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/ring-span-lite/all/test_package/conanfile.py +++ b/recipes/ring-span-lite/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/ring-span-lite/all/test_v1_package/CMakeLists.txt b/recipes/ring-span-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 6e14cd0d6387d..0000000000000 --- a/recipes/ring-span-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(ring-span-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::ring-span-lite) diff --git a/recipes/ring-span-lite/all/test_v1_package/conanfile.py b/recipes/ring-span-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/ring-span-lite/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_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/ring-span-lite/config.yml b/recipes/ring-span-lite/config.yml index babcbfb79d964..a0804c43130f1 100644 --- a/recipes/ring-span-lite/config.yml +++ b/recipes/ring-span-lite/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.0": + folder: all "0.6.0": folder: all "0.5.0": diff --git a/recipes/rmlui/3.3/CMakeLists.txt b/recipes/rmlui/3.3/CMakeLists.txt index 525557293822c..56513025ccd4d 100644 --- a/recipes/rmlui/3.3/CMakeLists.txt +++ b/recipes/rmlui/3.3/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper LANGUAGES CXX) include(conanbuildinfo.cmake) diff --git a/recipes/rmlui/3.3/test_package/CMakeLists.txt b/recipes/rmlui/3.3/test_package/CMakeLists.txt index c85e03106ee56..6ab0447c67273 100644 --- a/recipes/rmlui/3.3/test_package/CMakeLists.txt +++ b/recipes/rmlui/3.3/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/rmlui/4.x/CMakeLists.txt b/recipes/rmlui/4.x/CMakeLists.txt index 525557293822c..56513025ccd4d 100644 --- a/recipes/rmlui/4.x/CMakeLists.txt +++ b/recipes/rmlui/4.x/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper LANGUAGES CXX) include(conanbuildinfo.cmake) diff --git a/recipes/rmlui/4.x/test_package/CMakeLists.txt b/recipes/rmlui/4.x/test_package/CMakeLists.txt index e73da164625e9..b11848269ffb4 100644 --- a/recipes/rmlui/4.x/test_package/CMakeLists.txt +++ b/recipes/rmlui/4.x/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(rmlui REQUIRED CONFIG) diff --git a/recipes/rmm/all/conandata.yml b/recipes/rmm/all/conandata.yml index 67683994d5b6f..31ecfbfa6c6ef 100644 --- a/recipes/rmm/all/conandata.yml +++ b/recipes/rmm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "24.04.00": + url: "https://github.com/rapidsai/rmm/archive/v24.04.00a.tar.gz" + sha256: "47a5d28a99165fc6e1f02399e0cc8b304f5bbc9aaf2071288ae92638ecdf516c" "23.10.00": url: "https://github.com/rapidsai/rmm/archive/v23.10.00.tar.gz" sha256: "4e2408073662fdfd92ca21d87f7d2afc64d2595fd5a1e3fa321d3472cfbd7f7a" diff --git a/recipes/rmm/all/conanfile.py b/recipes/rmm/all/conanfile.py index ca0e3861927c1..91388dbe02f58 100644 --- a/recipes/rmm/all/conanfile.py +++ b/recipes/rmm/all/conanfile.py @@ -42,8 +42,8 @@ def layout(self): def requirements(self): self.requires("thrust/1.17.2") - self.requires("spdlog/1.12.0") - self.requires("fmt/10.1.1") + self.requires("spdlog/1.13.0") + self.requires("fmt/10.2.1") def package_id(self): self.info.clear() diff --git a/recipes/rmm/config.yml b/recipes/rmm/config.yml index 20cd4f56dc99f..396bbc9cfd497 100644 --- a/recipes/rmm/config.yml +++ b/recipes/rmm/config.yml @@ -1,4 +1,6 @@ versions: + "24.04.00": + folder: all "23.10.00": folder: all "23.06.00": diff --git a/recipes/roaring/all/conandata.yml b/recipes/roaring/all/conandata.yml index ec4f98fdaba4d..1cf5a2a6090e4 100644 --- a/recipes/roaring/all/conandata.yml +++ b/recipes/roaring/all/conandata.yml @@ -1,34 +1,28 @@ sources: - "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" - "1.1.0": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.1.0.tar.gz" - sha256: "b59495578e3e4790a216420ce70578d22c1b6d1987232fc2bf46463a03fb1c06" - "1.0.0": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v1.0.0.tar.gz" - sha256: "08f884cd2790fcfba69b63443442034702f5d4865514fb09ac6ff05e048bf230" - "0.9.9": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.9.9.tar.gz" - sha256: "3083bcbc37e43403111c482ddf317a710972256c23bc83abc8925803a02bdf60" - "0.8.1": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.8.1.tar.gz" - sha256: "5359f2a051f10e42cea5edc3cb3650fd272e9125e6a0538901cf30619939d4f8" - "0.7.3": - url: "https://github.com/RoaringBitmap/CRoaring/archive/v0.7.3.tar.gz" - sha256: "e3f8115ba44ef0e1eb7b982dc3c3233f08f5f95ec1260169c2ad0ca50e56b656" + "4.2.1": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.2.1.tar.gz" + sha256: "3514728e9eb8c90dbc00a9e337302eb458c65be2f9501a3e882d051599c4a74c" + "4.2.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.2.0.tar.gz" + sha256: "b5f2d184b0872f57dce911cb520925539cfa851deda516d1239e8e06aff96439" + "4.1.7": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.1.7.tar.gz" + sha256: "ea235796c074c3a8a8c3e5c84bb5f09619723b8e4913cf99cc349f626c193569" + "4.1.2": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.1.2.tar.gz" + sha256: "dd9e9d9a28dcf9ba1622fb4a3a7b4d7f5e12732bb35e99a7cb028b7512731a7b" + "4.1.1": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.1.1.tar.gz" + sha256: "42804cc2bb5c9279ec4fcaa56d2d6b389da934634abcce8dbc4e4c1d60e1468d" + "4.1.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.1.0.tar.gz" + sha256: "0596c6e22bcccb56f38260142b435f1f72aef7721fa370fd9f2b88380245fc1d" + "4.0.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.0.0.tar.gz" + sha256: "a8b98db3800cd10979561a1388e4e970886a24015bd6cfabb08ba7917f541b0d" + "3.0.0": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v3.0.0.tar.gz" + sha256: "25183bc54ab650d964256d547869a34573a13d06f7e6a369b79e77f5c1feb8ba" + "2.1.2": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.1.2.tar.gz" + sha256: "a53d2f540f78ddae31e30c573b1b7fd41d7257d6a090507ba35d9c398712e5ad" diff --git a/recipes/roaring/all/conanfile.py b/recipes/roaring/all/conanfile.py index f0d51742149de..124a3907934e8 100644 --- a/recipes/roaring/all/conanfile.py +++ b/recipes/roaring/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version import os @@ -45,8 +45,6 @@ def config_options(self): 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 @@ -79,11 +77,11 @@ def generate(self): tc.variables["ENABLE_ROARING_TESTS"] = False # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "3.0.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): - 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 6e9e7fadde265..9d40ef7a3f2b3 100644 --- a/recipes/roaring/all/test_package/CMakeLists.txt +++ b/recipes/roaring/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(roaring REQUIRED CONFIG) diff --git a/recipes/roaring/all/test_v1_package/CMakeLists.txt b/recipes/roaring/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/roaring/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/roaring/all/test_v1_package/conanfile.py b/recipes/roaring/all/test_v1_package/conanfile.py deleted file mode 100644 index 1d4478bedc297..0000000000000 --- a/recipes/roaring/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_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/roaring/config.yml b/recipes/roaring/config.yml index 8cf27c6a95cb1..589d7841508de 100644 --- a/recipes/roaring/config.yml +++ b/recipes/roaring/config.yml @@ -1,23 +1,19 @@ versions: - "2.1.0": + "4.2.1": folder: all - "2.0.4": + "4.2.0": folder: all - "2.0.2": + "4.1.7": folder: all - "1.3.0": + "4.1.2": folder: all - "1.1.5": + "4.1.1": folder: all - "1.1.2": + "4.1.0": folder: all - "1.1.0": + "4.0.0": folder: all - "1.0.0": + "3.0.0": folder: all - "0.9.9": - folder: all - "0.8.1": - folder: all - "0.7.3": + "2.1.2": folder: all diff --git a/recipes/robin-hood-hashing/all/test_package/CMakeLists.txt b/recipes/robin-hood-hashing/all/test_package/CMakeLists.txt index c5737c42bfb29..c34b0491896f0 100644 --- a/recipes/robin-hood-hashing/all/test_package/CMakeLists.txt +++ b/recipes/robin-hood-hashing/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(robin_hood REQUIRED CONFIG) diff --git a/recipes/robin-hood-hashing/all/test_v1_package/CMakeLists.txt b/recipes/robin-hood-hashing/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/robin-hood-hashing/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/robin-hood-hashing/all/test_v1_package/conanfile.py b/recipes/robin-hood-hashing/all/test_v1_package/conanfile.py deleted file mode 100644 index b5c4f7e93cf63..0000000000000 --- a/recipes/robin-hood-hashing/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_find_package_multi", "cmake" - - 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/rocket/all/conandata.yml b/recipes/rocket/all/conandata.yml new file mode 100644 index 0000000000000..03683863693df --- /dev/null +++ b/recipes/rocket/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "cci.20200603": + url: "https://github.com/tripleslash/rocket/archive/348869fcda83f8b8b521c7654f83fea07ebe7a0a.tar.gz" + sha256: "de03b9c7f9b9478cfaa60683f95a7b0773dc0929d14e510c23f53b3804cc921f" +patches: + "cci.20200603": + - patch_file: "patches/0001-fix-thread_id.patch" + patch_description: "Fix compilation on different C++ std versions" + patch_type: "backport" + patch_source: "https://github.com/tripleslash/rocket/issues/10" diff --git a/recipes/rocket/all/conanfile.py b/recipes/rocket/all/conanfile.py new file mode 100644 index 0000000000000..7e395c84d11ae --- /dev/null +++ b/recipes/rocket/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 apply_conandata_patches, copy, export_conandata_patches, get, load, save +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class RocketConan(ConanFile): + name = "rocket" + description = "Fast single header signal/slots library for C++" + license = "DocumentRef-README.md:LicenseRef-Rocket-public-domain" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tripleslash/rocket" + topics = ("signal-slots", "observer-pattern", "header-only") + package_type = "header-library" + settings = "os", "compiler", "build_type", "arch" + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + def export_sources(self): + export_conandata_patches(self) + + 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 package_id(self): + self.info.clear() + + def build(self): + apply_conandata_patches(self) + + def _extract_license(self): + readme_content = load(self, os.path.join(self.source_folder, "README.md")) + first = readme_content.find("# rocket") + last = readme_content.find("signals2).") + license_content = readme_content[first:last+len("signals2).")] + # Make sure the extracted text from README has the license type + assert license_content.find("public-domain") != -1 + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_content) + + def package(self): + self._extract_license() + copy(self, "rocket.hpp", self.build_folder, os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + diff --git a/recipes/rocket/all/patches/0001-fix-thread_id.patch b/recipes/rocket/all/patches/0001-fix-thread_id.patch new file mode 100644 index 0000000000000..793c870ed12dc --- /dev/null +++ b/recipes/rocket/all/patches/0001-fix-thread_id.patch @@ -0,0 +1,16 @@ +diff --git a/rocket.hpp b/rocket.hpp +index 8c4e539..47d650a 100644 +--- a/rocket.hpp ++++ b/rocket.hpp +@@ -2082,8 +2082,8 @@ namespace rocket + + bool is_queued() const ROCKET_NOEXCEPT + { +- return thread_id != std::thread::id{} +- && thread_id != std::this_thread::get_id(); ++ return !(thread_id == std::thread::id{}) ++ && !(thread_id == std::this_thread::get_id()); + } + + #ifndef ROCKET_NO_BLOCKING_CONNECTIONS + diff --git a/recipes/rocket/all/test_package/CMakeLists.txt b/recipes/rocket/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6555535f21daa --- /dev/null +++ b/recipes/rocket/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(rocket REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rocket::rocket) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/rocket/all/test_package/conanfile.py b/recipes/rocket/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b4c8de77c89d8 --- /dev/null +++ b/recipes/rocket/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 RocketTestConan(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/rocket/all/test_package/test_package.cpp b/recipes/rocket/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..33702a87e060d --- /dev/null +++ b/recipes/rocket/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include +#include + +int main() +{ + rocket::signal test; + test.connect([](int x) + { return x * 3; }); + + constexpr int value = 2; + + const auto result{test(value) == value * 3}; + std::cout << "Rocket test success: " << std::boolalpha << result << '\n'; + return result? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/recipes/rocket/config.yml b/recipes/rocket/config.yml new file mode 100644 index 0000000000000..0496cb4bde798 --- /dev/null +++ b/recipes/rocket/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200603": + folder: "all" diff --git a/recipes/rocksdb/all/conandata.yml b/recipes/rocksdb/all/conandata.yml index af19cfe0abbd7..9698da05e2b54 100644 --- a/recipes/rocksdb/all/conandata.yml +++ b/recipes/rocksdb/all/conandata.yml @@ -1,16 +1,55 @@ sources: + "10.0.1": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v10.0.1.tar.gz" + sha256: "3fdc9ca996971c4c039959866382c4a3a6c8ade4abf888f3b2ff77153e07bf28" + "9.10.0": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.10.0.tar.gz" + sha256: "FDCCAB16133C9D927A183C2648BCEA8D956FB41EB1DF2AACAA73EB0B95E43724" + "9.7.4": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.7.4.tar.gz" + sha256: "9b810c81731835fda0d4bbdb51d3199d901fa4395733ab63752d297da84c5a47" + "9.5.2": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.5.2.tar.gz" + sha256: "B20780586D3DF4A3C5BCBDE341A2C1946B03D18237960BDA5BC5E9538F42AF40" + "9.4.0": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v9.4.0.tar.gz" + sha256: "1f829976aa24b8ba432e156f52c9e0f0bd89c46dc0cc5a9a628ea70571c1551c" + "8.8.1": + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v8.8.1.tar.gz" + sha256: "056c7e21ad8ae36b026ac3b94b9d6e0fcc60e1d937fc80330921e4181be5c36e" "6.29.5": 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/refs/tags/v6.27.3.tar.gz" - sha256: "ee29901749b9132692b26f0a6c1d693f47d1a9ed8e3771e60556afe80282bf58" - "6.20.3": - url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.20.3.tar.gz" - sha256: "c6502c7aae641b7e20fafa6c2b92273d935d2b7b2707135ebd9a67b092169dca" patches: + "10.0.1": + - patch_file: "patches/9.x.x-0001-exclude-thirdparty.patch" + patch_description: "Do not include thirdparty.inc" + patch_type: "portability" + "9.10.0": + - patch_file: "patches/9.x.x-0001-exclude-thirdparty.patch" + patch_description: "Do not include thirdparty.inc" + patch_type: "portability" + "9.7.4": + - patch_file: "patches/9.x.x-0001-exclude-thirdparty.patch" + patch_description: "Do not include thirdparty.inc" + patch_type: "portability" + "9.5.2": + - patch_file: "patches/9.x.x-0001-exclude-thirdparty.patch" + patch_description: "Do not include thirdparty.inc" + patch_type: "portability" + "9.4.0": + - patch_file: "patches/9.x.x-0001-exclude-thirdparty.patch" + patch_description: "Do not include thirdparty.inc" + patch_type: "portability" + "8.8.1": + - patch_file: "patches/8.8.1-0001-exclude-thirdparty.patch" + patch_description: "Do not include thirdparty.inc" + patch_type: "portability" "6.29.5": - 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" + - patch_file: "patches/6.29.5-0002-exclude-thirdparty.patch" + patch_description: "Do not include thirdparty.inc" + patch_type: "portability" diff --git a/recipes/rocksdb/all/conanfile.py b/recipes/rocksdb/all/conanfile.py index 5962da8487f2b..36406c6b10c4d 100644 --- a/recipes/rocksdb/all/conanfile.py +++ b/recipes/rocksdb/all/conanfile.py @@ -1,5 +1,5 @@ -import os import glob +import os import shutil from conan import ConanFile @@ -7,18 +7,18 @@ 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.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class RocksDBConan(ConanFile): name = "rocksdb" - homepage = "https://github.com/facebook/rocksdb" + description = "A library that provides an embeddable, persistent key-value store for fast storage" 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" + homepage = "https://github.com/facebook/rocksdb" topics = ("database", "leveldb", "facebook", "key-value") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -51,6 +51,10 @@ class RocksDBConan(ConanFile): "use_rtti": False, } + @property + def _min_cppstd(self): + return "11" if Version(self.version) < "8.8.1" else "17" + def export_sources(self): export_conandata_patches(self) @@ -86,19 +90,13 @@ def requirements(self): self.requires("jemalloc/5.3.0") 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.arch not in ["x86_64", "ppc64le", "ppc64", "mips64", "armv8"]: raise ConanInvalidConfiguration("Rocksdb requires 64 bits") - check_min_vs(self, "191") - - if self.version == "6.20.3" and \ - self.settings.os == "Linux" and \ - self.settings.compiler == "gcc" and \ - 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 + if is_msvc(self) and Version(self.settings.compiler.version) < "191": + raise ConanInvalidConfiguration("Rocksdb requires MSVC version >= 191") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -143,6 +141,8 @@ def generate(self): if self.options.with_jemalloc: deps.set_property("jemalloc", "cmake_file_name", "JeMalloc") deps.set_property("jemalloc", "cmake_target_name", "JeMalloc::JeMalloc") + if self.options.with_zstd: + deps.set_property("zstd", "cmake_target_name", "zstd::zstd") deps.generate() def build(self): @@ -174,6 +174,7 @@ def package(self): self._remove_static_libraries() self._remove_cpp_headers() # Force stable ABI for shared libraries 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" @@ -190,11 +191,6 @@ def package_info(self): if self.options.lite: self.cpp_info.components["librocksdb"].defines.append("ROCKSDB_LITE") - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "RocksDB" - 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", f"RocksDB::{cmake_target}") if self.options.with_gflags: self.cpp_info.components["librocksdb"].requires.append("gflags::gflags") diff --git a/recipes/rocksdb/all/patches/6.29.5-0002-exclude-thirdparty.patch b/recipes/rocksdb/all/patches/6.29.5-0002-exclude-thirdparty.patch new file mode 100644 index 0000000000000..fb0dd0c46b4f2 --- /dev/null +++ b/recipes/rocksdb/all/patches/6.29.5-0002-exclude-thirdparty.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ec59d4491..35577c998 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -101 +100,0 @@ if(MSVC) +- option(WITH_GFLAGS "build with GFlags" OFF) +@@ -103,2 +102,2 @@ if(MSVC) +- include(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty.inc) +-else() ++endif() ++ +@@ -117 +116 @@ else() +- if(MINGW) ++ if(MINGW OR MSVC) +@@ -183 +181,0 @@ else() +-endif() diff --git a/recipes/rocksdb/all/patches/8.8.1-0001-exclude-thirdparty.patch b/recipes/rocksdb/all/patches/8.8.1-0001-exclude-thirdparty.patch new file mode 100644 index 0000000000000..c059220524e41 --- /dev/null +++ b/recipes/rocksdb/all/patches/8.8.1-0001-exclude-thirdparty.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b475a22..1d846dc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -88,14 +88,9 @@ endif() + include(CMakeDependentOption) + + if(MSVC) +- option(WITH_GFLAGS "build with GFlags" OFF) + option(WITH_XPRESS "build with windows built in compression" OFF) +- option(ROCKSDB_SKIP_THIRDPARTY "skip thirdparty.inc" OFF) +- +- if(NOT ROCKSDB_SKIP_THIRDPARTY) +- include(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty.inc) +- endif() +-else() ++endif() ++if(TRUE) + if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" AND NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD") + # FreeBSD has jemalloc as default malloc + # but it does not have all the jemalloc files in include/... +@@ -108,7 +103,7 @@ else() + endif() + endif() + +- if(MINGW) ++ if(MSVC OR MINGW) + option(WITH_GFLAGS "build with GFlags" OFF) + else() + option(WITH_GFLAGS "build with GFlags" ON) diff --git a/recipes/rocksdb/all/patches/9.x.x-0001-exclude-thirdparty.patch b/recipes/rocksdb/all/patches/9.x.x-0001-exclude-thirdparty.patch new file mode 100644 index 0000000000000..69aca45670016 --- /dev/null +++ b/recipes/rocksdb/all/patches/9.x.x-0001-exclude-thirdparty.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 93b884d..b715cb6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -106,14 +106,9 @@ endif() + include(CMakeDependentOption) + + if(MSVC) +- option(WITH_GFLAGS "build with GFlags" OFF) + option(WITH_XPRESS "build with windows built in compression" OFF) +- option(ROCKSDB_SKIP_THIRDPARTY "skip thirdparty.inc" OFF) +- +- if(NOT ROCKSDB_SKIP_THIRDPARTY) +- include(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty.inc) +- endif() +-else() ++endif() ++if(TRUE) + if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" AND NOT CMAKE_SYSTEM_NAME MATCHES "kFreeBSD") + # FreeBSD has jemalloc as default malloc + # but it does not have all the jemalloc files in include/... +@@ -126,7 +121,7 @@ else() + endif() + endif() + +- if(MINGW) ++ if(MSVC OR MINGW) + option(WITH_GFLAGS "build with GFlags" OFF) + else() + option(WITH_GFLAGS "build with GFlags" ON) diff --git a/recipes/rocksdb/all/test_package/CMakeLists.txt b/recipes/rocksdb/all/test_package/CMakeLists.txt index 81aa571c924fc..19f3d1344cf03 100644 --- a/recipes/rocksdb/all/test_package/CMakeLists.txt +++ b/recipes/rocksdb/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) enable_testing() @@ -14,6 +14,10 @@ else() add_executable(${PROJECT_NAME}_cpp test_package.cpp) target_link_libraries(${PROJECT_NAME}_cpp PRIVATE RocksDB::rocksdb) - target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11) + 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_v1_package/CMakeLists.txt b/recipes/rocksdb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c23ed5cfe6d98..0000000000000 --- a/recipes/rocksdb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 5fc2cee9c5517..0000000000000 --- a/recipes/rocksdb/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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 c4e32f27c353e..e83f7ffcd4ab5 100644 --- a/recipes/rocksdb/config.yml +++ b/recipes/rocksdb/config.yml @@ -1,7 +1,15 @@ versions: - "6.29.5": + "10.0.1": + folder: all + "9.10.0": + folder: all + "9.7.4": folder: all - "6.27.3": + "9.5.2": folder: all - "6.20.3": + "9.4.0": + folder: all + "8.8.1": + folder: all + "6.29.5": folder: all diff --git a/recipes/rotor/all/conandata.yml b/recipes/rotor/all/conandata.yml index b1d2937ec9c70..0e9e7bae5aa0c 100644 --- a/recipes/rotor/all/conandata.yml +++ b/recipes/rotor/all/conandata.yml @@ -1,13 +1,19 @@ sources: - "0.21": - url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.21.tar.gz" - sha256: "1a5bc1919fe1052c8ad148707708b19fad903ff3db33015710cfb4f89baab8fa" - "0.23": - url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.23.tar.gz" - sha256: "8f89f9d0a561ab7cc90253cc761d8b5a78887c99ef488e75ae4c49abb44ddac4" - "0.24": - url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.24.tar.gz" - sha256: "3a360d6ce7c743b740b9c6c4063493f67298690fc51e29efa19811bb3d11fa86" - "0.25": - url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.25.tar.gz" - sha256: "b1de95937adb8d7a9beb93bc4956d8e28ff64a6c0a898e7ce12b22a224bb8f6f" + "0.34": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.34.tar.gz" + sha256: "8c59a36b3b2917c91650fb91e57f8e116e0dd7f88b70d95e2e92bde4f9395202" + "0.33": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.33.tar.gz" + sha256: "0a57af1018e2ca89c9cd95ae134c4b2af2c8e803c81ebee5433495776830eea6" + "0.32": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.32.tar.gz" + sha256: "b0b7a294704f1ab779b95ab433eb5f4a2859db3539108a0e08709fc97f6bccee" + "0.31": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.31.tar.gz" + sha256: "c8d9b28083c7a9c32af2cbff1d90fe1e62def989f0f89baba1244c44fb8ec9e4" + "0.30": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.30.tar.gz" + sha256: "d143bfce1d18d42ab0f072acfe239d1cc07a495411537579e02260673cbe8121" + "0.29": + url: "https://github.com/basiliscos/cpp-rotor/archive/refs/tags/v0.29.tar.gz" + sha256: "e17e25f2d6402389e8fde07a158ca952b815666f0a2b5e07748dfc062834c522" diff --git a/recipes/rotor/all/conanfile.py b/recipes/rotor/all/conanfile.py index 373e87fb89eb0..83bff318d85d5 100644 --- a/recipes/rotor/all/conanfile.py +++ b/recipes/rotor/all/conanfile.py @@ -1,23 +1,20 @@ import os from conan import ConanFile -from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.scm import Version from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir, copy from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.54.0" class RotorConan(ConanFile): name = "rotor" + description = "Event loop friendly C++ actor micro-framework, supervisable" license = "MIT" homepage = "https://github.com/basiliscos/cpp-rotor" url = "https://github.com/conan-io/conan-center-index" - description = ( - "Event loop friendly C++ actor micro-framework, supervisable" - ) topics = ("concurrency", "actor-framework", "actors", "actor-model", "erlang", "supervising", "supervisor") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], @@ -25,6 +22,8 @@ class RotorConan(ConanFile): "enable_asio": [True, False], "enable_thread": [True, False], "multithreading": [True, False], # enables multithreading support + "enable_ev": [True, False], + "enable_fltk": [True, False], } default_options = { "fPIC": True, @@ -32,6 +31,8 @@ class RotorConan(ConanFile): "enable_asio": False, "enable_thread": False, "multithreading": True, + "enable_ev": False, + "enable_fltk": False, } def export_sources(self): @@ -40,55 +41,39 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "0.30": + del self.options.enable_fltk def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def requirements(self): - self.requires("boost/1.81.0") + self.requires("boost/1.84.0", transitive_headers=True) + if self.options.get_safe("enable_ev", False): + self.requires("libev/4.33") + if self.options.get_safe("enable_fltk", False): + self.requires("fltk/1.3.9") def layout(self): cmake_layout(self, src_folder="src") def generate(self): + v = Version(self.version) tc = CMakeToolchain(self) - tc.variables["BUILD_BOOST_ASIO"] = self.options.enable_asio - tc.variables["BUILD_THREAD"] = self.options.enable_thread - tc.variables["BUILD_THREAD_UNSAFE"] = not self.options.multithreading - tc.variables["BUILD_TESTING"] = False + tc.cache_variables["BUILD_BOOST_ASIO" if v < "0.34" else "ROTOR_BUILD_ASIO"] = self.options.enable_asio + tc.cache_variables["BUILD_THREAD" if v < "0.34" else "ROTOR_BUILD_THREAD"] = self.options.enable_thread + tc.cache_variables["BUILD_THREAD_UNSAFE" if v < "0.34" else "ROTOR_BUILD_THREAD_UNSAFE"] = not self.options.multithreading + tc.cache_variables["BUILD_TESTING" if v < "0.34" else "ROTOR_BUILD_TESTS"] = False + tc.cache_variables["BUILD_EV" if v < "0.34" else "ROTOR_BUILD_EV"] = self.options.enable_ev + if v >= "0.30": + tc.cache_variables["BUILD_FLTK" if v < "0.34" else "ROTOR_BUILD_FLTK"] = self.options.enable_fltk tc.generate() tc = CMakeDeps(self) tc.generate() def validate(self): - minimal_cpp_standard = "17" - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, minimal_cpp_standard) - minimal_version = { - "gcc": "7", - "clang": "6", - "apple-clang": "10", - "Visual Studio": "15" - } - compiler = str(self.settings.compiler) - if compiler not in minimal_version: - self.output.warn( - f"{self.ref} recipe lacks information about the {compiler} compiler standard version support") - self.output.warn( - f"{self.ref} requires a compiler that supports at least C++{minimal_cpp_standard}") - return - - compiler_version = Version(self.settings.compiler.version) - if compiler_version < minimal_version[compiler]: - raise ConanInvalidConfiguration(f"{self.ref} requires a compiler that supports at least C++{minimal_cpp_standard}") - - if self.options.shared and Version(self.version) < "0.23": - raise ConanInvalidConfiguration("shared option is available from v0.23") - + check_min_cppstd(self, 17) def build(self): apply_conandata_patches(self) @@ -111,15 +96,26 @@ def package_info(self): self.cpp_info.components["core"].requires = ["boost::date_time", "boost::system", "boost::regex"] if not self.options.multithreading: - self.cpp_info.components["core"].defines.append("BUILD_THREAD_UNSAFE") + v = Version(self.version) + self.cpp_info.components["core"].defines.append("BUILD_THREAD_UNSAFE" if v < "0.34" else "ROTOR_BUILD_THREAD_UNSAFE") if self.options.enable_asio: self.cpp_info.components["asio"].libs = ["rotor_asio"] self.cpp_info.components["asio"].requires = ["core"] + if self.settings.os == "Windows": + self.cpp_info.components["asio"].system_libs = ["ws2_32"] if self.options.enable_thread: self.cpp_info.components["thread"].libs = ["rotor_thread"] self.cpp_info.components["thread"].requires = ["core"] - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "rotor" + if self.options.get_safe("enable_ev", False): + self.cpp_info.components["ev"].libs = ["rotor_ev"] + self.cpp_info.components["ev"].requires = ["core", "libev::libev"] + + if self.options.get_safe("enable_fltk", False): + self.cpp_info.components["fltk"].libs = ["rotor_fltk"] + self.cpp_info.components["fltk"].requires = ["core", "fltk::fltk"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["core"].system_libs.append("m") diff --git a/recipes/rotor/all/test_package/CMakeLists.txt b/recipes/rotor/all/test_package/CMakeLists.txt index b48e565513a1d..027b2945e0aad 100644 --- a/recipes/rotor/all/test_package/CMakeLists.txt +++ b/recipes/rotor/all/test_package/CMakeLists.txt @@ -1,12 +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(TARGETS) -find_package("rotor" REQUIRED) +find_package("rotor" COMPONENTS asio thread REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) target_link_libraries(${PROJECT_NAME} rotor::core) - - diff --git a/recipes/rotor/all/test_package/conanfile.py b/recipes/rotor/all/test_package/conanfile.py index 6dfcc57d996c4..a9fb96656f203 100644 --- a/recipes/rotor/all/test_package/conanfile.py +++ b/recipes/rotor/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,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.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/rotor/config.yml b/recipes/rotor/config.yml index 1dfb74272e8cc..b3d647dd915c5 100644 --- a/recipes/rotor/config.yml +++ b/recipes/rotor/config.yml @@ -1,9 +1,13 @@ versions: - "0.21": + "0.34": folder: all - "0.23": + "0.33": folder: all - "0.24": + "0.32": folder: all - "0.25": + "0.31": + folder: all + "0.30": + folder: all + "0.29": folder: all diff --git a/recipes/rpclib/all/test_package/CMakeLists.txt b/recipes/rpclib/all/test_package/CMakeLists.txt index 6ea9e950e13d6..0c57303ffca4d 100644 --- a/recipes/rpclib/all/test_package/CMakeLists.txt +++ b/recipes/rpclib/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(rpclib REQUIRED CONFIG) diff --git a/recipes/rpclib/all/test_v1_package/CMakeLists.txt b/recipes/rpclib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/rpclib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index d2f62e670fcd2..0000000000000 --- a/recipes/rpclib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,15 +0,0 @@ -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/rply/all/CMakeLists.txt b/recipes/rply/all/CMakeLists.txt index b354602f83650..b80895b45a40d 100644 --- a/recipes/rply/all/CMakeLists.txt +++ b/recipes/rply/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(rply LANGUAGES C) add_library(rply ${RPLY_SRC_DIR}/rply.c) diff --git a/recipes/rply/all/test_package/CMakeLists.txt b/recipes/rply/all/test_package/CMakeLists.txt index 5de7de58218bf..ddd0ddfc53344 100644 --- a/recipes/rply/all/test_package/CMakeLists.txt +++ b/recipes/rply/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(rply REQUIRED CONFIG) diff --git a/recipes/rply/all/test_v1_package/CMakeLists.txt b/recipes/rply/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/rply/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/rply/all/test_v1_package/conanfile.py b/recipes/rply/all/test_v1_package/conanfile.py deleted file mode 100644 index 8c7d6ccfd145d..0000000000000 --- a/recipes/rply/all/test_v1_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 = os.path.join("bin", "test_package") - ply_file = os.path.join(self.source_folder, os.pardir, "test_package", "triangle.ply") - self.run(f"{bin_path} {ply_file}", run_environment=True) diff --git a/recipes/rtm/all/conandata.yml b/recipes/rtm/all/conandata.yml index 41cc19013d6fa..e9ca9adc1569f 100644 --- a/recipes/rtm/all/conandata.yml +++ b/recipes/rtm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.0": + url: "https://github.com/nfrechette/rtm/archive/v2.3.0.tar.gz" + sha256: "2b5f2c3761bb52ae89802a574e9dc9949aec3b183f7e100b9b66a65adcc6f5ab" "2.2.1": url: "https://github.com/nfrechette/rtm/archive/v2.2.1.tar.gz" sha256: "678989368bc9859138db00719ad9e2f82b51acb0d8da6905426e4134223cee2a" diff --git a/recipes/rtm/all/test_v1_package/CMakeLists.txt b/recipes/rtm/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/rtm/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index abcaeed3f89b6..0000000000000 --- a/recipes/rtm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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 3a396aa92fa44..92f533de05d77 100644 --- a/recipes/rtm/config.yml +++ b/recipes/rtm/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.0": + folder: "all" "2.2.1": folder: "all" "2.2.0": diff --git a/recipes/rtmidi/all/conandata.yml b/recipes/rtmidi/all/conandata.yml index 7f688e03dcce4..ad84f3a29f6e6 100644 --- a/recipes/rtmidi/all/conandata.yml +++ b/recipes/rtmidi/all/conandata.yml @@ -1,12 +1,18 @@ sources: "6.0.0": - url: "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-6.0.0.tar.gz" + url: + - "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-6.0.0.tar.gz" + - "http://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" + url: + - "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz" + - "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-5.0.0.tar.gz" sha256: "48db0ed58c8c0e207b5d7327a0210b5bcaeb50e26387935d02829239b0f3c2b9" "4.0.0": - url: "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz" + url: + - "https://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz" + - "http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz" sha256: "370cfe710f43fbeba8d2b8c8bc310f314338c519c2cf2865e2d2737b251526cd" patches: "4.0.0": diff --git a/recipes/rtmidi/all/test_package/CMakeLists.txt b/recipes/rtmidi/all/test_package/CMakeLists.txt index 6e185f98e410d..7956adc2f1f77 100644 --- a/recipes/rtmidi/all/test_package/CMakeLists.txt +++ b/recipes/rtmidi/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) diff --git a/recipes/rtmidi/all/test_v1_package/CMakeLists.txt b/recipes/rtmidi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/rtmidi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/rtmidi/all/test_v1_package/conanfile.py b/recipes/rtmidi/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/rtmidi/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/rttr/all/test_package/CMakeLists.txt b/recipes/rttr/all/test_package/CMakeLists.txt index ba71afe013a96..3e39446ce8cbd 100644 --- a/recipes/rttr/all/test_package/CMakeLists.txt +++ b/recipes/rttr/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(rttr REQUIRED CONFIG) diff --git a/recipes/rttr/all/test_v1_package/CMakeLists.txt b/recipes/rttr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/rttr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/rttr/all/test_v1_package/conanfile.py b/recipes/rttr/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/rttr/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_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/ruby/all/test_package/CMakeLists.txt b/recipes/ruby/all/test_package/CMakeLists.txt index 361d2a449e95c..315082a538aea 100644 --- a/recipes/ruby/all/test_package/CMakeLists.txt +++ b/recipes/ruby/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(Ruby REQUIRED) diff --git a/recipes/runtimeqml/all/conanfile.py b/recipes/runtimeqml/all/conanfile.py index 8ed18efdf54c9..cae0fb3d308bb 100644 --- a/recipes/runtimeqml/all/conanfile.py +++ b/recipes/runtimeqml/all/conanfile.py @@ -41,8 +41,7 @@ def _compilers_minimum_version(self): } def export_sources(self): - copy(self, "CMakeLists.txt", self.recipe_folder, - self.export_sources_folder) + 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": @@ -50,19 +49,16 @@ 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) + cmake_layout(self, src_folder="src") def requirements(self): if Version(self.version) <= "cci.20211220": - self.requires("qt/5.15.5") + self.requires("qt/5.15.13") else: - self.requires("qt/6.3.1") + self.requires("qt/6.6.2") def validate(self): if self.info.settings.compiler.cppstd: @@ -81,8 +77,7 @@ def validate(self): f"{self.ref} requires option qt:qtdeclarative=True") 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) diff --git a/recipes/runtimeqml/all/test_package/CMakeLists.txt b/recipes/runtimeqml/all/test_package/CMakeLists.txt index 0abdc1edf18c8..fe51d49e0f798 100644 --- a/recipes/runtimeqml/all/test_package/CMakeLists.txt +++ b/recipes/runtimeqml/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(runtimeqml REQUIRED CONFIG) diff --git a/recipes/runtimeqml/all/test_v1_package/CMakeLists.txt b/recipes/runtimeqml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/runtimeqml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/runtimeqml/all/test_v1_package/conanfile.py b/recipes/runtimeqml/all/test_v1_package/conanfile.py deleted file mode 100644 index f44ea85fbe3eb..0000000000000 --- a/recipes/runtimeqml/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conan import ConanFile -from conan.tools.build import cross_building -from conan.tools.cmake import CMake -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 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/rusty-cpp/all/conandata.yml b/recipes/rusty-cpp/all/conandata.yml new file mode 100644 index 0000000000000..fef66d0431a97 --- /dev/null +++ b/recipes/rusty-cpp/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "0.1.12": + url: + - "https://github.com/seekstar/rusty-cpp/archive/refs/tags/v0.1.12.tar.gz" + sha256: "18397dfb9aaea6eef9217f749fe4d1ad55715c519fa0df3173eabfd8d418160f" diff --git a/recipes/rusty-cpp/all/conanfile.py b/recipes/rusty-cpp/all/conanfile.py new file mode 100644 index 0000000000000..72c8fcdb590e3 --- /dev/null +++ b/recipes/rusty-cpp/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +import os + + +required_conan_version = ">=2.0" + + +class RustyCppConan(ConanFile): + name = "rusty-cpp" + description = "Write C++ code like Rust!" + license = "Apache-2.0", "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/seekstar/rusty-cpp" + topics = ("C++", "Rust", "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 validate(self): + check_min_cppstd(self, 17) + + 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): + copy(self, "LICENSE-APACHE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE-MIT", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_target_name", "rusty-cpp") + self.cpp_info.libdirs = [] + self.cpp_info.bindirs = [] diff --git a/recipes/rusty-cpp/all/test_package/CMakeLists.txt b/recipes/rusty-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0f9e9c368c1e3 --- /dev/null +++ b/recipes/rusty-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(rusty-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE rusty-cpp) diff --git a/recipes/rusty-cpp/all/test_package/conanfile.py b/recipes/rusty-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2e77b4246fa81 --- /dev/null +++ b/recipes/rusty-cpp/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" + + 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/rusty-cpp/all/test_package/test_package.cpp b/recipes/rusty-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..22d41c65d059d --- /dev/null +++ b/recipes/rusty-cpp/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include + +int main(void) { + rusty_assert(1); + rusty_assert_eq(rusty::next_power_of_two((size_t)42), 64, + "Math doesn't exist anymore"); + rusty_assert_eq(rusty::next_power_of_two((size_t)233), 256); + printf("All tests passed.\n"); + + return EXIT_SUCCESS; +} diff --git a/recipes/rusty-cpp/config.yml b/recipes/rusty-cpp/config.yml new file mode 100644 index 0000000000000..eeb539913a115 --- /dev/null +++ b/recipes/rusty-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.12": + folder: all diff --git a/recipes/ruy/all/conandata.yml b/recipes/ruy/all/conandata.yml index c9acc9f74ac8c..d072c208fb5e1 100644 --- a/recipes/ruy/all/conandata.yml +++ b/recipes/ruy/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231129": + url: "https://github.com/google/ruy/archive/690c14c441387a4ea6e07a9ed89657cec8200b92.tar.gz" + sha256: "98077cf3c38f0d8c5156953c4044a6104108f247fab021477d1cff1012eb82f3" "cci.20220628": url: "https://github.com/google/ruy/archive/841ea4172ba904fe3536789497f9565f2ef64129.tar.gz" sha256: "fbd20e6c8cd5cf8ef159f69600ea0c7ef0f1401a4c16a9cd04e5a12ffa9c6e14" diff --git a/recipes/ruy/all/conanfile.py b/recipes/ruy/all/conanfile.py index c508de954594d..5ff76e6c68a9c 100644 --- a/recipes/ruy/all/conanfile.py +++ b/recipes/ruy/all/conanfile.py @@ -31,7 +31,7 @@ class RuyConan(ConanFile): def _minimum_compilers_version(self): return { "Visual Studio": "15", - "msvc": "191", + "msvc": "191", "gcc": "5", "clang": "3.4", "apple-clang": "5.1", @@ -60,7 +60,7 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - self.requires("cpuinfo/cci.20220228") + self.requires("cpuinfo/cci.20231129") def layout(self): cmake_layout(self, src_folder="src") @@ -85,8 +85,8 @@ def _patch_sources(self): patches = { #Remove the invocation after project(), see https://github.com/google/ruy/issues/328 "cmake_minimum_required(VERSION 3.13)": "", - # Ensure `cmake_minimum_required` is called first - "# Copyright 2021 Google LLC": "# Copyright 2021 Google LLC\ncmake_minimum_required(VERSION 3.13)", + # Ensure `cmake_minimum_required` is called first + "# Copyright 2021 Google LLC": "# Copyright 2021 Google LLC\ncmake_minimum_required(VERSION 3.13)", } for pattern, patch in patches.items(): diff --git a/recipes/ruy/all/test_v1_package/CMakeLists.txt b/recipes/ruy/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index ad23fc4ce0674..0000000000000 --- a/recipes/ruy/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(ruy REQUIRED) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ruy::ruy) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/ruy/all/test_v1_package/conanfile.py b/recipes/ruy/all/test_v1_package/conanfile.py deleted file mode 100644 index cb4e2b3389e8f..0000000000000 --- a/recipes/ruy/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -import os -from conans import ConanFile, CMake, tools - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - 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/ruy/all/test_v1_package/test_package.cpp b/recipes/ruy/all/test_v1_package/test_package.cpp deleted file mode 100644 index 9e1b8a13b5564..0000000000000 --- a/recipes/ruy/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include - -#include "ruy/ruy.h" - -int main() { - - ruy::Context context; - const float lhs_data[] = {1, 2, 3, 4}; - const float rhs_data[] = {1, 2, 3, 4}; - float dst_data[4]; - - ruy::Matrix lhs; - ruy::MakeSimpleLayout(2, 2, ruy::Order::kRowMajor, lhs.mutable_layout()); - lhs.set_data(lhs_data); - ruy::Matrix rhs; - ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, rhs.mutable_layout()); - rhs.set_data(rhs_data); - ruy::Matrix dst; - ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, dst.mutable_layout()); - dst.set_data(dst_data); - - ruy::MulParams mul_params; - ruy::Mul(lhs, rhs, mul_params, &context, &dst); - - std::cout << "ruy's test_package ran successfully \n"; -} diff --git a/recipes/ruy/config.yml b/recipes/ruy/config.yml index f2da5345e749b..1535fe201a121 100644 --- a/recipes/ruy/config.yml +++ b/recipes/ruy/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20231129": + folder: all "cci.20220628": folder: all diff --git a/recipes/rvo2/all/test_v1_package/CMakeLists.txt b/recipes/rvo2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/rvo2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/rvo2/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", "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/rxcpp/all/conanfile.py b/recipes/rxcpp/all/conanfile.py index d05961ecfc442..61160297e88db 100644 --- a/recipes/rxcpp/all/conanfile.py +++ b/recipes/rxcpp/all/conanfile.py @@ -1,9 +1,11 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration 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" +required_conan_version = ">=2.1" class RxcppConan(ConanFile): @@ -14,6 +16,7 @@ class RxcppConan(ConanFile): homepage = "https://github.com/ReactiveX/RxCpp" url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch", "compiler", "build_type" + package_type = "header-library" no_copy_source = True def package_id(self): @@ -21,6 +24,11 @@ def package_id(self): def layout(self): basic_layout(self, src_folder="src") + + def validate_build(self): + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) >= "14": + raise ConanInvalidConfiguration("This package can't be built for gcc >= 14. " + "You can compile it with a lower version and consume it later with your compiler.") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/rxcpp/all/test_package/CMakeLists.txt b/recipes/rxcpp/all/test_package/CMakeLists.txt index 32a71bb8a4f6d..ef0fffebf7800 100644 --- a/recipes/rxcpp/all/test_package/CMakeLists.txt +++ b/recipes/rxcpp/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(rxcpp REQUIRED CONFIG) diff --git a/recipes/rxcpp/all/test_v1_package/CMakeLists.txt b/recipes/rxcpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f776bf6153687..0000000000000 --- a/recipes/rxcpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(rxcpp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE rxcpp::rxcpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/rxcpp/all/test_v1_package/conanfile.py b/recipes/rxcpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/rxcpp/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_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/s2geometry/all/conandata.yml b/recipes/s2geometry/all/conandata.yml index 2320f21a27e4c..5cd6ac69f48bf 100644 --- a/recipes/s2geometry/all/conandata.yml +++ b/recipes/s2geometry/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.11.1": + url: "https://github.com/google/s2geometry/archive/refs/tags/v0.11.1.tar.gz" + sha256: "bdbeb8ebdb88fa934257caf81bb44b55711617a3ab4fdec2c3cfd6cc31b61734" "0.10.0": url: "https://github.com/google/s2geometry/archive/refs/tags/v0.10.0.tar.gz" sha256: "1c17b04f1ea20ed09a67a83151ddd5d8529716f509dde49a8190618d70532a3d" diff --git a/recipes/s2geometry/all/conanfile.py b/recipes/s2geometry/all/conanfile.py index 31e07fd7e0dc3..fd54c4b79443f 100644 --- a/recipes/s2geometry/all/conanfile.py +++ b/recipes/s2geometry/all/conanfile.py @@ -4,7 +4,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, copy, export_conandata_patches, apply_conandata_patches +from conan.tools.files import get, copy, rmdir, export_conandata_patches, apply_conandata_patches from conan.tools.microsoft import is_msvc from conan.tools.scm import Version @@ -36,7 +36,7 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "gcc": "5", + "gcc": "6", "clang": "7", "apple-clang": "10", "Visual Studio": "15", @@ -58,7 +58,7 @@ 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("abseil/20230802.1", transitive_headers=True, transitive_libs=True) self.requires("openssl/[>=1.1 <4]", transitive_headers=True) def validate(self): @@ -81,6 +81,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["GOOGLETEST_ROOT"] = False tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TESTS"] = False tc.generate() tc = CMakeDeps(self) tc.generate() @@ -95,6 +96,9 @@ 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")) def package_info(self): self.cpp_info.libs = ["s2"] + self.cpp_info.set_property("cmake_file_name", "s2") + self.cpp_info.set_property("cmake_target_name", "s2::s2") diff --git a/recipes/s2geometry/all/test_package/CMakeLists.txt b/recipes/s2geometry/all/test_package/CMakeLists.txt index cc8c0e2143602..629a8c3aedf01 100644 --- a/recipes/s2geometry/all/test_package/CMakeLists.txt +++ b/recipes/s2geometry/all/test_package/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -find_package(s2geometry REQUIRED CONFIG) +find_package(s2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE s2geometry::s2geometry) +target_link_libraries(${PROJECT_NAME} PRIVATE s2::s2) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) if(MSVC) # Use unsigned characters diff --git a/recipes/s2geometry/config.yml b/recipes/s2geometry/config.yml index 1b582dcf6716b..3a159672513b1 100644 --- a/recipes/s2geometry/config.yml +++ b/recipes/s2geometry/config.yml @@ -1,3 +1,5 @@ versions: + "0.11.1": + folder: all "0.10.0": folder: all diff --git a/recipes/s2let/all/CMakeLists.txt b/recipes/s2let/all/CMakeLists.txt deleted file mode 100644 index 0496b29838549..0000000000000 --- a/recipes/s2let/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/s2let/all/conandata.yml b/recipes/s2let/all/conandata.yml index 93e1e80ecc199..9a04386d3631c 100644 --- a/recipes/s2let/all/conandata.yml +++ b/recipes/s2let/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.6": + url: "https://github.com/astro-informatics/s2let/archive/v2.2.6.tar.gz" + sha256: "0ce214e110305fdd3729875add515ca00c23dde3329af43d1fff763514607381" "2.2.3": url: "https://github.com/astro-informatics/s2let/archive/refs/tags/v2.2.3.tar.gz" sha256: "1321e1bc96ba200e4cd4056843cd4075de1c05be20e64185f065f48b9cefe3f8" diff --git a/recipes/s2let/all/conanfile.py b/recipes/s2let/all/conanfile.py index 1fc2aa8dc0cd5..a68602d8d89c3 100644 --- a/recipes/s2let/all/conanfile.py +++ b/recipes/s2let/all/conanfile.py @@ -1,17 +1,24 @@ -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, rm +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class S2let(ConanFile): name = "s2let" + description = "Fast wavelets on the sphere" license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/astro-informatics/s2let" - description = "Fast wavelets on the sphere" - settings = "os", "arch", "compiler", "build_type" topics = ("physics", "astrophysics", "radio interferometry") + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], "with_cfitsio": [True, False], @@ -20,62 +27,50 @@ class S2let(ConanFile): "fPIC": True, "with_cfitsio": False, } - 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" 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("astro-informatics-so3/1.3.4") + self.requires("astro-informatics-so3/1.3.6", transitive_headers=True, transitive_libs=True) if self.options.with_cfitsio: - self.requires("cfitsio/3.490") + self.requires("cfitsio/4.3.1") def validate(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration( - "S2LET requires C99 support for complex numbers." - ) + if is_msvc(self): + raise ConanInvalidConfiguration("S2LET requires C99 support for complex numbers.") 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) - @property - def _cmake(self): - if not hasattr(self, "_cmake_instance"): - self._cmake_instance = CMake(self) - self._cmake_instance.definitions["BUILD_TESTING"] = False - self._cmake_instance.definitions["cfitsio"] = self.options.with_cfitsio - self._cmake_instance.configure(build_folder=self._build_subfolder) - return self._cmake_instance + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["cfitsio"] = self.options.with_cfitsio + tc.generate() + tc = CMakeDeps(self) + tc.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", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "*.cmake", self.package_folder, recursive=True) def package_info(self): - self.cpp_info.names["cmake_find_package"] = "s2let" - self.cpp_info.names["cmake_find_package_multi"] = "s2let" self.cpp_info.libs = ["s2let"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] diff --git a/recipes/s2let/all/test_package/CMakeLists.txt b/recipes/s2let/all/test_package/CMakeLists.txt index 87839a22ea4e7..d0ee79e2b9187 100644 --- a/recipes/s2let/all/test_package/CMakeLists.txt +++ b/recipes/s2let/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -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(s2let REQUIRED NO_MODULE) +find_package(s2let REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.c) target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) diff --git a/recipes/s2let/all/test_package/conanfile.py b/recipes/s2let/all/test_package/conanfile.py index abcaeed3f89b6..ef5d7042163ec 100644 --- a/recipes/s2let/all/test_package/conanfile.py +++ b/recipes/s2let/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/s2let/config.yml b/recipes/s2let/config.yml index a0d8538280848..880dc7c80ba70 100644 --- a/recipes/s2let/config.yml +++ b/recipes/s2let/config.yml @@ -1,3 +1,5 @@ versions: + "2.2.6": + folder: all "2.2.3": folder: all diff --git a/recipes/s2n/all/conandata.yml b/recipes/s2n/all/conandata.yml index 7cf47057ff944..84ba1e3c9fffe 100644 --- a/recipes/s2n/all/conandata.yml +++ b/recipes/s2n/all/conandata.yml @@ -1,45 +1,31 @@ sources: - "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" + "1.5.9": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.5.9.tar.gz" + sha256: "8a9aa2ba9a25f936e241eaa6bb7e39bc1a097d178c4b255fa36795c0457e3f4e" + "1.5.7": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.5.7.tar.gz" + sha256: "c30b97c8bcccc0557331dd1a043010a70984c9cff11b0bbd769651db68f8b91d" + "1.5.6": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.5.6.tar.gz" + sha256: "85602d0ad672cb233052504624dec23b47fc6d324bb82bd6eaff13b8f652dec3" + "1.5.5": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.5.5.tar.gz" + sha256: "6316e1ad2c8ef5807519758bb159d314b9fef31d79ae27bc8f809104b978bb04" + "1.5.3": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.5.3.tar.gz" + sha256: "609d4ab5747e592a8749f2db7ff6422ea2e0aff3d2790b6d36defe276f422a71" + "1.5.2": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.5.2.tar.gz" + sha256: "896d9f8f8e9bd2fdcb9a21b18aede4f7afc65bde279afabc60abf97fa5069dd1" + "1.5.1": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.5.1.tar.gz" + sha256: "d79710d6ef089097a3b84fc1e5cec2f08d1ec46e93b1d400df59fcfc859e15a3" + "1.5.0": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.5.0.tar.gz" + sha256: "5e86d97d8f24653ef3dff3abe6165169f0ba59cdf52b5264987125bba070174d" + "1.4.16": + url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.4.16.tar.gz" + sha256: "84fdbaa894c722bf13cac87b8579f494c1c2d66de642e5e6104638fddea76ad9" "1.3.15": url: "https://github.com/aws/s2n-tls/archive/v1.3.15.tar.gz" sha256: "e3fc3405bb56334cbec90c35cbdf0e8a0f53199749a3f4b8fddb8d8a41e6db8b" - "1.3.9": - url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.3.9.tar.gz" - sha256: "09f03600d45cac99b8495f9c7aa5f70a83b5c02867a3018a1ba9975d53184658" - "1.2.0": - url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.2.0.tar.gz" - sha256: "90c1b5f4ac2c46774c8f100cac4f2a951715ae0bf2661799b9aaa891e6fb1f30" - "1.1.1": - url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.1.1.tar.gz" - sha256: "a17ef1e55b0a6c3d422b8b857bcfd26af7d2f8b33628a540854a6c17b8bed4d8" - "1.1.0": - url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.1.0.tar.gz" - sha256: "e094fd1f2044cfaeedb534ef1d7e4fd8745d8c07a247ce383cd8a6a5288e195c" - "1.0.11": - url: "https://github.com/aws/s2n-tls/archive/refs/tags/v1.0.11.tar.gz" - sha256: "dbe886cf8cd6658cce571cdaba81e9a93d8c914fd1eba0d3233fec64ed53224b" -patches: - "1.1.0": - - patch_file: "patches/1.1.0/001-try-compile.patch" - "1.0.11": - - patch_file: "patches/1.0.11/001-try-compile.patch" diff --git a/recipes/s2n/all/conanfile.py b/recipes/s2n/all/conanfile.py index 34d4cbcae2b9f..ff6db0a572dc7 100644 --- a/recipes/s2n/all/conanfile.py +++ b/recipes/s2n/all/conanfile.py @@ -1,20 +1,19 @@ 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, rmdir, save +from conan.tools.files import copy, get, rmdir import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.4" class S2nConan(ConanFile): name = "s2n" description = "An implementation of the TLS/SSL protocols" - topics = ("aws", "amazon", "cloud", ) + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/aws/s2n-tls" - license = "Apache-2.0" + topics = ("aws", "amazon", "cloud", ) package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -26,15 +25,11 @@ class S2nConan(ConanFile): "fPIC": True, } + implements = ["auto_shared_fpic"] + languages = "C" + def export_sources(self): copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) - 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): cmake_layout(self, src_folder="src") @@ -54,12 +49,13 @@ def generate(self): tc.variables["BUILD_TESTING"] = False tc.variables["UNSAFE_TREAT_WARNINGS_AS_ERRORS"] = False tc.variables["SEARCH_LIBCRYPTO"] = False # see CMakeLists wrapper + # When adding new version, check if they updated their minimum CMake version and make this conditional + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" tc.generate() deps = CMakeDeps(self) deps.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() @@ -70,27 +66,6 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "s2n")) - # 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::s2n": "s2n::s2n"} - ) - - 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", "s2n") self.cpp_info.set_property("cmake_target_name", "AWS::s2n") @@ -98,7 +73,3 @@ def package_info(self): self.cpp_info.requires = ["openssl::crypto"] if self.settings.os in ("FreeBSD", "Linux"): self.cpp_info.system_libs = ["m", "pthread"] - - # 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/s2n/all/test_package/CMakeLists.txt b/recipes/s2n/all/test_package/CMakeLists.txt index 2f57c92d6fe12..40da6d9e646c2 100644 --- a/recipes/s2n/all/test_package/CMakeLists.txt +++ b/recipes/s2n/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(s2n REQUIRED CONFIG) diff --git a/recipes/s2n/all/test_v1_package/CMakeLists.txt b/recipes/s2n/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/s2n/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/s2n/all/test_v1_package/conanfile.py b/recipes/s2n/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/s2n/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_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/s2n/config.yml b/recipes/s2n/config.yml index 08d9c1cf6b54d..69632288533b2 100644 --- a/recipes/s2n/config.yml +++ b/recipes/s2n/config.yml @@ -1,27 +1,23 @@ versions: - "1.4.0": + "1.5.9": folder: all - "1.3.56": + "1.5.7": folder: all - "1.3.55": + "1.5.6": folder: all - "1.3.52": + "1.5.5": folder: all - "1.3.50": + "1.5.3": folder: all - "1.3.49": + "1.5.2": folder: all - "1.3.31": + "1.5.1": folder: all - "1.3.15": - folder: all - "1.3.9": - folder: all - "1.2.0": + "1.5.0": folder: all - "1.1.1": + # keep 1.4.16 for aws-sdk-cpp, aws-c-io + "1.4.16": folder: all - "1.1.0": - folder: all - "1.0.11": + # keep 1.3.15 for aws-sdk-cpp, aws-c-io + "1.3.15": folder: all diff --git a/recipes/safe/all/conandata.yml b/recipes/safe/all/conandata.yml new file mode 100644 index 0000000000000..fb5bd5ef42e56 --- /dev/null +++ b/recipes/safe/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.0.0": + url: "https://github.com/LouisCharlesC/safe/archive/v2.0.0.tar.gz" + sha256: "1684c61212d01d1b20db77d17ddd795badc7c1b9feb06ef93ef453c6cb4a1642" + "1.1.1": + url: "https://github.com/LouisCharlesC/safe/archive/v1.1.1.tar.gz" + sha256: "A6E161EAFC32AA522CD2CE1A5F95A3DF963C51263053089FC8F7A9765D054F00" diff --git a/recipes/safe/all/conanfile.py b/recipes/safe/all/conanfile.py new file mode 100644 index 0000000000000..c7c9d401cf1af --- /dev/null +++ b/recipes/safe/all/conanfile.py @@ -0,0 +1,48 @@ +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 +import os + +required_conan_version = ">=1.51.1" + +class SafeConan(ConanFile): + name = "safe" + description = "Header only read and write locks for mutexes" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/LouisCharlesC/safe" + topics = ("multi-threading ", "lock", "guard", "raii", "thread-safety", "mutexes", "lock-guard", "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.get_safe("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, 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 = [] diff --git a/recipes/safe/all/test_package/CMakeLists.txt b/recipes/safe/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f12ebd4fe5f2f --- /dev/null +++ b/recipes/safe/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(safe REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE safe::safe) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/safe/all/test_package/conanfile.py b/recipes/safe/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/safe/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/safe/all/test_package/test_package.cpp b/recipes/safe/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9286960794fc7 --- /dev/null +++ b/recipes/safe/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include "safe/safe.h" + +int main(void) { + safe::Safe safeValue; + + { + safe::WriteAccess> value(safeValue); + *value = 5; + } + + return 0; +} diff --git a/recipes/safe/config.yml b/recipes/safe/config.yml new file mode 100644 index 0000000000000..eb4c9584b610a --- /dev/null +++ b/recipes/safe/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.0": + folder: all + "1.1.1": + folder: all diff --git a/recipes/safeint/all/test_package/CMakeLists.txt b/recipes/safeint/all/test_package/CMakeLists.txt index 947fe8e635a5d..a8bf9b0b6809b 100644 --- a/recipes/safeint/all/test_package/CMakeLists.txt +++ b/recipes/safeint/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(safeint REQUIRED CONFIG) diff --git a/recipes/safeint/all/test_v1_package/CMakeLists.txt b/recipes/safeint/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/safeint/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/safeint/all/test_v1_package/conanfile.py b/recipes/safeint/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/safeint/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_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/sail/all/conandata.yml b/recipes/sail/all/conandata.yml index f34812471ebce..82da53f9eba7e 100644 --- a/recipes/sail/all/conandata.yml +++ b/recipes/sail/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "0.9.8": + url: "https://github.com/HappySeaFox/sail/archive/v0.9.8.tar.gz" + sha256: "ba2160f0825171ab3c41cbc5bb0834bf56439d2986e5aae5f586d5e2009dd9cd" + "0.9.6": + url: "https://github.com/HappySeaFox/sail/archive/v0.9.6.tar.gz" + sha256: "4e46b1a5cd0e23f78fbeef085340779c9d4a7d5dd731ffd1df8fdfb343befbc4" + "0.9.5": + url: "https://github.com/HappySeaFox/sail/archive/v0.9.5.tar.gz" + sha256: "28c601c0399be1940710afc150b5836f8b3f5f6a35b98d7ac1467e62bc568e20" + "0.9.4": + url: "https://github.com/HappySeaFox/sail/archive/v0.9.4.tar.gz" + sha256: "9a8b93c15c4a1afe07c760d2087895a18626034f55917f333aaabe9c9704438f" + "0.9.1": + url: "https://github.com/HappySeaFox/sail/archive/v0.9.1.tar.gz" + sha256: "d02ce889b70d9e237b64806df26b044753e3edf3e87c8af42c32ec9968133a88" "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 5f767c3bd62c5..8afbd6f8c8980 100644 --- a/recipes/sail/all/conanfile.py +++ b/recipes/sail/all/conanfile.py @@ -1,13 +1,15 @@ 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, rename, rmdir +from conan.tools.files import copy, get, rename, rmdir from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" class SAILConan(ConanFile): name = "sail" + package_type = "library" description = "The missing small and fast image decoding library for humans (not for machines)" url = "https://github.com/conan-io/conan-center-index" homepage = "https://sail.software" @@ -23,14 +25,6 @@ class SAILConan(ConanFile): "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, @@ -41,22 +35,8 @@ class SAILConan(ConanFile): "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", @@ -64,10 +44,6 @@ class SAILConan(ConanFile): "with_lowest_priority_codecs": "Enable codecs: WAL, XBM", } - - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") @@ -78,33 +54,19 @@ def configure(self): def requirements(self): if self.options.with_highest_priority_codecs: - self.requires("giflib/5.2.1") + self.requires("giflib/5.2.2") self.requires("libjpeg/9e") - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") self.requires("libtiff/4.6.0") + if self.options.with_high_priority_codecs: + if Version(self.version) >= "0.9.1": + self.requires("nanosvg/cci.20231025") 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("libavif/1.0.4") + self.requires("jasper/4.2.0") + self.requires("libjxl/0.8.2") 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") @@ -131,23 +93,21 @@ def generate(self): tc.variables["SAIL_BUILD_APPS"] = False tc.variables["SAIL_BUILD_EXAMPLES"] = False tc.variables["SAIL_COMBINE_CODECS"] = True + tc.variables["SAIL_ENABLE_OPENMP"] = False 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" + # SVG with nanosvg is supported in >= 0.9.1 + if Version(self.version) < "0.9.1": + tc.variables["SAIL_DISABLE_CODECS"] = "svg" 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) + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) tc.generate() deps = CMakeDeps(self) deps.generate() def build(self): - apply_conandata_patches(self) - cmake = CMake(self) cmake.configure() cmake.build() @@ -193,10 +153,12 @@ def package_info(self): self.cpp_info.components["sail-codecs"].requires.append("libjpeg::libjpeg") self.cpp_info.components["sail-codecs"].requires.append("libpng::libpng") self.cpp_info.components["sail-codecs"].requires.append("libtiff::libtiff") + if Version(self.version) >= "0.9.1": + self.cpp_info.components["sail-codecs"].requires.append("nanosvg::nanosvg") 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("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/test_package/CMakeLists.txt b/recipes/sail/all/test_package/CMakeLists.txt index 79614592c76dc..cb86fe79928de 100644 --- a/recipes/sail/all/test_package/CMakeLists.txt +++ b/recipes/sail/all/test_package/CMakeLists.txt @@ -11,10 +11,8 @@ find_package(Sail REQUIRED CONFIG) # C API add_executable(test_package_c test_package.c) -target_compile_definitions(test_package_c PRIVATE SAIL_DEMO_FILE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/bmp.bmp") target_link_libraries(test_package_c PRIVATE SAIL::Sail) # C++ API add_executable(test_package_cxx test_package.cpp) -target_compile_definitions(test_package_cxx PRIVATE SAIL_DEMO_FILE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/bmp.bmp") target_link_libraries(test_package_cxx PRIVATE SAIL::SailC++) diff --git a/recipes/sail/all/test_package/bmp.bmp b/recipes/sail/all/test_package/bmp.bmp deleted file mode 100644 index 74d4973a3b13c..0000000000000 Binary files a/recipes/sail/all/test_package/bmp.bmp and /dev/null differ diff --git a/recipes/sail/all/test_package/conanfile.py b/recipes/sail/all/test_package/conanfile.py index 00e3064a021c0..fb321506e5e83 100644 --- a/recipes/sail/all/test_package/conanfile.py +++ b/recipes/sail/all/test_package/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.cmake import CMake, cmake_layout import os + class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" diff --git a/recipes/sail/all/test_package/test_package.c b/recipes/sail/all/test_package/test_package.c index eba9d786722c4..59c23fda941fb 100644 --- a/recipes/sail/all/test_package/test_package.c +++ b/recipes/sail/all/test_package/test_package.c @@ -1,26 +1,9 @@ #include - +#include #include -int main(int argc, char *argv[]) -{ - (void)argc; - (void)argv; - +int main() { struct sail_image *image; - - SAIL_TRY_OR_EXECUTE(sail_load_from_file(SAIL_DEMO_FILE_PATH, &image), - /* on error */ return 1); - - printf("Size: %ux%u, bytes per line: %u, " - "pixel format: %s, pixels: %p\n", - image->width, - image->height, - image->bytes_per_line, - sail_pixel_format_to_string(image->pixel_format), - image->pixels); - - sail_destroy_image(image); - - return 0; + sail_status_t status = sail_load_from_file("binary-file.bmp", &image); + printf("Error - file not found generate: status %d\n", status); } diff --git a/recipes/sail/all/test_package/test_package.cpp b/recipes/sail/all/test_package/test_package.cpp index efad1f9a8c2e3..918cafc9fb33d 100644 --- a/recipes/sail/all/test_package/test_package.cpp +++ b/recipes/sail/all/test_package/test_package.cpp @@ -4,25 +4,13 @@ int main(int argc, char *argv[]) { - (void)argc; - (void)argv; - - const sail::image image(SAIL_DEMO_FILE_PATH); - - if (!image.is_valid()) { - return 1; + const char* filename = "my-binary.bmp"; + try { + const sail::image image(filename); + std::cout << "Size: " << image.width() << std::endl; // Never reached + } catch (const std::exception& e) { + std::cerr << "Error - file not found generate: " << e.what() << std::endl; } - std::cout - << "Size: " - << image.width() << 'x' << image.height() - << ", bytes per line: " - << image.bytes_per_line() - << ", pixel format: " - << sail::image::pixel_format_to_string(image.pixel_format()) - << ", pixels: " - << image.pixels() - << std::endl; - return 0; } diff --git a/recipes/sail/all/test_v1_package/CMakeLists.txt b/recipes/sail/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index dbf35d5521717..0000000000000 --- a/recipes/sail/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C 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/sail/all/test_v1_package/bmp.bmp b/recipes/sail/all/test_v1_package/bmp.bmp deleted file mode 100644 index 74d4973a3b13c..0000000000000 Binary files a/recipes/sail/all/test_v1_package/bmp.bmp and /dev/null differ diff --git a/recipes/sail/all/test_v1_package/conanfile.py b/recipes/sail/all/test_v1_package/conanfile.py deleted file mode 100644 index e1256a3fd44fe..0000000000000 --- a/recipes/sail/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -import os - -from conans import ConanFile, CMake, tools - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package", "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_c") - self.run(bin_path, run_environment=True) - - bin_path = os.path.join("bin", "test_package_cxx") - self.run(bin_path, run_environment=True) diff --git a/recipes/sail/config.yml b/recipes/sail/config.yml index 7dbf8a1dbf4a8..25b4a1caaab79 100644 --- a/recipes/sail/config.yml +++ b/recipes/sail/config.yml @@ -1,3 +1,13 @@ versions: + "0.9.8": + folder: all + "0.9.6": + folder: all + "0.9.5": + folder: all + "0.9.4": + folder: all + "0.9.1": + folder: all "0.9.0": folder: all diff --git a/recipes/samurai/all/conandata.yml b/recipes/samurai/all/conandata.yml index b4ff07102a673..39739edcf25df 100644 --- a/recipes/samurai/all/conandata.yml +++ b/recipes/samurai/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.16.0": + url: "https://github.com/hpc-maths/samurai/archive/v0.16.0.tar.gz" + sha256: "61616de42557e5cd5e9483103fd640f94f3235354e42a22a0ec76520196059a5" + "0.13.0": + url: "https://github.com/hpc-maths/samurai/archive/v0.13.0.tar.gz" + sha256: "f38e379218b1206fc5c5e157ee5e80687721a896f70b892623d9f30280529448" "0.9.0": url: "https://github.com/hpc-maths/samurai/archive/v0.9.0.tar.gz" sha256: "49f94a7451b1b50cab335a62e294e612fea27cbf5b131827eb69a8e228ad8010" diff --git a/recipes/samurai/all/conanfile.py b/recipes/samurai/all/conanfile.py index 9bbf83edd6985..3667d0c5edfed 100644 --- a/recipes/samurai/all/conanfile.py +++ b/recipes/samurai/all/conanfile.py @@ -43,8 +43,8 @@ def requirements(self): self.requires("fmt/10.1.1") self.requires("highfive/2.7.1") self.requires("pugixml/1.14") - self.requires("xsimd/11.1.0") - self.requires("xtensor/0.24.6") + self.requires("xsimd/13.0.0") + self.requires("xtensor/0.24.7") def package_id(self): self.info.clear() diff --git a/recipes/samurai/config.yml b/recipes/samurai/config.yml index b54c9224b6c19..87628f14bd6dd 100644 --- a/recipes/samurai/config.yml +++ b/recipes/samurai/config.yml @@ -1,4 +1,8 @@ versions: + "0.16.0": + folder: all + "0.13.0": + folder: all "0.9.0": folder: all "0.8.0": diff --git a/recipes/sassc/all/conandata.yml b/recipes/sassc/all/conandata.yml index 5119b677bea74..23ccaaba2c88a 100644 --- a/recipes/sassc/all/conandata.yml +++ b/recipes/sassc/all/conandata.yml @@ -2,6 +2,3 @@ sources: "3.6.2": url: "https://github.com/sass/sassc/archive/3.6.2.tar.gz" sha256: "608dc9002b45a91d11ed59e352469ecc05e4f58fc1259fc9a9f5b8f0f8348a03" - "3.6.1": - sha256: 8cee391c49a102b4464f86fc40c4ceac3a2ada52a89c4c933d8348e3e4542a60 - url: https://github.com/sass/sassc/archive/3.6.1.tar.gz diff --git a/recipes/sassc/all/conanfile.py b/recipes/sassc/all/conanfile.py index b9452a96ffc40..4aed7995e790a 100644 --- a/recipes/sassc/all/conanfile.py +++ b/recipes/sassc/all/conanfile.py @@ -1,91 +1,138 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get, replace_in_file, chdir, save -from conan.tools.microsoft import is_msvc -from conans import AutoToolsBuildEnvironment, tools, MSBuild -import os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import chdir, copy, get, replace_in_file, save +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuild, is_msvc, MSBuildToolchain, MSBuildDeps -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class SasscConan(ConanFile): name = "sassc" + description = "libsass command line driver" license = "MIT" - homepage = "https://sass-lang.com/libsass" url = "https://github.com/conan-io/conan-center-index" - description = "libsass command line driver" - topics = ("Sass", "sassc", "compiler") - settings = "os", "compiler", "build_type", "arch" - generators = "visual_studio" - - _autotools = None + homepage = "https://sass-lang.com/libsass" + topics = ("Sass", "compiler") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" def config_options(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 requirements(self): + self.requires("libsass/3.6.5") def package_id(self): del self.info.settings.compiler def validate(self): if not is_msvc(self) and self.info.settings.os not in ["Linux", "FreeBSD", "Macos"]: - raise ConanInvalidConfiguration("sassc supports only Linux, FreeBSD, Macos and Windows Visual Studio at this time, contributions are welcomed") - - def requirements(self): - self.requires("libsass/3.6.5") + raise ConanInvalidConfiguration( + "sassc supports only Linux, FreeBSD, Macos and Windows Visual Studio at this time," + " contributions are welcomed" + ) def build_requirements(self): if not is_msvc(self): 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) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + @property + def _msbuild_configuration(self): + return "Debug" if self.settings.build_type == "Debug" else "Release" + + @property + def _msbuild_platform(self): + return "Win32" if self.settings.arch == "x86" else "Win64" + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = self._msbuild_configuration + tc.platform = self._msbuild_platform + # FIXME: setting this property does not work, applied as a patch instead + # tc.properties["LIBSASS_DIR"] = self.dependencies["libsass"].package_folder + tc.generate() + deps = MSBuildDeps(self) + deps.configuration = self._msbuild_configuration + deps.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args += ["--disable-tests"] + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() def _patch_sources(self): - replace_in_file(self, - os.path.join(self.build_folder, self._source_subfolder, "win", "sassc.vcxproj"), - "$(LIBSASS_DIR)\\win\\libsass.targets", - os.path.join(self.build_folder, "conanbuildinfo.props")) - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - self._autotools.configure(args=["--disable-tests"]) - return self._autotools - - def _build_msbuild(self): - msbuild = MSBuild(self) - platforms = { - "x86": "Win32", - "x86_64": "Win64" - } - msbuild.build("win/sassc.sln", platforms=platforms) + 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", "sassc.vcxproj") + for existing_toolset in ["v120", "v140", "v141", "v142", "v143"]: + replace_in_file(self, vcxproj_file, + f"{existing_toolset}", + f"{platform_toolset}", strict=False) + # Inject VS 2022 support + replace_in_file(self, vcxproj_file, + '\n' + f' {platform_toolset}\n' + '\n' + '..\\..', + f"{self.dependencies['libsass'].package_folder}") + replace_in_file(self, vcxproj_file, r'', "") + if props_path: + replace_in_file(self, vcxproj_file, + r'', + rf'{import_conan_generators}') def build(self): self._patch_sources() - with chdir(self, self._source_subfolder): + with chdir(self, self.source_folder): if is_msvc(self): - self._build_msbuild() + msbuild = MSBuild(self) + msbuild.build_type = self._msbuild_configuration + msbuild.platform = self._msbuild_platform + msbuild.build(sln=os.path.join("win", "sassc.sln")) else: - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True) save(self, path="VERSION", content=f"{self.version}") - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() autotools.make() def package(self): - with chdir(self, self._source_subfolder): + with chdir(self, self.source_folder): if is_msvc(self): - self.copy("*.exe", dst="bin", src=os.path.join(self._source_subfolder, "bin"), keep_path=False) + copy(self, "*.exe", + dst=os.path.join(self.package_folder, "bin"), + src=os.path.join(self.source_folder, "bin"), + keep_path=False) else: - autotools = self._configure_autotools() + autotools = Autotools(self) autotools.install() - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + copy(self, "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) def package_info(self): self.cpp_info.frameworkdirs = [] @@ -93,6 +140,6 @@ def package_info(self): self.cpp_info.resdirs = [] self.cpp_info.includedirs = [] - bin_folder = os.path.join(self.package_folder, "bin") # 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/sassc/all/test_package/conanfile.py b/recipes/sassc/all/test_package/conanfile.py index 70d62ab9bfc61..cad02af78d9e1 100644 --- a/recipes/sassc/all/test_package/conanfile.py +++ b/recipes/sassc/all/test_package/conanfile.py @@ -1,9 +1,13 @@ -from conans import ConanFile, tools +from conan import ConanFile -class LibsassTestConan(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): - if not tools.cross_building(self): - self.run("sassc --version", run_environment=True) + self.run("sassc --version") diff --git a/recipes/sassc/config.yml b/recipes/sassc/config.yml index bfe5b909d834d..4c410b4e03fe2 100644 --- a/recipes/sassc/config.yml +++ b/recipes/sassc/config.yml @@ -1,5 +1,3 @@ versions: "3.6.2": folder: all - "3.6.1": - folder: all diff --git a/recipes/sbepp/all/conandata.yml b/recipes/sbepp/all/conandata.yml index 82c17d19658b7..ce667904a7ecd 100644 --- a/recipes/sbepp/all/conandata.yml +++ b/recipes/sbepp/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "1.5.1": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.5.1.tar.gz" + sha256: "f3b087fab45bbc6f071188e35843ed3c919be1b608a469e9451a5d72c8f9ab28" + "1.4.2": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.4.2.tar.gz" + sha256: "4af544262cd447f0fad45db850ab82b3318ff75e47dbdbdd5150437ca7d523c5" + "1.4.1": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.4.1.tar.gz" + sha256: "1e5913372e3f4871a7aa3d8ac94759cdcc9df61a3865ce99944f74cc0672795d" + "1.4.0": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.4.0.tar.gz" + sha256: "64112ed22d6c82debc70a4c097f3fcd05a4bd280dca7e2013edbd6bebfd1da56" + "1.3.0": + url: "https://github.com/OleksandrKvl/sbepp/archive/refs/tags/1.3.0.tar.gz" + sha256: "44caa61681c7f94c840a2f2a247a0385e9e61c6e8639b9f7561c9d62125f9486" + "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" diff --git a/recipes/sbepp/all/conanfile.py b/recipes/sbepp/all/conanfile.py index 550f0466dea48..85e391e2ff327 100644 --- a/recipes/sbepp/all/conanfile.py +++ b/recipes/sbepp/all/conanfile.py @@ -37,7 +37,7 @@ def _min_cppstd(self): def _compilers_minimum_version(self): if self.options.with_sbeppc: return { - "gcc": "9", + "gcc": "8", "clang": "9", "apple-clang": "11" } @@ -69,8 +69,8 @@ def requirements(self): self.requires("fmt/9.1.0") self.requires("pugixml/1.12.1") else: - self.requires("fmt/10.1.0") - self.requires("pugixml/1.13") + self.requires("fmt/10.2.0") + self.requires("pugixml/1.14") def validate(self): if self.settings.compiler.cppstd: @@ -111,16 +111,23 @@ def package(self): 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 + # 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) diff --git a/recipes/sbepp/all/test_package/CMakeLists.txt b/recipes/sbepp/all/test_package/CMakeLists.txt index 0d65c50caeceb..de42d2a9dbead 100644 --- a/recipes/sbepp/all/test_package/CMakeLists.txt +++ b/recipes/sbepp/all/test_package/CMakeLists.txt @@ -9,27 +9,37 @@ if(TARGET sbepp::sbeppc) set(sbeppc_test_name "test_sbeppc") set(schema "test_schema") set(schema_path "${CMAKE_CURRENT_LIST_DIR}/${schema}.xml") - 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_executable(${sbeppc_test_name}) - add_dependencies(${sbeppc_test_name} compile_schema) target_sources(${sbeppc_test_name} PRIVATE test_sbeppc.cpp) - - target_include_directories(${sbeppc_test_name} - SYSTEM PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} - ) - - target_link_libraries(${sbeppc_test_name} PRIVATE sbepp::sbepp) 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 diff --git a/recipes/sbepp/all/test_package/conanfile.py b/recipes/sbepp/all/test_package/conanfile.py index 1111583fea732..f673d7c44446b 100644 --- a/recipes/sbepp/all/test_package/conanfile.py +++ b/recipes/sbepp/all/test_package/conanfile.py @@ -1,13 +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 # 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): @@ -16,6 +16,11 @@ def requirements(self): 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() diff --git a/recipes/sbepp/all/test_v1_package/CMakeLists.txt b/recipes/sbepp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/sbepp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/sbepp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/sbepp/config.yml b/recipes/sbepp/config.yml index 20ec1c9e2bdee..019aa4696ae9a 100644 --- a/recipes/sbepp/config.yml +++ b/recipes/sbepp/config.yml @@ -1,4 +1,16 @@ versions: + "1.5.1": + folder: all + "1.4.2": + folder: all + "1.4.1": + folder: all + "1.4.0": + folder: all + "1.3.0": + folder: all + "1.2.0": + folder: all "1.1.0": folder: all "1.0.1": diff --git a/recipes/sbp/all/conandata.yml b/recipes/sbp/all/conandata.yml index c5be56f8c3b1f..517606eaacf88 100644 --- a/recipes/sbp/all/conandata.yml +++ b/recipes/sbp/all/conandata.yml @@ -1,22 +1,29 @@ sources: + "5.0.4": + cmake: + url: "https://github.com/swift-nav/cmake/archive/954e6cebe4c902d07d33beef166df89073a7b4f2.zip" + sha256: "910e14e35d02fd766bc885cfc9b99626006c12ef26d6446cfbf728862d7cebab" + source: + 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 + sha256: "6a725914bf8c3ed13065812cf4d7b0a69e478eaa150561e0e3be4cd01bf3798f" source: url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v4.15.0.tar.gz" - sha256: e71fd7dd5536058d6b93ade443913e68da7b4f1896aa720dc369baab1864e9e9 + 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 + sha256: "6077d2a754d013e3cb9826f589e47b19ab01f4d91ede4f5bfc14db74bc5dc894" source: url: "https://github.com/swift-nav/libsbp/archive/refs/tags/v3.4.10.tar.gz" - sha256: f2fb738f49112b25e7849ca0c75415159127e9b5373b13e7027362b8fa0b1224 + sha256: "f2fb738f49112b25e7849ca0c75415159127e9b5373b13e7027362b8fa0b1224" diff --git a/recipes/sbp/all/conanfile.py b/recipes/sbp/all/conanfile.py index b94c371fc9b5b..42d7e5a981521 100644 --- a/recipes/sbp/all/conanfile.py +++ b/recipes/sbp/all/conanfile.py @@ -4,8 +4,9 @@ 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 -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class SbpConan(ConanFile): @@ -55,6 +56,8 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["libsbp_ENABLE_TESTS"] = False tc.variables["libsbp_ENABLE_DOCS"] = False + if Version(self.version) < "4.0.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() tc = CMakeDeps(self) tc.generate() diff --git a/recipes/sbp/config.yml b/recipes/sbp/config.yml index 6e299a70ad6f8..e2fec4a93304d 100644 --- a/recipes/sbp/config.yml +++ b/recipes/sbp/config.yml @@ -1,4 +1,6 @@ versions: + "5.0.4": + folder: "all" "4.15.0": folder: "all" "4.2.0": diff --git a/recipes/scc/all/CMakeLists.txt b/recipes/scc/all/CMakeLists.txt deleted file mode 100644 index 19bdb7e7f5fb7..0000000000000 --- a/recipes/scc/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(scc C) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/scc/all/conandata.yml b/recipes/scc/all/conandata.yml index bd7433056072d..a492e239a4b1c 100644 --- a/recipes/scc/all/conandata.yml +++ b/recipes/scc/all/conandata.yml @@ -1,4 +1,13 @@ sources: - "2022.08": - url: "https://github.com/Minres/SystemC-Components/releases/download/2022.08/systemc-components.tar.gz" - sha256: "825dfc38e7b00df34330f01ba38f5913e1a88c5002344e433b972faf0e6c4501" + "2023.06": + url: "https://github.com/Minres/SystemC-Components/releases/download/2023.06/SCC-2023.06-full.tar.gz" + sha256: "6d1a842f474daa512030d61526e83182f9289b977a3a7cb88ed151050c33c4e9" +patches: + "2023.06": + - patch_file: "patches/2023.06-fix-conan-targets.patch" + patch_description: "add find_package()-s and disable automatic Conan setup" + patch_type: "conan" + - patch_file: "patches/2023.06-add-fmt-10-support.patch" + patch_description: "fix incompatibility with fmt 10.x and newer" + patch_type: "portability" + patch_source: "https://github.com/Minres/SystemC-Components/pull/51" diff --git a/recipes/scc/all/conanfile.py b/recipes/scc/all/conanfile.py index c95474718f1dd..5f82f6e023588 100644 --- a/recipes/scc/all/conanfile.py +++ b/recipes/scc/all/conanfile.py @@ -1,89 +1,166 @@ +import os + from conan import ConanFile -from conan.tools.scm import Version -from conan.tools.files import get -from conans import tools, CMake from conan.errors import ConanInvalidConfiguration -import functools +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, CMakeDeps +from conan.tools.files import copy, get, export_conandata_patches, apply_conandata_patches, replace_in_file, rmdir +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 SystemcComponentsConan(ConanFile): name = "scc" - description = """A light weight productivity library for SystemC and TLM 2.0""" - homepage = "https://minres.github.io/SystemC-Components" - url = "https://github.com/conan-io/conan-center-index" + description = "A light-weight productivity library for SystemC and TLM 2.0" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://minres.github.io/SystemC-Components" topics = ("systemc", "modeling", "tlm", "scc") - settings = "os", "compiler", "build_type", "arch" + + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" options = { "fPIC": [True, False], "enable_phase_callbacks": [True, False], - "enable_phase_callbacks_tracing": [True, False] + "enable_phase_callbacks_tracing": [True, False], } default_options = { "fPIC": True, "enable_phase_callbacks": False, - "enable_phase_callbacks_tracing": False + "enable_phase_callbacks_tracing": False, } - generators = "cmake" - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" - - # no exports_sources attribute, but export_sources(self) method instead - # this allows finer grain exportation of patches per version def export_sources(self): - self.copy("CMakeLists.txt") - + 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): + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/sysc/scc/perf_estimator.h#L20 + self.requires("boost/1.83.0", transitive_headers=True, transitive_libs=True) + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/sysc/scc/trace/vcd_trace.hh#L28 + self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/common/util/lz4_streambuf.h#L13 + self.requires("lz4/1.9.4", transitive_headers=True, transitive_libs=True) + self.requires("rapidjson/cci.20220822") + self.requires("spdlog/1.13.0") + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/sysc/tlm/scc/lwtr/tlm2_lwtr.h + self.requires("systemc-cci/1.0.0", transitive_headers=True, transitive_libs=True) + self.requires("systemc/2.3.4", transitive_headers=True, transitive_libs=True) + # https://github.com/Minres/SystemC-Components/blob/2023.06/src/sysc/scc/trace/gz_writer.hh#L18 + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) + self.requires("yaml-cpp/0.8.0") + def validate(self): + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.name} is not supported on {self.settings.os}.") + if is_msvc(self): + # Fails with + # src\sysc\tlm\scc\tlm_mm.h(116,114): error C2259: 'tlm::scc::tlm_gp_mm_t<16,false>': cannot instantiate abstract class + # (compiling source file '../../../src/src/sysc/tlm/scc/lwtr/tlm2_lwtr.cpp') + # src\sysc\tlm\scc\tlm_mm.h(116,48): + # see declaration of 'tlm::scc::tlm_gp_mm_t<16,false>' + # src\sysc\tlm\scc\tlm_mm.h(116,114): + # due to following members: + # src\sysc\tlm\scc\tlm_mm.h(116,114): + # 'void tlm::tlm_extension::copy_from(const tlm::tlm_extension_base &)': is abstract + # systemc-2.3.4\p\include\tlm_core\tlm_2\tlm_generic_payload\tlm_gp.h(78,18): + # see declaration of 'tlm::tlm_extension::copy_from' + # and + # src\sysc\tlm\scc\tlm_mm.h(31,20): error C2061: syntax error: identifier '__attribute__' + raise ConanInvalidConfiguration(f"{self.ref} recipe is not supported on MSVC. Contributions are welcome!") if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) - if self.settings.os == "Macos": - raise ConanInvalidConfiguration(f"{self.name} is not suppported on {self.settings.os}.") + 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], - destination=self._source_subfolder, strip_root=True) - def build_requirements(self): - self.tool_requires("cmake/3.24.0") + self.tool_requires("cmake/[>=3.24 <4]") - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["SC_WITH_PHASE_CALLBACKS"] = self.options.enable_phase_callbacks - cmake.definitions["SC_WITH_PHASE_CALLBACK_TRACING"] = self.options.enable_phase_callbacks_tracing - cmake.definitions["BUILD_SCC_DOCUMENTATION"] = False - cmake.definitions["SCC_LIB_ONLY"] = True + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["SC_WITH_PHASE_CALLBACKS"] = self.options.enable_phase_callbacks + tc.cache_variables["SC_WITH_PHASE_CALLBACK_TRACING"] = self.options.enable_phase_callbacks_tracing + tc.cache_variables["BUILD_SCC_DOCUMENTATION"] = False + tc.cache_variables["SCC_LIB_ONLY"] = True + tc.cache_variables["ENABLE_CONAN"] = False if self.settings.os == "Windows": - cmake.definitions["SCC_LIMIT_TRACE_TYPE_LIST"] = True - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.cache_variables["SCC_LIMIT_TRACE_TYPE_LIST"] = True + # Used at https://github.com/Minres/SystemC-Components/blob/2023.06/src/common/util/pool_allocator.h#L110 + # but is not set anywhere + tc.preprocessor_definitions["_GLIBCXX_USE_NOEXCEPT"] = "noexcept" + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("systemc", "cmake_file_name", "SystemC") + deps.set_property("systemc-cci", "cmake_target_name", "systemc-cci::systemc-cci") + deps.set_property("yaml-cpp", "cmake_target_name", "yaml-cpp::yaml-cpp") + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "third_party", "axi_chi", "CMakeLists.txt"), + " STATIC", "") 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() + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - self.cpp_info.components["busses"].libs = ["busses"] self.cpp_info.components["scc-sysc"].libs = ["scc-sysc"] + self.cpp_info.components["scc-sysc"].requires = [ + "fstapi", + "lwtr", + "scc-util", + "scv-tr", + "boost::date_time", + "fmt::fmt", + "lz4::lz4", + "rapidjson::rapidjson", + "spdlog::spdlog", + "systemc-cci::systemc-cci", + "systemc::systemc", + "yaml-cpp::yaml-cpp", + "zlib::zlib", + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["scc-sysc"].system_libs = ["pthread", "dl"] + + self.cpp_info.components["busses"].libs = ["busses"] + self.cpp_info.components["busses"].requires = ["tlm-interfaces", "scc-sysc"] + + self.cpp_info.components["fstapi"].libs = ["fstapi"] + self.cpp_info.components["fstapi"].requires = ["zlib::zlib", "lz4::lz4"] + + self.cpp_info.components["lwtr"].libs = ["lwtr"] + self.cpp_info.components["lwtr"].requires = ["zlib::zlib", "lz4::lz4", "systemc::systemc", "fmt::fmt"] + self.cpp_info.components["scc-util"].libs = ["scc-util"] + self.cpp_info.components["scc-util"].requires = ["lz4::lz4"] + self.cpp_info.components["scv-tr"].libs = ["scv-tr"] + self.cpp_info.components["scv-tr"].requires = ["fmt::fmt", "systemc::systemc"] + self.cpp_info.components["tlm-interfaces"].libs = ["tlm-interfaces"] + self.cpp_info.components["tlm-interfaces"].requires = ["scc-sysc", "systemc::systemc"] diff --git a/recipes/scc/all/patches/2023.06-add-fmt-10-support.patch b/recipes/scc/all/patches/2023.06-add-fmt-10-support.patch new file mode 100644 index 0000000000000..e07a125098cc9 --- /dev/null +++ b/recipes/scc/all/patches/2023.06-add-fmt-10-support.patch @@ -0,0 +1,11 @@ +--- src/sysc/scc/trace/vcd_trace.hh ++++ src/sysc/scc/trace/vcd_trace.hh +@@ -53,7 +53,7 @@ + + template + inline void vcdEmitValueChangeReal(FPTR os, std::string const& handle, unsigned bits, T val){ +- auto buf = fmt::format("r{:.16g} {}\n", val, handle); ++ auto buf = fmt::format("r{:.16g} {}\n", static_cast(val), handle); + FWRITE(buf.c_str(), 1, buf.size(), os); + } + diff --git a/recipes/scc/all/patches/2023.06-fix-conan-targets.patch b/recipes/scc/all/patches/2023.06-fix-conan-targets.patch new file mode 100644 index 0000000000000..052ef97ffbc9f --- /dev/null +++ b/recipes/scc/all/patches/2023.06-fix-conan-targets.patch @@ -0,0 +1,17 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -24,5 +24,13 @@ + include(Common) + +-if(CMAKE_PROJECT_NAME STREQUAL "scc") ++find_package(SystemC REQUIRED CONFIG) ++find_package(systemc-cci REQUIRED CONFIG) ++find_package(fmt REQUIRED CONFIG) ++find_package(spdlog REQUIRED CONFIG) ++find_package(Boost REQUIRED CONFIG) ++find_package(yaml-cpp REQUIRED CONFIG) ++find_package(lz4 REQUIRED CONFIG) ++if(TRUE) ++elseif(CMAKE_PROJECT_NAME STREQUAL "scc") + message(STATUS "Building SCC in standalone mode") + include(GNUInstallDirs) diff --git a/recipes/scc/all/test_package/CMakeLists.txt b/recipes/scc/all/test_package/CMakeLists.txt index b74b2d8e566a6..32a369fbfeb6a 100644 --- a/recipes/scc/all/test_package/CMakeLists.txt +++ b/recipes/scc/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(scc REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) diff --git a/recipes/scc/all/test_package/conanfile.py b/recipes/scc/all/test_package/conanfile.py index 48f7a8523a636..ef5d7042163ec 100644 --- a/recipes/scc/all/test_package/conanfile.py +++ b/recipes/scc/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 SystemcComponentsTestConan(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/scc/all/test_package/example.cpp b/recipes/scc/all/test_package/example.cpp index 2de9f26d9f75d..4f5ccf21b1e5c 100644 --- a/recipes/scc/all/test_package/example.cpp +++ b/recipes/scc/all/test_package/example.cpp @@ -1,7 +1,9 @@ +#include #include #include -int main(int argc, char* argv[]) { +int main() { + util::IoRedirector::get(); std::cout << "scc loaded successfully. Mini test: util::ilog2(32) = " << util::ilog2(32) << std::endl; return 0; } diff --git a/recipes/scc/config.yml b/recipes/scc/config.yml index f8b19962361c1..f334fc74322ea 100644 --- a/recipes/scc/config.yml +++ b/recipes/scc/config.yml @@ -1,3 +1,3 @@ versions: - "2022.08": - folder: "all" + "2023.06": + 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/test_v1_package/conanfile.py b/recipes/scdoc/all/test_v1_package/conanfile.py deleted file mode 100644 index 4e046a6fb6265..0000000000000 --- a/recipes/scdoc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -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 index aacd6d1a319fe..3da148cb520bd 100644 --- a/recipes/scip/all/conandata.yml +++ b/recipes/scip/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "9.2.0": + url: "https://github.com/scipopt/scip/archive/refs/tags/v920.tar.gz" + sha256: "a22dc20f44e99bfec071889fd5af2bfc57c4af14b76d777d1312006616346f7c" + "9.0.1": + url: "https://github.com/scipopt/scip/archive/refs/tags/v901.tar.gz" + sha256: "08ad3e7ad6f84f457d95bb70ab21fa7fc648dd43103099359ef8a8f30fcce32e" "8.1.0": url: "https://github.com/scipopt/scip/archive/refs/tags/v810.tar.gz" sha256: "b6daf54c37d02564b12fb32ec3bb7a105710eb0026adeafc602af4435fa94685" @@ -8,3 +14,24 @@ sources: "8.0.3": url: "https://github.com/scipopt/scip/archive/refs/tags/v803.tar.gz" sha256: "fe7636f8165a8c9298ff55ed3220d084d4ea31ba9b69d2733beec53e0e4335d6" +patches: + "9.2.0": + - patch_file: "patches/0001-bliss-include-dir.patch" + patch_description: "Change hard-coded paths to conan includes" + patch_type: "conan" +version_mappings: + "9.2.0": + soplex: "7.1.2" + default_sym: "snauty" + "9.0.1": + soplex: "7.0.1" + default_sym: "bliss" + "8.1.0": + soplex: "6.0.4" + default_sym: "bliss" + "8.0.4": + soplex: "6.0.4" + default_sym: "bliss" + "8.0.3": + soplex: "6.0.3" + default_sym: "bliss" diff --git a/recipes/scip/all/conanfile.py b/recipes/scip/all/conanfile.py index 30a113fa5330e..0c642f80cc866 100644 --- a/recipes/scip/all/conanfile.py +++ b/recipes/scip/all/conanfile.py @@ -3,7 +3,7 @@ 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.files import apply_conandata_patches, export_conandata_patches, copy, get from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.scm import Version from os.path import join @@ -25,19 +25,13 @@ class SCIPConan(ConanFile): "fPIC": [True, False], "with_gmp": [True, False], "with_tpi": [False, "omp", "tny"], - "with_sym": [False, "bliss"], + "with_sym": [False, "bliss", "snauty"], } 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" + "with_tpi": False } @property @@ -52,6 +46,9 @@ def _compilers_minimum_version(self): "apple-clang": "7", } + def export_sources(self): + export_conandata_patches(self) + def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) @@ -71,22 +68,31 @@ def validate(self): 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.") + if Version(self.version) >= "9.0.1" and is_msvc(self) and self.settings.build_type == "Debug": + # lpi_spx2.cpp : error C1128: number of sections exceeded object file format limit: compile with /bigobj + raise ConanInvalidConfiguration(f"{self.ref} can not be build in Debug with 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 - def requirements(self): + def _mapping_requires(dep, **kwargs): + required_version = self.conan_data["version_mappings"][self.version][dep] + self.requires(f"{dep}/{required_version}", **kwargs) + 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]}") + _mapping_requires("soplex") self.requires("zlib/[>=1.2.11 <2]") + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.options.with_sym == None: + self.options.with_sym = self.conan_data["version_mappings"][self.version]["default_sym"] + def configure(self): self.options["soplex"].with_gmp = self.options.with_gmp if self.options.shared: @@ -100,6 +106,7 @@ def _to_cmake(*arrays): return ";".join(item.replace("\\", "/") for sublist in arrays for item in sublist) def generate(self): + apply_conandata_patches(self) tc = CMakeToolchain(self) tc.variables["SHARED"] = self.options.shared tc.variables["READLINE"] = False # required for interactive stuff @@ -120,6 +127,7 @@ def generate(self): tc.variables["PAPILO"] = False # LGPL tc.variables["ZIMPL"] = False # LPGL tc.variables["IPOPT"] = False # no such coin package on conan center yet + tc.variables["BUILD_TESTING"] = False # do not build documentation and examples tc.generate() deps = CMakeDeps(self) deps.set_property("sopex", "cmake_file_name", "SOPEX") diff --git a/recipes/scip/all/patches/0001-bliss-include-dir.patch b/recipes/scip/all/patches/0001-bliss-include-dir.patch new file mode 100644 index 0000000000000..c47daafc7bbb7 --- /dev/null +++ b/recipes/scip/all/patches/0001-bliss-include-dir.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c23a1a85c9..f288b2b89d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -133,11 +133,10 @@ if(SYM STREQUAL "bliss" OR SYM STREQUAL "sbliss") + + find_package(Bliss CONFIG HINTS ${BLISS_DIR}) + if(Bliss_FOUND) +- get_filename_component(BLISS_ABSOLUTE_PATH ${Bliss_DIR}/../../.. REALPATH) +- include_directories(${BLISS_ABSOLUTE_PATH}/include) +- set(SYM_LIBRARIES ${BLISS_ABSOLUTE_PATH}/lib/libbliss.a) +- set(SYM_PIC_LIBRARIES ${BLISS_ABSOLUTE_PATH}/lib/libbliss.a) +- message(STATUS "Found Bliss: ${BLISS_ABSOLUTE_PATH}") ++ include_directories("${bliss_INCLUDE_DIRS}") ++ set(SYM_LIBRARIES "bliss::bliss") ++ set(SYM_PIC_LIBRARIES "bliss::bliss") ++ message(STATUS "Found Bliss via Conan") + else() + # Utilities to automatically download missing dependencies + include(cmake/Dependencies.cmake) diff --git a/recipes/scip/config.yml b/recipes/scip/config.yml index f70b85bc6cf44..73c7b80b6ca0b 100644 --- a/recipes/scip/config.yml +++ b/recipes/scip/config.yml @@ -1,4 +1,8 @@ versions: + "9.2.0": + folder: all + "9.0.1": + folder: all "8.1.0": folder: all "8.0.4": diff --git a/recipes/scippp/all/conandata.yml b/recipes/scippp/all/conandata.yml index 88b2816d64354..39c343801470f 100644 --- a/recipes/scippp/all/conandata.yml +++ b/recipes/scippp/all/conandata.yml @@ -1,7 +1,14 @@ sources: + "1.2.0": + url: "https://github.com/scipopt/SCIPpp/archive/refs/tags/1.2.0.tar.gz" + sha256: "8fa4b819734b9841eda1ec1c9266fb07144be490c3f24be46271c538ab18da61" "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" +scip_mapping: + "1.2.0": "9.0.1" + "1.1.0": "8.0.4" + "1.0.2": "8.0.4" diff --git a/recipes/scippp/all/conanfile.py b/recipes/scippp/all/conanfile.py index 77b8d49bdb43c..55ee8105f9224 100644 --- a/recipes/scippp/all/conanfile.py +++ b/recipes/scippp/all/conanfile.py @@ -76,7 +76,7 @@ def configure(self): 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) + self.requires(f"scip/{self.conan_data['scip_mapping'][self.version]}", transitive_headers=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/scippp/all/test_package/CMakeLists.txt b/recipes/scippp/all/test_package/CMakeLists.txt index 877c0c21bd3c0..e32c2cd907e43 100644 --- a/recipes/scippp/all/test_package/CMakeLists.txt +++ b/recipes/scippp/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) set(CMAKE_CXX_STANDARD 17) diff --git a/recipes/scippp/config.yml b/recipes/scippp/config.yml index a59308932f1d8..eb9a4f6036cd3 100644 --- a/recipes/scippp/config.yml +++ b/recipes/scippp/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "1.0.2": diff --git a/recipes/scnlib/all/conandata.yml b/recipes/scnlib/all/conandata.yml index fc615b57c8109..14fe174ba433a 100644 --- a/recipes/scnlib/all/conandata.yml +++ b/recipes/scnlib/all/conandata.yml @@ -1,48 +1,13 @@ 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" - "1.0": - url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v1.0.tar.gz" - sha256: "5b8333e522206c2a74e57a9c9544c4fe4e7858cfe93e216905b463eaf91af5fe" - "0.4": - 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" - patch_type: "portability" - - patch_file: "patches/1.1.2-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.2-0003-fix-link-keyword.patch" - patch_description: "use PRIVATE instead of INTERFACE" - patch_type: "conan" - "1.0": - - patch_file: "patches/1.0-0001-install-dll-windows.patch" - patch_description: "add runtime destination path on install" - patch_type: "portability" - - patch_file: "patches/1.0-0002-remove-header-only-target.patch" - patch_description: "prevent to generate header only target for conan package" - patch_type: "conan" - - patch_file: "patches/1.0-0003-use-conan-package.patch" - patch_description: "use conan package of fast-float" - patch_type: "conan" - "0.4": - - patch_file: "patches/0.4-0001-install-dll-windows.patch" - patch_description: "add runtime destination path on install" - patch_type: "portability" + "4.0.1": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v4.0.1.tar.gz" + sha256: "ece17b26840894cc57a7127138fe4540929adcb297524dec02c490c233ff46a7" + "3.0.2": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v3.0.2.tar.gz" + sha256: "27f17420ddad6971339e6d5db0d915204181c31f5cb0e92a63b9998d98e2852b" + "3.0.1": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v3.0.1.tar.gz" + sha256: "bc8a668873601d00cce6841c2d0f2c93f836f63f0fbc77997834dea12e951eb1" + "2.0.3": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v2.0.3.tar.gz" + sha256: "507ed0e988f1d9460a9c921fc21f5a5244185a4015942f235522fbe5c21e6a51" diff --git a/recipes/scnlib/all/conanfile.py b/recipes/scnlib/all/conanfile.py index 3760576fb6438..24ceccc7b0a31 100644 --- a/recipes/scnlib/all/conanfile.py +++ b/recipes/scnlib/all/conanfile.py @@ -1,14 +1,15 @@ from conan import ConanFile -from conan.tools.microsoft import check_min_vs -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir +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.layout import basic_layout from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class ScnlibConan(ConanFile): name = "scnlib" @@ -23,54 +24,75 @@ class ScnlibConan(ConanFile): "header_only": [True, False], "shared": [True, False], "fPIC": [True, False], + "regex_backend": ["None", "std", "boost", "boost_icu", "re2"], } default_options = { "header_only": False, "shared": False, "fPIC": True, + "regex_backend": "std", } @property def _min_cppstd(self): - return 11 - - def export_sources(self): - export_conandata_patches(self) + # scn/2.0.0 has complation error on MSVC c++17 + # we have to use versions which support c++20 + # https://github.com/eliaskosunen/scnlib/issues/97 + # https://github.com/conan-io/conan-center-index/pull/22455#issuecomment-1924444193 + return "20" if is_msvc(self) else "17" def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.options.header_only or self.options.shared: + if self.options.get_safe("header_only") or self.options.shared: self.options.rm_safe("fPIC") - if self.options.header_only: + if self.options.get_safe("header_only"): del self.options.shared + self.package_type = "header-library" def layout(self): - if self.options.header_only: + if self.options.get_safe("header_only"): basic_layout(self, src_folder="src") else: cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) >= "1.0": - self.requires("fast_float/6.0.0") - - def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_cppstd) - check_min_vs(self, 192 if Version(self.version) >= "1.0" else 191) + self.requires("fast_float/6.1.0") + if Version(self.version) < "3.0": + self.requires("simdutf/4.0.5") + if self.options.get_safe("regex_backend") in ["boost", "boost_icu"]: + self.requires("boost/1.83.0") + elif self.options.get_safe("regex_backend") == "re2": + self.requires("re2/20231101") def package_id(self): - if self.info.options.header_only: + if self.info.options.get_safe("header_only"): self.info.clear() + def validate(self): + check_min_cppstd(self, self._min_cppstd) + + if self.options.get_safe("regex_backend") == "boost_icu" and \ + not self.dependencies["boost"].options.get_safe("i18n_backend_icu"): + raise ConanInvalidConfiguration( + f"{self.ref} with regex_backend=Boost_icu option requires boost::i18n_backend_icu to be enabled." + ) + # TODO: This should probably be a del self.options.header_only in config_options once the CI supports it + if self.options.header_only: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support header only mode.") + if Version(self.version) < "3.0.2" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "11": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc 11.x due to std::regex_constants::multiline is not defined.") + + 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): - if self.options.header_only: + if self.options.get_safe("header_only"): return tc = CMakeToolchain(self) @@ -80,54 +102,57 @@ def generate(self): tc.variables["SCN_DOCS"] = False tc.variables["SCN_INSTALL"] = True tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True - if Version(self.version) >= "1.0": - tc.variables["SCN_USE_BUNDLED_FAST_FLOAT"] = False + + tc.variables["SCN_USE_EXTERNAL_SIMDUTF"] = True + tc.variables["SCN_USE_EXTERNAL_FAST_FLOAT"] = True + tc.variables["SCN_BENCHMARKS_BUILDTIME"] = False + tc.variables["SCN_BENCHMARKS_BINARYSIZE"] = False + tc.variables["SCN_DISABLE_REGEX"] = self.options.regex_backend is None + if self.options.regex_backend is not None: + tc.variables["SCN_REGEX_BACKEND"] = self.options.regex_backend + tc.variables["SCN_USE_EXTERNAL_REGEX_BACKEND"] = True tc.generate() deps = CMakeDeps(self) deps.generate() def build(self): - apply_conandata_patches(self) - if not self.options.header_only: + if not self.options.get_safe("header_only"): 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) - if self.options.header_only: + if self.options.get_safe("header_only"): copy(self, "*", dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include")) src_folder = os.path.join(self.source_folder, "src") - if Version(self.version) >= "1.0": - copy(self, "reader_*.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "reader")) - copy(self, "vscan.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "scan")) - copy(self, "locale.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "detail")) - copy(self, "file.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "detail")) - else: - copy(self, "*.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "detail")) + copy(self, "reader_*.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "reader")) + copy(self, "vscan.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "scan")) + copy(self, "locale.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "detail")) + copy(self, "file.cpp", src=src_folder, dst=os.path.join(self.package_folder, "include", "scn", "detail")) else: cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "share")) - if Version(self.version) >= "1.0": - rm(self, "*.cmake", os.path.join(self.package_folder, "include", "scn", "detail")) - rmdir(self, os.path.join(self.package_folder, "include", "scn", "detail", "CMakeFiles")) - rmdir(self, os.path.join(self.package_folder, "include", "scn", "detail", "deps", "CMakeFiles")) + rm(self, "*.cmake", os.path.join(self.package_folder, "include", "scn", "detail")) + rmdir(self, os.path.join(self.package_folder, "include", "scn", "detail", "CMakeFiles")) + rmdir(self, os.path.join(self.package_folder, "include", "scn", "detail", "deps", "CMakeFiles")) def package_info(self): - target = "scn-header-only" if self.options.header_only else "scn" + target = "scn-header-only" if self.options.get_safe("header_only") else "scn" self.cpp_info.set_property("cmake_file_name", "scn") self.cpp_info.set_property("cmake_target_name", f"scn::{target}") # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - if self.options.header_only: + if self.options.get_safe("header_only"): self.cpp_info.components["_scnlib"].defines = ["SCN_HEADER_ONLY=1"] else: self.cpp_info.components["_scnlib"].defines = ["SCN_HEADER_ONLY=0"] self.cpp_info.components["_scnlib"].libs = ["scn"] - if Version(self.version) >= "1.0": - self.cpp_info.components["_scnlib"].requires = ["fast_float::fast_float"] + self.cpp_info.components["_scnlib"].requires.append("fast_float::fast_float") + if Version(self.version) < "3.0": + self.cpp_info.components["_scnlib"].requires.append("simdutf::simdutf") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["_scnlib"].system_libs.append("m") diff --git a/recipes/scnlib/all/patches/0.4-0001-install-dll-windows.patch b/recipes/scnlib/all/patches/0.4-0001-install-dll-windows.patch deleted file mode 100644 index 8928ce2f8c250..0000000000000 --- a/recipes/scnlib/all/patches/0.4-0001-install-dll-windows.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -145,6 +145,7 @@ if (SCN_INSTALL) - - install(TARGETS ${SCN_EXPORT_TARGETS_LIST} - 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.0-0001-install-dll-windows.patch b/recipes/scnlib/all/patches/1.0-0001-install-dll-windows.patch deleted file mode 100644 index c2d5fe9c223ea..0000000000000 --- a/recipes/scnlib/all/patches/1.0-0001-install-dll-windows.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d960eb9..c914832 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -167,6 +167,7 @@ if (SCN_INSTALL) - - install(TARGETS ${SCN_EXPORT_TARGETS_LIST} - 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.0-0002-remove-header-only-target.patch b/recipes/scnlib/all/patches/1.0-0002-remove-header-only-target.patch deleted file mode 100644 index 6c35d57c4ca41..0000000000000 --- a/recipes/scnlib/all/patches/1.0-0002-remove-header-only-target.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c914832..1aba404 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -106,12 +106,10 @@ function(generate_header_only_target target_name) - endfunction() - - generate_library_target(scn) --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) - - set_property(TARGET scn PROPERTY SOVERSION 0) - diff --git a/recipes/scnlib/all/patches/1.0-0003-use-conan-package.patch b/recipes/scnlib/all/patches/1.0-0003-use-conan-package.patch deleted file mode 100644 index 5b5354a04f783..0000000000000 --- a/recipes/scnlib/all/patches/1.0-0003-use-conan-package.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1aba404..f0c4b94 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -48,6 +48,8 @@ if (NOT (${CMAKE_VERSION} VERSION_LESS "3.9.0")) - cmake_policy(SET CMP0069 NEW) - endif () - -+find_package(FastFloat REQUIRED) -+ - include(sanitizers) - include(flags) - -@@ -83,8 +85,8 @@ function(generate_library_target target_name) - target_include_directories(${target_name} PRIVATE - $) - else () -- target_link_libraries(${target_name} INTERFACE -- fast_float) -+ target_link_libraries(${target_name} PRIVATE -+ FastFloat::fast_float) - endif () - endfunction() - function(generate_header_only_target target_name) -@@ -100,8 +102,8 @@ function(generate_header_only_target target_name) - target_include_directories(${target_name} INTERFACE - $) - else () -- target_link_libraries(${target_name} INTERFACE -- fast_float) -+ target_link_libraries(${target_name} PRIVATE -+ FastFloat::fast_float) - endif () - endfunction() - diff --git a/recipes/scnlib/all/patches/1.1.2-0001-install-dll-windows.patch b/recipes/scnlib/all/patches/1.1.2-0001-install-dll-windows.patch deleted file mode 100644 index ee64fa9407251..0000000000000 --- a/recipes/scnlib/all/patches/1.1.2-0001-install-dll-windows.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f1864c6..b42736e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -171,6 +171,7 @@ if (SCN_INSTALL) - - install(TARGETS ${SCN_EXPORT_TARGETS_LIST} - 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.2-0002-remove-header-only-target.patch b/recipes/scnlib/all/patches/1.1.2-0002-remove-header-only-target.patch deleted file mode 100644 index 08f98586c6b5b..0000000000000 --- a/recipes/scnlib/all/patches/1.1.2-0002-remove-header-only-target.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b42736e..87cb1f7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -110,12 +110,10 @@ function(generate_header_only_target target_name) - endfunction() - - generate_library_target(scn) --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) - - set_property(TARGET scn PROPERTY SOVERSION 0) - diff --git a/recipes/scnlib/all/patches/1.1.2-0003-fix-link-keyword.patch b/recipes/scnlib/all/patches/1.1.2-0003-fix-link-keyword.patch deleted file mode 100644 index 9fedf6c33071c..0000000000000 --- a/recipes/scnlib/all/patches/1.1.2-0003-fix-link-keyword.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 87cb1f7..4524490 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -87,7 +87,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() -@@ -104,7 +104,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/all/patches/1.1.3-0001-install-dll-windows.patch b/recipes/scnlib/all/patches/1.1.3-0001-install-dll-windows.patch deleted file mode 100644 index 97cf567063d67..0000000000000 --- a/recipes/scnlib/all/patches/1.1.3-0001-install-dll-windows.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 5a50483b54c0f..0000000000000 --- a/recipes/scnlib/all/patches/1.1.3-0002-remove-header-only-target.patch +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 1b34af4ceeb25..0000000000000 --- a/recipes/scnlib/all/patches/1.1.3-0003-fix-link-keyword.patch +++ /dev/null @@ -1,22 +0,0 @@ -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/all/test_package/CMakeLists.txt b/recipes/scnlib/all/test_package/CMakeLists.txt index 0c68330d44cd3..f81573559c690 100644 --- a/recipes/scnlib/all/test_package/CMakeLists.txt +++ b/recipes/scnlib/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(scn REQUIRED CONFIG) @@ -9,4 +9,9 @@ if(TARGET scn::scn-header-only) else() target_link_libraries(${PROJECT_NAME} PRIVATE scn::scn) endif() -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if (scn_VERSION VERSION_LESS "2.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + target_compile_definitions(${PROJECT_NAME} PUBLIC SCNLIB_V2) +endif() diff --git a/recipes/scnlib/all/test_package/test_package.cpp b/recipes/scnlib/all/test_package/test_package.cpp index 148a9caff4852..276439b1c0eb3 100644 --- a/recipes/scnlib/all/test_package/test_package.cpp +++ b/recipes/scnlib/all/test_package/test_package.cpp @@ -1,9 +1,27 @@ +#include +#include + +#ifndef SCNLIB_V2 + #include -#include +int main() { + std::string word; + auto result = scn::scan("Hello world", "{}", word); + std::cout << word << '\n'; + std::cout << result.range_as_string() << '\n'; +} + +#else + +#include int main() { - std::string s{"conan-center-index"}; - auto span = scn::make_span(s); - return 0; + if (auto result = scn::scan("Hello world!", "{}")) { + std::cout << result->value() << '\n'; + } else { + std::cout << "Couldn't parse a word: " << result.error().msg() << '\n'; + } } + +#endif diff --git a/recipes/scnlib/all/test_v1_package/CMakeLists.txt b/recipes/scnlib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/scnlib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/scnlib/all/test_v1_package/conanfile.py b/recipes/scnlib/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/scnlib/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/scnlib/config.yml b/recipes/scnlib/config.yml index 3305d97b32797..a66959b861c3f 100644 --- a/recipes/scnlib/config.yml +++ b/recipes/scnlib/config.yml @@ -1,9 +1,9 @@ versions: - "1.1.3": + "4.0.1": folder: all - "1.1.2": + "3.0.2": folder: all - "1.0": + "3.0.1": folder: all - "0.4": + "2.0.3": folder: all 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/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/scope-lite/all/test_package/CMakeLists.txt b/recipes/scope-lite/all/test_package/CMakeLists.txt index f9df37a1d3e63..249c9b14c66d3 100644 --- a/recipes/scope-lite/all/test_package/CMakeLists.txt +++ b/recipes/scope-lite/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(scope-lite REQUIRED CONFIG) diff --git a/recipes/scope-lite/all/test_v1_package/CMakeLists.txt b/recipes/scope-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8cf0930ee8587..0000000000000 --- a/recipes/scope-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(scope-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::scope-lite) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/scope-lite/all/test_v1_package/conanfile.py b/recipes/scope-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/scope-lite/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_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/screen_capture_lite/all/test_package/CMakeLists.txt b/recipes/screen_capture_lite/all/test_package/CMakeLists.txt index 920e6c9d22764..e67c72084b2fb 100644 --- a/recipes/screen_capture_lite/all/test_package/CMakeLists.txt +++ b/recipes/screen_capture_lite/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(screen_capture_lite REQUIRED CONFIG) diff --git a/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt b/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/screen_capture_lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/screen_capture_lite/all/test_v1_package/conanfile.py b/recipes/screen_capture_lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/screen_capture_lite/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/sdbus-cpp/all/conandata.yml b/recipes/sdbus-cpp/all/conandata.yml index ac3e9f3df9188..597865c12dd7d 100644 --- a/recipes/sdbus-cpp/all/conandata.yml +++ b/recipes/sdbus-cpp/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.0.0": + url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v2.0.0.tar.gz" + sha256: "88af4569161a0d0192f0f4a94582a1af4e75722499d06984fb7f91f638f5afb3" + "1.5.0": + url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.5.0.tar.gz" + sha256: "577986929f911320fb9ef6a3e2badd464dc38411ebc25d2966f5cb85c39f0897" + "1.4.0": + url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.4.0.tar.gz" + sha256: "ca7405c7f0f9ae3023dcfa37bc68974c4b8a1c9ea2909b970e0aedc3e8657ee6" "1.3.0": url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.3.0.tar.gz" sha256: "d44f59abdd64d8f1ca3af7db58bc6518cb081fc9ff16285c3d75a68f5c073d10" @@ -14,15 +23,3 @@ sources: "0.8.3": url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v0.8.3.tar.gz" sha256: "0fd575ae0f463773dd9141242d1133731e2b780fd6526650ce992ba711d88628" - -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: "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: "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 1f8bc66668fef..18ebec3e55883 100644 --- a/recipes/sdbus-cpp/all/conanfile.py +++ b/recipes/sdbus-cpp/all/conanfile.py @@ -3,11 +3,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.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir +from conan.tools.gnu import PkgConfigDeps from conan.tools.scm import Version -required_conan_version = ">=1.51.0" +required_conan_version = ">=1.55.0" class SdbusCppConan(ConanFile): @@ -24,13 +26,14 @@ class SdbusCppConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_code_gen": [True, False], + "with_sdbus": ["systemd", "basu"], } default_options = { "shared": False, "fPIC": True, "with_code_gen": False, + "with_sdbus": "systemd", } - generators = "PkgConfigDeps", "VirtualBuildEnv" @property def _minimum_cpp_standard(self): @@ -38,15 +41,26 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): + # non-trivial designated initializers are not supported in gcc < 8 + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55606 return { - "gcc": "7", + "gcc": "7" if Version(self.version) < "2.0.0" else "8", "clang": "6", } - 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) + @property + def _supported_os(self): + return (["Linux"] if Version(self.version) < "1.4.0" + else ["Linux", "FreeBSD"]) + + @property + def _with_sdbus(self): + return ("basu" if self.settings.os == "FreeBSD" + else self.options.get_safe("with_sdbus", "systemd")) + + def config_options(self): + if Version(self.version) < "1.4.0" or self.settings.os != "Linux": + del self.options.with_sdbus def configure(self): if Version(self.version) < "0.9.0": @@ -55,49 +69,63 @@ def configure(self): if self.options.shared: del self.options.fPIC + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): - self.requires("libsystemd/253.10") + if self._with_sdbus == "systemd": + self.requires("libsystemd/255.2") + elif self._with_sdbus == "basu": + self.requires("basu/0.2.1") + if self.options.with_code_gen: + # Trick: always force transitive_libs=False, in order to not propagate expat lib + # transitively even when sdbus-cpp is static, since expat is a dependency of the executable, not the lib + self.requires("expat/[>=2.6.2 <3]", transitive_libs=False) def validate(self): - if self.info.settings.os != "Linux": - raise ConanInvalidConfiguration(f"{self.name} only supports Linux") + if self.settings.os not in self._supported_os: + raise ConanInvalidConfiguration( + f"{self.ref} does not support {self.settings.os}") - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get(str(self.info.settings.compiler)) - if not min_version: - self.output.warning("{} recipe lacks information about the {} compiler support.".format( - self.name, self.info.settings.compiler)) - else: - if Version(self.info.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.info.settings.compiler, self.info.settings.compiler.version)) + min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) + if min_version and 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 build_requirements(self): - self.tool_requires("pkgconf/2.0.3") - if self.options.with_code_gen: - self.tool_requires("expat/2.5.0") - - def layout(self): - cmake_layout(self, src_folder="src") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") 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["BUILD_CODE_GEN"] = self.options.with_code_gen + if Version(self.version) >= "2.0.0": + tc.variables["SDBUSCPP_BUILD_CODEGEN"] = self.options.with_code_gen + else: + tc.variables["BUILD_CODE_GEN"] = self.options.with_code_gen tc.variables["BUILD_DOC"] = False tc.variables["BUILD_TESTS"] = False tc.variables["BUILD_LIBSYSTEMD"] = False + tc.variables["SDBUSCPP_BUILD_DOCS"] = False + tc.variables["SDBUSCPP_SDBUS_LIB"] = self._with_sdbus tc.generate() - # workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/18150 - copy(self, "*.pc", self.generators_folder, - os.path.join(self.generators_folder, "lib", "pkgconfig")) + deps = PkgConfigDeps(self) + deps.generate() + + if self.options.with_code_gen: + deps = CMakeDeps(self) + deps.set_property("expat", "cmake_file_name", "EXPAT") + deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -131,9 +159,16 @@ def package_info(self): "cmake_target_name", "SDBusCpp::sdbus-c++") self.cpp_info.components["sdbus-c++"].set_property( "pkg_config_name", "sdbus-c++") - self.cpp_info.components["sdbus-c++"].requires.append( - "libsystemd::libsystemd") + if self._with_sdbus == "systemd": + self.cpp_info.components["sdbus-c++"].requires.append( + "libsystemd::libsystemd") + elif self._with_sdbus == "basu": + self.cpp_info.components["sdbus-c++"].requires.append( + "basu::basu") + if self.options.with_code_gen: + # Not a dependency of the lib, only of executable, but there is no way to modelize this + # with conan + self.cpp_info.components["sdbus-c++"].requires.append("expat::expat") if self.options.with_code_gen: 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/sdbus-cpp/all/patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch b/recipes/sdbus-cpp/all/patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch deleted file mode 100644 index 3d0422bc85f54..0000000000000 --- a/recipes/sdbus-cpp/all/patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch +++ /dev/null @@ -1,35 +0,0 @@ -From fb008445b15b452f461c34667f4991f5ce06e481 Mon Sep 17 00:00:00 2001 -From: bobrofon -Date: Fri, 12 Mar 2021 19:17:55 +0700 -Subject: [PATCH] xml2cpp: Add missing EXPAT include dirs (#136) - -This patch is required if EXPAT library is installed in non-standard location. -Without 'target_include_directories' cmake will find EXPAT library: - ... - -- Found EXPAT: .../lib/libexpat.a (found version "2.2.10") - ... - -But 'xml.cpp' compilation will fail with error: - ... - tools/xml2cpp-codegen/xml.cpp:7:10: fatal error: expat.h: No such file or directory - 7 | #include - ... ---- - tools/CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 375c379..8d7a3d0 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -43,6 +43,7 @@ set(CMAKE_CXX_STANDARD 14) - - add_executable(sdbus-c++-xml2cpp ${SDBUSCPP_XML2CPP_SRCS}) - target_link_libraries (sdbus-c++-xml2cpp ${EXPAT_LIBRARIES}) -+target_include_directories(sdbus-c++-xml2cpp PRIVATE ${EXPAT_INCLUDE_DIRS}) - - #---------------------------------- - # INSTALLATION --- -2.31.1 - diff --git a/recipes/sdbus-cpp/all/patches/0002-correct-readme-cpack-resource-path.patch b/recipes/sdbus-cpp/all/patches/0002-correct-readme-cpack-resource-path.patch deleted file mode 100644 index 5b37424cc3112..0000000000000 --- a/recipes/sdbus-cpp/all/patches/0002-correct-readme-cpack-resource-path.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --color -Naur --label a/CMakeLists.txt --label b/CMakeLists.txt a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -180,7 +180,6 @@ - #---------------------------------- - - option(BUILD_DOC "Build documentation for sdbus-c++" ON) -- - if(BUILD_DOC) - message(STATUS "Building with documentation") - option(BUILD_DOXYGEN_DOC "Build doxygen documentation for sdbus-c++ API" OFF) -@@ -217,7 +216,7 @@ - set(CPACK_PACKAGE_VENDOR "Kistler") - set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "high-level C++ D-Bus library") - set(CPACK_PACKAGE_CONTACT "info@kistler.com") --set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") -+set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") - set(CPACK_COMPONENTS_ALL runtime dev doc) - set(CPACK_COMPONENT_DEV_DEPENDS "runtime") - diff --git a/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py b/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py index 8706e3310f0bf..3b0485074eb5d 100644 --- a/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py +++ b/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py @@ -3,7 +3,6 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout -from conan.tools.files import copy class SdbusCppTestConan(ConanFile): @@ -11,19 +10,14 @@ class SdbusCppTestConan(ConanFile): generators = "CMakeToolchain", "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv" test_type = "explicit" + def layout(self): + cmake_layout(self) + def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("pkgconf/2.0.3") - - def layout(self): - cmake_layout(self) - - def generate(self): - # workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/18150 - copy(self, "*.pc", self.generators_folder, - os.path.join(self.generators_folder, "lib", "pkgconfig")) + self.tool_requires("pkgconf/[>=2.2 <3]") def build(self): cmake = CMake(self) diff --git a/recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py b/recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py index 47a93884e54ef..710a613734954 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/2.0.3") + self.tool_requires("pkgconf/[>=2.2 <3]") def build(self): cmake = CMake(self) diff --git a/recipes/sdbus-cpp/config.yml b/recipes/sdbus-cpp/config.yml index a48eafa88431d..b633474143962 100644 --- a/recipes/sdbus-cpp/config.yml +++ b/recipes/sdbus-cpp/config.yml @@ -1,4 +1,10 @@ versions: + "2.0.0": + folder: all + "1.5.0": + folder: all + "1.4.0": + folder: all "1.3.0": folder: all "1.2.0": diff --git a/recipes/sdf/all/test_package/CMakeLists.txt b/recipes/sdf/all/test_package/CMakeLists.txt index afcf11bbd8776..29675b89b0d57 100644 --- a/recipes/sdf/all/test_package/CMakeLists.txt +++ b/recipes/sdf/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) find_package(sdf REQUIRED CONFIG) -find_package(stb REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE sdf::sdf stb::stb) +target_link_libraries(${PROJECT_NAME} PRIVATE sdf::sdf) diff --git a/recipes/sdf/all/test_package/conanfile.py b/recipes/sdf/all/test_package/conanfile.py index ad5b8f9465ed6..0a6bc68712d90 100644 --- a/recipes/sdf/all/test_package/conanfile.py +++ b/recipes/sdf/all/test_package/conanfile.py @@ -14,7 +14,6 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("stb/cci.20210910") def build(self): cmake = CMake(self) @@ -24,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_path = os.path.join(self.source_folder, "test.png") - self.run(f"{bin_path} {img_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/sdf/all/test_package/test.png b/recipes/sdf/all/test_package/test.png deleted file mode 100644 index 568aa3449320a..0000000000000 Binary files a/recipes/sdf/all/test_package/test.png and /dev/null differ diff --git a/recipes/sdf/all/test_package/test_package.c b/recipes/sdf/all/test_package/test_package.c index 808fd873709a9..01f233e85fca3 100644 --- a/recipes/sdf/all/test_package/test_package.c +++ b/recipes/sdf/all/test_package/test_package.c @@ -3,35 +3,14 @@ #define SDF_IMPLEMENTATION #include "sdf.h" -#define STB_IMAGE_IMPLEMENTATION -#include "stb_image.h" - int main(int argc, char **argv) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - - int width, height, bpp; - unsigned char* img_data = stbi_load(argv[1], &width, &height, &bpp, 0); - if(img_data == NULL) - { - fprintf(stderr, "Could not load image: %s\n", stbi_failure_reason()); - return 1; - } - - unsigned char* dest_data = malloc(width * height * bpp); - if(dest_data == NULL) - { - stbi_image_free(img_data); - return 1; - } - - sdfBuildDistanceField(dest_data, width, 2.0f, img_data, width, height, width); + unsigned char* dest_data = malloc(0); + int result = sdfBuildDistanceField(dest_data, 0, 2.0f, NULL, 0, 0, 0); + printf("Result: %d\n", result); + printf("Test"); free(dest_data); - stbi_image_free(img_data); return 0; } diff --git a/recipes/sdf/all/test_v1_package/CMakeLists.txt b/recipes/sdf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index ee4e3e06a56c5..0000000000000 --- a/recipes/sdf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(sdf REQUIRED CONFIG) -find_package(stb REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE sdf::sdf stb::stb) diff --git a/recipes/sdf/all/test_v1_package/conanfile.py b/recipes/sdf/all/test_v1_package/conanfile.py deleted file mode 100644 index 855f0ca3462a1..0000000000000 --- a/recipes/sdf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +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 requirements(self): - self.requires("stb/cci.20210910") - - 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") - img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.png") - self.run(f"{bin_path} {img_path}", run_environment=True) diff --git a/recipes/sdl/3.x/conandata.yml b/recipes/sdl/3.x/conandata.yml new file mode 100644 index 0000000000000..a26a34e593852 --- /dev/null +++ b/recipes/sdl/3.x/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.2.14": + url: "https://github.com/libsdl-org/SDL/releases/download/release-3.2.14/SDL3-3.2.14.tar.gz" + sha256: "b7e7dc05011b88c69170fe18935487b2559276955e49113f8c1b6b72c9b79c1f" + "3.2.6": + url: "https://github.com/libsdl-org/SDL/releases/download/release-3.2.6/SDL3-3.2.6.tar.gz" + sha256: "096a0b843dd1124afda41c24bd05034af75af37e9a1b9d205cc0a70193b27e1a" diff --git a/recipes/sdl/3.x/conanfile.py b/recipes/sdl/3.x/conanfile.py new file mode 100644 index 0000000000000..3e8560e7a0218 --- /dev/null +++ b/recipes/sdl/3.x/conanfile.py @@ -0,0 +1,482 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.files import get, replace_in_file, copy, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.scm import Version +import os + +required_conan_version = ">=2" + +_subsystems = [ + ("audio", []), + ("video", []), + ("gpu", ["video"]), + ("render", ["video"]), + ("camera", ["video"]), + ("joystick", []), + ("haptic", ["joystick"]), + ("hidapi", []), + ("power", []), + ("sensor", []), + ("dialog", []), +] + +class SDLConan(ConanFile): + name = "sdl" + description = "A cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libsdl.org" + topics = ("sdl3", "audio", "keyboard", "graphics", "opengl") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + + options = { + **{ + "shared": [True, False], + "fPIC": [True, False], + }, + **{subsystem: [True, False] for subsystem, _ in _subsystems}, + **{ + "alsa": [True, False], + "pulseaudio": [True, False], + "sndio": [True, False], + "opengl": [True, False], + "opengles": [True, False], + "x11": [True, False], + "xcursor": [True, False], + "xdbe": [True, False], + "xinput": [True, False], + "xfixes": [True, False], + "xrandr": [True, False], + "xscrnsaver": [True, False], + "xshape": [True, False], + "xsync": [True, False], + "wayland": [True, False], + "vulkan": [True, False], + "metal": [True, False], + "directx": [True, False], + "libudev": [True, False], + "dbus": [True, False], + "libusb": [True, False], + "libiconv": [True, False], + } + } + + default_options = { + **{ + "shared": False, + "fPIC": True, + }, + **{subsystem: True for subsystem, _ in _subsystems}, + **{ + ## Audio + # Linux only + "alsa": True, + "pulseaudio": True, + "sndio": True, + ## Video + "opengl": True, + "opengles": True, + "x11": True, + "xcursor": True, + "xdbe": True, + "xinput": True, + "xfixes": True, + "xrandr": True, + "xscrnsaver": True, + "xshape": True, + "xsync": True, + "wayland": True, + "vulkan": True, + "metal": True, + "directx": True, + ## Hidapi + "libusb": True, + ## Other + "libudev": True, + "dbus": True, + "libiconv": False, + } + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + if not self._is_unix_sys: + del self.options.pulseaudio + del self.options.alsa + del self.options.sndio + del self.options.libudev + del self.options.dbus + del self.options.x11 + del self.options.xcursor + del self.options.xdbe + del self.options.xinput + del self.options.xfixes + del self.options.xrandr + del self.options.xscrnsaver + del self.options.xshape + del self.options.xsync + del self.options.wayland + + if not is_apple_os(self): + del self.options.metal + + if self.settings.os != "Windows": + del self.options.directx + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + if not (self.settings.os == "Android" and self.options.get_safe("hidapi")): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + if not self.options.get_safe("audio"): + self.options.rm_safe("alsa") + self.options.rm_safe("pulseaudio") + self.options.rm_safe("sndio") + + if not self.options.get_safe("video"): + self.options.rm_safe("opengl") + self.options.rm_safe("opengles") + self.options.rm_safe("x11") + self.options.rm_safe("wayland") + self.options.rm_safe("vulkan") + self.options.rm_safe("metal") + + if not self.options.get_safe("x11"): + self.options.rm_safe("xcursor") + self.options.rm_safe("xdbe") + self.options.rm_safe("xinput") + self.options.rm_safe("xfixes") + self.options.rm_safe("xrandr") + self.options.rm_safe("xscrnsaver") + self.options.rm_safe("xshape") + self.options.rm_safe("xsync") + + if not self.options.get_safe("hidapi"): + self.options.rm_safe("libusb") + + def validate(self): + # If any of the subsystems is enabled, then the corresponding dependencies must be enabled + for subsystem, dependencies in _subsystems: + if self.options.get_safe(subsystem): + for dependency in dependencies: + if not self.options.get_safe(dependency): + raise ConanInvalidConfiguration(f'-o="&:{subsystem}=True" subsystem requires -o="&:{dependency}=True"') + + def validate_build(self): + # TODO: Remove this one new CMakeDeps is default + if conan_version >= "2.12" and self._needs_libusb and self.dependencies["libusb"].options.get_safe("shared", True)\ + and not self.conf.get("tools.cmake.cmakedeps:new"): + raise ConanInvalidConfiguration("SDL with shared libusb requires new CMakeDeps generator") + + if self.settings.os == "Android" and not self.conf.get("user.sdl:android", False): + raise ConanInvalidConfiguration("SDL builds on android require extra configuration on the user's side. " + "Set -c user.sdl:android=True if you understand it and want to build it") + + 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 _is_unix_sys(self): + """ True for UNIX but not Macos/Android""" + return self.settings.os in ("Linux", "FreeBSD") + + @property + def _needs_libusb(self): + return (self.options.get_safe("libusb") and + (not is_apple_os(self) or self.settings.os == "Macos") and + self.settings.os != "Android") + + @property + def _supports_opengl(self): + return (self.options.get_safe("opengl") + and self.settings.os not in ("iOS", "visionOS", "tvOS", "watchOS")) + + @property + def _supports_opengles(self): + return (self.options.get_safe("opengles") + and self.settings.os in ("Android", "iOS", "visionOS", "tvOS", "watchOS")) + + @property + def _supports_dbus(self): + return self.options.get_safe("dbus") and self._is_unix_sys + + def requirements(self): + if self.options.get_safe("libiconv"): + self.requires("libiconv/1.17") + if self._needs_libusb: + self.requires("libusb/1.0.26") + if self._supports_opengl: + self.requires("opengl/system") + if self.options.get_safe("libudev"): + self.requires("libudev/system") + if self._supports_dbus: + self.requires("dbus/1.15.8") + if self.options.get_safe("pulseaudio"): + self.requires("pulseaudio/17.0") + if self.options.get_safe("alsa"): + self.requires("libalsa/[>=1.2 <1.3]") + if self.options.get_safe("sndio"): + self.requires("libsndio/1.9.0") + if self.options.get_safe("wayland"): + self.requires("wayland/1.22.0") + self.requires("xkbcommon/1.6.0") + self.requires("egl/system") + if self.options.get_safe("x11"): + self.requires("xorg/system") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.24 <4]") + if self._is_unix_sys and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + if self.options.get_safe("wayland"): + self.tool_requires("wayland/") # Provides wayland-scanner + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["SDL_SHARED"] = self.options.shared + tc.cache_variables["SDL_STATIC"] = not self.options.shared + tc.cache_variables["SDL_TEST_LIBRARY"] = False + tc.cache_variables["SDL_TESTS"] = False + tc.cache_variables["SDL_EXAMPLES"] = False + tc.cache_variables["SDL_INSTALL_EXAMPLES"] = False + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + tc.cache_variables["SDL_SYSTEM_ICONV_DEFAULT"] = True + tc.cache_variables["SDL_LIBICONV"] = self.options.libiconv + + tc.cache_variables["SDL_JACK"] = False # Jack is not available in CCI + + for subsystem in _subsystems: + tc.cache_variables[f"SDL_{subsystem[0].upper()}"] = self.options.get_safe(subsystem[0]) + + if self._supports_opengl: + tc.cache_variables["SDL_OPENGL"] = True + if self._supports_opengles: + tc.cache_variables["SDL_OPENGLES"] = True + + tc.cache_variables["SDL_HIDAPI_LIBUSB"] = self._needs_libusb + if self._needs_libusb: + # TODO: This is a supported configuration in upstream + tc.cache_variables["SDL_HIDAPI_LIBUSB_SHARED"] = self.dependencies["libusb"].options.get_safe("shared", True) + + tc.variables["SDL_VULKAN"] = self.options.get_safe("vulkan") + tc.variables["SDL_METAL"] = self.options.get_safe("metal") + tc.variables["SDL_DIRECTX"] = self.options.get_safe("directx") + + if self.options.get_safe("pulseaudio"): + tc.cache_variables["SDL_PULSEAUDIO"] = True + tc.cache_variables["SDL_PULSEAUDIO_SHARED"] = self.dependencies["pulseaudio"].options.get_safe("shared", True) + if self.options.get_safe("alsa"): + tc.cache_variables["SDL_ALSA"] = True + tc.cache_variables["SDL_ALSA_SHARED"] = self.dependencies["libalsa"].options.shared + if self.options.get_safe("sndio"): + tc.cache_variables["SDL_SNDIO"] = True + tc.cache_variables["SDL_SNDIO_SHARED"] = True # sndio is always shared + tc.cache_variables["SDL_LIBUDEV"] = self.options.get_safe("libudev", False) + + # X11 and wayland configuration + with_x11 = self.options.get_safe("x11", False) + tc.cache_variables["SDL_X11"] = with_x11 + tc.cache_variables["SDL_X11_SHARED"] = True + if with_x11: + # See https://github.com/bincrafters/community/issues/696 + tc.cache_variables["SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS"] = 1 + tc.cache_variables["SDL_X11_XCURSOR"] = self.options.xcursor + tc.cache_variables["SDL_X11_XDBE"] = self.options.xdbe + tc.cache_variables["SDL_X11_XINPUT"] = self.options.xinput + tc.cache_variables["SDL_X11_XFIXES"] = self.options.xfixes + tc.cache_variables["SDL_X11_XRANDR"] = self.options.xrandr + tc.cache_variables["SDL_X11_XSCRNSAVER"] = self.options.xscrnsaver + tc.cache_variables["SDL_X11_XSHAPE"] = self.options.xshape + tc.cache_variables["SDL_X11_XSYNC"] = self.options.xsync + + with_wayland = self.options.get_safe("wayland", False) + tc.cache_variables["SDL_WAYLAND"] = with_wayland + if with_wayland: + tc.cache_variables["SDL_WAYLAND_SHARED"] = self.dependencies["wayland"].options.shared + if not with_x11 and not with_wayland: + # Disable windowing support: + # https://github.com/libsdl-org/SDL/blob/main/docs/README-cmake.md#cmake-fails-to-build-without-x11-or-wayland-support + tc.cache_variables["SDL_UNIX_CONSOLE_BUILD"] = True + + tc.generate() + deps = CMakeDeps(self) + deps.set_property("libusb", "cmake_target_name", "LibUSB::LibUSB") + deps.set_property("libusb", "cmake_file_name", "LibUSB") + deps.generate() + pcdeps = PkgConfigDeps(self) + pcdeps.generate() + + def _patch_sources(self): + # TODO: Once new CMakeDeps is default, remove this + # Right now this would fail at runtime for shared libusb, but we're + # validating it out for now. The new incubating cmakedeps in 2.12 is required + # to build that configuration, else remove the failing line in the old one + if conan_version < "2.12" or not self.conf.get("tools.cmake.cmakedeps:new"): + replace_in_file(self, os.path.join(self.source_folder, "cmake", "sdlchecks.cmake"), + "target_get_dynamic_library(dynamic_libusb LibUSB::LibUSB)", + "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", self.source_folder, 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")) + + + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SDL3") + + sdl_lib_name = "SDL3" + if (is_msvc(self) or self._is_clang_cl) and not self.options.shared: + sdl_lib_name = f"{sdl_lib_name}-static" + self.cpp_info.components["sdl3"].libs = [sdl_lib_name] + self.cpp_info.components["sdl3"].set_property("cmake_target_name", "SDL3::SDL3") + self.cpp_info.components["sdl3"].set_property("cmake_target_aliases", [ + "SDL3::SDL3-shared" if self.options.shared else "SDL3::SDL3-static", + ]) + + # Target that only contains the include directories + self.cpp_info.components["headers"].set_property("cmake_target_name", "SDL3::Headers") + self.cpp_info.components["headers"].libdirs = [] + + self.cpp_info.components["sdl3"].requires.append("headers") + + if self.settings.os in ("Linux", "FreeBSD", "Macos"): + self.cpp_info.components["sdl3"].system_libs.append("pthread") + + if self.options.get_safe("libiconv"): + self.cpp_info.components["sdl3"].requires.append("libiconv::libiconv") + + if self.options.get_safe("libudev"): + self.cpp_info.components["sdl3"].requires.append("libudev::libudev") + + if self._needs_libusb: + self.cpp_info.components["sdl3"].requires.append("libusb::libusb") + + if self.options.get_safe("dbus"): + self.cpp_info.components["sdl3"].requires.append("dbus::dbus") + + if self.options.get_safe("opengl"): + self.cpp_info.components["sdl3"].requires.append("opengl::opengl") + + if self.options.get_safe("wayland"): + self.cpp_info.components["sdl3"].requires.extend(["wayland::wayland", "xkbcommon::xkbcommon", "egl::egl"]) + + if self.options.get_safe("x11"): + self.cpp_info.components["sdl3"].requires.extend(["xorg::x11", "xorg::xext"]) + # xdbe, xshape and xsync are covered by x11 and xext + if self.options.xcursor: + self.cpp_info.components["sdl3"].requires.append("xorg::xcursor") + if self.options.xinput: + self.cpp_info.components["sdl3"].requires.append("xorg::xi") + if self.options.xfixes: + self.cpp_info.components["sdl3"].requires.append("xorg::xfixes") + if self.options.xrandr: + self.cpp_info.components["sdl3"].requires.append("xorg::xrandr") + if self.options.xscrnsaver: + self.cpp_info.components["sdl3"].requires.append("xorg::xscrnsaver") + + if self.options.get_safe("audio"): + if self.options.get_safe("alsa"): + self.cpp_info.components["sdl3"].requires.append("libalsa::libalsa") + if self.options.get_safe("pulseaudio"): + self.cpp_info.components["sdl3"].requires.append("pulseaudio::pulseaudio") + if self.options.get_safe("sndio"): + self.cpp_info.components["sdl3"].requires.append("libsndio::libsndio") + + if self.settings.os == "Android": + if self.options.get_safe("video"): + self.cpp_info.components["sdl3"].system_libs.extend(["dl", "log", "android"]) + if self.options.get_safe("opengles"): + self.cpp_info.components["sdl3"].system_libs.extend(["GLESv1_CM", "GLESv2"]) + if self.options.get_safe("audio"): + self.cpp_info.components["sdl3"].system_libs.append("OpenSLES") + + # TODO(conan client): when shared, SDL do not need to link against its dependencies but conan will complain about it + if is_apple_os(self) and not self.options.shared: + self.cpp_info.components["sdl3"].frameworks = ["CoreVideo", "Foundation"] + + if self.settings.os == "Macos": + self.cpp_info.components["sdl3"].frameworks.extend(["Cocoa", "Carbon"]) + + if self.options.get_safe("audio"): + self.cpp_info.components["sdl3"].frameworks.extend(["CoreAudio", "AudioToolbox", "AVFoundation"]) + + if self.options.get_safe("video"): + if self.settings.os in ("iOS", "tvOS", "visionOS", "watchOS"): + self.cpp_info.components["sdl3"].frameworks.extend(["CoreGraphics", "QuartzCore", "UIKit"]) + else: + self.cpp_info.components["sdl3"].frameworks.append("UniformTypeIdentifiers") + + if self.options.get_safe("camera"): + if self.settings.os in ("Macos", "iOS"): + self.cpp_info.components["sdl3"].frameworks.append("CoreMedia") + if Version(self.version) >= "3.2.14": + self.cpp_info.components["sdl3"].frameworks.append("AVFoundation") + + if self.options.get_safe("joystick"): + self.cpp_info.components["sdl3"].frameworks.append("GameController") + self.cpp_info.components["sdl3"].sharedlinkflags.append("-Wl,-weak_framework,CoreHaptics") + self.cpp_info.components["sdl3"].exelinkflags.append("-Wl,-weak_framework,CoreHaptics") + if self.settings.os == "Macos": + # Mind that ForceFeedback is also added in haptic system, but haptic depends on joystick + self.cpp_info.components["sdl3"].frameworks.extend(["ForceFeedback", "IOKit"]) + elif self.settings.os in ("iOS", "visionOS", "watchOS"): + self.cpp_info.components["sdl3"].frameworks.append("CoreMotion") + + if self.options.get_safe("hidapi") and self.settings.os in ("iOS", "tvOS"): + self.cpp_info.components["sdl3"].frameworks.append("CoreBluetooth") + + if self.options.get_safe("power") and self.settings.os == "Macos": + self.cpp_info.components["sdl3"].frameworks.append("IOKit") + + if self.options.get_safe("opengles") and self.settings.os in ("iOS", "tvOS", "visionOS", "watchOS"): + self.cpp_info.components["sdl3"].frameworks.append("OpenGLES") + + if self.options.get_safe("metal"): + self.cpp_info.components["sdl3"].frameworks.extend(["Metal", "QuartzCore"]) + + # Windows links with all libs by default + if self.settings.os == "Windows": + self.cpp_info.components["sdl3"].system_libs.extend( + [ + "kernel32", + "user32", + "gdi32", + "winmm", + "imm32", + "ole32", + "oleaut32", + "version", + "uuid", + "advapi32", + "setupapi", + "shell32", + ] + ) diff --git a/recipes/sdl/3.x/test_package/CMakeLists.txt b/recipes/sdl/3.x/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..52d1454ee1046 --- /dev/null +++ b/recipes/sdl/3.x/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(SDL3 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} SDL3::SDL3) + diff --git a/recipes/sdl/3.x/test_package/conanfile.py b/recipes/sdl/3.x/test_package/conanfile.py new file mode 100644 index 0000000000000..c21bd201e65b8 --- /dev/null +++ b/recipes/sdl/3.x/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_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) + 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") + self.run(bin_path, env="conanrun") diff --git a/recipes/sdl/3.x/test_package/test_package.cpp b/recipes/sdl/3.x/test_package/test_package.cpp new file mode 100644 index 0000000000000..b9d1f23d138d5 --- /dev/null +++ b/recipes/sdl/3.x/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char* args[]) { + auto version = SDL_GetVersion(); + std::cout << "SDL version " << version << std::endl; + return 0; +} diff --git a/recipes/sdl/all/conandata.yml b/recipes/sdl/all/conandata.yml index 5542cc7bb105c..411133c0cb31c 100644 --- a/recipes/sdl/all/conandata.yml +++ b/recipes/sdl/all/conandata.yml @@ -1,28 +1,31 @@ sources: + "2.32.2": + url: "https://www.libsdl.org/release/SDL2-2.32.2.tar.gz" + sha256: "c5f30c427fd8107ee4a400c84d4447dd211352512eaf0b6e89cc6a50a2821922" + "2.30.9": + url: "https://www.libsdl.org/release/SDL2-2.30.9.tar.gz" + sha256: "24b574f71c87a763f50704bbb630cbe38298d544a1f890f099a4696b1d6beba4" + "2.30.8": + url: "https://www.libsdl.org/release/SDL2-2.30.8.tar.gz" + sha256: "380c295ea76b9bd72d90075793971c8bcb232ba0a69a9b14da4ae8f603350058" + "2.30.7": + url: "https://www.libsdl.org/release/SDL2-2.30.7.tar.gz" + sha256: "2508c80438cd5ff3bbeb8fe36b8f3ce7805018ff30303010b61b03bb83ab9694" + "2.30.6": + url: "https://www.libsdl.org/release/SDL2-2.30.6.tar.gz" + sha256: "c6ef64ca18a19d13df6eb22df9aff19fb0db65610a74cc81dae33a82235cacd4" + "2.30.5": + url: "https://www.libsdl.org/release/SDL2-2.30.5.tar.gz" + sha256: "f374f3fa29c37dfcc20822d4a7d7dc57e58924d1a5f2ad511bfab4c8193de63b" + "2.30.4": + url: "https://www.libsdl.org/release/SDL2-2.30.4.tar.gz" + sha256: "59c89d0ed40d4efb23b7318aa29fe7039dbbc098334b14f17f1e7e561da31a26" "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" - "2.26.0": - url: "https://www.libsdl.org/release/SDL2-2.26.0.tar.gz" - sha256: "8000d7169febce93c84b6bdf376631f8179132fd69f7015d4dadb8b9c2bdb295" - "2.24.1": - url: "https://www.libsdl.org/release/SDL2-2.24.1.tar.gz" - sha256: "bc121588b1105065598ce38078026a414c28ea95e66ed2adab4c44d80b309e1b" - "2.24.0": - url: "https://www.libsdl.org/release/SDL2-2.24.0.tar.gz" - sha256: "91e4c34b1768f92d399b078e171448c6af18cafda743987ed2064a28954d6d97" "2.0.20": url: "https://www.libsdl.org/release/SDL2-2.0.20.tar.gz" sha256: "c56aba1d7b5b0e7e999e4a7698c70b63a3394ff9704b5f6e1c57e0c16f04dd06" diff --git a/recipes/sdl/all/conanfile.py b/recipes/sdl/all/conanfile.py index 03ff0430a22b1..3dae0a2c6e6cd 100644 --- a/recipes/sdl/all/conanfile.py +++ b/recipes/sdl/all/conanfile.py @@ -3,23 +3,22 @@ from conan.tools.apple import is_apple_os from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, replace_in_file, rm, rmdir, copy from conan.tools.microsoft import is_msvc -from conan.tools.build import cross_building from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.env import Environment import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.55.0" class SDLConan(ConanFile): name = "sdl" description = "Access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL, Direct3D and Vulkan" - topics = ("sdl2", "audio", "keyboard", "graphics", "opengl") + license = "Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.libsdl.org" - license = "Zlib" + topics = ("sdl2", "audio", "keyboard", "graphics", "opengl") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -50,6 +49,7 @@ class SDLConan(ConanFile): "opengles": [True, False], "vulkan": [True, False], "libunwind": [True, False], + "hidapi": [True, False], } default_options = { "shared": False, @@ -78,14 +78,15 @@ class SDLConan(ConanFile): "opengles": True, "vulkan": True, "libunwind": True, + "hidapi": True, } 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") @@ -95,9 +96,6 @@ def generate(self): env = Environment() env.define_path("LIBRARY_PATH", os.pathsep.join(lib_paths)) - # FIXME: remove and raise required_conan_version to 1.55 once it's on c3i - env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) - env = env.vars(self, scope="build") env.save_script("sdl_env") @@ -105,11 +103,11 @@ def export_sources(self): export_conandata_patches(self) def config_options(self): - # Don't depend on iconv on macOS by default + # Don't depend on iconv on Apple by default # SDL2 depends on many system freamworks, # which depend on the system-provided iconv # and can conflict with the Conan provided one - self.options.iconv = self.settings.os != "Macos" + self.options.iconv = not is_apple_os(self) if self.settings.os == "Windows": del self.options.fPIC @@ -141,8 +139,10 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.libcxx") - self.settings.rm_safe("compiler.cppstd") + # TODO: C++ is also required for WinRT and Haiku + if not (self.settings.os == "Android" and self.options.hidapi): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def requirements(self): if self.options.get_safe("iconv", False): @@ -161,11 +161,11 @@ def requirements(self): self.requires("xkbcommon/1.6.0") self.requires("egl/system") if self.options.libunwind: - self.requires("libunwind/1.7.2") + self.requires("libunwind/1.8.0") def validate(self): # SDL>=2.0.18 requires xcode 12 or higher because it uses CoreHaptics. - if Version(self.version) >= "2.0.18" and is_apple_os(self) and Version(self.settings.compiler.version) < "12": + if is_apple_os(self) and Version(self.settings.compiler.version) < "12": raise ConanInvalidConfiguration("{}/{} requires xcode 12 or higher".format(self.name, self.version)) if self.settings.os == "Linux": @@ -183,49 +183,45 @@ def package_id(self): del self.info.options.sdl2main def build_requirements(self): - if self.settings.os == "Macos" and cross_building(self): - # 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.tool_requires("cmake/3.27.9") + self.tool_requires("cmake/[>3.27 <4]") if self.settings.os == "Linux" and not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/2.1.0") if hasattr(self, "settings_build") and self.options.get_safe("wayland"): self.build_requires("wayland/1.22.0") # Provides wayland-scanner 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 _patch_sources(self): apply_conandata_patches(self) - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - if self.settings.os == "Macos": - if self.options.iconv: - # If using conan-provided iconv, search for the symbol "libiconv_open" - replace_check = "check_library_exists(iconv libiconv_open" - else: - # When no tusing conan-provided icon, don't check for iconv at all - replace_check = "#check_library_exists(iconv iconv_open" - replace_in_file(self, cmakelists, "check_library_exists(iconv iconv_open", - replace_check) - - # Avoid assuming iconv is available if it is provided by the C runtime, - # and let SDL build the fallback implementation - replace_in_file(self, cmakelists, - 'check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)', - '# check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)') + if Version(self.version) < "2.30.0": + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + if self.settings.os == "Macos": + if self.options.iconv: + # If using conan-provided iconv, search for the symbol "libiconv_open" + replace_check = "check_library_exists(iconv libiconv_open" + else: + # When no tusing conan-provided icon, don't check for iconv at all + replace_check = "#check_library_exists(iconv iconv_open" + replace_in_file(self, cmakelists, "check_library_exists(iconv iconv_open", + replace_check) + + # Avoid assuming iconv is available if it is provided by the C runtime, + # and let SDL build the fallback implementation + replace_in_file(self, cmakelists, + 'check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)', + '# check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)') # Ensure to find wayland-scanner from wayland recipe in build requirements (or requirements if 1 profile) - if self.options.get_safe("wayland") and Version(self.version) >= "2.0.18": + if self.options.get_safe("wayland"): replace_in_file(self, os.path.join(self.source_folder, "cmake", "sdlchecks.cmake"), "find_program(WAYLAND_SCANNER NAMES wayland-scanner REQUIRED)", 'find_program(WAYLAND_SCANNER NAMES wayland-scanner REQUIRED PATHS "${WAYLAND_BIN_DIR}" NO_DEFAULT_PATH)', ) + if Version(self.version) >= "2.30.6" and not self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "list(APPEND targets SDL2-static)", "set(targets SDL2-static)") def define_toolchain(self): tc = CMakeToolchain(self) @@ -247,9 +243,11 @@ def define_toolchain(self): tc.variables["HAVE_LIBC"] = True tc.variables["SDL_SHARED"] = self.options.shared tc.variables["SDL_STATIC"] = not self.options.shared + tc.variables["SDL_TEST"] = False tc.variables["SDL_OPENGL"] = self.options.opengl tc.variables["SDL_OPENGLES"] = self.options.opengles tc.variables["SDL_VULKAN"] = self.options.vulkan + tc.variables["SDL_HIDAPI"] = self.options.hidapi if self.settings.os == "Linux": # See https://github.com/bincrafters/community/issues/696 tc.variables["SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS"] = 1 @@ -323,6 +321,9 @@ def define_toolchain(self): if Version(self.version) >= "2.0.22": tc.variables["SDL2_DISABLE_SDL2MAIN"] = not self.options.sdl2main + if Version(self.version) >= "2.30.0": + tc.variables["SDL_LIBICONV"] = self.options.get_safe("iconv", False) + tc.variables["SDL_SYSTEM_ICONV"] = False # Add extra information collected from the deps tc.variables["EXTRA_LDFLAGS"] = ";".join(cmake_extra_ldflags) @@ -330,6 +331,7 @@ def define_toolchain(self): 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).replace(os.sep, '/') tc.variables["EXTRA_LIBS"] = ";".join(cmake_extra_libs) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def build(self): @@ -344,6 +346,8 @@ def package(self): copy(self, pattern="LICENSE.txt", src=os.path.join(self.source_folder), dst=os.path.join(self.package_folder, "licenses")) rm(self, "sdl2-config", os.path.join(self.package_folder, "bin")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + 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")) @@ -416,7 +420,15 @@ def package_info(self): "AVFoundation", "Foundation", "QuartzCore", ] if self.settings.os == "Macos": - self.cpp_info.components["libsdl2"].frameworks.extend(["Cocoa", "Carbon", "IOKit", "ForceFeedback"]) + self.cpp_info.components["libsdl2"].frameworks.extend([ + "Cocoa", + "Carbon", + "IOKit", + "ForceFeedback", + "CoreFoundation", + "CoreServices", + "AppKit" + ]) self.cpp_info.components["libsdl2"].frameworks.append("GameController") elif self.settings.os in ["iOS", "tvOS", "watchOS"]: self.cpp_info.components["libsdl2"].frameworks.extend([ diff --git a/recipes/sdl/all/patches/0001-fix-cmake-ios-tvos.patch b/recipes/sdl/all/patches/0001-fix-cmake-ios-tvos.patch deleted file mode 100644 index 7a56e3d843ff6..0000000000000 --- a/recipes/sdl/all/patches/0001-fix-cmake-ios-tvos.patch +++ /dev/null @@ -1,26 +0,0 @@ -see https://github.com/libsdl-org/SDL/commit/471d3c363e654c7ad10782f50cb47e639c0646c3 - ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -131,6 +131,8 @@ elseif(APPLE) - set(MACOSX TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*") - set(TVOS TRUE) -+ elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*") -+ set(IOS TRUE) - endif() - # TODO: iOS? - elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*") -@@ -1668,7 +1670,11 @@ elseif(APPLE) - message_error("SDL_FILE must be enabled to build on MacOS X") - endif() - -- file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m) -+ if(IOS OR TVOS) -+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m) -+ else() -+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m) -+ endif() - set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES}) - set(HAVE_SDL_MISC TRUE) - diff --git a/recipes/sdl/all/patches/0002-mingw-improvements.patch b/recipes/sdl/all/patches/0002-mingw-improvements.patch deleted file mode 100644 index 250f0b8951359..0000000000000 --- a/recipes/sdl/all/patches/0002-mingw-improvements.patch +++ /dev/null @@ -1,27 +0,0 @@ -Upstream-pull-request: https://github.com/libsdl-org/SDL/pull/4492 -Upstream-pull-request-status: Merged ---- - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b9b9eb62..454a0bbd 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2092,7 +2092,8 @@ if(NOT CMAKE_HOST_WIN32) - execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh - WORKING_DIRECTORY ${SDL2_BINARY_DIR}) - endif() --if(NOT WINDOWS OR CYGWIN) -+if(NOT WINDOWS OR CYGWIN OR MINGW) -+ - set(prefix ${CMAKE_INSTALL_PREFIX}) - set(exec_prefix "\${prefix}") - set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}") -@@ -2361,7 +2361,7 @@ else() - set(SOPOSTFIX "") - endif() - --if(NOT (WINDOWS OR CYGWIN)) -+if(NOT (WINDOWS OR CYGWIN OR MINGW)) - if(SDL_SHARED) - set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. - get_target_property(SONAME SDL2 OUTPUT_NAME) diff --git a/recipes/sdl/all/patches/0003-2.0.14-wayland-scanner-buildrequires.patch b/recipes/sdl/all/patches/0003-2.0.14-wayland-scanner-buildrequires.patch deleted file mode 100644 index d6352aaac4789..0000000000000 --- a/recipes/sdl/all/patches/0003-2.0.14-wayland-scanner-buildrequires.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/cmake/sdlchecks.cmake -+++ b/cmake/sdlchecks.cmake -@@ -593,9 +593,10 @@ endmacro() - # - HAVE_DLOPEN opt - macro(CheckWayland) - if(VIDEO_WAYLAND) -- pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-egl wayland-cursor egl xkbcommon) -+ pkg_check_modules(WAYLAND wayland-client wayland-egl wayland-cursor egl xkbcommon) - - if(WAYLAND_FOUND) -+ if(0) - execute_process( - COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=wayland_scanner wayland-scanner - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" -@@ -607,6 +608,8 @@ macro(CheckWayland) - if(NOT WAYLAND_SCANNER_RC EQUAL 0) - set(WAYLAND_FOUND FALSE) - endif() -+ endif() -+ set(WAYLAND_SCANNER "wayland-scanner") - endif() - - if(WAYLAND_FOUND) diff --git a/recipes/sdl/all/patches/0003-2.0.16-wayland-scanner-buildrequires.patch b/recipes/sdl/all/patches/0003-2.0.16-wayland-scanner-buildrequires.patch deleted file mode 100644 index 664a37968e03a..0000000000000 --- a/recipes/sdl/all/patches/0003-2.0.16-wayland-scanner-buildrequires.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/cmake/sdlchecks.cmake -+++ b/cmake/sdlchecks.cmake -@@ -628,10 +628,10 @@ endmacro() - # - HAVE_DLOPEN opt - macro(CheckWayland) - if(VIDEO_WAYLAND) -- pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-egl wayland-cursor egl xkbcommon) -- pkg_check_modules(WAYLAND_SCANNER_1_15 "wayland-scanner>=1.15") -+ pkg_check_modules(WAYLAND wayland-client wayland-egl wayland-cursor egl xkbcommon) - - if(WAYLAND_FOUND AND HAVE_VIDEO_OPENGL_EGL) -+ if(0) - execute_process( - COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=wayland_scanner wayland-scanner - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" -@@ -643,6 +643,8 @@ macro(CheckWayland) - if(NOT WAYLAND_SCANNER_RC EQUAL 0) - set(WAYLAND_FOUND FALSE) - endif() -+ endif() -+ set(WAYLAND_SCANNER "wayland-scanner") - endif() - - if(WAYLAND_FOUND) diff --git a/recipes/sdl/all/test_package/conanfile.py b/recipes/sdl/all/test_package/conanfile.py index 956346bb80854..c21bd201e65b8 100644 --- a/recipes/sdl/all/test_package/conanfile.py +++ b/recipes/sdl/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", "VirtualRunEnv" diff --git a/recipes/sdl/config.yml b/recipes/sdl/config.yml index e05c00ea2969e..cb9753886e266 100644 --- a/recipes/sdl/config.yml +++ b/recipes/sdl/config.yml @@ -1,19 +1,29 @@ versions: - "2.28.5": + "3.2.14": + folder: 3.x + "3.2.6": + folder: 3.x + "2.32.2": folder: all - "2.28.3": + "2.30.9": folder: all - "2.28.2": + "2.30.8": folder: all - "2.26.5": + "2.30.7": folder: all - "2.26.1": + "2.30.6": folder: all - "2.26.0": + # keep 2.30.5 for sdl_mixer + "2.30.5": folder: all - "2.24.1": + "2.30.4": folder: all - "2.24.0": + # keep 2.28.5 for pdcurses, ffmpeg, sdl_net, sdl_mixer + "2.28.5": + folder: all + # keep 2.28.3 for sdl_image, sdl_ttf + "2.28.3": folder: all + # keep 2.0.20 for magnum, ogre "2.0.20": folder: all diff --git a/recipes/sdl_image/all/CMakeLists.txt b/recipes/sdl_image/all/CMakeLists.txt deleted file mode 100644 index 6554bf914af3f..0000000000000 --- a/recipes/sdl_image/all/CMakeLists.txt +++ /dev/null @@ -1,118 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(SDL2_image LANGUAGES C) - -find_package(SDL2 REQUIRED CONFIG) - -macro(add_image_option type) - option(${type} "${type} images support" ON) - if(${type}) - add_definitions("-DLOAD_${type}") - endif() -endmacro() - -if(APPLE) - option(IMAGEIO "use native Apple frameworks for loading images" ON) - if(IMAGEIO) - set(IMAGEIO_SOURCE "${SDL_IMAGE_SRC_DIR}/IMG_ImageIO.m") - else() - add_definitions("-DSDL_IMAGE_USE_COMMON_BACKEND") - endif() -endif() - -add_image_option(BMP) -add_image_option(GIF) -add_image_option(JPG) -add_image_option(LBM) -add_image_option(PCX) -add_image_option(PNG) -add_image_option(PNM) -add_image_option(SVG) -add_image_option(TGA) -add_image_option(TIF) -add_image_option(WEBP) -add_image_option(XCF) -add_image_option(XPM) -add_image_option(XV) - -set(SOURCES - ${SDL_IMAGE_SRC_DIR}/IMG.c - ${SDL_IMAGE_SRC_DIR}/IMG_bmp.c - ${SDL_IMAGE_SRC_DIR}/IMG_gif.c - ${SDL_IMAGE_SRC_DIR}/IMG_jpg.c - ${SDL_IMAGE_SRC_DIR}/IMG_lbm.c - ${SDL_IMAGE_SRC_DIR}/IMG_pcx.c - ${SDL_IMAGE_SRC_DIR}/IMG_png.c - ${SDL_IMAGE_SRC_DIR}/IMG_pnm.c - ${SDL_IMAGE_SRC_DIR}/IMG_svg.c - ${SDL_IMAGE_SRC_DIR}/IMG_tga.c - ${SDL_IMAGE_SRC_DIR}/IMG_tif.c - ${SDL_IMAGE_SRC_DIR}/IMG_webp.c - ${SDL_IMAGE_SRC_DIR}/IMG_xcf.c - ${SDL_IMAGE_SRC_DIR}/IMG_xpm.c - ${SDL_IMAGE_SRC_DIR}/IMG_xv.c - ${IMAGEIO_SOURCE} -) - -if(BUILD_SHARED_LIBS) - list(APPEND SOURCES ${SDL_IMAGE_SRC_DIR}/version.rc) -endif() - -add_library(${PROJECT_NAME} ${SOURCES}) -target_include_directories(${PROJECT_NAME} PRIVATE ${SDL_IMAGE_SRC_DIR}) -set_target_properties(${PROJECT_NAME} PROPERTIES - PUBLIC_HEADER ${SDL_IMAGE_SRC_DIR}/SDL_image.h - DEFINE_SYMBOL DLL_EXPORT -) - -if(SDL_IS_SHARED) - target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2-static) -endif() - -if(TIF) - find_package(TIFF REQUIRED) - target_link_libraries(${PROJECT_NAME} PRIVATE TIFF::TIFF) -endif() - -if(JPG) - find_package(JPEG REQUIRED) - target_link_libraries(${PROJECT_NAME} PRIVATE JPEG::JPEG) -endif() - -if(PNG) - find_package(PNG REQUIRED) - target_link_libraries(${PROJECT_NAME} PRIVATE PNG::PNG) -endif() - -if(WEBP) - find_package(WebP REQUIRED CONFIG) - target_link_libraries(${PROJECT_NAME} PRIVATE WebP::webp) -endif() - -if(APPLE AND IMAGEIO AND BUILD_SHARED_LIBS) - if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) - set(extraFrameworks - "-framework ApplicationServices" - ) - else() - set(extraFrameworks - "-framework MobileCoreServices" - "-framework UIKit" - ) - endif() - target_link_libraries(${PROJECT_NAME} PRIVATE - "-framework CoreFoundation" - "-framework CoreGraphics" - "-framework Foundation" - "-framework ImageIO" - ${extraFrameworks} - ) -endif() - -install(TARGETS ${PROJECT_NAME} - ARCHIVE DESTINATION "lib" - LIBRARY DESTINATION "lib" - RUNTIME DESTINATION "bin" - PUBLIC_HEADER DESTINATION "include/SDL2" -) diff --git a/recipes/sdl_image/all/conandata.yml b/recipes/sdl_image/all/conandata.yml index 0444df801e1ac..18c7b6cfb194e 100644 --- a/recipes/sdl_image/all/conandata.yml +++ b/recipes/sdl_image/all/conandata.yml @@ -1,7 +1,13 @@ sources: + "2.8.2": + url: "https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.2/SDL2_image-2.8.2.tar.gz" + sha256: "8f486bbfbcf8464dd58c9e5d93394ab0255ce68b51c5a966a918244820a76ddc" "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" +patches: + "2.8.2": + - patch_description: "Fix webpdemux cmake target name" + patch_file: "patches/webpdemux-target.patch" + patch_source: "https://github.com/libsdl-org/SDL_image/pull/479" + patch_type: "portability" diff --git a/recipes/sdl_image/all/conanfile.py b/recipes/sdl_image/all/conanfile.py index bca15363d987d..44d58bae13f85 100644 --- a/recipes/sdl_image/all/conanfile.py +++ b/recipes/sdl_image/all/conanfile.py @@ -2,11 +2,10 @@ 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, get, rmdir -from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2" class SDLImageConan(ConanFile): @@ -67,18 +66,13 @@ class SDLImageConan(ConanFile): } def export_sources(self): - if Version(self.version) < "2.6": - 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 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 @@ -87,9 +81,6 @@ def configure(self): self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") - if self.options.shared: - # sdl static into sdl_image shared is not allowed - self.options["sdl"].shared = True def layout(self): cmake_layout(self, src_folder="src") @@ -102,7 +93,7 @@ def requirements(self): if self.options.with_libjpeg: self.requires("libjpeg/9e") if self.options.with_libpng: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_libwebp: self.requires("libwebp/1.3.2") if self.options.get_safe("with_avif"): @@ -116,55 +107,36 @@ def validate(self): 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]") + self.tool_requires("cmake/[>=3.16 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) - 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.cache_variables["SDL2IMAGE_VENDORED"] = False + tc.cache_variables["SDL2IMAGE_DEPS_SHARED"] = False + tc.cache_variables["SDL2IMAGE_SAMPLES"] = False + tc.cache_variables["SDL2IMAGE_AVIF"] = self.options.get_safe("with_avif") + tc.cache_variables["SDL2IMAGE_BMP"] = self.options.bmp + tc.cache_variables["SDL2IMAGE_GIF"] = self.options.gif + tc.cache_variables["SDL2IMAGE_JPG"] = self.options.with_libjpeg + tc.cache_variables["SDL2IMAGE_JXL"] = self.options.get_safe("with_jxl") + tc.cache_variables["SDL2IMAGE_LBM"] = self.options.lbm + tc.cache_variables["SDL2IMAGE_PCX"] = self.options.pcx + tc.cache_variables["SDL2IMAGE_PNG"] = self.options.with_libpng + tc.cache_variables["SDL2IMAGE_PNM"] = self.options.pnm + tc.cache_variables["SDL2IMAGE_QOI"] = self.options.get_safe("qoi") + tc.cache_variables["SDL2IMAGE_SVG"] = self.options.svg + tc.cache_variables["SDL2IMAGE_TGA"] = self.options.tga + tc.cache_variables["SDL2IMAGE_TIF"] = self.options.with_libtiff + tc.cache_variables["SDL2IMAGE_WEBP"] = self.options.with_libwebp + tc.cache_variables["SDL2IMAGE_XCF"] = self.options.xcf + tc.cache_variables["SDL2IMAGE_XPM"] = self.options.xpm + tc.cache_variables["SDL2IMAGE_XV"] = self.options.xv + tc.cache_variables["SDL2IMAGE_BACKEND_WIC"] = self.options.get_safe("wic") + tc.cache_variables["SDL2IMAGE_BACKEND_IMAGEIO"] = self.options.get_safe("imageio") tc.generate() cd = CMakeDeps(self) cd.generate() @@ -172,22 +144,15 @@ def generate(self): def build(self): rmdir(self, os.path.join(self.source_folder, "external")) cmake = CMake(self) - if Version(self.version) < "2.6": - cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) - else: - cmake.configure() + 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")) + 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): - 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")) + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() @@ -199,11 +164,10 @@ def package(self): 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" + if self.settings.compiler == "msvc" 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") @@ -215,12 +179,6 @@ def package_info(self): self.cpp_info.components["_sdl_image"].includedirs.append(os.path.join("include", "SDL2")) # TODO: to remove in conan v2 once legacy generators removed - self.cpp_info.names["cmake_find_package"] = "SDL2_image" - self.cpp_info.names["cmake_find_package_multi"] = "SDL2_image" - self.cpp_info.names["pkg_config"] = "SDL2_image" - target_name = "SDL2_image" if self.options.shared else "SDL2_image-static" - self.cpp_info.components["_sdl_image"].names["cmake_find_package"] = target_name - self.cpp_info.components["_sdl_image"].names["cmake_find_package_multi"] = target_name self.cpp_info.components["_sdl_image"].set_property("cmake_target_name", "SDL2_image::SDL2_image") self.cpp_info.components["_sdl_image"].set_property("pkg_config_name", "SDL2_image") self.cpp_info.components["_sdl_image"].requires = ["sdl::sdl"] diff --git a/recipes/sdl_image/all/patches/webpdemux-target.patch b/recipes/sdl_image/all/patches/webpdemux-target.patch new file mode 100644 index 0000000000000..beff89d55cb0a --- /dev/null +++ b/recipes/sdl_image/all/patches/webpdemux-target.patch @@ -0,0 +1,23 @@ +From 35e3cb865f8394bdc8bb2d2cf6e9f91dfd3c94bd Mon Sep 17 00:00:00 2001 +From: Andrey Filipenkov +Date: Sat, 23 Nov 2024 00:47:15 +0300 +Subject: [PATCH] fix name case of webpdemux target + +(cherry picked from commit 0d418a2a2dc562699854d9c2fc264304ec404e2c) +--- + cmake/Findwebp.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/Findwebp.cmake b/cmake/Findwebp.cmake +index 58891318..e07b377c 100644 +--- a/cmake/Findwebp.cmake ++++ b/cmake/Findwebp.cmake +@@ -43,7 +43,7 @@ if (webp_FOUND) + INTERFACE_LINK_FLAGS "${webp_LINK_FLAGS}" + ) + endif() +- if (NOT TARGET WEBP::webpdemux) ++ if (NOT TARGET WebP::webpdemux) + add_library(WebP::webpdemux UNKNOWN IMPORTED) + set_target_properties(WebP::webpdemux PROPERTIES + IMPORTED_LOCATION "${webpdemux_LIBRARY}" diff --git a/recipes/sdl_image/all/test_package/CMakeLists.txt b/recipes/sdl_image/all/test_package/CMakeLists.txt index a9ac602e7d066..8cfe71e9dfd36 100644 --- a/recipes/sdl_image/all/test_package/CMakeLists.txt +++ b/recipes/sdl_image/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(SDL2_image REQUIRED CONFIG) diff --git a/recipes/sdl_image/all/test_v1_package/CMakeLists.txt b/recipes/sdl_image/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/sdl_image/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/sdl_image/all/test_v1_package/conanfile.py b/recipes/sdl_image/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sdl_image/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_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/sdl_image/config.yml b/recipes/sdl_image/config.yml index 53a0b9c216274..0741a5fa4c15e 100644 --- a/recipes/sdl_image/config.yml +++ b/recipes/sdl_image/config.yml @@ -1,5 +1,5 @@ versions: - "2.6.3": + "2.8.2": folder: "all" - "2.0.5": + "2.6.3": folder: "all" diff --git a/recipes/sdl_mixer/all/CMakeLists.txt b/recipes/sdl_mixer/all/CMakeLists.txt index fa206e6c5d5c7..2dfb3ecfdb114 100644 --- a/recipes/sdl_mixer/all/CMakeLists.txt +++ b/recipes/sdl_mixer/all/CMakeLists.txt @@ -1,19 +1,13 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.15) project(sdl2_mixer) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - include(CheckTypeSize) macro(add_music_option type) option(${type} "${type} music support" OFF) message(STATUS "${type} ${${type}}") - if(${${type}}) + if(${type}) add_definitions("-DMUSIC_${type}") - if(${${type}_DYNAMIC}) - add_definitions("-D${type}_DYNAMIC") - endif() endif() endmacro() @@ -30,73 +24,78 @@ add_music_option(MID_NATIVE) add_music_option(MID_FLUIDSYNTH) add_music_option(MID_TINYMIDI) -if(${MID_NATIVE}) - -set(NATIVE_MIDI_SOURCES -source_subfolder/native_midi/native_midi_common.c -source_subfolder/native_midi/native_midi_common.h -source_subfolder/native_midi/native_midi_haiku.cpp -source_subfolder/native_midi/native_midi_mac.c -source_subfolder/native_midi/native_midi_macosx.c -source_subfolder/native_midi/native_midi_win32.c -) - -set(NATIVE_MIDI_HEADERS -source_subfolder/native_midi/native_midi.h -) - +if(MIDI_NATIVE) + set(NATIVE_MIDI_SOURCES + src/native_midi/native_midi_common.c + src/native_midi/native_midi_common.h + src/native_midi/native_midi_haiku.cpp + src/native_midi/native_midi_mac.c + src/native_midi/native_midi_macosx.c + src/native_midi/native_midi_win32.c + ) + + set(NATIVE_MIDI_HEADERS + src/native_midi/native_midi.h + ) endif() set(SOURCES -source_subfolder/effect_position.c -source_subfolder/effect_stereoreverse.c -source_subfolder/effects_internal.c -source_subfolder/load_aiff.c -source_subfolder/load_voc.c -source_subfolder/mixer.c -source_subfolder/music.c -source_subfolder/music_cmd.c -source_subfolder/music_flac.c -source_subfolder/music_fluidsynth.c -source_subfolder/music_mad.c -source_subfolder/music_mikmod.c -source_subfolder/music_modplug.c -source_subfolder/music_mpg123.c -source_subfolder/music_nativemidi.c -source_subfolder/music_ogg.c -source_subfolder/music_opus.c -source_subfolder/music_timidity.c -source_subfolder/music_wav.c -${NATIVE_MIDI_SOURCES} + src/effect_position.c + src/effect_stereoreverse.c + src/effects_internal.c + src/load_aiff.c + src/load_voc.c + src/mixer.c + src/music.c + src/music_cmd.c + src/music_flac.c + src/music_fluidsynth.c + src/music_mad.c + src/music_mikmod.c + src/music_modplug.c + src/music_mpg123.c + src/music_nativemidi.c + src/music_ogg.c + src/music_opus.c + src/music_timidity.c + src/music_wav.c + ${NATIVE_MIDI_SOURCES} ) set(HEADERS -source_subfolder/effects_internal.h -source_subfolder/load_aiff.h -source_subfolder/load_voc.h -source_subfolder/mixer.h -source_subfolder/music.h -source_subfolder/music_cmd.h -source_subfolder/music_flac.h -source_subfolder/music_fluidsynth.h -source_subfolder/music_mad.h -source_subfolder/music_mikmod.h -source_subfolder/music_modplug.h -source_subfolder/music_mpg123.h -source_subfolder/music_nativemidi.h -source_subfolder/music_ogg.h -source_subfolder/music_opus.h -source_subfolder/music_timidity.h -source_subfolder/music_wav.h -${NATIVE_MIDI_HEADERS} + src/effects_internal.h + src/load_aiff.h + src/load_voc.h + src/mixer.h + src/music.h + src/music_cmd.h + src/music_flac.h + src/music_fluidsynth.h + src/music_mad.h + src/music_mikmod.h + src/music_modplug.h + src/music_mpg123.h + src/music_nativemidi.h + src/music_ogg.h + src/music_opus.h + src/music_timidity.h + src/music_wav.h + ${NATIVE_MIDI_HEADERS} ) add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS}) -target_include_directories(${PROJECT_NAME} PRIVATE "source_subfolder") +target_include_directories(${PROJECT_NAME} PRIVATE "src") -if(${MID_NATIVE}) - target_include_directories(${PROJECT_NAME} PRIVATE "source_subfolder/native_midi") +if(MIDI_NATIVE) + target_include_directories(${PROJECT_NAME} PRIVATE "src/native_midi") + if(APPLE) + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.0.4/configure.in#L380 + target_link_libraries(${PROJECT_NAME} PRIVATE "-framework AudioToolbox" "-framework AudioUnit" "-framework CoreServices") + elseif(WIN32) + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.0.4/configure.in#L376 + target_link_libraries(${PROJECT_NAME} PRIVATE winmm) + endif() endif() find_package(SDL2 CONFIG REQUIRED) @@ -146,9 +145,9 @@ if(MID_TINYMIDI) target_link_libraries(${PROJECT_NAME} PRIVATE tinymidi::tinymidi) endif() -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER source_subfolder/SDL_mixer.h) +set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER src/SDL_mixer.h) -if(${BUILD_SHARED_LIBS}) +if(BUILD_SHARED_LIBS) target_compile_definitions(${PROJECT_NAME} PRIVATE DLL_EXPORT) endif() @@ -160,8 +159,8 @@ if(SSIZE_T STREQUAL "") endif() install(TARGETS ${PROJECT_NAME} - ARCHIVE DESTINATION "lib" - LIBRARY DESTINATION "lib" - RUNTIME DESTINATION "bin" - PUBLIC_HEADER DESTINATION "include/SDL2" + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + PUBLIC_HEADER DESTINATION include/SDL2 ) diff --git a/recipes/sdl_mixer/all/conanfile.py b/recipes/sdl_mixer/all/conanfile.py index 7139d07a2b4ea..d2133052c545d 100644 --- a/recipes/sdl_mixer/all/conanfile.py +++ b/recipes/sdl_mixer/all/conanfile.py @@ -1,144 +1,155 @@ -from conans import CMake, tools +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 copy from conan.tools.files import get, rmdir -import os -import functools + +required_conan_version = ">=1.57.0" class SDLMixerConan(ConanFile): name = "sdl_mixer" description = "SDL_mixer is a sample multi-channel audio mixer library" - topics = ("sdl_mixer", "sdl2", "sdl", "mixer", "audio", "multimedia", "sound", "music") + license = "Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.libsdl.org/projects/SDL_mixer/" - license = "Zlib" - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package_multi" + topics = ("sdl2", "sdl", "mixer", "audio", "multimedia", "sound", "music") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], - "fPIC": [True, False], - "cmd": [True, False], - "wav": [True, False], - "flac": [True, False], - "mpg123": [True, False], - "mad": [True, False], - "ogg": [True, False], - "opus": [True, False], - "mikmod": [True, False], - "modplug": [True, False], - "fluidsynth": [True, False], - "nativemidi": [True, False], - "tinymidi": [True, False]} - default_options = {"shared": False, - "fPIC": True, - "cmd": False, # needs sys/wait.h - "wav": True, - "flac": True, - "mpg123": True, - "mad": True, - "ogg": True, - "opus": True, - "mikmod": True, - "modplug": True, - "fluidsynth": False, # TODO: add fluidsynth to Conan Center - "nativemidi": True, - "tinymidi": True} - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cmd": [True, False], + "wav": [True, False], + "flac": [True, False], + "mpg123": [True, False], + "mad": [True, False], + "ogg": [True, False], + "opus": [True, False], + "mikmod": [True, False], + "modplug": [True, False], + "nativemidi": [True, False], + "tinymidi": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "cmd": False, + "wav": True, + "flac": True, + "mpg123": True, + "mad": True, + "ogg": True, + "opus": True, + "mikmod": True, + "modplug": True, + "nativemidi": True, + "tinymidi": 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 - if self.settings.os != "Linux": - del self.options.tinymidi + if self.settings.os in ["Linux", "FreeBSD"]: + self.options.rm_safe("nativemidi") else: - del self.options.nativemidi + self.options.rm_safe("tinymidi") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") 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("sdl/2.0.20") + self.requires("sdl/2.30.5", transitive_headers=True, transitive_libs=True) if self.options.flac: - self.requires("flac/1.3.3") + self.requires("flac/1.4.2") if self.options.mpg123: - self.requires("mpg123/1.29.3") + self.requires("mpg123/1.31.2") if self.options.mad: self.requires("libmad/0.15.1b") if self.options.ogg: self.requires("ogg/1.3.5") self.requires("vorbis/1.3.7") if self.options.opus: - self.requires("openssl/1.1.1q") - self.requires("opus/1.3.1") + self.requires("openssl/[>=1.1 <4]") + self.requires("opus/1.4") self.requires("opusfile/0.12") if self.options.mikmod: self.requires("libmikmod/3.3.11.1") if self.options.modplug: self.requires("libmodplug/0.8.9.0") - if self.options.fluidsynth: - self.requires("fluidsynth/2.2") # TODO: this package is missing on the conan-center-index - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: if self.options.tinymidi: self.requires("tinymidi/cci.20130325") 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) + rmdir(self, os.path.join(self.source_folder, "external")) - rmdir(self, os.path.join(self._source_subfolder, "external")) - - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["CMD"] = self.options.cmd - cmake.definitions["WAV"] = self.options.wav - cmake.definitions["FLAC"] = self.options.flac - cmake.definitions["MP3_MPG123"] = self.options.mpg123 - cmake.definitions["MP3_MAD"] = self.options.mad - cmake.definitions["OGG"] = self.options.ogg - cmake.definitions["OPUS"] = self.options.opus - cmake.definitions["MOD_MIKMOD"] = self.options.mikmod - cmake.definitions["MOD_MODPLUG"] = self.options.modplug - cmake.definitions["MID_FLUIDSYNTH"] = self.options.fluidsynth - if self.settings.os == "Linux": - cmake.definitions["MID_TINYMIDI"] = self.options.tinymidi - cmake.definitions["MID_NATIVE"] = False + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMD"] = self.options.cmd + tc.variables["WAV"] = self.options.wav + tc.variables["FLAC"] = self.options.flac + tc.variables["MP3_MPG123"] = self.options.mpg123 + tc.variables["MP3_MAD"] = self.options.mad + tc.variables["OGG"] = self.options.ogg + tc.variables["OPUS"] = self.options.opus + tc.variables["MOD_MIKMOD"] = self.options.mikmod + tc.variables["MOD_MODPLUG"] = self.options.modplug + tc.variables["MID_FLUIDSYNTH"] = False + if self.settings.os in ["Linux", "FreeBSD"]: + tc.variables["MID_TINYMIDI"] = self.options.tinymidi + tc.variables["MIDI_NATIVE"] = False else: - cmake.definitions["MID_TINYMIDI"] = False - cmake.definitions["MID_NATIVE"] = self.options.nativemidi - - cmake.definitions["FLAC_DYNAMIC"] = self.options["flac"].shared if self.options.flac else False - cmake.definitions["MP3_MPG123_DYNAMIC"] = self.options["mpg123"].shared if self.options.mpg123 else False - cmake.definitions["OGG_DYNAMIC"] = self.options["ogg"].shared if self.options.ogg else False - cmake.definitions["OPUS_DYNAMIC"] = self.options["opus"].shared if self.options.opus else False - cmake.definitions["MOD_MIKMOD_DYNAMIC"] = self.options["libmikmod"].shared if self.options.mikmod else False - cmake.definitions["MOD_MODPLUG_DYNAMIC"] = self.options["libmodplug"].shared if self.options.modplug else False - - cmake.configure(build_folder=self._build_subfolder) - - return cmake + tc.variables["MID_TINYMIDI"] = False + tc.variables["MIDI_NATIVE"] = self.options.nativemidi + 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() def package(self): - self.copy(pattern="COPYING.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING.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("pkg_config_name", "SDL2_mixer") self.cpp_info.set_property("cmake_file_name", "SDL2_mixer") self.cpp_info.set_property("cmake_target_name", "SDL2_mixer::SDL2_mixer") self.cpp_info.set_property("pkg_config_name", "SDL2_mixer") + self.cpp_info.libs = ["SDL2_mixer"] self.cpp_info.includedirs.append(os.path.join("include", "SDL2")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + + if self.options.get_safe("nativemidi"): + if is_apple_os(self): + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.0.4/configure.in#L380 + self.cpp_info.frameworks.extend(["AudioToolbox", "AudioUnit", "CoreServices"]) + elif self.settings.os == "Windows": + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.0.4/configure.in#L376 + self.cpp_info.system_libs.extend(["winmm"]) self.cpp_info.names["cmake_find_package"] = "SDL2_mixer" self.cpp_info.names["cmake_find_package_multi"] = "SDL2_mixer" diff --git a/recipes/sdl_mixer/all/test_package/CMakeLists.txt b/recipes/sdl_mixer/all/test_package/CMakeLists.txt index cbb6dbc11043a..d1c846300657f 100644 --- a/recipes/sdl_mixer/all/test_package/CMakeLists.txt +++ b/recipes/sdl_mixer/all/test_package/CMakeLists.txt @@ -1,11 +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(SDL2_mixer CONFIG REQUIRED) +find_package(SDL2_mixer REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_mixer::SDL2_mixer) diff --git a/recipes/sdl_mixer/all/test_package/conanfile.py b/recipes/sdl_mixer/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/sdl_mixer/all/test_package/conanfile.py +++ b/recipes/sdl_mixer/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/sdl_mixer/cmake/conandata.yml b/recipes/sdl_mixer/cmake/conandata.yml new file mode 100644 index 0000000000000..67acbdb598f69 --- /dev/null +++ b/recipes/sdl_mixer/cmake/conandata.yml @@ -0,0 +1,6 @@ +sources: + "2.8.0": + url: + - "https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.0/SDL2_mixer-2.8.0.tar.gz" + - "https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.8.0.tar.gz" + sha256: "1cfb34c87b26dbdbc7afd68c4f545c0116ab5f90bbfecc5aebe2a9cb4bb31549" diff --git a/recipes/sdl_mixer/cmake/conanfile.py b/recipes/sdl_mixer/cmake/conanfile.py new file mode 100644 index 0000000000000..5180b62854006 --- /dev/null +++ b/recipes/sdl_mixer/cmake/conanfile.py @@ -0,0 +1,269 @@ +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 copy, get, rmdir +from conan.tools.microsoft import is_msvc +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.57.0" + + +class SDLMixerConan(ConanFile): + name = "sdl_mixer" + description = "SDL_mixer is a sample multi-channel audio mixer library" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.libsdl.org/projects/SDL_mixer/" + topics = ("sdl2", "sdl", "mixer", "audio", "multimedia", "sound", "music") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cmd": [True, False], + "wav": [True, False], + "flac": [True, False], + "gme": [True, False], + "minimp3": [True, False], + "mpg123": [True, False], + "opus": [True, False], + "modplug": [True, False], + "fluidsynth": [True, False], + "nativemidi": [True, False], + "tinymidi": [True, False], + "vorbis": [False, "vorbisfile", "tremor", "stb"], + "wavpack": [True, False], + "xmp": [False, "libxmp", "libxmp-lite"], + } + default_options = { + "shared": False, + "fPIC": True, + "cmd": False, + "wav": True, + "flac": True, + "gme": False, + "minimp3": False, + "mpg123": True, + "opus": True, + "modplug": True, + "fluidsynth": False, + "nativemidi": True, + "tinymidi": True, + "vorbis": "stb", + "wavpack": False, + "xmp": False + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.tinymidi + if not (self.settings.os == "Windows" or self.settings.os == "Macos"): + del self.options.nativemidi + + 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 not self.options.flac and self.options.gme: + raise ConanInvalidConfiguration("gme is not yet available in CCI, contributions are welcome") + if self.options.vorbis == "tremor": + raise ConanInvalidConfiguration("tremor is not yet available in CCI, contributions are welcome") + if self.options.xmp == "libxmp": + raise ConanInvalidConfiguration("libxmp is not yet available in CCI, contributions are welcome") + if self.options.xmp == "libxmp-lite": + raise ConanInvalidConfiguration("libxmp-lite is not yet available in CCI, contributions are welcome") + if self.options.fluidsynth: + raise ConanInvalidConfiguration("fluidsynth is not yet available in CCI, contributions are welcome") + if self.options.wavpack: + raise ConanInvalidConfiguration("wavpack is not yet available in CCI, contributions are welcome") + + def requirements(self): + self.requires("sdl/2.28.5", transitive_headers=True, transitive_libs=True) + if self.options.flac: + self.requires("flac/1.4.2") + elif self.options.gme: + # TODO: not available on CCI + # self.requires("gme/x.y.z") + pass + if self.options.mpg123: + self.requires("mpg123/1.31.2") + if self.options.minimp3: + self.requires("minimp3/cci.20211201") + if self.options.vorbis == "stb": + self.requires("stb/cci.20230920") + elif self.options.vorbis == "vorbisfile": + self.requires("vorbis/1.3.7") + elif self.options.vorbis == "tremor": + # TODO: not available on CCI + # self.requires("tremor/1.2.1") + pass + if self.options.opus: + self.requires("opusfile/0.12") + if self.options.modplug: + self.requires("libmodplug/0.8.9.0") + if self.options.xmp == "libxmp": + # TODO: not available on CCI + # self.requires("libxmp/x.y.z") + pass + elif self.options.xmp == "libxmp-lite": + # TODO: not available on CCI + # self.requires("libxmp-lite/x.y.z") + pass + if self.options.fluidsynth: + # TODO: not available on CCI + # self.requires("fluidsynth/2.2") + pass + if self.options.get_safe("tinymidi"): + self.requires("tinymidi/cci.20130325") + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.6.3/CMakeLists.txt#L148-L162 + if self.options.vorbis or self.options.flac or self.options.opus: + self.requires("ogg/1.3.5") + if self.options.wavpack: + # TODO: not available on CCI + # self.requires("wavpack/x.y.z") + pass + + 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) + rmdir(self, os.path.join(self.source_folder, "external")) + + def generate(self): + tc = CMakeToolchain(self) + # Disable debug postfix as it's not relevant to single-configuration Conan builds + # and will be removed in v3.0 anyway. + tc.variables["SDL2MIXER_DEBUG_POSTFIX"] = "" + tc.variables["SDL2MIXER_VENDORED"] = False + tc.variables["SDL2MIXER_SAMPLES"] = False + tc.variables["SDL2MIXER_CMD"] = self.options.cmd + # WAVE + tc.variables["SDL2MIXER_WAVE"] = self.options.wav + # FLAC + tc.variables["SDL2MIXER_FLAC"] = self.options.flac + # GME + tc.variables["SDL2MIXER_GME"] = self.options.gme + # MOD + tc.variables["SDL2MIXER_MOD"] = self.options.modplug or bool(self.options.xmp) + tc.variables["SDL2MIXER_MOD_MODPLUG"] = self.options.modplug + tc.variables["SDL2MIXER_MOD_XMP"] = self.options.xmp == "libxmp" + tc.variables["SDL2MIXER_MOD_XMP_LITE"] = self.options.xmp == "libxmp-lite" + # MP3 + tc.variables["SDL2MIXER_MP3"] = self.options.mpg123 or self.options.minimp3 + tc.variables["SDL2MIXER_MP3_MPG123"] = self.options.mpg123 + tc.variables["SDL2MIXER_MP3_MINIMP3"] = self.options.minimp3 + # MIDI + tc.variables["SDL2MIXER_MIDI"] = self.options.get_safe("nativemidi", False) or self.options.get_safe("tinymidi", False) or self.options.fluidsynth + tc.variables["SDL2MIXER_MIDI_FLUIDSYNTH"] = self.options.fluidsynth + tc.variables["SDL2MIXER_MIDI_TIMIDITY"] = self.options.get_safe("tinymidi", False) + tc.variables["SDL2MIXER_MIDI_NATIVE"] = self.options.get_safe("nativemidi", False) + # OPUS + tc.variables["SDL2MIXER_OPUS"] = self.options.opus + # VORBIS + if self.options.vorbis == "stb": + tc.variables["SDL2MIXER_VORBIS"] = "STB" + elif self.options.vorbis == "vorbisfile": + tc.variables["SDL2MIXER_VORBIS"] = "VORBISFILE" + elif self.options.vorbis == "tremor": + tc.variables["SDL2MIXER_VORBIS"] = "TREMOR" + else: + tc.variables["SDL2MIXER_VORBIS"] = False + # WavPack + tc.variables["SDL2MIXER_WAVPACK"] = self.options.wavpack + + # TODO: add support for dynamic loading of dependencies + tc.variables["SDL2MIXER_DEPS_SHARED"] = False + tc.variables["SDL2MIXER_FLAC_LIBFLAC_SHARED"] = False + tc.variables["SDL2MIXER_GME_SHARED"] = False + tc.variables["SDL2MIXER_MIDI_FLUIDSYNTH_SHARED"] = False + tc.variables["SDL2MIXER_MIDI_TIMIDITY_SHARED"] = False + tc.variables["SDL2MIXER_MOD_MODPLUG_SHARED"] = False + tc.variables["SDL2MIXER_MOD_XMP_SHARED"] = False + tc.variables["SDL2MIXER_MP3_MPG123_SHARED"] = False + tc.variables["SDL2MIXER_OGG_SHARED"] = False + tc.variables["SDL2MIXER_OPUS_SHARED"] = False + tc.variables["SDL2MIXER_SNDFILE_SHARED"] = False + tc.variables["SDL2MIXER_VORBIS_TREMOR_SHARED"] = False + tc.variables["SDL2MIXER_VORBIS_VORBISFILE_SHARED"] = False + tc.variables["SDL2MIXER_WAVPACK_SHARED"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("flac", "cmake_file_name", "FLAC") + deps.set_property("flac", "cmake_target_name", "FLAC::FLAC") + deps.set_property("fluidsynth", "cmake_file_name", "FluidSynth") + deps.set_property("fluidsynth", "cmake_target_name", "FluidSynth::libfluidsynth") + deps.set_property("gme", "cmake_file_name", "gme") + deps.set_property("gme", "cmake_target_name", "gme::gme") + deps.set_property("libxmp", "cmake_file_name", "libxmp") + deps.set_property("libxmp", "cmake_target_name", "libxmp::libxmp") + deps.set_property("libxmp-lite", "cmake_file_name", "libxmp-lite") + deps.set_property("libxmp-lite", "cmake_target_name", "libxmp-lite::libxmp-lite") + deps.set_property("libmodplug", "cmake_file_name", "modplug") + deps.set_property("libmodplug", "cmake_target_name", "modplug::modplug") + deps.set_property("mpg123", "cmake_file_name", "mpg123") + deps.set_property("mpg123", "cmake_target_name", "MPG123::libmpg123") + deps.set_property("opusfile", "cmake_file_name", "OpusFile") + deps.set_property("opusfile", "cmake_target_name", "OpusFile::opusfile") + deps.set_property("tremor", "cmake_file_name", "tremor") + deps.set_property("tremor", "cmake_target_name", "tremor::tremor") + deps.set_property("vorbis", "cmake_file_name", "Vorbis") + deps.set_property("vorbis::vorbisfile", "cmake_target_name", "Vorbis::vorbisfile") + deps.set_property("wavpack", "cmake_file_name", "wavpack") + deps.set_property("wavpack", "cmake_target_name", "WavPack::WavPack") + + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", 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")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SDL2_mixer") + self.cpp_info.set_property("cmake_target_name", "SDL2_mixer::SDL2_mixer") + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.6.3/CMakeLists.txt#L164-L172 + if not self.options.shared: + self.cpp_info.set_property("cmake_target_aliases", ["SDL2_mixer::SDL2_mixer-static"]) + # The project only creates a pkg-config file for a shared lib, but add it for static as well, unofficially + # https://github.com/libsdl-org/SDL_mixer/blob/release-2.6.3/CMakeLists.txt#L828 + self.cpp_info.set_property("pkg_config_name", "SDL2_mixer") + + if is_msvc(self) and not self.options.shared: + self.cpp_info.libs = ["SDL2_mixer-static"] + else: + self.cpp_info.libs = ["SDL2_mixer"] + self.cpp_info.includedirs.append(os.path.join("include", "SDL2")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m"] + if self.settings.os == "Windows": + if self.options.nativemidi: + self.cpp_info.system_libs.append("winmm") + elif is_apple_os(self) and not self.options.shared: + self.cpp_info.frameworks.extend(["AudioToolbox", "CoreServices", "CoreGraphics", "CoreFoundation"]) + if self.settings.os == "Macos": + self.cpp_info.frameworks.extend(["AppKit", "AudioUnit"]) + + self.cpp_info.names["cmake_find_package"] = "SDL2_mixer" + self.cpp_info.names["cmake_find_package_multi"] = "SDL2_mixer" diff --git a/recipes/sdl_mixer/cmake/test_package/CMakeLists.txt b/recipes/sdl_mixer/cmake/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d1c846300657f --- /dev/null +++ b/recipes/sdl_mixer/cmake/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(SDL2_mixer REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_mixer::SDL2_mixer) diff --git a/recipes/sdl_mixer/cmake/test_package/conanfile.py b/recipes/sdl_mixer/cmake/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/sdl_mixer/cmake/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/sdl_mixer/cmake/test_package/test_package.c b/recipes/sdl_mixer/cmake/test_package/test_package.c new file mode 100644 index 0000000000000..c0bb50e718473 --- /dev/null +++ b/recipes/sdl_mixer/cmake/test_package/test_package.c @@ -0,0 +1,43 @@ +#include +#include + +#include +#include + +int main(int argc, char *argv[]) +{ + int audio_rate = MIX_DEFAULT_FREQUENCY; + int audio_format = MIX_DEFAULT_FORMAT; + int audio_channels = 2; + const SDL_version * version = Mix_Linked_Version(); + printf("%s", "SDL2_mixer version: "); + printf("%d.", (int)(version->major)); + printf("%d.", (int)(version->minor)); + printf("%d\n", (int)(version->patch)); + + if (SDL_Init(SDL_INIT_AUDIO) == 0) { + int initted = Mix_Init(MIX_INIT_FLAC | MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG | MIX_INIT_MID | MIX_INIT_OPUS); + printf("%s %s\n", "Supported MIX_INIT_MOD: " , (initted & MIX_INIT_MOD ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_MP3: " , (initted & MIX_INIT_MP3 ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_OGG: " , (initted & MIX_INIT_OGG ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_FLAC: ", (initted & MIX_INIT_FLAC ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_MID: " , (initted & MIX_INIT_MID ? "Yes" : "No")); + printf("%s %s\n", "Supported MIX_INIT_OPUS: ", (initted & MIX_INIT_OPUS ? "Yes" : "No")); + + if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, 4096) == 0) { + int num_chunk_decoders = Mix_GetNumChunkDecoders(); + int num_music_decoders = Mix_GetNumMusicDecoders(); + int i = 0; + printf("%s\n", "chunk decoders:"); + for (i = 0; i < num_chunk_decoders; ++i) + printf("\t%s\n", Mix_GetChunkDecoder(i)); + printf("%s\n", "music decoders:"); + for (i = 0; i < num_music_decoders; ++i) + printf("\t%s\n", Mix_GetMusicDecoder(i)); + Mix_CloseAudio(); + Mix_Quit(); + } + } + + return 0; +} diff --git a/recipes/sdl_mixer/config.yml b/recipes/sdl_mixer/config.yml index 303d89a72ec25..ddf82f5ad0c18 100644 --- a/recipes/sdl_mixer/config.yml +++ b/recipes/sdl_mixer/config.yml @@ -1,3 +1,5 @@ versions: + "2.8.0": + folder: "cmake" "2.0.4": folder: "all" diff --git a/recipes/sdl_net/all/CMakeLists.txt b/recipes/sdl_net/all/CMakeLists.txt index 2b17dca170dfa..96e3929f3903e 100644 --- a/recipes/sdl_net/all/CMakeLists.txt +++ b/recipes/sdl_net/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(SDL2_net LANGUAGES C) find_package(SDL2 REQUIRED CONFIG) diff --git a/recipes/sdl_net/all/conandata.yml b/recipes/sdl_net/all/conandata.yml index d051057513001..941ee319ca346 100644 --- a/recipes/sdl_net/all/conandata.yml +++ b/recipes/sdl_net/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.2.0": + url: "https://github.com/libsdl-org/SDL_net/releases/download/release-2.2.0/SDL2_net-2.2.0.tar.gz" + sha256: "4e4a891988316271974ff4e9585ed1ef729a123d22c08bd473129179dc857feb" "2.0.1": url: "https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.0.1.tar.gz" sha256: "15ce8a7e5a23dafe8177c8df6e6c79b6749a03fff1e8196742d3571657609d21" diff --git a/recipes/sdl_net/all/conanfile.py b/recipes/sdl_net/all/conanfile.py index ce2f6091ea9cd..6a4d6d8994d74 100644 --- a/recipes/sdl_net/all/conanfile.py +++ b/recipes/sdl_net/all/conanfile.py @@ -43,7 +43,7 @@ def layout(self): def requirements(self): # SDL_net.h includes SDL.h, SDL_endian.h and SDL_version.h - self.requires("sdl/2.28.2", transitive_headers=True) + self.requires("sdl/2.28.5", transitive_headers=True) def validate(self): if Version(self.version).major != Version(self.dependencies["sdl"].ref.version).major: @@ -65,7 +65,8 @@ def build(self): cmake.build() def package(self): - copy(self, "COPYING.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + license_file = "COPYING.txt" if Version(self.version) < "2.2.0" else "LICENSE.txt" + copy(self, license_file, self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() diff --git a/recipes/sdl_net/all/test_package/CMakeLists.txt b/recipes/sdl_net/all/test_package/CMakeLists.txt index 221605e46a6cf..c0d6830bbb07d 100644 --- a/recipes/sdl_net/all/test_package/CMakeLists.txt +++ b/recipes/sdl_net/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(SDL2 REQUIRED CONFIG) diff --git a/recipes/sdl_net/all/test_package/conanfile.py b/recipes/sdl_net/all/test_package/conanfile.py index 3a507f665d331..4c58e9c67e01f 100644 --- a/recipes/sdl_net/all/test_package/conanfile.py +++ b/recipes/sdl_net/all/test_package/conanfile.py @@ -14,7 +14,7 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) - self.requires("sdl/2.28.2") + self.requires("sdl/2.28.5") def build(self): cmake = CMake(self) diff --git a/recipes/sdl_net/all/test_v1_package/CMakeLists.txt b/recipes/sdl_net/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/sdl_net/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/sdl_net/all/test_v1_package/conanfile.py b/recipes/sdl_net/all/test_v1_package/conanfile.py deleted file mode 100644 index cb4e97ea795b6..0000000000000 --- a/recipes/sdl_net/all/test_v1_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 = os.path.join("bin", "test_package") - test_ip = "127.0.0.1" - self.run(f"{bin_path} {test_ip}", run_environment=True) diff --git a/recipes/sdl_net/config.yml b/recipes/sdl_net/config.yml index bb7eb85dfac49..0323e9f109615 100644 --- a/recipes/sdl_net/config.yml +++ b/recipes/sdl_net/config.yml @@ -1,3 +1,5 @@ versions: + "2.2.0": + folder: all "2.0.1": folder: all diff --git a/recipes/sdl_ttf/all/conandata.yml b/recipes/sdl_ttf/all/conandata.yml index 556b69cb6d777..55145b79f646d 100644 --- a/recipes/sdl_ttf/all/conandata.yml +++ b/recipes/sdl_ttf/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.24.0": + url: "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.24.0/SDL2_ttf-2.24.0.tar.gz" + sha256: "0b2bf1e7b6568adbdbc9bb924643f79d9dedafe061fa1ed687d1d9ac4e453bfd" + "2.22.0": + url: "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-2.22.0.tar.gz" + sha256: "d48cbd1ce475b9e178206bf3b72d56b66d84d44f64ac05803328396234d67723" "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" diff --git a/recipes/sdl_ttf/all/conanfile.py b/recipes/sdl_ttf/all/conanfile.py index 3fb325e526385..c492151a74a16 100644 --- a/recipes/sdl_ttf/all/conanfile.py +++ b/recipes/sdl_ttf/all/conanfile.py @@ -68,6 +68,9 @@ def validate(self): if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} shared is not supported with Visual Studio") + def build_requirements(self): + self.tool_requires("cmake/[>=3.17 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/sdl_ttf/all/test_package/CMakeLists.txt b/recipes/sdl_ttf/all/test_package/CMakeLists.txt index a17e98d94db30..05fb0d066a851 100644 --- a/recipes/sdl_ttf/all/test_package/CMakeLists.txt +++ b/recipes/sdl_ttf/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(SDL2_ttf REQUIRED CONFIG) diff --git a/recipes/sdl_ttf/all/test_package/OpenSans-Bold.ttf b/recipes/sdl_ttf/all/test_package/OpenSans-Bold.ttf deleted file mode 100644 index fd79d43bea029..0000000000000 Binary files a/recipes/sdl_ttf/all/test_package/OpenSans-Bold.ttf and /dev/null differ diff --git a/recipes/sdl_ttf/all/test_package/conanfile.py b/recipes/sdl_ttf/all/test_package/conanfile.py index c4fdfb4dbdc98..0a6bc68712d90 100644 --- a/recipes/sdl_ttf/all/test_package/conanfile.py +++ b/recipes/sdl_ttf/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - ttf_path = os.path.join(self.source_folder, "OpenSans-Bold.ttf") - self.run(f"{bin_path} {ttf_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/sdl_ttf/all/test_package/test_package.c b/recipes/sdl_ttf/all/test_package/test_package.c index 2050bc43e4215..20d9fde4b5f07 100644 --- a/recipes/sdl_ttf/all/test_package/test_package.c +++ b/recipes/sdl_ttf/all/test_package/test_package.c @@ -4,23 +4,11 @@ #include int main(int argc, char **argv) { - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - if (TTF_Init() == -1) { fprintf(stderr, "Failed to initialize TTF: %s\n", SDL_GetError()); return 1; } - TTF_Font *font = TTF_OpenFont(argv[1], 16); - - if (font == NULL) { - fprintf(stderr, "Failed to load font: %s\n", SDL_GetError()); - return 1; - } - printf("SDL2_ttf is working!\n"); return 0; diff --git a/recipes/sdl_ttf/all/test_v1_package/CMakeLists.txt b/recipes/sdl_ttf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/sdl_ttf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/sdl_ttf/all/test_v1_package/conanfile.py b/recipes/sdl_ttf/all/test_v1_package/conanfile.py deleted file mode 100644 index 7b775db727c08..0000000000000 --- a/recipes/sdl_ttf/all/test_v1_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 = os.path.join("bin", "test_package") - ttf_path = os.path.join(self.source_folder, os.pardir, "test_package", "OpenSans-Bold.ttf") - self.run(f"{bin_path} {ttf_path}", run_environment=True) diff --git a/recipes/sdl_ttf/config.yml b/recipes/sdl_ttf/config.yml index be62a6c021ae5..728bd4da40122 100644 --- a/recipes/sdl_ttf/config.yml +++ b/recipes/sdl_ttf/config.yml @@ -1,4 +1,8 @@ versions: + "2.24.0": + folder: all + "2.22.0": + folder: all "2.20.2": folder: all "2.20.1": diff --git a/recipes/seadex-essentials/all/test_v1_package/CMakeLists.txt b/recipes/seadex-essentials/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/seadex-essentials/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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-essentials/all/test_v1_package/conanfile.py b/recipes/seadex-essentials/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/seadex-essentials/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/all/test_v1_package/CMakeLists.txt b/recipes/seadex-genesis/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/seadex-genesis/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/seadex-genesis/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/seasocks/all/CMakeLists.txt b/recipes/seasocks/all/CMakeLists.txt index 56b7606e716f9..3fe499d60f36c 100644 --- a/recipes/seasocks/all/CMakeLists.txt +++ b/recipes/seasocks/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(conanbuildinfo.cmake) diff --git a/recipes/seasocks/all/conanfile.py b/recipes/seasocks/all/conanfile.py index 1662f1e11775f..555301b93f026 100644 --- a/recipes/seasocks/all/conanfile.py +++ b/recipes/seasocks/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class SeasocksConan(ConanFile): name = "seasocks" @@ -15,6 +15,7 @@ class SeasocksConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mattgodbolt/seasocks" topics = ("embeddable", "webserver", "websockets") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -86,6 +87,8 @@ def generate(self): tc.variables["SEASOCKS_SHARED"] = self.options.shared tc.variables["SEASOCKS_EXAMPLE_APP"] = False tc.variables["UNITTESTS"] = False + if Version(self.version) < "1.4.6": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) @@ -114,11 +117,6 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libseasocks"].system_libs.extend(["pthread", "m"]) - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "Seasocks" - self.cpp_info.names["cmake_find_package_multi"] = "Seasocks" - self.cpp_info.components["libseasocks"].names["cmake_find_package"] = "seasocks" - self.cpp_info.components["libseasocks"].names["cmake_find_package_multi"] = "seasocks" self.cpp_info.components["libseasocks"].set_property("cmake_target_name", "Seasocks::seasocks") if self.options.with_zlib: self.cpp_info.components["libseasocks"].requires = ["zlib::zlib"] diff --git a/recipes/seasocks/all/test_package/CMakeLists.txt b/recipes/seasocks/all/test_package/CMakeLists.txt index f005fadc41716..b44ac1bb0bd10 100644 --- a/recipes/seasocks/all/test_package/CMakeLists.txt +++ b/recipes/seasocks/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(Seasocks REQUIRED CONFIG) diff --git a/recipes/seasocks/all/test_v1_package/CMakeLists.txt b/recipes/seasocks/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/seasocks/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/seasocks/all/test_v1_package/conanfile.py b/recipes/seasocks/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/seasocks/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/semimap/all/test_package/CMakeLists.txt b/recipes/semimap/all/test_package/CMakeLists.txt index 07f01c03a2b1b..ccc97fa45c802 100644 --- a/recipes/semimap/all/test_package/CMakeLists.txt +++ b/recipes/semimap/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(semimap REQUIRED CONFIG) diff --git a/recipes/semimap/all/test_v1_package/CMakeLists.txt b/recipes/semimap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/semimap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/semimap/all/test_v1_package/conanfile.py b/recipes/semimap/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/semimap/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/semver.c/all/CMakeLists.txt b/recipes/semver.c/all/CMakeLists.txt index 38d90f4390989..c812c8222af15 100644 --- a/recipes/semver.c/all/CMakeLists.txt +++ b/recipes/semver.c/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(semver.c LANGUAGES C) include(GNUInstallDirs) diff --git a/recipes/semver.c/all/test_package/CMakeLists.txt b/recipes/semver.c/all/test_package/CMakeLists.txt index 96e57e4c4f92b..a4058d06097fd 100644 --- a/recipes/semver.c/all/test_package/CMakeLists.txt +++ b/recipes/semver.c/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(semver.c CONFIG REQUIRED) diff --git a/recipes/semver.c/all/test_v1_package/CMakeLists.txt b/recipes/semver.c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/semver.c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/semver.c/all/test_v1_package/conanfile.py b/recipes/semver.c/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/semver.c/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_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/sentry-breakpad/all/test_package/CMakeLists.txt b/recipes/sentry-breakpad/all/test_package/CMakeLists.txt index c1914e41dc58f..93a4462a84c29 100644 --- a/recipes/sentry-breakpad/all/test_package/CMakeLists.txt +++ b/recipes/sentry-breakpad/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(PkgConfig REQUIRED) diff --git a/recipes/sentry-crashpad/all/test_package/CMakeLists.txt b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt index f90e3b77e86ad..6c82ca92e1348 100644 --- a/recipes/sentry-crashpad/all/test_package/CMakeLists.txt +++ b/recipes/sentry-crashpad/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) diff --git a/recipes/sentry-native/all/conandata.yml b/recipes/sentry-native/all/conandata.yml index ced5e36dba275..f00a947e630a8 100644 --- a/recipes/sentry-native/all/conandata.yml +++ b/recipes/sentry-native/all/conandata.yml @@ -1,16 +1,13 @@ sources: - "0.6.5": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.5/sentry-native.zip" - sha256: "5f74a5c5c3abc6e1e7825d3306be9e3b3fd4e0f586f3cf7e86607d6f56a71995" - "0.6.4": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.4/sentry-native.zip" - sha256: "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38" - "0.6.3": - url: "https://github.com/getsentry/sentry-native/releases/download/0.6.3/sentry-native.zip" - sha256: "6b515c17a9b860ea47c6a5fd7abdfdc89b4b8cbc654c23a8bb42a39bfcb87ad9" - "0.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" + "0.8.3": + url: "https://github.com/getsentry/sentry-native/releases/download/0.8.3/sentry-native.zip" + sha256: "26a3f2118b5fde469659f5c48eb8cdc70b7a43aea8d2bdf9efb0d6fa6ac36cb6" + "0.8.1": + url: "https://github.com/getsentry/sentry-native/releases/download/0.8.1/sentry-native.zip" + sha256: "a7fe694b36fa61903704f93c6aff79b0bb5b27726b1075a47855b6ed58028108" + "0.7.20": + url: "https://github.com/getsentry/sentry-native/releases/download/0.7.20/sentry-native.zip" + sha256: "bf8afca08506cd3f48c273ccf75bee37b030392369317afc40188bf478aa6902" + "0.6.6": + url: "https://github.com/getsentry/sentry-native/releases/download/0.6.6/sentry-native.zip" + sha256: "7a98467c0b2571380a3afc5e681cb13aa406a709529be12d74610b0015ccde0c" diff --git a/recipes/sentry-native/all/conanfile.py b/recipes/sentry-native/all/conanfile.py index 35bd2e66caa37..3e29dc02bbc0b 100644 --- a/recipes/sentry-native/all/conanfile.py +++ b/recipes/sentry-native/all/conanfile.py @@ -1,3 +1,5 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os @@ -5,12 +7,9 @@ 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 -from conan.tools.gnu import PkgConfigDeps -from conan.tools.microsoft import is_msvc from conan.tools.scm import Version -import os -required_conan_version = ">=1.55.0" +required_conan_version = ">=2.1" class SentryNativeConan(ConanFile): @@ -34,8 +33,9 @@ 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], + "wer": [True, False], } default_options = { "shared": False, @@ -44,22 +44,37 @@ class SentryNativeConan(ConanFile): "transport": "curl", # overwritten in config_options "qt": False, "with_crashpad": "sentry", + "crashpad_with_tls": "openssl", "with_breakpad": "sentry", - "wer": False + "wer": False, } @property def _min_cppstd(self): - if is_msvc(self): + if Version(self.version) >= "0.7.8" and self.options.get_safe("with_crashpad") == "sentry": + return "20" + else: return "17" - return "14" @property def _minimum_compilers_version(self): + if Version(self.version) >= "0.7.8" and self.options.get_safe("with_crashpad") == "sentry": + # Sentry-native 0.7.8 requires C++20: Concepts and bit_cast + # https://github.com/chromium/mini_chromium/blob/e49947ad445c4ed4bc1bb4ed60bbe0fe17efe6ec/base/numerics/byte_conversions.h#L88 + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "11", + "clang": "14", + "apple-clang": "14", + } + minimum_gcc_version = "5" + if self.options.get_safe("backend") == "breakpad" or self.options.get_safe("backend") == "crashpad": + minimum_gcc_version = "7" return { "Visual Studio": "15", "msvc": "191", - "gcc": "5", + "gcc": minimum_gcc_version, "clang": "3.4", "apple-clang": "5.1", } @@ -68,27 +83,24 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.os != "Windows" or Version(self.version) < "0.6.0": + if self.settings.os != "Windows": del self.options.wer # Configure default transport if self.settings.os == "Windows": + self.options.backend = "crashpad" self.options.transport = "winhttp" - elif self.settings.os in ("FreeBSD", "Linux") or self.settings.os == "Macos": # Don't use tools.is_apple_os(os) here - self.options.transport = "curl" - else: + elif self.settings.os == "Android": self.options.transport = "none" # Configure default backend - if self.settings.os == "Windows" or self.settings.os == "Macos": # Don't use tools.is_apple_os(os) here - # FIXME: for self.version < 0.4: default backend is "breakpad" when building with MSVC for Windows xp; else: backend=none + # See https://github.com/getsentry/sentry-native/pull/927 + if self.settings.os == "Macos": self.options.backend = "crashpad" - elif self.settings.os in ("FreeBSD", "Linux"): - self.options.backend = "breakpad" - elif self.settings.os == "Android": - self.options.backend = "inproc" - else: - self.options.backend = "inproc" + if self.settings.os in ("FreeBSD", "Linux"): + self.options.backend = "breakpad" if Version(self.version) < "0.7.0" else "crashpad" + 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: @@ -105,13 +117,13 @@ def requirements(self): if self.options.transport == "curl": 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.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"): @@ -119,8 +131,7 @@ def requirements(self): self.requires("openssl/[>=1.1 <4]") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_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: @@ -135,9 +146,6 @@ def validate(self): def build_requirements(self): if self.settings.os == "Windows": self.tool_requires("cmake/[>=3.16.4 <4]") - if self.options.backend == "breakpad": - if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version]) @@ -146,8 +154,11 @@ 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 + # See https://github.com/getsentry/sentry-native/pull/928 + if Version(self.version) < "0.7.0" and 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) @@ -158,8 +169,6 @@ def generate(self): tc.variables["CRASHPAD_WER_ENABLED"] = True tc.generate() CMakeDeps(self).generate() - if self.options.backend == "breakpad": - PkgConfigDeps(self).generate() def build(self): cmake = CMake(self) @@ -175,25 +184,120 @@ 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"]) + 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"] - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "sentry" - self.cpp_info.names["cmake_find_package_multi"] = "sentry" + 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/sentry-native/all/test_package/CMakeLists.txt b/recipes/sentry-native/all/test_package/CMakeLists.txt index 8b84ac464d998..484af40d886c9 100644 --- a/recipes/sentry-native/all/test_package/CMakeLists.txt +++ b/recipes/sentry-native/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(sentry REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE sentry::sentry) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) 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/all/test_v1_package/CMakeLists.txt b/recipes/sentry-native/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/sentry-native/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/sentry-native/all/test_v1_package/conanfile.py b/recipes/sentry-native/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sentry-native/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_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/sentry-native/config.yml b/recipes/sentry-native/config.yml index 3450228c14b09..157a8249183ec 100644 --- a/recipes/sentry-native/config.yml +++ b/recipes/sentry-native/config.yml @@ -1,11 +1,9 @@ versions: - "0.6.5": + "0.8.3": folder: all - "0.6.4": + "0.8.1": folder: all - "0.6.3": + "0.7.20": folder: all - "0.5.4": - folder: all - "0.4.18": + "0.6.6": folder: all diff --git a/recipes/seqan/2.x.x/test_v1_package/CMakeLists.txt b/recipes/seqan/2.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/seqan/2.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index abcaeed3f89b6..0000000000000 --- a/recipes/seqan/2.x.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/conandata.yml b/recipes/seqan3/all/conandata.yml index 7b4ddfdc76fc6..ee19f74eeca81 100644 --- a/recipes/seqan3/all/conandata.yml +++ b/recipes/seqan3/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.3.0": + url: "https://github.com/seqan/seqan3/releases/download/3.3.0/seqan3-3.3.0-Source.tar.xz" + sha256: "da2fb621268ebc52b9cc26087e96f4a94109db1f4f28d363d19c7c9cdbd788b1" "3.1.0": - url: https://github.com/seqan/seqan3/releases/download/3.1.0/seqan3-3.1.0-Source.tar.xz - sha256: 0b37b1c3450e19c0ebe42c052c3f87babb8074bd772f10a553949c312c285726 + url: "https://github.com/seqan/seqan3/releases/download/3.1.0/seqan3-3.1.0-Source.tar.xz" + sha256: "0b37b1c3450e19c0ebe42c052c3f87babb8074bd772f10a553949c312c285726" diff --git a/recipes/seqan3/all/conanfile.py b/recipes/seqan3/all/conanfile.py index 10b57ed42fdf7..9ea0680d5bf45 100644 --- a/recipes/seqan3/all/conanfile.py +++ b/recipes/seqan3/all/conanfile.py @@ -28,7 +28,9 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): - return {"gcc": "10"} + if Version(self.version) < "3.3.0": + return {"gcc": "10"} + return {"gcc": "11"} def layout(self): basic_layout(self, src_folder="src") @@ -44,11 +46,8 @@ def validate(self): 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("SeqAn3 requires C++20, which your compiler does not fully support.") - else: - self.output.warning("SeqAn3 requires C++20. Your compiler is unknown. Assuming it supports C++20.") + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("SeqAn3 requires C++20, which your compiler does not fully support.") if self.settings.compiler == "gcc" and self.settings.compiler.libcxx != "libstdc++11": self.output.warning("SeqAn3 does not actively support libstdc++, consider using libstdc++11 instead.") diff --git a/recipes/seqan3/all/test_v1_package/CMakeLists.txt b/recipes/seqan3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/seqan3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/seqan3/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_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/seqan3/config.yml b/recipes/seqan3/config.yml index 9370babb6565a..8d4de7c167625 100644 --- a/recipes/seqan3/config.yml +++ b/recipes/seqan3/config.yml @@ -1,3 +1,5 @@ versions: + "3.3.0": + folder: "all" "3.1.0": folder: "all" diff --git a/recipes/serd/all/conandata.yml b/recipes/serd/all/conandata.yml index b401b2ad15e33..87d44aaa3ef2a 100644 --- a/recipes/serd/all/conandata.yml +++ b/recipes/serd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.32.0": + url: "https://gitlab.com/drobilla/serd/-/archive/v0.32.0/serd-v0.32.0.tar.gz" + sha256: "355bc7c7fe366e5d4ce32641e4f55d35f8226169ac2d9a2824b1443ab7c03ec8" "0.30.16": url: "https://gitlab.com/drobilla/serd/-/archive/v0.30.16/serd-v0.30.16.tar.gz" sha256: "c139e02af039e277fb1b7deb2a687477bf6ec46cd6348bbb1232c2727a1dd744" diff --git a/recipes/serd/all/conanfile.py b/recipes/serd/all/conanfile.py index b5008dc8cfa01..cfa7c895a4697 100644 --- a/recipes/serd/all/conanfile.py +++ b/recipes/serd/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 is_msvc +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -74,7 +75,7 @@ def package(self): def package_info(self): self.cpp_info.set_property("pkg_config_name", "serd-0") libname = "serd" - if not (is_msvc(self) and self.options.shared): + if (not (is_msvc(self) and self.options.shared)) or (Version(self.version) >= "0.32.0" and is_msvc(self)): libname += "-0" self.cpp_info.libs = [libname] self.cpp_info.includedirs = [os.path.join("include", "serd-0")] diff --git a/recipes/serd/all/test_package/CMakeLists.txt b/recipes/serd/all/test_package/CMakeLists.txt index 37cde52c36d91..45d514599b264 100644 --- a/recipes/serd/all/test_package/CMakeLists.txt +++ b/recipes/serd/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(serd REQUIRED CONFIG) diff --git a/recipes/serd/all/test_v1_package/CMakeLists.txt b/recipes/serd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/serd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/serd/all/test_v1_package/conanfile.py b/recipes/serd/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/serd/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_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/config.yml b/recipes/serd/config.yml index 9877695aeb2f5..bfcc718ff5128 100644 --- a/recipes/serd/config.yml +++ b/recipes/serd/config.yml @@ -1,4 +1,6 @@ versions: + "0.32.0": + folder: all "0.30.16": folder: all "0.30.14": diff --git a/recipes/serdepp/all/conanfile.py b/recipes/serdepp/all/conanfile.py index 433b310f78080..8db8ca27da233 100644 --- a/recipes/serdepp/all/conanfile.py +++ b/recipes/serdepp/all/conanfile.py @@ -59,15 +59,15 @@ 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") + self.requires("toml11/3.8.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") + self.requires("fmt/10.2.1") if self.options.with_nlohmann_json: - self.requires("nlohmann_json/3.11.2") + self.requires("nlohmann_json/3.11.3") def package_id(self): self.info.clear() diff --git a/recipes/serdepp/all/test_v1_package/CMakeLists.txt b/recipes/serdepp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/serdepp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index e788460ad0765..0000000000000 --- a/recipes/serdepp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/conanfile.py b/recipes/serial/all/conanfile.py index b0bd05408cdc0..833be5f08f14f 100644 --- a/recipes/serial/all/conanfile.py +++ b/recipes/serial/all/conanfile.py @@ -1,11 +1,13 @@ import os from conan import ConanFile +from conan.errors import ConanException from conan.tools.apple import is_apple_os 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 = ">=2.1" class ConanRecipe(ConanFile): @@ -49,6 +51,9 @@ def generate(self): tc = CMakeToolchain(self) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.2.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): diff --git a/recipes/serial/all/test_v1_package/CMakeLists.txt b/recipes/serial/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/serial/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 1bf1c7e26255d..0000000000000 --- a/recipes/serial/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 8cb01ed6a8b53..0000000000000 --- a/recipes/serial/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#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/sfl/all/conandata.yml b/recipes/sfl/all/conandata.yml new file mode 100644 index 0000000000000..c24818932cd5e --- /dev/null +++ b/recipes/sfl/all/conandata.yml @@ -0,0 +1,34 @@ +sources: + "1.9.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.9.0.tar.gz" + sha256: "89b21506026faba84c42e24256eb41f990f76fc7b9d7db8c983dc585a41594d3" + "1.8.2": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.8.2.tar.gz" + sha256: "06dc215f73ebfbbcbb4ef39cd556bffe0da16918f542045407f51c4b9effcabb" + "1.8.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.8.0.tar.gz" + sha256: "bb473a8e0b46ecff957c06112593b9a4104e0d1ec8e9d5840ff33c20ad3a243e" + "1.7.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.7.0.tar.gz" + sha256: "9e09bacc51cfb085c4a6030f90cbea45685de608900d6b7b3c0a9f4971682652" + "1.6.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.6.0.tar.gz" + sha256: "f5121d95c2f3922da4f1cec9bb6045d8733892ddc55ee3c47c99e761e5df5ec4" + "1.5.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.5.0.tar.gz" + sha256: "767d9b3627540071d2a80f18f034d80d6e9eaffc027876c7898c51aeebd3bf37" + "1.4.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.4.0.tar.gz" + sha256: "dcdc6c40a60116075910e3321fe12065142d78f4947826aac263ade1d84d449a" + "1.3.1": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.3.1.tar.gz" + sha256: "e541857067ae3e6c8d9933736e70ef92c1ce0a0e374872497328edd2e4e47ae9" + "1.3.0": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.3.0.tar.gz" + sha256: "1d0e797c5e11bbc861f9f1ae8eb7d9378d456d6cd1c43e00cdec6d3664e745e6" + "1.2.4": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.2.4.tar.gz" + sha256: "e24d4adb1aff638e17ef49841881992a1020dc951e4e9721b81b76d44ef89f5b" + "1.2.3": + url: "https://github.com/slavenf/sfl-library/archive/refs/tags/1.2.3.tar.gz" + sha256: "6111a81b5dcad091c5c8a420d127c1bbfb06f8fbb7d915e6a30b4b7d2d67db71" diff --git a/recipes/sfl/all/conanfile.py b/recipes/sfl/all/conanfile.py new file mode 100644 index 0000000000000..ef6582dd3b15f --- /dev/null +++ b/recipes/sfl/all/conanfile.py @@ -0,0 +1,45 @@ +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.62.0" + + +class SflConan(ConanFile): + name = "sfl" + description = "A header-only C++11 library that offers several new containers" + license = "Zlib" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/slavenf/sfl-library" + topics = ("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, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", 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 = [] diff --git a/recipes/sfl/all/test_package/CMakeLists.txt b/recipes/sfl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f8085bbcbe2d6 --- /dev/null +++ b/recipes/sfl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(sfl REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sfl::sfl) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sfl/all/test_package/conanfile.py b/recipes/sfl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e62d4fe972ff2 --- /dev/null +++ b/recipes/sfl/all/test_package/conanfile.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +from conan 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/sfl/all/test_package/test_package.cpp b/recipes/sfl/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..78ba6f47df1d5 --- /dev/null +++ b/recipes/sfl/all/test_package/test_package.cpp @@ -0,0 +1,23 @@ +#include + +#include "sfl/small_vector.hpp" +#include "sfl/small_flat_set.hpp" +#include "sfl/small_flat_map.hpp" +#include "sfl/small_flat_multiset.hpp" +#include "sfl/small_flat_multimap.hpp" +#include "sfl/small_unordered_flat_set.hpp" +#include "sfl/small_unordered_flat_map.hpp" +#include "sfl/small_unordered_flat_multiset.hpp" +#include "sfl/small_unordered_flat_multimap.hpp" +#include "sfl/compact_vector.hpp" +#include "sfl/segmented_vector.hpp" + +int main() { + sfl::small_vector v1; + v1.push_back(123); + + sfl::segmented_vector v2; + v2.push_back(123); + + return EXIT_SUCCESS; +} diff --git a/recipes/sfl/config.yml b/recipes/sfl/config.yml new file mode 100644 index 0000000000000..02a9c7e5de56c --- /dev/null +++ b/recipes/sfl/config.yml @@ -0,0 +1,23 @@ +versions: + "1.9.0": + folder: "all" + "1.8.2": + folder: "all" + "1.8.0": + folder: "all" + "1.7.0": + folder: "all" + "1.6.0": + folder: "all" + "1.5.0": + folder: "all" + "1.4.0": + folder: "all" + "1.3.1": + folder: "all" + "1.3.0": + folder: "all" + "1.2.4": + folder: "all" + "1.2.3": + folder: "all" diff --git a/recipes/sfml/all/conandata.yml b/recipes/sfml/all/conandata.yml index 37e057f517a7d..e8b0f34c7c588 100644 --- a/recipes/sfml/all/conandata.yml +++ b/recipes/sfml/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6.2": + url: "https://www.sfml-dev.org/files/SFML-2.6.2-sources.zip" + sha256: "19d6dbd9c901c74441d9888c13cb1399f614fe8993d59062a72cfbceb00fed04" "2.6.1": url: "https://www.sfml-dev.org/files/SFML-2.6.1-sources.zip" sha256: "5bf19e5c303516987f7f54d4ff1b208a0f9352ffa1cd55f992527016de0e8cb7" @@ -9,6 +12,16 @@ sources: url: "https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip" sha256: "bf1e0643acb92369b24572b703473af60bac82caf5af61e77c063b779471bb7f" patches: + "2.6.2": + - patch_file: "patches/2.6.2-0001-cmake-robust-find-deps.patch" + patch_description: "Robust discovery of dependencies" + patch_type: "conan" + - patch_file: "patches/2.6.2-0003-allow-shared-MT.patch" + patch_description: "Allow to build shared SFML with MT runtime" + 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" "2.6.1": - patch_file: "patches/2.6.0-0001-cmake-robust-find-deps.patch" patch_description: "Robust discovery of dependencies" diff --git a/recipes/sfml/all/conanfile.py b/recipes/sfml/all/conanfile.py index c29aef0d78113..54c2d3087bcf4 100644 --- a/recipes/sfml/all/conanfile.py +++ b/recipes/sfml/all/conanfile.py @@ -63,7 +63,7 @@ def requirements(self): 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": @@ -99,6 +99,13 @@ def generate(self): tc.variables["SFML_USE_STATIC_STD_LIBS"] = is_msvc_static_runtime(self) tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "2.6.2": + if self.options.audio: + deps.set_property("vorbis", "cmake_file_name", "VORBIS") + if self.options.graphics: + deps.set_property("freetype", "cmake_file_name", "Freetype") + deps.set_property("freetype", "cmake_additional_variables_prefixes", ["FREETYPE"]) + deps.set_property("freetype", "cmake_target_name", "Freetype") deps.generate() def build(self): @@ -115,27 +122,6 @@ def package(self): 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( - os.path.join(self.package_folder, self._module_file_rel_path), - {values["target"]: f"SFML::{component}" for component, values in self._sfml_components.items()} - ) - - 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") - @property def _sfml_components(self): def gdi32(): @@ -305,13 +291,4 @@ def _register_components(components): 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] - self.cpp_info.components[component].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - _register_components(self._sfml_components) - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "SFML" - self.cpp_info.names["cmake_find_package_multi"] = "SFML" - self.cpp_info.names["pkgconfig"] = "sfml-all" diff --git a/recipes/sfml/all/patches/2.6.2-0001-cmake-robust-find-deps.patch b/recipes/sfml/all/patches/2.6.2-0001-cmake-robust-find-deps.patch new file mode 100644 index 0000000000000..5cd33b253b9f0 --- /dev/null +++ b/recipes/sfml/all/patches/2.6.2-0001-cmake-robust-find-deps.patch @@ -0,0 +1,54 @@ +diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt +index 8158365..a2e029a 100644 +--- a/src/SFML/Audio/CMakeLists.txt ++++ b/src/SFML/Audio/CMakeLists.txt +@@ -73,8 +73,8 @@ 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") ++# 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 +@@ -84,7 +84,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) +@@ -92,4 +93,4 @@ endif() + + target_link_libraries(sfml-audio + PUBLIC sfml-system +- PRIVATE VORBIS FLAC) ++ PRIVATE Vorbis::vorbisenc Vorbis::vorbisfile FLAC::FLAC minimp3::minimp3) +diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt +index a939a98..6f16273 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,7 +124,7 @@ 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") ++find_package(Freetype REQUIRED) + target_link_libraries(sfml-graphics PRIVATE Freetype) + + # add preprocessor symbols diff --git a/recipes/sfml/all/patches/2.6.2-0003-allow-shared-MT.patch b/recipes/sfml/all/patches/2.6.2-0003-allow-shared-MT.patch new file mode 100644 index 0000000000000..57308c95f28c9 --- /dev/null +++ b/recipes/sfml/all/patches/2.6.2-0003-allow-shared-MT.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a302f23..afe1830 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -208,7 +208,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/test_v1_package/CMakeLists.txt b/recipes/sfml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/sfml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/sfml/all/test_v1_package/conanfile.py b/recipes/sfml/all/test_v1_package/conanfile.py deleted file mode 100644 index d431379ec6c21..0000000000000 --- a/recipes/sfml/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +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.definitions["SFML_WITH_WINDOW"] = self.options["sfml"].window - cmake.definitions["SFML_WITH_GRAPHICS"] = self.options["sfml"].graphics - cmake.definitions["SFML_WITH_NETWORK"] = self.options["sfml"].network - cmake.definitions["SFML_WITH_AUDIO"] = self.options["sfml"].audio - 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/sfml/config.yml b/recipes/sfml/config.yml index 7ce3d994f27a7..20ad3255593e1 100644 --- a/recipes/sfml/config.yml +++ b/recipes/sfml/config.yml @@ -1,4 +1,6 @@ versions: + "2.6.2": + folder: all "2.6.1": folder: all "2.6.0": diff --git a/recipes/shaderc/all/CMakeLists.txt b/recipes/shaderc/all/CMakeLists.txt deleted file mode 100644 index 4d393c7a86c09..0000000000000 --- a/recipes/shaderc/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/shaderc/all/conandata.yml b/recipes/shaderc/all/conandata.yml index 36e3a9f3b6b76..25858ddef7954 100644 --- a/recipes/shaderc/all/conandata.yml +++ b/recipes/shaderc/all/conandata.yml @@ -1,16 +1,47 @@ sources: + "2024.1": + url: "https://github.com/google/shaderc/archive/refs/tags/v2024.1.tar.gz" + sha256: "eb3b5f0c16313d34f208d90c2fa1e588a23283eed63b101edd5422be6165d528" + "2023.6": + url: "https://github.com/google/shaderc/archive/refs/tags/v2023.6.tar.gz" + sha256: "e40fd4a87a56f6610e223122179f086d5c4f11a7e0e2aa461f0325c3a0acc6ae" "2021.1": url: "https://github.com/google/shaderc/archive/v2021.1.tar.gz" sha256: "047113bc4628da164a3cb845efc20d442728873f6054a68ab56d04a053f2c32b" - "2019.0": - url: "https://github.com/google/shaderc/archive/v2019.0.tar.gz" - sha256: "1018cd02be52295272fdbffa056ee24b881be277c83d039ad554d91230f4e11b" patches: + "2024.1": + - patch_file: "patches/2023.6/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" + "2023.6": + - patch_file: "patches/2023.6/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" "2021.1": - - patch_file: "patches/2021.1/fix-cmake.patch" - base_path: "source_subfolder" - "2019.0": - - patch_file: "patches/2019.0/fix-cmake.patch" - base_path: "source_subfolder" - - patch_file: "patches/2019.0/fix-spvc.patch" - base_path: "source_subfolder" + - patch_file: "patches/2021.1/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" +siprv_mapping: + # TODO: bump me once newer versions are available on CCI + "2024.1": "1.3.261.1" + # "2023.6": "1.3.261.1" + "2023.6": "1.3.239.0" + "2021.1": "1.3.224.0" diff --git a/recipes/shaderc/all/conanfile.py b/recipes/shaderc/all/conanfile.py index 431f1292c6d2f..309b53f6cb235 100644 --- a/recipes/shaderc/all/conanfile.py +++ b/recipes/shaderc/all/conanfile.py @@ -1,131 +1,133 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.36.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd, stdcpp_library +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.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.apple import fix_apple_shared_install_name + +required_conan_version = ">=1.53.0" class ShadercConan(ConanFile): name = "shaderc" description = "A collection of tools, libraries and tests for shader compilation." license = "Apache-2.0" - topics = ("glsl", "hlsl", "msl", "spirv", "spir-v", "glslc", "spvc") - homepage = "https://github.com/google/shaderc" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/shaderc" + topics = ("glsl", "hlsl", "msl", "spirv", "spir-v", "glslc") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "spvc": [True, False], } default_options = { "shared": False, "fPIC": True, - "spvc": False, } - 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": del self.options.fPIC - if tools.Version(self.version) >= "2020.4": - del self.options.spvc def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") - @property - def _get_compatible_spirv_tools_version(self): - return { - "2021.1": "2021.2", - "2019.0": "2020.5" - }.get(str(self.version), False) + def layout(self): + cmake_layout(self, src_folder="src") @property - def _get_compatible_glslang_version(self): - return { - "2021.1": "11.5.0", - "2019.0": "8.13.3559" - }.get(str(self.version), False) + def _spirv_version(self): + return self.conan_data.get("siprv_mapping")[self.version] def requirements(self): - self.requires("glslang/{}".format(self._get_compatible_glslang_version)) - self.requires("spirv-tools/{}".format(self._get_compatible_spirv_tools_version)) - if self.options.get_safe("spvc", False): - self.requires("spirv-cross/20210115") + # transitive_headers=True is not required for any of the dependencies + self.requires(f"glslang/{self._spirv_version}") + self.requires(f"spirv-tools/{self._spirv_version}") + self.requires(f"spirv-headers/{self._spirv_version}") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.17.2 <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): + venv = VirtualBuildEnv(self) + venv.generate() + + tc = CMakeToolchain(self) + tc.cache_variables["SHADERC_SKIP_INSTALL"] = False + tc.cache_variables["SHADERC_SKIP_EXAMPLES"] = True + tc.cache_variables["SHADERC_SKIP_TESTS"] = True + tc.cache_variables["ENABLE_CODE_COVERAGE"] = False + tc.cache_variables["SHADERC_ENABLE_WERROR_COMPILE"] = False + if is_msvc(self): + tc.cache_variables["SHADERC_ENABLE_SHARED_CRT"] = not is_msvc_static_runtime(self) + tc.generate() + + self.dependencies["glslang"].cpp_info.components["glslang-core"].includedirs.append( + os.path.join(self.dependencies["glslang"].package_folder, "include", "glslang") + ) + + deps = CMakeDeps(self) + deps.set_property("glslang::glslang-core", "cmake_target_name", "glslang") + deps.set_property("glslang::osdependent", "cmake_target_name", "OSDependent") + deps.set_property("glslang::oglcompiler", "cmake_target_name", "OGLCompiler") + deps.set_property("glslang::hlsl", "cmake_target_name", "HLSL") + deps.set_property("glslang::spirv", "cmake_target_name", "SPIRV") + 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 _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - self._cmake.definitions["SHADERC_ENABLE_SPVC"] = self.options.get_safe("spvc", False) - self._cmake.definitions["SHADERC_SKIP_INSTALL"] = False - self._cmake.definitions["SHADERC_SKIP_TESTS"] = True - self._cmake.definitions["SHADERC_SPVC_ENABLE_DIRECT_LOGGING"] = False - self._cmake.definitions["SHADERC_SPVC_DISABLE_CONTEXT_LOGGING"] = False - self._cmake.definitions["SHADERC_ENABLE_WERROR_COMPILE"] = False - if self.settings.compiler == "Visual Studio": - self._cmake.definitions["SHADERC_ENABLE_SHARED_CRT"] = str(self.settings.compiler.runtime).startswith("MD") - self._cmake.definitions["ENABLE_CODE_COVERAGE"] = False - if tools.is_apple_os(self.settings.os): - self._cmake.definitions["CMAKE_MACOSX_BUNDLE"] = 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", "pkgconfig")) + fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.set_property("pkg_config_name", "shaderc" if self.options.shared else "shaderc_static") - self.cpp_info.libs = self._get_ordered_libs() - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") - if not self.options.shared and tools.stdcpp_library(self): - self.cpp_info.system_libs.append(tools.stdcpp_library(self)) if self.options.shared: + self.cpp_info.set_property("pkg_config_name", "shaderc") + self.cpp_info.libs = ["shaderc_shared"] self.cpp_info.defines.append("SHADERC_SHAREDLIB") + else: + self.cpp_info.set_property("pkg_config_name", "shaderc_static") + self.cpp_info.libs = ["shaderc", "shaderc_util"] + if stdcpp_library(self): + self.cpp_info.system_libs.append(stdcpp_library(self)) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + + self.cpp_info.requires = [ + "glslang::glslang-core", + "glslang::osdependent", + "glslang::oglcompiler", + "glslang::hlsl", + "glslang::spirv", + "spirv-tools::spirv-tools-core", + "spirv-tools::spirv-tools-opt", + "spirv-headers::spirv-headers" + ] + + # 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) - - def _get_ordered_libs(self): - libs = ["shaderc_shared" if self.options.shared else "shaderc"] - if not self.options.shared: - libs.append("shaderc_util") - if self.options.get_safe("spvc", False): - libs.append("shaderc_spvc_shared" if self.options.shared else "shaderc_spvc") - return libs diff --git a/recipes/shaderc/all/patches/2019.0/fix-cmake.patch b/recipes/shaderc/all/patches/2019.0/fix-cmake.patch deleted file mode 100644 index 1fee3bf35ecf3..0000000000000 --- a/recipes/shaderc/all/patches/2019.0/fix-cmake.patch +++ /dev/null @@ -1,402 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -70,7 +70,6 @@ endif(MSVC) - - # Configure subdirectories. - # We depend on these for later projects, so they should come first. --add_subdirectory(third_party) - - if(SHADERC_ENABLE_SPVC) - add_subdirectory(libshaderc_spvc) -@@ -79,12 +78,11 @@ endif() - add_subdirectory(libshaderc_util) - add_subdirectory(libshaderc) - add_subdirectory(glslc) --add_subdirectory(examples) - - add_custom_target(build-version - ${PYTHON_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py -- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} -+ ${shaderc_SOURCE_DIR} - COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).") - - function(define_pkg_config_file NAME LIBS) ---- a/cmake/utils.cmake -+++ b/cmake/utils.cmake -@@ -11,7 +11,6 @@ function(shaderc_default_c_compile_options TARGET) - if (NOT "${MSVC}") - target_compile_options(${TARGET} PRIVATE -Wall -Werror -fvisibility=hidden) - if (NOT "${MINGW}") -- target_compile_options(${TARGET} PRIVATE -fPIC) - endif() - if (ENABLE_CODE_COVERAGE) - # The --coverage option is a synonym for -fprofile-arcs -ftest-coverage -@@ -24,10 +23,6 @@ function(shaderc_default_c_compile_options TARGET) - endif() - if (NOT SHADERC_ENABLE_SHARED_CRT) - if (WIN32) -- # For MinGW cross compile, statically link to the libgcc runtime. -- # But it still depends on MSVCRT.dll. -- set_target_properties(${TARGET} PROPERTIES -- LINK_FLAGS "-static -static-libgcc") - endif(WIN32) - endif(NOT SHADERC_ENABLE_SHARED_CRT) - else() -@@ -40,13 +35,8 @@ endfunction(shaderc_default_c_compile_options) - function(shaderc_default_compile_options TARGET) - shaderc_default_c_compile_options(${TARGET}) - if (NOT "${MSVC}") -- target_compile_options(${TARGET} PRIVATE -std=c++11) - if (NOT SHADERC_ENABLE_SHARED_CRT) - if (WIN32) -- # For MinGW cross compile, statically link to the C++ runtime. -- # But it still depends on MSVCRT.dll. -- set_target_properties(${TARGET} PROPERTIES -- LINK_FLAGS "-static -static-libgcc -static-libstdc++") - endif(WIN32) - endif(NOT SHADERC_ENABLE_SHARED_CRT) - endif() ---- a/glslc/CMakeLists.txt -+++ b/glslc/CMakeLists.txt -@@ -16,31 +16,19 @@ add_library(glslc STATIC - ) - - shaderc_default_compile_options(glslc) --target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR}) --target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler -- HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT}) --target_link_libraries(glslc PRIVATE shaderc_util shaderc) -+target_link_libraries(glslc PRIVATE ${CMAKE_THREAD_LIBS_INIT}) -+target_link_libraries(glslc PUBLIC shaderc_util shaderc) - - add_executable(glslc_exe src/main.cc) - shaderc_default_compile_options(glslc_exe) --target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${spirv-tools_SOURCE_DIR}/include) -+target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..) - set_target_properties(glslc_exe PROPERTIES OUTPUT_NAME glslc) --target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc) -+target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc CONAN_PKG::spirv-tools) - add_dependencies(glslc_exe build-version) - --shaderc_add_tests( -- TEST_PREFIX glslc -- LINK_LIBS glslc shaderc_util shaderc -- TEST_NAMES -- file -- resource_parse -- stage) -- - shaderc_add_asciidoc(glslc_doc_README README) - - if(SHADERC_ENABLE_INSTALL) - install(TARGETS glslc_exe - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif(SHADERC_ENABLE_INSTALL) -- --add_subdirectory(test) ---- a/libshaderc/CMakeLists.txt -+++ b/libshaderc/CMakeLists.txt -@@ -10,18 +10,16 @@ set(SHADERC_SOURCES - src/shaderc_private.h - ) - --add_library(shaderc STATIC ${SHADERC_SOURCES}) -+add_library(shaderc ${SHADERC_SOURCES}) - shaderc_default_compile_options(shaderc) --target_include_directories(shaderc PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) -- --add_library(shaderc_shared SHARED ${SHADERC_SOURCES}) --shaderc_default_compile_options(shaderc_shared) --target_include_directories(shaderc_shared PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) --target_compile_definitions(shaderc_shared -- PRIVATE SHADERC_IMPLEMENTATION -- PUBLIC SHADERC_SHAREDLIB --) --set_target_properties(shaderc_shared PROPERTIES SOVERSION 1) -+target_include_directories(shaderc PUBLIC include) -+if(BUILD_SHARED_LIBS) -+ target_compile_definitions(shaderc -+ PRIVATE SHADERC_IMPLEMENTATION -+ PUBLIC SHADERC_SHAREDLIB -+ ) -+ set_target_properties(shaderc PROPERTIES OUTPUT_NAME "shaderc_shared" SOVERSION 1) -+endif() - - if(SHADERC_ENABLE_INSTALL) - install( -@@ -34,70 +32,19 @@ if(SHADERC_ENABLE_INSTALL) - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/shaderc) - -- install(TARGETS shaderc shaderc_shared -+ install(TARGETS shaderc - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(SHADERC_ENABLE_INSTALL) - --find_package(Threads) - set(SHADERC_LIBS -- glslang OSDependent OGLCompiler glslang ${CMAKE_THREAD_LIBS_INIT} - shaderc_util -- SPIRV # from glslang -- SPIRV-Tools -+ "CONAN_PKG::glslang" -+ "CONAN_PKG::spirv-tools" - ) - - target_link_libraries(shaderc PRIVATE ${SHADERC_LIBS}) --target_link_libraries(shaderc_shared PRIVATE ${SHADERC_LIBS}) -- --shaderc_add_tests( -- TEST_PREFIX shaderc -- LINK_LIBS shaderc -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp -- shaderc_private) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_shared -- LINK_LIBS shaderc_shared SPIRV-Tools -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp -- shaderc_private) -- --shaderc_combine_static_lib(shaderc_combined shaderc) -- --if(SHADERC_ENABLE_INSTALL) -- # Since shaderc_combined is defined as an imported library, we cannot use the -- # install() directive to install it. Install it like a normal file. -- get_target_property(generated_location shaderc_combined LOCATION) -- string(REGEX MATCH "Visual Studio .*" vs_generator "${CMAKE_GENERATOR}") -- if (NOT "${vs_generator}" STREQUAL "") -- # With Visual Studio generators, the LOCATION property is not properly -- # expanded according to the current build configuration. We need to work -- # around this problem by manually substitution. -- string(REPLACE "$(Configuration)" "\${CMAKE_INSTALL_CONFIG_NAME}" -- install_location "${generated_location}") -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- else() -- install(FILES ${generated_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- endif() --endif(SHADERC_ENABLE_INSTALL) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_combined -- LINK_LIBS shaderc_combined ${CMAKE_THREAD_LIBS_INIT} -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp) - - if(${SHADERC_ENABLE_TESTS}) - add_executable(shaderc_c_smoke_test ./src/shaderc_c_smoke_test.c) ---- a/libshaderc_spvc/CMakeLists.txt -+++ b/libshaderc_spvc/CMakeLists.txt -@@ -9,26 +9,22 @@ set(SPVC_SOURCES - src/spvc.cc - ) - --add_library(shaderc_spvc STATIC ${SPVC_SOURCES}) -+add_library(shaderc_spvc ${SPVC_SOURCES}) - shaderc_default_compile_options(shaderc_spvc) --target_include_directories(shaderc_spvc PUBLIC include PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${spirv-tools_SOURCE_DIR}/include ${SPIRV-Cross_SOURCE_DIR}/..) -- --add_library(shaderc_spvc_shared SHARED ${SPVC_SOURCES}) --shaderc_default_compile_options(shaderc_spvc_shared) --target_include_directories(shaderc_spvc_shared PUBLIC include PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${spirv-tools_SOURCE_DIR}/include ${SPIRV-Cross_SOURCE_DIR}/..) -- --target_compile_definitions(shaderc_spvc_shared -- PRIVATE SHADERC_IMPLEMENTATION -- PUBLIC SHADERC_SHAREDLIB --) -+target_include_directories(shaderc_spvc -+ PUBLIC include ${shaderc_SOURCE_DIR}/libshaderc/include PRIVATE ${shaderc_SOURCE_DIR}/libshaderc_util/include) -+if(BUILD_SHARED_LIBS) -+ target_compile_definitions(shaderc_spvc -+ PRIVATE SHADERC_IMPLEMENTATION -+ PUBLIC SHADERC_SHAREDLIB -+ ) -+ set_target_properties(shaderc_spvc PROPERTIES OUTPUT_NAME "shaderc_spvc_shared" SOVERSION 1) -+endif() - - if (DISABLE_EXCEPTIONS) - target_compile_definitions(shaderc_spvc PRIVATE SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS) -- target_compile_definitions(shaderc_spvc_shared PRIVATE SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS) - endif (DISABLE_EXCEPTIONS) - --set_target_properties(shaderc_spvc_shared PROPERTIES SOVERSION 1) -- - if(SHADERC_ENABLE_INSTALL) - install( - FILES -@@ -37,71 +33,18 @@ if(SHADERC_ENABLE_INSTALL) - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/shaderc) - -- install(TARGETS shaderc_spvc shaderc_spvc_shared -+ install(TARGETS shaderc_spvc - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(SHADERC_ENABLE_INSTALL) - --find_package(Threads) - set(SPVC_LIBS -- ${CMAKE_THREAD_LIBS_INIT} -- SPIRV-Tools -- SPIRV-Tools-opt -- spirv-cross-glsl -- spirv-cross-hlsl -- spirv-cross-msl -+ "CONAN_PKG::spirv-cross" -+ "CONAN_PKG::spirv-tools" - ) - - target_link_libraries(shaderc_spvc PRIVATE ${SPVC_LIBS}) --target_link_libraries(shaderc_spvc_shared PRIVATE ${SPVC_LIBS}) -- --shaderc_add_tests( -- TEST_PREFIX shaderc -- LINK_LIBS shaderc_spvc -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc/include ${SPIRV-Cross_SOURCE_DIR}/.. -- TEST_NAMES -- spvc -- spvc_cpp -- spvc_webgpu -- spvc_webgpu_cpp) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_shared -- LINK_LIBS shaderc_spvc_shared SPIRV-Tools SPIRV-Tools-opt -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc/include ${SPIRV-Cross_SOURCE_DIR}/.. -- TEST_NAMES -- spvc -- spvc_cpp -- spvc_webgpu -- spvc_webgpu_cpp) -- --shaderc_combine_static_lib(shaderc_spvc_combined shaderc_spvc) -- --if(SHADERC_ENABLE_INSTALL) -- # Since shaderc_combined is defined as an imported library, we cannot use the -- # install() directive to install it. Install it like a normal file. -- get_target_property(generated_location shaderc_spvc_combined LOCATION) -- string(REGEX MATCH "Visual Studio .*" vs_generator "${CMAKE_GENERATOR}") -- if (NOT "${vs_generator}" STREQUAL "") -- # With Visual Studio generators, the LOCATION property is not properly -- # expanded according to the current build configuration. We need to work -- # around this problem by manually substitution. -- string(REPLACE "$(Configuration)" "\${CMAKE_INSTALL_CONFIG_NAME}" -- install_location "${generated_location}") -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- else() -- install(FILES ${generated_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- endif() --endif(SHADERC_ENABLE_INSTALL) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_spvc_combined -- LINK_LIBS shaderc_spvc_combined ${CMAKE_THREAD_LIBS_INIT} shaderc_util -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc/include ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- spvc -- spvc_cpp) - - if(${SHADERC_ENABLE_TESTS}) - add_executable(spvc_c_smoke_test ./src/spvc_smoke_test_util.c ./src/spvc_c_smoke_test.c) ---- a/libshaderc_util/CMakeLists.txt -+++ b/libshaderc_util/CMakeLists.txt -@@ -24,25 +24,20 @@ add_library(shaderc_util STATIC - - shaderc_default_compile_options(shaderc_util) - target_include_directories(shaderc_util -- PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) -+ PUBLIC include) - - find_package(Threads) --target_link_libraries(shaderc_util PRIVATE -- glslang OSDependent OGLCompiler HLSL glslang SPIRV -- SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT}) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_util -- LINK_LIBS shaderc_util -- TEST_NAMES -- counting_includer -- string_piece -- format -- file_finder -- io -- message -- mutex -- version_profile) -+target_link_libraries(shaderc_util PUBLIC -+ CONAN_PKG::glslang -+ CONAN_PKG::spirv-tools -+ ${CMAKE_THREAD_LIBS_INIT}) -+ -+if(SHADERC_ENABLE_INSTALL AND NOT BUILD_SHARED_LIBS) -+ install(TARGETS shaderc_util -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+endif(SHADERC_ENABLE_INSTALL) - - if(${SHADERC_ENABLE_TESTS}) - target_include_directories(shaderc_util_counting_includer_test -@@ -51,15 +46,6 @@ if(${SHADERC_ENABLE_TESTS}) - PRIVATE ${glslang_SOURCE_DIR}) - endif() - --shaderc_add_tests( -- TEST_PREFIX shaderc_util -- LINK_LIBS shaderc_util -- INCLUDE_DIRS -- ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- compiler) -- - # This target copies content of testdata into the build directory. - add_custom_target(testdata COMMAND - ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/testdata/copy-to-build.cmake ---- a/spvc/CMakeLists.txt -+++ b/spvc/CMakeLists.txt -@@ -1,8 +1,8 @@ - add_executable(spvc_exe src/main.cc) - shaderc_default_compile_options(spvc_exe) --target_include_directories(spvc_exe PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include ${spirv-tools_SOURCE_DIR}/include) -+target_include_directories(spvc_exe PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include) - set_target_properties(spvc_exe PROPERTIES OUTPUT_NAME spvc) --target_link_libraries(spvc_exe PRIVATE shaderc_spvc shaderc_util) -+target_link_libraries(spvc_exe PRIVATE shaderc_spvc shaderc_util CONAN_PKG::spirv-tools) - add_dependencies(spvc_exe build-version) - - shaderc_add_asciidoc(spvc_doc_README README) ---- a/utils/update_build_version.py -+++ b/utils/update_build_version.py -@@ -114,12 +114,12 @@ def get_version_string(project, directory): - - - def main(): -- if len(sys.argv) != 4: -- print('usage: {} '.format( -+ if len(sys.argv) != 2: -+ print('usage: {} '.format( - sys.argv[0])) - sys.exit(1) - -- projects = ['shaderc', 'spirv-tools', 'glslang'] -+ projects = ['shaderc'] - new_content = ''.join([ - '"{}\\n"\n'.format(get_version_string(p, d)) - for (p, d) in zip(projects, sys.argv[1:]) diff --git a/recipes/shaderc/all/patches/2019.0/fix-spvc.patch b/recipes/shaderc/all/patches/2019.0/fix-spvc.patch deleted file mode 100644 index 682a95ac5deb9..0000000000000 --- a/recipes/shaderc/all/patches/2019.0/fix-spvc.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/libshaderc_spvc/src/spvc.cc -+++ b/libshaderc_spvc/src/spvc.cc -@@ -15,9 +15,9 @@ - #include "shaderc/spvc.h" - - #include "libshaderc_util/exceptions.h" --#include "spirv-cross/spirv_glsl.hpp" --#include "spirv-cross/spirv_hlsl.hpp" --#include "spirv-cross/spirv_msl.hpp" -+#include "spirv_glsl.hpp" -+#include "spirv_hlsl.hpp" -+#include "spirv_msl.hpp" - #include "spirv-tools/libspirv.hpp" - #include "spirv-tools/optimizer.hpp" - -@@ -169,7 +169,7 @@ size_t shaderc_spvc_compile_options_set_for_fuzzing( - shaderc_spvc_compile_options_t options, const uint8_t* data, size_t size) { - if (!data || size < sizeof(*options)) return 0; - -- memcpy(options, data, sizeof(*options)); -+ memcpy(static_cast(options), data, sizeof(*options)); - return sizeof(*options); - } - diff --git a/recipes/shaderc/all/patches/2021.1/adapt-update_build_version.py.patch b/recipes/shaderc/all/patches/2021.1/adapt-update_build_version.py.patch new file mode 100644 index 0000000000000..a53d4b7300f53 --- /dev/null +++ b/recipes/shaderc/all/patches/2021.1/adapt-update_build_version.py.patch @@ -0,0 +1,25 @@ +diff --git a/utils/update_build_version.py b/utils/update_build_version.py +--- a/utils/update_build_version.py ++++ b/utils/update_build_version.py +@@ -128,18 +128,18 @@ + + + def main(): +- if len(sys.argv) != 5: ++ if len(sys.argv) < 5: + print(('usage: {} '.format( + sys.argv[0]))) + sys.exit(1) + +- projects = ['shaderc', 'spirv-tools', 'glslang'] ++ projects = ['shaderc'] + new_content = ''.join([ + '"{}\\n"\n'.format(get_version_string(p, d)) + for (p, d) in zip(projects, sys.argv[1:]) + ]) + +- output_file = sys.argv[4] ++ output_file = sys.argv[-1] + mkdir_p(os.path.dirname(output_file)) + + if os.path.isfile(output_file): diff --git a/recipes/shaderc/all/patches/2021.1/fix-cmake.patch b/recipes/shaderc/all/patches/2021.1/fix-cmake.patch deleted file mode 100644 index ac2fd7ef1015f..0000000000000 --- a/recipes/shaderc/all/patches/2021.1/fix-cmake.patch +++ /dev/null @@ -1,324 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0c8d1ae..4f4e6e0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -112,19 +112,16 @@ endif(MSVC) - - # Configure subdirectories. - # We depend on these for later projects, so they should come first. --add_subdirectory(third_party) -+ - - add_subdirectory(libshaderc_util) - add_subdirectory(libshaderc) - add_subdirectory(glslc) --if(${SHADERC_ENABLE_EXAMPLES}) -- add_subdirectory(examples) --endif() - - add_custom_target(build-version - ${PYTHON_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py -- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc -+ ${shaderc_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc - COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).") - - function(define_pkg_config_file NAME LIBS) -diff --git a/cmake/utils.cmake b/cmake/utils.cmake -index d64757d..0adc008 100644 ---- a/cmake/utils.cmake -+++ b/cmake/utils.cmake -@@ -41,14 +41,6 @@ function(shaderc_default_c_compile_options TARGET) - # requires clang to be built with compiler-rt. - target_link_libraries(${TARGET} PRIVATE --coverage) - endif() -- if (NOT SHADERC_ENABLE_SHARED_CRT) -- if (WIN32) -- # For MinGW cross compile, statically link to the libgcc runtime. -- # But it still depends on MSVCRT.dll. -- set_target_properties(${TARGET} PROPERTIES -- LINK_FLAGS "-static -static-libgcc") -- endif(WIN32) -- endif(NOT SHADERC_ENABLE_SHARED_CRT) - else() - # disable warning C4800: 'int' : forcing value to bool 'true' or 'false' - # (performance warning) -@@ -58,17 +50,6 @@ endfunction(shaderc_default_c_compile_options) - - function(shaderc_default_compile_options TARGET) - shaderc_default_c_compile_options(${TARGET}) -- if (NOT "${MSVC}") -- target_compile_options(${TARGET} PRIVATE -std=c++11) -- if (NOT SHADERC_ENABLE_SHARED_CRT) -- if (WIN32) -- # For MinGW cross compile, statically link to the C++ runtime. -- # But it still depends on MSVCRT.dll. -- set_target_properties(${TARGET} PROPERTIES -- LINK_FLAGS "-static -static-libgcc -static-libstdc++") -- endif(WIN32) -- endif(NOT SHADERC_ENABLE_SHARED_CRT) -- endif() - endfunction(shaderc_default_compile_options) - - # Build an asciidoc file; additional arguments past the base filename specify -diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt -index 31664d1..a962c2e 100644 ---- a/glslc/CMakeLists.txt -+++ b/glslc/CMakeLists.txt -@@ -30,7 +30,6 @@ add_library(glslc STATIC - ) - - shaderc_default_compile_options(glslc) --target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR}) - - if (SHADERC_ENABLE_WGSL_OUTPUT) - if (IS_DIRECTORY "${tint_SOURCE_DIR}/include") -@@ -43,26 +42,17 @@ if (SHADERC_ENABLE_WGSL_OUTPUT) - endif(SHADERC_ENABLE_WGSL_OUTPUT) - - target_link_libraries(glslc PRIVATE -- glslang OSDependent OGLCompiler HLSL glslang SPIRV # Glslang libraries - $<$:libtint> # Tint libraries, optional - shaderc_util shaderc # internal Shaderc libraries - ${CMAKE_THREAD_LIBS_INIT}) - - add_executable(glslc_exe src/main.cc) - shaderc_default_compile_options(glslc_exe) --target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${spirv-tools_SOURCE_DIR}/include) -+target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${CONAN_INCLUDE_DIRS}) - set_target_properties(glslc_exe PROPERTIES OUTPUT_NAME glslc) --target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc) -+target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc CONAN_PKG::spirv-tools) - add_dependencies(glslc_exe build-version) - --shaderc_add_tests( -- TEST_PREFIX glslc -- LINK_LIBS glslc shaderc_util shaderc -- TEST_NAMES -- file -- resource_parse -- stage) -- - shaderc_add_asciidoc(glslc_doc_README README) - - if(SHADERC_ENABLE_INSTALL) -@@ -70,4 +60,3 @@ if(SHADERC_ENABLE_INSTALL) - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif(SHADERC_ENABLE_INSTALL) - --add_subdirectory(test) -diff --git a/libshaderc/CMakeLists.txt b/libshaderc/CMakeLists.txt -index 3ada419..08cf265 100644 ---- a/libshaderc/CMakeLists.txt -+++ b/libshaderc/CMakeLists.txt -@@ -24,24 +24,19 @@ set(SHADERC_SOURCES - src/shaderc_private.h - ) - --add_library(shaderc STATIC ${SHADERC_SOURCES}) -+add_library(shaderc ${SHADERC_SOURCES}) - shaderc_default_compile_options(shaderc) - target_include_directories(shaderc -- PUBLIC include -- PRIVATE ${glslang_SOURCE_DIR} -- ${SPIRV-Headers_SOURCE_DIR}/include) -+ PUBLIC include) - --add_library(shaderc_shared SHARED ${SHADERC_SOURCES}) --shaderc_default_compile_options(shaderc_shared) --target_include_directories(shaderc_shared -- PUBLIC include -- PRIVATE ${glslang_SOURCE_DIR} -- ${SPIRV-Headers_SOURCE_DIR}/include) --target_compile_definitions(shaderc_shared -- PRIVATE SHADERC_IMPLEMENTATION -- PUBLIC SHADERC_SHAREDLIB --) --set_target_properties(shaderc_shared PROPERTIES SOVERSION 1) -+target_include_directories(shaderc PUBLIC include) -+if(BUILD_SHARED_LIBS) -+ target_compile_definitions(shaderc -+ PRIVATE SHADERC_IMPLEMENTATION -+ PUBLIC SHADERC_SHAREDLIB -+ ) -+ set_target_properties(shaderc PROPERTIES OUTPUT_NAME "shaderc_shared" SOVERSION 1) -+endif() - - if(SHADERC_ENABLE_INSTALL) - install( -@@ -54,73 +49,21 @@ if(SHADERC_ENABLE_INSTALL) - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/shaderc) - -- install(TARGETS shaderc shaderc_shared -+ install(TARGETS shaderc - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(SHADERC_ENABLE_INSTALL) - --find_package(Threads) - set(SHADERC_LIBS -- glslang OSDependent OGLCompiler glslang ${CMAKE_THREAD_LIBS_INIT} - shaderc_util -- SPIRV # from glslang -- SPIRV-Tools -+ "CONAN_PKG::glslang" -+ "CONAN_PKG::spirv-tools" - ) - - target_link_libraries(shaderc PRIVATE ${SHADERC_LIBS}) --target_link_libraries(shaderc_shared PRIVATE ${SHADERC_LIBS}) -- --shaderc_add_tests( -- TEST_PREFIX shaderc -- LINK_LIBS shaderc -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- ${SPIRV-Headers_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp -- shaderc_private) -- --shaderc_add_tests( -- TEST_PREFIX shaderc_shared -- LINK_LIBS shaderc_shared SPIRV-Tools -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- ${SPIRV-Headers_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp -- shaderc_private) - --shaderc_combine_static_lib(shaderc_combined shaderc) -- --if(SHADERC_ENABLE_INSTALL) -- # Since shaderc_combined is defined as an imported library, we cannot use the -- # install() directive to install it. Install it like a normal file. -- get_target_property(generated_location shaderc_combined LOCATION) -- string(REGEX MATCH "Visual Studio .*" vs_generator "${CMAKE_GENERATOR}") -- if (NOT "${vs_generator}" STREQUAL "") -- # With Visual Studio generators, the LOCATION property is not properly -- # expanded according to the current build configuration. We need to work -- # around this problem by manually substitution. -- string(REPLACE "$(Configuration)" "\${CMAKE_INSTALL_CONFIG_NAME}" -- install_location "${generated_location}") -- install(FILES ${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- else() -- install(FILES ${generated_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- endif() --endif(SHADERC_ENABLE_INSTALL) - --shaderc_add_tests( -- TEST_PREFIX shaderc_combined -- LINK_LIBS shaderc_combined ${CMAKE_THREAD_LIBS_INIT} -- INCLUDE_DIRS include ${shaderc_SOURCE_DIR}/libshaderc_util/include ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- ${SPIRV-Headers_SOURCE_DIR}/include -- TEST_NAMES -- shaderc -- shaderc_cpp) - - if(${SHADERC_ENABLE_TESTS}) - add_executable(shaderc_c_smoke_test ./src/shaderc_c_smoke_test.c) -diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt -index 99ce3c4..3eb57d5 100644 ---- a/libshaderc_util/CMakeLists.txt -+++ b/libshaderc_util/CMakeLists.txt -@@ -39,28 +39,23 @@ add_library(shaderc_util STATIC - - shaderc_default_compile_options(shaderc_util) - target_include_directories(shaderc_util -- PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) -+ PUBLIC include) - # We use parts of Glslang's HLSL compilation interface, which - # now requires this preprocessor definition. - add_definitions(-DENABLE_HLSL) - - find_package(Threads) - target_link_libraries(shaderc_util PRIVATE -- glslang OSDependent OGLCompiler HLSL glslang SPIRV -- SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT}) -+ CONAN_PKG::glslang -+ CONAN_PKG::spirv-tools -+ ${CMAKE_THREAD_LIBS_INIT}) - --shaderc_add_tests( -- TEST_PREFIX shaderc_util -- LINK_LIBS shaderc_util -- TEST_NAMES -- counting_includer -- string_piece -- format -- file_finder -- io_shaderc -- message -- mutex -- version_profile) -+if(SHADERC_ENABLE_INSTALL AND NOT BUILD_SHARED_LIBS) -+ install(TARGETS shaderc_util -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+endif(SHADERC_ENABLE_INSTALL) - - if(${SHADERC_ENABLE_TESTS}) - target_include_directories(shaderc_util_counting_includer_test -@@ -69,15 +64,6 @@ if(${SHADERC_ENABLE_TESTS}) - PRIVATE ${glslang_SOURCE_DIR}) - endif() - --shaderc_add_tests( -- TEST_PREFIX shaderc_util -- LINK_LIBS shaderc_util -- INCLUDE_DIRS -- ${glslang_SOURCE_DIR} -- ${spirv-tools_SOURCE_DIR}/include -- TEST_NAMES -- compiler) -- - # This target copies content of testdata into the build directory. - add_custom_target(testdata COMMAND - ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/testdata/copy-to-build.cmake -diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc -index 8a8d12b..92d8279 100644 ---- a/libshaderc_util/src/compiler.cc -+++ b/libshaderc_util/src/compiler.cc -@@ -20,7 +20,7 @@ - #include - #include - --#include "SPIRV/GlslangToSpv.h" -+#include "glslang/SPIRV/GlslangToSpv.h" - #include "libshaderc_util/format.h" - #include "libshaderc_util/io_shaderc.h" - #include "libshaderc_util/message.h" -diff --git a/utils/update_build_version.py b/utils/update_build_version.py -index 5785390..7801a02 100755 ---- a/utils/update_build_version.py -+++ b/utils/update_build_version.py -@@ -128,18 +128,18 @@ def get_version_string(project, directory): - - - def main(): -- if len(sys.argv) != 5: -- print(('usage: {} '.format( -+ if len(sys.argv) != 3: -+ print(('usage: {} '.format( - sys.argv[0]))) - sys.exit(1) - -- projects = ['shaderc', 'spirv-tools', 'glslang'] -+ projects = ['shaderc'] - new_content = ''.join([ - '"{}\\n"\n'.format(get_version_string(p, d)) - for (p, d) in zip(projects, sys.argv[1:]) - ]) - -- output_file = sys.argv[4] -+ output_file = sys.argv[2] - mkdir_p(os.path.dirname(output_file)) - - if os.path.isfile(output_file): diff --git a/recipes/shaderc/all/patches/2021.1/install-shaderc_util.patch b/recipes/shaderc/all/patches/2021.1/install-shaderc_util.patch new file mode 100644 index 0000000000000..c2806270e883d --- /dev/null +++ b/recipes/shaderc/all/patches/2021.1/install-shaderc_util.patch @@ -0,0 +1,14 @@ +diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt +--- a/libshaderc_util/CMakeLists.txt ++++ b/libshaderc_util/CMakeLists.txt +@@ -87,3 +87,10 @@ + add_dependencies(shaderc_util_file_finder_test testdata) + add_dependencies(shaderc_util_io_shaderc_test testdata) + endif() ++ ++if(SHADERC_ENABLE_INSTALL AND NOT BUILD_SHARED_LIBS) ++ install(TARGETS shaderc_util ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif() diff --git a/recipes/shaderc/all/patches/2021.1/use-conan-dependencies.patch b/recipes/shaderc/all/patches/2021.1/use-conan-dependencies.patch new file mode 100644 index 0000000000000..667cfb6d0a4fb --- /dev/null +++ b/recipes/shaderc/all/patches/2021.1/use-conan-dependencies.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -112,7 +112,12 @@ + + # Configure subdirectories. + # We depend on these for later projects, so they should come first. +-add_subdirectory(third_party) ++find_package(glslang REQUIRED CONFIG) ++find_package(SPIRV-Headers REQUIRED CONFIG) ++find_package(SPIRV-Tools REQUIRED CONFIG) ++set(glslang_SOURCE_DIR ${glslang_INCLUDE_DIRS}) ++set(SPIRV-Headers_SOURCE_DIR ${SPIRV-Headers_INCLUDE_DIR}/..) ++set(spirv-tools_SOURCE_DIR ${SPIRV-Tools_INCLUDE_DIR}/..) + + add_subdirectory(libshaderc_util) + add_subdirectory(libshaderc) diff --git a/recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch b/recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch new file mode 100644 index 0000000000000..b28517493c7a8 --- /dev/null +++ b/recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -120,7 +120,12 @@ + + # Configure subdirectories. + # We depend on these for later projects, so they should come first. +-add_subdirectory(third_party) ++find_package(glslang REQUIRED CONFIG) ++find_package(SPIRV-Headers REQUIRED CONFIG) ++find_package(SPIRV-Tools REQUIRED CONFIG) ++set(glslang_SOURCE_DIR ${glslang_INCLUDE_DIRS}) ++set(SPIRV-Headers_SOURCE_DIR ${SPIRV-Headers_INCLUDE_DIR}/..) ++set(spirv-tools_SOURCE_DIR ${SPIRV-Tools_INCLUDE_DIR}/..) + + add_subdirectory(libshaderc_util) + add_subdirectory(libshaderc) diff --git a/recipes/shaderc/all/test_package/CMakeLists.txt b/recipes/shaderc/all/test_package/CMakeLists.txt index 492695489b31c..e88a76ff2e432 100644 --- a/recipes/shaderc/all/test_package/CMakeLists.txt +++ b/recipes/shaderc/all/test_package/CMakeLists.txt @@ -1,21 +1,11 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(shaderc REQUIRED CONFIG) add_executable(${PROJECT_NAME}_shaderc_c test_package_shaderc.c) -target_link_libraries(${PROJECT_NAME}_shaderc_c ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME}_shaderc_c PRIVATE shaderc::shaderc) add_executable(${PROJECT_NAME}_shaderc_cpp test_package_shaderc.cpp) -target_link_libraries(${PROJECT_NAME}_shaderc_cpp ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME}_shaderc_cpp PRIVATE shaderc::shaderc) set_property(TARGET ${PROJECT_NAME}_shaderc_cpp PROPERTY CXX_STANDARD 11) - -if(SHADERC_WITH_SPVC) - add_executable(${PROJECT_NAME}_spvc_c test_package_spvc.c) - target_link_libraries(${PROJECT_NAME}_spvc_c ${CONAN_LIBS}) - - add_executable(${PROJECT_NAME}_spvc_cpp test_package_spvc.cpp) - target_link_libraries(${PROJECT_NAME}_spvc_cpp ${CONAN_LIBS}) - set_property(TARGET ${PROJECT_NAME}_spvc_cpp PROPERTY CXX_STANDARD 11) -endif() diff --git a/recipes/shaderc/all/test_package/conanfile.py b/recipes/shaderc/all/test_package/conanfile.py index e6ac9a4c93682..4613db3f59c9f 100644 --- a/recipes/shaderc/all/test_package/conanfile.py +++ b/recipes/shaderc/all/test_package/conanfile.py @@ -1,32 +1,34 @@ -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", "arch", "compiler", "build_type" - generators = "cmake" + 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.definitions["SHADERC_WITH_SPVC"] = self.options["shaderc"].spvc if "spvc" in self.options["shaderc"] else False cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): # Test programs consuming shaderc lib - bin_path_shaderc_c = os.path.join("bin", "test_package_shaderc_c") - self.run(bin_path_shaderc_c, run_environment=True) - bin_path_shaderc_cpp = os.path.join("bin", "test_package_shaderc_cpp") - self.run(bin_path_shaderc_cpp, run_environment=True) + bin_path_shaderc_c = os.path.join(self.cpp.build.bindir, "test_package_shaderc_c") + self.run(bin_path_shaderc_c, env="conanrun") + + bin_path_shaderc_cpp = os.path.join(self.cpp.build.bindir, "test_package_shaderc_cpp") + self.run(bin_path_shaderc_cpp, env="conanrun") + # Test glslc executable - in_glsl_name = os.path.join(self.source_folder, "test_package.vert") - spv_name = "test_package.spv" - self.run("glslc \"{0}\" -o {1}".format(in_glsl_name, spv_name), run_environment=True) - - if "spvc" in self.options["shaderc"] and self.options["shaderc"].spvc: - # Test programs consuming shaderc_spvc lib - bin_path_spvc_c = os.path.join("bin", "test_package_spvc_c") - self.run(bin_path_spvc_c, run_environment=True) - bin_path_spvc_cpp = os.path.join("bin", "test_package_spvc_cpp") - self.run(bin_path_spvc_cpp, run_environment=True) + self.run(f"glslc -h", env="conanrun") diff --git a/recipes/shaderc/all/test_package/test_package.vert b/recipes/shaderc/all/test_package/test_package.vert deleted file mode 100644 index 8f349eebab57e..0000000000000 --- a/recipes/shaderc/all/test_package/test_package.vert +++ /dev/null @@ -1,8 +0,0 @@ -#version 450 -#extension GL_ARB_separate_shader_objects : enable - -layout(location = 0) in vec2 inPosition; - -void main() { - gl_Position = vec4(inPosition, 0.0, 1.0); -} diff --git a/recipes/shaderc/all/test_package/test_package_spvc.c b/recipes/shaderc/all/test_package/test_package_spvc.c deleted file mode 100644 index c9fc709f30096..0000000000000 --- a/recipes/shaderc/all/test_package/test_package_spvc.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() { - shaderc_spvc_compiler_t shaderc_spvc_compiler = shaderc_spvc_compiler_initialize(); - shaderc_spvc_compiler_release(shaderc_spvc_compiler); - - return 0; -} diff --git a/recipes/shaderc/all/test_package/test_package_spvc.cpp b/recipes/shaderc/all/test_package/test_package_spvc.cpp deleted file mode 100644 index 40978d50d1c6c..0000000000000 --- a/recipes/shaderc/all/test_package/test_package_spvc.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() { - shaderc_spvc::Compiler compiler; - shaderc_spvc::CompileOptions compile_options; - - return 0; -} diff --git a/recipes/shaderc/config.yml b/recipes/shaderc/config.yml index 15d431909e594..7b4ff24649925 100644 --- a/recipes/shaderc/config.yml +++ b/recipes/shaderc/config.yml @@ -1,5 +1,7 @@ versions: - "2021.1": + "2024.1": + folder: all + "2023.6": folder: all - "2019.0": + "2021.1": folder: all diff --git a/recipes/shapelib/all/conandata.yml b/recipes/shapelib/all/conandata.yml index 16ed675c6719f..b4cae11fb3a97 100644 --- a/recipes/shapelib/all/conandata.yml +++ b/recipes/shapelib/all/conandata.yml @@ -1,17 +1,27 @@ sources: + "1.6.1": + url: "https://github.com/OSGeo/shapelib/archive/v1.6.1.tar.gz" + sha256: "72a30ed408edee0dc9eaa81255e634af6706f9192b5ed5b536013f1cc4b327c4" + "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/0003-relocatable-shared-macos.patch" + - 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 bed1f979c1ec8..56012aa251125 100644 --- a/recipes/shapelib/all/conanfile.py +++ b/recipes/shapelib/all/conanfile.py @@ -11,9 +11,9 @@ class ShapelibConan(ConanFile): name = "shapelib" description = "C library for reading and writing ESRI Shapefiles" license = "LGPL-2.0-or-later", "MIT" - topics = ("osgeo", "shapefile", "esri", "geospatial") - homepage = "https://github.com/OSGeo/shapelib" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OSGeo/shapelib" + topics = ("osgeo", "shapefile", "esri", "geospatial") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -63,6 +63,7 @@ def package(self): cmake.install() rm(self, "*.exe", 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")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "shapelib") 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/0003-relocatable-shared-macos.patch b/recipes/shapelib/all/patches/1.5.0-0003-relocatable-shared-macos.patch similarity index 100% rename from recipes/shapelib/all/patches/0003-relocatable-shared-macos.patch rename to recipes/shapelib/all/patches/1.5.0-0003-relocatable-shared-macos.patch 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_v1_package/CMakeLists.txt b/recipes/shapelib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2f11d9b196ef7..0000000000000 --- a/recipes/shapelib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -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/shapelib/all/test_v1_package/conanfile.py b/recipes/shapelib/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/shapelib/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_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/shapelib/config.yml b/recipes/shapelib/config.yml index 7f3d5d7f62dd8..7da8bd84259cd 100644 --- a/recipes/shapelib/config.yml +++ b/recipes/shapelib/config.yml @@ -1,3 +1,7 @@ versions: + "1.6.1": + folder: all + "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 76d8f2a0a392d..7719bd88959d1 100644 --- a/recipes/shield/all/conandata.yml +++ b/recipes/shield/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6": + url: "https://github.com/holoplot/shield/archive/0.6.tar.gz" + sha256: "9ed05e2be8268dc634367ce87aff8b4878b481353eacfdbd8d1f303888c9e3bb" "0.5": url: "https://github.com/holoplot/shield/archive/0.5.tar.gz" sha256: "f6494b1c95aeddb23fe507ab8da17234ecd7ca6aff97a92112e1e6459b343ff3" diff --git a/recipes/shield/all/test_package/CMakeLists.txt b/recipes/shield/all/test_package/CMakeLists.txt index 93639374653d7..0bc89a1f2bcd1 100644 --- a/recipes/shield/all/test_package/CMakeLists.txt +++ b/recipes/shield/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(shield CONFIG REQUIRED) diff --git a/recipes/shield/all/test_v1_package/CMakeLists.txt b/recipes/shield/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/shield/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/shield/all/test_v1_package/conanfile.py b/recipes/shield/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/shield/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/shield/config.yml b/recipes/shield/config.yml index ab08cd3e58a8c..0afee7e4b4830 100644 --- a/recipes/shield/config.yml +++ b/recipes/shield/config.yml @@ -1,4 +1,6 @@ versions: + "0.6": + folder: all "0.5": folder: all "0.4": diff --git a/recipes/si/all/test_v1_package/CMakeLists.txt b/recipes/si/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/si/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 8ae9b638e62fe..0000000000000 --- a/recipes/si/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ - -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/sigslot/all/test_package/CMakeLists.txt b/recipes/sigslot/all/test_package/CMakeLists.txt index b2d6dadc6457d..42979b78c7132 100644 --- a/recipes/sigslot/all/test_package/CMakeLists.txt +++ b/recipes/sigslot/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(PalSigslot REQUIRED CONFIG) diff --git a/recipes/sigslot/all/test_v1_package/CMakeLists.txt b/recipes/sigslot/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/sigslot/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/sigslot/all/test_v1_package/conanfile.py b/recipes/sigslot/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sigslot/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_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/simd/all/conandata.yml b/recipes/simd/all/conandata.yml new file mode 100644 index 0000000000000..4806772037748 --- /dev/null +++ b/recipes/simd/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "6.1.143": + url: "https://github.com/ermig1979/Simd/archive/refs/tags/v6.1.143.tar.gz" + sha256: "f6cd1031eddc8f1f2bd0140a766e242ab2a9f8e38f133748187fe2cd51ac94cb" + "6.1.142": + url: "https://github.com/ermig1979/Simd/archive/refs/tags/v6.1.142.tar.gz" + sha256: "e9b83b91d38d0c1b1e50e1cee51314f036f6f96efc3f035314cb59ff6345c393" + "6.1.138": + url: "https://github.com/ermig1979/Simd/archive/refs/tags/v6.1.138.tar.gz" + sha256: "5090e4879d48851d5d7d9605485f517dea9a27d9431ec2d54a74a6f04cf3ba00" diff --git a/recipes/simd/all/conanfile.py b/recipes/simd/all/conanfile.py new file mode 100644 index 0000000000000..37b86bba68c29 --- /dev/null +++ b/recipes/simd/all/conanfile.py @@ -0,0 +1,130 @@ +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 get, copy, rmdir, replace_in_file, collect_libs +from conan.tools.microsoft import is_msvc, MSBuild, MSBuildToolchain, is_msvc_static_runtime, msvs_toolset +from conan.tools.scm import Version + +required_conan_version = ">=1.59.0" + + +class SimdConan(ConanFile): + name = "simd" + description = "C++ image processing and machine learning library with SIMD" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ermig1979/Simd" + topics = ("sse", "avx", "avx-512", "amx", "vmx", "vsx", "neon") + 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 validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if self.settings.os == "Windows" and self.settings.arch not in ["x86", "x86_64"]: + raise ConanInvalidConfiguration("Windows only supports x86/x64 architectures.") + if is_msvc(self) and self.settings.arch == "armv8": + raise ConanInvalidConfiguration("ARM64 building with MSVC is not supported.") + if Version(self.version) >= "6.1.142" and \ + self.settings.arch in ["x86", "x86_64"] and \ + self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9": + raise ConanInvalidConfiguration("${self.ref} requires GCC >= 9") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.generate() + else: + tc = CMakeToolchain(self) + tc.variables["SIMD_TEST"] = False + tc.variables["SIMD_SHARED"] = self.options.shared + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + + @property + def vs_proj_folder(self): + """Return the vsXXXX/ folder given the MSVC compiler version""" + toolset = msvs_toolset(self) + # By default, v2022 folder + return {"v140": "vs2015", + "v141": "vs2017", + "v142": "vs2019"}.get(toolset, "vs2022") + + def _patch_sources(self): + if is_msvc(self): + if not self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "src", "Simd", "SimdConfig.h"), "//#define SIMD_STATIC", "#define SIMD_STATIC") + replace_in_file(self, os.path.join(self.source_folder, "prj", self.vs_proj_folder, "Simd.vcxproj"), + "DynamicLibrary", + "StaticLibrary") + for prj in ("AmxBf16", "Avx2", "Avx512bw", "Avx512vnni", "Base", "Neon", "Simd", "Sse41"): + replace_in_file(self, os.path.join(self.source_folder, "prj", self.vs_proj_folder, f"{prj}.vcxproj"), + " ", + " OldStyle\n ") + + if not is_msvc_static_runtime(self): + for prj in ("AmxBf16", "Avx2", "Avx512bw", "Avx512vnni", "Base", "Neon", "Simd", "Sse41"): + replace_in_file(self, os.path.join(self.source_folder, "prj", self.vs_proj_folder, f"{prj}.vcxproj"), + " ", + " MultiThreadedDebugDLL\n" + " MultiThreadedDLL\n" + " ") + + def build(self): + self._patch_sources() + if is_msvc(self): + msbuild = MSBuild(self) + msbuild.build(os.path.join(self.source_folder, "prj", self.vs_proj_folder, "Simd.vcxproj")) + else: + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "prj", "cmake")) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if is_msvc(self): + copy(self, pattern="*.h*", dst=os.path.join(self.package_folder, "include", "Simd"), src=os.path.join(self.source_folder, "src", "Simd"), keep_path=True) + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + copy(self, pattern="*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder, keep_path=False) + else: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + self.cpp_info.set_property("cmake_file_name", "Simd") + self.cpp_info.set_property("cmake_target_name", "Simd::Simd") + if not self.options.shared and is_msvc(self): + self.cpp_info.defines.append("SIMD_STATIC") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) diff --git a/recipes/simd/all/test_package/CMakeLists.txt b/recipes/simd/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..eef0ed5180fa2 --- /dev/null +++ b/recipes/simd/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Simd REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Simd::Simd) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/simd/all/test_package/conanfile.py b/recipes/simd/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d7de1f914ce42 --- /dev/null +++ b/recipes/simd/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_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) + 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/simd/all/test_package/test_package.cpp b/recipes/simd/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9618b4bc617e4 --- /dev/null +++ b/recipes/simd/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include +#include "Simd/SimdLib.hpp" + +int main(void) { + Simd::PrintInfo(std::cout); +} diff --git a/recipes/simd/config.yml b/recipes/simd/config.yml new file mode 100644 index 0000000000000..27fd4dbf8a73a --- /dev/null +++ b/recipes/simd/config.yml @@ -0,0 +1,7 @@ +versions: + "6.1.143": + folder: all + "6.1.142": + folder: all + "6.1.138": + folder: all diff --git a/recipes/simde/all/conandata.yml b/recipes/simde/all/conandata.yml index c108fd42332f1..4819243883706 100644 --- a/recipes/simde/all/conandata.yml +++ b/recipes/simde/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "0.8.2": + url: "https://github.com/simd-everywhere/simde/archive/refs/tags/v0.8.2.tar.gz" + sha256: "ed2a3268658f2f2a9b5367628a85ccd4cf9516460ed8604eed369653d49b25fb" + "0.8.0": + # same as 0.7.6 + url: "https://github.com/simd-everywhere/simde/archive/refs/tags/v0.8.0.tar.gz" + sha256: "d7c1aef6dd9ef0fbe6f521d1ca3e79afc26deda7d8f857544ca020b42a4b9b97" "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. diff --git a/recipes/simde/config.yml b/recipes/simde/config.yml index 1d3599e3efc2e..63dd232920b7f 100644 --- a/recipes/simde/config.yml +++ b/recipes/simde/config.yml @@ -1,3 +1,7 @@ versions: + "0.8.2": + folder: all + "0.8.0": + folder: all "0.7.6": folder: all diff --git a/recipes/simdjson/all/conandata.yml b/recipes/simdjson/all/conandata.yml index 3f7b97847e169..20ae7f655365d 100644 --- a/recipes/simdjson/all/conandata.yml +++ b/recipes/simdjson/all/conandata.yml @@ -1,34 +1,16 @@ 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.0.1": - url: "https://github.com/simdjson/simdjson/archive/v3.0.1.tar.gz" - sha256: "156b1bc5eb0561b2bd166b46d191fd3d95a3e709cc63761477d3b7aec2b6e9ed" - "2.2.3": - url: "https://github.com/simdjson/simdjson/archive/v2.2.3.tar.gz" - sha256: "4c62f2d82edec3dbc63650c10453dc471de9f1be689eb5b4bde89efed89db5d8" + "3.12.3": + url: "https://github.com/simdjson/simdjson/archive/v3.12.3.tar.gz" + sha256: "d0af071f2f4187d8b26b556e83ef832b634bd5feb4e2f537b9dabbd334d4e334" + "3.12.2": + url: "https://github.com/simdjson/simdjson/archive/v3.12.2.tar.gz" + sha256: "8ac7c97073d5079f54ad66d04381ec75e1169c2e20bfe9b6500bc81304da3faf" + "3.11.5": + url: "https://github.com/simdjson/simdjson/archive/v3.11.5.tar.gz" + sha256: "509bf4880978666f5a6db1eb3d747681e0cc6e0b5bddd94ab0f14a4199d93e18" + "3.10.1": + url: "https://github.com/simdjson/simdjson/archive/v3.10.1.tar.gz" + sha256: "1e8f881cb2c0f626c56cd3665832f1e97b9d4ffc648ad9e1067c134862bba060" + "3.9.3": + url: "https://github.com/simdjson/simdjson/archive/v3.9.3.tar.gz" + sha256: "2e3d10abcde543d3dd8eba9297522cafdcebdd1db4f51b28f3bc95bf1d6ad23c" diff --git a/recipes/simdjson/all/conanfile.py b/recipes/simdjson/all/conanfile.py index 7b42a92cdbbc8..c881156c9ace8 100644 --- a/recipes/simdjson/all/conanfile.py +++ b/recipes/simdjson/all/conanfile.py @@ -1,8 +1,7 @@ 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, rmdir +from conan.tools.files import copy, get, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -13,7 +12,7 @@ class SimdjsonConan(ConanFile): name = "simdjson" description = "Parsing gigabytes of JSON per second" - license = "Apache-2.0" + license = ("Apache-2.0", "MIT") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/lemire/simdjson" topics = ("json", "parser", "simd", "format") @@ -31,20 +30,6 @@ class SimdjsonConan(ConanFile): "threads": True, } - @property - def _min_cppstd(self): - return "17" - - @property - def _compilers_minimum_version(self): - return { - "gcc": "8", - "Visual Studio": "16", - "msvc": "192", - "clang": "6", - "apple-clang": "9.4", - } - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -52,32 +37,14 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if Version(self.version) < "3.12.0": + self.license = "Apache-2.0" 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 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 fully support." - ) - - 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.") - if self.settings.build_type == "Debug": - raise ConanInvalidConfiguration(f"{self.ref} doesn't support GCC 9 with Debug build type.") + check_min_cppstd(self, 17) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -88,14 +55,7 @@ def generate(self): tc.variables["SIMDJSON_DEVELOPER_MODE"] = False tc.generate() - def _patch_sources(self): - 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)", "") - def build(self): - self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/simdjson/all/test_package/CMakeLists.txt b/recipes/simdjson/all/test_package/CMakeLists.txt index 84e6f651dff5a..f2f1424649e74 100644 --- a/recipes/simdjson/all/test_package/CMakeLists.txt +++ b/recipes/simdjson/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(simdjson REQUIRED CONFIG) diff --git a/recipes/simdjson/all/test_v1_package/CMakeLists.txt b/recipes/simdjson/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/simdjson/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/simdjson/all/test_v1_package/conanfile.py b/recipes/simdjson/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/simdjson/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_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/simdjson/config.yml b/recipes/simdjson/config.yml index c4ccbb7735a04..b55207b775056 100644 --- a/recipes/simdjson/config.yml +++ b/recipes/simdjson/config.yml @@ -1,23 +1,11 @@ versions: - "3.6.1": + "3.12.3": folder: all - "3.6.0": + "3.12.2": folder: all - "3.5.0": + "3.11.5": folder: all - "3.3.0": + "3.10.1": folder: all - "3.2.3": - folder: all - "3.2.2": - folder: all - "3.2.1": - folder: all - "3.2.0": - folder: all - "3.1.8": - folder: all - "3.0.1": - folder: all - "2.2.3": + "3.9.3": folder: all diff --git a/recipes/simdutf/all/conandata.yml b/recipes/simdutf/all/conandata.yml index b28c517c6191a..3d8b4a9a586d9 100644 --- a/recipes/simdutf/all/conandata.yml +++ b/recipes/simdutf/all/conandata.yml @@ -1,67 +1,38 @@ sources: + "6.3.1": + url: "https://github.com/simdutf/simdutf/archive/v6.3.1.tar.gz" + sha256: "7a36c37db8f6dd36e03b1e894075c15f54dac6d0fe45026090eb56b941fcadca" + "6.2.0": + url: "https://github.com/simdutf/simdutf/archive/v6.2.0.tar.gz" + sha256: "f3ef16cb86d866d2271a9a2a539b6ed9ef9083d524963919ce6792a0e3750fe3" + "5.6.3": + url: "https://github.com/simdutf/simdutf/archive/v5.6.3.tar.gz" + sha256: "503070ddf27e26c051b9500dfc7354ec8850e11076f47db32635931c85b630c0" + "5.6.2": + url: "https://github.com/simdutf/simdutf/archive/v5.6.2.tar.gz" + sha256: "c71b5478c9b912e07f75098f3a60920f1c4de3227b5285ea8a90a2fcf8bd6a89" + "5.6.0": + url: "https://github.com/simdutf/simdutf/archive/v5.6.0.tar.gz" + sha256: "98cc5761b638642b018a628b1609f1b2df489b555836fa88706055bb56a4d6fe" + "5.5.0": + url: "https://github.com/simdutf/simdutf/archive/v5.5.0.tar.gz" + sha256: "47090a770b8eecf610ac4d1fafadde60bb7ba3c9d576d2a3a545aba989a3d749" + "5.4.15": + url: "https://github.com/simdutf/simdutf/archive/v5.4.15.tar.gz" + sha256: "188a9516ee208659cab9a1e5063c1b8385d63d171c2381e9ce18af97936d9879" + "5.3.7": + url: "https://github.com/simdutf/simdutf/archive/v5.3.7.tar.gz" + sha256: "731fb29c8c0b05c77b0a29dc37ab8eabe09533f000864a7c55e1ed2e1d33d1e7" + "5.3.5": + url: "https://github.com/simdutf/simdutf/archive/v5.3.5.tar.gz" + sha256: "e6706d7fc68f6e1541414dcf45abe6190d591505d08bff3cc53f55642568f28d" + "5.3.2": + url: "https://github.com/simdutf/simdutf/archive/v5.3.2.tar.gz" + sha256: "3c146fb80d775b869ae9b132f41981dc3266f616f589b5f45045d6a22fdabdca" + "5.3.1": + url: "https://github.com/simdutf/simdutf/archive/v5.3.1.tar.gz" + sha256: "373e1e66a1c245817f0aa08ae8693b71d1703f9355d364e0d9d002929738ddcc" + # 4.0.5 is required by scnlib "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" - "3.2.0": - url: "https://github.com/simdutf/simdutf/archive/v3.2.0.tar.gz" - sha256: "0d9f63e2f308b6b54f399ebbe3a02776b902a2670c88c28de2d75ea2197dc4e9" - "3.1.0": - url: "https://github.com/simdutf/simdutf/archive/v3.1.0.tar.gz" - sha256: "9757a04085ad3ebab9fe933d9198ec6b84a857632a540418b6cfeb7b889a8017" - "3.0.0": - url: "https://github.com/simdutf/simdutf/archive/v3.0.0.tar.gz" - sha256: "cc23b47fd0caf9018fc0dcf49ebeff2676654fff997f9f6ce50fa93cd36f661f" - "2.2.0": - url: "https://github.com/simdutf/simdutf/archive/v2.2.0.tar.gz" - sha256: "b0b8527e194700363cc47e75a7b8d58c88798b0dc31671f5ae5c8803d8678fe6" -patches: - "3.2.17": - - patch_file: "patches/3.2.17-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "3.2.15": - - patch_file: "patches/3.2.14-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "3.2.14": - - patch_file: "patches/3.2.14-0001-fix-cmake.patch" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "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" - "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" - "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" - patch_description: "remove static build, enable rpath on macOS" - patch_type: "conan" - "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" diff --git a/recipes/simdutf/all/conanfile.py b/recipes/simdutf/all/conanfile.py index e0a52dd250245..7f4c06e0624c0 100644 --- a/recipes/simdutf/all/conanfile.py +++ b/recipes/simdutf/all/conanfile.py @@ -1,6 +1,6 @@ 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.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 @@ -31,9 +31,6 @@ class SimdutfConan(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 @@ -48,13 +45,11 @@ def layout(self): def validate(self): 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") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 9.") + if self.settings.compiler == "gcc" and self.settings.build_type == "Debug" and \ + Version(self.settings.compiler.version) < "10.0": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc < 10 with debug build") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -62,7 +57,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["SIMDUTF_BENCHMARKS"] = False - tc.variables["BUILD_TESTING"] = False + tc.variables["SIMDUTF_TESTS"] = False if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) == "8": tc.variables["CMAKE_CXX_FLAGS"] = " -mavx512f" tc.variables["SIMDUTF_TOOLS"] = False @@ -71,7 +66,6 @@ def generate(self): deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/simdutf/all/patches/2.0.3-0001-fix-cmake.patch b/recipes/simdutf/all/patches/2.0.3-0001-fix-cmake.patch deleted file mode 100644 index 6bedd6c48eb5d..0000000000000 --- a/recipes/simdutf/all/patches/2.0.3-0001-fix-cmake.patch +++ /dev/null @@ -1,23 +0,0 @@ -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/src/CMakeLists.txt b/src/CMakeLists.txt -index f3ede1e..91a1bdd 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -3,6 +3,6 @@ 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/3.2.14-0001-fix-cmake.patch b/recipes/simdutf/all/patches/3.2.14-0001-fix-cmake.patch deleted file mode 100644 index 2fa471fee1dfb..0000000000000 --- a/recipes/simdutf/all/patches/3.2.14-0001-fix-cmake.patch +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100644 index 6f1f0aa23c231..0000000000000 --- a/recipes/simdutf/all/patches/3.2.17-0001-fix-cmake.patch +++ /dev/null @@ -1,22 +0,0 @@ -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/all/test_package/CMakeLists.txt b/recipes/simdutf/all/test_package/CMakeLists.txt index ac41d27abf2c8..17e45885bf67d 100644 --- a/recipes/simdutf/all/test_package/CMakeLists.txt +++ b/recipes/simdutf/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(simdutf REQUIRED CONFIG) diff --git a/recipes/simdutf/all/test_v1_package/CMakeLists.txt b/recipes/simdutf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b4c2f89fe6420..0000000000000 --- a/recipes/simdutf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(simdutf REQUIRED CONFIG) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/simdutf/all/test_v1_package/conanfile.py b/recipes/simdutf/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/simdutf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/simdutf/config.yml b/recipes/simdutf/config.yml index d16a8ca4a324b..c548910d0c672 100644 --- a/recipes/simdutf/config.yml +++ b/recipes/simdutf/config.yml @@ -1,23 +1,25 @@ versions: - "4.0.5": + "6.3.1": + folder: all + "6.2.0": folder: all - "4.0.4": + "5.6.3": folder: all - "4.0.3": + "5.6.2": folder: all - "3.2.17": + "5.6.0": folder: all - "3.2.15": + "5.5.0": folder: all - "3.2.14": + "5.4.15": folder: all - "3.2.2": + "5.3.7": folder: all - "3.2.0": + "5.3.5": folder: all - "3.1.0": + "5.3.2": folder: all - "3.0.0": + "5.3.1": folder: all - "2.2.0": + "4.0.5": folder: all diff --git a/recipes/simfil/all/conandata.yml b/recipes/simfil/all/conandata.yml new file mode 100644 index 0000000000000..3fb95aeb48621 --- /dev/null +++ b/recipes/simfil/all/conandata.yml @@ -0,0 +1,28 @@ +sources: + "0.3.4": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.3.4.tar.gz" + sha256: "f69241512ca925e22ddb90aa4fcaccec8e6e3782fa1dc7f6b3b48d8dc12c78ef" + "0.3.3": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.3.3.tar.gz" + sha256: "1e09c3785dc14e0a9a6c2c64962debd6ab1c7f7750a2de49dbb5dea18a461973" + "0.3.2": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.3.2.tar.gz" + sha256: "b8357db1d46058bb5b02eee4945801fc96cf06736c15195235a4b35da72e2ac2" + "0.3.1": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.3.1.tar.gz" + sha256: "caddee2e338041ae5ec56c6a92f14e79ee3d5a0f7eaf327d6b8418fe06dd484e" + "0.3.0": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.3.0.tar.gz" + sha256: "dea7b063f3f062772fcb49b368954814fc04d66c55db327a53ea008d698cd171" + "0.2.1": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.2.1.tar.gz" + sha256: "d3114900f121013cbffe42b0a70c66a47846c9326f6327d2ce0dd2e841919fd9" + "0.1.3": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.1.3.tar.gz" + sha256: "e42004b46118950e95b22430e4580fb89d1e6d2a1399e209d1aa4310944962e5" + "0.1.2": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.1.2.tar.gz" + sha256: "a903658ff37fa304dc6d8cb65e7923b6857b825ce2ac205522b84e4785d80e8d" + "0.1.1": + url: "https://github.com/Klebert-Engineering/simfil/archive/refs/tags/v0.1.1.tar.gz" + sha256: "e82a9d92ec65b7e27776d5507c78571cecc234f2b6fcdacc7ffcece6198f7f9a" diff --git a/recipes/simfil/all/conanfile.py b/recipes/simfil/all/conanfile.py new file mode 100644 index 0000000000000..55dad5c2c07b1 --- /dev/null +++ b/recipes/simfil/all/conanfile.py @@ -0,0 +1,106 @@ +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 +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.53.0" + + +class SimfilRecipe(ConanFile): + name = "simfil" + description = "simfil is a C++ 17 library and a language for querying structured map feature data. The library provides an efficient in-memory storage pool for map data, optimized for the simfil query language, along with a query interpreter to query the actual data." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Klebert-Engineering/simfil" + license = "BSD-3-Clause" + package_type = "library" + topics = ["query-language", "json", "data-model"] + + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_json": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_json": True, + } + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "10", + "clang": "10", + "apple-clang": "14", + } + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def validate(self): + check_min_cppstd(self, 20) + + 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 Concepts support. The current compiler {self.settings.compiler} {self.settings.compiler.version} does not support it.") + + def build_requirements(self): + self.tool_requires("cmake/[>3.19 <4]") + + def requirements(self): + self.requires("sfl/1.2.4", transitive_headers=True) + self.requires("fmt/10.0.0", transitive_headers=True) + self.requires("bitsery/5.2.3", transitive_headers=True) + if self.options.with_json: + self.requires("nlohmann_json/3.11.2", transitive_headers=True) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.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["SIMFIL_CONAN"] = True + tc.cache_variables["SIMFIL_SHARED"] = self.options.get_safe("shared") + tc.cache_variables["SIMFIL_WITH_REPL"] = False + tc.cache_variables["SIMFIL_WITH_COVERAGE"] = False + tc.cache_variables["SIMFIL_WITH_TESTS"] = False + tc.cache_variables["SIMFIL_WITH_EXAMPLES"] = False + tc.cache_variables["SIMFIL_WITH_MODEL_JSON"] = self.options.with_json + tc.generate() + deps = CMakeDeps(self) + deps.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.libs = ["simfil"] + if self.options.with_json: + self.cpp_info.defines = ["SIMFIL_WITH_MODEL_JSON=1"] diff --git a/recipes/simfil/all/test_package/CMakeLists.txt b/recipes/simfil/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..33e4104ed085d --- /dev/null +++ b/recipes/simfil/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(simfil CONFIG REQUIRED) + +add_executable(test_package src/example.cpp) +target_link_libraries(test_package simfil::simfil) +target_compile_features(test_package PRIVATE cxx_std_20) diff --git a/recipes/simfil/all/test_package/conanfile.py b/recipes/simfil/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0c831359c3d24 --- /dev/null +++ b/recipes/simfil/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 SimfilTestPackageConanFile(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/simfil/all/test_package/src/example.cpp b/recipes/simfil/all/test_package/src/example.cpp new file mode 100644 index 0000000000000..e263d12871d8b --- /dev/null +++ b/recipes/simfil/all/test_package/src/example.cpp @@ -0,0 +1,8 @@ +#include "simfil/value.h" + +int main() { + auto value = simfil::Value::make((int64_t)123); + (void)value; + + return 0; +} diff --git a/recipes/simfil/config.yml b/recipes/simfil/config.yml new file mode 100644 index 0000000000000..bec2c9fad1134 --- /dev/null +++ b/recipes/simfil/config.yml @@ -0,0 +1,19 @@ +versions: + "0.3.4": + folder: all + "0.3.3": + folder: all + "0.3.2": + folder: all + "0.3.1": + folder: all + "0.3.0": + folder: all + "0.2.1": + folder: all + "0.1.3": + folder: all + "0.1.2": + folder: all + "0.1.1": + folder: all diff --git a/recipes/simple-websocket-server/all/test_v1_package/CMakeLists.txt b/recipes/simple-websocket-server/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/simple-websocket-server/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/simple-websocket-server/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", "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_enum/all/conandata.yml b/recipes/simple_enum/all/conandata.yml new file mode 100644 index 0000000000000..6c936b9324135 --- /dev/null +++ b/recipes/simple_enum/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.8.0": + url: "https://github.com/arturbac/simple_enum/archive/refs/tags/v0.8.0.tar.gz" + sha256: "b32e723ddb29b6cb2ab93f2376157ee6fd7a4f3c170edddb6a3fb7186068e6ee" diff --git a/recipes/simple_enum/all/conanfile.py b/recipes/simple_enum/all/conanfile.py new file mode 100644 index 0000000000000..6be80c9e19d4d --- /dev/null +++ b/recipes/simple_enum/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.files import copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class SimpleEnumConan(ConanFile): + name = "simple_enum" + description = "An Fast, Intuitive and Type-Safe C++ Enumeration Support Library" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/arturbac/simple_enum" + topics = ("serialization", "type-safe", "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": "11", + "clang": "12", + "apple-clang": "14", # apple-clang/13 doesn't support std::convertible_to + "Visual Studio": "16", + "msvc": "192", + } + + 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"): + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), + ) + copy( + self, + "*.h", + 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 = [] diff --git a/recipes/simple_enum/all/test_package/CMakeLists.txt b/recipes/simple_enum/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6835a49d78e83 --- /dev/null +++ b/recipes/simple_enum/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(simple_enum REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE simple_enum::simple_enum) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/simple_enum/all/test_package/conanfile.py b/recipes/simple_enum/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/simple_enum/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/simple_enum/all/test_package/test_package.cpp b/recipes/simple_enum/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..694699608c7ba --- /dev/null +++ b/recipes/simple_enum/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + enum struct enum_bounded { v1 = 1, v2, v3, first = v1, last = v3 }; + static_assert(simple_enum::enum_name(enum_bounded::v2) == "v2"); + + return 0; +} diff --git a/recipes/simple_enum/config.yml b/recipes/simple_enum/config.yml new file mode 100644 index 0000000000000..675f954f2770e --- /dev/null +++ b/recipes/simple_enum/config.yml @@ -0,0 +1,3 @@ +versions: + "0.8.0": + folder: all diff --git a/recipes/sioclient/all/conandata.yml b/recipes/sioclient/all/conandata.yml new file mode 100644 index 0000000000000..ae83b98849ee1 --- /dev/null +++ b/recipes/sioclient/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240405": + url: "https://github.com/socketio/socket.io-client-cpp/archive/c6be96b226f0fe3853beaeaa99c06834342a78db.zip" + sha256: "7c68117185dbc49579bba09a3e877f2a716cc331c28b3d8b6d3f867c4346b639" diff --git a/recipes/sioclient/all/conanfile.py b/recipes/sioclient/all/conanfile.py new file mode 100644 index 0000000000000..28f6a1a4ad91a --- /dev/null +++ b/recipes/sioclient/all/conanfile.py @@ -0,0 +1,112 @@ +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.microsoft import is_msvc +from conan.tools.files import copy, get, replace_in_file, rm, rmdir, save + +required_conan_version = ">=1.53.0" + + +class SioclientConan(ConanFile): + name = "sioclient" + description = "C++11 implementation of Socket.IO client" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/socketio/socket.io-client-cpp" + topics = ("websocket", "client") + + 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": 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") + if is_msvc(self): + self.options.rm_safe("shared") + self.package_type = "static-library" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("websocketpp/0.8.2") + self.requires("asio/1.30.2") + self.requires("rapidjson/cci.20230929") + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + 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.variables["USE_SUBMODULES"] = False + tc.variables["BUILD_UNIT_TESTS"] = False + tc.variables["BUILD_TESTING"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "asio asio::asio", "asio::asio") + + 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", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "sioclient") + + self.cpp_info.components["sioclient_"].set_property("cmake_target_name", "sioclient::sioclient") + self.cpp_info.components["sioclient_"].libs = ["sioclient"] + self.cpp_info.components["sioclient_"].requires = [ + "websocketpp::websocketpp", + "asio::asio", + "rapidjson::rapidjson", + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sioclient_"].system_libs.extend(["m", "pthread"]) + + if self.options.with_openssl: + self.cpp_info.components["sioclient_tls"].set_property("cmake_target_name", "sioclient::sioclient_tls") + self.cpp_info.components["sioclient_tls"].libs = ["sioclient_tls"] + self.cpp_info.components["sioclient_tls"].requires = [ + "websocketpp::websocketpp", + "asio::asio", + "rapidjson::rapidjson", + "openssl::openssl", + ] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["sioclient_tls"].system_libs.extend(["m", "pthread"]) diff --git a/recipes/sioclient/all/test_package/CMakeLists.txt b/recipes/sioclient/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4985d53cb13ca --- /dev/null +++ b/recipes/sioclient/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(sioclient REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sioclient::sioclient) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sioclient/all/test_package/conanfile.py b/recipes/sioclient/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/sioclient/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/sioclient/all/test_package/test_package.cpp b/recipes/sioclient/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..646e232b2bda0 --- /dev/null +++ b/recipes/sioclient/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + sio::client h; + h.socket(); +} diff --git a/recipes/sioclient/config.yml b/recipes/sioclient/config.yml new file mode 100644 index 0000000000000..f1cb71fea7cad --- /dev/null +++ b/recipes/sioclient/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240405": + folder: all diff --git a/recipes/sjson-cpp/all/test_v1_package/CMakeLists.txt b/recipes/sjson-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/sjson-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sjson-cpp/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_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/skyr-url/all/test_v1_package/CMakeLists.txt b/recipes/skyr-url/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 54d2c07bb9d41..0000000000000 --- a/recipes/skyr-url/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/skyr-url/all/test_v1_package/conanfile.py b/recipes/skyr-url/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/skyr-url/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/sleef/all/CMakeLists.txt b/recipes/sleef/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb9..0000000000000 --- a/recipes/sleef/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/sleef/all/conandata.yml b/recipes/sleef/all/conandata.yml index d1737a7a842cf..2cb4098c3fd69 100644 --- a/recipes/sleef/all/conandata.yml +++ b/recipes/sleef/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.6": + url: "https://github.com/shibatch/sleef/archive/3.6.tar.gz" + sha256: "de4f3d992cf2183a872cd397f517c1defcd3ee6cafa2ce5fa36963bd7e562446" "3.5.1": url: "https://github.com/shibatch/sleef/archive/3.5.1.tar.gz" sha256: "415ee9b1bcc5816989d3d4d92afd0cd3f9ee89cbd5a33eb008e69751e40438ab" diff --git a/recipes/sleef/all/conanfile.py b/recipes/sleef/all/conanfile.py index 0496b1b63c7cd..7cba3764e2337 100644 --- a/recipes/sleef/all/conanfile.py +++ b/recipes/sleef/all/conanfile.py @@ -1,19 +1,25 @@ -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.build import cross_building +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class SleefConan(ConanFile): name = "sleef" - description = "SLEEF is a library that implements vectorized versions " \ - "of C standard math functions." + description = "SLEEF is a library that implements vectorized versions of C standard math functions." license = "BSL-1.0" - topics = ("conan", "sleef", "vectorization", "simd") - homepage = "https://sleef.org" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://sleef.org" + topics = ("vectorization", "simd") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,75 +30,92 @@ class SleefConan(ConanFile): "fPIC": True, } - short_paths = 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 - 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.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration("shared sleef not supported on Windows, it produces runtime errors") + raise ConanInvalidConfiguration( + "shared sleef not supported on Windows, it produces runtime errors" + ) + if self.settings.compiler == "apple-clang": + if cross_building(self): + # Fails with "No rule to make target `/bin/mkrename'" + # https://github.com/shibatch/sleef/issues/308 + raise ConanInvalidConfiguration(f"{self.ref} does not support cross-building with apple-clang") + if Version(self.version) < "3.6" and self.settings.arch == "armv8": + # clang: error: the clang compiler does not support '-march=armv7-a' + # clang: warning: argument unused during compilation: '-mfpu=vfpv4' [-Wunused-command-line-argument] + # clang: warning: argument unused during compilation: '-arch arm64' [-Wunused-command-line-argument] + # clang: warning: argument unused during compilation: '-mmacosx-version-min=11.0' [-Wunused-command-line-argument] + raise ConanInvalidConfiguration(f"{self.ref} does not support Mac M1. Please, use {self.name} version >=3.6.") + + def build_requirements(self): + if Version(self.version) >= "3.6": + self.tool_requires("cmake/[>=3.18 <4]") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename(self.name + "-" + self.version, self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_STATIC_TEST_BINS"] = False - self._cmake.definitions["ENABLE_LTO"] = False - self._cmake.definitions["BUILD_LIBM"] = True - self._cmake.definitions["BUILD_DFT"] = False - self._cmake.definitions["BUILD_QUAD"] = False - self._cmake.definitions["BUILD_GNUABI_LIBS"] = False - self._cmake.definitions["BUILD_TESTS"] = False - self._cmake.definitions["BUILD_INLINE_HEADERS"] = False - self._cmake.definitions["SLEEF_TEST_ALL_IUT"] = False - self._cmake.definitions["SLEEF_SHOW_CONFIG"] = True - self._cmake.definitions["SLEEF_SHOW_ERROR_LOG"] = False - self._cmake.definitions["ENFORCE_TESTER"] = False - self._cmake.definitions["ENFORCE_TESTER3"] = False - self._cmake.definitions["ENABLE_ALTDIV"] = False - self._cmake.definitions["ENABLE_ALTSQRT"] = False - self._cmake.definitions["DISABLE_FFTW"] = 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): + VirtualBuildEnv(self).generate() + + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + if Version(self.version) >= "3.6": + tc.cache_variables["SLEEF_BUILD_STATIC_TEST_BINS"] = False + tc.cache_variables["SLEEF_BUILD_LIBM"] = True + tc.cache_variables["SLEEF_BUILD_DFT"] = False + tc.cache_variables["SLEEF_BUILD_QUAD"] = False + tc.cache_variables["SLEEF_BUILD_GNUABI_LIBS"] = False + tc.cache_variables["SLEEF_BUILD_SCALAR_LIB"] = False + tc.cache_variables["SLEEF_BUILD_TESTS"] = False + tc.cache_variables["SLEEF_BUILD_INLINE_HEADERS"] = False + tc.cache_variables["SLEEF_SHOW_CONFIG"] = True + tc.cache_variables["SLEEF_SHOW_ERROR_LOG"] = False + tc.cache_variables["SLEEF_ENABLE_ALTDIV"] = False + tc.cache_variables["SLEEF_ENABLE_ALTSQRT"] = False + tc.cache_variables["SLEEF_DISABLE_FFTW"] = True + tc.cache_variables["SLEEF_DISABLE_MPFR"] = True + tc.cache_variables["SLEEF_DISABLE_SSL"] = True + tc.cache_variables["SLEEF_ENABLE_CUDA"] = False + tc.cache_variables["SLEEF_ENABLE_CXX"] = False + else: + tc.cache_variables["BUILD_DFT"] = False + tc.cache_variables["BUILD_GNUABI_LIBS"] = False + tc.cache_variables["BUILD_TESTS"] = False + tc.cache_variables["DISABLE_FFTW"] = True + 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", "pkgconfig")) + 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, "dummy")) def package_info(self): - self.cpp_info.names["pkg_config"] = "sleef" + self.cpp_info.set_property("pkg_config_name", "sleef") self.cpp_info.libs = ["sleef"] if self.settings.os == "Windows" and not self.options.shared: self.cpp_info.defines = ["SLEEF_STATIC_LIBS"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] diff --git a/recipes/sleef/all/test_package/CMakeLists.txt b/recipes/sleef/all/test_package/CMakeLists.txt index 7b9b613cbb24a..a5f1ed24ef5f7 100644 --- a/recipes/sleef/all/test_package/CMakeLists.txt +++ b/recipes/sleef/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(sleef REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE sleef::sleef) diff --git a/recipes/sleef/all/test_package/conanfile.py b/recipes/sleef/all/test_package/conanfile.py index 5216332f39f5c..ef5d7042163ec 100644 --- a/recipes/sleef/all/test_package/conanfile.py +++ b/recipes/sleef/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.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/sleef/config.yml b/recipes/sleef/config.yml index 2276d8a2cd6a8..3c718426b97bd 100644 --- a/recipes/sleef/config.yml +++ b/recipes/sleef/config.yml @@ -1,3 +1,5 @@ versions: + "3.6": + folder: all "3.5.1": folder: all diff --git a/recipes/sml/all/conandata.yml b/recipes/sml/all/conandata.yml index 39d52a814e37c..f972c4f8da512 100644 --- a/recipes/sml/all/conandata.yml +++ b/recipes/sml/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.1.12": + url: "https://github.com/boost-ext/sml/archive/refs/tags/v1.1.12.tar.gz" + sha256: "65b53b3b839881512a5bf5bd443afd7dd64a406c706aab469f2e7cfd1d0a6012" + "1.1.11": + url: "https://github.com/boost-ext/sml/archive/refs/tags/v1.1.11.tar.gz" + sha256: "8773efd639ce9649dc449135c8c53232e1cb5f4037d44be02c1b9ccc343f246d" "1.1.9": url: "https://github.com/boost-ext/sml/archive/refs/tags/v1.1.9.tar.gz" sha256: "c5ebffcf791ca0b89fd49a410b720432de748a31b7e0c9e5bd5c567d11c8c477" diff --git a/recipes/sml/all/test_package/CMakeLists.txt b/recipes/sml/all/test_package/CMakeLists.txt index ab67ff60b5680..91686c278b852 100644 --- a/recipes/sml/all/test_package/CMakeLists.txt +++ b/recipes/sml/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(sml REQUIRED CONFIG) diff --git a/recipes/sml/all/test_v1_package/CMakeLists.txt b/recipes/sml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2ecfffc8e29bc..0000000000000 --- a/recipes/sml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(sml REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE sml::sml) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/sml/all/test_v1_package/conanfile.py b/recipes/sml/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sml/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_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/sml/config.yml b/recipes/sml/config.yml index aff831fd45b0a..af2238f8fa6a4 100644 --- a/recipes/sml/config.yml +++ b/recipes/sml/config.yml @@ -1,4 +1,8 @@ versions: + "1.1.12": + folder: all + "1.1.11": + folder: all "1.1.9": folder: all "1.1.8": diff --git a/recipes/snappy/all/conandata.yml b/recipes/snappy/all/conandata.yml index 1488c7a2baf50..501018a1c4174 100644 --- a/recipes/snappy/all/conandata.yml +++ b/recipes/snappy/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.2.1": + url: "https://github.com/google/snappy/archive/1.2.1.tar.gz" + sha256: "736aeb64d86566d2236ddffa2865ee5d7a82d26c9016b36218fcc27ea4f09f86" + "1.2.0": + url: "https://github.com/google/snappy/archive/1.2.0.tar.gz" + sha256: "9b8f10fbb5e3bc112f2e5e64f813cb73faea42ec9c533a5023b5ae08aedef42e" "1.1.10": url: "https://github.com/google/snappy/archive/1.1.10.tar.gz" sha256: "49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90" @@ -12,6 +18,32 @@ sources: url: "https://github.com/google/snappy/archive/1.1.7.tar.gz" sha256: "3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4" patches: + "1.2.1": + - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.2.0-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.2.0-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" + "1.2.0": + - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" + patch_description: "disable inlining for compilation error" + patch_type: "portability" + - patch_file: "patches/1.1.9-0002-no-Werror.patch" + patch_description: "disable 'warning as error' options" + patch_type: "portability" + - patch_file: "patches/1.2.0-0003-fix-clobber-list-older-llvm.patch" + patch_description: "disable inline asm on apple-clang" + patch_type: "portability" + - patch_file: "patches/1.2.0-0004-rtti-by-default.patch" + patch_description: "remove 'disable rtti'" + patch_type: "conan" "1.1.10": - patch_file: "patches/1.1.10-0001-fix-inlining-failure.patch" patch_description: "disable inlining for compilation error" diff --git a/recipes/snappy/all/conanfile.py b/recipes/snappy/all/conanfile.py index d60c824527335..99e4bdb8250eb 100644 --- a/recipes/snappy/all/conanfile.py +++ b/recipes/snappy/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class SnappyConan(ConanFile): @@ -72,6 +72,8 @@ def generate(self): tc.variables["SNAPPY_HAVE_BMI2"] = self.options.with_bmi2 if self.options.with_ssse3 != "auto": tc.variables["SNAPPY_HAVE_SSSE3"] = self.options.with_ssse3 + if Version(self.version) < "1.2.2": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -98,9 +100,4 @@ def package_info(self): if libcxx: self.cpp_info.components["snappylib"].system_libs.append(libcxx) - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "Snappy" - self.cpp_info.names["cmake_find_package_multi"] = "Snappy" - self.cpp_info.components["snappylib"].names["cmake_find_package"] = "snappy" - self.cpp_info.components["snappylib"].names["cmake_find_package_multi"] = "snappy" self.cpp_info.components["snappylib"].set_property("cmake_target_name", "Snappy::snappy") diff --git a/recipes/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch b/recipes/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch new file mode 100644 index 0000000000000..05accb60abfba --- /dev/null +++ b/recipes/snappy/all/patches/1.2.0-0003-fix-clobber-list-older-llvm.patch @@ -0,0 +1,13 @@ +diff --git a/snappy.cc b/snappy.cc +index 08c2a98..151de55 100644 +--- a/snappy.cc ++++ b/snappy.cc +@@ -1311,7 +1311,7 @@ inline size_t AdvanceToNextTagX86Optimized(const uint8_t** ip_p, size_t* tag) { + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +-#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) ++#if defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(__x86_64__) && ( (!defined(__clang__) && !defined(__APPLE__)) || (!defined(__APPLE__) && defined(__clang__) && (__clang_major__ >= 9)) || (defined(__APPLE__) && defined(__clang__) && (__clang_major__ > 11)) ) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" diff --git a/recipes/snappy/all/patches/1.2.0-0004-rtti-by-default.patch b/recipes/snappy/all/patches/1.2.0-0004-rtti-by-default.patch new file mode 100644 index 0000000000000..7ca0e721fadea --- /dev/null +++ b/recipes/snappy/all/patches/1.2.0-0004-rtti-by-default.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 01eb2d7..fb4e6bf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,8 +53,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_definitions(-D_HAS_EXCEPTIONS=0) + + # Disable RTTI. +- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") ++# string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") + else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") +@@ -83,8 +83,8 @@ endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + + # Disable RTTI. +- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") ++# string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ++# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") + endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make diff --git a/recipes/snappy/all/test_package/CMakeLists.txt b/recipes/snappy/all/test_package/CMakeLists.txt index a0fd3f83d2c67..4a1f38c3238b8 100644 --- a/recipes/snappy/all/test_package/CMakeLists.txt +++ b/recipes/snappy/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(Snappy REQUIRED CONFIG) diff --git a/recipes/snappy/all/test_v1_package/CMakeLists.txt b/recipes/snappy/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/snappy/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/snappy/all/test_v1_package/conanfile.py b/recipes/snappy/all/test_v1_package/conanfile.py deleted file mode 100644 index 00d8ab9e282f8..0000000000000 --- a/recipes/snappy/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - bin_path_c = os.path.join("bin", "test_package_c") - self.run(bin_path_c, run_environment=True) diff --git a/recipes/snappy/config.yml b/recipes/snappy/config.yml index 521a59e91e109..4059143be6e19 100644 --- a/recipes/snappy/config.yml +++ b/recipes/snappy/config.yml @@ -1,4 +1,8 @@ versions: + "1.2.1": + folder: all + "1.2.0": + folder: all "1.1.10": folder: all "1.1.9": diff --git a/recipes/snitch/all/test_package/CMakeLists.txt b/recipes/snitch/all/test_package/CMakeLists.txt index 19d7688a6e4c0..76a14b8cd42ff 100644 --- a/recipes/snitch/all/test_package/CMakeLists.txt +++ b/recipes/snitch/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(snitch REQUIRED CONFIG) diff --git a/recipes/snitch/all/test_v1_package/CMakeLists.txt b/recipes/snitch/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/snitch/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index c8d1d20a4e7d2..0000000000000 --- a/recipes/snitch/all/test_v1_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.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/snowhouse/all/test_v1_package/CMakeLists.txt b/recipes/snowhouse/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/snowhouse/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/snowhouse/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", "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/test_v1_package/CMakeLists.txt b/recipes/so5extra/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/so5extra/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/so5extra/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_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/sobjectizer/all/conandata.yml b/recipes/sobjectizer/all/conandata.yml index 9867b85e58972..3ed6d5a8e7536 100644 --- a/recipes/sobjectizer/all/conandata.yml +++ b/recipes/sobjectizer/all/conandata.yml @@ -1,41 +1,16 @@ sources: - "5.7.2.2": - url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.2.tar.gz" - sha256: "85f6cdd10bc4b05b8e7eeff7cd6eb76cc0338810114ba6d517163f143676054f" - "5.7.2.3": - url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.3.tar.gz" - sha256: "3dd3936fdd5443056fb0698477ad2b299c11b90ff6f551fa2dfb031a17930ee2" - "5.7.2.4": - url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.4.tar.gz" - sha256: "1ab370e430a1621c7f3ec8a530c3933efed1c5718953fbea214c1694fecc7128" - "5.7.2.5": - url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.5.tar.gz" - sha256: "0bf87f9a4ec631b2dd53033cbb9a8b84a09a8e499f4edf6504121c6a7d1ef459" - "5.7.2.6": - url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.2.6.tar.gz" - sha256: "62f1cfca8181bd60af2fb31b295471d0494b7ba72ab23e5a749bd70c9aa9e7b2" - "5.7.3": - url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.3.tar.gz" - sha256: "15ddaa69861e2853fb8888faf70766e7c56c3cf66a6293f72848e0909875a4c3" "5.7.4": url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.4.tar.gz" sha256: "f032d071579d80fb423171d411ae0e33af0da46776ca0db7eb1d933c69fb0726" - - "5.7.4.1": - url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.4.1.tar.gz" - sha256: "9f5fb9d0be46d427be17f1c47cfa3d332dfe40877d1f9fafd38bcc05c46ff013" - "5.7.4.2": - url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.7.4.2.tar.gz" - sha256: "defaec29e135a21b1b279b1db8eb56993099a7368baae93e7ea1f3f79909f3d8" - "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" + "5.8.3": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.8.3.tar.gz" + sha256: "c76661771c7a0a272ff2cefc62cf3100e9530ec670f225c0e11c6bfa2cc6974e" + "5.8.4": + url: "https://github.com/Stiffstream/sobjectizer/archive/v.5.8.4.tar.gz" + sha256: "09ebbec6bdafa4298c146056aef2070f0a3e56781a5dda1d7deece546c5b2b72" diff --git a/recipes/sobjectizer/all/test_package/CMakeLists.txt b/recipes/sobjectizer/all/test_package/CMakeLists.txt index 38c12b1dc72ca..118ec1f8c8a0c 100644 --- a/recipes/sobjectizer/all/test_package/CMakeLists.txt +++ b/recipes/sobjectizer/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(sobjectizer REQUIRED CONFIG) diff --git a/recipes/sobjectizer/all/test_v1_package/CMakeLists.txt b/recipes/sobjectizer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c960a336839f6..0000000000000 --- a/recipes/sobjectizer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 9b63bd176646b..0000000000000 --- a/recipes/sobjectizer/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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): - self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/sobjectizer/config.yml b/recipes/sobjectizer/config.yml index 648b2e28b68fb..1b76c7c91dd6f 100644 --- a/recipes/sobjectizer/config.yml +++ b/recipes/sobjectizer/config.yml @@ -1,27 +1,11 @@ versions: - "5.7.2.2": - folder: all - "5.7.2.3": - folder: all - "5.7.2.4": - folder: all - "5.7.2.5": - folder: all - "5.7.2.6": - folder: all - "5.7.3": - folder: all - "5.7.4": - folder: all - "5.7.4.1": - folder: all - "5.7.4.2": - folder: all - "5.7.4.3": + "5.7.4": # Used in so5extra folder: all "5.7.5": folder: all - "5.8.0": + "5.8.1": # Used in so5extra + folder: all + "5.8.3": folder: all - "5.8.1": + "5.8.4": folder: all diff --git a/recipes/soci/all/conanfile.py b/recipes/soci/all/conanfile.py index 1f10648c31235..b32ea8183d84e 100644 --- a/recipes/soci/all/conanfile.py +++ b/recipes/soci/all/conanfile.py @@ -7,7 +7,7 @@ from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.55.0" +required_conan_version = ">=2.1" class SociConan(ConanFile): @@ -17,7 +17,7 @@ class SociConan(ConanFile): description = "The C++ Database Access Library " topics = ("mysql", "odbc", "postgresql", "sqlite3") license = "BSL-1.0" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -125,6 +125,8 @@ def generate(self): tc.variables["WITH_MYSQL"] = self.options.with_mysql tc.variables["WITH_POSTGRESQL"] = self.options.with_postgresql tc.variables["WITH_BOOST"] = self.options.with_boost + if Version(self.version) < "4.1.0": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() deps = CMakeDeps(self) @@ -159,7 +161,7 @@ def package_info(self): self.cpp_info.components["soci_core"].set_property("cmake_target_name", "SOCI::soci_core{}".format(target_suffix)) self.cpp_info.components["soci_core"].libs = ["{}soci_core{}".format(lib_prefix, lib_suffix)] if self.options.with_boost: - self.cpp_info.components["soci_core"].requires.append("boost::boost") + self.cpp_info.components["soci_core"].requires.append("boost::headers") # soci_empty if self.options.empty: @@ -194,24 +196,3 @@ def package_info(self): self.cpp_info.components["soci_postgresql"].set_property("cmake_target_name", "SOCI::soci_postgresql{}".format(target_suffix)) self.cpp_info.components["soci_postgresql"].libs = ["{}soci_postgresql{}".format(lib_prefix, lib_suffix)] self.cpp_info.components["soci_postgresql"].requires = ["soci_core", "libpq::libpq"] - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "SOCI" - self.cpp_info.names["cmake_find_package_multi"] = "SOCI" - self.cpp_info.components["soci_core"].names["cmake_find_package"] = "soci_core{}".format(target_suffix) - self.cpp_info.components["soci_core"].names["cmake_find_package_multi"] = "soci_core{}".format(target_suffix) - if self.options.empty: - self.cpp_info.components["soci_empty"].names["cmake_find_package"] = "soci_empty{}".format(target_suffix) - self.cpp_info.components["soci_empty"].names["cmake_find_package_multi"] = "soci_empty{}".format(target_suffix) - if self.options.with_sqlite3: - self.cpp_info.components["soci_sqlite3"].names["cmake_find_package"] = "soci_sqlite3{}".format(target_suffix) - self.cpp_info.components["soci_sqlite3"].names["cmake_find_package_multi"] = "soci_sqlite3{}".format(target_suffix) - if self.options.with_odbc: - self.cpp_info.components["soci_odbc"].names["cmake_find_package"] = "soci_odbc{}".format(target_suffix) - self.cpp_info.components["soci_odbc"].names["cmake_find_package_multi"] = "soci_odbc{}".format(target_suffix) - if self.options.with_mysql: - self.cpp_info.components["soci_mysql"].names["cmake_find_package"] = "soci_mysql{}".format(target_suffix) - self.cpp_info.components["soci_mysql"].names["cmake_find_package_multi"] = "soci_mysql{}".format(target_suffix) - if self.options.with_postgresql: - self.cpp_info.components["soci_postgresql"].names["cmake_find_package"] = "soci_postgresql{}".format(target_suffix) - self.cpp_info.components["soci_postgresql"].names["cmake_find_package_multi"] = "soci_postgresql{}".format(target_suffix) diff --git a/recipes/soci/all/test_package/CMakeLists.txt b/recipes/soci/all/test_package/CMakeLists.txt index 070af95d1baf0..4f5a4c0df6833 100644 --- a/recipes/soci/all/test_package/CMakeLists.txt +++ b/recipes/soci/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(SOCI REQUIRED CONFIG) diff --git a/recipes/soci/all/test_package/conanfile.py b/recipes/soci/all/test_package/conanfile.py index 84eaa369e4a72..d120a992c06a6 100644 --- a/recipes/soci/all/test_package/conanfile.py +++ b/recipes/soci/all/test_package/conanfile.py @@ -5,7 +5,7 @@ class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type", + settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" def requirements(self): diff --git a/recipes/soci/all/test_v1_package/CMakeLists.txt b/recipes/soci/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/soci/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/soci/all/test_v1_package/conanfile.py b/recipes/soci/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/soci/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_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/sofa/all/CMakeLists.txt b/recipes/sofa/all/CMakeLists.txt index 197cc26a04e81..d020c5d9231d8 100644 --- a/recipes/sofa/all/CMakeLists.txt +++ b/recipes/sofa/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4.3) +cmake_minimum_required(VERSION 3.15) project(sofa C) include(GNUInstallDirs) diff --git a/recipes/sofa/all/test_package/CMakeLists.txt b/recipes/sofa/all/test_package/CMakeLists.txt index e18d0ea3f0d4b..951954d019222 100644 --- a/recipes/sofa/all/test_package/CMakeLists.txt +++ b/recipes/sofa/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(sofa REQUIRED CONFIG) diff --git a/recipes/sofa/all/test_v1_package/CMakeLists.txt b/recipes/sofa/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/sofa/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/sofa/all/test_v1_package/conanfile.py b/recipes/sofa/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sofa/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_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/sokol/all/test_package/CMakeLists.txt b/recipes/sokol/all/test_package/CMakeLists.txt index ecaa904d9733e..78dcdaa9aeda9 100644 --- a/recipes/sokol/all/test_package/CMakeLists.txt +++ b/recipes/sokol/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(sokol REQUIRED CONFIG) diff --git a/recipes/sokol/all/test_v1_package/CMakeLists.txt b/recipes/sokol/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 4999ac8ba67d0..0000000000000 --- a/recipes/sokol/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(sokol REQUIRED CONFIG) - -add_executable(test_package ../test_package/test_package.c) -target_link_libraries(test_package PRIVATE sokol::sokol) diff --git a/recipes/sokol/all/test_v1_package/conanfile.py b/recipes/sokol/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sokol/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_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/sol2/all/conandata.yml b/recipes/sol2/all/conandata.yml index f83f4a6a36735..d83a86253bd8e 100644 --- a/recipes/sol2/all/conandata.yml +++ b/recipes/sol2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.5.0": + url: "https://github.com/ThePhD/sol2/archive/v3.5.0.tar.gz" + sha256: "86c0f6d2836b184a250fc2907091c076bf53c9603dd291eaebade36cc342e13c" "3.3.1": url: "https://github.com/ThePhD/sol2/archive/v3.3.1.tar.gz" sha256: "ad121461047d52b449aa84234a6b578fa3ed95d67d1a0703902eba72417f61bb" @@ -14,3 +17,7 @@ sources: "2.20.6": url: "https://github.com/ThePhD/sol2/archive/v2.20.6.tar.gz" sha256: "90c72e120cdd67d516434b51fdcff2d63cc25afe06fb7866fcf7f5bc85366808" + +patches: + "3.3.1": + - patch_file: patches/0001-Fix-emplace.patch diff --git a/recipes/sol2/all/conanfile.py b/recipes/sol2/all/conanfile.py index 4ebb24964da6a..22145961dbc11 100644 --- a/recipes/sol2/all/conanfile.py +++ b/recipes/sol2/all/conanfile.py @@ -3,7 +3,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.files import copy, get +from conan.tools.files import apply_conandata_patches, copy, get, export_conandata_patches from conan.tools.layout import basic_layout from conan.tools.scm import Version @@ -58,6 +58,9 @@ def _compilers_minimum_version(self): }, }.get(self._min_cppstd, {}) + def export_sources(self): + export_conandata_patches(self) + def layout(self): basic_layout(self, src_folder="src") @@ -92,9 +95,7 @@ def loose_lt_semver(v1, v2): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - - def build(self): - pass + apply_conandata_patches(self) def package(self): copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) diff --git a/recipes/sol2/all/patches/0001-Fix-emplace.patch b/recipes/sol2/all/patches/0001-Fix-emplace.patch new file mode 100644 index 0000000000000..815326b69564b --- /dev/null +++ b/recipes/sol2/all/patches/0001-Fix-emplace.patch @@ -0,0 +1,14 @@ +diff --git a/include/sol/optional_implementation.hpp b/include/sol/optional_implementation.hpp +index 26f41d0c..e22226d6 100644 +--- a/include/sol/optional_implementation.hpp ++++ b/include/sol/optional_implementation.hpp +@@ -2191,7 +2191,8 @@ namespace sol { + static_assert(std::is_constructible::value, "T must be constructible with Args"); + + *this = nullopt; +- this->construct(std::forward(args)...); ++ new (static_cast(this)) optional(std::in_place, std::forward(args)...); ++ return **this; + } + + /// Swaps this optional with the other. diff --git a/recipes/sol2/all/test_v1_package/CMakeLists.txt b/recipes/sol2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index db5ac2a1312e0..0000000000000 --- a/recipes/sol2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -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/sol2/all/test_v1_package/conanfile.py b/recipes/sol2/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sol2/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_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/sol2/config.yml b/recipes/sol2/config.yml index d6be5bd0bfdf0..326e11b75706e 100644 --- a/recipes/sol2/config.yml +++ b/recipes/sol2/config.yml @@ -1,4 +1,6 @@ versions: + "3.5.0": + folder: "all" "3.3.1": folder: "all" "3.3.0": diff --git a/recipes/sole/all/conanfile.py b/recipes/sole/all/conanfile.py index e15d1c06c6dc1..ac242d0a91892 100644 --- a/recipes/sole/all/conanfile.py +++ b/recipes/sole/all/conanfile.py @@ -14,6 +14,7 @@ class SoleConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/r-lyeh-archived/sole" topics = ("uuid", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" def export_sources(self): @@ -30,19 +31,14 @@ 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): 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=self.source_folder, - ) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", self.source_folder, os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.bindirs = [] diff --git a/recipes/sole/all/test_package/CMakeLists.txt b/recipes/sole/all/test_package/CMakeLists.txt index 829b5ca81b9ce..a08164097e4da 100644 --- a/recipes/sole/all/test_package/CMakeLists.txt +++ b/recipes/sole/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(sole 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 sole::sole) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/sole/all/test_package/conanfile.py b/recipes/sole/all/test_package/conanfile.py index bd7165a553cf4..ef5d7042163ec 100644 --- a/recipes/sole/all/test_package/conanfile.py +++ b/recipes/sole/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/sonic-cpp/all/conandata.yml b/recipes/sonic-cpp/all/conandata.yml index d309d05a897b8..1b94133aa026e 100644 --- a/recipes/sonic-cpp/all/conandata.yml +++ b/recipes/sonic-cpp/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "1.0.1": + url: "https://github.com/bytedance/sonic-cpp/archive/refs/tags/v1.0.1.tar.gz" + sha256: "c78fb90c56ba235e8867888c0b1af0e96d7b0b86829381b3cca94f61f83d41e5" "1.0.0": url: "https://github.com/bytedance/sonic-cpp/archive/refs/tags/v1.0.0.tar.gz" sha256: "78af626fa070a2702fe9586d90617292b421d97d7ab1fe27a02cc20434467a80" patches: + "1.0.1": + - patch_file: "patches/1.0.0-0001-use-cci.patch" + patch_description: "use cci recipes" + patch_type: "conan" "1.0.0": - patch_file: "patches/1.0.0-0001-use-cci.patch" patch_description: "use cci recipes" diff --git a/recipes/sonic-cpp/all/conanfile.py b/recipes/sonic-cpp/all/conanfile.py index 8490a3d80c51b..533e9e8146a77 100644 --- a/recipes/sonic-cpp/all/conanfile.py +++ b/recipes/sonic-cpp/all/conanfile.py @@ -4,6 +4,7 @@ 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 +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -50,8 +51,11 @@ 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.") + supported_archs = ["x86", "x86_64"] + if Version(self.version) >= "1.0.1": + supported_archs.extend(["armv8", "armv8.3"]) + if self.settings.arch not in supported_archs: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support {self.settings.arch}.") if is_msvc(self): raise ConanInvalidConfiguration(f"{self.ref} doesn't support MSVC now.") diff --git a/recipes/sonic-cpp/all/test_package/CMakeLists.txt b/recipes/sonic-cpp/all/test_package/CMakeLists.txt index 2af5927a3f12f..356e222a692c6 100644 --- a/recipes/sonic-cpp/all/test_package/CMakeLists.txt +++ b/recipes/sonic-cpp/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(sonic-cpp REQUIRED CONFIG) diff --git a/recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt b/recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/sonic-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/sonic-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/sonic-cpp/config.yml b/recipes/sonic-cpp/config.yml index 40341aa3db6cd..af3bb0714e65c 100644 --- a/recipes/sonic-cpp/config.yml +++ b/recipes/sonic-cpp/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.1": + folder: all "1.0.0": folder: all diff --git a/recipes/sophus/all/test_package/CMakeLists.txt b/recipes/sophus/all/test_package/CMakeLists.txt index 6fd2e8f57ae50..b3b0a92fb4cf5 100644 --- a/recipes/sophus/all/test_package/CMakeLists.txt +++ b/recipes/sophus/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(Sophus REQUIRED CONFIG) diff --git a/recipes/sophus/all/test_v1_package/CMakeLists.txt b/recipes/sophus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8a25f45a5a90a..0000000000000 --- a/recipes/sophus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Sophus REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -target_link_libraries(${PROJECT_NAME} PRIVATE Sophus::Sophus) diff --git a/recipes/sophus/all/test_v1_package/conanfile.py b/recipes/sophus/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sophus/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_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/soplex/all/conandata.yml b/recipes/soplex/all/conandata.yml index b034a63a75693..aa0fdcefcf969 100644 --- a/recipes/soplex/all/conandata.yml +++ b/recipes/soplex/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "7.1.2": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-712.tar.gz" + sha256: "a1a7d7f7e30d1db65548b32f75d6f2ed9bd0bf289f639eb4481d3d141c67a332" + "7.1.1": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-711.tar.gz" + sha256: "75752dca395e219e350f3b462f1f4c08e9d3c2deb2782414862f546a9489cdeb" + "7.1.0": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-710.tar.gz" + sha256: "ec177fdb688346287d5f211dd7ec4a0195c8ec9b3a5314d38aca383b6fa1418e" + "7.0.1": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-701.tar.gz" + sha256: "80cce994dcbe45fd52b60e31a3aeb5d2c60a7ddbaae495e0ce6bf58481675696" + "7.0.0": + url: "https://github.com/scipopt/soplex/archive/refs/tags/release-700.tar.gz" + sha256: "ab1906d3afb1793a6f129a5baef9dd8eee929ee945aade427cb9f0b17888239c" "6.0.4": url: "https://github.com/scipopt/soplex/archive/refs/tags/release-604.tar.gz" sha256: "691f5b593cb85c2586522d5de5a5a7692958d22ff1ddffb4fc395f4696590b6f" diff --git a/recipes/soplex/all/conanfile.py b/recipes/soplex/all/conanfile.py index 047f359f2bb4b..9dc99e1409055 100644 --- a/recipes/soplex/all/conanfile.py +++ b/recipes/soplex/all/conanfile.py @@ -73,7 +73,7 @@ def requirements(self): # see https://github.com/conan-io/conan-center-index/pull/16017#issuecomment-1495688452 self.requires("gmp/6.3.0", transitive_headers=True, transitive_libs=True) if self.options.with_boost: - self.requires("boost/1.83.0", transitive_headers=True) # also update Boost_VERSION_MACRO below! + self.requires("boost/1.84.0", transitive_headers=True) # also update Boost_VERSION_MACRO below! def validate(self): if self.settings.compiler.cppstd: @@ -90,9 +90,11 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["MPFR"] = False tc.variables["GMP"] = self.options.with_gmp tc.variables["BOOST"] = self.options.with_boost - tc.variables["Boost_VERSION_MACRO"] = "108300" + tc.variables["Boost_VERSION_MACRO"] = "108400" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) if self.options.with_gmp: diff --git a/recipes/soplex/all/test_package/CMakeLists.txt b/recipes/soplex/all/test_package/CMakeLists.txt index e74edd1950d7a..f734804072478 100644 --- a/recipes/soplex/all/test_package/CMakeLists.txt +++ b/recipes/soplex/all/test_package/CMakeLists.txt @@ -9,5 +9,9 @@ if(TARGET soplex::soplex) set_target_properties(soplex PROPERTIES INTERFACE_LINK_LIBRARIES soplex::soplex) endif() +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") +endif () + add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE soplex) diff --git a/recipes/soplex/config.yml b/recipes/soplex/config.yml index 73bcf839da618..7c8e24f77726a 100644 --- a/recipes/soplex/config.yml +++ b/recipes/soplex/config.yml @@ -1,4 +1,14 @@ versions: + "7.1.2": + folder: all + "7.1.1": + folder: all + "7.1.0": + folder: all + "7.0.1": + folder: all + "7.0.0": + folder: all "6.0.4": folder: all "6.0.3": diff --git a/recipes/soundtouch/all/conandata.yml b/recipes/soundtouch/all/conandata.yml index ed99d82ff219b..0d3d865ce3fdb 100644 --- a/recipes/soundtouch/all/conandata.yml +++ b/recipes/soundtouch/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.3": + url: "https://www.surina.net/soundtouch/soundtouch-2.3.3.tar.gz" + sha256: "43b23dfac2f64a3aff55d64be096ffc7b73842c3f5665caff44975633a975a99" "2.3.2": url: "https://www.surina.net/soundtouch/soundtouch-2.3.2.tar.gz" sha256: "3bde8ddbbc3661f04e151f72cf21ca9d8f8c88e265833b65935b8962d12d6b08" diff --git a/recipes/soundtouch/all/conanfile.py b/recipes/soundtouch/all/conanfile.py index 66a875621a86d..dc042457b29be 100644 --- a/recipes/soundtouch/all/conanfile.py +++ b/recipes/soundtouch/all/conanfile.py @@ -1,11 +1,14 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd from conan.tools.microsoft import is_msvc -from conan.tools.files import get, copy, rm, rmdir +from conan.tools.files import get, copy, rm, rmdir, replace_in_file from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0" class SoundTouchConan(ConanFile): name = "soundtouch" @@ -14,6 +17,8 @@ class SoundTouchConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://codeberg.org/soundtouch/soundtouch" topics = ("audio", "processing", "tempo", "pitch", "playback") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -43,8 +48,26 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def validate(self): + if Version(self.version) >= "2.3.3": + check_min_cppstd(self, 17) + + if self.settings.os == "Macos" and self.options.integer_samples and self.options.with_dll: + # Undefined symbols for architecture arm64: + # "soundtouch::BPMDetect::inputSamples(float const*, int)", referenced from: + # _bpm_putSamples in SoundTouchDLL.cpp.o + # _bpm_putSamples_i16 in SoundTouchDLL.cpp.o + raise ConanInvalidConfiguration('The -o="&:integer_samples=True" option is incompatible with -o="&:with_dll=True"') + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + self._patch_sources() + + def _patch_sources(self): + if Version(self.version) >= "2.3.3": + # Let Conan handle the C++ standard + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD 17)", "") def generate(self): tc = CMakeToolchain(self) @@ -105,15 +128,5 @@ def package_info(self): 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"] = "SoundTouch" - self.cpp_info.names["cmake_find_package_multi"] = "SoundTouch" - self.cpp_info.components["_soundtouch"].names["cmake_find_package"] = "SoundTouch" - self.cpp_info.components["_soundtouch"].names["cmake_find_package_multi"] = "SoundTouch" - self.cpp_info.names["pkg_config"] = "SoundTouch" - if self.options.with_dll: - self.cpp_info.components["SoundTouchDLL"].names["cmake_find_package"] = "SoundTouchDLL" - self.cpp_info.components["SoundTouchDLL"].names["cmake_find_package_multi"] = "SoundTouchDLL" - if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("mvec") diff --git a/recipes/soundtouch/all/test_package/CMakeLists.txt b/recipes/soundtouch/all/test_package/CMakeLists.txt index a768ac666be33..fe275d53dc1ee 100644 --- a/recipes/soundtouch/all/test_package/CMakeLists.txt +++ b/recipes/soundtouch/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) diff --git a/recipes/soundtouch/all/test_v1_package/CMakeLists.txt b/recipes/soundtouch/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/soundtouch/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/soundtouch/all/test_v1_package/conanfile.py b/recipes/soundtouch/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/soundtouch/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/soundtouch/config.yml b/recipes/soundtouch/config.yml index aee8de619ec30..5ca4acfdc4f7b 100644 --- a/recipes/soundtouch/config.yml +++ b/recipes/soundtouch/config.yml @@ -1,3 +1,5 @@ versions: + "2.3.3": + folder: all "2.3.2": folder: all diff --git a/recipes/source_location/all/test_v1_package/CMakeLists.txt b/recipes/source_location/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/source_location/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index cbe0be23191a2..0000000000000 --- a/recipes/source_location/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 1e3734bb24378..0000000000000 --- a/recipes/source_location/all/test_v1_package/src/test.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#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/test_package/CMakeLists.txt b/recipes/soxr/all/test_package/CMakeLists.txt index bd7a2c60dd458..1a5476e72a5c4 100644 --- a/recipes/soxr/all/test_package/CMakeLists.txt +++ b/recipes/soxr/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) enable_testing() diff --git a/recipes/soxr/all/test_v1_package/CMakeLists.txt b/recipes/soxr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c23ed5cfe6d98..0000000000000 --- a/recipes/soxr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -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/soxr/all/test_v1_package/conanfile.py b/recipes/soxr/all/test_v1_package/conanfile.py deleted file mode 100644 index 4240acdf711cd..0000000000000 --- a/recipes/soxr/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,15 +0,0 @@ -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(f"ctest --output-on-failure -C {self.settings.build_type} -j {tools.cpu_count()}", run_environment=True) diff --git a/recipes/span-lite/all/conandata.yml b/recipes/span-lite/all/conandata.yml index fe2adde8330d8..f5a6e5aa8bfcb 100644 --- a/recipes/span-lite/all/conandata.yml +++ b/recipes/span-lite/all/conandata.yml @@ -1,28 +1,22 @@ sources: - "0.6.0": - url: https://github.com/martinmoene/span-lite/archive/v0.6.0.tar.gz - sha256: da97ea5922a3c6129fe2ce89b95b471ae40e2ad921b354e472236a5ad57c5053 - "0.7.0": - url: https://github.com/martinmoene/span-lite/archive/v0.7.0.tar.gz - sha256: e95a9b281b46eb2b44257c6c4ec218c1741144c1167644896e29fd6aed9bbcf4 - "0.8.0": - url: https://github.com/martinmoene/span-lite/archive/v0.8.0.tar.gz - sha256: cca1c9de1dd1b7244ee8e5a093cc38b869d972154db61932b7dd22bd7a9d609c - "0.8.1": - url: https://github.com/martinmoene/span-lite/archive/v0.8.1.tar.gz - sha256: 2136dba54988c16b03f7c652ea977205bf624bfde90c24331177027d6529386d - "0.9.0": - url: https://github.com/martinmoene/span-lite/archive/v0.9.0.tar.gz - sha256: cdb5f86e5f5e679d63700a56de734c44fe22a574a17347d09dbaaef80619af91 - "0.9.2": - url: https://github.com/martinmoene/span-lite/archive/v0.9.2.tar.gz - sha256: 7562802aac9b78e0140c3d59933cf4dc5825c0712c63daad2f7fff8c67e62eb4 - "0.10.0": - url: https://github.com/martinmoene/span-lite/archive/v0.10.0.tar.gz - sha256: fd2ca42c18b4d5fae869752d18cf414bb4a3e4f01e617835a79ddb54a207889c - "0.10.1": - url: "https://github.com/martinmoene/span-lite/archive/v0.10.1.tar.gz" - sha256: "f915bca2d1e8357efdd043a5dc88047b390a76d77fb8cc1b6de831f7f43e397b" + "0.11.0": + url: "https://github.com/martinmoene/span-lite/archive/v0.11.0.tar.gz" + sha256: "ef4e028e18ff21044da4b4641ca1bc8a2e2d656e2028322876c0e1b9b6904f9d" "0.10.3": url: "https://github.com/martinmoene/span-lite/archive/v0.10.3.tar.gz" sha256: "04ac8148760369f11d4cdbc7969d66cb3d372357b6b5c7744841a60551ccb50b" + "0.10.1": + url: "https://github.com/martinmoene/span-lite/archive/v0.10.1.tar.gz" + sha256: "f915bca2d1e8357efdd043a5dc88047b390a76d77fb8cc1b6de831f7f43e397b" + "0.10.0": + url: https://github.com/martinmoene/span-lite/archive/v0.10.0.tar.gz + sha256: fd2ca42c18b4d5fae869752d18cf414bb4a3e4f01e617835a79ddb54a207889c + "0.9.2": + url: https://github.com/martinmoene/span-lite/archive/v0.9.2.tar.gz + sha256: 7562802aac9b78e0140c3d59933cf4dc5825c0712c63daad2f7fff8c67e62eb4 + "0.9.0": + url: https://github.com/martinmoene/span-lite/archive/v0.9.0.tar.gz + sha256: cdb5f86e5f5e679d63700a56de734c44fe22a574a17347d09dbaaef80619af91 + "0.8.1": + url: https://github.com/martinmoene/span-lite/archive/v0.8.1.tar.gz + sha256: 2136dba54988c16b03f7c652ea977205bf624bfde90c24331177027d6529386d diff --git a/recipes/span-lite/all/conanfile.py b/recipes/span-lite/all/conanfile.py index a3cdfec98fc6a..1ff14a35802e5 100644 --- a/recipes/span-lite/all/conanfile.py +++ b/recipes/span-lite/all/conanfile.py @@ -8,11 +8,12 @@ class SpanLiteConan(ConanFile): name = "span-lite" + description = "A C++20-like span 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/span-lite" - description = "span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only library" - topics = ("cpp98", "cpp11", "cpp14", "cpp17", "span", "span-implementations") - license = "BSL-1.0" + topics = ("cpp98", "cpp11", "cpp14", "cpp17", "span", "span-implementations", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -23,11 +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) - - def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) @@ -38,7 +35,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "nonstd::span-lite") 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"] = "span-lite" @@ -48,6 +44,5 @@ def package_info(self): self.cpp_info.components["spanlite"].names["cmake_find_package"] = "span-lite" self.cpp_info.components["spanlite"].names["cmake_find_package_multi"] = "span-lite" self.cpp_info.components["spanlite"].set_property("cmake_target_name", "nonstd::span-lite") - self.cpp_info.components["spanlite"].bindirs = [] self.cpp_info.components["spanlite"].libdirs = [] self.cpp_info.components["spanlite"].resdirs = [] diff --git a/recipes/span-lite/all/test_package/CMakeLists.txt b/recipes/span-lite/all/test_package/CMakeLists.txt index d8392ded7dfb5..926524b405811 100644 --- a/recipes/span-lite/all/test_package/CMakeLists.txt +++ b/recipes/span-lite/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(span-lite REQUIRED CONFIG) diff --git a/recipes/span-lite/all/test_v1_package/CMakeLists.txt b/recipes/span-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index b91df846606c0..0000000000000 --- a/recipes/span-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(span-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::span-lite) diff --git a/recipes/span-lite/all/test_v1_package/conanfile.py b/recipes/span-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/span-lite/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_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/span-lite/config.yml b/recipes/span-lite/config.yml index ebfb72f91ca97..cd3bc2b5634a7 100644 --- a/recipes/span-lite/config.yml +++ b/recipes/span-lite/config.yml @@ -1,19 +1,15 @@ versions: - "0.6.0": + "0.11.0": folder: all - "0.7.0": - folder: all - "0.8.0": + "0.10.3": folder: all - "0.8.1": + "0.10.1": folder: all - "0.9.0": + "0.10.0": folder: all "0.9.2": folder: all - "0.10.0": - folder: all - "0.10.1": + "0.9.0": folder: all - "0.10.3": + "0.8.1": folder: all diff --git a/recipes/sparrow/all/conandata.yml b/recipes/sparrow/all/conandata.yml new file mode 100644 index 0000000000000..fb683b28842e6 --- /dev/null +++ b/recipes/sparrow/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.5.0": + url: "https://github.com/man-group/sparrow/archive/refs/tags/0.5.0.tar.gz" + sha256: "EFEB7258B3B1F7A25CE72CF3F86C6DE98D2AB4F1A6A89CECC1D6D822E98B3AF1" diff --git a/recipes/sparrow/all/conanfile.py b/recipes/sparrow/all/conanfile.py new file mode 100644 index 0000000000000..ffa74ae197d85 --- /dev/null +++ b/recipes/sparrow/all/conanfile.py @@ -0,0 +1,111 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build.cppstd import check_min_cppstd +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 +from conan.tools.scm import Version +import os + +required_conan_version = ">=2.4" + + +class SparrowRecipe(ConanFile): + name = "sparrow" + description = "C++20 idiomatic APIs for the Apache Arrow Columnar Format" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/man-group/sparrow" + topics = ("arrow", "apache arrow", "columnar format", "dataframe") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "use_date_polyfill": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "use_date_polyfill": True + } + + implements = ["auto_shared_fpic"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + if self.settings.os == "Macos": + del self.options.use_date_polyfill + + @property + def _uses_date_polyfill(self): + # Not an option not to use it on Macos + return self.options.get_safe("use_date_polyfill", True) + + def requirements(self): + if self._uses_date_polyfill: + self.requires("date/3.0.3", transitive_headers=True) + + @property + def _compilers_minimum_version(self): + # Upstream has these set as the minimum versions + # regardless of cppstd support + return { + "apple-clang": "16", + "clang": "18", + "gcc": "12", + "msvc": "194" + } + + def validate(self): + check_min_cppstd(self, 20) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + if minimum_version and Version(self.settings.compiler.version) < Version(minimum_version): + raise ConanInvalidConfiguration(f"{self.name} requires {self.settings.compiler} {minimum_version} or newer") + + 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["USE_DATE_POLYFILL"] = self._uses_date_polyfill + tc.variables["SPARROW_BUILD_SHARED"] = self.options.shared + if is_msvc(self): + tc.variables["USE_LARGE_INT_PLACEHOLDERS"] = True + 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() + rmdir(self, os.path.join(self.package_folder, "share", "cmake")) + + def package_info(self): + self.cpp_info.libs = ["sparrow"] + self.cpp_info.set_property("cmake_file_name", "sparrow") + self.cpp_info.set_property("cmake_target_name", "sparrow::sparrow") + if not self.options.shared: + self.cpp_info.defines.append("SPARROW_STATIC_LIB") + if self._uses_date_polyfill: + self.cpp_info.defines.append("SPARROW_USE_DATE_POLYFILL") + if is_msvc(self): + self.cpp_info.defines.append("SPARROW_USE_LARGE_INT_PLACEHOLDERS") diff --git a/recipes/sparrow/all/test_package/CMakeLists.txt b/recipes/sparrow/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e9d3e101ce46a --- /dev/null +++ b/recipes/sparrow/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(sparrow REQUIRED CONFIG) + +add_executable(standalone main.cpp) + +target_link_libraries(standalone PRIVATE sparrow::sparrow) +target_compile_features(standalone PRIVATE cxx_std_20) diff --git a/recipes/sparrow/all/test_package/conanfile.py b/recipes/sparrow/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3df0f0d196721 --- /dev/null +++ b/recipes/sparrow/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" + 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], "standalone"), env="conanrun") diff --git a/recipes/sparrow/all/test_package/main.cpp b/recipes/sparrow/all/test_package/main.cpp new file mode 100644 index 0000000000000..eb113c190e15c --- /dev/null +++ b/recipes/sparrow/all/test_package/main.cpp @@ -0,0 +1,12 @@ +#include + +#include + +int main(int argc, char** argv) +{ + // using initializer_list + auto arr = sparrow::build({1, 2, 3, 4, 5}); + auto arr5 = sparrow::primitive_array({1, 2, 3, 4, 5}); + assert(arr == arr5); + return EXIT_SUCCESS; +} diff --git a/recipes/sparrow/config.yml b/recipes/sparrow/config.yml new file mode 100644 index 0000000000000..88582b9a915c6 --- /dev/null +++ b/recipes/sparrow/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.0": + folder: "all" diff --git a/recipes/spdlog/all/conandata.yml b/recipes/spdlog/all/conandata.yml index f320d3a0e0568..318ef598d52ce 100644 --- a/recipes/spdlog/all/conandata.yml +++ b/recipes/spdlog/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.15.1": + url: "https://github.com/gabime/spdlog/archive/v1.15.1.tar.gz" + sha256: "25c843860f039a1600f232c6eb9e01e6627f7d030a2ae5e232bdd3c9205d26cc" + "1.15.0": + url: "https://github.com/gabime/spdlog/archive/v1.15.0.tar.gz" + sha256: "9962648c9b4f1a7bbc76fd8d9172555bad1871fdb14ff4f842ef87949682caa5" + "1.14.1": + url: "https://github.com/gabime/spdlog/archive/v1.14.1.tar.gz" + sha256: "1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b" + "1.14.0": + url: "https://github.com/gabime/spdlog/archive/v1.14.0.tar.gz" + sha256: "429a6b73ade8285cb21f83bacf89e2821dd1720ea7faa3cb518ffe04b4e00efc" + "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" @@ -23,3 +38,16 @@ patches: patch_description: "Fix fmt 10.0.0 build" patch_type: "conan" patch_source: "https://github.com/gabime/spdlog/pull/2694" +# Each release is intended to work with some specific versions +fmt_version_mapping: + "1.15.1": "11.1.3" + "1.15.0": "11.0.2" + "1.14.1": "10.2.1" + "1.14.0": "10.2.1" + "1.13.0": "10.2.1" + "1.12.0": "10.2.1" + "1.11.0": "10.0.0" + "1.10.0": "8.1.1" + "1.9.2": "8.0.1" + "1.9.1": "8.0.1" + "1.8.5": "7.1.3" diff --git a/recipes/spdlog/all/conanfile.py b/recipes/spdlog/all/conanfile.py index 85bd609950223..26289fe3fbce1 100644 --- a/recipes/spdlog/all/conanfile.py +++ b/recipes/spdlog/all/conanfile.py @@ -3,7 +3,7 @@ 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, apply_conandata_patches, export_conandata_patches -from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -25,7 +25,9 @@ class SpdlogConan(ConanFile): "header_only": [True, False], "wchar_support": [True, False], "wchar_filenames": [True, False], + "wchar_console": [True, False], "no_exceptions": [True, False], + "use_std_fmt": [True, False], } default_options = { "shared": False, @@ -33,7 +35,9 @@ class SpdlogConan(ConanFile): "header_only": False, "wchar_support": False, "wchar_filenames": False, + "wchar_console": False, "no_exceptions": False, + "use_std_fmt": False, } def export_sources(self): @@ -42,6 +46,14 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + else: + del self.options.wchar_support + del self.options.wchar_filenames + del self.options.wchar_console + if Version(self.version) < "1.10.0": + del self.options.use_std_fmt + if Version(self.version) < "1.15.0": + self.options.rm_safe("wchar_console") def configure(self): if self.options.get_safe("shared") or self.options.header_only: @@ -53,53 +65,65 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self_version = Version(self.version) - fmt_version = "7.1.3" - - if self_version >= "1.12.0": - fmt_version = "10.1.1" - elif self_version >= "1.11.0": - fmt_version = "10.0.0" - elif self_version >= "1.10.0": - fmt_version = "8.1.1" - elif self_version >= "1.9.0": - fmt_version = "8.0.1" - elif self_version >= "1.7.0": - fmt_version = "7.1.3" - - self.requires(f"fmt/{fmt_version}", transitive_headers=True, transitive_libs=True) + if not self.options.get_safe("use_std_fmt"): + fmt_version = self.conan_data["fmt_version_mapping"][self.version] + self.requires(f"fmt/{fmt_version}", transitive_headers=True, transitive_libs=True) def package_id(self): if self.info.options.header_only: self.info.clear() + + @property + def _std_fmt_compilers_minimum_version(self): + return { + "gcc": "13", + "clang": "14", + "apple-clang": "15", + "Visual Studio": "16", + "msvc": "192", + } def validate(self): - if self.settings.get_safe("compiler.cppstd"): + if self.options.get_safe("use_std_fmt"): + check_min_cppstd(self, 20) + else: check_min_cppstd(self, 11) - if self.settings.os != "Windows" and (self.options.wchar_support or self.options.wchar_filenames): - raise ConanInvalidConfiguration("wchar is only supported under windows") if self.options.get_safe("shared") and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported") + + if self.options.get_safe("use_std_fmt"): + compiler_name = str(self.settings.compiler) + minimum_version = self._std_fmt_compilers_minimum_version.get(compiler_name, False) + if not minimum_version: + self.output.warning(f"{self.name} recipe lacks information about the {compiler_name} compiler support.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} using std::fmt requires std::fmt, which your compiler does not support." + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): if not self.options.header_only: - fmt = self.dependencies["fmt"] tc = CMakeToolchain(self) tc.variables["SPDLOG_BUILD_EXAMPLE"] = False tc.variables["SPDLOG_BUILD_EXAMPLE_HO"] = False tc.variables["SPDLOG_BUILD_TESTS"] = False tc.variables["SPDLOG_BUILD_TESTS_HO"] = False tc.variables["SPDLOG_BUILD_BENCH"] = False - tc.variables["SPDLOG_FMT_EXTERNAL"] = not fmt.options.header_only - tc.variables["SPDLOG_FMT_EXTERNAL_HO"] = fmt.options.header_only + if not self.options.get_safe("use_std_fmt"): + fmt = self.dependencies["fmt"] + tc.variables["SPDLOG_FMT_EXTERNAL"] = not fmt.options.header_only + tc.variables["SPDLOG_FMT_EXTERNAL_HO"] = fmt.options.header_only tc.variables["SPDLOG_BUILD_SHARED"] = not self.options.header_only and self.options.shared - tc.variables["SPDLOG_WCHAR_SUPPORT"] = self.options.wchar_support - tc.variables["SPDLOG_WCHAR_FILENAMES"] = self.options.wchar_filenames + tc.variables["SPDLOG_WCHAR_SUPPORT"] = self.options.get_safe("wchar_support", False) + tc.variables["SPDLOG_WCHAR_FILENAMES"] = self.options.get_safe("wchar_filenames", False) + if Version(self.version) >= "1.15.0": + tc.variables["SDPLOG_WCHAR_CONSOLE"] = self.options.get_safe("wchar_console", False) tc.variables["SPDLOG_INSTALL"] = True tc.variables["SPDLOG_NO_EXCEPTIONS"] = self.options.no_exceptions + tc.variables["SPDLOG_USE_STD_FORMAT"] = self.options.get_safe("use_std_fmt") if self.settings.os in ("iOS", "tvOS", "watchOS"): tc.variables["SPDLOG_NO_TLS"] = True tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" @@ -107,12 +131,17 @@ def generate(self): cmake_deps = CMakeDeps(self) cmake_deps.generate() - def _disable_werror(self): + + def _patch_sources(self): + apply_conandata_patches(self) replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"), "/WX", "") + # This is properly set in later versions + if self.options.get_safe("use_std_fmt") and Version(self.version) < "1.12": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "CMAKE_CXX_STANDARD 11", "CMAKE_CXX_STANDARD 20") def build(self): - apply_conandata_patches(self) - self._disable_werror() + self._patch_sources() if not self.options.header_only: cmake = CMake(self) cmake.configure() @@ -141,8 +170,11 @@ def package_info(self): # TODO: back to global scope in conan v2 once legacy generators removed self.cpp_info.components["libspdlog"].set_property("cmake_target_name", f"spdlog::{target}") - self.cpp_info.components["libspdlog"].defines.append("SPDLOG_FMT_EXTERNAL") - self.cpp_info.components["libspdlog"].requires = ["fmt::fmt"] + if self.options.get_safe("use_std_fmt"): + self.cpp_info.components["libspdlog"].defines.append("SPDLOG_USE_STD_FORMAT") + else: + self.cpp_info.components["libspdlog"].requires = ["fmt::fmt"] + self.cpp_info.components["libspdlog"].defines.append("SPDLOG_FMT_EXTERNAL") if self.options.header_only: self.cpp_info.components["libspdlog"].libdirs = [] @@ -150,18 +182,15 @@ def package_info(self): 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") - if self.options.wchar_support: + if self.options.get_safe("wchar_support"): self.cpp_info.components["libspdlog"].defines.append("SPDLOG_WCHAR_TO_UTF8_SUPPORT") - if self.options.wchar_filenames: + if self.options.get_safe("wchar_filenames"): self.cpp_info.components["libspdlog"].defines.append("SPDLOG_WCHAR_FILENAMES") + if self.options.get_safe("wchar_console"): + self.cpp_info.components["libspdlog"].defines.append("SPDLOG_UTF8_TO_WCHAR_CONSOLE") if self.options.no_exceptions: self.cpp_info.components["libspdlog"].defines.append("SPDLOG_NO_EXCEPTIONS") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libspdlog"].system_libs = ["pthread"] if self.options.header_only and self.settings.os in ("iOS", "tvOS", "watchOS"): self.cpp_info.components["libspdlog"].defines.append("SPDLOG_NO_TLS") - - self.cpp_info.names["cmake_find_package"] = "spdlog" - self.cpp_info.names["cmake_find_package_multi"] = "spdlog" - self.cpp_info.components["libspdlog"].names["cmake_find_package"] = target - self.cpp_info.components["libspdlog"].names["cmake_find_package_multi"] = target diff --git a/recipes/spdlog/all/test_package/CMakeLists.txt b/recipes/spdlog/all/test_package/CMakeLists.txt index d31b151d6390c..253d52b368e6f 100644 --- a/recipes/spdlog/all/test_package/CMakeLists.txt +++ b/recipes/spdlog/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(spdlog REQUIRED CONFIG) @@ -9,4 +9,9 @@ if(SPDLOG_HEADER_ONLY) else() target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog) endif() -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(SPDLOG_USE_STD_FORMAT) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/spdlog/all/test_package/conanfile.py b/recipes/spdlog/all/test_package/conanfile.py index 81d7c956cf9d2..346d9bd744058 100644 --- a/recipes/spdlog/all/test_package/conanfile.py +++ b/recipes/spdlog/all/test_package/conanfile.py @@ -19,6 +19,7 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) tc.variables["SPDLOG_HEADER_ONLY"] = self.dependencies["spdlog"].options.header_only + tc.variables["SPDLOG_USE_STD_FORMAT"] = self.dependencies["spdlog"].options.get_safe("use_std_fmt", False) tc.generate() def build(self): diff --git a/recipes/spdlog/all/test_v1_package/CMakeLists.txt b/recipes/spdlog/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/spdlog/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/spdlog/all/test_v1_package/conanfile.py b/recipes/spdlog/all/test_v1_package/conanfile.py deleted file mode 100644 index 30ca1d12b0933..0000000000000 --- a/recipes/spdlog/all/test_v1_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): - tools.mkdir("logs/") - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/spdlog/config.yml b/recipes/spdlog/config.yml index 0228f28a93d75..0a050e962b0df 100644 --- a/recipes/spdlog/config.yml +++ b/recipes/spdlog/config.yml @@ -1,4 +1,14 @@ versions: + "1.15.1": + folder: "all" + "1.15.0": + folder: "all" + "1.14.1": + folder: "all" + "1.14.0": + folder: "all" + "1.13.0": + folder: "all" "1.12.0": folder: "all" "1.11.0": diff --git a/recipes/spectra/all/test_package/CMakeLists.txt b/recipes/spectra/all/test_package/CMakeLists.txt index c68917e8a8c64..b647e2b44cedd 100644 --- a/recipes/spectra/all/test_package/CMakeLists.txt +++ b/recipes/spectra/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(spectra REQUIRED CONFIG) diff --git a/recipes/spectra/all/test_v1_package/CMakeLists.txt b/recipes/spectra/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/spectra/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/spectra/all/test_v1_package/conanfile.py b/recipes/spectra/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/spectra/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_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/speedb/all/conandata.yml b/recipes/speedb/all/conandata.yml new file mode 100644 index 0000000000000..63a7ae1e28120 --- /dev/null +++ b/recipes/speedb/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "2.8.0": + url: "https://github.com/speedb-io/speedb/archive/refs/tags/speedb/v2.8.0.tar.gz" + sha256: "ee7a55942a23d9589e5d3527364a2f9ae552ef7d52f6fd303dda25e4f27786ba" +patches: + "2.8.0": + - patch_file: "patches/2.8.0-0001-use-cci.patch" + patch_description: "use cci's package" + patch_type: "conan" + - patch_file: "patches/2.8.0-0002-fix-install.patch" + patch_description: "disable static lib installation on shared build" + patch_type: "conan" diff --git a/recipes/speedb/all/conanfile.py b/recipes/speedb/all/conanfile.py new file mode 100644 index 0000000000000..043f01899c023 --- /dev/null +++ b/recipes/speedb/all/conanfile.py @@ -0,0 +1,141 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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, cross_building +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 SpeedbConan(ConanFile): + name = "speedb" + description = "A RocksDB compliant high performance scalable embedded key-value store" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/speedb-io/speedb" + topics = ("rocksdb", "embedded", "key-value-store", "kvs", "storage-engine") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_snappy": [True, False], + "with_lz4": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + "with_core_tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_snappy": True, + "with_lz4": True, + "with_zlib": True, + "with_zstd": True, + "with_core_tools": 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 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): + # TODO: support jemalloc, liburing + if self.options.with_snappy: + self.requires("snappy/1.1.10") + if self.options.with_lz4: + self.requires("lz4/1.9.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_core_tools: + self.requires("gflags/2.2.2") + self.requires("readline/8.2") + + 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["WITH_JEMALLOC"] = False + tc.variables["WITH_LIBURING"] = False + 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_TESTS"] = False + tc.variables["WITH_BENCHMARK_TOOLS"] = False + tc.variables["WITH_CORE_TOOLS"] = self.options.with_core_tools + tc.variables["WITH_GFLAGS"] = self.options.with_core_tools + tc.variables["WITH_TOOLS"] = False + tc.variables["ROCKSDB_BUILD_SHARED"] = self.options.shared + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # to avoid wrong CPU detection, modify not to use "-march=native" in apple-clang + if cross_building(self) and self.settings.compiler == "apple-clang": + replace_in_file(self, + os.path.join(self.source_folder, "CMakeLists.txt"), + """elseif(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64" AND NOT HAS_ARMV8_CRC)""", + "elseif(FALSE)" + ) + + def build(self): + self._patch_sources() + 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, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["speedb"] + self.cpp_info.set_property("pkg_config_name", "speedb") + self.cpp_info.set_property("cmake_file_name", "Speedb") + self.cpp_info.set_property("cmake_target_name", "Speedb::speedb") diff --git a/recipes/speedb/all/patches/2.8.0-0001-use-cci.patch b/recipes/speedb/all/patches/2.8.0-0001-use-cci.patch new file mode 100644 index 0000000000000..0c321d827ce99 --- /dev/null +++ b/recipes/speedb/all/patches/2.8.0-0001-use-cci.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a579792..62299e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -195,7 +195,11 @@ else() + find_package(zstd REQUIRED) + add_definitions(-DZSTD) + include_directories(${ZSTD_INCLUDE_DIR}) +- list(APPEND THIRDPARTY_LIBS zstd::zstd) ++ if (TARGET zstd::libzstd_shared) ++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_shared) ++ else() ++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_static) ++ endif() + endif() + endif() + +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 90e76e2..96180cc 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -2,11 +2,12 @@ set(CORE_TOOLS + sst_dump.cc + ldb.cc + beezcli.cc) ++find_package(readline REQUIRED) + foreach(src ${CORE_TOOLS}) + get_filename_component(exename ${src} NAME_WE) + add_executable(${exename}${ARTIFACT_SUFFIX} + ${src}) +- target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB} readline) ++ target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB} readline::readline) + list(APPEND core_tool_deps ${exename}) + endforeach() + diff --git a/recipes/speedb/all/patches/2.8.0-0002-fix-install.patch b/recipes/speedb/all/patches/2.8.0-0002-fix-install.patch new file mode 100644 index 0000000000000..8306a64425750 --- /dev/null +++ b/recipes/speedb/all/patches/2.8.0-0002-fix-install.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 62299e9..43fe51d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1290,7 +1290,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) + endforeach() + + install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination}) +- ++ if(NOT ROCKSDB_BUILD_SHARED) + install( + TARGETS ${ROCKSDB_STATIC_LIB} + EXPORT SpeedbTargets +@@ -1298,7 +1298,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) +- ++ endif() + if(ROCKSDB_BUILD_SHARED) + install( + TARGETS ${ROCKSDB_SHARED_LIB} diff --git a/recipes/speedb/all/test_package/CMakeLists.txt b/recipes/speedb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..4353233f81e9a --- /dev/null +++ b/recipes/speedb/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Speedb REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE Speedb::speedb) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/speedb/all/test_package/conanfile.py b/recipes/speedb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/speedb/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/speedb/all/test_package/test_package.cpp b/recipes/speedb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2d49c4d14da21 --- /dev/null +++ b/recipes/speedb/all/test_package/test_package.cpp @@ -0,0 +1,93 @@ +// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. +// This source code is licensed under both the GPLv2 (found in the +// COPYING file in the root directory) and Apache 2.0 License +// (found in the LICENSE.Apache file in the root directory). + +#include +#include + +#include "rocksdb/db.h" +#include "rocksdb/options.h" +#include "rocksdb/slice.h" + +using ROCKSDB_NAMESPACE::DB; +using ROCKSDB_NAMESPACE::Options; +using ROCKSDB_NAMESPACE::PinnableSlice; +using ROCKSDB_NAMESPACE::ReadOptions; +using ROCKSDB_NAMESPACE::Status; +using ROCKSDB_NAMESPACE::WriteBatch; +using ROCKSDB_NAMESPACE::WriteOptions; + +#if defined(OS_WIN) +std::string kDBPath = "C:\\Windows\\TEMP\\rocksdb_simple_example"; +#else +std::string kDBPath = "/tmp/rocksdb_simple_example"; +#endif + +int main() { + DB* db; + Options options; + // Optimize RocksDB. This is the easiest way to get RocksDB to perform well + options.IncreaseParallelism(); + options.OptimizeLevelStyleCompaction(); + // create the DB if it's not already present + options.create_if_missing = true; + + // open DB + Status s = DB::Open(options, kDBPath, &db); + assert(s.ok()); + + // Put key-value + s = db->Put(WriteOptions(), "key1", "value"); + assert(s.ok()); + std::string value; + // get value + s = db->Get(ReadOptions(), "key1", &value); + assert(s.ok()); + assert(value == "value"); + + // atomically apply a set of updates + { + WriteBatch batch; + batch.Delete("key1"); + batch.Put("key2", value); + s = db->Write(WriteOptions(), &batch); + } + + s = db->Get(ReadOptions(), "key1", &value); + assert(s.IsNotFound()); + + db->Get(ReadOptions(), "key2", &value); + assert(value == "value"); + + { + PinnableSlice pinnable_val; + db->Get(ReadOptions(), db->DefaultColumnFamily(), "key2", &pinnable_val); + assert(pinnable_val == "value"); + } + + { + std::string string_val; + // If it cannot pin the value, it copies the value to its internal buffer. + // The intenral buffer could be set during construction. + PinnableSlice pinnable_val(&string_val); + db->Get(ReadOptions(), db->DefaultColumnFamily(), "key2", &pinnable_val); + assert(pinnable_val == "value"); + // If the value is not pinned, the internal buffer must have the value. + assert(pinnable_val.IsPinned() || string_val == "value"); + } + + PinnableSlice pinnable_val; + s = db->Get(ReadOptions(), db->DefaultColumnFamily(), "key1", &pinnable_val); + assert(s.IsNotFound()); + // Reset PinnableSlice after each use and before each reuse + pinnable_val.Reset(); + db->Get(ReadOptions(), db->DefaultColumnFamily(), "key2", &pinnable_val); + assert(pinnable_val == "value"); + pinnable_val.Reset(); + // The Slice pointed by pinnable_val is not valid after this point + + delete db; + + return 0; +} diff --git a/recipes/speedb/config.yml b/recipes/speedb/config.yml new file mode 100644 index 0000000000000..64a500c0f05d7 --- /dev/null +++ b/recipes/speedb/config.yml @@ -0,0 +1,3 @@ +versions: + "2.8.0": + folder: all diff --git a/recipes/spirv-cross/all/conandata.yml b/recipes/spirv-cross/all/conandata.yml index 124af978201fc..86077bc0b9022 100644 --- a/recipes/spirv-cross/all/conandata.yml +++ b/recipes/spirv-cross/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.4.309.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.4.309.0.tar.gz" + sha256: "cf4f12a767d63f63024e61750e372ffdc95567513b99ed9be6f21f474b328ddd" + "1.3.296.0": + url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.3.296.0.tar.gz" + sha256: "4f7f9a8a643e6694f155712016b9b572c13a9444e65b3f43b27bb464c0ab76e0" "1.3.268.0": url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" sha256: "dd656a51ba4c229c1a0bb220b7470723e8fd4b68abb7f2cf2ca4027df824f4a0" diff --git a/recipes/spirv-cross/all/test_package/CMakeLists.txt b/recipes/spirv-cross/all/test_package/CMakeLists.txt index a40c4a736880a..c3b57d84cd380 100644 --- a/recipes/spirv-cross/all/test_package/CMakeLists.txt +++ b/recipes/spirv-cross/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) # FIXME: this is not the official way to find spirv-cross components diff --git a/recipes/spirv-cross/all/test_v1_package/CMakeLists.txt b/recipes/spirv-cross/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/spirv-cross/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/spirv-cross/all/test_v1_package/conanfile.py b/recipes/spirv-cross/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/spirv-cross/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_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/spirv-cross/config.yml b/recipes/spirv-cross/config.yml index fee2421b06ee6..659016d6be94d 100644 --- a/recipes/spirv-cross/config.yml +++ b/recipes/spirv-cross/config.yml @@ -1,4 +1,8 @@ versions: + "1.4.309.0": + folder: all + "1.3.296.0": + folder: all "1.3.268.0": folder: all "1.3.261.1": diff --git a/recipes/spirv-headers/all/conandata.yml b/recipes/spirv-headers/all/conandata.yml index 44f2fdcf490ab..a5e19a69bb7ba 100644 --- a/recipes/spirv-headers/all/conandata.yml +++ b/recipes/spirv-headers/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.4.309.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.4.309.0.tar.gz" + sha256: "a96f8b4f2dfb18f7432e5c523e220ab0075372a9509e0c25fbff21c76af0de7c" + "1.3.296.0": + url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.3.296.0.tar.gz" + sha256: "1423d58a1171611d5aba2bf6f8c69c72ef9c38a0aca12c3493e4fda64c9b2dc6" "1.3.268.0": url: "https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" sha256: "1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4" diff --git a/recipes/spirv-headers/all/conanfile.py b/recipes/spirv-headers/all/conanfile.py index 854ef17328263..0d28680817678 100644 --- a/recipes/spirv-headers/all/conanfile.py +++ b/recipes/spirv-headers/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.50.0" @@ -28,6 +29,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["SPIRV_HEADERS_SKIP_EXAMPLES"] = True + if Version(self.version) > "1.3.275.0": + tc.variables["SPIRV_HEADERS_ENABLE_TESTS"] = False tc.generate() def build(self): diff --git a/recipes/spirv-headers/all/test_package/CMakeLists.txt b/recipes/spirv-headers/all/test_package/CMakeLists.txt index a94f6e4aba03d..cc7ffe9db76ec 100644 --- a/recipes/spirv-headers/all/test_package/CMakeLists.txt +++ b/recipes/spirv-headers/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(SPIRV-Headers REQUIRED CONFIG) diff --git a/recipes/spirv-headers/all/test_v1_package/CMakeLists.txt b/recipes/spirv-headers/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/spirv-headers/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/spirv-headers/all/test_v1_package/conanfile.py b/recipes/spirv-headers/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/spirv-headers/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_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/spirv-headers/config.yml b/recipes/spirv-headers/config.yml index f615fa9738359..1f18d827216b2 100644 --- a/recipes/spirv-headers/config.yml +++ b/recipes/spirv-headers/config.yml @@ -1,4 +1,8 @@ versions: + "1.4.309.0": + folder: all + "1.3.296.0": + folder: all "1.3.268.0": folder: all "1.3.261.1": diff --git a/recipes/spirv-tools/all/conandata.yml b/recipes/spirv-tools/all/conandata.yml index aec3e6ece4050..b1565fe066956 100644 --- a/recipes/spirv-tools/all/conandata.yml +++ b/recipes/spirv-tools/all/conandata.yml @@ -1,5 +1,8 @@ # Add only the SDK release versions from https://github.com/KhronosGroup/SPIRV-Tools/tags for consistency sources: + "1.4.309.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.4.309.0.tar.gz" + sha256: "6b8577054c575573ead3ad71cb6a2c0b3397b64c746cc3c99e48cc5e324c1b55" "1.3.268.0": url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" sha256: "4c19fdcffb5fe8ef8dc93d7a65ae78b64edc7a5688893ee381c57f70be77deaf" diff --git a/recipes/spirv-tools/all/conanfile.py b/recipes/spirv-tools/all/conanfile.py index 5530f21ad5289..0046a4040c73f 100644 --- a/recipes/spirv-tools/all/conanfile.py +++ b/recipes/spirv-tools/all/conanfile.py @@ -8,7 +8,7 @@ import os import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class SpirvtoolsConan(ConanFile): @@ -118,6 +118,7 @@ def generate(self): # To install relocatable shared libs on Macos if Version(self.version) < "1.3.239": tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support # For iOS/tvOS/watchOS tc.variables["CMAKE_MACOSX_BUNDLE"] = False @@ -160,39 +161,6 @@ def package(self): rm(self, "*SPIRV-Tools-shared.dll", os.path.join(self.package_folder, "bin")) rm(self, "*SPIRV-Tools-shared*", os.path.join(self.package_folder, "lib")) - # TODO: to remove in conan v2 once cmake_find_package* generators removed - if self.options.shared: - targets = {"SPIRV-Tools-shared": "spirv-tools::SPIRV-Tools"} - else: - targets = { - "SPIRV-Tools": "spirv-tools::SPIRV-Tools", # before 2020.5, kept for conveniency - "SPIRV-Tools-static": "spirv-tools::SPIRV-Tools", - "SPIRV-Tools-opt": "spirv-tools::SPIRV-Tools-opt", - "SPIRV-Tools-link": "spirv-tools::SPIRV-Tools-link", - "SPIRV-Tools-reduce": "spirv-tools::SPIRV-Tools-reduce", - "SPIRV-Tools-lint": "spirv-tools::SPIRV-Tools-lint", - "SPIRV-Tools-diff": "spirv-tools::SPIRV-Tools-diff", - } - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - targets, - ) - - 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", "SPIRV-Tools") self.cpp_info.set_property("pkg_config_name", "SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools") @@ -243,38 +211,5 @@ def package_info(self): self.cpp_info.components["spirv-tools-diff"].libs = ["SPIRV-Tools-diff"] self.cpp_info.components["spirv-tools-diff"].requires = ["spirv-tools-core", "spirv-tools-opt"] - if self.options.build_executables: - self.env_info.path.append(os.path.join(self.package_folder, "bin")) - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.filenames["cmake_find_package"] = "SPIRV-Tools" - self.cpp_info.filenames["cmake_find_package_multi"] = "SPIRV-Tools" - self.cpp_info.names["pkg_config"] = "SPIRV-Tools-shared" if self.options.shared else "SPIRV-Tools" - self.cpp_info.components["spirv-tools-core"].names["cmake_find_package"] = "SPIRV-Tools" - self.cpp_info.components["spirv-tools-core"].names["cmake_find_package_multi"] = "SPIRV-Tools" - self.cpp_info.components["spirv-tools-core"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["spirv-tools-core"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - if not self.options.shared: - self.cpp_info.components["spirv-tools-opt"].names["cmake_find_package"] = "SPIRV-Tools-opt" - self.cpp_info.components["spirv-tools-opt"].names["cmake_find_package_multi"] = "SPIRV-Tools-opt" - self.cpp_info.components["spirv-tools-opt"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["spirv-tools-opt"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - self.cpp_info.components["spirv-tools-link"].names["cmake_find_package"] = "SPIRV-Tools-link" - self.cpp_info.components["spirv-tools-link"].names["cmake_find_package_multi"] = "SPIRV-Tools-link" - self.cpp_info.components["spirv-tools-link"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["spirv-tools-link"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - self.cpp_info.components["spirv-tools-reduce"].names["cmake_find_package"] = "SPIRV-Tools-reduce" - self.cpp_info.components["spirv-tools-reduce"].names["cmake_find_package_multi"] = "SPIRV-Tools-reduce" - self.cpp_info.components["spirv-tools-reduce"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["spirv-tools-reduce"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - self.cpp_info.components["spirv-tools-lint"].names["cmake_find_package"] = "SPIRV-Tools-lint" - self.cpp_info.components["spirv-tools-lint"].names["cmake_find_package_multi"] = "SPIRV-Tools-lint" - self.cpp_info.components["spirv-tools-lint"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["spirv-tools-lint"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - self.cpp_info.components["spirv-tools-diff"].names["cmake_find_package"] = "SPIRV-Tools-diff" - 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/all/test_package/CMakeLists.txt b/recipes/spirv-tools/all/test_package/CMakeLists.txt index 71afec6288abe..8e5e8c8350639 100644 --- a/recipes/spirv-tools/all/test_package/CMakeLists.txt +++ b/recipes/spirv-tools/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package) find_package(SPIRV-Tools REQUIRED CONFIG) diff --git a/recipes/spirv-tools/all/test_v1_package/CMakeLists.txt b/recipes/spirv-tools/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/spirv-tools/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/spirv-tools/all/test_v1_package/conanfile.py b/recipes/spirv-tools/all/test_v1_package/conanfile.py deleted file mode 100644 index 0244d69a545f1..0000000000000 --- a/recipes/spirv-tools/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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_c = os.path.join("bin", "test_package_c") - self.run(bin_path_c, run_environment=True) - if not self.options["spirv-tools"].shared: - bin_path_cpp = os.path.join("bin", "test_package_cpp") - self.run(bin_path_cpp, run_environment=True) diff --git a/recipes/spirv-tools/config.yml b/recipes/spirv-tools/config.yml index 87519b61c9623..9e2f956a6b62e 100644 --- a/recipes/spirv-tools/config.yml +++ b/recipes/spirv-tools/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.309.0": + folder: all "1.3.268.0": folder: all "1.3.261.1": diff --git a/recipes/spix/all/conandata.yml b/recipes/spix/all/conandata.yml index 69403c56106cb..40af11d5a96ee 100644 --- a/recipes/spix/all/conandata.yml +++ b/recipes/spix/all/conandata.yml @@ -8,16 +8,6 @@ sources: "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" - patch_description: "Link to conan libs" - patch_type: "conan" - "0.5": - - 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" + "0.7": + url: "https://github.com/faaxm/spix/archive/refs/tags/v0.7.tar.gz" + sha256: "a5b290d4959d1e57397eb2b03fb8965150cd3f0c18c13933dbbd4f75a09e8437" diff --git a/recipes/spix/all/conanfile.py b/recipes/spix/all/conanfile.py index e4a33c59e2c81..a7b8b05ad6264 100644 --- a/recipes/spix/all/conanfile.py +++ b/recipes/spix/all/conanfile.py @@ -1,6 +1,6 @@ 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.files import 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 @@ -50,9 +50,6 @@ def _compilers_minimum_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 @@ -66,8 +63,8 @@ def layout(self): def requirements(self): self.requires("anyrpc/1.0.2") - self.requires("qt/6.5.3") - + self.requires("qt/6.6.1") + def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._minimum_cpp_standard) @@ -98,9 +95,10 @@ def generate(self): deps.generate() def _patch_sources(self): - apply_conandata_patches(self) + rmdir(self, os.path.join(self.source_folder, "cmake", "modules")) if self.version == "0.4" and Version(self.dependencies["qt"].ref.version).major == 6: - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "set(CMAKE_CXX_STANDARD 14)", "set(CMAKE_CXX_STANDARD 17)") + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD 14)", "set(CMAKE_CXX_STANDARD 17)") def build(self): self._patch_sources() @@ -122,9 +120,9 @@ def package(self): def package_info(self): self.cpp_info.libs = ["Spix"] - self.cpp_info.set_property("cmake_file_name", "Spix") + self.cpp_info.set_property("cmake_file_name", "Spix") self.cpp_info.set_property("cmake_target_name", "Spix::Spix") - + # TODO remove once conan v2 removed cmake_find_package_* self.cpp_info.names["cmake_find_package"] = "Spix" self.cpp_info.names["cmake_find_package_multi"] = "Spix" diff --git a/recipes/spix/all/patches/0001-use-conan-libs-0.4.patch b/recipes/spix/all/patches/0001-use-conan-libs-0.4.patch deleted file mode 100644 index 7d0727e24bbf9..0000000000000 --- a/recipes/spix/all/patches/0001-use-conan-libs-0.4.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- 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 14) - - # Hide symbols unless explicitly flagged with SPIX_EXPORT diff --git a/recipes/spix/all/patches/0001-use-conan-libs-0.5.patch b/recipes/spix/all/patches/0001-use-conan-libs-0.5.patch deleted file mode 100644 index 0746373586081..0000000000000 --- a/recipes/spix/all/patches/0001-use-conan-libs-0.5.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- 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/all/patches/0001-use-conan-libs-0.6.patch b/recipes/spix/all/patches/0001-use-conan-libs-0.6.patch deleted file mode 100644 index 0746373586081..0000000000000 --- a/recipes/spix/all/patches/0001-use-conan-libs-0.6.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- 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/all/test_package/CMakeLists.txt b/recipes/spix/all/test_package/CMakeLists.txt index 8b674ce10f424..fb7f85c481bc4 100644 --- a/recipes/spix/all/test_package/CMakeLists.txt +++ b/recipes/spix/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_spix CXX) diff --git a/recipes/spix/all/test_v1_package/CMakeLists.txt b/recipes/spix/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 8272097b5b3da..0000000000000 --- a/recipes/spix/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -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/spix/all/test_v1_package/conanfile.py b/recipes/spix/all/test_v1_package/conanfile.py deleted file mode 100644 index c71bbcebecf4a..0000000000000 --- a/recipes/spix/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -import os - - -class TestSpixV1Conan(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_spix") - self.run(bin_path, run_environment=True) diff --git a/recipes/spix/config.yml b/recipes/spix/config.yml index 74b40e9de2d7f..39966b3a9945b 100644 --- a/recipes/spix/config.yml +++ b/recipes/spix/config.yml @@ -5,3 +5,5 @@ versions: folder: all "0.6": folder: all + "0.7": + folder: all diff --git a/recipes/splunk-opentelemetry-cpp/all/CMakeLists.txt b/recipes/splunk-opentelemetry-cpp/all/CMakeLists.txt deleted file mode 100644 index c0238c83236f9..0000000000000 --- a/recipes/splunk-opentelemetry-cpp/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.5.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/splunk-opentelemetry-cpp/all/conandata.yml b/recipes/splunk-opentelemetry-cpp/all/conandata.yml index d5ceac8af92c2..abbaf169e8c5c 100644 --- a/recipes/splunk-opentelemetry-cpp/all/conandata.yml +++ b/recipes/splunk-opentelemetry-cpp/all/conandata.yml @@ -2,3 +2,8 @@ sources: 0.4.0: url: "https://github.com/signalfx/splunk-otel-cpp/archive/refs/tags/v0.4.0.tar.gz" sha256: "e44f3167cecfea6d1fb0fa3060cc479a0873ab6d481b9b9f57629cbc7d17bfd4" +patches: + "0.4.0": + - patch_file: "patches/0.4.0-001-fix-cmake.patch" + patch_description: "Make CMakeLists.txt compatible with Conan" + patch_type: "conan" diff --git a/recipes/splunk-opentelemetry-cpp/all/conanfile.py b/recipes/splunk-opentelemetry-cpp/all/conanfile.py index 96d1153587973..45da1f403d709 100644 --- a/recipes/splunk-opentelemetry-cpp/all/conanfile.py +++ b/recipes/splunk-opentelemetry-cpp/all/conanfile.py @@ -1,83 +1,115 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -import glob + +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, export_conandata_patches, apply_conandata_patches +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class SplunkOpentelemetryConan(ConanFile): name = "splunk-opentelemetry-cpp" + description = "Splunk's distribution of OpenTelemetry C++" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/signalfx/splunk-otel-cpp" - description = "Splunk's distribution of OpenTelemetry C++" topics = ("opentelemetry", "observability", "tracing") - 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], + "build_jaeger_exporter": [True, False], } default_options = { - "fPIC": True, "shared": False, + "fPIC": True, + "build_jaeger_exporter": True, } - generators = "cmake", "cmake_find_package_multi" - requires = "opentelemetry-cpp/1.0.1" - exports_sources = "CMakeLists.txt" - short_paths = True - _cmake = None - def validate(self): - if self.settings.arch != "x86_64": - raise ConanInvalidConfiguration("Architecture not supported") + @property + def _min_cppstd(self): + return 14 - def configure(self): - if self.options.shared: - del self.options.fPIC + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "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 - @property - def _source_subfolder(self): - return "source_subfolder" + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") - @property - def _build_subfolder(self): - return "build_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") - def _remove_unnecessary_package_files(self): - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + def requirements(self): + self.requires("opentelemetry-cpp/1.8.3", transitive_headers=True) # v1.12 is not compatible + self.requires("grpc/1.54.3") + self.requires("nlohmann_json/3.11.3") + if self.options.build_jaeger_exporter: + self.requires("thrift/0.17.0") + self.requires("libcurl/[>=7.78.0 <9]") + + def validate(self): + if self.settings.arch != "x86_64": + raise ConanInvalidConfiguration(f"{self.settings.arch} architecture not supported") + if self.options.build_jaeger_exporter and not self.dependencies["opentelemetry-cpp"].options.get_safe("with_jaeger"): + raise ConanInvalidConfiguration("Cannot build Jaeger exporter without with_jaeger=True in opentelemetry-cpp") + + 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], - strip_root=True, - destination=self._source_subfolder - ) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - defs = { - "SPLUNK_CPP_EXAMPLES": False - } - self._cmake.configure(defs=defs, 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["SPLUNK_CPP_TESTS"] = False + tc.variables["SPLUNK_CPP_EXAMPLES"] = False + tc.variables["SPLUNK_CPP_WITH_JAEGER_EXPORTER"] = self.options.build_jaeger_exporter + 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 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() - self._remove_unnecessary_package_files() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "SplunkOpenTelemetry") + self.cpp_info.set_property("cmake_target_name", "SplunkOpenTelemetry::SplunkOpenTelemetry") + self.cpp_info.libs = ["SplunkOpenTelemetry"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "SplunkOpenTelemetry" self.cpp_info.names["cmake_find_package_multi"] = "SplunkOpenTelemetry" - self.cpp_info.libs = ["SplunkOpenTelemetry"] diff --git a/recipes/splunk-opentelemetry-cpp/all/patches/0.4.0-001-fix-cmake.patch b/recipes/splunk-opentelemetry-cpp/all/patches/0.4.0-001-fix-cmake.patch new file mode 100644 index 0000000000000..c4db3358cce46 --- /dev/null +++ b/recipes/splunk-opentelemetry-cpp/all/patches/0.4.0-001-fix-cmake.patch @@ -0,0 +1,26 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.5.1) ++cmake_minimum_required(VERSION 3.15) + + project(SplunkOpenTelemetry CXX) + +@@ -6,8 +6,6 @@ + include(GenerateExportHeader) + + set(PACKAGE_VERSION "0.1.0") +- +-set(CMAKE_CXX_STANDARD 11) + + option(SPLUNK_CPP_TESTS "Enable building of tests" OFF) + option(SPLUNK_CPP_EXAMPLES "Enable building of examples" ON) +@@ -36,7 +34,7 @@ + + target_link_libraries(SplunkOpenTelemetry + PUBLIC +- ${OPENTELEMETRY_CPP_LIBRARIES} ++ opentelemetry-cpp::opentelemetry-cpp + gRPC::grpc++ + protobuf::libprotobuf + ${SPLUNK_CPP_JAEGER_EXPORTER_LIBS} diff --git a/recipes/splunk-opentelemetry-cpp/all/test_package/CMakeLists.txt b/recipes/splunk-opentelemetry-cpp/all/test_package/CMakeLists.txt index 66cd3ac3bbc17..a7bd5843a1ba9 100644 --- a/recipes/splunk-opentelemetry-cpp/all/test_package/CMakeLists.txt +++ b/recipes/splunk-opentelemetry-cpp/all/test_package/CMakeLists.txt @@ -1,13 +1,8 @@ -cmake_minimum_required(VERSION 3.12) - +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -set(CMAKE_CXX_STANDARD 11) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) find_package(SplunkOpenTelemetry CONFIG REQUIRED) add_executable(test_package test_package.cpp) - target_link_libraries(test_package SplunkOpenTelemetry::SplunkOpenTelemetry) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/splunk-opentelemetry-cpp/all/test_package/conanfile.py b/recipes/splunk-opentelemetry-cpp/all/test_package/conanfile.py index 49a3a66ea5bad..ef5d7042163ec 100644 --- a/recipes/splunk-opentelemetry-cpp/all/test_package/conanfile.py +++ b/recipes/splunk-opentelemetry-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", "VirtualRunEnv" + 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/splunk-opentelemetry-cpp/all/test_package/test_package.cpp b/recipes/splunk-opentelemetry-cpp/all/test_package/test_package.cpp index c32b8e88e812f..5b8740706dcc0 100644 --- a/recipes/splunk-opentelemetry-cpp/all/test_package/test_package.cpp +++ b/recipes/splunk-opentelemetry-cpp/all/test_package/test_package.cpp @@ -1,22 +1,8 @@ -#include #include -#include - -int main(int argc, char** argv) { +int main() { splunk::OpenTelemetryOptions otelOptions = splunk::OpenTelemetryOptions() .WithServiceName("my-service") .WithServiceVersion("1.0") - .WithExporter(splunk::ExporterType_JaegerThriftHttp) .WithDeploymentEnvironment("test"); - auto provider = splunk::InitOpentelemetry(otelOptions); - auto span = opentelemetry::trace::Tracer::GetCurrentSpan(); - - char traceId[32] = {0}; - char spanId[16] = {0}; - span->GetContext().trace_id().ToLowerBase16(traceId); - span->GetContext().span_id().ToLowerBase16(spanId); - printf("current span: %.*s:%.*s\n", 32, traceId, 16, spanId); - - return 0; } diff --git a/recipes/spscqueue/all/test_package/CMakeLists.txt b/recipes/spscqueue/all/test_package/CMakeLists.txt index 8b3a38c02a2e2..f4a791ecc1f55 100644 --- a/recipes/spscqueue/all/test_package/CMakeLists.txt +++ b/recipes/spscqueue/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(SPSCQueue REQUIRED CONFIG) diff --git a/recipes/spscqueue/all/test_v1_package/CMakeLists.txt b/recipes/spscqueue/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index d44850ff451c0..0000000000000 --- a/recipes/spscqueue/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(SPSCQueue REQUIRED CONFIG) -find_package(Threads REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE SPSCQueue::SPSCQueue Threads::Threads) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/spscqueue/all/test_v1_package/conanfile.py b/recipes/spscqueue/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/spscqueue/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_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/spy/all/conandata.yml b/recipes/spy/all/conandata.yml index a03c066af9192..a6f3a70ed4537 100644 --- a/recipes/spy/all/conandata.yml +++ b/recipes/spy/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + url: "https://github.com/jfalcou/spy/archive/1.1.0.tar.gz" + sha256: "35e15dfe7bebcb03fb28c249d2c2c4ed302dadafbfd5f81e71c31b95d1e3b2dd" "1.0.0": url: "https://github.com/jfalcou/spy/archive/1.0.0.tar.gz" sha256: "ae2f508460b3b21436a652e281e1cf44370da5871a9d13086daa04a9e2bd7d1b" diff --git a/recipes/spy/all/conanfile.py b/recipes/spy/all/conanfile.py index 4e3adabd43a05..5d68cfa807921 100644 --- a/recipes/spy/all/conanfile.py +++ b/recipes/spy/all/conanfile.py @@ -10,11 +10,12 @@ class SpyConan(ConanFile): name = "spy" + description = "C++ 17 for constexpr-proof detection and classification of informations about OS, compiler, etc..." license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://jfalcou.github.io/spy/" - description = "C++ 17 for constexpr-proof detection and classification of informations about OS, compiler, etc..." - topics = ("c++17", "config", "metaprogramming") + topics = ("config", "metaprogramming", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -27,6 +28,7 @@ def _compilers_minimum_version(self): return { "gcc": "7.4", "Visual Studio": "15.7", + "msvc": "191", "clang": "6", "apple-clang": "10", } @@ -54,11 +56,7 @@ 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) - - def build(self): - pass + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) @@ -66,6 +64,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/spy/all/test_package/CMakeLists.txt b/recipes/spy/all/test_package/CMakeLists.txt index caa8001d48046..eaf6d8616b96d 100644 --- a/recipes/spy/all/test_package/CMakeLists.txt +++ b/recipes/spy/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(spy REQUIRED CONFIG) diff --git a/recipes/spy/all/test_package/conanfile.py b/recipes/spy/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/spy/all/test_package/conanfile.py +++ b/recipes/spy/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/spy/all/test_v1_package/CMakeLists.txt b/recipes/spy/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 4d114077005dc..0000000000000 --- a/recipes/spy/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(spy REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE spy::spy) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/spy/all/test_v1_package/conanfile.py b/recipes/spy/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/spy/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_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/spy/config.yml b/recipes/spy/config.yml index 1d92b70b7b274..cab874d2d97fa 100644 --- a/recipes/spy/config.yml +++ b/recipes/spy/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.0": + folder: all "1.0.0": folder: all "0.0.4": diff --git a/recipes/sqlcipher/all/conandata.yml b/recipes/sqlcipher/all/conandata.yml index a6f870e23b894..2c6b576f28dce 100644 --- a/recipes/sqlcipher/all/conandata.yml +++ b/recipes/sqlcipher/all/conandata.yml @@ -1,44 +1,23 @@ sources: - "4.5.1": - url: "https://github.com/sqlcipher/sqlcipher/archive/v4.5.1.zip" - sha256: "08a1024b299b5527d5b5ed79f67957938b516567f68662e973c4bec1b843b28e" - "4.5.0": - url: "https://github.com/sqlcipher/sqlcipher/archive/v4.5.0.zip" - sha256: "ce754d1fc1f55c7b39bdab28ee0e4a5c1e286254e2fbbab43e2c8135e5e6ab49" + "4.6.1": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.6.1.zip" + sha256: "93a7475183d47e2d33f85aefa7518e8730796f103612d36ae191ae56209104e0" + "4.5.7": + url: "https://github.com/sqlcipher/sqlcipher/archive/v4.5.7.zip" + sha256: "4f7e00e4b485d162d638094daba354d04aabb0ca68b72cc1826f082b40c9fd7d" "4.4.3": url: "https://github.com/sqlcipher/sqlcipher/archive/v4.4.3.zip" sha256: "e52d0595dc1ed30eed68523fe286d38657bd905957447a3725706ff54e21edf8" - "4.4.2": - url: "https://github.com/sqlcipher/sqlcipher/archive/v4.4.2.zip" - sha256: "6bb5c154ef979ddd28f4668846f394ae2ccbf6cece09a9148b73fadf8adc7b55" - "4.4.0": - url: "https://github.com/sqlcipher/sqlcipher/archive/v4.4.0.zip" - sha256: "99b6324c2af52d6483d3ff8de84c81bb3a9676429fc700cb55cdb07787d3c0fa" - "4.3.0": - url: "https://github.com/sqlcipher/sqlcipher/archive/v4.3.0.zip" - sha256: "41e1408465488e9c478ca5b7c5f8410405a10caa73b82db60ac115a76c563c05" patches: - "4.5.1": - - patch_file: patches/Makefile.in-v4.5.1.patch - - patch_file: patches/Makefile.msc-v4.5.1.patch - - patch_file: patches/fix_configure-v4.5.1.patch - "4.5.0": - - patch_file: patches/Makefile.in-v4.5.0.patch - - patch_file: patches/Makefile.msc-v4.5.0.patch - - patch_file: patches/fix_configure-v4.5.0.patch + "4.6.1": + - patch_file: patches/Makefile.in-v4.6.1.patch + - patch_file: patches/Makefile.msc-v4.6.1.patch + - patch_file: patches/fix_configure-v4.5.7.patch + "4.5.7": + - patch_file: patches/Makefile.in-v4.5.7.patch + - patch_file: patches/Makefile.msc-v4.5.7.patch + - patch_file: patches/fix_configure-v4.5.7.patch "4.4.3": - patch_file: patches/Makefile.in-v4.4.3.patch - patch_file: patches/Makefile.msc-v4.4.3.patch - patch_file: patches/fix_configure-v4.4.3.patch - "4.4.2": - - patch_file: patches/Makefile.in-v4.4.2.patch - - patch_file: patches/Makefile.msc-v4.4.2.patch - - patch_file: patches/fix_configure-v4.4.2.patch - "4.4.0": - - patch_file: patches/Makefile.in-v4.4.0.patch - - patch_file: patches/Makefile.msc-v4.4.0.patch - - patch_file: patches/fix_configure-v4.4.0.patch - "4.3.0": - - patch_file: patches/Makefile.in-v4.3.0.patch - - patch_file: patches/Makefile.msc-v4.3.0.patch - - patch_file: patches/fix_configure-v4.3.0.patch diff --git a/recipes/sqlcipher/all/conanfile.py b/recipes/sqlcipher/all/conanfile.py index d61f784a9ae42..b793f70248d53 100644 --- a/recipes/sqlcipher/all/conanfile.py +++ b/recipes/sqlcipher/all/conanfile.py @@ -20,7 +20,7 @@ class SqlcipherConan(ConanFile): license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.zetetic.net/sqlcipher/" - topics = ("database", "encryption", "SQLite") + topics = ("database", "encryption", "sqlite") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -30,6 +30,7 @@ class SqlcipherConan(ConanFile): "crypto_library": ["openssl", "libressl", "commoncrypto"], "with_largefile": [True, False], "temporary_store": ["always_file", "default_file", "default_memory", "always_memory"], + "enable_column_metadata": [True, False], } default_options = { "shared": False, @@ -37,6 +38,7 @@ class SqlcipherConan(ConanFile): "crypto_library": "openssl", "with_largefile": True, "temporary_store": "default_memory", + "enable_column_metadata": False, } @property @@ -114,7 +116,10 @@ def _generate_msvc(self): 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") + opt_feature_flags = "-DSQLCIPHER_CRYPTO_OPENSSL" + if self.options.enable_column_metadata: + opt_feature_flags += " -DSQLITE_ENABLE_COLUMN_METADATA" + env.define("OPT_FEATURE_FLAGS", opt_feature_flags) env.define("SQLITE_TEMP_STORE", self._temp_store_nmake_value) env.define("TCLSH_CMD", self.dependencies.build['tcl'].runenv_info.vars(self)['TCLSH']) @@ -169,6 +174,9 @@ def _generate_unix(self): tc.configure_args.append("--with-crypto-lib=commoncrypto") else: tc.extra_defines.append("SQLCIPHER_CRYPTO_OPENSSL") + + if self.options.enable_column_metadata: + tc.extra_defines.append("SQLITE_ENABLE_COLUMN_METADATA=1") tc.generate() deps = AutotoolsDeps(self) @@ -221,7 +229,7 @@ def build(self): autotools.make() def package(self): - copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) 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) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.3.0.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.3.0.patch deleted file mode 100644 index bcbdb0576a7ab..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.in-v4.3.0.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index a8eeae2..3af2a2c 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -647,7 +647,7 @@ DBFUZZ_OPT = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --all: sqlite3.h libsqlcipher.la sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) -+all: sqlite3.h libsqlcipher.la - - Makefile: $(TOP)/Makefile.in - ./config.status -@@ -1449,9 +1449,8 @@ lib_install: libsqlcipher.la - $(INSTALL) -d $(DESTDIR)$(libdir) - $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir) - --install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install} -+install: lib_install sqlite3.h sqlcipher.pc - $(INSTALL) -d $(DESTDIR)$(bindir) -- $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir) - $(INSTALL) -d $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.4.0.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.4.0.patch deleted file mode 100644 index 53552fe2b59b4..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.in-v4.4.0.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index d8f5a62..57b54d5 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -647,7 +647,7 @@ DBFUZZ_OPT = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --all: sqlite3.h libsqlcipher.la sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) -+all: sqlite3.h libsqlcipher.la - - Makefile: $(TOP)/Makefile.in - ./config.status -@@ -1445,9 +1445,8 @@ lib_install: libsqlcipher.la - $(INSTALL) -d $(DESTDIR)$(libdir) - $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir) - --install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install} -+install: lib_install sqlite3.h sqlcipher.pc - $(INSTALL) -d $(DESTDIR)$(bindir) -- $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir) - $(INSTALL) -d $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.4.2.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.4.2.patch deleted file mode 100644 index 122925179901b..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.in-v4.4.2.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index 3f810ab..e4c70c1 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -654,7 +654,7 @@ DBFUZZ_OPT = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --all: sqlite3.h libsqlcipher.la sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) -+all: sqlite3.h libsqlcipher.la - - Makefile: $(TOP)/Makefile.in - ./config.status -@@ -1469,9 +1469,8 @@ lib_install: libsqlcipher.la - $(INSTALL) -d $(DESTDIR)$(libdir) - $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir) - --install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install} -+install: lib_install sqlite3.h sqlcipher.pc - $(INSTALL) -d $(DESTDIR)$(bindir) -- $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir) - $(INSTALL) -d $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.5.0.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.0.patch deleted file mode 100644 index 798675993e00c..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.in-v4.5.0.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index 77c190a..2744de2 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -655,7 +655,7 @@ DBFUZZ_OPT = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --all: sqlite3.h libsqlcipher.la sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) -+all: sqlite3.h libsqlcipher.la - - Makefile: $(TOP)/Makefile.in - ./config.status -@@ -1477,9 +1477,8 @@ lib_install: libsqlcipher.la - $(INSTALL) -d $(DESTDIR)$(libdir) - $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir) - --install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install} -+install: lib_install sqlite3.h sqlcipher.pc - $(INSTALL) -d $(DESTDIR)$(bindir) -- $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir) - $(INSTALL) -d $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.5.1.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.1.patch deleted file mode 100644 index 9c39625141986..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.in-v4.5.1.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index ad4be7b..3304cc8 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -657,7 +657,7 @@ DBFUZZ_OPT = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --all: sqlite3.h libsqlcipher.la sqlcipher$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) -+all: sqlite3.h libsqlcipher.la - - Makefile: $(TOP)/Makefile.in - ./config.status -@@ -1482,9 +1482,8 @@ lib_install: libsqlcipher.la - $(INSTALL) -d $(DESTDIR)$(libdir) - $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir) - --install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install} -+install: lib_install sqlite3.h sqlcipher.pc - $(INSTALL) -d $(DESTDIR)$(bindir) -- $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir) - $(INSTALL) -d $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) - $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.5.7.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.7.patch new file mode 100644 index 0000000000000..8c0ff8f52c2da --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.in-v4.5.7.patch @@ -0,0 +1,25 @@ +diff --git a/Makefile.in b/Makefile.in +index ce2617c..77242fc 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -677,8 +677,7 @@ SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@) + # This is the default Makefile target. The objects listed here + # are what get build when you type just "make" with no arguments. + # +-all: sqlite3.h libsqlcipher.la $(SQLITE3_SHELL_TARGET) \ +- $(HAVE_TCL:1=libtclsqlite3.la) ++all: sqlite3.h libsqlcipher.la + + Makefile: $(TOP)/Makefile.in + ./config.status +@@ -1579,9 +1578,8 @@ lib_install: libsqlcipher.la + $(INSTALL) -d $(DESTDIR)$(libdir) + $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir) + +-install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install} ++install: lib_install sqlite3.h sqlcipher.pc + $(INSTALL) -d $(DESTDIR)$(bindir) +- $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir) + $(INSTALL) -d $(DESTDIR)$(includedir) + $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) + $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) diff --git a/recipes/sqlcipher/all/patches/Makefile.in-v4.6.1.patch b/recipes/sqlcipher/all/patches/Makefile.in-v4.6.1.patch new file mode 100644 index 0000000000000..318c717c81e5a --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.in-v4.6.1.patch @@ -0,0 +1,27 @@ +diff --git a/Makefile.in b/Makefile.in +index 8431c25..2c1d4fd 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -676,8 +676,8 @@ SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@) + # This is the default Makefile target. The objects listed here + # are what get build when you type just "make" with no arguments. + # +-all: sqlite3.h libsqlcipher.la $(SQLITE3_SHELL_TARGET) \ +- $(HAVE_TCL:1=libtclsqlite3.la) ++all: sqlite3.h libsqlcipher.la ++ + + Makefile: $(TOP)/Makefile.in + ./config.status +@@ -1578,9 +1578,9 @@ lib_install: libsqlcipher.la + $(INSTALL) -d $(DESTDIR)$(libdir) + $(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir) + +-install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install} ++install: lib_install sqlite3.h sqlcipher.pc + $(INSTALL) -d $(DESTDIR)$(bindir) +- $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir) ++# $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir) + $(INSTALL) -d $(DESTDIR)$(includedir) + $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) + $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) diff --git a/recipes/sqlcipher/all/patches/Makefile.msc-v4.3.0.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.3.0.patch deleted file mode 100644 index 9979f61586fe4..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.msc-v4.3.0.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff --git a/Makefile.msc b/Makefile.msc -index 9baa035..88d21e4 100644 ---- a/Makefile.msc -+++ b/Makefile.msc -@@ -270,9 +270,9 @@ SQLITE3H = sqlite3.h - # - !IFNDEF SQLITE3DLL - !IF $(FOR_WIN10)!=0 --SQLITE3DLL = winsqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ELSE --SQLITE3DLL = sqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ENDIF - !ENDIF - -@@ -280,9 +280,9 @@ SQLITE3DLL = sqlite3.dll - # - !IFNDEF SQLITE3LIB - !IF $(FOR_WIN10)!=0 --SQLITE3LIB = winsqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ELSE --SQLITE3LIB = sqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ENDIF - !ENDIF - -@@ -649,7 +649,7 @@ SHELL_CORE_SRC = $(SQLITE3C) - SHELL_CORE_DEP = $(SQLITE3DLL) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_DEP = libsqlite3.lib -+SHELL_CORE_DEP = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_DEP = -@@ -672,7 +672,7 @@ TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP) - SHELL_CORE_LIB = $(SQLITE3LIB) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_LIB = libsqlite3.lib -+SHELL_CORE_LIB = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_LIB = -@@ -707,8 +707,9 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP - # C compiler options for the Windows 10 platform (needs MSVC 2015). - # - !IF $(FOR_WIN10)!=0 --TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE --BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+# /d2guard4 requires /guard:cf to be present as well, but it doesn't work with /Zi (Debug builds) -+TCC = $(TCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+BCC = $(BCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE - !ENDIF - - # Also, we need to dynamically link to the correct MSVC runtime -@@ -985,8 +986,10 @@ TLIBS = - # default to file, 2 to default to memory, and 3 to force temporary - # tables to always be in memory. - # --TCC = $(TCC) -DSQLITE_TEMP_STORE=1 --RCC = $(RCC) -DSQLITE_TEMP_STORE=1 -+ -+# Allow overriding the value -+TCC = $(TCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) -+RCC = $(RCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) - - # Enable/disable loadable extensions, and other optional features - # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). -@@ -1152,14 +1155,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" - !ENDIF - LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib --LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL - !ENDIF - - # When compiling for UWP or the Windows 10 platform, some extra linker - # options are also required. - # - !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 --LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL -+LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) mincore.lib - !IFDEF PSDKLIBPATH - LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" -@@ -1214,7 +1218,7 @@ LTLIBS = $(LTLIBS) $(LIBICU) - # - LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \ - backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ -- callback.lo complete.lo ctime.lo \ -+ callback.lo complete.lo crypto.lo crypto_impl.lo crypto_openssl.lo ctime.lo \ - date.lo dbpage.lo dbstat.lo delete.lo \ - expr.lo fault.lo fkey.lo \ - fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \ -@@ -1702,7 +1706,7 @@ ALL_TCL_TARGETS = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --core: dll libsqlite3.lib shell -+core: dll sqlcipher.lib shell - - # Targets that require the Tcl library. - # -@@ -1721,11 +1725,12 @@ dll: $(SQLITE3DLL) - shell: $(SQLITE3EXE) - - # <> --libsqlite3.lib: $(LIBOBJ) -- $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) -+# LTLIBPATHS is required to find the openssl/libressl libs -+sqlcipher.lib: $(LIBOBJ) -+ $(LTLIB) $(LTLIBPATHS) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) - --libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib -- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) -+libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib -+ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) - - tclsqlite3.def: tclsqlite.lo - echo EXPORTS > tclsqlite3.def -@@ -1747,9 +1752,9 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) - $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) - - # <> --sqlite3.def: libsqlite3.lib -+sqlite3.def: sqlcipher.lib - echo EXPORTS > sqlite3.def -- dumpbin /all libsqlite3.lib \ -+ dumpbin /all sqlcipher.lib \ - | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@]*)(?:@\d+)?$$" \1 \ - | sort >> sqlite3.def - # <> -@@ -1927,6 +1932,15 @@ callback.lo: $(TOP)\src\callback.c $(HDR) - complete.lo: $(TOP)\src\complete.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c - -+crypto.lo: $(TOP)\src\crypto.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto.c -+ -+crypto_impl.lo: $(TOP)\src\crypto_impl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_impl.c -+ -+crypto_openssl.lo: $(TOP)\src\crypto_openssl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_openssl.c -+ - ctime.lo: $(TOP)\src\ctime.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c - -@@ -2336,7 +2350,7 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR) - # Rules to build the 'testfixture' application. - # - # If using the amalgamation, use sqlite3.c directly to build the test --# fixture. Otherwise link against libsqlite3.lib. (This distinction is -+# fixture. Otherwise link against sqlcipher.lib. (This distinction is - # necessary because the test fixture requires non-API symbols which are - # hidden when the library is built via the amalgamation). - # diff --git a/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.0.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.0.patch deleted file mode 100644 index 1c68b8dd21ed3..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.0.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff --git a/Makefile.msc b/Makefile.msc -index d59ca46..925061e 100644 ---- a/Makefile.msc -+++ b/Makefile.msc -@@ -276,9 +276,9 @@ SQLITE3H = sqlite3.h - # - !IFNDEF SQLITE3DLL - !IF $(FOR_WIN10)!=0 --SQLITE3DLL = winsqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ELSE --SQLITE3DLL = sqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ENDIF - !ENDIF - -@@ -286,9 +286,9 @@ SQLITE3DLL = sqlite3.dll - # - !IFNDEF SQLITE3LIB - !IF $(FOR_WIN10)!=0 --SQLITE3LIB = winsqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ELSE --SQLITE3LIB = sqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ENDIF - !ENDIF - -@@ -662,7 +662,7 @@ SHELL_CORE_SRC = $(SQLITE3C) - SHELL_CORE_DEP = $(SQLITE3DLL) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_DEP = libsqlite3.lib -+SHELL_CORE_DEP = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_DEP = -@@ -685,7 +685,7 @@ TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP) - SHELL_CORE_LIB = $(SQLITE3LIB) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_LIB = libsqlite3.lib -+SHELL_CORE_LIB = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_LIB = -@@ -720,8 +720,9 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP - # C compiler options for the Windows 10 platform (needs MSVC 2015). - # - !IF $(FOR_WIN10)!=0 --TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE --BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+# /d2guard4 requires /guard:cf to be present as well, but it doesn't work with /Zi (Debug builds) -+TCC = $(TCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+BCC = $(BCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE - !ENDIF - - # Also, we need to dynamically link to the correct MSVC runtime -@@ -998,8 +999,10 @@ TLIBS = - # default to file, 2 to default to memory, and 3 to force temporary - # tables to always be in memory. - # --TCC = $(TCC) -DSQLITE_TEMP_STORE=1 --RCC = $(RCC) -DSQLITE_TEMP_STORE=1 -+ -+# Allow overriding the value -+TCC = $(TCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) -+RCC = $(RCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) - - # Enable/disable loadable extensions, and other optional features - # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). -@@ -1165,14 +1168,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" - !ENDIF - LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib --LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL - !ENDIF - - # When compiling for UWP or the Windows 10 platform, some extra linker - # options are also required. - # - !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 --LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL -+LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) mincore.lib - !IFDEF PSDKLIBPATH - LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" -@@ -1227,7 +1231,7 @@ LTLIBS = $(LTLIBS) $(LIBICU) - # - LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \ - backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ -- callback.lo complete.lo ctime.lo \ -+ callback.lo complete.lo crypto.lo crypto_impl.lo crypto_openssl.lo ctime.lo \ - date.lo dbpage.lo dbstat.lo delete.lo \ - expr.lo fault.lo fkey.lo \ - fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \ -@@ -1715,7 +1719,7 @@ ALL_TCL_TARGETS = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --core: dll libsqlite3.lib shell -+core: dll sqlcipher.lib shell - - # Targets that require the Tcl library. - # -@@ -1734,11 +1738,12 @@ dll: $(SQLITE3DLL) - shell: $(SQLITE3EXE) - - # <> --libsqlite3.lib: $(LIBOBJ) -- $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) -+# LTLIBPATHS is required to find the openssl/libressl libs -+sqlcipher.lib: $(LIBOBJ) -+ $(LTLIB) $(LTLIBPATHS) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) - --libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib -- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) -+libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib -+ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) - - tclsqlite3.def: tclsqlite.lo - echo EXPORTS > tclsqlite3.def -@@ -1760,9 +1765,9 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) - $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) - - # <> --sqlite3.def: libsqlite3.lib -+sqlite3.def: sqlcipher.lib - echo EXPORTS > sqlite3.def -- dumpbin /all libsqlite3.lib \ -+ dumpbin /all sqlcipher.lib \ - | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \ - | sort >> sqlite3.def - # <> -@@ -1940,6 +1945,15 @@ callback.lo: $(TOP)\src\callback.c $(HDR) - complete.lo: $(TOP)\src\complete.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c - -+crypto.lo: $(TOP)\src\crypto.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto.c -+ -+crypto_impl.lo: $(TOP)\src\crypto_impl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_impl.c -+ -+crypto_openssl.lo: $(TOP)\src\crypto_openssl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_openssl.c -+ - ctime.lo: $(TOP)\src\ctime.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c - -@@ -2349,7 +2363,7 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR) - # Rules to build the 'testfixture' application. - # - # If using the amalgamation, use sqlite3.c directly to build the test --# fixture. Otherwise link against libsqlite3.lib. (This distinction is -+# fixture. Otherwise link against sqlcipher.lib. (This distinction is - # necessary because the test fixture requires non-API symbols which are - # hidden when the library is built via the amalgamation). - # diff --git a/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.2.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.2.patch deleted file mode 100644 index d765cd3530816..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.msc-v4.4.2.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff --git a/Makefile.msc b/Makefile.msc -index 2261ee9..0e3e710 100644 ---- a/Makefile.msc -+++ b/Makefile.msc -@@ -285,9 +285,9 @@ SQLITE3H = sqlite3.h - # - !IFNDEF SQLITE3DLL - !IF $(FOR_WIN10)!=0 --SQLITE3DLL = winsqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ELSE --SQLITE3DLL = sqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ENDIF - !ENDIF - -@@ -295,9 +295,9 @@ SQLITE3DLL = sqlite3.dll - # - !IFNDEF SQLITE3LIB - !IF $(FOR_WIN10)!=0 --SQLITE3LIB = winsqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ELSE --SQLITE3LIB = sqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ENDIF - !ENDIF - -@@ -672,7 +672,7 @@ SHELL_CORE_SRC = $(SQLITE3C) - SHELL_CORE_DEP = $(SQLITE3DLL) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_DEP = libsqlite3.lib -+SHELL_CORE_DEP = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_DEP = -@@ -695,7 +695,7 @@ TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP) - SHELL_CORE_LIB = $(SQLITE3LIB) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_LIB = libsqlite3.lib -+SHELL_CORE_LIB = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_LIB = -@@ -730,8 +730,9 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP - # C compiler options for the Windows 10 platform (needs MSVC 2015). - # - !IF $(FOR_WIN10)!=0 --TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE --BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+# /d2guard4 requires /guard:cf to be present as well, but it doesn't work with /Zi (Debug builds) -+TCC = $(TCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+BCC = $(BCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE - !ENDIF - - # Also, we need to dynamically link to the correct MSVC runtime -@@ -1008,8 +1009,10 @@ TLIBS = - # default to file, 2 to default to memory, and 3 to force temporary - # tables to always be in memory. - # --TCC = $(TCC) -DSQLITE_TEMP_STORE=1 --RCC = $(RCC) -DSQLITE_TEMP_STORE=1 -+ -+# Allow overriding the value -+TCC = $(TCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) -+RCC = $(RCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) - - # Enable/disable loadable extensions, and other optional features - # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). -@@ -1175,14 +1178,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" - !ENDIF - LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib --LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL - !ENDIF - - # When compiling for UWP or the Windows 10 platform, some extra linker - # options are also required. - # - !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 --LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL -+LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) mincore.lib - !IFDEF PSDKLIBPATH - LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" -@@ -1237,7 +1241,7 @@ LTLIBS = $(LTLIBS) $(LIBICU) - # - LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \ - backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ -- callback.lo complete.lo ctime.lo \ -+ callback.lo complete.lo crypto.lo crypto_impl.lo crypto_openssl.lo ctime.lo \ - date.lo dbpage.lo dbstat.lo delete.lo \ - expr.lo fault.lo fkey.lo \ - fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \ -@@ -1729,7 +1733,7 @@ ALL_TCL_TARGETS = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --core: dll libsqlite3.lib shell -+core: dll sqlcipher.lib shell - - # Targets that require the Tcl library. - # -@@ -1748,11 +1752,12 @@ dll: $(SQLITE3DLL) - shell: $(SQLITE3EXE) - - # <> --libsqlite3.lib: $(LIBOBJ) -- $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) -+# LTLIBPATHS is required to find the openssl/libressl libs -+sqlcipher.lib: $(LIBOBJ) -+ $(LTLIB) $(LTLIBPATHS) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) - --libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib -- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) -+libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib -+ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) - - tclsqlite3.def: tclsqlite.lo - echo EXPORTS > tclsqlite3.def -@@ -1774,9 +1779,9 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) - $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) - - # <> --sqlite3.def: libsqlite3.lib -+sqlite3.def: sqlcipher.lib - echo EXPORTS > sqlite3.def -- dumpbin /all libsqlite3.lib \ -+ dumpbin /all sqlcipher.lib \ - | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \ - | sort >> sqlite3.def - # <> -@@ -1956,6 +1961,15 @@ callback.lo: $(TOP)\src\callback.c $(HDR) - complete.lo: $(TOP)\src\complete.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c - -+crypto.lo: $(TOP)\src\crypto.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto.c -+ -+crypto_impl.lo: $(TOP)\src\crypto_impl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_impl.c -+ -+crypto_openssl.lo: $(TOP)\src\crypto_openssl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_openssl.c -+ - ctime.lo: $(TOP)\src\ctime.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c - -@@ -2380,7 +2394,7 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR) - # Rules to build the 'testfixture' application. - # - # If using the amalgamation, use sqlite3.c directly to build the test --# fixture. Otherwise link against libsqlite3.lib. (This distinction is -+# fixture. Otherwise link against sqlcipher.lib. (This distinction is - # necessary because the test fixture requires non-API symbols which are - # hidden when the library is built via the amalgamation). - # diff --git a/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.0.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.0.patch deleted file mode 100644 index 4e15846c5b1bd..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.0.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff --git a/Makefile.msc b/Makefile.msc -index 5e95d84..42d9c69 100644 ---- a/Makefile.msc -+++ b/Makefile.msc -@@ -285,9 +285,9 @@ SQLITE3H = sqlite3.h - # - !IFNDEF SQLITE3DLL - !IF $(FOR_WIN10)!=0 --SQLITE3DLL = winsqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ELSE --SQLITE3DLL = sqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ENDIF - !ENDIF - -@@ -295,9 +295,9 @@ SQLITE3DLL = sqlite3.dll - # - !IFNDEF SQLITE3LIB - !IF $(FOR_WIN10)!=0 --SQLITE3LIB = winsqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ELSE --SQLITE3LIB = sqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ENDIF - !ENDIF - -@@ -674,7 +674,7 @@ SHELL_CORE_SRC = $(SQLITE3C) - SHELL_CORE_DEP = $(SQLITE3DLL) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_DEP = libsqlite3.lib -+SHELL_CORE_DEP = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_DEP = -@@ -697,7 +697,7 @@ TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP) - SHELL_CORE_LIB = $(SQLITE3LIB) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_LIB = libsqlite3.lib -+SHELL_CORE_LIB = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_LIB = -@@ -732,8 +732,9 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP - # C compiler options for the Windows 10 platform (needs MSVC 2015). - # - !IF $(FOR_WIN10)!=0 --TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE --BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+# /d2guard4 requires /guard:cf to be present as well, but it doesn't work with /Zi (Debug builds) -+TCC = $(TCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+BCC = $(BCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE - !ENDIF - - # Also, we need to dynamically link to the correct MSVC runtime -@@ -1010,8 +1011,10 @@ TLIBS = - # default to file, 2 to default to memory, and 3 to force temporary - # tables to always be in memory. - # --TCC = $(TCC) -DSQLITE_TEMP_STORE=1 --RCC = $(RCC) -DSQLITE_TEMP_STORE=1 -+ -+# Allow overriding the value -+TCC = $(TCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) -+RCC = $(RCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) - - # Enable/disable loadable extensions, and other optional features - # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). -@@ -1177,14 +1180,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" - !ENDIF - LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib --LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL - !ENDIF - - # When compiling for UWP or the Windows 10 platform, some extra linker - # options are also required. - # - !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 --LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL -+LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) mincore.lib - !IFDEF PSDKLIBPATH - LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" -@@ -1239,7 +1243,7 @@ LTLIBS = $(LTLIBS) $(LIBICU) - # - LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \ - backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ -- callback.lo complete.lo ctime.lo \ -+ callback.lo complete.lo crypto.lo crypto_impl.lo crypto_openssl.lo ctime.lo \ - date.lo dbpage.lo dbstat.lo delete.lo \ - expr.lo fault.lo fkey.lo \ - fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \ -@@ -1732,7 +1736,7 @@ ALL_TCL_TARGETS = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --core: dll libsqlite3.lib shell -+core: dll sqlcipher.lib shell - - # Targets that require the Tcl library. - # -@@ -1751,11 +1755,12 @@ dll: $(SQLITE3DLL) - shell: $(SQLITE3EXE) - - # <> --libsqlite3.lib: $(LIBOBJ) -- $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) -+# LTLIBPATHS is required to find the openssl/libressl libs -+sqlcipher.lib: $(LIBOBJ) -+ $(LTLIB) $(LTLIBPATHS) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) - --libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib -- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) -+libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib -+ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) - - tclsqlite3.def: tclsqlite.lo - echo EXPORTS > tclsqlite3.def -@@ -1777,9 +1782,9 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) - $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) - - # <> --sqlite3.def: libsqlite3.lib -+sqlite3.def: sqlcipher.lib - echo EXPORTS > sqlite3.def -- dumpbin /all libsqlite3.lib \ -+ dumpbin /all sqlcipher.lib \ - | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \ - | sort >> sqlite3.def - # <> -@@ -1959,6 +1964,15 @@ callback.lo: $(TOP)\src\callback.c $(HDR) - complete.lo: $(TOP)\src\complete.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c - -+crypto.lo: $(TOP)\src\crypto.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto.c -+ -+crypto_impl.lo: $(TOP)\src\crypto_impl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_impl.c -+ -+crypto_openssl.lo: $(TOP)\src\crypto_openssl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_openssl.c -+ - ctime.lo: $(TOP)\src\ctime.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c - -@@ -2385,7 +2399,7 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR) - # Rules to build the 'testfixture' application. - # - # If using the amalgamation, use sqlite3.c directly to build the test --# fixture. Otherwise link against libsqlite3.lib. (This distinction is -+# fixture. Otherwise link against sqlcipher.lib. (This distinction is - # necessary because the test fixture requires non-API symbols which are - # hidden when the library is built via the amalgamation). - # diff --git a/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.1.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.1.patch deleted file mode 100644 index 7fb970d1364d5..0000000000000 --- a/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.1.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff --git a/Makefile.msc b/Makefile.msc -index 49e7daa..cd6ba91 100644 ---- a/Makefile.msc -+++ b/Makefile.msc -@@ -286,9 +286,9 @@ SQLITE3H = sqlite3.h - # - !IFNDEF SQLITE3DLL - !IF $(FOR_WIN10)!=0 --SQLITE3DLL = winsqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ELSE --SQLITE3DLL = sqlite3.dll -+SQLITE3DLL = sqlcipher.dll - !ENDIF - !ENDIF - -@@ -296,9 +296,9 @@ SQLITE3DLL = sqlite3.dll - # - !IFNDEF SQLITE3LIB - !IF $(FOR_WIN10)!=0 --SQLITE3LIB = winsqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ELSE --SQLITE3LIB = sqlite3.lib -+SQLITE3LIB = sqlcipher.lib - !ENDIF - !ENDIF - -@@ -675,7 +675,7 @@ SHELL_CORE_SRC = $(SQLITE3C) - SHELL_CORE_DEP = $(SQLITE3DLL) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_DEP = libsqlite3.lib -+SHELL_CORE_DEP = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_DEP = -@@ -698,7 +698,7 @@ TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP) - SHELL_CORE_LIB = $(SQLITE3LIB) - # <> - !ELSEIF $(USE_AMALGAMATION)==0 --SHELL_CORE_LIB = libsqlite3.lib -+SHELL_CORE_LIB = sqlcipher.lib - # <> - !ELSE - SHELL_CORE_LIB = -@@ -733,8 +733,9 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP - # C compiler options for the Windows 10 platform (needs MSVC 2015). - # - !IF $(FOR_WIN10)!=0 --TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE --BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+# /d2guard4 requires /guard:cf to be present as well, but it doesn't work with /Zi (Debug builds) -+TCC = $(TCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -+BCC = $(BCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE - !ENDIF - - # Also, we need to dynamically link to the correct MSVC runtime -@@ -1011,8 +1012,10 @@ TLIBS = - # default to file, 2 to default to memory, and 3 to force temporary - # tables to always be in memory. - # --TCC = $(TCC) -DSQLITE_TEMP_STORE=1 --RCC = $(RCC) -DSQLITE_TEMP_STORE=1 -+ -+# Allow overriding the value -+TCC = $(TCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) -+RCC = $(RCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) - - # Enable/disable loadable extensions, and other optional features - # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). -@@ -1178,14 +1181,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" - !ENDIF - LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib --LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL - !ENDIF - - # When compiling for UWP or the Windows 10 platform, some extra linker - # options are also required. - # - !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 --LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib -+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL -+LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE - LTLINKOPTS = $(LTLINKOPTS) mincore.lib - !IFDEF PSDKLIBPATH - LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" -@@ -1240,7 +1244,7 @@ LTLIBS = $(LTLIBS) $(LIBICU) - # - LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \ - backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ -- callback.lo complete.lo ctime.lo \ -+ callback.lo complete.lo crypto.lo crypto_impl.lo crypto_openssl.lo ctime.lo \ - date.lo dbpage.lo dbstat.lo delete.lo \ - expr.lo fault.lo fkey.lo \ - fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \ -@@ -1735,7 +1739,7 @@ ALL_TCL_TARGETS = - # This is the default Makefile target. The objects listed here - # are what get build when you type just "make" with no arguments. - # --core: dll libsqlite3.lib shell -+core: dll sqlcipher.lib shell - - # Targets that require the Tcl library. - # -@@ -1754,11 +1758,12 @@ dll: $(SQLITE3DLL) - shell: $(SQLITE3EXE) - - # <> --libsqlite3.lib: $(LIBOBJ) -- $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) -+# LTLIBPATHS is required to find the openssl/libressl libs -+sqlcipher.lib: $(LIBOBJ) -+ $(LTLIB) $(LTLIBPATHS) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) - --libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib -- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) -+libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib -+ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) - - tclsqlite3.def: tclsqlite.lo - echo EXPORTS > tclsqlite3.def -@@ -1780,9 +1785,9 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) - $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) - - # <> --sqlite3.def: libsqlite3.lib -+sqlite3.def: sqlcipher.lib - echo EXPORTS > sqlite3.def -- dumpbin /all libsqlite3.lib \ -+ dumpbin /all sqlcipher.lib \ - | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \ - | sort >> sqlite3.def - # <> -@@ -1962,6 +1967,15 @@ callback.lo: $(TOP)\src\callback.c $(HDR) - complete.lo: $(TOP)\src\complete.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c - -+crypto.lo: $(TOP)\src\crypto.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto.c -+ -+crypto_impl.lo: $(TOP)\src\crypto_impl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_impl.c -+ -+crypto_openssl.lo: $(TOP)\src\crypto_openssl.c $(HDR) -+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_openssl.c -+ - ctime.lo: $(TOP)\src\ctime.c $(HDR) - $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c - -@@ -2388,7 +2402,7 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR) - # Rules to build the 'testfixture' application. - # - # If using the amalgamation, use sqlite3.c directly to build the test --# fixture. Otherwise link against libsqlite3.lib. (This distinction is -+# fixture. Otherwise link against sqlcipher.lib. (This distinction is - # necessary because the test fixture requires non-API symbols which are - # hidden when the library is built via the amalgamation). - # diff --git a/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.7.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.7.patch new file mode 100644 index 0000000000000..78ff7f03e70eb --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.msc-v4.5.7.patch @@ -0,0 +1,170 @@ +diff --git a/Makefile.msc b/Makefile.msc +index eb6461c..0e8907b 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -299,9 +299,9 @@ SQLITE3H = sqlite3.h + # + !IFNDEF SQLITE3DLL + !IF $(FOR_WIN10)!=0 +-SQLITE3DLL = winsqlite3.dll ++SQLITE3DLL = sqlcipher.dll + !ELSE +-SQLITE3DLL = sqlite3.dll ++SQLITE3DLL = sqlcipher.dll + !ENDIF + !ENDIF + +@@ -309,9 +309,9 @@ SQLITE3DLL = sqlite3.dll + # + !IFNDEF SQLITE3LIB + !IF $(FOR_WIN10)!=0 +-SQLITE3LIB = winsqlite3.lib ++SQLITE3LIB = sqlcipher.lib + !ELSE +-SQLITE3LIB = sqlite3.lib ++SQLITE3LIB = sqlcipher.lib + !ENDIF + !ENDIF + +@@ -696,7 +696,7 @@ SHELL_CORE_SRC = $(SQLITE3C) + SHELL_CORE_DEP = $(SQLITE3DLL) + # <> + !ELSEIF $(USE_AMALGAMATION)==0 +-SHELL_CORE_DEP = libsqlite3.lib ++SHELL_CORE_DEP = sqlcipher.lib + # <> + !ELSE + SHELL_CORE_DEP = +@@ -719,7 +719,7 @@ TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP) + SHELL_CORE_LIB = $(SQLITE3LIB) + # <> + !ELSEIF $(USE_AMALGAMATION)==0 +-SHELL_CORE_LIB = libsqlite3.lib ++SHELL_CORE_LIB = sqlcipher.lib + # <> + !ELSE + SHELL_CORE_LIB = +@@ -754,8 +754,9 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP + # C compiler options for the Windows 10 platform (needs MSVC 2015). + # + !IF $(FOR_WIN10)!=0 +-TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE +-BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE ++# /d2guard4 requires /guard:cf to be present as well, but it doesn't work with /Zi (Debug builds) ++TCC = $(TCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE ++BCC = $(BCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + !ENDIF + + # Also, we need to dynamically link to the correct MSVC runtime +@@ -1039,8 +1040,9 @@ TLIBS = + # default to file, 2 to default to memory, and 3 to force temporary + # tables to always be in memory. + # +-TCC = $(TCC) -DSQLITE_TEMP_STORE=1 +-RCC = $(RCC) -DSQLITE_TEMP_STORE=1 ++# Allow overriding the value ++TCC = $(TCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) ++RCC = $(RCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) + + # Enable/disable loadable extensions, and other optional features + # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). +@@ -1206,14 +1208,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" + !ENDIF + LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE + LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib +-LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib ++# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL + !ENDIF + + # When compiling for UWP or the Windows 10 platform, some extra linker + # options are also required. + # + !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 +-LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib ++# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL ++LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE + LTLINKOPTS = $(LTLINKOPTS) mincore.lib + !IFDEF PSDKLIBPATH + LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" +@@ -1268,7 +1271,7 @@ LTLIBS = $(LTLIBS) $(LIBICU) + # + LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \ + backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ +- callback.lo complete.lo ctime.lo \ ++ callback.lo complete.lo crypto.lo crypto_impl.lo crypto_openssl.lo ctime.lo \ + date.lo dbpage.lo dbstat.lo delete.lo \ + expr.lo fault.lo fkey.lo \ + fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \ +@@ -1603,7 +1606,7 @@ TESTEXT = \ + $(TOP)\ext\rtree\test_rtreedoc.c \ + $(TOP)\ext\recover\sqlite3recover.c \ + $(TOP)\ext\recover\test_recover.c \ +- $(TOP)\ext\recover\dbdata.c ++ $(TOP)\ext\recover\dbdata.c + + # If use of zlib is enabled, add the "zipfile.c" source file. + # +@@ -1779,7 +1782,7 @@ ALL_TCL_TARGETS = + # This is the default Makefile target. The objects listed here + # are what get build when you type just "make" with no arguments. + # +-core: dll libsqlite3.lib shell ++core: dll sqlcipher.lib shell + + # Targets that require the Tcl library. + # +@@ -1798,11 +1801,13 @@ dll: $(SQLITE3DLL) + shell: $(SQLITE3EXE) + + # <> +-libsqlite3.lib: $(LIBOBJ) +- $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) ++# LTLIBPATHS is required to find the openssl/libressl libs ++sqlcipher.lib: $(LIBOBJ) ++ $(LTLIB) $(LTLIBPATHS) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) ++ ++libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib ++ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) + +-libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib +- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) + + tclsqlite3.def: tclsqlite.lo + echo EXPORTS > tclsqlite3.def +@@ -1824,9 +1829,9 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) + $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) + + # <> +-sqlite3.def: libsqlite3.lib ++sqlite3.def: sqlcipher.lib + echo EXPORTS > sqlite3.def +- dumpbin /all libsqlite3.lib \ ++ dumpbin /all sqlcipher.lib \ + | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \ + | sort >> sqlite3.def + # <> +@@ -2013,6 +2018,15 @@ callback.lo: $(TOP)\src\callback.c $(HDR) + complete.lo: $(TOP)\src\complete.c $(HDR) + $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c + ++crypto.lo: $(TOP)\src\crypto.c $(HDR) ++ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto.c ++ ++crypto_impl.lo: $(TOP)\src\crypto_impl.c $(HDR) ++ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_impl.c ++ ++crypto_openssl.lo: $(TOP)\src\crypto_openssl.c $(HDR) ++ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_openssl.c ++ + ctime.lo: $(TOP)\src\ctime.c $(HDR) + $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c + +@@ -2432,7 +2446,7 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR) + # Rules to build the 'testfixture' application. + # + # If using the amalgamation, use sqlite3.c directly to build the test +-# fixture. Otherwise link against libsqlite3.lib. (This distinction is ++# fixture. Otherwise link against sqlcipher.lib. (This distinction is + # necessary because the test fixture requires non-API symbols which are + # hidden when the library is built via the amalgamation). + # diff --git a/recipes/sqlcipher/all/patches/Makefile.msc-v4.6.1.patch b/recipes/sqlcipher/all/patches/Makefile.msc-v4.6.1.patch new file mode 100644 index 0000000000000..7edea48493167 --- /dev/null +++ b/recipes/sqlcipher/all/patches/Makefile.msc-v4.6.1.patch @@ -0,0 +1,160 @@ +diff --git a/Makefile.msc b/Makefile.msc +index d46cee1..899ce6a 100644 +--- a/Makefile.msc ++++ b/Makefile.msc +@@ -306,9 +306,9 @@ SQLITE3H = sqlite3.h + # + !IFNDEF SQLITE3DLL + !IF $(FOR_WIN10)!=0 +-SQLITE3DLL = winsqlite3.dll ++SQLITE3DLL = sqlcipher.dll + !ELSE +-SQLITE3DLL = sqlite3.dll ++SQLITE3DLL = sqlcipher.dll + !ENDIF + !ENDIF + +@@ -316,9 +316,9 @@ SQLITE3DLL = sqlite3.dll + # + !IFNDEF SQLITE3LIB + !IF $(FOR_WIN10)!=0 +-SQLITE3LIB = winsqlite3.lib ++SQLITE3LIB = sqlcipher.lib + !ELSE +-SQLITE3LIB = sqlite3.lib ++SQLITE3LIB = sqlcipher.lib + !ENDIF + !ENDIF + +@@ -703,7 +703,7 @@ SHELL_CORE_SRC = $(SQLITE3C) + SHELL_CORE_DEP = $(SQLITE3DLL) + # <> + !ELSEIF $(USE_AMALGAMATION)==0 +-SHELL_CORE_DEP = libsqlite3.lib ++SHELL_CORE_DEP = sqlcipher.lib + # <> + !ELSE + SHELL_CORE_DEP = +@@ -726,7 +726,7 @@ TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP) + SHELL_CORE_LIB = $(SQLITE3LIB) + # <> + !ELSEIF $(USE_AMALGAMATION)==0 +-SHELL_CORE_LIB = libsqlite3.lib ++SHELL_CORE_LIB = sqlcipher.lib + # <> + !ELSE + SHELL_CORE_LIB = +@@ -761,8 +761,9 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP + # C compiler options for the Windows 10 platform (needs MSVC 2015). + # + !IF $(FOR_WIN10)!=0 +-TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE +-BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE ++# /d2guard4 requires /guard:cf to be present as well, but it doesn't work with /Zi (Debug builds) ++TCC = $(TCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE ++BCC = $(BCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE + !ENDIF + + # Also, we need to dynamically link to the correct MSVC runtime +@@ -1046,8 +1047,9 @@ TLIBS = + # default to file, 2 to default to memory, and 3 to force temporary + # tables to always be in memory. + # +-TCC = $(TCC) -DSQLITE_TEMP_STORE=1 +-RCC = $(RCC) -DSQLITE_TEMP_STORE=1 ++# Allow overriding the value ++TCC = $(TCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) ++RCC = $(RCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE) + + # Enable/disable loadable extensions, and other optional features + # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). +@@ -1213,14 +1215,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" + !ENDIF + LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE + LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib +-LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib ++# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL + !ENDIF + + # When compiling for UWP or the Windows 10 platform, some extra linker + # options are also required. + # + !IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 +-LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib ++# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL ++LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE + LTLINKOPTS = $(LTLINKOPTS) mincore.lib + !IFDEF PSDKLIBPATH + LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" +@@ -1275,7 +1278,7 @@ LTLIBS = $(LTLIBS) $(LIBICU) + # + LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \ + backup.lo bitvec.lo btmutex.lo btree.lo build.lo \ +- callback.lo complete.lo ctime.lo \ ++ callback.lo complete.lo crypto.lo crypto_impl.lo crypto_openssl.lo ctime.lo \ + date.lo dbpage.lo dbstat.lo delete.lo \ + expr.lo fault.lo fkey.lo \ + fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \ +@@ -1786,7 +1789,7 @@ ALL_TCL_TARGETS = + # This is the default Makefile target. The objects listed here + # are what get build when you type just "make" with no arguments. + # +-core: dll libsqlite3.lib shell ++core: dll sqlcipher.lib shell + + # Targets that require the Tcl library. + # +@@ -1805,11 +1808,12 @@ dll: $(SQLITE3DLL) + shell: $(SQLITE3EXE) + + # <> +-libsqlite3.lib: $(LIBOBJ) +- $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) ++# LTLIBPATHS is required to find the openssl/libressl libs ++sqlcipher.lib: $(LIBOBJ) ++ $(LTLIB) $(LTLIBPATHS) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS) + +-libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib +- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS) ++libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib ++ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS) + + tclsqlite3.def: tclsqlite.lo + echo EXPORTS > tclsqlite3.def +@@ -1831,9 +1835,9 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) + $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) + + # <> +-sqlite3.def: libsqlite3.lib ++sqlite3.def: sqlcipher.lib + echo EXPORTS > sqlite3.def +- dumpbin /all libsqlite3.lib \ ++ dumpbin /all sqlcipher.lib \ + | $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \ + | sort >> sqlite3.def + # <> +@@ -2020,6 +2024,15 @@ callback.lo: $(TOP)\src\callback.c $(HDR) + complete.lo: $(TOP)\src\complete.c $(HDR) + $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c + ++crypto.lo: $(TOP)\src\crypto.c $(HDR) ++ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto.c ++ ++crypto_impl.lo: $(TOP)\src\crypto_impl.c $(HDR) ++ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_impl.c ++ ++crypto_openssl.lo: $(TOP)\src\crypto_openssl.c $(HDR) ++ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_openssl.c ++ + ctime.lo: $(TOP)\src\ctime.c $(HDR) + $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c + +@@ -2444,7 +2457,7 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR) + # Rules to build the 'testfixture' application. + # + # If using the amalgamation, use sqlite3.c directly to build the test +-# fixture. Otherwise link against libsqlite3.lib. (This distinction is ++# fixture. Otherwise link against sqlcipher.lib. (This distinction is + # necessary because the test fixture requires non-API symbols which are + # hidden when the library is built via the amalgamation). + # diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.3.0.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.3.0.patch deleted file mode 100644 index 5d20efbba5494..0000000000000 --- a/recipes/sqlcipher/all/patches/fix_configure-v4.3.0.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/configure b/configure -index ce44d5c..bc79910 100644 ---- a/configure -+++ b/configure -@@ -12092,7 +12092,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lcrypto $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -12127,7 +12126,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : - #define HAVE_LIBCRYPTO 1 - _ACEOF - -- LIBS="-lcrypto $LIBS" - - else - as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.4.0.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.4.0.patch deleted file mode 100644 index be33ac4e78f9b..0000000000000 --- a/recipes/sqlcipher/all/patches/fix_configure-v4.4.0.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/configure b/configure -index c90edcc..f1d48e6 100644 ---- a/configure -+++ b/configure -@@ -12094,7 +12094,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lcrypto $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -12129,7 +12128,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : - #define HAVE_LIBCRYPTO 1 - _ACEOF - -- LIBS="-lcrypto $LIBS" - - else - as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.4.2.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.4.2.patch deleted file mode 100644 index c4d26f253f633..0000000000000 --- a/recipes/sqlcipher/all/patches/fix_configure-v4.4.2.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/configure b/configure -index 5852752..43af5af 100755 ---- a/configure -+++ b/configure -@@ -12125,7 +12125,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lcrypto $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -12160,7 +12159,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : - #define HAVE_LIBCRYPTO 1 - _ACEOF - -- LIBS="-lcrypto $LIBS" - - else - as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.5.0.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.5.0.patch deleted file mode 100644 index 0a44e1e4e6e47..0000000000000 --- a/recipes/sqlcipher/all/patches/fix_configure-v4.5.0.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/configure b/configure -index 1142624..7f1680f 100755 ---- a/configure -+++ b/configure -@@ -12127,7 +12127,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lcrypto $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -12162,7 +12161,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : - #define HAVE_LIBCRYPTO 1 - _ACEOF - -- LIBS="-lcrypto $LIBS" - - else - as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.5.1.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.5.1.patch deleted file mode 100644 index 97f93ba573a2e..0000000000000 --- a/recipes/sqlcipher/all/patches/fix_configure-v4.5.1.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/configure b/configure -index a2909ce..9c25987 100755 ---- a/configure -+++ b/configure -@@ -12127,7 +12127,6 @@ if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lcrypto $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -12162,7 +12161,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : - #define HAVE_LIBCRYPTO 1 - _ACEOF - -- LIBS="-lcrypto $LIBS" - - else - as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/patches/fix_configure-v4.5.7.patch b/recipes/sqlcipher/all/patches/fix_configure-v4.5.7.patch new file mode 100644 index 0000000000000..902782af36686 --- /dev/null +++ b/recipes/sqlcipher/all/patches/fix_configure-v4.5.7.patch @@ -0,0 +1,20 @@ +diff --git a/configure b/configure +index 2ee4143..753e9b1 100755 +--- a/configure ++++ b/configure +@@ -12732,7 +12732,6 @@ then : + printf %s "(cached) " >&6 + else $as_nop + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcrypto $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -12764,7 +12763,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes + then : + printf "%s\n" "#define HAVE_LIBCRYPTO 1" >>confdefs.h + +- LIBS="-lcrypto $LIBS" + + else $as_nop + as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5 diff --git a/recipes/sqlcipher/all/test_package/conanfile.py b/recipes/sqlcipher/all/test_package/conanfile.py index a2566c4cce099..f42142315949c 100644 --- a/recipes/sqlcipher/all/test_package/conanfile.py +++ b/recipes/sqlcipher/all/test_package/conanfile.py @@ -13,15 +13,6 @@ class TestPackageConan(ConanFile): def requirements(self): self.requires(self.tested_reference_str) - 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.tool_requires("cmake/[>=3.22]") - def layout(self): cmake_layout(self) diff --git a/recipes/sqlcipher/all/test_v1_package/CMakeLists.txt b/recipes/sqlcipher/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/sqlcipher/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 84b7364551610..0000000000000 --- a/recipes/sqlcipher/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -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/sqlcipher/config.yml b/recipes/sqlcipher/config.yml index 939fca7342f84..7e7fec3a43452 100644 --- a/recipes/sqlcipher/config.yml +++ b/recipes/sqlcipher/config.yml @@ -1,13 +1,7 @@ versions: - "4.5.1": + "4.6.1": folder: all - "4.5.0": + "4.5.7": folder: all "4.4.3": folder: all - "4.4.2": - folder: all - "4.4.0": - folder: all - "4.3.0": - folder: all diff --git a/recipes/sqlite3/all/CMakeLists.txt b/recipes/sqlite3/all/CMakeLists.txt index 1f1e60b9b2dcf..4232fb09e8d32 100644 --- a/recipes/sqlite3/all/CMakeLists.txt +++ b/recipes/sqlite3/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.15) project(sqlite3 LANGUAGES C) # Add some options from https://sqlite.org/compile.html @@ -11,12 +11,15 @@ option(ENABLE_FTS3 "Enable version 3 of the full-text search engine") option(ENABLE_FTS3_PARENTHESIS "Kodifies the query pattern parser in FTS3 such that it supports operators AND and NOT (in addition to the usual OR and NEAR) and also allows query expressions to contain nested parenthesis") option(ENABLE_FTS4 "Enable version 3 and 4 of the full-text search engine") option(ENABLE_FTS5 "Enable version 5 of the full-text search engine") +option(ENABLE_ICU "Enable support for the ICU extension") +option(ENABLE_MEMSYS5 "Enable MEMSYS5 memory allocator") option(ENABLE_SOUNDEX "Enable the soundex() SQL function") option(ENABLE_PREUPDATE_HOOK "Enables APIs to handle any change to a rowid table") option(ENABLE_RTREE "Enable support for the R*Tree index extension") option(ENABLE_UNLOCK_NOTIFY "Enable support for the unlock notify API") option(ENABLE_DEFAULT_SECURE_DELETE "Turns on secure deletion by default") option(USE_ALLOCA "The alloca() memory allocator will be used in a few situations where it is appropriate.") +option(USE_URI "This option causes the URI filename process logic to be enabled by default.") option(OMIT_LOAD_EXTENSION "Omits the entire extension loading mechanism from SQLite") option(OMIT_DEPRECATED "Omits deprecated interfaces and features") if(SQLITE3_VERSION VERSION_GREATER_EQUAL "3.35.0") @@ -75,6 +78,9 @@ endif() if(ENABLE_FTS5) target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_FTS5) endif() +if(ENABLE_ICU) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_ICU) +endif() if(ENABLE_PREUPDATE_HOOK) target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_PREUPDATE_HOOK) endif() @@ -87,12 +93,18 @@ endif() if(ENABLE_DEFAULT_SECURE_DELETE) target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_SECURE_DELETE) endif() +if(ENABLE_MEMSYS5) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_ENABLE_MEMSYS5) +endif() if(ENABLE_SOUNDEX) target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_SOUNDEX) endif() if(USE_ALLOCA) target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_USE_ALLOCA) endif() +if(USE_URI) + target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_USE_URI) +endif() if(OMIT_LOAD_EXTENSION) target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_OMIT_LOAD_EXTENSION) endif() @@ -145,6 +157,12 @@ if(THREADSAFE) target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads) endif() +if(ENABLE_ICU) + find_package(ICU REQUIRED COMPONENTS data i18n uc) + target_link_libraries(${PROJECT_NAME} PRIVATE ICU::i18n ICU::uc ICU::data) + enable_language(CXX) # required for linking language since ICU has c++ code +endif() + if(NOT OMIT_LOAD_EXTENSION) target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS}) endif() @@ -176,6 +194,14 @@ if(SQLITE3_BUILD_EXECUTABLE) if(ENABLE_DBPAGE_VTAB) target_compile_definitions(sqlite3-bin PRIVATE SQLITE_ENABLE_DBPAGE_VTAB) endif() + if(ENABLE_ICU) + set_target_properties(sqlite3-bin PROPERTIES LINKER_LANGUAGE CXX) + endif() + if (MSVC) + # Prevent issue where an import library may be generated on Windows + # fatal error LNK1149: output filename matches input filename '\build\Release\sqlite3.lib'\ + target_link_options(sqlite3-bin PRIVATE "/noimplib") + endif() set_target_properties(sqlite3-bin PROPERTIES OUTPUT_NAME "sqlite3" PDB_NAME "sqlite3-bin") include(CheckSymbolExists) check_symbol_exists(system "stdlib.h" HAVE_SYSTEM) diff --git a/recipes/sqlite3/all/conandata.yml b/recipes/sqlite3/all/conandata.yml index d1238ae4e2a8d..3c81977a593c0 100644 --- a/recipes/sqlite3/all/conandata.yml +++ b/recipes/sqlite3/all/conandata.yml @@ -1,58 +1,19 @@ sources: + "3.49.1": + url: "https://sqlite.org/2025/sqlite-amalgamation-3490100.zip" + sha256: "6cebd1d8403fc58c30e93939b246f3e6e58d0765a5cd50546f16c00fd805d2c3" + "3.48.0": + url: "https://sqlite.org/2025/sqlite-amalgamation-3480000.zip" + sha256: "d9a15a42db7c78f88fe3d3c5945acce2f4bfe9e4da9f685cd19f6ea1d40aa884" + "3.47.2": + url: "https://sqlite.org/2024/sqlite-amalgamation-3470200.zip" + sha256: "aa73d8748095808471deaa8e6f34aa700e37f2f787f4425744f53fdd15a89c40" + "3.46.1": + url: "https://sqlite.org/2024/sqlite-amalgamation-3460100.zip" + sha256: "77823cb110929c2bcb0f5d48e4833b5c59a8a6e40cdea3936b99e199dbbe5784" + "3.45.3": + url: "https://sqlite.org/2024/sqlite-amalgamation-3450300.zip" + sha256: "ea170e73e447703e8359308ca2e4366a3ae0c4304a8665896f068c736781c651" "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" - "3.41.2": - url: "https://sqlite.org/2023/sqlite-amalgamation-3410200.zip" - sha256: "01df06a84803c1ab4d62c64e995b151b2dbcf5dbc93bbc5eee213cb18225d987" - "3.41.1": - url: "https://sqlite.org/2023/sqlite-amalgamation-3410100.zip" - sha256: "df0d54bf246521360c8148f64e7e5ad07a4665b4f902339e844f4c493d535ff5" - "3.40.1": - url: "https://sqlite.org/2022/sqlite-amalgamation-3400100.zip" - sha256: "49112cc7328392aa4e3e5dae0b2f6736d0153430143d21f69327788ff4efe734" - "3.40.0": - url: "https://sqlite.org/2022/sqlite-amalgamation-3400000.zip" - sha256: "7c23eb51409315738c930a222cf7cd41518ae5823c41e60a81b93a07070ef22a" - "3.39.4": - url: "https://sqlite.org/2022/sqlite-amalgamation-3390400.zip" - sha256: "9c99955b21d2374f3a385d67a1f64cbacb1d4130947473d25c77ad609c03b4cd" - "3.39.3": - url: "https://sqlite.org/2022/sqlite-amalgamation-3390300.zip" - sha256: "a89db3030d229d860ae56a8bac50ac9761434047ae886e47e7c8f9f428fa98ad" - "3.39.2": - url: "https://sqlite.org/2022/sqlite-amalgamation-3390200.zip" - sha256: "87775784f8b22d0d0f1d7811870d39feaa7896319c7c20b849a4181c5a50609b" - "3.39.1": - url: "https://sqlite.org/2022/sqlite-amalgamation-3390100.zip" - sha256: "f2ce17bca51b376de4fcb9d0dc174c52f472a34c29aa1ccc774f27467cc63ed7" - "3.39.0": - url: "https://sqlite.org/2022/sqlite-amalgamation-3390000.zip" - sha256: "35109dd6e4f062f4d76b48bd7614eec35abae9d2da70351c7ef936876b064b5f" - "3.38.5": - url: "https://sqlite.org/2022/sqlite-amalgamation-3380500.zip" - sha256: "bebb039b748441e3d25d71d11f7a4a33f5df11f318ec18fa7f343d2083755e2c" - "3.37.2": - url: "https://sqlite.org/2022/sqlite-amalgamation-3370200.zip" - sha256: "cb25df0fb90b77be6660f6ace641bbea88f3d0441110d394ce418f35f7561bb0" - "3.36.0": - url: "https://sqlite.org/2021/sqlite-amalgamation-3360000.zip" - sha256: "999826fe4c871f18919fdb8ed7ec9dd8217180854dd1fe21eea96aed36186729" + sha256: "833be89b53b3be8b40a2e3d5fedb635080e3edb204957244f3d6987c2bb2345f" \ No newline at end of file diff --git a/recipes/sqlite3/all/conanfile.py b/recipes/sqlite3/all/conanfile.py index eddf425a36988..b5ae64463d0b3 100644 --- a/recipes/sqlite3/all/conanfile.py +++ b/recipes/sqlite3/all/conanfile.py @@ -3,9 +3,7 @@ from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import get, load, save -from conan.tools.scm import Version import os -import textwrap required_conan_version = ">=1.53.0" @@ -30,11 +28,14 @@ class Sqlite3Conan(ConanFile): "enable_fts3_parenthesis": [True, False], "enable_fts4": [True, False], "enable_fts5": [True, False], + "enable_icu": [True, False], "enable_json1": [True, False], + "enable_memsys5": [True, False], "enable_soundex": [True, False], "enable_preupdate_hook": [True, False], "enable_rtree": [True, False], "use_alloca": [True, False], + "use_uri": [True, False], "omit_load_extension": [True, False], "omit_deprecated": [True, False], "enable_math_functions": [True, False], @@ -59,11 +60,14 @@ class Sqlite3Conan(ConanFile): "enable_fts3_parenthesis": False, "enable_fts4": False, "enable_fts5": False, + "enable_icu": False, "enable_json1": False, + "enable_memsys5": False, "enable_soundex": False, "enable_preupdate_hook": False, "enable_rtree": True, "use_alloca": False, + "use_uri": False, "omit_load_extension": False, "omit_deprecated": False, "enable_math_functions": True, @@ -80,15 +84,9 @@ class Sqlite3Conan(ConanFile): exports_sources = "CMakeLists.txt" - @property - def _has_enable_math_function_option(self): - return Version(self.version) >= "3.35.0" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if not self._has_enable_math_function_option: - del self.options.enable_math_functions def configure(self): if self.options.shared: @@ -99,6 +97,10 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + if self.options.enable_icu: + self.requires("icu/75.1") + def validate(self): if self.options.build_executable: if not self.options.enable_default_vfs: @@ -123,17 +125,19 @@ def generate(self): tc.variables["ENABLE_FTS3_PARENTHESIS"] = self.options.enable_fts3_parenthesis tc.variables["ENABLE_FTS4"] = self.options.enable_fts4 tc.variables["ENABLE_FTS5"] = self.options.enable_fts5 + tc.variables["ENABLE_ICU"] = self.options.enable_icu tc.variables["ENABLE_JSON1"] = self.options.enable_json1 + tc.variables["ENABLE_MEMSYS5"] = self.options.enable_memsys5 tc.variables["ENABLE_PREUPDATE_HOOK"] = self.options.enable_preupdate_hook tc.variables["ENABLE_SOUNDEX"] = self.options.enable_soundex tc.variables["ENABLE_RTREE"] = self.options.enable_rtree tc.variables["ENABLE_UNLOCK_NOTIFY"] = self.options.enable_unlock_notify tc.variables["ENABLE_DEFAULT_SECURE_DELETE"] = self.options.enable_default_secure_delete tc.variables["USE_ALLOCA"] = self.options.use_alloca + tc.variables["USE_URI"] = self.options.use_uri tc.variables["OMIT_LOAD_EXTENSION"] = self.options.omit_load_extension tc.variables["OMIT_DEPRECATED"] = self.options.omit_deprecated - if self._has_enable_math_function_option: - tc.variables["ENABLE_MATH_FUNCTIONS"] = self.options.enable_math_functions + tc.variables["ENABLE_MATH_FUNCTIONS"] = self.options.enable_math_functions tc.variables["HAVE_FDATASYNC"] = True tc.variables["HAVE_GMTIME_R"] = True tc.variables["HAVE_LOCALTIME_R"] = self.settings.os != "Windows" @@ -166,27 +170,6 @@ def package(self): cmake = CMake(self) cmake.install() - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - # Indeed CMakeDeps uses 'cmake_file_name' property to qualify CMake variables - self._create_cmake_module_variables( - os.path.join(self.package_folder, self._module_file_rel_path) - ) - - def _create_cmake_module_variables(self, module_file): - content = textwrap.dedent("""\ - if(DEFINED SQLite_INCLUDE_DIRS) - set(SQLite3_INCLUDE_DIRS ${SQLite_INCLUDE_DIRS}) - endif() - if(DEFINED SQLite_LIBRARIES) - set(SQLite3_LIBRARIES ${SQLite_LIBRARIES}) - endif() - """) - 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): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "SQLite3") @@ -195,6 +178,8 @@ def package_info(self): # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed self.cpp_info.components["sqlite"].libs = ["sqlite3"] + if self.options.enable_icu: + self.cpp_info.components["sqlite"].requires = ["icu::icu"] if self.options.omit_load_extension: self.cpp_info.components["sqlite"].defines.append("SQLITE_OMIT_LOAD_EXTENSION") if self.settings.os in ["Linux", "FreeBSD"]: @@ -208,16 +193,5 @@ def package_info(self): if self.options.shared: self.cpp_info.components["sqlite"].defines.append("SQLITE_API=__declspec(dllimport)") - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "SQLite3" - self.cpp_info.filenames["cmake_find_package_multi"] = "SQLite3" - self.cpp_info.names["cmake_find_package"] = "SQLite" - self.cpp_info.names["cmake_find_package_multi"] = "SQLite" - self.cpp_info.components["sqlite"].names["cmake_find_package"] = "SQLite3" - self.cpp_info.components["sqlite"].names["cmake_find_package_multi"] = "SQLite3" - self.cpp_info.components["sqlite"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["sqlite"].build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.components["sqlite"].set_property("cmake_target_name", "SQLite::SQLite3") self.cpp_info.components["sqlite"].set_property("pkg_config_name", "sqlite3") - if self.options.build_executable: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/sqlite3/all/test_package/CMakeLists.txt b/recipes/sqlite3/all/test_package/CMakeLists.txt index 3af61b1ff43d4..ab7a05695dcd8 100644 --- a/recipes/sqlite3/all/test_package/CMakeLists.txt +++ b/recipes/sqlite3/all/test_package/CMakeLists.txt @@ -1,14 +1,16 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) -option(USE_EMPTY_VFS "Using empty SQLite OS interface") - find_package(SQLite3 REQUIRED) +if(NOT SQLite3_INCLUDE_DIRS) + message(FATAL_ERROR "SQLite3_INCLUDE_DIRS CMake variable expected, but not defined") +endif() + +if(NOT SQLite3_LIBRARIES) + message(FATAL_ERROR "SQLite3_LIBRARIES CMake variable expected, but not defined") +endif() + add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) -if(USE_EMPTY_VFS) - target_compile_definitions(${PROJECT_NAME} PRIVATE USE_EMPTY_VFS) - target_sources(${PROJECT_NAME} PRIVATE empty_vfs.c) -endif() diff --git a/recipes/sqlite3/all/test_package/empty_vfs.c b/recipes/sqlite3/all/test_package/empty_vfs.c deleted file mode 100644 index e33137be93593..0000000000000 --- a/recipes/sqlite3/all/test_package/empty_vfs.c +++ /dev/null @@ -1,90 +0,0 @@ -#include -#include - -int empty_xOpen(sqlite3_vfs *vfs, const char *zName, sqlite3_file *f, int flags, int *pOutFlags) -{ - // TODO: implement - return SQLITE_OK; -} - -int empty_xDelete(sqlite3_vfs *vfs, const char *zName, int syncDir) -{ - // TODO: implement - return SQLITE_OK; -} - -int empty_xAccess(sqlite3_vfs *vfs, const char *zName, int flags, int *pResOut) -{ - // TODO: implement - return SQLITE_OK; -} - -int empty_xFullPathname(sqlite3_vfs *vfs, const char *zName, int nOut, char *zOut) -{ - // TODO: implement - return SQLITE_OK; -} -int empty_xRandomness(sqlite3_vfs *vfs, int nByte, char *zOut) -{ - // TODO: implement - return SQLITE_OK; -} -int empty_xSleep(sqlite3_vfs *vfs, int microseconds) -{ - // TODO: implement - return SQLITE_OK; -} -int empty_xCurrentTime(sqlite3_vfs *vfs, double *t) -{ - // TODO: implement - return SQLITE_OK; -} -int empty_xGetLastError(sqlite3_vfs *vfs, int code, char *name) -{ - // TODO: implement - return SQLITE_OK; -} -int empty_xCurrentTimeInt64(sqlite3_vfs *vfs, sqlite3_int64 *t) -{ - // TODO: implement - return SQLITE_OK; -} - -// empty VFS will be provided -int sqlite3_os_init(void) -{ - static sqlite3_vfs emptyVFS = - { - 2, /* iVersion */ - 0, /* szOsFile */ - 100, /* mxPathname */ - NULL, /* pNext */ - "empty", /* zName */ - NULL, /* pAppData */ - empty_xOpen, /* xOpen */ - empty_xDelete, /* xDelete */ - empty_xAccess, /* xAccess */ - empty_xFullPathname, /* xFullPathname */ - NULL, /* xDlOpen */ - NULL, /* xDlError */ - NULL, /* xDlSym */ - NULL, /* xDlClose */ - empty_xRandomness, /* xRandomness */ - empty_xSleep, /* xSleep */ - empty_xCurrentTime, /* xCurrentTime */ - empty_xGetLastError, /* xGetLastError */ - empty_xCurrentTimeInt64, /* xCurrentTimeInt64 */ - NULL, /* xSetSystemCall */ - NULL, /* xGetSystemCall */ - NULL, /* xNextSystemCall */ - }; - - sqlite3_vfs_register(&emptyVFS, 1); - - return SQLITE_OK; -} - -int sqlite3_os_end(void) -{ - return SQLITE_OK; -} diff --git a/recipes/sqlite3/all/test_package/test_package.c b/recipes/sqlite3/all/test_package/test_package.c index a32b04528d029..e6a15ae5f4559 100644 --- a/recipes/sqlite3/all/test_package/test_package.c +++ b/recipes/sqlite3/all/test_package/test_package.c @@ -1,46 +1,7 @@ #include -#include #include -#ifdef USE_EMPTY_VFS -#define DB_NAME ":memory:" -#else -#define DB_NAME "bincrafters.db" -#endif - int main() { - sqlite3* db_instance = NULL; - char* errmsg = NULL; - int result = 0; - printf("SQLite Version: %s\n", sqlite3_libversion()); - - printf("Creating new data base ...\n"); - result = sqlite3_open(DB_NAME, &db_instance); - if (result != SQLITE_OK) { - fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db_instance)); - sqlite3_close(db_instance); - return EXIT_FAILURE; - } - printf("Done!\n"); - - printf("Creating new table...\n"); - result = sqlite3_exec(db_instance, "CREATE TABLE IF NOT EXISTS package(ID INT PRIMARY KEY NOT NULL);", NULL, 0, &errmsg); - if(result != SQLITE_OK) { - fprintf(stderr, "SQL error: %s\n", errmsg); - sqlite3_free(errmsg); - return EXIT_FAILURE; - } - printf("Done!\n"); - - printf("Closing connection ...\n"); - sqlite3_close(db_instance); - if(result != SQLITE_OK) { - fprintf(stderr, "Connection error: %s\n", errmsg); - sqlite3_free(errmsg); - return EXIT_FAILURE; - } - printf("Done!\n"); - - return EXIT_SUCCESS; + return 0; } diff --git a/recipes/sqlite3/all/test_v1_package/CMakeLists.txt b/recipes/sqlite3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/sqlite3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/sqlite3/all/test_v1_package/conanfile.py b/recipes/sqlite3/all/test_v1_package/conanfile.py deleted file mode 100644 index 48965a0bd0577..0000000000000 --- a/recipes/sqlite3/all/test_v1_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" - - def build(self): - cmake = CMake(self) - cmake.definitions["USE_EMPTY_VFS"] = not self.options["sqlite3"].enable_default_vfs - 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/sqlite3/config.yml b/recipes/sqlite3/config.yml index 8f761c32c82b7..ca13bd445b356 100644 --- a/recipes/sqlite3/config.yml +++ b/recipes/sqlite3/config.yml @@ -1,39 +1,13 @@ 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": + "3.49.1": folder: all - "3.41.1": + "3.48.0": folder: all - "3.40.1": + "3.47.2": folder: all - "3.40.0": + "3.46.1": folder: all - "3.39.4": + "3.45.3": folder: all - "3.39.3": - folder: all - "3.39.2": - folder: all - "3.39.1": - folder: all - "3.39.0": - folder: all - "3.38.5": - folder: all - "3.37.2": - folder: all - "3.36.0": + "3.44.2": folder: all diff --git a/recipes/sqlite3mc/all/conandata.yml b/recipes/sqlite3mc/all/conandata.yml new file mode 100644 index 0000000000000..db8d5f570e607 --- /dev/null +++ b/recipes/sqlite3mc/all/conandata.yml @@ -0,0 +1,19 @@ +sources: + "2.1.0": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v2.1.0.tar.gz" + sha256: "e7778297643f613bc2dabbcec8070d38a19e24b50d2faaed71b3d70ef0f0fe84" + "2.0.2": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v2.0.2.tar.gz" + sha256: "dc34a1575480d1ec6d7ed3a9ce0b3227c1d463a0a3e8885c16efe47d0e395bc7" + "1.9.0": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v1.9.0.tar.gz" + sha256: "b30dcf695ad3a53b32b8907a3920ab2b38670c7d37232839d0fb3148c41166da" + "1.8.6": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v1.8.6.tar.gz" + sha256: "7250e3d9ca4368df00d0ebfaa744add66b458a5de318728b95369d621ebf2028" + "1.8.4": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v1.8.4.tar.gz" + sha256: "453e1938a02c91796a013169d56f746f153d7c7a77b59894bf8462b341a343ca" + "1.8.0": + url: "https://github.com/utelle/SQLite3MultipleCiphers/archive/refs/tags/v1.8.0.tar.gz" + sha256: "13D9B939BEF7C7371D58A3874F83B18CF330EB2171205B3680ACDDB2215BE0E5" diff --git a/recipes/sqlite3mc/all/conanfile.py b/recipes/sqlite3mc/all/conanfile.py new file mode 100644 index 0000000000000..f99b4eebdebe5 --- /dev/null +++ b/recipes/sqlite3mc/all/conanfile.py @@ -0,0 +1,226 @@ +import os +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMakeDeps, CMakeToolchain, CMake +from conan.tools.files import get, copy +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class sqlite3mc(ConanFile): + name = "sqlite3mc" + package_type = "library" + + license = "MIT" + homepage = "https://github.com/utelle/SQLite3MultipleCiphers" + url = "https://github.com/conan-io/conan-center-index" + description = "The project SQLite3 Multiple Ciphers implements an encryption extension for SQLite with support for multiple ciphers." + topics = ("sqlite", "sqlite3", "sqlite3-encryption", "database-encryption", "sqlite3-extension") + + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "require_zlib": [True, False], + "static_runtime_link": [True, False], + "build_shell": [True, False], + "with_icu": [True, False], + "enable_debug": [True, False], + "soundex": [True, False], + "enable_column_metadata": [True, False], + "secure_delete": [True, False], + "enable_fts3": [True, False], + "enable_fts3_paranthesis": [True, False], + "enable_fts4": [True, False], + "enable_fts5": [True, False], + "enable_carray": [True, False], + "enable_csv": [True, False], + "enable_extfunc": [True, False], + "enable_geopoly": [True, False], + "enable_rtree": [True, False], + "enable_uuid": [True, False], + "use_uri": [True, False], + "user_authentication": [True, False], + "enable_preupdate_hook": [True, False], + "enable_session": [True, False], + "shell_is_utf8": [True, False], + "enable_fileio": [True, False], + "enable_regexp": [True, False], + "enable_series": [True, False], + "enable_sha3": [True, False], + "enable_explain_comments": [True, False], + "enable_dbpage_vtab": [True, False], + "enable_dbstat_vtab": [True, False], + "enable_stmtvtab": [True, False], + "enable_unknown_sql_function": [True, False], + "use_miniz": [True, False], + "enable_compress": [True, False], + "enable_sqlar": [True, False], + "enable_zipfile": [True, False], + "use_sqleet_legacy": [True, False], + "use_sqlcipher_legacy": [True, False], + "secure_memory": [True, False], + "use_random_fill_memory": [True, False], + "omit_aes_hardware_support": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "require_zlib": False, + "static_runtime_link": False, + "build_shell": False, + "with_icu": False, + "enable_debug": False, + "soundex": True, + "enable_column_metadata": True, + "secure_delete": True, + "enable_fts3": True, + "enable_fts3_paranthesis": True, + "enable_fts4": True, + "enable_fts5": True, + "enable_carray": True, + "enable_csv": True, + "enable_extfunc": True, + "enable_geopoly": True, + "enable_rtree": True, + "enable_uuid": True, + "use_uri": True, + "user_authentication": False, + "enable_preupdate_hook": False, + "enable_session": False, + "shell_is_utf8": True, + "enable_fileio": True, + "enable_regexp": True, + "enable_series": True, + "enable_sha3": True, + "enable_explain_comments": True, + "enable_dbpage_vtab": True, + "enable_dbstat_vtab": True, + "enable_stmtvtab": True, + "enable_unknown_sql_function": True, + "use_miniz": False, + "enable_compress": False, + "enable_sqlar": False, + "enable_zipfile": False, + "use_sqleet_legacy": False, + "use_sqlcipher_legacy": False, + "secure_memory": False, + "use_random_fill_memory": False, + "omit_aes_hardware_support": False + } + + def build_requirements(self): + self.tool_requires("cmake/[>=3.24 <4]") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "1.8.4": + # INFO: https://github.com/utelle/SQLite3MultipleCiphers/commit/3bb033956816b3301f026abb5e83087799de5bee + self.options.user_authentication = 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 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.require_zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.with_icu: + self.requires("icu/74.1") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + + tc = CMakeToolchain(self) + tc.variables["_SQLITE3MC_REQUIRE_ZLIB"] = self.options.require_zlib + tc.variables["SQLITE3MC_STATIC_RUNTIME_LINK"] = self.options.static_runtime_link + tc.variables["SQLITE3MC_STATIC"] = not self.options.shared + tc.variables["SQLITE3MC_BUILD_SHELL"] = self.options.build_shell + tc.variables["SQLITE3MC_WITH_ICU"] = self.options.with_icu + + tc.variables["SQLITE_ENABLE_DEBUG"] = self.options.enable_debug + tc.variables["SQLITE_SOUNDEX"] = self.options.soundex + tc.variables["SQLITE_ENABLE_COLUMN_METADATA"] = self.options.enable_column_metadata + tc.variables["SQLITE_SECURE_DELETE"] = self.options.secure_delete + tc.variables["SQLITE_ENABLE_FTS3"] = self.options.enable_fts3 + tc.variables["SQLITE_ENABLE_FTS3_PARENTHESIS"] = self.options.enable_fts3_paranthesis + tc.variables["SQLITE_ENABLE_FTS4"] = self.options.enable_fts4 + tc.variables["SQLITE_ENABLE_FTS5"] = self.options.enable_fts5 + + tc.variables["SQLITE_ENABLE_CARRAY"] = self.options.enable_carray + tc.variables["SQLITE_ENABLE_CSV"] = self.options.enable_csv + tc.variables["SQLITE_ENABLE_EXTFUNC"] = self.options.enable_extfunc + tc.variables["SQLITE_ENABLE_GEOPOLY"] = self.options.enable_geopoly + tc.variables["SQLITE_ENABLE_RTREE"] = self.options.enable_rtree + tc.variables["SQLITE_ENABLE_UUID"] = self.options.enable_uuid + tc.variables["SQLITE_USE_URI"] = self.options.use_uri + tc.variables["SQLITE_USER_AUTHENTICATION"] = self.options.user_authentication + tc.variables["SQLITE_ENABLE_PREUPDATE_HOOK"] = self.options.enable_preupdate_hook + tc.variables["SQLITE_ENABLE_SESSION"] = self.options.enable_session + tc.variables["SQLITE_SHELL_IS_UTF8"] = self.options.shell_is_utf8 + + # Options for library only + tc.variables["SQLITE_ENABLE_FILEIO"] = self.options.enable_fileio + tc.variables["SQLITE_ENABLE_REGEXP"] = self.options.enable_regexp + tc.variables["SQLITE_ENABLE_SERIES"] = self.options.enable_series + tc.variables["SQLITE_ENABLE_SHA3"] = self.options.enable_sha3 + + # Options for shell only (compatibility with official SQLite shell) + tc.variables["SQLITE_ENABLE_EXPLAIN_COMMENTS"] = self.options.enable_explain_comments + tc.variables["SQLITE_ENABLE_DBPAGE_VTAB"] = self.options.enable_dbpage_vtab + tc.variables["SQLITE_ENABLE_DBSTAT_VTAB"] = self.options.enable_dbstat_vtab + tc.variables["SQLITE_ENABLE_STMTVTAB"] = self.options.enable_stmtvtab + tc.variables["SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION"] = self.options.enable_unknown_sql_function + + # Embedded Compression + tc.variables["SQLITE3MC_USE_MINIZ"] = self.options.use_miniz + + # Compression/Options that require ZLIB + tc.variables["SQLITE_ENABLE_COMPRESS"] = self.options.enable_compress + tc.variables["SQLITE_ENABLE_SQLAR"] = self.options.enable_sqlar + tc.variables["SQLITE_ENABLE_ZIPFILE"] = self.options.enable_zipfile + + # Legacy Encryption Extensions + tc.variables["SQLITE3MC_USE_SQLEET_LEGACY"] = self.options.use_sqleet_legacy + tc.variables["SQLITE3MC_USE_SQLCIPHER_LEGACY"] = self.options.use_sqlcipher_legacy + + # Additional memory security (filling freed memory allocations with zeros or random data) + tc.variables["SQLITE3MC_SECURE_MEMORY"] = self.options.secure_memory + tc.variables["SQLITE3MC_USE_RANDOM_FILL_MEMORY"] = self.options.use_random_fill_memory + + # Omit AES hardware support + tc.variables["SQLITE3MC_OMIT_AES_HARDWARE_SUPPORT"] = self.options.omit_aes_hardware_support + + 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"), keep_path=False) + + def package_info(self): + if self.options.shared: + self.cpp_info.libs = ["sqlite3mc"] + else: + self.cpp_info.libs = ["sqlite3mc_static"] + if self.settings.os in ("Linux", "FreeBSD", "Macos"): + self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.append("dl") + self.cpp_info.system_libs.append("m") + if self.settings.os == "Macos": + self.cpp_info.frameworks.append("Security") diff --git a/recipes/sqlite3mc/all/test_package/CMakeLists.txt b/recipes/sqlite3mc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..79301e1094eb1 --- /dev/null +++ b/recipes/sqlite3mc/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_sqlite3mc C) + +find_package(sqlite3mc REQUIRED) + +add_executable(${PROJECT_NAME} + main.c +) + +target_link_libraries(${PROJECT_NAME} + sqlite3mc::sqlite3mc +) diff --git a/recipes/sqlite3mc/all/test_package/conanfile.py b/recipes/sqlite3mc/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1b70bb597a5da --- /dev/null +++ b/recipes/sqlite3mc/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class sqlite3mcTest(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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 can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_sqlite3mc") + self.run(cmd, env="conanrun") diff --git a/recipes/sqlite3mc/all/test_package/main.c b/recipes/sqlite3mc/all/test_package/main.c new file mode 100644 index 0000000000000..efb9f3b4c701d --- /dev/null +++ b/recipes/sqlite3mc/all/test_package/main.c @@ -0,0 +1,73 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + sqlite3 *db; + const char *key = "password"; + const char *wrongKey = "wrongPassword"; + + // Create database + int rc = sqlite3_open("test.db", &db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to open database: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + + // Encrypt + sqlite3_key(db, key, strlen(key)); + + // Fill db with some data and close it + rc = sqlite3_exec(db, "CREATE TABLE users (name TEXT NOT NULL, ID INTEGER PRIMARY KEY UNIQUE)", NULL, NULL, NULL); + if (rc != SQLITE_OK) + { + fprintf(stderr, "SQL error: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + rc = sqlite3_exec(db, "INSERT INTO users (name, ID) VALUES ('testUser', '12345')", NULL, NULL, NULL); + if (rc != SQLITE_OK) + { + fprintf(stderr, "SQL error: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + rc = sqlite3_close(db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to close database: %s\n", sqlite3_errmsg(db)); + return 1; + } + + // Reopen and provide wrong key + rc = sqlite3_open("test.db", &db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to open database: %s\n", sqlite3_errmsg(db)); + sqlite3_close(db); + return 1; + } + sqlite3_key(db, wrongKey, strlen(wrongKey)); + + // Try to access the database, should fail + rc = sqlite3_exec(db, "SELECT name FROM users WHERE ID = '12345'", NULL, NULL, NULL); + if (rc == SQLITE_OK) + { + fprintf(stderr, "Access was provided without the proper key\n"); + sqlite3_close(db); + return 1; + } + rc = sqlite3_close(db); + if (rc != SQLITE_OK) + { + fprintf(stderr, "Failed to close database: %s\n", sqlite3_errmsg(db)); + return 1; + } + + + fprintf(stdout, "Test successful\n"); + return 0; +} diff --git a/recipes/sqlite3mc/config.yml b/recipes/sqlite3mc/config.yml new file mode 100644 index 0000000000000..27779974863f1 --- /dev/null +++ b/recipes/sqlite3mc/config.yml @@ -0,0 +1,13 @@ +versions: + "2.1.0": + folder: all + "2.0.2": + folder: all + "1.9.0": + folder: all + "1.8.6": + folder: all + "1.8.4": + folder: all + "1.8.0": + folder: all diff --git a/recipes/sqlite_orm/all/conandata.yml b/recipes/sqlite_orm/all/conandata.yml index b99589eb8062e..320438efc6dc2 100644 --- a/recipes/sqlite_orm/all/conandata.yml +++ b/recipes/sqlite_orm/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.9.1": + url: "https://github.com/fnc12/sqlite_orm/archive/refs/tags/v1.9.1.tar.gz" + sha256: "de2db80e4f716a27c4e1f4cb8a356394e428676c98c90b0577b0431107d3cccf" + "1.9": + url: "https://github.com/fnc12/sqlite_orm/archive/refs/tags/v1.9.tar.gz" + sha256: "a2fa433e24f6873a9e8cd9dd7e49d2d12640b458f3f6f941163cf60f6673b8a2" "1.8.2": url: "https://github.com/fnc12/sqlite_orm/archive/refs/tags/v1.8.2.tar.gz" sha256: "56e0c7729800637a8061658d0fdad4424d2cdde77b063d23cc1b76aa20339072" diff --git a/recipes/sqlite_orm/all/conanfile.py b/recipes/sqlite_orm/all/conanfile.py index 23fa807bf57d5..423e3d770c3c8 100644 --- a/recipes/sqlite_orm/all/conanfile.py +++ b/recipes/sqlite_orm/all/conanfile.py @@ -3,6 +3,7 @@ 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.scm import Version import os required_conan_version = ">=1.52.0" @@ -12,9 +13,9 @@ class SqliteOrmConan(ConanFile): name = "sqlite_orm" description = "SQLite ORM light header only library for modern C++." license = "BSD-3-Clause" - topics = ("sqlite", "sql", "database", "orm") - homepage = "https://github.com/fnc12/sqlite_orm" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/fnc12/sqlite_orm" + topics = ("sqlite", "sql", "database", "orm", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" @@ -25,7 +26,7 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "gcc": "5", + "gcc": "5" if Version(self.version) < "1.9" else "8", "Visual Studio": "14", "msvc": "190", "clang": "3.4", @@ -39,7 +40,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("sqlite3/3.44.2", transitive_headers=True, transitive_libs=True) + self.requires("sqlite3/[>=3.45.0 <4]", transitive_headers=True, transitive_libs=True) def package_id(self): self.info.clear() diff --git a/recipes/sqlite_orm/config.yml b/recipes/sqlite_orm/config.yml index ab20df18e03f0..267ed6dc673db 100644 --- a/recipes/sqlite_orm/config.yml +++ b/recipes/sqlite_orm/config.yml @@ -1,4 +1,8 @@ versions: + "1.9.1": + folder: all + "1.9": + folder: all "1.8.2": folder: all "1.8.1": diff --git a/recipes/sqlitecpp/all/conandata.yml b/recipes/sqlitecpp/all/conandata.yml index a10675f041108..16fbd2738d3e2 100644 --- a/recipes/sqlitecpp/all/conandata.yml +++ b/recipes/sqlitecpp/all/conandata.yml @@ -1,34 +1,10 @@ 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" + "3.3.2": + url: "https://github.com/SRombauts/SQLiteCpp/archive/3.3.2.tar.gz" + sha256: "5aa8eda130d0689bd5ed9b2074714c2dbc610f710483c61ba6cf944cebfe03af" "3.2.1": url: "https://github.com/SRombauts/SQLiteCpp/archive/3.2.1.tar.gz" sha256: "70c67d5680c47460f82a7abf8e6b0329bf2fb10795a982a6d8abc06adb42d693" - "3.2.0": - url: "https://github.com/SRombauts/SQLiteCpp/archive/3.2.0.tar.gz" - sha256: "57f91ed44ef205fe97b8c6586002fe6031cd02771d1c5d8415d9c515ad1532d1" "3.1.1": url: "https://github.com/SRombauts/SQLiteCpp/archive/3.1.1.tar.gz" sha256: "b00b1efad985dd415c3b62b01252cae20d9f2c32dcac435ddd8a105e9d4ddcde" - "2.5.0": - url: "https://github.com/SRombauts/SQLiteCpp/archive/2.5.0.tar.gz" - sha256: "a598a07626ba0cb8bbad7e2f932f204b645eec5cb83e8cd7f0740fcbcce1ba50" - "2.4.0": - url: "https://github.com/SRombauts/SQLiteCpp/archive/2.4.0.tar.gz" - sha256: "16bf963619786652a60533bcdc71a0412cad1ce132cd09ce43344af6ed7463d9" -patches: - "2.5.0": - - patch_file: "patches/2.5.0-0001-cmake-sqlite3.patch" - patch_description: "Fix Sqlite3 CMake target" - patch_type: "conan" - "2.4.0": - - patch_file: "patches/2.4.0-0001-cmake-sqlite3.patch" - patch_description: "Fix Sqlite3 CMake target" - patch_type: "conan" - - patch_file: "patches/2.4.0-0002-mingw-flags.patch" - patch_description: "Fix Mingw compiler flags" - patch_type: "conan" diff --git a/recipes/sqlitecpp/all/conanfile.py b/recipes/sqlitecpp/all/conanfile.py index c0bfff9f89eee..f8bfffcda2645 100644 --- a/recipes/sqlitecpp/all/conanfile.py +++ b/recipes/sqlitecpp/all/conanfile.py @@ -1,14 +1,14 @@ from conan import ConanFile -from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir, save +from conan.tools.files import copy, get, rmdir from conan.tools.scm import Version from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.errors import ConanInvalidConfiguration +from conan.tools.gnu import PkgConfigDeps import os -import textwrap -required_conan_version = ">=1.53" +required_conan_version = ">=2.1" class SQLiteCppConan(ConanFile): @@ -24,33 +24,43 @@ class SQLiteCppConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "stack_protection": [True, False], + "with_sqlcipher": [True, False], } default_options = { "shared": False, "fPIC": True, "stack_protection": True, + "with_sqlcipher": 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) < "3.3.1": + del self.options.with_sqlcipher def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if self.options.get_safe("with_sqlcipher"): + self.options["sqlcipher"].enable_column_metadata = True def requirements(self): - self.requires("sqlite3/3.44.2") + if self.options.get_safe("with_sqlcipher"): + self.requires("sqlcipher/4.6.1") + else: + self.requires("sqlite3/[>=3.45 <4]") def validate(self): - if Version(self.version) >= "3.0.0" and self.info.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + if self.info.settings.os == "Windows" and self.info.options.shared: raise ConanInvalidConfiguration("SQLiteCpp can not be built as shared lib on Windows") - + if self.options.get_safe("with_sqlcipher")and Version(self.version) < "3.3.1": + raise ConanInvalidConfiguration("Using SQLCipher with this recipe is only available from version 3.3.1") + if self.options.get_safe("with_sqlcipher") and not self.dependencies["sqlcipher"].options.enable_column_metadata: + raise ConanInvalidConfiguration(f"{self.ref} option with_sqlcipher=True requires 'sqlcipher/*:enable_column_metadata=True'") + def layout(self): cmake_layout(self, src_folder="src") @@ -58,17 +68,6 @@ def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) - def _patch_sources(self): - apply_conandata_patches(self) - if self.settings.compiler == "clang" and \ - Version(self.settings.compiler.version) < "6.0" and \ - self.settings.compiler.libcxx == "libc++" and \ - Version(self.version) < "3": - replace_in_file(self, - os.path.join(self.source_folder, "include", "SQLiteCpp", "Utils.h"), - "const nullptr_t nullptr = {};", - "") - def generate(self): tc = CMakeToolchain(self) tc.variables["SQLITECPP_INTERNAL_SQLITE"] = False @@ -78,13 +77,17 @@ def generate(self): tc.variables["SQLITECPP_BUILD_EXAMPLES"] = False tc.variables["SQLITECPP_BUILD_TESTS"] = False tc.variables["SQLITECPP_USE_STACK_PROTECTION"] = self.options.stack_protection + tc.variables["SQLITE_HAS_CODEC"] = self.options.get_safe("with_sqlcipher", False) tc.generate() tc = CMakeDeps(self) tc.generate() + if self.options.get_safe("with_sqlcipher"): + pc = PkgConfigDeps(self) + pc.generate() + def build(self): - self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -96,27 +99,6 @@ def package(self): 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( - os.path.join(self.package_folder, self._module_file_rel_path), - {"SQLiteCpp": "SQLiteCpp::SQLiteCpp"} - ) - - 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") - @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler == "gcc" @@ -125,14 +107,11 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "SQLiteCpp") self.cpp_info.set_property("cmake_target_name", "SQLiteCpp") self.cpp_info.libs = ["SQLiteCpp"] + if self.options.get_safe("with_sqlcipher"): + self.cpp_info.defines.append("SQLITE_HAS_CODEC") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "dl", "m"] if self._is_mingw: self.cpp_info.system_libs = ["ssp"] - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "SQLiteCpp" - self.cpp_info.names["cmake_find_package_multi"] = "SQLiteCpp" - 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/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch b/recipes/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch deleted file mode 100644 index dd766533b851d..0000000000000 --- a/recipes/sqlitecpp/all/patches/2.4.0-0001-cmake-sqlite3.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c32724b..096818a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -206,7 +206,7 @@ install(EXPORT ${PROJECT_NAME}Config DESTINATION lib/cmake/${PROJECT_NAME}) - - ## Build provided copy of SQLite3 C library ## - --# TODO -+# TODO - #find_package(sqlite3) - #if(sqlite3_VERSION VERSION_LESS "3.19") - # set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") -@@ -230,6 +230,9 @@ if (SQLITECPP_INTERNAL_SQLITE) - add_subdirectory(sqlite3) - target_include_directories(sqlite3 PUBLIC "${PROJECT_SOURCE_DIR}/sqlite3") - target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3") -+else (SQLITECPP_INTERNAL_SQLITE) -+ find_package(SQLite3 REQUIRED) -+ target_link_libraries(SQLiteCpp PRIVATE SQLite::SQLite3) - endif (SQLITECPP_INTERNAL_SQLITE) - - # Optional additional targets: diff --git a/recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch b/recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch deleted file mode 100644 index 99fa2af08442e..0000000000000 --- a/recipes/sqlitecpp/all/patches/2.4.0-0002-mingw-flags.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 096818a..9e40f9f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -47,7 +47,12 @@ else (MSVC) - set(CPPLINT_ARG_OUTPUT "--output=eclipse") - set(CPPCHECK_ARG_TEMPLATE "--template=gcc") - # Useful compile flags and extra warnings -- add_compile_options(-fstack-protector -Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline) -+ if (MINGW) -+ MESSAGE ( STATUS "Running on MinGW - no -fstack-protector" ) -+ add_compile_options(-Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline) -+ else () -+ add_compile_options(-fstack-protector -Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline) -+ endif () - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++0x-compat") # C++ only - if (CMAKE_COMPILER_IS_GNUCXX) - # GCC flags diff --git a/recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch b/recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch deleted file mode 100644 index d114e32196b48..0000000000000 --- a/recipes/sqlitecpp/all/patches/2.5.0-0001-cmake-sqlite3.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f7e0fbd..146ab01 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -184,7 +184,7 @@ endif (SQLITE_ENABLE_ASSERT_HANDLER) - option(SQLITE_HAS_CODEC "Enable database encryption API. Not available in the public release of SQLite." OFF) - if (SQLITE_HAS_CODEC) - # Enable database encryption API. Requires implementations of sqlite3_key & sqlite3_key_v2. -- # Eg. SQLCipher (libsqlcipher-dev) is an SQLite extension that provides 256 bit AES encryption of database files. -+ # Eg. SQLCipher (libsqlcipher-dev) is an SQLite extension that provides 256 bit AES encryption of database files. - target_compile_definitions(SQLiteCpp PUBLIC SQLITE_HAS_CODEC) - endif (SQLITE_HAS_CODEC) - -@@ -247,10 +247,7 @@ if (SQLITECPP_INTERNAL_SQLITE) - target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3") - else (SQLITECPP_INTERNAL_SQLITE) - find_package (SQLite3 REQUIRED) -- if (SQLITE3_FOUND) -- include_directories(${SQLITE3_INCLUDE_DIRS}) -- target_link_libraries (SQLiteCpp ${SQLITE3_LIBRARIES}) -- endif (SQLITE3_FOUND) -+ target_link_libraries(SQLiteCpp PRIVATE SQLite::SQLite3) - endif (SQLITECPP_INTERNAL_SQLITE) - - # Optional additional targets: diff --git a/recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt b/recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/sqlitecpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/sqlitecpp/all/test_v1_package/conanfile.py b/recipes/sqlitecpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/sqlitecpp/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_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/sqlitecpp/config.yml b/recipes/sqlitecpp/config.yml index b3381f7005ac8..dec70503e13b5 100644 --- a/recipes/sqlitecpp/config.yml +++ b/recipes/sqlitecpp/config.yml @@ -1,15 +1,7 @@ versions: - "3.3.1": - folder: all - "3.3.0": + "3.3.2": folder: all "3.2.1": folder: all - "3.2.0": - folder: all "3.1.1": folder: all - "2.5.0": - folder: all - "2.4.0": - folder: all diff --git a/recipes/sqlitemap/all/conandata.yml b/recipes/sqlitemap/all/conandata.yml new file mode 100644 index 0000000000000..aad89bd4a3394 --- /dev/null +++ b/recipes/sqlitemap/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.0": + url: "https://github.com/bw-hro/sqlitemap/archive/v1.1.0.tar.gz" + sha256: "1a43e0799f95c79fd2633bff1f158fbab99dbd934222fb284e45f34e784faf96" \ No newline at end of file diff --git a/recipes/sqlitemap/all/conanfile.py b/recipes/sqlitemap/all/conanfile.py new file mode 100644 index 0000000000000..c381b51446485 --- /dev/null +++ b/recipes/sqlitemap/all/conanfile.py @@ -0,0 +1,45 @@ +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 = ">=2.0" + + +class PackageConan(ConanFile): + name = "sqlitemap" + description = "sqlitemap - Persistent Map Backed by SQLite" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/bw-hro/sqlitemap" + topics = ("sqlite", "database", "hash map", "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("sqlite3/[>=3.45.0 <4]") + + def package_id(self): + self.info.clear() + + def validate(self): + check_min_cppstd(self, 17) + + 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")) + copy(self, "*", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "sqlitemap") + self.cpp_info.set_property("cmake_target_name", "sqlitemap::sqlitemap") + self.cpp_info.set_property("pkg_config_name", "sqlitemap") + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/sqlitemap/all/test_package/CMakeLists.txt b/recipes/sqlitemap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..795480e776a92 --- /dev/null +++ b/recipes/sqlitemap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(sqlitemap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE sqlitemap::sqlitemap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/sqlitemap/all/test_package/conanfile.py b/recipes/sqlitemap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2e77b4246fa81 --- /dev/null +++ b/recipes/sqlitemap/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" + + 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/sqlitemap/all/test_package/test_package.cpp b/recipes/sqlitemap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f00073e3ae1e8 --- /dev/null +++ b/recipes/sqlitemap/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include + +#include + +int main() +{ + bw::sqlitemap::sqlitemap db(bw::sqlitemap::config().filename(":memory:").table("items")); + db["a"] = "first-item"; + db["b"] = "second-item"; + db["c"] = "third-item"; + db.commit(); + + std::cout << db.to_string() << std::endl; + std::cout << db.size() << " items saved:" << std::endl; + for (const auto &[key, value] : db) + { + std::cout << key << " = " << value << std::endl; + } + return 0; +} \ No newline at end of file diff --git a/recipes/sqlitemap/config.yml b/recipes/sqlitemap/config.yml new file mode 100644 index 0000000000000..b5c0d3cb2d409 --- /dev/null +++ b/recipes/sqlitemap/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.0": + folder: all diff --git a/recipes/sqlpp11/all/test_v1_package/CMakeLists.txt b/recipes/sqlpp11/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/sqlpp11/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 37ada808989d9..0000000000000 --- a/recipes/sqlpp11/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", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/squirrel/all/test_package/CMakeLists.txt b/recipes/squirrel/all/test_package/CMakeLists.txt index 13a7e10ca59c7..e396662ad6065 100644 --- a/recipes/squirrel/all/test_package/CMakeLists.txt +++ b/recipes/squirrel/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(squirrel REQUIRED CONFIG) diff --git a/recipes/squirrel/all/test_v1_package/CMakeLists.txt b/recipes/squirrel/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/squirrel/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/squirrel/all/test_v1_package/conanfile.py b/recipes/squirrel/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/squirrel/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/srt/all/CMakeLists.txt b/recipes/srt/all/CMakeLists.txt deleted file mode 100644 index 591533b782973..0000000000000 --- a/recipes/srt/all/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(CONAN_LIBS_PTHREADS4W) - set(PTHREAD_LIBRARY "${CONAN_LIBS_PTHREADS4W}") - set(PTHREAD_INCLUDE_DIR "${CONAN_INCLUDE_DIRS_PTHREADS4W}") -endif() - -add_subdirectory("source_subfolder") diff --git a/recipes/srt/all/conandata.yml b/recipes/srt/all/conandata.yml index e10fcb414463b..e64f6b682ab00 100644 --- a/recipes/srt/all/conandata.yml +++ b/recipes/srt/all/conandata.yml @@ -1,17 +1,10 @@ sources: - "1.4.1": - sha256: e80ca1cd0711b9c70882c12ec365cda1ba852e1ce8acd43161a21a04de0cbf14 - url: https://github.com/Haivision/srt/archive/v1.4.1.tar.gz - "1.4.2": - sha256: 28a308e72dcbb50eb2f61b50cc4c393c413300333788f3a8159643536684a0c4 - url: https://github.com/Haivision/srt/archive/v1.4.2.tar.gz - "1.4.3": - sha256: c06e05664c71d635c37207a2b5a444f2c4a95950a3548402b3e0c524f735b33d - url: https://github.com/Haivision/srt/archive/refs/tags/v1.4.3.tar.gz + "1.5.4": + url: "https://github.com/Haivision/srt/archive/v1.5.4.tar.gz" + sha256: "d0a8b600fe1b4eaaf6277530e3cfc8f15b8ce4035f16af4a5eb5d4b123640cdd" + "1.5.3": + url: "https://github.com/Haivision/srt/archive/v1.5.3.tar.gz" + sha256: "befaeb16f628c46387b898df02bc6fba84868e86a6f6d8294755375b9932d777" "1.4.4": url: "https://github.com/Haivision/srt/archive/v1.4.4.tar.gz" sha256: "93f5f3715bd5bd522b8d65fc0d086ef2ad49db6a41ad2d7b35df2e8bd7094114" -patches: - "1.4.1": - - patch_file: "patches/no-delayload-libeay32.patch" - base_path: "source_subfolder" diff --git a/recipes/srt/all/conanfile.py b/recipes/srt/all/conanfile.py index dfed1538859cc..d88c4602f0c97 100644 --- a/recipes/srt/all/conanfile.py +++ b/recipes/srt/all/conanfile.py @@ -1,41 +1,36 @@ -from conans import ConanFile, CMake, tools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class SrtConan(ConanFile): name = "srt" - homepage = "https://github.com/Haivision/srt" - description = "Secure Reliable Transport (SRT) is an open source transport technology that optimizes streaming performance across unpredictable networks, such as the Internet." - topics = ("conan", "srt", "ip", "transport") - url = "https://github.com/conan-io/conan-center-index" + description = ( + "Secure Reliable Transport (SRT) is an open source transport technology that optimizes streaming" + " performance across unpredictable networks, such as the Internet." + ) license = "MPL-2.0" - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - short_paths = True - - 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" - - @property - def _has_stdcxx_sync(self): - return tools.Version(self.version) >= "1.4.2" - - @property - def _has_posix_threads(self): - return not (self.settings.os == "Windows" and (self.settings.compiler == "Visual Studio" or \ - (self.settings.compiler == "gcc" and self.settings.compiler.get_safe("threads") == "win32"))) + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Haivision/srt" + topics = ("ip", "transport") + + 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": @@ -43,61 +38,62 @@ 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("openssl/1.1.1q") - if not self._has_posix_threads and not self._has_stdcxx_sync: - self.requires("pthreads4w/3.0.0") + self.requires("openssl/[>=1.1 <4]") 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"), - "set (CMAKE_MODULE_PATH \"${CMAKE_CURRENT_SOURCE_DIR}/scripts\")", - "list(APPEND CMAKE_MODULE_PATH \"${CMAKE_CURRENT_SOURCE_DIR}/scripts\")") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["ENABLE_APPS"] = False - self._cmake.definitions["ENABLE_LOGGING"] = False - self._cmake.definitions["ENABLE_SHARED"] = self.options.shared - self._cmake.definitions["ENABLE_STATIC"] = not self.options.shared - if self._has_stdcxx_sync: - self._cmake.definitions["ENABLE_STDCXX_SYNC"] = True - self._cmake.definitions["ENABLE_ENCRYPTION"] = True - self._cmake.definitions["USE_OPENSSL_PC"] = False - if self.settings.compiler == "Visual Studio": + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_APPS"] = False + tc.variables["ENABLE_LOGGING"] = False + tc.variables["ENABLE_SHARED"] = self.options.shared + tc.variables["ENABLE_STATIC"] = not self.options.shared + tc.variables["ENABLE_STDCXX_SYNC"] = True + tc.variables["ENABLE_ENCRYPTION"] = True + tc.variables["USE_OPENSSL_PC"] = False + if is_msvc(self): # required to avoid warnings when srt shared, even if openssl shared, # otherwise upstream CMakeLists would add /DELAYLOAD:libeay32.dll to link flags - self._cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = True - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.variables["OPENSSL_USE_STATIC_LIBS"] = True + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.5.4": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + 'set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/scripts")', + 'list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/scripts")') 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")) def package_info(self): - self.cpp_info.names["pkg_config"] = "srt" - suffix = "_static" if self.settings.compiler == "Visual Studio" and not self.options.shared else "" + self.cpp_info.set_property("pkg_config_name", "srt") + suffix = "_static" if is_msvc(self) and not self.options.shared else "" self.cpp_info.libs = ["srt" + suffix] if self.options.shared: self.cpp_info.defines = ["SRT_DYNAMIC"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/srt/all/patches/no-delayload-libeay32.patch b/recipes/srt/all/patches/no-delayload-libeay32.patch deleted file mode 100644 index 9916c2deb6bec..0000000000000 --- a/recipes/srt/all/patches/no-delayload-libeay32.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -627,7 +627,11 @@ if (srt_libspec_shared) - endif() - if (MICROSOFT) - target_link_libraries(${TARGET_srt}_shared PRIVATE ws2_32.lib) -- set_target_properties(${TARGET_srt}_shared PROPERTIES LINK_FLAGS "/DELAYLOAD:libeay32.dll") -+ if (OPENSSL_USE_STATIC_LIBS) -+ target_link_libraries(${TARGET_srt}_shared PRIVATE crypt32.lib) -+ else() -+ set_target_properties(${TARGET_srt}_shared PROPERTIES LINK_FLAGS "/DELAYLOAD:libeay32.dll") -+ endif() - elseif (MINGW) - target_link_libraries(${TARGET_srt}_shared PRIVATE wsock32.lib ws2_32.lib) - elseif (APPLE) diff --git a/recipes/srt/all/test_package/CMakeLists.txt b/recipes/srt/all/test_package/CMakeLists.txt index dd27cce4bb0ad..d665f87ea9368 100644 --- a/recipes/srt/all/test_package/CMakeLists.txt +++ b/recipes/srt/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(TARGETS) - -find_package(srt REQUIRED) +find_package(srt REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) target_link_libraries(${CMAKE_PROJECT_NAME} srt::srt) diff --git a/recipes/srt/all/test_package/conanfile.py b/recipes/srt/all/test_package/conanfile.py index 9294e13566895..ef5d7042163ec 100644 --- a/recipes/srt/all/test_package/conanfile.py +++ b/recipes/srt/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/srt/config.yml b/recipes/srt/config.yml index 09ca969e279a3..f91692b34ab25 100644 --- a/recipes/srt/config.yml +++ b/recipes/srt/config.yml @@ -1,9 +1,7 @@ versions: - "1.4.1": + "1.5.4": folder: all - "1.4.2": - folder: all - "1.4.3": + "1.5.3": folder: all "1.4.4": folder: all diff --git a/recipes/ssht/all/CMakeLists.txt b/recipes/ssht/all/CMakeLists.txt index 32d0b43daf801..fe7b1fab8541f 100644 --- a/recipes/ssht/all/CMakeLists.txt +++ b/recipes/ssht/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) include(conanbuildinfo.cmake) diff --git a/recipes/ssp/all/conandata.yml b/recipes/ssp/all/conandata.yml index 72dce2c480ffe..220fd55612197 100644 --- a/recipes/ssp/all/conandata.yml +++ b/recipes/ssp/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.8.0": + url: "https://github.com/red0124/ssp/archive/refs/tags/v1.8.0.tar.gz" + sha256: "a4416746023c8a60f6808200193dd207f1044b6e37e6c5bc0462e85452307d1d" + "1.7.2": + url: "https://github.com/red0124/ssp/archive/refs/tags/v1.7.2.tar.gz" + sha256: "700e05d304fe10f05331d0a963757257632dddc1f9442b826a85efa545c64772" + "1.6.2": + url: "https://github.com/red0124/ssp/archive/refs/tags/v1.6.2.tar.gz" + sha256: "6fa5ae1cd458eae3c1931e8cbcbd8d97956eda37db1388358456ca0743b48b7c" "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 index 16b88f523f6b2..5cb7a535180b4 100644 --- a/recipes/ssp/all/conanfile.py +++ b/recipes/ssp/all/conanfile.py @@ -37,7 +37,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("fast_float/6.0.0") + self.requires("fast_float/6.1.0") def package_id(self): self.info.clear() diff --git a/recipes/ssp/all/test_package/CMakeLists.txt b/recipes/ssp/all/test_package/CMakeLists.txt index 16a9ddec50721..c1b21019ccb9c 100644 --- a/recipes/ssp/all/test_package/CMakeLists.txt +++ b/recipes/ssp/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(ssp REQUIRED CONFIG) diff --git a/recipes/ssp/config.yml b/recipes/ssp/config.yml index bd3f43d241a52..e1c88426892a4 100644 --- a/recipes/ssp/config.yml +++ b/recipes/ssp/config.yml @@ -1,3 +1,9 @@ versions: + "1.8.0": + folder: all + "1.7.2": + folder: all + "1.6.2": + folder: all "1.6.1": folder: all diff --git a/recipes/st_tree/all/test_package/CMakeLists.txt b/recipes/st_tree/all/test_package/CMakeLists.txt index 221a27bafd9ef..e79a6b0c96767 100644 --- a/recipes/st_tree/all/test_package/CMakeLists.txt +++ b/recipes/st_tree/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(st_tree REQUIRED CONFIG) diff --git a/recipes/statistic/all/conandata.yml b/recipes/statistic/all/conandata.yml new file mode 100644 index 0000000000000..c9f570c26cbed --- /dev/null +++ b/recipes/statistic/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.8": + url: "https://github.com/RobTillaart/Statistic/archive/refs/tags/1.0.8.tar.gz" + sha256: "44ed39d05fb9280ad88e88d732805a228a69110fac6d1377bcf64cc84a363241" diff --git a/recipes/statistic/all/conanfile.py b/recipes/statistic/all/conanfile.py new file mode 100644 index 0000000000000..612fd3e02ff8c --- /dev/null +++ b/recipes/statistic/all/conanfile.py @@ -0,0 +1,52 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + +class StatisticConan(ConanFile): + name = "statistic" + description = "Statistic library for Arduino includes sum, average, variance and std deviation" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/RobTillaart/Statistic" + topics = ("arduino", "statistics", "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 is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support Visual Studio") + 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", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "Statistic.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/statistic/all/test_package/CMakeLists.txt b/recipes/statistic/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9b9900a401fc1 --- /dev/null +++ b/recipes/statistic/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(statistic REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE statistic::statistic) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/statistic/all/test_package/conanfile.py b/recipes/statistic/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/statistic/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/statistic/all/test_package/test_package.cpp b/recipes/statistic/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..185ea7dc94706 --- /dev/null +++ b/recipes/statistic/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#if defined __has_include && __has_include() +# define HAVE_STDCXX_LIMITS 1 +#endif +#include "Statistic.h" + +int main(void) { + statistic::Statistic myStats; + + for (int i = 0; i < 10; i++) { + myStats.add(i); + } + std::cout << myStats.count() << std::endl; + std::cout << myStats.average() << std::endl; + std::cout << myStats.variance() << std::endl; + std::cout << myStats.minimum() << std::endl; + std::cout << myStats.maximum() << std::endl; + + return 0; +} diff --git a/recipes/statistic/config.yml b/recipes/statistic/config.yml new file mode 100644 index 0000000000000..28e3ee22ca8ac --- /dev/null +++ b/recipes/statistic/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.8": + folder: all diff --git a/recipes/statslib/all/test_package/CMakeLists.txt b/recipes/statslib/all/test_package/CMakeLists.txt index 94c3b5a1feecb..1efb48de93bfe 100644 --- a/recipes/statslib/all/test_package/CMakeLists.txt +++ b/recipes/statslib/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(statslib CONFIG REQUIRED) diff --git a/recipes/statslib/all/test_v1_package/CMakeLists.txt b/recipes/statslib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/statslib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/statslib/all/test_v1_package/conanfile.py b/recipes/statslib/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/statslib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/status-code/all/conandata.yml b/recipes/status-code/all/conandata.yml index 49b0985bc39b6..70939803c28aa 100644 --- a/recipes/status-code/all/conandata.yml +++ b/recipes/status-code/all/conandata.yml @@ -2,3 +2,6 @@ sources: "cci.20220616": url: "https://github.com/ned14/status-code/archive/38e1e862386cb38d577664fd681ef829b0e03fba.tar.gz" sha256: "faf112df1633a1ee1f58c8b056130154b7c0dbf12e7f006a04dc376500d271c3" + "cci.20240614": + url: "https://github.com/ned14/status-code/archive/a6689afceb19ed127ec4a828dcf1597102e6c02d.tar.gz" + sha256: "f9725675f9d124d2223f9554f11a7f9dcb4893ea2b8a73bd3f7b182f23ba26ca" diff --git a/recipes/status-code/all/conanfile.py b/recipes/status-code/all/conanfile.py index ba9f0306e38c0..9e9d6e1e369a2 100644 --- a/recipes/status-code/all/conanfile.py +++ b/recipes/status-code/all/conanfile.py @@ -53,3 +53,7 @@ def package_info(self): # See https://github.com/ned14/status-code/blob/38e1e862386cb38d577664fd681ef829b0e03fba/CMakeLists.txt#L126 self.cpp_info.set_property("cmake_file_name", "status-code") self.cpp_info.set_property("cmake_target_name", "status-code::hl") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.components["hl"].names["cmake_find_package"] = "hl" + self.cpp_info.components["hl"].names["cmake_find_package_multi"] = "hl" diff --git a/recipes/status-code/all/test_package/test_package.cpp b/recipes/status-code/all/test_package/test_package.cpp index a2a617bc7f941..ac3726f0591c8 100644 --- a/recipes/status-code/all/test_package/test_package.cpp +++ b/recipes/status-code/all/test_package/test_package.cpp @@ -1,4 +1,8 @@ -#include +#if __has_include() +# include +#else +# include +#endif int main() { system_error2::system_code sc; diff --git a/recipes/status-code/all/test_v1_package/CMakeLists.txt b/recipes/status-code/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 378dd67690afd..0000000000000 --- a/recipes/status-code/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -# Just a workaround to not supprt the deprecated generators while passing the 1.x hooks -find_package(status-code CONFIG REQUIRED) -add_library(status-code::hl ALIAS status-code::status-code) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/status-code/all/test_v1_package/conanfile.py b/recipes/status-code/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/status-code/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/status-code/config.yml b/recipes/status-code/config.yml index 484ac289f9edf..9cd6d00352fb6 100644 --- a/recipes/status-code/config.yml +++ b/recipes/status-code/config.yml @@ -1,3 +1,5 @@ versions: "cci.20220616": folder: all + "cci.20240614": + folder: all diff --git a/recipes/status-value-lite/all/test_package/CMakeLists.txt b/recipes/status-value-lite/all/test_package/CMakeLists.txt index 624779ea603b1..800a1ecc07921 100644 --- a/recipes/status-value-lite/all/test_package/CMakeLists.txt +++ b/recipes/status-value-lite/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(status-value-lite REQUIRED CONFIG) diff --git a/recipes/status-value-lite/all/test_v1_package/CMakeLists.txt b/recipes/status-value-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index ed3eb47f85dd6..0000000000000 --- a/recipes/status-value-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(status-value-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::status-value-lite) diff --git a/recipes/status-value-lite/all/test_v1_package/conanfile.py b/recipes/status-value-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/status-value-lite/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_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/stb/all/conandata.yml b/recipes/stb/all/conandata.yml index c0c0739831fe0..1fad76276ca33 100644 --- a/recipes/stb/all/conandata.yml +++ b/recipes/stb/all/conandata.yml @@ -1,16 +1,13 @@ sources: + "cci.20240531": + url: "https://github.com/nothings/stb/archive/013ac3beddff3dbffafd5177e7972067cd2b5083.zip" + sha256: "b7f476902bbef1b30f8ecc2d9d95c459c32302c8b559d09b589b5955463b7af8" + "cci.20240213": + url: "https://github.com/nothings/stb/archive/ae721c50eaf761660b4f90cc590453cdb0c2acd0.zip" + sha256: "5d075769721e676746d0c25b698a0f00741f68252f9ab4b7ee245c513aeec3de" "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" - "cci.20210910": - url: "https://github.com/nothings/stb/archive/af1a5bc352164740c1cc1354942b1c6b72eacb8a.zip" - sha256: "e3d0edbecd356506d3d69b87419de2f9d180a98099134c6343177885f6c2cbef" - "cci.20210713": - url: "https://github.com/nothings/stb/archive/3a1174060a7dd4eb652d4e6854bc4cd98c159200.zip" - sha256: "9313f6871195b97771ce7da1feae0b3d92c7936456f13099edb54a78096ca93c" - "cci.20200203": - url: "https://github.com/nothings/stb/archive/0224a44a10564a214595797b4c88323f79a5f934.zip" - sha256: "5dd9cf8a9a8c0f253fad3e9904923b2dfc740eddbc86415c3f76152bd534f23a" diff --git a/recipes/stb/all/conanfile.py b/recipes/stb/all/conanfile.py index 7c777ca96ad4c..c1669e45a6c47 100644 --- a/recipes/stb/all/conanfile.py +++ b/recipes/stb/all/conanfile.py @@ -10,10 +10,10 @@ class StbConan(ConanFile): name = "stb" description = "single-file public domain libraries for C/C++" - topics = ("stb", "single-file") + license = ("Unlicense", "MIT") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/nothings/stb" - license = ("Unlicense", "MIT") + topics = ("stb", "single-file", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True @@ -51,9 +51,6 @@ def package_id(self): 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, "*.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include")) diff --git a/recipes/stb/all/test_package/CMakeLists.txt b/recipes/stb/all/test_package/CMakeLists.txt index 0f7be22180d6c..8b15095697fba 100644 --- a/recipes/stb/all/test_package/CMakeLists.txt +++ b/recipes/stb/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(stb REQUIRED CONFIG) diff --git a/recipes/stb/all/test_v1_package/CMakeLists.txt b/recipes/stb/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/stb/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/stb/all/test_v1_package/conanfile.py b/recipes/stb/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/stb/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_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/stb/config.yml b/recipes/stb/config.yml index a0248de0acece..ea0f41f79734d 100644 --- a/recipes/stb/config.yml +++ b/recipes/stb/config.yml @@ -1,11 +1,9 @@ versions: - "cci.20230920": - folder: all - "cci.20220909": + "cci.20240531": folder: all - "cci.20210910": + "cci.20240213": folder: all - "cci.20210713": + "cci.20230920": folder: all - "cci.20200203": + "cci.20220909": folder: all diff --git a/recipes/stc/all/test_package/CMakeLists.txt b/recipes/stc/all/test_package/CMakeLists.txt index 83d4a89b6f090..59df05b26b0f6 100644 --- a/recipes/stc/all/test_package/CMakeLists.txt +++ b/recipes/stc/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 C) find_package(stc REQUIRED CONFIG) diff --git a/recipes/stc/all/test_v1_package/CMakeLists.txt b/recipes/stc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/stc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/stc/all/test_v1_package/conanfile.py b/recipes/stc/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/stc/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_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/stduuid/all/test_package/CMakeLists.txt b/recipes/stduuid/all/test_package/CMakeLists.txt index f8d4ca0bfacfc..f32f912d0e2cf 100644 --- a/recipes/stduuid/all/test_package/CMakeLists.txt +++ b/recipes/stduuid/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(stduuid REQUIRED CONFIG) diff --git a/recipes/stduuid/all/test_v1_package/CMakeLists.txt b/recipes/stduuid/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/stduuid/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/stduuid/all/test_v1_package/conanfile.py b/recipes/stduuid/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/stduuid/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_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/stella-cv-fbow/all/conandata.yml b/recipes/stella-cv-fbow/all/conandata.yml new file mode 100644 index 0000000000000..54c56ba718ab0 --- /dev/null +++ b/recipes/stella-cv-fbow/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240508": + url: "https://github.com/stella-cv/FBoW/archive/c6e3c29e3332a0b0834021797e2aa4e8eb66a3c1.zip" + sha256: "23d866d86eaca6a85da8fe3e542b94324d5f6be4b37691cf82cd74a6cfd838bd" diff --git a/recipes/stella-cv-fbow/all/conanfile.py b/recipes/stella-cv-fbow/all/conanfile.py new file mode 100644 index 0000000000000..14eb8529d8c92 --- /dev/null +++ b/recipes/stella-cv-fbow/all/conanfile.py @@ -0,0 +1,127 @@ +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, replace_in_file + +required_conan_version = ">=1.53.0" + + +class StellaCvFbowConan(ConanFile): + name = "stella-cv-fbow" + description = "FBoW (Fast Bag of Words) is an extremely optimized version of the DBoW2/DBoW3 libraries." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/stella-cv/FBoW" + topics = ("bag-of-words", "computer-vision", "visual-slam", "dbow") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "fast_math": [True, False], + "avx": [True, False], + "mmx": [True, False], + "sse": [True, False], + "sse2": [True, False], + "sse3": [True, False], + "sse4": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "fast_math": True, + "avx": True, + "mmx": True, + "sse": True, + "sse2": True, + "sse3": True, + "sse4": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if self.settings.arch not in ["x86", "x86_64"] or self.settings.compiler not in ["gcc", "clang", "apple-clang"]: + del self.options.avx + del self.options.mmx + del self.options.sse + del self.options.sse2 + del self.options.sse3 + del self.options.sse4 + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # https://github.com/stella-cv/FBoW/blob/master/include/fbow/vocabulary.h#L35 + self.requires("opencv/4.9.0", transitive_headers=True, transitive_libs=True) + self.requires("llvm-openmp/17.0.6") + + 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.variables["USE_FAST_MATH"] = self.options.fast_math + tc.variables["USE_AVX"] = self.options.get_safe("avx", False) + tc.variables["USE_MMX"] = self.options.get_safe("mmx", False) + tc.variables["USE_SSE"] = self.options.get_safe("sse", False) + tc.variables["USE_SSE2"] = self.options.get_safe("sse2", False) + tc.variables["USE_SSE3"] = self.options.get_safe("sse3", False) + tc.variables["USE_SSE4"] = self.options.get_safe("sse4", False) + tc.variables["BUILD_UTILS"] = False + tc.variables["BUILD_TESTS"] = False + tc.variables["USE_CONTRIB"] = self.dependencies["opencv"].options.xfeatures2d + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + # Let Conan set the C++ standard + if self.settings.compiler.cppstd: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD 11)", "") + + 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, "share")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "fbow") + self.cpp_info.set_property("cmake_target_name", "fbow::fbow") + # unofficial + self.cpp_info.set_property("pkg_config_name", "fbow") + + self.cpp_info.libs = ["fbow"] + self.cpp_info.requires = [ + "opencv::opencv_core", + "opencv::opencv_features2d", + "opencv::opencv_highgui", + "llvm-openmp::llvm-openmp", + ] + if self.dependencies["opencv"].options.xfeatures2d: + self.cpp_info.requires.append("opencv::opencv_xfeatures2d") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/stella-cv-fbow/all/test_package/CMakeLists.txt b/recipes/stella-cv-fbow/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..825104df78ead --- /dev/null +++ b/recipes/stella-cv-fbow/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(fbow REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE fbow::fbow) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/stella-cv-fbow/all/test_package/conanfile.py b/recipes/stella-cv-fbow/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/stella-cv-fbow/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/stella-cv-fbow/all/test_package/test_package.cpp b/recipes/stella-cv-fbow/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..f51d557796902 --- /dev/null +++ b/recipes/stella-cv-fbow/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() { + auto features = fbow::cpu(); + features.detect_host(); + std::cout << "CPU Vendor String: " << fbow::cpu::get_vendor_string() << '\n'; + std::cout << "64-bit = " << features.OS_x64 << '\n'; +} diff --git a/recipes/stella-cv-fbow/config.yml b/recipes/stella-cv-fbow/config.yml new file mode 100644 index 0000000000000..ea26172cf981e --- /dev/null +++ b/recipes/stella-cv-fbow/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240508": + folder: all diff --git a/recipes/strawberryperl/all/conandata.yml b/recipes/strawberryperl/all/conandata.yml index 5d11e843fb992..60e5c1e798dfe 100644 --- a/recipes/strawberryperl/all/conandata.yml +++ b/recipes/strawberryperl/all/conandata.yml @@ -1,4 +1,12 @@ sources: + "5.40.2.1": + x86_64: + url: "https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54021_64bit_UCRT/strawberry-perl-5.40.2.1-64bit-portable.zip" + sha256: "7707700d5ad027773b775134fe48cd9610abf221433fcfb68c8eb0ec9c6fde8c" + "5.38.2.2": + x86_64: + url: "https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_53822_64bit/strawberry-perl-5.38.2.2-64bit-portable.zip" + sha256: "ea451686065d6338d7e4d4a04c9af49f17951d15aa4c2e19ab8cb56fa2373440" "5.32.1.1": x86: url: "https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-32bit-portable.zip" diff --git a/recipes/strawberryperl/all/conanfile.py b/recipes/strawberryperl/all/conanfile.py index e5d600869e82f..f6b47f3dd18e0 100644 --- a/recipes/strawberryperl/all/conanfile.py +++ b/recipes/strawberryperl/all/conanfile.py @@ -14,6 +14,7 @@ class StrawberryPerlConan(ConanFile): homepage = "http://strawberryperl.com" url = "https://github.com/conan-io/conan-center-index" topics = ("perl", "interpreter", "windows") + package_type = "application" settings = "os", "arch", "compiler", "build_type" def layout(self): @@ -24,8 +25,10 @@ def package_id(self): del self.info.settings.build_type def validate(self): - if self.info.settings.os != "Windows": - raise ConanInvalidConfiguration("Strawberry Perl is only intended to be used on Windows.") + if self.settings.os != "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is only intended to be used on Windows.") + if self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration(f"{self.ref} is only available for x86 and x86_64 architectures.") def source(self): pass diff --git a/recipes/strawberryperl/all/test_v1_package/conanfile.py b/recipes/strawberryperl/all/test_v1_package/conanfile.py deleted file mode 100644 index 641d8fdb8a176..0000000000000 --- a/recipes/strawberryperl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,12 +0,0 @@ -import os -from conans import ConanFile, tools - - -class DefaultNameConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - if not tools.cross_building(self): - self.run("perl --version", run_environment=True) - perl_script = os.path.join(self.source_folder, os.pardir, "test_package", "list_files.pl") - self.run(f"perl {perl_script}", run_environment=True) diff --git a/recipes/strawberryperl/config.yml b/recipes/strawberryperl/config.yml index 11c21ecefe1e6..db2f165d2d42c 100644 --- a/recipes/strawberryperl/config.yml +++ b/recipes/strawberryperl/config.yml @@ -1,4 +1,8 @@ versions: + "5.40.2.1": + folder: all + "5.38.2.2": + folder: all "5.32.1.1": folder: all "5.30.0.1": diff --git a/recipes/streaming-percentiles/all/conandata.yml b/recipes/streaming-percentiles/all/conandata.yml new file mode 100644 index 0000000000000..475aaed46b221 --- /dev/null +++ b/recipes/streaming-percentiles/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.1.0": + url: "https://github.com/sengelha/streaming-percentiles/archive/refs/tags/v3.1.0.tar.gz" + sha256: "196d76a7d7ce1bcdb6f720b1c2d8feb1cda62ac18cc6412f8bd907e4eafbab6c" +patches: + "3.1.0": + - patch_file: "patches/3.1.0-0001-add-includes.patch" + patch_description: "include missing headers (already applied to upstream)" + patch_type: "backport" + patch_source: "https://github.com/sengelha/streaming-percentiles/commit/058037eca3e05fafa1b53071137f3c168a9fdd92" diff --git a/recipes/streaming-percentiles/all/conanfile.py b/recipes/streaming-percentiles/all/conanfile.py new file mode 100644 index 0000000000000..6b5b0813aa365 --- /dev/null +++ b/recipes/streaming-percentiles/all/conanfile.py @@ -0,0 +1,54 @@ +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.layout import basic_layout +from conan.tools.build import check_min_cppstd +import os + +required_conan_version = ">=1.52.0" + +class StreamingPercentilesConan(ConanFile): + name = "streaming-percentiles" + description = "Cross-platform, multi-language implementation of multiple streaming percentile algorithms" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/sengelha/streaming-percentiles" + topics = ("streaming", "percentiles", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + 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 package_id(self): + 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 build(self): + apply_conandata_patches(self) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "cpp", "src"), + self.package_folder, + ) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/streaming-percentiles/all/patches/3.1.0-0001-add-includes.patch b/recipes/streaming-percentiles/all/patches/3.1.0-0001-add-includes.patch new file mode 100644 index 0000000000000..8c015b7b047b4 --- /dev/null +++ b/recipes/streaming-percentiles/all/patches/3.1.0-0001-add-includes.patch @@ -0,0 +1,62 @@ +diff --git a/cpp/src/include/stmpct/ckms_hbq.hpp b/cpp/src/include/stmpct/ckms_hbq.hpp +index 87cf860..850d527 100644 +--- a/cpp/src/include/stmpct/ckms_hbq.hpp ++++ b/cpp/src/include/stmpct/ckms_hbq.hpp +@@ -4,6 +4,7 @@ + // quantiles as defined in the paper _Effective Computation of Biased + // Quantiles over Data Streams_ + ++#include + #include "ckms_impl.hpp" + + namespace stmpct { +diff --git a/cpp/src/include/stmpct/ckms_lbq.hpp b/cpp/src/include/stmpct/ckms_lbq.hpp +index fb932af..c62d61d 100644 +--- a/cpp/src/include/stmpct/ckms_lbq.hpp ++++ b/cpp/src/include/stmpct/ckms_lbq.hpp +@@ -4,6 +4,7 @@ + // quantiles as defined in the paper _Effective Computation of Biased + // Quantiles over Data Streams_ + ++#include + #include "ckms_impl.hpp" + + namespace stmpct { +diff --git a/cpp/src/include/stmpct/ckms_tq.hpp b/cpp/src/include/stmpct/ckms_tq.hpp +index ac9dde8..5d1f093 100644 +--- a/cpp/src/include/stmpct/ckms_tq.hpp ++++ b/cpp/src/include/stmpct/ckms_tq.hpp +@@ -4,6 +4,8 @@ + // quantiles as defined in the paper _Effective Computation of Biased + // Quantiles over Data Streams_ + ++#include ++#include + #include "ckms_impl.hpp" + #include "targeted_quantile.hpp" + +diff --git a/cpp/src/include/stmpct/ckms_uq.hpp b/cpp/src/include/stmpct/ckms_uq.hpp +index d0d3837..c417ddc 100644 +--- a/cpp/src/include/stmpct/ckms_uq.hpp ++++ b/cpp/src/include/stmpct/ckms_uq.hpp +@@ -5,6 +5,7 @@ + // Quantiles over Data Streams_. Conceptually nearly equivalent to + // the GK algorithm. + ++#include + #include "ckms_impl.hpp" + + namespace stmpct { +diff --git a/cpp/src/include/stmpct/gk.hpp b/cpp/src/include/stmpct/gk.hpp +index 6b7a1c6..bf4e163 100644 +--- a/cpp/src/include/stmpct/gk.hpp ++++ b/cpp/src/include/stmpct/gk.hpp +@@ -1,6 +1,8 @@ + #pragma once + ++#include + #include ++#include + + // The Greenwald-Khanna algorithm as defined in the paper + // Space-Efficient Online Computation of Quantile Summaries diff --git a/recipes/streaming-percentiles/all/test_package/CMakeLists.txt b/recipes/streaming-percentiles/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0259c93280ffb --- /dev/null +++ b/recipes/streaming-percentiles/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(streaming-percentiles REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE streaming-percentiles::streaming-percentiles) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/streaming-percentiles/all/test_package/conanfile.py b/recipes/streaming-percentiles/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/streaming-percentiles/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/streaming-percentiles/all/test_package/test_package.cpp b/recipes/streaming-percentiles/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6bead07a3dd0f --- /dev/null +++ b/recipes/streaming-percentiles/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include + +#include "stmpct/gk.hpp" +int main(int argc, char* argv[]) { + double epsilon = 0.1; + stmpct::gk g(epsilon); + for (int i = 0; i < 1000; ++i) + g.insert(rand()); + double p50 = g.quantile(0.5); // Approx. median + double p95 = g.quantile(0.95); // Approx. 95th percentile + + std::cout << "median : " << p50 << " 95th percentile : " << p95 << std::endl; + + return 0; +} diff --git a/recipes/streaming-percentiles/config.yml b/recipes/streaming-percentiles/config.yml new file mode 100644 index 0000000000000..baa80af0c4b7d --- /dev/null +++ b/recipes/streaming-percentiles/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.0": + folder: all diff --git a/recipes/streamvbyte/all/conandata.yml b/recipes/streamvbyte/all/conandata.yml index 6ecc44a071052..98e479e0331d6 100644 --- a/recipes/streamvbyte/all/conandata.yml +++ b/recipes/streamvbyte/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.0": + url: "https://github.com/lemire/streamvbyte/archive/refs/tags/v2.0.0.tar.gz" + sha256: "51ca1c3b02648ea4b965d65b0e586891981f2e8184b056520e38ad70bcc43dd8" "1.0.0": url: "https://github.com/lemire/streamvbyte/archive/refs/tags/v1.0.0.tar.gz" sha256: "6b1920e9865146ba444cc317aa61cd39cdf760236e354ef7956011a9fe577882" diff --git a/recipes/streamvbyte/config.yml b/recipes/streamvbyte/config.yml index 40341aa3db6cd..870fb33e55af0 100644 --- a/recipes/streamvbyte/config.yml +++ b/recipes/streamvbyte/config.yml @@ -1,3 +1,5 @@ versions: + "2.0.0": + folder: all "1.0.0": folder: all diff --git a/recipes/string-view-lite/all/conandata.yml b/recipes/string-view-lite/all/conandata.yml index 84f246b4d8a4d..49123d0095698 100644 --- a/recipes/string-view-lite/all/conandata.yml +++ b/recipes/string-view-lite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.0": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.8.0.tar.gz" + sha256: "9b38c32621eb1a81a7fa59427144309225c414a7bae522ab3a2d9ae239dd35be" "1.7.0": url: "https://github.com/martinmoene/string-view-lite/archive/v1.7.0.tar.gz" sha256: "265eaec08c4555259b46f5b03004dbc0f7206384edfac1cd5a837efaa642e01c" diff --git a/recipes/string-view-lite/all/conanfile.py b/recipes/string-view-lite/all/conanfile.py index 3306dff001e24..05850dbb27134 100644 --- a/recipes/string-view-lite/all/conanfile.py +++ b/recipes/string-view-lite/all/conanfile.py @@ -8,11 +8,11 @@ class StringViewLite(ConanFile): name = "string-view-lite" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/martinmoene/string-view-lite" description = "string-view lite - A C++17-like string_view for C++98, C++11 and later in a single-file header-only library" - topics = ("cpp98", "cpp11", "cpp14", "cpp17", "string-view", "string-view-implementations") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/martinmoene/string-view-lite" + topics = ("cpp98", "cpp11", "cpp14", "cpp17", "string-view", "string-view-implementations", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/string-view-lite/all/test_package/CMakeLists.txt b/recipes/string-view-lite/all/test_package/CMakeLists.txt index a4c0c42072ea0..38bb967160f59 100644 --- a/recipes/string-view-lite/all/test_package/CMakeLists.txt +++ b/recipes/string-view-lite/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(string-view-lite REQUIRED CONFIG) diff --git a/recipes/string-view-lite/all/test_v1_package/CMakeLists.txt b/recipes/string-view-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 16690fb612bcb..0000000000000 --- a/recipes/string-view-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(string-view-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::string-view-lite) diff --git a/recipes/string-view-lite/all/test_v1_package/conanfile.py b/recipes/string-view-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/string-view-lite/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_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/string-view-lite/config.yml b/recipes/string-view-lite/config.yml index f05245374fbdd..4a0cc99434665 100644 --- a/recipes/string-view-lite/config.yml +++ b/recipes/string-view-lite/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.0": + folder: all "1.7.0": folder: all "1.6.0": diff --git a/recipes/stringzilla/all/conandata.yml b/recipes/stringzilla/all/conandata.yml index 63892a4c139d3..d78062b63415b 100644 --- a/recipes/stringzilla/all/conandata.yml +++ b/recipes/stringzilla/all/conandata.yml @@ -1,4 +1,28 @@ sources: + "3.11.3": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v3.11.3.tar.gz" + sha256: "8ca47c1f1bb8ba67a89c54951fff08483087fa637a43941de1a44fb04a2ba83e" + "3.10.3": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v3.10.3.tar.gz" + sha256: "8a19b5a8e24f4160dc8d00e77a308a75462c3d211c0879ac218887bb41d26ce6" + "3.10.0": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v3.10.0.tar.gz" + sha256: "69729a1403c4609256f861a0221e5331f836b4945f6848472e81183726e436e6" + "3.9.6": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v3.9.6.tar.gz" + sha256: "21577e967d79155f5bcbe9bfd885dd817a79666f384fb2a955c0ac5dbf0657a3" + "3.9.3": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v3.9.3.tar.gz" + sha256: "7d24a2fc0e426a85eac0a2be965f64e0eee794d89a895c2b5dcb614b038af580" + "3.9.0": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v3.9.0.tar.gz" + sha256: "26d282b7d5ba307de7fa80c41821526babf6c6cb8e808253af8bff7664275d5c" + "3.8.4": + url: "https://github.com/ashvardanian/StringZilla/archive/refs/tags/v3.8.4.tar.gz" + sha256: "4132957633d28ce2651e587f2ab736cdf174e61b8ab1bcef453b21d40a2d872e" + "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" diff --git a/recipes/stringzilla/all/conanfile.py b/recipes/stringzilla/all/conanfile.py index bded9fa3b6426..af7a34cd5d72b 100644 --- a/recipes/stringzilla/all/conanfile.py +++ b/recipes/stringzilla/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 import os required_conan_version = ">=1.52.0" @@ -36,12 +37,26 @@ def source(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, "stringzilla"), - ) + if Version(self.version) < "3.0.0": + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "stringzilla"), + ) + else: + copy( + self, + pattern="*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include"), + ) + 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 = [] diff --git a/recipes/stringzilla/all/test_package/CMakeLists.txt b/recipes/stringzilla/all/test_package/CMakeLists.txt index 6769ff716eab8..5bcb77f146e86 100644 --- a/recipes/stringzilla/all/test_package/CMakeLists.txt +++ b/recipes/stringzilla/all/test_package/CMakeLists.txt @@ -3,9 +3,12 @@ project(test_package LANGUAGES CXX) find_package(stringzilla REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) +if (stringzilla_VERSION VERSION_LESS 2.0) + add_executable(${PROJECT_NAME} test_package.cpp) +elseif(stringzilla_VERSION VERSION_LESS 3.0) + add_executable(${PROJECT_NAME} test_package_2_0.cpp) +else() + add_executable(${PROJECT_NAME} test_package_3_0.cpp) +endif() 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 index 3a91c9439218e..dd09e74d7fe14 100644 --- a/recipes/stringzilla/all/test_package/conanfile.py +++ b/recipes/stringzilla/all/test_package/conanfile.py @@ -1,6 +1,6 @@ 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, cmake_layout import os diff --git a/recipes/stringzilla/all/test_package/test_package.cpp b/recipes/stringzilla/all/test_package/test_package.cpp index c5ffe699dbc06..6829d24ab3783 100644 --- a/recipes/stringzilla/all/test_package/test_package.cpp +++ b/recipes/stringzilla/all/test_package/test_package.cpp @@ -1,8 +1,7 @@ #include #include -#include "stringzilla.h" -#ifdef STRINGZILLA_LESS_2_0 +#include "stringzilla.h" int main(void) { // Initialize your haystack and needle @@ -24,29 +23,3 @@ int main(void) { 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/all/test_package/test_package_2_0.cpp b/recipes/stringzilla/all/test_package/test_package_2_0.cpp new file mode 100644 index 0000000000000..c165ef341d114 --- /dev/null +++ b/recipes/stringzilla/all/test_package/test_package_2_0.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include "stringzilla.h" + +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; +} diff --git a/recipes/stringzilla/all/test_package/test_package_3_0.cpp b/recipes/stringzilla/all/test_package/test_package_3_0.cpp new file mode 100644 index 0000000000000..04385a3492e0c --- /dev/null +++ b/recipes/stringzilla/all/test_package/test_package_3_0.cpp @@ -0,0 +1,20 @@ +#include +#include + +#include "stringzilla/stringzilla.hpp" + +namespace sz = ashvardanian::stringzilla; + +int main(void) { + sz::string haystack = "some string"; + sz::string_view needle = sz::string_view(haystack).substr(0, 4); + + auto substring_position = haystack.find(needle); // Or `rfind` + + haystack.end() - haystack.begin() == haystack.size(); // Or `rbegin`, `rend` + haystack.find_first_of(" \v\t") == 4; // Or `find_last_of`, `find_first_not_of`, `find_last_not_of` + haystack.starts_with(needle) == true; // Or `ends_with` + haystack.remove_prefix(needle.size()); // Why is this operation in-place?! + + return EXIT_SUCCESS; +} diff --git a/recipes/stringzilla/config.yml b/recipes/stringzilla/config.yml index bb807cfa42498..b9b5e695863d0 100644 --- a/recipes/stringzilla/config.yml +++ b/recipes/stringzilla/config.yml @@ -1,4 +1,20 @@ versions: + "3.11.3": + folder: all + "3.10.3": + folder: all + "3.10.0": + folder: all + "3.9.6": + folder: all + "3.9.3": + folder: all + "3.9.0": + folder: all + "3.8.4": + folder: all + "2.0.4": + folder: all "2.0.3": folder: all "2.0.1": diff --git a/recipes/strong_type/all/conandata.yml b/recipes/strong_type/all/conandata.yml index 6f362b86eb346..f9c56ef18c867 100644 --- a/recipes/strong_type/all/conandata.yml +++ b/recipes/strong_type/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "v15": + url: "https://github.com/rollbear/strong_type/archive/refs/tags/v15.tar.gz" + sha256: "d445398d4c4d6795060ac2b60be146b3cd7e6039985244b2d56f9bc333f20bae" + "v14": + url: "https://github.com/rollbear/strong_type/archive/refs/tags/v14.tar.gz" + sha256: "6cc5a6f8de5b52e6c9e4c8b246b6052b5943d6de9b314660009e092af522d2fc" "v13": url: "https://github.com/rollbear/strong_type/archive/refs/tags/v13.tar.gz" sha256: "96a799dff6ed8d83040703c6f79162fc5ddf13d1aea4e56ce456736a30e07c5a" diff --git a/recipes/strong_type/all/test_package/CMakeLists.txt b/recipes/strong_type/all/test_package/CMakeLists.txt index d668b94ccc776..6161c8a8866a5 100644 --- a/recipes/strong_type/all/test_package/CMakeLists.txt +++ b/recipes/strong_type/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(strong_type REQUIRED CONFIG) diff --git a/recipes/strong_type/all/test_v1_package/CMakeLists.txt b/recipes/strong_type/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 1690306012889..0000000000000 --- a/recipes/strong_type/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(strong_type REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE rollbear::strong_type) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/strong_type/all/test_v1_package/conanfile.py b/recipes/strong_type/all/test_v1_package/conanfile.py deleted file mode 100644 index a500b98343c74..0000000000000 --- a/recipes/strong_type/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/strong_type/config.yml b/recipes/strong_type/config.yml index cf589fbd0a896..b91eac17af3a4 100644 --- a/recipes/strong_type/config.yml +++ b/recipes/strong_type/config.yml @@ -1,4 +1,8 @@ versions: + "v15": + folder: all + "v14": + folder: all "v13": folder: all "v12": diff --git a/recipes/structopt/all/test_v1_package/CMakeLists.txt b/recipes/structopt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/structopt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/structopt/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", "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/svector/all/test_package/CMakeLists.txt b/recipes/svector/all/test_package/CMakeLists.txt index 38ea734d2c8a7..2a100938dadd1 100644 --- a/recipes/svector/all/test_package/CMakeLists.txt +++ b/recipes/svector/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) diff --git a/recipes/svector/all/test_v1_package/CMakeLists.txt b/recipes/svector/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 33ce3d62f2939..0000000000000 --- a/recipes/svector/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(svector REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE svector::svector) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/svector/all/test_v1_package/conanfile.py b/recipes/svector/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/svector/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/svgpp/all/conandata.yml b/recipes/svgpp/all/conandata.yml index b4612b4441137..46ed1662b848f 100644 --- a/recipes/svgpp/all/conandata.yml +++ b/recipes/svgpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.1": + url: "https://github.com/svgpp/svgpp/archive/refs/tags/v1.3.1.tar.gz" + sha256: "be8a89df72d01cf062cc9815dd64c9576b4d20910d6d7aee7f0ea26484dc5e76" "cci.20221030": url: "https://github.com/svgpp/svgpp/archive/1583a7b209038bfd0d98c6ce7d4c93986f7b235e.tar.gz" sha256: "95f4145c43aada913e7b24e37d20d0eef5f170a7c70e00ffcb318a3910b43ca6" diff --git a/recipes/svgpp/config.yml b/recipes/svgpp/config.yml index d6e527e7221f4..cbf184c2b85d7 100644 --- a/recipes/svgpp/config.yml +++ b/recipes/svgpp/config.yml @@ -1,3 +1,5 @@ versions: + "1.3.1": + folder: "all" "cci.20221030": folder: "all" diff --git a/recipes/svgwrite/all/conanfile.py b/recipes/svgwrite/all/conanfile.py index 9c1c80b182559..61be81d1368f4 100644 --- a/recipes/svgwrite/all/conanfile.py +++ b/recipes/svgwrite/all/conanfile.py @@ -56,7 +56,7 @@ def layout(self): def requirements(self): self.requires("span-lite/0.10.3", transitive_headers=True) - self.requires("fmt/10.1.0") + self.requires("fmt/10.2.0") def validate(self): if self.settings.compiler.cppstd: diff --git a/recipes/svtjpegxs/all/conandata.yml b/recipes/svtjpegxs/all/conandata.yml new file mode 100644 index 0000000000000..d22e8967fad5f --- /dev/null +++ b/recipes/svtjpegxs/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.9.0": + url: "https://github.com/OpenVisualCloud/SVT-JPEG-XS/archive/refs/tags/v0.9.0.tar.gz" + sha256: "ff5dfb3b98348a39049da4fd3062d3391cbadec4c4b61825a9f3435ca671effa" +patches: + "0.9.0": + - patch_file: "patches/0.9.0-0001-manage-fpic.patch" + patch_type: "conan" + patch_description: "Let Conan configure fPIC" diff --git a/recipes/svtjpegxs/all/conanfile.py b/recipes/svtjpegxs/all/conanfile.py new file mode 100644 index 0000000000000..2f024fb63798b --- /dev/null +++ b/recipes/svtjpegxs/all/conanfile.py @@ -0,0 +1,84 @@ +import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import cmake_layout, CMakeToolchain, CMake +from conan.tools.files import copy, get, rmdir, apply_conandata_patches, export_conandata_patches +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=2.0.9" + + +class SvtJpegXsConan(ConanFile): + name = "svtjpegxs" + description = "A JPEG XS (ISO/IEC 21122) compatible software encoder/decoder library" + license = "BSD-2-Clause-Patent" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OpenVisualCloud/SVT-JPEG-XS" + topics = ("jpegxs", "codec", "encoder", "decoder", "image", "video") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + 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.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("yasm/1.3.0") + + def validate(self): + if self.settings.arch not in ["x86", "x86_64"]: + # INFO: The upstream mention about only supporting x86, SSE and AVX + # https://github.com/OpenVisualCloud/SVT-JPEG-XS/tree/v0.9.0?tab=readme-ov-file#environment-and-requirements + raise ConanInvalidConfiguration(f"{self.ref} does not support {self.settings.arch}. Only x86 and x86_64 are supported.") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_APPS"] = False + if self.settings.os != "Windows": + # INFO: The upstream use OBJECT library for shared library. CMake does not pass -fPIC to OBJECT library + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.md", self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.configure() + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = ["SvtJpegxs"] + self.cpp_info.set_property("pkg_config_name", "SvtJpegxs") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread"] + + if is_msvc(self) and self.options.shared: + self.cpp_info.bindirs = ["lib"] + self.cpp_info.defines.append("DEF_DLL") diff --git a/recipes/svtjpegxs/all/patches/0.9.0-0001-manage-fpic.patch b/recipes/svtjpegxs/all/patches/0.9.0-0001-manage-fpic.patch new file mode 100644 index 0000000000000..a0d3589cc7639 --- /dev/null +++ b/recipes/svtjpegxs/all/patches/0.9.0-0001-manage-fpic.patch @@ -0,0 +1,40 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e7cdc8d..6039b5c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -88,7 +88,6 @@ else() + set_property(CACHE SANITIZER PROPERTY STRINGS Address Memory Thread Undefined Integer) + endif() + +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + set(CMAKE_C_STANDARD 99) + set(CMAKE_CXX_STANDARD 11) + +@@ -120,7 +119,6 @@ if(UNIX) + endif() + + # Always build with -fPIC +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + function(check_flag lang flag) + string(REGEX REPLACE "[^A-Za-z0-9]" "_" flag_var "${flag}") +diff --git a/third_party/cpuinfo/CMakeLists.txt b/third_party/cpuinfo/CMakeLists.txt +index c994d47..7ca34bc 100644 +--- a/third_party/cpuinfo/CMakeLists.txt ++++ b/third_party/cpuinfo/CMakeLists.txt +@@ -112,7 +112,6 @@ CPUINFO_TARGET_ENABLE_C99(cpuinfo) + + INCLUDE_DIRECTORIES(deps/clog/include) + +-SET_PROPERTY(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON) + + CPUINFO_TARGET_RUNTIME_LIBRARY(cpuinfo) + IF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS)$") +@@ -160,7 +159,6 @@ IF(NOT TARGET clog) + ADD_SUBDIRECTORY( + "${CLOG_SOURCE_DIR}") + # We build static version of clog but a dynamic library may indirectly depend on it +- SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON) + ENDIF() + + ADD_LIBRARY(cpuinfo_public INTERFACE) diff --git a/recipes/svtjpegxs/all/test_package/CMakeLists.txt b/recipes/svtjpegxs/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7e22587af3e7c --- /dev/null +++ b/recipes/svtjpegxs/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(svtjpegxs REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE svtjpegxs::svtjpegxs) diff --git a/recipes/svtjpegxs/all/test_package/conanfile.py b/recipes/svtjpegxs/all/test_package/conanfile.py new file mode 100644 index 0000000000000..01276b37d172f --- /dev/null +++ b/recipes/svtjpegxs/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps" + + 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/svtjpegxs/all/test_package/test_package.cpp b/recipes/svtjpegxs/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7660d632cd305 --- /dev/null +++ b/recipes/svtjpegxs/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include "svt-jpegxs/SvtJpegxs.h" +#include "svt-jpegxs/SvtJpegxsImageBufferTools.h" + +int main() +{ + svt_jpeg_xs_frame_pool_free(nullptr); + return EXIT_SUCCESS; +} diff --git a/recipes/svtjpegxs/config.yml b/recipes/svtjpegxs/config.yml new file mode 100644 index 0000000000000..7dbf8a1dbf4a8 --- /dev/null +++ b/recipes/svtjpegxs/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.0": + folder: all diff --git a/recipes/swig/all/cmake/conan-official-swig-targets.cmake b/recipes/swig/all/cmake/conan-official-swig-targets.cmake deleted file mode 100644 index 8740b23580975..0000000000000 --- a/recipes/swig/all/cmake/conan-official-swig-targets.cmake +++ /dev/null @@ -1,7 +0,0 @@ -find_program(SWIG_EXECUTABLE swig) -if(NOT SWIG_DIR) - execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib - OUTPUT_VARIABLE SWIG_lib_output OUTPUT_STRIP_TRAILING_WHITESPACE) - set(SWIG_DIR ${SWIG_lib_output} CACHE STRING "Location of SWIG library" FORCE) -endif() -mark_as_advanced(SWIG_DIR SWIG_EXECUTABLE) diff --git a/recipes/swig/all/cmake/conan-swig-variables.cmake b/recipes/swig/all/cmake/conan-swig-variables.cmake new file mode 100644 index 0000000000000..3421127d0076f --- /dev/null +++ b/recipes/swig/all/cmake/conan-swig-variables.cmake @@ -0,0 +1,3 @@ +find_program(SWIG_EXECUTABLE swig) +# CMakeDeps sets SWIG_DIR to the generators folder, override it to the correct value +get_filename_component(SWIG_DIR "${SWIG_EXECUTABLE}/../swiglib" ABSOLUTE) diff --git a/recipes/swig/all/conandata.yml b/recipes/swig/all/conandata.yml index 7c4f531b134a3..98af067bebcb2 100644 --- a/recipes/swig/all/conandata.yml +++ b/recipes/swig/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "4.3.0": + url: "https://github.com/swig/swig/archive/refs/tags/v4.3.0.tar.gz" + sha256: "f2136da1137a20dfcec795fe0d17ca1a2465d28e3b307f122526629b6b2f2294" + "4.2.1": + url: "https://github.com/swig/swig/archive/refs/tags/v4.2.1.tar.gz" + sha256: "8895878b9215612e73611203dc8f5232c626e4d07ffc4532922f375518f067ca" + "4.1.1": + url: "https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz" + sha256: "4d97f9528dda8ced8b762e405dff2da38cc4603ef5f868f7287c94872f693265" "4.1.0": url: "https://github.com/swig/swig/archive/refs/tags/v4.1.0.tar.gz" sha256: "5b9313b1af5edfcea158a389520be266f013bc9be4ce933d79a30c5659ba99fe" @@ -9,18 +18,42 @@ sources: url: "https://github.com/swig/swig/archive/rel-4.0.1.tar.gz" sha256: "2eaf6fb89d071d1be280bf995c63360b3729860c0da64948123b5d7e4cfb6cb7" patches: + "4.3.0": + - patch_file: "patches/0002-4.3.0-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + "4.2.1": + - patch_file: "patches/0001-4.2.1-swig-linux-library-path.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + - patch_file: "patches/0002-4.2.1-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + "4.1.1": + - patch_file: "patches/0001-4.1.0-swig-linux-library-path.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + - patch_file: "patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" "4.1.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-4.1.0-swig-linux-library-path.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch" + - patch_file: "patches/0001-4.1.0-swig-linux-library-path.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + - patch_file: "patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" "4.0.2": - - base_path: "source_subfolder" - patch_file: "patches/0001-swig-linux-library-path.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-4.0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch" + - patch_file: "patches/0001-swig-linux-library-path.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + - patch_file: "patches/0002-4.0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" "4.0.1": - - base_path: "source_subfolder" - patch_file: "patches/0001-swig-linux-library-path.patch" - - base_path: "source_subfolder" - patch_file: "patches/0002-4.0.1-do-not-define-SWIG_LIB_WIN_UNIX.patch" + - patch_file: "patches/0001-swig-linux-library-path.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" + - patch_file: "patches/0002-4.0.1-do-not-define-SWIG_LIB_WIN_UNIX.patch" + patch_type: "portability" + patch_description: "swig -swiglib should return the correct path next to the binary even when relocated" diff --git a/recipes/swig/all/conanfile.py b/recipes/swig/all/conanfile.py index 432bfb37aeca5..fc0ddef14c147 100644 --- a/recipes/swig/all/conanfile.py +++ b/recipes/swig/all/conanfile.py @@ -1,170 +1,199 @@ -from conan import ConanFile -from conan.tools.files import get -from conans import AutoToolsBuildEnvironment, tools -import contextlib -import functools import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.apple import is_apple_os, to_apple_arch +from conan.tools.env import VirtualBuildEnv, Environment +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rmdir, 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 +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class SwigConan(ConanFile): name = "swig" description = "SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages." + license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.swig.org" - license = "GPL-3.0-or-later" - topics = ("swig", "python", "java", "wrapper") - exports_sources = "patches/**", "cmake/*" - settings = "os", "arch", "compiler", "build_type" + topics = ("python", "java", "wrapper") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + def configure(self): + # SWIG prefers static linking + self.options["pcre"].shared = False + self.options["pcre2"].shared = False + self.options["libgettext"].shared = False + + def export_sources(self): + copy(self, "cmake/*", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + @property def _use_pcre2(self): - return self.version not in ['4.0.1', '4.0.2'] - + return Version(self.version) >= "4.1" def requirements(self): if self._use_pcre2: - self.requires("pcre2/10.40") + self.requires("pcre2/10.43") else: self.requires("pcre/8.45") - - 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("winflexbison/2.5.24") - else: - self.build_requires("bison/3.8.2") - self.build_requires("automake/1.16.5") + if is_apple_os(self): + self.requires("libgettext/0.22") 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) - - @property - def _user_info_build(self): - # If using the experimental feature with different context for host and - # build, the 'user_info' attributes of the 'build_requires' packages - # will be located into the 'user_info_build' object. In other cases they - # will be located into the 'deps_user_info' object. - return getattr(self, "user_info_build", self.deps_user_info) - - @contextlib.contextmanager - def _build_context(self): - env = {} - if self.settings.compiler != "Visual Studio": - env["YACC"] = self._user_info_build["bison"].YACC - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env.update({ - "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)), - "AR": "{} link".format(self._user_info_build["automake"].ar_lib), - "LD": "link", - }) - with tools.environment_append(env): - yield + 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("cccl/1.3") + if Version(self.version) >= "4.2": + if is_msvc(self): + # bison 3.8.2 is not ready for msvc + self.tool_requires("bison/3.7.6") + else: + self.tool_requires("bison/3.8.2") else: - with tools.environment_append(env): - yield - - @functools.lru_cache(1) - def _configure_autotools(self): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - deps_libpaths = autotools.library_paths - deps_libs = autotools.libs - deps_defines = autotools.defines - if self.settings.os == "Windows" and self.settings.compiler != "Visual Studio": - autotools.link_flags.append("-static") - - libargs = list("-L\"{}\"".format(p) for p in deps_libpaths) + list("-l\"{}\"".format(l) for l in deps_libs) - args = [ - "{}_LIBS={}".format("PCRE2" if self._use_pcre2 else "PCRE", " ".join(libargs)), - "{}_CPPFLAGS={}".format("PCRE2" if self._use_pcre2 else "PCRE", " ".join("-D{}".format(define) for define in deps_defines)), - "--host={}".format(self.settings.arch), - "--with-swiglibdir={}".format(self._swiglibdir), - ] - if self.settings.os == "Linux": - args.append("LIBS=-ldl") - - host, build = None, None + if is_msvc(self): + self.tool_requires("winflexbison/2.5.25") + else: + self.tool_requires("bison/3.8.2") + self.tool_requires("automake/1.16.5") - if self.settings.compiler == "Visual Studio": - self.output.warn("Visual Studio compiler cannot create ccache-swig. Disabling ccache-swig.") - args.append("--disable-ccache") - autotools.flags.append("-FS") - # MSVC canonical names aren't understood - host, build = False, False - - if self.settings.os == "Macos" and self.settings.arch == "armv8": - # FIXME: Apple ARM should be handled by build helpers - autotools.flags.append("-arch arm64") - autotools.link_flags.append("-arch arm64") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - autotools.libs = [] - autotools.library_paths = [] + def generate(self): + build_env = VirtualBuildEnv(self) + build_env.generate() - if self.settings.os == "Windows" and self.settings.compiler != "Visual Studio": - autotools.libs.extend(["mingwex", "ssp"]) + tc = AutotoolsToolchain(self) + env = tc.environment() - autotools.configure(args=args, configure_dir=self._source_subfolder, - host=host, build=build) - return autotools + pcre = "pcre2" if self._use_pcre2 else "pcre" + tc.configure_args += [ + f"--host={self.settings.arch}", + "--with-swiglibdir=${prefix}/bin/swiglib", + f"--with-{pcre}-prefix={self.dependencies[pcre].package_folder}", + ] + tc.extra_cflags.append("-DHAVE_PCRE=1") + if self._use_pcre2: + env.define("PCRE2_LIBS", " ".join("-l" + lib for lib in self.dependencies["pcre2"].cpp_info.libs)) + + if self.settings.os in ["Linux", "FreeBSD"]: + tc.configure_args.append("LIBS=-ldl") + tc.extra_defines.append("HAVE_UNISTD_H=1") + elif self.settings.os == "Windows": + if is_msvc(self): + env.define("CC", "cccl -FS") + env.define("CXX", "cccl -FS") + tc.configure_args.append("--disable-ccache") + else: + tc.extra_ldflags.append("-static") + tc.configure_args.append("LIBS=-lmingwex -lssp") + elif is_apple_os(self): + tc.extra_cflags.append(f"-arch {to_apple_arch(self)}") + tc.extra_cxxflags.append(f"-arch {to_apple_arch(self)}") + tc.extra_ldflags.append(f"-arch {to_apple_arch(self)}") + tc.generate(env) + + 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") + else: + deps = AutotoolsDeps(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) + # Rely on AutotoolsDeps instead of pcre2-config + # https://github.com/swig/swig/blob/v4.1.1/configure.ac#L70-L92 + # https://github.com/swig/swig/blob/v4.0.2/configure.ac#L65-L86 + replace_in_file(self, os.path.join(self.source_folder, "configure.ac"), + 'AS_IF([test "x$with_pcre" != xno],', 'AS_IF([false],') def build(self): self._patch_sources() - with tools.chdir(os.path.join(self._source_subfolder)): - self.run("./autogen.sh", win_bash=tools.os_info.is_windows) - with self._build_context(): - autotools = self._configure_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) + self.run("./autogen.sh") + autotools.configure() autotools.make() def package(self): - self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) - self.copy(pattern="COPYRIGHT", dst="licenses", src=self._source_subfolder) - self.copy("*", src="cmake", dst=self._module_subfolder) - with self._build_context(): - autotools = self._configure_autotools() + copy(self, "LICENSE*", 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) + copy(self, "*.cmake", + dst=os.path.join(self.package_folder, self._module_subfolder), + src=os.path.join(self.export_sources_folder, "cmake")) + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install() - - @property - def _swiglibdir(self): - return os.path.join(self.package_folder, "bin", "swiglib").replace("\\", "/") + for path in self.package_path.iterdir(): + if path.is_dir() and path.name not in ["bin", "lib", "licenses"]: + rmdir(self, path) @property def _module_subfolder(self): return os.path.join("lib", "cmake") @property - def _module_file(self): - return "conan-official-{}-targets.cmake".format(self.name) + def _cmake_module_rel_path(self): + return os.path.join(self._module_subfolder, "conan-swig-variables.cmake") def package_info(self): - self.cpp_info.includedirs=[] + self.cpp_info.includedirs = [] + self.cpp_info.set_property("cmake_file_name", "SWIG") + self.cpp_info.set_property("cmake_target_name", "SWIG::SWIG") + self.cpp_info.set_property("cmake_build_modules", [self._cmake_module_rel_path]) + + self.buildenv_info.define_path("SWIG_LIB", os.path.join(self.package_folder, "bin", "swiglib")) + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "SWIG" self.cpp_info.names["cmake_find_package_multi"] = "SWIG" - self.cpp_info.builddirs = [self._module_subfolder] - self.cpp_info.build_modules["cmake_find_package"] = \ - [os.path.join(self._module_subfolder, self._module_file)] - self.cpp_info.build_modules["cmake_find_package_multi"] = \ - [os.path.join(self._module_subfolder, self._module_file)] + self.cpp_info.build_modules["cmake_find_package"] = [self._cmake_module_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._cmake_module_rel_path] bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) self.env_info.PATH.append(bindir) + self.env_info.SWIG_LIB = os.path.join(self.package_folder, "bin", "swiglib") diff --git a/recipes/swig/all/patches/0001-4.2.1-swig-linux-library-path.patch b/recipes/swig/all/patches/0001-4.2.1-swig-linux-library-path.patch new file mode 100644 index 0000000000000..f3c40eb7eab79 --- /dev/null +++ b/recipes/swig/all/patches/0001-4.2.1-swig-linux-library-path.patch @@ -0,0 +1,51 @@ +--- Source/Modules/main.cxx ++++ Source/Modules/main.cxx +@@ -861,6 +861,32 @@ + + static void SWIG_exit_handler(int status); + ++#if defined(HAVE_UNISTD_H) && !defined(_WIN32) ++#include ++#include ++#include ++ ++static String *get_exe_path(void) { ++ Dl_info info; ++ if (dladdr("main", &info)) { ++ char realp_buffer[PATH_MAX]; ++ char* res = NULL; ++ ++ res = realpath(info.dli_fname, realp_buffer); ++ if (!res) { ++ return NewString(SWIG_LIB); ++ } ++ ++ const char* dir = dirname(realp_buffer); ++ char dest_buf[PATH_MAX]; ++ strcpy(dest_buf, dir); ++ strcat(dest_buf, "/swiglib"); ++ return NewStringWithSize(dest_buf, strlen(dest_buf)); ++ } ++ return NewString(SWIG_LIB); ++} ++#endif ++ + int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) { + char *c; + +@@ -900,12 +926,14 @@ + char *p; + if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) { + *(p + 1) = '\0'; +- SwigLib = NewStringf("%sLib", buf); // Native windows installation path ++ SwigLib = NewStringf("%sswiglib", buf); // Native windows installation path + } else { + SwigLib = NewStringf(""); // Unexpected error + } + if (Len(SWIG_LIB_WIN_UNIX) > 0) + SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw) ++#elif defined(HAVE_UNISTD_H) && !defined(_WIN32) ++ SwigLib = get_exe_path(); + #else + SwigLib = NewString(SWIG_LIB); + #endif diff --git a/recipes/swig/all/patches/0002-4.2.1-do-not-define-SWIG_LIB_WIN_UNIX.patch b/recipes/swig/all/patches/0002-4.2.1-do-not-define-SWIG_LIB_WIN_UNIX.patch new file mode 100644 index 0000000000000..a58da257a1aef --- /dev/null +++ b/recipes/swig/all/patches/0002-4.2.1-do-not-define-SWIG_LIB_WIN_UNIX.patch @@ -0,0 +1,11 @@ +--- configure.ac ++++ configure.ac +@@ -2803,7 +2803,7 @@ + *-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;; + *) SWIG_LIB_WIN_UNIX="";; + esac +-AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) ++AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, [""], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) + + SWIG_LIB_PREINST=$ABS_SRCDIR/Lib + AC_SUBST(SWIG_LIB_PREINST) diff --git a/recipes/swig/all/patches/0002-4.3.0-do-not-define-SWIG_LIB_WIN_UNIX.patch b/recipes/swig/all/patches/0002-4.3.0-do-not-define-SWIG_LIB_WIN_UNIX.patch new file mode 100644 index 0000000000000..0643470780bed --- /dev/null +++ b/recipes/swig/all/patches/0002-4.3.0-do-not-define-SWIG_LIB_WIN_UNIX.patch @@ -0,0 +1,13 @@ +diff --git a/configure.ac b/configure.ac +index 88cc4e4cd..e8902d755 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2823,7 +2823,7 @@ case $build in + *-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;; + *) SWIG_LIB_WIN_UNIX="";; + esac +-AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) ++AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, [""], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) + + SWIG_LIB_PREINST=$ABS_SRCDIR/Lib + AC_SUBST(SWIG_LIB_PREINST) diff --git a/recipes/swig/all/test_package/CMakeLists.txt b/recipes/swig/all/test_package/CMakeLists.txt index 3f3a1aa9d1821..767943c116cee 100644 --- a/recipes/swig/all/test_package/CMakeLists.txt +++ b/recipes/swig/all/test_package/CMakeLists.txt @@ -1,51 +1,20 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS NO_OUTPUT_DIRS) - -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}>) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}>) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}>) - -find_package(SWIG REQUIRED) +find_package(SWIG REQUIRED CONFIG) include(UseSWIG) -set(Python_ADDITIONAL_VERSIONS 3) -find_package(PythonInterp) -find_package(PythonLibs 3) - -enable_testing() - -if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND) - swig_add_library(${PROJECT_NAME} - LANGUAGE python - SOURCES - test.i - test_package.c - ) - - get_filename_component(PYTHON_LIBRARY_DIR "${PYTHON_LIBRARIES}" DIRECTORY) - - message(STATUS "PYTHON_INCLUDE_DIRS: ${PYTHON_INCLUDE_DIRS}") - message(STATUS "PYTHON_LIBRARIES: ${PYTHON_LIBRARIES}") - message(STATUS "PYTHON_LIBRARY_DIR: ${PYTHON_LIBRARY_DIR}") +find_package(Python REQUIRED COMPONENTS Interpreter Development) - #target_compile_definitions(_${PROJECT_NAME} PRIVATE MS_NO_COREDLL) - target_include_directories(_${PROJECT_NAME} PRIVATE ${PYTHON_INCLUDE_DIRS}) - target_link_directories(_${PROJECT_NAME} PRIVATE ${PYTHON_LIBRARY_DIR}) - target_link_libraries(_${PROJECT_NAME} PRIVATE ${PYTHON_LIBRARIES}) +swig_add_library(${PROJECT_NAME} + LANGUAGE python + SOURCES test.i test_package.c + OUTPUT_DIR ${CMAKE_BINARY_DIR} +) +target_link_libraries(${PROJECT_NAME} PRIVATE Python::Python) - add_test( - NAME gcd_test - COMMAND ${PYTHON_EXECUTABLE} -c "import PackageTest; assert PackageTest.gcd(12, 16) == 4" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" - ) - add_test( - NAME foo_test - COMMAND ${PYTHON_EXECUTABLE} -c "import PackageTest; assert PackageTest.cvar.foo == 3.14159265359" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" - ) -else() - message(STATUS "Not building swig python module") -endif() +# Note: this does not copy the generated *.py file +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION ${CMAKE_BINARY_DIR} + RUNTIME DESTINATION ${CMAKE_BINARY_DIR} +) diff --git a/recipes/swig/all/test_package/conanfile.py b/recipes/swig/all/test_package/conanfile.py index 5059612e70e16..f305f9b713d22 100644 --- a/recipes/swig/all/test_package/conanfile.py +++ b/recipes/swig/all/test_package/conanfile.py @@ -1,27 +1,73 @@ -from conans import CMake, ConanFile, tools +import importlib +import os +import sys +from pathlib import PurePath + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps +from conan.tools.env import VirtualRunEnv +from conan.tools.microsoft import is_msvc class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str, visible=False, run=True) + + def layout(self): + cmake_layout(self) @property def _can_build(self): # FIXME: Python does not distribute debug libraries (use cci CPython recipe) - return not (self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug") + if is_msvc(self) and self.settings.build_type == "Debug": + return False + # FIXME: apple-clang fails with 'ld: library not found for -lintl' in CI, despite working ok locally + if self.settings.compiler == "apple-clang": + return False + return True + + @property + def _python_interpreter(self): + if getattr(sys, "frozen", False): + return "python" + return sys.executable + + def generate(self): + venv = VirtualRunEnv(self) + venv.generate(scope="build") + venv.generate(scope="run") + tc = CMakeToolchain(self) + tc.variables["Python_EXECUTABLE"] = PurePath(self._python_interpreter).as_posix() + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - if not tools.cross_building(self, skip_x64_x86=True): - self.run("swig -swiglib", run_environment=True) + if can_run(self): + self.run("swig -swiglib") if self._can_build: cmake = CMake(self) - cmake.verbose = True cmake.configure() cmake.build() + def _test_swig_module(self): + sys.path.append(self.build_folder) + sys.path.append(os.path.join(self.build_folder, str(self.settings.build_type))) + # Could also simply use 'import PackageTest' but this makes pylint angry + PackageTest = importlib.import_module("PackageTest") + assert PackageTest.gcd(12, 16) == 4 + self.output.info("PackageTest.gcd(12, 16) ran successfully") + assert PackageTest.cvar.foo == 3.14159265359 + self.output.info("PackageTest.cvar.foo == 3.14159265359 ran successfully") + sys.path.pop() + def test(self): - if not tools.cross_building(self): + if can_run(self): if self._can_build: - cmake = CMake(self) - cmake.test(output_on_failure=True) - self.run("swig -version", run_environment=True) + self._test_swig_module() + self.run("swig -version") + self.run("swig -swiglib") diff --git a/recipes/access_private/all/test_v1_package/CMakeLists.txt b/recipes/swig/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/access_private/all/test_v1_package/CMakeLists.txt rename to recipes/swig/all/test_v1_package/CMakeLists.txt diff --git a/recipes/swig/all/test_v1_package/conanfile.py b/recipes/swig/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e7dbf9e47271c --- /dev/null +++ b/recipes/swig/all/test_v1_package/conanfile.py @@ -0,0 +1,53 @@ +import importlib +import sys +from pathlib import PurePath + +from conans import CMake, ConanFile, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + @property + def _can_build(self): + # FIXME: Python does not distribute debug libraries (use cci CPython recipe) + if self.settings.compiler == "Visual Studio" and self.settings.build_type == "Debug": + return False + # FIXME: apple-clang fails with 'ld: library not found for -lintl' in CI, despite working ok locally + if self.settings.compiler == "apple-clang": + return False + return True + + @property + def _python_interpreter(self): + if getattr(sys, "frozen", False): + return "python" + return sys.executable + + def build(self): + if not tools.cross_building(self, skip_x64_x86=True): + self.run("swig -swiglib", run_environment=True) + if self._can_build: + cmake = CMake(self) + cmake.verbose = True + cmake.definitions["Python_EXECUTABLE"] = PurePath(self._python_interpreter).as_posix() + cmake.configure() + cmake.build() + cmake.install() + + def _test_swig_module(self): + sys.path.append(self.build_folder) + # Could also simply use 'import PackageTest' but this makes pylint angry + PackageTest = importlib.import_module("PackageTest") + assert PackageTest.gcd(12, 16) == 4 + self.output.info("PackageTest.gcd(12, 16) ran successfully") + assert PackageTest.cvar.foo == 3.14159265359 + self.output.info("PackageTest.cvar.foo == 3.14159265359 ran successfully") + sys.path.pop() + + def test(self): + if not tools.cross_building(self): + if self._can_build: + self._test_swig_module() + self.run("swig -version", run_environment=True) diff --git a/recipes/swig/config.yml b/recipes/swig/config.yml index 543f01b80f536..c897bf55ae298 100644 --- a/recipes/swig/config.yml +++ b/recipes/swig/config.yml @@ -1,4 +1,10 @@ versions: + "4.3.0": + folder: "all" + "4.2.1": + folder: "all" + "4.1.1": + folder: "all" "4.1.0": folder: "all" "4.0.2": diff --git a/recipes/symengine/all/conandata.yml b/recipes/symengine/all/conandata.yml index c52591b647475..2d0d978d499a3 100644 --- a/recipes/symengine/all/conandata.yml +++ b/recipes/symengine/all/conandata.yml @@ -14,3 +14,12 @@ sources: "0.11.2": url: "https://github.com/symengine/symengine/releases/download/v0.11.2/symengine-0.11.2.tar.gz" sha256: "f6972acd6a65354f6414e69460d2e175729470632bdac05919bc2f7f32e48cbd" + "0.12.0": + url: "https://github.com/symengine/symengine/archive/refs/tags/v0.12.0.tar.gz" + sha256: "1b5c3b0bc6a9f187635f93585649f24a18e9c7f2167cebcd885edeaaf211d956" + "0.13.0": + url: "https://github.com/symengine/symengine/archive/refs/tags/v0.13.0.tar.gz" + sha256: "f46bcf037529cd1a422369327bf360ad4c7d2b02d0f607a62a5b09c74a55bb59" + "0.14.0": + url: "https://github.com/symengine/symengine/archive/refs/tags/v0.14.0.tar.gz" + sha256: "11c5f64e9eec998152437f288b8429ec001168277d55f3f5f1df78e3cf129707" diff --git a/recipes/symengine/all/conanfile.py b/recipes/symengine/all/conanfile.py index c6d7a378b2e21..270776ba7fe08 100644 --- a/recipes/symengine/all/conanfile.py +++ b/recipes/symengine/all/conanfile.py @@ -1,16 +1,21 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps from conan.tools.files import ( - apply_conandata_patches, collect_libs, copy, get, rm, rmdir, + replace_in_file, ) -import os +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.scm import Version -required_conan_version = ">=1.54.0" +import os +required_conan_version = ">=2.1" class SymengineConan(ConanFile): @@ -20,8 +25,8 @@ class SymengineConan(ConanFile): topics = ("symbolic", "algebra") homepage = "https://symengine.org/" url = "https://github.com/conan-io/conan-center-index" - exports_sources = ["CMakeLists.txt", "patches/**"] settings = "os", "compiler", "build_type", "arch" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -34,11 +39,36 @@ class SymengineConan(ConanFile): } short_paths = True + def layout(self): + basic_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 validate(self): + min_cppstd = "11" + check_min_cppstd(self, min_cppstd) + + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "7": + raise ConanInvalidConfiguration(f"{self.ref} requires GCC >= 7") + + @property + def _needs_fast_float(self): + return Version(self.version) >= "0.13.0" + def requirements(self): if self.options.integer_class == "boostmp": - self.requires("boost/1.83.0") + # symengine/mp_class.h:12 + self.requires("boost/1.86.0", transitive_headers=True) else: self.requires("gmp/6.3.0", transitive_headers=True, transitive_libs=True) + if self._needs_fast_float: + self.requires("fast_float/6.1.5") def source(self): get( @@ -48,24 +78,42 @@ def source(self): destination=self.source_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 generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTS"] = False tc.variables["BUILD_BENCHMARKS"] = False tc.variables["INTEGER_CLASS"] = self.options.integer_class - tc.variables["MSVC_USE_MT"] = False + tc.variables["MSVC_USE_MT"] = is_msvc_static_runtime(self) + if self._needs_fast_float: + tc.variables["WITH_SYSTEM_FASTFLOAT"] = True + tc.generate() + deps = CMakeDeps(self) + if self.options.integer_class == "gmp": + deps.set_property("gmp", "cmake_file_name", "GMP") + # If we ever add support for gmpxx, we should set this property + # if self.dependencies["gmp"].options.enable_cxx: + # deps.set_property("gmp::gmpxx", "cmake_target_name", "gmpxx") + if self._needs_fast_float: + deps.set_property("fast_float", "cmake_file_name", "FASTFLOAT") + deps.generate() + + def _patch_sources(self): + # Disable hardcoded C++11 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + 'set(CMAKE_CXX_FLAGS "${CXX11_OPTIONS} ${CMAKE_CXX_FLAGS}")', + '') + # Let Conan choose fPIC + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${common}")', + '') + # cmake_target_name not working? + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(LIBS ${LIBS} ${GMP_TARGETS})", + "set(LIBS ${LIBS} gmp::gmp)") def build(self): - apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -90,6 +138,5 @@ def package_info(self): self.cpp_info.libs.append("teuchos") if self.settings.os == "Linux": self.cpp_info.system_libs.append("m") - self.cpp_info.names["cmake_find_package"] = "symengine" - # FIXME: symengine exports a non-namespaced `symengine` target. - self.cpp_info.names["cmake_find_package_multi"] = "symengine" + + self.cpp_info.set_property("cmake_target_name", "symengine") diff --git a/recipes/symengine/all/test_package/CMakeLists.txt b/recipes/symengine/all/test_package/CMakeLists.txt index 7b0ebad6adca2..db1bcb5e287ec 100644 --- a/recipes/symengine/all/test_package/CMakeLists.txt +++ b/recipes/symengine/all/test_package/CMakeLists.txt @@ -1,7 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(symengine REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE symengine::symengine) # FIXME: Replace `symengine::symengine` with `symengine` +target_link_libraries(${PROJECT_NAME} PRIVATE symengine) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/symengine/all/test_package/conanfile.py b/recipes/symengine/all/test_package/conanfile.py index 8a86f655664c1..f72d1f660e19f 100644 --- a/recipes/symengine/all/test_package/conanfile.py +++ b/recipes/symengine/all/test_package/conanfile.py @@ -17,7 +17,6 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["CMAKE_CXX_STANDARD"] = "11" tc.generate() def build(self): diff --git a/recipes/symengine/all/test_package/test_package.cpp b/recipes/symengine/all/test_package/test_package.cpp index 62249dac49da7..da10361cc19de 100644 --- a/recipes/symengine/all/test_package/test_package.cpp +++ b/recipes/symengine/all/test_package/test_package.cpp @@ -2,12 +2,19 @@ #include #include #include +#include +#include +#include #include int main() { SymEngine::Expression pi_by_12 = SymEngine::div(SymEngine::pi, SymEngine::integer(12)); std::cout << pi_by_12 << std::endl; + std::cout << SymEngine::mp_perfect_power_p(SymEngine::integer_class("9")) << std::endl; + std::string input = "123.0"; + auto parsed_value = SymEngine::parse(input, true); + return 0; } diff --git a/recipes/symengine/all/test_v1_package/CMakeLists.txt b/recipes/symengine/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 62739795b7eca..0000000000000 --- a/recipes/symengine/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(symengine REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE symengine::symengine) # FIXME: Replace `symengine::symengine` with `symengine` diff --git a/recipes/symengine/all/test_v1_package/conanfile.py b/recipes/symengine/all/test_v1_package/conanfile.py deleted file mode 100644 index 7e1802f4cdc24..0000000000000 --- a/recipes/symengine/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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.definitions["CMAKE_CXX_STANDARD"] = "11" - 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/symengine/all/test_v1_package/test_package.cpp b/recipes/symengine/all/test_v1_package/test_package.cpp deleted file mode 100644 index 62249dac49da7..0000000000000 --- a/recipes/symengine/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include -#include - -#include - -int main() { - SymEngine::Expression pi_by_12 = - SymEngine::div(SymEngine::pi, SymEngine::integer(12)); - std::cout << pi_by_12 << std::endl; - return 0; -} diff --git a/recipes/symengine/config.yml b/recipes/symengine/config.yml index b47e71fe86741..351849db5d393 100644 --- a/recipes/symengine/config.yml +++ b/recipes/symengine/config.yml @@ -9,3 +9,9 @@ versions: folder: all "0.11.2": folder: all + "0.12.0": + folder: all + "0.13.0": + folder: all + "0.14.0": + folder: all diff --git a/recipes/systemc-cci/all/test_v1_package/CMakeLists.txt b/recipes/systemc-cci/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/systemc-cci/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 189bd25a7c208..0000000000000 --- a/recipes/systemc-cci/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/conandata.yml b/recipes/systemc/all/conandata.yml index 234032a9f92d2..70bb847952eea 100644 --- a/recipes/systemc/all/conandata.yml +++ b/recipes/systemc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.1": + url: https://github.com/accellera-official/systemc/archive/3.0.1.tar.gz + sha256: d07765d0d2ffd6c01767880d0c6aaf53cd9487975f898c593ffffd713258fcbb "2.3.3": url: https://github.com/accellera-official/systemc/archive/2.3.3.tar.gz sha256: 5781b9a351e5afedabc37d145e5f7edec08f3fd5de00ffeb8fa1f3086b1f7b3f diff --git a/recipes/systemc/all/conanfile.py b/recipes/systemc/all/conanfile.py index 60fb8e631adf2..e11b81933e722 100644 --- a/recipes/systemc/all/conanfile.py +++ b/recipes/systemc/all/conanfile.py @@ -1,13 +1,15 @@ -from conan import ConanFile, conan_version +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 apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc -from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd import os -required_conan_version = ">=1.53.0" +from conan.tools.scm import Version + +required_conan_version = ">=2.1" class SystemcConan(ConanFile): @@ -62,25 +64,22 @@ def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if is_apple_os(self): + if is_apple_os(self) and Version(self.version) < "3.0.1": 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" - ) + if Version(self.version) >= "3.0.0": + # INFO: Starting from SystemC 3.0.0, C++17 is required + # https://github.com/accellera-official/systemc/blob/3.0.0/src/CMakeLists.txt#L65 + check_min_cppstd(self, "17") - if ( - conan_version.major == 1 - and self.settings.compiler == "gcc" - and Version(self.settings.compiler.version) <= "5" - ): + if self.settings.os == "Windows" and self.options.shared and Version(self.version) < 3: raise ConanInvalidConfiguration( - f"GCC {self.settings.compiler.version} is not supported by SystemC on Conan v1" + "Building SystemC as a shared library on Windows is currently not supported" ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) @@ -92,10 +91,11 @@ def generate(self): 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) + if Version(self.version) < "3.0.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -122,12 +122,13 @@ def package_info(self): self.cpp_info.components["_systemc"].system_libs = ["pthread", "m"] if is_msvc(self): self.cpp_info.components["_systemc"].cxxflags.append("/vmg") + if Version(self.version) >= 3 and self.options.shared: + # https://github.com/accellera-official/systemc/blob/main/INSTALL.md#33-building-against-a-systemc-dll + self.cpp_info.components["_systemc"].defines = ["SC_WIN_DLL"] + self.cpp_info.components["_systemc"].libs = [f"systemc-{self.version}"] - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.filenames["cmake_find_package"] = "SystemCLanguage" - self.cpp_info.filenames["cmake_find_package_multi"] = "SystemCLanguage" - self.cpp_info.names["cmake_find_package"] = "SystemC" - self.cpp_info.names["cmake_find_package_multi"] = "SystemC" - self.cpp_info.components["_systemc"].names["cmake_find_package"] = "systemc" - self.cpp_info.components["_systemc"].names["cmake_find_package_multi"] = "systemc" self.cpp_info.components["_systemc"].set_property("cmake_target_name", "SystemC::systemc") + if Version(self.version) >= "3" and self.settings.os == "Macos": + # INFO: sanitizer methods are undefined on Mac, need to force linker to ignore them + # https://github.com/accellera-official/systemc/blob/3.0.1/src/CMakeLists.txt#L103 + self.cpp_info.components["_systemc"].exelinkflags = ["LINKER:-U,___sanitizer_start_switch_fiber", "LINKER:-U,___sanitizer_finish_switch_fiber"] diff --git a/recipes/systemc/all/test_v1_package/CMakeLists.txt b/recipes/systemc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/systemc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/systemc/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", "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/config.yml b/recipes/systemc/config.yml index 695969ee424ef..bbc30048885c5 100644 --- a/recipes/systemc/config.yml +++ b/recipes/systemc/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.1": + folder: "all" "2.3.3": folder: "all" "2.3.4": diff --git a/recipes/szip/all/conanfile.py b/recipes/szip/all/conanfile.py index b431b4a8bec9e..a993271ca1e55 100644 --- a/recipes/szip/all/conanfile.py +++ b/recipes/szip/all/conanfile.py @@ -1,11 +1,12 @@ from conan import ConanFile +from conan.errors import ConanException from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, collect_libs, get, copy, replace_in_file, save +from conan.tools.files import apply_conandata_patches, export_conandata_patches, collect_libs, get, copy, replace_in_file from conan.tools.build import cross_building +from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class SzipConan(ConanFile): @@ -16,7 +17,7 @@ class SzipConan(ConanFile): topics = "compression", "decompression" homepage = "https://support.hdfgroup.org/doc_resource/SZIP/" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -81,32 +82,15 @@ def generate(self): tc.variables["TEST_LFS_WORKS_RUN__TRYRUN_OUTPUT"] = 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.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.1.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def package(self): copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() - # 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), - {"szip-shared" if self.options.shared else "szip-static": "szip::szip"} - ) - - def _create_cmake_module_alias_targets(self, 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)) - 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", "szip") @@ -118,7 +102,3 @@ def package_info(self): if self.options.shared: self.cpp_info.defines.append("SZ_BUILT_AS_DYNAMIC_LIB=1") - - # 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/szip/all/test_package/CMakeLists.txt b/recipes/szip/all/test_package/CMakeLists.txt index 2cc3f3a2650b9..3da862e0dc077 100644 --- a/recipes/szip/all/test_package/CMakeLists.txt +++ b/recipes/szip/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) diff --git a/recipes/szip/all/test_v1_package/CMakeLists.txt b/recipes/szip/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 54dab32a19430..0000000000000 --- a/recipes/szip/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - - -find_package(szip REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) - -if(TARGET szip-shared) - target_link_libraries(${PROJECT_NAME} szip-shared) -else () - target_link_libraries(${PROJECT_NAME} szip-static) -endif () diff --git a/recipes/szip/all/test_v1_package/conanfile.py b/recipes/szip/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/szip/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_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/tabulate/all/test_package/CMakeLists.txt b/recipes/tabulate/all/test_package/CMakeLists.txt index 30b68b896d39e..15e30f9ca8cae 100644 --- a/recipes/tabulate/all/test_package/CMakeLists.txt +++ b/recipes/tabulate/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(tabulate REQUIRED CONFIG) diff --git a/recipes/tabulate/all/test_v1_package/CMakeLists.txt b/recipes/tabulate/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/tabulate/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tabulate/all/test_v1_package/conanfile.py b/recipes/tabulate/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/tabulate/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/taglib/all/conandata.yml b/recipes/taglib/all/conandata.yml index af90af9573848..9e6c9ce55c7d0 100644 --- a/recipes/taglib/all/conandata.yml +++ b/recipes/taglib/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.0": + url: "https://taglib.org/releases/taglib-2.0.tar.gz" + sha256: "e36ea877a6370810b97d84cf8f72b1e4ed205149ab3ac8232d44c850f38a2859" + "1.13.1": + url: "https://taglib.org/releases/taglib-1.13.1.tar.gz" + sha256: "c8da2b10f1bfec2cd7dbfcd33f4a2338db0765d851a50583d410bacf055cfd0b" "1.13": url: "https://taglib.org/releases/taglib-1.13.tar.gz" sha256: "58f08b4db3dc31ed152c04896ee9172d22052bc7ef12888028c01d8b1d60ade0" diff --git a/recipes/taglib/all/conanfile.py b/recipes/taglib/all/conanfile.py index 816397a133c86..cbdc12fd0501f 100644 --- a/recipes/taglib/all/conanfile.py +++ b/recipes/taglib/all/conanfile.py @@ -1,9 +1,12 @@ +import os + from conan import ConanFile -from conan.tools.build import stdcpp_library +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import stdcpp_library, 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 +from conan.tools.microsoft import is_msvc_static_runtime from conan.tools.scm import Version -import os required_conan_version = ">=1.54.0" @@ -29,6 +32,21 @@ class TaglibConan(ConanFile): "bindings": True, } + @property + def _min_cppstd(self): + # https://github.com/taglib/taglib/blob/v2.0beta/CMakeLists.txt#L5 + return 17 + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + def export_sources(self): export_conandata_patches(self) @@ -45,6 +63,18 @@ def layout(self): def requirements(self): self.requires("zlib/[>=1.2.11 <2]") + if Version(self.version) >= 2: + self.requires("utfcpp/4.0.4") + + def validate(self): + if Version(self.version) >= 2: + 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) @@ -56,6 +86,7 @@ def generate(self): tc.variables["BUILD_TESTS"] = False tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_BINDINGS"] = self.options.bindings + tc.variables["ENABLE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.generate() cd = CMakeDeps(self) cd.generate() @@ -67,10 +98,7 @@ def _patch_sources(self): os.path.join(self.source_folder, "taglib", "CMakeLists.txt"), os.path.join(self.source_folder, "bindings", "c", "CMakeLists.txt"), ]: - if Version(self.version) >= "1.13": - replace_in_file(self, cmakelists, "INSTALL_NAME_DIR ${CMAKE_INSTALL_LIBDIR}", "") - else: - replace_in_file(self, cmakelists, "INSTALL_NAME_DIR ${LIB_INSTALL_DIR}", "") + replace_in_file(self, cmakelists, "INSTALL_NAME_DIR ${", "# INSTALL_NAME_DIR ${") def build(self): self._patch_sources() @@ -83,6 +111,7 @@ def package(self): cmake = CMake(self) cmake.install() rm(self, "taglib-config", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): @@ -92,6 +121,8 @@ def package_info(self): self.cpp_info.components["tag"].includedirs.append(os.path.join("include", "taglib")) self.cpp_info.components["tag"].libs = ["tag"] self.cpp_info.components["tag"].requires = ["zlib::zlib"] + if Version(self.version) >= 2: + self.cpp_info.components["tag"].requires.append("utfcpp::utfcpp") if not self.options.shared: self.cpp_info.components["tag"].defines.append("TAGLIB_STATIC") if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/taglib/all/test_package/CMakeLists.txt b/recipes/taglib/all/test_package/CMakeLists.txt index ada6c88956048..7aab6c94d88df 100644 --- a/recipes/taglib/all/test_package/CMakeLists.txt +++ b/recipes/taglib/all/test_package/CMakeLists.txt @@ -1,7 +1,10 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(taglib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE taglib::taglib) +if (taglib_VERSION VERSION_GREATER_EQUAL 2) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/taglib/all/test_v1_package/CMakeLists.txt b/recipes/taglib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/taglib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/taglib/all/test_v1_package/conanfile.py b/recipes/taglib/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/taglib/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_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/config.yml b/recipes/taglib/config.yml index c171123076114..72a875c97a160 100644 --- a/recipes/taglib/config.yml +++ b/recipes/taglib/config.yml @@ -1,4 +1,8 @@ versions: + "2.0": + folder: all + "1.13.1": + folder: all "1.13": folder: all "1.12": diff --git a/recipes/taocpp-json/all/test_package/CMakeLists.txt b/recipes/taocpp-json/all/test_package/CMakeLists.txt index bf7290d1f3c3a..beb25c6d0d44e 100644 --- a/recipes/taocpp-json/all/test_package/CMakeLists.txt +++ b/recipes/taocpp-json/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(taocpp-json REQUIRED CONFIG) diff --git a/recipes/taocpp-json/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-json/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2a4b77ef89cd7..0000000000000 --- a/recipes/taocpp-json/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/taocpp-json/all/test_v1_package/conanfile.py b/recipes/taocpp-json/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/taocpp-json/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_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/taocpp-operators/all/test_package/CMakeLists.txt b/recipes/taocpp-operators/all/test_package/CMakeLists.txt index f0441a83fe6de..5836065c8d26b 100644 --- a/recipes/taocpp-operators/all/test_package/CMakeLists.txt +++ b/recipes/taocpp-operators/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(taocpp-operators REQUIRED CONFIG) diff --git a/recipes/taocpp-operators/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-operators/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/taocpp-operators/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/taocpp-operators/all/test_v1_package/conanfile.py b/recipes/taocpp-operators/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/taocpp-operators/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_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/taocpp-pegtl/2.x.x/test_package/CMakeLists.txt b/recipes/taocpp-pegtl/2.x.x/test_package/CMakeLists.txt index 70714c11e2405..5a3f533caf3e6 100644 --- a/recipes/taocpp-pegtl/2.x.x/test_package/CMakeLists.txt +++ b/recipes/taocpp-pegtl/2.x.x/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(pegtl REQUIRED CONFIG) diff --git a/recipes/taocpp-pegtl/2.x.x/test_v1_package/CMakeLists.txt b/recipes/taocpp-pegtl/2.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 799649d28d583..0000000000000 --- a/recipes/taocpp-pegtl/2.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/taocpp-pegtl/2.x.x/test_v1_package/conanfile.py b/recipes/taocpp-pegtl/2.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/taocpp-pegtl/2.x.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/taocpp-pegtl/3.x.x/conandata.yml b/recipes/taocpp-pegtl/3.x.x/conandata.yml index 95cbe48c372b0..686f1e476aeff 100644 --- a/recipes/taocpp-pegtl/3.x.x/conandata.yml +++ b/recipes/taocpp-pegtl/3.x.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.8": + url: "https://github.com/taocpp/PEGTL/archive/3.2.8.tar.gz" + sha256: "319e8238daebc3a163f60c88c78922a8012772076fdd64a8dafaf5619cd64773" "3.2.7": url: "https://github.com/taocpp/PEGTL/archive/3.2.7.tar.gz" sha256: "d6cd113d8bd14e98bcbe7b7f8fc1e1e33448dc359e8cd4cca30e034ec2f0642d" diff --git a/recipes/taocpp-pegtl/3.x.x/conanfile.py b/recipes/taocpp-pegtl/3.x.x/conanfile.py index 367752744a1f1..5ddd704b5c07c 100644 --- a/recipes/taocpp-pegtl/3.x.x/conanfile.py +++ b/recipes/taocpp-pegtl/3.x.x/conanfile.py @@ -11,13 +11,13 @@ class TaoCPPPEGTLConan(ConanFile): name = "taocpp-pegtl" + description = "Parsing Expression Grammar Template Library" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/taocpp/pegtl" - description = "Parsing Expression Grammar Template Library" topics = ("peg", "header-only", "cpp", "parsing", "cpp17", "cpp11", "grammar") - no_copy_source = True + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "boost_filesystem": [True, False], @@ -25,6 +25,7 @@ class TaoCPPPEGTLConan(ConanFile): default_options = { "boost_filesystem": False, } + no_copy_source = True def requirements(self): if self.options.boost_filesystem: @@ -75,6 +76,9 @@ def package(self): 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", "pegtl") self.cpp_info.set_property("cmake_target_name", "taocpp::pegtl") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed diff --git a/recipes/taocpp-pegtl/3.x.x/test_package/CMakeLists.txt b/recipes/taocpp-pegtl/3.x.x/test_package/CMakeLists.txt index 5d60ca38b63f6..a1f8462ffd98b 100644 --- a/recipes/taocpp-pegtl/3.x.x/test_package/CMakeLists.txt +++ b/recipes/taocpp-pegtl/3.x.x/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(pegtl REQUIRED CONFIG) diff --git a/recipes/taocpp-pegtl/3.x.x/test_v1_package/CMakeLists.txt b/recipes/taocpp-pegtl/3.x.x/test_v1_package/CMakeLists.txt deleted file mode 100644 index 799649d28d583..0000000000000 --- a/recipes/taocpp-pegtl/3.x.x/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -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/taocpp-pegtl/3.x.x/test_v1_package/conanfile.py b/recipes/taocpp-pegtl/3.x.x/test_v1_package/conanfile.py deleted file mode 100644 index 2490acfa82ff8..0000000000000 --- a/recipes/taocpp-pegtl/3.x.x/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/taocpp-pegtl/config.yml b/recipes/taocpp-pegtl/config.yml index 768412ab23d94..10a10cf7e0ee7 100644 --- a/recipes/taocpp-pegtl/config.yml +++ b/recipes/taocpp-pegtl/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.8": + folder: "3.x.x" "3.2.7": folder: "3.x.x" "3.2.6": diff --git a/recipes/taocpp-sequences/all/test_package/CMakeLists.txt b/recipes/taocpp-sequences/all/test_package/CMakeLists.txt index 4333a397a88de..8e46c826aef3a 100644 --- a/recipes/taocpp-sequences/all/test_package/CMakeLists.txt +++ b/recipes/taocpp-sequences/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(taocpp-sequences REQUIRED CONFIG) diff --git a/recipes/taocpp-sequences/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-sequences/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/taocpp-sequences/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/taocpp-sequences/all/test_v1_package/conanfile.py b/recipes/taocpp-sequences/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/taocpp-sequences/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_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/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 7ea861e1070ea..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") package_type = "library" - settings = "os", "arch", "build_type", "compiler" + 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", @@ -59,7 +59,6 @@ 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( @@ -71,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) @@ -84,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/all/test_package/CMakeLists.txt b/recipes/taocpp-taopq/all/test_package/CMakeLists.txt index 6e73a15321e7c..be85f2341fd17 100644 --- a/recipes/taocpp-taopq/all/test_package/CMakeLists.txt +++ b/recipes/taocpp-taopq/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(taopq REQUIRED CONFIG) diff --git a/recipes/taocpp-taopq/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-taopq/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/taocpp-taopq/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/taocpp-taopq/all/test_v1_package/conanfile.py b/recipes/taocpp-taopq/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/taocpp-taopq/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_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/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/taocpp-tuple/all/test_package/CMakeLists.txt b/recipes/taocpp-tuple/all/test_package/CMakeLists.txt index 7758d52fe5e89..ace9bfd9a8beb 100644 --- a/recipes/taocpp-tuple/all/test_package/CMakeLists.txt +++ b/recipes/taocpp-tuple/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(taocpp-tuple REQUIRED CONFIG) diff --git a/recipes/taocpp-tuple/all/test_v1_package/CMakeLists.txt b/recipes/taocpp-tuple/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/taocpp-tuple/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/taocpp-tuple/all/test_v1_package/conanfile.py b/recipes/taocpp-tuple/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/taocpp-tuple/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_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/tar/all/conandata.yml b/recipes/tar/all/conandata.yml index 7df28f6d96e37..ab2017a8f4ca5 100644 --- a/recipes/tar/all/conandata.yml +++ b/recipes/tar/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.35": + url: "https://ftp.gnu.org/gnu/tar/tar-1.35.tar.xz" + sha256: "4d62ff37342ec7aed748535323930c7cf94acf71c3591882b26a7ea50f3edc16" "1.32.90": url: "https://alpha.gnu.org/gnu/tar/tar-1.32.90.tar.gz" sha256: "641fe07b7403c8eb801e7bfb91d1b7e5800ab15df524e22e0b2e89501280b6d7" +patches: + "1.35": + - patch_file: "patches/1.35-001-fix-iconv-link.patch" + patch_description: "Fix iconv link" + patch_type: "portability" + patch_source: "http://git.savannah.gnu.org/cgit/tar.git/patch/?id=8632df398b2f548465ebe68b8f494c0d6f8d913d" diff --git a/recipes/tar/all/conanfile.py b/recipes/tar/all/conanfile.py index 96d4365b7ea60..9f5cf868bef7f 100644 --- a/recipes/tar/all/conanfile.py +++ b/recipes/tar/all/conanfile.py @@ -3,10 +3,11 @@ 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.files import apply_conandata_patches, 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 is_msvc +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -26,6 +27,9 @@ class TarConan(ConanFile): def _settings_build(self): return getattr(self, "settings_build", self.settings) + def export_sources(self): + export_conandata_patches(self) + def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") @@ -39,10 +43,15 @@ def package_id(self): def requirements(self): 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("xz_utils/5.4.5", 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 build_requirements(self): + if Version(self.version) == "1.35": + self.build_requires("automake/1.16.5") + self.build_requires("gettext/0.22.5") + 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 @@ -86,6 +95,8 @@ def _patch_sources(self): def build(self): self._patch_sources() autotools = Autotools(self) + if Version(self.version) == "1.35": + autotools.autoreconf() # autoreconf needed after patching autotools.configure() autotools.make() diff --git a/recipes/tar/all/patches/1.35-001-fix-iconv-link.patch b/recipes/tar/all/patches/1.35-001-fix-iconv-link.patch new file mode 100644 index 0000000000000..e433aa6ead2da --- /dev/null +++ b/recipes/tar/all/patches/1.35-001-fix-iconv-link.patch @@ -0,0 +1,24 @@ +From 8632df398b2f548465ebe68b8f494c0d6f8d913d Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Tue, 18 Jul 2023 17:02:23 +0300 +Subject: Fix savannah bug #64441 + +* src/Makefile.am (tar_LDADD): Add libiconv libraries. +--- + src/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 36c9543..e2ec58d 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -52,4 +52,5 @@ AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) + tar_LDADD = $(LIBS) ../lib/libtar.a ../gnu/libgnu.a\ + $(LIB_ACL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)\ + $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) $(FILE_HAS_ACL_LIB) $(LIB_MBRTOWC)\ +- $(LIB_SELINUX) $(LIB_SETLOCALE_NULL) ++ $(LIB_SELINUX) $(LIB_SETLOCALE_NULL) \ ++ $(LIBINTL) $(LIBICONV) +-- +cgit v1.1 + diff --git a/recipes/tar/all/test_v1_package/conanfile.py b/recipes/tar/all/test_v1_package/conanfile.py deleted file mode 100644 index 68b1151321a11..0000000000000 --- a/recipes/tar/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/tar/config.yml b/recipes/tar/config.yml index b21f806d0621e..65088c19d5771 100644 --- a/recipes/tar/config.yml +++ b/recipes/tar/config.yml @@ -1,3 +1,5 @@ versions: + "1.35": + folder: "all" "1.32.90": folder: "all" diff --git a/recipes/taskflow/all/conandata.yml b/recipes/taskflow/all/conandata.yml index d4e7661550418..5c2c329c5fb03 100644 --- a/recipes/taskflow/all/conandata.yml +++ b/recipes/taskflow/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "3.10.0": + url: "https://github.com/taskflow/taskflow/archive/v3.10.0.tar.gz" + sha256: "fe86765da417f6ceaa2d232ffac70c9afaeb3dc0816337d39a7c93e39c2dee0b" + "3.9.0": + url: "https://github.com/taskflow/taskflow/archive/v3.9.0.tar.gz" + sha256: "d872a19843d12d437eba9b8664835b7537b92fe01fdb33ed92ca052d2483be2d" + "3.8.0": + url: "https://github.com/taskflow/taskflow/archive/v3.8.0.tar.gz" + sha256: "51316ee5fbf0c8f8f4638eb7428430cadfe6e8910756593884710e99129fa0ab" + "3.7.0": + url: "https://github.com/taskflow/taskflow/archive/v3.7.0.tar.gz" + sha256: "788b88093fb3788329ebbf7c7ee05d1f8960d974985a301798df01e77e04233b" "3.6.0": url: "https://github.com/taskflow/taskflow/archive/v3.6.0.tar.gz" sha256: "5a1cd9cf89f93a97fcace58fd73ed2fc8ee2053bcb43e047acb6bc121c3edf4c" @@ -17,18 +29,6 @@ sources: "3.1.0": url: "https://github.com/taskflow/taskflow/archive/v3.1.0.tar.gz" sha256: "B83E9A78C254D831B8401D0F8A766E3C5B60D8D20BE5AF6E2D2FAD4AA4A8B980" - "3.0.0": - url: "https://github.com/taskflow/taskflow/archive/v3.0.0.tar.gz" - sha256: "553C88A6E56E115D29AC1520B8A0FEA4557A5FCDA1AF1427BD3BA454926D03A2" - "2.7.0": - url: "https://github.com/taskflow/taskflow/archive/v2.7.0.tar.gz" - sha256: "BC2227DCABEC86ABEBA1FEE56BB357D9D3C0EF0184F7C2275D7008E8758DFC3E" - "2.6.0": - url: "https://github.com/taskflow/taskflow/archive/v2.6.0.tar.gz" - sha256: "2F511F4291653D759AF12A7854BABCEBF57CFBB8B49BF6CD3EB0DD98A1A4039C" - "2.5.0": - url: "https://github.com/taskflow/taskflow/archive/v2.5.0.tar.gz" - sha256: "B7016EE3486458AE401D521EA6BC0403DDE975828038B9734621A6A325ACAC1A" patches: "3.3.0": - patch_file: "patches/3.3.0-immintrin-guard.patch" diff --git a/recipes/taskflow/all/conanfile.py b/recipes/taskflow/all/conanfile.py index 7d914d16abb83..b7c01ed9815d0 100644 --- a/recipes/taskflow/all/conanfile.py +++ b/recipes/taskflow/all/conanfile.py @@ -26,26 +26,17 @@ class TaskflowConan(ConanFile): @property def _min_cppstd(self): - if Version(self.version) >= "3.0.0": - return "17" - return "14" + return "17" @property def _compilers_minimum_version(self): return { - "17": { - "Visual Studio": "16", - "gcc": "7.3", - "clang": "6.0", - "apple-clang": "10.0", - }, - "14": { - "Visual Studio": "15", - "gcc": "5", - "clang": "4.0", - "apple-clang": "8.0", - }, - }[self._min_cppstd] + "Visual Studio": "16", + "msvc": "192", + "gcc": "7.3" if Version(self.version) < "3.7.0" else "8.4", + "clang": "6.0", + "apple-clang": "10.0", + } def export_sources(self): export_conandata_patches(self) diff --git a/recipes/taskflow/all/test_package/CMakeLists.txt b/recipes/taskflow/all/test_package/CMakeLists.txt index 1f7019bf5d65a..da8ef3fe7c5fe 100644 --- a/recipes/taskflow/all/test_package/CMakeLists.txt +++ b/recipes/taskflow/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(Taskflow REQUIRED CONFIG) diff --git a/recipes/taskflow/all/test_v1_package/CMakeLists.txt b/recipes/taskflow/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/taskflow/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/taskflow/all/test_v1_package/conanfile.py b/recipes/taskflow/all/test_v1_package/conanfile.py deleted file mode 100644 index 94b8dc83beff4..0000000000000 --- a/recipes/taskflow/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, tools, CMake -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/taskflow/config.yml b/recipes/taskflow/config.yml index 36b5f1772375b..42d7efe84b538 100644 --- a/recipes/taskflow/config.yml +++ b/recipes/taskflow/config.yml @@ -1,4 +1,12 @@ versions: + "3.10.0": + folder: all + "3.9.0": + folder: all + "3.8.0": + folder: all + "3.7.0": + folder: all "3.6.0": folder: all "3.5.0": @@ -11,11 +19,3 @@ versions: folder: all "3.1.0": folder: all - "3.0.0": - folder: all - "2.7.0": - folder: all - "2.6.0": - folder: all - "2.5.0": - folder: all diff --git a/recipes/taywee-args/all/test_package/CMakeLists.txt b/recipes/taywee-args/all/test_package/CMakeLists.txt index 0a8e53f1264f3..f25eff8431a78 100644 --- a/recipes/taywee-args/all/test_package/CMakeLists.txt +++ b/recipes/taywee-args/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(args REQUIRED CONFIG) diff --git a/recipes/taywee-args/all/test_v1_package/CMakeLists.txt b/recipes/taywee-args/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/taywee-args/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/taywee-args/all/test_v1_package/conanfile.py b/recipes/taywee-args/all/test_v1_package/conanfile.py deleted file mode 100644 index 3e9c09d77df0c..0000000000000 --- a/recipes/taywee-args/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_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(f"{bin_path} -h", run_environment=True) diff --git a/recipes/tbb/all/test_package/CMakeLists.txt b/recipes/tbb/all/test_package/CMakeLists.txt index d5a40167452f4..77a9fc814752c 100644 --- a/recipes/tbb/all/test_package/CMakeLists.txt +++ b/recipes/tbb/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/tcb-span/all/test_package/CMakeLists.txt b/recipes/tcb-span/all/test_package/CMakeLists.txt index 858448385983d..8eb68d3d5823d 100644 --- a/recipes/tcb-span/all/test_package/CMakeLists.txt +++ b/recipes/tcb-span/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(tcb-span REQUIRED CONFIG) diff --git a/recipes/tcb-span/all/test_v1_package/CMakeLists.txt b/recipes/tcb-span/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 6930ecd6ea58a..0000000000000 --- a/recipes/tcb-span/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tcb-span REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cxx) -target_link_libraries(${PROJECT_NAME} PRIVATE tcb-span::tcb-span) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tcb-span/all/test_v1_package/conanfile.py b/recipes/tcb-span/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/tcb-span/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/tcl/all/conanfile.py b/recipes/tcl/all/conanfile.py index 1722816dbfb14..f3487edb47074 100644 --- a/recipes/tcl/all/conanfile.py +++ b/recipes/tcl/all/conanfile.py @@ -5,6 +5,7 @@ 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, 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 @@ -48,9 +49,9 @@ 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.11 <2]") @@ -82,7 +83,7 @@ def generate(self): env = VirtualRunEnv(self) env.generate(scope="build") - tc = AutotoolsToolchain(self, prefix=self.package_folder) + tc = AutotoolsToolchain(self) def yes_no(v): return "yes" if v else "no" tc.configure_args.extend([ "--enable-threads", @@ -94,25 +95,14 @@ def yes_no(v): return "yes" if v else "no" deps = AutotoolsDeps(self) deps.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) - 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"), @@ -127,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 <$@") @@ -157,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")) @@ -184,49 +195,37 @@ 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 = [] - 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 + # There are other libs in subfolders, but they are only used + # for TCL extensions and should not be linked against. + self.cpp_info.libs = collect_libs(self, os.path.join(self.package_folder, "lib")) if self.settings.os == "Windows": self.cpp_info.system_libs.extend(["ws2_32", "netapi32", "userenv"]) diff --git a/recipes/tclap/all/test_package/CMakeLists.txt b/recipes/tclap/all/test_package/CMakeLists.txt index abb2293e73c6e..c4a5993a2f6df 100644 --- a/recipes/tclap/all/test_package/CMakeLists.txt +++ b/recipes/tclap/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(tclap REQUIRED CONFIG) diff --git a/recipes/tclap/all/test_v1_package/CMakeLists.txt b/recipes/tclap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/tclap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/tclap/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", "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/test_v1_package/CMakeLists.txt b/recipes/tcp-wrappers/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tcp-wrappers/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/tcp-wrappers/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", "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/test_v1_package/CMakeLists.txt b/recipes/tcsbank-uconfig/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tcsbank-uconfig/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6bbeeb230e6b0..0000000000000 --- a/recipes/tcsbank-uconfig/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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-uri-template/all/conanfile.py b/recipes/tcsbank-uri-template/all/conanfile.py index aed3fb5a97334..c3d69ed3886ce 100644 --- a/recipes/tcsbank-uri-template/all/conanfile.py +++ b/recipes/tcsbank-uri-template/all/conanfile.py @@ -4,10 +4,10 @@ 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.files import collect_libs, copy, get, rmdir from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class TCSBankUriTemplateConan(ConanFile): @@ -29,9 +29,6 @@ class TCSBankUriTemplateConan(ConanFile): "fPIC": True, } - def export_sources(self): - export_conandata_patches(self) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -82,6 +79,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["URITEMPLATE_BUILD_TESTING"] = False + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -101,7 +99,3 @@ def package_info(self): 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" diff --git a/recipes/tcsbank-uri-template/all/test_v1_package/CMakeLists.txt b/recipes/tcsbank-uri-template/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tcsbank-uri-template/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/tcsbank-uri-template/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", "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/teemo/all/test_package/CMakeLists.txt b/recipes/teemo/all/test_package/CMakeLists.txt index caf3475df9376..1fccef0e48bf1 100644 --- a/recipes/teemo/all/test_package/CMakeLists.txt +++ b/recipes/teemo/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) diff --git a/recipes/teemo/all/test_v1_package/CMakeLists.txt b/recipes/teemo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/teemo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/teemo/all/test_v1_package/conanfile.py b/recipes/teemo/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/teemo/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/tensorflow-lite/all/conandata.yml b/recipes/tensorflow-lite/all/conandata.yml index 4727adcc61017..ab25e5805cf91 100644 --- a/recipes/tensorflow-lite/all/conandata.yml +++ b/recipes/tensorflow-lite/all/conandata.yml @@ -1,26 +1,49 @@ sources: + "2.15.0": + url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.15.0.tar.gz" + sha256: "9cec5acb0ecf2d47b16891f8bc5bc6fbfdffe1700bdadc0d9ebe27ea34f0c220" "2.12.0": - url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.10.0.tar.gz" - sha256: "b5a1bb04c84b6fe1538377e5a1f649bb5d5f0b2e3625a3c526ff3a8af88633e8" + url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.12.0.tar.gz" + sha256: "c030cb1905bff1d2446615992aad8d8d85cbe90c4fb625cee458c63bf466bc8e" "2.10.0": url: "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.10.0.tar.gz" sha256: "b5a1bb04c84b6fe1538377e5a1f649bb5d5f0b2e3625a3c526ff3a8af88633e8" patches: + "2.15.0": + - patch_file: "patches/2.15.0-0001-disable-fetch-content.patch" + patch_description: "Fail if the CMake build script tries to fetch external dependencies" + patch_type: "conan" + - patch_file: "patches/2.15.0-0002-windows-mmap.patch" + patch_description: "Disable mmap on Windows." + patch_type: "bugfix" + patch_source: "https://github.com/tensorflow/tensorflow/pull/62636" + - patch_file: "patches/2.15.0-0003-use-cci-dependencies.patch" + patch_description: "Dependency compatibility: Patch CMakeLists.txt, updating package names, target names, etc" + patch_type: "conan" "2.12.0": - - patch_file: "patches/remove_simple_memory_arena_debug_dump.patch" + - patch_file: "patches/2.12.0-0001-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_type: "conan" + - patch_file: "patches/2.12.0-0002-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_file: "patches/2.12.0-0003-use-cci-dependencies.patch" patch_description: "Dependency compatibility: Patch CMakeLists.txt, updating package names, target names, etc" patch_type: "conan" + - patch_file: "patches/2.12.0-0004-use-add-stdint-for-int-types.patch" + patch_description: "Add stdint.h for int types in internal::Spectrogram" + patch_type: "bugfix" + patch_source: "https://github.com/tensorflow/tensorflow/pull/60299" "2.10.0": - - patch_file: "patches/remove_simple_memory_arena_debug_dump.patch" + - patch_file: "patches/2.10.0-0001-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_file: "patches/2.10.0-0002-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_file: "patches/2.10.0-0003-use-cci-dependencies.patch" patch_description: "Dependency compatibility: Patch CMakeLists.txt, updating package names, target names, etc" patch_type: "conan" + - patch_file: "patches/2.10.0-0004-use-add-stdint-for-int-types.patch" + patch_description: "Add stdint.h for int types in internal::Spectrogram" + patch_type: "bugfix" + patch_source: "https://github.com/tensorflow/tensorflow/pull/60299" diff --git a/recipes/tensorflow-lite/all/conanfile.py b/recipes/tensorflow-lite/all/conanfile.py index 5b4b074e11411..dd383c7b99b3e 100644 --- a/recipes/tensorflow-lite/all/conanfile.py +++ b/recipes/tensorflow-lite/all/conanfile.py @@ -72,22 +72,31 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + @property + def _needs_fxdiv(self): + return Version(self.version) >= "2.12.0" + def requirements(self): - self.requires("abseil/20230125.1") + self.requires("abseil/20230125.3") self.requires("eigen/3.4.0") self.requires("farmhash/cci.20190513") self.requires("fft/cci.20061228") - self.requires("flatbuffers/23.3.3", transitive_headers=True) + if Version(self.version) < "2.15.0": + self.requires("flatbuffers/23.3.3", transitive_headers=True) + else: + self.requires("flatbuffers/23.5.26", transitive_headers=True) self.requires("gemmlowp/cci.20210928") - self.requires("ruy/cci.20220628") + self.requires("ruy/cci.20231129") if self.settings.arch in ("x86", "x86_64"): self.requires("intel-neon2sse/cci.20210225") if self.options.with_xnnpack: - self.requires("xnnpack/cci.20220801") - # https://github.com/tensorflow/tensorflow/blob/359c3cdfc5fabac82b3c70b3b6de2b0a8c16874f/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc#L165 - self.requires("pthreadpool/cci.20210218") + self.requires("xnnpack/cci.20231026") + if Version(self.version) >= "2.12.0" or self.options.with_xnnpack: + self.requires("pthreadpool/cci.20231129") if self.options.with_xnnpack or self.options.get_safe("with_nnapi", False): self.requires("fp16/cci.20210320") + if self._needs_fxdiv: + self.requires("fxdiv/cci.20200417") def validate(self): if self.settings.get_safe("compiler.cppstd"): @@ -117,6 +126,7 @@ def generate(self): "TFLITE_ENABLE_XNNPACK": self.options.with_xnnpack, "TFLITE_ENABLE_MMAP": self.options.get_safe("with_mmap", False), "FETCHCONTENT_FULLY_DISCONNECTED": True, + "SYSTEM_PTHREADPOOL": True, "clog_POPULATED": True, }) if self.settings.arch == "armv8": @@ -151,9 +161,10 @@ def _module_file(self): def package(self): copy(self, "LICENSE", self.source_folder, join(self.package_folder, "licenses")) copy(self, "*.h", join(self.source_folder, "tensorflow", "lite"), join(self.package_folder, "include", "tensorflow", "lite")) - copy(self, "*.a", self.build_folder, join(self.package_folder, "lib")) - copy(self, "*.so", self.build_folder, join(self.package_folder, "lib")) - copy(self, "*.dylib", self.build_folder, join(self.package_folder, "lib")) + copy(self, "version.h", join(self.source_folder, "tensorflow", "core", "public"), join(self.package_folder, "include", "tensorflow", "core", "public")) + copy(self, "*.a", self.build_folder, join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.so", self.build_folder, join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dylib", self.build_folder, join(self.package_folder, "lib"), keep_path=False) copy(self, "*.lib", self.build_folder, join(self.package_folder, "lib"), keep_path=False) copy(self, "*.dll", self.build_folder, join(self.package_folder, "bin"), keep_path=False) self._create_cmake_module_alias_target(self, join(self.package_folder, self._module_file)) diff --git a/recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch b/recipes/tensorflow-lite/all/patches/2.10.0-0001-remove_simple_memory_arena_debug_dump.patch similarity index 100% rename from recipes/tensorflow-lite/all/patches/remove_simple_memory_arena_debug_dump.patch rename to recipes/tensorflow-lite/all/patches/2.10.0-0001-remove_simple_memory_arena_debug_dump.patch diff --git a/recipes/tensorflow-lite/all/patches/disable_fetch_content.patch b/recipes/tensorflow-lite/all/patches/2.10.0-0002-disable_fetch_content.patch similarity index 100% rename from recipes/tensorflow-lite/all/patches/disable_fetch_content.patch rename to recipes/tensorflow-lite/all/patches/2.10.0-0002-disable_fetch_content.patch diff --git a/recipes/tensorflow-lite/all/patches/dependencies_2_10.patch b/recipes/tensorflow-lite/all/patches/2.10.0-0003-use-cci-dependencies.patch similarity index 100% rename from recipes/tensorflow-lite/all/patches/dependencies_2_10.patch rename to recipes/tensorflow-lite/all/patches/2.10.0-0003-use-cci-dependencies.patch diff --git a/recipes/tensorflow-lite/all/patches/2.10.0-0004-use-add-stdint-for-int-types.patch b/recipes/tensorflow-lite/all/patches/2.10.0-0004-use-add-stdint-for-int-types.patch new file mode 100644 index 0000000000000..b57b09d18bd58 --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/2.10.0-0004-use-add-stdint-for-int-types.patch @@ -0,0 +1,12 @@ +diff --git a/tensorflow/lite/kernels/internal/spectrogram.cc b/tensorflow/lite/kernels/internal/spectrogram.cc +index a832962a..919eebeb 100644 +--- a/tensorflow/lite/kernels/internal/spectrogram.cc ++++ b/tensorflow/lite/kernels/internal/spectrogram.cc +@@ -17,6 +17,7 @@ limitations under the License. + + #include + #include ++#include + + #include "third_party/fft2d/fft.h" + diff --git a/recipes/tensorflow-lite/all/patches/2.12.0-0001-remove_simple_memory_arena_debug_dump.patch b/recipes/tensorflow-lite/all/patches/2.12.0-0001-remove_simple_memory_arena_debug_dump.patch new file mode 100644 index 0000000000000..4753a3d1bac63 --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/2.12.0-0001-remove_simple_memory_arena_debug_dump.patch @@ -0,0 +1,14 @@ +diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt +index c71a392..7260efe 100644 +--- a/tensorflow/lite/CMakeLists.txt ++++ b/tensorflow/lite/CMakeLists.txt +@@ -221,6 +221,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "Android") + endif() + # Build a list of source files to compile into the TF Lite library. + populate_tflite_source_vars("." TFLITE_SRCS) ++if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND BUILD_SHARED_LIBS) ++ list(FILTER TFLITE_SRCS EXCLUDE REGEX ".*simple_memory_arena_debug_dump\\.cc$") ++endif() + + # This particular file is excluded because the more explicit approach to enable + # XNNPACK delegate is preferred to the weak-symbol one. diff --git a/recipes/tensorflow-lite/all/patches/2.12.0-0002-disable-fetch-content.patch b/recipes/tensorflow-lite/all/patches/2.12.0-0002-disable-fetch-content.patch new file mode 100644 index 0000000000000..d3bfdf275681e --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/2.12.0-0002-disable-fetch-content.patch @@ -0,0 +1,12 @@ +diff --git a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake b/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake +index 9ed9510..4a6a45d 100644 +--- a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake ++++ b/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake +@@ -251,6 +251,7 @@ function(OverridableFetchContent_Declare CONTENT_NAME) + URL_HASH + URL_MD5 + ) ++ message(FATAL_ERROR "OverridableFetchContent_Declare called by ${CONTENT_NAME}! Failing build.") + set(ALL_VALUE_ARGS LICENSE_FILE LICENSE_URL ${OVERRIDABLE_ARGS}) + cmake_parse_arguments(ARGS + "" diff --git a/recipes/tensorflow-lite/all/patches/2.12.0-0003-use-cci-dependencies.patch b/recipes/tensorflow-lite/all/patches/2.12.0-0003-use-cci-dependencies.patch new file mode 100644 index 0000000000000..be146c5e56c09 --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/2.12.0-0003-use-cci-dependencies.patch @@ -0,0 +1,103 @@ +diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt +index 24b8265..d95c0ae 100644 +--- a/tensorflow/lite/CMakeLists.txt ++++ b/tensorflow/lite/CMakeLists.txt +@@ -142,31 +142,17 @@ endmacro() + find_package(absl REQUIRED) + find_package(Eigen3 REQUIRED) + find_package(farmhash REQUIRED) +-find_package(fft2d REQUIRED) ++find_package(fft REQUIRED) + find_package(Flatbuffers REQUIRED) + find_package(gemmlowp REQUIRED) +-find_package(NEON_2_SSE REQUIRED) + find_package(cpuinfo REQUIRED) #CPUINFO is used by XNNPACK and RUY library + find_package(ruy REQUIRED) +-# Download necessary dependencies. +-# Download pthreadpool source package if it doesn't exist. +-if(NOT DEFINED PTHREADPOOL_SOURCE_DIR) +- message(STATUS "Downloading pthreadpool to ${CMAKE_BINARY_DIR}/pthreadpool-source (define PTHREADPOOL_SOURCE_DIR to avoid it)") +- configure_file(cmake/DownloadPThreadPool.cmake "${CMAKE_BINARY_DIR}/pthreadpool-download/CMakeLists.txt") +- execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . +- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/pthreadpool-download") +- execute_process(COMMAND "${CMAKE_COMMAND}" --build . +- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/pthreadpool-download") +- set(PTHREADPOOL_SOURCE_DIR "${CMAKE_BINARY_DIR}/pthreadpool-source" CACHE STRING "pthreadpool source directory") +-endif() +-# Configure pthreadpool +-if(NOT TARGET pthreadpool) +- set(PTHREADPOOL_BUILD_TESTS OFF CACHE BOOL "") +- set(PTHREADPOOL_BUILD_BENCHMARKS OFF CACHE BOOL "") +- set(PTHREADPOOL_ALLOW_DEPRECATED_API OFF CACHE BOOL "") +- add_subdirectory( +- "${PTHREADPOOL_SOURCE_DIR}" +- "${CMAKE_BINARY_DIR}/pthreadpool") ++find_package(pthreadpool REQUIRED) ++ ++if(TARGET flatbuffers::flatbuffers_shared) ++ set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared) ++else() ++ set(FLATBUFFERS_TARGET flatbuffers::flatbuffers) + endif() + set(TF_TARGET_PRIVATE_OPTIONS "") + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang$") +@@ -180,6 +166,10 @@ set(TFLITE_TARGET_PRIVATE_OPTIONS "") + set(TFLITE_TARGET_PRIVATE_DEFINITIONS "") + # Additional library dependencies based upon enabled features. + set(TFLITE_TARGET_DEPENDENCIES "") ++if (NOT CMAKE_SYSTEM_PROCESSOR OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86") ++ find_package(NEON_2_SSE REQUIRED) ++ list(APPEND TFLITE_TARGET_DEPENDENCIES NEON_2_SSE::NEON_2_SSE) ++endif() + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang$") + # TFLite uses deprecated methods in neon2sse which generates a huge number of + # warnings so surpress these until they're fixed. +@@ -429,13 +419,13 @@ else() + endif() + if(TFLITE_ENABLE_XNNPACK) + find_package(fp16_headers REQUIRED) +- find_package(XNNPACK REQUIRED) ++ find_package(xnnpack REQUIRED) + populate_tflite_source_vars("delegates/xnnpack" + TFLITE_DELEGATES_XNNPACK_SRCS + FILTER ".*(_test|_tester)\\.(cc|h)" + ) + list(APPEND TFLITE_TARGET_DEPENDENCIES +- XNNPACK ++ xnnpack::xnnpack + ) + list(APPEND TFLITE_TARGET_PUBLIC_OPTIONS "-DTFLITE_BUILD_WITH_XNNPACK_DELEGATE") + endif() +@@ -492,6 +482,7 @@ populate_tflite_source_vars("kernels/internal/reference/sparse_ops" + TFLITE_KERNEL_INTERNAL_REF_SPARSE_OPS_SRCS + ) + set(TFLITE_PROFILER_SRCS ++${TFLITE_SOURCE_DIR}/profiling/telemetry/telemetry.cc + ${TFLITE_SOURCE_DIR}/profiling/platform_profiler.cc + ${TFLITE_SOURCE_DIR}/profiling/root_profiler.h + ${TFLITE_SOURCE_DIR}/profiling/root_profiler.cc +@@ -555,19 +546,18 @@ target_include_directories(tensorflow-lite + target_link_libraries(tensorflow-lite + PUBLIC + Eigen3::Eigen +- NEON_2_SSE::NEON_2_SSE + absl::flags + absl::hash + absl::status + absl::strings + absl::synchronization + absl::variant +- farmhash +- fft2d_fftsg2d +- flatbuffers::flatbuffers +- gemmlowp ++ farmhash::farmhash ++ fft::fft ++ ${FLATBUFFERS_TARGET} ++ gemmlowp::eight_bit_int_gemm + ruy::ruy +- pthreadpool ++ pthreadpool::pthreadpool + ${CMAKE_DL_LIBS} + ${TFLITE_TARGET_DEPENDENCIES} + ) diff --git a/recipes/tensorflow-lite/all/patches/2.12.0-0004-use-add-stdint-for-int-types.patch b/recipes/tensorflow-lite/all/patches/2.12.0-0004-use-add-stdint-for-int-types.patch new file mode 100644 index 0000000000000..b57b09d18bd58 --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/2.12.0-0004-use-add-stdint-for-int-types.patch @@ -0,0 +1,12 @@ +diff --git a/tensorflow/lite/kernels/internal/spectrogram.cc b/tensorflow/lite/kernels/internal/spectrogram.cc +index a832962a..919eebeb 100644 +--- a/tensorflow/lite/kernels/internal/spectrogram.cc ++++ b/tensorflow/lite/kernels/internal/spectrogram.cc +@@ -17,6 +17,7 @@ limitations under the License. + + #include + #include ++#include + + #include "third_party/fft2d/fft.h" + diff --git a/recipes/tensorflow-lite/all/patches/2.15.0-0001-disable-fetch-content.patch b/recipes/tensorflow-lite/all/patches/2.15.0-0001-disable-fetch-content.patch new file mode 100644 index 0000000000000..adc6f0561afef --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/2.15.0-0001-disable-fetch-content.patch @@ -0,0 +1,12 @@ +diff --git a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake b/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake +index 9ed95109ba9..4ddf322b95f 100644 +--- a/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake ++++ b/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake +@@ -244,6 +244,7 @@ endfunction() + # All content names passed to this method are added to the global property + # OVERRIDABLE_FETCH_CONTENT_LIST. + function(OverridableFetchContent_Declare CONTENT_NAME) ++ message(FATAL_ERROR "OverridableFetchContent_Declare called by ${CONTENT_NAME}! Failing build.") + set(OVERRIDABLE_ARGS + GIT_REPOSITORY + GIT_TAG diff --git a/recipes/tensorflow-lite/all/patches/2.15.0-0002-windows-mmap.patch b/recipes/tensorflow-lite/all/patches/2.15.0-0002-windows-mmap.patch new file mode 100644 index 0000000000000..1305e34c37c6d --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/2.15.0-0002-windows-mmap.patch @@ -0,0 +1,20 @@ +commit 77056b1ab930c36c8066446615577be4d121e3ea +Author: talyz +Date: Thu Dec 14 11:43:16 2023 +0100 + + cmake: Disable the use of mmap on Windows + +diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt +index 83bc7629004..0958ed1b9ce 100644 +--- a/tensorflow/lite/CMakeLists.txt ++++ b/tensorflow/lite/CMakeLists.txt +@@ -202,7 +202,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows") + # Use NOMINMAX to disable the min / max macros in windows.h as they break + # use of std::min std::max. + # Use NOGDI to ERROR macro which breaks TensorFlow logging. +- list(APPEND TFLITE_TARGET_PRIVATE_OPTIONS "-DNOMINMAX" "-DNOGDI") ++ # Disable mmap, which is not available on Windows. ++ list(APPEND TFLITE_TARGET_PRIVATE_OPTIONS "-DNOMINMAX" "-DNOGDI" "-DTFLITE_MMAP_DISABLED") + # lite/kernels/conv.cc has more than 64k sections so enable /bigobj to + # support compilation with MSVC2015. + if(MSVC) diff --git a/recipes/tensorflow-lite/all/patches/2.15.0-0003-use-cci-dependencies.patch b/recipes/tensorflow-lite/all/patches/2.15.0-0003-use-cci-dependencies.patch new file mode 100644 index 0000000000000..2c7c5965e2927 --- /dev/null +++ b/recipes/tensorflow-lite/all/patches/2.15.0-0003-use-cci-dependencies.patch @@ -0,0 +1,68 @@ +diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt +index 0958ed1b9ce..13d06f12ca6 100644 +--- a/tensorflow/lite/CMakeLists.txt ++++ b/tensorflow/lite/CMakeLists.txt +@@ -147,7 +147,7 @@ set(TFLITE_TARGET_DEPENDENCIES "") + find_package(absl REQUIRED) + find_package(Eigen3 REQUIRED) + find_package(farmhash REQUIRED) +-find_package(fft2d REQUIRED) ++find_package(fft REQUIRED) + find_package(FlatBuffers REQUIRED) + find_package(gemmlowp REQUIRED) + if (NOT CMAKE_SYSTEM_PROCESSOR OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86") +@@ -155,7 +155,6 @@ if (NOT CMAKE_SYSTEM_PROCESSOR OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86") + list(APPEND TFLITE_TARGET_DEPENDENCIES NEON_2_SSE::NEON_2_SSE) + endif() + find_package(cpuinfo REQUIRED) #CPUINFO is used by XNNPACK and RUY library +-find_package(ml_dtypes REQUIRED) + find_package(ruy REQUIRED) + # Include TSL, which is in tensorflow/third_party + include_directories( +@@ -183,6 +182,11 @@ if(NOT SYSTEM_PTHREADPOOL AND NOT TARGET pthreadpool) + "${PTHREADPOOL_SOURCE_DIR}" + "${CMAKE_BINARY_DIR}/pthreadpool") + endif() ++if(TARGET flatbuffers::flatbuffers_shared) ++ set(FLATBUFFERS_TARGET flatbuffers::flatbuffers_shared) ++else() ++ set(FLATBUFFERS_TARGET flatbuffers::flatbuffers) ++endif() + set(TF_TARGET_PRIVATE_OPTIONS "") + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang$") + # TensorFlow uses a heap of deprecated proto fields so surpress these +@@ -483,13 +487,13 @@ else() + endif() + if(TFLITE_ENABLE_XNNPACK) + find_package(fp16_headers REQUIRED) +- find_package(XNNPACK REQUIRED) ++ find_package(xnnpack REQUIRED) + populate_tflite_source_vars("delegates/xnnpack" + TFLITE_DELEGATES_XNNPACK_SRCS + FILTER ".*(_test|_tester)\\.(cc|h)" + ) + list(APPEND TFLITE_TARGET_DEPENDENCIES +- XNNPACK ++ xnnpack::xnnpack + ) + list(APPEND TFLITE_TARGET_PUBLIC_OPTIONS "-DTFLITE_BUILD_WITH_XNNPACK_DELEGATE") + endif() +@@ -633,13 +637,12 @@ target_link_libraries(tensorflow-lite + absl::strings + absl::synchronization + absl::variant +- farmhash +- fft2d_fftsg2d +- flatbuffers::flatbuffers +- gemmlowp::gemmlowp +- ml_dtypes ++ farmhash::farmhash ++ fft::fft ++ ${FLATBUFFERS_TARGET} ++ gemmlowp::eight_bit_int_gemm + ruy::ruy +- pthreadpool ++ pthreadpool::pthreadpool + ${CMAKE_DL_LIBS} + ${TFLITE_TARGET_DEPENDENCIES} + ) diff --git a/recipes/tensorflow-lite/all/test_package/CMakeLists.txt b/recipes/tensorflow-lite/all/test_package/CMakeLists.txt index b1b0f24e0aa99..befcd3f7e5209 100644 --- a/recipes/tensorflow-lite/all/test_package/CMakeLists.txt +++ b/recipes/tensorflow-lite/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(tensorflowlite REQUIRED CONFIG) diff --git a/recipes/tensorflow-lite/all/test_package/conanfile.py b/recipes/tensorflow-lite/all/test_package/conanfile.py index 841a097747d32..8321ed4e2de49 100644 --- a/recipes/tensorflow-lite/all/test_package/conanfile.py +++ b/recipes/tensorflow-lite/all/test_package/conanfile.py @@ -22,6 +22,5 @@ def build(self): def test(self): if can_run(self): - model_path = os.path.join(self.source_folder, "model.tflite") command = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(f"{command} {model_path}", env="conanrun") + self.run(command, env="conanrun") diff --git a/recipes/tensorflow-lite/all/test_package/model.tflite b/recipes/tensorflow-lite/all/test_package/model.tflite deleted file mode 100644 index 281cb988ba465..0000000000000 Binary files a/recipes/tensorflow-lite/all/test_package/model.tflite and /dev/null differ diff --git a/recipes/tensorflow-lite/all/test_package/test_package.cpp b/recipes/tensorflow-lite/all/test_package/test_package.cpp index 4a4921bbf217f..21834b32a2984 100644 --- a/recipes/tensorflow-lite/all/test_package/test_package.cpp +++ b/recipes/tensorflow-lite/all/test_package/test_package.cpp @@ -1,40 +1,15 @@ -#include #include #include -#include - #include -#include int main(int argc, char * argv[]) { - if ( argc != 2) { - std::cerr << "Pass model file path as argument" << std::endl; - return -1; - } - auto model = tflite::FlatBufferModel::BuildFromFile(argv[1]); - if (!model) { - throw std::runtime_error("Failed to load TFLite model"); - } - - tflite::ops::builtin::BuiltinOpResolver resolver; - tflite::InterpreterBuilder builder(*model, resolver); std::unique_ptr interpreter; - builder(&interpreter); + interpreter = std::make_unique(); - if (interpreter->AllocateTensors() != kTfLiteOk) { - throw std::runtime_error("Failed to allocate tensors"); - } + const int num_tensors = interpreter->tensors_size(); + std::cout << "Number of tensors in the interpreter: " << num_tensors << std::endl; - tflite::PrintInterpreterState(interpreter.get()); - auto input = interpreter->typed_input_tensor(0); - *input = 42.0F; - std::cout << "==== Running SQUARE(x) Model ====\n\n"; - if (interpreter->Invoke() != kTfLiteOk) { - throw std::runtime_error("Failed to execute model"); - } - auto output = interpreter->typed_output_tensor(0); - std::cout << "SQUARE(" << *input << ") = " << *output << std::endl; return 0; } diff --git a/recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt b/recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tensorflow-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tensorflow-lite/all/test_v1_package/conanfile.py b/recipes/tensorflow-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 17a163fae24bd..0000000000000 --- a/recipes/tensorflow-lite/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.build import cross_building -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 cross_building(self): - model_path = os.path.join(self.source_folder, os.pardir, "test_package", "model.tflite") - command = os.path.join("bin", "test_package") - self.run(f"{command} {model_path}", run_environment=True) diff --git a/recipes/tensorflow-lite/config.yml b/recipes/tensorflow-lite/config.yml index cabc9e91cd30c..7e71186249830 100644 --- a/recipes/tensorflow-lite/config.yml +++ b/recipes/tensorflow-lite/config.yml @@ -1,4 +1,6 @@ versions: + "2.15.0": + folder: all "2.12.0": folder: all "2.10.0": diff --git a/recipes/tensorpipe/all/test_package/CMakeLists.txt b/recipes/tensorpipe/all/test_package/CMakeLists.txt index b5d4b3c8d26da..339f540e57e53 100644 --- a/recipes/tensorpipe/all/test_package/CMakeLists.txt +++ b/recipes/tensorpipe/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(Tensorpipe REQUIRED CONFIG) diff --git a/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt b/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tensorpipe/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tensorpipe/all/test_v1_package/conanfile.py b/recipes/tensorpipe/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tensorpipe/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_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/termcap/all/CMakeLists.txt b/recipes/termcap/all/CMakeLists.txt index 8f1754f603024..8ffc72eb79760 100644 --- a/recipes/termcap/all/CMakeLists.txt +++ b/recipes/termcap/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(conan_termcap LANGUAGES C) include(CheckIncludeFile) diff --git a/recipes/termcap/all/test_package/CMakeLists.txt b/recipes/termcap/all/test_package/CMakeLists.txt index 57743fe7229db..ca5f0cbcf4ff6 100644 --- a/recipes/termcap/all/test_package/CMakeLists.txt +++ b/recipes/termcap/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(termcap CONFIG REQUIRED) diff --git a/recipes/termcap/all/test_v1_package/CMakeLists.txt b/recipes/termcap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/termcap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/termcap/all/test_v1_package/conanfile.py b/recipes/termcap/all/test_v1_package/conanfile.py deleted file mode 100644 index a7ccb827b1a74..0000000000000 --- a/recipes/termcap/all/test_v1_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): - with tools.environment_append({"TERM": "xtermc"}): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/termcolor/all/test_package/CMakeLists.txt b/recipes/termcolor/all/test_package/CMakeLists.txt index 1d45a2e0c344b..844c9205fd27a 100644 --- a/recipes/termcolor/all/test_package/CMakeLists.txt +++ b/recipes/termcolor/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(termcolor REQUIRED CONFIG) diff --git a/recipes/termcolor/all/test_v1_package/CMakeLists.txt b/recipes/termcolor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/termcolor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/termcolor/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_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..7039c8324a0d2 100644 --- a/recipes/tesseract/all/conandata.yml +++ b/recipes/tesseract/all/conandata.yml @@ -1,7 +1,13 @@ sources: - "5.3.0": - url: "https://github.com/tesseract-ocr/tesseract/archive/5.3.0.tar.gz" - sha256: "7e70870f8341e5ea228af2836ce79a36eefa11b01b56177b4a8997f330c014b8" + "5.5.0": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.5.0.tar.gz" + sha256: "f2fb34ca035b6d087a42875a35a7a5c4155fa9979c6132365b1e5a28ebc3fc11" + "5.4.1": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.4.1.tar.gz" + sha256: "c4bc2a81c12a472f445b7c2fb4705a08bd643ef467f51ec84f0e148bd368051b" + "5.3.4": + url: "https://github.com/tesseract-ocr/tesseract/archive/5.3.4.tar.gz" + sha256: "141afc12b34a14bb691a939b4b122db0d51bd38feda7f41696822bacea7710c7" "5.2.0": url: "https://github.com/tesseract-ocr/tesseract/archive/5.2.0.tar.gz" sha256: "eba4deb2f92a3f89a6623812074af8c53b772079525b3c263aa70bbf7b748b3c" @@ -11,12 +17,23 @@ sources: "5.0.0": url: "https://github.com/tesseract-ocr/tesseract/archive/5.0.0.tar.gz" sha256: "72467b7876dc0c39ef7fbcb0f793f73aee1c78d9fabab3ab19cbac1eb42e9fed" - "4.1.1": - url: "https://github.com/tesseract-ocr/tesseract/archive/4.1.1.tar.gz" - sha256: "2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb" patches: - "5.3.0": - - patch_file: "patches/0004-control-optimizations-5.3.0.patch" + "5.5.0": + - patch_file: "patches/0004-control-optimizations-5.4.0.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" + - patch_file: "patches/0005-disable-install-pdb-5.5.0.patch" + patch_description: "disable installing PDB files" + patch_type: "portability" + "5.4.1": + - patch_file: "patches/0004-control-optimizations-5.4.0.patch" + patch_description: "fix condition for cpu optimizations" + patch_type: "portability" + - patch_file: "patches/0005-disable-install-pdb-5.4.1.patch" + patch_description: "disable installing PDB files" + patch_type: "portability" + "5.3.4": + - patch_file: "patches/0004-control-optimizations-5.3.3.patch" patch_description: "fix condition for cpu optimizations" patch_type: "portability" "5.2.0": @@ -40,16 +57,3 @@ patches: - patch_file: "patches/0004-control-optimizations-5.0.0.patch" patch_description: "fix condition for cpu optimizations" patch_type: "portability" - "4.1.1": - - patch_file: "patches/0001-install-bundle.patch" - patch_description: "fix runtime install path" - patch_type: "conan" - - patch_file: "patches/0002-Link-with-targets.patch" - patch_description: "link cci package" - patch_type: "conan" - - patch_file: "patches/0003-Dont-change-locale.patch" - patch_description: "disable settings locale" - patch_type: "portability" - - patch_file: "patches/0004-control-optimizations-4.1.1.patch" - patch_description: "fix condition for cpu optimizations" - patch_type: "portability" diff --git a/recipes/tesseract/all/conanfile.py b/recipes/tesseract/all/conanfile.py index 06e523dc19f28..9a18c943ed3eb 100644 --- a/recipes/tesseract/all/conanfile.py +++ b/recipes/tesseract/all/conanfile.py @@ -1,14 +1,12 @@ 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, save +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, rm, replace_in_file from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class TesseractConan(ConanFile): @@ -40,38 +38,12 @@ class TesseractConan(ConanFile): "with_libarchive": True, } - @property - def _min_cppstd(self): - return "11" if Version(self.version) < "5.0.0" else "17" - - @property - def _compilers_minimum_version(self): - return { - "11": { - "Visual Studio": "14", - "msvc": "190", - "gcc": "5", - "clang": "5", - "apple-clang": "6", - }, - "17": { - "Visual Studio": "16", - "msvc": "192", - "gcc": "7", - "clang": "7", - "apple-clang": "11", - }, - }.get(self._min_cppstd, {}) - 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) < "5.0.0": - del self.options.with_libcurl - del self.options.with_libarchive def configure(self): if self.options.shared: @@ -81,25 +53,21 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("leptonica/1.82.0") - if self.settings.os == "Windows" and Version(self.version) >= "5.0.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": 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.7.1") + self.requires("libarchive/[>=3.7 <3.8]") # libcurl is not required for 4.x if self.options.get_safe("with_libcurl", default=False): self.requires("libcurl/[>=7.78.0 <9]") 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." - ) + check_min_cppstd(self, "17") if self.options.with_training: # do not enforce failure and allow user to build with system cairo, pango, fontconfig @@ -112,27 +80,15 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TRAINING_TOOLS"] = self.options.with_training tc.variables["INSTALL_CONFIGS"] = self.options.with_training - - # pre-5.0.0 uses custom STATIC variable instead of BUILD_SHARED_LIBS - if Version(self.version) < "5.0.0": - tc.variables["STATIC"] = not self.options.shared - # Use CMake-based package build and dependency detection, not the pkg-config, cppan or SW tc.variables["CPPAN_BUILD"] = False tc.variables["SW_BUILD"] = False - # disable autodetect of vector extensions and march=native tc.variables["ENABLE_OPTIMIZATIONS"] = self.options.with_auto_optimize - - if Version(self.version) < "5.0.0": - tc.variables["AUTO_OPTIMIZE"] = self.options.with_auto_optimize - # Set Leptonica_DIR to ensure that find_package will be called in original CMake file tc.variables["Leptonica_DIR"] = self.dependencies["leptonica"].package_folder.replace("\\", "/") - - if Version(self.version) >= "5.0.0": - tc.variables["DISABLE_CURL"] = not self.options.with_libcurl - tc.variables["DISABLE_ARCHIVE"] = not self.options.with_libarchive + tc.variables["DISABLE_CURL"] = not self.options.with_libcurl + tc.variables["DISABLE_ARCHIVE"] = not self.options.with_libarchive tc.generate() deps = CMakeDeps(self) @@ -140,6 +96,10 @@ def generate(self): def build(self): apply_conandata_patches(self) + if self.dependencies["leptonica"].options.get_safe("with_tiff"): + # version <=5.2 do not contain this check, and if not replaced it fail, strict=False is safe + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "check_leptonica_tiff_support()", "", strict=False) cmake = CMake(self) cmake.configure() cmake.build() @@ -152,32 +112,12 @@ def package(self): 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( - os.path.join(self.package_folder, self._module_file_rel_path), - {"libtesseract": "Tesseract::libtesseract"} - ) - - 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") + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) 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") @@ -187,7 +127,7 @@ 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": + if self.settings.os == "Windows": 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") @@ -199,16 +139,7 @@ def package_info(self): self.cpp_info.components["libtesseract"].system_libs = ["pthread"] elif self.settings.os == "Windows": self.cpp_info.components["libtesseract"].system_libs = ["ws2_32"] - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.names["cmake_find_package"] = "Tesseract" - self.cpp_info.names["cmake_find_package_multi"] = "Tesseract" - self.cpp_info.components["libtesseract"].names["cmake_find_package"] = "libtesseract" - self.cpp_info.components["libtesseract"].names["cmake_find_package_multi"] = "libtesseract" - self.cpp_info.components["libtesseract"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["libtesseract"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] self.cpp_info.components["libtesseract"].set_property("pkg_config_name", "tesseract") - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) @property def _libname(self): diff --git a/recipes/tesseract/all/patches/0001-install-bundle.patch b/recipes/tesseract/all/patches/0001-install-bundle.patch deleted file mode 100644 index 6cb91f3e0dc70..0000000000000 --- a/recipes/tesseract/all/patches/0001-install-bundle.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -537,7 +537,7 @@ get_target_property(tesseract_VERSION libtesseract VERSION) - get_target_property(tesseract_OUTPUT_NAME libtesseract OUTPUT_NAME) - configure_file(tesseract.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tesseract.pc DESTINATION lib/pkgconfig) --install(TARGETS tesseract RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -+install(TARGETS tesseract DESTINATION bin) - install(TARGETS libtesseract EXPORT TesseractTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) - install(EXPORT TesseractTargets DESTINATION cmake) - install(FILES diff --git a/recipes/tesseract/all/patches/0002-Link-with-targets.patch b/recipes/tesseract/all/patches/0002-Link-with-targets.patch deleted file mode 100644 index bffd512b1d705..0000000000000 --- a/recipes/tesseract/all/patches/0002-Link-with-targets.patch +++ /dev/null @@ -1,18 +0,0 @@ -Variable Leptonica_LIBRARIES does not know about its dependencies which are handled only -by exported cmake/pc files which are not used by Conan. -Therefore link with exported target from the autogenerated CMake file by the cmake_find_package -that contains information about all dependencies -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -491,8 +491,8 @@ elseif (SW_BUILD) - export(TARGETS libtesseract APPEND FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake) - else() - target_link_libraries (libtesseract PUBLIC -- ${Leptonica_LIBRARIES} -- ${LibArchive_LIBRARIES} -+ leptonica -+ LibArchive::LibArchive - ) - export(TARGETS libtesseract FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake) - endif() diff --git a/recipes/tesseract/all/patches/0003-Dont-change-locale.patch b/recipes/tesseract/all/patches/0003-Dont-change-locale.patch deleted file mode 100644 index abe5b612381f6..0000000000000 --- a/recipes/tesseract/all/patches/0003-Dont-change-locale.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/api/baseapi.cpp -+++ b/src/api/baseapi.cpp -@@ -219,7 +219,7 @@ TessBaseAPI::TessBaseAPI() - // problems caused by the locale settings. - - // Use the current locale if building debug code. -- std::locale::global(std::locale("")); -+ // std::locale::global(std::locale("")); - #endif - } - diff --git a/recipes/tesseract/all/patches/0004-control-optimizations-4.1.1.patch b/recipes/tesseract/all/patches/0004-control-optimizations-4.1.1.patch deleted file mode 100644 index 8df4fc161cb0c..0000000000000 --- a/recipes/tesseract/all/patches/0004-control-optimizations-4.1.1.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -265,7 +265,7 @@ - set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -O3 -ffast-math") - endif() - CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) --if(COMPILER_SUPPORTS_MARCH_NATIVE) -+if(ENABLE_OPTIMIZATIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) - set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -march=native -mtune=native") - set(MARCH_NATIVE_OPT ON) - endif() diff --git a/recipes/tesseract/all/patches/0004-control-optimizations-5.3.0.patch b/recipes/tesseract/all/patches/0004-control-optimizations-5.3.0.patch deleted file mode 100644 index 493ab5b70ee14..0000000000000 --- a/recipes/tesseract/all/patches/0004-control-optimizations-5.3.0.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8c6845c..6e56862 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -144,7 +144,7 @@ else() - endif() - - check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) --if(COMPILER_SUPPORTS_MARCH_NATIVE) -+if(ENABLE_OPTIMIZATIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) - set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -march=native") - if(NOT CLANG AND MSVC) - # clang-cl does not know this argument -@@ -155,7 +155,7 @@ endif() - - 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) -@@ -255,7 +255,7 @@ else() - set(HAVE_NEON FALSE) - set(HAVE_SSE4_1 FALSE) - --endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") -+endif(ENABLE_OPTIMIZATIONS AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686") - - # Compiler specific environments - if(CMAKE_COMPILER_IS_GNUCXX OR MINGW) 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/all/patches/0004-control-optimizations-5.4.0.patch b/recipes/tesseract/all/patches/0004-control-optimizations-5.4.0.patch new file mode 100644 index 0000000000000..5f979a5a3b6c0 --- /dev/null +++ b/recipes/tesseract/all/patches/0004-control-optimizations-5.4.0.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 85af2df..aff97da 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -165,7 +165,7 @@ endif(ENABLE_NATIVE) + + 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/all/patches/0005-disable-install-pdb-5.4.1.patch b/recipes/tesseract/all/patches/0005-disable-install-pdb-5.4.1.patch new file mode 100644 index 0000000000000..17461653a60f4 --- /dev/null +++ b/recipes/tesseract/all/patches/0005-disable-install-pdb-5.4.1.patch @@ -0,0 +1,179 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0dec189..70a11c0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -927,7 +927,7 @@ install( + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + RENAME tesseract.pc) + install(TARGETS tesseract DESTINATION bin) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + install( +@@ -937,7 +937,7 @@ install( + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + install( +diff --git a/src/training/CMakeLists.txt b/src/training/CMakeLists.txt +index 7fbf021..97fb7a4 100644 +--- a/src/training/CMakeLists.txt ++++ b/src/training/CMakeLists.txt +@@ -126,7 +126,7 @@ install( + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + generate_export_header(common_training EXPORT_MACRO_NAME + TESS_COMMON_TRAINING_API) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + project_group(common_training "Training Tools") +@@ -144,7 +144,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -162,7 +162,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -179,7 +179,7 @@ install( + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -196,7 +196,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -213,7 +213,7 @@ install( + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -230,7 +230,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -248,7 +248,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -265,7 +265,7 @@ install( + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -298,7 +298,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + generate_export_header(unicharset_training EXPORT_MACRO_NAME +@@ -317,7 +317,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -333,7 +333,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -349,7 +349,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -365,7 +365,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -381,7 +381,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -398,7 +398,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -457,7 +457,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() diff --git a/recipes/tesseract/all/patches/0005-disable-install-pdb-5.5.0.patch b/recipes/tesseract/all/patches/0005-disable-install-pdb-5.5.0.patch new file mode 100644 index 0000000000000..4f18422a50e90 --- /dev/null +++ b/recipes/tesseract/all/patches/0005-disable-install-pdb-5.5.0.patch @@ -0,0 +1,179 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6cb5a6c..1802e38 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -925,7 +925,7 @@ install( + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + RENAME tesseract.pc) + install(TARGETS tesseract DESTINATION bin) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + install( +@@ -935,7 +935,7 @@ install( + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-if (MSVC AND BUILD_SHARED_LIBS) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + install( +diff --git a/src/training/CMakeLists.txt b/src/training/CMakeLists.txt +index c764442..97fb7a4 100644 +--- a/src/training/CMakeLists.txt ++++ b/src/training/CMakeLists.txt +@@ -126,7 +126,7 @@ install( + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + generate_export_header(common_training EXPORT_MACRO_NAME + TESS_COMMON_TRAINING_API) +-if (MSVC AND BUILD_SHARED_LIBS) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + project_group(common_training "Training Tools") +@@ -144,7 +144,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -162,7 +162,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -179,7 +179,7 @@ install( + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -196,7 +196,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -213,7 +213,7 @@ install( + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -230,7 +230,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -248,7 +248,7 @@ if(NOT DISABLED_LEGACY_ENGINE) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() +@@ -265,7 +265,7 @@ install( + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +-if (MSVC) ++if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -298,7 +298,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- if (MSVC AND BUILD_SHARED_LIBS) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + generate_export_header(unicharset_training EXPORT_MACRO_NAME +@@ -317,7 +317,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -333,7 +333,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -349,7 +349,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -365,7 +365,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -381,7 +381,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -398,7 +398,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + +@@ -457,7 +457,7 @@ if(ICU_FOUND) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- if (MSVC) ++ if (0) + install(FILES $ DESTINATION bin OPTIONAL) + endif() + endif() diff --git a/recipes/tesseract/all/test_package/CMakeLists.txt b/recipes/tesseract/all/test_package/CMakeLists.txt index b9b9eb1f26670..44a7f8233985d 100644 --- a/recipes/tesseract/all/test_package/CMakeLists.txt +++ b/recipes/tesseract/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(Tesseract REQUIRED CONFIG) diff --git a/recipes/tesseract/all/test_package/conanfile.py b/recipes/tesseract/all/test_package/conanfile.py index a9fb96656f203..4db1f0ef58ade 100644 --- a/recipes/tesseract/all/test_package/conanfile.py +++ b/recipes/tesseract/all/test_package/conanfile.py @@ -6,8 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" - test_type = "explicit" + generators = "CMakeDeps", "CMakeToolchain", "PkgConfigDeps" def requirements(self): self.requires(self.tested_reference_str) @@ -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/tesseract/all/test_v1_package/CMakeLists.txt b/recipes/tesseract/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/tesseract/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tesseract/all/test_v1_package/conanfile.py b/recipes/tesseract/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/tesseract/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/tesseract/config.yml b/recipes/tesseract/config.yml index 18a9581e91b42..2e19acf76701e 100644 --- a/recipes/tesseract/config.yml +++ b/recipes/tesseract/config.yml @@ -1,5 +1,9 @@ versions: - "5.3.0": + "5.5.0": + folder: all + "5.4.1": + folder: all + "5.3.4": folder: all "5.2.0": folder: all @@ -7,5 +11,3 @@ versions: folder: all "5.0.0": folder: all - "4.1.1": - folder: all diff --git a/recipes/tgbot/all/conandata.yml b/recipes/tgbot/all/conandata.yml index e2625bd0a2fbb..c1de261e9fcc7 100644 --- a/recipes/tgbot/all/conandata.yml +++ b/recipes/tgbot/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "1.8": + url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.8.tar.gz" + sha256: "43ff1a359b8db026e58e517703e616accaae33e01ebc7e87613632b7e4653467" + # This is the last version for C++11. + "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" diff --git a/recipes/tgbot/all/conanfile.py b/recipes/tgbot/all/conanfile.py index 1fb99e68206f6..9d54fa2902dee 100644 --- a/recipes/tgbot/all/conanfile.py +++ b/recipes/tgbot/all/conanfile.py @@ -5,7 +5,8 @@ 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 +from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -29,6 +30,32 @@ class TgbotConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + # tgbot requiroes C++17 since 1.7.3 + return "14" if Version(self.version) < "1.7.3" else "17" + + @property + def _compilers_minimum_version(self): + return { + "17": { + # tgbot/>= 1.7.3 require C++17 filesystem + "gcc": "9", + "clang": "9", + "apple-clang": "13", + "Visual Studio": "16", + "msvc": "192", + }, + "14": { + "gcc": "5", + "clang": "3", + "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 @@ -53,7 +80,13 @@ def _required_boost_components(self): def validate(self): if self.settings.compiler.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." + ) + miss_boost_required_comp = any( self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) for boost_comp in self._required_boost_components @@ -70,6 +103,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["ENABLE_TESTS"] = False + if not self.settings.compiler.cppstd: + tc.cache_variables["CMAKE_CXX_STANDARD"] = self._min_cppstd tc.generate() tc = CMakeDeps(self) tc.generate() @@ -82,6 +117,11 @@ def _patch_sources(self): "set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)", "", ) + # Don't force CMAKE_CXX_STANDARD + replace_in_file(self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_CXX_STANDARD", + "#") def build(self): self._patch_sources() @@ -96,7 +136,11 @@ def package(self): dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) fix_apple_shared_install_name(self) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.libs = ["TgBot"] self.cpp_info.defines = ["HAVE_CURL=1"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/tgbot/all/test_package/CMakeLists.txt b/recipes/tgbot/all/test_package/CMakeLists.txt index ebe398c29035c..766207d11a696 100644 --- a/recipes/tgbot/all/test_package/CMakeLists.txt +++ b/recipes/tgbot/all/test_package/CMakeLists.txt @@ -1,8 +1,12 @@ cmake_minimum_required(VERSION 3.15) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(tgbot REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) -target_link_libraries(${PROJECT_NAME} tgbot::tgbot) +target_link_libraries(${PROJECT_NAME} PRIVATE tgbot::tgbot) +if(tvbot_VERSION VERSION_LESS "1.7.3") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/tgbot/all/test_v1_package/CMakeLists.txt b/recipes/tgbot/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tgbot/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 80f8edbcec938..0000000000000 --- a/recipes/tgbot/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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 39a996dda935d..e9249e18493da 100644 --- a/recipes/tgbot/config.yml +++ b/recipes/tgbot/config.yml @@ -1,4 +1,8 @@ versions: + "1.8": + folder: all + "1.7.2": + folder: all "1.5": folder: all "1.3": diff --git a/recipes/tgc/all/CMakeLists.txt b/recipes/tgc/all/CMakeLists.txt index 8f1121172b940..d9859c16d6d45 100644 --- a/recipes/tgc/all/CMakeLists.txt +++ b/recipes/tgc/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(tgc LANGUAGES C) add_library(tgc ${TGC_SRC_DIR}/tgc.c) diff --git a/recipes/tgc/all/test_package/CMakeLists.txt b/recipes/tgc/all/test_package/CMakeLists.txt index c3e8ecbc7e427..8d2b75a22a872 100644 --- a/recipes/tgc/all/test_package/CMakeLists.txt +++ b/recipes/tgc/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(tgc REQUIRED CONFIG) diff --git a/recipes/tgc/all/test_v1_package/CMakeLists.txt b/recipes/tgc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tgc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tgc/all/test_v1_package/conanfile.py b/recipes/tgc/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tgc/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_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/all/test_v1_package/CMakeLists.txt b/recipes/thelink2012-any/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/thelink2012-any/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 6b551939fbde3..0000000000000 --- a/recipes/thelink2012-any/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -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/thorvg/all/conandata.yml b/recipes/thorvg/all/conandata.yml new file mode 100644 index 0000000000000..3856c3fbf01e6 --- /dev/null +++ b/recipes/thorvg/all/conandata.yml @@ -0,0 +1,22 @@ +sources: + "0.15.9": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.15.9.tar.gz" + sha256: "05c5424d5065f38db832c87785e3cc0e135443797a4431bdcda6807abf75d8cc" + "0.15.4": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.15.4.tar.gz" + sha256: "3031a3e070322194fc5368419e996420f05f26ec2ec8137beca17eba5e5e8a58" + "0.15.3": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.15.3.tar.gz" + sha256: "c3d57167a54f0ecc3ead8bb33340593acc00bcd8477e784287307bc4e2c82b38" + "0.14.10": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.14.10.tar.gz" + sha256: "e11e2e27ef26ed018807e828cce3bca1fb9a7f25683a152c9cd1f7aac9f3b67a" + "0.14.6": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.14.6.tar.gz" + sha256: "13d7778968ce10f4f7dd1ea1f66861d4ee8ff22f669566992b4ac00e050496cf" + "0.13.8": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.13.8.tar.gz" + sha256: "ce49929a94d1686d4f1436da6ef5fa7a8439901c22b5fa0879d7d5879b8ba2bd" + "0.13.7": + url: "https://github.com/thorvg/thorvg/archive/refs/tags/v0.13.7.tar.gz" + sha256: "972c84e5670a7138eec24062d4ccc243d161158ecd9c53788300a8ca6aaf3426" diff --git a/recipes/thorvg/all/conanfile.py b/recipes/thorvg/all/conanfile.py new file mode 100644 index 0000000000000..54b51d1b7818f --- /dev/null +++ b/recipes/thorvg/all/conanfile.py @@ -0,0 +1,204 @@ +import os + +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 copy, get, rmdir, rename, replace_in_file, rm +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 + +required_conan_version = ">=1.64.0 <2 || >=2.2.0" + + +class ThorvgConan(ConanFile): + name = "thorvg" + description = "ThorVG is a platform-independent portable library that allows for drawing vector-based scenes and animations." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/thorvg/thorvg" + topics = ("svg", "lottie", "animation", "graphics", "rendering") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_engines": ['sw', 'gl_beta', 'wg_beta', "gl"], + "with_loaders": [False, 'tvg', 'svg', 'png', 'jpg', 'lottie', 'ttf', 'webp', 'all'], + "with_savers": [False, 'tvg', 'gif', 'all'], + "with_bindings": [False, 'capi', 'wasm_beta'], + "with_tools": [False, 'svg2tvg', 'svg2png', 'lottie2gif', 'all'], + "with_threads": [True, False], + "with_simd": [True, False], + "with_examples": [True, False], + "with_extra": [False, 'lottie_expressions'], + "with_file": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_engines": 'sw', + "with_loaders": 'all', + "with_savers": False, + "with_bindings": 'capi', + "with_tools": False, + "with_threads": True, + "with_simd": False, + "with_examples": False, + "with_extra": 'lottie_expressions', + "with_file": True, + } + # See more here: https://github.com/thorvg/thorvg/blob/main/meson_options.txt + options_description = { + "with_engines": "Enable Rasterizer Engine in thorvg", + "with_loaders": "Enable File Loaders in thorvg", + "with_savers": "Enable File Savers in thorvg", + "with_threads": "Enable the multi-threading task scheduler in thorvg", + "with_simd": "Enable CPU Vectorization(SIMD) in thorvg", + "with_bindings": "Enable API bindings", + "with_tools": "Enable building thorvg tools", + "with_examples": "Enable building examples", + "with_extra": "Enable support for exceptionally advanced features", + } + short_paths = True + + @property + 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 config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) < "0.15.6": + del self.options.with_file + + 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.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.build_type == "Debug": + raise ConanInvalidConfiguration( + f"{self.ref} doesn't support debug build on MSVC." + ) + + if Version(self.version) < "0.14.0" and self.options.with_engines in ["gl"]: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support with_engines=gl, use with_engines=gl_beta instead") + if Version(self.version) >= "0.14.0" and self.options.with_engines in ["gl_beta"]: + raise ConanInvalidConfiguration(f"{self.ref} doesn't support with_engines=gl_beta, use with_engines=gl instead") + + def requirements(self): + loaders_opt = str(self.options.with_loaders) + if loaders_opt in ("all", "jpg"): + self.requires("libjpeg-turbo/3.0.2") + if loaders_opt in ("all", "png"): + self.requires("libpng/1.6.43") + if loaders_opt in ("all", "webp"): + self.requires("libwebp/1.4.0") + if self.settings.os == "Linux": + if self.options.with_engines in ["gl", "gl_beta"]: + self.requires("opengl/system") + + def build_requirements(self): + self.tool_requires("meson/[>=1.2.3 <2]") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self, backend=("vs" if is_msvc(self) else None)) + is_debug = self.settings.get_safe("build_type") == "Debug" + tc.project_options.update({ + "engines": str(self.options.with_engines), + "loaders": str(self.options.with_loaders) if self.options.with_loaders else '', + "savers": str(self.options.with_savers) if self.options.with_savers else '', + "bindings": str(self.options.with_bindings) if self.options.with_bindings else '', + "tools": str(self.options.with_tools )if self.options.with_tools else '', + "threads": bool(self.options.with_threads), + "examples": bool(self.options.with_examples), + "tests": False, + "log": is_debug, + }) + # Workaround to avoid: error D8016: '/O1' and '/RTC1' command-line options are incompatible + if is_msvc(self) and is_debug: + tc.project_options["optimization"] = "plain" + tc.project_options["simd"] = bool(self.options.with_simd) + if self.options.with_extra: + tc.project_options["extra"] = str(self.options.with_extra) + if "with_file" in self.options: + tc.project_options["file"] = self.options.with_file + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + venv = VirtualBuildEnv(self) + venv.generate() + + def _patch_sources(self): + # Workaround to avoid: Stripping target 'src\\thorvg-0.dll'. + if is_msvc(self) and self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), ", 'strip=true'", "") + + # TODO: As OpenMP is tagged as "required: false", let's disable it for now to avoid extra flags and requirements injections. + if Version(self.version) >= "0.15.1" and self.options.with_threads: + # Notice that the use of disabler() is not working here. If it's used, there is no targets to build. + replace_in_file(self, os.path.join(self.source_folder, "src", "renderer", "sw_engine", "meson.build"), + "omp_dep = dependency('openmp', required: false)", + "omp_dep = []") + replace_in_file(self, os.path.join(self.source_folder, "src", "renderer", "sw_engine", "meson.build"), + "omp_dep.found()", + "false") + + def build(self): + self._patch_sources() + 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) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + fix_apple_shared_install_name(self) + + if is_msvc(self) and not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libthorvg.a"), os.path.join(self.package_folder, "lib", "thorvg.lib")) + + def package_info(self): + self.cpp_info.libs = ["thorvg"] + + self.cpp_info.set_property("pkg_config_name", "libthorvg") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["pthread", "m"]) + if not self.options.shared: + self.cpp_info.defines = ["TVG_STATIC"] + else: + self.cpp_info.defines = ["TVG_EXPORT", "TVG_BUILD"] diff --git a/recipes/thorvg/all/test_package/CMakeLists.txt b/recipes/thorvg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f35032cc2fe13 --- /dev/null +++ b/recipes/thorvg/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(thorvg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE thorvg::thorvg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/thorvg/all/test_package/conanfile.py b/recipes/thorvg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/thorvg/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/thorvg/all/test_package/test_package.cpp b/recipes/thorvg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..9953a7b6e75e3 --- /dev/null +++ b/recipes/thorvg/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#include "thorvg.h" + +int main() { + const int WIDTH = 800; + const int HEIGHT = 600; + + tvg::Initializer::init(tvg::CanvasEngine::Sw, 0); + + static uint32_t buffer[WIDTH * HEIGHT]; // canvas target buffer + + auto canvas = tvg::SwCanvas::gen(); // generate a canvas + canvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888); // buffer, stride, w, h, Colorspace + + auto rect = tvg::Shape::gen(); // generate a shape + rect->appendRect(50, 50, 200, 200, 20, 20); // define it as a rounded rectangle (x, y, w, h, rx, ry) + rect->fill(100, 100, 100, 255); // set its color (r, g, b, a) + canvas->push(std::move(rect)); // push the rectangle into the canvas + + auto circle = tvg::Shape::gen(); // generate a shape + circle->appendCircle(400, 400, 100, 100); // define it as a circle (cx, cy, rx, ry) + + auto fill = tvg::RadialGradient::gen(); // generate a radial gradient + fill->radial(400, 400, 150); // set the radial gradient geometry info (cx, cy, radius) + + tvg::Fill::ColorStop colorStops[2]; // gradient colors + colorStops[0] = {0.0, 255, 255, 255, 255}; // 1st color values (offset, r, g, b, a) + colorStops[1] = {1.0, 0, 0, 0, 255}; // 2nd color values (offset, r, g, b, a) + fill->colorStops(colorStops, 2); // set the gradient colors info + + circle->fill(std::move(fill)); // set the circle fill + canvas->push(std::move(circle)); // push the circle into the canvas +} diff --git a/recipes/thorvg/config.yml b/recipes/thorvg/config.yml new file mode 100644 index 0000000000000..5f9c1c8752cdc --- /dev/null +++ b/recipes/thorvg/config.yml @@ -0,0 +1,15 @@ +versions: + "0.15.9": + folder: all + "0.15.4": + folder: all + "0.15.3": + folder: all + "0.14.10": + folder: all + "0.14.6": + folder: all + "0.13.8": + folder: all + "0.13.7": + folder: all diff --git a/recipes/threadpool/all/test_package/CMakeLists.txt b/recipes/threadpool/all/test_package/CMakeLists.txt index 700241bb74acb..1abe671cddbed 100644 --- a/recipes/threadpool/all/test_package/CMakeLists.txt +++ b/recipes/threadpool/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(threadpool REQUIRED CONFIG) diff --git a/recipes/threadpool/all/test_v1_package/CMakeLists.txt b/recipes/threadpool/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 338ffbb0c05f3..0000000000000 --- a/recipes/threadpool/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(ThreadPool REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE ThreadPool::ThreadPool) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/threadpool/all/test_v1_package/conanfile.py b/recipes/threadpool/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/threadpool/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_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/thrift/all/conandata.yml b/recipes/thrift/all/conandata.yml index 57ad35a140baa..6ddf0c58f5a00 100644 --- a/recipes/thrift/all/conandata.yml +++ b/recipes/thrift/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.20.0": + url: "http://archive.apache.org/dist/thrift/0.20.0/thrift-0.20.0.tar.gz" + sha256: "b5d8311a779470e1502c027f428a1db542f5c051c8e1280ccd2163fa935ff2d6" "0.18.1": url: "http://archive.apache.org/dist/thrift/0.18.1/thrift-0.18.1.tar.gz" sha256: "04c6f10e5d788ca78e13ee2ef0d2152c7b070c0af55483d6b942e29cff296726" @@ -18,6 +21,10 @@ sources: url: "http://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz" sha256: "13da5e1cd9c8a3bb89778c0337cc57eb0c29b08f3090b41cf6ab78594b410ca5" patches: + "0.20.0": + - patch_file: "patches/cmake-0.16.0.patch" + patch_description: "use cci packages" + patch_type: "conan" "0.18.1": - patch_file: "patches/cmake-0.16.0.patch" patch_description: "use cci packages" diff --git a/recipes/thrift/all/conanfile.py b/recipes/thrift/all/conanfile.py index 3f576411eeb0d..97debbded3cd9 100644 --- a/recipes/thrift/all/conanfile.py +++ b/recipes/thrift/all/conanfile.py @@ -67,7 +67,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.82.0", transitive_headers=True) + self.requires("boost/1.85.0", transitive_headers=True) if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") if self.options.with_zlib: @@ -75,11 +75,11 @@ def requirements(self): 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.13") 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") @@ -175,7 +175,6 @@ def package_info(self): self.cpp_info.components["libthrift"].set_property("pkg_config_name", "thrift") self.cpp_info.components["libthrift"].libs = [f"thrift{libsuffix}"] if self.settings.os == "Windows": - self.cpp_info.components["libthrift"].defines.append("NOMINMAX") if Version(self.version) >= "0.15.0": self.cpp_info.components["libthrift"].system_libs.append("shlwapi") elif self.settings.os in ["Linux", "FreeBSD"]: 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/all/test_package/CMakeLists.txt b/recipes/thrift/all/test_package/CMakeLists.txt index d5da5a4dcda31..7bbb43cbf498e 100644 --- a/recipes/thrift/all/test_package/CMakeLists.txt +++ b/recipes/thrift/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(Thrift CONFIG REQUIRED) diff --git a/recipes/thrift/all/test_v1_package/CMakeLists.txt b/recipes/thrift/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/thrift/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/thrift/all/test_v1_package/conanfile.py b/recipes/thrift/all/test_v1_package/conanfile.py deleted file mode 100644 index 26e744ddda5b0..0000000000000 --- a/recipes/thrift/all/test_v1_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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - self.run("thrift --version", run_environment=True) diff --git a/recipes/thrift/config.yml b/recipes/thrift/config.yml index 8ce3e9b3821f4..f54d46190d9d2 100644 --- a/recipes/thrift/config.yml +++ b/recipes/thrift/config.yml @@ -1,4 +1,6 @@ versions: + "0.20.0": + folder: all "0.18.1": folder: all "0.17.0": diff --git a/recipes/tidwall-neco/all/CMakeLists.txt b/recipes/tidwall-neco/all/CMakeLists.txt new file mode 100644 index 0000000000000..ee8e2e4c821d7 --- /dev/null +++ b/recipes/tidwall-neco/all/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.15) +project(neco LANGUAGES C) + +include(GNUInstallDirs) + +add_library(neco ${TIDWALL_NECO_SRC_DIR}/neco.c) +target_include_directories(neco PRIVATE ${TIDWALL_NECO_SRC_DIR}) +set_target_properties(neco PROPERTIES + PUBLIC_HEADER ${TIDWALL_NECO_SRC_DIR}/neco.h + WINDOWS_EXPORT_ALL_SYMBOLS ON +) +target_compile_features(neco PRIVATE c_std_11) + +install( + TARGETS neco + 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/tidwall-neco/all/conandata.yml b/recipes/tidwall-neco/all/conandata.yml new file mode 100644 index 0000000000000..683bfe9e9152a --- /dev/null +++ b/recipes/tidwall-neco/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.3.2": + url: "https://github.com/tidwall/neco/archive/refs/tags/v0.3.2.tar.gz" + sha256: "ae3cefa6217428e992da0b30f254502b9974079dd9973eee9c482ea89df3fcef" diff --git a/recipes/tidwall-neco/all/conanfile.py b/recipes/tidwall-neco/all/conanfile.py new file mode 100644 index 0000000000000..5aea18d3be4d2 --- /dev/null +++ b/recipes/tidwall-neco/all/conanfile.py @@ -0,0 +1,69 @@ +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 TidwallNecoConan(ConanFile): + name = "tidwall-neco" + description = "Concurrency library for C (coroutines)" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/tidwall/neco" + topics = ("coroutine", "concurrency", "network") + 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.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if is_msvc(self): + raise ConanInvalidConfiguration(f"{self.ref} does not support Visual Studio (yet).") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TIDWALL_NECO_SRC_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, "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 = ["neco"] + if self.settings.os in ("FreeBSD", "Linux"): + self.cpp_info.system_libs = ["pthread", "dl"] diff --git a/recipes/tidwall-neco/all/test_package/CMakeLists.txt b/recipes/tidwall-neco/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a57d060daf586 --- /dev/null +++ b/recipes/tidwall-neco/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(tidwall-neco REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tidwall-neco::tidwall-neco) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) diff --git a/recipes/tidwall-neco/all/test_package/conanfile.py b/recipes/tidwall-neco/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fafba71d30d56 --- /dev/null +++ b/recipes/tidwall-neco/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.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tidwall-neco/all/test_package/test_package.c b/recipes/tidwall-neco/all/test_package/test_package.c new file mode 100644 index 0000000000000..463b07f3d9439 --- /dev/null +++ b/recipes/tidwall-neco/all/test_package/test_package.c @@ -0,0 +1,13 @@ +#include + +// #define _GNU_SOURCE +#include "neco.h" + +void coroutine(int argc, void *argv[]) { + printf("main coroutine started\n"); +} + +int main(int argc, char *argv[]) { + neco_start(coroutine, 0); + return 0; +} diff --git a/recipes/tidwall-neco/config.yml b/recipes/tidwall-neco/config.yml new file mode 100644 index 0000000000000..f2fc85b835922 --- /dev/null +++ b/recipes/tidwall-neco/config.yml @@ -0,0 +1,3 @@ +versions: + "0.3.2": + folder: all diff --git a/recipes/tidy-html5/all/test_v1_package/CMakeLists.txt b/recipes/tidy-html5/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tidy-html5/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/tidy-html5/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", "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/tiledb/all/conandata.yml b/recipes/tiledb/all/conandata.yml new file mode 100644 index 0000000000000..9683a1cfcc4e0 --- /dev/null +++ b/recipes/tiledb/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.26.1": + url: "https://github.com/TileDB-Inc/TileDB/archive/refs/tags/2.26.1.tar.gz" + sha256: "f90461850c6f87f63fe77788d7932fd53a4d1de7e2ba7263f5e8f2fd1df23e38" diff --git a/recipes/tiledb/all/conanfile.py b/recipes/tiledb/all/conanfile.py new file mode 100644 index 0000000000000..3a434ad427fa5 --- /dev/null +++ b/recipes/tiledb/all/conanfile.py @@ -0,0 +1,275 @@ +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 get, copy, rmdir, replace_in_file, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + +class TileDBConan(ConanFile): + name = "tiledb" + description = ("TileDB is a powerful engine for storing and accessing dense and sparse multi-dimensional arrays, " + "which can help you model any complex data efficiently.") + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/TileDB-Inc/TileDB" + topics = ("data-science", "storage-engine", "s3", "sparse-data", "scientific-computing", "s3-storage", + "arrays", "data-analysis", "dataframes", "dense-data", "sparse-arrays") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "cpp_api": [True, False], + "s3": [True, False], + "azure": [True, False], + "gcs": [True, False], + "serialization": [True, False], + "webp": [True, False], + "tools": [True, False], + "remove_deprecations": [True, False], + "verbose": [True, False], + "stats": [True, False], + "experimental_features": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "cpp_api": True, + "s3": False, + "azure": False, + "gcs": False, + "serialization": False, + "webp": True, + "tools": False, + "remove_deprecations": False, + "verbose": False, + "stats": True, + "experimental_features": False, + } + options_description = { + "cpp_api": "Enable building of the TileDB C++ API", + "s3": "Support AWS S3 Storage", + "azure": "Support Azure Blob Storage", + "gcs": "Support Google Cloud Storage", + "serialization": "Enable TileDB Cloud support by building with support for query serialization.", + "webp": "Support WebP compression", + "tools": "Build tiledb command-line tool", + "remove_deprecations": "Do not build deprecated APIs", + "verbose": "Print TileDB errors with verbosity", + "stats": "Enable internal TileDB statistics gathering", + "experimental_features": "Build and include experimental features", + } + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + # https://github.com/TileDB-Inc/TileDB/blob/2.21.0/doc/dev/BUILD.md#prerequisites + return { + "gcc": "10", + "clang": "10", + "apple-clang": "14", + "msvc": "192", + "Visual Studio": "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") + if self.options.serialization: + self.options["libcurl"].with_zstd = True + if self.options.azure: + self.options["azure-sdk-for-cpp"]["azure-storage-blobs"] = True + if self.options.s3: + self.options["aws-sdk-cpp"].s3 = True + self.options["aws-sdk-cpp"]["identity-management"] = True + self.options["aws-sdk-cpp"].sts = True + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + # TileDB has no transitive header deps + self.requires("bzip2/1.0.8") + self.requires("libxml2/[>=2.12.5 <3]") + self.requires("lz4/1.9.4") + self.requires("spdlog/1.14.1") + self.requires("xz_utils/[>=5.4.5 <6]") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("zstd/[^1.5]") + if self.settings.os != "Windows": + self.requires("openssl/[>=1.1 <4]") + self.requires("libmagic/5.45") + if self.options.azure: + self.requires("azure-sdk-for-cpp/1.11.3") + if self.options.gcs: + self.requires("google-cloud-cpp/2.28.0") + if self.options.serialization: + self.requires("capnproto/1.0.2") + self.requires("libcurl/[>=7.78 <9]") + if self.options.s3: + self.requires("aws-sdk-cpp/1.11.352") + if self.options.tools: + self.requires("clipp/1.2.3") + if self.options.webp: + self.requires("libwebp/1.4.0") + + # TODO: unvendor + # - bitshuffle + # - blosc + # - boost::interprocess + # - nlohmann_json + # - tcb-span + + 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.serialization and not self.dependencies["libcurl"].options.with_zstd: + raise ConanInvalidConfiguration("TileDB serialization requires libcurl with with_zstd option enabled.") + if self.options.s3: + aws_opts = self.dependencies["aws-sdk-cpp"].options + if not (aws_opts.get_safe("s3") and aws_opts.get_safe("identity-management") and aws_opts.get_safe("sts")): + raise ConanInvalidConfiguration( + f"TileDB S3 support requires aws-sdk-cpp with 's3', 'identity-management' and 'sts' options enabled." + ) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.21 <4]") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + # https://github.com/TileDB-Inc/TileDB/blob/2.26.1/cmake/Options/BuildOptions.cmake + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.cache_variables["TILEDB_AZURE"] = self.options.azure + tc.cache_variables["TILEDB_CPP_API"] = self.options.cpp_api + tc.cache_variables["TILEDB_DISABLE_AUTO_VCPKG"] = True + tc.cache_variables["TILEDB_EXPERIMENTAL_FEATURES"] = self.options.experimental_features + tc.cache_variables["TILEDB_GCS"] = self.options.gcs + tc.cache_variables["TILEDB_INSTALL_LIBDIR"] = os.path.join(self.package_folder, "lib") + tc.cache_variables["TILEDB_REMOVE_DEPRECATIONS"] = self.options.remove_deprecations + tc.cache_variables["TILEDB_S3"] = self.options.s3 + tc.cache_variables["TILEDB_SERIALIZATION"] = self.options.serialization + tc.cache_variables["TILEDB_STATS"] = self.options.stats + tc.cache_variables["TILEDB_TESTS"] = False + tc.cache_variables["TILEDB_TOOLS"] = self.options.tools + tc.cache_variables["TILEDB_VERBOSE"] = self.options.verbose + tc.cache_variables["TILEDB_WEBP"] = self.options.webp + tc.cache_variables["TILEDB_WERROR"] = False + # Disable ExternalProject just in case + tc.cache_variables["FETCHCONTENT_FULLY_DISCONNECTED"] = True + tc.cache_variables["libmagic_DICTIONARY"] = os.path.join(self.dependencies["libmagic"].package_folder, "res", "magic.mgc").replace("\\", "/") + tc.generate() + + deps = CMakeDeps(self) + conan_to_cmake_name = { + "aws-sdk-cpp": "AWSSDK", + "azure-sdk-for-cpp": "azure-storage-blobs-cpp", + "bzip2": "BZip2", + "capnproto": "CapnProto", + "clipp": "clipp", + "google-cloud-cpp": "google_cloud_cpp_storage", + "libcurl": "CURL", + "libmagic": "unofficial-libmagic", + "libwebp": "WebP", + "libxml2": "LibXml2", + "lz4": "lz4", + "openssl": "OpenSSL", + "spdlog": "spdlog", + "zlib": "ZLIB", + "zstd": "zstd", + } + for conan_name, cmake_name in conan_to_cmake_name.items(): + deps.set_property(conan_name, "cmake_file_name", cmake_name) + + renamed_targets = { + "azure-sdk-for-cpp::azure-storage-blobs": "Azure::azure-storage-blobs", + "bzip2": "BZip2::BZip2", + "clipp": "clipp::clipp", + "google-cloud-cpp::storage": "google-cloud-cpp::storage", + "libmagic": "unofficial::libmagic::libmagic", + "libwebp::webp": "WebP::webp", + "libwebp::webpdecoder": "WebP::webpdecoder", + "libwebp::webpdemux": "WebP::webpdemux", + "libwebp::webpmux": "WebP::libwebpmux", + "lz4": "LZ4::LZ4", + "zlib": "ZLIB::ZLIB", + "zstd": "Zstd::Zstd", + } + for component, new_target_name in renamed_targets.items(): + deps.set_property(component, "cmake_target_name", new_target_name) + + deps.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + def _patch_sources(self): + # Disable examples + 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, "CMakeLists.txt"), + "add_subdirectory(experimental/experimental_examples)", "") + # Don't actually run vcpkg + save(self, os.path.join(self.source_folder, "cmake", "Options", "TileDBToolchain.cmake"), "") + # No such target defined in CCI + if self.options.serialization: + capnproto_bindir = self.dependencies['capnproto'].cpp_info.bindir + replace_in_file(self, os.path.join(self.source_folder, "tiledb", "CMakeLists.txt"), + "set(CAPNP_PLUGIN_DIR $)", + f'set(CAPNP_PLUGIN_DIR "{capnproto_bindir}")') + + 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() + # tools are not installed by CMake + if self.options.tools: + suffix = ".exe" if self.settings.os == "Windows" else "" + copy(self, f"tiledb{suffix}", + src=os.path.join(self.build_folder, "tools"), + 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")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "TileDB") + suffix = "shared" if self.options.shared else "static" + self.cpp_info.set_property("cmake_target_name", f"TileDB::tiledb_{suffix}") + self.cpp_info.set_property("cmake_target_aliases", ["TileDB::tiledb"]) + self.cpp_info.set_property("pkg_config_name", "tiledb") + + self.cpp_info.libs = ["tiledb"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) + if stdcpp_library(self): + self.cpp_info.system_libs.append(stdcpp_library(self)) diff --git a/recipes/tiledb/all/test_package/CMakeLists.txt b/recipes/tiledb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6de1a132987e0 --- /dev/null +++ b/recipes/tiledb/all/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX C) + +find_package(TileDB REQUIRED CONFIG) + +if (TILEDB_CPP_API) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE TileDB::tiledb) + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_17) +endif() + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c PRIVATE TileDB::tiledb) +target_compile_features(${PROJECT_NAME}_c PRIVATE c_std_99) diff --git a/recipes/tiledb/all/test_package/conanfile.py b/recipes/tiledb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e12ef4e9a27cb --- /dev/null +++ b/recipes/tiledb/all/test_package/conanfile.py @@ -0,0 +1,42 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain +from conan.tools.files import save, load + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["TILEDB_CPP_API"] = self.dependencies["tiledb"].options.cpp_api + tc.generate() + save(self, os.path.join(self.build_folder, "have_tools"), str(self.dependencies["tiledb"].options.tools)) + + 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_cpp") + if os.path.exists(bin_path): + self.run(bin_path, env="conanrun") + + bin_path = os.path.join(self.cpp.build.bindir, "test_package_c") + self.run(bin_path, env="conanrun") + + have_tools = load(self, os.path.join(self.build_folder, "have_tools")) == "True" + if have_tools: + self.run("tiledb help info", env="conanrun") diff --git a/recipes/tiledb/all/test_package/test_package.c b/recipes/tiledb/all/test_package/test_package.c new file mode 100644 index 0000000000000..399f427b0fe86 --- /dev/null +++ b/recipes/tiledb/all/test_package/test_package.c @@ -0,0 +1,15 @@ +#include + +#include + +int main() { + tiledb_ctx_t* ctx; + tiledb_ctx_alloc(NULL, &ctx); + tiledb_ctx_free(&ctx); + + int32_t major, minor, rev; + tiledb_version(&major, &minor, &rev); + printf("TileDB version: %d.%d.%d\n", major, minor, rev); + + return 0; +} diff --git a/recipes/tiledb/all/test_package/test_package.cpp b/recipes/tiledb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a8b39dd993dc1 --- /dev/null +++ b/recipes/tiledb/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include + +#include + +int main() { + tiledb::Context ctx; + + auto version = tiledb::version(); + std::cout << "TileDB version: " + << std::get<0>(version) << "." << std::get<1>(version) << "." << std::get<2>(version) + << std::endl; + + return 0; +} diff --git a/recipes/tiledb/config.yml b/recipes/tiledb/config.yml new file mode 100644 index 0000000000000..a6f63ba7f5ece --- /dev/null +++ b/recipes/tiledb/config.yml @@ -0,0 +1,3 @@ +versions: + "2.26.1": + folder: all diff --git a/recipes/timsort/all/conandata.yml b/recipes/timsort/all/conandata.yml index 494ae5cf97b30..0a421d85bab63 100644 --- a/recipes/timsort/all/conandata.yml +++ b/recipes/timsort/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.0": + url: "https://github.com/timsort/cpp-TimSort/archive/v3.0.0.tar.gz" + sha256: "d61b92850996305e5248d1621c8ac437c31b474f74907e223019739e2e556b1f" "2.1.0": url: "https://github.com/timsort/cpp-TimSort/archive/v2.1.0.tar.gz" sha256: "b16606f85316d9a3cfde638c02dd9ce23324b0a904bb020e4ad2497cb8cf9ebd" diff --git a/recipes/timsort/all/conanfile.py b/recipes/timsort/all/conanfile.py index 9df11dc1a164c..2cf482ec5ce9d 100644 --- a/recipes/timsort/all/conanfile.py +++ b/recipes/timsort/all/conanfile.py @@ -5,20 +5,28 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=2.0.9" class TimsortConan(ConanFile): name = "timsort" description = "A C++ implementation of timsort" - topics = ("sorting", "algorithms") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/timsort/cpp-TimSort" - license = "MIT" + topics = ("sorting", "algorithms", "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) < "2.0.0": + return "98" + if Version(self.version) < "3.0.0": + return "11" + return "20" + def layout(self): basic_layout(self, src_folder="src") @@ -26,9 +34,7 @@ def package_id(self): self.info.clear() def validate(self): - if self.settings.compiler.get_safe("cppstd"): - if Version(self.version) >= "2.0.0": - 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) @@ -43,14 +49,6 @@ def package(self): 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.components["gfx-timsort"].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" - self.cpp_info.filenames["cmake_find_package_multi"] = "gfx-timsort" - self.cpp_info.names["cmake_find_package"] = "gfx" - self.cpp_info.names["cmake_find_package_multi"] = "gfx" - self.cpp_info.components["gfx-timsort"].names["cmake_find_package"] = "timsort" - self.cpp_info.components["gfx-timsort"].names["cmake_find_package_multi"] = "timsort" - self.cpp_info.components["gfx-timsort"].set_property("cmake_target_name", "gfx::timsort") diff --git a/recipes/timsort/all/test_package/CMakeLists.txt b/recipes/timsort/all/test_package/CMakeLists.txt index 0e39263ef4095..27bb0041156df 100644 --- a/recipes/timsort/all/test_package/CMakeLists.txt +++ b/recipes/timsort/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(gfx-timsort REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE gfx::timsort) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/timsort/all/test_v1_package/CMakeLists.txt b/recipes/timsort/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/timsort/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/timsort/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_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 798460e5d36d8..81269db497bd6 100644 --- a/recipes/timsort/config.yml +++ b/recipes/timsort/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.0": + folder: all "2.1.0": folder: all "2.0.2": 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/test_v1_package/CMakeLists.txt b/recipes/tinkerforge-bindings/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tinkerforge-bindings/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 9b63bd176646b..0000000000000 --- a/recipes/tinkerforge-bindings/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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): - 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-aes-c/all/conanfile.py b/recipes/tiny-aes-c/all/conanfile.py index e393e50a77697..43b33458ac0de 100644 --- a/recipes/tiny-aes-c/all/conanfile.py +++ b/recipes/tiny-aes-c/all/conanfile.py @@ -2,9 +2,10 @@ 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 +from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class TinyAesCConan(ConanFile): @@ -14,7 +15,7 @@ class TinyAesCConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "Small portable AES128/192/256 in C" topics = ("encryption", "crypto", "AES") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -87,6 +88,8 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True # Relocatable shared lib on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) <= "1.0.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): diff --git a/recipes/tiny-aes-c/all/test_package/CMakeLists.txt b/recipes/tiny-aes-c/all/test_package/CMakeLists.txt index 40e72103cc9fc..4783d7a7c7238 100644 --- a/recipes/tiny-aes-c/all/test_package/CMakeLists.txt +++ b/recipes/tiny-aes-c/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 CXX) find_package(tiny-aes-c REQUIRED CONFIG) diff --git a/recipes/tiny-aes-c/all/test_v1_package/CMakeLists.txt b/recipes/tiny-aes-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tiny-aes-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tiny-aes-c/all/test_v1_package/conanfile.py b/recipes/tiny-aes-c/all/test_v1_package/conanfile.py deleted file mode 100644 index 43f372e78e8c3..0000000000000 --- a/recipes/tiny-aes-c/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +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 = os.path.join("bin", "test_package_c") - self.run(bin_path, run_environment=True) - bin_path = os.path.join("bin", "test_package_cpp") - self.run(bin_path, run_environment=True) diff --git a/recipes/tiny-bignum-c/all/CMakeLists.txt b/recipes/tiny-bignum-c/all/CMakeLists.txt index 44dd25e827b3a..cbc886a8d27f1 100644 --- a/recipes/tiny-bignum-c/all/CMakeLists.txt +++ b/recipes/tiny-bignum-c/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(tiny-bignum-c LANGUAGES C) add_library(tiny-bignum-c ${TINY_BIGNUM_C_SRC_DIR}/bn.c) diff --git a/recipes/tiny-bignum-c/all/test_package/CMakeLists.txt b/recipes/tiny-bignum-c/all/test_package/CMakeLists.txt index a60cde76895a2..48a91d53182a2 100644 --- a/recipes/tiny-bignum-c/all/test_package/CMakeLists.txt +++ b/recipes/tiny-bignum-c/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(tiny-bignum-c REQUIRED CONFIG) diff --git a/recipes/tiny-bignum-c/all/test_v1_package/CMakeLists.txt b/recipes/tiny-bignum-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tiny-bignum-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tiny-bignum-c/all/test_v1_package/conanfile.py b/recipes/tiny-bignum-c/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tiny-bignum-c/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_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/tiny-dnn/all/test_v1_package/CMakeLists.txt b/recipes/tiny-dnn/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tiny-dnn/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tiny-dnn/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_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/tiny-regex-c/all/CMakeLists.txt b/recipes/tiny-regex-c/all/CMakeLists.txt index 26cfc3ad0a04d..d81678d3fe210 100644 --- a/recipes/tiny-regex-c/all/CMakeLists.txt +++ b/recipes/tiny-regex-c/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(tiny-regex-c LANGUAGES C) add_library(${PROJECT_NAME} ${TINY_REGEX_C_SRC_DIR}/re.c) diff --git a/recipes/tiny-regex-c/all/test_package/CMakeLists.txt b/recipes/tiny-regex-c/all/test_package/CMakeLists.txt index 7fe8bdd3edaeb..ab230bac448c7 100644 --- a/recipes/tiny-regex-c/all/test_package/CMakeLists.txt +++ b/recipes/tiny-regex-c/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(tiny-regex-c REQUIRED CONFIG) diff --git a/recipes/tiny-regex-c/all/test_v1_package/CMakeLists.txt b/recipes/tiny-regex-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tiny-regex-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tiny-regex-c/all/test_v1_package/conanfile.py b/recipes/tiny-regex-c/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tiny-regex-c/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_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/tiny-utf8/all/test_package/CMakeLists.txt b/recipes/tiny-utf8/all/test_package/CMakeLists.txt index e43ae145c7705..94bf252652e7e 100644 --- a/recipes/tiny-utf8/all/test_package/CMakeLists.txt +++ b/recipes/tiny-utf8/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(tinyutf8 REQUIRED CONFIG) diff --git a/recipes/tiny-utf8/all/test_v1_package/CMakeLists.txt b/recipes/tiny-utf8/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 5cf8cfb85bc6b..0000000000000 --- a/recipes/tiny-utf8/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tinyutf8 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tinyutf8::tinyutf8) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tiny-utf8/all/test_v1_package/conanfile.py b/recipes/tiny-utf8/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tiny-utf8/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_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/tinyad/all/conandata.yml b/recipes/tinyad/all/conandata.yml new file mode 100644 index 0000000000000..a2c45fe6ad86b --- /dev/null +++ b/recipes/tinyad/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20240718": + url: "https://github.com/patr-schm/TinyAD/archive/29417031c185b6dc27b6d4b684550d844459b735.tar.gz" + sha256: "0458b9aabd31bff079aa5e9e559bd4753744c29f9ffce9d06a6510409c92e221" \ No newline at end of file diff --git a/recipes/tinyad/all/conanfile.py b/recipes/tinyad/all/conanfile.py new file mode 100644 index 0000000000000..a71ac5080cf3f --- /dev/null +++ b/recipes/tinyad/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.microsoft import is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + + +class TinyADConan(ConanFile): + name = "tinyad" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/patr-schm/TinyAD" + description = "TinyAD is a C++ header-only library for second-order automatic differentiation" + topics = ("algebra", "linear-algebra", "optimization", "autodiff", "numerical", "header-only") + package_type = "header-library" + license = ("MIT") + settings = "os", "arch", "compiler", "build_type" + + def requirements(self): + self.requires("eigen/3.4.0") + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "12.0", + "Visual Studio": "15", + "msvc": "191", + } + + def validate(self): + required_min_cppstd = "17" + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, required_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++{required_min_cppstd}, which your compiler does not support." + ) + + 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) + + def package(self): + # The project has a CMakelists.txt file, but it doesn't have "install" logic + # so we just copy the headers to the package folder + copy(self, "include/**", src=self.source_folder, dst=self.package_folder) + 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", "TinyAD") + self.cpp_info.set_property("cmake_target_name", "TinyAD") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + if is_msvc(self): + # https://github.com/patr-schm/TinyAD/blob/29417031c185b6dc27b6d4b684550d844459b735/CMakeLists.txt#L35 + self.cpp_info.cxxflags.append("/bigobj") diff --git a/recipes/tinyad/all/test_package/CMakeLists.txt b/recipes/tinyad/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a9e943ae38cac --- /dev/null +++ b/recipes/tinyad/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(TinyAD REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE TinyAD) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/tinyad/all/test_package/conanfile.py b/recipes/tinyad/all/test_package/conanfile.py new file mode 100644 index 0000000000000..c0ba081cf41ea --- /dev/null +++ b/recipes/tinyad/all/test_package/conanfile.py @@ -0,0 +1,25 @@ +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): + self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") diff --git a/recipes/tinyad/all/test_package/test_package.cpp b/recipes/tinyad/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2b49f0bdc7ad9 --- /dev/null +++ b/recipes/tinyad/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include +#include +#include + +int main(void) { + // Choose autodiff scalar type for 3 variables + using ADouble = TinyAD::Double<3>; + + // Init a 3D vector of active variables and a 3D vector of passive variables + Eigen::Vector3 x = ADouble::make_active({0.0, -1.0, 1.0}); + Eigen::Vector3 y(2.0, 3.0, 5.0); + + // Compute angle using Eigen functions and retrieve gradient and Hessian w.r.t. x + ADouble angle = acos(x.dot(y) / (x.norm() * y.norm())); + Eigen::Vector3d g = angle.grad; + Eigen::Matrix3d H = angle.Hess; + + std::cout << "TinyAD test package successful \n"; + + return 0; +} diff --git a/recipes/tinyad/config.yml b/recipes/tinyad/config.yml new file mode 100644 index 0000000000000..ade632d071b81 --- /dev/null +++ b/recipes/tinyad/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20240718": + folder: all diff --git a/recipes/tinyalsa/all/test_package/CMakeLists.txt b/recipes/tinyalsa/all/test_package/CMakeLists.txt index 164aea9790081..0c15dc10a7b36 100644 --- a/recipes/tinyalsa/all/test_package/CMakeLists.txt +++ b/recipes/tinyalsa/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest LANGUAGES C) find_package(tinyalsa CONFIG REQUIRED) diff --git a/recipes/tinyalsa/all/test_v1_package/CMakeLists.txt b/recipes/tinyalsa/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tinyalsa/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index bb566468b9731..0000000000000 --- a/recipes/tinyalsa/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_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/tinycbor/all/test_package/CMakeLists.txt b/recipes/tinycbor/all/test_package/CMakeLists.txt index d44243714d196..63a051f300d4d 100644 --- a/recipes/tinycbor/all/test_package/CMakeLists.txt +++ b/recipes/tinycbor/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 C) find_package(tinycbor REQUIRED CONFIG) diff --git a/recipes/tinycbor/all/test_v1_package/CMakeLists.txt b/recipes/tinycbor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tinycbor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinycbor/all/test_v1_package/conanfile.py b/recipes/tinycbor/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tinycbor/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_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/tinycolormap/all/conandata.yml b/recipes/tinycolormap/all/conandata.yml new file mode 100644 index 0000000000000..771edaa798dc0 --- /dev/null +++ b/recipes/tinycolormap/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20230223": + url: "https://github.com/yuki-koyama/tinycolormap/archive/0f62abbc269d9677829083d4d563643830ac7fb9.zip" + sha256: "f736d7b76ea07e43da6c6905d891bc58ef512a794bbc0ef3ba9b593b4c1e2d63" diff --git a/recipes/tinycolormap/all/conanfile.py b/recipes/tinycolormap/all/conanfile.py new file mode 100644 index 0000000000000..be4fc0dfc05d4 --- /dev/null +++ b/recipes/tinycolormap/all/conanfile.py @@ -0,0 +1,64 @@ +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 TinycolormapConan(ConanFile): + name = "tinycolormap" + description = "A header-only, single-file library for colormaps written in C++11" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/yuki-koyama/tinycolormap" + topics = ("color", "colormap", "visualization", "header-only") + package_type = "header-library" + + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + options = { + "with_eigen": [True, False], + "with_qt": [True, False], + } + default_options = { + "with_eigen": False, + "with_qt": False, + } + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def requirements(self): + if self.options.with_eigen: + self.requires("eigen/3.4.0") + if self.options.with_qt: + # Only Qt5 is supported + self.requires("qt/5.15.13") + + 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 package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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.options.with_eigen: + self.cpp_info.defines.append("TINYCOLORMAP_WITH_EIGEN") + self.cpp_info.requires.append("eigen::eigen") + if self.options.with_qt: + self.cpp_info.defines.append("TINYCOLORMAP_WITH_QT5") + self.cpp_info.requires.append("qt::qtGui") diff --git a/recipes/tinycolormap/all/test_package/CMakeLists.txt b/recipes/tinycolormap/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..cafa69c0c2ce2 --- /dev/null +++ b/recipes/tinycolormap/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(tinycolormap REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tinycolormap::tinycolormap) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tinycolormap/all/test_package/conanfile.py b/recipes/tinycolormap/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0a808db45f245 --- /dev/null +++ b/recipes/tinycolormap/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/tinycolormap/all/test_package/test_package.cpp b/recipes/tinycolormap/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..fdc0a6b320ab7 --- /dev/null +++ b/recipes/tinycolormap/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include + +int main() { + double value = 0.75; + auto color = tinycolormap::GetColor(value, tinycolormap::ColormapType::Viridis); + std::cout << "Viridis RGB values at " << value << ": " + << (int)color.ri() << " " << (int)color.gi() << " " << (int)color.bi() << std::endl; +} diff --git a/recipes/tinycolormap/config.yml b/recipes/tinycolormap/config.yml new file mode 100644 index 0000000000000..5ebaf8fdf738e --- /dev/null +++ b/recipes/tinycolormap/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20230223": + folder: all diff --git a/recipes/tinycthread/all/test_package/CMakeLists.txt b/recipes/tinycthread/all/test_package/CMakeLists.txt index 70582c5470eea..28eab50803b5b 100644 --- a/recipes/tinycthread/all/test_package/CMakeLists.txt +++ b/recipes/tinycthread/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) diff --git a/recipes/tinycthread/all/test_v1_package/CMakeLists.txt b/recipes/tinycthread/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tinycthread/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tinycthread/all/test_v1_package/conanfile.py b/recipes/tinycthread/all/test_v1_package/conanfile.py deleted file mode 100644 index a500b98343c74..0000000000000 --- a/recipes/tinycthread/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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 = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/tinycthreadpool/all/test_v1_package/CMakeLists.txt b/recipes/tinycthreadpool/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/tinycthreadpool/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinycthreadpool/all/test_v1_package/conanfile.py b/recipes/tinycthreadpool/all/test_v1_package/conanfile.py deleted file mode 100644 index 2a41ea908ed28..0000000000000 --- a/recipes/tinycthreadpool/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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", "example") - self.run(bin_path, run_environment=True) diff --git a/recipes/tinydir/all/test_v1_package/CMakeLists.txt b/recipes/tinydir/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tinydir/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tinydir/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_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 deleted file mode 100644 index cc0003c9c9d0c..0000000000000 --- a/recipes/tinydir/all/test_v1_package/test_package.c +++ /dev/null @@ -1,27 +0,0 @@ -#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/tinyexif/all/test_package/CMakeLists.txt b/recipes/tinyexif/all/test_package/CMakeLists.txt index 569754ada9dd8..176e0b57f1101 100644 --- a/recipes/tinyexif/all/test_package/CMakeLists.txt +++ b/recipes/tinyexif/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(TinyEXIF REQUIRED CONFIG) diff --git a/recipes/tinyexif/all/test_v1_package/CMakeLists.txt b/recipes/tinyexif/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/tinyexif/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinyexif/all/test_v1_package/conanfile.py b/recipes/tinyexif/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/tinyexif/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/tinyexr/all/test_package/CMakeLists.txt b/recipes/tinyexr/all/test_package/CMakeLists.txt index 08dd3dd347374..c7014a3ada120 100644 --- a/recipes/tinyexr/all/test_package/CMakeLists.txt +++ b/recipes/tinyexr/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(tinyexr REQUIRED CONFIG) diff --git a/recipes/tinyexr/all/test_package/conanfile.py b/recipes/tinyexr/all/test_package/conanfile.py index 5a5dc0862d479..e845ae751a301 100644 --- a/recipes/tinyexr/all/test_package/conanfile.py +++ b/recipes/tinyexr/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - img_path = os.path.join(self.source_folder, "test.exr") - self.run(f"{bin_path} {img_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/tinyexr/all/test_package/test.exr b/recipes/tinyexr/all/test_package/test.exr deleted file mode 100644 index 5cc69a90c12ce..0000000000000 Binary files a/recipes/tinyexr/all/test_package/test.exr and /dev/null differ diff --git a/recipes/tinyexr/all/test_package/test_package.cpp b/recipes/tinyexr/all/test_package/test_package.cpp index 2cd0713e457c8..b1d9264dbf3c1 100644 --- a/recipes/tinyexr/all/test_package/test_package.cpp +++ b/recipes/tinyexr/all/test_package/test_package.cpp @@ -11,25 +11,15 @@ int main(int argc, const char *argv[]) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - } - float* out; int width; int height; const char* err = nullptr; - int ret = LoadEXR(&out, &width, &height, argv[1], &err); + int ret = LoadEXR(&out, &width, &height, "non-real-file.exr", &err); - if (ret == TINYEXR_SUCCESS) { - free(out); - } else { - if(err) { - std::cerr << err << std::endl; - } else { - std::cerr << "Unknown error." << std::endl; - } + if (ret != TINYEXR_SUCCESS) { + std::cout << "Test message\n"; // Always prints } return 0; diff --git a/recipes/tinyexr/all/test_v1_package/CMakeLists.txt b/recipes/tinyexr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/tinyexr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinyexr/all/test_v1_package/conanfile.py b/recipes/tinyexr/all/test_v1_package/conanfile.py deleted file mode 100644 index bd607d6c6515a..0000000000000 --- a/recipes/tinyexr/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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") - img_path = os.path.join(self.source_folder, os.pardir, "test_package", "test.exr") - self.run(f"{bin_path} {img_path}", run_environment=True) diff --git a/recipes/tinygltf/all/conandata.yml b/recipes/tinygltf/all/conandata.yml index ecf335230f785..105809b76f50e 100644 --- a/recipes/tinygltf/all/conandata.yml +++ b/recipes/tinygltf/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.9.0": + url: "https://github.com/syoyo/tinygltf/archive/v2.9.0.tar.gz" + sha256: "76c4da3fcd664ccf1b3d35f1d934dd19820141c8705c4966d841176c4c10a2e9" + "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" diff --git a/recipes/tinygltf/all/test_package/CMakeLists.txt b/recipes/tinygltf/all/test_package/CMakeLists.txt index 687cf3cb6de80..28d367023271a 100644 --- a/recipes/tinygltf/all/test_package/CMakeLists.txt +++ b/recipes/tinygltf/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(TinyGLTF REQUIRED CONFIG) diff --git a/recipes/tinygltf/all/test_package/box01.glb b/recipes/tinygltf/all/test_package/box01.glb deleted file mode 100644 index 7477e897f06a5..0000000000000 Binary files a/recipes/tinygltf/all/test_package/box01.glb and /dev/null differ diff --git a/recipes/tinygltf/all/test_package/conanfile.py b/recipes/tinygltf/all/test_package/conanfile.py index 0708ee77c3850..0a6bc68712d90 100644 --- a/recipes/tinygltf/all/test_package/conanfile.py +++ b/recipes/tinygltf/all/test_package/conanfile.py @@ -23,5 +23,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - glb_path = os.path.join(self.source_folder, "box01.glb") - self.run(f"{bin_path} {glb_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/tinygltf/all/test_package/test_package.cpp b/recipes/tinygltf/all/test_package/test_package.cpp index ade21796f6efe..0dd78b403c96f 100644 --- a/recipes/tinygltf/all/test_package/test_package.cpp +++ b/recipes/tinygltf/all/test_package/test_package.cpp @@ -8,29 +8,13 @@ #include int main(int argc, char **argv) { - if (argc < 2) { - std::cerr << "Need at least one argument\n"; - return 1; - } tinygltf::Model model; tinygltf::TinyGLTF loader; std::string err; std::string warn; - bool ret = loader.LoadBinaryFromFile(&model, &err, &warn, argv[1]); - - if (!warn.empty()) { - printf("Warn: %s\n", warn.c_str()); - } - - if (!err.empty()) { - printf("Err: %s\n", err.c_str()); - } - - if (!ret) { - printf("Failed to parse glTF\n"); - return -1; - } + bool ret = loader.LoadBinaryFromFile(&model, &err, &warn, "non_existent_file.glb"); + printf("Test %d\n", ret); return 0; } diff --git a/recipes/tinygltf/all/test_v1_package/CMakeLists.txt b/recipes/tinygltf/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tinygltf/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinygltf/all/test_v1_package/conanfile.py b/recipes/tinygltf/all/test_v1_package/conanfile.py deleted file mode 100644 index 6d85d0b397c56..0000000000000 --- a/recipes/tinygltf/all/test_v1_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 = os.path.join("bin", "test_package") - glb_path = os.path.join(self.source_folder, os.pardir, "test_package", "box01.glb") - self.run(f"{bin_path} {glb_path}", run_environment=True) diff --git a/recipes/tinygltf/config.yml b/recipes/tinygltf/config.yml index b8d9dd2cb9e3a..3eba51a5b7276 100644 --- a/recipes/tinygltf/config.yml +++ b/recipes/tinygltf/config.yml @@ -1,4 +1,8 @@ versions: + "2.9.0": + folder: all + "2.8.19": + folder: all "2.8.13": folder: all "2.5.0": diff --git a/recipes/tinymidi/all/test_package/CMakeLists.txt b/recipes/tinymidi/all/test_package/CMakeLists.txt index e64d0510b8470..1568bd385ae41 100644 --- a/recipes/tinymidi/all/test_package/CMakeLists.txt +++ b/recipes/tinymidi/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(tinymidi REQUIRED CONFIG) diff --git a/recipes/tinymidi/all/test_v1_package/CMakeLists.txt b/recipes/tinymidi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tinymidi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinymidi/all/test_v1_package/conanfile.py b/recipes/tinymidi/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tinymidi/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_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/tinyobjloader/all/test_package/CMakeLists.txt b/recipes/tinyobjloader/all/test_package/CMakeLists.txt index 05eed698062d7..c83024bf599f3 100644 --- a/recipes/tinyobjloader/all/test_package/CMakeLists.txt +++ b/recipes/tinyobjloader/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(tinyobjloader REQUIRED CONFIG) diff --git a/recipes/tinyobjloader/all/test_v1_package/CMakeLists.txt b/recipes/tinyobjloader/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tinyobjloader/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinyobjloader/all/test_v1_package/conanfile.py b/recipes/tinyobjloader/all/test_v1_package/conanfile.py deleted file mode 100644 index 159afa2f8c340..0000000000000 --- a/recipes/tinyobjloader/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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 = os.path.join("bin", "test_package") - res_dir = os.path.join(self.source_folder, os.pardir, "test_package") - obj_path = os.path.join(res_dir, "cube.obj") - mtl_dir = os.path.join(res_dir, "") - self.run(f"{bin_path} {obj_path} {mtl_dir}", run_environment=True) diff --git a/recipes/tinyply/all/conanfile.py b/recipes/tinyply/all/conanfile.py index cd8d6bcce424f..56db9d45e7a8a 100644 --- a/recipes/tinyply/all/conanfile.py +++ b/recipes/tinyply/all/conanfile.py @@ -1,16 +1,18 @@ from conan import ConanFile +from conan.errors import ConanException from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import collect_libs, get, load, rmdir, save +from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class TinyplyConan(ConanFile): name = "tinyply" description = "C++11 ply 3d mesh format importer & exporter." - license = ["Unlicense", "BSD-2-Clause"] + license = ("Unlicense", "BSD-2-Clause") topics = ("tinyply", "ply", "geometry", "mesh", "file-format") homepage = "https://github.com/ddiakopoulos/tinyply" url = "https://github.com/conan-io/conan-center-index" @@ -31,7 +33,8 @@ def config_options(self): del self.options.fPIC def configure(self): - self.options.rm_safe("fPIC") + if self.options.shared: + self.options.rm_safe("fPIC") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -49,6 +52,9 @@ def generate(self): tc.variables["BUILD_TESTS"] = False # Relocatable shared lib on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.3.4": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): @@ -73,3 +79,5 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tinyply::tinyply") self.cpp_info.set_property("pkg_config_name", "tinyply") self.cpp_info.libs = collect_libs(self) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/tinyply/all/test_package/CMakeLists.txt b/recipes/tinyply/all/test_package/CMakeLists.txt index e3ef9fec340b4..45f382ac798c1 100644 --- a/recipes/tinyply/all/test_package/CMakeLists.txt +++ b/recipes/tinyply/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(tinyply REQUIRED CONFIG) diff --git a/recipes/tinyply/all/test_v1_package/CMakeLists.txt b/recipes/tinyply/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tinyply/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinyply/all/test_v1_package/conanfile.py b/recipes/tinyply/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tinyply/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_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/tinyspline/all/conanfile.py b/recipes/tinyspline/all/conanfile.py index 2800204293c83..923743451ee2c 100644 --- a/recipes/tinyspline/all/conanfile.py +++ b/recipes/tinyspline/all/conanfile.py @@ -7,7 +7,7 @@ import os import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class TinysplineConan(ConanFile): name = "tinyspline" @@ -17,7 +17,7 @@ class TinysplineConan(ConanFile): topics = ("tinyspline ", "nurbs", "b-splines", "bezier") homepage = "https://github.com/msteinbeck/tinyspline" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -78,6 +78,7 @@ def generate(self): tc.variables["TINYSPLINE_DISABLE_PYTHON"] = True tc.variables["TINYSPLINE_DISABLE_R"] = True tc.variables["TINYSPLINE_DISABLE_RUBY"] = True + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support else: tc.variables["TINYSPLINE_WARNINGS_AS_ERRORS"] = False tc.variables["TINYSPLINE_ENABLE_CXX"] = self.options.cxx @@ -162,9 +163,3 @@ def package_info(self): # Workaround to always provide a global target or pkg-config file with all components self.cpp_info.set_property("cmake_target_name", "tinyspline-do-not-use") self.cpp_info.set_property("pkg_config_name", "tinyspline-do-not-use") - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.components["libtinyspline"].names["cmake_find_package"] = "tinyspline" - if self.options.cxx: - self.cpp_info.components["libtinysplinecxx"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["libtinysplinecxx"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/tinyspline/all/test_package/CMakeLists.txt b/recipes/tinyspline/all/test_package/CMakeLists.txt index 4ff151e0924ad..7905d38f6532c 100644 --- a/recipes/tinyspline/all/test_package/CMakeLists.txt +++ b/recipes/tinyspline/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 C CXX) find_package(tinyspline REQUIRED CONFIG) diff --git a/recipes/tinyspline/all/test_package/conanfile.py b/recipes/tinyspline/all/test_package/conanfile.py index 6d32d0065c481..48a47008187a7 100644 --- a/recipes/tinyspline/all/test_package/conanfile.py +++ b/recipes/tinyspline/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, CMakeToolchain, cmake_layout import os @@ -25,12 +25,10 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - bin_c_path = os.path.join(self.cpp.build.bindirs[0], "test_package_c") - self.run(bin_c_path, run_environment=True) - - # TODO: rely on self.dependencies["tinyspline"].options.cxx in CONAN_V2 mode - # see https://github.com/conan-io/conan/issues/11940#issuecomment-1223940786 - bin_cpp_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cpp") - if os.path.exists(bin_cpp_path): - self.run(bin_cpp_path, run_environment=True) + if can_run(self): + bin_c_path = os.path.join(self.cpp.build.bindir, "test_package_c") + self.run(bin_c_path, env="conanrun") + + if self.dependencies["tinyspline"].options.cxx: + bin_cpp_path = os.path.join(self.cpp.build.bindir, "test_package_cpp") + self.run(bin_cpp_path, env="conanrun") diff --git a/recipes/tinyspline/all/test_v1_package/CMakeLists.txt b/recipes/tinyspline/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/tinyspline/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinyspline/all/test_v1_package/conanfile.py b/recipes/tinyspline/all/test_v1_package/conanfile.py deleted file mode 100644 index f0e24ab54dc38..0000000000000 --- a/recipes/tinyspline/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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.definitions["TINYSPLINE_CXX"] = self.options["tinyspline"].cxx - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_c_path = os.path.join("bin", "test_package_c") - self.run(bin_c_path, run_environment=True) - if self.options["tinyspline"].cxx: - bin_cpp_path = os.path.join("bin", "test_package_cpp") - self.run(bin_cpp_path, run_environment=True) diff --git a/recipes/tinyxml/all/CMakeLists.txt b/recipes/tinyxml/all/CMakeLists.txt index c8bf6c2939aa7..e02ca6281390b 100644 --- a/recipes/tinyxml/all/CMakeLists.txt +++ b/recipes/tinyxml/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(tinyxml LANGUAGES CXX) option(TINYXML_WITH_STL "Compile TinyXML with STL" OFF) diff --git a/recipes/tinyxml/all/test_package/CMakeLists.txt b/recipes/tinyxml/all/test_package/CMakeLists.txt index f35c28e75d81c..f8821bd6a1f4b 100644 --- a/recipes/tinyxml/all/test_package/CMakeLists.txt +++ b/recipes/tinyxml/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(tinyxml REQUIRED CONFIG) diff --git a/recipes/tinyxml/all/test_v1_package/CMakeLists.txt b/recipes/tinyxml/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f0821ea56fd5b..0000000000000 --- a/recipes/tinyxml/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(TinyXML REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE TinyXML::TinyXML) diff --git a/recipes/tinyxml/all/test_v1_package/conanfile.py b/recipes/tinyxml/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tinyxml/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_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/tinyxml2/all/conandata.yml b/recipes/tinyxml2/all/conandata.yml index e2cd904cc1876..81bce4845d544 100644 --- a/recipes/tinyxml2/all/conandata.yml +++ b/recipes/tinyxml2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "11.0.0": + url: "https://github.com/leethomason/tinyxml2/archive/refs/tags/11.0.0.tar.gz" + sha256: "5556deb5081fb246ee92afae73efd943c889cef0cafea92b0b82422d6a18f289" + "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" @@ -10,6 +16,10 @@ sources: sha256: "68ebd396a4220d5a9b5a621c6e9c66349c5cfdf5efaea3f16e3bb92e45f4e2a3" patches: "8.0.0": - - patch_file: "patches/0001-cmake-pic.patch" + - patch_file: "patches/0001-cmake4-support.patch" + patch_description: "Remove hardcoded fPIC, increase CMake minimum to 3.5, substitute CMP0063 OLD with new setup" + patch_type: "portability" "7.1.0": - - patch_file: "patches/0001-cmake-pic.patch" + - patch_file: "patches/0001-cmake4-support.patch" + patch_description: "Remove hardcoded fPIC, increase CMake minimum to 3.5, substitute CMP0063 OLD with new setup" + patch_type: "portability" diff --git a/recipes/tinyxml2/all/patches/0001-cmake-pic.patch b/recipes/tinyxml2/all/patches/0001-cmake-pic.patch deleted file mode 100644 index 7ef499dd0ef83..0000000000000 --- a/recipes/tinyxml2/all/patches/0001-cmake-pic.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -40,7 +40,6 @@ option(BUILD_SHARED_LIBS "build as shared library" ON) - option(BUILD_TESTS "build xmltest (deprecated: Use BUILD_TESTING)" ON) - - # To allow using tinyxml in another shared library --set(CMAKE_POSITION_INDEPENDENT_CODE ON) - - set(CMAKE_CXX_VISIBILITY_PRESET hidden) - set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) diff --git a/recipes/tinyxml2/all/patches/0001-cmake4-support.patch b/recipes/tinyxml2/all/patches/0001-cmake4-support.patch new file mode 100644 index 0000000000000..8f5b84bc17be6 --- /dev/null +++ b/recipes/tinyxml2/all/patches/0001-cmake4-support.patch @@ -0,0 +1,23 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,11 +5,7 @@ IF(BIICODE) + ENDIF() + RETURN() + ENDIF(BIICODE) +-cmake_minimum_required(VERSION 2.6 FATAL_ERROR) +-cmake_policy(VERSION 2.6) +-if(POLICY CMP0063) +- cmake_policy(SET CMP0063 OLD) +-endif() ++cmake_minimum_required(VERSION 3.5 FATAL_ERROR) + + project(tinyxml2) + include(GNUInstallDirs) +@@ -40,7 +36,6 @@ option(BUILD_SHARED_LIBS "build as shared library" ON) + option(BUILD_TESTS "build xmltest (deprecated: Use BUILD_TESTING)" ON) + + # To allow using tinyxml in another shared library +-set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) diff --git a/recipes/tinyxml2/all/test_package/CMakeLists.txt b/recipes/tinyxml2/all/test_package/CMakeLists.txt index 237f6a3399d8b..bc4b17a75e5f9 100644 --- a/recipes/tinyxml2/all/test_package/CMakeLists.txt +++ b/recipes/tinyxml2/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(tinyxml2 REQUIRED CONFIG) diff --git a/recipes/tinyxml2/all/test_v1_package/CMakeLists.txt b/recipes/tinyxml2/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tinyxml2/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tinyxml2/all/test_v1_package/conanfile.py b/recipes/tinyxml2/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tinyxml2/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_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/tinyxml2/config.yml b/recipes/tinyxml2/config.yml index 0458a9c7b0da4..2f9820ef62d7d 100644 --- a/recipes/tinyxml2/config.yml +++ b/recipes/tinyxml2/config.yml @@ -1,4 +1,8 @@ versions: + "11.0.0": + folder: all + "10.0.0": + folder: all "9.0.0": folder: all "8.0.0": diff --git a/recipes/tixi3/all/conandata.yml b/recipes/tixi3/all/conandata.yml index 2336f6ccbdc16..0af8f2d8ae5cf 100644 --- a/recipes/tixi3/all/conandata.yml +++ b/recipes/tixi3/all/conandata.yml @@ -4,6 +4,10 @@ sources: url: "https://github.com/DLR-SC/tixi/archive/refs/tags/v3.3.0.tar.gz" patches: "3.3.0": + - patch_file: "patches/0001-missing-stdlib-include.patch" + patch_description: "fix missing stdlib include" + patch_type: "bugfix" + patch_source: "https://github.com/DLR-SC/tixi/pull/225" - patch_file: "patches/link_curl.patch" patch_description: "Fix CMake target name for libcurl" patch_type: "conan" diff --git a/recipes/tixi3/all/conanfile.py b/recipes/tixi3/all/conanfile.py index 945f16516ecaa..d67da63a2bb15 100644 --- a/recipes/tixi3/all/conanfile.py +++ b/recipes/tixi3/all/conanfile.py @@ -33,8 +33,8 @@ def generate(self): deps.generate() def requirements(self): - self.requires("libxml2/2.11.5") - self.requires("libxslt/1.1.34") + self.requires("libxml2/[>=2.12.5 <3]") + self.requires("libxslt/1.1.42") self.requires("libcurl/[>=7.78.0 <9]") def layout(self): diff --git a/recipes/tixi3/all/patches/0001-missing-stdlib-include.patch b/recipes/tixi3/all/patches/0001-missing-stdlib-include.patch new file mode 100644 index 0000000000000..1c8e8d048f4f9 --- /dev/null +++ b/recipes/tixi3/all/patches/0001-missing-stdlib-include.patch @@ -0,0 +1,88 @@ +From 53b324c41133ac72b36f2bcda0b75c2bf2f3bff0 Mon Sep 17 00:00:00 2001 +From: mayeut +Date: Sat, 20 Apr 2024 13:10:18 +0200 +Subject: [PATCH] fix issues with latest version of libxml2 + +--- + src/tixiImpl.c | 1 + + src/tixiInternal.c | 2 +- + src/tixiUtils.c | 1 + + src/uidHelper.c | 1 + + src/webMethods.c | 2 ++ + src/xpathFunctions.c | 1 + + 6 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/tixiImpl.c b/src/tixiImpl.c +index f9e08b9..aa306d1 100644 +--- a/src/tixiImpl.c ++++ b/src/tixiImpl.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + #include "libxml/parser.h" + #include "libxml/xpath.h" +diff --git a/src/tixiInternal.c b/src/tixiInternal.c +index 5bf0712..b399b4d 100644 +--- a/src/tixiInternal.c ++++ b/src/tixiInternal.c +@@ -46,7 +46,7 @@ + + extern void printMsg(MessageType type, const char* message, ...); + +-void xmlStructuredErrorHandler(void * userData, xmlErrorPtr error) { ++void xmlStructuredErrorHandler(void * userData, xmlError const* error) { + printMsg(MESSAGETYPE_ERROR, "%s:%i: %s", error->file, error->line, error->message); + } + +diff --git a/src/tixiUtils.c b/src/tixiUtils.c +index 834be5d..bd42fc8 100644 +--- a/src/tixiUtils.c ++++ b/src/tixiUtils.c +@@ -32,6 +32,7 @@ + #include + #include + #endif ++#include + + extern void printMsg(MessageType type, const char* message, ...); + +diff --git a/src/uidHelper.c b/src/uidHelper.c +index 9c7a7bd..841774d 100644 +--- a/src/uidHelper.c ++++ b/src/uidHelper.c +@@ -17,6 +17,7 @@ + */ + #include "uidHelper.h" + #include "tixiInternal.h" ++#include + + extern void printMsg(MessageType type, const char* message, ...); + +diff --git a/src/webMethods.c b/src/webMethods.c +index f8372e9..16e6411 100644 +--- a/src/webMethods.c ++++ b/src/webMethods.c +@@ -25,6 +25,8 @@ + #include + #include + ++#include ++ + extern void printMsg(MessageType type, const char* message, ...); + + void* myrealloc(void* ptr, size_t size) +diff --git a/src/xpathFunctions.c b/src/xpathFunctions.c +index 25442f6..69ce60e 100644 +--- a/src/xpathFunctions.c ++++ b/src/xpathFunctions.c +@@ -21,6 +21,7 @@ + #include "libxml/xpathInternals.h" + + #include ++#include + + extern void printMsg(MessageType type, const char* message, ...); + diff --git a/recipes/tk/all/conandata.yml b/recipes/tk/all/conandata.yml index 7e9e03ca25a75..ab60eb6021e47 100644 --- a/recipes/tk/all/conandata.yml +++ b/recipes/tk/all/conandata.yml @@ -14,3 +14,6 @@ patches: - 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" + - patch_file: "patches/0004-Fix-msvc-shared-build.patch" + patch_description: "Output an inline file directly to its final destination to avoid a failure in C3I" + patch_type: "conan" diff --git a/recipes/tk/all/conanfile.py b/recipes/tk/all/conanfile.py index 2c3e88ddc0d5b..1d1ce6f92531f 100644 --- a/recipes/tk/all/conanfile.py +++ b/recipes/tk/all/conanfile.py @@ -2,7 +2,7 @@ from conan import ConanFile from conan.errors import ConanException, ConanInvalidConfiguration -from conan.tools.apple import is_apple_os +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 ( @@ -136,6 +136,8 @@ def generate(self): "_ATL_XP_TARGETING", ] ) + if not is_apple_os(self): + tc.extra_ldflags.append("-Wl,--as-needed") tc.generate() if self.settings.os == "Linux": @@ -240,6 +242,8 @@ def package(self): # 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}/") + + fix_apple_shared_install_name(self) def package_info(self): tk_version = Version(self.version) @@ -273,6 +277,16 @@ def package_info(self): "ole32", "oleaut32", ] + elif self.settings.os == "Linux": + self.cpp_info.requires = [ + "tcl::tcl", + "fontconfig::fontconfig", + "xorg::x11", + "xorg::xcb", + "xorg::xrender", + "xorg::xau", + "xorg::xdmcp", + ] tk_library = os.path.join( self.package_folder, diff --git a/recipes/tk/all/patches/0004-Fix-msvc-shared-build.patch b/recipes/tk/all/patches/0004-Fix-msvc-shared-build.patch new file mode 100644 index 0000000000000..1665cb737d8b1 --- /dev/null +++ b/recipes/tk/all/patches/0004-Fix-msvc-shared-build.patch @@ -0,0 +1,13 @@ +diff --git a/win/makefile.vc b/win/makefile.vc +index 6371f0f4b..b548f827d 100644 +--- a/win/makefile.vc ++++ b/win/makefile.vc +@@ -651,7 +651,7 @@ install-binaries: + @$(CPY) "$(TKSTUBLIB)" "$(LIB_INSTALL_DIR)\" + !if !$(STATIC_BUILD) + @echo creating package index +- @type << > $(OUT_DIR)\pkgIndex.tcl ++ @type <<$(OUT_DIR)\pkgIndex.tcl + if {[catch {package present Tcl 8.6.0}]} { return } + if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)] + || ([info exists ::argv] && ("-display" in $$::argv)))} { diff --git a/recipes/tl-expected/all/conanfile.py b/recipes/tl-expected/all/conanfile.py index 9e0aa613d3d14..fcea2d681a64a 100644 --- a/recipes/tl-expected/all/conanfile.py +++ b/recipes/tl-expected/all/conanfile.py @@ -14,6 +14,7 @@ class TlExpectedConan(ConanFile): description = "C++11/14/17 std::expected with functional-style extensions" topics = ("cpp11", "cpp14", "cpp17", "expected") license = "CC0-1.0" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/tl-expected/all/test_package/CMakeLists.txt b/recipes/tl-expected/all/test_package/CMakeLists.txt index db7a62e02101e..6f6cd63d9dcc6 100644 --- a/recipes/tl-expected/all/test_package/CMakeLists.txt +++ b/recipes/tl-expected/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(tl-expected REQUIRED CONFIG) diff --git a/recipes/tl-expected/all/test_v1_package/CMakeLists.txt b/recipes/tl-expected/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9e3965ccc9cc1..0000000000000 --- a/recipes/tl-expected/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tl-expected REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tl::expected) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tl-expected/all/test_v1_package/conanfile.py b/recipes/tl-expected/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tl-expected/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_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/tl-function-ref/all/test_package/CMakeLists.txt b/recipes/tl-function-ref/all/test_package/CMakeLists.txt index 795da524a5e5c..13ebafc46939c 100644 --- a/recipes/tl-function-ref/all/test_package/CMakeLists.txt +++ b/recipes/tl-function-ref/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(tl-function-ref REQUIRED CONFIG) diff --git a/recipes/tl-function-ref/all/test_v1_package/CMakeLists.txt b/recipes/tl-function-ref/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7b288bff158e7..0000000000000 --- a/recipes/tl-function-ref/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tl-function-ref REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tl::function-ref) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tl-function-ref/all/test_v1_package/conanfile.py b/recipes/tl-function-ref/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tl-function-ref/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_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/tl-optional/all/test_package/CMakeLists.txt b/recipes/tl-optional/all/test_package/CMakeLists.txt index e4ef3b1e5cc66..c2318c4293f64 100644 --- a/recipes/tl-optional/all/test_package/CMakeLists.txt +++ b/recipes/tl-optional/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(tl-optional REQUIRED CONFIG) diff --git a/recipes/tl-optional/all/test_v1_package/CMakeLists.txt b/recipes/tl-optional/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index ea7e390161229..0000000000000 --- a/recipes/tl-optional/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tl-optional REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tl::optional) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tl-optional/all/test_v1_package/conanfile.py b/recipes/tl-optional/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tl-optional/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_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/tl-ranges/all/conandata.yml b/recipes/tl-ranges/all/conandata.yml new file mode 100644 index 0000000000000..52e4715a40621 --- /dev/null +++ b/recipes/tl-ranges/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20221207": + url: "https://github.com/TartanLlama/ranges/archive/361dae81e48ea9d0099e8783b56b903c2a6cd01c.tar.gz" + sha256: "9174e368d1f6e89d2ab5b059454dc402e68afdfe6d9bf5376d6634dab7aa2a36" diff --git a/recipes/tl-ranges/all/conanfile.py b/recipes/tl-ranges/all/conanfile.py new file mode 100644 index 0000000000000..a6ce8136be512 --- /dev/null +++ b/recipes/tl-ranges/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 copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.52.0" + +class TLRangesConan(ConanFile): + name = "tl-ranges" + description = "Ranges that didn't make C++20" + license = "CC0-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/TartanLlama/ranges" + topics = ("ranges", "views", "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": "11", + "clang": "15", + "apple-clang": "14", + "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, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + 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 = [] diff --git a/recipes/tl-ranges/all/test_package/CMakeLists.txt b/recipes/tl-ranges/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..03b4aa241a9d0 --- /dev/null +++ b/recipes/tl-ranges/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(tl-ranges REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tl-ranges::tl-ranges) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/tl-ranges/all/test_package/conanfile.py b/recipes/tl-ranges/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/tl-ranges/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/tl-ranges/all/test_package/test_package.cpp b/recipes/tl-ranges/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..76c10d34a8bc4 --- /dev/null +++ b/recipes/tl-ranges/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +#include "tl/enumerate.hpp" + +int main() { + std::vector data = {1, 2, 3, 4, 5}; + + for (auto&& [index, element] : data | tl::views::enumerate) { + std::cout << index << " " << element << '\n'; + } +} diff --git a/recipes/tl-ranges/config.yml b/recipes/tl-ranges/config.yml new file mode 100644 index 0000000000000..676cc76a125dc --- /dev/null +++ b/recipes/tl-ranges/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20221207": + folder: all diff --git a/recipes/tl/all/test_package/CMakeLists.txt b/recipes/tl/all/test_package/CMakeLists.txt index d1a2bc9434517..4c9a0d98bf322 100644 --- a/recipes/tl/all/test_package/CMakeLists.txt +++ b/recipes/tl/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(tl REQUIRED CONFIG) diff --git a/recipes/tl/all/test_v1_package/CMakeLists.txt b/recipes/tl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 59fddf2767731..0000000000000 --- a/recipes/tl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tl REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tl::tl) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tl/all/test_v1_package/conanfile.py b/recipes/tl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tl/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_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/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/test_v1_package/CMakeLists.txt b/recipes/tllist/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tllist/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/tllist/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", "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 deleted file mode 100644 index 77b3400127915..0000000000000 --- a/recipes/tllist/all/test_v1_package/test_package.c +++ /dev/null @@ -1,10 +0,0 @@ -#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/conanfile.py b/recipes/tlx/all/conanfile.py index 419a2fc27c4ef..dca8761bb2372 100644 --- a/recipes/tlx/all/conanfile.py +++ b/recipes/tlx/all/conanfile.py @@ -1,11 +1,11 @@ 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, replace_in_file, rmdir, save +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class TlxConan(ConanFile): @@ -60,8 +60,10 @@ def generate(self): tc.variables["TLX_BUILD_SHARED_LIBS"] = self.options.shared # For msvc shared tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True - # Relocatable shared libs on macOS - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) <= "0.6.1": + # Relocatable shared libs on macOS + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def _patch_sources(self): @@ -83,27 +85,6 @@ def package(self): 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( - os.path.join(self.package_folder, self._module_file_rel_path), - {"tlx": "tlx::tlx"} - ) - - 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", "tlx") self.cpp_info.set_property("cmake_target_name", "tlx") @@ -111,7 +92,3 @@ def package_info(self): self.cpp_info.libs = collect_libs(self) if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["m", "pthread"]) - - # 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/tlx/all/test_package/CMakeLists.txt b/recipes/tlx/all/test_package/CMakeLists.txt index e9517d8c4a071..a4e5cff77b177 100644 --- a/recipes/tlx/all/test_package/CMakeLists.txt +++ b/recipes/tlx/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(tlx REQUIRED CONFIG) diff --git a/recipes/tlx/all/test_v1_package/CMakeLists.txt b/recipes/tlx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tlx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tlx/all/test_v1_package/conanfile.py b/recipes/tlx/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tlx/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_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/tmx/all/conandata.yml b/recipes/tmx/all/conandata.yml index 015638445fd3e..8a82786790fb4 100644 --- a/recipes/tmx/all/conandata.yml +++ b/recipes/tmx/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.10.0": + url: "https://github.com/baylej/tmx/archive/refs/tags/tmx_1.10.0.tar.gz" + sha256: "8ee42d1728c567d6047a58b2624c39c8844aaf675c470f9f284c4ed17e94188f" "1.4.0": url: "https://github.com/baylej/tmx/archive/refs/tags/tmx_1.4.0.tar.gz" sha256: "5ab52e72976141260edd1b15ea34e1626c0f4ba9b8d2afe7f4d68b51fc9fedf7" +patches: + "1.4.0": + - patch_file: "patches/0001-missing-stdlib-include.patch" + patch_description: "fix missing stdlib include" + patch_type: "bugfix" + patch_source: "https://github.com/baylej/tmx/commit/2d20ed631618f5e9ca89d90147aab8157989f5da.patch" diff --git a/recipes/tmx/all/conanfile.py b/recipes/tmx/all/conanfile.py index 532a780023daa..30a73f62e1cfe 100644 --- a/recipes/tmx/all/conanfile.py +++ b/recipes/tmx/all/conanfile.py @@ -1,10 +1,10 @@ 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.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save import os import textwrap -required_conan_version = ">=1.51.1" +required_conan_version = ">=1.53.0" class TmxConan(ConanFile): @@ -15,6 +15,7 @@ class TmxConan(ConanFile): homepage = "https://github.com/baylej/tmx" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,30 +30,24 @@ class TmxConan(ConanFile): "with_zstd": 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: - 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 requirements(self): - self.requires("libxml2/2.11.4") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: @@ -75,6 +70,7 @@ def generate(self): deps.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/tmx/all/patches/0001-missing-stdlib-include.patch b/recipes/tmx/all/patches/0001-missing-stdlib-include.patch new file mode 100644 index 0000000000000..9c45635658dfa --- /dev/null +++ b/recipes/tmx/all/patches/0001-missing-stdlib-include.patch @@ -0,0 +1,22 @@ +From 2d20ed631618f5e9ca89d90147aab8157989f5da Mon Sep 17 00:00:00 2001 +From: Connor Rigby +Date: Thu, 18 Jan 2024 18:40:53 -0700 +Subject: [PATCH] tmx_mem: add stdlib.h for free and realloc + +Signed-off-by: Connor Rigby +--- + src/tmx_mem.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/tmx_mem.c b/src/tmx_mem.c +index 5ff31c9..b421af6 100644 +--- a/src/tmx_mem.c ++++ b/src/tmx_mem.c +@@ -2,6 +2,7 @@ + Node allocation + */ + ++#include + #include + + #include diff --git a/recipes/tmx/all/test_package/CMakeLists.txt b/recipes/tmx/all/test_package/CMakeLists.txt index 27410290350a8..b10820a839896 100644 --- a/recipes/tmx/all/test_package/CMakeLists.txt +++ b/recipes/tmx/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(tmx REQUIRED CONFIG) diff --git a/recipes/tmx/all/test_v1_package/CMakeLists.txt b/recipes/tmx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7b3630d9b9ae2..0000000000000 --- a/recipes/tmx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tmx REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE tmx) diff --git a/recipes/tmx/all/test_v1_package/conanfile.py b/recipes/tmx/all/test_v1_package/conanfile.py deleted file mode 100644 index 5654af76091cf..0000000000000 --- a/recipes/tmx/all/test_v1_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 = os.path.join("bin", "test_package") - tmx_path = os.path.join(self.source_folder, os.pardir, "test_package", "externtileset.tmx") - self.run(f"{bin_path} {tmx_path}", run_environment=True) diff --git a/recipes/tmx/config.yml b/recipes/tmx/config.yml index c957e4bc2d3c7..2403f62fecbf1 100644 --- a/recipes/tmx/config.yml +++ b/recipes/tmx/config.yml @@ -1,3 +1,5 @@ versions: + "1.10.0": + folder: all "1.4.0": folder: all diff --git a/recipes/tmxlite/all/conandata.yml b/recipes/tmxlite/all/conandata.yml index acb2db05df822..e7bc4087210dd 100644 --- a/recipes/tmxlite/all/conandata.yml +++ b/recipes/tmxlite/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.4": + url: "https://github.com/fallahn/tmxlite/archive/refs/tags/v1.4.4.tar.gz" + sha256: "ec8893efc8396308f291c284cb09f007441a15aabbb0e5722096cf79c65c9e58" "1.3.0": url: "https://github.com/fallahn/tmxlite/archive/refs/tags/v1.3.0.tar.gz" sha256: "f5d2abd23d4516168eb82bbe879998ce41cb17768f8cd72f643f394939123efe" diff --git a/recipes/tmxlite/all/conanfile.py b/recipes/tmxlite/all/conanfile.py index 44380126b8654..ab42a45dc9458 100644 --- a/recipes/tmxlite/all/conanfile.py +++ b/recipes/tmxlite/all/conanfile.py @@ -1,12 +1,12 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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, replace_in_file, rm, rmdir from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class TmxliteConan(ConanFile): @@ -17,6 +17,7 @@ class TmxliteConan(ConanFile): homepage = "https://github.com/fallahn/tmxlite" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,17 +37,18 @@ 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("miniz/2.2.0") - self.requires("pugixml/1.12.1") + if Version(self.version) < "1.4.1": + self.requires("miniz/3.0.2") + else: + self.requires("zlib/[>=1.2.11 <2]") + self.requires("zstd/1.5.5") + self.requires("pugixml/1.14") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): @@ -55,28 +57,41 @@ def validate(self): raise ConanInvalidConfiguration("gcc < 5 not supported") def source(self): - get(self, **self.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["TMXLITE_STATIC_LIB"] = not self.options.shared tc.variables["PROJECT_STATIC_RUNTIME"] = False tc.variables["USE_RTTI"] = True + if Version(self.version) >= "1.4.1": + tc.variables["USE_EXTLIBS"] = True + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.4.4": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "1.4.1": + deps.set_property("pugixml", "cmake_file_name", "PUGIXML") + deps.set_property("zstd", "cmake_file_name", "Zstd") + deps.set_property("zstd", "cmake_target_name", "zstd::libzstd") deps.generate() def _patch_sources(self): apply_conandata_patches(self) - # unvendor miniz - rm(self, "miniz*", os.path.join(self.source_folder, "tmxlite", "src")) - replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "src", "CMakeLists.txt"), - "${PROJECT_DIR}/miniz.c", "") - # unvendor pugixml - rmdir(self, os.path.join(self.source_folder, "tmxlite", "src", "detail")) - replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "src", "CMakeLists.txt"), - "${PROJECT_DIR}/detail/pugixml.cpp", "") + if Version(self.version) < "1.4.0": + # unvendor miniz + rm(self, "miniz*", os.path.join(self.source_folder, "tmxlite", "src")) + replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "src", "CMakeLists.txt"), + "${PROJECT_DIR}/miniz.c", "") + # unvendor pugixml + rmdir(self, os.path.join(self.source_folder, "tmxlite", "src", "detail")) + replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "src", "CMakeLists.txt"), + "${PROJECT_DIR}/detail/pugixml.cpp", "") + else: + replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "CMakeLists.txt"), + "target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES} ${PUGIXML_LIBRARY} ${ZSTD_LIBRARY})", + "target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB pugixml::pugixml zstd::libzstd)") # Don't inject -O3 in compile flags replace_in_file(self, os.path.join(self.source_folder, "tmxlite", "CMakeLists.txt"), "-O3", "") @@ -91,6 +106,8 @@ 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, "lib", "pkgconfig")) def package_info(self): self.cpp_info.libs = collect_libs(self) diff --git a/recipes/tmxlite/all/test_package/CMakeLists.txt b/recipes/tmxlite/all/test_package/CMakeLists.txt index 564eece99799e..083f11f594daa 100644 --- a/recipes/tmxlite/all/test_package/CMakeLists.txt +++ b/recipes/tmxlite/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(tmxlite REQUIRED CONFIG) diff --git a/recipes/tmxlite/all/test_v1_package/CMakeLists.txt b/recipes/tmxlite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index ca4979c8e62d9..0000000000000 --- a/recipes/tmxlite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tmxlite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tmxlite::tmxlite) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/tmxlite/all/test_v1_package/conanfile.py b/recipes/tmxlite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tmxlite/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_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/tmxlite/config.yml b/recipes/tmxlite/config.yml index 426a0e4c79e9b..33f41bd49b3a4 100644 --- a/recipes/tmxlite/config.yml +++ b/recipes/tmxlite/config.yml @@ -1,3 +1,5 @@ versions: + "1.4.4": + folder: all "1.3.0": folder: all diff --git a/recipes/tng/all/test_package/CMakeLists.txt b/recipes/tng/all/test_package/CMakeLists.txt index 30ebfd5167712..a5d96f4d45c91 100644 --- a/recipes/tng/all/test_package/CMakeLists.txt +++ b/recipes/tng/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(tng_io REQUIRED CONFIG) diff --git a/recipes/tng/all/test_v1_package/CMakeLists.txt b/recipes/tng/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tng/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tng/all/test_v1_package/conanfile.py b/recipes/tng/all/test_v1_package/conanfile.py deleted file mode 100644 index 2fc9de9b0d3fc..0000000000000 --- a/recipes/tng/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_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/toml11/all/conandata.yml b/recipes/toml11/all/conandata.yml index 473d7afa5e2db..af2b296de93e3 100644 --- a/recipes/toml11/all/conandata.yml +++ b/recipes/toml11/all/conandata.yml @@ -1,22 +1,19 @@ sources: - "3.7.1": - url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.7.1.tar.gz" - sha256: "afeaa9aa0416d4b6b2cd3897ca55d9317084103077b32a852247d8efd4cf6068" - "3.7.0": - url: "https://github.com/ToruNiina/toml11/archive/v3.7.0.tar.gz" - sha256: "a0b6bec77c0e418eea7d270a4437510884f2fe8f61e7ab121729624f04c4b58e" - "3.6.1": - url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.6.1.tar.gz" - sha256: "ca4c390ed8da0d77ae6eca30e70ab0bf5cc92adfc1bc2f71a2066bc5656d8d96" - "3.6.0": - url: "https://github.com/ToruNiina/toml11/archive/v3.6.0.tar.gz" - sha256: "39e8d651db346ae8c7e3b39d6338a37232b9af3bba36ade45b241bf105c2226c" - "3.5.0": - url: "https://github.com/ToruNiina/toml11/archive/v3.5.0.tar.gz" - sha256: "fc613874c6e80dc740134a7353cf23c7f834b59cd601af84ab535ee16a53b1c3" - "3.4.0": - url: "https://github.com/ToruNiina/toml11/archive/v3.4.0.tar.gz" - sha256: "bc6d733efd9216af8c119d8ac64a805578c79cc82b813e4d1d880ca128bd154d" - "3.1.0": - url: "https://github.com/ToruNiina/toml11/archive/v3.1.0.tar.gz" - sha256: "3a118f32e5343998f37be9807c72fd11c3168fe12a5b1abfdc0f1e60de6380a4" + "4.4.0": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v4.4.0.tar.gz" + sha256: "815bfe6792aa11a13a133b86e7f0f45edc5d71eb78f5fb6686c49c7f792b9049" + "4.2.0": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v4.2.0.tar.gz" + sha256: "9287971cd4a1a3992ef37e7b95a3972d1ae56410e7f8e3f300727ab1d6c79c2c" + "4.1.0": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v4.1.0.tar.gz" + sha256: "fb4c02cc708ae28e6fc3496514e3625e4b6738ed4ce40897710ca4d7a29de4f7" + "4.0.3": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v4.0.3.tar.gz" + sha256: "c8cbc7839cb3f235153045ce550e559f55a04554dfcab8743ba8a1e8ef6a54bf" + "4.0.1": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v4.0.1.tar.gz" + sha256: "96965cb00ca7757c611c169cd5a6fb15736eab1cd1c1a88aaa62ad9851d926aa" + "3.8.1": + url: "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.8.1.tar.gz" + sha256: "6a3d20080ecca5ea42102c078d3415bef80920f6c4ea2258e87572876af77849" diff --git a/recipes/toml11/all/conanfile.py b/recipes/toml11/all/conanfile.py index 72284ac7310c2..a610df26ea139 100644 --- a/recipes/toml11/all/conanfile.py +++ b/recipes/toml11/all/conanfile.py @@ -2,6 +2,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" @@ -9,11 +10,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,20 +30,22 @@ 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")) - copy(self, "*.hpp", src=os.path.join(self.source_folder, "toml"), dst=os.path.join(self.package_folder, "include", "toml11", "toml")) + if Version(self.version) < "4.0.0": + copy(self, "toml.hpp", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "toml11")) + copy(self, "*.hpp", src=os.path.join(self.source_folder, "toml"), dst=os.path.join(self.package_folder, "include", "toml11", "toml")) + else: + copy(self, "*.hpp", 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.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "toml11") self.cpp_info.set_property("cmake_target_name", "toml11::toml11") - self.cpp_info.bindirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "toml11")) - self.cpp_info.libdirs = [] diff --git a/recipes/toml11/all/test_package/CMakeLists.txt b/recipes/toml11/all/test_package/CMakeLists.txt index 6fbc21219d46f..20d5be5e36b0b 100644 --- a/recipes/toml11/all/test_package/CMakeLists.txt +++ b/recipes/toml11/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(toml11 REQUIRED CONFIG) diff --git a/recipes/toml11/all/test_v1_package/CMakeLists.txt b/recipes/toml11/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/toml11/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/toml11/all/test_v1_package/conanfile.py b/recipes/toml11/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/toml11/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_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/toml11/config.yml b/recipes/toml11/config.yml index 2a3893e072fff..a1dc228fcf169 100644 --- a/recipes/toml11/config.yml +++ b/recipes/toml11/config.yml @@ -1,15 +1,13 @@ versions: - "3.7.1": + "4.4.0": folder: all - "3.7.0": + "4.2.0": folder: all - "3.6.1": + "4.1.0": folder: all - "3.6.0": + "4.0.3": folder: all - "3.5.0": + "4.0.1": folder: all - "3.4.0": - folder: all - "3.1.0": + "3.8.1": folder: all diff --git a/recipes/tomlplusplus/all/conanfile.py b/recipes/tomlplusplus/all/conanfile.py index c7d9d9ea44bf5..4743d8a6d4255 100644 --- a/recipes/tomlplusplus/all/conanfile.py +++ b/recipes/tomlplusplus/all/conanfile.py @@ -21,6 +21,12 @@ class TomlPlusPlusConan(ConanFile): license = "MIT" package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + options = { + "exceptions": [True, False, None] + } + default_options = { + "exceptions": None + } no_copy_source = True @property @@ -73,3 +79,8 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "tomlplusplus::tomlplusplus") self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + # Casting as a String because None value would not be properly handled, this is a PackageOption, not the value itself + # which `is` never None + if str(self.options.exceptions) != "None": + define_value = "1" if self.options.exceptions is True else "0" + self.cpp_info.defines.append(f"TOML_EXCEPTIONS={define_value}") diff --git a/recipes/tomlplusplus/all/test_package/CMakeLists.txt b/recipes/tomlplusplus/all/test_package/CMakeLists.txt index dfea477614e59..6c7cc6df8160b 100644 --- a/recipes/tomlplusplus/all/test_package/CMakeLists.txt +++ b/recipes/tomlplusplus/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(tomlplusplus REQUIRED CONFIG) diff --git a/recipes/tomlplusplus/all/test_package/test_package.cpp b/recipes/tomlplusplus/all/test_package/test_package.cpp index d50b3c6469741..96107c1712ae1 100644 --- a/recipes/tomlplusplus/all/test_package/test_package.cpp +++ b/recipes/tomlplusplus/all/test_package/test_package.cpp @@ -7,21 +7,25 @@ using namespace std::string_view_literals; int main(int argc, char* argv[]) { auto config = toml::parse_file(argv[1]); + // Important: this cast will convert from parse_result which is sometimes defined as a table + // and sometimes defined as it's own class that is castable to a table&. + auto& table = static_cast(config); // get key-value pairs - std::string_view library_name = config["library"]["name"].value_or(""sv); - std::string_view library_author = config["library"]["authors"][0].value_or(""sv); - int64_t depends_on_cpp_version = config["dependencies"]["cpp"].value_or(0); + std::string_view library_name = table["library"]["name"].value_or(""sv); + std::string_view library_author = table["library"]["authors"][0].value_or(""sv); + int64_t depends_on_cpp_version = table["dependencies"]["cpp"].value_or(0); // modify the data - config.insert_or_assign("alternatives", toml::array{ + table.insert_or_assign("alternatives", toml::array{ "cpptoml", "toml11", "Boost.TOML" }); + table.insert_or_assign("exceptions", TOML_EXCEPTIONS==1); // iterate & visit over the data - for (auto&& [k, v] : config) + for (auto&& [k, v] : table) { v.visit([](auto& node) noexcept { @@ -30,9 +34,9 @@ int main(int argc, char* argv[]) { } // re-serialize as TOML - std::cout << config << std::endl; + std::cout << table << std::endl; // re-serialize as JSON - std::cout << toml::json_formatter{ config } << std::endl; + std::cout << toml::json_formatter{ table } << std::endl; return 0; } diff --git a/recipes/tomlplusplus/all/test_package/test_package_multi.cpp b/recipes/tomlplusplus/all/test_package/test_package_multi.cpp index df195938cfdee..436a7391f96b1 100644 --- a/recipes/tomlplusplus/all/test_package/test_package_multi.cpp +++ b/recipes/tomlplusplus/all/test_package/test_package_multi.cpp @@ -7,21 +7,25 @@ using namespace std::string_view_literals; int main(int argc, char* argv[]) { auto config = toml::parse_file(argv[1]); + // Important: this cast will convert from parse_result which is sometimes defined as a table + // and sometimes defined as it's own class that is castable to a table&. + auto& table = static_cast(config); // get key-value pairs - std::string_view library_name = config["library"]["name"].value_or(""sv); - std::string_view library_author = config["library"]["authors"][0].value_or(""sv); - int64_t depends_on_cpp_version = config["dependencies"]["cpp"].value_or(0); + std::string_view library_name = table["library"]["name"].value_or(""sv); + std::string_view library_author = table["library"]["authors"][0].value_or(""sv); + int64_t depends_on_cpp_version = table["dependencies"]["cpp"].value_or(0); // modify the data - config.insert_or_assign("alternatives", toml::array{ + table.insert_or_assign("alternatives", toml::array{ "cpptoml", "toml11", "Boost.TOML" }); + table.insert_or_assign("exceptions", TOML_EXCEPTIONS==1); // iterate & visit over the data - for (auto&& [k, v] : config) + for (auto&& [k, v] : table) { v.visit([](auto& node) noexcept { @@ -30,9 +34,9 @@ int main(int argc, char* argv[]) { } // re-serialize as TOML - std::cout << config << std::endl; + std::cout << table << std::endl; // re-serialize as JSON - std::cout << toml::json_formatter{ config } << std::endl; + std::cout << toml::json_formatter{ table } << std::endl; return 0; } diff --git a/recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt b/recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a6b6b2e67ed13..0000000000000 --- a/recipes/tomlplusplus/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/tomlplusplus/all/test_v1_package/conanfile.py b/recipes/tomlplusplus/all/test_v1_package/conanfile.py deleted file mode 100644 index 0e8807dfd3ae4..0000000000000 --- a/recipes/tomlplusplus/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +0,0 @@ -from conans import ConanFile, CMake -from conan.tools.scm import Version -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) - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": - self.single_header_only = True - if hasattr(self, "single_header_only"): - cmake.definitions["TOMLPP_BUILD_SINGLE_ONLY"] = True - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - 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") - self.run(f"{bin_path} {conf_path}", run_environment=True) diff --git a/recipes/toon/all/conandata.yml b/recipes/toon/all/conandata.yml new file mode 100644 index 0000000000000..2e5eef4c5773f --- /dev/null +++ b/recipes/toon/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.2": + url: "https://github.com/edrosten/TooN/archive/refs/tags/TOON_3.2.tar.gz" + sha256: "62f30dfb92a6f8873e6a42649760e2d1b54e61e1d3bc023d0bb171600b41c759" +patches: + "3.2": + - patch_file: "patches/001-bugfixes-backport.patch" + patch_description: "apply unreleased minor fixes" + patch_type: "backport" + patch_source: "https://github.com/edrosten/TooN/compare/TOON_3.2...370dcd9" diff --git a/recipes/toon/all/conanfile.py b/recipes/toon/all/conanfile.py new file mode 100644 index 0000000000000..6756336186e83 --- /dev/null +++ b/recipes/toon/all/conanfile.py @@ -0,0 +1,99 @@ +import os + +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, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + + +class ToonConan(ConanFile): + name = "toon" + description = "TooN - Tom's Object Oriented Numerics library" + license = "BSD-2-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://codedocs.xyz/edrosten/TooN/" + topics = ("numerical", "linear-algebra", "matrix", "vector", "optimization", "automatic-differentiation", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + exports_sources = ["config.hh"] + + options = { + "with_lapack": [True, False] + } + default_options = { + "with_lapack": True + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "msvc": "191", + "Visual Studio": "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_lapack: + self.requires("openblas/0.3.26", options={"build_lapack": 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) + 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.with_lapack and not self.dependencies["openblas"].options.build_lapack: + raise ConanInvalidConfiguration(f"{self.ref} requires LAPACK support in OpenBLAS with -o='openblas/*:build_lapack=True'") + + 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, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*", + os.path.join(self.source_folder, "TooN"), + os.path.join(self.package_folder, "include", "TooN")) + copy(self, "config.hh", self.export_sources_folder, + os.path.join(self.package_folder, "include", "TooN", "internal")) + + if not self.options.with_lapack: + replace_in_file( + self, + os.path.join(self.package_folder, "include", "TooN", "internal", "config.hh"), + "define TOON_USE_LAPACK", + "undef TOON_USE_LAPACK" + ) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "TooN") + + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/toon/all/config.hh b/recipes/toon/all/config.hh new file mode 100644 index 0000000000000..ed689361e6c58 --- /dev/null +++ b/recipes/toon/all/config.hh @@ -0,0 +1,29 @@ +/* TooN/internal/config.hh. Generated from config.hh.in by configure. */ +/* TooN/internal/config.hh.in. Generated from configure.ac by autoheader. */ + +/* define if the compiler supports basic C++14 syntax */ +#undef HAVE_CXX14 + +/* Define to 1 if you have the `lapack' library (-llapack). */ +#define HAVE_LIBLAPACK 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://github.com/edrosten/TooN" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "TooN" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "TooN version-3.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "toon" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "https://codedocs.xyz/edrosten/TooN/" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "version-3.2" + +/* Use LAPACK */ +#define TOON_USE_LAPACK diff --git a/recipes/toon/all/patches/001-bugfixes-backport.patch b/recipes/toon/all/patches/001-bugfixes-backport.patch new file mode 100644 index 0000000000000..634a27c8578c0 --- /dev/null +++ b/recipes/toon/all/patches/001-bugfixes-backport.patch @@ -0,0 +1,127 @@ +diff --git a/TooN/QR.h b/TooN/QR.h +index e2273cc..10b33c3 100644 +--- a/TooN/QR.h ++++ b/TooN/QR.h +@@ -29,6 +29,7 @@ + #ifndef TOON_INC_QR_H + #define TOON_INC_QR_H + #include ++#include + #include + + namespace TooN +diff --git a/TooN/QR_Lapack.h b/TooN/QR_Lapack.h +index 6b628d1..67f1fd0 100644 +--- a/TooN/QR_Lapack.h ++++ b/TooN/QR_Lapack.h +@@ -29,6 +29,7 @@ + + #include + #include ++#include + #include + + namespace TooN{ +diff --git a/TooN/SVD.h b/TooN/SVD.h +index a74deed..e22a437 100644 +--- a/TooN/SVD.h ++++ b/TooN/SVD.h +@@ -30,6 +30,7 @@ + + #include + #include ++#include + + namespace TooN { + +diff --git a/TooN/SymEigen.h b/TooN/SymEigen.h +index aa5b434..8c6d42f 100644 +--- a/TooN/SymEigen.h ++++ b/TooN/SymEigen.h +@@ -28,6 +28,7 @@ + #ifndef __SYMEIGEN_H + #define __SYMEIGEN_H + ++#include + #include + #include + #include +diff --git a/TooN/functions/derivatives.h b/TooN/functions/derivatives.h +index 791f71e..9749461 100644 +--- a/TooN/functions/derivatives.h ++++ b/TooN/functions/derivatives.h +@@ -27,6 +27,7 @@ + #define TOON_INCLUDE_DERIVATIVES_NUMERICAL_H + + #include ++#include + #include + #include + +diff --git a/TooN/helpers.h b/TooN/helpers.h +index 8204560..447bca3 100644 +--- a/TooN/helpers.h ++++ b/TooN/helpers.h +@@ -32,6 +32,7 @@ + + #include + #include ++#include + #include + #include + #include +diff --git a/TooN/optimization/brent.h b/TooN/optimization/brent.h +index e117a80..3e60251 100644 +--- a/TooN/optimization/brent.h ++++ b/TooN/optimization/brent.h +@@ -27,6 +27,7 @@ + #define TOON_BRENT_H + #include + #include ++#include + #include + #include + #include +diff --git a/doc/documentation.h b/doc/documentation.h +index 2df5d9e..95276b1 100644 +--- a/doc/documentation.h ++++ b/doc/documentation.h +@@ -1,15 +1,7 @@ + /* + Copyright (c) 2005 Paul Smith, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Edward Rosten + +- Permission is granted to copy, distribute and/or modify this document under +- the terms of the GNU Free Documentation License, Version 1.2 or any later +- version published by the Free Software Foundation; with no Invariant +- Sections, no Front-Cover Texts, and no Back-Cover Texts. +- +- You should have received a copy of the GNU Free Documentation License +- License along with this library; if not, write to the Free Software +- Foundation, Inc. +- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ This library is free software, see COPYING file for details + + */ + /////////////////////////////////////////////////////// +diff --git a/doc/linoperatorsdoc.h b/doc/linoperatorsdoc.h +index b7aa503..f2ec6b1 100644 +--- a/doc/linoperatorsdoc.h ++++ b/doc/linoperatorsdoc.h +@@ -1,16 +1,7 @@ + /* + Copyright (c) 2005 Paul Smith + +- Permission is granted to copy, distribute and/or modify this document under +- the terms of the GNU Free Documentation License, Version 1.2 or any later +- version published by the Free Software Foundation; with no Invariant +- Sections, no Front-Cover Texts, and no Back-Cover Texts. +- +- You should have received a copy of the GNU Free Documentation License +- License along with this library; if not, write to the Free Software +- Foundation, Inc. +- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +- ++ This library is free software, see COPYING file for details + */ + // A proxy version of the Matrix class, + // cleaned up to present a comprehensible diff --git a/recipes/toon/all/test_package/CMakeLists.txt b/recipes/toon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..28a1d29b7ba57 --- /dev/null +++ b/recipes/toon/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(TooN REQUIRED IMPORTED_TARGET TooN) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::TooN) +if (WITH_LAPACK) + target_compile_definitions(${PROJECT_NAME} PRIVATE "WITH_LAPACK") +endif () +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/toon/all/test_package/conanfile.py b/recipes/toon/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cfe5e425874fc --- /dev/null +++ b/recipes/toon/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +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 = "PkgConfigDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.1.0") + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_LAPACK"] = self.dependencies[self.tested_reference_str].options.with_lapack + 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") + self.run(bin_path, env="conanrun") diff --git a/recipes/toon/all/test_package/test_package.cpp b/recipes/toon/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..da2c3199f9737 --- /dev/null +++ b/recipes/toon/all/test_package/test_package.cpp @@ -0,0 +1,38 @@ +#include +#include + +#ifdef USE_LAPACK +#include +#endif + +#include +#include + +using namespace TooN; + +void test_determinant() { + Matrix<3> t = Data( + 1, 0.5, 0.5, + 0.5, 2, 0.7, + 0.5, 0.7, 3); + std::cout << "determinant: " << determinant(t) << std::endl; +} + +#ifdef USE_LAPACK +void test_lapack() { + Matrix<3> t = Data( + 1, 0.5, 0.5, + 0.5, 2, 0.7, + 0.5, 0.7, 3); + Lapack_Cholesky<3> chol(t); + std::cout << "Lapack_Cholesky determinat: " << chol.determinant() << std::endl; +} +#endif + +int main() { + test_determinant(); + +#ifdef USE_LAPACK + test_lapack(); +#endif +} diff --git a/recipes/toon/config.yml b/recipes/toon/config.yml new file mode 100644 index 0000000000000..9b5abcde381a5 --- /dev/null +++ b/recipes/toon/config.yml @@ -0,0 +1,3 @@ +versions: + "3.2": + folder: all diff --git a/recipes/tqdm-cpp/all/conandata.yml b/recipes/tqdm-cpp/all/conandata.yml new file mode 100644 index 0000000000000..b887e54b61bb3 --- /dev/null +++ b/recipes/tqdm-cpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "cci.20200603": + url: "https://codeload.github.com/mraggi/tqdm-cpp/zip/7e57e58550ac14e580ac9eeb948956e541402083" + sha256: "a6f129d330b1e6f73a221758800fec669157587faa43b050f36458a414448dfe" diff --git a/recipes/tqdm-cpp/all/conanfile.py b/recipes/tqdm-cpp/all/conanfile.py new file mode 100644 index 0000000000000..70497c1b12381 --- /dev/null +++ b/recipes/tqdm-cpp/all/conanfile.py @@ -0,0 +1,66 @@ +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 TqdmCppConan(ConanFile): + name = "tqdm-cpp" + description = "Easily display progress in C++17. Inspired by python's awesome tqdm library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mraggi/tqdm-cpp" + topics = ("progress", "progressbar", "command-line", "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": "7", + "clang": "6", + "apple-clang": "11", + "msvc": "191", + "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"): + 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, "tqdm.hpp",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/tqdm-cpp/all/test_package/CMakeLists.txt b/recipes/tqdm-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..75f886c04d1ce --- /dev/null +++ b/recipes/tqdm-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(tqdm-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tqdm-cpp::tqdm-cpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/tqdm-cpp/all/test_package/conanfile.py b/recipes/tqdm-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/tqdm-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/tqdm-cpp/all/test_package/test_package.cpp b/recipes/tqdm-cpp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..a32056d993faa --- /dev/null +++ b/recipes/tqdm-cpp/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include + +#include +#include +#include + +int main() +{ + using namespace std::chrono_literals; + auto delay = 5ms; + std::vector A(50, 0); + for (int a : tq::tqdm(A)) { + std::this_thread::sleep_for(delay); + } + return 0; +} diff --git a/recipes/tqdm-cpp/config.yml b/recipes/tqdm-cpp/config.yml new file mode 100644 index 0000000000000..7208e0ea0a4e0 --- /dev/null +++ b/recipes/tqdm-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "cci.20200603": + folder: all diff --git a/recipes/tracy/all/conandata.yml b/recipes/tracy/all/conandata.yml index de70002df8416..b98d6d618bb5d 100644 --- a/recipes/tracy/all/conandata.yml +++ b/recipes/tracy/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.11.1": + url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.11.1.tar.gz" + sha256: "2c11ca816f2b756be2730f86b0092920419f3dabc7a7173829ffd897d91888a1" + "0.11.0": + url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.11.0.tar.gz" + sha256: "b591ef2820c5575ccbf17e2e7a1dc1f6b9a2708f65bfd00f4ebefad2a1ccf830" "0.10": url: "https://github.com/wolfpld/tracy/archive/refs/tags/v0.10.tar.gz" sha256: "a76017d928f3f2727540fb950edd3b736caa97b12dbb4e5edce66542cbea6600" diff --git a/recipes/tracy/all/conanfile.py b/recipes/tracy/all/conanfile.py index a056814ff0165..a83ee515f3fc9 100644 --- a/recipes/tracy/all/conanfile.py +++ b/recipes/tracy/all/conanfile.py @@ -1,8 +1,10 @@ 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 +from conan.tools.gnu import PkgConfigDeps +from conan.tools.files import copy, get, rmdir, replace_in_file from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os required_conan_version = ">=1.53.0" @@ -11,10 +13,11 @@ class TracyConan(ConanFile): name = "tracy" description = "C++ frame profiler" - topics = ("profiler", "performance", "gamedev") - homepage = "https://github.com/wolfpld/tracy" - 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/wolfpld/tracy" + topics = ("profiler", "performance", "gamedev") + package_type = "library" settings = "os", "arch", "compiler", "build_type" # Existing CMake tracy options with default value @@ -40,6 +43,10 @@ class TracyConan(ConanFile): "fibers": ([True, False], False), "no_crash_handler": ([True, False], False), "timer_fallback": ([True, False], False), + "libunwind_backtrace": ([True, False], False), + "symbol_offline_resolve": ([True, False], False), + "libbacktrace_elf_dynload_support": ([True, False], False), + "verbose": ([True, False], False), } options = { "shared": [True, False], @@ -67,6 +74,19 @@ def config_options(self): del self._tracy_options["no_crash_handler"] del self._tracy_options["timer_fallback"] + if Version(self.version) < "0.11.0": + self.options.rm_safe("libunwind_backtrace") + self.options.rm_safe("symbol_offline_resolve") + self.options.rm_safe("libbacktrace_elf_dynload_support") + + del self._tracy_options["libunwind_backtrace"] + del self._tracy_options["symbol_offline_resolve"] + del self._tracy_options["libbacktrace_elf_dynload_support"] + + if Version(self.version) < "0.11.1": + self.options.rm_safe("verbose") + del self._tracy_options["verbose"] + def configure(self): if self.options.shared: self.options.rm_safe("fPIC") @@ -74,13 +94,20 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + if self.options.get_safe("libunwind_backtrace"): + self.requires("libunwind/1.8.1", transitive_headers=True, transitive_libs=True) + def validate(self): if self.info.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) + # libunwind_backtrace is not supported in 0.11.0. https://github.com/wolfpld/tracy/pull/841 + if Version(self.version) == "0.11.0" and self.options.get_safe("libunwind_backtrace"): + raise ConanInvalidConfiguration(f"libunwind_backtrace is not supported in {self.ref}") + def source(self): - get(self, **self.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) @@ -91,6 +118,9 @@ def generate(self): opt = f"TRACY_{opt.upper()}" tc.variables[opt] = switch tc.generate() + if self.options.get_safe("libunwind_backtrace"): + deps = PkgConfigDeps(self) + deps.generate() def build(self): cmake = CMake(self) @@ -113,10 +143,19 @@ def package_info(self): self.cpp_info.components["tracyclient"].defines.append( "TRACY_IMPORTS") if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["tracyclient"].system_libs.append( - "pthread") + self.cpp_info.components["tracyclient"].system_libs.extend([ + "pthread", + "m" + ]) if self.settings.os == "Linux": self.cpp_info.components["tracyclient"].system_libs.append("dl") + if self.settings.os == "Windows": + self.cpp_info.components["tracyclient"].system_libs.extend([ + "dbghelp", + "ws2_32" + ]) + if self.options.get_safe("libunwind_backtrace"): + self.cpp_info.components["tracyclient"].requires.append("libunwind::libunwind") # Tracy CMake adds options set to ON as public for opt in self._tracy_options.keys(): diff --git a/recipes/tracy/all/test_package/CMakeLists.txt b/recipes/tracy/all/test_package/CMakeLists.txt index a21a716d47b2b..5c34f757ac7ab 100644 --- a/recipes/tracy/all/test_package/CMakeLists.txt +++ b/recipes/tracy/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(Tracy REQUIRED CONFIG) diff --git a/recipes/tracy/all/test_v1_package/CMakeLists.txt b/recipes/tracy/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tracy/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tracy/all/test_v1_package/conanfile.py b/recipes/tracy/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tracy/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_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/tracy/config.yml b/recipes/tracy/config.yml index 7f42fe99a398a..01f7199be9c6a 100644 --- a/recipes/tracy/config.yml +++ b/recipes/tracy/config.yml @@ -1,4 +1,8 @@ versions: + "0.11.1": + folder: all + "0.11.0": + folder: all "0.10": folder: all "0.9.1": diff --git a/recipes/transwarp/all/test_package/CMakeLists.txt b/recipes/transwarp/all/test_package/CMakeLists.txt index eb80581dc80e9..6e73511fd6ca0 100644 --- a/recipes/transwarp/all/test_package/CMakeLists.txt +++ b/recipes/transwarp/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(transwarp REQUIRED CONFIG) diff --git a/recipes/transwarp/all/test_v1_package/CMakeLists.txt b/recipes/transwarp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index f5ef1888af073..0000000000000 --- a/recipes/transwarp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(transwarp REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE transwarp::transwarp) -target_compile_definitions(${PROJECT_NAME} PRIVATE TRANSWARP_CPP11) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/transwarp/all/test_v1_package/conanfile.py b/recipes/transwarp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/transwarp/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_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/trantor/all/conandata.yml b/recipes/trantor/all/conandata.yml index 5d96de887257b..8d5dd0ad82696 100644 --- a/recipes/trantor/all/conandata.yml +++ b/recipes/trantor/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "1.5.22": + url: "https://github.com/an-tao/trantor/archive/v1.5.22.tar.gz" + sha256: "2f870b016a592228d617ef51eec4e9a9ab7dc56c066923af9bf6dd42fefb63de" + "1.5.21": + url: "https://github.com/an-tao/trantor/archive/v1.5.21.tar.gz" + sha256: "c267e8d3657a85751554a6877efd1199f6766a9fd6418d2c72839ad0a8943988" + "1.5.20": + url: "https://github.com/an-tao/trantor/archive/v1.5.20.tar.gz" + sha256: "4d3b98c228aafde1001cff581cf8d1a4a9f71f7b2a85a28978b560aefc21c038" + "1.5.19": + url: "https://github.com/an-tao/trantor/archive/v1.5.19.tar.gz" + sha256: "a2f55a98fd4b0737ba0e2cd77d2f237253e607b2047071be04a9ea76587bb608" + "1.5.16": + url: "https://github.com/an-tao/trantor/archive/v1.5.16.tar.gz" + sha256: "ef6f4d9c855ea7823dd9bfb094e852d23450b5fc149936f09964d19cb34741e9" "1.5.15": url: "https://github.com/an-tao/trantor/archive/v1.5.15.tar.gz" sha256: "478d33bc2d48ef2511969c1024eeeee5cf0ef4eea6c65761d0a72b8b9b3004be" @@ -8,55 +23,36 @@ sources: "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" - "1.5.10": - url: "https://github.com/an-tao/trantor/archive/v1.5.10.tar.gz" - sha256: "2d47775b3091a1a103bea46f5da017dc03c39883f8d717cf6ba24bdcdf01a15d" - "1.5.8": - url: "https://github.com/an-tao/trantor/archive/v1.5.8.tar.gz" - sha256: "705ec0176681be5c99fcc7af37416ece9d65ff4d907bca764cb11471b104fbf8" - "1.5.7": - url: "https://github.com/an-tao/trantor/archive/v1.5.7.tar.gz" - sha256: "42576563afbf1e58c7d68f758cf3fca4d193496d4e3f82c80069d8389a7839d5" patches: - "1.5.15": - - patch_file: "patches/1.5.15-0001-disable-werror.patch" + "1.5.22": + - patch_file: "patches/1.5.19-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" + "1.5.21": + - patch_file: "patches/1.5.19-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" + "1.5.20": + - patch_file: "patches/1.5.19-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" + "1.5.19": + - patch_file: "patches/1.5.19-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" + "1.5.16": + - patch_file: "patches/1.5.15-0001-disable-werror.patch" + patch_description: "disable -Werror for gcc5" patch_type: "portability" - patch_source: "https://github.com/an-tao/trantor/commit/e8e3887435dcfb310263c588743be1b3746193be" - "1.5.10": - - patch_file: "patches/1.5.6-0001-include-cstdint.patch" - patch_description: "include cstdint for uint8_t, intmax_t" + "1.5.15": + - patch_file: "patches/1.5.15-0001-disable-werror.patch" + patch_description: "disable -Werror for gcc5" patch_type: "portability" - patch_source: "https://github.com/an-tao/trantor/commit/e8e3887435dcfb310263c588743be1b3746193be" - "1.5.8": - - patch_file: "patches/1.5.6-0001-include-cstdint.patch" - patch_description: "include cstdint for uint8_t, intmax_t" + "1.5.14": + - patch_file: "patches/1.5.12-0001-disable-werror.patch" + patch_description: "disable -Werror for gcc5" patch_type: "portability" - patch_source: "https://github.com/an-tao/trantor/commit/e8e3887435dcfb310263c588743be1b3746193be" - "1.5.7": - - patch_file: "patches/1.5.6-0001-include-cstdint.patch" - patch_description: "include cstdint for uint8_t, intmax_t" + "1.5.13": + - patch_file: "patches/1.5.12-0001-disable-werror.patch" + patch_description: "disable -Werror for gcc5" 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 9deee06df4b9b..0f9e11378b1a8 100644 --- a/recipes/trantor/all/conanfile.py +++ b/recipes/trantor/all/conanfile.py @@ -66,9 +66,9 @@ def layout(self): def requirements(self): self.requires("openssl/[>=1.1 <4]") if self.options.with_c_ares: - self.requires("c-ares/1.22.0") + self.requires("c-ares/1.25.0") if self.options.get_safe("with_spdlog"): - self.requires("spdlog/1.12.0") + self.requires("spdlog/1.13.0") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): @@ -93,8 +93,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) # TODO: support other tls providers - if Version(self.version) >= "1.5.12": - tc.variables["TRANTOR_USE_TLS"] = "openssl" + 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() diff --git a/recipes/trantor/all/patches/1.5.19-0001-disable-werror.patch b/recipes/trantor/all/patches/1.5.19-0001-disable-werror.patch new file mode 100644 index 0000000000000..c627d69cd2495 --- /dev/null +++ b/recipes/trantor/all/patches/1.5.19-0001-disable-werror.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a0b10de..b2331dc 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -76,7 +76,7 @@ if(NOT + "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.6-0001-include-cstdint.patch b/recipes/trantor/all/patches/1.5.6-0001-include-cstdint.patch deleted file mode 100644 index f910402545ffa..0000000000000 --- a/recipes/trantor/all/patches/1.5.6-0001-include-cstdint.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/trantor/utils/MsgBuffer.h b/trantor/utils/MsgBuffer.h -index 29817f6..f1d677e 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/trantor/utils/Utilities.cc b/trantor/utils/Utilities.cc -index 978dac8..0611e20 100644 ---- a/trantor/utils/Utilities.cc -+++ b/trantor/utils/Utilities.cc -@@ -25,6 +25,7 @@ - #include - #endif // __cplusplus - #endif // _WIN32 -+#include - - namespace trantor - { diff --git a/recipes/trantor/all/test_package/CMakeLists.txt b/recipes/trantor/all/test_package/CMakeLists.txt index 96e466512e5b2..254df20fc49b6 100644 --- a/recipes/trantor/all/test_package/CMakeLists.txt +++ b/recipes/trantor/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(Trantor CONFIG REQUIRED) diff --git a/recipes/trantor/all/test_v1_package/CMakeLists.txt b/recipes/trantor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index bc541ea90b512..0000000000000 --- a/recipes/trantor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/trantor/all/test_v1_package/conanfile.py b/recipes/trantor/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/trantor/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/trantor/config.yml b/recipes/trantor/config.yml index dddf9970713ce..1869cd2282d5e 100644 --- a/recipes/trantor/config.yml +++ b/recipes/trantor/config.yml @@ -1,17 +1,17 @@ versions: - "1.5.15": + "1.5.22": folder: "all" - "1.5.14": + "1.5.21": folder: "all" - "1.5.13": + "1.5.20": folder: "all" - "1.5.12": + "1.5.19": folder: "all" - "1.5.11": + "1.5.16": folder: "all" - "1.5.10": + "1.5.15": folder: "all" - "1.5.8": + "1.5.14": folder: "all" - "1.5.7": + "1.5.13": folder: "all" diff --git a/recipes/tree-gen/all/conandata.yml b/recipes/tree-gen/all/conandata.yml new file mode 100644 index 0000000000000..ff188eda8fa4f --- /dev/null +++ b/recipes/tree-gen/all/conandata.yml @@ -0,0 +1,13 @@ +sources: + "1.0.9": + url: "https://github.com/QuTech-Delft/tree-gen/archive/refs/tags/1.0.9.tar.gz" + sha256: "4ae8bd44f281ec76f25ac6f8228586467f7c7b2b9f67c4dc38ca524fb4e94d3a" + "1.0.8": + url: "https://github.com/QuTech-Delft/tree-gen/archive/refs/tags/1.0.8.tar.gz" + sha256: "a840f1da2fa377d2d791885d83b95dc15f081b308208d3497c395721488a4130" + "1.0.7": + url: "https://github.com/QuTech-Delft/tree-gen/archive/refs/tags/1.0.7.tar.gz" + sha256: "bd27c88d789efe1d187846d3b819fbaa1ba3a520d6d4181d1216c4a2e73e4e85" + "1.0.6": + url: "https://github.com/QuTech-Delft/tree-gen/archive/refs/tags/1.0.6.tar.gz" + sha256: "a7f6617830b3817b21cddc0f4442a04c10fbb89a19cabb1bbd0e8facb040cba8" diff --git a/recipes/tree-gen/all/conanfile.py b/recipes/tree-gen/all/conanfile.py new file mode 100644 index 0000000000000..7c2572f700bf5 --- /dev/null +++ b/recipes/tree-gen/all/conanfile.py @@ -0,0 +1,111 @@ +import os + +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.env import VirtualBuildEnv +from conan.tools.files import copy, get +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + +class TreeGenConan(ConanFile): + name = "tree-gen" + license = "Apache-2.0" + homepage = "https://github.com/QuTech-Delft/tree-gen" + url = "https://github.com/conan-io/conan-center-index" + description = "C++ and Python code generator for tree-like structures common in parser and compiler codebases." + topics = ("code generation", "tree", "parser", "compiler") + settings = "os", "compiler", "build_type", "arch" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True + } + + @property + def _should_build_test(self): + return not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "14", + "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 build_requirements(self): + if self._should_build_test: + self.test_requires("gtest/1.15.0") + self.tool_requires("m4/1.4.19") + if self.settings.os == "Windows": + self.tool_requires("winflexbison/2.5.24") + else: + self.tool_requires("flex/2.6.4") + self.tool_requires("bison/3.8.2") + + 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 Version(self.version) < "1.0.8": + self.requires("fmt/10.2.1", transitive_headers=True) + else: + self.requires("fmt/11.0.2", transitive_headers=True) + self.requires("range-v3/0.12.0", transitive_headers=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.variables["TREE_GEN_BUILD_TESTS"] = self._should_build_test + tc.generate() + env = VirtualBuildEnv(self) + env.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")) + copy(self, "generate_tree.cmake", src=os.path.join(self.source_folder, "cmake"), dst=os.path.join(self.package_folder, "lib", "cmake")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["tree-gen"] + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "cmake", "generate_tree.cmake")]) diff --git a/recipes/tree-gen/all/test_package/CMakeLists.txt b/recipes/tree-gen/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..829eec726262d --- /dev/null +++ b/recipes/tree-gen/all/test_package/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.15) + +project(PackageTest CXX) + +find_package(tree-gen REQUIRED CONFIG) + +find_program(TREE_GEN_EXECUTABLE tree-gen REQUIRED) + +# Generate the directory classes. +generate_tree_py( + "${TREE_GEN_EXECUTABLE}" + "${CMAKE_CURRENT_SOURCE_DIR}/res/directory.tree" + "${CMAKE_CURRENT_BINARY_DIR}/directory.hpp" + "${CMAKE_CURRENT_BINARY_DIR}/directory.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/directory.py" +) + +add_executable(test_package + "${CMAKE_CURRENT_SOURCE_DIR}/src/test_package.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/directory.cpp" +) + +target_include_directories(test_package + PRIVATE "${CMAKE_CURRENT_BINARY_DIR}" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src" +) +target_compile_features(test_package PRIVATE cxx_std_17) +target_link_libraries(test_package PRIVATE tree-gen::tree-gen) diff --git a/recipes/tree-gen/all/test_package/conanfile.py b/recipes/tree-gen/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d9214e3d91722 --- /dev/null +++ b/recipes/tree-gen/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +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", "VirtualRunEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + 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): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tree-gen/all/test_package/res/directory.tree b/recipes/tree-gen/all/test_package/res/directory.tree new file mode 100644 index 0000000000000..ef78a5d0d0d14 --- /dev/null +++ b/recipes/tree-gen/all/test_package/res/directory.tree @@ -0,0 +1,74 @@ +// Attach \file docstrings to the generated files for Doxygen. +# Implementation for classes representing a Windows directory tree. +source + +# Header for classes representing a Windows directory tree. +header + +// Include tree base classes. +include "tree-base.hpp" +tree_namespace tree::base + +// Include primitive types. +include "primitives.hpp" +import primitives + +// Initialization function to use to construct default values for the tree base +// classes and primitives. +initialize_function primitives::initialize +serdes_functions primitives::serialize primitives::deserialize + +// Set the namespace for the generated classes and attach a docstring. +# Namespace for classes representing a Windows directory tree. +namespace directory + +# Root node, containing the drives and associated directory trees. +system { + + # The drives available on the system. There must be at least one. + drives: Many; + +} + +# Represents a drive. +drive { + + # The drive letter used to identify it. + letter: primitives::Letter; + + # Root directory. + root_dir: One; + +} + +# Represents a directory entry. +entry { + + # Name of the directory entry. + name: primitives::String; + + # Represents a regular file. + file { + + # The file contents. + contents: primitives::String; + + } + + # Represents a (sub)directory. + directory { + + # The directory contents. Note that directories can be empty. + entries: Any; + + } + + # Represents a link to another directory. + mount { + + # The directory linked to. + target: Link; + + } + +} diff --git a/recipes/tree-gen/all/test_package/src/primitives.hpp b/recipes/tree-gen/all/test_package/src/primitives.hpp new file mode 100644 index 0000000000000..e4b04b69ada62 --- /dev/null +++ b/recipes/tree-gen/all/test_package/src/primitives.hpp @@ -0,0 +1,90 @@ +/** \file + * Defines primitives used in the generated directory tree structure. + */ + +#pragma once + +#include + +/** + * Namespace with primitives used in the generated directory tree structure. + */ +namespace primitives { + +/** + * Letter primitive, used to represent drive letters. + */ +using Letter = char; + +/** + * Strings, used to represent filenames and file contents. + */ +using String = std::string; + +/** + * Initialization function. This must be specialized for any types used as + * primitives in a tree that are actual C primitives (int, char, bool, etc), + * as these are not initialized by the T() construct. + */ +template +T initialize() { return T(); }; + +/** + * Declare the default initializer for drive letters. It's declared inline + * to avoid having to make a cpp file just for this. + */ +template <> +inline Letter initialize() { + return 'A'; +} + +/** + * Serialization function. This must be specialized for any types used as + * primitives in a tree. The default implementation doesn't do anything. + */ +template +void serialize(const T &obj, tree::cbor::MapWriter &map) { +} + +/** + * Serialization function for Letter. + */ +template <> +inline void serialize(const Letter &obj, tree::cbor::MapWriter &map) { + map.append_int("val", obj); +} + +/** + * Serialization function for String. + */ +template <> +inline void serialize(const String &obj, tree::cbor::MapWriter &map) { + map.append_string("val", obj); +} + +/** + * Deserialization function. This must be specialized for any types used as + * primitives in a tree. The default implementation doesn't do anything. + */ +template +T deserialize(const tree::cbor::MapReader &map) { + return initialize(); +} + +/** + * Deserialization function for Letter. + */ +template <> +inline Letter deserialize(const tree::cbor::MapReader &map) { + return map.at("val").as_int(); +} + +/** + * Deserialization function for String. + */ +template <> +inline String deserialize(const tree::cbor::MapReader &map) { + return map.at("val").as_string(); +} + +} // namespace primitives diff --git a/recipes/tree-gen/all/test_package/src/test_package.cpp b/recipes/tree-gen/all/test_package/src/test_package.cpp new file mode 100644 index 0000000000000..34ed4f5d4eea7 --- /dev/null +++ b/recipes/tree-gen/all/test_package/src/test_package.cpp @@ -0,0 +1,18 @@ +#include "directory.hpp" // the generated file +#include "utils.hpp" +#include "version.hpp" // tree-gen version + +#include + + +void print_tree_gen_version() { + std::cout << "tree-gen version: " << get_version() << "\n"; + std::cout << "tree-gen release year: " << get_release_year() << "\n"; +} + +int main() { + print_tree_gen_version(); + + auto system = tree::base::make(); + ASSERT(!system.is_well_formed()); +} diff --git a/recipes/tree-gen/all/test_package/src/utils.hpp b/recipes/tree-gen/all/test_package/src/utils.hpp new file mode 100644 index 0000000000000..09550ab4f6d8e --- /dev/null +++ b/recipes/tree-gen/all/test_package/src/utils.hpp @@ -0,0 +1,20 @@ +#pragma once + +#define ASSERT(x) \ + do { \ + if (!(x)) { \ + throw std::runtime_error("assertion failed: " #x " is false at " __FILE__ ":" + std::to_string(__LINE__)); \ + } \ + } while (0) + +#define ASSERT_RAISES(exc, x) \ + do { \ + try { \ + x; \ + throw std::runtime_error("assertion failed: no exception at " __FILE__ ":" + std::to_string(__LINE__)); \ + } catch (exc &e) { \ + std::cout << #exc << " exception message: " << e.what() << std::endl; \ + } \ + } while (0) + +#define MARKER std::cout << "###MARKER###" << std::endl; diff --git a/recipes/tree-gen/config.yml b/recipes/tree-gen/config.yml new file mode 100644 index 0000000000000..afebf2e48e20c --- /dev/null +++ b/recipes/tree-gen/config.yml @@ -0,0 +1,9 @@ +versions: + "1.0.9": + folder: all + "1.0.8": + folder: all + "1.0.7": + folder: all + "1.0.6": + folder: all diff --git a/recipes/tree-sitter-c/all/CMakeLists.txt b/recipes/tree-sitter-c/all/CMakeLists.txt index a028ec4e4627c..81044dd879b07 100644 --- a/recipes/tree-sitter-c/all/CMakeLists.txt +++ b/recipes/tree-sitter-c/all/CMakeLists.txt @@ -1,12 +1,11 @@ -cmake_minimum_required(VERSION 3.0) -project(tree-sitter-c C) +cmake_minimum_required(VERSION 3.15) +project(tree-sitter-c LANGUAGES C) find_package(tree-sitter REQUIRED CONFIG) include(GenerateExportHeader) file(WRITE api.h [[ #pragma once -#include #include "tree_sitter_c_export.h" #ifdef __cplusplus diff --git a/recipes/tree-sitter-c/all/conandata.yml b/recipes/tree-sitter-c/all/conandata.yml index f225285a8fae5..95bb76f1a288f 100644 --- a/recipes/tree-sitter-c/all/conandata.yml +++ b/recipes/tree-sitter-c/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "0.23.2": + url: "https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v0.23.2.tar.gz" + sha256: "d8b9c1b2ffb6a42caf9bc76e07c52507d4e60b17175ed9beb0e779be8db1200c" + "0.23.1": + url: "https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v0.23.1.tar.gz" + sha256: "8f90f481c28a45c7dcba84d05fc07853df043ff813868cdfa074a3835e89467a" + "0.20.7": + url: "https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v0.20.7.tar.gz" + sha256: "00abd71259093983fc7e2b51f3efc724ccab3e69af3a37d3cdd0a2a01d703061" "0.20.3": url: "https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v0.20.3.tar.gz" sha256: "8c72a765230324f2b64e9ed66e027daf1a2ed24dde5fbf21398ad8ff7fca2a2d" @@ -8,3 +17,9 @@ sources: "0.20.1": url: "https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v0.20.1.tar.gz" sha256: "ffcc2ef0eded59ad1acec9aec4f9b0c7dd209fc1a85d85f8b0e81298e3dddcc2" +patches: + "0.23.2": + - patch_file: "patches/0.23.2-0001-disable-gencode-fpic.patch" + patch_description: "disable gencode and fPIC" + patch_type: "portability" + diff --git a/recipes/tree-sitter-c/all/conanfile.py b/recipes/tree-sitter-c/all/conanfile.py index 9f73c2c805dce..a31cd6efa959a 100644 --- a/recipes/tree-sitter-c/all/conanfile.py +++ b/recipes/tree-sitter-c/all/conanfile.py @@ -1,6 +1,8 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, replace_in_file, copy +from conan.tools.files import get, replace_in_file, apply_conandata_patches, copy, export_conandata_patches, rmdir + +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -9,10 +11,10 @@ class TreeSitterCConan(ConanFile): name = "tree-sitter-c" description = "C grammar for tree-sitter." - topics = ("parser", "grammar", "tree", "c", "ide") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/tree-sitter/tree-sitter-c" - license = "MIT" + topics = ("parser", "grammar", "tree", "c", "ide") settings = "os", "arch", "compiler", "build_type" package_type = "library" @@ -25,18 +27,18 @@ class TreeSitterCConan(ConanFile): "fPIC": True, } - - exports_sources = "CMakeLists.txt" - 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")) + export_conandata_patches(self) + if Version(self.version) < "0.23.2": + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=os.path.join(self.export_sources_folder, "src")) def generate(self): tc = CMakeToolchain(self) - tc.variables["TREE_SITTER_C_SRC_DIR"] = self.source_folder.replace("\\", "/") + if Version(self.version) < "0.23.2": + tc.variables["TREE_SITTER_C_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.generate() deps = CMakeDeps(self) deps.generate() @@ -53,12 +55,13 @@ def configure(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def requirements(self): - self.requires("tree-sitter/0.20.8", transitive_headers=True, transitive_libs=True) + self.requires("tree-sitter/0.24.3", transitive_headers=True, transitive_libs=True) def _patch_sources(self): - if not self.options.shared: + if Version(self.version) < "0.23.2" and not self.options.shared: replace_in_file( self, os.path.join(self.source_folder, "src", "parser.c"), @@ -80,6 +83,7 @@ def package(self): ) cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = ["tree-sitter-c"] diff --git a/recipes/tree-sitter-c/all/patches/0.23.2-0001-disable-gencode-fpic.patch b/recipes/tree-sitter-c/all/patches/0.23.2-0001-disable-gencode-fpic.patch new file mode 100644 index 0000000000000..db0bbdd64f019 --- /dev/null +++ b/recipes/tree-sitter-c/all/patches/0.23.2-0001-disable-gencode-fpic.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 20754b4..7a2d575 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,7 +14,7 @@ if(NOT ${TREE_SITTER_ABI_VERSION} MATCHES "^[0-9]+$") + unset(TREE_SITTER_ABI_VERSION CACHE) + message(FATAL_ERROR "TREE_SITTER_ABI_VERSION must be an integer") + endif() +- ++if(0) + find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI") + + add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" +@@ -23,7 +23,7 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" + --abi=${TREE_SITTER_ABI_VERSION} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generating parser.c") +- ++endif() + add_library(tree-sitter-c src/parser.c) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c) + target_sources(tree-sitter-c PRIVATE src/scanner.c) +@@ -37,7 +37,7 @@ target_compile_definitions(tree-sitter-c PRIVATE + set_target_properties(tree-sitter-c + PROPERTIES + C_STANDARD 11 +- POSITION_INDEPENDENT_CODE ON ++ # POSITION_INDEPENDENT_CODE ON + SOVERSION "${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}" + DEFINE_SYMBOL "") + diff --git a/recipes/tree-sitter-c/all/test_package/CMakeLists.txt b/recipes/tree-sitter-c/all/test_package/CMakeLists.txt index 177a777e8ddf7..9c9e6ff5f4c7c 100644 --- a/recipes/tree-sitter-c/all/test_package/CMakeLists.txt +++ b/recipes/tree-sitter-c/all/test_package/CMakeLists.txt @@ -1,7 +1,10 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(tree-sitter-c REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} tree-sitter-c::tree-sitter-c) +target_link_libraries(${PROJECT_NAME} PRIVATE tree-sitter-c::tree-sitter-c) +if(tree-sitter-c_VERSION VERSION_LESS "0.23.2") + target_compile_definitions(${PROJECT_NAME} PRIVATE TREE_SITTER_C_API_H) +endif() diff --git a/recipes/tree-sitter-c/all/test_package/test_package.c b/recipes/tree-sitter-c/all/test_package/test_package.c index d5f86eae18cce..cffc87a0869d4 100644 --- a/recipes/tree-sitter-c/all/test_package/test_package.c +++ b/recipes/tree-sitter-c/all/test_package/test_package.c @@ -1,8 +1,14 @@ #include + +#ifdef TREE_SITTER_C_API_H #include +#else +#include +#endif #include #include +#include int main() { TSParser *parser = ts_parser_new(); diff --git a/recipes/tree-sitter-c/config.yml b/recipes/tree-sitter-c/config.yml index 7070a273f171a..54a7df0c98705 100644 --- a/recipes/tree-sitter-c/config.yml +++ b/recipes/tree-sitter-c/config.yml @@ -1,4 +1,10 @@ versions: + "0.23.2": + folder: all + "0.23.1": + folder: all + "0.20.7": + folder: all "0.20.3": folder: all "0.20.2": diff --git a/recipes/tree-sitter-cpp/all/conandata.yml b/recipes/tree-sitter-cpp/all/conandata.yml new file mode 100644 index 0000000000000..f8788219e7637 --- /dev/null +++ b/recipes/tree-sitter-cpp/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "0.23.4": + url: "https://github.com/tree-sitter/tree-sitter-cpp/archive/refs/tags/v0.23.4.tar.gz" + sha256: "7a2c55afe3028f4105f25762ea58cc16537d1f5a1dcd9cca90410b3cd5d46051" +patches: + "0.23.4": + - patch_file: "patches/0.23.4-0001-disable-gencode-fpic.patch" + patch_description: "disable gencode and fPIC" + patch_type: "portability" + diff --git a/recipes/tree-sitter-cpp/all/conanfile.py b/recipes/tree-sitter-cpp/all/conanfile.py new file mode 100644 index 0000000000000..308d0e01bb690 --- /dev/null +++ b/recipes/tree-sitter-cpp/all/conanfile.py @@ -0,0 +1,60 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, export_conandata_patches, apply_conandata_patches +import os + +required_conan_version = ">=2.4" + + +class TreeSitterCPPConan(ConanFile): + name = "tree-sitter-cpp" + description = "C++ grammar for tree-sitter" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tree-sitter.github.io/tree-sitter" + topics = ("tree-sitter", "parser", "cplusplus") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + languages = ["C"] + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("tree-sitter/0.24.3", transitive_headers=True, transitive_libs=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + 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", 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")) + + def package_info(self): + self.cpp_info.libs = ["tree-sitter-cpp"] diff --git a/recipes/tree-sitter-cpp/all/patches/0.23.4-0001-disable-gencode-fpic.patch b/recipes/tree-sitter-cpp/all/patches/0.23.4-0001-disable-gencode-fpic.patch new file mode 100644 index 0000000000000..2e9fa035acf51 --- /dev/null +++ b/recipes/tree-sitter-cpp/all/patches/0.23.4-0001-disable-gencode-fpic.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7b655fe..e83f97e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,7 +14,7 @@ if(NOT ${TREE_SITTER_ABI_VERSION} MATCHES "^[0-9]+$") + unset(TREE_SITTER_ABI_VERSION CACHE) + message(FATAL_ERROR "TREE_SITTER_ABI_VERSION must be an integer") + endif() +- ++if(0) + find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI") + + add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" +@@ -23,7 +23,7 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" + --abi=${TREE_SITTER_ABI_VERSION} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generating parser.c") +- ++endif() + add_library(tree-sitter-cpp src/parser.c) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c) + target_sources(tree-sitter-cpp PRIVATE src/scanner.c) +@@ -37,7 +37,7 @@ target_compile_definitions(tree-sitter-cpp PRIVATE + set_target_properties(tree-sitter-cpp + PROPERTIES + C_STANDARD 11 +- POSITION_INDEPENDENT_CODE ON ++ # POSITION_INDEPENDENT_CODE ON + SOVERSION "${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}" + DEFINE_SYMBOL "") + diff --git a/recipes/tree-sitter-cpp/all/test_package/CMakeLists.txt b/recipes/tree-sitter-cpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..aa2b732c7dc7c --- /dev/null +++ b/recipes/tree-sitter-cpp/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(tree-sitter-cpp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tree-sitter-cpp::tree-sitter-cpp) diff --git a/recipes/tree-sitter-cpp/all/test_package/conanfile.py b/recipes/tree-sitter-cpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2e77b4246fa81 --- /dev/null +++ b/recipes/tree-sitter-cpp/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" + + 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/tree-sitter-cpp/all/test_package/test_package.c b/recipes/tree-sitter-cpp/all/test_package/test_package.c new file mode 100644 index 0000000000000..e1332cbdaa232 --- /dev/null +++ b/recipes/tree-sitter-cpp/all/test_package/test_package.c @@ -0,0 +1,23 @@ +#include +#include + +#include +#include +#include + +int main() { + TSParser *parser = ts_parser_new(); + ts_parser_set_language(parser, tree_sitter_cpp()); + const char *source_code = "std::cout << \"Hello, world!\" << std::endl; "; + TSTree *tree = + ts_parser_parse_string(parser, NULL, source_code, strlen(source_code)); + TSNode root_node = ts_tree_root_node(tree); + + char *string = ts_node_string(root_node); + printf("Syntax tree: %s\n", string); + free(string); + + ts_tree_delete(tree); + ts_parser_delete(parser); + return 0; +} diff --git a/recipes/tree-sitter-cpp/config.yml b/recipes/tree-sitter-cpp/config.yml new file mode 100644 index 0000000000000..244b94e5983b5 --- /dev/null +++ b/recipes/tree-sitter-cpp/config.yml @@ -0,0 +1,3 @@ +versions: + "0.23.4": + folder: all diff --git a/recipes/tree-sitter-cql/all/CMakeLists.txt b/recipes/tree-sitter-cql/all/CMakeLists.txt new file mode 100644 index 0000000000000..c382967b7491f --- /dev/null +++ b/recipes/tree-sitter-cql/all/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.15) +project(tree-sitter-cql LANGUAGES C) + +find_package(tree-sitter REQUIRED CONFIG) + +add_library(${PROJECT_NAME} + "${CMAKE_CURRENT_SOURCE_DIR}/src/src/parser.c" +) +target_link_libraries(${PROJECT_NAME} + PUBLIC + tree-sitter::tree-sitter +) +target_include_directories(${PROJECT_NAME} + PRIVATE + $ +) +set_target_properties(${PROJECT_NAME} + PROPERTIES + C_STANDARD 99 + PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/bindings/c/tree-sitter-cql.h" +) + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + 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/tree-sitter-cql/all/conandata.yml b/recipes/tree-sitter-cql/all/conandata.yml new file mode 100644 index 0000000000000..ceb9f8a016e2a --- /dev/null +++ b/recipes/tree-sitter-cql/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.2.0": + url: "https://github.com/shotover/tree-sitter-cql/archive/refs/tags/v0.2.0.tar.gz" + sha256: "fc5aa2c660b6e6daa48e14b4bb7aca0a5a69294229bfae4fdcd9761d288edf07" diff --git a/recipes/tree-sitter-cql/all/conanfile.py b/recipes/tree-sitter-cql/all/conanfile.py new file mode 100644 index 0000000000000..ba45993bad869 --- /dev/null +++ b/recipes/tree-sitter-cql/all/conanfile.py @@ -0,0 +1,72 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, copy +from conan.tools.microsoft import is_msvc +import os + +required_conan_version = ">=2.0.9" + + +class TreeSitterCQLConan(ConanFile): + name = "tree-sitter-cql" + description = "Tree-sitter parser for Cassandra CQL language" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/shotover/tree-sitter-cql" + topics = ("parser", "grammar", "tree", "CQL", "cassandra") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + implements = ["auto_shared_fpic"] + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + + def configure(self): + 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): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("tree-sitter/0.24.3", transitive_headers=True, transitive_libs=True) + + def generate(self): + tc = CMakeToolchain(self) + if is_msvc(self): + tc.variables.preprocessor_definitions["TREE_SITTER_HIDE_SYMBOLS"] = not self.options.shared + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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, + "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 = ["tree-sitter-cql"] + self.cpp_info.set_property("pkg_config_name", "tree-sitter-cql") diff --git a/recipes/tree-sitter-cql/all/test_package/CMakeLists.txt b/recipes/tree-sitter-cql/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..802cad95e018c --- /dev/null +++ b/recipes/tree-sitter-cql/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(tree-sitter-cql REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE tree-sitter-cql::tree-sitter-cql) diff --git a/recipes/tree-sitter-cql/all/test_package/conanfile.py b/recipes/tree-sitter-cql/all/test_package/conanfile.py new file mode 100644 index 0000000000000..cb81bc4873df8 --- /dev/null +++ b/recipes/tree-sitter-cql/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 = "CMakeToolchain", "CMakeDeps" + + 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/tree-sitter-cql/all/test_package/test_package.c b/recipes/tree-sitter-cql/all/test_package/test_package.c new file mode 100644 index 0000000000000..5972b3828b0bb --- /dev/null +++ b/recipes/tree-sitter-cql/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include +#include + +int main() { + TSParser *parser = ts_parser_new(); + ts_parser_set_language(parser, tree_sitter_cql()); + ts_parser_delete(parser); + return 0; +} + diff --git a/recipes/tree-sitter-cql/config.yml b/recipes/tree-sitter-cql/config.yml new file mode 100644 index 0000000000000..b370fcee5fe7c --- /dev/null +++ b/recipes/tree-sitter-cql/config.yml @@ -0,0 +1,3 @@ +versions: + "0.2.0": + folder: all diff --git a/recipes/tree-sitter-sql/all/CMakeLists.txt b/recipes/tree-sitter-sql/all/CMakeLists.txt new file mode 100644 index 0000000000000..2c51456eb9a4e --- /dev/null +++ b/recipes/tree-sitter-sql/all/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.15) +project(tree-sitter-sql LANGUAGES C) + +find_package(tree-sitter REQUIRED CONFIG) + +add_library(${PROJECT_NAME} + ${TREE_SITTER_SQL_SRC_DIR}/src/scanner.c + ${TREE_SITTER_SQL_SRC_DIR}/src/parser.c +) +target_link_libraries(${PROJECT_NAME} + PUBLIC + tree-sitter::tree-sitter +) +target_include_directories(${PROJECT_NAME} + PRIVATE + $ +) +set_target_properties(${PROJECT_NAME} + PROPERTIES + C_STANDARD 99 + PUBLIC_HEADER "${TREE_SITTER_SQL_SRC_DIR}/bindings/c/tree-sitter-sql.h" +) + +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} + 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/tree-sitter-sql/all/conandata.yml b/recipes/tree-sitter-sql/all/conandata.yml new file mode 100644 index 0000000000000..818e7a2ebebb0 --- /dev/null +++ b/recipes/tree-sitter-sql/all/conandata.yml @@ -0,0 +1,15 @@ +sources: + # As per the official README, the release tarballs don't include the generated codes. + # > We don't commit the generated parser files to the main branch. Instead, you can find them on the gh-pages branch. + # We have to obtain the corresponding snapshot of the github-pages branch. + "0.3.7": + url: "https://github.com/DerekStride/tree-sitter-sql/archive/f58f33955ea0a3e6a0aa2ef4b90a133ebee02173.tar.gz" + sha256: "947f6236251b4e2388441f3748871e4a93884229a05b66c59603b80721c2c1fe" + "0.3.5": + url: "https://github.com/DerekStride/tree-sitter-sql/archive/c67ecbd37d8d12f22e4cc7138afd14bc20253e10.tar.gz" + sha256: "d8cd967ca4daa376614995fe8a439a957a303c7ca5b9858ca15ad243e6b176d3" +patches: + "0.3.7": + - patch_file: "patches/0.3.7-0001-fix-cmake.patch" + patch_description: "disable generating code and fPIC" + patch_type: "conan" diff --git a/recipes/tree-sitter-sql/all/conanfile.py b/recipes/tree-sitter-sql/all/conanfile.py new file mode 100644 index 0000000000000..b5038be7e60cf --- /dev/null +++ b/recipes/tree-sitter-sql/all/conanfile.py @@ -0,0 +1,83 @@ +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.microsoft import is_msvc +from conan.tools.scm import Version +import os + + +required_conan_version = ">=1.53.0" + + +class TreeSitterSqlConan(ConanFile): + name = "tree-sitter-sql" + description = "SQL grammar for tree-sitter" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/DerekStride/tree-sitter-sql" + topics = ("tree-sitter", "sql", "parser") + 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): + if Version(self.version) < "0.3.7": + 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 is_msvc(self) and Version(self.version) < "0.3.7": + 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): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("tree-sitter/0.24.3", transitive_headers=True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "0.3.7": + tc.variables["TREE_SITTER_SQL_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def build(self): + cmake = CMake(self) + if Version(self.version) < "0.3.7": + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + else: + 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() + if Version(self.version) >= "0.3.7": + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["tree-sitter-sql"] + self.cpp_info.set_property("pkg_config_name", "tree-sitter-sql") diff --git a/recipes/tree-sitter-sql/all/patches/0.3.7-0001-fix-cmake.patch b/recipes/tree-sitter-sql/all/patches/0.3.7-0001-fix-cmake.patch new file mode 100644 index 0000000000000..f6c65596a92c4 --- /dev/null +++ b/recipes/tree-sitter-sql/all/patches/0.3.7-0001-fix-cmake.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index faaef1e..c939c26 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,7 +14,7 @@ if(NOT ${TREE_SITTER_ABI_VERSION} MATCHES "^[0-9]+$") + unset(TREE_SITTER_ABI_VERSION CACHE) + message(FATAL_ERROR "TREE_SITTER_ABI_VERSION must be an integer") + endif() +- ++if(0) + find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI") + + add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" +@@ -23,9 +23,9 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c" + --abi=${TREE_SITTER_ABI_VERSION} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generating parser.c") +- ++endif() + add_library(tree-sitter-sql src/parser.c) +-if(EXISTS src/scanner.c) ++if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c) + target_sources(tree-sitter-sql PRIVATE src/scanner.c) + endif() + target_include_directories(tree-sitter-sql PRIVATE src) +@@ -37,7 +37,7 @@ target_compile_definitions(tree-sitter-sql PRIVATE + set_target_properties(tree-sitter-sql + PROPERTIES + C_STANDARD 11 +- POSITION_INDEPENDENT_CODE ON ++ # POSITION_INDEPENDENT_CODE ON + SOVERSION "${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}" + DEFINE_SYMBOL "") + diff --git a/recipes/tree-sitter-sql/all/test_package/CMakeLists.txt b/recipes/tree-sitter-sql/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2f8015847ed2a --- /dev/null +++ b/recipes/tree-sitter-sql/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(PkgConfig) +pkg_check_modules(TREE_SITTER_SQL IMPORTED_TARGET "tree-sitter-sql") + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::TREE_SITTER_SQL) +if(TREE_SITTER_SQL_VERSION VERSION_LESS "0.3.7") + target_compile_definitions(${PROJECT_NAME} PRIVATE TREE_SITTER_SQL_OLD_PATH) +endif() + diff --git a/recipes/tree-sitter-sql/all/test_package/conanfile.py b/recipes/tree-sitter-sql/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e8f597c20ddd4 --- /dev/null +++ b/recipes/tree-sitter-sql/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +from conan 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 = "PkgConfigDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + + 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/tree-sitter-sql/all/test_package/test_package.c b/recipes/tree-sitter-sql/all/test_package/test_package.c new file mode 100644 index 0000000000000..133b02dd2df77 --- /dev/null +++ b/recipes/tree-sitter-sql/all/test_package/test_package.c @@ -0,0 +1,30 @@ +#include +#include + +#include "tree_sitter/api.h" +#ifdef TREE_SITTER_SQL_OLD_PATH +#include "tree-sitter-sql.h" +#else +#include "tree_sitter/tree-sitter-sql.h" +#endif + +int main() { + TSParser *parser = ts_parser_new(); + ts_parser_set_language(parser, tree_sitter_sql()); + const char *source_code = "select * from dummy_table;\n"; + TSTree *tree = ts_parser_parse_string( + parser, + NULL, + source_code, + strlen(source_code) + ); + TSNode root_node = ts_tree_root_node(tree); + + char *string = ts_node_string(root_node); + printf("Syntax tree: %s\n", string); + free(string); + + ts_tree_delete(tree); + ts_parser_delete(parser); + return 0; +} diff --git a/recipes/tree-sitter-sql/config.yml b/recipes/tree-sitter-sql/config.yml new file mode 100644 index 0000000000000..92762b2a22839 --- /dev/null +++ b/recipes/tree-sitter-sql/config.yml @@ -0,0 +1,5 @@ +versions: + "0.3.7": + folder: all + "0.3.5": + folder: all diff --git a/recipes/tree-sitter/all/CMakeLists.txt b/recipes/tree-sitter/all/CMakeLists.txt index 5f48ce80be466..0198908ae200d 100644 --- a/recipes/tree-sitter/all/CMakeLists.txt +++ b/recipes/tree-sitter/all/CMakeLists.txt @@ -1,26 +1,31 @@ -cmake_minimum_required(VERSION 3.4) -project(tree-sitter C) +cmake_minimum_required(VERSION 3.15) +project(tree-sitter LANGUAGES C) # Use cmake script instead of Makefile to support MSVC + follow fPIC option -file(GLOB SOURCES RELATIVE "${PROJECT_SOURCE_DIR}" src/lib/src/*.c) -list(REMOVE_ITEM SOURCES src/lib/src/lib.c) +file(GLOB SOURCES ${TREE_SITTER_SRC_DIR}/lib/src/*.c) +list(REMOVE_ITEM SOURCES ${TREE_SITTER_SRC_DIR}/lib/src/lib.c) -file(GLOB HEADERS src/lib/include/tree_sitter/*.h) +file(GLOB HEADERS ${TREE_SITTER_SRC_DIR}/lib/include/tree_sitter/*.h) add_library(${PROJECT_NAME} ${SOURCES}) target_include_directories(${PROJECT_NAME} PRIVATE - $ - $ + $ + $ ) set_target_properties(${PROJECT_NAME} PROPERTIES - C_STANDARD 99 PUBLIC_HEADER "${HEADERS}" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +if(TREE_SITTER_VERSION VERSION_LESS "0.21.0") + target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) +else() + target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) +endif() + include(GNUInstallDirs) install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" diff --git a/recipes/tree-sitter/all/conandata.yml b/recipes/tree-sitter/all/conandata.yml index 43b71bcba5f69..e210584a98b60 100644 --- a/recipes/tree-sitter/all/conandata.yml +++ b/recipes/tree-sitter/all/conandata.yml @@ -1,13 +1,31 @@ sources: + "0.25.1": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.25.1.tar.gz" + sha256: "99a2446075c2edf60e82755c48415d5f6e40f2d9aacb3423c6ca56809b70fe59" + "0.24.4": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.24.4.tar.gz" + sha256: "d704832a6bfaac8b3cbca3b5d773cad613183ba8c04166638af2c6e5dfb9e2d2" + "0.24.3": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.24.3.tar.gz" + sha256: "0a8d0cf8e09caba22ed0d8439f7fa1e3d8453800038e43ccad1f34ef29537da1" + "0.23.1": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.23.1.tar.gz" + sha256: "30ea382bdaea8fc71e3d52850da509398f56d77b7c41e3494da46a1158d37b86" + "0.23.0": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.23.0.tar.gz" + sha256: "6403b361b0014999e96f61b9c84d6950d42f0c7d6e806be79382e0232e48a11b" + "0.22.6": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.22.6.tar.gz" + sha256: "e2b687f74358ab6404730b7fb1a1ced7ddb3780202d37595ecd7b20a8f41861f" + "0.22.5": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.22.5.tar.gz" + sha256: "6bc22ca7e0f81d77773462d922cf40b44bfd090d92abac75cb37dbae516c2417" + "0.22.1": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.22.1.tar.gz" + sha256: "b21065e78da33e529893c954e712ad15d9ad44a594b74567321d4a3a007d6090" + "0.21.0": + url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.21.0.tar.gz" + sha256: "6bb60e5b63c1dc18aba57a9e7b3ea775b4f9ceec44cc35dac4634d26db4eb69c" "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" - "0.20.0": - url: "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.20.0.tar.gz" - sha256: "4a8070b9de17c3b8096181fe8530320ab3e8cca685d8bee6a3e8d164b5fb47da" - "0.17.3": - url: "https://github.com/tree-sitter/tree-sitter/archive/0.17.3.tar.gz" - sha256: "a897e5c9a7ccb74271d9b20d59121d2d2e9de8b896c4d1cfaac0f8104c1ef9f8" diff --git a/recipes/tree-sitter/all/conanfile.py b/recipes/tree-sitter/all/conanfile.py index db16033332a0c..ac605167e9581 100644 --- a/recipes/tree-sitter/all/conanfile.py +++ b/recipes/tree-sitter/all/conanfile.py @@ -1,8 +1,9 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout -from conan.tools.files import get, copy +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout +from conan.tools.files import get, copy, rmdir +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -10,10 +11,10 @@ class TreeSitterConan(ConanFile): name = "tree-sitter" description = "Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited." - topics = ("parser", "incremental", "rust") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://tree-sitter.github.io/tree-sitter" - license = "MIT" + topics = ("parser", "incremental", "rust") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -25,15 +26,20 @@ class TreeSitterConan(ConanFile): "shared": False, } - generators = "CMakeToolchain" - exports_sources = "CMakeLists.txt" + def export_sources(self): + if Version(self.version) < "0.24.1": + 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) >= "0.24.1": + self.package_type = "static-library" def configure(self): - if self.options.shared: + if Version(self.version) >= "0.24.1" and self.settings.os == "Windows": + self.options.rm_safe("shared") + if self.options.get_safe("shared"): self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") @@ -44,9 +50,21 @@ def layout(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + tc = CMakeToolchain(self) + if Version(self.version) < "0.24.1": + tc.variables["TREE_SITTER_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["TREE_SITTER_VERSION"] = str(self.version) + else: + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.get_safe("shared", False) + tc.generate() + def build(self): cmake = CMake(self) - cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + if Version(self.version) < "0.24.1": + cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) + else: + cmake.configure(build_script_folder=os.path.join(self.source_folder, "lib")) cmake.build() def package(self): @@ -59,5 +77,7 @@ def package(self): cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + def package_info(self): 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 c0b053bd23a36..219187895d037 100644 --- a/recipes/tree-sitter/all/test_package/CMakeLists.txt +++ b/recipes/tree-sitter/all/test_package/CMakeLists.txt @@ -1,7 +1,12 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(tree-sitter REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} tree-sitter::tree-sitter) +if(tree-sitter_VERSION VERSION_LESS "0.21.0") + target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) +else() + target_compile_features(${PROJECT_NAME} PRIVATE c_std_11) +endif() diff --git a/recipes/tree-sitter/config.yml b/recipes/tree-sitter/config.yml index 30720fc6f1016..8d738be9be523 100644 --- a/recipes/tree-sitter/config.yml +++ b/recipes/tree-sitter/config.yml @@ -1,9 +1,22 @@ versions: - "0.20.8": + "0.25.1": + folder: all + "0.24.4": + folder: all + "0.24.3": + folder: all + "0.23.1": folder: all - "0.20.6": + "0.23.0": folder: all - "0.20.0": + "0.22.6": folder: all - "0.17.3": + "0.22.5": + folder: all + "0.22.1": + folder: all + "0.21.0": + folder: all + # keep 0.20.8 for tree-sitter-c + "0.20.8": folder: all diff --git a/recipes/troldal-zippy/all/test_v1_package/CMakeLists.txt b/recipes/troldal-zippy/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/troldal-zippy/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/troldal-zippy/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", "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 aa78e9ef74461..8fdd3be7c6bf2 100644 --- a/recipes/trompeloeil/all/conandata.yml +++ b/recipes/trompeloeil/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "49": + url: "https://github.com/rollbear/trompeloeil/archive/v49.tar.gz" + sha256: "2523571fb7920b2813cbc23b46e60294aba8ead7eba434bfec69c24408615593" + "48": + url: "https://github.com/rollbear/trompeloeil/archive/v48.tar.gz" + sha256: "eebd18456975251ea3450b815e241cccfefba5b883e4a36bd309f9cf629bdec6" + "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" diff --git a/recipes/trompeloeil/all/test_package/CMakeLists.txt b/recipes/trompeloeil/all/test_package/CMakeLists.txt index ecb1ebf14da1c..76b5f7f40831c 100644 --- a/recipes/trompeloeil/all/test_package/CMakeLists.txt +++ b/recipes/trompeloeil/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(trompeloeil REQUIRED) diff --git a/recipes/trompeloeil/all/test_package/test_package.cpp b/recipes/trompeloeil/all/test_package/test_package.cpp index 356b535560158..2d62e62471f0e 100644 --- a/recipes/trompeloeil/all/test_package/test_package.cpp +++ b/recipes/trompeloeil/all/test_package/test_package.cpp @@ -1,3 +1,4 @@ +#include #include struct S diff --git a/recipes/trompeloeil/all/test_v1_package/CMakeLists.txt b/recipes/trompeloeil/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 328f7742d99d6..0000000000000 --- a/recipes/trompeloeil/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(trompeloeil REQUIRED) - -add_executable(test_package ../test_package/test_package.cpp) -target_link_libraries(test_package PRIVATE trompeloeil::trompeloeil) -target_compile_features(test_package PRIVATE cxx_std_14) diff --git a/recipes/trompeloeil/all/test_v1_package/conanfile.py b/recipes/trompeloeil/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/trompeloeil/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_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/trompeloeil/config.yml b/recipes/trompeloeil/config.yml index 4cd5ba1f148f2..39c766357c1eb 100644 --- a/recipes/trompeloeil/config.yml +++ b/recipes/trompeloeil/config.yml @@ -1,4 +1,10 @@ versions: + "49": + folder: all + "48": + folder: all + "47": + folder: all "46": folder: all "45": diff --git a/recipes/tscns/all/test_package/CMakeLists.txt b/recipes/tscns/all/test_package/CMakeLists.txt index 46909114bb657..91d4f298179b9 100644 --- a/recipes/tscns/all/test_package/CMakeLists.txt +++ b/recipes/tscns/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(tscns REQUIRED CONFIG) diff --git a/recipes/tscns/all/test_v1_package/CMakeLists.txt b/recipes/tscns/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tscns/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tscns/all/test_v1_package/conanfile.py b/recipes/tscns/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tscns/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_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/tsil/all/CMakeLists.txt b/recipes/tsil/all/CMakeLists.txt index 2c6adc0080dcc..3691377ea7f82 100644 --- a/recipes/tsil/all/CMakeLists.txt +++ b/recipes/tsil/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(TSIL LANGUAGES C) add_library(tsil diff --git a/recipes/tsil/all/test_package/CMakeLists.txt b/recipes/tsil/all/test_package/CMakeLists.txt index 48214718fc55d..cb277d89320db 100644 --- a/recipes/tsil/all/test_package/CMakeLists.txt +++ b/recipes/tsil/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(tsil REQUIRED CONFIG) diff --git a/recipes/tsil/all/test_v1_package/CMakeLists.txt b/recipes/tsil/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 141659813702c..0000000000000 --- a/recipes/tsil/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tsil REQUIRED CONFIG) - -add_executable(test_package ../test_package/test_package.c) -target_link_libraries(test_package PRIVATE tsil::tsil) diff --git a/recipes/tsil/all/test_v1_package/conanfile.py b/recipes/tsil/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tsil/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_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/tsl-array-hash/all/test_package/CMakeLists.txt b/recipes/tsl-array-hash/all/test_package/CMakeLists.txt index 813f6130cae26..5fcc98219cf4d 100644 --- a/recipes/tsl-array-hash/all/test_package/CMakeLists.txt +++ b/recipes/tsl-array-hash/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(tsl-array-hash REQUIRED CONFIG) diff --git a/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt b/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tsl-array-hash/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tsl-array-hash/all/test_v1_package/conanfile.py b/recipes/tsl-array-hash/all/test_v1_package/conanfile.py deleted file mode 100644 index 1e9df9e32dfbd..0000000000000 --- a/recipes/tsl-array-hash/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_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) diff --git a/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt b/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt index c212bc7cbc125..253c1ec8e6c24 100644 --- a/recipes/tsl-hat-trie/all/test_package/CMakeLists.txt +++ b/recipes/tsl-hat-trie/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(tsl-hat-trie REQUIRED CONFIG) diff --git a/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt b/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tsl-hat-trie/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tsl-hat-trie/all/test_v1_package/conanfile.py b/recipes/tsl-hat-trie/all/test_v1_package/conanfile.py deleted file mode 100644 index 1e9df9e32dfbd..0000000000000 --- a/recipes/tsl-hat-trie/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_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) diff --git a/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt b/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt index de096ee6a84f9..f82e3abd0df88 100644 --- a/recipes/tsl-hopscotch-map/all/test_package/CMakeLists.txt +++ b/recipes/tsl-hopscotch-map/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(tsl-hopscotch-map REQUIRED CONFIG) diff --git a/recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index d71994382aff0..0000000000000 --- a/recipes/tsl-hopscotch-map/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tsl-hopscotch-map REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE tsl::hopscotch_map) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tsl-hopscotch-map/all/test_v1_package/conanfile.py b/recipes/tsl-hopscotch-map/all/test_v1_package/conanfile.py deleted file mode 100644 index 1e9df9e32dfbd..0000000000000 --- a/recipes/tsl-hopscotch-map/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_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) diff --git a/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt b/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt index cf4b3a228306b..fa24d3ba9d777 100644 --- a/recipes/tsl-ordered-map/all/test_package/CMakeLists.txt +++ b/recipes/tsl-ordered-map/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(tsl-ordered-map REQUIRED CONFIG) diff --git a/recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/tsl-ordered-map/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tsl-ordered-map/all/test_v1_package/conanfile.py b/recipes/tsl-ordered-map/all/test_v1_package/conanfile.py deleted file mode 100644 index 1e9df9e32dfbd..0000000000000 --- a/recipes/tsl-ordered-map/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_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) diff --git a/recipes/tsl-robin-map/all/conandata.yml b/recipes/tsl-robin-map/all/conandata.yml index 89211be8fec7b..184cd30d5f022 100644 --- a/recipes/tsl-robin-map/all/conandata.yml +++ b/recipes/tsl-robin-map/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.3.0": + url: "https://github.com/Tessil/robin-map/archive/v1.3.0.tar.gz" + sha256: "a8424ad3b0affd4c57ed26f0f3d8a29604f0e1f2ef2089f497f614b1c94c7236" + "1.2.2": + url: "https://github.com/Tessil/robin-map/archive/v1.2.2.tar.gz" + sha256: "c72767ecea2a90074c7efbe91620c8f955af666505e22782e82813c652710821" "1.2.1": url: "https://github.com/Tessil/robin-map/archive/v1.2.1.tar.gz" sha256: "2b54d2c1de2f73bea5c51d5dcbd64813a08caf1bfddcfdeee40ab74e9599e8e3" diff --git a/recipes/tsl-robin-map/all/conanfile.py b/recipes/tsl-robin-map/all/conanfile.py index 14ac380eaf691..d6ee665d5c051 100644 --- a/recipes/tsl-robin-map/all/conanfile.py +++ b/recipes/tsl-robin-map/all/conanfile.py @@ -11,9 +11,9 @@ class TslRobinMapConan(ConanFile): name = "tsl-robin-map" license = "MIT" description = "C++ implementation of a fast hash map and hash set using robin hood hashing." - topics = ("robin-map", "structure", "hash map", "hash set") - homepage = "https://github.com/Tessil/robin-map" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tessil/robin-map" + topics = ("robin-map", "structure", "hash map", "hash set", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/recipes/tsl-robin-map/all/test_package/CMakeLists.txt b/recipes/tsl-robin-map/all/test_package/CMakeLists.txt index e1f4cd6d85611..6b0bf41d10dc9 100644 --- a/recipes/tsl-robin-map/all/test_package/CMakeLists.txt +++ b/recipes/tsl-robin-map/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(tsl-robin-map REQUIRED CONFIG) diff --git a/recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/tsl-robin-map/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tsl-robin-map/all/test_v1_package/conanfile.py b/recipes/tsl-robin-map/all/test_v1_package/conanfile.py deleted file mode 100644 index 1e9df9e32dfbd..0000000000000 --- a/recipes/tsl-robin-map/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_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) diff --git a/recipes/tsl-robin-map/config.yml b/recipes/tsl-robin-map/config.yml index 7a3b316dace84..05411da627de4 100644 --- a/recipes/tsl-robin-map/config.yml +++ b/recipes/tsl-robin-map/config.yml @@ -1,4 +1,8 @@ versions: + "1.3.0": + folder: all + "1.2.2": + folder: all "1.2.1": folder: all "1.0.1": diff --git a/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt b/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt index 47e7071ad283b..3c758ca049bb6 100644 --- a/recipes/tsl-sparse-map/all/test_package/CMakeLists.txt +++ b/recipes/tsl-sparse-map/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(tsl-sparse-map REQUIRED CONFIG) diff --git a/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt b/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/tsl-sparse-map/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tsl-sparse-map/all/test_v1_package/conanfile.py b/recipes/tsl-sparse-map/all/test_v1_package/conanfile.py deleted file mode 100644 index 1e9df9e32dfbd..0000000000000 --- a/recipes/tsl-sparse-map/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_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - test_package = os.path.join("bin", "test_package") - self.run(test_package, run_environment=True) diff --git a/recipes/tuplet/all/test_package/CMakeLists.txt b/recipes/tuplet/all/test_package/CMakeLists.txt index 6da61fdca65d1..12d8601ebd0e0 100644 --- a/recipes/tuplet/all/test_package/CMakeLists.txt +++ b/recipes/tuplet/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(tuplet REQUIRED CONFIG) diff --git a/recipes/tuplet/all/test_v1_package/CMakeLists.txt b/recipes/tuplet/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/tuplet/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/tuplet/all/test_v1_package/conanfile.py b/recipes/tuplet/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/tuplet/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_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/turtle/all/conandata.yml b/recipes/turtle/all/conandata.yml index 1b973e23b0f99..3460796e19388 100644 --- a/recipes/turtle/all/conandata.yml +++ b/recipes/turtle/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "1.3.1": - url: "https://github.com/mat007/turtle/archive/v1.3.1.tar.gz" - sha256: "1ea10600a4046286a781c898ed3110d48fdab473f5320dc48cc2775353039b8b" + "2.0.0": + url: "https://github.com/mat007/turtle/archive/v2.0.0.tar.gz" + sha256: "636a552fc442d452955eca1f554e6a962b38270c1a6290538c6405da59b49e45" "1.3.2": url: "https://github.com/mat007/turtle/archive/v1.3.2.tar.gz" sha256: "4dc0bd79ddecd337691d5805ecb25f427bd85d9549f44d06cd3a6b7f0f0235d4" + "1.3.1": + url: "https://github.com/mat007/turtle/archive/v1.3.1.tar.gz" + sha256: "1ea10600a4046286a781c898ed3110d48fdab473f5320dc48cc2775353039b8b" diff --git a/recipes/turtle/all/conanfile.py b/recipes/turtle/all/conanfile.py index 1f12c41eb77c7..6b80db4af4ab7 100644 --- a/recipes/turtle/all/conanfile.py +++ b/recipes/turtle/all/conanfile.py @@ -1,6 +1,9 @@ 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" @@ -8,13 +11,27 @@ 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 = ("mock", "test", "boost") + license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mat007/turtle" - license = "BSL-1.0" - no_copy_source = True + topics = ("mock", "test", "boost", "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 { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } def layout(self): basic_layout(self, src_folder="src") @@ -25,9 +42,17 @@ def requirements(self): def package_id(self): self.info.clear() - def package_info(self): - self.cpp_info.libdirs = [] - self.cpp_info.bindirs = [] + def validate(self): + if Version(self.version) < "2.0.0": + return + + 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) @@ -35,3 +60,7 @@ def source(self): def package(self): 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.libdirs = [] + self.cpp_info.bindirs = [] diff --git a/recipes/turtle/all/test_package/CMakeLists.txt b/recipes/turtle/all/test_package/CMakeLists.txt index 284560de8122d..17dd4096afba2 100644 --- a/recipes/turtle/all/test_package/CMakeLists.txt +++ b/recipes/turtle/all/test_package/CMakeLists.txt @@ -5,3 +5,6 @@ find_package(turtle REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} turtle::turtle) +if(turtle_VERSION VERSION_GREATER_EQUAL "2.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +endif() diff --git a/recipes/turtle/config.yml b/recipes/turtle/config.yml index 266cd9ad48136..5a4bc86b61751 100644 --- a/recipes/turtle/config.yml +++ b/recipes/turtle/config.yml @@ -1,5 +1,7 @@ versions: - "1.3.1": + "2.0.0": folder: all "1.3.2": folder: all + "1.3.1": + folder: all diff --git a/recipes/tweenerspp/all/conandata.yml b/recipes/tweenerspp/all/conandata.yml new file mode 100644 index 0000000000000..1e9cad7f97a08 --- /dev/null +++ b/recipes/tweenerspp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1": + url: "https://github.com/j-jorge/tweenerspp/archive/refs/tags/v1.1.tar.gz" + sha256: "b3c111b05c5e480993238ed794cc524521bb2d4889e59c49a99b714fff566623" diff --git a/recipes/tweenerspp/all/conanfile.py b/recipes/tweenerspp/all/conanfile.py new file mode 100644 index 0000000000000..b4a432e3792d6 --- /dev/null +++ b/recipes/tweenerspp/all/conanfile.py @@ -0,0 +1,60 @@ +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.microsoft import is_msvc +import os + +required_conan_version = ">=1.52.0" + +class TweenersppConan(ConanFile): + name = "tweenerspp" + description = "Yet another C++ tweeners library" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/j-jorge/tweenerspp" + topics = ("tweener", "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, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy( + self, + "*.hpp", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), + ) + copy( + self, + "*.tpp", + 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 is_msvc(self): + self.cpp_info.defines = ["_USE_MATH_DEFINES"] + self.cpp_info.set_property("cmake_file_name", "tweeners") + self.cpp_info.set_property("cmake_target_name", "tweeners::tweeners") + self.cpp_info.set_property("cmake_target_aliases", ["tweeners"]) diff --git a/recipes/tweenerspp/all/test_package/CMakeLists.txt b/recipes/tweenerspp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7f72f56d7679a --- /dev/null +++ b/recipes/tweenerspp/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(tweeners REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tweeners::tweeners) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/tweenerspp/all/test_package/conanfile.py b/recipes/tweenerspp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..e730ad6dc0dfc --- /dev/null +++ b/recipes/tweenerspp/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/tweenerspp/all/test_package/test_package.cpp b/recipes/tweenerspp/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ccc39ffab8d02 --- /dev/null +++ b/recipes/tweenerspp/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include +#include +#include + +auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int { + std::cout << std::boolalpha; + std::cin.tie(nullptr); + std::ios_base::sync_with_stdio(false); + + constexpr auto from = 0; + constexpr auto to = 100; + constexpr auto duration = 10.f; + + auto system = tweeners::system {}; + + auto x = 0; + tweeners::builder().range_transform(from, to, duration, x, tweeners::easing::sine<>).build(system); + + for (auto i = 0; i != 10; ++i) { + system.update(1.0f); + std::cout << i << "->" << x << std::endl; + } + + return 0; +} diff --git a/recipes/tweenerspp/config.yml b/recipes/tweenerspp/config.yml new file mode 100644 index 0000000000000..3f8a45fae5832 --- /dev/null +++ b/recipes/tweenerspp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1": + folder: all diff --git a/recipes/tweeny/all/conandata.yml b/recipes/tweeny/all/conandata.yml new file mode 100644 index 0000000000000..7744678a2605e --- /dev/null +++ b/recipes/tweeny/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.2.0": + url: "https://github.com/mobius3/tweeny/archive/refs/tags/v3.2.0.tar.gz" + sha256: "2be7db9e0354da31f020b77474e2d547dbbaa8999a6a4bea4b388e6d31e4ef07" diff --git a/recipes/tweeny/all/conanfile.py b/recipes/tweeny/all/conanfile.py new file mode 100644 index 0000000000000..9e0d4dd2875b3 --- /dev/null +++ b/recipes/tweeny/all/conanfile.py @@ -0,0 +1,59 @@ +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 +from conan.tools.scm import Version +import os + + +required_conan_version = ">=2.0.9" + +class TweenyConan(ConanFile): + name = "tweeny" + description = "Tweeny is an inbetweening library designed for the creation of complex animations for games and other beautiful interactive software" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mobius3/tweeny" + topics = ("animation", "tweening", "easing-functions") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + 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) + if Version(self.version) == "3.2.0": + # already fixed in master, assuming it is fixed in upcoming release + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package_id(self): + self.info.clear() + + 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", "pkgconfig")) + 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.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "tweeny") + self.cpp_info.set_property("cmake_target_name", "tweeny") diff --git a/recipes/tweeny/all/test_package/CMakeLists.txt b/recipes/tweeny/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..01150e47a91f8 --- /dev/null +++ b/recipes/tweeny/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(tweeny REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE tweeny) diff --git a/recipes/tweeny/all/test_package/conanfile.py b/recipes/tweeny/all/test_package/conanfile.py new file mode 100644 index 0000000000000..2e77b4246fa81 --- /dev/null +++ b/recipes/tweeny/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" + + 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/tweeny/all/test_package/test_package.cpp b/recipes/tweeny/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..dcc12f75c4a2f --- /dev/null +++ b/recipes/tweeny/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include +#include +#include "tweeny/tweeny.h" + + +int main(void) { + auto helloworld = tweeny::from('h','e','l','l','o').to('w','o','r','l','d').during(2); + for (int i = 0; i < 2; i++) { + for (char c : helloworld.step(1)) { printf("%c", c); } + printf("\n"); + } +} diff --git a/recipes/tweeny/config.yml b/recipes/tweeny/config.yml new file mode 100644 index 0000000000000..b230719ccee73 --- /dev/null +++ b/recipes/tweeny/config.yml @@ -0,0 +1,3 @@ +versions: + "3.2.0": + folder: all diff --git a/recipes/tweetnacl/all/test_v1_package/CMakeLists.txt b/recipes/tweetnacl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/tweetnacl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/tweetnacl/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", "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/test_v1_package/CMakeLists.txt b/recipes/twitch-native-ipc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/twitch-native-ipc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index bbac244c5a058..0000000000000 --- a/recipes/twitch-native-ipc/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/test_v1_package/CMakeLists.txt b/recipes/twitchtv-libsoundtrackutil/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/twitchtv-libsoundtrackutil/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index a4ca380f17734..0000000000000 --- a/recipes/twitchtv-libsoundtrackutil/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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 0be0030fda0b5..1e778714e307e 100644 --- a/recipes/type_safe/all/conandata.yml +++ b/recipes/type_safe/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.4": + url: "https://github.com/foonathan/type_safe/archive/v0.2.4.tar.gz" + sha256: "a631d03c18c65726b3d1b7d41ac5806e9121367afe10dd2f408a2d75e144b734" "0.2.3": url: "https://github.com/foonathan/type_safe/archive/v0.2.3.tar.gz" sha256: "19008ab9526b0d2db1ae6bbd6640f5f7a398826bb2266561472e9f1b10d85bec" diff --git a/recipes/type_safe/all/test_v1_package/CMakeLists.txt b/recipes/type_safe/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/type_safe/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/type_safe/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", "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 ae20ba2754647..3e1d8c0bc781f 100644 --- a/recipes/type_safe/config.yml +++ b/recipes/type_safe/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.4": + folder: all "0.2.3": folder: all "0.2.2": diff --git a/recipes/ua-nodeset/all/test_v1_package/conanfile.py b/recipes/ua-nodeset/all/test_v1_package/conanfile.py deleted file mode 100644 index 872e7a1f2874d..0000000000000 --- a/recipes/ua-nodeset/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,12 +0,0 @@ -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/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 dc6c7c2cfb327..38d486d7a2d81 100644 --- a/recipes/uchardet/all/conanfile.py +++ b/recipes/uchardet/all/conanfile.py @@ -3,7 +3,8 @@ 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 +from conan.tools.files import copy, get, replace_in_file, rmdir, save +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -62,28 +63,14 @@ def generate(self): tc.generate() def _patch_sources(self): - # the following fixes that apply to uchardet version 0.0.7 - # fix broken cmake - replace_in_file( - self, - os.path.join(self.source_folder, "CMakeLists.txt"), - "${CMAKE_BINARY_DIR}", - "${CMAKE_CURRENT_BINARY_DIR}", - ) - # fix problem with mac os - replace_in_file( - self, - os.path.join(self.source_folder, "CMakeLists.txt"), - "string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} TARGET_ARCHITECTURE)", - 'string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" TARGET_ARCHITECTURE)', - ) - # disable building tests - replace_in_file( - self, - os.path.join(self.source_folder, "CMakeLists.txt"), - "add_subdirectory(test)", - "#add_subdirectory(test)", - ) + 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() @@ -97,6 +84,7 @@ def package(self): 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, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) fix_apple_shared_install_name(self) diff --git a/recipes/uchardet/all/test_v1_package/CMakeLists.txt b/recipes/uchardet/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/uchardet/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/uchardet/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_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 cfafd90c8a600..22361ddec897d 100644 --- a/recipes/ulfius/all/conanfile.py +++ b/recipes/ulfius/all/conanfile.py @@ -31,8 +31,8 @@ class UlfiusConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "enable_websockets": False, # FIXME: should be True (cannot be True because of missing gnutls recipe) - "with_gnutls": False, # FIXME: should be True + "enable_websockets": True, + "with_gnutls": True, "with_jansson": True, "with_libcurl": True, "with_yder": True, @@ -40,14 +40,13 @@ class UlfiusConan(ConanFile): def config_options(self): if self.settings.os == "Windows": - self.options.enable_websockets = False + # INSTALL.md says that websockets are not supported on Windows + del self.options.enable_websockets del self.options.fPIC def validate(self): - if self.options.with_gnutls: - raise ConanInvalidConfiguration("with_gnutls=True is not yet implemented due to missing gnutls CCI recipe") - if self.settings.os == "Windows" and self.options.enable_websockets: - raise ConanInvalidConfiguration("ulfius does not support with_websockets=True on Windows") + if self.options.get_safe("enable_websockets") and not self.options.with_gnutls: + raise ConanInvalidConfiguration(f"{self.ref} requires -o=&:with_gnutls=True when -o=&:enable_websockets=True") def configure(self): if self.options.shared: @@ -56,7 +55,7 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") def requirements(self): - self.requires("orcania/2.3.1", transitive_headers=True) + self.requires("orcania/2.3.3", transitive_headers=True) self.requires("libmicrohttpd/0.9.75", transitive_headers=True) if self.options.with_yder: self.requires("yder/1.4.18", transitive_headers=True) @@ -64,6 +63,11 @@ def requirements(self): self.requires("jansson/2.14", transitive_headers=True) if self.options.with_libcurl: self.requires("libcurl/[>=7.78.0 <9]") + if self.options.with_gnutls: + # Used in public ulfius.h:43 + self.requires("gnutls/3.8.2", transitive_headers=True) + if self.options.get_safe("enable_websockets"): + self.requires("zlib/[>=1.2.11 <2]") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -81,62 +85,33 @@ def generate(self): tc.variables["BUILD_STATIC"] = not self.options.shared tc.variables["DOWNLOAD_DEPENDENCIES"] = False tc.variables["WITH_GNUTLS"] = self.options.with_gnutls - tc.variables["WITH_WEBSOCKETS"] = self.options.enable_websockets + tc.variables["WITH_WEBSOCKET"] = self.options.get_safe("enable_websockets") tc.variables["WITH_CURL"] = self.options.with_libcurl tc.variables["WITH_JANSSON"] = self.options.with_jansson + + # Compilation issues when setting Ulifus as a dependency internally + tc.variables["BUILD_UWSC"] = False + tc.generate() deps = CMakeDeps(self) - deps.generate() - # https://github.com/conan-io/conan/issues/12367 + move this before running CMakeDeps.generate() - save(self, os.path.join(self.generators_folder, "MHDConfig.cmake"), textwrap.dedent(f"""\ - include(CMakeFindDependencyMacro) - find_dependency(libmicrohttpd) - - set(MHD_FOUND TRUE) - add_library(MHD::MHD INTERFACE IMPORTED) - set_target_properties(MHD::MHD PROPERTIES INTERFACE_LINK_LIBRARIES "libmicrohttpd::libmicrohttpd") - set(MHD_VERSION_STRING {self.dependencies['libmicrohttpd'].ref.version}) - """)) - save(self, os.path.join(self.generators_folder, "MHDConfigVersion.cmake"), textwrap.dedent(f"""\ - set(PACKAGE_VERSION "{ self.dependencies['libmicrohttpd'].ref.version }") - - if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) - set(PACKAGE_VERSION_COMPATIBLE FALSE) - else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) - endif() - endif() - """)) + deps.set_property("libmicrohttpd", "cmake_file_name", "MHD") + deps.set_property("libmicrohttpd", "cmake_target_name", "MHD::MHD") + + # Orcania generates -static targets for static libraries, but Ulfius does not check for them, + # unconditionally set the target name to Orcania::Orcania + deps.set_property("orcania", "cmake_target_name", "Orcania::Orcania") + + # Same for Yder + if self.options.with_yder: + deps.set_property("yder", "cmake_target_name", "Yder::Yder") - # Shared ulfius looks for Orcania::Orcania and Yder::Yder - # Static ulfius looks for Orcania::Orcania-static and Yder::Yder-static - if self.options.shared: - if not self.dependencies["orcania"].options.shared: - save(self, os.path.join(self.generators_folder, "OrcaniaConfig.cmake"), textwrap.dedent("""\ - add_library(Orcania::Orcania INTERFACE IMPORTED) - set_target_properties(Orcania::Orcania PROPERTIES INTERFACE_LINK_LIBRARIES "Orcania::Orcania-static") - """), append=True) - if self.options.with_yder and not self.dependencies["yder"].options.shared: - save(self, os.path.join(self.generators_folder, "YderConfig.cmake"), textwrap.dedent("""\ - add_library(Yder::Yder INTERFACE IMPORTED) - set_target_properties(Yder::Yder PROPERTIES INTERFACE_LINK_LIBRARIES "Yder::Yder-static") - """), append=True) - - # Create Jansson::Jansson if self.options.with_jansson: - save(self, os.path.join(self.generators_folder, "jansson-config.cmake"), textwrap.dedent(f"""\ - add_library(Jansson::Jansson INTERFACE IMPORTED) - set_target_properties(Jansson::Jansson PROPERTIES INTERFACE_LINK_LIBRARIES "jansson::jansson") - set(JANSSON_VERSION_STRING {self.dependencies['jansson'].ref.version}) - """), append=True) + deps.set_property("jansson", "cmake_file_name", "Jansson") + deps.set_property("jansson", "cmake_target_name", "Jansson::Jansson") - if self.options.with_gnutls: - # FIXME: make sure gnutls creates GnuTLSCOnfig.cmake + GnuTLS::GnuTLS target + GNUTLS_VERSION_STRING - pass + deps.generate() def _patch_sources(self): apply_conandata_patches(self) diff --git a/recipes/ulfius/all/test_package/CMakeLists.txt b/recipes/ulfius/all/test_package/CMakeLists.txt index 5abb20511e4c7..ae8215e84b957 100644 --- a/recipes/ulfius/all/test_package/CMakeLists.txt +++ b/recipes/ulfius/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(Ulfius REQUIRED CONFIG) diff --git a/recipes/ulfius/all/test_v1_package/CMakeLists.txt b/recipes/ulfius/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index c0c854f00b188..0000000000000 --- a/recipes/ulfius/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -find_package(Ulfius REQUIRED CONFIG) - -option(ULFIUS_SHARED "Ulfius is built as a shared library") - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -if(ULFIUS_SHARED) - target_link_libraries(${PROJECT_NAME} PRIVATE Ulfius::Ulfius) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE Ulfius::Ulfius-static) -endif() diff --git a/recipes/ulfius/all/test_v1_package/conanfile.py b/recipes/ulfius/all/test_v1_package/conanfile.py deleted file mode 100644 index 32ed9b5ed5ce3..0000000000000 --- a/recipes/ulfius/all/test_v1_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.definitions["ULFIUS_SHARED"] = self.options["ulfius"].shared - 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/uncrustify/all/conandata.yml b/recipes/uncrustify/all/conandata.yml index 994dd9df8f5c3..e46325da0f342 100644 --- a/recipes/uncrustify/all/conandata.yml +++ b/recipes/uncrustify/all/conandata.yml @@ -1,13 +1,10 @@ sources: - "0.78.0": - url: "https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.78.0.tar.gz" - sha256: "377efec187c26c7ad77900d94032fa51b029831c69442d607a6e53ef2115928f" + "0.79.0": + url: "https://github.com/uncrustify/uncrustify/archive/uncrustify-0.79.0.tar.gz" + sha256: "e7afaeabf636b7f0ce4e3e9747b95f7bd939613a8db49579755dddf44fedca5f" + "0.78.1": + url: "https://github.com/uncrustify/uncrustify/archive/uncrustify-0.78.1.tar.gz" + sha256: "ecaf4c0adca14c36dfffa30bc28e69865115ecd602c90eb16a8cddccb41caad2" "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" - "0.74.0": - url: "https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.74.0.tar.gz" - sha256: "b7d24e256e7f919aa96289ac8167ac98340df7faa2d34b60d2242dc54700caaa" diff --git a/recipes/uncrustify/all/conanfile.py b/recipes/uncrustify/all/conanfile.py index 0c905f0cb5c35..92d47714d1e2d 100644 --- a/recipes/uncrustify/all/conanfile.py +++ b/recipes/uncrustify/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=2.1" class UncrustifyConan(ConanFile): @@ -36,6 +36,8 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["NoGitVersionString"] = True tc.variables["BUILD_TESTING"] = False + if Version(self.version) < "0.78.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -65,6 +67,3 @@ def package(self): def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] - - # TODO: to remove in conan v2 - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/uncrustify/all/test_v1_package/conanfile.py b/recipes/uncrustify/all/test_v1_package/conanfile.py deleted file mode 100644 index a60815102333e..0000000000000 --- a/recipes/uncrustify/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,9 +0,0 @@ -from conans import ConanFile, tools - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - if not tools.cross_building(self): - self.run("uncrustify --version", run_environment=True) diff --git a/recipes/uncrustify/config.yml b/recipes/uncrustify/config.yml index 67d12c21bb4ac..2c75346920bc6 100644 --- a/recipes/uncrustify/config.yml +++ b/recipes/uncrustify/config.yml @@ -1,9 +1,7 @@ versions: - "0.78.0": + "0.79.0": folder: all - "0.77.1": - folder: all - "0.75.1": + "0.78.1": folder: all - "0.74.0": + "0.77.1": folder: all diff --git a/recipes/uni-algo/all/test_package/CMakeLists.txt b/recipes/uni-algo/all/test_package/CMakeLists.txt index 2c2668410d8a6..fcfff86388e94 100644 --- a/recipes/uni-algo/all/test_package/CMakeLists.txt +++ b/recipes/uni-algo/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(uni-algo REQUIRED CONFIG) diff --git a/recipes/uni-algo/all/test_v1_package/CMakeLists.txt b/recipes/uni-algo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/uni-algo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/uni-algo/all/test_v1_package/conanfile.py b/recipes/uni-algo/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/uni-algo/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/unicorn/all/test_package/CMakeLists.txt b/recipes/unicorn/all/test_package/CMakeLists.txt index 20222cfa58800..f8734e2450d03 100644 --- a/recipes/unicorn/all/test_package/CMakeLists.txt +++ b/recipes/unicorn/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(unicorn REQUIRED CONFIG) diff --git a/recipes/unicorn/all/test_v1_package/CMakeLists.txt b/recipes/unicorn/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/unicorn/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/unicorn/all/test_v1_package/conanfile.py b/recipes/unicorn/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/unicorn/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", "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/units/all/test_package/CMakeLists.txt b/recipes/units/all/test_package/CMakeLists.txt index 34eb08429bc23..7f2c45a57165f 100644 --- a/recipes/units/all/test_package/CMakeLists.txt +++ b/recipes/units/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(units REQUIRED CONFIG) diff --git a/recipes/units/all/test_v1_package/CMakeLists.txt b/recipes/units/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/units/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/units/all/test_v1_package/conanfile.py b/recipes/units/all/test_v1_package/conanfile.py deleted file mode 100644 index e0a85886fc12c..0000000000000 --- a/recipes/units/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import CMake, ConanFile, 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/unity/all/conandata.yml b/recipes/unity/all/conandata.yml index a3d7facb1dfbb..99c6f0d9d4bf6 100644 --- a/recipes/unity/all/conandata.yml +++ b/recipes/unity/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6.0": + url: "https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/v2.6.0.tar.gz" + sha256: "aa4c9fb1ae5fc5242f914c65f3557e817e40cb37f04a31e5ff76d1ab89dbf674" "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/test_package/CMakeLists.txt b/recipes/unity/all/test_package/CMakeLists.txt index ac959a17f44e2..5a30a155d5b22 100644 --- a/recipes/unity/all/test_package/CMakeLists.txt +++ b/recipes/unity/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 C) find_package(unity REQUIRED CONFIG) diff --git a/recipes/unity/config.yml b/recipes/unity/config.yml index 2ac88b6313aec..a6bd532e688f8 100644 --- a/recipes/unity/config.yml +++ b/recipes/unity/config.yml @@ -1,3 +1,5 @@ versions: + "2.6.0": + folder: all "2.5.2": folder: all diff --git a/recipes/univalue/all/test_package/CMakeLists.txt b/recipes/univalue/all/test_package/CMakeLists.txt index 2d1b2f3c62e86..ab5a8f6f1d67f 100644 --- a/recipes/univalue/all/test_package/CMakeLists.txt +++ b/recipes/univalue/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(univalue REQUIRED CONFIG) diff --git a/recipes/univalue/all/test_v1_package/CMakeLists.txt b/recipes/univalue/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/univalue/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/univalue/all/test_v1_package/conanfile.py b/recipes/univalue/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/univalue/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_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/unleash-client-cpp/all/CMakeLists.txt b/recipes/unleash-client-cpp/all/CMakeLists.txt deleted file mode 100644 index b71c882d9d33f..0000000000000 --- a/recipes/unleash-client-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(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/unleash-client-cpp/all/conandata.yml b/recipes/unleash-client-cpp/all/conandata.yml index 76a5bca8da701..69cfd9795a61f 100644 --- a/recipes/unleash-client-cpp/all/conandata.yml +++ b/recipes/unleash-client-cpp/all/conandata.yml @@ -1,8 +1,4 @@ sources: - "1.1.1": - url: "https://github.com/aruizs/unleash-client-cpp/archive/refs/tags/v1.1.1.tar.gz" - sha256: "2750dc231bf608910d4270ac39d83d46d25b88cc547a9d4d31f7ce4950effa7c" -patches: - "1.1.1": - - patch_file: "patches/0001-no-conan-cmake.patch" - base_path: "source_subfolder" + "1.3.0": + url: "https://github.com/aruizs/unleash-client-cpp/archive/refs/tags/v1.3.0.tar.gz" + sha256: "fa0b8d6101c6dbd08db23a3d353f386c17e9436a63d658f88c7d0b8619b8d501" diff --git a/recipes/unleash-client-cpp/all/conanfile.py b/recipes/unleash-client-cpp/all/conanfile.py index 08a60bfc378de..5c84a2f78a279 100644 --- a/recipes/unleash-client-cpp/all/conanfile.py +++ b/recipes/unleash-client-cpp/all/conanfile.py @@ -1,18 +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.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir import os -required_conan_version = ">=1.43.0" +from conan.tools.scm import Version +required_conan_version = ">=1.53.0" class UnleashConan(ConanFile): name = "unleash-client-cpp" - homepage = "https://github.com/aruizs/unleash-client-cpp/" + description = "Unleash Client SDK for C++ projects." license = "MIT" url = "https://github.com/conan-io/conan-center-index" - description = "Unleash Client SDK for C++ projects." + homepage = "https://github.com/aruizs/unleash-client-cpp/" topics = ("unleash", "feature", "flag", "toggle") - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,17 +27,6 @@ class UnleashConan(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" - @property def _min_cppstd(self): return "17" @@ -42,75 +35,61 @@ def _min_cppstd(self): def _compilers_min_version(self): return { "Visual Studio": "15", # Should we check toolset? + "msvc": "191", "gcc": "7", "clang": "4.0", "apple-clang": "3.8", "intel": "17", } - 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 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("cpr/1.7.2") - self.requires("nlohmann_json/3.10.5") + self.requires("cpr/1.10.5") + self.requires("nlohmann_json/3.11.3") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.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] + check_min_cppstd(self, self._min_cppstd) min_version = self._compilers_min_version.get(str(self.settings.compiler), False) - if min_version and loose_lt_semver(str(self.settings.compiler.version), min_version): + if min_version and Version(self.settings.compiler.version) < min_version: raise ConanInvalidConfiguration( - "{} requires C++{}, which your compiler does not support.".format(self.name, self._min_cppstd) + 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) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["ENABLE_TESTING"] = False - self._cmake.definitions["ENABLE_TEST_COVERAGE"] = 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["ENABLE_TESTING"] = False + tc.variables["ENABLE_TESTING_COVERAGE"] = 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() + 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() - 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 = ["unleash"] self.cpp_info.set_property("cmake_file_name", "unleash") self.cpp_info.set_property("cmake_target_name", "unleash::unleash") - self.cpp_info.libs = ["unleash"] - - self.cpp_info.names["cmake_find_package"] = "unleash" - self.cpp_info.names["cmake_find_package_multi"] = "unleash" - diff --git a/recipes/unleash-client-cpp/all/patches/0001-no-conan-cmake.patch b/recipes/unleash-client-cpp/all/patches/0001-no-conan-cmake.patch deleted file mode 100644 index f88f88c81dde7..0000000000000 --- a/recipes/unleash-client-cpp/all/patches/0001-no-conan-cmake.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -25,8 +25,6 @@ if(DEFINED unleash_SHARED_LIBS) - endif() - - # External dependencies using Conan.io --include(cmake/Conan.cmake) --run_conan() - - # Create the main unleash library target - add_subdirectory(src) diff --git a/recipes/unleash-client-cpp/all/test_package/CMakeLists.txt b/recipes/unleash-client-cpp/all/test_package/CMakeLists.txt index 5dfa06d3b7057..009cb832762c0 100644 --- a/recipes/unleash-client-cpp/all/test_package/CMakeLists.txt +++ b/recipes/unleash-client-cpp/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -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(unleash CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} unleash::unleash) +target_link_libraries(${PROJECT_NAME} PRIVATE unleash::unleash) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/unleash-client-cpp/all/test_package/conanfile.py b/recipes/unleash-client-cpp/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/unleash-client-cpp/all/test_package/conanfile.py +++ b/recipes/unleash-client-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/unleash-client-cpp/all/test_package/test_package.cpp b/recipes/unleash-client-cpp/all/test_package/test_package.cpp index 9af855c3e03d7..1eaf68256bc88 100644 --- a/recipes/unleash-client-cpp/all/test_package/test_package.cpp +++ b/recipes/unleash-client-cpp/all/test_package/test_package.cpp @@ -1,10 +1,11 @@ #include +#include +#include #include int main() { unleash::UnleashClient unleashClient = unleash::UnleashClient::create("production", "https://www.apple.com/%"); - unleashClient.initializeClient(); - return unleashClient.isEnabled("feature.toogle"); - + std::cout << "feature.toggle - is enabled: " << std::boolalpha << unleashClient.isEnabled("feature.toogle") << '\n'; + return 0; } diff --git a/recipes/unleash-client-cpp/config.yml b/recipes/unleash-client-cpp/config.yml index 60d31991f5141..426a0e4c79e9b 100644 --- a/recipes/unleash-client-cpp/config.yml +++ b/recipes/unleash-client-cpp/config.yml @@ -1,3 +1,3 @@ versions: - "1.1.1": + "1.3.0": folder: all diff --git a/recipes/unordered_dense/all/conandata.yml b/recipes/unordered_dense/all/conandata.yml index 68524cf6fdc7c..5ca5aaa12db58 100644 --- a/recipes/unordered_dense/all/conandata.yml +++ b/recipes/unordered_dense/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "4.5.0": + url: "https://github.com/martinus/unordered_dense/archive/v4.5.0.tar.gz" + sha256: "2364ce4bc4c23bd02549bbb3a7572d881684cd46057f3737fd53be53669743aa" + "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" diff --git a/recipes/unordered_dense/all/test_package/CMakeLists.txt b/recipes/unordered_dense/all/test_package/CMakeLists.txt index b9de8205fed9d..cceeb8417dfbc 100644 --- a/recipes/unordered_dense/all/test_package/CMakeLists.txt +++ b/recipes/unordered_dense/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) diff --git a/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt b/recipes/unordered_dense/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2a9b48732268c..0000000000000 --- a/recipes/unordered_dense/all/test_v1_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(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/unordered_dense/all/test_v1_package/conanfile.py b/recipes/unordered_dense/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/unordered_dense/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/unordered_dense/config.yml b/recipes/unordered_dense/config.yml index dde91314b03cb..a8c5fb226f398 100644 --- a/recipes/unordered_dense/config.yml +++ b/recipes/unordered_dense/config.yml @@ -1,4 +1,10 @@ versions: + "4.5.0": + folder: all + "4.4.0": + folder: all + "4.3.1": + folder: all "4.3.0": folder: all "4.1.2": diff --git a/recipes/unqlite/all/test_package/CMakeLists.txt b/recipes/unqlite/all/test_package/CMakeLists.txt index a726d8ff8063f..711614bc4924b 100644 --- a/recipes/unqlite/all/test_package/CMakeLists.txt +++ b/recipes/unqlite/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(unqlite REQUIRED CONFIG) diff --git a/recipes/unqlite/all/test_v1_package/CMakeLists.txt b/recipes/unqlite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/unqlite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/unqlite/all/test_v1_package/conanfile.py b/recipes/unqlite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/unqlite/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_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/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/test_v1_package/CMakeLists.txt b/recipes/upx/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/upx/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 2b7a8250c9937..0000000000000 --- a/recipes/upx/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,35 +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, 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 index 82a2012232450..c8d87b45ad9b0 100644 --- a/recipes/urdfdom/all/conandata.yml +++ b/recipes/urdfdom/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "4.0.0": + urdfdom: + url: "https://github.com/ros/urdfdom/archive/refs/tags/4.0.0.tar.gz" + sha256: "9848d106dc88dc0b907d5667c09da3ca53241fbcf17e982d8c234fe3e0d6ddcc" + urdfdom_headers: + url: "https://github.com/ros/urdfdom_headers/archive/refs/tags/1.1.1.zip" + sha256: "dde77e3dd96ffa41e2ee0a20bddcd6ef05863e95ce0143ede77130d8cd46c644" "3.1.1": urdfdom: url: "https://github.com/ros/urdfdom/archive/refs/tags/3.1.1.tar.gz" @@ -10,13 +17,20 @@ sources: url: "https://github.com/ros/urdfdom_headers/archive/1fd21b64ed78493508a174f98af982605d1e4607.zip" sha256: "aba42c1c83d6d1fb94e54ec84680a8b9e2417337fbaa85424da0e069d0cc89b6" patches: + "4.0.0": + - patch_file: "patches/4.0.0/001-optional-build-apps.patch" + patch_type: "conan" + patch_description: "Disable building of apps by default" + - patch_file: "patches/4.0.0/002-use-conan-dependencies.patch" + patch_type: "conan" + patch_description: "Use dependencies from Conan, use merged urdfdom_headers" "3.1.1": - - patch_file: "patches/001-optional-build-apps.patch" + - patch_file: "patches/3.1.1/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_file: "patches/3.1.1/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_description: "Use dependencies (console_bridge, TinyXML) from Conan" + - patch_file: "patches/3.1.1/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 index f7a710e7f7ea7..92fdbe4fc111e 100644 --- a/recipes/urdfdom/all/conanfile.py +++ b/recipes/urdfdom/all/conanfile.py @@ -4,6 +4,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, replace_in_file, rm, rmdir +from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -45,7 +46,10 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("tinyxml/2.6.2", transitive_headers=True) + if Version(self.version) >= "4.0": + self.requires("tinyxml2/10.0.0", transitive_headers=True, transitive_libs=True) + else: + self.requires("tinyxml/2.6.2", transitive_headers=True, transitive_libs=True) self.requires("console_bridge/1.0.2") def validate(self): @@ -68,6 +72,8 @@ def generate(self): tc.variables["BUILD_APPS"] = False if not self.options.shared: tc.preprocessor_definitions["URDFDOM_STATIC"] = "1" + # Need to set CMP0077 because CMake policy version is too old (3.5 as of v4.0.0) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() CMakeDeps(self).generate() @@ -84,11 +90,13 @@ def build(self): cmake.build() def package(self): - copy(self, "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() + # Copy urdfdom_headers + copy(self, "*", + src=os.path.join(self.source_folder, "urdf_parser", "include"), + dst=os.path.join(self.package_folder, "include")) 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")) diff --git a/recipes/urdfdom/all/patches/002-use-conan-dependencies.patch b/recipes/urdfdom/all/patches/002-use-conan-dependencies.patch deleted file mode 100644 index cbb6f0fc84fb3..0000000000000 --- a/recipes/urdfdom/all/patches/002-use-conan-dependencies.patch +++ /dev/null @@ -1,83 +0,0 @@ -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 deleted file mode 100644 index b4095fcb7ba42..0000000000000 --- a/recipes/urdfdom/all/patches/003-use-merged-urdfdom_headers.patch +++ /dev/null @@ -1,21 +0,0 @@ -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/patches/001-optional-build-apps.patch b/recipes/urdfdom/all/patches/3.1.1/001-optional-build-apps.patch similarity index 100% rename from recipes/urdfdom/all/patches/001-optional-build-apps.patch rename to recipes/urdfdom/all/patches/3.1.1/001-optional-build-apps.patch diff --git a/recipes/urdfdom/all/patches/3.1.1/002-use-conan-dependencies.patch b/recipes/urdfdom/all/patches/3.1.1/002-use-conan-dependencies.patch new file mode 100644 index 0000000000000..47e25f1f27284 --- /dev/null +++ b/recipes/urdfdom/all/patches/3.1.1/002-use-conan-dependencies.patch @@ -0,0 +1,48 @@ +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/recipes/urdfdom/all/patches/3.1.1/003-use-merged-urdfdom_headers.patch b/recipes/urdfdom/all/patches/3.1.1/003-use-merged-urdfdom_headers.patch new file mode 100644 index 0000000000000..0fc6cb3bfaa91 --- /dev/null +++ b/recipes/urdfdom/all/patches/3.1.1/003-use-merged-urdfdom_headers.patch @@ -0,0 +1,12 @@ +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/recipes/urdfdom/all/patches/4.0.0/001-optional-build-apps.patch b/recipes/urdfdom/all/patches/4.0.0/001-optional-build-apps.patch new file mode 100644 index 0000000000000..65518ddc352d0 --- /dev/null +++ b/recipes/urdfdom/all/patches/4.0.0/001-optional-build-apps.patch @@ -0,0 +1,34 @@ +--- urdf_parser/CMakeLists.txt ++++ urdf_parser/CMakeLists.txt +@@ -81,6 +81,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) +@@ -97,6 +98,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) +@@ -104,6 +106,7 @@ + add_subdirectory(test) + endif() + ++if(BUILD_APPS) + INSTALL( + TARGETS + check_urdf +@@ -114,6 +117,7 @@ + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) ++endif() + INSTALL( + TARGETS + urdfdom_model diff --git a/recipes/urdfdom/all/patches/4.0.0/002-use-conan-dependencies.patch b/recipes/urdfdom/all/patches/4.0.0/002-use-conan-dependencies.patch new file mode 100644 index 0000000000000..9553d1b1c9713 --- /dev/null +++ b/recipes/urdfdom/all/patches/4.0.0/002-use-conan-dependencies.patch @@ -0,0 +1,14 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -45,11 +45,8 @@ + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +-find_package(tinyxml2_vendor QUIET) + find_package(TinyXML2 REQUIRED) + +-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) + + # Control where libraries and executables are placed during the build diff --git a/recipes/urdfdom/config.yml b/recipes/urdfdom/config.yml index fd9669719a7ad..1188e8479ce63 100644 --- a/recipes/urdfdom/config.yml +++ b/recipes/urdfdom/config.yml @@ -1,3 +1,5 @@ versions: + "4.0.0": + folder: all "3.1.1": folder: all diff --git a/recipes/urdfdom_headers/all/conandata.yml b/recipes/urdfdom_headers/all/conandata.yml new file mode 100644 index 0000000000000..9c889de9abc7d --- /dev/null +++ b/recipes/urdfdom_headers/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1.1": + url: "https://github.com/ros/urdfdom_headers/archive/refs/tags/1.1.1.zip" + sha256: "dde77e3dd96ffa41e2ee0a20bddcd6ef05863e95ce0143ede77130d8cd46c644" diff --git a/recipes/urdfdom_headers/all/conanfile.py b/recipes/urdfdom_headers/all/conanfile.py new file mode 100644 index 0000000000000..a374540200186 --- /dev/null +++ b/recipes/urdfdom_headers/all/conanfile.py @@ -0,0 +1,44 @@ +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 PackageConan(ConanFile): + name = "urdfdom_headers" + description = "Headers for URDF parsers" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ros/urdfdom_headers" + topics = ("urdf", "ros", "robotics") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + 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, 11) + + 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")) + # Add a project prefix to the headers to match the default APPEND_PROJECT_NAME_TO_INCLUDEDIR=ON + copy(self, "*.h", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include", "urdfdom")) + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "urdfdom")) + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/urdfdom_headers/all/test_package/CMakeLists.txt b/recipes/urdfdom_headers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..733e7c8f06684 --- /dev/null +++ b/recipes/urdfdom_headers/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package CXX) + +find_package(urdfdom_headers REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE urdfdom_headers::urdfdom_headers) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/urdfdom_headers/all/test_package/conanfile.py b/recipes/urdfdom_headers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ef5d7042163ec --- /dev/null +++ b/recipes/urdfdom_headers/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_headers/all/test_package/test_package.cpp b/recipes/urdfdom_headers/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aa515bd58ffb9 --- /dev/null +++ b/recipes/urdfdom_headers/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + urdf::World world; + return 0; +} diff --git a/recipes/urdfdom_headers/config.yml b/recipes/urdfdom_headers/config.yml new file mode 100644 index 0000000000000..60d31991f5141 --- /dev/null +++ b/recipes/urdfdom_headers/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.1": + folder: all diff --git a/recipes/uriparser/all/conandata.yml b/recipes/uriparser/all/conandata.yml index 2e0f68c6098de..e42d123f7e6e6 100644 --- a/recipes/uriparser/all/conandata.yml +++ b/recipes/uriparser/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.8": + url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.8/uriparser-0.9.8.tar.xz" + sha256: "1d71c054837ea32a31e462bce5a1af272379ecf511e33448e88100b87ff73b2e" "0.9.7": url: "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.7/uriparser-0.9.7.tar.xz" sha256: "1ddae35cb3cc2c36e8199829d46f1c7f8b222e74a723fdae67ec8561e1ac5a39" diff --git a/recipes/uriparser/all/conanfile.py b/recipes/uriparser/all/conanfile.py index 9e901d6027dc5..c8edbccee9815 100644 --- a/recipes/uriparser/all/conanfile.py +++ b/recipes/uriparser/all/conanfile.py @@ -10,10 +10,10 @@ class UriparserConan(ConanFile): name = "uriparser" description = "Strictly RFC 3986 compliant URI parsing and handling library written in C89" - topics = ("uri", "parser") + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://uriparser.github.io/" - license = "BSD-3-Clause" + topics = ("uri", "parser") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { diff --git a/recipes/uriparser/all/test_package/CMakeLists.txt b/recipes/uriparser/all/test_package/CMakeLists.txt index e0af00ef4ec72..ab98d6efacf5d 100644 --- a/recipes/uriparser/all/test_package/CMakeLists.txt +++ b/recipes/uriparser/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(uriparser REQUIRED CONFIG) diff --git a/recipes/uriparser/all/test_v1_package/CMakeLists.txt b/recipes/uriparser/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/uriparser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/uriparser/all/test_v1_package/conanfile.py b/recipes/uriparser/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/uriparser/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_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/uriparser/config.yml b/recipes/uriparser/config.yml index 983b5479ac5be..42a189b84f1e9 100644 --- a/recipes/uriparser/config.yml +++ b/recipes/uriparser/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.8": + folder: "all" "0.9.7": folder: "all" "0.9.6": diff --git a/recipes/userspace-rcu/all/conandata.yml b/recipes/userspace-rcu/all/conandata.yml index 570705edb2dd6..63079c64c1840 100644 --- a/recipes/userspace-rcu/all/conandata.yml +++ b/recipes/userspace-rcu/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.14.0": + url: "https://github.com/urcu/userspace-rcu/archive/refs/tags/v0.14.0.tar.gz" + sha256: "42fb5129a3fffe5a4b790dfe1ea3a734c69ee095fefbf649326269bba94c262d" "0.11.4": - sha256: d995598482221587ff6753d2a8da6ac74ff0fa79fbea29ccee196f295834531d - url: https://github.com/urcu/userspace-rcu/archive/refs/tags/v0.11.4.tar.gz + url: "https://github.com/urcu/userspace-rcu/archive/refs/tags/v0.11.4.tar.gz" + sha256: "d995598482221587ff6753d2a8da6ac74ff0fa79fbea29ccee196f295834531d" diff --git a/recipes/userspace-rcu/all/conanfile.py b/recipes/userspace-rcu/all/conanfile.py index ad697812f9c26..bc82bbc3b711b 100644 --- a/recipes/userspace-rcu/all/conanfile.py +++ b/recipes/userspace-rcu/all/conanfile.py @@ -1,28 +1,25 @@ import os -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conan.tools.files import get, rmdir -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +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 -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class UserspaceRCUConan(ConanFile): name = "userspace-rcu" - homepage ="https://liburcu.org/" description = "Userspace RCU (read-copy-update) library" - topics = ("urcu") - url = "https://github.com/conan-io/conan-center-index" license = "LGPL-2.1" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://liburcu.org/" + topics = "urcu" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - settings = "os", "compiler", "build_type", "arch" - + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -31,65 +28,58 @@ def _source_subfolder(self): "shared": False, "fPIC": True, } - build_requires = ( - "libtool/2.4.6", - ) - generators = "PkgConfigDeps" + 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 self.settings.os not in ["Linux", "FreeBSD", "Macos"]: - raise ConanInvalidConfiguration("Building for {} unsupported".format(self.settings.os)) + raise ConanInvalidConfiguration(f"Building for {self.settings.os} unsupported") + if self.version == "0.11.4" and self.settings.compiler == "apple-clang": + # Fails with "cds_hlist_add_head_rcu.c:19:10: fatal error: 'urcu/urcu-memb.h' file not found" + raise ConanInvalidConfiguration(f"{self.ref} is not compatible with apple-clang") - def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - if self.options.shared: - del self.options.fPIC + def build_requirements(self): + 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) - self._autotools.libs = [] - 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)), - ] - 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() + tc = AutotoolsToolchain(self) + tc.generate() def build(self): - with tools.chdir(self._source_subfolder): - self.run("./bootstrap") - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() autotools.make() def package(self): - self.copy(pattern="LICENSE*", src=self._source_subfolder, dst="licenses") - autotools = self._configure_autotools() + copy(self, "LICENSE*", + 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") + rm(self, "*.la", self.package_folder, recursive=True) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): for lib_type in ["", "-bp", "-cds", "-mb", "-memb", "-qsbr", "-signal"]: - component_name = "urcu{}".format(lib_type) + component_name = f"urcu{lib_type}" self.cpp_info.components[component_name].libs = ["urcu-common", component_name] self.cpp_info.components[component_name].set_property("pkg_config_name", component_name) - self.cpp_info.components[component_name].names["pkg_config"] = component_name - # todo Remove in Conan version 1.50.0 where these are set by default for the PkgConfigDeps generator. - self.cpp_info.components[component_name].includedirs = ["include"] - self.cpp_info.components[component_name].libdirs = ["lib"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components[component_name].system_libs = ["pthread"] # Some definitions needed for MB and Signal variants diff --git a/recipes/userspace-rcu/all/test_package/CMakeLists.txt b/recipes/userspace-rcu/all/test_package/CMakeLists.txt index 2afe258693778..3dbdbb9223703 100644 --- a/recipes/userspace-rcu/all/test_package/CMakeLists.txt +++ b/recipes/userspace-rcu/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(test_package) +project(test_package LANGUAGES C) find_package(userspace-rcu COMPONENTS urcu REQUIRED) diff --git a/recipes/userspace-rcu/all/test_package/conanfile.py b/recipes/userspace-rcu/all/test_package/conanfile.py index 78d6ce7aad715..28dc52eddfee5 100644 --- a/recipes/userspace-rcu/all/test_package/conanfile.py +++ b/recipes/userspace-rcu/all/test_package/conanfile.py @@ -1,15 +1,23 @@ +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 TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" 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 requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -17,6 +25,7 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): + if can_run(self): for test in ["", "-mb", "-signal"]: - self.run("test_package{}".format(test), run_environment=True) + bin_path = os.path.join(self.cpp.build.bindir, f"test_package{test}") + self.run(bin_path, env="conanrun") diff --git a/recipes/userspace-rcu/config.yml b/recipes/userspace-rcu/config.yml index 813707cc5417d..8246204055b2f 100644 --- a/recipes/userspace-rcu/config.yml +++ b/recipes/userspace-rcu/config.yml @@ -1,3 +1,5 @@ versions: + "0.14.0": + folder: all "0.11.4": folder: all diff --git a/recipes/usockets/all/conandata.yml b/recipes/usockets/all/conandata.yml index 1e162a7179edd..3fbcf6ef2a19d 100644 --- a/recipes/usockets/all/conandata.yml +++ b/recipes/usockets/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.8.8": + url: "https://github.com/uNetworking/uSockets/archive/v0.8.8.tar.gz" + sha256: "d14d2efe1df767dbebfb8d6f5b52aa952faf66b30c822fbe464debaa0c5c0b17" + "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" @@ -24,6 +30,14 @@ sources: url: "https://github.com/uNetworking/uSockets/archive/v0.4.0.tar.gz" sha256: "f9f15b395def578cc79a5b32abc64fa9cff5dac873062911f515b984b90f7cc2" patches: + "0.8.8": + - patch_file: "patches/0001-makefile_0.8.6.patch" + patch_description: "remove lto options" + patch_type: "portability" + "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" diff --git a/recipes/usockets/all/test_package/CMakeLists.txt b/recipes/usockets/all/test_package/CMakeLists.txt index be191d27f55a9..9bb9c81cbf524 100644 --- a/recipes/usockets/all/test_package/CMakeLists.txt +++ b/recipes/usockets/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(usockets REQUIRED CONFIG) diff --git a/recipes/usockets/config.yml b/recipes/usockets/config.yml index ed2a319a00e8b..a6ec735be30d3 100644 --- a/recipes/usockets/config.yml +++ b/recipes/usockets/config.yml @@ -1,4 +1,8 @@ versions: + "0.8.8": + folder: all + "0.8.7": + folder: all "0.8.6": folder: all "0.8.5": diff --git a/recipes/usrsctp/all/test_v1_package/CMakeLists.txt b/recipes/usrsctp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/usrsctp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/usrsctp/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", "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/conandata.yml b/recipes/utf8.h/all/conandata.yml index 8841db197744f..35ff55cfedc3d 100644 --- a/recipes/utf8.h/all/conandata.yml +++ b/recipes/utf8.h/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20240202": + url: "https://github.com/sheredom/utf8.h/archive/2aa5709fe39c66d2868c0d52d42788899b90dc92.tar.gz" + sha256: "1cce8cad2ab17b9ac4e59c8b06fa6f2bdf729893c7061b734164f2e87ff9f7f9" "cci.20210310": url: "https://github.com/sheredom/utf8.h/archive/ee5a7d4beb7755da13e4d4ec3eccfb65a0530456.tar.gz" sha256: "d7c9ad480b640c76292a1c4b9735497fd635cb8828e95beabb7db91ea4cecf55" diff --git a/recipes/utf8.h/all/test_package/CMakeLists.txt b/recipes/utf8.h/all/test_package/CMakeLists.txt index 59a397c341a04..2a48cc86e2dfe 100644 --- a/recipes/utf8.h/all/test_package/CMakeLists.txt +++ b/recipes/utf8.h/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(utf8.h REQUIRED CONFIG) diff --git a/recipes/utf8.h/all/test_package/test_package.cpp b/recipes/utf8.h/all/test_package/test_package.cpp index fd1eef99eafd8..66c337dd316fb 100644 --- a/recipes/utf8.h/all/test_package/test_package.cpp +++ b/recipes/utf8.h/all/test_package/test_package.cpp @@ -1,3 +1,9 @@ +#if defined(__cplusplus) && __cplusplus >= 202002L +using char_type = char8_t; +#else +typedef char char_type; +#endif + #include "utf8.h" int main() @@ -7,7 +13,7 @@ int main() char str[] = {'\xcf', '\xb4', '\xce', '\xb8', '\xce', '\x98', '\xcf', '\x91', '\0'}; - int r = utf8ncasecmp(ref, str, 8); + int r = utf8ncasecmp(reinterpret_cast(ref), reinterpret_cast(str), 8); return 0; } diff --git a/recipes/utf8.h/all/test_v1_package/CMakeLists.txt b/recipes/utf8.h/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/utf8.h/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/utf8.h/all/test_v1_package/conanfile.py b/recipes/utf8.h/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/utf8.h/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_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/utf8.h/config.yml b/recipes/utf8.h/config.yml index dc79ecf2dafac..fad837c21119c 100644 --- a/recipes/utf8.h/config.yml +++ b/recipes/utf8.h/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20240202": + folder: all "cci.20210310": folder: all diff --git a/recipes/utf8proc/all/conanfile.py b/recipes/utf8proc/all/conanfile.py index 39b2b7b1cced3..b29bd524f9724 100644 --- a/recipes/utf8proc/all/conanfile.py +++ b/recipes/utf8proc/all/conanfile.py @@ -2,9 +2,10 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout 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.53.0" +required_conan_version = ">=2.1" class Utf8ProcConan(ConanFile): @@ -44,6 +45,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "2.10.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): diff --git a/recipes/utf8proc/all/test_package/CMakeLists.txt b/recipes/utf8proc/all/test_package/CMakeLists.txt index 55f8f30732e29..f1607b5ca2a21 100644 --- a/recipes/utf8proc/all/test_package/CMakeLists.txt +++ b/recipes/utf8proc/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(utf8proc REQUIRED CONFIG) diff --git a/recipes/utf8proc/all/test_v1_package/CMakeLists.txt b/recipes/utf8proc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 93470a5a40dd5..0000000000000 --- a/recipes/utf8proc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(utf8proc REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE utf8proc::utf8proc) diff --git a/recipes/utf8proc/all/test_v1_package/conanfile.py b/recipes/utf8proc/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/utf8proc/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_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/utfcpp/all/conandata.yml b/recipes/utfcpp/all/conandata.yml index f78d79ff038b9..d1a732d445794 100644 --- a/recipes/utfcpp/all/conandata.yml +++ b/recipes/utfcpp/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.0.5": + url: "https://github.com/nemtrif/utfcpp/archive/v4.0.5.tar.gz" + sha256: "ffc668a310e77607d393f3c18b32715f223da1eac4c4d6e0579a11df8e6b59cf" + "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" @@ -8,27 +14,9 @@ sources: "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" - "3.2.2": - url: "https://github.com/nemtrif/utfcpp/archive/v3.2.2.tar.gz" - sha256: "6f81e7cb2be2a6a9109a8a0cb7dc39ec947f1bcdb5dfa4a660e11a23face19f5" - "3.2.1": - url: "https://github.com/nemtrif/utfcpp/archive/refs/tags/v3.2.1.tar.gz" - sha256: "8d6aa7d77ad0abb35bb6139cb9a33597ac4c5b33da6a004ae42429b8598c9605" - "3.2": - url: "https://github.com/nemtrif/utfcpp/archive/v3.2.tar.gz" - sha256: "cd4f9a66d23dc385bd7ea11bc0abfda8ea1ad1dcf5cd6d3a27bc551e86436364" "3.1.2": url: "https://github.com/nemtrif/utfcpp/archive/v3.1.2.tar.gz" sha256: "fea3bfa39fb8bd7368077ea5e1e0db9a8951f7e6fb6d9400b00ab3d92b807c6d" - "3.1.1": - url: "https://github.com/nemtrif/utfcpp/archive/v3.1.1.tar.gz" - sha256: "33496a4c3cc2de80e9809c4997052331af5fb32079f43ab4d667cd48c3a36e88" - "3.1": - url: "https://github.com/nemtrif/utfcpp/archive/v3.1.tar.gz" - sha256: "ab531c3fd5d275150430bfaca01d7d15e017a188183be932322f2f651506b096" diff --git a/recipes/utfcpp/all/conanfile.py b/recipes/utfcpp/all/conanfile.py index 247b54396ade2..23b9e402630b2 100644 --- a/recipes/utfcpp/all/conanfile.py +++ b/recipes/utfcpp/all/conanfile.py @@ -9,27 +9,24 @@ class UtfCppConan(ConanFile): name = "utfcpp" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/nemtrif/utfcpp" description = "UTF-8 with C++ in a Portable Way" - topics = ("utf", "utf8", "unicode", "text") license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/nemtrif/utfcpp" + topics = ("utf", "utf8", "unicode", "text", "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], 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, "*.h", src=os.path.join(self.source_folder, "source"), diff --git a/recipes/utfcpp/all/test_package/CMakeLists.txt b/recipes/utfcpp/all/test_package/CMakeLists.txt index 7624c13618914..163d283567e85 100644 --- a/recipes/utfcpp/all/test_package/CMakeLists.txt +++ b/recipes/utfcpp/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(utf8cpp REQUIRED CONFIG) diff --git a/recipes/utfcpp/all/test_package/conanfile.py b/recipes/utfcpp/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/utfcpp/all/test_package/conanfile.py +++ b/recipes/utfcpp/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/utfcpp/all/test_v1_package/CMakeLists.txt b/recipes/utfcpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/utfcpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/utfcpp/all/test_v1_package/conanfile.py b/recipes/utfcpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/utfcpp/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_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/utfcpp/config.yml b/recipes/utfcpp/config.yml index eabfdbf69a0cc..93af14ff8ed78 100644 --- a/recipes/utfcpp/config.yml +++ b/recipes/utfcpp/config.yml @@ -1,23 +1,15 @@ versions: + "4.0.5": + folder: all + "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": - folder: all - "3.2.1": - folder: all - "3.2": - folder: all "3.1.2": folder: all - "3.1.1": - folder: all - "3.1": - folder: all diff --git a/recipes/util-linux-libuuid/all/conanfile.py b/recipes/util-linux-libuuid/all/conanfile.py index e5c35fe2c862b..33b4289d276d1 100644 --- a/recipes/util-linux-libuuid/all/conanfile.py +++ b/recipes/util-linux-libuuid/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, XCRun from conan.tools.files import copy, get, rm, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps from conan.tools.layout import basic_layout @@ -23,10 +23,12 @@ class UtilLinuxLibuuidConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_python_bindings": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_python_bindings": True, } @property @@ -73,7 +75,7 @@ def validate(self): 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") + self.requires("libgettext/0.22") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -82,10 +84,28 @@ def generate(self): tc = AutotoolsToolchain(self) tc.configure_args.append("--disable-all-programs") tc.configure_args.append("--enable-libuuid") + if not self.options.with_python_bindings: + tc.configure_args.append("--without-python") 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") + + # 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": + tc.configure_args.append("--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) + tc.generate() deps = AutotoolsDeps(self) diff --git a/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt b/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt index 75c717f769900..c8d7b49af9ba0 100644 --- a/recipes/util-linux-libuuid/all/test_package/CMakeLists.txt +++ b/recipes/util-linux-libuuid/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 C) find_package(libuuid REQUIRED CONFIG) diff --git a/recipes/uvw/all/conandata.yml b/recipes/uvw/all/conandata.yml index 2ce44b1f85239..9e2f0333781b4 100644 --- a/recipes/uvw/all/conandata.yml +++ b/recipes/uvw/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.4.0": + url: "https://github.com/skypjack/uvw/archive/v3.4.0_libuv_v1.48.tar.gz" + sha256: "c16600573871a5feeb524234b378ab832c8971b2a68d030c6bd0e3077d416ade" + "3.3.0": + url: "https://github.com/skypjack/uvw/archive/v3.3.0_libuv_v1.47.tar.gz" + sha256: "aabb17d3d8f0b3481b44e981c889dd4a2a6a3f1a96a4d01055e669f4b7d37d0e" "3.2.0": url: "https://github.com/skypjack/uvw/archive/v3.2.0_libuv_v1.46.tar.gz" sha256: "bd5aed741765950074b1ea2507291dce81e528abdf56c406991ad4a27d8d1714" @@ -14,3 +20,11 @@ sources: "2.10.0": url: "https://github.com/skypjack/uvw/archive/v2.10.0_libuv_v1.42.tar.gz" sha256: "30b0ba97a94d5e652490c6b1b32c95e608263f21cf3bc606308d09b3e3a114bf" +libuv_version_mapping: + "3.4.0": "1.48.0" + "3.3.0": "1.47.0" + "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/conanfile.py b/recipes/uvw/all/conanfile.py index af145be3d5ce2..b1ed6df28cbd3 100644 --- a/recipes/uvw/all/conanfile.py +++ b/recipes/uvw/all/conanfile.py @@ -37,13 +37,7 @@ 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", - }[self.version] + return self.conan_data["libuv_version_mapping"][self.version] def layout(self): basic_layout(self, src_folder="src") diff --git a/recipes/uvw/all/test_package/CMakeLists.txt b/recipes/uvw/all/test_package/CMakeLists.txt index 1bad80ec9ab42..3e22f75feda52 100644 --- a/recipes/uvw/all/test_package/CMakeLists.txt +++ b/recipes/uvw/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(uvw REQUIRED CONFIG) diff --git a/recipes/uvw/all/test_v1_package/CMakeLists.txt b/recipes/uvw/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/uvw/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/uvw/all/test_v1_package/conanfile.py b/recipes/uvw/all/test_v1_package/conanfile.py deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/uvw/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", "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/uvw/config.yml b/recipes/uvw/config.yml index f7ecad1e5c9ed..652dbe6c9d518 100644 --- a/recipes/uvw/config.yml +++ b/recipes/uvw/config.yml @@ -1,4 +1,8 @@ versions: + "3.4.0": + folder: "all" + "3.3.0": + folder: "all" "3.2.0": folder: "all" "3.1.0": diff --git a/recipes/uwebsockets/all/conandata.yml b/recipes/uwebsockets/all/conandata.yml index 2c922cffaec96..aba7eaeb3cf13 100644 --- a/recipes/uwebsockets/all/conandata.yml +++ b/recipes/uwebsockets/all/conandata.yml @@ -1,19 +1,14 @@ sources: - "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" - "18.3.0": - url: "https://github.com/uNetworking/uWebSockets/archive/v18.3.0.tar.gz" - sha256: "f51317e2a8cd743e6ff9dfd215569824eaca489c24f7d8fd94eaca44443a9728" + "20.71.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.71.0.tar.gz" + sha256: "1e4e7bfa379dd8096182d0b47ae648c7bcf93be4a4130ad6e7625ed1d46aec1d" + "20.70.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.70.0.tar.gz" + sha256: "39a7e32182df2da02955ab1c1681af9710c82115075f4caabb8689a2c04460b9" + "20.68.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.68.0.tar.gz" + sha256: "02dd1dd2925c639c01222d19f4ddd6fe12261571bcb3befc7eedaf8fa75c008f" + # keep 20.62.0, the last version to provide C-API + "20.62.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.62.0.tar.gz" + sha256: "03dfc8037cf43856a41e64bbc7fc5a7cf5e6369c9158682753074ecbbe09eed1" diff --git a/recipes/uwebsockets/all/conanfile.py b/recipes/uwebsockets/all/conanfile.py index 4598157564eba..3d26f6147da48 100644 --- a/recipes/uwebsockets/all/conanfile.py +++ b/recipes/uwebsockets/all/conanfile.py @@ -36,33 +36,20 @@ def _compilers_minimum_version(self): return { "Visual Studio": "15", "msvc": "191", - "gcc": "7" if Version(self.version) < "20.11.0" else "8", - "clang": "5" if Version(self.version) < "20.11.0" else "7", + "gcc": "8", + "clang": "7", "apple-clang": "10", } - def config_options(self): - # libdeflate is not supported before 19.0.0 - if Version(self.version) < "19.0.0": - del self.options.with_libdeflate - def layout(self): basic_layout(self, src_folder="src") def requirements(self): if self.options.with_zlib: self.requires("zlib/[>=1.2.11 <2]") - if self.options.get_safe("with_libdeflate"): - self.requires("libdeflate/1.14") - - if Version(self.version) > "20.17.0": - self.requires("usockets/0.8.6") - elif Version(self.version) >= "20.15.0": - self.requires("usockets/0.8.2") - elif Version(self.version) >= "19.0.0": - self.requires("usockets/0.8.1") - else: - self.requires("usockets/0.4.0") + if self.options.with_libdeflate: + self.requires("libdeflate/1.22") + self.requires("usockets/0.8.8") def package_id(self): self.info.clear() @@ -76,7 +63,7 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if Version(self.version) >= "20.14.0" and self.settings.compiler == "clang" and str(self.settings.compiler.libcxx) == "libstdc++": + if self.settings.compiler == "clang" and str(self.settings.compiler.libcxx) == "libstdc++": raise ConanInvalidConfiguration(f"{self.ref} needs recent libstdc++ with charconv.") def source(self): @@ -103,7 +90,7 @@ def package_info(self): if not self.options.with_zlib: self.cpp_info.defines.append("UWS_NO_ZLIB") - if self.options.get_safe("with_libdeflate"): + if self.options.with_libdeflate: self.cpp_info.defines.append("UWS_USE_LIBDEFLATE") self.cpp_info.includedirs.append(os.path.join("include", "uWebSockets")) diff --git a/recipes/uwebsockets/all/test_package/CMakeLists.txt b/recipes/uwebsockets/all/test_package/CMakeLists.txt index 38145240aeafa..6daf8971779b9 100644 --- a/recipes/uwebsockets/all/test_package/CMakeLists.txt +++ b/recipes/uwebsockets/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(uwebsockets REQUIRED CONFIG) diff --git a/recipes/uwebsockets/all/test_v1_package/CMakeLists.txt b/recipes/uwebsockets/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/uwebsockets/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/uwebsockets/all/test_v1_package/conanfile.py b/recipes/uwebsockets/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/uwebsockets/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/uwebsockets/config.yml b/recipes/uwebsockets/config.yml index d714e6b31716a..6f032823722ef 100644 --- a/recipes/uwebsockets/config.yml +++ b/recipes/uwebsockets/config.yml @@ -1,13 +1,9 @@ versions: - "20.49.0": + "20.71.0": folder: all - "20.48.0": + "20.70.0": folder: all - "20.47.0": + "20.68.0": folder: all - "20.45.0": - folder: all - "19.3.0": - folder: all - "18.3.0": + "20.62.0": # keeping it since it's the last to provide the C-API (this needs to be reviewed) folder: all diff --git a/recipes/v-hacd/all/test_package/CMakeLists.txt b/recipes/v-hacd/all/test_package/CMakeLists.txt index 188e6c3aff9e2..7367430b7155b 100644 --- a/recipes/v-hacd/all/test_package/CMakeLists.txt +++ b/recipes/v-hacd/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(v-hacd REQUIRED CONFIG) diff --git a/recipes/v-hacd/all/test_v1_package/CMakeLists.txt b/recipes/v-hacd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/v-hacd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/v-hacd/all/test_v1_package/conanfile.py b/recipes/v-hacd/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/v-hacd/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_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/vaapi/all/test_package/CMakeLists.txt b/recipes/vaapi/all/test_package/CMakeLists.txt index 1cc7d1fad52a6..a5f44879bc6eb 100644 --- a/recipes/vaapi/all/test_package/CMakeLists.txt +++ b/recipes/vaapi/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(xorg REQUIRED CONFIG) diff --git a/recipes/vaapi/all/test_v1_package/CMakeLists.txt b/recipes/vaapi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2f5bce0e6460d..0000000000000 --- a/recipes/vaapi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -set(SOURCES ../test_package/test_package.c) - -add_executable(${PROJECT_NAME} ${SOURCES}) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/vaapi/all/test_v1_package/conanfile.py b/recipes/vaapi/all/test_v1_package/conanfile.py deleted file mode 100644 index 1b482d65b9b4e..0000000000000 --- a/recipes/vaapi/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - requires = ("xorg/system",) - - 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/valijson/all/conandata.yml b/recipes/valijson/all/conandata.yml index 9c69d92d45720..3db6eca065b46 100644 --- a/recipes/valijson/all/conandata.yml +++ b/recipes/valijson/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.3": + url: "https://github.com/tristanpenman/valijson/archive/v1.0.3.tar.gz" + sha256: "0fbd3cd2312b441c6373ee116e9a162c400f9e3cd79f6b32665cdd22fa11ac3f" "1.0.2": url: "https://github.com/tristanpenman/valijson/archive/v1.0.2.tar.gz" sha256: "35d86e54fc727f1265226434dc996e33000a570f833537a25c8b702b0b824431" diff --git a/recipes/valijson/all/test_package/CMakeLists.txt b/recipes/valijson/all/test_package/CMakeLists.txt index 9fa0294a2d6c6..98dfbe86b7d4c 100644 --- a/recipes/valijson/all/test_package/CMakeLists.txt +++ b/recipes/valijson/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(ValiJSON REQUIRED CONFIG) diff --git a/recipes/valijson/all/test_v1_package/CMakeLists.txt b/recipes/valijson/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index a2f6329c538d2..0000000000000 --- a/recipes/valijson/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(ValiJSON REQUIRED CONFIG) -find_package(nlohmann_json REQUIRED CONFIG) -find_package(picojson REQUIRED CONFIG) -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 -) -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 deleted file mode 100644 index f02d6b2bb8320..0000000000000 --- a/recipes/valijson/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,25 +0,0 @@ -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 requirements(self): - 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.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 2244034e46866..b8be269bc2d5e 100644 --- a/recipes/valijson/config.yml +++ b/recipes/valijson/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.3": + folder: "all" "1.0.2": folder: "all" "1.0.1": diff --git a/recipes/variant-lite/all/test_package/CMakeLists.txt b/recipes/variant-lite/all/test_package/CMakeLists.txt index a1eed7de87b18..b71d53d33280a 100644 --- a/recipes/variant-lite/all/test_package/CMakeLists.txt +++ b/recipes/variant-lite/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(variant-lite REQUIRED CONFIG) diff --git a/recipes/variant-lite/all/test_v1_package/CMakeLists.txt b/recipes/variant-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7c27a523717ef..0000000000000 --- a/recipes/variant-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(variant-lite REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE nonstd::variant-lite) diff --git a/recipes/variant-lite/all/test_v1_package/conanfile.py b/recipes/variant-lite/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/variant-lite/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_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/vc/all/conanfile.py b/recipes/vc/all/conanfile.py index 12e8e45ebe604..6cac303b2dcc2 100644 --- a/recipes/vc/all/conanfile.py +++ b/recipes/vc/all/conanfile.py @@ -2,9 +2,10 @@ 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, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=2.1" class VcConan(ConanFile): @@ -39,6 +40,12 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + if Version(self.version) < "1.4.5": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + + if self.settings.os == "Macos" and self.settings.arch == "x86_64": + # set a compatible baseline with macs from 2015 onwards + tc.cache_variables["TARGET_ARCHITECTURE"] = "broadwell" tc.generate() def _patch_sources(self): @@ -61,7 +68,3 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "Vc") self.cpp_info.set_property("cmake_target_name", "Vc::Vc") self.cpp_info.libs = ["Vc"] - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "Vc" - self.cpp_info.names["cmake_find_package_multi"] = "Vc" diff --git a/recipes/vc/all/test_package/CMakeLists.txt b/recipes/vc/all/test_package/CMakeLists.txt index f92c2d97f3154..a53ab39d692d7 100644 --- a/recipes/vc/all/test_package/CMakeLists.txt +++ b/recipes/vc/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(Vc REQUIRED CONFIG) diff --git a/recipes/vc/all/test_v1_package/CMakeLists.txt b/recipes/vc/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/vc/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/vc/all/test_v1_package/conanfile.py b/recipes/vc/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/vc/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_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/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/test_package/CMakeLists.txt b/recipes/vcglib/all/test_package/CMakeLists.txt index e31ccdde007c2..e976c9189a34a 100644 --- a/recipes/vcglib/all/test_package/CMakeLists.txt +++ b/recipes/vcglib/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(vcglib REQUIRED CONFIG) diff --git a/recipes/vcglib/all/test_v1_package/CMakeLists.txt b/recipes/vcglib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/vcglib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/vcglib/all/test_v1_package/conanfile.py b/recipes/vcglib/all/test_v1_package/conanfile.py deleted file mode 100644 index 4d2909d5e4d45..0000000000000 --- a/recipes/vcglib/all/test_v1_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 = os.path.join("bin", "test_package") - obj_path = os.path.join(self.source_folder, os.pardir, "test_package", "cube.obj") - self.run(f"{bin_path} {obj_path}", run_environment=True) 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/vdpau/all/test_package/CMakeLists.txt b/recipes/vdpau/all/test_package/CMakeLists.txt index 0fe5a1d45c245..c7fa6f6d0bb7d 100644 --- a/recipes/vdpau/all/test_package/CMakeLists.txt +++ b/recipes/vdpau/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(PkgConfig) diff --git a/recipes/vdpau/all/test_v1_package/CMakeLists.txt b/recipes/vdpau/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9dfdf0083dcd8..0000000000000 --- a/recipes/vdpau/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +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/test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/vdpau/all/test_v1_package/conanfile.py b/recipes/vdpau/all/test_v1_package/conanfile.py deleted file mode 100644 index 1b482d65b9b4e..0000000000000 --- a/recipes/vdpau/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - requires = ("xorg/system",) - - 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/vectorclass/all/test_package/CMakeLists.txt b/recipes/vectorclass/all/test_package/CMakeLists.txt index b10c5c90bde2f..3c2d73e785e07 100644 --- a/recipes/vectorclass/all/test_package/CMakeLists.txt +++ b/recipes/vectorclass/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(vectorclass REQUIRED CONFIG) diff --git a/recipes/vectorclass/all/test_v1_package/CMakeLists.txt b/recipes/vectorclass/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/vectorclass/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/vectorclass/all/test_v1_package/conanfile.py b/recipes/vectorclass/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/vectorclass/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_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/vectorial/all/test_package/CMakeLists.txt b/recipes/vectorial/all/test_package/CMakeLists.txt index ed8a803f47fad..6cf9e6308f775 100644 --- a/recipes/vectorial/all/test_package/CMakeLists.txt +++ b/recipes/vectorial/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(vectorial REQUIRED CONFIG) diff --git a/recipes/vectorial/all/test_v1_package/CMakeLists.txt b/recipes/vectorial/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/vectorial/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/vectorial/all/test_v1_package/conanfile.py b/recipes/vectorial/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/vectorial/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_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/vectorscan/all/conandata.yml b/recipes/vectorscan/all/conandata.yml new file mode 100644 index 0000000000000..d727d7a8bd55c --- /dev/null +++ b/recipes/vectorscan/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "5.4.11": + url: "https://github.com/VectorCamp/vectorscan/archive/refs/tags/vectorscan/5.4.11.tar.gz" + sha256: "905f76ad1fa9e4ae0eb28232cac98afdb96c479666202c5a4c27871fb30a2711" +patches: + "5.4.11": + - patch_file: "patches/5.4.11-0001-fix-cmake.patch" + patch_description: "modify cmake files to build with conan" + patch_type: "conan" diff --git a/recipes/vectorscan/all/conanfile.py b/recipes/vectorscan/all/conanfile.py new file mode 100644 index 0000000000000..920ea3ac537af --- /dev/null +++ b/recipes/vectorscan/all/conanfile.py @@ -0,0 +1,167 @@ +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.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +import os + +required_conan_version = ">=2" + + +class VectorscanConan(ConanFile): + name = "vectorscan" + description = "A portable fork of the high-performance regular expression matching library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/VectorCamp/vectorscan" + topics = ("regex", "regular expressions", "hyperscan") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "debug_output": [True, False], + "dump_support": [True, False, "auto"], + "with_cpu_native": [True, False], + "with_fat_runtime": [True, False], + "with_avx": [False, "avx2", "avx512", "avx512vbmi"], + "with_sve": [False, "sve", "sve2", "sve2_bitperm"], + "with_chimera": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "debug_output": False, + "dump_support": "auto", + "with_cpu_native": False, + "with_fat_runtime": False, + "with_avx": False, + "with_sve": False, + "with_chimera": False, + } + + 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_fat_runtime + if self.settings.arch not in ["x86", "x86_64"]: + del self.options.with_avx + if str(self.settings.arch).startswith("arm"): + del self.options.with_sve + + def configure(self): + if self.options.shared or self.options.with_cpu_native: + self.options.rm_safe("fPIC") + if self.options.with_cpu_native: + self.options.rm_safe("with_fat_runtime") + if self.options.get_safe("with_fat_runtime"): + self.options.rm_safe("with_avx") + self.options.rm_safe("with_sve") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.86.0") + self.requires("simde/0.8.2") + if self.options.with_chimera: + self.requires("pcre/8.45") + + def validate(self): + check_min_cppstd(self, 17) + if self.options.shared and self.options.with_chimera: + raise ConanInvalidConfiguration("Chimera build requires static building") + if self.settings.compiler == "msvc": + raise ConanInvalidConfiguration("MSVC is not supported by upstream build scripts") + + def validate_build(self): + if self.settings.os == "Macos" and cross_building(self): + raise ConanInvalidConfiguration("Cross-building is not supported on macOS") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.18.4 <4]") + self.tool_requires("ragel/6.10") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + tc.variables["DEBUG_OUTPUT"] = self.options.debug_output + if self.options.dump_support != "auto": + tc.variables["DUMP_SUPPORT"] = self.options.dump_support + if "with_cpu_native" in self.options: + tc.variables["WITH_CPU_NATIVE"] = self.options.with_cpu_native + if "with_fat_runtime" in self.options: + tc.variables["WITH_FAT_RUNTIME"] = self.options.with_fat_runtime + if "with_avx" in self.options: + if not self.options.with_avx: + tc.cache_variables["BUILD_AVX2"] = False + elif self.options.with_avx == "avx2": + tc.cache_variables["BUILD_AVX2"] = True + elif self.options.with_avx == "avx512": + tc.variables["BUILD_AVX512"] = True + elif self.options.with_avx == "avx512vbmi": + tc.variables["BUILD_AVX512VBMI"] = True + if "with_sve" in self.options: + if not self.options.with_sve: + tc.cache_variables["BUILD_SVE"] = False + elif self.options.with_sve == "sve": + tc.cache_variables["BUILD_SVE"] = True + elif self.options.with_sve == "sve2": + tc.cache_variables["BUILD_SVE2"] = True + elif self.options.with_sve == "sve2_bitperm": + tc.cache_variables["BUILD_SVE2_BITPERM"] = True + tc.cache_variables["BUILD_CHIMERA"] = self.options.with_chimera + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_BENCHMARKS"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.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", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + hs_include_dir = os.path.join("include", "hs") + self.cpp_info.components["hs"].set_property("pkg_config_name", "libhs") + self.cpp_info.components["hs"].set_property("cmake_target_name", "hs") + self.cpp_info.components["hs"].libs = ["hs"] + self.cpp_info.components["hs"].requires = ["boost::headers", "simde::simde"] + self.cpp_info.components["hs"].includedirs = [hs_include_dir] + + self.cpp_info.components["hs_runtime"].libs = ["hs_runtime"] + self.cpp_info.components["hs_runtime"].includedirs = [hs_include_dir] + + if self.options.with_chimera: + self.cpp_info.components["chimera"].set_property("pkg_config_name", "libch") + self.cpp_info.components["chimera"].set_property("cmake_target_name", "chimera") + self.cpp_info.components["chimera"].libs = ["chimera"] + self.cpp_info.components["chimera"].requires = ["pcre::libpcre", "hs"] + self.cpp_info.components["chimera"].includedirs = [hs_include_dir] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["hs"].system_libs = ["m"] + self.cpp_info.components["hs_runtime"].system_libs = ["m"] + + if self.options.with_chimera: + self.cpp_info.components["chimera"].system_libs = ["m"] diff --git a/recipes/vectorscan/all/patches/5.4.11-0001-fix-cmake.patch b/recipes/vectorscan/all/patches/5.4.11-0001-fix-cmake.patch new file mode 100644 index 0000000000000..3e9a9da0f9c42 --- /dev/null +++ b/recipes/vectorscan/all/patches/5.4.11-0001-fix-cmake.patch @@ -0,0 +1,89 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1db128b..9838d6f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1194,9 +1194,9 @@ if (NOT BUILD_STATIC_LIBS) + endif () + + add_subdirectory(util) +-add_subdirectory(unit) ++# add_subdirectory(unit) + +-if (EXISTS ${CMAKE_SOURCE_DIR}/tools/CMakeLists.txt) ++if (0) + add_subdirectory(tools) + endif() + if (EXISTS ${CMAKE_SOURCE_DIR}/chimera/CMakeLists.txt AND BUILD_CHIMERA) +diff --git a/chimera/CMakeLists.txt b/chimera/CMakeLists.txt +index c3c50c3..d93fb5b 100644 +--- a/chimera/CMakeLists.txt ++++ b/chimera/CMakeLists.txt +@@ -1,6 +1,6 @@ + # Chimera lib + +-include_directories(${PCRE_INCLUDE_DIRS}) ++find_package(pcre REQUIRED CONFIG) + + # only set these after all tests are done + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS}") +@@ -28,8 +28,8 @@ SET(chimera_SRCS + ) + + add_library(chimera STATIC ${chimera_SRCS}) +-add_dependencies(chimera hs pcre) +-target_link_libraries(chimera hs pcre) ++# add_dependencies(chimera hs pcre) ++target_link_libraries(chimera hs pcre::pcre) + + install(TARGETS chimera DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +@@ -44,4 +44,4 @@ 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 +- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +\ No newline at end of file ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake +index e0acda5..2294c21 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 () ++ set(PCRE_LDFLAGS "pcre::pcre") + endif () + endif (PCRE_BUILD_SOURCE) +diff --git a/cmake/sqlite3.cmake b/cmake/sqlite3.cmake +index 92b18ce..4def33b 100644 +--- a/cmake/sqlite3.cmake ++++ b/cmake/sqlite3.cmake +@@ -18,7 +18,7 @@ if (SQLITE3_FOUND) + message(FATAL_ERROR "sqlite3 is broken from 3.8.7 to 3.8.10 - please find a working version") + endif() + endif() +- ++if(0) + if (NOT SQLITE3_BUILD_SOURCE) + set(_SAVED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + list(INSERT CMAKE_REQUIRED_LIBRARIES 0 ${SQLITE3_LDFLAGS}) +@@ -32,5 +32,5 @@ else() + set_target_properties(sqlite3_static PROPERTIES COMPILE_FLAGS "-Wno-error -Wno-extra -Wno-unused -Wno-cast-qual -DSQLITE_OMIT_LOAD_EXTENSION") + endif() + endif() +- ++endif() + # that's enough about sqlite diff --git a/recipes/vectorscan/all/test_package/CMakeLists.txt b/recipes/vectorscan/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..40ad13f34b7fb --- /dev/null +++ b/recipes/vectorscan/all/test_package/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(vectorscan COMPONENTS hs REQUIRED) + +add_executable(hs_example hs_example.cpp) +target_link_libraries(hs_example PRIVATE hs) +target_compile_features(hs_example PRIVATE cxx_std_11) + +if(BUILD_CHIMERA) + find_package(vectorscan COMPONENTS chimera REQUIRED) + add_executable(ch_example ch_example.cpp) + target_link_libraries(ch_example PRIVATE chimera) + target_compile_features(ch_example PRIVATE cxx_std_11) +endif() diff --git a/recipes/vectorscan/all/test_package/ch_example.cpp b/recipes/vectorscan/all/test_package/ch_example.cpp new file mode 100644 index 0000000000000..a4633f0ba060f --- /dev/null +++ b/recipes/vectorscan/all/test_package/ch_example.cpp @@ -0,0 +1,16 @@ +#include +#include "ch.h" + +int main(int argc, char **argv) { + ch_compile_error_t* err = nullptr; + ch_database_t* db = nullptr; + + const auto result = ch_compile("abc(\\w+)ghi", 0, CH_MODE_GROUPS, nullptr, &db, &err); + if (result != CH_SUCCESS) { + std::printf("Failed to compile database\n"); + std::printf("%s\n", err->message); + return 1; + } + + return 0; +} diff --git a/recipes/vectorscan/all/test_package/conanfile.py b/recipes/vectorscan/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9a81016a3a0ff --- /dev/null +++ b/recipes/vectorscan/all/test_package/conanfile.py @@ -0,0 +1,35 @@ +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["BUILD_CHIMERA"] = self.dependencies["vectorscan"].options.with_chimera + 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], "hs_example") + self.run(bin_path, env="conanrun") + + if self.dependencies["vectorscan"].options.with_chimera: + bin_path = os.path.join(self.cpp.build.bindirs[0], "ch_example") + self.run(bin_path, env="conanrun") diff --git a/recipes/vectorscan/all/test_package/hs_example.cpp b/recipes/vectorscan/all/test_package/hs_example.cpp new file mode 100644 index 0000000000000..1e69908ea553e --- /dev/null +++ b/recipes/vectorscan/all/test_package/hs_example.cpp @@ -0,0 +1,16 @@ +#include +#include "hs.h" + +int main(int argc, char **argv) { + hs_compile_error_t* err = nullptr; + hs_database_t* db = nullptr; + + const auto result = hs_compile("abc", HS_FLAG_SOM_LEFTMOST, HS_MODE_BLOCK, nullptr, &db, &err); + if (result != HS_SUCCESS) { + std::printf("Failed to compile database\n"); + std::printf("%s\n", err->message); + return 1; + } + + return 0; +} diff --git a/recipes/vectorscan/config.yml b/recipes/vectorscan/config.yml new file mode 100644 index 0000000000000..1ffb20d105a59 --- /dev/null +++ b/recipes/vectorscan/config.yml @@ -0,0 +1,3 @@ +versions: + "5.4.11": + folder: all diff --git a/recipes/velodyne_decoder/all/conandata.yml b/recipes/velodyne_decoder/all/conandata.yml new file mode 100644 index 0000000000000..2e0d017fd8b08 --- /dev/null +++ b/recipes/velodyne_decoder/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "3.0.0": + url: "https://github.com/valgur/velodyne_decoder/archive/refs/tags/v3.0.0.tar.gz" + sha256: "bce471232205f9d559464ba8cb99bfb96a2245115e54b744115fe71cd9e42042" +patches: + "3.0.0": + - patch_file: "patches/3.0.0-001-fix-msvc-flags.patch" + patch_type: "portability" + patch_description: "Fix /O2 conflicting with debug flags on MSVC" + patch_source: "https://github.com/valgur/velodyne_decoder/commit/22809df3a4d550c3746b17aaca1d6c20692730c4" diff --git a/recipes/velodyne_decoder/all/conanfile.py b/recipes/velodyne_decoder/all/conanfile.py new file mode 100644 index 0000000000000..680c39d6c8c9b --- /dev/null +++ b/recipes/velodyne_decoder/all/conanfile.py @@ -0,0 +1,100 @@ +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, rm, rmdir, export_conandata_patches, apply_conandata_patches +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class PackageConan(ConanFile): + name = "velodyne_decoder" + description = "A decoder library for raw Velodyne data and telemetry info" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/valgur/velodyne_decoder" + topics = ("velodyne", "lidar", "point-cloud") + + 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": "9", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + } + + 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 export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("yaml-cpp/0.8.0") + self.requires("ms-gsl/4.0.0", 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." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["INSTALL_THIRD_PARTY"] = False + 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, "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")) + rm(self, "*.pdb", self.package_folder, recursive=True) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "velodyne_decoder") + self.cpp_info.set_property("cmake_target_name", "velodyne_decoder::velodyne_decoder") + self.cpp_info.set_property("pkg_config_name", "velodyne_decoder") + + self.cpp_info.libs = ["velodyne_decoder"] + self.cpp_info.defines = ["_USE_MATH_DEFINES"] diff --git a/recipes/velodyne_decoder/all/patches/3.0.0-001-fix-msvc-flags.patch b/recipes/velodyne_decoder/all/patches/3.0.0-001-fix-msvc-flags.patch new file mode 100644 index 0000000000000..35a9576fc8880 --- /dev/null +++ b/recipes/velodyne_decoder/all/patches/3.0.0-001-fix-msvc-flags.patch @@ -0,0 +1,15 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -17,7 +17,11 @@ + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + if(MSVC) +- add_compile_options(/W4 /O2) ++ add_compile_options( ++ "$<$:/O2>" ++ "$<$:/O2>" ++ /W4 ++ ) + else() + add_compile_options( + "$<$:-ggdb3;-Og>" diff --git a/recipes/velodyne_decoder/all/test_package/CMakeLists.txt b/recipes/velodyne_decoder/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6af2b5f009096 --- /dev/null +++ b/recipes/velodyne_decoder/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(velodyne_decoder REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE velodyne_decoder::velodyne_decoder) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/velodyne_decoder/all/test_package/conanfile.py b/recipes/velodyne_decoder/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/velodyne_decoder/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/velodyne_decoder/all/test_package/test_package.cpp b/recipes/velodyne_decoder/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..bc82a05812525 --- /dev/null +++ b/recipes/velodyne_decoder/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include +#include +#include +#include + +int main() { + velodyne_decoder::Config config; + velodyne_decoder::StreamDecoder stream_decoder(config); +} diff --git a/recipes/velodyne_decoder/config.yml b/recipes/velodyne_decoder/config.yml new file mode 100644 index 0000000000000..c6ac749e0b234 --- /dev/null +++ b/recipes/velodyne_decoder/config.yml @@ -0,0 +1,3 @@ +versions: + "3.0.0": + folder: all diff --git a/recipes/veque/all/test_package/CMakeLists.txt b/recipes/veque/all/test_package/CMakeLists.txt index caac15bb37efa..bc7b466ad6e96 100644 --- a/recipes/veque/all/test_package/CMakeLists.txt +++ b/recipes/veque/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(veque REQUIRED CONFIG) diff --git a/recipes/veque/all/test_v1_package/CMakeLists.txt b/recipes/veque/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 79a72d05c7d54..0000000000000 --- a/recipes/veque/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(veque REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE veque::veque) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/veque/all/test_v1_package/conanfile.py b/recipes/veque/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/veque/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_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/verilator/all/test_package/CMakeLists.txt b/recipes/verilator/all/test_package/CMakeLists.txt index 857861b148ba8..50e7b8805c34a 100644 --- a/recipes/verilator/all/test_package/CMakeLists.txt +++ b/recipes/verilator/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") diff --git a/recipes/vigra/all/conandata.yml b/recipes/vigra/all/conandata.yml new file mode 100644 index 0000000000000..1d74fa25b7f22 --- /dev/null +++ b/recipes/vigra/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "1.11.2": + url: "https://github.com/ukoethe/vigra/archive/refs/tags/Version-1-11-2.tar.gz" + sha256: "4841936f5c3c137611ec782e293d961df29d3b5b70ade8cb711374de0f4cb5d3" +patches: + "1.11.2": + - patch_file: "patches/1.11.2-001-disable_doc_build.patch" + patch_description: "enable build to proceed when documentation is disabled" + patch_type: "conan" diff --git a/recipes/vigra/all/conanfile.py b/recipes/vigra/all/conanfile.py new file mode 100644 index 0000000000000..0ac9a204a6384 --- /dev/null +++ b/recipes/vigra/all/conanfile.py @@ -0,0 +1,123 @@ +import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout +from conan.tools.files import get, export_conandata_patches, apply_conandata_patches, rm, copy, replace_in_file + + +class VigraConan(ConanFile): + name = "vigra" + description = "A generic C++ library for image analysis" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://ukoethe.github.io/vigra/" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + topics = "image-processing", "computer-vision" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_hdf5": [True, False], + "with_openexr": [True, False], + "with_boost_graph": [True, False], + "with_lemon": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "with_hdf5": True, + "with_openexr": True, + "with_boost_graph": True, + "with_lemon": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + apply_conandata_patches(self) + replace_in_file( + self, + os.path.join(self.source_folder, "src", "impex", "CMakeLists.txt"), + 'SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}"', + 'SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" INSTALL_NAME_DIR "@rpath"' + ) + + 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 requirements(self): + self.requires("libtiff/4.6.0") + self.requires("libpng/[>=1.6 <2]") + self.requires("fftw/3.3.10") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("libjpeg/9e") + + if self.options.with_hdf5: + self.requires("hdf5/1.14.3") + + if self.options.with_openexr: + self.requires("openexr/3.2.4") + self.requires("imath/3.1.9") + + if self.options.with_boost_graph: + self.requires("boost/1.85.0") + + if self.options.with_lemon: + self.requires("coin-lemon/1.3.1") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["WITH_VIGRANUMPY"] = False + tc.cache_variables["BUILD_DOCS"] = False + tc.cache_variables["BUILD_TESTS"] = False + + tc.cache_variables["WITH_OPENEXR"] = self.options.with_openexr + tc.cache_variables["WITH_BOOST_GRAPH"] = self.options.with_boost_graph + tc.cache_variables["WITH_LEMON"] = self.options.with_lemon + + tc.cache_variables["VIGRA_STATIC_LIB"] = not self.options.shared + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + cm = CMake(self) + cm.install() + rm(self, "*.cmake", self.package_folder, recursive=True) + #fix_apple_shared_install_name(self) + + def package_info(self): + if not self.options.shared: + self.cpp_info.defines = ["VIGRA_STATIC_LIB"] + + self.cpp_info.libs = ["vigraimpex"] + self.cpp_info.set_property("cmake_file_name", "Vigra") + self.cpp_info.set_property("cmake_target_name", "vigraimpex") + + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("shlwapi") diff --git a/recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch b/recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch new file mode 100644 index 0000000000000..322479285c3dd --- /dev/null +++ b/recipes/vigra/all/patches/1.11.2-001-disable_doc_build.patch @@ -0,0 +1,13 @@ +Index: CMakeLists.txt +=================================================================== +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -341,7 +341,7 @@ add_custom_target(PACKAGE_SRC_TAR + COMMENT "Creating ${PROJECT_BINARY_DIR}/vigra-${vigra_version}-src.tar.gz") + + ADD_DEPENDENCIES(PACKAGE_SRC_TAR check) +-ADD_DEPENDENCIES(PACKAGE_SRC_TAR doc_cpp) ++#ADD_DEPENDENCIES(PACKAGE_SRC_TAR doc_cpp) + IF(WITH_VIGRANUMPY AND PYTHON_SPHINX) + ADD_DEPENDENCIES(PACKAGE_SRC_TAR doc_python) + ENDIF() diff --git a/recipes/vigra/all/test_package/CMakeLists.txt b/recipes/vigra/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8063e47f90875 --- /dev/null +++ b/recipes/vigra/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(Vigra REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE vigraimpex) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vigra/all/test_package/conanfile.py b/recipes/vigra/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4385dcaa88926 --- /dev/null +++ b/recipes/vigra/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" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cm = CMake(self) + cm.configure() + cm.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/vigra/all/test_package/test_package.cpp b/recipes/vigra/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..84b2dc0869089 --- /dev/null +++ b/recipes/vigra/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +using std::cout; +using std::endl; + +using namespace vigra; + +int main() +{ + cout << "creating a fixed size vigra array.." << endl; + + vigra::TinyVector arr = {1.1, 2.2, 3.3, 4.4, 5.5}; + + cout << "formats supported: " << endl; + cout << impexListFormats() << endl; +} diff --git a/recipes/vigra/config.yml b/recipes/vigra/config.yml new file mode 100644 index 0000000000000..68804c58d126a --- /dev/null +++ b/recipes/vigra/config.yml @@ -0,0 +1,3 @@ +versions: + "1.11.2": + folder: all diff --git a/recipes/vincentlaucsb-csv-parser/all/conandata.yml b/recipes/vincentlaucsb-csv-parser/all/conandata.yml index b2ca51139b4f8..ec36bbdac4426 100644 --- a/recipes/vincentlaucsb-csv-parser/all/conandata.yml +++ b/recipes/vincentlaucsb-csv-parser/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "2.3.0": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.3.0.tar.gz" + sha256: "27b8ac51aa58b9a4debd8ccfb44738c8583a2e874da42f56bbdf3764b75f3af5" + "2.2.3": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.2.3.tar.gz" + sha256: "e70ea75612fb45f9a9dd83145fb3fbf0b5929a32683de478ad429cdd85f10e4e" + "2.2.2": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.2.2.tar.gz" + sha256: "8d7720021d19cf03880eb768d82d7f7e0a240b6d564bc6b495fceb4775b8f0c7" + "2.2.0": + url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.2.0.tar.gz" + sha256: "027fd894c5e6a59f5afcedd6cc071364611df5f35fcc6fc4a8e193712b2f1e73" "2.1.3": url: "https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/2.1.3.tar.gz" - sha256: 3f6ce9212e66d273de12a9671dcbf7be7da0241334dc690585dd434dce5e5acf + sha256: "3f6ce9212e66d273de12a9671dcbf7be7da0241334dc690585dd434dce5e5acf" diff --git a/recipes/vincentlaucsb-csv-parser/all/conanfile.py b/recipes/vincentlaucsb-csv-parser/all/conanfile.py index eb5f85b4e4c16..02f230bb6cf6b 100644 --- a/recipes/vincentlaucsb-csv-parser/all/conanfile.py +++ b/recipes/vincentlaucsb-csv-parser/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.files import copy, get from conan.tools.scm import Version +from conan.tools.layout import basic_layout required_conan_version = ">=1.52.0" @@ -12,26 +13,44 @@ class VincentlaucsbCsvParserConan(ConanFile): name = "vincentlaucsb-csv-parser" description = "Vince's CSV Parser with simple and intuitive syntax" - topics = ("conan", "csv-parser", "csv", "rfc 4180", "parser", "generator") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/vincentlaucsb/csv-parser" - license = "MIT" - settings = "os", "compiler" + topics = ("csv", "rfc 4180", "parser", "generator", "header-only") package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def validate(self): - # C++17 recommended: https://github.com/vincentlaucsb/csv-parser/blob/2.1.3/README.md - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 14) - compiler = self.settings.compiler - compiler_version = Version(self.settings.compiler.version) - if compiler == "gcc" and compiler_version < "7": - raise ConanInvalidConfiguration("gcc version < 7 not supported") + @property + def _min_cppstd(self): + return 14 + + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): self.info.clear() + def validate(self): + # C++17 recommended: https://github.com/vincentlaucsb/csv-parser/blob/2.1.3/README.md + 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/vincentlaucsb-csv-parser/all/test_package/CMakeLists.txt b/recipes/vincentlaucsb-csv-parser/all/test_package/CMakeLists.txt index 3c123cd449689..55902fc2c64d7 100644 --- a/recipes/vincentlaucsb-csv-parser/all/test_package/CMakeLists.txt +++ b/recipes/vincentlaucsb-csv-parser/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(vincentlaucsb-csv-parser REQUIRED CONFIG) diff --git a/recipes/vincentlaucsb-csv-parser/all/test_v1_package/CMakeLists.txt b/recipes/vincentlaucsb-csv-parser/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index acffc65296726..0000000000000 --- a/recipes/vincentlaucsb-csv-parser/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/vincentlaucsb-csv-parser/all/test_v1_package/conanfile.py b/recipes/vincentlaucsb-csv-parser/all/test_v1_package/conanfile.py deleted file mode 100644 index bd7165a553cf4..0000000000000 --- a/recipes/vincentlaucsb-csv-parser/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", "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/vincentlaucsb-csv-parser/config.yml b/recipes/vincentlaucsb-csv-parser/config.yml index e6ceade928280..0aa8e836c3b2f 100644 --- a/recipes/vincentlaucsb-csv-parser/config.yml +++ b/recipes/vincentlaucsb-csv-parser/config.yml @@ -1,3 +1,11 @@ versions: + "2.3.0": + folder: all + "2.2.3": + folder: all + "2.2.2": + folder: all + "2.2.0": + folder: all "2.1.3": folder: all diff --git a/recipes/vir-simd/all/conandata.yml b/recipes/vir-simd/all/conandata.yml index f9462ed3ee48f..00b8471475e1b 100644 --- a/recipes/vir-simd/all/conandata.yml +++ b/recipes/vir-simd/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.3.1": + url: "https://github.com/mattkretz/vir-simd/archive/refs/tags/v0.3.1.tar.gz" + sha256: "552b80773a72db2ec2c82fd8fa70211c0fe8a7a3aa9dd7003541d99ff886a360" + "0.3.0": + url: "https://github.com/mattkretz/vir-simd/archive/refs/tags/v0.3.0.tar.gz" + sha256: "545c8c3254d8369fa01b2a5f8c674a8cb2703340eff63bca352bcd6d7147728f" "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/config.yml b/recipes/vir-simd/config.yml index 88f0acde73637..a996ca7a9b498 100644 --- a/recipes/vir-simd/config.yml +++ b/recipes/vir-simd/config.yml @@ -1,4 +1,8 @@ versions: # Newer versions at the top + "0.3.1": + folder: all + "0.3.0": + folder: all "0.2.0": folder: all diff --git a/recipes/visit_struct/all/test_package/CMakeLists.txt b/recipes/visit_struct/all/test_package/CMakeLists.txt index 24d52d34e85ac..e754e91eeb7ef 100644 --- a/recipes/visit_struct/all/test_package/CMakeLists.txt +++ b/recipes/visit_struct/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(visit_struct REQUIRED CONFIG) diff --git a/recipes/visit_struct/all/test_v1_package/CMakeLists.txt b/recipes/visit_struct/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/visit_struct/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/visit_struct/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/vk-bootstrap/all/conandata.yml b/recipes/vk-bootstrap/all/conandata.yml index d3c923855081d..c1e40af3ac0e6 100644 --- a/recipes/vk-bootstrap/all/conandata.yml +++ b/recipes/vk-bootstrap/all/conandata.yml @@ -1,30 +1,7 @@ sources: + "1.3.296": + url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v1.3.296.tar.gz" + sha256: "fbff2746134459648a488588a71609d11e6e00f591ac4a3cc6683a131bf31a53" "0.7": url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.7.tar.gz" sha256: "7b2c30a4c46514cc5b20d2bebab25c495df39574b9e117c760d1cfe19f71d9aa" - "0.6": - url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.6.tar.gz" - sha256: "95dedaa5cedf7a271f051d91b24b3b6c78aa3c5b2bc3cf058554c92748a421b2" - "0.5": - url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.5.tar.gz" - sha256: "7ec1017d71d48595c078a4488140b230fd9cad1059986a18a507f356bf00e89b" - "0.4": - url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.4.tar.gz" - sha256: "ba03449bb964d6cabbae3b6d6c8fce6e4276e4190885f9b5efc56153ef4b3c39" - "0.3.1": - url: "https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/v0.3.1.tar.gz" - sha256: "bed3333c17acef9249a0095c070b80644d7f275d2479e7c07032fb9532704d70" - "0.2": - url: "https://github.com/charles-lunarg/vk-bootstrap/archive/v0.2.tar.gz" - sha256: "45afc9c2c90309f768786c8014913627e6f1cb4db20449a65b98283b58918483" -patches: - "0.6": - - patch_file: "patches/0001-fix-cmake-0.6.patch" - "0.5": - - patch_file: "patches/0001-fix-cmake-0.5.patch" - "0.4": - - patch_file: "patches/0001-fix-cmake-0.4.patch" - "0.3.1": - - patch_file: "patches/0001-fix-cmake-0.3.1.patch" - "0.2": - - patch_file: "patches/0001-fix-cmake-0.2.patch" diff --git a/recipes/vk-bootstrap/all/conanfile.py b/recipes/vk-bootstrap/all/conanfile.py index 2d7b6c5514a0c..fdd3c90dadd40 100644 --- a/recipes/vk-bootstrap/all/conanfile.py +++ b/recipes/vk-bootstrap/all/conanfile.py @@ -1,8 +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 apply_conandata_patches, copy, export_conandata_patches, get +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, get, rm, replace_in_file from conan.tools.microsoft import is_msvc from conan.tools.scm import Version import os @@ -31,7 +31,7 @@ class VkBootstrapConan(ConanFile): @property def _min_cppstd(self): - return "14" + return "17" if Version(self.version) >= "1.3.270" else "14" @property def _compilers_minimum_version(self): @@ -43,23 +43,20 @@ def _compilers_minimum_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 def configure(self): - if self.options.shared: + if self.options.get_safe("shared"): self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) < "0.7": - self.requires("vulkan-headers/1.3.236.0", transitive_headers=True) + if Version(self.version) > Version("1.0"): + self.requires(f"vulkan-headers/{self.version}.0", transitive_headers=True) else: self.requires("vulkan-headers/1.3.239.0", transitive_headers=True) @@ -79,7 +76,7 @@ def loose_lt_semver(v1, v2): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", ) - if is_msvc(self) and self.options.shared: + if is_msvc(self) and self.options.get_safe("shared"): raise ConanInvalidConfiguration(f"{self.ref} shared not supported with Visual Studio") def source(self): @@ -88,21 +85,28 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["VK_BOOTSTRAP_TEST"] = False - vulkan_headers = self.dependencies["vulkan-headers"] - includedirs = ";".join( - [os.path.join(vulkan_headers.package_folder, includedir).replace("\\", "/") - for includedir in vulkan_headers.cpp_info.includedirs], - ) - if Version(self.version) < "0.3.0": - tc.variables["Vulkan_INCLUDE_DIR"] = includedirs - else: + tc.variables["VK_BOOTSTRAP_WERROR"] = False + if Version(self.version) < Version("1.0"): + vulkan_headers = self.dependencies["vulkan-headers"] + includedirs = ";".join( + [os.path.join(vulkan_headers.package_folder, includedir).replace("\\", "/") + for includedir in vulkan_headers.cpp_info.includedirs], + ) tc.variables["VK_BOOTSTRAP_VULKAN_HEADER_DIR"] = includedirs - if Version(self.version) >= "0.4.0": - tc.variables["VK_BOOTSTRAP_WERROR"] = False tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _source_patches(self): + if Version(self.version) >= "1.3.266": + # INFO: The upstream did not forbid the use of shared libraries + # https://github.com/charles-lunarg/vk-bootstrap/issues/367 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "add_library(vk-bootstrap STATIC", + "add_library(vk-bootstrap ") def build(self): - apply_conandata_patches(self) + self._source_patches() cmake = CMake(self) cmake.configure() cmake.build() @@ -111,6 +115,7 @@ def package(self): copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() + rm(self, "*", os.path.join(self.package_folder, "lib", "cmake"), recursive=True) def package_info(self): self.cpp_info.libs = ["vk-bootstrap"] diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.2.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.2.patch deleted file mode 100644 index 2f8cf8a9dc4fe..0000000000000 --- a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.2.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,7 +1,6 @@ - cmake_minimum_required(VERSION 3.10 FATAL_ERROR) - project(VulkanBootstrap) - --find_package(Vulkan REQUIRED) - - add_library(vk-bootstrap src/VkBootstrap.h src/VkBootstrap.cpp) - add_library(vk-bootstrap::vk-bootstrap ALIAS vk-bootstrap) -@@ -21,11 +20,9 @@ target_compile_options(vk-bootstrap-compiler-warnings - $<$,$,${VK_BOOTSTRAP_COMPILER_CLANGPP}>: - -Wall - -Wextra -- -pedantic-errors - -Wconversion - -Wsign-conversion> - $<$: -- /WX - /W4> - ) - -@@ -33,11 +30,19 @@ target_include_directories(vk-bootstrap PUBLIC src) - target_include_directories(vk-bootstrap PUBLIC ${Vulkan_INCLUDE_DIR}) - target_link_libraries(vk-bootstrap - PRIVATE -+ ${CMAKE_DL_LIBS} - vk-bootstrap-compiler-warnings) -+target_compile_features(vk-bootstrap PUBLIC cxx_std_14) -+include(GNUInstallDirs) -+install(FILES src/VkBootstrap.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+install(TARGETS vk-bootstrap -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) - --if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) -+if (VK_BOOTSTRAP_TEST) - - add_subdirectory(ext) - add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.3.1.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.3.1.patch deleted file mode 100644 index fec9e86ac4740..0000000000000 --- a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.3.1.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -43,11 +43,9 @@ target_compile_options(vk-bootstrap-compiler-warnings - $<$,$,${VK_BOOTSTRAP_COMPILER_CLANGPP}>: - -Wall - -Wextra -- -pedantic-errors - -Wconversion - -Wsign-conversion> - $<$: -- /WX - /W4> - ) - -@@ -71,7 +69,7 @@ install(TARGETS vk-bootstrap - - option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) - --if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) -+if (VK_BOOTSTRAP_TEST) - - add_subdirectory(ext) - add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.4.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.4.patch deleted file mode 100644 index 0305fb75872ef..0000000000000 --- a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.4.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -81,7 +81,7 @@ install(TARGETS vk-bootstrap - - option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) - --if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) -+if (VK_BOOTSTRAP_TEST) - - add_subdirectory(ext) - add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.5.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.5.patch deleted file mode 100644 index 1a523c52ff350..0000000000000 --- a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.5.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -72,7 +72,7 @@ target_link_libraries(vk-bootstrap - target_compile_features(vk-bootstrap PUBLIC cxx_std_14) - - include(GNUInstallDirs) --install(FILES src/VkBootstrap.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+install(FILES src/VkBootstrap.h src/VkBootstrapDispatch.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - install(TARGETS vk-bootstrap - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -@@ -80,7 +80,7 @@ install(TARGETS vk-bootstrap - - option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) - --if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) -+if (VK_BOOTSTRAP_TEST) - - add_subdirectory(ext) - add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch b/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch deleted file mode 100644 index a24ee1446f9e5..0000000000000 --- a/recipes/vk-bootstrap/all/patches/0001-fix-cmake-0.6.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f1e0181..4d154e0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -83,7 +83,7 @@ install(TARGETS vk-bootstrap vk-bootstrap-compiler-warnings vk-bootstrap-vulkan- - - option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) - --if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST) -+if (VK_BOOTSTRAP_TEST) - - add_subdirectory(ext) - add_subdirectory(tests) diff --git a/recipes/vk-bootstrap/all/test_package/CMakeLists.txt b/recipes/vk-bootstrap/all/test_package/CMakeLists.txt index d1c50daad2758..b2718c47f107b 100644 --- a/recipes/vk-bootstrap/all/test_package/CMakeLists.txt +++ b/recipes/vk-bootstrap/all/test_package/CMakeLists.txt @@ -5,4 +5,3 @@ find_package(vk-bootstrap REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE vk-bootstrap::vk-bootstrap) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/recipes/vk-bootstrap/all/test_v1_package/CMakeLists.txt b/recipes/vk-bootstrap/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/vk-bootstrap/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/vk-bootstrap/all/test_v1_package/conanfile.py b/recipes/vk-bootstrap/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/vk-bootstrap/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_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/vk-bootstrap/config.yml b/recipes/vk-bootstrap/config.yml index eaed33f60995e..c87206ed9a6c9 100644 --- a/recipes/vk-bootstrap/config.yml +++ b/recipes/vk-bootstrap/config.yml @@ -1,13 +1,5 @@ versions: - "0.7": - folder: all - "0.6": - folder: all - "0.5": - folder: all - "0.4": - folder: all - "0.3.1": - folder: all - "0.2": + "1.3.296": folder: all + "0.7": + folder: all \ No newline at end of file diff --git a/recipes/volk/all/conandata.yml b/recipes/volk/all/conandata.yml index ca101fd03c2bd..5f8a920ef96d6 100644 --- a/recipes/volk/all/conandata.yml +++ b/recipes/volk/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.296.0": + url: "https://github.com/zeux/volk/archive/refs/tags/vulkan-sdk-1.3.296.0.tar.gz" + sha256: "8ffd0e81e29688f4abaa39e598937160b098228f37503903b10d481d4862ab85" "1.3.268.0": url: "https://github.com/zeux/volk/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" sha256: "f1d30fac1cdc17a8fdc8c69f371663547f92db99cfd612962190bb1e2c8ce74d" diff --git a/recipes/volk/all/conanfile.py b/recipes/volk/all/conanfile.py index ec73b65420573..d15dc5ab17016 100644 --- a/recipes/volk/all/conanfile.py +++ b/recipes/volk/all/conanfile.py @@ -59,16 +59,25 @@ 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)") + if Version(self.version) < "1.3.296": + replace_in_file(self, cmakelists, "find_package(Vulkan QUIET)", "find_package(VulkanHeaders REQUIRED)") + if Version(self.version) < "1.3.261": replace_in_file(self, cmakelists, "Vulkan::Vulkan", "Vulkan::Headers") - else: + elif Version(self.version) < "1.3.296": replace_in_file( self, cmakelists, "if(VULKAN_HEADERS_INSTALL_DIR)", "if(1)\nset(VOLK_INCLUDES ${VulkanHeaders_INCLUDE_DIRS})\nelseif(VULKAN_HEADERS_INSTALL_DIR)", ) + else: + replace_in_file( + self, + cmakelists, + "if(VULKAN_HEADERS_INSTALL_DIR)", + "if(1)\nfind_package(VulkanHeaders REQUIRED)\nset(VOLK_INCLUDES ${VulkanHeaders_INCLUDE_DIRS})\nelseif(VULKAN_HEADERS_INSTALL_DIR)", + ) def build(self): self._patch_sources() diff --git a/recipes/volk/all/test_package/CMakeLists.txt b/recipes/volk/all/test_package/CMakeLists.txt index f79c7351a572f..4f94692f9e151 100644 --- a/recipes/volk/all/test_package/CMakeLists.txt +++ b/recipes/volk/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(volk REQUIRED CONFIG) diff --git a/recipes/volk/all/test_v1_package/CMakeLists.txt b/recipes/volk/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 528a71ca307f4..0000000000000 --- a/recipes/volk/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(volk REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE volk::volk) - -add_executable(${PROJECT_NAME}_nolibs ../test_package/test_package.c) -target_compile_definitions(${PROJECT_NAME}_nolibs PRIVATE VOLK_IMPLEMENTATION) -target_link_libraries(${PROJECT_NAME}_nolibs PRIVATE volk::volk_headers) diff --git a/recipes/volk/all/test_v1_package/conanfile.py b/recipes/volk/all/test_v1_package/conanfile.py deleted file mode 100644 index da79ceaaf9ebd..0000000000000 --- a/recipes/volk/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_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) - self.run(os.path.join("bin", "test_package_nolibs"), run_environment=True) diff --git a/recipes/volk/config.yml b/recipes/volk/config.yml index 76e46074dd1b4..a4fde06481cb0 100644 --- a/recipes/volk/config.yml +++ b/recipes/volk/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.296.0": + folder: "all" "1.3.268.0": folder: "all" "1.3.261.1": diff --git a/recipes/vorbis/all/conanfile.py b/recipes/vorbis/all/conanfile.py index 58d7504b2daef..ab965d02a5a63 100644 --- a/recipes/vorbis/all/conanfile.py +++ b/recipes/vorbis/all/conanfile.py @@ -1,9 +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, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.1" class VorbisConan(ConanFile): @@ -50,6 +52,9 @@ def generate(self): tc = CMakeToolchain(self) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.3.7": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() cd = CMakeDeps(self) cd.generate() @@ -76,8 +81,10 @@ def package_info(self): self.cpp_info.components["vorbismain"].set_property("cmake_target_name", "Vorbis::vorbis") self.cpp_info.components["vorbismain"].set_property("pkg_config_name", "vorbis") self.cpp_info.components["vorbismain"].libs = ["vorbis"] - if self.settings.os in ["Linux", "FreeBSD"]: + if self.settings.os in ["Linux", "FreeBSD", "Android"]: self.cpp_info.components["vorbismain"].system_libs.append("m") + if self.settings.os == "Android": + self.cpp_info.components["vorbismain"].system_libs.append("log") self.cpp_info.components["vorbismain"].requires = ["ogg::ogg"] # TODO: Upstream VorbisConfig.cmake defines components 'Enc' and 'File', @@ -96,19 +103,6 @@ def package_info(self): self.cpp_info.components["vorbisfile"].libs = ["vorbisfile"] self.cpp_info.components["vorbisfile"].requires = ["vorbismain"] - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "Vorbis" - self.cpp_info.names["cmake_find_package_multi"] = "Vorbis" - self.cpp_info.names["pkg_config"] = "vorbis-all-do-not-use" - self.cpp_info.components["vorbismain"].names["cmake_find_package"] = "vorbis" - self.cpp_info.components["vorbismain"].names["cmake_find_package_multi"] = "vorbis" - self.cpp_info.components["vorbisenc"].names["cmake_find_package"] = "vorbisenc" - self.cpp_info.components["vorbisenc"].names["cmake_find_package_multi"] = "vorbisenc" - self.cpp_info.components["vorbisfile"].names["cmake_find_package"] = "vorbisfile" - self.cpp_info.components["vorbisfile"].names["cmake_find_package_multi"] = "vorbisfile" - self.cpp_info.components["vorbisenc-alias"].names["cmake_find_package"] = "Enc" - self.cpp_info.components["vorbisenc-alias"].names["cmake_find_package_multi"] = "Enc" + # vorbisenc-alias self.cpp_info.components["vorbisenc-alias"].requires.append("vorbisenc") - self.cpp_info.components["vorbisfile-alias"].names["cmake_find_package"] = "File" - self.cpp_info.components["vorbisfile-alias"].names["cmake_find_package_multi"] = "File" self.cpp_info.components["vorbisfile-alias"].requires.append("vorbisfile") diff --git a/recipes/vorbis/all/test_package/8kadpcm.wav b/recipes/vorbis/all/test_package/8kadpcm.wav deleted file mode 100644 index 40a362222bc7a..0000000000000 Binary files a/recipes/vorbis/all/test_package/8kadpcm.wav and /dev/null differ diff --git a/recipes/vorbis/all/test_package/CMakeLists.txt b/recipes/vorbis/all/test_package/CMakeLists.txt index 2cb69c95d440d..ac51565711630 100644 --- a/recipes/vorbis/all/test_package/CMakeLists.txt +++ b/recipes/vorbis/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(Vorbis REQUIRED Enc CONFIG) diff --git a/recipes/vorbis/all/test_package/conanfile.py b/recipes/vorbis/all/test_package/conanfile.py index 327c8dd400306..3a8c6c5442b33 100644 --- a/recipes/vorbis/all/test_package/conanfile.py +++ b/recipes/vorbis/all/test_package/conanfile.py @@ -22,6 +22,4 @@ def build(self): def test(self): if not cross_building(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - in_wav_path = os.path.join(self.source_folder, "8kadpcm.wav") - out_ogg_path = os.path.join(self.cpp.build.bindirs[0], "sample.ogg") - self.run(f"{bin_path} < {in_wav_path} > {out_ogg_path}", env="conanrun") + self.run(bin_path, env="conanrun") diff --git a/recipes/vorbis/all/test_package/test_package.c b/recipes/vorbis/all/test_package/test_package.c index d8d92bc3cbff7..794aa0d6e61b5 100644 --- a/recipes/vorbis/all/test_package/test_package.c +++ b/recipes/vorbis/all/test_package/test_package.c @@ -1,252 +1,7 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - * * - ******************************************************************** - - function: simple example encoder - last mod: $Id$ - - ********************************************************************/ - -/* takes a stereo 16bit 44.1kHz WAV file from stdin and encodes it into - a Vorbis bitstream */ - -/* Note that this is POSIX, not ANSI, code */ - #include -#include -#include -#include -#include #include -#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */ -#include -#include -#endif - -#if defined(__MACOS__) && defined(__MWERKS__) -#include /* CodeWarrior's Mac "command-line" support */ -#endif - -#define READ 1024 -signed char readbuffer[READ*4+44]; /* out of the data segment, not the stack */ - int main(){ - ogg_stream_state os; /* take physical pages, weld into a logical - stream of packets */ - ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */ - ogg_packet op; /* one raw packet of data for decode */ - - vorbis_info vi; /* struct that stores all the static vorbis bitstream - settings */ - vorbis_comment vc; /* struct that stores all the user comments */ - - vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ - vorbis_block vb; /* local working space for packet->PCM decode */ - - int eos=0,ret; - int i, founddata; - -#if defined(macintosh) && defined(__MWERKS__) - int argc = 0; - char **argv = NULL; - argc = ccommand(&argv); /* get a "command line" from the Mac user */ - /* this also lets the user set stdin and stdout */ -#endif - - /* we cheat on the WAV header; we just bypass 44 bytes (simplest WAV - header is 44 bytes) and assume that the data is 44.1khz, stereo, 16 bit - little endian pcm samples. This is just an example, after all. */ - -#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */ - /* if we were reading/writing a file, it would also need to in - binary mode, eg, fopen("file.wav","wb"); */ - /* Beware the evil ifdef. We avoid these where we can, but this one we - cannot. Don't add any more, you'll probably go to hell if you do. */ - _setmode( _fileno( stdin ), _O_BINARY ); - _setmode( _fileno( stdout ), _O_BINARY ); -#endif - - - /* we cheat on the WAV header; we just bypass the header and never - verify that it matches 16bit/stereo/44.1kHz. This is just an - example, after all. */ - - readbuffer[0] = '\0'; - for (i=0, founddata=0; i<30 && ! feof(stdin) && ! ferror(stdin); i++) - { - fread(readbuffer,1,2,stdin); - - if ( ! strncmp((char*)readbuffer, "da", 2) ){ - founddata = 1; - fread(readbuffer,1,6,stdin); - break; - } - } - - /********** Encode setup ************/ - - vorbis_info_init(&vi); - - /* choose an encoding mode. A few possibilities commented out, one - actually used: */ - - /********************************************************************* - Encoding using a VBR quality mode. The usable range is -.1 - (lowest quality, smallest file) to 1. (highest quality, largest file). - Example quality mode .4: 44kHz stereo coupled, roughly 128kbps VBR - - ret = vorbis_encode_init_vbr(&vi,2,44100,.4); - - --------------------------------------------------------------------- - - Encoding using an average bitrate mode (ABR). - example: 44kHz stereo coupled, average 128kbps VBR - - ret = vorbis_encode_init(&vi,2,44100,-1,128000,-1); - - --------------------------------------------------------------------- - - Encode using a quality mode, but select that quality mode by asking for - an approximate bitrate. This is not ABR, it is true VBR, but selected - using the bitrate interface, and then turning bitrate management off: - - ret = ( vorbis_encode_setup_managed(&vi,2,44100,-1,128000,-1) || - vorbis_encode_ctl(&vi,OV_ECTL_RATEMANAGE2_SET,NULL) || - vorbis_encode_setup_init(&vi)); - - *********************************************************************/ - - ret=vorbis_encode_init_vbr(&vi,2,44100,0.1); - - /* do not continue if setup failed; this can happen if we ask for a - mode that libVorbis does not support (eg, too low a bitrate, etc, - will return 'OV_EIMPL') */ - - if(ret)exit(1); - - /* add a comment */ + vorbis_comment vc; vorbis_comment_init(&vc); - vorbis_comment_add_tag(&vc,"ENCODER","encoder_example.c"); - - /* set up the analysis state and auxiliary encoding storage */ - vorbis_analysis_init(&vd,&vi); - vorbis_block_init(&vd,&vb); - - /* set up our packet->stream encoder */ - /* pick a random serial number; that way we can more likely build - chained streams just by concatenation */ - srand(time(NULL)); - ogg_stream_init(&os,rand()); - - /* Vorbis streams begin with three headers; the initial header (with - most of the codec setup parameters) which is mandated by the Ogg - bitstream spec. The second header holds any comment fields. The - third header holds the bitstream codebook. We merely need to - make the headers, then pass them to libvorbis one at a time; - libvorbis handles the additional Ogg bitstream constraints */ - - { - ogg_packet header; - ogg_packet header_comm; - ogg_packet header_code; - - vorbis_analysis_headerout(&vd,&vc,&header,&header_comm,&header_code); - ogg_stream_packetin(&os,&header); /* automatically placed in its own - page */ - ogg_stream_packetin(&os,&header_comm); - ogg_stream_packetin(&os,&header_code); - - /* This ensures the actual - * audio data will start on a new page, as per spec - */ - while(!eos){ - int result=ogg_stream_flush(&os,&og); - if(result==0)break; - fwrite(og.header,1,og.header_len,stdout); - fwrite(og.body,1,og.body_len,stdout); - } - - } - - while(!eos){ - long i; - long bytes=fread(readbuffer,1,READ*4,stdin); /* stereo hardwired here */ - - if(bytes==0){ - /* end of file. this can be done implicitly in the mainline, - but it's easier to see here in non-clever fashion. - Tell the library we're at end of stream so that it can handle - the last frame and mark end of stream in the output properly */ - vorbis_analysis_wrote(&vd,0); - - }else{ - /* data to encode */ - - /* expose the buffer to submit data */ - float **buffer=vorbis_analysis_buffer(&vd,READ); - - /* uninterleave samples */ - for(i=0;i {out_ogg_path}", run_environment=True) diff --git a/recipes/voropp/all/CMakeLists.txt b/recipes/voropp/all/CMakeLists.txt index 6f2c6b9d5757a..ed0a66b60c658 100644 --- a/recipes/voropp/all/CMakeLists.txt +++ b/recipes/voropp/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.15) project(voro++ LANGUAGES CXX) add_library(${PROJECT_NAME} ${VOROPP_SRC_DIR}/src/voro++.cc) diff --git a/recipes/voropp/all/test_package/CMakeLists.txt b/recipes/voropp/all/test_package/CMakeLists.txt index 80445ad826690..9be3a3bae8436 100644 --- a/recipes/voropp/all/test_package/CMakeLists.txt +++ b/recipes/voropp/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(voropp REQUIRED CONFIG) diff --git a/recipes/voropp/all/test_v1_package/CMakeLists.txt b/recipes/voropp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/voropp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/voropp/all/test_v1_package/conanfile.py b/recipes/voropp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/voropp/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_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/vsg/all/test_package/CMakeLists.txt b/recipes/vsg/all/test_package/CMakeLists.txt index 5b45e894695a3..07c315f1634e2 100644 --- a/recipes/vsg/all/test_package/CMakeLists.txt +++ b/recipes/vsg/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) # if the project uses c++ diff --git a/recipes/vtu11/all/test_package/CMakeLists.txt b/recipes/vtu11/all/test_package/CMakeLists.txt index beca0132b2a57..a1df8fc1aac18 100644 --- a/recipes/vtu11/all/test_package/CMakeLists.txt +++ b/recipes/vtu11/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) diff --git a/recipes/vtu11/all/test_v1_package/CMakeLists.txt b/recipes/vtu11/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/vtu11/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/vtu11/all/test_v1_package/conanfile.py b/recipes/vtu11/all/test_v1_package/conanfile.py deleted file mode 100644 index 15d4a3b51a02d..0000000000000 --- a/recipes/vtu11/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,25 +0,0 @@ -from conans import ConanFile, CMake -from conan.errors import ConanException -from conan.tools.build import cross_building - -import os - -from pathlib import Path - - -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) - test_vtu = Path(self.build_folder, "test.vtu") - if not test_vtu.exists() or "VTKFile" not in test_vtu.read_text(): - raise ConanException("Failed to generate a viable vtu file") diff --git a/recipes/vulkan-headers/all/conandata.yml b/recipes/vulkan-headers/all/conandata.yml index a2e54aa68230e..2aaf7adcbb3e5 100644 --- a/recipes/vulkan-headers/all/conandata.yml +++ b/recipes/vulkan-headers/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.4.309.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.4.309.0.tar.gz" + sha256: "2bc1b4127950badc80212abf1edfa5c3b5032f3425edf37255863ba7592c1969" + "1.3.296.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.3.296.0.tar.gz" + sha256: "1e872a0be3890784bbe68dcd89b7e017fed77ba95820841848718c98bda6dc33" + "1.3.290.0": + url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.3.290.0.tar.gz" + sha256: "5b186e1492d97c44102fe858fb9f222b55524a8b6da940a8795c9e326ae6d722" "1.3.268.0": url: "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" sha256: "94993cbe2b1a604c0d5d9ea37a767e1aba4d771d2bfd4ddceefd66243095164f" diff --git a/recipes/vulkan-headers/all/conanfile.py b/recipes/vulkan-headers/all/conanfile.py index f2e2e4c12ab8e..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 diff --git a/recipes/vulkan-headers/all/test_package/CMakeLists.txt b/recipes/vulkan-headers/all/test_package/CMakeLists.txt index 92c13c3e4860c..1290ec07fb5a0 100644 --- a/recipes/vulkan-headers/all/test_package/CMakeLists.txt +++ b/recipes/vulkan-headers/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(VulkanHeaders REQUIRED CONFIG) diff --git a/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt b/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/vulkan-headers/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/vulkan-headers/all/test_v1_package/conanfile.py b/recipes/vulkan-headers/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/vulkan-headers/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_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/vulkan-headers/config.yml b/recipes/vulkan-headers/config.yml index 34a8efbe22307..dcd12da108a8c 100644 --- a/recipes/vulkan-headers/config.yml +++ b/recipes/vulkan-headers/config.yml @@ -1,4 +1,10 @@ versions: + "1.4.309.0": + folder: all + "1.3.296.0": + folder: all + "1.3.290.0": + folder: all "1.3.268.0": folder: all "1.3.261.1": diff --git a/recipes/vulkan-loader/all/conandata.yml b/recipes/vulkan-loader/all/conandata.yml index b31ce6fd5b07a..5a95739027f5d 100644 --- a/recipes/vulkan-loader/all/conandata.yml +++ b/recipes/vulkan-loader/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.4.309.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/v1.4.309.tar.gz" + sha256: "3e4085a55f6e356fe9dbd47e6dc762be732790add3532943da824b3e8c062827" + "1.3.290.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/v1.3.290.tar.gz" + sha256: "a1f0d80c4ee448d4fa37d1d4a4c4cf1d6d0f5873d3ca6dffe2a9498e6e654142" "1.3.268.0": url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" sha256: "404fa621f1ab2731bcc68bcbff64d8c6de322faad2d87f9198641bd37255fd39" diff --git a/recipes/vulkan-loader/all/conanfile.py b/recipes/vulkan-loader/all/conanfile.py index 408b02f227457..27aeb7d2928a6 100644 --- a/recipes/vulkan-loader/all/conanfile.py +++ b/recipes/vulkan-loader/all/conanfile.py @@ -79,7 +79,7 @@ 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/2.0.3") + self.tool_requires("pkgconf/2.1.0") if self._is_mingw: self.tool_requires("jwasm/2.13") if Version(self.version) >= "1.3.234": @@ -132,12 +132,13 @@ def _patch_sources(self): "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})", - ) + if Version(self.version) < "1.3.275": + 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, diff --git a/recipes/vulkan-loader/all/test_package/CMakeLists.txt b/recipes/vulkan-loader/all/test_package/CMakeLists.txt index b086288213558..eee2268c58ab4 100644 --- a/recipes/vulkan-loader/all/test_package/CMakeLists.txt +++ b/recipes/vulkan-loader/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(VulkanLoader REQUIRED CONFIG) diff --git a/recipes/vulkan-loader/config.yml b/recipes/vulkan-loader/config.yml index a9f30cdd286b9..19bada84d9f6b 100644 --- a/recipes/vulkan-loader/config.yml +++ b/recipes/vulkan-loader/config.yml @@ -1,4 +1,8 @@ versions: + "1.4.309.0": + folder: all + "1.3.290.0": + folder: all "1.3.268.0": folder: all "1.3.250.0": diff --git a/recipes/vulkan-validationlayers/all/conandata.yml b/recipes/vulkan-validationlayers/all/conandata.yml index 71fbe37f78e18..c686b5c17fccd 100644 --- a/recipes/vulkan-validationlayers/all/conandata.yml +++ b/recipes/vulkan-validationlayers/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.3.243.0": + url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.243.0.tar.gz" + sha256: "fd9f6c24027de177b2fb0eb6385542d62f4c21665a8d4cc7e1c118688e0836de" "1.3.239.0": url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.239.0.tar.gz" sha256: "7aa7fb46e25e5ef0144d29c92122b631dc7c7c6804a6339f195b368ad53328e4" @@ -18,6 +21,10 @@ sources: url: "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-1.3.211.0.tar.gz" sha256: "927c1cb98c81fe8a1a529cf2d977d701dcda49c495a19583dc00e178b6757203" patches: + "1.3.243.0": + - patch_file: "patches/1.3.243.0-0001-fix-cmake.patch" + patch_description: "CMake: Adapt to conan" + patch_type: "conan" "1.3.239.0": - patch_file: "patches/1.3.239.0-0001-fix-cmake.patch" patch_description: "CMake: Adapt to conan" diff --git a/recipes/vulkan-validationlayers/all/conanfile.py b/recipes/vulkan-validationlayers/all/conanfile.py index 9ce6269563249..8e8fd30935e41 100644 --- a/recipes/vulkan-validationlayers/all/conanfile.py +++ b/recipes/vulkan-validationlayers/all/conanfile.py @@ -23,14 +23,16 @@ class VulkanValidationLayersConan(ConanFile): topics = ("vulkan", "validation-layers") homepage = "https://github.com/KhronosGroup/Vulkan-ValidationLayers" url = "https://github.com/conan-io/conan-center-index" - + package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { + "fPIC": [True, False], "with_wsi_xcb": [True, False], "with_wsi_xlib": [True, False], "with_wsi_wayland": [True, False], } default_options = { + "fPIC": True, "with_wsi_xcb": True, "with_wsi_xlib": True, "with_wsi_wayland": True, @@ -53,7 +55,8 @@ def _dependencies_versions(self): @property def _needs_wayland_for_build(self): - return self.options.get_safe("with_wsi_wayland") and Version(self.version) < "1.3.231" + return (self.options.get_safe("with_wsi_wayland") and + (Version(self.version) < "1.3.231" or Version(self.version) >= "1.3.243.0")) @property def _needs_pkg_config(self): @@ -90,6 +93,8 @@ def config_options(self): del self.options.with_wsi_xcb del self.options.with_wsi_xlib del self.options.with_wsi_wayland + if self.settings.os == "Windows": + del self.options.fPIC def layout(self): cmake_layout(self, src_folder="src") @@ -137,7 +142,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/2.0.3") + self.tool_requires("pkgconf/2.1.0") if Version(self.version) >= "1.3.239": self.tool_requires("cmake/[>=3.17.2 <4]") @@ -149,13 +154,19 @@ def generate(self): env.generate() tc = CMakeToolchain(self) + if Version(self.version) >= "1.3.239": + tc.cache_variables["VVL_CLANG_TIDY"] = False if Version(self.version) < "1.3.234": tc.variables["VULKAN_HEADERS_INSTALL_DIR"] = self.dependencies["vulkan-headers"].package_folder.replace("\\", "/") tc.variables["USE_CCACHE"] = False if self.settings.os in ["Linux", "FreeBSD"]: - tc.variables["BUILD_WSI_XCB_SUPPORT"] = self.options.with_wsi_xcb - tc.variables["BUILD_WSI_XLIB_SUPPORT"] = self.options.with_wsi_xlib - tc.variables["BUILD_WSI_WAYLAND_SUPPORT"] = self.options.with_wsi_wayland + tc.variables["BUILD_WSI_XCB_SUPPORT"] = self.options.get_safe("with_wsi_xcb") + tc.variables["BUILD_WSI_XLIB_SUPPORT"] = self.options.get_safe("with_wsi_xlib") + tc.variables["BUILD_WSI_WAYLAND_SUPPORT"] = self.options.get_safe("with_wsi_wayland") + elif self.settings.os == "Android": + tc.variables["BUILD_WSI_XCB_SUPPORT"] = False + tc.variables["BUILD_WSI_XLIB_SUPPORT"] = False + tc.variables["BUILD_WSI_WAYLAND_SUPPORT"] = False tc.variables["BUILD_WERROR"] = False tc.variables["BUILD_TESTS"] = False tc.variables["INSTALL_TESTS"] = False @@ -175,7 +186,8 @@ def _patch_sources(self): # Vulkan-ValidationLayers relies on Vulkan-Headers version from CMake config file # to set api_version in its manifest file, but this value MUST have format x.y.z (no extra number). # FIXME: find a way to force correct version in CMakeDeps of vulkan-headers recipe? - if Version(self.version) >= "1.3.235": + # NOTE: At version 1.3.239, the JSON_API_VERSION was removed from the cmakelists file, + if Version(self.version) >= "1.3.235" and Version(self.version) < "1.3.239": vk_version = Version(self.dependencies["vulkan-headers"].ref.version) sanitized_vk_version = f"{vk_version.major}.{vk_version.minor}.{vk_version.patch}" replace_in_file( @@ -190,6 +202,14 @@ def _patch_sources(self): os.path.join(self.generators_folder, "SPIRV-ToolsConfig.cmake"), os.path.join(self.generators_folder, "SPIRV-Tools-optConfig.cmake"), ) + if self.settings.os == "Android": + # INFO: libVkLayer_utils.a: error: undefined symbol: __android_log_print + # https://github.com/KhronosGroup/Vulkan-ValidationLayers/commit/a26638ae9fdd8c40b56d4c7b72859a5b9a0952c9 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "VkLayer_utils PUBLIC Vulkan::Headers", "VkLayer_utils PUBLIC Vulkan::Headers -landroid -llog") + if not self.options.get_safe("fPIC"): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "CMAKE_POSITION_INDEPENDENT_CODE ON", "CMAKE_POSITION_INDEPENDENT_CODE OFF") def build(self): self._patch_sources() @@ -225,5 +245,20 @@ 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) + + if self.settings.os == "Android": + self.cpp_info.system_libs.extend(["android", "log"]) diff --git a/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.243.0.yml b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.243.0.yml new file mode 100644 index 0000000000000..a8eac7c72a089 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/dependencies/dependencies-1.3.243.0.yml @@ -0,0 +1,3 @@ +spirv-headers: "1.3.243.0" +spirv-tools: "1.3.243.0" +vulkan-headers: "1.3.243.0" 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/all/patches/1.3.243.0-0001-fix-cmake.patch b/recipes/vulkan-validationlayers/all/patches/1.3.243.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..82517d16d7d94 --- /dev/null +++ b/recipes/vulkan-validationlayers/all/patches/1.3.243.0-0001-fix-cmake.patch @@ -0,0 +1,11 @@ +--- a/layers/CMakeLists.txt ++++ b/layers/CMakeLists.txt +@@ -115,7 +115,7 @@ endif() + + find_package(PythonInterp 3 QUIET) + +-if (PYTHONINTERP_FOUND) ++if (0) + # Get the include directory of the SPIRV-Headers + get_target_property(SPIRV_HEADERS_INCLUDE_DIR SPIRV-Headers::SPIRV-Headers INTERFACE_INCLUDE_DIRECTORIES) + diff --git a/recipes/vulkan-validationlayers/config.yml b/recipes/vulkan-validationlayers/config.yml index 15d0c149a289c..4584a877880cf 100644 --- a/recipes/vulkan-validationlayers/config.yml +++ b/recipes/vulkan-validationlayers/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.243.0": + folder: all "1.3.239.0": folder: all "1.3.236.0": diff --git a/recipes/vvenc/all/conandata.yml b/recipes/vvenc/all/conandata.yml index ed507f5b4a2bc..cab7ae30015bb 100644 --- a/recipes/vvenc/all/conandata.yml +++ b/recipes/vvenc/all/conandata.yml @@ -1,5 +1,13 @@ sources: + "1.12.0": + url: "https://github.com/fraunhoferhhi/vvenc/archive/refs/tags/v1.12.0.tar.gz" + sha256: "e7311ffcc87d8fcc4b839807061cca1b89be017ae7c449a69436dc2dd07615c2" + "1.11.1": + url: "https://github.com/fraunhoferhhi/vvenc/archive/refs/tags/v1.11.1.tar.gz" + sha256: "4f0c8ac3f03eb970bee7a0cacc57a886ac511d58f081bb08ba4bce6f547d92fa" + "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" + 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 index 50d169ed09a7f..c1b3ae45e3f99 100644 --- a/recipes/vvenc/all/conanfile.py +++ b/recipes/vvenc/all/conanfile.py @@ -8,22 +8,28 @@ 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 +from conan.tools.scm import Version required_conan_version = ">=1.60.1" class vvencRecipe(ConanFile): name = "vvenc" + description = "Fraunhofer Versatile Video Encoder (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" + topics = ("video", "encoder", "codec", "vvc", "h266") package_type = "library" - - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def validate_build(self): if conan_version.major == 2: @@ -54,17 +60,29 @@ def _validate_build2(self): # 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) + if Version(self.version) < "1.10.0": + # 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 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 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, + # 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 @@ -73,17 +91,6 @@ def package_id(self): 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() diff --git a/recipes/vvenc/all/test_package/CMakeLists.txt b/recipes/vvenc/all/test_package/CMakeLists.txt index efaabb8094acb..c201147dc181d 100644 --- a/recipes/vvenc/all/test_package/CMakeLists.txt +++ b/recipes/vvenc/all/test_package/CMakeLists.txt @@ -1,9 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(PackageTest C) +project(test_package LANGUAGES C) find_package(vvenc CONFIG REQUIRED) - - -add_executable(example src/example.c) -target_link_libraries(example vvenc::vvenc) +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE vvenc::vvenc) diff --git a/recipes/vvenc/all/test_package/conanfile.py b/recipes/vvenc/all/test_package/conanfile.py index 0f4e9c14439cf..2f7db800db937 100644 --- a/recipes/vvenc/all/test_package/conanfile.py +++ b/recipes/vvenc/all/test_package/conanfile.py @@ -8,6 +8,7 @@ class vvencTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", 'VirtualRunEnv', "CMakeToolchain" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) @@ -22,5 +23,5 @@ def layout(self): def test(self): if can_run(self): - cmd = os.path.join(self.cpp.build.bindir, "example") + cmd = os.path.join(self.cpp.build.bindir, "test_package") self.run(cmd, env="conanrun") diff --git a/recipes/vvenc/all/test_package/src/example.c b/recipes/vvenc/all/test_package/test_package.c similarity index 100% rename from recipes/vvenc/all/test_package/src/example.c rename to recipes/vvenc/all/test_package/test_package.c diff --git a/recipes/vvenc/config.yml b/recipes/vvenc/config.yml index 6088e2f981017..dcf5ab8c72631 100644 --- a/recipes/vvenc/config.yml +++ b/recipes/vvenc/config.yml @@ -1,3 +1,9 @@ versions: + "1.12.0": + folder: "all" + "1.11.1": + folder: "all" + "1.10.0": + folder: "all" "1.8.0": folder: "all" diff --git a/recipes/waf/all/test_v1_package/conanfile.py b/recipes/waf/all/test_v1_package/conanfile.py deleted file mode 100644 index 252c1f1ae1d96..0000000000000 --- a/recipes/waf/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,43 +0,0 @@ -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/wasm-micro-runtime/all/conandata.yml b/recipes/wasm-micro-runtime/all/conandata.yml index 507fb63f45893..ba4fdc32928ed 100644 --- a/recipes/wasm-micro-runtime/all/conandata.yml +++ b/recipes/wasm-micro-runtime/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.2.0": + url: "https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-2.2.0.tar.gz" + sha256: "93b6ba03f681e061967106046b1908631ee705312b9a6410f3baee7af7c6aac9" + "1.3.3": + url: "https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-1.3.3.tar.gz" + sha256: "94d18b081b6fac0574faf36338c7762a659ff175b9ae2cbc1c0a8f045edcbe7a" "1.2.3": url: "https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-1.2.3.tar.gz" sha256: "85057f788630dc1b8c371f5443cc192627175003a8ea63c491beaff29a338346" @@ -6,6 +12,14 @@ sources: url: "https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-1.2.2.tar.gz" sha256: "d328fc1e19c54cfdb4248b861de54b62977b9b85c0a40eaaeb9cd9b628c0c788" patches: + "2.2.0": + - patch_file: "patches/2.2.0-0001-fix-cmake.patch" + patch_description: "link ntdll on Windows" + patch_type: "conan" + "1.3.3": + - patch_file: "patches/1.3.3-0001-fix-cmake.patch" + patch_description: "separate static and shared build, link ntdll on Windows" + patch_type: "conan" "1.2.3": - patch_file: "patches/1.2.3-0001-fix-cmake.patch" patch_description: "separate static and shasred build" diff --git a/recipes/wasm-micro-runtime/all/conanfile.py b/recipes/wasm-micro-runtime/all/conanfile.py index 4cd796f406c9c..e8354068cc7fd 100644 --- a/recipes/wasm-micro-runtime/all/conanfile.py +++ b/recipes/wasm-micro-runtime/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -136,3 +137,5 @@ def package_info(self): self.cpp_info.system_libs.append("pthread") if self.settings.os == "Windows": self.cpp_info.system_libs.append("ws2_32") + if Version(self.version) >= "1.3.0": + self.cpp_info.system_libs.append("ntdll") diff --git a/recipes/wasm-micro-runtime/all/patches/1.3.3-0001-fix-cmake.patch b/recipes/wasm-micro-runtime/all/patches/1.3.3-0001-fix-cmake.patch new file mode 100644 index 0000000000000..c86c12d4bcbe1 --- /dev/null +++ b/recipes/wasm-micro-runtime/all/patches/1.3.3-0001-fix-cmake.patch @@ -0,0 +1,64 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0ffba05..68d03d2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -114,10 +114,10 @@ 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} -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") ++# 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")) +@@ -135,22 +135,34 @@ 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} -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} -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(WIN32) ++ target_link_libraries (iwasm_shared PUBLIC ntdll) ++endif() + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_shared INTERFACE boringssl_crypto) + endif () +@@ -160,6 +172,7 @@ if (MINGW) + endif () + + install (TARGETS iwasm_shared LIBRARY DESTINATION lib) ++endif() + + # HEADERS + install (FILES + diff --git a/recipes/wasm-micro-runtime/all/patches/2.2.0-0001-fix-cmake.patch b/recipes/wasm-micro-runtime/all/patches/2.2.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..c386cfb73769f --- /dev/null +++ b/recipes/wasm-micro-runtime/all/patches/2.2.0-0001-fix-cmake.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 40658e9..05538a2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,13 +122,13 @@ set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) + + if (NOT WIN32) +- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security \ +- -ffunction-sections -fdata-sections \ +- -Wno-unused-parameter -Wno-pedantic \ +- -fvisibility=hidden") ++ # set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security \ ++ # -ffunction-sections -fdata-sections \ ++ # -Wno-unused-parameter -Wno-pedantic \ ++ # -fvisibility=hidden") + # Remove the extra spaces for better make log + string (REGEX REPLACE " *" " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) +- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wno-unused") ++ # set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wno-unused") + endif() + + if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64") +@@ -159,7 +159,14 @@ if (WAMR_BUILD_STATIC) + 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 ${CMAKE_THREAD_LIBS_INIT}) ++ target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} ${CMAKE_THREAD_LIBS_INIT}) ++ target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} ${CMAKE_THREAD_LIBS_INIT}) ++ if(NOT MSVC) ++ target_link_libraries (iwasm_static INTERFACE -lm -ldl) ++ endif() ++ if(WIN32) ++ target_link_libraries (iwasm_static PUBLIC ntdll) ++ endif() + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_static INTERFACE boringssl_crypto) + endif () +@@ -180,7 +187,14 @@ if (WAMR_BUILD_SHARED) + 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 ${CMAKE_THREAD_LIBS_INIT}) ++ target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} ${CMAKE_THREAD_LIBS_INIT}) ++ target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} ${CMAKE_THREAD_LIBS_INIT}) ++ if(NOT MSVC) ++ target_link_libraries (iwasm_shared INTERFACE -lm -ldl) ++ endif() ++ if(WIN32) ++ target_link_libraries (iwasm_shared PUBLIC ntdll) ++ endif() + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_shared INTERFACE boringssl_crypto) + endif () diff --git a/recipes/wasm-micro-runtime/config.yml b/recipes/wasm-micro-runtime/config.yml index 6d9f399765e2d..542597ea3f803 100644 --- a/recipes/wasm-micro-runtime/config.yml +++ b/recipes/wasm-micro-runtime/config.yml @@ -1,4 +1,8 @@ versions: + "2.2.0": + folder: all + "1.3.3": + folder: all "1.2.3": folder: all "1.2.2": diff --git a/recipes/wasmedge/all/conandata.yml b/recipes/wasmedge/all/conandata.yml index b7eef0f907d2e..9dcc47a29915a 100644 --- a/recipes/wasmedge/all/conandata.yml +++ b/recipes/wasmedge/all/conandata.yml @@ -1,4 +1,86 @@ sources: + "0.14.1": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.1/WasmEdge-0.14.1-windows.zip" + sha256: "cc38f2be3000743becaeb8b00871dcd04b0a0a47b8329735a71615ee06cf1d7b" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.1/WasmEdge-0.14.1-manylinux2014_x86_64.tar.gz" + sha256: "a82f9fb01a6a6f1dfbd1cb069dc96d116f22c15cdb01207a5d0e65096055d092" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.1/WasmEdge-0.14.1-manylinux2014_aarch64.tar.gz" + sha256: "d5ac5c2405ff8a878558379740498e5fe4b126fe746eac585f7efa9bb7f32e28" + - 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.14.1/WasmEdge-0.14.1-darwin_x86_64.tar.gz" + sha256: "96d01cf083d4f7e1c55683dc4b60acca6d8517ad901e2d7b4b5d64ca9a6532e0" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.1/WasmEdge-0.14.1-darwin_arm64.tar.gz" + sha256: "38dd10f4e78d339be91e0c3501055d4dad9bf08c3dc648e07a30df9bea2d6c4a" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Android: + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.1/WasmEdge-0.14.1-android_aarch64.tar.gz" + sha256: "8d979abc7777d01a4ab99e20c1052ba34985e795b6dc84101a7958fb171767a6" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "0.14.0": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-windows.zip" + sha256: "cd0dd57df8f3e8cb7ef0e57d2d09f1740093c2179fad933b270979bafe8295a1" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-manylinux2014_x86_64.tar.gz" + sha256: "73b3892f94c143dc09d53415c6848bb8e87206a1f614fd0edfc89957a0f1b027" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-manylinux2014_aarch64.tar.gz" + sha256: "6136c42066cdd9a96170285af2613dc00f262f5758a03d7afb3ab12a36363c79" + - 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.14.0/WasmEdge-0.14.0-darwin_x86_64.tar.gz" + sha256: "03c5d77be63ecad54ed33a1885f170bc854246ed8f9ae8e366b114bc8c0c2422" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-darwin_arm64.tar.gz" + sha256: "4f2f34545a97768e28700099ac9cbb18e7b434779d237de860324de400922546" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Android: + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-android_aarch64.tar.gz" + sha256: "58b834db8814b27051494df60588dc56f3a5d740604e92c1eac9e5021b311c03" + - url: "https://raw.githubusercontent.com/WasmEdge/WasmEdge/0.14.0/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" "0.13.5": Windows: "x86_64": diff --git a/recipes/wasmedge/all/test_package/CMakeLists.txt b/recipes/wasmedge/all/test_package/CMakeLists.txt index d5682fcb1d31a..f65904629b475 100644 --- a/recipes/wasmedge/all/test_package/CMakeLists.txt +++ b/recipes/wasmedge/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 C) find_package(wasmedge REQUIRED CONFIG) diff --git a/recipes/wasmedge/all/test_v1_package/CMakeLists.txt b/recipes/wasmedge/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/wasmedge/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wasmedge/all/test_v1_package/conanfile.py b/recipes/wasmedge/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/wasmedge/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/wasmedge/config.yml b/recipes/wasmedge/config.yml index 13b6ff12faa84..3eb29fd257a6f 100644 --- a/recipes/wasmedge/config.yml +++ b/recipes/wasmedge/config.yml @@ -1,4 +1,8 @@ versions: + "0.14.1": + folder: "all" + "0.14.0": + folder: "all" "0.13.5": folder: "all" "0.11.2": diff --git a/recipes/wasmer/all/conandata.yml b/recipes/wasmer/all/conandata.yml index 8b03fa42930cd..0ac30b85d7ed6 100644 --- a/recipes/wasmer/all/conandata.yml +++ b/recipes/wasmer/all/conandata.yml @@ -1,4 +1,190 @@ sources: + "5.0.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v5.0.0/wasmer-windows-amd64.tar.gz" + sha256: "1da23b195fb44582f9ff798e5ff23b064ce94d918ff850e54e612c207c08caa6" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v5.0.0/wasmer-windows-gnu64.tar.gz" + sha256: "9a9edeb9909b5314fd94a3afabf83d84ed0eb0ff52b29d3b425118b0df7c65c4" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v5.0.0/wasmer-linux-amd64.tar.gz" + sha256: "3293457cd2c7cdc9cdebd684c7b9c22ece90e05ea1b8f2a0a97ce9e2af560bcb" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v5.0.0/wasmer-linux-aarch64.tar.gz" + sha256: "99c5fbc2c448b089bb6195f0242ecca2a8ecc2bfb723400080ae653de59e34c1" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v5.0.0/wasmer-linux-riscv64.tar.gz" + sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v5.0.0/wasmer-darwin-amd64.tar.gz" + sha256: "b41d6120380add11ada9f4cbe8811bb3f051d0c00600bb2c20f2cfb10f99b4f9" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v5.0.0/wasmer-darwin-arm64.tar.gz" + sha256: "b114eb2b42e3140a74f212d58e3b622e395bd83dad97466e1aa191d2d4af20ab" + "4.4.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.4.0/wasmer-windows-amd64.tar.gz" + sha256: "15565759624f6847135ea8f1d2ca94bc3c8971a32443df39ad0e5b04afc659b9" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.4.0/wasmer-windows-gnu64.tar.gz" + sha256: "e4c275e52d74343abf03d231684d8e57f5d418eb28494972c7f311028cb4e433" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.4.0/wasmer-linux-amd64.tar.gz" + sha256: "5d29f37c52089c4f8c0303df9ba82ab03fe5cc2b6cbafa25e9535347f26ce6a5" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.4.0/wasmer-linux-aarch64.tar.gz" + sha256: "1efa2f6953248920cce1b27783ee3174bedcdb88b2e2bdca012446ad8a966261" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.4.0/wasmer-linux-riscv64.tar.gz" + sha256: "34e4350c2bca7a542d7a41d82f8104998b45bdf1dbafae22dbb0b4e5ca83bf4e" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.4.0/wasmer-darwin-amd64.tar.gz" + sha256: "dd7a913e40e8d6a4051bf7430d5df15a818df0da6962ffdeb1a1c87860f5083f" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.4.0/wasmer-darwin-arm64.tar.gz" + sha256: "c703e3a94e5010e68abdedf832175c64388e749fdbe31b532a5bdc8cf8ab628e" + "4.3.3": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-windows-amd64.tar.gz" + sha256: "63239253e7dc5373a421941aaa9ac8ee2ddb2f34e3d94b12ea739319d7929bd4" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-windows-gnu64.tar.gz" + sha256: "6180ddaed4b758ddc563be493001204f067667406994b4a05bfeb8f7948d9898" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-linux-amd64.tar.gz" + sha256: "817ce5b0ba0a97989fe390b16e76352632a3185ebd0ef3e5bfbaf0dbda73cd13" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-linux-aarch64.tar.gz" + sha256: "d15b8170911b1dca69923844bd31f2ea8a73d6ac9ebe7de0d5a30f0cab4cc1b4" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-linux-riscv64.tar.gz" + sha256: "b0ddc5ed34506f2c2674d3d09996b4c3da500644bc65880e8eede0a149dfaeae" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-darwin-amd64.tar.gz" + sha256: "cf49f6d421b0e8f00f3c4e96ac3ed1ee674b64e0e28f503ff46938cbf831c303" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.3/wasmer-darwin-arm64.tar.gz" + sha256: "4b6bc3fc10e22c5347e240df6be7d2ac8db4c930768d7ed7a3d99b086cad4ba0" + "4.3.0": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-windows-amd64.tar.gz" + sha256: "dc58db29591c3088da053336ddf52ab3f5c870daa0a6901e045a7f1a78b3358e" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-windows-gnu64.tar.gz" + sha256: "8d903af970293ab7987df71f31651e8a59911299c47c8062314dda28f8562556" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-linux-amd64.tar.gz" + sha256: "664c0fd253e86e88afd3977c5a09a1d8162b1e80ce1421da92a310fccfc14243" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-linux-aarch64.tar.gz" + sha256: "e4693e54e40c44957de78328b7711d2822a7e30c88119a68b1a2bd99fdd0a599" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-linux-riscv64.tar.gz" + sha256: "d4ba4ce197f7dbb8e900e6f515143c73934a91feec556bd2f928ba872ddd60b2" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-darwin-amd64.tar.gz" + sha256: "7e58b848649ceba2f4d2d65ea34c72bf02f463327efc1549f027feb344525c69" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.3.0/wasmer-darwin-arm64.tar.gz" + sha256: "ddf4079e3e0432bb1c856720cef8266494cfae2f3b294dbaf18c9853d32fbc1f" + "4.2.7": + Windows: + "x86_64": + "Visual Studio": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-windows-amd64.tar.gz" + sha256: "5e429450a997e9a23b4efb7ad1bfb57a8c4a77436ce2a0c7c160c26576a42562" + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-windows-gnu64.tar.gz" + sha256: "82061836fe79e2d52710ebb48fdffbd82910663ac1bae5bb13e72e6e1a7f0a46" + Linux: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-linux-amd64.tar.gz" + sha256: "7fb9c34c42d31cd7ffed956d0e98d620b5fde0c5fccf9af5e58b9177664e25b1" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-linux-aarch64.tar.gz" + sha256: "5915f617f966cdedd0fe18f26237ef04701c6475c34e5b1cd2ffc0f6e84ffd3a" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-linux-riscv64.tar.gz" + sha256: "bdb480c30ef07640edb63b59b84a5508e802571d8eab74d7a40ff1164e8b7151" + Macos: + "x86_64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-darwin-amd64.tar.gz" + sha256: "29748cdf51ecd11d10cc819bc568820e6267d658d495f08f4af7b90cf3bd0a35" + "armv8": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.7/wasmer-darwin-arm64.tar.gz" + sha256: "65de621cd931acee76e09505bda28d71b6d955a6b33481ae1251280f0f26ebfc" + "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" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.5/wasmer-linux-riscv64.tar.gz" + sha256: "d2002afdce6ecdcd0e31efb47b50a8c195a12ab6b5127520870ece3a1338e889" + 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": @@ -17,6 +203,10 @@ sources: "gcc": url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-linux-aarch64.tar.gz" sha256: "681fe6ad3e7f139d3d2ed8cfbf6ceb4d54098c32da9663bbf849e6429d6e8f1c" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.2.0/wasmer-linux-riscv64.tar.gz" + sha256: "3b2dd3172ffd0084367a07565259d76c99099f3c1b8467c5d7c2a6d5d158de64" Macos: "x86_64": "gcc": @@ -44,6 +234,10 @@ sources: "gcc": url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-linux-aarch64.tar.gz" sha256: "74cc40fcfe4108c0240137a47704d4f6ade8895c70da25358b471fe32ce47a50" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.1.1/wasmer-linux-riscv64.tar.gz" + sha256: "2ee1ee5759133802771018fccd1a4b39a36a1b7ed2bf0e6f38e83266ba5c8bdb" Macos: "x86_64": "gcc": @@ -71,6 +265,10 @@ sources: "gcc": url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-linux-aarch64.tar.gz" sha256: "20f98f4be160e73e387444437f87aeaa276b46c1efee12729ab1108ebeda1d16" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v4.0.0/wasmer-linux-riscv64.tar.gz" + sha256: "87ca77de67bd60a8ddc4c9fa9d9aaa647961826564051a40169cb0dddc2362ad" Macos: "x86_64": "gcc": @@ -98,6 +296,10 @@ sources: "gcc": url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-linux-aarch64.tar.gz" sha256: "f1847405588339b4327ef9d68c266355b04d3d18d6fc2c9fdfb2c9f576f4d758" + "riscv64": + "gcc": + url: "https://github.com/wasmerio/wasmer/releases/download/v3.2.1/wasmer-linux-riscv64.tar.gz" + sha256: "0408442c1da0d3bf1f83014adfe58d24a9ab5d3268db5a8a2dc05026f3a0650c" Macos: "x86_64": "gcc": diff --git a/recipes/wasmer/all/conanfile.py b/recipes/wasmer/all/conanfile.py index 441a5c8738ad6..06ec3aa8052ea 100644 --- a/recipes/wasmer/all/conanfile.py +++ b/recipes/wasmer/all/conanfile.py @@ -60,18 +60,18 @@ def package_id(self): del self.info.settings.compiler.version self.info.settings.compiler = self._compiler_alias - def source(self): + def build(self): get( self, - **self.conan_data["sources"][self.version][str(self.info.settings.os)][str(self.info.settings.arch)][self._compiler_alias] + **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias] ) def package(self): - copy(self, pattern="LICENSE", 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.build_folder) - copy(self, pattern="*.h", 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"), src=os.path.join(self.build_folder, "include")) - srclibdir = os.path.join(self.source_folder, "lib") + srclibdir = os.path.join(self.build_folder, "lib") dstlibdir = os.path.join(self.package_folder, "lib") dstbindir = os.path.join(self.package_folder, "bin") if self.options.shared: @@ -94,5 +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) and Version(self.version) >= "3.2.0": - self.cpp_info.frameworks = ["Security"] + 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/all/test_package/CMakeLists.txt b/recipes/wasmer/all/test_package/CMakeLists.txt index bf0cebf3a9ba7..50fdc9254d27d 100644 --- a/recipes/wasmer/all/test_package/CMakeLists.txt +++ b/recipes/wasmer/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 C) find_package(wasmer REQUIRED CONFIG) diff --git a/recipes/wasmer/all/test_v1_package/CMakeLists.txt b/recipes/wasmer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/wasmer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wasmer/all/test_v1_package/conanfile.py b/recipes/wasmer/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/wasmer/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/wasmer/config.yml b/recipes/wasmer/config.yml index 1f9b03131e570..57768d8568a22 100644 --- a/recipes/wasmer/config.yml +++ b/recipes/wasmer/config.yml @@ -1,4 +1,16 @@ versions: + "5.0.0": + folder: "all" + "4.4.0": + folder: "all" + "4.3.3": + folder: "all" + "4.3.0": + folder: "all" + "4.2.7": + folder: "all" + "4.2.5": + folder: "all" "4.2.0": folder: "all" "4.1.1": diff --git a/recipes/wasmtime-cpp/all/conandata.yml b/recipes/wasmtime-cpp/all/conandata.yml index 524a7021c9bc2..35283cdf993b9 100644 --- a/recipes/wasmtime-cpp/all/conandata.yml +++ b/recipes/wasmtime-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "18.0.0": + url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v18.0.0.tar.gz" + sha256: "94478a9465c6f766ebd7999438a89392dcb30f9fe10f772c8669dcd0b7ffbf86" "9.0.0": url: "https://github.com/bytecodealliance/wasmtime-cpp/archive/v9.0.0.tar.gz" sha256: "0ff8242a9dcbe43eb38c6a3e02be40ed585e6b88efd89092bf1b5318cb8fece1" diff --git a/recipes/wasmtime-cpp/all/conanfile.py b/recipes/wasmtime-cpp/all/conanfile.py index 9970e18861d77..9e61f74387ac9 100644 --- a/recipes/wasmtime-cpp/all/conanfile.py +++ b/recipes/wasmtime-cpp/all/conanfile.py @@ -44,6 +44,7 @@ def requirements(self): "1.0.0": "1.0.1", "6.0.0": "6.0.1", "9.0.0": "12.0.2", + "18.0.0": "18.0.3", } self.requires(f"wasmtime/{version_map.get(version, version)}") diff --git a/recipes/wasmtime-cpp/all/test_package/CMakeLists.txt b/recipes/wasmtime-cpp/all/test_package/CMakeLists.txt index a815c3edc0b1a..edb79389a77e2 100644 --- a/recipes/wasmtime-cpp/all/test_package/CMakeLists.txt +++ b/recipes/wasmtime-cpp/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(wasmtime-cpp REQUIRED CONFIG) diff --git a/recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt b/recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index bc541ea90b512..0000000000000 --- a/recipes/wasmtime-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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/wasmtime-cpp/all/test_v1_package/conanfile.py b/recipes/wasmtime-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/wasmtime-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/wasmtime-cpp/config.yml b/recipes/wasmtime-cpp/config.yml index 37168a28be705..49006a3577c70 100644 --- a/recipes/wasmtime-cpp/config.yml +++ b/recipes/wasmtime-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "18.0.0": + folder: all "9.0.0": folder: all "7.0.0": diff --git a/recipes/wasmtime/all/conandata.yml b/recipes/wasmtime/all/conandata.yml index c449ffc3965a6..f552bb5d07af3 100644 --- a/recipes/wasmtime/all/conandata.yml +++ b/recipes/wasmtime/all/conandata.yml @@ -1,445 +1,241 @@ sources: - "12.0.2": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-x86_64-windows-c-api.zip" - sha256: "ad589d69722f0fdf0b6900fe1c708194575c487776504c44a5283c2960c03a92" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-x86_64-mingw-c-api.zip" - sha256: "773737d9072aed6efdbb6c8137561bd3d5e271008e6741687fa504ec384d0799" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-x86_64-linux-c-api.tar.xz" - sha256: "9e02cd4201d74c68a236664f883873335c7427e820ce4a44c47c1cc98ec9e553" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-aarch64-linux-c-api.tar.xz" - sha256: "daf6ca147b288cf915978f064853f403ca163b52806ae0a52ddd5bd91a5a2507" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-s390x-linux-c-api.tar.xz" - sha256: "65e75ffe34ced6710b56da071e9eb734eabdad69be07f3e6baae27e6b1a95d41" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-x86_64-macos-c-api.tar.xz" - sha256: "35a0d3590afb147f9b312820df87189a9a376cc5bddc2d90b8d7e57b412c7dc6" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-aarch64-macos-c-api.tar.xz" - sha256: "6b8a13fbe6c5440b30632a1f9178df1cdc07bbf34633a105666e506bc8db941d" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.2/wasmtime-v12.0.2-aarch64-linux-c-api.tar.xz" - sha256: "daf6ca147b288cf915978f064853f403ca163b52806ae0a52ddd5bd91a5a2507" - "12.0.1": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-x86_64-windows-c-api.zip" - sha256: "e5da4752260ffd38e28cc56fc1db6f3cec65f9bf352b5e9757a92873e5a6f408" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-x86_64-mingw-c-api.zip" - sha256: "7b7a6c7d3e2603ec51837c28ec5c9306d599d44b707d052faa5102c691e07685" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-x86_64-linux-c-api.tar.xz" - sha256: "7f09952cba8e92ff3bd18ad59b847fb353a6cd6c9069b38c1b9763610616347f" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-aarch64-linux-c-api.tar.xz" - sha256: "fd7080f59413aca47e473e2f2517fbd75ef16d963925a7333c09d0621c81b449" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-s390x-linux-c-api.tar.xz" - sha256: "4482d42cf683f5ee4213fcb1c69f0b5fa7b4d948186d26ae6f647cc92ac4e779" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-x86_64-macos-c-api.tar.xz" - sha256: "89059ed138cb59c8c1f9008053da848d3d9e15c5edfe1a3f2f2d7c0c5bbf9597" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-aarch64-macos-c-api.tar.xz" - sha256: "8dca391f22cf53ae4b19a689e3a2cce87541bb4575a98d2f402f36402be419f7" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v12.0.1/wasmtime-v12.0.1-aarch64-linux-c-api.tar.xz" - sha256: "fd7080f59413aca47e473e2f2517fbd75ef16d963925a7333c09d0621c81b449" - "9.0.1": - Windows: - "x86_64": - 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": + "21.0.0": Windows: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-windows-c-api.zip" - sha256: "d09f31a8dcc6d38ac442a3b1d653137d5814cddad006b5e38151bbc4a9b9d692" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-x86_64-windows-c-api.zip" + sha256: "aee0fb2d792f93d16cc3ae2857a384c1f3b105374dfdecb6ab3f3b2823e6acaf" MinGW: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-mingw-c-api.zip" - sha256: "1198d705bae1d09df15b8ae194d54dfd11bd90e2cc6fbb9aa13a7b000bd24ba9" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-x86_64-mingw-c-api.zip" + sha256: "d4253540cc201c12d356a0806786ea518577c486d66d83a0144b4227d559c507" Linux: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-linux-c-api.tar.xz" - sha256: "cc9b137c0fddeb57a2d439fb8ad57e224a51e0e949cd8ea3fb4a6ee8bb1085d2" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-x86_64-linux-c-api.tar.xz" + sha256: "e91b15f242454ab916dd895d326f6c2585a1f93f0df5aeb079e6f0511c90b37d" "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-aarch64-linux-c-api.tar.xz" - sha256: "47a5fcad64a0e223cf1796eafd0fc9ca62c8b3e457942695397feb56382d3db1" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-aarch64-linux-c-api.tar.xz" + sha256: "b3e77e3eab5c0c4c3085364701bdb5cdd05e5ac4e3308d40263b06ac67bae610" "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-s390x-linux-c-api.tar.xz" - sha256: "18d32031a731e9f7d9dfdc9e75ac8210f88321b4c99b21e24bed6a25ba6cf0ca" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-s390x-linux-c-api.tar.xz" + sha256: "dad2b4c43aaaa6734ac0d2825767759338b0273c46500b46ac071ddc7e853bec" Macos: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-macos-c-api.tar.xz" - sha256: "b2b9dd2a200e93889ce2bff637aacbc8c40dae9903fb30eda20ed52fd4ca83a4" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-x86_64-macos-c-api.tar.xz" + sha256: "f99c5682ce85f353645b2b642a90104d43f77eafe8a90faa2ecd9421c4d48d2f" "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-aarch64-macos-c-api.tar.xz" - sha256: "88bc1c36665d230206130a9d194b11b907438c86224ed184f2bee8ef348cf193" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-aarch64-macos-c-api.tar.xz" + sha256: "0414332f1d6c90e6226102a27e8b8767eba845f34f4c8cabab575b094a0500f1" Android: "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-aarch64-linux-c-api.tar.xz" - sha256: "47a5fcad64a0e223cf1796eafd0fc9ca62c8b3e457942695397feb56382d3db1" - "6.0.1": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v21.0.0/wasmtime-v21.0.0-aarch64-linux-c-api.tar.xz" + sha256: "b3e77e3eab5c0c4c3085364701bdb5cdd05e5ac4e3308d40263b06ac67bae610" + "20.0.1": Windows: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-x86_64-windows-c-api.zip" - sha256: "09e5a916421933c6b81ae040b1678450a0c23c4286a2327d515001c51e5fe344" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-x86_64-windows-c-api.zip" + sha256: "d9a8cfefe8684d7170b67ade0fda6da4ad21508909680a64eebe083b93aabc70" MinGW: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-x86_64-mingw-c-api.zip" - sha256: "03982d3ff2d34d47f5609b4ac3acbc517d25c8ab881df69328d1e21b19ff70c4" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-x86_64-mingw-c-api.zip" + sha256: "164ecbbe632d1368020bccf442a81b20ec1cb57f0d0cdfaccf92ed74bd2311e8" Linux: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-x86_64-linux-c-api.tar.xz" - sha256: "a64c6e7bee46598d9efd357f4e7c6a4dfb3888e389755ff050555e0d330bcc0f" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-x86_64-linux-c-api.tar.xz" + sha256: "ba2e7ce72a50b0a472888249aecfb27aac841e5dfc72c845175fbeeaaf6862d4" "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-aarch64-linux-c-api.tar.xz" - sha256: "6dbc2dc9b9cc5ecd937f7fca07b5c87014615a4c00bcbac51ceb78140f9ccdf1" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-aarch64-linux-c-api.tar.xz" + sha256: "e5f383012c4cacbe5ab78dba334fa77793e109c0da5840a8c00cb63633043bee" "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-s390x-linux-c-api.tar.xz" - sha256: "047536e2085372d68ca5ee342d7c11722f8ac5858dd0e99615cf7c4cfa433225" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-s390x-linux-c-api.tar.xz" + sha256: "f331a0fee2856f42136aaf9fbdc413abae397070f7b688d4b8c4885ec04292ff" Macos: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-x86_64-macos-c-api.tar.xz" - sha256: "97bb023c9f8eb206fb2a11befbbdd55003dfd3bcf763dd4bdf72bd02768f3faf" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-x86_64-macos-c-api.tar.xz" + sha256: "a4031456c2c1e406395457bd7f452e9e71e8e024b727cf47ebb4da996f9a0c51" "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-aarch64-macos-c-api.tar.xz" - sha256: "914c5b7a844c8e04d4f191ac229d4e3714d185971bde1be3203a6041aec5f465" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-aarch64-macos-c-api.tar.xz" + sha256: "4bce467752f64dc4632b7ccad52b7e2ea134ad02a23e6b540b39a11c8c4fa579" Android: "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v6.0.1/wasmtime-v6.0.1-aarch64-linux-c-api.tar.xz" - sha256: "6dbc2dc9b9cc5ecd937f7fca07b5c87014615a4c00bcbac51ceb78140f9ccdf1" - "5.0.0": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.1/wasmtime-v20.0.1-aarch64-linux-c-api.tar.xz" + sha256: "e5f383012c4cacbe5ab78dba334fa77793e109c0da5840a8c00cb63633043bee" + "19.0.2": Windows: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-x86_64-windows-c-api.zip" - sha256: "11b3c7473afee0db400683ac1aa9e5243b3d55dbdaeaca534c7b3481d3e3c8a3" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-windows-c-api.zip" + sha256: "9814038a400680a322f8c287ccba68fc0c5ffccede31f9ed444e945bdeec5c70" MinGW: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-x86_64-mingw-c-api.zip" - sha256: "3c87f5c59a10cfda484131dd1454a9bac8b56e48648377178b4b1cbb201358bd" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-mingw-c-api.zip" + sha256: "0a1c37ec9eebc2322632c8275386f99cdb08c58020ad01409aecde874b8ad364" Linux: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-x86_64-linux-c-api.tar.xz" - sha256: "cbdec67ae16af672d50ff2c47718713d60b6cdc05f7c0bee77f612dde8c7ee92" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-linux-c-api.tar.xz" + sha256: "734f82bc0fcf9e3214db37f4275536ee3b59be8935ec3ffac379b312423ee3ae" "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-aarch64-linux-c-api.tar.xz" - sha256: "1b2baa5038afdd6d8338c4b94487c2b271d391b1f3e0bdf462ca7d9ef1c489df" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-aarch64-linux-c-api.tar.xz" + sha256: "6952c3ffcbb0d04c1c7f07c17e945d0fe2b756965d17717fde2c51dcce7465ab" "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-s390x-linux-c-api.tar.xz" - sha256: "4ee4fc1e43c5b588f52b309046549928e3f6c1daee373d245c71687c1bd8a2dd" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-s390x-linux-c-api.tar.xz" + sha256: "536a9a676ffaa143c77fa4e9712e19f6035e93e0d58865d243ad5e15302ef9e8" Macos: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-x86_64-macos-c-api.tar.xz" - sha256: "8c6f326c452598e23e2ba4894378e4ba73d18ce4d488cb1f29a377a47457321c" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-macos-c-api.tar.xz" + sha256: "42948b3dc8ba7061101d83c55d1fb2ed2f537061291739e0582aa8375d6baf76" "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-aarch64-macos-c-api.tar.xz" - sha256: "7c773aa2650bd9b2b50cfe5faa8bbff772a5417d8fc2ae1f050f575331aa6015" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-aarch64-macos-c-api.tar.xz" + sha256: "d5b1121219d3503dac0f8cfc04a0557eea2330107867d0b32b91bd9fe0b62322" Android: "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v5.0.0/wasmtime-v5.0.0-aarch64-linux-c-api.tar.xz" - sha256: "1b2baa5038afdd6d8338c4b94487c2b271d391b1f3e0bdf462ca7d9ef1c489df" - "4.0.0": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-aarch64-linux-c-api.tar.xz" + sha256: "6952c3ffcbb0d04c1c7f07c17e945d0fe2b756965d17717fde2c51dcce7465ab" + "18.0.3": Windows: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-x86_64-windows-c-api.zip" - sha256: "b2874ab0e2f7588dacef433bd1f9c4cd958243ef4cbbc5886b328cd14eab5d48" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.3/wasmtime-v18.0.3-x86_64-windows-c-api.zip" + sha256: "d23c633e73424304bc926b028a3fb9bed2709bc872414729e356ae66e55eb705" MinGW: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-x86_64-mingw-c-api.zip" - sha256: "68c0a5fccdd875c0d653110af94bceb2d8e35b0d836f8784bccea2d5b5b88108" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.3/wasmtime-v18.0.3-x86_64-mingw-c-api.zip" + sha256: "d4b74cf84862c1a3bb29a7a11f6785ed1307628a3f3e9a2b850df19f0c4da659" Linux: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-x86_64-linux-c-api.tar.xz" - sha256: "174166c8c2294d66844fe9736543e9edc8a28ff8db18b26e8b74f5a27024f8c5" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.3/wasmtime-v18.0.3-x86_64-linux-c-api.tar.xz" + sha256: "c5c67a16386c1b2efc875246cb8c75f45faa806a16979c985842d3ba91502b34" "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-aarch64-linux-c-api.tar.xz" - sha256: "f3017e9272068a264234efec5df822b619299e138bd2fdab2eca43c73d8e7d26" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.3/wasmtime-v18.0.3-aarch64-linux-c-api.tar.xz" + sha256: "c7c790b6e5e3f998f588f2aacda6b39daf4aa59b68e58578a477579312ca0756" "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-s390x-linux-c-api.tar.xz" - sha256: "9243404037187900ed85188744d28501c786abba1098a933a8c80363d3763350" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.3/wasmtime-v18.0.3-s390x-linux-c-api.tar.xz" + sha256: "196ec417bd07fe2559381c922434c9908087bd238ed0811b0b81a6a860ff0145" Macos: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-x86_64-macos-c-api.tar.xz" - sha256: "41d0d2fd9c9942f0b00eac3da6ddfaca5a660a61c6220bc608d2e15d5adfbdd4" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.3/wasmtime-v18.0.3-x86_64-macos-c-api.tar.xz" + sha256: "48a8969fda0abaee08ce17acd1413f21cc1112b2b5de1af00baa647a32d3951f" "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-aarch64-macos-c-api.tar.xz" - sha256: "2761ee87f265e520a2ed1d82188c958f5dc244ad6fed94a80f6af33f705a320d" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.3/wasmtime-v18.0.3-aarch64-macos-c-api.tar.xz" + sha256: "f6faa6ae319d43c7f54892c10742be18aa7cca5ba72fd470a0926f64d0745050" Android: "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v4.0.0/wasmtime-v4.0.0-aarch64-linux-c-api.tar.xz" - sha256: "f3017e9272068a264234efec5df822b619299e138bd2fdab2eca43c73d8e7d26" - "3.0.0": + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.3/wasmtime-v18.0.3-aarch64-linux-c-api.tar.xz" + sha256: "c7c790b6e5e3f998f588f2aacda6b39daf4aa59b68e58578a477579312ca0756" + "16.0.0": Windows: "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v3.0.0/wasmtime-v3.0.0-x86_64-windows-c-api.zip" - sha256: "4375673c544e43fc5c9c939e05b30efafdb1449412912ee17937272a25ee1ddd" + 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/v3.0.0/wasmtime-v3.0.0-x86_64-mingw-c-api.zip" - sha256: "793a0179391e1f9b6699b1054b37dfffc36b7ab5eff401bb16a8fe66e6e42ee1" + 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/v3.0.0/wasmtime-v3.0.0-x86_64-linux-c-api.tar.xz" - sha256: "0cdc7e36fa752c66d57121555fa58370581613e8c119654a4a12c197d4fde148" + 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/v3.0.0/wasmtime-v3.0.0-aarch64-linux-c-api.tar.xz" - sha256: "93c3dcd7b315a98de221d68e0d253cfcbf122328aea285c28e70aa0ea6582088" + 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/v3.0.0/wasmtime-v3.0.0-s390x-linux-c-api.tar.xz" - sha256: "9e19c795996a94ece9d0bf00c88cbb1081552c4ae0590effd50121351fb8303e" + 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/v3.0.0/wasmtime-v3.0.0-x86_64-macos-c-api.tar.xz" - sha256: "df85111b0b20ee5a4201eae7c7cf368f905e6b73d186fcbf7347f750278a598d" + 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/v3.0.0/wasmtime-v3.0.0-aarch64-macos-c-api.tar.xz" - sha256: "253a3d1c79134665ab2d7ae0672227b8d88b2becbb84ab96ceeee897a074801a" + 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/v3.0.0/wasmtime-v3.0.0-aarch64-linux-c-api.tar.xz" - sha256: "93c3dcd7b315a98de221d68e0d253cfcbf122328aea285c28e70aa0ea6582088" - "2.0.0": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-x86_64-windows-c-api.zip" - sha256: "ada9fe8f706811f3f63dcaa4c7c72519893f91ae7980f7f8ed6e542932ad6a4e" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-x86_64-mingw-c-api.zip" - sha256: "dc024d00671098260643b51b3609bb808f440bb8e2f06d9fad6c2af1160d16b7" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-x86_64-linux-c-api.tar.xz" - sha256: "c216f16a0494b7b609890effcd417b9807dc8a6d5c47818fb4a297fef2bb54e3" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-aarch64-linux-c-api.tar.xz" - sha256: "9bbcfbcc68b9b8c4572f0bdd956e1a558f9a01e82bd099fac9c7755220c92189" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-s390x-linux-c-api.tar.xz" - sha256: "9bbe40d443a34b1d8f71c9239d87555e9f41e04a9d84f085186711b8075ec5ef" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-x86_64-macos-c-api.tar.xz" - sha256: "658f8834a322ddf35cfcfc2c56afbbfad91106a00633d5c6c932757fa83378b2" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-aarch64-macos-c-api.tar.xz" - sha256: "08749d061565f9b48a29c57d3ef9ee2d432d531fad8758be97b1c98bfda1c14b" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v2.0.0/wasmtime-v2.0.0-aarch64-linux-c-api.tar.xz" - sha256: "9bbcfbcc68b9b8c4572f0bdd956e1a558f9a01e82bd099fac9c7755220c92189" - "1.0.1": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-windows-c-api.zip" - sha256: "7b8ae00997d3d6fef21d084141f843db9d2c562ca24aebccb5b20cdbba93c8c2" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-mingw-c-api.zip" - sha256: "ce5b516b3924fdf38e200cad2fd9438ac35bf7ddd734aea3e2dee8f319e275c3" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-linux-c-api.tar.xz" - sha256: "b481b015c8805acabf2d1aad3b005a8564ac11f3c5b360bbbf71ba0f03e2c067" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-aarch64-linux-c-api.tar.xz" - sha256: "aa950e47fdff4970efb7a59a3ea9e96b965180f9e84be46280915086f0ad7519" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-s390x-linux-c-api.tar.xz" - sha256: "b197a1d8878ae98b2a6ca769bc89aeda9352cb516f94d5a8d84453666ba57ab6" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-x86_64-macos-c-api.tar.xz" - sha256: "fc570e49cf3c4d66b69770ecee692e1cf27d0fa6a6363c83f3f5cca23ac9dc3b" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-aarch64-macos-c-api.tar.xz" - sha256: "48fe254302c6519bf289a4d1385dd425a1c65c4dd521d88dc6a1fab6f025bd19" - Android: - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v1.0.1/wasmtime-v1.0.1-aarch64-linux-c-api.tar.xz" - sha256: "aa950e47fdff4970efb7a59a3ea9e96b965180f9e84be46280915086f0ad7519" - "0.39.1": - Windows: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-x86_64-windows-c-api.zip" - sha256: "1bf83b7bfda81e2b7df5cede0b0b3dd29ff615ecaccb2ad59f266651f13ccab4" - MinGW: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-x86_64-mingw-c-api.zip" - sha256: "802325d7f1bbacd8b4c439cac7df9cdd35a9e7285fcd70bee217967a0f8c7ee7" - Linux: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-x86_64-linux-c-api.tar.xz" - sha256: "b8580211b10b4380039700c5dd75813fc56138faf79fc86d63cc1abfe84c099b" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-aarch64-linux-c-api.tar.xz" - sha256: "3fb770e9afa3114c3ffe9f60e696ba3e4a74d34e4b50b59cce27c3d118f215b1" - "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-s390x-linux-c-api.tar.xz" - sha256: "65d662cc3948b89aab1f56d44da129d117798a59bdc938e90d6412d620980d72" - Macos: - "x86_64": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-x86_64-macos-c-api.tar.xz" - sha256: "a045371654222d7eb29ca23520ebf64d8144ea8e1ae0b38df2f39cdeb83e3649" - "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.39.1/wasmtime-v0.39.1-aarch64-macos-c-api.tar.xz" - sha256: "a5e0e3b1acf924771d84beec6462baa00d9a436df2d65748bcd202cb8470d267" - Android: - "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": + 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/v0.38.0/wasmtime-v0.38.0-x86_64-windows-c-api.zip" - sha256: "69b28fe9a89451e4561c628341c960c08d369caecfc319650660586dcf8c0c61" + 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/v0.38.0/wasmtime-v0.38.0-x86_64-mingw-c-api.zip" - sha256: "926177b45afe208e64011a2cb68dc73e064c25391269982ca74678eeade30faf" + 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/v0.38.0/wasmtime-v0.38.0-x86_64-linux-c-api.tar.xz" - sha256: "a4dfe18391feb807ae9c219734bc084ff11c1f2f26762dfb5252f5299cee434e" + 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/v0.38.0/wasmtime-v0.38.0-aarch64-linux-c-api.tar.xz" - sha256: "01dd81ac4eeff128ff762b6f2e61336b723a78b940006cd405f135e509046c4e" + 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/v0.38.0/wasmtime-v0.38.0-s390x-linux-c-api.tar.xz" - sha256: "552c991ab894fa250a5be296befb1c9f44c115de760ffe80b9ddf430f3e30ec0" + 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/v0.38.0/wasmtime-v0.38.0-x86_64-macos-c-api.tar.xz" - sha256: "651c41d4de8958caf80086bab46d0f326bbfa0f328f544a632df52b050f2776c" + 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/v0.38.0/wasmtime-v0.38.0-aarch64-macos-c-api.tar.xz" - sha256: "1e424122c73418c972287043a50555569afb09dc721fb6630503bf455cbd2856" + 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/v0.38.0/wasmtime-v0.38.0-aarch64-linux-c-api.tar.xz" - sha256: "01dd81ac4eeff128ff762b6f2e61336b723a78b940006cd405f135e509046c4e" - "0.37.0": + 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/v0.37.0/wasmtime-v0.37.0-x86_64-windows-c-api.zip" - sha256: "1e2db8ccb86d2da0607aca783bb3c929562e4fa688a94452dffa745867494a2d" + 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/v0.37.0/wasmtime-v0.37.0-x86_64-mingw-c-api.zip" - sha256: "62966da16277aaf3312525c1e5ce08202d56c8450855bfaf7b319ffa4355fd52" + 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/v0.37.0/wasmtime-v0.37.0-x86_64-linux-c-api.tar.xz" - sha256: "7b8de351808eb4dd3186bcc18b8f54d6c486ec1f21961521be49d02d38833696" + 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/v0.37.0/wasmtime-v0.37.0-aarch64-linux-c-api.tar.xz" - sha256: "926c4736cc79835f880f5b6f193891960a4fc32464ca00871ffd7228605387d9" + 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/v0.37.0/wasmtime-v0.37.0-s390x-linux-c-api.tar.xz" - sha256: "cdcefd0394cfaefdac9eba9417016c7a916a063f567b483d6df09b883d9b5976" + 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/v0.37.0/wasmtime-v0.37.0-x86_64-macos-c-api.tar.xz" - sha256: "0f785932fc69105dcecbb2d7c1ceb0cd63dffa5e4b0b3f198c4c56118bdb4ecd" + 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/v0.37.0/wasmtime-v0.37.0-aarch64-macos-c-api.tar.xz" - sha256: "0a0f5fd2283f52b3ab725650a5dfc77a8bf53de962344fabc37418af9e5e407a" + 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/v0.37.0/wasmtime-v0.37.0-aarch64-linux-c-api.tar.xz" - sha256: "926c4736cc79835f880f5b6f193891960a4fc32464ca00871ffd7228605387d9" - "0.36.0": + 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": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-windows-c-api.zip" - sha256: "7c0cc05d73b376bce31964c99720cecd9f595fc4a338e4a45bbc04cca5780508" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-windows-c-api.zip" + sha256: "d09f31a8dcc6d38ac442a3b1d653137d5814cddad006b5e38151bbc4a9b9d692" 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" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-mingw-c-api.zip" + sha256: "1198d705bae1d09df15b8ae194d54dfd11bd90e2cc6fbb9aa13a7b000bd24ba9" 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" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-linux-c-api.tar.xz" + sha256: "cc9b137c0fddeb57a2d439fb8ad57e224a51e0e949cd8ea3fb4a6ee8bb1085d2" "armv8": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-aarch64-linux-c-api.tar.xz" - sha256: "865e73764fca8552734eea72d990d32a670e8e7079f8fc5f15d70cb03ef3c8d9" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-aarch64-linux-c-api.tar.xz" + sha256: "47a5fcad64a0e223cf1796eafd0fc9ca62c8b3e457942695397feb56382d3db1" "s390x": - url: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-s390x-linux-c-api.tar.xz" - sha256: "ec36bacf5b24b9da5ef1cdc979caf224412146d683ed6021f3bbd75adcb3754e" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-s390x-linux-c-api.tar.xz" + sha256: "18d32031a731e9f7d9dfdc9e75ac8210f88321b4c99b21e24bed6a25ba6cf0ca" 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" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-x86_64-macos-c-api.tar.xz" + sha256: "b2b9dd2a200e93889ce2bff637aacbc8c40dae9903fb30eda20ed52fd4ca83a4" "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" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-aarch64-macos-c-api.tar.xz" + sha256: "88bc1c36665d230206130a9d194b11b907438c86224ed184f2bee8ef348cf193" 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" + url: "https://github.com/bytecodealliance/wasmtime/releases/download/v7.0.0/wasmtime-v7.0.0-aarch64-linux-c-api.tar.xz" + sha256: "47a5fcad64a0e223cf1796eafd0fc9ca62c8b3e457942695397feb56382d3db1" diff --git a/recipes/wasmtime/all/test_package/CMakeLists.txt b/recipes/wasmtime/all/test_package/CMakeLists.txt index 6ed94adafb8e8..6836fa4cf17b6 100644 --- a/recipes/wasmtime/all/test_package/CMakeLists.txt +++ b/recipes/wasmtime/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 C) diff --git a/recipes/wasmtime/config.yml b/recipes/wasmtime/config.yml index e5ce53b819caa..5bcf55a2755ca 100644 --- a/recipes/wasmtime/config.yml +++ b/recipes/wasmtime/config.yml @@ -1,31 +1,19 @@ versions: - "12.0.2": - folder: all - "12.0.1": - folder: all - "9.0.1": - folder: all - "7.0.0": - folder: all - "6.0.1": - folder: all - "5.0.0": + "21.0.0": folder: all - "4.0.0": + "20.0.1": folder: all - "3.0.0": + "19.0.2": folder: all - "2.0.0": + "18.0.3": folder: all - "1.0.1": + "16.0.0": folder: all - "0.39.1": - folder: all - "0.38.0": + "12.0.2": folder: all - "0.37.0": + "9.0.1": folder: all - "0.36.0": + "7.0.0": folder: all - "0.35.1": + "6.0.1": folder: all diff --git a/recipes/watcher/all/conandata.yml b/recipes/watcher/all/conandata.yml index 857cc8ad36367..6976da974f6c5 100644 --- a/recipes/watcher/all/conandata.yml +++ b/recipes/watcher/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "0.12.0": + url: "https://github.com/e-dant/watcher/archive/release/0.12.0.tar.gz" + sha256: "9dd4758f4c45ae7925619ceee9e3bd5a0b33577aa5ac2cd857eca14d16749723" + "0.11.0": + url: "https://github.com/e-dant/watcher/archive/release/0.11.0.tar.gz" + sha256: "dd92496d77b6bc27e27ed28253faae4d81bc58b19407d154bb49504b2af73664" + "0.10.1": + url: "https://github.com/e-dant/watcher/archive/release/0.10.1.tar.gz" + sha256: "cc14b0adfc23ae90390cf8b4f20291abbc5bf0e358b5d12fa73f7e21d021ccd0" + "0.10.0": + url: "https://github.com/e-dant/watcher/archive/release/0.10.0.tar.gz" + sha256: "c15f088ddc41b58100921ea0b630bcbde83c9960aefecf82221da997f4d4b4ec" "0.9.5": url: "https://github.com/e-dant/watcher/archive/release/0.9.5.tar.gz" sha256: "41b74d138eec106c35a99e7544def599453a8bf4cf4887ad627e1c9e3355287c" @@ -11,26 +23,3 @@ sources: "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" - "0.6.0": - url: "https://github.com/e-dant/watcher/archive/release/0.6.0.tar.gz" - sha256: "156669c92f9119d658954e124fcd9fc640999fb8a45e2bd915ea8b05e15b925a" - "0.5.5": - url: "https://github.com/e-dant/watcher/archive/release/0.5.5.tar.gz" - sha256: "55da2b7a22cbdba836a405d5cab31a461e84e4e686a117f06399a806d33b2d09" - "0.5.4": - url: "https://github.com/e-dant/watcher/archive/release/0.5.4.tar.gz" - sha256: "0dac1d89886252bb0b999c2dad85aff283022a2b4393922a993459b180b8c663" - "0.5.2": - url: "https://github.com/e-dant/watcher/archive/release/0.5.2.tar.gz" - sha256: "e18e663f9a72a59fca3e7a9e125ca77823b03a3388aa569398965777c5671173" - "0.4.3": - url: "https://github.com/e-dant/watcher/archive/release/0.4.3.tar.gz" - sha256: "8603b45edfa5023752d9e2fdd731efe5a556a542aaf03f6be0e69c68f552b25a" -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" diff --git a/recipes/watcher/all/conanfile.py b/recipes/watcher/all/conanfile.py index a860da1f34772..167c9652d196e 100644 --- a/recipes/watcher/all/conanfile.py +++ b/recipes/watcher/all/conanfile.py @@ -1,11 +1,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy +from conan.tools.files import get, copy 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,6 +18,7 @@ class WatcherConan(ConanFile): topics = ("watch", "filesystem", "event", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" + no_copy_source = True @property def _min_cppstd(self): @@ -43,9 +43,6 @@ def _compilers_minimum_version(self): }, }.get(self._min_cppstd, {}) - def export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") @@ -71,9 +68,6 @@ def loose_lt_semver(v1, v2): 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( @@ -88,6 +82,6 @@ def package_info(self): self.cpp_info.libdirs = [] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.extend(["m", "pthread"]) if is_apple_os(self): self.cpp_info.frameworks = ["CoreFoundation", "CoreServices"] diff --git a/recipes/watcher/all/patches/0.5.5-fix-limits_max.patch b/recipes/watcher/all/patches/0.5.5-fix-limits_max.patch deleted file mode 100644 index aeed151aa95e0..0000000000000 --- a/recipes/watcher/all/patches/0.5.5-fix-limits_max.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/watcher/detail/adapter/adapter.hpp b/include/watcher/detail/adapter/adapter.hpp -index 3d43bb8..597c0bc 100644 ---- a/include/watcher/detail/adapter/adapter.hpp -+++ b/include/watcher/detail/adapter/adapter.hpp -@@ -23,7 +23,7 @@ namespace adapter { - - namespace { - inline constexpr size_t watch_count_max -- = std::numeric_limits::max() - 1; -+ = (std::numeric_limits::max)() - 1; - } /* namespace */ - - /* @brief wtr/watcher/detail/adapter/message diff --git a/recipes/watcher/all/test_package/CMakeLists.txt b/recipes/watcher/all/test_package/CMakeLists.txt index 7cb2b32a687ee..6b42da0b28e60 100644 --- a/recipes/watcher/all/test_package/CMakeLists.txt +++ b/recipes/watcher/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(watcher REQUIRED CONFIG) diff --git a/recipes/watcher/all/test_v1_package/CMakeLists.txt b/recipes/watcher/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 3154400093a96..0000000000000 --- a/recipes/watcher/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.12) - -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/watcher/all/test_v1_package/conanfile.py b/recipes/watcher/all/test_v1_package/conanfile.py deleted file mode 100644 index 20d4d2e28d57e..0000000000000 --- a/recipes/watcher/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/watcher/config.yml b/recipes/watcher/config.yml index 2b4b53a7cfb59..4670527815f92 100644 --- a/recipes/watcher/config.yml +++ b/recipes/watcher/config.yml @@ -1,21 +1,17 @@ versions: - "0.9.5": - folder: all - "0.9.2": - folder: all - "0.8.8": + "0.12.0": folder: all - "0.8.7": + "0.11.0": folder: all - "0.8.0": + "0.10.1": folder: all - "0.6.0": + "0.10.0": folder: all - "0.5.5": + "0.9.5": folder: all - "0.5.4": + "0.9.2": folder: all - "0.5.2": + "0.8.8": folder: all - "0.4.3": + "0.8.7": folder: all diff --git a/recipes/wavelet_buffer/all/test_package/CMakeLists.txt b/recipes/wavelet_buffer/all/test_package/CMakeLists.txt index 07b3926a7394a..2869d147934db 100644 --- a/recipes/wavelet_buffer/all/test_package/CMakeLists.txt +++ b/recipes/wavelet_buffer/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(WaveletBufferTest LANGUAGES CXX) find_package(wavelet_buffer CONFIG REQUIRED) diff --git a/recipes/wavelet_buffer/all/test_v1_package/CMakeLists.txt b/recipes/wavelet_buffer/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/wavelet_buffer/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wavelet_buffer/all/test_v1_package/conanfile.py b/recipes/wavelet_buffer/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/wavelet_buffer/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/wayland-protocols/all/conandata.yml b/recipes/wayland-protocols/all/conandata.yml index 9574e69bcf1e9..83d5a98b67c30 100644 --- a/recipes/wayland-protocols/all/conandata.yml +++ b/recipes/wayland-protocols/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.42": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.42/downloads/wayland-protocols-1.42.tar.xz" + sha256: "23ba80d410d1200a86fe29592c19766eae8f1c350b67289999e9e7ea12d9f7aa" + "1.36": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.36/downloads/wayland-protocols-1.36.tar.xz" + sha256: "71fd4de05e79f9a1ca559fac30c1f8365fa10346422f9fe795f74d77b9ef7e92" + "1.33": + url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.33/downloads/wayland-protocols-1.33.tar.xz" + sha256: "94f0c50b090d6e61a03f62048467b19abbe851be4e11ae7b36f65f8b98c3963a" "1.32": url: "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.32/downloads/wayland-protocols-1.32.tar.xz" sha256: "7459799d340c8296b695ef857c07ddef24c5a09b09ab6a74f7b92640d2b1ba11" diff --git a/recipes/wayland-protocols/all/conanfile.py b/recipes/wayland-protocols/all/conanfile.py index ad20a22df526e..399e6fc1f236a 100644 --- a/recipes/wayland-protocols/all/conanfile.py +++ b/recipes/wayland-protocols/all/conanfile.py @@ -1,4 +1,4 @@ -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, get, replace_in_file, rmdir from conan.tools.layout import basic_layout @@ -7,7 +7,7 @@ from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class WaylandProtocolsConan(ConanFile): @@ -18,6 +18,7 @@ class WaylandProtocolsConan(ConanFile): homepage = "https://gitlab.freedesktop.org/wayland/wayland-protocols" license = "MIT" settings = "os", "arch", "compiler", "build_type" + short_paths = True def package_id(self): self.info.clear() @@ -38,11 +39,10 @@ def source(self): def generate(self): tc = MesonToolchain(self) - tc.project_options["datadir"] = os.path.join(self.package_folder, "res") + # Using relative folder because of this https://github.com/conan-io/conan/pull/15706 + tc.project_options["datadir"] = "res" tc.project_options["tests"] = "false" tc.generate() - virtual_build_env = VirtualBuildEnv(self) - virtual_build_env.generate() def _patch_sources(self): if Version(self.version) <= "1.23": @@ -50,6 +50,10 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "dep_scanner = dependency('wayland-scanner', native: true)", "#dep_scanner = dependency('wayland-scanner', native: true)") + elif Version(self.version) >= "1.42": + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "dep_scanner = dependency('wayland-scanner',", + "dep_scanner = dependency('wayland-scanner', required: false, disabler: true,") def build(self): self._patch_sources() @@ -68,10 +72,10 @@ def package_info(self): 'datarootdir': '${prefix}/res', 'pkgdatadir': '${datarootdir}/wayland-protocols', } - self.cpp_info.set_property( - "pkg_config_custom_content", - "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items())) - + # TODO: Remove when Conan 1.x not supported + pkgconfig_variables = pkgconfig_variables if conan_version.major >= 2 \ + else "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items()) + self.cpp_info.set_property("pkg_config_custom_content", pkgconfig_variables) self.cpp_info.libdirs = [] self.cpp_info.includedirs = [] self.cpp_info.bindirs = [] diff --git a/recipes/wayland-protocols/all/test_package/conanfile.py b/recipes/wayland-protocols/all/test_package/conanfile.py index d6a32dbe0d2d5..f8d12a575d00c 100644 --- a/recipes/wayland-protocols/all/test_package/conanfile.py +++ b/recipes/wayland-protocols/all/test_package/conanfile.py @@ -38,8 +38,6 @@ def generate(self): pkg_config_deps.build_context_activated = ["wayland"] pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} pkg_config_deps.generate() - virtual_build_env = VirtualBuildEnv(self) - virtual_build_env.generate() def build(self): meson = Meson(self) diff --git a/recipes/wayland-protocols/all/test_v1_package/conanfile.py b/recipes/wayland-protocols/all/test_v1_package/conanfile.py deleted file mode 100644 index 37376c2138077..0000000000000 --- a/recipes/wayland-protocols/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +0,0 @@ -from conans import Meson, tools -from conan import ConanFile -from conan.tools.build import cross_building -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "pkg_config" - - def build_requirements(self): - self.build_requires("wayland/1.21.0") - self.build_requires("meson/1.0.0") - - def requirements(self): - self.requires("wayland/1.21.0") - - def build(self): - meson = Meson(self) - env_build = tools.RunEnvironment(self) - with tools.environment_append(env_build.vars): - meson.configure() - meson.build() - - def test(self): - if not cross_building(self): - self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/wayland-protocols/all/test_v1_package/meson.build b/recipes/wayland-protocols/all/test_v1_package/meson.build deleted file mode 100644 index d1776cc1915fd..0000000000000 --- a/recipes/wayland-protocols/all/test_v1_package/meson.build +++ /dev/null @@ -1,30 +0,0 @@ -project('test_wayland_protocols', 'c') - -wayland_client_dep = dependency('wayland-client', version: '>=1.2.0', required: true) -wayland_protocols_dep = dependency('wayland-protocols', required: true) -wayland_protocols_datadir = wayland_protocols_dep.get_pkgconfig_variable('pkgdatadir') - -wayland_scanner = find_program('wayland-scanner') -wayland_scanner_code_gen = generator( - wayland_scanner, - output: '@BASENAME@-protocol.c', - arguments: ['code', '@INPUT@', '@OUTPUT@'], -) -wayland_scanner_client_header_gen = generator( - wayland_scanner, - output: '@BASENAME@-client-protocol.h', - arguments: ['client-header', '@INPUT@', '@OUTPUT@'], -) - -xdg_shell_xml = wayland_protocols_datadir/'stable/xdg-shell/xdg-shell.xml' - -xdg_shell_sources = [ - wayland_scanner_code_gen.process(xdg_shell_xml), - wayland_scanner_client_header_gen.process(xdg_shell_xml), -] - -executable('test_package', - '../test_package/test_package.c', - xdg_shell_sources, - dependencies: [wayland_client_dep], - link_args : '-lrt') diff --git a/recipes/wayland-protocols/config.yml b/recipes/wayland-protocols/config.yml index f707ca2da06d2..64fa89c4b35bb 100644 --- a/recipes/wayland-protocols/config.yml +++ b/recipes/wayland-protocols/config.yml @@ -1,4 +1,10 @@ versions: + "1.42": + folder: all + "1.36": + folder: all + "1.33": + folder: all "1.32": folder: all "1.31": diff --git a/recipes/wayland/all/conandata.yml b/recipes/wayland/all/conandata.yml index 02888e74f53f7..fd05ff5a3e0d6 100644 --- a/recipes/wayland/all/conandata.yml +++ b/recipes/wayland/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.23.0": + url: "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.23.0/downloads/wayland-1.23.0.tar.xz" + sha256: "05b3e1574d3e67626b5974f862f36b5b427c7ceeb965cb36a4e6c2d342e45ab2" "1.22.0": url: "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.22.0/downloads/wayland-1.22.0.tar.xz" sha256: "1540af1ea698a471c2d8e9d288332c7e0fd360c8f1d12936ebb7e7cbc2425842" diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py index d23bcb66ab8ee..898e5cd5e6b1d 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,18 +50,18 @@ def requirements(self): if self.options.enable_libraries: self.requires("libffi/3.4.4") if self.options.enable_dtd_validation: - self.requires("libxml2/2.12.2") - self.requires("expat/2.5.0") + self.requires("libxml2/[>=2.12.5 <3]") + self.requires("expat/[>=2.6.2 <3]") def validate(self): - if self.settings.os != "Linux": - raise ConanInvalidConfiguration(f"{self.ref} only supports Linux") + if self.settings.os not in ("Linux", "Android"): + raise ConanInvalidConfiguration(f"{self.ref} only supports Linux or Android") def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/[>=1.4.0 <2]") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/2.1.0") - if cross_building(self): + self.tool_requires("pkgconf/[>=2.2 <3]") + 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 @@ -133,7 +133,9 @@ def package_info(self): self.cpp_info.components["wayland-server"].libs = ["wayland-server"] self.cpp_info.components["wayland-server"].set_property("pkg_config_name", "wayland-server") self.cpp_info.components["wayland-server"].requires = ["libffi::libffi"] - self.cpp_info.components["wayland-server"].system_libs = ["pthread", "m"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["wayland-server"].system_libs = ["pthread", "m"] + self.cpp_info.components["wayland-server"].resdirs = ["res"] if self.version >= Version("1.21.0") and self.settings.os == "Linux": self.cpp_info.components["wayland-server"].system_libs += ["rt"] @@ -149,7 +151,8 @@ def package_info(self): self.cpp_info.components["wayland-client"].libs = ["wayland-client"] self.cpp_info.components["wayland-client"].set_property("pkg_config_name", "wayland-client") self.cpp_info.components["wayland-client"].requires = ["libffi::libffi"] - self.cpp_info.components["wayland-client"].system_libs = ["pthread", "m"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["wayland-client"].system_libs = ["pthread", "m"] self.cpp_info.components["wayland-client"].resdirs = ["res"] if self.version >= Version("1.21.0") and self.settings.os == "Linux": self.cpp_info.components["wayland-client"].system_libs += ["rt"] @@ -174,6 +177,3 @@ def package_info(self): self.cpp_info.components["wayland-egl-backend"].set_property("pkg_config_name", "wayland-egl-backend") self.cpp_info.components["wayland-egl-backend"].set_property("component_version", "3") - - # TODO: to remove in conan v2 - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/wayland/all/test_package/conanfile.py b/recipes/wayland/all/test_package/conanfile.py index ad22b7b8367de..82a45a316a981 100644 --- a/recipes/wayland/all/test_package/conanfile.py +++ b/recipes/wayland/all/test_package/conanfile.py @@ -3,25 +3,18 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain -from conan.tools.env import VirtualBuildEnv from conan.tools.gnu import PkgConfig, PkgConfigDeps class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - test_type = "explicit" - - @property - def _has_build_profile(self): - return hasattr(self, "settings_build") def requirements(self): self.requires(self.tested_reference_str) 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/2.1.0") + self.tool_requires("pkgconf/[2.2 <3]") def layout(self): cmake_layout(self) @@ -32,21 +25,16 @@ def generate(self): cmake_deps = CMakeDeps(self) cmake_deps.generate() pkg_config_deps = PkgConfigDeps(self) - if self._has_build_profile: - pkg_config_deps.build_context_activated = ["wayland"] - pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} pkg_config_deps.generate() - virtual_build_env = VirtualBuildEnv(self) - virtual_build_env.generate() def build(self): cmake = CMake(self) cmake.configure() cmake.build() - if self._has_build_profile: - pkg_config = PkgConfig(self, "wayland-scanner_BUILD", self.generators_folder) - wayland_scanner = pkg_config.variables["wayland_scanner"] + pkg_config = PkgConfig(self, "wayland-scanner", self.generators_folder) + wayland_scanner = pkg_config.variables["wayland_scanner"] + if can_run(self): self.run(f"{wayland_scanner} --version", env="conanrun") def test(self): diff --git a/recipes/wayland/all/test_v1_package/CMakeLists.txt b/recipes/wayland/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/wayland/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wayland/all/test_v1_package/conanfile.py b/recipes/wayland/all/test_v1_package/conanfile.py deleted file mode 100644 index e7b714f005817..0000000000000 --- a/recipes/wayland/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,21 +0,0 @@ -import os - -from conan import ConanFile -from conan.tools.build import cross_building -from conans import 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): - self.run("wayland-scanner --version", run_environment=True) - cmd = os.path.join(self.build_folder, "bin", "test_package") - self.run(cmd, run_environment=True) diff --git a/recipes/wayland/config.yml b/recipes/wayland/config.yml index 27ca5fdc22826..077dbaede856b 100644 --- a/recipes/wayland/config.yml +++ b/recipes/wayland/config.yml @@ -1,4 +1,6 @@ versions: + "1.23.0": + folder: all "1.22.0": folder: all "1.21.0": diff --git a/recipes/websocketpp/all/conanfile.py b/recipes/websocketpp/all/conanfile.py index 8bc3d40999ef3..45cb59634acad 100644 --- a/recipes/websocketpp/all/conanfile.py +++ b/recipes/websocketpp/all/conanfile.py @@ -71,4 +71,4 @@ def package_info(self): self.cpp_info.defines.extend(["ASIO_STANDALONE", "_WEBSOCKETPP_CPP11_STL_"]) self.cpp_info.requires.append("asio::asio") elif self.options.asio == "boost": - self.cpp_info.requires.append("boost::headers") + self.cpp_info.requires.extend(["boost::headers","boost::random"] ) diff --git a/recipes/websocketpp/all/test_package/CMakeLists.txt b/recipes/websocketpp/all/test_package/CMakeLists.txt index d6d230796653e..da7c84de286cf 100644 --- a/recipes/websocketpp/all/test_package/CMakeLists.txt +++ b/recipes/websocketpp/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(websocketpp REQUIRED CONFIG) diff --git a/recipes/websocketpp/all/test_package/test_package.cpp b/recipes/websocketpp/all/test_package/test_package.cpp index 0ac4a3bb71f1e..659a35e83f88a 100644 --- a/recipes/websocketpp/all/test_package/test_package.cpp +++ b/recipes/websocketpp/all/test_package/test_package.cpp @@ -1,7 +1,12 @@ #include #include +#include +#include + int main() { websocketpp::server server; + + websocketpp::client client; } diff --git a/recipes/websocketpp/all/test_v1_package/CMakeLists.txt b/recipes/websocketpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/websocketpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/websocketpp/all/test_v1_package/conanfile.py b/recipes/websocketpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/websocketpp/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_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/wg21-linear_algebra/all/test_package/CMakeLists.txt b/recipes/wg21-linear_algebra/all/test_package/CMakeLists.txt index 61165ba3ffe02..59a9b0252ca65 100644 --- a/recipes/wg21-linear_algebra/all/test_package/CMakeLists.txt +++ b/recipes/wg21-linear_algebra/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(wg21_linear_algebra REQUIRED CONFIG) diff --git a/recipes/wg21-linear_algebra/all/test_v1_package/CMakeLists.txt b/recipes/wg21-linear_algebra/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index daf2832b167b8..0000000000000 --- a/recipes/wg21-linear_algebra/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wg21-linear_algebra/all/test_v1_package/conanfile.py b/recipes/wg21-linear_algebra/all/test_v1_package/conanfile.py deleted file mode 100644 index 7e264aad8e8ec..0000000000000 --- a/recipes/wg21-linear_algebra/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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/whereami/all/test_v1_package/CMakeLists.txt b/recipes/whereami/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/whereami/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/whereami/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", "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 index 7514fc59eab2f..3c4a88fb9a1ad 100644 --- a/recipes/whisper-cpp/all/conandata.yml +++ b/recipes/whisper-cpp/all/conandata.yml @@ -1,15 +1,21 @@ sources: - "1.2.1": - url: "https://github.com/ggerganov/whisper.cpp/archive/ad1389003d3f8bd47b8ca7d4c21b4764cc3844fc.tar.gz" - sha256: "e1459ddfe45430b68a1951e4e071478180a3a100a68c0d54f78d113c735e6363" - "1.4.2": - url: "https://github.com/ggerganov/whisper.cpp/archive/a5defbc1b98bea0f070331ce1e8b62d947b0443d.tar.gz" - sha256: "6dd0690b084269b22b1b749103b047e6d45d7b910d7bc9587085ce057dca5431" - "1.4.3": - url: "https://github.com/ggerganov/whisper.cpp/archive/6a5d195109994b865e1c92a88258ac182399eb64.tar.gz" - sha256: "5b6693c314ae6fb362c13d02357a18099ab0ba03abc07c21f2e8c32b42b7b07e" + "1.7.5": + url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.7.5.tar.gz" + sha256: "2fda42b57b7b8427d724551bd041616d85401fb9382e42b0349132a28920a34f" + "1.7.4": + url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.7.4.tar.gz" + sha256: "9ce7b33028793fcbf62f81f1fd087af7778dace8772eaba8c43c66bf0c8a3eed" + "1.7.2": + url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.7.2.tar.gz" + sha256: "d48e1b5b6ee18b931e98ac791eba838f83eb3b81bb8917db37fe9a79fa5e3ccb" + "1.6.2": + url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.6.2.tar.gz" + sha256: "da7988072022acc3cfa61b370b3c51baad017f1900c3dc4e68cb276499f66894" + "1.5.2": + url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.5.2.tar.gz" + sha256: "be9c4d5d4b5f28f02e36f28e602b7d2dcfd734dd1c834ddae91ae8db601e951f" patches: - "1.4.2": - - patch_file: "patches/1.4.2-0001-find_package_openblas.patch" - patch_description: "Fix OpenBlas cmake target name" + "1.6.2": + - patch_file: "patches/1.6.2-0001-remove_hardcoded_cxxstd.patch" + patch_description: "Remove hardcoded CMAKE_CXX_STANDARD" patch_type: "conan" diff --git a/recipes/whisper-cpp/all/conanfile.py b/recipes/whisper-cpp/all/conanfile.py index 629ef7bb98046..e269efe62f4ff 100644 --- a/recipes/whisper-cpp/all/conanfile.py +++ b/recipes/whisper-cpp/all/conanfile.py @@ -5,10 +5,10 @@ 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.files import apply_conandata_patches, copy, export_conandata_patches, get, rm from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class WhisperCppConan(ConanFile): @@ -19,16 +19,42 @@ class WhisperCppConan(ConanFile): 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} + 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], + "with_openvino": [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": True, + "metal_ndebug": False, + "with_coreml": False, + "coreml_allow_fallback": False, + "with_blas": False, + "with_openvino": False, + } package_type = "library" @property @@ -47,10 +73,16 @@ def _compilers_minimum_version(self): }, }.get(self._min_cppstd, {}) + @property + def _is_openvino_option_available(self): + return Version(self.version) >= "1.5.2" + def config_options(self): if is_apple_os(self): del self.options.with_blas else: + del self.options.metal + del self.options.metal_ndebug del self.options.no_accelerate del self.options.with_coreml del self.options.coreml_allow_fallback @@ -58,9 +90,8 @@ def config_options(self): 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 + if not self._is_openvino_option_available: + del self.options.with_openvino def configure(self): if self.options.shared: @@ -82,7 +113,9 @@ def validate(self): def requirements(self): if not is_apple_os(self): if self.options.with_blas: - self.requires("openblas/0.3.20") + self.requires("openblas/0.3.24") + if self.options.get_safe("with_openvino"): + self.requires("openvino/2023.2.0") def layout(self): cmake_layout(self, src_folder="src") @@ -95,6 +128,7 @@ def source(self): def generate(self): deps = CMakeDeps(self) + deps.set_property("openblas", "cmake_file_name", "BLAS") deps.generate() tc = CMakeToolchain(self) @@ -118,17 +152,27 @@ def generate(self): if self.options.no_f16c: tc.variables["WHISPER_NO_F16C"] = True + # TODO: Implement OpenMP support + tc.variables["GGML_OPENMP"] = False + + if self.options.get_safe("with_openvino"): + tc.variables["WHISPER_OPENVINO"] = True + # TODO: remove with Conan 1.x support + tc.variables["CMAKE_CXX_STANDARD"] = str(self.settings.get_safe("compiler.cppstd", 11)).replace("gnu", "") + 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 + if Version(self.version) >= "1.7.0": + tc.variables["GGML_METAL"] = self.options.metal + else: + tc.variables["WHISPER_METAL"] = self.options.metal else: if self.options.with_blas: if Version(self.version) >= "1.4.2": @@ -148,17 +192,33 @@ def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() + rm(self, "*.cmake", self.package_folder, recursive=True) + rm(self, "*.pc", self.package_folder, recursive=True) 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"] + if Version(self.version) >= "1.7.0": + self.cpp_info.libs.append("ggml") + if Version(self.version) >= "1.7.3": + self.cpp_info.libs.extend(["ggml-base", "ggml-cpu"]) self.cpp_info.resdirs = ["res"] - self.cpp_info.libdirs = ["lib", "lib/static"] + if Version(self.version) < "1.7.0": + self.cpp_info.libdirs = ["lib", "lib/static"] + + if self.options.get_safe("with_blas"): + self.cpp_info.requires = ["ggml-blas"] + if self.options.get_safe("with_openvino"): + self.cpp_info.requires = ["openvino::Runtime"] 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") + if self.options.get_safe("metal"): + self.cpp_info.frameworks.extend(["CoreFoundation", "Foundation", "Metal", "MetalKit"]) + if Version(self.version) >= "1.7.3": + self.cpp_info.libs.extend(["ggml-metal", "ggml-blas"]) 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.4.2-0001-find_package_openblas.patch b/recipes/whisper-cpp/all/patches/1.4.2-0001-find_package_openblas.patch deleted file mode 100644 index 52b554a4dff49..0000000000000 --- a/recipes/whisper-cpp/all/patches/1.4.2-0001-find_package_openblas.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 92b5d0c..b0c2c86 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -127,17 +127,9 @@ if (APPLE) - endif() - - if (WHISPER_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(OpenBLAS REQUIRED CONFIG) -+ set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} OpenBLAS::OpenBLAS) -+ set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_OPENBLAS) - endif() - - if (WHISPER_CUBLAS) diff --git a/recipes/whisper-cpp/all/patches/1.6.2-0001-remove_hardcoded_cxxstd.patch b/recipes/whisper-cpp/all/patches/1.6.2-0001-remove_hardcoded_cxxstd.patch new file mode 100644 index 0000000000000..9e041fd99d19b --- /dev/null +++ b/recipes/whisper-cpp/all/patches/1.6.2-0001-remove_hardcoded_cxxstd.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 82913aa..f3a2d27 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,8 +125,6 @@ find_package(Threads REQUIRED) + #compile flag sycl + if (WHISPER_SYCL) + set(CMAKE_CXX_STANDARD 17) +-else() +- set(CMAKE_CXX_STANDARD 11) + endif() + + if (WHISPER_FFMPEG) diff --git a/recipes/whisper-cpp/config.yml b/recipes/whisper-cpp/config.yml index ab276865b774a..3162fd31c73eb 100644 --- a/recipes/whisper-cpp/config.yml +++ b/recipes/whisper-cpp/config.yml @@ -1,7 +1,11 @@ versions: - "1.2.1": + "1.7.5": folder: "all" - "1.4.2": + "1.7.4": folder: "all" - "1.4.3": + "1.7.2": + folder: "all" + "1.6.2": + folder: "all" + "1.5.2": folder: "all" diff --git a/recipes/wil/all/conandata.yml b/recipes/wil/all/conandata.yml index f61d76458812c..4dda604c7c75a 100644 --- a/recipes/wil/all/conandata.yml +++ b/recipes/wil/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "1.0.240803.1": + url: "https://github.com/microsoft/wil/archive/refs/tags/v1.0.240803.1.tar.gz" + sha256: "39910ab105c6df345e4018a2b61dfbc909a8816c971a3d2cebbefa1f8c481cc6" + "1.0.240122.1": + url: "https://github.com/microsoft/wil/archive/refs/tags/v1.0.240122.1.tar.gz" + sha256: "e599f2843c01b9e4827e46f11d3651180675c8ecdbba8bdae735f533672989d3" + "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" diff --git a/recipes/wil/all/test_package/CMakeLists.txt b/recipes/wil/all/test_package/CMakeLists.txt index 69bc898ac6c03..d64c6b313191b 100644 --- a/recipes/wil/all/test_package/CMakeLists.txt +++ b/recipes/wil/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(wil REQUIRED CONFIG) diff --git a/recipes/wil/all/test_v1_package/CMakeLists.txt b/recipes/wil/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/wil/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wil/all/test_v1_package/conanfile.py b/recipes/wil/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/wil/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/wil/config.yml b/recipes/wil/config.yml index f2dcd6f1c34e1..67c36e1a1f315 100644 --- a/recipes/wil/config.yml +++ b/recipes/wil/config.yml @@ -1,4 +1,10 @@ versions: + "1.0.240803.1": + folder: "all" + "1.0.240122.1": + folder: "all" + "1.0.231216.1": + folder: "all" "1.0.231028.1": folder: "all" "1.0.230824.2": diff --git a/recipes/wildcards/all/conandata.yml b/recipes/wildcards/all/conandata.yml new file mode 100644 index 0000000000000..466e54e9a7c61 --- /dev/null +++ b/recipes/wildcards/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.4.0": + url: "https://github.com/zemasoft/wildcards/archive/refs/tags/v1.4.0.tar.gz" + sha256: "da8846215df2c1493e9796392d9e17ca2da8cfeae0f718fe1d6e0544cbcfaa0f" diff --git a/recipes/wildcards/all/conanfile.py b/recipes/wildcards/all/conanfile.py new file mode 100644 index 0000000000000..ea532ea715b2a --- /dev/null +++ b/recipes/wildcards/all/conanfile.py @@ -0,0 +1,53 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +required_conan_version = ">=1.52.0" + + +class PackageConan(ConanFile): + name = "wildcards" + description = "A simple C++ header-only template library implementing matching using wildcards" + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zemasoft/wildcards" + topics = ("template", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + 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, 11) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WILDCARDS_BUILD_TESTS"] = False + tc.variables["WILDCARDS_BUILD_EXAMPLES"] = False + tc.generate() + + def build(self): + # INFO: Wildcards uses CMake to generate wildcards.hpp + cmake = CMake(self) + cmake.configure() + + def package(self): + copy(self, "LICENSE_1_0.txt", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include", "wildcards")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.includedirs.append(os.path.join("include", "wildcards")) diff --git a/recipes/wildcards/all/test_package/CMakeLists.txt b/recipes/wildcards/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5d849260e8ce8 --- /dev/null +++ b/recipes/wildcards/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(wildcards REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE wildcards::wildcards) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/wildcards/all/test_package/conanfile.py b/recipes/wildcards/all/test_package/conanfile.py new file mode 100644 index 0000000000000..3a91c9439218e --- /dev/null +++ b/recipes/wildcards/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/wildcards/all/test_package/test_package.cpp b/recipes/wildcards/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..076aaeb8e51e2 --- /dev/null +++ b/recipes/wildcards/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include + +#include "wildcards.hpp" + + +int main(void) { + wildcards::match("Hello, World!", "H*World?"); + + return EXIT_SUCCESS; +} diff --git a/recipes/wildcards/config.yml b/recipes/wildcards/config.yml new file mode 100644 index 0000000000000..c957e4bc2d3c7 --- /dev/null +++ b/recipes/wildcards/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all diff --git a/recipes/wildmidi/all/test_package/CMakeLists.txt b/recipes/wildmidi/all/test_package/CMakeLists.txt index 583b61deec33c..2d645510603dc 100644 --- a/recipes/wildmidi/all/test_package/CMakeLists.txt +++ b/recipes/wildmidi/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) diff --git a/recipes/wildmidi/all/test_v1_package/CMakeLists.txt b/recipes/wildmidi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/wildmidi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wildmidi/all/test_v1_package/conanfile.py b/recipes/wildmidi/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/wildmidi/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/wilzegers-autotest/all/test_v1_package/CMakeLists.txt b/recipes/wilzegers-autotest/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/wilzegers-autotest/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/wilzegers-autotest/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", "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/wineditline/all/CMakeLists.txt b/recipes/wineditline/all/CMakeLists.txt deleted file mode 100644 index 1fedb144d2f6c..0000000000000 --- a/recipes/wineditline/all/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) - -project(WinEditLineWrapper C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -add_subdirectory(source_subfolder) diff --git a/recipes/wineditline/all/conandata.yml b/recipes/wineditline/all/conandata.yml index 789f36bc66156..d9e2a2c6f39a9 100644 --- a/recipes/wineditline/all/conandata.yml +++ b/recipes/wineditline/all/conandata.yml @@ -1,8 +1,4 @@ sources: "2.206": sha256: "2d255c417244e963261dc6171684265f405df030e90ba6e6690a99284d645161" - url: https://sourceforge.net/projects/mingweditline/files/wineditline-2.206.zip/download -patches: - "2.206": - - patch_file: patches/0001-fix-cmakelists.patch - base_path: source_subfolder + url: "https://sourceforge.net/projects/mingweditline/files/wineditline-2.206.zip" diff --git a/recipes/wineditline/all/conanfile.py b/recipes/wineditline/all/conanfile.py index 3888bf2a8557f..1a01961f91168 100644 --- a/recipes/wineditline/all/conanfile.py +++ b/recipes/wineditline/all/conanfile.py @@ -1,64 +1,63 @@ -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 WineditlineConan(ConanFile): name = "wineditline" - description = ( - "A BSD-licensed EditLine API implementation for the native " - "Windows Console" - ) + description = "A BSD-licensed EditLine API implementation for the native Windows Console" + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "http://mingweditline.sourceforge.net/" topics = ("readline", "editline", "windows") - license = "BSD-3-Clause" - generators = ("cmake",) - settings = ("os", "arch", "compiler", "build_type") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], } default_options = { "shared": False, } - exports_sources = ("patches/*", "CMakeLists.txt") + provides = "editline" + + @property + def _target_name(self): + return "edit" if self.options.shared else "edit_static" + + 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 validate(self): if self.settings.os != "Windows": - message = "wineditline is supported only on Windows." - raise ConanInvalidConfiguration(message) - - @property - def _source_subfolder(self): - return "source_subfolder" + raise ConanInvalidConfiguration(f"{self.ref} is supported only on Windows.") 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) - def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + 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 - - def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - self._configure_cmake().build() + cmake.build(target=self._target_name) def package(self): - self.copy("COPYING", "licenses", self._source_subfolder) - self._configure_cmake().install() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "*.h", dst=os.path.join(self.package_folder, "include", "editline"), src=os.path.join(self.source_folder, "src", "editline")) + copy(self, "*.lib", 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 = ["edit"] + self.cpp_info.libs = [self._target_name] diff --git a/recipes/wineditline/all/patches/0001-fix-cmakelists.patch b/recipes/wineditline/all/patches/0001-fix-cmakelists.patch deleted file mode 100644 index ef01b0ca0616b..0000000000000 --- a/recipes/wineditline/all/patches/0001-fix-cmakelists.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -1,25 +1,16 @@ --cmake_minimum_required (VERSION 2.6) --project (WinEditLine) --set (WinEditLine_VERSION_MAJOR 2) --set (WinEditLine_VERSION_MINOR 2) --if (MSVC AND MSVC_USE_STATIC_RUNTIME) --foreach(flag_var -- CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE -- CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) -- if(${flag_var} MATCHES "/MD") -- string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") -- endif(${flag_var} MATCHES "/MD") --endforeach(flag_var) --endif() --if(NOT DEFINED LIB_SUFFIX) -- if(CMAKE_SIZEOF_VOID_P MATCHES 4) -- set(LIB_SUFFIX "32") -- else() -- set(LIB_SUFFIX "64") -- endif() --endif() --configure_file ( -- "${PROJECT_SOURCE_DIR}/src/config.h.in" -- "${PROJECT_BINARY_DIR}/config.h" -+cmake_minimum_required(VERSION 3.1) -+ -+project(WinEditLine C) -+ -+add_library(edit src/editline.c src/fn_complete.c src/history.c src/libedit.def) -+target_include_directories(edit PRIVATE src) -+ -+include(GNUInstallDirs) -+ -+install( -+ TARGETS edit -+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ) --add_subdirectory (src) -+ -+install(DIRECTORY src/editline DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes/wineditline/all/test_package/CMakeLists.txt b/recipes/wineditline/all/test_package/CMakeLists.txt index 84a38c545c793..3d8aa097f7a2f 100644 --- a/recipes/wineditline/all/test_package/CMakeLists.txt +++ b/recipes/wineditline/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(wineditline REQUIRED CONFIG) add_executable(test_package test_package.c) diff --git a/recipes/wineditline/all/test_package/conanfile.py b/recipes/wineditline/all/test_package/conanfile.py index ec80e0c5cc134..ef5d7042163ec 100644 --- a/recipes/wineditline/all/test_package/conanfile.py +++ b/recipes/wineditline/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/wineditline/all/test_package/test_package.c b/recipes/wineditline/all/test_package/test_package.c index b51e6feba3274..452b5269fcee7 100644 --- a/recipes/wineditline/all/test_package/test_package.c +++ b/recipes/wineditline/all/test_package/test_package.c @@ -1,12 +1,7 @@ #include #include -int main(int argc, char const* argv[]) -{ - (void)argc; - (void)argv; - - free_history_entry(NULL); - - return 0; +int main() { + free_history_entry(NULL); + return 0; } diff --git a/recipes/winflexbison/all/conanfile.py b/recipes/winflexbison/all/conanfile.py index 96dfb9c1906e9..6c078d49dc1cf 100644 --- a/recipes/winflexbison/all/conanfile.py +++ b/recipes/winflexbison/all/conanfile.py @@ -1,10 +1,11 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, save +from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1" class WinflexbisonConan(ConanFile): @@ -34,6 +35,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "2.5.25": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): @@ -83,8 +87,3 @@ def package_info(self): yacc_path = os.path.join(self.package_folder, "bin", "win_bison -y").replace("\\", "/") self.output.info("Setting YACC environment variable: {}".format(yacc_path)) self.buildenv_info.define_path("YACC", yacc_path) - - # TODO: to remove in conan v2 - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) - self.env_info.LEX = lex_path - self.env_info.YACC = yacc_path diff --git a/recipes/winflexbison/all/test_package/CMakeLists.txt b/recipes/winflexbison/all/test_package/CMakeLists.txt index 04ea866fea355..e9e262c166507 100644 --- a/recipes/winflexbison/all/test_package/CMakeLists.txt +++ b/recipes/winflexbison/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 C CXX) # Flex diff --git a/recipes/winflexbison/all/test_v1_package/CMakeLists.txt b/recipes/winflexbison/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/winflexbison/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/winflexbison/all/test_v1_package/conanfile.py b/recipes/winflexbison/all/test_v1_package/conanfile.py deleted file mode 100644 index 744b30cd87048..0000000000000 --- a/recipes/winflexbison/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake" - test_type = "explicit" - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - self.run("win_flex --version") - self.run("win_bison --version") - if not tools.cross_building(self, skip_x64_x86=True): - bison_test = os.path.join("bin", "bison_test_package") - self.run(bison_test, run_environment=True) - flex_test = os.path.join("bin", "flex_test_package") - basic_nr_txt = os.path.join(self.source_folder, os.pardir, "test_package", "basic_nr.txt") - self.run(f"{flex_test} {basic_nr_txt}", run_environment=True) diff --git a/recipes/winmd/all/test_package/CMakeLists.txt b/recipes/winmd/all/test_package/CMakeLists.txt index 64e3b97db4f96..f2e32f7027c9e 100644 --- a/recipes/winmd/all/test_package/CMakeLists.txt +++ b/recipes/winmd/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(winmd REQUIRED CONFIG) diff --git a/recipes/winmd/all/test_v1_package/CMakeLists.txt b/recipes/winmd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/winmd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/winmd/all/test_v1_package/conanfile.py b/recipes/winmd/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/winmd/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/winreg/all/conandata.yml b/recipes/winreg/all/conandata.yml new file mode 100644 index 0000000000000..4a90ca44d78e9 --- /dev/null +++ b/recipes/winreg/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "6.2.0": + url: "https://github.com/GiovanniDicanio/WinReg/archive/refs/tags/v6.2.0.tar.gz" + sha256: "9dc1b287fb8c765a35791bf0deea0da81e52a969827bc2d8777f54f26ade588d" diff --git a/recipes/winreg/all/conanfile.py b/recipes/winreg/all/conanfile.py new file mode 100644 index 0000000000000..13ef7cc69e291 --- /dev/null +++ b/recipes/winreg/all/conanfile.py @@ -0,0 +1,53 @@ +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 +import os + +required_conan_version = ">=1.50.0" + + +class WinregConan(ConanFile): + name = "winreg" + homepage = "https://github.com/GiovanniDicanio/WinReg" + description = "Convenient high-level C++ wrapper around the Windows Registry API." + topics = "registry", "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 _minimum_cpp_standard(self): + return 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: + check_min_cppstd(self, self._minimum_cpp_standard) + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("WinReg is only supported on Windows") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + pass + + def build(self): + pass + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.hpp", os.path.join(self.source_folder, "WinReg"), os.path.join(self.package_folder, "include/WinReg")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/winreg/all/test_package/CMakeLists.txt b/recipes/winreg/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d6ae3f3d82d9a --- /dev/null +++ b/recipes/winreg/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(winreg REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE winreg::winreg) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/winreg/all/test_package/conanfile.py b/recipes/winreg/all/test_package/conanfile.py new file mode 100644 index 0000000000000..34be4a6e879fa --- /dev/null +++ b/recipes/winreg/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +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, run=can_run(self)) + + 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/winreg/all/test_package/test_package.cpp b/recipes/winreg/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ff8ebb139790c --- /dev/null +++ b/recipes/winreg/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +#include "WinReg/WinReg.hpp" + +int main() { + auto subkey = L"Environment"; + winreg::RegKey key{HKEY_CURRENT_USER, subkey}; + auto value = key.GetStringValue(L"Path"); + std::wcout << value << std::endl; + return 0; +} diff --git a/recipes/winreg/config.yml b/recipes/winreg/config.yml new file mode 100644 index 0000000000000..ff45ed79b1303 --- /dev/null +++ b/recipes/winreg/config.yml @@ -0,0 +1,3 @@ +versions: + "6.2.0": + folder: all diff --git a/recipes/wiringpi/all/CMakeLists.txt b/recipes/wiringpi/all/CMakeLists.txt index fdd0b1aff610c..80de9a56905b7 100644 --- a/recipes/wiringpi/all/CMakeLists.txt +++ b/recipes/wiringpi/all/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.8.11) -project(wiringPi C) +project(wiringPi LANGUAGES C) file(GLOB SRC_FILES ${WIRINGPI_SRC_DIR}/wiringPi/*.c) @@ -20,6 +20,10 @@ if(WIRINGPI_WITH_DEV_LIB) ${WIRINGPI_SRC_DIR}/wiringPi) endif() +if(WIRINGPI_LINUX_HEADERS_DIR) + target_include_directories(${PROJECT_NAME} PUBLIC ${WIRINGPI_LINUX_HEADERS_DIR}) +endif() + install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib diff --git a/recipes/wiringpi/all/conandata.yml b/recipes/wiringpi/all/conandata.yml index 676b9c65bf9fe..01a4914b9830b 100644 --- a/recipes/wiringpi/all/conandata.yml +++ b/recipes/wiringpi/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "3.10": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/3.10.tar.gz" + sha256: "d0a7b182154e763b4baff1a57a5e0fca093fcf081f663cb2fb17f5ada564e016" + "3.8": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/3.8.tar.gz" + sha256: "6159764d3d036486f0a110cd5393b1413c1f334d464b7337117fece59ea04bc9" + "3.6": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/3.6.tar.gz" + sha256: "bec180a14ccd2d6b4eb5248d6553593511e7881348f56f8c98515a6d5d5444ee" + "3.4": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/3.4.tar.gz" + sha256: "a81219e9ea0ce08295d2fc0457c69c4df0c6d2e846cb5817ba3247f673480d55" + "3.2": + url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/3.2.tar.gz" + sha256: "45aeaf52d86631edb7a5c82a4f6d0050ef10c8b4de6c566cd8017fc52a17b68e" "2.61-1": url: "https://github.com/WiringPi/WiringPi/archive/refs/tags/2.61-1.tar.gz" sha256: "b5dc6c6c2ba1349acf602fafd7b58aa81e3fc3216a33b983386264cca0033e12" diff --git a/recipes/wiringpi/all/conanfile.py b/recipes/wiringpi/all/conanfile.py index b1ff871a8a06d..882e90a790561 100644 --- a/recipes/wiringpi/all/conanfile.py +++ b/recipes/wiringpi/all/conanfile.py @@ -3,26 +3,32 @@ from conan.errors import ConanInvalidConfiguration 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.53.0" class WiringpiConan(ConanFile): name = "wiringpi" - license = "LGPL-3.0" description = "GPIO Interface library for the Raspberry Pi" - homepage = "http://wiringpi.com" - topics = ("wiringpi", "gpio", "raspberrypi") + license = "LGPL-3.0" url = "https://github.com/conan-io/conan-center-index" - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], - "fPIC": [True, False], - "wpi_extensions": [True, False], - "with_devlib": [True, False]} - default_options = {"shared": False, - "fPIC": True, - "wpi_extensions": False, - "with_devlib": True} - + homepage = "https://github.com/WiringPi/WiringPi" + topics = ("wiringpi", "gpio", "raspberrypi") + settings = "os", "arch", "compiler", "build_type" + package_type = "library" + options = { + "shared": [True, False], + "fPIC": [True, False], + "wpi_extensions": [True, False], + "with_devlib": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "wpi_extensions": False, + "with_devlib": True, + } + def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) @@ -32,21 +38,36 @@ 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 Version(self.version) >= "3.2": + self.requires("linux-headers-generic/6.5.9", transitive_headers=True) + def validate(self): if self.settings.os != "Linux": raise ConanInvalidConfiguration(f"{self.ref} only works for Linux") - - def layout(self): - cmake_layout(self, src_folder="src") + if Version(self.version) >= 3.0: + if self.settings.compiler == "gcc" and \ + Version(self.settings.compiler.version) < 8: + raise ConanInvalidConfiguration(f"{self.ref} requires gcc >= 8") + # wiringPi.c:1755:9: error: case label does not reduce to an integer constant + if self.settings.compiler == "gcc" and \ + Version(self.settings.compiler.version).major == 11 and \ + self.settings.build_type == "Debug": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support gcc 11 in Debug build") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) - + def generate(self): tc = CMakeToolchain(self) tc.variables["WIRINGPI_SRC_DIR"] = self.source_folder.replace("\\", "/") tc.variables["WIRINGPI_WITH_WPI_EXTENSIONS"] = self.options.wpi_extensions tc.variables["WIRINGPI_WITH_DEV_LIB"] = self.options.with_devlib + if Version(self.version) >= "3.2": + tc.variables["WIRINGPI_LINUX_HEADERS_DIR"] = self.dependencies["linux-headers-generic"].cpp_info.includedirs[0] tc.generate() def build(self): diff --git a/recipes/wiringpi/all/test_package/CMakeLists.txt b/recipes/wiringpi/all/test_package/CMakeLists.txt index 619241be63343..3dfbe8a866f08 100644 --- a/recipes/wiringpi/all/test_package/CMakeLists.txt +++ b/recipes/wiringpi/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) find_package(wiringpi REQUIRED CONFIG) add_executable(test_package test_package.c) -target_link_libraries(test_package wiringpi::wiringpi) +target_link_libraries(test_package PRIVATE wiringpi::wiringpi) diff --git a/recipes/wiringpi/all/test_v1_package/CMakeLists.txt b/recipes/wiringpi/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index caae3a2fdfe40..0000000000000 --- a/recipes/wiringpi/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(wiringpi REQUIRED CONFIG) - -add_executable(test_package ../test_package/test_package.c) -target_link_libraries(test_package wiringpi::wiringpi) diff --git a/recipes/wiringpi/all/test_v1_package/conanfile.py b/recipes/wiringpi/all/test_v1_package/conanfile.py deleted file mode 100644 index 0a93a273ba575..0000000000000 --- a/recipes/wiringpi/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/wiringpi/config.yml b/recipes/wiringpi/config.yml index b0d56a22c2e0d..36ce1b9437329 100644 --- a/recipes/wiringpi/config.yml +++ b/recipes/wiringpi/config.yml @@ -1,4 +1,14 @@ versions: + "3.10": + folder: "all" + "3.8": + folder: "all" + "3.6": + folder: "all" + "3.4": + folder: "all" + "3.2": + folder: "all" "2.61-1": folder: "all" "cci.20210727": diff --git a/recipes/wise_enum/all/conandata.yml b/recipes/wise_enum/all/conandata.yml index a7eb4605abb61..05e03d94a0301 100644 --- a/recipes/wise_enum/all/conandata.yml +++ b/recipes/wise_enum/all/conandata.yml @@ -1,4 +1,7 @@ -sources: +sources: + "3.1.0": + url: "https://github.com/quicknir/wise_enum/archive/refs/tags/3.1.0.tar.gz" + sha256: "79410816314941ea2c00b2bbd6932797caefa397a76db425d2b96e6211d1069b" "3.0.0": url: "https://github.com/quicknir/wise_enum/archive/refs/tags/3.0.0.tar.gz" sha256: "6e0d62855854ea755dd4277e74a599d1f4e7eec95562baf751151cc2e4df5eb8" diff --git a/recipes/wise_enum/all/test_package/CMakeLists.txt b/recipes/wise_enum/all/test_package/CMakeLists.txt index 6131dd641fdb9..f592851c4a3a4 100644 --- a/recipes/wise_enum/all/test_package/CMakeLists.txt +++ b/recipes/wise_enum/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(WiseEnum REQUIRED CONFIG) diff --git a/recipes/wise_enum/all/test_v1_package/CMakeLists.txt b/recipes/wise_enum/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/wise_enum/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wise_enum/all/test_v1_package/conanfile.py b/recipes/wise_enum/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/wise_enum/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_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/wise_enum/config.yml b/recipes/wise_enum/config.yml index c6ac749e0b234..fba1ec47d0659 100644 --- a/recipes/wise_enum/config.yml +++ b/recipes/wise_enum/config.yml @@ -1,3 +1,5 @@ versions: + "3.1.0": + folder: all "3.0.0": folder: all diff --git a/recipes/wolfssl/all/conandata.yml b/recipes/wolfssl/all/conandata.yml index 07a88deb272d2..ac2d8b39c2b06 100644 --- a/recipes/wolfssl/all/conandata.yml +++ b/recipes/wolfssl/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "5.7.2": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.7.2-stable.tar.gz" + sha256: "0f2ed82e345b833242705bbc4b08a2a2037a33f7bf9c610efae6464f6b10e305" + "5.7.0": + url: "https://github.com/wolfSSL/wolfssl/archive/v5.7.0-stable.tar.gz" + sha256: "2de93e8af588ee856fe67a6d7fce23fc1b226b74d710b0e3946bc8061f6aa18f" + "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" diff --git a/recipes/wolfssl/all/conanfile.py b/recipes/wolfssl/all/conanfile.py index 7233278df2e56..71b7470fcdfeb 100644 --- a/recipes/wolfssl/all/conanfile.py +++ b/recipes/wolfssl/all/conanfile.py @@ -14,13 +14,13 @@ class WolfSSLConan(ConanFile): name = "wolfssl" - license = "GPL-2.0-or-later" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://www.wolfssl.com/" description = ( "wolfSSL (formerly CyaSSL) is a small, fast, portable implementation " "of TLS/SSL for embedded devices to the cloud." ) + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.wolfssl.com/" topics = ("wolfssl", "tls", "ssl", "iot", "fips", "secure", "cryptology", "secret") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -39,6 +39,10 @@ class WolfSSLConan(ConanFile): "sessioncerts": [True, False], "sni": [True, False], "testcert": [True, False], + "with_curl": [True, False], + "with_quic": [True, False], + "with_experimental": [True, False], + "with_rpk": [True, False], } default_options = { "shared": False, @@ -55,6 +59,10 @@ class WolfSSLConan(ConanFile): "sessioncerts": False, "sni": False, "testcert": False, + "with_curl": False, + "with_quic": False, + "with_experimental": False, + "with_rpk": False, } @property @@ -64,6 +72,14 @@ def _settings_build(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) < "5.2.0": + del self.options.with_curl + if Version(self.version) < "5.5.0": + del self.options.with_quic + if Version(self.version) < "5.7.0": + del self.options.with_experimental + if Version(self.version) < "5.7.2": + del self.options.with_rpk def configure(self): if self.options.shared: @@ -80,6 +96,7 @@ def validate(self): def build_requirements(self): self.tool_requires("libtool/2.4.7") + self.tool_requires("cmake/[>=3.22 <4]") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): @@ -104,7 +121,7 @@ def generate(self): "--enable-sslv3={}".format(yes_no(self.options.sslv3)), "--enable-alpn={}".format(yes_no(self.options.alpn)), "--enable-des3={}".format(yes_no(self.options.des3)), - "--enable-tls13={}".format(yes_no(self.options.tls13)), + "--enable-tls13={}".format(yes_no(self.options.tls13 or self.options.get_safe("with_quic"))), "--enable-certgen={}".format(yes_no(self.options.certgen)), "--enable-dsa={}".format(yes_no(self.options.dsa)), "--enable-ripemd={}".format(yes_no(self.options.ripemd)), @@ -114,6 +131,14 @@ def generate(self): "--enable-shared={}".format(yes_no(self.options.shared)), "--enable-static={}".format(yes_no(not self.options.shared)), ]) + if self.options.get_safe("with_curl"): + tc.configure_args.append("--enable-curl") + if self.options.get_safe("with_quic"): + tc.configure_args.append("--enable-quic") + if self.options.get_safe("with_experimental"): + tc.configure_args.append("--enable-experimental") + if self.options.get_safe("with_rpk"): + tc.configure_args.append("--enable-rpk") if is_msvc(self): tc.extra_ldflags.append("-ladvapi32") if check_min_vs(self, "180", raise_invalid=False): diff --git a/recipes/wolfssl/all/test_v1_package/CMakeLists.txt b/recipes/wolfssl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/wolfssl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wolfssl/all/test_v1_package/conanfile.py b/recipes/wolfssl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/wolfssl/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_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/wolfssl/config.yml b/recipes/wolfssl/config.yml index 1d558dac0d232..0734e5e20ba48 100644 --- a/recipes/wolfssl/config.yml +++ b/recipes/wolfssl/config.yml @@ -1,4 +1,10 @@ versions: + "5.7.2": + folder: all + "5.7.0": + folder: all + "5.6.6": + folder: all "5.6.4": folder: all "5.6.3": diff --git a/recipes/wslay/all/conanfile.py b/recipes/wslay/all/conanfile.py index 0adf9718dbe26..e2c2a97531ce8 100644 --- a/recipes/wslay/all/conanfile.py +++ b/recipes/wslay/all/conanfile.py @@ -1,10 +1,11 @@ from conan import ConanFile +from conan.errors import ConanException 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 +from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class WslayConan(ConanFile): @@ -51,6 +52,9 @@ def generate(self): tc.variables["WSLAY_SHARED"] = self.options.shared # Relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.1.1": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): @@ -65,27 +69,6 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - # 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), - {self._wslay_lib_target: "wslay::wslay"} - ) - - 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") - @property def _wslay_lib_target(self): return "wslay_shared" if self.options.shared else "wslay" @@ -97,8 +80,3 @@ def package_info(self): self.cpp_info.libs = [self._wslay_lib_target] if self.settings.os == "Windows": self.cpp_info.system_libs = ["ws2_32"] - - # 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"] = "libwslay" diff --git a/recipes/wslay/all/test_package/CMakeLists.txt b/recipes/wslay/all/test_package/CMakeLists.txt index 2f2c295f8ed13..1d154279f1da3 100644 --- a/recipes/wslay/all/test_package/CMakeLists.txt +++ b/recipes/wslay/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(wslay REQUIRED CONFIG) diff --git a/recipes/wslay/all/test_v1_package/CMakeLists.txt b/recipes/wslay/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/wslay/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wslay/all/test_v1_package/conanfile.py b/recipes/wslay/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/wslay/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_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/wt/all/conandata.yml b/recipes/wt/all/conandata.yml index 7c33a1e76efa3..6aeaa3c26cb97 100644 --- a/recipes/wt/all/conandata.yml +++ b/recipes/wt/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.11.2": + url: "https://github.com/emweb/wt/archive/4.11.2.tar.gz" + sha256: "d28ce0b18121a5ded5ad9737ee664cac17ff1e287d339cc422ecef57fa68c2b6" "4.10.1": url: "https://github.com/emweb/wt/archive/4.10.1.tar.gz" sha256: "f6d6114416a628604793197cd077066a9d4d98799bbb288b97de42f66705bde5" @@ -21,6 +24,10 @@ sources: url: "https://github.com/emweb/wt/archive/4.6.0.tar.gz" sha256: "7f709e132d32c4925e6db0a590c7ccc5613344e8b9052676ef891a25ccb550e6" patches: + "4.11.2": + - patch_file: "patches/4.8.0-0001-use-cci-package.patch" + patch_description: "use cci package" + patch_type: "conan" "4.10.1": - patch_file: "patches/4.8.0-0001-use-cci-package.patch" patch_description: "use cci package" diff --git a/recipes/wt/all/conanfile.py b/recipes/wt/all/conanfile.py index fc0eb757303bd..f52c69a8dfbb5 100644 --- a/recipes/wt/all/conanfile.py +++ b/recipes/wt/all/conanfile.py @@ -32,6 +32,8 @@ class WtConan(ConanFile): "with_dbo": [True, False], "with_opengl": [True, False], "with_unwind": [True, False], + "with_haru": [True, False], + "raster_image": ["none", "Direct2D", "GraphicsMagick"], "no_std_locale": [True, False], "no_std_wstring": [True, False], "multi_threaded": [True, False], @@ -51,6 +53,8 @@ class WtConan(ConanFile): "with_dbo": True, "with_opengl": False, "with_unwind": True, + "with_haru": False, + "raster_image": "none", "no_std_locale": False, "no_std_wstring": False, "multi_threaded": True, @@ -112,7 +116,9 @@ def requirements(self): self.requires("odbc/2.3.11") if self.options.get_safe("with_unwind"): self.requires("libunwind/1.7.2") - + if self.options.with_haru: + self.requires("libharu/2.4.3") + 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) @@ -121,6 +127,8 @@ def validate(self): f"{self.ref} requires non header-only boost with these components: " f"{', '.join(self._required_boost_components)}" ) + if self.options.get_safe("raster_image", "none") == "Direct2D" and self.settings.os != "Windows": + raise ConanInvalidConfiguration("Direct2D is supported only on Windows.") # FIXME: https://redmine.emweb.be/issues/12073w if conan_version.major == 2 and Version(self.version) == "4.10.1" and is_msvc(self): @@ -178,7 +186,7 @@ def generate(self): tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_TESTS"] = False tc.variables["ENABLE_SSL"] = self.options.with_ssl - tc.variables["ENABLE_HARU"] = False + tc.variables["ENABLE_HARU"] = self.options.with_haru tc.variables["ENABLE_PANGO"] = False tc.variables["ENABLE_SQLITE"] = self.options.get_safe("with_sqlite", False) tc.variables["ENABLE_POSTGRES"] = self.options.get_safe("with_postgres", False) @@ -191,6 +199,7 @@ def generate(self): tc.variables["ENABLE_LIBWTDBO"] = self.options.with_dbo tc.variables["ENABLE_OPENGL"] = self.options.with_opengl tc.variables["ENABLE_UNWIND"] = self.options.get_safe("with_unwind", False) + tc.variables["WT_WRASTERIMAGE_IMPLEMENTATION"] = self.options.get_safe("raster_image", "none") tc.variables["WT_NO_STD_LOCALE"] = self.options.no_std_locale tc.variables["WT_NO_STD_WSTRING"] = self.options.no_std_wstring tc.variables["MULTI_THREADED"] = self.options.multi_threaded @@ -227,6 +236,8 @@ def generate(self): 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.with_haru: + tc.variables["HARU_PREFIX"] = self._cmakify_path_list(self.dependencies["libharu"].package_folder) if self.options.get_safe("with_unwind"): tc.variables["UNWIND_PREFIX"] = self._cmakify_path_list([self.dependencies["libunwind"].package_folder]) if self.settings.os == "Windows": @@ -306,6 +317,8 @@ def package_info(self): self.cpp_info.components["wtmain"].requires.append("openssl::openssl") if self.options.get_safe("with_unwind"): self.cpp_info.components["wtmain"].requires.append("libunwind::libunwind") + if self.options.with_haru: + self.cpp_info.components["wtmain"].requires.append("libharu::libharu") # wttest if self.options.with_test: diff --git a/recipes/wt/all/test_package/CMakeLists.txt b/recipes/wt/all/test_package/CMakeLists.txt index 634347f5dfc1c..73ef6377ddc9c 100644 --- a/recipes/wt/all/test_package/CMakeLists.txt +++ b/recipes/wt/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) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/wt/config.yml b/recipes/wt/config.yml index fec9d209ef876..4eef8adcfdf05 100644 --- a/recipes/wt/config.yml +++ b/recipes/wt/config.yml @@ -1,4 +1,6 @@ versions: + "4.11.2": + folder: all "4.10.1": folder: all "4.10.0": diff --git a/recipes/wtl/all/test_package/CMakeLists.txt b/recipes/wtl/all/test_package/CMakeLists.txt index 7c87cbcfbe53b..768a17a096f28 100644 --- a/recipes/wtl/all/test_package/CMakeLists.txt +++ b/recipes/wtl/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(wtl REQUIRED CONFIG) diff --git a/recipes/wtl/all/test_v1_package/CMakeLists.txt b/recipes/wtl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/wtl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/wtl/all/test_v1_package/conanfile.py b/recipes/wtl/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/wtl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/wxwidgets/all/conandata.yml b/recipes/wxwidgets/all/conandata.yml new file mode 100644 index 0000000000000..0b2357cd4a254 --- /dev/null +++ b/recipes/wxwidgets/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.2.6": + url: "https://github.com/wxWidgets/wxWidgets/archive/v3.2.6.tar.gz" + sha256: "46372b2dbf976521e1d7cca22afc3d3542d171a488b391444cf89aba87ea7d16" + "3.2.5": + url: "https://github.com/wxWidgets/wxWidgets/archive/v3.2.5.tar.gz" + sha256: "c3a54d1c5dc3feefc2893c28923fd722c990c572253d5ad353eec99386ba11eb" diff --git a/recipes/wxwidgets/all/conanfile.py b/recipes/wxwidgets/all/conanfile.py new file mode 100644 index 0000000000000..f666bae56e2db --- /dev/null +++ b/recipes/wxwidgets/all/conanfile.py @@ -0,0 +1,481 @@ +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, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version +from conan.tools.system import package_manager +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=2.0.6" + + +class wxWidgetsConan(ConanFile): + name = "wxwidgets" + description = "wxWidgets is a C++ library that lets developers create applications for Windows, macOS, " \ + "Linux and other platforms with a single code base." + topics = ("wxwidgets", "gui", "ui") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.wxwidgets.org" + license = "wxWidgets" + settings = "os", "arch", "compiler", "build_type" + + package_type = "library" + options = {"shared": [True, False], + "fPIC": [True, False], + "jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg"], + "secretstore": [True, False], + "aui": [True, False], + "opengl": [True, False], + "html": [True, False], + "mediactrl": [True, False], + "propgrid": [True, False], + "debugreport": [True, False], + "ribbon": [True, False], + "richtext": [True, False], + "sockets": [True, False], + "stc": [True, False], + "webview": [True, False], + "xml": [True, False], + "xrc": [True, False], + "cairo": [True, False], + "help": [True, False], + "html_help": [True, False], + "url": [True, False], + "protocol": [True, False], + "fs_inet": [True, False], + "custom_enables": ["ANY"], # comma splitted list + "custom_disables": ["ANY"]} + default_options = { + "shared": False, + "fPIC": True, + "jpeg": "libjpeg", + "secretstore": True, + "aui": True, + "opengl": True, + "html": True, + "mediactrl": False, + "propgrid": True, + "debugreport": True, + "ribbon": True, + "richtext": True, + "sockets": True, + "stc": True, + # WebKitGTK for GTK2 is not available as a system dependency on modern distros. + # When gtk/system defaults to GTK3, turn this back on. + "webview": False, + "xml": True, + "xrc": True, + "cairo": True, + "help": True, + "html_help": True, + "url": True, + "protocol": True, + "fs_inet": True, + "custom_enables": "", + "custom_disables": "" + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + if self.settings.os != "Linux": + self.options.rm_safe("secretstore") + self.options.rm_safe("cairo") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + @property + def _gtk_version(self): + return f"gtk{self.dependencies['gtk'].options.version}" + + def system_requirements(self): + apt = package_manager.Apt(self) + packages = [] + if self.options.get_safe("secretstore"): + packages.append("libsecret-1-dev") + if self.options.webview: + if self._gtk_version == "gtk2": + packages.extend(["libsoup2.4-dev", + "libwebkitgtk-dev"]) + else: + packages.extend(["libsoup3.0-dev", + "libwebkit2gtk-4.0-dev"]) + if self.options.get_safe("cairo"): + packages.append("libcairo2-dev") + apt.install(packages) + + yum = package_manager.Yum(self) + packages = [] + if self.options.get_safe("secretstore"): + packages.append("libsecret-devel") + if self.options.webview: + packages.extend(["libsoup3-devel", + "webkit2gtk4.1-devel"]) + if self.options.get_safe("cairo"): + packages.append("cairo-devel") + yum.install(packages) + + def build_requirements(self): + self.tool_requires("ninja/1.11.1") + self.tool_requires("cmake/[>=3.17]") + + # TODO: add support for gtk non system version when it's ready for Conan 2 + def requirements(self): + if self.settings.os == "Linux": + self.requires("xorg/system") + self.requires("gtk/system") + if self.options.get_safe("opengl", default=False): + self.requires("opengl/system") + self.requires("xkbcommon/1.6.0", options={"with_x11": True}) + # TODO: Does not work right now + # if self.options.get_safe("cairo"): + # self.requires("cairo/1.18.0") + if self.options.mediactrl: + self.requires("gstreamer/1.22.3") + self.requires("gst-plugins-base/1.19.2") + self.requires("libcurl/[>=7.78.0 <9]") + + if self.options.jpeg == "libjpeg": + self.requires("libjpeg/9e") + elif self.options.jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/3.0.2") + elif self.options.jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.5") + + self.requires("libpng/[>=1.6 <2]") + self.requires("libtiff/4.6.0") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("expat/[>=2.6.2 <3]") + self.requires("pcre2/10.42") + self.requires("nanosvg/cci.20231025") + + def validate(self): + if self.settings.os == "Linux": + if not self.dependencies.direct_host["xkbcommon"].options.with_x11: + raise ConanInvalidConfiguration("The 'with_x11' option for the 'xkbcommon' package must 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 _patch_sources(self): + apply_conandata_patches(self) + # Don't change library names when cross-compiling + replace_in_file(self, os.path.join(self.source_folder, "build", "cmake", "functions.cmake"), + 'set(cross_target "-${CMAKE_SYSTEM_NAME}")', + 'set(cross_target)') + # Don't override Conan's toolchain + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "CMAKE_OSX_DEPLOYMENT_TARGET", + "CMAKE_OSX_DEPLOYMENT_TARGET_IGNORED") + # Fix for strcpy_s (fix upstream?) + if is_apple_os(self): + cmake_version = "3.0" + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f'cmake_minimum_required(VERSION {cmake_version})', + f'cmake_minimum_required(VERSION {cmake_version})\nadd_definitions(-D__STDC_WANT_LIB_EXT1__)') + + def generate(self): + tc = CMakeToolchain(self) + + # generic build options + tc.variables["wxBUILD_SHARED"] = self.options.shared + tc.variables["wxBUILD_SAMPLES"] = "OFF" + tc.variables["wxBUILD_TESTS"] = "OFF" + tc.variables["wxBUILD_DEMOS"] = "OFF" + tc.variables["wxBUILD_INSTALL"] = True + if self.settings.compiler == "clang": + tc.variables["wxBUILD_PRECOMP"] = "OFF" + + # platform-specific options + if is_msvc(self): + tc.variables["wxBUILD_USE_STATIC_RUNTIME"] = "MT" in str(self.settings.compiler.runtime) + tc.variables["wxBUILD_MSVC_MULTIPROC"] = True + if self.settings.os == "Linux": + tc.variables["wxBUILD_TOOLKIT"] = self._gtk_version + tc.variables["wxUSE_CAIRO"] = self.options.cairo + # Disable some optional libraries that will otherwise lead to non-deterministic builds + if self.settings.os != "Windows": + tc.variables["wxUSE_LIBSDL"] = "OFF" + tc.variables["wxUSE_LIBICONV"] = "OFF" + tc.variables["wxUSE_LIBNOTIFY"] = "OFF" + tc.variables["wxUSE_LIBMSPACK"] = "OFF" + tc.variables["wxUSE_LIBGNOMEVFS"] = "OFF" + + tc.variables["wxUSE_LIBPNG"] = "sys" + tc.variables["wxUSE_LIBJPEG"] = "sys" + tc.variables["wxUSE_LIBTIFF"] = "sys" + tc.variables["wxUSE_ZLIB"] = "sys" + tc.variables["wxUSE_EXPAT"] = "sys" + tc.variables["wxUSE_REGEX"] = "sys" + tc.variables["wxUSE_NANOSVG"] = "sys" + + # wxWidgets features + tc.variables["wxUSE_SECRETSTORE"] = self.options.get_safe("secretstore") + + # wxWidgets libraries + tc.variables["wxUSE_AUI"] = self.options.aui + tc.variables["wxUSE_OPENGL"] = self.options.get_safe("opengl", default=False) + tc.variables["wxUSE_HTML"] = self.options.html + tc.variables["wxUSE_MEDIACTRL"] = self.options.mediactrl + tc.variables["wxUSE_PROPGRID"] = self.options.propgrid + tc.variables["wxUSE_DEBUGREPORT"] = self.options.debugreport + tc.variables["wxUSE_RIBBON"] = self.options.ribbon + tc.variables["wxUSE_RICHTEXT"] = self.options.richtext + tc.variables["wxUSE_SOCKETS"] = self.options.sockets + tc.variables["wxUSE_STC"] = self.options.stc + tc.variables["wxUSE_WEBVIEW"] = self.options.webview + tc.variables["wxUSE_XML"] = self.options.xml + tc.variables["wxUSE_XRC"] = self.options.xrc + tc.variables["wxUSE_HELP"] = self.options.help + tc.variables["wxUSE_WXHTML_HELP"] = self.options.html_help + tc.variables["wxUSE_URL"] = self.options.protocol + tc.variables["wxUSE_PROTOCOL"] = self.options.protocol + tc.variables["wxUSE_FS_INET"] = self.options.fs_inet + tc.cache_variables["CMAKE_CONFIGURATION_TYPES"] = "Debug;Release;RelWithDebInfo;MinSizeRel" + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + + for item in str(self.options.custom_enables).split(","): + if len(item) > 0: + tc.variables[item] = True + for item in str(self.options.custom_disables).split(","): + if len(item) > 0: + tc.variables[item] = False + + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("expat", "cmake_file_name", "EXPAT") + deps.set_property("expat", "cmake_target_name", "EXPAT") + deps.set_property("nanosvg", "cmake_file_name", "NanoSVG") + deps.set_property("nanosvg", "cmake_target_name", "NanoSVG::nanosvg") + deps.generate() + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="licence.txt", + src=os.path.join(self.source_folder, "docs"), + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + # remove cmake files + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + # copy setup.h + copy(self, pattern="*setup.h", + src=os.path.join(self.build_folder, "lib"), + dst=os.path.join(self.package_folder, "include", "wx"), + keep_path=False) + + if self.settings.os == "Windows": + # copy wxrc.exe + copy(self, pattern="*", + src=os.path.join(self.build_folder, "bin"), + dst=os.path.join(self.package_folder, "bin"), + keep_path=False) + else: + # make relative symlink + bin_dir = os.path.join(self.package_folder, "bin") + for x in os.listdir(bin_dir): + filename = os.path.join(bin_dir, x) + if os.path.islink(filename): + target = os.readlink(filename) + if os.path.isabs(target): + rel = os.path.relpath(target, bin_dir) + os.remove(filename) + os.symlink(rel, filename) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "wxWidgets") + self.cpp_info.set_property("cmake_target_name", "wxWidgets::wxWidgets") + self.cpp_info.set_property("pkg_config_name", "wxwidgets") + + _version = Version(self.version) + version_suffix_major_minor = f"-{_version.major}.{_version.minor}" + + # wx no longer uses a debug suffix for non-windows platforms from 3.1.3 onwards + use_debug_suffix = False + if self.settings.build_type == "Debug" and self.settings.os == "Windows": + use_debug_suffix = True + + debug = "d" if use_debug_suffix else "" + + if self.settings.os == "Linux": + prefix = "wx_" + toolkit = self._gtk_version + version = "" + suffix = version_suffix_major_minor + elif self.settings.os == "Macos": + prefix = "wx_" + toolkit = "osx_cocoa" + version = "" + suffix = version_suffix_major_minor + elif self.settings.os == "Windows": + toolkit = "msw" + if is_msvc(self): + prefix = "wx" + version = f"{_version.major}{_version.minor}" + suffix = "" + else: + prefix = "wx_" + version = "" + suffix = version_suffix_major_minor + + def base_library_pattern(library): + return "{prefix}base{version}u{debug}_%s{suffix}" % library + + def library_pattern(library): + return "{prefix}{toolkit}{version}u{debug}_%s{suffix}" % library + + libs = [] + libs.append("{prefix}base{version}u{debug}{suffix}") + libs.append(library_pattern("core")) + libs.append(library_pattern("adv")) + if self.options.sockets: + libs.append(base_library_pattern("net")) + if self.options.xml: + libs.append(base_library_pattern("xml")) + if self.options.aui: + libs.append(library_pattern("aui")) + if self.options.get_safe("opengl", default=False): + libs.append(library_pattern("gl")) + if self.options.html: + libs.append(library_pattern("html")) + if self.options.mediactrl: + libs.append(library_pattern("media")) + if self.options.propgrid: + libs.append(library_pattern("propgrid")) + if self.options.debugreport: + libs.append(library_pattern("qa")) + if self.options.ribbon: + libs.append(library_pattern("ribbon")) + if self.options.richtext: + libs.append(library_pattern("richtext")) + if self.options.stc: + if not self.options.shared: + scintilla_suffix = "{debug}" if self.settings.os == "Windows" else "{suffix}" + libs.append("wxscintilla" + scintilla_suffix) + libs.append(library_pattern("stc")) + if self.options.webview: + libs.append(library_pattern("webview")) + if self.options.xrc: + libs.append(library_pattern("xrc")) + for lib in reversed(libs): + self.cpp_info.libs.append(lib.format(prefix=prefix, + toolkit=toolkit, + version=version, + debug=debug, + suffix=suffix)) + + self.cpp_info.defines.append("wxUSE_GUI=1") + if self.settings.build_type == "Debug": + self.cpp_info.defines.append("__WXDEBUG__") + if self.options.shared: + self.cpp_info.defines.append("WXUSINGDLL") + if self.settings.os == "Linux": + self.cpp_info.defines.append("__WXGTK__") + self.cpp_info.system_libs.extend(["dl", "pthread", "SM"]) + elif self.settings.os == "Macos": + self.cpp_info.defines.extend(["__WXMAC__", "__WXOSX__", "__WXOSX_COCOA__"]) + for framework in ["Carbon", + "Cocoa", + "AudioToolbox", + "OpenGL", + "AppKit", + "AVKit", + "AVFoundation", + "Foundation", + "IOKit", + "ApplicationServices", + "CoreFoundation", + "CoreText", + "CoreGraphics", + "CoreServices", + "CoreMedia", + "CFNetwork", + "Security", + "ImageIO", + "System", + "WebKit", + "QuartzCore"]: + self.cpp_info.frameworks.append(framework) + elif self.settings.os == "Windows": + # see cmake/init.cmake + compiler_prefix = {"Visual Studio": "vc", + "msvc": "vc", + "gcc": "gcc", + "clang": "clang"}.get(str(self.settings.compiler)) + + arch_suffix = "_x64" if self.settings.arch == "x86_64" else "" + lib_suffix = "_dll" if self.options.shared else "_lib" + libdir = f"{compiler_prefix}{arch_suffix}{lib_suffix}" + libdir = os.path.join("lib", libdir) + self.cpp_info.bindirs.append(libdir) + self.cpp_info.libdirs.append(libdir) + self.cpp_info.defines.append("__WXMSW__") + # disable annoying auto-linking + self.cpp_info.defines.extend(["wxNO_NET_LIB", + "wxNO_XML_LIB", + "wxNO_REGEX_LIB", + "wxNO_ZLIB_LIB", + "wxNO_JPEG_LIB", + "wxNO_PNG_LIB", + "wxNO_TIFF_LIB", + "wxNO_ADV_LIB", + "wxNO_HTML_LIB", + "wxNO_GL_LIB", + "wxNO_QA_LIB", + "wxNO_XRC_LIB", + "wxNO_AUI_LIB", + "wxNO_PROPGRID_LIB", + "wxNO_RIBBON_LIB", + "wxNO_RICHTEXT_LIB", + "wxNO_MEDIA_LIB", + "wxNO_STC_LIB", + "wxNO_WEBVIEW_LIB"]) + self.cpp_info.system_libs.extend(["kernel32", + "user32", + "gdi32", + "comdlg32", + "winspool", + "shell32", + "comctl32", + "ole32", + "oleaut32", + "imm32", + "uuid", + "wininet", + "rpcrt4", + "winmm", + "advapi32", + "msimg32", + "opengl32", + "ws2_32", + "wsock32"]) + # Link a few libraries that are needed when using gcc on windows + if self.settings.compiler == "gcc": + self.cpp_info.system_libs.extend(["uxtheme", + "version", + "shlwapi", + "oleacc"]) + if is_msvc(self): + self.cpp_info.includedirs.append(os.path.join("include", "msvc")) + else: + include_path = os.path.join("include", f"wx{version_suffix_major_minor}") + self.cpp_info.includedirs = [include_path] + self.cpp_info.includedirs diff --git a/recipes/wxwidgets/all/test_package/CMakeLists.txt b/recipes/wxwidgets/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c85fb0ba17968 --- /dev/null +++ b/recipes/wxwidgets/all/test_package/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +find_package(wxWidgets REQUIRED) + +if(MSVC) + add_definitions("-DUNICODE") + add_definitions("-D_UNICODE") + add_definitions("-D_CRT_SECURE_NO_WARNINGS") +endif() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} wxWidgets::wxWidgets) diff --git a/recipes/wxwidgets/all/test_package/conanfile.py b/recipes/wxwidgets/all/test_package/conanfile.py new file mode 100644 index 0000000000000..91817d9f2df17 --- /dev/null +++ b/recipes/wxwidgets/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", "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/wxwidgets/all/test_package/test_package.cpp b/recipes/wxwidgets/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..40a8f99c42fac --- /dev/null +++ b/recipes/wxwidgets/all/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#if wxUSE_STC +#include +#endif + +int main() +{ + int argc = 0; + wxChar * argv[] = {NULL}; + if (!wxEntryStart(argc, argv)) { + std::cerr << "wxEntryStart failed!" << std::endl; + return EXIT_FAILURE; + } + wxVersionInfo vi = wxGetLibraryVersionInfo(); + std::cout << "wxWidgets version: "; + std::cout << vi.GetMajor() << "."; + std::cout << vi.GetMinor() << "."; + std::cout << vi.GetMicro() << std::endl; +#if wxUSE_STC + wxStyledTextCtrl * stc = new wxStyledTextCtrl(); +#endif + wxEntryCleanup(); + return EXIT_SUCCESS; +} diff --git a/recipes/wxwidgets/config.yml b/recipes/wxwidgets/config.yml new file mode 100644 index 0000000000000..f849d473251f2 --- /dev/null +++ b/recipes/wxwidgets/config.yml @@ -0,0 +1,5 @@ +versions: + "3.2.6": + folder: "all" + "3.2.5": + folder: "all" diff --git a/recipes/wyhash/all/conandata.yml b/recipes/wyhash/all/conandata.yml index 97f88594e3ec8..585638f0f02fb 100644 --- a/recipes/wyhash/all/conandata.yml +++ b/recipes/wyhash/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "final4": + url: "https://github.com/wangyi-fudan/wyhash/archive/refs/tags/wyhash_final4.tar.gz" + sha256: "a3f2da3acf300fba43f51c8299dae71c4e0774cd6fdd96e264fad5777b12ae3a" "cci.20221102": url: "https://github.com/wangyi-fudan/wyhash/archive/ea3b25e1aef55d90f707c3a292eeb9162e2615d8.tar.gz" sha256: "94c6ca365a1ca39f4327c4e031690441a45a7d9feefbc14f86323d8b42c82cbe" diff --git a/recipes/wyhash/all/conanfile.py b/recipes/wyhash/all/conanfile.py index 5ef173786f6ec..1fde6aed28d50 100644 --- a/recipes/wyhash/all/conanfile.py +++ b/recipes/wyhash/all/conanfile.py @@ -16,6 +16,7 @@ class WyhashConan(ConanFile): package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + deprecated = "rapidhash" def layout(self): basic_layout(self, src_folder="src") diff --git a/recipes/wyhash/all/test_package/CMakeLists.txt b/recipes/wyhash/all/test_package/CMakeLists.txt index 3e7c350f8102f..8f61ddcdcebec 100644 --- a/recipes/wyhash/all/test_package/CMakeLists.txt +++ b/recipes/wyhash/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 C) find_package(wyhash REQUIRED CONFIG) diff --git a/recipes/wyhash/all/test_v1_package/CMakeLists.txt b/recipes/wyhash/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 961b416af6b07..0000000000000 --- a/recipes/wyhash/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -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/wyhash/all/test_v1_package/conanfile.py b/recipes/wyhash/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/wyhash/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/wyhash/config.yml b/recipes/wyhash/config.yml index eec24bd72e90d..80db1803c9cf5 100644 --- a/recipes/wyhash/config.yml +++ b/recipes/wyhash/config.yml @@ -1,3 +1,5 @@ versions: + "final4": + folder: all "cci.20221102": folder: all diff --git a/recipes/xapian-core/all/conandata.yml b/recipes/xapian-core/all/conandata.yml index 4514bc0f40509..18806738cffac 100644 --- a/recipes/xapian-core/all/conandata.yml +++ b/recipes/xapian-core/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.24": + url: "https://oligarchy.co.uk/xapian/1.4.24/xapian-core-1.4.24.tar.xz" + sha256: "eda5ae6dcf6b0553a8676af64b1fd304e998cd20f779031ccaaf7ab9a373531a" "1.4.19": url: "https://oligarchy.co.uk/xapian/1.4.19/xapian-core-1.4.19.tar.xz" sha256: "1fca48fca6cc3526cc4ba93dd194fe9c1326857b78edcfb37e68d086d714a9c3" @@ -6,6 +9,8 @@ sources: url: "https://oligarchy.co.uk/xapian/1.4.18/xapian-core-1.4.18.tar.xz" sha256: "196ddbb4ad10450100f0991a599e4ed944cbad92e4a6fe813be6dce160244b77" patches: + "1.4.24": + - patch_file: "patches/0001-add-msvc-cl-sh.patch" "1.4.19": - patch_file: "patches/0001-add-msvc-cl-sh.patch" "1.4.18": diff --git a/recipes/xapian-core/all/conanfile.py b/recipes/xapian-core/all/conanfile.py index e5d0241981b9f..fd5b09b5d2d5d 100644 --- a/recipes/xapian-core/all/conanfile.py +++ b/recipes/xapian-core/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 Environment, VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir, save @@ -101,6 +101,12 @@ def generate(self): env.define("OBJDUMP", ":") env.define("RANLIB", ":") env.define("STRIP", ":") + + if is_apple_os(self) and self.settings.arch == "armv8": + # A fix for ./configure issues on armv8 + tc.configure_args.append("--host=aarch64-apple-darwin") + tc.extra_ldflags.append("-arch arm64") + tc.generate(env) if is_msvc(self): diff --git a/recipes/xapian-core/all/test_package/CMakeLists.txt b/recipes/xapian-core/all/test_package/CMakeLists.txt index 6d27b4aff7006..82f1528fae80d 100644 --- a/recipes/xapian-core/all/test_package/CMakeLists.txt +++ b/recipes/xapian-core/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(xapian REQUIRED CONFIG) diff --git a/recipes/xapian-core/all/test_v1_package/CMakeLists.txt b/recipes/xapian-core/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xapian-core/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xapian-core/all/test_v1_package/conanfile.py b/recipes/xapian-core/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/xapian-core/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_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/xapian-core/config.yml b/recipes/xapian-core/config.yml index bc4d571521f81..9a97cca323477 100644 --- a/recipes/xapian-core/config.yml +++ b/recipes/xapian-core/config.yml @@ -1,4 +1,6 @@ versions: + "1.4.24": + folder: "all" "1.4.19": folder: "all" "1.4.18": diff --git a/recipes/xbyak/all/conandata.yml b/recipes/xbyak/all/conandata.yml index a117cdd9c7b95..5fbe0f98a2367 100644 --- a/recipes/xbyak/all/conandata.yml +++ b/recipes/xbyak/all/conandata.yml @@ -1,4 +1,28 @@ sources: + "7.21": + url: "https://github.com/herumi/xbyak/archive/v7.21.tar.gz" + sha256: "23aad8abc682205ad718d77d51e8e66a569c66de1722b8772d1afb6cbb8d300b" + "7.20": + url: "https://github.com/herumi/xbyak/archive/v7.20.tar.gz" + sha256: "82824b436751d570f404f9d4598216dfd29596ac149bba8b6b5b4fc555061a12" + "7.10": + url: "https://github.com/herumi/xbyak/archive/v7.10.tar.gz" + sha256: "0f1060c9d14a090615f67391d7790ae596d0580726c79c9db6a249febda7ad63" + "7.08": + url: "https://github.com/herumi/xbyak/archive/v7.08.tar.gz" + sha256: "ef7f0504676635a04f2d0befdaf1c324bb1ea6af4e2636cb09eecb3da31d3402" + "7.07.1": + url: "https://github.com/herumi/xbyak/archive/v7.07.1.tar.gz" + sha256: "9f2a1215ed0511e421895d57e2681981f9f9f8fb952655919a9cf859cfe474ae" + "7.07": + url: "https://github.com/herumi/xbyak/archive/v7.07.tar.gz" + sha256: "7bd603fb8de9e605b86c1996a20111df66707c916a2ac0397424080cc0ad7bde" + "7.06": + url: "https://github.com/herumi/xbyak/archive/v7.06.tar.gz" + sha256: "686c710a67c7fb8e99d8e326cf22aea310a29db27a9db8ba19a9fee44f8ec097" + "7.05": + url: "https://github.com/herumi/xbyak/archive/v7.05.tar.gz" + sha256: "853b619a6615985dbb36e8c5528d96d83f7bba3d0728ed3b3ee8ac8f4f96d87f" "7.00": url: "https://github.com/herumi/xbyak/archive/v7.00.tar.gz" sha256: "9bc479d99bb3bbd30669813ca9719126fe93ab1bae857bd799d2b16a1fcb4c32" diff --git a/recipes/xbyak/all/conanfile.py b/recipes/xbyak/all/conanfile.py index 724743a916f47..540cdf1443f84 100644 --- a/recipes/xbyak/all/conanfile.py +++ b/recipes/xbyak/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.files import copy, get from conan.tools.layout import basic_layout +from conan.errors import ConanInvalidConfiguration import os required_conan_version = ">=1.50.0" @@ -24,6 +25,10 @@ def layout(self): def package_id(self): self.info.clear() + def validate(self): + if self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration(f"{self.ref} is only available for x86 and x86_64 architecture") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/xbyak/all/test_package/CMakeLists.txt b/recipes/xbyak/all/test_package/CMakeLists.txt index 94333066ea648..6534d707af16b 100644 --- a/recipes/xbyak/all/test_package/CMakeLists.txt +++ b/recipes/xbyak/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(xbyak REQUIRED CONFIG) diff --git a/recipes/xbyak/all/test_package/conanfile.py b/recipes/xbyak/all/test_package/conanfile.py index d120a992c06a6..8a5bb47f50c4c 100644 --- a/recipes/xbyak/all/test_package/conanfile.py +++ b/recipes/xbyak/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/xbyak/all/test_v1_package/CMakeLists.txt b/recipes/xbyak/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9eb3258c25176..0000000000000 --- a/recipes/xbyak/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(xbyak REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE xbyak::xbyak) diff --git a/recipes/xbyak/all/test_v1_package/conanfile.py b/recipes/xbyak/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/xbyak/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_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/xbyak/config.yml b/recipes/xbyak/config.yml index e1673a246df2d..00913bb048c6f 100644 --- a/recipes/xbyak/config.yml +++ b/recipes/xbyak/config.yml @@ -1,4 +1,20 @@ versions: + "7.21": + folder: all + "7.20": + folder: all + "7.10": + folder: all + "7.08": + folder: all + "7.07.1": + folder: all + "7.07": + folder: all + "7.06": + folder: all + "7.05": + folder: all "7.00": folder: all "6.73": diff --git a/recipes/xege/all/conandata.yml b/recipes/xege/all/conandata.yml index 2f7535221dfb9..fecd7fb356766 100644 --- a/recipes/xege/all/conandata.yml +++ b/recipes/xege/all/conandata.yml @@ -1,4 +1,4 @@ sources: "20.08": - url: "https://github.com/wysaid/xege/archive/refs/tags/20.08.tar.gz" + url: "https://github.com/wysaid/xege/archive/refs/tags/v20.08.tar.gz" sha256: "33bc63366d093902b5bc68d3d613ebd90e449bc22800b40f2dd98e2b5c44b88a" diff --git a/recipes/xege/all/test_v1_package/CMakeLists.txt b/recipes/xege/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/xege/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 423b8142d5f25..0000000000000 --- a/recipes/xege/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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..f8a528e307948 100644 --- a/recipes/xerces-c/all/conandata.yml +++ b/recipes/xerces-c/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "3.3.0": + url: "https://github.com/apache/xerces-c/archive/v3.3.0.tar.gz" + sha256: "0f28ea2d7a0a3824d326c8bc4be26a3bb01dde289663beb6f15b241f80cbd3ae" + "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 +15,23 @@ sources: url: "https://github.com/apache/xerces-c/archive/v3.2.2.tar.gz" sha256: "7fe5af7d7ad9d4a06503c15fb5bb0aa5f2ba7959700d16c21b8bd183ca542e7f" patches: + "3.3.0": + - patch_file: "patches/0002-find-icu-programs.patch" + patch_description: "Find ICU programs on environment" + patch_type: "conan" + "3.2.5": + - patch_file: "patches/0002-find-icu-programs.patch" + patch_description: "Find ICU programs on environment" + patch_type: "conan" "3.2.4": - - patch_file: "patches/0001-remove-test-samples-324.patch" - patch_file: "patches/0002-find-icu-programs.patch" + patch_description: "Find ICU programs on environment" + patch_type: "conan" "3.2.3": - - patch_file: "patches/0001-remove-test-samples.patch" - patch_file: "patches/0002-find-icu-programs.patch" + patch_description: "Find ICU programs on environment" + patch_type: "conan" "3.2.2": - - patch_file: "patches/0001-remove-test-samples.patch" - patch_file: "patches/0002-find-icu-programs.patch" + patch_description: "Find ICU programs on environment" + patch_type: "conan" diff --git a/recipes/xerces-c/all/conanfile.py b/recipes/xerces-c/all/conanfile.py index ea827bcd4bbeb..a7daf64e71cdb 100644 --- a/recipes/xerces-c/all/conanfile.py +++ b/recipes/xerces-c/all/conanfile.py @@ -2,7 +2,7 @@ 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, 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 @@ -26,6 +26,7 @@ class XercesCConan(ConanFile): "fPIC": [True, False], # https://xerces.apache.org/xerces-c/build-3.html "char_type": ["uint16_t", "char16_t", "wchar_t"], + "network": [True, False], "network_accessor": ["curl", "socket", "cfurl", "winsock"], "transcoder": ["gnuiconv", "iconv", "icu", "macosunicodeconverter", "windows"], "message_loader": ["inmemory", "icu", "iconv"], @@ -35,6 +36,7 @@ class XercesCConan(ConanFile): "shared": False, "fPIC": True, "char_type": "uint16_t", + "network": True, "network_accessor": "socket", "transcoder": "gnuiconv", "message_loader": "inmemory", @@ -64,14 +66,16 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if not self.options.network: + self.options.rm_safe("network_accessor") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if "icu" in (self.options.transcoder, self.options.message_loader): - self.requires("icu/74.1") - if self.options.network_accessor == "curl": + self.requires("icu/74.2") + if self.options.get_safe("network_accessor") == "curl": self.requires("libcurl/[>=7.78.0 <9]") def _validate(self, option, value, host_os): @@ -84,7 +88,7 @@ def _validate(self, option, value, host_os): :param os: either a single string or a tuple of strings containing the OS(es) that `value` is valid on """ - if self.settings.os not in host_os and getattr(self.options, option) == value: + if self.settings.os not in host_os and self.options.get_safe(option) == value: raise ConanInvalidConfiguration(f"Option '{option}={value}' is only supported on {host_os}") def validate(self): @@ -116,21 +120,39 @@ def generate(self): tc = CMakeToolchain(self) # Because upstream overrides BUILD_SHARED_LIBS as a CACHE variable tc.cache_variables["BUILD_SHARED_LIBS"] = "ON" if self.options.shared else "OFF" + + # Prevent linking against unused found library + tc.cache_variables["NSL_LIBRARY"] = "NSL_LIBRARY-NOTFOUND" + # https://xerces.apache.org/xerces-c/build-3.html - tc.variables["network-accessor"] = self.options.network_accessor + tc.variables["network"] = self.options.network + if self.options.network: + tc.variables["network-accessor"] = self.options.network_accessor tc.variables["transcoder"] = self.options.transcoder tc.variables["message-loader"] = self.options.message_loader tc.variables["xmlch-type"] = self.options.char_type tc.variables["mutex-manager"] = self.options.mutex_manager # avoid picking up system dependency - tc.variables["CMAKE_DISABLE_FIND_PACKAGE_CURL"] = self.options.network_accessor != "curl" + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_CURL"] = self.options.get_safe("network_accessor") != "curl" tc.variables["CMAKE_DISABLE_FIND_PACKAGE_ICU"] = "icu" not in (self.options.transcoder, self.options.message_loader) + + # Fix compatibility with Clang on Windows + # https://issues.apache.org/jira/browse/XERCESC-2252 + if self.settings.os == "Windows" and self.settings.compiler == "clang": + tc.cache_variables["CMAKE_RC_FLAGS"] = "-C 1252" + tc.generate() 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() @@ -154,7 +176,7 @@ def package_info(self): if self.settings.os == "Macos": self.cpp_info.frameworks = ["CoreFoundation", "CoreServices"] elif self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("pthread") + self.cpp_info.system_libs.extend(["pthread"]) if Version(conan_version).major < 2: self.cpp_info.names["cmake_find_package"] = "XercesC" 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/all/test_package/CMakeLists.txt b/recipes/xerces-c/all/test_package/CMakeLists.txt index 3f03b5b9ef2cd..adf14fc77e6da 100644 --- a/recipes/xerces-c/all/test_package/CMakeLists.txt +++ b/recipes/xerces-c/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(XercesC REQUIRED) diff --git a/recipes/xerces-c/all/test_v1_package/CMakeLists.txt b/recipes/xerces-c/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xerces-c/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xerces-c/all/test_v1_package/conanfile.py b/recipes/xerces-c/all/test_v1_package/conanfile.py deleted file mode 100644 index 19e6a0c06e3d8..0000000000000 --- a/recipes/xerces-c/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/xerces-c/config.yml b/recipes/xerces-c/config.yml index 795ad892ef369..563b86a347844 100644 --- a/recipes/xerces-c/config.yml +++ b/recipes/xerces-c/config.yml @@ -1,4 +1,8 @@ versions: + "3.3.0": + folder: all + "3.2.5": + folder: all "3.2.4": folder: all "3.2.3": diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 432d7eeef8795..f3860ce2b6c1e 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -2,7 +2,6 @@ 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, replace_in_file, rmdir from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout @@ -10,7 +9,7 @@ from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.0.5" class XkbcommonConan(ConanFile): @@ -36,10 +35,8 @@ class XkbcommonConan(ConanFile): "with_wayland": True, "xkbregistry": True, } - - @property - def _has_build_profile(self): - return hasattr(self, "settings_build") + implements = ["auto_shared_fpic"] + languages = ["C"] @property def _has_xkbregistry_option(self): @@ -48,95 +45,72 @@ def _has_xkbregistry_option(self): def config_options(self): if not self._has_xkbregistry_option: del self.options.xkbregistry - if self.settings.os != "Linux": + if self.settings.os not in ("Linux", "Android"): del self.options.with_wayland - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") + if self.settings.os == "Android": + del self.options.with_x11 def layout(self): basic_layout(self, src_folder="src") def requirements(self): self.requires("xkeyboard-config/system") - if self.options.with_x11: + if self.options.get_safe("with_x11"): self.requires("xorg/system") if self.options.get_safe("xkbregistry"): - self.requires("libxml2/2.12.2") + self.requires("libxml2/[>=2.12.5 <3]") if self.options.get_safe("with_wayland"): self.requires("wayland/1.22.0") - if not self._has_build_profile: - 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") + if self.settings.os not in ["Linux", "FreeBSD", "Android"]: + raise ConanInvalidConfiguration(f"{self.ref} is only compatible with Linux, FreeBSD and Android") def build_requirements(self): - self.tool_requires("meson/1.3.0") + self.tool_requires("meson/1.3.2") self.tool_requires("bison/3.8.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.1.0") - if self._has_build_profile and self.options.get_safe("with_wayland"): + if self.options.get_safe("with_wayland"): self.tool_requires("wayland/") - self.tool_requires("wayland-protocols/1.31") + self.tool_requires("wayland-protocols/1.33") 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 Version(self.version) >= "1.6": + tc.project_options["enable-bash-completion"] = False tc.project_options["enable-docs"] = False tc.project_options["enable-wayland"] = self.options.get_safe("with_wayland", False) - tc.project_options["enable-x11"] = self.options.with_x11 + tc.project_options["enable-x11"] = self.options.get_safe("with_x11", False) if self._has_xkbregistry_option: tc.project_options["enable-xkbregistry"] = self.options.xkbregistry - if self._has_build_profile: - tc.project_options["build.pkg_config_path"] = self.generators_folder + tc.project_options["build.pkg_config_path"] = self.generators_folder + if self.settings.os == "Android": + tc.project_options["enable-tools"] = False tc.generate() pkg_config_deps = PkgConfigDeps(self) - if self._has_build_profile and self.options.get_safe("with_wayland"): + if self.options.get_safe("with_wayland"): pkg_config_deps.build_context_activated = ["wayland", "wayland-protocols"] - pkg_config_deps.build_context_suffix = {"wayland": "_BUILD", "wayland-protocols": "_BUILD"} + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} pkg_config_deps.generate() - def build(self): + def _patch_sources(self): if self.options.get_safe("with_wayland"): - meson_build_file = os.path.join(self.source_folder, "meson.build") # Patch the build system to use the pkg-config files generated for the build context. + meson_build_file = os.path.join(self.source_folder, "meson.build") + replace_in_file( + self, + meson_build_file, + "wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)", + "wayland_scanner_dep = dependency('wayland-scanner_BUILD', required: false, native: true)", + ) - if Version(self.version) >= "1.5.0": - get_pkg_config_var = "get_variable(pkgconfig: " - else: - get_pkg_config_var = "get_pkgconfig_variable(" - - if self._has_build_profile: - replace_in_file(self, meson_build_file, - "wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)", - "wayland_scanner_dep = dependency('wayland-scanner_BUILD', required: false, native: true)") - replace_in_file(self, meson_build_file, - "wayland_protocols_dep = dependency('wayland-protocols', version: '>=1.12', required: false)", - "wayland_protocols_dep = dependency('wayland-protocols_BUILD', version: '>=1.12', required: false, native: true)") - else: - replace_in_file(self, meson_build_file, - "wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)", - "# wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)") - - replace_in_file(self, meson_build_file, - "if not wayland_client_dep.found() or not wayland_protocols_dep.found() or not wayland_scanner_dep.found()", - "if not wayland_client_dep.found() or not wayland_protocols_dep.found()") - - replace_in_file(self, meson_build_file, - f"wayland_scanner = find_program(wayland_scanner_dep.{get_pkg_config_var}'wayland_scanner'))", - "wayland_scanner = find_program('wayland-scanner')") - + def build(self): + self._patch_sources() meson = Meson(self) meson.configure() meson.build() @@ -155,7 +129,7 @@ def package_info(self): self.cpp_info.components["libxkbcommon"].requires = ["xkeyboard-config::xkeyboard-config"] self.cpp_info.components["libxkbcommon"].resdirs = ["res"] - if self.options.with_x11: + if self.options.get_safe("with_x11"): self.cpp_info.components["libxkbcommon-x11"].set_property("pkg_config_name", "xkbcommon-x11") self.cpp_info.components["libxkbcommon-x11"].libs = ["xkbcommon-x11"] self.cpp_info.components["libxkbcommon-x11"].requires = ["libxkbcommon", "xorg::xcb", "xorg::xcb-xkb"] @@ -167,13 +141,7 @@ def package_info(self): self.cpp_info.components["xkbcli-interactive-wayland"].libs = [] self.cpp_info.components["xkbcli-interactive-wayland"].includedirs = [] self.cpp_info.components["xkbcli-interactive-wayland"].requires = ["wayland::wayland-client"] - if not self._has_build_profile: - self.cpp_info.components["xkbcli-interactive-wayland"].requires.append("wayland-protocols::wayland-protocols") - - if Version(self.version) >= "1.0.0": - 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) self.cpp_info.set_property("pkg_config_name", "xkbcommon_all_do_not_use") - self.cpp_info.names["pkg_config"] = "xkbcommon_all_do_not_use" diff --git a/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt b/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/xkbcommon/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xkbcommon/all/test_v1_package/conanfile.py b/recipes/xkbcommon/all/test_v1_package/conanfile.py deleted file mode 100644 index e9bf8aa5f82dd..0000000000000 --- a/recipes/xkbcommon/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -import os - -from conans import ConanFile, CMake -from conan.tools.build import cross_building - - -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/xkeyboard-config/all/conanfile.py b/recipes/xkeyboard-config/all/conanfile.py index ec1b8c4a6f2ed..94f33a2e0472d 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/" @@ -16,7 +17,7 @@ class XkeyboardConfigConan(ConanFile): topics = ("x11", "xorg", "keyboard") def validate(self): - if self.settings.os not in ["Linux", "FreeBSD"]: + if self.settings.os not in ["Linux", "FreeBSD", "Android"]: raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") def package_id(self): diff --git a/recipes/xkeyboard-config/all/test_v1_package/conanfile.py b/recipes/xkeyboard-config/all/test_v1_package/conanfile.py deleted file mode 100644 index 510f8a1855391..0000000000000 --- a/recipes/xkeyboard-config/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,13 +0,0 @@ -from conans import ConanFile, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "pkg_config" - - def build(self): - pass - - def test(self): - self.run("pkg-config --validate ./xkeyboard-config.pc") diff --git a/recipes/xlnt/all/conanfile.py b/recipes/xlnt/all/conanfile.py index b40b12448a161..76abf59d1575e 100644 --- a/recipes/xlnt/all/conanfile.py +++ b/recipes/xlnt/all/conanfile.py @@ -1,12 +1,12 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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" +required_conan_version = ">=2.1" class XlntConan(ConanFile): @@ -65,6 +65,9 @@ def generate(self): tc.variables["SAMPLES"] = False tc.variables["BENCHMARKS"] = False tc.variables["PYTHON"] = False + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.5.0": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) deps.generate() @@ -97,9 +100,3 @@ def package_info(self): self.cpp_info.libs = [f"xlnt{suffix}"] if not self.options.shared: self.cpp_info.defines.append("XLNT_STATIC") - - # TODO: to remove in conan v2 - self.cpp_info.filenames["cmake_find_package"] = "Xlnt" - self.cpp_info.filenames["cmake_find_package_multi"] = "Xlnt" - self.cpp_info.names["cmake_find_package"] = "xlnt" - self.cpp_info.names["cmake_find_package_multi"] = "xlnt" diff --git a/recipes/xlnt/all/test_package/CMakeLists.txt b/recipes/xlnt/all/test_package/CMakeLists.txt index 5996d0ee3e85b..19afc9dce597a 100644 --- a/recipes/xlnt/all/test_package/CMakeLists.txt +++ b/recipes/xlnt/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(Xlnt REQUIRED CONFIG) diff --git a/recipes/xlnt/all/test_v1_package/CMakeLists.txt b/recipes/xlnt/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xlnt/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xlnt/all/test_v1_package/conanfile.py b/recipes/xlnt/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/xlnt/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_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/all/conanfile.py b/recipes/xlsxio/all/conanfile.py index 7724a07d64464..5c066a38e80fa 100644 --- a/recipes/xlsxio/all/conanfile.py +++ b/recipes/xlsxio/all/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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" +required_conan_version = ">=2.1" class XlsxioConan(ConanFile): @@ -62,7 +62,7 @@ def requirements(self): self.requires("minizip-ng/4.0.1") else: self.requires("minizip/1.2.13") - self.requires("expat/2.5.0") + self.requires("expat/[>=2.6.2 <3]") def validate(self): if Version(self.version) >= "0.2.34": @@ -82,6 +82,9 @@ def generate(self): tc.variables["WITH_WIDE"] = self.options.with_wide # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "0.2.34": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() tc = CMakeDeps(self) @@ -140,15 +143,3 @@ def package_info(self): 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/test_package/CMakeLists.txt b/recipes/xlsxio/all/test_package/CMakeLists.txt index a6b2c7649a0c8..355239cde4285 100644 --- a/recipes/xlsxio/all/test_package/CMakeLists.txt +++ b/recipes/xlsxio/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(xlsxio REQUIRED CONFIG) diff --git a/recipes/xlsxio/all/test_v1_package/CMakeLists.txt b/recipes/xlsxio/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xlsxio/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 49a3a66ea5bad..0000000000000 --- a/recipes/xlsxio/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", "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/xmlsec/all/conandata.yml b/recipes/xmlsec/all/conandata.yml index 9dcbff28223be..387c156be7f71 100644 --- a/recipes/xmlsec/all/conandata.yml +++ b/recipes/xmlsec/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "1.3.6": + url: "https://github.com/lsh123/xmlsec/releases/download/1.3.6/xmlsec1-1.3.6.tar.gz" + sha256: "952b626ad3f3be1a4598622dab52fdab2a8604d0837c1b00589f3637535af92f" + "1.3.4": + url: "https://github.com/lsh123/xmlsec/releases/download/1.3.4/xmlsec1-1.3.4.tar.gz" + sha256: "45ad9078d41ae76844ad2f8651600ffeec0fdd128ead988a8d69e907c57aee75" + "1.3.3": + url: "https://github.com/lsh123/xmlsec/releases/download/1.3.3/xmlsec1-1.3.3.tar.gz" + sha256: "ab5b9a9ffd6960f46f7466d9d91f174ec37e8c31989237ba6b9eacdd816464f2" + "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" diff --git a/recipes/xmlsec/all/conanfile.py b/recipes/xmlsec/all/conanfile.py index 30f254478d8cf..d827974a51ea9 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.11.5", transitive_headers=True) + self.requires("libxml2/[>=2.12.5 <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.37") + self.requires("libxslt/1.1.42") 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/2.1.0") + self.tool_requires("pkgconf/[>=2.2 <3]") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): @@ -105,6 +105,9 @@ def generate(self): tc = AutotoolsToolchain(self) if not self.options.shared: tc.extra_defines.append("XMLSEC_STATIC") + if self.settings.os == "Windows": + tc.extra_defines.append("WIN32_LEAN_AND_MEAN") + yes_no = lambda v: "yes" if v else "no" tc.configure_args.extend([ "--enable-crypto-dl=no", @@ -120,6 +123,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) diff --git a/recipes/xmlsec/all/test_package/CMakeLists.txt b/recipes/xmlsec/all/test_package/CMakeLists.txt index 80ae5f35a850c..086b7b6fabec3 100644 --- a/recipes/xmlsec/all/test_package/CMakeLists.txt +++ b/recipes/xmlsec/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(xmlsec REQUIRED CONFIG) diff --git a/recipes/xmlsec/all/test_v1_package/CMakeLists.txt b/recipes/xmlsec/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xmlsec/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xmlsec/all/test_v1_package/conanfile.py b/recipes/xmlsec/all/test_v1_package/conanfile.py deleted file mode 100644 index 8a68c0f50f6f9..0000000000000 --- a/recipes/xmlsec/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.definitions["XMLSEC_WITH_XSLT"] = self.options["xmlsec"].with_xslt - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - xml_file = os.path.join(self.source_folder, os.pardir, "test_package", "sign1-tmpl.xml") - pem_file = os.path.join(self.source_folder, os.pardir, "test_package", "rsakey.pem") - self.run(f"{bin_path} {xml_file} {pem_file}", run_environment=True) diff --git a/recipes/xmlsec/config.yml b/recipes/xmlsec/config.yml index ff9c9e19a6b99..58bd6590d5b0d 100644 --- a/recipes/xmlsec/config.yml +++ b/recipes/xmlsec/config.yml @@ -1,4 +1,12 @@ versions: + "1.3.6": + folder: all + "1.3.4": + folder: all + "1.3.3": + folder: all + "1.3.2": + folder: all "1.2.38": folder: all "1.2.33": diff --git a/recipes/xnnpack/all/conandata.yml b/recipes/xnnpack/all/conandata.yml index 97d441c786f9f..94f6829c40eea 100644 --- a/recipes/xnnpack/all/conandata.yml +++ b/recipes/xnnpack/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "cci.20240229": + url: "https://github.com/google/XNNPACK/archive/fcbf55af6cf28a4627bcd1f703ab7ad843f0f3a2.tar.gz" + sha256: "96b2800652a605f0bd289faa09865792d139cadde89f681c79e1b2a08a7e0498" + "cci.20231026": + url: "https://github.com/google/XNNPACK/archive/ab16a544c1cbc5ee4ec105a2f35f8adca22e94c1.tar.gz" + sha256: "11c7e0555d2c2c14d812b3fba2a277d59121cfb898dcc99de1c76477ff2055a0" "cci.20230715": url: "https://github.com/google/XNNPACK/archive/645035286fe31d47eeb07900450f4f6540b75c2c.tar.gz" sha256: "4c91153dfe4648dc3b325db0b4d6719d6e16f7ce30940b4ceb65abd033e5245e" diff --git a/recipes/xnnpack/all/conanfile.py b/recipes/xnnpack/all/conanfile.py index 5d80f5f3cd167..78398eb2350a3 100644 --- a/recipes/xnnpack/all/conanfile.py +++ b/recipes/xnnpack/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.51.1" +required_conan_version = ">=2.4" class XnnpackConan(ConanFile): @@ -35,38 +35,30 @@ class XnnpackConan(ConanFile): "memopt": True, "sparse": True, } + implements = ["auto_shared_fpic"] + languages = ["C"] def export_sources(self): copy(self, "xnnpack_project_include.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 - - 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 requirements(self): if self.version in ["cci.20220801", "cci.20220621", "cci.20211210"]: - self.requires("cpuinfo/cci.20220228") + self.requires("cpuinfo/cci.20220618") else: - self.requires("cpuinfo/cci.20230118") + self.requires("cpuinfo/cci.20231129") self.requires("fp16/cci.20210320") # https://github.com/google/XNNPACK/blob/ed5f9c0562e016a08b274a4579de5ef500fec134/include/xnnpack.h#L15 - self.requires("pthreadpool/cci.20210218", transitive_headers=True) + self.requires("pthreadpool/cci.20231129", transitive_headers=True) self.requires("fxdiv/cci.20200417") def validate(self): check_min_vs(self, 192) - compiler = self.info.settings.compiler + compiler = self.settings.compiler compiler_version = Version(compiler.version) - if self.version < "cci.20230715": + if Version(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}") @@ -75,6 +67,10 @@ def validate(self): 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}") + if self.options.assembly and compiler == "clang" and self.settings.arch == "armv6": + # clang assembly validator fails on XNNPACK's math.h for armv6: + # https://github.com/google/XNNPACK/issues/4348#issuecomment-1445437613 + raise ConanInvalidConfiguration(f"{self.ref} assembly option is incompatible with clang+armv6") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -120,6 +116,12 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}", "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}") + if self.settings.compiler == "clang" and self.settings.arch == "armv7": + # https://github.com/google/XNNPACK/issues/4348 + # XNNPACK targets armv6, but clang fails to compile to due to a bug in the assembler (see linked issue). + # The user is targetting armv7, so adjust XNNPACK's -march accordingly to avoid the bug. + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "-march=armv6 -mfpu=vfp", "-march=armv7-a -mfpu=neon") def build(self): self._patch_sources() diff --git a/recipes/xnnpack/all/test_package/CMakeLists.txt b/recipes/xnnpack/all/test_package/CMakeLists.txt index b71bd6e6242c8..63e15b72fbc87 100644 --- a/recipes/xnnpack/all/test_package/CMakeLists.txt +++ b/recipes/xnnpack/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 C) find_package(xnnpack REQUIRED CONFIG) diff --git a/recipes/xnnpack/all/test_v1_package/CMakeLists.txt b/recipes/xnnpack/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 7a503e7fa1a41..0000000000000 --- a/recipes/xnnpack/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(xnnpack REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE xnnpack::xnnpack) -target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/xnnpack/all/test_v1_package/conanfile.py b/recipes/xnnpack/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/xnnpack/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_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/xnnpack/config.yml b/recipes/xnnpack/config.yml index a1c159e3728ee..5557e99d09d21 100644 --- a/recipes/xnnpack/config.yml +++ b/recipes/xnnpack/config.yml @@ -1,4 +1,8 @@ versions: + "cci.20240229": + folder: all + "cci.20231026": + folder: all "cci.20230715": folder: all "cci.20220801": 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/test_v1_package/Imakefile b/recipes/xorg-cf-files/all/test_v1_package/Imakefile deleted file mode 100644 index a4a7f50021773..0000000000000 --- a/recipes/xorg-cf-files/all/test_v1_package/Imakefile +++ /dev/null @@ -1,4 +0,0 @@ -PROGRAMS = ProgramTargetName(test_package) -AllTarget($(PROGRAMS)) - -NormalProgramTarget(test_package,test_package.o,,,) diff --git a/recipes/xorg-cf-files/all/test_v1_package/conanfile.py b/recipes/xorg-cf-files/all/test_v1_package/conanfile.py deleted file mode 100644 index 843ab72802179..0000000000000 --- a/recipes/xorg-cf-files/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,45 +0,0 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import contextlib -import os -import shutil - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - exports_sources = "Imakefile", "test_package.c" - - def build_requirements(self): - self.build_requires("imake/1.0.8") - if not tools.get_env("CONAN_MAKE_PROGRAM"): - self.build_requires("make/4.3") - - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) - - @contextlib.contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "cl -nologo", - } - with tools.environment_append(env): - yield - else: - yield - - 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)) - if not tools.cross_building(self): - with self._build_context(): - self.run("imake -DUseInstalled -I{}".format(self.deps_user_info["xorg-cf-files"].CONFIG_PATH), run_environment=True) - with self._build_context(): - autotools = AutoToolsBuildEnvironment(self) - with tools.environment_append(autotools.vars): - autotools.make(target="test_package") - - def test(self): - if not tools.cross_building(self): - self.run(os.path.join(".", "test_package"), run_environment=True) diff --git a/recipes/xorg-cf-files/all/test_v1_package/test_package.c b/recipes/xorg-cf-files/all/test_v1_package/test_package.c deleted file mode 100644 index c5e7cd00f008f..0000000000000 --- a/recipes/xorg-cf-files/all/test_v1_package/test_package.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - printf("hello world!\n"); - return 0; -} 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/test_v1_package/Makefile b/recipes/xorg-gccmakedep/all/test_v1_package/Makefile deleted file mode 100644 index b129780b6cb50..0000000000000 --- a/recipes/xorg-gccmakedep/all/test_v1_package/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -test_package: - $(CC) test_package.c -o test_package diff --git a/recipes/xorg-gccmakedep/all/test_v1_package/conanfile.py b/recipes/xorg-gccmakedep/all/test_v1_package/conanfile.py deleted file mode 100644 index 7ac03637058e2..0000000000000 --- a/recipes/xorg-gccmakedep/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -from conans import ConanFile, tools -from conans.errors import ConanException -import os -import shutil - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - exports_sources = "Makefile", "test_package.c", "test_package.h" - - 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)) - - def test(self): - src = os.path.join(self.source_folder, "test_package.c") - self.run("gccmakedep {}".format(src), run_environment=True) - - if tools.load(os.path.join(self.source_folder, "Makefile")) == os.path.join(self.build_folder, "Makefile"): - raise ConanException("xorg-gccmakedep did not modify `Makefile'") diff --git a/recipes/xorg-gccmakedep/all/test_v1_package/test_package.c b/recipes/xorg-gccmakedep/all/test_v1_package/test_package.c deleted file mode 100644 index d58f0ed2d240b..0000000000000 --- a/recipes/xorg-gccmakedep/all/test_v1_package/test_package.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "test_package.h" - -#include - -int main() { - printf(TEXT); - return EXIT_SUCCESS; -} diff --git a/recipes/xorg-gccmakedep/all/test_v1_package/test_package.h b/recipes/xorg-gccmakedep/all/test_v1_package/test_package.h deleted file mode 100644 index 32e2088cba479..0000000000000 --- a/recipes/xorg-gccmakedep/all/test_v1_package/test_package.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST_PACKAGE_H -#define TEST_PACKAGE_H - -#include - -#define TEXT "hello world\n" - -#endif // TEST_PACKAGE_H 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/all/test_v1_package/Makefile.am b/recipes/xorg-macros/all/test_v1_package/Makefile.am deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/recipes/xorg-macros/all/test_v1_package/conanfile.py b/recipes/xorg-macros/all/test_v1_package/conanfile.py deleted file mode 100644 index 81b7391be15ba..0000000000000 --- a/recipes/xorg-macros/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,32 +0,0 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -import os -import shutil - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - exports_sources = "configure.ac", "Makefile.am", - generators = "pkg_config" - test_type = "explicit" - - @property - def _settings_build(self): - return self.settings_build if hasattr(self, "settings_build") else self.settings - - def build_requirements(self): - self.build_requires(self.tested_reference_str) - 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 build(self): - for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), self.build_folder) - print(tools.get_env("AUTOMAKE_CONAN_INCLUDES")) - self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=self._settings_build.os == "Windows", run_environment=True) - autotools = AutoToolsBuildEnvironment(self, win_bash=self._settings_build.os == "Windows") - autotools.configure() - - def test(self): - # FIXME: how to test extra pkg_config content? - pass diff --git a/recipes/xorg-macros/all/test_v1_package/configure.ac b/recipes/xorg-macros/all/test_v1_package/configure.ac deleted file mode 100644 index 3bb86acef57c9..0000000000000 --- a/recipes/xorg-macros/all/test_v1_package/configure.ac +++ /dev/null @@ -1,14 +0,0 @@ -AC_PREREQ([2.69]) -AC_CONFIG_AUX_DIR([build-aux]) -AC_INIT([test_package], [1.0]) -AC_CONFIG_SRCDIR([configure.ac]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) - -m4_ifndef([XORG_MACROS_VERSION],[ - m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])],[ - AC_MSG_NOTICE([xorg-macros version ok])]) - -XORG_MACROS_VERSION([1.1]) - -AC_CONFIG_FILES(Makefile) -AC_OUTPUT 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/test_v1_package/conanfile.py b/recipes/xorg-makedepend/all/test_v1_package/conanfile.py deleted file mode 100644 index b34e1e6e6345d..0000000000000 --- a/recipes/xorg-makedepend/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,13 +0,0 @@ -from conans import ConanFile, tools -import os - -required_conan_version = ">=1.36.0" - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - if not tools.cross_building(self): - src = os.path.join(self.source_folder, "test_package.c") - self.run("makedepend -f- -- -- {}".format(src), run_environment=True) diff --git a/recipes/xorg-makedepend/all/test_v1_package/test_package.c b/recipes/xorg-makedepend/all/test_v1_package/test_package.c deleted file mode 100644 index d58f0ed2d240b..0000000000000 --- a/recipes/xorg-makedepend/all/test_v1_package/test_package.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "test_package.h" - -#include - -int main() { - printf(TEXT); - return EXIT_SUCCESS; -} diff --git a/recipes/xorg-makedepend/all/test_v1_package/test_package.h b/recipes/xorg-makedepend/all/test_v1_package/test_package.h deleted file mode 100644 index 32e2088cba479..0000000000000 --- a/recipes/xorg-makedepend/all/test_v1_package/test_package.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TEST_PACKAGE_H -#define TEST_PACKAGE_H - -#include - -#define TEXT "hello world\n" - -#endif // TEST_PACKAGE_H 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/conandata.yml b/recipes/xorg-proto/all/conandata.yml index a78c2d2c2da43..31aa321346999 100644 --- a/recipes/xorg-proto/all/conandata.yml +++ b/recipes/xorg-proto/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2024.1": + url: "https://www.x.org/releases/individual/proto/xorgproto-2024.1.tar.gz" + sha256: "4f6b9b4faf91e5df8265b71843a91fc73dc895be6210c84117a996545df296ce" "2022.2": url: "https://www.x.org/releases/individual/proto/xorgproto-2022.2.tar.gz" sha256: "da351a403d07a7006d7bdc8dcfc14ddc1b588b38fb81adab9989a8eef605757b" diff --git a/recipes/xorg-proto/all/conanfile.py b/recipes/xorg-proto/all/conanfile.py index f20cc54f7acb5..b6a780899bca5 100644 --- a/recipes/xorg-proto/all/conanfile.py +++ b/recipes/xorg-proto/all/conanfile.py @@ -45,10 +45,7 @@ def requirements(self): self.requires("xorg-macros/1.19.3") def package_id(self): - # self.info.clear() would be fine too, but keep the os to add c3i test coverage for Windows. - del self.info.settings.arch - del self.info.settings.build_type - del self.info.settings.compiler + self.info.clear() def export_sources(self): export_conandata_patches(self) diff --git a/recipes/xorg-proto/all/test_v1_package/CMakeLists.txt b/recipes/xorg-proto/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 39b78234180b2..0000000000000 --- a/recipes/xorg-proto/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -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}) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) diff --git a/recipes/xorg-proto/all/test_v1_package/conanfile.py b/recipes/xorg-proto/all/test_v1_package/conanfile.py deleted file mode 100644 index 74a00ca1ef212..0000000000000 --- a/recipes/xorg-proto/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake -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 cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/xorg-proto/config.yml b/recipes/xorg-proto/config.yml index 2928e57dc1b28..0af5118e3b73a 100644 --- a/recipes/xorg-proto/config.yml +++ b/recipes/xorg-proto/config.yml @@ -1,4 +1,6 @@ versions: + "2024.1": + folder: "all" "2022.2": folder: "all" "2021.4": diff --git a/recipes/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py index b8a810681f531..18c7f048404e4 100644 --- a/recipes/xorg/all/conanfile.py +++ b/recipes/xorg/all/conanfile.py @@ -1,7 +1,8 @@ -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 +from conan.tools.scm import Version required_conan_version = ">=1.50.0" @@ -29,17 +30,19 @@ 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-glx0-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) + "libxcb-xinerama0-dev", "libxcb-dri3-dev", "uuid-dev", "libxcb-cursor-dev", "libxcb-dri2-0-dev", + "libxcb-dri3-dev", "libxcb-present-dev", "libxcb-composite0-dev", "libxcb-ewmh-dev", + "libxcb-res0-dev"], update=True, check=True) apt.install_substitutes( ["libxcb-util-dev"], ["libxcb-util0-dev"], update=True, check=True) 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 +50,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 +58,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,23 +66,38 @@ 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) + if Version(conan_version) >= "2.0.10": + alpine = package_manager.Apk(self) + alpine.install(["libx11-dev", " libxcb-dev", "libfontenc-dev", "libice-dev", "libsm-dev", " libxau-dev", "libxaw-dev", + "libxcomposite-dev", "libxcursor-dev", "libxdamage-dev", "libxdmcp-dev", " libxext-dev", "libxfixes-dev", "libxi-dev", + "libxinerama-dev", "libxkbfile-dev", " libxmu-dev", "libxpm-dev", "libxrandr-dev", "libxrender-dev", "libxres-dev", + "libxscrnsaver-dev", "libxt-dev", "libxtst-dev", "libxv-dev", "libxxf86vm-dev", + "xcb-util-wm-dev", "xcb-util-image-dev", "xcb-util-keysyms-dev", "xcb-util-renderutil-dev", + "libxinerama-dev", "libxcb-dev", "xcb-util-dev", "xcb-util-cursor-dev"], update=True, check=True) + def package_info(self): + if Version(conan_version) >= 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", - "xcb-dri3", "xcb-cursor"] + ([] if self.settings.os == "FreeBSD" else ["uuid"]): + "xcb-dri3", "xcb-cursor", "xcb-dri2", "xcb-dri3", "xcb-glx", "xcb-present", + "xcb-composite", "xcb-ewmh", "xcb-res"] + ([] if self.settings.os == "FreeBSD" else ["uuid"]): pkg_config = PkgConfig(self, name) pkg_config.fill_cpp_info( self.cpp_info.components[name], is_system=self.settings.os != "FreeBSD") @@ -88,6 +106,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/xorg/all/test_package/CMakeLists.txt b/recipes/xorg/all/test_package/CMakeLists.txt index 36e3820bcc3ab..ed5d30cc76fd0 100644 --- a/recipes/xorg/all/test_package/CMakeLists.txt +++ b/recipes/xorg/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(xorg REQUIRED CONFIG) diff --git a/recipes/xorg/all/test_v1_package/CMakeLists.txt b/recipes/xorg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index e6abf262eddbd..0000000000000 --- a/recipes/xorg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(xorg REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE xorg::xorg) diff --git a/recipes/xorg/all/test_v1_package/conanfile.py b/recipes/xorg/all/test_v1_package/conanfile.py deleted file mode 100644 index ce69ba8b754ca..0000000000000 --- a/recipes/xorg/all/test_v1_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", "pkg_config" - - def build(self): - self.run("pkg-config --validate ./uuid.pc") - 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/xorstr/all/test_package/CMakeLists.txt b/recipes/xorstr/all/test_package/CMakeLists.txt index b2faa1d5c02ce..16216fc26e62e 100644 --- a/recipes/xorstr/all/test_package/CMakeLists.txt +++ b/recipes/xorstr/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(xorstr REQUIRED CONFIG) diff --git a/recipes/xorstr/all/test_v1_package/CMakeLists.txt b/recipes/xorstr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xorstr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xorstr/all/test_v1_package/conanfile.py b/recipes/xorstr/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/xorstr/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_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/xoshiro-cpp/all/test_package/CMakeLists.txt b/recipes/xoshiro-cpp/all/test_package/CMakeLists.txt index 4a58eb5fc4eb1..b1b6d33f45a41 100644 --- a/recipes/xoshiro-cpp/all/test_package/CMakeLists.txt +++ b/recipes/xoshiro-cpp/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(xoshiro-cpp REQUIRED CONFIG) diff --git a/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt b/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xoshiro-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xoshiro-cpp/all/test_v1_package/conanfile.py b/recipes/xoshiro-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 2fc6ad2a6a2ba..0000000000000 --- a/recipes/xoshiro-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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): - bin_path = os.path.join("bin", "test_package") - self.run("{0}".format(bin_path), run_environment=True) diff --git a/recipes/xpack/all/conandata.yml b/recipes/xpack/all/conandata.yml index 86baf40457468..1216e4df4ec82 100644 --- a/recipes/xpack/all/conandata.yml +++ b/recipes/xpack/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.5": + url: "https://github.com/xyz347/xpack/archive/v1.0.5.tar.gz" + sha256: "ea8693dd3a53d54e0c1e3c9e6e06f31ff7f593f7f8cf8fb4889f5c3354dbae8e" "1.0.4": url: "https://github.com/xyz347/xpack/archive/v1.0.4.tar.gz" sha256: "ccea6d986052a9ad8ad859ad42283fc01fed29009133017b231a06ec0b1976b9" diff --git a/recipes/xpack/all/conanfile.py b/recipes/xpack/all/conanfile.py index fb4f7dbe93adb..278c5b2d134b0 100644 --- a/recipes/xpack/all/conanfile.py +++ b/recipes/xpack/all/conanfile.py @@ -28,7 +28,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("rapidjson/cci.20220822") + self.requires("rapidjson/cci.20230929") self.requires("rapidxml/1.13") def package_id(self): @@ -51,7 +51,7 @@ def package(self): pattern="*.h", dst=os.path.join(self.package_folder, "include", "xpack"), src=self.source_folder, - excludes=["example", "gtest", "thirdparty"], + excludes=["example", "gtest", "thirdparty", "rapidjson"], ) def package_info(self): diff --git a/recipes/xpack/all/test_package/CMakeLists.txt b/recipes/xpack/all/test_package/CMakeLists.txt index 64e85764dcebb..d541c97e00195 100644 --- a/recipes/xpack/all/test_package/CMakeLists.txt +++ b/recipes/xpack/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(xpack CONFIG REQUIRED) diff --git a/recipes/xpack/all/test_v1_package/CMakeLists.txt b/recipes/xpack/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/xpack/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xpack/all/test_v1_package/conanfile.py b/recipes/xpack/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/xpack/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/xpack/config.yml b/recipes/xpack/config.yml index 7ae7c5d038959..8588b8510913c 100644 --- a/recipes/xpack/config.yml +++ b/recipes/xpack/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.5": + folder: "all" "1.0.4": folder: "all" "1.0.3": diff --git a/recipes/xproperty/all/conandata.yml b/recipes/xproperty/all/conandata.yml index e22cd28ead6ab..b13aae1530d67 100644 --- a/recipes/xproperty/all/conandata.yml +++ b/recipes/xproperty/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.12.0": + url: "https://github.com/jupyter-xeus/xproperty/archive/refs/tags/0.12.0.tar.gz" + sha256: "27cbc8e441dcc515a1ebbf11bad5ef240748d32f5e1adf84deed87a1dc57a440" "0.11.0": url: "https://github.com/jupyter-xeus/xproperty/archive/refs/tags/0.11.0.tar.gz" sha256: "bf86a11c6758308aa0aa0f64d8dd24cd3e9d78378467b74002f552bfb75fc0eb" diff --git a/recipes/xproperty/all/conanfile.py b/recipes/xproperty/all/conanfile.py index e6eeff282118e..dce5d7f565304 100644 --- a/recipes/xproperty/all/conanfile.py +++ b/recipes/xproperty/all/conanfile.py @@ -2,35 +2,42 @@ from conan.tools.build import check_min_cppstd from conan.tools.files import copy, get, save from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=2.1.0" class XpropertyConan(ConanFile): name = "xproperty" description = "Traitlets-like C++ properties and implementation of the observer pattern." license = "BSD-3-Clause" - topics = ("observer", "traitlets") - homepage = "https://github.com/jupyter-xeus/xproperty" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jupyter-xeus/xproperty" + topics = ("observer", "traitlets", "header-only") package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True + @property + def _min_cppstd(self): + return "14" if Version(self.version) <= "0.12.0" else "17" + def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("xtl/0.7.4", transitive_headers=True, transitive_libs=True) + if Version(self.version) < "0.12.0": + self.requires("xtl/0.7.4", transitive_headers=True, transitive_libs=True) + else: + self.requires("nlohmann_json/3.11.3") 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) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/xproperty/all/test_package/CMakeLists.txt b/recipes/xproperty/all/test_package/CMakeLists.txt index 5115f7961f51a..c66c5568f1b3d 100644 --- a/recipes/xproperty/all/test_package/CMakeLists.txt +++ b/recipes/xproperty/all/test_package/CMakeLists.txt @@ -1,8 +1,12 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(xproperty REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE xproperty) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +if(xproperty_VERSION VERSION_LESS "0.12.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/recipes/xproperty/all/test_v1_package/CMakeLists.txt b/recipes/xproperty/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/xproperty/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xproperty/all/test_v1_package/conanfile.py b/recipes/xproperty/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/xproperty/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_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/xproperty/config.yml b/recipes/xproperty/config.yml index 98fa57f62a6c8..b63b89545fb06 100644 --- a/recipes/xproperty/config.yml +++ b/recipes/xproperty/config.yml @@ -1,3 +1,5 @@ versions: + "0.12.0": + folder: all "0.11.0": folder: all diff --git a/recipes/xqilla/all/test_package/CMakeLists.txt b/recipes/xqilla/all/test_package/CMakeLists.txt index 689d0b9e4eff3..1907e9e36d1eb 100644 --- a/recipes/xqilla/all/test_package/CMakeLists.txt +++ b/recipes/xqilla/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(xqilla REQUIRED CONFIG) diff --git a/recipes/xsd/all/test_v1_package/conanfile.py b/recipes/xsd/all/test_v1_package/conanfile.py deleted file mode 100644 index 7ea50ba1ad430..0000000000000 --- a/recipes/xsd/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -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 f65775fd15ca5..d6931cd59a48c 100644 --- a/recipes/xsimd/all/conandata.yml +++ b/recipes/xsimd/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "13.2.0": + url: "https://github.com/xtensor-stack/xsimd/archive/13.2.0.tar.gz" + sha256: "edd8cd3d548c185adc70321c53c36df41abe64c1fe2c67bc6d93c3ecda82447a" + "13.0.0": + url: "https://github.com/xtensor-stack/xsimd/archive/13.0.0.tar.gz" + sha256: "8bdbbad0c3e7afa38d88d0d484d70a1671a1d8aefff03f4223ab2eb6a41110a3" + "12.1.1": + url: "https://github.com/xtensor-stack/xsimd/archive/12.1.1.tar.gz" + sha256: "73f94a051278ef3da4533b691d31244d12074d5d71107473a9fd8d7be15f0110" "12.1.0": url: "https://github.com/xtensor-stack/xsimd/archive/12.1.0.tar.gz" sha256: "86b86e0aeba7a85575f6e079728f0c2b65307dddb7210487f2b7cb261ac8a4a2" diff --git a/recipes/xsimd/all/test_package/CMakeLists.txt b/recipes/xsimd/all/test_package/CMakeLists.txt index 0624e265ce85e..6ac5b55ee6ce1 100644 --- a/recipes/xsimd/all/test_package/CMakeLists.txt +++ b/recipes/xsimd/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) include(CheckCXXCompilerFlag) diff --git a/recipes/xsimd/all/test_package/test_package.cpp b/recipes/xsimd/all/test_package/test_package.cpp index be0d55dea1818..ed1e514c89b74 100644 --- a/recipes/xsimd/all/test_package/test_package.cpp +++ b/recipes/xsimd/all/test_package/test_package.cpp @@ -1,27 +1,17 @@ #include "xsimd/xsimd.hpp" #include -namespace xs = xsimd; - -#if XSIMD_VERSION_MAJOR >= 9 && (XSIMD_WITH_NEON64 || XSIMD_WITH_NEON) -using number_type = float; -#else -using number_type = double; -#endif - int main(int argc, char *argv[]) { + namespace xs = xsimd; #if XSIMD_VERSION_MAJOR < 8 - xs::batch a(1.5, 2.5, 3.5, 4.5); - xs::batch b(2.5, 3.5, 4.5, 5.5); -#elif XSIMD_VERSION_MAJOR < 9 - xs::batch a({1.5, 2.5, 3.5, 4.5}); - xs::batch b({2.5, 3.5, 4.5, 5.5}); + xs::batch a(1., 1.); + xs::batch b(2., 2.); #else - xs::batch a{1.5, 2.5, 3.5, 4.5}; - xs::batch b{2.5, 3.5, 4.5, 5.5}; + auto a = xs::broadcast(1.); + auto b = xs::broadcast(2.); #endif - auto mean = (a + b) / 2; - std::cout << mean << std::endl; + auto mean = (a + b) / 2.; + std::cout << "Mean: " << mean << std::endl; return 0; } diff --git a/recipes/xsimd/all/test_v1_package/CMakeLists.txt b/recipes/xsimd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/xsimd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xsimd/all/test_v1_package/conanfile.py b/recipes/xsimd/all/test_v1_package/conanfile.py deleted file mode 100644 index 71bd246c37e4e..0000000000000 --- a/recipes/xsimd/all/test_v1_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.definitions["XSIMD_WITH_XTL"] = self.options["xsimd"].xtl_complex - 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/xsimd/config.yml b/recipes/xsimd/config.yml index 65384140b0d83..fdf358e3422e6 100644 --- a/recipes/xsimd/config.yml +++ b/recipes/xsimd/config.yml @@ -1,4 +1,10 @@ versions: + "13.2.0": + folder: all + "13.0.0": + folder: all + "12.1.1": + folder: all "12.1.0": folder: all "12.0.0": diff --git a/recipes/xtensor/all/conandata.yml b/recipes/xtensor/all/conandata.yml index c0af344ba276e..300c78982eca0 100644 --- a/recipes/xtensor/all/conandata.yml +++ b/recipes/xtensor/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.25.0": + url: "https://github.com/xtensor-stack/xtensor/archive/0.25.0.tar.gz" + sha256: "32d5d9fd23998c57e746c375a544edf544b74f0a18ad6bc3c38cbba968d5e6c7" "0.24.7": url: "https://github.com/xtensor-stack/xtensor/archive/0.24.7.tar.gz" sha256: "0fbbd524dde2199b731b6af99b16063780de6cf1d0d6cb1f3f4d4ceb318f3106" diff --git a/recipes/xtensor/all/conanfile.py b/recipes/xtensor/all/conanfile.py index 892b72ea17486..1181b6ae698ab 100644 --- a/recipes/xtensor/all/conanfile.py +++ b/recipes/xtensor/all/conanfile.py @@ -57,7 +57,7 @@ def requirements(self): if Version(self.version) < "0.24.0": self.requires("xsimd/7.5.0") else: - self.requires("xsimd/12.0.0") + self.requires("xsimd/13.0.0") if self.options.tbb: self.requires("onetbb/2021.10.0") diff --git a/recipes/xtensor/all/test_package/CMakeLists.txt b/recipes/xtensor/all/test_package/CMakeLists.txt index ed456ebb1ccdb..82ea3aed764d8 100644 --- a/recipes/xtensor/all/test_package/CMakeLists.txt +++ b/recipes/xtensor/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) include(CheckCXXCompilerFlag) diff --git a/recipes/xtensor/all/test_v1_package/CMakeLists.txt b/recipes/xtensor/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xtensor/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xtensor/all/test_v1_package/conanfile.py b/recipes/xtensor/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/xtensor/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_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/xtensor/config.yml b/recipes/xtensor/config.yml index f1891e507a429..44984f8af502c 100644 --- a/recipes/xtensor/config.yml +++ b/recipes/xtensor/config.yml @@ -1,4 +1,6 @@ versions: + "0.25.0": + folder: all "0.24.7": folder: all "0.24.6": diff --git a/recipes/xtl/all/conandata.yml b/recipes/xtl/all/conandata.yml index de42ad34f303f..2da48ecbdb375 100644 --- a/recipes/xtl/all/conandata.yml +++ b/recipes/xtl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.0": + url: "https://github.com/xtensor-stack/xtl/archive/0.8.0.tar.gz" + sha256: "ee38153b7dd0ec84cee3361f5488a4e7e6ddd26392612ac8821cbc76e740273a" "0.7.6": url: "https://github.com/xtensor-stack/xtl/archive/0.7.6.tar.gz" sha256: "dda442dc81f390f77561913062471c39b6ef19ffc6f64d3cd12b5c4b4607c957" diff --git a/recipes/xtl/all/conanfile.py b/recipes/xtl/all/conanfile.py index 60668a4a58f13..f4a4a9ccd72b6 100644 --- a/recipes/xtl/all/conanfile.py +++ b/recipes/xtl/all/conanfile.py @@ -1,12 +1,11 @@ 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 +from conan.tools.files import copy, get from conan.tools.layout import basic_layout +from conan.tools.scm import Version import os -import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=2" class XtlConan(ConanFile): @@ -17,35 +16,14 @@ class XtlConan(ConanFile): description = "The x template library" topics = ("templates", "containers", "algorithms") settings = "os", "arch", "compiler", "build_type" + package_type = "header-library" no_copy_source = True - @property - def _compilers_minimum_version(self): - return { - "clang": "3.9", - "gcc": "6", - "Visual Studio": "15", - "msvc": "191", - } - 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] - - 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++14, which your compiler does not support.", - ) + check_min_cppstd(self, 14 if Version(self.version) < "0.8" else 17) def layout(self): basic_layout(self, src_folder="src") @@ -54,34 +32,10 @@ def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, 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, "*.hpp", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) - # 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), - {"xtl": "xtl::xtl"}, - ) - - 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", "xtl") self.cpp_info.set_property("cmake_target_name", "xtl") @@ -90,7 +44,3 @@ def package_info(self): 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.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/xtl/all/test_package/CMakeLists.txt b/recipes/xtl/all/test_package/CMakeLists.txt index db51a113d84aa..7b7cc1de01b8e 100644 --- a/recipes/xtl/all/test_package/CMakeLists.txt +++ b/recipes/xtl/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(xtl REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE xtl) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/xtl/all/test_package/test_package.cpp b/recipes/xtl/all/test_package/test_package.cpp index f323ad56d9437..92717d4b43fe8 100644 --- a/recipes/xtl/all/test_package/test_package.cpp +++ b/recipes/xtl/all/test_package/test_package.cpp @@ -1,15 +1,14 @@ #include -#include +#include int main(int argc, char *argv[]) { - xtl::variant v, w; + xtl::xoptional v, w; + w = v.value_or(0); v = 12; - int i = xtl::get(v); - w = xtl::get(v); - std::cout << xtl::get(v) << "\n"; - std::cout << xtl::get(w) << "\n"; + std::cout << v.value() << "\n"; + std::cout << w.value() << "\n"; return 0; } diff --git a/recipes/xtl/all/test_v1_package/CMakeLists.txt b/recipes/xtl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/xtl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xtl/all/test_v1_package/conanfile.py b/recipes/xtl/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/xtl/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_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/xtl/config.yml b/recipes/xtl/config.yml index 59f6a1275ac35..d2ad3d440da0f 100644 --- a/recipes/xtl/config.yml +++ b/recipes/xtl/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.0": + folder: all "0.7.6": folder: all "0.7.5": diff --git a/recipes/xtr/all/conandata.yml b/recipes/xtr/all/conandata.yml index c4c7a036934fc..36f7c0c7ec615 100644 --- a/recipes/xtr/all/conandata.yml +++ b/recipes/xtr/all/conandata.yml @@ -1,16 +1,16 @@ sources: + "2.1.2": + url: "https://github.com/choll/xtr/archive/refs/tags/2.1.2.tar.gz" + sha256: "81ff3511e877db68882d01be9e521d317c8222838b0793e48cfd631f405bb3e8" + "2.1.1": + url: "https://github.com/choll/xtr/archive/refs/tags/2.1.1.tar.gz" + sha256: "dbd8d1fbb5308329fe21bbe704206e2e69a5d49696959d43a2504ea1bec00140" "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" - "2.0.0": - url: "https://github.com/choll/xtr/archive/refs/tags/2.0.0.tar.gz" - sha256: "1d0113d3551e0d5f5b97228ba245d711c6b66a62a69d62bdf1b206fdf45edd41" "1.0.1": url: "https://github.com/choll/xtr/archive/refs/tags/1.0.1.tar.gz" sha256: "7cc5ec7a2d7d2979e33b928191def79dc05c8074f4c8bb76cd0a20d9b514be0c" - "1.0.0": - url: "https://github.com/choll/xtr/archive/refs/tags/1.0.0.tar.gz" - sha256: "c828883f3045762442fb8a69ed2633e523493a307a0cb2717ac0df93606db7fd" diff --git a/recipes/xtr/all/conanfile.py b/recipes/xtr/all/conanfile.py index 494c8ad3c65f3..d298982bf4d46 100644 --- a/recipes/xtr/all/conanfile.py +++ b/recipes/xtr/all/conanfile.py @@ -1,125 +1,161 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, 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 CMakeToolchain, CMakeDeps, CMake +from conan.tools.files import copy, get, replace_in_file +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + class XtrConan(ConanFile): name = "xtr" - description = \ - "C++ Logging Library for Low-latency or Real-time Environments" - topics = ("xtr", "logging", "logger") + description = "C++ Logging Library for Low-latency or Real-time Environments" + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/choll/xtr" - license = "MIT" + topics = ("logging", "logger") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { + "shared": [True, False], "fPIC": [True, False], "enable_exceptions": [True, False], "enable_lto": [True, False], "enable_io_uring": ["auto", True, False], "enable_io_uring_sqpoll": [True, False], - "sink_capacity_kb": "ANY" + "sink_capacity_kb": [None, "ANY"], } default_options = { + "shared": False, "fPIC": True, "enable_exceptions": True, "enable_lto": False, "enable_io_uring": "auto", "enable_io_uring_sqpoll": False, - "sink_capacity_kb": None + "sink_capacity_kb": None, } - generators = "make" + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + "clang": "12", + } + def config_options(self): - if tools.Version(self.version) < "1.0.1": - del self.options.sink_capacity_kb - if tools.Version(self.version) < "2.0.0": + if Version(self.version) >= "2.0.0" and self.settings.os == "Linux": + # Require liburing on any Linux system by default as a run-time check will be + # done to detect if the host kernel supports io_uring. + self.options.enable_io_uring = True + else: del self.options.enable_io_uring del self.options.enable_io_uring_sqpoll + 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("fmt/7.1.3") - # Require liburing on any Linux system as a run-time check will be - # done to detect if the host kernel supports io_uring. - if tools.Version(self.version) >= "2.0.0" and self.settings.os == "Linux" and self.options.get_safe("enable_io_uring"): - self.requires("liburing/2.1") + # INFO: https://github.com/choll/xtr/blob/2.1.0/include/xtr/detail/buffer.hpp#L27 + self.requires("fmt/10.1.1", transitive_headers=True, transitive_libs=True) + if self.options.get_safe("enable_io_uring"): + self.requires("liburing/2.4") def validate(self): - if self.settings.os not in ("FreeBSD", "Linux"): + if self.settings.os not in ["FreeBSD", "Linux"]: raise ConanInvalidConfiguration(f"Unsupported os={self.settings.os}") - if self.settings.compiler not in ("gcc", "clang"): - raise ConanInvalidConfiguration(f"Unsupported compiler={self.settings.compiler}") - if self.settings.arch not in ("x86_64", ): + if self.settings.arch not in ["x86_64"]: raise ConanInvalidConfiguration(f"Unsupported arch={self.settings.arch}") - if tools.Version(self.version) < "2.0.0" and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": - raise ConanInvalidConfiguration(f"Use at least version 2.0.0 for libc++ compatibility") - if self.options.get_safe("enable_io_uring_sqpoll") and not self.options.get_safe("enable_io_uring"): - raise ConanInvalidConfiguration(f"io_uring must be enabled if io_uring_sqpoll is enabled") - if self.options.get_safe("sink_capacity_kb") and not str(self.options.get_safe("sink_capacity_kb")).isdigit(): - raise ConanInvalidConfiguration(f"The option 'sink_capacity_kb' must be an integer") - minimal_cpp_standard = 20 if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, minimal_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 Version(self.version) < "2.0.0" and str(self.settings.compiler.libcxx) == "libc++": + raise ConanInvalidConfiguration("Use at least version 2.0.0 for libc++ compatibility") - minimum_version = {"gcc": 10, "clang": 12} - compiler = str(self.settings.compiler) - version = tools.Version(self.settings.compiler.version) + if self.options.get_safe("enable_io_uring_sqpoll") and not self.options.get_safe("enable_io_uring"): + raise ConanInvalidConfiguration("io_uring must be enabled if io_uring_sqpoll is enabled") + if self.options.get_safe("sink_capacity_kb") and not str(self.options.get_safe("sink_capacity_kb")).isdigit(): + raise ConanInvalidConfiguration("The option 'sink_capacity_kb' must be an integer") - if version < minimum_version[compiler]: - raise ConanInvalidConfiguration( - f"{self.name} requires {self.settings.compiler} version {minimum_version[compiler]} or later") + if Version(self.dependencies["fmt"].ref.version) < 6: + raise ConanInvalidConfiguration("The version of fmt must be >= 6.0.0") + if Version(self.dependencies["fmt"].ref.version) == "8.0.0" and self.settings.compiler == "clang": + raise ConanInvalidConfiguration("fmt/8.0.0 is known to not work with clang (https://github.com/fmtlib/fmt/issues/2377)") 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) - def get_defines(self): + def _get_defines(self): defines = [] enable_io_uring = self.options.get_safe("enable_io_uring") if enable_io_uring in (True, False): - defines += ["XTR_USE_IO_URING={}".format(int(bool(enable_io_uring)))] + defines += [f"XTR_USE_IO_URING={int(bool(enable_io_uring))}"] if self.options.get_safe("enable_io_uring_sqpoll"): defines += ["XTR_IO_URING_POLL=1"] capacity = self.options.get_safe("sink_capacity_kb") if capacity: - defines += ["XTR_SINK_CAPACITY={}".format(int(capacity) * 1024)] + defines += [f"XTR_SINK_CAPACITY={int(capacity) * 1024}"] return defines - def build(self): - # FIXME: should be done in validate (but version is not yet available there) - if tools.Version(self.deps_cpp_info["fmt"].version) < 6: - raise ConanInvalidConfiguration("The version of fmt must >= 6.0.0") - if tools.Version(self.deps_cpp_info["fmt"].version) == "8.0.0" and self.settings.compiler == "clang": - raise ConanInvalidConfiguration("fmt/8.0.0 is known to not work with clang (https://github.com/fmtlib/fmt/issues/2377)") + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["ENABLE_EXCEPTIONS"] = self.options.enable_exceptions + tc.cache_variables["ENABLE_LTO"] = self.options.enable_lto + tc.cache_variables["BUILD_SINGLE_HEADER"] = False + tc.cache_variables["BUILD_BENCHMARK"] = False + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["INSTALL_DOCS"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + if Version(self.version) >= "2.0.0": + # Ensure that liburing from Conan is used + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(liburing)", + "find_package(liburing REQUIRED NO_DEFAULT_PATH PATHS ${CMAKE_PREFIX_PATH})" + if self.options.get_safe("enable_io_uring") else + "") + if Version(self.version) < "2.1.2": + # Non-single header installation is broken until 2.1.2 + # https://github.com/choll/xtr/pull/4 + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + " PUBLIC_HEADER DESTINATION include)", + ")\ninstall(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include)") - autotools = AutoToolsBuildEnvironment(self) - env_build_vars = autotools.vars - # Conan uses LIBS, presumably following autotools conventions, while - # the XTR makefile follows GNU make conventions and uses LDLIBS - env_build_vars["LDLIBS"] = env_build_vars["LIBS"] - # fPIC and Release/Debug/RelWithDebInfo etc are set via CXXFLAGS, - # CPPFLAGS etc. - env_build_vars["EXCEPTIONS"] = \ - str(int(bool(self.options.enable_exceptions))) - env_build_vars["LTO"] = str(int(bool(self.options.enable_lto))) - env_build_vars["CXXFLAGS"] += "".join([" -D{}".format(d) for d in self.get_defines()]) - autotools.make(vars=env_build_vars) - autotools.make(vars=env_build_vars, target="xtrctl") + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self.copy("LICENSE", dst="licenses") - self.copy("*.hpp", src="include", dst="include") - self.copy("*/libxtr.a", src="build", dst="lib", keep_path=False) - self.copy("*/xtrctl", src="build", dst="bin", keep_path=False) - - tools.rmdir(os.path.join(self.package_folder, "man")) + 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 = ["xtr"] self.cpp_info.system_libs = ["pthread"] - self.cpp_info.defines = self.get_defines() + self.cpp_info.defines = self._get_defines() + + # TODO: Legacy, to be removed on Conan 2.0 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/xtr/all/test_package/CMakeLists.txt b/recipes/xtr/all/test_package/CMakeLists.txt index 921819122a4a1..3c2e1a85eb695 100644 --- a/recipes/xtr/all/test_package/CMakeLists.txt +++ b/recipes/xtr/all/test_package/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) set(CMAKE_CXX_STANDARD 20) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) -find_package(xtr REQUIRED) +find_package(xtr REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE xtr::xtr) diff --git a/recipes/xtr/all/test_package/conanfile.py b/recipes/xtr/all/test_package/conanfile.py index 38f4483872d47..ef5d7042163ec 100644 --- a/recipes/xtr/all/test_package/conanfile.py +++ b/recipes/xtr/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/xtr/config.yml b/recipes/xtr/config.yml index ecc6dca2fd252..6712968772b74 100644 --- a/recipes/xtr/config.yml +++ b/recipes/xtr/config.yml @@ -1,11 +1,11 @@ versions: + "2.1.2": + folder: all + "2.1.1": + folder: all "2.1.0": folder: all "2.0.1": folder: all - "2.0.0": - folder: all "1.0.1": folder: all - "1.0.0": - folder: all diff --git a/recipes/xtrans/all/test_v1_package/conanfile.py b/recipes/xtrans/all/test_v1_package/conanfile.py deleted file mode 100644 index c20eb932e465e..0000000000000 --- a/recipes/xtrans/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,13 +0,0 @@ -from conans import ConanFile -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "pkg_config" - - def build(self): - pass - - def test(self): - self.run("pkg-config --validate ./xtrans.pc") diff --git a/recipes/xxhash/all/conandata.yml b/recipes/xxhash/all/conandata.yml index 06fb02fd0ae83..d56024b1cce92 100644 --- a/recipes/xxhash/all/conandata.yml +++ b/recipes/xxhash/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8.3": + url: "https://github.com/Cyan4973/xxHash/archive/v0.8.3.tar.gz" + sha256: "aae608dfe8213dfd05d909a57718ef82f30722c392344583d3f39050c7f29a80" "0.8.2": url: "https://github.com/Cyan4973/xxHash/archive/v0.8.2.tar.gz" sha256: "baee0c6afd4f03165de7a4e67988d16f0f2b257b51d0e3cb91909302a26a79c4" diff --git a/recipes/xxhash/all/conanfile.py b/recipes/xxhash/all/conanfile.py index 3e018a810c976..d7a2baebf4355 100644 --- a/recipes/xxhash/all/conanfile.py +++ b/recipes/xxhash/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" @@ -53,6 +54,8 @@ def generate(self): tc.cache_variables["CMAKE_MACOSX_BUNDLE"] = False # Generate a relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if Version(self.version) < "0.8.3": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def build(self): @@ -75,13 +78,4 @@ def package_info(self): self.cpp_info.set_property("pkg_config_name", "libxxhash") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed self.cpp_info.components["libxxhash"].libs = ["xxhash"] - - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "xxHash" - self.cpp_info.names["cmake_find_package_multi"] = "xxHash" - self.cpp_info.names["pkg_config"] = "libxxhash" - self.cpp_info.components["libxxhash"].names["cmake_find_package"] = "xxhash" - self.cpp_info.components["libxxhash"].names["cmake_find_package_multi"] = "xxhash" self.cpp_info.components["libxxhash"].set_property("cmake_target_name", "xxHash::xxhash") - if self.options.utility: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/xxhash/all/test_package/CMakeLists.txt b/recipes/xxhash/all/test_package/CMakeLists.txt index 635658efca1c2..e8ed23d84c91a 100644 --- a/recipes/xxhash/all/test_package/CMakeLists.txt +++ b/recipes/xxhash/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(xxHash REQUIRED CONFIG) diff --git a/recipes/xxhash/all/test_v1_package/CMakeLists.txt b/recipes/xxhash/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/xxhash/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/xxhash/all/test_v1_package/conanfile.py b/recipes/xxhash/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/xxhash/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_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/xxhash/config.yml b/recipes/xxhash/config.yml index 50595ee5e4913..fe5a7c5b635b6 100644 --- a/recipes/xxhash/config.yml +++ b/recipes/xxhash/config.yml @@ -1,4 +1,6 @@ versions: + "0.8.3": + folder: all "0.8.2": folder: all "0.8.1": diff --git a/recipes/xxsds-sdsl-lite/all/test_v1_package/CMakeLists.txt b/recipes/xxsds-sdsl-lite/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/xxsds-sdsl-lite/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 75634e62bcb66..0000000000000 --- a/recipes/xxsds-sdsl-lite/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +0,0 @@ -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 09ca27188fcd2..3274a9b4cdc21 100644 --- a/recipes/xz_utils/all/conandata.yml +++ b/recipes/xz_utils/all/conandata.yml @@ -1,24 +1,38 @@ sources: "5.4.5": - url: "https://tukaani.org/xz/xz-5.4.5.tar.xz" + url: + - "https://tukaani.org/xz/xz-5.4.5.tar.xz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/da9dec6c12cf2ecf269c31ab65b5de18e8e52b96f35d5bcd08c12b43e6878803" sha256: "da9dec6c12cf2ecf269c31ab65b5de18e8e52b96f35d5bcd08c12b43e6878803" "5.4.4": - url: "https://tukaani.org/xz/xz-5.4.4.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.4.4.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/aae39544e254cfd27e942d35a048d592959bd7a79f9a624afb0498bb5613bdf8" sha256: "aae39544e254cfd27e942d35a048d592959bd7a79f9a624afb0498bb5613bdf8" "5.4.2": - url: "https://tukaani.org/xz/xz-5.4.2.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.4.2.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05" sha256: "87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05" "5.4.0": - url: "https://tukaani.org/xz/xz-5.4.0.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.4.0.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b" sha256: "7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b" "5.2.10": - url: "https://tukaani.org/xz/xz-5.2.10.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.2.10.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3" sha256: "eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3" "5.2.5": - url: "https://tukaani.org/xz/xz-5.2.5.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.2.5.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" sha256: "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" "5.2.4": - url: "https://tukaani.org/xz/xz-5.2.4.tar.gz" + url: + - "https://tukaani.org/xz/xz-5.2.4.tar.gz" + - "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145" sha256: "b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145" patches: "5.2.4": diff --git a/recipes/xz_utils/all/conanfile.py b/recipes/xz_utils/all/conanfile.py index 388fe0cf2e851..212eb51f593cc 100644 --- a/recipes/xz_utils/all/conanfile.py +++ b/recipes/xz_utils/all/conanfile.py @@ -50,6 +50,13 @@ def _effective_msbuild_type(self): @property def _msbuild_target(self): return "liblzma_dll" if self.options.shared else "liblzma" + + @property + def _use_msbuild(self): + assume_clang_cl = (self.settings.os == "Windows" + and self.settings.compiler == "clang" + and self.settings.get_safe("compiler.runtime") is not None) + return is_msvc(self) or assume_clang_cl def export_sources(self): export_conandata_patches(self) @@ -68,7 +75,7 @@ def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): - if self._settings_build.os == "Windows" and not is_msvc(self): + if self._settings_build.os == "Windows" and not self._use_msbuild: self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") @@ -77,7 +84,7 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): - if is_msvc(self): + if self._use_msbuild: tc = MSBuildToolchain(self) tc.configuration = self._effective_msbuild_type tc.generate() @@ -124,16 +131,24 @@ def _build_msvc(self): "", f"", ) + + if self.settings.arch == "armv8": + replace_in_file(self, vcxproj_file, "x64", "ARM64") + + solution_file = os.path.join(build_script_folder, "xz_win.sln") + if self.settings.arch == "armv8": + replace_in_file(self, solution_file, "x64", "ARM64") + #============================== msbuild = MSBuild(self) msbuild.build_type = self._effective_msbuild_type msbuild.platform = "Win32" if self.settings.arch == "x86" else msbuild.platform - msbuild.build(os.path.join(build_script_folder, "xz_win.sln"), targets=[self._msbuild_target]) + msbuild.build(os.path.join(build_script_folder, solution_file), targets=[self._msbuild_target]) def build(self): apply_conandata_patches(self) - if is_msvc(self): + if self._use_msbuild: self._build_msvc() else: autotools = Autotools(self) @@ -142,7 +157,7 @@ def build(self): def package(self): copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - if is_msvc(self): + if self._use_msbuild: inc_dir = os.path.join(self.source_folder, "src", "liblzma", "api") copy(self, "*.h", src=inc_dir, dst=os.path.join(self.package_folder, "include")) output_dir = os.path.join(self.source_folder, "windows") diff --git a/recipes/yaclib/all/test_v1_package/CMakeLists.txt b/recipes/yaclib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/yaclib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/yaclib/all/test_v1_package/conanfile.py b/recipes/yaclib/all/test_v1_package/conanfile.py deleted file mode 100644 index 22642ac137bfa..0000000000000 --- a/recipes/yaclib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +0,0 @@ -from conans import ConanFile, CMake, tools -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 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/test_v1_package/CMakeLists.txt b/recipes/yajl/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/yajl/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/yajl/all/test_v1_package/conanfile.py b/recipes/yajl/all/test_v1_package/conanfile.py deleted file mode 100644 index c492184eec19c..0000000000000 --- a/recipes/yajl/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -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/yaml-cpp/all/conanfile.py b/recipes/yaml-cpp/all/conanfile.py index 29c95c5649acc..25f5172c56211 100644 --- a/recipes/yaml-cpp/all/conanfile.py +++ b/recipes/yaml-cpp/all/conanfile.py @@ -2,13 +2,12 @@ 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, collect_libs, copy, export_conandata_patches, get, rmdir, save +from conan.tools.files import apply_conandata_patches, collect_libs, 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 textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class YamlCppConan(ConanFile): @@ -61,6 +60,8 @@ def generate(self): tc.variables["YAML_CPP_BUILD_TOOLS"] = False tc.variables["YAML_CPP_INSTALL"] = True tc.variables["YAML_BUILD_SHARED_LIBS"] = self.options.shared + if Version(self.version) <= "0.8.0": # pylint: disable=conan-condition-evals-to-constant + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support if is_msvc(self): tc.variables["YAML_MSVC_SHARED_RT"] = not is_msvc_static_runtime(self) tc.preprocessor_definitions["_NOEXCEPT"] = "noexcept" @@ -81,27 +82,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) 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( - os.path.join(self.package_folder, self._module_file_rel_path), - {"yaml-cpp": "yaml-cpp::yaml-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", "yaml-cpp") self.cpp_info.set_property("cmake_target_name", "yaml-cpp::yaml-cpp") @@ -118,7 +98,3 @@ def package_info(self): 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] - self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/yandex-ozo/all/test_v1_package/CMakeLists.txt b/recipes/yandex-ozo/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/yandex-ozo/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index a614ddb69f634..0000000000000 --- a/recipes/yandex-ozo/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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/yas/all/test_v1_package/CMakeLists.txt b/recipes/yas/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/yas/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 7e2dfe859bb27..0000000000000 --- a/recipes/yas/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", "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/yasm/all/test_v1_package/conanfile.py b/recipes/yasm/all/test_v1_package/conanfile.py deleted file mode 100644 index 5992797490cc6..0000000000000 --- a/recipes/yasm/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -from conans import ConanFile -from conan.tools.build import cross_building - - -class TestPackageV1Conan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - - def test(self): - if not cross_building(self): - self.run("yasm --help", run_environment=True) diff --git a/recipes/ydcpp-tcpcat/all/conandata.yml b/recipes/ydcpp-tcpcat/all/conandata.yml new file mode 100644 index 0000000000000..178fbec83214a --- /dev/null +++ b/recipes/ydcpp-tcpcat/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.0.4": + url: "https://github.com/ydcpp/tcpcat/archive/refs/tags/1.0.4.tar.gz" + sha256: "3413e74eab0a1bf7927b747e393b1931e8a516ee769642ce89c558a93e00e38b" + "1.0.5": + url: "https://github.com/ydcpp/tcpcat/archive/refs/tags/1.0.5.tar.gz" + sha256: "67772299f0922bff79462fd7a9cabf6fc39f9577b28f0b3137eb367ede641814" diff --git a/recipes/ydcpp-tcpcat/all/conanfile.py b/recipes/ydcpp-tcpcat/all/conanfile.py new file mode 100644 index 0000000000000..ff79b54fa821b --- /dev/null +++ b/recipes/ydcpp-tcpcat/all/conanfile.py @@ -0,0 +1,95 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.microsoft import is_msvc +from conan.tools.files import copy, get +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +import os + + +class TcpcatConan(ConanFile): + name = "ydcpp-tcpcat" + + # Optional metadata + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ydcpp/tcpcat" + description = "Simple C++ TCP Server and Client library." + topics = ("network", "tcp", "tcp-server", "tcp-client") + + # Binary configuration + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + 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": "12" + } + + 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 validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + # Upstream meant to support Windows Shared builds, but they don't currently export any symbols + # Disable for now until fixed. As this is an upstream issue they want fixed, we don't set + # package_type = "static-library" in the configure() method so that users have a clear message error for now + if is_msvc(self) and self.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} does not currently support Windows shared builds due to an upstream issue") + + 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("asio/1.30.2", transitive_headers = True) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + 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", 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")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ydcpp-tcpcat"] + self.cpp_info.set_property("cmake_target_name", "ydcpp-tcpcat") + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.append("m") diff --git a/recipes/ydcpp-tcpcat/all/test_package/CMakeLists.txt b/recipes/ydcpp-tcpcat/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0be8339e35258 --- /dev/null +++ b/recipes/ydcpp-tcpcat/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +add_executable(test_package test_package.cpp) + +find_package(ydcpp-tcpcat CONFIG REQUIRED) +target_link_libraries(test_package ydcpp-tcpcat) +target_compile_features(test_package PRIVATE cxx_std_17) diff --git a/recipes/ydcpp-tcpcat/all/test_package/conanfile.py b/recipes/ydcpp-tcpcat/all/test_package/conanfile.py new file mode 100644 index 0000000000000..806fd5ae2a792 --- /dev/null +++ b/recipes/ydcpp-tcpcat/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 tcpcatTestConan(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 can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/ydcpp-tcpcat/all/test_package/test_package.cpp b/recipes/ydcpp-tcpcat/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aa337b33b0be6 --- /dev/null +++ b/recipes/ydcpp-tcpcat/all/test_package/test_package.cpp @@ -0,0 +1,11 @@ +#include + +#include +#include + +int main() +{ + tcpcat::TcpSession session(nullptr, nullptr, 0); + std::cout << "session id: " << session.GetId() << std::endl; + return 0; +} diff --git a/recipes/ydcpp-tcpcat/config.yml b/recipes/ydcpp-tcpcat/config.yml new file mode 100644 index 0000000000000..cba23d63f022c --- /dev/null +++ b/recipes/ydcpp-tcpcat/config.yml @@ -0,0 +1,5 @@ +versions: + "1.0.4": + folder: all + "1.0.5": + folder: all diff --git a/recipes/yder/all/conandata.yml b/recipes/yder/all/conandata.yml index f6c79182d9b12..bda9472f3c267 100644 --- a/recipes/yder/all/conandata.yml +++ b/recipes/yder/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.4.20": + url: "https://github.com/babelouest/yder/archive/refs/tags/v1.4.20.tar.gz" + sha256: "c1a7f2281514d0d0bba912b6b70f371d8c127ccfd644b8c438c9301a0fd4c5f2" "1.4.18": url: "https://github.com/babelouest/yder/archive/refs/tags/v1.4.18.tar.gz" sha256: "b69cc81f6630f66468595d151446c00c90abed058f03f82e151591b8598a7598" diff --git a/recipes/yder/all/conanfile.py b/recipes/yder/all/conanfile.py index ffe23774e69d2..397af435bb258 100644 --- a/recipes/yder/all/conanfile.py +++ b/recipes/yder/all/conanfile.py @@ -42,7 +42,7 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") def requirements(self): - self.requires("orcania/2.3.1") + self.requires("orcania/2.3.3") if self.options.get_safe("with_libsystemd"): self.requires("libsystemd/253.10") diff --git a/recipes/yder/all/test_package/CMakeLists.txt b/recipes/yder/all/test_package/CMakeLists.txt index 604a54d72e91e..dc38c79a0a6d1 100644 --- a/recipes/yder/all/test_package/CMakeLists.txt +++ b/recipes/yder/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(Yder REQUIRED CONFIG) diff --git a/recipes/yder/all/test_v1_package/CMakeLists.txt b/recipes/yder/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 376a5ed06c20a..0000000000000 --- a/recipes/yder/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -find_package(Yder REQUIRED CONFIG) - -option(YDER_SHARED "Yder is built as a shared library") - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -if(YDER_SHARED) - target_link_libraries(${PROJECT_NAME} PRIVATE Yder::Yder) -else() - target_link_libraries(${PROJECT_NAME} PRIVATE Yder::Yder-static) -endif() diff --git a/recipes/yder/all/test_v1_package/conanfile.py b/recipes/yder/all/test_v1_package/conanfile.py deleted file mode 100644 index af01824ff624e..0000000000000 --- a/recipes/yder/all/test_v1_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.definitions["YDER_SHARED"] = self.options["yder"].shared - 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/yder/config.yml b/recipes/yder/config.yml index 76bddfaab892d..5e84389f49d3a 100644 --- a/recipes/yder/config.yml +++ b/recipes/yder/config.yml @@ -1,3 +1,5 @@ versions: + "1.4.20": + folder: all "1.4.18": folder: all diff --git a/recipes/yoga/all/conandata.yml b/recipes/yoga/all/conandata.yml index 17011be7f593d..315123bebf220 100644 --- a/recipes/yoga/all/conandata.yml +++ b/recipes/yoga/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "3.2.0": + url: "https://github.com/facebook/yoga/archive/refs/tags/v3.2.0.tar.gz" + sha256: "a963392c6c120a35f097b5b793d2b9b6684b94443ff873b0e521649a69a0b607" + "3.1.0": + url: "https://github.com/facebook/yoga/archive/refs/tags/v3.1.0.tar.gz" + sha256: "06ff9e6df9b2388a0c6ef8db55ba9bc2ae75e716e967cd12cf18785f6379159e" + "3.0.4": + url: "https://github.com/facebook/yoga/archive/refs/tags/v3.0.4.tar.gz" + sha256: "ef3ce5106eed03ab2e40dcfe5b868936a647c5f02b7ffd89ffaa5882dca3ef7f" + "3.0.2": + url: "https://github.com/facebook/yoga/archive/refs/tags/v3.0.2.tar.gz" + sha256: "73a81c51d9ceb5b95cd3abcafeb4c840041801d59f5048dacce91fbaab0cc6f9" "2.0.1": url: "https://github.com/facebook/yoga/archive/refs/tags/v2.0.1.tar.gz" sha256: "4c80663b557027cdaa6a836cc087d735bb149b8ff27cbe8442fc5e09cec5ed92" @@ -6,6 +18,22 @@ sources: url: "https://github.com/facebook/yoga/archive/refs/tags/v2.0.0.tar.gz" sha256: "29eaf05191dd857f76b6db97c77cce66db3c0067c88bd5e052909386ea66b8c5" patches: + "3.2.0": + - patch_file: "patches/0001-delete-tests.patch" + patch_description: "Delete test targets from cmake" + patch_type: "conan" + "3.1.0": + - patch_file: "patches/0001-delete-tests.patch" + patch_description: "Delete test targets from cmake" + patch_type: "conan" + "3.0.4": + - patch_file: "patches/0001-delete-tests.patch" + patch_description: "Delete test targets from cmake" + patch_type: "conan" + "3.0.2": + - patch_file: "patches/0001-delete-tests.patch" + patch_description: "Delete test targets from cmake" + patch_type: "conan" "2.0.1": - patch_file: "patches/0001-delete-tests.patch" patch_description: "Delete test targets from cmake" diff --git a/recipes/yoga/all/conanfile.py b/recipes/yoga/all/conanfile.py index e8249b9860f59..f2a7303076d24 100644 --- a/recipes/yoga/all/conanfile.py +++ b/recipes/yoga/all/conanfile.py @@ -26,15 +26,22 @@ class YogaConan(ConanFile): @property def _min_cppstd(self): - return 14 + return 20 if Version(self.version) >= "3.0.0" else 14 @property def _compilers_minimum_version(self): - return { - "gcc": "5", - "clang": "3.4", - "apple-clang": "10", - } + if Version(self.version) >= "3.0.0": + return { # C++20 with bit_cast + "gcc": "11", + "clang": "14", + "apple-clang": "14" + } + else: + return { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + } def export_sources(self): export_conandata_patches(self) @@ -49,7 +56,7 @@ def layout(self): def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) - check_min_vs(self, 191) + check_min_vs(self, 192 if Version(self.version) >= "3.0.0" else 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: diff --git a/recipes/yoga/all/patches/0001-delete-tests.patch b/recipes/yoga/all/patches/0001-delete-tests.patch index d3a76211634ca..bae612fca66b5 100644 --- a/recipes/yoga/all/patches/0001-delete-tests.patch +++ b/recipes/yoga/all/patches/0001-delete-tests.patch @@ -2,11 +2,8 @@ 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) +@@ -10,4 +10,3 @@ 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/config.yml b/recipes/yoga/config.yml index 184166496d26e..df573d0585f20 100644 --- a/recipes/yoga/config.yml +++ b/recipes/yoga/config.yml @@ -1,4 +1,12 @@ versions: + "3.2.0": + folder: all + "3.1.0": + folder: all + "3.0.4": + folder: all + "3.0.2": + folder: all "2.0.1": folder: all "2.0.0": diff --git a/recipes/yomm2/all/conandata.yml b/recipes/yomm2/all/conandata.yml new file mode 100644 index 0000000000000..b863f98db9295 --- /dev/null +++ b/recipes/yomm2/all/conandata.yml @@ -0,0 +1,10 @@ +sources: + "1.6.0": + url: "https://github.com/jll63/yomm2/archive/refs/tags/v1.6.0.tar.gz" + sha256: "5d617704755637b863a90129d09b8c3a1d3a06e3be809693c07575e0289cb508" + "1.5.2": + url: "https://github.com/jll63/yomm2/archive/refs/tags/v1.5.2.tar.gz" + sha256: "12f3f735b4870606199b889a242ebfed84cf0cd392b04a1c32db11291de684be" + "1.5.1": + url: "https://github.com/jll63/yomm2/archive/refs/tags/v1.5.1.tar.gz" + sha256: "323abba27a356555cc3ead3e3e950746ab43f90d97ad21950f2ba3afaf565ecc" diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py new file mode 100644 index 0000000000000..3f5eaff0f2be7 --- /dev/null +++ b/recipes/yomm2/all/conanfile.py @@ -0,0 +1,121 @@ +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, CMakeDeps +from conan.tools.files import get, rm, rmdir, copy, replace_in_file +from conan.tools.scm import Version + +required_conan_version = ">=1.54.0" + + +class yomm2Recipe(ConanFile): + name = "yomm2" + package_type = "header-library" + # Optional metadata + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jll63/yomm2" + description = "Fast, orthogonal, open multi-methods. Solve the Expression Problem in C++17" + topics = ("multi-methods", "multiple-dispatch", "open-methods", "shared-library", + "header-only", "polymorphism", "expression-problem", "c++17") + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = { + "header_only": [True, False], + } + default_options = { + "header_only": True + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "5", + "apple-clang": "13", + "msvc": "192" + } + + def configure(self): + if not bool(self.options.header_only): + self.package_type = "shared-library" + + 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 == "apple-clang" and not bool(self.options.header_only): + raise ConanInvalidConfiguration( + f"{self.ref} dynamic library builds are not supported on MacOS." + ) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.21 <4]") + + def requirements(self): + # Upstream requires Boost 1.74 + # Using more modern Boost version to avoid issues like the one commented here: + # - https://github.com/conan-io/conan/issues/15977#issuecomment-2098003085 + self.requires("boost/1.85.0", transitive_headers=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): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.variables["YOMM2_ENABLE_EXAMPLES"] = "OFF" + tc.variables["YOMM2_ENABLE_TESTS"] = "OFF" + tc.variables["YOMM2_SHARED"] = not bool(self.options.header_only) + tc.generate() + + def _patch_sources(self): + if Version(self.version) <= "1.5.1": + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "add_subdirectory(docs.in)", "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package_id(self): + # if yomm2 is built as static, it behaves as a header-only one + if self.info.options.header_only: + self.info.clear() + + def package(self): + copy(self, "LICENSE", 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")) + if self.options.header_only: + rmdir(self, os.path.join(self.package_folder, "lib")) + else: + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "YOMM2") + self.cpp_info.set_property("cmake_target_name", "YOMM2::yomm2") + if self.options.header_only: + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + else: # shared-library + self.cpp_info.libs = ["yomm2"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/yomm2/all/test_package/CMakeLists.txt b/recipes/yomm2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2686aaf2077a9 --- /dev/null +++ b/recipes/yomm2/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(YOMM2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE YOMM2::yomm2 ${CMAKE_THREAD_LIBS_INIT}) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/yomm2/all/test_package/conanfile.py b/recipes/yomm2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..189c09687bde3 --- /dev/null +++ b/recipes/yomm2/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 yomm2TestConan(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 can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/yomm2/all/test_package/test_package.cpp b/recipes/yomm2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..ea5d7313d5408 --- /dev/null +++ b/recipes/yomm2/all/test_package/test_package.cpp @@ -0,0 +1,53 @@ +// Copyright (c) 2018-2024 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include + +class Animal { + public: + virtual ~Animal() { + } +}; + +class Dog : public Animal {}; +class Cat : public Animal {}; + +register_classes(Animal, Dog, Cat); + +declare_method( + void, meet, (virtual_, virtual_, std::ostream&)); + +define_method(void, meet, (Animal&, Animal&, std::ostream& os)) { + os << "ignore"; +} + +// Add definitions for specific pairs of animals. +define_method(void, meet, (Dog& dog1, Dog& dog2, std::ostream& os)) { + os << "wag tail"; +} + +define_method(void, meet, (Dog& dog, Cat& cat, std::ostream& os)) { + os << "chase"; +} + +define_method(void, meet, (Cat& cat, Dog& dog, std::ostream& os)) { + os << "run"; +} + +int main() { + #ifndef NDEBUG + yorel::yomm2::default_policy::trace_enabled = true; + #endif + + yorel::yomm2::update(); + Animal&& snoopy = Dog(); + Animal&& felix = Cat(); + std::ostringstream os; + meet(snoopy, felix, os); // chase + + return os.str() == "chase" ? 0 : 1; +} diff --git a/recipes/yomm2/config.yml b/recipes/yomm2/config.yml new file mode 100644 index 0000000000000..46b176795aa94 --- /dev/null +++ b/recipes/yomm2/config.yml @@ -0,0 +1,7 @@ +versions: + "1.6.0": + folder: all + "1.5.2": + folder: all + "1.5.1": + folder: all diff --git a/recipes/yyjson/all/conandata.yml b/recipes/yyjson/all/conandata.yml index ad21b483cb840..bd4149d822688 100644 --- a/recipes/yyjson/all/conandata.yml +++ b/recipes/yyjson/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.10.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.10.0.tar.gz" + sha256: "0d901cb2c45c5586e3f3a4245e58c2252d6b24bf4b402723f6179523d389b165" + "0.9.0": + url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.9.0.tar.gz" + sha256: "59902bea55585d870fd7681eabe6091fbfd1a8776d1950f859d2dbbd510c74bd" "0.8.0": url: "https://github.com/ibireme/yyjson/archive/refs/tags/0.8.0.tar.gz" sha256: "b2e39ac4c65f9050820c6779e6f7dd3c0d3fed9c6667f91caec0badbedce00f3" diff --git a/recipes/yyjson/all/conanfile.py b/recipes/yyjson/all/conanfile.py index 3574d26b2c7d5..735dd7c15a5b0 100644 --- a/recipes/yyjson/all/conanfile.py +++ b/recipes/yyjson/all/conanfile.py @@ -61,6 +61,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.set_property("cmake_file_name", "yyjson") @@ -68,3 +69,6 @@ def package_info(self): self.cpp_info.libs = ["yyjson"] if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines.append("YYJSON_IMPORTS") + + if Version(self.version) >= "0.9.0": + self.cpp_info.set_property("pkg_config_name", "yyjson") diff --git a/recipes/yyjson/all/test_package/CMakeLists.txt b/recipes/yyjson/all/test_package/CMakeLists.txt index 147497b6b55a6..3b72a588b394c 100644 --- a/recipes/yyjson/all/test_package/CMakeLists.txt +++ b/recipes/yyjson/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(yyjson REQUIRED CONFIG) diff --git a/recipes/yyjson/all/test_v1_package/CMakeLists.txt b/recipes/yyjson/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/yyjson/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/yyjson/all/test_v1_package/conanfile.py b/recipes/yyjson/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/yyjson/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_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/yyjson/config.yml b/recipes/yyjson/config.yml index f84f2efec202b..b53dac867c374 100644 --- a/recipes/yyjson/config.yml +++ b/recipes/yyjson/config.yml @@ -1,4 +1,8 @@ versions: + "0.10.0": + folder: all + "0.9.0": + folder: all "0.8.0": folder: all "0.7.0": 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 8720c1e15bb24..3b0eba58b7a8c 100644 --- a/recipes/z3/all/conandata.yml +++ b/recipes/z3/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "4.14.1": + url: "https://github.com/Z3Prover/z3/archive/z3-4.14.1.tar.gz" + sha256: "81a02c2c64c64d6c3df233f59186b95627990ada0c4c2fc901c9c25a7072672a" + "4.13.0": + url: "https://github.com/Z3Prover/z3/archive/z3-4.13.0.tar.gz" + sha256: "01bcc61c8362e37bb89fd2430f7e3385e86df7915019bd2ce45de9d9bd934502" + "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" diff --git a/recipes/z3/all/conanfile.py b/recipes/z3/all/conanfile.py index b8fb69514925d..7d2773ee0b9b3 100644 --- a/recipes/z3/all/conanfile.py +++ b/recipes/z3/all/conanfile.py @@ -1,13 +1,13 @@ +import os + from conan import ConanFile -from conan.tools.microsoft import check_min_vs -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import export_conandata_patches, apply_conandata_patches, replace_in_file, get, copy, rmdir, save 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 -from conan.errors import ConanInvalidConfiguration -import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2" class Z3Conan(ConanFile): @@ -18,6 +18,7 @@ class Z3Conan(ConanFile): homepage = "https://github.com/Z3Prover/z3" license = "MIT" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -32,51 +33,23 @@ class Z3Conan(ConanFile): "use_gmp": False } - @property - def _min_cppstd(self): - return "17" - - @property - def _compilers_minimum_version(self): - # Compiling z3 with GCC 7 results in a segfault - return { - "17": { - "gcc": "8", - "clang": "5", - "apple-clang": "9.1", - }, - }.get(self._min_cppstd, {}) - - 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") + implements = ["auto_shared_fpic"] def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if self.options.use_gmp: - self.requires("gmp/6.2.1") + self.requires("gmp/6.3.0") def validate(self): - # Z3 requires C++17, and it is recommended to use VS2019 or later - check_min_vs(self, "192") + check_min_cppstd(self, 11) - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_cppstd) + def validate_build(self): + check_min_cppstd(self, 17 if Version(self.version) < "4.14" else 20) - 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) @@ -96,20 +69,19 @@ def generate(self): stdlib = f" -stdlib={self.settings.compiler.libcxx}".rstrip("1") tc.variables["CMAKE_CXX_FLAGS"] = tc.variables.get("CMAKE_CXX_FLAGS", "") + stdlib tc.generate() - tc = CMakeDeps(self) + + deps = CMakeDeps(self) # Override the target name of the GMP library provided by Conan Center - if self.options.use_gmp: - tc.set_property("gmp", "cmake_target_name", "GMP::GMP") - tc.generate() + deps.set_property("gmp", "cmake_target_name", "GMP::GMP") + deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() def package(self): - copy(self, "LICENSE.txt", src=os.path.join(self.source_folder), dst=os.path.join(self.package_folder, "licenses")) + 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")) @@ -120,18 +92,9 @@ 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"]) - # 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" - self.cpp_info.names["cmake_find_package"] = "z3" - 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"].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"]) + 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/test_package/CMakeLists.txt b/recipes/z3/all/test_package/CMakeLists.txt index 22ff0aeb773f3..5d20f146f861f 100644 --- a/recipes/z3/all/test_package/CMakeLists.txt +++ b/recipes/z3/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(Z3 REQUIRED CONFIG) diff --git a/recipes/z3/all/test_v1_package/CMakeLists.txt b/recipes/z3/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/z3/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/z3/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_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 16c46b24354e5..ce8c7d195e275 100644 --- a/recipes/z3/config.yml +++ b/recipes/z3/config.yml @@ -1,4 +1,10 @@ versions: + "4.14.1": + folder: "all" + "4.13.0": + folder: "all" + "4.12.4": + folder: "all" "4.12.2": folder: "all" "4.12.1": diff --git a/recipes/zbar/all/test_package/CMakeLists.txt b/recipes/zbar/all/test_package/CMakeLists.txt index 5f986e30b6686..bdea756aebf2e 100644 --- a/recipes/zbar/all/test_package/CMakeLists.txt +++ b/recipes/zbar/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(zbar CONFIG REQUIRED) diff --git a/recipes/zbar/all/test_v1_package/CMakeLists.txt b/recipes/zbar/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/zbar/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zbar/all/test_v1_package/conanfile.py b/recipes/zbar/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/zbar/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/zeromq/all/conanfile.py b/recipes/zeromq/all/conanfile.py index 24e21533e207e..1207f233089db 100644 --- a/recipes/zeromq/all/conanfile.py +++ b/recipes/zeromq/all/conanfile.py @@ -1,13 +1,12 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException 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, save +from conan.tools.files import apply_conandata_patches, collect_libs, 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 -import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class ZeroMQConan(ConanFile): @@ -60,7 +59,7 @@ def layout(self): def requirements(self): if self.options.encryption == "libsodium": - self.requires("libsodium/1.0.19") + self.requires("libsodium/1.0.20") if self.options.with_norm: self.requires("norm/1.5.9") @@ -93,6 +92,9 @@ def generate(self): tc.variables["POLLER"] = self.options.poller if is_msvc(self): tc.preprocessor_definitions["_NOEXCEPT"] = "noexcept" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "4.3.5": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() deps = CMakeDeps(self) deps.generate() @@ -134,27 +136,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "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), - {self._libzmq_target: f"ZeroMQ::{self._libzmq_target}"}, - ) - - 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") - @property def _libzmq_target(self): return "libzmq" if self.options.shared else "libzmq-static" @@ -177,14 +158,6 @@ def package_info(self): if self.options.with_websocket and self.settings.os != "Windows": self.cpp_info.components["libzmq"].system_libs.append("bsd") - # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "ZeroMQ" - self.cpp_info.names["cmake_find_package_multi"] = "ZeroMQ" - self.cpp_info.names["pkg_config"] = "libzmq" - self.cpp_info.components["libzmq"].names["cmake_find_package"] = self._libzmq_target - self.cpp_info.components["libzmq"].names["cmake_find_package_multi"] = self._libzmq_target - self.cpp_info.components["libzmq"].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components["libzmq"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] self.cpp_info.components["libzmq"].set_property("cmake_target_name", self._libzmq_target) if self.options.encryption == "libsodium": self.cpp_info.components["libzmq"].requires.append("libsodium::libsodium") diff --git a/recipes/zeromq/all/test_package/CMakeLists.txt b/recipes/zeromq/all/test_package/CMakeLists.txt index e02c2ff4211bd..06722199f2267 100644 --- a/recipes/zeromq/all/test_package/CMakeLists.txt +++ b/recipes/zeromq/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) option(WITH_LIBSODIUM "zeromq is built with libsodium") diff --git a/recipes/zeromq/all/test_v1_package/CMakeLists.txt b/recipes/zeromq/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/zeromq/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zeromq/all/test_v1_package/conanfile.py b/recipes/zeromq/all/test_v1_package/conanfile.py deleted file mode 100644 index 507e0ac53bc64..0000000000000 --- a/recipes/zeromq/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +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.definitions["WITH_LIBSODIUM"] = self.options["zeromq"].encryption == "libsodium" - cmake.definitions["ZEROMQ_SHARED"] = self.options["zeromq"].shared - cmake.definitions["WITH_NORM"] = self.options["zeromq"].with_norm - 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/zeus_expected/all/conandata.yml b/recipes/zeus_expected/all/conandata.yml new file mode 100644 index 0000000000000..5028bc49833f9 --- /dev/null +++ b/recipes/zeus_expected/all/conandata.yml @@ -0,0 +1,20 @@ +sources: + "1.3.0": + url: "https://github.com/zeus-cpp/expected/archive/refs/tags/v1.3.0.tar.gz" + sha256: "d45bd4a38bde787577d16983ba8efee25e8d445af711510619f7b49ef60f1e72" + "1.2.0": + url: "https://github.com/zeus-cpp/expected/archive/refs/tags/v1.2.0.tar.gz" + sha256: "460da641f212c793f46a5a8f29107c9b9540a17a91f197e2dc396dac0269a2b5" + "1.1.1": + url: "https://github.com/zeus-cpp/expected/archive/refs/tags/v1.1.1.tar.gz" + sha256: "47b411677ffb2fa0d43b308797542509ae2bdb101426cf0d4777e3c162b1d726" + "1.1.0": + url: "https://github.com/zeus-cpp/expected/archive/refs/tags/v1.1.0.tar.gz" + sha256: "a963eba43f227498da2cbb924265344209696320c75ee63a92073936bb49f7e5" + +patches: + "1.1.0": + - patch_file: "patches/0001-fix-compiler-errors-with-msvc-v142.patch" + patch_source: "https://github.com/zeus-cpp/expected/pull/7/commits/82ed513aa65a3c2c7b8f8af7c63e0b8b57637dfb" + patch_description: "Fix for MSVC v142" + patch_type: "bugfix" diff --git a/recipes/zeus_expected/all/conanfile.py b/recipes/zeus_expected/all/conanfile.py new file mode 100644 index 0000000000000..1067fa8157091 --- /dev/null +++ b/recipes/zeus_expected/all/conanfile.py @@ -0,0 +1,84 @@ +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.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, export_conandata_patches +import os + +required_conan_version = ">=1.54.0" + + +class ZeusExpectedConan(ConanFile): + name = "zeus_expected" + + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/zeus-cpp/expected" + description = "Backporting std::expected to C++17." + topics = ("cpp17", "expected") + license = "MIT" + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + + no_copy_source = True + + def export_sources(self): + export_conandata_patches(self) + + @property + def _min_cppstd(self): + return 17 + + @property + def _minimum_compilers_version(self): + return { + "gcc": "7", + "clang": "5", + "Visual Studio": "15.7", + "apple-clang": "10", + } + + 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 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 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) + + 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_target_name", "zeus::expected") + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + + def package_id(self): + self.info.clear() diff --git a/recipes/zeus_expected/all/patches/0001-fix-compiler-errors-with-msvc-v142.patch b/recipes/zeus_expected/all/patches/0001-fix-compiler-errors-with-msvc-v142.patch new file mode 100644 index 0000000000000..82856fb33c345 --- /dev/null +++ b/recipes/zeus_expected/all/patches/0001-fix-compiler-errors-with-msvc-v142.patch @@ -0,0 +1,88 @@ +From 82ed513aa65a3c2c7b8f8af7c63e0b8b57637dfb Mon Sep 17 00:00:00 2001 +From: X1aomu +Date: Fri, 19 Apr 2024 14:15:14 +0800 +Subject: [PATCH] fix: compiler errors with msvc v142 + +--- + include/zeus/expected.hpp | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/include/zeus/expected.hpp b/include/zeus/expected.hpp +index 6492953..790f870 100644 +--- a/include/zeus/expected.hpp ++++ b/include/zeus/expected.hpp +@@ -2441,7 +2441,7 @@ public: + constexpr auto and_then(F &&f) & + { + using U = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) +@@ -2453,7 +2453,7 @@ public: + constexpr auto and_then(F &&f) const & + { + using U = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) +@@ -2465,7 +2465,7 @@ public: + constexpr auto and_then(F &&f) && + { + using U = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) +@@ -2477,7 +2477,7 @@ public: + constexpr auto and_then(F &&f) const && + { + using U = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) +@@ -2490,7 +2490,7 @@ public: + constexpr auto or_else(F &&f) & + { + using G = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The value type must be the same after calling the F"); + + if (has_value()) +@@ -2502,7 +2502,7 @@ public: + constexpr auto or_else(F &&f) const & + { + using G = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The value type must be the same after calling the F"); + + if (has_value()) +@@ -2514,7 +2514,7 @@ public: + constexpr auto or_else(F &&f) && + { + using G = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The value type must be the same after calling the F"); + + if (has_value()) +@@ -2526,7 +2526,7 @@ public: + constexpr auto or_else(F &&f) const && + { + using G = expected_detail::remove_cvref_t>; +- static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); ++ static_assert(expected_detail::is_specialization_v, "G (return type of F) must be specialization of expected"); + static_assert(std::is_same_v, "The value type must be the same after calling the F"); + + if (has_value()) +-- +2.44.0.windows.1 + diff --git a/recipes/zeus_expected/all/test_package/CMakeLists.txt b/recipes/zeus_expected/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..9890dad90bccc --- /dev/null +++ b/recipes/zeus_expected/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(zeus_expected REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zeus::expected) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/zeus_expected/all/test_package/conanfile.py b/recipes/zeus_expected/all/test_package/conanfile.py new file mode 100644 index 0000000000000..d120a992c06a6 --- /dev/null +++ b/recipes/zeus_expected/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 = "CMakeToolchain", "CMakeDeps", "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 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/zeus_expected/all/test_package/test_package.cpp b/recipes/zeus_expected/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..1577435ab0a55 --- /dev/null +++ b/recipes/zeus_expected/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include + +zeus::expected func(int argc) +{ + if (argc > 1) + { + return {}; + } + else + { + return zeus::unexpected(1); + } +} + +int main(int argc, char** argv) +{ + return func(argc) + .and_then([] { return zeus::expected {}; }) + .transform_error([](int) { return 0; }) + .error_or(1); +} diff --git a/recipes/zeus_expected/config.yml b/recipes/zeus_expected/config.yml new file mode 100644 index 0000000000000..b41b36fe9fdb2 --- /dev/null +++ b/recipes/zeus_expected/config.yml @@ -0,0 +1,9 @@ +versions: + "1.3.0": + folder: all + "1.2.0": + folder: all + "1.1.1": + folder: all + "1.1.0": + folder: all 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/all/test_package/CMakeLists.txt b/recipes/zfp/all/test_package/CMakeLists.txt index d49c569f327a3..08cfefcf6f8ab 100644 --- a/recipes/zfp/all/test_package/CMakeLists.txt +++ b/recipes/zfp/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(zfp REQUIRED CONFIG) diff --git a/recipes/zfp/all/test_v1_package/CMakeLists.txt b/recipes/zfp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/zfp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zfp/all/test_v1_package/conanfile.py b/recipes/zfp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/zfp/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_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/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/test_package/CMakeLists.txt b/recipes/zimg/all/test_package/CMakeLists.txt index 0b744ea607a1f..37350adb2f553 100644 --- a/recipes/zimg/all/test_package/CMakeLists.txt +++ b/recipes/zimg/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(zimg REQUIRED CONFIG) diff --git a/recipes/zimg/all/test_v1_package/CMakeLists.txt b/recipes/zimg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/zimg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zimg/all/test_v1_package/conanfile.py b/recipes/zimg/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/zimg/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_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/zint/all/conanfile.py b/recipes/zint/all/conanfile.py index f9c54ff2b86cf..c582bdfe4e8e1 100644 --- a/recipes/zint/all/conanfile.py +++ b/recipes/zint/all/conanfile.py @@ -49,7 +49,7 @@ def layout(self): def requirements(self): if self.options.with_libpng: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") self.requires("zlib/[>=1.2.11 <2]") if self.options.with_qt: self.requires("qt/5.15.10") diff --git a/recipes/zint/all/test_package/CMakeLists.txt b/recipes/zint/all/test_package/CMakeLists.txt index d4ac6daa22c07..0425cc0d1da92 100644 --- a/recipes/zint/all/test_package/CMakeLists.txt +++ b/recipes/zint/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) enable_testing() diff --git a/recipes/zlib-ng/all/conandata.yml b/recipes/zlib-ng/all/conandata.yml index 7e85151017f0d..c9ae96a3063ce 100644 --- a/recipes/zlib-ng/all/conandata.yml +++ b/recipes/zlib-ng/all/conandata.yml @@ -1,4 +1,22 @@ sources: + "2.2.4": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.4.tar.gz" + sha256: "a73343c3093e5cdc50d9377997c3815b878fd110bf6511c2c7759f2afb90f5a3" + "2.2.3": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.3.tar.gz" + sha256: "f2fb245c35082fe9ea7a22b332730f63cf1d42f04d84fe48294207d033cba4dd" + "2.2.2": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.2.tar.gz" + sha256: "fcb41dd59a3f17002aeb1bb21f04696c9b721404890bb945c5ab39d2cb69654c" + "2.2.1": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.1.tar.gz" + sha256: "ec6a76169d4214e2e8b737e0850ba4acb806c69eeace6240ed4481b9f5c57cdf" + "2.1.7": + url: "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.7.tar.gz" + sha256: "59e68f67cbb16999842daeb517cdd86fc25b177b4affd335cd72b76ddc2a46d8" + "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" diff --git a/recipes/zlib-ng/all/conanfile.py b/recipes/zlib-ng/all/conanfile.py index 853a0a0f6a309..06541ac76f920 100644 --- a/recipes/zlib-ng/all/conanfile.py +++ b/recipes/zlib-ng/all/conanfile.py @@ -13,10 +13,10 @@ class ZlibNgConan(ConanFile): name = "zlib-ng" description = "zlib data compression library for the next generation systems" - topics = ("zlib", "compression") license ="Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/zlib-ng/zlib-ng/" + topics = ("zlib", "compression") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -28,6 +28,7 @@ class ZlibNgConan(ConanFile): "with_new_strategies": [True, False], "with_native_instructions": [True, False], "with_reduced_mem": [True, False], + "with_runtime_cpu_detection": [True, False], } default_options = { "shared": False, @@ -38,19 +39,28 @@ class ZlibNgConan(ConanFile): "with_new_strategies": True, "with_native_instructions": False, "with_reduced_mem": False, + "with_runtime_cpu_detection": True, } + + @property + def _is_windows(self): + return self.settings.os in ["Windows", "WindowsStore"] def config_options(self): - if self.settings.os == "Windows": + if self._is_windows: del self.options.fPIC if Version(self.version) < "2.1.0": del self.options.with_reduced_mem + if Version(self.version) < "2.2.1": + del self.options.with_runtime_cpu_detection def configure(self): if self.options.shared: self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if self.options.zlib_compat: + self.provides = ["zlib"] def layout(self): cmake_layout(self, src_folder="src") @@ -74,6 +84,8 @@ def generate(self): 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 + if Version(self.version) >= "2.2.1": + tc.variables["WITH_RUNTIME_CPU_DETECTION"] = self.options.with_runtime_cpu_detection tc.generate() def build(self): @@ -87,6 +99,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")) # upstream CMakeLists intentionally hardcodes install_name with full # install path (to match autootools behavior), instead of @rpath fix_apple_shared_install_name(self) @@ -95,7 +108,7 @@ def package_info(self): #FIXME: CMake targets are https://github.com/zlib-ng/zlib-ng/blob/29fd4672a2279a0368be936d7cd44d013d009fae/CMakeLists.txt#L914 suffix = "" if self.options.zlib_compat else "-ng" self.cpp_info.set_property("pkg_config_name", f"zlib{suffix}") - if self.settings.os == "Windows": + if self._is_windows: # The library name of zlib-ng is complicated in zlib-ng>=2.0.4: # https://github.com/zlib-ng/zlib-ng/blob/2.0.4/CMakeLists.txt#L994-L1016 base = "zlib" if is_msvc(self) or Version(self.version) < "2.0.4" or self.options.shared else "z" @@ -106,6 +119,12 @@ def package_info(self): self.cpp_info.libs = [f"z{suffix}"] if self.options.zlib_compat: self.cpp_info.defines.append("ZLIB_COMPAT") + #copied from zlib + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "ZLIB") + self.cpp_info.set_property("cmake_target_name", "ZLIB::ZLIB") + self.cpp_info.names["cmake_find_package"] = "ZLIB" + self.cpp_info.names["cmake_find_package_multi"] = "ZLIB" if self.options.with_gzfileop: self.cpp_info.defines.append("WITH_GZFILEOP") if not self.options.with_new_strategies: diff --git a/recipes/zlib-ng/all/test_package/CMakeLists.txt b/recipes/zlib-ng/all/test_package/CMakeLists.txt index 1afe7de5d08fc..f10e632412804 100644 --- a/recipes/zlib-ng/all/test_package/CMakeLists.txt +++ b/recipes/zlib-ng/all/test_package/CMakeLists.txt @@ -1,8 +1,14 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES C) -find_package(zlib-ng REQUIRED CONFIG) +if (ZLIB_COMPAT) + set(zlib_name ZLIB) +else() + set(zlib_name zlib-ng) +endif() + +find_package(${zlib_name} REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE zlib-ng::zlib-ng) +target_link_libraries(${PROJECT_NAME} PRIVATE ${zlib_name}::${zlib_name}) target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/zlib-ng/all/test_package/conanfile.py b/recipes/zlib-ng/all/test_package/conanfile.py index 0f34761d1525c..eabf8e03bfd74 100644 --- a/recipes/zlib-ng/all/test_package/conanfile.py +++ b/recipes/zlib-ng/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 = "CMakeDeps", "CMakeToolchain", "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["ZLIB_COMPAT"] = bool(self.dependencies["zlib-ng"].options.zlib_compat) + tc.generate() + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/zlib-ng/all/test_v1_package/CMakeLists.txt b/recipes/zlib-ng/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/zlib-ng/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zlib-ng/all/test_v1_package/conanfile.py b/recipes/zlib-ng/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/zlib-ng/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_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/zlib-ng/config.yml b/recipes/zlib-ng/config.yml index b48f6e22e71f3..d05569f9f7423 100644 --- a/recipes/zlib-ng/config.yml +++ b/recipes/zlib-ng/config.yml @@ -1,4 +1,16 @@ versions: + "2.2.4": + folder: all + "2.2.3": + folder: all + "2.2.2": + folder: all + "2.2.1": + folder: all + "2.1.7": + folder: all + "2.1.6": + folder: all "2.1.5": folder: all "2.1.4": diff --git a/recipes/zlib/all/conandata.yml b/recipes/zlib/all/conandata.yml index bcebfb9b13b6d..e069fd42a135c 100644 --- a/recipes/zlib/all/conandata.yml +++ b/recipes/zlib/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "1.3.1": + url: + - "https://zlib.net/fossils/zlib-1.3.1.tar.gz" + - "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz" + sha256: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23" "1.3": url: - "https://zlib.net/fossils/zlib-1.3.tar.gz" @@ -16,6 +21,10 @@ sources: url: "https://zlib.net/fossils/zlib-1.2.11.tar.gz" sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" patches: + "1.3.1": + - patch_file: "patches/1.3.1/0001-fix-cmake.patch" + patch_description: "separate static/shared builds, disable debug suffix" + patch_type: "conan" "1.3": - patch_file: "patches/1.3/0001-fix-cmake.patch" patch_description: "separate static/shared builds, disable debug suffix, disable building examples" diff --git a/recipes/zlib/all/conanfile.py b/recipes/zlib/all/conanfile.py index 716ee2007ab06..717b2e9d8aa9e 100644 --- a/recipes/zlib/all/conanfile.py +++ b/recipes/zlib/all/conanfile.py @@ -27,10 +27,6 @@ class ZlibConan(ConanFile): "fPIC": True, } - @property - def _is_mingw(self): - return self.settings.os == "Windows" and self.settings.compiler == "gcc" - def export_sources(self): export_conandata_patches(self) @@ -60,6 +56,7 @@ def generate(self): # Correct for misuse of "${CMAKE_INSTALL_PREFIX}/" in CMakeLists.txt tc.variables["INSTALL_LIB_DIR"] = "lib" tc.variables["INSTALL_INC_DIR"] = "include" + tc.variables["ZLIB_BUILD_EXAMPLES"] = False tc.generate() def _patch_sources(self): @@ -99,7 +96,10 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "ZLIB") self.cpp_info.set_property("cmake_target_name", "ZLIB::ZLIB") self.cpp_info.set_property("pkg_config_name", "zlib") - if self.settings.os == "Windows" and not self._is_mingw: + + if self.settings.os == "Windows" and self.settings.get_safe("compiler.runtime"): + # The recipe patches the CMakeLists.txt to generate different filenames when CMake + # detects MINGW (clang, gcc with compiler.runtime undefined and compiler.libcxx defined) libname = "zdll" if self.options.shared else "zlib" else: libname = "z" diff --git a/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch b/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch index a0748ec590d90..bf8b94cbe1bf8 100644 --- a/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch +++ b/recipes/zlib/all/patches/1.2.13/0001-Fix-cmake.patch @@ -13,7 +13,7 @@ index b412dc7..a5284ed 100644 +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.4.4) -+cmake_minimum_required(VERSION 3.0) # it's important to have https://cmake.org/cmake/help/latest/policy/CMP0042.html#policy:CMP0042 ++cmake_minimum_required(VERSION 3.5) # for CMP0042 and CMake 4 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) project(zlib C) diff --git a/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch b/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch index f99f0b5219682..503d83d68af11 100644 --- a/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch +++ b/recipes/zlib/all/patches/1.2.x/0001-fix-cmake.patch @@ -2,7 +2,7 @@ +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.4.4) -+cmake_minimum_required(VERSION 3.0) # it's important to have https://cmake.org/cmake/help/latest/policy/CMP0042.html#policy:CMP0042 ++cmake_minimum_required(VERSION 3.5) # for CMP0042 and CMake 4 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) project(zlib C) diff --git a/recipes/zlib/all/patches/1.3.1/0001-fix-cmake.patch b/recipes/zlib/all/patches/1.3.1/0001-fix-cmake.patch new file mode 100644 index 0000000000000..036af67bc9b38 --- /dev/null +++ b/recipes/zlib/all/patches/1.3.1/0001-fix-cmake.patch @@ -0,0 +1,81 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 15ceebe..2f08574 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,7 +59,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}) +@@ -122,7 +121,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. + ) +@@ -133,7 +132,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) +@@ -147,14 +146,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}) + target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + 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 +@@ -167,19 +168,25 @@ 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 AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX)) + 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}" ) 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 deleted file mode 100644 index d299f4962fa59..0000000000000 --- a/recipes/zlib/all/patches/1.3/0002-gzguts-xcode12-compile-fix.patch +++ /dev/null @@ -1,15 +0,0 @@ -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/all/test_package/CMakeLists.txt b/recipes/zlib/all/test_package/CMakeLists.txt index 6369d1f250672..22791d699ea05 100644 --- a/recipes/zlib/all/test_package/CMakeLists.txt +++ b/recipes/zlib/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(ZLIB REQUIRED) diff --git a/recipes/zlib/all/test_package/test_package.c b/recipes/zlib/all/test_package/test_package.c index 4c3da30d46136..41124efa7db0d 100644 --- a/recipes/zlib/all/test_package/test_package.c +++ b/recipes/zlib/all/test_package/test_package.c @@ -1,30 +1,9 @@ -#include #include -#include +#include #include int main(void) { - char buffer_in [32] = {"Conan Package Manager"}; - char buffer_out [32] = {0}; - - z_stream defstream; - defstream.zalloc = Z_NULL; - defstream.zfree = Z_NULL; - defstream.opaque = Z_NULL; - defstream.avail_in = (uInt) strlen(buffer_in); - defstream.next_in = (Bytef *) buffer_in; - defstream.avail_out = (uInt) sizeof(buffer_out); - defstream.next_out = (Bytef *) buffer_out; - - deflateInit(&defstream, Z_BEST_COMPRESSION); - deflate(&defstream, Z_FINISH); - deflateEnd(&defstream); - - printf("Compressed size is: %lu\n", strlen(buffer_in)); - printf("Compressed string is: %s\n", buffer_in); - printf("Compressed size is: %lu\n", strlen(buffer_out)); - printf("Compressed string is: %s\n", buffer_out); printf("ZLIB VERSION: %s\n", zlibVersion()); diff --git a/recipes/zlib/all/test_v1_package/CMakeLists.txt b/recipes/zlib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index eecfa28256816..0000000000000 --- a/recipes/zlib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(ZLIB REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) diff --git a/recipes/zlib/all/test_v1_package/conanfile.py b/recipes/zlib/all/test_v1_package/conanfile.py deleted file mode 100644 index 0245c9a8028a3..0000000000000 --- a/recipes/zlib/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,16 +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): - self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/zlib/config.yml b/recipes/zlib/config.yml index 132003f7c53b5..79c9c7d4f7785 100644 --- a/recipes/zlib/config.yml +++ b/recipes/zlib/config.yml @@ -1,4 +1,6 @@ versions: + "1.3.1": + folder: all "1.3": folder: all "1.2.13": diff --git a/recipes/zmarok-semver/all/test_package/CMakeLists.txt b/recipes/zmarok-semver/all/test_package/CMakeLists.txt index 42864628c0b43..910a900c00e0c 100644 --- a/recipes/zmarok-semver/all/test_package/CMakeLists.txt +++ b/recipes/zmarok-semver/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) find_package(zmarok-semver CONFIG REQUIRED) diff --git a/recipes/zmarok-semver/all/test_v1_package/CMakeLists.txt b/recipes/zmarok-semver/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/zmarok-semver/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zmarok-semver/all/test_v1_package/conanfile.py b/recipes/zmarok-semver/all/test_v1_package/conanfile.py deleted file mode 100644 index 2263c38965a38..0000000000000 --- a/recipes/zmarok-semver/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -from conans import ConanFile -from conans import CMake -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/zmqpp/all/test_package/CMakeLists.txt b/recipes/zmqpp/all/test_package/CMakeLists.txt index 18add93ce2d95..213e7c04ff483 100644 --- a/recipes/zmqpp/all/test_package/CMakeLists.txt +++ b/recipes/zmqpp/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(zmqpp REQUIRED) diff --git a/recipes/zmqpp/all/test_v1_package/CMakeLists.txt b/recipes/zmqpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/zmqpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zmqpp/all/test_v1_package/conanfile.py b/recipes/zmqpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/zmqpp/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_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/zoe/all/conandata.yml b/recipes/zoe/all/conandata.yml new file mode 100644 index 0000000000000..a315e5dbd038a --- /dev/null +++ b/recipes/zoe/all/conandata.yml @@ -0,0 +1,33 @@ +sources: + "3.6": + url: "https://github.com/winsoft666/zoe/archive/refs/tags/v3.6.tar.gz" + sha256: "5cae2a51bbac0bfa54aab78a4d2b534a66bea7bc2d72764cfb5bc8e02a751927" + "3.3": + url: "https://github.com/winsoft666/zoe/archive/refs/tags/v3.3.tar.gz" + sha256: "e75d24690d16feff8bf1fc57d1943d545a5203ba769ff94034dc1f35f89927a5" + "3.1": + url: "https://github.com/winsoft666/zoe/archive/refs/tags/v3.1.tar.gz" + sha256: "4b5a0c0cac5fb61846875699cb7e013c84bc33d852041824bde7af80d793f15d" + "3.0": + url: "https://github.com/winsoft666/zoe/archive/refs/tags/v3.0.tar.gz" + sha256: "718c6de993bea2a4b1866070a8685e77cfa7929bbd9e22abb29e54c67a687a5e" +patches: + "3.3": + - patch_file: "patches/3.1-0002-support-macosx.patch" + patch_description: "support macosx" + patch_type: "portability" + "3.1": + - patch_file: "patches/3.1-0002-support-macosx.patch" + patch_description: "support macosx" + patch_type: "portability" + "3.0": + - patch_file: "patches/3.0-0001-follow-cxx-standards.patch" + patch_description: "include threads header" + patch_type: "portability" + - patch_file: "patches/3.0-0002-support-macosx.patch" + patch_description: "support macosx" + patch_type: "portability" + - patch_file: "patches/3.0-0003-fix-install-target.patch" + patch_description: "fix wrong install target" + patch_type: "bugfix" + patch_source: "https://github.com/winsoft666/zoe/pull/25" diff --git a/recipes/zoe/all/conanfile.py b/recipes/zoe/all/conanfile.py new file mode 100644 index 0000000000000..598bbd6c08ccd --- /dev/null +++ b/recipes/zoe/all/conanfile.py @@ -0,0 +1,98 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc_static_runtime +from conan.tools.files import get, copy, apply_conandata_patches, export_conandata_patches, rmdir, replace_in_file +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 = ">=2.1" + +class ZoeConan(ConanFile): + name = "zoe" + description = "A multi-protocol, multi-threaded, resumable, cross-platform, open source, C++ file download library." + license = "GPL-3.0-only" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/winsoft666/zoe" + topics = ("curl", "download", "file", "ftp", "multithreading", "http", "libcurl", "rate-limit") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + implements = ["auto_shared_fpic"] + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("libcurl/[>=7.78.0 <9]") + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + + def validate(self): + check_min_cppstd(self, "11") + 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.") + + 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["ZOE_BUILD_SHARED_LIBS"] = self.options.shared + tc.variables["ZOE_USE_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["ZOE_BUILD_TESTS"] = False + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _apply_patches(self): + apply_conandata_patches(self) + # Remove hardcoded CMAKE_CXX_STANDANRD in newer versions + if Version(self.version) >= "3.2": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set (CMAKE_CXX_STANDARD 11)", + "") + + def build(self): + self._apply_patches() + 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")) + + def package_info(self): + libname = "zoe" if self.options.shared else "zoe-static" + libpostfix = "-d" if self.settings.build_type == "Debug" else "" + self.cpp_info.libs = [f"{libname}{libpostfix}"] + + if self.options.shared: + self.cpp_info.defines.append("ZOE_EXPORTS") + else: + self.cpp_info.defines.append("ZOE_STATIC") + + # https://github.com/winsoft666/zoe/blob/master/src/CMakeLists.txt#L88 + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "crypt32"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/zoe/all/patches/3.0-0001-follow-cxx-standards.patch b/recipes/zoe/all/patches/3.0-0001-follow-cxx-standards.patch new file mode 100644 index 0000000000000..ced0610043cd8 --- /dev/null +++ b/recipes/zoe/all/patches/3.0-0001-follow-cxx-standards.patch @@ -0,0 +1,25 @@ +diff --git a/src/entry_handler.cpp b/src/entry_handler.cpp +index 5844a03..0dc25a5 100644 +--- a/src/entry_handler.cpp ++++ b/src/entry_handler.cpp +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include "file_util.h" + #include "string_helper.hpp" + #include "string_encode.h" +diff --git a/src/md5.cpp b/src/md5.cpp +index 93dd21f..78a4b57 100644 +--- a/src/md5.cpp ++++ b/src/md5.cpp +@@ -90,7 +90,7 @@ void byteSwap(UWORD32* buf, unsigned words) { + * the data and converts bytes into longwords for this routine. + */ + void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) { +- register UWORD32 a, b, c, d; ++ UWORD32 a, b, c, d; + + a = buf[0]; + b = buf[1]; diff --git a/recipes/zoe/all/patches/3.0-0002-support-macosx.patch b/recipes/zoe/all/patches/3.0-0002-support-macosx.patch new file mode 100644 index 0000000000000..64f500a421a85 --- /dev/null +++ b/recipes/zoe/all/patches/3.0-0002-support-macosx.patch @@ -0,0 +1,40 @@ +diff --git a/a/src/file_util.cpp b/b/src/file_util.cpp +index 9cea293..20fb5c6 100644 +--- a/a/src/file_util.cpp ++++ b/b/src/file_util.cpp +@@ -46,6 +46,9 @@ int64_t FileUtil::GetFileSize(FILE* f) { + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) + _fseeki64(f, 0L, SEEK_END); + int64_t fsize = _ftelli64(f); ++#elif defined(__APPLE__) ++ fseeko(f, 0L, SEEK_END); ++ int64_t fsize = ftello(f); + #else + fseeko64(f, 0L, SEEK_END); + int64_t fsize = ftello64(f); +@@ -181,6 +184,8 @@ int FileUtil::Seek(FILE* f, int64_t offset, int origin) { + if (f) { + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) + return _fseeki64(f, offset, origin); ++#elif defined(__APPLE__) ++ return fseeko(f, offset, origin); + #else + return fseeko64(f, offset, origin); + #endif +@@ -263,6 +268,16 @@ bool FileUtil::CreateFixedSizeFile(const utf8string& path, int64_t fixed_size) { + } + + return prealloc; ++#elif defined(__APPLE__) ++ int fd = open(path.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); ++ fstore_t store = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, fixed_size}; ++ if (fcntl(fd, F_PREALLOCATE, &store) == -1) { ++ store.fst_flags = F_ALLOCATEALL; ++ if (fcntl(fd, F_PREALLOCATE, &store) == -1) { ++ return false; ++ } ++ } ++ return ftruncate(fd, fixed_size) == 0; + #else + int fd = open(path.c_str(), O_RDWR | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); diff --git a/recipes/zoe/all/patches/3.0-0003-fix-install-target.patch b/recipes/zoe/all/patches/3.0-0003-fix-install-target.patch new file mode 100644 index 0000000000000..8dc598ccf7ec9 --- /dev/null +++ b/recipes/zoe/all/patches/3.0-0003-fix-install-target.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 34f38b4..85c3a14 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -116,7 +116,7 @@ endif() + + install(DIRECTORY ../include/zoe DESTINATION include) + +-install(TARGETS ${ASHE_LIB_NAME} ++install(TARGETS ${ZOE_LIB_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/recipes/zoe/all/patches/3.1-0002-support-macosx.patch b/recipes/zoe/all/patches/3.1-0002-support-macosx.patch new file mode 100644 index 0000000000000..deb4b7f1cb9e7 --- /dev/null +++ b/recipes/zoe/all/patches/3.1-0002-support-macosx.patch @@ -0,0 +1,40 @@ +diff --git a/src/file_util.cpp b/src/file_util.cpp +index 386bfc8..70086be 100644 +--- a/src/file_util.cpp ++++ b/src/file_util.cpp +@@ -47,6 +47,9 @@ int64_t FileUtil::GetFileSize(FILE* f) { + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) + _fseeki64(f, 0L, SEEK_END); + int64_t fsize = _ftelli64(f); ++#elif defined(__APPLE__) ++ fseeko(f, 0L, SEEK_END); ++ int64_t fsize = ftello(f); + #else + fseeko64(f, 0L, SEEK_END); + int64_t fsize = ftello64(f); +@@ -182,6 +185,8 @@ int FileUtil::Seek(FILE* f, int64_t offset, int origin) { + if (f) { + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) + return _fseeki64(f, offset, origin); ++#elif defined(__APPLE__) ++ return fseeko(f, offset, origin); + #else + return fseeko64(f, offset, origin); + #endif +@@ -266,6 +271,16 @@ bool FileUtil::CreateFixedSizeFile(const utf8string& path, int64_t fixed_size) { + } + + return prealloc; ++#elif defined(__APPLE__) ++ int fd = open(path.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); ++ fstore_t store = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, fixed_size}; ++ if (fcntl(fd, F_PREALLOCATE, &store) == -1) { ++ store.fst_flags = F_ALLOCATEALL; ++ if (fcntl(fd, F_PREALLOCATE, &store) == -1) { ++ return false; ++ } ++ } ++ return ftruncate(fd, fixed_size) == 0; + #else + int fd = open(path.c_str(), O_RDWR | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); diff --git a/recipes/zoe/all/test_package/CMakeLists.txt b/recipes/zoe/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..573c0d90172aa --- /dev/null +++ b/recipes/zoe/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package LANGUAGES CXX) + +find_package(zoe REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE zoe::zoe) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/zoe/all/test_package/conanfile.py b/recipes/zoe/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/zoe/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/zoe/all/test_package/test_package.cpp b/recipes/zoe/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..3e7bf50d85e8c --- /dev/null +++ b/recipes/zoe/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include "zoe/zoe.h" + +int main(int argc, char** argv) { + using namespace zoe; + + Zoe::GlobalInit(); + + Zoe efd; + + Zoe::GlobalUnInit(); + + return 0; +} diff --git a/recipes/zoe/config.yml b/recipes/zoe/config.yml new file mode 100644 index 0000000000000..ac84b262b6517 --- /dev/null +++ b/recipes/zoe/config.yml @@ -0,0 +1,9 @@ +versions: + "3.6": + folder: all + "3.3": + folder: all + "3.1": + folder: all + "3.0": + folder: all diff --git a/recipes/zookeeper-client-c/all/conandata.yml b/recipes/zookeeper-client-c/all/conandata.yml index 0487be945d8c9..30c4962751575 100644 --- a/recipes/zookeeper-client-c/all/conandata.yml +++ b/recipes/zookeeper-client-c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.9.1": + url: "https://archive.apache.org/dist/zookeeper/zookeeper-3.9.1/apache-zookeeper-3.9.1.tar.gz" + sha256: "918f0fcf4ca8c53c2cccb97237ea72d2ccba978233ca85eff08f8ba077a8dadf" "3.9.0": url: "https://archive.apache.org/dist/zookeeper/zookeeper-3.9.0/apache-zookeeper-3.9.0.tar.gz" sha256: "c7af07e7411c798398bb8cd50f47780d8e014831666c41df6ec6540c143c0da2" @@ -6,6 +9,10 @@ sources: url: "https://archive.apache.org/dist/zookeeper/zookeeper-3.8.1/apache-zookeeper-3.8.1.tar.gz" sha256: "ccc16850c8ab2553583583234d11c813061b5ea5f3b8ff1d740cde6c1fd1e219" patches: + "3.9.1": + - patch_file: "patches/3.8.1-0001-add-install.patch" + patch_description: "add installer, disable cli program" + patch_type: "conan" "3.9.0": - patch_file: "patches/3.8.1-0001-add-install.patch" patch_description: "add installer, disable cli program" diff --git a/recipes/zookeeper-client-c/all/conanfile.py b/recipes/zookeeper-client-c/all/conanfile.py index ec48f11ba450f..020e3c8246146 100644 --- a/recipes/zookeeper-client-c/all/conanfile.py +++ b/recipes/zookeeper-client-c/all/conanfile.py @@ -44,12 +44,12 @@ def layout(self): def requirements(self): if self.options.with_cyrus_sasl: - self.requires("cyrus-sasl/2.1.27") + self.requires("cyrus-sasl/2.1.28") if self.options.with_openssl: self.requires("openssl/[>=1.1 <4]") def build_requirements(self): - self.tool_requires("maven/3.9.2") + self.tool_requires("maven/3.9.4") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -69,7 +69,9 @@ 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")) + # Override maven.repo.local to avoid writing to ~/.m2 + m2_repository = os.path.join(self.build_folder, "m2", "repository") + self.run(f'mvn compile -Dmaven.repo.local="{m2_repository}"', 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")) diff --git a/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt b/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt index 614f9306973ce..5e3c3ab6504d1 100644 --- a/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt +++ b/recipes/zookeeper-client-c/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(test_package C) find_package(zookeeper-client-c REQUIRED CONFIG) diff --git a/recipes/zookeeper-client-c/config.yml b/recipes/zookeeper-client-c/config.yml index 31b8685d6b74a..2bc00633d1dbc 100644 --- a/recipes/zookeeper-client-c/config.yml +++ b/recipes/zookeeper-client-c/config.yml @@ -1,4 +1,6 @@ versions: + "3.9.1": + folder: all "3.9.0": folder: all "3.8.1": diff --git a/recipes/zopfli/all/conanfile.py b/recipes/zopfli/all/conanfile.py index 35dd2870f9a77..cfe4cf62c2b09 100644 --- a/recipes/zopfli/all/conanfile.py +++ b/recipes/zopfli/all/conanfile.py @@ -1,10 +1,11 @@ -from conan import ConanFile, conan_version +from conan import ConanFile +from conan.errors import ConanException 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" +required_conan_version = ">=2.1" class ZopfliConan(ConanFile): @@ -50,6 +51,9 @@ def generate(self): tc.variables["CMAKE_MACOSX_BUNDLE"] = False # Generate a relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + if Version(self.version) > "1.0.3": # pylint: disable=conan-unreachable-upper-version + raise ConanException("CMAKE_POLICY_VERSION_MINIMUM hardcoded to 3.5, check if new version supports CMake 4") tc.generate() def build(self): @@ -75,8 +79,3 @@ def package_info(self): self.cpp_info.components["libzopflipng"].set_property("cmake_target_name", "Zopfli::libzopflipng") self.cpp_info.components["libzopflipng"].libs = ["zopflipng"] self.cpp_info.components["libzopflipng"].requires = ["libzopfli"] - - if Version(conan_version).major < 2: - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) - self.cpp_info.names["cmake_find_package"] = "Zopfli" - self.cpp_info.names["cmake_find_package_multi"] = "Zopfli" diff --git a/recipes/zopfli/all/test_package/CMakeLists.txt b/recipes/zopfli/all/test_package/CMakeLists.txt index 23f9efdde68f0..8b2d25ed3b402 100644 --- a/recipes/zopfli/all/test_package/CMakeLists.txt +++ b/recipes/zopfli/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(Zopfli CONFIG REQUIRED) diff --git a/recipes/zopfli/all/test_v1_package/CMakeLists.txt b/recipes/zopfli/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/zopfli/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zopfli/all/test_v1_package/conanfile.py b/recipes/zopfli/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/zopfli/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_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/zpp_bits/all/conandata.yml b/recipes/zpp_bits/all/conandata.yml index 21dad3174e487..8ce4aa57f1915 100644 --- a/recipes/zpp_bits/all/conandata.yml +++ b/recipes/zpp_bits/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "4.4.25": + url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.25.tar.gz" + sha256: "d4afb8cf73aec19686928445e912dbbe8d39bffdac43ea69b4781f145195a09e" + "4.4.24": + url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.24.tar.gz" + sha256: "eff8bf4507f26e670ddf760374c9b691abf501426c468b5fd938cc8d53985153" "4.4.20": url: "https://github.com/eyalz800/zpp_bits/archive/v4.4.20.tar.gz" sha256: "13023d3752392d64f89113bf8099a2a50b2602a7e26a2fdf78a27e327104819c" diff --git a/recipes/zpp_bits/all/test_package/CMakeLists.txt b/recipes/zpp_bits/all/test_package/CMakeLists.txt index 73137c5e1e473..1f6e642cd0d3a 100644 --- a/recipes/zpp_bits/all/test_package/CMakeLists.txt +++ b/recipes/zpp_bits/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(zpp_bits REQUIRED CONFIG) diff --git a/recipes/zpp_bits/all/test_v1_package/CMakeLists.txt b/recipes/zpp_bits/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/zpp_bits/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zpp_bits/all/test_v1_package/conanfile.py b/recipes/zpp_bits/all/test_v1_package/conanfile.py deleted file mode 100644 index 5a05af3c2dfd2..0000000000000 --- a/recipes/zpp_bits/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,18 +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/zpp_bits/config.yml b/recipes/zpp_bits/config.yml index 4b6dc9c688350..e5c2dd1bf22b4 100644 --- a/recipes/zpp_bits/config.yml +++ b/recipes/zpp_bits/config.yml @@ -1,4 +1,8 @@ versions: + "4.4.25": + folder: all + "4.4.24": + folder: all "4.4.20": folder: all "4.4.19": diff --git a/recipes/zpp_throwing/all/test_package/CMakeLists.txt b/recipes/zpp_throwing/all/test_package/CMakeLists.txt index 0d33f96e054b5..28c93d7e39789 100644 --- a/recipes/zpp_throwing/all/test_package/CMakeLists.txt +++ b/recipes/zpp_throwing/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(zpp_throwing REQUIRED CONFIG) diff --git a/recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt b/recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/zpp_throwing/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zpp_throwing/all/test_v1_package/conanfile.py b/recipes/zpp_throwing/all/test_v1_package/conanfile.py deleted file mode 100644 index 0f735b51a2642..0000000000000 --- a/recipes/zpp_throwing/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -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 tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) diff --git a/recipes/zserio/all/conandata.yml b/recipes/zserio/all/conandata.yml new file mode 100644 index 0000000000000..2f590dd3a499f --- /dev/null +++ b/recipes/zserio/all/conandata.yml @@ -0,0 +1,51 @@ +sources: + "2.16.0": + runtime: + url: "https://github.com/ndsev/zserio/releases/download/v2.16.0/zserio-2.16.0-runtime-libs.zip" + sha256: "e9e136247a70a198da20c145f9bf18b618b20b451cd64eb703e2f48b20c87b8c" + compiler: + url: "https://github.com/ndsev/zserio/releases/download/v2.16.0/zserio-2.16.0-bin.zip" + sha256: "b686ccb9bb7f7d786076a83b3f02cdaceedd9d1a509f975bed96ac283c6b4894" + license: + url: "https://raw.githubusercontent.com/ndsev/zserio/v2.16.0/LICENSE" + sha256: "8fd7b040fc223bb07551dfed490df0d55d6af25e331e58bc7c7599163ed1bb5a" + "2.15.0": + runtime: + url: "https://github.com/ndsev/zserio/releases/download/v2.15.0/zserio-2.15.0-runtime-libs.zip" + sha256: "6bfc82723715dccc4022f1aaf590513f4105f402cf33e3cf7bd15b04e203b218" + compiler: + url: "https://github.com/ndsev/zserio/releases/download/v2.15.0/zserio-2.15.0-bin.zip" + sha256: "17398de9856cc48e05e37eab34783f5d421a758f65efad6a20672f2547fc60b8" + license: + url: "https://raw.githubusercontent.com/ndsev/zserio/v2.15.0/LICENSE" + sha256: "8fd7b040fc223bb07551dfed490df0d55d6af25e331e58bc7c7599163ed1bb5a" + "2.14.1": + runtime: + url: "https://github.com/ndsev/zserio/releases/download/v2.14.1/zserio-2.14.1-runtime-libs.zip" + sha256: "ae3d7660ed3dd02fc77f535d7c7c721d9f03179c441efd0f4d09dc889da929fc" + compiler: + url: "https://github.com/ndsev/zserio/releases/download/v2.14.1/zserio-2.14.1-bin.zip" + sha256: "3280d620b2c23e01cc2e73bae9b60c93f94b23859c68edb1f105ba499b377049" + license: + url: "https://raw.githubusercontent.com/ndsev/zserio/v2.14.1/LICENSE" + sha256: "8fd7b040fc223bb07551dfed490df0d55d6af25e331e58bc7c7599163ed1bb5a" + "2.14.0": + runtime: + url: "https://github.com/ndsev/zserio/releases/download/v2.14.0/zserio-2.14.0-runtime-libs.zip" + sha256: "6002bfe179333435c84d3be2cfb612c008bd52837512aecea8a888e4a3139564" + compiler: + url: "https://github.com/ndsev/zserio/releases/download/v2.14.0/zserio-2.14.0-bin.zip" + sha256: "c1d4668371ad3543cb24f86b218640da7f720f31afe3f8af2d427114d7c7ae5c" + license: + url: "https://raw.githubusercontent.com/ndsev/zserio/v2.14.0/LICENSE" + sha256: "8fd7b040fc223bb07551dfed490df0d55d6af25e331e58bc7c7599163ed1bb5a" + "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..c90a1d67b100a --- /dev/null +++ b/recipes/zserio/all/conanfile.py @@ -0,0 +1,127 @@ +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 +from conan.tools.scm import Version + +required_conan_version = ">=2.1" + +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 _compilers_minimum_version(self): + # https://github.com/ndsev/zserio/tree/master/compiler/extensions/cpp#supported-compilers + return { + "apple-clang": "11", + "clang": "11", + "gcc": "5", + "msvc": "191", + "Visual Studio": "15", + } + + @property + def _min_cppstd(self): + return 11 + + def export_sources(self): + if Version(self.version) < "2.14.0": + 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) + + minimum_compiler_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_compiler_version and Version(self.settings.compiler.version) < minimum_compiler_version: + raise ConanInvalidConfiguration( + f"Compiler version '{self.settings.compiler.version}' not supported, " + f"minumum is '{minimum_compiler_version}'!" + ) + + 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) + if not self.settings.get_safe("compiler.cppstd"): + tc.variables["CMAKE_CXX_STANDARD"] = str(self._min_cppstd) + if Version(self.version) < "2.14.0": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support + 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") + if Version(self.version) >= "2.14.0": + get(self, **sources["compiler"], pattern="cmake/zserio_compiler.cmake") + + @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")) + if Version(self.version) >= "2.14.0": + # from 2.14.0 the cmake script is available directly in zserio repository + copy(self, "zserio_compiler.cmake", os.path.join(self.build_folder, "cmake"), + os.path.join(self.package_folder, self._cmake_module_path)) + else: + 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]) 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..b9203762adc31 --- /dev/null +++ b/recipes/zserio/config.yml @@ -0,0 +1,11 @@ +versions: + "2.16.0": + folder: all + "2.15.0": + folder: all + "2.14.1": + folder: all + "2.14.0": + folder: all + "2.13.0": + folder: all diff --git a/recipes/zstd/all/conandata.yml b/recipes/zstd/all/conandata.yml index 0deaf672d11b8..165b4b25cee01 100644 --- a/recipes/zstd/all/conandata.yml +++ b/recipes/zstd/all/conandata.yml @@ -1,44 +1,25 @@ sources: + "1.5.7": + url: "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz" + sha256: "eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3" + "1.5.6": + url: "https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz" + sha256: "8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1" "1.5.5": url: "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz" sha256: "9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4" - "1.5.4": - url: "https://github.com/facebook/zstd/releases/download/v1.5.4/zstd-1.5.4.tar.gz" - sha256: "0f470992aedad543126d06efab344dc5f3e171893810455787d38347343a4424" "1.5.2": url: "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz" sha256: "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0" - "1.5.1": - url: "https://github.com/facebook/zstd/releases/download/v1.5.1/zstd-1.5.1.tar.gz" - sha256: "e28b2f2ed5710ea0d3a1ecac3f6a947a016b972b9dd30242369010e5f53d7002" "1.5.0": url: "https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-1.5.0.tar.gz" sha256: "5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94" - "1.4.9": - url: "https://github.com/facebook/zstd/releases/download/v1.4.9/zstd-1.4.9.tar.gz" - sha256: "29ac74e19ea28659017361976240c4b5c5c24db3b89338731a6feb97c038d293" - "1.4.8": - url: "https://github.com/facebook/zstd/releases/download/v1.4.8/zstd-1.4.8.tar.gz" - sha256: "32478297ca1500211008d596276f5367c54198495cf677e9439f4791a4c69f24" - "1.4.7": - url: "https://github.com/facebook/zstd/releases/download/v1.4.7/zstd-1.4.7.tar.gz" - sha256: "192cbb1274a9672cbcceaf47b5c4e9e59691ca60a357f1d4a8b2dfa2c365d757" - "1.4.5": - url: "https://github.com/facebook/zstd/releases/download/v1.4.5/zstd-1.4.5.tar.gz" - sha256: "98e91c7c6bf162bf90e4e70fdbc41a8188b9fa8de5ad840c401198014406ce9e" - "1.4.4": - url: "https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-1.4.4.tar.gz" - sha256: "59ef70ebb757ffe74a7b3fe9c305e2ba3350021a918d168a046c6300aeea9315" - "1.4.3": - url: "https://github.com/facebook/zstd/releases/download/v1.4.3/zstd-1.4.3.tar.gz" - sha256: "e88ec8d420ff228610b77fba4fbf22b9f8b9d3f223a40ef59c9c075fcdad5767" - "1.3.8": - url: "https://github.com/facebook/zstd/releases/download/v1.3.8/zstd-1.3.8.tar.gz" - sha256: "293fa004dfacfbe90b42660c474920ff27093e3fb6c99f7b76e6083b21d6d48e" - "1.3.5": - url: "https://github.com/facebook/zstd/archive/refs/tags/v1.3.5.tar.gz" - sha256: "d6e1559e4cdb7c4226767d4ddc990bff5f9aab77085ff0d0490c828b025e2eea" patches: + "1.5.6": + - patch_file: "patches/1.5.6-public-scope-windows-shared.patch" + patch_description: "Include zstd.h folder when building shared library on Windows" + patch_type: "bugfix" + patch_source: "https://github.com/facebook/zstd/pull/4009" "1.5.5": - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" patch_description: "use assembler codes only on x86_64" @@ -47,14 +28,6 @@ patches: 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" - patch_type: "portability" - - patch_file: "patches/1.5.4-decrease-min-cmake-version.patch" - patch_description: "Don't require CMake 3.18 or later" - patch_type: "portability" - patch_source: "https://github.com/facebook/zstd/pull/3510" "1.5.2": - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" patch_description: "use assembler codes only on x86_64" @@ -63,24 +36,8 @@ patches: patch_description: "fix strange performance and scalability issues" patch_type: "bugfix" patch_source: "https://github.com/facebook/zstd/pull/3167" - "1.5.1": - - patch_file: "patches/1.5.1-cmake-remove-asm-except-x86_64.patch" - patch_description: "use assembler codes only on x86_64" - patch_type: "portability" - - patch_file: "patches/1.5.0-remove-explicit-standard-setting.patch" - patch_description: "fix strange performance and scalability issues" - patch_type: "bugfix" - patch_source: "https://github.com/facebook/zstd/pull/3167" "1.5.0": - patch_file: "patches/1.5.0-remove-explicit-standard-setting.patch" patch_description: "fix strange performance and scalability issues" patch_type: "bugfix" patch_source: "https://github.com/facebook/zstd/pull/3167" - "1.4.5": - - patch_file: "patches/1.4.5-cmake-install-dll.patch" - patch_description: "fix runtime installation path" - patch_type: "conan" - "1.3.5": - - patch_file: "patches/1.3.5-cmake-project.patch" - patch_description: "fix `project()` position" - patch_type: "portability" diff --git a/recipes/zstd/all/conanfile.py b/recipes/zstd/all/conanfile.py index 5920d50771523..d85b80636f701 100644 --- a/recipes/zstd/all/conanfile.py +++ b/recipes/zstd/all/conanfile.py @@ -2,11 +2,10 @@ 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, rm from conan.tools.scm import Version -from conan.tools.microsoft import is_msvc import glob import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class ZstdConan(ConanFile): name = "zstd" @@ -56,21 +55,15 @@ def generate(self): 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" + if Version(self.version) < "1.5.6": + tc.cache_variables["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5" # CMake 4 support tc.generate() def _patch_sources(self): apply_conandata_patches(self) # Don't force PIC - if Version(self.version) >= "1.4.5": - replace_in_file(self, os.path.join(self.source_folder, "build", "cmake", "lib", "CMakeLists.txt"), - "POSITION_INDEPENDENT_CODE On", "") + replace_in_file(self, os.path.join(self.source_folder, "build", "cmake", "lib", "CMakeLists.txt"), + "POSITION_INDEPENDENT_CODE On", "") def build(self): self._patch_sources() @@ -104,10 +97,5 @@ def package_info(self): 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.3.5-cmake-project.patch b/recipes/zstd/all/patches/1.3.5-cmake-project.patch deleted file mode 100644 index c8c9479c8ede1..0000000000000 --- a/recipes/zstd/all/patches/1.3.5-cmake-project.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/build/cmake/CMakeLists.txt -+++ b/build/cmake/CMakeLists.txt -@@ -7,8 +7,8 @@ - # in the COPYING file in the root directory of this source tree). - # ################################################################ - --PROJECT(zstd) - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9) -+PROJECT(zstd) - SET(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") - LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") - INCLUDE(GNUInstallDirs) diff --git a/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch b/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch deleted file mode 100644 index 9433dfdbea9cb..0000000000000 --- a/recipes/zstd/all/patches/1.4.5-cmake-install-dll.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- build/cmake/lib/CMakeLists.txt 2020-05-22 05:04:00.000000000 +0000 -+++ build/cmake/lib/CMakeLists.txt 2020-05-22 19:14:38.249960211 +0000 -@@ -161,6 +161,7 @@ - install(TARGETS ${library_targets} - EXPORT zstdExports - INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" -+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ) diff --git a/recipes/zstd/all/patches/1.5.1-cmake-remove-asm-except-x86_64.patch b/recipes/zstd/all/patches/1.5.1-cmake-remove-asm-except-x86_64.patch deleted file mode 100644 index 34bb693b4e039..0000000000000 --- a/recipes/zstd/all/patches/1.5.1-cmake-remove-asm-except-x86_64.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt -index 7ba4693..d6e1046 100644 ---- a/build/cmake/lib/CMakeLists.txt -+++ b/build/cmake/lib/CMakeLists.txt -@@ -22,7 +22,11 @@ include_directories(${LIBRARY_DIR} ${LIBRARY_DIR}/common) - - file(GLOB CommonSources ${LIBRARY_DIR}/common/*.c) - file(GLOB CompressSources ${LIBRARY_DIR}/compress/*.c) --file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S) -+if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") -+ file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S) -+else() -+ file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c) -+endif() - file(GLOB DictBuilderSources ${LIBRARY_DIR}/dictBuilder/*.c) - - set(Sources diff --git a/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch b/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch deleted file mode 100644 index d846e0df710df..0000000000000 --- a/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake -+++ b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake -@@ -1,6 +1,15 @@ - include(CheckCXXCompilerFlag) - include(CheckCCompilerFlag) --include(CheckLinkerFlag) -+# VERSION_GREATER_EQUAL requires CMake 3.7 or later. -+# https://cmake.org/cmake/help/latest/command/if.html#version-greater-equal -+if (CMAKE_VERSION VERSION_LESS 3.18) -+ set(ZSTD_HAVE_CHECK_LINKER_FLAG false) -+else () -+ set(ZSTD_HAVE_CHECK_LINKER_FLAG true) -+endif () -+if (ZSTD_HAVE_CHECK_LINKER_FLAG) -+ include(CheckLinkerFlag) -+endif() - - function(EnableCompilerFlag _flag _C _CXX _LD) - string(REGEX REPLACE "\\+" "PLUS" varname "${_flag}") -@@ -20,7 +29,15 @@ function(EnableCompilerFlag _flag _C _CXX _LD) - endif () - endif () - if (_LD) -- CHECK_LINKER_FLAG(C ${_flag} LD_FLAG_${varname}) -+ # We never add a linker flag with CMake < 3.18. We will -+ # implement CHECK_LINKER_FLAG() like feature for CMake < 3.18 -+ # or require CMake >= 3.18 when we need to add a required -+ # linker flag in future. -+ if (ZSTD_HAVE_CHECK_LINKER_FLAG) -+ CHECK_LINKER_FLAG(C ${_flag} LD_FLAG_${varname}) -+ else () -+ set(LD_FLAG_${varname} false) -+ endif () - if (LD_FLAG_${varname}) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_flag}" PARENT_SCOPE) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${_flag}" PARENT_SCOPE) diff --git a/recipes/zstd/all/patches/1.5.6-public-scope-windows-shared.patch b/recipes/zstd/all/patches/1.5.6-public-scope-windows-shared.patch new file mode 100644 index 0000000000000..9862de8aaa890 --- /dev/null +++ b/recipes/zstd/all/patches/1.5.6-public-scope-windows-shared.patch @@ -0,0 +1,13 @@ +diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt +index 5d514cc..1791897 100644 +--- a/build/cmake/lib/CMakeLists.txt ++++ b/build/cmake/lib/CMakeLists.txt +@@ -123,7 +123,7 @@ set(PUBLIC_INCLUDE_DIRS ${LIBRARY_DIR}) + set(library_targets) + if (ZSTD_BUILD_SHARED) + add_library(libzstd_shared SHARED ${Sources} ${Headers} ${PlatformDependResources}) +- target_include_directories(libzstd_shared INTERFACE $) ++ target_include_directories(libzstd_shared PUBLIC $) + list(APPEND library_targets libzstd_shared) + if (ZSTD_MULTITHREAD_SUPPORT) + set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") diff --git a/recipes/zstd/all/test_package/CMakeLists.txt b/recipes/zstd/all/test_package/CMakeLists.txt index 57a72caf9ad65..f182033a64014 100644 --- a/recipes/zstd/all/test_package/CMakeLists.txt +++ b/recipes/zstd/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(zstd REQUIRED CONFIG) diff --git a/recipes/zstd/all/test_package/conanfile.py b/recipes/zstd/all/test_package/conanfile.py index 5c69b0e8faebe..541303d07640d 100644 --- a/recipes/zstd/all/test_package/conanfile.py +++ b/recipes/zstd/all/test_package/conanfile.py @@ -25,7 +25,4 @@ def test(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") + self.run(bin_path, env="conanrun") diff --git a/recipes/zstd/all/test_package/logo.png b/recipes/zstd/all/test_package/logo.png deleted file mode 100644 index ef3d175cdec07..0000000000000 Binary files a/recipes/zstd/all/test_package/logo.png and /dev/null differ diff --git a/recipes/zstd/all/test_package/test_package.c b/recipes/zstd/all/test_package/test_package.c index 6ef7323d43a0d..29bca24047b95 100644 --- a/recipes/zstd/all/test_package/test_package.c +++ b/recipes/zstd/all/test_package/test_package.c @@ -1,126 +1,12 @@ -/* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under both the BSD-style license (found in the - * LICENSE file in the root directory of this source tree) and the GPLv2 (found - * in the COPYING file in the root directory of this source tree). - * You may select, at your option, one of the above-listed licenses. - */ - - -#include // malloc, free, exit -#include // fprintf, perror, feof, fopen, etc. -#include // strlen, memset, strcat -#include // presumes zstd library is installed - - -static void* malloc_orDie(size_t size) -{ - void* const buff = malloc(size); - if (buff) return buff; - /* error */ - perror("malloc:"); - exit(1); -} - -static FILE* fopen_orDie(const char *filename, const char *instruction) -{ - FILE* const inFile = fopen(filename, instruction); - if (inFile) return inFile; - /* error */ - perror(filename); - exit(3); -} - -static size_t fread_orDie(void* buffer, size_t sizeToRead, FILE* file) -{ - size_t const readSize = fread(buffer, 1, sizeToRead, file); - if (readSize == sizeToRead) return readSize; /* good */ - if (feof(file)) return readSize; /* good, reached end of file */ - /* error */ - perror("fread"); - exit(4); -} - -static size_t fwrite_orDie(const void* buffer, size_t sizeToWrite, FILE* file) -{ - size_t const writtenSize = fwrite(buffer, 1, sizeToWrite, file); - if (writtenSize == sizeToWrite) return sizeToWrite; /* good */ - /* error */ - perror("fwrite"); - exit(5); -} - -static size_t fclose_orDie(FILE* file) -{ - if (!fclose(file)) return 0; - /* error */ - perror("fclose"); - exit(6); -} - - -static void compressFile_orDie(const char* fname, const char* outName, int cLevel) -{ - FILE* const fin = fopen_orDie(fname, "rb"); - FILE* const fout = fopen_orDie(outName, "wb"); - size_t const buffInSize = ZSTD_CStreamInSize(); /* can always read one full block */ - void* const buffIn = malloc_orDie(buffInSize); - size_t const buffOutSize = ZSTD_CStreamOutSize(); /* can always flush a full block */ - void* const buffOut = malloc_orDie(buffOutSize); - - ZSTD_CStream* const cstream = ZSTD_createCStream(); - if (cstream==NULL) { fprintf(stderr, "ZSTD_createCStream() error \n"); exit(10); } - size_t const initResult = ZSTD_initCStream(cstream, cLevel); - if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_initCStream() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } - - size_t read, toRead = buffInSize; - while( (read = fread_orDie(buffIn, toRead, fin)) ) { - ZSTD_inBuffer input = { buffIn, read, 0 }; - while (input.pos < input.size) { - ZSTD_outBuffer output = { buffOut, buffOutSize, 0 }; - toRead = ZSTD_compressStream(cstream, &output , &input); /* toRead is guaranteed to be <= ZSTD_CStreamInSize() */ - if (ZSTD_isError(toRead)) { fprintf(stderr, "ZSTD_compressStream() error : %s \n", ZSTD_getErrorName(toRead)); exit(12); } - if (toRead > buffInSize) toRead = buffInSize; /* Safely handle case when `buffInSize` is manually changed to a value < ZSTD_CStreamInSize()*/ - fwrite_orDie(buffOut, output.pos, fout); - } - } - - ZSTD_outBuffer output = { buffOut, buffOutSize, 0 }; - size_t const remainingToFlush = ZSTD_endStream(cstream, &output); /* close frame */ - if (remainingToFlush) { fprintf(stderr, "not fully flushed"); exit(13); } - fwrite_orDie(buffOut, output.pos, fout); - - ZSTD_freeCStream(cstream); - fclose_orDie(fout); - fclose_orDie(fin); - free(buffIn); - free(buffOut); -} - - -static const char* createOutFilename_orDie(const char* filename) -{ - size_t const inL = strlen(filename); - size_t const outL = inL + 5; - void* outSpace = malloc_orDie(outL); - memset(outSpace, 0, outL); - strcat(outSpace, filename); - strcat(outSpace, ".zst"); - return (const char*)outSpace; -} - -int main(int argc, const char** argv) -{ - if (argc < 2) { - fprintf(stderr, "Need at least one argument\n"); - return 1; - } - const char* const inFilename = argv[1]; - - const char* const outFilename = createOutFilename_orDie("logo.png"); - compressFile_orDie(inFilename, outFilename, 1); +#include +#include +#include +#include + +int main() { + const char* originalData = "Sample text"; + size_t compressedSize = ZSTD_compressBound(strlen(originalData) + 1); + printf("%zu\n", compressedSize); return 0; } diff --git a/recipes/zstd/all/test_v1_package/CMakeLists.txt b/recipes/zstd/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/zstd/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zstd/all/test_v1_package/conanfile.py b/recipes/zstd/all/test_v1_package/conanfile.py deleted file mode 100644 index c6bf65d610aa1..0000000000000 --- a/recipes/zstd/all/test_v1_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 = os.path.join("bin", "test_package") - png_file = os.path.join(self.source_folder, os.pardir, "test_package", "logo.png") - self.run(f"{bin_path} {png_file}", run_environment=True) diff --git a/recipes/zstd/config.yml b/recipes/zstd/config.yml index ddb81b147ddb6..b8af9c291218a 100644 --- a/recipes/zstd/config.yml +++ b/recipes/zstd/config.yml @@ -1,27 +1,11 @@ versions: - "1.5.5": + "1.5.7": folder: all - "1.5.4": + "1.5.6": folder: all - "1.5.2": + "1.5.5": folder: all - "1.5.1": + "1.5.2": folder: all "1.5.0": folder: all - "1.4.9": - folder: all - "1.4.8": - folder: all - "1.4.7": - folder: all - "1.4.5": - folder: all - "1.4.4": - folder: all - "1.4.3": - folder: all - "1.3.8": - folder: all - "1.3.5": - folder: all diff --git a/recipes/zstr/all/test_package/CMakeLists.txt b/recipes/zstr/all/test_package/CMakeLists.txt index 4fae7f3b9f5a3..9c1010ce5b1f8 100644 --- a/recipes/zstr/all/test_package/CMakeLists.txt +++ b/recipes/zstr/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(zstr REQUIRED CONFIG) diff --git a/recipes/zstr/all/test_v1_package/CMakeLists.txt b/recipes/zstr/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 9d54a092e0a67..0000000000000 --- a/recipes/zstr/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zstr/all/test_v1_package/conanfile.py b/recipes/zstr/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/zstr/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_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/all/conandata.yml b/recipes/zug/all/conandata.yml index a182f02902b99..eec3bc50f0058 100644 --- a/recipes/zug/all/conandata.yml +++ b/recipes/zug/all/conandata.yml @@ -1,4 +1,7 @@ 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" diff --git a/recipes/zug/all/test_v1_package/CMakeLists.txt b/recipes/zug/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/zug/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/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 deleted file mode 100644 index 34e439b02360c..0000000000000 --- a/recipes/zug/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -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 80463c6cdc5cc..f6a5245cc2d90 100644 --- a/recipes/zug/config.yml +++ b/recipes/zug/config.yml @@ -1,4 +1,6 @@ versions: + "0.1.1": + folder: all "cci.20220125": folder: all "0.1.0": diff --git a/recipes/zulu-openjdk/all/conandata.yml b/recipes/zulu-openjdk/all/conandata.yml index 9e14b09c940cf..79b65fbdb247a 100644 --- a/recipes/zulu-openjdk/all/conandata.yml +++ b/recipes/zulu-openjdk/all/conandata.yml @@ -1,4 +1,26 @@ sources: + "21.0.4": + "Windows": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-win_x64.zip" + sha256: "d771dad10d3f0b440c3686d1f3d2b68b320802ac97b212d87671af3f2eef8848" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-win_aarch64.zip" + sha256: "9f873eccf030b1d3dc879ec1eb0ff5e11bf76002dc81c5c644c3462bf6c5146b" + "Linux": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-linux_x64.tar.gz" + sha256: "318d0c2ed3c876fb7ea2c952945cdcf7decfb5264ca51aece159e635ac53d544" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-linux_aarch64.tar.gz" + sha256: "da3c2d7db33670bcf66532441aeb7f33dcf0d227c8dafe7ce35cee67f6829c4c" + "Macos": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-macosx_x64.tar.gz" + sha256: "5ce75a6a247c7029b74c4ca7cf6f60fd2b2d68ce1e8956fb448d2984316b5fea" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jdk21.0.4-macosx_aarch64.tar.gz" + sha256: "bc2750f81a166cc6e9c30ae8aaba54f253a8c8ec9d8cfc04a555fe20712c7bff" "21.0.1": "Windows": "x86_64": @@ -37,6 +59,38 @@ sources: "armv8": url: "https://cdn.azul.com/zulu/bin/zulu17.46.19-ca-jdk17.0.9-macosx_aarch64.tar.gz" sha256: "d6837676e55b97772b6512e253fdaf8ab282bb216c0f8366b6c5905cd02b5056" + "11.0.24": + "Linux": + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.74.15-ca-jdk11.0.24-linux_x64.tar.gz" + sha256: "a7aac0e69a99bf64a1a3ec96f08149ac069a5bbdaaefae922ee3a7465fd918b3" + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu11.74.15-ca-jdk11.0.24-linux_aarch64.tar.gz" + sha256: "4f473e6307c465c037889981ae2cb3c4133648409c7331b6e57540a4896033e1" + "x86": + url: "https://cdn.azul.com/zulu/bin/zulu11.74.15-ca-jdk11.0.24-linux_i686.tar.gz" + sha256: "d6e9f14562b6a6b89e37bc740e0700de8f831e81a64ce701ab0c5d6ba4fc1b71" + "Macos": + "armv8": + url: "https://cdn.azul.com/zulu/bin/zulu11.74.15-ca-jdk11.0.24-macosx_aarch64.tar.gz" + sha256: "f8ac458076c10f13753b7342033aaa073b715ef798023acf155ba814bff67514" + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.74.15-ca-jdk11.0.24-macosx_x64.tar.gz" + sha256: "087ea956e8b43c89c732df8024e1344f686b02611c2c5449be6478299b9a9dac" + "SunOS": + "sparcv9": + url: "https://cdn.azul.com/zulu/bin/zulu11.74.15-ca-jdk11.0.24-solaris_sparcv9.zip" + sha256: "82e8eb5887592f290cec095c6c8466a576c8d8049c1c5eb8987822fba3bfdbb7" + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.74.15-ca-jdk11.0.24-solaris_x64.zip" + sha256: "60b67de2325b7041e2495c5ae10574c960542fd7ad7eee1fef0d9bcaf63ce514" + "Windows": + "x86": + url: "https://cdn.azul.com/zulu/bin/zulu11.74.15-ca-jdk11.0.24-win_i686.zip" + sha256: "bae034bc5075e31123f76980f3f3234150f68cbe96e48d288291b8ea6c5124f4" + "x86_64": + url: "https://cdn.azul.com/zulu/bin/zulu11.74.15-ca-jdk11.0.24-win_x64.zip" + sha256: "1b1870eb161076dcadf2c6f85855969484d907f44f11c1483d86e964dc946323" "11.0.19": "Windows": "x86_64": diff --git a/recipes/zulu-openjdk/config.yml b/recipes/zulu-openjdk/config.yml index d9b1272d1abe9..0ef2c791e311c 100644 --- a/recipes/zulu-openjdk/config.yml +++ b/recipes/zulu-openjdk/config.yml @@ -1,8 +1,12 @@ versions: + "21.0.4": + folder: all "21.0.1": folder: all "17.0.9": folder: all + "11.0.24": + folder: all "11.0.19": folder: all "11.0.15": diff --git a/recipes/zxing-cpp/all/conandata.yml b/recipes/zxing-cpp/all/conandata.yml index de7e69d1a2cb4..2d71c52b48c34 100644 --- a/recipes/zxing-cpp/all/conandata.yml +++ b/recipes/zxing-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.0": + url: "https://github.com/zxing-cpp/zxing-cpp/archive/v2.3.0.tar.gz" + sha256: "64e4139103fdbc57752698ee15b5f0b0f7af9a0331ecbdc492047e0772c417ba" "2.2.1": url: "https://github.com/zxing-cpp/zxing-cpp/archive/v2.2.1.tar.gz" sha256: "02078ae15f19f9d423a441f205b1d1bee32349ddda7467e2c84e8f08876f8635" diff --git a/recipes/zxing-cpp/all/conanfile.py b/recipes/zxing-cpp/all/conanfile.py index 51a640fb637ef..d264585049432 100644 --- a/recipes/zxing-cpp/all/conanfile.py +++ b/recipes/zxing-cpp/all/conanfile.py @@ -23,12 +23,14 @@ class ZXingCppConan(ConanFile): "fPIC": [True, False], "enable_encoders": [True, False], "enable_decoders": [True, False], + "enable_c_api": [True, False], } default_options = { "shared": False, "fPIC": True, "enable_encoders": True, "enable_decoders": True, + "enable_c_api": True, } @property @@ -64,6 +66,9 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def build_requirements(self): + self.build_requires("cmake/[>=3.16 <4]") + def validate(self): cpp_version = 17 if Version(self.version) >= "1.2.0" else 14 @@ -87,11 +92,16 @@ def generate(self): tc.variables["ENABLE_ENCODERS"] = self.options.enable_encoders tc.variables["ENABLE_DECODERS"] = self.options.enable_decoders tc.variables["BUILD_SHARED_LIBRARY"] = self.options.shared - else: + elif Version(self.version) < "2.3.0": tc.variables["BUILD_WRITERS"] = self.options.enable_encoders tc.variables["BUILD_READERS"] = self.options.enable_decoders tc.variables["BUILD_EXAMPLES"] = False tc.variables["BUILD_BLACKBOX_TESTS"] = False + else: + tc.variables["ZXING_WRITERS"] = "ON" if self.options.enable_encoders else "OFF" + tc.variables["ZXING_READERS"] = "ON" if self.options.enable_decoders else "OFF" + tc.variables["ZXING_C_API"] = "ON" if self.options.enable_c_api else "OFF" + tc.variables["ZXING_EXAMPLES"] = False if is_msvc(self): tc.variables["LINK_CPP_STATICALLY"] = is_msvc_static_runtime(self) tc.generate() diff --git a/recipes/zxing-cpp/all/test_v1_package/CMakeLists.txt b/recipes/zxing-cpp/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index be00a8c7f57c7..0000000000000 --- a/recipes/zxing-cpp/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zxing-cpp/all/test_v1_package/conanfile.py b/recipes/zxing-cpp/all/test_v1_package/conanfile.py deleted file mode 100644 index 030ecca50ee45..0000000000000 --- a/recipes/zxing-cpp/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,27 +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 requirements(self): - self.requires("stb/cci.20220909") - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not cross_building(self): - try: - os.unlink("output.png") - except FileNotFoundError: - pass - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - - assert os.path.isfile("output.png") diff --git a/recipes/zxing-cpp/config.yml b/recipes/zxing-cpp/config.yml index 335926844a15f..1b1881ded48db 100644 --- a/recipes/zxing-cpp/config.yml +++ b/recipes/zxing-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.0": + folder: all "2.2.1": folder: all "2.1.0": diff --git a/recipes/zyre/all/conanfile.py b/recipes/zyre/all/conanfile.py index bd990107ea362..be3408d481659 100644 --- a/recipes/zyre/all/conanfile.py +++ b/recipes/zyre/all/conanfile.py @@ -4,7 +4,6 @@ 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" @@ -48,7 +47,7 @@ def requirements(self): 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/253.10") + self.requires("libsystemd/255") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -56,9 +55,8 @@ def source(self): 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["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"] = "" @@ -99,7 +97,7 @@ def package_info(self): 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: + if is_msvc(self) and not self.options.shared: libname = "libzyre" self.cpp_info.libs = [libname] if self.settings.os in ["Linux", "FreeBSD"]: diff --git a/recipes/zziplib/all/conandata.yml b/recipes/zziplib/all/conandata.yml index 2b47b2bf41c26..546e31624c427 100644 --- a/recipes/zziplib/all/conandata.yml +++ b/recipes/zziplib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.13.78": + url: "https://github.com/gdraheim/zziplib/archive/refs/tags/v0.13.78.tar.gz" + sha256: "feaeee7c34f18aa27bd3da643cc6a47d04d2c41753a59369d09102d79b9b0a31" "0.13.72": url: "https://github.com/gdraheim/zziplib/archive/v0.13.72.tar.gz" sha256: "93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc" diff --git a/recipes/zziplib/all/conanfile.py b/recipes/zziplib/all/conanfile.py index bb584cb53822b..4c16c3a78d846 100644 --- a/recipes/zziplib/all/conanfile.py +++ b/recipes/zziplib/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.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" +required_conan_version = ">=2.1" class ZziplibConan(ConanFile): @@ -17,6 +18,7 @@ class ZziplibConan(ConanFile): license = "GPL-2.0-or-later" settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], @@ -51,13 +53,25 @@ def layout(self): def requirements(self): self.requires("zlib/[>=1.2.11 <2]") + def validate(self): + # Old versions do not support llvm >= 15 + if (Version(self.version) < "0.13.78" + and self.settings.compiler in ("clang", "apple-clang") + and Version(self.settings.compiler.version) >= "15.0"): + raise ConanInvalidConfiguration(f"{self.ref} does not support {self.settings.compiler} >= 15 due to incompatible pointer to integer conversion errors") + 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.variables["BUILD_STATIC_LIBS"] = not self.options.shared + # Older versions had BUILD_STATIC_LIBS option, new ones only have BUILD_SHARED_LIBS + if Version(self.version) < "0.13.78": + tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared + else: + # Disable sanitizer for newer versions + tc.variables["FORTIFY"] = False tc.variables["ZZIPCOMPAT"] = self.settings.os != "Windows" tc.variables["ZZIPMMAPPED"] = self.options.zzipmapped tc.variables["ZZIPFSEEKO"] = self.options.zzipfseeko @@ -85,6 +99,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.set_property("pkg_config_name", "zziplib-all-do-not-use") @@ -112,7 +127,7 @@ def package_info(self): if Version(self.version) >= "0.13.72" and self.options.shared and is_apple_os(self): self.cpp_info.components["zzipfseeko"].libs = [f"zzipfseeko"] else: - self.cpp_info.components["zzipfseeko"].libs = [f"zzipfseeko{suffix}"] + self.cpp_info.components["zzipfseeko"].libs = [f"zzipfseeko{suffix}"] self.cpp_info.components["zzipfseeko"].requires = ["zlib::zlib"] # libzzipwrap if self.options.zzipwrap: diff --git a/recipes/zziplib/all/test_package/CMakeLists.txt b/recipes/zziplib/all/test_package/CMakeLists.txt index dfd82ecc4be7e..77d201ba2f172 100644 --- a/recipes/zziplib/all/test_package/CMakeLists.txt +++ b/recipes/zziplib/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(zziplib REQUIRED CONFIG) diff --git a/recipes/zziplib/all/test_v1_package/CMakeLists.txt b/recipes/zziplib/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/zziplib/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -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/zziplib/all/test_v1_package/conanfile.py b/recipes/zziplib/all/test_v1_package/conanfile.py deleted file mode 100644 index 38f4483872d47..0000000000000 --- a/recipes/zziplib/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_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/zziplib/config.yml b/recipes/zziplib/config.yml index 68a29e739876a..f22b5dfa45a07 100644 --- a/recipes/zziplib/config.yml +++ b/recipes/zziplib/config.yml @@ -1,4 +1,6 @@ versions: + "0.13.78": + folder: all "0.13.72": folder: all "0.13.71":