summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 43eacdd1af2cb2f642c07049d63df808936ae3d5 (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
# Maintainer: Dmitry Lyashuk <lyashuk.voxx at gmail dot com>
pkgname=doom2df-editor-qt5
pkgver=0.667
pkgrel=5
pkgdesc="Official map editor for Doom 2D: Forever, qt5 version."
arch=(x86_64 i686)
url="https://doom2d.org/"
license=('GPL3')
group=(doom2df-full)
depends=(doom2df-res qt5-base qt5-imageformats qt5-networkauth qt5-x11extras libjpeg-turbo libpng gdk-pixbuf2 libxcb libx11 libgl)
makedepends=(git fpc lazarus lazarus-qt5 qt5pas)
optdepends=('doom2df-bin: for testing/playing')
provides=(doom2df-editor)
conflicts=(doom2df-editor-gtk2 doom2df-editor-qt4)
source=(
  'git://repo.or.cz/d2df-editor.git'
  'doom2df-editor.desktop'
  'doom2df-editor.png'
  'Doom2DF_E'
)
md5sums=(
  'SKIP'
  '6e002827b10502fb00feab7d64a021f1'
  '1ad21e89200ff2bdcae68935b43f53fd'
  '8dfb08b8e31386b612156db8e61a0fde'
)
options=(
  !strip
)


prepare(){
  cd "${srcdir}/d2df-editor"
  
  BIN="$PWD/bin"
  TMP="$PWD/tmp"

  # Check directories bin and tmp and remove them for normal rebuilding
  if [ -d "$BIN" ]; then
    		rm -r bin
  else
    	echo "Here we go"
	fi;


  if [ -d "$TMP" ]; then
    		rm -r tmp
  else
    	echo "Here we go"
	fi;

  # Make these directories
  mkdir bin
  mkdir tmp
}


build() {

  # Before building the editor, copy lang files
  cd "${srcdir}/d2df-editor/"
  	cp "lang/"*".lng" "${srcdir}"

  # Export environment variable before building
  export D2DF_BUILD_HASH="$(git rev-parse HEAD)"
  
  cd "src/editor"
    lazbuild --ws=qt5 --bm=Debug Editor.lpi
  
  cd ../../bin
  cp editor ../../
  
}


package() {
  cd "${srcdir}"
  install -Dm755 editor "${pkgdir}"/usr/bin/editor
  install -Dm755 Doom2DF_E "${pkgdir}"/usr/bin/Doom2DF_E
  install -Dm644 doom2df-editor.desktop "${pkgdir}"/usr/share/applications/doom2df-editor.desktop
  install -Dm644 doom2df-editor.png "${pkgdir}"/usr/share/pixmaps/doom2df-editor.png
  install -Dm644 editor.ru_RU.lng "${pkgdir}"/usr/share/doom2df/data/lang/editor.ru_RU.lng
}