git: make expat and curl into PACKAGECONFIG items

Message ID 20220330104615.3178842-1-rasmus.villemoes@prevas.dk
State Accepted, archived
Commit 49f81198c5d233a9a2612c3b8366681dd85bea59
Headers show
Series git: make expat and curl into PACKAGECONFIG items | expand

Commit Message

Rasmus Villemoes March 30, 2022, 10:46 a.m. UTC
It can be useful to use git on target (e.g. with some wrapper like
etckeeper for keeping track of changes to /etc), and for such cases,
it is likely one has no need for pulling from/pushing to http[s]
repositories. From the INSTALL file:

    - "libcurl" library ... If you do not use http:// or https://
      repositories, and do not want to put patches into an IMAP
      mailbox, you do not have to have them (use NO_CURL).

    - "expat" library; git-http-push uses it for remote lock
      management over DAV.  Similar to "curl" above, this is
      optional (with NO_EXPAT).

Setting --without-expat and --without-curl reduces the size of the
installed "git" package from 18M to 12M, in addition to avoiding
pulling those libraries into the rootfs.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 meta/recipes-devtools/git/git_2.35.1.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-devtools/git/git_2.35.1.bb b/meta/recipes-devtools/git/git_2.35.1.bb
index 0cff3ce1001..47c22118640 100644
--- a/meta/recipes-devtools/git/git_2.35.1.bb
+++ b/meta/recipes-devtools/git/git_2.35.1.bb
@@ -3,7 +3,7 @@  HOMEPAGE = "http://git-scm.com"
 DESCRIPTION = "Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency."
 SECTION = "console/utils"
 LICENSE = "GPL-2.0-only"
-DEPENDS = "openssl curl zlib expat"
+DEPENDS = "openssl zlib"
 
 PROVIDES:append:class-native = " git-replacement-native"
 
@@ -18,10 +18,12 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
 
 CVE_PRODUCT = "git-scm:git"
 
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "expat curl"
 PACKAGECONFIG[cvsserver] = ""
 PACKAGECONFIG[svn] = ""
 PACKAGECONFIG[manpages] = ",,asciidoc-native xmlto-native"
+PACKAGECONFIG[curl] = "--with-curl,--without-curl,curl"
+PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat"
 
 EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
 		--without-tcltk \