summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 46975a7e6935dfd695c13dec605d9e7c0858a7f1 (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
# Maintainer: Arti Zirk <arti@zirk.me>
# Contributor: Antonio Rojas <arojas@archlinux.org>
# Contributor: Eric BĂ©langer <eric@archlinux.org>

# This package pulls bunch of in flux wxWidgets patches together as noted in
# https://gitlab.com/kicad/code/kicad/-/issues/7207#note_1578155328
# Also borrwoed some things from AUR wxgtk-git package

pkgbase=wxwidgets-wayland-perf
pkgname=(wxwidgets-gtk3-wayland-perf wxwidgets-qt5-wayland-perf wxwidgets-common-wayland-perf)
pkgver=3.2.2.r189.gacea4afa5e01
pkgrel=1
epoch=1
arch=(x86_64)
url='https://wxwidgets.org'
license=(custom:wxWindows)
makedepends=(git cmake gst-plugins-base glu webkit2gtk libnotify qt5-base sdl2 libmspack)
# head of PR  Final bunch of proposed backports for 3.2.3 #23891
# https://github.com/wxWidgets/wxWidgets/pull/23891
source=("git+https://github.com/wxWidgets/wxWidgets.git#commit=acea4afa5e0176949353516a8f0ebb3db05bed82"
        "git+https://github.com/wxWidgets/Catch.git"
        "git+https://github.com/wxWidgets/pcre.git"
        "git+https://github.com/wxWidgets/nanosvg.git"
	"https://patch-diff.githubusercontent.com/raw/wxWidgets/wxWidgets/pull/23898.patch"
	"https://patch-diff.githubusercontent.com/raw/wxWidgets/wxWidgets/pull/23900.patch")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'dfac1456b4f6f4b8e955c2cfbc6aff61f7ad6b101d2906f69f7a6f1873298d48'
            '14ae7c30c8aef45a96255cdb171692e474df5bc5fa295c6f1c7b8c2a00a71edb')


pkgver() {
  cd wxWidgets
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd wxWidgets
  git config submodule.3rdparty/catch.url "${srcdir}/Catch"
  git -c protocol.file.allow=always submodule update --init 3rdparty/catch

  git config submodule.3rdparty/pcre.url "${srcdir}/pcre"
  git -c protocol.file.allow=always submodule update --init 3rdparty/pcre

  git config submodule.3rdparty/nanosvg.url "${srcdir}/nanosvg"
  git -c protocol.file.allow=always submodule update --init 3rdparty/nanosvg

  git apply "${srcdir}/23898.patch"
  git apply "${srcdir}/23900.patch"

  ./autogen.sh
}

build() {
  cmake -B build-gtk3 -S wxWidgets \
    -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_LIBMSPACK=ON \
    -DwxUSE_PRIVATE_FONTS=ON \
    -DwxUSE_GTKPRINT=ON
  cmake --build build-gtk3

  cmake -B build-qt5 -S wxWidgets \
    -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_LIBMSPACK=ON \
    -DwxUSE_PRIVATE_FONTS=ON
  cmake --build build-qt5

# Run configure to generate the Makefile, cmake doesn't install translations
  cd wxWidgets
  ./configure --prefix=/usr
}

package_wxwidgets-common-wayland-perf() {
  pkgdesc='Common libraries and headers for wxwidgets'
  depends=(expat pcre2 libsecret)
  provides=(wxwidgets-common)
  conflicts=(wxwidgets-common)

  DESTDIR="$pkgdir" cmake --install build-gtk3
  rm -r "$pkgdir"/usr/{bin/wx-config,lib/{cmake,wx,libwx_gtk*}}
  install -Dm644 wxWidgets/wxwin.m4 -t "$pkgdir"/usr/share/aclocal
# Install translations
  make DESTDIR="$pkgdir" -C wxWidgets locale_install

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

package_wxwidgets-gtk3-wayland-perf() {
  pkgdesc='GTK+3 implementation of wxWidgets API for GUI'
  depends=(gtk3 gst-plugins-base-libs libsm wxwidgets-common-wayland-perf libnotify libmspack sdl2)
  optdepends=('webkit2gtk: for webview support')
  provides=(wxwidgets-gtk3)
  conflicts=(wxwidgets-gtk3)

  DESTDIR="$pkgdir" cmake --install build-gtk3
  rm -r "$pkgdir"/usr/{include,lib/libwx_base*,bin/wxrc*}

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

package_wxwidgets-qt5-wayland-perf() {
  pkgdesc='Qt5 implementation of wxWidgets API for GUI'
  depends=(qt5-base wxwidgets-common-wayland-perf libmspack sdl2 libtiff)
  provides=(wxwidgets-qt5)
  conflicts=(wxwidgets-qt5)

  DESTDIR="$pkgdir" cmake --install build-qt5
  rm -r "$pkgdir"/usr/{include,lib/libwx_base*,bin/wxrc*}
  mv "$pkgdir"/usr/bin/wx-config{,-qt} # Conflicts with wx-gtk3
# Rename cmake files for coinstallability
  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

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