summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 56ff01373f870809165345b0955413dd2d75206c (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
# Contributor: Petteri Tolonen <petteri dot tolonen at gmail dot com>
# Contributor: erm67
# Contributor: JD Steffen

pkgname=hexen2
pkgver=1.5.9
_gamecodever=1.29b
pkgrel=1
pkgdesc="Hammer of Thyrion: Raven Software's Hexen II source port (based on Anvil of Thyrion)"
arch=('i686' 'x86_64')
url="http://uhexen2.sourceforge.net/"
license=('GPL2')
depends=('bash' 'libmad' 'libvorbis' 'sdl')
makedepends=('nasm')
provides=('hexenworld')
install=hexen2.install
source=("http://downloads.sourceforge.net/uhexen2/hexen2source-$pkgver.tgz"
        "http://downloads.sourceforge.net/uhexen2/hexen2source-gamecode-$pkgver.tgz"
        "http://downloads.sourceforge.net/uhexen2/hexenworld-pakfiles-0.15.tgz"
        "hexen2.desktop"
        "hexen2.sh")
sha256sums=('2aa84c141a820f9087850aacf3684a5f71c434428bc57545899eda1b9a28c3e0'
            '15188ecace6f8431af88d096aae2c4ff9e41c0e1b3e107eee0c4f5f9d09d34bb'
            '49462cdf984deee7350d03c7d192d1c34d682647ffc9d06de4308e0a7c71c4d9'
            'fa0bde060ba3afda3683b96d7ece23161816a04a2365ba996c1cb07268d6580f'
            '9882421ee54afa4995c11e3759ab7fffb59a448291f0d647b3857d43b5cf27a9')

prepare() {
  sed 's|^hexen2dir=.*$|hexen2dir=/opt/hexen2|' -i hexen2source-$pkgver/scripts/hexen2-run.sh
}

build() {
  cd hexen2source-$pkgver

  # main game
  make -C engine/hexen2 h2
  make -s -C engine/hexen2 localclean
  make -C engine/hexen2 glh2
  make -s -C engine/hexen2 localclean

  # dedicated server
  make -C engine/hexen2/server

  # HexenWorld
  make -C engine/hexenworld/server
  make -s -C engine/hexenworld/client localclean
  make -C engine/hexenworld/client hw
  make -s -C engine/hexenworld/client localclean
  make -C engine/hexenworld/client glhw

  # HexenWorld master server
  make -C hw_utils/hwmaster

  # h2patch
  make -C h2patch

  # hcode compiler
  make -C utils/hcc

  # game-code
  utils/hcc/hcc -src ../gamecode-$_gamecodever/hc/h2 -os
  utils/hcc/hcc -src ../gamecode-$_gamecodever/hc/h2 -os -name progs2.src
  utils/hcc/hcc -src ../gamecode-$_gamecodever/hc/portals -os -oi -on
  utils/hcc/hcc -src ../gamecode-$_gamecodever/hc/hw -os -oi -on
  #utils/hcc/hcc -src ../gamecode-$_gamecodever/hc/siege -os -oi -on
}

package() {
  cd hexen2source-$pkgver

  install -d "$pkgdir"/opt/$pkgname

  # executables
  install -m755 engine/hexen2/{gl,}hexen2 engine/hexen2/server/h2ded \
    engine/hexenworld/client/{gl,}hwcl engine/hexenworld/server/hwsv \
    hw_utils/hwmaster/hwmaster "$pkgdir"/opt/$pkgname
  install -Dm755 h2patch/h2patch  "$pkgdir"/usr/bin/h2patch

  # run and cd-rip scripts
  install -m755 scripts/hexen2-run.sh scripts/cdrip_*.sh "$pkgdir"/opt/$pkgname

  # launchers
  for _b in glhexen2 hexen2 h2ded glhwcl hwcl hwsv; do
    ln -s /opt/$pkgname/hexen2-run.sh "$pkgdir"/usr/bin/$_b
  done

  # docs
  (cd docs
    install -d "$pkgdir"/opt/$pkgname/docs
    install -m644 -t "$pkgdir"/opt/$pkgname/docs ABOUT AUTHORS BUGS CHANGES* TODO Features \
      README README.music README.3dfx README.h* ReleaseNotes* SrcNotes.txt
  )

  cd ..

  # gamedata
  (cd gamecode-$_gamecodever
    install -d "$pkgdir"/opt/$pkgname/data1
    install -m644 hc/h2/*.dat res/h2/* "$pkgdir"/opt/$pkgname/data1
    install -d "$pkgdir"/opt/$pkgname/portals
    install -m644 hc/portals/*.dat res/portals/* "$pkgdir"/opt/$pkgname/portals
    install -d "$pkgdir"/opt/$pkgname/hw
    install -m644 hc/hw/*.dat res/hw/* "$srcdir"/hw/pak4.pak "$pkgdir"/opt/$pkgname/hw

    # ent fixes (handling map quirks)
    install -d "$pkgdir"/opt/$pkgname/{data1,portals}/maps
    install -m644 mapfixes/data1/maps/* "$pkgdir"/opt/$pkgname/data1/maps
    install -m644 mapfixes/portals/maps/* "$pkgdir"/opt/$pkgname/portals/maps

    # xdelta updates
    install -d "$pkgdir"/opt/$pkgname/patchdat/data1
    install -m644 patch111/patchdat/data1/* "$pkgdir"/opt/$pkgname/patchdat/data1
    install -m644 patch111/patchdat.txt "$pkgdir"/opt/$pkgname
  )

  # .desktop entry
  install -Dm644 hexen2source-$pkgver/engine/resource/hexen2.png "$pkgdir"/usr/share/pixmaps/hexen2.png
  install -Dm644 $pkgname.desktop "$pkgdir"/usr/share/applications/$pkgname.desktop
}