diff options
Diffstat (limited to 'games-arcade/sdb')
-rw-r--r-- | games-arcade/sdb/Manifest | 5 | ||||
-rw-r--r-- | games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch | 45 | ||||
-rw-r--r-- | games-arcade/sdb/files/sdb-1.0.2-return-type.patch | 56 | ||||
-rw-r--r-- | games-arcade/sdb/sdb-1.0.2-r1.ebuild | 21 | ||||
-rw-r--r-- | games-arcade/sdb/sdb-1.0.2-r2.ebuild | 55 |
5 files changed, 173 insertions, 9 deletions
diff --git a/games-arcade/sdb/Manifest b/games-arcade/sdb/Manifest index 6e545909480f..26fda55522af 100644 --- a/games-arcade/sdb/Manifest +++ b/games-arcade/sdb/Manifest @@ -1,6 +1,9 @@ AUX sdb-1.0.2-endian.patch 9118 BLAKE2B de2bbe81f5d1fcf571a5b8eedf97892ff6eaccaa7a0acb74427740f27fdfb8f517cc38c1ccdaee59480fb1e224f8c7a768355af50bfd1cb66fea338eea2133a0 SHA512 65b623d93e2369353cc2c900e38b8dfb56e6896cf34447305870c3c01a97770371ecff6c9586f7b758c64b1de4f85da3e0c79264587be325e226488545ea0754 +AUX sdb-1.0.2-gcc-11.patch 1117 BLAKE2B bd63596fa7b332f8de3d2c4d873cce779170abc05e7363f6f5239d4a98c05da48215cc94a4a92f31c28237639df2ae9035937cc213356e43dfddcc2d8d94fd7b SHA512 ffb5dc5995a1e7ba73666fae9325d59f0f289361883cb76be41c9d69c47e4215d0cd48dfe2d92a18b35832891f9cf2e6dae1c522e1a4189756b2212b6ef982b4 AUX sdb-1.0.2-gcc43.patch 173 BLAKE2B a00d2ea25dc4f90ddf02bac62c099c9b47089f16c123384e00495050a26bb30f06131892f496f93349a55574810e8c0e4406ea6ca6eda703d890e3c141115392 SHA512 663b0edd244f6fd50166f053f1631f9a2fe239f97ee16bf77a7b79d5afcf3503c5f2a55370b79b5413e91be6dca23d580cc1afc9875385a8ed04981e7dfc2552 AUX sdb-1.0.2-ldflags.patch 322 BLAKE2B edfffa4f3821726f15729d93e6e52eec5c70ef87e716fa61a081e156d7ef55197dd064af6ad68397a0df0d5509a9d271f10c3c125dc63282e30916860c6e8d0e SHA512 45795b614ec967237a1d5a24075f7238e041a21b18a3e7a4f5608e4d5fc33734b05f80993aa54a044783a8a8b099e065db278ca5dfbda23704d848133b14dc2a +AUX sdb-1.0.2-return-type.patch 1984 BLAKE2B ec585269c96bcf1e46870cf55bb71d7beeb7c6f1ed638fd3019b1f6c030338c4ade54ce37b41358b4ce45f116086377099f5cc5da9a250baf05df5c06efdb407 SHA512 75dc51313b6f6d092ee29173043e2e28ea25e295ed32fabc1fea383f2d488f913a4dca2a96c4c5f40b6c3696d2d4796a389f4b3e7662981590b4769204c46638 DIST sdb-1.0.2.tar.gz 10342311 BLAKE2B faedcd26a55df724514b4222f617146e4590861166c49e45768982aa4ea2bb427cca5ae1c3a622eac4ba5d2b1b65fe948792902703cdf2be9e09b8171968c5b3 SHA512 670d43717224d564bfecac44a3570167e19b7b4c50a21afab6903b0b0f2f6092a5551fd2cc63b659d2c2eadff5156c97876b96db3a10beabbbadc689b1d46efc -EBUILD sdb-1.0.2-r1.ebuild 1154 BLAKE2B 003f66329d1918d69c1726981fb22af69724066453be51dfdede9cb686d4d10b53a882accef74f8358b7ad4a8beae328fdf5ae488f46c096437a62fc6a517df4 SHA512 b1b13ddc7606536b4325d77f6960ff30d9a7dff7a788a0c1e2b11d65b0f61ea5c1362ce451ab12d351db2c254daeed1c8e77753e0ed89b83cb4077ab5510c949 +EBUILD sdb-1.0.2-r1.ebuild 1236 BLAKE2B 9cdeb3272ff1953a5eebe245d40169fec788f91dde73c2190202dd749650adaba53cd25f0ce67bb1d0f3003354916c3f0b9c886c96a7b31b3037af5bab7d4753 SHA512 5a1c50f64fc963aa688a403e5fbcd3fe33cecd5c88d86448acffc9478cc8d7673037c188714ce6da29492bc4173b9444be2665988a8642514e0022701decd6a4 +EBUILD sdb-1.0.2-r2.ebuild 1274 BLAKE2B fc72ea7266dcf84e7b3956510fc40bf48fe26c57b07edd73dab1250a72947bbd8a9ad71d16bfc0ecd50c6e009bd1335a44885c3e200f0a63b760359625e1b700 SHA512 21fcb89630e9759f65a64a4002b03c88b4397fc3897691d890c8d36cc0103927108fec5ad65b203cafc9a9cbb5e1a22c08b42b0e9d909b28c34b3a7e88c76c66 MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118 diff --git a/games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch b/games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch new file mode 100644 index 000000000000..f0a20657b900 --- /dev/null +++ b/games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch @@ -0,0 +1,45 @@ +https://bugs.gentoo.org/787710 +--- a/src/md2.h ++++ b/src/md2.h +@@ -68,7 +68,7 @@ struct tMaterialInfo + { + char strName[255]; + char strFile[255]; +- byte color[3]; ++ sdb_byte color[3]; + int textureId; + float uTile; + float vTile; +@@ -151,8 +151,8 @@ struct tMd2Header + + struct tMd2AliasTriangle + { +- byte vertex[3]; +- byte lightNormalIndex; ++ sdb_byte vertex[3]; ++ sdb_byte lightNormalIndex; + }; + + struct tMd2Triangle +--- a/src/models.h ++++ b/src/models.h +@@ -43,7 +43,7 @@ struct tMaterialInfo + { + char strName[255]; // The texture name + char strFile[255]; // The texture file name (If this is set it's a texture map) +- byte color[3]; // The color of the object (R, G, B) ++ sdb_byte color[3]; // The color of the object (R, G, B) + int texureId; // the texture ID + float uTile; // u tiling of texture + float vTile; // v tiling of texture +--- a/src/sdb.h ++++ b/src/sdb.h +@@ -175,7 +175,7 @@ using namespace std; + #define MOUSE_BUTTON_2 -2 + #define MOUSE_BUTTON_3 -3 + +-typedef unsigned char byte; ++typedef unsigned char sdb_byte; + + enum TEXTURE_NAMES { + // Fonts diff --git a/games-arcade/sdb/files/sdb-1.0.2-return-type.patch b/games-arcade/sdb/files/sdb-1.0.2-return-type.patch new file mode 100644 index 000000000000..9750eedb9919 --- /dev/null +++ b/games-arcade/sdb/files/sdb-1.0.2-return-type.patch @@ -0,0 +1,56 @@ +Fix -Werror=return-type warnings to prevent gcc-8+ from +corrupting caller's stack. + +Also detected by -fsanitize=undefined as: +runtime error: execution reached the end of a value-returning +function without returning a value +--- a/src/input.cpp ++++ b/src/input.cpp +@@ -103,5 +103,6 @@ float InputHandler::bindingState(int key) + } + else + return 0.0; ++ return 0.0; + } + +--- a/src/objects.h ++++ b/src/objects.h +@@ -545,12 +545,12 @@ class Object : public LevelObject + bool Augmented() { return augmented; } + void Augment() { model[1].set(MDL_PLAYER_TORSO2); augmented = true; } + +- virtual Weapon* Wpn() {} +- virtual int CurrWeapon() {} ++ virtual Weapon* Wpn() { return 0; } ++ virtual int CurrWeapon() { return 0; } + virtual void selectWeapon(int wp) {} +- virtual char weaponState(int wp) {} +- virtual char keyState(int wp) {} +- virtual Vector2D* WeaponPoint() {} ++ virtual char weaponState(int wp) { return 0; } ++ virtual char keyState(int wp) { return 0; } ++ virtual Vector2D* WeaponPoint() { return 0; } + + void giveKey(int key) { keys |= 1 << key-1; } + virtual void givePowerup(int idx) {} +--- a/src/sdb.h ++++ b/src/sdb.h +@@ -370,7 +370,7 @@ class Vector2D + void set(float nx, float ny) { c[X] = nx; c[Y] = ny; c[Z] = 0; } + void apply() { glVertex3fv(c); } + void print() { printf("(%f, %f)\n", c[X], c[Y]); } +- Vector2D operator = (Vector2D v) { c[X] = v.c[X]; c[Y] = v.c[Y]; } ++ Vector2D operator = (Vector2D v) { c[X] = v.c[X]; c[Y] = v.c[Y]; return *this; } + void operator += (Vector2D v) { c[X] += v.c[X]; c[Y] += v.c[Y]; } + void operator -= (Vector2D v) { c[X] -= v.c[X]; c[Y] -= v.c[Y]; } + void operator += (float s) { c[X] += s; c[Y] += s; } +--- a/src/weapons.cpp ++++ b/src/weapons.cpp +@@ -135,6 +135,7 @@ bool Weapon::fire(float x, float y, float head, float h) + } + else + return false; ++ return false; + } + + void Weapon::releaseTrigger(float x, float y, float head, float h) diff --git a/games-arcade/sdb/sdb-1.0.2-r1.ebuild b/games-arcade/sdb/sdb-1.0.2-r1.ebuild index 155c5d3a4e9c..6456cfc460cb 100644 --- a/games-arcade/sdb/sdb-1.0.2-r1.ebuild +++ b/games-arcade/sdb/sdb-1.0.2-r1.ebuild @@ -1,8 +1,8 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 -inherit desktop +EAPI=7 +inherit desktop toolchain-funcs DESCRIPTION="A 2D top-down action game; escape a facility full of walking death machines" HOMEPAGE="http://sdb.gamecreation.org/" @@ -19,6 +19,13 @@ DEPEND="virtual/opengl media-libs/sdl-mixer" RDEPEND="${DEPEND}" +PATCHES=( + "${FILESDIR}"/${P}-endian.patch + "${FILESDIR}"/${P}-gcc43.patch + "${FILESDIR}"/${P}-ldflags.patch + "${FILESDIR}"/${P}-gcc-11.patch +) + src_prepare() { default sed -i \ @@ -27,16 +34,14 @@ src_prepare() { -e "s:sprites/:/usr/share/${PN}/sprites/:" \ -e "s:levels/:/usr/share/${PN}/levels/:" \ src/sdb.h src/game.cpp || die "setting game paths" - eapply \ - "${FILESDIR}"/${P}-endian.patch \ - "${FILESDIR}"/${P}-gcc43.patch \ - "${FILESDIR}"/${P}-ldflags.patch } src_compile() { emake \ -C src \ - CXXFLAGS="${CXXFLAGS} $(sdl-config --cflags)" + CXXFLAGS="${CXXFLAGS} $(sdl-config --cflags)" \ + CC=$(tc-getCC) \ + CPP=$(tc-getCXX) } src_install() { diff --git a/games-arcade/sdb/sdb-1.0.2-r2.ebuild b/games-arcade/sdb/sdb-1.0.2-r2.ebuild new file mode 100644 index 000000000000..842841e9cbd8 --- /dev/null +++ b/games-arcade/sdb/sdb-1.0.2-r2.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit desktop toolchain-funcs + +DESCRIPTION="A 2D top-down action game; escape a facility full of walking death machines" +HOMEPAGE="http://sdb.gamecreation.org/" +SRC_URI="http://gcsociety.sp.cs.cmu.edu/~frenzy/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="virtual/opengl + media-libs/libsdl + media-libs/sdl-image[png] + media-libs/sdl-mixer" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-endian.patch + "${FILESDIR}"/${P}-gcc43.patch + "${FILESDIR}"/${P}-ldflags.patch + "${FILESDIR}"/${P}-gcc-11.patch + "${FILESDIR}"/${P}-return-type.patch +) + +src_prepare() { + default + sed -i \ + -e "s:models/:/usr/share/${PN}/models/:" \ + -e "s:snd/:/usr/share/${PN}/snd/:" \ + -e "s:sprites/:/usr/share/${PN}/sprites/:" \ + -e "s:levels/:/usr/share/${PN}/levels/:" \ + src/sdb.h src/game.cpp || die "setting game paths" +} + +src_compile() { + emake \ + -C src \ + CXXFLAGS="${CXXFLAGS} $(sdl-config --cflags)" \ + CC=$(tc-getCC) \ + CPP=$(tc-getCXX) +} + +src_install() { + dobin src/sdb + insinto /usr/share/${PN} + doins -r levels models snd sprites + newicon sprites/barrel.png ${PN}.png + make_desktop_entry sdb "Shotgun Debugger" + einstalldocs +} |