summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 29ced55166a4d9f1c6a4e1ac60df8db589e269f2 (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
# Maintainer: begin-theadventure <begin-thecontact.ncncb at dralias dot com>

pkgname=switcheroo-gtk4
pkgver=2.1.0
_commit=fc1fb4f79f6b60f480f9381667d6683f33b9e8ac
pkgrel=2
pkgdesc="Convert and manipulate images"
url="https://gitlab.com/adhami3310/Switcheroo"
license=('GPL-3.0-only')
arch=('x86_64' 'aarch64')
depends=('gdk-pixbuf2' 'ghostscript' 'highway' 'imagemagick' 'imath' 'libadwaita' 'libde265'
         'libheif' 'libjxl' 'liblqr' 'librsvg' 'openexr' 'webp-pixbuf-loader' 'x265')
makedepends=('blueprint-compiler' 'cargo' 'git' 'meson')
checkdepends=('appstream-glib')
source=("git+$url.git#commit=$_commit")
sha256sums=('SKIP')

prepare() {
  cd Switcheroo
  export CARGO_HOME="$srcdir/CARGO_HOME"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --target "$CARCH-unknown-linux-gnu"
}

build() {
  export CARGO_HOME="$srcdir/CARGO_HOME"
  export RUSTUP_TOOLCHAIN=stable
  arch-meson Switcheroo build
  meson compile -C build
}

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

package() {
  meson install -C build --no-rebuild --destdir "$pkgdir"
# Resolve a file conflict with another switcheroo
  sed -i -E "s|Exec=switcheroo|Exec=$pkgname|g" "$pkgdir/usr/share/applications/io.gitlab.adhami3310.Converter.desktop"
  mv "$pkgdir/usr/bin/switcheroo" "$pkgdir/usr/bin/$pkgname"
}