commit:     0fe5dbcb6480392e8c7b84cbdeecc32a5c29d571
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 21 19:59:07 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jun 21 19:59:07 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fe5dbcb

games-roguelike/wrogue: [QA] Pass CC to build system

Closes: https://bugs.gentoo.org/724728
Package-Manager: Portage-2.3.101, Repoman-2.3.22
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../files/wrogue-0.8.0b-fix-build-system.patch     | 47 ++++++++++++++++++++++
 .../wrogue/files/wrogue-0.8.0b-ldflags.patch       | 29 -------------
 .../files/wrogue-0.8.0b-string-allocation.patch    | 20 +++++++++
 games-roguelike/wrogue/wrogue-0.8.0b-r1.ebuild     | 30 ++++++--------
 4 files changed, 79 insertions(+), 47 deletions(-)

diff --git a/games-roguelike/wrogue/files/wrogue-0.8.0b-fix-build-system.patch 
b/games-roguelike/wrogue/files/wrogue-0.8.0b-fix-build-system.patch
new file mode 100644
index 00000000000..b17ea5c196b
--- /dev/null
+++ b/games-roguelike/wrogue/files/wrogue-0.8.0b-fix-build-system.patch
@@ -0,0 +1,47 @@
+--- a/src/linux.mak
++++ b/src/linux.mak
+@@ -18,8 +18,9 @@
+ #
+ # common compiler/linker flags
+ #
+-CFLAGS=-I./include -I./lib -std=c89 `sdl-config --cflags`
+-LDFLAGS=-lm `sdl-config --libs`
++CFLAGS+=-std=gnu99
++CPPFLAGS+=-Iinclude -Ilib -Iui -Igenerate `sdl-config --cflags`
++LDLIBS+=-lm `sdl-config --libs`
+ 
+ 
+ SRC=\
+@@ -30,7 +31,6 @@
+ OBJ=$(SRC:.c=.o)
+ EXE=./wrogue
+ 
+-CC=gcc
+ RM=rm -f
+ 
+ 
+@@ -39,9 +39,7 @@
+ # target: release 
+ #
+ .PHONY: release
+-release: CFLAGS += -pipe -O2 -fomit-frame-pointer -march=i686
+-release: LDFLAGS += -Wl,-O1
+-release: STRIP_BINARY = yes
++release: STRIP_BINARY = no
+ release: build
+ 
+ 
+@@ -89,12 +87,8 @@
+ 
+ 
+ 
+-%.o: %.c
+-      @echo Building $<
+-      @$(CC) $(CFLAGS) -o $@ -c $<
+-
+ $(EXE): $(OBJ)
+-      @$(CC) $(OBJ) $(LDFLAGS) -o $@
++      $(CC) $(LDFLAGS) $(OBJ) -o $@ $(LDLIBS)
+ 
+ 
+ 

diff --git a/games-roguelike/wrogue/files/wrogue-0.8.0b-ldflags.patch 
b/games-roguelike/wrogue/files/wrogue-0.8.0b-ldflags.patch
deleted file mode 100644
index d3ec216b4c1..00000000000
--- a/games-roguelike/wrogue/files/wrogue-0.8.0b-ldflags.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/src/linux.mak    2010-10-14 11:07:22.000000000 +0200
-+++ b/src/linux.mak    2010-10-14 11:08:00.000000000 +0200
-@@ -19,7 +19,7 @@
- # common compiler/linker flags
- #
- CFLAGS=-I./include -I./lib -std=c89 `sdl-config --cflags`
--LDFLAGS=-lm `sdl-config --libs`
-+LDLIBS=-lm `sdl-config --libs`
- 
- 
- SRC=\
-@@ -40,7 +40,7 @@
- #
- .PHONY: release
- release: CFLAGS += -pipe -O2 -fomit-frame-pointer -march=i686
--release: LDFLAGS += -Wl,-O1
-+release: LDLIBS += -Wl,-O1
- release: STRIP_BINARY = yes
- release: build
- 
-@@ -94,7 +94,7 @@
-       @$(CC) $(CFLAGS) -o $@ -c $<
- 
- $(EXE): $(OBJ)
--      @$(CC) $(OBJ) $(LDFLAGS) -o $@
-+      $(CC) $(LDFLAGS) $(OBJ) $(LDLIBS) -o $@
- 
- 
- 

