Advertisement
gbc921

PKGBUILD_rigsofrods-hg

Apr 12th, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.78 KB | None | 0 0
  1. # Maintainer:  Alfredo Palhares <masterkorp@masterkorp.net>
  2.  
  3. pkgname=rigsofrods-hg
  4. pkgver=121
  5. pkgrel=5
  6. pkgdesc="An open source vehicle simulator based on soft-body physics"
  7. arch=('i686' 'x86_64')
  8. url="http://www.rigsofrods.com"
  9. license=('GPL')
  10. depends=('angelscript-2.22.1' 'caelum' 'mygui' 'socketw' 'ogre' 'openal' 'ogre-pagedgeometry' 'wxgtk2.9')
  11. makedepends=('cmake' 'mercurial' 'zip' 'angelscript-2.22.1')
  12. conflicts=('rigsofrods')
  13. provides=('rigsofrods')
  14. backup=('opt/rigsofrods/bin/plugins.cfg')
  15. install="rigsofrods-hg.install"
  16. source=('plugins.cfg'
  17.         'RoR.desktop'
  18.         'RoRConfig.desktop'
  19.         'RoR.png'
  20.         "rigsofrods-hg.install")
  21. md5sums=('4a17e366ecfdb6f43ab448a45863a760'
  22.          '4cc4c5aba1b43ca26f6d8cca69c97f79'
  23.          'b4763676cfc156c854aeaa3481772291'
  24.          'b1b8a67e7402f1fbbcf14dbf03303415'
  25.          'dd16cfb4381e13e7270fbf4fc943afda')
  26.  
  27.  
  28. _hgroot="http://hg.code.sf.net/p/rigsofrods"
  29. _hgrepo="codehg"
  30.  
  31. build() {
  32.   cd "$srcdir"
  33.   msg "Connecting to Mercurial server...."
  34.  
  35.   if [[ -d "$_hgrepo" ]]; then
  36.     cd "$_hgrepo"
  37.     hg pull -u
  38.     msg "The local files are updated."
  39.   else
  40.     hg clone "$_hgroot"/"$_hgrepo" "$_hgrepo"
  41.   fi
  42.  
  43.   msg "Mercurial checkout done or server timeout"
  44.   msg "Starting build..."
  45.  
  46.   rm -rf "$srcdir/$_hgrepo-build"
  47.   cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
  48.   cd "$srcdir/$_hgrepo-build"
  49.  
  50.  LDFLAGS="-lboost_system" cmake . \
  51.   -DROR_USE_MYGUI=TRUE \
  52.   -DROR_USE_OPENAL=TRUE \
  53.   -DROR_USE_SOCKETW=TRUE \
  54.   -DROR_USE_PAGED=TRUE \
  55.   -DROR_USE_CAELUM=TRUE \
  56.   -DROR_USE_ANGELSCRIPT=TRUE \
  57.   -DANGELSCRIPT_INCLUDE_DIRS=/usr/include \
  58.   -DANGELSCRIPT_LIBRARIES=/usr/lib/libangelscript.so \
  59.   -DROR_USE_CURL=TRUE \
  60.   -DwxWidgets_wxrc_EXECUTABLE=/usr/bin/wxrc-2.9 \
  61.   -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config-2.9 \
  62.   -DSOCKETW_INCLUDE_DIRS=/usr/include \
  63.   -DSOCKETW_LIBRARIES=/usr/lib/libSocketW.so \
  64.   -DCMAKE_PREFIX_PATH=/opt/rigsofrods
  65.  
  66.  make
  67. }
  68.  
  69. package() {
  70.  cd "$srcdir/$_hgrepo-build"
  71.  mkdir -p $pkgdir/opt/rigsofrods
  72.  cp -dpr --no-preserve=ownership bin "$pkgdir/opt/rigsofrods"
  73.  
  74.  # Somtimes RoR does not like directories
  75.  for dir in "$pkgdir/opt/rigsofrods/bin/resources/"*; do
  76.    if [[ -d $dir ]]; then
  77.      cd "$dir"
  78.      zip "$dir.zip" *
  79.      cd ..
  80.      rm -r $dir
  81.    fi
  82.  done
  83.  
  84.  install -Dm 644 "$srcdir/plugins.cfg" "$pkgdir/opt/rigsofrods/bin/plugins.cfg"
  85.  install -Dm 644 "$srcdir/RoR.png" "$pkgdir/usr/share/pixmaps/RoR.png"
  86.  install -Dm 644 "$srcdir/RoR.desktop" "$pkgdir/usr/share/applications/RoR.desktop"
  87.  install -Dm 644 "$srcdir/RoRConfig.desktop" "$pkgdir/usr/share/applications/RoRConfig.desktop"
  88.  
  89.  mkdir -p "$pkgdir/usr/bin"
  90.  ln -s "/opt/rigsofrods/bin/RoRConfig" "$pkgdir/usr/bin/RoRConfig"
  91.  ln -s "/opt/rigsofrods/bin/RoR" "$pkgdir/usr/bin/RoR"
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement