summaryrefslogtreecommitdiff
path: root/pcr/font-manager
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/font-manager')
-rw-r--r--pcr/font-manager/0001-nonexistent_cache.patch71
-rw-r--r--pcr/font-manager/1001-gcc47.patch18
-rw-r--r--pcr/font-manager/2001-paths.patch25
-rw-r--r--pcr/font-manager/2002-local-fontconfig-path.patch11
-rw-r--r--pcr/font-manager/2003-file-roller-syntax-fix.patch22
-rw-r--r--pcr/font-manager/PKGBUILD58
6 files changed, 205 insertions, 0 deletions
diff --git a/pcr/font-manager/0001-nonexistent_cache.patch b/pcr/font-manager/0001-nonexistent_cache.patch
new file mode 100644
index 000000000..effd89320
--- /dev/null
+++ b/pcr/font-manager/0001-nonexistent_cache.patch
@@ -0,0 +1,71 @@
+Description: Don't remove cache dir if non-existent.
+Origin: upstream, http://code.google.com/p/font-manager/source/detail?r=261
+Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=658328
+---
+ src/lib/fm-fontutils.c | 16 ++++++++--------
+ src/ui/fontconfig.py | 8 +++++---
+ 2 files changed, 13 insertions(+), 11 deletions(-)
+
+--- font-manager.orig/src/lib/fm-fontutils.c
++++ font-manager/src/lib/fm-fontutils.c
+@@ -72,8 +72,8 @@ FcListFiles()
+ {
+ FcChar8 *file;
+
+- FcPatternGetString(fontset->fonts[i], FC_FILE, 0, &file);
+- filelist = g_slist_prepend(filelist, g_strdup((const gchar *) file));
++ if (FcPatternGetString(fontset->fonts[i], FC_FILE, 0, &file) == FcResultMatch)
++ filelist = g_slist_prepend(filelist, g_strdup((const gchar *) file));
+ }
+
+ if (objectset)
+@@ -272,7 +272,7 @@ _get_base_font_info(FontInfo *fontinfo,
+ PangoFontDescription *descr;
+
+ /* Need to add this font to the configuration, it may not be there in the
+- * case where this the font is not installed yet or possibly just installed
++ * case where this font is not installed yet or possibly just installed
+ */
+ FcConfigAppFontAddFile(FcConfigGetCurrent(), filepath);
+
+@@ -287,10 +287,10 @@ _get_base_font_info(FontInfo *fontinfo,
+ FcChar8 *family,
+ *style;
+
+- FcPatternGetString(fontset->fonts[i], FC_FAMILY, 0, &family);
+- FcPatternGetString(fontset->fonts[i], FC_STYLE, 0, &style);
+- ADD_PROP(fontinfo->family, family);
+- ADD_PROP(fontinfo->style, style);
++ if (FcPatternGetString(fontset->fonts[i], FC_FAMILY, 0, &family) == FcResultMatch)
++ ADD_PROP(fontinfo->family, family);
++ if (FcPatternGetString(fontset->fonts[i], FC_STYLE, 0, &style) == FcResultMatch)
++ ADD_PROP(fontinfo->style, style);
+ }
+
+ descr = pango_fc_font_description_from_pattern(pattern, FALSE);
+@@ -539,7 +539,7 @@ static const struct
+ }
+ NoticeData[] =
+ {
+- {"Bigelow", "B&H"},
++ {"Bigelow", "Bigelow & Holmes"},
+ {"Adobe", "Adobe"},
+ {"Bitstream", "Bitstream"},
+ {"Monotype", "Monotype"},
+--- font-manager.orig/src/ui/fontconfig.py
++++ font-manager/src/ui/fontconfig.py
+@@ -376,9 +376,11 @@ class ConfigEdit(gtk.Window):
+ for name in self.cache.iterkeys():
+ discard_fontconfig_settings(self.cache[name])
+ self.save_settings(None)
+- os.unlink(join(CACHE_DIR, CACHED_SETTINGS))
+- os.unlink(join(USER_FONT_CONFIG_DIR,
+- '25-{0}.conf'.format(self.selected_family.get_name())))
++ cache = join(CACHE_DIR, CACHED_SETTINGS)
++ not exists(cache) or os.unlink(cache)
++ cache = join(USER_FONT_CONFIG_DIR,
++ '25-{0}.conf'.format(self.selected_family.get_name()))
++ not exists(cache) or os.unlink(cache)
+ return
+
+ def save_cache(self):
diff --git a/pcr/font-manager/1001-gcc47.patch b/pcr/font-manager/1001-gcc47.patch
new file mode 100644
index 000000000..1563c71ce
--- /dev/null
+++ b/pcr/font-manager/1001-gcc47.patch
@@ -0,0 +1,18 @@
+Description: Fix missing #includes to prevent FTBFS with GCC 4.7.
+Author: Alessio Treglia <alessio@debian.org>
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672043
+Forwarded: http://code.google.com/p/font-manager/issues/detail?id=71
+---
+ src/lib/fm-fontutils.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- font-manager.orig/src/lib/fm-fontutils.c
++++ font-manager/src/lib/fm-fontutils.c
+@@ -21,6 +21,7 @@
+ * Boston, MA 02110-1301, USA
+ */
+
++#include <unistd.h>
+ #include <glib.h>
+ #include <glib/gprintf.h>
+ #include <glib/gstdio.h>
diff --git a/pcr/font-manager/2001-paths.patch b/pcr/font-manager/2001-paths.patch
new file mode 100644
index 000000000..2c15232fc
--- /dev/null
+++ b/pcr/font-manager/2001-paths.patch
@@ -0,0 +1,25 @@
+Description: Fixes file location constants to more updated/organized variants.
+ ~/.fonts.conf -> ~/.config/fontconfig/fonts.conf
+ ~/.fonts/ -> ~/.local/share/fonts/
+Author: i_magnific0 (i_magnific0@yahoo.com)
+Notes: patch not submitted
+---
+ src/constants.py.in | 4 ++--
+ 1 file changed, 2 insertion(+), 2 deletions(-)
+
+--- font-manager.orig/src/constants.py.in
++++ font-manager/src/constants.py
+@@ -75,11 +75,11 @@
+
+ HOME = os.getenv('HOME')
+ USER = os.getenv('USER')
+-USER_FONT_DIR = join(HOME, '.fonts')
++USER_FONT_DIR = join(glib.get_user_data_dir(), 'fonts')
+ COMPAT_COLLECTIONS = join(CONFIG_DIR, 'fontgroups.xml')
+ USER_FONT_COLLECTIONS = join(DATA_DIR, 'Collections.xml')
+ USER_FONT_COLLECTIONS_BAK = join(DATA_DIR, 'Collections.xml.bak')
+-USER_FONT_CONFIG = join(HOME, '.fonts.conf')
++USER_FONT_CONFIG = join(CONFIG_DIR, 'fontconfig/fonts.conf')
+ USER_FONT_CONFIG_DIR = join(APP_CONFIG_DIR, 'conf.d')
+ USER_FONT_CONFIG_DIRS = join(APP_CONFIG_DIR, 'directories.conf')
+ USER_FONT_CONFIG_RENDER = join(APP_CONFIG_DIR, 'local.conf')
diff --git a/pcr/font-manager/2002-local-fontconfig-path.patch b/pcr/font-manager/2002-local-fontconfig-path.patch
new file mode 100644
index 000000000..b3c65cc5c
--- /dev/null
+++ b/pcr/font-manager/2002-local-fontconfig-path.patch
@@ -0,0 +1,11 @@
+--- font-manager/src/core/__init__.py.in 2010-12-24 11:05:14.000000000 +0800
++++ font-manager/src/core/__init__.py.in 2013-06-12 21:15:28.294418494 +0800
+@@ -882,7 +882,7 @@
+ # Make sure we have everything we need to run properly
+ _setup_logging()
+ for folder in CACHE_DIR, CONFIG_DIR, APP_CONFIG_DIR, AUTOSTART_DIR, DATA_DIR, \
+- USER_FONT_CONFIG_DIR, USER_FONT_DIR, USER_LIBRARY_DIR:
++ USER_FONT_CONFIG_DIR, USER_FONT_DIR, USER_LIBRARY_DIR, join(CONFIG_DIR, 'fontconfig'):
+ if not exists(folder):
+ os.makedirs(folder, 0755)
+ if folder == USER_FONT_DIR:
diff --git a/pcr/font-manager/2003-file-roller-syntax-fix.patch b/pcr/font-manager/2003-file-roller-syntax-fix.patch
new file mode 100644
index 000000000..229e13dc6
--- /dev/null
+++ b/pcr/font-manager/2003-file-roller-syntax-fix.patch
@@ -0,0 +1,22 @@
+--- font-manager/src/utils/common.py 2010-12-20 12:47:37.000000000 +0800
++++ font-manager/src/utils/common.py 2013-06-12 22:09:06.296985078 +0800
+@@ -146,7 +146,7 @@
+
+ If delete is True, folder will be deleted afterwards
+ """
+- archiver = """file-roller -a '{0}.{1}' '{2}'""".format(arch_name,
++ archiver = """file-roller --add-to='{0}.{1}' '{2}'""".format(arch_name,
+ arch_type, folder)
+ os.chdir(destination)
+ roller = subprocess.Popen(shlex.split(archiver))
+--- font-manager/src/core/fonts.py 2010-12-20 13:14:43.000000000 +0800
++++ font-manager/src/core/fonts.py 2013-06-12 22:26:29.084669145 +0800
+@@ -524,7 +524,7 @@
+ tmp_dir = tempfile.mkdtemp(suffix='-font-manager', prefix='tmp-')
+ arch_dir = join(tmp_dir, dir_name)
+ os.mkdir(arch_dir)
+- subprocess.call(['file-roller', '-e', arch_dir, filepath])
++ subprocess.call(['file-roller', '--extract-to=' + arch_dir, filepath])
+ # Todo: Need to check whether archive actually contained any fonts
+ # if user_is_stupid:
+ # self.notify()
diff --git a/pcr/font-manager/PKGBUILD b/pcr/font-manager/PKGBUILD
new file mode 100644
index 000000000..7224df504
--- /dev/null
+++ b/pcr/font-manager/PKGBUILD
@@ -0,0 +1,58 @@
+# Contributor: Joeny Ang <ang(dot)joeny(at)gmail(dot)com>
+# Contributor: Guan 'kuno' Qing <neokuno(at)gmail(dot)com>
+# Contributor: Guten Ye <ywzhaifei(at)gmail(dot)com>
+# Contributor: i_magnific0 <i_magnific0(at)yahoo(dot)com>
+# Maintainer (Parabola): Esteban Carnevale <alfplayer@mailoo.org>
+
+pkgname=font-manager
+pkgver=0.5.7
+pkgrel=4
+pkgdesc="A font management application for the GNOME desktop"
+url="http://code.google.com/p/font-manager/"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=('pygtk>=2.0' 'libxml2' 'fontconfig')
+optdepends=('file-roller: to import/export font collections to archives'
+ 'gucharmap: to view selected font using GNOME character map application'
+ 'python-reportlab: to create PDF sample sheets')
+source=(http://font-manager.googlecode.com/files/${pkgname}-${pkgver}.tar.bz2
+ 0001-nonexistent_cache.patch
+ 1001-gcc47.patch
+ 2001-paths.patch
+ 2002-local-fontconfig-path.patch
+ 2003-file-roller-syntax-fix.patch)
+md5sums=('7cd3b635eaddcb84a8b31509880510ed'
+ '50e732de1a92bc498d4cffd39185225c'
+ '727acfbbce4ab8d05078e4719443ce29'
+ 'a9a3cfc9433a0a4c710d4192f34760b9'
+ '119c5049113dadbf54aa4d2edf243d97'
+ '1daadcf92126caa46a628710fd07ae41')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr --sysconfdir=/etc
+ sed -i -e 's/^PYTHON.*/PYTHON=\/usr\/bin\/python2/' Makefile
+
+ # apply patches from Debian
+ # source: http://ftp.de.debian.org/debian/pool/main/f/font-manager/font-manager_0.5.7-4.debian.tar.gz
+ patch -Np1 < ../0001-nonexistent_cache.patch
+ patch -Np1 < ../1001-gcc47.patch
+
+ # apply config file location constants patch by i_magnific0
+ # source: https://github.com/magnific0/font-manager
+ patch -Np1 < ../2001-paths.patch
+
+ # apply patch to create local fontconfig path if not found
+ patch -Np1 < ../2002-local-fontconfig-path.patch
+
+ # apply patch to fix file-roller command line syntax
+ patch -Np1 < ../2003-file-roller-syntax-fix.patch
+
+ # build
+ make
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir}/ install
+}