Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/golly/, app-misc/golly/files/
Date: Sun, 25 Nov 2018 13:14:12
Message-Id: 1543151636.8f7accb422905ad75fac88b548a933715e23a3ac.slyfox@gentoo
1 commit: 8f7accb422905ad75fac88b548a933715e23a3ac
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 25 13:08:42 2018 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 25 13:13:56 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f7accb4
7
8 app-misc/golly: bump up to 3.2, bug #661360
9
10 Also applied mouse patches provided by Hooloovo0 \o/
11
12 Reported-by: Hooloovo0
13 Closes: https://bugs.gentoo.org/661360
14 Package-Manager: Portage-2.3.52, Repoman-2.3.12
15 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
16
17 app-misc/golly/Manifest | 1 +
18 app-misc/golly/files/golly-3.2-mouse-1.patch | 63 ++++++++++++++++++++++++++++
19 app-misc/golly/files/golly-3.2-mouse-2.patch | 45 ++++++++++++++++++++
20 app-misc/golly/golly-3.2.ebuild | 59 ++++++++++++++++++++++++++
21 4 files changed, 168 insertions(+)
22
23 diff --git a/app-misc/golly/Manifest b/app-misc/golly/Manifest
24 index d6b3eaf28ce..2b935b9a5fa 100644
25 --- a/app-misc/golly/Manifest
26 +++ b/app-misc/golly/Manifest
27 @@ -1,2 +1,3 @@
28 DIST golly-2.7-src.tar.gz 3881882 BLAKE2B 1989ff56049b7a182cbca35e33ac287c279ebac69acc5d07ac5122e8ccffef978a2e063c0587813d177a6311c854c6d52c2e80a5919107f9c6b17947a5e5f1ab SHA512 084919f508b471cc0937d50307410c3f48281e7328e3b9d20e634b9ddfe5909e3b9a000da5a9845a2ba7e45a733fee39e2e6d55902c9af110b5f2d7ea8654d77
29 DIST golly-2.8-src.tar.gz 4087191 BLAKE2B 4029b9bd30624cf2253dc5524c998f7e50648d39bc8dccf23b5c6b586989a641dde17b9fe35f16043d0f0d4a60da46729b31a9715b5d07950d610ea41a93a7a5 SHA512 bd86f685d180687814a44aa51edf4952a5af9024abb76d6b30faf1229edc86a1ba4e1f2c13f249f604d483fbde1a6db05150263450935b5bb073c155ad166a53
30 +DIST golly-3.2-src.tar.gz 5261483 BLAKE2B c9a1c09c71bafcb624eab91c7b86d671bd0cec23041d5ada91972c363242a4bc0c55d699f45e9b732dd00d4f030818a51f9c1e4ccafed298e230d912d4d22235 SHA512 bff5bbe75c0914bfcd416101894f8be1fd644c147fb90e0ad2cf87b4472c132c5d50be1829345fae59038e3d2e106ac417c5bc3cbc5c7d3a32a03c241b7a8eca
31
32 diff --git a/app-misc/golly/files/golly-3.2-mouse-1.patch b/app-misc/golly/files/golly-3.2-mouse-1.patch
33 new file mode 100644
34 index 00000000000..ab4fc703f50
35 --- /dev/null
36 +++ b/app-misc/golly/files/golly-3.2-mouse-1.patch
37 @@ -0,0 +1,63 @@
38 +From e22d1534d486a7b46612ca6f6cd693b8fa4635d2 Mon Sep 17 00:00:00 2001
39 +From: Chris Rowett <rowett@×××××.com>
40 +Date: Tue, 10 Jul 2018 23:22:20 +0100
41 +Subject: [PATCH] bugfix: do not process other mouse buttons until current
42 + button released
43 +
44 +---
45 + gui-wx/wxview.cpp | 15 +++++++++++++++
46 + gui-wx/wxview.h | 2 ++
47 + 2 files changed, 17 insertions(+)
48 +
49 +--- a/gui-wx/wxview.cpp
50 ++++ b/gui-wx/wxview.cpp
51 +@@ -2801,6 +2801,13 @@ void PatternView::OnMouseDown(wxMouseEvent& event)
52 + int button = event.GetButton();
53 + int modifiers = GetMouseModifiers(event);
54 +
55 ++ // ignore if a mouse button is already down
56 ++ if (mouseisdown) return;
57 ++
58 ++ // flag that a mouse button is down
59 ++ mouseisdown = true;
60 ++ whichbuttondown = button;
61 ++
62 + if (waitingforclick && button == wxMOUSE_BTN_LEFT) {
63 + // save paste location
64 + pastex = x;
65 +@@ -2870,6 +2877,13 @@ void PatternView::OnMouseDown(wxMouseEvent& event)
66 +
67 + void PatternView::OnMouseUp(wxMouseEvent& event)
68 + {
69 ++ // if the button released was not the first held down then ignore
70 ++ int button = event.GetButton();
71 ++ if (button != whichbuttondown) return;
72 ++
73 ++ // same button released so process
74 ++ mouseisdown = false;
75 ++
76 + if (drawingcells || selectingcells || movingview || clickedcontrol > NO_CONTROL) {
77 + StopDraggingMouse();
78 + } else if (mainptr->draw_pending) {
79 +@@ -3273,6 +3287,7 @@ PatternView::PatternView(wxWindow* parent, wxCoord x, wxCoord y, int wd, int ht,
80 + selectingcells = false; // not selecting cells
81 + movingview = false; // not moving view
82 + waitingforclick = false; // not waiting for user to click
83 ++ mouseisdown = false; // mouse button is not down
84 + nopattupdate = false; // enable pattern updates
85 + showcontrols = false; // not showing translucent controls
86 + oldcursor = NULL; // for toggling cursor via shift key
87 +--- a/gui-wx/wxview.h
88 ++++ b/gui-wx/wxview.h
89 +@@ -102,6 +102,8 @@ public:
90 + bool movingview; // moving view due to dragging mouse?
91 + bool nopattupdate; // disable pattern updates?
92 + bool showcontrols; // draw translucent controls?
93 ++ bool mouseisdown; // mouse button held down?
94 ++ int whichbuttondown; // which mouse button is down
95 + wxRect controlsrect; // location of translucent controls
96 + wxRect pasterect; // area to be pasted
97 + wxCursor* oldcursor; // non-NULL if shift key has toggled cursor
98 +--
99 +2.19.2
100 +
101
102 diff --git a/app-misc/golly/files/golly-3.2-mouse-2.patch b/app-misc/golly/files/golly-3.2-mouse-2.patch
103 new file mode 100644
104 index 00000000000..b2655ba6212
105 --- /dev/null
106 +++ b/app-misc/golly/files/golly-3.2-mouse-2.patch
107 @@ -0,0 +1,45 @@
108 +From 746f5f6f0c29867ac97516d00fdf58d3496a6687 Mon Sep 17 00:00:00 2001
109 +From: Chris Rowett <rowett@×××××.com>
110 +Date: Wed, 11 Jul 2018 12:44:22 +0100
111 +Subject: [PATCH] bugfix: clear mousedown flag in mousecapturelost event
112 + handler
113 +
114 +---
115 + gui-wx/wxview.cpp | 7 +------
116 + 1 file changed, 1 insertion(+), 6 deletions(-)
117 +
118 +--- a/gui-wx/wxview.cpp
119 ++++ b/gui-wx/wxview.cpp
120 +@@ -81,9 +81,7 @@ EVT_MIDDLE_DCLICK ( PatternView::OnMouseDown)
121 + EVT_LEFT_UP ( PatternView::OnMouseUp)
122 + EVT_RIGHT_UP ( PatternView::OnMouseUp)
123 + EVT_MIDDLE_UP ( PatternView::OnMouseUp)
124 +-#if wxCHECK_VERSION(2, 8, 0)
125 + EVT_MOUSE_CAPTURE_LOST ( PatternView::OnMouseCaptureLost)
126 +-#endif
127 + EVT_MOTION ( PatternView::OnMouseMotion)
128 + EVT_ENTER_WINDOW ( PatternView::OnMouseEnter)
129 + EVT_LEAVE_WINDOW ( PatternView::OnMouseExit)
130 +@@ -2901,18 +2899,15 @@ void PatternView::OnMouseUp(wxMouseEvent& event)
131 +
132 + // -----------------------------------------------------------------------------
133 +
134 +-#if wxCHECK_VERSION(2, 8, 0)
135 +-
136 + // mouse capture can be lost on Windows before mouse-up event
137 + void PatternView::OnMouseCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event))
138 + {
139 ++ mouseisdown = false;
140 + if (drawingcells || selectingcells || movingview || clickedcontrol > NO_CONTROL) {
141 + StopDraggingMouse();
142 + }
143 + }
144 +
145 +-#endif
146 +-
147 + // -----------------------------------------------------------------------------
148 +
149 + void PatternView::OnMouseMotion(wxMouseEvent& event)
150 +--
151 +2.19.2
152 +
153
154 diff --git a/app-misc/golly/golly-3.2.ebuild b/app-misc/golly/golly-3.2.ebuild
155 new file mode 100644
156 index 00000000000..6000a64174e
157 --- /dev/null
158 +++ b/app-misc/golly/golly-3.2.ebuild
159 @@ -0,0 +1,59 @@
160 +# Copyright 1999-2018 Gentoo Authors
161 +# Distributed under the terms of the GNU General Public License v2
162 +
163 +EAPI=6
164 +WX_GTK_VER=3.0
165 +PYTHON_COMPAT=( python2_7 )
166 +
167 +inherit eutils flag-o-matic python-single-r1 gnome2-utils wxwidgets
168 +
169 +DESCRIPTION="simulator for Conway's Game of Life and other cellular automata"
170 +HOMEPAGE="http://golly.sourceforge.net/"
171 +SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.gz"
172 +
173 +LICENSE="GPL-2"
174 +SLOT="0"
175 +KEYWORDS="~amd64 ~x86"
176 +IUSE="tiff"
177 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
178 +
179 +DEPEND="virtual/opengl
180 + sys-libs/zlib
181 + x11-libs/wxGTK:${WX_GTK_VER}[X,opengl,tiff?]"
182 +RDEPEND="${DEPEND}
183 + ${PYTHON_DEPS}"
184 +
185 +S=${WORKDIR}/${P}-src
186 +
187 +PATCHES=(
188 + "${FILESDIR}"/${P}-mouse-1.patch
189 + "${FILESDIR}"/${P}-mouse-2.patch
190 +)
191 +
192 +pkg_setup() {
193 + setup-wxwidgets
194 +}
195 +
196 +src_configure() {
197 + ECONF_SOURCE=gui-wx/configure econf \
198 + --with-wxshared
199 +}
200 +
201 +src_install() {
202 + emake docdir= DESTDIR="${D}" install
203 + dodoc docs/ReadMe.html
204 + newicon --size 32 gui-wx/icons/appicon.xpm ${PN}.xpm
205 + make_desktop_entry ${PN} "Golly" ${PN} "Science"
206 +}
207 +
208 +pkg_preinst() {
209 + gnome2_icon_savelist
210 +}
211 +
212 +pkg_postinst() {
213 + gnome2_icon_cache_update
214 +}
215 +
216 +pkg_postrm() {
217 + gnome2_icon_cache_update
218 +}