diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-05-02 23:22:26 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-05-02 23:22:26 +0000 |
commit | 59e5bf7f0580a2a685b3c36255a6d8abfd86a587 (patch) | |
tree | 85e601a559304fff0a8ce850e9b4ed6404c0cb5d /games-strategy/freecnc | |
parent | version bump (bug #91090) (diff) | |
download | historical-59e5bf7f0580a2a685b3c36255a6d8abfd86a587.tar.gz historical-59e5bf7f0580a2a685b3c36255a6d8abfd86a587.tar.bz2 historical-59e5bf7f0580a2a685b3c36255a6d8abfd86a587.zip |
fix endian building issues #90949
Package-Manager: portage-2.0.51.21
Diffstat (limited to 'games-strategy/freecnc')
-rw-r--r-- | games-strategy/freecnc/Manifest | 3 | ||||
-rw-r--r-- | games-strategy/freecnc/files/freecnc-0.2.0-endian.patch | 124 | ||||
-rw-r--r-- | games-strategy/freecnc/freecnc-0.2.0.ebuild | 8 |
3 files changed, 131 insertions, 4 deletions
diff --git a/games-strategy/freecnc/Manifest b/games-strategy/freecnc/Manifest index 03f74bfe13a0..5873ad021bc1 100644 --- a/games-strategy/freecnc/Manifest +++ b/games-strategy/freecnc/Manifest @@ -1,5 +1,5 @@ MD5 01ff747ab6646bcc738efec1a8985935 ChangeLog 715 -MD5 950cea66e2df92c4c3eedb3ba2af589d freecnc-0.2.0.ebuild 2013 +MD5 4f1c51ccd97a27e8fff5d00b2a6e42e5 freecnc-0.2.0.ebuild 2085 MD5 b11af61552f7f0ec72907360cc1b86d5 freecnc-0.2.1.31072003.ebuild 2128 MD5 f17b9b8fa07a38914fe1c03268f51678 metadata.xml 158 MD5 deb5d60f8269a27307f92372b65f2600 files/0.2.0-gentoo-paths.patch 980 @@ -11,3 +11,4 @@ MD5 a95fe9ff48a57f7d2afaf10e0932faab files/0.2.1.31072003-remove-root.patch 555 MD5 7705eafc118ebb753d4b8a80fe7e333c files/digest-freecnc-0.2.0 189 MD5 caea2862781d0a98c4c8eb0b932aa47d files/digest-freecnc-0.2.1.31072003 198 MD5 190952f0b1cd7f8ebd7385c01e0b70db files/freecnc 44 +MD5 da57fef460c5cba4a6aaf3490242a0e4 files/freecnc-0.2.0-endian.patch 3042 diff --git a/games-strategy/freecnc/files/freecnc-0.2.0-endian.patch b/games-strategy/freecnc/files/freecnc-0.2.0-endian.patch new file mode 100644 index 000000000000..ad8779ace61a --- /dev/null +++ b/games-strategy/freecnc/files/freecnc-0.2.0-endian.patch @@ -0,0 +1,124 @@ +freecnc normally bundles a file called 'endian.h' ... this causes problems +with the real system endian.h. grab upstream cvs fix for this (rename +endian.h to fcnc_endian.h). + +--- src/game/loadmap.cpp ++++ src/game/loadmap.cpp +@@ -8,3 +8,3 @@ + #include "shpimage.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "config.h" +--- src/include/fcnc_endian.h ++++ src/include/fcnc_endian.h +@@ -0,0 +1,68 @@ ++// mode: -*- C++ -*- ++/***************************************************************************** ++ * endian.h - Includes macro definitions to convert bytes to correct endianess ++ * This code has yet to be tested on Big Endian Machines. ++ * ++ * Author: Kareem Dana ++ ****************************************************************************/ ++ ++#ifndef __FCNC_ENDIAN_H ++#define __FCNC_ENDIAN_H ++ ++#include <stdio.h> ++#include "SDL_endian.h" ++ ++#if SDL_BYTEORDER == SDL_LIL_ENDIAN ++ #define readbyte(x,y) x[y] ++ #define readword(x,y) x[y] + (x[y+1] << 8) ++ #define readthree(x,y) x[y] + (x[y+1] << 8) + (x[y+2] << 16) + (0 << 24) ++ #define readlong(x,y) x[y] + (x[y+1] << 8) + (x[y+2] << 16) + (x[y+3] << 24) ++#else ++ #define readbyte(x,y) x[y] ++ #define readword(x,y) SDL_Swap16((x[y] << 8) ^ x[y+1]) ++ #define readthree(x,y) SDL_Swap32((x[y] << 24) ^ (x[y+1] << 16) ^ (x[y+2] << 8)) ++ #define readlong(x,y) SDL_Swap32((x[y] << 24) ^ (x[y+1] << 16) ^ (x[y+2] << 8) ^ (x[y+3])) ++#endif ++ ++static __inline__ Uint8 freadbyte(FILE *fptr) ++{ ++ Uint8 x; ++ fread(&x,1,1,fptr); ++ return x; ++} ++ ++static __inline__ Uint16 freadword(FILE *fptr) ++{ ++ Uint16 x; ++ fread(&x,2,1,fptr); ++#if SDL_BYTEORDER == SDL_BIG_ENDIAN ++ ++ return SDL_Swap16(x); ++#else ++ ++ return x; ++#endif ++} ++ ++static __inline__ Uint32 freadthree(FILE *fptr) ++{ ++ /* Can this be made betteR?? */ ++ Uint8 x[3]; ++ fread(x,3,1,fptr); ++ return readthree(x,0); ++} ++ ++static __inline__ Uint32 freadlong(FILE *fptr) ++{ ++ Uint32 x; ++ fread(&x, 4, 1, fptr); ++#if SDL_BYTEORDER == SDL_BIG_ENDIAN ++ ++ return SDL_Swap32(x); ++#else ++ ++ return x; ++#endif ++} ++ ++#endif +--- src/ui/font.cpp ++++ src/ui/font.cpp +@@ -1,3 +1,3 @@ + #include "font.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "vfs.h" +--- src/vfs/vfs_mix/mixvfs.cpp ++++ src/vfs/vfs_mix/mixvfs.cpp +@@ -2,3 +2,3 @@ + #include "ws-key.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "SDL_endian.h" +--- src/video/cpsimage.cpp ++++ src/video/cpsimage.cpp +@@ -4,3 +4,3 @@ + #include "inifile.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "compression.h" +--- src/video/shpimage.cpp ++++ src/video/shpimage.cpp +@@ -7,3 +7,3 @@ + #include "inifile.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "compression.h" +--- src/video/vqa.cpp ++++ src/video/vqa.cpp +@@ -1,3 +1,3 @@ + #include "compression.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "vfs.h" +--- src/video/wsaimage.cpp ++++ src/video/wsaimage.cpp +@@ -1,3 +1,3 @@ + #include "wsa.h" +-#include "endian.h" ++#include "fcnc_endian.h" + #include "compression.h" diff --git a/games-strategy/freecnc/freecnc-0.2.0.ebuild b/games-strategy/freecnc/freecnc-0.2.0.ebuild index 3f7b35e48f2c..3d074aa20133 100644 --- a/games-strategy/freecnc/freecnc-0.2.0.ebuild +++ b/games-strategy/freecnc/freecnc-0.2.0.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-strategy/freecnc/freecnc-0.2.0.ebuild,v 1.4 2004/06/24 23:27:21 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-strategy/freecnc/freecnc-0.2.0.ebuild,v 1.5 2005/05/02 23:22:26 vapier Exp $ inherit games flag-o-matic eutils @@ -34,11 +34,13 @@ src_unpack() { epatch ${FILESDIR}/${PV}-makefile-cflags.patch epatch ${FILESDIR}/${PV}-remove-root.patch epatch ${FILESDIR}/${PV}-gentoo-paths.patch + epatch "${FILESDIR}"/${P}-endian.patch + rm -f src/include/endian.h sed -i \ -e "s:GENTOO_LOGDIR:${GAMES_LOGDIR}:" \ -e "s:GENTOO_CONFDIR:${GAMES_SYSCONFDIR}/${PN}/:" \ -e "s:GENTOO_DATADIR:${GAMES_DATADIR}/${PN}/:" \ - src/{freecnc,vfs/vfs}.cpp + src/freecnc.cpp src/vfs/vfs.cpp } src_compile() { |