summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6d86ae81c12f24cbf5c8c1d1e8b213175631302f (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
# Maintainer: Marco Pompili <aur@emarcs.org>

pkgname=openframeworks
pkgver=0.9.8
pkgrel=1
pkgdesc="An open source C++ toolkit for creative coding."
url="http://openframeworks.cc/"
arch=('x86_64' 'i686')
license=('MIT')
depends=('make' 'pkg-config' 'gcc' 'openal' 'python-lxml' 'glew' 'freeglut'
'freeimage' 'gstreamer' 'gst-plugins-base' 'gst-plugins-good' 'gst-plugins-bad'
'gst-plugins-ugly' 'gst-libav' 'opencv' 'libxcursor' 'assimp' 'boost' 'mpg123' 'rtaudio')
optdepends=('qtcreator' 'xterm')
options=(!strip)
install=openframeworks.install

[[ "$CARCH" == "i686" ]] && _arch="linux" || _arch="linux64"
_name="of_v${pkgver}_${_arch}_release"

source=("rtAudio.patch" "of-make-workspace")

source_i686=("http://www.openframeworks.cc/versions/v${pkgver}/of_v${pkgver}_linux_release.tar.gz")
source_x86_64=("http://www.openframeworks.cc/versions/v${pkgver}/of_v${pkgver}_linux64_release.tar.gz")
md5sums=('31600cdc597a275295fa35cf178f83c0'
         'd4a0cfda1970138b71d28f1cd81220da')
md5sums_x86_64=('df607d735617005e795234c834d91746')
md5sums_i686=('452002f4246fd0c9ab4ff5a4dc2f2111')

prepare() {
	export OF_ROOT=${srcdir}/${_name}
	export LC_ALL=C

	ARCH=$(uname -m)

	if [ "$ARCH" = "x86_64" ]; then
		LIBSPATH=linux64
	else
		LIBSPATH=linux
	fi

	GCC_MAJOR_GT_4=$(expr `gcc -dumpversion | cut -f1 -d.` \> 4)
	if [ $GCC_MAJOR_GT_4 -eq 1 ]; then
		msg2 "Rebuilding POCO libraries for gcc5, this could take a while..."

		sys_cores=$(getconf _NPROCESSORS_ONLN)

		if [ $sys_cores -gt 1 ]; then
			cores=$(($sys_cores-1))
		else
			cores=1
		fi

		msg2 "Found $sys_cores core/s, set sail!"

		cd ${OF_ROOT}/scripts/apothecary
		./apothecary -j${cores} update poco
	fi

	msg2 "Fix RtAudio.h path"
	cd $srcdir
	patch ${srcdir}/${_name}/libs/openFrameworks/sound/ofRtAudioSoundStream.cpp rtAudio.patch
}

build() {
	cd ${srcdir}/${_name}

	cd libs/openFrameworksCompiled/project

	msg2 "Building openFrameworks Debug version"
	make -j$cores Debug

	msg2 "Building openFrameworks Release version"
	make -j$cores Release

	cd ${srcdir}/${_name}

	msg2 "Building OF Project Generator tool..."
	cd apps/projectGenerator/commandLine
	make -j$cores Release

	cd ${srcdir}/${_name}

	msg2 "Building OF Project Generator interface..."
	cd libs/openFrameworksCompiled/project
	make -j$cores Release
}

package() {
	install -Dm755 "${srcdir}/${_name}/apps/projectGenerator/commandLine/bin/projectGenerator" \
	"${pkgdir}/usr/bin/projectGenerator"

	install -dm755 "${pkgdir}/opt"

	cp -R "${srcdir}/${_name}" "${pkgdir}/opt/openFrameworks"

	install -Dm775 "${srcdir}/of-make-workspace" "${pkgdir}/opt/openFrameworks/scripts/of-make-workspace"

	msg2 "Fixing emptyExample project files permissions..."

	chmod 644 "${pkgdir}"/opt/openFrameworks/apps/myApps/emptyExample/addons.make
	chmod 644 "${pkgdir}"/opt/openFrameworks/apps/myApps/emptyExample/config.make
	chmod 644 "${pkgdir}"/opt/openFrameworks/apps/myApps/emptyExample/emptyExample.qbs
	chmod 644 "${pkgdir}"/opt/openFrameworks/apps/myApps/emptyExample/Makefile

	install -D -m644 "${srcdir}/${_name}/LICENSE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md"
}