summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 042a2444e0d698dfe90a4ffe9fb65963f78bd004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: farseerfc <farseerfc@archlinuxcn.org>
# Contributor:	refujee		<gmail.com: refujee>
# Contributor:	sausageandeggs	<archlinux.us: sausageandeggs>
# Maintainer:	Jesse Jaara	<gmail.com: jesse.jaara>

# Set to 'y' if you want native optimizations (-march=native)
# based on your hardware. Enabled automatically if -march
# is set to native in makepkg.conf.
NATIVE_OPTIMIZATIONS=n



pkgname=powder-toy
_sver=91
_mver=3
_build=328
pkgver=${_sver}.${_mver}
pkgrel=1
pkgdesc="Desktop version of the classic falling sand physics sandbox, simulates air pressure, velocity & heat!"
arch=(i686 x86_64)
depends=('sdl' 'lua52' 'fftw' 'bzip2' 'zlib')
makedepends=('python2' 'scons')
url="http://powdertoy.co.uk/"
license=('GPL3')
source=(http://github.com/FacialTurd/The-Powder-Toy/archive/v${_sver}.${_mver}.${_build}.tar.gz
	${pkgname}.desktop ${pkgname}.png)

prepare() {
  cd "${srcdir}/The-Powder-Toy-${_sver}.${_mver}.${_build}"

  #Disable the updates. I cant get the buildsystem to not compile a beta version.
  #Also I do not know the logic behind the generated snapshotids.
  sed 's|//#define I|#define I|' -i src/Config.h

}

build() {
  unset _xarch _ssever _native
  cd "${srcdir}/The-Powder-Toy-${_sver}.${_mver}.${_build}"

  if $(grep -q 'pni' -i /proc/cpuinfo); then
    _ssever="sse3"
  elif $(grep -q sse2 -i /proc/cpuinfo); then
    _ssever="sse2"
  else
    _ssever="sse"
  fi

#  if [ NATIVE_OPTIMIZATIONS == "y"  ] || $(echo ${CXXFLAGS} | grep -q -- "-march=native"); then
#    _native="--native"
#  fi

  if [ "${CARCH}" == "x86_64" ]; then
    _xarch="--64bit"
  fi

  msg2 "building powder with options with following extra flags ${_xarch} --${_ssever} ${_native}"
  scons --lin ${_xarch} --release --${_ssever} ${_native} --save-version=${_sver} \
	--minor-version=${_mver} --build-number=${_build} ${MAKEFLAGS} \
    --lua52

  mv build/{powder*,binary}
}

package() {
  install -Dm 755 "${srcdir}/The-Powder-Toy-${_sver}.${_mver}.${_build}/build/binary" "${pkgdir}/usr/bin/powder-toy"
  install -Dm 644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  install -Dm 644 "${srcdir}/${pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
}

md5sums=('7a052607201e97f295fb19db6198863a'
         '8901d334c53c04738cbd3518c80fa37c'
         'bb40bf9c2fa3982e2872b5d32de3b006')