aboutsummaryrefslogtreecommitdiffstats
path: root/community/wxgtk/APKBUILD
blob: b00b95e37ddd80c75d17f99b30412f57def54056 (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
# Contributor: Rasmus Thonsen <oss@cogitri.dev>
# Contributor: Pavel Kalian <pavel@kalian.cz>
# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
pkgname=wxgtk
pkgver=3.0.4
pkgrel=5
pkgdesc="GTK2 port of wxWidgets GUI library"
url="https://www.wxwidgets.org/"
arch="all"
license="wxWidgets"
depends_dev="gtk+2.0-dev mesa-dev zlib-dev tiff-dev libjpeg-turbo-dev expat-dev
	libsm-dev gtk+3.0-dev"
makedepends="$depends_dev glu-dev sdl-dev gst-plugins-base-dev
	gstreamer-dev"
options="!check" # doesn't have any checks
subpackages="
	$pkgname-dev
	$pkgname-lang
	$pkgname-base
	$pkgname-base-dev:_base_dev
	$pkgname-media:_media2
	${pkgname}3-media:_media3
	${pkgname}3-dev:_dev3
	${pkgname}3:_gtk3
	"
source="https://github.com/wxWidgets/wxWidgets/releases/download/v${pkgver}/wxWidgets-${pkgver}.tar.bz2"
builddir="$srcdir/wxWidgets-$pkgver"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	for gtk_version in 2 3; do
		cd "$builddir"
		mkdir gtk${gtk_version}
		cd "$builddir"/gtk${gtk_version}
		"$builddir"/configure \
			--build=$CBUILD \
			--host=$CHOST \
			--prefix=/usr \
			--with-sdl \
			--with-opengl \
			--enable-unicode \
			--enable-aui \
			--enable-no_deps \
			--enable-shared \
			--enable-sound \
			--enable-mediactrl \
			--disable-rpath \
			--disable-optimise \
			--with-gtk=${gtk_version}

			make
		done
}

package() {
	cd "$builddir"/gtk2
	make DESTDIR="$pkgdir" install

	cd "$builddir"/gtk3
	make DESTDIR="$pkgdir" install
}

dev() {
	depends_dev="$depends_dev wxgtk-base-dev=$pkgver-r$pkgrel"
	default_dev

	mkdir -p "$subpkgdir"/usr/lib/wx/config

	sed 's,_include_cppflags="-I${includedir}/wx-3.0",_include_cppflags="-I${includedir}/",' "$pkgdir"/usr/lib/wx/config/gtk2-unicode-3.0 >"$subpkgdir"/usr/lib/wx/config/gtk2-unicode-3.0
	chmod +x "$subpkgdir"/usr/lib/wx/config/gtk2-unicode-3.0
	rm "$pkgdir"/usr/lib/wx/config/gtk2-unicode-3.0


	mkdir -p "$subpkgdir"/usr/bin
	cd "$subpkgdir"/usr/bin/
	ln -s /usr/lib/wx/config/gtk2-unicode-3.0 wx-config-gtk2
	ln -sf /usr/bin/wx-config-gtk2 wx-config

	# Move stuff back into the wild for the other -dev packages
	mv "$subpkgdir"/usr/include/wx-3.0 "$pkgdir"/usr/include
	mv "$subpkgdir"/usr/lib/libwx_baseu*.so "$pkgdir"/usr/lib
	mv "$subpkgdir"/usr/share/aclocal "$pkgdir"/usr/share
	mv "$subpkgdir"/usr/lib/libwx_gtk3u*.so "$pkgdir"/usr/lib

	mkdir -p "$pkgdir"/usr/lib/wx/include
	mv "$subpkgdir"/usr/lib/wx/include/gtk3-unicode-3.0 "$pkgdir"/usr/lib/wx/include
}

_base_dev() {
	short_desc="Common development files of wxgtk"
	pkgdesc="Non-GUI support classes from the wxWidgets library"
	default_dev

	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/bin/wxrc* "$subpkgdir"/usr/bin/
	mv "$pkgdir"/usr/share/bakefile "$subpkgdir"/usr/share/

	# Move stuff back into the wild
	mv "$subpkgdir"/usr/lib/libwx_gtk3u*.so "$pkgdir"/usr/lib
	mv "$subpkgdir"/usr/lib/wx/include "$pkgdir"/usr/lib/wx
}

_dev3() {
	depends_dev="$depends_dev wxgtk-base-dev=$pkgver-r$pkgrel"
	pkgdesc="${pkgdesc/GTK2/GTK3}"
	default_dev

	mkdir -p "$subpkgdir"/usr/lib/wx/config

	sed 's,_include_cppflags="-I${includedir}/wx-3.0",_include_cppflags="-I${includedir}/",' "$pkgdir"/usr/lib/wx/config/gtk3-unicode-3.0 >"$subpkgdir"/usr/lib/wx/config/gtk3-unicode-3.0
	chmod +x "$subpkgdir"/usr/lib/wx/config/gtk3-unicode-3.0
	rm "$pkgdir"/usr/lib/wx/config/gtk3-unicode-3.0

	mkdir -p "$subpkgdir"/usr/bin
	cd "$subpkgdir"/usr/bin/
	ln -s /usr/lib/wx/config/gtk3-unicode-3.0 wx-config-gtk3
}

_media2() {
	pkgdesc="Multimedia add-on for the wxWidgets library (GTK2)"

	mkdir -p "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/lib/libwx_gtk2u_media-*.so.* "$subpkgdir"/usr/lib/
}

_media3() {
	pkgdesc="Multimedia add-on for the wxWidgets library (GTK3)"

	mkdir -p "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/lib/libwx_gtk3u_media-*.so.* "$subpkgdir"/usr/lib/
}

base() {
	pkgdesc="Non-GUI support classes from the wxWidgets library"
	mkdir -p "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/lib/libwx_baseu-*.so.* \
		"$pkgdir"/usr/lib/libwx_baseu_net-*.so.* \
		"$pkgdir"/usr/lib/libwx_baseu_xml-*.so.* \
		"$subpkgdir"/usr/lib/
}

_gtk3() {
	pkgdesc="${pkgdesc/GTK2/GTK3}"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libwx_gtk3* "$subpkgdir"/usr/lib/
}

sha512sums="c9e6b35d541a99921c54cfdac260843f574f146b27f924a7a0fca5007344fa99865a96ded95e6802329ad9221b4880d62b92277a1b4c1ce71420acb672ad9158  wxWidgets-3.0.4.tar.bz2"