summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e069b9b5661ce6b53159cd592be94be6de9e02ae (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
# Maintainer: Reihar <reihar@necronomicon.fr>
# Contributor: Nick Hu <nickhu00@gmail.com>
# Contributor: Fernando Carmona Varo <ferkiwi @t gmail dot com>
pkgname=cataclysm-dda-ncurses
pkgver=0.C
pkgrel=3
pkgdesc="Cataclysm: Dark Days Ahead is an actively maintained roguelike set in a post-apocalyptic world, forked from the original. (ncurses only)"
arch=('i686' 'x86_64')
url="http://www.cataclysmdda.com/"
license=('CCPL:by-sa')

depends=('glibc' 'gcc-libs' 'sh' 'ncurses')
makedepends=('gettext' 'clang')
optdepends=('lua51')
conflicts=('cataclysm-dda' 'cataclysm-dda-git' 'cataclysm-dda-ncurses-bin')

install='cataclysm-dda-ncurses.install'
source=("https://github.com/CleverRaven/Cataclysm-DDA/archive/${pkgver}.tar.gz"
       'clang36.patch::https://github.com/narc0tiq/Cataclysm-DDA/commit/2e12a15fdbb32b5941d597e3cc774030445d483a.patch')
sha256sums=('69e947824626fffb505ca4ec44187ec94bba32c1e5957ba5c771b3445f958af6'
            '806cbb61ad27b112e4343112ab6281178f490f8d3041da5c510af9ae6dea7578')

prepare() {
  #We need to "patch" cataclysm for it to build with clang>=3.6.
  #This will be corrected in the next release version.
  #See https://github.com/CleverRaven/Cataclysm-DDA/issues/11805 for details.
  cd "$srcdir/Cataclysm-DDA-${pkgver}"
  patch -Np1 -i $srcdir/clang36.patch
}

build() {

  #Due to build problems with gcc, we'll be using clang for a while
  cd "$srcdir/Cataclysm-DDA-${pkgver}"
  make USE_HOME_DIR=1 CLANG=1 RELEASE=1
}

package() {
  cd "$srcdir/Cataclysm-DDA-${pkgver}"

  local instdir=/usr/share/cataclysm-dda

  install -dm755 "$pkgdir/${instdir}/"{data,gfx}
  cp -r --no-preserve=ownership data gfx "$pkgdir/${instdir}/"


  local instdir="/usr/share/cataclysm-dda"

  install -dm755 "$pkgdir/${instdir}/"
  install -Dm755 cataclysm cataclysm-launcher "$pkgdir/${instdir}/"
  install -dm755 data "$pkgdir/${instdir}/"

  #The doc goes in /usr/share/doc  
  install -dm755 "$pkgdir/usr/share/doc/cataclysm-dda"
  unlink doc/JSON_LOADING_ORDER.md
  cp -T data/json/LOADING_ORDER.md doc/JSON_LOADING_ORDER.md
  cp -r *.txt doc/* "$pkgdir/usr/share/doc/cataclysm-dda/"
  
  # License file
  install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"

  #Launcher symlinks
  install -dm755  "$pkgdir/usr/bin/"
  ln -s "${instdir}/cataclysm-launcher" "$pkgdir/usr/bin/cataclysm"

  # Localization
  install -dm755 "$pkgdir/usr/share/locale"
  LOCALE_DIR="$pkgdir/usr/share/locale" lang/compile_mo.sh
}