From 939c4960abe91764f06b0f7dd454adc26d787018 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 20 Jan 2021 11:00:41 -0300 Subject: [PATCH 1/2] Remove conan community from docs Signed-off-by: Uilian Ries --- devtools/create_installer_packages.rst | 14 ++--- howtos/other_languages_package_manager/go.rst | 57 ++++++++++++------- howtos/run_conan_in_docker.rst | 14 ++--- .../build_system/cmake/find_packages.rst | 4 +- integrations/ci/jenkins.rst | 12 ++-- integrations/cross_platform/buildroot.rst | 5 +- reference/commands/output/user.rst | 7 +-- systems_cross_building/cross_building.rst | 6 +- 8 files changed, 67 insertions(+), 52 deletions(-) diff --git a/devtools/create_installer_packages.rst b/devtools/create_installer_packages.rst index 37de1bce55e1..d4d8e0a7c50f 100644 --- a/devtools/create_installer_packages.rst +++ b/devtools/create_installer_packages.rst @@ -4,7 +4,7 @@ Creating conan packages to install dev tools ============================================ One of the most useful features of Conan is to package executables like compilers or build tools and -distribute them in a controlled way to the team of developers. This way Conan helps not only with the +distribute them in a controlled way to the team of developers. This way Conan helps not only with the graph of dependencies of the application itself, but also with all the ecosystem needed to generate the project, making it really easy to control everything involved in the deployed application. @@ -38,7 +38,7 @@ the ``nasm`` tool for building assembler: name = "nasm" version = "2.13.02" license = "BSD-2-Clause" - url = "https://github.com/conan-community/conan-nasm-installer" + url = "https://github.com/conan-io/conan-center-index" settings = "os", "arch" description="Nasm for windows. Useful as a build_require." @@ -91,9 +91,9 @@ Using the tool packages in other recipes These kind of tools are not usually part of the application graph itself, they are needed only to build the library, so you should usually declare them as :ref:`build requirements `, in the recipe itself or in a profile. -For example, there are many recipes that can take advantage of the ``nasm`` package we've seen above, like +For example, there are many recipes that can take advantage of the ``nasm`` package we've seen above, like `flac `_ or `libx264 `_ -that are already available in `ConanCenter `_. Those recipes will take advantage of ``nasm`` +that are already available in `ConanCenter `_. Those recipes will take advantage of ``nasm`` being in the PATH to run some assembly optimizations. @@ -107,7 +107,7 @@ being in the PATH to run some assembly optimizations. def build(self): ... # ``nasm.exe`` will be in the PATH here - + def package_info(self): self.cpp_info.libs = [...] @@ -126,7 +126,7 @@ of adding the required paths to the corresponding environment variables: Here we are telling Conan to create the package for the ``libx264`` for the ``host`` platform defined in the profile ``profile_host`` file and to use the profile ``windows`` for all the build requirements -that are in the ``build`` context. In other words: in this example we are running a Windows machine +that are in the ``build`` context. In other words: in this example we are running a Windows machine and we need a version of ``nasm`` compatible with this machine, so we are providing a ``windows`` profile for the ``build`` context, and we are generating the library for the ``host`` platform which is declared in the ``profile_host`` profile (read more about :ref:`build requires context `). @@ -195,7 +195,7 @@ For example: Working in Windows with the ``nasm`` package we've already defined: > NASM version 2.13.02 compiled on Dec 18 2019 - + #. You can deactivate the virtual environment with the *deactivate.bat* script .. code-block:: bash diff --git a/howtos/other_languages_package_manager/go.rst b/howtos/other_languages_package_manager/go.rst index 7849bd152da7..c1a5cf5ce863 100644 --- a/howtos/other_languages_package_manager/go.rst +++ b/howtos/other_languages_package_manager/go.rst @@ -15,7 +15,7 @@ You can just clone the following example repository: .. code-block:: bash - $ git clone https://github.com/conan-community/conan-goserver-example + $ git clone https://github.com/conan-io/examples/tree/master/features/goserver Or, alternatively, manually create the folder and copy the following files inside: @@ -53,12 +53,12 @@ Create a *conanfile.txt*, with the following content: :caption: *conanfile.txt* [requires] - go-martini/1.0@lasote/stable + go-martini/1.0@ [imports] src, * -> ./deps/src -Our project requires a package, **go-martini/1.0@lasote/stable**, and we indicate that all **src contents** from all our requirements have +Our project requires a package, **go-martini/1.0@**, and we indicate that all **src contents** from all our requirements have to be copied to *./deps/src*. The package go-martini depends on go-inject, so Conan will handle automatically the go-inject dependency. @@ -109,24 +109,32 @@ Let's take a look at the *conanfile.py* of the **go inject** library: .. code-block:: python :caption: *conanfile.py* - from conans import ConanFile + import os + from conans import ConanFile, tools - class InjectConan(ConanFile): + + class GoInjectConan(ConanFile): name = "go-inject" version = "1.0" + license = "MIT" + homepage = "https://github.com/codegangsta/inject" + no_copy_source = True def source(self): - self.run("git clone https://github.com/codegangsta/inject.git") - self.run("cd inject && git checkout v1.0-rc1") # TAG v1.0-rc1 + tools.get("https://github.com/codegangsta/inject/archive/v1.0-rc1.tar.gz", + sha256="22b265ea391a19de6961aaa8811ecfcc5bbe7979594e30663c610821cdad6c7b") def package(self): - self.copy(pattern='*', dst='src/github.com/codegangsta/inject', src="inject", keep_path=True) + self.copy(pattern='*', + dst=os.path.join("src", "github.com", "codegangsta", "inject"), + src="inject-1.0-rc1", keep_path=True) + If you have read the :ref:`Building a hello world package `, the previous code may look quite simple to you. We want to pack **version 1.0** of the **go inject** library, so the **version** variable is **"1.0"**. In the ``source()`` method, we -declare how to obtain the source code of the library, in this case just by cloning the github repository and making a checkout of the -**v1.0-rc1** tag. In the ``package()`` method, we are just copying all the sources to a folder named "src/github.com/codegangsta/inject". +declare how to obtain the source code of the library, in this case just by downloading **v1.0-rc1** tag. +In the ``package()`` method, we are just copying all the sources to a folder named "src/github.com/codegangsta/inject". This way, we can keep importing the library in the same way: @@ -138,35 +146,42 @@ We can export and upload the package to a remote and we are done: .. code-block:: bash - $ conan export . lasote/stable # Or any other user/channel - $ conan upload go-inject/1.0@lasote/stable --all + $ conan create . # Or any other user/channel + $ conan upload go-inject/1.0@ --all Now look at the **go martini** conanfile: .. code-block:: python :caption: *conanfile.py* - from conans import ConanFile + import os + from conans import ConanFile, tools - class InjectConan(ConanFile): + + class GoMartiniConan(ConanFile): name = "go-martini" version = "1.0" - requires = 'go-inject/1.0@lasote/stable' + requires = "go-inject/1.0@" + license = "MIT" + homepage = "https://github.com/go-martini/martini" + no_copy_source = True def source(self): - self.run("git clone https://github.com/go-martini/martini.git") - self.run("cd martini && git checkout v1.0") # TAG v1.0 + tools.get("https://github.com/go-martini/martini/archive/v1.0.tar.gz", + sha256="3db135845d076d611f4420e0500e91625543a6b00dc9431cbe45d3571741281b") def package(self): - self.copy(pattern='*', dst='src/github.com/go-martini/martini', src="martini", keep_path=True) + self.copy(pattern="*", dst=os.path.join("src", "github.com", "go-martini", "martini"), + src="martini-1.0", keep_path=True) + -It is very similar. The only difference is the ``requires`` variable. It defines the **go-inject/1.0@lasote/stable** library, as a +It is very similar. The only difference is the ``requires`` variable. It defines the **go-inject/1.0@** library, as a requirement. .. code-block:: bash - $ conan export . lasote/stable # Or any other user/channel - $ conan upload go-martini/1.0@lasote/stable --all + $ conan create . # Or any other user/channel + $ conan upload go-martini/1.0@ --all Now we are able to use them easily and without the problems of versioning with github checkouts. diff --git a/howtos/run_conan_in_docker.rst b/howtos/run_conan_in_docker.rst index 4f0155be1156..1bc80e76b454 100644 --- a/howtos/run_conan_in_docker.rst +++ b/howtos/run_conan_in_docker.rst @@ -38,9 +38,9 @@ It is always recommended to upgrade Conan from pip first: .. code-block:: bash $ sudo pip install conan --upgrade # We make sure we are running the latest Conan version - $ git clone https://github.com/conan-community/conan-openssl - $ cd conan-openssl - $ conan create . user/channel + $ git clone https://github.com/conan-io/conan-center-index + $ cd conan-center-index/recipes/openssl/1.x.x + $ conan create . 1.1.1i@ Sharing a local folder with a Docker container @@ -50,8 +50,8 @@ You can share a local folder with your container, for example a project: .. code-block:: bash - $ git clone https://github.com/conan-community/conan-openssl - $ cd conan-openssl + $ git clone https://github.com/conan-io/conan-center-index + $ cd conan-center-index/recipes/openssl/1.x.x $ docker run -it -v$(pwd):/home/conan/project --rm conanio/gcc7 /bin/bash @@ -90,8 +90,8 @@ Building and uploading a package along with all its missing dependencies for ``L .. code-block:: bash - $ git clone https://github.com/conan-community/conan-openssl - $ cd conan-openssl + $ git clone https://github.com/conan-io/conan-center-index + $ cd conan-center-index/recipes/openssl/1.x.x $ docker run -it -v$(pwd):/home/conan/project --rm conanio/gcc49-armv7hf /bin/bash # Now we are running on the conangcc49-armv7hf container diff --git a/integrations/build_system/cmake/find_packages.rst b/integrations/build_system/cmake/find_packages.rst index 40a96d086df2..f9dd79e993de 100644 --- a/integrations/build_system/cmake/find_packages.rst +++ b/integrations/build_system/cmake/find_packages.rst @@ -85,5 +85,5 @@ Then repeat for the library names with CONAN_LIBS_XXX and the paths where the li self.copy("FindXXX.cmake", ".", ".") -.. _`conan's boost package`: https://github.com/conan-community/conan-boost.git -.. _`conan's zlib package`: https://github.com/conan-community/conan-zlib.git +.. _`conan's boost package`: https://github.com/conan-io/conan-center-index/tree/master/recipes/boost/all +.. _`conan's zlib package`: https://github.com/conan-io/conan-center-index/tree/master/recipes/zlib/1.2.11 diff --git a/integrations/ci/jenkins.rst b/integrations/ci/jenkins.rst index ce33e526d1c7..c521dae5392c 100644 --- a/integrations/ci/jenkins.rst +++ b/integrations/ci/jenkins.rst @@ -84,13 +84,15 @@ Example: Build a Conan package and upload it to Artifactory In this example we will call Conan :ref:`test package` command to create a binary packages and then upload it to Artifactory. We also upload the `build information`_: - + .. code-block:: groovy def artifactory_name = "artifactory" def artifactory_repo = "conan-local" - def repo_url = 'https://github.com/conan-community/conan-zlib.git' - def repo_branch = "release/1.2.11" + def repo_url = 'https://github.com/conan-io/conan-center-index.git' + def repo_branch = "master" + def recipe_folder = "recipes/zlib/1.2.11" + def recipe_version = "1.2.11" node { def server = Artifactory.server artifactory_name @@ -102,7 +104,9 @@ and then upload it to Artifactory. We also upload the `build information`_: } stage("Test recipe"){ - client.run(command: "create") + dir (recipe_folder) { + client.run(command: "create . ${recipe_version}@") + } } stage("Upload packages"){ diff --git a/integrations/cross_platform/buildroot.rst b/integrations/cross_platform/buildroot.rst index 10279706597b..f6dbfa4fdaac 100644 --- a/integrations/cross_platform/buildroot.rst +++ b/integrations/cross_platform/buildroot.rst @@ -117,8 +117,9 @@ Now let's go to the *conan-zlib.mk* that contains the Zlib data: CONAN_ZLIB_VERSION = 1.2.11 CONAN_ZLIB_LICENSE = Zlib CONAN_ZLIB_LICENSE_FILES = licenses/LICENSE - CONAN_ZLIB_SITE = $(call github,conan-community,conan-zlib,92d34d0024d64a8f307237f211e43ab9952ef0a1) + CONAN_ZLIB_SITE = $(call github,conan-io,conan-center-index,134dd3b84d629d27ba3474e01b688e9c0f25b9c8) CONAN_ZLIB_REFERENCE = zlib/$(CONAN_ZLIB_VERSION)@ + CONAN_ZLIB_SUBDIR = recipes/zlib/1.2.11 $(eval $(conan-package)) @@ -235,4 +236,4 @@ If you are interested in knowing more, we have a complete `blog post`_ about Bui .. _`Buildroot Project`: https://buildroot.org/ .. _`GPL-2.0-or-later`: https://spdx.org/licenses/GPL-2.0-or-later.html .. _`blog post`: https://blog.conan.io/2019/08/27/Creating-small-Linux-images-with-Buildroot.html -.. _`pkg-conan.mk`: https://github.com/conan-community/buildroot/blob/feature/conan/package/pkg-conan.mk \ No newline at end of file +.. _`pkg-conan.mk`: https://github.com/conan-io/examples/blob/features/buildroot/package/pkg-conan.mk diff --git a/reference/commands/output/user.rst b/reference/commands/output/user.rst index 9f68754b2b6a..4cc9406d8c14 100644 --- a/reference/commands/output/user.rst +++ b/reference/commands/output/user.rst @@ -30,7 +30,7 @@ List users per remote: :command:`conan user --json user.json` { "error":false, - "remotes":[ + "remotes":[ { "name":"conan-center", "user_name":"danimtb", @@ -41,11 +41,6 @@ List users per remote: :command:`conan user --json user.json` "user_name":null, "authenticated":false }, - { - "name":"conan-community", - "user_name":"danimtb", - "authenticated":true - }, { "name":"the_remote", "user_name":"foo", diff --git a/systems_cross_building/cross_building.rst b/systems_cross_building/cross_building.rst index 1d7854d4efe3..9c2ac69f92dc 100644 --- a/systems_cross_building/cross_building.rst +++ b/systems_cross_building/cross_building.rst @@ -591,13 +591,13 @@ RPI one: .. code-block:: bash - git clone https://github.com/conan-community/conan-zlib.git + git clone https://github.com/conan-io/conan-center-index.git - Call :command:`conan create` using the created profile. .. code-block:: bash - $ cd conan-zlib && conan create . -pr:h ../android_21_arm_clang -pr:b default + $ cd conan-center-index/recipes/zlib/1.2.11 && conan create . 1.2.11@ -pr:h ../android_21_arm_clang -pr:b default ... -- Build files have been written to: /tmp/conan-zlib/test_package/build/ba0b9dbae0576b9a23ce7005180b00e4fdef1198 @@ -623,7 +623,7 @@ integration section` in the documentation. - Check the :ref:`Creating conan packages to install dev tools` to learn more about how to create Conan packages for tools. - - Check the `mingw-installer `_ build require recipe as an example of packaging a compiler. + - Check the `msys2 `_ build require recipe as an example of packaging a compiler. From e2658e7f07b5c4002299ea8cd5f709c58b6c3b3a Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 20 Jan 2021 14:12:24 -0300 Subject: [PATCH 2/2] Remove Conan COmmunity from remotes Signed-off-by: Uilian Ries --- uploading_packages/remotes.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/uploading_packages/remotes.rst b/uploading_packages/remotes.rst index c939c426f221..1b365568c749 100644 --- a/uploading_packages/remotes.rst +++ b/uploading_packages/remotes.rst @@ -85,15 +85,6 @@ Bincrafters $ conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan -Conan Community -+++++++++++++++ - -.. warning:: - - The conan community repository is deprecated and no longer maintained. Packages in this repository - have been moved or are in the process of being added to `conan-center-index `_ - and served in `ConanCenter `_. - .. note:: If you are working in a team, you probably want to use the same remotes everywhere: developer machines, CI. The ``conan config install``