diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 97 |
1 files changed, 66 insertions, 31 deletions
@@ -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 |