summaryrefslogtreecommitdiff
blob: 2d57f637a09ddb66938cf6cb0f27c8875bb5c03c (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
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit scons-utils toolchain-funcs

DESCRIPTION="easy-to-use image and video I/O functions"
HOMEPAGE="https://github.com/tmbdev/iulib"
SRC_URI="https://iulib.googlecode.com/files/${P}.tgz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="sdl"

RDEPEND="sys-libs/zlib
	media-libs/libpng:0=
	virtual/jpeg:0
	media-libs/tiff:0
	sdl? (
		media-libs/libsdl
		media-libs/sdl-gfx
	)"
DEPEND="${RDEPEND}
	dev-util/scons"

PATCHES=(
	"${FILESDIR}/${P}-scons-build-env.patch"
	"${FILESDIR}/${P}-default-arguments-declaration.patch"
)

src_prepare() {
	default
	sed -i \
		-e "/^have_sdl = 1/s:1:$(usex sdl 1 0):" \
		-e '/tiff/s:inflate:TIFFOpen:' \
		-e '/progs.Append(LIBS=libiulib)/s:Append:Prepend:' \
		-e "/^libdir/s:/lib:/$(get_libdir):" \
		SConstruct || die #297326 #308955 #310439
	sed -i '/SDL.SDL_image.h/d' utils/dgraphics.cc || die #310443
	tc-export AR CC CXX RANLIB
}

src_configure() {
	# Avoid configure as we build/install with scons
	:
}

src_compile() {
	escons prefix=/usr
}

src_install() {
	escons prefix="${D}"/usr install
	dodoc CHANGES README TODO
}