summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 37cf243903b2912bc5039b80952fc27cbbae88ec (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Maintainer: Nico <d3sox at protonmail dot com>
# Contributor: Sefa Eyeoglu <contact@scrumplex.net>

# options
: ${_build_kf5:=true}
: ${_build_kf6:=true}

# basic info
_pkgname="lightly"
pkgbase="$_pkgname-git"
pkgver=0.4.1.r73.g00ca234
pkgrel=4
pkgdesc="Modern style for KDE/Qt applications"
url="https://github.com/boehs/lightly"
arch=('x86_64' 'aarch64')
license=("GPL-2.0-or-later")

makedepends=(
  'cmake'
  'extra-cmake-modules'
  'git'
)

options=(!emptydirs !debug)

_pkgsrc="$_pkgname"
source=(
  "$_pkgname"::"git+$url.git#branch=qt6"
  "qt6-missing-config.patch"
)
sha256sums=(
  'SKIP'
  '2553ff71310e265a9481c0afb9d50bbd1d9f66d47bd67675956199601c1a6501'
)

# common functions
pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  if [[ "${_build_kf5::1}" == "t" ]] ; then
    _prepare_kf5
    _build_kf5
    _package_kf5
  fi

  if [[ "${_build_kf6::1}" == "t" ]] ; then
    _prepare_kf6
    _build_kf6
    _package_kf6
  fi
}

# KF5/Qt5
_depends_kf5=(
  'frameworkintegration5'
  'hicolor-icon-theme'
  'kcmutils5'
  'kconfig5'
  'kcoreaddons5'
  'kdecoration5'
  'kguiaddons5'
  'ki18n5'
  'kiconthemes5'
  'kwayland5'
  'kwindowsystem5'
  'qt5-declarative'
  'qt5-x11extras'

  ## implicit
  #libxcb
  #qt5-base
)

_prepare_kf5() (
  cd "$_pkgsrc"
  git checkout -f master
)

_build_kf5() (
  local _cmake_options=(
    -B build_kf5
    -S "$_pkgsrc"
    -DBUILD_TESTING=OFF
    -DKDecoration2_DIR=/usr/lib/cmake/plasma5/KDecoration2
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"
  cmake --build build_kf5
)

_package_kf5() (
  local _pkgdir="$srcdir/fakeinstall_kf5"
  install -dm755 "$_pkgdir"
  DESTDIR="$_pkgdir" cmake --install build_kf5

  rm -rf "$_pkgdir/usr/lib/cmake"
  rm -rf "$_pkgdir/usr/share/icons"
  mv "$_pkgdir/usr/share/color-schemes/Lightly.colors" "$_pkgdir/usr/share/color-schemes/Lightly5.colors"
  mv "$_pkgdir/usr/share/kstyle/themes/lightly.themerc" "$_pkgdir/usr/share/kstyle/themes/lightly5.themerc"
)

# KF6/Qt6
_depends_kf6=(
  'frameworkintegration'
  'hicolor-icon-theme'
  'kcmutils'
  'kcolorscheme'
  'kconfig'
  'kcoreaddons'
  'kdecoration'
  'kguiaddons'
  'kiconthemes'
  'kwindowsystem'
  'qt6-declarative'

  ## implicit
  #ki18n
  #kwidgetsaddons
  #qt6-base
)

_prepare_kf6() (
  cd "$_pkgsrc"
  git checkout -f qt6
  patch -Np1 -F100 -i ../qt6-missing-config.patch
)

_build_kf6() (
  local _cmake_options=(
    -B build_kf6
    -S "$_pkgsrc"
    -DBUILD_TESTING=OFF
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"

  cmake --build build_kf6/kdecoration/config/
  cmake --build build_kf6
)

_package_kf6() (
  local _pkgdir="$srcdir/fakeinstall_kf6"
  install -dm755 "$_pkgdir"
  DESTDIR="$_pkgdir" cmake --install build_kf6

  rm -rf "$_pkgdir/usr/lib/cmake"
)

# execute
if [[ "${_build_kf5::1}" == "t" ]] ; then
  depends+=("${_depends_kf5[@]}")

  pkgname+=("$_pkgname-kf5-git")

  package_lightly-kf5-git() {
    pkgdesc="Modern style for KF5/Qt5 applications"

    provides=(
      lightly
      lightly-kf5
      lightly-qt
      lightly-qt5
    )
    conflicts=(
      lightly
      lightly-boehs-git
      lightly-kf5
      lightly-qt
      lightly-qt5
    )

    depends=("${_depends_kf5[@]}")

    local _pkgdir="$srcdir/fakeinstall_kf5"
    mv "$_pkgdir"/* "$pkgdir/"

    chmod u=rwX,g=rX,o=rX -R "$pkgdir"
  }
fi

if [[ "${_build_kf6::1}" == "t" ]] ; then
  depends+=("${_depends_kf6[@]}")

  pkgname+=("$_pkgname-kf6-git")

  package_lightly-kf6-git() {
    pkgdesc="Modern style for KF6/Qt6 applications"

    provides=(
      lightly-kf6
      lightly-qt6
      lightly-qt6-git
    )
    conflicts=(
      lightly-kf6
      lightly-qt6
      lightly-qt6-git
    )

    depends=("${_depends_kf6[@]}")

    local _pkgdir="$srcdir/fakeinstall_kf6"
    mv "$_pkgdir"/* "$pkgdir/"

    chmod u=rwX,g=rX,o=rX -R "$pkgdir"
  }
fi