1. # Maintainer: Jeremy Newton (Mystro256)
  2. # Contributor: Jeremy Newton (Mystro256)
  3. # Special thanks to the contributors of dolphin-emu-svn: for the icon, desktop file and some lines from the PKGBUILD
  4. # Thanks to all that contributed! :)
  5.  
  6. pkgname=dolphin-emu
  7. pkgver=3.0
  8. pkgrel=6
  9. pkgdesc="A GameCube and Wii emulator (stable git branch)"
  10. arch=('i686' 'x86_64')
  11. url="http://www.dolphin-emulator.com/"
  12. license=('GPL2')
  13.  
  14. makedepends=('git' 'cmake' 'glproto' 'opencl-headers')
  15. depends=('sdl' 'libxxf86vm' 'libao' 'wxgtk' 'wiiuse' 'nvidia-cg-toolkit' 'glew1.6' 'mesa' 'libgl')
  16. provides=("dolphin-emu=${pkgver}-${pkgrel}")
  17.  
  18. # Cannot be BUILT with sfml later than 1.6
  19. # IF YOU NEED SFML>=1.7 FOR SOMETHING ELSE, TRY REMOVING THE CONFLICT
  20. # BELOW AND ONLY TEMPORARY UNINSTALLING SFML TO BUILD/INSTALL DOLPHIN
  21. conflicts=('dolphin-emu-no-svn-config-dir-svn' 'dolphin-emu-git' 'dolphin-emu-svn' 'dolphin-emu-svn-bin' 'dolphin-emu-svn-bin' 'sfml>=1.7' 'sfml-git')
  22.  
  23. source=('dolphin-emu.desktop'
  24.         'Dolphin_Logo.png'
  25.         'sse4.2_fix.patch')
  26.  
  27. sha512sums=('cf4eeb7befb638acf9fd5cf1ef140b0d9fc630ef42d8e472d43882d9ec609990315a9929e8e2c7e387d750cf3c100904a3adf28a38d33c27a143da044cdab523'
  28.             '0306a521a1c072dc4ccf09c1ce6f7754ea581898f537d806e9716bfa404c4119f4b8f3dfd7fbf76ef11c0c03620333525a9166e4270ebad6f7756cdc547886d7'
  29.             'd0c787722be8f69205b0e6ed0bf79195c7a8b4a83ef0a4234955cd9caa64fed42e42ca0cfff7e71976d3b071fe650cd02fd8ad1af048d47f0c4d44065899f3e7')
  30.  
  31. build() {
  32.   cd "${srcdir}"
  33.  
  34.   msg "Checking git...."
  35.   if [ -d dolphin-emu-3.0 ] ; then
  36.     # To avoid any conflict, grab a fresh clone
  37.     msg "Removing old files"
  38.     rm -R -f dolphin-emu-3.0
  39.   fi
  40.  
  41.   msg "Cloning from GIT"
  42.   git clone https://code.google.com/p/dolphin-emu/ dolphin-emu-3.0
  43.   cd dolphin-emu-3.0
  44.  
  45.   #Checkout at the STABLE 3.0 Branch of the git
  46.   msg "Checking out at stable 3.0 branch"
  47.   git checkout 3.0
  48.  
  49.   msg "GIT checkout done or server timeout"
  50.  
  51.   # Apply SSE4.2 bugfix patch
  52.   patch -Np1 -i "${srcdir}/sse4.2_fix.patch"
  53.  
  54.   # Detect SSE 4.2 support
  55.   if $(grep sse4_2 /proc/cpuinfo > /dev/null); then
  56.     SSE4_2="-msse4.2"
  57.   else
  58.     SSE4_2=""
  59.   fi
  60.  
  61.   mkdir Build && cd Build
  62.  
  63.   export CFLAGS="-march=native -mtune=native ${SSE4_2} -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
  64.   export CXXFLAGS="-march=native -mtune=native ${SSE4_2} -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
  65.   export LDFLAGS="-Wl,-O3,--sort-common,--as-needed,-z,relro,--hash-style=gnu"
  66.  
  67.   cmake .. -DCMAKE_INSTALL_PREFIX=/usr
  68.   make -j8
  69. }
  70.  
  71. package() {
  72.   cd "${srcdir}/dolphin-emu-3.0/Build"
  73.  
  74.   make DESTDIR="${pkgdir}/" install
  75.  
  76.   install -Dm644 "${srcdir}/dolphin-emu.desktop" "${pkgdir}/usr/share/applications/dolphin-emu.desktop"
  77.   install -Dm644 "${srcdir}/Dolphin_Logo.png" "${pkgdir}/usr/share/pixmaps/dolphin-emu.png"
  78. }
  79.  

Posted by Xiao-Long Chen at 20 Dec 2011, 22:49:18 Europe/Berlin
Language: bash