Name glycin
Description Sandboxed and extendable image decoding
Version 2.0.8-1
Package Base glycin
Homepage https://gnome.pages.gitlab.gnome.org/glycin/
Maintainers ['Fabian Bornschein <fabiscafe@archlinux.org>', 'Jan Alexander Steffens (heftig) <heftig@archlinux.org>']
Contributors []
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/glycin
Sources ['git+https://gitlab.gnome.org/GNOME/glycin.git#tag=2.0.8', 'git+https://gitlab.gnome.org/sophie-h/test-images.git']
Dependencies ['bubblewrap', 'cairo', 'fontconfig', 'gcc-libs', 'glib2', 'glibc', 'lcms2', 'libjxl', 'librsvg', 'libseccomp']
Optional-Dependencies ['libheif']
Build-Dependencies ['clang', 'git', 'gtk4', 'gobject-introspection', 'libheif', 'meson', 'rust', 'vala']
Provides ['libglycin-2.so']
Builddate 11-02-2026 01:36:56
Architecture x86_64
Distro-Version
Licenses ['MPL-2.0 OR LGPL-2.1-or-later']
Hash 0d31581ac995c36ff53bf0bf18a5575542e22b51c76c94845acfad831ee3fb4b
# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgbase=glycin
pkgname=(
  glycin
  glycin-gtk4
)
pkgver=2.0.8
pkgrel=1
pkgdesc="Sandboxed and extendable image decoding"
arch=(x86_64)
url="https://gnome.pages.gitlab.gnome.org/glycin/"
license=('MPL-2.0 OR LGPL-2.1-or-later')
depends=(
  bubblewrap
  cairo
  fontconfig
  gcc-libs
  glib2
  glibc
  lcms2
  libjxl
  librsvg
  libseccomp
)
makedepends=(
  clang
  git
  gtk4
  gobject-introspection
  libheif
  meson
  rust
  vala
)
checkdepends=(
  dav1d
  ffmpeg
  rav1e
  svt-av1
)
source=(
  "git+https://gitlab.gnome.org/GNOME/glycin.git#tag=${pkgver/[a-z]/.&}"
  "git+https://gitlab.gnome.org/sophie-h/test-images.git"
)
b2sums=('82c04a7bad9d3a30c69b8da760077fc785cebefbc79620274df93e19a7ec954d182e0eb309f86ea2cbe711a47ffee14736912ef919d9b829d0709d4ebbe8ffa0'
        'SKIP')

# Use debug
export CARGO_PROFILE_RELEASE_DEBUG=2 CARGO_PROFILE_RELEASE_STRIP=false

# Use LTO
export CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1

prepare() {
  cd glycin

  git submodule init
  git submodule set-url tests/test-images "$srcdir/test-images"
  git -c protocol.file.allow=always -c protocol.allow=never submodule update

  # Match cargo_home in meson.build
  CARGO_HOME="$srcdir/build/cargo-home" \
    cargo fetch --locked --target "$(rustc --print host-tuple)"
}

build() {
  local meson_options=(
  )

  arch-meson glycin build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

_pick() {
  local p="$1" f d; shift
  for f; do
    d="$srcdir/$p/${f#$pkgdir/}"
    mkdir -p "$(dirname "$d")"
    mv "$f" "$d"
    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  done
}

package_glycin() {
  optdepends=(
    'libheif: Load .avif, .heic and .heif'
  )
  provides=(libglycin-2.so)

  meson install -C build --destdir "$pkgdir" --no-rebuild

  cd "$pkgdir"
  _pick gtk4 usr/include/glycin-gtk4-*
  _pick gtk4 usr/lib/girepository-1.0/GlyGtk4-*
  _pick gtk4 usr/lib/libglycin-gtk4-*
  _pick gtk4 usr/lib/pkgconfig/glycin-gtk4-*
  _pick gtk4 usr/share/gir-1.0/GlyGtk4-*
  _pick gtk4 usr/share/vala/vapi/glycin-gtk4-*
}

package_glycin-gtk4() {
  pkgdesc+=" - GTK4 integration"
  depends=(
    fontconfig
    gcc-libs
    glib2
    glibc
    glycin
    gtk4
    lcms2
    libseccomp
  )
  provides=(libglycin-gtk4-2.so)

  mv gtk4/* "$pkgdir"
}

# vim:set sw=2 sts=-1 et: