123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- # Maintainer (arch): Morten Linderud <foxboron@archlinux.org>
- # Maintainer (arch): Lukas Fleischer <lfleischer@archlinux.org>
- # Contributor: Pierre Neidhardt <ambrevar@gmail.com>
- # Contributor: Florian Bruhin (The Compiler) <archlinux.org@the-compiler.org>
- # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
- # Contributor: André Silva <emulatorman@hyperbola.info>
- # Contributor: bill-auger <bill-auger@programmer.net>
- # parabola changes and rationale:
- # - removed 'qt5-webengine' dependency
- # - set webkit backend as default
- # - condensed the excessive webkit rant on the welcome screen
- # - pin to strongly-coupled dependency versions
- # NOTE: Arch has no QT webkit. Parabola retains 'qt5-webkit' primarily
- # to support 'qutebrowser'.
- # Qt5 and webkit are supported upstream; but that may change.
- # Watch https://github.com/qutebrowser/qutebrowser/issues/4039
- # especiallly, WRT movableink/webkit + mnutt/PyQt6-QtWebKit.
- # NOTE: for each 'qt5-base' N.N.N release, build order:
- # (qt5-base-N.N.N) <- qt5-webkit <- python-pyqt5 <- qutebrowser
- # NOTE: for each ''python N.N release, build order:
- # (python-N.N) <- python-pyqt5 <- qutebrowser
- pkgname=qutebrowser
- pkgver=3.3.1
- pkgrel=2
- pkgrel+=.parabola1
- pkgdesc="A keyboard-driven, vim-like browser based on Python and Qt"
- pkgdesc+="/QtWebKit"
- arch=("any")
- arch=(armv7h i686 x86_64) # for per arch version constraints
- url="https://www.qutebrowser.org/"
- license=("GPL-3.0-only")
- depends=("python-jinja" "python-pyqt6" "python-yaml" "qt6-base" "python-pyqt6-webengine")
- depends=( ${depends[*]/python-pyqt6-webengine/qt5-webkit} )
- depends=( ${depends[*]/python-pyqt6/python-pyqt5} )
- depends=( ${depends[*]/qt6-base/qt5-base} )
- makedepends=("asciidoc" "python-setuptools")
- makedepends=( ${makedepends[*]/asciidoc/asciidoc>=10.2.0} ) # for python3
- optdepends=("python-adblock: adblocking backend"
- "python-pygments"
- "pdfjs: displaying PDF in-browser")
- 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")
- 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")
- source+=("warning-webkit.html")
- noextract=(qutebrowser-$pkgver.tar.gz) # for armv7h
- validpgpkeys=("27F3BB4FC217EECB858578AEEF7EE4D039690B7B")
- sha256sums=('aadb64accc730bc9a15ce341c9a0580b1f36383ed4874f54d31ce1dabe94e17a'
- 'SKIP')
- sha256sums+=('e18216f24387b61a109611958bb59248beaf5afc90da8654e29ea8b0a7ef1610')
- _version_constraint() # (dep_pkgname [precision])
- {
- Log() { [[ "${FUNCNAME[2]}" == package ]] && echo "$@" >&2 || : ; }
- local dep_pkgname=$1
- declare -i req_precision=$2
- local full_version=$(pacman -S --print-format='%v' ${dep_pkgname} 2> /dev/null | tail -n 1)
- local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;)
- local def_precision=$(( n_dots + 1 ))
- local is_prec_valid=$(( req_precision > 0 && req_precision <= def_precision ))
- local precision=$((( is_prec_valid )) && echo ${req_precision} || echo ${def_precision})
- local pkgver_rx='[0-9A-Za-z_]+'
- pkgver_rx=$(sed 's|\]|\+]|' <<<${pkgver_rx}) # according to the wiki, '+' is not allowed,
- # but some pkgver have it (eg: 5.15.10+kde+r130)
- local subver_rx='\.'${pkgver_rx}
- local pkgrel_rx='[0-9]+'
- local garbage_rx='[^0-9].*'
- local capture_rx=${pkgver_rx}
- for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ;
- local version pkgrel has_dot_char version_min version_max constraint_string
- declare -i subver subver_inc pkgrel_inc
- if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-(${pkgrel_rx}).*$ ]]
- then version=${BASH_REMATCH[1]} # pkgver cut to the requested precision
- #unused=${BASH_REMATCH[2]} # discarded pkgver segments
- pkgrel=${BASH_REMATCH[3]} # pkgrel with non-numerics right-trimmed
- has_dot_char=$([[ "${version}" =~ \. ]] ; echo $(( ! $? )) ; )
- subver=$(sed "s|${garbage_rx}||" <<<${version##*.}) # right-trim from any non-numeric
- version=$( (( has_dot_char )) && echo ${version%.*}.${subver} || echo ${subver} )
- subver_inc=$(( subver + 1 ))
- pkgrel_inc=$(( pkgrel + 1 ))
- version_min=$( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel} || \
- echo ${version} )
- version_max=$( ( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \
- ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \
- echo ${subver_inc} )
- constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}"
- Log "Applied version constraint: '${constraint_string}'"
- else Log "ERROR: in _version_constraint() parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'"
- exit 1
- fi
- unset -f Log
- echo -n "${constraint_string}"
- }
- prepare() {
- # for armv7h
- # bsdtar: Pathname can't be converted from UTF-8 to current locale
- tar xzf "$srcdir"/qutebrowser-$pkgver.tar.gz
- cd "qutebrowser-$pkgver/qutebrowser"
- # tone-down the webkit warning on the first-run welcome page
- cp "$srcdir"/warning-webkit.html html/
- # make sure webkit is the default backend
- sed -i 's|default: webengine|default: webkit|' config/configdata.yml
- ! grep 'default: webengine' config/configdata.yml ||
- ! echo "prepare() requires re-working - config still prefers webengine" || return 1
- # force QT5 support
- sed -i 's/_WRAPPER_OVERRIDE = .*/_WRAPPER_OVERRIDE = "PyQt5"/' qt/machinery.py
- }
- build() {
- cd "$pkgname-$pkgver"
- make -f misc/Makefile all
- }
- package() {
- # pin to strongly-coupled dependency versions
- depends=( $(_version_constraint python 2) \
- $(_version_constraint qt5-base 3) ${depends[*]%qt5-base} )
- cd "$pkgname-$pkgver"
- make -f misc/Makefile DESTDIR="$pkgdir" PREFIX=/usr install
- }
|