public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-i18n/canfep/, app-i18n/canfep/files/
@ 2017-07-23 13:15 Akinori Hattori
  0 siblings, 0 replies; only message in thread
From: Akinori Hattori @ 2017-07-23 13:15 UTC (permalink / raw
  To: gentoo-commits

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 3812 bytes --]

commit:     f6e84ff2dfd1ffed828390ff78148999cf7eed37
Author:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 23 13:13:20 2017 +0000
Commit:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
CommitDate: Sun Jul 23 13:15:23 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6e84ff2

app-i18n/canfep: add support for Unix98 PTY

Gentoo-Bug: 212709

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 app-i18n/canfep/canfep-1.0-r1.ebuild         | 41 +++++++++++++++++
 app-i18n/canfep/files/canfep-posix-pty.patch | 67 ++++++++++++++++++++++++++++
 2 files changed, 108 insertions(+)

diff --git a/app-i18n/canfep/canfep-1.0-r1.ebuild b/app-i18n/canfep/canfep-1.0-r1.ebuild
new file mode 100644
index 00000000000..9d542a19716
--- /dev/null
+++ b/app-i18n/canfep/canfep-1.0-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit toolchain-funcs
+
+DESCRIPTION="Canna Japanese kana-kanji frontend processor on console"
+HOMEPAGE="http://www.geocities.co.jp/SiliconValley-Bay/7584/canfep/"
+SRC_URI="http://www.geocities.co.jp/SiliconValley-Bay/7584/${PN}/${P}.tar.gz
+	unicode? ( http://hp.vector.co.jp/authors/VA020411/patches/${PN}_utf8.diff )"
+
+LICENSE="canfep"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+IUSE="unicode"
+
+RDEPEND="app-i18n/canna
+	sys-libs/ncurses:="
+DEPEND="${RDEPEND}
+	virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}"/${PN}-posix-pty.patch )
+
+src_prepare() {
+	use unicode && eapply "${DISTDIR}"/${PN}_utf8.diff
+	sed -i 's/$(CFLAGS)/$(CFLAGS) $(LDFLAGS)/' Makefile
+
+	default
+}
+
+src_compile() {
+	emake \
+		CC="$(tc-getCXX)" \
+		LIBS="-lcanna $(pkg-config --libs ncurses)"
+}
+
+src_install() {
+	dobin ${PN}
+	dodoc 00{changes,readme}
+}

diff --git a/app-i18n/canfep/files/canfep-posix-pty.patch b/app-i18n/canfep/files/canfep-posix-pty.patch
new file mode 100644
index 00000000000..caa451232ef
--- /dev/null
+++ b/app-i18n/canfep/files/canfep-posix-pty.patch
@@ -0,0 +1,67 @@
+https://bugs.gentoo.org/show_bug.cgi?id=212709
+
+Author: OKUMURA N. Shin-ya <oku.ns@dream.com>
+
+--- a/pty.C
++++ b/pty.C
+@@ -257,6 +257,23 @@
+         }
+     }
+ 
++#if defined(_POSIX_C_SOURCE)
++    // BSD pty ¤¬³«¤±¤Ê¤¤¤Î¤Ç¡¢POSIX ¤ÎÊýË¡¤ò»î¤¹
++    if ((master = posix_openpt(O_RDWR)) >= 0) {
++        if (grantpt(master) == 0 && unlockpt(master) == 0) {
++            // ¥Þ¥¹¥¿¥Ç¥Ð¥¤¥¹Ì¾¤Ï¸ÇÄê
++            strcpy(line, "/dev/ptmx");
++            tcgetattr(0, &tt);
++            tt.c_iflag &= ~ISTRIP;
++            ioctl(0, TIOCGWINSZ, (char*) &win);
++            return;
++        }
++        close(master);
++    } else {
++        perror("/dev/ptmx");
++    }
++#endif  // _POSIX_C_SOURCE
++
+     printf("Out of pty's\n");
+     fail();
+ }
+@@ -265,12 +282,36 @@
+ void
+ Pty::getslave()
+ {
++#if defined(_POSIX_C_SOURCE)
++    // ¥Þ¥¹¥¿¥Ç¥Ð¥¤¥¹¤¬ POSIX Êý¼°¤Î¾ì¹ç
++    if (strcmp(line, "/dev/ptmx") == 0) {
++        char *slave_devname = ptsname(master);
++        if (slave_devname == NULL) {
++            perror("ptsname");
++            fail();
++        }
++        slave = open(slave_devname, O_RDWR);
++        if (slave < 0) {
++            perror(slave_devname);
++            fail();
++        }
++        strcpy(line, slave_devname);
++    } else {
++        line[strlen("/dev/")] = 't';
++        slave = open(line, O_RDWR);
++        if (slave < 0) {
++            perror(line);
++            fail();
++        }
++    }
++#else   // ! _POSIX_C_SOURCE
+     line[strlen("/dev/")] = 't';
+     slave = open(line, O_RDWR);
+     if (slave < 0) {
+         perror(line);
+         fail();
+     }
++#endif  // _POSIX_C_SOURCE
+     tcsetattr(slave, TCSAFLUSH, &tt);
+     if (!hs)
+         win.ws_row--;


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-23 13:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-23 13:15 [gentoo-commits] repo/gentoo:master commit in: app-i18n/canfep/, app-i18n/canfep/files/ Akinori Hattori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox