summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 264f9a3798ac7e09189647ecb1744bb744efaec0 (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
# Maintainer:  Marcell Meszaros < marcell.meszaros AT runbox.eu >
# Contributor: aksr <aksr at t-com dot me>

_distname=sudoku
_dist_owner=wimleers
pkgname="${_distname}-git"
pkgver=1.0.r2.g2489c02
pkgrel=4
pkgdesc="Sudoku app written in C++/Qt."
arch=('i686' 'x86_64')
url="https://wimleers.com/project/work/${_distname}"
_repourl="https://github.com/${_dist_owner}/${_distname}"
license=('Unlicense')
depends=(
  'gcc-libs'
  'glibc'
  'qt4'
)
makedepends=(
  'gendesk'
  'git'
)
provides=("${_distname}=${pkgver%.r*}")
conflicts=("${_distname}")
_clonedirname="${_distname}-${_dist_owner}"
source=("${_clonedirname}::git+${_repourl}.git")
b2sums=('SKIP')

prepare() {
  echo "Pathching to increase max difficulty level to 6..."
  sed -e 's/static int NumLevels(void) { return 5; }/static int NumLevels(void) { return 6; }/' \
      -i "${_clonedirname}/src/Sudoku.h"
  echo "Done."

  gendesk -n -f \
          --pkgname "${_distname}" \
          --pkgdesc "${pkgdesc}" \
          --name "Sudoku (Qt4)" \
          --icon "${_distname}-qt" \
          --genericname "Sudoku Game" \
          --exec "/usr/bin/${_distname} %u" \
          --categories "Game;Sudoku"
}

pkgver() {
  cd "${_clonedirname}"
  git describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g;s/^v//g'
}

build() {
  cd "${_clonedirname}/src"
  qmake-qt4 Sudoku_release.pro
  make
}

package() {
  cd "${_clonedirname}"
  install -Dm755 src/Sudoku "${pkgdir}/usr/bin/${_distname}"
  install -Dm644 "../${_distname}.desktop" -t "${pkgdir}/usr/share/applications/"
  install -Dm644 src/resources/images/icon.png "${pkgdir}/usr/share/icons/${_distname}-qt.png"
}