diff options
author | xiota | 2024-02-21 01:12:29 +0000 |
---|---|---|
committer | xiota | 2024-02-21 01:28:56 +0000 |
commit | 9bc6d58342cf07ea4cb4c3044316d1f7e1e3ae46 (patch) | |
tree | 8fdfb3699ea9b9d622bff66e60faf98be0e7434c | |
parent | 9e09731c6d75998c611355c9b2b5f31c4e02d518 (diff) | |
download | aur-siril-git.tar.gz |
1.2.1.r708
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 97 |
2 files changed, 70 insertions, 34 deletions
@@ -1,6 +1,6 @@ pkgbase = siril-git - pkgdesc = An astronomical image processing software for Linux. (IRIS clone) - pkgver = 1.2.0.r538.g22ca41c40 + pkgdesc = Astronomical image processing software for Linux (IRIS clone) + pkgver = 1.2.1.r708.gc6150305 pkgrel = 1 url = https://gitlab.com/free-astro/siril arch = i686 @@ -12,6 +12,7 @@ pkgbase = siril-git makedepends = meson makedepends = ninja depends = cfitsio + depends = curl depends = exiv2 depends = ffms2 depends = fftw @@ -22,7 +23,7 @@ pkgbase = siril-git depends = libraw depends = libxisf depends = opencv - provides = siril=1.2.0 + provides = siril=1.2.1 conflicts = siril source = siril::git+https://gitlab.com/free-astro/siril.git source = flathub.shared-modules::git+https://github.com/flathub/shared-modules.git @@ -8,6 +8,12 @@ # https://gitlab.com/free-astro/siril ## options +if [ -n "$_srcinfo" ] || [ -n "$_pkgver" ] ; then + : ${_autoupdate:=false} +else + : ${_autoupdate:=true} +fi + : ${_build_avx:=false} : ${_build_git:=true} @@ -17,9 +23,9 @@ # basic info _pkgname="siril" pkgname="$_pkgname${_pkgtype:-}" -pkgver=1.2.0.r538.g22ca41c40 +pkgver=1.2.1.r708.gc6150305 pkgrel=1 -pkgdesc="An astronomical image processing software for Linux. (IRIS clone)" +pkgdesc="Astronomical image processing software for Linux (IRIS clone)" url="https://gitlab.com/free-astro/siril" arch=('i686' 'x86_64') license=('GPL-3.0-or-later') @@ -28,6 +34,7 @@ license=('GPL-3.0-or-later') _main_package() { depends=( 'cfitsio' + 'curl' 'exiv2' 'ffms2' 'fftw' @@ -41,7 +48,6 @@ _main_package() { ## implicit #'cairo' - #'curl' #'ffmpeg' #'gcc-libs' #'gdk-pixbuf2' @@ -65,6 +71,30 @@ _main_package() { 'criterion' # AUR ) + if [ "${_build_git::1}" != "t" ] ; then + _main_stable + else + _main_git + fi +} + +# stable package +_main_stable() { + _update_version + + _pkgsrc="$_pkgname" + source+=("$_pkgsrc"::"git+$url.git#tag=$_pkgver") + sha256sums+=('SKIP') + + _source_siril + + pkgver() { + echo "${_pkgver:?}" + } +} + +# git package +_main_git() { provides=("$_pkgname=${pkgver%%.r*}") conflicts=("$_pkgname") @@ -73,6 +103,14 @@ _main_package() { sha256sums=('SKIP') _source_siril + + pkgver() { + cd "$_pkgsrc" + local _version=$(git tag | grep -Ev '^.*[A-Za-z]{2}.*$' | sort -V | tail -1) + local _revision=$(git rev-list --count --cherry-pick $_version...HEAD) + local _hash=$(git rev-parse --short=8 HEAD) + printf "%s.r%s.g%s" "${_version:?}" "${_revision:?}" "${_hash:?}" + } } # submodules @@ -87,7 +125,7 @@ _source_siril() { ) _prepare_siril() ( - cd "${srcdir:?}/$_pkgsrc" + cd "$_pkgsrc" local -A _submodules=( ['flathub.shared-modules']='build/flatpak/shared-modules' ['carvac.librtprocess']='subprojects/librtprocess' @@ -110,39 +148,13 @@ prepare() { _prepare_siril } -pkgver() { - cd "$_pkgsrc" - local _version=$(git tag | grep -Ev '^.*[A-Za-z]{2}.*$' | sort -V | tail -1) - local _revision=$(git rev-list --count --cherry-pick $_version...HEAD) - local _hash=$(git rev-parse --short HEAD) - printf "%s.r%s.g%s" "${_version:?}" "${_revision:?}" "${_hash:?}" -} - build() { local _meson_options=( "$_pkgsrc" build - - # curl/curl.h provided by core/curl via base-devel - -Dlibcurl=true - - # force features - -Dexiv2=true - -Dffmpeg=true - -Dffms2=true - -Djson_glib=true - -DlibXISF=true - -Dlibgit2=true - -Dlibheif=true - -Dlibjpeg=true - -Dlibjxl=true - -Dlibpng=true - -Dlibraw=true - -Dlibtiff=true - -Dopenmp=true ) - # criterion not available when using --nocheck + # criterion available and needed only for check if pacman -Q criterion 2> /dev/null ; then _meson_options+=( -Dcriterion=true @@ -166,5 +178,28 @@ package() { meson install -C build --destdir "$pkgdir" } +# update version +_update_version() { + : ${_pkgver:=${pkgver%%.r*}} + + if [[ "${_autoupdate::1}" != "t" ]] ; then + return + fi + + local _response=$(curl -Ssf "$url/-/tags?format=atom") + local _tag=$( + printf '%s' "$_response" \ + | grep '"https://.*/tags/.*"' \ + | sed -E 's@^.*/tags/(.*)".*$@\1@' \ + | grep -Ev '[a-z]{2}' | sort -rV | head -1 + ) + local _pkgver_new="${_tag:?}" + + # update _pkgver + if [ "$_pkgver" != "${_pkgver_new:?}" ] ; then + _pkgver="${_pkgver_new:?}" + fi +} + # execute _main_package |