Changes between Initial Version and Version 7 of Ticket #1424


Ignore:
Timestamp:
Oct 14, 2014, 5:52:08 AM (10 years ago)
Author:
Vincent Cheng
Comment:

There's recently been another bug report from an Ubuntu user about the 0ad.sh wrapper script not being able to find pyrogenesis if /usr/games isn't in the user's path, i.e. https://bugs.launchpad.net/bugs/1380737. It's not ideal, but I've gone ahead and hardcoded the path in the 0ad packages in Debian/Ubuntu:

--- a/build/resources/0ad.sh
+++ b/build/resources/0ad.sh
@@ -3,6 +3,9 @@
 pyrogenesis=$(which pyrogenesis 2> /dev/null)
 if [ -x "$pyrogenesis" ] ; then
   "$pyrogenesis" "$@"
+elif [ -x /usr/games/pyrogenesis ] ; then
+  # Fallback in case /usr/games is not in $PATH; see #679033 and LP: #1380737
+  /usr/games/pyrogenesis "$@"
 else
   echo "Error: pyrogenesis not found in ($PATH)"
   exit 1

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1424

    • Property Status newreopened
    • Property Cc Philip Taylor added
    • Property Component Core engineBuild & Packages
    • Property Summary Remove hardcoded paths for better Linux Packaging support[PATCH] Remove hardcoded paths for better Linux Packaging support
    • Property Owner set to leper
    • Property Milestone BacklogAlpha 18
    • Property Keywords patch added
  • Ticket #1424 – Description

    initial v7  
    11Currently, the script that calls pyrogenesis (build/resources/0ad.sh) hardcodes the path to the pyrogenesis binary (/usr/bin/pyrogenesis), which means that Linux distros which install game binaries to /usr/games (i.e. Debian & Ubuntu) end up having to patch the file. Instead of hardcoding the path, I propose the following patch, which looks for the first instance of pyrogenesis in the user's PATH and runs that. The patch below also modifies build/resources/0ad.desktop to use a relative path for the Exec= field rather than a hardcoded path.
    2 
    32{{{
    43--- a/build/resources/0ad.sh
     
    65@@ -1,3 +1,9 @@
    76 #!/bin/sh
    8  
    97-/usr/bin/pyrogenesis "$@"
    108+path_to_pyrogenesis=$(which pyrogenesis)