gmake: bootstrap without make (#35050)

This commit is contained in:
Harmen Stoppels 2023-01-21 11:27:56 +01:00 committed by GitHub
parent cc01e33d53
commit a15448eae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re import re
from spack.build_environment import MakeExecutable, determine_number_of_jobs from spack.build_environment import MakeExecutable, determine_number_of_jobs
@ -24,14 +25,14 @@ class Gmake(AutotoolsPackage, GNUMirrorPackage):
version("4.0", sha256="fc42139fb0d4b4291929788ebaf77e2a4de7eaca95e31f3634ef7d4932051f69") version("4.0", sha256="fc42139fb0d4b4291929788ebaf77e2a4de7eaca95e31f3634ef7d4932051f69")
variant("guile", default=False, description="Support GNU Guile for embedded scripting") 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") with when("+guile"):
depends_on("guile", 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.sh requires it in 4.0 (SV 40254)
conflicts("~guile", when="@4.0")
build_directory = "spack-build"
patch( patch(
"https://src.fedoraproject.org/rpms/make/raw/519a7c5bcbead22e6ea2d2c2341d981ef9e25c0d/f/make-4.2.1-glob-fix-2.patch", "https://src.fedoraproject.org/rpms/make/raw/519a7c5bcbead22e6ea2d2c2341d981ef9e25c0d/f/make-4.2.1-glob-fix-2.patch",
@ -62,13 +63,18 @@ def determine_version(cls, exe):
def configure_args(self): def configure_args(self):
args = [] args = []
args.extend(self.with_or_without("guile")) args.extend(self.with_or_without("guile"))
args.extend(self.with_or_without("nls")) args.append("--disable-nls")
return args return args
@run_after("install") def build(self, spec, prefix):
def symlink_gmake(self): with working_dir(self.build_directory):
with working_dir(self.prefix.bin): Executable(os.path.join(os.curdir, "build.sh"))()
symlink("make", "gmake")
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): def setup_dependent_package(self, module, dspec):
module.make = MakeExecutable( module.make = MakeExecutable(