aboutsummaryrefslogtreecommitdiffstats
path: root/main/qt5-qtbase/APKBUILD
blob: 4817a5d8f561032004ffb2dee223fc11f82dd4b2 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=qt5-qtbase
pkgver=5.4.2
_ver=${pkgver/_/-}
_ver=${_ver/beta0/beta}
_ver=${_ver/rc0/rc}
_V=${_ver/rc/RC}
pkgrel=1
pkgdesc="Qt5 - QtBase components"
url="http://qt-project.org/"
arch="all"
license="LGPLv2 with exceptions or GPLv3 with exceptions"
depends=""
depends_dev="mesa-dev libice-dev libsm-dev libx11-dev libxext-dev
	openssl-dev fontconfig-dev freetype-dev glib-dev libpng-dev zlib-dev
	sqlite-dev dbus-dev"
makedepends="$depends_dev
	bison
	cups-dev
	flex
	freetds-dev
	gawk
	gperf
	gtk+2.0-dev
	hicolor-icon-theme
	icu-dev
	libjpeg-turbo-dev
	libxkbcommon-dev
	libxi-dev
	libxrandr-dev
	libxrender-dev
	libxslt-dev
	libxv-dev
	mariadb-dev
	pcre-dev
	postgresql-dev
	udev-dev
	unixodbc-dev
	xcb-util-dev
	xcb-util-image-dev
	xcb-util-keysyms-dev
	xcb-util-wm-dev
	"
install=""
subpackages="$pkgname-dev $pkgname-doc
	$pkgname-sqlite $pkgname-odbc $pkgname-postgresql $pkgname-mysql
	$pkgname-tds $pkgname-x11"
case $pkgver in
*_beta*|*_rc*) _rel=development_releases;;
*) _rel=official_releases;;
esac
source="http://download.qt-project.org/$_rel/qt/${pkgver%.*}/$_ver/submodules/qtbase-opensource-src-$_V.tar.xz
	qt-musl-iconv-no-bom.patch
	qt-musl-socklen.patch
	"

_qt5_prefix=/usr/lib/qt5
_qt5_datadir=/usr/share/qt5

_builddir="$srcdir"/qtbase-opensource-src-$_V
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch)
			msg "Applying $i"
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done
	sed -i -e "s|-O2|$CXXFLAGS|" \
		-e "/^QMAKE_RPATH/s| -Wl,-rpath,||g" \
		-e "/^QMAKE_LFLAGS\s/s|+=|+= $LDFLAGS|g" \
		mkspecs/common/*.conf || return 1
}

build() {
	local _arch

	cd "$_builddir"

	case "$CTARGET" in
	arm*) _arch="";;
	*) _arch="-reduce-relocations";;
	esac

	./configure -confirm-license -opensource \
		-archdatadir "$_qt5_prefix" \
		-bindir  "$_qt5_prefix"/bin \
		-datadir "$_qt5_datadir" \
		-dbus-linked \
		-docdir /usr/share/doc/qt5 \
		-examplesdir /usr/share/doc/qt5/examples \
		-glib \
		-gtkstyle \
		-icu \
		-importdir "$_qt5_prefix"/imports \
		-largefile \
		-libexecdir "$_qt5_prefix"/libexec \
		-no-openvg \
		-no-rpath \
		-no-separate-debug-info \
		-nomake examples \
		-opengl \
		-openssl-linked \
		-optimized-qmake \
		-plugin-sql-mysql \
		-plugin-sql-odbc \
		-plugin-sql-psql \
		-plugin-sql-sqlite \
		-plugin-sql-tds \
		-plugindir "$_qt5_prefix"/plugins \
		-prefix /usr \
		-silent \
		-sysconfdir /etc/xdg \
		-system-libjpeg \
		-system-libpng \
		-system-pcre \
		-system-sqlite \
		-system-xcb \
		-system-zlib \
		-translationdir "$_qt5_datadir"/translations \
		$_arch \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make INSTALL_ROOT="$pkgdir" install || return 1
	rm -f "$pkgdir"/usr/lib/*.la
	mkdir -p "$pkgdir"/usr/bin/
	for i in "$pkgdir"/$_qt5_prefix/bin/*; do
		ln -s ../lib/qt5/bin/${i##*/} "$pkgdir"/usr/bin/${i##*/}-qt5 || return 1
	done
}

