summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8b94bbbe5e06ceb634a55fb5d5c0f754955963fb (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
# Maintainer: Barry <howtoedittv@gmail.com>
pkgname=drawy-build
pkgver=1.0.0
pkgrel=1
pkgdesc="A lightweight and user-friendly drawing application"
arch=('x86_64')
url="https://invent.kde.org/prayag/drawy"
license=('GPL')
depends=('qt6-tools' 'qt6-base' 'extra-cmake-modules' 'cmake' 'zstd' 'gcc' 'git')
makedepends=('git' 'cmake' 'yay')   # yay needed to install kf6 from AUR

source=("git+https://invent.kde.org/prayag/drawy.git")
sha256sums=('SKIP')

is_installed() {
  pacman -Qi "$1" &>/dev/null
}

install_kf6_from_aur() {
  if ! is_installed "kf6"; then
    yay -S --noconfirm kf6
  fi
}

build() {
  install_kf6_from_aur

  cd "$srcdir/drawy"
  cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
  cmake --build build --config Release
}

package() {
  cd "$srcdir/drawy"

  # create required directories
  install -dm755 "$pkgdir/usr/bin"
  install -dm755 "$pkgdir/usr/share/icons/hicolor/256x256/apps"
  install -dm755 "$pkgdir/usr/share/applications"


  install -Dm755 build/bin/drawy "$pkgdir/usr/bin/drawy"

  install -Dm644 assets/icon.ico \
    "$pkgdir/usr/share/icons/hicolor/256x256/apps/drawy.ico"

  cat > "$pkgdir/usr/share/applications/drawy.desktop" <<EOF
[Desktop Entry]
Version=1.0
Name=Drawy
Comment=Lightweight drawing application
Exec=drawy
Icon=drawy
Terminal=false
Type=Application
Categories=Graphics;Utility;
StartupWMClass=drawy
EOF
}