summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e566b478280318ef9daab41fab25965e8c954833 (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
pkgname=scantailor-advanced-git
pkgver=v1.0.18.r16.gdc6f160
pkgrel=2
pkgdesc="Interactive post-processing tool for scanned pages that merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and fixes. "
arch=("x86_64")
#url="https://github.com/4lex4/scantailor-advanced"
url="https://github.com/ScanTailor-Advanced/scantailor-advanced"
license=("GPL3")
depends=(
    "boost-libs"
    "libjpeg"
    "libpng"
    "libtiff"
    "qt5-base"
    "zlib"
    )
makedepends=(
    "boost"
    "cmake"
    "qt5-tools"
    "qt5-svg"
    )
provides=("scantailor")
conflicts=("scantailor-advanced" "scantailor")
#source=("scantailor-advanced::git+https://github.com/4lex4/scantailor-advanced")
source=("scantailor-advanced::git+https://github.com/ScanTailor-Advanced/scantailor-advanced.git")

sha256sums=('SKIP')

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

build() {
    export LDFLAGS="-L/usr/local/lib,--rpath=/usr/local/lib"
    export LD_LIBRARY_PATH="/usr/local/lib"
    export CFLAGS="-fPIC"
    export CXXFLAGS="-fPIC"

    cd "${srcdir}/${pkgname%-git}"
    sed -i "s/#define VERSION .*$/#define VERSION \"$pkgver\"/" version.h.in
    # https://aur.archlinux.org/packages/scantailor-advanced-git/#comment-831404
    mkdir build && cd build
    cmake -G "Unix Makefiles" ..
    cmake --build .
    make
}

package() {
    cd "${srcdir}/${pkgname%-git}"
    cd build
    make DESTDIR="${pkgdir}" install
}