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 $
9 inherit toolchain-funcs flag-o-matic eutils
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 )"
21 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-fbsd ~x86-fbsd"
24 DEPEND="sys-devel/bison
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.'
41 find "${S}" -type f -name 'Makefile*' -print0 | \
43 sed -r -e 's:-\<Werror\>::g' -i '{}' \
54 cd acpica/generate/unix
61 #The aapits test currently fails, missing include probably.
65 cd acpica/generate/unix
66 emake install DESTDIR="${D}" BITS=${BITS}
69 #for bin in $(<"${T}"/binlist) ; do
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
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"
84 dodir /usr/share/${PF}
85 insinto /usr/share/${PF}
86 doins ${tb} || die "doins testresults.tar.bz2 failed"
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
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"
102 #The below Do commands runs the tests twice and then dies if the results aren't
104 Do 1 || die "failed Do 1"
105 Do 2 || die "failed Do 2"
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"
117 ./aapitsrun || die "aapitsrun failed"