summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e289a3977cb1f1bb1ab06a87c5f2cb55144b2d7f (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
pkgname=antiduplx-git
_pkgver=1.0.1
pkgver=1.0.1.r31.d597451
pkgrel=1
pkgdesc="Command line tool to find and remove similar pictures"
arch=('x86_64')
url="https://github.com/ermig1979/AntiDuplX"
license=(MIT)
depends=(
  gcc-libs
  glibc
  libjpeg-turbo
)
makedepends=(
  cmake
  git
  nasm
  ninja
)
source=(
  "$pkgname::git+$url.git"
  "git+https://github.com/ermig1979/Cpl.git"
  "git+https://github.com/ermig1979/Simd.git"
)
sha256sums=('SKIP'
            'SKIP'
            'SKIP')

pkgver() {
  cd "$pkgname"
  printf "%s.r%s.%s" "$_pkgver" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
  cd "$pkgname"
  git submodule init
  git config submodule.3rd/Cpl.url "$srcdir/Cpl"
  git config submodule.3rd/Simd.url "$srcdir/Simd"
  git -c protocol.file.allow=always submodule update -- "3rd/Cpl" "3rd/Simd"
}

build() {
  cd "$pkgname"

  cmake -B build -G Ninja -S ./prj/cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DADX_USE_SYSTEM_TURBOJPEG=ON

  cmake --build build
}

package() {
  cd "$pkgname"

  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

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