perl: change permissions in order to apply patch on version 5.38.0 (#40609)

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
This commit is contained in:
Lydéric Debusschère 2023-10-20 00:00:24 +02:00 committed by GitHub
parent f2ba25e09d
commit e30f53f206
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,8 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
url = "http://www.cpan.org/src/5.0/perl-5.34.0.tar.gz" url = "http://www.cpan.org/src/5.0/perl-5.34.0.tar.gz"
tags = ["windows"] tags = ["windows"]
maintainers("LydDeb")
executables = [r"^perl(-?\d+.*)?$"] executables = [r"^perl(-?\d+.*)?$"]
# see https://www.cpan.org/src/README.html for # see https://www.cpan.org/src/README.html for
@ -258,13 +260,23 @@ def determine_variants(cls, exes, version):
# aren't writeable so make pp.c user writeable # aren't writeable so make pp.c user writeable
# before patching. This should probably walk the # before patching. This should probably walk the
# source and make everything writeable in the future. # source and make everything writeable in the future.
# The patch "zlib-ng.patch" also fail. So, apply chmod
# to Makefile.PL and Zlib.xs too.
def do_stage(self, mirror_only=False): def do_stage(self, mirror_only=False):
# Do Spack's regular stage # Do Spack's regular stage
super().do_stage(mirror_only) super().do_stage(mirror_only)
# Add write permissions on file to be patched # Add write permissions on files to be patched
filename = join_path(self.stage.source_path, "pp.c") files_to_chmod = [
perm = os.stat(filename).st_mode join_path(self.stage.source_path, "pp.c"),
os.chmod(filename, perm | 0o200) join_path(self.stage.source_path, "cpan/Compress-Raw-Zlib/Makefile.PL"),
join_path(self.stage.source_path, "cpan/Compress-Raw-Zlib/Zlib.xs"),
]
for filename in files_to_chmod:
try:
perm = os.stat(filename).st_mode
os.chmod(filename, perm | 0o200)
except IOError:
continue
def nmake_arguments(self): def nmake_arguments(self):
args = [] args = []