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

EAPI=2

inherit autotools toolchain-funcs

DESCRIPTION="Utility to modify HCI/SCI controls on Toshiba Laptops"
HOMEPAGE="http://www.schwieters.org/toshset/"
SRC_URI="http://schwieters.org/${PN}/allVersions/${P}.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug"

src_prepare() {
	sed -i '/$(BININSTALL) novatel_3g_suspend/d' "${S}/Makefile.in" || die "sed failed"
	sed -i '/$(DESTDIR)\/pm\/sleep.d\/$/d' "${S}/Makefile.in" || die "sed failed"
	sed -i "s/\(^CFLAGS = -Wall @OS_CFLAGS@ @DEBUGFLAGS@$\)/\1 ${CFLAGS}/" "${S}/Makefile.in" || die "sed failed"
	sed -i "/^LDFLAGS = -s/s:-s:${LDFLAGS}:" "${S}/Makefile.in" || die "sed failed"

	eautoreconf
}

src_configure() {
	econf $(use_enable debug)
}

src_compile() {
	emake CC=$(tc-getCC) CXX=$(tc-getCXX) || die "emake failed"
}

src_install() {
	emake CC=$(tc-getCC) CXX=$(tc-getCXX) \
		DESTDIR="${D}" install || die "emake install failed"
	dodoc README README.video || die
}

pkg_postinst() {
	ewarn "If you want to use ${PN} under ACPI you probably need to patch your kernel."
	ewarn "Check ${HOMEPAGE} for details."
}