summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 76e7ce96fe296ccadb82318e7f12569852aa7e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Maintainer: Lennard Hofmann <lennard dot hofmann at web dot de>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=papers-git
_reponame=papers
pkgver=50.beta.r12.gc9daa37
pkgrel=1
pkgdesc='Document viewer for PDF and other document formats aimed at the GNOME desktop'
arch=(x86_64)
url='https://apps.gnome.org/Papers/'
license=(GPL-2.0-or-later)
depends=(
  cairo
  dconf
  djvulibre
  exempi
  gcc-libs
  gdk-pixbuf2
  glib2
  glibc
  graphene
  gtk4
  gtksourceview5
  hicolor-icon-theme
  libadwaita
  libarchive
  libnautilus-extension
  libspelling
  libtiff
  pango
  poppler-glib
)
makedepends=(
  appstream
  blueprint-compiler
  gi-docgen
  git
  glib2-devel
  gobject-introspection
  itstool
  libsysprof-capture
  meson
  rust
)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+https://gitlab.gnome.org/GNOME/papers.git")
b2sums=('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

pkgver() {
  cd "$_reponame"
  git describe --long --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$_reponame"

  CARGO_HOME="$srcdir/build/cargo-home" \
    cargo fetch --locked --target "$(rustc --print host-tuple)"
}

build() {
  arch-meson "$_reponame" build
  meson compile -C build
}

# thumbnailer test fails in `pkgctl build` container, possibly due to missing test-data
# check() {
#   meson test -C build --print-errorlogs --no-rebuild
# }

package() {
  groups=(gnome)

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

  mkdir -p doc/usr/share
  mv {"$pkgdir",doc}/usr/share/doc
}