summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4c967d0471f797243b3502cedccdc92509e00764 (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
# Maintainer: Sergey A <murlakatamenka@disroot.org>

# shellcheck shell=bash
# shellcheck disable=SC2034,SC2164

pkgname=hdiff
pkgver=4.8.0
pkgrel=1
pkgdesc='C/C++ library and CLI tool for Diff & Patch between binary files or directories'
arch=('x86_64' 'aarch64' 'i686' 'armv7h')
url='https://github.com/sisong/HDiffPatch'
license=('MIT')
depends=('zlib' 'bzip2' 'zstd') #  zlib and bzip2 are in base
makedepends=('zlib' 'bzip2' 'zstd')
provides=('hdiffpatch')
conflicts=('hdiffpatch-bin')
source=("$pkgname-$pkgver.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz"
)
sha256sums=('01c526132a183e31b62b435cf80e769e44be6ac1e827e0ee405786e6cf48f013')

prepare() {
  git clone --depth=1 https://github.com/sisong/libmd5.git ./libmd5
  git clone --depth=1 https://github.com/sisong/lzma.git ./lzma
}

build() {
  cd "HDiffPatch-$pkgver"

  make ZSTD=2 LDEF=0 ZLIB=2
}

package() {
  cd "HDiffPatch-$pkgver"

  install -Dm 755 ./hdiffz -t "$pkgdir/usr/bin"
  install -Dm 755 ./hpatchz -t "$pkgdir/usr/bin"

  install -Dm 644 ./LICENSE -t "$pkgdir/usr/share/licenses/${pkgname}"
}