summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 99e29f6feb8636ac3989c1adcafe49a37820df7f (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
# Maintainer: pingplug < aur at pingplug dot me >

_pkgname=dlib
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

pkgname=mingw-w64-dlib
pkgver=19.24.6
pkgrel=1
pkgdesc="A general purpose cross-platform C++ library designed using contract programming and modern C++ techniques (mingw-w64)"
arch=('any')
url="http://dlib.net"
license=('custom')
depends=('mingw-w64-crt'
         'mingw-w64-cblas'
         'mingw-w64-lapack'
         'mingw-w64-libjpeg-turbo'
         'mingw-w64-libpng')
optdepends=('mingw-w64-ffmpeg: for FFmpeg support'
            'mingw-w64-giflib: for GIF support'
            'mingw-w64-libwebp: for WebP support'
            'mingw-w64-sqlite: for sqlite support')
makedepends=('mingw-w64-cmake')
options=('!strip' 'staticlibs' '!buildflags')
source=("https://codeload.github.com/davisking/dlib/tar.gz/refs/tags/v${pkgver}")
sha256sums=('22513c353ec9c153300c394050c96ca9d088e02966ac0f639e989e50318c82d6')

build() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  for _arch in ${_architectures}; do
    # shared
    ${_arch}-cmake \
      -DBUILD_SHARED_LIBS:BOOL=ON \
      -DUSE_AVX_INSTRUCTIONS=OFF \
      -DDLIB_USE_CUDA=OFF \
      -B build-${_arch}-shared -S .
    make -C build-${_arch}-shared
    # static
    ${_arch}-cmake \
      -DBUILD_SHARED_LIBS:BOOL=OFF \
      -DUSE_AVX_INSTRUCTIONS=OFF \
      -DDLIB_USE_CUDA=OFF \
      -B build-${_arch}-static -S .
    make -C build-${_arch}-static
  done
}

package() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  for _arch in ${_architectures}; do
    make DESTDIR=${pkgdir} install -C build-${_arch}-static
    make DESTDIR=${pkgdir} install -C build-${_arch}-shared
    mv "${pkgdir}/usr/${_arch}/lib/cmake/dlib/"{dlib,dlib-static}.cmake
    pushd "${pkgdir}/usr/${_arch}/lib/cmake/dlib/"
    ln -s dlib-static.cmake dlib.cmake
    popd
    ${_arch}-strip --strip-unneeded "${pkgdir}/usr/${_arch}/bin/"*.dll
    ${_arch}-strip -g "${pkgdir}/usr/${_arch}/lib/"*.a
  done
  install -Dm644 dlib/LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim:set ts=2 sw=2 et: