[arch-commits] Commit in gcompris-qt/repos (10 files)
Evangelos Foutras
foutrelis at archlinux.org
Tue Apr 11 17:51:35 UTC 2017
Date: Tuesday, April 11, 2017 @ 17:51:35
Author: foutrelis
Revision: 222324
archrelease: copy trunk to community-i686, community-x86_64
Added:
gcompris-qt/repos/community-i686/
gcompris-qt/repos/community-i686/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
(from rev 222322, gcompris-qt/trunk/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch)
gcompris-qt/repos/community-i686/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
(from rev 222322, gcompris-qt/trunk/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch)
gcompris-qt/repos/community-i686/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch
(from rev 222322, gcompris-qt/trunk/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch)
gcompris-qt/repos/community-i686/PKGBUILD
(from rev 222322, gcompris-qt/trunk/PKGBUILD)
gcompris-qt/repos/community-x86_64/
gcompris-qt/repos/community-x86_64/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
(from rev 222323, gcompris-qt/trunk/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch)
gcompris-qt/repos/community-x86_64/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
(from rev 222323, gcompris-qt/trunk/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch)
gcompris-qt/repos/community-x86_64/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch
(from rev 222323, gcompris-qt/trunk/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch)
gcompris-qt/repos/community-x86_64/PKGBUILD
(from rev 222323, gcompris-qt/trunk/PKGBUILD)
----------------------------------------------------------------------------------+
community-i686/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch | 83 +++++++
community-i686/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch | 117 ++++++++++
community-i686/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch | 36 +++
community-i686/PKGBUILD | 53 ++++
community-x86_64/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch | 83 +++++++
community-x86_64/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch | 117 ++++++++++
community-x86_64/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch | 36 +++
community-x86_64/PKGBUILD | 53 ++++
8 files changed, 578 insertions(+)
Copied: gcompris-qt/repos/community-i686/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch (from rev 222322, gcompris-qt/trunk/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch)
===================================================================
--- community-i686/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch (rev 0)
+++ community-i686/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch 2017-04-11 17:51:35 UTC (rev 222324)
@@ -0,0 +1,83 @@
+From 36606b617776ea0c87dac48834e440930d1d881a Mon Sep 17 00:00:00 2001
+From: Johnny Jazeix <jazeix at gmail.com>
+Date: Sat, 18 Feb 2017 19:39:02 +0100
+Subject: [PATCH 1/3] chess, Qt bug in 5.8 with do-while loop
+ (https://bugreports.qt.io/browse/QTBUG-59012)
+
+---
+ src/activities/chess/engine.js | 28 ++++++++++++++++++----------
+ 1 file changed, 18 insertions(+), 10 deletions(-)
+
+diff --git a/src/activities/chess/engine.js b/src/activities/chess/engine.js
+index 9a8a48d6..12330306 100644
+--- a/src/activities/chess/engine.js
++++ b/src/activities/chess/engine.js
+@@ -581,11 +581,14 @@ function p4_check_check(state, colour){
+ /*find the king. The pieces list updates from the end,
+ * so the last-most king is correctly placed.*/
+ var pieces = state.pieces[colour];
+- var p;
+ var i = pieces.length;
+- do {
+- p = pieces[--i];
+- } while (p[0] != (P4_KING | colour));
++ var king = P4_KING | colour
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ var val = king-1
++ while (val !== king) {
++ var p = pieces[--i];
++ val = p[0]
++ };
+ var s = p[1];
+ var other_colour = 1 - colour;
+ var dir = 10 - 20 * colour;
+@@ -614,19 +617,26 @@ function p4_check_check(state, colour){
+ var m = diagonal_moves[i];
+ var e = s;
+ var E;
+- do {
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += m;
++ E = board[e];
++ while (!E) {
+ e += m;
+ E = board[e];
+- } while (!E);
++ }
+ if((E & diag_mask) == diag_slider)
+ return true;
+
+ m = grid_moves[i];
+ e = s;
+- do {
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += m;
++ E = board[e];
++ while (!E) {
+ e += m;
+ E = board[e];
+- } while (!E);
++ }
++
+ if((E & grid_mask) == grid_slider)
+ return true;
+ }
+@@ -984,7 +994,6 @@ function p4_move(state, s, e, promotion){
+
+ /*Try the move, and see what the response is.*/
+ var changes = p4_make_move(state, s, e, promotion);
+-
+ /*is it check? */
+ if (p4_check_check(state, colour)){
+ p4_unmake_move(state, changes);
+@@ -997,7 +1006,6 @@ function p4_move(state, s, e, promotion){
+
+ state.enpassant = changes.ep;
+ state.history.push([s, e, promotion]);
+-
+ /*draw timeout: 50 moves without pawn move or capture is a draw */
+ if (changes.E || changes.ep_position){
+ state.draw_timeout = 0;
+--
+2.12.2
+
Copied: gcompris-qt/repos/community-i686/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch (from rev 222322, gcompris-qt/trunk/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch)
===================================================================
--- community-i686/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch (rev 0)
+++ community-i686/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch 2017-04-11 17:51:35 UTC (rev 222324)
@@ -0,0 +1,117 @@
+From 1e5cfe5a94c94c7a9c207971d9ebbae401ab796b Mon Sep 17 00:00:00 2001
+From: Johnny Jazeix <jazeix at gmail.com>
+Date: Sat, 18 Feb 2017 20:58:10 +0100
+Subject: [PATCH 2/3] chess, Qt bug in 5.8 with do-while loop
+ (https://bugreports.qt.io/browse/QTBUG-59012)
+
+---
+ src/activities/chess/engine.js | 49 +++++++++++++++++++++++++++++++-----------
+ 1 file changed, 36 insertions(+), 13 deletions(-)
+
+diff --git a/src/activities/chess/engine.js b/src/activities/chess/engine.js
+index 12330306..adcc0663 100644
+--- a/src/activities/chess/engine.js
++++ b/src/activities/chess/engine.js
+@@ -420,7 +420,17 @@ function p4_parse(state, colour, ep, score) {
+ for(i=0;i<mlen;){ //goeth thru list of moves
+ var m = moves[i++];
+ e=s;
+- do {
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e+=m;
++ E=board[e];
++ if(!E){
++ movelist.push([weight + values[E] + weight_lut[e], s, e]);
++ }
++ else if((E&17)==other_colour){
++ captures.push([weight + values[E] + weight_lut[e] + all_weights[E][e], s, e]);
++ }
++
++ while(!E) {
+ e+=m;
+ E=board[e];
+ if(!E){
+@@ -429,7 +439,7 @@ function p4_parse(state, colour, ep, score) {
+ else if((E&17)==other_colour){
+ captures.push([weight + values[E] + weight_lut[e] + all_weights[E][e], s, e]);
+ }
+- }while(!E);
++ }
+ }
+ }
+ }
+@@ -527,26 +537,35 @@ function p4_check_castling(board, s, colour, dir, side){
+ for(p = s; p < s + 3; p++){
+ //bishops, rooks, queens
+ e = p;
+- do{
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += dir;
++ E=board[e];
++ while (! E) {
+ e += dir;
+ E=board[e];
+- } while (! E);
++ }
+ if((E & grid_mask) == grid_slider)
+ return 0;
+ e = p;
+ var delta = dir - 1;
+- do{
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += delta;
++ E=board[e];
++ while (!E) {
+ e += delta;
+ E=board[e];
+- } while (! E);
++ }
+ if((E & diag_mask) == diag_slider)
+ return 0;
+ e = p;
+ delta += 2;
+- do{
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += delta;
++ E=board[e];
++ while(! E) {
+ e += delta;
+ E=board[e];
+- } while (! E);
++ }
+ if((E & diag_mask) == diag_slider)
+ return 0;
+ /*knights on row 7. (row 6 is handled below)*/
+@@ -566,10 +585,13 @@ function p4_check_castling(board, s, colour, dir, side){
+ * Same side check is impossible, because the castling rook is there
+ */
+ e = (side < 0) ? s + 2 : s;
+- do {
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e -= side;
++ E=board[e];
++ while (! E) {
+ e -= side;
+ E=board[e];
+- } while (! E);
++ }
+ if((E & grid_mask) == grid_slider)
+ return 0;
+
+@@ -1572,9 +1594,10 @@ function p4_random_int(state, top){
+ mask |= mask >>> 4;
+ mask |= mask >>> 8;
+ mask |= mask >>> 16;
+- var r;
+- do{
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ var r = top + 1;
++ while(r >= top)
+ r = p4_random31(state) & mask;
+- } while (r >= top);
++
+ return r;
+ }
+--
+2.12.2
+
Copied: gcompris-qt/repos/community-i686/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch (from rev 222322, gcompris-qt/trunk/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch)
===================================================================
--- community-i686/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch (rev 0)
+++ community-i686/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch 2017-04-11 17:51:35 UTC (rev 222324)
@@ -0,0 +1,36 @@
+From 1073a282e797efb28695aaec69204b2dd59288ab Mon Sep 17 00:00:00 2001
+From: Johnny Jazeix <jazeix at gmail.com>
+Date: Sat, 18 Feb 2017 22:38:08 +0100
+Subject: [PATCH 3/3] chess, allow to move again the same piece after undo
+
+---
+ src/activities/chess/chess.js | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/activities/chess/chess.js b/src/activities/chess/chess.js
+index 3b9b7b41..1fde004b 100644
+--- a/src/activities/chess/chess.js
++++ b/src/activities/chess/chess.js
+@@ -238,6 +238,8 @@ function undo() {
+ redo_stack.push(state.history[state.moveno - 1])
+ state.jump_to_moveno(state.moveno - 1)
+ }
++ // without it, you can't move again the same piece
++ Engine.p4_prepare(state)
+ items.redo_stack = redo_stack
+ refresh()
+ items.positions = [] // Force a model reload
+@@ -311,8 +313,9 @@ function clearAcceptMove() {
+ function showPossibleMoves(from) {
+ var result = Engine.p4_parse(state, state.to_play, 0, 0)
+ clearAcceptMove()
++ var fromEngine = viewPosToEngine(from)
+ for(var i=0; i < result.length; ++i) {
+- if(viewPosToEngine(from) == result[i][1]) {
++ if(fromEngine == result[i][1]) {
+ var pos = engineToViewPos(result[i][2])
+ items.squares.getSquareAt(pos)['acceptMove'] = true
+ }
+--
+2.12.2
+
Copied: gcompris-qt/repos/community-i686/PKGBUILD (from rev 222322, gcompris-qt/trunk/PKGBUILD)
===================================================================
--- community-i686/PKGBUILD (rev 0)
+++ community-i686/PKGBUILD 2017-04-11 17:51:35 UTC (rev 222324)
@@ -0,0 +1,53 @@
+# $Id$
+# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
+# Contributor: Jose Riha <jose1711 gmail com>
+
+pkgname=gcompris-qt
+pkgver=0.70
+pkgrel=1
+pkgdesc="Educational software suite comprising of numerous activities for children aged 2 to 10"
+arch=('i686' 'x86_64')
+url="http://gcompris.net/"
+license=('GPL3')
+depends=('qt5-declarative' 'qt5-multimedia' 'qt5-svg' 'qt5-tools' 'qt5-sensors'
+ 'qt5-quickcontrols' 'qt5-graphicaleffects' 'qml-box2d')
+makedepends=('cmake' 'git' 'qt5-tools')
+replaces=('gcompris' 'gcompris-data')
+source=(http://gcompris.net/download/qt/src/$pkgname-$pkgver.tar.xz
+ 0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
+ 0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
+ 0003-chess-allow-to-move-again-the-same-piece-after-undo.patch)
+sha256sums=('8a475ac354dad320dee1c1f6835fb1bb36ef91fe157870bda3562c5e1b8a2707'
+ 'd9788a7c9df61be76a1ac47186fbfe565b4c66d7cbae769e11dba3401b28a05d'
+ 'bdf09a6b11204d9e2c97e56b1bff64b0faa65f2ce46c840a35262c5e7b86acee'
+ 'b5cb2dfe1f6103488afdf1196216b27b503a9b4724212c502dad75ea2f46f8a8')
+
+prepare() {
+ cd $pkgname-$pkgver
+ mkdir build
+
+ # Fix bugs in the chess activity
+ patch -Np1 -i ../0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
+ patch -Np1 -i ../0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
+ patch -Np1 -i ../0003-chess-allow-to-move-again-the-same-piece-after-undo.patch
+}
+
+build() {
+ cd $pkgname-$pkgver/build
+
+ cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DQML_BOX2D_LIBRARY=/usr/lib/qt/qml/Box2D.2.0 \
+ ..
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make -C build DESTDIR="$pkgdir" install
+ install -Dm644 org.kde.gcompris.desktop "$pkgdir/usr/share/applications/gcompris.desktop"
+ install -Dm644 GCompris80.png "$pkgdir/usr/share/pixmaps/$pkgname.png"
+}
+
+# vim:set ts=2 sw=2 et:
Copied: gcompris-qt/repos/community-x86_64/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch (from rev 222323, gcompris-qt/trunk/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch)
===================================================================
--- community-x86_64/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch (rev 0)
+++ community-x86_64/0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch 2017-04-11 17:51:35 UTC (rev 222324)
@@ -0,0 +1,83 @@
+From 36606b617776ea0c87dac48834e440930d1d881a Mon Sep 17 00:00:00 2001
+From: Johnny Jazeix <jazeix at gmail.com>
+Date: Sat, 18 Feb 2017 19:39:02 +0100
+Subject: [PATCH 1/3] chess, Qt bug in 5.8 with do-while loop
+ (https://bugreports.qt.io/browse/QTBUG-59012)
+
+---
+ src/activities/chess/engine.js | 28 ++++++++++++++++++----------
+ 1 file changed, 18 insertions(+), 10 deletions(-)
+
+diff --git a/src/activities/chess/engine.js b/src/activities/chess/engine.js
+index 9a8a48d6..12330306 100644
+--- a/src/activities/chess/engine.js
++++ b/src/activities/chess/engine.js
+@@ -581,11 +581,14 @@ function p4_check_check(state, colour){
+ /*find the king. The pieces list updates from the end,
+ * so the last-most king is correctly placed.*/
+ var pieces = state.pieces[colour];
+- var p;
+ var i = pieces.length;
+- do {
+- p = pieces[--i];
+- } while (p[0] != (P4_KING | colour));
++ var king = P4_KING | colour
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ var val = king-1
++ while (val !== king) {
++ var p = pieces[--i];
++ val = p[0]
++ };
+ var s = p[1];
+ var other_colour = 1 - colour;
+ var dir = 10 - 20 * colour;
+@@ -614,19 +617,26 @@ function p4_check_check(state, colour){
+ var m = diagonal_moves[i];
+ var e = s;
+ var E;
+- do {
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += m;
++ E = board[e];
++ while (!E) {
+ e += m;
+ E = board[e];
+- } while (!E);
++ }
+ if((E & diag_mask) == diag_slider)
+ return true;
+
+ m = grid_moves[i];
+ e = s;
+- do {
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += m;
++ E = board[e];
++ while (!E) {
+ e += m;
+ E = board[e];
+- } while (!E);
++ }
++
+ if((E & grid_mask) == grid_slider)
+ return true;
+ }
+@@ -984,7 +994,6 @@ function p4_move(state, s, e, promotion){
+
+ /*Try the move, and see what the response is.*/
+ var changes = p4_make_move(state, s, e, promotion);
+-
+ /*is it check? */
+ if (p4_check_check(state, colour)){
+ p4_unmake_move(state, changes);
+@@ -997,7 +1006,6 @@ function p4_move(state, s, e, promotion){
+
+ state.enpassant = changes.ep;
+ state.history.push([s, e, promotion]);
+-
+ /*draw timeout: 50 moves without pawn move or capture is a draw */
+ if (changes.E || changes.ep_position){
+ state.draw_timeout = 0;
+--
+2.12.2
+
Copied: gcompris-qt/repos/community-x86_64/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch (from rev 222323, gcompris-qt/trunk/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch)
===================================================================
--- community-x86_64/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch (rev 0)
+++ community-x86_64/0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch 2017-04-11 17:51:35 UTC (rev 222324)
@@ -0,0 +1,117 @@
+From 1e5cfe5a94c94c7a9c207971d9ebbae401ab796b Mon Sep 17 00:00:00 2001
+From: Johnny Jazeix <jazeix at gmail.com>
+Date: Sat, 18 Feb 2017 20:58:10 +0100
+Subject: [PATCH 2/3] chess, Qt bug in 5.8 with do-while loop
+ (https://bugreports.qt.io/browse/QTBUG-59012)
+
+---
+ src/activities/chess/engine.js | 49 +++++++++++++++++++++++++++++++-----------
+ 1 file changed, 36 insertions(+), 13 deletions(-)
+
+diff --git a/src/activities/chess/engine.js b/src/activities/chess/engine.js
+index 12330306..adcc0663 100644
+--- a/src/activities/chess/engine.js
++++ b/src/activities/chess/engine.js
+@@ -420,7 +420,17 @@ function p4_parse(state, colour, ep, score) {
+ for(i=0;i<mlen;){ //goeth thru list of moves
+ var m = moves[i++];
+ e=s;
+- do {
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e+=m;
++ E=board[e];
++ if(!E){
++ movelist.push([weight + values[E] + weight_lut[e], s, e]);
++ }
++ else if((E&17)==other_colour){
++ captures.push([weight + values[E] + weight_lut[e] + all_weights[E][e], s, e]);
++ }
++
++ while(!E) {
+ e+=m;
+ E=board[e];
+ if(!E){
+@@ -429,7 +439,7 @@ function p4_parse(state, colour, ep, score) {
+ else if((E&17)==other_colour){
+ captures.push([weight + values[E] + weight_lut[e] + all_weights[E][e], s, e]);
+ }
+- }while(!E);
++ }
+ }
+ }
+ }
+@@ -527,26 +537,35 @@ function p4_check_castling(board, s, colour, dir, side){
+ for(p = s; p < s + 3; p++){
+ //bishops, rooks, queens
+ e = p;
+- do{
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += dir;
++ E=board[e];
++ while (! E) {
+ e += dir;
+ E=board[e];
+- } while (! E);
++ }
+ if((E & grid_mask) == grid_slider)
+ return 0;
+ e = p;
+ var delta = dir - 1;
+- do{
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += delta;
++ E=board[e];
++ while (!E) {
+ e += delta;
+ E=board[e];
+- } while (! E);
++ }
+ if((E & diag_mask) == diag_slider)
+ return 0;
+ e = p;
+ delta += 2;
+- do{
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e += delta;
++ E=board[e];
++ while(! E) {
+ e += delta;
+ E=board[e];
+- } while (! E);
++ }
+ if((E & diag_mask) == diag_slider)
+ return 0;
+ /*knights on row 7. (row 6 is handled below)*/
+@@ -566,10 +585,13 @@ function p4_check_castling(board, s, colour, dir, side){
+ * Same side check is impossible, because the castling rook is there
+ */
+ e = (side < 0) ? s + 2 : s;
+- do {
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ e -= side;
++ E=board[e];
++ while (! E) {
+ e -= side;
+ E=board[e];
+- } while (! E);
++ }
+ if((E & grid_mask) == grid_slider)
+ return 0;
+
+@@ -1572,9 +1594,10 @@ function p4_random_int(state, top){
+ mask |= mask >>> 4;
+ mask |= mask >>> 8;
+ mask |= mask >>> 16;
+- var r;
+- do{
++ // can't do-while loop: https://bugreports.qt.io/browse/QTBUG-59012
++ var r = top + 1;
++ while(r >= top)
+ r = p4_random31(state) & mask;
+- } while (r >= top);
++
+ return r;
+ }
+--
+2.12.2
+
Copied: gcompris-qt/repos/community-x86_64/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch (from rev 222323, gcompris-qt/trunk/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch)
===================================================================
--- community-x86_64/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch (rev 0)
+++ community-x86_64/0003-chess-allow-to-move-again-the-same-piece-after-undo.patch 2017-04-11 17:51:35 UTC (rev 222324)
@@ -0,0 +1,36 @@
+From 1073a282e797efb28695aaec69204b2dd59288ab Mon Sep 17 00:00:00 2001
+From: Johnny Jazeix <jazeix at gmail.com>
+Date: Sat, 18 Feb 2017 22:38:08 +0100
+Subject: [PATCH 3/3] chess, allow to move again the same piece after undo
+
+---
+ src/activities/chess/chess.js | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/activities/chess/chess.js b/src/activities/chess/chess.js
+index 3b9b7b41..1fde004b 100644
+--- a/src/activities/chess/chess.js
++++ b/src/activities/chess/chess.js
+@@ -238,6 +238,8 @@ function undo() {
+ redo_stack.push(state.history[state.moveno - 1])
+ state.jump_to_moveno(state.moveno - 1)
+ }
++ // without it, you can't move again the same piece
++ Engine.p4_prepare(state)
+ items.redo_stack = redo_stack
+ refresh()
+ items.positions = [] // Force a model reload
+@@ -311,8 +313,9 @@ function clearAcceptMove() {
+ function showPossibleMoves(from) {
+ var result = Engine.p4_parse(state, state.to_play, 0, 0)
+ clearAcceptMove()
++ var fromEngine = viewPosToEngine(from)
+ for(var i=0; i < result.length; ++i) {
+- if(viewPosToEngine(from) == result[i][1]) {
++ if(fromEngine == result[i][1]) {
+ var pos = engineToViewPos(result[i][2])
+ items.squares.getSquareAt(pos)['acceptMove'] = true
+ }
+--
+2.12.2
+
Copied: gcompris-qt/repos/community-x86_64/PKGBUILD (from rev 222323, gcompris-qt/trunk/PKGBUILD)
===================================================================
--- community-x86_64/PKGBUILD (rev 0)
+++ community-x86_64/PKGBUILD 2017-04-11 17:51:35 UTC (rev 222324)
@@ -0,0 +1,53 @@
+# $Id$
+# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
+# Contributor: Jose Riha <jose1711 gmail com>
+
+pkgname=gcompris-qt
+pkgver=0.70
+pkgrel=1
+pkgdesc="Educational software suite comprising of numerous activities for children aged 2 to 10"
+arch=('i686' 'x86_64')
+url="http://gcompris.net/"
+license=('GPL3')
+depends=('qt5-declarative' 'qt5-multimedia' 'qt5-svg' 'qt5-tools' 'qt5-sensors'
+ 'qt5-quickcontrols' 'qt5-graphicaleffects' 'qml-box2d')
+makedepends=('cmake' 'git' 'qt5-tools')
+replaces=('gcompris' 'gcompris-data')
+source=(http://gcompris.net/download/qt/src/$pkgname-$pkgver.tar.xz
+ 0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
+ 0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
+ 0003-chess-allow-to-move-again-the-same-piece-after-undo.patch)
+sha256sums=('8a475ac354dad320dee1c1f6835fb1bb36ef91fe157870bda3562c5e1b8a2707'
+ 'd9788a7c9df61be76a1ac47186fbfe565b4c66d7cbae769e11dba3401b28a05d'
+ 'bdf09a6b11204d9e2c97e56b1bff64b0faa65f2ce46c840a35262c5e7b86acee'
+ 'b5cb2dfe1f6103488afdf1196216b27b503a9b4724212c502dad75ea2f46f8a8')
+
+prepare() {
+ cd $pkgname-$pkgver
+ mkdir build
+
+ # Fix bugs in the chess activity
+ patch -Np1 -i ../0001-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
+ patch -Np1 -i ../0002-chess-Qt-bug-in-5.8-with-do-while-loop-https-bugrepo.patch
+ patch -Np1 -i ../0003-chess-allow-to-move-again-the-same-piece-after-undo.patch
+}
+
+build() {
+ cd $pkgname-$pkgver/build
+
+ cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DQML_BOX2D_LIBRARY=/usr/lib/qt/qml/Box2D.2.0 \
+ ..
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make -C build DESTDIR="$pkgdir" install
+ install -Dm644 org.kde.gcompris.desktop "$pkgdir/usr/share/applications/gcompris.desktop"
+ install -Dm644 GCompris80.png "$pkgdir/usr/share/pixmaps/$pkgname.png"
+}
+
+# vim:set ts=2 sw=2 et:
More information about the arch-commits
mailing list