summaryrefslogtreecommitdiff
blob: 486537c9d1dbd45758d80d3f90d8b95e7ba48616 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit multilib flag-o-matic

DESCRIPTION="Captury Tool - captures the screen from your OpenGL games."
HOMEPAGE="http://battousai.mylair.de/projects/captury/"
SRC_URI="http://battousai.mylair.de/dist/${PN}/${P}.tar.bz2"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug multilib"

RDEPEND="media-libs/xvid
		 x11-libs/libX11
		 virtual/opengl"

DEPEND="${RDEPEND}
		dev-util/pkgconfig"

RESTRICT="multilib-pkg-force"

S="${WORKDIR}/${P}/${PN}"

setup_env() {
	myconf=""
	makeopts=""

	if [[ ${ABI} != ${DEFAULT_ABI} ]]; then
		myconf="${myconf} --disable-builtin-strip-soname"
		makeopts="${makeopts} STRIP_SONAME=$(pwd)/../abi-${DEFAULT_ABI}/src/libGLcaptury/strip-soname"
	fi
}

src_compile() {
	if [[ -z ${OABI} ]] && ( use multilib || has_multilib_profile ); then
		einfo "Building multilib ${PN} for ABIs: $(get_install_abis)"
		OABI=${ABI}
		for ABI in $DEFAULT_ABI $(get_install_abis); do
			export ABI=${ABI}
			src_compile
		done
		ABI=${OABI}
	fi

	use debug && append-flags -O0 -g3
	use debug || append-flags -DNDEBUG=1

	if [[ ! -f configure ]]; then
		./autogen.sh || die "autogen.sh failed"
	fi

	test -d abi-${ABI} && return

	mkdir abi-${ABI}
	pushd abi-${ABI}

	einfo "Compiling for ABI ${ABI}..."
	einfo

	setup_env

	../configure ${myconf} \
		--prefix="/usr" \
		--host="${CHOST}" \
		--libdir="/usr/$(get_libdir)" \
		|| die "./configure for ABI ${ABI} failed"

	emake ${makeopts} \
		NATIVE_LIBGL="/usr/$(get_libdir)/libGL.so" \
		NATIVE_LIBX11="/usr/$(get_libdir)/libX11.so" \
		|| die "make for ABI ${ABI} failed"

	popd
}

src_install() {
	for ABI in $(get_install_abis); do
		pushd abi-${ABI}
		setup_env
		einfo "make ${makeopts} install DESTDIR=\"${D}\""
		make ${makeopts} install DESTDIR="${D}" || die "make install for ABI ${ABI} failed."
		popd
	done

	dodoc AUTHORS ChangeLog* NEWS README* TODO
}

# vim:ai:noet:ts=4:nowrap