testing/perl-net-idn-encode: new aport

https://metacpan.org/release/Net-IDN-Encode/
Internationalizing Domain Names in Applications (IDNA)
This commit is contained in:
Celeste 2024-01-14 06:22:07 +00:00 committed by omni
parent acd5effe0d
commit 819ca26b66
2 changed files with 86 additions and 0 deletions
testing/perl-net-idn-encode

View file

@ -0,0 +1,48 @@
# Automatically generated by apkbuild-cpan, template 4
# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=perl-net-idn-encode
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Net-IDN-Encode
pkgver=2.500
pkgrel=0
pkgdesc="Internationalizing Domain Names in Applications (IDNA)"
url="https://metacpan.org/release/Net-IDN-Encode/"
arch="all"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
makedepends="perl-dev perl-module-build"
checkdepends="perl-test-nowarnings"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/C/CF/CFAERBER/Net-IDN-Encode-$pkgver.tar.gz
perl-5.38-compat.patch
"
builddir="$srcdir/$_pkgreal-$pkgver"
build() {
export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
perl Build.PL \
--installdirs=vendor \
--create_packlist=0
./Build
}
check() {
./Build test
}
package() {
./Build install --destdir="$pkgdir"
}
doc() {
local file; find "$pkgdir" -name "*.pod" | while read -r file; do
amove "${file#"$pkgdir"}"
done
default_doc
}
sha512sums="
3537309ea391e4f762eb8ce43929bfa024d63ee59c94f8d2ea16179aa6ad66ecef29188551749593302f14dc5b3182dbce18ebaf5176a34b40d6fa5b7e5763fb Net-IDN-Encode-2.500.tar.gz
485c8373199ade1ee5efb630b602e0f81ced0fdc19fcdd825334fefd12e9bcc83e71dabe2c6b0747203451d012019e2f32b1f44fee9c3479e4753df8371c645c perl-5.38-compat.patch
"

View file

@ -0,0 +1,38 @@
Patch-Source: https://github.com/cfaerber/Net-IDN-Encode/pull/11.patch
--
From 3ebe6f2e239b470efcb64a044edc8202798188af Mon Sep 17 00:00:00 2001
From: Shin Kojima <shin@kojima.org>
Date: Sun, 23 Jul 2023 13:15:59 +0900
Subject: [PATCH] use uvchr_to_utf8_flags instead of uvuni_to_utf8_flags (which
is removed in perl 5.38.0)
https://perldoc.perl.org/5.36.0/perlintern#uvuni_to_utf8_flags
Signed-off-by: Shin Kojima <shin@kojima.org>
---
lib/Net/IDN/Punycode.xs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/Net/IDN/Punycode.xs b/lib/Net/IDN/Punycode.xs
index 211ef9c..36530dd 100644
--- a/lib/Net/IDN/Punycode.xs
+++ b/lib/Net/IDN/Punycode.xs
@@ -24,6 +24,10 @@
#define utf8_to_uvchr_buf(in_p,in_e,u8) utf8_to_uvchr(in_p,u8);
#endif
+#ifndef uvchr_to_utf8_flags
+#define uvchr_to_utf8_flags(d, uv, flags) uvuni_to_utf8_flags(d, uv, flags);
+#endif
+
static char enc_digit[BASE] = {
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
@@ -253,7 +257,7 @@ decode_punycode(input)
if(skip_p < re_p) /* move succeeding chars */
Move(skip_p, skip_p + u8, re_p - skip_p, char);
re_p += u8;
- uvuni_to_utf8_flags((U8*)skip_p, n, UNICODE_ALLOW_ANY);
+ uvchr_to_utf8_flags((U8*)skip_p, n, UNICODE_ALLOW_ANY);
}
if(!first) SvUTF8_on(RETVAL); /* UTF-8 chars have been inserted */