From a15448eae8cb1c9065b37c0fd122d476e3b6c898 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Sat, 21 Jan 2023 11:27:56 +0100 Subject: gmake: bootstrap without make (#35050) --- var/spack/repos/builtin/packages/gmake/package.py | 28 ++++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/var/spack/repos/builtin/packages/gmake/package.py b/var/spack/repos/builtin/packages/gmake/package.py index 919b33527e..5fe49b28cf 100644 --- a/var/spack/repos/builtin/packages/gmake/package.py +++ b/var/spack/repos/builtin/packages/gmake/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os import re from spack.build_environment import MakeExecutable, determine_number_of_jobs @@ -24,14 +25,14 @@ class Gmake(AutotoolsPackage, GNUMirrorPackage): version("4.0", sha256="fc42139fb0d4b4291929788ebaf77e2a4de7eaca95e31f3634ef7d4932051f69") variant("guile", default=False, description="Support GNU Guile for embedded scripting") - variant("nls", default=True, description="Enable Native Language Support") - depends_on("gettext", when="+nls") - depends_on("guile", when="+guile") + with when("+guile"): + depends_on("guile@:2.0", when="@:4.2") + depends_on("guile@:3.0") + depends_on("pkgconfig", type="build") - depends_on("texinfo", type="build") - - build_directory = "spack-build" + # build.sh requires it in 4.0 (SV 40254) + conflicts("~guile", when="@4.0") patch( "https://src.fedoraproject.org/rpms/make/raw/519a7c5bcbead22e6ea2d2c2341d981ef9e25c0d/f/make-4.2.1-glob-fix-2.patch", @@ -62,13 +63,18 @@ class Gmake(AutotoolsPackage, GNUMirrorPackage): def configure_args(self): args = [] args.extend(self.with_or_without("guile")) - args.extend(self.with_or_without("nls")) + args.append("--disable-nls") return args - @run_after("install") - def symlink_gmake(self): - with working_dir(self.prefix.bin): - symlink("make", "gmake") + def build(self, spec, prefix): + with working_dir(self.build_directory): + Executable(os.path.join(os.curdir, "build.sh"))() + + def install(self, spec, prefix): + with working_dir(self.build_directory): + os.mkdir(prefix.bin) + install("make", prefix.bin) + os.symlink("make", prefix.bin.gmake) def setup_dependent_package(self, module, dspec): module.make = MakeExecutable( -- cgit v1.2.3-70-g09d2