_mv_files() {
	local i
	for i; do
		mkdir -p "$subpkgdir"/${i%/*}
		mv "$pkgdir"/$i "$subpkgdir"/$i || return 1
	done
}

dev() {
	cd "$pkgdir"
	_mv_files usr/lib/qt5/mkspecs \
		usr/lib/cmake \
		usr/lib/qt5/bin \
		usr/bin \
		$(find usr/ -name '*.prl') \
		|| return 1
	default_dev
}

sqlite() {
	pkgdesc="SQLite driver for Qt5's SQL classes"
	cd "$pkgdir"
	_mv_files usr/lib/qt5/plugins/sqldrivers/libqsqlite*
}

odbc() {
	pkgdesc="ODBC driver for Qt5's SQL classes"
	cd "$pkgdir"
	_mv_files usr/lib/qt5/plugins/sqldrivers/libqsqlodbc*
}

postgresql() {
	pkgdesc="PostgreSQL driver for Qt5's SQL classes"
	cd "$pkgdir"
	_mv_files usr/lib/qt5/plugins/sqldrivers/libqsqlpsql*
}

mysql() {
	pkgdesc="MySQL driver for Qt5's SQL classes"
	cd "$pkgdir"
	_mv_files usr/lib/qt5/plugins/sqldrivers/libqsqlmysql*
}

tds() {
	pkgdesc="TDS driver for Qt5's SQL classes"
	cd "$pkgdir"
	_mv_files usr/lib/qt5/plugins/sqldrivers/libqsqltds*
}

x11() {
	pkgdesc="Qt5 GUI-related libraries"
	depends="hicolor-icon-theme"
	cd "$pkgdir"
	_mv_files \
		usr/lib/libQt5Gui.so.* \
		usr/lib/libQt5Widgets.so.* \
		usr/lib/libQt5OpenGL.so.* \
		usr/lib/libQt5PrintSupport.so.* \
		usr/lib/qt5/plugins/generic \
		usr/lib/qt5/plugins/image* \
		usr/lib/qt5/plugins/platform* \
		usr/lib/qt5/plugins/printsupport* \
		|| return 1

	scanelf -Rn usr/ | egrep '(libX|libQt5Gui|libGL)' && return 1
	return 0
}

md5sums="67a95eec79ffc4a14f516ad6f3d24c96  qtbase-opensource-src-5.4.2.tar.xz
077e31e0cb0d25637a3b3638fffbef3c  qt-musl-iconv-no-bom.patch
bc83dc99f866423b4803453a0e2949d2  qt-musl-socklen.patch"
sha256sums="9fc4f720b8b5a8b8e4a7d45e13ce4d5b86756ad46fb406386637eb2de5fd5a74  qtbase-opensource-src-5.4.2.tar.xz
40b337c16bbb1d259f315fe5a1b110f9917223aee53b82809934efa4fa5e62a3  qt-musl-iconv-no-bom.patch
e70bdddf67c358c02099bebee460e3c5456666562bff9ef9ebaacf9f4ea7a6df  qt-musl-socklen.patch"
sha512sums="029da83969614bc9b3803c76242af62911e3c6de171b116b5cb8e2823cad0514ab705cc3fa331e042c679caeb099de4e9cd7ddea92959f675dda82533e3ad7fe  qtbase-opensource-src-5.4.2.tar.xz
a185ea5e984d2636e3f9f6c4ed8fad66a17575da0679724da60a3dc519468ab45aa9369f43ce5c64f07cb730910e36623164aefafca3aabe0359c62becca870e  qt-musl-iconv-no-bom.patch
fb621e9e5a60bb5bd4ad86fa41772fd8db7e8ad3a6e8d36a3d720d493d462db618e4bf3187e3eb66d123fceca64bbbd2df2afba506cc4c79bafa456cd67e82aa  qt-musl-socklen.patch"