{"id":20249599,"url":"https://github.com/jonico/zenofgithub","last_synced_at":"2025-03-03T16:15:37.208Z","repository":{"id":147879643,"uuid":"92800376","full_name":"jonico/zenofgithub","owner":"jonico","description":"Example C application consuming multiple conan.io packages","archived":false,"fork":false,"pushed_at":"2021-08-04T09:41:59.000Z","size":69,"stargazers_count":18,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-14T02:32:23.974Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonico.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-30T05:14:09.000Z","updated_at":"2023-08-27T00:31:55.000Z","dependencies_parsed_at":"2023-05-27T19:00:11.100Z","dependency_job_id":null,"html_url":"https://github.com/jonico/zenofgithub","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonico%2Fzenofgithub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonico%2Fzenofgithub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonico%2Fzenofgithub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonico%2Fzenofgithub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonico","download_url":"https://codeload.github.com/jonico/zenofgithub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241696182,"owners_count":20004748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T09:54:37.175Z","updated_at":"2025-03-03T16:15:37.201Z","avatar_url":"https://github.com/jonico.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zenofgithub - how to consume portable [conan.io](https://www.conan.io/) C/C++ packages, like [libzengithub](https://github.com/jonico/libzengithub), [libgit2](https://github.com/paulobrizolara/libgit2-conan) and [libcurl](https://github.com/lasote/conan-libcurl) and build on multiple platforms\n\n[![Build zenofgithub on main platforms](https://github.com/jonico/zenofgithub/actions/workflows/build.yaml/badge.svg)](https://github.com/jonico/zenofgithub/actions/workflows/build.yaml)\n\n```zenofgithub``` is a small C application that prints out a random [Zen of Github](http://ben.balter.com/2015/08/12/the-zen-of-github/) whenever you call it from a directory that contains a Git repository:\n\n```\n./zenofgithub\n```\n\nwill provide you something like\n\n```\n               MMM.           .MMM\n               MMMMMMMMMMMMMMMMMMM\n               MMMMMMMMMMMMMMMMMMM      _________________________________________\n              MMMMMMMMMMMMMMMMMMMMM    |                                         |\n             MMMMMMMMMMMMMMMMMMMMMMM   | Anything added dilutes everything else. |\n            MMMMMMMMMMMMMMMMMMMMMMMM   |_   _____________________________________|\n            MMMM::- -:::::::- -::MMMM    |/\n             MM~:~ 00~:::::~ 00~:~MM\n        .. MMMMM::.00:::+:::.00::MMMMM ..\n              .MM::::: ._. :::::MM.\n                 MMMM;:::::;MMMM\n          -MM        MMMMMMM\n          ^  M+     MMMMMMMMM\n              MMMMMMM MM MM MM\n                   MM MM MM MM\n                   MM MM MM MM\n                .~~MM~MM~MM~MM~~.\n             ~~~~MM:~MM~~~MM~:MM~~~~\n            ~~~~~~==~==~~~==~==~~~~~~\n             ~~~~~~==~==~==~==~~~~~~\n                 :~==~==~==~==~~\n```\n\nif you are in a Git repo and\n\n```\nYou're not in a git repo so the octocat will stay silent.\nCreate a git repo and the Zen of GitHub will be revealed to you.\n```\n\nif you are not in a Git repo.\n\n# But why?\n\nThe main purpose of this application is to demo how you can use the portable [conan.io](https://www.conan.io/) package manager to declare (and easily consume) C/C++ dependencies no matter whether you are running on Windows, Linux or Mac.\n\nThis small demo application consumes a lot of packages, like [ZenGithub](https://github.com/jonico/libzengithub), [libgit2](https://github.com/paulobrizolara/libgit2-conan), [libbzip2](https://github.com/lasote/conan-bzip2) and their transitive dependencies:\n\n```\nconan info . --graph deps.html\nopen deps.html\n```\n![image](https://user-images.githubusercontent.com/1872314/38521399-d34b0052-3c45-11e8-992b-7241793fe1a3.png)\n\nThe only thing to consume all those dependencies is to have a [conanfile.txt](https://github.com/jonico/zenofgithub/blob/master/conanfile.txt) which is referencing the versions you want:\n\n```\n[requires]\nZenGitHub/1.0@jonico/stable\nlibgit2/0.26.0@jonico/stable\n```\n\nconan.io takes care of the rest, downloads the dependencies from your conan.io remotes and if it cannot find appropriate binaries for your architecture, download the build recipe and build locally.\n\nIf you look into [conanfile-semver.txt](https://github.com/jonico/zenofgithub/blob/master/conanfile-semver.txt), you can also see an example how you can use [semantic versioning](http://conanio.readthedocs.io/en/latest/mastering/version_ranges.html) while specifying your package dependencies:\n\n```\n[requires]\nZenGitHub/[\u003e0.9\u003c1.2 || 0.8]@jonico/stable # In such range, OR’ing possible\nlibgit2/[~=0.26.0]@jonico/stable # Compatible according to semantic versioning\n```\n\n# Building the package\n\n## Basic setup\n\nFirst, [install](http://docs.conan.io/en/latest/installation.html) the conan package manager locally.\nThen, add the remote to my conan bintray repo where the [ZenGithub](https://github.com/jonico/libzengithub) package is stored:\n\n```\nconan remote add conan-jonico https://jonico.jfrog.io/artifactory/api/conan/libzengithub-conan\n```\n\nThen, clone this repository and cd into it:\n\n```\ngit clone https://github.com/jonico/zenofgithub.git \u0026\u0026 cd zenofgithub\n```\n\nAfter that, create a build subdirectory and cd into it:\n\n```\nmkdir build \u0026\u0026 cd build\n```\n\n## Installing dependent conan packages\n\nNow you can let conan do the work and install all needed dependencies and generates the files *conanbuildinfo.txt* and *conanbuildinfo.cmake* with all the paths and variables that we need to link with our dependencies.\n\n`\nconan install ..\n`\n\nIf conan complains about missing dependencies (like ZenGitHub, libCurl or libz or OpenSSL), this is an indication that we do not have a pre-built version of those packages for your architecture. Don't worry, this is how you can build anything missing on your local machine instead:\n\n```\nconan install .. --build missing\n```\n\nIf you rather want to link statically against libcurl (or other libraries), run\n\n```\nconan install .. -o libcurl:shared=False --build missing\n```\n\n## Generating Makefile, compile and link\n\nNow, that all dependencies are satisfied and *conanbuildinfo.txt* and *conanbuildinfo.cmake* are generated, we just have to create the Makefile using cmake (or any other [generator](http://conanio.readthedocs.io/en/latest/reference/generators.html?highlight=generator) of your choice).\n\nFor Linux and Mac, run\n\n```\ncmake .. -G \"Unix Makefiles\" -DCMAKE_BUILD_TYPE=Release\ncmake --build .\n```\n\nFor Windows, run\n\n```\ncmake .. -G \"Visual Studio 14 Win64\"\ncmake --build . --config Release\n```\n\nAfter that, you can finally run our small program:\n\n```\ncd bin\n./zenofgithub\n```\n\nIf the :octocat: does not reveal a Zen of GitHub yet, you have to switch to a Git repo or create one:\n\n```\ngit init\n./zenofgithub\n\n               MMM.           .MMM\n               MMMMMMMMMMMMMMMMMMM\n               MMMMMMMMMMMMMMMMMMM      _______________________________________\n              MMMMMMMMMMMMMMMMMMMMM    |                                       |\n             MMMMMMMMMMMMMMMMMMMMMMM   | Non-blocking is better than blocking. |\n            MMMMMMMMMMMMMMMMMMMMMMMM   |_   ___________________________________|\n            MMMM::- -:::::::- -::MMMM    |/\n             MM~:~ 00~:::::~ 00~:~MM\n        .. MMMMM::.00:::+:::.00::MMMMM ..\n              .MM::::: ._. :::::MM.\n                 MMMM;:::::;MMMM\n          -MM        MMMMMMM\n          ^  M+     MMMMMMMMM\n              MMMMMMM MM MM MM\n                   MM MM MM MM\n                   MM MM MM MM\n                .~~MM~MM~MM~MM~~.\n             ~~~~MM:~MM~~~MM~:MM~~~~\n            ~~~~~~==~==~~~==~==~~~~~~\n             ~~~~~~==~==~==~==~~~~~~\n                 :~==~==~==~==~~\n```\n\nEnjoy :octocat::heart:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonico%2Fzenofgithub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonico%2Fzenofgithub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonico%2Fzenofgithub/lists"}