diff options
author | xiota | 2024-02-26 02:49:31 +0000 |
---|---|---|
committer | xiota | 2024-02-26 02:49:31 +0000 |
commit | 0c3fdfc6288efa977b0f2068052edb1a9aa5a7bf (patch) | |
tree | a9fcacc9fd6cec166f6f55a39c458b98498febcc /PKGBUILD | |
parent | 825ef6dd436eb5658fbb61c03972ad094796ef1d (diff) | |
download | aur-0c3fdfc6288efa977b0f2068052edb1a9aa5a7bf.tar.gz |
1.0.03.r2444
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 95 |
1 files changed, 60 insertions, 35 deletions
@@ -2,47 +2,71 @@ # Contributor: m4sk1n <m4sk1n@vivaldi.net> # Contributor: Christian Hesse <mail@eworm.de> -_pkgname=otter-browser -pkgname="$_pkgname-git" -pkgver=1.0.03.r2358.gb2397dc +# options +: ${_build_git:=true} + +unset _pkgtype +[[ "${_build_git::1}" == "t" ]] && _pkgtype+="-git" + +# basic info +_pkgname="otter-browser" +pkgname="$_pkgname${_pkgtype:-}" +pkgver=1.0.03.r2444.g305aeec7 pkgrel=1 -pkgdesc='Browser aiming to recreate the best aspects of the classic Opera (12.x) UI using Qt5' +pkgdesc='Browser recreating the best aspects of the classic Opera interface' url='https://github.com/OtterBrowser/otter-browser' -license=('GPL3') +license=('GPL-3.0-or-later') arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64') -depends=( - 'qt5-multimedia' - 'qt5-svg' - 'qt5-webengine' -) -makedepends=( - 'cmake' -) -optdepends=( - 'hunspell: for spell checking' -) - -if [ x"$pkgname" == x"$_pkgname" ] ; then - # normal package +# main package +_main_package() { + depends=( + 'qt5-multimedia' + 'qt5-svg' + 'qt5-webengine' + + ## implicit + #qt5-base + #qt5-declarative + ) + makedepends=( + 'cmake' + ) + optdepends=( + 'hunspell: for spell checking' + ) + + if [ "${_build_git::1}" != "t" ] ; then + _main_stable + else + _main_git + fi +} + +# stable package +_main_stable() { + : ${_pkgver:=${pkgver%%.r*}} + depends+=( 'qt5-xmlpatterns' ) - _pkgsrc="$_pkgname-${pkgver%%.r*}" + _pkgsrc="$_pkgname-${_pkgver:?}" _pkgext="tar.gz" - source+=("$_pkgsrc.$_pkgext"::"$url/archive/v${pkgver%%.r*}/$_pkgsrc.$_pkgext") + source+=("$_pkgsrc.$_pkgext"::"$url/archive/v$_pkgver/$_pkgsrc.$_pkgext") sha256sums+=('2b07d22a5d921ec0b3d29a680eb913c3fe0713ca7d10e37873a3802d1a5154a3') pkgver() { - echo "${pkgver%%.r*}" + echo "${_pkgver:?}" } -else - # git package +} + +# git package +_main_git() { makedepends+=('git') - provides=("$_pkgname") - conflicts=("$_pkgname") + provides+=("$_pkgname=${pkgver%%.r*}") + conflicts+=("$_pkgname") _pkgsrc="$_pkgname" source+=("$_pkgsrc"::"git+$url.git") @@ -51,26 +75,24 @@ else pkgver() { cd "$_pkgsrc" - _tag=$(git tag | tail -1) - if [[ $(vercmp "$_tag" "v1.0.03") -lt 0 ]] ; then - _tag="v1.0.03" - fi - - _revision=$(git rev-list --count "$_tag"..HEAD) - _hash=$(git rev-parse --short=7 HEAD) + local _tag=$(git tag | sort -rV | head -1) + local _revision=$(git rev-list --count --cherry-pick "$_tag"...HEAD) + local _hash=$(git rev-parse --short=8 HEAD) printf '%s.r%s.g%s' \ "${_tag#v}" \ "$_revision" \ "$_hash" } -fi +} +# common functions build() { local _cmake_options=( -B build -S "$_pkgsrc" -DCMAKE_INSTALL_PREFIX='/usr' + -Wno-dev ) cmake "${_cmake_options[@]}" @@ -80,5 +102,8 @@ build() { package() { depends+=('hicolor-icon-theme') - DESTDIR="${pkgdir:?}" cmake --install build + DESTDIR="$pkgdir" cmake --install build } + +# execute +_main_package |