diff --git a/games-roguelike/wrogue/files/wrogue-0.8.0b-string-allocation.patch 
b/games-roguelike/wrogue/files/wrogue-0.8.0b-string-allocation.patch
new file mode 100644
index 00000000000..66afe8ea1d7
--- /dev/null
+++ b/games-roguelike/wrogue/files/wrogue-0.8.0b-string-allocation.patch
@@ -0,0 +1,20 @@
+--- a/src/lib/appdir.c
++++ b/src/lib/appdir.c
+@@ -149,7 +149,7 @@
+         CreateDirectory(UserData, NULL);
+ 
+         /* Determine app data directory */
+-        AppData[0] = '.'; AppData[1] = ADIR_DELIMITER; AppData[2] = '\0';
++        strcpy(AppData, "/usr/share/wrogue/");
+ 
+         /* Initialize internal data */
+         Handle = INVALID_HANDLE_VALUE;
+@@ -558,7 +558,7 @@
+         }
+ 
+         /* Determine app data directory */
+-        AppData[0] = '.'; AppData[1] = ADIR_DELIMITER; AppData[2] = '\0';
++        strcpy(AppData, "/usr/share/wrogue/");
+ 
+         /* Initialize internal data */
+         DirectoryStreamValid = ADIR_FALSE;

diff --git a/games-roguelike/wrogue/wrogue-0.8.0b-r1.ebuild 
b/games-roguelike/wrogue/wrogue-0.8.0b-r1.ebuild
index 074880df4a8..db050bca72d 100644
--- a/games-roguelike/wrogue/wrogue-0.8.0b-r1.ebuild
+++ b/games-roguelike/wrogue/wrogue-0.8.0b-r1.ebuild
@@ -1,8 +1,9 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
-inherit eutils
+EAPI=7
+
+inherit desktop toolchain-funcs
 
 DESCRIPTION="Gothic science fantasy roguelike game"
 HOMEPAGE="https://freecode.com/projects/wrogue";
@@ -11,34 +12,27 @@ SRC_URI="mirror://gentoo/${P}.zip"
 LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE=""
 
 RDEPEND="media-libs/libsdl[video]"
-DEPEND="${RDEPEND}
-       app-arch/unzip"
+DEPEND="${RDEPEND}"
+BDEPEND="app-arch/unzip"
 
 PATCHES=(
-       "${FILESDIR}"/${P}-ldflags.patch
+       "${FILESDIR}"/${P}-fix-build-system.patch
+       "${FILESDIR}"/${P}-string-allocation.patch
 )
 
-src_prepare() {
-       default
-
-       sed -i \
-               -e "/AppData\[0\]/ s:AppData.*:strcpy(AppData, 
\"/usr/share/${PN}/\");:" \
-               src/lib/appdir.c \
-               || die "sed failed"
+src_configure() {
+       tc-export CC
 }
 
 src_compile() {
-       local myCPPFLAGS="-std=c99 -Iinclude -Ilib -Iui -Igenerate"
-       local myCFLAGS="$(sdl-config --cflags) ${CFLAGS}"
-       emake -C src -f linux.mak STRIP_BINARY=NO \
-               CFLAGS="${myCPPFLAGS} ${myCFLAGS}" release
+       emake -C src -f linux.mak release
 }
 
 src_install() {
        dobin ${PN}
+
        insinto /usr/share/${PN}
        doins -r data
        dodoc changes.txt

Reply via email to