Compare commits

...

No commits in common. "c8-stream-5.3" and "c10s" have entirely different histories.

11 changed files with 358 additions and 468 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

10
.gitignore vendored
View File

@ -1 +1,9 @@
SOURCES/ExtUtils-ParseXS-3.35.tar.gz
ExtUtils-ParseXS-2.18.tar.gz
/ExtUtils-ParseXS-3.18.tar.gz
/ExtUtils-ParseXS-3.21.tar.gz
/ExtUtils-ParseXS-3.22.tar.gz
/ExtUtils-ParseXS-3.24.tar.gz
/ExtUtils-ParseXS-3.30.tar.gz
/ExtUtils-ParseXS-3.35.tar.gz
/ExtUtils-ParseXS-3.44.tar.gz
/ExtUtils-ParseXS-3.51.tar.gz

View File

@ -1 +0,0 @@
5b40949a789d0ac52a32cbfe622be5018f700ed8 SOURCES/ExtUtils-ParseXS-3.35.tar.gz

View File

@ -1,240 +1,23 @@
From c85261a4cef59150c379ff88a21d0f9ca6374dc2 Mon Sep 17 00:00:00 2001
From bd2b15a246ebcb8cee2c060b18f9157481a084f9 Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik@redhat.com>
Date: Thu, 24 May 2018 09:57:37 +0200
Subject: [PATCH] Upgrade to 3.39
Date: Fri, 7 Jan 2022 11:03:48 +0100
Subject: [PATCH] Add perlxs* man pages
---
Changes | 6 +
lib/ExtUtils/ParseXS.pm | 14 +-
lib/ExtUtils/ParseXS/Constants.pm | 2 +-
lib/ExtUtils/ParseXS/CountLines.pm | 2 +-
lib/ExtUtils/ParseXS/Eval.pm | 6 +-
lib/ExtUtils/ParseXS/Utilities.pm | 2 +-
lib/ExtUtils/Typemaps.pm | 6 +-
lib/ExtUtils/Typemaps/Cmd.pm | 2 +-
lib/ExtUtils/Typemaps/InputMap.pm | 2 +-
lib/ExtUtils/Typemaps/OutputMap.pm | 2 +-
lib/ExtUtils/Typemaps/Type.pm | 2 +-
lib/perlxs.pod | 2354 ++++++++++++++++++++++++++++++++++++
lib/perlxstut.pod | 1401 +++++++++++++++++++++
lib/perlxstypemap.pod | 711 +++++++++++
t/XSTest.xs | 1 +
t/XSUsage.xs | 2 +
16 files changed, 4497 insertions(+), 18 deletions(-)
lib/perlxs.pod | 2429 +++++++++++++++++++++++++++++++++++++++++
lib/perlxstut.pod | 1425 ++++++++++++++++++++++++
lib/perlxstypemap.pod | 711 ++++++++++++
3 files changed, 4565 insertions(+)
create mode 100644 lib/perlxs.pod
create mode 100644 lib/perlxstut.pod
create mode 100644 lib/perlxstypemap.pod
diff --git a/Changes b/Changes
index 0181371..f9fb36e 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,11 @@
Revision history for Perl extension ExtUtils::ParseXS.
+3.36
+ - Make generated code avoid warnings about the "items" variable
+ being unused
+ - Avoid some unused-variable warnings generated by XS code in the
+ test suite
+
3.35 - Mon Jul 31 17:50:00 CET 2017
- Fix ExtUtils-ParseXS/t/*.t that needed '.' in @INC (David Mitchell)
- Remove impediment to compiling under C++11 (Karl Williamson)
diff --git a/lib/ExtUtils/ParseXS.pm b/lib/ExtUtils/ParseXS.pm
index d629cf6..e1f0940 100644
--- a/lib/ExtUtils/ParseXS.pm
+++ b/lib/ExtUtils/ParseXS.pm
@@ -11,12 +11,12 @@ use Symbol;
our $VERSION;
BEGIN {
- $VERSION = '3.35';
+ $VERSION = '3.39';
+ require ExtUtils::ParseXS::Constants; ExtUtils::ParseXS::Constants->VERSION($VERSION);
+ require ExtUtils::ParseXS::CountLines; ExtUtils::ParseXS::CountLines->VERSION($VERSION);
+ require ExtUtils::ParseXS::Utilities; ExtUtils::ParseXS::Utilities->VERSION($VERSION);
+ require ExtUtils::ParseXS::Eval; ExtUtils::ParseXS::Eval->VERSION($VERSION);
}
-use ExtUtils::ParseXS::Constants $VERSION;
-use ExtUtils::ParseXS::CountLines $VERSION;
-use ExtUtils::ParseXS::Utilities $VERSION;
-use ExtUtils::ParseXS::Eval $VERSION;
$VERSION = eval $VERSION if $VERSION =~ /_/;
use ExtUtils::ParseXS::Utilities qw(
@@ -519,9 +519,10 @@ EOF
EOF
}
else {
- # cv likely to be unused
+ # cv and items likely to be unused
print Q(<<"EOF");
# PERL_UNUSED_VAR(cv); /* -W */
+# PERL_UNUSED_VAR(items); /* -W */
EOF
}
@@ -871,6 +872,7 @@ EOF
#XS_EUPXS(XS_$self->{Packid}_nil)
#{
# dXSARGS;
+# PERL_UNUSED_VAR(items);
# XSRETURN_EMPTY;
#}
#
diff --git a/lib/ExtUtils/ParseXS/Constants.pm b/lib/ExtUtils/ParseXS/Constants.pm
index 2150fb8..45b5674 100644
--- a/lib/ExtUtils/ParseXS/Constants.pm
+++ b/lib/ExtUtils/ParseXS/Constants.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use Symbol;
-our $VERSION = '3.35';
+our $VERSION = '3.39';
=head1 NAME
diff --git a/lib/ExtUtils/ParseXS/CountLines.pm b/lib/ExtUtils/ParseXS/CountLines.pm
index ad86b57..5b48449 100644
--- a/lib/ExtUtils/ParseXS/CountLines.pm
+++ b/lib/ExtUtils/ParseXS/CountLines.pm
@@ -1,7 +1,7 @@
package ExtUtils::ParseXS::CountLines;
use strict;
-our $VERSION = '3.35';
+our $VERSION = '3.39';
our $SECTION_END_MARKER;
diff --git a/lib/ExtUtils/ParseXS/Eval.pm b/lib/ExtUtils/ParseXS/Eval.pm
index 6b06bf5..9eba5e5 100644
--- a/lib/ExtUtils/ParseXS/Eval.pm
+++ b/lib/ExtUtils/ParseXS/Eval.pm
@@ -2,7 +2,7 @@ package ExtUtils::ParseXS::Eval;
use strict;
use warnings;
-our $VERSION = '3.35';
+our $VERSION = '3.39';
=head1 NAME
@@ -29,7 +29,7 @@ Warns the contents of C<$@> if any.
Not all these variables are necessarily considered "public" wrt. use in
typemaps, so beware. Variables set up from the ExtUtils::ParseXS object:
- $Package $Alias $func_name $Full_func_name $pname
+ $Package $ALIAS $func_name $Full_func_name $pname
Variables set up from C<$other_hashref>:
@@ -63,7 +63,7 @@ Warns the contents of C<$@> if any.
Not all these variables are necessarily considered "public" wrt. use in
typemaps, so beware. Variables set up from the ExtUtils::ParseXS object:
- $Package $Alias $func_name $Full_func_name $pname
+ $Package $ALIAS $func_name $Full_func_name $pname
Variables set up from C<$other_hashref>:
diff --git a/lib/ExtUtils/ParseXS/Utilities.pm b/lib/ExtUtils/ParseXS/Utilities.pm
index bc1e098..ae25b33 100644
--- a/lib/ExtUtils/ParseXS/Utilities.pm
+++ b/lib/ExtUtils/ParseXS/Utilities.pm
@@ -5,7 +5,7 @@ use Exporter;
use File::Spec;
use ExtUtils::ParseXS::Constants ();
-our $VERSION = '3.35';
+our $VERSION = '3.39';
our (@ISA, @EXPORT_OK);
@ISA = qw(Exporter);
diff --git a/lib/ExtUtils/Typemaps.pm b/lib/ExtUtils/Typemaps.pm
index 992d15b..a762322 100644
--- a/lib/ExtUtils/Typemaps.pm
+++ b/lib/ExtUtils/Typemaps.pm
@@ -2,7 +2,7 @@ package ExtUtils::Typemaps;
use 5.006001;
use strict;
use warnings;
-our $VERSION = '3.35';
+our $VERSION = '3.38';
require ExtUtils::ParseXS;
require ExtUtils::ParseXS::Constants;
@@ -781,7 +781,9 @@ corresponding OUTPUT code:
$var.context.value().size());
',
'T_OUT' => ' {
- GV *gv = newGVgen("$Package");
+ GV *gv = (GV *)sv_newmortal();
+ gv_init_pvn(gv, gv_stashpvs("$Package",1),
+ "__ANONIO__",10,0);
if ( do_open(gv, "+>&", 3, FALSE, 0, 0, $var) )
sv_setsv(
$arg,
diff --git a/lib/ExtUtils/Typemaps/Cmd.pm b/lib/ExtUtils/Typemaps/Cmd.pm
index 7ff0780..3c33f54 100644
--- a/lib/ExtUtils/Typemaps/Cmd.pm
+++ b/lib/ExtUtils/Typemaps/Cmd.pm
@@ -2,7 +2,7 @@ package ExtUtils::Typemaps::Cmd;
use 5.006001;
use strict;
use warnings;
-our $VERSION = '3.35';
+our $VERSION = '3.38';
use ExtUtils::Typemaps;
diff --git a/lib/ExtUtils/Typemaps/InputMap.pm b/lib/ExtUtils/Typemaps/InputMap.pm
index b626973..bf19df1 100644
--- a/lib/ExtUtils/Typemaps/InputMap.pm
+++ b/lib/ExtUtils/Typemaps/InputMap.pm
@@ -2,7 +2,7 @@ package ExtUtils::Typemaps::InputMap;
use 5.006001;
use strict;
use warnings;
-our $VERSION = '3.35';
+our $VERSION = '3.38';
=head1 NAME
diff --git a/lib/ExtUtils/Typemaps/OutputMap.pm b/lib/ExtUtils/Typemaps/OutputMap.pm
index 8c72e5b..90adb48 100644
--- a/lib/ExtUtils/Typemaps/OutputMap.pm
+++ b/lib/ExtUtils/Typemaps/OutputMap.pm
@@ -2,7 +2,7 @@ package ExtUtils::Typemaps::OutputMap;
use 5.006001;
use strict;
use warnings;
-our $VERSION = '3.35';
+our $VERSION = '3.38';
=head1 NAME
diff --git a/lib/ExtUtils/Typemaps/Type.pm b/lib/ExtUtils/Typemaps/Type.pm
index 7909bbe..01bd51d 100644
--- a/lib/ExtUtils/Typemaps/Type.pm
+++ b/lib/ExtUtils/Typemaps/Type.pm
@@ -4,7 +4,7 @@ use strict;
use warnings;
require ExtUtils::Typemaps;
-our $VERSION = '3.35';
+our $VERSION = '3.38';
=head1 NAME
diff --git a/lib/perlxs.pod b/lib/perlxs.pod
new file mode 100644
index 0000000..1419ee0
index 0000000..aa7ccad
--- /dev/null
+++ b/lib/perlxs.pod
@@ -0,0 +1,2354 @@
@@ -0,0 +1,2429 @@
+=head1 NAME
+
+perlxs - XS language reference manual
@ -259,8 +42,8 @@ index 0000000..1419ee0
+calling conventions.
+
+The glue code pulls the arguments from the Perl stack, converts these
+Perl values to the formats expected by a C function, call this C function,
+transfers the return values of the C function back to Perl.
+Perl values to the formats expected by a C function, calls this C function,
+and then transfers the return values of the C function back to Perl.
+Return values here may be a conventional C return value or any C
+function arguments that may serve as output parameters. These return
+values may be passed back to Perl either by putting them on the
@ -316,6 +99,11 @@ index 0000000..1419ee0
+significantly more convenient mechanism for creating the extension
+glue code. See L<http://www.swig.org/> for more information.
+
+For simple bindings to C libraries as well as other machine code libraries,
+consider instead using the much simpler
+L<libffi|http://sourceware.org/libffi/> interface via CPAN modules like
+L<FFI::Platypus> or L<FFI::Raw>.
+
+=head2 On The Road
+
+Many of the examples which follow will concentrate on creating an interface
@ -431,7 +219,7 @@ index 0000000..1419ee0
+ bool make_char_uppercase(char *c);
+
+are used in absolutely incompatible manner. Parameters to these functions
+could be described B<xsubpp> like this:
+could be described to B<xsubpp> like this:
+
+ char * s
+ char &c
@ -835,7 +623,7 @@ index 0000000..1419ee0
+
+ bool_t
+ rpcb_gettime(host,timep)
+ char *host = (char *)SvPV_nolen($arg);
+ char *host = (char *)SvPVbyte_nolen($arg);
+ time_t &timep = 0;
+ OUTPUT:
+ timep
@ -862,7 +650,7 @@ index 0000000..1419ee0
+ bool_t
+ rpcb_gettime(host,timep)
+ time_t &timep; /* \$v{timep}=@{[$v{timep}=$arg]} */
+ char *host + SvOK($v{timep}) ? SvPV_nolen($arg) : NULL;
+ char *host + SvOK($v{timep}) ? SvPVbyte_nolen($arg) : NULL;
+ OUTPUT:
+ timep
+
@ -1225,7 +1013,7 @@ index 0000000..1419ee0
+ char *host = "localhost";
+ CODE:
+ if( items > 1 )
+ host = (char *)SvPV_nolen(ST(1));
+ host = (char *)SvPVbyte_nolen(ST(1));
+ RETVAL = rpcb_gettime( host, &timep );
+ OUTPUT:
+ timep
@ -1526,7 +1314,7 @@ index 0000000..1419ee0
+ char *host = "localhost";
+ CODE:
+ if( items > 1 )
+ host = (char *)SvPV_nolen(ST(1));
+ host = (char *)SvPVbyte_nolen(ST(1));
+ RETVAL = rpcb_gettime( host, &timep );
+ OUTPUT:
+ timep
@ -1564,6 +1352,46 @@ index 0000000..1419ee0
+ OUTPUT:
+ timep
+
+A warning will be produced when you create more than one alias to the same
+value. This may be worked around in a backwards compatible way by creating
+multiple defines which resolve to the same value, or with a modern version
+of ExtUtils::ParseXS you can use a symbolic alias, which are denoted with
+a C<< => >> instead of a C<< = >>. For instance you could change the above
+so that the alias section looked like this:
+
+ ALIAS:
+ FOO::gettime = 1
+ BAR::getit = 2
+ BAZ::gettime => FOO::gettime
+
+this would have the same effect as this:
+
+ ALIAS:
+ FOO::gettime = 1
+ BAR::getit = 2
+ BAZ::gettime = 1
+
+except that the latter will produce warnings during the build process. A
+mechanism that would work in a backwards compatible way with older
+versions of our tool chain would be to do this:
+
+ #define FOO_GETTIME 1
+ #define BAR_GETIT 2
+ #define BAZ_GETTIME 1
+
+ bool_t
+ rpcb_gettime(host,timep)
+ char *host
+ time_t &timep
+ ALIAS:
+ FOO::gettime = FOO_GETTIME
+ BAR::getit = BAR_GETIT
+ BAZ::gettime = BAZ_GETTIME
+ INIT:
+ printf("# ix = %d\n", ix );
+ OUTPUT:
+ timep
+
+=head2 The OVERLOAD: Keyword
+
+Instead of writing an overloaded interface using pure Perl, you
@ -1980,8 +1808,8 @@ index 0000000..1419ee0
+ if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) )
+ $var = ($type)SvIV((SV*)SvRV( $arg ));
+ else{
+ warn("${Package}::$func_name() -- " .
+ "$var is not a blessed SV reference");
+ warn(\"${Package}::$func_name() -- \"
+ \"$var is not a blessed SV reference\");
+ XSRETURN_UNDEF;
+ }
+
@ -2217,6 +2045,8 @@ index 0000000..1419ee0
+Always place the START_MY_CXT macro directly after the declaration
+of C<my_cxt_t>.
+
+=for apidoc Amnh||START_MY_CXT
+
+=item MY_CXT_INIT
+
+The MY_CXT_INIT macro initializes storage for the C<my_cxt_t> struct.
@ -2226,11 +2056,15 @@ index 0000000..1419ee0
+interpreter instance, except for interpreters cloned from existing ones.
+(But see L</MY_CXT_CLONE> below.)
+
+=for apidoc Amnh||MY_CXT_INIT
+
+=item dMY_CXT
+
+Use the dMY_CXT macro (a declaration) in all the functions that access
+MY_CXT.
+
+=for apidoc Amnh||dMY_CXT
+
+=item MY_CXT
+
+Use the MY_CXT macro to access members of the C<my_cxt_t> struct. For
@ -2251,6 +2085,14 @@ index 0000000..1419ee0
+of invoking it in each function it is possible to pass the declaration
+onto other functions using the C<aMY_CXT>/C<pMY_CXT> macros, eg
+
+=for apidoc Amnh||_aMY_CXT
+=for apidoc Amnh||aMY_CXT
+=for apidoc Amnh||aMY_CXT_
+=for apidoc Amnh||_pMY_CXT
+=for apidoc Amnh||pMY_CXT
+=for apidoc Amnh||pMY_CXT_
+=for apidoc Amnh||MY_CXT
+
+ void sub1() {
+ dMY_CXT;
+ MY_CXT.index = 1;
@ -2273,6 +2115,8 @@ index 0000000..1419ee0
+C<CLONE()> function), causes a byte-for-byte copy of the structure to be
+taken, and any future dMY_CXT will cause the copy to be accessed instead.
+
+=for apidoc Amnh||MY_CXT_CLONE
+
+=item MY_CXT_INIT_INTERP(my_perl)
+
+=item dMY_CXT_INTERP(my_perl)
@ -2319,7 +2163,8 @@ index 0000000..1419ee0
+ #include "perl.h"
+ #include "XSUB.h"
+
+ #include <rpc/rpc.h>
+ /* Note: On glibc 2.13 and earlier, this needs be <rpc/rpc.h> */
+ #include <tirpc/rpc.h>
+
+ typedef struct netconfig Netconfig;
+
@ -2379,6 +2224,8 @@ index 0000000..1419ee0
+ print "time = $a\n";
+ print "netconf = $netconf\n";
+
+In Makefile.PL add -ltirpc and -I/usr/include/tirpc.
+
+=head1 CAVEATS
+
+XS code has full access to system calls including C library functions.
@ -2489,7 +2336,7 @@ index 0000000..1419ee0
+continues to use C<POSIX::setlocale()>, and the interpreter translates
+that into the per-thread functions.
+
+All other locale-senstive functions automatically use the per-thread
+All other locale-sensitive functions automatically use the per-thread
+locale, if that is turned on, and failing that, the global locale. Thus
+calls to C<setlocale> are ineffective on POSIX systems for the current
+thread if that thread is using a per-thread locale. If perl is compiled
@ -2582,19 +2429,30 @@ index 0000000..1419ee0
+=head1 XS VERSION
+
+This document covers features supported by C<ExtUtils::ParseXS>
+(also known as C<xsubpp>) 3.13_01.
+(also known as C<xsubpp>) 3.51
+
+=head1 AUTHOR DIAGNOSTICS
+
+As of version 3.49 certain warnings are disabled by default. While developing
+you can set C<$ENV{AUTHOR_WARNINGS}> to true in your environment or in your
+Makefile.PL, or set C<$ExtUtils::ParseXS::AUTHOR_WARNINGS> to true via code, or
+pass C<< author_warnings=>1 >> into process_file() explicitly. Currently this will
+enable stricter alias checking but more warnings might be added in the future.
+The kind of warnings this will enable are only helpful to the author of the XS
+file, and the diagnostics produced will not include installation specific
+details so they are only useful to the maintainer of the XS code itself.
+
+=head1 AUTHOR
+
+Originally written by Dean Roehrich <F<roehrich@cray.com>>.
+
+Maintained since 1996 by The Perl Porters <F<perlbug@perl.org>>.
+Maintained since 1996 by The Perl Porters <F<perl5-porters@perl.org>>.
diff --git a/lib/perlxstut.pod b/lib/perlxstut.pod
new file mode 100644
index 0000000..ef154ad
index 0000000..fcafa58
--- /dev/null
+++ b/lib/perlxstut.pod
@@ -0,0 +1,1401 @@
@@ -0,0 +1,1425 @@
+=head1 NAME
+
+perlxstut - Tutorial for writing XSUBs
@ -2712,14 +2570,15 @@ index 0000000..ef154ad
+The file Makefile.PL should look something like this:
+
+ use ExtUtils::MakeMaker;
+
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.
+ WriteMakefile(
+ NAME => 'Mytest',
+ VERSION_FROM => 'Mytest.pm', # finds $VERSION
+ LIBS => [''], # e.g., '-lm'
+ DEFINE => '', # e.g., '-DHAVE_SOMETHING'
+ INC => '', # e.g., '-I/usr/include/other'
+ NAME => 'Mytest',
+ VERSION_FROM => 'Mytest.pm', # finds $VERSION
+ LIBS => [''], # e.g., '-lm'
+ DEFINE => '', # e.g., '-DHAVE_SOMETHING'
+ INC => '-I', # e.g., '-I. -I/usr/include/other'
+ );
+
+The file Mytest.pm should start with something like this:
@ -2873,9 +2732,9 @@ index 0000000..ef154ad
+ # so read its man page ( perldoc Test::More ) for help writing this
+ # test script.
+
+ is(&Mytest::is_even(0), 1);
+ is(&Mytest::is_even(1), 0);
+ is(&Mytest::is_even(2), 1);
+ is( Mytest::is_even(0), 1 );
+ is( Mytest::is_even(1), 0 );
+ is( Mytest::is_even(2), 1 );
+
+We will be calling the test script through the command "C<make test>". You
+should see output that looks something like this:
@ -2987,16 +2846,32 @@ index 0000000..ef154ad
+
+Edit the Makefile.PL file so that the corresponding line looks like this:
+
+ 'LIBS' => ['-lm'], # e.g., '-lm'
+ LIBS => ['-lm'], # e.g., '-lm'
+
+Generate the Makefile and run make. Change the test number in Mytest.t to
+"9" and add the following tests:
+
+ $i = -1.5; &Mytest::round($i); is( $i, -2.0 );
+ $i = -1.1; &Mytest::round($i); is( $i, -1.0 );
+ $i = 0.0; &Mytest::round($i); is( $i, 0.0 );
+ $i = 0.5; &Mytest::round($i); is( $i, 1.0 );
+ $i = 1.2; &Mytest::round($i); is( $i, 1.0 );
+ my $i;
+
+ $i = -1.5;
+ Mytest::round($i);
+ is( $i, -2.0, 'Rounding -1.5 to -2.0' );
+
+ $i = -1.1;
+ Mytest::round($i);
+ is( $i, -1.0, 'Rounding -1.1 to -1.0' );
+
+ $i = 0.0;
+ Mytest::round($i);
+ is( $i, 0.0, 'Rounding 0.0 to 0.0' );
+
+ $i = 0.5;
+ Mytest::round($i);
+ is( $i, 1.0, 'Rounding 0.5 to 1.0' );
+
+ $i = 1.2;
+ Mytest::round($i);
+ is( $i, 1.0, 'Rounding 1.2 to 1.0' );
+
+Running "C<make test>" should now print out that all nine tests are okay.
+
@ -3004,7 +2879,7 @@ index 0000000..ef154ad
+scalar variable. You might be wondering if you can round a constant or
+literal. To see what happens, temporarily add the following line to Mytest.t:
+
+ &Mytest::round(3);
+ Mytest::round(3);
+
+Run "C<make test>" and notice that Perl dies with a fatal error. Perl won't
+let you change the value of constants!
@ -3131,7 +3006,7 @@ index 0000000..ef154ad
+Also create a file mylib.c that looks like this:
+
+ #include <stdlib.h>
+ #include "./mylib.h"
+ #include "mylib.h"
+
+ double
+ foo(int a, long b, const char *c)
@ -3144,9 +3019,9 @@ index 0000000..ef154ad
+ use ExtUtils::MakeMaker;
+ $Verbose = 1;
+ WriteMakefile(
+ NAME => 'Mytest2::mylib',
+ SKIP => [qw(all static static_lib dynamic dynamic_lib)],
+ clean => {'FILES' => 'libmylib$(LIB_EXT)'},
+ NAME => 'Mytest2::mylib',
+ SKIP => [qw(all static static_lib dynamic dynamic_lib)],
+ clean => {'FILES' => 'libmylib$(LIB_EXT)'},
+ );
+
+
@ -3173,7 +3048,7 @@ index 0000000..ef154ad
+We will now create the main top-level Mytest2 files. Change to the directory
+above Mytest2 and run the following command:
+
+ % h2xs -O -n Mytest2 ./Mytest2/mylib/mylib.h
+ % h2xs -O -n Mytest2 Mytest2/mylib/mylib.h
+
+This will print out a warning about overwriting Mytest2, but that's okay.
+Our files are stored in Mytest2/mylib, and will be untouched.
@ -3184,12 +3059,12 @@ index 0000000..ef154ad
+the WriteMakefile call so that it looks like this:
+
+ WriteMakefile(
+ 'NAME' => 'Mytest2',
+ 'VERSION_FROM' => 'Mytest2.pm', # finds $VERSION
+ 'LIBS' => [''], # e.g., '-lm'
+ 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
+ 'INC' => '', # e.g., '-I/usr/include/other'
+ 'MYEXTLIB' => 'mylib/libmylib$(LIB_EXT)',
+ NAME => 'Mytest2',
+ VERSION_FROM => 'Mytest2.pm', # finds $VERSION
+ LIBS => [''], # e.g., '-lm'
+ DEFINE => '', # e.g., '-DHAVE_SOMETHING'
+ INC => '', # e.g., '-I/usr/include/other'
+ MYEXTLIB => 'mylib/libmylib$(LIB_EXT)',
+ );
+
+and then at the end add a subroutine (which will override the pre-existing
@ -3203,9 +3078,7 @@ index 0000000..ef154ad
+ ';
+ }
+
+Let's also fix the MANIFEST file so that it accurately reflects the contents
+of our extension. The single line that says "mylib" should be replaced by
+the following three lines:
+Let's also fix the MANIFEST file by appending the following three lines:
+
+ mylib/Makefile.PL
+ mylib/mylib.c
@ -3239,12 +3112,12 @@ index 0000000..ef154ad
+Makefile in the mylib directory. Run make and watch that it does cd into
+the mylib directory and run make in there as well.
+
+Now edit the Mytest2.t script and change the number of tests to "4",
+Now edit the Mytest2.t script and change the number of tests to "5",
+and add the following lines to the end of the script:
+
+ is( &Mytest2::foo(1, 2, "Hello, world!"), 7 );
+ is( &Mytest2::foo(1, 2, "0.0"), 7 );
+ ok( abs(&Mytest2::foo(0, 0, "-3.4") - 0.6) <= 0.01 );
+ is( Mytest2::foo( 1, 2, "Hello, world!" ), 7 );
+ is( Mytest2::foo( 1, 2, "0.0" ), 7 );
+ ok( abs( Mytest2::foo( 0, 0, "-3.4" ) - 0.6 ) <= 0.01 );
+
+(When dealing with floating-point comparisons, it is best to not check for
+equality, but rather that the difference between the expected and actual
@ -3304,7 +3177,7 @@ index 0000000..ef154ad
+
+=head2 Anatomy of .xs file
+
+The .xs file of L<"EXAMPLE 4"> contained some new elements. To understand
+The .xs file of L</EXAMPLE 4> contained some new elements. To understand
+the meaning of these elements, pay attention to the line which reads
+
+ MODULE = Mytest2 PACKAGE = Mytest2
@ -3334,7 +3207,7 @@ index 0000000..ef154ad
+
+=head2 Getting the fat out of XSUBs
+
+In L<"EXAMPLE 4"> the second part of .xs file contained the following
+In L</EXAMPLE 4> the second part of .xs file contained the following
+description of an XSUB:
+
+ double
@ -3614,9 +3487,12 @@ index 0000000..ef154ad
+Also add the following code segment to Mytest.t while incrementing the "9"
+tests to "11":
+
+ @a = &Mytest::statfs("/blech");
+ my @a;
+
+ @a = Mytest::statfs("/blech");
+ ok( scalar(@a) == 1 && $a[0] == 2 );
+ @a = &Mytest::statfs("/");
+
+ @a = Mytest::statfs("/");
+ is( scalar(@a), 7 );
+
+=head2 New Things in this Example
@ -3722,7 +3598,8 @@ index 0000000..ef154ad
+ for (n = 0; n <= numpaths; n++) {
+ HV * rh;
+ STRLEN l;
+ char * fn = SvPV(*av_fetch((AV *)SvRV(paths), n, 0), l);
+ SV * path = *av_fetch((AV *)SvRV(paths), n, 0);
+ char * fn = SvPVbyte(path, l);
+
+ i = statfs(fn, &buf);
+ if (i != 0) {
@ -3749,7 +3626,7 @@ index 0000000..ef154ad
+And add the following code to Mytest.t, while incrementing the "11"
+tests to "13":
+
+ $results = Mytest::multi_statfs([ '/', '/blech' ]);
+ my $results = Mytest::multi_statfs([ '/', '/blech' ]);
+ ok( ref $results->[0] );
+ ok( ! ref $results->[1] );
+
@ -3843,21 +3720,24 @@ index 0000000..ef154ad
+Suppose that for some strange reason we need a wrapper around the
+standard C library function C<fputs()>. This is all we need:
+
+ #define PERLIO_NOT_STDIO 0
+ #define PERL_NO_GET_CONTEXT
+ #include "EXTERN.h"
+ #include "perl.h"
+ #include "XSUB.h"
+ #define PERLIO_NOT_STDIO 0 /* For co-existence with stdio only */
+ #define PERL_NO_GET_CONTEXT /* This is more efficient */
+ #include "EXTERN.h"
+ #include "perl.h"
+ #include "XSUB.h"
+
+ #include <stdio.h>
+ #include <stdio.h>
+
+ int
+ fputs(s, stream)
+ char * s
+ FILE * stream
+ int
+ fputs(s, stream)
+ char * s
+ FILE * stream
+
+The real work is done in the standard typemap.
+
+For more details, see
+L<perlapio/"Co-existence with stdio">.
+
+B<But> you lose all the fine stuff done by the perlio layers. This
+calls the stdio function C<fputs()>, which knows nothing about them.
+
@ -3979,7 +3859,7 @@ index 0000000..ef154ad
+=head1 See also
+
+For more information, consult L<perlguts>, L<perlapi>, L<perlxs>, L<perlmod>,
+and L<perlpod>.
+L<perlapio>, and L<perlpod>
+
+=head1 Author
+
@ -3993,9 +3873,11 @@ index 0000000..ef154ad
+
+Changes for h2xs as of Perl 5.8.x by Renee Baecker
+
+This document is now maintained as part of Perl itself.
+
+=head2 Last Changed
+
+2012-01-20
+2020-10-05
diff --git a/lib/perlxstypemap.pod b/lib/perlxstypemap.pod
new file mode 100644
index 0000000..7d1f73c
@ -4713,31 +4595,6 @@ index 0000000..7d1f73c
+
+=back
+
diff --git a/t/XSTest.xs b/t/XSTest.xs
index 89df22f..452d3db 100644
--- a/t/XSTest.xs
+++ b/t/XSTest.xs
@@ -76,6 +76,7 @@ bool
T_BOOL_2(in)
bool in
CODE:
+ PERL_UNUSED_VAR(RETVAL);
OUTPUT: in
void
diff --git a/t/XSUsage.xs b/t/XSUsage.xs
index 9a8d93d..ed3c8f8 100644
--- a/t/XSUsage.xs
+++ b/t/XSUsage.xs
@@ -35,6 +35,8 @@ xsusage_two()
ALIAS:
two_x = 1
FOO::two = 2
+ INIT:
+ PERL_UNUSED_VAR(ix);
int
interface_v_i()
--
2.14.3
2.31.1

View File

@ -1,126 +0,0 @@
From 4f8996e1ea5a5f24b1d5b4462f56a917daa67a47 Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik@redhat.com>
Date: Fri, 26 Apr 2019 15:59:36 +0200
Subject: [PATCH] Upgrade to 3.40
The generated prototype (with PROTOTYPES: ENABLE) would include
OUTLIST parameters, but these aren't arguments to the perl function.
---
lib/ExtUtils/ParseXS.pm | 4 ++--
lib/ExtUtils/ParseXS/Constants.pm | 2 +-
lib/ExtUtils/ParseXS/CountLines.pm | 2 +-
lib/ExtUtils/ParseXS/Eval.pm | 2 +-
lib/ExtUtils/ParseXS/Utilities.pm | 2 +-
t/002-more.t | 7 +++++--
6 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/lib/ExtUtils/ParseXS.pm b/lib/ExtUtils/ParseXS.pm
index e1f0940..fba7f4d 100644
--- a/lib/ExtUtils/ParseXS.pm
+++ b/lib/ExtUtils/ParseXS.pm
@@ -11,7 +11,7 @@ use Symbol;
our $VERSION;
BEGIN {
- $VERSION = '3.39';
+ $VERSION = '3.40';
require ExtUtils::ParseXS::Constants; ExtUtils::ParseXS::Constants->VERSION($VERSION);
require ExtUtils::ParseXS::CountLines; ExtUtils::ParseXS::CountLines->VERSION($VERSION);
require ExtUtils::ParseXS::Utilities; ExtUtils::ParseXS::Utilities->VERSION($VERSION);
@@ -467,7 +467,7 @@ EOM
$self->{defaults}->{$args[$i]} = $2;
$self->{defaults}->{$args[$i]} =~ s/"/\\"/g;
}
- $self->{proto_arg}->[$i+1] = '$';
+ $self->{proto_arg}->[$i+1] = '$' unless $only_C_inlist_ref->{$args[$i]};
}
my $min_args = $num_args - $extra_args;
$report_args =~ s/"/\\"/g;
diff --git a/lib/ExtUtils/ParseXS/Constants.pm b/lib/ExtUtils/ParseXS/Constants.pm
index 45b5674..2c392e3 100644
--- a/lib/ExtUtils/ParseXS/Constants.pm
+++ b/lib/ExtUtils/ParseXS/Constants.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use Symbol;
-our $VERSION = '3.39';
+our $VERSION = '3.40';
=head1 NAME
diff --git a/lib/ExtUtils/ParseXS/CountLines.pm b/lib/ExtUtils/ParseXS/CountLines.pm
index 5b48449..a9258f9 100644
--- a/lib/ExtUtils/ParseXS/CountLines.pm
+++ b/lib/ExtUtils/ParseXS/CountLines.pm
@@ -1,7 +1,7 @@
package ExtUtils::ParseXS::CountLines;
use strict;
-our $VERSION = '3.39';
+our $VERSION = '3.40';
our $SECTION_END_MARKER;
diff --git a/lib/ExtUtils/ParseXS/Eval.pm b/lib/ExtUtils/ParseXS/Eval.pm
index 9eba5e5..840bac7 100644
--- a/lib/ExtUtils/ParseXS/Eval.pm
+++ b/lib/ExtUtils/ParseXS/Eval.pm
@@ -2,7 +2,7 @@ package ExtUtils::ParseXS::Eval;
use strict;
use warnings;
-our $VERSION = '3.39';
+our $VERSION = '3.40';
=head1 NAME
diff --git a/lib/ExtUtils/ParseXS/Utilities.pm b/lib/ExtUtils/ParseXS/Utilities.pm
index ae25b33..58f3856 100644
--- a/lib/ExtUtils/ParseXS/Utilities.pm
+++ b/lib/ExtUtils/ParseXS/Utilities.pm
@@ -5,7 +5,7 @@ use Exporter;
use File::Spec;
use ExtUtils::ParseXS::Constants ();
-our $VERSION = '3.39';
+our $VERSION = '3.40';
our (@ISA, @EXPORT_OK);
@ISA = qw(Exporter);
diff --git a/t/002-more.t b/t/002-more.t
index 4aaa3ab..e982290 100644
--- a/t/002-more.t
+++ b/t/002-more.t
@@ -9,7 +9,7 @@ use ExtUtils::CBuilder;
use attributes;
use overload;
-plan tests => 29;
+plan tests => 30;
my ($source_file, $obj_file, $lib_file);
@@ -48,7 +48,7 @@ SKIP: {
}
SKIP: {
- skip "no dynamic loading", 25
+ skip "no dynamic loading", 26
if !$b->have_compiler || !$Config{usedl};
my $module = 'XSMore';
$lib_file = $b->link( objects => $obj_file, module_name => $module );
@@ -92,6 +92,9 @@ SKIP: {
is_deeply [XSMore::outlist()], [ord('a'), ord('b')], 'the OUTLIST keyword';
+ # eval so compile-time sees any prototype
+ is_deeply [ eval 'XSMore::outlist()' ], [ord('a'), ord('b')], 'OUTLIST prototypes';
+
is XSMore::len("foo"), 3, 'the length keyword';
is XSMore::sum(5, 9), 14, 'the INCLUDE_COMMAND directive';
--
2.20.1

15
gating.yaml Normal file
View File

@ -0,0 +1,15 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
# RHEL
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,19 +1,15 @@
%global base_version 3.35
%global base_version 3.51
Name: perl-ExtUtils-ParseXS
# Epoch to compete with perl.spec
Epoch: 1
Version: 3.40
Release: 439%{?dist}
Version: 3.51
Release: 511%{?dist}
Summary: Module and a script for converting Perl XS code into C code
License: GPL+ or Artistic
License: GPL-1.0-or-later OR Artistic-1.0-Perl
URL: https://metacpan.org/release/ExtUtils-ParseXS
Source0: https://cpan.metacpan.org/authors/id/S/SM/SMUELLER/ExtUtils-ParseXS-%{base_version}.tar.gz
# Unbundled from perl 5.28.0-RC1
Patch0: ExtUtils-ParseXS-3.35-Upgrade-to-3.39.patch
# Unbundled from perl 5.29.10
# Fix generating Perl prototypes for XS functions with OUTLIST parameters,
# RT#133654
Patch1: ExtUtils-ParseXS-3.39-Upgrade-to-3.40.patch
Source0: https://cpan.metacpan.org/modules/by-module/ExtUtils/ExtUtils-ParseXS-%{base_version}.tar.gz
# # Added man page perlxs* which are missing in tarball
Patch0: ExtUtils-ParseXS-3.51-Add-perlxs-man-pages.patch
BuildArch: noarch
BuildRequires: coreutils
BuildRequires: make
@ -42,44 +38,155 @@ BuildRequires: perl(File::Temp)
BuildRequires: perl(lib)
BuildRequires: perl(overload)
BuildRequires: perl(Test::More) >= 0.47
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires: perl(Exporter) >= 5.57
# Remove under-specified dependencies
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Exporter\\)$
# Filter modules bundled for tests
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
%global __requires_exclude %{__requires_exclude}|^perl\\(ExtUtils::Typemaps::Test\\)
%global __requires_exclude %{__requires_exclude}|^perl\\((TypemapTest::Foo\|IncludeTester\|PrimitiveCapture)\\)
%description
ExtUtils::ParseXS will compile XS code into C code by embedding the
constructs necessary to let C functions manipulate Perl values and creates
the glue necessary to let Perl access those functions.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n ExtUtils-ParseXS-%{base_version}
%patch0 -p1
%patch1 -p1
%patch -P0 -p1
# Help generators to recognize Perl scripts
for F in t/*.t; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
chmod +x "$F"
done
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1
make %{?_smp_mflags}
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build}
%install
make pure_install DESTDIR=$RPM_BUILD_ROOT
%{make_install}
%{_fixperms} $RPM_BUILD_ROOT/*
# Do not install xsubpp twice, RT#117289
rm $RPM_BUILD_ROOT%{perl_vendorlib}/ExtUtils/xsubpp
ln -s ../../../../bin/xsubpp $RPM_BUILD_ROOT%{perl_vendorlib}/ExtUtils/
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/bash
set -e
# Some tests write into temporary files/directories. The easiest solution
# is to copy the tests into a writable directory and execute them from there.
DIR=$(mktemp -d)
pushd "$DIR"
cp -a %{_libexecdir}/%{name}/* ./
prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
popd
rm -rf "$DIR"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
make test
%files
%doc Changes README
%{_bindir}/*
%{perl_vendorlib}/*
%{_mandir}/man1/*
%{_mandir}/man3/*
%doc Changes
%{_bindir}/xsubpp
%{perl_vendorlib}/ExtUtils*
%{perl_vendorlib}/perlxs*
%{_mandir}/man1/xsubpp*
%{_mandir}/man3/ExtUtils*
%{_mandir}/man3/perlxs*
%files tests
%{_libexecdir}/%{name}
%changelog
* Mon Aug 26 2024 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.51-510
- Fix filter of dependencies
* Thu Jul 18 2024 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.51-510
- Increase release to favour standalone package
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:3.51-504
- Bump release for June 2024 mass rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.51-503
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.51-502
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Sep 04 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.51-501
- Replace patch update from Perl release by CPAN upstream 3.51 (rhbz#2237243)
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.51-500
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jul 11 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.51-499
- Increase release to favour standalone package
* Mon Jun 12 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.51-1
- Upgrade to 3.51 as provided in perl-5.37.12
* Wed May 17 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.50-1
- Upgrade to 3.50 as provided in perl-5.37.11
- Package tests
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.45-490
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.45-489
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon May 30 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.45-488
- Increase release to favour standalone package
* Thu May 12 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.45-1
- Upgrade to 3.45 as provided in perl-5.35.11
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.44-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jan 07 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.44-1
- 3.44 bump
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.43-478
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.43-477
- Increase release to favour standalone package
* Thu May 06 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.43-1
- Upgrade to 3.43 as provided in perl-5.34.0
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.40-458
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.40-457
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jun 22 2020 Jitka Plesnikova <jplesnik@redhat.com> - 1:3.40-456
- Increase release to favour standalone package
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.40-440
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.40-439
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

12
plans/internal.fmf Normal file
View File

@ -0,0 +1,12 @@
summary: Private (RHEL) beakerlib tests
enabled: false
adjust:
- when: distro == rhel
enabled: true
because: private tests are accesible only within rhel pipline
discover:
- name: rhel
how: fmf
url: https://pkgs.devel.redhat.com/git/tests/perl-ExtUtils-ParseXS
execute:
how: tmt

5
plans/sanity.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Sanity tests
discover:
how: fmf
execute:
how: tmt

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (ExtUtils-ParseXS-3.51.tar.gz) = f8e3a064577b62ee17c4b55349c2044da7e4075cd6da20f7b2c6b92a8522209b594a0cecd0853744f15c4fc71cb9bc3d23f05511f84d2b15da05897a86d9f660

11
tests/upstream-tests.fmf Normal file
View File

@ -0,0 +1,11 @@
summary: Upstream tests
component: perl-ExtUtils-ParseXS
require: perl-ExtUtils-ParseXS-tests
test: /usr/libexec/perl-ExtUtils-ParseXS/test
enabled: true
tag:
- rhel-buildroot
adjust:
- enabled: false
when: distro < rhel-10 or distro < centos-stream-10
continue: false