summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9758a6300b89077a7016599e4008e2038b3d5aa7 (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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>

pkgbase=wxwidgets-light
pkgname=(
  'wxwidgets-common-light'
  'wxwidgets-gtk3-light'
#   'wxwidgets-gtk4-light'
  'wxwidgets-qt5-light'
)
pkgver=3.2.6
pkgrel=2
pkgdesc="wxWidgets suite for Base, Qt5 and GTK3 toolkits (GNOME/GStreamer free!)"
arch=('x86_64')
url='http://wxwidgets.org'
license=('custom:wxWindows')
makedepends=(
  'git'
  'cmake'
  'glu'
  'webkit2gtk-4.1'
  'gtk3'
#  'gtk4'
  'libnotify'
  'qt5-base'
  'sdl2'
  'libmspack'
  'libsecret'
  'bash'
  'gspell'
  'gcc-libs'
  'glibc'
  'curl'
  'expat'
  'glib2'
  'xz'
  'pcre2'
  'libglvnd'
  'libtiff'
  'libjpeg-turbo'
  'libglvnd'
  'libpng'
  'fontconfig'
  'pango'
  'cairo'
  'gdk-pixbuf2'
  'wayland'
  'cython'
  'nanosvg'
  'libxkbcommon'
  'gettext'
)
source=(
  "wxwidgets::git+https://github.com/wxWidgets/wxWidgets.git#tag=v${pkgver}"
  "install_locales_cmake.patch::https://github.com/MaartenBent/wxWidgets/commit/82b50732181a43b4a0a4f3cb6624bf95d05e7a0d.patch"
)
sha256sums=(
  'SKIP'
  'SKIP'
)
options=('debug')

prepare() {
  cd wxwidgets

  git cherry-pick ed510012bac97f6ad1f3b776d1b13c37a987e83e -n # Fix undefined symbols in Qt build
  git cherry-pick 8ea22b5e92bf46add0b20059f6e39a938858ff97 -n # Avoid crash with GTK3 if console program is using a GUI wxApp
  patch -p1 -i "${srcdir}/install_locales_cmake.patch"
}

build() {
  msg2 "Build WxBASE"
  cmake -S wxwidgets -B build-base \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=None \
    -DwxUSE_GUI=OFF \
    -DwxUSE_OPENGL=ON \
    -DwxUSE_REGEX=sys \
    -DwxUSE_ZLIB=sys \
    -DwxUSE_EXPAT=sys \
    -DwxUSE_LIBJPEG=sys \
    -DwxUSE_LIBPNG=sys \
    -DwxUSE_LIBTIFF=sys \
    -DwxUSE_LIBLZMA=sys \
    -DwxUSE_NANOSVG=sys \
    -DwxUSE_LIBMSPACK=ON \
    -DwxUSE_LIBSDL=ON \
    -DwxUSE_PRIVATE_FONTS=ON

  cmake --build build-base

  msg2 "Build WxGTK3"
    cmake -S wxwidgets -B build-gtk3 \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=None \
    -DwxBUILD_TOOLKIT=gtk3 \
    -DwxUSE_OPENGL=ON \
    -DwxUSE_REGEX=sys \
    -DwxUSE_ZLIB=sys \
    -DwxUSE_EXPAT=sys \
    -DwxUSE_LIBJPEG=sys \
    -DwxUSE_LIBPNG=sys \
    -DwxUSE_LIBTIFF=sys \
    -DwxUSE_LIBLZMA=sys \
    -DwxUSE_NANOSVG=sys \
    -DwxUSE_LIBMSPACK=ON \
    -DwxUSE_LIBSDL=ON \
    -DwxUSE_MEDIACTRL=OFF \
    -DwxUSE_PRIVATE_FONTS=ON \
    -DwxUSE_GTKPRINT=ON \
    -DwxUSE_DETECT_SM=ON \
    -DwxUSE_AUTOID_MANAGEMENT=ON

  cmake --build build-gtk3

#   msg2 "Build WxGTK4"
#     cmake -S wxwidgets -B build-gtk4 \
#     -DCMAKE_INSTALL_PREFIX=/usr \
#     -DCMAKE_BUILD_TYPE=None \
#     -DwxBUILD_TOOLKIT=gtk4 \
#     -DwxUSE_OPENGL=ON \
#     -DwxUSE_REGEX=sys \
#     -DwxUSE_ZLIB=sys \
#     -DwxUSE_EXPAT=sys \
#     -DwxUSE_LIBJPEG=sys \
#     -DwxUSE_LIBPNG=sys \
#     -DwxUSE_LIBTIFF=sys \
#     -DwxUSE_LIBLZMA=sys \
#     -DwxUSE_NANOSVG=sys \
#     -DwxUSE_LIBMSPACK=ON \
#     -DwxUSE_LIBSDL=ON \
#     -DwxUSE_MEDIACTRL=OFF \
#     -DwxUSE_PRIVATE_FONTS=ON \
#     -DwxUSE_GTKPRINT=ON \
#     -DwxUSE_DETECT_SM=ON \
#     -DwxUSE_AUTOID_MANAGEMENT=ON

#   cmake --build build-gtk4

  msg2 "Build WxQT5"
  cmake -S wxwidgets -B build-qt5 \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=None \
    -DwxBUILD_TOOLKIT=qt \
    -DwxUSE_OPENGL=ON \
    -DwxUSE_REGEX=sys \
    -DwxUSE_ZLIB=sys \
    -DwxUSE_EXPAT=sys \
    -DwxUSE_LIBJPEG=sys \
    -DwxUSE_LIBPNG=sys \
    -DwxUSE_LIBTIFF=sys \
    -DwxUSE_LIBLZMA=sys \
    -DwxUSE_NANOSVG=sys \
    -DwxUSE_LIBMSPACK=ON \
    -DwxUSE_LIBSDL=ON \
    -DwxUSE_MEDIACTRL=OFF \
    -DwxUSE_PRIVATE_FONTS=ON \
    -DwxUSE_DETECT_SM=ON \
    -DwxUSE_AUTOID_MANAGEMENT=ON

  cmake --build build-qt5
}

package_wxwidgets-qt5-light() {
pkgdesc="wxWidgets Qt5 Toolkit (GNOME/GStreamer free!)"
  depends=(
    'bash'
    'glibc'
    'libpng'
    'qt5-base'
    'sdl2'
    'gcc-libs'
    'wxwidgets-common-light' 'libwx_baseu-3.2.so' 'libwx_baseu_xml-3.2.so'
    'libglvnd' 'libOpenGL.so'
    'libjpeg-turbo' 'libjpeg.so'
    'libmspack' 'libmspack.so'
    'libtiff' 'libtiff.so'
  )
  provides=(
    'wxwidgets'
    "wxwidgets-qt5=${pkgver:0:3}"
    'libwx_qtu_adv-3.2.so'
    'libwx_qtu_aui-3.2.so'
    'libwx_qtu_core-3.2.so'
    'libwx_qtu_gl-3.2.so'
    'libwx_qtu_html-3.2.so'
    'libwx_qtu_propgrid-3.2.so'
    'libwx_qtu_qa-3.2.so'
    'libwx_qtu_ribbon-3.2.so'
    'libwx_qtu_richtext-3.2.so'
    'libwx_qtu_stc-3.2.so'
    'libwx_qtu_xrc-3.2.so'
  )
  conflicts=('wxwidgets-qt5')

  DESTDIR="${pkgdir}" cmake --install build-qt5

  mv "${pkgdir}/usr/bin/wx-config" "${pkgdir}/usr/bin/wx-config-qt"
  rm -fr "${pkgdir}/usr/bin/"wxrc{,-3*}
  rm -fr "${pkgdir}/usr/include"
  rm -fr "${pkgdir}/usr/lib/"*base*
  mv "${pkgdir}/usr/lib/cmake/wxWidgets"{,Qt}
  for _f in "${pkgdir}/usr/lib/cmake/wxWidgetsQt/"*; do
    mv $_f $(dirname $_f)/$(basename $_f | sed -e 's/wxWidgets/wxWidgetsQt/')
  done
  rm -fr "${pkgdir}/usr/share/bakefile"
  rm -fr "${pkgdir}/usr/share/"{aclocal,locale}

  install -Dm644 wxwidgets/docs/licence.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_wxwidgets-gtk3-light() {
  pkgdesc="wxWidgets GTK3 Toolkit (GNOME/GStreamer free!)"
  depends=(
    'libsm'
    'bash'
    'gcc-libs'
    'libpng'
    'glibc'
    'libx11'
    'libxtst'
    'sdl2'
    'wxwidgets-common-light' 'libwx_baseu-3.2.so' 'libwx_baseu_xml-3.2.so'
    'libglvnd' 'libEGL.so' 'libOpenGL.so'
    'cairo'  'libcairo.so'
    'fontconfig'  'libfontconfig.so'
    'gtk3' 'libgdk-3.so' 'libgtk-3.so'
    'gdk-pixbuf2' 'libgdk_pixbuf-2.0.so'
    'glib2' 'libgio-2.0.so' 'libglib-2.0.so' 'libgobject-2.0.so'
    'gspell' 'libgspell-1.so'
    'libjpeg-turbo' 'libjpeg.so'
    'libmspack' 'libmspack.so'
    'libnotify' 'libnotify.so'
    'pango' 'libpango-1.0.so' 'libpangocairo-1.0.so' 'libpangoft2-1.0.so'
    'libtiff' 'libtiff.so'
    'wayland' 'libwayland-client.so' 'libwayland-egl.so'
    'libxkbcommon' 'libxkbcommon.so'
  )
  provides=(
    'wxwidgets'
    "wxwidgets-gtk3=${pkgver:0:3}"
    'libwx_gtk3u_adv-3.2.so'
    'libwx_gtk3u_aui-3.2.so'
    'libwx_gtk3u_core-3.2.so'
    'libwx_gtk3u_gl-3.2.so'
    'libwx_gtk3u_html-3.2.so'
    'libwx_gtk3u_propgrid-3.2.so'
    'libwx_gtk3u_qa-3.2.so'
    'libwx_gtk3u_ribbon-3.2.so'
    'libwx_gtk3u_richtext-3.2.so'
    'libwx_gtk3u_stc-3.2.so'
    'libwx_gtk3u_webview-3.2.so'
    'libwx_gtk3u_xrc-3.2.so'
  )
  optdepends=('webkit2gtk-4.1: for webview support')
  conflicts=('wxwidgets-gtk3')

  DESTDIR="${pkgdir}" cmake --install build-gtk3

  ln -s wx-config "${pkgdir}/usr/bin/wx-config-gtk3"
  rm -fr "${pkgdir}/usr/bin/"wxrc{,-3*}
  rm -fr "${pkgdir}/usr/include"
  rm -fr "${pkgdir}/usr/lib/"*base*
  mv "${pkgdir}/usr/lib/cmake/wxWidgets"{,GTK}
  for _f in "${pkgdir}/usr/lib/cmake/wxWidgetsGTK/"*; do
    mv $_f $(dirname $_f)/$(basename $_f | sed -e 's/wxWidgets/wxWidgetsGTK/')
  done
  rm -fr "${pkgdir}/usr/share/bakefile"
  rm -fr "${pkgdir}/usr/share/"{aclocal,locale}

  install -Dm644 wxwidgets/docs/licence.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_wxwidgets-gtk4-light() {
  pkgdesc="wxWidgets GTK4 Toolkit (GNOME/GStreamer free!)"
  depends=(
    'sdl2'
    'wxwidgets-common-light' 'libwx_baseu-3.2.so' 'libwx_baseu_xml-3.2.so'
    'gspell' 'libgspell-1.so'
    'gtk4' 'libgtk-4.so'
    'libmspack' 'libmspack.so'
    'libnotify' 'libnotify.so'
    'libtiff'  'libtiff.so'
)
  optdepends=('webkit2gtk-4.1: for webview support')
  provides=(
    'wxwidgets'
    "wxwidgets-gtk4=${pkgver:0:3}"
  )
  conflicts=('wxwidgets-gtk4')

  DESTDIR="${pkgdir}" cmake --install build-gtk4

  ln -s wx-config "${pkgdir}/usr/bin/wx-config-gtk4"
  rm -fr "${pkgdir}/usr/bin/"wxrc{,-4*}
  rm -fr "${pkgdir}/usr/include"
  rm -fr "${pkgdir}/usr/lib/"*base*
  mv "${pkgdir}/usr/lib/cmake/wxWidgets"{,GTK4}
  for _f in "${pkgdir}/usr/lib/cmake/wxWidgetsGTK4/"*; do
    mv $_f $(dirname $_f)/$(basename $_f | sed -e 's/wxWidgets/wxWidgetsGTK4/')
  done
  rm -fr "${pkgdir}/usr/share/bakefile"
  rm -fr "${pkgdir}/usr/share/"{aclocal,locale}

  install -Dm644 wxwidgets/docs/licence.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_wxwidgets-common-light() {
  pkgdesc="wxWidgets common & base (GNOME/GStreamer free!)"
  depends=(
    'gcc-libs'
    'glibc'
    'bash'
    'zlib'
    'xz'
    'curl' 'libcurl.so'
    'expat' 'libexpat.so'
    'glib2' 'libglib-2.0.so' 'libgobject-2.0.so'
    'xz' 'liblzma.so'
    'pcre2' 'libpcre2-32.so'
    'libsecret' 'libsecret-1.so'
  )
  provides=(
    'wxbase'
    'wxbase-light'
    "wxwidgets-common=${pkgver:0:3}"
    'libwx_baseu-3.2.so'
    'libwx_baseu_net-3.2.so'
    'libwx_baseu_xml-3.2.so'
  )
  conflicts=(
    'wxbase'
    'wxwidgets-common'
  )

  DESTDIR="${pkgdir}" cmake --install build-qt5
  DESTDIR="${pkgdir}" cmake --install build-gtk3
#   DESTDIR="${pkgdir}" cmake --install build-gtk4
  DESTDIR="${pkgdir}" cmake --install build-base

  mv "${pkgdir}/usr/bin/wx-config" "${pkgdir}/usr/bin/wx-config-base"
  rm -fr "${pkgdir}/usr/lib/"*qt*.so*
  rm -fr "${pkgdir}/usr/lib/"*gtk*.so*
  rm -fr "${pkgdir}/usr/lib/wx/"{config,include}/{gtk,qt}*
  rm -fr "${pkgdir}/usr/lib/wx/"3*

  install -Dm644 wxwidgets/wxwin.m4 -t "${pkgdir}/usr/share/aclocal"

  install -Dm644 wxwidgets/docs/licence.txt "${pkgdir}/usr/share/licenses/wxwidgets-common-light/LICENSE"
}