gmake: generic CXX, fix build.sh, deprecate 4.0, add 4.1 (#45137)

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
This commit is contained in:
Harmen Stoppels 2024-07-16 18:58:57 +02:00 committed by GitHub
parent ce1b569b69
commit 40b390903d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,7 +24,12 @@ class Gmake(Package, GNUMirrorPackage):
version("4.4", sha256="581f4d4e872da74b3941c874215898a7d35802f03732bdccee1d4a7979105d18")
version("4.3", sha256="e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19")
version("4.2.1", sha256="e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7")
version("4.0", sha256="fc42139fb0d4b4291929788ebaf77e2a4de7eaca95e31f3634ef7d4932051f69")
version("4.1", sha256="9fc7a9783d3d2ea002aa1348f851875a2636116c433677453cc1d1acc3fc4d55")
version(
"4.0",
deprecated=True,
sha256="fc42139fb0d4b4291929788ebaf77e2a4de7eaca95e31f3634ef7d4932051f69",
)
variant("guile", default=False, description="Support GNU Guile for embedded scripting")
@ -33,9 +38,6 @@ class Gmake(Package, GNUMirrorPackage):
depends_on("guile@:3.0")
depends_on("pkgconfig", type="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",
level=1,
@ -75,10 +77,18 @@ def configure_args(self):
def install(self, spec, prefix):
configure = Executable(join_path(self.stage.source_path, "configure"))
build_sh = Executable(join_path(self.stage.source_path, "build.sh"))
with working_dir(self.build_directory, create=True):
configure(f"--prefix={prefix}", *self.configure_args())
build_sh()
if spec.satisfies("@:4.2.1"): # generated files in build dir
build_sh = join_path(".", "build.sh")
config_h = join_path(".", "config.h")
else: # generated files in source dir
build_sh = join_path(self.stage.source_path, "build.sh")
config_h = join_path("src", "config.h")
# The default CXX value should be generic, not CXX from the current build as it points
# to the compiler wrapper by absolute path.
filter_file(r"^#define MAKE_CXX .*$", "#undef MAKE_CXX", config_h)
Executable(build_sh)()
os.mkdir(prefix.bin)
install("make", prefix.bin)
os.symlink("make", prefix.bin.gmake)