summaryrefslogtreecommitdiff
blob: f17cd8b086497965527e423b61604606e619e503 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/libsvgtiny/libsvgtiny-0.1.0.ebuild,v 1.2 2013/06/22 09:51:09 hasufell Exp $

EAPI=5

inherit base toolchain-funcs multilib-minimal

DESCRIPTION="framebuffer abstraction library, written in C"
HOMEPAGE="http://www.netsurf-browser.org/projects/libsvgtiny/"
NETSURF_BUILDSYSTEM="buildsystem-1.0"
SRC_URI="http://download.netsurf-browser.org/libs/releases/${P}-src.tar.gz
	http://download.netsurf-browser.org/libs/releases/${NETSURF_BUILDSYSTEM}.tar.gz -> netsurf-${NETSURF_BUILDSYSTEM}-1.0.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm"
IUSE=""

RDEPEND=">=net-libs/libdom-0.0.1[xml,static-libs?,${MULTILIB_USEDEP}]
	>=dev-libs/libwapcaplet-0.2.0[static-libs?,${MULTILIB_USEDEP}]"
DEPEND="${RDEPEND}
	dev-util/gperf"

### future context of netsurf.eclass

NETSURF_BUILDSYSTEM="${NETSURF_BUILDSYSTEM:-buildsystem-1.0}"
SRC_URI=${SRC_URI:-http://download.netsurf-browser.org/libs/releases/${P}-src.tar.gz}
SRC_URI+="
	http://download.netsurf-browser.org/libs/releases/${NETSURF_BUILDSYSTEM}.tar.gz -> netsurf-${NETSURF_BUILDSYSTEM}.tar.gz"
IUSE+=" debug static-libs"
if has doc ${IUSE} ; then
	DEPEND+="
	doc? ( app-doc/doxygen )"
fi
DEPEND+="
	virtual/pkgconfig"
pkg_setup(){
	netsurf_src_prepare() {
		if [ -f docs/doxygen.conf ] ; then
			if ! has doc ${IUSE} ; then
				if [ -z "${NETSURF_IGNORE_DOXYGEN}" ] ; then
					die "Missing IUSE=doc"
				fi
			fi
		fi

		base_src_prepare

		multilib_copy_sources
	}

	netsurf_src_configure() {
		netsurf_makeconf=(
			NSSHARED=${WORKDIR}/${NETSURF_BUILDSYSTEM}
			Q=
			CCOPT=
			CCNOOPT=
			CCDBG=
			LDDBG=
			AR="$(tc-getAR)"
			BUILD=$(usex debug debug release)
			DESTDIR="${D}"
			PREFIX="${EROOT}"usr
		)

		multilib-minimal_src_configure
	}

	netsurf_src_compile() {
		multilib-minimal_src_compile

		if has doc ${IUSE} ; then
			use doc && netsurf_make docs
		fi
	}

	netsurf_src_test() {
		multilib-minimal_src_test
	}

	netsurf_src_install() {
		multilib-minimal_src_install
	}

	multilib_src_configure() {
		sed -e "/^INSTALL_ITEMS/s: /lib: /$(get_libdir):g" \
			-i Makefile || die
		if [ -f ${PN}.pc.in ] ; then
			sed -e "/^libdir/s:/lib:/$(get_libdir):g" \
				-i ${PN}.pc.in || die
		fi
	}

	netsurf_make() {
		emake CC="$(tc-getCC)" LD="$(tc-getLD)" "${netsurf_makeconf[@]}" \
			COMPONENT_TYPE=lib-shared "$@"
		if use static-libs ; then
			emake CC="$(tc-getCC)" LD="$(tc-getLD)" "${netsurf_makeconf[@]}" \
				COMPONENT_TYPE=lib-static "$@"
		fi
	}

	multilib_src_compile() {
		netsurf_make
	}

	multilib_src_test() {
		netsurf_make test
	}

	multilib_src_test() {
		netsurf_make test
	}

	multilib_src_install() {
		netsurf_make install
	}

	multilib_src_install_all() {
		if has doc ${IUSE} ; then
			use doc && dohtml -r build/docs/html/*
		fi
	}
}

src_prepare() {
	netsurf_src_prepare
}

src_configure() {
	netsurf_src_configure
}

src_compile() {
	netsurf_src_compile
}

src_test() {
	netsurf_src_test
}

src_install() {
	netsurf_src_install
}