1SUMMARY="Powerful yet simple to use screenshot software"
2DESCRIPTION="Features
3
4* Customizable appearance.
5* Easy to use.
6* In-app screenshot edition.
7* DBus interface.
8* Upload to Imgur."
9HOMEPAGE="https://github.com/flameshot-org/flameshot/"
10COPYRIGHT="2022 lupoDharkael"
11LICENSE="GNU GPL v3"
12REVISION="1"
13SOURCE_URI="https://github.com/flameshot-org/flameshot/archive/refs/tags/v$portVersion.tar.gz"
14CHECKSUM_SHA256="c82c05d554e7a6d810aca8417ca12b21e4f74864455ab4ac94602668f85ac22a"
15PATCHES="flameshot-$portVersion.patchset"
16ADDITIONAL_FILES="
17	flameshot.rdef.in
18	icons.zip
19	"
20
21ARCHITECTURES="all !x86_gcc2"
22SECONDARY_ARCHITECTURES="x86"
23
24PROVIDES="
25	flameshot$secondaryArchSuffix = $portVersion
26	app:Flameshot$secondaryArchSuffix = $portVersion
27	"
28REQUIRES="
29	haiku$secondaryArchSuffix
30	cmd:dbus_launch
31	lib:libGL$secondaryArchSuffix
32	lib:libQt5Core$secondaryArchSuffix
33	lib:libQt5DBus$secondaryArchSuffix
34	lib:libQt5Gui$secondaryArchSuffix
35	lib:libQt5Network$secondaryArchSuffix
36	lib:libQt5Svg$secondaryArchSuffix
37	lib:libQt5Widgets$secondaryArchSuffix
38	"
39
40BUILD_REQUIRES="
41	haiku${secondaryArchSuffix}_devel
42	devel:libQt5Core$secondaryArchSuffix
43	"
44BUILD_PREREQUIRES="
45	cmd:cmake
46	cmd:gcc$secondaryArchSuffix
47	cmd:lrelease$secondaryArchSuffix
48	cmd:make
49	"
50
51PATCH()
52{
53	unzip -o $sourceDir/../../additional-files/icons.zip -d $sourceDir/data/img
54}
55
56BUILD()
57{
58	mkdir -p build
59	cd build
60	cmake .. \
61		-DCMAKE_BUILD_TYPE=Release \
62		-DCMAKE_INSTALL_PREFIX=$appsDir/Flameshot
63
64	make $jobArgs
65}
66
67INSTALL()
68{
69	cd build
70	make install/strip
71
72	mv $appsDir/Flameshot/bin/flameshot \
73		$appsDir/Flameshot/Flameshot
74
75	mv $appsDir/Flameshot/share/flameshot/translations \
76		$appsDir/Flameshot
77
78	rm -rf $appsDir/Flameshot/bin
79	rm -rf $appsDir/Flameshot/share
80
81	local APP_SIGNATURE="application/x-vnd.flameshot"
82	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
83	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
84	local MINOR="`echo "$portVersion" | cut -d. -f3`"
85	local LONG_INFO="$SUMMARY"
86	sed \
87		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
88		-e "s|@MAJOR@|$MAJOR|" \
89		-e "s|@MIDDLE@|$MIDDLE|" \
90		-e "s|@MINOR@|$MINOR|" \
91		-e "s|@LONG_INFO@|$LONG_INFO|" \
92		$portDir/additional-files/flameshot.rdef.in > flameshot.rdef
93
94	addResourcesToBinaries flameshot.rdef $appsDir/Flameshot/Flameshot
95
96	addAppDeskbarSymlink $appsDir/Flameshot/Flameshot
97}
98