1SUMMARY="GUI to profilers such as Valgrind"
2DESCRIPTION="QCachegrind is a Qt GUI to visualize profiling data.
3It's mainly used as visualization frontend for data measured
4by Cachegrind/Callgrind tools from the Valgrind package, but
5there are converters for other measurement tools available.
6
7Features
8
9* direct support for profiles generated by Cachegrind/Callgrind
10* support for arbitrary event types and derived event types
11* sorted function list, with grouping according to ELF object/source
12  file/symbol namespace (such as C++ classes)
13* correct handling of recursive cycles (similar to GProf)
14* various visualization views for a selected function, such as
15  - treemap in caller/callee direction
16  - call graph around function
17  - source & assembly annotation"
18HOMEPAGE="https://github.com/KDE/kcachegrind"
19COPYRIGHT="2010-2020 KDE Organisation"
20LICENSE="GNU GPL v2"
21REVISION="1"
22SOURCE_URI="https://github.com/KDE/kcachegrind/archive/refs/tags/v$portVersion.tar.gz"
23CHECKSUM_SHA256="f5696891680058229351a721c06cfec4d4417a2293e90133bb8ce3652db85ab0"
24SOURCE_DIR="kcachegrind-$portVersion"
25ADDITIONAL_FILES="qcachegrind.rdef.in"
26
27ARCHITECTURES="all !x86_gcc2"
28SECONDARY_ARCHITECTURES="x86"
29
30PROVIDES="
31	qcachegrind$secondaryArchSuffix = $portVersion
32	app:QCachegrind$secondaryArchSuffix = $portVersion
33	cmd:cgview
34	"
35REQUIRES="
36	haiku$secondaryArchSuffix
37	cmd:dbus_launch
38	lib:libGL$secondaryArchSuffix
39	lib:libQt5Core$secondaryArchSuffix
40	lib:libQt5DBus$secondaryArchSuffix
41	lib:libQt5Gui$secondaryArchSuffix
42	lib:libQt5Widgets$secondaryArchSuffix
43	"
44
45BUILD_REQUIRES="
46	haiku${secondaryArchSuffix}_devel
47	devel:libQt5Core$secondaryArchSuffix
48	devel:libQt5DBus$secondaryArchSuffix
49	devel:libQt5Gui$secondaryArchSuffix
50	devel:libQt5Widgets$secondaryArchSuffix
51	"
52BUILD_PREREQUIRES="
53	cmd:qmake
54	cmd:g++$secondaryArchSuffix
55	cmd:make
56	cmd:pkg_config$secondaryArchSuffix
57	"
58
59defineDebugInfoPackage qcachegrind$secondaryArchSuffix \
60	"$binDir"/cgview \
61	"$appsDir"/QCachegrind
62
63BUILD()
64{
65	mkdir -p build
66	cd build
67
68	qmake ..
69	make $jobArgs
70}
71
72INSTALL()
73{
74	cd build
75	mkdir $appsDir $binDir
76	cp -R cgview/cgview $binDir
77	cp -R qcachegrind/qcachegrind $appsDir/QCachegrind
78
79	local APP_SIGNATURE="application/x-vnd.kde-qcachegrind"
80	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
81	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
82	local MINOR="`echo "$portVersion" | cut -d. -f3`"
83	local LONG_INFO="$SUMMARY"
84	sed \
85		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
86		-e "s|@MAJOR@|$MAJOR|" \
87		-e "s|@MIDDLE@|$MIDDLE|" \
88		-e "s|@MINOR@|$MINOR|" \
89		-e "s|@LONG_INFO@|$LONG_INFO|" \
90		$portDir/additional-files/qcachegrind.rdef.in > qcachegrind.rdef
91
92	addResourcesToBinaries qcachegrind.rdef $appsDir/QCachegrind
93	addAppDeskbarSymlink $appsDir/QCachegrind
94}
95