Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 2009 17:37:35 GMT
From:      Stef Walter <stef@memberwebs.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/139993: [patch] Make git dependencies optional.
Message-ID:  <200910261737.n9QHbZk8003883@www.freebsd.org>
Resent-Message-ID: <200910261740.n9QHe1kS087835@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         139993
>Category:       ports
>Synopsis:       [patch] Make git dependencies optional.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 26 17:40:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Stef Walter
>Release:        7.2-RELEASE
>Organization:
>Environment:
FreeBSD dev-test2.ws.local 7.2-RELEASE-p4 FreeBSD 7.2-RELEASE-p4 #2: Sat Oct  3 02:36:12 UTC 2009     root@dev-test2.ws.local:/usr/obj/usr/src/sys/DEVTEST2  amd64

>Description:
When using git as a deployment mechanism, I'd like to be able to have minimal dependencies installed on the production system. The git developers have made git so every dependency is optional. 

This patch adds options to the port, so that with 'make config' you can choose to not install any dependencies. The following options were added:

                PERL "Build perl based git tools" on \
                ICONV "Support for multiple character encodings" on \
                CURL "Support HTTP push and pull" on \

The options default to the previous state of affairs, so ports users will by default get a git that works exactly like before.

Thanks in advance for considering this patch. Please let me know if additional changes are necessary. I'd love to help you get this into FreeBSD ports.

Some points about the patch: 
 * When git is built without perl support, stubs are installed for all 
   perl dependent commands, so the packaging does not change greatly 
   with or without perl.
 * When git is built without curl support, three commands are not 
   installed. Packaging changes slightly.
 * When git is built without curl support, the expat dependency is no 
   longer needed.
 * When git is built without iconv support, nothing changes in the 
   packaging. And obviously UTF-8 support is still present. 

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- ./Makefile.orig	2009-10-26 17:01:23.000000000 +0000
+++ ./Makefile	2009-10-26 17:17:18.000000000 +0000
@@ -20,11 +20,4 @@
 COMMENT=	Distributed source code management tool
 
-BUILD_DEPENDS=	curl:${PORTSDIR}/ftp/curl \
-		${SITE_PERL}/Error.pm:${PORTSDIR}/lang/p5-Error
-RUN_DEPENDS=	curl:${PORTSDIR}/ftp/curl \
-		${SITE_PERL}/Error.pm:${PORTSDIR}/lang/p5-Error \
-		${SITE_PERL}/Net/SMTP/SSL.pm:${PORTSDIR}/mail/p5-Net-SMTP-SSL
-LIB_DEPENDS=	expat.6:${PORTSDIR}/textproc/expat2
-
 MAKE_JOBS_SAFE=	yes
 
@@ -154,5 +147,4 @@
 		git-whatchanged.1 \
 		git-write-tree.1
-MAN3=		Git.3
 MAN5=		gitattributes.5 \
 		githooks.5 \
@@ -171,14 +163,7 @@
 
 USE_BZIP2=	yes
-USE_PERL5=	yes
-USE_ICONV=	yes
 USE_GMAKE=	yes
 CFLAGS+=	-I${LOCALBASE}/include -L${LOCALBASE}/lib
-MAKE_ENV+=	CURLDIR=${LOCALBASE} \
-		NEEDS_LIBICONV=yes \
-		OLD_ICONV=yes \
-		PERL_PATH=${PERL} \
-		LIBMD_SHA1=yes \
-		ICONVDIR=${LOCALBASAE} \
+MAKE_ENV+=	LIBMD_SHA1=yes \
 		V=1
 MAKE_ARGS+=	prefix="${PREFIX}"
@@ -188,5 +173,8 @@
 SHELLS=		/etc/shells
 
-OPTIONS=	GUI "Enable building of GUI tools" off \
+OPTIONS=	PERL "Build perl based git tools" on \
+		ICONV "Support for multiple character encodings" on \
+		CURL "Support HTTP push and pull" on \
+		GUI "Enable building of GUI tools" off \
 		SVN "Enable required dependencies for SVN tools" off \
 		GITWEB "Install gitweb" off \
@@ -197,4 +185,37 @@
 .include <bsd.port.pre.mk>
 
+.ifdef (WITH_PERL)
+USE_PERL5=	yes
+MAKE_ENV+=	PERL_PATH=${PERL}
+BUILD_DEPENDS+=	${SITE_PERL}/Error.pm:${PORTSDIR}/lang/p5-Error
+RUN_DEPENDS+=	${SITE_PERL}/Error.pm:${PORTSDIR}/lang/p5-Error \
+		${SITE_PERL}/Net/SMTP/SSL.pm:${PORTSDIR}/mail/p5-Net-SMTP-SSL
+MAN3=		Git.3
+.else
+MAKE_ENV+=	NO_PERL=1
+PLIST_SUB+=	SITE_PERL="@comment "
+.endif
+
+.ifdef (WITH_ICONV)
+USE_ICONV=	yes
+MAKE_ENV+=	NEEDS_LIBICONV=yes \
+		OLD_ICONV=yes \
+		ICONVDIR=${LOCALBASE}
+.else
+MAKE_ENV+=	NO_ICONV=1
+.endif
+
+.ifdef (WITH_CURL)
+MAKE_ENV+=	CURLDIR=${LOCALBASE}
+BUILD_DEPENDS+=	curl:${PORTSDIR}/ftp/curl
+RUN_DEPENDS+=	curl:${PORTSDIR}/ftp/curl
+LIB_DEPENDS+=	expat.6:${PORTSDIR}/textproc/expat2
+PLIST_SUB+=	CURL=""
+.else
+MAKE_ENV+=	NO_CURL=1 \
+		NO_EXPAT=1
+PLIST_SUB+=	CURL="@comment "
+.endif
+
 .ifdef (WITH_HTMLDOCS)
 RUN_DEPENDS+=	${LOCALBASE}/bin/asciidoc:${PORTSDIR}/textproc/asciidoc \
--- ./pkg-plist.orig	2009-10-26 17:17:24.000000000 +0000
+++ ./pkg-plist	2009-10-26 17:22:50.000000000 +0000
@@ -63,6 +63,6 @@
 libexec/git-core/git-hash-object
 libexec/git-core/git-help
-libexec/git-core/git-http-fetch
-libexec/git-core/git-http-push
+%%CURL%%libexec/git-core/git-http-fetch
+%%CURL%%libexec/git-core/git-http-push
 libexec/git-core/git-imap-send
 libexec/git-core/git-index-pack
@@ -112,5 +112,5 @@
 libexec/git-core/git-relink
 libexec/git-core/git-remote
-libexec/git-core/git-remote-curl
+%%CURL%%libexec/git-core/git-remote-curl
 libexec/git-core/git-repack
 libexec/git-core/git-repo-config
@@ -738,5 +738,5 @@
 %%HTMLDOCS%%@dirrm %%DOCSDIR%%
 @dirrm libexec/git-core
-@dirrm share/git-core/templates/branches
+@dirrmtry share/git-core/templates/branches
 @dirrmtry share/git-core/templates/hooks
 @dirrm share/git-core/templates/info


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910261737.n9QHbZk8003883>