summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 18aba76ea1d8e48cfc8e619a6699abbb39d98785 (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
# Maintainer:  vitor_hideyoshi <vitor.h.n.batista at gmail dot com>
# Contributor: Ilias Stamatis <stamatis.iliass at gmail dot com>, Saren Arterius <saren at wtako dot net>
# Contributor: Panagiotis Mavrogiorgos (pmav99) <> (gmail)

pkgname=snapper-gui-git
pkgver=0.1+8.r132.20220626.1915750
pkgrel=1
pkgdesc="Gui for snapper, a tool of managing snapshots of Btrfs subvolumes and LVM volumes"
arch=(any)
url="https://github.com/ricardomv/snapper-gui"
license=('GPL2')
depends=(
    'python3'
    'gtk3'
    'python-dbus'
    'python-gobject'
    'python-setuptools'
    'gtksourceview3'
    'snapper'
)
optdepends=(
    'gksu: Access snapper-gui from application menu under GTK-base DE'
    'kdesu: Access snapper-gui from application menu under KDE'
)
makedepends=('git')
provides=('snapper-gui')
conflicts=('snapper-gui')
install=snapper-gui.install
source=(
    "${pkgname}::git+https://github.com/ricardomv/snapper-gui.git"
    "python3.11-diff-fix.patch::https://patch-diff.githubusercontent.com/raw/ricardomv/snapper-gui/pull/59.patch"
)
sha256sums=(
    'SKIP'
    '2770d1ef054c1e089af72d3779e65fcaa33b7fab54eab57e31cfd3ebab6b96e9'    
)

prepare() {
  cd "$pkgname"

  for _patch in "${srcdir}/python3.11-diff-fix.patch"; do
    msg2 "Applying patch '$(basename "${_patch}")' ..."
    patch -Np1 --follow-symlinks -i "${_patch}"
  done
}

pkgver() {
    cd "$pkgname"

    _ver="$(git describe --tags | sed -E -e 's|^[vV]||' -e 's|\-g[0-9a-f]*$||' | tr '-' '+')"
    _rev="$(git rev-list --count HEAD)"
    _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
    _hash="$(git rev-parse --short HEAD)"

    if [ -z "${_ver}" ]; then
        error "Version could not be determined."
        return 1
    else
        printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
    fi
}

package() {
    cd "$pkgname"
    python setup.py install --root="${pkgdir}/" --optimize=1
}