summaryrefslogtreecommitdiff
path: root/user/perl-extutils-cppguess/fix.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-07-10 12:55:06 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-08-07 10:08:23 -0500
commit05c00040eb6b0ff6c73d268d0a67e83b1a6bc228 (patch)
treec854d376c07336e6992782d5cd39afeaff347d01 /user/perl-extutils-cppguess/fix.patch
parent5e2729b8bbe4ef800a44c0a7f10312fda7451ecb (diff)
downloadpackages-05c00040eb6b0ff6c73d268d0a67e83b1a6bc228.tar.gz
packages-05c00040eb6b0ff6c73d268d0a67e83b1a6bc228.tar.bz2
packages-05c00040eb6b0ff6c73d268d0a67e83b1a6bc228.tar.xz
packages-05c00040eb6b0ff6c73d268d0a67e83b1a6bc228.zip
user/perl-extutils-cppguess: Fix tests
Closes: #1174
Diffstat (limited to 'user/perl-extutils-cppguess/fix.patch')
-rw-r--r--user/perl-extutils-cppguess/fix.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/user/perl-extutils-cppguess/fix.patch b/user/perl-extutils-cppguess/fix.patch
new file mode 100644
index 000000000..13ddb2203
--- /dev/null
+++ b/user/perl-extutils-cppguess/fix.patch
@@ -0,0 +1,60 @@
+Fix MSVC detection. I don't know why I did this, either.
+
+Ref: #1174
+
+--- ExtUtils-CppGuess-0.27/lib/ExtUtils/CppGuess.pm.old 2023-11-19 13:19:51.000000000 -0600
++++ ExtUtils-CppGuess-0.27/lib/ExtUtils/CppGuess.pm 2024-07-10 11:26:59.221777726 -0500
+@@ -257,6 +257,12 @@
+ compiler_command => 'clang++',
+ extra_lflags => '-lc++',
+ );
++ } elsif ( $self->_cc_is_msvc( $c_compiler ) ) {
++ %guess = (
++ compiler_command => 'cl',
++ extra_cflags => '-TP -EHsc',
++ extra_lflags => 'msvcprt.lib',
++ );
+ } elsif( $self->_cc_is_sunstudio( $c_compiler ) ) {
+ %guess = (
+ compiler_command => 'CC',
+@@ -277,12 +283,6 @@
+ # Don't use -lstdc++ if Perl was linked with -static-libstdc++ (ActivePerl 5.18+ on Windows)
+ $guess{extra_lflags} = '-lstdc++'
+ unless ($self->_config->{ldflags} || '') =~ /static-libstdc\+\+/;
+- } elsif ( $self->_cc_is_msvc( $c_compiler ) ) {
+- %guess = (
+- compiler_command => 'cl',
+- extra_cflags => '-TP -EHsc',
+- extra_lflags => 'msvcprt.lib',
+- );
+ }
+ $guess{$ENV2VAL{$_}} = $ENV{$_} for grep defined $ENV{$_}, keys %ENV2VAL;
+ if (!%guess) {
+@@ -383,8 +383,12 @@
+
+ sub _cc_is_msvc {
+ my( $self, $cc ) = @_;
+- $self->{is_msvc}
+- = ($self->_os =~ /MSWin32/ and File::Basename::basename($cc) =~ /^cl/i);
++ $self->{is_msvc} = undef;
++ if (
++ ($self->_os =~ /MSWin32/ and File::Basename::basename($cc) =~ /^cl/i)
++ ) {
++ $self->{is_msvc} = 1;
++ }
+ return $self->{is_msvc};
+ }
+
+--- ExtUtils-CppGuess-0.27/t/002_icpp.t.old 2023-11-19 13:11:06.000000000 -0600
++++ ExtUtils-CppGuess-0.27/t/002_icpp.t 2024-07-10 11:27:48.506428703 -0500
+@@ -9,8 +9,8 @@
+ [
+ { os => 'MSWin32', cc => 'cl', config => {ccflags => ''} },
+ {
+- is_sunstudio => 0,
+- is_msvc => 1, is_gcc => 0, is_clang => 0,
++ is_sunstudio => undef,
++ is_msvc => 1, is_gcc => undef, is_clang => undef,
+ compiler_command => 'cl -TP -EHsc',
+ linker_flags => 'msvcprt.lib',
+ },