public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gamerlay:master commit in: games-puzzle/caph/, games-puzzle/caph/files/
@ 2011-03-22 13:39 Steffen Stramm
  0 siblings, 0 replies; only message in thread
From: Steffen Stramm @ 2011-03-22 13:39 UTC (permalink / raw
  To: gentoo-commits

commit:     e126736727cf2e8ff211061346a6a1c4fb6f9413
Author:     krytzz <krytzz <AT> soylent <DOT> eu>
AuthorDate: Tue Mar 22 13:38:56 2011 +0000
Commit:     Steffen Stramm <krytzz <AT> soylent <DOT> eu>
CommitDate: Tue Mar 22 13:38:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gamerlay.git;a=commit;h=e1267367

[games-puzzle/caph] bump, thanks jasiu

---
 games-puzzle/caph/caph-1.1.ebuild        |   38 +++++++++++++
 games-puzzle/caph/caph-20091231.ebuild   |   39 -------------
 games-puzzle/caph/files/caph-linux.patch |   87 ++++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+), 39 deletions(-)

diff --git a/games-puzzle/caph/caph-1.1.ebuild b/games-puzzle/caph/caph-1.1.ebuild
new file mode 100644
index 0000000..f2278fa
--- /dev/null
+++ b/games-puzzle/caph/caph-1.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit games
+
+DESCRIPTION="sandbox physics game"
+HOMEPAGE="http://sourceforge.net/projects/caphgame"
+SRC_URI="mirror://sourceforge/caphgame/caph/${PN}game-${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="media-libs/libpng
+	media-libs/libsdl"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+	epatch "${FILESDIR}/${PN}-linux.patch"
+}
+
+src_compile() {
+	cd src \
+	&& CFLAGS="$CFLAGS -I../include" LFLAGS="-lpng -lSDL" ./mkgen > caph.mk \
+	&& ./build \
+	|| die "build failed"
+}
+
+src_install() {
+	dogamesbin "bin/caph" || die "dogamesbin failed"
+	insinto "${GAMES_DATADIR}"
+	doins -r "share/${PN}" || die "doins failed"
+	dodoc "doc/${PN}/README" || die "dodoc failed"
+	prepgamesdirs
+}

diff --git a/games-puzzle/caph/caph-20091231.ebuild b/games-puzzle/caph/caph-20091231.ebuild
deleted file mode 100644
index df4ba92..0000000
--- a/games-puzzle/caph/caph-20091231.ebuild
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-EAPI="2"
-
-inherit games
-
-DESCRIPTION="sandbox physics game"
-HOMEPAGE="http://sourceforge.net/projects/caphgame"
-SRC_URI="mirror://sourceforge/caphgame/${PN}-091231/${PN}-src-091231.tar.bz2
-	mirror://sourceforge/caphgame/${PN}-091231/${PN}-data-091231.tar.bz2"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE=""
-
-DEPEND="media-libs/libpng
-	media-libs/libsdl"
-RDEPEND="${DEPEND}"
-
-src_prepare() {
-	sed -i "s:../share/${PN}:${GAMES_DATADIR}/${PN}:" ${PN}-src/src/${PN}.c || die "sed failed"
-	sed -i "s:return dir;:return SYS_DATA_DIR;:" ${PN}-src/src/${PN}.c || die "sed failed"
-}
-
-src_compile() {
-	cd "${PN}-src/src"
-	./build || die "build failed"
-}
-
-src_install() {
-	dogamesbin "caph-src/bin/caph" || die "dogamesbin failed"
-	insinto "${GAMES_DATADIR}"
-	doins -r "${PN}-data/share/${PN}" || die "install failed"
-	dodoc "${PN}-src/doc/${PN}/README" || die "dodoc failed"
-	prepgamesdirs
-}

diff --git a/games-puzzle/caph/files/caph-linux.patch b/games-puzzle/caph/files/caph-linux.patch
new file mode 100644
index 0000000..f83ba69
--- /dev/null
+++ b/games-puzzle/caph/files/caph-linux.patch
@@ -0,0 +1,87 @@
+--- caph-1.1/src/caph.c.orig	2010-10-25 17:40:24.000000000 +0200
++++ caph-1.1/src/caph.c	2011-03-19 00:26:07.127666043 +0100
+@@ -37,7 +37,7 @@
+ #endif
+ 
+ #define SYS_PRINT	1
+-#define SYS_DATA_DIR	"../share/caph/"
++#define SYS_DATA_DIR	"/usr/share/games/caph/"
+ 
+ #define DATA_CONFIG		"caph.conf"
+ #define HOME_CONFIG		".caph.conf"
+@@ -48,29 +48,8 @@
+ static const char *
+ sys_get_data_dir()
+ {
+-	static char dir[256];
+-
+-#if defined(_WIN32)
+-	strcpy(dir, SYS_DATA_DIR);
+-	return dir;
+-#else
+-	int ret = readlink("/proc/self/exe", dir, sizeof(dir));
+-	if (ret < 0) {
+-		fprintf(stderr, "%s:%i [ERROR] readlink failed: %s \n",
+-					__FILE__, __LINE__, strerror(ret));
+-		strcpy(dir, SYS_DATA_DIR);
+-		return dir;
+-	}
+-
+-	char	*p = dir;
+-
+-	while (*p != '\0') ++p;
+-	while (*p != '/') --p;
+-	*++p = '\0';
+-
+-	strcat(dir, SYS_DATA_DIR);
+-	return dir;
+-#endif
++	static char dir[FILENAME_MAX];
++	return strcpy(dir, SYS_DATA_DIR);
+ }
+ 
+ static void
+@@ -79,38 +58,19 @@
+ #if defined(_WIN32)
+ 	SetCurrentDirectory(name);
+ #else
+-	int	ret;
+-
+-	ret = chdir(name);
++	chdir(name);
+ #endif
+ }
+ 
+ static const char *
+ sys_get_config()
+ {
+-	static char dir[256];
+-	const char *home;
+-
++	static char dir[FILENAME_MAX];
+ #if defined(_WIN32)
+-	strcpy(dir, DATA_CONFIG);
+-	return dir;
++	return strcpy(dir, DATA_CONFIG);
+ #else
+-	home = getenv("HOME");
+-
+-	if (home)
+-		strcpy(dir, home);
+-	else
+-		return "";
+-
+-	char	*p = dir;
+-
+-	while (*p != '\0') ++p;
+-
+-	if (*(p - 1) != '/') {
+-		*p++ = '/';
+-		*p++ = '\0';
+-	}
+-
++	strcpy(dir, getenv("HOME"));
++	strcat(dir, "/");
+ 	strcat(dir, HOME_CONFIG);
+ 	return dir;
+ #endif



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-22 13:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-22 13:39 [gentoo-commits] proj/gamerlay:master commit in: games-puzzle/caph/, games-puzzle/caph/files/ Steffen Stramm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox