Re: [PATCH 1/3] gnu: wxwidgets: Fix for Filezilla client.

2017-02-17 Thread rennes

Hello again,
Resend patch, forget run './pre-inst-env guix lint wxwidgets'.

On 2017-02-17 18:39, ren...@openmailbox.org wrote:

Hello,

Patch updated according to your suggestions.
Thanks
From bcb6d42b3f8e4aa06f794c0734c7ec87fa481c04 Mon Sep 17 00:00:00 2001
From: rennes 
Date: Fri, 17 Feb 2017 19:16:36 -0600
Subject: [PATCH 1/3] gnu: wxwidgets: Fix for Filezilla client.

* gnu/packages/patches/wxwidgets-fix-windowGTK.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk   |  3 ++-
 gnu/packages/patches/wxwidgets-fix-windowGTK.patch | 20 
 gnu/packages/wxwidgets.scm |  5 -
 3 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/wxwidgets-fix-windowGTK.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 060de2535..681d3fa1b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -5,7 +5,7 @@
 # Copyright © 2013, 2014, 2015, 2016 Mark H Weaver 
 # Copyright © 2016 Chris Marusich 
 # Copyright © 2016, 2017 Kei Kebreau 
-# Copyright © 2016 Rene Saavedra 
+# Copyright © 2016, 2017 Rene Saavedra 
 # Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> 
 # Copyright © 2016, 2017 Ricardo Wurmus 
 # Copyright © 2016 Ben Woodcroft 
@@ -971,6 +971,7 @@ dist_patch_DATA =		\
   %D%/packages/patches/wordnet-CVE-2008-2149.patch			\
   %D%/packages/patches/wordnet-CVE-2008-3908-pt1.patch			\
   %D%/packages/patches/wordnet-CVE-2008-3908-pt2.patch			\
+  %D%/packages/patches/wxwidgets-fix-windowGTK.patch		\
   %D%/packages/patches/xdotool-fix-makefile.patch   \
   %D%/packages/patches/xf86-video-ark-remove-mibstore.patch	\
   %D%/packages/patches/xf86-video-ast-remove-mibstore.patch	\
diff --git a/gnu/packages/patches/wxwidgets-fix-windowGTK.patch b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch
new file mode 100644
index 0..1c0d0704a
--- /dev/null
+++ b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch
@@ -0,0 +1,20 @@
+This patch allow Filezilla client to resize window.
+The patch was adapted from upstream source repository:
+'<http://trac.wxwidgets.org/changeset/4793e5b0a4e189e492287305859b278fed780080/git-wxWidgets>'
+
+Commit: a97553a939b76df1564ffbfe9c919d1da5a34c5a
+
+--- a/src/gtk/toplevel.cpp	2014-10-06 16:33:44.0 -0500
 b/src/gtk/toplevel.cpp	2017-02-16 21:33:27.779907810 -0600
+@@ -1216,8 +1216,9 @@
+ int hints_mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
+ hints.min_width = 1;
+ hints.min_height = 1;
+-hints.max_width = INT_MAX;
+-hints.max_height = INT_MAX;
++// using INT_MAX for size will lead to integer overflow with HiDPI scaling
++hints.max_width = INT_MAX / 16;
++hints.max_height = INT_MAX / 16;
+ const int decorSize_x = m_decorSize.left + m_decorSize.right;
+ const int decorSize_y = m_decorSize.top + m_decorSize.bottom;
+ if (minSize.x > decorSize_x)
diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 5285037ff..52fa8184d 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Ricardo Wurmus 
 ;;; Copyright © 2016 Theodoros Foradis 
 ;;; Copyright © 2016 Danny Milosavljevic 
