summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ffd9e1eb62f740407e9376dddd53cf864bfc4890 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer : Daniel Bermond < gmail-com: danielbermond >
# Contributor: John Jenkins <twodopeshaggy@gmail.com>

pkgname=flif-git
pkgver=0.3.r96.g74ea92b
pkgrel=3
pkgdesc='Free Lossless Image Format (git version)'
arch=('x86_64')
url='https://github.com/FLIF-hub/FLIF/'
license=('LGPL3' 'Apache')
depends=('gcc-libs' 'libpng' 'sdl2' 'gdk-pixbuf2' 'glib2')
makedepends=('git')
optdepends=(
    # official repositories:
        'imagemagick: for gif2flif tool'
    # AUR:
        'apng-utils: for apng2flif tool'
)
provides=('flif')
conflicts=('flif')
source=('git+https://github.com/FLIF-hub/FLIF.git'
        'flif-git-fix-makefile-target-install-pixbufloader.patch'
        'flif-git-remove-apt-get-references-from-tools.patch')
sha256sums=('SKIP'
            '4d166a2f462b6d250202f6adf3b7280871fe98bc5385a851135d2473785d5399'
            'c516d92d4724e319af79bb1ac5d3dde81dac359fd4a02af1ee71239a49d58710')

prepare() {
    cd FLIF
    
    # fix Makefile target install-pixbufloader
    patch -Np1 -i "${srcdir}/flif-git-fix-makefile-target-install-pixbufloader.patch"
    
    # remove apt-get references from installed tools
    patch -Np1 -i "${srcdir}/flif-git-remove-apt-get-references-from-tools.patch"
}

pkgver() {
    cd FLIF
    
    # git, tags available
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
}

build() {
    cd FLIF/src
    
    make all decoder viewflif pixbufloader test-interface
    
}

check() {
    cd FLIF/src
    
    local _image
    local -a _images
    mapfile -t -d '' _images < <(find "${srcdir}/FLIF/testFiles" -type f -print0)
    
    export LD_LIBRARY_PATH="${srcdir}/FLIF/src"
    
    for _image in "${_images[@]}"
    do
        printf '%s\n' "  -> Testing with image '${_image##*/}'..."
        ./test-interface "$_image"
    done
}

package() {
    cd FLIF/src
    
    make PREFIX="${pkgdir}/usr" install{,-dev}
    make PREFIX="${pkgdir}/usr" install{-decoder,-viewflif,-pixbufloader}
    
    # mime type for pixbuf loader
    install -D -m644 flif-mime.xml -t "${pkgdir}/usr/share/mime/packages"
}