]> git.bzium.org - embe/overlay.git/blob - sys-power/iasl/iasl-20130117.ebuild
Podbicie wersji: sys-power/iasl-20130117
[embe/overlay.git] / sys-power / iasl / iasl-20130117.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-power/iasl/iasl-20120816.ebuild,v 1.1 2012/09/07 23:11:29 robbat2 Exp $
4
5 EAPI=4
6
7 RESTRICT=mirror
8
9 inherit toolchain-funcs flag-o-matic eutils
10
11 MY_PN=acpica-unix
12 MY_P=${MY_PN}-${PV}
13 MY_TESTS_P=${MY_PN/ca/tests}-${PV}
14 DESCRIPTION="Intel ACPI Source Language (ASL) compiler"
15 HOMEPAGE="https://www.acpica.org/downloads/index.php"
16 SRC_URI="http://www.acpica.org/download/${MY_P}.tar.gz
17         test? ( http://www.acpica.org/download/${MY_TESTS_P}.tar.gz )"
18
19 LICENSE="iASL"
20 SLOT="0"
21 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-fbsd ~x86-fbsd"
22 IUSE="test"
23
24 DEPEND="sys-devel/bison
25         sys-devel/flex"
26 RDEPEND=""
27
28 S=${WORKDIR}/${MY_P}
29
30 pkg_setup() {
31         if use test && has test ${FEATURES}; then
32                 ewarn 'You have selected USE="test". This will install the test results'
33                 ewarn "into /usr/share/${PF}/, compressed as a tarball."
34                 ewarn 'The tests themselves will only rarely die, but the test results'
35                 ewarn 'are interesting for arch testing. The tests may take quite some'
36                 ewarn 'time to complete.'
37         fi
38 }
39
40 src_prepare() {
41         find "${S}" -type f -name 'Makefile*' -print0 | \
42                 xargs -0 -I '{}' \
43                 sed -r -e 's:-\<Werror\>::g' -i '{}' \
44                 || die
45
46         export BITS=64
47 }
48
49 src_configure() {
50         :
51 }
52
53 src_compile() {
54         cd acpica/generate/unix
55         emake BITS=${BITS}
56 }
57
58 src_test() {
59         aslts_test
60         #aapits_test
61         #The aapits test currently fails, missing include probably.
62 }
63
64 src_install() {
65         cd acpica/generate/unix
66         emake install DESTDIR="${D}" BITS=${BITS}
67         default_src_install
68         #local bin
69         #for bin in $(<"${T}"/binlist) ; do
70         #       dobin "${T}"/${bin}
71         #done
72         dodoc "${S}"/changes.txt
73         newdoc "${S}"/source/compiler/readme.txt compiler-readme.txt
74         newdoc "${S}"/generate/unix/readme.txt unix-readme.txt
75         newdoc "${S}"/generate/lint/readme.txt lint-readme.txt
76         newdoc "${S}"/source/compiler/new_table.txt compiler-new_table.txt
77
78         if use test && has test ${FEATURES}; then
79                 tb="${T}"/testresults.tar.bz2
80                 export ASLTSDIR="$(<"${T}"/asltdir)"
81                 ebegin "Creating Test Tarball"
82                 tar -cjf "${tb}" -C "${ASLTSDIR}"/tmp/RESULTS .  || die "tar failed"
83                 eend $?
84                 dodir /usr/share/${PF}
85                 insinto /usr/share/${PF}
86                 doins ${tb} || die "doins testresults.tar.bz2 failed"
87         fi
88
89 }
90
91 aslts_test() {
92         export  ASL="${S}"/generate/unix/bin${BITS}/iasl \
93                 acpiexec="${S}"/generate/unix/bin${BITS}/acpiexec \
94                 ASLTSDIR="${WORKDIR}/${MY_TESTS_P}"/tests/aslts
95         export  PATH="${PATH}:${ASLTSDIR}/bin"
96         echo "$ASLTSDIR" >"${T}"/asltdir
97         cd "${ASLTSDIR}"
98         edos2unix $(find . -type 'f')
99         make install || die "make install aslts test failed"
100         chmod +x $(find bin/ ! -regex 'ERROR_OPCODES|HOW_TO_USE|README' ) || die "chmod bin +x failed"
101
102         #The below Do commands runs the tests twice and then dies if the results aren't
103         #Identical.
104         Do 1 || die "failed Do 1"
105         Do 2 || die "failed Do 2"
106 }
107
108 aapits_test() {
109         mv "${WORKDIR}/${MY_TESTS_P}/tests/aapits" "${S}/tools/" || die "mv failed"
110         cd "${S}/tools/aapits" || die "cannot find ${S}/tools/aapits"
111         edos2unix $(find . -type 'f')
112         chmod +x $(find bin/ | sed  -r -e '/\/[A-Z_]+$/d') || die "chmod bin +x failed"
113         make || die "make in aapits failed"
114         cd asl || die "cd asl failed"
115         make || die "make in asl failed"
116         cd ../bin
117         ./aapitsrun || die "aapitsrun failed"
118 }