1SUMMARY="2D animation and drawing program based on Qt5"
2DESCRIPTION="Pencil2D lets you create traditional hand-drawn animation (cartoon) \
3using both bitmap and vector graphics on Windows, MacOS and Linux. \
4Pencil2D is free and open source."
5HOMEPAGE="https://www.pencil2d.org/"
6COPYRIGHT="Pascal Naidon, Patrick Corrieri, Matt Chang"
7LICENSE="GNU GPL v2"
8REVISION="1"
9SOURCE_URI="https://github.com/pencil2d/pencil/archive/v$portVersion.tar.gz"
10CHECKSUM_SHA256="31903c54c8f0a79385cc5f519b380d26524219984e619204820b946c96fc2482"
11ADDITIONAL_FILES="pencil.rdef.in"
12
13ARCHITECTURES="all !x86_gcc2"
14SECONDARY_ARCHITECTURES="x86"
15
16PROVIDES="
17	pencil$secondaryArchSuffix = $portVersion
18	app:Pencil2D$secondaryArchSuffix = $portVersion
19	"
20REQUIRES="
21	haiku$secondaryArchSuffix
22	cmd:ffmpeg
23	lib:libGL$secondaryArchSuffix
24	lib:libQt5Core$secondaryArchSuffix
25	lib:libQt5Gui$secondaryArchSuffix
26	lib:libQt5Multimedia$secondaryArchSuffix
27	lib:libQt5Svg$secondaryArchSuffix
28	lib:libQt5Widgets$secondaryArchSuffix
29	lib:libQt5Xml$secondaryArchSuffix
30	"
31
32BUILD_REQUIRES="
33	haiku${secondaryArchSuffix}_devel
34	devel:libfreetype$secondaryArchSuffix
35	devel:libGL$secondaryArchSuffix
36	devel:libQt5Core$secondaryArchSuffix
37	devel:libQt5Gui$secondaryArchSuffix
38	devel:libQt5Multimedia$secondaryArchSuffix
39	devel:libQt5Svg$secondaryArchSuffix
40	devel:libQt5Widgets$secondaryArchSuffix
41	devel:libQt5Xml$secondaryArchSuffix
42	"
43BUILD_PREREQUIRES="
44	cmd:g++$secondaryArchSuffix
45	cmd:make
46	cmd:pkg_config$secondaryArchSuffix
47	cmd:qmake$secondaryArchSuffix >= 5
48	cmd:which
49	"
50
51PATCH()
52{
53	sed -e '/tests/ s/^#*/#/' -i $sourceDir/pencil2d.pro
54}
55
56BUILD()
57{
58	export DISABLE_ASLR=1
59
60	qmake
61	make $jobArgs
62}
63
64INSTALL()
65{
66	mkdir -p $appsDir
67	cp bin/pencil2d $appsDir/Pencil2D
68
69	local APP_SIGNATURE="application/x-vnd.pencil2d"
70	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
71	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
72	local MINOR="`echo "$portVersion" | cut -d. -f3`"
73	local LONG_INFO="$SUMMARY"
74	sed \
75		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
76		-e "s|@MAJOR@|$MAJOR|" \
77		-e "s|@MIDDLE@|$MIDDLE|" \
78		-e "s|@MINOR@|$MINOR|" \
79		-e "s|@LONG_INFO@|$LONG_INFO|" \
80		$portDir/additional-files/pencil.rdef.in > pencil.rdef
81
82	addResourcesToBinaries pencil.rdef $appsDir/Pencil2D
83
84	addAppDeskbarSymlink $appsDir/Pencil2D
85}
86