From fd6d2265244b2b326d9c8fbe223e80595d472374 Mon Sep 17 00:00:00 2001 From: Jennifer Green Date: Thu, 5 May 2022 03:08:51 -0600 Subject: git: adding subtree support, post-install step, reordered deps (#30400) --- var/spack/repos/builtin/packages/git/package.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/git/package.py b/var/spack/repos/builtin/packages/git/package.py index d60dd9d1bf..5f53851ed3 100644 --- a/var/spack/repos/builtin/packages/git/package.py +++ b/var/spack/repos/builtin/packages/git/package.py @@ -17,6 +17,7 @@ class Git(AutotoolsPackage): homepage = "http://git-scm.com" url = "https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.12.0.tar.gz" + maintainers = ['jennfshr'] tags = ['build-tools'] @@ -137,7 +138,13 @@ class Git(AutotoolsPackage): description='Enable native language support') variant('man', default=True, description='Install manual pages') + variant('subtree', default=True, + description='Add git-subtree command and capability') + depends_on('autoconf', type='build') + depends_on('automake', type='build') + depends_on('libtool', type='build') + depends_on('m4', type='build') depends_on('curl') depends_on('expat') depends_on('gettext', when='+nls') @@ -149,13 +156,8 @@ class Git(AutotoolsPackage): depends_on('perl', when='+perl') depends_on('zlib') depends_on('openssh', type='run') - - depends_on('autoconf', type='build') - depends_on('automake', type='build') - depends_on('libtool', type='build') - depends_on('m4', type='build') - depends_on('tk', type=('build', 'link'), when='+tcltk') depends_on('perl-alien-svn', type='run', when='+svn') + depends_on('tk', type=('build', 'link'), when='+tcltk') conflicts('+svn', when='~perl') @@ -277,6 +279,16 @@ class Git(AutotoolsPackage): install_tree('man5', prefix.share.man.man5) install_tree('man7', prefix.share.man.man7) + @run_after('install') + def install_subtree(self): + if '+subtree' in self.spec: + with working_dir('contrib/subtree'): + make_args = ['V=1', 'prefix={}'.format(self.prefix.bin)] + make(" ".join(make_args)) + install_args = ['V=1', 'prefix={}'.format(self.prefix.bin), 'install'] + make(" ".join(install_args)) + install('git-subtree', self.prefix.bin) + def setup_run_environment(self, env): # Setup run environment if using SVN extension # Libs from perl-alien-svn and apr-util are required in -- cgit v1.2.3-70-g09d2