pkgsrc で gimp がアレだった件 - デマと放置と私

45

Click here to load reader

Upload: akio-obata

Post on 13-Apr-2017

338 views

Category:

Presentations & Public Speaking


1 download

TRANSCRIPT

Page 1: pkgsrc で gimp がアレだった件 - デマと放置と私

pkgsrc で gimp がアレだった件

デマと放置と私

OBATA AkioJul 12, 2014

Page 2: pkgsrc で gimp がアレだった件 - デマと放置と私

前提知識(1) gettext とは多言語対応の仕組みテキスト形式のメッセージカタログ(*.po)→ (gettext-tools) →バイナリ形式(*.mo)gettext-lib (libintl) を利用して翻訳メッセージ出力

01 44

Page 3: pkgsrc で gimp がアレだった件 - デマと放置と私

前提知識(2) NetBSDの状況libintl は Citrus (独自)

gettext-tools は GNU3.x は 0.10.35

4.x 以降は 0.14.4

02 44

Page 4: pkgsrc で gimp がアレだった件 - デマと放置と私

前提知識(3) gettext の拡張機能メッセージカタログの追加機能

msgid_plural0.10.36以降対応

複数形など数によってメッセージが異なる場合

msgctxt0.15以降対応

原文が同じでも状況によって翻訳が異なる場合

対応していない古いtoolsだとエラーになる

03 44

Page 5: pkgsrc で gimp がアレだった件 - デマと放置と私

前提知識(4) pkgsrcの対応方法gettext-tool がmsgid_plural 非対応

1個の場合と2個の場合で標準の複数形形式に変換

3個以上の場合は捨てる

msgctct非対応まるっきり削除

04 44

Page 6: pkgsrc で gimp がアレだった件 - デマと放置と私

gdt さんの疑問 2008/7/18

We have 0.14.6 in pkgsrc, but gutenprint requires 0.16. Can anyone shed light on if we are behind, if 0.16 is bleeding edge, and if there are reasons not to update?

05 44

Page 7: pkgsrc で gimp がアレだった件 - デマと放置と私

joerg さんの答 2008/7/18

Ignoring pkgsrc for a moment -- what do you want to do for NetBSD base?Also keep in mind that the support for printf argument reordering is missing in base and therefore creates a lot of issues.

06 44

Page 8: pkgsrc で gimp がアレだった件 - デマと放置と私

dholland さんの反応 2008/7/21

?

% cat foo.c#include <stdio.h>int main() { printf("%3$d %2$d %1$d\n", 2, 4, 6); return 0;}% gcc foo.c -o foo% ./foo6 4 2%

07 44

Page 9: pkgsrc で gimp がアレだった件 - デマと放置と私

gdt さんの追試 2008/7/21

Thanks for pointing out that we should try it Worked for me on 4_STABLE, current, and failed on 3_STABLE.

08 44

Page 10: pkgsrc で gimp がアレだった件 - デマと放置と私

wiz さんの提案 2008/11/11

Hi!KDE and some Gnome packages are starting to use newer features of gettext that are not supported by the gettext version included in NetBSD.

09 44

Page 11: pkgsrc で gimp がアレだった件 - デマと放置と私

wiz さんの提案(2) 2008/11/11

IIRC, there was some work to improve NetBSD's libintl support for these features, but I haven't read news about this in a long time.

10 44

Page 12: pkgsrc で gimp がアレだった件 - デマと放置と私

wiz さんの提案(3) 2008/11/11

I suggest that we update the gettext in pkgsrc and default to using the gettext from pkgsrc on all pkgsrc platforms. When NetBSD's builtin support gets good enough, we can always switch back.This would also allow us to get rid of the msgfmtstrip hack Comments? Other solutions? Status reports about NetBSD's libintl?

11 44

Page 13: pkgsrc で gimp がアレだった件 - デマと放置と私

joerg さんの答 2008/11/11

Who will fix the breakage on all NetBSD versions that don't support positional arguments in printf and friends?

12 44

Page 14: pkgsrc で gimp がアレだった件 - デマと放置と私

dholland さんの追い打ち 2008/11/12

NetBSD has supported positional arguments in printf for a good while.It's only scanf that's an issue, and while I suppose that could turn out to matter it seems moderately unlikely to.

