Package: conanex
ConanEx - Conan Extended, conan that more decentralizeOverviewWhat does it for ?ConanEx is usingconanas underlying tool.
ConanEx is a command line wrapper aroundconanwith additional features.Consider the following workflow:wget https://github.com/google/flatbuffers/archive/refs/tags/v22.10.26.zipunzip v22.10.26.zip -d flatbuffers_22_10_26conan create flatbuffers/22.10.26 flatbuffers_22_10_26/conan create ctre/3.6 ../../../../compile-time-regular-expressionsSuch workflow has a following drawbacks:Not all dependencies are specified inconanfile.txtIt adds a boilerplate commands to execute each time when environment should be deployedLets also describeconancenterdrawbacks:Centralized repository (do not allow decentralized behaviour)Hard to addconanfile.pyreceipt toconan-center-index. It takes too long to pass review with all unwrittenconan-center-indexrules forconanfile.pyLets also describe a currentconanfile.txtdrawbacks:conanfile.txtdoes not allow specifying dependencies to other package sources likegit, remoteziparchive and etc. It makes it less decentralized as claimedLet's consider what ConanEx brings toconanfile.txtsyntax.
Consider the followingconanfile.txt:[requires]poco/1.9.4flatbuffers/22.10.26 {zip = 'https://github.com/google/flatbuffers/archive/refs/tags/v22.10.26.zip',sha256 = 'B97C7C017B05F20B17939FEBD413C75201F5B704C8DE49ADB0B35A70D50478CD'}ctre/3.6 { remote = "conancenter" }#Examples:#flatbuffers/2.0.0{#git=https://github.com/google/flatbuffers,#tag=v2.0.0#}#flatbuffers/2.0.0{zip="https://github.com/google/flatbuffers/archive/refs/tags/v2.0.0.tar.gz"}#flatbuffers/2.0.0{conan="https://raw.githubusercontent.com/google/flatbuffers/master/conanfile.py"}#CTRE/3.6{git="https://github.com/hanickadot/compile-time-regular-expressions"}#CTRE/3.6{path="../../../../compile-time-regular-expressions"}[options]flatbuffers/*:shared=Truepoco/*:shared=TrueAs you can see in this file we have 5 additional ways to install packageLets describe them:gitallow to download package using Git and runconanfile.pylocated in root directoryzip(url/file_path) allow installing package from archive, unpack it and runconanfile.pylocated in root directory.
There are the following formats that supported:zip,tar.gz,tar.bz2conan(url/file_path) if you receipt is completely independent, then you could specify url/path to it to create package.
Independent means that receipt could download source files by itself.pathallow to install package from folderremotespecify separate remote for this particular packageurl/file_pathsupports the hash calculation with options:md5,sha256andsha512To installconanex:python3 -m pip install conanexTo useconanexuse it the same way you useconan:conanex install <path_to_conanfile.txt> -pr=<path_to_profile>If you are usingcmake-conan:if(NOTEXISTS"${CMAKE_BINARY_DIR}/conan.cmake")message(STATUS"Downloading conan.cmake from https://github.com/conan-io/cmake-conan")file(DOWNLOAD"https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake""${CMAKE_BINARY_DIR}/conan.cmake"TLS_VERIFYON)endif()include(${CMAKE_BINARY_DIR}/conan.cmake)set(CONAN_COMMANDconanex)conan_cmake_autodetect(settings)conan_cmake_install(PATH_OR_REFERENCE${CMAKE_CURRENT_LIST_DIR}BUILDmissingREMOTEconancenterSETTINGS${settings})Only thing you need is to specifyset(CONAN_COMMAND conanex)before any conan command