summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 870c07ac7dff1b37359c7f71203d58c4f6d0a3a8 (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
# Maintainer: Dmitry Lyashuk <lyashuk.voxx at gmail dot com>
pkgname=doom2df-bin
pkgver=0.667
pkgrel=17
pkgdesc="Doom-themed platformer with network play (binaries-only)"
arch=(x86_64 i686)
url="https://doom2d.org/"
license=('GPL3')
group=(doom2df-full)
depends=(doom2df-res sdl2 sdl2_mixer enet libgl openal xmp libxmp libvorbis opus opusfile libgme timidity miniupnpc)
makedepends=(git fpc)
optdepends=('doom2df-editor: map editor for game')
provides=(doom2df)
conflicts=(doom2df-git doom2df-bin-git)
source=(
  'git://repo.or.cz/d2df-sdl.git'
  'doom2df.desktop'
  'doom2df.png'
  'd2df.1.gz'
  'd2df.2.gz'
  'd2df.3.gz'
  'd2df.1.ru.gz'
  'd2df.2.ru.gz'
  'd2df.3.ru.gz'
)
noextract=(
  'd2df.1.gz'
  'd2df.2.gz'
  'd2df.3.gz'
  'd2df.1.ru.gz'
  'd2df.2.ru.gz'
  'd2df.3.ru.gz'
)
md5sums=(
  'SKIP'
  'a529aca738b79f2099fcef6e583fbed3'
  '191cd29a6994ab257abf6c0b1060b2fd'
  # EN Mans
  '9da12c0a777cd8a745b2436369776a02'
  'ee3d8d3d1e7d0ae9da36e11cf5d168d6'
  '5f37c2b20c47cff25305f845df60083b'
  # RU Mans
  '1e7fc56216ab37431ef6e132bc9af63a'
  '3c879d3f024daaf43746ef716a98ab88'
  '6cfe33776879b82f042a9525fcd893cd'
)
options=(
  !strip
)
install=doom2df-bin.install


prepare(){
  cd "${srcdir}/d2df-sdl"
  
  # Create some environment for build
  mkdir tmp
}


build() {
  # Export environment variable before building
  cd "${srcdir}/d2df-sdl/"
  export D2DF_BUILD_HASH="$(git rev-parse HEAD)"

  git submodule update --init
  cd "src/game"

  # First - main graphical binary with openal sound system
  fpc -g -gl -FU../../tmp -dUSE_SDL2 -dUSE_OPENGL -dUSE_OPENAL -dUSE_SDL2 -dUSE_VORBIS -dUSE_MODPLUG -dUSE_XMP -dUSE_MPG123 -dUSE_OPUS -dUSE_GME -dUSE_MINIUPNPC Doom2DF.lpr

  # If you want to build with a sdl_mixer, comment out the line above and uncomment the bottom line.
  #fpc -g -gl -FU../../tmp -dUSE_SDL2 -dUSE_OPENGL -dUSE_SDLMIXER -dUSE_MINIUPNPC Doom2DF.lpr

  # Clearing tmp
  rm -r ../../tmp && mkdir ../../tmp

  # Second - headless binary (for dedicated server)
  fpc -g -gl -FU../../tmp -dUSE_SYSSTUB -dUSE_SDLMIXER -dUSE_MINIUPNPC -dHEADLESS -oDoom2DF_H Doom2DF.lpr

  cp Doom2DF ../../../
  cp Doom2DF_H ../../../
}


package() {
  cd "${srcdir}"
  install -Dm755 Doom2DF "${pkgdir}"/usr/bin/Doom2DF
  install -Dm755 Doom2DF_H "${pkgdir}"/usr/bin/Doom2DF_H
  install -Dm644 doom2df.desktop "${pkgdir}"/usr/share/applications/doom2df.desktop
  install -Dm644 doom2df.png "${pkgdir}"/usr/share/pixmaps/doom2df.png
  install -Dm644 d2df.1.gz "${pkgdir}"/usr/share/man/man1/d2df.1.gz
  install -Dm644 d2df.2.gz "${pkgdir}"/usr/share/man/man2/d2df.2.gz
  install -Dm644 d2df.3.gz "${pkgdir}"/usr/share/man/man3/d2df.3.gz
  install -Dm644 d2df.1.ru.gz "${pkgdir}"/usr/share/man/ru/man1/d2df.1.gz
  install -Dm644 d2df.2.ru.gz "${pkgdir}"/usr/share/man/ru/man2/d2df.2.gz
  install -Dm644 d2df.3.ru.gz "${pkgdir}"/usr/share/man/ru/man3/d2df.3.gz
}