summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 53f08902c2a39f81fb90a69bd231bb90af3c4a69 (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
104
105
# Maintainer           : Arnaud Dovi <mr.dovi@gmail.com>
# Contributor          : SharkEzz <icraft640@gmail.com>
# Contributor          : Nikola Milinković <nikmil@gmail.com>

# WITH_KNOTIFICATION = 0 -> Default notifier is use simply qt5
# WITH_KNOTIFICATION = 1 -> Enable the Plasma/knotifications support notifier
WITH_KNOTIFICATION=0

# WITH_DARK_ICON = 0 -> Default icons
# WITH_DARK_ICON = 1 -> Replace the green icon by a dark one (dark themes support)
WITH_DARK_ICON=1

pkgname=octopi-git
pkgver=0.14.0.r4.2db10e3b
pkgrel=1
pkgdesc="This is Octopi, a powerful Pacman frontend using Qt libs"
arch=('x86_64')
url="https://github.com/aarnt/octopi"
license=('GPL2')
depends=(
  'alpm_octopi_utils-git'
  'pkgfile'
  'qtermwidget'
  'sudo'
)
makedepends=(
  'git'
  'qt5-base'
  'qt5-tools'
)
provides=(
  'octopi'
  'octopi-cachecleaner'
  'octopi-helper'
  'octopi-notifier'
  'octopi-repoeditor'
  'octopi-sudo'
)
conflicts=(
  'octopi'
  'octopi-cachecleaner'
  'octopi-helper'
  'octopi-notifier'
  'octopi-repoeditor'
  'octopi-sudo'
  'octopi-dev'
  'octopi-kde-git'
  'octopi-notifier-frameworks'
  'octopi-notifier-qt5'
  'octopi-notifier-noknotify'
)
#install=octopi.install
source=(
  'git+https://github.com/aarnt/octopi.git'
  'octopi_dark.png'
)
sha256sums=('SKIP'
            '49aa640be835eb9ccf216f44a2d86aba3b39bf349e62b855192096526883cdc0')

pkgver() {
  cd "${pkgname/-git/}" || exit
  printf "%s" "$(git describe --long --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
  cd "${pkgname/-git/}" || exit
  [[ "$WITH_KNOTIFICATION" == "1" ]] && sed -e "s|DEFINES += ALPM_BACKEND #KSTATUS|DEFINES += ALPM_BACKEND KSTATUS|" -i notifier/octopi-notifier.pro
  if [[ "$WITH_DARK_ICON" -eq "1" ]]; then
    cp resources/images/octopi_green.png resources/images/octopi_green.bak.png
    cp "${srcdir}/octopi_dark.png" resources/images/octopi_green.png
  fi
  cp resources/images/octopi_green.png resources/images/octopi.png
  # https://github.com/aarnt/octopi/commit/2250904a902fca96ea16adf463400fbda913aa70
  #patch --forward --strip=2 --input="${srcdir}/2250904a902fca96ea16adf463400fbda913aa70.patch"
}

build() {
  cd "${pkgname/-git/}" || exit
  echo "Starting build..."
  qmake-qt5 PREFIX=/usr QMAKE_CFLAGS="${CFLAGS}" QMAKE_CXXFLAGS="${CXXFLAGS}" QMAKE_LFLAGS="${LDFLAGS}" octopi.pro
  make

  _subdirs="cachecleaner helper notifier repoeditor sudo"

  for _subdir in $_subdirs; do
    pushd $_subdir
    echo "Building octopi-$_subdir..."
    qmake-qt5 PREFIX=/usr QMAKE_CFLAGS="${CFLAGS}" QMAKE_CXXFLAGS="${CXXFLAGS}" QMAKE_LFLAGS="${LDFLAGS}" "octopi-$_subdir.pro"
    make
    popd
  done
}

package() {
  cd "${pkgname/-git/}" || exit
  make INSTALL_ROOT="${pkgdir}" install

  _subdirs="cachecleaner helper notifier repoeditor sudo"

  for _subdir in $_subdirs; do
    pushd $_subdir
    make INSTALL_ROOT="${pkgdir}" install
    popd
  done
}