commit: 6b353e90e47cec0a9e5ea5e8a3e1892b0df5bac6 Author: Sebastian Pipping <sebastian <AT> pipping <DOT> org> AuthorDate: Thu Sep 11 00:32:26 2014 +0000 Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org> CommitDate: Thu Sep 11 00:32:26 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/betagarden.git;a=commit;h=6b353e90
games-board/gambit: 0_p22 --- .../gambit/files/gambit-0_p22-engine-makefile | 27 ++++++++++ games-board/gambit/files/gambit-0_p22-path.patch | 45 ++++++++++++++++ .../gambit/files/gambit-0_p22-undefined.patch | 23 ++++++++ games-board/gambit/gambit-0_p22.ebuild | 61 ++++++++++++++++++++++ licenses/fair | 3 ++ 5 files changed, 159 insertions(+) diff --git a/games-board/gambit/files/gambit-0_p22-engine-makefile b/games-board/gambit/files/gambit-0_p22-engine-makefile new file mode 100644 index 0000000..284f29b --- /dev/null +++ b/games-board/gambit/files/gambit-0_p22-engine-makefile @@ -0,0 +1,27 @@ +CPPFLAGS += -Isrc + +C_FILES = \ + src/enforce.c \ + src/log.c \ + src/uassert.c \ + src/cecp/cecp.c \ + src/cecp/signal.c \ + src/cecp/stdin_io.c \ + src/engine/board.c \ + src/engine/delta_movement_info.c \ + src/engine/eval.c \ + src/engine/fen.c \ + src/engine/gupta.c \ + src/engine/move.c \ + src/engine/move_deltas.c \ + src/engine/piece.c \ + src/engine/rules.c \ + src/engine/search.c + +O_FILES = $(patsubst %.c,%.o,$(C_FILES)) + +gupta: $(O_FILES) + $(CC) $(LDFLAGS) -o $@ $(O_FILES) + +%.o: %.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $< -o $@ diff --git a/games-board/gambit/files/gambit-0_p22-path.patch b/games-board/gambit/files/gambit-0_p22-path.patch new file mode 100644 index 0000000..d3e65f8 --- /dev/null +++ b/games-board/gambit/files/gambit-0_p22-path.patch @@ -0,0 +1,45 @@ +From e55e49647bed60cd227af82691720402d85df7b3 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping <sebast...@pipping.org> +Date: Thu, 11 Sep 2014 01:25:24 +0200 +Subject: [PATCH] Adjust resource and engige path + +--- + src/Core/GuptaEngine.cc | 4 +--- + src/Core/ResourcePath.cc | 4 ++-- + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/src/Core/GuptaEngine.cc b/src/Core/GuptaEngine.cc +index 68c32e4..fa576d2 100644 +--- a/src/Core/GuptaEngine.cc ++++ b/src/Core/GuptaEngine.cc +@@ -19,9 +19,7 @@ GuptaEngine::GuptaEngine( + bool _ponderingEnabled) + : Engine(_engineManager, _app, _callback, _searchDepth, _ponderingEnabled) + { +- setWorkingDirectory( +- app.applicationDirPath() + +- QString::fromUtf8("/engine/gupta")); ++ setWorkingDirectory(QString("/usr/bin")); + + setFileName( + workingDirectory_ + +diff --git a/src/Core/ResourcePath.cc b/src/Core/ResourcePath.cc +index 1d11f1a..8ea545f 100644 +--- a/src/Core/ResourcePath.cc ++++ b/src/Core/ResourcePath.cc +@@ -14,10 +14,10 @@ DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. + + QString ResourcePath::mkQString(const char *fileName) + { +- return QDir::toNativeSeparators(QApplication::applicationDirPath() + "/data/" + fileName); ++ return QDir::toNativeSeparators(QString("/usr/share/games/gambit/") + fileName); + } + + QString ResourcePath::mkQString(const QString &fileName) + { +- return QDir::toNativeSeparators(QApplication::applicationDirPath() + "/data/" + fileName); ++ return QDir::toNativeSeparators(QString("/usr/share/games/gambit/") + fileName); + } +-- +2.1.0 + diff --git a/games-board/gambit/files/gambit-0_p22-undefined.patch b/games-board/gambit/files/gambit-0_p22-undefined.patch new file mode 100644 index 0000000..8345f47 --- /dev/null +++ b/games-board/gambit/files/gambit-0_p22-undefined.patch @@ -0,0 +1,23 @@ +From c040e13af7c2a6e86630c3556696a5cfa618061c Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping <sebast...@pipping.org> +Date: Thu, 11 Sep 2014 01:29:16 +0200 +Subject: [PATCH 2/2] Fix link error + +--- + src/View/BoardView.cc | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/View/BoardView.cc b/src/View/BoardView.cc +index f5050df..0a99473 100644 +--- a/src/View/BoardView.cc ++++ b/src/View/BoardView.cc +@@ -976,3 +976,6 @@ void BoardView::updateTargetSquareHighlight() + update(); + } + } ++ ++const int Board::DefaultWidth; ++const int Board::DefaultHeight; +-- +2.1.0 + diff --git a/games-board/gambit/gambit-0_p22.ebuild b/games-board/gambit/gambit-0_p22.ebuild new file mode 100644 index 0000000..1f4953e --- /dev/null +++ b/games-board/gambit/gambit-0_p22.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="5" + +CMAKE_IN_SOURCE_BUILD=true +inherit cmake-utils subversion + +DESCRIPTION="Qt-based chess application + engine \"gupta\"" +HOMEPAGE="http://sourceforge.net/projects/gambitchess/" +ESVN_REPO_URI="svn://svn.code.sf.net/p/gambitchess/code/" +ESVN_REVISION=${PV/*_p/} + +LICENSE="fair" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="dev-qt/qtgui + x11-libs/libX11 + x11-libs/libICE" +RDEPEND="${DEPEND}" + +S="${WORKDIR}"/${PN^}-${PV} + +src_prepare() { + epatch "${FILESDIR}"/${P}-path.patch + epatch "${FILESDIR}"/${P}-undefined.patch + cp "${FILESDIR}"/${P}-engine-makefile engine/gupta/Makefile || die + + rm svn_update_revision_number_header.sh || die + sed 's|svn_update_revision_number_header\.sh|/dev/null|' -i CMakeLists.txt || die + + subversion_wc_info # to fill ESVN_WC_REVISION + cat <<-HEADER_H > src/svn_revision_number.h + #ifndef SVN_REVISION_NUMBER_H + #define SVN_REVISION_NUMBER_H + + #define SVN_REVISION_NUMBER ${ESVN_WC_REVISION} + #define SVN_REVISION_NUMBER_STRING "${ESVN_WC_REVISION}" + + #endif + HEADER_H +} + +src_compile() { + cmake-utils_src_compile + emake -C engine/gupta || die +} + +src_install() { + insinto /usr/share/games/${PN} + doins -r data/* || die + + make_desktop_entry ${PN^} ${PN^} /usr/share/games/${PN}/icons/${PN}/gambit-256.png Game || die + dodoc doc/contributors.txt || die + + dobin engine/gupta/gupta || die + dobin ${PN^} || die +} diff --git a/licenses/fair b/licenses/fair new file mode 100644 index 0000000..4a8c5cb --- /dev/null +++ b/licenses/fair @@ -0,0 +1,3 @@ +Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument. + +DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.