summaryrefslogtreecommitdiff
path: root/games-arcade/whichwayisup
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
commit21435953e16cda318a82334ddbadb3b5c36d9ea7 (patch)
treee1810a4b135afce04b34862ef0fab2bfaeb8aeca /games-arcade/whichwayisup
parent7bc9c63c9da678a7e6fceb095d56c634afd22c56 (diff)
gentoo resync : 15.01.2020
Diffstat (limited to 'games-arcade/whichwayisup')
-rw-r--r--games-arcade/whichwayisup/Manifest5
-rw-r--r--games-arcade/whichwayisup/files/whichwayisup-0.7.9-check_for_joystick_axes_not_null.patch21
-rw-r--r--games-arcade/whichwayisup/files/whichwayisup-0.7.9-initialize_only_required_pygame_modules.patch23
-rw-r--r--games-arcade/whichwayisup/files/whichwayisup-0.7.9-python3.patch470
-rw-r--r--games-arcade/whichwayisup/whichwayisup-0.7.9-r3.ebuild (renamed from games-arcade/whichwayisup/whichwayisup-0.7.9-r2.ebuild)25
5 files changed, 532 insertions, 12 deletions
diff --git a/games-arcade/whichwayisup/Manifest b/games-arcade/whichwayisup/Manifest
index e27b41e2b46c..588e8f27948b 100644
--- a/games-arcade/whichwayisup/Manifest
+++ b/games-arcade/whichwayisup/Manifest
@@ -1,4 +1,7 @@
+AUX whichwayisup-0.7.9-check_for_joystick_axes_not_null.patch 582 BLAKE2B 6d5c35fe35fe08df884c69b54c8a0ca18bfa2f22706274cf7a8589391fc0f25d77ae7619c8ec44fe075e31020af19b0350bbac7f9e2866838629e24df6e7468f SHA512 506560bb48348b37034a6f7851e1d4ff4e56374df7fed9cc5ac405aadfd4e63cf947fdfa837f45b51eaa08f5bd0f5deeb805a02afb67eae9a03c8b24aff53c74
+AUX whichwayisup-0.7.9-initialize_only_required_pygame_modules.patch 631 BLAKE2B 09c7b64e45ec239905043b1d1a8abf965d92a54405f98ee5db4f3c6e494dc509ca99ee00f42c2c125320975e8e8e7bd17436a05b1066218b70ba27c16af65643 SHA512 2fb39740ed5ee4814f496e799d27f4d9377771861799e907bab5d3454aca2b3d6d25616d254977f7bf3504b4874774bc9984ddcfca58660fd63cb5bc6938663d
+AUX whichwayisup-0.7.9-python3.patch 18559 BLAKE2B 96cb66f5092e1a0ee29e82b12ec5c6cdde3f92cdc3cb6a0db5b768e0eb51e6a8eaf5e4ca85889966d5155f9197fff8431408ac5a3a63b58cb65d38db15e04c64 SHA512 cefabb3deee25bf6fb008d648257dfd5fbe30a87e7aa9fc3cb0d80ce544db6e7c52193a3aad68761a8d7258b9474066eba6c5723b7da3ad1ac5c27f579184f28
AUX whichwayisup-32.xpm 1694 BLAKE2B 079e9f6e3dde54c1d2bb7f576330663fa886bc112f3e20398c3e50521c19ccc4c68647b37e9d3ed4dc88a7f2c2ac60d11c171e3350e7ec84fee0b193e4eeb830 SHA512 e0329876d45aa575abe07024d7f154ff743f1899c4dbb58b8e317ae9173c2aadd63a511924e99115a9f56f42411507f542225e4980d9588e09f7765cf41bf95c
DIST whichwayisup_b079.zip 1001890 BLAKE2B bfc8f15376ae7c93cc3921a7c0537d44bca44cbfd5e19533912c56151b8811a40e96271e0f3b8634a6fc4625bd32c9668fc3c321f1d2ea0306517067f3d31e24 SHA512 49ac6b8224f3cf7b0711b297c9dd96ff2a0969f7c16fa1da500bef1ea5d793bd900be124a9b9874239c98db6fd2db92917b8ce2ee09b685e184cfd87bf519809
-EBUILD whichwayisup-0.7.9-r2.ebuild 1238 BLAKE2B 9470470daf38683f8a2f0e25872564ffd7117cd80c4eae2191d87db21089879b07d13738c24be27e11b515221a0bcf557ce29d7e222b1f78c71cae17dd0594b3 SHA512 c27361684ecb16ed1ee09f85adf191bec985703a0d6012e318c98859359354e30bb00c249c37fab47741fde4c233ac9285f4b4e3e0657b6473ef28af1b743f6a
+EBUILD whichwayisup-0.7.9-r3.ebuild 1370 BLAKE2B e6f8fb72e65f483ad7a387fcd060fcfe4c93d5f9d435e211e0333f6a77f4a4630d21952d55c14c148a2f2269c5f7ec88d5399d78af5a4da4dd35ae2b81b398fa SHA512 0d95d825fb0f05d15fd1e3abdad4d9d2e1f1023660a1fc13fe7551fff66413521d6bd3f1a5eb5656d779ca6b75748eddb1e2e28963eb0a345bc499bbddb3e6fe
MISC metadata.xml 491 BLAKE2B 7c632e2660757b2796dc732506e95b040890bc30941d152f4b650a2aad266e9aa3c013ce8054d02979c64610559ace6b4ac4b6d8ed9b5277a0dd9c92d9414b4c SHA512 a53511b1c0d5b69a34c5dfb0c302505cda98b9a54edb6b4f74868a48ee7870b1ec83dfedff7833e2997a97160182fb35f610a2f97c3577ca4b4cc297c98eeb1b
diff --git a/games-arcade/whichwayisup/files/whichwayisup-0.7.9-check_for_joystick_axes_not_null.patch b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-check_for_joystick_axes_not_null.patch
new file mode 100644
index 000000000000..b97856a0d2b9
--- /dev/null
+++ b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-check_for_joystick_axes_not_null.patch
@@ -0,0 +1,21 @@
+From: Markus Koschany <apo@debian.org>
+Date: Tue, 28 May 2013 18:40:34 +0200
+Subject: check for joystick axes not null
+
+---
+ lib/game.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/game.py b/lib/game.py
+index f0afd84..30f86fd 100644
+--- a/lib/game.py
++++ b/lib/game.py
+@@ -138,7 +138,7 @@ def parse_inputs(joystick = None):
+ if keys[K_F10]:
+ inputs["SPECIAL"] = True
+
+- if joystick != None: # Parse joystick input
++ if joystick != None and joystick.get_numaxes() != 0: # Parse joystick input
+
+ axis0 = joystick.get_axis(0)
+
diff --git a/games-arcade/whichwayisup/files/whichwayisup-0.7.9-initialize_only_required_pygame_modules.patch b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-initialize_only_required_pygame_modules.patch
new file mode 100644
index 000000000000..5bfea4ddd6e6
--- /dev/null
+++ b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-initialize_only_required_pygame_modules.patch
@@ -0,0 +1,23 @@
+From: Markus Koschany <apo@debian.org>
+Date: Tue, 28 May 2013 18:21:54 +0200
+Subject: initialize only required pygame modules.
+
+---
+ lib/main.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/lib/main.py b/lib/main.py
+index cfe9046..6a0376a 100644
+--- a/lib/main.py
++++ b/lib/main.py
+@@ -60,7 +60,9 @@ def main():
+
+ #Initializing pygame and screen
+
+- pygame.init()
++ pygame.joystick.init()
++ pygame.display.init()
++ pygame.mixer.init()
+ screen = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT))
+ caption = "Which way is up?"
+ if (Variables.vdict["devmode"]):
diff --git a/games-arcade/whichwayisup/files/whichwayisup-0.7.9-python3.patch b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-python3.patch
new file mode 100644
index 000000000000..5b2026405516
--- /dev/null
+++ b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-python3.patch
@@ -0,0 +1,470 @@
+Author: Reiner Herrmann <reiner@reiner-h.de>
+Description: Port game to python3
+Bug-Debian: https://bugs.debian.org/912500
+
+--- a/run_game.py
++++ b/run_game.py
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#! /usr/bin/env python3
+
+ import sys
+ import os
+--- a/lib/util.py
++++ b/lib/util.py
+@@ -113,12 +113,12 @@
+ try:
+ conffile = codecs.open(file_path, "w", "utf_8")
+ for world in WORLDS:
+- print >> conffile, "unlocked\t%(world)s\t%(unlocked)s" % {"world": world, "unlocked": Variables.vdict["unlocked" + world]}
+- print >> conffile, "hiscore\t%(world)s\t%(hiscore)s" % {"world": world, "hiscore": Variables.vdict["hiscore" + world]}
+- print >> conffile, "besttime\t%(world)s\t%(besttime)s" % {"world": world, "besttime": Variables.vdict["besttime" + world]}
+- print >> conffile, "sound\t%s" % bool_to_str(Variables.vdict["sound"])
+- print >> conffile, "dialogue\t%s" % bool_to_str(Variables.vdict["dialogue"])
+- print >> conffile, "fullscreen\t%s" % bool_to_str(Variables.vdict["fullscreen"])
++ print("unlocked\t%(world)s\t%(unlocked)s" % {"world": world, "unlocked": Variables.vdict["unlocked" + world]}, file=conffile)
++ print("hiscore\t%(world)s\t%(hiscore)s" % {"world": world, "hiscore": Variables.vdict["hiscore" + world]}, file=conffile)
++ print("besttime\t%(world)s\t%(besttime)s" % {"world": world, "besttime": Variables.vdict["besttime" + world]}, file=conffile)
++ print("sound\t%s" % bool_to_str(Variables.vdict["sound"]), file=conffile)
++ print("dialogue\t%s" % bool_to_str(Variables.vdict["dialogue"]), file=conffile)
++ print("fullscreen\t%s" % bool_to_str(Variables.vdict["fullscreen"]), file=conffile)
+ except:
+ error_message("Could not write configuration file to " + file_path)
+ return False
+@@ -136,13 +136,13 @@
+ count += 1
+ if count > MAX_OLD_LOG_LINES:
+ break
+- if Variables.vdict.has_key("log"):
++ if "log" in Variables.vdict:
+ try:
+ conffile = codecs.open(file_path, "w", "utf_8")
+- print >> conffile, "Log updated " + str(datetime.date.today())
+- print >> conffile, Variables.vdict["log"]
+- print >> conffile, ""
+- print >> conffile, old_log
++ print("Log updated " + str(datetime.date.today()), file=conffile)
++ print(Variables.vdict["log"], file=conffile)
++ print("", file=conffile)
++ print(old_log, file=conffile)
+ except:
+ error_message("Could not write log file to " + file_path)
+ return False
+@@ -166,7 +166,7 @@
+ The constant colors can be found from locals.py.
+ '''
+ def render_text(string, color = COLOR_GUI, bgcolor = COLOR_GUI_BG):
+- if Util.cached_text_images.has_key(string + str(color) + str(bgcolor)):
++ if (string + str(color) + str(bgcolor)) in Util.cached_text_images:
+ final_image = Util.cached_text_images[string + str(color) + str(bgcolor)]
+ else:
+ text_image_bg = Util.smallfont.render(string, True, bgcolor)
+@@ -200,8 +200,8 @@
+ rendered_string = string[0:phase]
+ string_image = render_text(rendered_string)
+ string_rect = string_image.get_rect()
+- string_rect.centerx = SCREEN_WIDTH / 2
+- string_rect.centery = SCREEN_HEIGHT / 2
++ string_rect.centerx = SCREEN_WIDTH // 2
++ string_rect.centery = SCREEN_HEIGHT // 2
+
+ if key == "p":
+ skip_image = Util.cached_images["key_p"]
+@@ -209,7 +209,7 @@
+ skip_image = Util.cached_images["key_z"]
+
+ skip_rect = skip_image.get_rect()
+- skip_rect.centerx = SCREEN_WIDTH / 2
++ skip_rect.centerx = SCREEN_WIDTH // 2
+ skip_rect.top = string_rect.bottom + 5
+
+ bg_rect = pygame.Rect(string_rect.left - 10, string_rect.top - 5, string_rect.width + 20, string_rect.height + skip_rect.height + 15)
+--- a/lib/animation.py
++++ b/lib/animation.py
+@@ -58,9 +58,9 @@
+ self.finished = True
+ else:
+ self.i = 0
+- if Animation.cached_frames.has_key(self.cache_name + str(self.i)):
++ if (self.cache_name + str(self.i)) in Animation.cached_frames:
+ self.image = Animation.cached_frames[self.cache_name + str(self.i)]
+ else:
+ self.image = (self.frames[self.i]).get_image()
+ Animation.cached_frames[self.cache_name + str(self.i)] = self.image
+- return self.image
+\ No newline at end of file
++ return self.image
+--- a/lib/edit_utils.py
++++ b/lib/edit_utils.py
+@@ -16,23 +16,23 @@
+ return
+
+ def update(self, inputs):
+- if inputs.has_key("REMOVE_TILE"):
++ if "REMOVE_TILE" in inputs:
+ return Change("remove", self.cursor)
+- if inputs.has_key("ADD_TILE_WALL"):
++ if "ADD_TILE_WALL" in inputs:
+ return Change("W", self.cursor)
+- if inputs.has_key("ADD_TILE_SPIKES"):
++ if "ADD_TILE_SPIKES" in inputs:
+ return Change("S", self.cursor)
+- if inputs.has_key("ADD_TILE_BARS"):
++ if "ADD_TILE_BARS" in inputs:
+ return Change("B", self.cursor)
+- if inputs.has_key("SAVE_TILES"):
++ if "SAVE_TILES" in inputs:
+ return Change("save", (0, 0))
+- if inputs.has_key("EDIT_RIGHT") and self.cursor[0] < (TILES_HOR - 1):
++ if "EDIT_RIGHT" in inputs and self.cursor[0] < (TILES_HOR - 1):
+ self.cursor[0] += 1
+- if inputs.has_key("EDIT_LEFT") and self.cursor[0] > 0:
++ if "EDIT_LEFT" in inputs and self.cursor[0] > 0:
+ self.cursor[0] -= 1
+- if inputs.has_key("EDIT_DOWN") and self.cursor[1] < (TILES_VER - 1):
++ if "EDIT_DOWN" in inputs and self.cursor[1] < (TILES_VER - 1):
+ self.cursor[1] += 1
+- if inputs.has_key("EDIT_UP") and self.cursor[1] > 0:
++ if "EDIT_UP" in inputs and self.cursor[1] > 0:
+ self.cursor[1] -= 1
+ return None
+
+--- a/lib/game.py
++++ b/lib/game.py
+@@ -265,7 +265,7 @@
+ trigger = None
+
+ if scripted_event_on:
+- if inputs.has_key("JUMP") or inputs.has_key("DOWN"):
++ if "JUMP" in inputs or "DOWN" in inputs:
+ cleared = True
+
+ moved = False
+@@ -277,20 +277,20 @@
+ #There isn't anything special going on: player can control the character
+ #Translates input to commands to the player object
+ add_time = True
+- if inputs.has_key("LEFT"):
++ if "LEFT" in inputs:
+ player.move((-PLAYER_MAX_ACC, 0))
+ moved = True
+
+- if inputs.has_key("RIGHT"):
++ if "RIGHT" in inputs:
+ player.move((PLAYER_MAX_ACC, 0))
+ moved = True
+
+- if inputs.has_key("JUMP"):
++ if "JUMP" in inputs:
+ if (player.on_ground):
+ count = 0
+ while (count < 5):
+ count += 1
+- particles.append(Particle(screen, 10, player.rect.centerx - player.dx / 4 + random.uniform(-3, 3), player.rect.bottom, -player.dx * 0.1, -0.5, 0.3, level.dust_color, 4))
++ particles.append(Particle(screen, 10, player.rect.centerx - player.dx // 4 + random.uniform(-3, 3), player.rect.bottom, -player.dx * 0.1, -0.5, 0.3, level.dust_color, 4))
+ player.jump()
+
+ #The blobs always try to jump when the player jumps
+@@ -299,10 +299,10 @@
+ if o.itemclass == "blob":
+ o.jump()
+
+- if inputs.has_key("UP") and not player.on_ground:
++ if "UP" in inputs and not player.on_ground:
+ player.jump()
+
+- if inputs.has_key("DOWN"):
++ if "DOWN" in inputs:
+ pick_up_item = level.pick_up(player.x, player.y)
+ if pick_up_item != None:
+ play_sound("coins")
+@@ -314,10 +314,10 @@
+ trigger = level.trigger(player.x, player.y)
+
+ #Debug command for flipping:
+- if inputs.has_key("SPECIAL"):
++ if "SPECIAL" in inputs:
+ trigger = Trigger(TRIGGER_FLIP, player.x, player.y)
+
+- if inputs.has_key("PAUSE") and player.current_animation != "dying":
++ if "PAUSE" in inputs and player.current_animation != "dying":
+ paused = not paused
+
+ #Decelerates the player, if he doesn't press any movement keys or when he is dead and on the ground
+@@ -344,7 +344,7 @@
+ #Dust effect rising from the character's feet:
+
+ if (player.current_animation == "walking"):
+- particles.append(Particle(screen, 10, player.rect.centerx - player.dx / 2 + random.uniform(-2, 2), player.rect.bottom, -player.dx * 0.1, 0.1, 0.3, level.dust_color))
++ particles.append(Particle(screen, 10, player.rect.centerx - player.dx // 2 + random.uniform(-2, 2), player.rect.bottom, -player.dx * 0.1, 0.1, 0.3, level.dust_color))
+
+ #Updating level and objects:
+
+@@ -455,7 +455,7 @@
+ player.orientation = current_scripted_event_element.orientation
+ current_scripted_event_element.finished = True
+ elif current_scripted_event_element.event_type == "change_level":
+- score.score += (5 + score_mod) * ((player.life + 4) / 5 + 12)
++ score.score += (5 + score_mod) * ((player.life + 4) // 5 + 12)
+ score.levels += 1
+ current_scripted_event_element.finished = True
+ if player.current_animation != "gone":
+--- a/lib/level.py
++++ b/lib/level.py
+@@ -129,8 +129,8 @@
+ self.bg_animations["default"] = Animation(self.set + "_background", "static")
+ self.current_animation = "default"
+ self.rect = (self.bg_animations[self.current_animation].update_and_get_image()).get_rect()
+- self.rect.centerx = SCREEN_WIDTH / 2
+- self.rect.centery = SCREEN_HEIGHT / 2
++ self.rect.centerx = SCREEN_WIDTH // 2
++ self.rect.centery = SCREEN_HEIGHT // 2
+
+ self.reset_active_tiles()
+ return
+@@ -217,7 +217,7 @@
+
+ #Checks the point for solid ground
+ def ground_check(self, x, y):
+- if self.cached_ground_check.has_key(str(x) + "_" + str(y)):
++ if (str(x) + "_" + str(y)) in self.cached_ground_check:
+ return self.cached_ground_check[str(x) + "_" + str(y)]
+ else:
+ if x > SCREEN_WIDTH or y > SCREEN_HEIGHT or x < 0 or y < 0:
+@@ -333,7 +333,7 @@
+ def remove_tile(self, coords):
+ """Remove a tile from the level with coordinates relative to the corner of the area currently visible."""
+ for t in self.active_tiles:
+- if t.rect.collidepoint(coords[0]*TILE_DIM + TILE_DIM / 2, coords[1]*TILE_DIM + TILE_DIM / 2):
++ if t.rect.collidepoint(coords[0]*TILE_DIM + TILE_DIM // 2, coords[1]*TILE_DIM + TILE_DIM // 2):
+ self.active_tiles.remove(t)
+ self.tiles.remove(t)
+ self.edited = True
+--- a/lib/log.py
++++ b/lib/log.py
+@@ -15,7 +15,7 @@
+ """Add a message to the message log, which can be written on disk later."""
+
+ #Multiple messages of the same type aren't added to the log:
+- if Variables.vdict.has_key("last_log_message"):
++ if "last_log_message" in Variables.vdict:
+ if string == Variables.vdict["last_log_message"]:
+ return
+
+@@ -24,9 +24,9 @@
+
+ Variables.vdict["last_log_message"] = string
+
+- if Variables.vdict.has_key("log"):
++ if "log" in Variables.vdict:
+ Variables.vdict["log"] = string + "\n" + Variables.vdict["log"]
+ else:
+ Variables.vdict["log"] = string
+
+- return
+\ No newline at end of file
++ return
+--- a/lib/sound.py
++++ b/lib/sound.py
+@@ -25,7 +25,7 @@
+ if not Variables.vdict["sound"]:
+ return
+ snd = None
+- if (not sounds.has_key(sound_id)):
++ if sound_id not in sounds:
+ try:
+ sound_path = data.filepath(os.path.join("sounds", sound_id + ".ogg"))
+ snd = sounds[sound_id] = pygame.mixer.Sound(sound_path)
+--- a/lib/visibleobject.py
++++ b/lib/visibleobject.py
+@@ -27,9 +27,9 @@
+ self.x = x
+ self.y = y
+ if (self.x == None):
+- self.x = SCREEN_WIDTH / 2
++ self.x = SCREEN_WIDTH // 2
+ if (self.y == None):
+- self.y = SCREEN_HEIGHT / 2
++ self.y = SCREEN_HEIGHT // 2
+
+ self.flipping = False
+ self.flipcounter = 0
+@@ -122,7 +122,7 @@
+
+ def die(self):
+ """Make the object die - if the object has a death animation, it will be played first."""
+- if self.animations.has_key("dying"):
++ if "dying" in self.animations:
+ self.current_animation = "dying"
+ else:
+ self.dead = True
+--- a/lib/player.py
++++ b/lib/player.py
+@@ -79,7 +79,7 @@
+
+ blood = []
+
+- if collision_type > 0:
++ if collision_type and collision_type > 0:
+ blood = self.take_damage(collision_type)
+ if self.current_animation != "dying":
+ self.dy -= collision_type*PLAYER_JUMP_ACC / 4.5
+--- a/lib/object.py
++++ b/lib/object.py
+@@ -34,7 +34,7 @@
+ self.initial_y = y
+ self.gravity = gravity
+ self.colliding = colliding
+- self.active = (self.x + self.rect.width / 2 > 0) and (self.y + self.rect.height / 2 > 0)
++ self.active = (self.x + self.rect.width // 2 > 0) and (self.y + self.rect.height // 2 > 0)
+
+ self.on_ground = False
+
+@@ -76,7 +76,7 @@
+ VisibleObject.update(self)
+
+ if self.flip_finished and self.itemclass != "player":
+- self.active = (self.x + self.rect.width / 2 > 0) and (self.y + self.rect.height / 2 > 0)
++ self.active = (self.x + self.rect.width // 2 > 0) and (self.y + self.rect.height // 2 > 0)
+
+ if self.flipping:
+ return
+@@ -101,9 +101,9 @@
+ """Make the object flip with the level to either direction"""
+ if VisibleObject.flip(self, flip_direction):
+ if flip_direction == CLOCKWISE:
+- self.initial_x, self.initial_y = -self.initial_y + PLAY_AREA_WIDTH / TILES_HOR * (TILES_HOR*2 - FULL_TILES_HOR), self.initial_x
++ self.initial_x, self.initial_y = -self.initial_y + PLAY_AREA_WIDTH // TILES_HOR * (TILES_HOR*2 - FULL_TILES_HOR), self.initial_x
+ else:
+- self.initial_x, self.initial_y = self.initial_y, -self.initial_x + PLAY_AREA_WIDTH / TILES_HOR * (TILES_HOR*2 - FULL_TILES_HOR)
++ self.initial_x, self.initial_y = self.initial_y, -self.initial_x + PLAY_AREA_WIDTH // TILES_HOR * (TILES_HOR*2 - FULL_TILES_HOR)
+ return
+
+ def check_collisions(self, level):
+@@ -116,25 +116,25 @@
+
+ self.on_ground = False
+
+- if self.x < 0 + self.rect.width / 2:
+- self.x = 0 + self.rect.width / 2
++ if self.x < 0 + self.rect.width // 2:
++ self.x = 0 + self.rect.width // 2
+ self.dx = 0
+ collision_type = 0
+
+- if self.x > PLAY_AREA_WIDTH - self.rect.width / 2:
+- self.x = PLAY_AREA_WIDTH - self.rect.width / 2
++ if self.x > PLAY_AREA_WIDTH - self.rect.width // 2:
++ self.x = PLAY_AREA_WIDTH - self.rect.width // 2
+ self.dx = 0
+ collision_type = 0
+
+ # The commented block is the collision code for the upper edge of the screen.
+ # The spiders and projectiles might need this, but they use simplified
+ # collision detection for better performance anyway.
+- '''if self.y < 0 + self.rect.height / 2:
+- self.y = 0 + self.rect.height / 2
++ '''if self.y < 0 + self.rect.height // 2:
++ self.y = 0 + self.rect.height // 2
+ self.dy = 0'''
+
+- if self.y > PLAY_AREA_HEIGHT - self.rect.height / 2:
+- self.y = PLAY_AREA_HEIGHT - self.rect.height / 2
++ if self.y > PLAY_AREA_HEIGHT - self.rect.height // 2:
++ self.y = PLAY_AREA_HEIGHT - self.rect.height // 2
+ self.dy = 0
+ self.on_ground = True
+ collision_type = 0
+--- a/lib/locals.py
++++ b/lib/locals.py
+@@ -16,8 +16,8 @@
+
+ TILE_DIM = 40
+
+-PLAY_AREA_CENTER_X = (-FULL_TILES_HOR / 2 + TILES_HOR) * TILE_DIM
+-PLAY_AREA_CENTER_Y = (-FULL_TILES_VER / 2 + TILES_VER) * TILE_DIM
++PLAY_AREA_CENTER_X = (-FULL_TILES_HOR // 2 + TILES_HOR) * TILE_DIM
++PLAY_AREA_CENTER_Y = (-FULL_TILES_VER // 2 + TILES_VER) * TILE_DIM
+
+ GRAVITY = 1.0
+ GRAVITY_PARTICLE = 0.5
+--- a/lib/mainmenu.py
++++ b/lib/mainmenu.py
+@@ -73,19 +73,19 @@
+
+ menu_image = render_text("World " + str(self.world.number) + ": " + self.world.name, COLOR_GUI)
+ rect = menu_image.get_rect()
+- rect.centerx = SCREEN_WIDTH / 2
++ rect.centerx = SCREEN_WIDTH // 2
+ rect.top = GUI_MENU_TOP - 75
+ self.bgscreen.blit(menu_image, rect)
+
+ menu_image = render_text(score_text, COLOR_GUI)
+ rect = menu_image.get_rect()
+- rect.centerx = SCREEN_WIDTH / 2
++ rect.centerx = SCREEN_WIDTH // 2
+ rect.top = GUI_MENU_TOP - 50
+ self.bgscreen.blit(menu_image, rect)
+
+ menu_image = render_text(time_text, COLOR_GUI)
+ rect = menu_image.get_rect()
+- rect.centerx = SCREEN_WIDTH / 2
++ rect.centerx = SCREEN_WIDTH // 2
+ rect.top = GUI_MENU_TOP - 30
+ self.bgscreen.blit(menu_image, rect)
+
+--- a/lib/menu.py
++++ b/lib/menu.py
+@@ -91,14 +91,14 @@
+
+ menu_bg = pygame.image.load(data.picpath("menu", "bg")).convert_alpha()
+ rect = menu_bg.get_rect()
+- rect.centerx = SCREEN_WIDTH / 2
++ rect.centerx = SCREEN_WIDTH // 2
+ rect.top = GUI_MENU_TOP
+ self.screen.blit(menu_bg, rect)
+
+ if self.heading_text != None:
+ menu_head = render_text(self.heading_text)
+ rect = menu_head.get_rect()
+- rect.centerx = SCREEN_WIDTH / 2
++ rect.centerx = SCREEN_WIDTH // 2
+ rect.top = GUI_MENU_TOP + 50 + menu_offset
+ self.screen.blit(menu_head, rect)
+
+@@ -120,7 +120,7 @@
+ else:
+ menu_image = render_text(m, COLOR_GUI)
+ rect = menu_image.get_rect()
+- rect.centerx = SCREEN_WIDTH / 2
++ rect.centerx = SCREEN_WIDTH // 2
+ rect.top = GUI_MENU_TOP + 60 + (menu_visible + 1) * 20 + menu_offset
+ self.screen.blit(menu_image, rect)
+ current_menu_index += 1
+--- a/lib/particle.py
++++ b/lib/particle.py
+@@ -28,9 +28,9 @@
+ self.radius = radius
+ self.gravity = gravity
+ if (self.x == None):
+- self.x = SCREEN_WIDTH / 2
++ self.x = SCREEN_WIDTH // 2
+ if (self.y == None):
+- self.y = SCREEN_HEIGHT / 2
++ self.y = SCREEN_HEIGHT // 2
+ if (self.dx == None):
+ self.dx = 0.0
+ if (self.dy == None):
+--- a/lib/tile.py
++++ b/lib/tile.py
+@@ -47,8 +47,8 @@
+ def realign(self):
+ self.rect.centerx = self.x
+ self.rect.centery = self.y
+- self.x = round((float(self.rect.right)/float(TILE_DIM)), 0)*TILE_DIM - self.rect.width / 2
+- self.y = round((float(self.rect.bottom)/float(TILE_DIM)), 0)*TILE_DIM - self.rect.height / 2
++ self.x = round((float(self.rect.right)/float(TILE_DIM)), 0)*TILE_DIM - self.rect.width // 2
++ self.y = round((float(self.rect.bottom)/float(TILE_DIM)), 0)*TILE_DIM - self.rect.height // 2
+ if self.rect.height % 2 == 1:
+ self.y -= 1
+ if self.rect.width % 2 == 1:
diff --git a/games-arcade/whichwayisup/whichwayisup-0.7.9-r2.ebuild b/games-arcade/whichwayisup/whichwayisup-0.7.9-r3.ebuild
index 84964d15a797..0644c6c31c39 100644
--- a/games-arcade/whichwayisup/whichwayisup-0.7.9-r2.ebuild
+++ b/games-arcade/whichwayisup/whichwayisup-0.7.9-r3.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
-PYTHON_COMPAT=( python2_7 )
+EAPI=7
+PYTHON_COMPAT=( python3_{6,7,8} )
-inherit desktop python-single-r1
+inherit desktop python-r1
MY_PV="${PV//./}"
MY_P="${PN}_b${MY_PV}"
@@ -23,12 +23,18 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="${PYTHON_DEPS}
dev-python/pygame[${PYTHON_USEDEP}]
"
-DEPEND="${RDEPEND}
- app-arch/unzip
-"
+DEPEND="${RDEPEND}"
+BDEPEND="app-arch/unzip"
S="${WORKDIR}/${PN}"
+PATCHES=(
+ # Fixes from Fedora
+ "${FILESDIR}"/${P}-check_for_joystick_axes_not_null.patch
+ "${FILESDIR}"/${P}-initialize_only_required_pygame_modules.patch
+ "${FILESDIR}"/${P}-python3.patch
+)
+
src_prepare() {
default
sed -i \
@@ -37,8 +43,7 @@ src_prepare() {
sed -i \
-e "s:data_dir\ =\ .*:data_dir\ =\ \"/usr/share/${PN}\":" \
lib/data.py || die
- rm data/pictures/Thumbs.db
- python_fix_shebang .
+ rm data/pictures/Thumbs.db || die
}
src_install() {
@@ -47,8 +52,6 @@ src_install() {
insinto "/usr/$(get_libdir)/${PN}"
doins lib/*.py
- python_optimize "${ED}/usr/$(get_libdir)/${PN}"
-
einstalldocs
insinto "/usr/share/${PN}"