freebsd-ports/textproc/p5-SGML-Parser-OpenSP
Yasuhiro Kimura c279190b7d textproc/p5-SGML-Parser-OpenSP: Fix build with Perl 5.38
When 5.38 is default perl5 version, build of this port fails as
following.

--- OpenSP.c ---
Warning: Found a 'CODE' section which seems to be using 'RETVAL' but no 'OUTPUT' section. in OpenSP.xs, line 1178
mv OpenSP.xsc OpenSP.c
--- OpenSP.o ---
c++ -c  -I/usr/local/include  -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing    -DVERSION=\"0.994\"  -DXS_VERSION=\"0.994\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.38/mach/CORE"  -DSP_MULTI_BYTE=1 OpenSP.c
c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
OpenSP.xs:165:17: error: use of undeclared identifier 'uvuni_to_utf8_flags'
            d = uvuni_to_utf8_flags(d, s.ptr[i], 0);
                ^
OpenSP.xs:174:17: error: use of undeclared identifier 'uvuni_to_utf8_flags'
            d = uvuni_to_utf8_flags(d + SvCUR(result), s.ptr[i], 0);
                ^
2 errors generated.
*** [OpenSP.o] Error code 1

make[1]: stopped in /usr0/freebsd/ports/work/usr/ports/textproc/p5-SGML-Parser-OpenSP/work/SGML-Parser-OpenSP-0.994
1 error

make[1]: stopped in /usr0/freebsd/ports/work/usr/ports/textproc/p5-SGML-Parser-OpenSP/work/SGML-Parser-OpenSP-0.994
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/textproc/p5-SGML-Parser-OpenSP

In the perlintern(1) man pages of perl 5.36.1, there are sentences as
following.

"uvuni_to_utf8_flags"
   "DEPRECATED!"  It is	planned	to remove "uvuni_to_utf8_flags"	from a
   future release of Perl.  Do not use it for new code;	remove it from
   existing code.

   Instead you almost certainly	want to	use "uvchr_to_utf8" in perlapi
   or "uvchr_to_utf8_flags" in perlapi.

   This	function is a deprecated synonym for "uvoffuni_to_utf8_flags",
   which itself, while not deprecated, should be used only in isolated
   circumstances.  These functions were	useful for code	that wanted to
   handle both EBCDIC and ASCII	platforms with Unicode properties, but
   starting in Perl v5.20, the distinctions between the	platforms have
   mostly been made invisible to most code, so this function is	quite
   unlikely to be what you want.

   U8*	 uvuni_to_utf8_flags(U8	*d, UV uv, UV flags)

So it seems planned removal finally happend with 5.38.

There are two occurrences of uvuni_to_utf8_flags in OpenSP.xs. So fix
build by replacing them with uvchr_to_utf8_flags.

PR:		272364
Approved by:	maintainer
MFH:		2023Q3
2023-07-05 09:28:04 +09:00
..
files
distinfo
Makefile
pkg-descr
pkg-plist