13 44

Page 15: pkgsrc で gimp がアレだった件 - デマと放置と私

wiz さんのトドメ 2008/11/24

So is there any other problem with the proposal?

14 44

Page 16: pkgsrc で gimp がアレだった件 - デマと放置と私

NetBSD 5.0 released 2009/4/29

Good-bye 3.x !

15 44

Page 17: pkgsrc で gimp がアレだった件 - デマと放置と私

tnozakiさんの疑問 2009/9/21

pkgsrc方面詳しくないんですが、今NetBSDのbaseに含まれてるgettext-toolが0.14.4と古いせいで 0.15から導入された*.poのmsgctxtキーワードを理解しないせいでbuildが上手くいかない問題 ってどれくらい深刻なんでそ。 それとgettextを最新の0.17にするとした場合、GPL3ってまじぇまじぇしていいんだっけ?

16 44

Page 18: pkgsrc で gimp がアレだった件 - デマと放置と私

私の解釈 2009/9/22

gettext-tool のバージョン見て、対応していない機能は削除してるんで、翻訳が全部出ないかもね。ライセンスは問題なさげ (lib/LGPLv3 tool/GPLv3)でも、諸般の事情のため? 0.14.6 のまま(base も pkgsrcも?)

17 44

Page 19: pkgsrc で gimp がアレだった件 - デマと放置と私

adam さんの行動 2011/4/12

Updated devel/gettext to 0.18.1.1

18 44

Page 20: pkgsrc で gimp がアレだった件 - デマと放置と私

adam さんの提案 2012/9/11

Greetings,I have just updated mk/tools/msgfmt-msgctxt.awk to make graphics/gimp compile on systems where gettext-tools is not the latest.

19 44

Page 21: pkgsrc で gimp がアレだった件 - デマと放置と私

adam さんの提案(2) 2012/9/11

But I have a feeling this whole hack (see mk/tools/msgfmt*) with msgfmt should be removed and a proper dependency on devel/gettext-tools>=0.18.1 settled in its place. With the present setup it looks like not all messages get translated.Let's discuss the matter.

20 44

Page 22: pkgsrc で gimp がアレだった件 - デマと放置と私

joerg さんの答 2012/9/11

It doesn't work, NetBSD's libintl doesn't support the newer format.

21 44

Page 23: pkgsrc で gimp がアレだった件 - デマと放置と私

abs さんの疑問 2012/9/17

Is what NetBSD's libintl is missing recorded anywhere?

22 44

Page 24: pkgsrc で gimp がアレだった件 - デマと放置と私

joerg さんの答…

23 44

Page 25: pkgsrc で gimp がアレだった件 - デマと放置と私

isaki さんの疑問 2012/11/1

pkgsrc-2012Q3のgimp(-2.8.2)のメニューとか、一部日本語だけど大半が日本語化されてないのはどういう状態なんだろう。

24 44

Page 26: pkgsrc で gimp がアレだった件 - デマと放置と私

kano さんの見立て 2012/11/3

msgctxt つきのメッセージ全滅ってことは、GIMP 以外もけっこーアレかー、とか思ったけど、GNOME は 2 系だから目立たないってことかしら。

25 44

Page 27: pkgsrc で gimp がアレだった件 - デマと放置と私

私の見立て 2012/11/6

joerg さんの意見を参考すると、そもそも、gettext-tool の能力で catelog を削るのは間違いではないか?

gettext-lib の能力に合わせて削るべきではないか?

gettext-tool の能力が足りないのなら pkgsrc から入れるべきでは?

26 44

Page 28: pkgsrc で gimp がアレだった件 - デマと放置と私

しばらくお休みほぼ死んでました

27 44

Page 29: pkgsrc で gimp がアレだった件 - デマと放置と私

私の提案 2013/2/8

Hi,Is it possible to change current strategy for using gettext-{tools,lib}?

28 44

Page 30: pkgsrc で gimp がアレだった件 - デマと放置と私

私の提案(2) 2013/2/8

Current strategy

use builtin gettext-tools, or install devel/gettext-tools (depend on settings and/or builtin version)

1.