+;;; Copyright © 2017 Rene Saavedra 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -50,7 +51,9 @@
"releases/download/v" version
"/wxWidgets-" version ".tar.bz2"))
(sha256
-(base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l"
+(base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l"))
+   (patches (search-patches
+ "wxwidgets-fix-windowGTK.patch"
 (build-system glib-or-gtk-build-system)
 (inputs
  `(("glu" ,glu)
-- 
2.11.0



Re: [PATCH 1/3] gnu: wxwidgets: Fix for Filezilla client.

2017-02-17 Thread rennes

Hello,

Patch updated according to your suggestions.
Thanks

On 2017-02-16 10:28, Leo Famulari wrote:

On Thu, Feb 09, 2017 at 10:36:16AM -0600, rennes wrote:

* gnu/packages/patches/wxwidgets-fix-windowGTK.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.


I'm unable to apply this patch to the Guix source tree. Please try
recreating it from current master and sending it again.




But, instead of using the proposed patch from the upstream bug report,
we should use the commit that was applied to the appropriate wxWidgets
branch and, if possible, include a link to that commit in their
web-based Git interface.

Can you send an updated patch?From 6b152648c3f56fc370ff4e9e33b745bd11ca6d77 Mon Sep 17 00:00:00 2001
From: rennes 
Date: Fri, 17 Feb 2017 18:14:42 -0600
Subject: [PATCH 1/3] gnu: wxwidgets: Fix for Filezilla client.

* gnu/packages/patches/wxwidgets-fix-windowGTK.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk   |  3 ++-
 gnu/packages/patches/wxwidgets-fix-windowGTK.patch | 20 
 gnu/packages/wxwidgets.scm |  5 -
 3 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/wxwidgets-fix-windowGTK.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 060de2535..681d3fa1b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -5,7 +5,7 @@
 # Copyright © 2013, 2014, 2015, 2016 Mark H Weaver 
 # Copyright © 2016 Chris Marusich 
 # Copyright © 2016, 2017 Kei Kebreau 
-# Copyright © 2016 Rene Saavedra 
+# Copyright © 2016, 2017 Rene Saavedra 
 # Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> 
 # Copyright © 2016, 2017 Ricardo Wurmus 
 # Copyright © 2016 Ben Woodcroft 
@@ -971,6 +971,7 @@ dist_patch_DATA =		\
   %D%/packages/patches/wordnet-CVE-2008-2149.patch			\
   %D%/packages/patches/wordnet-CVE-2008-3908-pt1.patch			\
   %D%/packages/patches/wordnet-CVE-2008-3908-pt2.patch			\
+  %D%/packages/patches/wxwidgets-fix-windowGTK.patch		\
   %D%/packages/patches/xdotool-fix-makefile.patch   \
   %D%/packages/patches/xf86-video-ark-remove-mibstore.patch	\
   %D%/packages/patches/xf86-video-ast-remove-mibstore.patch	\
diff --git a/gnu/packages/patches/wxwidgets-fix-windowGTK.patch b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch
new file mode 100644
index 0..1c0d0704a
--- /dev/null
+++ b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch
@@ -0,0 +1,20 @@
+This patch allow Filezilla client to resize window.
+The patch was adapted from upstream source repository:
+'<http://trac.wxwidgets.org/changeset/4793e5b0a4e189e492287305859b278fed780080/git-wxWidgets>'
+
+Commit: a97553a939b76df1564ffbfe9c919d1da5a34c5a
+
+--- a/src/gtk/toplevel.cpp	2014-10-06 16:33:44.0 -0500
 b/src/gtk/toplevel.cpp	2017-02-16 21:33:27.779907810 -0600
+@@ -1216,8 +1216,9 @@
+ int hints_mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
+ hints.min_width = 1;
+ hints.min_height = 1;
+-hints.max_width = INT_MAX;
+-hints.max_height = INT_MAX;
++// using INT_MAX for size will lead to integer overflow with HiDPI scaling
++hints.max_width = INT_MAX / 16;
++hints.max_height = INT_MAX / 16;
+ const int decorSize_x = m_decorSize.left + m_decorSize.right;
+ const int decorSize_y = m_decorSize.top + m_decorSize.bottom;
+ if (minSize.x > decorSize_x)
diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 5285037ff..953910652 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Ricardo Wurmus 
 ;;; Copyright © 2016 Theodoros Foradis 
 ;;; Copyright © 2016 Danny Milosavljevic 
+;;; Copyright © 2017 Rene Saavedra 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -50,7 +51,9 @@
"releases/download/v" version
"/wxWidgets-" version ".tar.bz2"))
(sha256
-(base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l"
+(base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l"))
+   (patches (search-patches
+ "wxwidgets-fix-windowGTK.patch"   
 (build-system glib-or-gtk-build-system)
 (inputs
  `(("glu" ,glu)
-- 
2.11.0



Re: [PATCH 1/3] gnu: wxwidgets: Fix for Filezilla client.

2017-02-16 Thread Leo Famulari
On Thu, Feb 09, 2017 at 10:36:16AM -0600, rennes wrote:
> * gnu/packages/patches/wxwidgets-fix-windowGTK.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.

I'm unable to apply this patch to the Guix source tree. Please try
recreating it from current master and sending it again.

> diff --git a/gnu/packages/patches/wxwidgets-fix-windowGTK.patch 
> b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch
> new file mode 100644
> index 0..05e2e5819
> --- /dev/null
> +++ b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch
> @@ -0,0 +1,35 @@
> +This patch allow Filezilla client to resize window.
> +
> +Authors: Tim Kosse 
> +Upstream status: This issue was fixed in master branch.
> +Ticket: ''
> +
> +From 3a52125f81d28fcad5d3c841b94a3e4bad295d9e Mon Sep 17 00:00:00 2001
> +From: Tim Kosse 
> +Date: Sun, 20 Mar 2016 10:22:13 +0100
> +Subject: [PATCH] Fix wxTopLevelWindowGTK::DoSetSizeHints if a window scale
> +factor larger than 1  is set.
> +
> +In this case, passing INT_MAX as maximum width/height hint
> +to gtk_window_set_geometry_hints leads to integer overlows.
> +
> +Instead, use INT_MAX / 16 which should work with all
> +resonable scale factors.

Okay, thanks!

But, instead of using the proposed patch from the upstream bug report,
we should use the commit that was applied to the appropriate wxWidgets
branch and, if possible, include a link to that commit in their
web-based Git interface.

Can you send an updated patch?



[PATCH 1/3] gnu: wxwidgets: Fix for Filezilla client.

2017-02-09 Thread rennes
* gnu/packages/patches/wxwidgets-fix-windowGTK.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk   |  3 +-
 gnu/packages/patches/wxwidgets-fix-windowGTK.patch | 35 ++
 gnu/packages/wxwidgets.scm |  5 +++-
 3 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/wxwidgets-fix-windowGTK.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 63ce3af71..d94cede10 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -5,7 +5,7 @@
 # Copyright © 2013, 2014, 2015, 2016 Mark H Weaver 
 # Copyright © 2016 Chris Marusich 
 # Copyright © 2016 Kei Kebreau 
-# Copyright © 2016 Rene Saavedra 
+# Copyright © 2016, 2017 Rene Saavedra 
 # Copyright © 2016 Adonay "adfeno" Felipe Nogueira 
 
 # Copyright © 2016, 2017 Ricardo Wurmus 
 # Copyright © 2016 Ben Woodcroft 
@@ -957,6 +957,7 @@ dist_patch_DATA =   
\
   %D%/packages/patches/wordnet-CVE-2008-2149.patch \
   %D%/packages/patches/wordnet-CVE-2008-3908-pt1.patch \
   %D%/packages/patches/wordnet-CVE-2008-3908-pt2.patch \
+  %D%/packages/patches/wxwidgets-fix-windowGTK.patch   \
   %D%/packages/patches/xdotool-fix-makefile.patch   \
   %D%/packages/patches/xf86-video-ark-remove-mibstore.patch\
   %D%/packages/patches/xf86-video-ast-remove-mibstore.patch\
diff --git a/gnu/packages/patches/wxwidgets-fix-windowGTK.patch 
b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch
new file mode 100644
index 0..05e2e5819
--- /dev/null
+++ b/gnu/packages/patches/wxwidgets-fix-windowGTK.patch
@@ -0,0 +1,35 @@
+This patch allow Filezilla client to resize window.
+
+Authors: Tim Kosse 
+Upstream status: This issue was fixed in master branch.
+Ticket: ''
+
+From 3a52125f81d28fcad5d3c841b94a3e4bad295d9e Mon Sep 17 00:00:00 2001
+From: Tim Kosse 
+Date: Sun, 20 Mar 2016 10:22:13 +0100
+Subject: [PATCH] Fix wxTopLevelWindowGTK::DoSetSizeHints if a window scale
+factor larger than 1  is set.
+
+In this case, passing INT_MAX as maximum width/height hint
+to gtk_window_set_geometry_hints leads to integer overlows.
+
+Instead, use INT_MAX / 16 which should work with all
+resonable scale factors.
+
+--- a/src/gtk/toplevel.cpp 2014-10-06 16:33:44.0 -0500
 b/src/gtk/toplevel.cpp 2017-02-07 20:44:07.382988282 -0600
+@@ -1216,8 +1216,12 @@
+ int hints_mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
+ hints.min_width = 1;
+ hints.min_height = 1;
+-hints.max_width = INT_MAX;
+-hints.max_height = INT_MAX;
++// Due to HiDPI UI scale, using INT_MAX leads to integer
++// overflows when calculating the actual window size.
++// Divide by 16 to to accomodate crazy high scale factors
++// without overflowing.
++hints.max_width = INT_MAX / 16;
++hints.max_height = INT_MAX / 16;
+ const int decorSize_x = m_decorSize.left + m_decorSize.right;
+ const int decorSize_y = m_decorSize.top + m_decorSize.bottom;
+ if (minSize.x > decorSize_x)
diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm
index 5285037ff..52fa8184d 100644
--- a/gnu/packages/wxwidgets.scm
+++ b/gnu/packages/wxwidgets.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Ricardo Wurmus 
 ;;; Copyright © 2016 Theodoros Foradis 
 ;;; Copyright © 2016 Danny Milosavljevic 
+;;; Copyright © 2017 Rene Saavedra 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -50,7 +51,9 @@
"releases/download/v" version
"/wxWidgets-" version ".tar.bz2"))
(sha256
-(base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l"
+(base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l"))
+   (patches (search-patches
+ "wxwidgets-fix-windowGTK.patch"
 (build-system glib-or-gtk-build-system)
 (inputs
  `(("glu" ,glu)
-- 
2.11.0