subversion: add the external find feature using svn (#28862)

This commit is contained in:
Olivier Cessenat 2022-02-11 09:40:29 +01:00 committed by GitHub
parent a45c7c185b
commit 5b71839127
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
from spack import * from spack import *
@ -42,6 +44,8 @@ class Subversion(AutotoolsPackage):
depends_on('swig@1.3.24:3.0.0', when='+perl') depends_on('swig@1.3.24:3.0.0', when='+perl')
depends_on('perl-termreadkey', when='+perl') depends_on('perl-termreadkey', when='+perl')
executables = [r'^svn$']
# https://www.linuxfromscratch.org/blfs/view/svn/general/subversion.html # https://www.linuxfromscratch.org/blfs/view/svn/general/subversion.html
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
@ -108,3 +112,9 @@ def install(self, spec, prefix):
with working_dir(join_path( with working_dir(join_path(
'subversion', 'bindings', 'swig', 'perl', 'native')): 'subversion', 'bindings', 'swig', 'perl', 'native')):
make('install') make('install')
@classmethod
def determine_version(cls, exe):
output = Executable(exe)('--version', output=str, error=str)
match = re.search(r'^svn, version\s+([\d\.]+)', output)
return match.group(1) if match else None