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 $
7 inherit toolchain-funcs flag-o-matic eutils
11 MY_TESTS_P=${MY_PN/ca/tests}-${PV}
12 DESCRIPTION="Intel ACPI Source Language (ASL) compiler"
13 HOMEPAGE="https://www.acpica.org/downloads/index.php"
14 SRC_URI="http://www.acpica.org/download/${MY_P}.tar.gz
15 test? ( http://www.acpica.org/download/${MY_TESTS_P}.tar.gz )"
19 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-fbsd ~x86-fbsd"
22 DEPEND="sys-devel/bison
29 if use test && has test ${FEATURES}; then
30 ewarn 'You have selected USE="test". This will install the test results'
31 ewarn "into /usr/share/${PF}/, compressed as a tarball."
32 ewarn 'The tests themselves will only rarely die, but the test results'
33 ewarn 'are interesting for arch testing. The tests may take quite some'
34 ewarn 'time to complete.'
39 find "${S}" -type f -name 'Makefile*' -print0 | \
41 sed -r -e 's:-\<Werror\>::g' -i '{}' \
52 cd acpica/generate/unix
59 #The aapits test currently fails, missing include probably.
63 cd acpica/generate/unix
64 emake install DESTDIR="${D}" BITS=${BITS}
67 #for bin in $(<"${T}"/binlist) ; do
70 dodoc "${S}"/changes.txt
71 newdoc "${S}"/source/compiler/readme.txt compiler-readme.txt
72 newdoc "${S}"/generate/unix/readme.txt unix-readme.txt
73 newdoc "${S}"/generate/lint/readme.txt lint-readme.txt
74 newdoc "${S}"/source/compiler/new_table.txt compiler-new_table.txt
76 if use test && has test ${FEATURES}; then
77 tb="${T}"/testresults.tar.bz2
78 export ASLTSDIR="$(<"${T}"/asltdir)"
79 ebegin "Creating Test Tarball"
80 tar -cjf "${tb}" -C "${ASLTSDIR}"/tmp/RESULTS . || die "tar failed"
82 dodir /usr/share/${PF}
83 insinto /usr/share/${PF}
84 doins ${tb} || die "doins testresults.tar.bz2 failed"
90 export ASL="${S}"/generate/unix/bin${BITS}/iasl \
91 acpiexec="${S}"/generate/unix/bin${BITS}/acpiexec \
92 ASLTSDIR="${WORKDIR}/${MY_TESTS_P}"/tests/aslts
93 export PATH="${PATH}:${ASLTSDIR}/bin"
94 echo "$ASLTSDIR" >"${T}"/asltdir
96 edos2unix $(find . -type 'f')
97 make install || die "make install aslts test failed"
98 chmod +x $(find bin/ ! -regex 'ERROR_OPCODES|HOW_TO_USE|README' ) || die "chmod bin +x failed"
100 #The below Do commands runs the tests twice and then dies if the results aren't
102 Do 1 || die "failed Do 1"
103 Do 2 || die "failed Do 2"
107 mv "${WORKDIR}/${MY_TESTS_P}/tests/aapits" "${S}/tools/" || die "mv failed"
108 cd "${S}/tools/aapits" || die "cannot find ${S}/tools/aapits"
109 edos2unix $(find . -type 'f')
110 chmod +x $(find bin/ | sed -r -e '/\/[A-Z_]+$/d') || die "chmod bin +x failed"
111 make || die "make in aapits failed"
112 cd asl || die "cd asl failed"
113 make || die "make in asl failed"
115 ./aapitsrun || die "aapitsrun failed"