summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2afab0c0c860587eadd1390f782d6803f721837b (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
# Maintainer: epitron <chris AT ill-logic.com>

pkgname=ansilove-git
pkgver=3.0.9.r20.g9fad130
pkgrel=1
pkgdesc='Program and shared library to converts ANSI and artscene related file formats into PNG images'
url='https://ansilove.org/'
license=('BSD')
depends=('gd')
makedepends=('git' 'cmake' 'gcc')
provides=('ansilove')
conflicts=('ansilove')
arch=('x86_64' 'i686')
source=(
  'git+https://github.com/ansilove/libansilove.git'
  'git+https://github.com/ansilove/ansilove.git'
)
sha256sums=(
  'SKIP'
  'SKIP'
)

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

build() {
  # shared library
  mkdir "${srcdir}/libansilove/build"
  cd "${srcdir}/libansilove/build"

  cmake .. \
    -DBUILD_SHARED_LIBS=OFF \
    -DCMAKE_INSTALL_PREFIX:PATH="${pkgdir}/usr"
  make

  # executable
  mkdir "${srcdir}/ansilove/build"
  cd "${srcdir}/ansilove/build"

  cmake .. \
    -DANSILOVE_INCLUDE_DIRS="${srcdir}/libansilove/include/" \
    -DANSILOVE_LIBRARIES="${srcdir}/libansilove/build/libansilove.so" \
    -DCMAKE_INSTALL_PREFIX:PATH="${pkgdir}/usr"
  make
}

package() {
  cd "${srcdir}/libansilove/build"
  make install

  cd "${srcdir}/ansilove/build"
  make install

  install -Dm644 "${srcdir}/ansilove/LICENSE" "${pkgdir}/usr/share/licenses/ansilove/LICENSE"
  install -Dm644 "${srcdir}/ansilove/README.md" "${pkgdir}/usr/share/doc/ansilove/README.md"
}