Date: Mon, 26 Oct 2009 14:37:25 -0600 From: Stef Walter <stef-list@memberwebs.com> To: wxs@FreeBSD.org, freebsd-ports@freebsd.org Subject: [patch] Make git dependencies optional. Message-ID: <4AE60885.1040103@memberwebs.com>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------030805040303090005070208 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks for your work on the git port. 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. 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. PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=139993 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. Cheers, Stef --------------030805040303090005070208 Content-Type: text/x-diff; name="git-port-optional-dependencies.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="git-port-optional-dependencies.patch" --- ./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 --------------030805040303090005070208--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AE60885.1040103>