1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs flag-o-matic
10 MY_TESTS_P="${MY_PN/ca/tests}-${PV}"
11 DESCRIPTION="Intel ACPI Source Language (ASL) compiler"
12 HOMEPAGE="https://www.acpica.org/downloads/"
13 SRC_URI="http://www.acpica.org/sites/acpica/files/${MY_P}.tar.gz
14 test? ( http://www.acpica.org/sites/acpica/files/${MY_TESTS_P}.tar.gz )"
18 KEYWORDS="amd64 ~arm64 ppc x86"
20 RESTRICT="!test? ( test )"
22 DEPEND="sys-devel/bison
26 S="${WORKDIR}/${MY_P}"
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 "${FILESDIR}/${PN}-20140828-locale.patch"
40 "${FILESDIR}/${PN}-20140214-nostrip.patch"
46 find "${S}" -type f -name 'Makefile*' -print0 | \
48 sed -r -e 's:-\<Werror\>::g' -e "s:/usr:${EPREFIX}/usr:g" \
52 # BITS is tied to ARCH - please set appropriately if you add new keywords
53 if [[ $ARCH == @(amd64|amd64-fbsd) ]] ; then
65 cd generate/unix || die
71 #The aapits test currently fails, missing include probably.
76 cd generate/unix || die
77 emake install DESTDIR="${D}" BITS=${BITS}
80 #for bin in $(<"${T}"/binlist) ; do
83 dodoc "${S}"/changes.txt
84 newdoc "${S}"/source/compiler/readme.txt compiler-readme.txt
85 newdoc "${S}"/generate/unix/readme.txt unix-readme.txt
86 newdoc "${S}"/generate/lint/readme.txt lint-readme.txt
87 newdoc "${S}"/source/compiler/new_table.txt compiler-new_table.txt
89 if use test && has test ${FEATURES}; then
90 tb="${T}"/testresults.tar.bz2
91 export ASLTSDIR="$(<"${T}"/asltdir)"
92 ebegin "Creating Test Tarball"
93 tar -cjf "${tb}" -C "${ASLTSDIR}"/tmp/RESULTS . || die "tar failed"
95 dodir /usr/share/${PF}
96 insinto /usr/share/${PF}
103 export ASL="${S}"/generate/unix/bin/iasl \
104 acpibin="${S}"/generate/unix/bin/acpibin \
105 acpiexec="${S}"/generate/unix/bin/acpiexec \
106 ASLTSDIR="${WORKDIR}/${MY_TESTS_P}"/tests/aslts
107 export PATH="${PATH}:${ASLTSDIR}/bin"
108 echo "$ASLTSDIR" >"${T}"/asltdir
109 cd "${ASLTSDIR}" || die
110 edos2unix $(find . -type 'f')
111 make install || die "make install aslts test failed"
112 chmod +x $(find bin/ ! -regex 'ERROR_OPCODES|HOW_TO_USE|README' ) || die "chmod bin +x failed"
114 #The below Do commands runs the tests twice and then dies if the results aren't
116 Do 1 || die "failed Do 1"
117 Do 2 || die "failed Do 2"
121 mv "${WORKDIR}/${MY_TESTS_P}/tests/aapits" "${S}/tools/" || die "mv failed"
122 cd "${S}/tools/aapits" || die "cannot find ${S}/tools/aapits"
123 edos2unix $(find . -type 'f')
124 chmod +x $(find bin/ | sed -r -e '/\/[A-Z_]+$/d') || die "chmod bin +x failed"
125 make || die "make in aapits failed"
126 cd asl || die "cd asl failed"
127 make || die "make in asl failed"
129 ./aapitsrun || die "aapitsrun failed"