Advertisement
Draygera

Dungeon Defenders AUR PKGBUILD

Mar 7th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.22 KB | None | 0 0
  1. # Contributor: Ben R <thebenj88 *AT* gmail *DOT* com>
  2. # Modified by: Brandon D <draygera *AT* gmail *DOT* com>
  3.  
  4. pkgname=dungeon-defenders-hib
  5. pkgver=03052013
  6. pkgrel=1
  7. pkgdesc="A co-operative 3D tower defense game with medieval theming."
  8. url="http://dungeondefenders.com/"
  9. license=('custom: "commercial"')
  10. arch=('i686' 'x86_64')
  11. depends=('libstdc++5' 'glibc>=2.12.2' 'unzip' 'libxss')
  12. options=(!strip)
  13. source=("dungeon-defenders.desktop"
  14.         "http://uk-microsites.ign.com/playstationoffers/images/charts/dlc/dungeon_defenders.png")
  15. sha256sums=('b7c299ef6430db375519846b7a18002a9cfb418f4ed83969cb880b369f4918d5'
  16.             '1d5292e72931d2e59d9568454f082b0c2e92074c28f2b7260eda549c01b560e3')
  17. screenshot="http://dungeondefenders.com/wp-content/gallery/screenshots/forestscreenfinal.jpg"
  18.            
  19. _gamepkg="dundef-linux-${pkgver}.mojo.run"
  20.  
  21. build() {
  22.    cd "${srcdir}"
  23.    msg "You need a full copy of this game in order to install it"
  24.    msg "Searching for ${_gamepkg} in dir: $(readlink -f `pwd`/..)"
  25.    if [[ -f "../${_gamepkg}" ]]; then
  26.        msg "Found game package, installing..."
  27.        ln -fs "../${_gamepkg}" .
  28.    else
  29.        error "Game package not found, please type absolute path to ${_gamepkg} (/home/joe):"
  30.        read pkgpath
  31.        if [[ -f "${pkgpath}/${_gamepkg}" ]]; then
  32.            msg "Found game package, installing..."
  33.            ln -fs "${pkgpath}/${_gamepkg}" .
  34.        else
  35.            error "Unable to find game package."
  36.            return 1
  37.        fi
  38.    fi
  39.    msg 'Extracting game files from mojosetup installer'
  40.    unzip -uo ${_gamepkg} || true  # Mojo.run files are actually zip files with an extra header most of the time.
  41. }
  42.  
  43. package(){
  44.   msg 'Installing game icon and desktop files'
  45.   install -Dm644 "${srcdir}/dungeon-defenders.desktop" \
  46.   "${pkgdir}/usr/applications/dungeon-defenders.desktop"
  47.  
  48.   install -Dm644 "${srcdir}/dungeon_defenders.png" \
  49.   "${pkgdir}/usr/share/icons/dungeon-defenders.png"
  50.  
  51.   msg 'Installing game files'
  52.   install -d "${pkgdir}/opt/"
  53.   mv ${srcdir}/data/ ${pkgdir}/opt/DungeonDefenders/
  54.  
  55.   msg 'Installing launcher'
  56.   install -d "${pkgdir}/usr/bin/"
  57.   ln -s /opt/DungeonDefenders/DungeonDefenders \
  58.   ${pkgdir}/usr/bin/dungeon-defenders
  59.  
  60.   msg 'Fixing infinite start bug as found here: https://bugzilla.icculus.org/show_bug.cgi?id=5894'
  61.   sed -i 's/DefaultGameplayLevel=LobbyLevel_Valentines2013.udk/LobbyLevel.udk/g' ${pkgdir}/opt/DungeonDefenders/UDKGame/Config/DefaultDunDef.ini
  62.   sed -i 's/DefaultGameplayLevelRanked=LobbyLevel_Valentines2013.udk/LobbyLevel.udk/g' ${pkgdir}/opt/DungeonDefenders/UDKGame/Config/DefaultDunDef.ini
  63. }
  64.  
  65. # Locate a file or folder provided by the user, and symlink it into $srcdir
  66. _get_local_source() {
  67.   msg "Looking for '$1'..."
  68.   declare -A _search=(['build dir']="$startdir"
  69.                       ['$LOCAL_PACKAGE_SOURCES']="$LOCAL_PACKAGE_SOURCES"
  70.                       ['$_gamedir']="$_gamedir")
  71.   for _key in "${!_search[@]}"; do local _dir="${_search["$_key"]}"
  72.     if [ -z "$_dir" ]; then _dir="<undefined>"; fi
  73.     echo -n "    - in $_key ['$_dir'] ... ";
  74.     if [ -e "$_dir/$1" ]; then
  75.       echo "FOUND"; ln -sfT "$(readlink -f "$_dir/$1")" "$srcdir/$1"; break; fi
  76.     echo "NOT FOUND"
  77.   done
  78.   if [ ! -e "$srcdir/$1" ]; then return 1; fi
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement