summaryrefslogtreecommitdiff
path: root/libre/qutebrowser/PKGBUILD
blob: e246c460c539210ad15630322415dc3c03af2bd6 (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
77
78
79
80
81
82
# Maintainer (Arch): Morten Linderud <foxboron@archlinux.org>
# Contributor (Arch): Pierre Neidhardt <ambrevar@gmail.com>
# Contributor (Arch): Florian Bruhin (The Compiler) <archlinux.org@the-compiler.org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: André Silva <emulatorman@hyperbola.info>

# parabola changes and rationale:
#  - removed qt5-webengine dependency
#  - set webkit backend as default

pkgname=qutebrowser
_pkgver_armv7h=1.11.0 # this could be an 'any' package
_pkgver_i686=1.11.0   # but our different arches do not always roll at the same speed
_pkgver_x86_64=1.11.0
eval "pkgver=\$_pkgver_${CARCH}"
pkgrel=1
pkgrel+=.par1
pkgdesc="A keyboard-driven, vim-like browser based on PyQt5"
pkgdesc+=" and QtWebKit, without nonfree qt5-webengine recommendation"
arch=('armv7h' 'i686' 'x86_64')
url="https://www.qutebrowser.org/"
license=("GPL")
depends=("python-attrs" "python-jinja" "python-pygments" "python-pypeg2"
         "python-pyqt5" "python-yaml" "qt5-base" "qt5-webkit")
makedepends=("asciidoc" "python-setuptools")
optdepends=("gst-libav: media playback with qt5-webkit backend"
            "gst-plugins-base: media playback with qt5-webkit backend"
            "gst-plugins-good: media playback with qt5-webkit backend"
            "gst-plugins-bad: media playback with qt5-webkit backend"
            "gst-plugins-ugly: media playback with qt5-webkit backend"
            "pdfjs: displaying PDF in-browser")
options=(!emptydirs)
source=("https://github.com/qutebrowser/qutebrowser/releases/download/v$pkgver/qutebrowser-$pkgver.tar.gz"
        "https://github.com/qutebrowser/qutebrowser/releases/download/v$pkgver/qutebrowser-$pkgver.tar.gz.asc"
        "webkit-warning.patch")
validpgpkeys=("E04E560002401B8EF0E76F0A916EB0C8FD55A072") # Florian Bruhin
_sha256sums_x86_64=('e2ed9d56aa5db8a0865f7a18d5d0d796d48db161d9c04c03a935dd95e2a4182c'
                    'SKIP'
                    '41da24c74fca7a716a672bab2924e7c1de8e83ad4bdcec3b0ba055baba6459f2')
_sha256sums_i686=('e2ed9d56aa5db8a0865f7a18d5d0d796d48db161d9c04c03a935dd95e2a4182c'
                  'SKIP'
                  '41da24c74fca7a716a672bab2924e7c1de8e83ad4bdcec3b0ba055baba6459f2')
_sha256sums_armv7h=('e2ed9d56aa5db8a0865f7a18d5d0d796d48db161d9c04c03a935dd95e2a4182c'
                    'SKIP'
                    '41da24c74fca7a716a672bab2924e7c1de8e83ad4bdcec3b0ba055baba6459f2')
eval "sha256sums=(\${_sha256sums_${CARCH}[@]})"


_version_constraint() # (dep_pkgname)
{
  local dep_pkgname=$1
  local version=$(pacman -S --print-format='%v' ${dep_pkgname} | tail -n 1)
  version=${version%-*}
  local version_inc=${version%.*}.$(( ${version##*.} + 1 ))

  echo -n "${dep_pkgname}>=${version}" "${dep_pkgname}<${version_inc}"
}

prepare() {
  cd "$pkgname-$pkgver"

  patch -Np1 < $srcdir/webkit-warning.patch
}

build() {
    cd "$pkgname-$pkgver"

    # make sure webkit is the default backend
    sed -i 's/webengine/webkit/' qutebrowser/config/configdata.yml

    make -f misc/Makefile all
}

package() {
    cd "$pkgname-$pkgver"

    depends+=( $(_version_constraint 'python'      ) \
               $(_version_constraint 'python-pyqt5') \
               $(_version_constraint 'qt5-base'    ) )

    make -f misc/Makefile DESTDIR="$pkgdir" PREFIX=/usr install
}