Add a gitlab macro
cover Add a gitlab macro
Hello,
Here is a small patch series that adds a gitlab macro, similar to the github macro. What prompted me to add this is a pending patch for a package, which uses gitlab, but does a git clone instead of relying on gitlab tarballs.
Hopefully, having a gitlab macro will make it more obvious how we prefer to handle things.
This series also has a preparation patch improving some details about the github macro.
Thanks,
Thomas
Thomas Petazzoni (7):
docs/manual: improve details about the Github macro package/pkg-download.mk: add gitlab macro docs/manual: add documentation for the gitlab macro package/eigen: use gitlab macro package/frotz: use gitlab macro package/ipcalc: use gitlab macro package/libsoundtouch: use gitlab macro
docs/manual/adding-packages-tips.txt | 40 ++++++++++++++++++++++++-- package/eigen/eigen.mk | 2 +- package/frotz/frotz.mk | 2 +- package/ipcalc/ipcalc.mk | 2 +- package/libsoundtouch/libsoundtouch.mk | 2 +- package/pkg-download.mk | 3 ++ 6 files changed, 45 insertions(+), 6 deletions(-)
Signature · 1 line
2.30.2
PATCH 1/7 docs/manual: improve details about the Github macro
The Github macro example shows something that is now considered
incorrect: using v1.0 as the VERSION. This is not longer recommended as it prevents from matching with release-monitoring.org details.
Let's update the example, and add a note to explain this in more details.
--- docs/manual/adding-packages-tips.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
docs/manual/adding-packages-tips.txt +8 -2
@@ -174,8 +174,8 @@ past, the 'github' helper function should be used as shown below. ------------------------ # Use a tag or a full commit ID -FOO_VERSION = v1.0 -FOO_SITE = $(call github,<user>,<package>,$(FOO_VERSION)) +FOO_VERSION = 1.0 +FOO_SITE = $(call github,<user>,<package>,v$(FOO_VERSION)) ------------------------ .Notes
@@ -184,6 +184,12 @@ FOO_SITE = $(call github,<user>,<package>,$(FOO_VERSION)) Buildroot (e.g.: +foo-f6fb6654af62045239caed5950bc6c7971965e60.tar.gz+), so it is not necessary to specify it in the +.mk+ file. - When using a commit ID as version, you should use the full 40 hex characters. +- When the tag contains a prefix such as +v+ in +v1.0+, then the + +VERSION+ variable should contain just +1.0+, and the +v+ should be + added directly in the +SITE+ variable, as illustrated above. This + ensures that the +VERSION+ variable value can be used to match + against http://www.release-monitoring.org/[release-monitoring.org] + results. If the package you wish to add does have a release section on GitHub, the maintainer may have uploaded a release tarball, or the release may just point
Signature · 1 line
2.30.2
PATCH 1/7 docs/manual: improve details about the Github macro
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
The Github macro example shows something that is now considered
incorrect: using v1.0 as the VERSION. This is not longer recommended as it prevents from matching with release-monitoring.org details.Let's update the example, and add a note to explain this in more details.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2020.02.x, 2020.11.x and 2021.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/7 package/pkg-download.mk: add gitlab macro
In reply to Thomas PetazzoniJust like we have a "github" macro to calculate the URL of the tarball to download source from Github, let's introduce a similar macro for Gitlab.
This should be used to download the auto-generated tarballs from Gitlab. If there is a specific release tarball uploaded by the upstream developers, the <pkg>_SITE variable should not use this new gitlab macro.
--- package/pkg-download.mk | 3 +++ 1 file changed, 3 insertions(+)
package/pkg-download.mk +3 -0
@@ -61,6 +61,9 @@ domainseparator = $(if $(1),$(1),/) # github(user,package,version): returns site of GitHub repository github = https://github.com/$(1)/$(2)/archive/$(3) +# gitlab(user,package,version): returns site of Gitlab-generated tarball +gitlab = https://gitlab.com/$(1)/$(2)/-/archive/$(3) + # Expressly do not check hashes for those files # Exported variables default to immediately expanded in some versions of # make, but we need it to be recursively-epxanded, so explicitly assign it.
Signature · 1 line
2.30.2
PATCH 2/7 package/pkg-download.mk: add gitlab macro
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Just like we have a "github" macro to calculate the URL of the tarball to download source from Github, let's introduce a similar macro for Gitlab.
Quoted 6 lines
This should be used to download the auto-generated tarballs from Gitlab. If there is a specific release tarball uploaded by the upstream developers, the <pkg>_SITE variable should not use this new gitlab macro.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2021.02.x for easier backporting in the future, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 3/7 docs/manual: add documentation for the gitlab macro
In reply to Thomas Petazzoni--- docs/manual/adding-packages-tips.txt | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
docs/manual/adding-packages-tips.txt +30 -0
@@ -210,3 +210,33 @@ image::github_hash_mongrel2.png[] - On the other hand, if there's is *only* the "Source code" link, then it's an automatically generated tarball and you should use the 'github' helper function. + +[[gitlab-download-url]] +==== How to add a package from Gitlab + +In a similar way to the +github+ macro described in +xref:github-download-url[], Buildroot also provides the +gitlab+ macro +to download from Gitlab repositories. It can be used to download +auto-generated tarballs produced by Gitlab, either for specific tags +or commits: + +------------------------ +# Use a tag or a full commit ID +FOO_VERSION = 1.0 +FOO_SITE = $(call gitlab,<user>,<package>,v$(FOO_VERSION)) +------------------------ + +By default, it will use a +.tar.gz+ tarball, but Gitlab also provides ++.tar.bz2+ tarballs, so by adding a +<pkg>_SOURCE+ variable, this ++.tar.bz2+ tarball can be used: + +------------------------ +# Use a tag or a full commit ID +FOO_VERSION = 1.0 +FOO_SITE = $(call gitlab,<user>,<package>,v$(FOO_VERSION)) +FOO_SOURCE = foo-$(FOO_VERSION).tar.bz2 +------------------------ + +If there is a specific tarball uploaded by the upstream developers in ++https://gitlab.com/<project>/releases/+, do not use this macro, but +rather use directly the link to the tarball.
Signature · 1 line
2.30.2
PATCH 3/7 docs/manual: add documentation for the gitlab macro
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2021.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 4/7 package/eigen: use gitlab macro
In reply to Thomas Petazzoni--- package/eigen/eigen.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/eigen/eigen.mk +1 -1
@@ -6,7 +6,7 @@ EIGEN_VERSION = 3.3.7 EIGEN_SOURCE = eigen-$(EIGEN_VERSION).tar.bz2 -EIGEN_SITE = https://gitlab.com/libeigen/eigen/-/archive/$(EIGEN_VERSION) +EIGEN_SITE = $(call gitlab,libeigen,eigen,$(EIGEN_VERSION)) EIGEN_LICENSE = MPL2, BSD-3-Clause, LGPL-2.1 EIGEN_LICENSE_FILES = COPYING.MPL2 COPYING.BSD COPYING.LGPL COPYING.README EIGEN_INSTALL_STAGING = YES
Signature · 1 line
2.30.2
PATCH 4/7 package/eigen: use gitlab macro
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2021.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 5/7 package/frotz: use gitlab macro
In reply to Thomas Petazzoni--- package/frotz/frotz.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/frotz/frotz.mk +1 -1
@@ -6,7 +6,7 @@ FROTZ_VERSION = 2.53 FROTZ_SOURCE = frotz-$(FROTZ_VERSION).tar.bz2 -FROTZ_SITE = https://gitlab.com/DavidGriffith/frotz/-/archive/$(FROTZ_VERSION) +FROTZ_SITE = $(call gitlab,DavidGriffith,frotz,$(FROTZ_VERSION)) FROTZ_DEPENDENCIES = host-pkgconf ncurses FROTZ_LICENSE = GPL-2.0+ FROTZ_LICENSE_FILES = COPYING
Signature · 1 line
2.30.2
PATCH 5/7 package/frotz: use gitlab macro
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2021.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 6/7 package/ipcalc: use gitlab macro
In reply to Thomas Petazzoni--- package/ipcalc/ipcalc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/ipcalc/ipcalc.mk +1 -1
@@ -5,7 +5,7 @@ ################################################################################ IPCALC_VERSION = 1.0.0 -IPCALC_SITE = https://gitlab.com/ipcalc/ipcalc/-/archive/$(IPCALC_VERSION) +IPCALC_SITE = $(call gitlab,ipcalc,ipcalc,$(IPCALC_VERSION)) IPCALC_SOURCE = ipcalc-$(IPCALC_VERSION).tar.bz2 IPCALC_LICENSE = GPL-2.0+ IPCALC_LICENSE_FILES = COPYING
Signature · 1 line
2.30.2
PATCH 6/7 package/ipcalc: use gitlab macro
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2021.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 7/7 package/libsoundtouch: use gitlab macro
In reply to Thomas Petazzoni--- package/libsoundtouch/libsoundtouch.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/libsoundtouch/libsoundtouch.mk +1 -1
@@ -5,7 +5,7 @@ ################################################################################ LIBSOUNDTOUCH_VERSION = 2.2 -LIBSOUNDTOUCH_SITE = https://gitlab.com/soundtouch/soundtouch/-/archive/$(LIBSOUNDTOUCH_VERSION) +LIBSOUNDTOUCH_SITE = $(call gitlab,soundtouch,soundtouch,$(LIBSOUNDTOUCH_VERSION)) LIBSOUNDTOUCH_LICENSE = LGPL-2.1+ LIBSOUNDTOUCH_LICENSE_FILES = COPYING.TXT LIBSOUNDTOUCH_AUTORECONF = YES
Signature · 1 line
2.30.2
PATCH 7/7 package/libsoundtouch: use gitlab macro
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2021.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
cover Add a gitlab macro
In reply to Thomas PetazzoniThomas, All,
On 2021-03-28 21:13 +0200, Thomas Petazzoni spake thusly:
Quoted 4 lines
Here is a small patch series that adds a gitlab macro, similar to the github macro. What prompted me to add this is a pending patch for a package, which uses gitlab, but does a git clone instead of relying on gitlab tarballs.
Although tht is my personal preferenc, to use the git download backend for git-hosted source, rather than use remotely generated tarballs, I've still applied the entire series as-is, because that makes gitlab on-par with github, and the consensus among mantainers was not clear-cut.
Still, I'd like to remind everyone that git trees are cached lcoally, which may make for a slower first-step, but is supposed to gfreatly increase subsequent downloads and updates. The local git cache has been quite some work, and not usign it is quite a bit of a waste..
Anyway: entire series applied, thanks!
Regards,
Yann E. MORIN.
Quoted 34 lines
Hopefully, having a gitlab macro will make it more obvious how we prefer to handle things.
This series also has a preparation patch improving some details about the github macro.
Thanks,
Thomas
Thomas Petazzoni (7):
docs/manual: improve details about the Github macropackage/pkg-download.mk: add gitlab macro docs/manual: add documentation for the gitlab macro package/eigen: use gitlab macro package/frotz: use gitlab macro package/ipcalc: use gitlab macro package/libsoundtouch: use gitlab macrodocs/manual/adding-packages-tips.txt | 40 ++++++++++++++++++++++++-- package/eigen/eigen.mk | 2 +- package/frotz/frotz.mk | 2 +- package/ipcalc/ipcalc.mk | 2 +- package/libsoundtouch/libsoundtouch.mk | 2 +- package/pkg-download.mk | 3 ++ 6 files changed, 45 insertions(+), 6 deletions(-)Signature · 6 lines
2.30.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'