pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
import perl5 with reproducibility patch
Module Name: pkgsrc-wip
Committed By: nikita <nikita%NetBSD.org@localhost>
Pushed By: nikita
Date: Mon May 8 23:38:22 2023 +0200
Changeset: 60f2c5ecf4f1e7143ee3c078380e79002e77f2fe
Added Files:
perl5/DESCR
perl5/Makefile
perl5/Makefile.common
perl5/PLIST
perl5/buildlink3.mk
perl5/dirs.mk
perl5/distinfo
perl5/files/Policy.sh
perl5/files/deinstall.tmpl
perl5/files/install.tmpl
perl5/files/install_threads.tmpl
perl5/files/perllink.1
perl5/files/perllink.in
perl5/hacks.mk
perl5/license.mk
perl5/module.mk
perl5/options.mk
perl5/packlist.mk
perl5/patches/patch-Configure
perl5/patches/patch-Makefile.SH
perl5/patches/patch-caretx.c
perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__BeOS.pm
perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__Unix.pm
perl5/patches/patch-cpan_ExtUtils-MakeMaker_t_MM__BeOS.t
perl5/patches/patch-hints_cygwin.sh
perl5/patches/patch-hints_linux.sh
perl5/patches/patch-hints_netbsd.sh
perl5/patches/patch-hints_solaris__2.sh
perl5/patches/patch-installperl
perl5/patches/patch-perl.c
perl5/vars.mk
perl5/version.mk
Log Message:
import perl5 with reproducibility patch
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=60f2c5ecf4f1e7143ee3c078380e79002e77f2fe
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
perl5/DESCR | 9 +
perl5/Makefile | 253 +++++++++++++++++++++
perl5/Makefile.common | 14 ++
perl5/PLIST | 5 +
perl5/buildlink3.mk | 46 ++++
perl5/dirs.mk | 41 ++++
perl5/distinfo | 17 ++
perl5/files/Policy.sh | 124 ++++++++++
perl5/files/deinstall.tmpl | 23 ++
perl5/files/install.tmpl | 11 +
perl5/files/install_threads.tmpl | 24 ++
perl5/files/perllink.1 | 125 ++++++++++
perl5/files/perllink.in | 205 +++++++++++++++++
perl5/hacks.mk | 60 +++++
perl5/license.mk | 12 +
perl5/module.mk | 239 +++++++++++++++++++
perl5/options.mk | 100 ++++++++
perl5/packlist.mk | 129 +++++++++++
perl5/patches/patch-Configure | 238 +++++++++++++++++++
perl5/patches/patch-Makefile.SH | 15 ++
perl5/patches/patch-caretx.c | 15 ++
...pan_ExtUtils-MakeMaker_lib_ExtUtils_MM__BeOS.pm | 16 ++
...pan_ExtUtils-MakeMaker_lib_ExtUtils_MM__Unix.pm | 36 +++
.../patch-cpan_ExtUtils-MakeMaker_t_MM__BeOS.t | 16 ++
perl5/patches/patch-hints_cygwin.sh | 15 ++
perl5/patches/patch-hints_linux.sh | 19 ++
perl5/patches/patch-hints_netbsd.sh | 41 ++++
perl5/patches/patch-hints_solaris__2.sh | 24 ++
perl5/patches/patch-installperl | 29 +++
perl5/patches/patch-perl.c | 10 +
perl5/vars.mk | 44 ++++
perl5/version.mk | 35 +++
32 files changed, 1990 insertions(+)
diffs:
diff --git a/perl5/DESCR b/perl5/DESCR
new file mode 100644
index 0000000000..d4d2bffcdf
--- /dev/null
+++ b/perl5/DESCR
@@ -0,0 +1,9 @@
+Perl is a general-purpose programming language originally developed
+for text manipulation and now used for a wide range of tasks including
+system administration, web development, network programming, GUI
+development, and more. The language is intended to be practical (easy
+to use, efficient, complete) rather than beautiful (tiny, elegant,
+minimal). Its major features are that it's easy to use, supports both
+procedural and object-oriented (OO) programming, has powerful built-in
+support for text processing, and has one of the world's most impressive
+collections of third-party modules.
diff --git a/perl5/Makefile b/perl5/Makefile
new file mode 100644
index 0000000000..a56114a01a
--- /dev/null
+++ b/perl5/Makefile
@@ -0,0 +1,253 @@
+# $NetBSD: Makefile,v 1.277 2023/05/05 23:01:32 jperkin Exp $
+
+.include "license.mk"
+.include "Makefile.common"
+
+COMMENT= Practical Extraction and Report Language
+
+CONFLICTS+= perl-base-[0-9]* perl-thread-[0-9]*
+
+# when updating perl, you can remove packages that are included
+# in perl core, see
+# corelist -diff ${PREV_PKGVERSION} ${PKGVERSION}
+
+SUPERSEDES+= p5-Tie-File<=0.99
+SUPERSEDES+= p5-Time-HiRes-[0-9]*
+SUPERSEDES+= p5-DB_File-[0-9]*
+SUPERSEDES+= p5-Memoize<=1.03
+SUPERSEDES+= p5-I18N-LangTags<=0.39
+SUPERSEDES+= p5-Locale-Maketext<=1.23
+SUPERSEDES+= p5-experimental<=0.007
+
+# XXX: requires that gcc use an external perl to avoid circular dependencies
+USE_GCC_RUNTIME= yes
+USE_LANGUAGES= c c99
+
+.include "../../mk/bsd.prefs.mk"
+
+# Determine the Perl API version from the patchlevel.h file from the
+# source distribution.
+#
+PERL5_API_VERS= ${PERL5_API_VERS_cmd:sh}
+PERL5_API_VERS_cmd= \
+ if ${TEST} -f ${WRKSRC}/patchlevel.h; then \
+ ${AWK} '/\#define[ ]*PERL_API_REVISION/ { R = $$3 }\
+ /\#define[ ]*PERL_API_VERSION/ { r = "."$$3 } \
+ /\#define[ ]*PERL_API_SUBVERSION/ { s = "."$$3 } \
+ END { printf "%s%s%s\n", R, r, s }' \
+ ${WRKSRC}/patchlevel.h; \
+ else \
+ ${ECHO} "unknown"; \
+ fi
+
+.include "dirs.mk"
+
+.include "../../mk/compiler.mk"
+
+HAS_CONFIGURE= yes
+CONFIGURE_SCRIPT= ./Configure
+CONFIGURE_ARGS+= -sde
+CONFIGURE_ARGS+= -Dldflags=${LDFLAGS:Q}
+MAKE_ENV+= LC_ALL="C"
+LDFLAGS.QNX+= -lm
+
+CONFIGURE_ARGS.SunOS+= -Aundef:csh
+
+TEST_TARGET= test
+
+# Policy.sh generation
+# (see comments in files/Policy.sh)
+SUBST_CLASSES+= policysh
+SUBST_STAGE.policysh= pre-configure
+SUBST_FILES.policysh= Policy.sh
+SUBST_VARS.policysh+= MACHINE_ARCH
+SUBST_VARS.policysh+= LOWER_OPSYS
+SUBST_VARS.policysh+= OBJECT_FMT
+SUBST_VARS.policysh+= CC
+SUBST_VARS.policysh+= CFLAGS
+SUBST_VARS.policysh+= LDFLAGS
+SUBST_VARS.policysh+= COMPILER_RPATH_FLAG
+SUBST_VARS.policysh+= PERL5_PREFIX
+SUBST_VARS.policysh+= PERL5_SITEPREFIX
+SUBST_VARS.policysh+= PERL5_VENDORPREFIX
+SUBST_VARS.policysh+= PERL5_PERLBASE
+SUBST_VARS.policysh+= PERL5_SITEBASE
+SUBST_VARS.policysh+= PERL5_SITEBIN
+SUBST_VARS.policysh+= PERL5_VENDORBASE
+SUBST_VARS.policysh+= PERL5_PRIVLIB
+SUBST_VARS.policysh+= PERL5_SITELIB
+SUBST_VARS.policysh+= PERL5_VENDORLIB
+SUBST_VARS.policysh+= PKGMANDIR
+SUBST_VARS.policysh+= LOCALBASE
+SUBST_VARS.policysh+= PTHREAD_LDFLAGS
+
+# Avoid the ${TOOLS_BIN} path getting written to installed files.
+SUBST_CLASSES+= toolsbin
+SUBST_STAGE.toolsbin= pre-configure
+SUBST_FILES.toolsbin= Configure
+SUBST_VARS.toolsbin= TOOLS_RM
+
+SUBST_CLASSES+= pwd
+SUBST_STAGE.pwd= pre-configure
+SUBST_FILES.pwd= dist/PathTools/Cwd.pm
+SUBST_SED.pwd+= -e "s,/bin/pwd,${TOOLS_PLATFORM.pwd},g"
+
+.if ${OPSYS} == "Darwin" || ${OPSYS} == "Cygwin"
+#
+# The Perl build attempts to work around case-insensitivity problems on
+# HFS filesystems by using GNUmakefiles, so we need to use GNU make.
+#
+USE_TOOLS+= gmake
+MAKE_FILE= GNUmakefile
+.endif
+
+#
+# For the moment disable the building of a shared libperl.dylib on Darwin
+# => 9.0 as it breaks the build. This should just be considered a temporary
+# work around until the actual problem can be fixed as this worked for
+# Darwin < 9.0.
+#
+.if !${MACHINE_PLATFORM:MDarwin-9.*-*}
+CONFIGURE_ARGS+= -Duseshrplib
+.endif
+
+# Perl embeds the full paths to the following tools in several installed
+# files, so make sure the paths to the ones in ${TOOLS_DIR} aren't used.
+#
+USE_TOOLS+= hostname ln rm sed test
+SUBST_VARS.policysh+= TOOLS_HOSTNAME_CMD
+SUBST_VARS.policysh+= TOOLS_LN
+TOOLS_ALIASES.sed= ${TOOLS_SED:T}
+SUBST_VARS.policysh+= TOOLS_SED
+SUBST_VARS.policysh+= TOOLS_SH
+SUBST_VARS.policysh+= TOOLS_TEST
+SUBST_VARS.policysh+= FALSE
+
+# Nail down the needed libraries for each platform here to avoid hidden
+# dependencies. If this isn't defined, then use the perl defaults for the
+# particular operating system.
+#
+LIBSWANTED.Bitrig= m crypt
+LIBSWANTED.Cygwin= m crypt dl
+LIBSWANTED.Darwin= m c
+LIBSWANTED.DragonFly= m crypt
+LIBSWANTED.FreeBSD= m crypt
+LIBSWANTED.GNUkFreeBSD= m crypt dl nsl
+LIBSWANTED.Haiku= network
+LIBSWANTED.HPUX= cl pthread $$libswanted # see Perl's README.hpux
+LIBSWANTED.IRIX= m crypt
+LIBSWANTED.Interix= m dl
+LIBSWANTED.Linux= m crypt dl nsl
+LIBSWANTED.Minix= m crypt c
+LIBSWANTED.MirBSD= m crypt
+LIBSWANTED.NetBSD= m crypt
+LIBSWANTED.OpenBSD= m crypt
+LIBSWANTED.SunOS= m crypt dl socket nsl
+LIBSWANTED.AIX= m crypt dl socket nsl bind c
+LIBSWANTED.SCO_SV= m crypt socket
+LIBSWANTED.UnixWare= m crypt socket
+LIBSWANTED= ${LIBSWANTED.${OPSYS}}
+SUBST_VARS.policysh+= LIBSWANTED
+
+# Nail down the directories in which the system libraries may be found.
+# If this isn't defined, then use the perl defaults for the particular
+# operating system.
+#
+SYSLIBPATH.Bitrig= /usr/lib
+SYSLIBPATH.Cygwin= /usr/lib
+SYSLIBPATH.Darwin= /usr/lib
+SYSLIBPATH.DragonFly= /usr/lib
+SYSLIBPATH.FreeBSD= /usr/lib
+SYSLIBPATH.Interix= /usr/lib
+SYSLIBPATH.Minix= /usr/lib
+SYSLIBPATH.MirBSD= /usr/lib
+SYSLIBPATH.NetBSD= /usr/lib
+SYSLIBPATH.OpenBSD= /usr/lib
+SYSLIBPATH.SunOS= /usr/lib
+SYSLIBPATH.AIX= /usr/lib
+SYSLIBPATH.SCO_SV= /usr/lib
+SYSLIBPATH= ${SYSLIBPATH.${OPSYS}:U${COMPILER_LIB_DIRS}}
+SUBST_VARS.policysh+= SYSLIBPATH
+
+.include "../../mk/dlopen.buildlink3.mk"
+.include "options.mk"
+
+.if ${MACHINE_PLATFORM} == "MirBSD"
+SUBST_CLASSES+= mirbsd-paths
+SUBST_STAGE.mirbsd-paths= pre-configure
+SUBST_FILES.mirbsd-paths= hints/mirbsd.sh
+SUBST_SED.mirbsd-paths= -e 's,/usr/mpkg,${PREFIX},g'
+SUBST_MESSAGE.mirbsd-paths= Do not use non-pkgsrc paths on MirBSD.
+.endif
+
+# Replace our perl as the interpreter
+REPLACE_PERL+= cpan/Config-Perl-V/V.pm
+REPLACE_PERL+= cpan/Getopt-Long/lib/Getopt/Long.pm
+REPLACE_PERL+= cpan/version/lib/version.pm
+REPLACE_PERL+= dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
+REPLACE_PERL+= ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
+REPLACE_PERL+= ext/File-DosGlob/lib/File/DosGlob.pm
+REPLACE_PERL+= lib/unicore/mktables
+
+.if ${PKGSRC_COMPILER:Mxlc}
+SUBST_CLASSES+= cpprun
+SUBST_STAGE.cpprun= pre-install
+SUBST_FILES.cpprun= lib/Config_heavy.pl
+. if !empty(PKG_OPTIONS:Mthreads)
+SUBST_SED.cpprun= -e "s/cpprun=''/cpprun='cc_r -E'/"
+. else
+SUBST_SED.cpprun= -e "s/cpprun=''/cpprun='cc -E'/"
+. endif
+.endif
+
+# Some platforms may want the directory mode not to be 0755. This
+# is, unfortunately, hardcoded in quite a few places in Perl, so
+# let's substitute what pkgsrc says instead.
+#
+SUBST_CLASSES+= dirmode
+SUBST_STAGE.dirmode= pre-configure
+SUBST_FILES.dirmode= install_lib.pl
+SUBST_SED.dirmode= -e "s/755/${PKGDIRMODE}/g;/umask(/d"
+
+post-extract:
+ ${CP} ${FILESDIR}/Policy.sh ${WRKSRC}/Policy.sh
+
+pre-configure:
+ ${FIND} ${WRKSRC} -name "*.orig" -type f -exec rm -f {} \;
+
+post-build:
+ ${SED} -e "s,@PERL5@,"${PERL5:Q}",g" \
+ -e "s,@SH@,"${SH:Q}",g" \
+ -e "s,@PKGMANDIR@,"${PKGMANDIR}",g" \
+ ${FILESDIR}/perllink.in > ${WRKDIR}/perllink.sh
+
+INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
+PERL5_PACKLIST_DIR_cmd= . ${WRKSRC}/config.sh; echo $$installarchlib
+PERL5_PACKLIST_DIR= ${PERL5_PACKLIST_DIR_cmd:sh}
+PERL5_PACKLIST= .packlist
+PERL5_PACKLIST_DESTDIR= no
+FILES_SUBST+= PERL5_COMMENT=\#
+FILES_SUBST+= PERL5_PACKLIST=
+
+.PHONY: perl5-post-install
+post-install: perl5-post-install
+perl5-post-install:
+ ${RUN}if ${TEST} -x ${DESTDIR}${PREFIX}/bin/a2p; then \
+ strip ${DESTDIR}${PREFIX}/bin/a2p; \
+ fi
+ ${INSTALL_SCRIPT} ${WRKDIR}/perllink.sh \
+ ${DESTDIR}${PERL5_PERLBASE}/bin/perllink
+ ${INSTALL_MAN} ${FILESDIR}/perllink.1 \
+ ${DESTDIR}${PERL5_PERLBASE}/${PKGMANDIR}/man1/perllink.1
+ ${RM} -f ${DESTDIR}${PREFIX}/bin/perllink \
+ ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/perllink.1
+ ${LN} -s ${PERL5_PERLBASE}/bin/perllink \
+ ${DESTDIR}${PREFIX}/bin/perllink
+ ${LN} -s ${PERL5_PERLBASE}/${PKGMANDIR}/man1/perllink.1 \
+ ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/perllink.1
+.if ${OPSYS} == "Haiku"
+ ${CHMOD} a+x ${DESTDIR}${PREFIX}/bin/perl
+.endif
+
+.include "packlist.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/perl5/Makefile.common b/perl5/Makefile.common
new file mode 100644
index 0000000000..63292c786d
--- /dev/null
+++ b/perl5/Makefile.common
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile.common,v 1.46 2023/04/25 07:29:47 adam Exp $
+#
+# used by lang/perl5/Makefile
+# used by databases/p5-gdbm/Makefile
+
+DISTNAME= perl-5.36.1
+CATEGORIES= lang devel perl5
+MASTER_SITES= ${MASTER_SITE_PERL_CPAN:S,/modules/by-module/$,/src/5.0/,}
+DISTFILES+= ${DISTNAME}${EXTRACT_SUFX}
+EXTRACT_SUFX= .tar.xz
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://www.perl.org/
+LICENSE= ${PERL5_LICENSE}
diff --git a/perl5/PLIST b/perl5/PLIST
new file mode 100644
index 0000000000..7ab007d5e6
--- /dev/null
+++ b/perl5/PLIST
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.6 2012/11/02 07:29:30 sbd Exp $
+bin/perllink
+lib/perl5/bin/perllink
+lib/perl5/${PKGMANDIR}/man1/perllink.1
+man/man1/perllink.1
diff --git a/perl5/buildlink3.mk b/perl5/buildlink3.mk
new file mode 100644
index 0000000000..069912f912
--- /dev/null
+++ b/perl5/buildlink3.mk
@@ -0,0 +1,46 @@
+# $NetBSD: buildlink3.mk,v 1.72 2022/12/26 22:11:52 wiz Exp $
+
+BUILDLINK_TREE+= perl
+
+.if !defined(PERL_BUILDLINK3_MK)
+PERL_BUILDLINK3_MK:=
+
+.include "../../mk/bsd.fast.prefs.mk"
+PERL5_REQD+= 5.36.0
+.for _perl5_ver_ in ${PERL5_REQD}
+BUILDLINK_API_DEPENDS.perl+= perl>=${_perl5_ver_}
+.endfor
+# Prevent p5-* etc. packages built for 5.36.0 to be used
+# with the next incompatible version of perl:
+BUILDLINK_API_DEPENDS.perl+= perl<5.37.0
+
+BUILDLINK_PKGSRCDIR.perl?= ../../lang/perl5
+
+_TOOLS_USE_PKGSRC.perl= yes
+
+# do not change this LOCALBASE to PREFIX; that breaks the install of perl modules
+PERL5= ${LOCALBASE}/bin/perl
+
+pkgbase := perl
+.include "../../mk/pkg-build-options.mk"
+
+.if ${PKG_BUILD_OPTIONS.perl:Mthreads}
+. include "../../mk/pthread.buildlink3.mk"
+.endif
+
+PERL5_OPTIONS?= # empty
+.if !empty(PERL5_OPTIONS:Mthreads)
+INSTALL_TEMPLATES+= ${.CURDIR}/../../lang/perl5/files/install_threads.tmpl
+.endif
+
+#
+# Perl keeps headers and odd libraries in an odd path not caught by the
+# default BUILDLINK_FILES_CMD, so name them to be symlinked into
+# ${BUILDLINK_DIR}.
+#
+.include "../../lang/perl5/vars.mk"
+BUILDLINK_FILES.perl= ${PERL5_SUB_INSTALLARCHLIB}/CORE/*
+BUILDLINK_RPATHDIRS.perl+= ${PERL5_SUB_INSTALLARCHLIB}/CORE
+.endif # PERL_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -perl
diff --git a/perl5/dirs.mk b/perl5/dirs.mk
new file mode 100644
index 0000000000..f641d2cad4
--- /dev/null
+++ b/perl5/dirs.mk
@@ -0,0 +1,41 @@
+# $NetBSD: dirs.mk,v 1.2 2011/05/16 07:59:04 abs Exp $
+#
+# Provide typical required Perl directories
+
+.if !defined(_PERL5_DIRS_MK)
+_PERL5_DIRS_MK= # defined
+
+.include "../../mk/bsd.prefs.mk"
+
+PERL5_PREFIX= ${PREFIX}
+PERL5_VENDORPREFIX= ${PERL5_PREFIX}
+PERL5_SITEPREFIX?= ${PERL5_PREFIX}
+BUILD_DEFS+= PERL5_SITEPREFIX
+
+PERL5= ${PERL5_PREFIX}/bin/perl
+PERL5_PERLBASE= ${PERL5_PREFIX}/lib/perl5
+PERL5_VENDORBASE= ${PERL5_VENDORPREFIX}/lib/perl5/vendor_perl
+#
+# The unusual check for empty(PERL5_SITEPREFIX) is because ${PREFIX} isn't
+# defined until bsd.pkg.mk is included, so when we inspect its value at
+# this point, it's empty.
+#
+.if empty(PERL5_SITEPREFIX) || \
+ !empty(PERL5_SITEPREFIX:M${LOCALBASE}) || \
+ !empty(PERL5_SITEPREFIX:M${LOCALBASE}/*)
+PERL5_SITEBASE= ${PERL5_SITEPREFIX}/lib/perl5/site_perl
+.else
+PERL5_SITEBASE= ${PERL5_SITEPREFIX}
+.endif
+
+PERL5_SITEBIN?= ${PERL5_SITEBASE}/bin
+
+PERL5_PRIVLIB= ${PERL5_PERLBASE}/${PERL5_API_VERS}
+PERL5_VENDORLIB= ${PERL5_VENDORBASE}/${PERL5_API_VERS}
+.if !empty(PERL5_SITEBASE:M*lib/perl5/site_perl)
+PERL5_SITELIB= ${PERL5_SITEBASE}/${PERL5_API_VERS}
+.else
+PERL5_SITELIB= ${PERL5_SITEBASE}/lib/perl5/site_perl/${PERL5_API_VERS}
+.endif
+
+.endif
diff --git a/perl5/distinfo b/perl5/distinfo
new file mode 100644
index 0000000000..78d6fada71
--- /dev/null
+++ b/perl5/distinfo
@@ -0,0 +1,17 @@
+$NetBSD: distinfo,v 1.178 2023/04/25 07:29:47 adam Exp $
+
+BLAKE2s (perl-5.36.1.tar.xz) = d1bfb3348be21613b3bde6246682ba15afe58d2dd786e99ffa8325ee368256c3
+SHA512 (perl-5.36.1.tar.xz) = 8d1ec654c59d078bfc477f11c9526233199a85e4d4f6f5a55bf9eb7802cd355189c669cc6785d2d5e741c1de4d740b7a0cfd3c0198122586a07ac7f527fb14af
+Size (perl-5.36.1.tar.xz) = 13053604 bytes
+SHA1 (patch-Configure) = afbc6660012128531e53ec7da8f077c5e39f0dfd
+SHA1 (patch-Makefile.SH) = 56203aea57c429a94760f039a978463b8859b0a9
+SHA1 (patch-caretx.c) = b76b4175a58123fa4dfd2adf36b2207dcb6cf65a
+SHA1 (patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__BeOS.pm) = 79e5aeccfa272ca5ec08bffc616d8053ae90ac51
+SHA1 (patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__Unix.pm) = 6171a21a24e3bea312155b1d5f692d76ef733d23
+SHA1 (patch-cpan_ExtUtils-MakeMaker_t_MM__BeOS.t) = 9b0e7ab85fdab4887b1754599a8879bd7d9f36cc
+SHA1 (patch-hints_cygwin.sh) = 1b21d927d6b7379754c4cd64a2b05d3632c35470
+SHA1 (patch-hints_linux.sh) = 4baa8f80695687abb53d4f4e1830cf86db5b2bf7
+SHA1 (patch-hints_netbsd.sh) = 0d549a48800372d75fe34b783529a78cba90f646
+SHA1 (patch-hints_solaris__2.sh) = 364a28ca57dbabe1f902b601e336532996db6a0e
+SHA1 (patch-installperl) = b129d64cc17b898b44fe6282b8b1df36e342d0ef
+SHA1 (patch-perl.c) = 7730326b2dc6b4276d5b82a57bae133255c23c67
diff --git a/perl5/files/Policy.sh b/perl5/files/Policy.sh
new file mode 100644
index 0000000000..64f388566d
--- /dev/null
+++ b/perl5/files/Policy.sh
@@ -0,0 +1,124 @@
+# $NetBSD: Policy.sh,v 1.6 2021/05/17 15:06:49 nia Exp $
+#
+# Site-wide policy settings for pkgsrc Perl
+#
+archname='@MACHINE_ARCH@-@LOWER_OPSYS@'
+cc='@CC@'
+ccflags='@CFLAGS@'
+ldflags='@LDFLAGS@'
+if $test -n "$ccflags"; then
+ optimize="$ccflags"
+fi
+i_malloc='undef'
+installusrbinperl='undef'
+installstyle='lib/perl5'
+
+# Perl embeds the full paths to the following tools in several installed
+# files, so make sure the paths to the ones in ${TOOLS_DIR} aren't used.
+aphostname='@TOOLS_HOSTNAME_CMD@'
+ln='@TOOLS_LN@'
+lns='@TOOLS_LN@ -s'
+sed='@TOOLS_SED@'
+sh='@TOOLS_SH@'
+issymlink='@TOOLS_TEST@ -h'
+perl5='@FALSE@'
+
+# Installation directories for "perl", "vendor" and "site" bits.
+prefix='@PERL5_PREFIX@'
+siteprefix='@PERL5_SITEPREFIX@'
+vendorprefix='@PERL5_VENDORPREFIX@'
+
+# The Perl Configure script will install scripts into "*/script"
+# directories if they exist, so override with explicit settings.
+scriptdir='@PERL5_PERLBASE@/bin'
+sitescript='@PERL5_SITEBASE@/bin'
+vendorscript='@PERL5_VENDORBASE@/bin'
+
+# Put any compiled binaries into vendor- and site-specific locations to
+# avoid conflicts with each other. The perllink script will handle all
+# the appropriate symlinking.
+sitebin='@PERL5_SITEBIN@'
+vendorbin='@PERL5_VENDORBASE@/bin'
+
+# Put the API-specific files into API-specific directories instead
+# of the default version-specific directories.
+privlib='@PERL5_PRIVLIB@'
+sitelib='@PERL5_SITELIB@'
+vendorlib='@PERL5_VENDORLIB@'
+
+# Search for version-specific directories under these directories.
+sitelib_stem='@PERL5_SITEBASE@'
+vendorlib_stem='@PERL5_VENDORBASE@'
+
+# Avoid manpage conflicts between the standard Perl library, 3rd-party
+# modules, and other packages.
+man1ext='1'
+man1dir='@PERL5_PERLBASE@/@PKGMANDIR@/man1'
+siteman1dir='@PERL5_SITEBASE@/@PKGMANDIR@/man1'
+vendorman1dir='@PERL5_VENDORBASE@/@PKGMANDIR@/man1'
+man3ext='3'
+man3dir='@PERL5_PERLBASE@/@PKGMANDIR@/man3'
+siteman3dir='@PERL5_SITEBASE@/@PKGMANDIR@/man3'
+vendorman3dir='@PERL5_VENDORBASE@/@PKGMANDIR@/man3'
+
+# Nail down the needed libraries for each platform here to avoid hidden
+# dependencies. If this isn't defined, then use the perl defaults for the
+# particular operating system.
+if $test -n "@LIBSWANTED@"; then
+ libswanted="@LIBSWANTED@ "
+fi
+
+# Add the pkgsrc-derived LDFLAGS for linking against pthreads to the
+# usethreads.cbu call-back script
+if $test -n "@PTHREAD_LDFLAGS@"; then
+ cat >> UU/usethreads.cbu <<EOCBU
+
+# Add pkgsrc-derived ldflags to link with thread support.
+ldflags="@PTHREAD_LDFLAGS@ \$ldflags"
+lddlflags="@PTHREAD_LDFLAGS@ \$lddlflags"
+EOCBU
+fi
+
+# Generate a pkgsrc.cbu call-back script that sets the correct LDFLAGS
+# for linking against pkgsrc-installed libraries
+cat > UU/pkgsrc.cbu <<EOCBU
+# This script UU/pkgsrc.cbu will get 'called-back' by Configure
+# *after* all hints
+
+# XCOFF targets need the path specified where libperl.a resides.
+if $test "@OBJECT_FMT@" = "XCOFF"; then
+ ldflags="@COMPILER_RPATH_FLAG@\${shrpdir} \$ldflags"
+ lddlflags="@COMPILER_RPATH_FLAG@\${shrpdir} \$lddlflags"
+ ccdlflags="@COMPILER_RPATH_FLAG@\${shrpdir} \$ccdlflags"
+fi
+
+# Set pkgsrc defaults for library and header search paths:
+# nail down the directories in which headers and libraries of
+# locally-installed software may be found.
+loclibpth="@LOCALBASE@/lib"
+locincpth="@LOCALBASE@/include"
+
+# Set pkgsrc defaults for "plateform"/general path used to
+# find libraries
+if $test -n "@SYSLIBPATH@"; then
+ glibpth="@SYSLIBPATH@"
+fi
+
+# Strip /usr/local/lib... from ldflags
+case "\$ldflags" in */usr/local/lib*)
+ set \`echo "X \$ldflags " | sed 's, [^ ]*/usr/local/lib[^ ]* , ,g'\`
+ shift
+ ldflags="\$*"
+ ;;
+esac
+
+# Strip gdbm from libswanted
+case "\$libswanted" in *gdbm*)
+ set \`echo "X \$libswanted " | sed 's, [^ ]*gdbm[^ ]* , ,g'\`
+ shift
+ libswanted="\$*"
+esac
+
+# (re)Set sed here so that sed _and_ full_sed are correctly *both* set
+sed='@TOOLS_SED@'
+EOCBU
diff --git a/perl5/files/deinstall.tmpl b/perl5/files/deinstall.tmpl
new file mode 100644
index 0000000000..4280fed56d
--- /dev/null
+++ b/perl5/files/deinstall.tmpl
@@ -0,0 +1,23 @@
+# $NetBSD: deinstall.tmpl,v 1.3 2010/02/14 15:10:38 tron Exp $
+
+case ${STAGE} in
+DEINSTALL)
+ eval `${PERL5} -V:prefix -V:archlib -V:scriptdir`
+ PERL5_PACKLIST="@PERL5_PACKLIST@"
+
+ # Remove the perllocal.pod file.
+ case "$archlib" in
+ $prefix/*) archlib="${PKG_PREFIX-@PREFIX@}/${archlib#$prefix/}" ;;
+ esac
+ ${RM} -f $archlib/perllocal.pod
+ ${RMDIR} -p $archlib 2>/dev/null || ${TRUE}
+
+ # Remove any symlinked bits that belong to this module.
+ $scriptdir/perllink -f -p ${PKG_PREFIX-@PREFIX@} delete ${PERL5_PACKLIST}
+
+ # If this is not the perl package, then re-link any perl bits
+ # back into place.
+ #
+ @PERL5_COMMENT@$scriptdir/perllink -p ${PKG_PREFIX-@PREFIX@} add
+ ;;
+esac
diff --git a/perl5/files/install.tmpl b/perl5/files/install.tmpl
new file mode 100644
index 0000000000..cc2ff4d69c
--- /dev/null
+++ b/perl5/files/install.tmpl
@@ -0,0 +1,11 @@
+# $NetBSD: install.tmpl,v 1.2 2005/08/12 19:59:03 jlam Exp $
+
+case ${STAGE} in
+POST-INSTALL)
+ eval `${PERL5} -V:scriptdir`
+ PERL5_PACKLIST="@PERL5_PACKLIST@"
+
+ # Symlink the bits that belong to this module.
+ $scriptdir/perllink -f -p ${PKG_PREFIX} add ${PERL5_PACKLIST}
+ ;;
+esac
diff --git a/perl5/files/install_threads.tmpl b/perl5/files/install_threads.tmpl
new file mode 100644
index 0000000000..6574aba7ff
--- /dev/null
+++ b/perl5/files/install_threads.tmpl
@@ -0,0 +1,24 @@
+# $NetBSD: install_threads.tmpl,v 1.2 2016/12/12 16:08:00 wiz Exp $
+#
+# Require the presence of a pkgsrc Perl installation that supports threads
+# during the PRE-INSTALL stage, otherwise we bail out.
+
+case ${STAGE} in
+PRE-INSTALL)
+ if [ ! -x "${PERL5}" ]; then
+ ${ECHO} "==> ${PERL5} does not exist." 1>&2
+ exit 1
+ fi
+ eval `${PERL5} -V:usethreads`
+ case $usethreads in
+ define*|true|[yY]*) # possible "yes" values in Perl Config.pm
+ # We found what we were looking for (a threaded perl) so
+ # do nothing.
+ ;;
+ *)
+ ${ECHO} "==> ${PKGNAME} requires a Perl that supports threads." 1>&2
+ exit 1
+ ;;
+ esac
+ ;;
+esac
diff --git a/perl5/files/perllink.1 b/perl5/files/perllink.1
new file mode 100644
index 0000000000..5b1cfbf7d4
--- /dev/null
+++ b/perl5/files/perllink.1
@@ -0,0 +1,125 @@
+.\" $NetBSD: perllink.1,v 1.3 2010/03/21 16:29:40 wiz Exp $
+.\"
+.\" Copyright (c) 2005 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Johnny C. Lam.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the NetBSD
+.\" Foundation, Inc. and its contributors.
+.\" 4. Neither the name of The NetBSD Foundation nor the names of its
+.\" contributors may be used to endorse or promote products derived
+.\" from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd July 15, 2005
+.Dt PERLLINK 1
+.Sh NAME
+.Nm perllink
+.Nd add and delete symlinks in the standard Perl installation
+.Sh SYNOPSIS
+.Nm perllink
+.Op Fl fnv
+.Op Fl p Ar prefix
+.Ar action
+.Op Ar packlist ...
+.Sh DESCRIPTION
+.Nm
+manages the symlinks that match the files listed in the given
+packlists.
+.Pp
+The perl configuration library defines the main directory trees
+containing the standard Perl installation in the following variables:
+.Bl -column -offset indent
+.It Va prefix
+.It Va siteprefix
+.It Va vendorprefix
+.El
+.Pp
+The perl configuration library also defines the locations of scripts
+and manual pages in the following variables:
+.Bl -column -offset indent ".Va vendorscript" ".Va vendorman1dir"
+.It Va scriptdir Ta Va man1dir
+.It Va sitescript Ta Va siteman1dir
+.It Va vendorscript Ta Va vendorman1dir
+.El
+.Pp
+For each file listed in the packlists that is in one of the script
+or manual page locations,
+a relative symbolic link to that file is added or deleted from
+. Va prefix Ns Pa /bin
+and
+. Va prefix Ns Pa /man/man1 .
+.Pp
+If
+.Fl p Ar prefix
+is specified, then the script and manual page locations are recomputed
+relative to the given
+.Ar prefix
+instead of to perl's
+.Va prefix ,
+and the symlinks are managed under the given
+.Ar prefix
+instead.
+.Pp
+The options are as follows:
+.Bl -tag -width indent
+.It Ar action
+This required option is either
+.Dq add
+or
+.Dq delete
+and determines
+whether the managed symlinks are added or deleted.
+.It Ar packlist ...
+These are paths to packlists containing the files installed as
+part of a module.
+Each line of a packlist contains a path terminated by a newline.
+If no packlists are specified, then the packlist for Perl itself
+is used.
+.It Fl f , -force
+Unlink any already existing files, permitting the new symlinks
+to replace the existing ones.
+.It Fl n , -noaction
+Do not actually make any changes to the files in
+.Ar prefix .
+.It Fl p Ar prefix , Fl -prefix= Ns Ar prefix
+Manage the symlinks in
+.Ar prefix .
+By default,
+.Nm
+manages the symlinks in the location referenced by the perl configuration
+variable
+.Va prefix .
+.It Fl v
+Be verbose.
+Display on standard error the shell-equivalent commands that
+are being executed.
+.El
+.Sh SEE ALSO
+.Xr perl 1 ,
+.Xr symlink 2
+.Sh AUTHORS
+.An Johnny C. Lam
diff --git a/perl5/files/perllink.in b/perl5/files/perllink.in
new file mode 100644
index 0000000000..bd0a9cbc3d
--- /dev/null
+++ b/perl5/files/perllink.in
@@ -0,0 +1,205 @@
+#!@SH@
+# $NetBSD: perllink.in,v 1.4 2012/03/04 10:26:57 tron Exp $
+#
+# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Johnny C. Lam.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the NetBSD
+# Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# This script parses the packlists listed on the command line and either
+# adds or deletes the symlinks in
+#
+# <prefix>/bin
+# <prefix>/@PKGMANDIR@/man1
+#
+# that match the files in the packlists.
+#
+
+perlprog="@PERL5@"
+
+usage()
+{
+ echo 1>&2 "usage: $0 [-fnv] [-p prefix] add|delete [packlist ...]"
+ exit 1
+}
+
+opt_action=
+opt_force=
+opt_noaction=
+opt_prefix=
+opt_packlists=
+opt_verbose=
+
+while test $# -gt 0; do
+ opt="$1"
+ case "$opt" in
+ -f|--force) opt_force=yes; shift ;;
+ -n|--noaction) opt_noaction=yes; shift ;;
+ -p) opt_prefix="$2"; shift; shift ;;
+ --prefix=*) opt_prefix="${1#--prefix=}"; shift ;;
+ -v|--verbose) opt_verbose=yes; shift ;;
+ --) break; shift ;;
+ -*) usage ;;
+ [!-]*) break ;;
+ esac
+done
+
+# We expect the action argument, as well as any packlists, to be left
+# in the argument list.
+#
+test $# -gt 0 || usage
+opt_action="$1"; shift
+
+# Get the values of various Config.pm values from perl.
+eval `$perlprog -V:prefix -V:scriptdir -V:man1dir -V:vendorprefix -V:vendorscript -V:vendorman1dir -V:siteprefix -V:sitescript -V:siteman1dir -V:archlib`
+
+# The remaining arguments, if any, are packlists.
+if test $# -gt 0; then
+ opt_packlists="$@"
+elif test -f "$archlib/.packlist"; then
+ opt_packlists="$archlib/.packlist"
+fi
+
+test -n "$opt_prefix" || opt_prefix="$prefix"
+
+pkgmandir="@PKGMANDIR@"
+
+# Re-point variables so that if they are under $prefix, then they are
+# recomputed to point under $opt_prefix.
+#
+case "$scriptdir" in
+$prefix/*) scriptdir="$opt_prefix/${scriptdir#$prefix/}" ;;
+"") scriptdir="$opt_prefix/bin" ;;
+esac
+case "$man1dir" in
+$prefix/*) man1dir="$opt_prefix/${man1dir#$prefix/}" ;;
+"") man1dir="$opt_prefix/$pkgmandir/man1" ;;
+esac
+case "$siteprefix" in
+$prefix/*) siteprefix="$opt_prefix/${siteprefix#$prefix/}" ;;
+"") siteprefix="$opt_prefix" ;;
+esac
+case "$sitescript" in
+$prefix/*) sitescript="$opt_prefix/${sitescript#$prefix/}" ;;
+"") sitescript="$scriptdir" ;;
+esac
+case "$siteman1dir" in
+$prefix/*) siteman1dir="$opt_prefix/${siteman1dir#$prefix/}" ;;
+"") siteman1dir="$man1dir" ;;
+esac
+case "$vendorprefix" in
+$prefix/*) vendorprefix="$opt_prefix/${vendorprefix#$prefix/}" ;;
+"") vendorprefix="$opt_prefix" ;;
+esac
+case "$vendorscript" in
+$prefix/*) vendorscript="$opt_prefix/${vendorscript#$prefix/}" ;;
+"") vendorscript="$scriptdir" ;;
+esac
+case "$vendorman1dir" in
+$prefix/*) vendorman1dir="$opt_prefix/${vendorman1dir#$prefix/}" ;;
+"") vendorman1dir="$man1dir" ;;
+esac
+
+destbindir="$opt_prefix/bin"
+destman1dir="$opt_prefix/$pkgmandir/man1"
+
+echo __dummy__ | $perlprog -pe '0' $opt_packlists |
+{ while read file junk; do
+ if [ ! -f "$file" ] && [ -f "$file.gz" ]; then
+ file="$file.gz"
+ fi
+
+ case "$file" in
+ $scriptdir/*|$sitescript/*|$vendorscript/*) destdir="$destbindir" ;;
+ $man1dir/*|$siteman1dir/*|$vendorman1dir/*) destdir="$destman1dir" ;;
+ esac
+
+ case "$file" in
+ $scriptdir/*) dest="$destdir/${file#$scriptdir/}" ;;
+ $sitescript/*) dest="$destdir/${file#$sitescript/}" ;;
+ $vendorscript/*) dest="$destdir/${file#$vendorscript/}" ;;
+ $man1dir/*) dest="$destdir/${file#$man1dir/}" ;;
+ $siteman1dir/*) dest="$destdir/${file#$siteman1dir/}" ;;
+ $vendorman1dir/*) dest="$destdir/${file#$vendorman1dir/}" ;;
+ *) continue ;;
+ esac
+
+ test "$file" != "$dest" || continue
+
+ # Set $src to be a relative symlink from $file into $destdir.
+ file="${file#/}"
+ destdir="${destdir#/}"
+ while test "${file%%/*}" = "${destdir%%/*}"; do
+ case "$file" in
+ */*) file="${file#*/}" ;;
+ *) file= ;;
+ esac
+ case "$destdir" in
+ */*) destdir="${destdir#*/}" ;;
+ *) destdir= ;;
+ esac
+ done
+ src=""
+ while test -n "$destdir"; do
+ src="../$src"
+ case "$destdir" in
+ */*) destdir="${destdir#*/}" ;;
+ *) destdir= ;;
+ esac
+ done
+ src="$src$file"
+
+ case "$opt_action" in
+ add|delete)
+ if test -n "$opt_force"; then
+ test -z "$opt_verbose" || \
+ echo "print STDERR \"rm $dest\\n\";"
+ test -n "$opt_noaction" || \
+ echo "unlink(\"$dest\");"
+ fi
+ ;;
+ *)
+ usage
+ ;;
+ esac
+ case "$opt_action" in
+ add)
+ test -z "$opt_verbose" || \
+ echo "print STDERR \"ln -s $src $dest\\n\";"
+ test -n "$opt_noaction" || \
+ echo "symlink(\"$src\", \"$dest\");"
+ ;;
+ esac
+done;
+echo "exit(0);"; } | $perlprog -w -
diff --git a/perl5/hacks.mk b/perl5/hacks.mk
new file mode 100644
index 0000000000..f64d53dc3a
--- /dev/null
+++ b/perl5/hacks.mk
@@ -0,0 +1,60 @@
+# $NetBSD: hacks.mk,v 1.27 2023/04/25 07:29:47 adam Exp $
+
+.if !defined(PERL5_HACKS_MK)
+PERL5_HACKS_MK= defined
+
+.include "../../mk/compiler.mk"
+
+### [ Fri Oct 11 10:00:00 UTC 2011 : hauke ]
+###
+### On m68k, gcc creates short assembler branch insns, and expects
+### the assembler to adapt them to the distance. m68k gas appears not to
+### do that for fpu branch insns, resulting in an out-of-range FPU
+### assembler branch instruction error in "ext/re/re_exec.c".
+###
+### As a workaround, building with "-Os" instead of "-O2" reduces
+### the size of the object file enough to allow short branches.
+###
+### See PR toolchain/45439.
+
+.if ${OPSYS} == "NetBSD" && ${MACHINE_ARCH} == "m68k"
+PKG_HACKS+= m68k-codegen
+BUILDLINK_TRANSFORM+= opt:-O[0-9]*:-Os
+.endif
+
+### [Fri Jan 31 11:09:04 CST 2014 : schnoebe]
+### [Fri Oct 28 11:53:57 EDT 2016 : dholland - extended to gcc5]
+### gcc-[45].*.* in NetBSD/alpha causes unaligned access exception in perl.
+### -O works around, and there is a report that -O2 -fno-tree-ter is enough.
+.if (${MACHINE_PLATFORM:MNetBSD-*-alpha} || ${MACHINE_PLATFORM:MOpenBSD-*-alpha}) \
+ && ${CC_VERSION:Mgcc-[45].*.*}
+# XXX: is there any good way to replace the default -O2 with multiple args?
+PKG_HACKS+= alpha-optimisation
+#BUILDLINK_TRANSFORM+= opt:-O[2-9]*:-O2 -fno-tree-ter
+CFLAGS+= -fno-tree-ter
+.endif
+
+### [Thu May 14 23:17:20 JST 2015 : ryoon]
+### Force to use /usr/sfw/lib/amd64/libgcc_s.co.1 instead.
+.if ${MACHINE_PLATFORM} == SunOS-5.10-x86_64
+. if ${CC_VERSION} == gcc-3.4.3
+BUILDLINK_PASSTHRU_RPATHDIRS+= /usr/sfw/lib/amd64
+LDFLAGS+= ${COMPILER_RPATH_FLAG}/usr/sfw/lib/amd64
+. endif
+.endif
+
+### [Thu Aug 6 14:43:56 PDT 2015 : mrg]
+### On NetBSD/{mips,vax,sparc64}, the -freorder-blocks option in -O2
+### causes opmini.c to be miscompiled, and perl build fails.
+###
+.if ${CC_VERSION:Mgcc-4.5.*} && ${OPSYS} == "NetBSD"
+. if (${MACHINE_ARCH} == "vax" || \
+ ${MACHINE_CPU} == "mips" || \
+ ${MACHINE_ARCH} == "sparc" || \
+ ${MACHINE_ARCH} == "sparc64")
+PKG_HACKS+= gcc-4.5-codegen
+CFLAGS+= -fno-reorder-blocks
+. endif
+.endif
+
+.endif # PERL5_HACKS_MK
diff --git a/perl5/license.mk b/perl5/license.mk
new file mode 100644
index 0000000000..74a314c80d
--- /dev/null
+++ b/perl5/license.mk
@@ -0,0 +1,12 @@
+# $NetBSD: license.mk,v 1.2 2009/07/17 06:44:46 sno Exp $
+#
+# This Makefile fragment is intended to be included by packages that build
+# and install perl5 modules and by the perl5 package.
+#
+# The following variables may be set prior to including this file:
+#
+# PERL5_LICENSE If set, it'll not overwritten with gnu-gpl-v2.
+# Allowed values: gnu-gpl-v2 and artistic until
+# pkgsrc can handle dual licenses correctly.
+#
+PERL5_LICENSE?= gnu-gpl-v2 OR artistic
diff --git a/perl5/module.mk b/perl5/module.mk
new file mode 100644
index 0000000000..1ccbabae0b
--- /dev/null
+++ b/perl5/module.mk
@@ -0,0 +1,239 @@
+# $NetBSD: module.mk,v 1.75 2020/08/31 18:00:37 wiz Exp $
+#
+# This Makefile fragment is intended to be included by packages that build
+# and install perl5 modules.
+#
+# The following targets are provided by this file:
+#
+# perl5-configure runs the standard perl configuration in
+# each of the directories specified in
+# ${PERL5_CONFIGURE_DIRS}.
+#
+# do-configure runs the perl5-configure target; if PERL5_CONFIGURE
+# is set to "YES", then this target overrides the
+# default do-configure provided by bsd.pkg.mk.
+#
+# The following variables may be set prior to including this file:
+#
+# PERL5_CONFIGURE if "YES", then for do-configure, run the standard
+# perl configuration assuming Makefile.PL exists;
+# defaults to "YES".
+#
+# PERL5_CONFIGURE_DIRS list of directories in which to run the
+# standard perl configuration; defaults to
+# ${CONFIGURE_DIRS}.
+#
+# PERL5_LDFLAGS extra linker flags to pass on to the build
+# process.
+#
+# PERL5_MODULE_TYPE "MakeMaker", "Module::Build", "Module::Build::Bundled",
+# "Module::Build::Tiny", "Module::Install", or
+# "Module::Install::Bundled" depending on which framework
+# is used to build/install the module.
+#
+# See also:
+# PERL5_PACKLIST
+#
+# Keywords: perl perl5
+
+.include "../../lang/perl5/license.mk"
+
+.if !defined(PERL5_MODULE_MK)
+PERL5_MODULE_MK= # defined
+
+.include "../../mk/bsd.prefs.mk"
+
+PERL5_MODULE_TYPE?= MakeMaker
+
+.if (${PERL5_MODULE_TYPE} != "MakeMaker") && \
+ (${PERL5_MODULE_TYPE} != "Module::Build") && \
+ (${PERL5_MODULE_TYPE} != "Module::Build::Bundled") && \
+ (${PERL5_MODULE_TYPE} != "Module::Build::Tiny") && \
+ (${PERL5_MODULE_TYPE} != "Module::Install") && \
+ (${PERL5_MODULE_TYPE} != "Module::Install::Bundled")
+PKG_FAIL_REASON+= "\`\`${PERL5_MODULE_TYPE}'' is not a supported PERL5_MODULE_TYPE."
+.endif
+
+# Default test target for Perl modules
+TEST_TARGET?= test
+
+.include "../../mk/compiler.mk"
+
+.if ${PERL5_MODULE_TYPE} == "Module::Build" || \
+ ${PERL5_MODULE_TYPE} == "Module::Build::Bundled" || \
+ ${PERL5_MODULE_TYPE} == "Module::Build::Tiny"
+PERL5_MODTYPE= modbuild
+PERL5_MODBUILD_DESTDIR_OPTION= --destdir ${DESTDIR:Q}
+.elif ${PERL5_MODULE_TYPE} == "Module::Install" || \
+ ${PERL5_MODULE_TYPE} == "Module::Install::Bundled"
+PERL5_MODTYPE= modinst
+.elif ${PERL5_MODULE_TYPE} == "MakeMaker"
+PERL5_MODTYPE= makemaker
+.endif
+
+
+###########################################################################
+###
+### Add the proper dependencies for using the specified module build
+### system.
+###
+
+BUILDLINK_DEPMETHOD.perl+= full
+.include "../../lang/perl5/buildlink3.mk"
+
+.if ${PKGPATH} != devel/p5-Module-Build && \
+ (${PERL5_MODULE_TYPE} == "Module::Build")
+BUILD_DEPENDS+= p5-Module-Build>=0.42050:../../devel/p5-Module-Build
+.endif
+
+.if ${PKGPATH} != devel/p5-Module-Build-Tiny && \
+ (${PERL5_MODULE_TYPE} == "Module::Build::Tiny")
+BUILD_DEPENDS+= p5-Module-Build-Tiny>=0.23:../../devel/p5-Module-Build-Tiny
+.endif
+
+.if ${PKGPATH} != devel/p5-Module-Install && \
+ (${PERL5_MODULE_TYPE} == "Module::Install")
+BUILD_DEPENDS+= p5-Module-Install>=0.91:../../devel/p5-Module-Install
+.endif
+
+
+###########################################################################
+###
+### Target definitions (configure, build, install, etc.)
+###
+
+PERL5_CONFIGURE?= yes
+PERL5_CONFIGURE_DIRS?= ${CONFIGURE_DIRS}
+
+MAKE_ENV+= LC_ALL=C
+MAKE_ENV+= PERL_MM_USE_DEFAULT=1
+
+# All pkgsrc-installed Perl modules are installed into the "vendor"
+# directories.
+#
+MAKE_PARAMS.makemaker+= INSTALLDIRS=vendor
+MAKE_PARAMS.modbuild+= --installdirs=vendor
+MAKE_PARAMS.modinst+= installdirs=vendor
+
+MAKE_PARAMS+= ${MAKE_PARAMS.${PERL5_MODTYPE}}
+
+.PHONY: do-makemaker-configure
+do-makemaker-configure:
+ ${RUN} \
+ for dir in ${PERL5_CONFIGURE_DIRS}; do \
+ cd ${WRKSRC}; \
+ if ${TEST} -f "$$dir"/Makefile.PL; then \
+ cd "$$dir"; \
+ ${SETENV} ${MAKE_ENV} \
+ ${BUILDLINK_PREFIX.perl}/bin/perl Makefile.PL ${MAKE_PARAMS}; \
+ fi; \
+ done
+
+.PHONY: do-modbuild-configure
+do-modbuild-configure:
+ ${RUN} \
+ for dir in ${PERL5_CONFIGURE_DIRS}; do \
+ cd ${WRKSRC}; \
+ if ${TEST} -f "$$dir"/Build.PL; then \
+ cd "$$dir"; \
+ ${SETENV} ${MAKE_ENV} \
+ ${BUILDLINK_PREFIX.perl}/bin/perl Build.PL ${MAKE_PARAMS}; \
+ fi; \
+ done
+
+.PHONY: do-modinst-configure
+do-modinst-configure:
+.if ${PERL5_MODULE_TYPE} == "Module::Install"
+ ${RUN} \
+ for dir in ${PERL5_CONFIGURE_DIRS}; do \
+ cd ${WRKSRC}; \
+ if ${TEST} -d "$$dir"/inc/Module; then \
+ ${RM} -rf "$$dir"/inc/Module; \
+ fi; \
+ if ${TEST} -f "$$dir"/Makefile.PL; then \
+ cd "$$dir"; \
+ ${SETENV} ${MAKE_ENV} \
+ ${BUILDLINK_PREFIX.perl}/bin/perl Makefile.PL --skipdeps ${MAKE_PARAMS}; \
+ fi; \
+ done
+.else
+ ${RUN} \
+ for dir in ${PERL5_CONFIGURE_DIRS}; do \
+ cd ${WRKSRC}; \
+ if ${TEST} -f "$$dir"/Makefile.PL; then \
+ cd "$$dir"; \
+ ${SETENV} ${MAKE_ENV} \
+ ${BUILDLINK_PREFIX.perl}/bin/perl Makefile.PL --skipdeps ${MAKE_PARAMS}; \
+ fi; \
+ done
+.endif
+
+.PHONY: perl5-configure
+perl5-configure: do-${PERL5_MODTYPE}-configure
+
+.if !empty(PERL5_CONFIGURE:M[yY][eE][sS])
+do-configure: perl5-configure
+.endif
+
+.PHONY: do-modbuild-build
+do-modbuild-build:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build ${BUILD_PARAMS}
+
+.PHONY: do-modbuild-test
+do-modbuild-test:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build test ${BUILD_PARAMS}
+
+.PHONY: do-modbuild-install
+do-modbuild-install:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build install ${PERL5_MODBUILD_DESTDIR_OPTION} ${BUILD_PARAMS}
+
+.if target(do-${PERL5_MODTYPE}-build) && !defined(NO_BUILD)
+do-build: do-${PERL5_MODTYPE}-build
+do-test: do-${PERL5_MODTYPE}-test
+.endif
+.if target(do-${PERL5_MODTYPE}-install)
+do-install: do-${PERL5_MODTYPE}-install
+.endif
+
+
+###########################################################################
+###
+### Make variable overrides
+###
+
+# MakeMaker provides two hooks, OPTIMIZE and OTHERLDFLAGS, to
+# customize the arguments passed to the preprocessor and linker,
+# respectively.
+#
+PERL5_MAKE_FLAGS.makemaker+= OPTIMIZE=${CFLAGS:Q}" "${CPPFLAGS:Q}
+.if ${OBJECT_FMT} == "a.out"
+PERL5_MAKE_FLAGS.makemaker+= OTHERLDFLAGS=${LDFLAGS:S/-Wl,//g:Q}
+.else
+PERL5_MAKE_FLAGS.makemaker+= OTHERLDFLAGS=${LDFLAGS:Q}
+.endif
+
+# Repoint all of the vendor-specific variables to be under the perl5
+# module's ${PREFIX}.
+#
+.include "../../lang/perl5/vars.mk"
+.for _var_ in ${_PERL5_VARS}
+PERL5_MAKE_FLAGS.makemaker+= ${_var_}=${PERL5_${_var_}:Q}
+.endfor
+#
+# The PREFIX in the generated Makefile will point to ${PERL5_PREFIX},
+# so override its value to the module's ${PREFIX}.
+# Also, set VENDORARCHEXP, so existing .packlist won't be read.
+#
+PERL5_MAKE_FLAGS.makemaker+= PREFIX=${PREFIX:Q} VENDORARCHEXP=${DESTDIR}${PERL5_INSTALLVENDORARCH}
+
+PERL5_MAKE_FLAGS+= ${PERL5_MAKE_FLAGS.${PERL5_MODTYPE}}
+MAKE_FLAGS+= ${PERL5_MAKE_FLAGS}
+
+.if defined(PERL5_LDFLAGS) && !empty(PERL5_LDFLAGS)
+#FIX_RPATH+= PERL5_LDFLAGS
+LDFLAGS+= ${PERL5_LDFLAGS}
+.endif
+
+.include "../../lang/perl5/packlist.mk"
+
+.endif # PERL5_MODULE_MK
diff --git a/perl5/options.mk b/perl5/options.mk
new file mode 100644
index 0000000000..85d502f6fa
--- /dev/null
+++ b/perl5/options.mk
@@ -0,0 +1,100 @@
+# $NetBSD: options.mk,v 1.18 2023/04/25 07:29:47 adam Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.perl
+PKG_OPTIONS_REQUIRED_GROUPS= perlbits
+PKG_OPTIONS_GROUP.perlbits= perl-64bitauto perl-64bitint perl-64bitmore perl-64bitall perl-64bitnone
+PKG_SUPPORTED_OPTIONS= debug dtrace threads mstats
+
+CHECK_BUILTIN.pthread:= yes
+.include "../../mk/pthread.builtin.mk"
+CHECK_BUILTIN.pthread:= no
+
+# By default, build with threads only if the threads are native.
+.if ${USE_BUILTIN.pthread:tl} == yes
+PERL5_BUILD_THREADS_SUPPORT= yes
+.else
+PERL5_BUILD_THREADS_SUPPORT= ${DLOPEN_REQUIRE_PTHREADS}
+.endif
+
+### from KNOWN PROBLEMS in README.haiku
+### Perl cannot be compiled with threading support ATM.
+###
+.if ${MACHINE_PLATFORM:MHaiku-*-*}
+PERL5_BUILD_THREADS_SUPPORT= no
+.endif
+
+# miniperl fails with locking errors during build on QNX.
+.if ${OPSYS} == "QNX"
+PERL5_BUILD_THREADS_SUPPORT= no
+.endif
+
+.if !empty(PERL5_BUILD_THREADS_SUPPORT:M[yY][eE][sS])
+PKG_SUGGESTED_OPTIONS= threads
+.endif
+
+.if ${OPSYS} == "IRIX"
+. if defined(ABI) && ${ABI} == "64"
+PKG_SUGGESTED_OPTIONS+= perl-64bitint
+. endif
+.elif ${OPSYS} == "AIX"
+. if defined(ABI) && ${ABI} == "64"
+PKG_SUGGESTED_OPTIONS+= perl-64bitall
+. else
+PKG_SUGGESTED_OPTIONS+= perl-64bitnone
+. endif
+.else
+PKG_SUGGESTED_OPTIONS+= perl-64bitauto
+.endif
+
+.if (${OPSYS} == "SunOS" && ${OPSYS_VERSION} >= 051100) || \
+ (${OPSYS} == "Darwin" && ${OPSYS_VERSION} >= 100500)
+PKG_SUGGESTED_OPTIONS+= dtrace
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mthreads)
+. include "../../mk/pthread.buildlink3.mk"
+CONFIGURE_ARGS+= -Duseithreads
+CFLAGS+= ${PTHREAD_CFLAGS}
+LDFLAGS+= ${PTHREAD_LDFLAGS}
+LIBSWANTED+= ${PTHREAD_LIBS:M-l*:S/^-l//}
+. if ${OBJECT_FMT} == "XCOFF"
+PERL5_RPATH_THREAD=-thread
+. endif
+.else
+CONFIGURE_ARGS+= -Uuseithreads
+. if ${OBJECT_FMT} == "XCOFF"
+PERL5_RPATH_THREAD=
+. endif
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+CFLAGS+= -DDEBUGGING
+.endif
+
+.if !empty(PKG_OPTIONS:Mdtrace)
+CONFIGURE_ARGS+= -Dusedtrace
+.endif
+
+.if !empty(PKG_OPTIONS:Mmstats)
+CFLAGS+= -DPERL_DEBUGGING_MSTATS
+CONFIGURE_ARGS+= -Dusemymalloc
+.else
+CONFIGURE_ARGS+= -Uusemymalloc
+.endif
+
+.if !empty(PKG_OPTIONS:Mperl-64bitint)
+CONFIGURE_ARGS+= -Duse64bitint
+.elif !empty(PKG_OPTIONS:Mperl-64bitmore)
+CONFIGURE_ARGS+= -Dusemorebits
+.elif !empty(PKG_OPTIONS:Mperl-64bitall)
+CONFIGURE_ARGS+= -Duse64bitall
+.elif !empty(PKG_OPTIONS:Mperl-64bitnone)
+CONFIGURE_ARGS+= -Uuse64bitall -Uusemorebits -Uuse64bitint
+.else
+. if ${OBJECT_FMT} == "XCOFF"
+BROKEN= "XCOFF targets need the path specified where libperl.a resides."
+BROKEN+= "Please choose on of perl-64bitint perl-64bitmore perl-64bitall or perl-64bitnone to allow this."
+. endif
+.endif
diff --git a/perl5/packlist.mk b/perl5/packlist.mk
new file mode 100644
index 0000000000..5be0d4c405
--- /dev/null
+++ b/perl5/packlist.mk
@@ -0,0 +1,129 @@
+# $NetBSD: packlist.mk,v 1.23 2023/05/05 23:00:27 jperkin Exp $
+#
+# This Makefile fragment is intended to be included by packages that
+# create packlist files. This file is automatically included by
+# perl5/module.mk, so it is typically not necessary to include this
+# file.
+#
+# The following variables should be set prior to including this file:
+#
+# PERL5_USE_PACKLIST
+# When set to "yes" (the default), automatically generates the
+# PLIST for the pkgsrc package from the Perl packlist.
+#
+# PERL5_PACKLIST_DIR
+# The "install*arch" directory under which packlist files are
+# installed. Only needs to be overridden in very special cases.
+#
+# Default: ${PERL5_INSTALLVENDORARCH}
+#
+# PERL5_PACKLIST
+# The list of packlist files relative to ${PERL5_PACKLIST_DIR}.
+#
+# Example: .auto/Text/Trim/.packlist
+
+.if !defined(_PERL5_PACKLIST_MK)
+_PERL5_PACKLIST_MK= # defined
+
+.include "../../mk/bsd.prefs.mk"
+
+PERL5_USE_PACKLIST?= yes
+.if ${PERL5_USE_PACKLIST:tl} == yes
+# XXX: still experimental, but many packages already work
+#PERL5_PACKLIST?= auto/${DISTNAME:C/-[0-9].*$//:C,-,/,g}/.packlist
+.endif
+
+PERL5_PACKLIST_DESTDIR?= yes
+
+.if defined(PERL5_PACKLIST)
+PERL5_PACKLIST_DIR?= ${PERL5_INSTALLVENDORARCH}
+_PERL5_REAL_PACKLIST= ${PERL5_PACKLIST:S/^/${PERL5_PACKLIST_DIR}\//}
+_PERL5_PACKLIST= ${_PERL5_REAL_PACKLIST:S/^/${DESTDIR}/}
+.endif
+
+###########################################################################
+###
+### INSTALL/DEINSTALL scripts to manage symlinks
+###
+
+INSTALL_TEMPLATES+= ${.CURDIR}/../../lang/perl5/files/install.tmpl
+DEINSTALL_TEMPLATES+= ${.CURDIR}/../../lang/perl5/files/deinstall.tmpl
+FILES_SUBST+= PERL5_COMMENT=
+FILES_SUBST+= PERL5_PACKLIST=${_PERL5_REAL_PACKLIST:Q}
+
+
+###########################################################################
+###
+### Packlist -> PLIST generation
+###
+
+# Generate the PLIST from the files listed in PERL5_PACKLIST.
+.if defined(_PERL5_PACKLIST)
+PERL5_PLIST_COMMENT_CMD= \
+ { ${ECHO} "@comment The following lines are automatically generated"; \
+ ${ECHO} "@comment from the installed .packlist files."; }
+PERL5_PLIST_FILES_CMD= \
+ { ${CAT} ${_PERL5_PACKLIST}; for f in ${_PERL5_REAL_PACKLIST}; do ${TEST} ! -f "${DESTDIR}$$f" || ${ECHO} "$$f"; done; } \
+ | ${SED} -e "s,[ ].*,," -e "s,/\\./,/,g" -e "s,${PREFIX}/,," \
+ | ${SORT} -u
+PERL5_GENERATE_PLIST= ${PERL5_PLIST_COMMENT_CMD}; \
+ ${PERL5_PLIST_FILES_CMD};
+GENERATE_PLIST+= ${PERL5_GENERATE_PLIST}
+.endif
+
+###########################################################################
+###
+### Packlist DESTDIR handling -- strip off the DESTDIR from each entry.
+###
+
+.if !empty(PERL5_PACKLIST_DESTDIR:M[Yy][Ee][Ss])
+_PERL5_PACKLIST_AWK_STRIP_DESTDIR= \
+ BEGIN { destdir = "${DESTDIR}"; \
+ gsub(/\/\//, "/", destdir); \
+ len_destdir = length(destdir); } \
+ { if (index($$1, destdir) == 1) \
+ $$1 = substr($$1, len_destdir + 1) }
+.else
+_PERL5_PACKLIST_AWK_STRIP_DESTDIR=
+.endif
+
+###########################################################################
+###
+### Packlist MANZ handling -- modify the .packlist so that it properly
+### records either compressed or uncompressed manpages depending on
+### how pkgsrc modifies them after installation.
+###
+
+_PERL5_PACKLIST_MANPAGE_RE= \
+ ^(\/[^ \/]*)+\/(man[1-9ln]\/[^ \/]*\.[1-9ln]|cat[1-9ln]\/[^ \/]*\.[0-9])$$
+
+_PERL5_PACKLIST_AWK_STRIP_MANZ= \
+ /${_PERL5_PACKLIST_MANPAGE_RE}\.gz/ \
+ { $$1 = substr($$1, 1, length($$1) - 3); }
+
+_PERL5_PACKLIST_AWK_ADD_MANZ.no= # empty
+_PERL5_PACKLIST_AWK_ADD_MANZ.yes= \
+ /${_PERL5_PACKLIST_MANPAGE_RE}/ { $$1 = $$1 ".gz"; }
+
+.if defined(_PERL5_PACKLIST)
+post-install: perl-packlist
+.endif
+
+.PHONY: perl-packlist
+perl-packlist:
+ ${RUN} \
+ ${TEST} -n ${_PERL5_PACKLIST:Q}"" || exit 0; \
+ for file in ${_PERL5_PACKLIST}; do \
+ if ${TEST} ! -f "$$file"; then \
+ ${ECHO} 1>&2 "Perl packlist $$file is missing."; \
+ exit 1; \
+ fi; \
+ ${AWK} '${_PERL5_PACKLIST_AWK_STRIP_DESTDIR} \
+ ${_PERL5_PACKLIST_AWK_STRIP_MANZ} \
+ ${_PERL5_PACKLIST_AWK_ADD_MANZ.${_MANZ}} \
+ { print $$0 }' \
+ $$file > $$file.new; \
+ ${MV} -f $$file.new $$file; \
+ done
+
+.endif # _PERL5_PACKLIST_MK
diff --git a/perl5/patches/patch-Configure b/perl5/patches/patch-Configure
new file mode 100644
index 0000000000..1b00f8eaa3
--- /dev/null
+++ b/perl5/patches/patch-Configure
@@ -0,0 +1,238 @@
+$NetBSD: patch-Configure,v 1.11 2021/05/24 17:46:25 wiz Exp $
+
+* Use "uname -r" to get OS version for *BSD.
+* Move $loclibpth to the end of $dlist, instead of the beginning.
+* Detect systems which have <fenv.h> but where using it fails.
+* Honor more ldflags in shared objects.
+* Add Minix
+* Several other changes.
+* Add rpath for QNX
+
+* reproducibility patch from guix:
+Don't encode the current timestamp.
+
+This affects the output of `perl -V`, specifically the message "Compiled
+at [...]".
+
+The 'cf_time' and 'cf_by' values show up in 'config.h' and
+in 'Config_heavy.pl'.
+
+Use the output of 'uname -s' instead of 'uname -a' to avoid recording
+the kernel version ('uname -o' leads to directory names like
+'x86_64-gnulinux' instead of 'x86_64-linux', which might cause breakage
+down the road.)
+
+--- Configure.orig 2021-05-04 06:52:48.000000000 +0000
++++ Configure
+@@ -3317,7 +3317,7 @@
+ : Try to determine whether config.sh was made on this system
+ case "$config_sh" in
+ '')
+-myuname=`$uname -a 2>/dev/null`
++myuname=`$uname -s 2>/dev/null`
+ $test -z "$myuname" && myuname=`hostname 2>/dev/null`
+ # Downcase everything to avoid ambiguity.
+ # Remove slashes and single quotes so we can use parts of this in
+@@ -3520,7 +3520,7 @@
+ ;;
+ MiNT) osname=mint
+ ;;
+- minix) osname=minix
++ minix*) osname=minix
+ osvers=`$uname -r`
+ ;;
+ netbsd*) osname=netbsd
+@@ -3549,6 +3549,9 @@
+ qnx) osname=qnx
+ osvers="$4"
+ ;;
++ sco_sv) osname=sco_sv
++ osvers="$3"
++ ;;
+ solaris) osname=solaris
+ case "$3" in
+ 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
+@@ -3889,13 +3889,13 @@
+ . ./posthint.sh
+
+ : who configured the system
+-cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
++cf_time="1970-01-01"
+ case "$cf_by" in
+ "")
+ cf_by=`(logname) 2>/dev/null`
+ case "$cf_by" in
+ "")
+- cf_by=`(whoami) 2>/dev/null`
++ cf_by="pkgsrc"
+ case "$cf_by" in
+ "") cf_by=unknown ;;
+ esac ;;
+@@ -4861,7 +4868,7 @@ esac
+ # If using gcc or clang, we can get better values for libpth, incpth
+ # and usrinc directly from the compiler.
+ # Note that ccname for clang is also gcc.
+-case "$ccname" in
++case "xx$ccname" in
+ gcc)
+ realpath=`which realpath 2>/dev/null | sed 's/no realpath in.*//'`
+ $echo 'extern int foo;' > try.c
+@@ -4945,14 +4952,14 @@ case "$plibpth" in
+ esac
+ case "$libpth" in
+ ' ') dlist='';;
+-'') dlist="$loclibpth $plibpth $glibpth";;
++'') dlist="$plibpth $glibpth $loclibpth";;
+ *) dlist="$libpth";;
+ esac
+
+ : Now check and see which directories actually exist, avoiding duplicates
+ for xxx in $dlist
+ do
+- if $test -d $xxx; then
++ if $test -d $xxx -o "$xxx" = "$prefix/lib"; then
+ case " $libpth " in
+ *" $xxx "*) ;;
+ *) libpth="$libpth $xxx";;
+@@ -5068,7 +5075,7 @@ lib_ext=$_a
+ obj_ext=$_o
+ path_sep=$p_
+
+-rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
++rm_try="@TOOLS_RM@ -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
+
+ : Which makefile gets called first. This is used by make depend.
+ case "$firstmakefile" in
+@@ -5401,7 +5408,7 @@ default|recommended)
+ *-fno-stack-protector*)
+ echo "Do not add -fstack-protector nor -fstack-protector-strong" 2>&1
+ ;;
+- *) case "$gccversion" in
++ nothing) case "$gccversion" in
+ ?*) set stack-protector-strong -fstack-protector-strong
+ eval $checkccflag
+ case "$dflt" in
+@@ -6384,6 +6391,15 @@ case "$nm_so_opt" in
+ ;;
+ esac
+
++: Mac OS X 10.7 is different
++case "$osname" in
++ darwin)
++ case "$osvers" in
++ 11.*)
++ libnames="$libnames /usr/lib/system/libsystem_*.dylib"
++ esac
++esac
++
+ : Figure out where the libc is located
+ case "$runnm" in
+ true)
+@@ -7564,7 +7580,9 @@ rp='Pathname for the site-specific libra
+ . ./getfile
+ prefixvar=sitelib
+ . ./setprefixvar
+-sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
++if $test -z "$sitelib_stem"; then
++ sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
++fi
+
+ : Determine list of previous versions to include in @INC
+ $cat > getverlist <<EOPL
+@@ -7977,7 +7995,9 @@ case "$vendorprefix" in
+ vendorlibexp="$ansexp"
+ ;;
+ esac
+-vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
++if $test -z "$vendorlib_stem"; then
++ vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
++fi
+ prefixvar=vendorlib
+ . ./installprefix
+
+@@ -8477,6 +8497,7 @@ EOM
+ esac
+ ;;
+ *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
++ sco_sv) dflt='-shared' ;;
+ solaris) # See [perl #66604].
+ # On Solaris 11, gcc -m64 on amd64
+ # appears not to understand -G. gcc versions at
+@@ -8516,7 +8537,7 @@ EOM
+ esac
+ for thisflag in $ldflags; do
+ case "$thisflag" in
+- -L*|-R*|-Wl,-R*)
++ -L*|-R*|-Wl,-R*|-Wl,-z*)
+ case " $dflt " in
+ *" $thisflag "*) ;;
+ *) dflt="$dflt $thisflag" ;;
+@@ -8772,7 +8793,7 @@ if "$useshrplib"; then
+ freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
+ xxx="-Wl,-R$shrpdir"
+ ;;
+- bsdos|linux|irix*|dec_osf|gnu*|haiku)
++ bsdos|linux|irix*|dec_osf|gnu*|haiku|nto)
+ xxx="-Wl,-rpath,$shrpdir"
+ ;;
+ hpux*)
+@@ -8782,6 +8803,9 @@ if "$useshrplib"; then
+ cygwin)
+ # cygwin needs only ldlibpth
+ ;;
++ sco_sv)
++ xxx="-Wl,-R$shrpdir"
++ ;;
+ *)
+ tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
+ ;;
+@@ -9858,6 +9882,13 @@ esac
+ : Check if we want perlio
+ useperlio="$define"
+
++: Look for a hint-file generated 'call-back-unit'. We need
++: to set some defaults for building perl in pkgsrc.
++if $test -f pkgsrc.cbu; then
++ echo "Setting pkgsrc-specific hints regarding compiler/linker flags..."
++ . ./pkgsrc.cbu
++fi
++
+ : Set the vendorbin variables
+ case "$vendorprefix" in
+ '') d_vendorbin="$undef"
+@@ -20225,7 +20256,15 @@ RCAT(Rei,ser)
+ ACAT(Cir,cus)
+ EOCP
+ $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
+-if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
++# yuck, what a hack.
++# MIPSPro compiler/preprocessor behaves differently if invoked on
++# stdin vs file. Here we test for stdin, but lateron we use files.
++# So force it to work the way we know it does:
++if [ x"${OPSYS}" = x"IRIX" ]; then
++ echo "Hacking MIPSPro on file vs. stdin..." >&4
++ echo "We know we can catify or stringify, separately or together!"
++ cpp_stuff=42
++elif $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
+ echo "Oh! Smells like ANSI's been here." >&4
+ echo "We can catify or stringify, separately or together!"
+ cpp_stuff=42
+@@ -23062,6 +23101,18 @@ eval $inhdr
+ set fenv.h i_fenv
+ eval $inhdr
+
++: And really validate that it is OK to include it
++: On NetBSD 6.x non-amd64 non-i386 and non-sparc this fails
++cat > try.c <<EOCP
++#include <fenv.h>
++int main() { return 0; }
++EOCP
++set try
++if ! eval $compile_ok; then
++ echo "<fenv.h> found to be unusable, disabling" >&4
++ i_fenv=$undef
++fi
++
+ : see if this is a fp.h system
+ set fp.h i_fp
+ eval $inhdr
diff --git a/perl5/patches/patch-Makefile.SH b/perl5/patches/patch-Makefile.SH
new file mode 100644
index 0000000000..b643e2538d
--- /dev/null
+++ b/perl5/patches/patch-Makefile.SH
@@ -0,0 +1,15 @@
+$NetBSD: patch-Makefile.SH,v 1.10 2019/11/14 09:56:56 adam Exp $
+
+Use correct -install_name on Darwin.
+
+--- Makefile.SH.orig 2019-10-24 21:27:53.000000000 +0000
++++ Makefile.SH
+@@ -70,7 +70,7 @@ true)
+ ${revision}.${patchlevel}.${subversion}"
+ case "$osvers" in
+ 1[5-9]*|[2-9]*)
+- shrpldflags="$shrpldflags -install_name `pwd`/\$@ -Xlinker -headerpad_max_install_names"
++ shrpldflags="$shrpldflags -install_name \$(shrpdir)/\$@ -Xlinker -headerpad_max_install_names"
+ exeldflags="-Xlinker -headerpad_max_install_names"
+ ;;
+ *)
diff --git a/perl5/patches/patch-caretx.c b/perl5/patches/patch-caretx.c
new file mode 100644
index 0000000000..f2b5d3cf2f
--- /dev/null
+++ b/perl5/patches/patch-caretx.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-caretx.c,v 1.3 2019/04/23 09:27:46 adam Exp $
+
+NetBSD's implementation sometimes returns "/"; reject that too.
+
+--- caretx.c.orig 2019-04-02 20:36:35.000000000 +0000
++++ caretx.c
+@@ -133,7 +133,7 @@ Perl_set_caret_X(pTHX) {
+ valid path has a '/' in it somewhere, so use that to validate the
+ result. See http://www.freebsd.org/cgi/query-pr.cgi?pr=35703
+ */
+- if (len > 0 && memchr(buf, '/', len)) {
++ if (len > 1 && memchr(buf, '/', len)) {
+ sv_setpvn(caret_x, buf, len);
+ return;
+ }
diff --git a/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__BeOS.pm b/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__BeOS.pm
new file mode 100644
index 0000000000..2b440f7d2c
--- /dev/null
+++ b/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__BeOS.pm
@@ -0,0 +1,16 @@
+$NetBSD: patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__BeOS.pm,v 1.1 2021/03/15 14:23:12 ryoon Exp $
+
+* Fix libperl.so reference.
+
+--- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm.orig 2020-12-18 10:04:35.000000000 +0000
++++ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm
+@@ -49,8 +49,7 @@ libperl.a equivalent to be linked to dyn
+ sub init_linker {
+ my($self) = shift;
+
+- $self->{PERL_ARCHIVE} ||=
+- File::Spec->catdir('$(PERL_INC)',$Config{libperl});
++ $self->{PERL_ARCHIVE} ||= '';
+ $self->{PERL_ARCHIVEDEP} ||= '';
+ $self->{PERL_ARCHIVE_AFTER} ||= '';
+ $self->{EXPORT_LIST} ||= '';
diff --git a/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__Unix.pm b/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__Unix.pm
new file mode 100644
index 0000000000..99395f8cd6
--- /dev/null
+++ b/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__Unix.pm
@@ -0,0 +1,36 @@
+$NetBSD: patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__Unix.pm,v 1.3 2022/06/28 10:02:51 wiz Exp $
+
+* $Is{NetBSD} and $Is{Interix} are unified into $Is{BSD}.
+* Ignore installed packlist when creating new packlist.
+* Compare inode numbers as string to fix pkg/55997. Cherry-picked from
+ upstream. See https://github.com/Perl/perl5/pull/18788 for more details.
+
+--- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm.orig 2021-05-13 17:40:25.661784701 +0900
++++ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 2021-05-13 17:40:29.734082886 +0900
+@@ -28,8 +28,6 @@ BEGIN {
+ $Is{VMS} = $^O eq 'VMS';
+ $Is{OSF} = $^O eq 'dec_osf';
+ $Is{IRIX} = $^O eq 'irix';
+- $Is{NetBSD} = $^O eq 'netbsd';
+- $Is{Interix} = $^O eq 'interix';
+ $Is{SunOS4} = $^O eq 'sunos';
+ $Is{Solaris} = $^O eq 'solaris';
+ $Is{SunOS} = $Is{SunOS4} || $Is{Solaris};
+@@ -1059,7 +1057,7 @@ sub xs_make_dynamic_lib {
+ push(@m," \$(RM_F) \$\@\n");
+
+ my $libs = '$(LDLOADLIBS)';
+- if (($Is{NetBSD} || $Is{Interix} || $Is{Android}) && $Config{'useshrplib'} eq 'true') {
++ if ($Is{BSD} && $Config{'useshrplib'} eq 'true') {
+ # Use nothing on static perl platforms, and to the flags needed
+ # to link against the shared libperl library on shared perl
+ # platforms. We peek at lddlflags to see if we need -Wl,-R
+@@ -2351,7 +2349,7 @@ pure_vendor_install :: all
+ $(NOECHO) $(MOD_INSTALL) \
+ };
+ push @m,
+-q{ read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
++q{ read "" \
+ write "}.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{" \
+ } unless $self->{NO_PACKLIST};
+
diff --git a/perl5/patches/patch-cpan_ExtUtils-MakeMaker_t_MM__BeOS.t b/perl5/patches/patch-cpan_ExtUtils-MakeMaker_t_MM__BeOS.t
new file mode 100644
index 0000000000..1e5c0e9a21
--- /dev/null
+++ b/perl5/patches/patch-cpan_ExtUtils-MakeMaker_t_MM__BeOS.t
@@ -0,0 +1,16 @@
+$NetBSD: patch-cpan_ExtUtils-MakeMaker_t_MM__BeOS.t,v 1.1 2021/03/15 14:23:12 ryoon Exp $
+
+* Fix libperl.so reference.
+
+--- cpan/ExtUtils-MakeMaker/t/MM_BeOS.t.orig 2020-12-18 10:04:35.000000000 +0000
++++ cpan/ExtUtils-MakeMaker/t/MM_BeOS.t
+@@ -38,8 +38,7 @@ my $MM = bless { NAME => "Foo" }, 'MM';
+
+ # init_linker
+ {
+- my $libperl = File::Spec->catfile('$(PERL_INC)',
+- $Config{libperl} || 'libperl.a' );
++ my $libperl = '';
+ my $export = '';
+ my $after = '';
+ $MM->init_linker;
diff --git a/perl5/patches/patch-hints_cygwin.sh b/perl5/patches/patch-hints_cygwin.sh
new file mode 100644
index 0000000000..5e4e152c95
--- /dev/null
+++ b/perl5/patches/patch-hints_cygwin.sh
@@ -0,0 +1,15 @@
+$NetBSD: patch-hints_cygwin.sh,v 1.1 2013/04/23 12:22:36 obache Exp $
+
+* prevent to use C++ by default.
+
+--- hints/cygwin.sh.orig 2013-03-04 15:16:22.000000000 +0000
++++ hints/cygwin.sh
+@@ -39,7 +39,7 @@ archname='cygwin'
+ # - otherwise -fpic
+ cccdlflags=' '
+ lddlflags=' --shared'
+-test -z "$ld" && ld='g++'
++test -z "$ld" && ld="$cc"
+
+ case "$osvers" in
+ # Configure gets these wrong if the IPC server isn't yet running:
diff --git a/perl5/patches/patch-hints_linux.sh b/perl5/patches/patch-hints_linux.sh
new file mode 100644
index 0000000000..ab3d04b57d
--- /dev/null
+++ b/perl5/patches/patch-hints_linux.sh
@@ -0,0 +1,19 @@
+$NetBSD: patch-hints_linux.sh,v 1.1 2019/04/23 09:27:46 adam Exp $
+
+We intentionally wire down the 'libswanted' list in the package Makefile,
+so don't let the hints file add new libraries that may be found outside
+Pkgsrc control.
+
+--- hints/linux.sh.orig 2014-05-26 13:34:20.000000000 +0000
++++ hints/linux.sh
+@@ -61,10 +61,6 @@
+
+ # Debian 4.0 puts ndbm in the -lgdbm_compat library.
+ echo $libs
+-if echo " $libswanted " | grep -q ' gdbm '; then
+- # Only add if gdbm is in libswanted.
+- libswanted="$libswanted gdbm_compat"
+-fi
+
+ # Configure may fail to find lstat() since it's a static/inline
+ # function in <sys/stat.h>.
diff --git a/perl5/patches/patch-hints_netbsd.sh b/perl5/patches/patch-hints_netbsd.sh
new file mode 100644
index 0000000000..8bf82e7f57
--- /dev/null
+++ b/perl5/patches/patch-hints_netbsd.sh
@@ -0,0 +1,41 @@
+$NetBSD: patch-hints_netbsd.sh,v 1.10 2015/02/25 14:56:45 wiz Exp $
+
+--whole-archive is a linker flag, not a compiler flag
+Better defaults for paths.
+Stop grovelling for functions we don't want to provide (*host*)
+
+--- hints/netbsd.sh.orig 2015-01-17 16:59:58.000000000 +0000
++++ hints/netbsd.sh
+@@ -36,16 +36,6 @@ case "$osvers" in
+ d_dlerror=$define
+ cccdlflags="-DPIC -fPIC $cccdlflags"
+ lddlflags="-shared $lddlflags"
+- cat >UU/cc.cbu <<'EOCBU'
+-# gcc 4.6 doesn't support --whole-archive, but it's required for the
+-# system gcc to build correctly, so check for it
+-echo 'int f(void) { return 0; }' >try.c
+-if ${cc:-cc} $cccdlflags -c try.c -otry.o 2>&1 &&
+- ${cc:-cc} --whole-archive $lddlflags try.o -otry.so 2>&1 ; then
+- lddlflags="--whole-archive $lddlflags"
+-fi
+-rm try.c try.o try.so 2>/dev/null
+-EOCBU
+ rpathflag="-Wl,-rpath,"
+ case "$osvers" in
+ 1.[0-5]*)
+@@ -200,10 +190,12 @@ esac
+ EOCBU
+
+ # Set sensible defaults for NetBSD: look for local software in
+-# /usr/pkg (NetBSD Packages Collection) and in /usr/local.
++# /usr/local, plus the build prefix, which might or might not be
++# /usr/pkg.
+ #
+-loclibpth="/usr/pkg/lib /usr/local/lib"
+-locincpth="/usr/pkg/include /usr/local/include"
++loclibpth="/usr/local/lib ${prefix}/lib"
++locincpth="/usr/local/include ${prefix}/include"
++
+ case "$rpathflag" in
+ '')
+ ldflags=
diff --git a/perl5/patches/patch-hints_solaris__2.sh b/perl5/patches/patch-hints_solaris__2.sh
new file mode 100644
index 0000000000..910c067cdb
--- /dev/null
+++ b/perl5/patches/patch-hints_solaris__2.sh
@@ -0,0 +1,24 @@
+$NetBSD: patch-hints_solaris__2.sh,v 1.3 2020/08/31 18:00:37 wiz Exp $
+
+Redo PR pkg/44999.
+
+--- hints/solaris_2.sh.orig 2020-06-14 23:01:25.000000000 +0000
++++ hints/solaris_2.sh
+@@ -585,7 +585,7 @@ EOM
+ fi
+ fi
+ case "${cc:-cc} -v 2>/dev/null" in
+- *gcc*|*g++*)
++ *gcc*|*g++*|clang*)
+ echo 'int main() { return 0; }' > try.c
+ case "`${cc:-cc} $ccflags -mcpu=v9 -m64 -S try.c 2>&1 | grep 'm64 is not supported by this configuration'`" in
+ *"m64 is not supported"*)
+@@ -622,7 +622,7 @@ EOM
+ # use that with Solaris 11 and later, but keep
+ # the old behavior for older Solaris versions.
+ case "$osvers" in
+- 2.?|2.10) lddlflags="$lddlflags -G -m64" ;;
++ 2.?|2.10) lddlflags="$lddlflags -shared -m64" ;;
+ *) lddlflags="$lddlflags -shared -m64" ;;
+ esac
+ ;;
diff --git a/perl5/patches/patch-installperl b/perl5/patches/patch-installperl
new file mode 100644
index 0000000000..5b6188f0a2
--- /dev/null
+++ b/perl5/patches/patch-installperl
@@ -0,0 +1,29 @@
+$NetBSD: patch-installperl,v 1.2 2021/03/15 14:23:12 ryoon Exp $
+
+Haiku part: From:
+https://github.com/haikuports/haikuports/blob/master/dev-lang/perl/patches/perl-5.32.0.patchset
+
+--- installperl.orig 2020-12-18 09:58:48.000000000 +0000
++++ installperl
+@@ -336,7 +336,6 @@ $do_installprivlib = 0 if $versiononly &
+ mkpath($installprivlib);
+ mkpath($installarchlib);
+ mkpath($installsitelib, $opts{verbose}, 0777) if ($installsitelib);
+-mkpath($installsitearch, $opts{verbose}, 0777) if ($installsitearch);
+
+ if (-d 'lib') {
+ find({no_chdir => 1, wanted => \&installlib}, 'lib')
+@@ -382,6 +381,13 @@ elsif ($Is_Cygwin) { # On Cygwin symlink
+
+ # AIX needs perl.exp installed as well.
+ push(@corefiles,'perl.exp') if $^O eq 'aix';
++
++ # Haiku requires haikuish.h.
++ if ($^O eq 'haiku') {
++ # Haiku needs haikuish.h installed as well.
++ mkpath("$installarchlib/CORE/haiku", $opts{verbose}, 0777);
++ push(@corefiles,'haiku/haikuish.h');
++ }
+ }
+
+
diff --git a/perl5/patches/patch-perl.c b/perl5/patches/patch-perl.c
new file mode 100644
index 0000000000..77664a75fa
--- /dev/null
+++ b/perl5/patches/patch-perl.c
@@ -0,0 +1,10 @@
+--- perl.c.orig 2023-05-08 22:16:08.305668988 +0200
++++ perl.c 2023-05-08 22:18:56.293971052 +0200
+@@ -2015,6 +2015,7 @@
+ PUSHs(Perl_newSVpvn_flags(aTHX_ non_bincompat_options,
+ sizeof(non_bincompat_options) - 1, SVs_TEMP));
+
++#define PERL_BUILD_DATE "Jan 1 1970 00:00:00"
+ #ifndef PERL_BUILD_DATE
+ # ifdef __DATE__
+ # ifdef __TIME__
diff --git a/perl5/vars.mk b/perl5/vars.mk
new file mode 100644
index 0000000000..f5e9002fe6
--- /dev/null
+++ b/perl5/vars.mk
@@ -0,0 +1,44 @@
+# $NetBSD: vars.mk,v 1.5 2011/10/28 07:41:52 obache Exp $
+#
+# This Makefile fragment exposes several Perl configuration variables
+# to the package Makefiles. The variables are only defined if the
+# ${PERL5} executable exists.
+
+.include "../../mk/bsd.prefs.mk"
+
+_PERL5_VARS= INSTALLARCHLIB INSTALLSCRIPT \
+ INSTALLVENDORBIN INSTALLVENDORSCRIPT \
+ INSTALLVENDORARCH INSTALLVENDORLIB \
+ INSTALLVENDORMAN1DIR INSTALLVENDORMAN3DIR
+
+.if defined(PERL5) && exists(${PERL5:Q})
+#
+# Locate some of the installation prefixes for ${PERL5} that are used to
+# define later variables.
+#
+. if !defined(_PERL5_VARS_OUT)
+_PERL5_VARS_CMD= ${PERL5:Q} -V:prefix ${_PERL5_VARS:tl:S/^/-V:/}
+_PERL5_VARS_OUT:= ${_PERL5_VARS_CMD:sh:ts,:S/'//g:S/;//g:Q:S/,/ /g}
+MAKEVARS+= _PERL5_VARS_OUT
+. endif
+
+. if !defined(_PERL5_PREFIX)
+_PERL5_PREFIX:= ${_PERL5_VARS_OUT:Mprefix=*:C/^prefix=//}
+MAKEVARS+= _PERL5_PREFIX
+. endif
+#
+# Define PERL5_SUB_* as the vendor variables minus the installation prefix
+# define later variables.
+#
+. for _var_ in ${_PERL5_VARS}
+. if !defined(PERL5_SUB_${_var_})
+PERL5_SUB_${_var_}:= ${_PERL5_VARS_OUT:M${_var_:tl}=*:S/^${_var_:tl}=${_PERL5_PREFIX:=/}//}
+. endif
+PERL5_${_var_}?= ${PREFIX}/${PERL5_SUB_${_var_}}
+MAKEVARS+= PERL5_SUB_${_var_}
+PLIST_SUBST+= PERL5_SUB_${_var_}=${PERL5_SUB_${_var_}:Q}
+PRINT_PLIST_AWK+= /^${PERL5_SUB_${_var_}:S|/|\\/|g}/ \
+ { gsub(/${PERL5_SUB_${_var_}:S|/|\\/|g}/, \
+ "$${PERL5_SUB_${_var_}}") }
+. endfor
+.endif # PERL5
diff --git a/perl5/version.mk b/perl5/version.mk
new file mode 100644
index 0000000000..8ccf301807
--- /dev/null
+++ b/perl5/version.mk
@@ -0,0 +1,35 @@
+# $NetBSD: version.mk,v 1.5 2019/04/23 09:27:46 adam Exp $
+#
+# Distill the PERL5_REQD list into a single value that is the highest
+# version of Perl required.
+#
+
+# Default to needing Perl 5.
+PERL5_REQD+= 5.0
+PERL5_REQD+= ${_OPSYS_PERL_REQD}
+
+.if !defined(_PERL5_REQD)
+_PERL5_REQD?= none
+. for _version_ in ${PERL5_REQD}
+. for _pkg_ in perl-${_version_}
+. if !empty(_PERL5_REQD:Mnone)
+_PERL5_PKG_SATISFIES_DEP= yes
+. for _dep_ in ${PERL5_REQD:S/^/perl>=/}
+. if !empty(_PERL5_PKG_SATISFIES_DEP:M[yY][eE][sS])
+_PERL5_PKG_SATISFIES_DEP!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${_pkg_:Q} 2>/dev/null; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. if !empty(_PERL5_PKG_SATISFIES_DEP:M[yY][eE][sS])
+_PERL5_REQD= ${_version_}
+. endif
+. endif
+. endfor
+. endfor
+.endif
+PERL5_REQD:= ${_PERL5_REQD}
+MAKEVARS+= _PERL5_REQD
Home |
Main Index |
Thread Index |
Old Index