pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/inputmethod/anthy-unicode
Module Name: pkgsrc
Committed By: wiz
Date: Fri Aug 28 11:30:25 UTC 2026
Added Files:
pkgsrc/inputmethod/anthy-unicode: DESCR Makefile Makefile.common PLIST
buildlink3.mk distinfo
pkgsrc/inputmethod/anthy-unicode/patches:
patch-src-util_anthy-unicode.el
Log Message:
inputmethod/anthy-unicode: import anthy-unicode-1.0.0.20260213
Provided by Showta Ishizaki in PR 60647.
Anthy is a Japanese kana-kanji conversion engine. anthy-unicode is the
maintained fork of anthy 9100h, whose last release was in 2009. It moves
the internal encoding from EUC-JP to UTF-8, from which it takes its name,
and installs everything under -unicode names so that it can be used
alongside the original.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/inputmethod/anthy-unicode/DESCR \
pkgsrc/inputmethod/anthy-unicode/Makefile \
pkgsrc/inputmethod/anthy-unicode/Makefile.common \
pkgsrc/inputmethod/anthy-unicode/PLIST \
pkgsrc/inputmethod/anthy-unicode/buildlink3.mk \
pkgsrc/inputmethod/anthy-unicode/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/inputmethod/anthy-unicode/patches/patch-src-util_anthy-unicode.el
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: pkgsrc/inputmethod/anthy-unicode/DESCR
diff -u /dev/null pkgsrc/inputmethod/anthy-unicode/DESCR:1.1
--- /dev/null Fri Aug 28 11:30:25 2026
+++ pkgsrc/inputmethod/anthy-unicode/DESCR Fri Aug 28 11:30:25 2026
@@ -0,0 +1,5 @@
+Anthy is a Japanese kana-kanji conversion engine. anthy-unicode is the
+maintained fork of anthy 9100h, whose last release was in 2009. It moves
+the internal encoding from EUC-JP to UTF-8, from which it takes its name,
+and installs everything under -unicode names so that it can be used
+alongside the original.
Index: pkgsrc/inputmethod/anthy-unicode/Makefile
diff -u /dev/null pkgsrc/inputmethod/anthy-unicode/Makefile:1.1
--- /dev/null Fri Aug 28 11:30:25 2026
+++ pkgsrc/inputmethod/anthy-unicode/Makefile Fri Aug 28 11:30:25 2026
@@ -0,0 +1,26 @@
+# $NetBSD: Makefile,v 1.1 2026/08/28 11:30:25 wiz Exp $
+
+.include "Makefile.common"
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+COMMENT= Kana Kanji conversion system (Unicode fork of anthy)
+
+USE_LIBTOOL= yes
+USE_TOOLS+= printf
+
+CONFIGURE_ENV+= EMACS=no
+EGDIR= ${PREFIX}/share/examples/anthy-unicode
+INSTALL_MAKE_FLAGS+= sysconfdir=${EGDIR}
+CONF_FILES+= ${EGDIR}/anthy-unicode.conf ${PKG_SYSCONFDIR}/anthy-unicode.conf
+INSTALLATION_DIRS= share/doc/anthy-unicode
+
+PKGCONFIG_OVERRIDE+= anthy-unicode.pc.in
+
+UNLIMIT_RESOURCES+= stacksize
+
+post-install:
+.for f in doc/DICUTIL doc/ELISP doc/GUIDE.english README README.en
+ ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/share/doc/anthy-unicode
+.endfor
+
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/inputmethod/anthy-unicode/Makefile.common
diff -u /dev/null pkgsrc/inputmethod/anthy-unicode/Makefile.common:1.1
--- /dev/null Fri Aug 28 11:30:25 2026
+++ pkgsrc/inputmethod/anthy-unicode/Makefile.common Fri Aug 28 11:30:25 2026
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile.common,v 1.1 2026/08/28 11:30:25 wiz Exp $
+# used by inputmethod/anthy-unicode/Makefile
+# used by inputmethod/anthy-unicode-elisp/Makefile
+
+ANTHY_UNICODE_VERSION= 1.0.0.20260213
+DISTNAME= anthy-unicode-${ANTHY_UNICODE_VERSION}
+CATEGORIES= inputmethod
+MASTER_SITES= ${MASTER_SITE_GITHUB:=fujiwarat/}
+GITHUB_PROJECT= anthy-unicode
+GITHUB_RELEASE= ${ANTHY_UNICODE_VERSION}
+
+DISTINFO_FILE= ${.CURDIR}/../../inputmethod/anthy-unicode/distinfo
+PATCHDIR= ${.CURDIR}/../../inputmethod/anthy-unicode/patches
+
+HOMEPAGE= https://github.com/fujiwarat/anthy-unicode/
+LICENSE= gnu-gpl-v2
+
+GNU_CONFIGURE= yes
+USE_LANGUAGES= c
Index: pkgsrc/inputmethod/anthy-unicode/PLIST
diff -u /dev/null pkgsrc/inputmethod/anthy-unicode/PLIST:1.1
--- /dev/null Fri Aug 28 11:30:25 2026
+++ pkgsrc/inputmethod/anthy-unicode/PLIST Fri Aug 28 11:30:25 2026
@@ -0,0 +1,21 @@
+@comment $NetBSD: PLIST,v 1.1 2026/08/28 11:30:25 wiz Exp $
+bin/anthy-agent-unicode
+bin/anthy-dic-tool-unicode
+bin/anthy-morphological-analyzer-unicode
+include/anthy-unicode-1.0/anthy/anthy.h
+include/anthy-unicode-1.0/anthy/dicutil.h
+include/anthy-unicode-1.0/anthy/input.h
+lib/libanthy-unicode.la
+lib/libanthydic-unicode.la
+lib/libanthyinput-unicode.la
+lib/pkgconfig/anthy-unicode.pc
+share/anthy-unicode/anthy.dic
+share/anthy-unicode/dic-tool-usage.txt
+share/anthy-unicode/typetab
+share/anthy-unicode/zipcode.t
+share/doc/anthy-unicode/DICUTIL
+share/doc/anthy-unicode/ELISP
+share/doc/anthy-unicode/GUIDE.english
+share/doc/anthy-unicode/README
+share/doc/anthy-unicode/README.en
+share/examples/anthy-unicode/anthy-unicode.conf
Index: pkgsrc/inputmethod/anthy-unicode/buildlink3.mk
diff -u /dev/null pkgsrc/inputmethod/anthy-unicode/buildlink3.mk:1.1
--- /dev/null Fri Aug 28 11:30:25 2026
+++ pkgsrc/inputmethod/anthy-unicode/buildlink3.mk Fri Aug 28 11:30:25 2026
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.1 2026/08/28 11:30:25 wiz Exp $
+
+BUILDLINK_TREE+= anthy-unicode
+
+.if !defined(ANTHY_UNICODE_BUILDLINK3_MK)
+ANTHY_UNICODE_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.anthy-unicode+= anthy-unicode>=1.0.0.20260213
+BUILDLINK_PKGSRCDIR.anthy-unicode?= ../../inputmethod/anthy-unicode
+.endif # ANTHY_UNICODE_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -anthy-unicode
Index: pkgsrc/inputmethod/anthy-unicode/distinfo
diff -u /dev/null pkgsrc/inputmethod/anthy-unicode/distinfo:1.1
--- /dev/null Fri Aug 28 11:30:25 2026
+++ pkgsrc/inputmethod/anthy-unicode/distinfo Fri Aug 28 11:30:25 2026
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2026/08/28 11:30:25 wiz Exp $
+
+BLAKE2s (anthy-unicode-1.0.0.20260213.tar.gz) = 184005918110fb3381927d20052ff541fb826e5e376ee4aa7c55715f19c201db
+SHA512 (anthy-unicode-1.0.0.20260213.tar.gz) = fcb7651c3d1cfa389fc1d25606c088528154e659668af92908c202b5cf936f81fc28b616f3bc764be4835a8016c347c1a7e0a14691bd1a7697bac3df842d694e
+Size (anthy-unicode-1.0.0.20260213.tar.gz) = 5184155 bytes
+SHA1 (patch-src-util_anthy-unicode.el) = 28229a7355057ed5e7464920683079e2c0b7a2bf
Index: pkgsrc/inputmethod/anthy-unicode/patches/patch-src-util_anthy-unicode.el
diff -u /dev/null pkgsrc/inputmethod/anthy-unicode/patches/patch-src-util_anthy-unicode.el:1.1
--- /dev/null Fri Aug 28 11:30:25 2026
+++ pkgsrc/inputmethod/anthy-unicode/patches/patch-src-util_anthy-unicode.el Fri Aug 28 11:30:25 2026
@@ -0,0 +1,259 @@
+$NetBSD: patch-src-util_anthy-unicode.el,v 1.1 2026/08/28 11:30:25 wiz Exp $
+
+Fix the coding system on the pipe to the agent, keep each buffer's saved undo
+list to itself, and let the file work on the older Emacs versions pkgsrc
+still carries.
+
+The first two are not about old Emacs at all. anthy-agent-unicode speaks
+UTF-8 and nothing else, but nothing sets the coding system on the pipe, so
+Emacs uses default-process-coding-system, which follows the user's locale.
+Under a ja_JP.eucJP or ja_JP.SJIS locale the conversion comes back as
+mojibake on Emacs 22.3 through 31.1 alike. utf-8-unix is set explicitly;
+the -unix matters, because plain utf-8 leaves the end-of-line undecided and
+the decoding side settles on utf-8-dos.
+
+anthy stops undo while a preedit is open and puts the buffer's undo list
+aside until the text is committed. The flag saying it did so is
+anthy-deflocalvar, that is per buffer, but the list itself was an undeclared
+global shared by every buffer, so opening a preedit in a second buffer
+overwrote what the first one had put aside, and the first buffer got the
+second one's undo history when it committed.
+
+anthy-restore-undo-list is dead: the two places that set the variable it
+reads and its one call site are all commented out, as they already were in
+anthy 9100h. It is commented out too rather than deleted, the same way its
+callers are, so that taking the semicolons off brings it back.
+
+The rest is the older Emacs versions. Each name is picked once at load time
+and called through a variable:
+
+ set-face-underline Emacs 20 has only set-face-underline-p, and
+ until 24.3 that is the current spelling.
+ The call is at top level, so on Emacs 20 the
+ file does not load and only 4 of the 6 .elc
+ files get built.
+ set-process-query-on-exit-flag new in 22.1. It is called from
+ anthy-check-agent, so Emacs 21 and XEmacs
+ build and load and then die at the first
+ conversion.
+ deactivate-input-method,
+ deactivate-current-input-method-function
+ renamed from inactivate-* in 24.3. Emacs 22
+ and 23 convert and then cannot leave the
+ input method: void-function nil, because the
+ variable they read stays nil.
+ mapc new in Emacs 21; 9100h used mapcar here.
+
+Writing the old name in an else branch would work, but a current Emacs then
+reports it as not known to be defined, so this goes through a variable. The
+XEmacs-only names in anthy-last-command-char get the same treatment, and a
+lexical-binding cookie is added, which together take Emacs 24 and later from
+nine byte-compile warnings to none.
+
+Emacs 20, 21 and XEmacs 21.4 have no utf-8 coding system that covers CJK, so
+Mule-UCS is required there, inside condition-case so that nothing happens
+where it is not installed and nothing at all happens from Emacs 22 on.
+XEmacs takes a coding system object rather than a symbol, so the value goes
+through find-coding-system there.
+
+Measured on NetBSD 11.0/amd64 with Emacs 20.7, 21.4, 22.3, 23.4, 24.5, 25.3,
+26.3, 27.2, 28.2, 29.4, 30.2, 31.1 and XEmacs 21.4.25, typing nihongo,
+converting, committing and switching the input method off again.
+
+Sent upstream as fujiwarat/anthy-unicode#21; this can be dropped once a
+release includes it.
+
+--- src-util/anthy-unicode.el.orig
++++ src-util/anthy-unicode.el
+@@ -1,4 +1,4 @@
+-;;; anthy-unicode.el -- Anthy
++;;; anthy-unicode.el -- Anthy -*- lexical-binding: nil -*-
+
+ ;; Copyright (C) 2001 - 2007 KMC(Kyoto University Micro Computer Club)
+ ;; Copyright (C) 2021 Takao Fujiwara <takao.fujiwara1%gmail.com@localhost>
+@@ -70,12 +70,73 @@
+ (defvar anthy-agent-unicode-command-list '("anthy-agent-unicode")
+ "anthy-agent-unicodeのPATH 名")
+
++;; XEmacs にしか無い名前。anthy-xemacs が真のときしか呼ばないが、直接書くと
++;; GNU Emacs の byte compiler が "not known to be defined" と言う。
++(defvar anthy-event-matches-key-specifier-p-function
++ 'event-matches-key-specifier-p)
++(defvar anthy-event-to-character-function 'event-to-character)
++(defvar anthy-char-to-int-function 'char-to-int)
++
++;; Emacs 22.1 から。Emacs 20/21 と XEmacs は process-kill-without-query。
++;; どちらも第二引数 nil で「終了時に問い合わせない」の意味になる。
++(defvar anthy-set-process-no-query-function
++ (if (fboundp 'set-process-query-on-exit-flag)
++ 'set-process-query-on-exit-flag
++ 'process-kill-without-query))
++
++;; Emacs 24.3 で inactivate-* から改名された。Emacs 20 から 23 と XEmacs は
++;; 旧名しか持たない。
++(defvar anthy-deactivate-input-method-function
++ (if (fboundp 'deactivate-input-method)
++ 'deactivate-input-method
++ 'inactivate-input-method))
++(defvar anthy-deactivate-current-input-method-variable
++ (if (boundp 'deactivate-current-input-method-function)
++ 'deactivate-current-input-method-function
++ 'inactivate-current-input-method-function))
++
++;; Emacs 21 から。Emacs 20 と XEmacs は set-face-underline-p のみ。24.3 までは
++;; -p の方が正で、こちらが obsolete。ここは top level なので、無い版では load
++;; そのものが失敗する。
++(defvar anthy-set-face-underline-function
++ (if (fboundp 'set-face-underline)
++ 'set-face-underline
++ 'set-face-underline-p))
++
++;; Emacs 21 から。Emacs 20 には無く、anthy 9100h はこの行で mapcar だった。
++;; 返り値は捨てるので、どちらでも同じ。
++(defvar anthy-mapc-function
++ (if (fboundp 'mapc)
++ 'mapc
++ 'mapcar))
++
++;; Emacs 20 と 21 の utf-8 は CJK を含まない (20 には utf-8 そのものが無い)。
++;; XEmacs 21.4 にも utf-8 が無い。agent は UTF-8 でしか話さないので、
++;; Mule-UCS があれば載せる。
++(if (and (or (featurep 'xemacs)
++ (< emacs-major-version 22))
++ (not (featurep 'un-define)))
++ (condition-case nil
++ (require 'un-define)
++ (error nil)))
++
++;; XEmacs の coding-system-p は symbol ではなく coding system オブジェクトを
++;; 取るので、find-coding-system を通す。
++(defvar anthy-agent-coding-system
++ (if (featurep 'xemacs)
++ (and (fboundp 'find-coding-system)
++ (find-coding-system 'utf-8-unix))
++ (and (coding-system-p 'utf-8-unix)
++ 'utf-8-unix)))
++
+ ;; face
+ (defvar anthy-highlight-face nil)
+ (defvar anthy-underline-face nil)
+ (copy-face 'highlight 'anthy-highlight-face)
++;(if (not (featurep 'xemacs))
++; (set-face-underline 'anthy-highlight-face t))
+ (if (not (featurep 'xemacs))
+- (set-face-underline 'anthy-highlight-face t))
++ (funcall anthy-set-face-underline-function 'anthy-highlight-face t))
+ (copy-face 'underline 'anthy-underline-face)
+
+ ;;
+@@ -202,6 +263,9 @@
+ (anthy-deflocalvar anthy-current-rkmap "hiragana")
+ ; undo
+ (anthy-deflocalvar anthy-buffer-undo-list-saved nil)
++;; 待避した undo list そのもの。旗だけ buffer local で中身が global だったので、
++;; buffer を二つ使うと片方の履歴がもう片方のもので上書きされていた。
++(anthy-deflocalvar anthy-buffer-undo-list nil)
+
+ ;;
+ (defvar anthy-wide-space " " "スペースを押した時に出て来る文字")
+@@ -250,7 +314,8 @@
+ (delete-region start (+ start len))
+ (goto-char start)))
+ (setq anthy-preedit "")
+- (mapc 'delete-overlay anthy-preedit-overlays)
++; (mapc 'delete-overlay anthy-preedit-overlays)
++ (funcall anthy-mapc-function 'delete-overlay anthy-preedit-overlays)
+ (setq anthy-preedit-overlays nil))
+
+ (defun anthy-select-face-by-attr (attr)
+@@ -546,14 +611,17 @@
+ (char-to-string ch)
+ nil))))
+
+-(defun anthy-restore-undo-list (commit-str)
+- (let* ((len (length commit-str))
+- (beginning (point))
+- (end (+ beginning len)))
+- (setq buffer-undo-list
+- (cons (cons beginning end)
+- (cons nil anthy-saved-buffer-undo-list)))
+- ))
++;; 呼び出し側も、anthy-saved-buffer-undo-list を設定する二箇所も、元から
++;; コメントアウトされている。この関数だけが生きていて、呼べば void-variable に
++;; なる。同じように閉じておく。
++;(defun anthy-restore-undo-list (commit-str)
++; (let* ((len (length commit-str))
++; (beginning (point))
++; (end (+ beginning len)))
++; (setq buffer-undo-list
++; (cons (cons beginning end)
++; (cons nil anthy-saved-buffer-undo-list)))
++; ))
+
+ (defun anthy-proc-agent-reply (repl)
+ (let*
+@@ -752,7 +820,13 @@
+ (if anthy-agent-unicode-process
+ (kill-process anthy-agent-unicode-process))
+ (setq anthy-agent-unicode-process proc)
+- (set-process-query-on-exit-flag proc nil)
++; (set-process-query-on-exit-flag proc nil)
++ (funcall anthy-set-process-no-query-function proc nil)
++; (if (coding-system-p 'utf-8-unix)
++; (set-process-coding-system proc 'utf-8-unix 'utf-8-unix))
++ (if anthy-agent-coding-system
++ (set-process-coding-system proc anthy-agent-coding-system
++ anthy-agent-coding-system))
+ ;; (if anthy-xemacs
+ ;; (if (coding-system-p (find-coding-system 'euc-japan))
+ ;; (set-process-coding-system proc 'euc-japan 'euc-japan))
+@@ -871,7 +945,9 @@
+ ;; leim の activate
+ ;;
+ (defun anthy-unicode-leim-activate (&optional name)
+- (setq deactivate-current-input-method-function 'anthy-unicode-leim-inactivate)
++; (setq deactivate-current-input-method-function 'anthy-unicode-leim-inactivate)
++ (set anthy-deactivate-current-input-method-variable
++ 'anthy-unicode-leim-inactivate)
+ (setq anthy-leim-active-p t)
+ (anthy-update-mode)
+ (when (eq (selected-window) (minibuffer-window))
+@@ -881,7 +957,8 @@
+ ;; emacsのバグ避けらしいです
+ ;;
+ (defun anthy-unicode-leim-exit-from-minibuffer ()
+- (deactivate-input-method)
++; (deactivate-input-method)
++ (funcall anthy-deactivate-input-method-function)
+ (when (<= (minibuffer-depth) 1)
+ (remove-hook 'minibuffer-exit-hook 'anthy-unicode-leim-exit-from-minibuffer)))
+
+@@ -891,14 +968,24 @@
+ ;;
+ (defun anthy-last-command-char ()
+ "最後の入力イベントを返す。XEmacs では int に変換する"
++; (if anthy-xemacs
++; (let ((event last-command-event))
++; (cond
++; ((event-matches-key-specifier-p event 'left) 2)
++; ((event-matches-key-specifier-p event 'right) 6)
++; ((event-matches-key-specifier-p event 'backspace) 8)
++; (t
++; (char-to-int (event-to-character event)))))
++; last-command-event))
+ (if anthy-xemacs
+ (let ((event last-command-event))
+ (cond
+- ((event-matches-key-specifier-p event 'left) 2)
+- ((event-matches-key-specifier-p event 'right) 6)
+- ((event-matches-key-specifier-p event 'backspace) 8)
++ ((funcall anthy-event-matches-key-specifier-p-function event 'left) 2)
++ ((funcall anthy-event-matches-key-specifier-p-function event 'right) 6)
++ ((funcall anthy-event-matches-key-specifier-p-function event 'backspace) 8)
+ (t
+- (char-to-int (event-to-character event)))))
++ (funcall anthy-char-to-int-function
++ (funcall anthy-event-to-character-function event)))))
+ last-command-event))
+
+ ;;
Home |
Main Index |
Thread Index |
Old Index