summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2018-10-15 03:01:37 +0000
committertaca <taca@pkgsrc.org>2018-10-15 03:01:37 +0000
commitd8bc63cc87164125a6057f93cfc98ce6d5600576 (patch)
tree530bcd3cd6020ee44a7c75aa6b5fe63a0d7940b8 /lang
parent1c07c04ae86ac7db712df80a0ed28a984a9fa717 (diff)
downloadpkgsrc-d8bc63cc87164125a6057f93cfc98ce6d5600576.tar.gz
lang/perl5: $^X fallback work when platform-specific technique fails
Apply 03b94aa47e981af3c7b0118bfb11facda2b95251 from upstream make $^X fallback work when platform-specific technique fails. Bump PKGREVISION.
Diffstat (limited to 'lang')
-rw-r--r--lang/perl5/Makefile4
-rw-r--r--lang/perl5/distinfo4
-rw-r--r--lang/perl5/patches/patch-caretx.c62
3 files changed, 62 insertions, 8 deletions
diff --git a/lang/perl5/Makefile b/lang/perl5/Makefile
index ffa82126923..6509d60f25f 100644
--- a/lang/perl5/Makefile
+++ b/lang/perl5/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.248 2018/09/19 13:52:33 gson Exp $
+# $NetBSD: Makefile,v 1.249 2018/10/15 03:01:37 taca Exp $
.include "license.mk"
.include "Makefile.common"
-PKGREVISION= 1
+PKGREVISION= 2
COMMENT= Practical Extraction and Report Language
CONFLICTS+= perl-base-[0-9]* perl-thread-[0-9]*
diff --git a/lang/perl5/distinfo b/lang/perl5/distinfo
index 82d489cbdc9..87a60d34781 100644
--- a/lang/perl5/distinfo
+++ b/lang/perl5/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.153 2018/09/19 13:52:33 gson Exp $
+$NetBSD: distinfo,v 1.154 2018/10/15 03:01:37 taca Exp $
SHA1 (perl-5.28.0.tar.xz) = c0e9e7a0dea97ec9816687d865fd461a99ef185c
RMD160 (perl-5.28.0.tar.xz) = 34c9ad0560a2eed134e09282696bfae307cbeb6a
@@ -9,7 +9,7 @@ SHA1 (patch-Makefile.SH) = febb87d876a44091a761d3ef99c649f3e4bdd394
SHA1 (patch-aa) = 3a2b39c9eb903e68ef7d03ae448c51c147c19aa1
SHA1 (patch-ab) = 0ad5988b7cadfb13d9646a59a57f6cf884a6238a
SHA1 (patch-ac) = 4baa8f80695687abb53d4f4e1830cf86db5b2bf7
-SHA1 (patch-caretx.c) = 9f53a9133f8dd2f962b448d7288b5b20454c86fb
+SHA1 (patch-caretx.c) = cbe55cdb897c02805a51582f6a7e413ca313b630
SHA1 (patch-cflags.SH) = 7ad64e5a17b876bff4bbe238abc4a57354acf4fe
SHA1 (patch-dist_Storable_Makefile.PL) = fd8964cf3c94ba811caaf71be21650b29e4c8e50
SHA1 (patch-doio.c) = 684563a5416604a61632bd9cf70f4f225cce81e5
diff --git a/lang/perl5/patches/patch-caretx.c b/lang/perl5/patches/patch-caretx.c
index 788d946441d..4ec888ea522 100644
--- a/lang/perl5/patches/patch-caretx.c
+++ b/lang/perl5/patches/patch-caretx.c
@@ -1,10 +1,51 @@
-$NetBSD: patch-caretx.c,v 1.1 2016/06/08 17:39:30 he Exp $
+$NetBSD: patch-caretx.c,v 1.2 2018/10/15 03:01:37 taca Exp $
-NetBSD's implementation sometimes returns "/"; reject that too.
+* NetBSD's implementation sometimes returns "/"; reject that too.
+* Apply 03b94aa47e981af3c7b0118bfb11facda2b95251 from upstream make
+ $^X fallback work when platform-specific technique fails.
---- caretx.c.orig 2016-03-01 12:33:01.000000000 +0000
+--- caretx.c.orig 2018-05-21 12:29:23.000000000 +0000
+++ caretx.c
-@@ -121,8 +121,10 @@ Perl_set_caret_X(pTHX) {
+@@ -56,7 +56,19 @@ Perl_set_caret_X(pTHX) {
+ SV *const caret_x = GvSV(tmpgv);
+ #if defined(OS2)
+ sv_setpv(caret_x, os2_execname(aTHX));
+-#elif defined(USE_KERN_PROC_PATHNAME)
++ return;
++#elif defined(WIN32)
++ char *ansi;
++ WCHAR widename[MAX_PATH];
++ GetModuleFileNameW(NULL, widename, sizeof(widename)/sizeof(WCHAR));
++ ansi = win32_ansipath(widename);
++ sv_setpv(caret_x, ansi);
++ win32_free(ansi);
++ return;
++#else
++ /* We can try a platform-specific one if possible; if it fails, or we
++ * aren't running on a suitable platform, we'll fall back to argv[0]. */
++# ifdef USE_KERN_PROC_PATHNAME
+ size_t size = 0;
+ int mib[4];
+ mib[0] = CTL_KERN;
+@@ -76,7 +88,7 @@ Perl_set_caret_X(pTHX) {
+ return;
+ }
+ }
+-#elif defined(USE_NSGETEXECUTABLEPATH)
++# elif defined(USE_NSGETEXECUTABLEPATH)
+ char buf[1];
+ uint32_t size = sizeof(buf);
+
+@@ -95,7 +107,7 @@ Perl_set_caret_X(pTHX) {
+ return;
+ }
+ }
+-#elif defined(HAS_PROCSELFEXE)
++# elif defined(HAS_PROCSELFEXE)
+ char buf[MAXPATHLEN];
+ SSize_t len = readlink(PROCSELFEXE_PATH, buf, sizeof(buf) - 1);
+ /* NOTE: if the length returned by readlink() is sizeof(buf) - 1,
+@@ -120,20 +132,14 @@ Perl_set_caret_X(pTHX) {
to the executable (or returning an error from the readlink). Any
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
@@ -16,3 +57,16 @@ NetBSD's implementation sometimes returns "/"; reject that too.
sv_setpvn(caret_x, buf, len);
return;
}
+-#elif defined(WIN32)
+- char *ansi;
+- WCHAR widename[MAX_PATH];
+- GetModuleFileNameW(NULL, widename, sizeof(widename)/sizeof(WCHAR));
+- ansi = win32_ansipath(widename);
+- sv_setpv(caret_x, ansi);
+- win32_free(ansi);
+- return;
+-#else
++# endif
+ /* Fallback to this: */
+ sv_setpv(caret_x, PL_origargv[0]);
+ #endif