summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleot <leot@pkgsrc.org>2016-12-09 08:06:50 +0000
committerleot <leot@pkgsrc.org>2016-12-09 08:06:50 +0000
commitf00a44fe5805b3d256fcffb583493a6292e08571 (patch)
treee3f7da1d08fdc06915a6b64e62fcb25ac154f8da
parent3666da903dff355a511b6fbad9fb3fed79c7aeed (diff)
downloadpkgsrc-f00a44fe5805b3d256fcffb583493a6292e08571.tar.gz
Fix various rendering problems for changes in Gtk+ 3.21 (due font handling
incompatibilites). Bump PKGREVISION Patches back-ported from `develop' branch via upstream. Approved by <degroote>
-rw-r--r--graphics/girara/Makefile4
-rw-r--r--graphics/girara/distinfo6
-rw-r--r--graphics/girara/patches/patch-data_girara-post-3.20.css__t43
-rw-r--r--graphics/girara/patches/patch-girara_config.c17
-rw-r--r--graphics/girara/patches/patch-girara_internal.h16
-rw-r--r--graphics/girara/patches/patch-girara_session.c123
6 files changed, 206 insertions, 3 deletions
diff --git a/graphics/girara/Makefile b/graphics/girara/Makefile
index 890f8660363..48f12886e30 100644
--- a/graphics/girara/Makefile
+++ b/graphics/girara/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.3 2016/08/03 10:22:14 adam Exp $
+# $NetBSD: Makefile,v 1.4 2016/12/09 08:06:50 leot Exp $
#
DISTNAME= girara-0.2.6
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= x11
MASTER_SITES= http://pwmt.org/projects/girara/download/
diff --git a/graphics/girara/distinfo b/graphics/girara/distinfo
index b0ffb9d1ec3..f1c92e51bb8 100644
--- a/graphics/girara/distinfo
+++ b/graphics/girara/distinfo
@@ -1,8 +1,12 @@
-$NetBSD: distinfo,v 1.2 2016/04/20 06:57:21 leot Exp $
+$NetBSD: distinfo,v 1.3 2016/12/09 08:06:50 leot Exp $
SHA1 (girara-0.2.6.tar.gz) = 674e4294fe091fe93a1c186d95b3263b30cd8a5e
RMD160 (girara-0.2.6.tar.gz) = 872889a2d5abcb907d8dbe2a27e7c9bb238963b8
SHA512 (girara-0.2.6.tar.gz) = a55702fc85594c6b8ee2cf3cdcde659b2b85559d1d5d2eff9ff05247b9762d0ee4ccc8e5e2fbb12ad174fb85bca7941a413c866aafa419765ed88cc1c4efa901
Size (girara-0.2.6.tar.gz) = 75841 bytes
SHA1 (patch-Makefile) = 26e28108f3d448ee4305cd4e3d8f7e9e3b24d343
+SHA1 (patch-data_girara-post-3.20.css__t) = a62cb52542c2a47cfc4536167eac7fcab9d6e6a5
+SHA1 (patch-girara_config.c) = 2682de9155162519bd719ad443dd3226c2c75109
+SHA1 (patch-girara_internal.h) = a2ac39fd53099bba7ef0b4ebd99074dfc60477cb
+SHA1 (patch-girara_session.c) = 973c3a4ac598425518524eb6285b589fcafb9ab2
SHA1 (patch-macros.h) = f9467ab009a53feec710a5f3d984c7b67b6747be
diff --git a/graphics/girara/patches/patch-data_girara-post-3.20.css__t b/graphics/girara/patches/patch-data_girara-post-3.20.css__t
new file mode 100644
index 00000000000..f03adf754cf
--- /dev/null
+++ b/graphics/girara/patches/patch-data_girara-post-3.20.css__t
@@ -0,0 +1,43 @@
+$NetBSD: patch-data_girara-post-3.20.css__t,v 1.1 2016/12/09 08:06:50 leot Exp $
+
+Update font handling for changes in Gtk+ 3.21
+(from upstream commit 949c879aa84e9496fabc7d3602060e29f9dc42a1)
+
+--- data/girara-post-3.20.css_t.orig 2016-04-18 20:35:34.000000000 +0000
++++ data/girara-post-3.20.css_t
+@@ -1,17 +1,22 @@
++#@session@ * {
++ color: @default-fg@;
++ background-color: @default-bg@;
++ background-image: none;
++ font-family: @font-family@;
++ font-size: @font-size@;
++ font-weight: @font-weight@;
++}
++
++/* Scrollbar */
++
+ #@session@ scrolledwindow scrollbar {
+ background-color: @scrollbar-bg@;
+ }
++
+ #@session@ scrolledwindow scrollbar > slider {
+ background-color: @scrollbar-fg@;
+ }
+
+-#@session@ * {
+- color: @default-fg@;
+- background-color: @default-bg@;
+- background-image: none;
+- font: @font@;
+-}
+-
+ /* Inputbar */
+
+ #@session@ entry.inputbar {
+@@ -111,4 +116,5 @@
+ #@session@ scrolledwindow overshoot.right,
+ #@session@ scrolledwindow overshoot.right:backdrop {
+ background-color: transparent;
++ background-image: none;
+ }
diff --git a/graphics/girara/patches/patch-girara_config.c b/graphics/girara/patches/patch-girara_config.c
new file mode 100644
index 00000000000..ca952ea1851
--- /dev/null
+++ b/graphics/girara/patches/patch-girara_config.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-girara_config.c,v 1.1 2016/12/09 08:06:50 leot Exp $
+
+Update font handling for changes in Gtk+ 3.21
+(from upstream commit 949c879aa84e9496fabc7d3602060e29f9dc42a1)
+
+--- girara/config.c.orig 2016-04-18 20:35:34.000000000 +0000
++++ girara/config.c
+@@ -50,8 +50,7 @@ cb_font(girara_session_t* session, const
+ {
+ g_return_if_fail(session != NULL && value != NULL);
+
+- girara_template_set_variable_value(session->private_data->csstemplate, "font",
+- value);
++ css_template_fill_font(session->private_data->csstemplate, value);
+ }
+
+ static void
diff --git a/graphics/girara/patches/patch-girara_internal.h b/graphics/girara/patches/patch-girara_internal.h
new file mode 100644
index 00000000000..f6c6a76a2ca
--- /dev/null
+++ b/graphics/girara/patches/patch-girara_internal.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-girara_internal.h,v 1.1 2016/12/09 08:06:50 leot Exp $
+
+Update font handling for changes in Gtk+ 3.21
+(from upstream commit 949c879aa84e9496fabc7d3602060e29f9dc42a1)
+
+--- girara/internal.h.orig 2016-04-18 20:35:34.000000000 +0000
++++ girara/internal.h
+@@ -148,6 +148,8 @@ HIDDEN bool girara_cmd_dump_config(girar
+ HIDDEN bool girara_sc_feedkeys(girara_session_t* session, girara_argument_t* argument,
+ girara_event_t* event, unsigned int t);
+
++HIDDEN void css_template_fill_font(GiraraTemplate* csstemplate, const char* font);
++
+ /**
+ * Structure of a command
+ */
diff --git a/graphics/girara/patches/patch-girara_session.c b/graphics/girara/patches/patch-girara_session.c
new file mode 100644
index 00000000000..c605b740476
--- /dev/null
+++ b/graphics/girara/patches/patch-girara_session.c
@@ -0,0 +1,123 @@
+$NetBSD: patch-girara_session.c,v 1.1 2016/12/09 08:06:50 leot Exp $
+
+Update font handling for changes in Gtk+ 3.21
+(from upstream commit 949c879aa84e9496fabc7d3602060e29f9dc42a1)
+
+--- girara/session.c.orig 2016-04-18 20:35:34.000000000 +0000
++++ girara/session.c
+@@ -44,7 +44,6 @@ init_template_engine(GiraraTemplate* css
+ {
+ static const char* variable_names[] = {
+ "session",
+- "font",
+ "default-fg",
+ "default-bg",
+ "inputbar-fg",
+@@ -78,6 +77,88 @@ init_template_engine(GiraraTemplate* css
+ for (size_t idx = 0; idx < LENGTH(variable_names); ++idx) {
+ girara_template_add_variable(csstemplate, variable_names[idx]);
+ }
++
++ if (gtk_check_version(3, 20, 0) == NULL) {
++ girara_template_add_variable(csstemplate, "font-family");
++ girara_template_add_variable(csstemplate, "font-size");
++ girara_template_add_variable(csstemplate, "font-weight");
++ } else {
++ girara_template_add_variable(csstemplate, "font");
++ }
++}
++
++void
++css_template_fill_font(GiraraTemplate* csstemplate, const char* font)
++{
++ if (gtk_check_version(3, 20, 0) != NULL) {
++ girara_template_set_variable_value(csstemplate, "font", font);
++ return;
++ }
++
++ PangoFontDescription* descr = pango_font_description_from_string(font);
++ if (descr == NULL) {
++ return;
++ }
++
++ girara_template_set_variable_value(csstemplate, "font-family",
++ pango_font_description_get_family(descr));
++
++ char* size = g_strdup_printf("%d%s", pango_font_description_get_size(descr) / PANGO_SCALE,
++ pango_font_description_get_size_is_absolute(descr) == FALSE ? "pt" : "");
++ girara_template_set_variable_value(csstemplate, "font-size", size);
++ g_free(size);
++
++ switch (pango_font_description_get_weight(descr)) {
++ case PANGO_WEIGHT_THIN:
++ girara_template_set_variable_value(csstemplate, "font-weight", "thin");
++ break;
++
++ case PANGO_WEIGHT_ULTRALIGHT:
++ girara_template_set_variable_value(csstemplate, "font-weight", "ultralight");
++ break;
++
++ case PANGO_WEIGHT_SEMILIGHT:
++ girara_template_set_variable_value(csstemplate, "font-weight", "light");
++ break;
++
++ case PANGO_WEIGHT_LIGHT:
++ girara_template_set_variable_value(csstemplate, "font-weight", "light");
++ break;
++
++ case PANGO_WEIGHT_BOOK:
++ girara_template_set_variable_value(csstemplate, "font-weight", "book");
++ break;
++
++ case PANGO_WEIGHT_MEDIUM:
++ girara_template_set_variable_value(csstemplate, "font-weight", "medium");
++ break;
++
++ case PANGO_WEIGHT_SEMIBOLD:
++ girara_template_set_variable_value(csstemplate, "font-weight", "semibold");
++ break;
++
++ case PANGO_WEIGHT_BOLD:
++ girara_template_set_variable_value(csstemplate, "font-weight", "bold");
++ break;
++
++ case PANGO_WEIGHT_ULTRABOLD:
++ girara_template_set_variable_value(csstemplate, "font-weight", "ultrabold");
++ break;
++
++ case PANGO_WEIGHT_HEAVY:
++ girara_template_set_variable_value(csstemplate, "font-weight", "heavy");
++ break;
++
++ case PANGO_WEIGHT_ULTRAHEAVY:
++ girara_template_set_variable_value(csstemplate, "font-weight", "ultraheavy");
++ break;
++
++ default:
++ girara_template_set_variable_value(csstemplate, "font-weight", "normal");
++ break;
++ }
++
++ pango_font_description_free(descr);
+ }
+
+ static void
+@@ -91,10 +172,16 @@ fill_template_with_values(girara_session
+ char* font = NULL;
+ girara_setting_get(session, "font", &font);
+ if (font != NULL) {
+- girara_template_set_variable_value(csstemplate, "font", font);
++ css_template_fill_font(csstemplate, font);
+ g_free(font);
+ } else {
+- girara_template_set_variable_value(csstemplate, "font", "monospace normal 9");
++ if (gtk_check_version(3, 20, 0) == NULL) {
++ girara_template_set_variable_value(csstemplate, "font-family", "monospace");
++ girara_template_set_variable_value(csstemplate, "font-size", "9pt");
++ girara_template_set_variable_value(csstemplate, "font-weight", "normal");
++ } else {
++ girara_template_set_variable_value(csstemplate, "font", "monospace normal 9");
++ }
+ };
+
+ /* parse color values */