{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4478","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4478/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4478/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4478/events","html_url":"https://github.com/RIOT-OS/RIOT/pull/4478","id":122213129,"number":4478,"title":"make: add remote packages / \"package management\"","user":{"login":"Kijewski","id":136776,"avatar_url":"https://avatars.githubusercontent.com/u/136776?v=3","gravatar_id":"","url":"https://api.github.com/users/Kijewski","html_url":"https://github.com/Kijewski","followers_url":"https://api.github.com/users/Kijewski/followers","following_url":"https://api.github.com/users/Kijewski/following{/other_user}","gists_url":"https://api.github.com/users/Kijewski/gists{/gist_id}","starred_url":"https://api.github.com/users/Kijewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kijewski/subscriptions","organizations_url":"https://api.github.com/users/Kijewski/orgs","repos_url":"https://api.github.com/users/Kijewski/repos","events_url":"https://api.github.com/users/Kijewski/events{/privacy}","received_events_url":"https://api.github.com/users/Kijewski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/API%20CHANGE","name":"API CHANGE","color":"e11d21"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/major","name":"major","color":"ff0000"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/make","name":"make","color":"bfdadc"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Request%20for%20Comments","name":"Request for Comments","color":"23F823"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-15T07:41:40Z","updated_at":"2015-12-15T10:05:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4478","html_url":"https://github.com/RIOT-OS/RIOT/pull/4478","diff_url":"https://github.com/RIOT-OS/RIOT/pull/4478.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/4478.patch"},"body":"This PR is meant to replace the current `USE_PKG` system.\r\nInstead with `REMOTE_PKG` a new option added to load decentralized\r\nmodules, that could live in some Git project, a local folder or some\r\nsimilar place.\r\nThe PR is inspired by package managers such as pip or npm.\r\n\r\nIn your project's Makefile you could add a line such as\r\n\r\n```Makefile\r\nREMOTE_PKG += some_module\r\n```\r\n\r\nwhich would clone `https://github.com/RIOT-OS/some_module.git`, checkout\r\nit's `master`. The revision can be overridden, too: `some_module@devel`\r\nor `some_module@1234ab`.\r\nIf `https://github.com/RIOT-OS/` is the right place for such modules is\r\nsubject for discussions.\r\n\r\nThe allow further decentralization, you can add another Git remote URL:\r\n\r\n```Makefile\r\nREMOTE_PKG += git+http://repos.example.com/some_module.git\r\nREMOTE_PKG += git+my_account@repos.example.com:some_module.git\r\n```\r\n\r\nalso with the option to add a revision / branch / tag.\r\n\r\nLast but not least you can add local paths:\r\n\r\n```Makefile\r\nREMOTE_PKG += ./../modules/some_module\r\nREMOTE_PKG += /usr/local/shared/riot-modules/some_module\r\nREMOTE_PKG += local+C:/User/Default/Documents/riot-modules/some_module\r\n```\r\n\r\nbut of course without a revision.\r\n\r\nAdding options for Mercurial, Bazaar, SVN, something, would be trivial.\r\n\r\nThe checked out project needs to contain an executable file\r\n`./riot-pkg`, which prints lines to STDOUT with are included in the\r\nMakefile. The easiest and probably most common `riot-pkg` will contain:\r\n\r\n```sh\r\n#!/bin/sh\r\necho \"DIRS += $(dirname \"$(readlink -f \"$0\")\")\"\r\necho \"USEMODULE += some_module\"\r\n```\r\n\r\nMore complicated `riot-pkg`s will download remote data, apply patches or\r\ndo similar setup tasks.\r\n\r\nThe advantage of the proposed system over the current `USEPKG` system is\r\nthat everybody who's interested could easily share RIOT modules without\r\nus needed to \"approve\" it. Library authors might find it easier to\r\ncontribute to RIOT because sharing the library is done effectively\r\nimmediately after they pushed to their module repository.\r\nFurthermore changes to that libraries that are not part of RIOT won't\r\nclutter out changelog. Excessive patch files might not be needed\r\nanymore: just fork the other repo and apply the changes directly.\r\n\r\nDisadvantages are that there could be ugly modules that contain the name\r\nRIOT and could damage RIOT's reputation. As everybody is already free to\r\nfork RIOT, I guess this could happen anyway.\r\nMore disadvantageous is the lack of a version relationship between\r\nRIOT's \"core\" and the remote modules. It could be forgotten to check the\r\nmodules against the newest changes to RIOT or the module could require\r\nthe rolling version of RIOT instead of the last tagged version.\r\nBut there the option to specify a version number in the `REMOTE_PKG +=\r\n...` line will come in handy. Could be that you want to use the tagged\r\nRIOT version but a bleeding edge version of the module."},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/164710731","html_url":"https://github.com/RIOT-OS/RIOT/pull/4478#issuecomment-164710731","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4478","id":164710731,"user":{"login":"kaspar030","id":4679640,"avatar_url":"https://avatars.githubusercontent.com/u/4679640?v=3","gravatar_id":"","url":"https://api.github.com/users/kaspar030","html_url":"https://github.com/kaspar030","followers_url":"https://api.github.com/users/kaspar030/followers","following_url":"https://api.github.com/users/kaspar030/following{/other_user}","gists_url":"https://api.github.com/users/kaspar030/gists{/gist_id}","starred_url":"https://api.github.com/users/kaspar030/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaspar030/subscriptions","organizations_url":"https://api.github.com/users/kaspar030/orgs","repos_url":"https://api.github.com/users/kaspar030/repos","events_url":"https://api.github.com/users/kaspar030/events{/privacy}","received_events_url":"https://api.github.com/users/kaspar030/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T10:05:38Z","updated_at":"2015-12-15T10:05:38Z","body":"Nice!\r\n\r\n> More disadvantageous is the lack of a version relationship between\r\n> RIOT's \"core\" and the remote modules.\r\n\r\nA specific pkg version has to be anchored somewhere in the RIOT tree, otherwise it is impossible to rebuild a RIOT commit, if parts of the tree (a pkg) can change externally.\r\n"}}