summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba65f86982c158fad53452f8aac6c9e9f4be587f (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: MatMoul <matmoul at the google email domain which is .com>
pkgbase=octopi
pkgname=('octopi'
         'octopi-notifier-qt5'
         'octopi-notifier-frameworks'
)
pkgbase=octopi
pkgver=0.15.0
pkgrel=4
arch=('x86_64')
url="https://tintaescura.com/projects/octopi"
license=('GPL-2.0-or-later')
depends=('alpm-octopi-utils' 'qtermwidget')
makedepends=('qt5-tools' 'knotifications5')
source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/aarnt/octopi/archive/v${pkgver}.tar.gz")
sha256sums=('e94525d906d6ab4f5fc594cf1a267668ae5f1fa7f32e449ddfa84328dd738f30')

_subdirs=(
  helper
  notifier
  notifier-frameworks
  repoeditor
  cachecleaner
  sudo
)

prepare() {
  cd "${pkgbase}-${pkgver}"

  # copy notifier folder for building both qt5 & kstatus notifier backends
  cp -rf notifier notifier-qt5
  cp -rf notifier notifier-frameworks

  # enable building the kstatus alpm backend for notifier-frameworks
  sed -i 's|#KSTATUS|KSTATUS|' "notifier-frameworks/${pkgbase}-notifier.pro"

  # why doesn't upstream just do this so we don't have to...
  cp -f "resources/images/${pkgbase}_green.png" "resources/images/${pkgbase}.png"
}

build() {
  cd "${pkgbase}-${pkgver}"
  qmake-qt5 \
    PREFIX=/usr \
    QMAKE_CFLAGS="${CFLAGS}" \
    QMAKE_CXXFLAGS="${CXXFLAGS}" \
    QMAKE_LFLAGS="${LDFLAGS}"
  make

  for _subdir in ${_subdirs[@]}; do
    pushd ${_subdir}
    qmake-qt5 \
    PREFIX=/usr \
    QMAKE_CFLAGS="${CFLAGS}" \
    QMAKE_CXXFLAGS="${CXXFLAGS}" \
    QMAKE_LFLAGS="${LDFLAGS}"
    make
    popd
  done
}

package_octopi() {
  pkgdesc="A powerful Pacman frontend using Qt libs"
  optdepends=('octopi-notifier-qt5: Notifier for Octopi using Qt5 libs'
              'octopi-notifier-frameworks: Notifier for Octopi with Knotifications support'
              'pacaur: for AUR support'
              'paru: for AUR support'
              'pikaur: for AUR support'
              'trizen: for AUR support'
              'yay: for AUR support'
              'pacmanlogviewer: to view pacman log files'
              'opendoas: privilege elevation'
              'sudo: privilege elevation')
  provides=('octopi-repoeditor' 'octopi-cachecleaner')

  cd "${pkgbase}-${pkgver}"
  make INSTALL_ROOT="${pkgdir}" install

  for folder in helper repoeditor cachecleaner sudo; do
    make -C ${folder} INSTALL_ROOT="${pkgdir}" install
  done
}

package_octopi-notifier-qt5() {
  pkgdesc="Notifier for Octopi using Qt5 libs"
  depends=('octopi')
  provides=('octopi-notifier')
  conflicts=('octopi-notifier')

  cd "${pkgbase}-${pkgver}"
  make -C notifier INSTALL_ROOT="${pkgdir}" install
}

package_octopi-notifier-frameworks() {
  pkgdesc="Notifier for Octopi with Knotifications support"
  depends=('octopi' 'knotifications5')
  provides=('octopi-notifier')
  conflicts=('octopi-notifier')

  cd "${pkgbase}-${pkgver}"
  make -C notifier-frameworks INSTALL_ROOT="${pkgdir}" install
}