Commits

Smith Dhumbumroong  committed 58414d3

Add pango-thai package.

  • Participants
  • Parent commits 75eadd4

Comments (0)

Files changed (3)

File pango-thai/21_thai-sara-am-mono.patch

+--- pango1.0-1.24.3.orig/modules/thai/thai-fc.c2009-06-21 17:37:22.000000000 +0700
++++ pango1.0-1.24.3.orig/modules/thai/thai-fc.c20092009-06-21 17:38:02.000000000 +0700
+@@ -171,6 +171,8 @@ 
+ 
+   if (G_UNLIKELY (!font_info))
+     {
++      PangoFontMap *fontmap;
++
+       /* No cached information not found, so we need to compute it
+        * from scratch
+        */
+@@ -187,6 +189,26 @@ 
+       else
+    font_info->font_set = THAI_FONT_TIS;
+ 
++      /* check if the font is monospace */
++      font_info->is_monospace = FALSE;
++      fontmap = pango_font_get_font_map (font);
++      if (fontmap)
++        {
++          PangoFontFamily **families;
++          int n_families, i;
++
++          pango_font_map_list_families (fontmap, &families, &n_families);
++          for (i = 0; i < n_families; i++)
++            {
++              if (pango_font_family_is_monospace (families[i]))
++                {
++                  font_info->is_monospace = TRUE;
++                  break;
++                }
++            }
++          g_free (families);
++        }
++
+       g_object_set_qdata_full (G_OBJECT (font), info_id, font_info, (GDestroyNotify)g_free);
+     }
+ 
+--- pango1.0-1.24.3.orig/modules/thai/thai-shaper.check2009-06-21 17:37:26.000000000 +0700
++++ pango1.0-1.24.3.orig/modules/thai/thai-shaper.check20092009-06-21 17:38:02.000000000 +0700
+@@ -164,7 +164,8 @@ 
+     {
+       case 1:
+    if (is_char_type (cluster[0],
+-if  BelowVowel|BelowDiac|AboveVowel|AboveDiac|Tone|SaraAm))
++AboveDiac  BelowVowel|BelowDiac|AboveVowel|AboveDiac|Tone)
++Tone    || (is_char_type (cluster[0], SaraAm) && !font_info->is_monospace))
+      {
+        gint n;
+        glyph_lists[0] = get_null_base_glyph (font_info);
+--- pango1.0-1.24.3.orig/modules/thai/thai-shaper.h2009-06-21 17:37:35.000000000 +0700
++++ pango1.0-1.24.3.orig/modules/thai/thai-shaper.h20092009-06-21 17:38:02.000000000 +0700
+@@ -50,6 +50,7 @@ 
+ {
+   PangoFont       *font;
+   ThaiFontSet      font_set;
++  gboolean         is_monospace;
+ };
+ 
+ /*
+

File pango-thai/PKGBUILD

+# $Id: PKGBUILD 118487 2011-04-07 10:59:52Z ibiru $ 
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=pango-thai
+_pkgname=pango
+pkgver=1.28.4
+pkgrel=1
+pkgdesc="A library for layout and rendering of text"
+arch=('i686' 'x86_64')
+license=('LGPL')
+depends=('glib2' 'cairo' 'libxft' 'libthai' 'freetype2')
+makedepends=('gobject-introspection' 'libxt' 'gtk-doc')
+provides=('pango')
+conflicts=('pango')
+options=('!libtool' '!emptydirs')
+install=pango.install
+source=(http://ftp.gnome.org/pub/gnome/sources/${_pkgname}/1.28/${_pkgname}-${pkgver}.tar.bz2
+        21_thai-sara-am-mono.patch)
+url="http://www.pango.org/"
+sha256sums=('7eb035bcc10dd01569a214d5e2bc3437de95d9ac1cfa9f50035a687c45f05a9f'
+            'ed51c1db7f756121068333092d3dc9ebd855254a8aa39bd9e7a58a7112bc4dd4')
+
+build() {
+  cd "${srcdir}/${_pkgname}-${pkgver}"
+
+  # https://bugzilla.gnome.org/show_bug.cgi?id=583718
+  # https://bugzilla.gnome.org/show_bug.cgi?id=584160
+  patch -Np1 < ../21_thai-sara-am-mono.patch || return 1
+
+  ./configure --prefix=/usr --sysconfdir=/etc \
+      --localstatedir=/var --with-included-modules=basic-fc
+  make
+}
+
+package() {
+  cd "${srcdir}/${_pkgname}-${pkgver}"
+  make DESTDIR="${pkgdir}" install
+}

File pango-thai/pango.install

+# arg 1:  the new package version
+post_install() {
+	# we need to ldconfig first, in case xfree86's libs aren't
+	# in ld.so.cache yet
+	sbin/ldconfig -r .
+	usr/bin/pango-querymodules >etc/pango/pango.modules
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_upgrade() {
+	if [ -f usr/etc/pango/pango.modules ]; then
+		rm usr/etc/pango/pango.modules
+	fi
+	post_install $1
+}
+
+# arg 1:  the old package version
+pre_remove() {
+	rm etc/pango/pango.modules
+}