[arch-commits] Commit in perl-curses-ui/repos (3 files)

Evangelos Foutras foutrelis at archlinux.org
Mon May 24 11:25:08 UTC 2021


    Date: Monday, May 24, 2021 @ 11:25:07
  Author: foutrelis
Revision: 944418

archrelease: copy trunk to community-staging-any

Added:
  perl-curses-ui/repos/community-staging-any/
  perl-curses-ui/repos/community-staging-any/Curses-UI-0.9607.utf8fix.diff
    (from rev 944417, perl-curses-ui/trunk/Curses-UI-0.9607.utf8fix.diff)
  perl-curses-ui/repos/community-staging-any/PKGBUILD
    (from rev 944417, perl-curses-ui/trunk/PKGBUILD)

-------------------------------+
 Curses-UI-0.9607.utf8fix.diff |   79 ++++++++++++++++++++++++++++++++++++++++
 PKGBUILD                      |   31 +++++++++++++++
 2 files changed, 110 insertions(+)

Copied: perl-curses-ui/repos/community-staging-any/Curses-UI-0.9607.utf8fix.diff (from rev 944417, perl-curses-ui/trunk/Curses-UI-0.9607.utf8fix.diff)
===================================================================
--- community-staging-any/Curses-UI-0.9607.utf8fix.diff	                        (rev 0)
+++ community-staging-any/Curses-UI-0.9607.utf8fix.diff	2021-05-24 11:25:07 UTC (rev 944418)
@@ -0,0 +1,79 @@
+diff -wBbur Curses-UI-0.9607/examples/color_editor Curses-UI-0.9607.my/examples/color_editor
+--- Curses-UI-0.9607/examples/color_editor	2008-12-21 21:21:26.000000000 +0000
++++ Curses-UI-0.9607.my/examples/color_editor	2011-02-01 13:55:10.000000000 +0000
+@@ -71,7 +71,8 @@
+ use Curses::UI;
+ my $cui = new Curses::UI ( 
+ 	-clear_on_exit => 1,
+-	-color_support => 1
++	-color_support => 1,
++  -utf8 => 1
+ );
+ 
+ # Add the menu to the root.
+diff -wBbur Curses-UI-0.9607/lib/Curses/UI/Common.pm Curses-UI-0.9607.my/lib/Curses/UI/Common.pm
+--- Curses-UI-0.9607/lib/Curses/UI/Common.pm	2008-12-21 21:21:26.000000000 +0000
++++ Curses-UI-0.9607.my/lib/Curses/UI/Common.pm	2011-02-01 13:56:37.000000000 +0000
+@@ -435,6 +435,21 @@
+ 	    if $Curses::UI::debug; 
+     } elsif ($found) {
+ 	$key = $s->getch();
++
++      if ($Curses::UI::utf8) {
++        my $c = unpack("C", $key);
++        if ($c > 128){ # utf8 character is coming
++          my @char_utf8 = ($c); # contains bytes for one symbol in utf8 encoding
++
++          # 6 byte is max for utf8 encoding
++          while (length ($key) <= 6 and !utf8::decode($key))  {
++            my $key_next = $s->getch();
++            my $c_next = unpack("C",$key_next);
++            push @char_utf8, $c_next;
++            $key = pack("C*", @char_utf8);
++          }
++        }
++      }
+     }
+ 
+     return $key;
+diff -wBbur Curses-UI-0.9607/lib/Curses/UI/TextEditor.pm Curses-UI-0.9607.my/lib/Curses/UI/TextEditor.pm
+--- Curses-UI-0.9607/lib/Curses/UI/TextEditor.pm	2008-12-21 21:21:26.000000000 +0000
++++ Curses-UI-0.9607.my/lib/Curses/UI/TextEditor.pm	2011-02-01 13:59:44.000000000 +0000
+@@ -333,7 +333,8 @@
+ 		my $newtrackpos = $trackpos + length($_);
+ 		if ( $this->{-pos} < $newtrackpos )
+ 		{
+-		    $xpos = length(substr($_, 0, ($this->{-pos}-$trackpos)));    
++      #$xpos = length(substr($_, 0, ($this->{-pos}-$trackpos)));    
++      $xpos = $this->{-pos}-$trackpos;    
+ 		}
+ 		$trackpos = $newtrackpos;
+ 		last if defined $xpos;
+diff -wBbur Curses-UI-0.9607/lib/Curses/UI.pm Curses-UI-0.9607.my/lib/Curses/UI.pm
+--- Curses-UI-0.9607/lib/Curses/UI.pm	2008-12-21 21:38:18.000000000 +0000
++++ Curses-UI-0.9607.my/lib/Curses/UI.pm	2011-02-01 14:04:03.000000000 +0000
+@@ -61,6 +61,7 @@
+ $Curses::UI::color_object     = 0;
+ $Curses::UI::ncurses_mouse    = 0;
+ $Curses::UI::gpm_mouse        = 0;
++$Curses::UI::utf8             = 0;
+ 
+ # Detect if we should use the new moushandler
+ if ($ENV{"TERM"} ne "xterm") {
+@@ -150,6 +151,7 @@
+ 	-mouse_support => 1,     # Do we want mouse support
+ 	-overlapping   => 1,     # Whether overlapping widgets are supported
+ 	-color_support => 0,
++	-utf8          => 0,
+ 	-default_colors=> 1,
+         #user data
+         -userdata       => undef,    #user internal data
+@@ -173,6 +175,8 @@
+ 	$Curses::UI::gpm_mouse = 0;
+     }
+ 
++    $Curses::UI::utf8 = $args{-utf8} if defined $args{-utf8};
++
+     my $self = bless { %args }, $class;
+ 
+     my $lang = new Curses::UI::Language($self->{-language});

Copied: perl-curses-ui/repos/community-staging-any/PKGBUILD (from rev 944417, perl-curses-ui/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2021-05-24 11:25:07 UTC (rev 944418)
@@ -0,0 +1,31 @@
+# Maintainer: Sergej Pupykin <pupykin.s+arch at gmail.com>
+# Maintainer: Charles Mauch <cmauch at gmail.com>
+
+pkgname=perl-curses-ui
+pkgver=0.9609
+pkgrel=8
+pkgdesc="Perl/CPAN Module Curses::UI"
+arch=("any")
+url="https://search.cpan.org/dist/Curses-UI/"
+license=("GPL" "PerlArtistic")
+makedepends=("perl-curses" "perl-term-readkey" "perl-test-pod")
+depends=("ncurses" "perl-curses" "perl-term-readkey" "perl-test-pod")
+source=("https://search.cpan.org/CPAN/authors/id/M/MD/MDXI/Curses-UI-$pkgver.tar.gz"
+	Curses-UI-0.9607.utf8fix.diff)
+md5sums=('0dc4de85d94389b1d0eaaf36e804fc96'
+         'bb5eb97de34c0f35969aed23e0ba7c53')
+
+build() {
+  cd "$srcdir"/Curses-UI-$pkgver
+  patch -p1 <"$srcdir"/Curses-UI-0.9607.utf8fix.diff
+  PERL_USE_UNSAFE_INC=1 \
+  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
+  make
+}
+
+package() {
+  cd "$srcdir"/Curses-UI-$pkgver
+  make pure_install doc_install DESTDIR="$pkgdir"
+  find "$pkgdir" -name '.packlist' -delete
+  find "$pkgdir" -name '*.pod' -delete
+}



More information about the arch-commits mailing list