diffutils: added support for external detection (#19344)
This commit is contained in:
parent
4b9701a195
commit
d34b612052
1 changed files with 10 additions and 0 deletions
|
@ -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 *
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +12,8 @@ class Diffutils(AutotoolsPackage, GNUMirrorPackage):
|
||||||
"""GNU Diffutils is a package of several programs related to finding
|
"""GNU Diffutils is a package of several programs related to finding
|
||||||
differences between files."""
|
differences between files."""
|
||||||
|
|
||||||
|
executables = [r'^diff$']
|
||||||
|
|
||||||
homepage = "https://www.gnu.org/software/diffutils/"
|
homepage = "https://www.gnu.org/software/diffutils/"
|
||||||
gnu_mirror_path = "diffutils/diffutils-3.7.tar.xz"
|
gnu_mirror_path = "diffutils/diffutils-3.7.tar.xz"
|
||||||
|
|
||||||
|
@ -24,3 +28,9 @@ def setup_build_environment(self, env):
|
||||||
if self.spec.satisfies('%fj'):
|
if self.spec.satisfies('%fj'):
|
||||||
env.append_flags('CFLAGS',
|
env.append_flags('CFLAGS',
|
||||||
'-Qunused-arguments')
|
'-Qunused-arguments')
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def determine_version(cls, exe):
|
||||||
|
output = Executable(exe)('--version', output=str, error=str)
|
||||||
|
match = re.search(r'diff \(GNU diffutils\) (\S+)', output)
|
||||||
|
return match.group(1) if match else None
|
||||||
|
|
Loading…
Reference in a new issue