use builtin gettext-lib, or install devel/gettext-lib (ditto)

2.

prepare *.po file depending on capabilities of gettext-tools (strip some entries if it is not supported)

3.

29 44

Page 31: pkgsrc で gimp がアレだった件 - デマと放置と私

私の提案(3) 2013/2/8

Issues - capability mismatch between gettext-lib and gettext-tools

If gettext-tools is less capabilities than gettext-lib,some translations may not appear well even thoughits library has sufficient capabilities.If gettext-tools is much capabilities than gettext-lib,some translations may not be handled well by the old library.

30 44

Page 32: pkgsrc で gimp がアレだった件 - デマと放置と私

私の提案(2) 2013/2/8

It is not only happened with builtin one v.s. pkgsrc one.For example, NetBSD's Citrus libintl support dcgettext(3) anddcngettext(3), but builtin gettext-tools is too old and msgctxtwill be stripped.

31 44

Page 33: pkgsrc で gimp がアレだった件 - デマと放置と私

私の提案(3) 2013/2/8

Proposed strategy

check capability of gettext-lib1.

if builtin gettext-tools is less capabilities than -lib, -tools from pkgsrc must be preferred than buitin one.

2.

prepare *.po file depending on capabilities of gettext-lib (strip some entries if it is not supported)

3.

32 44

Page 34: pkgsrc で gimp がアレだった件 - デマと放置と私

反応誰からもなし引き続き死んでたので、反応来ても困りますが

33 44

Page 35: pkgsrc で gimp がアレだった件 - デマと放置と私

候補パッチ 2013/4/30

Proposed patch.You can use current behavior with _TOOLS_USE_PKGSRC.msgfmt=no.

34 44

Page 36: pkgsrc で gimp がアレだった件 - デマと放置と私

反響いつもの人からのもうお分かりでしょうがピントのはずれたお話ばかり

35 44

Page 37: pkgsrc で gimp がアレだった件 - デマと放置と私

ここで考えるそもそも彼の話は根拠があるのか?libintl に最新の形式を扱う機能がない?標準: {,d}gettext(3)

msgid_plural: {,d}ngettext(3)

msgctxt: {,d}cngettext(3) ???

36 44

Page 38: pkgsrc で gimp がアレだった件 - デマと放置と私

勘違いしてたc != contextc == categoryこれなら Citrus のにもあるぞ?msgctxt ってどう扱われているんだ?

37 44

Page 39: pkgsrc で gimp がアレだった件 - デマと放置と私

msgfmt の msgctxt の扱いgettext-tools/src/write-mo.c 参照

msgctxt + \004 + msgid => msgctid

msgctid という特殊な msgid に変換

moのフォーマットは同じ

38 44

Page 40: pkgsrc で gimp がアレだった件 - デマと放置と私

libintl の msgctxt の扱い対応する関数は libint.h にない

{,d}pgettext マクロが gettext.h に

それは private で公開されてない

GLib の gi18n.h にも同様なマクロ

39 44

Page 41: pkgsrc で gimp がアレだった件 - デマと放置と私

対応方法 (tool) 2013/5/3

msgfmt-msgctxt.awk を書換

msgctxt を捨てない

msgctid への変換を行うmsgctxt + \004 + msgid => msgid

40 44

Page 42: pkgsrc で gimp がアレだった件 - デマと放置と私

追加の対処(tool) 2013/5/6

msgid 頭が改行なら msgstr も改行

頭に msgctxt 入れたのでミスマッチエラー発生

msgstr の頭に空白入れて誤魔化す

obosolete で comment out された部分とかどこまで対応すればいいのやら…

41 44

Page 43: pkgsrc で gimp がアレだった件 - デマと放置と私

対応方法 (libintl)

{,d}pgettext 関数は private

必要なアプリは自前で関数用意たとえば GLib とか

従来の機能で十分

ライブラリの対応は不要

42 44

Page 44: pkgsrc で gimp がアレだった件 - デマと放置と私

確認gimp のカタログがかなり変なことをしているこれが正しく表示されれば正解?

43 44

Page 45: pkgsrc で gimp がアレだった件 - デマと放置と私

まとめ不確かな戯言に惑わされない

一次情報を見る

動けば正解

44 44