APKBUILD 4.03 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=qt5-qttools
3
pkgver=5.9.1
4
pkgrel=0
Natanael Copa's avatar
Natanael Copa committed
5 6 7 8 9 10
pkgdesc="Qt5 - QtTool components"
url="http://qt-project.org/"
arch="all"
license="LGPLv2 with exceptions or GPLv3 with exceptions"
depends=""
depends_dev="qt5-qtbase-dev"
11
makedepends="$depends_dev"
Natanael Copa's avatar
Natanael Copa committed
12
install=""
13
subpackages="$pkgname-dev qt5-assistant:_assistant qt5-qdbusviewer:_dbusviewer"
14 15 16

_ver=${pkgver/_/-}
_ver=${_ver/beta0/beta}
17 18
_ver=${_ver/rc0/rc}
_V=${_ver/rc/RC}
19
case $pkgver in
20
*_beta*|*_rc*) _rel=development_releases;;
21 22 23
*) _rel=official_releases;;
esac

24
source="http://download.qt-project.org/$_rel/qt/${pkgver%.*}/$_ver/submodules/qttools-opensource-src-$_V.tar.xz
25 26 27 28
	assistant-qt5.desktop
	designer-qt5.desktop
	linguist-qt5.desktop
	qdbusviewer-qt5.desktop
Natanael Copa's avatar
Natanael Copa committed
29 30
	"

31
_qt5_prefix=/usr/lib/qt5
32
builddir="$srcdir"/qttools-opensource-src-$_V
Natanael Copa's avatar
Natanael Copa committed
33 34

build() {
35
	cd "$builddir"
36
	qmake-qt5 && make || return 1
Natanael Copa's avatar
Natanael Copa committed
37 38 39
}

package() {
40
	cd "$builddir"
Natanael Copa's avatar
Natanael Copa committed
41
	make install INSTALL_ROOT="$pkgdir" || return 1
42 43 44 45 46 47 48

	# -qt5 symlinks
	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

Natanael Copa's avatar
Natanael Copa committed
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
	for i in $source; do
		case $i in
		*.desktop) install -Dm644 "$srcdir"/$i \
			"$pkgdir"/usr/share/applications/$i || return 1;;
		esac
	done
	# icons
	install -m644 -p -D src/assistant/assistant/images/assistant.png \
		"$pkgdir"/usr/share/icons/hicolor/32x32/apps/assistant-qt5.png \
		|| return 1
	install -m644 -p -D src/assistant/assistant/images/assistant-128.png \
		"$pkgdir"/usr/share/icons/hicolor/128x128/apps/assistant-qt5.png\
		|| return 1
	install -m644 -p -D src/designer/src/designer/images/designer.png \
		"$pkgdir"/usr/share/icons/hicolor/32x32/apps/designer-qt5.png \
		|| return 1
	install -m644 -p -D src/qdbus/qdbusviewer/images/qdbusviewer.png \
		"$pkgdir"/usr/share/icons/hicolor/32x32/apps/qdbusviewer-qt5.png \
		|| return 1
	install -m644 -p -D src/qdbus/qdbusviewer/images/qdbusviewer-128.png \
		"$pkgdir"/usr/share/icons/hicolor/128x128/apps/qdbusviewer-qt5.png \
		|| return 1
	# linguist icons
	for icon in src/linguist/linguist/images/icons/linguist-*-32.png ; do
		size=$(echo ${icon##*/} | cut -d- -f2)
	    install -p -m644 -D ${icon} \
		"$pkgdir"/usr/share/icons/hicolor/${size}x${size}/apps/linguist.png || return 1
	    done
}

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

dev() {
	default_dev
	cd "$pkgdir"
90 91 92 93 94
	for i in designer lconvert linguist lrelease lupdate pixeltool \
		qcollectiongenerator qhelpconverter qhelpgenerator; do

		_mv_files $_qt5_prefix/bin/$i usr/bin/$i-qt5 || return 1
	done
Natanael Copa's avatar
Natanael Copa committed
95 96 97 98 99 100 101 102 103 104 105 106
	_mv_files \
		usr/share/applications/designer* \
		usr/share/applications/linguist* \
		usr/share/icons/hicolor/*/apps/designer* \
		usr/share/icons/hicolor/*/apps/linguist* \
		|| return 1
}

_assistant() {
	pkgdesc="Documentation browser for Qt5"
	cd "$pkgdir"
	_mv_files usr/bin/assist* \
107
		$_qt5_prefix/bin/assist* \
Natanael Copa's avatar
Natanael Copa committed
108 109 110 111 112 113 114 115 116
		usr/share/applications/*assistant* \
		usr/share/icons/hicolor/*/apps/assistant* \
		|| return 1
}

_dbusviewer() {
	pkgdesc="D-Bus debugger and viewer"
	cd "$pkgdir"
	_mv_files usr/bin/qdbusviewer* \
117
		$_qt5_prefix/bin/qdbusviewer* \
Natanael Copa's avatar
Natanael Copa committed
118 119 120 121 122
		usr/share/applications/qdbusviewer* \
		usr/share/icons/hicolor/*/apps/qdbusviewer* \
		|| return 1
}

123
sha512sums="689d0d19b56c333862dc3270b72e83ad640c0b6462c37b13c5ad522338d2d7e105c88d47f506243b5fcf4d5813b63ce559049977e8d2c3e4fd1d7c5be9cd0a3f  qttools-opensource-src-5.9.1.tar.xz
124 125 126 127
d566c5284854855541df7177b23f491d96f5064b571e899a44f1d4fcf8bbf1223590b05b1954278dc6f3f56341c917f5b846594c5bd2215b6a859224038d8ad2  assistant-qt5.desktop
72d9a2235a60c4ae05ba8395d473fe0b42c12e584da619dadb112eb67ba33a85fe0dab6c185d98112d7b25d3eeacaf02f7ef4731742e50c17eacc54c383661b3  designer-qt5.desktop
b6d8a672d19eed39ab868ff6fc880f255da94acb9e1e84f5905c0f3b9b6055547e8a706492973692c06dc23d35ce77622fc13efc11adf21b62c3baf4ef5ab2ad  linguist-qt5.desktop
dddcc8c945dcbaf834e8aa8f42fd6df8d6e257e673a256cfd4affed7caf119502dffe6864262d353e8c2e234296cd091279f120ab9502f1b323e20ae3c3dc709  qdbusviewer-qt5.desktop"